// tools/register-migration-tools.ts — Registers tech migration tool (SPEC-028a + SPEC-028b)
import { z } from 'zod';
import { t } from '../i18n/index.js';
import { handleMigrateTech } from './migrate-tech.js';
import { safeLicensed } from './safe-handler.js';
const MigrateTechActionEnum = z.enum([
    'analyze',
    'map',
    'plan',
    'strategy',
    'validate',
    'analyze-db',
    'map-db',
    'plan-db',
    // SPEC-028b
    'analyze-services',
    'map-services',
    'plan-services',
    'validate-service',
    'rollback-plan',
    'checkpoint',
    'rollback',
    'feature-flags',
    'status',
    // SPEC-050 S4: Build tool migration paths
    'webpack-to-vite',
    'vite6-to-vite7',
    // SPEC-054 S4: Detect pending major migrations
    'detect-pending',
]);
export function registerMigrationTools(server) {
    // migrate_tech — SPEC-028a
    server.registerTool('migrate_tech', {
        description: t('tools.migrate_tech.description'),
        annotations: { readOnlyHint: false },
        inputSchema: {
            action: MigrateTechActionEnum.describe('Migration action: analyze | map | plan | strategy | validate | analyze-db | map-db | plan-db | analyze-services | map-services | plan-services | validate-service | rollback-plan | checkpoint | rollback | feature-flags | status | webpack-to-vite | vite6-to-vite7 | detect-pending'),
            projectId: z.string().max(500).describe('Project ID'),
            projectPath: z
                .string()
                .max(4096)
                .optional()
                .describe('Absolute path to project root (for analyze action)'),
            sourceStack: z
                .string()
                .max(500)
                .optional()
                .describe('Source technology stack (e.g. "java-spring", "php-laravel", "express") — required for map/plan/strategy'),
            targetStack: z
                .string()
                .max(500)
                .optional()
                .describe('Target technology stack (e.g. "go", "node-typescript", "fastify") — required for map/plan/strategy'),
            component: z
                .string()
                .max(500)
                .optional()
                .describe('Component name to validate (required for validate action)'),
            sourceDbEngine: z
                .string()
                .max(500)
                .optional()
                .describe('Source database engine (e.g. "postgresql", "mysql", "mongodb") — required for analyze-db/map-db/plan-db'),
            targetDbEngine: z
                .string()
                .max(500)
                .optional()
                .describe('Target database engine — required for map-db/plan-db'),
            existingAnalysisId: z
                .string()
                .max(500)
                .optional()
                .describe('ID of a previous analyze result to reuse for plan/strategy actions'),
        },
    }, safeLicensed('migrate_tech', async (args) => handleMigrateTech(args)));
}
//# sourceMappingURL=register-migration-tools.js.map