"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('epics_search', {
        description: 'Semantic search over epics. Returns matching epics ranked by relevance.',
        inputSchema: {
            query: zod_1.z.string().min(1).max(defaults_1.MAX_SEARCH_QUERY_LEN).describe('Search query'),
            topK: zod_1.z.number().int().positive().max(defaults_1.MAX_SEARCH_TOP_K).optional().describe('Max results'),
            minScore: zod_1.z.number().min(0).max(1).optional().describe('Minimum relevance score'),
            searchMode: zod_1.z.enum(['hybrid', 'vector', 'keyword']).optional().describe('Search mode'),
        },
    }, async ({ query, topK, minScore, searchMode }) => {
        const results = await mgr.searchEpics(query, { topK, minScore, searchMode });
        return { content: [{ type: 'text', text: JSON.stringify(results, null, 2) }] };
    });
}
