@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.
- package/README.md +2 -1
- package/dist/pdf/index.d.ts +1 -1
- package/dist/pdf/model.d.ts +7 -2
- package/dist/safe-bash/chunks/{chunk-D2XB7XIC.js → chunk-AZAJJVFX.js} +7 -11
- package/dist/safe-bash/chunks/{chunk-C2NYCU7O.js → chunk-JSVX4VIA.js} +5 -1
- package/dist/safe-bash/chunks/{chunk-TCWZNUVP.js → chunk-SPYL72GN.js} +1 -25
- package/dist/safe-bash/chunks/{chunk-TGOF7VO5.js → chunk-TRVGCN3U.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-ZXKVOJNL.js → chunk-WUNK5NXJ.js} +6 -5
- package/dist/safe-bash/command-chunks/{chunk-JG5W2ENK.js → chunk-43GSSUAY.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-OAJUAAWH.js → chunk-464RVBGB.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-25BLI6S6.js → chunk-4Y3WVMK4.js} +1 -14
- package/dist/safe-bash/command-chunks/{chunk-SSBFTMVI.js → chunk-4ZALPDBV.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-YMQKVEIF.js → chunk-52PCQXD2.js} +2 -13
- package/dist/safe-bash/command-chunks/{chunk-ZCKDQGKY.js → chunk-5HDSFHGW.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-JHVZYB4R.js → chunk-5MPOQ6V3.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-AUAF5YBT.js → chunk-5WPI42ZW.js} +0 -7
- package/dist/safe-bash/command-chunks/{chunk-PPOIPMY4.js → chunk-5ZSM4UFN.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-RECJB2BO.js → chunk-7BS66BXN.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-GRWOVSFK.js → chunk-7D7JRRML.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-E6IYUYVA.js → chunk-7L24L4UO.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-HBXQWTJR.js → chunk-A5ZAV6DO.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-LW34AKDM.js → chunk-AB4MXHVS.js} +4 -14
- package/dist/safe-bash/command-chunks/{chunk-EELNLEEP.js → chunk-AXK3H4PX.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-Y55OCH37.js → chunk-AYUTO323.js} +3 -10
- package/dist/safe-bash/command-chunks/{chunk-DY36FDDC.js → chunk-B5BKA5WH.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-YB6KVU6H.js → chunk-BDBVVZY6.js} +4 -14
- package/dist/safe-bash/command-chunks/{chunk-QAN7KKDZ.js → chunk-BZDDAPSV.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-HZCPWYWA.js → chunk-BZPAWTUL.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-RT2J5ATD.js → chunk-CPPGTBZF.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-A7RIYQIF.js → chunk-DDLQ5YDB.js} +172 -167
- package/dist/safe-bash/command-chunks/{chunk-JEPY4UY4.js → chunk-EIVW3X3N.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-C2DUYVYZ.js → chunk-ESMCX3YV.js} +138 -36
- package/dist/safe-bash/command-chunks/chunk-EZ7D6DXC.js +6 -0
- package/dist/safe-bash/command-chunks/{chunk-QGVOS3EY.js → chunk-HFII3QYO.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-5EWTQJSC.js → chunk-HHP343KT.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-5UA3BEGA.js → chunk-I3K5RYU4.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-4MS5WZJC.js → chunk-IKS2YXZQ.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-CZVBYCB5.js → chunk-IL53SJL4.js} +2 -12
- package/dist/safe-bash/command-chunks/{chunk-HLMUPSM6.js → chunk-JCNNOMBV.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-2LLZBNLL.js → chunk-JWE54GHQ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-QLDIP3OP.js → chunk-JZSNU2MY.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-2HOESGFJ.js → chunk-KMCZ6P4O.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-U3ONEICA.js → chunk-KVFCSLKK.js} +1 -11
- package/dist/safe-bash/command-chunks/{chunk-THS4YAKG.js → chunk-LLCXZKZ6.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-3TANKHBX.js → chunk-MRW5HD2D.js} +1 -6
- package/dist/safe-bash/command-chunks/{chunk-3WKA57FA.js → chunk-N5FGCXQJ.js} +1 -9
- package/dist/safe-bash/command-chunks/{chunk-ULZ7HIZP.js → chunk-NETECMOF.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-2Q7UQ7R4.js → chunk-OPUJSTHS.js} +12 -12
- package/dist/safe-bash/command-chunks/{chunk-HVI6ALJF.js → chunk-PFAADCB5.js} +2 -4
- package/dist/safe-bash/command-chunks/{chunk-JXU2N6GN.js → chunk-Q7Q5GM5S.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-Z5TFSVNU.js → chunk-QAKKSRNV.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-KAHH4XOU.js → chunk-QNXI2UP6.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-ECAK3JHR.js → chunk-QRRYN2KO.js} +21 -12
- package/dist/safe-bash/command-chunks/{chunk-WYOL5JNT.js → chunk-SX2X3IH4.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-WBJKOTSP.js → chunk-UI32HWGS.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-AC6X7Q4I.js → chunk-VVI4Z73I.js} +1 -8
- package/dist/safe-bash/command-chunks/{chunk-JCVXAX2G.js → chunk-XWZBMJ5B.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-UUR2S7AD.js → chunk-Y6TUZWPS.js} +28 -1
- package/dist/safe-bash/command-chunks/{chunk-23XLM73P.js → chunk-YEOPI5SK.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-PRCT7FKJ.js → chunk-YZ5SVZFD.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-OGUMMTTD.js → chunk-ZJBR5Q5I.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-VZ64JXHC.js → chunk-ZS3QPNUL.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-VKQCNX32.js → chunk-ZT4KSS2V.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-6N5V4VBN.js → chunk-ZXKW7SJ2.js} +2 -2
- package/dist/safe-bash/command-chunks/{pptx-KY2OJWZW-76LBHCHD.js → pptx-GBPNWNEP-7EQEVXV5.js} +8 -2
- package/dist/safe-bash/commands/diff-patch/shared.d.ts +0 -2
- package/dist/safe-bash/commands/diff-patch/shared.js +2 -11
- package/dist/safe-bash/commands/llm/index.browser.js +9 -1
- package/dist/safe-bash/commands/llm/providers/index.browser.js +6 -2
- package/dist/safe-bash/commands/text.js +1 -25
- package/dist/safe-bash/core.browser.js +1 -1
- package/dist/safe-bash/core.d.ts +5 -1
- package/dist/safe-bash/core.js +5 -1
- package/dist/safe-bash/full-core.browser.js +134 -5
- package/dist/safe-bash/lazy-optional.d.ts +13 -0
- package/dist/safe-bash/lazy-optional.js +118 -0
- package/dist/safe-bash/opt-in/commands/dd/index.js +4 -13
- package/dist/safe-bash/opt-in/commands/yq/native-work.js +2 -1
- package/dist/safe-bash/opt-in/optional/commands/shuf/input.js +3 -21
- package/dist/safe-bash/opt-in/optional/commands/shuf/shuf.js +4 -27
- package/dist/safe-bash/plugins/index.browser.js +3 -3
- package/dist/safe-bash/registry-entry.browser.js +2 -2
- package/dist/safe-bash/shell/env-warning.js +3 -2
- package/dist/safe-bash/shell/runtime.js +2 -2
- package/dist/safe-bash/shell-entry.browser.js +2 -2
- package/dist/safe-bash-command-csvkit/index.js +528 -498
- package/dist/safe-bash-command-dd/index.js +4 -13
- package/dist/safe-bash-command-du/budget.d.ts +0 -2
- package/dist/safe-bash-command-du/budget.js +1 -1
- package/dist/safe-bash-command-du/du.js +2 -2
- package/dist/safe-bash-command-du/index.js +2 -2
- package/dist/safe-bash-command-file/index.js +1 -1
- package/dist/safe-bash-command-file/shared.d.ts +0 -2
- package/dist/safe-bash-command-file/shared.js +1 -1
- package/dist/safe-bash-command-fmt/index.js +3 -15
- package/dist/safe-bash-command-git/git_rust.wasm +0 -0
- package/dist/safe-bash-command-git/wasm.generated.js +1 -1
- package/dist/safe-bash-command-html-to-markdown/budget.d.ts +0 -3
- package/dist/safe-bash-command-html-to-markdown/budget.js +1 -1
- package/dist/safe-bash-command-html-to-markdown/entities.js +3 -3
- package/dist/safe-bash-command-html-to-markdown/index.js +6 -6
- package/dist/safe-bash-command-html-to-markdown/input.js +5 -5
- package/dist/safe-bash-command-html-to-markdown/parser.js +4 -4
- package/dist/safe-bash-command-html-to-markdown/render.js +5 -5
- package/dist/safe-bash-command-html-to-markdown/text.js +2 -2
- package/dist/safe-bash-command-iconv/command.js +5 -5
- package/dist/safe-bash-command-iconv/index.js +5 -5
- package/dist/safe-bash-command-iconv/internal.d.ts +0 -2
- package/dist/safe-bash-command-iconv/internal.js +1 -1
- package/dist/safe-bash-command-iconv/lifecycle.js +2 -2
- package/dist/safe-bash-command-iconv/options.js +2 -2
- package/dist/safe-bash-command-iconv/reader.js +2 -2
- package/dist/safe-bash-command-llm/base64-stream.d.ts +2 -0
- package/dist/safe-bash-command-llm/chat-json.d.ts +10 -0
- package/dist/safe-bash-command-llm/index.d.ts +2 -1
- package/dist/safe-bash-command-llm/index.js +11 -2
- package/dist/safe-bash-command-llm/json-string.d.ts +2 -0
- package/dist/safe-bash-command-llm/json-value.d.ts +2 -0
- package/dist/safe-bash-command-llm/openai.d.ts +1 -0
- package/dist/safe-bash-command-llm/openai.js +4 -2
- package/dist/safe-bash-command-llm/provider-serialization.d.ts +6 -0
- package/dist/safe-bash-command-llm/providers/index.d.ts +2 -1
- package/dist/safe-bash-command-llm/providers/index.js +12 -3
- package/dist/safe-bash-command-llm/providers/openai.d.ts +1 -1
- package/dist/safe-bash-command-llm/providers/openai.js +4 -2
- package/dist/safe-bash-command-numfmt/index.js +4 -18
- package/dist/safe-bash-command-pandoc/citeproc-filters.js +1 -1
- package/dist/safe-bash-command-pandoc/command.js +3 -3
- package/dist/safe-bash-command-pandoc/index.js +3 -3
- package/dist/safe-bash-command-pr/command.js +5 -5
- package/dist/safe-bash-command-pr/format.js +2 -2
- package/dist/safe-bash-command-pr/index.js +5 -5
- package/dist/safe-bash-command-pr/internal.d.ts +0 -2
- package/dist/safe-bash-command-pr/internal.js +1 -1
- package/dist/safe-bash-command-pr/io.js +2 -2
- package/dist/safe-bash-command-pr/options.js +2 -2
- package/dist/safe-bash-command-shuf/input.js +3 -21
- package/dist/safe-bash-command-shuf/shuf.js +4 -27
- package/dist/safe-bash-command-split/index.js +3 -3
- package/dist/safe-bash-command-split/io.d.ts +0 -2
- package/dist/safe-bash-command-split/io.js +1 -1
- package/dist/safe-bash-command-split/outputs.js +2 -2
- package/dist/safe-bash-command-split/split.js +3 -3
- package/dist/safe-bash-command-ssconvert/index.js +1 -1
- package/dist/safe-bash-command-tree/arguments.js +3 -3
- package/dist/safe-bash-command-tree/charset.js +1 -1
- package/dist/safe-bash-command-tree/index.js +4 -4
- package/dist/safe-bash-command-tree/io.d.ts +0 -1
- package/dist/safe-bash-command-tree/io.js +1 -1
- package/dist/safe-bash-command-tree/pattern.js +2 -2
- package/dist/safe-bash-command-tree/tree.js +4 -4
- package/dist/safe-bash-command-tsort/command.js +4 -4
- package/dist/safe-bash-command-tsort/graph.js +2 -2
- package/dist/safe-bash-command-tsort/index.js +4 -4
- package/dist/safe-bash-command-tsort/internal.d.ts +0 -2
- package/dist/safe-bash-command-tsort/internal.js +1 -1
- package/dist/safe-bash-command-tsort/io.js +2 -2
- package/dist/safe-bash-command-yq/native-work.js +2 -1
- package/dist/safe-bash-io-engine/commands/archive/internal.d.ts +0 -1
- package/dist/safe-bash-io-engine/commands/archive/internal.js +3 -7
- package/dist/safe-bash-io-engine/shell/pattern.js +1 -1
- package/dist/safe-bash-io-engine/shell/string-operations.d.ts +0 -2
- package/dist/safe-bash-io-engine/shell/string-operations.js +1 -1
- package/dist/safe-bash-line-ending-engine/internal.d.ts +0 -2
- package/dist/safe-bash-line-ending-engine/internal.js +1 -9
- package/dist/safe-bash-query-engine/capture.js +5 -5
- package/dist/safe-bash-query-engine/dates.js +2 -2
- package/dist/safe-bash-query-engine/delpaths.js +5 -5
- package/dist/safe-bash-query-engine/formats.js +3 -3
- package/dist/safe-bash-query-engine/index.js +15 -15
- package/dist/safe-bash-query-engine/indices.js +5 -5
- package/dist/safe-bash-query-engine/input.js +2 -2
- package/dist/safe-bash-query-engine/interpreter.js +13 -13
- package/dist/safe-bash-query-engine/limits.js +1 -1
- package/dist/safe-bash-query-engine/parser.js +2 -2
- package/dist/safe-bash-query-engine/query-core.js +15 -15
- package/dist/safe-bash-query-engine/recurse.js +2 -2
- package/dist/safe-bash-query-engine/regex.js +5 -5
- package/dist/safe-bash-query-engine/split.js +2 -2
- package/dist/safe-bash-query-engine/splits.js +6 -6
- package/dist/safe-bash-query-engine/values.js +4 -4
- package/dist/safe-bash-regex-engine/ere/limits.d.ts +0 -1
- package/dist/safe-bash-regex-engine/ere/limits.js +1 -1
- package/dist/safe-bash-regex-engine/ere/matcher.js +5 -5
- package/dist/safe-bash-regex-engine/ere/syntax.js +2 -2
- package/dist/safe-bash-regex-engine/execution/bounded-provider.js +2 -4
- package/dist/safe-bash-text-stream-engine/stream-format/shared.d.ts +0 -2
- package/dist/safe-bash-text-stream-engine/stream-format/shared.js +1 -9
- package/dist/safe-bash-xml-engine/document.js +2 -2
- package/dist/safe-bash-xml-engine/index.js +3 -3
- package/dist/safe-bash-xml-engine/io.js +1 -1
- package/dist/safe-bash-xml-engine/limits.d.ts +0 -2
- package/dist/safe-bash-xml-engine/limits.js +1 -1
- package/dist/safe-bash-xml-engine/query.js +2 -2
- 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 {
|
|
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
|
|
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
|
|
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
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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,
|
|
@@ -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 {
|
|
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
|
|
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
|
|
2461
|
+
} else if (++checkpoints % 64 === 0) await contractYieldTurn(local.signal);
|
|
2474
2462
|
step = machine.next();
|
|
2475
2463
|
}
|
|
2476
2464
|
}
|
|
Binary file
|