"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.register = register;
const zod_1 = require("zod");
function register(server, mgr) {
    server.registerTool('notes_get', {
        description: 'Return the full content of a note by its ID. ' +
            'Returns id, title, content, tags, createdAt, updatedAt, and relations (including cross-graph links from/to tasks, docs, code, files).',
        inputSchema: {
            noteId: zod_1.z.string().min(1).max(500).describe('Note ID, e.g. "auth-uses-jwt-tokens"'),
        },
    }, async ({ noteId }) => {
        const note = mgr.getNote(noteId);
        if (!note) {
            return { content: [{ type: 'text', text: 'Note not found' }], isError: true };
        }
        const { embedding: _embedding, version: _version, ...rest } = note;
        const clean = (_k, v) => (v === null || (Array.isArray(v) && v.length === 0) ? undefined : v);
        return { content: [{ type: 'text', text: JSON.stringify(rest, clean, 2) }] };
    });
}
