// tools/register-search-tools.ts — Registers the semantic_search tool on the MCP server.
// SPEC-075 AC-07: TF-IDF + vector search across specs, patterns, knowledge, decisions.
import { z } from 'zod';
import { safeLicensed } from './safe-handler.js';
import { handleSemanticSearch } from './semantic-search-handler.js';
/**
 * Registers the semantic_search tool (SPEC-075) on the MCP server.
 * Pro tier: semantic search across project knowledge.
 */
export function registerSearchTools(server) {
    server.registerTool('semantic_search', {
        description: 'Search your project knowledge (specs, patterns, decisions, learned knowledge) by meaning — ' +
            'not just by exact text. Uses TF-IDF embeddings to find semantically similar documents. ' +
            'Requires init_project first.',
        inputSchema: {
            projectId: z.string().describe('Project ID returned by init_project'),
            query: z.string().describe('Natural language search query'),
            scope: z
                .enum(['spec', 'pattern', 'knowledge', 'decision', 'all'])
                .default('all')
                .describe('Scope: spec | pattern | knowledge | decision | all'),
            topK: z.number().default(5).describe('Maximum results to return (default 5)'),
            threshold: z
                .number()
                .default(0.3)
                .describe('Minimum similarity threshold 0-1 (default 0.3)'),
        },
        annotations: {
            title: 'Semantic Search',
            readOnlyHint: true,
        },
    }, safeLicensed('semantic_search', async (args) => handleSemanticSearch(args)));
}
//# sourceMappingURL=register-search-tools.js.map