@poe-platform/safe-bash 0.1.629 → 0.1.631

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.
Files changed (377) hide show
  1. package/README.md +2 -2
  2. package/dist/office-package/compression.d.ts +19 -0
  3. package/dist/office-package/compression.js +186 -0
  4. package/dist/office-package/runtime.d.ts +11 -0
  5. package/dist/office-package/runtime.js +28 -0
  6. package/dist/safe-bash/chunks/{bz2-B2RXT4EX.js → bz2-ACU4EOVE.js} +2 -2
  7. package/dist/safe-bash/chunks/chunk-2E4KBFO6.js +239 -0
  8. package/dist/safe-bash/chunks/chunk-2E4KBFO6.js.map +7 -0
  9. package/dist/safe-bash/chunks/chunk-3E5M2WEL.js +33 -0
  10. package/dist/safe-bash/chunks/chunk-3E5M2WEL.js.map +7 -0
  11. package/dist/safe-bash/chunks/{chunk-WPEMUXV4.js → chunk-3LD67SER.js} +12 -10
  12. package/dist/safe-bash/chunks/{chunk-WPEMUXV4.js.map → chunk-3LD67SER.js.map} +1 -1
  13. package/dist/safe-bash/chunks/{chunk-6LSSEOG7.js → chunk-6HNK7Q66.js} +11 -7
  14. package/dist/safe-bash/chunks/{chunk-6LSSEOG7.js.map → chunk-6HNK7Q66.js.map} +1 -1
  15. package/dist/safe-bash/chunks/{chunk-AD7UAP5B.js → chunk-7EEWZY5S.js} +10 -8
  16. package/dist/safe-bash/chunks/{chunk-AD7UAP5B.js.map → chunk-7EEWZY5S.js.map} +1 -1
  17. package/dist/safe-bash/chunks/{chunk-RNKTWFEM.js → chunk-CDBQXRWL.js} +3 -3
  18. package/dist/safe-bash/chunks/{chunk-UYX72YHY.js → chunk-CHHAB5SS.js} +10 -74
  19. package/dist/safe-bash/chunks/{chunk-UYX72YHY.js.map → chunk-CHHAB5SS.js.map} +3 -3
  20. package/dist/safe-bash/chunks/{chunk-KYNRHYHP.js → chunk-EI4X5ETX.js} +15 -13
  21. package/dist/safe-bash/chunks/{chunk-KYNRHYHP.js.map → chunk-EI4X5ETX.js.map} +1 -1
  22. package/dist/safe-bash/chunks/{chunk-KZ7QCYNT.js → chunk-GIBLUW2U.js} +13 -9
  23. package/dist/safe-bash/chunks/{chunk-KZ7QCYNT.js.map → chunk-GIBLUW2U.js.map} +1 -1
  24. package/dist/safe-bash/chunks/chunk-GPV7ZFYS.js +1528 -0
  25. package/dist/safe-bash/chunks/chunk-GPV7ZFYS.js.map +7 -0
  26. package/dist/safe-bash/chunks/{chunk-N5CYTGBN.js → chunk-H3E67KTZ.js} +13 -9
  27. package/dist/safe-bash/chunks/{chunk-N5CYTGBN.js.map → chunk-H3E67KTZ.js.map} +1 -1
  28. package/dist/safe-bash/chunks/{chunk-AFH57PPL.js → chunk-IEKESMO4.js} +3 -3
  29. package/dist/safe-bash/chunks/{chunk-DPJWEGIX.js → chunk-JLBIUYT3.js} +2 -2
  30. package/dist/safe-bash/chunks/chunk-JZDO5MC3.js +77 -0
  31. package/dist/safe-bash/chunks/chunk-JZDO5MC3.js.map +7 -0
  32. package/dist/safe-bash/chunks/{chunk-GFZKQIPL.js → chunk-LA6BX562.js} +8 -6
  33. package/dist/safe-bash/chunks/{chunk-GFZKQIPL.js.map → chunk-LA6BX562.js.map} +1 -1
  34. package/dist/safe-bash/chunks/{chunk-PVJJFCGA.js → chunk-M3GPCYSP.js} +2 -2
  35. package/dist/safe-bash/chunks/{chunk-FWDMJTQO.js → chunk-NDCZ3UBP.js} +13 -9
  36. package/dist/safe-bash/chunks/{chunk-FWDMJTQO.js.map → chunk-NDCZ3UBP.js.map} +1 -1
  37. package/dist/safe-bash/chunks/{chunk-2KL6W6NB.js → chunk-O2EVBRKF.js} +1 -2
  38. package/dist/safe-bash/chunks/chunk-OFT77XIB.js +389 -0
  39. package/dist/safe-bash/chunks/chunk-OFT77XIB.js.map +7 -0
  40. package/dist/safe-bash/chunks/{chunk-PCLOK32J.js → chunk-PC6BEIAF.js} +13 -9
  41. package/dist/safe-bash/chunks/{chunk-PCLOK32J.js.map → chunk-PC6BEIAF.js.map} +1 -1
  42. package/dist/safe-bash/chunks/{chunk-3M5F7LD5.js → chunk-QWKP7ZU7.js} +13 -9
  43. package/dist/safe-bash/chunks/{chunk-3M5F7LD5.js.map → chunk-QWKP7ZU7.js.map} +1 -1
  44. package/dist/safe-bash/chunks/chunk-THXJ6CLF.js +53 -0
  45. package/dist/safe-bash/chunks/chunk-THXJ6CLF.js.map +7 -0
  46. package/dist/safe-bash/chunks/{chunk-HHJSJWUD.js → chunk-V73A742N.js} +57 -15
  47. package/dist/safe-bash/chunks/chunk-V73A742N.js.map +7 -0
  48. package/dist/safe-bash/chunks/{chunk-4BYUV5PA.js → chunk-VN3ZGME3.js} +12 -8
  49. package/dist/safe-bash/chunks/{chunk-4BYUV5PA.js.map → chunk-VN3ZGME3.js.map} +1 -1
  50. package/dist/safe-bash/chunks/chunk-WECHUK3Y.js +4285 -0
  51. package/dist/safe-bash/chunks/chunk-WECHUK3Y.js.map +7 -0
  52. package/dist/safe-bash/chunks/{chunk-X55AMTNM.js → chunk-WIOEUR7D.js} +14 -10
  53. package/dist/safe-bash/chunks/{chunk-X55AMTNM.js.map → chunk-WIOEUR7D.js.map} +1 -1
  54. package/dist/safe-bash/chunks/chunk-WPIOO4NX.js +443 -0
  55. package/dist/safe-bash/chunks/chunk-WPIOO4NX.js.map +7 -0
  56. package/dist/safe-bash/chunks/{chunk-C7QNJ3D4.js → chunk-WYTI64IU.js} +2 -2
  57. package/dist/safe-bash/chunks/{xz-AVXFDXW4.js → xz-U4QDTPZL.js} +2 -2
  58. package/dist/safe-bash/chunks/{zstd-R6RPHJYO.js → zstd-OG5RPYXO.js} +2 -2
  59. package/dist/safe-bash/commands/archive/zip/crc.d.ts +2 -0
  60. package/dist/safe-bash/commands/archive/zip/crc.d.ts.map +1 -0
  61. package/dist/safe-bash/commands/archive/zip/crc.js +7 -0
  62. package/dist/safe-bash/commands/archive/zip/crc.js.map +1 -0
  63. package/dist/safe-bash/commands/archive/zip/crypto.d.ts +4 -0
  64. package/dist/safe-bash/commands/archive/zip/crypto.d.ts.map +1 -0
  65. package/dist/safe-bash/commands/archive/zip/crypto.js +34 -0
  66. package/dist/safe-bash/commands/archive/zip/crypto.js.map +1 -0
  67. package/dist/safe-bash/commands/archive/zip/help.d.ts +3 -0
  68. package/dist/safe-bash/commands/archive/zip/help.d.ts.map +1 -0
  69. package/dist/safe-bash/commands/archive/zip/help.js +87 -0
  70. package/dist/safe-bash/commands/archive/zip/help.js.map +1 -0
  71. package/dist/safe-bash/commands/archive/zip/move.d.ts +12 -0
  72. package/dist/safe-bash/commands/archive/zip/move.d.ts.map +1 -0
  73. package/dist/safe-bash/commands/archive/zip/move.js +60 -0
  74. package/dist/safe-bash/commands/archive/zip/move.js.map +1 -0
  75. package/dist/safe-bash/commands/archive/zip/options.js +5 -5
  76. package/dist/safe-bash/commands/archive/zip/options.js.map +1 -1
  77. package/dist/safe-bash/commands/archive/zip-format.d.ts +1 -1
  78. package/dist/safe-bash/commands/archive/zip-format.d.ts.map +1 -1
  79. package/dist/safe-bash/commands/archive/zip-format.js +14 -17
  80. package/dist/safe-bash/commands/archive/zip-format.js.map +1 -1
  81. package/dist/safe-bash/commands/archive/zip.d.ts.map +1 -1
  82. package/dist/safe-bash/commands/archive/zip.js +45 -15
  83. package/dist/safe-bash/commands/archive/zip.js.map +1 -1
  84. package/dist/safe-bash/commands/bytes/compression/bounded-codec.d.ts +2 -0
  85. package/dist/safe-bash/commands/bytes/compression/bounded-codec.d.ts.map +1 -1
  86. package/dist/safe-bash/commands/bytes/compression/bounded-codec.js +4 -0
  87. package/dist/safe-bash/commands/bytes/compression/bounded-codec.js.map +1 -1
  88. package/dist/safe-bash/commands/bytes/compression/codec.d.ts +4 -24
  89. package/dist/safe-bash/commands/bytes/compression/codec.d.ts.map +1 -1
  90. package/dist/safe-bash/commands/bytes/compression/codec.js +12 -168
  91. package/dist/safe-bash/commands/bytes/compression/codec.js.map +1 -1
  92. package/dist/safe-bash/commands/cmp.js +1 -1
  93. package/dist/safe-bash/commands/cmp.js.map +1 -1
  94. package/dist/safe-bash/commands/csplit/index.browser.js +10 -7
  95. package/dist/safe-bash/commands/docx/index.browser.js +54 -0
  96. package/dist/safe-bash/commands/docx/index.browser.js.map +7 -0
  97. package/dist/safe-bash/commands/docx/index.d.ts +25 -0
  98. package/dist/safe-bash/commands/docx/index.d.ts.map +1 -0
  99. package/dist/safe-bash/commands/docx/index.js +42 -0
  100. package/dist/safe-bash/commands/docx/index.js.map +1 -0
  101. package/dist/safe-bash/commands/docx/io.d.ts +15 -0
  102. package/dist/safe-bash/commands/docx/io.d.ts.map +1 -0
  103. package/dist/safe-bash/commands/docx/io.js +16 -0
  104. package/dist/safe-bash/commands/docx/io.js.map +1 -0
  105. package/dist/safe-bash/commands/factor/index.browser.js +7 -5
  106. package/dist/safe-bash/commands/filesystem.d.ts.map +1 -1
  107. package/dist/safe-bash/commands/filesystem.js +9 -1
  108. package/dist/safe-bash/commands/filesystem.js.map +1 -1
  109. package/dist/safe-bash/commands/getopt/index.browser.js +7 -5
  110. package/dist/safe-bash/commands/hexdump/index.browser.js +8 -6
  111. package/dist/safe-bash/commands/iconv/index.browser.js +8 -6
  112. package/dist/safe-bash/commands/line-endings/index.browser.js +10 -7
  113. package/dist/safe-bash/commands/llm/index.browser.js +10 -8
  114. package/dist/safe-bash/commands/llm/providers/index.browser.js +3 -3
  115. package/dist/safe-bash/commands/network/index.browser.js +11 -8
  116. package/dist/safe-bash/commands/node/browser.d.ts +2 -0
  117. package/dist/safe-bash/commands/node/browser.d.ts.map +1 -0
  118. package/dist/safe-bash/commands/node/browser.js +2 -0
  119. package/dist/safe-bash/commands/node/browser.js.map +1 -0
  120. package/dist/safe-bash/commands/node/index.browser.js +18 -0
  121. package/dist/safe-bash/commands/node/index.browser.js.map +7 -0
  122. package/dist/safe-bash/commands/node/safejs.d.ts +6 -0
  123. package/dist/safe-bash/commands/node/safejs.d.ts.map +1 -1
  124. package/dist/safe-bash/commands/node/safejs.js +25 -1
  125. package/dist/safe-bash/commands/node/safejs.js.map +1 -1
  126. package/dist/safe-bash/commands/op/index.browser.js +3 -3
  127. package/dist/safe-bash/commands/op/index.js +0 -1
  128. package/dist/safe-bash/commands/op/index.js.map +2 -2
  129. package/dist/safe-bash/commands/pptx/index.d.ts +29 -0
  130. package/dist/safe-bash/commands/pptx/index.d.ts.map +1 -0
  131. package/dist/safe-bash/commands/pptx/index.js +153 -0
  132. package/dist/safe-bash/commands/pptx/index.js.map +1 -0
  133. package/dist/safe-bash/commands/pr/index.browser.js +8 -6
  134. package/dist/safe-bash/commands/predicates.js +1 -1
  135. package/dist/safe-bash/commands/python/execution.d.ts +3 -0
  136. package/dist/safe-bash/commands/python/execution.d.ts.map +1 -0
  137. package/dist/safe-bash/commands/python/execution.js +193 -0
  138. package/dist/safe-bash/commands/python/execution.js.map +1 -0
  139. package/dist/safe-bash/commands/python/index.browser.js +21 -0
  140. package/dist/safe-bash/commands/python/index.browser.js.map +7 -0
  141. package/dist/safe-bash/commands/python/index.d.ts +49 -0
  142. package/dist/safe-bash/commands/python/index.d.ts.map +1 -0
  143. package/dist/safe-bash/commands/python/index.js +317 -0
  144. package/dist/safe-bash/commands/python/index.js.map +1 -0
  145. package/dist/safe-bash/commands/python/installation.d.ts +9 -0
  146. package/dist/safe-bash/commands/python/installation.d.ts.map +1 -0
  147. package/dist/safe-bash/commands/python/installation.js +80 -0
  148. package/dist/safe-bash/commands/python/installation.js.map +1 -0
  149. package/dist/safe-bash/commands/python/invocation.d.ts +10 -0
  150. package/dist/safe-bash/commands/python/invocation.d.ts.map +1 -0
  151. package/dist/safe-bash/commands/python/invocation.js +81 -0
  152. package/dist/safe-bash/commands/python/invocation.js.map +1 -0
  153. package/dist/safe-bash/commands/python/node.d.ts +12 -0
  154. package/dist/safe-bash/commands/python/node.d.ts.map +1 -0
  155. package/dist/safe-bash/commands/python/node.js +33 -0
  156. package/dist/safe-bash/commands/python/node.js.map +1 -0
  157. package/dist/safe-bash/commands/python/provisioning-runtime.d.ts +5 -0
  158. package/dist/safe-bash/commands/python/provisioning-runtime.d.ts.map +1 -0
  159. package/dist/safe-bash/commands/python/provisioning-runtime.js +179 -0
  160. package/dist/safe-bash/commands/python/provisioning-runtime.js.map +1 -0
  161. package/dist/safe-bash/commands/python/provisioning.d.ts +49 -0
  162. package/dist/safe-bash/commands/python/provisioning.d.ts.map +1 -0
  163. package/dist/safe-bash/commands/python/provisioning.js +320 -0
  164. package/dist/safe-bash/commands/python/provisioning.js.map +1 -0
  165. package/dist/safe-bash/commands/python/reply.d.ts +3 -0
  166. package/dist/safe-bash/commands/python/reply.d.ts.map +1 -0
  167. package/dist/safe-bash/commands/python/reply.js +103 -0
  168. package/dist/safe-bash/commands/python/reply.js.map +1 -0
  169. package/dist/safe-bash/commands/python/worker.browser.js +736 -0
  170. package/dist/safe-bash/commands/python/worker.browser.js.map +7 -0
  171. package/dist/safe-bash/commands/python/worker.d.ts +47 -0
  172. package/dist/safe-bash/commands/python/worker.d.ts.map +1 -0
  173. package/dist/safe-bash/commands/python/worker.js +373 -0
  174. package/dist/safe-bash/commands/python/worker.js.map +1 -0
  175. package/dist/safe-bash/commands/safejs/index.d.ts +5 -17
  176. package/dist/safe-bash/commands/safejs/index.d.ts.map +1 -1
  177. package/dist/safe-bash/commands/safejs/index.js +3 -202
  178. package/dist/safe-bash/commands/safejs/index.js.map +1 -1
  179. package/dist/safe-bash/commands/safejs/runtime.d.ts +15 -0
  180. package/dist/safe-bash/commands/safejs/runtime.d.ts.map +1 -0
  181. package/dist/safe-bash/commands/safejs/runtime.js +190 -0
  182. package/dist/safe-bash/commands/safejs/runtime.js.map +1 -0
  183. package/dist/safe-bash/commands/tsort/index.browser.js +8 -6
  184. package/dist/safe-bash/commands/xml/index.browser.js +9 -7
  185. package/dist/safe-bash/commands/yq/index.browser.js +10 -8
  186. package/dist/safe-bash/commands/yq/index.d.ts.map +1 -1
  187. package/dist/safe-bash/commands/yq/index.js +32 -4
  188. package/dist/safe-bash/commands/yq/index.js.map +1 -1
  189. package/dist/safe-bash/commands/yq/parser.d.ts.map +1 -1
  190. package/dist/safe-bash/commands/yq/parser.js +21 -5
  191. package/dist/safe-bash/commands/yq/parser.js.map +1 -1
  192. package/dist/safe-bash/contracts/command.d.ts +2 -0
  193. package/dist/safe-bash/contracts/command.d.ts.map +1 -1
  194. package/dist/safe-bash/contracts/command.js +6 -2
  195. package/dist/safe-bash/contracts/command.js.map +1 -1
  196. package/dist/safe-bash/contracts/filesystem-descriptor.d.ts +13 -0
  197. package/dist/safe-bash/contracts/filesystem-descriptor.d.ts.map +1 -0
  198. package/dist/safe-bash/contracts/filesystem-descriptor.js +189 -0
  199. package/dist/safe-bash/contracts/filesystem-descriptor.js.map +1 -0
  200. package/dist/safe-bash/contracts/filesystem-output-budget.d.ts +15 -0
  201. package/dist/safe-bash/contracts/filesystem-output-budget.d.ts.map +1 -0
  202. package/dist/safe-bash/contracts/filesystem-output-budget.js +69 -0
  203. package/dist/safe-bash/contracts/filesystem-output-budget.js.map +1 -0
  204. package/dist/safe-bash/contracts/filesystem-output.d.ts +11 -5
  205. package/dist/safe-bash/contracts/filesystem-output.d.ts.map +1 -1
  206. package/dist/safe-bash/contracts/filesystem-output.js +229 -20
  207. package/dist/safe-bash/contracts/filesystem-output.js.map +1 -1
  208. package/dist/safe-bash/contracts/io.d.ts +29 -0
  209. package/dist/safe-bash/contracts/io.d.ts.map +1 -1
  210. package/dist/safe-bash/contracts/io.js +317 -37
  211. package/dist/safe-bash/contracts/io.js.map +1 -1
  212. package/dist/safe-bash/core.browser.js +5963 -6522
  213. package/dist/safe-bash/core.browser.js.map +4 -4
  214. package/dist/safe-bash/core.d.ts +2 -0
  215. package/dist/safe-bash/core.d.ts.map +1 -1
  216. package/dist/safe-bash/core.js +2 -0
  217. package/dist/safe-bash/core.js.map +1 -1
  218. package/dist/safe-bash/index.d.ts +1 -0
  219. package/dist/safe-bash/index.d.ts.map +1 -1
  220. package/dist/safe-bash/index.js +1 -0
  221. package/dist/safe-bash/index.js.map +1 -1
  222. package/dist/safe-bash/opt-in/commands/cmp/compare.js +95 -0
  223. package/dist/safe-bash/opt-in/commands/cmp/index.d.ts +6 -0
  224. package/dist/safe-bash/opt-in/commands/cmp/index.js +99 -0
  225. package/dist/safe-bash/opt-in/commands/cmp/io.js +218 -0
  226. package/dist/safe-bash/opt-in/commands/cmp/options.d.ts +24 -0
  227. package/dist/safe-bash/opt-in/commands/cmp/options.js +195 -0
  228. package/dist/safe-bash/opt-in/commands/dd/conversions.js +152 -0
  229. package/dist/safe-bash/opt-in/commands/dd/index.d.ts +18 -0
  230. package/dist/safe-bash/opt-in/commands/dd/index.js +561 -0
  231. package/dist/safe-bash/opt-in/commands/dd/io.d.ts +31 -0
  232. package/dist/safe-bash/opt-in/commands/dd/io.js +244 -0
  233. package/dist/safe-bash/opt-in/commands/dd/options.js +184 -0
  234. package/dist/safe-bash/opt-in/commands/dd/report.js +69 -0
  235. package/dist/safe-bash/opt-in/commands/install/arguments.js +224 -0
  236. package/dist/safe-bash/opt-in/commands/install/index.d.ts +6 -0
  237. package/dist/safe-bash/opt-in/commands/install/index.js +678 -0
  238. package/dist/safe-bash/opt-in/commands/install/mode.js +71 -0
  239. package/dist/safe-bash/opt-in/commands/install/options.d.ts +36 -0
  240. package/dist/safe-bash/opt-in/commands/install/options.js +27 -0
  241. package/dist/safe-bash/opt-in/commands/shuf/args.js +179 -0
  242. package/dist/safe-bash/opt-in/commands/shuf/index.d.ts +6 -0
  243. package/dist/safe-bash/opt-in/commands/shuf/index.js +20 -0
  244. package/dist/safe-bash/opt-in/commands/shuf/input.js +93 -0
  245. package/dist/safe-bash/opt-in/commands/shuf/options.d.ts +9 -0
  246. package/dist/safe-bash/opt-in/commands/shuf/options.js +8 -0
  247. package/dist/safe-bash/opt-in/commands/shuf/random.js +114 -0
  248. package/dist/safe-bash/opt-in/commands/shuf/shuf.d.ts +3 -0
  249. package/dist/safe-bash/opt-in/commands/shuf/shuf.js +230 -0
  250. package/dist/safe-bash/opt-in/commands/shuf/usage.js +24 -0
  251. package/dist/safe-bash/opt-in/commands/truncate/arguments.js +186 -0
  252. package/dist/safe-bash/opt-in/commands/truncate/index.d.ts +9 -0
  253. package/dist/safe-bash/opt-in/commands/truncate/index.js +244 -0
  254. package/dist/safe-bash/opt-in/commands/yes/index.d.ts +11 -0
  255. package/dist/safe-bash/opt-in/commands/yes/index.js +167 -0
  256. package/dist/safe-bash/opt-in/commands/yq/arguments.js +177 -0
  257. package/dist/safe-bash/opt-in/commands/yq/evaluate.js +564 -0
  258. package/dist/safe-bash/opt-in/commands/yq/expression.js +183 -0
  259. package/dist/safe-bash/opt-in/commands/yq/inplace.js +65 -0
  260. package/dist/safe-bash/opt-in/commands/yq/mike.d.ts +9 -0
  261. package/dist/safe-bash/opt-in/commands/yq/mike.js +192 -0
  262. package/dist/safe-bash/opt-in/commands/yq/native-encoder.js +165 -0
  263. package/dist/safe-bash/opt-in/commands/yq/native-work.d.ts +44 -0
  264. package/dist/safe-bash/opt-in/commands/yq/native-work.js +188 -0
  265. package/dist/safe-bash/opt-in/commands/yq/nodes.js +621 -0
  266. package/dist/safe-bash/opt-in/entrypoints/arrays.d.ts +1 -0
  267. package/dist/safe-bash/opt-in/entrypoints/arrays.js +1 -0
  268. package/dist/safe-bash/opt-in/entrypoints/cmp.d.ts +2 -0
  269. package/dist/safe-bash/opt-in/entrypoints/cmp.js +1 -0
  270. package/dist/safe-bash/opt-in/entrypoints/dd.d.ts +2 -0
  271. package/dist/safe-bash/opt-in/entrypoints/dd.js +1 -0
  272. package/dist/safe-bash/opt-in/entrypoints/devices.d.ts +2 -0
  273. package/dist/safe-bash/opt-in/entrypoints/devices.js +1 -0
  274. package/dist/safe-bash/opt-in/entrypoints/install.d.ts +2 -0
  275. package/dist/safe-bash/opt-in/entrypoints/install.js +1 -0
  276. package/dist/safe-bash/opt-in/entrypoints/jobs.d.ts +1 -0
  277. package/dist/safe-bash/opt-in/entrypoints/jobs.js +1 -0
  278. package/dist/safe-bash/opt-in/entrypoints/mapfile.d.ts +1 -0
  279. package/dist/safe-bash/opt-in/entrypoints/mapfile.js +1 -0
  280. package/dist/safe-bash/opt-in/entrypoints/read.d.ts +2 -0
  281. package/dist/safe-bash/opt-in/entrypoints/read.js +1 -0
  282. package/dist/safe-bash/opt-in/entrypoints/shuf.d.ts +2 -0
  283. package/dist/safe-bash/opt-in/entrypoints/shuf.js +1 -0
  284. package/dist/safe-bash/opt-in/entrypoints/trap.d.ts +2 -0
  285. package/dist/safe-bash/opt-in/entrypoints/trap.js +1 -0
  286. package/dist/safe-bash/opt-in/entrypoints/truncate.d.ts +2 -0
  287. package/dist/safe-bash/opt-in/entrypoints/truncate.js +1 -0
  288. package/dist/safe-bash/opt-in/entrypoints/yes.d.ts +2 -0
  289. package/dist/safe-bash/opt-in/entrypoints/yes.js +1 -0
  290. package/dist/safe-bash/opt-in/entrypoints/yq.d.ts +3 -0
  291. package/dist/safe-bash/opt-in/entrypoints/yq.js +1 -0
  292. package/dist/safe-bash/opt-in/fs/devices/index.d.ts +8 -0
  293. package/dist/safe-bash/opt-in/fs/devices/index.js +292 -0
  294. package/dist/safe-bash/opt-in/optional.d.ts +28 -0
  295. package/dist/safe-bash/opt-in/optional.js +14 -0
  296. package/dist/safe-bash/opt-in/shell/extensions/arrays/index.d.ts +2 -0
  297. package/dist/safe-bash/opt-in/shell/extensions/arrays/index.js +4 -0
  298. package/dist/safe-bash/opt-in/shell/extensions/jobs/index.d.ts +2 -0
  299. package/dist/safe-bash/opt-in/shell/extensions/jobs/index.js +291 -0
  300. package/dist/safe-bash/opt-in/shell/extensions/jobs/state.js +374 -0
  301. package/dist/safe-bash/opt-in/shell/extensions/mapfile/index.d.ts +24 -0
  302. package/dist/safe-bash/opt-in/shell/extensions/mapfile/index.js +338 -0
  303. package/dist/safe-bash/opt-in/shell/extensions/read/index.d.ts +5 -0
  304. package/dist/safe-bash/opt-in/shell/extensions/read/index.js +351 -0
  305. package/dist/safe-bash/opt-in/shell/extensions/trap/index.d.ts +9 -0
  306. package/dist/safe-bash/opt-in/shell/extensions/trap/index.js +210 -0
  307. package/dist/safe-bash/optional-host.d.ts +5 -0
  308. package/dist/safe-bash/optional-host.d.ts.map +1 -0
  309. package/dist/safe-bash/optional-host.js +3 -0
  310. package/dist/safe-bash/optional-host.js.map +1 -0
  311. package/dist/safe-bash/shell/arrays/bindings.d.ts +15 -5
  312. package/dist/safe-bash/shell/arrays/bindings.d.ts.map +1 -1
  313. package/dist/safe-bash/shell/arrays/bindings.js +131 -23
  314. package/dist/safe-bash/shell/arrays/bindings.js.map +1 -1
  315. package/dist/safe-bash/shell/arrays/ledger.d.ts +1 -0
  316. package/dist/safe-bash/shell/arrays/ledger.d.ts.map +1 -1
  317. package/dist/safe-bash/shell/arrays/ledger.js +19 -0
  318. package/dist/safe-bash/shell/arrays/ledger.js.map +1 -1
  319. package/dist/safe-bash/shell/arrays/state.d.ts.map +1 -1
  320. package/dist/safe-bash/shell/arrays/state.js +3 -1
  321. package/dist/safe-bash/shell/arrays/state.js.map +1 -1
  322. package/dist/safe-bash/shell/arrays/syntax.d.ts +4 -1
  323. package/dist/safe-bash/shell/arrays/syntax.d.ts.map +1 -1
  324. package/dist/safe-bash/shell/arrays/syntax.js +3 -3
  325. package/dist/safe-bash/shell/arrays/syntax.js.map +1 -1
  326. package/dist/safe-bash/shell/conditional.js +1 -1
  327. package/dist/safe-bash/shell/descriptors.d.ts +31 -0
  328. package/dist/safe-bash/shell/descriptors.d.ts.map +1 -0
  329. package/dist/safe-bash/shell/descriptors.js +234 -0
  330. package/dist/safe-bash/shell/descriptors.js.map +1 -0
  331. package/dist/safe-bash/shell/diagnostic-name-ranges.d.ts +2 -0
  332. package/dist/safe-bash/shell/diagnostic-name-ranges.d.ts.map +1 -0
  333. package/dist/safe-bash/shell/diagnostic-name-ranges.js +717 -0
  334. package/dist/safe-bash/shell/diagnostic-name-ranges.js.map +1 -0
  335. package/dist/safe-bash/shell/diagnostic-name.d.ts +3 -0
  336. package/dist/safe-bash/shell/diagnostic-name.d.ts.map +1 -0
  337. package/dist/safe-bash/shell/diagnostic-name.js +89 -0
  338. package/dist/safe-bash/shell/diagnostic-name.js.map +1 -0
  339. package/dist/safe-bash/shell/display.js +1 -1
  340. package/dist/safe-bash/shell/display.js.map +1 -1
  341. package/dist/safe-bash/shell/extensions.d.ts +188 -0
  342. package/dist/safe-bash/shell/extensions.d.ts.map +1 -0
  343. package/dist/safe-bash/shell/extensions.js +141 -0
  344. package/dist/safe-bash/shell/extensions.js.map +1 -0
  345. package/dist/safe-bash/shell/input.d.ts +66 -14
  346. package/dist/safe-bash/shell/input.d.ts.map +1 -1
  347. package/dist/safe-bash/shell/input.js +947 -173
  348. package/dist/safe-bash/shell/input.js.map +1 -1
  349. package/dist/safe-bash/shell/parser.d.ts +38 -6
  350. package/dist/safe-bash/shell/parser.d.ts.map +1 -1
  351. package/dist/safe-bash/shell/parser.js +339 -52
  352. package/dist/safe-bash/shell/parser.js.map +1 -1
  353. package/dist/safe-bash/shell/runtime.d.ts +92 -20
  354. package/dist/safe-bash/shell/runtime.d.ts.map +1 -1
  355. package/dist/safe-bash/shell/runtime.js +2547 -689
  356. package/dist/safe-bash/shell/runtime.js.map +1 -1
  357. package/dist/safe-bash/shell/shell.d.ts.map +1 -1
  358. package/dist/safe-bash/shell/shell.js +52 -21
  359. package/dist/safe-bash/shell/shell.js.map +1 -1
  360. package/dist/safe-bash/shell/types.d.ts +4 -0
  361. package/dist/safe-bash/shell/types.d.ts.map +1 -1
  362. package/dist/safe-bash/shell/types.js.map +1 -1
  363. package/package.json +99 -5
  364. package/dist/safe-bash/chunks/chunk-4DBWBEU7.js +0 -194
  365. package/dist/safe-bash/chunks/chunk-4DBWBEU7.js.map +0 -7
  366. package/dist/safe-bash/chunks/chunk-CXMIIXJA.js +0 -178
  367. package/dist/safe-bash/chunks/chunk-CXMIIXJA.js.map +0 -7
  368. package/dist/safe-bash/chunks/chunk-HHJSJWUD.js.map +0 -7
  369. /package/dist/safe-bash/chunks/{bz2-B2RXT4EX.js.map → bz2-ACU4EOVE.js.map} +0 -0
  370. /package/dist/safe-bash/chunks/{chunk-RNKTWFEM.js.map → chunk-CDBQXRWL.js.map} +0 -0
  371. /package/dist/safe-bash/chunks/{chunk-AFH57PPL.js.map → chunk-IEKESMO4.js.map} +0 -0
  372. /package/dist/safe-bash/chunks/{chunk-DPJWEGIX.js.map → chunk-JLBIUYT3.js.map} +0 -0
  373. /package/dist/safe-bash/chunks/{chunk-PVJJFCGA.js.map → chunk-M3GPCYSP.js.map} +0 -0
  374. /package/dist/safe-bash/chunks/{chunk-2KL6W6NB.js.map → chunk-O2EVBRKF.js.map} +0 -0
  375. /package/dist/safe-bash/chunks/{chunk-C7QNJ3D4.js.map → chunk-WYTI64IU.js.map} +0 -0
  376. /package/dist/safe-bash/chunks/{xz-AVXFDXW4.js.map → xz-U4QDTPZL.js.map} +0 -0
  377. /package/dist/safe-bash/chunks/{zstd-R6RPHJYO.js.map → zstd-OG5RPYXO.js.map} +0 -0
@@ -0,0 +1,317 @@
1
+ import { PythonFileSystem, PythonStatTranslator } from "@poe-platform/safe-fs/core";
2
+ import { validateExitCode } from '../../contracts/command.js';
3
+ import { openCommandFile } from '../../contracts/filesystem-descriptor.js';
4
+ import { encodePythonReply } from './reply.js';
5
+ import { parsePythonInvocation, PythonInvocationError } from './invocation.js';
6
+ import { parsePythonInstallation, pythonInstallationHelp } from './installation.js';
7
+ import { createPythonPackageEnvironment } from './provisioning.js';
8
+ import { readBytes, writeBytes } from '../../contracts/io.js';
9
+ import { createOutputOperation } from '../../contracts/output.js';
10
+ import { inheritYieldCheckpoint, yieldTurn } from '../../contracts/yield.js';
11
+ class PythonInputChunkError extends RangeError {
12
+ }
13
+ export function createPythonCommands(options) {
14
+ if (typeof options?.createWorker !== 'function')
15
+ throw new TypeError('Python requires an explicit interpreter worker factory');
16
+ const maxTransferBytes = options.maxTransferBytes ?? 65536;
17
+ const maxOpenFiles = options.maxOpenFiles ?? 256;
18
+ const maxConcurrentWorkers = options.maxConcurrentWorkers ?? 4;
19
+ const maxInputChunkBytes = options.maxInputChunkBytes ?? 1048576;
20
+ if (!Number.isSafeInteger(maxConcurrentWorkers) || maxConcurrentWorkers < 1 || maxConcurrentWorkers > 64)
21
+ throw new RangeError('Invalid Python worker concurrency limit');
22
+ if (!Number.isSafeInteger(maxInputChunkBytes) || maxInputChunkBytes < 1 || maxInputChunkBytes > 16777216)
23
+ throw new RangeError('Invalid Python input chunk limit');
24
+ let activeWorkers = 0;
25
+ for (const size of [maxTransferBytes, maxOpenFiles])
26
+ if (!Number.isSafeInteger(size) || size < 1 || size > 1048576)
27
+ throw new RangeError('Invalid Python resource limit');
28
+ const runtimeMount = options.runtimeMount ?? '/.pyodide-runtime';
29
+ if (!runtimeMount.startsWith('/') || runtimeMount === '/' || runtimeMount.slice(1).includes('/') || runtimeMount.includes('\0') || runtimeMount.split('/').some(part => part === '..' || part === '.'))
30
+ throw new TypeError('Python runtime mount must be an absolute top-level canonical path');
31
+ const environment = createPythonPackageEnvironment({
32
+ ...options.provisioning,
33
+ requirements: [...(options.provisioning?.requirements ?? []), ...(options.packages ?? [])],
34
+ requirementFiles: [...(options.provisioning?.requirementFiles ?? []), ...(options.requirements ?? [])],
35
+ ...(options.packageProfile ? { profile: options.packageProfile } : {}),
36
+ });
37
+ const execute = async (context) => {
38
+ let installation;
39
+ try {
40
+ parsePythonInvocation(context.args, context.env);
41
+ installation = parsePythonInstallation(context.args);
42
+ }
43
+ catch (error) {
44
+ if (!(error instanceof PythonInvocationError))
45
+ throw error;
46
+ await writeBytes(context.stderr, new TextEncoder().encode('python: ' + error.message + '\n'), context.signal);
47
+ return { exitCode: 2 };
48
+ }
49
+ if (installation?.help) {
50
+ await writeBytes(context.stdout, new TextEncoder().encode(pythonInstallationHelp), context.signal);
51
+ return { exitCode: 0 };
52
+ }
53
+ context.signal.throwIfAborted();
54
+ if (activeWorkers >= maxConcurrentWorkers) {
55
+ await writeBytes(context.stderr, new TextEncoder().encode('python: worker capacity exhausted\n'), context.signal);
56
+ return { exitCode: 1 };
57
+ }
58
+ const controller = new AbortController();
59
+ const signal = AbortSignal.any([context.signal, controller.signal]);
60
+ inheritYieldCheckpoint(context.signal, signal);
61
+ // The service is the single registered owner of descriptors and late acquisition.
62
+ const fileContext = { ...context, descriptorCleanup: "caller" };
63
+ const metadata = new PythonStatTranslator();
64
+ const service = new PythonFileSystem(context.fs, { cwd: context.cwd, signal, maxTransferBytes, maxOpenFiles,
65
+ open: (path, settings) => openCommandFile(fileContext, path, settings) });
66
+ let stdoutOperation;
67
+ let stderrOperation;
68
+ let endpoint;
69
+ let packages;
70
+ let unsubscribe;
71
+ let admitted = false;
72
+ let closed = false;
73
+ let closing;
74
+ const pending = new Set();
75
+ const input = readBytes(context.stdin, signal)[Symbol.asyncIterator]();
76
+ let fragment;
77
+ let offset = 0;
78
+ let inputBytes = 0;
79
+ let rejectRun;
80
+ const close = () => {
81
+ if (closing)
82
+ return closing;
83
+ let finish;
84
+ let fail;
85
+ closing = new Promise((resolve, reject) => { finish = resolve; fail = reject; });
86
+ closed = true;
87
+ controller.abort(new Error('Python invocation retired'));
88
+ void (async () => {
89
+ signal.removeEventListener('abort', aborted);
90
+ const subscription = Promise.resolve().then(() => unsubscribe?.());
91
+ const termination = Promise.resolve().then(() => endpoint?.terminate());
92
+ const results = await Promise.allSettled([subscription, termination, service.close(), stdoutOperation?.close(), stderrOperation?.close(), ...pending]);
93
+ await input.return?.(undefined);
94
+ fragment = undefined;
95
+ if (packages)
96
+ environment.finish(packages);
97
+ for (const result of results)
98
+ if (result.status === 'rejected')
99
+ throw result.reason;
100
+ })().then(() => {
101
+ if (admitted) {
102
+ activeWorkers--;
103
+ admitted = false;
104
+ }
105
+ finish();
106
+ }, reason => {
107
+ // A failed termination cannot establish retirement: retain its capacity slot.
108
+ fail(reason);
109
+ });
110
+ return closing;
111
+ };
112
+ const aborted = () => { rejectRun?.(signal.reason); };
113
+ context.registerCleanup?.(close);
114
+ let primary;
115
+ let result = 1;
116
+ try {
117
+ signal.throwIfAborted();
118
+ activeWorkers++;
119
+ admitted = true;
120
+ const outputContext = { signal, ...(context.registerCleanup ? { registerCleanup: context.registerCleanup } : {}) };
121
+ stdoutOperation = createOutputOperation(outputContext, context.stdout);
122
+ stderrOperation = createOutputOperation(outputContext, context.stderr);
123
+ if (typeof SharedArrayBuffer !== 'function')
124
+ throw new Error('Python worker filesystem requires SharedArrayBuffer');
125
+ const shared = new SharedArrayBuffer(8 + maxTransferBytes * 6 + 65536);
126
+ const control = new Int32Array(shared, 0, 2);
127
+ const payload = new Uint8Array(shared, 8);
128
+ const reply = (value, status) => {
129
+ if (closed)
130
+ return;
131
+ let bytes;
132
+ try {
133
+ bytes = encodePythonReply(value, payload.length);
134
+ }
135
+ catch (error) {
136
+ if (typeof error !== 'object' || error === null || !('code' in error) || error.code !== 'EFBIG')
137
+ throw error;
138
+ bytes = encodePythonReply({ code: 'EFBIG' }, payload.length);
139
+ status = 2;
140
+ }
141
+ payload.set(bytes);
142
+ Atomics.store(control, 1, bytes.length);
143
+ Atomics.store(control, 0, status);
144
+ Atomics.notify(control, 0);
145
+ };
146
+ const dispatch = async (request) => {
147
+ signal.throwIfAborted();
148
+ if (request.op.startsWith('package-'))
149
+ return environment.dispatch(request.op, request.args, { fs: context.fs, cwd: context.cwd, signal });
150
+ if (request.op === 'stdin') {
151
+ const length = request.args[0];
152
+ if (!Number.isSafeInteger(length) || length < 1 || length > maxTransferBytes)
153
+ throw new RangeError('Invalid Python input request');
154
+ let pulls = 0;
155
+ while (!fragment || offset === fragment.length) {
156
+ if (++pulls % 128 === 0)
157
+ await yieldTurn(signal);
158
+ const next = await input.next();
159
+ if (next.done)
160
+ return [];
161
+ inputBytes += next.value.length;
162
+ context.inputBudget?.check(inputBytes);
163
+ if (next.value.length > maxInputChunkBytes)
164
+ throw new PythonInputChunkError('Python input chunk exceeds maxInputChunkBytes');
165
+ // The retained fragment owns its bytes before producer advancement/finalization.
166
+ fragment = Uint8Array.from(next.value);
167
+ offset = 0;
168
+ }
169
+ const end = Math.min(fragment.length, offset + length);
170
+ const bytes = Array.from(fragment.subarray(offset, end));
171
+ offset = end;
172
+ return bytes;
173
+ }
174
+ if (request.op === 'stdout' || request.op === 'stderr') {
175
+ const bytes = request.args[0];
176
+ if (!Array.isArray(bytes) || bytes.length > maxTransferBytes || bytes.some(value => !Number.isInteger(value) || value < 0 || value > 255))
177
+ throw new TypeError('Invalid Python output bytes');
178
+ const operation = request.op === 'stdout' ? stdoutOperation : stderrOperation;
179
+ await writeBytes(operation.output, Uint8Array.from(bytes), signal);
180
+ return bytes.length;
181
+ }
182
+ const value = await service.dispatch(request);
183
+ return request.op === 'stat' || request.op === 'lstat' || request.op === 'fstat'
184
+ ? metadata.translate(value) : value;
185
+ };
186
+ options.onProgress?.({ phase: 'initializing', command: context.command });
187
+ const preparation = environment.prepare({ fs: context.fs, cwd: context.cwd, signal,
188
+ ...(installation ? { requirements: installation.packages, requirementFiles: installation.requirements } : {}),
189
+ }).then(value => { packages = value; });
190
+ pending.add(preparation);
191
+ try {
192
+ await preparation;
193
+ }
194
+ finally {
195
+ pending.delete(preparation);
196
+ }
197
+ signal.throwIfAborted();
198
+ endpoint = options.createWorker();
199
+ signal.throwIfAborted();
200
+ result = await new Promise((resolve, reject) => {
201
+ let settled = false;
202
+ const fail = (reason) => { settled = true; reject(reason); };
203
+ rejectRun = fail;
204
+ signal.addEventListener('abort', aborted, { once: true });
205
+ unsubscribe = endpoint.subscribe(value => {
206
+ if (closed || settled)
207
+ return;
208
+ if (typeof value !== 'object' || value === null) {
209
+ fail(new TypeError('Invalid Python worker message'));
210
+ return;
211
+ }
212
+ const message = value;
213
+ if (message.type === 'ready') {
214
+ try {
215
+ options.onProgress?.({ phase: 'ready', command: context.command });
216
+ }
217
+ catch (error) {
218
+ fail(error);
219
+ }
220
+ return;
221
+ }
222
+ if (message.type === 'exit') {
223
+ if (pending.size) {
224
+ fail(new TypeError('Python worker exited with an outstanding request'));
225
+ return;
226
+ }
227
+ try {
228
+ const status = validateExitCode(message.exitCode);
229
+ settled = true;
230
+ resolve(status);
231
+ }
232
+ catch (error) {
233
+ fail(error);
234
+ }
235
+ return;
236
+ }
237
+ if (message.type === 'error') {
238
+ settled = true;
239
+ const diagnostic = 'python: ' + (typeof message.message === 'string' ? message.message : 'Python worker failed') + '\n';
240
+ const work = writeBytes(stderrOperation.output, new TextEncoder().encode(diagnostic), signal).then(() => { pending.delete(work); resolve(1); }, error => { pending.delete(work); reject(error); });
241
+ pending.add(work);
242
+ return;
243
+ }
244
+ if (typeof message.op !== 'string' || !Array.isArray(message.args) || pending.size) {
245
+ fail(new TypeError('Invalid concurrent Python worker request'));
246
+ return;
247
+ }
248
+ const work = dispatch({ op: message.op, args: message.args }).then(value => { pending.delete(work); reply(value, 1); }, error => {
249
+ pending.delete(work);
250
+ if (signal.aborted) {
251
+ fail(signal.reason);
252
+ return;
253
+ }
254
+ if (typeof message.op === 'string' && message.op.startsWith('package-')) {
255
+ reply({ code: 'EPACKAGE', message: error instanceof Error ? error.message : String(error) }, 2);
256
+ return;
257
+ }
258
+ if (typeof error !== 'object' || error === null || !('code' in error) || typeof error.code !== 'string') {
259
+ fail(error);
260
+ return;
261
+ }
262
+ reply({ code: error.code }, 2);
263
+ });
264
+ pending.add(work);
265
+ void work.catch(fail);
266
+ }, fail);
267
+ if (settled)
268
+ return;
269
+ const start = { type: 'start', shared, invocation: { args: [...context.args], cwd: context.cwd, env: { ...context.env } }, runtimeMount, maxTransferBytes, ...(packages ? { packages } : {}), installOnly: !!installation };
270
+ signal.throwIfAborted();
271
+ endpoint.postMessage(start);
272
+ });
273
+ }
274
+ catch (reason) {
275
+ if (!signal.aborted && (reason instanceof PythonInputChunkError || (reason instanceof Error && 'code' in reason && reason.code === 'EPACKAGE'))) {
276
+ try {
277
+ await writeBytes(stderrOperation.output, new TextEncoder().encode('python: ' + reason.message + '\n'), signal);
278
+ }
279
+ catch (error) {
280
+ primary = { reason: error };
281
+ }
282
+ }
283
+ else
284
+ primary = { reason };
285
+ }
286
+ try {
287
+ await close();
288
+ }
289
+ catch (reason) {
290
+ primary ??= { reason };
291
+ }
292
+ try {
293
+ options.onProgress?.({ phase: 'finished', command: context.command });
294
+ }
295
+ catch (reason) {
296
+ primary ??= { reason };
297
+ }
298
+ context.signal.throwIfAborted();
299
+ if (primary)
300
+ throw primary.reason;
301
+ return { exitCode: result };
302
+ };
303
+ return ['python', 'python3'].map(name => ({ name, description: 'Python with an explicit synchronous interpreter worker and canonical filesystem', execute }));
304
+ }
305
+ export function pythonCommands(options) {
306
+ const commands = createPythonCommands(options);
307
+ return { name: 'python-commands', setup(host) {
308
+ if (!options.replace)
309
+ for (const command of commands)
310
+ if (host.commands.has(command.name))
311
+ throw new Error(`Command already registered: ${command.name}`);
312
+ for (const command of commands)
313
+ host.commands.register(command, { replace: options.replace ?? false });
314
+ } };
315
+ }
316
+ export { createPythonPackageEnvironment, pythonDocumentPackages } from './provisioning.js';
317
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/python/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAiB,MAAM,uBAAuB,CAAC;AAE9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACpF,OAAO,EAAE,8BAA8B,EAAsD,MAAM,mBAAmB,CAAC;AACvH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,uBAAuB,C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AAE,OAAO,CAAC,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC;QACzG,CAAC,EAAE,CAAC;AACN,CAAC;AAED,OAAO,EAAE,8BAA8B,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,9 @@
1
+ export interface PythonInstallation {
2
+ readonly packages: readonly string[];
3
+ readonly requirements: readonly string[];
4
+ readonly help: boolean;
5
+ }
6
+ export declare const pythonInstallationHelp = "Usage: python -m pip install [-r FILE | --requirement FILE] PACKAGE ...\nInstalls compatible wheels and dependencies using the configured Pyodide installer.\nPACKAGE is a package requirement or a canonical filesystem wheel path.\nSupported options: -r, --requirement, -h, --help, --.\nAll other pip options and commands are unsupported, including --upgrade,\n--force-reinstall, --no-index, --no-deps, --target, --user, --prefix, --root, --editable,\n--index-url, --extra-index-url, --find-links, --trusted-host, --require-hashes,\n--constraint, --dry-run, --quiet, --verbose and cache/build/configuration flags.\nConfigure transport and integrity through the Python package SDK configuration.\n";
7
+ /** Recognize only the actual -m pip entrypoint, never application arguments. */
8
+ export declare function parsePythonInstallation(args: readonly string[]): PythonInstallation | undefined;
9
+ //# sourceMappingURL=installation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../../src/commands/python/installation.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,sBAAsB,2rBASlC,CAAC;AAEF,gFAAgF;AAChF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,kBAAkB,GAAG,SAAS,CA+C/F"}
@@ -0,0 +1,80 @@
1
+ import { PythonInvocationError } from './invocation.js';
2
+ export const pythonInstallationHelp = `Usage: python -m pip install [-r FILE | --requirement FILE] PACKAGE ...
3
+ Installs compatible wheels and dependencies using the configured Pyodide installer.
4
+ PACKAGE is a package requirement or a canonical filesystem wheel path.
5
+ Supported options: -r, --requirement, -h, --help, --.
6
+ All other pip options and commands are unsupported, including --upgrade,
7
+ --force-reinstall, --no-index, --no-deps, --target, --user, --prefix, --root, --editable,
8
+ --index-url, --extra-index-url, --find-links, --trusted-host, --require-hashes,
9
+ --constraint, --dry-run, --quiet, --verbose and cache/build/configuration flags.
10
+ Configure transport and integrity through the Python package SDK configuration.
11
+ `;
12
+ /** Recognize only the actual -m pip entrypoint, never application arguments. */
13
+ export function parsePythonInstallation(args) {
14
+ let pipArgs;
15
+ scan: for (let index = 0; index < args.length; index++) {
16
+ const option = args[index];
17
+ if (option === '--' || option === '-' || !option.startsWith('-') || option.startsWith('--'))
18
+ return undefined;
19
+ for (let offset = 1; offset < option.length; offset++) {
20
+ const flag = option[offset];
21
+ if ('h?V'.includes(flag))
22
+ return undefined;
23
+ if ('cmWX'.includes(flag)) {
24
+ const operand = option.slice(offset + 1) || args[++index];
25
+ if (flag === 'c')
26
+ return undefined;
27
+ if (flag === 'm') {
28
+ if (operand !== 'pip')
29
+ return undefined;
30
+ pipArgs = args.slice(index + 1);
31
+ break scan;
32
+ }
33
+ break;
34
+ }
35
+ }
36
+ }
37
+ if (!pipArgs)
38
+ return undefined;
39
+ const packages = [];
40
+ const requirements = [];
41
+ if (pipArgs.length === 0)
42
+ return { packages, requirements, help: true };
43
+ if (pipArgs[0] === '--help' || pipArgs[0] === '-h') {
44
+ if (pipArgs.length > 1)
45
+ throw new PythonInvocationError('unsupported pip option or argument after help: ' + pipArgs[1]);
46
+ return { packages, requirements, help: true };
47
+ }
48
+ if (pipArgs[0] !== 'install')
49
+ throw new PythonInvocationError('unsupported pip command ' + pipArgs[0]);
50
+ let operands = false;
51
+ let help = false;
52
+ for (let index = 1; index < pipArgs.length; index++) {
53
+ const option = pipArgs[index];
54
+ if (operands || !option.startsWith('-')) {
55
+ packages.push(option);
56
+ continue;
57
+ }
58
+ if (option === '--') {
59
+ operands = true;
60
+ continue;
61
+ }
62
+ if (option === '--help' || option === '-h') {
63
+ help = true;
64
+ continue;
65
+ }
66
+ if (option === '-r' || option === '--requirement' || option.startsWith('--requirement=') || option.startsWith('-r')) {
67
+ const path = option.startsWith('--requirement=') ? option.slice('--requirement='.length)
68
+ : option !== '-r' && option.startsWith('-r') ? option.slice(2) : pipArgs[++index];
69
+ if (!path || path.startsWith('-'))
70
+ throw new PythonInvocationError(option + ' requires a path');
71
+ requirements.push(path);
72
+ continue;
73
+ }
74
+ throw new PythonInvocationError('unsupported pip option ' + option);
75
+ }
76
+ if (!help && packages.length === 0 && requirements.length === 0)
77
+ throw new PythonInvocationError('pip install requires at least one package or requirements file');
78
+ return { packages, requirements, help };
79
+ }
80
+ //# sourceMappingURL=installation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"installation.js","sourceRoot":"","sources":["../../../src/commands/python/installation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAQxD,MAAM,CAAC,MAAM,sBAAsB,GAAG;;;;;;;;;CASrC,CAAC;AAEF,gFAAgF;AAChF,MAAM,UAAU,uBAAuB,CAAC,IAAuB;IAC7D,IAAI,OAAsC,CAAC;IAC3C,IAAI,EAAE,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;QACvD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAE,CAAC;QAC5B,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC;YAAE,OAAO,SAAS,CAAC;QAC9G,KAAK,IAAI,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,MA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AC,UAAU,CAAC,GAAG,CAAC;gBAAE,MAAM,IAAI,qBAAqB,CAAC,MAAM,GAAG,kBAAkB,CAAC,CAAC;YAChG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACxB,SAAS;QACX,CAAC;QACD,MAAM,IAAI,qBAAqB,CAAC,yBAAyB,GAAG,MAAM,CAAC,CAAC;IACtE,CAAC;IACD,IAAI,CAAC,IAAI,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,qBAAqB,CAAC,gEAAgE,CAAC,CAAC;IACnK,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,10 @@
1
+ /** An explicit compatibility failure, rendered as Python usage status 2. */
2
+ export declare class PythonInvocationError extends Error {
3
+ constructor(message: string);
4
+ }
5
+ /** Extract native initialization flags without consuming script/module arguments. */
6
+ export declare function parsePythonInvocation(args: readonly string[], env: Readonly<Record<string, string>>): {
7
+ readonly startupArgs: string[];
8
+ readonly env: Record<string, string>;
9
+ };
10
+ //# sourceMappingURL=invocation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invocation.d.ts","sourceRoot":"","sources":["../../../src/commands/python/invocation.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,qBAAa,qBAAsB,SAAQ,KAAK;gBAClC,OAAO,EAAE,MAAM;CAC5B;AAED,qFAAqF;AACrF,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG;IACrG,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC;IAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC,CAoDA"}
@@ -0,0 +1,81 @@
1
+ /** An explicit compatibility failure, rendered as Python usage status 2. */
2
+ export class PythonInvocationError extends Error {
3
+ constructor(message) { super(message); this.name = 'PythonInvocationError'; }
4
+ }
5
+ /** Extract native initialization flags without consuming script/module arguments. */
6
+ export function parsePythonInvocation(args, env) {
7
+ const startupArgs = [];
8
+ let informational = false;
9
+ scan: for (let index = 0; index < args.length; index++) {
10
+ const option = args[index];
11
+ if (option === '--' || option === '-' || !option.startsWith('-'))
12
+ break;
13
+ if (option === '--help') {
14
+ informational = true;
15
+ break;
16
+ }
17
+ if (option === '--version') {
18
+ informational = true;
19
+ continue;
20
+ }
21
+ if (option.startsWith('--'))
22
+ throw new PythonInvocationError('unsupported option ' + option);
23
+ for (let offset = 1; offset < option.length; offset++) {
24
+ const flag = option[offset];
25
+ if (flag === 'h' || flag === '?') {
26
+ informational = true;
27
+ break scan;
28
+ }
29
+ if (flag === 'V') {
30
+ informational = true;
31
+ continue;
32
+ }
33
+ if ('cmWX'.includes(flag)) {
34
+ const operand = option.slice(offset + 1) || args[++index];
35
+ if (operand === undefined)
36
+ throw new PythonInvocationError('argument expected for -' + flag);
37
+ if (flag === 'c' || flag === 'm')
38
+ break scan;
39
+ if (flag === 'X') {
40
+ const separator = operand.indexOf('=');
41
+ const name = separator < 0 ? operand : operand.slice(0, separator);
42
+ const value = separator < 0 ? undefined : operand.slice(separator + 1);
43
+ let decimal = value ?? '';
44
+ while (decimal.length && ' \t\n\r\v\f'.includes(decimal[0]))
45
+ decimal = decimal.slice(1);
46
+ if (decimal[0] === '+' || decimal[0] === '-')
47
+ decimal = decimal.slice(1);
48
+ const digits = decimal.length > 0 && [...decimal].every(character => character >= '0' && character <= '9');
49
+ const supported = (name === 'utf8' && (value === undefined || value === '0' || value === '1'))
50
+ || ((name === 'dev' || name === 'warn_default_encoding') && value === undefined)
51
+ || (name === 'int_max_str_digits' && digits && Number.isSafeInteger(Number(value)) && Number(value) <= 2147483647 && (Number(value) === 0 || Number(value) >= 640));
52
+ if (!supported)
53
+ throw new PythonInvocationError('unsupported -X option ' + operand);
54
+ startupArgs.push('-X', operand);
55
+ }
56
+ // Warning-as-error can prevent Pyodide bootstrap; apply -W after bootstrap.
57
+ break;
58
+ }
59
+ if (!'BEPOusISbdvqR'.includes(flag))
60
+ throw new PythonInvocationError('unsupported option -' + flag);
61
+ startupArgs.push('-' + flag);
62
+ }
63
+ }
64
+ if (!informational && !startupArgs.includes('-E') && !startupArgs.includes('-I')) {
65
+ if (env.PYTHONINSPECT)
66
+ throw new PythonInvocationError('PYTHONINSPECT requires an interactive terminal, which the shell does not expose');
67
+ if (env.PYTHONHOME)
68
+ throw new PythonInvocationError('PYTHONHOME cannot replace the configured Pyodide runtime');
69
+ }
70
+ const runtimeEnv = { ...env };
71
+ // These paths belong to the canonical filesystem, mounted after bootstrap.
72
+ delete runtimeEnv.PYTHONPATH;
73
+ delete runtimeEnv.PYTHONHOME;
74
+ delete runtimeEnv.PYTHONWARNINGS;
75
+ // Pyodide otherwise supplies PYTHONINSPECT=1, including with a -c operand.
76
+ runtimeEnv.PYTHONINSPECT = '';
77
+ // Without a command Pyodide initializes CPython in inspect mode.
78
+ startupArgs.push('-c', '');
79
+ return { startupArgs, env: runtimeEnv };
80
+ }
81
+ //# sourceMappingURL=invocation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invocation.js","sourceRoot":"","sources":["../../../src/commands/python/invocation.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAC9C,YAAY,OAAe,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC,CAAC,CAAC;CACtF;AAED,qFAAqF;AACrF,MAAM,UAAU,qBAAqB,CAAC,IAAuB,EAAE,GAAqC;IAIlG,MAAM,WAAW,GAAa,EAAE,CAAC;IACjC,IAAI,aAAa,GAAG,KAAK,CAAC;IAC1B,IAAI,EAAE,KAAK,IAAI,KAAK,GAAG,CA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EAAiE;IACjE,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC3B,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { PythonWorkerEndpoint } from './index.js';
2
+ export interface NodePythonWorkerOptions {
3
+ /** Required acknowledgement: guest JavaScript interoperability is not host isolation. */
4
+ readonly trustedPython: true;
5
+ /** Explicit trusted Pyodide ES module URL; no installation or host Python fallback. */
6
+ readonly runtimeModuleURL: string;
7
+ /** Runtime asset directory, defaulting to the module's containing directory. */
8
+ readonly indexURL?: string;
9
+ }
10
+ /** Each endpoint owns a new worker and a new interpreter, including module state. */
11
+ export declare function createNodePythonWorker(options: NodePythonWorkerOptions): PythonWorkerEndpoint;
12
+ //# sourceMappingURL=node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/commands/python/node.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,MAAM,WAAW,uBAAuB;IACtC,yFAAyF;IACzF,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC;IAC7B,uFAAuF;IACvF,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,gFAAgF;IAChF,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,qFAAqF;AACrF,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,uBAAuB,GAAG,oBAAoB,CAyB7F"}
@@ -0,0 +1,33 @@
1
+ import { fileURLToPath } from 'node:url';
2
+ import { Worker } from 'node:worker_threads';
3
+ /** Each endpoint owns a new worker and a new interpreter, including module state. */
4
+ export function createNodePythonWorker(options) {
5
+ if (options.trustedPython !== true)
6
+ throw new TypeError('Node Python requires trustedPython: true; Pyodide JavaScript interoperability is not a sandbox');
7
+ const runtimeModuleURL = new URL(options.runtimeModuleURL).href;
8
+ const worker = new Worker(`
9
+ import('node:worker_threads').then(({ parentPort, workerData }) => {
10
+ parentPort.once('message', async start => {
11
+ try {
12
+ const { runPythonWorker } = await import(workerData.runner);
13
+ const { loadPyodide } = await import(workerData.runtimeModuleURL);
14
+ await runPythonWorker({ start, loadRuntime: configuration => loadPyodide({...configuration, indexURL: workerData.indexURL}),
15
+ postMessage: message => parentPort.postMessage(message) });
16
+ } catch (error) { parentPort.postMessage({type:'error', message:String(error)}); }
17
+ });
18
+ });
19
+ `, { eval: true, workerData: { runner: import.meta.resolve('poe-code/safe-bash/commands/python/worker'),
20
+ runtimeModuleURL, indexURL: options.indexURL ?? (runtimeModuleURL.startsWith('file:') ? fileURLToPath(new URL('.', runtimeModuleURL)) : new URL('.', runtimeModuleURL).href) } });
21
+ return {
22
+ postMessage(message) { worker.postMessage(message); },
23
+ subscribe(onMessage, onError) {
24
+ const onExit = (code) => onError(new Error(`Python worker exited unexpectedly (${code})`));
25
+ worker.on('message', onMessage);
26
+ worker.on('error', onError);
27
+ worker.on('exit', onExit);
28
+ return () => { worker.off('message', onMessage); worker.off('error', onError); worker.off('exit', onExit); };
29
+ },
30
+ async terminate() { await worker.terminate(); },
31
+ };
32
+ }
33
+ //# sourceMappingURL=node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.js","sourceRoot":"","sources":["../../../src/commands/python/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAY7C,qFAAqF;AACrF,MAAM,UAAU,sBAAsB,CAAC,OAAgC;IACrE,IAAI,OAAO,CAAC,aAAa,KAAK,IAAI;QAAE,MAAM,IAAI,SAAS,CAAC,gGAAgG,CAAC,CAAC;IAC1J,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC;IAChE,MAAM,MAA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0,0 +1,5 @@
1
+ import type { PythonWorkerRuntime } from './worker.js';
2
+ import type { PythonPackageStart } from './provisioning.js';
3
+ /** Pinned installer ABI; all package transport is serviced by the host, before user execution. */
4
+ export declare function installPythonPackages(supplied: PythonWorkerRuntime, start: PythonPackageStart, request: (operation: string, ...args: any[]) => any, maxTransferBytes: number): Promise<void>;
5
+ //# sourceMappingURL=provisioning-runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provisioning-runtime.d.ts","sourceRoot":"","sources":["../../../src/commands/python/provisioning-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAc5D,kGAAkG;AAClG,wBAAsB,qBAAqB,CAC1C,QAAQ,EAAE,mBAAmB,EAC7B,KAAK,EAAE,kBAAkB,EACzB,OAAO,EAAC,CAAC,SAAS,EAAC,MAAM,EAAC,GAAG,IAAI,EAAC,GAAG,EAAE,KAAG,GAAG,EAC7C,gBAAgB,EAAC,MAAM,GACtB,OAAO,CAAC,IAAI,CAAC,CAoKd"}