@poe-platform/safe-bash 0.1.736 → 0.1.738

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 (31) hide show
  1. package/dist/safe-bash/chunks/{chunk-ZFV5FGGH.js → chunk-E2FTAYLG.js} +15 -16
  2. package/dist/safe-bash/chunks/{chunk-ZFV5FGGH.js.map → chunk-E2FTAYLG.js.map} +2 -2
  3. package/dist/safe-bash/chunks/{chunk-DFNSXDHP.js → chunk-JNHKE26E.js} +2 -2
  4. package/dist/safe-bash/chunks/{chunk-N3RTTKMA.js → chunk-JTKTBT3B.js} +2 -2
  5. package/dist/safe-bash/command-assets/git_rust-NOIGQE52.wasm +0 -0
  6. package/dist/safe-bash/command-chunks/{chunk-L6GGCZOK.js → chunk-5EOMWWKN.js} +16 -15
  7. package/dist/safe-bash/command-chunks/chunk-5EOMWWKN.js.map +7 -0
  8. package/dist/safe-bash/command-chunks/{chunk-YXAPLUY4.js → chunk-WFMUMKBQ.js} +2 -2
  9. package/dist/safe-bash/core.browser.js +928 -218
  10. package/dist/safe-bash/core.browser.js.map +3 -3
  11. package/dist/safe-bash/shell/arithmetic.d.ts.map +1 -1
  12. package/dist/safe-bash/shell/arithmetic.js +10 -1
  13. package/dist/safe-bash/shell/arithmetic.js.map +1 -1
  14. package/dist/safe-bash/shell/getopts.d.ts +1 -0
  15. package/dist/safe-bash/shell/getopts.d.ts.map +1 -1
  16. package/dist/safe-bash/shell/getopts.js +71 -0
  17. package/dist/safe-bash/shell/getopts.js.map +1 -1
  18. package/dist/safe-bash/shell/runtime.d.ts +5 -0
  19. package/dist/safe-bash/shell/runtime.d.ts.map +1 -1
  20. package/dist/safe-bash/shell/runtime.js +1043 -247
  21. package/dist/safe-bash/shell/runtime.js.map +1 -1
  22. package/dist/safe-bash-command-git/index.js +1 -1
  23. package/dist/safe-bash-regex-engine/index.js +2 -2
  24. package/dist/safe-bash-regex-engine/text/regex.js +2 -2
  25. package/dist/safe-bash-regex-engine/text/replacement-buffer.js +1 -1
  26. package/package.json +2 -2
  27. package/dist/safe-bash/command-assets/git_rust-VC5UCZXR.wasm +0 -0
  28. package/dist/safe-bash/command-chunks/chunk-L6GGCZOK.js.map +0 -7
  29. /package/dist/safe-bash/chunks/{chunk-DFNSXDHP.js.map → chunk-JNHKE26E.js.map} +0 -0
  30. /package/dist/safe-bash/chunks/{chunk-N3RTTKMA.js.map → chunk-JTKTBT3B.js.map} +0 -0
  31. /package/dist/safe-bash/command-chunks/{chunk-YXAPLUY4.js.map → chunk-WFMUMKBQ.js.map} +0 -0
@@ -2881,7 +2881,6 @@ var ReplacementBuffer = class {
2881
2881
  #segments = [];
2882
2882
  #size = 0;
2883
2883
  #allocated = 0;
2884
- #tailUsed = 0;
2885
2884
  #unboundedText = "";
2886
2885
  get remaining() {
2887
2886
  return this.budget.maxBufferBytes - this.#size;
@@ -2908,20 +2907,21 @@ var ReplacementBuffer = class {
2908
2907
  let offset = start;
2909
2908
  while (offset < end) {
2910
2909
  await this.budget.checkpoint();
2911
- let tail = this.#segments.at(-1);
2912
- const available = tail ? tail.length - this.#tailUsed : 0;
2913
- const capacity = Math.min(1024, this.budget.maxBufferBytes - this.#allocated);
2914
- const length = Math.min(end - offset, available || capacity);
2915
- this.budget.step(length);
2916
- if (!available) {
2910
+ this.budget.step();
2911
+ const width = source.charCodeAt(offset) <= 255 ? 1 : 2;
2912
+ let length = 1;
2913
+ while (length < 1024 && offset + length < end) {
2917
2914
  this.budget.step();
2918
- tail = new Uint16Array(capacity);
2919
- this.#segments.push(tail);
2920
- this.#allocated += capacity;
2921
- this.#tailUsed = 0;
2922
- }
2923
- for (let index = 0; index < length; index++) tail[this.#tailUsed + index] = source.charCodeAt(offset + index);
2924
- this.#tailUsed += length;
2915
+ if ((source.charCodeAt(offset + length) <= 255 ? 1 : 2) !== width) break;
2916
+ length++;
2917
+ }
2918
+ const bytes = length * width;
2919
+ if (bytes > this.budget.maxBufferBytes - this.#allocated) throw new ProgramError("text buffer limit exceeded");
2920
+ this.budget.step(length + 1);
2921
+ const segment = width === 1 ? new Uint8Array(length) : new Uint16Array(length);
2922
+ for (let index = 0; index < length; index++) segment[index] = source.charCodeAt(offset + index);
2923
+ this.#segments.push(segment);
2924
+ this.#allocated += segment.byteLength;
2925
2925
  this.#size += length;
2926
2926
  offset += length;
2927
2927
  }
@@ -2962,7 +2962,6 @@ var ReplacementBuffer = class {
2962
2962
  this.#segments = [];
2963
2963
  this.#size = 0;
2964
2964
  this.#allocated = 0;
2965
- this.#tailUsed = 0;
2966
2965
  this.#unboundedText = "";
2967
2966
  }
2968
2967
  };
@@ -8085,4 +8084,4 @@ export {
8085
8084
  moduleProgram,
8086
8085
  parse
8087
8086
  };
8088
- //# sourceMappingURL=chunk-ZFV5FGGH.js.map
8087
+ //# sourceMappingURL=chunk-E2FTAYLG.js.map