UNPKG

@measey/mycoder-agent

Version:

Agent module for mycoder - an AI-powered software development assistant

56 lines 1.56 kB
import type { ChildProcess } from 'child_process'; export declare enum ShellStatus { RUNNING = "running", COMPLETED = "completed", ERROR = "error", TERMINATED = "terminated" } export type ProcessState = { process: ChildProcess; command: string; stdout: string[]; stderr: string[]; state: { completed: boolean; signaled: boolean; exitCode: number | null; }; showStdIn: boolean; showStdout: boolean; }; export interface ShellProcess { shellId: string; status: ShellStatus; startTime: Date; endTime?: Date; metadata: { command: string; exitCode?: number | null; signaled?: boolean; error?: string; [key: string]: any; }; } /** * Registry to keep track of shell processes */ export declare class ShellTracker { ownerAgentId: string | undefined; private shells; processStates: Map<string, ProcessState>; constructor(ownerAgentId: string | undefined); registerShell(command: string): string; updateShellStatus(shellId: string, status: ShellStatus, metadata?: Record<string, any>): boolean; getShells(status?: ShellStatus): ShellProcess[]; getShellById(shellId: string): ShellProcess | undefined; /** * Cleans up a shell process * @param shellId The ID of the shell process to clean up */ cleanupShellProcess(shellId: string): Promise<void>; /** * Cleans up all running shell processes */ cleanup(): Promise<void>; } //# sourceMappingURL=ShellTracker.d.ts.map