"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.register = register;
const zod_1 = require("zod");
function register(server, mgr) {
    server.registerTool('tasks_delete', {
        description: 'Delete a task and all its edges (relations, cross-graph links). ' +
            'Orphaned proxy nodes are cleaned up automatically. ' +
            'This action is irreversible.',
        inputSchema: {
            taskId: zod_1.z.string().min(1).max(500).describe('Task ID to delete (slug, e.g. "fix-auth-redirect-loop")'),
        },
    }, async ({ taskId }) => {
        const deleted = mgr.deleteTask(taskId);
        if (!deleted) {
            return { content: [{ type: 'text', text: 'Task not found' }], isError: true };
        }
        return { content: [{ type: 'text', text: JSON.stringify({ taskId, deleted: true }, null, 2) }] };
    });
}
