import { SdkClient } from "../sdk/client"; import type { HarnessSessionTransport } from "./session-transport"; export declare class HarnessSdkTransportError extends Error { readonly code: "endpoint_unavailable" | "invalid_response"; readonly cause?: unknown; constructor(code: "endpoint_unavailable" | "invalid_response", message: string, cause?: unknown); } export interface SpawnedHarnessSession { stop(): Promise; } export interface CreateSdkSessionTransportOptions { repo: string; sessionId: string; /** Starts the normal GJC session before discovery. Test callers may provide a deterministic SDK host. */ spawn?: () => SpawnedHarnessSession | Promise; discoveryTimeoutMs?: number; /** Test seam: inject SDK client/endpoint resolution to avoid a process-global module mock. */ connect?: typeof SdkClient.connect; readEndpoint?: (repo: string, sessionId: string) => Promise<{ url: string; token: string; } | null>; } /** * Connects an owner to the child session's public SDK endpoint. The SDK client owns * hello-gated reconnects; this adapter only owns the bounded discovery wait and child * lifecycle. */ export declare function createSdkSessionTransport(options: CreateSdkSessionTransportOptions): Promise; export interface ReapableHarnessChild { kill(signal?: number | NodeJS.Signals): void; readonly exited: Promise; readonly exitCode: number | null; } export declare function spawnNormalHarnessSession(repo: string, sessionId: string, options?: { termGraceMs?: number; killVerifyMs?: number; }): SpawnedHarnessSession; /** Test hook for exact-child stop serialization and retry semantics. */ export declare function ownedHarnessSessionForTest(child: ReapableHarnessChild, options?: { termGraceMs?: number; killVerifyMs?: number; }): SpawnedHarnessSession;