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

/**
 * NetaClaw 会话
 */
@Entity('netaclaw_session')
export class NetaClawSessionEntity extends BaseEntity {
  @Column({ comment: '会话ID', unique: true })
  sessionId: string;

  @Column({ comment: '用户ID', nullable: true })
  userId: string;

  @Column({ comment: 'Agent名称' })
  agentName: string;

  @Column({ comment: 'Agent ID（关联 netaclaw_agent）', nullable: true })
  agentId: number;

  @Column({ comment: '会话标题', nullable: true })
  title: string;

  @Column({ comment: '使用的模型', nullable: true })
  model: string;

  @Column({ comment: '状态: active/archived', default: 'active' })
  status: string;

  @Column({ type: 'json', comment: '元数据', nullable: true })
  metadata: Record<string, unknown>;
}
