/**
 * PTY manager initialization — extracted from PTYService.initialize().
 *
 * Creates either a BunCompatiblePTYManager (for Bun runtime) or PTYManager
 * (for Node), wires up event handlers, and returns the configured manager.
 *
 * @module services/pty-init
 */
import { BunCompatiblePTYManager, PTYManager, type StallClassification } from "pty-manager";
import type { CompletionMethod } from "./agent-metrics.ts";
import type { PTYServiceConfig } from "./pty-types.ts";
/**
 * All callbacks and state that the initialization logic needs
 * from the surrounding PTYService instance.
 */
export interface InitContext {
    serviceConfig: PTYServiceConfig;
    classifyStall: (sessionId: string, recentOutput: string) => Promise<StallClassification | null>;
    emitEvent: (sessionId: string, event: string, data: unknown) => void;
    handleGeminiAuth: (sessionId: string) => void;
    sessionOutputBuffers: Map<string, string[]>;
    taskResponseMarkers: Map<string, number>;
    metricsTracker: {
        recordCompletion(type: string, method: CompletionMethod, durationMs: number): void;
    };
    traceEntries: Array<string | Record<string, unknown>>;
    maxTraceEntries: number;
    log: (msg: string) => void;
    handleWorkerExit?: (info: {
        code: number | null;
        signal: string | null;
    }) => void;
    /** Check if a session has an active task in the coordinator. */
    hasActiveTask?: (sessionId: string) => boolean;
    /** Check if a session's task has started work (task delivered or decisions made). */
    hasTaskActivity?: (sessionId: string) => boolean;
    /** Mark a session's task as delivered (initial ready event processed). */
    markTaskDelivered?: (sessionId: string) => void;
}
/** Value returned by {@link initializePTYManager}. */
export interface InitResult {
    manager: PTYManager | BunCompatiblePTYManager;
    usingBunWorker: boolean;
}
/**
 * Create and configure a PTY manager for the current runtime.
 *
 * - **Bun**: instantiates a {@link BunCompatiblePTYManager} that spawns a
 *   Node worker process and communicates via JSON-RPC over stdio.
 * - **Node**: instantiates a {@link PTYManager} directly and registers
 *   all built-in adapters in-process.
 */
export declare function initializePTYManager(ctx: InitContext): Promise<InitResult>;
//# sourceMappingURL=pty-init.d.ts.map