@opengeni/runtime 2.5.2 → 2.5.3-canary.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 (32) hide show
  1. package/dist/{agent-Q2VNH5FV.js → agent-RJQLKFIW.js} +2 -2
  2. package/dist/{chunk-CD22I76N.js → chunk-FHGLYLBL.js} +2 -2
  3. package/dist/{chunk-GJC7H2FC.js → chunk-SD6MDONS.js} +350 -67
  4. package/dist/chunk-SD6MDONS.js.map +1 -0
  5. package/dist/{chunk-25B3EQRW.js → chunk-UNICCRW5.js} +4 -4
  6. package/dist/{chunk-LGLJ5PVD.js → chunk-VVEGJPDR.js} +2309 -1345
  7. package/dist/chunk-VVEGJPDR.js.map +1 -0
  8. package/dist/index.d.ts +7 -0
  9. package/dist/index.js +22 -4
  10. package/dist/{localSources-Z5IJIIRV.js → localSources-PVFCAPN2.js} +3 -3
  11. package/dist/mcp-operation-dispatch.d.ts +45 -0
  12. package/dist/mcp-operation-observation.d.ts +137 -0
  13. package/dist/sandbox/archive-spool.d.ts +14 -0
  14. package/dist/sandbox/host-archive-spool.d.ts +19 -0
  15. package/dist/sandbox/index.d.ts +5 -1
  16. package/dist/sandbox/index.js +7 -3
  17. package/dist/sandbox/workspace-archive.d.ts +7 -0
  18. package/dist/workspace-tool-gateway.js +4 -4
  19. package/package.json +11 -11
  20. package/src/index.ts +231 -45
  21. package/src/mcp-operation-dispatch.ts +144 -0
  22. package/src/mcp-operation-observation.ts +148 -0
  23. package/src/sandbox/archive-spool.ts +16 -0
  24. package/src/sandbox/host-archive-spool.ts +1040 -0
  25. package/src/sandbox/index.ts +292 -203
  26. package/src/sandbox/workspace-archive.ts +54 -1
  27. package/dist/chunk-GJC7H2FC.js.map +0 -1
  28. package/dist/chunk-LGLJ5PVD.js.map +0 -1
  29. /package/dist/{agent-Q2VNH5FV.js.map → agent-RJQLKFIW.js.map} +0 -0
  30. /package/dist/{chunk-CD22I76N.js.map → chunk-FHGLYLBL.js.map} +0 -0
  31. /package/dist/{chunk-25B3EQRW.js.map → chunk-UNICCRW5.js.map} +0 -0
  32. /package/dist/{localSources-Z5IJIIRV.js.map → localSources-PVFCAPN2.js.map} +0 -0
package/dist/index.d.ts CHANGED
@@ -1,4 +1,7 @@
1
1
  import type { ModelProviderApi, ResolvedModelProvider, Settings } from "@opengeni/config";
2
+ import { type McpOperationPersistence } from "./mcp-operation-dispatch.js";
3
+ export { captureMcpOperationDispatch, hasActiveRecoverableMcpOperation, McpOperationOutcomeUnknownError, runRecoverableMcpOperation, type CapturedMcpOperation, type McpOperationPersistence, type RecoverableMcpOperation, } from "./mcp-operation-dispatch.js";
4
+ export { assertMcpOperationObservationAuthority, observeMcpOperation, runMcpOperationObservationWithAuthority, type McpOperationObservationAuthority, type McpObservationBinding, type McpObservationReceipt, } from "./mcp-operation-observation.js";
2
5
  import { type SkillCatalogDescriptor } from "./skill-catalog.js";
3
6
  export { formatSkillCatalog, type SkillCatalogDescriptor } from "./skill-catalog.js";
4
7
  import { AttemptToolEnvironment, type AttemptToolAuthorization, type AttemptToolDefinition } from "@opengeni/codemode";
@@ -90,6 +93,8 @@ export type ResolveConnectionCredentialResult = {
90
93
  connectionId: string;
91
94
  authoritySource?: "host";
92
95
  authorizeProviderRequest?: () => Promise<boolean>;
96
+ /** Metadata-only immutable authority binding supplied by the trusted worker resolver. */
97
+ operationAuthorityDigest?: string;
93
98
  expiresAt?: Date | null;
94
99
  } | {
95
100
  status: "auth_needed";
@@ -707,6 +712,8 @@ export type ToolPreparationPhaseMeasurement = {
707
712
  durationSeconds: number;
708
713
  };
709
714
  export type PrepareToolsOptions = {
715
+ /** Opt-in exact-attempt persistence; absence preserves ordinary MCP execution. */
716
+ mcpOperationPersistence?: McpOperationPersistence;
710
717
  /** Live exact-owner control refresh; API remains read/observation authority. */
711
718
  refreshOwnedCommand?: (commandId: string) => Promise<boolean>;
712
719
  accountId?: string;
package/dist/index.js CHANGED
@@ -30,6 +30,7 @@ import {
30
30
  MCP_LIFECYCLE_POLICIES,
31
31
  MCP_TOOL_CALL_OUTCOMES,
32
32
  MIN_COMPACTION_THRESHOLD_RATIO,
33
+ McpOperationOutcomeUnknownError,
33
34
  MultiProviderModelProvider,
34
35
  OPENGENI_INNER_MCP_CUSTOM_DATA_KEY,
35
36
  OPENGENI_MCP_RESULT_CUSTOM_DATA_KEY,
@@ -73,6 +74,7 @@ import {
73
74
  appendWorkspaceGovernance,
74
75
  appendWorkspaceMemory,
75
76
  applyMissingManifestEntries,
77
+ assertMcpOperationObservationAuthority,
76
78
  assertOpenSuffixResumable,
77
79
  azureCliLoginCommand,
78
80
  azureOpenAIDefaultQuery,
@@ -91,6 +93,7 @@ import {
91
93
  buildRemoteV2ReplacementHistory,
92
94
  buildSummaryItem,
93
95
  callModelInputFilterForSettings,
96
+ captureMcpOperationDispatch,
94
97
  clampCompactionThresholdRatio,
95
98
  codemodeTokenSeedCommand,
96
99
  compactMcpResultCustomDataRunState,
@@ -137,6 +140,7 @@ import {
137
140
  gitCredentialBindingHash,
138
141
  gitCredentialBindingTokenRefreshCommand,
139
142
  gitProviderTokenRefreshCommand,
143
+ hasActiveRecoverableMcpOperation,
140
144
  hasActiveWorkspaceInstructionPolicy,
141
145
  hasCanonicalEditableArtifactToolSurface,
142
146
  hasModelGeneratedItem,
@@ -174,6 +178,7 @@ import {
174
178
  normalizeSdkEvent,
175
179
  normalizeToolOutputForEvent,
176
180
  normalizeVercelGatewayRequestBody,
181
+ observeMcpOperation,
177
182
  oneShotGenesisTitleInputFilter,
178
183
  opaqueEncryptedContentLength,
179
184
  persistentAgentInstructionInspectionFor,
@@ -215,7 +220,9 @@ import {
215
220
  runAzureCliLoginHook,
216
221
  runBeforeAgentStartHooks,
217
222
  runCodemodeTokenSeedHook,
223
+ runMcpOperationObservationWithAuthority,
218
224
  runOwnedSandboxSetup,
225
+ runRecoverableMcpOperation,
219
226
  runRepositoryCloneHook,
220
227
  runRigSetupHook,
221
228
  runtimeSkillIndexForAgent,
@@ -247,7 +254,7 @@ import {
247
254
  workspaceEnvironmentInstructions,
248
255
  wrapAttemptToolDefinitions,
249
256
  wrapAttemptToolExecute
250
- } from "./chunk-GJC7H2FC.js";
257
+ } from "./chunk-SD6MDONS.js";
251
258
  import {
252
259
  ActiveBackendUnresolvableError,
253
260
  BROWSER_CONTROL_ADMIN_TOKEN_FILE,
@@ -361,6 +368,7 @@ import {
361
368
  buildTerminalServerScript,
362
369
  cancelSelfhostedOp,
363
370
  captureVerifiedWorkspaceArchive,
371
+ captureWorkspaceArchiveForStorage,
364
372
  classifyProviderSandboxFailure,
365
373
  clearRunCredentials,
366
374
  clearRunCredentialsForAttempt,
@@ -385,6 +393,7 @@ import {
385
393
  describeNativeSnapshotArchive,
386
394
  deserializeSandboxSessionStateEnvelope,
387
395
  desktopCapableBackend,
396
+ disposeWorkspaceArchive,
388
397
  dockerNetworkExposedPortEndpoint,
389
398
  drainingExhaustedError,
390
399
  drainingMessage,
@@ -517,8 +526,8 @@ import {
517
526
  withRunCredentialsClient,
518
527
  withRunCredentialsSession,
519
528
  withoutSandboxProviderIdentity
520
- } from "./chunk-LGLJ5PVD.js";
521
- import "./chunk-CD22I76N.js";
529
+ } from "./chunk-VVEGJPDR.js";
530
+ import "./chunk-FHGLYLBL.js";
522
531
  import {
523
532
  SKILL_MAX_FILES,
524
533
  SKILL_MAX_FILE_BYTES,
@@ -543,7 +552,7 @@ import {
543
552
  } from "./chunk-JHM4OS7C.js";
544
553
  import {
545
554
  MaxTurnsExceededError
546
- } from "./chunk-25B3EQRW.js";
555
+ } from "./chunk-UNICCRW5.js";
547
556
  import "./chunk-PZ5AY32C.js";
548
557
  export {
549
558
  ActiveBackendUnresolvableError,
@@ -616,6 +625,7 @@ export {
616
625
  MIN_COMPACTION_THRESHOLD_RATIO,
617
626
  MODAL_EXEC_READINESS_TIMEOUT_MS,
618
627
  MaxTurnsExceededError,
628
+ McpOperationOutcomeUnknownError,
619
629
  MockAgentResponder,
620
630
  MultiProviderModelProvider,
621
631
  NEVER_SENT_DETAIL_KEY,
@@ -729,6 +739,7 @@ export {
729
739
  applyMissingManifestEntries,
730
740
  assertConsistentSandboxProviderIdentity,
731
741
  assertDescriptorRegistryInvariants,
742
+ assertMcpOperationObservationAuthority,
732
743
  assertOpenSuffixResumable,
733
744
  assertProviderRegistryInvariants,
734
745
  assertSafeRelPath,
@@ -758,7 +769,9 @@ export {
758
769
  buildTerminalServerScript,
759
770
  callModelInputFilterForSettings,
760
771
  cancelSelfhostedOp,
772
+ captureMcpOperationDispatch,
761
773
  captureVerifiedWorkspaceArchive,
774
+ captureWorkspaceArchiveForStorage,
762
775
  clampCompactionThresholdRatio,
763
776
  classifyProviderSandboxFailure,
764
777
  clearRunCredentials,
@@ -804,6 +817,7 @@ export {
804
817
  describeNativeSnapshotArchive,
805
818
  deserializeSandboxSessionStateEnvelope,
806
819
  desktopCapableBackend,
820
+ disposeWorkspaceArchive,
807
821
  dockerNetworkExposedPortEndpoint,
808
822
  drainingExhaustedError,
809
823
  drainingMessage,
@@ -846,6 +860,7 @@ export {
846
860
  gitCredentialBindingTokenRefreshCommand,
847
861
  gitProviderTokenRefreshCommand,
848
862
  gmailRestToolIsMutation,
863
+ hasActiveRecoverableMcpOperation,
849
864
  hasActiveWorkspaceInstructionPolicy,
850
865
  hasCanonicalEditableArtifactToolSurface,
851
866
  hasModelGeneratedItem,
@@ -916,6 +931,7 @@ export {
916
931
  normalizeSdkEvent,
917
932
  normalizeToolOutputForEvent,
918
933
  normalizeVercelGatewayRequestBody,
934
+ observeMcpOperation,
919
935
  offlineAgentError,
920
936
  offlineControlResponse,
921
937
  oneShotGenesisTitleInputFilter,
@@ -994,7 +1010,9 @@ export {
994
1010
  runCodemodeTokenSeedHook,
995
1011
  runCredentialPointerFile,
996
1012
  runCredentialRoot,
1013
+ runMcpOperationObservationWithAuthority,
997
1014
  runOwnedSandboxSetup,
1015
+ runRecoverableMcpOperation,
998
1016
  runRepositoryCloneHook,
999
1017
  runRigSetupHook,
1000
1018
  runStateCompatibilityProvider,
@@ -3,8 +3,8 @@ import {
3
3
  applyLocalSourceManifestToState,
4
4
  materializeLocalSourceManifest,
5
5
  materializeLocalSourceManifestEntry
6
- } from "./chunk-CD22I76N.js";
7
- import "./chunk-25B3EQRW.js";
6
+ } from "./chunk-FHGLYLBL.js";
7
+ import "./chunk-UNICCRW5.js";
8
8
  import "./chunk-PZ5AY32C.js";
9
9
  export {
10
10
  applyLocalSourceManifestEntryToState,
@@ -12,4 +12,4 @@ export {
12
12
  materializeLocalSourceManifest,
13
13
  materializeLocalSourceManifestEntry
14
14
  };
15
- //# sourceMappingURL=localSources-Z5IJIIRV.js.map
15
+ //# sourceMappingURL=localSources-PVFCAPN2.js.map
@@ -0,0 +1,45 @@
1
+ import type { AttemptToolResult } from "@opengeni/contracts";
2
+ export type RecoverableMcpOperation = {
3
+ operationId: string;
4
+ sourceCallId?: string;
5
+ serverId: string;
6
+ originalTool: string;
7
+ observerTool: string;
8
+ destinationDigest: string;
9
+ argumentDigest: string;
10
+ };
11
+ export type CapturedMcpOperation = RecoverableMcpOperation & {
12
+ authorityDigest: string;
13
+ };
14
+ /** Worker-owned persistence. Its implementation must enforce canonical live
15
+ * attempt identity and store no arguments, URLs, headers, or credentials. */
16
+ export type McpOperationPersistence = {
17
+ capture: (operation: CapturedMcpOperation) => Promise<"created" | "existing">;
18
+ settleOriginal: (input: {
19
+ operationId: string;
20
+ outcome: "completed";
21
+ result: AttemptToolResult;
22
+ } | {
23
+ operationId: string;
24
+ outcome: "outcome_unknown";
25
+ }) => Promise<void>;
26
+ };
27
+ /** Presence is an execution-routing fact, not authorization. A closed context
28
+ * remains visible to late callbacks so they still hit the dispatch fence. */
29
+ export declare function hasActiveRecoverableMcpOperation(): boolean;
30
+ export declare class McpOperationOutcomeUnknownError extends Error {
31
+ readonly operationId: string;
32
+ readonly code = "mcp_operation_outcome_unknown";
33
+ constructor(operationId: string, cause: unknown);
34
+ }
35
+ /** Establish trusted in-process correlation around one gateway execution. */
36
+ export declare function runRecoverableMcpOperation(operation: RecoverableMcpOperation, persistence: McpOperationPersistence, execute: () => Promise<AttemptToolResult>): Promise<AttemptToolResult>;
37
+ /** Called by the authorized broker immediately before the physical request.
38
+ * A second dispatch with the same identity is never an observation. */
39
+ export declare function captureMcpOperationDispatch(input: {
40
+ operationId: string;
41
+ serverId: string;
42
+ toolName: string;
43
+ destinationDigest: string;
44
+ authorityDigest: string;
45
+ }): Promise<void>;
@@ -0,0 +1,137 @@
1
+ import { z } from "zod";
2
+ export type McpOperationObservationAuthority = {
3
+ serverId: string;
4
+ observerTool: string;
5
+ destinationDigest: string;
6
+ authorityDigest: string;
7
+ };
8
+ /** Pin the actual broker request, not merely the earlier credential lookup. */
9
+ export declare function runMcpOperationObservationWithAuthority<T>(binding: McpOperationObservationAuthority, execute: () => Promise<T>): Promise<T>;
10
+ /** The caller is the credential broker, after live authorization and before
11
+ * physical tools/call dispatch. Unrelated ordinary calls remain unchanged. */
12
+ export declare function assertMcpOperationObservationAuthority(actual: {
13
+ serverId: string;
14
+ toolName?: string;
15
+ destinationDigest: string;
16
+ authorityDigest?: string;
17
+ }): void;
18
+ declare const receiptSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
19
+ version: z.ZodLiteral<1>;
20
+ operationRef: z.ZodString;
21
+ fingerprint: z.ZodObject<{
22
+ version: z.ZodLiteral<1>;
23
+ algorithm: z.ZodLiteral<"sha256">;
24
+ value: z.ZodString;
25
+ }, z.core.$strict>;
26
+ status: z.ZodLiteral<"unknown">;
27
+ }, z.core.$strict>, z.ZodObject<{
28
+ version: z.ZodLiteral<1>;
29
+ operationRef: z.ZodString;
30
+ fingerprint: z.ZodObject<{
31
+ version: z.ZodLiteral<1>;
32
+ algorithm: z.ZodLiteral<"sha256">;
33
+ value: z.ZodString;
34
+ }, z.core.$strict>;
35
+ status: z.ZodLiteral<"pending">;
36
+ evidenceRevision: z.ZodString;
37
+ }, z.core.$strict>, z.ZodObject<{
38
+ version: z.ZodLiteral<1>;
39
+ operationRef: z.ZodString;
40
+ fingerprint: z.ZodObject<{
41
+ version: z.ZodLiteral<1>;
42
+ algorithm: z.ZodLiteral<"sha256">;
43
+ value: z.ZodString;
44
+ }, z.core.$strict>;
45
+ status: z.ZodLiteral<"completed">;
46
+ receiptRevision: z.ZodString;
47
+ result: z.ZodObject<{
48
+ content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
49
+ type: z.ZodLiteral<"text">;
50
+ text: z.ZodString;
51
+ annotations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
52
+ _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
53
+ }, z.core.$loose>, z.ZodObject<{
54
+ type: z.ZodLiteral<"image">;
55
+ data: z.ZodString;
56
+ mimeType: z.ZodString;
57
+ annotations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
58
+ _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
59
+ }, z.core.$loose>, z.ZodObject<{
60
+ type: z.ZodLiteral<"audio">;
61
+ data: z.ZodString;
62
+ mimeType: z.ZodString;
63
+ annotations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
64
+ _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
65
+ }, z.core.$loose>, z.ZodObject<{
66
+ type: z.ZodLiteral<"resource_link">;
67
+ name: z.ZodString;
68
+ title: z.ZodOptional<z.ZodString>;
69
+ uri: z.ZodString;
70
+ description: z.ZodOptional<z.ZodString>;
71
+ mimeType: z.ZodOptional<z.ZodString>;
72
+ size: z.ZodOptional<z.ZodNumber>;
73
+ icons: z.ZodOptional<z.ZodArray<z.ZodObject<{
74
+ src: z.ZodString;
75
+ mimeType: z.ZodOptional<z.ZodString>;
76
+ sizes: z.ZodOptional<z.ZodArray<z.ZodString>>;
77
+ theme: z.ZodOptional<z.ZodEnum<{
78
+ dark: "dark";
79
+ light: "light";
80
+ }>>;
81
+ }, z.core.$strict>>>;
82
+ annotations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
83
+ _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
84
+ }, z.core.$loose>, z.ZodObject<{
85
+ type: z.ZodLiteral<"resource">;
86
+ resource: z.ZodUnion<readonly [z.ZodObject<{
87
+ uri: z.ZodString;
88
+ mimeType: z.ZodOptional<z.ZodString>;
89
+ text: z.ZodString;
90
+ _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
91
+ }, z.core.$loose>, z.ZodObject<{
92
+ uri: z.ZodString;
93
+ mimeType: z.ZodOptional<z.ZodString>;
94
+ blob: z.ZodString;
95
+ _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
96
+ }, z.core.$loose>]>;
97
+ annotations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
98
+ _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
99
+ }, z.core.$loose>], "type">>;
100
+ structuredContent: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
101
+ isError: z.ZodOptional<z.ZodBoolean>;
102
+ _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
103
+ }, z.core.$loose>;
104
+ }, z.core.$strict>, z.ZodObject<{
105
+ version: z.ZodLiteral<1>;
106
+ operationRef: z.ZodString;
107
+ fingerprint: z.ZodObject<{
108
+ version: z.ZodLiteral<1>;
109
+ algorithm: z.ZodLiteral<"sha256">;
110
+ value: z.ZodString;
111
+ }, z.core.$strict>;
112
+ status: z.ZodLiteral<"conflict">;
113
+ }, z.core.$strict>], "status">;
114
+ declare const bindingSchema: z.ZodObject<{
115
+ operationId: z.ZodString;
116
+ serverId: z.ZodString;
117
+ originalTool: z.ZodString;
118
+ observerTool: z.ZodString;
119
+ argumentDigest: z.ZodString;
120
+ }, z.core.$strict>;
121
+ export type McpObservationBinding = z.infer<typeof bindingSchema>;
122
+ export type McpObservationReceipt = z.infer<typeof receiptSchema>;
123
+ /**
124
+ * One observation, never a mutation retry. This helper is deliberately not an
125
+ * authority resolver or a scheduler: its caller must load an immutable trusted
126
+ * binding and bind callObserver to that exact authorized provider destination.
127
+ * Tool annotations and model-supplied arguments cannot establish that trust.
128
+ *
129
+ * Durable settlement must additionally recheck authority under its own locks.
130
+ * A successful return alone is not a durable delivery or commit receipt.
131
+ */
132
+ export declare function observeMcpOperation(input: {
133
+ binding: McpObservationBinding;
134
+ authorize: (phase: "before_request" | "before_delivery") => Promise<boolean>;
135
+ callObserver: (tool: string, args: Record<string, unknown>) => Promise<unknown>;
136
+ }): Promise<McpObservationReceipt>;
137
+ export {};
@@ -0,0 +1,14 @@
1
+ import type { TarWorkspaceArchiveDescriptor } from "@opengeni/contracts";
2
+ /** Process-owned, reopenable archive bytes. Never persisted as a local path. */
3
+ export type WorkspaceArchiveSpool = {
4
+ path: string;
5
+ byteSize: number;
6
+ sha256: string;
7
+ open: () => AsyncIterable<Uint8Array>;
8
+ dispose: () => Promise<void>;
9
+ };
10
+ export type VerifiedHostWorkspaceArchive = {
11
+ kind: "host_spool";
12
+ spool: WorkspaceArchiveSpool;
13
+ descriptor: TarWorkspaceArchiveDescriptor;
14
+ };
@@ -0,0 +1,19 @@
1
+ import type { WorkspaceTreeFingerprint } from "@opengeni/contracts";
2
+ import type { WorkspaceArchiveSpool } from "./archive-spool.js";
3
+ /** Matches SDK 0.14.3 resolveSandboxArchiveLimits: absent/null means unlimited;
4
+ * an explicit object fills undefined fields with SDK defaults, null disables a field.
5
+ * chunkBytes controls buffering, never the amount of input accepted. */
6
+ export type HostWorkspaceArchiveOptions = {
7
+ chunkBytes?: number;
8
+ archiveLimits?: {
9
+ maxInputBytes?: number | null;
10
+ maxExtractedBytes?: number | null;
11
+ maxMembers?: number | null;
12
+ } | null;
13
+ };
14
+ export declare function fingerprintHostWorkspace(root: string, excludedPaths: readonly string[]): Promise<WorkspaceTreeFingerprint>;
15
+ export declare function captureHostWorkspaceArchive(root: string, excludedPaths: readonly string[]): Promise<{
16
+ spool: WorkspaceArchiveSpool;
17
+ workspace: WorkspaceTreeFingerprint;
18
+ }>;
19
+ export declare function restoreHostWorkspaceArchive(root: string, spool: WorkspaceArchiveSpool, options?: HostWorkspaceArchiveOptions): Promise<void>;
@@ -1,6 +1,9 @@
1
1
  export type { ProviderCommandPersistence, ProviderCommandSession, } from "./provider-command-session.js";
2
2
  import type { Settings } from "@opengeni/config";
3
- import { type SandboxBackend, type SandboxProviderContinuityRecovery } from "@opengeni/contracts";
3
+ export type { WorkspaceArchiveSpool, VerifiedHostWorkspaceArchive } from "./archive-spool.js";
4
+ import type { WorkspaceArchiveSpool } from "./archive-spool.js";
5
+ export { captureWorkspaceArchiveForStorage, disposeWorkspaceArchive, type VerifiedWorkspaceArchivePayload, } from "./workspace-archive.js";
6
+ import { type WorkspaceArchiveObjectRef, type SandboxBackend, type SandboxProviderContinuityRecovery } from "@opengeni/contracts";
4
7
  import type { SandboxClient, SandboxSessionState } from "@openai/agents/sandbox";
5
8
  import { type WorkspaceArchiveDescriptor } from "./workspace-archive.js";
6
9
  import type { RuntimeMetricsHooks } from "../metrics.js";
@@ -202,6 +205,7 @@ export declare function withoutSandboxProviderIdentity(envelope: Record<string,
202
205
  export declare function establishSandboxSessionFromEnvelope(settings: Settings, envelope: Record<string, unknown> | null, opts: {
203
206
  sessionId: string;
204
207
  recovery: "create-or-restore" | "resume-only";
208
+ loadHostWorkspaceArchive?: (ref: WorkspaceArchiveObjectRef) => Promise<WorkspaceArchiveSpool>;
205
209
  backendOverride?: SandboxBackend;
206
210
  environment?: Record<string, string>;
207
211
  onSandboxCreated?: SandboxCreatedCallback;
@@ -110,6 +110,7 @@ import {
110
110
  buildTerminalServerScript,
111
111
  cancelSelfhostedOp,
112
112
  captureVerifiedWorkspaceArchive,
113
+ captureWorkspaceArchiveForStorage,
113
114
  classifyProviderSandboxFailure,
114
115
  clearRunCredentials,
115
116
  clearRunCredentialsForAttempt,
@@ -134,6 +135,7 @@ import {
134
135
  describeNativeSnapshotArchive,
135
136
  deserializeSandboxSessionStateEnvelope,
136
137
  desktopCapableBackend,
138
+ disposeWorkspaceArchive,
137
139
  dockerNetworkExposedPortEndpoint,
138
140
  drainingExhaustedError,
139
141
  drainingMessage,
@@ -265,9 +267,9 @@ import {
265
267
  withRunCredentialsClient,
266
268
  withRunCredentialsSession,
267
269
  withoutSandboxProviderIdentity
268
- } from "../chunk-LGLJ5PVD.js";
269
- import "../chunk-CD22I76N.js";
270
- import "../chunk-25B3EQRW.js";
270
+ } from "../chunk-VVEGJPDR.js";
271
+ import "../chunk-FHGLYLBL.js";
272
+ import "../chunk-UNICCRW5.js";
271
273
  import "../chunk-PZ5AY32C.js";
272
274
  export {
273
275
  ActiveBackendUnresolvableError,
@@ -381,6 +383,7 @@ export {
381
383
  buildTerminalServerScript,
382
384
  cancelSelfhostedOp,
383
385
  captureVerifiedWorkspaceArchive,
386
+ captureWorkspaceArchiveForStorage,
384
387
  classifyProviderSandboxFailure,
385
388
  clearRunCredentials,
386
389
  clearRunCredentialsForAttempt,
@@ -405,6 +408,7 @@ export {
405
408
  describeNativeSnapshotArchive,
406
409
  deserializeSandboxSessionStateEnvelope,
407
410
  desktopCapableBackend,
411
+ disposeWorkspaceArchive,
408
412
  dockerNetworkExposedPortEndpoint,
409
413
  drainingExhaustedError,
410
414
  drainingMessage,
@@ -1,4 +1,5 @@
1
1
  import { type NativeSnapshotDescriptor, type NativeSnapshotRef, type WorkspaceArchiveDescriptor, type WorkspaceTreeFingerprint } from "@opengeni/contracts";
2
+ import type { VerifiedHostWorkspaceArchive } from "./archive-spool.js";
2
3
  export { WORKSPACE_ARCHIVE_DESCRIPTOR_VERSION, decodeNativeSnapshotRef, encodeNativeSnapshotRef, parseWorkspaceArchiveDescriptor, type NativeSnapshotDescriptor, type NativeSnapshotProvider, type NativeSnapshotRef, type TarWorkspaceArchiveDescriptor, type WorkspaceArchiveDescriptor, type WorkspaceTreeFingerprint, } from "@opengeni/contracts";
3
4
  export type VerifiedWorkspaceArchive = {
4
5
  bytes: Uint8Array;
@@ -7,6 +8,12 @@ export type VerifiedWorkspaceArchive = {
7
8
  kind: "tar" | "provider_snapshot";
8
9
  nativeSnapshot?: NativeSnapshotRef;
9
10
  };
11
+ export type VerifiedWorkspaceArchivePayload = VerifiedWorkspaceArchive | VerifiedHostWorkspaceArchive;
12
+ /** Host-backed portable archives can go directly to object storage without an
13
+ * intermediate whole-document string or buffer. Existing inline/provider APIs
14
+ * retain their compatibility path when disk-backed publication is unavailable. */
15
+ export declare function captureWorkspaceArchiveForStorage(session: unknown, capturedAtMs: number, options: WorkspaceArchiveCaptureOptions, objectStorageAvailable: boolean): Promise<VerifiedWorkspaceArchivePayload>;
16
+ export declare function disposeWorkspaceArchive(archive: VerifiedWorkspaceArchivePayload | undefined): Promise<void>;
10
17
  export type WorkspaceArchiveIntegrityCode = "archive_metadata_missing" | "archive_metadata_invalid" | "archive_base64_invalid" | "archive_hash_mismatch" | "archive_hydration_failed" | "workspace_fingerprint_unavailable" | "workspace_changed_during_capture" | "workspace_fingerprint_mismatch" | "native_snapshot_reference_invalid" | "native_snapshot_fallback_unverified";
11
18
  export declare class WorkspaceArchiveIntegrityError extends Error {
12
19
  readonly code: WorkspaceArchiveIntegrityCode;
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  prepareAgentTools
3
- } from "./chunk-GJC7H2FC.js";
4
- import "./chunk-LGLJ5PVD.js";
5
- import "./chunk-CD22I76N.js";
3
+ } from "./chunk-SD6MDONS.js";
4
+ import "./chunk-VVEGJPDR.js";
5
+ import "./chunk-FHGLYLBL.js";
6
6
  import "./chunk-GB763TSV.js";
7
7
  import "./chunk-UZ66CGC2.js";
8
8
  import "./chunk-JHM4OS7C.js";
9
- import "./chunk-25B3EQRW.js";
9
+ import "./chunk-UNICCRW5.js";
10
10
  import "./chunk-PZ5AY32C.js";
11
11
  export {
12
12
  prepareAgentTools as prepareWorkspaceToolGatewayTools
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeni/runtime",
3
- "version": "2.5.2",
3
+ "version": "2.5.3-canary.0",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -62,16 +62,16 @@
62
62
  "@openai/agents": "0.14.3",
63
63
  "@openai/agents-core": "0.14.3",
64
64
  "@openai/agents-extensions": "0.14.3",
65
- "@opengeni/agent-proto": "^0.5.1",
66
- "@opengeni/capabilities": "^0.3.3",
67
- "@opengeni/codemode": "^0.5.5",
68
- "@opengeni/codex": "^0.2.22",
69
- "@opengeni/config": "^1.1.1",
70
- "@opengeni/contracts": "^3.0.1",
71
- "@opengeni/network": "^0.3.1",
72
- "@opengeni/sdk": "^5.0.3",
73
- "@opengeni/tool-gateway": "^0.1.6",
74
- "@opengeni/xai-subscription": "^0.1.4",
65
+ "@opengeni/agent-proto": "^0.5.1-canary.26",
66
+ "@opengeni/capabilities": "^0.3.3-canary.8",
67
+ "@opengeni/codemode": "^0.5.6-canary.0",
68
+ "@opengeni/codex": "^0.2.22-canary.8",
69
+ "@opengeni/config": "^1.1.2-canary.0",
70
+ "@opengeni/contracts": "^3.0.2-canary.0",
71
+ "@opengeni/network": "^0.3.1-canary.8",
72
+ "@opengeni/sdk": "^5.0.5-canary.0",
73
+ "@opengeni/tool-gateway": "^0.1.7-canary.0",
74
+ "@opengeni/xai-subscription": "^0.1.4-canary.8",
75
75
  "debug": "4.4.3",
76
76
  "modal": "0.9.0",
77
77
  "openai": "6.47.0",