@poe-platform/safe-bash 0.1.812 → 0.1.813
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/id3-source.d.ts +27 -0
- package/dist/audio-ast/index.d.ts +4 -0
- package/dist/audio-ast/index.js +996 -596
- package/dist/audio-ast/mp3-source.d.ts +18 -0
- package/dist/audio-ast/ogg-source.d.ts +25 -0
- package/dist/audio-ast/ogg-stream-source.d.ts +22 -0
- package/dist/image-ast/index.js +139 -9
- package/dist/mp4-ast/containers/adapters.d.ts +7 -0
- package/dist/office-xml/retained-xml-document.d.ts +8 -0
- package/dist/pdf-ast/ast.d.ts +2 -0
- package/dist/pdf-ast/content/dictionary-cursor.d.ts +15 -0
- package/dist/pdf-ast/content/range-operator-parser.d.ts +4 -0
- package/dist/pdf-ast/content/stored-dictionary.d.ts +10 -0
- package/dist/pdf-ast/cos/lexer.d.ts +8 -5
- package/dist/pdf-ast/cos/object-reader.d.ts +4 -3
- package/dist/pdf-ast/cos/range-parser.d.ts +4 -0
- package/dist/pdf-ast/cos/retained-objects.d.ts +1 -0
- package/dist/pdf-ast/cos/retained-writer.d.ts +1 -0
- package/dist/pdf-ast/cos/value-parser.d.ts +9 -0
- package/dist/pdf-ast/edit/retained-append-attachments.d.ts +13 -0
- package/dist/pdf-ast/edit/retained-bookmarks.d.ts +13 -0
- package/dist/pdf-ast/edit/retained-graph.d.ts +6 -0
- package/dist/pdf-ast/edit/retained-save.d.ts +2 -0
- package/dist/pdf-ast/edit/retained-stamps.d.ts +9 -0
- package/dist/pdf-ast/fonts/resolve.d.ts +3 -1
- package/dist/pdf-ast/index.d.ts +3 -1
- package/dist/pdf-ast/index.js +1557 -770
- package/dist/safe-bash/audio-ast.browser.js +6 -1
- package/dist/safe-bash/chunks/{chunk-HHSOUC3Z.js → chunk-HPQE675Q.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-BUYRKFW2.js → chunk-I6ECNJMR.js} +1 -1
- package/dist/safe-bash/chunks/{pdftk-WRYEP3CA.js → pdftk-Y2TX74LY.js} +2 -1
- package/dist/safe-bash/command-chunks/biff-4ALVARRF-7SRX6R6N.js +5192 -0
- package/dist/safe-bash/command-chunks/{chunk-EHSM5ZQS.js → chunk-2DGJOOXM.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-Q6S57NOQ.js → chunk-2E2H7MBH.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-MMBZTYXO.js → chunk-2PQRZDNR.js} +221 -0
- package/dist/safe-bash/command-chunks/{chunk-NARD63DY.js → chunk-2V6FOLXV.js} +22 -66
- package/dist/safe-bash/command-chunks/{chunk-56NYSX65.js → chunk-2Z3WRRFT.js} +9 -9
- package/dist/safe-bash/command-chunks/chunk-3D24WDND.js +63 -0
- package/dist/safe-bash/command-chunks/{chunk-47NEG4UO.js → chunk-3JST2Q7G.js} +219 -43
- package/dist/safe-bash/command-chunks/{chunk-WGG6G2KG.js → chunk-3LJAXFH5.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-AHA6IWAJ.js → chunk-3TYDSGAH.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-YSMNXMAO.js → chunk-3Y4XZB24.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-ZIIO6GRY.js → chunk-4PBNMKAT.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-JFYWVQ4V.js → chunk-4Z6W5EOC.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-GEM47B2P.js → chunk-57DDYKE5.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-4CKFNXRN.js → chunk-5IFRAI7Y.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-RHYJVTJO.js → chunk-5KGEZ3RW.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-A5FZBR7X.js → chunk-5MFDRSGG.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-7GKKMNL6.js → chunk-5P6I2T63.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-6M6TM5Z5.js → chunk-5VQVZPP3.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-MIRL7HTF.js → chunk-6244HYJY.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-63EMPQ7Z.js +115 -0
- package/dist/safe-bash/command-chunks/{chunk-XRVKWGVQ.js → chunk-6CY5BHBS.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-XVP6V5K3.js → chunk-6IWE7PTK.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-6QBMND4A.js → chunk-6SRHWVEB.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-6ZHQB453.js +35 -0
- package/dist/safe-bash/command-chunks/chunk-73NYFNAS.js +173 -0
- package/dist/safe-bash/command-chunks/{chunk-2JSDKQ4J.js → chunk-7NXTEWPR.js} +119 -44
- package/dist/safe-bash/command-chunks/{chunk-554Z6IKP.js → chunk-7PRL6RJ6.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-SDTPO2VV.js → chunk-7PZHWMK6.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-XZ2FWFNV.js → chunk-7QZ2HP2F.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-OEJM666F.js → chunk-7UC2Q6Z6.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-COKYZUBW.js → chunk-AJI55RS7.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-WXRYDALR.js → chunk-BBAB7LC4.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-QYMEASQ6.js → chunk-BEHUSUOY.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-Z2JW6M2D.js → chunk-BK7ISUJL.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-33YCKZZX.js → chunk-C5KLFZGT.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-TVH4JORU.js → chunk-C5QDEB3I.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-N4R2SHSS.js → chunk-CCZZVCHX.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-2VLAXKTS.js → chunk-CTDC4LJT.js} +121 -85
- package/dist/safe-bash/command-chunks/{chunk-S6R3IB36.js → chunk-D55REQA3.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-Y4EYCZFT.js → chunk-D6WJY6QO.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-2CORNDGF.js → chunk-DBLHCJJU.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-SPW4GW4Z.js → chunk-DFI7QF3M.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-456PHA3L.js → chunk-DMCI6T6N.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-TW73OXPR.js → chunk-EJTNVXWF.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-QD7ZRDUN.js → chunk-ET2VPDUA.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-CJQSAATC.js → chunk-EXOQGXEU.js} +26 -26
- package/dist/safe-bash/command-chunks/{chunk-CRV2Q3PB.js → chunk-EZ4NQIPL.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-FWKLBDMK.js +0 -0
- package/dist/safe-bash/command-chunks/{chunk-22MOB45U.js → chunk-FWPVQGYK.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-QC5RMGSA.js → chunk-G3RUXKVY.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-JYUJAF4L.js → chunk-G7NENPYV.js} +4 -0
- package/dist/safe-bash/command-chunks/{chunk-KCOJA7EM.js → chunk-GKILM4HZ.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-HTVIYLVB.js → chunk-GNXTMSYN.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-D2ASPM7R.js → chunk-GOBUDKZ3.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-RNSKXOG3.js → chunk-GVWVRPG6.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-FDCIPJBQ.js → chunk-HCKYUQ3L.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-AGLK7OJR.js → chunk-HDSIIQBS.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-DM2CPMB4.js → chunk-HKOMXGJS.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-IT7TAC3F.js → chunk-HVW53ARH.js} +16 -16
- package/dist/safe-bash/command-chunks/{chunk-M7QE2MN7.js → chunk-I4GMCWAT.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-HWQ2UHMT.js → chunk-IHSOOSNC.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-LCZDBW55.js → chunk-JAHJWVGF.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-MOZD7RUY.js → chunk-JORIVUPM.js} +27 -11
- package/dist/safe-bash/command-chunks/{chunk-PMAM4N33.js → chunk-JUJHYPYL.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-ENT3IV2G.js → chunk-KBUBSMCQ.js} +12 -12
- package/dist/safe-bash/command-chunks/{chunk-ZXR6LXV5.js → chunk-KCE5D4Z4.js} +48 -4
- package/dist/safe-bash/command-chunks/{chunk-FIIAYCWS.js → chunk-KZ5ODST6.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-PNGDJA6M.js → chunk-LD7BONZY.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-KJ4XXZIL.js → chunk-M3Z5PU2M.js} +582 -59
- package/dist/safe-bash/command-chunks/{chunk-LXLLA4PM.js → chunk-MKX4JAZ6.js} +17 -17
- package/dist/safe-bash/command-chunks/{chunk-RQIQ75W5.js → chunk-MNHBQBF6.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-A2CLZMQZ.js → chunk-MPKY37QR.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-K5GB2YMN.js → chunk-MUUWBZIC.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-JOCFI7TG.js → chunk-N32GSM3J.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-EUT24Y5Z.js → chunk-NKTULXVD.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-5HPU7D36.js → chunk-NMPED6L5.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-QZZ73J2O.js → chunk-NPFHUS4X.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-X7FA7ZD5.js → chunk-O675URF4.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-R6EGGK5M.js → chunk-P7EL2FWW.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-YS25EI54.js → chunk-PCCFLPUQ.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-RRL3Y562.js → chunk-PI6MOMHA.js} +11 -11
- package/dist/safe-bash/command-chunks/{chunk-26VCZHLJ.js → chunk-PIOQBOEK.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-PK36TVXB.js +175 -0
- package/dist/safe-bash/command-chunks/{chunk-3Q247UDJ.js → chunk-PKLJRB7W.js} +264 -129
- package/dist/safe-bash/command-chunks/{chunk-6CCQI6XZ.js → chunk-PSCOXGCA.js} +12 -12
- package/dist/safe-bash/command-chunks/{chunk-XPD636C4.js → chunk-PVGZMLC6.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-JQVHUSDD.js → chunk-PXWS3Q7L.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-HDJVJTCK.js → chunk-QFF5KBOM.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-MPUHH2KR.js → chunk-QM2HZJSJ.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-UAXSE3XE.js → chunk-R2BMZAHG.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-KB7DUBVL.js → chunk-RGOQKIG6.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-D2KZ66W4.js → chunk-RLCQ7BN3.js} +187 -39
- package/dist/safe-bash/command-chunks/{chunk-B5LDP7AA.js → chunk-S2N2V5U4.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-OA75SGN2.js → chunk-SGPCXAG7.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-QUM3SYAJ.js → chunk-SYSX46IV.js} +3 -3
- package/dist/safe-bash/command-chunks/chunk-T3E5RV3U.js +737 -0
- package/dist/safe-bash/command-chunks/{chunk-YORJDX4V.js → chunk-T5ERNELL.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-ZEX53S5I.js → chunk-T6C5QP7T.js} +6368 -6230
- package/dist/safe-bash/command-chunks/{chunk-ATTWQVR2.js → chunk-TKRLZIFI.js} +17 -17
- package/dist/safe-bash/command-chunks/{chunk-ZMHEGDU2.js → chunk-TODWFDYB.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-XVLWZTPY.js → chunk-TQEB4DH4.js} +543 -144
- package/dist/safe-bash/command-chunks/{chunk-36XGIPOG.js → chunk-U5TWQFZY.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-APEWTWCC.js → chunk-UAF4IX5H.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-6VPQ3CDZ.js → chunk-V37D6AHO.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-RID6VYS3.js → chunk-V6XBEYPC.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-WJCN2IXI.js → chunk-VQOINPVF.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-W5YSINXC.js → chunk-VVWXY6IA.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-HKATEVAP.js → chunk-WPVBUVFK.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-UYWSIIUX.js → chunk-X53AEG36.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-L5MCW6CM.js → chunk-X64XGIXZ.js} +9 -155
- package/dist/safe-bash/command-chunks/{chunk-Q73EMLLZ.js → chunk-X6RHJ6YN.js} +84 -5
- package/dist/safe-bash/command-chunks/{chunk-7PVHO47B.js → chunk-XG6UWQV5.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-NQDIT667.js → chunk-XIDGHIGB.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-CV7M2QJU.js → chunk-XLYIVBAR.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-WVMHRNXZ.js → chunk-YUXTK3XA.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-SPLOIABU.js → chunk-YXD6VGVG.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-2ZFLMWOX.js → chunk-Z5BIM5B7.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-ZYLGNIGA.js +156 -0
- package/dist/safe-bash/command-chunks/{command-engine-BCUQGJJ4.js → command-engine-X3OLN7N6.js} +150 -67
- package/dist/safe-bash/command-chunks/{engine-LAUEWYSQ-DQCEI5HE.js → engine-XUCIFZ7V-LJFGZM6O.js} +1 -1
- package/dist/safe-bash/command-chunks/paradox-4FCZE53D-LQPGVMEL.js +365 -0
- package/dist/safe-bash/commands/pandoc/index.browser.js +1 -1
- package/dist/safe-bash/full-core.browser.js +2 -2
- package/dist/safe-bash/plugins/index.browser.js +2 -2
- package/dist/safe-bash-command-diff/diff.js +1 -1
- package/dist/safe-bash-command-diff/index.js +1 -1
- package/dist/safe-bash-command-ffmpeg/index.js +1 -1
- package/dist/safe-bash-command-ffprobe/index.js +2 -2
- package/dist/safe-bash-command-ffprobe/media.d.ts +3 -1
- package/dist/safe-bash-command-ffprobe/media.js +2 -2
- package/dist/safe-bash-command-html-to-markdown/budget.js +2 -1
- package/dist/safe-bash-command-html-to-markdown/entities.js +4 -3
- package/dist/safe-bash-command-html-to-markdown/index.js +564 -110
- package/dist/safe-bash-command-html-to-markdown/input.js +6 -5
- package/dist/safe-bash-command-html-to-markdown/options.js +2 -1
- package/dist/safe-bash-command-html-to-markdown/parser.js +5 -4
- package/dist/safe-bash-command-html-to-markdown/render.js +6 -5
- package/dist/safe-bash-command-html-to-markdown/text.js +3 -2
- package/dist/safe-bash-command-htmlq/index.js +361 -37
- package/dist/safe-bash-command-htmlq/tree.d.ts +3 -2
- package/dist/safe-bash-command-pandoc/command.js +7 -7
- package/dist/safe-bash-command-pandoc/index.js +55 -55
- package/dist/safe-bash-command-patch/index.js +6 -6
- package/dist/safe-bash-command-patch/patch-envelope.js +53 -3
- package/dist/safe-bash-command-patch/patch-formats.d.ts +2 -2
- package/dist/safe-bash-command-patch/patch-formats.js +2 -2
- package/dist/safe-bash-command-patch/patch-gnu-reject.d.ts +2 -1
- package/dist/safe-bash-command-patch/patch-gnu-reject.js +4 -3
- package/dist/safe-bash-command-patch/patch-publication.js +2 -1
- package/dist/safe-bash-command-patch/patch.js +6 -6
- package/dist/safe-bash-command-patch/unified.d.ts +10 -2
- package/dist/safe-bash-command-patch/unified.js +1 -1
- package/dist/safe-bash-command-pdftk/index.d.ts +6 -2
- package/dist/safe-bash-command-pdftk/index.js +830 -271
- package/dist/safe-bash-command-pptx/command-engine.d.ts +3 -0
- package/dist/safe-bash-command-pptx/engine.js +1 -1
- package/dist/safe-bash-command-pptx/index.js +9 -2
- 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 +22 -31
- package/dist/safe-bash-presentation-engine/accessibility.js +31 -30
- package/dist/safe-bash-presentation-engine/animation-editing.js +16 -15
- package/dist/safe-bash-presentation-engine/animations.js +16 -15
- package/dist/safe-bash-presentation-engine/backgrounds.js +17 -16
- package/dist/safe-bash-presentation-engine/bytes.js +3 -3
- package/dist/safe-bash-presentation-engine/chart-editing.js +34 -33
- package/dist/safe-bash-presentation-engine/chart-object-operations.js +25 -24
- package/dist/safe-bash-presentation-engine/charts.js +31 -30
- package/dist/safe-bash-presentation-engine/command-placeholder.js +59 -56
- package/dist/safe-bash-presentation-engine/comments.js +17 -16
- package/dist/safe-bash-presentation-engine/connector-operations.js +32 -31
- package/dist/safe-bash-presentation-engine/connectors.js +29 -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 +32 -31
- package/dist/safe-bash-presentation-engine/drawing-enums.d.ts +10 -10
- package/dist/safe-bash-presentation-engine/drawing-format.js +20 -19
- package/dist/safe-bash-presentation-engine/drawing-operations.js +31 -30
- package/dist/safe-bash-presentation-engine/drawing-schema.js +21 -20
- package/dist/safe-bash-presentation-engine/equations.js +17 -16
- package/dist/safe-bash-presentation-engine/errors.js +2 -2
- package/dist/safe-bash-presentation-engine/fields.js +17 -16
- package/dist/safe-bash-presentation-engine/font-metrics.js +3 -3
- package/dist/safe-bash-presentation-engine/image-extraction.js +20 -19
- package/dist/safe-bash-presentation-engine/image-formatting.js +32 -31
- package/dist/safe-bash-presentation-engine/image-insertion.js +18 -17
- package/dist/safe-bash-presentation-engine/image-replacement.js +21 -20
- package/dist/safe-bash-presentation-engine/image-value.js +4 -4
- package/dist/safe-bash-presentation-engine/images.js +19 -18
- package/dist/safe-bash-presentation-engine/index.d.ts +5 -1
- package/dist/safe-bash-presentation-engine/index.js +109 -96
- package/dist/safe-bash-presentation-engine/layouts.js +16 -15
- package/dist/safe-bash-presentation-engine/length.js +3 -3
- package/dist/safe-bash-presentation-engine/links.js +16 -15
- package/dist/safe-bash-presentation-engine/masters.js +15 -14
- package/dist/safe-bash-presentation-engine/media-editing.js +24 -23
- package/dist/safe-bash-presentation-engine/media-extraction.js +17 -16
- package/dist/safe-bash-presentation-engine/media.js +16 -15
- package/dist/safe-bash-presentation-engine/memberships.js +15 -14
- package/dist/safe-bash-presentation-engine/notes.js +16 -15
- package/dist/safe-bash-presentation-engine/ole-enum.js +4 -4
- package/dist/safe-bash-presentation-engine/ole-insertion.js +20 -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.d.ts +3 -0
- package/dist/safe-bash-presentation-engine/package-tools.js +27 -17
- 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 +58 -55
- package/dist/safe-bash-presentation-engine/presentation-settings.js +14 -13
- package/dist/safe-bash-presentation-engine/properties.js +16 -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-archive-staging.d.ts +19 -0
- package/dist/safe-bash-presentation-engine/retained-extraction-output.d.ts +18 -0
- package/dist/safe-bash-presentation-engine/retained-inspection.js +14 -12
- package/dist/safe-bash-presentation-engine/retained-package-extraction.d.ts +22 -0
- package/dist/safe-bash-presentation-engine/retained-package-packing.d.ts +19 -0
- package/dist/safe-bash-presentation-engine/retained-package.d.ts +2 -0
- package/dist/safe-bash-presentation-engine/retained-package.js +6 -4
- package/dist/safe-bash-presentation-engine/retained-text.js +19 -17
- package/dist/safe-bash-presentation-engine/retained-xml-parts.d.ts +5 -1
- package/dist/safe-bash-presentation-engine/retained-xml-publication.d.ts +18 -0
- package/dist/safe-bash-presentation-engine/retained-xml-replacement.d.ts +13 -0
- package/dist/safe-bash-presentation-engine/sanitize.js +17 -16
- package/dist/safe-bash-presentation-engine/selectors.js +10 -10
- package/dist/safe-bash-presentation-engine/shape-groups.js +31 -30
- package/dist/safe-bash-presentation-engine/shape-operations.js +30 -29
- package/dist/safe-bash-presentation-engine/shape-path-operations.js +32 -31
- package/dist/safe-bash-presentation-engine/shape-paths.js +16 -15
- package/dist/safe-bash-presentation-engine/shape-presets.js +3 -3
- package/dist/safe-bash-presentation-engine/shape-selection.js +31 -30
- package/dist/safe-bash-presentation-engine/shape-transforms.js +18 -17
- package/dist/safe-bash-presentation-engine/shapes.d.ts +1 -1
- package/dist/safe-bash-presentation-engine/shapes.js +27 -26
- package/dist/safe-bash-presentation-engine/slide-copy.js +17 -16
- package/dist/safe-bash-presentation-engine/slide-import.js +18 -17
- package/dist/safe-bash-presentation-engine/slide-merge-split.js +20 -19
- package/dist/safe-bash-presentation-engine/slide-model.js +43 -42
- package/dist/safe-bash-presentation-engine/slide-removal.js +18 -17
- package/dist/safe-bash-presentation-engine/slide-transfer-budget.js +9 -9
- package/dist/safe-bash-presentation-engine/slides.js +19 -16
- package/dist/safe-bash-presentation-engine/table-operations.js +33 -32
- package/dist/safe-bash-presentation-engine/table-spans.js +32 -31
- package/dist/safe-bash-presentation-engine/tables.js +31 -30
- package/dist/safe-bash-presentation-engine/tags.js +16 -15
- package/dist/safe-bash-presentation-engine/template-bindings.js +33 -32
- package/dist/safe-bash-presentation-engine/template-repeat.js +40 -39
- package/dist/safe-bash-presentation-engine/text-fitting.js +27 -26
- package/dist/safe-bash-presentation-engine/text-frames.js +27 -26
- package/dist/safe-bash-presentation-engine/text-paragraphs.js +27 -26
- package/dist/safe-bash-presentation-engine/text-reading.js +11 -11
- package/dist/safe-bash-presentation-engine/text-replacement.js +17 -16
- package/dist/safe-bash-presentation-engine/text-runs.js +20 -19
- package/dist/safe-bash-presentation-engine/themes.js +16 -15
- package/dist/safe-bash-presentation-engine/transitions.js +16 -15
- package/dist/safe-bash-presentation-engine/validation.js +10 -9
- package/dist/safe-bash-presentation-engine/xml-parts.d.ts +2 -0
- package/dist/safe-bash-presentation-engine/xml-parts.js +23 -15
- 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-regex-engine/index.js +1 -1
- package/dist/safe-bash-regex-engine/python-glob.js +1 -1
- package/dist/safe-bash-regex-engine/text/regex.d.ts +19 -0
- package/dist/safe-bash-regex-engine/text/regex.js +1 -1
- package/dist/safe-bash-xml-engine/document.js +3 -3
- package/dist/safe-bash-xml-engine/evaluate.js +1 -1
- package/dist/safe-bash-xml-engine/index.d.ts +1 -0
- package/dist/safe-bash-xml-engine/index.js +8 -4
- package/dist/safe-bash-xml-engine/query.js +2 -2
- package/dist/safe-bash-xml-engine/recovery.d.ts +10 -0
- package/dist/safe-bash-xml-engine/stored-document.d.ts +1 -1
- package/dist/safe-bash-xml-engine/stored-document.js +1 -1
- package/dist/safe-bash-xml-engine/stored-evaluate.js +1 -1
- package/dist/spreadsheet-engine/formulas/functions/python-printf.js +56 -33
- package/dist/spreadsheet-format-xls/biff-encrypted-properties.d.ts +1 -1
- package/dist/spreadsheet-format-xls/biff-encrypted-properties.js +47 -18
- package/dist/spreadsheet-format-xls/biff-properties-merge.d.ts +6 -2
- package/dist/spreadsheet-format-xls/biff-properties-merge.js +413 -296
- package/dist/spreadsheet-format-xls/biff-properties-write.js +40 -23
- package/dist/spreadsheet-format-xls/biff-properties.js +3 -68
- package/dist/spreadsheet-format-xls/biff-property-index.d.ts +23 -0
- package/dist/spreadsheet-format-xls/biff-property-index.js +93 -0
- package/dist/spreadsheet-format-xls/biff-property-name.d.ts +4 -0
- package/dist/spreadsheet-format-xls/biff-property-name.js +114 -0
- package/dist/spreadsheet-format-xls/biff-property-text.d.ts +6 -0
- package/dist/spreadsheet-format-xls/biff-property-text.js +68 -0
- package/dist/spreadsheet-format-xls/biff-property-transcode.d.ts +5 -0
- package/dist/spreadsheet-format-xls/biff-property-transcode.js +45 -0
- package/package.json +6 -3
- package/dist/safe-bash/command-chunks/biff-YKPDH35C-MVQIWNKV.js +0 -4974
- package/dist/safe-bash/command-chunks/chunk-5Q22ZLNC.js +0 -127
- package/dist/safe-bash/command-chunks/chunk-JKLOBSMP.js +0 -56
- package/dist/safe-bash/command-chunks/chunk-JYTESTBS.js +0 -99
- package/dist/safe-bash/command-chunks/chunk-ZEGNRZV2.js +0 -333
- package/dist/safe-bash/command-chunks/paradox-ZWWXYY4J-JYOSWSBL.js +0 -362
- package/dist/spreadsheet-format-xls/biff-properties-layout.js +0 -56
|
@@ -396,30 +396,12 @@ export async function writeBiffProperties(book, context, staged = false) {
|
|
|
396
396
|
yield* propertyChunks(encoded.get(guid));
|
|
397
397
|
} });
|
|
398
398
|
}
|
|
399
|
-
// Opaque snapshot merging still needs random byte-array access. Keep it explicit
|
|
400
|
-
// until that reader and its codepage/identity logic migrate to retained ranges.
|
|
401
399
|
const snapshots = (book.unsupportedRecords ?? []).some(record => record.source === "biff" && record.kind === "ole-properties" && record.disposition === "retained");
|
|
402
|
-
const streams = new Map();
|
|
403
|
-
if (!staged || snapshots)
|
|
404
|
-
for (const [name, value] of planned) {
|
|
405
|
-
const bytes = new Uint8Array(value.length);
|
|
406
|
-
let at = 0;
|
|
407
|
-
for (const part of propertyChunks(value)) {
|
|
408
|
-
bytes.set(part, at);
|
|
409
|
-
at += part.length;
|
|
410
|
-
}
|
|
411
|
-
streams.set(name, bytes);
|
|
412
|
-
}
|
|
413
|
-
const preserved = await mergeBiffProperties(book, streams, handledMetadata, context, charge, allocate);
|
|
414
|
-
for (const key of unsupportedKeys)
|
|
415
|
-
if (!preserved.has(key))
|
|
416
|
-
await context.diagnostic?.({ code: "biff-loss-warning", severity: "warning", message: `Unsupported Excel BIFF document property: ${key}` });
|
|
417
|
-
if (!staged)
|
|
418
|
-
return { streams, handledMetadata, async close() { } };
|
|
400
|
+
const streams = new Map(), inputs = [];
|
|
419
401
|
const sources = new Map();
|
|
420
402
|
const close = async () => {
|
|
421
403
|
const errors = [];
|
|
422
|
-
for (const source of sources.values())
|
|
404
|
+
for (const source of [...sources.values(), ...inputs])
|
|
423
405
|
try {
|
|
424
406
|
await source.close();
|
|
425
407
|
}
|
|
@@ -432,8 +414,42 @@ export async function writeBiffProperties(book, context, staged = false) {
|
|
|
432
414
|
throw new AggregateError(errors, "BIFF property sources cleanup failed");
|
|
433
415
|
};
|
|
434
416
|
try {
|
|
417
|
+
if (!staged || snapshots)
|
|
418
|
+
for (const [name, value] of planned) {
|
|
419
|
+
if (staged) {
|
|
420
|
+
const source = await stagePropertyBytes(value, context);
|
|
421
|
+
inputs.push(source);
|
|
422
|
+
streams.set(name, source);
|
|
423
|
+
}
|
|
424
|
+
else {
|
|
425
|
+
const bytes = new Uint8Array(value.length);
|
|
426
|
+
let at = 0;
|
|
427
|
+
for (const part of propertyChunks(value)) {
|
|
428
|
+
bytes.set(part, at);
|
|
429
|
+
at += part.length;
|
|
430
|
+
}
|
|
431
|
+
streams.set(name, bytes);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
const preserved = await mergeBiffProperties(book, streams, handledMetadata, context, charge, allocate, staged ? { sources, reserve } : undefined);
|
|
435
|
+
for (const key of unsupportedKeys)
|
|
436
|
+
if (!preserved.has(key))
|
|
437
|
+
await context.diagnostic?.({ code: "biff-loss-warning", severity: "warning", message: `Unsupported Excel BIFF document property: ${key}` });
|
|
438
|
+
if (!staged)
|
|
439
|
+
return { streams, handledMetadata, async close() { } };
|
|
435
440
|
for (const [name, value] of snapshots ? streams : planned)
|
|
436
|
-
sources.
|
|
441
|
+
if (!sources.has(name)) {
|
|
442
|
+
const bytes = 'size' in value ? { length: value.size, async *chunks() {
|
|
443
|
+
for (let at = 0; at < value.size;) {
|
|
444
|
+
const part = await value.read(at, Math.min(16384, value.size - at));
|
|
445
|
+
at += part.length;
|
|
446
|
+
yield part;
|
|
447
|
+
}
|
|
448
|
+
} } : value;
|
|
449
|
+
sources.set(name, await stagePropertyBytes(bytes, context));
|
|
450
|
+
}
|
|
451
|
+
for (const input of inputs)
|
|
452
|
+
await input.close();
|
|
437
453
|
return { streams: sources, handledMetadata, close };
|
|
438
454
|
}
|
|
439
455
|
catch (error) {
|
|
@@ -446,8 +462,9 @@ export async function writeBiffProperties(book, context, staged = false) {
|
|
|
446
462
|
throw error;
|
|
447
463
|
}
|
|
448
464
|
finally {
|
|
449
|
-
if (snapshots)
|
|
465
|
+
if (staged && snapshots)
|
|
450
466
|
for (const bytes of streams.values())
|
|
451
|
-
bytes
|
|
467
|
+
if (bytes instanceof Uint8Array)
|
|
468
|
+
bytes.fill(0);
|
|
452
469
|
}
|
|
453
470
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { SsconvertError } from "../spreadsheet-engine/contracts.js";
|
|
2
2
|
import { invalidBiff } from "./biff-binary.js";
|
|
3
3
|
import { propertyRange, readPropertySectionRanges, readPropertyValueRanges } from "./biff-property-range.js";
|
|
4
|
-
import {
|
|
5
|
-
import { biffDecode } from "./biff-strings.js";
|
|
4
|
+
import { readBiffPropertyText } from "./biff-property-text.js";
|
|
6
5
|
// OLE property-set layout and IDs: LibreOffice oleprops.cxx/.hxx at
|
|
7
6
|
// bce0998afefdbc355585ca324285661a2170ba77; source receipts are in the gap ledger.
|
|
8
7
|
export const biffPropertyFormats = { summary: "e0859ff2f94f6810ab9108002b27b3d9",
|
|
@@ -29,70 +28,6 @@ export async function readBiffProperties(streams, context, accountText, accountW
|
|
|
29
28
|
if (nodes > (context.limits.workbookNodes ?? context.limits.inputBytes))
|
|
30
29
|
throw new SsconvertError("resource-limit", "ssconvert BIFF property node limit exceeded");
|
|
31
30
|
};
|
|
32
|
-
const text = async (data, offset, codepage) => {
|
|
33
|
-
const count = await data.u32(offset), width = codepage === 1200 ? 2 : 1, size = count * width;
|
|
34
|
-
if (!count)
|
|
35
|
-
invalidBiff("empty property string buffer");
|
|
36
|
-
data.check(offset + 4, size);
|
|
37
|
-
// Admit the maximum UTF-8 expansion before allocating a decoded string.
|
|
38
|
-
if ((count - 1) * 3 > (context.limits.workbookTextBytes ?? context.limits.inputBytes))
|
|
39
|
-
throw new SsconvertError("resource-limit", "ssconvert BIFF property text limit exceeded");
|
|
40
|
-
accountWork(size);
|
|
41
|
-
const end = offset + 4 + size;
|
|
42
|
-
if ((await data.read(end - width, width)).some(Boolean))
|
|
43
|
-
invalidBiff("unterminated property string");
|
|
44
|
-
let value = "";
|
|
45
|
-
const unicode = codepage === 1200 || codepage === 65001;
|
|
46
|
-
const decoder = unicode ? new TextDecoder(codepage === 1200 ? "utf-16le" : "utf-8", { fatal: true, ignoreBOM: true }) : undefined;
|
|
47
|
-
const multibyte = biffDbcsTables[codepage];
|
|
48
|
-
let lead;
|
|
49
|
-
if (!unicode && !multibyte)
|
|
50
|
-
biffDecode(new Uint8Array(), codepage);
|
|
51
|
-
for (let at = offset + 4; at < end - width;) {
|
|
52
|
-
const bytes = await data.read(at, Math.min(16384, end - width - at));
|
|
53
|
-
at += bytes.length;
|
|
54
|
-
if (decoder) {
|
|
55
|
-
try {
|
|
56
|
-
value += decoder.decode(bytes, { stream: true });
|
|
57
|
-
}
|
|
58
|
-
catch {
|
|
59
|
-
invalidBiff("invalid property string encoding");
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
else if (multibyte) {
|
|
63
|
-
const characters = [];
|
|
64
|
-
for (const byte of bytes) {
|
|
65
|
-
if (lead !== undefined) {
|
|
66
|
-
const character = multibyte.double[lead]?.[byte];
|
|
67
|
-
if (character === undefined || character === "\uffff")
|
|
68
|
-
invalidBiff("invalid or truncated DBCS character");
|
|
69
|
-
characters.push(character);
|
|
70
|
-
lead = undefined;
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
const character = multibyte.single[byte];
|
|
74
|
-
if (character === "\uffff")
|
|
75
|
-
lead = byte;
|
|
76
|
-
else
|
|
77
|
-
characters.push(character);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
value += characters.join("");
|
|
81
|
-
}
|
|
82
|
-
else
|
|
83
|
-
value += biffDecode(bytes, codepage);
|
|
84
|
-
}
|
|
85
|
-
if (lead !== undefined)
|
|
86
|
-
invalidBiff("invalid or truncated DBCS character");
|
|
87
|
-
if (decoder)
|
|
88
|
-
try {
|
|
89
|
-
value += decoder.decode();
|
|
90
|
-
}
|
|
91
|
-
catch {
|
|
92
|
-
invalidBiff("invalid property string encoding");
|
|
93
|
-
}
|
|
94
|
-
return { value: accountText(value), end: width === 2 ? Math.ceil(end / 4) * 4 : end };
|
|
95
|
-
};
|
|
96
31
|
for (const target of ["\u0005SummaryInformation", "\u0005DocumentSummaryInformation"]) {
|
|
97
32
|
let streamName = target, bytes = streams.get(target);
|
|
98
33
|
if (!bytes)
|
|
@@ -132,7 +67,7 @@ export async function readBiffProperties(streams, context, accountText, accountW
|
|
|
132
67
|
admit(length);
|
|
133
68
|
let at = 4;
|
|
134
69
|
for (let i = 0; i < length; i++) {
|
|
135
|
-
const id = await dictionary.u32(at), entry = await
|
|
70
|
+
const id = await dictionary.u32(at), entry = await readBiffPropertyText(dictionary, at + 4, codepage, context, accountText, accountWork);
|
|
136
71
|
if (id < 2 || names.has(id) || !entry.value)
|
|
137
72
|
invalidBiff("invalid property dictionary entry");
|
|
138
73
|
names.set(id, entry.value);
|
|
@@ -159,7 +94,7 @@ export async function readBiffProperties(streams, context, accountText, accountW
|
|
|
159
94
|
const type = await data.u32(0);
|
|
160
95
|
try {
|
|
161
96
|
if (type === 30 || type === 31)
|
|
162
|
-
value = (await
|
|
97
|
+
value = (await readBiffPropertyText(data, 4, type === 31 ? 1200 : codepage, context, accountText, accountWork)).value;
|
|
163
98
|
else if (type === 3)
|
|
164
99
|
value = (await data.u32(4)) | 0;
|
|
165
100
|
else if (type === 5) {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { WorkingStorage } from "../spreadsheet-engine/contracts.js";
|
|
2
|
+
export interface BiffPropertyDescriptor {
|
|
3
|
+
offset: number;
|
|
4
|
+
size: number;
|
|
5
|
+
block: number;
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
8
|
+
/** Two bounded radix caches index UTF-16 name edges and stable range order.
|
|
9
|
+
* Linked fixed-size records replay original descriptor order without an array. */
|
|
10
|
+
export declare class BiffPropertyDescriptorIndex {
|
|
11
|
+
private readonly storage;
|
|
12
|
+
private readonly check;
|
|
13
|
+
private readonly names;
|
|
14
|
+
private readonly ranges;
|
|
15
|
+
private node;
|
|
16
|
+
private count;
|
|
17
|
+
private first;
|
|
18
|
+
private last;
|
|
19
|
+
constructor(storage: WorkingStorage, check: () => void);
|
|
20
|
+
add(entry: BiffPropertyDescriptor): Promise<void>;
|
|
21
|
+
validate(): Promise<void>;
|
|
22
|
+
entries(): AsyncIterable<BiffPropertyDescriptor>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { IntegerTable } from "@poe-platform/safe-fs/storage";
|
|
2
|
+
import { Binary, invalidBiff } from './biff-binary.js';
|
|
3
|
+
/** Two bounded radix caches index UTF-16 name edges and stable range order.
|
|
4
|
+
* Linked fixed-size records replay original descriptor order without an array. */
|
|
5
|
+
export class BiffPropertyDescriptorIndex {
|
|
6
|
+
storage;
|
|
7
|
+
check;
|
|
8
|
+
names;
|
|
9
|
+
ranges;
|
|
10
|
+
node = 2n;
|
|
11
|
+
count = 0;
|
|
12
|
+
first = 0;
|
|
13
|
+
last = 0;
|
|
14
|
+
constructor(storage, check) {
|
|
15
|
+
this.storage = storage;
|
|
16
|
+
this.check = check;
|
|
17
|
+
storage.allocate(8);
|
|
18
|
+
this.check();
|
|
19
|
+
this.names = new IntegerTable(storage, 64);
|
|
20
|
+
this.ranges = new IntegerTable(storage, 64);
|
|
21
|
+
}
|
|
22
|
+
async add(entry) {
|
|
23
|
+
this.check();
|
|
24
|
+
let node = 1n;
|
|
25
|
+
const name = entry.name.toUpperCase();
|
|
26
|
+
for (let i = 0; i < name.length; i++) {
|
|
27
|
+
const key = node << 16n | BigInt(name.charCodeAt(i));
|
|
28
|
+
let next = await this.names.get(key);
|
|
29
|
+
this.check();
|
|
30
|
+
if (next === undefined) {
|
|
31
|
+
next = this.node++;
|
|
32
|
+
await this.names.set(key, next);
|
|
33
|
+
this.check();
|
|
34
|
+
}
|
|
35
|
+
node = next;
|
|
36
|
+
}
|
|
37
|
+
const terminal = node << 16n;
|
|
38
|
+
if (await this.names.get(terminal) !== undefined)
|
|
39
|
+
invalidBiff('duplicate or invalid encrypted property stream name');
|
|
40
|
+
this.check();
|
|
41
|
+
await this.names.set(terminal, 1n);
|
|
42
|
+
this.check();
|
|
43
|
+
await this.ranges.set(BigInt(entry.offset) << 32n | BigInt(this.count++), BigInt(entry.offset + entry.size));
|
|
44
|
+
this.check();
|
|
45
|
+
const bytes = new Uint8Array(88), view = new DataView(bytes.buffer);
|
|
46
|
+
view.setUint32(8, entry.offset, true);
|
|
47
|
+
view.setUint32(12, entry.size, true);
|
|
48
|
+
view.setUint16(16, entry.block, true);
|
|
49
|
+
view.setUint16(18, entry.name.length, true);
|
|
50
|
+
for (let i = 0; i < entry.name.length; i++)
|
|
51
|
+
view.setUint16(20 + i * 2, entry.name.charCodeAt(i), true);
|
|
52
|
+
const position = this.storage.allocate(bytes.length);
|
|
53
|
+
this.check();
|
|
54
|
+
try {
|
|
55
|
+
await this.storage.write(position, bytes);
|
|
56
|
+
this.check();
|
|
57
|
+
if (this.last) {
|
|
58
|
+
view.setFloat64(0, position, true);
|
|
59
|
+
await this.storage.write(this.last, bytes.subarray(0, 8));
|
|
60
|
+
this.check();
|
|
61
|
+
}
|
|
62
|
+
else
|
|
63
|
+
this.first = position;
|
|
64
|
+
this.last = position;
|
|
65
|
+
}
|
|
66
|
+
finally {
|
|
67
|
+
bytes.fill(0);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
async validate() {
|
|
71
|
+
let end = 0n;
|
|
72
|
+
for await (const [key, next] of this.ranges.entries()) {
|
|
73
|
+
this.check();
|
|
74
|
+
if (key >> 32n < end)
|
|
75
|
+
invalidBiff('overlapping encrypted property payloads');
|
|
76
|
+
end = next;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
async *entries() {
|
|
80
|
+
let position = this.first;
|
|
81
|
+
while (position) {
|
|
82
|
+
this.check();
|
|
83
|
+
const bytes = new Binary(await this.storage.read(position, 88));
|
|
84
|
+
this.check();
|
|
85
|
+
bytes.check(0, 88);
|
|
86
|
+
position = bytes.f64(0);
|
|
87
|
+
let name = '';
|
|
88
|
+
for (let i = 0; i < bytes.u16(18); i++)
|
|
89
|
+
name += String.fromCharCode(bytes.u16(20 + i * 2));
|
|
90
|
+
yield { offset: bytes.u32(8), size: bytes.u32(12), block: bytes.u16(16), name };
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type CapabilityContext } from "../spreadsheet-engine/contracts.js";
|
|
2
|
+
import type { BiffPropertyBytes } from './biff-property-bytes.js';
|
|
3
|
+
/** Validate representability before exposing bounded encoded windows. */
|
|
4
|
+
export declare function createBiffPropertyNameEncoder(context: CapabilityContext, charge: (amount: number) => void, accountText: (text: string) => string): (name: string, codepage: number) => BiffPropertyBytes | undefined;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { SsconvertError } from "../spreadsheet-engine/contracts.js";
|
|
2
|
+
import { singleByteTables } from "../spreadsheet-engine/encoding/tables.js";
|
|
3
|
+
import { biffDbcsTables } from "../spreadsheet-engine/encoding/biff-dbcs-tables.js";
|
|
4
|
+
import { biffDecode } from './biff-strings.js';
|
|
5
|
+
/** Validate representability before exposing bounded encoded windows. */
|
|
6
|
+
export function createBiffPropertyNameEncoder(context, charge, accountText) {
|
|
7
|
+
// Reverse the same tables as the importer; no transliteration or escape fallback.
|
|
8
|
+
const encodings = new Map();
|
|
9
|
+
return (name, cp) => {
|
|
10
|
+
accountText(name);
|
|
11
|
+
if (cp === 65001) {
|
|
12
|
+
let length = 1;
|
|
13
|
+
for (const point of name) {
|
|
14
|
+
const code = point.codePointAt(0);
|
|
15
|
+
length += code < 128 ? 1 : code < 2048 ? 2 : code < 65536 ? 3 : 4;
|
|
16
|
+
}
|
|
17
|
+
return { length, *chunks() {
|
|
18
|
+
const encoder = new TextEncoder(), buffer = new Uint8Array(16384);
|
|
19
|
+
try {
|
|
20
|
+
for (let at = 0; at < name.length;) {
|
|
21
|
+
context.signal.throwIfAborted();
|
|
22
|
+
let end = Math.min(name.length, at + 4096);
|
|
23
|
+
if (end < name.length && name.charCodeAt(end - 1) >= 0xd800 && name.charCodeAt(end - 1) <= 0xdbff)
|
|
24
|
+
end--;
|
|
25
|
+
const result = encoder.encodeInto(name.slice(at, end), buffer);
|
|
26
|
+
at = end;
|
|
27
|
+
yield buffer.subarray(0, result.written);
|
|
28
|
+
}
|
|
29
|
+
yield new Uint8Array(1);
|
|
30
|
+
}
|
|
31
|
+
finally {
|
|
32
|
+
buffer.fill(0);
|
|
33
|
+
}
|
|
34
|
+
} };
|
|
35
|
+
}
|
|
36
|
+
if (cp === 1200) {
|
|
37
|
+
const length = (name.length + 1) * 2;
|
|
38
|
+
charge(length);
|
|
39
|
+
if (length > 0xffffffff || length > context.limits.outputBytes)
|
|
40
|
+
throw new SsconvertError("resource-limit", "ssconvert BIFF property output bytes limit exceeded");
|
|
41
|
+
return { length, *chunks() {
|
|
42
|
+
const buffer = new Uint8Array(16384), view = new DataView(buffer.buffer);
|
|
43
|
+
try {
|
|
44
|
+
for (let at = 0; at < name.length; at += 8192) {
|
|
45
|
+
context.signal.throwIfAborted();
|
|
46
|
+
const size = Math.min(8192, name.length - at);
|
|
47
|
+
for (let i = 0; i < size; i++)
|
|
48
|
+
view.setUint16(i * 2, name.charCodeAt(at + i), true);
|
|
49
|
+
yield buffer.subarray(0, size * 2);
|
|
50
|
+
}
|
|
51
|
+
yield new Uint8Array(2);
|
|
52
|
+
}
|
|
53
|
+
finally {
|
|
54
|
+
buffer.fill(0);
|
|
55
|
+
}
|
|
56
|
+
} };
|
|
57
|
+
}
|
|
58
|
+
let reverse = encodings.get(cp);
|
|
59
|
+
if (!reverse) {
|
|
60
|
+
reverse = new Map();
|
|
61
|
+
encodings.set(cp, reverse);
|
|
62
|
+
const dbcs = biffDbcsTables[cp], table = dbcs?.single ?? singleByteTables[cp === 1201 ? "iso-8859-1" : cp === 10000 ? "macintosh" : cp >= 1250 && cp <= 1258 ? `windows-${cp}` : `cp${cp}`];
|
|
63
|
+
if (!table)
|
|
64
|
+
return undefined;
|
|
65
|
+
for (let i = 0; i < table.length; i++) {
|
|
66
|
+
charge(1);
|
|
67
|
+
if (table[i] !== "\uffff" && !reverse.has(table[i]))
|
|
68
|
+
reverse.set(table[i], [i]);
|
|
69
|
+
}
|
|
70
|
+
if (dbcs)
|
|
71
|
+
for (const [lead, row] of Object.entries(dbcs.double))
|
|
72
|
+
for (let trail = 0; trail < row.length; trail++) {
|
|
73
|
+
charge(1);
|
|
74
|
+
if (row[trail] !== "\uffff" && !reverse.has(row[trail]))
|
|
75
|
+
reverse.set(row[trail], [Number(lead), trail]);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const characters = function* () { yield* name; yield "\0"; };
|
|
79
|
+
let length = 0;
|
|
80
|
+
for (const character of characters()) {
|
|
81
|
+
charge(1);
|
|
82
|
+
const value = reverse.get(character);
|
|
83
|
+
if (!value)
|
|
84
|
+
return undefined;
|
|
85
|
+
if (biffDecode(Uint8Array.from(value), cp) !== character)
|
|
86
|
+
return undefined;
|
|
87
|
+
length += value.length;
|
|
88
|
+
if (length > context.limits.outputBytes)
|
|
89
|
+
throw new SsconvertError("resource-limit", "ssconvert BIFF property output bytes limit exceeded");
|
|
90
|
+
}
|
|
91
|
+
const table = reverse;
|
|
92
|
+
return { length, *chunks() {
|
|
93
|
+
const buffer = new Uint8Array(16384);
|
|
94
|
+
let at = 0;
|
|
95
|
+
try {
|
|
96
|
+
for (const character of characters()) {
|
|
97
|
+
const value = table.get(character);
|
|
98
|
+
if (at + value.length > buffer.length) {
|
|
99
|
+
context.signal.throwIfAborted();
|
|
100
|
+
yield buffer.subarray(0, at);
|
|
101
|
+
at = 0;
|
|
102
|
+
}
|
|
103
|
+
buffer.set(value, at);
|
|
104
|
+
at += value.length;
|
|
105
|
+
}
|
|
106
|
+
if (at)
|
|
107
|
+
yield buffer.subarray(0, at);
|
|
108
|
+
}
|
|
109
|
+
finally {
|
|
110
|
+
buffer.fill(0);
|
|
111
|
+
}
|
|
112
|
+
} };
|
|
113
|
+
};
|
|
114
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type CapabilityContext } from "../spreadsheet-engine/contracts.js";
|
|
2
|
+
import type { BiffPropertyRange } from './biff-property-range.js';
|
|
3
|
+
export declare function readBiffPropertyText(data: BiffPropertyRange, offset: number, codepage: number, context: CapabilityContext, accountText: (text: string) => string, accountWork: (amount: number) => void): Promise<{
|
|
4
|
+
value: string;
|
|
5
|
+
end: number;
|
|
6
|
+
}>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { SsconvertError } from "../spreadsheet-engine/contracts.js";
|
|
2
|
+
import { invalidBiff } from './biff-binary.js';
|
|
3
|
+
import { biffDbcsTables } from "../spreadsheet-engine/encoding/biff-dbcs-tables.js";
|
|
4
|
+
import { biffDecode } from './biff-strings.js';
|
|
5
|
+
export async function readBiffPropertyText(data, offset, codepage, context, accountText, accountWork) {
|
|
6
|
+
const count = await data.u32(offset), width = codepage === 1200 ? 2 : 1, size = count * width;
|
|
7
|
+
if (!count)
|
|
8
|
+
invalidBiff("empty property string buffer");
|
|
9
|
+
data.check(offset + 4, size);
|
|
10
|
+
// Admit the maximum UTF-8 expansion before allocating a decoded string.
|
|
11
|
+
if ((count - 1) * 3 > (context.limits.workbookTextBytes ?? context.limits.inputBytes))
|
|
12
|
+
throw new SsconvertError("resource-limit", "ssconvert BIFF property text limit exceeded");
|
|
13
|
+
accountWork(size);
|
|
14
|
+
const end = offset + 4 + size;
|
|
15
|
+
if ((await data.read(end - width, width)).some(Boolean))
|
|
16
|
+
invalidBiff("unterminated property string");
|
|
17
|
+
let value = "";
|
|
18
|
+
const unicode = codepage === 1200 || codepage === 65001;
|
|
19
|
+
const decoder = unicode ? new TextDecoder(codepage === 1200 ? "utf-16le" : "utf-8", { fatal: true, ignoreBOM: true }) : undefined;
|
|
20
|
+
const multibyte = biffDbcsTables[codepage];
|
|
21
|
+
let lead;
|
|
22
|
+
if (!unicode && !multibyte)
|
|
23
|
+
biffDecode(new Uint8Array(), codepage);
|
|
24
|
+
for (let at = offset + 4; at < end - width;) {
|
|
25
|
+
const bytes = await data.read(at, Math.min(16384, end - width - at));
|
|
26
|
+
at += bytes.length;
|
|
27
|
+
if (decoder) {
|
|
28
|
+
try {
|
|
29
|
+
value += decoder.decode(bytes, { stream: true });
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
invalidBiff("invalid property string encoding");
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
else if (multibyte) {
|
|
36
|
+
const characters = [];
|
|
37
|
+
for (const byte of bytes) {
|
|
38
|
+
if (lead !== undefined) {
|
|
39
|
+
const character = multibyte.double[lead]?.[byte];
|
|
40
|
+
if (character === undefined || character === "\uffff")
|
|
41
|
+
invalidBiff("invalid or truncated DBCS character");
|
|
42
|
+
characters.push(character);
|
|
43
|
+
lead = undefined;
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
const character = multibyte.single[byte];
|
|
47
|
+
if (character === "\uffff")
|
|
48
|
+
lead = byte;
|
|
49
|
+
else
|
|
50
|
+
characters.push(character);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
value += characters.join("");
|
|
54
|
+
}
|
|
55
|
+
else
|
|
56
|
+
value += biffDecode(bytes, codepage);
|
|
57
|
+
}
|
|
58
|
+
if (lead !== undefined)
|
|
59
|
+
invalidBiff("invalid or truncated DBCS character");
|
|
60
|
+
if (decoder)
|
|
61
|
+
try {
|
|
62
|
+
value += decoder.decode();
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
invalidBiff("invalid property string encoding");
|
|
66
|
+
}
|
|
67
|
+
return { value: accountText(value), end: width === 2 ? Math.ceil(end / 4) * 4 : end };
|
|
68
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CapabilityContext } from "../spreadsheet-engine/contracts.js";
|
|
2
|
+
import type { BiffPropertyRange } from './biff-property-range.js';
|
|
3
|
+
import type { BiffPropertySource } from './biff-encrypted-properties-write.js';
|
|
4
|
+
/** Count UTF-16 units before staging; both passes retain only a bounded decoder window. */
|
|
5
|
+
export declare function stageWideBiffProperty(source: BiffPropertyRange, context: CapabilityContext, charge: (amount: number) => void, reserve: (length: number) => number): Promise<BiffPropertySource>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { stagePropertyBytes } from './biff-property-bytes.js';
|
|
2
|
+
/** Count UTF-16 units before staging; both passes retain only a bounded decoder window. */
|
|
3
|
+
export async function stageWideBiffProperty(source, context, charge, reserve) {
|
|
4
|
+
reserve(source.size);
|
|
5
|
+
const text = source.slice(8, await source.u32(4) - 1);
|
|
6
|
+
const parts = async function* () {
|
|
7
|
+
const decoder = new TextDecoder('utf-8', { fatal: true, ignoreBOM: true });
|
|
8
|
+
for (let at = 0; at < text.size;) {
|
|
9
|
+
const bytes = await text.read(at, Math.min(8192, text.size - at));
|
|
10
|
+
at += bytes.length;
|
|
11
|
+
try {
|
|
12
|
+
yield decoder.decode(bytes, { stream: true });
|
|
13
|
+
}
|
|
14
|
+
finally {
|
|
15
|
+
bytes.fill(0);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
yield decoder.decode();
|
|
19
|
+
};
|
|
20
|
+
let units = 0;
|
|
21
|
+
for await (const part of parts())
|
|
22
|
+
units += part.length;
|
|
23
|
+
charge(units);
|
|
24
|
+
const length = reserve(8 + (units + 1) * 2);
|
|
25
|
+
return stagePropertyBytes({ length, async *chunks() {
|
|
26
|
+
const header = new Uint8Array(8), view = new DataView(header.buffer);
|
|
27
|
+
view.setUint32(0, 31, true);
|
|
28
|
+
view.setUint32(4, units + 1, true);
|
|
29
|
+
yield header;
|
|
30
|
+
const buffer = new Uint8Array(16384), output = new DataView(buffer.buffer);
|
|
31
|
+
try {
|
|
32
|
+
for await (const part of parts())
|
|
33
|
+
for (let at = 0; at < part.length; at += 8192) {
|
|
34
|
+
const size = Math.min(8192, part.length - at);
|
|
35
|
+
for (let i = 0; i < size; i++)
|
|
36
|
+
output.setUint16(i * 2, part.charCodeAt(at + i), true);
|
|
37
|
+
yield buffer.subarray(0, size * 2);
|
|
38
|
+
}
|
|
39
|
+
yield new Uint8Array(2);
|
|
40
|
+
}
|
|
41
|
+
finally {
|
|
42
|
+
buffer.fill(0);
|
|
43
|
+
}
|
|
44
|
+
} }, context);
|
|
45
|
+
}
|
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.813",
|
|
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.813",
|
|
1411
1411
|
"pdf-lib": "1.17.1",
|
|
1412
1412
|
"@types/node": "^25.2.2",
|
|
1413
1413
|
"@formatjs/intl-numberformat": "9.4.0",
|
|
@@ -2834,12 +2834,15 @@
|
|
|
2834
2834
|
"./dist/spreadsheet-format-xls/biff-label-ranges.js",
|
|
2835
2835
|
"./dist/spreadsheet-format-xls/biff-metadata.js",
|
|
2836
2836
|
"./dist/spreadsheet-format-xls/biff-name-bindings.js",
|
|
2837
|
-
"./dist/spreadsheet-format-xls/biff-properties-layout.js",
|
|
2838
2837
|
"./dist/spreadsheet-format-xls/biff-properties-merge.js",
|
|
2839
2838
|
"./dist/spreadsheet-format-xls/biff-properties-write.js",
|
|
2840
2839
|
"./dist/spreadsheet-format-xls/biff-properties.js",
|
|
2841
2840
|
"./dist/spreadsheet-format-xls/biff-property-bytes.js",
|
|
2841
|
+
"./dist/spreadsheet-format-xls/biff-property-index.js",
|
|
2842
|
+
"./dist/spreadsheet-format-xls/biff-property-name.js",
|
|
2842
2843
|
"./dist/spreadsheet-format-xls/biff-property-range.js",
|
|
2844
|
+
"./dist/spreadsheet-format-xls/biff-property-text.js",
|
|
2845
|
+
"./dist/spreadsheet-format-xls/biff-property-transcode.js",
|
|
2843
2846
|
"./dist/spreadsheet-format-xls/biff-range.js",
|
|
2844
2847
|
"./dist/spreadsheet-format-xls/biff-record-storage.js",
|
|
2845
2848
|
"./dist/spreadsheet-format-xls/biff-shared-strings.js",
|