@poe-platform/safe-bash 0.1.826 → 0.1.827
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-AGHV53VF.js → chunk-M6XFU6LQ.js} +3 -1
- package/dist/safe-bash/chunks/{chunk-363QOIDR.js → chunk-T6FHWSHM.js} +3 -1
- package/dist/safe-bash/command-chunks/{chunk-ZPBL7TYJ.js → chunk-2JRHCVMQ.js} +1 -1
- 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-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-ZIDESNHW.js → chunk-7M3M6FKC.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-2KMNVJB7.js → chunk-A7PKUIJT.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-P66Q5F6K.js → chunk-DEQ47SBQ.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-EV7A5FNN.js → chunk-FFFRLPXU.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-4MVQE6CT.js → chunk-FYTBEGSY.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-VKTM2SOL.js → chunk-HQIZR6EU.js} +192 -489
- package/dist/safe-bash/command-chunks/chunk-HS2L7I4N.js +219 -0
- package/dist/safe-bash/command-chunks/{chunk-WKS2PAZL.js → chunk-HUGKO4ZE.js} +10 -1
- 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-L54KVUSY.js +604 -0
- package/dist/safe-bash/command-chunks/{chunk-3NJETNC2.js → chunk-MBXNG6C3.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-HCPEYQKT.js → chunk-N4SH6QY5.js} +285 -302
- 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-RQTFK7AV.js → chunk-QZYEI4N6.js} +1 -1
- 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-T4TGJYFV.js +60 -0
- package/dist/safe-bash/command-chunks/{chunk-NXCJNPL3.js → chunk-UCE77LYV.js} +2 -1
- package/dist/safe-bash/command-chunks/{chunk-EWECMOQ5.js → chunk-UIHPHIKI.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-T7RT2BNL.js → chunk-UJPWPRVB.js} +191 -146
- package/dist/safe-bash/command-chunks/{chunk-E5CDHXFA.js → chunk-VOR6YDZC.js} +26 -1
- package/dist/safe-bash/command-chunks/chunk-VSNVYOK2.js +30 -0
- package/dist/safe-bash/command-chunks/{chunk-4XYGJB24.js → chunk-VTH4AORO.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-W5LH7D23.js → chunk-WKKJJBJQ.js} +8 -8
- 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-K576GZED.js → chunk-XTHKXCF2.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-J3VS55K4.js → chunk-YHRESVJ7.js} +9 -3
- package/dist/safe-bash/command-chunks/{chunk-UWIDPTOB.js → chunk-YSCKOUQP.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-UYNJF5QN.js → chunk-ZALAWNOE.js} +76 -122
- package/dist/safe-bash/command-chunks/{chunk-OT75C5YS.js → chunk-ZYXKW2K7.js} +1 -1
- 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/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 +10 -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-gpg/index.js +11 -3
- package/dist/safe-bash-command-imagemagick/index.js +2 -2
- 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/package.json +2 -2
- 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
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import {
|
|
2
|
+
openPythonPackageFile
|
|
3
|
+
} from "./chunk-UCE77LYV.js";
|
|
4
|
+
|
|
5
|
+
// packages/safe-bash-command-python/src/record-reader.ts
|
|
6
|
+
function createPythonRecordReader(encode) {
|
|
7
|
+
let source, row;
|
|
8
|
+
let text = "", previous = "", position = 0, tail = Promise.resolve();
|
|
9
|
+
return {
|
|
10
|
+
read(nextRow, offset) {
|
|
11
|
+
const work = tail.then(async () => {
|
|
12
|
+
if (row === nextRow && offset === position - 1 && previous) {
|
|
13
|
+
text = previous + text;
|
|
14
|
+
position--;
|
|
15
|
+
}
|
|
16
|
+
if (row !== nextRow || offset < position) {
|
|
17
|
+
source = void 0;
|
|
18
|
+
position = 0;
|
|
19
|
+
text = previous = "";
|
|
20
|
+
row = nextRow;
|
|
21
|
+
}
|
|
22
|
+
source ??= encode(nextRow)[Symbol.asyncIterator]();
|
|
23
|
+
const decoder = new TextDecoder();
|
|
24
|
+
while (true) {
|
|
25
|
+
if (position < offset) {
|
|
26
|
+
const skip = Math.min(offset - position, text.length);
|
|
27
|
+
if (skip) previous = text[skip - 1];
|
|
28
|
+
text = text.slice(skip);
|
|
29
|
+
position += skip;
|
|
30
|
+
}
|
|
31
|
+
if (text.length >= 8192) break;
|
|
32
|
+
const next = await source.next();
|
|
33
|
+
if (next.done) break;
|
|
34
|
+
text += decoder.decode(next.value);
|
|
35
|
+
}
|
|
36
|
+
const result = text.slice(0, 8192);
|
|
37
|
+
previous = result.at(-1) ?? previous;
|
|
38
|
+
text = text.slice(result.length);
|
|
39
|
+
position += result.length;
|
|
40
|
+
return result;
|
|
41
|
+
});
|
|
42
|
+
tail = work.catch(() => {
|
|
43
|
+
});
|
|
44
|
+
return work;
|
|
45
|
+
},
|
|
46
|
+
async close() {
|
|
47
|
+
await tail;
|
|
48
|
+
source = void 0;
|
|
49
|
+
text = previous = "";
|
|
50
|
+
row = void 0;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// packages/safe-bash-command-python/src/manifest-backed.ts
|
|
56
|
+
import { openLlmJsonDocument } from "../../safe-bash-command-llm/index.js";
|
|
57
|
+
import { IntegerTable, PagedStorage } from "@poe-platform/safe-fs/storage";
|
|
58
|
+
async function readBackedPythonManifest(fs, directory, signal, input, collectInstalled = true) {
|
|
59
|
+
const document = await openLlmJsonDocument({ fs, directory, signal, maxFileBytes: Number.MAX_SAFE_INTEGER, maxOpenFiles: 1, profile: "javascript", maxControlBytes: Number.MAX_SAFE_INTEGER }, input);
|
|
60
|
+
const storage = new PagedStorage({ fs, cwd: directory, env: {}, signal }, 4), index = new IntegerTable(storage, 64);
|
|
61
|
+
const invalid = () => {
|
|
62
|
+
throw new Error("Invalid Python package environment manifest");
|
|
63
|
+
};
|
|
64
|
+
const close = async () => {
|
|
65
|
+
const results = await Promise.allSettled([document.close(), storage.close()]);
|
|
66
|
+
for (const result of results) if (result.status === "rejected") throw result.reason;
|
|
67
|
+
};
|
|
68
|
+
async function* children(node) {
|
|
69
|
+
for (let child = await document.child(node.id); child; child = await document.child(node.id, child.position)) yield child;
|
|
70
|
+
}
|
|
71
|
+
const string = async (node) => {
|
|
72
|
+
if (node.type !== "string") invalid();
|
|
73
|
+
let text = "";
|
|
74
|
+
for await (const chunk of document.text(node)) text += chunk;
|
|
75
|
+
return text;
|
|
76
|
+
};
|
|
77
|
+
let version = 0, records, installedNode = document.root, recordCount = -1;
|
|
78
|
+
try {
|
|
79
|
+
if (document.root.type !== "array") {
|
|
80
|
+
if (document.root.type !== "object") invalid();
|
|
81
|
+
let count = 0, found = false;
|
|
82
|
+
for await (const { node, key } of children(document.root)) {
|
|
83
|
+
count++;
|
|
84
|
+
if (key === "version") {
|
|
85
|
+
const value = Number(node.token);
|
|
86
|
+
if (node.type !== "number" || ![1, 2, 3].includes(value)) invalid();
|
|
87
|
+
version = value;
|
|
88
|
+
} else if (key === "installed") {
|
|
89
|
+
installedNode = node;
|
|
90
|
+
found = true;
|
|
91
|
+
} else if (key === "records") records = node;
|
|
92
|
+
else invalid();
|
|
93
|
+
}
|
|
94
|
+
if (!found || !version || count !== (version === 1 ? 2 : 3) || version !== 1 && !records) invalid();
|
|
95
|
+
}
|
|
96
|
+
if (installedNode.type !== "array") invalid();
|
|
97
|
+
const installed = [];
|
|
98
|
+
for await (const { node } of children(installedNode)) {
|
|
99
|
+
if (node.type !== "string") invalid();
|
|
100
|
+
if (collectInstalled) installed.push(await string(node));
|
|
101
|
+
}
|
|
102
|
+
if (records) {
|
|
103
|
+
if (records.type !== "array") invalid();
|
|
104
|
+
recordCount = 0;
|
|
105
|
+
let previous = -1;
|
|
106
|
+
for await (const entry of children(records)) {
|
|
107
|
+
const row = entry.node;
|
|
108
|
+
if (row.type !== "array") invalid();
|
|
109
|
+
let field = 0;
|
|
110
|
+
for await (const { node } of children(row)) {
|
|
111
|
+
if (field === 3 || field === 4) {
|
|
112
|
+
if (node.type !== "array") invalid();
|
|
113
|
+
for await (const { node: item } of children(node)) if (item.type !== "string") invalid();
|
|
114
|
+
} else if (node.type !== "string" && !(field === 5 && node.type === "null")) invalid();
|
|
115
|
+
field++;
|
|
116
|
+
}
|
|
117
|
+
if (field !== version + 3) invalid();
|
|
118
|
+
await index.set(BigInt(recordCount++), BigInt(previous + 1));
|
|
119
|
+
previous = entry.position;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
const encoder = new TextEncoder();
|
|
123
|
+
async function* json(node, legacy = false) {
|
|
124
|
+
if (!node || node.type === "null") {
|
|
125
|
+
yield "null";
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
if (node.type === "string") {
|
|
129
|
+
yield '"';
|
|
130
|
+
for await (const text of document.text(node)) for (let offset = 0; offset < text.length; offset += 1024) yield JSON.stringify(text.slice(offset, offset + 1024)).slice(1, -1);
|
|
131
|
+
yield '"';
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
yield "[";
|
|
135
|
+
let count = 0;
|
|
136
|
+
for await (const { node: item } of children(node)) {
|
|
137
|
+
if (count++) yield ",";
|
|
138
|
+
yield* json(item);
|
|
139
|
+
}
|
|
140
|
+
if (legacy) yield ",null";
|
|
141
|
+
yield "]";
|
|
142
|
+
}
|
|
143
|
+
const reader = createPythonRecordReader(async function* (key) {
|
|
144
|
+
const ordinal = Math.floor(key / 7), field = key % 7 - 1;
|
|
145
|
+
const previous = await index.get(BigInt(ordinal));
|
|
146
|
+
if (previous === void 0) invalid();
|
|
147
|
+
const entry = await document.child(records.id, Number(previous) - 1);
|
|
148
|
+
if (!entry) invalid();
|
|
149
|
+
let selected = entry.node;
|
|
150
|
+
if (field >= 0) {
|
|
151
|
+
selected = void 0;
|
|
152
|
+
let position = 0;
|
|
153
|
+
for await (const { node } of children(entry.node)) if (position++ === field) {
|
|
154
|
+
selected = node;
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
for await (const part of json(selected, field < 0 && version === 2)) yield encoder.encode(part);
|
|
159
|
+
});
|
|
160
|
+
const read = async (ordinal, offset, field = -1) => {
|
|
161
|
+
if (!Number.isSafeInteger(ordinal) || ordinal < 0 || ordinal >= recordCount || !Number.isSafeInteger(offset) || offset < 0 || !Number.isInteger(field) || field < -1 || field > 5) invalid();
|
|
162
|
+
return reader.read(ordinal * 7 + field + 1, offset);
|
|
163
|
+
};
|
|
164
|
+
return { installed, version, recordCount, readRecord: read, async readField(ordinal, field, offset) {
|
|
165
|
+
if (field < 0) invalid();
|
|
166
|
+
return read(ordinal, offset, field);
|
|
167
|
+
}, async close() {
|
|
168
|
+
try {
|
|
169
|
+
await reader.close();
|
|
170
|
+
} finally {
|
|
171
|
+
await close();
|
|
172
|
+
}
|
|
173
|
+
} };
|
|
174
|
+
} catch (error) {
|
|
175
|
+
await close();
|
|
176
|
+
throw error;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// packages/safe-bash-command-python/src/manifest-publication.ts
|
|
181
|
+
var pythonPublicationFile = "publication.json";
|
|
182
|
+
async function withPythonManifestPublication(context, maxBytes, publish) {
|
|
183
|
+
const { fs, signal, cwd } = context, path = cwd + "/" + pythonPublicationFile, stat = await fs.lstat(path, { signal });
|
|
184
|
+
if (stat.type !== "file") throw new Error("Invalid Python manifest publication file");
|
|
185
|
+
if (stat.size > maxBytes) throw new Error("Python package manifest exceeds maxManifestBytes");
|
|
186
|
+
const file = await openPythonPackageFile(context, path, maxBytes, stat);
|
|
187
|
+
if (!file) throw new Error("Python manifest publication requires retained caller reads");
|
|
188
|
+
let consumed = false;
|
|
189
|
+
async function* source() {
|
|
190
|
+
for (let offset = 0; offset < file.size; ) {
|
|
191
|
+
const bytes = await file.read(offset, 65536);
|
|
192
|
+
offset += bytes.length;
|
|
193
|
+
yield bytes;
|
|
194
|
+
}
|
|
195
|
+
consumed = true;
|
|
196
|
+
}
|
|
197
|
+
try {
|
|
198
|
+
const snapshot = await readBackedPythonManifest(fs, cwd, signal, source(), false);
|
|
199
|
+
try {
|
|
200
|
+
if (snapshot.version !== 3) throw new Error("Invalid Python manifest publication version");
|
|
201
|
+
} finally {
|
|
202
|
+
await snapshot.close();
|
|
203
|
+
}
|
|
204
|
+
consumed = false;
|
|
205
|
+
const committed = await publish(source());
|
|
206
|
+
signal.throwIfAborted();
|
|
207
|
+
if (committed && !consumed) throw new Error("Python manifest store returned before consuming its source");
|
|
208
|
+
return committed;
|
|
209
|
+
} finally {
|
|
210
|
+
await file.close();
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export {
|
|
215
|
+
createPythonRecordReader,
|
|
216
|
+
readBackedPythonManifest,
|
|
217
|
+
pythonPublicationFile,
|
|
218
|
+
withPythonManifestPublication
|
|
219
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
stringify
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-N4SH6QY5.js";
|
|
4
4
|
import {
|
|
5
5
|
JqError
|
|
6
6
|
} from "./chunk-3K5FCRUG.js";
|
|
@@ -53,6 +53,15 @@ async function formatValue(name, input, budget) {
|
|
|
53
53
|
}
|
|
54
54
|
break;
|
|
55
55
|
}
|
|
56
|
+
case "urid": {
|
|
57
|
+
if (typeof input !== "string") throw new JqError("urid requires a string");
|
|
58
|
+
try {
|
|
59
|
+
result = decodeURIComponent(input);
|
|
60
|
+
} catch {
|
|
61
|
+
throw new JqError("invalid uri string");
|
|
62
|
+
}
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
56
65
|
case "html": {
|
|
57
66
|
const escapes = { "&": "&", "<": "<", ">": ">", "'": "'", '"': """ };
|
|
58
67
|
result = "";
|