"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.register = register;
const zod_1 = require("zod");
function register(server, mgr) {
    server.registerTool('epics_link_task', {
        description: 'Link a task to an epic (belongs_to relationship). A task can belong to multiple epics.',
        inputSchema: {
            taskId: zod_1.z.string().min(1).max(500).describe('Task ID to link'),
            epicId: zod_1.z.string().min(1).max(500).describe('Epic ID to link to'),
        },
    }, async ({ taskId, epicId }) => {
        const ok = mgr.linkTaskToEpic(taskId, epicId);
        if (!ok)
            return { content: [{ type: 'text', text: 'Failed to link — task or epic not found, or already linked' }], isError: true };
        return { content: [{ type: 'text', text: JSON.stringify({ taskId, epicId, linked: true }, null, 2) }] };
    });
}
