/** * Command Registry Utility * Manages an append-only (or rotating) chronologically-ordered feed of background platformio events. * * Provides: * - registerCommand: Records a new command execution to the registry. * - updateCommandStatus: Modifies the status or exit details of an existing command. * - getCommandHistory: Retrieves the list of historically executing commands. */ /** * Historical record of an executed command spanning builds or serial monitors. */ export interface TaskRecord { taskId: string; type: "build" | "monitor" | "upload" | "test" | "debug"; status: "inactive" | "running" | "success" | "error" | "terminated"; logPaths?: string[]; port?: string; pid?: number; exitCode?: number; commandDesc?: string; error?: string; } export interface CommandRecord { id: string; commandDesc: string; timestamp: number; status: "running" | "success" | "error" | "terminated"; tasks: TaskRecord[]; mcpRequest?: any; mcpResponse?: any; mcpToolName?: string; source?: "agent" | "dashboard"; error?: string; } /** * Appends a new command record into the workspace command history, or appends an artifact if the command exists. * @param record Initial status details of the command being spun up * @param projectDir Optional specific workspace */ export declare function registerCommand(record: CommandRecord, projectDir?: string): Promise; /** * Searches and updates the fields of a given command record. * @param id Unique identifier to search for * @param updates Partial properties to overwrite on the discovered command * @param projectDir Optional specific workspace */ export declare function updateCommandStatus(id: string, updates: Partial, projectDir?: string): Promise; /** * Updates a specific nested task's status. */ export declare function updateTaskStatus(commandId: string, taskId: string, updates: Partial, projectDir?: string): Promise; /** * Returns a parsed Array of historic command records. * @param projectDir Optional specific workspace * @returns Array of CommandRecords currently saved in state */ export declare function getCommandHistory(projectDir?: string): CommandRecord[]; /** * Searches for a command record by ID across all known workspace registries. * Checks the global registry first, then iterates project-specific workspaces. * * This solves the case where a task was registered under a project-specific * workspace but the caller only has a taskId (no projectDir). * * @param taskId - The command ID to search for. * @returns The matching command, full history for its registry, and the resolved projectDir, or undefined if not found. */ export declare function findCommandAcrossWorkspaces(taskId: string): Promise<{ command: CommandRecord; history: CommandRecord[]; projectDir?: string; } | undefined>; //# sourceMappingURL=command-registry.d.ts.map