@poe-platform/safe-bash 0.1.826 → 0.1.828
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/dist/image-ast/index.js +39 -18
- package/dist/pdf-ast/image.js +1 -1
- package/dist/pdf-ast/index.js +1 -1
- package/dist/pdf-ast/vendor/pdfjs-fonts.mjs +9 -3
- package/dist/safe-bash/chunks/{chunk-VWLQDZFF.js → chunk-C7RBTLYX.js} +12 -5
- package/dist/safe-bash/chunks/{chunk-TZRVK3NU.js → chunk-HWYINF6Y.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-AGHV53VF.js → chunk-M6XFU6LQ.js} +3 -1
- package/dist/safe-bash/chunks/{chunk-ZJAXMB5M.js → chunk-SGHFQIZB.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-363QOIDR.js → chunk-T6FHWSHM.js} +3 -1
- package/dist/safe-bash/chunks/{chunk-RAFD5ZAH.js → chunk-Y67A2DE4.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-VKTM2SOL.js → chunk-2EEIB5O3.js} +192 -489
- package/dist/safe-bash/command-chunks/{chunk-FMGNXOMV.js → chunk-2L3NMRLG.js} +7 -3
- package/dist/safe-bash/command-chunks/{chunk-DAQO64WC.js → chunk-2YKOJPIW.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-EPYJSPOY.js → chunk-3QCW4VQF.js} +12 -8
- package/dist/safe-bash/command-chunks/{chunk-YRBFNT5B.js → chunk-3YL2TMLA.js} +10 -1
- package/dist/safe-bash/command-chunks/{chunk-UWIDPTOB.js → chunk-3ZCABR5P.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-5H7ZHP7F.js → chunk-43NDRBKY.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-BBOYR6LV.js → chunk-46GA576V.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-WPT2FCHH.js → chunk-4SLPM2WM.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-7ZQVMPSB.js → chunk-5CAXR62E.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-3DTHX5UU.js → chunk-66653AEZ.js} +40 -14
- package/dist/safe-bash/command-chunks/{chunk-ETFJ4L7F.js → chunk-6OLE6CLV.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-2KMNVJB7.js → chunk-A7PKUIJT.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-O3FTKLWR.js → chunk-BXOBM4HJ.js} +26 -17
- package/dist/safe-bash/command-chunks/{chunk-P66Q5F6K.js → chunk-DEQ47SBQ.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-ZPBL7TYJ.js → chunk-EF3RAQ7M.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-RQTFK7AV.js → chunk-EOO3NLD5.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-EV7A5FNN.js → chunk-FFFRLPXU.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-MQCLG2CT.js → chunk-FMXBLKWO.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-4MVQE6CT.js → chunk-FYTBEGSY.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-HS2L7I4N.js +219 -0
- package/dist/safe-bash/command-chunks/{chunk-NXZJJM4J.js → chunk-IGXH5W5Z.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-CMJBRGU2.js → chunk-IHQZKUBS.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-JADJ4BMN.js +1519 -0
- package/dist/safe-bash/command-chunks/{chunk-5AQAWIYK.js → chunk-JEZC5V3B.js} +4 -0
- package/dist/safe-bash/command-chunks/{chunk-YB5TNDY6.js → chunk-K5VJ4NNL.js} +39 -5
- package/dist/safe-bash/command-chunks/{chunk-7RQGRFHJ.js → chunk-KHWDEAE4.js} +2 -2
- package/dist/safe-bash/command-chunks/chunk-KSCVKF7I.js +604 -0
- package/dist/safe-bash/command-chunks/{chunk-3NJETNC2.js → chunk-MBXNG6C3.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-WKS2PAZL.js → chunk-N63IGO5F.js} +10 -1
- package/dist/safe-bash/command-chunks/{chunk-3DID6MQY.js → chunk-OWTQYLID.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-4EA7WI3L.js → chunk-QOOQD6BD.js} +42 -33
- package/dist/safe-bash/command-chunks/{chunk-R3SLT3ZX.js → chunk-R6GON4H3.js} +11 -1
- package/dist/safe-bash/command-chunks/{chunk-2GILUQJY.js → chunk-R7ZGDHME.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-LKAFLJ5L.js → chunk-RWQKX44L.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-PKH57OIC.js → chunk-SG2KOOD4.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-HCPEYQKT.js → chunk-SIAN5LI3.js} +286 -307
- package/dist/safe-bash/command-chunks/chunk-T4TGJYFV.js +60 -0
- package/dist/safe-bash/command-chunks/{chunk-T7RT2BNL.js → chunk-U5TQVW64.js} +191 -146
- package/dist/safe-bash/command-chunks/{chunk-NXCJNPL3.js → chunk-UCE77LYV.js} +2 -1
- package/dist/safe-bash/command-chunks/{chunk-OT75C5YS.js → chunk-UGDQSGUZ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-EWECMOQ5.js → chunk-UIHPHIKI.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-4XYGJB24.js → chunk-VJXPNNBD.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-E5CDHXFA.js → chunk-VOR6YDZC.js} +26 -1
- package/dist/safe-bash/command-chunks/{chunk-ZIDESNHW.js → chunk-VQINIBCZ.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-VSNVYOK2.js +30 -0
- package/dist/safe-bash/command-chunks/{chunk-Q2ACHUTY.js → chunk-WRO3PB2M.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-RUAGHZNF.js → chunk-X5ODTF3E.js} +7 -5
- package/dist/safe-bash/command-chunks/{chunk-LH4VBNF6.js → chunk-XGTSP2CP.js} +84 -16
- package/dist/safe-bash/command-chunks/{chunk-J3VS55K4.js → chunk-YHRESVJ7.js} +9 -3
- package/dist/safe-bash/command-chunks/{chunk-K576GZED.js → chunk-YK6ZVCA2.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-W5LH7D23.js → chunk-YR2A2L4J.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-UYNJF5QN.js → chunk-ZALAWNOE.js} +76 -122
- package/dist/safe-bash/command-chunks/{pdf-renderer-346WYKSZ.js → pdf-renderer-5QWOVFA4.js} +1 -1
- package/dist/safe-bash/command-chunks/{prompt-tool-debug-3POFNRYP.js → prompt-tool-debug-G7ATE7D5.js} +6 -4
- package/dist/safe-bash/commands/bc/index.browser.js +1 -1
- package/dist/safe-bash/commands/llm/index.browser.js +5 -1
- package/dist/safe-bash/commands/llm/index.js +1 -1
- package/dist/safe-bash/commands/python/executor.browser.js +3 -1
- package/dist/safe-bash/commands/python/executor.js +1 -1
- package/dist/safe-bash/commands/python/index.browser.js +5 -1
- package/dist/safe-bash/commands/python/index.js +1 -1
- package/dist/safe-bash/core.browser.js +2 -2
- package/dist/safe-bash/full-core.browser.js +14 -6
- package/dist/safe-bash/plugins/index.browser.js +3 -3
- package/dist/safe-bash/registry-entry.browser.js +2 -2
- package/dist/safe-bash/search.browser.js +1 -1
- package/dist/safe-bash/shell/runtime.js +18 -7
- package/dist/safe-bash/shell/sync-extra-evaluators.js +2 -0
- package/dist/safe-bash/shell-entry.browser.js +2 -2
- package/dist/safe-bash-command-awk/awk-runtime.js +2 -2
- package/dist/safe-bash-command-awk/awk-syntax.js +1 -1
- package/dist/safe-bash-command-awk/awk.js +3 -3
- package/dist/safe-bash-command-awk/index.js +3 -3
- package/dist/safe-bash-command-ffmpeg/index.js +15 -12
- package/dist/safe-bash-command-ffprobe/index.js +2 -2
- package/dist/safe-bash-command-ffprobe/media.js +2 -2
- package/dist/safe-bash-command-git/git_rust.wasm +0 -0
- package/dist/safe-bash-command-gpg/index.js +11 -3
- package/dist/safe-bash-command-imagemagick/index.js +45 -12
- package/dist/safe-bash-command-llm/collections.js +6 -4
- package/dist/safe-bash-command-llm/command.js +4 -4
- package/dist/safe-bash-command-llm/import-json-document.d.ts +9 -2
- package/dist/safe-bash-command-llm/index.d.ts +2 -1
- package/dist/safe-bash-command-llm/index.js +10 -4
- package/dist/safe-bash-command-llm/loader-provider.d.ts +5 -0
- package/dist/safe-bash-command-mcp/index.js +10 -13
- package/dist/safe-bash-command-pdftoppm/index.js +2 -2
- package/dist/safe-bash-command-playwright-cli/index.js +2 -2
- package/dist/safe-bash-command-playwright-cli/playwright/ability-execution.d.ts +1 -0
- package/dist/safe-bash-command-playwright-cli/playwright/ability-execution.js +1 -1
- package/dist/safe-bash-command-playwright-cli/playwright/controller.d.ts +2 -0
- package/dist/safe-bash-command-playwright-cli/playwright/controller.js +2 -2
- package/dist/safe-bash-command-playwright-cli/playwright/index.js +2 -2
- package/dist/safe-bash-command-python/build-backend.d.ts +2 -0
- package/dist/safe-bash-command-python/cache.d.ts +1 -1
- package/dist/safe-bash-command-python/executor.d.ts +5 -2
- package/dist/safe-bash-command-python/executor.js +11 -6
- package/dist/safe-bash-command-python/host-capabilities.js +1 -1
- package/dist/safe-bash-command-python/index.js +11 -6
- package/dist/safe-bash-command-python/jspi.js +5 -3
- package/dist/safe-bash-command-python/manifest-file.d.ts +44 -0
- package/dist/safe-bash-command-python/manifest.d.ts +45 -0
- package/dist/safe-bash-command-python/provisioning.d.ts +20 -1
- package/dist/safe-bash-command-python/provisioning.js +3 -2
- package/dist/safe-bash-command-python/reply.js +7 -11
- package/dist/safe-bash-command-python/source-archive.js +2 -2
- package/dist/safe-bash-command-python/source-zip.js +2 -2
- package/dist/safe-bash-command-python/worker.js +34 -21
- package/dist/safe-bash-command-sqlite3/engine.d.ts +4 -0
- package/dist/safe-bash-command-sqlite3/index.js +174 -18
- package/dist/safe-bash-command-svgo/index.js +1 -1
- package/dist/safe-bash-command-tar/create.js +3 -3
- package/dist/safe-bash-command-tar/extract.js +3 -3
- package/dist/safe-bash-command-tar/index.js +5 -5
- package/dist/safe-bash-command-tar/modes.js +5 -5
- package/dist/safe-bash-command-tar/options.d.ts +1 -1
- package/dist/safe-bash-command-tar/options.js +1 -1
- package/dist/safe-bash-command-tar/stream.js +1 -1
- package/dist/safe-bash-command-wkhtmltopdf/index.js +1 -1
- package/dist/safe-bash-command-xan/argv.js +1 -1
- package/dist/safe-bash-command-xan/commands.js +3 -3
- package/dist/safe-bash-command-xan/index.js +3 -3
- package/dist/safe-bash-command-xan/io.js +2 -2
- package/dist/safe-bash-compression-engine/bounded-codec.js +3 -3
- package/dist/safe-bash-compression-engine/codec-loader.js +2 -2
- package/dist/safe-bash-compression-engine/files.js +6 -6
- package/dist/safe-bash-compression-engine/index.js +5 -5
- package/dist/safe-bash-compression-engine/operand.js +6 -6
- package/dist/safe-bash-compression-engine/options.js +1 -1
- package/dist/safe-bash-compression-engine/stream.js +5 -5
- package/dist/safe-bash-compression-engine/zstd-decode.js +4 -4
- package/dist/safe-bash-contracts/filesystem-descriptor.js +1 -1
- package/dist/safe-bash-contracts/filesystem-output.js +1 -1
- package/dist/safe-bash-csv-engine/index.js +4 -4
- package/dist/safe-bash-csv-engine/python-codec-aliases.js +1 -1
- package/dist/safe-bash-csv-engine/python-codepages.js +2 -2
- package/dist/safe-bash-csv-engine/python-utf16.js +3 -3
- package/dist/safe-bash-csv-engine/text-decoder.js +4 -4
- package/dist/safe-bash-graphviz-engine/index.js +1 -1
- package/dist/safe-bash-pager-engine/index.js +2 -2
- package/dist/safe-bash-query-engine/capture.js +3 -3
- package/dist/safe-bash-query-engine/delpaths.js +3 -3
- package/dist/safe-bash-query-engine/formats.js +2 -2
- package/dist/safe-bash-query-engine/index.js +10 -10
- package/dist/safe-bash-query-engine/indices.js +3 -3
- package/dist/safe-bash-query-engine/input.d.ts +3 -3
- package/dist/safe-bash-query-engine/input.js +1 -1
- package/dist/safe-bash-query-engine/interpreter.js +9 -9
- package/dist/safe-bash-query-engine/query-core.js +10 -10
- package/dist/safe-bash-query-engine/regex.js +4 -4
- package/dist/safe-bash-query-engine/splits.js +5 -5
- package/dist/safe-bash-query-engine/values.js +2 -2
- package/dist/safe-playwright-cloudflare/browser-code-executor.js +2 -2
- package/dist/safe-playwright-cloudflare/browser-guest-source.d.ts +2 -0
- package/dist/safe-playwright-cloudflare/browser-guest-source.js +36 -0
- package/dist/safe-playwright-cloudflare/browser-run-code-contract.d.ts +1 -1
- package/dist/safe-playwright-cloudflare/browser-run-code-guest.generated.d.ts +1 -2
- package/dist/safe-playwright-cloudflare/browser-run-code-guest.generated.js +2 -2
- package/dist/safe-playwright-cloudflare/browser-run-code.js +4 -1
- package/package.json +4 -3
- package/dist/safe-bash/command-chunks/chunk-BKQWFABY.js +0 -960
- package/dist/safe-bash/command-chunks/chunk-DV7TCGJR.js +0 -691
- package/dist/safe-bash/command-chunks/chunk-ZERCTWUI.js +0 -467
|
@@ -117,8 +117,9 @@ var builtinArities = {
|
|
|
117
117
|
length: [0, 1],
|
|
118
118
|
substr: [2, 3],
|
|
119
119
|
index: [2, 2],
|
|
120
|
-
split: [2,
|
|
121
|
-
match: [2,
|
|
120
|
+
split: [2, 4],
|
|
121
|
+
match: [2, 3],
|
|
122
|
+
strtonum: [1, 1],
|
|
122
123
|
sub: [2, 3],
|
|
123
124
|
gsub: [2, 3],
|
|
124
125
|
sprintf: [1, Infinity],
|
|
@@ -271,7 +272,8 @@ var AwkParser = class {
|
|
|
271
272
|
const arity = Object.hasOwn(this.arities, call.expression.name) ? this.arities[call.expression.name] : definition ? [0, definition.parameters.length] : void 0;
|
|
272
273
|
if (!arity) throw new ProgramError(`unsupported function '${call.expression.name}'`);
|
|
273
274
|
if (call.expression.args.length < arity[0] || call.expression.args.length > arity[1]) throw new ProgramError(`invalid argument count for '${call.expression.name}'`);
|
|
274
|
-
if (call.expression.name === "split" && call.expression.args[1]?.kind !== "variable") throw new ProgramError("split requires an array variable as its second argument");
|
|
275
|
+
if (call.expression.name === "split" && (call.expression.args[1]?.kind !== "variable" || call.expression.args[3] && call.expression.args[3].kind !== "variable")) throw new ProgramError("split requires an array variable as its second argument");
|
|
276
|
+
if (call.expression.name === "match" && call.expression.args[2] && call.expression.args[2].kind !== "variable") throw new ProgramError("match requires an array variable as its third argument");
|
|
275
277
|
if ((call.expression.name === "asort" || call.expression.name === "asorti") && call.expression.args.some((arg) => arg.kind !== "variable")) throw new ProgramError("asort/asorti requires array variables");
|
|
276
278
|
if ((call.expression.name === "sub" || call.expression.name === "gsub") && call.expression.args[2] && !isLvalue(call.expression.args[2])) throw new ProgramError("sub/gsub target must be assignable");
|
|
277
279
|
if (call.expression.name === "sprintf" && call.expression.args[0]?.kind === "string") validateFormat(call.expression.args[0].value);
|
|
@@ -514,6 +516,8 @@ var AwkParser = class {
|
|
|
514
516
|
const expression = { kind: "call", name, args };
|
|
515
517
|
this.calls.push({ expression, owner: this.currentFunction });
|
|
516
518
|
if (name === "split" && args[1]?.kind === "variable") this.arrays.add(args[1].name);
|
|
519
|
+
if (name === "split" && args[3]?.kind === "variable") this.arrays.add(args[3].name);
|
|
520
|
+
if (name === "match" && args[2]?.kind === "variable") this.arrays.add(args[2].name);
|
|
517
521
|
if (name === "asort" || name === "asorti") {
|
|
518
522
|
for (const arg of args) if (arg.kind === "variable") this.arrays.add(arg.name);
|
|
519
523
|
}
|
|
@@ -235,7 +235,7 @@ function serializeDot(graph) {
|
|
|
235
235
|
return reference(statement.node) + attributes(statement.attributes) + ";\n";
|
|
236
236
|
if (statement.kind === "edge")
|
|
237
237
|
return statement.endpoints.map((endpoint) => "kind" in endpoint ? sub(endpoint) : reference(endpoint)).join(graph.directed ? " -> " : " -- ") + attributes(statement.attributes) + ";\n";
|
|
238
|
-
return statement.target + attributes(statement.attributes) + ";\n";
|
|
238
|
+
return Object.keys(statement.attributes).length ? statement.target + attributes(statement.attributes) + ";\n" : "";
|
|
239
239
|
}).join("");
|
|
240
240
|
return (graph.strict ? "strict " : "") + (graph.directed ? "digraph" : "graph") + (graph.id !== void 0 ? " " + quote(graph.id) : "") + " {\n" + body(graph.statements) + "}\n";
|
|
241
241
|
}
|
|
@@ -13,6 +13,9 @@ function createPythonHostBridge(capabilities, options) {
|
|
|
13
13
|
for (const limit of [maxMessageBytes, maxMessageDepth, maxConcurrentCalls, maxStreams, maxStreamBytes]) {
|
|
14
14
|
if (limit !== Infinity && (!Number.isSafeInteger(limit) || limit < 1)) throw new RangeError("Invalid Python host capability limit");
|
|
15
15
|
}
|
|
16
|
+
const checkMessageLimit = (size, maximum = maxMessageBytes) => {
|
|
17
|
+
if (size > maximum) throw new RangeError("Python host message limit exceeded");
|
|
18
|
+
};
|
|
16
19
|
const registry = new Map(Object.entries(capabilities));
|
|
17
20
|
const controller = new AbortController();
|
|
18
21
|
const signal = AbortSignal.any([options.signal, controller.signal]);
|
|
@@ -31,20 +34,21 @@ function createPythonHostBridge(capabilities, options) {
|
|
|
31
34
|
let nodes = 0;
|
|
32
35
|
let estimatedBytes = 0;
|
|
33
36
|
const inspect = (item, depth) => {
|
|
34
|
-
|
|
37
|
+
checkMessageLimit(++nodes);
|
|
38
|
+
checkMessageLimit(depth, maxMessageDepth);
|
|
35
39
|
if (item === null || typeof item === "boolean" || typeof item === "number" && Number.isFinite(item)) {
|
|
36
40
|
estimatedBytes += JSON.stringify(item).length;
|
|
37
|
-
|
|
41
|
+
checkMessageLimit(estimatedBytes);
|
|
38
42
|
return;
|
|
39
43
|
}
|
|
40
44
|
if (typeof item === "string") {
|
|
41
|
-
|
|
45
|
+
checkMessageLimit(item.length);
|
|
42
46
|
estimatedBytes += new TextEncoder().encode(JSON.stringify(item)).length;
|
|
43
|
-
|
|
47
|
+
checkMessageLimit(estimatedBytes);
|
|
44
48
|
return;
|
|
45
49
|
}
|
|
46
50
|
if (typeof item !== "object" || item === null || !Array.isArray(item) && Object.getPrototypeOf(item) !== Object.prototype && Object.getPrototypeOf(item) !== null) throw new TypeError("Python host messages must contain data only");
|
|
47
|
-
if (Array.isArray(item)
|
|
51
|
+
if (Array.isArray(item)) checkMessageLimit(item.length);
|
|
48
52
|
if (ancestors.has(item)) throw new TypeError("Python host messages must not contain cycles");
|
|
49
53
|
ancestors.add(item);
|
|
50
54
|
estimatedBytes += 2;
|
|
@@ -52,7 +56,7 @@ function createPythonHostBridge(capabilities, options) {
|
|
|
52
56
|
for (const key in item) {
|
|
53
57
|
if (!Object.hasOwn(item, key)) continue;
|
|
54
58
|
estimatedBytes += 2;
|
|
55
|
-
|
|
59
|
+
checkMessageLimit(estimatedBytes);
|
|
56
60
|
if (Array.isArray(item) && key === "length") continue;
|
|
57
61
|
if (typeof key !== "string") throw new TypeError("Python host messages must contain data only");
|
|
58
62
|
const descriptor = Object.getOwnPropertyDescriptor(item, key);
|
|
@@ -64,7 +68,7 @@ function createPythonHostBridge(capabilities, options) {
|
|
|
64
68
|
};
|
|
65
69
|
inspect(value, 0);
|
|
66
70
|
const encoded = JSON.stringify(value);
|
|
67
|
-
|
|
71
|
+
checkMessageLimit(new TextEncoder().encode(encoded).length);
|
|
68
72
|
return JSON.parse(encoded);
|
|
69
73
|
};
|
|
70
74
|
const assertLive = () => {
|
|
@@ -101,7 +105,7 @@ function createPythonHostBridge(capabilities, options) {
|
|
|
101
105
|
if (chunkBytes > maxStreamBytes - stream.bytes) throw new RangeError("Python host stream byte limit exceeded");
|
|
102
106
|
stream.bytes += chunkBytes;
|
|
103
107
|
const value = result.value instanceof Uint8Array ? (() => {
|
|
104
|
-
|
|
108
|
+
checkMessageLimit(result.value.length, maxMessageBytes / 4);
|
|
105
109
|
return { type: "bytes", bytes: Array.from(result.value) };
|
|
106
110
|
})() : typeof result.value === "string" ? { type: "text", text: result.value } : { type: "data", value: result.value };
|
|
107
111
|
return data({ done: false, value });
|
|
@@ -91,6 +91,7 @@ async function openCommandFile(context, path, options) {
|
|
|
91
91
|
signal?.throwIfAborted();
|
|
92
92
|
};
|
|
93
93
|
let defaultFsOptions;
|
|
94
|
+
const callerOptions = /* @__PURE__ */ new WeakMap();
|
|
94
95
|
const run = (syscall, forwarded, action) => {
|
|
95
96
|
const signal = forwarded.signal;
|
|
96
97
|
try {
|
|
@@ -101,7 +102,15 @@ async function openCommandFile(context, path, options) {
|
|
|
101
102
|
}
|
|
102
103
|
const operation = work.then(async () => {
|
|
103
104
|
check(signal);
|
|
104
|
-
|
|
105
|
+
let supplied = defaultFsOptions;
|
|
106
|
+
if (signal && signal !== scope) {
|
|
107
|
+
const cached = callerOptions.get(signal);
|
|
108
|
+
if (cached) supplied = cached;
|
|
109
|
+
else {
|
|
110
|
+
supplied = { signal: AbortSignal.any([scope, signal]) };
|
|
111
|
+
callerOptions.set(signal, supplied);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
105
114
|
try {
|
|
106
115
|
const result = await action(descriptor, supplied);
|
|
107
116
|
if (syscall !== "write" || !context.preserveWriteReceipt) check(signal);
|
|
@@ -60,7 +60,7 @@ async function* autodetected(source, signal, limits) {
|
|
|
60
60
|
if (next.value.length) yield next.value;
|
|
61
61
|
}
|
|
62
62
|
})();
|
|
63
|
-
const format = size >= 2 && prefix[0] === 31 && prefix[1] === 139 ? "gzip" : size >= 3 && prefix[0] === 66 && prefix[1] === 90 && prefix[2] === 104 ? "bzip2" : size === 6 && [253, 55, 122, 88, 90, 0].every((byte, index) => prefix[index] === byte) ? "xz" : void 0;
|
|
63
|
+
const format = size >= 2 && prefix[0] === 31 && prefix[1] === 139 ? "gzip" : size >= 3 && prefix[0] === 66 && prefix[1] === 90 && prefix[2] === 104 ? "bzip2" : size >= 4 && prefix[0] === 40 && prefix[1] === 181 && prefix[2] === 47 && prefix[3] === 253 ? "zstd" : size === 6 && [253, 55, 122, 88, 90, 0].every((byte, index) => prefix[index] === byte) ? "xz" : void 0;
|
|
64
64
|
yield* format ? compressed(replay, true, signal, limits, format) : replay;
|
|
65
65
|
} finally {
|
|
66
66
|
if (iterator.return) await iterator.return(void 0);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createArchive,
|
|
3
3
|
manifest
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-MBXNG6C3.js";
|
|
5
5
|
import {
|
|
6
6
|
readArchive
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-SG2KOOD4.js";
|
|
8
8
|
import {
|
|
9
9
|
quoteName
|
|
10
10
|
} from "./chunk-PYIG32ZI.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
autodetected,
|
|
14
14
|
compressed,
|
|
15
15
|
recordPadding
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-43NDRBKY.js";
|
|
17
17
|
|
|
18
18
|
// packages/safe-bash-command-tar/src/modes.ts
|
|
19
19
|
import { dirname, retainFileSystemCleanup } from "@poe-platform/safe-fs/core";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
outputOperation,
|
|
4
4
|
preflight,
|
|
5
5
|
publish
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4SLPM2WM.js";
|
|
7
7
|
import {
|
|
8
8
|
Scanner
|
|
9
9
|
} from "./chunk-DSX7SPN5.js";
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
checkedAdd,
|
|
19
19
|
inferDelimiter,
|
|
20
20
|
unsigned
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-R6GON4H3.js";
|
|
22
22
|
import {
|
|
23
23
|
boundedSort
|
|
24
24
|
} from "./chunk-6ZMUR3LT.js";
|
|
@@ -142,7 +142,7 @@ async function aggregates(text, header, args, budget) {
|
|
|
142
142
|
const begin = at;
|
|
143
143
|
while (at < text.length && text[at] !== "(") at++;
|
|
144
144
|
const name = text.slice(begin, at).trim().toLowerCase();
|
|
145
|
-
if (!["count", "sum", "mean", "avg", "min", "max", "first", "last"].includes(name) || at === text.length) throw new XanError("expected an aggregate call");
|
|
145
|
+
if (!["count", "sum", "mean", "avg", "min", "max", "median", "first", "last"].includes(name) || at === text.length) throw new XanError("expected an aggregate call");
|
|
146
146
|
const start = ++at;
|
|
147
147
|
let quote = "";
|
|
148
148
|
while (at < text.length) {
|
|
@@ -262,7 +262,7 @@ async function* extendedRows(args, scope, budget, writer) {
|
|
|
262
262
|
const bytes = row.cells[index].decoded.view();
|
|
263
263
|
budget.hold(bytes.length);
|
|
264
264
|
return bytes.slice();
|
|
265
|
-
}), states: specs.map(() => ({ count: 0, sum: 0, min: Infinity, max: -Infinity })) };
|
|
265
|
+
}), states: specs.map(() => ({ count: 0, sum: 0, min: Infinity, max: -Infinity, values: [] })) };
|
|
266
266
|
};
|
|
267
267
|
if (args.command === "agg") groups.set("", make());
|
|
268
268
|
yield* textRow([...selected.map((index) => args.noHeaders ? String(index) : header.cells[index].decoded.view()), ...specs.map((spec) => spec.label)], writer, budget);
|
|
@@ -303,6 +303,10 @@ async function* extendedRows(args, scope, budget, writer) {
|
|
|
303
303
|
state.sum += value;
|
|
304
304
|
state.min = Math.min(state.min, value);
|
|
305
305
|
state.max = Math.max(state.max, value);
|
|
306
|
+
if (spec.name === "median") {
|
|
307
|
+
budget.hold(8);
|
|
308
|
+
state.values.push(value);
|
|
309
|
+
}
|
|
306
310
|
}
|
|
307
311
|
}
|
|
308
312
|
} finally {
|
|
@@ -316,6 +320,11 @@ async function* extendedRows(args, scope, budget, writer) {
|
|
|
316
320
|
if (spec.name === "count") return String(state.count);
|
|
317
321
|
if (spec.name === "sum") return String(state.sum);
|
|
318
322
|
if (!state.count) return "";
|
|
323
|
+
if (spec.name === "median") {
|
|
324
|
+
const sorted = [...state.values].sort((a, b) => a - b);
|
|
325
|
+
const mid = Math.floor(sorted.length / 2);
|
|
326
|
+
return String(sorted.length % 2 === 1 ? sorted[mid] : (sorted[mid - 1] + sorted[mid]) / 2);
|
|
327
|
+
}
|
|
319
328
|
return String(spec.name === "min" ? state.min : spec.name === "max" ? state.max : state.sum / state.count);
|
|
320
329
|
})], writer, budget);
|
|
321
330
|
return;
|
|
@@ -571,16 +580,30 @@ async function expressions(text, header, noHeaders, budget) {
|
|
|
571
580
|
} else {
|
|
572
581
|
const name = identifier();
|
|
573
582
|
if (!name) throw new XanError("expected expression");
|
|
574
|
-
|
|
575
|
-
if (
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
583
|
+
space();
|
|
584
|
+
if (text[offset] === "(") {
|
|
585
|
+
offset++;
|
|
586
|
+
const inner = parse(0, depth + 1);
|
|
587
|
+
space();
|
|
588
|
+
if (text[offset++] !== ")") throw new XanError("expected closing parenthesis");
|
|
589
|
+
const fnName = name.toLowerCase();
|
|
590
|
+
if (fnName === "upper") left = (row) => String(inner(row)).toUpperCase();
|
|
591
|
+
else if (fnName === "lower") left = (row) => String(inner(row)).toLowerCase();
|
|
592
|
+
else if (fnName === "trim") left = (row) => String(inner(row)).trim();
|
|
593
|
+
else if (fnName === "len") left = (row) => String(inner(row)).length;
|
|
594
|
+
else throw new XanError(`unknown expression column: ${name}`);
|
|
595
|
+
} else {
|
|
596
|
+
let column = -1;
|
|
597
|
+
if (!noHeaders) for (let i = 0; i < (header?.width ?? 0); i++) {
|
|
598
|
+
budget.work();
|
|
599
|
+
if (cellText(header.cells[i].decoded.view(), budget) === name) {
|
|
600
|
+
column = i;
|
|
601
|
+
break;
|
|
602
|
+
}
|
|
580
603
|
}
|
|
604
|
+
if (column < 0) throw new XanError(`unknown expression column: ${name}`);
|
|
605
|
+
left = (row) => cellText(row.cells[column].decoded.view(), budget);
|
|
581
606
|
}
|
|
582
|
-
if (column < 0) throw new XanError(`unknown expression column: ${name}`);
|
|
583
|
-
left = (row) => cellText(row.cells[column].decoded.view(), budget);
|
|
584
607
|
}
|
|
585
608
|
let chainDepth = depth;
|
|
586
609
|
while (true) {
|
|
@@ -634,7 +657,7 @@ async function presentationRows(args, scope, budget, writer) {
|
|
|
634
657
|
const table = args.command === "table";
|
|
635
658
|
const source = args.command === "map" ? args.operand : args.evaluateFile ? await scope.expression(args.selection) : args.selection;
|
|
636
659
|
const projections = table ? [] : await expressions(source, first, args.noHeaders, budget);
|
|
637
|
-
if (args.command === "map" && projections.length !== 1) throw new XanError("map requires one expression");
|
|
660
|
+
if (args.command === "map" && args.rightSelection !== "__INLINE_MULTI__" && projections.length !== 1) throw new XanError("map requires one expression");
|
|
638
661
|
budget.hold((first?.width ?? 0) * 32);
|
|
639
662
|
const selected = table ? await resolveSelection(await parseSelection(args.selection, budget), first?.cells.map((cell) => cell.decoded.view()) ?? [], args.noHeaders, budget) : [];
|
|
640
663
|
const lines = [], widths = selected.map(() => 0);
|
|
@@ -647,7 +670,10 @@ async function presentationRows(args, scope, budget, writer) {
|
|
|
647
670
|
return (async function* () {
|
|
648
671
|
try {
|
|
649
672
|
if (!table && !args.noHeaders) {
|
|
650
|
-
yield* textRow(args.command === "map" ? [
|
|
673
|
+
yield* textRow(args.command === "map" ? [
|
|
674
|
+
...first?.cells.map((cell) => cell.decoded.view()) ?? [],
|
|
675
|
+
...args.rightSelection === "__INLINE_MULTI__" ? projections.map((p) => p.name) : [args.rightSelection]
|
|
676
|
+
] : projections.map((projection) => projection.name), writer, budget);
|
|
651
677
|
first?.free();
|
|
652
678
|
row = await scanner.next();
|
|
653
679
|
}
|
|
@@ -166,7 +166,7 @@ async function executePlaywrightAbility(ability, parsed, invocation, context) {
|
|
|
166
166
|
if (bytes.byteLength > context.maxArtifactBytes) throw new PlaywrightResourceLimitError("Artifact byte limit exceeded");
|
|
167
167
|
if (filename !== void 0) filenameCheck(filename);
|
|
168
168
|
if (!invocation.writeArtifact) throw new Error("Artifact byte destination unsupported");
|
|
169
|
-
budget.admit(bytes.byteLength);
|
|
169
|
+
(context.artifactBudget ?? budget).admit(bytes.byteLength);
|
|
170
170
|
const owned = new Uint8Array(bytes);
|
|
171
171
|
return track(async () => {
|
|
172
172
|
context.check();
|
|
@@ -334090,16 +334090,18 @@ function materializeTrackSamples(track) {
|
|
|
334090
334090
|
for (let i = 0; i < track.decodedVideoFrames.length; i++) {
|
|
334091
334091
|
const frame = track.decodedVideoFrames[i];
|
|
334092
334092
|
const duration = Math.max(1, Math.round(frame.durationSeconds * timescale));
|
|
334093
|
+
const pts = Math.round(frame.ptsSeconds * timescale);
|
|
334093
334094
|
const encoded = encodeH264IdrFrame(frame.data, width, height, i, refBuffer);
|
|
334094
334095
|
detachBytesBuffer(frame.data);
|
|
334095
334096
|
samples.push({
|
|
334096
334097
|
data: encoded,
|
|
334097
334098
|
dts,
|
|
334098
|
-
pts
|
|
334099
|
-
cts:
|
|
334099
|
+
pts,
|
|
334100
|
+
cts: pts - dts,
|
|
334100
334101
|
duration,
|
|
334101
334102
|
size: encoded.byteLength,
|
|
334102
|
-
|
|
334103
|
+
// The encoder emits one length-prefixed NAL unit, including predicted pictures.
|
|
334104
|
+
isKeyframe: (encoded[4] & 31) === 5,
|
|
334103
334105
|
sampleDescriptionIndex: 1
|
|
334104
334106
|
});
|
|
334105
334107
|
dts += duration;
|
|
@@ -337907,22 +337909,30 @@ function extractVideoFramesFromDoc(doc, maxFrames) {
|
|
|
337907
337909
|
}
|
|
337908
337910
|
const width = vTrack.width ?? vTrack.codecDescriptions[0]?.width ?? 64;
|
|
337909
337911
|
const height = vTrack.height ?? vTrack.codecDescriptions[0]?.height ?? 64;
|
|
337910
|
-
if (vTrack.decodedVideoFrames && vTrack.decodedVideoFrames.length > 0) {
|
|
337911
|
-
const dur = vTrack.decodedVideoFrames[0].durationSeconds || 0.1;
|
|
337912
|
-
return {
|
|
337913
|
-
frames: [...vTrack.decodedVideoFrames],
|
|
337914
|
-
width,
|
|
337915
|
-
height,
|
|
337916
|
-
fps: Math.max(1, Math.round(1 / dur))
|
|
337917
|
-
};
|
|
337918
|
-
}
|
|
337919
337912
|
const ts = vTrack.timescale || 9e4;
|
|
337920
337913
|
const frames = [];
|
|
337921
|
-
|
|
337922
|
-
|
|
337914
|
+
const edits = vTrack.editList?.length ? vTrack.editList : void 0;
|
|
337915
|
+
let presentationStart = 0;
|
|
337916
|
+
for (const edit of edits ?? [void 0]) {
|
|
337917
|
+
const duration = edit ? edit.segmentDuration / doc.timescale : Infinity;
|
|
337918
|
+
if (edit && edit.mediaTime < 0) {
|
|
337919
|
+
presentationStart += duration;
|
|
337920
|
+
continue;
|
|
337921
|
+
}
|
|
337922
|
+
const mediaStart = edit ? edit.mediaTime / ts : -Infinity;
|
|
337923
|
+
const mediaEnd = edit ? mediaStart + duration : Infinity;
|
|
337924
|
+
const decoded = vTrack.decodedVideoFrames?.length ? vTrack.decodedVideoFrames : decodeH264Samples(vTrack.samples, vTrack.codecDescriptions, width, height, ts);
|
|
337925
|
+
for (const frame of decoded) {
|
|
337926
|
+
const start = Math.max(Math.round(frame.ptsSeconds * ts) / ts, mediaStart);
|
|
337927
|
+
const end = Math.min(Math.round((frame.ptsSeconds + frame.durationSeconds) * ts) / ts, mediaEnd);
|
|
337928
|
+
if (end <= start) continue;
|
|
337929
|
+
frames.push(edit ? { ...frame, ptsSeconds: presentationStart + start - mediaStart, durationSeconds: end - start } : frame);
|
|
337930
|
+
if (maxFrames !== void 0 && frames.length >= maxFrames) break;
|
|
337931
|
+
}
|
|
337923
337932
|
if (maxFrames !== void 0 && frames.length >= maxFrames) break;
|
|
337933
|
+
presentationStart += duration;
|
|
337924
337934
|
}
|
|
337925
|
-
const fps = frames.length > 0
|
|
337935
|
+
const fps = frames.length > 0 ? Math.max(1, Math.round(1 / (frames[0].durationSeconds || 0.1))) : 30;
|
|
337926
337936
|
return { frames, width, height, fps };
|
|
337927
337937
|
}
|
|
337928
337938
|
function isY4mSignature(bytes) {
|
|
@@ -338304,8 +338314,7 @@ function serializeWav(doc) {
|
|
|
338304
338314
|
} else if (audioTrack && audioTrack.samples.length > 0 && audioTrack.codecDescriptions[0]?.codecName.startsWith("pcm_")) {
|
|
338305
338315
|
pcmBytes = concatBytes(audioTrack.samples.map((s) => s.data));
|
|
338306
338316
|
} else {
|
|
338307
|
-
|
|
338308
|
-
pcmBytes = new Uint8Array(numSamples * channels * 2);
|
|
338317
|
+
throw new Error("WAV encoding requires decoded PCM audio");
|
|
338309
338318
|
}
|
|
338310
338319
|
const writer = new BinaryWriter(44 + pcmBytes.byteLength);
|
|
338311
338320
|
writer.writeFourCC("RIFF");
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PythonTextEncodingError,
|
|
3
3
|
PythonUtf16Decoder
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WRO3PB2M.js";
|
|
5
5
|
import {
|
|
6
6
|
PythonTextDecodeError,
|
|
7
7
|
decodePythonSingleByte,
|
|
8
8
|
pythonSingleByteCodepages
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-IGXH5W5Z.js";
|
|
10
10
|
import {
|
|
11
11
|
normalizeEncoding,
|
|
12
12
|
pythonCodecAliases
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-VSNVYOK2.js";
|
|
14
14
|
import {
|
|
15
15
|
pythonFileCodepages
|
|
16
16
|
} from "./chunk-TGSNVLFZ.js";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
probeOggStreamMetadata,
|
|
13
13
|
scanMp4Frames,
|
|
14
14
|
scanMp4Packets
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-BXOBM4HJ.js";
|
|
16
16
|
|
|
17
17
|
// packages/safe-bash-command-ffprobe/src/probe-text.ts
|
|
18
18
|
import { yieldTurn } from "../../safe-bash-contracts/yield.js";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-52DDLGBS.js";
|
|
4
4
|
import {
|
|
5
5
|
boundedCodec
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-IHQZKUBS.js";
|
|
7
7
|
|
|
8
8
|
// packages/safe-bash-compression-engine/src/zstd-decode.ts
|
|
9
9
|
import { PublicDiagnostic } from "../../safe-bash-contracts/diagnostics.js";
|