@poe-platform/safe-bash 0.1.822 → 0.1.824

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 (291) hide show
  1. package/dist/safe-bash/chunks/{chunk-HNT2MR4W.js → chunk-363QOIDR.js} +2 -1
  2. package/dist/safe-bash/chunks/chunk-AGHV53VF.js +42 -0
  3. package/dist/safe-bash/chunks/{chunk-VF3Q2V3E.js → chunk-RAFD5ZAH.js} +1 -1
  4. package/dist/safe-bash/chunks/{chunk-67QE3JLU.js → chunk-TZRVK3NU.js} +1 -1
  5. package/dist/safe-bash/chunks/{chunk-IRJS54AA.js → chunk-VWLQDZFF.js} +20 -12
  6. package/dist/safe-bash/chunks/{chunk-NAETSXBW.js → chunk-ZJAXMB5M.js} +1 -1
  7. package/dist/safe-bash/command-chunks/{chunk-LDR3PPM3.js → chunk-22QEL76N.js} +3 -3
  8. package/dist/safe-bash/command-chunks/{chunk-QX3WKBLI.js → chunk-36FV6BAG.js} +5 -3
  9. package/dist/safe-bash/command-chunks/{chunk-BSLXS4PE.js → chunk-3DH5QBZC.js} +1 -1
  10. package/dist/safe-bash/command-chunks/{chunk-ZSHXZ3XG.js → chunk-3EAZRKI4.js} +7 -7
  11. package/dist/safe-bash/command-chunks/{chunk-5EFNQ6FY.js → chunk-3EBQOZET.js} +216 -1
  12. package/dist/safe-bash/command-chunks/{chunk-KQE2D7PX.js → chunk-3HUCLYKJ.js} +2 -2
  13. package/dist/safe-bash/command-chunks/{chunk-J4I7KCQQ.js → chunk-4JABZEDO.js} +4 -4
  14. package/dist/safe-bash/command-chunks/{chunk-PVKSBXHB.js → chunk-4M6D4IUB.js} +4 -4
  15. package/dist/safe-bash/command-chunks/{chunk-UVM6QG2H.js → chunk-4MVQE6CT.js} +1 -1
  16. package/dist/safe-bash/command-chunks/{chunk-QWQHLMDX.js → chunk-4VTB4DGE.js} +3 -3
  17. package/dist/safe-bash/command-chunks/{chunk-JQPDVCBU.js → chunk-565AAQTV.js} +3 -3
  18. package/dist/safe-bash/command-chunks/{chunk-JSW6YH6T.js → chunk-5PRXCH54.js} +5 -5
  19. package/dist/safe-bash/command-chunks/{chunk-42OQIFPW.js → chunk-5RLK2QSY.js} +3 -3
  20. package/dist/safe-bash/command-chunks/{chunk-PYYAX5FB.js → chunk-63WEGFLL.js} +16 -16
  21. package/dist/safe-bash/command-chunks/{chunk-5QR4LTAK.js → chunk-6KZXFPOT.js} +6 -6
  22. package/dist/safe-bash/command-chunks/{chunk-LJLB7TBN.js → chunk-6YTXU3NF.js} +6 -6
  23. package/dist/safe-bash/command-chunks/{chunk-NNYOPI7K.js → chunk-7NF44M2V.js} +5 -5
  24. package/dist/safe-bash/command-chunks/{chunk-ZRHKXN6W.js → chunk-7RQGRFHJ.js} +2 -2
  25. package/dist/safe-bash/command-chunks/{chunk-QGSY4ZAU.js → chunk-7UYBNOOM.js} +2 -2
  26. package/dist/safe-bash/command-chunks/{chunk-WOT2YXBT.js → chunk-7ZQVMPSB.js} +213 -42
  27. package/dist/safe-bash/command-chunks/{chunk-6REH56FL.js → chunk-AA254KE5.js} +4 -4
  28. package/dist/safe-bash/command-chunks/{chunk-2VSNIHIW.js → chunk-APUXNXXQ.js} +11 -11
  29. package/dist/safe-bash/command-chunks/{chunk-4VHCA4KK.js → chunk-AVSINNZ6.js} +80 -3
  30. package/dist/safe-bash/command-chunks/{chunk-XE75H5ZZ.js → chunk-AVXSR5MO.js} +6 -6
  31. package/dist/safe-bash/command-chunks/{chunk-22D6Q6SW.js → chunk-BKCVCMUX.js} +2 -2
  32. package/dist/safe-bash/command-chunks/{chunk-UDRJKA3P.js → chunk-C23L4HZB.js} +2 -2
  33. package/dist/safe-bash/command-chunks/{chunk-PAEAEFK3.js → chunk-C3EEMMQL.js} +3 -3
  34. package/dist/safe-bash/command-chunks/{chunk-NDJPULBE.js → chunk-CEKBIZGU.js} +2 -2
  35. package/dist/safe-bash/command-chunks/{chunk-75OUKYCM.js → chunk-CH5JDE3C.js} +1 -1
  36. package/dist/safe-bash/command-chunks/{chunk-XNVL6AOV.js → chunk-CIYGC7WU.js} +6 -6
  37. package/dist/safe-bash/command-chunks/{chunk-RUXY7GN5.js → chunk-CMJBRGU2.js} +1 -1
  38. package/dist/safe-bash/command-chunks/{chunk-DGFMOT4O.js → chunk-CO4HYNPS.js} +1 -1
  39. package/dist/safe-bash/command-chunks/{chunk-TMJG745A.js → chunk-CQLZM75U.js} +3 -3
  40. package/dist/safe-bash/command-chunks/{chunk-T2LZWXWF.js → chunk-DBCTHLB5.js} +4 -4
  41. package/dist/safe-bash/command-chunks/{chunk-6RE4MZYM.js → chunk-DBEJMI7J.js} +1 -1
  42. package/dist/safe-bash/command-chunks/{chunk-XXUMECE4.js → chunk-DEEZYCOQ.js} +6 -6
  43. package/dist/safe-bash/command-chunks/{chunk-YJMS5Q4Y.js → chunk-DHTTI7CE.js} +8 -8
  44. package/dist/safe-bash/command-chunks/{chunk-D3WMD32B.js → chunk-DLLGOC4Q.js} +6 -6
  45. package/dist/safe-bash/command-chunks/{chunk-HVLF3Y4B.js → chunk-DYCYAIET.js} +5 -5
  46. package/dist/safe-bash/command-chunks/{chunk-BZLLQWRK.js → chunk-E5CDHXFA.js} +2 -2
  47. package/dist/safe-bash/command-chunks/{chunk-5NC2IQMQ.js → chunk-EV7A5FNN.js} +1 -1
  48. package/dist/safe-bash/command-chunks/{chunk-MCUDSE4H.js → chunk-EWECMOQ5.js} +1 -1
  49. package/dist/safe-bash/command-chunks/{chunk-2YC6MWQB.js → chunk-EY3UE26F.js} +1 -1
  50. package/dist/safe-bash/command-chunks/{chunk-ZQ4NQ24M.js → chunk-FJLVISSD.js} +4 -4
  51. package/dist/safe-bash/command-chunks/{chunk-WOO3YO2X.js → chunk-HTMGN3KL.js} +4 -4
  52. package/dist/safe-bash/command-chunks/{chunk-2E53ZL5D.js → chunk-HU72CZBN.js} +4 -4
  53. package/dist/safe-bash/command-chunks/{chunk-AH3ZEPAN.js → chunk-IGHFIRXK.js} +1 -1
  54. package/dist/safe-bash/command-chunks/{chunk-R4NPYXQX.js → chunk-IKBTII7C.js} +285 -70
  55. package/dist/safe-bash/command-chunks/{chunk-J3ISXTYB.js → chunk-JTEAYB72.js} +2 -2
  56. package/dist/safe-bash/command-chunks/{chunk-NR7POLKP.js → chunk-KCS25XUJ.js} +2 -2
  57. package/dist/safe-bash/command-chunks/chunk-LKAFLJ5L.js +123 -0
  58. package/dist/safe-bash/command-chunks/{chunk-EU5SR3LS.js → chunk-LSH6UKCT.js} +2 -2
  59. package/dist/safe-bash/command-chunks/{chunk-WV3C6BRD.js → chunk-MHZ7UTRX.js} +5 -5
  60. package/dist/safe-bash/command-chunks/{chunk-K6J3KFQ2.js → chunk-MSA5BQFK.js} +3 -3
  61. package/dist/safe-bash/command-chunks/{chunk-OMD45J52.js → chunk-MW3L6JB7.js} +6 -6
  62. package/dist/safe-bash/command-chunks/{chunk-AR65HNNX.js → chunk-N2TN7IBE.js} +1 -1
  63. package/dist/safe-bash/command-chunks/chunk-NNGWTDVJ.js +2819 -0
  64. package/dist/safe-bash/command-chunks/{chunk-NWA7ZJDV.js → chunk-NU64GWGN.js} +3 -3
  65. package/dist/safe-bash/command-chunks/{chunk-4Q3HP33O.js → chunk-NW3S6T6R.js} +146 -123
  66. package/dist/safe-bash/command-chunks/chunk-NXCJNPL3.js +47 -0
  67. package/dist/safe-bash/command-chunks/{chunk-GAYTDZPP.js → chunk-ORWYNKKL.js} +3 -3
  68. package/dist/safe-bash/command-chunks/{chunk-FCGMSOF6.js → chunk-P6YTNXRV.js} +1 -1
  69. package/dist/safe-bash/command-chunks/{chunk-3RDEX4AF.js → chunk-PAS4YSNN.js} +1 -1
  70. package/dist/safe-bash/command-chunks/{chunk-RKAL5VFP.js → chunk-PLVFJ6FF.js} +255 -616
  71. package/dist/safe-bash/command-chunks/{chunk-TTPT3OME.js → chunk-PSNTCRL5.js} +4 -4
  72. package/dist/safe-bash/command-chunks/{chunk-CJIFJ45R.js → chunk-QBCEAYQT.js} +1 -1
  73. package/dist/safe-bash/command-chunks/{chunk-FGK6HLSY.js → chunk-QC2RWSYM.js} +3 -3
  74. package/dist/safe-bash/command-chunks/{chunk-HCZITM4C.js → chunk-QPY3NCMC.js} +5 -5
  75. package/dist/safe-bash/command-chunks/{chunk-3TXPZLFI.js → chunk-R6RVR6ZZ.js} +5 -5
  76. package/dist/safe-bash/command-chunks/{chunk-HQFX5XKV.js → chunk-RB7XAYO2.js} +3 -3
  77. package/dist/safe-bash/command-chunks/{chunk-6PDXNY3T.js → chunk-RF5VEKFU.js} +9 -9
  78. package/dist/safe-bash/command-chunks/{chunk-VAMBWXDV.js → chunk-RUAGHZNF.js} +18 -18
  79. package/dist/safe-bash/command-chunks/{chunk-3MFYCMQU.js → chunk-S2T7DDGY.js} +16 -16
  80. package/dist/safe-bash/command-chunks/{chunk-LZHFVNEV.js → chunk-S3QYSI5E.js} +1 -1
  81. package/dist/safe-bash/command-chunks/{chunk-ZLMCWAAU.js → chunk-STTXZKR6.js} +3 -3
  82. package/dist/safe-bash/command-chunks/{chunk-AXUHORS3.js → chunk-SUYSZJI3.js} +1 -1
  83. package/dist/safe-bash/command-chunks/{chunk-C5SLY3RB.js → chunk-U2C6A3QO.js} +1 -1
  84. package/dist/safe-bash/command-chunks/{chunk-HCJWEB6P.js → chunk-U6IEK2CI.js} +7 -7
  85. package/dist/safe-bash/command-chunks/{chunk-NN6OWOJG.js → chunk-UC6DUY3K.js} +2 -2
  86. package/dist/safe-bash/command-chunks/{chunk-64L57DEI.js → chunk-UQTU7H6T.js} +9 -9
  87. package/dist/safe-bash/command-chunks/{chunk-I7MEH76L.js → chunk-UYNJF5QN.js} +1 -1
  88. package/dist/safe-bash/command-chunks/{chunk-ARA57PMC.js → chunk-V5PVNBOS.js} +4 -4
  89. package/dist/safe-bash/command-chunks/{chunk-IAHYG67O.js → chunk-V5ZBRM5R.js} +3 -3
  90. package/dist/safe-bash/command-chunks/{chunk-ZZ6EIACJ.js → chunk-VGHRMAI4.js} +5 -5
  91. package/dist/safe-bash/command-chunks/{chunk-DZTT5SLG.js → chunk-VP7R7HKY.js} +5 -5
  92. package/dist/safe-bash/command-chunks/{chunk-TP5MZHCB.js → chunk-W5Y7Y7PS.js} +3 -3
  93. package/dist/safe-bash/command-chunks/{chunk-ZTW2E5OT.js → chunk-WAE3OCOU.js} +3 -3
  94. package/dist/safe-bash/command-chunks/{chunk-DBYY7IDI.js → chunk-WCM47S5A.js} +10 -10
  95. package/dist/safe-bash/command-chunks/{chunk-U6VSRO6E.js → chunk-WNVBS4GV.js} +4 -4
  96. package/dist/safe-bash/command-chunks/{chunk-CXOAMPOV.js → chunk-WUIS2INH.js} +13 -13
  97. package/dist/safe-bash/command-chunks/{chunk-4HJEZGYN.js → chunk-YODHIRPW.js} +7 -7
  98. package/dist/safe-bash/command-chunks/{chunk-C3FERGHU.js → chunk-YRMTOLG5.js} +3 -3
  99. package/dist/safe-bash/command-chunks/{chunk-GQV5RWMN.js → chunk-ZFXHSFTU.js} +1 -1
  100. package/dist/safe-bash/command-chunks/{chunk-YXIJOYT6.js → chunk-ZUOCXDYW.js} +1 -1
  101. package/dist/safe-bash/command-chunks/{chunk-LBBJ5S3W.js → chunk-ZZKJPLIH.js} +1 -1
  102. package/dist/safe-bash/command-chunks/{engine-UPLVIV72-IGXUDNO5.js → engine-UPLVIV72-MSSFJLK4.js} +1 -1
  103. package/dist/safe-bash/command-chunks/{prompt-tool-debug-ERJKK3XZ.js → prompt-tool-debug-3POFNRYP.js} +5 -5
  104. package/dist/safe-bash/commands/bc/index.browser.js +1 -1
  105. package/dist/safe-bash/commands/llm/index.browser.js +3 -1
  106. package/dist/safe-bash/commands/llm/index.js +1 -1
  107. package/dist/safe-bash/commands/python/executor.browser.js +12 -1
  108. package/dist/safe-bash/commands/python/executor.js +1 -1
  109. package/dist/safe-bash/commands/python/index.browser.js +23 -1
  110. package/dist/safe-bash/commands/python/index.js +1 -1
  111. package/dist/safe-bash/commands/python/source-archive.d.ts +2 -0
  112. package/dist/safe-bash/commands/python/source-archive.js +2 -0
  113. package/dist/safe-bash/commands/python/source-zip.d.ts +2 -0
  114. package/dist/safe-bash/commands/python/source-zip.js +2 -0
  115. package/dist/safe-bash/core.browser.js +2 -2
  116. package/dist/safe-bash/full-core.browser.js +30 -6
  117. package/dist/safe-bash/plugins/index.browser.js +3 -3
  118. package/dist/safe-bash/registry-entry.browser.js +2 -2
  119. package/dist/safe-bash/search.browser.js +1 -1
  120. package/dist/safe-bash/shell/runtime.d.ts +2 -2
  121. package/dist/safe-bash/shell/runtime.js +11 -2
  122. package/dist/safe-bash/shell/sync-extra-evaluators.js +12 -12
  123. package/dist/safe-bash/shell-entry.browser.js +2 -2
  124. package/dist/safe-bash-command-exiftool/index.js +41 -0
  125. package/dist/safe-bash-command-git/git_rust.wasm +0 -0
  126. package/dist/safe-bash-command-llm/collections.js +24 -65
  127. package/dist/safe-bash-command-llm/command.js +6 -6
  128. package/dist/safe-bash-command-llm/fragment-loaders.d.ts +3 -2
  129. package/dist/safe-bash-command-llm/index.d.ts +3 -2
  130. package/dist/safe-bash-command-llm/index.js +10 -8
  131. package/dist/safe-bash-command-llm/loader-provider.d.ts +25 -0
  132. package/dist/safe-bash-command-llm/openai-sse.js +2 -2
  133. package/dist/safe-bash-command-llm/openai.js +4 -4
  134. package/dist/safe-bash-command-llm/providers/index.js +4 -4
  135. package/dist/safe-bash-command-llm/providers/openai.js +4 -4
  136. package/dist/safe-bash-command-llm/python-unicode.d.ts +2 -0
  137. package/dist/safe-bash-command-llm/templates.d.ts +7 -2
  138. package/dist/safe-bash-command-llm/types.d.ts +7 -1
  139. package/dist/safe-bash-command-mcp/index.browser.js +3 -0
  140. package/dist/safe-bash-command-mcp/index.js +3 -0
  141. package/dist/safe-bash-command-playwright-cli/index.js +36 -36
  142. package/dist/safe-bash-command-playwright-cli/playwright/abilities.js +7 -7
  143. package/dist/safe-bash-command-playwright-cli/playwright/adapter.js +3 -3
  144. package/dist/safe-bash-command-playwright-cli/playwright/capability-events.js +1 -1
  145. package/dist/safe-bash-command-playwright-cli/playwright/capability-result.js +1 -1
  146. package/dist/safe-bash-command-playwright-cli/playwright/controller.js +15 -15
  147. package/dist/safe-bash-command-playwright-cli/playwright/download-capabilities.js +1 -1
  148. package/dist/safe-bash-command-playwright-cli/playwright/drop-capability.js +1 -1
  149. package/dist/safe-bash-command-playwright-cli/playwright/index.js +35 -35
  150. package/dist/safe-bash-command-playwright-cli/playwright/modal-capabilities.js +1 -1
  151. package/dist/safe-bash-command-playwright-cli/playwright/native-evaluation.js +1 -1
  152. package/dist/safe-bash-command-playwright-cli/playwright/native-json-snapshot.js +1 -1
  153. package/dist/safe-bash-command-playwright-cli/playwright/native-snapshot.js +1 -1
  154. package/dist/safe-bash-command-playwright-cli/playwright/native-storage-replacement.js +2 -2
  155. package/dist/safe-bash-command-playwright-cli/playwright/profile.js +3 -3
  156. package/dist/safe-bash-command-playwright-cli/playwright/recording-capabilities.js +1 -1
  157. package/dist/safe-bash-command-playwright-cli/playwright/route-capabilities.js +1 -1
  158. package/dist/safe-bash-command-playwright-cli/playwright/snapshot.js +1 -1
  159. package/dist/safe-bash-command-playwright-cli/playwright/standard-capabilities.js +6 -6
  160. package/dist/safe-bash-command-playwright-cli/playwright/storage-capabilities.js +5 -5
  161. package/dist/safe-bash-command-playwright-cli/playwright/tracing-capabilities.js +1 -1
  162. package/dist/safe-bash-command-playwright-cli/playwright/webmcp-capabilities.js +1 -1
  163. package/dist/safe-bash-command-python/build-backend.d.ts +93 -0
  164. package/dist/safe-bash-command-python/build-dependencies.d.ts +13 -0
  165. package/dist/safe-bash-command-python/build-environment.d.ts +3 -0
  166. package/dist/safe-bash-command-python/build-wheel.d.ts +8 -0
  167. package/dist/safe-bash-command-python/executor.d.ts +12 -2
  168. package/dist/safe-bash-command-python/executor.js +27 -4
  169. package/dist/safe-bash-command-python/index.js +27 -4
  170. package/dist/safe-bash-command-python/jspi.js +2 -2
  171. package/dist/safe-bash-command-python/llm-assets-node.js +1 -1
  172. package/dist/safe-bash-command-python/llm-fragment-loader.d.ts +6 -0
  173. package/dist/safe-bash-command-python/llm-functions-loader.d.ts +5 -1
  174. package/dist/safe-bash-command-python/llm-loader-discovery.d.ts +13 -0
  175. package/dist/safe-bash-command-python/llm-package-manager.d.ts +7 -0
  176. package/dist/safe-bash-command-python/llm-template-loader.d.ts +6 -0
  177. package/dist/safe-bash-command-python/manifest.d.ts +17 -0
  178. package/dist/safe-bash-command-python/provisioning.d.ts +37 -5
  179. package/dist/safe-bash-command-python/provisioning.js +2 -1
  180. package/dist/safe-bash-command-python/source-archive.d.ts +4 -0
  181. package/dist/safe-bash-command-python/source-archive.js +136 -0
  182. package/dist/safe-bash-command-python/source-environment.d.ts +12 -0
  183. package/dist/safe-bash-command-python/source-snapshot.d.ts +8 -0
  184. package/dist/safe-bash-command-python/source-zip.d.ts +8 -0
  185. package/dist/safe-bash-command-python/source-zip.js +8 -0
  186. package/dist/safe-bash-command-python/worker.js +3 -185
  187. package/dist/safe-bash-command-safejs/index.js +5 -5
  188. package/dist/safe-bash-command-safejs/runtime.js +3 -3
  189. package/dist/safe-bash-command-ssconvert/index.js +8 -8
  190. package/dist/safe-bash-compression-engine/bounded-codec.js +2 -2
  191. package/dist/safe-bash-compression-engine/codec-loader.js +1 -1
  192. package/dist/safe-bash-compression-engine/files.js +5 -5
  193. package/dist/safe-bash-compression-engine/index.js +4 -4
  194. package/dist/safe-bash-compression-engine/operand.js +5 -5
  195. package/dist/safe-bash-compression-engine/stream.js +4 -4
  196. package/dist/safe-bash-compression-engine/zstd-decode.js +3 -3
  197. package/dist/safe-bash-csv-engine/index.js +1 -1
  198. package/dist/safe-bash-csv-engine/python-utf7.d.ts +18 -0
  199. package/dist/safe-bash-csv-engine/text-decoder.d.ts +1 -0
  200. package/dist/safe-bash-csv-engine/text-decoder.js +5 -3
  201. package/dist/safe-bash-presentation-engine/accessibility.js +15 -15
  202. package/dist/safe-bash-presentation-engine/animation-editing.js +5 -5
  203. package/dist/safe-bash-presentation-engine/animations.js +5 -5
  204. package/dist/safe-bash-presentation-engine/backgrounds.js +6 -6
  205. package/dist/safe-bash-presentation-engine/chart-editing.js +18 -18
  206. package/dist/safe-bash-presentation-engine/chart-object-operations.js +12 -12
  207. package/dist/safe-bash-presentation-engine/charts.js +15 -15
  208. package/dist/safe-bash-presentation-engine/command-placeholder.js +39 -39
  209. package/dist/safe-bash-presentation-engine/comments.js +6 -6
  210. package/dist/safe-bash-presentation-engine/connector-operations.js +16 -16
  211. package/dist/safe-bash-presentation-engine/connectors.js +13 -13
  212. package/dist/safe-bash-presentation-engine/diff.js +21 -21
  213. package/dist/safe-bash-presentation-engine/drawing-format.js +7 -7
  214. package/dist/safe-bash-presentation-engine/drawing-operations.js +15 -15
  215. package/dist/safe-bash-presentation-engine/drawing-schema.js +8 -8
  216. package/dist/safe-bash-presentation-engine/equations.js +6 -6
  217. package/dist/safe-bash-presentation-engine/fields.js +6 -6
  218. package/dist/safe-bash-presentation-engine/image-extraction.js +7 -7
  219. package/dist/safe-bash-presentation-engine/image-formatting.js +16 -16
  220. package/dist/safe-bash-presentation-engine/image-insertion.js +6 -6
  221. package/dist/safe-bash-presentation-engine/image-replacement.js +7 -7
  222. package/dist/safe-bash-presentation-engine/images.js +6 -6
  223. package/dist/safe-bash-presentation-engine/index.js +104 -104
  224. package/dist/safe-bash-presentation-engine/layouts.js +5 -5
  225. package/dist/safe-bash-presentation-engine/links.js +5 -5
  226. package/dist/safe-bash-presentation-engine/masters.js +4 -4
  227. package/dist/safe-bash-presentation-engine/media-editing.js +13 -13
  228. package/dist/safe-bash-presentation-engine/media-extraction.js +7 -7
  229. package/dist/safe-bash-presentation-engine/media.js +6 -6
  230. package/dist/safe-bash-presentation-engine/memberships.js +5 -5
  231. package/dist/safe-bash-presentation-engine/notes.js +6 -6
  232. package/dist/safe-bash-presentation-engine/ole-insertion.js +6 -6
  233. package/dist/safe-bash-presentation-engine/opaque-objects.js +2 -2
  234. package/dist/safe-bash-presentation-engine/package-tools.js +6 -6
  235. package/dist/safe-bash-presentation-engine/presentation-model.js +38 -38
  236. package/dist/safe-bash-presentation-engine/presentation-settings.js +5 -5
  237. package/dist/safe-bash-presentation-engine/properties.js +6 -6
  238. package/dist/safe-bash-presentation-engine/retained-inspection.js +3 -3
  239. package/dist/safe-bash-presentation-engine/retained-text.js +16 -16
  240. package/dist/safe-bash-presentation-engine/sanitize.js +7 -7
  241. package/dist/safe-bash-presentation-engine/selectors.js +2 -2
  242. package/dist/safe-bash-presentation-engine/shape-groups.js +15 -15
  243. package/dist/safe-bash-presentation-engine/shape-operations.js +14 -14
  244. package/dist/safe-bash-presentation-engine/shape-path-operations.js +16 -16
  245. package/dist/safe-bash-presentation-engine/shape-paths.js +5 -5
  246. package/dist/safe-bash-presentation-engine/shape-selection.js +15 -15
  247. package/dist/safe-bash-presentation-engine/shape-transforms.js +5 -5
  248. package/dist/safe-bash-presentation-engine/shapes.js +11 -11
  249. package/dist/safe-bash-presentation-engine/slide-copy.js +7 -7
  250. package/dist/safe-bash-presentation-engine/slide-import.js +6 -6
  251. package/dist/safe-bash-presentation-engine/slide-merge-split.js +8 -8
  252. package/dist/safe-bash-presentation-engine/slide-model.js +25 -25
  253. package/dist/safe-bash-presentation-engine/slide-removal.js +7 -7
  254. package/dist/safe-bash-presentation-engine/slide-transfer-budget.js +2 -2
  255. package/dist/safe-bash-presentation-engine/slides.js +5 -5
  256. package/dist/safe-bash-presentation-engine/table-operations.js +17 -17
  257. package/dist/safe-bash-presentation-engine/table-spans.js +16 -16
  258. package/dist/safe-bash-presentation-engine/tables.js +15 -15
  259. package/dist/safe-bash-presentation-engine/tags.js +6 -6
  260. package/dist/safe-bash-presentation-engine/template-bindings.js +16 -16
  261. package/dist/safe-bash-presentation-engine/template-repeat.js +26 -26
  262. package/dist/safe-bash-presentation-engine/text-fitting.js +11 -11
  263. package/dist/safe-bash-presentation-engine/text-frames.js +11 -11
  264. package/dist/safe-bash-presentation-engine/text-paragraphs.js +11 -11
  265. package/dist/safe-bash-presentation-engine/text-reading.js +3 -3
  266. package/dist/safe-bash-presentation-engine/text-replacement.js +6 -6
  267. package/dist/safe-bash-presentation-engine/text-runs.js +8 -8
  268. package/dist/safe-bash-presentation-engine/themes.js +5 -5
  269. package/dist/safe-bash-presentation-engine/transitions.js +6 -6
  270. package/dist/safe-bash-presentation-engine/validation.js +2 -2
  271. package/dist/safe-bash-presentation-engine/xml-parts.js +5 -5
  272. package/dist/safe-bash-zip-engine/index.js +1 -1
  273. package/dist/safe-bash-zip-engine/zip/repair.js +1 -1
  274. package/dist/safe-bash-zip-engine/zip/sfx.js +1 -1
  275. package/dist/safe-bash-zip-engine/zip-format.d.ts +3 -1
  276. package/dist/safe-bash-zip-engine/zip-format.js +1 -1
  277. package/dist/safe-playwright-cloudflare/shell-browser-resource.d.ts +1 -1
  278. package/dist/safe-playwright-cloudflare/shell-browser-resource.js +35 -20
  279. package/package.json +13 -3
  280. package/dist/safe-bash/chunks/chunk-PSD2RSOS.js +0 -31
  281. package/dist/safe-bash/command-chunks/chunk-RHXV2KG5.js +0 -1466
  282. package/dist/safe-bash/command-chunks/{biff-AYJZR2YV-YFF3BK43.js → biff-AYJZR2YV-2BK47I2W.js} +1 -1
  283. package/dist/safe-bash/command-chunks/{chunk-SKDJCMGI.js → chunk-ATUZ7J3B.js} +3 -3
  284. package/dist/safe-bash/command-chunks/{chunk-4Q4R3VZU.js → chunk-ETFJ4L7F.js} +0 -0
  285. package/dist/safe-bash/command-chunks/{chunk-QWHBQBPB.js → chunk-EXDMIGZY.js} +6 -6
  286. package/dist/safe-bash/command-chunks/{chunk-SKF6PGA5.js → chunk-I2OKE2NI.js} +3 -3
  287. package/dist/safe-bash/command-chunks/{chunk-2H6RJPCQ.js → chunk-JDDZRKC4.js} +3 -3
  288. package/dist/safe-bash/command-chunks/{chunk-3TP4SSPS.js → chunk-SRXARACJ.js} +3 -3
  289. package/dist/safe-bash/command-chunks/{chunk-D54L2IOZ.js → chunk-Y7UXJ77P.js} +3 -3
  290. package/dist/safe-bash/command-chunks/{dif-BXKPQOCO-FVJYYGYB.js → dif-BXKPQOCO-4KB3RC6G.js} +4 -4
  291. package/dist/safe-bash/command-chunks/{sylk-25D7TL2Y-NJKBZZTF.js → sylk-25D7TL2Y-RU6ANKGT.js} +4 -4
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  SlideTransferBudget
3
- } from "./chunk-D54L2IOZ.js";
3
+ } from "./chunk-Y7UXJ77P.js";
4
4
  import {
5
5
  importSelectedSlides
6
- } from "./chunk-XNVL6AOV.js";
6
+ } from "./chunk-CIYGC7WU.js";
7
7
  import {
8
8
  writePackageArchive
9
9
  } from "./chunk-5KWEZV5H.js";
10
10
  import {
11
11
  validatePresentation
12
- } from "./chunk-SKDJCMGI.js";
12
+ } from "./chunk-ATUZ7J3B.js";
13
13
  import {
14
14
  OfficeError
15
15
  } from "./chunk-VJQ5OWS5.js";
@@ -2,6 +2,7 @@ import {
2
2
  installPythonShellModule
3
3
  } from "./chunk-FXWKMNX2.js";
4
4
  import {
5
+ installPythonPackages,
5
6
  parsePythonInvocation,
6
7
  pythonDirectoryEntries,
7
8
  pythonExecution,
@@ -9,7 +10,7 @@ import {
9
10
  pythonRuntimeRelocation,
10
11
  pythonStatProjection,
11
12
  pythonTreeCleanup
12
- } from "./chunk-5EFNQ6FY.js";
13
+ } from "./chunk-3EBQOZET.js";
13
14
  import {
14
15
  pythonJspiSignatures
15
16
  } from "./chunk-P56KGNW7.js";
@@ -30,6 +31,7 @@ import { createPythonNativeSyscalls } from "@poe-platform/safe-fs/core";
30
31
  function installPythonJspiRunSync(runtime) {
31
32
  runtime.runPython(`
32
33
  import pyodide.ffi as _safe_jspi_ffi
34
+ import pyodide.webloop as _safe_jspi_webloop
33
35
  def _safe_jspi_run_sync(awaitable, _original=_safe_jspi_ffi.run_sync):
34
36
  async def capture():
35
37
  try:
@@ -41,7 +43,10 @@ def _safe_jspi_run_sync(awaitable, _original=_safe_jspi_ffi.run_sync):
41
43
  return value
42
44
  raise value
43
45
  _safe_jspi_ffi.run_sync = _safe_jspi_run_sync
44
- del _safe_jspi_ffi, _safe_jspi_run_sync
46
+ # WebLoop captures this import during runtime initialization. asyncio.run()
47
+ # must use the same exception envelope as explicit synchronous model calls.
48
+ _safe_jspi_webloop.run_sync = _safe_jspi_run_sync
49
+ del _safe_jspi_ffi, _safe_jspi_webloop, _safe_jspi_run_sync
45
50
  `);
46
51
  }
47
52
 
@@ -366,7 +371,6 @@ function createPythonJspiExecutor(options) {
366
371
  let hostCleanupFailure;
367
372
  try {
368
373
  signal.throwIfAborted();
369
- if (start.packages?.requirements.length || start.installOnly) throw new PythonFailure("runtime-assets", { cause: new Error("JSPI runtime requires statically qualified packages") });
370
374
  runtime = await options.loadRuntime({
371
375
  jsglobals: /* @__PURE__ */ Object.create(null),
372
376
  args: configuration.startupArgs,
@@ -415,116 +419,134 @@ function createPythonJspiExecutor(options) {
415
419
  qualified = true;
416
420
  runtime._api.config.enableRunUntilComplete = true;
417
421
  signal.throwIfAborted();
418
- runtime.runPython("import sys, os, json, runpy, traceback, types, warnings, textwrap, io, struct, linecache, importlib.machinery, shutil, stat, pyodide.ffi");
419
- runtime.globals.set("_safe_runtime_mount", start.runtimeMount);
420
- const filesystem = runtime.FS;
421
- const bootstrap = filesystem.root;
422
- filesystem.root = null;
423
- filesystem.mount(filesystem.filesystems.MEMFS, {}, "/");
424
- filesystem.mkdir(start.runtimeMount);
425
- filesystem.mount({ mount: () => bootstrap }, {}, start.runtimeMount);
426
- runtime.runPython(pythonRuntimeRelocation);
427
- filesystem.currentPath = start.invocation.cwd;
428
- native = createPythonNativeSyscalls({
429
- getUmask: () => guestMask,
430
- runtime: runtime._module,
431
- cwd: start.invocation.cwd,
432
- runtimeMount: start.runtimeMount,
433
- maxTransferBytes: start.maxTransferBytes,
434
- signal,
435
- dispatch: start.dispatch,
436
- original: (name, args) => originals[name](...args)
437
- });
438
- const errno = JSON.parse(runtime.runPython("__import__('json').dumps({name:value for name,value in vars(__import__('errno')).items() if name.startswith('E') and isinstance(value,int)})"));
439
- const encode = async (operation) => {
440
- try {
441
- return JSON.stringify(await operation());
442
- } catch (error) {
443
- return JSON.stringify({ errno: signal.aborted ? errno.EINTR : error.errno ?? errno[error.code ?? ""] ?? errno.EIO });
444
- }
422
+ if (start.packages) await installPythonPackages(
423
+ runtime,
424
+ start.packages,
425
+ (op, ...args) => start.dispatch({ op, args }),
426
+ start.maxTransferBytes
427
+ );
428
+ const unavailablePackage = () => {
429
+ throw new Error("Python package transport is only available during installation");
445
430
  };
446
- const absolute = (path) => path.startsWith("/") ? path : filesystem.cwd() + "/" + path;
447
- const bootstrapPath = (path) => path === start.runtimeMount || path.startsWith(start.runtimeMount + "/");
448
- const module = runtime._module;
449
- const send = async (pointer) => {
450
- let response = await encode(async () => {
451
- const payload = JSON.parse(module.UTF8ToString(pointer));
452
- if (payload[0] === "host") {
453
- try {
454
- if (!start.host || !acceptingHostCalls) throw new Error("Python host capability unavailable");
455
- return { value: await start.host.request(payload[1]) };
456
- } catch (error) {
457
- return { errorCode: pythonHostFailureCode(error), error: signal.aborted ? "Python host operation cancelled" : "Python host operation failed" };
458
- }
459
- }
460
- signal.throwIfAborted();
461
- const [operation, path, follow] = payload;
462
- if (operation === "stat") return native.metadata(path, follow);
463
- if (typeof path !== "string") throw Object.assign(new Error("Invalid native Python path"), { code: "EINVAL" });
464
- const target = absolute(path);
465
- if (operation === "directory") {
466
- const entries = bootstrapPath(target) ? filesystem.readdir(target).filter((name) => name !== "." && name !== "..") : (await start.dispatch({ op: "readdir", args: [target] })).map((entry) => entry.name);
467
- return { entries };
431
+ if ("loadPackage" in runtime) runtime.loadPackage = unavailablePackage;
432
+ if (runtime._api.packageManager) runtime._api.packageManager.downloadPackage = unavailablePackage;
433
+ if (start.installOnly) {
434
+ start.onReady();
435
+ const message = new TextEncoder().encode(start.packages?.uninstall ? "" : "Successfully installed requested Python packages\n");
436
+ for (let offset = 0; offset < message.length; offset += start.maxTransferBytes) {
437
+ await start.dispatch({ op: "stdout", args: [Array.from(message.subarray(offset, offset + start.maxTransferBytes))] });
438
+ }
439
+ } else {
440
+ runtime.runPython("import sys, os, json, runpy, traceback, types, warnings, textwrap, io, struct, linecache, importlib.machinery, shutil, stat, pyodide.ffi");
441
+ runtime.globals.set("_safe_runtime_mount", start.runtimeMount);
442
+ const filesystem = runtime.FS;
443
+ const bootstrap = filesystem.root;
444
+ filesystem.root = null;
445
+ filesystem.mount(filesystem.filesystems.MEMFS, {}, "/");
446
+ filesystem.mkdir(start.runtimeMount);
447
+ filesystem.mount({ mount: () => bootstrap }, {}, start.runtimeMount);
448
+ runtime.runPython(pythonRuntimeRelocation);
449
+ filesystem.currentPath = start.invocation.cwd;
450
+ native = createPythonNativeSyscalls({
451
+ getUmask: () => guestMask,
452
+ runtime: runtime._module,
453
+ cwd: start.invocation.cwd,
454
+ runtimeMount: start.runtimeMount,
455
+ maxTransferBytes: start.maxTransferBytes,
456
+ signal,
457
+ dispatch: start.dispatch,
458
+ original: (name, args) => originals[name](...args)
459
+ });
460
+ const errno = JSON.parse(runtime.runPython("__import__('json').dumps({name:value for name,value in vars(__import__('errno')).items() if name.startswith('E') and isinstance(value,int)})"));
461
+ const encode = async (operation) => {
462
+ try {
463
+ return JSON.stringify(await operation());
464
+ } catch (error) {
465
+ return JSON.stringify({ errno: signal.aborted ? errno.EINTR : error.errno ?? errno[error.code ?? ""] ?? errno.EIO });
468
466
  }
469
- if (operation === "tree") {
470
- if (bootstrapPath(target) || !await start.dispatch({ op: "rmtreeSupported", args: [target] })) return { supported: false };
471
- try {
472
- await start.dispatch({ op: "rmtree", args: [target] });
473
- return { supported: true };
474
- } catch (error) {
475
- return { supported: true, errno: errno[error.code ?? ""] ?? errno.EIO };
467
+ };
468
+ const absolute = (path) => path.startsWith("/") ? path : filesystem.cwd() + "/" + path;
469
+ const bootstrapPath = (path) => path === start.runtimeMount || path.startsWith(start.runtimeMount + "/");
470
+ const module = runtime._module;
471
+ const send = async (pointer) => {
472
+ let response = await encode(async () => {
473
+ const payload = JSON.parse(module.UTF8ToString(pointer));
474
+ if (payload[0] === "host") {
475
+ try {
476
+ if (!start.host || !acceptingHostCalls) throw new Error("Python host capability unavailable");
477
+ return { value: await start.host.request(payload[1]) };
478
+ } catch (error) {
479
+ return { errorCode: pythonHostFailureCode(error), error: signal.aborted ? "Python host operation cancelled" : "Python host operation failed" };
480
+ }
476
481
  }
477
- }
478
- throw Object.assign(new Error("Invalid native Python operation"), { code: "EINVAL" });
482
+ signal.throwIfAborted();
483
+ const [operation, path, follow] = payload;
484
+ if (operation === "stat") return native.metadata(path, follow);
485
+ if (typeof path !== "string") throw Object.assign(new Error("Invalid native Python path"), { code: "EINVAL" });
486
+ const target = absolute(path);
487
+ if (operation === "directory") {
488
+ const entries = bootstrapPath(target) ? filesystem.readdir(target).filter((name) => name !== "." && name !== "..") : (await start.dispatch({ op: "readdir", args: [target] })).map((entry) => entry.name);
489
+ return { entries };
490
+ }
491
+ if (operation === "tree") {
492
+ if (bootstrapPath(target) || !await start.dispatch({ op: "rmtreeSupported", args: [target] })) return { supported: false };
493
+ try {
494
+ await start.dispatch({ op: "rmtree", args: [target] });
495
+ return { supported: true };
496
+ } catch (error) {
497
+ return { supported: true, errno: errno[error.code ?? ""] ?? errno.EIO };
498
+ }
499
+ }
500
+ throw Object.assign(new Error("Invalid native Python operation"), { code: "EINVAL" });
501
+ });
502
+ if (response.length > 1048576) response = JSON.stringify({ errno: errno.EFBIG });
503
+ let bytes = new TextEncoder().encode(response);
504
+ if (bytes.length > 1048576) bytes = new TextEncoder().encode(JSON.stringify({ errno: errno.EFBIG }));
505
+ const output = module._malloc(bytes.length + 1);
506
+ if (!output) return 0;
507
+ module.HEAPU8.set(bytes, output);
508
+ module.HEAPU8[output + bytes.length] = 0;
509
+ return output;
510
+ };
511
+ const nativeCall = new engine.Instance(options.nativeCall, {
512
+ python: {
513
+ utf8: module._PyUnicode_AsUTF8,
514
+ unicode: module._PyUnicode_FromString,
515
+ free: module._free,
516
+ noMemory: module._PyErr_NoMemory
517
+ },
518
+ request: { send },
519
+ shutdown: { send: new engine.Suspending(send) },
520
+ control: { active, syncify }
479
521
  });
480
- if (response.length > 1048576) response = JSON.stringify({ errno: errno.EFBIG });
481
- let bytes = new TextEncoder().encode(response);
482
- if (bytes.length > 1048576) bytes = new TextEncoder().encode(JSON.stringify({ errno: errno.EFBIG }));
483
- const output = module._malloc(bytes.length + 1);
484
- if (!output) return 0;
485
- module.HEAPU8.set(bytes, output);
486
- module.HEAPU8[output + bytes.length] = 0;
487
- return output;
488
- };
489
- const nativeCall = new engine.Instance(options.nativeCall, {
490
- python: {
491
- utf8: module._PyUnicode_AsUTF8,
492
- unicode: module._PyUnicode_FromString,
493
- free: module._free,
494
- noMemory: module._PyErr_NoMemory
495
- },
496
- request: { send },
497
- shutdown: { send: new engine.Suspending(send) },
498
- control: { active, syncify }
499
- });
500
- methodPointer = module.addFunction(nativeCall.exports.call, "iii");
501
- methodDefinition = module._malloc(128);
502
- if (!methodDefinition) throw new PythonFailure("runtime-assets");
503
- module.HEAPU8.fill(0, methodDefinition, methodDefinition + 128);
504
- module.HEAPU8.set(new TextEncoder().encode("request\0_safe_native_fs\0"), methodDefinition + 16);
505
- module.HEAPU32.set([methodDefinition + 16, methodPointer, 8, 0], methodDefinition / 4);
506
- const extension = module._PyImport_AddModule(methodDefinition + 24);
507
- const callable = module._PyCFunction_NewEx(methodDefinition, 0, 0);
508
- if (!extension || !callable || module._PyModule_AddObject(extension, methodDefinition + 16, callable) < 0) throw new PythonFailure("runtime-abi");
509
- const fields = Number(runtime.runPython("os.stat_result.n_fields"));
510
- const statResult = new engine.Instance(options.statResult, { python: {
511
- fields: new engine.Global({ value: "i32" }, fields),
512
- create: module._PyStructSequence_New,
513
- size: module._PyTuple_Size,
514
- item: module._PyTuple_GetItem,
515
- retain: module._Py_IncRef,
516
- set: module._PyStructSequence_SetItem,
517
- invalid: module._PyErr_BadArgument
518
- } });
519
- statPointer = module.addFunction(statResult.exports.construct, "iii");
520
- module.HEAPU8.set(new TextEncoder().encode("stat_result\0os\0"), methodDefinition + 80);
521
- module.HEAPU32.set([methodDefinition + 80, statPointer, 8, 0], (methodDefinition + 64) / 4);
522
- const osModule = module._PyImport_AddModule(methodDefinition + 92);
523
- const statType = module._PyObject_GetAttrString(osModule, methodDefinition + 80);
524
- const constructStat = module._PyCFunction_NewEx(methodDefinition + 64, statType, 0);
525
- module._Py_DecRef(statType);
526
- if (!constructStat || module._PyModule_AddObject(extension, methodDefinition + 80, constructStat) < 0) throw new PythonFailure("runtime-abi");
527
- runtime.runPython(`
522
+ methodPointer = module.addFunction(nativeCall.exports.call, "iii");
523
+ methodDefinition = module._malloc(128);
524
+ if (!methodDefinition) throw new PythonFailure("runtime-assets");
525
+ module.HEAPU8.fill(0, methodDefinition, methodDefinition + 128);
526
+ module.HEAPU8.set(new TextEncoder().encode("request\0_safe_native_fs\0"), methodDefinition + 16);
527
+ module.HEAPU32.set([methodDefinition + 16, methodPointer, 8, 0], methodDefinition / 4);
528
+ const extension = module._PyImport_AddModule(methodDefinition + 24);
529
+ const callable = module._PyCFunction_NewEx(methodDefinition, 0, 0);
530
+ if (!extension || !callable || module._PyModule_AddObject(extension, methodDefinition + 16, callable) < 0) throw new PythonFailure("runtime-abi");
531
+ const fields = Number(runtime.runPython("os.stat_result.n_fields"));
532
+ const statResult = new engine.Instance(options.statResult, { python: {
533
+ fields: new engine.Global({ value: "i32" }, fields),
534
+ create: module._PyStructSequence_New,
535
+ size: module._PyTuple_Size,
536
+ item: module._PyTuple_GetItem,
537
+ retain: module._Py_IncRef,
538
+ set: module._PyStructSequence_SetItem,
539
+ invalid: module._PyErr_BadArgument
540
+ } });
541
+ statPointer = module.addFunction(statResult.exports.construct, "iii");
542
+ module.HEAPU8.set(new TextEncoder().encode("stat_result\0os\0"), methodDefinition + 80);
543
+ module.HEAPU32.set([methodDefinition + 80, statPointer, 8, 0], (methodDefinition + 64) / 4);
544
+ const osModule = module._PyImport_AddModule(methodDefinition + 92);
545
+ const statType = module._PyObject_GetAttrString(osModule, methodDefinition + 80);
546
+ const constructStat = module._PyCFunction_NewEx(methodDefinition + 64, statType, 0);
547
+ module._Py_DecRef(statType);
548
+ if (!constructStat || module._PyModule_AddObject(extension, methodDefinition + 80, constructStat) < 0) throw new PythonFailure("runtime-abi");
549
+ runtime.runPython(`
528
550
  from _safe_native_fs import request as _safe_native_request
529
551
  def _safe_stat_projection(path, follow):
530
552
  return _safe_native_request(json.dumps(['stat', path, follow]))
@@ -535,8 +557,8 @@ def _safe_directory_entries(path):
535
557
  def _safe_tree_cleanup(path):
536
558
  return _safe_native_request(json.dumps(['tree', path]))
537
559
  `);
538
- for (const script of [pythonImportMetadata, pythonDirectoryEntries, pythonStatProjection, pythonTreeCleanup]) runtime.runPython(script);
539
- runtime.runPython(`
560
+ for (const script of [pythonImportMetadata, pythonDirectoryEntries, pythonStatProjection, pythonTreeCleanup]) runtime.runPython(script);
561
+ runtime.runPython(`
540
562
  from _safe_native_fs import stat_result as _safe_construct_stat
541
563
  _safe_stat_fields = os.stat_result.n_fields
542
564
  _safe_stat_probe = os.stat_result(tuple(range(_safe_stat_fields)))
@@ -549,18 +571,18 @@ def _safe_native_stat_type(values, extras):
549
571
  return _safe_construct_stat(tuple(fields))
550
572
  _safe_stat_type = _safe_native_stat_type
551
573
  `);
552
- runtime.runPython(pythonHostModule);
553
- installPythonLlmModule(runtime);
554
- installPythonShellModule(runtime);
555
- installPythonJspiRunSync(runtime);
556
- runtime.runPython(pythonLibraryAdapter);
557
- runtime.runPython("import tempfile; tempfile.tempdir = None");
558
- runtime.globals.set("_safe_invocation_json", JSON.stringify(start.invocation));
559
- runtime.globals.set("_safe_execution_code", pythonExecution);
560
- runtime.globals.set("_safe_is_cancelled", () => signal.aborted);
561
- active.value = 1;
562
- start.onReady();
563
- exitCode = Number(await runtime.runPythonAsync(`
574
+ runtime.runPython(pythonHostModule);
575
+ installPythonLlmModule(runtime);
576
+ installPythonShellModule(runtime);
577
+ installPythonJspiRunSync(runtime);
578
+ runtime.runPython(pythonLibraryAdapter);
579
+ runtime.runPython("import tempfile; tempfile.tempdir = None");
580
+ runtime.globals.set("_safe_invocation_json", JSON.stringify(start.invocation));
581
+ runtime.globals.set("_safe_execution_code", pythonExecution);
582
+ runtime.globals.set("_safe_is_cancelled", () => signal.aborted);
583
+ active.value = 1;
584
+ start.onReady();
585
+ exitCode = Number(await runtime.runPythonAsync(`
564
586
  try:
565
587
  exec(_safe_execution_code)
566
588
  except BaseException:
@@ -569,6 +591,7 @@ except BaseException:
569
591
  _safe_exit = 130
570
592
  _safe_exit
571
593
  `)) & 255;
594
+ }
572
595
  } finally {
573
596
  try {
574
597
  if (qualified) {
@@ -0,0 +1,47 @@
1
+ // packages/safe-bash-command-python/src/package-file.ts
2
+ import { yieldTurn } from "../../safe-bash-contracts/yield.js";
3
+ import { sha256 } from "@noble/hashes/sha2.js";
4
+ import { compareIdentity, compareFileVersion } from "@poe-platform/safe-fs/core";
5
+ async function openPythonPackageFile({ fs, signal }, path, maxBytes, expected) {
6
+ const settings = { signal };
7
+ const capabilities = await fs.capabilitiesFor?.(path, settings) ?? fs.capabilities;
8
+ if (!capabilities.retainedRead || !fs.openReadFile) return void 0;
9
+ const file = await fs.openReadFile(path, settings);
10
+ try {
11
+ signal.throwIfAborted();
12
+ const state = { ...await file.stat(settings) };
13
+ if (expected && (compareIdentity(expected, state) !== "same" || !compareFileVersion(expected, state))) throw new Error("Canonical Python wheel changed");
14
+ if (state.type !== "file" || !Number.isSafeInteger(state.size) || state.size < 0) throw new Error("Invalid canonical Python wheel");
15
+ if (state.size > maxBytes) throw new Error("Canonical package exceeds maxDownloadBytes");
16
+ const check = async () => {
17
+ signal.throwIfAborted();
18
+ const current = await file.stat(settings);
19
+ if (compareIdentity(state, current) !== "same" || !compareFileVersion(state, current)) throw new Error("Canonical Python wheel changed");
20
+ };
21
+ const read = async (offset, length) => {
22
+ await check();
23
+ const count = Math.min(length, Math.max(0, state.size - offset));
24
+ if (!count) return new Uint8Array(0);
25
+ const bytes = Uint8Array.from(await file.read(offset, count, settings));
26
+ if (!bytes.length || bytes.length > count) throw new Error("Invalid canonical package read");
27
+ await check();
28
+ return bytes;
29
+ };
30
+ const hash = sha256.create();
31
+ for (let offset = 0, pulls = 0; offset < state.size; ) {
32
+ if (++pulls % 16 === 0) await yieldTurn(signal);
33
+ const bytes = await read(offset, 65536);
34
+ hash.update(bytes);
35
+ offset += bytes.length;
36
+ }
37
+ await check();
38
+ return { key: Array.from(hash.digest(), (byte) => byte.toString(16).padStart(2, "0")).join(""), size: state.size, read, close: () => file.close() };
39
+ } catch (error) {
40
+ await file.close();
41
+ throw error;
42
+ }
43
+ }
44
+
45
+ export {
46
+ openPythonPackageFile
47
+ };
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  applyTableUpdate,
3
3
  readTable
4
- } from "./chunk-JQPDVCBU.js";
4
+ } from "./chunk-565AAQTV.js";
5
5
  import {
6
6
  nodeFor
7
- } from "./chunk-4HJEZGYN.js";
7
+ } from "./chunk-YODHIRPW.js";
8
8
  import {
9
9
  attr,
10
10
  required
11
- } from "./chunk-UDRJKA3P.js";
11
+ } from "./chunk-C23L4HZB.js";
12
12
  import {
13
13
  parseXmlPart
14
14
  } from "./chunk-YWP62BAZ.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SelectionError,
3
3
  readSelectionIndex
4
- } from "./chunk-SKF6PGA5.js";
4
+ } from "./chunk-I2OKE2NI.js";
5
5
  import {
6
6
  readPackage
7
7
  } from "./chunk-KVTZJBLM.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  themeColorSlots,
3
3
  validateColor
4
- } from "./chunk-75OUKYCM.js";
4
+ } from "./chunk-CH5JDE3C.js";
5
5
  import {
6
6
  readXmlPercentage
7
7
  } from "./chunk-LBILRPVR.js";