/**
 * AcpConnection — Per-subagent ACP connection.
 *
 * Spawns a child process via Bun.spawn and connects to it via ClientSideConnection
 * using ndJsonStream over stdio. Implements the ACP Client interface so the
 * subagent can request permissions and send session updates.
 */
import type { SubagentInfo, SubagentResult, SubagentTask } from '@pellux/goodvibes-sdk/platform/acp/protocol';
import type { PermissionRequestHandler } from '../permissions/prompt.js';
import type { RuntimeEventBus } from '../runtime/events/index.js';
import type { HookDispatcher } from '../hooks/index.js';
/**
 * AcpConnection manages the lifecycle of a single subagent child process.
 *
 * Lifecycle:
 *   1. Construct with spawn params
 *   2. Call run() — spawns child, performs ACP handshake, starts a session
 *   3. Resolves with SubagentResult when the subagent completes or is cancelled
 *   4. Call cancel() to abort
 */
export declare class AcpConnection {
    private task;
    readonly id: string;
    private info;
    private spawnCmd;
    private requestPermission;
    private runtimeBus;
    private conn;
    private sessionId;
    private childProcess;
    private toolCallsMade;
    private lastProgressText;
    private transportClosed;
    private readonly hookDispatcher;
    constructor(id: string, task: SubagentTask, spawnCmd: string[], requestPermission?: PermissionRequestHandler, runtimeBus?: RuntimeEventBus | null, hookDispatcher?: Pick<HookDispatcher, 'fire'> | null);
    /** Current info snapshot. */
    getInfo(): SubagentInfo;
    /**
     * Spawn the child process, perform the ACP handshake, and run the prompt.
     * Resolves with SubagentResult when the subagent completes or errors.
     */
    run(): Promise<SubagentResult>;
    /** Cancel the running subagent. */
    cancel(): Promise<void>;
    private emitterContext;
    private transportId;
    private transportEndpoint;
    private emitTransportInitializing;
    private emitTransportAuthenticating;
    private emitTransportConnected;
    private emitTransportSyncing;
    private emitTransportDisconnected;
    private emitTransportTerminalFailure;
    private fireTransportHook;
    private cleanup;
    private buildClientImpl;
    private buildPromptText;
}
//# sourceMappingURL=connection.d.ts.map