@poe-platform/safe-bash 0.1.811 → 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.
Files changed (351) hide show
  1. package/dist/audio-ast/id3-source.d.ts +27 -0
  2. package/dist/audio-ast/index.d.ts +5 -0
  3. package/dist/audio-ast/index.js +1001 -596
  4. package/dist/audio-ast/mp3-source.d.ts +18 -0
  5. package/dist/audio-ast/ogg-source.d.ts +25 -0
  6. package/dist/audio-ast/ogg-stream-source.d.ts +22 -0
  7. package/dist/audio-ast/vorbis.d.ts +14 -0
  8. package/dist/image-ast/index.js +139 -9
  9. package/dist/mp4-ast/containers/adapters.d.ts +7 -0
  10. package/dist/office-xml/retained-xml-document.d.ts +8 -0
  11. package/dist/pdf-ast/ast.d.ts +2 -0
  12. package/dist/pdf-ast/content/dictionary-cursor.d.ts +15 -0
  13. package/dist/pdf-ast/content/range-operator-parser.d.ts +4 -0
  14. package/dist/pdf-ast/content/stored-dictionary.d.ts +10 -0
  15. package/dist/pdf-ast/cos/lexer.d.ts +8 -5
  16. package/dist/pdf-ast/cos/object-reader.d.ts +4 -3
  17. package/dist/pdf-ast/cos/range-parser.d.ts +4 -0
  18. package/dist/pdf-ast/cos/retained-objects.d.ts +1 -0
  19. package/dist/pdf-ast/cos/retained-writer.d.ts +1 -0
  20. package/dist/pdf-ast/cos/value-parser.d.ts +32 -2
  21. package/dist/pdf-ast/edit/retained-append-attachments.d.ts +13 -0
  22. package/dist/pdf-ast/edit/retained-bookmarks.d.ts +13 -0
  23. package/dist/pdf-ast/edit/retained-graph.d.ts +6 -0
  24. package/dist/pdf-ast/edit/retained-save.d.ts +2 -0
  25. package/dist/pdf-ast/edit/retained-stamps.d.ts +9 -0
  26. package/dist/pdf-ast/extract/retained-form-field-details.d.ts +20 -0
  27. package/dist/pdf-ast/extract/retained-form-fields.d.ts +17 -4
  28. package/dist/pdf-ast/fonts/resolve.d.ts +3 -1
  29. package/dist/pdf-ast/index.d.ts +4 -1
  30. package/dist/pdf-ast/index.js +2127 -975
  31. package/dist/pdf-ast/retained-document.d.ts +4 -0
  32. package/dist/safe-bash/audio-ast.browser.js +7 -1
  33. package/dist/safe-bash/chunks/{chunk-HHSOUC3Z.js → chunk-HPQE675Q.js} +1 -1
  34. package/dist/safe-bash/chunks/{chunk-BUYRKFW2.js → chunk-I6ECNJMR.js} +1 -1
  35. package/dist/safe-bash/chunks/{pdftk-WRYEP3CA.js → pdftk-Y2TX74LY.js} +2 -1
  36. package/dist/safe-bash/command-chunks/biff-4ALVARRF-7SRX6R6N.js +5192 -0
  37. package/dist/safe-bash/command-chunks/{chunk-EHSM5ZQS.js → chunk-2DGJOOXM.js} +8 -8
  38. package/dist/safe-bash/command-chunks/{chunk-Q6S57NOQ.js → chunk-2E2H7MBH.js} +7 -7
  39. package/dist/safe-bash/command-chunks/{chunk-MMBZTYXO.js → chunk-2PQRZDNR.js} +221 -0
  40. package/dist/safe-bash/command-chunks/{chunk-5OO2P27R.js → chunk-2V6FOLXV.js} +78 -25
  41. package/dist/safe-bash/command-chunks/{chunk-56NYSX65.js → chunk-2Z3WRRFT.js} +9 -9
  42. package/dist/safe-bash/command-chunks/chunk-3D24WDND.js +63 -0
  43. package/dist/safe-bash/command-chunks/{chunk-47NEG4UO.js → chunk-3JST2Q7G.js} +219 -43
  44. package/dist/safe-bash/command-chunks/{chunk-WGG6G2KG.js → chunk-3LJAXFH5.js} +7 -7
  45. package/dist/safe-bash/command-chunks/{chunk-AHA6IWAJ.js → chunk-3TYDSGAH.js} +6 -6
  46. package/dist/safe-bash/command-chunks/{chunk-YSMNXMAO.js → chunk-3Y4XZB24.js} +4 -4
  47. package/dist/safe-bash/command-chunks/{chunk-ZIIO6GRY.js → chunk-4PBNMKAT.js} +7 -7
  48. package/dist/safe-bash/command-chunks/{chunk-JFYWVQ4V.js → chunk-4Z6W5EOC.js} +8 -8
  49. package/dist/safe-bash/command-chunks/{chunk-GEM47B2P.js → chunk-57DDYKE5.js} +7 -7
  50. package/dist/safe-bash/command-chunks/{chunk-HARUYHH7.js → chunk-5HUICAWD.js} +1 -1
  51. package/dist/safe-bash/command-chunks/{chunk-4CKFNXRN.js → chunk-5IFRAI7Y.js} +1 -1
  52. package/dist/safe-bash/command-chunks/{chunk-RHYJVTJO.js → chunk-5KGEZ3RW.js} +2 -2
  53. package/dist/safe-bash/command-chunks/{chunk-A5FZBR7X.js → chunk-5MFDRSGG.js} +4 -4
  54. package/dist/safe-bash/command-chunks/{chunk-7GKKMNL6.js → chunk-5P6I2T63.js} +8 -8
  55. package/dist/safe-bash/command-chunks/{chunk-6M6TM5Z5.js → chunk-5VQVZPP3.js} +3 -3
  56. package/dist/safe-bash/command-chunks/{chunk-MIRL7HTF.js → chunk-6244HYJY.js} +1 -1
  57. package/dist/safe-bash/command-chunks/chunk-63EMPQ7Z.js +115 -0
  58. package/dist/safe-bash/command-chunks/{chunk-XRVKWGVQ.js → chunk-6CY5BHBS.js} +6 -6
  59. package/dist/safe-bash/command-chunks/{chunk-XVP6V5K3.js → chunk-6IWE7PTK.js} +6 -6
  60. package/dist/safe-bash/command-chunks/{chunk-6QBMND4A.js → chunk-6SRHWVEB.js} +1 -1
  61. package/dist/safe-bash/command-chunks/chunk-6ZHQB453.js +35 -0
  62. package/dist/safe-bash/command-chunks/chunk-73NYFNAS.js +173 -0
  63. package/dist/safe-bash/command-chunks/{chunk-VU3EQF7F.js → chunk-7NXTEWPR.js} +229 -75
  64. package/dist/safe-bash/command-chunks/{chunk-554Z6IKP.js → chunk-7PRL6RJ6.js} +2 -2
  65. package/dist/safe-bash/command-chunks/{chunk-SDTPO2VV.js → chunk-7PZHWMK6.js} +7 -7
  66. package/dist/safe-bash/command-chunks/{chunk-XZ2FWFNV.js → chunk-7QZ2HP2F.js} +6 -6
  67. package/dist/safe-bash/command-chunks/{chunk-OEJM666F.js → chunk-7UC2Q6Z6.js} +5 -5
  68. package/dist/safe-bash/command-chunks/{chunk-COKYZUBW.js → chunk-AJI55RS7.js} +1 -1
  69. package/dist/safe-bash/command-chunks/{chunk-2VCKUNDZ.js → chunk-B2C3UPJS.js} +27 -17
  70. package/dist/safe-bash/command-chunks/{chunk-WXRYDALR.js → chunk-BBAB7LC4.js} +4 -4
  71. package/dist/safe-bash/command-chunks/{chunk-QYMEASQ6.js → chunk-BEHUSUOY.js} +4 -4
  72. package/dist/safe-bash/command-chunks/{chunk-Z2JW6M2D.js → chunk-BK7ISUJL.js} +3 -3
  73. package/dist/safe-bash/command-chunks/{chunk-33YCKZZX.js → chunk-C5KLFZGT.js} +6 -6
  74. package/dist/safe-bash/command-chunks/{chunk-TVH4JORU.js → chunk-C5QDEB3I.js} +3 -3
  75. package/dist/safe-bash/command-chunks/{chunk-N4R2SHSS.js → chunk-CCZZVCHX.js} +2 -2
  76. package/dist/safe-bash/command-chunks/{chunk-2VLAXKTS.js → chunk-CTDC4LJT.js} +121 -85
  77. package/dist/safe-bash/command-chunks/{chunk-S6R3IB36.js → chunk-D55REQA3.js} +1 -1
  78. package/dist/safe-bash/command-chunks/{chunk-Y4EYCZFT.js → chunk-D6WJY6QO.js} +10 -10
  79. package/dist/safe-bash/command-chunks/{chunk-2CORNDGF.js → chunk-DBLHCJJU.js} +2 -2
  80. package/dist/safe-bash/command-chunks/{chunk-SPW4GW4Z.js → chunk-DFI7QF3M.js} +2 -2
  81. package/dist/safe-bash/command-chunks/{chunk-456PHA3L.js → chunk-DMCI6T6N.js} +1 -1
  82. package/dist/safe-bash/command-chunks/{chunk-TW73OXPR.js → chunk-EJTNVXWF.js} +6 -6
  83. package/dist/safe-bash/command-chunks/{chunk-QD7ZRDUN.js → chunk-ET2VPDUA.js} +1 -1
  84. package/dist/safe-bash/command-chunks/{chunk-5LI2DLNZ.js → chunk-EXOQGXEU.js} +26 -26
  85. package/dist/safe-bash/command-chunks/{chunk-CRV2Q3PB.js → chunk-EZ4NQIPL.js} +1 -1
  86. package/dist/safe-bash/command-chunks/chunk-FWKLBDMK.js +0 -0
  87. package/dist/safe-bash/command-chunks/{chunk-22MOB45U.js → chunk-FWPVQGYK.js} +6 -6
  88. package/dist/safe-bash/command-chunks/{chunk-QC5RMGSA.js → chunk-G3RUXKVY.js} +3 -3
  89. package/dist/safe-bash/command-chunks/{chunk-JYUJAF4L.js → chunk-G7NENPYV.js} +4 -0
  90. package/dist/safe-bash/command-chunks/{chunk-KCOJA7EM.js → chunk-GKILM4HZ.js} +7 -7
  91. package/dist/safe-bash/command-chunks/{chunk-HTVIYLVB.js → chunk-GNXTMSYN.js} +4 -4
  92. package/dist/safe-bash/command-chunks/{chunk-D2ASPM7R.js → chunk-GOBUDKZ3.js} +3 -3
  93. package/dist/safe-bash/command-chunks/{chunk-RNSKXOG3.js → chunk-GVWVRPG6.js} +6 -6
  94. package/dist/safe-bash/command-chunks/{chunk-ZHRGYR7B.js → chunk-HCKYUQ3L.js} +7 -7
  95. package/dist/safe-bash/command-chunks/{chunk-AGLK7OJR.js → chunk-HDSIIQBS.js} +1 -1
  96. package/dist/safe-bash/command-chunks/{chunk-DM2CPMB4.js → chunk-HKOMXGJS.js} +2 -2
  97. package/dist/safe-bash/command-chunks/{chunk-IT7TAC3F.js → chunk-HVW53ARH.js} +16 -16
  98. package/dist/safe-bash/command-chunks/{chunk-M7QE2MN7.js → chunk-I4GMCWAT.js} +6 -6
  99. package/dist/safe-bash/command-chunks/{chunk-5MB64DWR.js → chunk-IHSOOSNC.js} +9 -9
  100. package/dist/safe-bash/command-chunks/{chunk-LCZDBW55.js → chunk-JAHJWVGF.js} +5 -5
  101. package/dist/safe-bash/command-chunks/{chunk-MOZD7RUY.js → chunk-JORIVUPM.js} +27 -11
  102. package/dist/safe-bash/command-chunks/{chunk-PMAM4N33.js → chunk-JUJHYPYL.js} +9 -9
  103. package/dist/safe-bash/command-chunks/{chunk-ENT3IV2G.js → chunk-KBUBSMCQ.js} +12 -12
  104. package/dist/safe-bash/command-chunks/{chunk-ZXR6LXV5.js → chunk-KCE5D4Z4.js} +48 -4
  105. package/dist/safe-bash/command-chunks/{chunk-FIIAYCWS.js → chunk-KZ5ODST6.js} +2 -2
  106. package/dist/safe-bash/command-chunks/{chunk-PNGDJA6M.js → chunk-LD7BONZY.js} +2 -2
  107. package/dist/safe-bash/command-chunks/{chunk-KJ4XXZIL.js → chunk-M3Z5PU2M.js} +582 -59
  108. package/dist/safe-bash/command-chunks/{chunk-LXLLA4PM.js → chunk-MKX4JAZ6.js} +17 -17
  109. package/dist/safe-bash/command-chunks/{chunk-RQIQ75W5.js → chunk-MNHBQBF6.js} +5 -5
  110. package/dist/safe-bash/command-chunks/{chunk-A2CLZMQZ.js → chunk-MPKY37QR.js} +1 -1
  111. package/dist/safe-bash/command-chunks/{chunk-K5GB2YMN.js → chunk-MUUWBZIC.js} +10 -10
  112. package/dist/safe-bash/command-chunks/{chunk-JOCFI7TG.js → chunk-N32GSM3J.js} +1 -1
  113. package/dist/safe-bash/command-chunks/{chunk-EUT24Y5Z.js → chunk-NKTULXVD.js} +8 -8
  114. package/dist/safe-bash/command-chunks/{chunk-5HPU7D36.js → chunk-NMPED6L5.js} +4 -4
  115. package/dist/safe-bash/command-chunks/{chunk-QZZ73J2O.js → chunk-NPFHUS4X.js} +6 -6
  116. package/dist/safe-bash/command-chunks/{chunk-X7FA7ZD5.js → chunk-O675URF4.js} +8 -8
  117. package/dist/safe-bash/command-chunks/{chunk-R6EGGK5M.js → chunk-P7EL2FWW.js} +7 -7
  118. package/dist/safe-bash/command-chunks/{chunk-YS25EI54.js → chunk-PCCFLPUQ.js} +2 -2
  119. package/dist/safe-bash/command-chunks/{chunk-RRL3Y562.js → chunk-PI6MOMHA.js} +11 -11
  120. package/dist/safe-bash/command-chunks/{chunk-26VCZHLJ.js → chunk-PIOQBOEK.js} +1 -1
  121. package/dist/safe-bash/command-chunks/chunk-PK36TVXB.js +175 -0
  122. package/dist/safe-bash/command-chunks/{chunk-72C3TZ2U.js → chunk-PKLJRB7W.js} +264 -129
  123. package/dist/safe-bash/command-chunks/{chunk-6CCQI6XZ.js → chunk-PSCOXGCA.js} +12 -12
  124. package/dist/safe-bash/command-chunks/{chunk-XPD636C4.js → chunk-PVGZMLC6.js} +3 -3
  125. package/dist/safe-bash/command-chunks/{chunk-JQVHUSDD.js → chunk-PXWS3Q7L.js} +5 -5
  126. package/dist/safe-bash/command-chunks/{chunk-HDJVJTCK.js → chunk-QFF5KBOM.js} +9 -9
  127. package/dist/safe-bash/command-chunks/{chunk-MPUHH2KR.js → chunk-QM2HZJSJ.js} +3 -3
  128. package/dist/safe-bash/command-chunks/{chunk-UAXSE3XE.js → chunk-R2BMZAHG.js} +5 -5
  129. package/dist/safe-bash/command-chunks/{chunk-KB7DUBVL.js → chunk-RGOQKIG6.js} +5 -5
  130. package/dist/safe-bash/command-chunks/{chunk-D2KZ66W4.js → chunk-RLCQ7BN3.js} +187 -39
  131. package/dist/safe-bash/command-chunks/{chunk-B5LDP7AA.js → chunk-S2N2V5U4.js} +2 -2
  132. package/dist/safe-bash/command-chunks/{chunk-OA75SGN2.js → chunk-SGPCXAG7.js} +7 -7
  133. package/dist/safe-bash/command-chunks/{chunk-Z5QOVRVH.js → chunk-SU26FZLJ.js} +1 -1
  134. package/dist/safe-bash/command-chunks/{chunk-QUM3SYAJ.js → chunk-SYSX46IV.js} +3 -3
  135. package/dist/safe-bash/command-chunks/chunk-T3E5RV3U.js +737 -0
  136. package/dist/safe-bash/command-chunks/{chunk-YORJDX4V.js → chunk-T5ERNELL.js} +4 -4
  137. package/dist/safe-bash/command-chunks/{chunk-KL3OIBKB.js → chunk-T6C5QP7T.js} +6495 -6343
  138. package/dist/safe-bash/command-chunks/{chunk-ATTWQVR2.js → chunk-TKRLZIFI.js} +17 -17
  139. package/dist/safe-bash/command-chunks/{chunk-ZMHEGDU2.js → chunk-TODWFDYB.js} +2 -2
  140. package/dist/safe-bash/command-chunks/{chunk-YSY6R6AS.js → chunk-TQEB4DH4.js} +703 -102
  141. package/dist/safe-bash/command-chunks/{chunk-36XGIPOG.js → chunk-U5TWQFZY.js} +1 -1
  142. package/dist/safe-bash/command-chunks/{chunk-APEWTWCC.js → chunk-UAF4IX5H.js} +6 -6
  143. package/dist/safe-bash/command-chunks/{chunk-6VPQ3CDZ.js → chunk-V37D6AHO.js} +5 -5
  144. package/dist/safe-bash/command-chunks/{chunk-RID6VYS3.js → chunk-V6XBEYPC.js} +8 -8
  145. package/dist/safe-bash/command-chunks/{chunk-WJCN2IXI.js → chunk-VQOINPVF.js} +2 -2
  146. package/dist/safe-bash/command-chunks/{chunk-W5YSINXC.js → chunk-VVWXY6IA.js} +6 -6
  147. package/dist/safe-bash/command-chunks/{chunk-HKATEVAP.js → chunk-WPVBUVFK.js} +6 -6
  148. package/dist/safe-bash/command-chunks/{chunk-UYWSIIUX.js → chunk-X53AEG36.js} +7 -7
  149. package/dist/safe-bash/command-chunks/{chunk-L5MCW6CM.js → chunk-X64XGIXZ.js} +9 -155
  150. package/dist/safe-bash/command-chunks/{chunk-Q73EMLLZ.js → chunk-X6RHJ6YN.js} +84 -5
  151. package/dist/safe-bash/command-chunks/{chunk-7PVHO47B.js → chunk-XG6UWQV5.js} +6 -6
  152. package/dist/safe-bash/command-chunks/{chunk-NQDIT667.js → chunk-XIDGHIGB.js} +5 -5
  153. package/dist/safe-bash/command-chunks/{chunk-DPR5CYQV.js → chunk-XITDDJFT.js} +2 -0
  154. package/dist/safe-bash/command-chunks/{chunk-CV7M2QJU.js → chunk-XLYIVBAR.js} +7 -7
  155. package/dist/safe-bash/command-chunks/{chunk-WVMHRNXZ.js → chunk-YUXTK3XA.js} +3 -3
  156. package/dist/safe-bash/command-chunks/{chunk-SPLOIABU.js → chunk-YXD6VGVG.js} +3 -3
  157. package/dist/safe-bash/command-chunks/{chunk-2ZFLMWOX.js → chunk-Z5BIM5B7.js} +1 -1
  158. package/dist/safe-bash/command-chunks/chunk-ZYLGNIGA.js +156 -0
  159. package/dist/safe-bash/command-chunks/{command-engine-BEWABZ75.js → command-engine-X3OLN7N6.js} +206 -86
  160. package/dist/safe-bash/command-chunks/{engine-AXXFTGCL-QBQNBI6K.js → engine-XUCIFZ7V-LJFGZM6O.js} +1 -1
  161. package/dist/safe-bash/command-chunks/paradox-4FCZE53D-LQPGVMEL.js +365 -0
  162. package/dist/safe-bash/commands/pandoc/index.browser.js +1 -1
  163. package/dist/safe-bash/full-core.browser.js +2 -2
  164. package/dist/safe-bash/plugins/index.browser.js +2 -2
  165. package/dist/safe-bash-command-apply-patch/apply.js +4 -4
  166. package/dist/safe-bash-command-apply-patch/index.js +4 -4
  167. package/dist/safe-bash-command-apply-patch/matcher.js +2 -2
  168. package/dist/safe-bash-command-apply-patch/parser.js +2 -2
  169. package/dist/safe-bash-command-apply-patch/shared.d.ts +2 -0
  170. package/dist/safe-bash-command-apply-patch/shared.js +1 -1
  171. package/dist/safe-bash-command-diff/diff.js +1 -1
  172. package/dist/safe-bash-command-diff/index.js +1 -1
  173. package/dist/safe-bash-command-ffmpeg/index.js +1 -1
  174. package/dist/safe-bash-command-ffprobe/index.js +2 -2
  175. package/dist/safe-bash-command-ffprobe/media.d.ts +3 -1
  176. package/dist/safe-bash-command-ffprobe/media.js +2 -2
  177. package/dist/safe-bash-command-html-to-markdown/budget.js +2 -1
  178. package/dist/safe-bash-command-html-to-markdown/entities.js +4 -3
  179. package/dist/safe-bash-command-html-to-markdown/index.js +564 -110
  180. package/dist/safe-bash-command-html-to-markdown/input.js +6 -5
  181. package/dist/safe-bash-command-html-to-markdown/options.js +2 -1
  182. package/dist/safe-bash-command-html-to-markdown/parser.js +5 -4
  183. package/dist/safe-bash-command-html-to-markdown/render.js +6 -5
  184. package/dist/safe-bash-command-html-to-markdown/text.js +3 -2
  185. package/dist/safe-bash-command-htmlq/index.js +361 -37
  186. package/dist/safe-bash-command-htmlq/tree.d.ts +3 -2
  187. package/dist/safe-bash-command-pandoc/command.js +7 -7
  188. package/dist/safe-bash-command-pandoc/index.js +55 -55
  189. package/dist/safe-bash-command-patch/index.js +6 -6
  190. package/dist/safe-bash-command-patch/patch-envelope.js +53 -3
  191. package/dist/safe-bash-command-patch/patch-formats.d.ts +2 -2
  192. package/dist/safe-bash-command-patch/patch-formats.js +2 -2
  193. package/dist/safe-bash-command-patch/patch-gnu-reject.d.ts +2 -1
  194. package/dist/safe-bash-command-patch/patch-gnu-reject.js +4 -3
  195. package/dist/safe-bash-command-patch/patch-publication.js +2 -1
  196. package/dist/safe-bash-command-patch/patch.js +6 -6
  197. package/dist/safe-bash-command-patch/unified.d.ts +10 -2
  198. package/dist/safe-bash-command-patch/unified.js +1 -1
  199. package/dist/safe-bash-command-pdftk/index.d.ts +6 -2
  200. package/dist/safe-bash-command-pdftk/index.js +835 -243
  201. package/dist/safe-bash-command-pptx/command-engine.d.ts +15 -3
  202. package/dist/safe-bash-command-pptx/engine.d.ts +2 -2
  203. package/dist/safe-bash-command-pptx/engine.js +1 -1
  204. package/dist/safe-bash-command-pptx/index.js +9 -2
  205. package/dist/safe-bash-command-soffice/index.js +1 -1
  206. package/dist/safe-bash-command-ssconvert/index.js +2 -2
  207. package/dist/safe-bash-command-xmllint/index.js +22 -31
  208. package/dist/safe-bash-diff-engine/document.d.ts +2 -1
  209. package/dist/safe-bash-diff-engine/document.js +7 -4
  210. package/dist/safe-bash-presentation-engine/accessibility.js +31 -30
  211. package/dist/safe-bash-presentation-engine/animation-editing.js +16 -15
  212. package/dist/safe-bash-presentation-engine/animations.js +16 -15
  213. package/dist/safe-bash-presentation-engine/backgrounds.js +17 -16
  214. package/dist/safe-bash-presentation-engine/bytes.js +3 -3
  215. package/dist/safe-bash-presentation-engine/chart-editing.js +34 -33
  216. package/dist/safe-bash-presentation-engine/chart-object-operations.js +25 -24
  217. package/dist/safe-bash-presentation-engine/charts.js +31 -30
  218. package/dist/safe-bash-presentation-engine/command-placeholder.js +59 -55
  219. package/dist/safe-bash-presentation-engine/comments.js +17 -16
  220. package/dist/safe-bash-presentation-engine/connector-operations.js +32 -31
  221. package/dist/safe-bash-presentation-engine/connectors.js +29 -28
  222. package/dist/safe-bash-presentation-engine/content-types.js +4 -4
  223. package/dist/safe-bash-presentation-engine/creation.js +6 -6
  224. package/dist/safe-bash-presentation-engine/diff.js +32 -31
  225. package/dist/safe-bash-presentation-engine/drawing-enums.d.ts +10 -10
  226. package/dist/safe-bash-presentation-engine/drawing-format.js +20 -19
  227. package/dist/safe-bash-presentation-engine/drawing-operations.js +31 -30
  228. package/dist/safe-bash-presentation-engine/drawing-schema.js +21 -20
  229. package/dist/safe-bash-presentation-engine/equations.js +17 -16
  230. package/dist/safe-bash-presentation-engine/errors.js +2 -2
  231. package/dist/safe-bash-presentation-engine/fields.js +17 -16
  232. package/dist/safe-bash-presentation-engine/font-metrics.js +3 -3
  233. package/dist/safe-bash-presentation-engine/image-extraction.js +20 -19
  234. package/dist/safe-bash-presentation-engine/image-formatting.js +32 -31
  235. package/dist/safe-bash-presentation-engine/image-insertion.js +18 -17
  236. package/dist/safe-bash-presentation-engine/image-replacement.js +21 -20
  237. package/dist/safe-bash-presentation-engine/image-value.js +4 -4
  238. package/dist/safe-bash-presentation-engine/images.js +19 -18
  239. package/dist/safe-bash-presentation-engine/index.d.ts +6 -2
  240. package/dist/safe-bash-presentation-engine/index.js +112 -97
  241. package/dist/safe-bash-presentation-engine/layouts.js +16 -15
  242. package/dist/safe-bash-presentation-engine/length.js +3 -3
  243. package/dist/safe-bash-presentation-engine/links.js +16 -15
  244. package/dist/safe-bash-presentation-engine/masters.js +15 -14
  245. package/dist/safe-bash-presentation-engine/media-editing.js +24 -23
  246. package/dist/safe-bash-presentation-engine/media-extraction.js +17 -16
  247. package/dist/safe-bash-presentation-engine/media.js +16 -15
  248. package/dist/safe-bash-presentation-engine/memberships.js +15 -14
  249. package/dist/safe-bash-presentation-engine/notes.js +16 -15
  250. package/dist/safe-bash-presentation-engine/ole-enum.js +4 -4
  251. package/dist/safe-bash-presentation-engine/ole-insertion.js +20 -19
  252. package/dist/safe-bash-presentation-engine/opaque-objects.js +9 -9
  253. package/dist/safe-bash-presentation-engine/package-reader.js +5 -5
  254. package/dist/safe-bash-presentation-engine/package-tools.d.ts +3 -0
  255. package/dist/safe-bash-presentation-engine/package-tools.js +27 -17
  256. package/dist/safe-bash-presentation-engine/package-uri.js +3 -3
  257. package/dist/safe-bash-presentation-engine/package-writer.js +4 -4
  258. package/dist/safe-bash-presentation-engine/presentation-model.js +58 -54
  259. package/dist/safe-bash-presentation-engine/presentation-settings.js +14 -13
  260. package/dist/safe-bash-presentation-engine/properties.js +16 -15
  261. package/dist/safe-bash-presentation-engine/relationships.js +4 -4
  262. package/dist/safe-bash-presentation-engine/resource-limits.js +1 -1
  263. package/dist/safe-bash-presentation-engine/retained-archive-staging.d.ts +19 -0
  264. package/dist/safe-bash-presentation-engine/retained-extraction-output.d.ts +18 -0
  265. package/dist/safe-bash-presentation-engine/retained-inspection.js +14 -12
  266. package/dist/safe-bash-presentation-engine/retained-package-extraction.d.ts +22 -0
  267. package/dist/safe-bash-presentation-engine/retained-package-packing.d.ts +19 -0
  268. package/dist/safe-bash-presentation-engine/retained-package.d.ts +2 -0
  269. package/dist/safe-bash-presentation-engine/retained-package.js +6 -4
  270. package/dist/safe-bash-presentation-engine/retained-slide-publication.d.ts +24 -0
  271. package/dist/safe-bash-presentation-engine/retained-text.js +19 -17
  272. package/dist/safe-bash-presentation-engine/retained-xml-parts.d.ts +5 -1
  273. package/dist/safe-bash-presentation-engine/retained-xml-publication.d.ts +18 -0
  274. package/dist/safe-bash-presentation-engine/retained-xml-replacement.d.ts +13 -0
  275. package/dist/safe-bash-presentation-engine/sanitize.js +17 -16
  276. package/dist/safe-bash-presentation-engine/selectors.js +10 -10
  277. package/dist/safe-bash-presentation-engine/shape-groups.js +31 -30
  278. package/dist/safe-bash-presentation-engine/shape-operations.js +30 -29
  279. package/dist/safe-bash-presentation-engine/shape-path-operations.js +32 -31
  280. package/dist/safe-bash-presentation-engine/shape-paths.js +16 -15
  281. package/dist/safe-bash-presentation-engine/shape-presets.js +3 -3
  282. package/dist/safe-bash-presentation-engine/shape-selection.js +31 -30
  283. package/dist/safe-bash-presentation-engine/shape-transforms.js +18 -17
  284. package/dist/safe-bash-presentation-engine/shapes.d.ts +1 -1
  285. package/dist/safe-bash-presentation-engine/shapes.js +27 -26
  286. package/dist/safe-bash-presentation-engine/slide-copy.js +17 -16
  287. package/dist/safe-bash-presentation-engine/slide-import.js +18 -17
  288. package/dist/safe-bash-presentation-engine/slide-merge-split.js +20 -19
  289. package/dist/safe-bash-presentation-engine/slide-model.js +43 -42
  290. package/dist/safe-bash-presentation-engine/slide-removal.js +18 -17
  291. package/dist/safe-bash-presentation-engine/slide-transfer-budget.js +9 -9
  292. package/dist/safe-bash-presentation-engine/slides.d.ts +1 -0
  293. package/dist/safe-bash-presentation-engine/slides.js +23 -17
  294. package/dist/safe-bash-presentation-engine/table-operations.js +33 -32
  295. package/dist/safe-bash-presentation-engine/table-spans.js +32 -31
  296. package/dist/safe-bash-presentation-engine/tables.js +31 -30
  297. package/dist/safe-bash-presentation-engine/tags.js +16 -15
  298. package/dist/safe-bash-presentation-engine/template-bindings.js +33 -32
  299. package/dist/safe-bash-presentation-engine/template-repeat.js +40 -39
  300. package/dist/safe-bash-presentation-engine/text-fitting.js +27 -26
  301. package/dist/safe-bash-presentation-engine/text-frames.js +27 -26
  302. package/dist/safe-bash-presentation-engine/text-paragraphs.js +27 -26
  303. package/dist/safe-bash-presentation-engine/text-reading.js +11 -11
  304. package/dist/safe-bash-presentation-engine/text-replacement.js +17 -16
  305. package/dist/safe-bash-presentation-engine/text-runs.js +20 -19
  306. package/dist/safe-bash-presentation-engine/themes.js +16 -15
  307. package/dist/safe-bash-presentation-engine/transitions.js +16 -15
  308. package/dist/safe-bash-presentation-engine/validation.js +10 -9
  309. package/dist/safe-bash-presentation-engine/xml-parts.d.ts +2 -0
  310. package/dist/safe-bash-presentation-engine/xml-parts.js +23 -15
  311. package/dist/safe-bash-presentation-engine/xml-view.js +3 -3
  312. package/dist/safe-bash-presentation-engine/xml.js +3 -3
  313. package/dist/safe-bash-regex-engine/index.js +1 -1
  314. package/dist/safe-bash-regex-engine/python-glob.js +1 -1
  315. package/dist/safe-bash-regex-engine/text/regex.d.ts +19 -0
  316. package/dist/safe-bash-regex-engine/text/regex.js +1 -1
  317. package/dist/safe-bash-xml-engine/document.js +3 -3
  318. package/dist/safe-bash-xml-engine/evaluate.js +1 -1
  319. package/dist/safe-bash-xml-engine/index.d.ts +1 -0
  320. package/dist/safe-bash-xml-engine/index.js +8 -4
  321. package/dist/safe-bash-xml-engine/query.js +2 -2
  322. package/dist/safe-bash-xml-engine/recovery.d.ts +10 -0
  323. package/dist/safe-bash-xml-engine/stored-document.d.ts +1 -1
  324. package/dist/safe-bash-xml-engine/stored-document.js +1 -1
  325. package/dist/safe-bash-xml-engine/stored-evaluate.js +1 -1
  326. package/dist/spreadsheet-engine/formulas/functions/python-printf.js +56 -33
  327. package/dist/spreadsheet-format-xls/biff-encrypted-properties.d.ts +2 -2
  328. package/dist/spreadsheet-format-xls/biff-encrypted-properties.js +86 -24
  329. package/dist/spreadsheet-format-xls/biff-metadata.d.ts +1 -0
  330. package/dist/spreadsheet-format-xls/biff-metadata.js +2 -2
  331. package/dist/spreadsheet-format-xls/biff-properties-merge.d.ts +6 -2
  332. package/dist/spreadsheet-format-xls/biff-properties-merge.js +413 -296
  333. package/dist/spreadsheet-format-xls/biff-properties-write.js +40 -23
  334. package/dist/spreadsheet-format-xls/biff-properties.js +3 -68
  335. package/dist/spreadsheet-format-xls/biff-property-index.d.ts +23 -0
  336. package/dist/spreadsheet-format-xls/biff-property-index.js +93 -0
  337. package/dist/spreadsheet-format-xls/biff-property-name.d.ts +4 -0
  338. package/dist/spreadsheet-format-xls/biff-property-name.js +114 -0
  339. package/dist/spreadsheet-format-xls/biff-property-text.d.ts +6 -0
  340. package/dist/spreadsheet-format-xls/biff-property-text.js +68 -0
  341. package/dist/spreadsheet-format-xls/biff-property-transcode.d.ts +5 -0
  342. package/dist/spreadsheet-format-xls/biff-property-transcode.js +45 -0
  343. package/dist/spreadsheet-format-xls/biff-write-metadata.js +10 -1
  344. package/package.json +6 -3
  345. package/dist/safe-bash/command-chunks/biff-3EFLKBAH-NYWZOYQS.js +0 -4942
  346. package/dist/safe-bash/command-chunks/chunk-5Q22ZLNC.js +0 -127
  347. package/dist/safe-bash/command-chunks/chunk-JKLOBSMP.js +0 -56
  348. package/dist/safe-bash/command-chunks/chunk-JYTESTBS.js +0 -99
  349. package/dist/safe-bash/command-chunks/chunk-WH3TIOTS.js +0 -326
  350. package/dist/safe-bash/command-chunks/paradox-ZWWXYY4J-JYOSWSBL.js +0 -362
  351. package/dist/spreadsheet-format-xls/biff-properties-layout.js +0 -56
@@ -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 OfficeError(
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 OfficeError) || error.code !== "missing-binding") throw error;
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 OfficeError(
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 OfficeError("resource-limit", "Capability XML node limit exceeded.", "index");
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 OfficeError2 } from "../../safe-bash-presentation-engine/errors.js";
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 OfficeError2("invalid-value", message, "usage");
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 OfficeError3 } from "../../safe-bash-presentation-engine/errors.js";
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 OfficeError3(
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 OfficeError3("invalid-value", "Length is outside the supported range.", "usage");
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 OfficeError3(
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 OfficeError3(
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 OfficeError4 } from "../../safe-bash-presentation-engine/errors.js";
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 OfficeError4("invalid-value", message, "usage");
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 OfficeError4(
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 OfficeError4(
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 OfficeError4("resource-limit", "Manifest exceeds byte limit.", "admit");
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 OfficeError4("resource-limit", "Manifest exceeds member limit.", "admit");
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 OfficeError4("resource-limit", "Manifest contents exceed byte limit.", "admit");
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 OfficeError4("resource-limit", "Packed output exceeds byte limit.", "validate-intent");
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 OfficeError5 } from "../../safe-bash-presentation-engine/errors.js";
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 OfficeError5 ? error : void 0;
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 OfficeError5("invalid-value", message, "usage");
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 OfficeError5("resource-limit", "Argument limit exceeded.", "admit");
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 OfficeError5(
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 OfficeError5("resource-limit", "Comparison output limit exceeded.", "admit")
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 OfficeError6 } from "../../safe-bash-presentation-engine/errors.js";
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 OfficeError6("invalid-value", message, "usage");
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 OfficeError7 } from "../../safe-bash-presentation-engine/errors.js";
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 OfficeError7("invalid-value", message, "usage");
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 OfficeError8 } from "../../safe-bash-presentation-engine/errors.js";
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 OfficeError8("invalid-value", message, "usage");
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 OfficeError9 } from "../../safe-bash-presentation-engine/errors.js";
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 OfficeError9("invalid-value", message, "usage");
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 OfficeError10 } from "../../safe-bash-presentation-engine/errors.js";
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 OfficeError10("invalid-value", message, "usage");
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 OfficeError11 } from "../../safe-bash-presentation-engine/errors.js";
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 OfficeError11("invalid-value", message, "usage");
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 OfficeError11(
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 OfficeError12 } from "../../safe-bash-presentation-engine/errors.js";
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 OfficeError12("invalid-value", message, "usage");
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 OfficeError13 } from "../../safe-bash-presentation-engine/errors.js";
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 OfficeError13("invalid-value", message, "usage");
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 OfficeError14 } from "../../safe-bash-presentation-engine/errors.js";
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 OfficeError14("invalid-value", message, "usage");
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 OfficeError14("resource-limit", "Opaque output count exceeds limit.", "validate-intent");
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 OfficeError15 } from "../../safe-bash-presentation-engine/errors.js";
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 OfficeError15("invalid-value", message, "usage");
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 OfficeError16 } from "../../safe-bash-presentation-engine/errors.js";
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 {
@@ -8781,7 +8832,8 @@ import {
8781
8832
  import { createPresentation } from "../../safe-bash-presentation-engine/creation.js";
8782
8833
  import {
8783
8834
  addSlide,
8784
- mutateSlides
8835
+ mutateSlides,
8836
+ stageRetainedSlideSettings
8785
8837
  } from "../../safe-bash-presentation-engine/slides.js";
8786
8838
  import { duplicateSlides } from "../../safe-bash-presentation-engine/slide-copy.js";
8787
8839
  import { importSlides } from "../../safe-bash-presentation-engine/slide-import.js";
@@ -8793,7 +8845,7 @@ import {
8793
8845
  readPresentationSettings,
8794
8846
  mutatePresentationSettings
8795
8847
  } from "../../safe-bash-presentation-engine/presentation-settings.js";
8796
- 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";
8797
8849
  import { validatePresentation, openRetainedPresentationValidation } from "../../safe-bash-presentation-engine/validation.js";
8798
8850
  import { readPackage as readPackage3 } from "../../safe-bash-presentation-engine/package-reader.js";
8799
8851
  import { resourceContext } from "../../safe-bash-presentation-engine/resource-limits.js";
@@ -8963,7 +9015,7 @@ Slides add requires an exact layout name or part URI; position defaults to appen
8963
9015
  Title/body match placeholder types; indexed bindings use --placeholders-json.
8964
9016
  `;
8965
9017
  function usage12(message) {
8966
- throw new OfficeError16("invalid-value", message, "usage");
9018
+ throw new OfficeError17("invalid-value", message, "usage");
8967
9019
  }
8968
9020
  function paragraphTabLength(length4) {
8969
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")
@@ -9222,7 +9274,7 @@ function parse(raw, maximum, output3) {
9222
9274
  size += bytes.length + 1;
9223
9275
  if (size > maximum) {
9224
9276
  if (invalidUtf8) usage12("Arguments must be UTF-8.");
9225
- throw new OfficeError16("resource-limit", "Argument limit exceeded.", "usage");
9277
+ throw new OfficeError17("resource-limit", "Argument limit exceeded.", "usage");
9226
9278
  }
9227
9279
  try {
9228
9280
  args.push(decoder.decode(bytes));
@@ -9874,7 +9926,7 @@ function parse(raw, maximum, output3) {
9874
9926
  try {
9875
9927
  parsed = admitFontMetrics(JSON.parse(value));
9876
9928
  } catch (error) {
9877
- if (error instanceof OfficeError16) throw error;
9929
+ if (error instanceof OfficeError17) throw error;
9878
9930
  usage12("Metrics require a valid JSON metric object.");
9879
9931
  }
9880
9932
  } else if (["bold", "italic", "wrap"].includes(key)) {
@@ -11600,7 +11652,7 @@ async function transferLocations(bytes, budget) {
11600
11652
  (edge) => relationshipNamespaces.some((namespace) => edge.type === `${namespace}/officeDocument`)
11601
11653
  );
11602
11654
  const root = roots.length === 1 ? roots[0].targetPart : void 0;
11603
- if (!root) throw new OfficeError16("invalid-opc", "Presentation part is missing.", "index");
11655
+ if (!root) throw new OfficeError17("invalid-opc", "Presentation part is missing.", "index");
11604
11656
  const relationshipNamespace = roots[0].type.slice(0, -"/officeDocument".length);
11605
11657
  const xml = budget.xml(reader.get(root));
11606
11658
  const fingerprint = Array.from(sha2564(bytes), (byte) => byte.toString(16).padStart(2, "0")).join(
@@ -11619,7 +11671,7 @@ async function transferLocations(bytes, budget) {
11619
11671
  (edge) => edge.id === reference && edge.type === `${relationshipNamespace}/slide`
11620
11672
  )?.targetPart;
11621
11673
  if (!id || !owner || !reader.has(owner))
11622
- throw new OfficeError16("invalid-opc", "Referenced slide is missing.", "index");
11674
+ throw new OfficeError17("invalid-opc", "Referenced slide is missing.", "index");
11623
11675
  return {
11624
11676
  fingerprint,
11625
11677
  scope: "slides",
@@ -11683,10 +11735,11 @@ var declaredOperations = {
11683
11735
  "xml.set": xmlSetSchema,
11684
11736
  capabilities: capabilitiesSchema
11685
11737
  };
11686
- async function execute(request, options2) {
11738
+ async function executeRequest(request, options2, owned) {
11687
11739
  if (request.args?.[0] instanceof Uint8Array && request.args[0].length === 4 && request.args[0].every((byte, index) => byte === [100, 105, 102, 102][index]))
11688
11740
  return executeDiffCommand(request, options2);
11689
11741
  const output3 = { json: false, operation: "help" };
11742
+ let retainedExtraction;
11690
11743
  let result;
11691
11744
  let exitCode = 0;
11692
11745
  let stagedOutput;
@@ -11727,7 +11780,54 @@ async function execute(request, options2) {
11727
11780
  output3.json = args.json;
11728
11781
  output3.operation = args.operation;
11729
11782
  const operation2 = args.operation;
11730
- if ((args.operation === "inspect" || args.operation === "text.get" || args.operation === "fields.list" || args.operation === "fields.get" || args.operation === "xml.get") && request.streaming) {
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) {
11814
+ if (args.token) decodeSelectionToken2(args.token);
11815
+ const input = await request.streaming.openInput(args.input, Math.min(options2.context.limits.maxBytes, options2.context.archiveLimits.maxArchiveBytes));
11816
+ const destination = args.inPlace ? args.input : args.output;
11817
+ const dryRun = args.dryRun ?? false;
11818
+ const staged = await stageRetainedSlideSettings(input, {
11819
+ ...args.mutation,
11820
+ selection: args.selection ?? (args.token ? { token: args.token } : { kind: "slide", ...args.slide === void 0 ? {} : { position: { coordinateSystem: "one-based", value: args.slide } }, ...args.all ? { all: true } : {} }),
11821
+ allowEmpty: args.allowEmpty ?? false
11822
+ }, { ...options2.context, signal: request.signal, workingStorage: request.streaming.workingStorage }, { json: args.json, dryRun, ...destination === void 0 ? {} : { destination }, maxOutputBytes: options2.maxOutputBytes });
11823
+ owned.push(staged);
11824
+ stagedOutput = staged.output;
11825
+ if (destination && destination !== "-") {
11826
+ if (!request.publishOutput) throw Object.assign(new Error("Output publication capability is unavailable."), { code: "publication-unsupported" });
11827
+ publication = { inputPath: args.input, outputPath: destination, bytes: staged.bytes(), originalBytes: input, inPlace: args.inPlace ?? false, force: args.force ?? false, dryRun };
11828
+ }
11829
+ result = success(operation2, null);
11830
+ } else if ((args.operation === "inspect" || args.operation === "text.get" || args.operation === "fields.list" || args.operation === "fields.get" || args.operation === "xml.get") && request.streaming) {
11731
11831
  if (args.token) decodeSelectionToken2(args.token);
11732
11832
  const input = await request.streaming.openInput(args.input, Math.min(options2.context.limits.maxBytes, options2.context.archiveLimits.maxArchiveBytes));
11733
11833
  const hash = sha2564.create();
@@ -11762,7 +11862,7 @@ async function execute(request, options2) {
11762
11862
  }, context, { json: args.json, maxOutputBytes: options2.maxOutputBytes });
11763
11863
  } catch (error) {
11764
11864
  failed = true;
11765
- if (error instanceof OfficeError16 && error.code === "resource-limit" && error.phase === "publish") return outputLimitFailure(operation2, args.json);
11865
+ if (error instanceof OfficeError17 && error.code === "resource-limit" && error.phase === "publish") return outputLimitFailure(operation2, args.json);
11766
11866
  throw error;
11767
11867
  } finally {
11768
11868
  try {
@@ -11787,7 +11887,7 @@ async function execute(request, options2) {
11787
11887
  let failed = false;
11788
11888
  try {
11789
11889
  validation = await openRetainedPresentationValidation(archive, context, limits);
11790
- if (!validation.valid) throw new OfficeError16("invalid-opc", "Presentation semantic validation failed.", "index");
11890
+ if (!validation.valid) throw new OfficeError17("invalid-opc", "Presentation semantic validation failed.", "index");
11791
11891
  result = success(operation2, { valid: true, schema: validation.schema, rules: validation.rules, issues: [] });
11792
11892
  } catch (error) {
11793
11893
  failed = true;
@@ -11802,7 +11902,7 @@ async function execute(request, options2) {
11802
11902
  const bytes = await request.readInput(args.input, maxBytes);
11803
11903
  const reader = await readPackage3(bytes, { ...options2.context, signal: request.signal });
11804
11904
  const validation = validatePresentation(reader, limits);
11805
- if (!validation.valid) throw new OfficeError16("invalid-opc", "Presentation semantic validation failed.", "index");
11905
+ if (!validation.valid) throw new OfficeError17("invalid-opc", "Presentation semantic validation failed.", "index");
11806
11906
  result = success(operation2, validation);
11807
11907
  }
11808
11908
  human = "Presentation is semantically valid; XML schema validation not checked.\n";
@@ -13398,13 +13498,13 @@ ${item.parts.map((part) => ` ${part}
13398
13498
  const inputs = [];
13399
13499
  for (const path of [args.input, ...args.sources ?? []]) {
13400
13500
  if (remaining < 1)
13401
- throw new OfficeError16("resource-limit", "Combined input limit exceeded.", "admit");
13501
+ throw new OfficeError17("resource-limit", "Combined input limit exceeded.", "admit");
13402
13502
  const bytes = await request.readInput(
13403
13503
  path,
13404
13504
  Math.min(remaining, context.archiveLimits.maxArchiveBytes)
13405
13505
  );
13406
13506
  if (bytes.length > remaining || bytes.length > context.archiveLimits.maxArchiveBytes)
13407
- throw new OfficeError16("resource-limit", "Combined input limit exceeded.", "admit");
13507
+ throw new OfficeError17("resource-limit", "Combined input limit exceeded.", "admit");
13408
13508
  remaining -= bytes.length;
13409
13509
  inputs.push(await budget.read(bytes));
13410
13510
  }
@@ -13505,7 +13605,7 @@ ${JSON.stringify(result.data, null, 2)}
13505
13605
  }
13506
13606
  } else if (args.operation === "create") {
13507
13607
  if (args.template)
13508
- throw new OfficeError16(
13608
+ throw new OfficeError17(
13509
13609
  "unsupported-profile",
13510
13610
  "Template-based creation is unavailable.",
13511
13611
  "validate-intent"
@@ -13557,7 +13657,7 @@ ${JSON.stringify(result.data, null, 2)}
13557
13657
  );
13558
13658
  } catch (error) {
13559
13659
  if (error && typeof error === "object" && "code" in error && error.code === "resource-limit")
13560
- throw new OfficeError16("resource-limit", "Input limit exceeded.", "admit");
13660
+ throw new OfficeError17("resource-limit", "Input limit exceeded.", "admit");
13561
13661
  throw error;
13562
13662
  }
13563
13663
  const index = await readSelectionIndex2(bytes, { ...options2.context, signal: request.signal });
@@ -13702,7 +13802,7 @@ ${JSON.stringify(result.data, null, 2)}
13702
13802
  const part = metadata2 ?? records[0].part;
13703
13803
  const validationLimits = options2.context.validationLimits;
13704
13804
  if (!validationLimits)
13705
- throw new OfficeError16(
13805
+ throw new OfficeError17(
13706
13806
  "invalid-value",
13707
13807
  "XML operations require explicit validation limits.",
13708
13808
  "usage"
@@ -13778,9 +13878,10 @@ ${xml.xml}
13778
13878
  await stagedOutput?.close().catch(() => {
13779
13879
  });
13780
13880
  stagedOutput = void 0;
13881
+ if (error instanceof OfficeError17 && error.code === "resource-limit" && error.phase === "publish") return outputLimitFailure(output3.operation, output3.json);
13781
13882
  if (request.signal.aborted)
13782
13883
  return { exitCode: 130, stdout: new Uint8Array(), stderr: new Uint8Array() };
13783
- const office = error instanceof OfficeError16 ? error : void 0;
13884
+ const office = error instanceof OfficeError17 ? error : void 0;
13784
13885
  const capabilityCode = error && typeof error === "object" && "code" in error ? error.code : void 0;
13785
13886
  const limit = office?.code === "resource-limit" || capabilityCode === "resource-limit";
13786
13887
  const unsupported = capabilityCode === "publication-unsupported";
@@ -13806,24 +13907,9 @@ ${xml.xml}
13806
13907
  human = `pptx: ${diagnostic.code}: ${diagnostic.message}
13807
13908
  `;
13808
13909
  }
13809
- if (stagedOutput) {
13810
- let failed = false;
13811
- try {
13812
- await stagedOutput.write(request.streaming.stdout);
13813
- } catch (error) {
13814
- failed = true;
13815
- throw error;
13816
- } finally {
13817
- try {
13818
- await stagedOutput.close();
13819
- } catch (error) {
13820
- if (!failed) await Promise.reject(error);
13821
- }
13822
- }
13823
- return { exitCode: 0, stdout: new Uint8Array(), stderr: new Uint8Array() };
13824
- }
13910
+ if (retainedExtraction && result.ok) return retainedExtraction.publish();
13825
13911
  const { json, operation } = output3;
13826
- const encoded = binary ?? new TextEncoder().encode(
13912
+ const encoded = (stagedOutput ? new Uint8Array() : binary) ?? new TextEncoder().encode(
13827
13913
  json ? `${JSON.stringify(result)}
13828
13914
  ` : human ?? `${JSON.stringify(result.data, null, 2)}
13829
13915
  `
@@ -13893,11 +13979,12 @@ ${JSON.stringify(failure.data)}
13893
13979
  if (publication && result.ok) {
13894
13980
  try {
13895
13981
  request.signal.throwIfAborted();
13896
- await request.publishOutput(publication);
13982
+ if (publication.bytes instanceof Uint8Array) await request.publishOutput(publication);
13983
+ else if (request.streaming) await request.publishOutput(publication);
13897
13984
  } catch (error) {
13898
13985
  if (request.signal.aborted)
13899
13986
  return { exitCode: 130, stdout: new Uint8Array(), stderr: new Uint8Array() };
13900
- const office = error instanceof OfficeError16 ? error : void 0;
13987
+ const office = error instanceof OfficeError17 ? error : void 0;
13901
13988
  const rawCode = error && typeof error === "object" && "code" in error ? error.code : void 0;
13902
13989
  const code = typeof rawCode === "string" && [
13903
13990
  "resource-limit",
@@ -13933,6 +14020,22 @@ ${JSON.stringify(failure.data)}
13933
14020
  };
13934
14021
  }
13935
14022
  }
14023
+ if (stagedOutput) {
14024
+ let failed = false;
14025
+ try {
14026
+ await stagedOutput.write(request.streaming.stdout);
14027
+ } catch (error) {
14028
+ failed = true;
14029
+ throw error;
14030
+ } finally {
14031
+ try {
14032
+ await stagedOutput.close();
14033
+ } catch (error) {
14034
+ if (!failed) await Promise.reject(error);
14035
+ }
14036
+ }
14037
+ return { exitCode: 0, stdout: new Uint8Array(), stderr: new Uint8Array() };
14038
+ }
13936
14039
  if (operation === "validate" && request.streaming) {
13937
14040
  request.signal.throwIfAborted();
13938
14041
  await (json || result.ok ? request.streaming.stdout : request.streaming.stderr).write(encoded);
@@ -13945,6 +14048,23 @@ ${JSON.stringify(failure.data)}
13945
14048
  stderr: json || result.ok ? new Uint8Array() : encoded
13946
14049
  };
13947
14050
  }
14051
+ async function execute(request, options2) {
14052
+ const owned = [];
14053
+ let failed = false;
14054
+ try {
14055
+ const result = await executeRequest(request, options2, owned);
14056
+ failed = result.exitCode !== 0;
14057
+ return result;
14058
+ } catch (error) {
14059
+ failed = true;
14060
+ throw error;
14061
+ } finally {
14062
+ const results = await Promise.allSettled(owned.map((value) => value.close()));
14063
+ if (!failed) {
14064
+ for (const result of results) if (result.status === "rejected") await Promise.reject(result.reason);
14065
+ }
14066
+ }
14067
+ }
13948
14068
  function createPptxCommandEngine(settings = {}) {
13949
14069
  const context = resourceContext(settings.context);
13950
14070
  const options2 = {