import { BaseEntity } from '../../base/entity/base.js';
import { Column, Entity, Index } from 'typeorm';

/**
 * NetaClaw Tool 全局治理配置
 */
@Entity('netaclaw_tool')
export class NetaClawToolEntity extends BaseEntity {
  @Index({ unique: true })
  @Column({ comment: 'Tool 名称', length: 100 })
  name: string;

  @Column({ comment: '显示名称', length: 200, nullable: true })
  label: string;

  @Index()
  @Column({ comment: '所属 toolset', length: 50 })
  toolset: string;

  @Column({ comment: '描述', type: 'text', nullable: true })
  description: string;

  @Column({ comment: '可见性', length: 20, nullable: true })
  visibility: string;

  @Column({ comment: '能力要求', length: 20, nullable: true })
  capability: string;

  @Index()
  @Column({ comment: '状态 0=禁用 1=启用', default: 1 })
  status: number;

  @Column({ comment: '是否核心工具', default: 0 })
  isCore: number;

  @Column({ comment: '是否允许禁用', default: 1 })
  canDisable: number;

  @Column({ comment: '是否支持 Prompt Hint', default: 0 })
  supportsPromptHint: number;

  @Column({ comment: 'Prompt Hint 覆写', type: 'text', nullable: true })
  promptHint: string;

  @Column({ comment: '排序', default: 0 })
  sort: number;

  @Column({ comment: '是否需要大模型配置 0否 1是', default: 0 })
  requiresModel: number;

  @Column({ comment: '关联模型渠道ID', nullable: true })
  modelChannelId: number;

  @Column({ comment: '关联模型ID', length: 100, nullable: true })
  modelId: string;

  @Column({ comment: '扩展字段', type: 'json', nullable: true })
  extra: Record<string, unknown>;
}
