/** * OpenKernel — Command System * * The canonical OpenKernel slash-command surface from the spec: * /status /workers /logs /pause /resume /retry /models /providers * /checkpoints /goal (+ /missions /cancel /help) * * One registry, reused everywhere: the CLI console REPL and notification * plugins (Telegram/Discord/Slack) all dispatch through `kernel.command(...)`, * so behavior is defined once. Each command returns a renderable `CommandResult` * (text) so any surface can display it. */ import type { Kernel } from './kernel.js'; import type { CommandResult } from './types.js'; import type { Federation } from './federation/federation.js'; export interface CommandContext { kernel: Kernel; /** The mesh node, when the kernel is running under `serve`/`mcp`. */ federation?: Federation; args: string[]; raw: string; } export interface KernelCommand { name: string; aliases?: string[]; description: string; usage?: string; run(ctx: CommandContext): Promise | CommandResult; } export declare const DEFAULT_COMMANDS: KernelCommand[]; export declare class KernelCommandRegistry { private kernel; private commands; private aliases; constructor(kernel: Kernel); register(cmd: KernelCommand): void; list(): KernelCommand[]; resolve(name: string): KernelCommand | undefined; execute(input: string): Promise; }