@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,8 +1,9 @@
1
1
  // packages/safe-bash/src/commands/llm/index.ts
2
- import { LlmCancelToolCall, createElevenLabsProvider, createLlmCommand, createLlmCommands, createLlmConfiguration, createLlmFragmentLoaders, createLlmFragmentSource, createLlmInputBudget, createLlmService, createLlmSpool, createLlmTemplateStore, createLlmToolRegistry, createLlmUrlFragmentSource, createLlmUrlSource, createOpenAiProvider, encodeLlmBase64, evaluateLlmTemplate, executeLlmToolCalls, findExtractedRange, getLlmAttachmentUrlId, getLlmFragmentPrefix, getLlmModelAliases, llmCommands, llmReferenceVersion, llmTemplateUsesInput, loadLlmPluginFragments, openAiChatOptions, parseLlmSchemaDsl, resolveLlmSchemaInput, resolveLlmUrlAttachment, selectLlmModelByQuery, selectLlmTools, serializeLlmJsonString, serializeLlmJsonValue, serializeLlmTokenUsage, serializeOpenAiChatRequest, streamLlmToolChain, templateYaml, validateLlmTemplateParameters, validateModelOptions } from "../../safe-bash-command-llm/index.js";
2
+ import { LlmCancelToolCall, LlmLoaderLookupError, createElevenLabsProvider, createLlmCommand, createLlmCommands, createLlmConfiguration, createLlmFragmentLoaders, createLlmFragmentSource, createLlmInputBudget, createLlmService, createLlmSpool, createLlmTemplateStore, createLlmToolRegistry, createLlmUrlFragmentSource, createLlmUrlSource, createOpenAiProvider, encodeLlmBase64, evaluateLlmTemplate, executeLlmToolCalls, findExtractedRange, getLlmAttachmentUrlId, getLlmFragmentPrefix, getLlmModelAliases, llmCommands, llmReferenceVersion, llmTemplateUsesInput, loadLlmPluginFragments, openAiChatOptions, parseLlmSchemaDsl, resolveLlmSchemaInput, resolveLlmUrlAttachment, selectLlmModelByQuery, selectLlmTools, serializeLlmJsonString, serializeLlmJsonValue, serializeLlmTokenUsage, serializeOpenAiChatRequest, streamLlmToolChain, templateYaml, validateLlmTemplateParameters, validateModelOptions } from "../../safe-bash-command-llm/index.js";
3
3
 
4
4
  export {
5
5
  LlmCancelToolCall,
6
+ LlmLoaderLookupError,
6
7
  createElevenLabsProvider,
7
8
  createLlmCommand,
8
9
  createLlmCommands,
@@ -0,0 +1,42 @@
1
+ // packages/safe-bash/src/commands/python/index.ts
2
+ import { PythonFailure, PythonPackageConflictError, createPythonBuildBackend, createPythonBuildDependencies, createPythonBuildEnvironment, createPythonCommands, createPythonExecutorCommands, createPythonExecutorPool, createPythonHostBridge, createPythonJspiAssets, createPythonJspiExecutor, createPythonJspiNativeCall, createPythonJspiStatResult, createPythonJspiTrampoline, createPythonLlmCapability, createPythonLlmFragmentLoader, createPythonLlmLoaderDiscovery, createPythonLlmLoaderProvider, createPythonLlmPackageManager, createPythonLlmTemplateLoader, createPythonLlmToolLoader, createPythonPackageCache, createPythonPackageEnvironment, createPythonPackageManifestStore, createPythonShellCapability, createPythonSourcePackageEnvironment, createPythonSourceSnapshot, inspectPythonCapabilities, installPythonLlmDependencies, installPythonLlmPackages, publishPythonBuildWheel, pythonCommands, pythonDocumentPackages, pythonExecutorCommands, pythonHostFailureCode, pythonLlmDependencies, pythonLlmPackages } from "../../safe-bash-command-python/index.js";
3
+
4
+ export {
5
+ PythonFailure,
6
+ PythonPackageConflictError,
7
+ createPythonBuildBackend,
8
+ createPythonBuildDependencies,
9
+ createPythonBuildEnvironment,
10
+ createPythonCommands,
11
+ createPythonExecutorCommands,
12
+ createPythonExecutorPool,
13
+ createPythonHostBridge,
14
+ createPythonJspiAssets,
15
+ createPythonJspiExecutor,
16
+ createPythonJspiNativeCall,
17
+ createPythonJspiStatResult,
18
+ createPythonJspiTrampoline,
19
+ createPythonLlmCapability,
20
+ createPythonLlmFragmentLoader,
21
+ createPythonLlmLoaderDiscovery,
22
+ createPythonLlmLoaderProvider,
23
+ createPythonLlmPackageManager,
24
+ createPythonLlmTemplateLoader,
25
+ createPythonLlmToolLoader,
26
+ createPythonPackageCache,
27
+ createPythonPackageEnvironment,
28
+ createPythonPackageManifestStore,
29
+ createPythonShellCapability,
30
+ createPythonSourcePackageEnvironment,
31
+ createPythonSourceSnapshot,
32
+ inspectPythonCapabilities,
33
+ installPythonLlmDependencies,
34
+ installPythonLlmPackages,
35
+ publishPythonBuildWheel,
36
+ pythonCommands,
37
+ pythonDocumentPackages,
38
+ pythonExecutorCommands,
39
+ pythonHostFailureCode,
40
+ pythonLlmDependencies,
41
+ pythonLlmPackages
42
+ };
@@ -80,7 +80,7 @@ import {
80
80
  wcDisplayWidth,
81
81
  writeFileOutput,
82
82
  yieldTurn
83
- } from "./chunk-IRJS54AA.js";
83
+ } from "./chunk-VWLQDZFF.js";
84
84
  import {
85
85
  compareByteArrays,
86
86
  compareCopyIdentity,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-GI7OALXO.js";
4
4
  import {
5
5
  yieldTurn
6
- } from "./chunk-IRJS54AA.js";
6
+ } from "./chunk-VWLQDZFF.js";
7
7
  import {
8
8
  latin1Text
9
9
  } from "./chunk-N4CQ5E3G.js";
@@ -14405,10 +14405,16 @@ var BudgetedPipeStageSink = class {
14405
14405
  }
14406
14406
  }
14407
14407
  writeSync(chunk) {
14408
- this.budget.assertPipelineInput(chunk.byteLength);
14409
- this.budget.bytes += chunk.byteLength;
14408
+ if (!this.canWriteSync(chunk.byteLength)) return false;
14409
+ this.signal.throwIfAborted();
14410
+ if (!(chunk instanceof Uint8Array)) throw new TypeError("Shell output must be Uint8Array");
14411
+ const budget = this.budget;
14412
+ if (chunk.byteLength > budget.limits.maxOutputBytes - budget.bytes) budget.fail("maxOutputBytes");
14413
+ budget.assertPipelineInput(chunk.byteLength);
14414
+ budget.bytes += chunk.byteLength;
14410
14415
  this.writable.write(chunk);
14411
14416
  if (chunk.byteLength && this.written) this.written.add(this.index);
14417
+ return true;
14412
14418
  }
14413
14419
  write(chunk) {
14414
14420
  try {
@@ -29331,6 +29337,9 @@ function exportedVariablesView(rawState) {
29331
29337
  }
29332
29338
  var evalSyncFd = (...args) => syncCommandEvaluators.evalSyncFd?.(...args);
29333
29339
  var evalSyncRg = (...args) => syncCommandEvaluators.evalSyncRg?.(...args);
29340
+ function canWriteBuiltinOutput(budget, pipe, byteLength3) {
29341
+ return (!pipe || pipe.canWriteSync(byteLength3)) && (budget.bytes + byteLength3 <= budget.maxOutputBytesSmi || byteLength3 <= budget.limits.maxOutputBytes - budget.bytes);
29342
+ }
29334
29343
  var createFmtEngine = (...args) => syncCommandEvaluators.createFmtEngine(...args);
29335
29344
  var parseFmtArguments = (...args) => syncCommandEvaluators.parseFmtArguments(...args);
29336
29345
  var evalSyncCal = (...args) => syncCommandEvaluators.evalSyncCal?.(...args);
@@ -29484,11 +29493,13 @@ function initializeSyncPrototypes() {
29484
29493
  }
29485
29494
  });
29486
29495
  Object.assign(BudgetedPipeStageSink.prototype, {
29487
- canWriteSync() {
29496
+ canWriteSync(byteLength3 = 0) {
29488
29497
  if (this.signal.aborted) return false;
29489
29498
  const w = this.writable;
29490
29499
  const pipe = w._pipe;
29491
- return Boolean(w.open && pipe && !pipe.failed && !pipe.signal?.aborted && pipe.readerReferences && (!pipe.writes || pipe.writes.size === 0) && (pipe.availableBytes ?? 0) < (pipe.highWaterMark ?? 0));
29500
+ const avail = pipe?.availableBytes ?? 0;
29501
+ const hwm = pipe?.highWaterMark ?? 0;
29502
+ return Boolean(w.open && pipe && !pipe.failed && !pipe.signal?.aborted && pipe.readerReferences && (!pipe.writes || pipe.writes.size === 0) && (byteLength3 > 0 ? avail + byteLength3 <= hwm : avail < hwm));
29492
29503
  }
29493
29504
  });
29494
29505
  }
@@ -39051,7 +39062,7 @@ var syncExtraRuntimeMethods = {
39051
39062
  const encoded = disc.status === 0 ? encodeRedirectTextWithNewlineToScratch(disc.text) ?? fastSharedTextEncoder2.encode(`${disc.text}
39052
39063
  `) : void 0;
39053
39064
  const byteLength3 = encoded ? encoded.byteLength : 0;
39054
- if (byteLength3 === 0 || this.budget.bytes + byteLength3 <= this.budget.maxOutputBytesSmi || byteLength3 <= this.budget.limits.maxOutputBytes - this.budget.bytes) {
39065
+ if (byteLength3 === 0 || canWriteBuiltinOutput(this.budget, fastPipeSink, byteLength3)) {
39055
39066
  if (rawState.extensions && !rawState.extensions.eventDepth) publishCommandSpelling(rawState, commandSpelling(command));
39056
39067
  const restEpoch = monitor.chargeInternal(syncRestorationCharge, syncRestorationTickets).epoch;
39057
39068
  this.budget.tick();
@@ -39085,7 +39096,7 @@ var syncExtraRuntimeMethods = {
39085
39096
  const encoded = encodeRedirectTextWithNewlineToScratch(rawState.cwd) ?? fastSharedTextEncoder2.encode(`${rawState.cwd}
39086
39097
  `);
39087
39098
  const byteLength3 = encoded.byteLength;
39088
- if (this.budget.bytes + byteLength3 <= this.budget.maxOutputBytesSmi || byteLength3 <= this.budget.limits.maxOutputBytes - this.budget.bytes) {
39099
+ if (canWriteBuiltinOutput(this.budget, fastPipeSink, byteLength3)) {
39089
39100
  if (rawState.extensions && !rawState.extensions.eventDepth) publishCommandSpelling(rawState, commandSpelling(command));
39090
39101
  const restEpoch = monitor.chargeInternal(syncRestorationCharge, syncRestorationTickets).epoch;
39091
39102
  this.budget.tick();
@@ -39154,7 +39165,7 @@ var syncExtraRuntimeMethods = {
39154
39165
  const encoded = encodeRedirectTextWithNewlineToScratch(outText) ?? fastSharedTextEncoder2.encode(`${outText}
39155
39166
  `);
39156
39167
  const byteLength3 = encoded.byteLength;
39157
- if (this.budget.bytes + byteLength3 <= this.budget.maxOutputBytesSmi || byteLength3 <= this.budget.limits.maxOutputBytes - this.budget.bytes) {
39168
+ if (canWriteBuiltinOutput(this.budget, fastPipeSink, byteLength3)) {
39158
39169
  if (rawState.extensions && !rawState.extensions.eventDepth) publishCommandSpelling(rawState, commandSpelling(command));
39159
39170
  const restEpoch = monitor.chargeInternal(syncRestorationCharge, syncRestorationTickets).epoch;
39160
39171
  this.budget.tick();
@@ -39252,7 +39263,7 @@ var syncExtraRuntimeMethods = {
39252
39263
  if (preEncoded !== void 0 || formatted2 !== void 0) {
39253
39264
  const encoded = preEncoded ?? encodeRedirectTextToScratch(formatted2);
39254
39265
  const byteLength3 = encoded.byteLength;
39255
- if (this.budget.bytes + byteLength3 <= this.budget.maxOutputBytesSmi || byteLength3 <= this.budget.limits.maxOutputBytes - this.budget.bytes) {
39266
+ if (canWriteBuiltinOutput(this.budget, fastPipeSink, byteLength3)) {
39256
39267
  const restEpoch = monitor.chargeInternal(syncRestorationCharge, syncRestorationTickets).epoch;
39257
39268
  this.budget.tick();
39258
39269
  if (fastSyncSink) {
@@ -44747,15 +44758,12 @@ ${s1}
44747
44758
  }
44748
44759
  const chunk = fastSharedTextEncoder2.encode(this._syncStdoutBatch);
44749
44760
  this._syncStdoutBatch = "";
44750
- if (io.stdout instanceof BudgetedSyncSink && io.stdout.write === BudgetedSyncSink.prototype.write || io.stdout instanceof Capture && io.stdout.write === Capture.prototype.write) {
44761
+ if (io.stdout instanceof BudgetedSyncSink && io.stdout.write === BudgetedSyncSink.prototype.write || io.stdout instanceof Capture && io.stdout.write === Capture.prototype.write || io.stdout instanceof BudgetedPipeStageSink && io.stdout.write === BudgetedPipeStageSink.prototype.write && io.stdout.canWriteSync(chunk.byteLength)) {
44751
44762
  if (io.stdout.budget !== this.budget) {
44752
44763
  if (chunk.byteLength > this.budget.limits.maxOutputBytes - this.budget.bytes) this.budget.fail("maxOutputBytes");
44753
44764
  this.budget.bytes += chunk.byteLength;
44754
44765
  }
44755
44766
  io.stdout.writeSync(chunk);
44756
- } else if (io.stdout instanceof BudgetedPipeStageSink && io.stdout.canWriteSync()) {
44757
- if (chunk.byteLength > this.budget.limits.maxOutputBytes - this.budget.bytes) this.budget.fail("maxOutputBytes");
44758
- io.stdout.writeSync(chunk);
44759
44767
  } else {
44760
44768
  if (budgetedSinks.get(io.stdout)?.budget !== this.budget) {
44761
44769
  if (chunk.byteLength > this.budget.limits.maxOutputBytes - this.budget.bytes) this.budget.fail("maxOutputBytes");
@@ -5,7 +5,7 @@ import {
5
5
  composeAgentCommands,
6
6
  createAgentCommandPlugin,
7
7
  createRegexExecutors
8
- } from "./chunk-VF3Q2V3E.js";
8
+ } from "./chunk-RAFD5ZAH.js";
9
9
  import {
10
10
  createOpCommands
11
11
  } from "./chunk-UKMP6ZT5.js";
@@ -2,7 +2,7 @@ import {
2
2
  nodeFor,
3
3
  selected,
4
4
  validateSelection
5
- } from "./chunk-4HJEZGYN.js";
5
+ } from "./chunk-YODHIRPW.js";
6
6
  import {
7
7
  Length
8
8
  } from "./chunk-GNVAW6NL.js";
@@ -11,10 +11,10 @@ import {
11
11
  child,
12
12
  loadShared,
13
13
  required
14
- } from "./chunk-UDRJKA3P.js";
14
+ } from "./chunk-C23L4HZB.js";
15
15
  import {
16
16
  SelectionError
17
- } from "./chunk-SKF6PGA5.js";
17
+ } from "./chunk-I2OKE2NI.js";
18
18
  import {
19
19
  OfficeError
20
20
  } from "./chunk-VJQ5OWS5.js";
@@ -1,5 +1,5 @@
1
1
  // packages/safe-bash-command-llm/src/request-source.ts
2
- function waitForSource(start, signal) {
2
+ function waitForSource(start, signal, late) {
3
3
  signal.throwIfAborted();
4
4
  return new Promise((resolve, reject) => {
5
5
  const abort = () => {
@@ -13,8 +13,10 @@ function waitForSource(start, signal) {
13
13
  }).then(
14
14
  (value) => {
15
15
  signal.removeEventListener("abort", abort);
16
- if (signal.aborted) reject(signal.reason);
17
- else resolve(value);
16
+ if (signal.aborted) {
17
+ if (late) void Promise.resolve().then(() => late(value)).catch(() => void 0);
18
+ reject(signal.reason);
19
+ } else resolve(value);
18
20
  },
19
21
  (error) => {
20
22
  signal.removeEventListener("abort", abort);
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  attr,
3
3
  child
4
- } from "./chunk-UDRJKA3P.js";
4
+ } from "./chunk-C23L4HZB.js";
5
5
  import {
6
6
  OfficeError
7
7
  } from "./chunk-VJQ5OWS5.js";
@@ -66,10 +66,10 @@ async function exact(source, offset, length, signal) {
66
66
  async function readZipSpan(source, index, signal) {
67
67
  return decode(await exact(source, index * recordBytes, recordBytes, signal), 0);
68
68
  }
69
- async function validateZipSpans(index, count, factory, signal, chunkSize, initial, centralStart) {
69
+ async function validateZipSpans(index, count, factory, signal, chunkSize, initial, centralStart, allowUnreferencedData = false) {
70
70
  if (!count) {
71
71
  const start = initial ?? centralStart;
72
- if (start !== centralStart) fail("ZIP unreferenced local data is unsupported");
72
+ if (!allowUnreferencedData && start !== centralStart) fail("ZIP unreferenced local data is unsupported");
73
73
  return start;
74
74
  }
75
75
  const windowRecords = Math.max(1, Math.floor(Math.min(chunkSize, 65536) / recordBytes));
@@ -136,11 +136,11 @@ async function validateZipSpans(index, count, factory, signal, chunkSize, initia
136
136
  let covered = prefix;
137
137
  while (record) {
138
138
  signal.throwIfAborted();
139
- if (record.start !== covered) fail("ZIP overlapping spans, gaps or self-extracting prefix are unsupported");
139
+ if (record.start < covered || !allowUnreferencedData && record.start !== covered) fail("ZIP overlapping spans, gaps or self-extracting prefix are unsupported");
140
140
  covered = record.end;
141
141
  record = await sorted.next();
142
142
  }
143
- if (covered !== centralStart) fail("ZIP unreferenced local data is unsupported");
143
+ if (!allowUnreferencedData && covered !== centralStart) fail("ZIP unreferenced local data is unsupported");
144
144
  return prefix;
145
145
  } finally {
146
146
  try {
@@ -489,10 +489,10 @@ async function readZipArchive(input, limits, signal, profile = {}) {
489
489
  const prefix = profile.disks ? 4 : profile.prefix ? spans[0]?.start ?? reader.centralStart : 0;
490
490
  let covered = prefix;
491
491
  for (const span of spans) {
492
- if (span.start !== covered) fail2("ZIP overlapping spans, gaps or self-extracting prefix are unsupported");
492
+ if (span.start < covered || !profile.allowUnreferencedData && span.start !== covered) fail2("ZIP overlapping spans, gaps or self-extracting prefix are unsupported");
493
493
  covered = span.end;
494
494
  }
495
- if (covered !== reader.centralStart) fail2("ZIP unreferenced local data is unsupported");
495
+ if (!profile.allowUnreferencedData && covered !== reader.centralStart) fail2("ZIP unreferenced local data is unsupported");
496
496
  if (profile.grow) for (const entry of entries) {
497
497
  const start = entry.growStart, length = entry.growLength;
498
498
  zipGrowRecords.set(entry, input instanceof Uint8Array ? await reader.bytes.subarray(start, start + length) : { length, version: entry.growVersion, source: () => reader.bytes.stream(start, length) });
@@ -507,7 +507,7 @@ async function readZipIndexedArchive(input, limits, signal, createSpool, profile
507
507
  try {
508
508
  for await (const record of scanZipDirectory(reader, limits, signal, profile)) await spool.append(encodeZipSpan(record));
509
509
  const index = await spool.finish();
510
- const prefix = await validateZipSpans(index, reader.members, createSpool, signal, reader.chunkSize, profile.disks ? 4 : profile.prefix ? void 0 : 0, reader.centralStart);
510
+ const prefix = await validateZipSpans(index, reader.members, createSpool, signal, reader.chunkSize, profile.disks ? 4 : profile.prefix ? void 0 : 0, reader.centralStart, profile.allowUnreferencedData);
511
511
  const entries = {
512
512
  length: reader.members,
513
513
  async get(position) {
@@ -8,6 +8,7 @@ var PythonInvocationError = class extends Error {
8
8
  function parsePythonInvocation(args, env) {
9
9
  const startupArgs = [];
10
10
  let informational = false;
11
+ let module;
11
12
  scan: for (let index = 0; index < args.length; index++) {
12
13
  const option = args[index];
13
14
  if (option === "--" || option === "-" || !option.startsWith("-")) break;
@@ -33,6 +34,7 @@ function parsePythonInvocation(args, env) {
33
34
  if ("cmWX".includes(flag)) {
34
35
  const operand = option.slice(offset + 1) || args[++index];
35
36
  if (operand === void 0) throw new PythonInvocationError("argument expected for -" + flag);
37
+ if (flag === "m" && !informational) module = { name: operand, args: args.slice(index + 1) };
36
38
  if (flag === "c" || flag === "m") break scan;
37
39
  if (flag === "X") {
38
40
  const separator = operand.indexOf("=");
@@ -62,7 +64,214 @@ function parsePythonInvocation(args, env) {
62
64
  delete runtimeEnv.PYTHONWARNINGS;
63
65
  runtimeEnv.PYTHONINSPECT = "";
64
66
  startupArgs.push("-c", "");
65
- return { startupArgs, env: runtimeEnv };
67
+ return { startupArgs, env: runtimeEnv, module };
68
+ }
69
+
70
+ // packages/safe-bash-command-python/src/package-program.generated.ts
71
+ var pythonPackageProgramGzip = "H4sIAAAAAAACA7U7a4/cNpLf9Su4uMVKijVy4j0vdhtoJEbs3BlInNzY2SDX7hU4EnuaGbWkkGyPO5P574cqvvWYae8hn7pFkVXFYr2LatiOCEabSvZHUbOqF/yad5lgvx6ZVPkqIfww9EIRwQryi+y7hOxEfyBH0bb8qhyokMxOOYpWDi1XBfw7dvg/IRowWRMDc5PqkXSbEL4zr0upqFDylqt9lj5NAa/GM1C1b/mVRfEDVfuEeJjwnOmnvKSyOgqe5QngJ2tHj52QkI6ptq/1q1I/IBHpVynhnXkNuGvBGtYpTltZkH0vFVmbt6UGmX6VFuSLPCGwvOuBP+WBqnqfifRf7//8/m7z4uJ/6cVvn1/846LaPnl/n63mRvMv/5wWIbZ85YkEvAkRTB5bwH+XHkWbrgLmZhnsQ9Z7dmCFWYfML4Ft+t+vRyZOBUnTPL9PiDxeNVywWvXihEdSSkYFUr35j79sw9frbPOvv2w/y9OCOP7BeQVTVoa4TRqOpluyjqaV16I/Dhlwi3e7HrZyn3i+GakI1sMJ7Kncs2ZEYyb39Ivf5Z4+e/af8PPXv+PPs+d/g5/nXzz7/dA8z9fZhl7sPr/4x/ZJRD2g1GBXSMgmhSckVw87QskTkq5T8iQef5YnbsMNFxXASAHo3B4IayUjKRDOPzA9FzDBHwCjjqJDhSqb42GQmQYM1ApV3bCTXL8TR5YniZF8mEqoJJWkO1ahJuq/gknVC95dkzX5hraS2RX6B7T0wBRtqKJ+vR0xMAbB2p42yO9N4+Zv0jf0wNIt2fWCNKAh8eqy4VIJfnVUvO9klgMvpqu3CWrygdeiH/hQVnV/GKilj+gnfsVbrk5VS09MeDr1yxGAgdY39JpVB9rRaya8bcDh78wowHhLdyweHoG63TPWolAaID/BwGsYsOvdyHgbR8Vb6XaxZ/VNZffSsmALozdjMB9Y1/SCNWZbvLsupaiD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F24MlyJAopAaE8gr4G5NjnUej6F8qG5Z1VQxpHjJP6vq+dbLyOxj5gCw28enFFEZpuCU5TPLtZ+4xoafMDBu+siyJWwCvcbH7JN+lN/bMGLgwFZoezhgP7WDgZJduDXe0WuGDnQ7gg9cEKbBtovcM052HQ+6m96D3ieiJDgOA3R+shT07Lxe4qrnSGiMzGFuBBYgGjUDj4L4g+irxlrSPbz0y7/khiK9RrayVt0ibMfGrS8Y3BdSZew87Ltb5lOYwNWGhC8I1l6Anxdih9pmk3bdsp5tP7cH+EGihz6TjKSASMEG6y4aVSYf+fklmrjgq2kHVF75j+nsRDkipwK0hXE8m9M9XoN9NrSu7NJps7R9tfwkZivcpgBZ3zgWUcU4WvQmm/xTeYv10c5LL1qgy6lhlLa8eDayOz7oB8YpxfOZGSbUGe381dEplBj8hy9n5omjsk/z5rbe8DxEnNb9U2v0Eij40TQA5USVulU7IwE3dgk0nBtQaB23DI171dnsxOgv6aiyZYmY6AT99kfMv0ujfsD7qT80VGdEzXWYK4z9zFCxJY8DpPHjfCQz3aqybt05Gh7Dh1tg7L8Zpuce7vFjy7ebJgvCgUfxfjVcxHeqHwWXUWhjSm0RYW7ab0sUBuz/ViePAX+Gnu43prqCPSiT3fQlt16QFDE/PF1kpmyuIOOBshpqneiYTMx4v3UdiD34HMq0xa/YSeMnJAB+gtT7SVReuEt78gmtRbr4p9atsHF4LEWJA2GTDohL7TNiIagtmi86AfeMHnxCssfuvquMTthMJvC2jKY4Rt2Kshmm+ePMHHMsGJu9wWJaqLYIU2dby7IZ4/GXsWCTE7qsFurgucquVXVJ2QT58+hTdE7c7dAuriX566WmBaA7kzP6dp21J57hLaI4+Pm3Lk+zV5NqH0scF0n9k9Z9y1c8Mny5P8AXf5IH4ZEAAA=";
72
+
73
+ // packages/safe-bash-command-python/src/package-program.ts
74
+ var decoded;
75
+ function loadPythonPackageProgram() {
76
+ return decoded ??= new Response(new Blob([Uint8Array.from(atob(pythonPackageProgramGzip), (character) => character.charCodeAt(0))]).stream().pipeThrough(new DecompressionStream("gzip"))).text();
77
+ }
78
+
79
+ // packages/safe-bash-command-python/src/native-wheel.generated.ts
80
+ var pythonNativeWheelGzip = "H4sIAAAAAAACA51WTW/cNhC976+Y5iIJltWNgwSFYRVw0RTIoUnQGi3gYCHQ0mg1XYkUSMq7619f8ENaSl67aG7icGbe45vhUKsKaygUq7HAg5as1AVnmh6x2DeIbSyRVSkolMRaesIquV4Bdb2QGkgAUzC6k0jhHyV4aDPrFFQzaGpDu7OsoJaig57ppqWHMetXphvr+9n6mqV3fKK+phZHx3vqfzPLk+899WPOo6iomlyLnpU7tsWiFaxCGVJxlnlYVtc0hsqBF+rIyxn9Iy9XKyhbpibsv61aJzGyP9j+05dfmEKjGFiVC+KkiyJW2NYpKHpye2DWmVmm7rMXijQJDjk469pnMMVgDy3aDC5Woh4khzs5oHdSiLv/dNLYts8dZuhBOs9Y1LVCncK+QV5ivnaxVHsDcKGBOMTrFN6mcOW2QTJSCH+xdsCPUgoZR8QfWUuVD4sS4xac2cHAhU00o5SepEq+ueiNpzDF38A6xP3ypwO9ukoh+uSBmdwOHXLtoJeaBwKMwiw0MXUIqphfvh1l7Bhx4lvIoWOHib9xgss5kIM2G3kQR7WzkYLPgiMI6dY3sAZsFUJHPHZNMQXZTGLQ/aAhh4ejRiYlO8bWvm/MHWmRx84jgRub0WuEami1ZeBPFGg9Ql0G0Sl8eP/+3YfE5jZsG6aY1jJ2mVKIdIM88qU/5Q+vjvd1Kcpm4DtPW812qLYN5RyEtGewiwR+hiWvEW9W86neX4+6ERz8FHApXe29bhkeNPLK57cb8664yAP8oDEcbU9itZrOWQpe0zY4uBmFmRk2Kg6G6Qr2pJvzM8Sl+BaZo0abJBxATJYNPdoaUg0RcY1bSfoYmes3j3dX1M2yhikzaY2FtVshSTddCnjosdRYBWRH6FNie83KBsudGjrIx1QZx3085QoazlXtOl9SzmyjuR669g3gkmZDXzGNgcRUnzYbPFS0RaXjBH7IJ84vTZhFwadzQEeqY7psriGCC5gz9yWN3ryJvLAdalYxzQrOOnxJXPtydFRK0VOfjSGj5vYVLSpSuiBei6Ki2fMzIVQkp2SLh27xIt5T7x5FmDXPPfXxQuxZzzxR79Qy762p9el9jc+xiYPA9FlnzJXZJAn8CNHvH+9uf729u438bLFyzi5ANXS9iucHmQMpLWPDMElsqxQaDzpGXoqK+DaPBl1f/hTZ8TOGaSa3qF840ch3/LepSEYbW9vQ8ryybtjOfxKyLZoiKs3adqbQCOKYGDWe0cu6nYnomUSuVW5eYnPzTFuInV2GMe7/KCsGbjq48P2wLG+6wDAZvqcjqH5VOgPtq5ypoa7pAHkOUbZv2sh11EImhdr9PE799ErOFM72mTvRy30XbZJz0FN1mGYGQ30vcliN6shbelDBfAz6wW+eqc3/kvQM/iv3Z04sWb3y/+62QlPhfunPbDh6yepfGFf6SBQMAAA=";
81
+
82
+ // packages/safe-bash-command-python/src/native-wheel.ts
83
+ var decoded2;
84
+ function loadPythonNativeWheel() {
85
+ return decoded2 ??= new Response(new Blob([Uint8Array.from(atob(pythonNativeWheelGzip), (character) => character.charCodeAt(0))]).stream().pipeThrough(new DecompressionStream("gzip"))).text();
86
+ }
87
+
88
+ // packages/safe-bash-command-python/src/package-url-hash.ts
89
+ function pythonPackageUrlHash(url) {
90
+ const match = /(sha1|sha224|sha384|sha256|sha512|md5)=([a-f0-9]+)/.exec(url);
91
+ return match ? [match[1], match[2]] : void 0;
92
+ }
93
+
94
+ // packages/safe-bash-command-python/src/provisioning-runtime.ts
95
+ async function installPythonPackages(supplied, start, request, maxTransferBytes) {
96
+ if (!start.requirements.length && !start.uninstall && !start.bootstrap) return;
97
+ const runtime = supplied;
98
+ if (runtime.version !== "314.0.6" || !runtime._api?.packageManager || !runtime._api.lockfile_packages || typeof runtime._api.packageManager.installPackage !== "function" || typeof runtime.loadPackage !== "function" || typeof runtime.runPythonAsync !== "function") throw new Error("Python package installer ABI requires Pyodide 314.0.6");
99
+ let transportFailure;
100
+ let accepting = true;
101
+ let pending = Promise.resolve();
102
+ let installing = Promise.resolve();
103
+ const manager = runtime._api.packageManager;
104
+ const transfer = (consume) => {
105
+ if (!accepting) return Promise.reject(new Error("Python package transport is only available during installation"));
106
+ const work = pending.then(async () => {
107
+ if (transportFailure) throw transportFailure.error;
108
+ try {
109
+ return await consume();
110
+ } catch (error) {
111
+ transportFailure ??= { error };
112
+ throw error;
113
+ }
114
+ });
115
+ pending = work.then(() => {
116
+ }, () => {
117
+ });
118
+ return work;
119
+ };
120
+ const readArtifact = (operation, key, offset, length) => {
121
+ const failed = (error) => {
122
+ transportFailure ??= { error };
123
+ throw error;
124
+ };
125
+ try {
126
+ const result = request(operation, start.session, key, offset, Math.min(length, maxTransferBytes, 65536));
127
+ return result instanceof Promise ? result.catch(failed) : result;
128
+ } catch (error) {
129
+ return failed(error);
130
+ }
131
+ };
132
+ const withArtifact = (url, expected, metadata, consume) => transfer(async () => {
133
+ const opened = await request("package-open", start.session, url, expected, ...metadata ? [metadata] : []);
134
+ try {
135
+ return await consume(opened, (offset, length) => readArtifact("package-read", opened.key, offset, length));
136
+ } finally {
137
+ await request("package-close", start.session, opened.key);
138
+ }
139
+ });
140
+ const wheel = async (size, read, configuration) => {
141
+ const globals = ["_safe_native_wheel_read", "_safe_native_wheel_config", "_safe_extract_native_wheel"];
142
+ try {
143
+ runtime.globals.set(globals[0], read);
144
+ runtime.globals.set(globals[1], JSON.stringify({ ...configuration, size }));
145
+ const result = JSON.parse(await runtime.runPythonAsync(await loadPythonNativeWheel()));
146
+ if (Array.isArray(result)) for (const path of result) await runtime._api.loadDynlib(path);
147
+ return result;
148
+ } finally {
149
+ for (const name of globals) runtime.globals.delete(name);
150
+ }
151
+ };
152
+ const fetch = (url, expected, metadata) => withArtifact(url, expected, metadata, async (opened, read) => {
153
+ const bytes = new Uint8Array(opened.size);
154
+ for (let offset = 0; offset < bytes.length; ) {
155
+ const chunk = await read(offset, bytes.length - offset);
156
+ if (!Array.isArray(chunk) || chunk.length === 0 || offset + chunk.length > bytes.length) throw new Error("Invalid Python package chunk");
157
+ bytes.set(chunk, offset);
158
+ offset += chunk.length;
159
+ }
160
+ return { bytes, headers: opened.headers };
161
+ });
162
+ manager.downloadPackage = async (metadata) => {
163
+ if (!accepting) throw new Error("Python package transport is only available during installation");
164
+ if (metadata.channel === manager.defaultChannel) {
165
+ const pkg = runtime._api.lockfile_packages[metadata.normalizedName];
166
+ if (!pkg) throw new Error(`Missing matching Pyodide package: ${metadata.normalizedName}`);
167
+ return { url: new URL(pkg.file_name, "https://cdn.jsdelivr.net/pyodide/v314.0.6/full/").href, expected: pkg.sha256 };
168
+ }
169
+ return { url: metadata.channel };
170
+ };
171
+ manager.installPackage = (metadata, source) => {
172
+ if (!accepting) return Promise.reject(new Error("Python package transport is only available during installation"));
173
+ const work = installing.then(async () => {
174
+ if (source instanceof Uint8Array) throw new Error("Expected retained Python package source");
175
+ const pkg = runtime._api.lockfile_packages[metadata.normalizedName] ?? metadata.packageData;
176
+ if (!pkg) throw new Error(`Missing matching Pyodide package: ${metadata.normalizedName}`);
177
+ return withArtifact(source.url, source.expected, void 0, (opened, read) => wheel(opened.size, read, {
178
+ filename: pkg.file_name,
179
+ target: pkg.install_dir ?? null,
180
+ metadata: { INSTALLER: "pyodide.loadPackage", PYODIDE_SOURCE: metadata.channel === manager.defaultChannel ? "pyodide" : metadata.channel }
181
+ }));
182
+ });
183
+ installing = work.then(() => {
184
+ }, () => {
185
+ });
186
+ return work;
187
+ };
188
+ const loadPackages = async (names) => {
189
+ const errors = [];
190
+ await runtime.loadPackage(names, { messageCallback() {
191
+ }, errorCallback(message) {
192
+ errors.push(message);
193
+ } });
194
+ if (errors.length) throw new Error(errors.join("\n"));
195
+ };
196
+ const installedGlobals = [];
197
+ const bind = (name, value) => {
198
+ runtime.globals.set(name, value);
199
+ installedGlobals.push(name);
200
+ };
201
+ try {
202
+ await loadPackages(["micropip", ...start.bootstrapPackages ?? []]);
203
+ bind("_safe_package_native", loadPackages);
204
+ bind("_safe_package_bytes", async (url, hash) => (await fetch(url, hash)).bytes);
205
+ bind("_safe_package_metadata", async (url) => {
206
+ const result = await fetch(url, void 0, "metadata");
207
+ return JSON.stringify({ text: new TextDecoder().decode(result.bytes), headers: Object.fromEntries(result.headers.map(([name, value]) => [name.toLowerCase(), value])) });
208
+ });
209
+ bind("_safe_package_wheel_download", async (url, expected) => withArtifact(url, expected, void 0, async (opened, read) => {
210
+ const hash = pythonPackageUrlHash(url);
211
+ if (hash) await wheel(opened.size, read, { integrity: hash });
212
+ return JSON.stringify(await request("package-retain", start.session, opened.key));
213
+ }));
214
+ bind("_safe_package_wheel_metadata", async (serialized) => transfer(async () => {
215
+ const { source, name } = JSON.parse(serialized);
216
+ return wheel(source.size, (offset, length) => readArtifact("package-read-retained", source.token, offset, length), { metadata_name: name });
217
+ }));
218
+ bind("_safe_package_wheel_install", async (serialized) => transfer(async () => {
219
+ const { source, ...configuration } = JSON.parse(serialized);
220
+ await wheel(source.size, (offset, length) => readArtifact("package-read-retained", source.token, offset, length), configuration);
221
+ }));
222
+ bind("_safe_package_requirements_json", JSON.stringify(start.requested ?? start.requirements));
223
+ for (const key of ["pre", "upgrade", "forceReinstall", "legacy"]) {
224
+ bind("_safe_package_" + key, !!start[key]);
225
+ }
226
+ bind("_safe_package_restore_json", JSON.stringify(start.restore ?? []));
227
+ bind("_safe_package_records_json", JSON.stringify(start.records ?? null));
228
+ bind("_safe_package_uninstall_json", JSON.stringify(start.uninstall ?? null));
229
+ bind("_safe_package_emit", async (stream, message) => {
230
+ if (stream !== "stdout" && stream !== "stderr") throw new Error("Invalid package output stream");
231
+ const bytes = new TextEncoder().encode(message);
232
+ for (let offset = 0; offset < bytes.length; offset += maxTransferBytes) await request(stream, Array.from(bytes.subarray(offset, offset + maxTransferBytes)));
233
+ });
234
+ bind("_safe_package_line", async () => {
235
+ const bytes = [];
236
+ while (true) {
237
+ const chunk = await request("stdin", 1);
238
+ if (!chunk.length) {
239
+ if (!bytes.length) throw new Error("EOF when reading package confirmation");
240
+ break;
241
+ }
242
+ if (chunk[0] === 10) break;
243
+ bytes.push(chunk[0]);
244
+ }
245
+ return new TextDecoder().decode(Uint8Array.from(bytes));
246
+ });
247
+ await runtime.runPythonAsync(await loadPythonPackageProgram());
248
+ await installing;
249
+ accepting = false;
250
+ await pending;
251
+ if (transportFailure) throw transportFailure.error;
252
+ const pinned = JSON.parse(runtime.runPython("_safe_installed_json"));
253
+ await request("package-commit", start.session, start.restore === void 0 ? pinned : { version: 3, installed: pinned, records: JSON.parse(runtime.runPython("_safe_records_json")) });
254
+ if (start.uninstall) {
255
+ const removed = JSON.parse(runtime.runPython("_safe_uninstalled_json"));
256
+ for (const name of removed) {
257
+ const bytes = new TextEncoder().encode(" Successfully uninstalled " + name + "\n");
258
+ for (let offset = 0; offset < bytes.length; offset += maxTransferBytes) await request("stdout", Array.from(bytes.subarray(offset, offset + maxTransferBytes)));
259
+ }
260
+ }
261
+ } catch (error) {
262
+ await installing;
263
+ accepting = false;
264
+ await pending;
265
+ throw transportFailure ? transportFailure.error : error;
266
+ } finally {
267
+ await installing;
268
+ accepting = false;
269
+ await pending;
270
+ manager.downloadPackage = manager.installPackage = async () => {
271
+ throw new Error("Python package transport is only available during installation");
272
+ };
273
+ for (const name of installedGlobals) runtime.globals.delete(name);
274
+ }
66
275
  }
67
276
 
68
277
  // packages/safe-bash-command-python/src/execution.ts
@@ -190,6 +399,10 @@ def _safe_launch():
190
399
  main = types.ModuleType('__main__')
191
400
  main.__dict__.update(__package__=None, __spec__=None, __loader__=__import__('importlib.machinery', fromlist=['BuiltinImporter']).BuiltinImporter, __builtins__=__builtins__)
192
401
  sys.modules['__main__'] = main
402
+ if not sys.flags.no_site:
403
+ sys.argv = [args[0]] + args[2:] if not options_terminated and args and args[0] in ('-c', '-m') else args or ['']
404
+ import site
405
+ site.addsitepackages(site.addusersitepackages(None), [_safe_runtime_mount])
193
406
  if not options_terminated and args and args[0] == '-c':
194
407
  sys.argv = ['-c'] + args[2:]
195
408
  if not safe_path: sys.path.insert(0, '')
@@ -448,6 +661,8 @@ shutil._rmtree_impl = _safe_rmtree_impl
448
661
  export {
449
662
  PythonInvocationError,
450
663
  parsePythonInvocation,
664
+ pythonPackageUrlHash,
665
+ installPythonPackages,
451
666
  pythonExecution,
452
667
  pythonRuntimeRelocation,
453
668
  pythonImportMetadata,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  validateColor
3
- } from "./chunk-75OUKYCM.js";
3
+ } from "./chunk-CH5JDE3C.js";
4
4
  import {
5
5
  attr,
6
6
  child,
@@ -12,7 +12,7 @@ import {
12
12
  relPart,
13
13
  required,
14
14
  unique
15
- } from "./chunk-UDRJKA3P.js";
15
+ } from "./chunk-C23L4HZB.js";
16
16
  import {
17
17
  parseXmlPart
18
18
  } from "./chunk-YWP62BAZ.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  openRetainedPresentationIndex
3
- } from "./chunk-LZHFVNEV.js";
3
+ } from "./chunk-S3QYSI5E.js";
4
4
  import {
5
5
  stageRetainedOutput,
6
6
  streamJson
@@ -10,13 +10,13 @@ import {
10
10
  child,
11
11
  invalid,
12
12
  loadShared
13
- } from "./chunk-UDRJKA3P.js";
13
+ } from "./chunk-C23L4HZB.js";
14
14
  import {
15
15
  SelectionError
16
- } from "./chunk-SKF6PGA5.js";
16
+ } from "./chunk-I2OKE2NI.js";
17
17
  import {
18
18
  openRetainedPresentationValidation
19
- } from "./chunk-SKDJCMGI.js";
19
+ } from "./chunk-ATUZ7J3B.js";
20
20
  import {
21
21
  OfficeError,
22
22
  RetainedValues,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  openRetainedPresentationIndex
3
- } from "./chunk-LZHFVNEV.js";
3
+ } from "./chunk-S3QYSI5E.js";
4
4
  import {
5
5
  stageRetainedOutput,
6
6
  streamJson
@@ -14,13 +14,13 @@ import {
14
14
  nextRel,
15
15
  relPart,
16
16
  required
17
- } from "./chunk-UDRJKA3P.js";
17
+ } from "./chunk-C23L4HZB.js";
18
18
  import {
19
19
  SelectionError
20
- } from "./chunk-SKF6PGA5.js";
20
+ } from "./chunk-I2OKE2NI.js";
21
21
  import {
22
22
  openRetainedPresentationValidation
23
- } from "./chunk-SKDJCMGI.js";
23
+ } from "./chunk-ATUZ7J3B.js";
24
24
  import {
25
25
  dialects
26
26
  } from "./chunk-P3LHQOX7.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-52DDLGBS.js";
4
4
  import {
5
5
  boundedCodec
6
- } from "./chunk-RUXY7GN5.js";
6
+ } from "./chunk-CMJBRGU2.js";
7
7
 
8
8
  // packages/safe-bash-compression-engine/src/zstd-decode.ts
9
9
  import { PublicDiagnostic } from "../../safe-bash-contracts/diagnostics.js";