@tangle-network/agent-app 0.45.5 → 0.45.6

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.
@@ -262,25 +262,221 @@ declare function statSandboxFileSize(box: SandboxExecChannel, absolutePath: stri
262
262
  declare function readSandboxBinaryBytes(box: SandboxExecChannel, absolutePath: string, expectedSize: number, options?: SandboxExecOptions): Promise<SandboxFileBytesOutcome>;
263
263
 
264
264
  /**
265
- * Read a sandbox provisioning failure without leaking what it carries.
265
+ * What an app does after the platform hands back a sandbox it cannot use.
266
266
  *
267
- * Provisioning errors arrive as deep `cause` chains from the sandbox API, the
268
- * runtime sidecar, and the app's own vault code, and they routinely carry
269
- * bearer tokens and signed URLs in their messages. Every app on this shell
270
- * needs the same three things from one: a redacted shape it can log, a
271
- * classification it can act on, and a sentence it can show a person. Before
272
- * this module each app either wrote its own or — far more often — wrote none,
273
- * and surfaced the raw error or a generic apology.
267
+ * `replaceUnbringableBox` (see `./index`) decides whether to abandon a dead box.
268
+ * This decides everything around that: which box key the next attempt uses,
269
+ * whether the old box's snapshot is safe to restore from, whether an owner has
270
+ * to confirm the loss first, and what the person waiting is told. It is
271
+ * bookkeeping, not I/O the app supplies storage through
272
+ * {@link WorkspaceSandboxRecoveryStore}.
274
273
  *
275
- * The classifiers are deliberately narrow. `isSandboxApiSandboxMissingFailure`
276
- * does not fire on a 404 from inside a live box; `isSandboxHostCapacityFailure`
277
- * does not fire on capacity wording from any origin but the sandbox API. A
278
- * classifier that over-matches turns a transient failure into a box deletion.
274
+ * ── Why the tables ──────────────────────────────────────────────────────────
275
+ * Every fact about an action or a code lives in ACTIONS/CODES below, and the
276
+ * types are DERIVED from those tables. That is deliberate, and it is the whole
277
+ * reliability argument for this module.
278
+ *
279
+ * The hand-maintained alternative — a union type plus a separate `x === 'a' ||
280
+ * x === 'b' || …` list per question — silently drops anything not on the list.
281
+ * A recovery recorded under an unlisted action is written to storage, read
282
+ * back, discarded as malformed, and the workspace re-provisions the box it just
283
+ * abandoned. Nothing throws. The fix looks correct, ships, and does nothing.
284
+ * That failure was hit twice inside one change before this module existed.
285
+ *
286
+ * With the tables, adding an action or code is a compile error until every
287
+ * question about it is answered. There is no list to forget.
279
288
  */
280
- /** Error code an app raises when a stopped box's egress proxy must be rebuilt
281
- * before the box can be reused. Declared here so the classifier below stands
282
- * alone; apps that model this failure re-export the same literal. */
289
+ /** The box exists and still holds unsnapshotted state, so discarding it is an
290
+ * owner's decision, not the runtime's. */
283
291
  declare const EGRESS_PROXY_RECOVERY_REQUIRED = "EGRESS_PROXY_RECOVERY_REQUIRED";
292
+ declare const EGRESS_PROXY_RECOVERY_PHASE = "egress_proxy_recovery";
293
+ /** The platform no longer has the box. Nothing to confirm, delete, or restore. */
294
+ declare const WORKSPACE_SANDBOX_MISSING = "WORKSPACE_SANDBOX_MISSING";
295
+ /** The box exists but its host has no free slot, so it can never be resumed
296
+ * where it is. A replacement can be placed on a host with room. */
297
+ declare const WORKSPACE_SANDBOX_HOST_EXHAUSTED = "WORKSPACE_SANDBOX_HOST_EXHAUSTED";
298
+ /** The platform ran its own recovery, failed, and asked for a replacement.
299
+ * Covers every way a box ends up unbringable with no more specific cause. */
300
+ declare const WORKSPACE_SANDBOX_UNRECOVERABLE = "WORKSPACE_SANDBOX_UNRECOVERABLE";
301
+ declare const WORKSPACE_SANDBOX_SNAPSHOT_MAX_AGE_MS: number;
302
+ /**
303
+ * Every recovery cause, and the one thing the runtime must know about each:
304
+ * whether the box it names can still be read from.
305
+ *
306
+ * `snapshotUsable: false` is not a preference. A snapshot is addressed by the
307
+ * sandbox it was taken from, so when that sandbox cannot be started the restore
308
+ * fails exactly the way the resume did — and an app that tried it would turn a
309
+ * recoverable workspace into a stuck one.
310
+ */
311
+ declare const CODES: {
312
+ readonly EGRESS_PROXY_RECOVERY_REQUIRED: {
313
+ readonly snapshotUsable: true;
314
+ };
315
+ readonly WORKSPACE_SANDBOX_MISSING: {
316
+ readonly snapshotUsable: false;
317
+ };
318
+ readonly WORKSPACE_SANDBOX_HOST_EXHAUSTED: {
319
+ readonly snapshotUsable: false;
320
+ };
321
+ readonly WORKSPACE_SANDBOX_UNRECOVERABLE: {
322
+ readonly snapshotUsable: false;
323
+ };
324
+ };
325
+ type WorkspaceSandboxRecoveryCode = keyof typeof CODES;
326
+ /**
327
+ * Every recovery action, and whether it means a replacement box has been
328
+ * CHOSEN — the single question that decides which box key the next provisioning
329
+ * attempt uses.
330
+ *
331
+ * `replacementChosen: false` covers the states where a key may be recorded but
332
+ * must not be used yet: an owner has been asked and has not answered, or has
333
+ * answered no. Handing back a key in those states replaces a box the owner
334
+ * declined to lose.
335
+ */
336
+ declare const ACTIONS: {
337
+ readonly confirmation_required: {
338
+ readonly replacementChosen: false;
339
+ };
340
+ readonly deletion_declined: {
341
+ readonly replacementChosen: false;
342
+ };
343
+ readonly replacement_authorized: {
344
+ readonly replacementChosen: false;
345
+ };
346
+ readonly snapshot_replacement_authorized: {
347
+ readonly replacementChosen: false;
348
+ };
349
+ readonly replacement_started: {
350
+ readonly replacementChosen: true;
351
+ };
352
+ readonly replacement_completed: {
353
+ readonly replacementChosen: true;
354
+ };
355
+ readonly snapshot_replacement_started: {
356
+ readonly replacementChosen: true;
357
+ };
358
+ readonly snapshot_restore_failed: {
359
+ readonly replacementChosen: true;
360
+ };
361
+ readonly snapshot_replacement_completed: {
362
+ readonly replacementChosen: true;
363
+ };
364
+ readonly missing_replacement_started: {
365
+ readonly replacementChosen: true;
366
+ };
367
+ readonly missing_replacement_completed: {
368
+ readonly replacementChosen: true;
369
+ };
370
+ readonly unrecoverable_replacement_started: {
371
+ readonly replacementChosen: true;
372
+ };
373
+ readonly unrecoverable_replacement_completed: {
374
+ readonly replacementChosen: true;
375
+ };
376
+ };
377
+ type WorkspaceSandboxRecoveryAction = keyof typeof ACTIONS;
378
+ type WorkspaceSandboxSnapshotAvailability = 'available' | 'missing' | 'stale';
379
+ type WorkspaceSandboxSnapshotFreshness = 'fresh' | 'stale' | 'unknown';
380
+ /** A snapshot the app took of a box, addressed by the box it came from. */
381
+ interface WorkspaceSandboxSnapshot {
382
+ fromSandboxId: string;
383
+ createdAt: string;
384
+ [key: string]: unknown;
385
+ }
386
+ interface WorkspaceSandboxSnapshotAssessment {
387
+ availability: WorkspaceSandboxSnapshotAvailability;
388
+ freshness: WorkspaceSandboxSnapshotFreshness;
389
+ snapshot?: WorkspaceSandboxSnapshot;
390
+ }
391
+ interface WorkspaceSandboxRecoveryState {
392
+ code: WorkspaceSandboxRecoveryCode;
393
+ sandboxId: string;
394
+ detectedAt: string;
395
+ snapshot: WorkspaceSandboxSnapshotAssessment;
396
+ action: WorkspaceSandboxRecoveryAction;
397
+ replacementBoxKey?: string;
398
+ replacementSandboxId?: string;
399
+ confirmedAt?: string;
400
+ }
401
+ type WorkspaceSandboxRecoveryDecision = 'replace' | 'decline';
402
+ /** Raised when chat cannot continue until an owner decides about the box. */
403
+ declare class WorkspaceSandboxRecoveryRequiredError extends Error {
404
+ readonly code = "EGRESS_PROXY_RECOVERY_REQUIRED";
405
+ readonly status = 409;
406
+ readonly phase = "egress_proxy_recovery";
407
+ readonly recovery: WorkspaceSandboxRecoveryState;
408
+ constructor(recovery: WorkspaceSandboxRecoveryState, cause: Error);
409
+ }
410
+ declare function isEgressProxyRecoveryRequiredError(error: unknown): boolean;
411
+ declare function isWorkspaceSandboxSnapshotRestoreError(error: unknown): boolean;
412
+ /**
413
+ * Judge a snapshot against the box being replaced.
414
+ *
415
+ * Fresh means BOTH that it came from this exact sandbox and that it is inside
416
+ * the age bound — a snapshot from a different box restores someone else's
417
+ * filesystem, which is worse than starting empty.
418
+ */
419
+ declare function assessWorkspaceSandboxSnapshot(snapshot: WorkspaceSandboxSnapshot | undefined, sandboxId: string, now?: number): WorkspaceSandboxSnapshotAssessment;
420
+ declare function isWorkspaceSandboxRecoveryAction(value: unknown): value is WorkspaceSandboxRecoveryAction;
421
+ declare function isWorkspaceSandboxRecoveryCode(value: unknown): value is WorkspaceSandboxRecoveryCode;
422
+ declare function isWorkspaceSandboxRecoveryState(value: unknown): value is WorkspaceSandboxRecoveryState;
423
+ declare function workspaceSandboxRecoveryFromError(error: unknown): WorkspaceSandboxRecoveryState | undefined;
424
+ /** What to tell the person waiting. Never names the product, so an app can
425
+ * surface it verbatim. */
426
+ declare function workspaceSandboxRecoveryMessage(recovery: WorkspaceSandboxRecoveryState): string;
427
+ declare function workspaceSandboxRecoveryRecommendedActions(recovery: WorkspaceSandboxRecoveryState): string[];
428
+ /** Flat key/value shape for a log line — no nesting, no secrets. */
429
+ declare function workspaceSandboxRecoveryDiagnostic(recovery: WorkspaceSandboxRecoveryState): Record<string, string | undefined>;
430
+ /**
431
+ * The box key the next provisioning attempt should use, or undefined to keep
432
+ * using the workspace's own key.
433
+ *
434
+ * Reads {@link ACTIONS} rather than a hand-kept list, because the failure mode
435
+ * of a hand-kept list here is invisible: the key is recorded, silently ignored,
436
+ * and provisioning goes back to the box the app just decided to abandon.
437
+ */
438
+ declare function preferredWorkspaceSandboxRecoveryBoxKey(recovery: WorkspaceSandboxRecoveryState | undefined): string | undefined;
439
+ /** Whether the replacement should be restored from the old box's snapshot. */
440
+ declare function shouldRestoreWorkspaceSandboxRecovery(recovery: WorkspaceSandboxRecoveryState | undefined): boolean;
441
+ /**
442
+ * Where an app keeps recovery state. One row per workspace, last write wins —
443
+ * a recovery is a current situation, not a history.
444
+ */
445
+ interface WorkspaceSandboxRecoveryStore {
446
+ read: (workspaceId: string) => Promise<WorkspaceSandboxRecoveryState | undefined>;
447
+ write: (workspaceId: string, recovery: WorkspaceSandboxRecoveryState) => Promise<void>;
448
+ }
449
+ interface WorkspaceSandboxRecoveryManager {
450
+ read: (workspaceId: string) => Promise<WorkspaceSandboxRecoveryState | undefined>;
451
+ record: (workspaceId: string, recovery: WorkspaceSandboxRecoveryState) => Promise<void>;
452
+ /** Record an owner's decision. Returns undefined when the stored recovery does
453
+ * not name this sandbox — a decision about a box that has already been
454
+ * replaced must not resurrect it. */
455
+ decide: (args: {
456
+ workspaceId: string;
457
+ sandboxId: string;
458
+ decision: WorkspaceSandboxRecoveryDecision;
459
+ replacementBoxKey?: string;
460
+ }) => Promise<WorkspaceSandboxRecoveryState | undefined>;
461
+ /** Mark a replacement finished and name the box that took over. */
462
+ complete: (args: {
463
+ workspaceId: string;
464
+ replacementSandboxId: string;
465
+ }) => Promise<WorkspaceSandboxRecoveryState | undefined>;
466
+ }
467
+ /**
468
+ * Bind the recovery bookkeeping to an app's storage.
469
+ *
470
+ * The app owns persistence — a D1 column, a KV key, a Postgres row — and
471
+ * nothing else. Every rule about which action means what stays here, so it
472
+ * cannot drift between apps.
473
+ */
474
+ declare function createWorkspaceSandboxRecoveryManager(store: WorkspaceSandboxRecoveryStore): WorkspaceSandboxRecoveryManager;
475
+ /** Every declared action, for exhaustiveness tests in apps and here. */
476
+ declare const WORKSPACE_SANDBOX_RECOVERY_ACTIONS: readonly WorkspaceSandboxRecoveryAction[];
477
+ /** Every declared cause. */
478
+ declare const WORKSPACE_SANDBOX_RECOVERY_CODES: readonly WorkspaceSandboxRecoveryCode[];
479
+
284
480
  interface SafeSandboxErrorCause {
285
481
  name?: string;
286
482
  message?: string;
@@ -1363,4 +1559,4 @@ declare function isTerminalPromptEvent(event: unknown): boolean;
1363
1559
  /** Resolve the interactive question text from a structured event or return null if none found */
1364
1560
  declare function detectInteractiveQuestion(event: unknown): string | null;
1365
1561
 
1366
- export { type AppToolDescriptor, type BuildAppToolMcpServersOptions, type BuildSandboxToolFileMountsOptions, type D1PrewarmClaimStoreOptions, DEFAULT_PREWARM_CLAIM_TABLE, DEFAULT_SANDBOX_RESOURCES, DEFAULT_SIDECAR_PROCESS_PATTERN, type DriveSandboxTurnOptions, EGRESS_PROXY_RECOVERY_REQUIRED, ENV_TOTAL_MAX_BYTES, ENV_VALUE_MAX_BYTES, type EnsureWorkspaceSandboxOptions, type LivenessProbeConfig, type MemberSyncSeam, type ModelSelection, type ModelSelectionError, type ModelSelectionFailure, type ModelSelectionSource, type Outcome, PREWARM_CLAIM_TABLE_DDL, PROVISION_PAYLOAD_MAX_BYTES, type PeekWorkspaceSandboxOutcome, type PrewarmClaimD1Like, type PrewarmClaimStore, type PrewarmDecision, type PrewarmEvent, type PrewarmOutcome, type PrewarmResult, type ProfileComposeOptions, type PromptInputPart, type ProviderResolutionConfig, type ProvisionPayloadSections, type ProvisionProfileSection, type ResolveSandboxClientCredentialsOptions, type ResolvedModel, type SafeSandboxErrorCause, type SafeSandboxErrorDiagnostics, type SandboxBuildContext, type SandboxClientCredentials, type SandboxCredentialEnvironment, SandboxEgressPolicyMismatchError, type SandboxEgressPolicySource, type SandboxExecChannel, type SandboxExecOptions, type SandboxExistingBoxStage, type SandboxFileBytesOutcome, type SandboxFileSizeOutcome, SandboxModelResolutionError, type SandboxPermissionLevel, type SandboxPrewarmScope, type SandboxPrewarmer, type SandboxPrewarmerOptions, type SandboxReadiness, SandboxRecoveryFailedError, type SandboxRecoveryPhase, type SandboxResourceConfig, type SandboxRestoreSpec, SandboxRuntimeAuthRefreshError, type SandboxRuntimeConfig, type SandboxScope, type SandboxStepTransition, type SandboxTerminalConnectionRouteOptions, type SandboxToolPathOptions, type SandboxToolSpec, type ScopedTokenResult, type SecretStore, type StoppedSandboxResumeFailure, type StoppedSandboxResumeRecovery, type StreamSandboxPromptOptions, type TerminalConnectionBoxLike, type WorkspaceSandboxEnsureContext, type WorkspaceSandboxInstanceLike, type WorkspaceSandboxManager, type WorkspaceSandboxManagerOptions, type WriteProfileFilesOptions, assertEnvWithinLimits, assertProvisionPayloadWithinCap, attachReasoningEffort, buildAppToolMcpServers, buildSandboxToolFileMounts, buildSandboxToolPathSetupScript, classifySeveredStream, collectSandboxPromptText, createD1PrewarmClaimStore, createSandboxPrewarmer, createSandboxTerminalConnectionRoute, createWorkspaceSandboxManager, deferredCorpusHash, deleteSecret, detectInteractiveQuestion, driveSandboxTurn, ensureWorkspaceSandbox, flattenHistory, formatSandboxProvisioningSupportDetails, formatSandboxProvisioningUserMessage, getClient, isSandboxApiBearerAuthFailure, isSandboxApiSandboxMissingFailure, isSandboxAuthFailure, isSandboxHostCapacityFailure, isTerminalPromptEvent, mergeExtraMcp, mergeHistoryIntoParts, mintSandboxScopedToken, peekWorkspaceSandbox, readSandboxBinaryBytes, readSecret, requireTransportableModel, resetClientCache, resolveModel, resolveModelSelection, resolveSandboxClientCredentials, runSandboxPrompt, runSandboxToolPathSetup, sandboxToolBinDir, sandboxToolPath, sandboxToolRootDir, secretStoreFromClient, serializeSandboxProvisioningError, shellQuote, splitDeferredProfileFiles, statSandboxFileSize, storeSecret, streamSandboxPrompt, syncSandboxMemberAdd, syncSandboxMemberRemove, syncSandboxMemberRole, writeProfileFilesToBox };
1562
+ export { type AppToolDescriptor, type BuildAppToolMcpServersOptions, type BuildSandboxToolFileMountsOptions, type D1PrewarmClaimStoreOptions, DEFAULT_PREWARM_CLAIM_TABLE, DEFAULT_SANDBOX_RESOURCES, DEFAULT_SIDECAR_PROCESS_PATTERN, type DriveSandboxTurnOptions, EGRESS_PROXY_RECOVERY_PHASE, EGRESS_PROXY_RECOVERY_REQUIRED, ENV_TOTAL_MAX_BYTES, ENV_VALUE_MAX_BYTES, type EnsureWorkspaceSandboxOptions, type LivenessProbeConfig, type MemberSyncSeam, type ModelSelection, type ModelSelectionError, type ModelSelectionFailure, type ModelSelectionSource, type Outcome, PREWARM_CLAIM_TABLE_DDL, PROVISION_PAYLOAD_MAX_BYTES, type PeekWorkspaceSandboxOutcome, type PrewarmClaimD1Like, type PrewarmClaimStore, type PrewarmDecision, type PrewarmEvent, type PrewarmOutcome, type PrewarmResult, type ProfileComposeOptions, type PromptInputPart, type ProviderResolutionConfig, type ProvisionPayloadSections, type ProvisionProfileSection, type ResolveSandboxClientCredentialsOptions, type ResolvedModel, type SafeSandboxErrorCause, type SafeSandboxErrorDiagnostics, type SandboxBuildContext, type SandboxClientCredentials, type SandboxCredentialEnvironment, SandboxEgressPolicyMismatchError, type SandboxEgressPolicySource, type SandboxExecChannel, type SandboxExecOptions, type SandboxExistingBoxStage, type SandboxFileBytesOutcome, type SandboxFileSizeOutcome, SandboxModelResolutionError, type SandboxPermissionLevel, type SandboxPrewarmScope, type SandboxPrewarmer, type SandboxPrewarmerOptions, type SandboxReadiness, SandboxRecoveryFailedError, type SandboxRecoveryPhase, type SandboxResourceConfig, type SandboxRestoreSpec, SandboxRuntimeAuthRefreshError, type SandboxRuntimeConfig, type SandboxScope, type SandboxStepTransition, type SandboxTerminalConnectionRouteOptions, type SandboxToolPathOptions, type SandboxToolSpec, type ScopedTokenResult, type SecretStore, type StoppedSandboxResumeFailure, type StoppedSandboxResumeRecovery, type StreamSandboxPromptOptions, type TerminalConnectionBoxLike, WORKSPACE_SANDBOX_HOST_EXHAUSTED, WORKSPACE_SANDBOX_MISSING, WORKSPACE_SANDBOX_RECOVERY_ACTIONS, WORKSPACE_SANDBOX_RECOVERY_CODES, WORKSPACE_SANDBOX_SNAPSHOT_MAX_AGE_MS, WORKSPACE_SANDBOX_UNRECOVERABLE, type WorkspaceSandboxEnsureContext, type WorkspaceSandboxInstanceLike, type WorkspaceSandboxManager, type WorkspaceSandboxManagerOptions, type WorkspaceSandboxRecoveryAction, type WorkspaceSandboxRecoveryCode, type WorkspaceSandboxRecoveryDecision, type WorkspaceSandboxRecoveryManager, WorkspaceSandboxRecoveryRequiredError, type WorkspaceSandboxRecoveryState, type WorkspaceSandboxRecoveryStore, type WorkspaceSandboxSnapshot, type WorkspaceSandboxSnapshotAssessment, type WorkspaceSandboxSnapshotAvailability, type WorkspaceSandboxSnapshotFreshness, type WriteProfileFilesOptions, assertEnvWithinLimits, assertProvisionPayloadWithinCap, assessWorkspaceSandboxSnapshot, attachReasoningEffort, buildAppToolMcpServers, buildSandboxToolFileMounts, buildSandboxToolPathSetupScript, classifySeveredStream, collectSandboxPromptText, createD1PrewarmClaimStore, createSandboxPrewarmer, createSandboxTerminalConnectionRoute, createWorkspaceSandboxManager, createWorkspaceSandboxRecoveryManager, deferredCorpusHash, deleteSecret, detectInteractiveQuestion, driveSandboxTurn, ensureWorkspaceSandbox, flattenHistory, formatSandboxProvisioningSupportDetails, formatSandboxProvisioningUserMessage, getClient, isEgressProxyRecoveryRequiredError, isSandboxApiBearerAuthFailure, isSandboxApiSandboxMissingFailure, isSandboxAuthFailure, isSandboxHostCapacityFailure, isTerminalPromptEvent, isWorkspaceSandboxRecoveryAction, isWorkspaceSandboxRecoveryCode, isWorkspaceSandboxRecoveryState, isWorkspaceSandboxSnapshotRestoreError, mergeExtraMcp, mergeHistoryIntoParts, mintSandboxScopedToken, peekWorkspaceSandbox, preferredWorkspaceSandboxRecoveryBoxKey, readSandboxBinaryBytes, readSecret, requireTransportableModel, resetClientCache, resolveModel, resolveModelSelection, resolveSandboxClientCredentials, runSandboxPrompt, runSandboxToolPathSetup, sandboxToolBinDir, sandboxToolPath, sandboxToolRootDir, secretStoreFromClient, serializeSandboxProvisioningError, shellQuote, shouldRestoreWorkspaceSandboxRecovery, splitDeferredProfileFiles, statSandboxFileSize, storeSecret, streamSandboxPrompt, syncSandboxMemberAdd, syncSandboxMemberRemove, syncSandboxMemberRole, workspaceSandboxRecoveryDiagnostic, workspaceSandboxRecoveryFromError, workspaceSandboxRecoveryMessage, workspaceSandboxRecoveryRecommendedActions, writeProfileFilesToBox };
@@ -2,6 +2,7 @@ import {
2
2
  DEFAULT_PREWARM_CLAIM_TABLE,
3
3
  DEFAULT_SANDBOX_RESOURCES,
4
4
  DEFAULT_SIDECAR_PROCESS_PATTERN,
5
+ EGRESS_PROXY_RECOVERY_PHASE,
5
6
  EGRESS_PROXY_RECOVERY_REQUIRED,
6
7
  ENV_TOTAL_MAX_BYTES,
7
8
  ENV_VALUE_MAX_BYTES,
@@ -11,8 +12,16 @@ import {
11
12
  SandboxModelResolutionError,
12
13
  SandboxRecoveryFailedError,
13
14
  SandboxRuntimeAuthRefreshError,
15
+ WORKSPACE_SANDBOX_HOST_EXHAUSTED,
16
+ WORKSPACE_SANDBOX_MISSING,
17
+ WORKSPACE_SANDBOX_RECOVERY_ACTIONS,
18
+ WORKSPACE_SANDBOX_RECOVERY_CODES,
19
+ WORKSPACE_SANDBOX_SNAPSHOT_MAX_AGE_MS,
20
+ WORKSPACE_SANDBOX_UNRECOVERABLE,
21
+ WorkspaceSandboxRecoveryRequiredError,
14
22
  assertEnvWithinLimits,
15
23
  assertProvisionPayloadWithinCap,
24
+ assessWorkspaceSandboxSnapshot,
16
25
  attachReasoningEffort,
17
26
  buildAppToolMcpServers,
18
27
  buildSandboxToolFileMounts,
@@ -23,6 +32,7 @@ import {
23
32
  createSandboxPrewarmer,
24
33
  createSandboxTerminalConnectionRoute,
25
34
  createWorkspaceSandboxManager,
35
+ createWorkspaceSandboxRecoveryManager,
26
36
  deferredCorpusHash,
27
37
  deleteSecret,
28
38
  detectInteractiveQuestion,
@@ -32,15 +42,21 @@ import {
32
42
  formatSandboxProvisioningSupportDetails,
33
43
  formatSandboxProvisioningUserMessage,
34
44
  getClient,
45
+ isEgressProxyRecoveryRequiredError,
35
46
  isSandboxApiBearerAuthFailure,
36
47
  isSandboxApiSandboxMissingFailure,
37
48
  isSandboxAuthFailure,
38
49
  isSandboxHostCapacityFailure,
39
50
  isTerminalPromptEvent,
51
+ isWorkspaceSandboxRecoveryAction,
52
+ isWorkspaceSandboxRecoveryCode,
53
+ isWorkspaceSandboxRecoveryState,
54
+ isWorkspaceSandboxSnapshotRestoreError,
40
55
  mergeExtraMcp,
41
56
  mergeHistoryIntoParts,
42
57
  mintSandboxScopedToken,
43
58
  peekWorkspaceSandbox,
59
+ preferredWorkspaceSandboxRecoveryBoxKey,
44
60
  readSandboxBinaryBytes,
45
61
  readSecret,
46
62
  requireTransportableModel,
@@ -56,6 +72,7 @@ import {
56
72
  secretStoreFromClient,
57
73
  serializeSandboxProvisioningError,
58
74
  shellQuote,
75
+ shouldRestoreWorkspaceSandboxRecovery,
59
76
  splitDeferredProfileFiles,
60
77
  statSandboxFileSize,
61
78
  storeSecret,
@@ -63,8 +80,12 @@ import {
63
80
  syncSandboxMemberAdd,
64
81
  syncSandboxMemberRemove,
65
82
  syncSandboxMemberRole,
83
+ workspaceSandboxRecoveryDiagnostic,
84
+ workspaceSandboxRecoveryFromError,
85
+ workspaceSandboxRecoveryMessage,
86
+ workspaceSandboxRecoveryRecommendedActions,
66
87
  writeProfileFilesToBox
67
- } from "../chunk-QGHQ2IRC.js";
88
+ } from "../chunk-4XNCMUVI.js";
68
89
  import "../chunk-LWSJK546.js";
69
90
  import "../chunk-73F3CKVK.js";
70
91
  import "../chunk-ITCINLSU.js";
@@ -76,6 +97,7 @@ export {
76
97
  DEFAULT_PREWARM_CLAIM_TABLE,
77
98
  DEFAULT_SANDBOX_RESOURCES,
78
99
  DEFAULT_SIDECAR_PROCESS_PATTERN,
100
+ EGRESS_PROXY_RECOVERY_PHASE,
79
101
  EGRESS_PROXY_RECOVERY_REQUIRED,
80
102
  ENV_TOTAL_MAX_BYTES,
81
103
  ENV_VALUE_MAX_BYTES,
@@ -85,8 +107,16 @@ export {
85
107
  SandboxModelResolutionError,
86
108
  SandboxRecoveryFailedError,
87
109
  SandboxRuntimeAuthRefreshError,
110
+ WORKSPACE_SANDBOX_HOST_EXHAUSTED,
111
+ WORKSPACE_SANDBOX_MISSING,
112
+ WORKSPACE_SANDBOX_RECOVERY_ACTIONS,
113
+ WORKSPACE_SANDBOX_RECOVERY_CODES,
114
+ WORKSPACE_SANDBOX_SNAPSHOT_MAX_AGE_MS,
115
+ WORKSPACE_SANDBOX_UNRECOVERABLE,
116
+ WorkspaceSandboxRecoveryRequiredError,
88
117
  assertEnvWithinLimits,
89
118
  assertProvisionPayloadWithinCap,
119
+ assessWorkspaceSandboxSnapshot,
90
120
  attachReasoningEffort,
91
121
  buildAppToolMcpServers,
92
122
  buildSandboxToolFileMounts,
@@ -97,6 +127,7 @@ export {
97
127
  createSandboxPrewarmer,
98
128
  createSandboxTerminalConnectionRoute,
99
129
  createWorkspaceSandboxManager,
130
+ createWorkspaceSandboxRecoveryManager,
100
131
  deferredCorpusHash,
101
132
  deleteSecret,
102
133
  detectInteractiveQuestion,
@@ -106,15 +137,21 @@ export {
106
137
  formatSandboxProvisioningSupportDetails,
107
138
  formatSandboxProvisioningUserMessage,
108
139
  getClient,
140
+ isEgressProxyRecoveryRequiredError,
109
141
  isSandboxApiBearerAuthFailure,
110
142
  isSandboxApiSandboxMissingFailure,
111
143
  isSandboxAuthFailure,
112
144
  isSandboxHostCapacityFailure,
113
145
  isTerminalPromptEvent,
146
+ isWorkspaceSandboxRecoveryAction,
147
+ isWorkspaceSandboxRecoveryCode,
148
+ isWorkspaceSandboxRecoveryState,
149
+ isWorkspaceSandboxSnapshotRestoreError,
114
150
  mergeExtraMcp,
115
151
  mergeHistoryIntoParts,
116
152
  mintSandboxScopedToken,
117
153
  peekWorkspaceSandbox,
154
+ preferredWorkspaceSandboxRecoveryBoxKey,
118
155
  readSandboxBinaryBytes,
119
156
  readSecret,
120
157
  requireTransportableModel,
@@ -130,6 +167,7 @@ export {
130
167
  secretStoreFromClient,
131
168
  serializeSandboxProvisioningError,
132
169
  shellQuote,
170
+ shouldRestoreWorkspaceSandboxRecovery,
133
171
  splitDeferredProfileFiles,
134
172
  statSandboxFileSize,
135
173
  storeSecret,
@@ -137,6 +175,10 @@ export {
137
175
  syncSandboxMemberAdd,
138
176
  syncSandboxMemberRemove,
139
177
  syncSandboxMemberRole,
178
+ workspaceSandboxRecoveryDiagnostic,
179
+ workspaceSandboxRecoveryFromError,
180
+ workspaceSandboxRecoveryMessage,
181
+ workspaceSandboxRecoveryRecommendedActions,
140
182
  writeProfileFilesToBox
141
183
  };
142
184
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-app",
3
- "version": "0.45.5",
3
+ "version": "0.45.6",
4
4
  "packageManager": "pnpm@11.17.0",
5
5
  "description": "Build agent applications with typed chat, tools, sandboxes, integrations, billing, and evaluation.",
6
6
  "keywords": [