/** * ACP domain state, tracks the Agent Client Protocol transport layer, * active subagent connections, and inter-session ACP sessions. */ import type { DaemonTransportState } from './daemon.js'; /** ACP transport state reuses the daemon transport lifecycle. */ export type AcpTransportState = DaemonTransportState; /** An active ACP subagent connection. */ export interface AcpConnection { /** Subagent ID. */ agentId: string; /** Human-readable label for this connection. */ label: string; /** ACP transport state for this specific connection. */ transportState: AcpTransportState; /** Epoch ms when the connection was established. */ connectedAt?: number | undefined; /** Whether the subagent has completed and the connection is being torn down. */ completing: boolean; /** Number of messages exchanged on this connection. */ messageCount: number; /** Number of protocol errors on this connection. */ errorCount: number; /** Last protocol error message. */ lastError?: string | undefined; /** Task associated with this ACP connection. */ taskId?: string | undefined; } /** * AcpDomainState, ACP protocol transport and connection state. */ export interface AcpDomainState { /** Monotonic revision counter; increments on every mutation. */ revision: number; /** Timestamp of last mutation (Date.now()). */ lastUpdatedAt: number; /** Subsystem that triggered the last mutation. */ source: string; /** Current ACP manager transport state. */ managerTransportState: AcpTransportState; /** Whether the ACP subsystem has been initialized. */ initialized: boolean; /** All ACP connections keyed by agentId. */ connections: Map; /** IDs of active (non-completing) connections. */ activeConnectionIds: string[]; /** Total subagents spawned via ACP this session. */ totalSpawned: number; /** Total ACP connections that completed successfully. */ totalCompleted: number; /** Total ACP connections that failed. */ totalFailed: number; /** Total messages exchanged across all connections. */ totalMessages: number; } /** * Returns the default initial state for the ACP domain. */ export declare function createInitialAcpState(): AcpDomainState; //# sourceMappingURL=acp.d.ts.map