@poe-platform/safe-bash 0.1.798 → 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/safe-bash/chunks/{chunk-XH26YVGW.js → chunk-AZAJJVFX.js} +1 -11
- package/dist/safe-bash/chunks/{chunk-CSNXID73.js → chunk-SPYL72GN.js} +1 -25
- package/dist/safe-bash/chunks/{chunk-AMTCC256.js → chunk-TRVGCN3U.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-V3VEATEA.js → chunk-WUNK5NXJ.js} +1 -1
- 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-JEPY4UY4.js → chunk-EIVW3X3N.js} +3 -3
- 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-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-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/commands/diff-patch/shared.d.ts +0 -2
- package/dist/safe-bash/commands/diff-patch/shared.js +2 -11
- package/dist/safe-bash/commands/text.js +1 -25
- package/dist/safe-bash/full-core.browser.js +4 -4
- 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-entry.browser.js +2 -2
- 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-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-numfmt/index.js +4 -18
- 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-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 +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FsError, readBytes } from "@poe-platform/safe-bash/contracts";
|
|
2
|
-
import {
|
|
2
|
+
import { yieldTurn } from "@poe-platform/safe-bash/contracts/yield";
|
|
3
3
|
import { Diagnostic } from "./args.js";
|
|
4
4
|
export function virtualPath(cwd, name) {
|
|
5
5
|
if (name === "")
|
|
@@ -173,8 +173,6 @@ export async function* records(source, delimiter, limit, signal) {
|
|
|
173
173
|
let pending = new Uint8Array(Math.min(256, limit));
|
|
174
174
|
let used = 0;
|
|
175
175
|
let scanned = 0;
|
|
176
|
-
let lastYield = monotonicNow();
|
|
177
|
-
let yieldChecks = 0;
|
|
178
176
|
for await (const rawChunk of source) {
|
|
179
177
|
const chunk = Uint8Array.prototype.slice.call(rawChunk);
|
|
180
178
|
let start = 0;
|
|
@@ -205,14 +203,7 @@ export async function* records(source, delimiter, limit, signal) {
|
|
|
205
203
|
}
|
|
206
204
|
}
|
|
207
205
|
if (++scanned % 8192 === 0) {
|
|
208
|
-
|
|
209
|
-
await yieldTurn(signal);
|
|
210
|
-
lastYield = monotonicNow();
|
|
211
|
-
}
|
|
212
|
-
else {
|
|
213
|
-
runYieldCheckpoint(signal);
|
|
214
|
-
signal.throwIfAborted();
|
|
215
|
-
}
|
|
206
|
+
await yieldTurn(signal);
|
|
216
207
|
}
|
|
217
208
|
}
|
|
218
209
|
}
|
|
@@ -230,8 +221,6 @@ export async function readAllRecords(source, delimiter, maxBytes, maxRecords, si
|
|
|
230
221
|
let used = 0;
|
|
231
222
|
let scanned = 0;
|
|
232
223
|
let totalBytes = 0;
|
|
233
|
-
let lastYield = monotonicNow();
|
|
234
|
-
let yieldChecks = 0;
|
|
235
224
|
for await (const rawChunk of source) {
|
|
236
225
|
const chunk = Uint8Array.prototype.slice.call(rawChunk);
|
|
237
226
|
let start = 0;
|
|
@@ -271,14 +260,7 @@ export async function readAllRecords(source, delimiter, maxBytes, maxRecords, si
|
|
|
271
260
|
}
|
|
272
261
|
}
|
|
273
262
|
if (++scanned % 8192 === 0) {
|
|
274
|
-
|
|
275
|
-
if (++yieldChecks % 16 === 0 || hasYieldCheckpoint(signal) || now - lastYield >= 16) {
|
|
276
|
-
await yieldTurn(signal);
|
|
277
|
-
lastYield = monotonicNow();
|
|
278
|
-
}
|
|
279
|
-
else {
|
|
280
|
-
runYieldCheckpoint(signal);
|
|
281
|
-
}
|
|
263
|
+
await yieldTurn(signal);
|
|
282
264
|
}
|
|
283
265
|
}
|
|
284
266
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { builtInDirectContextExecutors, commandRuntimeIdentity, createBufferedOutput, getCommandArguments, isFsError, writeBytes, } from "@poe-platform/safe-bash/contracts";
|
|
2
2
|
import { openFileOutput } from "./filesystem-output.js";
|
|
3
|
-
import {
|
|
3
|
+
import { inheritYieldCheckpoint, yieldTurn } from "@poe-platform/safe-bash/contracts/yield";
|
|
4
4
|
import { countMax, Diagnostic, fileQuote, parse, quote, unicodeLocale } from "./args.js";
|
|
5
5
|
import { FileInput, ownedBytes, readAllRecords, records, virtualPath } from "./input.js";
|
|
6
6
|
import { settings } from "./options.js";
|
|
@@ -25,8 +25,6 @@ export function createShufCommand(options = {}) {
|
|
|
25
25
|
runtimeIdentity: commandRuntimeIdentity,
|
|
26
26
|
description: "Write a random permutation of input records",
|
|
27
27
|
async execute(context) {
|
|
28
|
-
let lastYield = monotonicNow();
|
|
29
|
-
let yieldChecks = 0;
|
|
30
28
|
let random;
|
|
31
29
|
let output;
|
|
32
30
|
let source;
|
|
@@ -152,14 +150,7 @@ export function createShufCommand(options = {}) {
|
|
|
152
150
|
}
|
|
153
151
|
seen++;
|
|
154
152
|
if (seen % 1024n === 0n) {
|
|
155
|
-
|
|
156
|
-
await yieldTurn(context.signal);
|
|
157
|
-
lastYield = monotonicNow();
|
|
158
|
-
}
|
|
159
|
-
else {
|
|
160
|
-
runYieldCheckpoint(context.signal);
|
|
161
|
-
context.signal.throwIfAborted();
|
|
162
|
-
}
|
|
153
|
+
await yieldTurn(context.signal);
|
|
163
154
|
}
|
|
164
155
|
}
|
|
165
156
|
}
|
|
@@ -185,14 +176,7 @@ export function createShufCommand(options = {}) {
|
|
|
185
176
|
swaps.set(chosen, swaps.get(index) ?? index);
|
|
186
177
|
swaps.delete(index);
|
|
187
178
|
if (index % 1024n === 1023n) {
|
|
188
|
-
|
|
189
|
-
await yieldTurn(context.signal);
|
|
190
|
-
lastYield = monotonicNow();
|
|
191
|
-
}
|
|
192
|
-
else {
|
|
193
|
-
runYieldCheckpoint(context.signal);
|
|
194
|
-
context.signal.throwIfAborted();
|
|
195
|
-
}
|
|
179
|
+
await yieldTurn(context.signal);
|
|
196
180
|
}
|
|
197
181
|
}
|
|
198
182
|
}
|
|
@@ -227,14 +211,7 @@ export function createShufCommand(options = {}) {
|
|
|
227
211
|
if (parsed.repeat && parsed.random !== undefined)
|
|
228
212
|
await sink.flush();
|
|
229
213
|
if (index % 256n === 255n) {
|
|
230
|
-
|
|
231
|
-
await yieldTurn(context.signal);
|
|
232
|
-
lastYield = monotonicNow();
|
|
233
|
-
}
|
|
234
|
-
else {
|
|
235
|
-
runYieldCheckpoint(context.signal);
|
|
236
|
-
context.signal.throwIfAborted();
|
|
237
|
-
}
|
|
214
|
+
await yieldTurn(context.signal);
|
|
238
215
|
}
|
|
239
216
|
}
|
|
240
217
|
await sink.flush();
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
agentCommands,
|
|
3
3
|
createAgentCommands
|
|
4
|
-
} from "../chunks/chunk-
|
|
4
|
+
} from "../chunks/chunk-TRVGCN3U.js";
|
|
5
5
|
import {
|
|
6
6
|
baseAgentCommands
|
|
7
|
-
} from "../chunks/chunk-
|
|
7
|
+
} from "../chunks/chunk-SPYL72GN.js";
|
|
8
8
|
import "../chunks/chunk-M4CFCXHN.js";
|
|
9
9
|
import "../chunks/chunk-T3JTVIEP.js";
|
|
10
10
|
import "../chunks/chunk-MHZ24KEI.js";
|
|
11
|
-
import "../chunks/chunk-
|
|
11
|
+
import "../chunks/chunk-AZAJJVFX.js";
|
|
12
12
|
import "../chunks/chunk-U5NUZPCC.js";
|
|
13
13
|
import "../chunks/chunk-3L3T6LYV.js";
|
|
14
14
|
import "../chunks/chunk-H6JW3E4F.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
baseAgentCommands
|
|
3
|
-
} from "./chunks/chunk-
|
|
3
|
+
} from "./chunks/chunk-SPYL72GN.js";
|
|
4
4
|
import "./chunks/chunk-M4CFCXHN.js";
|
|
5
5
|
import "./chunks/chunk-T3JTVIEP.js";
|
|
6
6
|
import "./chunks/chunk-MHZ24KEI.js";
|
|
7
|
-
import "./chunks/chunk-
|
|
7
|
+
import "./chunks/chunk-AZAJJVFX.js";
|
|
8
8
|
import "./chunks/chunk-U5NUZPCC.js";
|
|
9
9
|
import "./chunks/chunk-3L3T6LYV.js";
|
|
10
10
|
import "./chunks/chunk-H6JW3E4F.js";
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
ShellSyntaxError,
|
|
5
5
|
cloudflareWorkerLimits,
|
|
6
6
|
parseShell
|
|
7
|
-
} from "./chunks/chunk-
|
|
7
|
+
} from "./chunks/chunk-WUNK5NXJ.js";
|
|
8
8
|
import "./chunks/chunk-AKC46AF6.js";
|
|
9
|
-
import "./chunks/chunk-
|
|
9
|
+
import "./chunks/chunk-AZAJJVFX.js";
|
|
10
10
|
import "./chunks/chunk-U5NUZPCC.js";
|
|
11
11
|
import "./chunks/chunk-3L3T6LYV.js";
|
|
12
12
|
import "./chunks/chunk-H6JW3E4F.js";
|
|
@@ -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
|
}
|
|
@@ -10,9 +10,6 @@ export declare class Budget {
|
|
|
10
10
|
cells: number;
|
|
11
11
|
private workUsed;
|
|
12
12
|
private sinceYield;
|
|
13
|
-
private checkpoints;
|
|
14
|
-
private lastYieldTime;
|
|
15
|
-
private readonly hasExtYield;
|
|
16
13
|
private aborted;
|
|
17
14
|
private readonly pollSignal;
|
|
18
15
|
constructor(context: CommandContext, limits: HtmlToMarkdownLimits);
|
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
destination,
|
|
3
3
|
entities,
|
|
4
4
|
escapeText
|
|
5
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
6
|
-
import "../safe-bash/command-chunks/chunk-
|
|
7
|
-
import "../safe-bash/command-chunks/chunk-
|
|
5
|
+
} from "../safe-bash/command-chunks/chunk-7L24L4UO.js";
|
|
6
|
+
import "../safe-bash/command-chunks/chunk-HHP343KT.js";
|
|
7
|
+
import "../safe-bash/command-chunks/chunk-4Y3WVMK4.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-
|
|
3
|
+
} from "../safe-bash/command-chunks/chunk-ZJBR5Q5I.js";
|
|
4
4
|
import {
|
|
5
5
|
Inputs
|
|
6
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
7
|
-
import "../safe-bash/command-chunks/chunk-
|
|
8
|
-
import "../safe-bash/command-chunks/chunk-
|
|
9
|
-
import "../safe-bash/command-chunks/chunk-
|
|
6
|
+
} from "../safe-bash/command-chunks/chunk-BZDDAPSV.js";
|
|
7
|
+
import "../safe-bash/command-chunks/chunk-HFII3QYO.js";
|
|
8
|
+
import "../safe-bash/command-chunks/chunk-7L24L4UO.js";
|
|
9
|
+
import "../safe-bash/command-chunks/chunk-HHP343KT.js";
|
|
10
10
|
import {
|
|
11
11
|
Budget
|
|
12
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
12
|
+
} from "../safe-bash/command-chunks/chunk-4Y3WVMK4.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-
|
|
4
|
-
import "../safe-bash/command-chunks/chunk-
|
|
5
|
-
import "../safe-bash/command-chunks/chunk-
|
|
6
|
-
import "../safe-bash/command-chunks/chunk-
|
|
7
|
-
import "../safe-bash/command-chunks/chunk-
|
|
3
|
+
} from "../safe-bash/command-chunks/chunk-BZDDAPSV.js";
|
|
4
|
+
import "../safe-bash/command-chunks/chunk-HFII3QYO.js";
|
|
5
|
+
import "../safe-bash/command-chunks/chunk-7L24L4UO.js";
|
|
6
|
+
import "../safe-bash/command-chunks/chunk-HHP343KT.js";
|
|
7
|
+
import "../safe-bash/command-chunks/chunk-4Y3WVMK4.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-
|
|
5
|
-
import "../safe-bash/command-chunks/chunk-
|
|
6
|
-
import "../safe-bash/command-chunks/chunk-
|
|
7
|
-
import "../safe-bash/command-chunks/chunk-
|
|
4
|
+
} from "../safe-bash/command-chunks/chunk-HFII3QYO.js";
|
|
5
|
+
import "../safe-bash/command-chunks/chunk-7L24L4UO.js";
|
|
6
|
+
import "../safe-bash/command-chunks/chunk-HHP343KT.js";
|
|
7
|
+
import "../safe-bash/command-chunks/chunk-4Y3WVMK4.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-
|
|
4
|
-
import "../safe-bash/command-chunks/chunk-
|
|
5
|
-
import "../safe-bash/command-chunks/chunk-
|
|
6
|
-
import "../safe-bash/command-chunks/chunk-
|
|
7
|
-
import "../safe-bash/command-chunks/chunk-
|
|
3
|
+
} from "../safe-bash/command-chunks/chunk-ZJBR5Q5I.js";
|
|
4
|
+
import "../safe-bash/command-chunks/chunk-HFII3QYO.js";
|
|
5
|
+
import "../safe-bash/command-chunks/chunk-7L24L4UO.js";
|
|
6
|
+
import "../safe-bash/command-chunks/chunk-HHP343KT.js";
|
|
7
|
+
import "../safe-bash/command-chunks/chunk-4Y3WVMK4.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-
|
|
6
|
-
import "../safe-bash/command-chunks/chunk-
|
|
5
|
+
} from "../safe-bash/command-chunks/chunk-HHP343KT.js";
|
|
6
|
+
import "../safe-bash/command-chunks/chunk-4Y3WVMK4.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-
|
|
3
|
+
} from "../safe-bash/command-chunks/chunk-SX2X3IH4.js";
|
|
4
4
|
import "../safe-bash/command-chunks/chunk-IEXHHNOF.js";
|
|
5
|
-
import "../safe-bash/command-chunks/chunk-
|
|
6
|
-
import "../safe-bash/command-chunks/chunk-
|
|
7
|
-
import "../safe-bash/command-chunks/chunk-
|
|
8
|
-
import "../safe-bash/command-chunks/chunk-
|
|
5
|
+
import "../safe-bash/command-chunks/chunk-7D7JRRML.js";
|
|
6
|
+
import "../safe-bash/command-chunks/chunk-JWE54GHQ.js";
|
|
7
|
+
import "../safe-bash/command-chunks/chunk-5HDSFHGW.js";
|
|
8
|
+
import "../safe-bash/command-chunks/chunk-AB4MXHVS.js";
|
|
9
9
|
import "../safe-bash/command-chunks/chunk-F44RAKDZ.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-
|
|
3
|
+
} from "../safe-bash/command-chunks/chunk-SX2X3IH4.js";
|
|
4
4
|
import "../safe-bash/command-chunks/chunk-IEXHHNOF.js";
|
|
5
|
-
import "../safe-bash/command-chunks/chunk-
|
|
6
|
-
import "../safe-bash/command-chunks/chunk-
|
|
7
|
-
import "../safe-bash/command-chunks/chunk-
|
|
8
|
-
import "../safe-bash/command-chunks/chunk-
|
|
5
|
+
import "../safe-bash/command-chunks/chunk-7D7JRRML.js";
|
|
6
|
+
import "../safe-bash/command-chunks/chunk-JWE54GHQ.js";
|
|
7
|
+
import "../safe-bash/command-chunks/chunk-5HDSFHGW.js";
|
|
8
|
+
import "../safe-bash/command-chunks/chunk-AB4MXHVS.js";
|
|
9
9
|
import "../safe-bash/command-chunks/chunk-F44RAKDZ.js";
|
|
10
10
|
import {
|
|
11
11
|
init_buffer
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Lifecycle
|
|
3
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
4
|
-
import "../safe-bash/command-chunks/chunk-
|
|
3
|
+
} from "../safe-bash/command-chunks/chunk-7D7JRRML.js";
|
|
4
|
+
import "../safe-bash/command-chunks/chunk-AB4MXHVS.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-
|
|
4
|
-
import "../safe-bash/command-chunks/chunk-
|
|
3
|
+
} from "../safe-bash/command-chunks/chunk-JWE54GHQ.js";
|
|
4
|
+
import "../safe-bash/command-chunks/chunk-AB4MXHVS.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-
|
|
5
|
-
import "../safe-bash/command-chunks/chunk-
|
|
4
|
+
} from "../safe-bash/command-chunks/chunk-5HDSFHGW.js";
|
|
5
|
+
import "../safe-bash/command-chunks/chunk-AB4MXHVS.js";
|
|
6
6
|
import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
|
|
7
7
|
export {
|
|
8
8
|
Reader,
|
|
@@ -7,7 +7,7 @@ init_buffer();
|
|
|
7
7
|
import { FsError as FsError2, getCommandArguments, readBytes, writeBytes } from "../safe-bash-contracts/index.js";
|
|
8
8
|
import { createOutputOperation } from "../safe-bash-contracts/output.js";
|
|
9
9
|
import { shellValueByteLength } from "../safe-bash-contracts/value.js";
|
|
10
|
-
import {
|
|
10
|
+
import { yieldTurn } from "../safe-bash-contracts/yield.js";
|
|
11
11
|
import { PublicDiagnostic, publicDiagnosticMessage } from "../safe-bash-contracts/diagnostics.js";
|
|
12
12
|
|
|
13
13
|
// packages/safe-bash-command-numfmt/src/record-buffer.ts
|
|
@@ -1941,31 +1941,19 @@ var Converter = class {
|
|
|
1941
1941
|
invalid = false;
|
|
1942
1942
|
autoPadding = false;
|
|
1943
1943
|
work = 0;
|
|
1944
|
-
tickCount = 0;
|
|
1945
|
-
lastYieldWork = 0;
|
|
1946
|
-
lastYield = monotonicNow();
|
|
1947
1944
|
signalAborted;
|
|
1948
1945
|
pollSignal;
|
|
1949
1946
|
canTickSync(maxTicks) {
|
|
1950
1947
|
if (this.pollSignal ? this.context.signal.aborted : this.signalAborted) return false;
|
|
1951
|
-
if (this.work + maxTicks > this.limits.maxWork
|
|
1948
|
+
if (this.work + maxTicks > this.limits.maxWork) return false;
|
|
1952
1949
|
if (this.work % 1024 + maxTicks < 1024) return true;
|
|
1953
|
-
return
|
|
1950
|
+
return false;
|
|
1954
1951
|
}
|
|
1955
1952
|
tick(amount = 1) {
|
|
1956
1953
|
this.work += amount;
|
|
1957
1954
|
if (this.work > this.limits.maxWork) throw new PublicDiagnostic("numfmt work limit exceeded");
|
|
1958
1955
|
if (this.work % 1024 < amount) {
|
|
1959
|
-
|
|
1960
|
-
const now = monotonicNow();
|
|
1961
|
-
if (count === 1 || this.work - this.lastYieldWork >= 16384 || now - this.lastYield >= 16 || hasYieldCheckpoint(this.context.signal)) {
|
|
1962
|
-
this.lastYield = now;
|
|
1963
|
-
this.lastYieldWork = this.work;
|
|
1964
|
-
return yieldTurn(this.context.signal).then(() => {
|
|
1965
|
-
this.lastYield = monotonicNow();
|
|
1966
|
-
});
|
|
1967
|
-
}
|
|
1968
|
-
runYieldCheckpoint(this.context.signal);
|
|
1956
|
+
return yieldTurn(this.context.signal);
|
|
1969
1957
|
}
|
|
1970
1958
|
if (this.pollSignal ? this.context.signal.aborted : this.signalAborted) this.context.signal.throwIfAborted();
|
|
1971
1959
|
}
|
|
@@ -2246,11 +2234,9 @@ var Converter = class {
|
|
|
2246
2234
|
return false;
|
|
2247
2235
|
}
|
|
2248
2236
|
const savedWork = this.work;
|
|
2249
|
-
const savedTickCount = this.tickCount;
|
|
2250
2237
|
const savedPadding = settings2.padding;
|
|
2251
2238
|
const bail = () => {
|
|
2252
2239
|
this.work = savedWork;
|
|
2253
|
-
this.tickCount = savedTickCount;
|
|
2254
2240
|
settings2.padding = savedPadding;
|
|
2255
2241
|
return false;
|
|
2256
2242
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createPrCommand
|
|
3
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
4
|
-
import "../safe-bash/command-chunks/chunk-
|
|
5
|
-
import "../safe-bash/command-chunks/chunk-
|
|
6
|
-
import "../safe-bash/command-chunks/chunk-
|
|
7
|
-
import "../safe-bash/command-chunks/chunk-
|
|
3
|
+
} from "../safe-bash/command-chunks/chunk-B5BKA5WH.js";
|
|
4
|
+
import "../safe-bash/command-chunks/chunk-QAKKSRNV.js";
|
|
5
|
+
import "../safe-bash/command-chunks/chunk-QNXI2UP6.js";
|
|
6
|
+
import "../safe-bash/command-chunks/chunk-CPPGTBZF.js";
|
|
7
|
+
import "../safe-bash/command-chunks/chunk-N5FGCXQJ.js";
|
|
8
8
|
import "../safe-bash/command-chunks/chunk-HX3SHTCE.js";
|
|
9
9
|
export {
|
|
10
10
|
createPrCommand
|