// tools/register-dashboard-tools.ts — Registers start_dashboard and stop_dashboard on the MCP server.
import { z } from 'zod';
import { safe } from './safe-handler.js';
import { handleStartDashboard, handleStopDashboard } from './dashboard.js';
export function registerDashboardTools(server) {
    // start_dashboard
    server.registerTool('start_dashboard', {
        description: 'Start a local web dashboard at http://localhost:5050 (or a custom port) that shows ' +
            'all your projects, specs, progress bars, and health metrics. ' +
            'Open the URL in your browser after calling this tool.',
        inputSchema: {
            port: z
                .number()
                .int()
                .min(1024)
                .max(65535)
                .optional()
                .describe('Port to serve the dashboard on (default: 5050, range: 1024-65535). Falls back to port+1, +2, +3 if busy.'),
            open_browser: z
                .boolean()
                .optional()
                .describe('Auto-open the dashboard URL in the default browser (default: false)'),
        },
        annotations: { title: 'Start Dashboard', readOnlyHint: true },
    }, safe(async (args) => handleStartDashboard(args)));
    // stop_dashboard
    server.registerTool('stop_dashboard', {
        description: 'Stop the Planu web dashboard and release the port.',
        inputSchema: {},
        annotations: { title: 'Stop Dashboard', readOnlyHint: false },
    }, safe(async (args) => handleStopDashboard(args)));
}
//# sourceMappingURL=register-dashboard-tools.js.map