// tools/register-model-tools.ts — Registers the recommend_model MCP tool.
// SPEC-076
import { z } from 'zod';
import { handleRecommendModel } from './recommend-model-handler.js';
import { safeLicensed } from './safe-handler.js';
export function registerModelTools(server) {
    server.registerTool('recommend_model', {
        description: 'Recommend the best AI model tier (haiku, sonnet, or opus) for a given task or spec. ' +
            'Analyzes complexity signals, applies configurable rules, learns from past outcomes, ' +
            'and estimates token cost in USD. Returns a recommendation with reasoning and alternatives.',
        inputSchema: {
            specId: z
                .string()
                .optional()
                .describe('Optional spec ID to analyse (e.g., "SPEC-076"). ' +
                'The router will extract complexity signals from the spec content.'),
            taskDescription: z
                .string()
                .optional()
                .describe('Optional natural-language description of the task. ' +
                'Used to infer complexity signals when no specId is provided.'),
            signals: z
                .object({
                criteriaCount: z.number().optional().describe('Number of acceptance criteria.'),
                fileCount: z.number().optional().describe('Number of files to create or modify.'),
                dependencyDepth: z.number().optional().describe('Depth of dependency chain.'),
                crossLayerCount: z
                    .number()
                    .optional()
                    .describe('Number of architectural layers involved.'),
                hasNewTypes: z.boolean().optional().describe('Whether new types are introduced.'),
                hasDBChanges: z.boolean().optional().describe('Whether database changes are needed.'),
                hasSecurityImplications: z
                    .boolean()
                    .optional()
                    .describe('Whether the task has security implications.'),
                estimatedHours: z.number().optional().describe('Estimated hours to complete.'),
                isReadOnly: z.boolean().optional().describe('Whether the task is read-only.'),
                taskType: z
                    .enum(['search', 'generation', 'architecture', 'debugging', 'refactor'])
                    .optional()
                    .describe('Type of task: search | generation | architecture | debugging | refactor'),
            })
                .optional()
                .describe('Optional explicit complexity signals. Overrides signals extracted from text.'),
        },
        annotations: { title: 'Recommend Model', readOnlyHint: true },
    }, safeLicensed('recommend_model', (args) => Promise.resolve(handleRecommendModel(args))));
}
//# sourceMappingURL=register-model-tools.js.map