"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('notes_create', {
        description: 'Create a new note or fact in the knowledge graph. ' +
            'The note is automatically embedded for semantic search. ' +
            'Returns the generated noteId (slug from title). ' +
            'Use create_relation to link notes together.',
        inputSchema: {
            title: zod_1.z.string().min(1).max(defaults_1.MAX_TITLE_LEN).describe('Short title for the note, e.g. "Auth uses JWT tokens"'),
            content: zod_1.z.string().max(defaults_1.MAX_NOTE_CONTENT_LEN).describe('Full text content of the note (markdown)'),
            tags: zod_1.z.array(zod_1.z.string().max(defaults_1.MAX_TAG_LEN)).max(defaults_1.MAX_TAGS_COUNT).optional().describe('Optional tags for filtering, e.g. ["architecture", "decision"]'),
        },
    }, async ({ title, content, tags }) => {
        const noteId = await mgr.createNote(title, content, tags ?? []);
        return { content: [{ type: 'text', text: JSON.stringify({ noteId }, null, 2) }] };
    });
}
