@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
|
@@ -1939,7 +1939,15 @@ For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/St
|
|
|
1939
1939
|
import { yieldTurn as yieldTurn9 } from "../../safe-bash-contracts/yield.js";
|
|
1940
1940
|
|
|
1941
1941
|
// packages/safe-bash-command-llm/src/word-ranges.ts
|
|
1942
|
-
var wordRanges = [[48, 57], [65, 90], [95, 95], [97, 122], [170, 170], [178, 179], [181, 181], [185, 186], [188, 190], [192, 214], [216, 246], [248, 705], [710, 721], [736, 740], [748, 748], [750, 750], [880, 884], [886, 887], [890, 893], [895, 895], [902, 902], [904, 906], [908, 908], [910, 929], [931, 1013], [1015, 1153], [1162, 1327], [1329, 1366], [1369, 1369], [1376, 1416], [1488, 1514], [1519, 1522], [1568, 1610], [1632, 1641], [1646, 1647], [1649, 1747], [1749, 1749], [1765, 1766], [1774, 1788], [1791, 1791], [1808, 1808], [1810, 1839], [1869, 1957], [1969, 1969], [1984, 2026], [2036, 2037], [2042, 2042], [2048, 2069], [2074, 2074], [2084, 2084], [2088, 2088], [2112, 2136], [2144, 2154], [2208, 2228], [2230, 2247], [2308, 2361], [2365, 2365], [2384, 2384], [2392, 2401], [2406, 2415], [2417, 2432], [2437, 2444], [2447, 2448], [2451, 2472], [2474, 2480], [2482, 2482], [2486, 2489], [2493, 2493], [2510, 2510], [2524, 2525], [2527, 2529], [2534, 2545], [2548, 2553], [2556, 2556], [2565, 2570], [2575, 2576], [2579, 2600], [2602, 2608], [2610, 2611], [2613, 2614], [2616, 2617], [2649, 2652], [2654, 2654], [2662, 2671], [2674, 2676], [2693, 2701], [2703, 2705], [2707, 2728], [2730, 2736], [2738, 2739], [2741, 2745], [2749, 2749], [2768, 2768], [2784, 2785], [2790, 2799], [2809, 2809], [2821, 2828], [2831, 2832], [2835, 2856], [2858, 2864], [2866, 2867], [2869, 2873], [2877, 2877], [2908, 2909], [2911, 2913], [2918, 2927], [2929, 2935], [2947, 2947], [2949, 2954], [2958, 2960], [2962, 2965], [2969, 2970], [2972, 2972], [2974, 2975], [2979, 2980], [2984, 2986], [2990, 3001], [3024, 3024], [3046, 3058], [3077, 3084], [3086, 3088], [3090, 3112], [3114, 3129], [3133, 3133], [3160, 3162], [3168, 3169], [3174, 3183], [3192, 3198], [3200, 3200], [3205, 3212], [3214, 3216], [3218, 3240], [3242, 3251], [3253, 3257], [3261, 3261], [3294, 3294], [3296, 3297], [3302, 3311], [3313, 3314], [3332, 3340], [3342, 3344], [3346, 3386], [3389, 3389], [3406, 3406], [3412, 3414], [3416, 3425], [3430, 3448], [3450, 3455], [3461, 3478], [3482, 3505], [3507, 3515], [3517, 3517], [3520, 3526], [3558, 3567], [3585, 3632], [3634, 3635], [3648, 3654], [3664, 3673], [3713, 3714], [3716, 3716], [3718, 3722], [3724, 3747], [3749, 3749], [3751, 3760], [3762, 3763], [3773, 3773], [3776, 3780], [3782, 3782], [3792, 3801], [3804, 3807], [3840, 3840], [3872, 3891], [3904, 3911], [3913, 3948], [3976, 3980], [4096, 4138], [4159, 4169], [4176, 4181], [4186, 4189], [4193, 4193], [4197, 4198], [4206, 4208], [4213, 4225], [4238, 4238], [4240, 4249], [4256, 4293], [4295, 4295], [4301, 4301], [4304, 4346], [4348, 4680], [4682, 4685], [4688, 4694], [4696, 4696], [4698, 4701], [4704, 4744], [4746, 4749], [4752, 4784], [4786, 4789], [4792, 4798], [4800, 4800], [4802, 4805], [4808, 4822], [4824, 4880], [4882, 4885], [4888, 4954], [4969, 4988], [4992, 5007], [5024, 5109], [5112, 5117], [5121, 5740], [5743, 5759], [5761, 5786], [5792, 5866], [5870, 5880], [5888, 5900], [5902, 5905], [5920, 5937], [5952, 5969], [5984, 5996], [5998, 6e3], [6016, 6067], [6103, 6103], [6108, 6108], [6112, 6121], [6128, 6137], [6160, 6169], [6176, 6264], [6272, 6276], [6279, 6312], [6314, 6314], [6320, 6389], [6400, 6430], [6470, 6509], [6512, 6516], [6528, 6571], [6576, 6601], [6608, 6618], [6656, 6678], [6688, 6740], [6784, 6793], [6800, 6809], [6823, 6823], [6917, 6963], [6981, 6987], [6992, 7001], [7043, 7072], [7086, 7141], [7168, 7203], [7232, 7241], [7245, 7293], [7296, 7304], [7312, 7354], [7357, 7359], [7401, 7404], [7406, 7411], [7413, 7414], [7418, 7418], [7424, 7615], [7680, 7957], [7960, 7965], [7968, 8005], [8008, 8013], [8016, 8023], [8025, 8025], [8027, 8027], [8029, 8029], [8031, 8061], [8064, 8116], [8118, 8124], [8126, 8126], [8130, 8132], [8134, 8140], [8144, 8147], [8150, 8155], [8160, 8172], [8178, 8180], [8182, 8188], [8304, 8305], [8308, 8313], [8319, 8329], [8336, 8348], [8450, 8450], [8455, 8455], [8458, 8467], [8469, 8469], [8473, 8477], [8484, 8484], [8486, 8486], [8488, 8488], [8490, 8493], [8495, 8505], [8508, 8511], [8517, 8521], [8526, 8526], [8528, 8585], [9312, 9371], [9450, 9471], [10102, 10131], [11264, 11310], [11312, 11358], [11360, 11492], [11499, 11502], [11506, 11507], [11517, 11517], [11520, 11557], [11559, 11559], [11565, 11565], [11568, 11623], [11631, 11631], [11648, 11670], [11680, 11686], [11688, 11694], [11696, 11702], [11704, 11710], [11712, 11718], [11720, 11726], [11728, 11734], [11736, 11742], [11823, 11823], [12293, 12295], [12321, 12329], [12337, 12341], [12344, 12348], [12353, 12438], [12445, 12447], [12449, 12538], [12540, 12543], [12549, 12591], [12593, 12686], [12690, 12693], [12704, 12735], [12784, 12799], [12832, 12841], [12872, 12879], [12881, 12895], [12928, 12937], [12977, 12991], [13312, 19903], [19968, 40956], [40960, 42124], [42192, 42237], [42240, 42508], [42512, 42539], [42560, 42606], [42623, 42653], [42656, 42735], [42775, 42783], [42786, 42888], [42891, 42943], [42946, 42954], [42997, 43009], [43011, 43013], [43015, 43018], [43020, 43042], [43056, 43061], [43072, 43123], [43138, 43187], [43216, 43225], [43250, 43255], [43259, 43259], [43261, 43262], [43264, 43301], [43312, 43334], [43360, 43388], [43396, 43442], [43471, 43481], [43488, 43492], [43494, 43518], [43520, 43560], [43584, 43586], [43588, 43595], [43600, 43609], [43616, 43638], [43642, 43642], [43646, 43695], [43697, 43697], [43701, 43702], [43705, 43709], [43712, 43712], [43714, 43714], [43739, 43741], [43744, 43754], [43762, 43764], [43777, 43782], [43785, 43790], [43793, 43798], [43808, 43814], [43816, 43822], [43824, 43866], [43868, 43881], [43888, 44002], [44016, 44025], [44032, 55203], [55216, 55238], [55243, 55291], [63744, 64109], [64112, 64217], [64256, 64262], [64275, 64279], [64285, 64285], [64287, 64296], [64298, 64310], [64312, 64316], [64318, 64318], [64320, 64321], [64323, 64324], [64326, 64433], [64467, 64829], [64848, 64911], [64914, 64967], [65008, 65019], [65136, 65140], [65142, 65276], [65296, 65305], [65313, 65338], [65345, 65370], [65382, 65470], [65474, 65479], [65482, 65487], [65490, 65495], [65498, 65500], [65536, 65547], [65549, 65574], [65576, 65594], [65596, 65597], [65599, 65613], [65616, 65629], [65664, 65786], [65799, 65843], [65856, 65912], [65930, 65931], [66176, 66204], [66208, 66256], [66273, 66299], [66304, 66339], [66349, 66378], [66384, 66421], [66432, 66461], [66464, 66499], [66504, 66511], [66513, 66517], [66560, 66717], [66720, 66729], [66736, 66771], [66776, 66811], [66816, 66855], [66864, 66915], [67072, 67382], [67392, 67413], [67424, 67431], [67584, 67589], [67592, 67592], [67594, 67637], [67639, 67640], [67644, 67644], [67647, 67669], [67672, 67702], [67705, 67742], [67751, 67759], [67808, 67826], [67828, 67829], [67835, 67867], [67872, 67897], [67968, 68023], [68028, 68047], [68050, 68096], [68112, 68115], [68117, 68119], [68121, 68149], [68160, 68168], [68192, 68222], [68224, 68255], [68288, 68295], [68297, 68324], [68331, 68335], [68352, 68405], [68416, 68437], [68440, 68466], [68472, 68497], [68521, 68527], [68608, 68680], [68736, 68786], [68800, 68850], [68858, 68899], [68912, 68921], [69216, 69246], [69248, 69289], [69296, 69297], [69376, 69415], [69424, 69445], [69457, 69460], [69552, 69579], [69600, 69622], [69635, 69687], [69714, 69743], [69763, 69807], [69840, 69864], [69872, 69881], [69891, 69926], [69942, 69951], [69956, 69956], [69959, 69959], [69968, 70002], [70006, 70006], [70019, 70066], [70081, 70084], [70096, 70106], [70108, 70108], [70113, 70132], [70144, 70161], [70163, 70187], [70272, 70278], [70280, 70280], [70282, 70285], [70287, 70301], [70303, 70312], [70320, 70366], [70384, 70393], [70405, 70412], [70415, 70416], [70419, 70440], [70442, 70448], [70450, 70451], [70453, 70457], [70461, 70461], [70480, 70480], [70493, 70497], [70656, 70708], [70727, 70730], [70736, 70745], [70751, 70753], [70784, 70831], [70852, 70853], [70855, 70855], [70864, 70873], [71040, 71086], [71128, 71131], [71168, 71215], [71236, 71236], [71248, 71257], [71296, 71338], [71352, 71352], [71360, 71369], [71424, 71450], [71472, 71483], [71680, 71723], [71840, 71922], [71935, 71942], [71945, 71945], [71948, 71955], [71957, 71958], [71960, 71983], [71999, 71999], [72001, 72001], [72016, 72025], [72096, 72103], [72106, 72144], [72161, 72161], [72163, 72163], [72192, 72192], [72203, 72242], [72250, 72250], [72272, 72272], [72284, 72329], [72349, 72349], [72384, 72440], [72704, 72712], [72714, 72750], [72768, 72768], [72784, 72812], [72818, 72847], [72960, 72966], [72968, 72969], [72971, 73008], [73030, 73030], [73040, 73049], [73056, 73061], [73063, 73064], [73066, 73097], [73112, 73112], [73120, 73129], [73440, 73458], [73648, 73648], [73664, 73684], [73728, 74649], [74752, 74862], [74880, 75075], [77824, 78894], [82944, 83526], [92160, 92728], [92736, 92766], [92768, 92777], [92880, 92909], [92928, 92975], [92992, 92995], [93008, 93017], [93019, 93025], [93027, 93047], [93053, 93071], [93760, 93846], [93952, 94026], [94032, 94032], [94099, 94111], [94176, 94177], [94179, 94179], [94208, 100343], [100352, 101589], [101632, 101640], [110592, 110878], [110928, 110930], [110948, 110951], [110960, 111355], [113664, 113770], [113776, 113788], [113792, 113800], [113808, 113817], [119520, 119539], [119648, 119672], [119808, 119892], [119894, 119964], [119966, 119967], [119970, 119970], [119973, 119974], [119977, 119980], [119982, 119993], [119995, 119995], [119997, 120003], [120005, 120069], [120071, 120074], [120077, 120084], [120086, 120092], [120094, 120121], [120123, 120126], [120128, 120132], [120134, 120134], [120138, 120144], [120146, 120485], [120488, 120512], [120514, 120538], [120540, 120570], [120572, 120596], [120598, 120628], [120630, 120654], [120656, 120686], [120688, 120712], [120714, 120744], [120746, 120770], [120772, 120779], [120782, 120831], [123136, 123180], [123191, 123197], [123200, 123209], [123214, 123214], [123584, 123627], [123632, 123641], [124928, 125124], [125127, 125135], [125184, 125251], [125259, 125259], [125264, 125273], [126065, 126123], [126125, 126127], [126129, 126132], [126209, 126253], [126255, 126269], [126464, 126467], [126469, 126495], [126497, 126498], [126500, 126500], [126503, 126503], [126505, 126514], [126516, 126519], [126521, 126521], [126523, 126523], [126530, 126530], [126535, 126535], [126537, 126537], [126539, 126539], [126541, 126543], [126545, 126546], [126548, 126548], [126551, 126551], [126553, 126553], [126555, 126555], [126557, 126557], [126559, 126559], [126561, 126562], [126564, 126564], [126567, 126570], [126572, 126578], [126580, 126583], [126585, 126588], [126590, 126590], [126592, 126601], [126603, 126619], [126625, 126627], [126629, 126633], [126635, 126651], [127232, 127244], [130032, 130041], [131072, 173789], [173824, 177972], [177984, 178205], [178208, 183969], [183984, 191456], [194560, 195101], [196608, 201546]];
|
|
1942
|
+
var wordRanges = /* @__PURE__ */ (() => {
|
|
1943
|
+
let end = 0;
|
|
1944
|
+
return "1c,9;8,p;5,0;2,p;1c,0;8,1;2,0;4,1;2,2;2,m;2,u;2,cp;5,b;f,4;8,0;2,0;3m,4;2,1;3,3;2,0;7,0;2,2;2,0;2,j;2,2a;2,3u;9,4l;2,11;3,0;7,14;20,q;5,3;1a,16;m,9;5,1;2,2q;2,0;g,1;8,e;3,0;h,0;2,t;u,2g;c,0;f,16;a,1;5,0;6,l;5,0;a,0;4,0;o,o;8,a;1i,k;2,h;1p,1h;4,0;j,0;8,9;5,9;2,f;5,7;3,1;3,l;2,6;2,0;4,3;4,0;h,0;e,1;2,2;5,b;3,5;3,0;9,5;5,1;3,l;2,6;2,1;2,1;2,1;w,3;2,0;8,9;3,2;h,8;2,2;2,l;2,6;2,1;2,4;4,0;j,0;g,1;5,9;a,0;c,7;3,1;3,l;2,6;2,1;2,4;4,0;v,1;2,2;5,9;2,6;c,0;2,5;4,2;2,3;4,1;2,0;2,1;4,1;4,2;4,b;n,0;m,c;j,7;2,2;2,m;2,f;4,0;r,2;6,1;5,9;9,6;2,0;5,7;2,2;2,m;2,9;2,4;4,0;x,0;2,1;5,9;2,1;i,8;2,2;2,14;3,0;h,0;6,2;2,9;5,i;2,5;6,h;4,n;2,8;2,0;3,6;w,9;i,1b;2,1;d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3,o;2,o;2,u;2,o;2,u;2,o;2,u;2,o;2,u;2,o;2,7;3,1d;1s1,18;b,6;3,9;5,0;aa,17;5,9;zr,5g;3,8;1d,1v;8,0;5,9;m0,1m;2,2;2,3;25,18;2,e;5f,3;2,q;2,1;2,0;3,0;2,9;2,3;2,0;2,0;7,0;5,0;2,0;2,0;2,2;2,1;2,0;3,0;2,0;2,0;2,0;2,0;2,1;2,0;3,3;2,6;2,3;2,3;2,0;2,9;2,g;6,2;2,4;2,g;g5,c;25g,9;sn,wyl;z,378;c,65;3,4g1;f,5rk;2e8,f1;15v,3t6".split(";").map((pair) => {
|
|
1945
|
+
const [gap, length] = pair.split(",").map((value) => parseInt(value, 36));
|
|
1946
|
+
const start = end + gap;
|
|
1947
|
+
end = start + length;
|
|
1948
|
+
return [start, end];
|
|
1949
|
+
});
|
|
1950
|
+
})();
|
|
1943
1951
|
|
|
1944
1952
|
// packages/safe-bash-command-llm/src/extract-range.ts
|
|
1945
1953
|
function isWord(value) {
|
|
@@ -2,6 +2,178 @@ import {
|
|
|
2
2
|
openPythonPackageFile
|
|
3
3
|
} from "./chunk-NXCJNPL3.js";
|
|
4
4
|
|
|
5
|
+
// packages/safe-bash-command-python/src/wheel-index.ts
|
|
6
|
+
import { ArchiveMetadataMap } from "../../safe-bash-io-engine/commands/archive/metadata.js";
|
|
7
|
+
import { createArchiveScratchFactory } from "../../safe-bash-io-engine/commands/archive/scratch.js";
|
|
8
|
+
import { DEFAULT_ARCHIVE_LIMITS } from "../../safe-bash-io-engine/commands/archive/internal.js";
|
|
9
|
+
import { toByteSource } from "../../safe-bash-contracts/index.js";
|
|
10
|
+
async function exact(source, offset, length) {
|
|
11
|
+
const bytes = new Uint8Array(length);
|
|
12
|
+
for (let position = 0; position < length; ) {
|
|
13
|
+
const chunk = await source.read(offset + position, Math.min(65536, length - position));
|
|
14
|
+
if (!chunk.length || chunk.length > length - position) throw new Error("Invalid native ZIP index read");
|
|
15
|
+
bytes.set(chunk, position);
|
|
16
|
+
position += chunk.length;
|
|
17
|
+
}
|
|
18
|
+
return bytes;
|
|
19
|
+
}
|
|
20
|
+
var PythonWheelIndex = class {
|
|
21
|
+
constructor(context) {
|
|
22
|
+
this.context = context;
|
|
23
|
+
const discard = { async write() {
|
|
24
|
+
} };
|
|
25
|
+
this.scratch = createArchiveScratchFactory({ context: { ...context, command: "python", args: [], env: {}, stdin: toByteSource(""), stdout: discard, stderr: discard }, limits: DEFAULT_ARCHIVE_LIMITS, operation: (action) => Promise.resolve().then(action) }, context.cwd);
|
|
26
|
+
const metadata = this.spool = async () => {
|
|
27
|
+
const spool = await this.scratch();
|
|
28
|
+
let buffer = new Uint8Array(16384), used = 0;
|
|
29
|
+
const flush = async () => {
|
|
30
|
+
if (used) {
|
|
31
|
+
await spool.append(buffer.subarray(0, used));
|
|
32
|
+
used = 0;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
return { append: async (bytes) => {
|
|
36
|
+
if (!buffer) throw new Error("Python wheel scratch is sealed");
|
|
37
|
+
for (let at = 0; at < bytes.length; ) {
|
|
38
|
+
const length = Math.min(buffer.length - used, bytes.length - at);
|
|
39
|
+
buffer.set(bytes.subarray(at, at + length), used);
|
|
40
|
+
used += length;
|
|
41
|
+
at += length;
|
|
42
|
+
if (used === buffer.length) await flush();
|
|
43
|
+
}
|
|
44
|
+
}, close: async () => {
|
|
45
|
+
buffer = void 0;
|
|
46
|
+
used = 0;
|
|
47
|
+
await spool.close();
|
|
48
|
+
}, finish: async () => {
|
|
49
|
+
await flush();
|
|
50
|
+
buffer = void 0;
|
|
51
|
+
const source = await spool.finish();
|
|
52
|
+
return { size: source.size, read: async (offset, length) => {
|
|
53
|
+
if (offset >= source.size) return new Uint8Array();
|
|
54
|
+
const base = Math.floor(offset / 16384) * 16384;
|
|
55
|
+
const found = this.pages.findIndex((page2) => page2.source === source && page2.offset === base);
|
|
56
|
+
const page = found < 0 ? { source, offset: base, bytes: await exact(source, base, Math.min(16384, source.size - base)) } : this.pages.splice(found, 1)[0];
|
|
57
|
+
this.pages.push(page);
|
|
58
|
+
if (this.pages.length > 4) this.pages.shift();
|
|
59
|
+
return page.bytes.subarray(offset - base, Math.min(page.bytes.length, offset - base + length));
|
|
60
|
+
} };
|
|
61
|
+
} };
|
|
62
|
+
};
|
|
63
|
+
this.boundaries = new ArchiveMetadataMap(metadata, context.signal);
|
|
64
|
+
this.names = new ArchiveMetadataMap(metadata, context.signal);
|
|
65
|
+
this.headers = new ArchiveMetadataMap(metadata, context.signal);
|
|
66
|
+
}
|
|
67
|
+
context;
|
|
68
|
+
scratch;
|
|
69
|
+
spool;
|
|
70
|
+
data;
|
|
71
|
+
offsets;
|
|
72
|
+
dataSource;
|
|
73
|
+
offsetSource;
|
|
74
|
+
ends;
|
|
75
|
+
size = 0;
|
|
76
|
+
pages = [];
|
|
77
|
+
cached;
|
|
78
|
+
names;
|
|
79
|
+
headers;
|
|
80
|
+
boundaries;
|
|
81
|
+
count = 0;
|
|
82
|
+
sealed = false;
|
|
83
|
+
failed;
|
|
84
|
+
tail = Promise.resolve();
|
|
85
|
+
closing;
|
|
86
|
+
execute(operation, args) {
|
|
87
|
+
if (this.closing) return Promise.reject(new Error("Python wheel index is closed"));
|
|
88
|
+
const work = this.tail.then(async () => {
|
|
89
|
+
this.context.signal.throwIfAborted();
|
|
90
|
+
if (this.failed) throw this.failed.error;
|
|
91
|
+
if (operation === "append") {
|
|
92
|
+
if (this.sealed) throw new Error("Python wheel index is sealed");
|
|
93
|
+
const [name, offset, payload] = args;
|
|
94
|
+
if (typeof name !== "string" || typeof offset !== "string" || typeof payload !== "string") throw new Error("Invalid native ZIP entry");
|
|
95
|
+
const header = BigInt(offset), ordinal = this.count++;
|
|
96
|
+
if (!Number.isSafeInteger(this.count) || header <= -(1n << 128n) || header >= 1n << 128n) throw new Error("Invalid native ZIP coordinate");
|
|
97
|
+
this.data ??= await this.spool();
|
|
98
|
+
this.offsets ??= await this.spool();
|
|
99
|
+
const bytes = new TextEncoder().encode(payload), pointer = new Uint8Array(16), view = new DataView(pointer.buffer);
|
|
100
|
+
view.setBigUint64(0, BigInt(this.size), true);
|
|
101
|
+
view.setBigUint64(8, BigInt(bytes.length), true);
|
|
102
|
+
for (let at = 0; at < bytes.length; at += 65536) await this.data.append(bytes.subarray(at, at + 65536));
|
|
103
|
+
await this.offsets.append(pointer);
|
|
104
|
+
this.size += bytes.length;
|
|
105
|
+
if (!Number.isSafeInteger(this.size)) throw new Error("Native ZIP index size overflow");
|
|
106
|
+
await this.names.set(name, ordinal);
|
|
107
|
+
const order = ((1n << 128n) - header).toString().padStart(40, "0") + ":" + String(Number.MAX_SAFE_INTEGER - ordinal).padStart(16, "0");
|
|
108
|
+
await this.headers.set(order, { ordinal, offset });
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
if (operation === "seal") {
|
|
112
|
+
if (this.sealed) throw new Error("Python wheel index is sealed");
|
|
113
|
+
if (typeof args[0] !== "string") throw new Error("Invalid native ZIP directory offset");
|
|
114
|
+
let end = args[0];
|
|
115
|
+
BigInt(end);
|
|
116
|
+
for await (const [, entry] of this.headers.sortedEntries()) {
|
|
117
|
+
await this.boundaries.set(String(entry.ordinal).padStart(16, "0"), end);
|
|
118
|
+
end = entry.offset;
|
|
119
|
+
}
|
|
120
|
+
const boundaries = await this.spool();
|
|
121
|
+
for await (const [, end2] of this.boundaries.sortedEntries()) {
|
|
122
|
+
const value = BigInt.asUintN(128, BigInt(end2)), bytes = new Uint8Array(16), view = new DataView(bytes.buffer);
|
|
123
|
+
view.setBigUint64(0, value & (1n << 64n) - 1n, true);
|
|
124
|
+
view.setBigUint64(8, value >> 64n, true);
|
|
125
|
+
await boundaries.append(bytes);
|
|
126
|
+
}
|
|
127
|
+
this.ends = await boundaries.finish();
|
|
128
|
+
this.dataSource = await this.data?.finish();
|
|
129
|
+
this.offsetSource = await this.offsets?.finish();
|
|
130
|
+
this.sealed = true;
|
|
131
|
+
await Promise.all([this.headers.close(), this.boundaries.close()]);
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
if (operation === "get" || operation === "name") {
|
|
135
|
+
if (!this.sealed) throw new Error("Python wheel index is not sealed");
|
|
136
|
+
const ordinal = operation === "name" && typeof args[0] === "string" ? await this.names.get(args[0]) : args[0];
|
|
137
|
+
const offset = args[1];
|
|
138
|
+
if (!Number.isSafeInteger(offset) || offset < 0) throw new Error("Invalid native ZIP response offset");
|
|
139
|
+
if (ordinal === void 0) return "null".slice(offset, offset + 8192);
|
|
140
|
+
if (!Number.isSafeInteger(ordinal) || ordinal < 0 || ordinal >= this.count) throw new Error("Invalid native ZIP entry ordinal");
|
|
141
|
+
if (this.cached?.ordinal === ordinal) return this.cached.response.slice(offset, offset + 8192);
|
|
142
|
+
const pointer = await exact(this.offsetSource, ordinal * 16, 16), view = new DataView(pointer.buffer);
|
|
143
|
+
const payload = new TextDecoder("utf-8", { fatal: true }).decode(await exact(this.dataSource, Number(view.getBigUint64(0, true)), Number(view.getBigUint64(8, true))));
|
|
144
|
+
const boundary = await exact(this.ends, ordinal * 16, 16), endView = new DataView(boundary.buffer);
|
|
145
|
+
const end = BigInt.asIntN(128, endView.getBigUint64(0, true) | endView.getBigUint64(8, true) << 64n).toString();
|
|
146
|
+
this.cached = { ordinal, response: JSON.stringify([payload, end]) };
|
|
147
|
+
return this.cached.response.slice(offset, offset + 8192);
|
|
148
|
+
}
|
|
149
|
+
throw new Error("Invalid native ZIP index operation");
|
|
150
|
+
});
|
|
151
|
+
this.tail = work.catch((error) => {
|
|
152
|
+
this.failed ??= { error };
|
|
153
|
+
});
|
|
154
|
+
return work;
|
|
155
|
+
}
|
|
156
|
+
close() {
|
|
157
|
+
return this.closing ??= this.tail.then(async () => {
|
|
158
|
+
this.cached = void 0;
|
|
159
|
+
this.pages.length = 0;
|
|
160
|
+
const results = await Promise.allSettled([this.boundaries.close(), this.names.close(), this.headers.close()]);
|
|
161
|
+
try {
|
|
162
|
+
await this.scratch.close();
|
|
163
|
+
} catch (reason) {
|
|
164
|
+
results.push({ status: "rejected", reason });
|
|
165
|
+
}
|
|
166
|
+
const errors = results.filter((result) => result.status === "rejected").map((result) => result.reason);
|
|
167
|
+
if (errors.length === 1) throw errors[0];
|
|
168
|
+
if (errors.length) throw new AggregateError(errors, "Python wheel index cleanup failed");
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
// packages/safe-bash-command-python/src/build-wheel.ts
|
|
174
|
+
import { FsError as FsError2 } from "../../safe-bash-contracts/index.js";
|
|
175
|
+
import { resolvePath as resolvePath2, basename } from "../../safe-bash-contracts/path.js";
|
|
176
|
+
|
|
5
177
|
// packages/safe-bash-command-python/src/package-download.ts
|
|
6
178
|
import { FsError } from "../../safe-bash-contracts/index.js";
|
|
7
179
|
import { resolvePath } from "../../safe-bash-contracts/path.js";
|
|
@@ -103,9 +275,67 @@ async function stagePythonPackage(context, directory, body, maxBytes, progress,
|
|
|
103
275
|
}
|
|
104
276
|
}
|
|
105
277
|
|
|
278
|
+
// packages/safe-bash-command-python/src/build-wheel.ts
|
|
279
|
+
async function publishPythonBuildWheel(source, directory, maxBytes, context) {
|
|
280
|
+
const { fs, signal } = context, settings = { signal };
|
|
281
|
+
let artifact = typeof source === "string" ? void 0 : source.artifact;
|
|
282
|
+
let reading;
|
|
283
|
+
try {
|
|
284
|
+
signal.throwIfAborted();
|
|
285
|
+
if (maxBytes !== Infinity && (!Number.isSafeInteger(maxBytes) || maxBytes < 0)) throw new RangeError("Invalid Python wheel size limit");
|
|
286
|
+
const filename = typeof source === "string" ? basename(source) : source.filename;
|
|
287
|
+
if (basename(filename) !== filename || !filename.endsWith(".whl") || filename.includes("\\") || filename.includes("\0")) throw new TypeError("Invalid Python build wheel filename");
|
|
288
|
+
const root = await fs.realpath(resolvePath2(context.cwd, directory), settings);
|
|
289
|
+
const caps = await fs.capabilitiesFor?.(root, settings) ?? fs.capabilities;
|
|
290
|
+
if (!fs.confineExtraction || !fs.prepareDirectory || !caps.retainedStagingWrite || !caps.retainedStagingCleanup || !caps.retainedRead || !caps.atomicFileStaging) throw new Error("Python wheel publication requires confined retained atomic staging");
|
|
291
|
+
if (typeof source === "string") artifact = await openPythonPackageFile(context, resolvePath2(context.cwd, source), maxBytes);
|
|
292
|
+
if (!artifact) throw new Error("Python wheel publication requires retained source reads");
|
|
293
|
+
if (artifact.size > maxBytes) throw new Error("Canonical package exceeds maxDownloadBytes");
|
|
294
|
+
const retained = artifact;
|
|
295
|
+
const confined = await fs.confineExtraction([root], settings);
|
|
296
|
+
const destination = new Proxy(confined, { get(target, key) {
|
|
297
|
+
const owner = key === "openReadFile" ? fs : target, value = Reflect.get(owner, key);
|
|
298
|
+
return typeof value === "function" ? value.bind(owner) : value;
|
|
299
|
+
} });
|
|
300
|
+
const parent = await destination.stat(root, settings), path = resolvePath2(root, artifact.key);
|
|
301
|
+
try {
|
|
302
|
+
await destination.prepareDirectory(path, { parent, expected: null, mode: 448, signal });
|
|
303
|
+
} catch (error) {
|
|
304
|
+
if (!(error instanceof FsError2) || !["EEXIST", "EAGAIN"].includes(error.code)) throw error;
|
|
305
|
+
}
|
|
306
|
+
if ((await destination.lstat(path, settings)).type !== "directory") throw new Error("Python wheel publication directory changed");
|
|
307
|
+
const output = resolvePath2(path, filename);
|
|
308
|
+
const body = async function* () {
|
|
309
|
+
for (let offset = 0; offset < retained.size; ) {
|
|
310
|
+
const bytes = await (reading = Promise.resolve(retained.read(offset, Math.min(65536, retained.size - offset))));
|
|
311
|
+
if (!bytes.length || bytes.length > Math.min(65536, retained.size - offset)) throw new Error("Invalid Python wheel read");
|
|
312
|
+
offset += bytes.length;
|
|
313
|
+
yield bytes;
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
const published = await stagePythonPackage({ ...context, fs: destination }, path, body(), maxBytes, () => {
|
|
317
|
+
}, (key) => {
|
|
318
|
+
if (key !== retained.key) throw new Error("Built Python wheel integrity mismatch");
|
|
319
|
+
}, () => output);
|
|
320
|
+
if (!published) throw new Error("Python wheel publication requires retained atomic staging");
|
|
321
|
+
try {
|
|
322
|
+
return { url: "file://" + output.split("/").map(encodeURIComponent).join("/"), digest: published.key, size: published.size };
|
|
323
|
+
} finally {
|
|
324
|
+
await published.close();
|
|
325
|
+
}
|
|
326
|
+
} finally {
|
|
327
|
+
try {
|
|
328
|
+
await reading?.catch(() => {
|
|
329
|
+
});
|
|
330
|
+
} finally {
|
|
331
|
+
await artifact?.close?.();
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
106
336
|
// packages/safe-bash-command-python/src/provisioning.ts
|
|
107
337
|
import { sha256 } from "@noble/hashes/sha2.js";
|
|
108
|
-
import { resolvePath as resolve, dirname } from "../../safe-bash-contracts/path.js";
|
|
338
|
+
import { resolvePath as resolve, dirname, basename as basename2 } from "../../safe-bash-contracts/path.js";
|
|
109
339
|
import { inheritYieldCheckpoint } from "../../safe-bash-contracts/yield.js";
|
|
110
340
|
|
|
111
341
|
// packages/safe-bash-command-python/src/manifest.ts
|
|
@@ -286,6 +516,10 @@ function createPythonPackageEnvironment(options = {}) {
|
|
|
286
516
|
};
|
|
287
517
|
function release(session, all = false) {
|
|
288
518
|
const artifacts = all ? [...session.retained.values()] : [];
|
|
519
|
+
if (all && session.wheelIndex) {
|
|
520
|
+
artifacts.push(session.wheelIndex);
|
|
521
|
+
session.wheelIndex = void 0;
|
|
522
|
+
}
|
|
289
523
|
if (all) session.retained.clear();
|
|
290
524
|
if (session.opened) {
|
|
291
525
|
artifacts.push(session.opened);
|
|
@@ -311,18 +545,20 @@ function createPythonPackageEnvironment(options = {}) {
|
|
|
311
545
|
const context = { ...input, signal };
|
|
312
546
|
signal.throwIfAborted();
|
|
313
547
|
const directory = options.cacheDirectory === void 0 ? void 0 : resolve(context.cwd, options.cacheDirectory, pythonPackageRuntimeKey);
|
|
314
|
-
const
|
|
548
|
+
const noCache = context.noCache ?? options.noCache ?? false;
|
|
549
|
+
const artifactDirectory = directory ?? (!options.cache && !noCache ? resolve(context.cwd, ".python-packages", "cache", pythonPackageRuntimeKey) : void 0);
|
|
550
|
+
const cache = options.cache ?? (artifactDirectory === void 0 ? defaultCache : {
|
|
315
551
|
async get(key) {
|
|
316
552
|
try {
|
|
317
|
-
return await context.fs.readFile(resolve(
|
|
553
|
+
return await context.fs.readFile(resolve(artifactDirectory, key), { signal });
|
|
318
554
|
} catch (error) {
|
|
319
555
|
if (missing(error)) return void 0;
|
|
320
556
|
throw error;
|
|
321
557
|
}
|
|
322
558
|
},
|
|
323
559
|
async set(key, bytes) {
|
|
324
|
-
await context.fs.mkdir(
|
|
325
|
-
await context.fs.writeFile(resolve(
|
|
560
|
+
await context.fs.mkdir(artifactDirectory, { recursive: true, signal });
|
|
561
|
+
await context.fs.writeFile(resolve(artifactDirectory, key), bytes, { signal });
|
|
326
562
|
}
|
|
327
563
|
});
|
|
328
564
|
const manifestCache = options.cacheDirectory === void 0 ? defaultCache : cache;
|
|
@@ -384,7 +620,7 @@ function createPythonPackageEnvironment(options = {}) {
|
|
|
384
620
|
}
|
|
385
621
|
};
|
|
386
622
|
const offline = context.offline ?? options.offline ?? false;
|
|
387
|
-
sessions.set(session, { ...context, cacheDirectory: directory,
|
|
623
|
+
sessions.set(session, { ...context, cacheDirectory: directory, artifactDirectory, noCache, cache, manifestCache, manifestRevision, controller: invocation, offline, requirements: unique, opening: false, retained: /* @__PURE__ */ new Map(), closed: false, manifest, aborted });
|
|
388
624
|
signal.addEventListener("abort", aborted, { once: true });
|
|
389
625
|
const controls = {};
|
|
390
626
|
for (const key of ["pre", "upgrade", "forceReinstall"]) if (context[key] ?? options[key]) controls[key] = true;
|
|
@@ -426,6 +662,22 @@ function createPythonPackageEnvironment(options = {}) {
|
|
|
426
662
|
options.onProgress?.({ phase: "installed" });
|
|
427
663
|
return null;
|
|
428
664
|
}
|
|
665
|
+
if (op === "package-index") {
|
|
666
|
+
const operation = args[1];
|
|
667
|
+
if (operation === "start") {
|
|
668
|
+
if (session.wheelIndex) throw failure("Python wheel index already open");
|
|
669
|
+
session.wheelIndex = new PythonWheelIndex({ ...session, cwd: session.cacheDirectory ? dirname(session.cacheDirectory) : session.cwd });
|
|
670
|
+
return null;
|
|
671
|
+
}
|
|
672
|
+
if (operation === "close") {
|
|
673
|
+
const index = session.wheelIndex;
|
|
674
|
+
session.wheelIndex = void 0;
|
|
675
|
+
await index?.close();
|
|
676
|
+
return null;
|
|
677
|
+
}
|
|
678
|
+
if (!session.wheelIndex) throw failure("Python wheel index is closed");
|
|
679
|
+
return session.wheelIndex.execute(operation, args.slice(2));
|
|
680
|
+
}
|
|
429
681
|
if (op === "package-read" || op === "package-read-retained") {
|
|
430
682
|
const artifact = op === "package-read" ? session.opened : session.retained.get(String(args[1])), offset = args[2], length = args[3];
|
|
431
683
|
if (!artifact || op === "package-read" && artifact.key !== String(args[1]) || !Number.isSafeInteger(offset) || !Number.isSafeInteger(length) || offset < 0 || length < 1 || length > 65536) throw failure("Invalid package chunk request");
|
|
@@ -434,24 +686,65 @@ function createPythonPackageEnvironment(options = {}) {
|
|
|
434
686
|
return Array.from(bytes);
|
|
435
687
|
}
|
|
436
688
|
if (op === "package-retain") {
|
|
437
|
-
|
|
689
|
+
let artifact = session.opened;
|
|
438
690
|
if (!artifact || artifact.key !== String(args[1])) throw failure("Invalid package retention request");
|
|
691
|
+
if (artifact.url && artifact.close) {
|
|
692
|
+
const source = artifact;
|
|
693
|
+
const retaining = (async () => {
|
|
694
|
+
const path = decodeURIComponent(new URL(source.url).pathname);
|
|
695
|
+
const directory = resolve(session.cacheDirectory ?? resolve(session.cwd, ".python-packages"), "installed");
|
|
696
|
+
const capabilities = await session.fs.capabilitiesFor?.(directory, { signal: session.signal }) ?? session.fs.capabilities;
|
|
697
|
+
if (!session.fs.confineExtraction || !session.fs.prepareDirectory || !capabilities.retainedStagingWrite || !capabilities.retainedStagingCleanup || !capabilities.retainedRead || !capabilities.atomicFileStaging) return;
|
|
698
|
+
const target = resolve(directory, source.key, basename2(path));
|
|
699
|
+
if (path !== target) {
|
|
700
|
+
await session.fs.mkdir(directory, { recursive: true, signal: session.signal });
|
|
701
|
+
checkSession(session);
|
|
702
|
+
session.opened = void 0;
|
|
703
|
+
const published = await publishPythonBuildWheel({ filename: basename2(path), artifact: source }, directory, maxBytes, session);
|
|
704
|
+
artifact = await openPythonPackageFile(session, decodeURIComponent(new URL(published.url).pathname), maxBytes);
|
|
705
|
+
if (!artifact) throw failure("Installed Python wheels require retained reads");
|
|
706
|
+
if (artifact.key !== published.digest) {
|
|
707
|
+
await artifact.close?.();
|
|
708
|
+
throw failure("Installed Python wheel changed");
|
|
709
|
+
}
|
|
710
|
+
session.opened = artifact;
|
|
711
|
+
artifact.url = published.url;
|
|
712
|
+
try {
|
|
713
|
+
checkSession(session);
|
|
714
|
+
} catch (error) {
|
|
715
|
+
await release(session);
|
|
716
|
+
throw error;
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
const durable = new URL(artifact.url);
|
|
720
|
+
durable.hash = "sha256=" + artifact.key;
|
|
721
|
+
artifact.url = durable.href;
|
|
722
|
+
})();
|
|
723
|
+
session.retaining = retaining;
|
|
724
|
+
try {
|
|
725
|
+
await retaining;
|
|
726
|
+
} finally {
|
|
727
|
+
session.retaining = void 0;
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
checkSession(session);
|
|
731
|
+
if (!artifact) throw failure("Installed Python wheel unavailable");
|
|
439
732
|
const token = String(++counter);
|
|
440
733
|
session.retained.set(token, artifact);
|
|
441
734
|
session.opened = void 0;
|
|
442
|
-
return { token, key: artifact.key, size: artifact.size };
|
|
735
|
+
return { token, key: artifact.key, size: artifact.size, ...artifact.url ? { url: artifact.url } : {} };
|
|
443
736
|
}
|
|
444
737
|
if (op === "package-close") {
|
|
445
738
|
if (session.opened?.key === String(args[1])) await release(session);
|
|
446
739
|
return null;
|
|
447
740
|
}
|
|
448
741
|
if (op !== "package-open" || typeof args[1] !== "string") throw failure("Invalid package operation");
|
|
449
|
-
if (session.opening) throw failure("Package download already in progress");
|
|
742
|
+
if (session.opening || session.retaining) throw failure("Package download already in progress");
|
|
450
743
|
session.opening = true;
|
|
451
744
|
try {
|
|
452
745
|
await release(session);
|
|
453
746
|
checkSession(session);
|
|
454
|
-
const url = args[1], { cacheDirectory, noCache } = session;
|
|
747
|
+
const url = args[1], { artifactDirectory: cacheDirectory, noCache } = session;
|
|
455
748
|
const expected = args[2];
|
|
456
749
|
let responseUrl = url;
|
|
457
750
|
const verifyIntegrity = (key2) => {
|
|
@@ -466,6 +759,7 @@ function createPythonPackageEnvironment(options = {}) {
|
|
|
466
759
|
let headers = [];
|
|
467
760
|
const adopt = async (artifact, ready) => {
|
|
468
761
|
session.opened = artifact;
|
|
762
|
+
if (canonicalWheel) artifact.url = url;
|
|
469
763
|
try {
|
|
470
764
|
checkSession(session);
|
|
471
765
|
await ready();
|
|
@@ -615,7 +909,7 @@ function createPythonPackageEnvironment(options = {}) {
|
|
|
615
909
|
checkSession(session);
|
|
616
910
|
verifyIntegrity(key);
|
|
617
911
|
const value = bytes;
|
|
618
|
-
session.opened = { key, size: bytes.length, read: (offset, length) => value.subarray(offset, offset + length) };
|
|
912
|
+
session.opened = { key, size: bytes.length, ...canonicalWheel ? { url } : {}, read: (offset, length) => value.subarray(offset, offset + length) };
|
|
619
913
|
return { key, size: bytes.length, headers, url: responseUrl };
|
|
620
914
|
} finally {
|
|
621
915
|
session.opening = false;
|
|
@@ -631,7 +925,14 @@ function createPythonPackageEnvironment(options = {}) {
|
|
|
631
925
|
session.signal.removeEventListener("abort", session.aborted);
|
|
632
926
|
session.controller.abort(failure("Python package session is closed"));
|
|
633
927
|
sessions.delete(start.session);
|
|
634
|
-
|
|
928
|
+
const retired = release(session, true);
|
|
929
|
+
return Promise.allSettled([session.retaining, retired]).then(async () => {
|
|
930
|
+
try {
|
|
931
|
+
await retired;
|
|
932
|
+
} finally {
|
|
933
|
+
await release(session, true);
|
|
934
|
+
}
|
|
935
|
+
});
|
|
635
936
|
}
|
|
636
937
|
},
|
|
637
938
|
dispose() {
|
|
@@ -650,7 +951,7 @@ function createPythonPackageEnvironment(options = {}) {
|
|
|
650
951
|
}
|
|
651
952
|
|
|
652
953
|
export {
|
|
653
|
-
|
|
954
|
+
publishPythonBuildWheel,
|
|
654
955
|
PythonPackageConflictError,
|
|
655
956
|
createPythonPackageManifestStore,
|
|
656
957
|
createPythonPackageCache,
|
|
@@ -68,7 +68,7 @@ function parsePythonInvocation(args, env) {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
// packages/safe-bash-command-python/src/package-program.generated.ts
|
|
71
|
-
var pythonPackageProgramGzip = "H4sIAAAAAAACA7U7a4/cNpLf9Su4uMVKijVy4j0vdhtoJEbs3BlInNzY2SDX7hU4EnuaGbWkkGyPO5P574cqvvWYae8hn7pFkVXFYr2LatiOCEabSvZHUbOqF/yad5lgvx6ZVPkqIfww9EIRwQryi+y7hOxEfyBH0bb8qhyokMxOOYpWDi1XBfw7dvg/IRowWRMDc5PqkXSbEL4zr0upqFDylqt9lj5NAa/GM1C1b/mVRfEDVfuEeJjwnOmnvKSyOgqe5QngJ2tHj52QkI6ptq/1q1I/IBHpVynhnXkNuGvBGtYpTltZkH0vFVmbt6UGmX6VFuSLPCGwvOuBP+WBqnqfifRf7//8/m7z4uJ/6cVvn1/846LaPnl/n63mRvMv/5wWIbZ85YkEvAkRTB5bwH+XHkWbrgLmZhnsQ9Z7dmCFWYfML4Ft+t+vRyZOBUnTPL9PiDxeNVywWvXihEdSSkYFUr35j79sw9frbPOvv2w/y9OCOP7BeQVTVoa4TRqOpluyjqaV16I/Dhlwi3e7HrZyn3i+GakI1sMJ7Kncs2ZEYyb39Ivf5Z4+e/af8PPXv+PPs+d/g5/nXzz7/dA8z9fZhl7sPr/4x/ZJRD2g1GBXSMgmhSckVw87QskTkq5T8iQef5YnbsMNFxXASAHo3B4IayUjKRDOPzA9FzDBHwCjjqJDhSqb42GQmQYM1ApV3b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FcoeDuhP8GCQZAd+vVfkipED7Y7QAye0aaD9Atecg03no/6m94DniQgJjtMQrY88NS0bv6e42hkiOhNTiAuBBYhG7eCzIP4g+pqxhmQ/P+3yL4mhWK+hnbxFlzj7/UHLOwbXlXQJOy/b/pbpNDZgpQHBO5KlJ8DXpfjtptm0baecR+vP/RFuoMih7yQjGTBCsMGKm0aF+XdObqk2LthK2hG1Z/4rGwtBrsipIF1BLP/GVK/XQK8tvTubZOocbX8N3475KocZcMYHnnVEEb4GrfkW32T+cn2Uw9KrNuhSaiilHQ+ujcy+D/qBcXrhTEa2CXV2O39FZAo1Js/R+6lp4pj886y5vQccLzG3Vd/0Co00Ok4EPVApYZVOxc5I0I1NIg3XFgRqxy1T8351NjsB+msqmmxpMgY6cZ/9IdPv0rg/4E7KHx3VOVFjDeY6cx8jRGzJ4zB53AgP+WynmrxLR46259DRNijLb7bJubdb/OjizYb5olDwUYxfPRfhjcpn0VUU2phCW1S4m9bLArUx24/lyVPgr7GH662pjkAv+nQHbdmtBwRFzB9fJ5kpizvoaICcpnonGjYTI95PbQdyD76yMm3xG3bCyAkZoD881V4SpRfe8o5sUmuxLv6pZRtcDB5rQdJgyKQT8kLbjGgIaovGi37gDZMXr7D8oavvGrMTBrMprC2DGb5hp4Jstnn+CBPHDCvmdl+QqCaKHdLU+eaCfPZo7FUsyOSkDru1KniukltVfUI2cf4c2hS9M3cLpIt7ee5qiWkB6M70nK5tR+25R2iLOD5uzp3r0+zVhNrHAtd1Yv+Udd/CBZ8sT/4PYSKnnZ1EAAA=";
|
|
72
72
|
|
|
73
73
|
// packages/safe-bash-command-python/src/package-program.ts
|
|
74
74
|
var decoded;
|
|
@@ -77,7 +77,7 @@ function loadPythonPackageProgram() {
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
// packages/safe-bash-command-python/src/native-wheel.generated.ts
|
|
80
|
-
var pythonNativeWheelGzip = "
|
|
80
|
+
var pythonNativeWheelGzip = "H4sIAAAAAAACA60aXXPctvH9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+y3omGiMRillkTq+iqb665ymQy7flXibunCXiGqZ314VNnChyHD6warpIrq+F45Vi/LtCtv0iifFX5Qmwlo7CJ44TkccxfMdwQis8nJWU38lkyDnljH1dI7jOtopoEGX/lreJQx/nBJs5zf49d8PZB8YXEl1xlhZ7alt/ZW6Pitut9l3IoK43G32kGY3mAaA4nzc0d6n7zC1dZh3vPOmKG2bbv9269UonraHUUXyOz8C9PKOizpHqKgQccac1ZtnngY8ITl83u+8ITLxx/2eZ/4PnXC6EoAAA=";
|
|
81
81
|
|
|
82
82
|
// packages/safe-bash-command-python/src/native-wheel.ts
|
|
83
83
|
var decoded2;
|
|
@@ -138,15 +138,33 @@ async function installPythonPackages(supplied, start, request, maxTransferBytes)
|
|
|
138
138
|
}
|
|
139
139
|
});
|
|
140
140
|
const wheel = async (size, read, configuration) => {
|
|
141
|
-
const globals = ["_safe_native_wheel_read", "_safe_native_wheel_config", "_safe_extract_native_wheel"];
|
|
141
|
+
const globals = ["_safe_native_wheel_read", "_safe_native_wheel_config", "_safe_extract_native_wheel", "_safe_native_wheel_index"];
|
|
142
|
+
let indexed = false;
|
|
142
143
|
try {
|
|
143
144
|
runtime.globals.set(globals[0], read);
|
|
145
|
+
runtime.globals.set(globals[3], (operation, ...args) => {
|
|
146
|
+
if (operation === "start") indexed = true;
|
|
147
|
+
const failed = (error) => {
|
|
148
|
+
transportFailure ??= { error };
|
|
149
|
+
throw error;
|
|
150
|
+
};
|
|
151
|
+
try {
|
|
152
|
+
const result2 = request("package-index", start.session, operation, ...args);
|
|
153
|
+
return result2 instanceof Promise ? result2.catch(failed) : result2;
|
|
154
|
+
} catch (error) {
|
|
155
|
+
return failed(error);
|
|
156
|
+
}
|
|
157
|
+
});
|
|
144
158
|
runtime.globals.set(globals[1], JSON.stringify({ ...configuration, size }));
|
|
145
159
|
const result = JSON.parse(await runtime.runPythonAsync(await loadPythonNativeWheel()));
|
|
146
160
|
if (Array.isArray(result)) for (const path of result) await runtime._api.loadDynlib(path);
|
|
147
161
|
return result;
|
|
148
162
|
} finally {
|
|
149
|
-
|
|
163
|
+
try {
|
|
164
|
+
if (indexed) await request("package-index", start.session, "close");
|
|
165
|
+
} finally {
|
|
166
|
+
for (const name of globals) runtime.globals.delete(name);
|
|
167
|
+
}
|
|
150
168
|
}
|
|
151
169
|
};
|
|
152
170
|
const fetch = (url, expected, metadata) => withArtifact(url, expected, metadata, async (opened, read) => {
|
|
@@ -69,11 +69,29 @@ function createSqliteVfs(options) {
|
|
|
69
69
|
if (failed) throw failure;
|
|
70
70
|
signal.throwIfAborted();
|
|
71
71
|
};
|
|
72
|
-
const
|
|
72
|
+
const confined = (name) => {
|
|
73
73
|
const prefix = directory + "/", leaf = name.slice(prefix.length);
|
|
74
74
|
if (!name.startsWith(prefix) || !leaf || leaf.includes("/") || leaf.includes("\0") || leaf === "." || leaf === "..") throw new FsError2("EACCES", { path: name, message: "SQLite file is outside its private directory" });
|
|
75
75
|
return name;
|
|
76
76
|
};
|
|
77
|
+
const visible = /* @__PURE__ */ new Map(), backing = /* @__PURE__ */ new Map();
|
|
78
|
+
for (const { path, name } of options.filenames ?? []) {
|
|
79
|
+
confined(path);
|
|
80
|
+
if (!name.startsWith("/") || name.includes("\0") || name.split("/").slice(1).some((part) => !part || part === "." || part === "..")) throw new RangeError("Invalid SQLite visible filename");
|
|
81
|
+
if (visible.has(path)) throw new TypeError("Duplicate SQLite backing filename");
|
|
82
|
+
visible.set(path, name);
|
|
83
|
+
if (!backing.has(name)) backing.set(name, path);
|
|
84
|
+
}
|
|
85
|
+
const shared = new Set(backing.values());
|
|
86
|
+
const filename = (name) => {
|
|
87
|
+
const exact = backing.get(name);
|
|
88
|
+
if (exact) return exact;
|
|
89
|
+
for (const suffix of ["-journal", "-wal", "-shm"]) if (name.endsWith(suffix)) {
|
|
90
|
+
const path = backing.get(name.slice(0, -suffix.length));
|
|
91
|
+
if (path) return confined(path + suffix);
|
|
92
|
+
}
|
|
93
|
+
return confined(name);
|
|
94
|
+
};
|
|
77
95
|
const entry = (id) => {
|
|
78
96
|
const value = handles.get(id);
|
|
79
97
|
if (!value) throw new FsError2("EBADF", { message: "Unknown SQLite file handle" });
|
|
@@ -128,12 +146,26 @@ function createSqliteVfs(options) {
|
|
|
128
146
|
return task;
|
|
129
147
|
};
|
|
130
148
|
return {
|
|
149
|
+
jFullPathname(name, out) {
|
|
150
|
+
try {
|
|
151
|
+
admit();
|
|
152
|
+
filename(name);
|
|
153
|
+
const value = visible.get(name) ?? name;
|
|
154
|
+
const { read, written } = new TextEncoder().encodeInto(value, out);
|
|
155
|
+
if (read !== value.length || written >= out.length) throw new FsError2("ENAMETOOLONG", { path: value });
|
|
156
|
+
out[written] = 0;
|
|
157
|
+
return 0;
|
|
158
|
+
} catch (error) {
|
|
159
|
+
fail(error);
|
|
160
|
+
return 10;
|
|
161
|
+
}
|
|
162
|
+
},
|
|
131
163
|
async jOpen(name, id, flags, out) {
|
|
132
164
|
return execute(async () => {
|
|
133
165
|
if (handles.has(id) || opening.has(id) || handles.size + opening.size >= maxOpenFiles) throw new FsError2("EMFILE", { message: "SQLite open file limit exceeded" });
|
|
134
166
|
const temporary = name === null;
|
|
135
167
|
const path = filename(name ?? `${directory}/sqlite-temp-${crypto.randomUUID()}`);
|
|
136
|
-
if ([...opening.values()].includes(path) || [...handles.values()].some((value) => value.name === path)) throw new FsError2("EBUSY", { path, message: "SQLite private files require a single connection" });
|
|
168
|
+
if ([...opening.values()].includes(path) || !shared.has(path) && [...handles.values()].some((value) => value.name === path)) throw new FsError2("EBUSY", { path, message: "SQLite private files require a single connection" });
|
|
137
169
|
opening.set(id, path);
|
|
138
170
|
try {
|
|
139
171
|
const file = await open(path, { access: flags & 1 ? "read" : "readwrite", creation: temporary || flags & 16 ? "exclusive" : flags & 4 ? "ifMissing" : "never", noFollow: true, mode: 384, signal });
|