mycoder-agent
Version:
Agent module for mycoder - an AI-powered software development assistant
58 lines • 1.63 kB
TypeScript
import { ToolAgentResult } from '../../core/toolAgent/types.js';
import { ToolContext } from '../../core/types.js';
export declare enum AgentStatus {
RUNNING = "running",
COMPLETED = "completed",
ERROR = "error",
TERMINATED = "terminated"
}
export interface Agent {
id: string;
status: AgentStatus;
startTime: Date;
endTime?: Date;
goal: string;
result?: string;
error?: string;
}
export interface AgentState {
id: string;
goal: string;
prompt: string;
output: string;
capturedLogs: string[];
completed: boolean;
error?: string;
result?: ToolAgentResult;
context: ToolContext;
workingDirectory: string;
tools: unknown[];
aborted: boolean;
parentMessages: string[];
}
export declare class AgentTracker {
ownerAgentId: string | undefined;
private agents;
private agentStates;
constructor(ownerAgentId: string | undefined);
registerAgent(goal: string): string;
registerAgentState(id: string, state: AgentState): void;
updateAgentStatus(id: string, status: AgentStatus, metadata?: {
result?: string;
error?: string;
}): boolean;
getAgentState(id: string): AgentState | undefined;
getAgent(id: string): Agent | undefined;
getAgents(status?: AgentStatus): Agent[];
/**
* Get list of active agents with their descriptions
*/
getActiveAgents(): Array<{
id: string;
description: string;
status: AgentStatus;
}>;
cleanup(): Promise<void>;
terminateAgent(id: string): Promise<void>;
}
//# sourceMappingURL=AgentTracker.d.ts.map