@opengeni/runtime 0.7.1 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/THIRD_PARTY_NOTICES +32 -0
  2. package/dist/agent-UMUIWWD2.js +8 -0
  3. package/dist/agent-UMUIWWD2.js.map +1 -0
  4. package/dist/chunk-4YJ5Z52Z.js +1789 -0
  5. package/dist/chunk-4YJ5Z52Z.js.map +1 -0
  6. package/dist/chunk-DPULLAJG.js +215 -0
  7. package/dist/chunk-DPULLAJG.js.map +1 -0
  8. package/dist/chunk-K4V4QYCL.js +37683 -0
  9. package/dist/chunk-K4V4QYCL.js.map +1 -0
  10. package/dist/chunk-PZ5AY32C.js +10 -0
  11. package/dist/chunk-PZ5AY32C.js.map +1 -0
  12. package/dist/chunk-YUAFQEFY.js +21522 -0
  13. package/dist/chunk-YUAFQEFY.js.map +1 -0
  14. package/dist/{index-DIiiwQY2.d.ts → index-D6yi-JcU.d.ts} +138 -15
  15. package/dist/index.d.ts +329 -121
  16. package/dist/index.js +8149 -307
  17. package/dist/index.js.map +1 -1
  18. package/dist/localSources-T3HZ6KY4.js +15 -0
  19. package/dist/localSources-T3HZ6KY4.js.map +1 -0
  20. package/dist/sandbox/index.d.ts +1 -1
  21. package/dist/sandbox/index.js +42 -5
  22. package/dist/skill-library.d.ts +74 -0
  23. package/dist/skill-library.js +18 -0
  24. package/dist/skill-library.js.map +1 -0
  25. package/package.json +13 -5
  26. package/src/bundled_hashicorp_terraform_skills/README.md +3 -3
  27. package/src/bundled_hashicorp_terraform_skills/checkov/SKILL.md +1 -1
  28. package/src/context-compaction.ts +421 -24
  29. package/src/history-sanitizer.ts +14 -5
  30. package/src/index.ts +1335 -280
  31. package/src/sandbox/channel-a.ts +535 -97
  32. package/src/sandbox/index.ts +36 -2
  33. package/src/sandbox/routing/routing-session.ts +10 -2
  34. package/src/sandbox/run-credentials.ts +818 -0
  35. package/src/sandbox/select.ts +3 -3
  36. package/src/sandbox/selfhosted/capabilities.ts +1 -1
  37. package/src/sandbox/selfhosted/op-stream.ts +40 -0
  38. package/src/sandbox/selfhosted/op-testing.ts +50 -3
  39. package/src/sandbox/selfhosted/session.ts +17 -4
  40. package/src/sandbox/selfhosted/testing.ts +1 -1
  41. package/src/sandbox/stream-port.ts +1 -1
  42. package/src/sandbox/stream-token.ts +1 -1
  43. package/src/sandbox/terminal-server.ts +6 -2
  44. package/src/sandbox/toolspace-token.ts +147 -0
  45. package/src/sandbox/turn-tool-cancellation.ts +940 -0
  46. package/src/skill-library.ts +323 -0
  47. package/dist/chunk-RYDCVTMW.js +0 -5531
  48. package/dist/chunk-RYDCVTMW.js.map +0 -1
  49. /package/src/{bundled_hashicorp_terraform_skills → bundled_skill_library}/azure-verified-modules/SKILL.md +0 -0
@@ -1,6 +1,6 @@
1
1
  import { Settings } from '@opengeni/config';
2
- import { SandboxBackend, CapabilityDescriptor, SandboxOs, SessionCapabilities, StreamTokenPayload, SessionEventType, SessionStructuredCapabilities, FsListRequest, FsListResponse, FsReadRequest, FsReadResponse, FsWriteRequest, FsWriteResponse, FsDeleteRequest, FsDeleteResponse, FsMoveRequest, FsMoveResponse, FsMkdirRequest, FsMkdirResponse, GitStatusRequest, GitStatusResponse, GitDiffRequest, GitDiffResponse, GitLogRequest, GitLogResponse, GitShowRequest, GitShowResponse, TerminalExecRequest, TerminalExecResponse, PtyOpenRequest, PtyOpenResponse, PtyWriteRequest, PtyResizeRequest, PtyCloseRequest, GitChangedPayload, GitDiffHunk, GitFileStatusCode, CapabilityUnavailableReason } from '@opengeni/contracts';
3
- import { Manifest, SandboxClient, SandboxSessionState } from '@openai/agents/sandbox';
2
+ import { SandboxBackend, CapabilityDescriptor, SandboxOs, SessionCapabilities, StreamTokenPayload, RunCredentialFile, RunCredentialAuthNeeded, RunCredentialRedaction, RunCredentialsResolution, SessionEventType, SessionStructuredCapabilities, FsListRequest, FsListResponse, FsReadRequest, FsReadResponse, FsWriteRequest, FsWriteResponse, FsDeleteRequest, FsDeleteResponse, FsMoveRequest, FsMoveResponse, FsMkdirRequest, FsMkdirResponse, GitStatusRequest, GitStatusResponse, GitDiffRequest, GitDiffResponse, GitLogRequest, GitLogResponse, GitShowRequest, GitShowResponse, TerminalExecRequest, TerminalExecResponse, PtyOpenRequest, PtyOpenResponse, PtyWriteRequest, PtyResizeRequest, PtyCloseRequest, GitChangedPayload, GitDiffHunk, GitFileStatusCode, CapabilityUnavailableReason } from '@opengeni/contracts';
3
+ import { SandboxSessionLike, ExecCommandArgs, SandboxClient, Manifest, SandboxSessionState } from '@openai/agents/sandbox';
4
4
  import * as modal from 'modal';
5
5
  import { ControlRequest, ControlResponse, ErrorCode, AgentError, ExecResponse, DesktopInputRequest, ExecRequest } from '@opengeni/agent-proto';
6
6
 
@@ -173,7 +173,7 @@ interface NegotiationContext {
173
173
  * (settings.computerUseReadOnly). v1 default false (the agent clicks/types). */
174
174
  computerUseReadOnly?: boolean;
175
175
  /**
176
- * Whether a scoped-stream-token secret is resolvable (I8/OD-8). When desktop
176
+ * Whether a scoped-stream-token secret is resolvable (stream-token availability contract). When desktop
177
177
  * is enabled but this is false (no streamTokenSecret AND no delegationSecret),
178
178
  * the desktop plane GRACEFULLY DEGRADES to transport:null — the deployment
179
179
  * boots, but the pixel plane cannot mint scoped tokens. Defaults to true so a
@@ -414,7 +414,11 @@ type EnsureTerminalServerResult = {
414
414
  *
415
415
  * Exported (pure, side-effect-free) so the ensureTerminalServer unit test can
416
416
  * assert the exact command sequence without a live box. Mirrors
417
- * buildDisplayStackScript.
417
+ * buildDisplayStackScript. A ttyd process is sandbox-group-global, not
418
+ * OpenGeni-session-specific, so it must never inherit the box-global legacy
419
+ * Toolspace pointer. Session-scoped interactive exec/PTY uses Channel A; the
420
+ * shared ttyd shell fails closed for Toolspace until that stream plane itself is
421
+ * session-isolated.
418
422
  */
419
423
  declare function buildTerminalServerScript(options?: EnsureTerminalServerOptions): string;
420
424
  /**
@@ -435,6 +439,92 @@ declare function ensureTerminalServer(session: unknown, options?: EnsureTerminal
435
439
  * missing process. Mirrors tearDownDisplayStack. */
436
440
  declare function tearDownTerminalServer(session: unknown): Promise<void>;
437
441
 
442
+ type RunCredentialExpectedScope = {
443
+ accountId: string;
444
+ workspaceId: string;
445
+ sessionId: string;
446
+ };
447
+ type NormalizedRunCredentialMaterial = {
448
+ environment: Record<string, string>;
449
+ files: RunCredentialFile[];
450
+ fileEnvironment: Record<string, string>;
451
+ expiresAt: Date | null;
452
+ authNeeded: RunCredentialAuthNeeded[];
453
+ redactions: RunCredentialRedaction[];
454
+ };
455
+ type RunCredentialCommandSession = Pick<SandboxSessionLike, "exec" | "execCommand">;
456
+ type RunCredentialCommandRunner = (session: RunCredentialCommandSession, args: ExecCommandArgs) => Promise<unknown>;
457
+ type RunCredentialSessionReady = (session: RunCredentialCommandSession) => Promise<void> | void;
458
+ declare class RunCredentialValidationError extends Error {
459
+ constructor(message: string);
460
+ }
461
+ /**
462
+ * Validate the untrusted host-port response before any secret is written to a
463
+ * box. The host owns credential selection; OpenGeni owns scope checks, bounds,
464
+ * path safety, and the transport lifecycle.
465
+ */
466
+ declare function normalizeRunCredentialsResolution(resolution: Extract<RunCredentialsResolution, {
467
+ status: "not_applicable";
468
+ }>, expected: RunCredentialExpectedScope, now?: Date): null;
469
+ declare function normalizeRunCredentialsResolution(resolution: Exclude<RunCredentialsResolution, {
470
+ status: "not_applicable";
471
+ }>, expected: RunCredentialExpectedScope, now?: Date): NormalizedRunCredentialMaterial;
472
+ declare function normalizeRunCredentialsResolution(resolution: RunCredentialsResolution, expected: RunCredentialExpectedScope, now?: Date): NormalizedRunCredentialMaterial | null;
473
+ declare function runCredentialRoot(sessionId: string): string;
474
+ declare function runCredentialPointerFile(sessionId: string): string;
475
+ type MaterializeRunCredentialsOptions = {
476
+ sessionId: string;
477
+ attemptId: string;
478
+ executionGeneration: number;
479
+ /** Initial provision after recovery may prune generations from older attempts. */
480
+ pruneOtherAttempts?: boolean;
481
+ /** An all-auth-needed replacement removes every prior readable generation. */
482
+ prunePreviousGenerations?: boolean;
483
+ /** Renewal keeps the active and immediately prior same-attempt generations. */
484
+ pruneSupersededGenerations?: boolean;
485
+ commandRunner?: RunCredentialCommandRunner;
486
+ };
487
+ /** Materialize one complete immutable generation, then atomically flip current. */
488
+ declare function materializeRunCredentials(session: RunCredentialCommandSession, material: NormalizedRunCredentialMaterial, options: MaterializeRunCredentialsOptions): Promise<void>;
489
+ declare function clearRunCredentials(session: RunCredentialCommandSession, sessionId: string, commandRunner?: RunCredentialCommandRunner): Promise<void>;
490
+ /**
491
+ * Remove only generations owned by one attempt. A successor may already have
492
+ * atomically activated its own pointer after queue admission; this cleanup must
493
+ * never clear or overwrite that newer generation.
494
+ */
495
+ declare function clearRunCredentialsForAttempt(session: RunCredentialCommandSession, options: Pick<MaterializeRunCredentialsOptions, "sessionId" | "attemptId" | "executionGeneration">, commandRunner?: RunCredentialCommandRunner): Promise<void>;
496
+ /** Prefix one sandbox command so every new process observes the active generation. */
497
+ declare function withRunCredentialEnvironment(cmd: string, sessionId: string): string;
498
+ /**
499
+ * Preserve the provider session identity/capabilities while decorating only
500
+ * command creation. Non-command methods stay bound to the original instance.
501
+ */
502
+ declare function withRunCredentialsSession<T extends object>(session: T, sessionId: string): T;
503
+ /** Decorate every client-created/resumed session after the host seeds it. */
504
+ declare function withRunCredentialsClient(client: SandboxClient, sessionId: string, onSessionReady?: RunCredentialSessionReady): SandboxClient;
505
+
506
+ declare class ToolspaceTokenPathError extends Error {
507
+ constructor(message: string);
508
+ }
509
+ /**
510
+ * Derive the per-session token file beside the legacy manifest pointer.
511
+ *
512
+ * The manifest pointer stays box-global so an already-warm shared sandbox does
513
+ * not receive an illegal environment delta. Every OpenGeni command overrides
514
+ * that pointer with this deterministic path. The hash is path hygiene and
515
+ * avoids disclosing host/session ids in filenames; filesystem paths are not an
516
+ * authorization boundary. The delegated bearer's session claim remains the
517
+ * authority boundary for Toolspace calls.
518
+ */
519
+ declare function toolspaceTokenFileForSession(manifestTokenFile: string, sessionId: string): string;
520
+ declare function toolspaceTokenFileFromEnvironment(environment: Readonly<Record<string, string>>, sessionId: string): string;
521
+ /** Prefix one sandbox command with its session-specific Toolspace pointer. */
522
+ declare function withToolspaceTokenEnvironment(cmd: string, tokenFile: string): string;
523
+ /** Preserve provider identity/capabilities while decorating command creation. */
524
+ declare function withToolspaceTokenSession<T extends object>(session: T, tokenFile: string): T;
525
+ /** Decorate every client-created/resumed session with one session pointer. */
526
+ declare function withToolspaceTokenClient(client: SandboxClient, tokenFile: string): SandboxClient;
527
+
438
528
  /** The provider-resolved endpoint for an exposed port. Mirrors the SDK's
439
529
  * `ExposedPortEndpoint` (host/port/tls/query/...) WITHOUT importing the
440
530
  * agent-loop barrel — the leaf stays agent-loop-free. */
@@ -638,6 +728,12 @@ type ChannelASession = {
638
728
  declare class ChannelAValidationError extends Error {
639
729
  constructor(message: string);
640
730
  }
731
+ /** A structurally valid Channel-A request could not be completed because the
732
+ * sandbox/provider control plane was temporarily unavailable. Callers may retry
733
+ * this class; it must never be presented as a bad user path. */
734
+ declare class ChannelAUnavailableError extends Error {
735
+ constructor(message: string);
736
+ }
641
737
  declare class ChannelAConflictError extends Error {
642
738
  constructor(message: string);
643
739
  }
@@ -678,11 +774,22 @@ declare class SandboxChannelAService {
678
774
  capabilities(repos?: string[]): SessionStructuredCapabilities;
679
775
  private run;
680
776
  fsList(req: FsListRequest): Promise<FsListResponse>;
777
+ /**
778
+ * Worker-only fast path for a bounded whole-workspace index. Matching
779
+ * directory nodes are emitted but pruned by `find` before descent, so residue
780
+ * such as node_modules cannot consume the result budget. The public fs/list
781
+ * wire remains unchanged; interactive callers still expand every directory
782
+ * they explicitly request.
783
+ */
784
+ fsListPruned(req: FsListRequest, pruneDirectoryNames: readonly string[]): Promise<FsListResponse>;
785
+ private fsListInternal;
681
786
  fsRead(req: FsReadRequest): Promise<FsReadResponse>;
682
- /** Read a file by base64-ing it through exec. Binary-safe and — crucially —
683
- * NOT subject to the provider's native-readFile workspace-escape validation,
684
- * so it can render a symlink whose target lives outside /workspace (the link
685
- * node itself is in-workspace). `base64 <path>` follows the symlink. */
787
+ private assertConfinedExistingDirectory;
788
+ private assertConfinedMutationParent;
789
+ private assertConfinementResult;
790
+ /** Binary-safe fallback for sessions without native reads. The file is opened
791
+ * before checking `/proc/.../fd/3`, so a symlink swap cannot redirect the
792
+ * subsequent read after confinement has been established. */
686
793
  private fsReadViaExec;
687
794
  private shapeRead;
688
795
  fsWrite(req: FsWriteRequest): Promise<FsWriteResponse>;
@@ -697,9 +804,10 @@ declare class SandboxChannelAService {
697
804
  /**
698
805
  * Detect repo roots within every supported workspace layout.
699
806
  *
700
- * The platform seeds GitHub repositories at
701
- * `repos/<owner>/<repo>`, which puts the `.git` marker at depth four from the
702
- * workspace root. Do not reintroduce a fixed maxdepth here. Traversal is
807
+ * The platform normally seeds repositories at
808
+ * `repos/<encoded-host>/<owner>/<repo>`, while explicit mount paths and
809
+ * connected-machine layouts can be deeper. Do not reintroduce a fixed
810
+ * maxdepth here. Traversal is
703
811
  * bounded instead by pruning known machine/build residue, a wall-clock
704
812
  * timeout, and a result limit. `.git` may be either a directory (ordinary
705
813
  * clone/submodule) or a file (linked worktree).
@@ -741,6 +849,10 @@ declare class SandboxChannelAService {
741
849
  /** The current FS revision (for the caller to persist/seed). */
742
850
  currentRevision(): number;
743
851
  private joinRoot;
852
+ /** Validate and enter an FS/Git directory in the same remote command that
853
+ * performs the operation. This preserves confinement without adding a full
854
+ * provider round-trip to every tree expansion or Git query. */
855
+ private runInConfinedDirectory;
744
856
  private repoWorkdir;
745
857
  private terminalWorkdir;
746
858
  private emitEvents;
@@ -750,9 +862,11 @@ declare class SandboxChannelAService {
750
862
  emitGitChanged(repoPath: string, reason: GitChangedPayload["reason"]): Promise<void>;
751
863
  }
752
864
  declare function stripExecBanner(raw: string): string;
753
- declare function isWorkspaceEscapeError(error: unknown): boolean;
754
865
  declare function isExecSessionLostBanner(out: string, execSessionId: number): boolean;
755
866
  declare function parseExecBannerSessionId(raw: string): number | null;
867
+ /** Recover a completed execCommand fallback's exit status from its banner.
868
+ * Only the banner region is inspected, so command output cannot spoof success. */
869
+ declare function parseExecBannerExitCode(raw: string): number | null;
756
870
  declare function assertSafeRelPath(p: string): string;
757
871
  declare function parsePorcelainV2(z: string): Omit<GitStatusResponse, "revision">;
758
872
  type NumstatEntry = {
@@ -1511,6 +1625,13 @@ declare class SelfhostedSession {
1511
1625
  workdir?: string;
1512
1626
  runAs?: string;
1513
1627
  }): Promise<string>;
1628
+ /**
1629
+ * Physical turn-cancellation seam used by the runtime tool fence. Only the
1630
+ * op-stream transport has a process-tree cancellation protocol; a legacy
1631
+ * runner returns false and the caller remains fail-closed until its exec
1632
+ * deadline rather than claiming the machine is quiescent.
1633
+ */
1634
+ cancelExecCommand(opId: string): Promise<boolean>;
1514
1635
  /** SDK shell capability never calls this (gated on `supportsPty()` which is
1515
1636
  * false), but the surface advertises it. Selfhosted exec has no interactive PTY
1516
1637
  * session over the structured RPC, so a stdin write is unsupported. */
@@ -1608,7 +1729,7 @@ declare class SelfhostedSession {
1608
1729
  * after asking the agent to ensure a stream channel for the port. M8b wires the
1609
1730
  * real relay tier (the byte pump) behind THIS seam.
1610
1731
  *
1611
- * THE CHANNEL-KEY QUERY (the M8b relay-dial contract, dossier §10.5): the relay
1732
+ * THE CHANNEL-KEY QUERY (the M8b relay-dial contract): the relay
1612
1733
  * routes by `{workspaceId, agentId, port}` — the EXACT `ChannelKey::query` the
1613
1734
  * agent's relay client (`opengeni-agent-stream`) appends when it registers the
1614
1735
  * producer side: `ws=<workspaceId>&agent=<agentId>&port=<port>`. We append the
@@ -1753,7 +1874,7 @@ declare function buildSelfhostedBackendSession(deps: SelfhostedSessionBuild): Pr
1753
1874
  }>;
1754
1875
  /**
1755
1876
  * The selfhosted NotFound discriminator — THE load-bearing safety property
1756
- * (dossier §10.2/§19): for selfhosted, `agent-offline` (no responder) is NEVER a
1877
+ *: for selfhosted, `agent-offline` (no responder) is NEVER a
1757
1878
  * provider NotFound. A user's real machine is not recreatable; if the lease saw
1758
1879
  * agent-offline as NotFound it would cold-create a RIVAL box (a Modal box) for
1759
1880
  * the user's machine. So this ALWAYS returns FALSE for selfhosted — there is no
@@ -1955,6 +2076,7 @@ interface RoutableBackendSession {
1955
2076
  exec?(args: unknown): Promise<unknown>;
1956
2077
  execCommand?(args: unknown): Promise<string>;
1957
2078
  writeStdin?(args: unknown): Promise<string>;
2079
+ cancelExecCommand?(opId: string): Promise<boolean>;
1958
2080
  readFile?(args: unknown): Promise<string | Uint8Array>;
1959
2081
  writeFile?(args: unknown): Promise<unknown>;
1960
2082
  createEditor?(runAs?: string): unknown;
@@ -2116,6 +2238,7 @@ declare class RoutingSandboxSession implements RoutableBackendSession {
2116
2238
  exec(args: unknown): Promise<unknown>;
2117
2239
  execCommand(args: unknown): Promise<string>;
2118
2240
  writeStdin(args: unknown): Promise<string>;
2241
+ cancelExecCommand(opId: string): Promise<boolean>;
2119
2242
  readFile(args: unknown): Promise<string | Uint8Array>;
2120
2243
  writeFile(args: unknown): Promise<unknown>;
2121
2244
  listDir(args: unknown): Promise<unknown>;
@@ -2448,4 +2571,4 @@ declare function establishSandboxSessionFromEnvelope(settings: Settings, envelop
2448
2571
  */
2449
2572
  declare function serializeEstablishedSandboxEnvelope(established: EstablishedSandboxSession): Promise<Record<string, unknown> | null>;
2450
2573
 
2451
- export { type OpStreamTransport as $, type ActiveBackendResolverDeps as A, type BackendUnresolvableCode as B, ChannelAConflictError as C, DEFAULT_DESKTOP_GEOMETRY as D, type EnsureDisplayStackOptions as E, FAULT_FIELD_WHAT_HAPPENED as F, type MockExecHandler as G, type ModalModuleLoader as H, type ModalOrphanSweepResult as I, type ModalSandboxAttribution as J, NatsControlRpc as K, type LiveModalSandboxLeaseAttribution as L, type MintStreamTokenInput as M, NEVER_SENT_DETAIL_KEY as N, type NatsOpStreamConnection as O, NatsOpStreamTransport as P, type NatsRequestConnection as Q, type RuntimeMetricsHooks as R, type NegotiationContext as S, type NumstatEntry as T, OP_STREAM_ACK_INTERVAL_MS as U, OP_STREAM_DEFAULT_WINDOW_BYTES as V, OP_STREAM_RECONNECT_HOLD_MS as W, OP_STREAM_SILENCE_TIMEOUT_MS as X, type OpStreamExecOutcome as Y, type OpStreamJournal as Z, type OpStreamSubscription as _, ActiveBackendUnresolvableError as a, type SwapTargetEstablishability as a$, OpStreamUnavailableError as a0, PROVIDER_REGISTRY as a1, type ProviderConstructionContext as a2, type ProviderRegistration as a3, REPOSITORY_DISCOVERY_LIMIT as a4, type RecordingArtifactMetadata as a5, type RecordingCodec as a6, type RecordingContentType as a7, RecordingError as a8, type RecordingProcess as a9, SandboxConfigError as aA, type SandboxCreatedCallback as aB, SandboxProviderUnavailableError as aC, SandboxResumeStateUnavailableError as aD, type SelfhostedApplyDiff as aE, SelfhostedControlError as aF, type SelfhostedEditor as aG, type SelfhostedEnrollment as aH, type SelfhostedExecArgs as aI, type SelfhostedExecResult as aJ, type SelfhostedImageOutput as aK, type SelfhostedLivenessState as aL, type SelfhostedNegotiationInput as aM, type SelfhostedOpObservation as aN, type SelfhostedOpObserver as aO, type SelfhostedOpStreamDeps as aP, type SelfhostedRelayConfig as aQ, type SelfhostedRetryClock as aR, type SelfhostedRetryDecision as aS, SelfhostedSandboxClient as aT, SelfhostedSession as aU, type SelfhostedSessionBuild as aV, type SelfhostedSessionDeps as aW, type SelfhostedSessionState as aX, type SelfhostedUnavailableReason as aY, type StartRecordingInput as aZ, StreamPortUnavailableError as a_, RecordingUnavailableError as aa, type RepositoryDiscoveryDegradedReason as ab, type RepositoryDiscoveryResult as ac, type ResolvedActiveBackend as ad, type RoutableBackendSession as ae, type RoutableSandbox as af, RoutingSandboxSession as ag, type RoutingSandboxSessionDeps as ah, type RoutingTransitionEvent as ai, RoutingUnsupportedError as aj, SELFHOSTED_DEFAULT_TIMEOUT_MS as ak, SELFHOSTED_DRAINING_MAX_RETRIES as al, SELFHOSTED_EXEC_DRAINING_MAX_RETRIES as am, SELFHOSTED_IDEMPOTENT_READONLY_OPS as an, SELFHOSTED_INFRASTRUCTURE_FAULT_CLASSES as ao, SELFHOSTED_NEVER_SENT_MAX_RETRIES as ap, SELFHOSTED_RECONNECT_WINDOW_MS as aq, SELFHOSTED_RELAY_STREAM_PATH as ar, SELFHOSTED_RETRY_BACKOFF_BASE_MS as as, SELFHOSTED_RETRY_BACKOFF_CAP_MS as at, SELFHOSTED_RETRY_BACKOFF_FACTOR as au, SELFHOSTED_TIMEOUT_MAX_RETRIES as av, STREAM_PORT as aw, STREAM_TOKEN_DEFAULT_TTL_SECONDS as ax, SandboxChannelAService as ay, type SandboxChannelAServiceOptions as az, type ActivePointer as b, serializeEstablishedSandboxEnvelope as b$, TERMINAL_SERVER_TIMEOUT_MS as b0, TerminalServerError as b1, TerminalServerUnsupportedError as b2, agentErrorToControlError as b3, assertDescriptorRegistryInvariants as b4, assertProviderRegistryInvariants as b5, assertSafeRelPath as b6, backendSupportsOs as b7, buildDisplayStackScript as b8, buildSelfhostedBackendSession as b9, makeActiveBackendResolver as bA, mintStreamToken as bB, modalSandboxAttributionEnvironment as bC, modalSandboxAttributionTags as bD, negotiateCapabilities as bE, negotiateSelfhostedCapabilities as bF, nextDurableOpId as bG, offlineAgentError as bH, offlineControlResponse as bI, opAckSubject as bJ, opFrameSubject as bK, parseExecBannerSessionId as bL, parseNumstatZ as bM, parsePorcelainV2 as bN, parseUnifiedPatch as bO, payloadTooLargeMessage as bP, readWorkspaceArchiveFromEnvelopeSessionState as bQ, recordingStorageKey as bR, renderSelfhostedFault as bS, restoredSandboxSessionStateFromEntry as bT, runWithToolCallCorrelation as bU, sandboxStateEntryFromRunState as bV, sanitizeOpIdToken as bW, selectBackend as bX, selfhostedFaultClass as bY, selfhostedLiveness as bZ, selfhostedRetryBackoffMs as b_, buildStreamUrl as ba, buildTerminalServerScript as bb, contentTypeForCodec as bc, createSandboxClient as bd, createSandboxClientForBackend as be, decideSelfhostedRetry as bf, decodeModalSnapshotId as bg, defaultSelfhostedRetryClock as bh, deletePriorPersistedSnapshot as bi, deleteRecordingArtifacts as bj, deserializeSandboxSessionStateEnvelope as bk, desktopCapableBackend as bl, drainingExhaustedError as bm, drainingMessage as bn, ensureDisplayStack as bo, ensureModalRegistryImage as bp, ensureTerminalServer as bq, establishSandboxSessionFromEnvelope as br, execDeadlineHint as bs, exposeStreamPort as bt, extForCodec as bu, inspectRecordingArtifact as bv, isExecSessionLostBanner as bw, isProviderSandboxNotFoundError as bx, isSelfhostedProviderNotFoundError as by, isWorkspaceEscapeError as bz, type ChannelAEmitter as c, setSelfhostedApplyDiff as c0, startRecording as c1, stopRecording as c2, stripExecBanner as c3, subjectFor as c4, swapTargetEstablishability as c5, sweepModalOrphanSandboxes as c6, tagModalSandbox as c7, tearDownDisplayStack as c8, tearDownTerminalServer as c9, terminateModalSandboxById as ca, timeoutAgentError as cb, timeoutControlResponse as cc, uploadRecordingArtifact as cd, verifyStreamToken as ce, type ChannelAExecArgs as d, type ChannelAExecResult as e, ChannelANotFoundError as f, type ChannelASession as g, ChannelAUnsupportedError as h, ChannelAValidationError as i, type ControlRpc as j, DISPLAY_STACK_TIMEOUT_MS as k, type DesktopGeometry as l, DisplayStackError as m, DisplayStackUnsupportedError as n, type EnsureDisplayStackResult as o, type EnsureTerminalServerOptions as p, type EnsureTerminalServerResult as q, type EstablishedSandboxSession as r, type ExposeStreamPortInput as s, type ExposeStreamPortResult as t, type ExposedPortEndpoint as u, FAULT_FIELD_WHAT_PRESERVED as v, FAULT_FIELD_WHAT_TO_TRY as w, FAULT_FIELD_WHICH_LAYER as x, MockAgentResponder as y, type MockAgentResponderOptions as z };
2574
+ export { OP_STREAM_SILENCE_TIMEOUT_MS as $, type ActiveBackendResolverDeps as A, type BackendUnresolvableCode as B, ChannelAConflictError as C, DEFAULT_DESKTOP_GEOMETRY as D, type EnsureDisplayStackOptions as E, FAULT_FIELD_WHAT_HAPPENED as F, type MintStreamTokenInput as G, MockAgentResponder as H, type MockAgentResponderOptions as I, type MockExecHandler as J, type ModalModuleLoader as K, type LiveModalSandboxLeaseAttribution as L, type MaterializeRunCredentialsOptions as M, type ModalOrphanSweepResult as N, type ModalSandboxAttribution as O, NEVER_SENT_DETAIL_KEY as P, NatsControlRpc as Q, type RunCredentialSessionReady as R, type NatsOpStreamConnection as S, NatsOpStreamTransport as T, type NatsRequestConnection as U, type NegotiationContext as V, type NormalizedRunCredentialMaterial as W, type NumstatEntry as X, OP_STREAM_ACK_INTERVAL_MS as Y, OP_STREAM_DEFAULT_WINDOW_BYTES as Z, OP_STREAM_RECONNECT_HOLD_MS as _, type RuntimeMetricsHooks as a, SelfhostedSandboxClient as a$, type OpStreamExecOutcome as a0, type OpStreamJournal as a1, type OpStreamSubscription as a2, type OpStreamTransport as a3, OpStreamUnavailableError as a4, PROVIDER_REGISTRY as a5, type ProviderConstructionContext as a6, type ProviderRegistration as a7, REPOSITORY_DISCOVERY_LIMIT as a8, type RecordingArtifactMetadata as a9, SELFHOSTED_RETRY_BACKOFF_BASE_MS as aA, SELFHOSTED_RETRY_BACKOFF_CAP_MS as aB, SELFHOSTED_RETRY_BACKOFF_FACTOR as aC, SELFHOSTED_TIMEOUT_MAX_RETRIES as aD, STREAM_PORT as aE, STREAM_TOKEN_DEFAULT_TTL_SECONDS as aF, SandboxChannelAService as aG, type SandboxChannelAServiceOptions as aH, SandboxConfigError as aI, type SandboxCreatedCallback as aJ, SandboxProviderUnavailableError as aK, SandboxResumeStateUnavailableError as aL, type SelfhostedApplyDiff as aM, SelfhostedControlError as aN, type SelfhostedEditor as aO, type SelfhostedEnrollment as aP, type SelfhostedExecArgs as aQ, type SelfhostedExecResult as aR, type SelfhostedImageOutput as aS, type SelfhostedLivenessState as aT, type SelfhostedNegotiationInput as aU, type SelfhostedOpObservation as aV, type SelfhostedOpObserver as aW, type SelfhostedOpStreamDeps as aX, type SelfhostedRelayConfig as aY, type SelfhostedRetryClock as aZ, type SelfhostedRetryDecision as a_, type RecordingCodec as aa, type RecordingContentType as ab, RecordingError as ac, type RecordingProcess as ad, RecordingUnavailableError as ae, type RepositoryDiscoveryDegradedReason as af, type RepositoryDiscoveryResult as ag, type ResolvedActiveBackend as ah, type RoutableBackendSession as ai, type RoutableSandbox as aj, RoutingSandboxSession as ak, type RoutingSandboxSessionDeps as al, type RoutingTransitionEvent as am, RoutingUnsupportedError as an, type RunCredentialCommandRunner as ao, type RunCredentialCommandSession as ap, type RunCredentialExpectedScope as aq, RunCredentialValidationError as ar, SELFHOSTED_DEFAULT_TIMEOUT_MS as as, SELFHOSTED_DRAINING_MAX_RETRIES as at, SELFHOSTED_EXEC_DRAINING_MAX_RETRIES as au, SELFHOSTED_IDEMPOTENT_READONLY_OPS as av, SELFHOSTED_INFRASTRUCTURE_FAULT_CLASSES as aw, SELFHOSTED_NEVER_SENT_MAX_RETRIES as ax, SELFHOSTED_RECONNECT_WINDOW_MS as ay, SELFHOSTED_RELAY_STREAM_PATH as az, ActiveBackendUnresolvableError as b, parseUnifiedPatch as b$, SelfhostedSession as b0, type SelfhostedSessionBuild as b1, type SelfhostedSessionDeps as b2, type SelfhostedSessionState as b3, type SelfhostedUnavailableReason as b4, type StartRecordingInput as b5, StreamPortUnavailableError as b6, type SwapTargetEstablishability as b7, TERMINAL_SERVER_TIMEOUT_MS as b8, TerminalServerError as b9, ensureModalRegistryImage as bA, ensureTerminalServer as bB, establishSandboxSessionFromEnvelope as bC, execDeadlineHint as bD, exposeStreamPort as bE, extForCodec as bF, inspectRecordingArtifact as bG, isExecSessionLostBanner as bH, isProviderSandboxNotFoundError as bI, isSelfhostedProviderNotFoundError as bJ, makeActiveBackendResolver as bK, materializeRunCredentials as bL, mintStreamToken as bM, modalSandboxAttributionEnvironment as bN, modalSandboxAttributionTags as bO, negotiateCapabilities as bP, negotiateSelfhostedCapabilities as bQ, nextDurableOpId as bR, normalizeRunCredentialsResolution as bS, offlineAgentError as bT, offlineControlResponse as bU, opAckSubject as bV, opFrameSubject as bW, parseExecBannerExitCode as bX, parseExecBannerSessionId as bY, parseNumstatZ as bZ, parsePorcelainV2 as b_, TerminalServerUnsupportedError as ba, ToolspaceTokenPathError as bb, agentErrorToControlError as bc, assertDescriptorRegistryInvariants as bd, assertProviderRegistryInvariants as be, assertSafeRelPath as bf, backendSupportsOs as bg, buildDisplayStackScript as bh, buildSelfhostedBackendSession as bi, buildStreamUrl as bj, buildTerminalServerScript as bk, clearRunCredentials as bl, clearRunCredentialsForAttempt as bm, contentTypeForCodec as bn, createSandboxClient as bo, createSandboxClientForBackend as bp, decideSelfhostedRetry as bq, decodeModalSnapshotId as br, defaultSelfhostedRetryClock as bs, deletePriorPersistedSnapshot as bt, deleteRecordingArtifacts as bu, deserializeSandboxSessionStateEnvelope as bv, desktopCapableBackend as bw, drainingExhaustedError as bx, drainingMessage as by, ensureDisplayStack as bz, type ActivePointer as c, payloadTooLargeMessage as c0, readWorkspaceArchiveFromEnvelopeSessionState as c1, recordingStorageKey as c2, renderSelfhostedFault as c3, restoredSandboxSessionStateFromEntry as c4, runCredentialPointerFile as c5, runCredentialRoot as c6, runWithToolCallCorrelation as c7, sandboxStateEntryFromRunState as c8, sanitizeOpIdToken as c9, withToolspaceTokenEnvironment as cA, withToolspaceTokenSession as cB, selectBackend as ca, selfhostedFaultClass as cb, selfhostedLiveness as cc, selfhostedRetryBackoffMs as cd, serializeEstablishedSandboxEnvelope as ce, setSelfhostedApplyDiff as cf, startRecording as cg, stopRecording as ch, stripExecBanner as ci, subjectFor as cj, swapTargetEstablishability as ck, sweepModalOrphanSandboxes as cl, tagModalSandbox as cm, tearDownDisplayStack as cn, tearDownTerminalServer as co, terminateModalSandboxById as cp, timeoutAgentError as cq, timeoutControlResponse as cr, toolspaceTokenFileForSession as cs, toolspaceTokenFileFromEnvironment as ct, uploadRecordingArtifact as cu, verifyStreamToken as cv, withRunCredentialEnvironment as cw, withRunCredentialsClient as cx, withRunCredentialsSession as cy, withToolspaceTokenClient as cz, type ChannelAEmitter as d, type ChannelAExecArgs as e, type ChannelAExecResult as f, ChannelANotFoundError as g, type ChannelASession as h, ChannelAUnavailableError as i, ChannelAUnsupportedError as j, ChannelAValidationError as k, type ControlRpc as l, DISPLAY_STACK_TIMEOUT_MS as m, type DesktopGeometry as n, DisplayStackError as o, DisplayStackUnsupportedError as p, type EnsureDisplayStackResult as q, type EnsureTerminalServerOptions as r, type EnsureTerminalServerResult as s, type EstablishedSandboxSession as t, type ExposeStreamPortInput as u, type ExposeStreamPortResult as v, type ExposedPortEndpoint as w, FAULT_FIELD_WHAT_PRESERVED as x, FAULT_FIELD_WHAT_TO_TRY as y, FAULT_FIELD_WHICH_LAYER as z };