/** * CLI-side client for the Workflow v3 session relay. * * Used only when the CLI runs inside an isolation boundary that masks the * host mutation path: a Linux bwrap sandbox (BOTMUX_SEND_RELAY outbox) or a * macOS read-isolated session (per-session capability carve-out file). * Isolation is detected marker-first (a visible live process-tree marker * always wins → host path), and only then by the worker-published rotating * capability file — see readWorkflowSessionRelayContext. * * Identity is NOT claimed here: the daemon re-derives caller/chat/bot from * its own live session record keyed by the verified capability. Env values * are used only to route the request (which daemon to dial). */ import { readManagedOriginCapability } from '../../core/managed-origin-capability.js'; import { findAncestorSessionContext } from '../../core/session-marker.js'; import type { WorkflowDaemonMutation, WorkflowDaemonMutationResponse } from './daemon-ipc-client.js'; export interface WorkflowSessionRelayContext { sessionId: string; capability: string; originChannelId?: string; turnId?: string; dispatchAttempt?: number; /** Routing hints only — never identity. */ larkAppId?: string; ipcPortFallback?: number; } /** * Detect an isolated session and load its per-turn capability. * * Detection follows the same precedence as resolveSessionContext * (core/session-marker.ts): a visible live process-tree marker means the host * path is available and MUST be used — capability files can survive a SIGKILL * or a later config change that disables isolation, so file existence alone * would permanently hijack a healthy host session onto the relay. Only when no * marker is visible (bwrap masks the marker dir + unshares pids; Seatbelt * denies it) is the capability file consulted, and host sessions without one * still return null. */ export declare function readWorkflowSessionRelayContext(options: { env: NodeJS.ProcessEnv; dataDir: string; startPid?: number; /** Test seams. */ readClaim?: typeof readManagedOriginCapability; findMarker?: typeof findAncestorSessionContext; }): WorkflowSessionRelayContext | null; /** * POST one relayed mutation. Loopback + capability-in-body, mirroring the * `/api/asks` client: the daemon admits the route through its narrow * capability aperture and fail-closes inside the handler. */ export declare function postWorkflowSessionRunMutation(input: { context: WorkflowSessionRelayContext; runId: string; mutation: WorkflowDaemonMutation; body?: Record; /** Resolve the owning daemon's ipcPort from discovery (host-visible only). */ resolveIpcPort?: (larkAppId: string | undefined) => number | undefined; fetchImpl?: typeof fetch; }): Promise; //# sourceMappingURL=session-relay-client.d.ts.map