@poe-platform/safe-bash 0.1.824 → 0.1.826
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/safe-bash/command-chunks/{chunk-PLVFJ6FF.js → chunk-4EA7WI3L.js} +9 -1
- package/dist/safe-bash/command-chunks/{chunk-IKBTII7C.js → chunk-BKQWFABY.js} +314 -13
- package/dist/safe-bash/command-chunks/{chunk-3EBQOZET.js → chunk-DV7TCGJR.js} +22 -4
- package/dist/safe-bash/command-chunks/{chunk-3UDJYSAF.js → chunk-IX3B4HCD.js} +34 -2
- package/dist/safe-bash/command-chunks/chunk-NXZJJM4J.js +111 -0
- package/dist/safe-bash/command-chunks/{chunk-AVSINNZ6.js → chunk-P66Q5F6K.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-OLXMWQJ5.js → chunk-Q2ACHUTY.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-HNEWGADJ.js → chunk-RUXOFW5G.js} +7 -6
- package/dist/safe-bash/command-chunks/{chunk-NW3S6T6R.js → chunk-T7RT2BNL.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-TGSNVLFZ.js +105 -0
- package/dist/safe-bash/command-chunks/{chunk-NNGWTDVJ.js → chunk-VKTM2SOL.js} +24 -81
- package/dist/safe-bash/commands/llm/collections.browser.js +4 -2
- package/dist/safe-bash/commands/llm/collections.js +1 -1
- package/dist/safe-bash-command-llm/collections.d.ts +2 -0
- package/dist/safe-bash-command-llm/collections.js +146 -22
- package/dist/safe-bash-command-llm/command.js +1 -1
- package/dist/safe-bash-command-llm/import-sql.d.ts +9 -0
- package/dist/safe-bash-command-llm/index.js +1 -1
- package/dist/safe-bash-command-python/build-wheel.d.ts +11 -2
- package/dist/safe-bash-command-python/executor.js +5 -5
- package/dist/safe-bash-command-python/index.js +5 -5
- package/dist/safe-bash-command-python/jspi.js +2 -2
- package/dist/safe-bash-command-python/provisioning.d.ts +1 -1
- package/dist/safe-bash-command-python/provisioning.js +1 -1
- package/dist/safe-bash-command-python/worker.js +1 -1
- package/dist/safe-bash-csv-engine/index.js +5 -5
- package/dist/safe-bash-csv-engine/python-codepages.js +2 -2
- package/dist/safe-bash-csv-engine/python-file-codepages.js +2 -2
- package/dist/safe-bash-csv-engine/python-utf16.js +3 -3
- package/dist/safe-bash-csv-engine/text-decoder.js +5 -5
- package/dist/safe-bash-sqlite-engine/safe-fs.d.ts +6 -0
- package/dist/safe-bash-sqlite-engine/safe-fs.js +1 -1
- package/dist/safe-bash-sqlite-engine/sqlite-attachments.d.ts +5 -0
- package/dist/safe-bash-sqlite-engine/sqlite-input-snapshots.d.ts +20 -0
- package/dist/safe-bash-sqlite-engine/sqlite-query-records.d.ts +9 -0
- package/dist/safe-bash-sqlite-engine/sqlite-read-session.d.ts +3 -16
- package/dist/safe-bash-sqlite-engine/sqlite-session.d.ts +4 -0
- package/dist/safe-bash-sqlite-engine/sqlite-statement.d.ts +4 -0
- package/dist/safe-bash-sqlite-engine/storage.d.ts +2 -0
- package/dist/safe-bash-sqlite-engine/storage.js +324 -31
- package/dist/safe-bash-sqlite-engine/types.d.ts +1 -0
- package/package.json +2 -2
- package/dist/safe-bash/command-chunks/chunk-OOYVZAWL.js +0 -90
- package/dist/safe-bash/command-chunks/chunk-WIUEM7HP.js +0 -58
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import {
|
|
2
|
+
normalizeEncoding,
|
|
3
|
+
pythonCodecAliases
|
|
4
|
+
} from "./chunk-ZERCTWUI.js";
|
|
5
|
+
import {
|
|
6
|
+
unpackCodepage
|
|
7
|
+
} from "./chunk-RUXOFW5G.js";
|
|
8
|
+
|
|
9
|
+
// packages/safe-bash-csv-engine/src/python-codepages.ts
|
|
10
|
+
var table0 = unpackCodepage("gKwggf//gQOFJiCG//+GCpEYIJEBkxwgkwGVIiCWEyCWAZj//5gHoQEOoTnb///bA98/Dt8c/P///AM=");
|
|
11
|
+
var table1 = unpackCodepage("ghogg5IBhB4ghiAghgGJMCCLOSCZIiGbOiChhQOhAaOjAKMGqv//q6sAqwOvFSCwsACwA7SEA7W1ALUCuIgDuAK7uwC8jAO9vQC+jgO+E9L//9OjA9Mr", table0);
|
|
12
|
+
var table2 = unpackCodepage("iMYCmNwCoaEAoQGkqiCq1wCvrwC0tAC4uAC4Abr3ALy8AL6+AL4BwLAFwAnK///LuwXLCNTwBdQE2f//2Qbg0AXgGvv///sB/Q4g/QE=", table1);
|
|
13
|
+
var table3 = unpackCodepage("imABjFIBmmEBnFMBn3gBpKQAqqoAuroAwMAAwA/QHgHR0QDRC90wAd5eAd/fAN8Q8B8B8fEA8Qv9MQH+XwH//wA=", table2);
|
|
14
|
+
var table4 = unpackCodepage("gX4GinkGjYYGjpgGj4gGkK8GmKkGmpEGnQwgnQGfugahDAaqvga6Gwa/HwbAwQbBIQbBFdg3BtgD3EAG3APhRAbjRQbjA+xJBuwB8EsG8AP1Twb1AfhRBvpSBv0OIP0B/9IG", table3);
|
|
15
|
+
var table5 = unpackCodepage("gAIEgAGDUwSIrCCKCQSMCgSNDASOCwSPDwSQUgSaWQScWgSdXASeWwSfXwShDgSiXgSjCASlkASoAQSqBASvBwSyBgSzVgS0kQS4UQS5FiG6VAS8WAS9BQS+VQS/VwTAEATAPw==", table1);
|
|
16
|
+
var table6 = unpackCodepage("gBAEgC+wkSWwArMCJbQkJbVhJbUBt1YluFUluWMlulElu1clvF0lvVwlvlslvxAlwBQlwTQlwiwlwxwlxAAlxTwlxl4lxgHIWiXJVCXKaSXLZiXMYCXNUCXObCXPZyXPAdFkJdEB01kl1Fgl1VIl1QHXayXYaiXZGCXaDCXbiCXchCXdjCXekCXfgCXgQATgD/ABBPFRBPIEBPNUBPQHBPVXBPYOBPdeBPiwAPkZIvq3APsaIvwWIf2kAP6gJf+gAA==");
|
|
17
|
+
var table7 = unpackCodepage("gJEDgBCRowORBpixA5gQqcMDqsIDq8QDqwTgyQPhrAPhAuTKA+WvA+bMA+YB6MsD6c4D6oYD64gD6wLujAPvjgPvAfGxAPJlIvNkIvSqA/QB9vcA90gi/H8g/bIA", table6);
|
|
18
|
+
var table8 = unpackCodepage("gBAEgB+gICChsACikASkpwClIiCmtgCnBgSorgCqIiGrAgSsUgStYCKuAwSvUwSwHiKyZCKyAbRWBLaRBLcIBLgEBLlUBLoHBLtXBLwJBL1ZBL4KBL9aBMBYBMEFBMKsAMMaIsSSAcVIIsYGIserAMi7AMkmIMqgAMsLBMxbBM0MBM5cBM9VBNATINAB0hwg0gHUGCDUAdb3ANceINgOBNleBNoPBNtfBNwWId0BBN5RBN9PBOAwBOAe/6wg");
|
|
19
|
+
var table9 = unpackCodepage("g///iP//jFoBjWQBjn0Bj3kBmP//nFsBnWUBnn4Bn3oBoccCotgCo0EBpQQBql4Br3sBstsCs0IBuQUBul8BvD0Bvd0Cvj4Bv3wBwFQBwwIBxTkBxgYByAwByhgBzBoBzw4B0BAB0UMB0kcB1VAB2FgB2W4B23AB3d0A3mIB4FUB4wMB5ToB5gcB6A0B6hkB7BsB7w8B8BEB8UQB8kgB9VEB+FkB+W8B+3EB/f0A/mMB/9kC", table3);
|
|
20
|
+
var table10 = unpackCodepage("gMcAgfwAgukAg+IAhOQAheAAhuUAh+cAiOoAiAGK6ACL7wCM7gCN7ACOxACOAZDJAJHmAJLGAJP0AJT2AJXyAJb7AJf5AJj/AJnWAJrcAJuiAJsBnaUAnqcgn5IBoOEAoe0AovMAo/oApPEApdEApqoAp7oAqL8AqRAjqqwAq70ArLwAraEArqsAr7sA4LED4d8A4pMD48AD5KMD5cMD5rUA58QD6KYD6ZgD6qkD67QD7B4i7cYD7rUD7yki8GEi9CAj9AE=", table7);
|
|
21
|
+
var table11 = unpackCodepage("m/gAndgAr6QA", table10);
|
|
22
|
+
var table12 = unpackCodepage("i9AAjPAAjd4Alf4Al90AmP0ApMEApc0AptMAp9oAr7sA", table11);
|
|
23
|
+
var table13 = unpackCodepage("hOMAhsEAicoAi80AjNQAjsMAj8IAkcAAksgAlPUAltoAmMwAmdUAndkAn9MAqdIA", table10);
|
|
24
|
+
var table14 = unpackCodepage("hMIAhrYAjRcgjsAAj6cAkcgAksoAlMsAlc8AmKQAmdQAndkAntsAoKYAobQApKgApbgAprMAp68AqM4Arb4A", table10);
|
|
25
|
+
var table15 = unpackCodepage("ntcAqa4Ar7sAtcEAtQG3wAC4qQC9ogC+pQDG4wDHwwDPpADQ8ADR0ADSygDSAdTIANUxAdbNANYC3aYA3swA4NMA4tQA49IA5PUA5dUA5/4A6N4A6doA6QHr2QDs/QDt3QDurwDvtADwrQDyFyDzvgD0tgD1pwD3uAD5qAD7uQD8swA=", table11);
|
|
26
|
+
var table16 = unpackCodepage("jTEBmDABnl4BngGmHgGmAdC6ANGqANX//+f//+jXAOzsAO3/APL//w==", table15);
|
|
27
|
+
var table17 = unpackCodepage("hW8BhgcBiEIBilABigGNeQGPBgGROQGRAZU9AZUBl1oBlwGbZAGbAZ1BAZ8NAaQEAaQBpn0BpgGoGAGoAat6AawMAa1fAbcaAbheAb17Ab0BxgIBxgHQEQHREAHSDgHUDwHVRwHYGwHdYgHebgHjQwHjAeVIAeZgAeYB6FQB6lUB63AB7mMB8d0C8tsC88cC9NgC+tkC+3EB/FgB/AE=", table15);
|
|
28
|
+
var table18 = unpackCodepage("gMQAgQABgQGDyQCEBAGF1gCG3ACH4QCIBQGJDAGK5ACLDQGMBgGMAY7pAI95AY8BkQ4Bku0Akw8BlBIBlAGWFgGX8wCYFwGZ9ACa9gCb9QCc+gCdGgGdAZ/8AKIYAaffAKsZAayoAK4jAa8uAa8BsSoBtCsBtTYBtgIitxEiuEIBuTsBuQO9OQG9Ab9FAb8BwUMBxEQBxUcBy0gBzFABzdUAzlEBz0wB18ol2E0B2VQB2QHbWAHcOSDcAd5ZAd9WAd8B4WAB4hog4x4g5GEB5VoB5QHnwQDoZAHoAerNAOt9AesB7WoB7tMA7gHwawHxbgHy2gDzbwHzBPjdAPn9APo3Aft7AfxBAf18Af4iAf/HAg==", table8);
|
|
29
|
+
var table19 = unpackCodepage("gcUAgscAhNEAiOAAieIAi+MAjOUAjecAj+gAkOoAkAGT7ACU7gCUAZbxAJjyAJ35AJ77AKKiAKu0AK7GAK/YALAeIrGxALSlALW1ALgPIrnAA7orIruqALy6AL2pA77mAL/4AMC/AMGhAMSSAcVIIsvAAMzDAM5SAc4B2P8A2XgB2kQg26wg3gH73gHgISDhtwDkMCDlwgDmygDoywDpyADrzgDrAe3MAPD/+PHSAPPbAPTZAPUxAfbGAvfcAvivAPnYAvkC/LgA/d0C/tsC", table18);
|
|
30
|
+
var table20 = unpackCodepage("gbkAgrIAhLMAh4UDi4QDjKgAkqMAkyIhliIgl70AmDAgm6YAnKwgoZMDoQGjmAOkmwOlngOmoAOqowOrqgOspwCusACvtwCwkQO1kgO2lQO2ArmZA7kBu5wDvKYDvasDvqgDvgHArAPBnQPDnwPEoQPGpAPLpQPMpwPNhgPOiAPRFSDXiQPXAdmMA9qOA9utA9sC3swD348D4M0D4bED4QHjyAPktAPkAebGA+ezA+i3A+m5A+q+A+u6A+sD778D7wHxzgPywQPzwwPzAfW4A/bJA/fCA/jHA/nFA/q2A/vKA/sB/ZAD/rAD/60A", table19);
|
|
31
|
+
var dbfCodepages = Object.freeze({
|
|
32
|
+
"cp1250": table9,
|
|
33
|
+
"cp1251": table5,
|
|
34
|
+
"cp1253": table1,
|
|
35
|
+
"cp1254": table3,
|
|
36
|
+
"cp1255": table2,
|
|
37
|
+
"cp1256": table4,
|
|
38
|
+
"cp437": table10,
|
|
39
|
+
"cp737": table7,
|
|
40
|
+
"cp850": table15,
|
|
41
|
+
"cp852": table17,
|
|
42
|
+
"cp857": table16,
|
|
43
|
+
"cp860": table13,
|
|
44
|
+
"cp861": table12,
|
|
45
|
+
"cp863": table14,
|
|
46
|
+
"cp865": table11,
|
|
47
|
+
"cp866": table6,
|
|
48
|
+
"cp874": table0,
|
|
49
|
+
"mac_cyrillic": table8,
|
|
50
|
+
"mac_greek": table20,
|
|
51
|
+
"mac_latin2": table18,
|
|
52
|
+
"mac_roman": table19
|
|
53
|
+
});
|
|
54
|
+
var cp1252High = [
|
|
55
|
+
8364,
|
|
56
|
+
-1,
|
|
57
|
+
8218,
|
|
58
|
+
402,
|
|
59
|
+
8222,
|
|
60
|
+
8230,
|
|
61
|
+
8224,
|
|
62
|
+
8225,
|
|
63
|
+
710,
|
|
64
|
+
8240,
|
|
65
|
+
352,
|
|
66
|
+
8249,
|
|
67
|
+
338,
|
|
68
|
+
-1,
|
|
69
|
+
381,
|
|
70
|
+
-1,
|
|
71
|
+
-1,
|
|
72
|
+
8216,
|
|
73
|
+
8217,
|
|
74
|
+
8220,
|
|
75
|
+
8221,
|
|
76
|
+
8226,
|
|
77
|
+
8211,
|
|
78
|
+
8212,
|
|
79
|
+
732,
|
|
80
|
+
8482,
|
|
81
|
+
353,
|
|
82
|
+
8250,
|
|
83
|
+
339,
|
|
84
|
+
-1,
|
|
85
|
+
382,
|
|
86
|
+
376
|
|
87
|
+
];
|
|
88
|
+
var PythonTextDecodeError = class extends Error {
|
|
89
|
+
};
|
|
90
|
+
function decodePythonSingleByte(bytes, codepoints, encoding) {
|
|
91
|
+
let text = "";
|
|
92
|
+
for (const byte of bytes) {
|
|
93
|
+
const code = codepoints[byte];
|
|
94
|
+
if (code < 0) throw new PythonTextDecodeError(`Invalid ${encoding} input`);
|
|
95
|
+
text += String.fromCodePoint(code);
|
|
96
|
+
}
|
|
97
|
+
return text;
|
|
98
|
+
}
|
|
99
|
+
var pythonSingleByteCodepages = Object.freeze({
|
|
100
|
+
...Object.fromEntries(Object.entries(dbfCodepages).map(([name, codepoints]) => [pythonCodecAliases[normalizeEncoding(name)], codepoints])),
|
|
101
|
+
ascii: Object.freeze(Array.from({ length: 256 }, (_, byte) => byte < 128 ? byte : -1)),
|
|
102
|
+
"iso8859-1": Object.freeze(Array.from({ length: 256 }, (_, byte) => byte)),
|
|
103
|
+
cp1252: Object.freeze(Array.from({ length: 256 }, (_, byte) => byte >= 128 && byte < 160 ? cp1252High[byte - 128] : byte))
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
export {
|
|
107
|
+
dbfCodepages,
|
|
108
|
+
PythonTextDecodeError,
|
|
109
|
+
decodePythonSingleByte,
|
|
110
|
+
pythonSingleByteCodepages
|
|
111
|
+
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PythonTextEncodingError,
|
|
3
3
|
PythonUtf16Decoder
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-Q2ACHUTY.js";
|
|
5
5
|
import {
|
|
6
6
|
PythonTextDecodeError,
|
|
7
7
|
decodePythonSingleByte,
|
|
8
8
|
pythonSingleByteCodepages
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NXZJJM4J.js";
|
|
10
10
|
import {
|
|
11
11
|
normalizeEncoding,
|
|
12
12
|
pythonCodecAliases
|
|
13
13
|
} from "./chunk-ZERCTWUI.js";
|
|
14
14
|
import {
|
|
15
15
|
pythonFileCodepages
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-TGSNVLFZ.js";
|
|
17
17
|
import {
|
|
18
18
|
decodeBase64Latin1,
|
|
19
19
|
encodeBase64Latin1
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-RUXOFW5G.js";
|
|
21
21
|
|
|
22
22
|
// packages/safe-bash-csv-engine/src/python-utf7.ts
|
|
23
23
|
var PythonUtf7EncodingError = class extends TypeError {
|
|
@@ -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
|
}
|
|
@@ -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,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createPythonPackageEnvironment,
|
|
3
3
|
createPythonPackageManifestStore,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} from "./chunk-
|
|
4
|
+
publishPythonBuildWheel,
|
|
5
|
+
pythonDocumentPackages
|
|
6
|
+
} from "./chunk-BKQWFABY.js";
|
|
7
7
|
import {
|
|
8
8
|
pythonShellDispatchActive
|
|
9
9
|
} from "./chunk-NHAG4DWL.js";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
PythonInvocationError,
|
|
15
15
|
parsePythonInvocation,
|
|
16
16
|
pythonPackageUrlHash
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-DV7TCGJR.js";
|
|
18
18
|
import {
|
|
19
19
|
pythonLlmProvider
|
|
20
20
|
} from "./chunk-YYRVGXJH.js";
|
|
@@ -1948,65 +1948,9 @@ del _install_safe_llm_import
|
|
|
1948
1948
|
}
|
|
1949
1949
|
}
|
|
1950
1950
|
|
|
1951
|
-
// packages/safe-bash-command-python/src/build-wheel.ts
|
|
1952
|
-
import { FsError as FsError3 } from "../../safe-bash-contracts/index.js";
|
|
1953
|
-
import { resolvePath as resolvePath2, basename } from "../../safe-bash-contracts/path.js";
|
|
1954
|
-
async function publishPythonBuildWheel(source, directory, maxBytes, context) {
|
|
1955
|
-
const { fs, signal } = context, settings = { signal };
|
|
1956
|
-
signal.throwIfAborted();
|
|
1957
|
-
if (maxBytes !== Infinity && (!Number.isSafeInteger(maxBytes) || maxBytes < 0)) throw new RangeError("Invalid Python wheel size limit");
|
|
1958
|
-
const filename = basename(source);
|
|
1959
|
-
if (!filename.endsWith(".whl") || filename.includes("\\") || filename.includes("\0")) throw new TypeError("Invalid Python build wheel filename");
|
|
1960
|
-
const root = await fs.realpath(resolvePath2(context.cwd, directory), settings);
|
|
1961
|
-
const caps = await fs.capabilitiesFor?.(root, settings) ?? fs.capabilities;
|
|
1962
|
-
if (!fs.confineExtraction || !fs.prepareDirectory || !caps.retainedStagingWrite || !caps.retainedStagingCleanup || !caps.retainedRead || !caps.atomicFileStaging) throw new Error("Python wheel publication requires confined retained atomic staging");
|
|
1963
|
-
const artifact = await openPythonPackageFile(context, resolvePath2(context.cwd, source), maxBytes);
|
|
1964
|
-
if (!artifact) throw new Error("Python wheel publication requires retained source reads");
|
|
1965
|
-
let reading;
|
|
1966
|
-
try {
|
|
1967
|
-
const confined = await fs.confineExtraction([root], settings);
|
|
1968
|
-
const destination = new Proxy(confined, { get(target, key) {
|
|
1969
|
-
const owner = key === "openReadFile" ? fs : target, value = Reflect.get(owner, key);
|
|
1970
|
-
return typeof value === "function" ? value.bind(owner) : value;
|
|
1971
|
-
} });
|
|
1972
|
-
const parent = await destination.stat(root, settings), path = resolvePath2(root, artifact.key);
|
|
1973
|
-
try {
|
|
1974
|
-
await destination.prepareDirectory(path, { parent, expected: null, mode: 448, signal });
|
|
1975
|
-
} catch (error) {
|
|
1976
|
-
if (!(error instanceof FsError3) || !["EEXIST", "EAGAIN"].includes(error.code)) throw error;
|
|
1977
|
-
}
|
|
1978
|
-
if ((await destination.lstat(path, settings)).type !== "directory") throw new Error("Python wheel publication directory changed");
|
|
1979
|
-
const output = resolvePath2(path, filename);
|
|
1980
|
-
const body = async function* () {
|
|
1981
|
-
for (let offset = 0; offset < artifact.size; ) {
|
|
1982
|
-
const bytes = await (reading = artifact.read(offset, 65536));
|
|
1983
|
-
offset += bytes.length;
|
|
1984
|
-
yield bytes;
|
|
1985
|
-
}
|
|
1986
|
-
};
|
|
1987
|
-
const published = await stagePythonPackage({ ...context, fs: destination }, path, body(), maxBytes, () => {
|
|
1988
|
-
}, (key) => {
|
|
1989
|
-
if (key !== artifact.key) throw new Error("Built Python wheel integrity mismatch");
|
|
1990
|
-
}, () => output);
|
|
1991
|
-
if (!published) throw new Error("Python wheel publication requires retained atomic staging");
|
|
1992
|
-
try {
|
|
1993
|
-
return { url: "file://" + output.split("/").map(encodeURIComponent).join("/"), digest: published.key, size: published.size };
|
|
1994
|
-
} finally {
|
|
1995
|
-
await published.close();
|
|
1996
|
-
}
|
|
1997
|
-
} finally {
|
|
1998
|
-
try {
|
|
1999
|
-
await reading?.catch(() => {
|
|
2000
|
-
});
|
|
2001
|
-
} finally {
|
|
2002
|
-
await artifact.close();
|
|
2003
|
-
}
|
|
2004
|
-
}
|
|
2005
|
-
}
|
|
2006
|
-
|
|
2007
1951
|
// packages/safe-bash-command-python/src/source-origin.ts
|
|
2008
|
-
import { FsError as
|
|
2009
|
-
import { resolvePath as
|
|
1952
|
+
import { FsError as FsError3 } from "../../safe-bash-contracts/index.js";
|
|
1953
|
+
import { resolvePath as resolvePath2, dirname, basename } from "../../safe-bash-contracts/path.js";
|
|
2010
1954
|
function withPythonSourceOrigins(environment, directory, maxBytes) {
|
|
2011
1955
|
const origins = /* @__PURE__ */ new Map(), encoder2 = new TextEncoder();
|
|
2012
1956
|
return {
|
|
@@ -2018,12 +1962,12 @@ function withPythonSourceOrigins(environment, directory, maxBytes) {
|
|
|
2018
1962
|
const url = new URL(String(args[1]));
|
|
2019
1963
|
if (url.protocol === "file:" && url.hash.startsWith("#python-source=")) {
|
|
2020
1964
|
const parent = dirname(decodeURIComponent(url.pathname));
|
|
2021
|
-
if (
|
|
1965
|
+
if (basename(parent) !== result.key) return result;
|
|
2022
1966
|
let root;
|
|
2023
1967
|
try {
|
|
2024
|
-
root = await context.fs.realpath(
|
|
1968
|
+
root = await context.fs.realpath(resolvePath2(context.cwd, directory), { signal: context.signal });
|
|
2025
1969
|
} catch (error) {
|
|
2026
|
-
if (error instanceof
|
|
1970
|
+
if (error instanceof FsError3 && error.code === "ENOENT") return result;
|
|
2027
1971
|
throw error;
|
|
2028
1972
|
}
|
|
2029
1973
|
if (dirname(parent) !== root) return result;
|
|
@@ -2054,11 +1998,11 @@ function withPythonSourceOrigins(environment, directory, maxBytes) {
|
|
|
2054
1998
|
|
|
2055
1999
|
// packages/safe-bash-command-python/src/source-environment.ts
|
|
2056
2000
|
import { compareIdentity as compareIdentity2 } from "@poe-platform/safe-fs/core";
|
|
2057
|
-
import { FsError as
|
|
2058
|
-
import { resolvePath as
|
|
2001
|
+
import { FsError as FsError4, toByteSource as toByteSource7 } from "../../safe-bash-contracts/index.js";
|
|
2002
|
+
import { resolvePath as resolvePath4 } from "../../safe-bash-contracts/path.js";
|
|
2059
2003
|
|
|
2060
2004
|
// packages/safe-bash-command-python/src/source-download.ts
|
|
2061
|
-
import { dirname as dirname2, resolvePath as
|
|
2005
|
+
import { dirname as dirname2, resolvePath as resolvePath3 } from "../../safe-bash-contracts/path.js";
|
|
2062
2006
|
import { sha224, sha256, sha384, sha512 } from "@noble/hashes/sha2.js";
|
|
2063
2007
|
import { sha1, md5 } from "@noble/hashes/legacy.js";
|
|
2064
2008
|
async function* verifiedBytes(source, expected, maxBytes, signal) {
|
|
@@ -2083,7 +2027,7 @@ async function* verifiedBytes(source, expected, maxBytes, signal) {
|
|
|
2083
2027
|
}
|
|
2084
2028
|
}
|
|
2085
2029
|
async function downloadPythonSourceArchive(url, path, options, context) {
|
|
2086
|
-
const { fs, signal } = context, cacheDirectory =
|
|
2030
|
+
const { fs, signal } = context, cacheDirectory = resolvePath3(context.cwd, options.cacheDirectory ?? dirname2(path));
|
|
2087
2031
|
const caps = await fs.capabilitiesFor?.(cacheDirectory, { signal }) ?? fs.capabilities;
|
|
2088
2032
|
if (!caps.retainedStagingWrite || !caps.retainedStagingCleanup || !caps.retainedRead || !caps.atomicFileStaging || !fs.createStagedFile || !fs.openReadFile || !fs.publishStagedFile || !fs.confineExtraction) throw new Error("Remote Python sources require retained caller storage");
|
|
2089
2033
|
const output = await fs.confineExtraction([dirname2(path)], { signal });
|
|
@@ -2237,14 +2181,14 @@ function createPythonSourcePackageEnvironment(options, build) {
|
|
|
2237
2181
|
if (remote) {
|
|
2238
2182
|
if (!archived) return requirement;
|
|
2239
2183
|
} else {
|
|
2240
|
-
source =
|
|
2184
|
+
source = resolvePath4(context.cwd, source);
|
|
2241
2185
|
try {
|
|
2242
2186
|
const stat = await fs.stat(source, settings);
|
|
2243
2187
|
archived = stat.type === "file" && !!suffix;
|
|
2244
2188
|
if (editable && stat.type !== "directory") throw new Error("Editable source requires a local directory");
|
|
2245
2189
|
if (stat.type !== "directory" && !archived) return requirement;
|
|
2246
2190
|
} catch (error) {
|
|
2247
|
-
if (error instanceof
|
|
2191
|
+
if (error instanceof FsError4 && error.code === "ENOENT") {
|
|
2248
2192
|
if (editable) throw new Error("Editable source requires an existing local directory");
|
|
2249
2193
|
return requirement;
|
|
2250
2194
|
}
|
|
@@ -2254,17 +2198,17 @@ function createPythonSourcePackageEnvironment(options, build) {
|
|
|
2254
2198
|
const originSource = originalLink ?? source;
|
|
2255
2199
|
if (!context.stdout || !context.stderr || !context.env) throw new TypeError("Source package preparation requires command output and environment context");
|
|
2256
2200
|
if (!fs.prepareDirectory || !fs.removeTreeConditional || !fs.confineExtraction) throw new Error("Source packages require conditional caller storage");
|
|
2257
|
-
const root = await fs.realpath(
|
|
2201
|
+
const root = await fs.realpath(resolvePath4(context.cwd, build.directory), settings), parent = await fs.stat(root, settings);
|
|
2258
2202
|
const caps = await fs.capabilitiesFor?.(root, settings) ?? fs.capabilities;
|
|
2259
2203
|
if (!caps.atomicTreeRemoval) throw new Error("Source packages require conditional tree cleanup");
|
|
2260
2204
|
let path = "", owned;
|
|
2261
2205
|
for (let attempt = 0; attempt < 16; attempt++) {
|
|
2262
|
-
path =
|
|
2206
|
+
path = resolvePath4(root, ".python-build-" + ++serial2);
|
|
2263
2207
|
try {
|
|
2264
2208
|
owned = await fs.prepareDirectory(path, { parent, expected: null, mode: 448, signal });
|
|
2265
2209
|
break;
|
|
2266
2210
|
} catch (error) {
|
|
2267
|
-
if (!(error instanceof
|
|
2211
|
+
if (!(error instanceof FsError4) || !["EEXIST", "EAGAIN"].includes(error.code)) throw error;
|
|
2268
2212
|
signal.throwIfAborted();
|
|
2269
2213
|
}
|
|
2270
2214
|
}
|
|
@@ -2295,37 +2239,37 @@ function createPythonSourcePackageEnvironment(options, build) {
|
|
|
2295
2239
|
const configuration = { ...build.python, environment }, hook = createPythonBuildBackend(configuration), hookContext = { ...command, maxBytes: options.maxMetadataBytes ?? Infinity };
|
|
2296
2240
|
let prepared;
|
|
2297
2241
|
if (archived) {
|
|
2298
|
-
prepared =
|
|
2242
|
+
prepared = resolvePath4(path, "source");
|
|
2299
2243
|
await confined.mkdir(prepared, settings);
|
|
2300
2244
|
if (!build.extractArchive) throw new Error("Source archives require an extraction capability");
|
|
2301
2245
|
let metadata;
|
|
2302
2246
|
if (remote) {
|
|
2303
|
-
source =
|
|
2247
|
+
source = resolvePath4(path, "archive");
|
|
2304
2248
|
const response = await downloadPythonSourceArchive(remote, source, options, command);
|
|
2305
2249
|
const filename2 = await hook({ hook: "read_download_filename", source: remote.href, responseUrl: response.url, headers: response.headers }, hookContext);
|
|
2306
2250
|
const headers = new Map(response.headers.map(([key, value]) => [key.toLowerCase(), value]));
|
|
2307
2251
|
metadata = { filename: filename2, ...headers.has("content-type") ? { contentType: headers.get("content-type") } : {} };
|
|
2308
2252
|
}
|
|
2309
2253
|
if (!remote && originalLink && pythonPackageUrlHash(originalLink)) {
|
|
2310
|
-
const snapshot =
|
|
2254
|
+
const snapshot = resolvePath4(path, "archive" + suffix);
|
|
2311
2255
|
await snapshotPythonSourceArchive(source, snapshot, originalLink, options.maxDownloadBytes ?? Infinity, { ...command, fs: staging });
|
|
2312
2256
|
source = snapshot;
|
|
2313
2257
|
}
|
|
2314
2258
|
await build.extractArchive(source, prepared, options.maxDownloadBytes ?? Infinity, { ...command, fs: staging }, metadata);
|
|
2315
2259
|
} else prepared = editable ? await fs.realpath(source, settings) : (await createPythonSourceSnapshot(source, path, { ...command, fs: staging })).path;
|
|
2316
2260
|
if (subdirectory) {
|
|
2317
|
-
const selected =
|
|
2261
|
+
const selected = resolvePath4(prepared, subdirectory);
|
|
2318
2262
|
if (selected !== prepared && !selected.startsWith(prepared + "/")) throw new Error("Source subdirectory escapes the build tree");
|
|
2319
2263
|
const root2 = await fs.realpath(prepared, settings), actual = await fs.realpath(selected, settings);
|
|
2320
2264
|
if (actual !== root2 && !actual.startsWith(root2 + "/")) throw new Error("Source subdirectory escapes the build tree");
|
|
2321
2265
|
prepared = actual;
|
|
2322
2266
|
}
|
|
2323
|
-
const wheelDirectory =
|
|
2267
|
+
const wheelDirectory = resolvePath4(path, "wheels");
|
|
2324
2268
|
await confined.mkdir(wheelDirectory, settings);
|
|
2325
2269
|
const buildSystem = await hook({ hook: "read_build_system", source: prepared, name: requirement, installation: archived ? "archive" : "directory" }, hookContext);
|
|
2326
2270
|
await createPythonBuildDependencies(configuration)({ source: prepared, buildSystem }, hookContext);
|
|
2327
2271
|
const filename = await hook(editable ? { hook: "build_legacy_wheel", source: prepared, wheelDirectory, editable: true } : buildSystem ? { hook: "build_wheel", source: prepared, backend: buildSystem.backend, backendPath: buildSystem.backendPath, wheelDirectory } : { hook: "build_legacy_wheel", source: prepared, wheelDirectory }, hookContext);
|
|
2328
|
-
const published = await publishPythonBuildWheel(
|
|
2272
|
+
const published = await publishPythonBuildWheel(resolvePath4(wheelDirectory, filename), root, options.maxDownloadBytes ?? Infinity, context);
|
|
2329
2273
|
const origin = buildSystem && !editable ? await hook({ hook: "read_source_origin", source: originSource, directory: !archived }, hookContext) : void 0;
|
|
2330
2274
|
const url = published.url + "#python-source=" + encodeURIComponent(origin ?? "null");
|
|
2331
2275
|
await cleanup();
|
|
@@ -2812,7 +2756,6 @@ export {
|
|
|
2812
2756
|
createPythonSourceSnapshot,
|
|
2813
2757
|
pythonLlmPackages,
|
|
2814
2758
|
installPythonLlmPackages,
|
|
2815
|
-
publishPythonBuildWheel,
|
|
2816
2759
|
createPythonSourcePackageEnvironment,
|
|
2817
2760
|
createPythonExecutorCommands,
|
|
2818
2761
|
pythonExecutorCommands
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
// packages/safe-bash/src/commands/llm/collections.ts
|
|
2
|
-
import { LlmCollectionDoesNotExist, createLlmCollectionCommands, withCsvEmbeddingEntries, withEmbeddingFileGlob, withFileEmbeddingEntries, withJsonEmbeddingEntries, withJsonLinesEmbeddingEntries, withLlmCollections } from "../../../safe-bash-command-llm/collections.js";
|
|
2
|
+
import { LlmCollectionDoesNotExist, createLlmCollectionCommands, prepareSqliteAttachments, withCsvEmbeddingEntries, withEmbeddingFileGlob, withFileEmbeddingEntries, withJsonEmbeddingEntries, withJsonLinesEmbeddingEntries, withLlmCollections, withSqlEmbeddingEntries } from "../../../safe-bash-command-llm/collections.js";
|
|
3
3
|
export {
|
|
4
4
|
LlmCollectionDoesNotExist,
|
|
5
5
|
createLlmCollectionCommands,
|
|
6
|
+
prepareSqliteAttachments,
|
|
6
7
|
withCsvEmbeddingEntries,
|
|
7
8
|
withEmbeddingFileGlob,
|
|
8
9
|
withFileEmbeddingEntries,
|
|
9
10
|
withJsonEmbeddingEntries,
|
|
10
11
|
withJsonLinesEmbeddingEntries,
|
|
11
|
-
withLlmCollections
|
|
12
|
+
withLlmCollections,
|
|
13
|
+
withSqlEmbeddingEntries
|
|
12
14
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { "LlmCollectionDoesNotExist", "createLlmCollectionCommands", "withCsvEmbeddingEntries", "withEmbeddingFileGlob", "withFileEmbeddingEntries", "withJsonEmbeddingEntries", "withJsonLinesEmbeddingEntries", "withLlmCollections" } from "../../../safe-bash-command-llm/collections.js";
|
|
1
|
+
export { "LlmCollectionDoesNotExist", "createLlmCollectionCommands", "prepareSqliteAttachments", "withCsvEmbeddingEntries", "withEmbeddingFileGlob", "withFileEmbeddingEntries", "withJsonEmbeddingEntries", "withJsonLinesEmbeddingEntries", "withLlmCollections", "withSqlEmbeddingEntries" } from "../../../safe-bash-command-llm/collections.js";
|
|
2
2
|
//# sourceMappingURL=collections.js.map
|
|
@@ -57,3 +57,5 @@ export { withJsonEmbeddingEntries } from "./import-json.js";
|
|
|
57
57
|
export { withJsonLinesEmbeddingEntries } from "./import-json-lines.js";
|
|
58
58
|
export { withFileEmbeddingEntries, type LlmEmbeddingFile, type LlmFileEmbeddingOptions } from "./import-files.js";
|
|
59
59
|
export { withEmbeddingFileGlob, type LlmEmbeddingGlob } from "./import-glob.js";
|
|
60
|
+
export { withSqlEmbeddingEntries } from './import-sql.js';
|
|
61
|
+
export { prepareSqliteAttachments } from "../safe-bash-sqlite-engine/storage.js";
|