/** * AcpTaskAdapter, bridges ACP remote subagent tasks (managed by AcpManager) * into the unified RuntimeTask registry. * * Each spawned ACP subagent gets a corresponding RuntimeTask of kind 'acp'. * The adapter maps SubagentStatus strings to task lifecycle transitions. */ import type { RuntimeStore } from '../../store/index.js'; import type { SubagentStatus } from '../../../acp/protocol.js'; import type { AcpManager } from '../../../acp/manager.js'; /** * Bridges ACP remote subagent tasks into the RuntimeTask registry. * * NOTE: This adapter writes directly to the Zustand store for performance, * bypassing TaskManager. Lifecycle validation is the caller's responsibility. * This is intentional, adapters are authoritative sources for their subsystem. * * @example * ```ts * const adapter = new AcpTaskAdapter(store); * const taskId = adapter.wrapRemoteTask(acpId, 'Refactor auth module'); * adapter.handleRemoteUpdate(acpId, 'complete'); * ``` */ export declare class AcpTaskAdapter { private readonly _store; /** Maps ACP remote ID → task ID. */ private readonly _remoteToTask; /** Maps task ID → ACP remote ID. */ private readonly _taskToRemote; private readonly _dispatch; constructor(_store: RuntimeStore); /** * Wrap an ACP remote subagent task as a RuntimeTask. * * @param remoteId - The ACP subagent ID from AcpManager.spawn(). * @param title - Human-readable title for display in the task monitor. * @returns The new task ID. */ wrapRemoteTask(remoteId: string, title: string): string; /** * Handle an ACP status update and transition the task accordingly. * * @param remoteId - The ACP subagent ID. * @param status - New status string (SubagentStatus). */ handleRemoteUpdate(remoteId: string, status: SubagentStatus): void; /** * Cancel an ACP remote task by task ID. * Cancels the underlying ACP connection via AcpManager and marks the task cancelled. * * @param taskId - The RuntimeTask ID to cancel. * @param manager - The AcpManager instance to use for cancellation. */ cancelRemote(taskId: string, manager?: AcpManager): void; /** * Reconcile adapter state with the current AcpManager snapshot. * * @param manager - The AcpManager whose active subagents to sync from. */ sync(manager: AcpManager): void; private _upsertTask; private _transitionTask; } //# sourceMappingURL=acp-adapter.d.ts.map