poe-code 17.0.33 → 17.0.34
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/{chunk-4SR3FG2F.js → chunk-EQAAKXQV.js} +2 -2
- package/dist/{chunk-NIIYLKZ6.js → chunk-LYH24BKM.js} +70 -9
- package/dist/chunk-LYH24BKM.js.map +7 -0
- package/dist/{chunk-EW55GBOF.js → chunk-S2NLSD2J.js} +2 -2
- package/dist/{core-2UUUWCLM.js → core-CRWO3R4F.js} +2 -2
- package/dist/index.js +2 -2
- package/dist/metafile.json +1 -1
- package/dist/{program-2FF4TQ2G.js → program-3H7FXQW5.js} +3 -3
- package/dist/safe-bash.js +2 -2
- package/dist/{src-LTWZPB3P.js → src-IES5F6JJ.js} +3 -3
- package/package.json +1 -1
- package/packages/safe-bash/dist/chunks/{chunk-4CEZRUSZ.js → chunk-AOT4SUBQ.js} +2 -2
- package/packages/safe-bash/dist/chunks/{chunk-MX6K5URO.js → chunk-FOMU56TU.js} +18 -2
- package/packages/safe-bash/dist/chunks/chunk-FOMU56TU.js.map +7 -0
- package/packages/safe-bash/dist/chunks/{chunk-UMCWCITQ.js → chunk-KLEL3WAN.js} +38 -3
- package/packages/safe-bash/dist/chunks/{chunk-UMCWCITQ.js.map → chunk-KLEL3WAN.js.map} +2 -2
- package/packages/safe-bash/dist/chunks/{chunk-UKO4AP3K.js → chunk-L4HKTYVE.js} +2 -2
- package/packages/safe-bash/dist/chunks/{chunk-RGSI3B5P.js → chunk-RYXT5BJJ.js} +2 -2
- package/packages/safe-bash/dist/chunks/{chunk-TZ53QA73.js → chunk-WSX5CLK2.js} +2 -2
- package/packages/safe-bash/dist/commands/basic.d.ts.map +1 -1
- package/packages/safe-bash/dist/commands/basic.js +9 -2
- package/packages/safe-bash/dist/commands/basic.js.map +1 -1
- package/packages/safe-bash/dist/commands/internal.d.ts +4 -1
- package/packages/safe-bash/dist/commands/internal.d.ts.map +1 -1
- package/packages/safe-bash/dist/commands/internal.js +45 -2
- package/packages/safe-bash/dist/commands/internal.js.map +1 -1
- package/packages/safe-bash/dist/commands/llm/index.browser.js +2 -2
- package/packages/safe-bash/dist/commands/network/index.browser.js +2 -2
- package/packages/safe-bash/dist/commands/node/index.browser.js +2 -2
- package/packages/safe-bash/dist/commands/structured/jq.d.ts.map +1 -1
- package/packages/safe-bash/dist/commands/structured/jq.js +8 -4
- package/packages/safe-bash/dist/commands/structured/jq.js.map +1 -1
- package/packages/safe-bash/dist/commands/structured/values.d.ts +1 -0
- package/packages/safe-bash/dist/commands/structured/values.d.ts.map +1 -1
- package/packages/safe-bash/dist/commands/structured/values.js +18 -1
- package/packages/safe-bash/dist/commands/structured/values.js.map +1 -1
- package/packages/safe-bash/dist/commands/xml/index.browser.js +2 -2
- package/packages/safe-bash/dist/commands/yq/index.browser.js +2 -2
- package/packages/safe-bash/dist/core.browser.js +24 -12
- package/packages/safe-bash/dist/core.browser.js.map +3 -3
- package/dist/chunk-NIIYLKZ6.js.map +0 -7
- package/packages/safe-bash/dist/chunks/chunk-MX6K5URO.js.map +0 -7
- /package/dist/{chunk-4SR3FG2F.js.map → chunk-EQAAKXQV.js.map} +0 -0
- /package/dist/{chunk-EW55GBOF.js.map → chunk-S2NLSD2J.js.map} +0 -0
- /package/dist/{core-2UUUWCLM.js.map → core-CRWO3R4F.js.map} +0 -0
- /package/dist/{program-2FF4TQ2G.js.map → program-3H7FXQW5.js.map} +0 -0
- /package/dist/{src-LTWZPB3P.js.map → src-IES5F6JJ.js.map} +0 -0
- /package/packages/safe-bash/dist/chunks/{chunk-4CEZRUSZ.js.map → chunk-AOT4SUBQ.js.map} +0 -0
- /package/packages/safe-bash/dist/chunks/{chunk-UKO4AP3K.js.map → chunk-L4HKTYVE.js.map} +0 -0
- /package/packages/safe-bash/dist/chunks/{chunk-RGSI3B5P.js.map → chunk-RYXT5BJJ.js.map} +0 -0
- /package/packages/safe-bash/dist/chunks/{chunk-TZ53QA73.js.map → chunk-WSX5CLK2.js.map} +0 -0
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
readBytes,
|
|
11
11
|
resolvePath,
|
|
12
12
|
writeFileOutput
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-LYH24BKM.js";
|
|
14
14
|
import {
|
|
15
15
|
getCommandArguments,
|
|
16
16
|
shellValueByteLength
|
|
@@ -81559,4 +81559,4 @@ export {
|
|
|
81559
81559
|
* dealings in these Data Files or Software without prior written
|
|
81560
81560
|
* authorization of the copyright holder.
|
|
81561
81561
|
*/
|
|
81562
|
-
//# sourceMappingURL=chunk-
|
|
81562
|
+
//# sourceMappingURL=chunk-EQAAKXQV.js.map
|
|
@@ -10952,7 +10952,8 @@ function replaceArgument(source2, pattern, replacement) {
|
|
|
10952
10952
|
chunks.push(source2.subarray(start));
|
|
10953
10953
|
return concatenate(chunks);
|
|
10954
10954
|
}
|
|
10955
|
-
function escapeBytes(text4, zeroOctal = false, bareOctal = false) {
|
|
10955
|
+
function escapeBytes(text4, zeroOctal = false, bareOctal = false, unicode) {
|
|
10956
|
+
if (unicode && typeof text4 === "string") text4 = encoder2.encode(text4);
|
|
10956
10957
|
if (typeof text4 === "string") {
|
|
10957
10958
|
const chunks = [];
|
|
10958
10959
|
const control2 = { a: 7, b: 8, e: 27, E: 27, f: 12, n: 10, r: 13, t: 9, v: 11, "\\": 92 };
|
|
@@ -10989,7 +10990,7 @@ function escapeBytes(text4, zeroOctal = false, bareOctal = false) {
|
|
|
10989
10990
|
return { bytes: concatenate(chunks), stop: false };
|
|
10990
10991
|
}
|
|
10991
10992
|
const source2 = text4;
|
|
10992
|
-
const bytes8 = new Uint8Array(source2.length);
|
|
10993
|
+
const bytes8 = new Uint8Array(source2.length * (unicode && !unicode.utf8 ? 3 : 1));
|
|
10993
10994
|
const control = { 97: 7, 98: 8, 101: 27, 69: 27, 102: 12, 110: 10, 114: 13, 116: 9, 118: 11, 92: 92 };
|
|
10994
10995
|
let size = 0;
|
|
10995
10996
|
for (let index = 0; index < source2.length; ) {
|
|
@@ -11013,6 +11014,40 @@ function escapeBytes(text4, zeroOctal = false, bareOctal = false) {
|
|
|
11013
11014
|
index = offset;
|
|
11014
11015
|
continue;
|
|
11015
11016
|
}
|
|
11017
|
+
if (unicode && (next === 117 || next === 85)) {
|
|
11018
|
+
const digits = next === 117 ? 4 : 8;
|
|
11019
|
+
let offset = index + 2;
|
|
11020
|
+
const end = Math.min(source2.length, offset + digits);
|
|
11021
|
+
let value2 = 0;
|
|
11022
|
+
while (offset < end) {
|
|
11023
|
+
const digit4 = source2[offset];
|
|
11024
|
+
const number8 = digit4 >= 48 && digit4 <= 57 ? digit4 - 48 : digit4 >= 65 && digit4 <= 70 ? digit4 - 55 : digit4 >= 97 && digit4 <= 102 ? digit4 - 87 : -1;
|
|
11025
|
+
if (number8 < 0) break;
|
|
11026
|
+
value2 = value2 * 16 + number8;
|
|
11027
|
+
offset++;
|
|
11028
|
+
}
|
|
11029
|
+
if (offset === index + 2) unicode.missingDigit(String.fromCharCode(next));
|
|
11030
|
+
else {
|
|
11031
|
+
if (value2 < 2147483648) {
|
|
11032
|
+
if (!unicode.utf8 && value2 > 127) {
|
|
11033
|
+
const literal = encoder2.encode(`\\${value2 <= 65535 ? "u" : "U"}${value2.toString(16).toUpperCase().padStart(value2 <= 65535 ? 4 : 8, "0")}`);
|
|
11034
|
+
bytes8.set(literal, size);
|
|
11035
|
+
size += literal.length;
|
|
11036
|
+
} else if (value2 < 128) bytes8[size++] = value2;
|
|
11037
|
+
else {
|
|
11038
|
+
const length2 = value2 < 2048 ? 2 : value2 < 65536 ? 3 : value2 < 2097152 ? 4 : value2 < 67108864 ? 5 : 6;
|
|
11039
|
+
for (let position = length2 - 1; position > 0; position--) {
|
|
11040
|
+
bytes8[size + position] = 128 | value2 & 63;
|
|
11041
|
+
value2 = Math.floor(value2 / 64);
|
|
11042
|
+
}
|
|
11043
|
+
bytes8[size] = 255 << 8 - length2 & 255 | value2;
|
|
11044
|
+
size += length2;
|
|
11045
|
+
}
|
|
11046
|
+
}
|
|
11047
|
+
index = offset;
|
|
11048
|
+
continue;
|
|
11049
|
+
}
|
|
11050
|
+
}
|
|
11016
11051
|
if (next === 120) {
|
|
11017
11052
|
let offset = index + 2;
|
|
11018
11053
|
const end = Math.min(source2.length, offset + 2);
|
|
@@ -11112,6 +11147,11 @@ async function formatPrintf(context2) {
|
|
|
11112
11147
|
let argument2 = 1;
|
|
11113
11148
|
let exitCode = 0;
|
|
11114
11149
|
let stopped = false;
|
|
11150
|
+
const locale = context2.env.LC_ALL || context2.env.LC_CTYPE || context2.env.LANG || "C.UTF-8";
|
|
11151
|
+
const unicodeErrors = [];
|
|
11152
|
+
const unicode = { utf8: locale !== "C" && locale !== "POSIX", missingDigit: (escape2) => {
|
|
11153
|
+
unicodeErrors.push(escape2);
|
|
11154
|
+
} };
|
|
11115
11155
|
do {
|
|
11116
11156
|
const before = argument2;
|
|
11117
11157
|
for (let offset = 0; offset < formatLength && !stopped; ) {
|
|
@@ -11119,7 +11159,9 @@ async function formatPrintf(context2) {
|
|
|
11119
11159
|
const end = rawFormat ? rawFormat.indexOf(37, offset) : format3.indexOf("%", offset);
|
|
11120
11160
|
const limit2 = end < 0 ? formatLength : end;
|
|
11121
11161
|
const literal = rawFormat ? rawFormat.subarray(offset, limit2) : format3.slice(offset, limit2);
|
|
11122
|
-
const escaped3 = escapeBytes(literal);
|
|
11162
|
+
const escaped3 = escapeBytes(literal, false, false, unicode);
|
|
11163
|
+
for (const escape2 of unicodeErrors.splice(0)) await writeDiagnostic(context2.stderr, `printf: missing unicode digit for \\${escape2}
|
|
11164
|
+
`, context2.signal);
|
|
11123
11165
|
await output(context2, escaped3.bytes);
|
|
11124
11166
|
stopped = escaped3.stop;
|
|
11125
11167
|
offset += literal.length;
|
|
@@ -11148,7 +11190,9 @@ async function formatPrintf(context2) {
|
|
|
11148
11190
|
if (specifier === "b" || specifier === "s") {
|
|
11149
11191
|
const suppliedValue = arguments_.values[suppliedIndex] ?? "";
|
|
11150
11192
|
const raw7 = specifier === "b" && typeof suppliedValue === "string" ? suppliedValue : arguments_.bytes(suppliedIndex) ?? new Uint8Array();
|
|
11151
|
-
const escaped3 = specifier === "b" ? escapeBytes(raw7, true, true) : { bytes: raw7, stop: false };
|
|
11193
|
+
const escaped3 = specifier === "b" ? escapeBytes(raw7, true, true, unicode) : { bytes: raw7, stop: false };
|
|
11194
|
+
for (const escape2 of unicodeErrors.splice(0)) await writeDiagnostic(context2.stderr, `printf: missing unicode digit for \\${escape2}
|
|
11195
|
+
`, context2.signal);
|
|
11152
11196
|
const bytes8 = escaped3.bytes.subarray(0, precision);
|
|
11153
11197
|
const padding = " ".repeat(Math.max(0, width - bytes8.length));
|
|
11154
11198
|
if (!flags4.includes("-")) await output(context2, padding);
|
|
@@ -28585,6 +28629,21 @@ async function sortedKeys(value2, budget) {
|
|
|
28585
28629
|
await stableSort(keys2, budget, (left, right) => stringCompare(left, right, budget));
|
|
28586
28630
|
return keys2;
|
|
28587
28631
|
}
|
|
28632
|
+
async function sortObjectKeys(value2, budget) {
|
|
28633
|
+
await budget.tick();
|
|
28634
|
+
if (Array.isArray(value2)) {
|
|
28635
|
+
budget.collection(value2.length);
|
|
28636
|
+
const result2 = [];
|
|
28637
|
+
for (const item of value2) result2.push(await sortObjectKeys(item, budget));
|
|
28638
|
+
return result2;
|
|
28639
|
+
}
|
|
28640
|
+
if (isObject(value2)) {
|
|
28641
|
+
const result2 = object();
|
|
28642
|
+
for (const key of await sortedKeys(value2, budget)) put(result2, key, await sortObjectKeys(value2[key], budget));
|
|
28643
|
+
return result2;
|
|
28644
|
+
}
|
|
28645
|
+
return value2;
|
|
28646
|
+
}
|
|
28588
28647
|
async function compare4(left, right, budget) {
|
|
28589
28648
|
await budget.tick();
|
|
28590
28649
|
const rank2 = (value2) => value2 === null ? 0 : value2 === false ? 1 : value2 === true ? 2 : isNumber(value2) ? 3 : typeof value2 === "string" ? 4 : Array.isArray(value2) ? 5 : 6;
|
|
@@ -29829,7 +29888,7 @@ function argumentsFor(args, budget) {
|
|
|
29829
29888
|
argumentBytes += Buffer.byteLength(argument2);
|
|
29830
29889
|
if (argumentBytes > budget.limits.maxInputBytes) throw new JqLimitError("maxInputBytes");
|
|
29831
29890
|
}
|
|
29832
|
-
const options3 = { raw: false, rawInput: false, joinOutput: false, compact: false, slurp: false, nullInput: false, exitStatus: false, source: void 0, programFile: void 0, files: [], variables: /* @__PURE__ */ new Map() };
|
|
29891
|
+
const options3 = { raw: false, rawInput: false, joinOutput: false, compact: false, sortKeys: false, slurp: false, nullInput: false, exitStatus: false, source: void 0, programFile: void 0, files: [], variables: /* @__PURE__ */ new Map() };
|
|
29833
29892
|
const named2 = object();
|
|
29834
29893
|
let ended = false;
|
|
29835
29894
|
let variableBytes = 0;
|
|
@@ -29870,10 +29929,10 @@ function argumentsFor(args, budget) {
|
|
|
29870
29929
|
options3.programFile = operand();
|
|
29871
29930
|
continue;
|
|
29872
29931
|
}
|
|
29873
|
-
const long = { "--raw-output": "r", "--raw-input": "R", "--join-output": "j", "--compact-output": "c", "--slurp": "s", "--null-input": "n", "--exit-status": "e" };
|
|
29932
|
+
const long = { "--raw-output": "r", "--raw-input": "R", "--join-output": "j", "--compact-output": "c", "--sort-keys": "S", "--slurp": "s", "--null-input": "n", "--exit-status": "e" };
|
|
29874
29933
|
if (!ended && argument2.startsWith("-") && argument2 !== "-") {
|
|
29875
29934
|
const flags4 = Object.hasOwn(long, argument2) ? long[argument2] : argument2.startsWith("--") ? "" : argument2.slice(1);
|
|
29876
|
-
if (!flags4 ||
|
|
29935
|
+
if (!flags4 || [...flags4].some((flag) => !"rRjcSsne".includes(flag))) throw new JqError(`unsupported option ${argument2}`, 2);
|
|
29877
29936
|
for (const flag of flags4) {
|
|
29878
29937
|
if (flag === "r") options3.raw = true;
|
|
29879
29938
|
else if (flag === "R") options3.rawInput = true;
|
|
@@ -29881,6 +29940,7 @@ function argumentsFor(args, budget) {
|
|
|
29881
29940
|
options3.joinOutput = true;
|
|
29882
29941
|
options3.raw = true;
|
|
29883
29942
|
} else if (flag === "c") options3.compact = true;
|
|
29943
|
+
else if (flag === "S") options3.sortKeys = true;
|
|
29884
29944
|
else if (flag === "s") options3.slurp = true;
|
|
29885
29945
|
else if (flag === "n") options3.nullInput = true;
|
|
29886
29946
|
else options3.exitStatus = true;
|
|
@@ -30006,7 +30066,8 @@ async function execute3(context2, limits) {
|
|
|
30006
30066
|
if (++budget.results > limits.maxResults) throw new JqLimitError("maxResults");
|
|
30007
30067
|
const remaining = limits.maxOutputBytes - budget.outputBytes;
|
|
30008
30068
|
const suffix2 = options3.joinOutput ? "" : "\n";
|
|
30009
|
-
const
|
|
30069
|
+
const output3 = options3.sortKeys ? await sortObjectKeys(result2, budget) : result2;
|
|
30070
|
+
const text4 = options3.raw && typeof output3 === "string" ? output3 : await stringify(output3, budget, !options3.compact, Math.max(0, remaining - suffix2.length), "maxOutputBytes");
|
|
30010
30071
|
const bytes8 = Buffer.from(`${text4}${suffix2}`);
|
|
30011
30072
|
if (bytes8.byteLength > remaining) throw new JqLimitError("maxOutputBytes");
|
|
30012
30073
|
budget.outputBytes += bytes8.byteLength;
|
|
@@ -88169,4 +88230,4 @@ export {
|
|
|
88169
88230
|
isAbsolutePath3 as isAbsolutePath,
|
|
88170
88231
|
posixPath2 as posixPath
|
|
88171
88232
|
};
|
|
88172
|
-
//# sourceMappingURL=chunk-
|
|
88233
|
+
//# sourceMappingURL=chunk-LYH24BKM.js.map
|