@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
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
} from "./chunk-K6WIMONJ.js";
|
|
8
8
|
import {
|
|
9
9
|
Outputs
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-AXK3H4PX.js";
|
|
11
11
|
import {
|
|
12
12
|
Budget,
|
|
13
13
|
Cursor,
|
|
14
14
|
interruptible
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-MRW5HD2D.js";
|
|
16
16
|
import {
|
|
17
17
|
init_buffer
|
|
18
18
|
} from "./chunk-HX3SHTCE.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
describe
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YZ5SVZFD.js";
|
|
4
4
|
import {
|
|
5
5
|
JqError,
|
|
6
6
|
JqLimitError,
|
|
7
7
|
object,
|
|
8
8
|
put
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VVI4Z73I.js";
|
|
10
10
|
import {
|
|
11
11
|
utf8ByteLength
|
|
12
12
|
} from "./chunk-PDKXAR4Y.js";
|
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
|
|
5
5
|
// packages/safe-bash-xml-engine/src/limits.ts
|
|
6
6
|
init_buffer();
|
|
7
|
-
import { hasYieldCheckpoint, monotonicNow, runYieldCheckpoint, yieldTurn } from "../../safe-bash-contracts/yield.js";
|
|
8
7
|
var defaultXmlQueryLimits = Object.freeze({
|
|
9
8
|
maxInputBytes: Infinity,
|
|
10
9
|
maxOutputBytes: Infinity,
|
|
@@ -56,8 +55,6 @@ var XmlBudget = class {
|
|
|
56
55
|
checkpointTurn;
|
|
57
56
|
steps = 0;
|
|
58
57
|
checkpoint = 0;
|
|
59
|
-
checkpointCount = 0;
|
|
60
|
-
lastYield = monotonicNow();
|
|
61
58
|
aborted = false;
|
|
62
59
|
pollSignal;
|
|
63
60
|
outputBytes = 0;
|
|
@@ -69,14 +66,7 @@ var XmlBudget = class {
|
|
|
69
66
|
this.checkpoint += work;
|
|
70
67
|
if (this.checkpoint >= 16384) {
|
|
71
68
|
this.checkpoint = 0;
|
|
72
|
-
|
|
73
|
-
if ((++this.checkpointCount & 15) === 0 || this.checkpointTurn !== yieldTurn || hasYieldCheckpoint(this.signal) || now - this.lastYield >= 16) {
|
|
74
|
-
this.lastYield = now;
|
|
75
|
-
return this.checkpointTurn(this.signal).then(() => {
|
|
76
|
-
this.lastYield = monotonicNow();
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
runYieldCheckpoint(this.signal);
|
|
69
|
+
return this.checkpointTurn(this.signal);
|
|
80
70
|
}
|
|
81
71
|
}
|
|
82
72
|
results(size) {
|
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
equal,
|
|
3
3
|
indexValue,
|
|
4
4
|
sliceValue
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-YZ5SVZFD.js";
|
|
6
6
|
import {
|
|
7
7
|
JqError,
|
|
8
8
|
JqLimitError,
|
|
9
9
|
isObject
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-VVI4Z73I.js";
|
|
11
11
|
import {
|
|
12
12
|
encoder
|
|
13
13
|
} from "./chunk-PDKXAR4Y.js";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
|
|
5
5
|
// packages/safe-bash-command-split/src/io.ts
|
|
6
6
|
init_buffer();
|
|
7
|
-
import {
|
|
7
|
+
import { yieldTurn } from "../../safe-bash-contracts/yield.js";
|
|
8
8
|
import { FsError, readBytes } from "../../safe-bash-contracts/index.js";
|
|
9
9
|
import { pathOf } from "../../safe-bash-io-engine/internal.js";
|
|
10
10
|
var splitSignalWaiters = /* @__PURE__ */ new WeakMap();
|
|
@@ -56,8 +56,6 @@ var Budget = class {
|
|
|
56
56
|
outputBytes = 0;
|
|
57
57
|
steps = 0;
|
|
58
58
|
untilYield = 65536;
|
|
59
|
-
yieldChecks = 0;
|
|
60
|
-
lastYield = monotonicNow();
|
|
61
59
|
check(value, maximum, label) {
|
|
62
60
|
if (value > maximum) throw new FsError("EFBIG", { message: `split ${label} limit exceeded` });
|
|
63
61
|
}
|
|
@@ -77,13 +75,10 @@ var Budget = class {
|
|
|
77
75
|
this.untilYield -= count;
|
|
78
76
|
if (this.untilYield > 0) return;
|
|
79
77
|
this.untilYield = 65536;
|
|
80
|
-
if (++this.yieldChecks % 16 !== 0 && !hasYieldCheckpoint(this.signal) && monotonicNow() - this.lastYield < 16) return;
|
|
81
|
-
this.lastYield = monotonicNow();
|
|
82
78
|
return yieldTurn(this.signal).catch((error) => {
|
|
83
79
|
this.signal.throwIfAborted();
|
|
84
80
|
throw error;
|
|
85
81
|
}).then(() => {
|
|
86
|
-
this.lastYield = monotonicNow();
|
|
87
82
|
this.signal.throwIfAborted();
|
|
88
83
|
});
|
|
89
84
|
}
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
init_buffer();
|
|
7
7
|
import { getCommandArguments } from "../../safe-bash-contracts/index.js";
|
|
8
8
|
import { shellValueByteLength, shellValueBytes } from "../../safe-bash-contracts/value.js";
|
|
9
|
-
import {
|
|
9
|
+
import { inheritYieldCheckpoint, yieldTurn } from "../../safe-bash-contracts/yield.js";
|
|
10
10
|
import { PublicDiagnostic } from "../../safe-bash-contracts/diagnostics.js";
|
|
11
11
|
function settings(options) {
|
|
12
12
|
const limits = {
|
|
@@ -119,8 +119,6 @@ var Budget = class {
|
|
|
119
119
|
signal;
|
|
120
120
|
work = 0;
|
|
121
121
|
checkpoint = 0;
|
|
122
|
-
yieldChecks = 0;
|
|
123
|
-
lastYield = monotonicNow();
|
|
124
122
|
retained = 0;
|
|
125
123
|
input = 0;
|
|
126
124
|
lines = 0;
|
|
@@ -144,13 +142,7 @@ var Budget = class {
|
|
|
144
142
|
this.assertSignalOpen();
|
|
145
143
|
if (this.work - this.checkpoint < 4096) return;
|
|
146
144
|
this.checkpoint = this.work;
|
|
147
|
-
if (++this.yieldChecks % 16 !== 0 && !hasYieldCheckpoint(this.signal) && monotonicNow() - this.lastYield < 25) {
|
|
148
|
-
runYieldCheckpoint(this.signal);
|
|
149
|
-
this.assertSignalOpen();
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
145
|
return yieldTurn(this.signal).then(() => {
|
|
153
|
-
this.lastYield = monotonicNow();
|
|
154
146
|
this.assertSignalOpen();
|
|
155
147
|
});
|
|
156
148
|
}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import {
|
|
2
2
|
recurse
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZT4KSS2V.js";
|
|
4
4
|
import {
|
|
5
5
|
splitRegex
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-EIVW3X3N.js";
|
|
7
7
|
import {
|
|
8
8
|
scanRegex,
|
|
9
9
|
substituteRegex
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-KMCZ6P4O.js";
|
|
11
11
|
import {
|
|
12
12
|
capture
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-JCNNOMBV.js";
|
|
14
14
|
import {
|
|
15
15
|
fromDateIso8601,
|
|
16
16
|
toDateIso8601
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-NETECMOF.js";
|
|
18
18
|
import {
|
|
19
19
|
delpaths
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-ZXKW7SJ2.js";
|
|
21
21
|
import {
|
|
22
22
|
formatValue
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-4ZALPDBV.js";
|
|
24
24
|
import {
|
|
25
25
|
indices
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-LLCXZKZ6.js";
|
|
27
27
|
import {
|
|
28
28
|
binary,
|
|
29
29
|
compare,
|
|
@@ -37,16 +37,16 @@ import {
|
|
|
37
37
|
sortedKeys,
|
|
38
38
|
stableSort,
|
|
39
39
|
type
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-YZ5SVZFD.js";
|
|
41
41
|
import {
|
|
42
42
|
splitString
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-UI32HWGS.js";
|
|
44
44
|
import {
|
|
45
45
|
JqParseError,
|
|
46
46
|
measureValue,
|
|
47
47
|
parseJson,
|
|
48
48
|
stringify
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-5ZSM4UFN.js";
|
|
50
50
|
import {
|
|
51
51
|
JqError,
|
|
52
52
|
JqHalt,
|
|
@@ -61,7 +61,7 @@ import {
|
|
|
61
61
|
put,
|
|
62
62
|
remove,
|
|
63
63
|
truth
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-VVI4Z73I.js";
|
|
65
65
|
import {
|
|
66
66
|
utf8ByteLength
|
|
67
67
|
} from "./chunk-PDKXAR4Y.js";
|
|
@@ -9,7 +9,7 @@ init_buffer();
|
|
|
9
9
|
init_buffer();
|
|
10
10
|
import { utf8ByteLength } from "../../safe-bash-byte-engine/index.js";
|
|
11
11
|
import { publicDiagnosticMessage } from "../../safe-bash-contracts/diagnostics.js";
|
|
12
|
-
import {
|
|
12
|
+
import { yieldTurn } from "../../safe-bash-contracts/yield.js";
|
|
13
13
|
import { escapeText } from "../../safe-bash-contracts/escaping.js";
|
|
14
14
|
import { FsError, writeBytes } from "../../safe-bash-contracts/index.js";
|
|
15
15
|
var treeUtf8Encoder = new TextEncoder();
|
|
@@ -69,7 +69,6 @@ var WalkBudget = class {
|
|
|
69
69
|
output = 0;
|
|
70
70
|
steps = 0;
|
|
71
71
|
operations = 0;
|
|
72
|
-
lastYield = monotonicNow();
|
|
73
72
|
nameCharset;
|
|
74
73
|
get remainingEntries() {
|
|
75
74
|
return this.limits.maxEntries - this.entries;
|
|
@@ -106,9 +105,8 @@ var WalkBudget = class {
|
|
|
106
105
|
async fs(operation) {
|
|
107
106
|
this.step();
|
|
108
107
|
const { signal } = this.context;
|
|
109
|
-
if (++this.operations % 64 === 0
|
|
108
|
+
if (++this.operations % 64 === 0) {
|
|
110
109
|
await yieldTurn(signal);
|
|
111
|
-
this.lastYield = monotonicNow();
|
|
112
110
|
}
|
|
113
111
|
signal.throwIfAborted();
|
|
114
112
|
const waiters = getTreeSignalWaiters(signal);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compile
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BZPAWTUL.js";
|
|
4
4
|
import {
|
|
5
5
|
UsageError,
|
|
6
6
|
environmentCharset,
|
|
7
7
|
explicitCharset
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-PFAADCB5.js";
|
|
9
9
|
import {
|
|
10
10
|
init_buffer
|
|
11
11
|
} from "./chunk-HX3SHTCE.js";
|
|
@@ -3,20 +3,20 @@ import {
|
|
|
3
3
|
} from "./chunk-IEXHHNOF.js";
|
|
4
4
|
import {
|
|
5
5
|
Lifecycle
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7D7JRRML.js";
|
|
7
7
|
import {
|
|
8
8
|
parse
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-JWE54GHQ.js";
|
|
10
10
|
import {
|
|
11
11
|
Reader,
|
|
12
12
|
fsDetail
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-5HDSFHGW.js";
|
|
14
14
|
import {
|
|
15
15
|
Budget,
|
|
16
16
|
IconvError,
|
|
17
17
|
pathText,
|
|
18
18
|
settings
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-AB4MXHVS.js";
|
|
20
20
|
import {
|
|
21
21
|
init_buffer
|
|
22
22
|
} from "./chunk-HX3SHTCE.js";
|
|
@@ -147,14 +147,7 @@ var Budget = class {
|
|
|
147
147
|
if (now - this.yieldTimes[0] >= 25) return true;
|
|
148
148
|
if (checkpoint) return this.steps - this.lastYieldSteps >= 1024;
|
|
149
149
|
}
|
|
150
|
-
|
|
151
|
-
if (!checkTime && this.yieldTimes[0] >= 0 && this.steps < 524288 && monotonicNow() - this.yieldTimes[0] < 20) {
|
|
152
|
-
this.lastYieldSteps = this.steps;
|
|
153
|
-
return false;
|
|
154
|
-
}
|
|
155
|
-
return true;
|
|
156
|
-
}
|
|
157
|
-
return false;
|
|
150
|
+
return this.steps - this.lastYieldSteps >= 65536;
|
|
158
151
|
}
|
|
159
152
|
ensureFreshWindow() {
|
|
160
153
|
const now = monotonicNow();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
splitString
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UI32HWGS.js";
|
|
4
4
|
import {
|
|
5
5
|
jsonFragments,
|
|
6
6
|
renderJsonFragment
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-5ZSM4UFN.js";
|
|
8
8
|
import {
|
|
9
9
|
JqError,
|
|
10
10
|
JqLimitError,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
objectKeyIterator,
|
|
15
15
|
objectKeys,
|
|
16
16
|
put
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-VVI4Z73I.js";
|
|
18
18
|
import {
|
|
19
19
|
decoder,
|
|
20
20
|
encoder,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
blockTags
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HFII3QYO.js";
|
|
4
4
|
import {
|
|
5
5
|
destination,
|
|
6
6
|
escapeText
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-7L24L4UO.js";
|
|
8
8
|
import {
|
|
9
9
|
htmlSpace,
|
|
10
10
|
normalizeText,
|
|
11
11
|
trimText
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-HHP343KT.js";
|
|
13
13
|
import {
|
|
14
14
|
Builder
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-4Y3WVMK4.js";
|
|
16
16
|
import {
|
|
17
17
|
init_buffer
|
|
18
18
|
} from "./chunk-HX3SHTCE.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
indexValue,
|
|
3
3
|
type
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YZ5SVZFD.js";
|
|
5
5
|
import {
|
|
6
6
|
JqError,
|
|
7
7
|
JqLimitError,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
isObject,
|
|
10
10
|
put,
|
|
11
11
|
remove
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-VVI4Z73I.js";
|
|
13
13
|
import {
|
|
14
14
|
isNumber,
|
|
15
15
|
numberValue
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { byteLength, concatBytes, decodeBytes, encodeBytes } from "../../byte-encoding.js";
|
|
2
2
|
import { PublicDiagnostic, publicDiagnosticMessage } from "../../diagnostics.js";
|
|
3
3
|
import { writeDiagnostic } from "../../escaping.js";
|
|
4
|
-
import {
|
|
4
|
+
import { yieldTurn } from "../../contracts/yield.js";
|
|
5
5
|
import { collectBytes, isFsError, readBytes, } from "../../contracts/index.js";
|
|
6
6
|
import { pathOf } from "../internal.js";
|
|
7
7
|
export class ToolError extends PublicDiagnostic {
|
|
@@ -20,8 +20,6 @@ export class Budget {
|
|
|
20
20
|
lines = 0;
|
|
21
21
|
work = 0;
|
|
22
22
|
nextYield = 4096;
|
|
23
|
-
yieldChecks = 0;
|
|
24
|
-
nextYieldTime = monotonicNow() + 8;
|
|
25
23
|
files = 0;
|
|
26
24
|
hunks = 0;
|
|
27
25
|
signalAborted;
|
|
@@ -63,15 +61,8 @@ export class Budget {
|
|
|
63
61
|
if (this.pollSignal ? this.context.signal.aborted : this.signalAborted)
|
|
64
62
|
this.context.signal.throwIfAborted();
|
|
65
63
|
if (this.work >= this.nextYield) {
|
|
66
|
-
const firstYield = this.nextYield === 4096;
|
|
67
64
|
this.nextYield = this.work + 4096;
|
|
68
|
-
|
|
69
|
-
if (++this.yieldChecks % 16 === 0 || firstYield || now >= this.nextYieldTime) {
|
|
70
|
-
this.nextYieldTime = now + 16;
|
|
71
|
-
return yieldTurn(this.context.signal).then(() => {
|
|
72
|
-
this.nextYieldTime = monotonicNow() + 16;
|
|
73
|
-
});
|
|
74
|
-
}
|
|
65
|
+
return yieldTurn(this.context.signal);
|
|
75
66
|
}
|
|
76
67
|
}
|
|
77
68
|
file() {
|
|
@@ -4,15 +4,13 @@ import { createBufferedOutput, FsError } from "../contracts/index.js";
|
|
|
4
4
|
import { RETURN_EXIT_ONE, RETURN_EXIT_TWO, RETURN_EXIT_ZERO, assertInputRequirements, bufferLimit, codeOf, concatenate, define, diagnostic, encoder, input, integer, lines, options, output, outputRange, pathOf, requireOperands, RESOLVED_EXIT_ZERO, UsageError, value } from "./internal.js";
|
|
5
5
|
import { assertCommandRequirements } from "../contracts/command-requirements.js";
|
|
6
6
|
import { inputRequirements, textOutputRequirements } from "./portable-requirements.js";
|
|
7
|
-
import { hasYieldCheckpoint,
|
|
7
|
+
import { hasYieldCheckpoint, yieldTurn } from "../contracts/yield.js";
|
|
8
8
|
import { RecordBuffer } from "./record-buffer.js";
|
|
9
9
|
import { SortRecordBudget } from "./sort-admission.js";
|
|
10
10
|
import { compareObservedEntries } from "./copy-identity.js";
|
|
11
11
|
class SortWork {
|
|
12
12
|
signal;
|
|
13
13
|
#pending = 0;
|
|
14
|
-
#syncTurns = 0;
|
|
15
|
-
#lastYield = monotonicNow();
|
|
16
14
|
constructor(signal) {
|
|
17
15
|
this.signal = signal;
|
|
18
16
|
this.signal.throwIfAborted();
|
|
@@ -20,31 +18,9 @@ class SortWork {
|
|
|
20
18
|
charge(units = 1) {
|
|
21
19
|
this.#pending += units;
|
|
22
20
|
if (this.#pending >= 4096) {
|
|
23
|
-
if (!hasYieldCheckpoint(this.signal)) {
|
|
24
|
-
while (this.#pending >= 4096) {
|
|
25
|
-
this.#pending -= 4096;
|
|
26
|
-
runYieldCheckpoint(this.signal);
|
|
27
|
-
this.signal.throwIfAborted();
|
|
28
|
-
if (++this.#syncTurns % 8 === 0) {
|
|
29
|
-
const now = monotonicNow();
|
|
30
|
-
// A fast or coarse host clock must not suppress every host turn.
|
|
31
|
-
if (this.#syncTurns >= 256 || now - this.#lastYield >= 16) {
|
|
32
|
-
this.#syncTurns = 0;
|
|
33
|
-
this.#lastYield = now;
|
|
34
|
-
return this.#checkpointOnce();
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return undefined;
|
|
39
|
-
}
|
|
40
21
|
return this.#checkpoint();
|
|
41
22
|
}
|
|
42
23
|
}
|
|
43
|
-
async #checkpointOnce() {
|
|
44
|
-
await yieldTurn(this.signal);
|
|
45
|
-
this.#lastYield = monotonicNow();
|
|
46
|
-
this.signal.throwIfAborted();
|
|
47
|
-
}
|
|
48
24
|
async #checkpoint() {
|
|
49
25
|
while (this.#pending >= 4096) {
|
|
50
26
|
this.#pending -= 4096;
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
parseShell,
|
|
58
58
|
searchCommands,
|
|
59
59
|
unrtfCommands
|
|
60
|
-
} from "./chunks/chunk-
|
|
60
|
+
} from "./chunks/chunk-WUNK5NXJ.js";
|
|
61
61
|
import {
|
|
62
62
|
createYqCommand,
|
|
63
63
|
createYqCommands,
|
|
@@ -75,7 +75,7 @@ import {
|
|
|
75
75
|
ghCommands,
|
|
76
76
|
ghMetadata,
|
|
77
77
|
lazyCommandPlugin
|
|
78
|
-
} from "./chunks/chunk-
|
|
78
|
+
} from "./chunks/chunk-TRVGCN3U.js";
|
|
79
79
|
import {
|
|
80
80
|
applyPatchCommands,
|
|
81
81
|
baseAgentCommands,
|
|
@@ -120,7 +120,7 @@ import {
|
|
|
120
120
|
textProgramCommands,
|
|
121
121
|
xxdCommands,
|
|
122
122
|
yesCommands
|
|
123
|
-
} from "./chunks/chunk-
|
|
123
|
+
} from "./chunks/chunk-SPYL72GN.js";
|
|
124
124
|
import {
|
|
125
125
|
createHdCommand,
|
|
126
126
|
createHexdumpCommand,
|
|
@@ -247,7 +247,7 @@ import {
|
|
|
247
247
|
unameCommands,
|
|
248
248
|
whichCommands,
|
|
249
249
|
whoamiCommands
|
|
250
|
-
} from "./chunks/chunk-
|
|
250
|
+
} from "./chunks/chunk-AZAJJVFX.js";
|
|
251
251
|
import "./chunks/chunk-U5NUZPCC.js";
|
|
252
252
|
import {
|
|
253
253
|
createGetoptCommand,
|
|
@@ -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 "@poe-platform/safe-bash/contracts/io";
|
|
6
6
|
import { createOutputOperation } from "@poe-platform/safe-bash/contracts/output";
|
|
7
|
-
import {
|
|
7
|
+
import { yieldTurn } from "@poe-platform/safe-bash/contracts/yield";
|
|
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) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createOutputOperation } from "@poe-platform/safe-bash/contracts";
|
|
2
|
-
import { yieldTurn } from "@poe-platform/safe-bash/contracts/yield";
|
|
2
|
+
import { inheritYieldCheckpoint, yieldTurn } from "@poe-platform/safe-bash/contracts/yield";
|
|
3
3
|
export const mikeLimits = Object.freeze({
|
|
4
4
|
maxInputBytes: Infinity, maxDocumentBytes: Infinity,
|
|
5
5
|
maxScalarBytes: Infinity, maxNodes: Infinity, maxParserNodes: Infinity,
|
|
@@ -49,6 +49,7 @@ export class NativeWork {
|
|
|
49
49
|
constructor(context, limits) {
|
|
50
50
|
this.context = context;
|
|
51
51
|
this.limits = limits;
|
|
52
|
+
inheritYieldCheckpoint(context.signal, this.signal);
|
|
52
53
|
context.registerCleanup?.(() => this.close());
|
|
53
54
|
const abort = () => { this.#aborted = true; this.controller.abort(context.signal.reason); };
|
|
54
55
|
this.signal.addEventListener("abort", () => { this.#aborted = true; }, { once: true });
|