@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.
- package/dist/safe-bash/chunks/{chunk-HNT2MR4W.js → chunk-363QOIDR.js} +2 -1
- package/dist/safe-bash/chunks/chunk-AGHV53VF.js +42 -0
- package/dist/safe-bash/chunks/{chunk-VF3Q2V3E.js → chunk-RAFD5ZAH.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-67QE3JLU.js → chunk-TZRVK3NU.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-IRJS54AA.js → chunk-VWLQDZFF.js} +20 -12
- package/dist/safe-bash/chunks/{chunk-NAETSXBW.js → chunk-ZJAXMB5M.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-LDR3PPM3.js → chunk-22QEL76N.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-QX3WKBLI.js → chunk-36FV6BAG.js} +5 -3
- package/dist/safe-bash/command-chunks/{chunk-BSLXS4PE.js → chunk-3DH5QBZC.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-ZSHXZ3XG.js → chunk-3EAZRKI4.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-5EFNQ6FY.js → chunk-3EBQOZET.js} +216 -1
- package/dist/safe-bash/command-chunks/{chunk-KQE2D7PX.js → chunk-3HUCLYKJ.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-J4I7KCQQ.js → chunk-4JABZEDO.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-PVKSBXHB.js → chunk-4M6D4IUB.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-UVM6QG2H.js → chunk-4MVQE6CT.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-QWQHLMDX.js → chunk-4VTB4DGE.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-JQPDVCBU.js → chunk-565AAQTV.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-JSW6YH6T.js → chunk-5PRXCH54.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-42OQIFPW.js → chunk-5RLK2QSY.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-PYYAX5FB.js → chunk-63WEGFLL.js} +16 -16
- package/dist/safe-bash/command-chunks/{chunk-5QR4LTAK.js → chunk-6KZXFPOT.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-LJLB7TBN.js → chunk-6YTXU3NF.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-NNYOPI7K.js → chunk-7NF44M2V.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-ZRHKXN6W.js → chunk-7RQGRFHJ.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-QGSY4ZAU.js → chunk-7UYBNOOM.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-WOT2YXBT.js → chunk-7ZQVMPSB.js} +213 -42
- package/dist/safe-bash/command-chunks/{chunk-6REH56FL.js → chunk-AA254KE5.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-2VSNIHIW.js → chunk-APUXNXXQ.js} +11 -11
- package/dist/safe-bash/command-chunks/{chunk-4VHCA4KK.js → chunk-AVSINNZ6.js} +80 -3
- package/dist/safe-bash/command-chunks/{chunk-XE75H5ZZ.js → chunk-AVXSR5MO.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-22D6Q6SW.js → chunk-BKCVCMUX.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-UDRJKA3P.js → chunk-C23L4HZB.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-PAEAEFK3.js → chunk-C3EEMMQL.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-NDJPULBE.js → chunk-CEKBIZGU.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-75OUKYCM.js → chunk-CH5JDE3C.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-XNVL6AOV.js → chunk-CIYGC7WU.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-RUXY7GN5.js → chunk-CMJBRGU2.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-DGFMOT4O.js → chunk-CO4HYNPS.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-TMJG745A.js → chunk-CQLZM75U.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-T2LZWXWF.js → chunk-DBCTHLB5.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-6RE4MZYM.js → chunk-DBEJMI7J.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-XXUMECE4.js → chunk-DEEZYCOQ.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-YJMS5Q4Y.js → chunk-DHTTI7CE.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-D3WMD32B.js → chunk-DLLGOC4Q.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-HVLF3Y4B.js → chunk-DYCYAIET.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-BZLLQWRK.js → chunk-E5CDHXFA.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-5NC2IQMQ.js → chunk-EV7A5FNN.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-MCUDSE4H.js → chunk-EWECMOQ5.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-2YC6MWQB.js → chunk-EY3UE26F.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-ZQ4NQ24M.js → chunk-FJLVISSD.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-WOO3YO2X.js → chunk-HTMGN3KL.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-2E53ZL5D.js → chunk-HU72CZBN.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-AH3ZEPAN.js → chunk-IGHFIRXK.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-R4NPYXQX.js → chunk-IKBTII7C.js} +285 -70
- package/dist/safe-bash/command-chunks/{chunk-J3ISXTYB.js → chunk-JTEAYB72.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-NR7POLKP.js → chunk-KCS25XUJ.js} +2 -2
- package/dist/safe-bash/command-chunks/chunk-LKAFLJ5L.js +123 -0
- package/dist/safe-bash/command-chunks/{chunk-EU5SR3LS.js → chunk-LSH6UKCT.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-WV3C6BRD.js → chunk-MHZ7UTRX.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-K6J3KFQ2.js → chunk-MSA5BQFK.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-OMD45J52.js → chunk-MW3L6JB7.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-AR65HNNX.js → chunk-N2TN7IBE.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-NNGWTDVJ.js +2819 -0
- package/dist/safe-bash/command-chunks/{chunk-NWA7ZJDV.js → chunk-NU64GWGN.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-4Q3HP33O.js → chunk-NW3S6T6R.js} +146 -123
- package/dist/safe-bash/command-chunks/chunk-NXCJNPL3.js +47 -0
- package/dist/safe-bash/command-chunks/{chunk-GAYTDZPP.js → chunk-ORWYNKKL.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-FCGMSOF6.js → chunk-P6YTNXRV.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-3RDEX4AF.js → chunk-PAS4YSNN.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-RKAL5VFP.js → chunk-PLVFJ6FF.js} +255 -616
- package/dist/safe-bash/command-chunks/{chunk-TTPT3OME.js → chunk-PSNTCRL5.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-CJIFJ45R.js → chunk-QBCEAYQT.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-FGK6HLSY.js → chunk-QC2RWSYM.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-HCZITM4C.js → chunk-QPY3NCMC.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-3TXPZLFI.js → chunk-R6RVR6ZZ.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-HQFX5XKV.js → chunk-RB7XAYO2.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-6PDXNY3T.js → chunk-RF5VEKFU.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-VAMBWXDV.js → chunk-RUAGHZNF.js} +18 -18
- package/dist/safe-bash/command-chunks/{chunk-3MFYCMQU.js → chunk-S2T7DDGY.js} +16 -16
- package/dist/safe-bash/command-chunks/{chunk-LZHFVNEV.js → chunk-S3QYSI5E.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-ZLMCWAAU.js → chunk-STTXZKR6.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-AXUHORS3.js → chunk-SUYSZJI3.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-C5SLY3RB.js → chunk-U2C6A3QO.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-HCJWEB6P.js → chunk-U6IEK2CI.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-NN6OWOJG.js → chunk-UC6DUY3K.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-64L57DEI.js → chunk-UQTU7H6T.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-I7MEH76L.js → chunk-UYNJF5QN.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-ARA57PMC.js → chunk-V5PVNBOS.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-IAHYG67O.js → chunk-V5ZBRM5R.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-ZZ6EIACJ.js → chunk-VGHRMAI4.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-DZTT5SLG.js → chunk-VP7R7HKY.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-TP5MZHCB.js → chunk-W5Y7Y7PS.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-ZTW2E5OT.js → chunk-WAE3OCOU.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-DBYY7IDI.js → chunk-WCM47S5A.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-U6VSRO6E.js → chunk-WNVBS4GV.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-CXOAMPOV.js → chunk-WUIS2INH.js} +13 -13
- package/dist/safe-bash/command-chunks/{chunk-4HJEZGYN.js → chunk-YODHIRPW.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-C3FERGHU.js → chunk-YRMTOLG5.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-GQV5RWMN.js → chunk-ZFXHSFTU.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-YXIJOYT6.js → chunk-ZUOCXDYW.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-LBBJ5S3W.js → chunk-ZZKJPLIH.js} +1 -1
- package/dist/safe-bash/command-chunks/{engine-UPLVIV72-IGXUDNO5.js → engine-UPLVIV72-MSSFJLK4.js} +1 -1
- package/dist/safe-bash/command-chunks/{prompt-tool-debug-ERJKK3XZ.js → prompt-tool-debug-3POFNRYP.js} +5 -5
- package/dist/safe-bash/commands/bc/index.browser.js +1 -1
- package/dist/safe-bash/commands/llm/index.browser.js +3 -1
- package/dist/safe-bash/commands/llm/index.js +1 -1
- package/dist/safe-bash/commands/python/executor.browser.js +12 -1
- package/dist/safe-bash/commands/python/executor.js +1 -1
- package/dist/safe-bash/commands/python/index.browser.js +23 -1
- package/dist/safe-bash/commands/python/index.js +1 -1
- package/dist/safe-bash/commands/python/source-archive.d.ts +2 -0
- package/dist/safe-bash/commands/python/source-archive.js +2 -0
- package/dist/safe-bash/commands/python/source-zip.d.ts +2 -0
- package/dist/safe-bash/commands/python/source-zip.js +2 -0
- package/dist/safe-bash/core.browser.js +2 -2
- package/dist/safe-bash/full-core.browser.js +30 -6
- package/dist/safe-bash/plugins/index.browser.js +3 -3
- package/dist/safe-bash/registry-entry.browser.js +2 -2
- package/dist/safe-bash/search.browser.js +1 -1
- package/dist/safe-bash/shell/runtime.d.ts +2 -2
- package/dist/safe-bash/shell/runtime.js +11 -2
- package/dist/safe-bash/shell/sync-extra-evaluators.js +12 -12
- package/dist/safe-bash/shell-entry.browser.js +2 -2
- package/dist/safe-bash-command-exiftool/index.js +41 -0
- package/dist/safe-bash-command-git/git_rust.wasm +0 -0
- package/dist/safe-bash-command-llm/collections.js +24 -65
- package/dist/safe-bash-command-llm/command.js +6 -6
- package/dist/safe-bash-command-llm/fragment-loaders.d.ts +3 -2
- package/dist/safe-bash-command-llm/index.d.ts +3 -2
- package/dist/safe-bash-command-llm/index.js +10 -8
- package/dist/safe-bash-command-llm/loader-provider.d.ts +25 -0
- package/dist/safe-bash-command-llm/openai-sse.js +2 -2
- package/dist/safe-bash-command-llm/openai.js +4 -4
- package/dist/safe-bash-command-llm/providers/index.js +4 -4
- package/dist/safe-bash-command-llm/providers/openai.js +4 -4
- package/dist/safe-bash-command-llm/python-unicode.d.ts +2 -0
- package/dist/safe-bash-command-llm/templates.d.ts +7 -2
- package/dist/safe-bash-command-llm/types.d.ts +7 -1
- package/dist/safe-bash-command-mcp/index.browser.js +3 -0
- package/dist/safe-bash-command-mcp/index.js +3 -0
- package/dist/safe-bash-command-playwright-cli/index.js +36 -36
- package/dist/safe-bash-command-playwright-cli/playwright/abilities.js +7 -7
- package/dist/safe-bash-command-playwright-cli/playwright/adapter.js +3 -3
- package/dist/safe-bash-command-playwright-cli/playwright/capability-events.js +1 -1
- package/dist/safe-bash-command-playwright-cli/playwright/capability-result.js +1 -1
- package/dist/safe-bash-command-playwright-cli/playwright/controller.js +15 -15
- package/dist/safe-bash-command-playwright-cli/playwright/download-capabilities.js +1 -1
- package/dist/safe-bash-command-playwright-cli/playwright/drop-capability.js +1 -1
- package/dist/safe-bash-command-playwright-cli/playwright/index.js +35 -35
- package/dist/safe-bash-command-playwright-cli/playwright/modal-capabilities.js +1 -1
- package/dist/safe-bash-command-playwright-cli/playwright/native-evaluation.js +1 -1
- package/dist/safe-bash-command-playwright-cli/playwright/native-json-snapshot.js +1 -1
- package/dist/safe-bash-command-playwright-cli/playwright/native-snapshot.js +1 -1
- package/dist/safe-bash-command-playwright-cli/playwright/native-storage-replacement.js +2 -2
- package/dist/safe-bash-command-playwright-cli/playwright/profile.js +3 -3
- package/dist/safe-bash-command-playwright-cli/playwright/recording-capabilities.js +1 -1
- package/dist/safe-bash-command-playwright-cli/playwright/route-capabilities.js +1 -1
- package/dist/safe-bash-command-playwright-cli/playwright/snapshot.js +1 -1
- package/dist/safe-bash-command-playwright-cli/playwright/standard-capabilities.js +6 -6
- package/dist/safe-bash-command-playwright-cli/playwright/storage-capabilities.js +5 -5
- package/dist/safe-bash-command-playwright-cli/playwright/tracing-capabilities.js +1 -1
- package/dist/safe-bash-command-playwright-cli/playwright/webmcp-capabilities.js +1 -1
- package/dist/safe-bash-command-python/build-backend.d.ts +93 -0
- package/dist/safe-bash-command-python/build-dependencies.d.ts +13 -0
- package/dist/safe-bash-command-python/build-environment.d.ts +3 -0
- package/dist/safe-bash-command-python/build-wheel.d.ts +8 -0
- package/dist/safe-bash-command-python/executor.d.ts +12 -2
- package/dist/safe-bash-command-python/executor.js +27 -4
- package/dist/safe-bash-command-python/index.js +27 -4
- package/dist/safe-bash-command-python/jspi.js +2 -2
- package/dist/safe-bash-command-python/llm-assets-node.js +1 -1
- package/dist/safe-bash-command-python/llm-fragment-loader.d.ts +6 -0
- package/dist/safe-bash-command-python/llm-functions-loader.d.ts +5 -1
- package/dist/safe-bash-command-python/llm-loader-discovery.d.ts +13 -0
- package/dist/safe-bash-command-python/llm-package-manager.d.ts +7 -0
- package/dist/safe-bash-command-python/llm-template-loader.d.ts +6 -0
- package/dist/safe-bash-command-python/manifest.d.ts +17 -0
- package/dist/safe-bash-command-python/provisioning.d.ts +37 -5
- package/dist/safe-bash-command-python/provisioning.js +2 -1
- package/dist/safe-bash-command-python/source-archive.d.ts +4 -0
- package/dist/safe-bash-command-python/source-archive.js +136 -0
- package/dist/safe-bash-command-python/source-environment.d.ts +12 -0
- package/dist/safe-bash-command-python/source-snapshot.d.ts +8 -0
- package/dist/safe-bash-command-python/source-zip.d.ts +8 -0
- package/dist/safe-bash-command-python/source-zip.js +8 -0
- package/dist/safe-bash-command-python/worker.js +3 -185
- package/dist/safe-bash-command-safejs/index.js +5 -5
- package/dist/safe-bash-command-safejs/runtime.js +3 -3
- package/dist/safe-bash-command-ssconvert/index.js +8 -8
- package/dist/safe-bash-compression-engine/bounded-codec.js +2 -2
- package/dist/safe-bash-compression-engine/codec-loader.js +1 -1
- package/dist/safe-bash-compression-engine/files.js +5 -5
- package/dist/safe-bash-compression-engine/index.js +4 -4
- package/dist/safe-bash-compression-engine/operand.js +5 -5
- package/dist/safe-bash-compression-engine/stream.js +4 -4
- package/dist/safe-bash-compression-engine/zstd-decode.js +3 -3
- package/dist/safe-bash-csv-engine/index.js +1 -1
- package/dist/safe-bash-csv-engine/python-utf7.d.ts +18 -0
- package/dist/safe-bash-csv-engine/text-decoder.d.ts +1 -0
- package/dist/safe-bash-csv-engine/text-decoder.js +5 -3
- package/dist/safe-bash-presentation-engine/accessibility.js +15 -15
- package/dist/safe-bash-presentation-engine/animation-editing.js +5 -5
- package/dist/safe-bash-presentation-engine/animations.js +5 -5
- package/dist/safe-bash-presentation-engine/backgrounds.js +6 -6
- package/dist/safe-bash-presentation-engine/chart-editing.js +18 -18
- package/dist/safe-bash-presentation-engine/chart-object-operations.js +12 -12
- package/dist/safe-bash-presentation-engine/charts.js +15 -15
- package/dist/safe-bash-presentation-engine/command-placeholder.js +39 -39
- package/dist/safe-bash-presentation-engine/comments.js +6 -6
- package/dist/safe-bash-presentation-engine/connector-operations.js +16 -16
- package/dist/safe-bash-presentation-engine/connectors.js +13 -13
- package/dist/safe-bash-presentation-engine/diff.js +21 -21
- package/dist/safe-bash-presentation-engine/drawing-format.js +7 -7
- package/dist/safe-bash-presentation-engine/drawing-operations.js +15 -15
- package/dist/safe-bash-presentation-engine/drawing-schema.js +8 -8
- package/dist/safe-bash-presentation-engine/equations.js +6 -6
- package/dist/safe-bash-presentation-engine/fields.js +6 -6
- package/dist/safe-bash-presentation-engine/image-extraction.js +7 -7
- package/dist/safe-bash-presentation-engine/image-formatting.js +16 -16
- package/dist/safe-bash-presentation-engine/image-insertion.js +6 -6
- package/dist/safe-bash-presentation-engine/image-replacement.js +7 -7
- package/dist/safe-bash-presentation-engine/images.js +6 -6
- package/dist/safe-bash-presentation-engine/index.js +104 -104
- package/dist/safe-bash-presentation-engine/layouts.js +5 -5
- package/dist/safe-bash-presentation-engine/links.js +5 -5
- package/dist/safe-bash-presentation-engine/masters.js +4 -4
- package/dist/safe-bash-presentation-engine/media-editing.js +13 -13
- package/dist/safe-bash-presentation-engine/media-extraction.js +7 -7
- package/dist/safe-bash-presentation-engine/media.js +6 -6
- package/dist/safe-bash-presentation-engine/memberships.js +5 -5
- package/dist/safe-bash-presentation-engine/notes.js +6 -6
- package/dist/safe-bash-presentation-engine/ole-insertion.js +6 -6
- package/dist/safe-bash-presentation-engine/opaque-objects.js +2 -2
- package/dist/safe-bash-presentation-engine/package-tools.js +6 -6
- package/dist/safe-bash-presentation-engine/presentation-model.js +38 -38
- package/dist/safe-bash-presentation-engine/presentation-settings.js +5 -5
- package/dist/safe-bash-presentation-engine/properties.js +6 -6
- package/dist/safe-bash-presentation-engine/retained-inspection.js +3 -3
- package/dist/safe-bash-presentation-engine/retained-text.js +16 -16
- package/dist/safe-bash-presentation-engine/sanitize.js +7 -7
- package/dist/safe-bash-presentation-engine/selectors.js +2 -2
- package/dist/safe-bash-presentation-engine/shape-groups.js +15 -15
- package/dist/safe-bash-presentation-engine/shape-operations.js +14 -14
- package/dist/safe-bash-presentation-engine/shape-path-operations.js +16 -16
- package/dist/safe-bash-presentation-engine/shape-paths.js +5 -5
- package/dist/safe-bash-presentation-engine/shape-selection.js +15 -15
- package/dist/safe-bash-presentation-engine/shape-transforms.js +5 -5
- package/dist/safe-bash-presentation-engine/shapes.js +11 -11
- package/dist/safe-bash-presentation-engine/slide-copy.js +7 -7
- package/dist/safe-bash-presentation-engine/slide-import.js +6 -6
- package/dist/safe-bash-presentation-engine/slide-merge-split.js +8 -8
- package/dist/safe-bash-presentation-engine/slide-model.js +25 -25
- package/dist/safe-bash-presentation-engine/slide-removal.js +7 -7
- package/dist/safe-bash-presentation-engine/slide-transfer-budget.js +2 -2
- package/dist/safe-bash-presentation-engine/slides.js +5 -5
- package/dist/safe-bash-presentation-engine/table-operations.js +17 -17
- package/dist/safe-bash-presentation-engine/table-spans.js +16 -16
- package/dist/safe-bash-presentation-engine/tables.js +15 -15
- package/dist/safe-bash-presentation-engine/tags.js +6 -6
- package/dist/safe-bash-presentation-engine/template-bindings.js +16 -16
- package/dist/safe-bash-presentation-engine/template-repeat.js +26 -26
- package/dist/safe-bash-presentation-engine/text-fitting.js +11 -11
- package/dist/safe-bash-presentation-engine/text-frames.js +11 -11
- package/dist/safe-bash-presentation-engine/text-paragraphs.js +11 -11
- package/dist/safe-bash-presentation-engine/text-reading.js +3 -3
- package/dist/safe-bash-presentation-engine/text-replacement.js +6 -6
- package/dist/safe-bash-presentation-engine/text-runs.js +8 -8
- package/dist/safe-bash-presentation-engine/themes.js +5 -5
- package/dist/safe-bash-presentation-engine/transitions.js +6 -6
- package/dist/safe-bash-presentation-engine/validation.js +2 -2
- package/dist/safe-bash-presentation-engine/xml-parts.js +5 -5
- package/dist/safe-bash-zip-engine/index.js +1 -1
- package/dist/safe-bash-zip-engine/zip/repair.js +1 -1
- package/dist/safe-bash-zip-engine/zip/sfx.js +1 -1
- package/dist/safe-bash-zip-engine/zip-format.d.ts +3 -1
- package/dist/safe-bash-zip-engine/zip-format.js +1 -1
- package/dist/safe-playwright-cloudflare/shell-browser-resource.d.ts +1 -1
- package/dist/safe-playwright-cloudflare/shell-browser-resource.js +35 -20
- package/package.json +13 -3
- package/dist/safe-bash/chunks/chunk-PSD2RSOS.js +0 -31
- package/dist/safe-bash/command-chunks/chunk-RHXV2KG5.js +0 -1466
- package/dist/safe-bash/command-chunks/{biff-AYJZR2YV-YFF3BK43.js → biff-AYJZR2YV-2BK47I2W.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-SKDJCMGI.js → chunk-ATUZ7J3B.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-4Q4R3VZU.js → chunk-ETFJ4L7F.js} +0 -0
- package/dist/safe-bash/command-chunks/{chunk-QWHBQBPB.js → chunk-EXDMIGZY.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-SKF6PGA5.js → chunk-I2OKE2NI.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-2H6RJPCQ.js → chunk-JDDZRKC4.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-3TP4SSPS.js → chunk-SRXARACJ.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-D54L2IOZ.js → chunk-Y7UXJ77P.js} +3 -3
- package/dist/safe-bash/command-chunks/{dif-BXKPQOCO-FVJYYGYB.js → dif-BXKPQOCO-4KB3RC6G.js} +4 -4
- 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-
|
|
3
|
+
} from "./chunk-Y7UXJ77P.js";
|
|
4
4
|
import {
|
|
5
5
|
importSelectedSlides
|
|
6
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
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
|
-
|
|
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
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
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
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
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
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
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
|
-
|
|
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
|
-
|
|
481
|
-
|
|
482
|
-
if (
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
module.
|
|
486
|
-
module.
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
python: {
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
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
|
-
|
|
539
|
-
|
|
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
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
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-
|
|
4
|
+
} from "./chunk-565AAQTV.js";
|
|
5
5
|
import {
|
|
6
6
|
nodeFor
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-YODHIRPW.js";
|
|
8
8
|
import {
|
|
9
9
|
attr,
|
|
10
10
|
required
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-C23L4HZB.js";
|
|
12
12
|
import {
|
|
13
13
|
parseXmlPart
|
|
14
14
|
} from "./chunk-YWP62BAZ.js";
|