import type { EngagementScope } from "../store/scope.js"; import { type InteractiveSessionConfig, type InteractiveSessionOverrides } from "./config.js"; import { RecoveryJournal, type ReconciliationEntry } from "./recovery-journal.js"; import { type Clock } from "./runtime.js"; import { SessionTelemetry } from "./telemetry.js"; import { type SessionTransportFactory } from "./transport.js"; import { type CloseAllResult, type CloseOwnerResult, type CloseRequest, type CloseResult, type ListResult, type ReadRequest, type ReadResult, type ResizeRequest, type ResizeResult, type SendRequest, type SendResult, type SessionInput, type SessionOperation, type StartRequest, type StartResult, type StatusResult, type TerminationReason } from "./types.js"; /** Confirmation surface for a `confirm`-level action. Previews are redacted. */ export type ConfirmPreview = (request: { readonly title: string; readonly description: string; readonly reason: string; }) => Promise; export interface ManagerRequestExtras { readonly confirm?: ConfirmPreview | undefined; readonly scope?: EngagementScope | undefined; } export interface InteractiveSessionManagerDeps { readonly config?: InteractiveSessionOverrides | undefined; readonly transports?: SessionTransportFactory | undefined; readonly clock?: Clock | undefined; readonly journal?: RecoveryJournal | undefined; readonly telemetry?: SessionTelemetry | undefined; readonly artifactBaseDir?: string | undefined; } export declare class InteractiveSessionManager { private readonly registry; private readonly runtimes; private readonly approvals; private readonly telemetry; private readonly journal; private readonly cleanup; private readonly transports; private readonly clock; private readonly baseConfig; private readonly artifactBaseDir; private readonly ownerCloses; private readonly ownerActivations; private readonly pendingStarts; private readonly lateLaunches; constructor(deps?: InteractiveSessionManagerDeps); get config(): InteractiveSessionConfig; reconcileOrphans(): ReconciliationEntry[]; ptyCapability(): Promise<{ available: boolean; reason?: string | undefined; }>; start(request: StartRequest & ManagerRequestExtras): Promise; private startManaged; private launchError; private launchWithDeadline; send(request: SendRequest & ManagerRequestExtras): Promise; private sendError; private accept; private assertControlSupported; private gather; read(request: ReadRequest): Promise; private waitForOutput; status(request: { ownerId: string; id: string; }): StatusResult; list(request: { ownerId: string; }): ListResult; resize(request: ResizeRequest): Promise; close(request: CloseRequest): Promise; cancelOwner(ownerId: string): Promise; beginCloseOwner(ownerId: string, reason?: TerminationReason): Promise; awaitOwnerClose(ownerId: string): Promise; activateOwner(ownerId: string): Promise; private awaitOwnerActivation; closeAll(reason?: TerminationReason): Promise; private closeOwnerSessions; private finalizeRecord; private finalize; private authorizeCommand; private authorizeInput; private registerPendingStart; private trackLateLaunch; private cancelPendingStarts; private releaseUnmanagedTransport; private throwIfCancelled; private assertOwner; private assertNotFenced; private assertEnabled; private notFound; private requireRuntime; } export declare function validateInput(input: SessionInput | undefined, operation: SessionOperation): SessionInput; export declare const interactiveSessionManager: InteractiveSessionManager;