UNPKG

@measey/mycoder-agent

Version:

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

62 lines 2.03 kB
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 AgentInfo { agentId: string; status: AgentStatus; startTime: Date; endTime?: Date; goal: string; result?: string; error?: string; prompt?: string; output: string; capturedLogs: string[]; completed: boolean; result_detailed?: ToolAgentResult; context?: ToolContext; workingDirectory?: string; tools?: unknown[]; aborted: boolean; parentMessages: string[]; } /** @deprecated Use AgentInfo instead */ export type Agent = AgentInfo; /** @deprecated Use AgentInfo instead */ export type AgentState = AgentInfo; export declare class AgentTracker { ownerAgentId: string | undefined; private agentInfos; constructor(ownerAgentId: string | undefined); /** * Register a new agent with basic information or update an existing agent with full state * @param goalOrState Either a goal string or a complete AgentInfo object * @param state Optional additional state information to set * @returns The agent ID */ registerAgent(goalOrState: string | Partial<AgentInfo>, state?: Partial<AgentInfo>): string; updateAgentStatus(agentId: string, status: AgentStatus, metadata?: { result?: string; error?: string; }): boolean; /** * Get an agent by ID * @param agentId The agent ID * @returns The agent info or undefined if not found */ getAgent(agentId: string): AgentInfo | undefined; /** * Get all agents, optionally filtered by status * @param status Optional status to filter by * @returns Array of agents */ getAgents(status?: AgentStatus): AgentInfo[]; cleanup(): Promise<void>; terminateAgent(agentId: string): Promise<void>; } //# sourceMappingURL=AgentTracker.d.ts.map