import { type ProviderName } from "./providers"; import type { HostHeartbeatState, HostTransport } from "./pty-host/protocol"; import type { ManagedSession, PTYManagerOptions, StartForkSessionOptions, StartFreshSessionOptions, StartSessionOptions, UserMessage } from "./types"; export declare class LiveSessionManager { private runners; private remoteRunner; private options; constructor(options?: PTYManagerOptions); useRemoteRunner(transport: HostTransport): Promise; isRemote(): boolean; startRemoteHeartbeat(getState: () => HostHeartbeatState): void; start(sessionId: string, options: StartSessionOptions & { provider?: ProviderName; }): Promise; startFresh(options: StartFreshSessionOptions & { provider?: ProviderName; }): Promise; /** * Fork an existing conversation into a new session. Codex-only: `codex fork` * has no Claude Code equivalent, and there is no safe generic fallback — a * silent downgrade to resume would attach to the very writer the caller is * trying to leave alone. */ startFork(options: StartForkSessionOptions & { provider?: ProviderName; }): Promise; sendInput(sessionId: string, input: string): number; sendKeys(sessionId: string, keys: string): void; sendRawKeys(sessionId: string, keys: string): void; resize(sessionId: string, cols: number, rows: number): void; cancel(sessionId: string): void; killPid(pid: number): void; putOnHold(sessionId: string, signal?: NodeJS.Signals): void; getOutput(sessionId: string): string; getOutputLines(sessionId: string, maxLines: number): Promise; getInputHistory(sessionId: string): UserMessage[]; getSession(sessionId: string): ManagedSession | null; getPid(sessionId: string): number | null; hasSession(sessionId: string): boolean; listSessions(): ManagedSession[]; dispose(): void; private runnerFor; /** * Refuse before spawning when the provider's CLI is not on this machine. * * Without this the spawn "succeeds": on POSIX execvp fails inside the forked * child, so a session appears, exits ~12ms later with code 1 and no output, * and the caller is told only that it "exited before becoming ready" — or, * on the Claude resume path, is told nothing at all, since that path answers * 200 before the process has had a chance to die. Every start route funnels * through here, so one check covers start, resume, adopt and fork. * * 503, not 500: the request was well-formed and the fault is this machine's * environment. `code` is what mobile branches on (it reads `errBody.code`), * and `PROVIDER_NOT_INSTALLED` is a remediation string it already knows. */ private assertProviderInstalled; private assertSupportedProvider; private activeRunners; } //# sourceMappingURL=live-session-manager.d.ts.map