"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.register = register;
const zod_1 = require("zod");
function register(server, mgr) {
    server.registerTool('skills_link', {
        description: 'Create a directed relation between two skills. ' +
            '"depends_on": fromId depends on toId. ' +
            '"related_to": free association between skills. ' +
            '"variant_of": fromId is a variant of toId.',
        inputSchema: {
            fromId: zod_1.z.string().min(1).max(500).describe('Source skill ID'),
            toId: zod_1.z.string().min(1).max(500).describe('Target skill ID'),
            kind: zod_1.z.enum(['depends_on', 'related_to', 'variant_of']).describe('Relation type: "depends_on", "related_to", or "variant_of"'),
        },
    }, async ({ fromId, toId, kind }) => {
        const created = mgr.linkSkills(fromId, toId, kind);
        if (!created) {
            return { content: [{ type: 'text', text: 'Could not create relation — one or both skills not found, or relation already exists.' }], isError: true };
        }
        return { content: [{ type: 'text', text: JSON.stringify({ fromId, toId, kind, created: true }, null, 2) }] };
    });
}
