import type { TaskAssignment, InputResponse } from '../types/index.js'; import type { AgentWebSocketClient } from '../daemon/ws-client.js'; export type AgentType = 'claude-code' | 'openclaw'; export interface AgentConfig { type: AgentType; openclawGatewayUrl?: string; } /** * AgentAdapter abstracts how a task gets executed. * Each agent type implements this interface. */ export interface AgentAdapter { readonly type: AgentType; readonly displayName: string; /** * Check if this agent is available/reachable on this machine. */ checkHealth(): Promise<{ ok: boolean; message: string; }>; /** * Handle a task assignment end-to-end: * plan → execute → report progress/results via ws. */ handleTask(task: TaskAssignment, ws: AgentWebSocketClient, pendingInputResolvers: Map void>, signal?: AbortSignal, pendingPermissionResolvers?: Map void>): Promise; /** * Get current agent performance metrics. */ getMetrics?(): Record; /** * Clean up resources on shutdown. */ dispose(): Promise; }