@opengeni/worker-bundle 0.16.21 → 0.16.29

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 (48) hide show
  1. package/dist/activities/agent-turn.d.ts +61 -14
  2. package/dist/activities/context-compaction.d.ts +2 -0
  3. package/dist/activities/environment.d.ts +1 -0
  4. package/dist/activities/expiring-material-renewal.d.ts +5 -3
  5. package/dist/activities/git-credential-renewal.d.ts +1 -1
  6. package/dist/activities/retained-screenshot-reaper.d.ts +32 -0
  7. package/dist/activities/retained-screenshots.d.ts +93 -0
  8. package/dist/activities/run-credential-renewal.d.ts +1 -1
  9. package/dist/activities/run-input.d.ts +2 -0
  10. package/dist/activities/toolspace-token-renewal.d.ts +1 -1
  11. package/dist/activities/workspace-capture.d.ts +1 -0
  12. package/dist/activities.d.ts +3 -0
  13. package/dist/{chunk-BJUW5LCM.js → chunk-RAMNYSAW.js} +15 -12
  14. package/dist/chunk-RAMNYSAW.js.map +1 -0
  15. package/dist/host-export.js +1 -1
  16. package/dist/index.js +1317 -390
  17. package/dist/index.js.map +1 -1
  18. package/dist/sandbox-resume.d.ts +6 -0
  19. package/dist/sandbox-routing.d.ts +11 -6
  20. package/dist/workflow-bundle.js +2 -1
  21. package/package.json +12 -12
  22. package/src/activities/agent-turn.ts +482 -360
  23. package/src/activities/codex-capacity.ts +10 -1
  24. package/src/activities/codex-rotation.ts +19 -5
  25. package/src/activities/context-compaction.ts +9 -3
  26. package/src/activities/environment.ts +13 -24
  27. package/src/activities/expiring-material-renewal.ts +16 -7
  28. package/src/activities/git-credential-renewal.ts +3 -3
  29. package/src/activities/recording.ts +4 -5
  30. package/src/activities/retained-screenshot-reaper.ts +202 -0
  31. package/src/activities/retained-screenshots.ts +892 -0
  32. package/src/activities/rig-verification.ts +13 -34
  33. package/src/activities/run-credential-renewal.ts +9 -2
  34. package/src/activities/run-input.ts +18 -4
  35. package/src/activities/scheduled-tasks.ts +19 -3
  36. package/src/activities/toolspace-token-renewal.ts +9 -2
  37. package/src/activities/workspace-capture.ts +33 -3
  38. package/src/activities.ts +10 -2
  39. package/src/host-export-pump.ts +28 -11
  40. package/src/http.ts +3 -6
  41. package/src/observability-metrics.ts +3 -3
  42. package/src/sandbox-resume.ts +45 -12
  43. package/src/sandbox-routing.ts +30 -15
  44. package/src/worker-service-lifecycle.ts +8 -4
  45. package/src/workflows/file-upload-reaper.ts +4 -1
  46. package/dist/activities/redaction.d.ts +0 -1
  47. package/dist/chunk-BJUW5LCM.js.map +0 -1
  48. package/src/activities/redaction.ts +0 -9
@@ -112,6 +112,12 @@ export declare class SandboxLeaseInstanceLostError extends SandboxLeaseSupersede
112
112
  * lease as warm and enforce our own wall-clock deadline.
113
113
  */
114
114
  export declare function waitForSandboxExecReadiness(established: EstablishedSandboxSession, timeoutMs?: number): Promise<void>;
115
+ export declare function safeSnapshotError(error: unknown): {
116
+ errorClass: "SnapshotOperationError";
117
+ errorCode: "snapshot_operation_failed";
118
+ status?: number;
119
+ origin: "sandbox-resume";
120
+ };
115
121
  export declare function waitForWarmSnapshot(snapshot: Promise<unknown>, timeoutMs: number, signal?: AbortSignal): Promise<boolean>;
116
122
  /**
117
123
  * MID-SESSION /workspace snapshot (sandbox-file-persistence). The reaper's
@@ -32,6 +32,12 @@ export type RoutingWiringServices = {
32
32
  leaseEpoch: number;
33
33
  }) => void;
34
34
  };
35
+ /** Worker-turn routing may final-ack streamed command output, so it must always
36
+ * carry the turn's durable frontier journal. Non-turn helpers may still omit it
37
+ * through the broader service shape above. */
38
+ type TurnRoutingWiringServices = RoutingWiringServices & {
39
+ opJournal: OpStreamJournal;
40
+ };
35
41
  export type RoutingWiringIds = {
36
42
  workspaceId: string;
37
43
  sessionId: string;
@@ -91,8 +97,8 @@ export type RoutingWiringIds = {
91
97
  export declare function relayConfigFromSettings(settings: Settings): SelfhostedRelayConfig;
92
98
  /** The selfhosted CONTROL vs EXEC op deadlines for a turn, from settings. Control
93
99
  * ops (ping/fs/desktop/pty) stay on the short timeout so machine liveness is never
94
- * masked by a slow op; exec gets its own much larger budget so a real command is not
95
- * killed at the control wall. Threaded into every turn-path session build + resolver. */
100
+ * masked by a slow op; exec has its own setting and defaults to no duration wall.
101
+ * Threaded into every turn-path session build + resolver. */
96
102
  export declare function selfhostedTimeoutsFromSettings(settings: Settings): {
97
103
  timeoutMs: number;
98
104
  execTimeoutMs: number;
@@ -110,8 +116,8 @@ export declare function providerIdentityFromResumeState(resumeState: Record<stri
110
116
  * SelfhostedSession bound to the target's enrollment agentId, fenced under the
111
117
  * swap's active_epoch.
112
118
  */
113
- export declare function wrapTurnBoxWithRouting(services: RoutingWiringServices, ids: RoutingWiringIds, established: EstablishedSandboxSession): EstablishedSandboxSession;
114
- export declare function wrapLazyTurnBoxWithRouting(services: RoutingWiringServices, ids: RoutingWiringIds, args: {
119
+ export declare function wrapTurnBoxWithRouting(services: TurnRoutingWiringServices, ids: RoutingWiringIds, established: EstablishedSandboxSession): EstablishedSandboxSession;
120
+ export declare function wrapLazyTurnBoxWithRouting(services: TurnRoutingWiringServices, ids: RoutingWiringIds, args: {
115
121
  client: EstablishedSandboxSession["client"];
116
122
  backendId: string;
117
123
  agentDefaultManifest: unknown;
@@ -143,8 +149,7 @@ export type SelfhostedTurnSessionArgs = {
143
149
  /** The session working directory (per-session pointer). Null ⇒ workspace_root. */
144
150
  workingDir: string | null;
145
151
  };
146
- type LegacySelfhostedTurnSessionArgs = Omit<SelfhostedTurnSessionArgs, "opStream">;
147
- export declare function establishSelfhostedTurnSession(services: RoutingWiringServices, args: SelfhostedTurnSessionArgs | LegacySelfhostedTurnSessionArgs): Promise<EstablishedSandboxSession>;
152
+ export declare function establishSelfhostedTurnSession(services: RoutingWiringServices, args: SelfhostedTurnSessionArgs): Promise<EstablishedSandboxSession>;
148
153
  /** Whether the routing proxy should wrap the turn box: the hot-swap feature is
149
154
  * gated by the selfhosted flag (the active pointer + swap tools are only
150
155
  * meaningful when selfhosted is enabled). With the flag off the established