"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.register = register;
const zod_1 = require("zod");
const defaults_1 = require("../../../lib/defaults");
function register(server, mgr) {
    server.registerTool('epics_create', {
        description: 'Create a new epic. Epics group related tasks and track progress. ' +
            'Returns the generated epicId. Use epics_link_task to add tasks.',
        inputSchema: {
            title: zod_1.z.string().min(1).max(defaults_1.MAX_TITLE_LEN).describe('Short epic title'),
            description: zod_1.z.string().max(defaults_1.MAX_DESCRIPTION_LEN).optional().describe('Epic description in markdown'),
            status: zod_1.z.enum(['open', 'in_progress', 'done', 'cancelled']).optional().describe('Status: "open" (default), "in_progress", "done", "cancelled"'),
            priority: zod_1.z.enum(['critical', 'high', 'medium', 'low']).optional().describe('Priority level'),
            tags: zod_1.z.array(zod_1.z.string().max(defaults_1.MAX_TAG_LEN)).max(defaults_1.MAX_TAGS_COUNT).optional().describe('Tags array'),
        },
    }, async ({ title, description, status, priority, tags }) => {
        const epicId = await mgr.createEpic(title, description ?? '', status ?? 'open', priority ?? 'medium', tags ?? []);
        return { content: [{ type: 'text', text: JSON.stringify({ epicId }, null, 2) }] };
    });
}
