@poe-platform/safe-bash 0.1.250 → 0.1.252

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.
@@ -8662,6 +8662,9 @@ var ValueStore = class _ValueStore {
8662
8662
  }
8663
8663
  };
8664
8664
 
8665
+ // packages/safe-bash/src/shell/runtime.ts
8666
+ import { scopeFileSystem } from "@poe-platform/safe-fs/core";
8667
+
8665
8668
  // packages/safe-bash/src/shell/brace-expansion.ts
8666
8669
  init_platform();
8667
8670
  var BraceExpansionFailure = class extends Error {
@@ -11608,6 +11611,7 @@ var defaultLimits = {
11608
11611
  maxInputBytes: 32 * 1024 * 1024,
11609
11612
  maxOutputBytes: 16 * 1024 * 1024,
11610
11613
  maxCommands: 1e4,
11614
+ maxFileSystemOperations: 1e5,
11611
11615
  maxRedirects: 64,
11612
11616
  maxPipelineStages: 64,
11613
11617
  maxLoopIterations: 1e4,
@@ -11712,6 +11716,7 @@ var Budget = class {
11712
11716
  #wallClockTimer;
11713
11717
  #wallClockDeadline = 0;
11714
11718
  #pipelineStages = 0;
11719
+ #fileSystemOperations = 0;
11715
11720
  #cpuStarted = monotonicNow();
11716
11721
  #armWallClock() {
11717
11722
  const remaining = this.#wallClockDeadline - Date.now();
@@ -11741,6 +11746,11 @@ var Budget = class {
11741
11746
  this.signal.throwIfAborted();
11742
11747
  if (++this.commands > this.limits.maxCommands) this.fail("maxCommands");
11743
11748
  }
11749
+ fileSystemOperation() {
11750
+ this.cpuCheckpoint();
11751
+ if (this.#fileSystemOperations >= this.limits.maxFileSystemOperations) this.fail("maxFileSystemOperations");
11752
+ this.#fileSystemOperations++;
11753
+ }
11744
11754
  reservePipelineStages(count2) {
11745
11755
  this.signal.throwIfAborted();
11746
11756
  if (count2 > this.limits.maxPipelineStages - this.#pipelineStages) this.fail("maxPipelineStages");
@@ -12589,6 +12599,7 @@ var Runtime = class _Runtime {
12589
12599
  this.cancellationDepth = cancellationDepth;
12590
12600
  this.cancellationMaxDepth = cancellationMaxDepth;
12591
12601
  this.outcomeFrame = outcomeFrame;
12602
+ this.fs = scopeFileSystem(fs, () => budget.fileSystemOperation(), signal);
12592
12603
  const checkpoint = () => budget.cpuCheckpoint();
12593
12604
  registerYieldCheckpoint(signal, checkpoint);
12594
12605
  registerYieldCheckpoint(commandSignal, checkpoint);
@@ -17685,6 +17696,7 @@ var cloudflareWorkerLimits = Object.freeze({
17685
17696
  maxInputBytes: 4 * 1024 * 1024,
17686
17697
  maxOutputBytes: 4 * 1024 * 1024,
17687
17698
  maxCommands: 1e3,
17699
+ maxFileSystemOperations: 1e4,
17688
17700
  maxRedirects: 64,
17689
17701
  maxPipelineStages: 64,
17690
17702
  maxLoopIterations: 1e3,
@@ -17699,7 +17711,11 @@ var cloudflareWorkerLimits = Object.freeze({
17699
17711
 
17700
17712
  // packages/safe-bash/src/fs/memory/index.ts
17701
17713
  init_platform();
17702
- import { createMemoryFileSystem, MemoryFileSystem } from "@poe-platform/safe-fs/core";
17714
+ import {
17715
+ createMemoryFileSystem,
17716
+ defaultMemoryFileSystemLimits,
17717
+ MemoryFileSystem
17718
+ } from "@poe-platform/safe-fs/core";
17703
17719
 
17704
17720
  // packages/safe-bash/src/fs/readonly/index.ts
17705
17721
  init_platform();
@@ -21441,6 +21457,7 @@ export {
21441
21457
  createOutputOperation,
21442
21458
  createOverlayFileSystem,
21443
21459
  createReadOnlyFileSystem,
21460
+ defaultMemoryFileSystemLimits,
21444
21461
  dirname,
21445
21462
  evaluateCommandSupport,
21446
21463
  extname,