/**
 * Per-tenant agent skill entity.
 *
 * Skills are reusable script templates that the AI agent can execute.
 * Each skill has a category, script content, and can be enabled/disabled.
 */
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn } from 'typeorm';

@Entity('agent_skills')
export class AgentSkill {
  @PrimaryGeneratedColumn('uuid')
  id!: string;

  @Column({ type: 'varchar', length: 20 })
  tenantId!: string;

  @Column({ type: 'varchar', length: 100 })
  name!: string;

  @Column({ type: 'text', default: '' })
  description!: string;

  @Column({ type: 'varchar', length: 30, default: 'custom' })
  category!: string;

  @Column({ type: 'text', default: '' })
  script!: string;

  @Column({ type: 'varchar', array: true, default: '{}' })
  tags!: string[];

  @Column({ type: 'boolean', default: true })
  enabled!: boolean;

  @CreateDateColumn({ type: 'timestamptz' })
  createdAt!: Date;

  @UpdateDateColumn({ type: 'timestamptz' })
  updatedAt!: Date;
}
