import { ICliCommandAuthor } from './cli-command-author'; import { ICliCommandParameterDescriptor } from './cli-command-parameter-descriptor'; import { CliProcessCommand } from './cli-process-command'; import { CliStructuredResponse } from './cli-structured-response'; /** Contract for a CLI command processor that handles one command (and optionally sub-commands). */ export interface ICliCommandProcessor { /** Primary command keyword (e.g. "echo", "hash"). */ command: string; /** Short description shown in help/listing output. */ description: string; /** Author metadata for this processor. */ author: ICliCommandAuthor; /** When true, sub-commands not listed in {@link processors} are forwarded to this processor. */ allowUnlistedCommands?: boolean; /** When true, the command requires a positional value argument. */ valueRequired?: boolean; /** * When true, the command reads an optional positional value (`command.value`). * Implied by {@link valueRequired}. MCP exposes it as an optional `value` argument. */ acceptsValue?: boolean; /** Semantic version of this processor. */ version: string; /** Nested sub-command processors. */ processors?: ICliCommandProcessor[]; /** Parameter descriptors for this command. */ parameters?: ICliCommandParameterDescriptor[]; /** * Permissions required to execute this command (all of them), enforced * server-side when the users plugin protects the server. */ requiredPermissions?: string[]; /** * Executes the command and returns a plain-text result. * @param command - Parsed command with arguments. * @param signal - Optional AbortSignal to cancel the operation. * @returns Plain-text output string. */ handleAsync(command: CliProcessCommand, signal?: AbortSignal): Promise; /** * Executes the command and returns a structured response with typed outputs. * When implemented, takes precedence over {@link handleAsync}. * @param command - Parsed command with arguments. * @param signal - Optional AbortSignal to cancel the operation. * @returns Structured response containing exit code and typed outputs. */ handleStructuredAsync?(command: CliProcessCommand, signal?: AbortSignal): Promise; } /** * Abstract base class for CLI command processors with sensible defaults. * Extend this class and implement {@link handleAsync} to create a new command. */ export declare abstract class CliCommandProcessor implements ICliCommandProcessor { abstract command: string; abstract description: string; author: ICliCommandAuthor; allowUnlistedCommands?: boolean; valueRequired?: boolean; acceptsValue?: boolean; version: string; processors?: ICliCommandProcessor[]; parameters?: ICliCommandParameterDescriptor[]; requiredPermissions?: string[]; abstract handleAsync(command: CliProcessCommand, signal?: AbortSignal): Promise; handleStructuredAsync?(command: CliProcessCommand, signal?: AbortSignal): Promise; } //# sourceMappingURL=cli-command-processor.d.ts.map