// tools/register-license-tools.ts — Registers license management tools on the MCP server.
// These tools are always accessible (no license gate) — they manage the license itself.
import { z } from 'zod';
import { safe } from './safe-handler.js';
import { handleActivateLicense, handleDeactivateLicense } from './activate-license.js';
import { handleLicenseStatus } from './license-status.js';
export function registerLicenseTools(server) {
    // activate_license
    server.registerTool('activate_license', {
        description: 'Activate a Planu license key to unlock Pro/Team/Enterprise features. ' +
            'Get your key at https://planu.dev/pricing.',
        inputSchema: {
            licenseKey: z.string().describe('License key from Lemon Squeezy (e.g. XXXXXXXX-XXXX-...)'),
            instanceName: z
                .string()
                .optional()
                .describe('Optional name for this machine (defaults to hostname)'),
        },
        annotations: { title: 'Activate License', readOnlyHint: false },
    }, safe(async (args) => handleActivateLicense(args)));
    // deactivate_license
    server.registerTool('deactivate_license', {
        description: 'Deactivate your Planu license on this machine. ' +
            'Frees up the activation slot so you can use it elsewhere.',
        inputSchema: {
            confirm: z
                .boolean()
                .describe('Set to true to confirm deactivation. This reverts to the Free plan.'),
        },
        annotations: { title: 'Deactivate License', destructiveHint: true },
    }, safe(async (args) => handleDeactivateLicense(args)));
    // license_status
    server.registerTool('license_status', {
        description: 'Show your current Planu plan, limits, usage, and upgrade options.',
        inputSchema: {
            projectId: z
                .string()
                .optional()
                .describe('Optional project ID to include project-specific usage'),
        },
        annotations: { title: 'License Status', readOnlyHint: true },
    }, safe(async (args) => handleLicenseStatus(args)));
}
//# sourceMappingURL=register-license-tools.js.map