@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
package/dist/safe-bash/command-chunks/{command-engine-BCUQGJJ4.js → command-engine-X3OLN7N6.js}
RENAMED
|
@@ -5,6 +5,57 @@ import {
|
|
|
5
5
|
} from "./chunk-E6SK3OU2.js";
|
|
6
6
|
import "./chunk-65DS4IOB.js";
|
|
7
7
|
|
|
8
|
+
// packages/safe-bash-command-pptx/src/command-extract-streaming.ts
|
|
9
|
+
import { openRetainedPackageExtraction, stageRetainedExtractionOutput } from "../../safe-bash-presentation-engine/package-tools.js";
|
|
10
|
+
import { OfficeError } from "../../safe-bash-presentation-engine/errors.js";
|
|
11
|
+
async function prepareRetainedExtraction(args, request, options2) {
|
|
12
|
+
const { streaming, signal } = request, context = { ...options2.context, signal, workingStorage: streaming.workingStorage };
|
|
13
|
+
const input = await streaming.openInput(args.input, Math.min(context.limits.maxBytes, context.archiveLimits.maxArchiveBytes));
|
|
14
|
+
const extraction = await openRetainedPackageExtraction(input, context, args.parts ? { parts: args.parts } : {});
|
|
15
|
+
let response, closing;
|
|
16
|
+
const close = () => closing ??= (async () => {
|
|
17
|
+
const results = await Promise.allSettled([response?.close(), extraction.close()]);
|
|
18
|
+
for (const result of results) if (result.status === "rejected") throw result.reason;
|
|
19
|
+
})();
|
|
20
|
+
try {
|
|
21
|
+
let total = 0;
|
|
22
|
+
for await (const member of extraction.members()) total += member.size;
|
|
23
|
+
if (extraction.count > (args.limits?.maxOutputs ?? context.archiveLimits.maxMembers) || !Number.isSafeInteger(total) || total > options2.maxOutputBytes)
|
|
24
|
+
throw new OfficeError("resource-limit", "Package extraction exceeds output limits.", "validate-intent");
|
|
25
|
+
if (!request.publishOutputStreams && (!args.allowPartialOutput || !request.publishOutput)) throw Object.assign(new Error("Extraction requires a publication capability."), { code: "publication-unsupported" });
|
|
26
|
+
response = await stageRetainedExtractionOutput(extraction, context, { directory: args.outputDir, json: args.json, maxOutputBytes: options2.maxOutputBytes, allowPartialOutput: args.allowPartialOutput ?? false });
|
|
27
|
+
async function* publications(dryRun) {
|
|
28
|
+
for await (const member of extraction.members()) {
|
|
29
|
+
signal.throwIfAborted();
|
|
30
|
+
yield { inputPath: args.input, outputPath: response.path(member.name), bytes: member.bytes(), originalBytes: input, inPlace: false, force: args.force ?? false, dryRun };
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return { close, async publish() {
|
|
34
|
+
let published = 0, code;
|
|
35
|
+
try {
|
|
36
|
+
for await (const item of publications(true)) {
|
|
37
|
+
if (request.preflightOutputStream) await request.preflightOutputStream(item);
|
|
38
|
+
else if (request.publishOutput) await request.publishOutput(item);
|
|
39
|
+
}
|
|
40
|
+
if (request.publishOutputStreams) await request.publishOutputStreams(publications(false));
|
|
41
|
+
else for await (const item of publications(false)) {
|
|
42
|
+
await request.publishOutput(item);
|
|
43
|
+
published++;
|
|
44
|
+
}
|
|
45
|
+
} catch (error) {
|
|
46
|
+
const raw = error && typeof error === "object" && "code" in error ? error.code : void 0;
|
|
47
|
+
code = signal.aborted ? "cancelled" : typeof raw === "string" && ["resource-limit", "stale-input", "publication-unsupported"].includes(raw) ? raw : "io-failure";
|
|
48
|
+
}
|
|
49
|
+
await response.write(!code || args.json ? streaming.stdout : streaming.stderr, code ? { code, published } : void 0);
|
|
50
|
+
return { exitCode: !code ? 0 : code === "cancelled" ? 130 : code === "resource-limit" ? 4 : code === "stale-input" ? 1 : 3, stdout: new Uint8Array(), stderr: new Uint8Array() };
|
|
51
|
+
} };
|
|
52
|
+
} catch (error) {
|
|
53
|
+
await close().catch(() => {
|
|
54
|
+
});
|
|
55
|
+
throw error;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
8
59
|
// packages/safe-bash-command-pptx/src/command-engine.ts
|
|
9
60
|
import { stageRetainedText } from "../../safe-bash-presentation-engine/retained-text.js";
|
|
10
61
|
import { stageRetainedInspection } from "../../safe-bash-presentation-engine/retained-inspection.js";
|
|
@@ -12,7 +63,7 @@ import { openPackageArchive } from "../../safe-bash-presentation-engine/retained
|
|
|
12
63
|
|
|
13
64
|
// packages/safe-bash-command-pptx/src/capabilities-discovery.ts
|
|
14
65
|
import { parseContentTypes } from "../../safe-bash-presentation-engine/content-types.js";
|
|
15
|
-
import { OfficeError } from "../../safe-bash-presentation-engine/errors.js";
|
|
66
|
+
import { OfficeError as OfficeError2 } from "../../safe-bash-presentation-engine/errors.js";
|
|
16
67
|
import { readRelationshipGraph } from "../../safe-bash-presentation-engine/relationships.js";
|
|
17
68
|
import { readPackage } from "../../safe-bash-presentation-engine/package-reader.js";
|
|
18
69
|
import { parseXmlPart } from "../../safe-bash-presentation-engine/xml.js";
|
|
@@ -49,7 +100,7 @@ function declaredFeatureCapabilities(features, operations) {
|
|
|
49
100
|
Object.entries(features).map(([name, feature]) => {
|
|
50
101
|
const paths = feature.operations ?? (feature.operation ? [feature.operation] : featureOperations[name]);
|
|
51
102
|
if (!paths?.length || paths.some((path) => !Object.hasOwn(operations, path))) {
|
|
52
|
-
throw new
|
|
103
|
+
throw new OfficeError2(
|
|
53
104
|
"invalid-value",
|
|
54
105
|
"Capability references an undeclared operation.",
|
|
55
106
|
"usage"
|
|
@@ -99,7 +150,7 @@ async function assessCapabilities(input, context) {
|
|
|
99
150
|
try {
|
|
100
151
|
contentType = types.get(part);
|
|
101
152
|
} catch (error) {
|
|
102
|
-
if (!(error instanceof
|
|
153
|
+
if (!(error instanceof OfficeError2) || error.code !== "missing-binding") throw error;
|
|
103
154
|
}
|
|
104
155
|
}
|
|
105
156
|
const type = contentType?.split(";", 1)[0].trim().toLowerCase();
|
|
@@ -114,7 +165,7 @@ async function assessCapabilities(input, context) {
|
|
|
114
165
|
const data = reader.get(part);
|
|
115
166
|
xmlBytes += data.length;
|
|
116
167
|
if (xmlBytes > context.xmlLimits.maxBytes || nodes >= context.xmlLimits.maxNodes)
|
|
117
|
-
throw new
|
|
168
|
+
throw new OfficeError2(
|
|
118
169
|
"resource-limit",
|
|
119
170
|
"Capability XML inspection limit exceeded.",
|
|
120
171
|
"index"
|
|
@@ -125,7 +176,7 @@ async function assessCapabilities(input, context) {
|
|
|
125
176
|
});
|
|
126
177
|
nodes += xml.nodeCount;
|
|
127
178
|
if (nodes > context.xmlLimits.maxNodes)
|
|
128
|
-
throw new
|
|
179
|
+
throw new OfficeError2("resource-limit", "Capability XML node limit exceeded.", "index");
|
|
129
180
|
const pending = [xml.root];
|
|
130
181
|
let visited = 0;
|
|
131
182
|
while (pending.length) {
|
|
@@ -3464,7 +3515,7 @@ var discoverySchemas = Object.fromEntries([
|
|
|
3464
3515
|
}]));
|
|
3465
3516
|
|
|
3466
3517
|
// packages/safe-bash-command-pptx/src/command-objects-add.ts
|
|
3467
|
-
import { OfficeError as
|
|
3518
|
+
import { OfficeError as OfficeError3 } from "../../safe-bash-presentation-engine/errors.js";
|
|
3468
3519
|
import { addOleObject } from "../../safe-bash-presentation-engine/ole-insertion.js";
|
|
3469
3520
|
var objectsAddUsage = "Usage: pptx objects add INPUT --slide N --file PATH --icon PATH (--program-id TEXT | --program DOCX|PPTX|XLSX) [--icon-content-type TYPE]\n --left LENGTH --top LENGTH --width LENGTH --height LENGTH --icon-width LENGTH --icon-height LENGTH --name TEXT\n --output PATH|--in-place|--dry-run [--force] [--json] [--limit NAME=VALUE]\nEmbed explicit inert bytes with an explicit icon. No activation or recursive payload parsing.\n";
|
|
3470
3521
|
var length = {
|
|
@@ -3572,7 +3623,7 @@ var objectsAddSchema = {
|
|
|
3572
3623
|
}
|
|
3573
3624
|
};
|
|
3574
3625
|
function usage(message) {
|
|
3575
|
-
throw new
|
|
3626
|
+
throw new OfficeError3("invalid-value", message, "usage");
|
|
3576
3627
|
}
|
|
3577
3628
|
function validateObjectsAddCommand(args, positionals, seen) {
|
|
3578
3629
|
const allowed = Object.keys(objectsAddSchema.options.properties).map(
|
|
@@ -3802,7 +3853,7 @@ var packageToolsSchemas = Object.fromEntries(
|
|
|
3802
3853
|
);
|
|
3803
3854
|
|
|
3804
3855
|
// packages/safe-bash-command-pptx/src/command-engine-values.ts
|
|
3805
|
-
import { OfficeError as
|
|
3856
|
+
import { OfficeError as OfficeError4 } from "../../safe-bash-presentation-engine/errors.js";
|
|
3806
3857
|
function commandLength(value, minimum = 1) {
|
|
3807
3858
|
const units = { emu: 1, in: 914400, cm: 36e4, mm: 36e3, pt: 12700 };
|
|
3808
3859
|
const unit = Object.keys(units).find((candidate) => value.endsWith(candidate));
|
|
@@ -3811,7 +3862,7 @@ function commandLength(value, minimum = 1) {
|
|
|
3811
3862
|
if (!unit || pieces.length > 2 || !pieces[0] || pieces.some(
|
|
3812
3863
|
(piece) => !piece || [...piece].some((character) => character < "0" || character > "9")
|
|
3813
3864
|
))
|
|
3814
|
-
throw new
|
|
3865
|
+
throw new OfficeError4(
|
|
3815
3866
|
"invalid-value",
|
|
3816
3867
|
"Lengths require a decimal and emu, in, cm, mm or pt unit.",
|
|
3817
3868
|
"usage"
|
|
@@ -3819,13 +3870,13 @@ function commandLength(value, minimum = 1) {
|
|
|
3819
3870
|
const raw = Number(digits) * units[unit];
|
|
3820
3871
|
const result = Math.sign(raw) * Math.round(Math.abs(raw));
|
|
3821
3872
|
if (!Number.isFinite(raw) || Math.abs(raw) > Number.MAX_SAFE_INTEGER || !Number.isSafeInteger(result) || result < minimum)
|
|
3822
|
-
throw new
|
|
3873
|
+
throw new OfficeError4("invalid-value", "Length is outside the supported range.", "usage");
|
|
3823
3874
|
return result;
|
|
3824
3875
|
}
|
|
3825
3876
|
function commandTimestamp(value) {
|
|
3826
3877
|
const date = new Date(value);
|
|
3827
3878
|
if (!Number.isFinite(date.getTime()) || !value.endsWith("Z") || date.toISOString() !== value && date.toISOString() !== value.slice(0, -1) + ".000Z")
|
|
3828
|
-
throw new
|
|
3879
|
+
throw new OfficeError4(
|
|
3829
3880
|
"invalid-value",
|
|
3830
3881
|
"Timestamp requires a valid UTC date with seconds and Z suffix.",
|
|
3831
3882
|
"usage"
|
|
@@ -3859,7 +3910,7 @@ function commandJson(value) {
|
|
|
3859
3910
|
}
|
|
3860
3911
|
return JSON.parse(value);
|
|
3861
3912
|
} catch {
|
|
3862
|
-
throw new
|
|
3913
|
+
throw new OfficeError4(
|
|
3863
3914
|
"invalid-value",
|
|
3864
3915
|
"Structured slides require valid JSON without duplicate keys, at most 32 levels deep.",
|
|
3865
3916
|
"usage"
|
|
@@ -3869,11 +3920,11 @@ function commandJson(value) {
|
|
|
3869
3920
|
|
|
3870
3921
|
// packages/safe-bash-command-pptx/src/command-package-tools.ts
|
|
3871
3922
|
import { sha256 } from "@noble/hashes/sha2.js";
|
|
3872
|
-
import { OfficeError as
|
|
3923
|
+
import { OfficeError as OfficeError5 } from "../../safe-bash-presentation-engine/errors.js";
|
|
3873
3924
|
import { asciiKey, partName } from "../../safe-bash-presentation-engine/package-uri.js";
|
|
3874
3925
|
import { extractPackage, packPackage } from "../../safe-bash-presentation-engine/package-tools.js";
|
|
3875
3926
|
function usage2(message) {
|
|
3876
|
-
throw new
|
|
3927
|
+
throw new OfficeError5("invalid-value", message, "usage");
|
|
3877
3928
|
}
|
|
3878
3929
|
function scopedPath(manifest, path) {
|
|
3879
3930
|
if (path === "-") return path;
|
|
@@ -3940,7 +3991,7 @@ async function executePackageCommand(args, request, options2) {
|
|
|
3940
3991
|
);
|
|
3941
3992
|
const files = await extractPackage(bytes2, context, args.parts ? { parts: args.parts } : {});
|
|
3942
3993
|
if (files.length > (args.limits?.maxOutputs ?? context.archiveLimits.maxMembers) || files.reduce((sum, file) => sum + file.bytes.length, 0) > options2.maxOutputBytes)
|
|
3943
|
-
throw new
|
|
3994
|
+
throw new OfficeError5(
|
|
3944
3995
|
"resource-limit",
|
|
3945
3996
|
"Package extraction exceeds output limits.",
|
|
3946
3997
|
"validate-intent"
|
|
@@ -3972,7 +4023,7 @@ async function executePackageCommand(args, request, options2) {
|
|
|
3972
4023
|
};
|
|
3973
4024
|
}
|
|
3974
4025
|
if (args.creation?.author !== void 0 || args.creation?.timestamp !== void 0)
|
|
3975
|
-
throw new
|
|
4026
|
+
throw new OfficeError5(
|
|
3976
4027
|
"unsupported-edit",
|
|
3977
4028
|
"Pack metadata overrides are unavailable; source properties are preserved.",
|
|
3978
4029
|
"validate-intent"
|
|
@@ -3982,7 +4033,7 @@ async function executePackageCommand(args, request, options2) {
|
|
|
3982
4033
|
Math.min(context.limits.maxBytes, context.xmlLimits.maxBytes)
|
|
3983
4034
|
);
|
|
3984
4035
|
if (encoded.length > Math.min(context.limits.maxBytes, context.xmlLimits.maxBytes))
|
|
3985
|
-
throw new
|
|
4036
|
+
throw new OfficeError5("resource-limit", "Manifest exceeds byte limit.", "admit");
|
|
3986
4037
|
let value;
|
|
3987
4038
|
try {
|
|
3988
4039
|
value = commandJson(new TextDecoder("utf-8", { fatal: true }).decode(encoded));
|
|
@@ -3992,7 +4043,7 @@ async function executePackageCommand(args, request, options2) {
|
|
|
3992
4043
|
if (!value || typeof value !== "object" || Array.isArray(value) || Object.keys(value).some((key) => key !== "parts") || !("parts" in value) || !Array.isArray(value.parts) || !value.parts.length)
|
|
3993
4044
|
usage2("Manifest requires a nonempty parts array.");
|
|
3994
4045
|
if (value.parts.length > context.archiveLimits.maxMembers)
|
|
3995
|
-
throw new
|
|
4046
|
+
throw new OfficeError5("resource-limit", "Manifest exceeds member limit.", "admit");
|
|
3996
4047
|
const parts = value.parts;
|
|
3997
4048
|
for (const item of parts)
|
|
3998
4049
|
if (!item || typeof item !== "object" || Object.keys(item).some((key) => !["part", "sha256", "file"].includes(key)) || !canonical(item.part) || typeof item.sha256 !== "string" || item.sha256.length !== 64 || [...item.sha256].some((c) => !"0123456789abcdef".includes(c)) || !item.file || typeof item.file !== "object" || Object.keys(item.file).length !== 1 || typeof item.file.vfsPath !== "string" || !item.file.vfsPath.length)
|
|
@@ -4014,7 +4065,7 @@ async function executePackageCommand(args, request, options2) {
|
|
|
4014
4065
|
);
|
|
4015
4066
|
total += bytes2.length;
|
|
4016
4067
|
if (bytes2.length > context.archiveLimits.maxEntryBytes || total > context.archiveLimits.maxTotalBytes)
|
|
4017
|
-
throw new
|
|
4068
|
+
throw new OfficeError5("resource-limit", "Manifest contents exceed byte limit.", "admit");
|
|
4018
4069
|
members.push({ part: item.part, sha256: item.sha256, bytes: bytes2 });
|
|
4019
4070
|
}
|
|
4020
4071
|
const bytes = await packPackage(
|
|
@@ -4023,7 +4074,7 @@ async function executePackageCommand(args, request, options2) {
|
|
|
4023
4074
|
args.creation?.kind ? { kind: args.creation.kind } : {}
|
|
4024
4075
|
);
|
|
4025
4076
|
if (bytes.length > options2.maxOutputBytes)
|
|
4026
|
-
throw new
|
|
4077
|
+
throw new OfficeError5("resource-limit", "Packed output exceeds byte limit.", "validate-intent");
|
|
4027
4078
|
const dryRun = args.dryRun ?? false;
|
|
4028
4079
|
const fingerprint = [...sha256(bytes)].map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
4029
4080
|
if (args.output && args.output !== "-" && !request.publishOutput)
|
|
@@ -4059,7 +4110,7 @@ async function executePackageCommand(args, request, options2) {
|
|
|
4059
4110
|
}
|
|
4060
4111
|
|
|
4061
4112
|
// packages/safe-bash-command-pptx/src/command-diff.ts
|
|
4062
|
-
import { OfficeError as
|
|
4113
|
+
import { OfficeError as OfficeError6 } from "../../safe-bash-presentation-engine/errors.js";
|
|
4063
4114
|
import { comparePresentations } from "../../safe-bash-presentation-engine/diff.js";
|
|
4064
4115
|
|
|
4065
4116
|
// packages/safe-bash-command-pptx/src/diff-schema.ts
|
|
@@ -4165,7 +4216,7 @@ async function executeDiffCommand(request, options2) {
|
|
|
4165
4216
|
let human = "";
|
|
4166
4217
|
let exitCode = 0;
|
|
4167
4218
|
const failure = (error) => {
|
|
4168
|
-
const office = error instanceof
|
|
4219
|
+
const office = error instanceof OfficeError6 ? error : void 0;
|
|
4169
4220
|
const code = request.signal.aborted ? "cancelled" : office?.code ?? (error && typeof error === "object" && "code" in error && error.code === "resource-limit" ? "resource-limit" : "io-failure");
|
|
4170
4221
|
exitCode = code === "cancelled" ? 130 : 2;
|
|
4171
4222
|
const message = office?.message ?? (code === "cancelled" ? "Comparison cancelled." : "Comparison input could not be read.");
|
|
@@ -4183,7 +4234,7 @@ async function executeDiffCommand(request, options2) {
|
|
|
4183
4234
|
};
|
|
4184
4235
|
};
|
|
4185
4236
|
const usage13 = (message) => {
|
|
4186
|
-
throw new
|
|
4237
|
+
throw new OfficeError6("invalid-value", message, "usage");
|
|
4187
4238
|
};
|
|
4188
4239
|
try {
|
|
4189
4240
|
let byteCount = 0;
|
|
@@ -4191,7 +4242,7 @@ async function executeDiffCommand(request, options2) {
|
|
|
4191
4242
|
if (!(bytes2 instanceof Uint8Array)) usage13("Arguments must be byte arrays.");
|
|
4192
4243
|
byteCount += bytes2.byteLength;
|
|
4193
4244
|
if (byteCount > options2.maxArgumentBytes)
|
|
4194
|
-
throw new
|
|
4245
|
+
throw new OfficeError6("resource-limit", "Argument limit exceeded.", "admit");
|
|
4195
4246
|
try {
|
|
4196
4247
|
return new TextDecoder("utf-8", { fatal: true }).decode(bytes2);
|
|
4197
4248
|
} catch {
|
|
@@ -4269,7 +4320,7 @@ async function executeDiffCommand(request, options2) {
|
|
|
4269
4320
|
}
|
|
4270
4321
|
};
|
|
4271
4322
|
if (mode === "effective-formatting")
|
|
4272
|
-
throw new
|
|
4323
|
+
throw new OfficeError6(
|
|
4273
4324
|
"unsupported-profile",
|
|
4274
4325
|
"Effective formatting comparison is not supported.",
|
|
4275
4326
|
"usage"
|
|
@@ -4304,7 +4355,7 @@ async function executeDiffCommand(request, options2) {
|
|
|
4304
4355
|
let bytes = encoder.encode(json ? JSON.stringify(result) + "\n" : human);
|
|
4305
4356
|
if (bytes.length > maxOutputBytes) {
|
|
4306
4357
|
result = failure(
|
|
4307
|
-
new
|
|
4358
|
+
new OfficeError6("resource-limit", "Comparison output limit exceeded.", "admit")
|
|
4308
4359
|
);
|
|
4309
4360
|
bytes = encoder.encode(json ? JSON.stringify(result) + "\n" : human);
|
|
4310
4361
|
}
|
|
@@ -4424,7 +4475,7 @@ var templateSchema = {
|
|
|
4424
4475
|
|
|
4425
4476
|
// packages/safe-bash-command-pptx/src/command-template.ts
|
|
4426
4477
|
import { sha256 as sha2562 } from "@noble/hashes/sha2.js";
|
|
4427
|
-
import { OfficeError as
|
|
4478
|
+
import { OfficeError as OfficeError7 } from "../../safe-bash-presentation-engine/errors.js";
|
|
4428
4479
|
import {
|
|
4429
4480
|
applyTemplateBindings,
|
|
4430
4481
|
validateTemplateBindings
|
|
@@ -4438,7 +4489,7 @@ function validateTemplateData(value) {
|
|
|
4438
4489
|
else validateTemplateRepeat(value);
|
|
4439
4490
|
}
|
|
4440
4491
|
function usage3(message) {
|
|
4441
|
-
throw new
|
|
4492
|
+
throw new OfficeError7("invalid-value", message, "usage");
|
|
4442
4493
|
}
|
|
4443
4494
|
function validateTemplateCommand(args, positionals, seen) {
|
|
4444
4495
|
if ([...seen].some(
|
|
@@ -4790,11 +4841,11 @@ var commentSchemas = Object.fromEntries(
|
|
|
4790
4841
|
);
|
|
4791
4842
|
|
|
4792
4843
|
// packages/safe-bash-command-pptx/src/command-comments.ts
|
|
4793
|
-
import { OfficeError as
|
|
4844
|
+
import { OfficeError as OfficeError8 } from "../../safe-bash-presentation-engine/errors.js";
|
|
4794
4845
|
import { mutateComments, readComments, readCommentAuthors } from "../../safe-bash-presentation-engine/comments.js";
|
|
4795
4846
|
import { SelectionError } from "../../safe-bash-presentation-engine/selectors.js";
|
|
4796
4847
|
function usage4(message) {
|
|
4797
|
-
throw new
|
|
4848
|
+
throw new OfficeError8("invalid-value", message, "usage");
|
|
4798
4849
|
}
|
|
4799
4850
|
function validateCommentsCommand(args, positionals, seen) {
|
|
4800
4851
|
const allowed = Object.keys(commentSchemas[args.operation].options.properties).map(
|
|
@@ -5296,7 +5347,7 @@ var accessibilitySchemas = Object.fromEntries(
|
|
|
5296
5347
|
);
|
|
5297
5348
|
|
|
5298
5349
|
// packages/safe-bash-command-pptx/src/command-accessibility.ts
|
|
5299
|
-
import { OfficeError as
|
|
5350
|
+
import { OfficeError as OfficeError9 } from "../../safe-bash-presentation-engine/errors.js";
|
|
5300
5351
|
import {
|
|
5301
5352
|
readAccessibility,
|
|
5302
5353
|
mutateAccessibility,
|
|
@@ -5304,7 +5355,7 @@ import {
|
|
|
5304
5355
|
} from "../../safe-bash-presentation-engine/accessibility.js";
|
|
5305
5356
|
import { SelectionError as SelectionError2 } from "../../safe-bash-presentation-engine/selectors.js";
|
|
5306
5357
|
function usage5(message) {
|
|
5307
|
-
throw new
|
|
5358
|
+
throw new OfficeError9("invalid-value", message, "usage");
|
|
5308
5359
|
}
|
|
5309
5360
|
function validateAccessibilityCommand(args, positionals, seen) {
|
|
5310
5361
|
const allowed = Object.keys(accessibilitySchemas[args.operation].options.properties).map(
|
|
@@ -5414,13 +5465,13 @@ async function executeAccessibilityCommand(args, request, options2) {
|
|
|
5414
5465
|
}
|
|
5415
5466
|
|
|
5416
5467
|
// packages/safe-bash-command-pptx/src/command-metadata.ts
|
|
5417
|
-
import { OfficeError as
|
|
5468
|
+
import { OfficeError as OfficeError10 } from "../../safe-bash-presentation-engine/errors.js";
|
|
5418
5469
|
import { coreDefinition, mutateProperty, readProperties } from "../../safe-bash-presentation-engine/properties.js";
|
|
5419
5470
|
import { sanitize as sanitizePresentation } from "../../safe-bash-presentation-engine/sanitize.js";
|
|
5420
5471
|
import { mutateTags, readTags } from "../../safe-bash-presentation-engine/tags.js";
|
|
5421
5472
|
import { SelectionError as SelectionError3 } from "../../safe-bash-presentation-engine/selectors.js";
|
|
5422
5473
|
function usage6(message) {
|
|
5423
|
-
throw new
|
|
5474
|
+
throw new OfficeError10("invalid-value", message, "usage");
|
|
5424
5475
|
}
|
|
5425
5476
|
function removalCategories(value) {
|
|
5426
5477
|
const categories = ["notes", "comments", "properties", "links", "objects"];
|
|
@@ -5522,11 +5573,11 @@ ${sanitization.retained.map((entry) => `Retained ${entry.category} ${entry.kind}
|
|
|
5522
5573
|
}
|
|
5523
5574
|
|
|
5524
5575
|
// packages/safe-bash-command-pptx/src/command-notes.ts
|
|
5525
|
-
import { OfficeError as
|
|
5576
|
+
import { OfficeError as OfficeError11 } from "../../safe-bash-presentation-engine/errors.js";
|
|
5526
5577
|
import { mutateNotes, readNotes, validateNotesOptions } from "../../safe-bash-presentation-engine/notes.js";
|
|
5527
5578
|
import { readSelectionIndex, SelectionError as SelectionError4 } from "../../safe-bash-presentation-engine/selectors.js";
|
|
5528
5579
|
function usage7(message) {
|
|
5529
|
-
throw new
|
|
5580
|
+
throw new OfficeError11("invalid-value", message, "usage");
|
|
5530
5581
|
}
|
|
5531
5582
|
function validateNotesCommand(args, positionals, seen) {
|
|
5532
5583
|
const allowed = Object.keys(noteSchemas[args.operation].options.properties).map(
|
|
@@ -5808,12 +5859,12 @@ var linkSchemas = Object.fromEntries(
|
|
|
5808
5859
|
// packages/safe-bash-command-pptx/src/command-links.ts
|
|
5809
5860
|
import { readPackage as readPackage2 } from "../../safe-bash-presentation-engine/package-reader.js";
|
|
5810
5861
|
import { parseXmlPart as parseXmlPart2 } from "../../safe-bash-presentation-engine/xml.js";
|
|
5811
|
-
import { OfficeError as
|
|
5862
|
+
import { OfficeError as OfficeError12 } from "../../safe-bash-presentation-engine/errors.js";
|
|
5812
5863
|
import { listLinks, setLink, removeLink, isOrdinaryLinkUrl } from "../../safe-bash-presentation-engine/links.js";
|
|
5813
5864
|
import { readShapes } from "../../safe-bash-presentation-engine/shape-operations.js";
|
|
5814
5865
|
import { SelectionError as SelectionError5 } from "../../safe-bash-presentation-engine/selectors.js";
|
|
5815
5866
|
function usage8(message) {
|
|
5816
|
-
throw new
|
|
5867
|
+
throw new OfficeError12("invalid-value", message, "usage");
|
|
5817
5868
|
}
|
|
5818
5869
|
function validateLinkCommand(args, positionals, seen) {
|
|
5819
5870
|
const allowed = Object.keys(linkSchemas[args.operation].options.properties).map(
|
|
@@ -5951,7 +6002,7 @@ async function executeLinkCommand(args, request, options2) {
|
|
|
5951
6002
|
if (args.operation === "links.add" && selectedLinks.some(
|
|
5952
6003
|
(link) => link.part === selection.owner && link.shapeId === selection.id && (path ? link.path.length === path.length + 1 && path.every((position, i) => link.path[i] === position) : existingShapeLinks.has(JSON.stringify([link.part, link.shapeId])))
|
|
5953
6004
|
))
|
|
5954
|
-
throw new
|
|
6005
|
+
throw new OfficeError12(
|
|
5955
6006
|
"unsupported-edit",
|
|
5956
6007
|
"Selected trigger already contains a link.",
|
|
5957
6008
|
"validate-intent"
|
|
@@ -6978,11 +7029,11 @@ import { readAnimations } from "../../safe-bash-presentation-engine/animations.j
|
|
|
6978
7029
|
import { mutateAnimations, mutateAnimationsBatch, validateAnimationOptions as validateAnimationOptions2 } from "../../safe-bash-presentation-engine/animation-editing.js";
|
|
6979
7030
|
|
|
6980
7031
|
// packages/safe-bash-command-pptx/src/animation-batch-command.ts
|
|
6981
|
-
import { OfficeError as
|
|
7032
|
+
import { OfficeError as OfficeError13 } from "../../safe-bash-presentation-engine/errors.js";
|
|
6982
7033
|
import { validateAnimationOptions } from "../../safe-bash-presentation-engine/animation-editing.js";
|
|
6983
7034
|
import { decodeSelectionToken, SelectionError as SelectionError6 } from "../../safe-bash-presentation-engine/selectors.js";
|
|
6984
7035
|
function invalid(message) {
|
|
6985
|
-
throw new
|
|
7036
|
+
throw new OfficeError13("invalid-value", message, "usage");
|
|
6986
7037
|
}
|
|
6987
7038
|
function record(value, keys) {
|
|
6988
7039
|
if (!value || typeof value !== "object" || Array.isArray(value) || Object.keys(value).some((key) => !keys.includes(key))) invalid("Invalid animation batch fields.");
|
|
@@ -7190,11 +7241,11 @@ var equationSchemas = Object.fromEntries(["list", "get", "add"].map((action) =>
|
|
|
7190
7241
|
}));
|
|
7191
7242
|
|
|
7192
7243
|
// packages/safe-bash-command-pptx/src/command-equations.ts
|
|
7193
|
-
import { OfficeError as
|
|
7244
|
+
import { OfficeError as OfficeError14 } from "../../safe-bash-presentation-engine/errors.js";
|
|
7194
7245
|
import { readEquations, mutateEquations } from "../../safe-bash-presentation-engine/equations.js";
|
|
7195
7246
|
import { SelectionError as SelectionError7 } from "../../safe-bash-presentation-engine/selectors.js";
|
|
7196
7247
|
function usage9(message) {
|
|
7197
|
-
throw new
|
|
7248
|
+
throw new OfficeError14("invalid-value", message, "usage");
|
|
7198
7249
|
}
|
|
7199
7250
|
function validateEquationCommand(args, positionals, seen) {
|
|
7200
7251
|
const schema = equationSchemas[args.operation];
|
|
@@ -7345,11 +7396,11 @@ var opaqueSchemas = Object.fromEntries(["objects.list", "objects.extract", "font
|
|
|
7345
7396
|
|
|
7346
7397
|
// packages/safe-bash-command-pptx/src/command-opaque.ts
|
|
7347
7398
|
import { sha256 as sha2563 } from "@noble/hashes/sha2.js";
|
|
7348
|
-
import { OfficeError as
|
|
7399
|
+
import { OfficeError as OfficeError15 } from "../../safe-bash-presentation-engine/errors.js";
|
|
7349
7400
|
import { extractObject, readFonts, readObjects } from "../../safe-bash-presentation-engine/opaque-objects.js";
|
|
7350
7401
|
import { partName as partName2 } from "../../safe-bash-presentation-engine/package-uri.js";
|
|
7351
7402
|
function usage10(message) {
|
|
7352
|
-
throw new
|
|
7403
|
+
throw new OfficeError15("invalid-value", message, "usage");
|
|
7353
7404
|
}
|
|
7354
7405
|
function validateOpaqueCommand(args, positionals, seen) {
|
|
7355
7406
|
const schema = opaqueSchemas[args.operation];
|
|
@@ -7386,7 +7437,7 @@ async function executeOpaqueCommand(args, request, options2) {
|
|
|
7386
7437
|
}
|
|
7387
7438
|
const extracted = await extractObject(bytes, { part: args.part }, context);
|
|
7388
7439
|
const files = [{ part: extracted.part, name: extracted.name, bytes: extracted.bytes }, ...extracted.dependencies];
|
|
7389
|
-
if (files.length > (args.limits?.maxOutputs ?? context.archiveLimits.maxMembers)) throw new
|
|
7440
|
+
if (files.length > (args.limits?.maxOutputs ?? context.archiveLimits.maxMembers)) throw new OfficeError15("resource-limit", "Opaque output count exceeds limit.", "validate-intent");
|
|
7390
7441
|
const dryRun = args.dryRun ?? false;
|
|
7391
7442
|
const allowPartialOutput = args.allowPartialOutput ?? false;
|
|
7392
7443
|
if (!dryRun && !request.publishOutputs && (!allowPartialOutput || !request.publishOutput)) throw Object.assign(new Error("Object extraction requires atomic publication or explicit partial output."), { code: "publication-unsupported" });
|
|
@@ -7418,7 +7469,7 @@ import { readMedia } from "../../safe-bash-presentation-engine/media.js";
|
|
|
7418
7469
|
import { extractMedia } from "../../safe-bash-presentation-engine/media-extraction.js";
|
|
7419
7470
|
|
|
7420
7471
|
// packages/safe-bash-command-pptx/src/command-media-editing.ts
|
|
7421
|
-
import { OfficeError as
|
|
7472
|
+
import { OfficeError as OfficeError16 } from "../../safe-bash-presentation-engine/errors.js";
|
|
7422
7473
|
import { addMedia, replaceMedia } from "../../safe-bash-presentation-engine/media-editing.js";
|
|
7423
7474
|
|
|
7424
7475
|
// packages/safe-bash-command-pptx/src/media-schema.ts
|
|
@@ -7668,7 +7719,7 @@ for (const action of ["add", "replace", "extract"]) {
|
|
|
7668
7719
|
|
|
7669
7720
|
// packages/safe-bash-command-pptx/src/command-media-editing.ts
|
|
7670
7721
|
function usage11(message) {
|
|
7671
|
-
throw new
|
|
7722
|
+
throw new OfficeError16("invalid-value", message, "usage");
|
|
7672
7723
|
}
|
|
7673
7724
|
function validateMediaEditingCommand(args, positionals, seen) {
|
|
7674
7725
|
const allowed = Object.keys(mediaSchemas[args.operation].options.properties).map(
|
|
@@ -8762,7 +8813,7 @@ import {
|
|
|
8762
8813
|
import { readBackgrounds, mutateBackground } from "../../safe-bash-presentation-engine/backgrounds.js";
|
|
8763
8814
|
import { replacePresentationText } from "../../safe-bash-presentation-engine/text-replacement.js";
|
|
8764
8815
|
import { readPresentationText } from "../../safe-bash-presentation-engine/text-reading.js";
|
|
8765
|
-
import { OfficeError as
|
|
8816
|
+
import { OfficeError as OfficeError17 } from "../../safe-bash-presentation-engine/errors.js";
|
|
8766
8817
|
import { sha256 as sha2564 } from "@noble/hashes/sha2.js";
|
|
8767
8818
|
import { packageUri, partName as partName3 } from "../../safe-bash-presentation-engine/package-uri.js";
|
|
8768
8819
|
import {
|
|
@@ -8794,7 +8845,7 @@ import {
|
|
|
8794
8845
|
readPresentationSettings,
|
|
8795
8846
|
mutatePresentationSettings
|
|
8796
8847
|
} from "../../safe-bash-presentation-engine/presentation-settings.js";
|
|
8797
|
-
import { getXmlPart, stageRetainedXmlPart, replaceXmlPart } from "../../safe-bash-presentation-engine/xml-parts.js";
|
|
8848
|
+
import { getXmlPart, stageRetainedXmlPart, stageRetainedXmlReplacement, replaceXmlPart } from "../../safe-bash-presentation-engine/xml-parts.js";
|
|
8798
8849
|
import { validatePresentation, openRetainedPresentationValidation } from "../../safe-bash-presentation-engine/validation.js";
|
|
8799
8850
|
import { readPackage as readPackage3 } from "../../safe-bash-presentation-engine/package-reader.js";
|
|
8800
8851
|
import { resourceContext } from "../../safe-bash-presentation-engine/resource-limits.js";
|
|
@@ -8964,7 +9015,7 @@ Slides add requires an exact layout name or part URI; position defaults to appen
|
|
|
8964
9015
|
Title/body match placeholder types; indexed bindings use --placeholders-json.
|
|
8965
9016
|
`;
|
|
8966
9017
|
function usage12(message) {
|
|
8967
|
-
throw new
|
|
9018
|
+
throw new OfficeError17("invalid-value", message, "usage");
|
|
8968
9019
|
}
|
|
8969
9020
|
function paragraphTabLength(length4) {
|
|
8970
9021
|
if (Object.keys(length4).some((key) => !["value", "unit"].includes(key)) || typeof length4.value !== "number" || !Number.isFinite(length4.value) || length4.value < 0 || typeof length4.unit !== "string")
|
|
@@ -9223,7 +9274,7 @@ function parse(raw, maximum, output3) {
|
|
|
9223
9274
|
size += bytes.length + 1;
|
|
9224
9275
|
if (size > maximum) {
|
|
9225
9276
|
if (invalidUtf8) usage12("Arguments must be UTF-8.");
|
|
9226
|
-
throw new
|
|
9277
|
+
throw new OfficeError17("resource-limit", "Argument limit exceeded.", "usage");
|
|
9227
9278
|
}
|
|
9228
9279
|
try {
|
|
9229
9280
|
args.push(decoder.decode(bytes));
|
|
@@ -9875,7 +9926,7 @@ function parse(raw, maximum, output3) {
|
|
|
9875
9926
|
try {
|
|
9876
9927
|
parsed = admitFontMetrics(JSON.parse(value));
|
|
9877
9928
|
} catch (error) {
|
|
9878
|
-
if (error instanceof
|
|
9929
|
+
if (error instanceof OfficeError17) throw error;
|
|
9879
9930
|
usage12("Metrics require a valid JSON metric object.");
|
|
9880
9931
|
}
|
|
9881
9932
|
} else if (["bold", "italic", "wrap"].includes(key)) {
|
|
@@ -11601,7 +11652,7 @@ async function transferLocations(bytes, budget) {
|
|
|
11601
11652
|
(edge) => relationshipNamespaces.some((namespace) => edge.type === `${namespace}/officeDocument`)
|
|
11602
11653
|
);
|
|
11603
11654
|
const root = roots.length === 1 ? roots[0].targetPart : void 0;
|
|
11604
|
-
if (!root) throw new
|
|
11655
|
+
if (!root) throw new OfficeError17("invalid-opc", "Presentation part is missing.", "index");
|
|
11605
11656
|
const relationshipNamespace = roots[0].type.slice(0, -"/officeDocument".length);
|
|
11606
11657
|
const xml = budget.xml(reader.get(root));
|
|
11607
11658
|
const fingerprint = Array.from(sha2564(bytes), (byte) => byte.toString(16).padStart(2, "0")).join(
|
|
@@ -11620,7 +11671,7 @@ async function transferLocations(bytes, budget) {
|
|
|
11620
11671
|
(edge) => edge.id === reference && edge.type === `${relationshipNamespace}/slide`
|
|
11621
11672
|
)?.targetPart;
|
|
11622
11673
|
if (!id || !owner || !reader.has(owner))
|
|
11623
|
-
throw new
|
|
11674
|
+
throw new OfficeError17("invalid-opc", "Referenced slide is missing.", "index");
|
|
11624
11675
|
return {
|
|
11625
11676
|
fingerprint,
|
|
11626
11677
|
scope: "slides",
|
|
@@ -11688,6 +11739,7 @@ async function executeRequest(request, options2, owned) {
|
|
|
11688
11739
|
if (request.args?.[0] instanceof Uint8Array && request.args[0].length === 4 && request.args[0].every((byte, index) => byte === [100, 105, 102, 102][index]))
|
|
11689
11740
|
return executeDiffCommand(request, options2);
|
|
11690
11741
|
const output3 = { json: false, operation: "help" };
|
|
11742
|
+
let retainedExtraction;
|
|
11691
11743
|
let result;
|
|
11692
11744
|
let exitCode = 0;
|
|
11693
11745
|
let stagedOutput;
|
|
@@ -11728,7 +11780,37 @@ async function executeRequest(request, options2, owned) {
|
|
|
11728
11780
|
output3.json = args.json;
|
|
11729
11781
|
output3.operation = args.operation;
|
|
11730
11782
|
const operation2 = args.operation;
|
|
11731
|
-
if (args.operation === "
|
|
11783
|
+
if (args.operation === "extract" && request.streaming && (!request.publishOutputs || request.publishOutputStreams) && (!request.preflightOutput || request.preflightOutputStream)) {
|
|
11784
|
+
retainedExtraction = await prepareRetainedExtraction(args, request, options2);
|
|
11785
|
+
owned.push(retainedExtraction);
|
|
11786
|
+
result = success(operation2, null);
|
|
11787
|
+
} else if (args.operation === "xml.set" && request.streaming) {
|
|
11788
|
+
if (args.token) decodeSelectionToken2(args.token);
|
|
11789
|
+
const streaming = request.streaming, context = { ...options2.context, signal: request.signal, workingStorage: streaming.workingStorage };
|
|
11790
|
+
if (!context.validationLimits) throw new OfficeError17("invalid-value", "XML operations require explicit validation limits.", "usage");
|
|
11791
|
+
const input = await streaming.openInput(args.input, Math.min(context.limits.maxBytes, context.archiveLimits.maxArchiveBytes));
|
|
11792
|
+
const maxReplacementBytes = Math.min(context.validationLimits.maxBytes, context.archiveLimits.maxEntryBytes), file = args.file;
|
|
11793
|
+
async function* replacement() {
|
|
11794
|
+
const source3 = await streaming.openInput(file, maxReplacementBytes);
|
|
11795
|
+
yield* source3.stream();
|
|
11796
|
+
}
|
|
11797
|
+
const destination = args.inPlace ? args.input : args.output, dryRun = args.dryRun ?? false;
|
|
11798
|
+
const staged = await stageRetainedXmlReplacement(input, replacement(), {
|
|
11799
|
+
...args.token === void 0 ? {} : { token: args.token },
|
|
11800
|
+
...args.slide === void 0 ? {} : { slide: args.slide },
|
|
11801
|
+
...args.shape === void 0 ? {} : { shape: args.shape },
|
|
11802
|
+
...args.part === void 0 ? {} : { part: args.part },
|
|
11803
|
+
...args.scope === void 0 ? {} : { scope: args.scope },
|
|
11804
|
+
...args.all === void 0 ? {} : { all: args.all }
|
|
11805
|
+
}, context, { json: args.json, dryRun, ...destination === void 0 ? {} : { destination }, maxOutputBytes: options2.maxOutputBytes });
|
|
11806
|
+
owned.push(staged);
|
|
11807
|
+
stagedOutput = staged.output;
|
|
11808
|
+
if (destination && destination !== "-") {
|
|
11809
|
+
if (!request.publishOutput) throw Object.assign(new Error("Output publication capability is unavailable."), { code: "publication-unsupported" });
|
|
11810
|
+
publication = { inputPath: args.input, outputPath: destination, bytes: staged.bytes(), originalBytes: input, inPlace: args.inPlace ?? false, force: args.force ?? false, dryRun };
|
|
11811
|
+
}
|
|
11812
|
+
result = success(operation2, null);
|
|
11813
|
+
} else if (args.operation === "slides.set" && request.streaming) {
|
|
11732
11814
|
if (args.token) decodeSelectionToken2(args.token);
|
|
11733
11815
|
const input = await request.streaming.openInput(args.input, Math.min(options2.context.limits.maxBytes, options2.context.archiveLimits.maxArchiveBytes));
|
|
11734
11816
|
const destination = args.inPlace ? args.input : args.output;
|
|
@@ -11780,7 +11862,7 @@ async function executeRequest(request, options2, owned) {
|
|
|
11780
11862
|
}, context, { json: args.json, maxOutputBytes: options2.maxOutputBytes });
|
|
11781
11863
|
} catch (error) {
|
|
11782
11864
|
failed = true;
|
|
11783
|
-
if (error instanceof
|
|
11865
|
+
if (error instanceof OfficeError17 && error.code === "resource-limit" && error.phase === "publish") return outputLimitFailure(operation2, args.json);
|
|
11784
11866
|
throw error;
|
|
11785
11867
|
} finally {
|
|
11786
11868
|
try {
|
|
@@ -11805,7 +11887,7 @@ async function executeRequest(request, options2, owned) {
|
|
|
11805
11887
|
let failed = false;
|
|
11806
11888
|
try {
|
|
11807
11889
|
validation = await openRetainedPresentationValidation(archive, context, limits);
|
|
11808
|
-
if (!validation.valid) throw new
|
|
11890
|
+
if (!validation.valid) throw new OfficeError17("invalid-opc", "Presentation semantic validation failed.", "index");
|
|
11809
11891
|
result = success(operation2, { valid: true, schema: validation.schema, rules: validation.rules, issues: [] });
|
|
11810
11892
|
} catch (error) {
|
|
11811
11893
|
failed = true;
|
|
@@ -11820,7 +11902,7 @@ async function executeRequest(request, options2, owned) {
|
|
|
11820
11902
|
const bytes = await request.readInput(args.input, maxBytes);
|
|
11821
11903
|
const reader = await readPackage3(bytes, { ...options2.context, signal: request.signal });
|
|
11822
11904
|
const validation = validatePresentation(reader, limits);
|
|
11823
|
-
if (!validation.valid) throw new
|
|
11905
|
+
if (!validation.valid) throw new OfficeError17("invalid-opc", "Presentation semantic validation failed.", "index");
|
|
11824
11906
|
result = success(operation2, validation);
|
|
11825
11907
|
}
|
|
11826
11908
|
human = "Presentation is semantically valid; XML schema validation not checked.\n";
|
|
@@ -13416,13 +13498,13 @@ ${item.parts.map((part) => ` ${part}
|
|
|
13416
13498
|
const inputs = [];
|
|
13417
13499
|
for (const path of [args.input, ...args.sources ?? []]) {
|
|
13418
13500
|
if (remaining < 1)
|
|
13419
|
-
throw new
|
|
13501
|
+
throw new OfficeError17("resource-limit", "Combined input limit exceeded.", "admit");
|
|
13420
13502
|
const bytes = await request.readInput(
|
|
13421
13503
|
path,
|
|
13422
13504
|
Math.min(remaining, context.archiveLimits.maxArchiveBytes)
|
|
13423
13505
|
);
|
|
13424
13506
|
if (bytes.length > remaining || bytes.length > context.archiveLimits.maxArchiveBytes)
|
|
13425
|
-
throw new
|
|
13507
|
+
throw new OfficeError17("resource-limit", "Combined input limit exceeded.", "admit");
|
|
13426
13508
|
remaining -= bytes.length;
|
|
13427
13509
|
inputs.push(await budget.read(bytes));
|
|
13428
13510
|
}
|
|
@@ -13523,7 +13605,7 @@ ${JSON.stringify(result.data, null, 2)}
|
|
|
13523
13605
|
}
|
|
13524
13606
|
} else if (args.operation === "create") {
|
|
13525
13607
|
if (args.template)
|
|
13526
|
-
throw new
|
|
13608
|
+
throw new OfficeError17(
|
|
13527
13609
|
"unsupported-profile",
|
|
13528
13610
|
"Template-based creation is unavailable.",
|
|
13529
13611
|
"validate-intent"
|
|
@@ -13575,7 +13657,7 @@ ${JSON.stringify(result.data, null, 2)}
|
|
|
13575
13657
|
);
|
|
13576
13658
|
} catch (error) {
|
|
13577
13659
|
if (error && typeof error === "object" && "code" in error && error.code === "resource-limit")
|
|
13578
|
-
throw new
|
|
13660
|
+
throw new OfficeError17("resource-limit", "Input limit exceeded.", "admit");
|
|
13579
13661
|
throw error;
|
|
13580
13662
|
}
|
|
13581
13663
|
const index = await readSelectionIndex2(bytes, { ...options2.context, signal: request.signal });
|
|
@@ -13720,7 +13802,7 @@ ${JSON.stringify(result.data, null, 2)}
|
|
|
13720
13802
|
const part = metadata2 ?? records[0].part;
|
|
13721
13803
|
const validationLimits = options2.context.validationLimits;
|
|
13722
13804
|
if (!validationLimits)
|
|
13723
|
-
throw new
|
|
13805
|
+
throw new OfficeError17(
|
|
13724
13806
|
"invalid-value",
|
|
13725
13807
|
"XML operations require explicit validation limits.",
|
|
13726
13808
|
"usage"
|
|
@@ -13796,10 +13878,10 @@ ${xml.xml}
|
|
|
13796
13878
|
await stagedOutput?.close().catch(() => {
|
|
13797
13879
|
});
|
|
13798
13880
|
stagedOutput = void 0;
|
|
13799
|
-
if (error instanceof
|
|
13881
|
+
if (error instanceof OfficeError17 && error.code === "resource-limit" && error.phase === "publish") return outputLimitFailure(output3.operation, output3.json);
|
|
13800
13882
|
if (request.signal.aborted)
|
|
13801
13883
|
return { exitCode: 130, stdout: new Uint8Array(), stderr: new Uint8Array() };
|
|
13802
|
-
const office = error instanceof
|
|
13884
|
+
const office = error instanceof OfficeError17 ? error : void 0;
|
|
13803
13885
|
const capabilityCode = error && typeof error === "object" && "code" in error ? error.code : void 0;
|
|
13804
13886
|
const limit = office?.code === "resource-limit" || capabilityCode === "resource-limit";
|
|
13805
13887
|
const unsupported = capabilityCode === "publication-unsupported";
|
|
@@ -13825,6 +13907,7 @@ ${xml.xml}
|
|
|
13825
13907
|
human = `pptx: ${diagnostic.code}: ${diagnostic.message}
|
|
13826
13908
|
`;
|
|
13827
13909
|
}
|
|
13910
|
+
if (retainedExtraction && result.ok) return retainedExtraction.publish();
|
|
13828
13911
|
const { json, operation } = output3;
|
|
13829
13912
|
const encoded = (stagedOutput ? new Uint8Array() : binary) ?? new TextEncoder().encode(
|
|
13830
13913
|
json ? `${JSON.stringify(result)}
|
|
@@ -13901,7 +13984,7 @@ ${JSON.stringify(failure.data)}
|
|
|
13901
13984
|
} catch (error) {
|
|
13902
13985
|
if (request.signal.aborted)
|
|
13903
13986
|
return { exitCode: 130, stdout: new Uint8Array(), stderr: new Uint8Array() };
|
|
13904
|
-
const office = error instanceof
|
|
13987
|
+
const office = error instanceof OfficeError17 ? error : void 0;
|
|
13905
13988
|
const rawCode = error && typeof error === "object" && "code" in error ? error.code : void 0;
|
|
13906
13989
|
const code = typeof rawCode === "string" && [
|
|
13907
13990
|
"resource-limit",
|