"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SubAgent = void 0;
const typeorm_1 = require("typeorm");
const swagger_1 = require("@nestjs/swagger");
const base_entity_1 = require("../core-entities/base.entity");
const system_prompt_entity_1 = require("../core-entities/system-prompt.entity");
const context_template_entity_1 = require("../core-entities/context-template.entity");
let SubAgent = class SubAgent extends base_entity_1.BaseEntity {
};
exports.SubAgent = SubAgent;
__decorate([
    (0, swagger_1.ApiProperty)({
        description: 'Name of this sub-agent',
        example: 'Bug Fixer',
    }),
    (0, typeorm_1.Column)({ type: 'text' }),
    __metadata("design:type", String)
], SubAgent.prototype, "name", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({
        description: 'Description of what this sub-agent does',
        example: 'Specialized in identifying and fixing bugs in code',
    }),
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], SubAgent.prototype, "description", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({
        description: 'UUID of the system prompt for this sub-agent',
        format: 'uuid',
    }),
    (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
    __metadata("design:type", String)
], SubAgent.prototype, "system_prompt_id", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({
        description: 'The system prompt entity for this sub-agent',
        type: () => system_prompt_entity_1.SystemPrompt,
    }),
    (0, typeorm_1.ManyToOne)(() => system_prompt_entity_1.SystemPrompt, {
        nullable: true,
        onDelete: 'SET NULL',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'system_prompt_id' }),
    __metadata("design:type", system_prompt_entity_1.SystemPrompt)
], SubAgent.prototype, "systemPrompt", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({
        description: 'UUID of context template for initial prompts',
        format: 'uuid',
    }),
    (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
    __metadata("design:type", String)
], SubAgent.prototype, "context_template_id", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({
        description: 'The context template entity for initial prompts',
        type: () => context_template_entity_1.ContextTemplate,
    }),
    (0, typeorm_1.ManyToOne)(() => context_template_entity_1.ContextTemplate, {
        nullable: true,
        onDelete: 'SET NULL',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'context_template_id' }),
    __metadata("design:type", context_template_entity_1.ContextTemplate)
], SubAgent.prototype, "contextTemplate", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({
        description: 'UUID of context template for follow-up prompts',
        format: 'uuid',
    }),
    (0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
    __metadata("design:type", String)
], SubAgent.prototype, "followup_context_template_id", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({
        description: 'The context template entity for follow-up prompts',
        type: () => context_template_entity_1.ContextTemplate,
    }),
    (0, typeorm_1.ManyToOne)(() => context_template_entity_1.ContextTemplate, {
        nullable: true,
        onDelete: 'SET NULL',
    }),
    (0, typeorm_1.JoinColumn)({ name: 'followup_context_template_id' }),
    __metadata("design:type", context_template_entity_1.ContextTemplate)
], SubAgent.prototype, "followupContextTemplate", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({
        description: 'Array of tool names this sub-agent can use. null = all tools, [] = no tools',
        example: ['create_file', 'overwrite_file', 'delete_file'],
        type: 'array',
    }),
    (0, typeorm_1.Column)({ type: 'json', nullable: true }),
    __metadata("design:type", Array)
], SubAgent.prototype, "enabled_tools", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({
        description: 'Enabled MCP tools: null (no MCP tools), "all", or array of serverName__toolName identifiers',
        example: 'all',
    }),
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], SubAgent.prototype, "enabled_mcp_tools", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({
        description: 'Whether this sub-agent is active/available',
        example: true,
        default: true,
    }),
    (0, typeorm_1.Column)({ type: 'boolean', default: true }),
    __metadata("design:type", Boolean)
], SubAgent.prototype, "is_active", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({
        description: 'Model ID to use for this sub-agent',
        example: 'ollama/glm-5.1:cloud',
    }),
    (0, typeorm_1.Column)({ type: 'text', nullable: true }),
    __metadata("design:type", String)
], SubAgent.prototype, "model_id", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({
        description: 'Whether this is a built-in seed sub-agent (immutable)',
        example: false,
        default: false,
    }),
    (0, typeorm_1.Column)({ type: 'boolean', default: false }),
    __metadata("design:type", Boolean)
], SubAgent.prototype, "is_builtin", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({
        description: 'Unique key for built-in sub-agents (used for version updates)',
        example: 'explore-codebase',
    }),
    (0, typeorm_1.Column)({ type: 'text', nullable: true, unique: true }),
    __metadata("design:type", String)
], SubAgent.prototype, "builtin_key", void 0);
exports.SubAgent = SubAgent = __decorate([
    (0, typeorm_1.Entity)('sub_agents')
], SubAgent);
//# sourceMappingURL=sub-agent.entity.js.map