@poe-platform/safe-bash 0.1.825 → 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-AVSINNZ6.js → chunk-DEQ47SBQ.js} +5 -5
- 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-LFTGMUAV.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-IGXH5W5Z.js +111 -0
- 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-HNEWGADJ.js → chunk-RUXOFW5G.js} +7 -6
- 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-TGSNVLFZ.js +105 -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-XSZNL3GV.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-OLXMWQJ5.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 +6 -6
- package/dist/safe-bash-csv-engine/python-codec-aliases.js +1 -1
- package/dist/safe-bash-csv-engine/python-codepages.js +3 -3
- package/dist/safe-bash-csv-engine/python-file-codepages.js +2 -2
- package/dist/safe-bash-csv-engine/python-utf16.js +4 -4
- package/dist/safe-bash-csv-engine/text-decoder.js +6 -6
- 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-OOYVZAWL.js +0 -90
- package/dist/safe-bash/command-chunks/chunk-RZOHZGEZ.js +0 -772
- package/dist/safe-bash/command-chunks/chunk-WIUEM7HP.js +0 -58
- package/dist/safe-bash/command-chunks/chunk-WY6THI6J.js +0 -673
- package/dist/safe-bash/command-chunks/chunk-ZERCTWUI.js +0 -467
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
} from "./chunk-4D27OCWG.js";
|
|
4
4
|
import {
|
|
5
5
|
AwkRuntime
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-K5VJ4NNL.js";
|
|
7
7
|
import {
|
|
8
8
|
AwkParser,
|
|
9
9
|
builtinArities,
|
|
10
10
|
decodeString
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-2L3NMRLG.js";
|
|
12
12
|
import {
|
|
13
13
|
AwkInspection
|
|
14
14
|
} from "./chunk-DDYPQAXN.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pythonRepr
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UIHPHIKI.js";
|
|
4
4
|
import {
|
|
5
5
|
chatOptionSuggestion,
|
|
6
6
|
chatOptions,
|
|
@@ -10,13 +10,14 @@ import {
|
|
|
10
10
|
loadLlmHelp,
|
|
11
11
|
publishConfiguration,
|
|
12
12
|
unicodeOrder
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-5CAXR62E.js";
|
|
14
14
|
import {
|
|
15
15
|
createLlmSpool,
|
|
16
|
+
decodeUnicodeRanges,
|
|
16
17
|
fileSource,
|
|
17
18
|
isPythonWhitespace,
|
|
18
19
|
stripPythonWhitespace
|
|
19
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-VOR6YDZC.js";
|
|
20
21
|
import {
|
|
21
22
|
createLlmService,
|
|
22
23
|
validateModelOptions
|
|
@@ -356,6 +357,22 @@ import { yieldTurn as yieldTurn4 } from "../../safe-bash-contracts/yield.js";
|
|
|
356
357
|
import { shellValueByteLength } from "../../safe-bash-contracts/index.js";
|
|
357
358
|
import { inheritYieldCheckpoint as inheritYieldCheckpoint2, yieldTurn as yieldTurn3 } from "../../safe-bash-contracts/yield.js";
|
|
358
359
|
|
|
360
|
+
// packages/safe-bash-command-llm/src/loader-provider.ts
|
|
361
|
+
var LlmLoaderLookupError = class extends Error {
|
|
362
|
+
};
|
|
363
|
+
var LlmPluginExit = class extends Error {
|
|
364
|
+
constructor(exitCode) {
|
|
365
|
+
super();
|
|
366
|
+
this.exitCode = exitCode;
|
|
367
|
+
}
|
|
368
|
+
exitCode;
|
|
369
|
+
};
|
|
370
|
+
async function discoverLlmLoaders(loaders, context, provider) {
|
|
371
|
+
if (!provider) return loaders ?? /* @__PURE__ */ new Map();
|
|
372
|
+
const result = await waitForSource(() => provider.discover(context), context.signal);
|
|
373
|
+
return new Map([...result[context.kind === "fragments" ? "fragmentLoaders" : "templateLoaders"], ...loaders ?? []]);
|
|
374
|
+
}
|
|
375
|
+
|
|
359
376
|
// packages/safe-bash-command-llm/src/tool-execution.ts
|
|
360
377
|
import { inheritYieldCheckpoint, yieldTurn as yieldTurn2 } from "../../safe-bash-contracts/yield.js";
|
|
361
378
|
var LlmCancelToolCall = class extends Error {
|
|
@@ -491,6 +508,7 @@ async function executeLlmToolCalls(options, visit) {
|
|
|
491
508
|
throw new TypeError("Invalid tool output source");
|
|
492
509
|
} catch (error) {
|
|
493
510
|
signal.throwIfAborted();
|
|
511
|
+
if (error instanceof LlmPluginExit) throw error;
|
|
494
512
|
exception = error;
|
|
495
513
|
output = { output: "Error: " + (error instanceof Error ? error.message : String(error)) };
|
|
496
514
|
}
|
|
@@ -879,7 +897,7 @@ async function* promptToolChain(options) {
|
|
|
879
897
|
const write = options.debugWrite;
|
|
880
898
|
diagnostics = diagnostics.then(async () => {
|
|
881
899
|
signal.throwIfAborted();
|
|
882
|
-
const { debugToolResult } = await import("./prompt-tool-debug-
|
|
900
|
+
const { debugToolResult } = await import("./prompt-tool-debug-G7ATE7D5.js");
|
|
883
901
|
await debugToolResult({ context: { ...context, signal }, result, output: content.spool, attachments, write });
|
|
884
902
|
});
|
|
885
903
|
await diagnostics;
|
|
@@ -1002,15 +1020,6 @@ function selectLlmTools(registry, names) {
|
|
|
1002
1020
|
return names.map((name) => registry.get(name));
|
|
1003
1021
|
}
|
|
1004
1022
|
|
|
1005
|
-
// packages/safe-bash-command-llm/src/loader-provider.ts
|
|
1006
|
-
var LlmLoaderLookupError = class extends Error {
|
|
1007
|
-
};
|
|
1008
|
-
async function discoverLlmLoaders(loaders, context, provider) {
|
|
1009
|
-
if (!provider) return loaders ?? /* @__PURE__ */ new Map();
|
|
1010
|
-
const result = await waitForSource(() => provider.discover(context), context.signal);
|
|
1011
|
-
return new Map([...result[context.kind === "fragments" ? "fragmentLoaders" : "templateLoaders"], ...loaders ?? []]);
|
|
1012
|
-
}
|
|
1013
|
-
|
|
1014
1023
|
// packages/safe-bash-command-llm/src/loader-description.ts
|
|
1015
1024
|
function formatLoaderDescription(value) {
|
|
1016
1025
|
const lines = (value || "Undocumented").split("\n");
|
|
@@ -1064,6 +1073,7 @@ async function toolsCommand(tokens, registry, output, diagnostic, step, signal,
|
|
|
1064
1073
|
toolboxes = [...loaded.toolboxes ?? []].sort((left, right) => unicodeOrder(left.name, right.name));
|
|
1065
1074
|
selected = new Map(names.length ? [...loaded.tools, ...selectLlmTools(registry, load ? names.filter((name) => registry.has(name)) : names)].map((tool) => [tool.name, tool]) : [...registry, ...loaded.tools.map((tool) => [tool.registryKey ?? tool.name, tool])]);
|
|
1066
1075
|
} catch (failure) {
|
|
1076
|
+
if (failure instanceof LlmPluginExit) throw failure;
|
|
1067
1077
|
await diagnostic("Error: " + (failure instanceof Error ? failure.message : String(failure)) + "\n");
|
|
1068
1078
|
return 1;
|
|
1069
1079
|
}
|
|
@@ -1169,7 +1179,7 @@ async function* loadLlmPluginFragments(reference, loaders, context, allowAttachm
|
|
|
1169
1179
|
}
|
|
1170
1180
|
} catch (error) {
|
|
1171
1181
|
signal.throwIfAborted();
|
|
1172
|
-
if (error instanceof LlmLoaderLookupError) throw error;
|
|
1182
|
+
if (error instanceof LlmLoaderLookupError || error instanceof LlmPluginExit) throw error;
|
|
1173
1183
|
throw new Error(`Could not load fragment ${reference}: ${error instanceof Error ? error.message : String(error)}`);
|
|
1174
1184
|
} finally {
|
|
1175
1185
|
if (iterator && !ended) {
|
|
@@ -1804,7 +1814,7 @@ For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/St
|
|
|
1804
1814
|
return value;
|
|
1805
1815
|
} catch (error2) {
|
|
1806
1816
|
context.signal.throwIfAborted();
|
|
1807
|
-
if (error2 instanceof LlmLoaderLookupError) throw error2;
|
|
1817
|
+
if (error2 instanceof LlmLoaderLookupError || error2 instanceof LlmPluginExit) throw error2;
|
|
1808
1818
|
throw new Error(`Could not load template ${name}: ${error2 instanceof Error ? error2.message : String(error2)}`);
|
|
1809
1819
|
}
|
|
1810
1820
|
}
|
|
@@ -1940,13 +1950,9 @@ import { yieldTurn as yieldTurn9 } from "../../safe-bash-contracts/yield.js";
|
|
|
1940
1950
|
|
|
1941
1951
|
// packages/safe-bash-command-llm/src/word-ranges.ts
|
|
1942
1952
|
var wordRanges = /* @__PURE__ */ (() => {
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
const start = end + gap;
|
|
1947
|
-
end = start + length;
|
|
1948
|
-
return [start, end];
|
|
1949
|
-
});
|
|
1953
|
+
const values = decodeUnicodeRanges(0), ranges = [];
|
|
1954
|
+
for (let index = 0; index < values.length; index += 2) ranges.push([values[index], values[index + 1]]);
|
|
1955
|
+
return ranges;
|
|
1950
1956
|
})();
|
|
1951
1957
|
|
|
1952
1958
|
// packages/safe-bash-command-llm/src/extract-range.ts
|
|
@@ -2574,6 +2580,9 @@ async function interrupted(start, signal) {
|
|
|
2574
2580
|
);
|
|
2575
2581
|
});
|
|
2576
2582
|
}
|
|
2583
|
+
function commandError(error, fallback) {
|
|
2584
|
+
return error instanceof LlmPluginExit ? error : new Error(`Error: ${error instanceof Error ? error.message : fallback ?? String(error)}`);
|
|
2585
|
+
}
|
|
2577
2586
|
async function execute(context, service, limits, templateLoaderOptions, collections, fragmentLoaders, tools, loadTools, managePackages) {
|
|
2578
2587
|
context.signal.throwIfAborted();
|
|
2579
2588
|
const controller = new AbortController();
|
|
@@ -2733,7 +2742,7 @@ async function execute(context, service, limits, templateLoaderOptions, collecti
|
|
|
2733
2742
|
return { exitCode: 0 };
|
|
2734
2743
|
}
|
|
2735
2744
|
if (argumentsValue.args[0] === "install" || argumentsValue.args[0] === "uninstall") {
|
|
2736
|
-
const args2 =
|
|
2745
|
+
const args2 = argumentsValue.args.map((_, index) => argumentText(index));
|
|
2737
2746
|
if (!managePackages) {
|
|
2738
2747
|
await writeDiagnostic2(context.stderr, "Error: Python package management is not configured\n", signal);
|
|
2739
2748
|
return { exitCode: 1 };
|
|
@@ -2817,18 +2826,16 @@ async function execute(context, service, limits, templateLoaderOptions, collecti
|
|
|
2817
2826
|
return { exitCode: await embeddingModelsCommand({ ...context, signal }, service, tokens, emitText, (text) => writeDiagnostic2(context.stderr, text, signal), step, limits?.maxConfigurationBytes) };
|
|
2818
2827
|
}
|
|
2819
2828
|
if (argumentsValue.args[0] === "templates") {
|
|
2820
|
-
let exitCode = 0;
|
|
2821
2829
|
try {
|
|
2822
|
-
exitCode
|
|
2830
|
+
return { exitCode: await createLlmTemplateStore(loaderContext(), invocationLoaders).command(Array.from({ length: argumentsValue.args.length - 1 }, (_, index) => argumentText(index + 1)), emitText, (text) => writeDiagnostic2(context.stderr, text, signal)) };
|
|
2823
2831
|
} catch (error) {
|
|
2824
|
-
throw
|
|
2832
|
+
throw commandError(error, "Template failed");
|
|
2825
2833
|
}
|
|
2826
|
-
return { exitCode };
|
|
2827
2834
|
}
|
|
2828
2835
|
const configurationInvocation = argumentsValue.args[0] === "keys" || argumentsValue.args[0] === "aliases" || argumentsValue.args[0] === "models" && ["default", "options"].includes(argumentsValue.args[1] ?? "");
|
|
2829
2836
|
if (configurationInvocation) {
|
|
2830
2837
|
try {
|
|
2831
|
-
const tokens =
|
|
2838
|
+
const tokens = argumentsValue.args.map((_, index) => argumentText(index));
|
|
2832
2839
|
return { exitCode: await configurationCommand({ ...context, signal }, service, tokens, emitText, (text) => writeDiagnostic2(context.stderr, text, signal), admitInput, limits?.maxConfigurationBytes, step) };
|
|
2833
2840
|
} catch (error) {
|
|
2834
2841
|
throw new Error(`Error: ${error instanceof Error ? error.message : "Configuration failed"}`);
|
|
@@ -2866,7 +2873,7 @@ async function execute(context, service, limits, templateLoaderOptions, collecti
|
|
|
2866
2873
|
try {
|
|
2867
2874
|
stored = args.template === void 0 ? void 0 : await templateStore.load(args.template);
|
|
2868
2875
|
} catch (error) {
|
|
2869
|
-
throw
|
|
2876
|
+
throw commandError(error, "Invalid template");
|
|
2870
2877
|
}
|
|
2871
2878
|
if (stored) {
|
|
2872
2879
|
if (!isChat && stored.schema_object) schema = stored.schema_object;
|
|
@@ -2945,7 +2952,7 @@ Error: Got unexpected extra argument (${args.prompt})`);
|
|
|
2945
2952
|
}
|
|
2946
2953
|
}
|
|
2947
2954
|
} catch (error) {
|
|
2948
|
-
throw
|
|
2955
|
+
throw commandError(error);
|
|
2949
2956
|
}
|
|
2950
2957
|
return selectedTools2;
|
|
2951
2958
|
};
|
|
@@ -3049,7 +3056,7 @@ Error: Got unexpected extra argument (${args.prompt})`);
|
|
|
3049
3056
|
}
|
|
3050
3057
|
} catch (error) {
|
|
3051
3058
|
signal.throwIfAborted();
|
|
3052
|
-
throw
|
|
3059
|
+
throw commandError(error);
|
|
3053
3060
|
}
|
|
3054
3061
|
continue;
|
|
3055
3062
|
}
|
|
@@ -3424,7 +3431,7 @@ ${args.prompt}` : evaluated.prompt;
|
|
|
3424
3431
|
} catch (error) {
|
|
3425
3432
|
signal.throwIfAborted();
|
|
3426
3433
|
if (outputFailed) throw error;
|
|
3427
|
-
throw
|
|
3434
|
+
throw commandError(error);
|
|
3428
3435
|
}
|
|
3429
3436
|
})()[Symbol.asyncIterator]();
|
|
3430
3437
|
} else if (streamed) {
|
|
@@ -3500,7 +3507,8 @@ ${args.prompt}` : evaluated.prompt;
|
|
|
3500
3507
|
controller.abort(error);
|
|
3501
3508
|
if (outputFailed) throw error;
|
|
3502
3509
|
await operation.close();
|
|
3503
|
-
|
|
3510
|
+
if (error instanceof LlmPluginExit) return { exitCode: error.exitCode };
|
|
3511
|
+
await writeDiagnostic2(context.stderr, `${error instanceof Error ? error.message : "llm provider failed"}
|
|
3504
3512
|
`, context.signal);
|
|
3505
3513
|
return { exitCode: error instanceof LlmModelsUsageError || error instanceof LlmPromptUsageError ? 2 : 1 };
|
|
3506
3514
|
} finally {
|
|
@@ -3540,6 +3548,7 @@ function llmCommands(options = {}) {
|
|
|
3540
3548
|
export {
|
|
3541
3549
|
serializeLlmTokenUsage,
|
|
3542
3550
|
LlmLoaderLookupError,
|
|
3551
|
+
LlmPluginExit,
|
|
3543
3552
|
createLlmToolRegistry,
|
|
3544
3553
|
selectLlmTools,
|
|
3545
3554
|
LlmCancelToolCall,
|
|
@@ -166,7 +166,17 @@ async function parseArguments(args, cwd, budget) {
|
|
|
166
166
|
let operand;
|
|
167
167
|
if (command === "map") {
|
|
168
168
|
operand = operands.shift();
|
|
169
|
-
|
|
169
|
+
const inlineAs = operand?.match(/^(.*)\s+[aA][sS]\s+([A-Za-z_][A-Za-z0-9_]*)$/s);
|
|
170
|
+
if (inlineAs && (operands.length === 0 || operands.length === 1 && (operands[0] === "-" || operands[0].includes("/") || /\.(csv|tsv|txt)$/iu.test(operands[0])))) {
|
|
171
|
+
if (operand.includes(",")) {
|
|
172
|
+
rightSelection = "__INLINE_MULTI__";
|
|
173
|
+
} else {
|
|
174
|
+
operand = inlineAs[1].trim();
|
|
175
|
+
rightSelection = inlineAs[2];
|
|
176
|
+
}
|
|
177
|
+
} else {
|
|
178
|
+
rightSelection = operands.shift();
|
|
179
|
+
}
|
|
170
180
|
if ((!operand || !rightSelection) && !help) throw new XanError("map requires an expression and a new column name");
|
|
171
181
|
}
|
|
172
182
|
if (command === "groupby") rightSelection = operands.shift();
|
|
@@ -86,8 +86,8 @@ async function parseOptions(context, limits) {
|
|
|
86
86
|
if (flag === "c" || flag === "t" || flag === "x" || flag === "r" || flag === "u" || flag === "d" || flag === "delete" || flag === "A") {
|
|
87
87
|
if (mode) fail("exactly one tar operation is required (-c, -t, -x, -r, -u, -d, --delete, -A)");
|
|
88
88
|
mode = flag;
|
|
89
|
-
} else if (flag === "z" || flag === "j" || flag === "J") {
|
|
90
|
-
const selected = flag === "z" ? "gzip" : flag === "j" ? "bzip2" : "xz";
|
|
89
|
+
} else if (flag === "z" || flag === "j" || flag === "J" || flag === "zstd") {
|
|
90
|
+
const selected = flag === "z" ? "gzip" : flag === "j" ? "bzip2" : flag === "J" ? "xz" : "zstd";
|
|
91
91
|
if (compression && compression !== selected) fail("conflicting compression options");
|
|
92
92
|
compression = selected;
|
|
93
93
|
} else if (flag === "a") autoCompress = true;
|
|
@@ -241,7 +241,7 @@ async function parseOptions(context, limits) {
|
|
|
241
241
|
if (mode === "c" && !operands.length && !filesFrom) fail("refusing to create an empty archive without -T");
|
|
242
242
|
if (archive !== "-") checkPath(archive, limits);
|
|
243
243
|
if (mode === "c" && autoCompress) {
|
|
244
|
-
compression = archive.endsWith(".gz") || archive.endsWith(".tgz") ? "gzip" : archive.endsWith(".bz2") || archive.endsWith(".tbz2") || archive.endsWith(".tbz") ? "bzip2" : archive.endsWith(".xz") || archive.endsWith(".txz") ? "xz" : void 0;
|
|
244
|
+
compression = archive.endsWith(".gz") || archive.endsWith(".tgz") ? "gzip" : archive.endsWith(".bz2") || archive.endsWith(".tbz2") || archive.endsWith(".tbz") ? "bzip2" : archive.endsWith(".xz") || archive.endsWith(".txz") ? "xz" : archive.endsWith(".zst") || archive.endsWith(".tzst") ? "zstd" : void 0;
|
|
245
245
|
}
|
|
246
246
|
return { mode, archive, ...compression ? { compression } : {}, verbose, toStdout, utc, recordSize, ignoreZeros, totals, quotingStyle, showTransformedNames, transforms, strip, format, cwd, operands, excludes, sort, dereference, excludeCaches, recursion, wildcards, ...occurrence !== void 0 ? { occurrence } : {}, metadata, overwrite };
|
|
247
247
|
}
|
|
@@ -26,12 +26,13 @@ function encodeBase64Latin1(bytes) {
|
|
|
26
26
|
}
|
|
27
27
|
return out;
|
|
28
28
|
}
|
|
29
|
-
function unpackCodepage(encoded) {
|
|
30
|
-
const bytes = decodeBase64Latin1(encoded)
|
|
31
|
-
const values = Array.from({ length:
|
|
32
|
-
for (let i = 0; i < bytes.length;
|
|
33
|
-
const point = bytes.charCodeAt(i) | bytes.charCodeAt(i
|
|
34
|
-
|
|
29
|
+
function unpackCodepage(encoded, base) {
|
|
30
|
+
const bytes = decodeBase64Latin1(encoded);
|
|
31
|
+
const values = base ? [...base] : Array.from({ length: 256 }, (_, byte) => byte);
|
|
32
|
+
for (let i = 0; i < bytes.length; ) {
|
|
33
|
+
const start = bytes.charCodeAt(i++), point = bytes.charCodeAt(i++) | bytes.charCodeAt(i++) << 8;
|
|
34
|
+
const length = bytes.charCodeAt(i) === start ? (i++, bytes.charCodeAt(i++) + 1) : 1;
|
|
35
|
+
for (let offset = 0; offset < length; offset++) values[start + offset] = point === 65535 ? -1 : point + offset;
|
|
35
36
|
}
|
|
36
37
|
return Object.freeze(values);
|
|
37
38
|
}
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-PYIG32ZI.js";
|
|
4
4
|
import {
|
|
5
5
|
Exclusions
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-R7ZGDHME.js";
|
|
7
7
|
import {
|
|
8
8
|
Reader
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-43NDRBKY.js";
|
|
10
10
|
import {
|
|
11
11
|
TransformedNames
|
|
12
12
|
} from "./chunk-LSYPQ2W5.js";
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isPythonWhitespace
|
|
3
|
+
} from "./chunk-VOR6YDZC.js";
|
|
4
|
+
|
|
5
|
+
// packages/safe-bash-command-llm/src/indent-text.ts
|
|
6
|
+
import { yieldTurn } from "../../safe-bash-contracts/yield.js";
|
|
7
|
+
async function* decodeLlmText(source, signal) {
|
|
8
|
+
const decoder = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true });
|
|
9
|
+
let steps = 0;
|
|
10
|
+
for await (const bytes of source) {
|
|
11
|
+
if (++steps % 256 === 0) await yieldTurn(signal);
|
|
12
|
+
signal.throwIfAborted();
|
|
13
|
+
for (let offset = 0; offset < bytes.length; offset += 2048) {
|
|
14
|
+
if (++steps % 256 === 0) await yieldTurn(signal);
|
|
15
|
+
signal.throwIfAborted();
|
|
16
|
+
yield decoder.decode(bytes.subarray(offset, offset + 2048), { stream: true });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
yield decoder.decode();
|
|
20
|
+
}
|
|
21
|
+
async function* indentLlmText(source, signal) {
|
|
22
|
+
const replay = decodeLlmText(source, signal)[Symbol.asyncIterator]();
|
|
23
|
+
let pending = "", offset = 0;
|
|
24
|
+
async function* line(length2, nonblank2) {
|
|
25
|
+
if (nonblank2) yield " ";
|
|
26
|
+
while (length2) {
|
|
27
|
+
if (offset === pending.length) {
|
|
28
|
+
const next = await replay.next();
|
|
29
|
+
if (next.done) throw new Error("Stored content changed");
|
|
30
|
+
pending = next.value;
|
|
31
|
+
offset = 0;
|
|
32
|
+
if (!pending.length) continue;
|
|
33
|
+
}
|
|
34
|
+
const count = Math.min(length2, pending.length - offset);
|
|
35
|
+
yield pending.slice(offset, offset + count);
|
|
36
|
+
offset += count;
|
|
37
|
+
length2 -= count;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
let length = 0, nonblank = false;
|
|
41
|
+
try {
|
|
42
|
+
for await (const chunk of decodeLlmText(source, signal)) for (const char of chunk) {
|
|
43
|
+
length += char.length;
|
|
44
|
+
if (!isPythonWhitespace(char)) nonblank = true;
|
|
45
|
+
if (["\n", "\r", "\v", "\f", "", "", "", "\x85", "\u2028", "\u2029"].includes(char)) {
|
|
46
|
+
yield* line(length, nonblank);
|
|
47
|
+
length = 0;
|
|
48
|
+
nonblank = false;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (length) yield* line(length, nonblank);
|
|
52
|
+
} finally {
|
|
53
|
+
await replay.return?.();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export {
|
|
58
|
+
decodeLlmText,
|
|
59
|
+
indentLlmText
|
|
60
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import {
|
|
2
|
+
unpackCodepage
|
|
3
|
+
} from "./chunk-RUXOFW5G.js";
|
|
4
|
+
|
|
5
|
+
// packages/safe-bash-csv-engine/src/python-file-codepages.ts
|
|
6
|
+
var table0 = unpackCodepage("oQEOoTnb///bA98/Dt8c/P///AM=");
|
|
7
|
+
var table1 = unpackCodepage("oP//", table0);
|
|
8
|
+
var table2 = unpackCodepage("oQEEoQuuDgSuQfAWIfFRBPEL/acA/l4E/gE=");
|
|
9
|
+
var table3 = unpackCodepage("0B4B3TAB3l4B8B8B/TEB/l8B");
|
|
10
|
+
var table4 = unpackCodepage("pKwgpmABqGEBtH0BuH4BvFIBvAG+eAE=");
|
|
11
|
+
var table5 = unpackCodepage("of//qtcAuvcAv///vx/fFyDg0AXgGvv///sB/Q4g/QH///8=");
|
|
12
|
+
var table6 = unpackCodepage("oRggoQGkrCClryCqegOu//+vFSC0hAO0AriIA7gCvIwDvo4DvhPTowPTKw==", table5);
|
|
13
|
+
var table7 = unpackCodepage("of//oQKl//+lBqwMBq7//64MuxsGvP//vAK/HwbA///BIQbBGdv//9sE4EAG4BLz///zDA==");
|
|
14
|
+
var table8 = unpackCodepage("gKwgghogg5IBhB4ghSYghiAghgGIxgKJMCCKYAGLOSCMUgGNZiaOYyaPZSaQYCaRGCCRAZMcIJMBlSIglhMglgGY3AKZIiGaYQGcUwGfeAE=");
|
|
15
|
+
var table9 = unpackCodepage("gf//iv//jf//jQOa//+bOiCd//+dAcMCAcwAA9AQAdIJA9WgAd2vAd4DA+MDAewBA/ARAfIjA/WhAf2wAf6rIA==", table8);
|
|
16
|
+
var table10 = unpackCodepage("oQIeoQGkCgGkAaYKHqiAHqqCHqsLHqzyHq94AbAeHrABsiABsgG0QB60AbdWHriBHrlXHrqDHrtgHrzzHr2EHr0Bv2Ee0HQB12oe3nYB8HUB92se/ncB");
|
|
17
|
+
var table11 = unpackCodepage("oQQBoQGjQQGlHiCqGAKseQGuegGuAbIMAbNCAbUdILkNAboZAr98AcMCAcUGAdAQAdFDAdVQAddaAdhwAd0YAd4aAuMDAeUHAfARAfFEAfVRAfdbAfhxAf0ZAf4bAg==", table4);
|
|
18
|
+
var table12 = unpackCodepage("gAIEgAGDUwSIrCCKCQSMCgSNmgSOugSPDwSQUgSY//+aWQScWgSdmwSeuwSfXwShsAShAaPYBKXoBKgBBKqSBK+uBLIGBLNWBLTpBLhRBLkWIbqTBLzZBL2iBL0Bv68EwBAEwD8=", table9);
|
|
19
|
+
var table13 = unpackCodepage("oSYBotgCpf//piQBqTABql4Bqx4BrDQBrv//r3sBsScBtiUBuTEBul8Bux8BvDUBvv//v3wBw///xQoBxggB0P//1SAB2BwB3WwB3lwB4///5QsB5gkB8P//9SEB+B0B/W0B/l0B/9kC");
|
|
20
|
+
var table14 = unpackCodepage("gJYEgZIEgu4Eg5MEhrYEh64EiLIEia8EiqAEi+IEjKIEj7gEkJcEmLMEmbcEmqEEm+MEnKMEn7kEoQ4Eol4EowgEpOgEpZgEprAEqtgEre8Er5wEsbEEtJkEtekEutkEvFgEvaoEvQG/nQQ=", table12);
|
|
21
|
+
var table15 = unpackCodepage("oQQBohIBoyIBpCoBpSgBpjYBqDsBqRABqmABq2YBrH0BrmoBr0oBsQUBshMBsyMBtCsBtSkBtjcBuDwBuREBumEBu2cBvH4BvRUgvmsBv0sBwAABxy4ByAwByhgBzBYB0UUB0kwB12gB2XIB4AEB5y8B6A0B6hkB7BcB8UYB8k0B92kB+XMB/zgB");
|
|
22
|
+
var table16 = unpackCodepage("ojgBo1YBpKQApjsBqKgAqWABqhIBqyIBrGYBrn0Br68AstsCs1cBtLQAtjwBt8cCuLgAuWEBuhMBuyMBvGcBvUoBvn4BzyoB0BAB0zYB19cA3WgB3moB7ysB8BEB8zcB9/cA/WkB/msB/9kC", table15);
|
|
23
|
+
var table17 = unpackCodepage("otgCo0EBpT0BploBql4Bq2QBrHkBr3sBs0IBtT4BtlsBul8Bu2UBvHoBvd0Cv3wBwFQBwwIBxTkBxgYBx8cAzBoBzw4B0UMB0kcB09MA1VAB2FgB2W4B23AB3d0A3mIB4FUB4wMB5ToB5gcB5+cA7BsB7w8B8UQB8kgB8/MA9VEB+FkB+W8B+3EB/f0A/mMB", table16);
|
|
24
|
+
var table18 = unpackCodepage("gMQAgaAAgscAg8kAhNEAhdYAhtwAh+EAiOAAieIAiuQAi7oGjKsAjecAjukAj+gAkOoAkAGS7QCTJiCU7gCUAZbxAJfzAJi7AJn0AJr2AJoBnPoAnfkAnvsAngGgIACgBKVqBqYmAKYFrS0ArQKwYAawCbo6ALw8ALwCwEon21sA2wTzfgb0eQb1hgb21Qb3pAb4rwb5iAb6kQb7ewD7Av6YBv/SBg==", table7);
|
|
25
|
+
var table19 = unpackCodepage("sPAGsAk=", table18);
|
|
26
|
+
var table20 = unpackCodepage("gBAEgC+wkSWwArMCJbQkJbVhJbUBt1YluFUluWMlulElu1clvF0lvVwlvlslvxAlwBQlwTQlwiwlwxwlxAAlxTwlxl4lxgHIWiXJVCXKaSXLZiXMYCXNUCXObCXPZyXPAdFkJdEB01kl1Fgl1VIl1QHXayXYaiXZGCXaDCXbiCXchCXdjCXekCXfgCXwAQTykATyAfQEBPVUBPYGBPdWBPgHBPlXBPq3APsaIvwWIf2kAP6gJf+gAA==", table2);
|
|
27
|
+
var table21 = unpackCodepage("gIAAgAGC6QCD4gCEhACF4ACGhgCH5wCI6gCIAYroAIvvAIzuAI2NAI0DkVEGkQGT9ACUpACVQAaW+wCX+QCYIQaYA5yjAJ0lBp0QrqsAr7sA4DYG4ATlQQbmtQDnQgbnCPBhIvFLBvEF90gi+LAA+Rki/H8g/bIA", table20);
|
|
28
|
+
var table22 = unpackCodepage("gNAFgBqb//+d//+e1wCf//+fCamuAKqsAKu9AKy8AK3//7X//7UCuKkAvaIAvqUAxv//xgHPpADQ///QCN2mAN7//+D//+AF5///5wburwDvtADwrQDxsQDyFyDzvgD0tgD1pwD29wD3uAD5qAD7uQD8swA=", table21);
|
|
29
|
+
var table23 = unpackCodepage("gNAFgBqbogCdpQCepyCfkgGg4QCh7QCi8wCj+gCk8QCl0QCmqgCnugCovwCpECOqrACrvQCsvACtoQDgsQPh3wDikwPjwAPkowPlwwPnxAPopgPpmAPqqQPrtAPsHiLtxgPutQPvKSLxsQDyZSLzZCL0ICP0Afb3AA==", table21);
|
|
30
|
+
var table24 = unpackCodepage("gP//gAWGhgOH//+ItwCJrACKpgCLGCCLAY2IA44VII+JA48BkaoDkowDk///kwGVjgOWqwOXqQCYjwOZsgCZAZusA52tA50CoMoDoZADoswDogGkkQOkBqyYA6wBtZoDtQO9ngO9AcagA8YBz6MDzwbWsQPWAt20A90B4LYD4AvswwPtwgPuxAPvhAPyxQPyAvbIA/eFA/rJA/vLA/ywA/3OAw==", table22);
|
|
31
|
+
var table25 = unpackCodepage("oR0gpR4gqNgAqlYBr8YAtBwguPgAulcBv+YAwAQBwS4BwgABwwYBxhgBxxIByAwBynkByxYBzCIBzTYBzioBzzsB0GAB0UMB0kUB1EwB2HIB2UEB2loB22oB3XsB3n0B4AUB4S8B4gEB4wcB5hkB5xMB6A0B6noB6xcB7CMB7TcB7isB7zwB8GEB8UQB8kYB9E0B+HMB+UIB+lsB+2sB/XwB/n4B/xkg");
|
|
32
|
+
var table26 = unpackCodepage("gKwggf//ghogg///hB4ghSYghiAghgGI//+JMCCK//+LOSCM//+NqACOxwKPuACQ//+RGCCRAZMcIJMBlSIglhMglgGY//+ZIiGa//+bOiCc//+drwCe2wKf//+h//+l//+0tAD/2QI=", table25);
|
|
33
|
+
var table27 = unpackCodepage("gMcAgfwAgukAg+IAhOQAheAAhuUAh+cAiOoAiAGK6ACL7wCM7gCN7ACOxACOAZDJAJHmAJLGAJP0AJT2AJXyAJb7AJf5AJj/AJnWAJrcAJv4AJ3YAJ+SAaDhAKHtAKLzAKP6AKTxAKXRAKaqAKe6AKi/AK2hALXBALUBt8AAxuMAx8MA0PAA0dAA0soA0gHUyADVrCDWzQDWAt7MAODTAOHfAOLUAOPSAOT1AOXVAOf+AOjeAOnaAOkB69kA7P0A7d0A", table22);
|
|
34
|
+
var table28 = unpackCodepage("gAYBgwEBhSMBhwcBiEIBiRMBilYBigGMKwGNeQGTTQGVIgGWogCXWgGXAZ+kAKAAAaEqAaN7AaMBpXoBph0gp6YAqKkArUEBtQQBtgwBtxgBuBYBvS4BvmABxnIBx2oBz30B0AUB0Q0B0hkB0xcB1C8B1WEB1nMB12sB2H4B3Ywl3pAl4kwB40MB50QB6DYB6AHqOwHqAexGAe0SAe5FAe8ZIPIcIPceIPkZIg==", table27);
|
|
35
|
+
var table29 = unpackCodepage("gJsEgZMEg5IEirMEjLIEjbcEjrYEj///kJoEnf//nQGg//+h7wSi7gSjUQSl4wSo//+oAq///7MBBLT//7XiBLj//7kWIbr//7z//7wCv6kAwE4EwTAEwQHDRgTENATEAcZEBMczBMhFBMk4BMkH0U8E0kAE0gPWNgTXMgTYTATZSwTaNwTbSATcTQTdSQTeRwTfSgTgLgThEAThAeMmBOQUBOQB5iQE5xME6CUE6RgE6QfxLwTyIATyA/YWBPcSBPgsBPkrBPoXBPsoBPwtBP0pBP4nBP8qBA==", table26);
|
|
36
|
+
var table30 = unpackCodepage("gAAlgQIlggwlgxAlhBQlhRglhhwlhyQliCwliTQlijwli4AljIQljYgljowlj5AljwOTICOUoCWVGSKVAZdIIphkIpgBmqAAmyEjnLAAnbIAnrcAn/cAoFAloAKkUyWkDrRiJbQK", table29);
|
|
37
|
+
var table31 = unpackCodepage("pFQEplYEpgGtkQS0BAS2BgS2Ab2QBA==", table30);
|
|
38
|
+
var table32 = unpackCodepage("ofAGoQmrDAasGwauHwavgf6wjf6wAbKO/rIBtJH+tVb7tlj7t5P+uJX+uZf+umb7u2j7vJn+vZv+vp3+v5/+wHr7wXz7wqH+w6P+xKX+xaf+xqn+x4T7yKv+ya3+yoz7y6/+zIr7zbH+zrP+z7X+0Lf+0bn+0rv+073+1L/+1cH+1sX+18n+1wjg0/7h1f7i1/7j2f7k2/7lkvvmlPvn3f7o3/7oAuvj/uye++3l/u7n/u+F/vDt/vGm+/Ko+/IC9YD+9on+9gL58f75Avyw+/2u+/58/v4B");
|
|
39
|
+
var table33 = unpackCodepage("gcUAi+MAjOUAk+wAmPIAm/UAoCAgobAAoqIAogGkpwClIiCmtgCn3wCorgCpqQCqIiGrtACsqACtYCKuxgCv2ACwHiKxsQCyZCKyAbSlALW1ALYCIrcRIrgPIrnAA7orIruqALy6AL2pA77mAL/4AMC/AMGhAMKsAMMaIsSSAcVIIsYGIserAMi7AMkmIMqgAMvAAMzDAM3VAM5SAc4B0BMg0AHSHCDSAdQYINQB1vcA18ol2P8A2XgB2h4B2gHcMAHcAd5eAd4B4CEg4bcA4hog4x4g5DAg5cIA5soA58EA6MsA6cgA6s0A6gLtzADu0wDuAfD/+PHSAPLaAPIB9NkA9aD49sYC99wC+K8A+dgC+QL8uAD93QL+2wL/xwI=", table18);
|
|
40
|
+
var table34 = unpackCodepage("oN0A2kQg26wg3NAA3fAA3t4A3/4A4P0A9TEB", table33);
|
|
41
|
+
var table35 = unpackCodepage("oCAgrgIBrxgCvgMBvxkC3Dkg3AHeGgLeAeAhIA==", table34);
|
|
42
|
+
var table36 = unpackCodepage("oCAgqWABrn0BtAYiuWEBvn4BxgYByAwB0BAB2P/42akA3Dkg3AHexgDfuwDgEyDmBwHoDQHwEQH5wAP6ywD9ygD+5gA=", table34);
|
|
43
|
+
var table37 = unpackCodepage("ocAAosIAo8gApMoApAGmzgCmAai0AKnLAqrGAquoAKzcAq3ZAK7bAK+kILCvALHdALL9ALOwALTHALXnALbRALfxALihALm/ALqkALujALylAL2nAL6SAb+iAMDiAMHqAML0AMP7AMThAMXpAMbzAMf6AMjgAMnoAMryAMv5AMzkAM3rAM72AM/8ANDFANHuANLYANPGANTlANXtANb4ANfmANjEANnsANrWANvcANzJAN3vAN7fAN/UAODBAOHDAOLjAOPQAOTwAOXNAObMAOfTAOjSAOnVAOr1AOtgAesB7doA7ngB7/8A8N4A8f4A8rcA87UA8wH1vgD2FCD3vAD3AfmqAPq6APurAPygJf27AP6xAA==", table0);
|
|
44
|
+
var table38 = unpackCodepage("gFIEgQIEglMEgwMEhFEEhQEEhlQEhwQEiFUEiQUEilYEiwYEjFcEjQcEjlgEjwgEkFkEkQkEkloEkwoElFsElQsEllwElwwEmF4EmQ4Eml8Emw8EnE4EnS4EnkoEnyoEoDAEoRAEojEEoxEEpEYEpSYEpjQEpxQEqDUEqRUEqkQEqyQErDMErRMEtUUEtiUEtzgEuBgEvTkEvhkExjoExxoE0DsE0RsE0jwE0xwE1D0E1R0E1j4E1x4E2D8E3R8E3k8E4C8E4UAE4iAE40EE5CEE5UIE5iIE50ME6CME6TYE6hYE6zIE7BIE7UwE7iwE7xYh8UsE8isE8zcE9BcE9UgE9igE900E+C0E+UkE+ikE+0cE/CcE/acA", table22);
|
|
45
|
+
var table39 = unpackCodepage("JWoGgLAAgbcAghkiggGEkiWFACWGAiWHPCWIJCWJLCWKHCWLNCWMECWNDCWOFCWPGCWQsgORHiKSxgOTsQCUvQCVvACWSCKXqwCYuwCZ9/6ZAZv//5sBnfv+nQGf//+hrQCigv6jowClhP6ojv6oAaqV/quZ/q2d/q6h/q+l/rBgBrAJutH+vLH+vbX+vrn+wKIAwYD+wQHDg/7Ehf7Fyv7Gi/7Hjf7Ikf7Jk/7Kl/7Lm/7Mn/7No/7Op/7Pqf7Qq/7Rrf7Sr/7Ts/7Ut/7Vu/7Wv/7Xwf7Yxf7Zy/7az/7bpgDcrADd9wDe1wDfyf7h0/7i1/7j2/7k3/7l4/7m5/7n6/7o7f7p7/7q8/7rvf7szP7tzv7uzf7v4f7wff7y5f7z6f707P718P728v730P741f759f75Afvd/vzZ/v3x/v6gJQ==", table7);
|
|
46
|
+
var table40 = unpackCodepage("BJwABQkABoYAB38ACJcACY0ACQEUnQAVhQAWCAAXhwAakgAbjwAggAAgBCUKACYXACcbACiIACgELQUALQIwkAAwATIWADOTADMDNwQAOJgAOAM8FAA8AT6eAD8aAEAgAEHQBUEISqIASy4ATDwATSgATisAT3wAUCYAUdkFUQhaIQBbJABcKgBdKQBeOwBfrABgLQBhLwBi4gViB2qmAGssAGwlAG1fAG4+AG4BcP//ceoFcv//cgF0oAB1//91AngXIHlgAHo6AHsjAHxAAH0nAH49AH8iAID//4FhAIEIiqsAi7sAjP//jAKPsQCQsACRagCRCJr//5oCnbgAnv//n6QAoLUAoX4AonMAogeq//+qBK+uALBeALGjALKlALO3ALSpALWnALe8ALcCulsAu10AvK8AvagAvrQAv9cAwHsAwUEAwQjKrQDQfQDRSgDRCNq5AN///+BcAOH3AOJTAOIH6rIA6///6wTwMADwCfqzAP3///0B/58A", table5);
|
|
47
|
+
var table41 = unpackCodepage("QaAAQuIAQ+QAROAARAFG4wBH5QBI5wBJ8QBR6QBRAlToAFXtAFUCWOwAWd8AYsIAY8QAZMAAZAFmwwBnxQBoxwBp0QBw+ABxyQBxAnTIAHXNAHUCeMwAgNgAjPAAjf0AjQGaqgCbugCc5gCexgCqoQCrvwCs0ACt3QCtAcv0AMz2AM3yAM0Bz/UA2/sA2wHd+QDdAd//AOvUAOzWAO3SAO0B79UA+9sA+wH92QD9AQ==", table40);
|
|
48
|
+
var table42 = unpackCodepage("n6wg", table41);
|
|
49
|
+
var table43 = unpackCodepage("SlsATyEAWl0AX14AsKIAuqwAu3wA", table41);
|
|
50
|
+
var table44 = unpackCodepage("Q3sASsQAWX4AWtwAY1sAavYAfKcAod8AtUAAvD4gwOQAzKYA0PwA3H0A4NYA7FwA/F0A", table43);
|
|
51
|
+
var table45 = unpackCodepage("SHsASscAWh4BWzABaFsAal8BeTEBe9YAfF4Bf9wAjH0AjWAAjqYAofYArF0ArSQArkAAwOcAzH4A0B8B3FwA4PwA7CMA/CIA", table43);
|
|
52
|
+
var table46 = unpackCodepage("QZEDQQhRmgNRB1mjA2KkA2IHanwAcKgAcYYDcogDcgF0oAB1igN2jAN3jgN3AYCFA4qxA4oFmrcDmgWgtACqvQOqBK/DA7CjALGsA7ECtMoDta8DtswDtgG4ywO5zgO6wgO7xAO7BMvJA8yQA82wA84YIM8VINqxANu9ANwaAN2HA94ZIN+mAOEaAOunAOwaAO0aAO6rAO4B+6kA/BoA/RoA/rsA", table43);
|
|
53
|
+
var pythonFileCodepages = Object.freeze({
|
|
54
|
+
"cp037": table41,
|
|
55
|
+
"cp1006": table32,
|
|
56
|
+
"cp1026": table45,
|
|
57
|
+
"cp1125": table20,
|
|
58
|
+
"cp1140": table42,
|
|
59
|
+
"cp1257": table26,
|
|
60
|
+
"cp1258": table9,
|
|
61
|
+
"cp273": table44,
|
|
62
|
+
"cp424": table40,
|
|
63
|
+
"cp500": table43,
|
|
64
|
+
"cp720": table21,
|
|
65
|
+
"cp775": table28,
|
|
66
|
+
"cp855": table38,
|
|
67
|
+
"cp856": table22,
|
|
68
|
+
"cp858": table27,
|
|
69
|
+
"cp862": table23,
|
|
70
|
+
"cp864": table39,
|
|
71
|
+
"cp869": table24,
|
|
72
|
+
"cp875": table46,
|
|
73
|
+
"hp-roman8": table37,
|
|
74
|
+
"iso8859-10": table15,
|
|
75
|
+
"iso8859-11": table0,
|
|
76
|
+
"iso8859-13": table25,
|
|
77
|
+
"iso8859-14": table10,
|
|
78
|
+
"iso8859-15": table4,
|
|
79
|
+
"iso8859-16": table11,
|
|
80
|
+
"iso8859-2": table17,
|
|
81
|
+
"iso8859-3": table13,
|
|
82
|
+
"iso8859-4": table16,
|
|
83
|
+
"iso8859-5": table2,
|
|
84
|
+
"iso8859-6": table7,
|
|
85
|
+
"iso8859-7": table6,
|
|
86
|
+
"iso8859-8": table5,
|
|
87
|
+
"iso8859-9": table3,
|
|
88
|
+
"koi8-r": table30,
|
|
89
|
+
"koi8-t": table29,
|
|
90
|
+
"koi8-u": table31,
|
|
91
|
+
"kz1048": table12,
|
|
92
|
+
"mac-arabic": table18,
|
|
93
|
+
"mac-croatian": table36,
|
|
94
|
+
"mac-farsi": table19,
|
|
95
|
+
"mac-iceland": table34,
|
|
96
|
+
"mac-romanian": table35,
|
|
97
|
+
"mac-turkish": table33,
|
|
98
|
+
"palmos": table8,
|
|
99
|
+
"ptcp154": table14,
|
|
100
|
+
"tis-620": table1
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
export {
|
|
104
|
+
pythonFileCodepages
|
|
105
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// packages/safe-bash-command-python/src/package-file.ts
|
|
2
|
+
import { bytesToHex } from "../../safe-bash-io-engine/byte-encoding.js";
|
|
2
3
|
import { yieldTurn } from "../../safe-bash-contracts/yield.js";
|
|
3
4
|
import { sha256 } from "@noble/hashes/sha2.js";
|
|
4
5
|
import { compareIdentity, compareFileVersion } from "@poe-platform/safe-fs/core";
|
|
@@ -35,7 +36,7 @@ async function openPythonPackageFile({ fs, signal }, path, maxBytes, expected) {
|
|
|
35
36
|
offset += bytes.length;
|
|
36
37
|
}
|
|
37
38
|
await check();
|
|
38
|
-
return { key:
|
|
39
|
+
return { key: bytesToHex(hash.digest()), size: state.size, read, close: () => file.close() };
|
|
39
40
|
} catch (error) {
|
|
40
41
|
await file.close();
|
|
41
42
|
throw error;
|