@poe-platform/safe-bash 0.1.797 → 0.1.799

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 (195) hide show
  1. package/README.md +2 -1
  2. package/dist/pdf/index.d.ts +1 -1
  3. package/dist/pdf/model.d.ts +7 -2
  4. package/dist/safe-bash/chunks/{chunk-D2XB7XIC.js → chunk-AZAJJVFX.js} +7 -11
  5. package/dist/safe-bash/chunks/{chunk-C2NYCU7O.js → chunk-JSVX4VIA.js} +5 -1
  6. package/dist/safe-bash/chunks/{chunk-TCWZNUVP.js → chunk-SPYL72GN.js} +1 -25
  7. package/dist/safe-bash/chunks/{chunk-TGOF7VO5.js → chunk-TRVGCN3U.js} +1 -1
  8. package/dist/safe-bash/chunks/{chunk-ZXKVOJNL.js → chunk-WUNK5NXJ.js} +6 -5
  9. package/dist/safe-bash/command-chunks/{chunk-JG5W2ENK.js → chunk-43GSSUAY.js} +3 -3
  10. package/dist/safe-bash/command-chunks/{chunk-OAJUAAWH.js → chunk-464RVBGB.js} +3 -3
  11. package/dist/safe-bash/command-chunks/{chunk-25BLI6S6.js → chunk-4Y3WVMK4.js} +1 -14
  12. package/dist/safe-bash/command-chunks/{chunk-SSBFTMVI.js → chunk-4ZALPDBV.js} +2 -2
  13. package/dist/safe-bash/command-chunks/{chunk-YMQKVEIF.js → chunk-52PCQXD2.js} +2 -13
  14. package/dist/safe-bash/command-chunks/{chunk-ZCKDQGKY.js → chunk-5HDSFHGW.js} +1 -1
  15. package/dist/safe-bash/command-chunks/{chunk-JHVZYB4R.js → chunk-5MPOQ6V3.js} +1 -1
  16. package/dist/safe-bash/command-chunks/{chunk-AUAF5YBT.js → chunk-5WPI42ZW.js} +0 -7
  17. package/dist/safe-bash/command-chunks/{chunk-PPOIPMY4.js → chunk-5ZSM4UFN.js} +1 -1
  18. package/dist/safe-bash/command-chunks/{chunk-RECJB2BO.js → chunk-7BS66BXN.js} +1 -1
  19. package/dist/safe-bash/command-chunks/{chunk-GRWOVSFK.js → chunk-7D7JRRML.js} +1 -1
  20. package/dist/safe-bash/command-chunks/{chunk-E6IYUYVA.js → chunk-7L24L4UO.js} +2 -2
  21. package/dist/safe-bash/command-chunks/{chunk-HBXQWTJR.js → chunk-A5ZAV6DO.js} +1 -1
  22. package/dist/safe-bash/command-chunks/{chunk-LW34AKDM.js → chunk-AB4MXHVS.js} +4 -14
  23. package/dist/safe-bash/command-chunks/{chunk-EELNLEEP.js → chunk-AXK3H4PX.js} +1 -1
  24. package/dist/safe-bash/command-chunks/{chunk-Y55OCH37.js → chunk-AYUTO323.js} +3 -10
  25. package/dist/safe-bash/command-chunks/{chunk-DY36FDDC.js → chunk-B5BKA5WH.js} +4 -4
  26. package/dist/safe-bash/command-chunks/{chunk-YB6KVU6H.js → chunk-BDBVVZY6.js} +4 -14
  27. package/dist/safe-bash/command-chunks/{chunk-QAN7KKDZ.js → chunk-BZDDAPSV.js} +1 -1
  28. package/dist/safe-bash/command-chunks/{chunk-HZCPWYWA.js → chunk-BZPAWTUL.js} +1 -1
  29. package/dist/safe-bash/command-chunks/{chunk-RT2J5ATD.js → chunk-CPPGTBZF.js} +1 -1
  30. package/dist/safe-bash/command-chunks/{chunk-A7RIYQIF.js → chunk-DDLQ5YDB.js} +172 -167
  31. package/dist/safe-bash/command-chunks/{chunk-JEPY4UY4.js → chunk-EIVW3X3N.js} +3 -3
  32. package/dist/safe-bash/command-chunks/{chunk-C2DUYVYZ.js → chunk-ESMCX3YV.js} +138 -36
  33. package/dist/safe-bash/command-chunks/chunk-EZ7D6DXC.js +6 -0
  34. package/dist/safe-bash/command-chunks/{chunk-QGVOS3EY.js → chunk-HFII3QYO.js} +1 -1
  35. package/dist/safe-bash/command-chunks/{chunk-5EWTQJSC.js → chunk-HHP343KT.js} +1 -1
  36. package/dist/safe-bash/command-chunks/{chunk-5UA3BEGA.js → chunk-I3K5RYU4.js} +1 -1
  37. package/dist/safe-bash/command-chunks/{chunk-4MS5WZJC.js → chunk-IKS2YXZQ.js} +3 -3
  38. package/dist/safe-bash/command-chunks/{chunk-CZVBYCB5.js → chunk-IL53SJL4.js} +2 -12
  39. package/dist/safe-bash/command-chunks/{chunk-HLMUPSM6.js → chunk-JCNNOMBV.js} +2 -2
  40. package/dist/safe-bash/command-chunks/{chunk-2LLZBNLL.js → chunk-JWE54GHQ.js} +1 -1
  41. package/dist/safe-bash/command-chunks/{chunk-QLDIP3OP.js → chunk-JZSNU2MY.js} +2 -2
  42. package/dist/safe-bash/command-chunks/{chunk-2HOESGFJ.js → chunk-KMCZ6P4O.js} +2 -2
  43. package/dist/safe-bash/command-chunks/{chunk-U3ONEICA.js → chunk-KVFCSLKK.js} +1 -11
  44. package/dist/safe-bash/command-chunks/{chunk-THS4YAKG.js → chunk-LLCXZKZ6.js} +2 -2
  45. package/dist/safe-bash/command-chunks/{chunk-3TANKHBX.js → chunk-MRW5HD2D.js} +1 -6
  46. package/dist/safe-bash/command-chunks/{chunk-3WKA57FA.js → chunk-N5FGCXQJ.js} +1 -9
  47. package/dist/safe-bash/command-chunks/{chunk-ULZ7HIZP.js → chunk-NETECMOF.js} +1 -1
  48. package/dist/safe-bash/command-chunks/{chunk-2Q7UQ7R4.js → chunk-OPUJSTHS.js} +12 -12
  49. package/dist/safe-bash/command-chunks/{chunk-HVI6ALJF.js → chunk-PFAADCB5.js} +2 -4
  50. package/dist/safe-bash/command-chunks/{chunk-JXU2N6GN.js → chunk-Q7Q5GM5S.js} +2 -2
  51. package/dist/safe-bash/command-chunks/{chunk-Z5TFSVNU.js → chunk-QAKKSRNV.js} +1 -1
  52. package/dist/safe-bash/command-chunks/{chunk-KAHH4XOU.js → chunk-QNXI2UP6.js} +1 -1
  53. package/dist/safe-bash/command-chunks/{chunk-ECAK3JHR.js → chunk-QRRYN2KO.js} +21 -12
  54. package/dist/safe-bash/command-chunks/{chunk-WYOL5JNT.js → chunk-SX2X3IH4.js} +4 -4
  55. package/dist/safe-bash/command-chunks/{chunk-WBJKOTSP.js → chunk-UI32HWGS.js} +1 -1
  56. package/dist/safe-bash/command-chunks/{chunk-AC6X7Q4I.js → chunk-VVI4Z73I.js} +1 -8
  57. package/dist/safe-bash/command-chunks/{chunk-JCVXAX2G.js → chunk-XWZBMJ5B.js} +1 -1
  58. package/dist/safe-bash/command-chunks/{chunk-UUR2S7AD.js → chunk-Y6TUZWPS.js} +28 -1
  59. package/dist/safe-bash/command-chunks/{chunk-23XLM73P.js → chunk-YEOPI5SK.js} +1 -1
  60. package/dist/safe-bash/command-chunks/{chunk-PRCT7FKJ.js → chunk-YZ5SVZFD.js} +3 -3
  61. package/dist/safe-bash/command-chunks/{chunk-OGUMMTTD.js → chunk-ZJBR5Q5I.js} +4 -4
  62. package/dist/safe-bash/command-chunks/{chunk-VZ64JXHC.js → chunk-ZS3QPNUL.js} +1 -1
  63. package/dist/safe-bash/command-chunks/{chunk-VKQCNX32.js → chunk-ZT4KSS2V.js} +1 -1
  64. package/dist/safe-bash/command-chunks/{chunk-6N5V4VBN.js → chunk-ZXKW7SJ2.js} +2 -2
  65. package/dist/safe-bash/command-chunks/{pptx-KY2OJWZW-76LBHCHD.js → pptx-GBPNWNEP-7EQEVXV5.js} +8 -2
  66. package/dist/safe-bash/commands/diff-patch/shared.d.ts +0 -2
  67. package/dist/safe-bash/commands/diff-patch/shared.js +2 -11
  68. package/dist/safe-bash/commands/llm/index.browser.js +9 -1
  69. package/dist/safe-bash/commands/llm/providers/index.browser.js +6 -2
  70. package/dist/safe-bash/commands/text.js +1 -25
  71. package/dist/safe-bash/core.browser.js +1 -1
  72. package/dist/safe-bash/core.d.ts +5 -1
  73. package/dist/safe-bash/core.js +5 -1
  74. package/dist/safe-bash/full-core.browser.js +134 -5
  75. package/dist/safe-bash/lazy-optional.d.ts +13 -0
  76. package/dist/safe-bash/lazy-optional.js +118 -0
  77. package/dist/safe-bash/opt-in/commands/dd/index.js +4 -13
  78. package/dist/safe-bash/opt-in/commands/yq/native-work.js +2 -1
  79. package/dist/safe-bash/opt-in/optional/commands/shuf/input.js +3 -21
  80. package/dist/safe-bash/opt-in/optional/commands/shuf/shuf.js +4 -27
  81. package/dist/safe-bash/plugins/index.browser.js +3 -3
  82. package/dist/safe-bash/registry-entry.browser.js +2 -2
  83. package/dist/safe-bash/shell/env-warning.js +3 -2
  84. package/dist/safe-bash/shell/runtime.js +2 -2
  85. package/dist/safe-bash/shell-entry.browser.js +2 -2
  86. package/dist/safe-bash-command-csvkit/index.js +528 -498
  87. package/dist/safe-bash-command-dd/index.js +4 -13
  88. package/dist/safe-bash-command-du/budget.d.ts +0 -2
  89. package/dist/safe-bash-command-du/budget.js +1 -1
  90. package/dist/safe-bash-command-du/du.js +2 -2
  91. package/dist/safe-bash-command-du/index.js +2 -2
  92. package/dist/safe-bash-command-file/index.js +1 -1
  93. package/dist/safe-bash-command-file/shared.d.ts +0 -2
  94. package/dist/safe-bash-command-file/shared.js +1 -1
  95. package/dist/safe-bash-command-fmt/index.js +3 -15
  96. package/dist/safe-bash-command-git/git_rust.wasm +0 -0
  97. package/dist/safe-bash-command-git/wasm.generated.js +1 -1
  98. package/dist/safe-bash-command-html-to-markdown/budget.d.ts +0 -3
  99. package/dist/safe-bash-command-html-to-markdown/budget.js +1 -1
  100. package/dist/safe-bash-command-html-to-markdown/entities.js +3 -3
  101. package/dist/safe-bash-command-html-to-markdown/index.js +6 -6
  102. package/dist/safe-bash-command-html-to-markdown/input.js +5 -5
  103. package/dist/safe-bash-command-html-to-markdown/parser.js +4 -4
  104. package/dist/safe-bash-command-html-to-markdown/render.js +5 -5
  105. package/dist/safe-bash-command-html-to-markdown/text.js +2 -2
  106. package/dist/safe-bash-command-iconv/command.js +5 -5
  107. package/dist/safe-bash-command-iconv/index.js +5 -5
  108. package/dist/safe-bash-command-iconv/internal.d.ts +0 -2
  109. package/dist/safe-bash-command-iconv/internal.js +1 -1
  110. package/dist/safe-bash-command-iconv/lifecycle.js +2 -2
  111. package/dist/safe-bash-command-iconv/options.js +2 -2
  112. package/dist/safe-bash-command-iconv/reader.js +2 -2
  113. package/dist/safe-bash-command-llm/base64-stream.d.ts +2 -0
  114. package/dist/safe-bash-command-llm/chat-json.d.ts +10 -0
  115. package/dist/safe-bash-command-llm/index.d.ts +2 -1
  116. package/dist/safe-bash-command-llm/index.js +11 -2
  117. package/dist/safe-bash-command-llm/json-string.d.ts +2 -0
  118. package/dist/safe-bash-command-llm/json-value.d.ts +2 -0
  119. package/dist/safe-bash-command-llm/openai.d.ts +1 -0
  120. package/dist/safe-bash-command-llm/openai.js +4 -2
  121. package/dist/safe-bash-command-llm/provider-serialization.d.ts +6 -0
  122. package/dist/safe-bash-command-llm/providers/index.d.ts +2 -1
  123. package/dist/safe-bash-command-llm/providers/index.js +12 -3
  124. package/dist/safe-bash-command-llm/providers/openai.d.ts +1 -1
  125. package/dist/safe-bash-command-llm/providers/openai.js +4 -2
  126. package/dist/safe-bash-command-numfmt/index.js +4 -18
  127. package/dist/safe-bash-command-pandoc/citeproc-filters.js +1 -1
  128. package/dist/safe-bash-command-pandoc/command.js +3 -3
  129. package/dist/safe-bash-command-pandoc/index.js +3 -3
  130. package/dist/safe-bash-command-pr/command.js +5 -5
  131. package/dist/safe-bash-command-pr/format.js +2 -2
  132. package/dist/safe-bash-command-pr/index.js +5 -5
  133. package/dist/safe-bash-command-pr/internal.d.ts +0 -2
  134. package/dist/safe-bash-command-pr/internal.js +1 -1
  135. package/dist/safe-bash-command-pr/io.js +2 -2
  136. package/dist/safe-bash-command-pr/options.js +2 -2
  137. package/dist/safe-bash-command-shuf/input.js +3 -21
  138. package/dist/safe-bash-command-shuf/shuf.js +4 -27
  139. package/dist/safe-bash-command-split/index.js +3 -3
  140. package/dist/safe-bash-command-split/io.d.ts +0 -2
  141. package/dist/safe-bash-command-split/io.js +1 -1
  142. package/dist/safe-bash-command-split/outputs.js +2 -2
  143. package/dist/safe-bash-command-split/split.js +3 -3
  144. package/dist/safe-bash-command-ssconvert/index.js +1 -1
  145. package/dist/safe-bash-command-tree/arguments.js +3 -3
  146. package/dist/safe-bash-command-tree/charset.js +1 -1
  147. package/dist/safe-bash-command-tree/index.js +4 -4
  148. package/dist/safe-bash-command-tree/io.d.ts +0 -1
  149. package/dist/safe-bash-command-tree/io.js +1 -1
  150. package/dist/safe-bash-command-tree/pattern.js +2 -2
  151. package/dist/safe-bash-command-tree/tree.js +4 -4
  152. package/dist/safe-bash-command-tsort/command.js +4 -4
  153. package/dist/safe-bash-command-tsort/graph.js +2 -2
  154. package/dist/safe-bash-command-tsort/index.js +4 -4
  155. package/dist/safe-bash-command-tsort/internal.d.ts +0 -2
  156. package/dist/safe-bash-command-tsort/internal.js +1 -1
  157. package/dist/safe-bash-command-tsort/io.js +2 -2
  158. package/dist/safe-bash-command-yq/native-work.js +2 -1
  159. package/dist/safe-bash-io-engine/commands/archive/internal.d.ts +0 -1
  160. package/dist/safe-bash-io-engine/commands/archive/internal.js +3 -7
  161. package/dist/safe-bash-io-engine/shell/pattern.js +1 -1
  162. package/dist/safe-bash-io-engine/shell/string-operations.d.ts +0 -2
  163. package/dist/safe-bash-io-engine/shell/string-operations.js +1 -1
  164. package/dist/safe-bash-line-ending-engine/internal.d.ts +0 -2
  165. package/dist/safe-bash-line-ending-engine/internal.js +1 -9
  166. package/dist/safe-bash-query-engine/capture.js +5 -5
  167. package/dist/safe-bash-query-engine/dates.js +2 -2
  168. package/dist/safe-bash-query-engine/delpaths.js +5 -5
  169. package/dist/safe-bash-query-engine/formats.js +3 -3
  170. package/dist/safe-bash-query-engine/index.js +15 -15
  171. package/dist/safe-bash-query-engine/indices.js +5 -5
  172. package/dist/safe-bash-query-engine/input.js +2 -2
  173. package/dist/safe-bash-query-engine/interpreter.js +13 -13
  174. package/dist/safe-bash-query-engine/limits.js +1 -1
  175. package/dist/safe-bash-query-engine/parser.js +2 -2
  176. package/dist/safe-bash-query-engine/query-core.js +15 -15
  177. package/dist/safe-bash-query-engine/recurse.js +2 -2
  178. package/dist/safe-bash-query-engine/regex.js +5 -5
  179. package/dist/safe-bash-query-engine/split.js +2 -2
  180. package/dist/safe-bash-query-engine/splits.js +6 -6
  181. package/dist/safe-bash-query-engine/values.js +4 -4
  182. package/dist/safe-bash-regex-engine/ere/limits.d.ts +0 -1
  183. package/dist/safe-bash-regex-engine/ere/limits.js +1 -1
  184. package/dist/safe-bash-regex-engine/ere/matcher.js +5 -5
  185. package/dist/safe-bash-regex-engine/ere/syntax.js +2 -2
  186. package/dist/safe-bash-regex-engine/execution/bounded-provider.js +2 -4
  187. package/dist/safe-bash-text-stream-engine/stream-format/shared.d.ts +0 -2
  188. package/dist/safe-bash-text-stream-engine/stream-format/shared.js +1 -9
  189. package/dist/safe-bash-xml-engine/document.js +2 -2
  190. package/dist/safe-bash-xml-engine/index.js +3 -3
  191. package/dist/safe-bash-xml-engine/io.js +1 -1
  192. package/dist/safe-bash-xml-engine/limits.d.ts +0 -2
  193. package/dist/safe-bash-xml-engine/limits.js +1 -1
  194. package/dist/safe-bash-xml-engine/query.js +2 -2
  195. package/package.json +5 -4
@@ -4,7 +4,7 @@ import { assertCountedFileOutput, writeFileOutputCounted } from "./filesystem-ou
4
4
  import { FsError } from "@poe-platform/safe-fs/core";
5
5
  import { writeBytes } from "../safe-bash-contracts/io.js";
6
6
  import { createOutputOperation } from "../safe-bash-contracts/output.js";
7
- import { hasYieldCheckpoint, monotonicNow, yieldTurn } from "../safe-bash-contracts/yield.js";
7
+ import { yieldTurn } from "../safe-bash-contracts/yield.js";
8
8
  import { DdConverter } from "./conversions.js";
9
9
  import { errorMessage, openDdFile, writeDdOutput } from "./io.js";
10
10
  import { DdError, parseDd, quote } from "./options.js";
@@ -246,15 +246,6 @@ export function createDdCommand(options = {}) {
246
246
  let previousShort = 0;
247
247
  let partialRecord = 0;
248
248
  let warned = false;
249
- let lastYieldTime = monotonicNow();
250
- let yieldChecks = 0;
251
- const maybeYield = async () => {
252
- context.signal.throwIfAborted();
253
- if (++yieldChecks % 16 === 0 || hasYieldCheckpoint(context.signal) || monotonicNow() - lastYieldTime >= 16) {
254
- await yieldTurn(context.signal);
255
- lastYieldTime = monotonicNow();
256
- }
257
- };
258
249
  const read = async (size) => {
259
250
  context.signal.throwIfAborted();
260
251
  if (++readOperations > limits.maxReadOperations)
@@ -298,7 +289,7 @@ export function createDdCommand(options = {}) {
298
289
  skipRecords--;
299
290
  else
300
291
  skipRemainder = 0n;
301
- await maybeYield();
292
+ await yieldTurn(context.signal);
302
293
  }
303
294
  if (skipped < skipOffset && plan.status !== "none")
304
295
  await diagnostic(`${quote(plan.input ?? "standard input")}: cannot skip to specified offset`);
@@ -360,7 +351,7 @@ export function createDdCommand(options = {}) {
360
351
  report.stats.outputPartial++;
361
352
  }
362
353
  }
363
- await maybeYield();
354
+ await yieldTurn(context.signal);
364
355
  };
365
356
  const outputBuffer = new Uint8Array(copying && plan.twoBuffers ? obs : 0);
366
357
  let used = 0;
@@ -450,7 +441,7 @@ export function createDdCommand(options = {}) {
450
441
  await converter.push(chunk);
451
442
  else
452
443
  await emit(chunk);
453
- await maybeYield();
444
+ await yieldTurn(context.signal);
454
445
  }
455
446
  await converter?.finish();
456
447
  if (used) {
@@ -12,7 +12,6 @@ export declare class Budget {
12
12
  private metadata;
13
13
  private output;
14
14
  private operations;
15
- private lastYield;
16
15
  private closed;
17
16
  private completion;
18
17
  private readonly cancellation;
@@ -20,7 +19,6 @@ export declare class Budget {
20
19
  private outputSignal;
21
20
  private readonly work;
22
21
  private readonly pending;
23
- private readonly timers;
24
22
  private boundSignal;
25
23
  private readonly onSignalAbort;
26
24
  constructor(context: CommandContext, limits: DuLimits, caller?: CommandContext);
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Budget,
3
3
  DuLimitError
4
- } from "../safe-bash/command-chunks/chunk-YB6KVU6H.js";
4
+ } from "../safe-bash/command-chunks/chunk-BDBVVZY6.js";
5
5
  import "../safe-bash/command-chunks/chunk-PO2KMW6A.js";
6
6
  import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
7
7
  export {
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createDuCommand
3
- } from "../safe-bash/command-chunks/chunk-23XLM73P.js";
3
+ } from "../safe-bash/command-chunks/chunk-YEOPI5SK.js";
4
4
  import "../safe-bash/command-chunks/chunk-G5IVXGFR.js";
5
- import "../safe-bash/command-chunks/chunk-YB6KVU6H.js";
5
+ import "../safe-bash/command-chunks/chunk-BDBVVZY6.js";
6
6
  import "../safe-bash/command-chunks/chunk-ZXC4QWX7.js";
7
7
  import "../safe-bash/command-chunks/chunk-PO2KMW6A.js";
8
8
  import "../safe-bash/command-chunks/chunk-UGN3TDTG.js";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createDuCommand
3
- } from "../safe-bash/command-chunks/chunk-23XLM73P.js";
3
+ } from "../safe-bash/command-chunks/chunk-YEOPI5SK.js";
4
4
  import "../safe-bash/command-chunks/chunk-G5IVXGFR.js";
5
- import "../safe-bash/command-chunks/chunk-YB6KVU6H.js";
5
+ import "../safe-bash/command-chunks/chunk-BDBVVZY6.js";
6
6
  import "../safe-bash/command-chunks/chunk-ZXC4QWX7.js";
7
7
  import {
8
8
  blockSize,
@@ -4,7 +4,7 @@ import {
4
4
  SharedBudget,
5
5
  limitMessage,
6
6
  settings
7
- } from "../safe-bash/command-chunks/chunk-Y55OCH37.js";
7
+ } from "../safe-bash/command-chunks/chunk-AYUTO323.js";
8
8
  import {
9
9
  classify
10
10
  } from "../safe-bash/command-chunks/chunk-NIEIGZ2T.js";
@@ -27,8 +27,6 @@ export declare class SharedBudget {
27
27
  private steps;
28
28
  private failureUnits;
29
29
  private untilYield;
30
- private yieldChecks;
31
- private lastYield;
32
30
  private readonly controller;
33
31
  private timer;
34
32
  private readonly deadline;
@@ -4,7 +4,7 @@ import {
4
4
  SharedBudget,
5
5
  limitMessage,
6
6
  settings
7
- } from "../safe-bash/command-chunks/chunk-Y55OCH37.js";
7
+ } from "../safe-bash/command-chunks/chunk-AYUTO323.js";
8
8
  import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
9
9
  export {
10
10
  FileFailure,
@@ -2124,7 +2124,7 @@ import { commandRuntimeIdentity, CommandArgumentIdentityError, FsError, getComma
2124
2124
  import { isAbsolutePath, validatePath } from "@poe-platform/safe-fs/core";
2125
2125
  import { assertCommandRequirements } from "../safe-bash-contracts/command-requirements.js";
2126
2126
  import { createOutputOperation } from "../safe-bash-contracts/output.js";
2127
- import { hasYieldCheckpoint, inheritYieldCheckpoint, monotonicNow, runYieldCheckpoint, yieldTurn as contractYieldTurn } from "../safe-bash-contracts/yield.js";
2127
+ import { inheritYieldCheckpoint, yieldTurn as contractYieldTurn } from "../safe-bash-contracts/yield.js";
2128
2128
 
2129
2129
  // packages/safe-bash-command-fmt/src/sdk.ts
2130
2130
  init_buffer();
@@ -2395,18 +2395,6 @@ async function fmt(context, configuration = {}) {
2395
2395
  let emptyChunks = 0;
2396
2396
  let chunks = 0;
2397
2397
  let checkpoints = 0;
2398
- let lastYield = monotonicNow();
2399
- let yieldChecks = 0;
2400
- const maybeYield = async (signal) => {
2401
- const now = monotonicNow();
2402
- if (++yieldChecks % 16 === 0 || now - lastYield >= 25 || hasYieldCheckpoint(signal)) {
2403
- lastYield = now;
2404
- await contractYieldTurn(signal);
2405
- lastYield = monotonicNow();
2406
- } else {
2407
- await runYieldCheckpoint(signal);
2408
- }
2409
- };
2410
2398
  let exitCode = 0;
2411
2399
  for (const { name, bytes: nameBytes } of settings.files) {
2412
2400
  local.signal.throwIfAborted();
@@ -2455,7 +2443,7 @@ async function fmt(context, configuration = {}) {
2455
2443
  }
2456
2444
  }
2457
2445
  if (bytes2?.length === 0 && ++emptyChunks > (limits.emptyChunks ?? Infinity)) throw new FmtError("LIMIT", "empty input chunk limit exceeded");
2458
- if (++chunks % 64 === 0) await maybeYield(local.signal);
2446
+ if (++chunks % 64 === 0) await contractYieldTurn(local.signal);
2459
2447
  step = machine.next(bytes2);
2460
2448
  } else {
2461
2449
  if (step.value) {
@@ -2470,7 +2458,7 @@ async function fmt(context, configuration = {}) {
2470
2458
  } else {
2471
2459
  await output(outputContext, step.value);
2472
2460
  }
2473
- } else if (++checkpoints % 64 === 0) await maybeYield(local.signal);
2461
+ } else if (++checkpoints % 64 === 0) await contractYieldTurn(local.signal);
2474
2462
  step = machine.next();
2475
2463
  }
2476
2464
  }