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

/**
 * desktop_op 全局配置(单行 — 通常 id=1)
 *
 * v4 注意:
 *  - 移除了 default_model_channel_id 字段(model 走 desktop agent 自己的 modelChannelId)
 */
@Entity('desktop_op_config')
export class DesktopOpConfigEntity extends BaseEntity {
  @Column({ comment: '应用白名单 JSON 数组', type: 'json' })
  allowedApps: string[];

  @Column({ comment: '额外危险按键 JSON 数组', type: 'json', nullable: true })
  extraDangerousKeys: string[] | null;

  @Column({ comment: '全局每分钟上限', default: 30 })
  globalPerMin: number;

  @Column({ comment: '全局每天上限', default: 1000 })
  globalPerDay: number;

  @Column({ comment: '默认水印 none / suffix / zero-width', length: 32, default: 'suffix' })
  defaultWatermark: string;
}
