@poe-platform/safe-bash 0.1.809 → 0.1.811
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/audio-ast/flac-source.d.ts +13 -0
- package/dist/audio-ast/index.d.ts +2 -1
- package/dist/audio-ast/index.js +254 -179
- package/dist/audio-ast/wav-source.d.ts +7 -1
- package/dist/image-ast/index.js +1 -1
- package/dist/json-ast/backed-json-parser.d.ts +12 -1
- package/dist/json-ast/index.d.ts +1 -1
- package/dist/office-xml/index.d.ts +1 -0
- package/dist/office-xml/retained-xml-edits.d.ts +22 -0
- package/dist/pdf-ast/cos/mutable-object-store.d.ts +3 -0
- package/dist/pdf-ast/cos/qpdf-json-document.d.ts +43 -0
- package/dist/pdf-ast/cos/qpdf-json-values.d.ts +7 -0
- package/dist/pdf-ast/index.d.ts +1 -0
- package/dist/pdf-ast/index.js +653 -87
- package/dist/pdf-ast/retained-document.d.ts +5 -1
- package/dist/safe-bash/audio-ast.browser.js +2 -1
- package/dist/safe-bash/chunks/{chunk-RQCK77SC.js → chunk-BUYRKFW2.js} +9 -36
- package/dist/safe-bash/chunks/{chunk-SOFBGDXG.js → chunk-HHSOUC3Z.js} +32 -0
- package/dist/safe-bash/chunks/{chunk-WAZEELYB.js → chunk-TPG55BAQ.js} +10 -7
- package/dist/safe-bash/command-chunks/biff-3EFLKBAH-NYWZOYQS.js +4942 -0
- package/dist/safe-bash/command-chunks/{chunk-HEHGHIE2.js → chunk-22MOB45U.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-6DEWZMOL.js → chunk-2CORNDGF.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-62ZAHKFS.js → chunk-2VCKUNDZ.js} +130 -14
- package/dist/safe-bash/command-chunks/{chunk-6UHGIWFX.js → chunk-2ZFLMWOX.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-HONWGFDA.js → chunk-33YCKZZX.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-AXWPJRY6.js → chunk-36XGIPOG.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-32ADKP5E.js → chunk-456PHA3L.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-UJXP3T6R.js → chunk-4CKFNXRN.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-5L6GHFRW.js → chunk-554Z6IKP.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-ORZRWT62.js → chunk-56NYSX65.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-53JP3S6H.js → chunk-5HPU7D36.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-NB7JO7FE.js → chunk-5LI2DLNZ.js} +26 -26
- package/dist/safe-bash/command-chunks/{chunk-YJJBGN7U.js → chunk-5MB64DWR.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-3ZWBBS6U.js → chunk-5OO2P27R.js} +340 -34
- package/dist/safe-bash/command-chunks/{chunk-IC5GJI7E.js → chunk-5Q22ZLNC.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-YO3V5RLY.js → chunk-6CCQI6XZ.js} +12 -12
- package/dist/safe-bash/command-chunks/{chunk-EO2IVGV7.js → chunk-6M6TM5Z5.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-Z54Z3KRN.js → chunk-6QBMND4A.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-INX4JMQ6.js → chunk-6VPQ3CDZ.js} +5 -5
- package/dist/safe-bash/command-chunks/chunk-72C3TZ2U.js +826 -0
- package/dist/safe-bash/command-chunks/{chunk-VGXVN3BX.js → chunk-7GKKMNL6.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-TZJC67W3.js → chunk-7PVHO47B.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-CM3C7AXJ.js → chunk-A2CLZMQZ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-ASR27KHW.js → chunk-A5FZBR7X.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-DMDHE5KC.js → chunk-AHA6IWAJ.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-PTZ55XXN.js → chunk-APEWTWCC.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-YUVH6CE4.js → chunk-ATTWQVR2.js} +17 -17
- package/dist/safe-bash/command-chunks/{chunk-JON5DB3Z.js → chunk-B5LDP7AA.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-CHJL6JMU.js → chunk-COKYZUBW.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-KCTV4NVX.js → chunk-CRV2Q3PB.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-V3WXPCKN.js → chunk-CV7M2QJU.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-D7XBUF76.js → chunk-D2ASPM7R.js} +109 -23
- package/dist/safe-bash/command-chunks/{chunk-VPDSQPSN.js → chunk-DM2CPMB4.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-3DTDMEOP.js → chunk-EAGIJ4VW.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-WFDG3N5R.js → chunk-ECDEPKKW.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-JW6CMBF2.js → chunk-EHSM5ZQS.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-WIOH7ZQN.js → chunk-ENT3IV2G.js} +12 -12
- package/dist/safe-bash/command-chunks/{chunk-5IE4LJGB.js → chunk-EUT24Y5Z.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-COKZFXHG.js → chunk-FIIAYCWS.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-MWVFP2HY.js → chunk-GEM47B2P.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-OQCJGUI6.js → chunk-HARUYHH7.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-EHL6B34L.js → chunk-HDJVJTCK.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-JMM3MNAY.js → chunk-HKATEVAP.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-NVBUC644.js → chunk-HKGNBH7Z.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-VWY3EAVQ.js → chunk-HTVIYLVB.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-Z4QJMDK3.js → chunk-IT7TAC3F.js} +16 -16
- package/dist/safe-bash/command-chunks/{chunk-EWS4KYJE.js → chunk-JFYWVQ4V.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-ZCX63QWA.js → chunk-JOCFI7TG.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-F5WTH4O4.js → chunk-JQVHUSDD.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-O4VJEGL6.js → chunk-K5GB2YMN.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-27C3NT5V.js → chunk-KB7DUBVL.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-4DZ32PI7.js → chunk-KCOJA7EM.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-6OKH4X67.js → chunk-KJ4XXZIL.js} +273 -10
- package/dist/safe-bash/command-chunks/{chunk-GLVD3JJG.js → chunk-KL3OIBKB.js} +4712 -4654
- package/dist/safe-bash/command-chunks/{chunk-U6QHTC5J.js → chunk-L5MCW6CM.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-LVL3A7YE.js → chunk-LCZDBW55.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-DJVRDUCA.js → chunk-LXLLA4PM.js} +17 -17
- package/dist/safe-bash/command-chunks/{chunk-K7AGAS3K.js → chunk-M7QE2MN7.js} +6 -6
- package/dist/safe-bash/command-chunks/chunk-MGBHGZEX.js +12 -0
- package/dist/safe-bash/command-chunks/{chunk-SWT6ILF2.js → chunk-MPUHH2KR.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-DC3OJLRB.js → chunk-NQDIT667.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-LWZVDDJA.js → chunk-NUGQQDGE.js} +5 -1
- package/dist/safe-bash/command-chunks/{chunk-MFLQZLFR.js → chunk-OA75SGN2.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-5LATYOF7.js → chunk-OEJM666F.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-AF25YYIO.js → chunk-PMAM4N33.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-4557HE3J.js → chunk-PMWW7KSB.js} +161 -42
- package/dist/safe-bash/command-chunks/{chunk-KMMAJ6H6.js → chunk-PNGDJA6M.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-62BHPSKJ.js → chunk-Q6S57NOQ.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-KJ3PEDI2.js → chunk-Q73EMLLZ.js} +146 -4
- package/dist/safe-bash/command-chunks/{chunk-FXKBM5KJ.js → chunk-QC5RMGSA.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-UQ6UIZMM.js → chunk-QD7ZRDUN.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-JHUYZZGV.js → chunk-QYMEASQ6.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-3GY5VDIX.js → chunk-QZZ73J2O.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-S2CYIGWH.js → chunk-R6EGGK5M.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-7AVN3OBH.js → chunk-RHYJVTJO.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-EWGDSO6U.js → chunk-RID6VYS3.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-MMBRBANA.js → chunk-RNSKXOG3.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-D3ZRZTY5.js → chunk-RQIQ75W5.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-DWKQPLRT.js → chunk-RRL3Y562.js} +11 -11
- package/dist/safe-bash/command-chunks/{chunk-JW3KIZU6.js → chunk-RUXY7GN5.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-NXCMXD74.js → chunk-S6R3IB36.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-XUPKFHAQ.js → chunk-SDTPO2VV.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-PIAGKRFW.js → chunk-SPLOIABU.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-KELMIFVV.js → chunk-TI52LKLL.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-WLTJDNSQ.js → chunk-TVH4JORU.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-6XVMWFHD.js → chunk-TW73OXPR.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-SFO43CID.js → chunk-UAXSE3XE.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-K35BSUHO.js → chunk-UYWSIIUX.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-JJQ72P3V.js → chunk-VCML4T5D.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-DCD32BEY.js → chunk-VU3EQF7F.js} +91 -53
- package/dist/safe-bash/command-chunks/{chunk-2E2YEDVB.js → chunk-W5YSINXC.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-EYNT4OEJ.js → chunk-WGG6G2KG.js} +7 -7
- package/dist/safe-bash/command-chunks/chunk-WH3TIOTS.js +326 -0
- package/dist/safe-bash/command-chunks/{chunk-DVQBZXMQ.js → chunk-WJCN2IXI.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-45FI2IPY.js → chunk-WQ6ABTJU.js} +3 -6
- package/dist/safe-bash/command-chunks/{chunk-XBZ4ZWGL.js → chunk-WVMHRNXZ.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-7GXUCQI4.js → chunk-WXRYDALR.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-S4IIOSRA.js → chunk-X7FA7ZD5.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-SFCERNHU.js → chunk-XPD636C4.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-HYDWQLJ3.js → chunk-XRVKWGVQ.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-3UJWHRK4.js → chunk-XVP6V5K3.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-KTI3BULE.js → chunk-XZ2FWFNV.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-QK3CHRGL.js → chunk-Y4EYCZFT.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-GTWVMFBK.js → chunk-YORJDX4V.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-H6F5SN2N.js → chunk-YSMNXMAO.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-GKYCV6BU.js → chunk-YSY6R6AS.js} +493 -183
- package/dist/safe-bash/command-chunks/{chunk-SE5SJ4JT.js → chunk-Z2JW6M2D.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-5HGEXQVD.js → chunk-ZHRGYR7B.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-HQYFRQ5W.js → chunk-ZIIO6GRY.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-NTRZMQZP.js → chunk-ZMHEGDU2.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-EYBXHGA6.js → chunk-ZXR6LXV5.js} +2 -2
- package/dist/safe-bash/command-chunks/{command-engine-P5DFM4OU.js → command-engine-BEWABZ75.js} +10 -3
- package/dist/safe-bash/command-chunks/{engine-RU4OFLPO-CPLFYD67.js → engine-AXXFTGCL-QBQNBI6K.js} +1 -1
- package/dist/safe-bash/command-chunks/pdf-XHHFTOT4-UJJYOYJ2.js +573 -0
- package/dist/safe-bash/commands/audio/index.browser.js +2 -14
- package/dist/safe-bash/commands/diff-patch/index.js +0 -5
- package/dist/safe-bash/commands/diff3/index.js +0 -2
- package/dist/safe-bash/commands/ffprobe/index.browser.js +2 -5
- package/dist/safe-bash/commands/pandoc/index.browser.js +3 -1
- package/dist/safe-bash/commands/text.js +10 -1
- package/dist/safe-bash/core.d.ts +2 -2
- package/dist/safe-bash/core.js +2 -2
- package/dist/safe-bash/full-core.browser.js +18 -22
- package/dist/safe-bash/lazy-optional.d.ts +9 -0
- package/dist/safe-bash/lazy-optional.js +24 -0
- package/dist/safe-bash/plugins/index.browser.js +5 -3
- package/dist/safe-bash/plugins/index.js +3 -1
- package/dist/safe-bash/plugins/portable-commands.d.ts +1 -1
- package/dist/safe-bash/plugins/portable-commands.js +5 -3
- package/dist/safe-bash/registry-entry.browser.js +1 -1
- package/dist/safe-bash-command-apply-patch/apply.js +2 -2
- package/dist/safe-bash-command-apply-patch/index.js +2 -2
- package/dist/safe-bash-command-apply-patch/parser.d.ts +20 -1
- package/dist/safe-bash-command-apply-patch/parser.js +1 -1
- package/dist/safe-bash-command-diff/index.js +0 -2
- package/dist/safe-bash-command-diff3/index.js +830 -56
- package/dist/safe-bash-command-ffmpeg/index.js +1 -1
- package/dist/safe-bash-command-ffprobe/index.js +3 -2
- package/dist/safe-bash-command-ffprobe/media.js +3 -2
- package/dist/safe-bash-command-ffprobe/options.d.ts +15 -0
- package/dist/safe-bash-command-ffprobe/options.js +7 -0
- package/dist/safe-bash-command-html-to-markdown/index.js +75 -21
- package/dist/safe-bash-command-media/index.js +2 -2
- package/dist/safe-bash-command-media/plugin.js +1 -1
- package/dist/safe-bash-command-media/remote.js +2 -2
- package/dist/safe-bash-command-pandoc/command.js +8 -8
- package/dist/safe-bash-command-pandoc/execution.d.ts +2 -2
- package/dist/safe-bash-command-pandoc/index.d.ts +1 -1
- package/dist/safe-bash-command-pandoc/index.js +37 -37
- package/dist/safe-bash-command-pandoc/lua-filters.js +2 -2
- package/dist/safe-bash-command-pandoc/types.d.ts +17 -2
- package/dist/safe-bash-command-patch/index.js +2 -2
- package/dist/safe-bash-command-patch/patch-publication.d.ts +2 -2
- package/dist/safe-bash-command-patch/patch-publication.js +1 -1
- package/dist/safe-bash-command-patch/patch.js +2 -2
- package/dist/safe-bash-command-pdftk/index.js +616 -265
- package/dist/safe-bash-command-pptx/engine.js +1 -1
- package/dist/safe-bash-command-qpdf/index.js +115 -9
- package/dist/safe-bash-command-soffice/index.js +1 -1
- package/dist/safe-bash-command-ssconvert/index.js +2 -2
- package/dist/safe-bash-command-xmllint/index.js +137 -30
- package/dist/safe-bash-command-xq/index.js +45 -29
- 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-media-engine/imagemagick.d.ts +2 -0
- package/dist/safe-bash-media-engine/index.js +162 -72
- package/dist/safe-bash-network-engine/body.d.ts +1 -0
- package/dist/safe-bash-network-engine/body.js +1 -1
- package/dist/safe-bash-network-engine/transfer.js +11 -3
- package/dist/safe-bash-presentation-engine/accessibility.js +30 -30
- package/dist/safe-bash-presentation-engine/animation-editing.js +15 -15
- package/dist/safe-bash-presentation-engine/animations.js +15 -15
- package/dist/safe-bash-presentation-engine/backgrounds.js +16 -16
- package/dist/safe-bash-presentation-engine/bytes.js +3 -3
- package/dist/safe-bash-presentation-engine/chart-editing.js +33 -33
- package/dist/safe-bash-presentation-engine/chart-object-operations.js +24 -24
- package/dist/safe-bash-presentation-engine/charts.js +30 -30
- package/dist/safe-bash-presentation-engine/command-placeholder.js +55 -54
- package/dist/safe-bash-presentation-engine/comments.js +16 -16
- package/dist/safe-bash-presentation-engine/connector-operations.js +31 -31
- package/dist/safe-bash-presentation-engine/connectors.js +28 -28
- package/dist/safe-bash-presentation-engine/content-types.js +4 -4
- package/dist/safe-bash-presentation-engine/creation.js +6 -6
- package/dist/safe-bash-presentation-engine/diff.js +31 -31
- package/dist/safe-bash-presentation-engine/drawing-format.js +19 -19
- package/dist/safe-bash-presentation-engine/drawing-operations.js +30 -30
- package/dist/safe-bash-presentation-engine/drawing-schema.js +20 -20
- package/dist/safe-bash-presentation-engine/equations.js +16 -16
- package/dist/safe-bash-presentation-engine/errors.js +2 -2
- package/dist/safe-bash-presentation-engine/fields.js +16 -16
- package/dist/safe-bash-presentation-engine/font-metrics.js +3 -3
- package/dist/safe-bash-presentation-engine/image-extraction.js +19 -19
- package/dist/safe-bash-presentation-engine/image-formatting.js +31 -31
- package/dist/safe-bash-presentation-engine/image-insertion.js +17 -17
- package/dist/safe-bash-presentation-engine/image-replacement.js +20 -20
- package/dist/safe-bash-presentation-engine/image-value.js +4 -4
- package/dist/safe-bash-presentation-engine/images.js +18 -18
- package/dist/safe-bash-presentation-engine/index.d.ts +2 -2
- package/dist/safe-bash-presentation-engine/index.js +100 -93
- package/dist/safe-bash-presentation-engine/layouts.js +15 -15
- package/dist/safe-bash-presentation-engine/length.js +3 -3
- package/dist/safe-bash-presentation-engine/links.js +15 -15
- package/dist/safe-bash-presentation-engine/masters.js +14 -14
- package/dist/safe-bash-presentation-engine/media-editing.js +23 -23
- package/dist/safe-bash-presentation-engine/media-extraction.js +16 -16
- package/dist/safe-bash-presentation-engine/media.js +15 -15
- package/dist/safe-bash-presentation-engine/memberships.js +14 -14
- package/dist/safe-bash-presentation-engine/notes.js +15 -15
- package/dist/safe-bash-presentation-engine/ole-enum.js +4 -4
- package/dist/safe-bash-presentation-engine/ole-insertion.js +19 -19
- package/dist/safe-bash-presentation-engine/opaque-objects.js +9 -9
- package/dist/safe-bash-presentation-engine/package-reader.js +5 -5
- package/dist/safe-bash-presentation-engine/package-tools.js +15 -15
- package/dist/safe-bash-presentation-engine/package-uri.js +3 -3
- package/dist/safe-bash-presentation-engine/package-writer.js +4 -4
- package/dist/safe-bash-presentation-engine/presentation-model.js +54 -53
- package/dist/safe-bash-presentation-engine/presentation-settings.js +13 -13
- package/dist/safe-bash-presentation-engine/properties.js +15 -15
- package/dist/safe-bash-presentation-engine/relationships.js +4 -4
- package/dist/safe-bash-presentation-engine/resource-limits.js +1 -1
- package/dist/safe-bash-presentation-engine/retained-inspection.js +12 -12
- package/dist/safe-bash-presentation-engine/retained-package.js +4 -4
- package/dist/safe-bash-presentation-engine/retained-slide-settings.d.ts +15 -0
- package/dist/safe-bash-presentation-engine/retained-text.js +19 -19
- package/dist/safe-bash-presentation-engine/retained-xml-parts.d.ts +26 -0
- package/dist/safe-bash-presentation-engine/sanitize.js +16 -16
- package/dist/safe-bash-presentation-engine/selectors.js +10 -10
- package/dist/safe-bash-presentation-engine/shape-groups.js +30 -30
- package/dist/safe-bash-presentation-engine/shape-operations.js +29 -29
- package/dist/safe-bash-presentation-engine/shape-path-operations.js +31 -31
- package/dist/safe-bash-presentation-engine/shape-paths.js +15 -15
- package/dist/safe-bash-presentation-engine/shape-presets.js +3 -3
- package/dist/safe-bash-presentation-engine/shape-selection.js +30 -30
- package/dist/safe-bash-presentation-engine/shape-transforms.js +17 -17
- package/dist/safe-bash-presentation-engine/shapes.js +26 -26
- package/dist/safe-bash-presentation-engine/slide-copy.js +16 -16
- package/dist/safe-bash-presentation-engine/slide-import.js +17 -17
- package/dist/safe-bash-presentation-engine/slide-merge-split.js +19 -19
- package/dist/safe-bash-presentation-engine/slide-model.js +42 -42
- package/dist/safe-bash-presentation-engine/slide-removal.js +17 -17
- package/dist/safe-bash-presentation-engine/slide-transfer-budget.js +9 -9
- package/dist/safe-bash-presentation-engine/slides.d.ts +2 -0
- package/dist/safe-bash-presentation-engine/slides.js +21 -16
- package/dist/safe-bash-presentation-engine/table-operations.js +32 -32
- package/dist/safe-bash-presentation-engine/table-spans.js +31 -31
- package/dist/safe-bash-presentation-engine/tables.js +30 -30
- package/dist/safe-bash-presentation-engine/tags.js +15 -15
- package/dist/safe-bash-presentation-engine/template-bindings.js +32 -32
- package/dist/safe-bash-presentation-engine/template-repeat.js +39 -39
- package/dist/safe-bash-presentation-engine/text-fitting.js +26 -26
- package/dist/safe-bash-presentation-engine/text-frames.js +26 -26
- package/dist/safe-bash-presentation-engine/text-paragraphs.js +26 -26
- package/dist/safe-bash-presentation-engine/text-reading.js +11 -11
- package/dist/safe-bash-presentation-engine/text-replacement.js +16 -16
- package/dist/safe-bash-presentation-engine/text-runs.js +19 -19
- package/dist/safe-bash-presentation-engine/themes.js +15 -15
- package/dist/safe-bash-presentation-engine/transitions.js +15 -15
- package/dist/safe-bash-presentation-engine/validation.js +9 -9
- package/dist/safe-bash-presentation-engine/xml-parts.d.ts +1 -0
- package/dist/safe-bash-presentation-engine/xml-parts.js +19 -13
- package/dist/safe-bash-presentation-engine/xml-view.js +3 -3
- package/dist/safe-bash-presentation-engine/xml.js +3 -3
- package/dist/safe-bash-xml-engine/document.js +1 -1
- package/dist/safe-bash-xml-engine/index.js +1 -1
- package/dist/safe-bash-xml-engine/json.d.ts +1 -0
- package/dist/safe-bash-xml-engine/json.js +203 -0
- package/dist/safe-bash-xml-engine/stored-json.d.ts +5 -0
- package/dist/spreadsheet-engine/rendering/print/bidi-runs.d.ts +5 -0
- package/dist/spreadsheet-engine/rendering/print/bidi-runs.js +35 -0
- package/dist/spreadsheet-engine/rendering/print/control-bidi.d.ts +8 -0
- package/dist/spreadsheet-engine/rendering/print/control-bidi.js +80 -0
- package/dist/spreadsheet-engine/rendering/print/tab-layout.d.ts +11 -0
- package/dist/spreadsheet-engine/rendering/print/tab-layout.js +15 -0
- package/dist/spreadsheet-engine/rendering/print/text-lines.d.ts +2 -2
- package/dist/spreadsheet-engine/rendering/print/text-lines.js +3 -3
- package/dist/spreadsheet-format-xls/biff-encrypted-properties.d.ts +5 -1
- package/dist/spreadsheet-format-xls/biff-encrypted-properties.js +151 -57
- package/dist/spreadsheet-format-xls/biff-encryption.d.ts +1 -1
- package/dist/spreadsheet-format-xls/biff-encryption.js +8 -3
- package/dist/spreadsheet-format-xls/biff-property-bytes.d.ts +4 -1
- package/dist/spreadsheet-format-xls/biff-property-bytes.js +3 -3
- package/dist/spreadsheet-format-xls/biff-range.js +1 -1
- package/dist/spreadsheet-format-xls/biff.js +11 -3
- package/package.json +6 -2
- package/dist/safe-bash/chunks/chunk-I2A5ZCPD.js +0 -17
- package/dist/safe-bash/chunks/chunk-PQTT2EZP.js +0 -8
- package/dist/safe-bash/command-chunks/biff-DS263V2K-2GP4GZT7.js +0 -4868
- package/dist/safe-bash/command-chunks/chunk-6ZFYWT3U.js +0 -581
- package/dist/safe-bash/command-chunks/chunk-S244SWDH.js +0 -153
- package/dist/safe-bash/command-chunks/pdf-T7AWYZGQ-KNAYJ7YF.js +0 -552
- /package/dist/safe-bash/command-chunks/{chunk-EMMSXKEJ.js → chunk-4Q4R3VZU.js} +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import createBidi from "bidi-js";
|
|
2
|
+
// The CommonJS factory is published with an ESM-shaped declaration.
|
|
3
|
+
const bidi = createBidi();
|
|
4
|
+
/** Visual run order with logical text retained for the font shaper. */
|
|
5
|
+
export function printBidiRuns(text, direction, tick) {
|
|
6
|
+
// UAX #9 caps embedding depth at 125; reserve synchronous resolver work.
|
|
7
|
+
tick(text.length * 128);
|
|
8
|
+
if (!text)
|
|
9
|
+
return [];
|
|
10
|
+
const embedding = bidi.getEmbeddingLevels(text, direction);
|
|
11
|
+
const groups = [];
|
|
12
|
+
const membership = [];
|
|
13
|
+
let previous = -1;
|
|
14
|
+
for (let index = 0; index < text.length; index++) {
|
|
15
|
+
tick();
|
|
16
|
+
const level = embedding.levels[index];
|
|
17
|
+
if (level !== previous) {
|
|
18
|
+
groups.push({ text: "", direction: level % 2 ? "rtl" : "ltr" });
|
|
19
|
+
previous = level;
|
|
20
|
+
}
|
|
21
|
+
groups[groups.length - 1].text += text[index];
|
|
22
|
+
membership.push(groups.length - 1);
|
|
23
|
+
}
|
|
24
|
+
const seen = new Set();
|
|
25
|
+
const result = [];
|
|
26
|
+
for (const index of bidi.getReorderedIndices(text, embedding)) {
|
|
27
|
+
tick();
|
|
28
|
+
const group = membership[index];
|
|
29
|
+
if (!seen.has(group)) {
|
|
30
|
+
seen.add(group);
|
|
31
|
+
result.push(groups[group]);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Pango's single-paragraph FriBidi profile for mixed letter/tab/control runs. */
|
|
2
|
+
export declare function controlBidiItems(text: string, direction: "ltr" | "rtl", tick: (amount?: number) => void): {
|
|
3
|
+
items: {
|
|
4
|
+
text: string;
|
|
5
|
+
direction: "ltr" | "rtl";
|
|
6
|
+
}[];
|
|
7
|
+
order: number[];
|
|
8
|
+
} | undefined;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import createBidi from "bidi-js";
|
|
2
|
+
const bidi = createBidi();
|
|
3
|
+
/** Pango's single-paragraph FriBidi profile for mixed letter/tab/control runs. */
|
|
4
|
+
export function controlBidiItems(text, direction, tick) {
|
|
5
|
+
tick(text.length * 128);
|
|
6
|
+
const types = Array.from(text, char => bidi.getBidiCharTypeName(char));
|
|
7
|
+
// Wider weak/neutral/explicit profiles need independent native qualification.
|
|
8
|
+
if (!types.includes("L") || !types.includes("R") || types.some(type => !["L", "R", "BN", "B", "S"].includes(type)))
|
|
9
|
+
return;
|
|
10
|
+
const levels = new Uint8Array(text.length);
|
|
11
|
+
let start = 0;
|
|
12
|
+
for (let index = 0; index <= text.length; index++) {
|
|
13
|
+
tick();
|
|
14
|
+
if (index < text.length && text[index] !== "\r" && text[index] !== "\u2029")
|
|
15
|
+
continue;
|
|
16
|
+
// FriBidi X8 stops explicit-level assignment at the first B. Later
|
|
17
|
+
// letters retain the initialized zero base before implicit resolution.
|
|
18
|
+
levels.set(bidi.getEmbeddingLevels(text.slice(start, index), start === 0 ? direction : "ltr").levels, start);
|
|
19
|
+
if (index < text.length)
|
|
20
|
+
levels[index] = direction === "rtl" ? 1 : 0;
|
|
21
|
+
start = index + 1;
|
|
22
|
+
}
|
|
23
|
+
// FriBidi L1 restores segment/paragraph separators to the original base.
|
|
24
|
+
let afterParagraph = false;
|
|
25
|
+
for (let index = 0; index < text.length; index++) {
|
|
26
|
+
tick();
|
|
27
|
+
if (text[index] === "\r" || text[index] === "\u2029")
|
|
28
|
+
afterParagraph = true;
|
|
29
|
+
if (afterParagraph && bidi.getBidiCharTypeName(text[index]) === "BN")
|
|
30
|
+
levels[index] = 0;
|
|
31
|
+
if (text[index] === "\t")
|
|
32
|
+
levels[index] = direction === "rtl" ? 1 : 0;
|
|
33
|
+
}
|
|
34
|
+
let reset = true;
|
|
35
|
+
for (let index = text.length - 1; index >= 0; index--) {
|
|
36
|
+
tick();
|
|
37
|
+
const char = text[index];
|
|
38
|
+
if (char === "\t" || char === "\r" || char === "\u2029")
|
|
39
|
+
reset = true;
|
|
40
|
+
else if (bidi.getBidiCharTypeName(char) !== "BN")
|
|
41
|
+
reset = false;
|
|
42
|
+
if (reset)
|
|
43
|
+
levels[index] = direction === "rtl" ? 1 : 0;
|
|
44
|
+
}
|
|
45
|
+
const items = [];
|
|
46
|
+
const itemLevels = [];
|
|
47
|
+
let previousControl = true;
|
|
48
|
+
for (let index = 0; index < text.length; index++) {
|
|
49
|
+
tick();
|
|
50
|
+
const char = text[index], level = levels[index];
|
|
51
|
+
const control = char === "\t" || char === "\r" || char === "\u2029";
|
|
52
|
+
if (control || previousControl || level !== itemLevels.at(-1)) {
|
|
53
|
+
items.push({ text: "", direction: level % 2 ? "rtl" : "ltr" });
|
|
54
|
+
itemLevels.push(level);
|
|
55
|
+
}
|
|
56
|
+
items.at(-1).text += char;
|
|
57
|
+
previousControl = control;
|
|
58
|
+
}
|
|
59
|
+
const order = items.map((_, index) => index);
|
|
60
|
+
const max = itemLevels.reduce((max, level) => Math.max(max, level), 0);
|
|
61
|
+
// Reorder the single rendered line, including controls, as Pango does.
|
|
62
|
+
for (let level = max; level >= 1; level--) {
|
|
63
|
+
for (let first = 0; first < order.length;) {
|
|
64
|
+
tick();
|
|
65
|
+
if (itemLevels[order[first]] < level) {
|
|
66
|
+
first++;
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
let last = first;
|
|
70
|
+
while (last < order.length && itemLevels[order[last]] >= level) {
|
|
71
|
+
tick();
|
|
72
|
+
last++;
|
|
73
|
+
}
|
|
74
|
+
for (let a = first, b = last - 1; a < b; a++, b--)
|
|
75
|
+
[order[a], order[b]] = [order[b], order[a]];
|
|
76
|
+
first = last;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return { items, order };
|
|
80
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Pango default tabs leave at least one space before the next eight-space stop. */
|
|
2
|
+
export declare function nextPrintTabStop(width: number, tabWidth: number): number;
|
|
3
|
+
/** Mirror tab-run boxes without reversing the already-shaped glyphs inside each run. */
|
|
4
|
+
export declare function mirrorPrintTabRuns(glyphs: {
|
|
5
|
+
x: number;
|
|
6
|
+
}[], runs: readonly {
|
|
7
|
+
start: number;
|
|
8
|
+
end: number;
|
|
9
|
+
first: number;
|
|
10
|
+
last: number;
|
|
11
|
+
}[], width: number, tick: () => void): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Pango default tabs leave at least one space before the next eight-space stop. */
|
|
2
|
+
export function nextPrintTabStop(width, tabWidth) {
|
|
3
|
+
return Math.ceil((width + tabWidth / 8) / tabWidth) * tabWidth;
|
|
4
|
+
}
|
|
5
|
+
/** Mirror tab-run boxes without reversing the already-shaped glyphs inside each run. */
|
|
6
|
+
export function mirrorPrintTabRuns(glyphs, runs, width, tick) {
|
|
7
|
+
for (const run of runs) {
|
|
8
|
+
tick();
|
|
9
|
+
const offset = width - run.end - run.start;
|
|
10
|
+
for (let index = run.first; index < run.last; index++) {
|
|
11
|
+
tick();
|
|
12
|
+
glyphs[index].x += offset;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -5,5 +5,5 @@ export declare function splitPrintLines(value: string, tick: (amount?: number) =
|
|
|
5
5
|
}[];
|
|
6
6
|
/** Gnumeric displays LF inside Fill strings as a direction-aware return arrow. */
|
|
7
7
|
export declare function fillPrintNewlines(value: string, rtl: boolean, tick: (amount?: number) => void): string;
|
|
8
|
-
/** Keep shaping boundaries
|
|
9
|
-
export declare function
|
|
8
|
+
/** Keep shaping boundaries and control markers in single-direction Fill visual order. */
|
|
9
|
+
export declare function fillPrintItems(value: string, rtl: boolean, tick: (amount?: number) => void): string[];
|
|
@@ -30,9 +30,9 @@ export function fillPrintNewlines(value, rtl, tick) {
|
|
|
30
30
|
tick(value.length);
|
|
31
31
|
return value.split("\n").join(rtl ? "↪" : "↩");
|
|
32
32
|
}
|
|
33
|
-
/** Keep shaping boundaries
|
|
34
|
-
export function
|
|
33
|
+
/** Keep shaping boundaries and control markers in single-direction Fill visual order. */
|
|
34
|
+
export function fillPrintItems(value, rtl, tick) {
|
|
35
35
|
tick(value.length);
|
|
36
|
-
const parts = value.split("\u2029");
|
|
36
|
+
const parts = value.split("\u2029").flatMap(part => ["\u2028", "\r"].reduce((parts, separator) => parts.flatMap(part => part.split(separator).flatMap((piece, index) => index ? [separator, piece] : [piece])), [part]));
|
|
37
37
|
return rtl ? parts.reverse() : parts;
|
|
38
38
|
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { type CapabilityContext, type RangeSource } from "../spreadsheet-engine/contracts.js";
|
|
2
|
+
import type { BiffPropertySource } from "./biff-encrypted-properties-write.js";
|
|
2
3
|
import type { BiffRc4Cipher } from "./biff-encryption.js";
|
|
3
4
|
/** Admit the outer container and reject hidden plaintext property collisions
|
|
4
5
|
* before asking for a password. POI emits an empty document-summary placeholder. */
|
|
5
|
-
export declare function encryptedBiffPropertyStream(streams: ReadonlyMap<string, Uint8Array> | undefined, context: CapabilityContext, charge: (amount: number) => void, propertySources?: ReadonlyMap<string, RangeSource>): Promise<Uint8Array>;
|
|
6
|
+
export declare function encryptedBiffPropertyStream(streams: ReadonlyMap<string, Uint8Array> | undefined, context: CapabilityContext, charge: (amount: number) => void, propertySources?: ReadonlyMap<string, RangeSource>): Promise<Uint8Array | RangeSource>;
|
|
6
7
|
/** MS-OFFCRYPTO 2.3.5.4: header/table restart block 0; each payload restarts its
|
|
7
8
|
* descriptor block. These are not Workbook's absolute-position 1024-byte chunks. */
|
|
8
9
|
export declare function decryptBiffPropertyContainer(encrypted: Uint8Array, keyStream: (block: number, length: number) => Uint8Array, context: CapabilityContext, charge: (amount: number) => void, createCipher?: (block: number) => BiffRc4Cipher): ReadonlyMap<string, Uint8Array>;
|
|
10
|
+
/** Decrypt retained ciphertext directly into caller storage. Only the descriptor
|
|
11
|
+
* table is buffered; payload plaintext never accumulates in RAM. */
|
|
12
|
+
export declare function decryptBiffPropertySources(encrypted: Uint8Array | RangeSource, createCipher: (block: number) => BiffRc4Cipher, context: CapabilityContext, charge: (amount: number) => void): Promise<ReadonlyMap<string, BiffPropertySource>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SsconvertError } from "../spreadsheet-engine/contracts.js";
|
|
2
|
+
import { stagePropertyBytes } from "./biff-property-bytes.js";
|
|
2
3
|
import { Binary, invalidBiff } from "./biff-binary.js";
|
|
3
4
|
import { biffPropertyFormats } from "./biff-properties.js";
|
|
4
5
|
import { propertyRange, readPropertySectionRanges, readPropertyValueRanges } from "./biff-property-range.js";
|
|
@@ -22,7 +23,8 @@ export async function encryptedBiffPropertyStream(streams, context, charge, prop
|
|
|
22
23
|
invalidBiff("duplicate encrypted property stream");
|
|
23
24
|
names.add(key);
|
|
24
25
|
if (key === "ENCRYPTION") {
|
|
25
|
-
|
|
26
|
+
const input = propertySources?.get(name);
|
|
27
|
+
encrypted = input ? propertyRange(input, context) : bytes;
|
|
26
28
|
continue;
|
|
27
29
|
}
|
|
28
30
|
const file = propertyRange(propertySources?.get(name) ?? bytes, context);
|
|
@@ -44,9 +46,11 @@ export async function encryptedBiffPropertyStream(streams, context, charge, prop
|
|
|
44
46
|
}
|
|
45
47
|
if (!encrypted)
|
|
46
48
|
throw new SsconvertError("unsupported-feature", "Unsupported ssconvert feature: encrypted Excel workbook ancillary properties require the encryption stream");
|
|
47
|
-
|
|
49
|
+
const length = encrypted instanceof Uint8Array ? encrypted.length : encrypted.size;
|
|
50
|
+
if (length > context.limits.inputBytes)
|
|
48
51
|
throw new SsconvertError("resource-limit", "ssconvert encrypted BIFF property input limit exceeded");
|
|
49
|
-
|
|
52
|
+
if (length < 8)
|
|
53
|
+
invalidBiff("truncated binary data");
|
|
50
54
|
return encrypted;
|
|
51
55
|
}
|
|
52
56
|
/** MS-OFFCRYPTO 2.3.5.4: header/table restart block 0; each payload restarts its
|
|
@@ -100,60 +104,8 @@ export function decryptBiffPropertyContainer(encrypted, keyStream, context, char
|
|
|
100
104
|
check();
|
|
101
105
|
if (encrypted.length > context.limits.inputBytes)
|
|
102
106
|
throw new SsconvertError("resource-limit", "ssconvert encrypted BIFF property input limit exceeded");
|
|
103
|
-
const source = new Binary(encrypted),
|
|
104
|
-
const
|
|
105
|
-
header.bytes.fill(0);
|
|
106
|
-
if (offset < 8 || size < 4)
|
|
107
|
-
invalidBiff("invalid encrypted property descriptor range");
|
|
108
|
-
source.check(offset, size);
|
|
109
|
-
const table = new Binary(decrypt(source.slice(offset, size), 0)), count = table.u32(0);
|
|
110
|
-
if (count > Math.floor((size - 4) / 18))
|
|
111
|
-
invalidBiff("invalid encrypted property descriptor count");
|
|
112
|
-
if (count > (context.limits.workbookNodes ?? context.limits.inputBytes))
|
|
113
|
-
throw new SsconvertError("resource-limit", "ssconvert encrypted BIFF property node limit exceeded");
|
|
114
|
-
charge(count);
|
|
115
|
-
let at = 4, textBytes = 0;
|
|
116
|
-
const descriptors = [], names = new Set();
|
|
117
|
-
for (let i = 0; i < count; i++) {
|
|
118
|
-
context.signal.throwIfAborted();
|
|
119
|
-
table.check(at, 18);
|
|
120
|
-
const start = table.u32(at), length = table.u32(at + 4), block = table.u16(at + 8), nameLength = table.u8(at + 10), flags = table.u8(at + 11);
|
|
121
|
-
if (flags !== 1 || table.u32(at + 12) !== 0)
|
|
122
|
-
invalidBiff("invalid encrypted property descriptor flags");
|
|
123
|
-
at += 16;
|
|
124
|
-
if (!nameLength || nameLength > 31)
|
|
125
|
-
invalidBiff("invalid encrypted property stream name");
|
|
126
|
-
table.check(at, (nameLength + 1) * 2);
|
|
127
|
-
charge(nameLength);
|
|
128
|
-
if (table.u16(at + nameLength * 2) !== 0)
|
|
129
|
-
invalidBiff("unterminated encrypted property stream name");
|
|
130
|
-
textBytes += nameLength * 3;
|
|
131
|
-
if (textBytes > (context.limits.workbookTextBytes ?? context.limits.inputBytes))
|
|
132
|
-
throw new SsconvertError("resource-limit", "ssconvert encrypted BIFF property text limit exceeded");
|
|
133
|
-
let name;
|
|
134
|
-
try {
|
|
135
|
-
name = new TextDecoder("utf-16le", { fatal: true, ignoreBOM: true }).decode(table.slice(at, nameLength * 2));
|
|
136
|
-
}
|
|
137
|
-
catch {
|
|
138
|
-
invalidBiff("invalid encrypted property stream name");
|
|
139
|
-
}
|
|
140
|
-
if (name.includes("\0") || names.has(name.toUpperCase()))
|
|
141
|
-
invalidBiff("duplicate or invalid encrypted property stream name");
|
|
142
|
-
names.add(name.toUpperCase());
|
|
143
|
-
at += (nameLength + 1) * 2;
|
|
144
|
-
source.check(start, length);
|
|
145
|
-
if (start < 8 || start < offset + size && start + length > offset)
|
|
146
|
-
invalidBiff("overlapping encrypted property ranges");
|
|
147
|
-
descriptors.push({ offset: start, size: length, block, name });
|
|
148
|
-
}
|
|
149
|
-
if (at !== size)
|
|
150
|
-
invalidBiff("invalid encrypted property descriptor size");
|
|
151
|
-
table.bytes.fill(0);
|
|
152
|
-
charge(count * Math.ceil(Math.log2(count + 1)));
|
|
153
|
-
const ordered = [...descriptors].sort((a, b) => a.offset - b.offset);
|
|
154
|
-
for (let i = 1; i < ordered.length; i++)
|
|
155
|
-
if (ordered[i].offset < ordered[i - 1].offset + ordered[i - 1].size)
|
|
156
|
-
invalidBiff("overlapping encrypted property payloads");
|
|
107
|
+
const source = new Binary(encrypted), { offset, size } = propertyTableRange(decrypt(source.slice(0, 8), 0), source);
|
|
108
|
+
const descriptors = readEncryptedPropertyDescriptors(source, offset, size, decrypt(source.slice(offset, size), 0), context, charge);
|
|
157
109
|
for (const entry of descriptors)
|
|
158
110
|
result.set(entry.name, decrypt(source.slice(entry.offset, entry.size), entry.block));
|
|
159
111
|
return result;
|
|
@@ -163,3 +115,145 @@ export function decryptBiffPropertyContainer(encrypted, keyStream, context, char
|
|
|
163
115
|
throw error;
|
|
164
116
|
}
|
|
165
117
|
}
|
|
118
|
+
function propertyTableRange(bytes, source) {
|
|
119
|
+
const header = new Binary(bytes), offset = header.u32(0), size = header.u32(4);
|
|
120
|
+
bytes.fill(0);
|
|
121
|
+
if (offset < 8 || size < 4)
|
|
122
|
+
invalidBiff("invalid encrypted property descriptor range");
|
|
123
|
+
source.check(offset, size);
|
|
124
|
+
return { offset, size };
|
|
125
|
+
}
|
|
126
|
+
function readEncryptedPropertyDescriptors(source, offset, size, bytes, context, charge) {
|
|
127
|
+
const table = new Binary(bytes), count = table.u32(0);
|
|
128
|
+
if (count > Math.floor((size - 4) / 18))
|
|
129
|
+
invalidBiff("invalid encrypted property descriptor count");
|
|
130
|
+
if (count > (context.limits.workbookNodes ?? context.limits.inputBytes))
|
|
131
|
+
throw new SsconvertError("resource-limit", "ssconvert encrypted BIFF property node limit exceeded");
|
|
132
|
+
charge(count);
|
|
133
|
+
let at = 4, textBytes = 0;
|
|
134
|
+
const descriptors = [], names = new Set();
|
|
135
|
+
for (let i = 0; i < count; i++) {
|
|
136
|
+
context.signal.throwIfAborted();
|
|
137
|
+
table.check(at, 18);
|
|
138
|
+
const start = table.u32(at), length = table.u32(at + 4), block = table.u16(at + 8), nameLength = table.u8(at + 10), flags = table.u8(at + 11);
|
|
139
|
+
if (flags !== 1 || table.u32(at + 12) !== 0)
|
|
140
|
+
invalidBiff("invalid encrypted property descriptor flags");
|
|
141
|
+
at += 16;
|
|
142
|
+
if (!nameLength || nameLength > 31)
|
|
143
|
+
invalidBiff("invalid encrypted property stream name");
|
|
144
|
+
table.check(at, (nameLength + 1) * 2);
|
|
145
|
+
charge(nameLength);
|
|
146
|
+
if (table.u16(at + nameLength * 2) !== 0)
|
|
147
|
+
invalidBiff("unterminated encrypted property stream name");
|
|
148
|
+
textBytes += nameLength * 3;
|
|
149
|
+
if (textBytes > (context.limits.workbookTextBytes ?? context.limits.inputBytes))
|
|
150
|
+
throw new SsconvertError("resource-limit", "ssconvert encrypted BIFF property text limit exceeded");
|
|
151
|
+
let name;
|
|
152
|
+
try {
|
|
153
|
+
name = new TextDecoder("utf-16le", { fatal: true, ignoreBOM: true }).decode(table.slice(at, nameLength * 2));
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
invalidBiff("invalid encrypted property stream name");
|
|
157
|
+
}
|
|
158
|
+
if (name.includes("\0") || names.has(name.toUpperCase()))
|
|
159
|
+
invalidBiff("duplicate or invalid encrypted property stream name");
|
|
160
|
+
names.add(name.toUpperCase());
|
|
161
|
+
at += (nameLength + 1) * 2;
|
|
162
|
+
source.check(start, length);
|
|
163
|
+
if (start < 8 || start < offset + size && start + length > offset)
|
|
164
|
+
invalidBiff("overlapping encrypted property ranges");
|
|
165
|
+
descriptors.push({ offset: start, size: length, block, name });
|
|
166
|
+
}
|
|
167
|
+
if (at !== size)
|
|
168
|
+
invalidBiff("invalid encrypted property descriptor size");
|
|
169
|
+
table.bytes.fill(0);
|
|
170
|
+
charge(count * Math.ceil(Math.log2(count + 1)));
|
|
171
|
+
const ordered = [...descriptors].sort((a, b) => a.offset - b.offset);
|
|
172
|
+
for (let i = 1; i < ordered.length; i++)
|
|
173
|
+
if (ordered[i].offset < ordered[i - 1].offset + ordered[i - 1].size)
|
|
174
|
+
invalidBiff("overlapping encrypted property payloads");
|
|
175
|
+
return descriptors;
|
|
176
|
+
}
|
|
177
|
+
/** Decrypt retained ciphertext directly into caller storage. Only the descriptor
|
|
178
|
+
* table is buffered; payload plaintext never accumulates in RAM. */
|
|
179
|
+
export async function decryptBiffPropertySources(encrypted, createCipher, context, charge) {
|
|
180
|
+
const result = new Map(), owned = [];
|
|
181
|
+
const input = propertyRange(encrypted, context);
|
|
182
|
+
let closed = false;
|
|
183
|
+
const check = () => { context.signal.throwIfAborted(); if (closed)
|
|
184
|
+
throw new SsconvertError("invalid-request", "Encrypted BIFF property reader disposed"); };
|
|
185
|
+
const close = async () => {
|
|
186
|
+
closed = true;
|
|
187
|
+
for (const bytes of owned)
|
|
188
|
+
bytes.fill(0);
|
|
189
|
+
const outcomes = await Promise.allSettled([...result.values()].map(source => source.close()));
|
|
190
|
+
result.clear();
|
|
191
|
+
const errors = outcomes.filter((value) => value.status === "rejected").map(value => value.reason);
|
|
192
|
+
if (errors.length)
|
|
193
|
+
throw new AggregateError(errors, "Encrypted BIFF property cleanup failed");
|
|
194
|
+
};
|
|
195
|
+
context.own(close);
|
|
196
|
+
async function* chunks(offset, size, block) {
|
|
197
|
+
check();
|
|
198
|
+
input.check(offset, size);
|
|
199
|
+
charge(size * 2 + 320);
|
|
200
|
+
const cipher = createCipher(block);
|
|
201
|
+
try {
|
|
202
|
+
check();
|
|
203
|
+
for (let at = 0; at < size;) {
|
|
204
|
+
const output = await input.read(offset + at, Math.min(16384, size - at), { signal: context.signal });
|
|
205
|
+
at += output.length;
|
|
206
|
+
try {
|
|
207
|
+
cipher.xor(output);
|
|
208
|
+
check();
|
|
209
|
+
yield output;
|
|
210
|
+
check();
|
|
211
|
+
}
|
|
212
|
+
finally {
|
|
213
|
+
output.fill(0);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
finally {
|
|
218
|
+
cipher.close();
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
try {
|
|
222
|
+
check();
|
|
223
|
+
if (input.size > context.limits.inputBytes)
|
|
224
|
+
throw new SsconvertError("resource-limit", "ssconvert encrypted BIFF property input limit exceeded");
|
|
225
|
+
const decrypt = async (offset, size) => {
|
|
226
|
+
input.check(offset, size);
|
|
227
|
+
const output = new Uint8Array(size);
|
|
228
|
+
owned.push(output);
|
|
229
|
+
let at = 0;
|
|
230
|
+
for await (const part of chunks(offset, size, 0)) {
|
|
231
|
+
output.set(part, at);
|
|
232
|
+
at += part.length;
|
|
233
|
+
}
|
|
234
|
+
return output;
|
|
235
|
+
};
|
|
236
|
+
const { offset, size } = propertyTableRange(await decrypt(0, 8), input);
|
|
237
|
+
const descriptors = readEncryptedPropertyDescriptors(input, offset, size, await decrypt(offset, size), context, charge);
|
|
238
|
+
for (const entry of descriptors) {
|
|
239
|
+
const source = await stagePropertyBytes({ length: entry.size, chunks: () => chunks(entry.offset, entry.size, entry.block) }, context, context.limits.inputBytes);
|
|
240
|
+
result.set(entry.name, source);
|
|
241
|
+
check();
|
|
242
|
+
}
|
|
243
|
+
return result;
|
|
244
|
+
}
|
|
245
|
+
catch (error) {
|
|
246
|
+
try {
|
|
247
|
+
await close();
|
|
248
|
+
}
|
|
249
|
+
catch (cleanup) {
|
|
250
|
+
throw new AggregateError([error, cleanup], "Encrypted BIFF property read and cleanup failed");
|
|
251
|
+
}
|
|
252
|
+
throw error;
|
|
253
|
+
}
|
|
254
|
+
finally {
|
|
255
|
+
for (const bytes of owned)
|
|
256
|
+
bytes.fill(0);
|
|
257
|
+
owned.length = 0;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
@@ -12,4 +12,4 @@ export declare function createRc4Cipher(key: Uint8Array, context: CapabilityCont
|
|
|
12
12
|
/** Buffering convenience for the bounded record blocks and legacy readers. */
|
|
13
13
|
export declare function rc4Stream(key: Uint8Array, length: number, context: CapabilityContext): Uint8Array;
|
|
14
14
|
/** Decode admitted XOR/RC4 profiles; optional secret acquisition is explicit host authority. */
|
|
15
|
-
export declare function decryptBiffRecords(records: BiffRecords, revision: number, context: CapabilityContext, streams?: ReadonlyMap<string, Uint8Array>, propertySources?: ReadonlyMap<string, RangeSource>): Promise<ReadonlyMap<string, Uint8Array> | undefined>;
|
|
15
|
+
export declare function decryptBiffRecords(records: BiffRecords, revision: number, context: CapabilityContext, streams?: ReadonlyMap<string, Uint8Array>, propertySources?: ReadonlyMap<string, RangeSource>): Promise<ReadonlyMap<string, Uint8Array | RangeSource> | undefined>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { biffRecord } from "./biff-record-storage.js";
|
|
2
2
|
import { SsconvertError } from "../spreadsheet-engine/contracts.js";
|
|
3
3
|
import { Binary, invalidBiff } from "./biff-binary.js";
|
|
4
|
-
import { decryptBiffPropertyContainer, encryptedBiffPropertyStream } from "./biff-encrypted-properties.js";
|
|
4
|
+
import { decryptBiffPropertyContainer, decryptBiffPropertySources, encryptedBiffPropertyStream } from "./biff-encrypted-properties.js";
|
|
5
5
|
import { md5, sha1 } from "@noble/hashes/legacy.js";
|
|
6
6
|
/** MS-OFFCRYPTO legacy interoperability only; RC4 provides no authentication.
|
|
7
7
|
* The caller closes each stream before releasing its key lifetime. Only the
|
|
@@ -327,7 +327,9 @@ export async function decryptBiffRecords(records, revision, context, streams, pr
|
|
|
327
327
|
decoded.fill(0);
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
|
-
|
|
330
|
+
if (!properties)
|
|
331
|
+
return undefined;
|
|
332
|
+
const createCipher = (number) => {
|
|
331
333
|
const key = blockKey(number);
|
|
332
334
|
try {
|
|
333
335
|
return createRc4Cipher(key, context);
|
|
@@ -335,7 +337,10 @@ export async function decryptBiffRecords(records, revision, context, streams, pr
|
|
|
335
337
|
finally {
|
|
336
338
|
key.fill(0);
|
|
337
339
|
}
|
|
338
|
-
}
|
|
340
|
+
};
|
|
341
|
+
// Staging must finish while the block-key base still exists.
|
|
342
|
+
return context.createWorkingStorage || !(properties instanceof Uint8Array) ? await decryptBiffPropertySources(properties, createCipher, context, admit) :
|
|
343
|
+
decryptBiffPropertyContainer(properties, keyStream, context, admit, createCipher);
|
|
339
344
|
}
|
|
340
345
|
catch (error) {
|
|
341
346
|
for (const bytes of decodedBuffers)
|
|
@@ -6,4 +6,7 @@ export type BiffPropertyBytes = Uint8Array | {
|
|
|
6
6
|
};
|
|
7
7
|
export declare function propertyChunks(value: BiffPropertyBytes): Iterable<Uint8Array>;
|
|
8
8
|
/** Consume lazy serialization once into caller storage; never retain emitted chunks. */
|
|
9
|
-
export declare function stagePropertyBytes(value: BiffPropertyBytes
|
|
9
|
+
export declare function stagePropertyBytes(value: BiffPropertyBytes | {
|
|
10
|
+
readonly length: number;
|
|
11
|
+
chunks(): AsyncIterable<Uint8Array>;
|
|
12
|
+
}, context: CapabilityContext, maximumBytes?: number): Promise<BiffPropertySource>;
|
|
@@ -8,9 +8,9 @@ export function* propertyChunks(value) {
|
|
|
8
8
|
yield* value.chunks();
|
|
9
9
|
}
|
|
10
10
|
/** Consume lazy serialization once into caller storage; never retain emitted chunks. */
|
|
11
|
-
export async function stagePropertyBytes(value, context) {
|
|
11
|
+
export async function stagePropertyBytes(value, context, maximumBytes = context.limits.outputBytes) {
|
|
12
12
|
context.signal.throwIfAborted();
|
|
13
|
-
if (!Number.isSafeInteger(value.length) || value.length < 0 || value.length >
|
|
13
|
+
if (!Number.isSafeInteger(value.length) || value.length < 0 || value.length > maximumBytes)
|
|
14
14
|
throw new SsconvertError('resource-limit', 'Invalid BIFF property serialization size');
|
|
15
15
|
const acquire = context.createWorkingStorage?.bind(context);
|
|
16
16
|
if (!acquire)
|
|
@@ -61,7 +61,7 @@ export async function stagePropertyBytes(value, context) {
|
|
|
61
61
|
count = 0;
|
|
62
62
|
};
|
|
63
63
|
try {
|
|
64
|
-
for (const part of propertyChunks(value)) {
|
|
64
|
+
for await (const part of value instanceof Uint8Array ? propertyChunks(value) : value.chunks()) {
|
|
65
65
|
check();
|
|
66
66
|
if (part.length > source.size - written - count)
|
|
67
67
|
throw new SsconvertError('io', 'Invalid BIFF property serialization size');
|
|
@@ -100,7 +100,7 @@ export async function readBiffRange(input, context, probe = false) {
|
|
|
100
100
|
// Only these ancillary payloads are interpreted by the existing reader.
|
|
101
101
|
// Keep other names for its name/work admission, without copying ignored streams.
|
|
102
102
|
const needed = ["ENCRYPTION", "\u0005SUMMARYINFORMATION", "\u0005DOCUMENTSUMMARYINFORMATION"].includes(name.toUpperCase());
|
|
103
|
-
if (needed &&
|
|
103
|
+
if (needed && recordStore) {
|
|
104
104
|
propertySources.set(name, { size: stream.size, async read(at, count, options) {
|
|
105
105
|
try {
|
|
106
106
|
return await stream.read(at, count, options);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { propertyRange } from "./biff-property-range.js";
|
|
1
2
|
import { BiffStagedOutput } from "./biff-staged-output.js";
|
|
2
3
|
import { createBiffCatalogs } from "./biff-catalogs.js";
|
|
3
4
|
import { biffFillPatterns } from "./biff-fill-patterns.js";
|
|
@@ -1348,12 +1349,19 @@ async function readBiffContents(records, streamSize, streams, context, encoding,
|
|
|
1348
1349
|
for (const [name, bytes] of decryptedProperties ?? []) {
|
|
1349
1350
|
if (["\u0005SUMMARYINFORMATION", "\u0005DOCUMENTSUMMARYINFORMATION"].includes(name.toUpperCase()))
|
|
1350
1351
|
continue;
|
|
1351
|
-
|
|
1352
|
-
|
|
1352
|
+
const range = propertyRange(bytes, context);
|
|
1353
|
+
accountFormulaWork(range.size * 2);
|
|
1354
|
+
metadataBytes += range.size * 2;
|
|
1353
1355
|
if (metadataBytes > (context.limits.workbookTextBytes ?? context.limits.inputBytes * 2))
|
|
1354
1356
|
throw new SsconvertError("resource-limit", "ssconvert BIFF metadata byte limit exceeded");
|
|
1357
|
+
let hex = "";
|
|
1358
|
+
for (let at = 0; at < range.size;) {
|
|
1359
|
+
const chunk = await range.read(at, 16384);
|
|
1360
|
+
at += chunk.length;
|
|
1361
|
+
hex += Array.from(chunk, byte => byte.toString(16).padStart(2, "0")).join("");
|
|
1362
|
+
}
|
|
1355
1363
|
unsupported.push({ source: "biff", kind: "encrypted-ancillary", disposition: "retained",
|
|
1356
|
-
data: { stream: accountText(name), bytes: accountText(
|
|
1364
|
+
data: { stream: accountText(name), bytes: accountText(hex) } });
|
|
1357
1365
|
await context.diagnostic?.({ code: "biff-loss-warning", severity: "warning", message: `BIFF encrypted ancillary stream ${name} retained without interpretation` });
|
|
1358
1366
|
}
|
|
1359
1367
|
const properties = propertyStreams ? await readBiffProperties(propertyStreams, context, accountText, accountFormulaWork, unsupported) : {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poe-platform/safe-bash",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.811",
|
|
4
4
|
"description": "Extensible virtual shell with pluggable filesystems and streaming commands",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -1407,7 +1407,7 @@
|
|
|
1407
1407
|
"access": "public"
|
|
1408
1408
|
},
|
|
1409
1409
|
"dependencies": {
|
|
1410
|
-
"@poe-platform/safe-fs": "0.1.
|
|
1410
|
+
"@poe-platform/safe-fs": "0.1.811",
|
|
1411
1411
|
"pdf-lib": "1.17.1",
|
|
1412
1412
|
"@types/node": "^25.2.2",
|
|
1413
1413
|
"@formatjs/intl-numberformat": "9.4.0",
|
|
@@ -1420,6 +1420,7 @@
|
|
|
1420
1420
|
"parse5": "7.3.0",
|
|
1421
1421
|
"@pdf-lib/fontkit": "1.1.1",
|
|
1422
1422
|
"linebreak": "^1.1.0",
|
|
1423
|
+
"bidi-js": "1.1.0",
|
|
1423
1424
|
"saxes": "^6.0.0",
|
|
1424
1425
|
"temporal-polyfill": "1.0.4",
|
|
1425
1426
|
"@formatjs/intl-localematcher": "0.8.13",
|
|
@@ -2729,9 +2730,11 @@
|
|
|
2729
2730
|
"./dist/spreadsheet-engine/rendering/images/index.js",
|
|
2730
2731
|
"./dist/spreadsheet-engine/rendering/images/profile-raster.js",
|
|
2731
2732
|
"./dist/spreadsheet-engine/rendering/images/scene.js",
|
|
2733
|
+
"./dist/spreadsheet-engine/rendering/print/bidi-runs.js",
|
|
2732
2734
|
"./dist/spreadsheet-engine/rendering/print/blank-styles.js",
|
|
2733
2735
|
"./dist/spreadsheet-engine/rendering/print/border-junctions.js",
|
|
2734
2736
|
"./dist/spreadsheet-engine/rendering/print/cell-style.js",
|
|
2737
|
+
"./dist/spreadsheet-engine/rendering/print/control-bidi.js",
|
|
2735
2738
|
"./dist/spreadsheet-engine/rendering/print/diagonal-borders.js",
|
|
2736
2739
|
"./dist/spreadsheet-engine/rendering/print/font-normalization-data.js",
|
|
2737
2740
|
"./dist/spreadsheet-engine/rendering/print/font-normalization.js",
|
|
@@ -2748,6 +2751,7 @@
|
|
|
2748
2751
|
"./dist/spreadsheet-engine/rendering/print/rotated-text.js",
|
|
2749
2752
|
"./dist/spreadsheet-engine/rendering/print/settings.js",
|
|
2750
2753
|
"./dist/spreadsheet-engine/rendering/print/shared-borders.js",
|
|
2754
|
+
"./dist/spreadsheet-engine/rendering/print/tab-layout.js",
|
|
2751
2755
|
"./dist/spreadsheet-engine/rendering/print/text-lines.js",
|
|
2752
2756
|
"./dist/spreadsheet-engine/rendering/print/text-span.js",
|
|
2753
2757
|
"./dist/spreadsheet-engine/rendering/print/wrap-lines.js",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// packages/safe-bash/src/commands/audio/index.ts
|
|
2
|
-
import { audioCommands, createAudioCommand, createAudioCommands, createFfprobeCommand, createFfprobeCommands, createSoxCommand, createSoxCommands, createSoxiCommand, createSoxiCommands, ffprobeCommands, soxCommands, soxiCommands } from "../../safe-bash-command-audio/index.js";
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
audioCommands,
|
|
6
|
-
createAudioCommand,
|
|
7
|
-
createAudioCommands,
|
|
8
|
-
createFfprobeCommand,
|
|
9
|
-
createFfprobeCommands,
|
|
10
|
-
createSoxCommand,
|
|
11
|
-
createSoxCommands,
|
|
12
|
-
createSoxiCommand,
|
|
13
|
-
createSoxiCommands,
|
|
14
|
-
ffprobeCommands,
|
|
15
|
-
soxCommands,
|
|
16
|
-
soxiCommands
|
|
17
|
-
};
|