"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.register = register;
const zod_1 = require("zod");
function register(server, mgr) {
    server.registerTool('files_get_info', {
        description: 'Get full metadata for a specific file or directory by path. ' +
            'For files: returns filePath, kind, fileName, directory, extension, language, mimeType, size, mtime, and crossLinks (notes/tasks linking to this file). ' +
            'For directories: returns filePath, kind, fileName, directory, fileCount, size (total of direct children). ' +
            'Use "." for the project root.',
        inputSchema: {
            filePath: zod_1.z.string().min(1).max(4096).describe('Relative file or directory path (e.g. "src/lib/config.ts" or "src/lib")'),
        },
    }, async ({ filePath }) => {
        const info = mgr.getFileInfo(filePath);
        if (!info) {
            return { content: [{ type: 'text', text: 'File or directory not found' }], isError: true };
        }
        const { mimeType: _, ...rest } = info;
        return { content: [{ type: 'text', text: JSON.stringify(rest, null, 2) }] };
    });
}
