@poe-platform/safe-bash 0.1.778 → 0.1.780

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 (97) hide show
  1. package/dist/safe-bash/command-chunks/{chunk-ELX7X5SF.js → chunk-2MPJNOGU.js} +3 -3
  2. package/dist/safe-bash/command-chunks/{chunk-NT6N3KCA.js → chunk-36A7T7VI.js} +1 -1
  3. package/dist/safe-bash/command-chunks/{chunk-W7K4JN2M.js → chunk-3AQJQW6S.js} +1 -1
  4. package/dist/safe-bash/command-chunks/{chunk-T6ZPGCNJ.js → chunk-3DVCCMBJ.js} +2 -1
  5. package/dist/safe-bash/command-chunks/{chunk-XQZ3OG7K.js → chunk-442UWLQR.js} +1 -1
  6. package/dist/safe-bash/command-chunks/{chunk-W6UOCPP2.js → chunk-7THHNO2E.js} +1 -1
  7. package/dist/safe-bash/command-chunks/{chunk-ZMCVEYVX.js → chunk-AXO7RDN5.js} +1 -1
  8. package/dist/safe-bash/command-chunks/{chunk-PLOA5HZJ.js → chunk-BHOK6HA3.js} +4 -4
  9. package/dist/safe-bash/command-chunks/{chunk-TEVDQ3XP.js → chunk-C2JGBXOY.js} +2 -2
  10. package/dist/safe-bash/command-chunks/{chunk-MANR67FK.js → chunk-CD2SMRKD.js} +4 -4
  11. package/dist/safe-bash/command-chunks/{chunk-IFMCWC7A.js → chunk-CXDWDFFU.js} +2 -2
  12. package/dist/safe-bash/command-chunks/{chunk-TETIL2QG.js → chunk-FDJBYW3P.js} +1 -1
  13. package/dist/safe-bash/command-chunks/{chunk-OTTXGYBL.js → chunk-G3O44ZGT.js} +2 -2
  14. package/dist/safe-bash/command-chunks/{chunk-TUX2ZVRV.js → chunk-G5XIFXNF.js} +1 -1
  15. package/dist/safe-bash/command-chunks/{chunk-3PBP2NWM.js → chunk-GEHF4YAY.js} +1 -1
  16. package/dist/safe-bash/command-chunks/{chunk-ACRMXIQC.js → chunk-JUMF6JDJ.js} +10 -10
  17. package/dist/safe-bash/command-chunks/{chunk-B7CSA2AN.js → chunk-KEMWQP25.js} +1 -1
  18. package/dist/safe-bash/command-chunks/{chunk-VGKASRY7.js → chunk-KI2XV6GF.js} +1 -1
  19. package/dist/safe-bash/command-chunks/{chunk-T4BURXBK.js → chunk-KL4ODNMV.js} +3 -3
  20. package/dist/safe-bash/command-chunks/{chunk-YRMCH7OE.js → chunk-LCR6YMBL.js} +1 -1
  21. package/dist/safe-bash/command-chunks/{chunk-YUBBOIPH.js → chunk-LP5NRR5O.js} +1 -1
  22. package/dist/safe-bash/command-chunks/{chunk-CUFCNL6G.js → chunk-MTKXVRXL.js} +1 -1
  23. package/dist/safe-bash/command-chunks/{chunk-4SZIRINP.js → chunk-OEPERWLZ.js} +2 -1
  24. package/dist/safe-bash/command-chunks/{chunk-QYSAAJ6K.js → chunk-PUIGJ37F.js} +1 -1
  25. package/dist/safe-bash/command-chunks/{chunk-O4ARSYST.js → chunk-QSD4I3TT.js} +4 -3
  26. package/dist/safe-bash/command-chunks/{chunk-KDVJQQVT.js → chunk-QTKPEWR7.js} +4 -4
  27. package/dist/safe-bash/command-chunks/{chunk-EYRJX6FJ.js → chunk-TICYYKJB.js} +2 -1
  28. package/dist/safe-bash/command-chunks/{chunk-TKBJACLG.js → chunk-VXDCTI33.js} +1 -1
  29. package/dist/safe-bash/command-chunks/{chunk-MAZIL3QC.js → chunk-WQHCF6N6.js} +1 -1
  30. package/dist/safe-bash/command-chunks/{chunk-I7PJVVOO.js → chunk-XFQAGBAV.js} +1 -1
  31. package/dist/safe-bash/command-chunks/{chunk-DYCEVLVC.js → chunk-Y6YHBQIS.js} +1 -1
  32. package/dist/safe-bash/command-chunks/{chunk-OPRPIHKA.js → chunk-ZGBHQQGL.js} +1 -1
  33. package/dist/safe-bash/command-chunks/{chunk-6QG3YR2F.js → chunk-ZPQ5OCKE.js} +1 -1
  34. package/dist/safe-bash/commands/diff-patch/shared.d.ts +1 -0
  35. package/dist/safe-bash/commands/diff-patch/shared.js +2 -1
  36. package/dist/safe-bash/core.browser.js +36 -19
  37. package/dist/safe-bash/opt-in/commands/dd/index.js +2 -1
  38. package/dist/safe-bash/opt-in/commands/shuf/input.js +4 -2
  39. package/dist/safe-bash/opt-in/commands/shuf/shuf.js +4 -3
  40. package/dist/safe-bash/shell/runtime.js +42 -24
  41. package/dist/safe-bash-command-dd/index.js +2 -1
  42. package/dist/safe-bash-command-du/budget.js +1 -1
  43. package/dist/safe-bash-command-du/du.js +2 -2
  44. package/dist/safe-bash-command-du/index.js +2 -2
  45. package/dist/safe-bash-command-file/index.js +1 -1
  46. package/dist/safe-bash-command-file/shared.d.ts +1 -0
  47. package/dist/safe-bash-command-file/shared.js +1 -1
  48. package/dist/safe-bash-command-fmt/index.js +2 -1
  49. package/dist/safe-bash-command-html-to-markdown/budget.js +1 -1
  50. package/dist/safe-bash-command-html-to-markdown/entities.js +3 -3
  51. package/dist/safe-bash-command-html-to-markdown/index.js +6 -6
  52. package/dist/safe-bash-command-html-to-markdown/input.js +5 -5
  53. package/dist/safe-bash-command-html-to-markdown/parser.js +4 -4
  54. package/dist/safe-bash-command-html-to-markdown/render.js +5 -5
  55. package/dist/safe-bash-command-html-to-markdown/text.js +2 -2
  56. package/dist/safe-bash-command-iconv/command.js +5 -5
  57. package/dist/safe-bash-command-iconv/index.js +5 -5
  58. package/dist/safe-bash-command-iconv/internal.js +1 -1
  59. package/dist/safe-bash-command-iconv/lifecycle.js +2 -2
  60. package/dist/safe-bash-command-iconv/options.js +2 -2
  61. package/dist/safe-bash-command-iconv/reader.js +2 -2
  62. package/dist/safe-bash-command-numfmt/index.js +5 -3
  63. package/dist/safe-bash-command-pr/command.js +5 -5
  64. package/dist/safe-bash-command-pr/format.js +2 -2
  65. package/dist/safe-bash-command-pr/index.js +5 -5
  66. package/dist/safe-bash-command-pr/internal.d.ts +1 -0
  67. package/dist/safe-bash-command-pr/internal.js +1 -1
  68. package/dist/safe-bash-command-pr/io.js +2 -2
  69. package/dist/safe-bash-command-pr/options.js +2 -2
  70. package/dist/safe-bash-command-shuf/input.js +4 -2
  71. package/dist/safe-bash-command-shuf/shuf.js +4 -3
  72. package/dist/safe-bash-command-split/index.js +3 -3
  73. package/dist/safe-bash-command-split/io.d.ts +1 -0
  74. package/dist/safe-bash-command-split/io.js +1 -1
  75. package/dist/safe-bash-command-split/outputs.js +2 -2
  76. package/dist/safe-bash-command-split/split.js +3 -3
  77. package/dist/safe-bash-command-tree/arguments.js +3 -3
  78. package/dist/safe-bash-command-tree/charset.js +1 -1
  79. package/dist/safe-bash-command-tree/index.js +4 -4
  80. package/dist/safe-bash-command-tree/io.js +1 -1
  81. package/dist/safe-bash-command-tree/pattern.js +2 -2
  82. package/dist/safe-bash-command-tree/tree.js +4 -4
  83. package/dist/safe-bash-command-tsort/command.js +4 -4
  84. package/dist/safe-bash-command-tsort/graph.js +2 -2
  85. package/dist/safe-bash-command-tsort/index.js +4 -4
  86. package/dist/safe-bash-command-tsort/internal.js +1 -1
  87. package/dist/safe-bash-command-tsort/io.js +2 -2
  88. package/dist/safe-bash-io-engine/commands/archive/internal.js +2 -2
  89. package/dist/safe-bash-io-engine/shell/pattern.js +1 -1
  90. package/dist/safe-bash-io-engine/shell/string-operations.d.ts +1 -0
  91. package/dist/safe-bash-io-engine/shell/string-operations.js +1 -1
  92. package/dist/safe-bash-query-engine/index.js +2 -2
  93. package/dist/safe-bash-query-engine/parser.js +1 -1
  94. package/dist/safe-bash-query-engine/query-core.js +2 -2
  95. package/dist/safe-bash-text-stream-engine/stream-format/shared.d.ts +1 -0
  96. package/dist/safe-bash-text-stream-engine/stream-format/shared.js +2 -1
  97. package/package.json +2 -2
@@ -22,6 +22,7 @@ export function createShufCommand(options = {}) {
22
22
  description: "Write a random permutation of input records",
23
23
  async execute(context) {
24
24
  let lastYield = monotonicNow();
25
+ let yieldChecks = 0;
25
26
  let random;
26
27
  let output;
27
28
  let source;
@@ -155,7 +156,7 @@ export function createShufCommand(options = {}) {
155
156
  }
156
157
  seen++;
157
158
  if (seen % 1024n === 0n) {
158
- if (hasYieldCheckpoint(context.signal) || monotonicNow() - lastYield >= 25) {
159
+ if (++yieldChecks % 16 === 0 || hasYieldCheckpoint(context.signal) || monotonicNow() - lastYield >= 25) {
159
160
  await yieldTurn(context.signal);
160
161
  lastYield = monotonicNow();
161
162
  }
@@ -187,7 +188,7 @@ export function createShufCommand(options = {}) {
187
188
  swaps.set(chosen, swaps.get(index) ?? index);
188
189
  swaps.delete(index);
189
190
  if (index % 1024n === 1023n) {
190
- if (hasYieldCheckpoint(context.signal) || monotonicNow() - lastYield >= 25) {
191
+ if (++yieldChecks % 16 === 0 || hasYieldCheckpoint(context.signal) || monotonicNow() - lastYield >= 25) {
191
192
  await yieldTurn(context.signal);
192
193
  lastYield = monotonicNow();
193
194
  }
@@ -227,7 +228,7 @@ export function createShufCommand(options = {}) {
227
228
  diagnostic = "write error";
228
229
  await sink.write(line);
229
230
  if (index % 256n === 255n) {
230
- if (hasYieldCheckpoint(context.signal) || monotonicNow() - lastYield >= 25) {
231
+ if (++yieldChecks % 16 === 0 || hasYieldCheckpoint(context.signal) || monotonicNow() - lastYield >= 25) {
231
232
  await yieldTurn(context.signal);
232
233
  lastYield = monotonicNow();
233
234
  }
@@ -29678,9 +29678,27 @@ export class Runtime {
29678
29678
  const normPat = syncPosixRegexSource(patSpec);
29679
29679
  if (normPat === undefined)
29680
29680
  return undefined;
29681
- const jsPat = isExtended
29682
- ? normPat
29683
- : normPat.replace(/\\([+?()|])/g, "$1");
29681
+ let jsPat = normPat;
29682
+ if (!isExtended) {
29683
+ jsPat = "";
29684
+ let inBracket = false;
29685
+ for (let i = 0; i < normPat.length; i++) {
29686
+ const ch = normPat[i];
29687
+ if (ch === "\\") {
29688
+ const next = normPat[++i];
29689
+ if (next === undefined)
29690
+ return undefined;
29691
+ jsPat += !inBracket && "+?(){}|".includes(next) ? next : "\\" + next;
29692
+ }
29693
+ else {
29694
+ if (ch === "[")
29695
+ inBracket = true;
29696
+ else if (ch === "]")
29697
+ inBracket = false;
29698
+ jsPat += !inBracket && "+?(){}|".includes(ch) ? "\\" + ch : ch;
29699
+ }
29700
+ }
29701
+ }
29684
29702
  try {
29685
29703
  return new RegExp(jsPat);
29686
29704
  }
@@ -31321,27 +31339,6 @@ export class Runtime {
31321
31339
  : (l.length === 0 ? [] : l.split(awkSep));
31322
31340
  if (rowPred && !rowPred(l, fields, li + 1))
31323
31341
  continue;
31324
- if (subRe) {
31325
- if (subTarget === "0") {
31326
- l = l.replace(subRe, matched => subRep.split("&").join(matched));
31327
- fields = awkSep === undefined || awkSep === " "
31328
- ? l.split(/[ \t]+/).filter(Boolean)
31329
- : (l.length === 0 ? [] : l.split(awkSep));
31330
- }
31331
- else {
31332
- const tIdx = subTarget === "NF" ? fields.length : Number(subTarget);
31333
- if (tIdx >= 1 && tIdx <= fields.length) {
31334
- fields = [...fields];
31335
- let replaced = false;
31336
- fields[tIdx - 1] = fields[tIdx - 1].replace(subRe, matched => {
31337
- replaced = true;
31338
- return subRep.split("&").join(matched);
31339
- });
31340
- if (replaced)
31341
- l = fields.join(ofs);
31342
- }
31343
- }
31344
- }
31345
31342
  if (preAssigns.length > 0) {
31346
31343
  for (let ai = 0; ai < preAssigns.length; ai++) {
31347
31344
  const pa = preAssigns[ai];
@@ -31422,6 +31419,27 @@ export class Runtime {
31422
31419
  }
31423
31420
  }
31424
31421
  }
31422
+ if (subRe) {
31423
+ if (subTarget === "0") {
31424
+ l = l.replace(subRe, matched => subRep.split("&").join(matched));
31425
+ fields = awkSep === undefined || awkSep === " "
31426
+ ? l.split(/[ \t]+/).filter(Boolean)
31427
+ : (l.length === 0 ? [] : l.split(awkSep));
31428
+ }
31429
+ else {
31430
+ const tIdx = subTarget === "NF" ? fields.length : Number(subTarget);
31431
+ if (tIdx >= 1 && tIdx <= fields.length) {
31432
+ fields = [...fields];
31433
+ let replaced = false;
31434
+ fields[tIdx - 1] = fields[tIdx - 1].replace(subRe, matched => {
31435
+ replaced = true;
31436
+ return subRep.split("&").join(matched);
31437
+ });
31438
+ if (replaced)
31439
+ l = fields.join(ofs);
31440
+ }
31441
+ }
31442
+ }
31425
31443
  if (parts.length === 1 && parts[0].kind === "field" && parts[0].token === "0") {
31426
31444
  outLines.push(l);
31427
31445
  continue;
@@ -247,9 +247,10 @@ export function createDdCommand(options = {}) {
247
247
  let partialRecord = 0;
248
248
  let warned = false;
249
249
  let lastYieldTime = monotonicNow();
250
+ let yieldChecks = 0;
250
251
  const maybeYield = async () => {
251
252
  context.signal.throwIfAborted();
252
- if (hasYieldCheckpoint(context.signal) || monotonicNow() - lastYieldTime >= 16) {
253
+ if (++yieldChecks % 16 === 0 || hasYieldCheckpoint(context.signal) || monotonicNow() - lastYieldTime >= 16) {
253
254
  await yieldTurn(context.signal);
254
255
  lastYieldTime = monotonicNow();
255
256
  }
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Budget,
3
3
  DuLimitError
4
- } from "../safe-bash/command-chunks/chunk-TETIL2QG.js";
4
+ } from "../safe-bash/command-chunks/chunk-FDJBYW3P.js";
5
5
  import "../safe-bash/command-chunks/chunk-FPUJFPKO.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-YRMCH7OE.js";
3
+ } from "../safe-bash/command-chunks/chunk-LCR6YMBL.js";
4
4
  import "../safe-bash/command-chunks/chunk-D7FJPOCA.js";
5
- import "../safe-bash/command-chunks/chunk-TETIL2QG.js";
5
+ import "../safe-bash/command-chunks/chunk-FDJBYW3P.js";
6
6
  import "../safe-bash/command-chunks/chunk-EDH2EAAY.js";
7
7
  import "../safe-bash/command-chunks/chunk-FPUJFPKO.js";
8
8
  import "../safe-bash/command-chunks/chunk-FGB3XLDL.js";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createDuCommand
3
- } from "../safe-bash/command-chunks/chunk-YRMCH7OE.js";
3
+ } from "../safe-bash/command-chunks/chunk-LCR6YMBL.js";
4
4
  import "../safe-bash/command-chunks/chunk-D7FJPOCA.js";
5
- import "../safe-bash/command-chunks/chunk-TETIL2QG.js";
5
+ import "../safe-bash/command-chunks/chunk-FDJBYW3P.js";
6
6
  import "../safe-bash/command-chunks/chunk-EDH2EAAY.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-O4ARSYST.js";
7
+ } from "../safe-bash/command-chunks/chunk-QSD4I3TT.js";
8
8
  import {
9
9
  classify
10
10
  } from "../safe-bash/command-chunks/chunk-P5MKNVL7.js";
@@ -27,6 +27,7 @@ export declare class SharedBudget {
27
27
  private steps;
28
28
  private failureUnits;
29
29
  private untilYield;
30
+ private yieldChecks;
30
31
  private lastYield;
31
32
  private readonly controller;
32
33
  private timer;
@@ -4,7 +4,7 @@ import {
4
4
  SharedBudget,
5
5
  limitMessage,
6
6
  settings
7
- } from "../safe-bash/command-chunks/chunk-O4ARSYST.js";
7
+ } from "../safe-bash/command-chunks/chunk-QSD4I3TT.js";
8
8
  import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
9
9
  export {
10
10
  FileFailure,
@@ -2547,9 +2547,10 @@ async function fmt(context, configuration = {}) {
2547
2547
  let chunks = 0;
2548
2548
  let checkpoints = 0;
2549
2549
  let lastYield = monotonicNow();
2550
+ let yieldChecks = 0;
2550
2551
  const maybeYield = async (signal) => {
2551
2552
  const now = monotonicNow();
2552
- if (now - lastYield >= 25 || hasYieldCheckpoint(signal)) {
2553
+ if (++yieldChecks % 16 === 0 || now - lastYield >= 25 || hasYieldCheckpoint(signal)) {
2553
2554
  lastYield = now;
2554
2555
  await contractYieldTurn(signal);
2555
2556
  lastYield = monotonicNow();
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Budget,
3
3
  Builder
4
- } from "../safe-bash/command-chunks/chunk-YUBBOIPH.js";
4
+ } from "../safe-bash/command-chunks/chunk-LP5NRR5O.js";
5
5
  import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
6
6
  export {
7
7
  Budget,
@@ -2,9 +2,9 @@ import {
2
2
  destination,
3
3
  entities,
4
4
  escapeText
5
- } from "../safe-bash/command-chunks/chunk-OTTXGYBL.js";
6
- import "../safe-bash/command-chunks/chunk-DYCEVLVC.js";
7
- import "../safe-bash/command-chunks/chunk-YUBBOIPH.js";
5
+ } from "../safe-bash/command-chunks/chunk-G3O44ZGT.js";
6
+ import "../safe-bash/command-chunks/chunk-Y6YHBQIS.js";
7
+ import "../safe-bash/command-chunks/chunk-LP5NRR5O.js";
8
8
  import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
9
9
  export {
10
10
  destination,
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  Renderer
3
- } from "../safe-bash/command-chunks/chunk-PLOA5HZJ.js";
3
+ } from "../safe-bash/command-chunks/chunk-BHOK6HA3.js";
4
4
  import {
5
5
  Inputs
6
- } from "../safe-bash/command-chunks/chunk-MAZIL3QC.js";
7
- import "../safe-bash/command-chunks/chunk-OPRPIHKA.js";
8
- import "../safe-bash/command-chunks/chunk-OTTXGYBL.js";
9
- import "../safe-bash/command-chunks/chunk-DYCEVLVC.js";
6
+ } from "../safe-bash/command-chunks/chunk-WQHCF6N6.js";
7
+ import "../safe-bash/command-chunks/chunk-ZGBHQQGL.js";
8
+ import "../safe-bash/command-chunks/chunk-G3O44ZGT.js";
9
+ import "../safe-bash/command-chunks/chunk-Y6YHBQIS.js";
10
10
  import {
11
11
  Budget
12
- } from "../safe-bash/command-chunks/chunk-YUBBOIPH.js";
12
+ } from "../safe-bash/command-chunks/chunk-LP5NRR5O.js";
13
13
  import {
14
14
  HtmlUsageError,
15
15
  argumentsFor,
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Inputs
3
- } from "../safe-bash/command-chunks/chunk-MAZIL3QC.js";
4
- import "../safe-bash/command-chunks/chunk-OPRPIHKA.js";
5
- import "../safe-bash/command-chunks/chunk-OTTXGYBL.js";
6
- import "../safe-bash/command-chunks/chunk-DYCEVLVC.js";
7
- import "../safe-bash/command-chunks/chunk-YUBBOIPH.js";
3
+ } from "../safe-bash/command-chunks/chunk-WQHCF6N6.js";
4
+ import "../safe-bash/command-chunks/chunk-ZGBHQQGL.js";
5
+ import "../safe-bash/command-chunks/chunk-G3O44ZGT.js";
6
+ import "../safe-bash/command-chunks/chunk-Y6YHBQIS.js";
7
+ import "../safe-bash/command-chunks/chunk-LP5NRR5O.js";
8
8
  import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
9
9
  export {
10
10
  Inputs
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Parser,
3
3
  blockTags
4
- } from "../safe-bash/command-chunks/chunk-OPRPIHKA.js";
5
- import "../safe-bash/command-chunks/chunk-OTTXGYBL.js";
6
- import "../safe-bash/command-chunks/chunk-DYCEVLVC.js";
7
- import "../safe-bash/command-chunks/chunk-YUBBOIPH.js";
4
+ } from "../safe-bash/command-chunks/chunk-ZGBHQQGL.js";
5
+ import "../safe-bash/command-chunks/chunk-G3O44ZGT.js";
6
+ import "../safe-bash/command-chunks/chunk-Y6YHBQIS.js";
7
+ import "../safe-bash/command-chunks/chunk-LP5NRR5O.js";
8
8
  import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
9
9
  export {
10
10
  Parser,
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Renderer
3
- } from "../safe-bash/command-chunks/chunk-PLOA5HZJ.js";
4
- import "../safe-bash/command-chunks/chunk-OPRPIHKA.js";
5
- import "../safe-bash/command-chunks/chunk-OTTXGYBL.js";
6
- import "../safe-bash/command-chunks/chunk-DYCEVLVC.js";
7
- import "../safe-bash/command-chunks/chunk-YUBBOIPH.js";
3
+ } from "../safe-bash/command-chunks/chunk-BHOK6HA3.js";
4
+ import "../safe-bash/command-chunks/chunk-ZGBHQQGL.js";
5
+ import "../safe-bash/command-chunks/chunk-G3O44ZGT.js";
6
+ import "../safe-bash/command-chunks/chunk-Y6YHBQIS.js";
7
+ import "../safe-bash/command-chunks/chunk-LP5NRR5O.js";
8
8
  import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
9
9
  export {
10
10
  Renderer
@@ -2,8 +2,8 @@ import {
2
2
  htmlSpace,
3
3
  normalizeText,
4
4
  trimText
5
- } from "../safe-bash/command-chunks/chunk-DYCEVLVC.js";
6
- import "../safe-bash/command-chunks/chunk-YUBBOIPH.js";
5
+ } from "../safe-bash/command-chunks/chunk-Y6YHBQIS.js";
6
+ import "../safe-bash/command-chunks/chunk-LP5NRR5O.js";
7
7
  import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
8
8
  export {
9
9
  htmlSpace,
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  createIconvCommand
3
- } from "../safe-bash/command-chunks/chunk-KDVJQQVT.js";
3
+ } from "../safe-bash/command-chunks/chunk-QTKPEWR7.js";
4
4
  import "../safe-bash/command-chunks/chunk-Z6V4XEAW.js";
5
- import "../safe-bash/command-chunks/chunk-QYSAAJ6K.js";
6
- import "../safe-bash/command-chunks/chunk-B7CSA2AN.js";
7
- import "../safe-bash/command-chunks/chunk-XQZ3OG7K.js";
8
- import "../safe-bash/command-chunks/chunk-W6UOCPP2.js";
5
+ import "../safe-bash/command-chunks/chunk-PUIGJ37F.js";
6
+ import "../safe-bash/command-chunks/chunk-KEMWQP25.js";
7
+ import "../safe-bash/command-chunks/chunk-442UWLQR.js";
8
+ import "../safe-bash/command-chunks/chunk-7THHNO2E.js";
9
9
  import "../safe-bash/command-chunks/chunk-VGAAT55W.js";
10
10
  import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
11
11
  export {
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  createIconvCommand
3
- } from "../safe-bash/command-chunks/chunk-KDVJQQVT.js";
3
+ } from "../safe-bash/command-chunks/chunk-QTKPEWR7.js";
4
4
  import "../safe-bash/command-chunks/chunk-Z6V4XEAW.js";
5
- import "../safe-bash/command-chunks/chunk-QYSAAJ6K.js";
6
- import "../safe-bash/command-chunks/chunk-B7CSA2AN.js";
7
- import "../safe-bash/command-chunks/chunk-XQZ3OG7K.js";
8
- import "../safe-bash/command-chunks/chunk-W6UOCPP2.js";
5
+ import "../safe-bash/command-chunks/chunk-PUIGJ37F.js";
6
+ import "../safe-bash/command-chunks/chunk-KEMWQP25.js";
7
+ import "../safe-bash/command-chunks/chunk-442UWLQR.js";
8
+ import "../safe-bash/command-chunks/chunk-7THHNO2E.js";
9
9
  import "../safe-bash/command-chunks/chunk-VGAAT55W.js";
10
10
  import {
11
11
  init_buffer
@@ -4,7 +4,7 @@ import {
4
4
  pathText,
5
5
  raw,
6
6
  settings
7
- } from "../safe-bash/command-chunks/chunk-W6UOCPP2.js";
7
+ } from "../safe-bash/command-chunks/chunk-7THHNO2E.js";
8
8
  import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
9
9
  export {
10
10
  Budget,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Lifecycle
3
- } from "../safe-bash/command-chunks/chunk-QYSAAJ6K.js";
4
- import "../safe-bash/command-chunks/chunk-W6UOCPP2.js";
3
+ } from "../safe-bash/command-chunks/chunk-PUIGJ37F.js";
4
+ import "../safe-bash/command-chunks/chunk-7THHNO2E.js";
5
5
  import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
6
6
  export {
7
7
  Lifecycle
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  parse
3
- } from "../safe-bash/command-chunks/chunk-B7CSA2AN.js";
4
- import "../safe-bash/command-chunks/chunk-W6UOCPP2.js";
3
+ } from "../safe-bash/command-chunks/chunk-KEMWQP25.js";
4
+ import "../safe-bash/command-chunks/chunk-7THHNO2E.js";
5
5
  import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
6
6
  export {
7
7
  parse
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  Reader,
3
3
  fsDetail
4
- } from "../safe-bash/command-chunks/chunk-XQZ3OG7K.js";
5
- import "../safe-bash/command-chunks/chunk-W6UOCPP2.js";
4
+ } from "../safe-bash/command-chunks/chunk-442UWLQR.js";
5
+ import "../safe-bash/command-chunks/chunk-7THHNO2E.js";
6
6
  import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
7
7
  export {
8
8
  Reader,
@@ -2040,6 +2040,7 @@ var Converter = class {
2040
2040
  autoPadding = false;
2041
2041
  work = 0;
2042
2042
  tickCount = 0;
2043
+ lastYieldWork = 0;
2043
2044
  lastYield = monotonicNow();
2044
2045
  signalAborted;
2045
2046
  pollSignal;
@@ -2059,7 +2060,7 @@ var Converter = class {
2059
2060
  canTickSync(maxTicks) {
2060
2061
  if (this.pollSignal ? this.context.signal.aborted : this.signalAborted)
2061
2062
  return false;
2062
- if (this.work + maxTicks > this.limits.maxWork)
2063
+ if (this.work + maxTicks > this.limits.maxWork || this.work + maxTicks - this.lastYieldWork >= 16384)
2063
2064
  return false;
2064
2065
  if (this.work % 1024 + maxTicks < 1024)
2065
2066
  return true;
@@ -2072,8 +2073,9 @@ var Converter = class {
2072
2073
  if (this.work % 1024 < amount) {
2073
2074
  const count = ++this.tickCount;
2074
2075
  const now = monotonicNow();
2075
- if (count === 1 || now - this.lastYield >= 16 || hasYieldCheckpoint(this.context.signal)) {
2076
+ if (count === 1 || this.work - this.lastYieldWork >= 16384 || now - this.lastYield >= 16 || hasYieldCheckpoint(this.context.signal)) {
2076
2077
  this.lastYield = now;
2078
+ this.lastYieldWork = this.work;
2077
2079
  return yieldTurn(this.context.signal).then(() => {
2078
2080
  this.lastYield = monotonicNow();
2079
2081
  });
@@ -2416,7 +2418,7 @@ var Converter = class {
2416
2418
  }
2417
2419
  trySimpleLineSync(line, newline) {
2418
2420
  const settings2 = this.settings;
2419
- if (settings2.developer || settings2.suffix || settings2.padding > 128n || settings2.zeroPadding > 0n || settings2.grouping || settings2.format !== void 0 || settings2.from !== "none" || settings2.fromUnit !== 1n || settings2.toUnit !== 1n || settings2.to !== "iec" && settings2.to !== "iec-i" && settings2.to !== "si" && settings2.to !== "none" || line.indexOf("\0") >= 0 || !this.canTickSync(line.length * 2 + 16)) {
2421
+ if (settings2.developer || settings2.suffix || settings2.padding > 128n || settings2.zeroPadding > 0n || settings2.grouping || settings2.format !== void 0 || settings2.from !== "none" || settings2.fromUnit !== 1n || settings2.toUnit !== 1n || settings2.to !== "iec" && settings2.to !== "iec-i" && settings2.to !== "si" && settings2.to !== "none" || line.indexOf("\0") >= 0 || !this.canTickSync((line.length * 2 + 16) * ((settings2.fields?.length ?? 0) + 1))) {
2420
2422
  return false;
2421
2423
  }
2422
2424
  const savedWork = this.work;
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createPrCommand
3
- } from "../safe-bash/command-chunks/chunk-MANR67FK.js";
4
- import "../safe-bash/command-chunks/chunk-6QG3YR2F.js";
5
- import "../safe-bash/command-chunks/chunk-TUX2ZVRV.js";
6
- import "../safe-bash/command-chunks/chunk-ZMCVEYVX.js";
7
- import "../safe-bash/command-chunks/chunk-T6ZPGCNJ.js";
3
+ } from "../safe-bash/command-chunks/chunk-CD2SMRKD.js";
4
+ import "../safe-bash/command-chunks/chunk-ZPQ5OCKE.js";
5
+ import "../safe-bash/command-chunks/chunk-G5XIFXNF.js";
6
+ import "../safe-bash/command-chunks/chunk-AXO7RDN5.js";
7
+ import "../safe-bash/command-chunks/chunk-3DVCCMBJ.js";
8
8
  import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
9
9
  export {
10
10
  createPrCommand
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Formatter
3
- } from "../safe-bash/command-chunks/chunk-6QG3YR2F.js";
4
- import "../safe-bash/command-chunks/chunk-T6ZPGCNJ.js";
3
+ } from "../safe-bash/command-chunks/chunk-ZPQ5OCKE.js";
4
+ import "../safe-bash/command-chunks/chunk-3DVCCMBJ.js";
5
5
  import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
6
6
  export {
7
7
  Formatter
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  createPrCommand
3
- } from "../safe-bash/command-chunks/chunk-MANR67FK.js";
3
+ } from "../safe-bash/command-chunks/chunk-CD2SMRKD.js";
4
4
  import {
5
5
  Formatter
6
- } from "../safe-bash/command-chunks/chunk-6QG3YR2F.js";
6
+ } from "../safe-bash/command-chunks/chunk-ZPQ5OCKE.js";
7
7
  import {
8
8
  Lifecycle,
9
9
  Reader
10
- } from "../safe-bash/command-chunks/chunk-TUX2ZVRV.js";
10
+ } from "../safe-bash/command-chunks/chunk-G5XIFXNF.js";
11
11
  import {
12
12
  parseOptions
13
- } from "../safe-bash/command-chunks/chunk-ZMCVEYVX.js";
13
+ } from "../safe-bash/command-chunks/chunk-AXO7RDN5.js";
14
14
  import {
15
15
  Budget,
16
16
  settings
17
- } from "../safe-bash/command-chunks/chunk-T6ZPGCNJ.js";
17
+ } from "../safe-bash/command-chunks/chunk-3DVCCMBJ.js";
18
18
  import {
19
19
  init_buffer
20
20
  } from "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
@@ -40,6 +40,7 @@ export declare class Budget {
40
40
  readonly signal: AbortSignal;
41
41
  private work;
42
42
  private checkpoint;
43
+ private yieldChecks;
43
44
  private lastYield;
44
45
  private retained;
45
46
  private input;
@@ -8,7 +8,7 @@ import {
8
8
  quote,
9
9
  raw,
10
10
  settings
11
- } from "../safe-bash/command-chunks/chunk-T6ZPGCNJ.js";
11
+ } from "../safe-bash/command-chunks/chunk-3DVCCMBJ.js";
12
12
  import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
13
13
  export {
14
14
  Budget,
@@ -2,8 +2,8 @@ import {
2
2
  Lifecycle,
3
3
  Reader,
4
4
  fsDetail
5
- } from "../safe-bash/command-chunks/chunk-TUX2ZVRV.js";
6
- import "../safe-bash/command-chunks/chunk-T6ZPGCNJ.js";
5
+ } from "../safe-bash/command-chunks/chunk-G5XIFXNF.js";
6
+ import "../safe-bash/command-chunks/chunk-3DVCCMBJ.js";
7
7
  import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
8
8
  export {
9
9
  Lifecycle,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  parseOptions
3
- } from "../safe-bash/command-chunks/chunk-ZMCVEYVX.js";
4
- import "../safe-bash/command-chunks/chunk-T6ZPGCNJ.js";
3
+ } from "../safe-bash/command-chunks/chunk-AXO7RDN5.js";
4
+ import "../safe-bash/command-chunks/chunk-3DVCCMBJ.js";
5
5
  import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
6
6
  export {
7
7
  parseOptions
@@ -58,6 +58,7 @@ export async function* records(source, delimiter, limit, signal) {
58
58
  let used = 0;
59
59
  let scanned = 0;
60
60
  let lastYield = monotonicNow();
61
+ let yieldChecks = 0;
61
62
  for await (const rawChunk of source) {
62
63
  const chunk = Uint8Array.prototype.slice.call(rawChunk);
63
64
  let start = 0;
@@ -88,7 +89,7 @@ export async function* records(source, delimiter, limit, signal) {
88
89
  }
89
90
  }
90
91
  if (++scanned % 8192 === 0) {
91
- if (hasYieldCheckpoint(signal) || monotonicNow() - lastYield >= 25) {
92
+ if (++yieldChecks % 16 === 0 || hasYieldCheckpoint(signal) || monotonicNow() - lastYield >= 25) {
92
93
  await yieldTurn(signal);
93
94
  lastYield = monotonicNow();
94
95
  }
@@ -114,6 +115,7 @@ export async function readAllRecords(source, delimiter, maxBytes, maxRecords, si
114
115
  let scanned = 0;
115
116
  let totalBytes = 0;
116
117
  let lastYield = monotonicNow();
118
+ let yieldChecks = 0;
117
119
  for await (const rawChunk of source) {
118
120
  const chunk = Uint8Array.prototype.slice.call(rawChunk);
119
121
  let start = 0;
@@ -154,7 +156,7 @@ export async function readAllRecords(source, delimiter, maxBytes, maxRecords, si
154
156
  }
155
157
  if (++scanned % 8192 === 0) {
156
158
  const now = monotonicNow();
157
- if (hasYieldCheckpoint(signal) || now - lastYield >= 16) {
159
+ if (++yieldChecks % 16 === 0 || hasYieldCheckpoint(signal) || now - lastYield >= 16) {
158
160
  await yieldTurn(signal);
159
161
  lastYield = monotonicNow();
160
162
  }
@@ -22,6 +22,7 @@ export function createShufCommand(options = {}) {
22
22
  description: "Write a random permutation of input records",
23
23
  async execute(context) {
24
24
  let lastYield = monotonicNow();
25
+ let yieldChecks = 0;
25
26
  let random;
26
27
  let output;
27
28
  let source;
@@ -155,7 +156,7 @@ export function createShufCommand(options = {}) {
155
156
  }
156
157
  seen++;
157
158
  if (seen % 1024n === 0n) {
158
- if (hasYieldCheckpoint(context.signal) || monotonicNow() - lastYield >= 25) {
159
+ if (++yieldChecks % 16 === 0 || hasYieldCheckpoint(context.signal) || monotonicNow() - lastYield >= 25) {
159
160
  await yieldTurn(context.signal);
160
161
  lastYield = monotonicNow();
161
162
  }
@@ -187,7 +188,7 @@ export function createShufCommand(options = {}) {
187
188
  swaps.set(chosen, swaps.get(index) ?? index);
188
189
  swaps.delete(index);
189
190
  if (index % 1024n === 1023n) {
190
- if (hasYieldCheckpoint(context.signal) || monotonicNow() - lastYield >= 25) {
191
+ if (++yieldChecks % 16 === 0 || hasYieldCheckpoint(context.signal) || monotonicNow() - lastYield >= 25) {
191
192
  await yieldTurn(context.signal);
192
193
  lastYield = monotonicNow();
193
194
  }
@@ -227,7 +228,7 @@ export function createShufCommand(options = {}) {
227
228
  diagnostic = "write error";
228
229
  await sink.write(line);
229
230
  if (index % 256n === 255n) {
230
- if (hasYieldCheckpoint(context.signal) || monotonicNow() - lastYield >= 25) {
231
+ if (++yieldChecks % 16 === 0 || hasYieldCheckpoint(context.signal) || monotonicNow() - lastYield >= 25) {
231
232
  await yieldTurn(context.signal);
232
233
  lastYield = monotonicNow();
233
234
  }
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createSplitCommand,
3
3
  evalSyncSplit
4
- } from "../safe-bash/command-chunks/chunk-IFMCWC7A.js";
4
+ } from "../safe-bash/command-chunks/chunk-CXDWDFFU.js";
5
5
  import "../safe-bash/command-chunks/chunk-BIERORHV.js";
6
6
  import {
7
7
  settings
8
8
  } from "../safe-bash/command-chunks/chunk-N3PU3KH4.js";
9
- import "../safe-bash/command-chunks/chunk-TKBJACLG.js";
10
- import "../safe-bash/command-chunks/chunk-4SZIRINP.js";
9
+ import "../safe-bash/command-chunks/chunk-VXDCTI33.js";
10
+ import "../safe-bash/command-chunks/chunk-OEPERWLZ.js";
11
11
  import {
12
12
  init_buffer
13
13
  } from "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
@@ -8,6 +8,7 @@ export declare class Budget {
8
8
  private outputBytes;
9
9
  private steps;
10
10
  private untilYield;
11
+ private yieldChecks;
11
12
  private lastYield;
12
13
  constructor(limits: SplitLimits, signal: AbortSignal);
13
14
  check(value: number, maximum: number, label: string): void;