import { SlashCommandRegistry } from '../../../../core/commands/slash/registry.js';
import { createCoreSlashCommandModules } from '../../../../core/commands/slash/modules/core-command-modules.js';
import { controlPlaneSlashCommandExecutionContextService } from '../../../../server/services/control-plane/slash-command-execution-context-service.js';
const registry = new SlashCommandRegistry(createCoreSlashCommandModules());
/**
 * Exposes core slash-command semantics through the frontend-agnostic control plane.
 */
export class ControlPlaneSlashCommandsController {
    catalog() {
        return {
            commands: registry.commands().map(({ id, syntax, description, aliases }) => ({
                id,
                syntax,
                description,
                ...(aliases ? { aliases } : {}),
            })),
            hints: registry.hints(),
        };
    }
    async execute(args, command) {
        const result = await registry.run(controlPlaneSlashCommandExecutionContextService.create(args, registry.hints()), command.trim());
        return result ?? {
            handled: true,
            kind: 'message',
            message: `Unknown command: ${command.trim()}. Use the slash command hints to inspect available commands.`,
        };
    }
}
export const controlPlaneSlashCommandsController = new ControlPlaneSlashCommandsController();
//# sourceMappingURL=slash-commands-controller.js.map