// tools/register-transform-tools.ts — Registers SPEC-077 transform_code MCP tool (AC-09).
import { z } from 'zod';
import { safeLicensed } from './safe-handler.js';
import { handleTransformCode } from './transform-code-handler.js';
export function registerTransformTools(server) {
    server.registerTool('transform_code', {
        description: 'Apply deterministic code transformations using the TypeScript Compiler API. ' +
            'Supports: rename-symbol, add-types, add-error-handling, modernize-syntax, extract-interface, add-jsdoc. ' +
            'Returns the transformed source code with a list of changes made.',
        inputSchema: {
            source: z.string().describe('The source code to transform'),
            intent: z
                .string()
                .describe('Transform intent: rename-symbol | add-types | add-error-handling | modernize-syntax | extract-interface | add-jsdoc'),
            options: z
                .record(z.string(), z.unknown())
                .optional()
                .describe('Intent-specific options. rename-symbol: {oldName, newName}. add-types: {inferFromUsage}. ' +
                'add-error-handling: {style: "rethrow"|"return-null"|"log-and-rethrow"}. ' +
                'modernize-syntax: {varToConst, requireToImport, moduleExportsToExport, templateLiterals}. ' +
                'extract-interface: {className, interfaceName}. add-jsdoc: {includeParams, includeReturns, includeThrows}.'),
        },
        annotations: {
            title: 'Transform Code',
            readOnlyHint: true,
        },
    }, safeLicensed('transform_code', (args) => Promise.resolve(handleTransformCode(args))));
}
//# sourceMappingURL=register-transform-tools.js.map