@tangle-network/agent-app 0.60.71 → 0.60.72

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.
@@ -84,7 +84,7 @@ import {
84
84
  warmBinOf,
85
85
  warmWeekdayOf,
86
86
  writeProfileFilesToBox
87
- } from "../chunk-GIJZAJ5W.js";
87
+ } from "../chunk-MBEJPQW6.js";
88
88
  import {
89
89
  EGRESS_PROXY_RECOVERY_PHASE,
90
90
  EGRESS_PROXY_RECOVERY_REQUIRED,
@@ -12,5 +12,6 @@ export { createExportEngine, MANIFEST_SCHEMA, type ExportEngine, type ExportEngi
12
12
  export { createR2ExportStorage, createMemoryExportStorage, type ExportStorage, type R2ExportBucket } from './storage';
13
13
  export { d1WorkspaceTables, type D1ExportDatabase, type D1TableCoverage, type D1WorkspaceTablesOptions } from './d1';
14
14
  export { r2Files, kvFiles, type R2FilesBucket, type KVFilesNamespace } from './sources';
15
+ export { sandboxArchive, type ArchivableBox } from './sandbox';
15
16
  export { createSecretScanner, isSecretName, isCredentialFile, REDACTED, type SecretScanner } from './secrets';
16
17
  export type { ExportArchiveSource, ExportDataClass, ExportFile, ExportFilesSource, ExportJob, ExportJsonSource, ExportPlan, ExportPrincipal, ExportProgress, ExportRow, ExportRowsSource, ExportSource, ExportStatus, ExportUnit, StoredEntry, UnitStatus, } from './types';
@@ -1476,6 +1476,33 @@ function kvFiles(args) {
1476
1476
  }
1477
1477
  };
1478
1478
  }
1479
+
1480
+ // src/workspace-export/sandbox.ts
1481
+ var GONE = /* @__PURE__ */ new Set(["deleted", "expired", "failed"]);
1482
+ function sandboxArchive(args) {
1483
+ return {
1484
+ kind: "archive",
1485
+ name: args.name,
1486
+ dataClass: args.dataClass ?? "sandbox",
1487
+ description: args.description,
1488
+ async open() {
1489
+ const box = await args.getBox();
1490
+ if (!box || GONE.has(box.status)) return null;
1491
+ const wasStopped = box.status === "stopped";
1492
+ if (wasStopped) await box.resume();
1493
+ if (box.status !== "running" || wasStopped) await box.waitFor("running", { timeoutMs: args.resumeTimeoutMs ?? 12e4 });
1494
+ const archive = await box.fs.openArchive(args.dir ?? ".");
1495
+ if (!wasStopped || !box.stop) return archive;
1496
+ const restore = () => box.stop().catch(() => {
1497
+ });
1498
+ return archive.pipeThrough(
1499
+ new TransformStream({
1500
+ flush: () => restore()
1501
+ })
1502
+ );
1503
+ }
1504
+ };
1505
+ }
1479
1506
  export {
1480
1507
  MANIFEST_SCHEMA,
1481
1508
  REDACTED,
@@ -1488,6 +1515,7 @@ export {
1488
1515
  isCredentialFile,
1489
1516
  isSecretName,
1490
1517
  kvFiles,
1491
- r2Files
1518
+ r2Files,
1519
+ sandboxArchive
1492
1520
  };
1493
1521
  //# sourceMappingURL=index.js.map