@poe-platform/safe-bash 0.1.812 → 0.1.814

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 (602) hide show
  1. package/dist/audio-ast/id3-source.d.ts +27 -0
  2. package/dist/audio-ast/index.d.ts +4 -0
  3. package/dist/audio-ast/index.js +996 -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/image-ast/index.js +139 -9
  8. package/dist/mp4-ast/containers/adapters.d.ts +7 -0
  9. package/dist/mp4-ast/index.d.ts +2 -0
  10. package/dist/mp4-ast/mp4-sample-source.d.ts +52 -0
  11. package/dist/mp4-ast/mp4-source.d.ts +32 -0
  12. package/dist/office-xml/retained-xml-document.d.ts +14 -0
  13. package/dist/pdf-ast/ast.d.ts +2 -0
  14. package/dist/pdf-ast/content/dictionary-cursor.d.ts +15 -0
  15. package/dist/pdf-ast/content/evaluator.d.ts +4 -0
  16. package/dist/pdf-ast/content/range-operator-parser.d.ts +4 -0
  17. package/dist/pdf-ast/content/stored-dictionary.d.ts +10 -0
  18. package/dist/pdf-ast/cos/lexer.d.ts +8 -5
  19. package/dist/pdf-ast/cos/object-reader.d.ts +11 -3
  20. package/dist/pdf-ast/cos/range-parser.d.ts +4 -0
  21. package/dist/pdf-ast/cos/retained-objects.d.ts +1 -0
  22. package/dist/pdf-ast/cos/retained-writer.d.ts +1 -0
  23. package/dist/pdf-ast/cos/value-parser.d.ts +10 -0
  24. package/dist/pdf-ast/edit/retained-append-attachments.d.ts +13 -0
  25. package/dist/pdf-ast/edit/retained-bookmarks.d.ts +13 -0
  26. package/dist/pdf-ast/edit/retained-form-appearances.d.ts +10 -0
  27. package/dist/pdf-ast/edit/retained-graph.d.ts +12 -0
  28. package/dist/pdf-ast/edit/retained-info-updates.d.ts +33 -0
  29. package/dist/pdf-ast/edit/retained-save.d.ts +2 -0
  30. package/dist/pdf-ast/edit/retained-stamps.d.ts +9 -0
  31. package/dist/pdf-ast/fonts/resolve.d.ts +3 -1
  32. package/dist/pdf-ast/index.d.ts +3 -1
  33. package/dist/pdf-ast/index.js +1966 -844
  34. package/dist/pdf-ast/retained-document.d.ts +5 -0
  35. package/dist/safe-bash/audio-ast.browser.js +6 -1
  36. package/dist/safe-bash/chunks/{chunk-HHSOUC3Z.js → chunk-HPQE675Q.js} +1 -1
  37. package/dist/safe-bash/chunks/{chunk-BUYRKFW2.js → chunk-I6ECNJMR.js} +1 -1
  38. package/dist/safe-bash/chunks/{pdftk-WRYEP3CA.js → pdftk-Y2TX74LY.js} +2 -1
  39. package/dist/safe-bash/command-chunks/biff-KRHJ63K3-VQPJCVIL.js +5309 -0
  40. package/dist/safe-bash/command-chunks/{chunk-34G2SQX2.js → chunk-2BLTUQNK.js} +2 -2
  41. package/dist/safe-bash/command-chunks/{chunk-LLU2IQEJ.js → chunk-2BNGPR6Z.js} +2 -2
  42. package/dist/safe-bash/command-chunks/{chunk-HWQ2UHMT.js → chunk-2ETEJOYX.js} +18 -18
  43. package/dist/safe-bash/command-chunks/{chunk-NQDIT667.js → chunk-2PKBXGXD.js} +5 -5
  44. package/dist/safe-bash/command-chunks/{chunk-MMBZTYXO.js → chunk-2PQRZDNR.js} +221 -0
  45. package/dist/safe-bash/command-chunks/{chunk-6QBMND4A.js → chunk-2VVJRVYM.js} +1 -1
  46. package/dist/safe-bash/command-chunks/{chunk-G5QVZQCO.js → chunk-3EASXF5D.js} +5 -5
  47. package/dist/safe-bash/command-chunks/{chunk-U3SBHEKH.js → chunk-3EB2FSAN.js} +9 -9
  48. package/dist/safe-bash/command-chunks/{chunk-VB2TUPO2.js → chunk-3EW7GYHM.js} +9 -9
  49. package/dist/safe-bash/command-chunks/{chunk-RNSKXOG3.js → chunk-3GRMU7TM.js} +6 -6
  50. package/dist/safe-bash/command-chunks/chunk-3JM7E42I.js +197 -0
  51. package/dist/safe-bash/command-chunks/{chunk-6L4IYQAT.js → chunk-3MG5EAMX.js} +4 -4
  52. package/dist/safe-bash/command-chunks/{chunk-RASQPOSV.js → chunk-3SPLP2DB.js} +1 -1
  53. package/dist/safe-bash/command-chunks/{chunk-K5COUQAQ.js → chunk-3VGQTLO6.js} +1 -1
  54. package/dist/safe-bash/command-chunks/{chunk-K7CV55K5.js → chunk-3YEQI5B7.js} +10 -10
  55. package/dist/safe-bash/command-chunks/{chunk-ZXR6LXV5.js → chunk-3ZRCL756.js} +48 -4
  56. package/dist/safe-bash/command-chunks/{chunk-SOFM3GPG.js → chunk-42MEXZBJ.js} +1 -1
  57. package/dist/safe-bash/command-chunks/{chunk-GQ2ZSPZ3.js → chunk-46AMTJPE.js} +10 -10
  58. package/dist/safe-bash/command-chunks/{chunk-MTWZEPAR.js → chunk-47IAU25U.js} +2 -2
  59. package/dist/safe-bash/command-chunks/{chunk-6GI3NTCW.js → chunk-4B2ZUGLT.js} +4 -4
  60. package/dist/safe-bash/command-chunks/{chunk-L5MCW6CM.js → chunk-4EHY6J2Z.js} +9 -155
  61. package/dist/safe-bash/command-chunks/{chunk-QQVACHZA.js → chunk-4EZJV4FZ.js} +1 -1
  62. package/dist/safe-bash/command-chunks/{chunk-SSKMPDN4.js → chunk-4GQKCUS5.js} +15 -15
  63. package/dist/safe-bash/command-chunks/{chunk-UOBW5K3M.js → chunk-4RRYWHED.js} +7 -7
  64. package/dist/safe-bash/command-chunks/{chunk-PINR7QET.js → chunk-4UPKVQWH.js} +8 -8
  65. package/dist/safe-bash/command-chunks/{chunk-M7QE2MN7.js → chunk-4YLACJHE.js} +6 -6
  66. package/dist/safe-bash/command-chunks/chunk-5BIQWWLB.js +175 -0
  67. package/dist/safe-bash/command-chunks/{chunk-P3WU3PSL.js → chunk-5L4YGRQU.js} +3 -3
  68. package/dist/safe-bash/command-chunks/{chunk-HKATEVAP.js → chunk-5LFGXN3D.js} +6 -6
  69. package/dist/safe-bash/command-chunks/{chunk-SPLOIABU.js → chunk-5OM3UIK3.js} +3 -3
  70. package/dist/safe-bash/command-chunks/{chunk-TVH4JORU.js → chunk-6LPSKLLD.js} +3 -3
  71. package/dist/safe-bash/command-chunks/{chunk-CV7M2QJU.js → chunk-6QYSF7I2.js} +7 -7
  72. package/dist/safe-bash/command-chunks/{chunk-XVP6V5K3.js → chunk-6VBDJC6V.js} +6 -6
  73. package/dist/safe-bash/command-chunks/{chunk-6N5GHM72.js → chunk-6WNVGCXD.js} +8 -8
  74. package/dist/safe-bash/command-chunks/{chunk-6CCQI6XZ.js → chunk-6XES7Z4G.js} +12 -12
  75. package/dist/safe-bash/command-chunks/{chunk-AFROLW6S.js → chunk-6XGDWFNQ.js} +4 -4
  76. package/dist/safe-bash/command-chunks/{chunk-WTE23QXN.js → chunk-6ZGCKUAM.js} +3 -3
  77. package/dist/safe-bash/command-chunks/chunk-6ZHQB453.js +35 -0
  78. package/dist/safe-bash/command-chunks/{chunk-RIV6XN7K.js → chunk-7DOLY7IV.js} +2 -2
  79. package/dist/safe-bash/command-chunks/{chunk-QD7ZRDUN.js → chunk-7KZ5LWV2.js} +1 -1
  80. package/dist/safe-bash/command-chunks/{chunk-NGR5KOPQ.js → chunk-A347DLRB.js} +3 -3
  81. package/dist/safe-bash/command-chunks/{chunk-ZM2Y4Z3C.js → chunk-A45UG4KT.js} +4 -4
  82. package/dist/safe-bash/command-chunks/{chunk-56NYSX65.js → chunk-ADHFF2IM.js} +9 -9
  83. package/dist/safe-bash/command-chunks/{chunk-ATI464W3.js → chunk-AG2SNMP5.js} +1 -1
  84. package/dist/safe-bash/command-chunks/{chunk-FDCIPJBQ.js → chunk-AM5LANIE.js} +7 -7
  85. package/dist/safe-bash/command-chunks/{chunk-3Q247UDJ.js → chunk-AVGXFWEB.js} +278 -135
  86. package/dist/safe-bash/command-chunks/{chunk-RBTC7OFT.js → chunk-AVOGFREX.js} +5 -5
  87. package/dist/safe-bash/command-chunks/{chunk-QC5RMGSA.js → chunk-AWPI4DZR.js} +3 -3
  88. package/dist/safe-bash/command-chunks/{chunk-FYMNHG7R.js → chunk-AXXZNB7U.js} +13 -13
  89. package/dist/safe-bash/command-chunks/{chunk-Q6S57NOQ.js → chunk-AY3KQ4EN.js} +7 -7
  90. package/dist/safe-bash/command-chunks/{chunk-456PHA3L.js → chunk-BLGGAHQW.js} +1 -1
  91. package/dist/safe-bash/command-chunks/{chunk-CU4DLVME.js → chunk-BLIFGBIO.js} +2 -2
  92. package/dist/safe-bash/command-chunks/{chunk-NARD63DY.js → chunk-BS3ZEQGT.js} +22 -66
  93. package/dist/safe-bash/command-chunks/{chunk-WFVSUXJL.js → chunk-BS5JEUEW.js} +8 -8
  94. package/dist/safe-bash/command-chunks/{chunk-UYWSIIUX.js → chunk-BZMNC7Q5.js} +7 -7
  95. package/dist/safe-bash/command-chunks/{chunk-RHYJVTJO.js → chunk-CCMAHM3I.js} +2 -2
  96. package/dist/safe-bash/command-chunks/{chunk-N4R2SHSS.js → chunk-CCZZVCHX.js} +2 -2
  97. package/dist/safe-bash/command-chunks/{chunk-WGG6G2KG.js → chunk-CIRDVCAZ.js} +7 -7
  98. package/dist/safe-bash/command-chunks/chunk-CK2WFJZN.js +178 -0
  99. package/dist/safe-bash/command-chunks/{chunk-UZL7G57V.js → chunk-CKEMZUE3.js} +7 -7
  100. package/dist/safe-bash/command-chunks/{chunk-B5LDP7AA.js → chunk-CQBACD2V.js} +2 -2
  101. package/dist/safe-bash/command-chunks/{chunk-JYUJAF4L.js → chunk-CSE4VQKG.js} +16 -1
  102. package/dist/safe-bash/command-chunks/{chunk-Q73EMLLZ.js → chunk-CXME4YHU.js} +107 -5
  103. package/dist/safe-bash/command-chunks/{chunk-FTLDRH47.js → chunk-CZ5K2YPU.js} +16 -16
  104. package/dist/safe-bash/command-chunks/{chunk-554Z6IKP.js → chunk-DBLQUZGN.js} +2 -2
  105. package/dist/safe-bash/command-chunks/{chunk-6M6TM5Z5.js → chunk-DBNJEXHK.js} +3 -3
  106. package/dist/safe-bash/command-chunks/{chunk-SPW4GW4Z.js → chunk-DFI7QF3M.js} +2 -2
  107. package/dist/safe-bash/command-chunks/{chunk-ZO5WBWLL.js → chunk-DN6MSXY7.js} +2 -2
  108. package/dist/safe-bash/command-chunks/{chunk-GXLXWZWH.js → chunk-DZH54L3F.js} +3 -3
  109. package/dist/safe-bash/command-chunks/{chunk-XRVKWGVQ.js → chunk-EBHOZIBS.js} +6 -6
  110. package/dist/safe-bash/command-chunks/{chunk-3Y5EME26.js → chunk-ENEIE44W.js} +2 -2
  111. package/dist/safe-bash/command-chunks/{chunk-ATTWQVR2.js → chunk-EQWFKNHJ.js} +17 -17
  112. package/dist/safe-bash/command-chunks/{chunk-YV72XQKL.js → chunk-ETXPMVR6.js} +13 -13
  113. package/dist/safe-bash/command-chunks/{chunk-JFYWVQ4V.js → chunk-EV5G535P.js} +8 -8
  114. package/dist/safe-bash/command-chunks/{chunk-PZMU3Z4L.js → chunk-EVYKV3QI.js} +5 -5
  115. package/dist/safe-bash/command-chunks/{chunk-D6UMSC45.js → chunk-F4YFTO2K.js} +11 -11
  116. package/dist/safe-bash/command-chunks/{chunk-MPUHH2KR.js → chunk-F762XDNG.js} +3 -3
  117. package/dist/safe-bash/command-chunks/{chunk-D2ASPM7R.js → chunk-FF7UGJWS.js} +5 -5
  118. package/dist/safe-bash/command-chunks/{chunk-OA75SGN2.js → chunk-FOONI6BD.js} +7 -7
  119. package/dist/safe-bash/command-chunks/{chunk-DYLNU57U.js → chunk-FSVJ67G5.js} +1 -1
  120. package/dist/safe-bash/command-chunks/{chunk-CLKOGAR3.js → chunk-FSYMSWJU.js} +8 -8
  121. package/dist/safe-bash/command-chunks/{chunk-22MOB45U.js → chunk-FUQMEUAT.js} +6 -6
  122. package/dist/safe-bash/command-chunks/chunk-FWKLBDMK.js +0 -0
  123. package/dist/safe-bash/command-chunks/{chunk-KXPCSVAT.js → chunk-FXCSPPYE.js} +20 -20
  124. package/dist/safe-bash/command-chunks/{chunk-XZ2FWFNV.js → chunk-FYYFV6PW.js} +6 -6
  125. package/dist/safe-bash/command-chunks/{chunk-3OETVNJA.js → chunk-G2COZLXX.js} +9 -9
  126. package/dist/safe-bash/command-chunks/{chunk-ZEX53S5I.js → chunk-G3TAX3CV.js} +7369 -7221
  127. package/dist/safe-bash/command-chunks/{chunk-LXLLA4PM.js → chunk-GCHB7VNX.js} +17 -17
  128. package/dist/safe-bash/command-chunks/{chunk-4Y6O2K35.js → chunk-GLAF45M7.js} +1 -1
  129. package/dist/safe-bash/command-chunks/{chunk-OEJM666F.js → chunk-GQGMQMIM.js} +5 -5
  130. package/dist/safe-bash/command-chunks/{chunk-RRL3Y562.js → chunk-GXMPXMDP.js} +11 -11
  131. package/dist/safe-bash/command-chunks/{chunk-GEM47B2P.js → chunk-GYM5ICK4.js} +7 -7
  132. package/dist/safe-bash/command-chunks/{chunk-A5FZBR7X.js → chunk-H33D4R26.js} +4 -4
  133. package/dist/safe-bash/command-chunks/{chunk-AGLK7OJR.js → chunk-HDSIIQBS.js} +1 -1
  134. package/dist/safe-bash/command-chunks/{chunk-3ZDANXIC.js → chunk-HELAVGZH.js} +3 -3
  135. package/dist/safe-bash/command-chunks/{chunk-S4QH5BXZ.js → chunk-HGIMFVI2.js} +4 -4
  136. package/dist/safe-bash/command-chunks/{chunk-35IPOBWL.js → chunk-HI6ZYH3W.js} +10 -10
  137. package/dist/safe-bash/command-chunks/{chunk-KB7DUBVL.js → chunk-HK6MSB7Z.js} +5 -5
  138. package/dist/safe-bash/command-chunks/{chunk-7ZE3VIAN.js → chunk-IB5QP4LF.js} +2 -2
  139. package/dist/safe-bash/command-chunks/{chunk-UCR5YDV3.js → chunk-IBYMPAUW.js} +1 -1
  140. package/dist/safe-bash/command-chunks/{chunk-LABOWPFB.js → chunk-IHXZMAMY.js} +9 -9
  141. package/dist/safe-bash/command-chunks/{chunk-XPD636C4.js → chunk-IWHNRYER.js} +3 -3
  142. package/dist/safe-bash/command-chunks/{chunk-PPO7YUZF.js → chunk-JGKSWDGP.js} +1 -1
  143. package/dist/safe-bash/command-chunks/{chunk-KCOJA7EM.js → chunk-JR3Q6QNL.js} +7 -7
  144. package/dist/safe-bash/command-chunks/{chunk-S6R3IB36.js → chunk-JUHOL5KB.js} +1 -1
  145. package/dist/safe-bash/command-chunks/{chunk-3O2YEI47.js → chunk-JVKE7YZN.js} +3 -3
  146. package/dist/safe-bash/command-chunks/{chunk-6NATRKUJ.js → chunk-JW6WVNTM.js} +1 -1
  147. package/dist/safe-bash/command-chunks/{chunk-IK6K2HCG.js → chunk-JWORWL72.js} +1 -1
  148. package/dist/safe-bash/command-chunks/{chunk-JOCFI7TG.js → chunk-K2WOMJOQ.js} +1 -1
  149. package/dist/safe-bash/command-chunks/{chunk-XVLWZTPY.js → chunk-K4XNUJVJ.js} +543 -144
  150. package/dist/safe-bash/command-chunks/{chunk-DM2CPMB4.js → chunk-KBAQHE5Y.js} +2 -2
  151. package/dist/safe-bash/command-chunks/chunk-KCLJGRU7.js +737 -0
  152. package/dist/safe-bash/command-chunks/{chunk-TUDFMNPP.js → chunk-KINIV2SV.js} +1 -1
  153. package/dist/safe-bash/command-chunks/{chunk-43TRBJ2N.js → chunk-KPHLESD4.js} +4 -4
  154. package/dist/safe-bash/command-chunks/{chunk-47NEG4UO.js → chunk-KRRG4MGH.js} +222 -46
  155. package/dist/safe-bash/command-chunks/{chunk-33YCKZZX.js → chunk-KSBNZTAZ.js} +6 -6
  156. package/dist/safe-bash/command-chunks/{chunk-4Y34ZG4T.js → chunk-KUOCGGEU.js} +11 -11
  157. package/dist/safe-bash/command-chunks/{chunk-ML5R5JML.js → chunk-KY4LCHUF.js} +1 -1
  158. package/dist/safe-bash/command-chunks/{chunk-2JSDKQ4J.js → chunk-LAPOMHGY.js} +251 -239
  159. package/dist/safe-bash/command-chunks/{chunk-ENT3IV2G.js → chunk-LDW3RF7Y.js} +12 -12
  160. package/dist/safe-bash/command-chunks/{chunk-U27XPNLP.js → chunk-LEO4VRIN.js} +2 -2
  161. package/dist/safe-bash/command-chunks/{chunk-GZ3VIWNN.js → chunk-LKGTH2Q7.js} +7 -7
  162. package/dist/safe-bash/command-chunks/{chunk-ZMHEGDU2.js → chunk-LNTEV56A.js} +2 -2
  163. package/dist/safe-bash/command-chunks/{chunk-DVGXLBUW.js → chunk-LZ2JFMKT.js} +10 -10
  164. package/dist/safe-bash/command-chunks/{chunk-6D2BMAF4.js → chunk-MEM2ZPMI.js} +2 -2
  165. package/dist/safe-bash/command-chunks/{chunk-HTVIYLVB.js → chunk-MGMTRGKM.js} +4 -4
  166. package/dist/safe-bash/command-chunks/{chunk-B3NLITWP.js → chunk-MKK6FM5H.js} +7 -7
  167. package/dist/safe-bash/command-chunks/{chunk-Z2JW6M2D.js → chunk-MKOIPOXX.js} +3 -3
  168. package/dist/safe-bash/command-chunks/chunk-MLOYUXUV.js +244 -0
  169. package/dist/safe-bash/command-chunks/{chunk-CBNKHBLD.js → chunk-MNK3DDH6.js} +2 -2
  170. package/dist/safe-bash/command-chunks/{chunk-JVGUVHWI.js → chunk-MPXMRTMY.js} +10 -10
  171. package/dist/safe-bash/command-chunks/{chunk-TW73OXPR.js → chunk-MVLVIMJ6.js} +6 -6
  172. package/dist/safe-bash/command-chunks/{chunk-TY4WDAHM.js → chunk-MYZ46FQL.js} +1 -1
  173. package/dist/safe-bash/command-chunks/{chunk-TBAIMDGL.js → chunk-N4MUBJCT.js} +1 -1
  174. package/dist/safe-bash/command-chunks/{chunk-NPLVFAD6.js → chunk-N6G3345Q.js} +8 -8
  175. package/dist/safe-bash/command-chunks/{chunk-ZIIO6GRY.js → chunk-NEMUPUUB.js} +7 -7
  176. package/dist/safe-bash/command-chunks/{chunk-K5GB2YMN.js → chunk-NEVQWOU6.js} +10 -10
  177. package/dist/safe-bash/command-chunks/{chunk-FIIAYCWS.js → chunk-NFGCBQN3.js} +2 -2
  178. package/dist/safe-bash/command-chunks/{chunk-PNGDJA6M.js → chunk-NFII726L.js} +2 -2
  179. package/dist/safe-bash/command-chunks/{chunk-JQPNA77Y.js → chunk-NHNZYWPW.js} +2 -2
  180. package/dist/safe-bash/command-chunks/chunk-NQINS4XY.js +156 -0
  181. package/dist/safe-bash/command-chunks/{chunk-APEWTWCC.js → chunk-NRFTYZ2R.js} +6 -6
  182. package/dist/safe-bash/command-chunks/{chunk-THMZLJQD.js → chunk-NYFYTL5G.js} +18 -18
  183. package/dist/safe-bash/command-chunks/{chunk-SMSGLRIH.js → chunk-OTF2AJ5M.js} +6 -6
  184. package/dist/safe-bash/command-chunks/{chunk-QZZ73J2O.js → chunk-OVQP6KH5.js} +6 -6
  185. package/dist/safe-bash/command-chunks/{chunk-HDJVJTCK.js → chunk-P2LT6TGR.js} +9 -9
  186. package/dist/safe-bash/command-chunks/{chunk-YS25EI54.js → chunk-PCCFLPUQ.js} +2 -2
  187. package/dist/safe-bash/command-chunks/{chunk-26VCZHLJ.js → chunk-PIOQBOEK.js} +1 -1
  188. package/dist/safe-bash/command-chunks/{chunk-D2KZ66W4.js → chunk-PIVH35EQ.js} +190 -42
  189. package/dist/safe-bash/command-chunks/{chunk-QYMEASQ6.js → chunk-PLMF35XK.js} +4 -4
  190. package/dist/safe-bash/command-chunks/{chunk-JQVHUSDD.js → chunk-PLR5IULU.js} +5 -5
  191. package/dist/safe-bash/command-chunks/{chunk-2CORNDGF.js → chunk-PS5GDFIP.js} +2 -2
  192. package/dist/safe-bash/command-chunks/{chunk-R6EGGK5M.js → chunk-Q5PWYPQV.js} +7 -7
  193. package/dist/safe-bash/command-chunks/{chunk-COKYZUBW.js → chunk-Q7TVCBU2.js} +1 -1
  194. package/dist/safe-bash/command-chunks/{chunk-EHTOHOTR.js → chunk-QB72X7FF.js} +9 -9
  195. package/dist/safe-bash/command-chunks/{chunk-F3GP3EXE.js → chunk-RGDOYWOD.js} +2 -2
  196. package/dist/safe-bash/command-chunks/{chunk-RQIQ75W5.js → chunk-RHDERFMR.js} +5 -5
  197. package/dist/safe-bash/command-chunks/{chunk-3KMOXEGH.js → chunk-RHU44OMN.js} +2 -2
  198. package/dist/safe-bash/command-chunks/{chunk-7PVHO47B.js → chunk-RIVKF77R.js} +6 -6
  199. package/dist/safe-bash/command-chunks/{chunk-UOR6PXZZ.js → chunk-ROL5AEX6.js} +1 -1
  200. package/dist/safe-bash/command-chunks/{chunk-AHA6IWAJ.js → chunk-RQYPFLZJ.js} +6 -6
  201. package/dist/safe-bash/command-chunks/{chunk-YSMNXMAO.js → chunk-RTNI47C5.js} +4 -4
  202. package/dist/safe-bash/command-chunks/{chunk-W5LLKV5H.js → chunk-RV5AGXOV.js} +2 -2
  203. package/dist/safe-bash/command-chunks/{chunk-PMAM4N33.js → chunk-RXQ2G2YK.js} +9 -9
  204. package/dist/safe-bash/command-chunks/{chunk-EVU7FLDA.js → chunk-S2QNBAN6.js} +7 -7
  205. package/dist/safe-bash/command-chunks/{chunk-YE6OAKK7.js → chunk-S43QRKDC.js} +7 -7
  206. package/dist/safe-bash/command-chunks/{chunk-774GLJAO.js → chunk-S7HIOT7Z.js} +4 -4
  207. package/dist/safe-bash/command-chunks/chunk-SEPUP6TZ.js +63 -0
  208. package/dist/safe-bash/command-chunks/{chunk-JPMYPOYZ.js → chunk-SUTHGUD3.js} +28 -28
  209. package/dist/safe-bash/command-chunks/chunk-SW37YCBW.js +286 -0
  210. package/dist/safe-bash/command-chunks/{chunk-Y4EYCZFT.js → chunk-SWAKALDJ.js} +10 -10
  211. package/dist/safe-bash/command-chunks/{chunk-QUM3SYAJ.js → chunk-SYSX46IV.js} +3 -3
  212. package/dist/safe-bash/command-chunks/{chunk-WGH3RLJY.js → chunk-T5S4SJGO.js} +9 -9
  213. package/dist/safe-bash/command-chunks/{chunk-7JEIWA3A.js → chunk-TID5TSQW.js} +5 -5
  214. package/dist/safe-bash/command-chunks/{chunk-CRV2Q3PB.js → chunk-TJLXSENN.js} +1 -1
  215. package/dist/safe-bash/command-chunks/{chunk-IT7TAC3F.js → chunk-TKCUGMRZ.js} +24 -20
  216. package/dist/safe-bash/command-chunks/{chunk-7GKKMNL6.js → chunk-TXPDKEGY.js} +8 -8
  217. package/dist/safe-bash/command-chunks/{chunk-A2CLZMQZ.js → chunk-UJERQEJB.js} +1 -1
  218. package/dist/safe-bash/command-chunks/{chunk-6VPQ3CDZ.js → chunk-USGZN2KE.js} +5 -5
  219. package/dist/safe-bash/command-chunks/{chunk-LCZDBW55.js → chunk-UYGQEQIP.js} +5 -5
  220. package/dist/safe-bash/command-chunks/{chunk-MPORWUTU.js → chunk-V5XC43BX.js} +8 -8
  221. package/dist/safe-bash/command-chunks/{chunk-AIMSZBWP.js → chunk-V7E3PZOK.js} +9 -9
  222. package/dist/safe-bash/command-chunks/{chunk-CNHRVUHA.js → chunk-VDTFVRYX.js} +1 -1
  223. package/dist/safe-bash/command-chunks/{chunk-KJ4XXZIL.js → chunk-VT2PHQ63.js} +582 -59
  224. package/dist/safe-bash/command-chunks/{chunk-MOZD7RUY.js → chunk-VT7UBPAE.js} +38 -15
  225. package/dist/safe-bash/command-chunks/{chunk-QDVI2YB6.js → chunk-VUWXLH3E.js} +2 -2
  226. package/dist/safe-bash/command-chunks/{chunk-X7FA7ZD5.js → chunk-W3ZSWK76.js} +8 -8
  227. package/dist/safe-bash/command-chunks/{chunk-JPA2PUYI.js → chunk-WBKB7HBZ.js} +8 -8
  228. package/dist/safe-bash/command-chunks/{chunk-MIRL7HTF.js → chunk-WJ2ERUCQ.js} +1 -1
  229. package/dist/safe-bash/command-chunks/{chunk-36XGIPOG.js → chunk-WTVJLHMG.js} +1 -1
  230. package/dist/safe-bash/command-chunks/{chunk-SLQWQKXP.js → chunk-WWHMI4S3.js} +9 -9
  231. package/dist/safe-bash/command-chunks/{chunk-2UBZALAK.js → chunk-WYZG3DRR.js} +1 -1
  232. package/dist/safe-bash/command-chunks/{chunk-YORJDX4V.js → chunk-WZRFS5OY.js} +4 -4
  233. package/dist/safe-bash/command-chunks/{chunk-EHSM5ZQS.js → chunk-X6OHFKBL.js} +8 -8
  234. package/dist/safe-bash/command-chunks/{chunk-S6ZTBXYO.js → chunk-XKAUKLF7.js} +13 -13
  235. package/dist/safe-bash/command-chunks/{chunk-EUT24Y5Z.js → chunk-XM5QJCPD.js} +8 -8
  236. package/dist/safe-bash/command-chunks/{chunk-WXRYDALR.js → chunk-XMTR7QGL.js} +4 -4
  237. package/dist/safe-bash/command-chunks/{chunk-4CKFNXRN.js → chunk-XNGM3W5R.js} +1 -1
  238. package/dist/safe-bash/command-chunks/{chunk-2ZFLMWOX.js → chunk-XTEIT5CI.js} +1 -1
  239. package/dist/safe-bash/command-chunks/{chunk-4DLIUTQV.js → chunk-XU6S3XUZ.js} +11 -11
  240. package/dist/safe-bash/command-chunks/{chunk-CJQSAATC.js → chunk-XUJAQA3S.js} +30 -30
  241. package/dist/safe-bash/command-chunks/{chunk-W5YSINXC.js → chunk-Y42KSX63.js} +6 -6
  242. package/dist/safe-bash/command-chunks/{chunk-UAXSE3XE.js → chunk-Y54L4P4J.js} +5 -5
  243. package/dist/safe-bash/command-chunks/{chunk-6WQD7LRA.js → chunk-YAD7EV4N.js} +14 -14
  244. package/dist/safe-bash/command-chunks/{chunk-WVMHRNXZ.js → chunk-YRPXBGRX.js} +3 -3
  245. package/dist/safe-bash/command-chunks/{chunk-5HPU7D36.js → chunk-Z2WNYEPD.js} +4 -4
  246. package/dist/safe-bash/command-chunks/{chunk-SDTPO2VV.js → chunk-Z7QOSXQC.js} +7 -7
  247. package/dist/safe-bash/command-chunks/{chunk-WJCN2IXI.js → chunk-ZQM37BGE.js} +2 -2
  248. package/dist/safe-bash/command-chunks/{chunk-W3HV45CI.js → chunk-ZSQZHFWS.js} +9 -9
  249. package/dist/safe-bash/command-chunks/{chunk-IDJQP3A6.js → chunk-ZTMZO4IT.js} +1 -1
  250. package/dist/safe-bash/command-chunks/{chunk-RID6VYS3.js → chunk-ZU2KJMXO.js} +8 -8
  251. package/dist/safe-bash/command-chunks/{chunk-YXKNJ6EM.js → chunk-ZXELXF2H.js} +5 -5
  252. package/dist/safe-bash/command-chunks/{clipboard-BBDK33GP-VB22F7GI.js → clipboard-BBDK33GP-QZ4ERNQX.js} +2 -2
  253. package/dist/safe-bash/command-chunks/{command-engine-BCUQGJJ4.js → command-engine-7V6PZR7G.js} +1012 -678
  254. package/dist/safe-bash/command-chunks/{engine-LAUEWYSQ-DQCEI5HE.js → engine-UYJENSWK-VSCGKSQV.js} +1 -1
  255. package/dist/safe-bash/command-chunks/{gnumeric-UJPXWBVR-YPXTNEDZ.js → gnumeric-UJPXWBVR-7VOHQAPM.js} +2 -2
  256. package/dist/safe-bash/command-chunks/{model-store-E7BHBFJC.js → model-store-UB5DWMAP.js} +24 -24
  257. package/dist/safe-bash/command-chunks/paradox-4FCZE53D-LQPGVMEL.js +365 -0
  258. package/dist/safe-bash/commands/pandoc/index.browser.js +1 -1
  259. package/dist/safe-bash/full-core.browser.js +2 -2
  260. package/dist/safe-bash/plugins/index.browser.js +2 -2
  261. package/dist/safe-bash-command-awk/awk-runtime.js +3 -3
  262. package/dist/safe-bash-command-awk/awk.js +4 -4
  263. package/dist/safe-bash-command-awk/index.js +4 -4
  264. package/dist/safe-bash-command-diff/diff.js +2 -2
  265. package/dist/safe-bash-command-diff/index.js +3 -3
  266. package/dist/safe-bash-command-diff/sync.js +2 -2
  267. package/dist/safe-bash-command-du/du.js +2 -2
  268. package/dist/safe-bash-command-du/index.js +2 -2
  269. package/dist/safe-bash-command-ffmpeg/index.js +1 -1
  270. package/dist/safe-bash-command-ffprobe/index.js +2 -2
  271. package/dist/safe-bash-command-ffprobe/media.d.ts +3 -1
  272. package/dist/safe-bash-command-ffprobe/media.js +2 -2
  273. package/dist/safe-bash-command-html-to-markdown/budget.js +2 -1
  274. package/dist/safe-bash-command-html-to-markdown/entities.js +4 -3
  275. package/dist/safe-bash-command-html-to-markdown/index.js +533 -310
  276. package/dist/safe-bash-command-html-to-markdown/input.js +6 -5
  277. package/dist/safe-bash-command-html-to-markdown/options.js +2 -1
  278. package/dist/safe-bash-command-html-to-markdown/parser.js +5 -4
  279. package/dist/safe-bash-command-html-to-markdown/render.js +6 -5
  280. package/dist/safe-bash-command-html-to-markdown/stored-text.d.ts +50 -0
  281. package/dist/safe-bash-command-html-to-markdown/stored-text.js +12 -0
  282. package/dist/safe-bash-command-html-to-markdown/text.js +3 -2
  283. package/dist/safe-bash-command-htmlq/contracts.d.ts +5 -0
  284. package/dist/safe-bash-command-htmlq/index.js +2006 -259
  285. package/dist/safe-bash-command-htmlq/selectors.d.ts +38 -1
  286. package/dist/safe-bash-command-htmlq/serializer.d.ts +1 -0
  287. package/dist/safe-bash-command-htmlq/tree.d.ts +4 -2
  288. package/dist/safe-bash-command-iconv/command.js +2 -2
  289. package/dist/safe-bash-command-iconv/index.js +2 -2
  290. package/dist/safe-bash-command-llm/command.js +3 -3
  291. package/dist/safe-bash-command-llm/index.js +9 -9
  292. package/dist/safe-bash-command-llm/openai.js +2 -2
  293. package/dist/safe-bash-command-llm/providers/index.js +2 -2
  294. package/dist/safe-bash-command-llm/providers/openai.js +2 -2
  295. package/dist/safe-bash-command-node/commands/node/browser.js +2 -2
  296. package/dist/safe-bash-command-node/commands/node/default-runtime.js +2 -2
  297. package/dist/safe-bash-command-node/commands/node/safejs.js +2 -2
  298. package/dist/safe-bash-command-pandoc/command.js +7 -7
  299. package/dist/safe-bash-command-pandoc/index.js +46 -46
  300. package/dist/safe-bash-command-patch/index.js +6 -6
  301. package/dist/safe-bash-command-patch/patch-envelope.js +53 -3
  302. package/dist/safe-bash-command-patch/patch-formats.d.ts +7 -2
  303. package/dist/safe-bash-command-patch/patch-formats.js +6 -4
  304. package/dist/safe-bash-command-patch/patch-gnu-paths.d.ts +7 -7
  305. package/dist/safe-bash-command-patch/patch-gnu-reject.d.ts +3 -2
  306. package/dist/safe-bash-command-patch/patch-gnu-reject.js +4 -3
  307. package/dist/safe-bash-command-patch/patch-publication.js +2 -1
  308. package/dist/safe-bash-command-patch/patch.js +6 -6
  309. package/dist/safe-bash-command-patch/stored-patch.d.ts +26 -0
  310. package/dist/safe-bash-command-patch/stored-target.d.ts +40 -0
  311. package/dist/safe-bash-command-patch/unified.d.ts +23 -10
  312. package/dist/safe-bash-command-patch/unified.js +3 -1
  313. package/dist/safe-bash-command-pdftk/index.d.ts +6 -2
  314. package/dist/safe-bash-command-pdftk/index.js +1247 -373
  315. package/dist/safe-bash-command-playwright-cli/index.js +26 -26
  316. package/dist/safe-bash-command-playwright-cli/playwright/abilities.js +10 -10
  317. package/dist/safe-bash-command-playwright-cli/playwright/controller.js +14 -14
  318. package/dist/safe-bash-command-playwright-cli/playwright/index.js +23 -23
  319. package/dist/safe-bash-command-playwright-cli/playwright/snapshot.js +2 -2
  320. package/dist/safe-bash-command-playwright-cli/playwright/standard-capabilities.js +6 -6
  321. package/dist/safe-bash-command-playwright-cli/playwright/storage-capabilities.js +4 -4
  322. package/dist/safe-bash-command-pptx/command-engine.d.ts +5 -1
  323. package/dist/safe-bash-command-pptx/engine.js +1 -1
  324. package/dist/safe-bash-command-pptx/index.d.ts +1 -1
  325. package/dist/safe-bash-command-pptx/index.js +172 -19
  326. package/dist/safe-bash-command-pptx/streaming-inputs.d.ts +7 -2
  327. package/dist/safe-bash-command-python/executor.js +5 -5
  328. package/dist/safe-bash-command-python/index.js +5 -5
  329. package/dist/safe-bash-command-python/jspi.js +2 -2
  330. package/dist/safe-bash-command-soffice/index.js +1 -1
  331. package/dist/safe-bash-command-sort/index.js +3 -3
  332. package/dist/safe-bash-command-ssconvert/index.js +2 -2
  333. package/dist/safe-bash-command-tar/create.js +2 -2
  334. package/dist/safe-bash-command-tar/extract.js +2 -2
  335. package/dist/safe-bash-command-tar/index.js +8 -8
  336. package/dist/safe-bash-command-tar/modes.js +4 -4
  337. package/dist/safe-bash-command-timeout/index.js +3 -3
  338. package/dist/safe-bash-command-tree/index.js +2 -2
  339. package/dist/safe-bash-command-tree/tree.js +2 -2
  340. package/dist/safe-bash-command-xmllint/index.js +22 -31
  341. package/dist/safe-bash-command-xz/index.js +5 -5
  342. package/dist/safe-bash-compression-engine/files.js +2 -2
  343. package/dist/safe-bash-compression-engine/operand.js +4 -4
  344. package/dist/safe-bash-contracts/diagnostics.js +3 -3
  345. package/dist/safe-bash-contracts/escaping.js +10 -10
  346. package/dist/safe-bash-contracts/filesystem-descriptor.js +1 -1
  347. package/dist/safe-bash-contracts/filesystem-output.js +6 -6
  348. package/dist/safe-bash-contracts/index.js +33 -33
  349. package/dist/safe-bash-contracts/io.js +2 -2
  350. package/dist/safe-bash-contracts/output.js +3 -3
  351. package/dist/safe-bash-docx-engine/ancillary-resources.js +5 -5
  352. package/dist/safe-bash-docx-engine/batch-operations.js +63 -63
  353. package/dist/safe-bash-docx-engine/batch-result-schema.js +74 -74
  354. package/dist/safe-bash-docx-engine/batch.js +74 -74
  355. package/dist/safe-bash-docx-engine/bookmarks.js +13 -13
  356. package/dist/safe-bash-docx-engine/charts.js +6 -6
  357. package/dist/safe-bash-docx-engine/command-option-rules.js +3 -3
  358. package/dist/safe-bash-docx-engine/comments.js +21 -21
  359. package/dist/safe-bash-docx-engine/control-bindings.js +16 -16
  360. package/dist/safe-bash-docx-engine/control-repeat.js +16 -16
  361. package/dist/safe-bash-docx-engine/controls.js +14 -14
  362. package/dist/safe-bash-docx-engine/create.js +8 -8
  363. package/dist/safe-bash-docx-engine/diagrams.js +6 -6
  364. package/dist/safe-bash-docx-engine/diff.js +8 -8
  365. package/dist/safe-bash-docx-engine/document-properties.js +12 -12
  366. package/dist/safe-bash-docx-engine/equations.js +12 -12
  367. package/dist/safe-bash-docx-engine/extract.js +9 -9
  368. package/dist/safe-bash-docx-engine/fields.js +18 -18
  369. package/dist/safe-bash-docx-engine/font-inventory.js +13 -13
  370. package/dist/safe-bash-docx-engine/font-resources.js +3 -3
  371. package/dist/safe-bash-docx-engine/image-batch-operations.js +11 -11
  372. package/dist/safe-bash-docx-engine/image-insertion.js +17 -17
  373. package/dist/safe-bash-docx-engine/image-layout.js +14 -14
  374. package/dist/safe-bash-docx-engine/image-replacement.js +19 -19
  375. package/dist/safe-bash-docx-engine/images.js +14 -14
  376. package/dist/safe-bash-docx-engine/index.js +102 -102
  377. package/dist/safe-bash-docx-engine/inspection.js +15 -15
  378. package/dist/safe-bash-docx-engine/invocation.js +4 -4
  379. package/dist/safe-bash-docx-engine/io.js +6 -6
  380. package/dist/safe-bash-docx-engine/links.js +17 -17
  381. package/dist/safe-bash-docx-engine/lists.js +16 -16
  382. package/dist/safe-bash-docx-engine/locations.js +10 -10
  383. package/dist/safe-bash-docx-engine/notes.js +18 -18
  384. package/dist/safe-bash-docx-engine/objects.js +14 -14
  385. package/dist/safe-bash-docx-engine/pack.js +9 -9
  386. package/dist/safe-bash-docx-engine/package-view-batch-operations.js +19 -19
  387. package/dist/safe-bash-docx-engine/pandoc-adapter.js +25 -25
  388. package/dist/safe-bash-docx-engine/paragraph-edit.js +21 -21
  389. package/dist/safe-bash-docx-engine/publication.js +6 -6
  390. package/dist/safe-bash-docx-engine/removal.js +16 -16
  391. package/dist/safe-bash-docx-engine/revision-decisions.js +16 -16
  392. package/dist/safe-bash-docx-engine/revision-edit.js +15 -15
  393. package/dist/safe-bash-docx-engine/revisions.js +12 -12
  394. package/dist/safe-bash-docx-engine/run-format.js +15 -15
  395. package/dist/safe-bash-docx-engine/sanitize.js +29 -29
  396. package/dist/safe-bash-docx-engine/sections.js +15 -15
  397. package/dist/safe-bash-docx-engine/settings.js +6 -6
  398. package/dist/safe-bash-docx-engine/shape-edit.js +16 -16
  399. package/dist/safe-bash-docx-engine/signatures.js +11 -11
  400. package/dist/safe-bash-docx-engine/stories.js +18 -18
  401. package/dist/safe-bash-docx-engine/structure-model-batch-operations.js +34 -34
  402. package/dist/safe-bash-docx-engine/style-model-batch-operations.js +24 -24
  403. package/dist/safe-bash-docx-engine/style-model-result-schema.js +39 -39
  404. package/dist/safe-bash-docx-engine/styles.js +14 -14
  405. package/dist/safe-bash-docx-engine/table-edit.js +23 -23
  406. package/dist/safe-bash-docx-engine/table-read.js +11 -11
  407. package/dist/safe-bash-docx-engine/template.js +17 -17
  408. package/dist/safe-bash-docx-engine/text-replace.js +15 -15
  409. package/dist/safe-bash-docx-engine/text-resource-read.js +11 -11
  410. package/dist/safe-bash-docx-engine/text.js +11 -11
  411. package/dist/safe-bash-docx-engine/validation.js +4 -4
  412. package/dist/safe-bash-docx-engine/xml-parts.js +17 -17
  413. package/dist/safe-bash-io-engine/commands/text-programs/shared.js +4 -4
  414. package/dist/safe-bash-line-ending-engine/command.js +3 -3
  415. package/dist/safe-bash-line-ending-engine/convert.js +2 -2
  416. package/dist/safe-bash-line-ending-engine/index.js +6 -6
  417. package/dist/safe-bash-line-ending-engine/info.js +2 -2
  418. package/dist/safe-bash-markdown-engine/commonmark-blocks.js +4 -4
  419. package/dist/safe-bash-markdown-engine/commonmark-inlines.js +4 -4
  420. package/dist/safe-bash-markdown-engine/commonmark-syntax.js +2 -2
  421. package/dist/safe-bash-markdown-engine/gfm-syntax.js +3 -3
  422. package/dist/safe-bash-markdown-engine/index.js +5 -5
  423. package/dist/safe-bash-network-engine/transfer.js +3 -3
  424. package/dist/safe-bash-presentation-engine/accessibility.js +31 -30
  425. package/dist/safe-bash-presentation-engine/animation-editing.js +16 -15
  426. package/dist/safe-bash-presentation-engine/animations.js +16 -15
  427. package/dist/safe-bash-presentation-engine/backgrounds.js +17 -16
  428. package/dist/safe-bash-presentation-engine/bytes.js +3 -3
  429. package/dist/safe-bash-presentation-engine/chart-editing.js +34 -33
  430. package/dist/safe-bash-presentation-engine/chart-object-operations.js +25 -24
  431. package/dist/safe-bash-presentation-engine/charts.js +31 -30
  432. package/dist/safe-bash-presentation-engine/command-placeholder.js +59 -56
  433. package/dist/safe-bash-presentation-engine/comments.js +17 -16
  434. package/dist/safe-bash-presentation-engine/connector-operations.js +32 -31
  435. package/dist/safe-bash-presentation-engine/connectors.js +29 -28
  436. package/dist/safe-bash-presentation-engine/content-types.js +4 -4
  437. package/dist/safe-bash-presentation-engine/creation.js +6 -6
  438. package/dist/safe-bash-presentation-engine/diff.js +32 -31
  439. package/dist/safe-bash-presentation-engine/drawing-enums.d.ts +10 -10
  440. package/dist/safe-bash-presentation-engine/drawing-format.js +20 -19
  441. package/dist/safe-bash-presentation-engine/drawing-operations.js +31 -30
  442. package/dist/safe-bash-presentation-engine/drawing-schema.js +21 -20
  443. package/dist/safe-bash-presentation-engine/equations.js +17 -16
  444. package/dist/safe-bash-presentation-engine/errors.js +2 -2
  445. package/dist/safe-bash-presentation-engine/fields.js +17 -16
  446. package/dist/safe-bash-presentation-engine/font-metrics.js +3 -3
  447. package/dist/safe-bash-presentation-engine/image-extraction.js +20 -19
  448. package/dist/safe-bash-presentation-engine/image-formatting.js +32 -31
  449. package/dist/safe-bash-presentation-engine/image-insertion.js +18 -17
  450. package/dist/safe-bash-presentation-engine/image-replacement.js +21 -20
  451. package/dist/safe-bash-presentation-engine/image-value.js +4 -4
  452. package/dist/safe-bash-presentation-engine/images.js +19 -18
  453. package/dist/safe-bash-presentation-engine/index.d.ts +5 -1
  454. package/dist/safe-bash-presentation-engine/index.js +121 -108
  455. package/dist/safe-bash-presentation-engine/layouts.js +16 -15
  456. package/dist/safe-bash-presentation-engine/length.js +3 -3
  457. package/dist/safe-bash-presentation-engine/links.js +16 -15
  458. package/dist/safe-bash-presentation-engine/masters.js +15 -14
  459. package/dist/safe-bash-presentation-engine/media-editing.js +24 -23
  460. package/dist/safe-bash-presentation-engine/media-extraction.js +17 -16
  461. package/dist/safe-bash-presentation-engine/media.js +16 -15
  462. package/dist/safe-bash-presentation-engine/memberships.js +15 -14
  463. package/dist/safe-bash-presentation-engine/notes.js +16 -15
  464. package/dist/safe-bash-presentation-engine/ole-enum.js +4 -4
  465. package/dist/safe-bash-presentation-engine/ole-insertion.js +20 -19
  466. package/dist/safe-bash-presentation-engine/opaque-objects.js +9 -9
  467. package/dist/safe-bash-presentation-engine/package-reader.js +5 -5
  468. package/dist/safe-bash-presentation-engine/package-tools.d.ts +3 -0
  469. package/dist/safe-bash-presentation-engine/package-tools.js +27 -17
  470. package/dist/safe-bash-presentation-engine/package-uri.js +3 -3
  471. package/dist/safe-bash-presentation-engine/package-writer.js +4 -4
  472. package/dist/safe-bash-presentation-engine/presentation-model.js +58 -55
  473. package/dist/safe-bash-presentation-engine/presentation-settings.js +14 -13
  474. package/dist/safe-bash-presentation-engine/properties.js +16 -15
  475. package/dist/safe-bash-presentation-engine/relationships.js +4 -4
  476. package/dist/safe-bash-presentation-engine/resource-limits.js +1 -1
  477. package/dist/safe-bash-presentation-engine/retained-archive-staging.d.ts +19 -0
  478. package/dist/safe-bash-presentation-engine/retained-extraction-output.d.ts +18 -0
  479. package/dist/safe-bash-presentation-engine/retained-frame-formatting.d.ts +14 -0
  480. package/dist/safe-bash-presentation-engine/retained-inspection.js +14 -12
  481. package/dist/safe-bash-presentation-engine/retained-package-extraction.d.ts +22 -0
  482. package/dist/safe-bash-presentation-engine/retained-package-packing.d.ts +19 -0
  483. package/dist/safe-bash-presentation-engine/retained-package.d.ts +2 -0
  484. package/dist/safe-bash-presentation-engine/retained-package.js +6 -4
  485. package/dist/safe-bash-presentation-engine/retained-text.d.ts +9 -2
  486. package/dist/safe-bash-presentation-engine/retained-text.js +131 -30
  487. package/dist/safe-bash-presentation-engine/retained-xml-document.d.ts +1 -0
  488. package/dist/safe-bash-presentation-engine/retained-xml-parts.d.ts +5 -1
  489. package/dist/safe-bash-presentation-engine/retained-xml-publication.d.ts +18 -0
  490. package/dist/safe-bash-presentation-engine/retained-xml-replacement.d.ts +13 -0
  491. package/dist/safe-bash-presentation-engine/sanitize.js +17 -16
  492. package/dist/safe-bash-presentation-engine/selectors.js +10 -10
  493. package/dist/safe-bash-presentation-engine/shape-groups.js +31 -30
  494. package/dist/safe-bash-presentation-engine/shape-operations.js +30 -29
  495. package/dist/safe-bash-presentation-engine/shape-path-operations.js +32 -31
  496. package/dist/safe-bash-presentation-engine/shape-paths.js +16 -15
  497. package/dist/safe-bash-presentation-engine/shape-presets.js +3 -3
  498. package/dist/safe-bash-presentation-engine/shape-selection.js +31 -30
  499. package/dist/safe-bash-presentation-engine/shape-transforms.js +18 -17
  500. package/dist/safe-bash-presentation-engine/shapes.d.ts +1 -1
  501. package/dist/safe-bash-presentation-engine/shapes.js +27 -26
  502. package/dist/safe-bash-presentation-engine/slide-copy.js +17 -16
  503. package/dist/safe-bash-presentation-engine/slide-import.js +18 -17
  504. package/dist/safe-bash-presentation-engine/slide-merge-split.js +20 -19
  505. package/dist/safe-bash-presentation-engine/slide-model.js +43 -42
  506. package/dist/safe-bash-presentation-engine/slide-removal.js +18 -17
  507. package/dist/safe-bash-presentation-engine/slide-transfer-budget.js +9 -9
  508. package/dist/safe-bash-presentation-engine/slides.js +19 -16
  509. package/dist/safe-bash-presentation-engine/table-operations.js +33 -32
  510. package/dist/safe-bash-presentation-engine/table-spans.js +32 -31
  511. package/dist/safe-bash-presentation-engine/tables.js +31 -30
  512. package/dist/safe-bash-presentation-engine/tags.js +16 -15
  513. package/dist/safe-bash-presentation-engine/template-bindings.js +33 -32
  514. package/dist/safe-bash-presentation-engine/template-repeat.js +40 -39
  515. package/dist/safe-bash-presentation-engine/text-fitting.js +27 -26
  516. package/dist/safe-bash-presentation-engine/text-frames.d.ts +13 -0
  517. package/dist/safe-bash-presentation-engine/text-frames.js +29 -26
  518. package/dist/safe-bash-presentation-engine/text-paragraphs.js +27 -26
  519. package/dist/safe-bash-presentation-engine/text-reading.js +11 -11
  520. package/dist/safe-bash-presentation-engine/text-replacement.js +17 -16
  521. package/dist/safe-bash-presentation-engine/text-runs.js +20 -19
  522. package/dist/safe-bash-presentation-engine/themes.js +16 -15
  523. package/dist/safe-bash-presentation-engine/transitions.js +16 -15
  524. package/dist/safe-bash-presentation-engine/validation.js +10 -9
  525. package/dist/safe-bash-presentation-engine/xml-parts.d.ts +2 -0
  526. package/dist/safe-bash-presentation-engine/xml-parts.js +23 -15
  527. package/dist/safe-bash-presentation-engine/xml-view.js +3 -3
  528. package/dist/safe-bash-presentation-engine/xml.js +3 -3
  529. package/dist/safe-bash-query-engine/index.js +4 -4
  530. package/dist/safe-bash-query-engine/interpreter.js +2 -2
  531. package/dist/safe-bash-query-engine/query-core.js +4 -4
  532. package/dist/safe-bash-regex-engine/index.js +1 -1
  533. package/dist/safe-bash-regex-engine/python-glob.js +1 -1
  534. package/dist/safe-bash-regex-engine/text/regex.d.ts +19 -0
  535. package/dist/safe-bash-regex-engine/text/regex.js +1 -1
  536. package/dist/safe-bash-xml-engine/document.js +3 -3
  537. package/dist/safe-bash-xml-engine/evaluate.js +1 -1
  538. package/dist/safe-bash-xml-engine/index.d.ts +1 -0
  539. package/dist/safe-bash-xml-engine/index.js +9 -5
  540. package/dist/safe-bash-xml-engine/query.js +2 -2
  541. package/dist/safe-bash-xml-engine/recovery.d.ts +10 -0
  542. package/dist/safe-bash-xml-engine/stored-document.d.ts +3 -3
  543. package/dist/safe-bash-xml-engine/stored-document.js +1 -1
  544. package/dist/safe-bash-xml-engine/stored-evaluate.js +1 -1
  545. package/dist/safe-bash-zip-engine/zip/repair.js +3 -3
  546. package/dist/safe-bash-zip-engine/zip/volumes.js +3 -3
  547. package/dist/spreadsheet-engine/datasource.js +16 -2
  548. package/dist/spreadsheet-engine/formulas/diagnostics.d.ts +2 -1
  549. package/dist/spreadsheet-engine/formulas/diagnostics.js +2 -2
  550. package/dist/spreadsheet-engine/formulas/evaluator.d.ts +1 -1
  551. package/dist/spreadsheet-engine/formulas/evaluator.js +2 -1
  552. package/dist/spreadsheet-engine/formulas/functions/python-printf.js +56 -33
  553. package/dist/spreadsheet-format-xls/biff-encrypted-properties.d.ts +1 -1
  554. package/dist/spreadsheet-format-xls/biff-encrypted-properties.js +54 -24
  555. package/dist/spreadsheet-format-xls/biff-properties-merge.d.ts +6 -2
  556. package/dist/spreadsheet-format-xls/biff-properties-merge.js +413 -296
  557. package/dist/spreadsheet-format-xls/biff-properties-write.js +40 -23
  558. package/dist/spreadsheet-format-xls/biff-properties.js +95 -175
  559. package/dist/spreadsheet-format-xls/biff-property-dictionary.d.ts +5 -0
  560. package/dist/spreadsheet-format-xls/biff-property-dictionary.js +75 -0
  561. package/dist/spreadsheet-format-xls/biff-property-index.d.ts +23 -0
  562. package/dist/spreadsheet-format-xls/biff-property-index.js +93 -0
  563. package/dist/spreadsheet-format-xls/biff-property-name.d.ts +4 -0
  564. package/dist/spreadsheet-format-xls/biff-property-name.js +114 -0
  565. package/dist/spreadsheet-format-xls/biff-property-range.d.ts +17 -3
  566. package/dist/spreadsheet-format-xls/biff-property-range.js +178 -37
  567. package/dist/spreadsheet-format-xls/biff-property-text.d.ts +6 -0
  568. package/dist/spreadsheet-format-xls/biff-property-text.js +68 -0
  569. package/dist/spreadsheet-format-xls/biff-property-transcode.d.ts +5 -0
  570. package/dist/spreadsheet-format-xls/biff-property-transcode.js +45 -0
  571. package/package.json +8 -3
  572. package/dist/safe-bash/command-chunks/biff-YKPDH35C-MVQIWNKV.js +0 -4974
  573. package/dist/safe-bash/command-chunks/chunk-2VLAXKTS.js +0 -245
  574. package/dist/safe-bash/command-chunks/chunk-5Q22ZLNC.js +0 -127
  575. package/dist/safe-bash/command-chunks/chunk-JKLOBSMP.js +0 -56
  576. package/dist/safe-bash/command-chunks/chunk-JYTESTBS.js +0 -99
  577. package/dist/safe-bash/command-chunks/chunk-ZEGNRZV2.js +0 -333
  578. package/dist/safe-bash/command-chunks/paradox-ZWWXYY4J-JYOSWSBL.js +0 -362
  579. package/dist/spreadsheet-format-xls/biff-properties-layout.js +0 -56
  580. package/dist/safe-bash/command-chunks/{chunk-X2HVVMTW.js → chunk-AW4Q3GZW.js} +6 -6
  581. package/dist/safe-bash/command-chunks/{chunk-JC2EV66U.js → chunk-BJXADHRT.js} +3 -3
  582. package/dist/safe-bash/command-chunks/{chunk-XI2LETBJ.js → chunk-BXU5Y7I5.js} +3 -3
  583. package/dist/safe-bash/command-chunks/{chunk-PVLPWVRH.js → chunk-D3HW7R2N.js} +3 -3
  584. package/dist/safe-bash/command-chunks/{chunk-OLK3DCJD.js → chunk-DYERIXPU.js} +3 -3
  585. package/dist/safe-bash/command-chunks/{chunk-WYBCSJFG.js → chunk-FWCUEZ3K.js} +3 -3
  586. package/dist/safe-bash/command-chunks/{chunk-FF2SQ2GP.js → chunk-GGH376XQ.js} +3 -3
  587. package/dist/safe-bash/command-chunks/{chunk-D66Q7QJ3.js → chunk-JRSZ5IGD.js} +6 -6
  588. package/dist/safe-bash/command-chunks/{chunk-Z3YB4EVE.js → chunk-KSM5CCHT.js} +8 -8
  589. package/dist/safe-bash/command-chunks/{chunk-NJ4NTTCR.js → chunk-LNLACEAN.js} +8 -8
  590. package/dist/safe-bash/command-chunks/{chunk-NBTG6NF6.js → chunk-LTJRUMK6.js} +3 -3
  591. package/dist/safe-bash/command-chunks/{chunk-XCYTG7CR.js → chunk-NJGL5JQ6.js} +3 -3
  592. package/dist/safe-bash/command-chunks/{chunk-SZ66JC25.js → chunk-Q7J2NTH2.js} +3 -3
  593. package/dist/safe-bash/command-chunks/{chunk-MDV7W5AS.js → chunk-SKNI2XQA.js} +3 -3
  594. package/dist/safe-bash/command-chunks/{chunk-7ZWACKCG.js → chunk-T6OXG7QQ.js} +3 -3
  595. package/dist/safe-bash/command-chunks/{chunk-ECDEPKKW.js → chunk-W25EIKDJ.js} +3 -3
  596. package/dist/safe-bash/command-chunks/{chunk-4YSBUQPV.js → chunk-W2FKFEVY.js} +3 -3
  597. package/dist/safe-bash/command-chunks/{chunk-2CIDPOUV.js → chunk-WSNHJZQ5.js} +3 -3
  598. package/dist/safe-bash/command-chunks/{chunk-4H3TYOVC.js → chunk-Y7AXMCFV.js} +3 -3
  599. package/dist/safe-bash/command-chunks/{chunk-U6IEK2CI.js → chunk-YPG55QTP.js} +7 -7
  600. package/dist/safe-bash/command-chunks/{chunk-252L5YC5.js → chunk-Z37OM247.js} +6 -6
  601. package/dist/safe-bash/command-chunks/{pln-DFS7VLVS-JATX6FS7.js → pln-DFS7VLVS-OVOBS4QX.js} +3 -3
  602. package/dist/safe-bash/command-chunks/{psion-YBI6JEQI-6OMC2PGC.js → psion-YBI6JEQI-GY4S6ZLC.js} +3 -3
@@ -1,10 +1,295 @@
1
1
  import "./chunk-37XCUS43.js";
2
- import "./chunk-IOEUZ4EA.js";
2
+ import {
3
+ ZipDirectoryIndex
4
+ } from "./chunk-IOEUZ4EA.js";
3
5
  import {
4
6
  yieldEventLoop
5
7
  } from "./chunk-E6SK3OU2.js";
8
+ import {
9
+ BackedJson,
10
+ parseBackedJson
11
+ } from "./chunk-NUGQQDGE.js";
6
12
  import "./chunk-65DS4IOB.js";
7
13
 
14
+ // packages/safe-bash-command-pptx/src/retained-pack-manifest.ts
15
+ import { PagedStorage } from "@poe-platform/safe-fs/storage";
16
+ import { resourceContext } from "../../safe-bash-presentation-engine/resource-limits.js";
17
+ import { OfficeError as OfficeError2 } from "../../safe-bash-presentation-engine/errors.js";
18
+ import { asciiKey, partName } from "../../safe-bash-presentation-engine/package-uri.js";
19
+
20
+ // packages/safe-bash-command-pptx/src/command-package-path.ts
21
+ import { OfficeError } from "../../safe-bash-presentation-engine/errors.js";
22
+ function usage(message) {
23
+ throw new OfficeError("invalid-value", message, "usage");
24
+ }
25
+ function scopedPackagePath(manifest, path) {
26
+ if (path === "-") return path;
27
+ if (path.includes("\\") || [...path].some((c) => c.charCodeAt(0) < 32))
28
+ usage("Invalid scoped file path.");
29
+ const prefix = path.startsWith("/") ? "" : manifest === "-" ? "/" : manifest.slice(0, manifest.lastIndexOf("/") + 1);
30
+ const absolute = (prefix + path).startsWith("/");
31
+ const segments = [];
32
+ for (const segment of (prefix + path).split("/")) {
33
+ if (!segment || segment === ".") continue;
34
+ if (segment === "..") {
35
+ if (!segments.length) usage("Scoped path escapes its root.");
36
+ segments.pop();
37
+ } else segments.push(segment);
38
+ }
39
+ return (absolute ? "/" : "") + segments.join("/");
40
+ }
41
+
42
+ // packages/safe-bash-command-pptx/src/retained-pack-manifest.ts
43
+ async function openRetainedPackManifest(source3, settings, options2) {
44
+ const context = resourceContext(settings), signal = context.signal ?? new AbortController().signal;
45
+ const working = { ...settings.workingStorage }, cacheBytes = working.cacheBytes ?? 1024 * 1024;
46
+ if (!working.fs || typeof working.directory !== "string" || !working.directory.startsWith("/") || !Number.isSafeInteger(cacheBytes) || cacheBytes < 16384 || cacheBytes % 16384)
47
+ throw new OfficeError2("invalid-value", "Explicit manifest storage and a valid cache budget are required.", "usage");
48
+ const manifestPath = options2.manifest, outputPath = options2.output;
49
+ const pages = new PagedStorage({ fs: working.fs, cwd: working.directory, env: {}, signal }, cacheBytes / 16384);
50
+ const index = new PagedStorage({ fs: working.fs, cwd: working.directory, env: {}, signal }, cacheBytes / 16384);
51
+ let closed = false, closing, count = 0, parts = 0;
52
+ const check = () => {
53
+ if (closed) throw new OfficeError2("invalid-handle", "Manifest is closed.", "admit");
54
+ if (signal.aborted) throw new OfficeError2("cancelled", "Operation cancelled.", "admit");
55
+ };
56
+ const usage14 = () => {
57
+ throw new OfficeError2("invalid-value", "Manifest requires unique canonical parts, hashes and explicit scoped files.", "usage");
58
+ };
59
+ const limit = () => {
60
+ throw new OfficeError2("resource-limit", "Manifest exceeds input limits.", "admit");
61
+ };
62
+ const failure = (error) => error instanceof OfficeError2 ? error : new OfficeError2(signal.aborted ? "cancelled" : error && typeof error === "object" && "code" in error && error.code === "EFBIG" ? "resource-limit" : "io-failure", "Manifest input or storage failed.", "admit");
63
+ const close = () => {
64
+ closed = true;
65
+ return closing ??= (async () => {
66
+ const outcomes = await Promise.allSettled([pages.close(), index.close()]);
67
+ for (const outcome of outcomes) if (outcome.status === "rejected") throw outcome.reason;
68
+ })();
69
+ };
70
+ let work = 0;
71
+ const cooperate = async (units = 1) => {
72
+ check();
73
+ work += units;
74
+ if (work >= 4096) {
75
+ work = 0;
76
+ await yieldEventLoop();
77
+ check();
78
+ }
79
+ };
80
+ const tree = new BackedJson(pages, cooperate), names = new ZipDirectoryIndex(index, { signal });
81
+ async function text2(position) {
82
+ let value = "";
83
+ for await (const fragment of tree.scalarChunks(position)) {
84
+ check();
85
+ value += fragment;
86
+ }
87
+ return value;
88
+ }
89
+ async function fields2(position, keys) {
90
+ const header = await tree.describe(position);
91
+ if (header.kind !== "object" || header.children !== keys.length * 2) usage14();
92
+ const result = {};
93
+ let key;
94
+ for await (const child of tree.children(position)) {
95
+ check();
96
+ if (key === void 0) {
97
+ key = await tree.smallText(child, Math.max(...keys.map((key2) => key2.length)));
98
+ if (key === void 0 || !keys.includes(key)) usage14();
99
+ } else {
100
+ result[key] = child;
101
+ key = void 0;
102
+ }
103
+ }
104
+ return result;
105
+ }
106
+ async function member(row) {
107
+ const fields3 = { part: await tree.property(row, "part"), sha256: await tree.property(row, "sha256") };
108
+ const part = await tree.smallText(fields3.part, 65535), sha2565 = await tree.smallText(fields3.sha256, 64);
109
+ if (part === void 0) return limit();
110
+ if (sha2565 === void 0) return usage14();
111
+ return { part, sha256: sha2565 };
112
+ }
113
+ async function pathAt(row) {
114
+ const file = await tree.property(row, "file"), path = await tree.property(file, "vfsPath");
115
+ return scopedPackagePath(manifestPath, await text2(path));
116
+ }
117
+ async function* decoded() {
118
+ let iterator, exhausted = false, size = 0;
119
+ const decoder = new TextDecoder("utf-8", { fatal: true });
120
+ try {
121
+ iterator = source3[Symbol.asyncIterator]();
122
+ for (let reads = 0; reads < context.limits.maxReads; reads++) {
123
+ await cooperate();
124
+ const item = await iterator.next();
125
+ check();
126
+ if (item.done) {
127
+ exhausted = true;
128
+ let tail;
129
+ try {
130
+ tail = decoder.decode();
131
+ } catch {
132
+ usage14();
133
+ }
134
+ if (tail) yield tail;
135
+ return;
136
+ }
137
+ if (!(item.value instanceof Uint8Array)) throw new OfficeError2("invalid-type", "Manifest source returned invalid bytes.", "admit");
138
+ size += item.value.length;
139
+ if (!Number.isSafeInteger(size) || size > Math.min(context.limits.maxBytes, context.xmlLimits.maxBytes)) limit();
140
+ for (let offset = 0; offset < item.value.length; offset += 16384) {
141
+ check();
142
+ let fragment;
143
+ try {
144
+ fragment = decoder.decode(item.value.subarray(offset, offset + 16384), { stream: true });
145
+ } catch {
146
+ usage14();
147
+ }
148
+ if (fragment) yield fragment;
149
+ }
150
+ }
151
+ limit();
152
+ } finally {
153
+ if (!exhausted) try {
154
+ await iterator?.return?.();
155
+ } catch {
156
+ }
157
+ }
158
+ }
159
+ try {
160
+ check();
161
+ await parseBackedJson(decoded(), tree, index, cooperate, usage14, void 0, false, (depth) => {
162
+ if (depth > 32) usage14();
163
+ });
164
+ parts = (await fields2(tree.rootPosition, ["parts"])).parts;
165
+ const array = await tree.describe(parts);
166
+ if (array.kind !== "array" || !array.children) usage14();
167
+ count = array.children;
168
+ if (count > context.archiveLimits.maxMembers) limit();
169
+ let stdin = manifestPath === "-" ? 1 : 0;
170
+ if (outputPath !== "-" && outputPath === manifestPath) usage14();
171
+ for await (const row of tree.children(parts)) {
172
+ check();
173
+ const values3 = await fields2(row, ["part", "sha256", "file"]);
174
+ for (const key2 of ["part", "sha256"]) if ((await tree.describe(values3[key2])).kind !== "string") usage14();
175
+ const item = await member(row);
176
+ try {
177
+ if (partName(item.part, false) !== item.part) usage14();
178
+ } catch {
179
+ usage14();
180
+ }
181
+ if (item.sha256.length !== 64 || [...item.sha256].some((character) => !"0123456789abcdef".includes(character))) usage14();
182
+ const key = asciiKey(item.part);
183
+ if (await names.get(key) !== void 0) usage14();
184
+ await names.set(key, row);
185
+ const file = await fields2(values3.file, ["vfsPath"]);
186
+ if ((await tree.describe(file.vfsPath)).kind !== "string") usage14();
187
+ const rawPath = await text2(file.vfsPath);
188
+ if (!rawPath.length) usage14();
189
+ const path = scopedPackagePath(manifestPath, rawPath);
190
+ if (path === "-" && ++stdin > 1 || outputPath !== "-" && path === outputPath) usage14();
191
+ }
192
+ return Object.freeze({
193
+ count,
194
+ close,
195
+ async *members() {
196
+ try {
197
+ check();
198
+ for await (const row of tree.children(parts)) {
199
+ check();
200
+ yield await member(row);
201
+ }
202
+ check();
203
+ } catch (error) {
204
+ throw failure(error);
205
+ }
206
+ },
207
+ async path(part) {
208
+ try {
209
+ check();
210
+ const row = await names.get(asciiKey(part));
211
+ if (row === void 0) throw new OfficeError2("missing-binding", "Manifest member is absent.", "admit");
212
+ return await pathAt(row);
213
+ } catch (error) {
214
+ throw failure(error);
215
+ }
216
+ },
217
+ async *paths() {
218
+ try {
219
+ check();
220
+ yield manifestPath;
221
+ for await (const row of tree.children(parts)) {
222
+ check();
223
+ yield await pathAt(row);
224
+ }
225
+ check();
226
+ } catch (error) {
227
+ throw failure(error);
228
+ }
229
+ }
230
+ });
231
+ } catch (error) {
232
+ const primary = failure(error);
233
+ await close().catch(() => {
234
+ });
235
+ throw primary;
236
+ }
237
+ }
238
+
239
+ // packages/safe-bash-command-pptx/src/command-engine.ts
240
+ import { stageRetainedPackage } from "../../safe-bash-presentation-engine/package-tools.js";
241
+
242
+ // packages/safe-bash-command-pptx/src/command-extract-streaming.ts
243
+ import { openRetainedPackageExtraction, stageRetainedExtractionOutput } from "../../safe-bash-presentation-engine/package-tools.js";
244
+ import { OfficeError as OfficeError3 } from "../../safe-bash-presentation-engine/errors.js";
245
+ async function prepareRetainedExtraction(args, request, options2) {
246
+ const { streaming, signal } = request, context = { ...options2.context, signal, workingStorage: streaming.workingStorage };
247
+ const input = await streaming.openInput(args.input, Math.min(context.limits.maxBytes, context.archiveLimits.maxArchiveBytes));
248
+ const extraction = await openRetainedPackageExtraction(input, context, args.parts ? { parts: args.parts } : {});
249
+ let response, closing;
250
+ const close = () => closing ??= (async () => {
251
+ const results = await Promise.allSettled([response?.close(), extraction.close()]);
252
+ for (const result of results) if (result.status === "rejected") throw result.reason;
253
+ })();
254
+ try {
255
+ let total = 0;
256
+ for await (const member of extraction.members()) total += member.size;
257
+ if (extraction.count > (args.limits?.maxOutputs ?? context.archiveLimits.maxMembers) || !Number.isSafeInteger(total) || total > options2.maxOutputBytes)
258
+ throw new OfficeError3("resource-limit", "Package extraction exceeds output limits.", "validate-intent");
259
+ if (!request.publishOutputStreams && (!args.allowPartialOutput || !request.publishOutput)) throw Object.assign(new Error("Extraction requires a publication capability."), { code: "publication-unsupported" });
260
+ response = await stageRetainedExtractionOutput(extraction, context, { directory: args.outputDir, json: args.json, maxOutputBytes: options2.maxOutputBytes, allowPartialOutput: args.allowPartialOutput ?? false });
261
+ async function* publications(dryRun) {
262
+ for await (const member of extraction.members()) {
263
+ signal.throwIfAborted();
264
+ yield { inputPath: args.input, outputPath: response.path(member.name), bytes: member.bytes(), originalBytes: input, inPlace: false, force: args.force ?? false, dryRun };
265
+ }
266
+ }
267
+ return { close, async publish() {
268
+ let published = 0, code;
269
+ try {
270
+ for await (const item of publications(true)) {
271
+ if (request.preflightOutputStream) await request.preflightOutputStream(item);
272
+ else if (request.publishOutput) await request.publishOutput(item);
273
+ }
274
+ if (request.publishOutputStreams) await request.publishOutputStreams(publications(false));
275
+ else for await (const item of publications(false)) {
276
+ await request.publishOutput(item);
277
+ published++;
278
+ }
279
+ } catch (error) {
280
+ const raw = error && typeof error === "object" && "code" in error ? error.code : void 0;
281
+ code = signal.aborted ? "cancelled" : typeof raw === "string" && ["resource-limit", "stale-input", "publication-unsupported"].includes(raw) ? raw : "io-failure";
282
+ }
283
+ await response.write(!code || args.json ? streaming.stdout : streaming.stderr, code ? { code, published } : void 0);
284
+ return { exitCode: !code ? 0 : code === "cancelled" ? 130 : code === "resource-limit" ? 4 : code === "stale-input" ? 1 : 3, stdout: new Uint8Array(), stderr: new Uint8Array() };
285
+ } };
286
+ } catch (error) {
287
+ await close().catch(() => {
288
+ });
289
+ throw error;
290
+ }
291
+ }
292
+
8
293
  // packages/safe-bash-command-pptx/src/command-engine.ts
9
294
  import { stageRetainedText } from "../../safe-bash-presentation-engine/retained-text.js";
10
295
  import { stageRetainedInspection } from "../../safe-bash-presentation-engine/retained-inspection.js";
@@ -12,7 +297,7 @@ import { openPackageArchive } from "../../safe-bash-presentation-engine/retained
12
297
 
13
298
  // packages/safe-bash-command-pptx/src/capabilities-discovery.ts
14
299
  import { parseContentTypes } from "../../safe-bash-presentation-engine/content-types.js";
15
- import { OfficeError } from "../../safe-bash-presentation-engine/errors.js";
300
+ import { OfficeError as OfficeError4 } from "../../safe-bash-presentation-engine/errors.js";
16
301
  import { readRelationshipGraph } from "../../safe-bash-presentation-engine/relationships.js";
17
302
  import { readPackage } from "../../safe-bash-presentation-engine/package-reader.js";
18
303
  import { parseXmlPart } from "../../safe-bash-presentation-engine/xml.js";
@@ -49,7 +334,7 @@ function declaredFeatureCapabilities(features, operations) {
49
334
  Object.entries(features).map(([name, feature]) => {
50
335
  const paths = feature.operations ?? (feature.operation ? [feature.operation] : featureOperations[name]);
51
336
  if (!paths?.length || paths.some((path) => !Object.hasOwn(operations, path))) {
52
- throw new OfficeError(
337
+ throw new OfficeError4(
53
338
  "invalid-value",
54
339
  "Capability references an undeclared operation.",
55
340
  "usage"
@@ -99,7 +384,7 @@ async function assessCapabilities(input, context) {
99
384
  try {
100
385
  contentType = types.get(part);
101
386
  } catch (error) {
102
- if (!(error instanceof OfficeError) || error.code !== "missing-binding") throw error;
387
+ if (!(error instanceof OfficeError4) || error.code !== "missing-binding") throw error;
103
388
  }
104
389
  }
105
390
  const type = contentType?.split(";", 1)[0].trim().toLowerCase();
@@ -114,7 +399,7 @@ async function assessCapabilities(input, context) {
114
399
  const data = reader.get(part);
115
400
  xmlBytes += data.length;
116
401
  if (xmlBytes > context.xmlLimits.maxBytes || nodes >= context.xmlLimits.maxNodes)
117
- throw new OfficeError(
402
+ throw new OfficeError4(
118
403
  "resource-limit",
119
404
  "Capability XML inspection limit exceeded.",
120
405
  "index"
@@ -125,7 +410,7 @@ async function assessCapabilities(input, context) {
125
410
  });
126
411
  nodes += xml.nodeCount;
127
412
  if (nodes > context.xmlLimits.maxNodes)
128
- throw new OfficeError("resource-limit", "Capability XML node limit exceeded.", "index");
413
+ throw new OfficeError4("resource-limit", "Capability XML node limit exceeded.", "index");
129
414
  const pending = [xml.root];
130
415
  let visited = 0;
131
416
  while (pending.length) {
@@ -3464,7 +3749,7 @@ var discoverySchemas = Object.fromEntries([
3464
3749
  }]));
3465
3750
 
3466
3751
  // packages/safe-bash-command-pptx/src/command-objects-add.ts
3467
- import { OfficeError as OfficeError2 } from "../../safe-bash-presentation-engine/errors.js";
3752
+ import { OfficeError as OfficeError5 } from "../../safe-bash-presentation-engine/errors.js";
3468
3753
  import { addOleObject } from "../../safe-bash-presentation-engine/ole-insertion.js";
3469
3754
  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
3755
  var length = {
@@ -3571,24 +3856,24 @@ var objectsAddSchema = {
3571
3856
  }
3572
3857
  }
3573
3858
  };
3574
- function usage(message) {
3575
- throw new OfficeError2("invalid-value", message, "usage");
3859
+ function usage2(message) {
3860
+ throw new OfficeError5("invalid-value", message, "usage");
3576
3861
  }
3577
3862
  function validateObjectsAddCommand(args, positionals, seen) {
3578
3863
  const allowed = Object.keys(objectsAddSchema.options.properties).map(
3579
3864
  (key) => "--" + [...key].map((c) => c >= "A" && c <= "Z" ? "-" + c.toLowerCase() : c).join("")
3580
3865
  );
3581
3866
  if ([...seen].some((flag) => !allowed.includes(flag)))
3582
- usage("Option does not apply to object insertion.");
3867
+ usage2("Option does not apply to object insertion.");
3583
3868
  if (positionals.length !== 1 || !positionals[0])
3584
- usage("Object insertion requires exactly one input.");
3869
+ usage2("Object insertion requires exactly one input.");
3585
3870
  args.input = positionals[0];
3586
3871
  if (seen.has("--program-id") && seen.has("--program"))
3587
- usage("Program and program ID are mutually exclusive.");
3872
+ usage2("Program and program ID are mutually exclusive.");
3588
3873
  if (!args.slide || !args.file || !args.icon || !args.objectAdd?.progId)
3589
- usage("Object insertion requires slide, file, icon and program ID.");
3874
+ usage2("Object insertion requires slide, file, icon and program ID.");
3590
3875
  if ([args.input, args.file, args.icon].filter((path) => path === "-").length > 1)
3591
- usage("Only one input may consume stdin.");
3876
+ usage2("Only one input may consume stdin.");
3592
3877
  if (!args.iconContentType) {
3593
3878
  const extension = args.icon.slice(args.icon.lastIndexOf(".") + 1).toLowerCase();
3594
3879
  const type = {
@@ -3601,16 +3886,16 @@ function validateObjectsAddCommand(args, positionals, seen) {
3601
3886
  tiff: "image/tiff",
3602
3887
  wmf: "image/x-wmf"
3603
3888
  };
3604
- if (!type[extension]) usage("Icon requires a supported extension or explicit content type.");
3889
+ if (!type[extension]) usage2("Icon requires a supported extension or explicit content type.");
3605
3890
  args.iconContentType = type[extension];
3606
3891
  }
3607
3892
  if (args.inPlace && (args.input === "-" || args.output))
3608
- usage("In-place requires a named input and no output flag.");
3609
- if (!args.dryRun && !args.inPlace && !args.output) usage("Mutation requires a destination.");
3610
- if (args.force && !args.output) usage("Force requires an explicit output.");
3893
+ usage2("In-place requires a named input and no output flag.");
3894
+ if (!args.dryRun && !args.inPlace && !args.output) usage2("Mutation requires a destination.");
3895
+ if (args.force && !args.output) usage2("Force requires an explicit output.");
3611
3896
  if (args.output === args.input && args.output !== "-")
3612
- usage("Replacing input requires --in-place.");
3613
- if (args.output === "-" && args.json && !args.dryRun) usage("Binary stdout conflicts with JSON.");
3897
+ usage2("Replacing input requires --in-place.");
3898
+ if (args.output === "-" && args.json && !args.dryRun) usage2("Binary stdout conflicts with JSON.");
3614
3899
  }
3615
3900
  async function executeObjectsAddCommand(args, request, options2) {
3616
3901
  const context = { ...options2.context, signal: request.signal };
@@ -3802,7 +4087,7 @@ var packageToolsSchemas = Object.fromEntries(
3802
4087
  );
3803
4088
 
3804
4089
  // packages/safe-bash-command-pptx/src/command-engine-values.ts
3805
- import { OfficeError as OfficeError3 } from "../../safe-bash-presentation-engine/errors.js";
4090
+ import { OfficeError as OfficeError6 } from "../../safe-bash-presentation-engine/errors.js";
3806
4091
  function commandLength(value, minimum = 1) {
3807
4092
  const units = { emu: 1, in: 914400, cm: 36e4, mm: 36e3, pt: 12700 };
3808
4093
  const unit = Object.keys(units).find((candidate) => value.endsWith(candidate));
@@ -3811,7 +4096,7 @@ function commandLength(value, minimum = 1) {
3811
4096
  if (!unit || pieces.length > 2 || !pieces[0] || pieces.some(
3812
4097
  (piece) => !piece || [...piece].some((character) => character < "0" || character > "9")
3813
4098
  ))
3814
- throw new OfficeError3(
4099
+ throw new OfficeError6(
3815
4100
  "invalid-value",
3816
4101
  "Lengths require a decimal and emu, in, cm, mm or pt unit.",
3817
4102
  "usage"
@@ -3819,13 +4104,13 @@ function commandLength(value, minimum = 1) {
3819
4104
  const raw = Number(digits) * units[unit];
3820
4105
  const result = Math.sign(raw) * Math.round(Math.abs(raw));
3821
4106
  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");
4107
+ throw new OfficeError6("invalid-value", "Length is outside the supported range.", "usage");
3823
4108
  return result;
3824
4109
  }
3825
4110
  function commandTimestamp(value) {
3826
4111
  const date = new Date(value);
3827
4112
  if (!Number.isFinite(date.getTime()) || !value.endsWith("Z") || date.toISOString() !== value && date.toISOString() !== value.slice(0, -1) + ".000Z")
3828
- throw new OfficeError3(
4113
+ throw new OfficeError6(
3829
4114
  "invalid-value",
3830
4115
  "Timestamp requires a valid UTC date with seconds and Z suffix.",
3831
4116
  "usage"
@@ -3859,7 +4144,7 @@ function commandJson(value) {
3859
4144
  }
3860
4145
  return JSON.parse(value);
3861
4146
  } catch {
3862
- throw new OfficeError3(
4147
+ throw new OfficeError6(
3863
4148
  "invalid-value",
3864
4149
  "Structured slides require valid JSON without duplicate keys, at most 32 levels deep.",
3865
4150
  "usage"
@@ -3869,31 +4154,15 @@ function commandJson(value) {
3869
4154
 
3870
4155
  // packages/safe-bash-command-pptx/src/command-package-tools.ts
3871
4156
  import { sha256 } from "@noble/hashes/sha2.js";
3872
- import { OfficeError as OfficeError4 } from "../../safe-bash-presentation-engine/errors.js";
3873
- import { asciiKey, partName } from "../../safe-bash-presentation-engine/package-uri.js";
4157
+ import { OfficeError as OfficeError7 } from "../../safe-bash-presentation-engine/errors.js";
4158
+ import { asciiKey as asciiKey2, partName as partName2 } from "../../safe-bash-presentation-engine/package-uri.js";
3874
4159
  import { extractPackage, packPackage } from "../../safe-bash-presentation-engine/package-tools.js";
3875
- function usage2(message) {
3876
- throw new OfficeError4("invalid-value", message, "usage");
3877
- }
3878
- function scopedPath(manifest, path) {
3879
- if (path === "-") return path;
3880
- if (path.includes("\\") || [...path].some((c) => c.charCodeAt(0) < 32))
3881
- usage2("Invalid scoped file path.");
3882
- const prefix = path.startsWith("/") ? "" : manifest === "-" ? "/" : manifest.slice(0, manifest.lastIndexOf("/") + 1);
3883
- const absolute = (prefix + path).startsWith("/");
3884
- const segments = [];
3885
- for (const segment of (prefix + path).split("/")) {
3886
- if (!segment || segment === ".") continue;
3887
- if (segment === "..") {
3888
- if (!segments.length) usage2("Scoped path escapes its root.");
3889
- segments.pop();
3890
- } else segments.push(segment);
3891
- }
3892
- return (absolute ? "/" : "") + segments.join("/");
4160
+ function usage3(message) {
4161
+ throw new OfficeError7("invalid-value", message, "usage");
3893
4162
  }
3894
4163
  function canonical(part) {
3895
4164
  try {
3896
- return typeof part === "string" && partName(part, false) === part;
4165
+ return typeof part === "string" && partName2(part, false) === part;
3897
4166
  } catch {
3898
4167
  return false;
3899
4168
  }
@@ -3903,23 +4172,23 @@ function validatePackageCommand(args, positionals, seen) {
3903
4172
  (key) => "--" + [...key].map((c) => c >= "A" && c <= "Z" ? "-" + c.toLowerCase() : c).join("")
3904
4173
  );
3905
4174
  if ([...seen].some((flag) => !allowed.includes(flag)))
3906
- usage2("Option does not apply to package tools.");
4175
+ usage3("Option does not apply to package tools.");
3907
4176
  if (args.operation === "extract") {
3908
- if (positionals.length !== 1 || !positionals[0]) usage2("Extraction requires one input.");
4177
+ if (positionals.length !== 1 || !positionals[0]) usage3("Extraction requires one input.");
3909
4178
  args.input = positionals[0];
3910
4179
  if (!args.outputDir || args.outputDir === "-")
3911
- usage2("Extraction requires an output directory.");
3912
- if (args.parts && (!args.parts.length || args.parts.some((part) => !canonical(part)) || new Set(args.parts.map(asciiKey)).size !== args.parts.length))
3913
- usage2("Parts require unique canonical part URIs.");
4180
+ usage3("Extraction requires an output directory.");
4181
+ if (args.parts && (!args.parts.length || args.parts.some((part) => !canonical(part)) || new Set(args.parts.map(asciiKey2)).size !== args.parts.length))
4182
+ usage3("Parts require unique canonical part URIs.");
3914
4183
  } else {
3915
4184
  if (positionals.length || !args.manifest)
3916
- usage2("Pack requires a manifest and no positional inputs.");
3917
- if (!args.output && !args.dryRun) usage2("Pack requires output or dry-run.");
3918
- if (args.force && !args.output) usage2("Force requires output.");
4185
+ usage3("Pack requires a manifest and no positional inputs.");
4186
+ if (!args.output && !args.dryRun) usage3("Pack requires output or dry-run.");
4187
+ if (args.force && !args.output) usage3("Force requires output.");
3919
4188
  if (args.output === "-" && args.json && !args.dryRun)
3920
- usage2("Binary stdout cannot be combined with JSON.");
4189
+ usage3("Binary stdout cannot be combined with JSON.");
3921
4190
  if (args.output === args.manifest && args.output !== "-")
3922
- usage2("Output cannot replace manifest.");
4191
+ usage3("Output cannot replace manifest.");
3923
4192
  }
3924
4193
  }
3925
4194
  async function executePackageCommand(args, request, options2) {
@@ -3940,7 +4209,7 @@ async function executePackageCommand(args, request, options2) {
3940
4209
  );
3941
4210
  const files = await extractPackage(bytes2, context, args.parts ? { parts: args.parts } : {});
3942
4211
  if (files.length > (args.limits?.maxOutputs ?? context.archiveLimits.maxMembers) || files.reduce((sum, file) => sum + file.bytes.length, 0) > options2.maxOutputBytes)
3943
- throw new OfficeError4(
4212
+ throw new OfficeError7(
3944
4213
  "resource-limit",
3945
4214
  "Package extraction exceeds output limits.",
3946
4215
  "validate-intent"
@@ -3972,7 +4241,7 @@ async function executePackageCommand(args, request, options2) {
3972
4241
  };
3973
4242
  }
3974
4243
  if (args.creation?.author !== void 0 || args.creation?.timestamp !== void 0)
3975
- throw new OfficeError4(
4244
+ throw new OfficeError7(
3976
4245
  "unsupported-edit",
3977
4246
  "Pack metadata overrides are unavailable; source properties are preserved.",
3978
4247
  "validate-intent"
@@ -3982,28 +4251,28 @@ async function executePackageCommand(args, request, options2) {
3982
4251
  Math.min(context.limits.maxBytes, context.xmlLimits.maxBytes)
3983
4252
  );
3984
4253
  if (encoded.length > Math.min(context.limits.maxBytes, context.xmlLimits.maxBytes))
3985
- throw new OfficeError4("resource-limit", "Manifest exceeds byte limit.", "admit");
4254
+ throw new OfficeError7("resource-limit", "Manifest exceeds byte limit.", "admit");
3986
4255
  let value;
3987
4256
  try {
3988
4257
  value = commandJson(new TextDecoder("utf-8", { fatal: true }).decode(encoded));
3989
4258
  } catch {
3990
- usage2("Manifest must be valid JSON.");
4259
+ usage3("Manifest must be valid JSON.");
3991
4260
  }
3992
4261
  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
- usage2("Manifest requires a nonempty parts array.");
4262
+ usage3("Manifest requires a nonempty parts array.");
3994
4263
  if (value.parts.length > context.archiveLimits.maxMembers)
3995
- throw new OfficeError4("resource-limit", "Manifest exceeds member limit.", "admit");
4264
+ throw new OfficeError7("resource-limit", "Manifest exceeds member limit.", "admit");
3996
4265
  const parts = value.parts;
3997
4266
  for (const item of parts)
3998
4267
  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)
3999
- usage2("Manifest parts require canonical URIs, hashes and explicit scoped files.");
4000
- if (new Set(parts.map((item) => asciiKey(item.part))).size !== parts.length)
4001
- usage2("Manifest parts must be unique.");
4002
- const paths = parts.map((item) => scopedPath(args.manifest, item.file.vfsPath));
4268
+ usage3("Manifest parts require canonical URIs, hashes and explicit scoped files.");
4269
+ if (new Set(parts.map((item) => asciiKey2(item.part))).size !== parts.length)
4270
+ usage3("Manifest parts must be unique.");
4271
+ const paths = parts.map((item) => scopedPackagePath(args.manifest, item.file.vfsPath));
4003
4272
  if ([args.manifest, ...paths].filter((path) => path === "-").length > 1)
4004
- usage2("Only one manifest input may consume stdin.");
4273
+ usage3("Only one manifest input may consume stdin.");
4005
4274
  if (args.output !== "-" && paths.includes(args.output))
4006
- usage2("Output cannot replace a source file.");
4275
+ usage3("Output cannot replace a source file.");
4007
4276
  let total = 0;
4008
4277
  const members = [];
4009
4278
  for (const [index, item] of parts.entries()) {
@@ -4014,7 +4283,7 @@ async function executePackageCommand(args, request, options2) {
4014
4283
  );
4015
4284
  total += bytes2.length;
4016
4285
  if (bytes2.length > context.archiveLimits.maxEntryBytes || total > context.archiveLimits.maxTotalBytes)
4017
- throw new OfficeError4("resource-limit", "Manifest contents exceed byte limit.", "admit");
4286
+ throw new OfficeError7("resource-limit", "Manifest contents exceed byte limit.", "admit");
4018
4287
  members.push({ part: item.part, sha256: item.sha256, bytes: bytes2 });
4019
4288
  }
4020
4289
  const bytes = await packPackage(
@@ -4023,7 +4292,7 @@ async function executePackageCommand(args, request, options2) {
4023
4292
  args.creation?.kind ? { kind: args.creation.kind } : {}
4024
4293
  );
4025
4294
  if (bytes.length > options2.maxOutputBytes)
4026
- throw new OfficeError4("resource-limit", "Packed output exceeds byte limit.", "validate-intent");
4295
+ throw new OfficeError7("resource-limit", "Packed output exceeds byte limit.", "validate-intent");
4027
4296
  const dryRun = args.dryRun ?? false;
4028
4297
  const fingerprint = [...sha256(bytes)].map((byte) => byte.toString(16).padStart(2, "0")).join("");
4029
4298
  if (args.output && args.output !== "-" && !request.publishOutput)
@@ -4059,7 +4328,7 @@ async function executePackageCommand(args, request, options2) {
4059
4328
  }
4060
4329
 
4061
4330
  // packages/safe-bash-command-pptx/src/command-diff.ts
4062
- import { OfficeError as OfficeError5 } from "../../safe-bash-presentation-engine/errors.js";
4331
+ import { OfficeError as OfficeError8 } from "../../safe-bash-presentation-engine/errors.js";
4063
4332
  import { comparePresentations } from "../../safe-bash-presentation-engine/diff.js";
4064
4333
 
4065
4334
  // packages/safe-bash-command-pptx/src/diff-schema.ts
@@ -4165,7 +4434,7 @@ async function executeDiffCommand(request, options2) {
4165
4434
  let human = "";
4166
4435
  let exitCode = 0;
4167
4436
  const failure = (error) => {
4168
- const office = error instanceof OfficeError5 ? error : void 0;
4437
+ const office = error instanceof OfficeError8 ? error : void 0;
4169
4438
  const code = request.signal.aborted ? "cancelled" : office?.code ?? (error && typeof error === "object" && "code" in error && error.code === "resource-limit" ? "resource-limit" : "io-failure");
4170
4439
  exitCode = code === "cancelled" ? 130 : 2;
4171
4440
  const message = office?.message ?? (code === "cancelled" ? "Comparison cancelled." : "Comparison input could not be read.");
@@ -4182,20 +4451,20 @@ async function executeDiffCommand(request, options2) {
4182
4451
  errors: [{ code, message, context: { phase: office?.phase ?? "admit" } }]
4183
4452
  };
4184
4453
  };
4185
- const usage13 = (message) => {
4186
- throw new OfficeError5("invalid-value", message, "usage");
4454
+ const usage14 = (message) => {
4455
+ throw new OfficeError8("invalid-value", message, "usage");
4187
4456
  };
4188
4457
  try {
4189
4458
  let byteCount = 0;
4190
4459
  const args = request.args.map((bytes2) => {
4191
- if (!(bytes2 instanceof Uint8Array)) usage13("Arguments must be byte arrays.");
4460
+ if (!(bytes2 instanceof Uint8Array)) usage14("Arguments must be byte arrays.");
4192
4461
  byteCount += bytes2.byteLength;
4193
4462
  if (byteCount > options2.maxArgumentBytes)
4194
- throw new OfficeError5("resource-limit", "Argument limit exceeded.", "admit");
4463
+ throw new OfficeError8("resource-limit", "Argument limit exceeded.", "admit");
4195
4464
  try {
4196
4465
  return new TextDecoder("utf-8", { fatal: true }).decode(bytes2);
4197
4466
  } catch {
4198
- return usage13("Arguments must be UTF-8.");
4467
+ return usage14("Arguments must be UTF-8.");
4199
4468
  }
4200
4469
  });
4201
4470
  const delimiter = args.indexOf("--");
@@ -4214,31 +4483,31 @@ async function executeDiffCommand(request, options2) {
4214
4483
  }
4215
4484
  if (!positionalOnly && arg.startsWith("-") && arg !== "-") {
4216
4485
  if (!["--json", "--mode", "--limit", "--help"].includes(arg))
4217
- usage13("Unknown comparison option.");
4218
- if (seen.has(arg) && arg !== "--limit") usage13("Duplicate comparison option.");
4486
+ usage14("Unknown comparison option.");
4487
+ if (seen.has(arg) && arg !== "--limit") usage14("Duplicate comparison option.");
4219
4488
  seen.add(arg);
4220
4489
  if (arg === "--json" || arg === "--help") continue;
4221
4490
  const value = args[++i];
4222
- if (!value) usage13("Comparison option requires a value.");
4491
+ if (!value) usage14("Comparison option requires a value.");
4223
4492
  if (arg === "--mode") {
4224
- if (!diffModes.includes(value)) usage13("Unsupported comparison mode.");
4493
+ if (!diffModes.includes(value)) usage14("Unsupported comparison mode.");
4225
4494
  mode = value;
4226
4495
  } else {
4227
4496
  const parts = value.split("=");
4228
4497
  const name = parts[0];
4229
4498
  const number = Number(parts[1]);
4230
4499
  if (parts.length !== 2 || !["maxBytes", "maxNodes", "maxDepth", "maxOutputBytes"].includes(name) || !parts[1] || ![...parts[1]].every((c) => c >= "0" && c <= "9") || !Number.isSafeInteger(number) || number <= 0 || Object.hasOwn(limits, name))
4231
- usage13("Invalid comparison limit.");
4500
+ usage14("Invalid comparison limit.");
4232
4501
  limits[name] = number;
4233
4502
  }
4234
4503
  } else {
4235
- if (!arg || arg.includes("\0")) usage13("Invalid comparison input.");
4504
+ if (!arg || arg.includes("\0")) usage14("Invalid comparison input.");
4236
4505
  positionals.push(arg);
4237
4506
  }
4238
4507
  }
4239
4508
  if (seen.has("--help")) {
4240
4509
  if (positionals.length || [...seen].some((flag) => flag !== "--help" && flag !== "--json"))
4241
- usage13("Comparison help does not accept inputs or options.");
4510
+ usage14("Comparison help does not accept inputs or options.");
4242
4511
  result = {
4243
4512
  version: 1,
4244
4513
  operation: "help",
@@ -4252,7 +4521,7 @@ async function executeDiffCommand(request, options2) {
4252
4521
  human = diffUsage;
4253
4522
  } else {
4254
4523
  if (positionals.length !== 2 || positionals.every((path) => path === "-"))
4255
- usage13("Comparison requires two inputs and at most one stdin consumer.");
4524
+ usage14("Comparison requires two inputs and at most one stdin consumer.");
4256
4525
  maxOutputBytes = limits.maxOutputBytes ?? maxOutputBytes;
4257
4526
  const context = {
4258
4527
  ...options2.context,
@@ -4269,7 +4538,7 @@ async function executeDiffCommand(request, options2) {
4269
4538
  }
4270
4539
  };
4271
4540
  if (mode === "effective-formatting")
4272
- throw new OfficeError5(
4541
+ throw new OfficeError8(
4273
4542
  "unsupported-profile",
4274
4543
  "Effective formatting comparison is not supported.",
4275
4544
  "usage"
@@ -4304,7 +4573,7 @@ async function executeDiffCommand(request, options2) {
4304
4573
  let bytes = encoder.encode(json ? JSON.stringify(result) + "\n" : human);
4305
4574
  if (bytes.length > maxOutputBytes) {
4306
4575
  result = failure(
4307
- new OfficeError5("resource-limit", "Comparison output limit exceeded.", "admit")
4576
+ new OfficeError8("resource-limit", "Comparison output limit exceeded.", "admit")
4308
4577
  );
4309
4578
  bytes = encoder.encode(json ? JSON.stringify(result) + "\n" : human);
4310
4579
  }
@@ -4424,7 +4693,7 @@ var templateSchema = {
4424
4693
 
4425
4694
  // packages/safe-bash-command-pptx/src/command-template.ts
4426
4695
  import { sha256 as sha2562 } from "@noble/hashes/sha2.js";
4427
- import { OfficeError as OfficeError6 } from "../../safe-bash-presentation-engine/errors.js";
4696
+ import { OfficeError as OfficeError9 } from "../../safe-bash-presentation-engine/errors.js";
4428
4697
  import {
4429
4698
  applyTemplateBindings,
4430
4699
  validateTemplateBindings
@@ -4437,8 +4706,8 @@ function validateTemplateData(value) {
4437
4706
  if (Array.isArray(value)) validateTemplateBindings(value);
4438
4707
  else validateTemplateRepeat(value);
4439
4708
  }
4440
- function usage3(message) {
4441
- throw new OfficeError6("invalid-value", message, "usage");
4709
+ function usage4(message) {
4710
+ throw new OfficeError9("invalid-value", message, "usage");
4442
4711
  }
4443
4712
  function validateTemplateCommand(args, positionals, seen) {
4444
4713
  if ([...seen].some(
@@ -4453,25 +4722,25 @@ function validateTemplateCommand(args, positionals, seen) {
4453
4722
  "--dry-run"
4454
4723
  ].includes(flag)
4455
4724
  ))
4456
- usage3("Option does not apply to template apply.");
4725
+ usage4("Option does not apply to template apply.");
4457
4726
  if (positionals.length !== 1 || !positionals[0])
4458
- usage3("Template apply requires exactly one input.");
4727
+ usage4("Template apply requires exactly one input.");
4459
4728
  args.input = positionals[0];
4460
4729
  if (args.bindings !== void 0 === (args.dataFile !== void 0))
4461
- usage3("Template apply requires exactly one binding source.");
4462
- if (args.dataFile === "") usage3("Binding file path must not be empty.");
4463
- if (args.input === "-" && args.dataFile === "-") usage3("Only one input may consume stdin.");
4464
- if (args.inPlace && args.input === "-") usage3("Stdin cannot be edited in place.");
4465
- if (args.inPlace && args.output) usage3("Output and in-place cannot be combined.");
4466
- if (!args.dryRun && !args.inPlace && !args.output) usage3("Mutation requires a destination.");
4467
- if (args.force && !args.output) usage3("Force requires an explicit output destination.");
4730
+ usage4("Template apply requires exactly one binding source.");
4731
+ if (args.dataFile === "") usage4("Binding file path must not be empty.");
4732
+ if (args.input === "-" && args.dataFile === "-") usage4("Only one input may consume stdin.");
4733
+ if (args.inPlace && args.input === "-") usage4("Stdin cannot be edited in place.");
4734
+ if (args.inPlace && args.output) usage4("Output and in-place cannot be combined.");
4735
+ if (!args.dryRun && !args.inPlace && !args.output) usage4("Mutation requires a destination.");
4736
+ if (args.force && !args.output) usage4("Force requires an explicit output destination.");
4468
4737
  if (args.output === args.input && args.output !== "-")
4469
- usage3("Replacing input requires --in-place.");
4738
+ usage4("Replacing input requires --in-place.");
4470
4739
  const destination = args.inPlace ? args.input : args.output;
4471
4740
  if (args.dataFile !== void 0 && args.dataFile !== "-" && destination === args.dataFile)
4472
- usage3("Output cannot replace the binding source.");
4741
+ usage4("Output cannot replace the binding source.");
4473
4742
  if (args.output === "-" && args.json && !args.dryRun)
4474
- usage3("Binary stdout cannot be combined with JSON.");
4743
+ usage4("Binary stdout cannot be combined with JSON.");
4475
4744
  }
4476
4745
  async function executeTemplateCommand(args, request, options2) {
4477
4746
  const context = { ...options2.context, signal: request.signal };
@@ -4485,7 +4754,7 @@ async function executeTemplateCommand(args, request, options2) {
4485
4754
  try {
4486
4755
  json = new TextDecoder("utf-8", { fatal: true }).decode(data);
4487
4756
  } catch {
4488
- usage3("Binding data must be UTF-8 JSON.");
4757
+ usage4("Binding data must be UTF-8 JSON.");
4489
4758
  }
4490
4759
  bindings = commandJson(json);
4491
4760
  }
@@ -4790,40 +5059,40 @@ var commentSchemas = Object.fromEntries(
4790
5059
  );
4791
5060
 
4792
5061
  // packages/safe-bash-command-pptx/src/command-comments.ts
4793
- import { OfficeError as OfficeError7 } from "../../safe-bash-presentation-engine/errors.js";
5062
+ import { OfficeError as OfficeError10 } from "../../safe-bash-presentation-engine/errors.js";
4794
5063
  import { mutateComments, readComments, readCommentAuthors } from "../../safe-bash-presentation-engine/comments.js";
4795
5064
  import { SelectionError } from "../../safe-bash-presentation-engine/selectors.js";
4796
- function usage4(message) {
4797
- throw new OfficeError7("invalid-value", message, "usage");
5065
+ function usage5(message) {
5066
+ throw new OfficeError10("invalid-value", message, "usage");
4798
5067
  }
4799
5068
  function validateCommentsCommand(args, positionals, seen) {
4800
5069
  const allowed = Object.keys(commentSchemas[args.operation].options.properties).map(
4801
5070
  (key) => "--" + [...key].map((c) => c >= "A" && c <= "Z" ? "-" + c.toLowerCase() : c).join("")
4802
5071
  );
4803
5072
  if ([...seen].some((flag) => !allowed.includes(flag)))
4804
- usage4("Option does not apply to comments.");
4805
- if (positionals.length !== 1 || !positionals[0]) usage4("Comments require exactly one input.");
5073
+ usage5("Option does not apply to comments.");
5074
+ if (positionals.length !== 1 || !positionals[0]) usage5("Comments require exactly one input.");
4806
5075
  args.input = positionals[0];
4807
- if (args.scope !== void 0 && args.scope !== "slides") usage4("Comments require slides scope.");
5076
+ if (args.scope !== void 0 && args.scope !== "slides") usage5("Comments require slides scope.");
4808
5077
  if (args.token && ["--slide", "--scope", "--id"].some((flag) => seen.has(flag)))
4809
- usage4("Opaque and simple selectors cannot be combined.");
5078
+ usage5("Opaque and simple selectors cannot be combined.");
4810
5079
  if (args.operation === "comments.list" || args.operation === "comments.get") return;
4811
5080
  if (!args.token && args.slide === void 0 && !args.all)
4812
5081
  throw new SelectionError("missing-selection");
4813
5082
  if (args.operation === "comments.add" && [args.commentEdit?.text, args.commentEdit?.author, args.commentEdit?.timestamp].some(
4814
5083
  (value) => value === void 0
4815
5084
  ))
4816
- usage4("Comment creation requires text, author and timestamp.");
5085
+ usage5("Comment creation requires text, author and timestamp.");
4817
5086
  if (args.operation === "comments.set" && !Object.keys(args.commentEdit ?? {}).some((key) => key !== "id"))
4818
- usage4("Comment update requires an edit.");
4819
- if (args.inPlace && args.input === "-") usage4("Stdin cannot be edited in place.");
4820
- if (args.inPlace && args.output) usage4("Output and in-place cannot be combined.");
4821
- if (!args.dryRun && !args.inPlace && !args.output) usage4("Mutation requires a destination.");
4822
- if (args.force && !args.output) usage4("Force requires an explicit output destination.");
5087
+ usage5("Comment update requires an edit.");
5088
+ if (args.inPlace && args.input === "-") usage5("Stdin cannot be edited in place.");
5089
+ if (args.inPlace && args.output) usage5("Output and in-place cannot be combined.");
5090
+ if (!args.dryRun && !args.inPlace && !args.output) usage5("Mutation requires a destination.");
5091
+ if (args.force && !args.output) usage5("Force requires an explicit output destination.");
4823
5092
  if (args.output === args.input && args.output !== "-")
4824
- usage4("Replacing input requires --in-place.");
5093
+ usage5("Replacing input requires --in-place.");
4825
5094
  if (args.output === "-" && args.json && !args.dryRun)
4826
- usage4("Binary stdout cannot be combined with JSON.");
5095
+ usage5("Binary stdout cannot be combined with JSON.");
4827
5096
  }
4828
5097
  async function executeCommentsCommand(args, request, options2) {
4829
5098
  const context = { ...options2.context, signal: request.signal };
@@ -5296,43 +5565,43 @@ var accessibilitySchemas = Object.fromEntries(
5296
5565
  );
5297
5566
 
5298
5567
  // packages/safe-bash-command-pptx/src/command-accessibility.ts
5299
- import { OfficeError as OfficeError8 } from "../../safe-bash-presentation-engine/errors.js";
5568
+ import { OfficeError as OfficeError11 } from "../../safe-bash-presentation-engine/errors.js";
5300
5569
  import {
5301
5570
  readAccessibility,
5302
5571
  mutateAccessibility,
5303
5572
  validateAccessibilityUpdate
5304
5573
  } from "../../safe-bash-presentation-engine/accessibility.js";
5305
5574
  import { SelectionError as SelectionError2 } from "../../safe-bash-presentation-engine/selectors.js";
5306
- function usage5(message) {
5307
- throw new OfficeError8("invalid-value", message, "usage");
5575
+ function usage6(message) {
5576
+ throw new OfficeError11("invalid-value", message, "usage");
5308
5577
  }
5309
5578
  function validateAccessibilityCommand(args, positionals, seen) {
5310
5579
  const allowed = Object.keys(accessibilitySchemas[args.operation].options.properties).map(
5311
5580
  (key) => "--" + [...key].map((c) => c >= "A" && c <= "Z" ? "-" + c.toLowerCase() : c).join("")
5312
5581
  );
5313
5582
  if ([...seen].some((flag) => !allowed.includes(flag)))
5314
- usage5("Option does not apply to accessibility.");
5583
+ usage6("Option does not apply to accessibility.");
5315
5584
  if (positionals.length !== 1 || !positionals[0])
5316
- usage5("Accessibility requires exactly one input.");
5585
+ usage6("Accessibility requires exactly one input.");
5317
5586
  args.input = positionals[0];
5318
5587
  if (args.scope !== void 0 && !["slides", "layouts", "masters"].includes(args.scope))
5319
- usage5("Unsupported accessibility scope.");
5588
+ usage6("Unsupported accessibility scope.");
5320
5589
  if (args.token && ["--slide", "--shape", "--scope", "--all"].some((flag) => seen.has(flag)))
5321
- usage5("Opaque and simple selectors cannot be combined.");
5590
+ usage6("Opaque and simple selectors cannot be combined.");
5322
5591
  if (args.shape !== void 0 && args.slide === void 0)
5323
- usage5("Shape selection requires a slide.");
5592
+ usage6("Shape selection requires a slide.");
5324
5593
  if (args.operation !== "accessibility.set") return;
5325
5594
  validateAccessibilityUpdate(args.accessibilityEdit ?? {});
5326
5595
  if (!args.token && args.slide === void 0 && !args.all)
5327
- usage5("Accessibility mutation requires explicit selection.");
5328
- if (args.inPlace && args.input === "-") usage5("Stdin cannot be edited in place.");
5329
- if (args.inPlace && args.output) usage5("Output and in-place cannot be combined.");
5330
- if (!args.dryRun && !args.inPlace && !args.output) usage5("Mutation requires a destination.");
5331
- if (args.force && !args.output) usage5("Force requires an output destination.");
5596
+ usage6("Accessibility mutation requires explicit selection.");
5597
+ if (args.inPlace && args.input === "-") usage6("Stdin cannot be edited in place.");
5598
+ if (args.inPlace && args.output) usage6("Output and in-place cannot be combined.");
5599
+ if (!args.dryRun && !args.inPlace && !args.output) usage6("Mutation requires a destination.");
5600
+ if (args.force && !args.output) usage6("Force requires an output destination.");
5332
5601
  if (args.output === args.input && args.output !== "-")
5333
- usage5("Replacing input requires --in-place.");
5602
+ usage6("Replacing input requires --in-place.");
5334
5603
  if (args.output === "-" && args.json && !args.dryRun)
5335
- usage5("Binary stdout cannot be combined with JSON.");
5604
+ usage6("Binary stdout cannot be combined with JSON.");
5336
5605
  }
5337
5606
  async function executeAccessibilityCommand(args, request, options2) {
5338
5607
  const context = { ...options2.context, signal: request.signal };
@@ -5414,13 +5683,13 @@ async function executeAccessibilityCommand(args, request, options2) {
5414
5683
  }
5415
5684
 
5416
5685
  // packages/safe-bash-command-pptx/src/command-metadata.ts
5417
- import { OfficeError as OfficeError9 } from "../../safe-bash-presentation-engine/errors.js";
5686
+ import { OfficeError as OfficeError12 } from "../../safe-bash-presentation-engine/errors.js";
5418
5687
  import { coreDefinition, mutateProperty, readProperties } from "../../safe-bash-presentation-engine/properties.js";
5419
5688
  import { sanitize as sanitizePresentation } from "../../safe-bash-presentation-engine/sanitize.js";
5420
5689
  import { mutateTags, readTags } from "../../safe-bash-presentation-engine/tags.js";
5421
5690
  import { SelectionError as SelectionError3 } from "../../safe-bash-presentation-engine/selectors.js";
5422
- function usage6(message) {
5423
- throw new OfficeError9("invalid-value", message, "usage");
5691
+ function usage7(message) {
5692
+ throw new OfficeError12("invalid-value", message, "usage");
5424
5693
  }
5425
5694
  function removalCategories(value) {
5426
5695
  const categories = ["notes", "comments", "properties", "links", "objects"];
@@ -5429,37 +5698,37 @@ function removalCategories(value) {
5429
5698
  try {
5430
5699
  parsed = JSON.parse(value);
5431
5700
  } catch {
5432
- usage6("Remove requires a category or a JSON array of categories.");
5701
+ usage7("Remove requires a category or a JSON array of categories.");
5433
5702
  }
5434
5703
  }
5435
5704
  const values3 = Array.isArray(parsed) ? parsed : [parsed];
5436
- if (!values3.length || values3.some((item) => typeof item !== "string" || !categories.includes(item)) || new Set(values3).size !== values3.length) usage6("Remove requires distinct notes, comments, properties, links or objects categories.");
5705
+ if (!values3.length || values3.some((item) => typeof item !== "string" || !categories.includes(item)) || new Set(values3).size !== values3.length) usage7("Remove requires distinct notes, comments, properties, links or objects categories.");
5437
5706
  return values3;
5438
5707
  }
5439
5708
  function validateMetadataCommand(args, positionals, seen) {
5440
5709
  const allowed = Object.keys(metadataSchemas[args.operation].options.properties).map((key) => "--" + [...key].map((c) => c >= "A" && c <= "Z" ? "-" + c.toLowerCase() : c).join(""));
5441
- if ([...seen].some((flag) => !allowed.includes(flag))) usage6("Option does not apply to this metadata operation.");
5442
- if (positionals.length !== 1 || !positionals[0]) usage6("Metadata operations require exactly one input.");
5710
+ if ([...seen].some((flag) => !allowed.includes(flag))) usage7("Option does not apply to this metadata operation.");
5711
+ if (positionals.length !== 1 || !positionals[0]) usage7("Metadata operations require exactly one input.");
5443
5712
  args.input = positionals[0];
5444
5713
  const tags = args.operation.startsWith("tags."), sanitize = args.operation === "sanitize";
5445
5714
  const action = args.operation.split(".")[1];
5446
- if (args.scope !== void 0 && !(tags ? ["slides", "presentation"] : ["presentation"]).includes(args.scope)) usage6("Unsupported metadata scope.");
5447
- if (args.token && ["--slide", "--scope", "--all"].some((flag) => seen.has(flag))) usage6("Opaque and simple selectors cannot be combined.");
5448
- if (args.scope === "presentation" && args.slide !== void 0) usage6("Presentation scope rejects slide selection.");
5449
- if (!tags && !sanitize && action !== "list" && !args.metadataName) usage6("Property name is required.");
5450
- if (args.metadataName === "") usage6("Metadata names cannot be empty.");
5451
- if (action === "add" && (!args.metadataName || args.metadataValue === void 0)) usage6("New tags require name and value.");
5452
- if (action === "set" && (tags ? args.metadataName === void 0 && args.metadataValue === void 0 : args.metadataValue === void 0)) usage6("Metadata edit value is required.");
5453
- if (args.metadataType !== void 0 && !["string", "number", "boolean", "date"].includes(args.metadataType)) usage6("Unknown property type.");
5715
+ if (args.scope !== void 0 && !(tags ? ["slides", "presentation"] : ["presentation"]).includes(args.scope)) usage7("Unsupported metadata scope.");
5716
+ if (args.token && ["--slide", "--scope", "--all"].some((flag) => seen.has(flag))) usage7("Opaque and simple selectors cannot be combined.");
5717
+ if (args.scope === "presentation" && args.slide !== void 0) usage7("Presentation scope rejects slide selection.");
5718
+ if (!tags && !sanitize && action !== "list" && !args.metadataName) usage7("Property name is required.");
5719
+ if (args.metadataName === "") usage7("Metadata names cannot be empty.");
5720
+ if (action === "add" && (!args.metadataName || args.metadataValue === void 0)) usage7("New tags require name and value.");
5721
+ if (action === "set" && (tags ? args.metadataName === void 0 && args.metadataValue === void 0 : args.metadataValue === void 0)) usage7("Metadata edit value is required.");
5722
+ if (args.metadataType !== void 0 && !["string", "number", "boolean", "date"].includes(args.metadataType)) usage7("Unknown property type.");
5454
5723
  if (sanitize) removalCategories(args.metadataRemove);
5455
5724
  if (!sanitize && ["list", "get"].includes(action)) return;
5456
5725
  if (tags && !args.token && args.slide === void 0 && args.scope !== "presentation" && !args.all) throw new SelectionError3("missing-selection");
5457
- if (args.inPlace && args.input === "-") usage6("Stdin cannot be edited in place.");
5458
- if (args.inPlace && args.output) usage6("Output and in-place cannot be combined.");
5459
- if (!args.dryRun && !args.inPlace && !args.output) usage6("Mutation requires a destination.");
5460
- if (args.force && !args.output) usage6("Force requires an output destination.");
5461
- if (args.output === args.input && args.output !== "-") usage6("Replacing input requires --in-place.");
5462
- if (args.output === "-" && args.json && !args.dryRun) usage6("Binary stdout cannot be combined with JSON.");
5726
+ if (args.inPlace && args.input === "-") usage7("Stdin cannot be edited in place.");
5727
+ if (args.inPlace && args.output) usage7("Output and in-place cannot be combined.");
5728
+ if (!args.dryRun && !args.inPlace && !args.output) usage7("Mutation requires a destination.");
5729
+ if (args.force && !args.output) usage7("Force requires an output destination.");
5730
+ if (args.output === args.input && args.output !== "-") usage7("Replacing input requires --in-place.");
5731
+ if (args.output === "-" && args.json && !args.dryRun) usage7("Binary stdout cannot be combined with JSON.");
5463
5732
  }
5464
5733
  async function executeMetadataCommand(args, request, options2) {
5465
5734
  const context = { ...options2.context, signal: request.signal };
@@ -5494,15 +5763,15 @@ async function executeMetadataCommand(args, request, options2) {
5494
5763
  const type = args.metadataType ?? known[0]?.type ?? coreDefinition(args.metadataName)?.[2];
5495
5764
  let value = args.metadataValue;
5496
5765
  if (action === "set" && type === "boolean") {
5497
- if (value !== "true" && value !== "false") usage6("Boolean properties require true or false.");
5766
+ if (value !== "true" && value !== "false") usage7("Boolean properties require true or false.");
5498
5767
  value = value === "true";
5499
5768
  } else if (action === "set" && type === "number") {
5500
5769
  try {
5501
5770
  value = JSON.parse(args.metadataValue);
5502
5771
  } catch {
5503
- usage6("Number properties require a finite JSON number.");
5772
+ usage7("Number properties require a finite JSON number.");
5504
5773
  }
5505
- if (typeof value !== "number" || !Number.isFinite(value)) usage6("Number properties require a finite JSON number.");
5774
+ if (typeof value !== "number" || !Number.isFinite(value)) usage7("Number properties require a finite JSON number.");
5506
5775
  }
5507
5776
  bytes = (await mutateProperty(original, action, { name: args.metadataName, ...action === "set" ? { value, ...type === void 0 ? {} : { type } } : {} }, context)).bytes;
5508
5777
  affected = 1;
@@ -5522,22 +5791,22 @@ ${sanitization.retained.map((entry) => `Retained ${entry.category} ${entry.kind}
5522
5791
  }
5523
5792
 
5524
5793
  // packages/safe-bash-command-pptx/src/command-notes.ts
5525
- import { OfficeError as OfficeError10 } from "../../safe-bash-presentation-engine/errors.js";
5794
+ import { OfficeError as OfficeError13 } from "../../safe-bash-presentation-engine/errors.js";
5526
5795
  import { mutateNotes, readNotes, validateNotesOptions } from "../../safe-bash-presentation-engine/notes.js";
5527
5796
  import { readSelectionIndex, SelectionError as SelectionError4 } from "../../safe-bash-presentation-engine/selectors.js";
5528
- function usage7(message) {
5529
- throw new OfficeError10("invalid-value", message, "usage");
5797
+ function usage8(message) {
5798
+ throw new OfficeError13("invalid-value", message, "usage");
5530
5799
  }
5531
5800
  function validateNotesCommand(args, positionals, seen) {
5532
5801
  const allowed = Object.keys(noteSchemas[args.operation].options.properties).map(
5533
5802
  (key) => "--" + [...key].map((c) => c >= "A" && c <= "Z" ? "-" + c.toLowerCase() : c).join("")
5534
5803
  );
5535
- if ([...seen].some((flag) => !allowed.includes(flag))) usage7("Option does not apply to notes.");
5536
- if (positionals.length !== 1 || !positionals[0]) usage7("Notes require exactly one input.");
5804
+ if ([...seen].some((flag) => !allowed.includes(flag))) usage8("Option does not apply to notes.");
5805
+ if (positionals.length !== 1 || !positionals[0]) usage8("Notes require exactly one input.");
5537
5806
  args.input = positionals[0];
5538
- if (args.scope !== void 0 && args.scope !== "notes") usage7("Notes require notes scope.");
5807
+ if (args.scope !== void 0 && args.scope !== "notes") usage8("Notes require notes scope.");
5539
5808
  if (args.token && ["--slide", "--scope"].some((flag) => seen.has(flag)))
5540
- usage7("Opaque and simple selectors cannot be combined.");
5809
+ usage8("Opaque and simple selectors cannot be combined.");
5541
5810
  if (args.operation === "notes.list" || args.operation === "notes.get") return;
5542
5811
  if (!args.token && args.slide === void 0 && !args.all)
5543
5812
  throw new SelectionError4("missing-selection");
@@ -5545,14 +5814,14 @@ function validateNotesCommand(args, positionals, seen) {
5545
5814
  selection: { kind: "slide" },
5546
5815
  ...args.noteText === void 0 ? {} : { text: args.noteText }
5547
5816
  });
5548
- if (args.inPlace && args.input === "-") usage7("Stdin cannot be edited in place.");
5549
- if (args.inPlace && args.output) usage7("Output and in-place cannot be combined.");
5550
- if (!args.dryRun && !args.inPlace && !args.output) usage7("Mutation requires a destination.");
5551
- if (args.force && !args.output) usage7("Force requires an explicit output destination.");
5817
+ if (args.inPlace && args.input === "-") usage8("Stdin cannot be edited in place.");
5818
+ if (args.inPlace && args.output) usage8("Output and in-place cannot be combined.");
5819
+ if (!args.dryRun && !args.inPlace && !args.output) usage8("Mutation requires a destination.");
5820
+ if (args.force && !args.output) usage8("Force requires an explicit output destination.");
5552
5821
  if (args.output === args.input && args.output !== "-")
5553
- usage7("Replacing input requires --in-place.");
5822
+ usage8("Replacing input requires --in-place.");
5554
5823
  if (args.output === "-" && args.json && !args.dryRun)
5555
- usage7("Binary stdout cannot be combined with JSON.");
5824
+ usage8("Binary stdout cannot be combined with JSON.");
5556
5825
  }
5557
5826
  async function executeNotesCommand(args, request, options2) {
5558
5827
  const context = { ...options2.context, signal: request.signal };
@@ -5808,33 +6077,33 @@ var linkSchemas = Object.fromEntries(
5808
6077
  // packages/safe-bash-command-pptx/src/command-links.ts
5809
6078
  import { readPackage as readPackage2 } from "../../safe-bash-presentation-engine/package-reader.js";
5810
6079
  import { parseXmlPart as parseXmlPart2 } from "../../safe-bash-presentation-engine/xml.js";
5811
- import { OfficeError as OfficeError11 } from "../../safe-bash-presentation-engine/errors.js";
6080
+ import { OfficeError as OfficeError14 } from "../../safe-bash-presentation-engine/errors.js";
5812
6081
  import { listLinks, setLink, removeLink, isOrdinaryLinkUrl } from "../../safe-bash-presentation-engine/links.js";
5813
6082
  import { readShapes } from "../../safe-bash-presentation-engine/shape-operations.js";
5814
6083
  import { SelectionError as SelectionError5 } from "../../safe-bash-presentation-engine/selectors.js";
5815
- function usage8(message) {
5816
- throw new OfficeError11("invalid-value", message, "usage");
6084
+ function usage9(message) {
6085
+ throw new OfficeError14("invalid-value", message, "usage");
5817
6086
  }
5818
6087
  function validateLinkCommand(args, positionals, seen) {
5819
6088
  const allowed = Object.keys(linkSchemas[args.operation].options.properties).map(
5820
6089
  (key) => "--" + [...key].map((c) => c >= "A" && c <= "Z" ? "-" + c.toLowerCase() : c).join("")
5821
6090
  );
5822
- if ([...seen].some((flag) => !allowed.includes(flag))) usage8("Option does not apply to links.");
5823
- if (positionals.length !== 1 || !positionals[0]) usage8("Links require exactly one input.");
6091
+ if ([...seen].some((flag) => !allowed.includes(flag))) usage9("Option does not apply to links.");
6092
+ if (positionals.length !== 1 || !positionals[0]) usage9("Links require exactly one input.");
5824
6093
  args.input = positionals[0];
5825
- if (args.scope !== void 0 && args.scope !== "slides") usage8("Links support slides scope.");
6094
+ if (args.scope !== void 0 && args.scope !== "slides") usage9("Links support slides scope.");
5826
6095
  if (args.token && ["--slide", "--shape", "--scope"].some((flag) => seen.has(flag)))
5827
- usage8("Opaque and simple selectors cannot be combined.");
6096
+ usage9("Opaque and simple selectors cannot be combined.");
5828
6097
  if (args.shape !== void 0 && args.slide === void 0)
5829
- usage8("Shape selection requires a slide.");
6098
+ usage9("Shape selection requires a slide.");
5830
6099
  const edit = args.linkEdit ?? {};
5831
6100
  if (edit.trigger !== void 0 && !["click", "hover"].includes(edit.trigger))
5832
- usage8("Unsupported link trigger.");
6101
+ usage9("Unsupported link trigger.");
5833
6102
  if (edit.path !== void 0 && (!Array.isArray(edit.path) || edit.path.some((value) => !Number.isSafeInteger(value) || value < 0)))
5834
- usage8("Link path requires an array of nonnegative integer child positions.");
6103
+ usage9("Link path requires an array of nonnegative integer child positions.");
5835
6104
  if (["links.list", "links.get"].includes(args.operation)) return;
5836
6105
  if (!args.token && args.slide === void 0 && !args.all)
5837
- usage8("Link mutation requires explicit selection.");
6106
+ usage9("Link mutation requires explicit selection.");
5838
6107
  if (args.operation !== "links.remove") {
5839
6108
  const url = edit.url !== void 0, slide = edit.targetSlide !== void 0;
5840
6109
  if (Number(url) + Number(slide) + Number(
@@ -5842,20 +6111,20 @@ function validateLinkCommand(args, positionals, seen) {
5842
6111
  edit.action ?? ""
5843
6112
  )
5844
6113
  ) !== 1)
5845
- usage8("Provide exactly one link destination.");
6114
+ usage9("Provide exactly one link destination.");
5846
6115
  if (url && (!isOrdinaryLinkUrl(edit.url) || edit.action !== void 0 && edit.action !== "url"))
5847
- usage8("URL action must agree with its destination.");
6116
+ usage9("URL action must agree with its destination.");
5848
6117
  if (slide && edit.action !== void 0 && edit.action !== "slide")
5849
- usage8("Slide action must agree with its destination.");
6118
+ usage9("Slide action must agree with its destination.");
5850
6119
  }
5851
- if (args.inPlace && args.input === "-") usage8("Stdin cannot be edited in place.");
5852
- if (args.inPlace && args.output) usage8("Output and in-place cannot be combined.");
5853
- if (!args.dryRun && !args.inPlace && !args.output) usage8("Mutation requires a destination.");
5854
- if (args.force && !args.output) usage8("Force requires an explicit output destination.");
6120
+ if (args.inPlace && args.input === "-") usage9("Stdin cannot be edited in place.");
6121
+ if (args.inPlace && args.output) usage9("Output and in-place cannot be combined.");
6122
+ if (!args.dryRun && !args.inPlace && !args.output) usage9("Mutation requires a destination.");
6123
+ if (args.force && !args.output) usage9("Force requires an explicit output destination.");
5855
6124
  if (args.output === args.input && args.output !== "-")
5856
- usage8("Replacing input requires --in-place.");
6125
+ usage9("Replacing input requires --in-place.");
5857
6126
  if (args.output === "-" && args.json && !args.dryRun)
5858
- usage8("Binary stdout cannot be combined with JSON.");
6127
+ usage9("Binary stdout cannot be combined with JSON.");
5859
6128
  }
5860
6129
  var actionNames = {
5861
6130
  url: "hyperlink",
@@ -5951,7 +6220,7 @@ async function executeLinkCommand(args, request, options2) {
5951
6220
  if (args.operation === "links.add" && selectedLinks.some(
5952
6221
  (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
6222
  ))
5954
- throw new OfficeError11(
6223
+ throw new OfficeError14(
5955
6224
  "unsupported-edit",
5956
6225
  "Selected trigger already contains a link.",
5957
6226
  "validate-intent"
@@ -6978,11 +7247,11 @@ import { readAnimations } from "../../safe-bash-presentation-engine/animations.j
6978
7247
  import { mutateAnimations, mutateAnimationsBatch, validateAnimationOptions as validateAnimationOptions2 } from "../../safe-bash-presentation-engine/animation-editing.js";
6979
7248
 
6980
7249
  // packages/safe-bash-command-pptx/src/animation-batch-command.ts
6981
- import { OfficeError as OfficeError12 } from "../../safe-bash-presentation-engine/errors.js";
7250
+ import { OfficeError as OfficeError15 } from "../../safe-bash-presentation-engine/errors.js";
6982
7251
  import { validateAnimationOptions } from "../../safe-bash-presentation-engine/animation-editing.js";
6983
7252
  import { decodeSelectionToken, SelectionError as SelectionError6 } from "../../safe-bash-presentation-engine/selectors.js";
6984
7253
  function invalid(message) {
6985
- throw new OfficeError12("invalid-value", message, "usage");
7254
+ throw new OfficeError15("invalid-value", message, "usage");
6986
7255
  }
6987
7256
  function record(value, keys) {
6988
7257
  if (!value || typeof value !== "object" || Array.isArray(value) || Object.keys(value).some((key) => !keys.includes(key))) invalid("Invalid animation batch fields.");
@@ -7190,31 +7459,31 @@ var equationSchemas = Object.fromEntries(["list", "get", "add"].map((action) =>
7190
7459
  }));
7191
7460
 
7192
7461
  // packages/safe-bash-command-pptx/src/command-equations.ts
7193
- import { OfficeError as OfficeError13 } from "../../safe-bash-presentation-engine/errors.js";
7462
+ import { OfficeError as OfficeError16 } from "../../safe-bash-presentation-engine/errors.js";
7194
7463
  import { readEquations, mutateEquations } from "../../safe-bash-presentation-engine/equations.js";
7195
7464
  import { SelectionError as SelectionError7 } from "../../safe-bash-presentation-engine/selectors.js";
7196
- function usage9(message) {
7197
- throw new OfficeError13("invalid-value", message, "usage");
7465
+ function usage10(message) {
7466
+ throw new OfficeError16("invalid-value", message, "usage");
7198
7467
  }
7199
7468
  function validateEquationCommand(args, positionals, seen) {
7200
7469
  const schema = equationSchemas[args.operation];
7201
7470
  const allowed = Object.keys(schema.options.properties).map((key) => "--" + [...key].map((c) => c >= "A" && c <= "Z" ? "-" + c.toLowerCase() : c).join(""));
7202
- if ([...seen].some((flag) => !allowed.includes(flag))) usage9("Option does not apply to equations.");
7203
- if (positionals.length !== 1 || !positionals[0]) usage9("Equations require exactly one input.");
7471
+ if ([...seen].some((flag) => !allowed.includes(flag))) usage10("Option does not apply to equations.");
7472
+ if (positionals.length !== 1 || !positionals[0]) usage10("Equations require exactly one input.");
7204
7473
  args.input = positionals[0];
7205
- if (args.scope !== void 0 && args.scope !== "slides") usage9("Equations support slides scope.");
7206
- if (args.token && ["--slide", "--shape", "--scope"].some((flag) => seen.has(flag))) usage9("Opaque and simple selectors cannot be combined.");
7207
- if (args.shape !== void 0 && args.slide === void 0) usage9("Shape selection requires a slide.");
7474
+ if (args.scope !== void 0 && args.scope !== "slides") usage10("Equations support slides scope.");
7475
+ if (args.token && ["--slide", "--shape", "--scope"].some((flag) => seen.has(flag))) usage10("Opaque and simple selectors cannot be combined.");
7476
+ if (args.shape !== void 0 && args.slide === void 0) usage10("Shape selection requires a slide.");
7208
7477
  if (args.operation !== "equations.add") return;
7209
- if (!args.file) usage9("Equation insertion requires --file.");
7210
- if (!args.token && !args.shape) usage9("Equation insertion requires a shape selector.");
7211
- if (args.input === "-" && args.file === "-") usage9("Only one input may consume stdin.");
7212
- if (args.inPlace && args.input === "-") usage9("Stdin cannot be edited in place.");
7213
- if (args.inPlace && args.output) usage9("Output and in-place cannot be combined.");
7214
- if (!args.dryRun && !args.inPlace && !args.output) usage9("Mutation requires a destination.");
7215
- if (args.force && !args.output) usage9("Force requires an explicit output destination.");
7216
- if (args.output === args.input && args.output !== "-") usage9("Replacing input requires --in-place.");
7217
- if (args.output === "-" && args.json && !args.dryRun) usage9("Binary stdout cannot be combined with JSON.");
7478
+ if (!args.file) usage10("Equation insertion requires --file.");
7479
+ if (!args.token && !args.shape) usage10("Equation insertion requires a shape selector.");
7480
+ if (args.input === "-" && args.file === "-") usage10("Only one input may consume stdin.");
7481
+ if (args.inPlace && args.input === "-") usage10("Stdin cannot be edited in place.");
7482
+ if (args.inPlace && args.output) usage10("Output and in-place cannot be combined.");
7483
+ if (!args.dryRun && !args.inPlace && !args.output) usage10("Mutation requires a destination.");
7484
+ if (args.force && !args.output) usage10("Force requires an explicit output destination.");
7485
+ if (args.output === args.input && args.output !== "-") usage10("Replacing input requires --in-place.");
7486
+ if (args.output === "-" && args.json && !args.dryRun) usage10("Binary stdout cannot be combined with JSON.");
7218
7487
  }
7219
7488
  async function executeEquationCommand(args, request, options2) {
7220
7489
  const context = { ...options2.context, signal: request.signal };
@@ -7345,30 +7614,30 @@ var opaqueSchemas = Object.fromEntries(["objects.list", "objects.extract", "font
7345
7614
 
7346
7615
  // packages/safe-bash-command-pptx/src/command-opaque.ts
7347
7616
  import { sha256 as sha2563 } from "@noble/hashes/sha2.js";
7348
- import { OfficeError as OfficeError14 } from "../../safe-bash-presentation-engine/errors.js";
7617
+ import { OfficeError as OfficeError17 } from "../../safe-bash-presentation-engine/errors.js";
7349
7618
  import { extractObject, readFonts, readObjects } from "../../safe-bash-presentation-engine/opaque-objects.js";
7350
- import { partName as partName2 } from "../../safe-bash-presentation-engine/package-uri.js";
7351
- function usage10(message) {
7352
- throw new OfficeError14("invalid-value", message, "usage");
7619
+ import { partName as partName3 } from "../../safe-bash-presentation-engine/package-uri.js";
7620
+ function usage11(message) {
7621
+ throw new OfficeError17("invalid-value", message, "usage");
7353
7622
  }
7354
7623
  function validateOpaqueCommand(args, positionals, seen) {
7355
7624
  const schema = opaqueSchemas[args.operation];
7356
7625
  const allowed = Object.keys(schema.options.properties).map((key) => "--" + [...key].map((c) => c >= "A" && c <= "Z" ? "-" + c.toLowerCase() : c).join(""));
7357
- if ([...seen].some((flag) => !allowed.includes(flag))) usage10("Option does not apply to opaque resources.");
7358
- if (positionals.length !== 1 || !positionals[0]) usage10("Opaque resources require exactly one input.");
7626
+ if ([...seen].some((flag) => !allowed.includes(flag))) usage11("Option does not apply to opaque resources.");
7627
+ if (positionals.length !== 1 || !positionals[0]) usage11("Opaque resources require exactly one input.");
7359
7628
  args.input = positionals[0];
7360
7629
  const scope = args.operation === "fonts.list" ? "presentation" : "shared";
7361
- if (args.scope !== void 0 && args.scope !== scope) usage10("Unsupported opaque resource scope.");
7630
+ if (args.scope !== void 0 && args.scope !== scope) usage11("Unsupported opaque resource scope.");
7362
7631
  if (args.operation !== "objects.extract") return;
7363
- if (!args.part) usage10("Object extraction requires --part.");
7632
+ if (!args.part) usage11("Object extraction requires --part.");
7364
7633
  try {
7365
- if (partName2(args.part, false) !== args.part) usage10("Object extraction requires a canonical package part.");
7634
+ if (partName3(args.part, false) !== args.part) usage11("Object extraction requires a canonical package part.");
7366
7635
  } catch {
7367
- usage10("Object extraction requires a canonical package part.");
7636
+ usage11("Object extraction requires a canonical package part.");
7368
7637
  }
7369
- if (!args.outputDir && !args.dryRun) usage10("Object extraction requires --output-dir.");
7370
- if (args.outputDir === "-") usage10("Output directories cannot be stdout.");
7371
- if (args.force && !args.outputDir) usage10("Force requires an output directory.");
7638
+ if (!args.outputDir && !args.dryRun) usage11("Object extraction requires --output-dir.");
7639
+ if (args.outputDir === "-") usage11("Output directories cannot be stdout.");
7640
+ if (args.force && !args.outputDir) usage11("Force requires an output directory.");
7372
7641
  }
7373
7642
  async function executeOpaqueCommand(args, request, options2) {
7374
7643
  const context = { ...options2.context, signal: request.signal };
@@ -7386,7 +7655,7 @@ async function executeOpaqueCommand(args, request, options2) {
7386
7655
  }
7387
7656
  const extracted = await extractObject(bytes, { part: args.part }, context);
7388
7657
  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");
7658
+ if (files.length > (args.limits?.maxOutputs ?? context.archiveLimits.maxMembers)) throw new OfficeError17("resource-limit", "Opaque output count exceeds limit.", "validate-intent");
7390
7659
  const dryRun = args.dryRun ?? false;
7391
7660
  const allowPartialOutput = args.allowPartialOutput ?? false;
7392
7661
  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 +7687,7 @@ import { readMedia } from "../../safe-bash-presentation-engine/media.js";
7418
7687
  import { extractMedia } from "../../safe-bash-presentation-engine/media-extraction.js";
7419
7688
 
7420
7689
  // packages/safe-bash-command-pptx/src/command-media-editing.ts
7421
- import { OfficeError as OfficeError15 } from "../../safe-bash-presentation-engine/errors.js";
7690
+ import { OfficeError as OfficeError18 } from "../../safe-bash-presentation-engine/errors.js";
7422
7691
  import { addMedia, replaceMedia } from "../../safe-bash-presentation-engine/media-editing.js";
7423
7692
 
7424
7693
  // packages/safe-bash-command-pptx/src/media-schema.ts
@@ -7667,56 +7936,56 @@ for (const action of ["add", "replace", "extract"]) {
7667
7936
  }
7668
7937
 
7669
7938
  // packages/safe-bash-command-pptx/src/command-media-editing.ts
7670
- function usage11(message) {
7671
- throw new OfficeError15("invalid-value", message, "usage");
7939
+ function usage12(message) {
7940
+ throw new OfficeError18("invalid-value", message, "usage");
7672
7941
  }
7673
7942
  function validateMediaEditingCommand(args, positionals, seen) {
7674
7943
  const allowed = Object.keys(mediaSchemas[args.operation].options.properties).map(
7675
7944
  (key) => "--" + [...key].map((c) => c >= "A" && c <= "Z" ? "-" + c.toLowerCase() : c).join("")
7676
7945
  );
7677
7946
  if ([...seen].some((flag) => !allowed.includes(flag)))
7678
- usage11("Option does not apply to this media operation.");
7679
- if (positionals.length !== 1 || !positionals[0]) usage11("Media requires exactly one input.");
7947
+ usage12("Option does not apply to this media operation.");
7948
+ if (positionals.length !== 1 || !positionals[0]) usage12("Media requires exactly one input.");
7680
7949
  args.input = positionals[0];
7681
7950
  if (args.token && ["--slide", "--shape", "--scope", "--all"].some((flag) => seen.has(flag)))
7682
- usage11("Opaque and simple selectors cannot be combined.");
7951
+ usage12("Opaque and simple selectors cannot be combined.");
7683
7952
  if (args.shape !== void 0 && args.slide === void 0)
7684
- usage11("Shape selection requires an owning slide.");
7953
+ usage12("Shape selection requires an owning slide.");
7685
7954
  if (args.operation === "media.extract") {
7686
7955
  if (!args.outputDir || args.outputDir === "-")
7687
- usage11("Media extraction requires an output directory.");
7956
+ usage12("Media extraction requires an output directory.");
7688
7957
  return;
7689
7958
  }
7690
7959
  if (args.operation === "media.add" && args.scope !== void 0 && args.scope !== "slides")
7691
- usage11("Media editing requires slides scope.");
7692
- if (!args.file) usage11("Media mutation requires --file.");
7960
+ usage12("Media editing requires slides scope.");
7961
+ if (!args.file) usage12("Media mutation requires --file.");
7693
7962
  if (args.operation === "media.add") {
7694
7963
  if (args.slide === void 0 || !args.mediaEdit?.kind || !args.mediaEdit.contentType || ["left", "top", "width", "height"].some(
7695
7964
  (key) => args.mediaEdit?.[key] === void 0
7696
7965
  ))
7697
- usage11("Media insertion requires slide, kind, MIME type and explicit geometry.");
7698
- if (!args.poster) usage11("Media insertion requires an explicit poster.");
7966
+ usage12("Media insertion requires slide, kind, MIME type and explicit geometry.");
7967
+ if (!args.poster) usage12("Media insertion requires an explicit poster.");
7699
7968
  } else {
7700
- if (!args.poster) usage11("Media replacement requires an explicit poster.");
7969
+ if (!args.poster) usage12("Media replacement requires an explicit poster.");
7701
7970
  if (!args.token && args.shape === void 0 && !args.all)
7702
- usage11("Media replacement requires a shape selector or all.");
7971
+ usage12("Media replacement requires a shape selector or all.");
7703
7972
  }
7704
7973
  if ([args.input, args.file, args.poster].filter((value) => value === "-").length > 1)
7705
- usage11("Only one input may consume stdin.");
7974
+ usage12("Only one input may consume stdin.");
7706
7975
  if (args.poster && !args.posterContentType) {
7707
7976
  const extension = args.poster.slice(args.poster.lastIndexOf(".") + 1).toLowerCase();
7708
7977
  const inferred = { png: "image/png", jpg: "image/jpeg", jpeg: "image/jpeg", gif: "image/gif", bmp: "image/bmp", tif: "image/tiff", tiff: "image/tiff", wmf: "image/x-wmf" }[extension];
7709
- if (!inferred) usage11("Poster requires an explicit content type or supported extension.");
7978
+ if (!inferred) usage12("Poster requires an explicit content type or supported extension.");
7710
7979
  args.posterContentType = inferred;
7711
7980
  }
7712
- if (args.inPlace && args.input === "-") usage11("Stdin cannot be edited in place.");
7713
- if (args.inPlace && args.output) usage11("Output and in-place cannot be combined.");
7714
- if (!args.dryRun && !args.inPlace && !args.output) usage11("Mutation requires a destination.");
7715
- if (args.force && !args.output) usage11("Force requires an explicit output destination.");
7981
+ if (args.inPlace && args.input === "-") usage12("Stdin cannot be edited in place.");
7982
+ if (args.inPlace && args.output) usage12("Output and in-place cannot be combined.");
7983
+ if (!args.dryRun && !args.inPlace && !args.output) usage12("Mutation requires a destination.");
7984
+ if (args.force && !args.output) usage12("Force requires an explicit output destination.");
7716
7985
  if (args.output === args.input && args.output !== "-")
7717
- usage11("Replacing input requires --in-place.");
7986
+ usage12("Replacing input requires --in-place.");
7718
7987
  if (args.output === "-" && args.json && !args.dryRun)
7719
- usage11("Binary stdout cannot be combined with JSON.");
7988
+ usage12("Binary stdout cannot be combined with JSON.");
7720
7989
  }
7721
7990
  async function executeMediaEditingCommand(args, request, options2) {
7722
7991
  const context = { ...options2.context, signal: request.signal };
@@ -8762,9 +9031,9 @@ import {
8762
9031
  import { readBackgrounds, mutateBackground } from "../../safe-bash-presentation-engine/backgrounds.js";
8763
9032
  import { replacePresentationText } from "../../safe-bash-presentation-engine/text-replacement.js";
8764
9033
  import { readPresentationText } from "../../safe-bash-presentation-engine/text-reading.js";
8765
- import { OfficeError as OfficeError16 } from "../../safe-bash-presentation-engine/errors.js";
9034
+ import { OfficeError as OfficeError19 } from "../../safe-bash-presentation-engine/errors.js";
8766
9035
  import { sha256 as sha2564 } from "@noble/hashes/sha2.js";
8767
- import { packageUri, partName as partName3 } from "../../safe-bash-presentation-engine/package-uri.js";
9036
+ import { packageUri, partName as partName4 } from "../../safe-bash-presentation-engine/package-uri.js";
8768
9037
  import {
8769
9038
  SelectionError as SelectionError8,
8770
9039
  decodeSelectionToken as decodeSelectionToken2,
@@ -8794,10 +9063,10 @@ import {
8794
9063
  readPresentationSettings,
8795
9064
  mutatePresentationSettings
8796
9065
  } from "../../safe-bash-presentation-engine/presentation-settings.js";
8797
- import { getXmlPart, stageRetainedXmlPart, replaceXmlPart } from "../../safe-bash-presentation-engine/xml-parts.js";
9066
+ import { getXmlPart, stageRetainedXmlPart, stageRetainedXmlReplacement, replaceXmlPart } from "../../safe-bash-presentation-engine/xml-parts.js";
8798
9067
  import { validatePresentation, openRetainedPresentationValidation } from "../../safe-bash-presentation-engine/validation.js";
8799
9068
  import { readPackage as readPackage3 } from "../../safe-bash-presentation-engine/package-reader.js";
8800
- import { resourceContext } from "../../safe-bash-presentation-engine/resource-limits.js";
9069
+ import { resourceContext as resourceContext2 } from "../../safe-bash-presentation-engine/resource-limits.js";
8801
9070
  var scopes2 = [
8802
9071
  "slides",
8803
9072
  "notes",
@@ -8963,15 +9232,15 @@ Dimension conflicts reject by default; destination policy retains source coordin
8963
9232
  Slides add requires an exact layout name or part URI; position defaults to append.
8964
9233
  Title/body match placeholder types; indexed bindings use --placeholders-json.
8965
9234
  `;
8966
- function usage12(message) {
8967
- throw new OfficeError16("invalid-value", message, "usage");
9235
+ function usage13(message) {
9236
+ throw new OfficeError19("invalid-value", message, "usage");
8968
9237
  }
8969
9238
  function paragraphTabLength(length4) {
8970
9239
  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")
8971
- usage12("Tabs require finite explicit lengths.");
9240
+ usage13("Tabs require finite explicit lengths.");
8972
9241
  const emu = length4.value * commandLength("1" + length4.unit, 0);
8973
9242
  if (!Number.isFinite(emu) || emu > Number.MAX_SAFE_INTEGER)
8974
- usage12("Tab length is outside the supported range.");
9243
+ usage13("Tab length is outside the supported range.");
8975
9244
  return Math.round(emu) / 12700;
8976
9245
  }
8977
9246
  var runFlags = [
@@ -9219,11 +9488,11 @@ function parse(raw, maximum, output3) {
9219
9488
  const decoder = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true });
9220
9489
  for (let index = 0; index < raw.length; index++) {
9221
9490
  const bytes = raw[index];
9222
- if (!(bytes instanceof Uint8Array)) usage12("Arguments must be byte arrays.");
9491
+ if (!(bytes instanceof Uint8Array)) usage13("Arguments must be byte arrays.");
9223
9492
  size += bytes.length + 1;
9224
9493
  if (size > maximum) {
9225
- if (invalidUtf8) usage12("Arguments must be UTF-8.");
9226
- throw new OfficeError16("resource-limit", "Argument limit exceeded.", "usage");
9494
+ if (invalidUtf8) usage13("Arguments must be UTF-8.");
9495
+ throw new OfficeError19("resource-limit", "Argument limit exceeded.", "usage");
9227
9496
  }
9228
9497
  try {
9229
9498
  args.push(decoder.decode(bytes));
@@ -9294,9 +9563,9 @@ function parse(raw, maximum, output3) {
9294
9563
  else if (scalarOptions.includes(argument)) hintValue = true;
9295
9564
  }
9296
9565
  }
9297
- if (invalidUtf8) usage12("Arguments must be UTF-8.");
9566
+ if (invalidUtf8) usage13("Arguments must be UTF-8.");
9298
9567
  if (args[0] === "accessibility" && ["--help", "-h"].includes(args[1])) {
9299
- if (args.slice(2).some((argument) => argument !== "--json")) usage12("Unexpected help option.");
9568
+ if (args.slice(2).some((argument) => argument !== "--json")) usage13("Unexpected help option.");
9300
9569
  return { operation: "help", json: output3.json, schemaPath: "accessibility" };
9301
9570
  }
9302
9571
  if (args[0] === "text" && ["runs", "paragraphs", "frames"].includes(args[1]) && ["get", "set", "list"].includes(args[2])) {
@@ -9401,7 +9670,7 @@ function parse(raw, maximum, output3) {
9401
9670
  "help",
9402
9671
  "version"
9403
9672
  ].includes(operation))
9404
- usage12("Unsupported operation.");
9673
+ usage13("Unsupported operation.");
9405
9674
  const result = { operation, json: false };
9406
9675
  const positionals = [];
9407
9676
  const seen = /* @__PURE__ */ new Set();
@@ -9431,10 +9700,10 @@ function parse(raw, maximum, output3) {
9431
9700
  "--height",
9432
9701
  "--workbook-policy"
9433
9702
  ].includes(argument)) {
9434
- if (seen.has(argument)) usage12("Repeated option.");
9703
+ if (seen.has(argument)) usage13("Repeated option.");
9435
9704
  seen.add(argument);
9436
9705
  const value2 = args[++index];
9437
- if (value2 === void 0) usage12("Chart option requires a value.");
9706
+ if (value2 === void 0) usage13("Chart option requires a value.");
9438
9707
  const key = argument.slice(2);
9439
9708
  if (key === "workbook-policy") result.chartWorkbookPolicy = value2;
9440
9709
  else {
@@ -9442,10 +9711,10 @@ function parse(raw, maximum, output3) {
9442
9711
  if (key === "data" || key === "objects") parsed = commandJson(value2);
9443
9712
  else if (key === "style") {
9444
9713
  if (!value2.length || [...value2].some((c) => c < "0" || c > "9"))
9445
- usage12("Chart style requires an integer.");
9714
+ usage13("Chart style requires an integer.");
9446
9715
  parsed = Number(value2);
9447
9716
  } else if (key === "legend") {
9448
- if (!["true", "false"].includes(value2)) usage12("Legend requires true or false.");
9717
+ if (!["true", "false"].includes(value2)) usage13("Legend requires true or false.");
9449
9718
  parsed = value2 === "true";
9450
9719
  } else if (["left", "top", "width", "height"].includes(key))
9451
9720
  parsed = commandLength(
@@ -9459,14 +9728,14 @@ function parse(raw, maximum, output3) {
9459
9728
  if (operation.startsWith("tables.") && (argument === "--table" || argument === "--cell" || ["--from", "--to", "--position", "--span-policy"].includes(argument) || Object.keys(tableValues).some(
9460
9729
  (key) => "--" + [...key].map((c) => c >= "A" && c <= "Z" ? "-" + c.toLowerCase() : c).join("") === argument
9461
9730
  ))) {
9462
- if (seen.has(argument)) usage12("Repeated option.");
9731
+ if (seen.has(argument)) usage13("Repeated option.");
9463
9732
  seen.add(argument);
9464
9733
  const value2 = args[++index];
9465
- if (value2 === void 0) usage12("Table option requires a value.");
9734
+ if (value2 === void 0) usage13("Table option requires a value.");
9466
9735
  const key = argument.slice(2).split("-").map((word, i) => i ? word[0].toUpperCase() + word.slice(1) : word).join("");
9467
9736
  if (key === "table" || key === "rows" || key === "columns" || key === "position") {
9468
9737
  if (!value2.length || [...value2].some((c) => c < "0" || c > "9") || !Number.isSafeInteger(Number(value2)) || Number(value2) < 1)
9469
- usage12("Table positions and dimensions require positive integers.");
9738
+ usage13("Table positions and dimensions require positive integers.");
9470
9739
  if (key === "position") result.tablePosition = Number(value2);
9471
9740
  else if (key === "table") result.table = Number(value2);
9472
9741
  else result.tableEdit = { ...result.tableEdit, [key]: Number(value2) };
@@ -9475,7 +9744,7 @@ function parse(raw, maximum, output3) {
9475
9744
  try {
9476
9745
  tableCell(value2);
9477
9746
  } catch {
9478
- usage12("Cell requires one-based row,column coordinates.");
9747
+ usage13("Cell requires one-based row,column coordinates.");
9479
9748
  }
9480
9749
  if (key === "from") result.tableFrom = value2;
9481
9750
  else if (key === "to") result.tableTo = value2;
@@ -9497,7 +9766,7 @@ function parse(raw, maximum, output3) {
9497
9766
  let parsed = value2;
9498
9767
  if (key === "data") parsed = commandJson(value2);
9499
9768
  else if (["firstRow", "lastRow", "firstCol", "lastCol", "horzBand", "vertBand"].includes(key)) {
9500
- if (!["true", "false"].includes(value2)) usage12("Table style flags require true or false.");
9769
+ if (!["true", "false"].includes(value2)) usage13("Table style flags require true or false.");
9501
9770
  parsed = value2 === "true";
9502
9771
  } else if (value2 === "null" && !["text"].includes(key)) parsed = null;
9503
9772
  else if (lengths.includes(key))
@@ -9522,10 +9791,10 @@ function parse(raw, maximum, output3) {
9522
9791
  "--line-width",
9523
9792
  "--line-color"
9524
9793
  ].includes(argument)) {
9525
- if (seen.has(argument)) usage12("Repeated option.");
9794
+ if (seen.has(argument)) usage13("Repeated option.");
9526
9795
  seen.add(argument);
9527
9796
  const value2 = args[++index];
9528
- if (value2 === void 0) usage12("Connector option requires a value.");
9797
+ if (value2 === void 0) usage13("Connector option requires a value.");
9529
9798
  const keys = {
9530
9799
  "--begin-x": "beginX",
9531
9800
  "--begin-y": "beginY",
@@ -9539,7 +9808,7 @@ function parse(raw, maximum, output3) {
9539
9808
  };
9540
9809
  const key = keys[argument] ?? argument.slice(2);
9541
9810
  if (key === "site" && (!value2 || [...value2].some((c) => c < "0" || c > "9")))
9542
- usage12("Sites require nonnegative decimal integers.");
9811
+ usage13("Sites require nonnegative decimal integers.");
9543
9812
  const parsed = key === "lineWidth" ? value2 === "null" ? null : new Emu(commandLength(value2, 0)) : ["beginX", "beginY", "endX", "endY"].includes(key) ? new Emu(commandLength(value2, -Number.MAX_SAFE_INTEGER)) : ["beginTarget", "endTarget"].includes(key) ? commandJson(value2) : key === "site" ? Number(value2) : key === "kind" && ["1", "2", "3"].includes(value2) ? Number(value2) : key !== "name" && value2 === "null" ? null : value2;
9544
9813
  result.connectorEdit = { ...result.connectorEdit, [key]: parsed };
9545
9814
  continue;
@@ -9556,14 +9825,14 @@ function parse(raw, maximum, output3) {
9556
9825
  "--offset-x",
9557
9826
  "--offset-y"
9558
9827
  ].includes(argument)) {
9559
- if (seen.has(argument)) usage12("Repeated option.");
9828
+ if (seen.has(argument)) usage13("Repeated option.");
9560
9829
  seen.add(argument);
9561
9830
  const value2 = args[++index];
9562
- if (value2 === void 0) usage12("Shape selection option requires a value.");
9831
+ if (value2 === void 0) usage13("Shape selection option requires a value.");
9563
9832
  if (argument === "--shapes") {
9564
9833
  const locations = commandJson(value2);
9565
9834
  if (!Array.isArray(locations) || locations.length === 0)
9566
- usage12("Shapes requires a nonempty location array.");
9835
+ usage13("Shapes requires a nonempty location array.");
9567
9836
  result.shapes = locations;
9568
9837
  } else {
9569
9838
  const key = argument === "--coordinate-system" ? "coordinateSystem" : argument === "--offset-x" ? "offsetX" : argument === "--offset-y" ? "offsetY" : argument.slice(2);
@@ -9576,24 +9845,24 @@ function parse(raw, maximum, output3) {
9576
9845
  continue;
9577
9846
  }
9578
9847
  if (["shapes.group", "shapes.ungroup"].includes(operation) && ["--shapes", "--tolerance"].includes(argument)) {
9579
- if (seen.has(argument)) usage12("Repeated option.");
9848
+ if (seen.has(argument)) usage13("Repeated option.");
9580
9849
  seen.add(argument);
9581
9850
  const value2 = args[++index];
9582
- if (value2 === void 0) usage12("Group option requires a value.");
9851
+ if (value2 === void 0) usage13("Group option requires a value.");
9583
9852
  if (argument === "--tolerance") result.tolerance = new Emu(commandLength(value2, 0));
9584
9853
  else {
9585
9854
  const locations = commandJson(value2);
9586
9855
  if (!Array.isArray(locations) || locations.length < 2)
9587
- usage12("Grouping requires at least two shape locations.");
9856
+ usage13("Grouping requires at least two shape locations.");
9588
9857
  result.shapes = locations;
9589
9858
  }
9590
9859
  continue;
9591
9860
  }
9592
9861
  if (operation.startsWith("fields.") && ["--kind", "--text", "--update", "--timestamp"].includes(argument)) {
9593
- if (seen.has(argument)) usage12("Repeated option.");
9862
+ if (seen.has(argument)) usage13("Repeated option.");
9594
9863
  seen.add(argument);
9595
9864
  const value2 = args[++index];
9596
- if (value2 === void 0) usage12("Field option requires a value.");
9865
+ if (value2 === void 0) usage13("Field option requires a value.");
9597
9866
  const key = argument.slice(2);
9598
9867
  result.fieldEdit = {
9599
9868
  ...result.fieldEdit,
@@ -9602,13 +9871,13 @@ function parse(raw, maximum, output3) {
9602
9871
  continue;
9603
9872
  }
9604
9873
  if (operation.startsWith("animations.") && ["--kind", "--trigger", "--duration", "--delay", "--target"].includes(argument)) {
9605
- if (seen.has(argument)) usage12("Repeated option.");
9874
+ if (seen.has(argument)) usage13("Repeated option.");
9606
9875
  seen.add(argument);
9607
9876
  const value2 = args[++index];
9608
- if (value2 === void 0) usage12("Animation option requires a value.");
9877
+ if (value2 === void 0) usage13("Animation option requires a value.");
9609
9878
  let parsed = value2;
9610
9879
  if (argument === "--duration" || argument === "--delay") {
9611
- if (!value2.length || [...value2].some((character) => character < "0" || character > "9")) usage12("Timing requires integer milliseconds.");
9880
+ if (!value2.length || [...value2].some((character) => character < "0" || character > "9")) usage13("Timing requires integer milliseconds.");
9612
9881
  parsed = Number(value2);
9613
9882
  }
9614
9883
  if (argument === "--target") parsed = animationTargetArgument(value2.trimStart().startsWith("{") ? commandJson(value2) : value2);
@@ -9616,31 +9885,31 @@ function parse(raw, maximum, output3) {
9616
9885
  continue;
9617
9886
  }
9618
9887
  if (operation === "batch" && ["--ops-json", "--ops-file"].includes(argument)) {
9619
- if (seen.has(argument)) usage12("Repeated option.");
9888
+ if (seen.has(argument)) usage13("Repeated option.");
9620
9889
  seen.add(argument);
9621
9890
  const value2 = args[++index];
9622
- if (!value2) usage12("Batch option requires a value.");
9891
+ if (!value2) usage13("Batch option requires a value.");
9623
9892
  if (argument === "--ops-json") result.animationBatch = parseAnimationBatch(commandJson(value2));
9624
9893
  else result.opsFile = value2;
9625
9894
  continue;
9626
9895
  }
9627
9896
  if (operation.startsWith("comments.") && ["--id", "--text", "--author", "--author-id", "--initials", "--timestamp", "--left", "--top"].includes(argument)) {
9628
- if (seen.has(argument)) usage12("Repeated option.");
9897
+ if (seen.has(argument)) usage13("Repeated option.");
9629
9898
  seen.add(argument);
9630
9899
  const value2 = args[++index];
9631
- if (value2 === void 0) usage12("Comment option requires a value.");
9900
+ if (value2 === void 0) usage13("Comment option requires a value.");
9632
9901
  const key = argument === "--author-id" ? "authorId" : argument.slice(2);
9633
9902
  const parsed = ["left", "top"].includes(key) ? commandLength(value2, -Number.MAX_SAFE_INTEGER) : key === "timestamp" ? commandTimestamp(value2).toISOString() : value2;
9634
9903
  result.commentEdit = { ...result.commentEdit, [key]: parsed };
9635
9904
  continue;
9636
9905
  }
9637
9906
  if (Object.hasOwn(accessibilitySchemas, operation) && ["--title", "--alt-text", "--decorative"].includes(argument)) {
9638
- if (seen.has(argument)) usage12("Repeated option.");
9907
+ if (seen.has(argument)) usage13("Repeated option.");
9639
9908
  seen.add(argument);
9640
9909
  const value2 = args[++index];
9641
- if (value2 === void 0) usage12("Accessibility option requires a value.");
9910
+ if (value2 === void 0) usage13("Accessibility option requires a value.");
9642
9911
  if (argument === "--decorative") {
9643
- if (value2 !== "true" && value2 !== "false") usage12("Decorative requires true or false.");
9912
+ if (value2 !== "true" && value2 !== "false") usage13("Decorative requires true or false.");
9644
9913
  result.accessibilityEdit = { ...result.accessibilityEdit, decorative: value2 === "true" };
9645
9914
  } else {
9646
9915
  const key = argument === "--alt-text" ? "altText" : "title";
@@ -9649,10 +9918,10 @@ function parse(raw, maximum, output3) {
9649
9918
  continue;
9650
9919
  }
9651
9920
  if (Object.hasOwn(metadataSchemas, operation) && ["--name", "--value", "--type", "--remove"].includes(argument)) {
9652
- if (seen.has(argument)) usage12("Repeated option.");
9921
+ if (seen.has(argument)) usage13("Repeated option.");
9653
9922
  seen.add(argument);
9654
9923
  const value2 = args[++index];
9655
- if (value2 === void 0) usage12("Metadata option requires a value.");
9924
+ if (value2 === void 0) usage13("Metadata option requires a value.");
9656
9925
  if (argument === "--name") result.metadataName = value2;
9657
9926
  else if (argument === "--value") result.metadataValue = value2;
9658
9927
  else if (argument === "--type") result.metadataType = value2;
@@ -9660,49 +9929,49 @@ function parse(raw, maximum, output3) {
9660
9929
  continue;
9661
9930
  }
9662
9931
  if (operation.startsWith("notes.") && argument === "--text") {
9663
- if (seen.has(argument)) usage12("Repeated option.");
9932
+ if (seen.has(argument)) usage13("Repeated option.");
9664
9933
  seen.add(argument);
9665
9934
  const value2 = args[++index];
9666
- if (value2 === void 0) usage12("Notes text requires a value.");
9935
+ if (value2 === void 0) usage13("Notes text requires a value.");
9667
9936
  result.noteText = value2;
9668
9937
  continue;
9669
9938
  }
9670
9939
  if (operation.startsWith("links.") && ["--url", "--target-slide", "--action", "--trigger", "--sanitize", "--path"].includes(argument)) {
9671
- if (seen.has(argument)) usage12("Repeated option.");
9940
+ if (seen.has(argument)) usage13("Repeated option.");
9672
9941
  seen.add(argument);
9673
9942
  if (argument === "--sanitize") {
9674
9943
  result.linkEdit = { ...result.linkEdit, sanitize: true };
9675
9944
  continue;
9676
9945
  }
9677
9946
  const value2 = args[++index];
9678
- if (value2 === void 0) usage12("Link option requires a value.");
9679
- if (argument === "--target-slide" && (!value2.length || [...value2].some((c) => c < "0" || c > "9") || !Number.isSafeInteger(Number(value2)) || Number(value2) < 1)) usage12("Slide target requires a positive integer.");
9947
+ if (value2 === void 0) usage13("Link option requires a value.");
9948
+ if (argument === "--target-slide" && (!value2.length || [...value2].some((c) => c < "0" || c > "9") || !Number.isSafeInteger(Number(value2)) || Number(value2) < 1)) usage13("Slide target requires a positive integer.");
9680
9949
  const key = argument === "--target-slide" ? "targetSlide" : argument.slice(2);
9681
9950
  result.linkEdit = { ...result.linkEdit, [key]: argument === "--target-slide" ? Number(value2) : argument === "--path" ? commandJson(value2) : value2 };
9682
9951
  continue;
9683
9952
  }
9684
9953
  if (operation.startsWith("transitions.") && ["--kind", "--direction", "--duration", "--advance-after", "--advance-on-click"].includes(argument)) {
9685
- if (seen.has(argument)) usage12("Repeated option.");
9954
+ if (seen.has(argument)) usage13("Repeated option.");
9686
9955
  seen.add(argument);
9687
9956
  const value2 = args[++index];
9688
- if (value2 === void 0) usage12("Transition option requires a value.");
9957
+ if (value2 === void 0) usage13("Transition option requires a value.");
9689
9958
  let parsed = value2;
9690
9959
  if (argument === "--duration" || argument === "--advance-after") {
9691
9960
  if (argument === "--advance-after" && value2 === "null") parsed = null;
9692
9961
  else {
9693
- if (!value2.length || [...value2].some((character) => character < "0" || character > "9")) usage12("Timing requires integer milliseconds.");
9962
+ if (!value2.length || [...value2].some((character) => character < "0" || character > "9")) usage13("Timing requires integer milliseconds.");
9694
9963
  parsed = Number(value2);
9695
9964
  }
9696
9965
  }
9697
9966
  if (argument === "--advance-on-click") {
9698
- if (value2 !== "true" && value2 !== "false") usage12("Advance on click requires true or false.");
9967
+ if (value2 !== "true" && value2 !== "false") usage13("Advance on click requires true or false.");
9699
9968
  parsed = value2 === "true";
9700
9969
  }
9701
9970
  const key = argument === "--advance-after" ? "advanceAfter" : argument === "--advance-on-click" ? "advanceOnClick" : argument.slice(2);
9702
9971
  result.transitionEdit = { ...result.transitionEdit, [key]: parsed };
9703
9972
  continue;
9704
9973
  }
9705
- if (seen.has(argument) && argument !== "--limit") usage12("Repeated option.");
9974
+ if (seen.has(argument) && argument !== "--limit") usage13("Repeated option.");
9706
9975
  seen.add(argument);
9707
9976
  if (argument === "--json") {
9708
9977
  result.json = true;
@@ -9710,7 +9979,7 @@ function parse(raw, maximum, output3) {
9710
9979
  }
9711
9980
  if (argument === "--unique") {
9712
9981
  if (!["images.list", "images.extract"].includes(operation))
9713
- usage12("Unique requires images list or extract.");
9982
+ usage13("Unique requires images list or extract.");
9714
9983
  result.unique = true;
9715
9984
  continue;
9716
9985
  }
@@ -9723,7 +9992,7 @@ function parse(raw, maximum, output3) {
9723
9992
  continue;
9724
9993
  }
9725
9994
  if (argument === "--shared") {
9726
- if (operation !== "images.replace") usage12("Shared requires images replace.");
9995
+ if (operation !== "images.replace") usage13("Shared requires images replace.");
9727
9996
  result.imageReplace = { ...result.imageReplace, shared: true };
9728
9997
  continue;
9729
9998
  }
@@ -9740,12 +10009,12 @@ function parse(raw, maximum, output3) {
9740
10009
  }
9741
10010
  if (argument === "--allow-partial-output") {
9742
10011
  if (!["extract", "slides.split", "images.extract", "media.extract", "objects.extract"].includes(operation))
9743
- usage12("Partial output requires a multi-file operation.");
10012
+ usage13("Partial output requires a multi-file operation.");
9744
10013
  result.allowPartialOutput = true;
9745
10014
  continue;
9746
10015
  }
9747
10016
  if (argument === "--first") {
9748
- if (operation !== "text.replace") usage12("First requires text replace.");
10017
+ if (operation !== "text.replace") usage13("First requires text replace.");
9749
10018
  result.first = true;
9750
10019
  continue;
9751
10020
  }
@@ -9753,7 +10022,7 @@ function parse(raw, maximum, output3) {
9753
10022
  result.all = true;
9754
10023
  continue;
9755
10024
  }
9756
- if (!scalarOptions.includes(argument)) usage12("Unsupported option.");
10025
+ if (!scalarOptions.includes(argument)) usage13("Unsupported option.");
9757
10026
  const booleanValueOptions = [
9758
10027
  "--preserve-geometry",
9759
10028
  "--preserve-crop",
@@ -9778,9 +10047,9 @@ function parse(raw, maximum, output3) {
9778
10047
  "--matching-name",
9779
10048
  "--with"
9780
10049
  ].includes(argument))
9781
- usage12("Missing option value.");
10050
+ usage13("Missing option value.");
9782
10051
  if (["--data-json", "--data-file"].includes(argument)) {
9783
- if (operation !== "template.apply") usage12("Binding sources require template apply.");
10052
+ if (operation !== "template.apply") usage13("Binding sources require template apply.");
9784
10053
  if (argument === "--data-file") result.dataFile = value;
9785
10054
  else {
9786
10055
  const bindings = commandJson(value);
@@ -9791,7 +10060,7 @@ function parse(raw, maximum, output3) {
9791
10060
  }
9792
10061
  if (operation === "objects.add" && ["--icon", "--icon-content-type", "--program", "--program-id", "--name", "--left", "--top", "--width", "--height", "--icon-width", "--icon-height"].includes(argument)) {
9793
10062
  if (argument === "--program") {
9794
- if (!Object.hasOwn(PROG_ID, value)) usage12("Unknown registered program.");
10063
+ if (!Object.hasOwn(PROG_ID, value)) usage13("Unknown registered program.");
9795
10064
  result.objectAdd = { ...result.objectAdd, progId: PROG_ID[value] };
9796
10065
  } else if (argument === "--icon") result.icon = value;
9797
10066
  else if (argument === "--icon-content-type") result.iconContentType = value;
@@ -9807,10 +10076,10 @@ function parse(raw, maximum, output3) {
9807
10076
  else if (argument === "--poster-content-type") result.posterContentType = value;
9808
10077
  else {
9809
10078
  const key = argument === "--mime-type" ? "contentType" : argument.slice(2).split("-").map((part, i) => i ? part[0].toUpperCase() + part.slice(1) : part).join("");
9810
- if (key === "kind" && !["audio", "video"].includes(value)) usage12("Media kind requires audio or video.");
9811
- if (key === "loop" && !["true", "false"].includes(value)) usage12("Loop requires true or false.");
10079
+ if (key === "kind" && !["audio", "video"].includes(value)) usage13("Media kind requires audio or video.");
10080
+ if (key === "loop" && !["true", "false"].includes(value)) usage13("Loop requires true or false.");
9812
10081
  const parsed = ["left", "top", "width", "height"].includes(key) ? commandLength(value, ["width", "height"].includes(key) ? 1 : -27273042316900) : key === "loop" ? value === "true" : ["trimStart", "trimEnd", "volume"].includes(key) ? Number(value) : value;
9813
- if (typeof parsed === "number" && !Number.isFinite(parsed)) usage12("Media values must be finite.");
10082
+ if (typeof parsed === "number" && !Number.isFinite(parsed)) usage13("Media values must be finite.");
9814
10083
  result.mediaEdit = { ...result.mediaEdit, [key]: parsed };
9815
10084
  }
9816
10085
  continue;
@@ -9819,13 +10088,13 @@ function parse(raw, maximum, output3) {
9819
10088
  const key = argument.slice(2).split("-").map((part, i) => i ? part[0].toUpperCase() + part.slice(1) : part).join("");
9820
10089
  let parsed = value;
9821
10090
  if (key === "flipHorizontal" || key === "flipVertical") {
9822
- if (value !== "true" && value !== "false") usage12("Picture flips require true or false.");
10091
+ if (value !== "true" && value !== "false") usage13("Picture flips require true or false.");
9823
10092
  parsed = value === "true";
9824
10093
  } else if (key === "borderWidth") parsed = commandLength(value, 0);
9825
10094
  else if (key !== "borderColor" && key !== "altText") {
9826
10095
  parsed = Number(value);
9827
10096
  if (!value.trim() || !Number.isFinite(parsed))
9828
- usage12("Picture values must be finite numbers.");
10097
+ usage13("Picture values must be finite numbers.");
9829
10098
  }
9830
10099
  result.imageSet = { ...result.imageSet, [key]: parsed };
9831
10100
  continue;
@@ -9839,9 +10108,9 @@ function parse(raw, maximum, output3) {
9839
10108
  ].includes(argument)) {
9840
10109
  const key = argument.slice(2).split("-").map((part, i) => i ? part[0].toUpperCase() + part.slice(1) : part).join("");
9841
10110
  if (key === "contentType" && !["image/png", "image/jpeg", "image/gif", "image/bmp", "image/tiff", "image/x-wmf"].includes(value))
9842
- usage12("Unsupported image content type.");
10111
+ usage13("Unsupported image content type.");
9843
10112
  if (argument.startsWith("--preserve-") && value !== "true" && value !== "false")
9844
- usage12("Image preservation requires true or false.");
10113
+ usage13("Image preservation requires true or false.");
9845
10114
  result.imageReplace = {
9846
10115
  ...result.imageReplace,
9847
10116
  [key]: argument.startsWith("--preserve-") ? value === "true" : value
@@ -9853,18 +10122,18 @@ function parse(raw, maximum, output3) {
9853
10122
  )) {
9854
10123
  const key = argument === "--content-type" ? "contentType" : argument === "--alt-text" ? "altText" : argument.slice(2);
9855
10124
  if (key === "fit" && !["contain", "cover", "stretch"].includes(value))
9856
- usage12("Invalid image fit.");
10125
+ usage13("Invalid image fit.");
9857
10126
  if (key === "contentType" && !["image/png", "image/jpeg", "image/gif", "image/bmp", "image/tiff", "image/x-wmf"].includes(value))
9858
- usage12("Unsupported image content type.");
10127
+ usage13("Unsupported image content type.");
9859
10128
  const parsed = ["left", "top", "width", "height"].includes(key) ? commandLength(value, key === "left" || key === "top" ? -27273042316900 : 1) : value;
9860
10129
  result.imageAdd = { ...result.imageAdd, [key]: parsed };
9861
10130
  continue;
9862
10131
  }
9863
10132
  if (argument === "--image") {
9864
10133
  if (operation !== "images.list" && operation !== "images.extract" && operation !== "images.replace" && operation !== "images.set")
9865
- usage12("Image selection requires images list, extract, replace or set.");
10134
+ usage13("Image selection requires images list, extract, replace or set.");
9866
10135
  if (!value.length || [...value].some((c) => c < "0" || c > "9") || !Number.isSafeInteger(Number(value)) || Number(value) < 1)
9867
- usage12("Image positions require positive integers.");
10136
+ usage13("Image positions require positive integers.");
9868
10137
  result.image = Number(value);
9869
10138
  continue;
9870
10139
  }
@@ -9875,17 +10144,17 @@ function parse(raw, maximum, output3) {
9875
10144
  try {
9876
10145
  parsed = admitFontMetrics(JSON.parse(value));
9877
10146
  } catch (error) {
9878
- if (error instanceof OfficeError16) throw error;
9879
- usage12("Metrics require a valid JSON metric object.");
10147
+ if (error instanceof OfficeError19) throw error;
10148
+ usage13("Metrics require a valid JSON metric object.");
9880
10149
  }
9881
10150
  } else if (["bold", "italic", "wrap"].includes(key)) {
9882
- if (!["true", "false"].includes(value)) usage12("Text fit switches require true or false.");
10151
+ if (!["true", "false"].includes(value)) usage13("Text fit switches require true or false.");
9883
10152
  parsed = value === "true";
9884
10153
  } else if (key.startsWith("margin")) parsed = commandLength(value) / 12700;
9885
10154
  else if (key !== "fontFamily") {
9886
10155
  const pieces = value.split(".");
9887
10156
  if (pieces.length > 2 || pieces.some((p) => !p || [...p].some((c) => c < "0" || c > "9")))
9888
- usage12("Text fit sizes and spacing require decimal numbers.");
10157
+ usage13("Text fit sizes and spacing require decimal numbers.");
9889
10158
  parsed = Number(value);
9890
10159
  }
9891
10160
  result.fitEdit = { ...result.fitEdit, [key]: parsed };
@@ -9897,13 +10166,13 @@ function parse(raw, maximum, output3) {
9897
10166
  if (value === "null" && key !== "text") parsed = null;
9898
10167
  else if (key.startsWith("margin")) parsed = commandLength(value, -2147483648) / 12700;
9899
10168
  else if (key === "wrap") {
9900
- if (!["true", "false"].includes(value)) usage12("Wrap requires true, false or null.");
10169
+ if (!["true", "false"].includes(value)) usage13("Wrap requires true, false or null.");
9901
10170
  parsed = value === "true";
9902
10171
  } else if (key === "columns" || key === "rotation") {
9903
10172
  const digits = key === "rotation" && value.startsWith("-") ? value.slice(1) : value;
9904
10173
  const pieces = digits.split(".");
9905
10174
  if (pieces.length > (key === "columns" ? 1 : 2) || pieces.some((piece) => !piece || [...piece].some((c) => c < "0" || c > "9")) || !Number.isFinite(Number(value)))
9906
- usage12("Columns require an integer; rotation requires finite decimal degrees.");
10175
+ usage13("Columns require an integer; rotation requires finite decimal degrees.");
9907
10176
  parsed = Number(value);
9908
10177
  }
9909
10178
  result.frameEdit = { ...result.frameEdit, [key]: parsed };
@@ -9913,12 +10182,12 @@ function parse(raw, maximum, output3) {
9913
10182
  let key = argument.slice(2).split("-").map((part, index2) => index2 ? part[0].toUpperCase() + part.slice(1) : part).join("");
9914
10183
  let parsed = value;
9915
10184
  if (key === "direction") {
9916
- if (seen.has("--rtl")) usage12("Direction and RTL cannot be combined.");
9917
- if (!["ltr", "rtl", "null"].includes(value)) usage12("Direction requires ltr, rtl or null.");
10185
+ if (seen.has("--rtl")) usage13("Direction and RTL cannot be combined.");
10186
+ if (!["ltr", "rtl", "null"].includes(value)) usage13("Direction requires ltr, rtl or null.");
9918
10187
  key = "rtl";
9919
10188
  parsed = value === "null" ? null : value === "rtl";
9920
10189
  } else if (key === "numbering") {
9921
- if (seen.has("--bullet")) usage12("Bullet and numbering cannot be combined.");
10190
+ if (seen.has("--bullet")) usage13("Bullet and numbering cannot be combined.");
9922
10191
  const schemes = {
9923
10192
  decimal: "arabicPeriod",
9924
10193
  "lower-alpha": "alphaLcPeriod",
@@ -9927,7 +10196,7 @@ function parse(raw, maximum, output3) {
9927
10196
  "upper-roman": "romanUcPeriod"
9928
10197
  };
9929
10198
  if (!Object.hasOwn(schemes, value) && !["none", "null"].includes(value))
9930
- usage12("Unsupported numbering style.");
10199
+ usage13("Unsupported numbering style.");
9931
10200
  key = "bullet";
9932
10201
  parsed = value === "null" ? null : value === "none" ? { kind: "none" } : { kind: "numbered", scheme: schemes[value] };
9933
10202
  } else if (value === "null" && key !== "paragraph") parsed = null;
@@ -9941,11 +10210,11 @@ function parse(raw, maximum, output3) {
9941
10210
  ].includes(key))
9942
10211
  parsed = commandLength(value, key === "indent" ? -Number.MAX_SAFE_INTEGER : 0) / 12700;
9943
10212
  else if (key === "rtl") {
9944
- if (!["true", "false"].includes(value)) usage12("RTL requires true, false or null.");
10213
+ if (!["true", "false"].includes(value)) usage13("RTL requires true, false or null.");
9945
10214
  parsed = value === "true";
9946
10215
  } else if (["paragraph", "level"].includes(key)) {
9947
10216
  if (![...value].every((c) => c >= "0" && c <= "9") || !Number.isSafeInteger(Number(value)) || key === "paragraph" && Number(value) < 1)
9948
- usage12("Invalid paragraph position or level.");
10217
+ usage13("Invalid paragraph position or level.");
9949
10218
  parsed = Number(value) - (key === "paragraph" ? 1 : 0);
9950
10219
  } else if (key === "lineSpacing") {
9951
10220
  const pieces = value.split(".");
@@ -9957,7 +10226,7 @@ function parse(raw, maximum, output3) {
9957
10226
  parsed = value.startsWith("{") ? commandJson(value) : { kind: "character", character: value };
9958
10227
  else if (key === "tabs") {
9959
10228
  const tabs = commandJson(value);
9960
- if (!Array.isArray(tabs)) usage12("Tabs require an array or null.");
10229
+ if (!Array.isArray(tabs)) usage13("Tabs require an array or null.");
9961
10230
  parsed = tabs.map((tab) => {
9962
10231
  if (tab && typeof tab === "object" && "unit" in tab) {
9963
10232
  const record3 = tab;
@@ -9970,7 +10239,7 @@ function parse(raw, maximum, output3) {
9970
10239
  const aligned = tab;
9971
10240
  const length4 = tab.position;
9972
10241
  if (Object.keys(aligned).some((key2) => !["position", "alignment"].includes(key2)))
9973
- usage12("Tabs require finite explicit lengths.");
10242
+ usage13("Tabs require finite explicit lengths.");
9974
10243
  return {
9975
10244
  position: paragraphTabLength(length4),
9976
10245
  alignment: aligned.alignment
@@ -9980,9 +10249,9 @@ function parse(raw, maximum, output3) {
9980
10249
  });
9981
10250
  }
9982
10251
  if (argument === "--rtl" && seen.has("--direction"))
9983
- usage12("Direction and RTL cannot be combined.");
10252
+ usage13("Direction and RTL cannot be combined.");
9984
10253
  if (argument === "--bullet" && seen.has("--numbering"))
9985
- usage12("Bullet and numbering cannot be combined.");
10254
+ usage13("Bullet and numbering cannot be combined.");
9986
10255
  result.paragraphEdit = { ...result.paragraphEdit, [key]: parsed };
9987
10256
  continue;
9988
10257
  }
@@ -9993,20 +10262,20 @@ function parse(raw, maximum, output3) {
9993
10262
  else if (["complexScriptCharset", "complexScriptPitchFamily"].includes(key)) {
9994
10263
  const digits = value.startsWith("-") ? value.slice(1) : value;
9995
10264
  if (!digits || [...digits].some((c) => c < "0" || c > "9") || !Number.isSafeInteger(Number(value)))
9996
- usage12("Font classification requires an integer or null.");
10265
+ usage13("Font classification requires an integer or null.");
9997
10266
  parsed = Number(value);
9998
10267
  } else if (["size", "spacing"].includes(key))
9999
10268
  parsed = commandLength(value, key === "spacing" ? -Number.MAX_SAFE_INTEGER : 1) / 12700;
10000
10269
  else if (["bold", "italic", "rtl"].includes(key)) {
10001
- if (!["true", "false"].includes(value)) usage12("Emphasis requires true, false or null.");
10270
+ if (!["true", "false"].includes(value)) usage13("Emphasis requires true, false or null.");
10002
10271
  parsed = value === "true";
10003
10272
  } else if (["paragraph", "run"].includes(key)) {
10004
10273
  if (![...value].every((c) => c >= "0" && c <= "9") || !Number.isSafeInteger(Number(value)) || Number(value) < 1)
10005
- usage12("Text positions require positive one-based integers.");
10274
+ usage13("Text positions require positive one-based integers.");
10006
10275
  parsed = Number(value) - 1;
10007
10276
  } else if (key === "baseline") {
10008
10277
  if (!value.trim() || !Number.isFinite(Number(value)))
10009
- usage12("Baseline requires a finite percentage.");
10278
+ usage13("Baseline requires a finite percentage.");
10010
10279
  parsed = Number(value);
10011
10280
  } else if (["color", "highlight"].includes(key) && value.startsWith("{"))
10012
10281
  parsed = commandJson(value);
@@ -10017,20 +10286,20 @@ function parse(raw, maximum, output3) {
10017
10286
  continue;
10018
10287
  }
10019
10288
  if (argument === "--style-json") {
10020
- if (operation !== "text.replace") usage12("Style override requires text replace.");
10289
+ if (operation !== "text.replace") usage13("Style override requires text replace.");
10021
10290
  const style = commandJson(value);
10022
10291
  if (!style || typeof style !== "object" || Array.isArray(style) || Object.keys(style).length === 0 || Object.entries(style).some(
10023
10292
  ([key, field]) => !["bold", "italic"].includes(key) || typeof field !== "boolean"
10024
10293
  ))
10025
- usage12("Style requires explicit bold or italic boolean values.");
10294
+ usage13("Style requires explicit bold or italic boolean values.");
10026
10295
  result.style = style;
10027
10296
  continue;
10028
10297
  }
10029
10298
  if (["--find", "--with", "--occurrence"].includes(argument)) {
10030
- if (operation !== "text.replace") usage12("Match options require text replace.");
10299
+ if (operation !== "text.replace") usage13("Match options require text replace.");
10031
10300
  if (argument === "--occurrence") {
10032
10301
  if (![...value].every((c) => c >= "0" && c <= "9") || !Number.isSafeInteger(Number(value)) || Number(value) < 1)
10033
- usage12("Occurrence must be a positive integer.");
10302
+ usage13("Occurrence must be a positive integer.");
10034
10303
  result.occurrence = Number(value);
10035
10304
  } else if (argument === "--find") result.find = value;
10036
10305
  else result.with = value;
@@ -10047,7 +10316,7 @@ function parse(raw, maximum, output3) {
10047
10316
  ].includes(argument)) {
10048
10317
  const key = argument === "--placeholder-policy" ? "placeholderPolicy" : argument === "--show-master-shapes" ? "showMasterShapes" : argument === "--matching-name" ? "matchingName" : argument === "--placeholders-json" ? "placeholders" : argument.slice(2);
10049
10318
  if (["preserve", "showMasterShapes"].includes(key) && !["true", "false"].includes(value))
10050
- usage12("Expected true or false.");
10319
+ usage13("Expected true or false.");
10051
10320
  result.layoutEdit = {
10052
10321
  ...result.layoutEdit,
10053
10322
  [key]: key === "placeholders" ? commandJson(value) : ["preserve", "showMasterShapes"].includes(key) ? value === "true" : value
@@ -10086,18 +10355,18 @@ function parse(raw, maximum, output3) {
10086
10355
  }
10087
10356
  if (operation === "shapes.drawing.set" && ["--fill", "--line", "--shadow-inherit"].includes(argument)) {
10088
10357
  if (argument === "--shadow-inherit" && !["true", "false"].includes(value))
10089
- usage12("Shadow inheritance requires true or false.");
10358
+ usage13("Shadow inheritance requires true or false.");
10090
10359
  const key = argument === "--shadow-inherit" ? "shadowInherit" : argument.slice(2);
10091
10360
  result.drawingEdit = { ...result.drawingEdit, [key]: commandJson(value) };
10092
10361
  continue;
10093
10362
  }
10094
10363
  if (operation === "shapes.effects.set" && ["--shadow", "--opacity", "--shadow-blur", "--shadow-color"].includes(argument)) {
10095
10364
  if (argument === "--shadow") {
10096
- if (!["true", "false"].includes(value)) usage12("Shadow requires true or false.");
10365
+ if (!["true", "false"].includes(value)) usage13("Shadow requires true or false.");
10097
10366
  result.shadowEnabled = value === "true";
10098
10367
  } else if (argument === "--opacity") {
10099
10368
  if (!value.trim() || !Number.isFinite(Number(value)) || Number(value) < 0 || Number(value) > 1)
10100
- usage12("Opacity requires a ratio from zero to one.");
10369
+ usage13("Opacity requires a ratio from zero to one.");
10101
10370
  result.shadowOpacity = Number(value);
10102
10371
  } else if (argument === "--shadow-blur")
10103
10372
  result.shadowBlur = { value: commandLength(value, 0), unit: "emu" };
@@ -10106,7 +10375,7 @@ function parse(raw, maximum, output3) {
10106
10375
  continue;
10107
10376
  }
10108
10377
  if (operation.startsWith("shapes.paths.") && argument === "--close") {
10109
- if (!["true", "false"].includes(value)) usage12("Close requires true or false.");
10378
+ if (!["true", "false"].includes(value)) usage13("Close requires true or false.");
10110
10379
  result.close = value === "true";
10111
10380
  continue;
10112
10381
  }
@@ -10144,18 +10413,18 @@ function parse(raw, maximum, output3) {
10144
10413
  value,
10145
10414
  ["left", "top"].includes(key) ? -27273042316900 : key === "lineWidth" ? 0 : 1
10146
10415
  );
10147
- if (Math.abs(length4) > 27273042316900) usage12("Shape geometry exceeds DrawingML bounds.");
10416
+ if (Math.abs(length4) > 27273042316900) usage13("Shape geometry exceeds DrawingML bounds.");
10148
10417
  parsed = { value: length4, unit: "emu" };
10149
10418
  } else if (key === "flipHorizontal" || key === "flipVertical") {
10150
- if (!["true", "false"].includes(value)) usage12("Flips require true or false.");
10419
+ if (!["true", "false"].includes(value)) usage13("Flips require true or false.");
10151
10420
  parsed = value === "true";
10152
10421
  } else if (key === "locked") {
10153
10422
  if (!["true", "false", "null"].includes(value))
10154
- usage12("Locked requires true, false or null.");
10423
+ usage13("Locked requires true, false or null.");
10155
10424
  parsed = value === "null" ? null : value === "true";
10156
10425
  } else if (key === "rotation") {
10157
10426
  if (!value.trim() || !Number.isFinite(Number(value)))
10158
- usage12("Rotation requires finite degrees.");
10427
+ usage13("Rotation requires finite degrees.");
10159
10428
  parsed = Number(value);
10160
10429
  } else if (key === "kind" && value.length && [...value].every((c) => c >= "0" && c <= "9"))
10161
10430
  parsed = Number(value);
@@ -10193,7 +10462,7 @@ function parse(raw, maximum, output3) {
10193
10462
  "--loop",
10194
10463
  "--show-type"
10195
10464
  ].includes(argument) || operation === "settings.set" && ["--width", "--height"].includes(argument)) {
10196
- if (operation !== "settings.set") usage12("Settings options require settings set.");
10465
+ if (operation !== "settings.set") usage13("Settings options require settings set.");
10197
10466
  if (["--width", "--height", "--notes-width", "--notes-height"].includes(argument)) {
10198
10467
  const key = argument === "--notes-width" ? "notesWidth" : argument === "--notes-height" ? "notesHeight" : argument.slice(2);
10199
10468
  result.settings = {
@@ -10202,7 +10471,7 @@ function parse(raw, maximum, output3) {
10202
10471
  };
10203
10472
  } else if (argument === "--orientation" || argument === "--notes-orientation") {
10204
10473
  if (value !== "portrait" && value !== "landscape")
10205
- usage12("Orientation requires portrait or landscape.");
10474
+ usage13("Orientation requires portrait or landscape.");
10206
10475
  result.settings = {
10207
10476
  ...result.settings,
10208
10477
  [argument === "--orientation" ? "orientation" : "notesOrientation"]: value
@@ -10210,17 +10479,17 @@ function parse(raw, maximum, output3) {
10210
10479
  } else if (argument === "--slide-number-start") {
10211
10480
  const digits = value.startsWith("-") ? value.slice(1) : value;
10212
10481
  if (!digits.length || ![...digits].every((c) => c >= "0" && c <= "9") || !Number.isSafeInteger(Number(value)))
10213
- usage12("Slide-number start requires a safe integer.");
10482
+ usage13("Slide-number start requires a safe integer.");
10214
10483
  result.settings = { ...result.settings, slideNumberStart: Number(value) };
10215
10484
  } else if (argument === "--loop" || argument === "--scale-content") {
10216
- if (value !== "true" && value !== "false") usage12("Boolean settings require true or false.");
10485
+ if (value !== "true" && value !== "false") usage13("Boolean settings require true or false.");
10217
10486
  result.settings = {
10218
10487
  ...result.settings,
10219
10488
  [argument === "--loop" ? "loop" : "scaleContent"]: value === "true"
10220
10489
  };
10221
10490
  } else {
10222
10491
  if (value !== "speaker" && value !== "window" && value !== "kiosk")
10223
- usage12("Unknown show type.");
10492
+ usage13("Unknown show type.");
10224
10493
  result.settings = { ...result.settings, showType: value };
10225
10494
  }
10226
10495
  continue;
@@ -10230,24 +10499,24 @@ function parse(raw, maximum, output3) {
10230
10499
  else if (argument === "--slides") {
10231
10500
  const slides = commandJson(value);
10232
10501
  if (!Array.isArray(slides) || !slides.length || slides.some((item) => !Number.isSafeInteger(item) || item < 1) || new Set(slides).size !== slides.length)
10233
- usage12("Members require a nonempty array of unique one-based slide positions.");
10502
+ usage13("Members require a nonempty array of unique one-based slide positions.");
10234
10503
  result.membership = { ...result.membership, slides };
10235
10504
  } else {
10236
10505
  if (![...value].every((c) => c >= "0" && c <= "9") || !Number.isSafeInteger(Number(value)) || Number(value) < 1)
10237
- usage12("Section positions must be positive integers.");
10506
+ usage13("Section positions must be positive integers.");
10238
10507
  result.membership = { ...result.membership, position: Number(value) };
10239
10508
  }
10240
10509
  continue;
10241
10510
  }
10242
10511
  if (argument === "--sources") {
10243
- if (operation !== "slides.merge") usage12("Sources require slides merge.");
10512
+ if (operation !== "slides.merge") usage13("Sources require slides merge.");
10244
10513
  const sources = commandJson(value);
10245
10514
  if (!Array.isArray(sources) || !sources.length || sources.some(
10246
10515
  (source3) => !source3 || typeof source3 !== "object" || Array.isArray(source3) || Object.keys(source3).length !== 1 || typeof source3.vfsPath !== "string" || !source3.vfsPath.length
10247
10516
  ))
10248
- usage12("Sources require a nonempty ordered array of scoped vfsPath inputs.");
10517
+ usage13("Sources require a nonempty ordered array of scoped vfsPath inputs.");
10249
10518
  const paths = sources.map((source3) => source3.vfsPath);
10250
- if (new Set(paths).size !== paths.length) usage12("Source inputs must be unique.");
10519
+ if (new Set(paths).size !== paths.length) usage13("Source inputs must be unique.");
10251
10520
  result.sources = paths;
10252
10521
  continue;
10253
10522
  }
@@ -10255,57 +10524,57 @@ function parse(raw, maximum, output3) {
10255
10524
  if (argument === "--manifest") result.manifest = value;
10256
10525
  else {
10257
10526
  const parts = commandJson(value);
10258
- if (!Array.isArray(parts) || parts.some((part) => typeof part !== "string")) usage12("Parts require a string array.");
10527
+ if (!Array.isArray(parts) || parts.some((part) => typeof part !== "string")) usage13("Parts require a string array.");
10259
10528
  result.parts = parts;
10260
10529
  }
10261
10530
  continue;
10262
10531
  }
10263
10532
  if (argument === "--sha256") {
10264
10533
  if (operation !== "images.extract" || value.length !== 64 || !Array.from(value).every((character) => "0123456789abcdef".includes(character)))
10265
- usage12("Image extraction requires a lowercase SHA256 hash.");
10534
+ usage13("Image extraction requires a lowercase SHA256 hash.");
10266
10535
  result.imageSha256 = value;
10267
10536
  continue;
10268
10537
  }
10269
10538
  if (argument === "--output-dir" || argument === "--slides") {
10270
10539
  if (operation !== "slides.split" && !(["extract", "images.extract", "media.extract", "objects.extract"].includes(operation) && argument === "--output-dir"))
10271
- usage12("Option requires a multi-file operation.");
10540
+ usage13("Option requires a multi-file operation.");
10272
10541
  if (argument === "--output-dir") result.outputDir = value;
10273
10542
  else {
10274
10543
  const positions = commandJson(value);
10275
10544
  if (!Array.isArray(positions) || !positions.length || positions.some((position) => !Number.isSafeInteger(position) || position < 1) || new Set(positions).size !== positions.length)
10276
- usage12("Slides require a nonempty array of unique one-based positions.");
10545
+ usage13("Slides require a nonempty array of unique one-based positions.");
10277
10546
  result.splitSlides = positions;
10278
10547
  }
10279
10548
  continue;
10280
10549
  }
10281
10550
  if (argument === "--reference-policy") {
10282
10551
  if (operation !== "slides.remove" || value !== "remove")
10283
- usage12("Slide removal reference policy must be remove.");
10552
+ usage13("Slide removal reference policy must be remove.");
10284
10553
  result.referencePolicy = value;
10285
10554
  continue;
10286
10555
  }
10287
10556
  if (argument === "--media-policy") {
10288
10557
  if (operation !== "slides.duplicate" || !["shared-media", "isolated-instance"].includes(value))
10289
- usage12("Slide duplication media policy must be shared-media or isolated-instance.");
10558
+ usage13("Slide duplication media policy must be shared-media or isolated-instance.");
10290
10559
  result.copyMediaPolicy = value;
10291
10560
  continue;
10292
10561
  }
10293
10562
  if (["--source", "--source-slides", "--theme-policy", "--dimension-policy"].includes(argument)) {
10294
10563
  if (operation !== "slides.import" && operation !== "slides.merge")
10295
- usage12("Option requires slides import or merge.");
10564
+ usage13("Option requires slides import or merge.");
10296
10565
  if (operation === "slides.merge" && argument === "--source")
10297
- usage12("Merge requires --sources.");
10566
+ usage13("Merge requires --sources.");
10298
10567
  if (argument === "--source") result.source = value;
10299
10568
  else if (argument === "--source-slides") {
10300
10569
  const positions = commandJson(value);
10301
10570
  if (!Array.isArray(positions) || !positions.length || positions.some((position) => !Number.isSafeInteger(position) || position < 1) || new Set(positions).size !== positions.length)
10302
- usage12("Source slides require a nonempty array of unique one-based positions.");
10571
+ usage13("Source slides require a nonempty array of unique one-based positions.");
10303
10572
  result.importing = { ...result.importing, sourceSlides: positions };
10304
10573
  } else if (argument === "--theme-policy") {
10305
- if (value !== "source" && value !== "destination") usage12("Unknown theme policy.");
10574
+ if (value !== "source" && value !== "destination") usage13("Unknown theme policy.");
10306
10575
  result.importing = { ...result.importing, themePolicy: value };
10307
10576
  } else {
10308
- if (value !== "reject" && value !== "destination") usage12("Unknown dimension policy.");
10577
+ if (value !== "reject" && value !== "destination") usage13("Unknown dimension policy.");
10309
10578
  result.importing = { ...result.importing, dimensionPolicy: value };
10310
10579
  }
10311
10580
  continue;
@@ -10323,7 +10592,7 @@ function parse(raw, maximum, output3) {
10323
10592
  if (operation === "slides.import" || operation === "slides.duplicate" || operation === "slides.move" || operation === "slides.set") {
10324
10593
  if (argument === "--position") {
10325
10594
  if (![...value].every((character) => character >= "0" && character <= "9") || !Number.isSafeInteger(Number(value)) || Number(value) < 1)
10326
- usage12("Slide positions must be positive one-based integers.");
10595
+ usage13("Slide positions must be positive one-based integers.");
10327
10596
  if (operation === "slides.import")
10328
10597
  result.importing = { ...result.importing, position: Number(value) };
10329
10598
  else result.mutation = { ...result.mutation, position: Number(value) };
@@ -10331,30 +10600,30 @@ function parse(raw, maximum, output3) {
10331
10600
  result.mutation = { ...result.mutation, name: value };
10332
10601
  else if (operation === "slides.set" && argument === "--hidden") {
10333
10602
  if (value !== "true" && value !== "false")
10334
- usage12("Slide boolean options require true or false.");
10603
+ usage13("Slide boolean options require true or false.");
10335
10604
  result.mutation = { ...result.mutation, hidden: value === "true" };
10336
- } else usage12("Option is unavailable for this slide operation.");
10605
+ } else usage13("Option is unavailable for this slide operation.");
10337
10606
  continue;
10338
10607
  }
10339
- if (operation !== "slides.add") usage12("Slide addition options require slides add.");
10608
+ if (operation !== "slides.add") usage13("Slide addition options require slides add.");
10340
10609
  result.addition ??= {};
10341
10610
  if (argument === "--position") {
10342
10611
  if (![...value].every((character) => character >= "0" && character <= "9") || !Number.isSafeInteger(Number(value)) || Number(value) < 1)
10343
- usage12("Insertion positions must be positive one-based integers.");
10612
+ usage13("Insertion positions must be positive one-based integers.");
10344
10613
  result.addition = { ...result.addition, position: Number(value) };
10345
10614
  } else if (argument === "--hidden" || argument === "--follow-master-background") {
10346
10615
  if (value !== "true" && value !== "false")
10347
- usage12("Slide boolean options require true or false.");
10616
+ usage13("Slide boolean options require true or false.");
10348
10617
  result.addition = {
10349
10618
  ...result.addition,
10350
10619
  [argument === "--hidden" ? "hidden" : "followMasterBackground"]: value === "true"
10351
10620
  };
10352
10621
  } else if (argument === "--placeholders-json") {
10353
10622
  const placeholders = commandJson(value);
10354
- if (!Array.isArray(placeholders)) usage12("Placeholders require an array.");
10623
+ if (!Array.isArray(placeholders)) usage13("Placeholders require an array.");
10355
10624
  for (const binding of placeholders) {
10356
10625
  if (!binding || typeof binding !== "object" || Array.isArray(binding) || Object.keys(binding).some((key) => !["type", "index", "text"].includes(key)) || typeof binding.type !== "string" || !binding.type.length || typeof binding.text !== "string" || Object.hasOwn(binding, "index") && (!Number.isSafeInteger(binding.index) || binding.index < 0 || binding.index > 4294967295))
10357
- usage12("Placeholder bindings require type, optional nonnegative index, and text.");
10626
+ usage13("Placeholder bindings require type, optional nonnegative index, and text.");
10358
10627
  }
10359
10628
  result.addition = { ...result.addition, placeholders };
10360
10629
  } else result.addition = { ...result.addition, [argument.slice(2)]: value };
@@ -10371,16 +10640,16 @@ function parse(raw, maximum, output3) {
10371
10640
  "--slides-json",
10372
10641
  "--properties-json"
10373
10642
  ].includes(argument)) {
10374
- if (operation !== "create" && operation !== "pack") usage12("Creation options require create or pack.");
10643
+ if (operation !== "create" && operation !== "pack") usage13("Creation options require create or pack.");
10375
10644
  result.creation ??= {};
10376
10645
  if (argument === "--template") result.template = value;
10377
10646
  else if (argument === "--width" || argument === "--height")
10378
10647
  result.creation = { ...result.creation, [argument.slice(2)]: commandLength(value) };
10379
10648
  else if (argument === "--kind") {
10380
- if (!["pptx", "potx", "ppsx"].includes(value)) usage12("Unknown presentation kind.");
10649
+ if (!["pptx", "potx", "ppsx"].includes(value)) usage13("Unknown presentation kind.");
10381
10650
  result.creation = { ...result.creation, kind: value };
10382
10651
  } else if (argument === "--dialect") {
10383
- if (!["strict", "transitional"].includes(value)) usage12("Unknown presentation dialect.");
10652
+ if (!["strict", "transitional"].includes(value)) usage13("Unknown presentation dialect.");
10384
10653
  result.creation = { ...result.creation, dialect: value };
10385
10654
  } else if (argument === "--author") result.creation = { ...result.creation, author: value };
10386
10655
  else if (argument === "--timestamp")
@@ -10388,7 +10657,7 @@ function parse(raw, maximum, output3) {
10388
10657
  else if (argument === "--properties-json") {
10389
10658
  const properties = commandJson(value);
10390
10659
  if (!properties || typeof properties !== "object" || Array.isArray(properties))
10391
- usage12("Properties require an object.");
10660
+ usage13("Properties require an object.");
10392
10661
  if (Object.keys(properties).some(
10393
10662
  (key) => ![
10394
10663
  "title",
@@ -10408,11 +10677,11 @@ function parse(raw, maximum, output3) {
10408
10677
  "lastPrinted"
10409
10678
  ].includes(key)
10410
10679
  ))
10411
- usage12("Unknown creation property.");
10680
+ usage13("Unknown creation property.");
10412
10681
  for (const key of ["created", "modified", "lastPrinted"]) {
10413
10682
  if (Object.hasOwn(properties, key)) {
10414
10683
  const dates = properties;
10415
- if (typeof dates[key] !== "string") usage12("Property dates require UTC strings.");
10684
+ if (typeof dates[key] !== "string") usage13("Property dates require UTC strings.");
10416
10685
  dates[key] = commandTimestamp(dates[key]);
10417
10686
  }
10418
10687
  }
@@ -10434,36 +10703,36 @@ function parse(raw, maximum, output3) {
10434
10703
  }
10435
10704
  if (argument === "--selection-json") {
10436
10705
  if (operation !== "slides.move" && operation !== "slides.set" && operation !== "slides.remove" && operation !== "slides.duplicate")
10437
- usage12("Selection JSON requires a supported slide mutation.");
10706
+ usage13("Selection JSON requires a supported slide mutation.");
10438
10707
  const selection = commandJson(value);
10439
10708
  if (!selection || typeof selection !== "object")
10440
- usage12("Selection JSON requires a query or nonempty query array.");
10709
+ usage13("Selection JSON requires a query or nonempty query array.");
10441
10710
  const queries = Array.isArray(selection) ? selection : [selection];
10442
- if (!queries.length) usage12("Selection arrays must not be empty.");
10711
+ if (!queries.length) usage13("Selection arrays must not be empty.");
10443
10712
  for (const query of queries) {
10444
10713
  if (!query || typeof query !== "object" || Array.isArray(query) || Object.keys(query).some(
10445
10714
  (key) => !["kind", "scope", "owner", "position", "id", "name", "token", "all"].includes(key)
10446
10715
  ))
10447
- usage12("Invalid slide selection query.");
10716
+ usage13("Invalid slide selection query.");
10448
10717
  if (query.token !== void 0) {
10449
10718
  if (typeof query.token !== "string" || Object.keys(query).some((key) => !["kind", "token"].includes(key)) || query.kind !== void 0 && query.kind !== "slide")
10450
- usage12("Invalid slide token query.");
10719
+ usage13("Invalid slide token query.");
10451
10720
  decodeSelectionToken2(query.token);
10452
10721
  continue;
10453
10722
  }
10454
10723
  if (query.kind !== "slide" || query.scope !== void 0 && query.scope !== "slides" || query.all !== void 0 && typeof query.all !== "boolean")
10455
- usage12("Selection queries must address slides.");
10724
+ usage13("Selection queries must address slides.");
10456
10725
  for (const key of ["id", "name", "owner"])
10457
10726
  if (query[key] !== void 0 && (typeof query[key] !== "string" || key !== "name" && !query[key]))
10458
- usage12("Invalid slide selection value.");
10727
+ usage13("Invalid slide selection value.");
10459
10728
  if ([query.position, query.id, query.name].filter((item) => item !== void 0).length > 1)
10460
- usage12("Slide identity selectors cannot be combined.");
10729
+ usage13("Slide identity selectors cannot be combined.");
10461
10730
  if (!query.all && query.position === void 0 && query.id === void 0 && query.name === void 0)
10462
- usage12("Slide selection requires an identity or all.");
10731
+ usage13("Slide selection requires an identity or all.");
10463
10732
  if (query.position !== void 0) {
10464
10733
  const position = query.position;
10465
10734
  if (!position || typeof position !== "object" || Array.isArray(position) || Object.keys(position).some((key) => !["coordinateSystem", "value"].includes(key)) || !["one-based", "zero-based"].includes(position.coordinateSystem) || !Number.isSafeInteger(position.value) || position.value < (position.coordinateSystem === "one-based" ? 1 : 0))
10466
- usage12("Invalid slide selection coordinate.");
10735
+ usage13("Invalid slide selection coordinate.");
10467
10736
  }
10468
10737
  }
10469
10738
  result.selection = selection;
@@ -10473,9 +10742,9 @@ function parse(raw, maximum, output3) {
10473
10742
  const pieces = value.split("=");
10474
10743
  const [name, digits] = pieces;
10475
10744
  if (pieces.length !== 2 || !name || !digits || ![...digits].every((c) => c >= "0" && c <= "9") || !Number.isSafeInteger(Number(digits)) || Number(digits) < 1)
10476
- usage12("Limits require NAME=POSITIVE_INTEGER.");
10745
+ usage13("Limits require NAME=POSITIVE_INTEGER.");
10477
10746
  result.limits ??= {};
10478
- if (Object.hasOwn(result.limits, name)) usage12("Repeated limit name.");
10747
+ if (Object.hasOwn(result.limits, name)) usage13("Repeated limit name.");
10479
10748
  if (![
10480
10749
  "maxBytes",
10481
10750
  "maxNodes",
@@ -10483,21 +10752,21 @@ function parse(raw, maximum, output3) {
10483
10752
  "maxOutputBytes",
10484
10753
  ...["extract", "images.extract", "media.extract", "objects.extract"].includes(operation) ? ["maxOutputs"] : []
10485
10754
  ].includes(name))
10486
- usage12("Unknown limit name.");
10755
+ usage13("Unknown limit name.");
10487
10756
  result.limits[name] = Number(digits);
10488
10757
  } else if (argument === "--placeholder") {
10489
- if (!value.length || ![...value].every((c) => c >= "0" && c <= "9") || (!Number.isSafeInteger(Number(value)) || Number(value) > 4294967295)) usage12("Placeholder idx must be a nonnegative integer.");
10758
+ if (!value.length || ![...value].every((c) => c >= "0" && c <= "9") || (!Number.isSafeInteger(Number(value)) || Number(value) > 4294967295)) usage13("Placeholder idx must be a nonnegative integer.");
10490
10759
  result.placeholder = Number(value);
10491
10760
  } else if (argument === "--slide") {
10492
10761
  if (![...value].every((character) => character >= "0" && character <= "9") || !Number.isSafeInteger(Number(value)) || Number(value) < 1)
10493
- usage12("Slide positions must be positive one-based integers.");
10762
+ usage13("Slide positions must be positive one-based integers.");
10494
10763
  result.slide = Number(value);
10495
10764
  } else if (argument === "--shape") result.shape = value;
10496
10765
  else if (argument === "--part") {
10497
10766
  if (operation === "objects.list" || operation === "fonts.list")
10498
- usage12("Part selection requires object extraction.");
10767
+ usage13("Part selection requires object extraction.");
10499
10768
  try {
10500
- result.part = partName3(value, false);
10769
+ result.part = partName4(value, false);
10501
10770
  } catch {
10502
10771
  throw new SelectionError8("invalid-selection");
10503
10772
  }
@@ -10505,7 +10774,7 @@ function parse(raw, maximum, output3) {
10505
10774
  else if (argument === "--file") result.file = value;
10506
10775
  else if (argument === "--output") result.output = value;
10507
10776
  else {
10508
- if (!scopes2.includes(value)) usage12("Unknown scope.");
10777
+ if (!scopes2.includes(value)) usage13("Unknown scope.");
10509
10778
  result.scope = value;
10510
10779
  }
10511
10780
  }
@@ -10529,42 +10798,42 @@ function parse(raw, maximum, output3) {
10529
10798
  "--dry-run"
10530
10799
  ];
10531
10800
  if ([...seen].some((option) => !allowed.includes(option)))
10532
- usage12("Option does not apply to images set.");
10533
- if (positionals.length !== 1 || !positionals[0]) usage12("Image formatting requires one input.");
10534
- if (!result.imageSet) usage12("Image formatting requires an update.");
10801
+ usage13("Option does not apply to images set.");
10802
+ if (positionals.length !== 1 || !positionals[0]) usage13("Image formatting requires one input.");
10803
+ if (!result.imageSet) usage13("Image formatting requires an update.");
10535
10804
  if (result.scope === "presentation" || result.scope === "shared")
10536
- usage12("Image formatting requires an occurrence scope.");
10805
+ usage13("Image formatting requires an occurrence scope.");
10537
10806
  if (result.token && ["--slide", "--image", "--scope", "--all"].some((option) => seen.has(option)))
10538
- usage12("Opaque and simple selectors cannot be combined.");
10807
+ usage13("Opaque and simple selectors cannot be combined.");
10539
10808
  if (result.image !== void 0 && (!result.scope || result.scope === "slides") && result.slide === void 0)
10540
- usage12("Slide image selection requires a slide.");
10809
+ usage13("Slide image selection requires a slide.");
10541
10810
  result.input = positionals[0];
10542
10811
  result.imageSet = {
10543
10812
  ...result.imageSet,
10544
10813
  ...result.all ? { all: true } : {},
10545
10814
  ...result.allowEmpty ? { allowEmpty: true } : {}
10546
10815
  };
10547
- if (result.inPlace && result.input === "-") usage12("Stdin cannot be edited in place.");
10548
- if (result.inPlace && result.output) usage12("Output and in-place cannot be combined.");
10816
+ if (result.inPlace && result.input === "-") usage13("Stdin cannot be edited in place.");
10817
+ if (result.inPlace && result.output) usage13("Output and in-place cannot be combined.");
10549
10818
  if (!result.dryRun && !result.inPlace && !result.output)
10550
- usage12("Mutation requires a destination.");
10551
- if (result.force && !result.output) usage12("Force requires an explicit output destination.");
10819
+ usage13("Mutation requires a destination.");
10820
+ if (result.force && !result.output) usage13("Force requires an explicit output destination.");
10552
10821
  if (result.output === result.input && result.output !== "-")
10553
- usage12("Replacing input requires --in-place.");
10822
+ usage13("Replacing input requires --in-place.");
10554
10823
  if (result.output === "-" && result.json && !result.dryRun)
10555
- usage12("Binary stdout cannot be combined with JSON.");
10824
+ usage13("Binary stdout cannot be combined with JSON.");
10556
10825
  return result;
10557
10826
  }
10558
10827
  if (result.placeholder !== void 0) {
10559
10828
  if (!["images.add", "tables.add", "charts.add"].includes(operation) || result.slide === void 0)
10560
- usage12("Placeholder insertion requires an add operation and --slide.");
10829
+ usage13("Placeholder insertion requires an add operation and --slide.");
10561
10830
  if (["--left", "--top", "--width", "--height", "--fit"].some((flag) => seen.has(flag)))
10562
- usage12("Placeholder insertion uses inherited geometry.");
10563
- if (operation === "tables.add" && (!result.tableEdit?.rows || !result.tableEdit?.columns)) usage12("Table placeholder insertion requires rows and columns.");
10831
+ usage13("Placeholder insertion uses inherited geometry.");
10832
+ if (operation === "tables.add" && (!result.tableEdit?.rows || !result.tableEdit?.columns)) usage13("Table placeholder insertion requires rows and columns.");
10564
10833
  if (operation === "tables.add" && Object.keys(result.tableEdit ?? {}).some((key) => !["rows", "columns"].includes(key)))
10565
- usage12("Table placeholder insertion accepts rows and columns.");
10834
+ usage13("Table placeholder insertion accepts rows and columns.");
10566
10835
  if (operation === "charts.add" && Object.keys(result.chartEdit ?? {}).some((key) => !["type", "data"].includes(key)))
10567
- usage12("Chart placeholder insertion accepts type and data.");
10836
+ usage13("Chart placeholder insertion accepts type and data.");
10568
10837
  }
10569
10838
  if (operation === "images.add" || operation === "images.replace") {
10570
10839
  const replacing = operation === "images.replace";
@@ -10592,19 +10861,19 @@ function parse(raw, maximum, output3) {
10592
10861
  "--dry-run"
10593
10862
  ];
10594
10863
  if ([...seen].some((option) => !allowed.includes(option)))
10595
- usage12("Option does not apply to this image operation.");
10864
+ usage13("Option does not apply to this image operation.");
10596
10865
  if (positionals.length !== 1 || !positionals[0] || !replacing && result.slide === void 0 || !result.file)
10597
- usage12("Image mutation requires one input, selection and file.");
10866
+ usage13("Image mutation requires one input, selection and file.");
10598
10867
  if (replacing) {
10599
- if (result.scope === "presentation") usage12("Presentation scope has no image owners.");
10868
+ if (result.scope === "presentation") usage13("Presentation scope has no image owners.");
10600
10869
  if (result.scope === "shared" && !result.imageReplace?.shared)
10601
- usage12("Shared scope requires explicit shared replacement.");
10870
+ usage13("Shared scope requires explicit shared replacement.");
10602
10871
  if (result.token && ["--slide", "--image", "--scope", "--all"].some((option) => seen.has(option)))
10603
- usage12("Opaque and simple selectors cannot be combined.");
10872
+ usage13("Opaque and simple selectors cannot be combined.");
10604
10873
  if (!result.token && result.image === void 0 && !result.all)
10605
- usage12("Image replacement requires an image selector or all.");
10874
+ usage13("Image replacement requires an image selector or all.");
10606
10875
  if (result.image !== void 0 && (!result.scope || result.scope === "slides") && result.slide === void 0)
10607
- usage12("Slide image selection requires a slide.");
10876
+ usage13("Slide image selection requires a slide.");
10608
10877
  result.imageReplace = {
10609
10878
  ...result.imageReplace,
10610
10879
  ...result.all ? { all: true } : {},
@@ -10613,28 +10882,28 @@ function parse(raw, maximum, output3) {
10613
10882
  }
10614
10883
  result.input = positionals[0];
10615
10884
  if (result.input === "-" && result.file === "-")
10616
- usage12("Document and image cannot both use stdin.");
10885
+ usage13("Document and image cannot both use stdin.");
10617
10886
  const imageOptions = replacing ? result.imageReplace : result.imageAdd;
10618
10887
  if (!imageOptions?.contentType) {
10619
10888
  const extension = result.file.slice(result.file.lastIndexOf(".") + 1).toLowerCase();
10620
10889
  const contentType = { png: "image/png", jpg: "image/jpeg", jpeg: "image/jpeg", gif: "image/gif", bmp: "image/bmp", tif: "image/tiff", tiff: "image/tiff", wmf: "image/x-wmf" }[extension];
10621
10890
  if (!contentType)
10622
- usage12("Image file requires an explicit supported content type or extension.");
10891
+ usage13("Image file requires an explicit supported content type or extension.");
10623
10892
  if (replacing) result.imageReplace = { ...result.imageReplace, contentType };
10624
10893
  else result.imageAdd = { ...result.imageAdd, contentType };
10625
10894
  }
10626
10895
  const both = result.imageAdd?.width !== void 0 && result.imageAdd?.height !== void 0;
10627
10896
  if (!replacing && !both && result.imageAdd?.fit !== void 0)
10628
- usage12("Both dimensions and explicit fit must be supplied together.");
10629
- if (result.inPlace && result.input === "-") usage12("Stdin cannot be edited in place.");
10630
- if (result.inPlace && result.output) usage12("Output and in-place cannot be combined.");
10897
+ usage13("Both dimensions and explicit fit must be supplied together.");
10898
+ if (result.inPlace && result.input === "-") usage13("Stdin cannot be edited in place.");
10899
+ if (result.inPlace && result.output) usage13("Output and in-place cannot be combined.");
10631
10900
  if (!result.dryRun && !result.inPlace && !result.output)
10632
- usage12("Mutation requires a destination.");
10633
- if (result.force && !result.output) usage12("Force requires an explicit output destination.");
10901
+ usage13("Mutation requires a destination.");
10902
+ if (result.force && !result.output) usage13("Force requires an explicit output destination.");
10634
10903
  if (result.output === result.input && result.output !== "-")
10635
- usage12("Replacing input requires --in-place.");
10904
+ usage13("Replacing input requires --in-place.");
10636
10905
  if (result.output === "-" && result.json && !result.dryRun)
10637
- usage12("Binary stdout cannot be combined with JSON.");
10906
+ usage13("Binary stdout cannot be combined with JSON.");
10638
10907
  return result;
10639
10908
  }
10640
10909
  if (["media.add", "media.replace", "media.extract"].includes(operation)) {
@@ -10644,9 +10913,9 @@ function parse(raw, maximum, output3) {
10644
10913
  if (Object.hasOwn(mediaSchemas, operation)) {
10645
10914
  const allowed = ["--json", "--limit", "--scope", "--slide", "--shape", "--select"];
10646
10915
  if ([...seen].some((option) => !allowed.includes(option)))
10647
- usage12("Option does not apply to media inspection.");
10916
+ usage13("Option does not apply to media inspection.");
10648
10917
  if (positionals.length !== 1 || !positionals[0])
10649
- usage12("Media inspection requires exactly one input.");
10918
+ usage13("Media inspection requires exactly one input.");
10650
10919
  if (result.scope !== void 0 && ![
10651
10920
  "slides",
10652
10921
  "layouts",
@@ -10656,11 +10925,11 @@ function parse(raw, maximum, output3) {
10656
10925
  "handout-master",
10657
10926
  "shared"
10658
10927
  ].includes(result.scope))
10659
- usage12("Unsupported media scope.");
10928
+ usage13("Unsupported media scope.");
10660
10929
  if (result.token && ["--slide", "--shape", "--scope"].some((option) => seen.has(option)))
10661
- usage12("Opaque and simple selectors cannot be combined.");
10930
+ usage13("Opaque and simple selectors cannot be combined.");
10662
10931
  if (result.shape !== void 0 && result.slide === void 0)
10663
- usage12("Shape selection requires an owning slide.");
10932
+ usage13("Shape selection requires an owning slide.");
10664
10933
  result.input = positionals[0];
10665
10934
  return result;
10666
10935
  }
@@ -10709,47 +10978,47 @@ function parse(raw, maximum, output3) {
10709
10978
  (key) => "--" + [...key].map((c) => c >= "A" && c <= "Z" ? "-" + c.toLowerCase() : c).join("")
10710
10979
  );
10711
10980
  if ([...seen].some((flag) => !allowed.includes(flag)))
10712
- usage12("Option does not apply to chart mutation.");
10981
+ usage13("Option does not apply to chart mutation.");
10713
10982
  if (positionals.length !== 1 || !positionals[0])
10714
- usage12("Chart mutation requires exactly one input.");
10983
+ usage13("Chart mutation requires exactly one input.");
10715
10984
  result.input = positionals[0];
10716
10985
  if (result.scope !== void 0 && result.scope !== "slides")
10717
- usage12("Chart mutation supports slides scope.");
10986
+ usage13("Chart mutation supports slides scope.");
10718
10987
  if (result.token && ["--slide", "--shape", "--scope", "--all"].some((flag) => seen.has(flag)))
10719
- usage12("Opaque and simple selectors cannot be combined.");
10988
+ usage13("Opaque and simple selectors cannot be combined.");
10720
10989
  const edit = result.chartEdit ?? {};
10721
10990
  const { type, ...update } = edit;
10722
10991
  validateChartUpdate(update);
10723
10992
  if (operation === "charts.add") {
10724
10993
  if (!result.slide || result.token || result.shape || result.all || result.allowEmpty)
10725
- usage12("Chart addition requires one slide.");
10994
+ usage13("Chart addition requires one slide.");
10726
10995
  if (!type || !chartTypes2.includes(type) || !edit.data || result.placeholder === void 0 && [edit.left, edit.top, edit.width, edit.height].some((value) => value === void 0))
10727
- usage12("Chart addition requires type, data and geometry.");
10996
+ usage13("Chart addition requires type, data and geometry.");
10728
10997
  validateChartData(edit.data, type);
10729
- } else if (!Object.keys(edit).length) usage12("Chart mutation requires an update.");
10998
+ } else if (!Object.keys(edit).length) usage13("Chart mutation requires an update.");
10730
10999
  if (operation === "charts.replace" && (!edit.data || !["synchronize-simple", "reject-complex"].includes(result.chartWorkbookPolicy)))
10731
- usage12("Chart replacement requires data and an explicit workbook policy.");
10732
- if (result.inPlace && result.input === "-") usage12("Stdin cannot be edited in place.");
10733
- if (result.output && result.inPlace) usage12("Output and in-place are mutually exclusive.");
11000
+ usage13("Chart replacement requires data and an explicit workbook policy.");
11001
+ if (result.inPlace && result.input === "-") usage13("Stdin cannot be edited in place.");
11002
+ if (result.output && result.inPlace) usage13("Output and in-place are mutually exclusive.");
10734
11003
  if (!result.dryRun && !result.inPlace && !result.output)
10735
- usage12("Mutation requires a destination.");
10736
- if (result.force && !result.output) usage12("Force requires an explicit output destination.");
11004
+ usage13("Mutation requires a destination.");
11005
+ if (result.force && !result.output) usage13("Force requires an explicit output destination.");
10737
11006
  if (result.output === result.input && result.output !== "-")
10738
- usage12("Replacing input requires --in-place.");
11007
+ usage13("Replacing input requires --in-place.");
10739
11008
  if (result.output === "-" && result.json && !result.dryRun)
10740
- usage12("Binary stdout cannot be combined with JSON.");
11009
+ usage13("Binary stdout cannot be combined with JSON.");
10741
11010
  return result;
10742
11011
  }
10743
11012
  if (operation === "charts.list" || operation === "charts.get") {
10744
11013
  const allowed = ["--json", "--limit", "--scope", "--slide", "--shape", "--select"];
10745
11014
  if ([...seen].some((option) => !allowed.includes(option)))
10746
- usage12("Option does not apply to chart inspection.");
11015
+ usage13("Option does not apply to chart inspection.");
10747
11016
  if (positionals.length !== 1 || !positionals[0])
10748
- usage12("Chart inspection requires exactly one input.");
11017
+ usage13("Chart inspection requires exactly one input.");
10749
11018
  if (result.scope !== void 0 && result.scope !== "slides")
10750
- usage12("Chart inspection supports slides scope.");
11019
+ usage13("Chart inspection supports slides scope.");
10751
11020
  if (result.token && ["--slide", "--shape", "--scope"].some((option) => seen.has(option)))
10752
- usage12("Opaque and simple selectors cannot be combined.");
11021
+ usage13("Opaque and simple selectors cannot be combined.");
10753
11022
  result.input = positionals[0];
10754
11023
  return result;
10755
11024
  }
@@ -10766,33 +11035,33 @@ function parse(raw, maximum, output3) {
10766
11035
  ...extracting ? ["--sha256", "--output-dir", "--allow-partial-output", "--force", "--dry-run"] : []
10767
11036
  ];
10768
11037
  if (extracting) {
10769
- if (!result.outputDir && !result.dryRun) usage12("Image extraction requires --output-dir.");
10770
- if (result.outputDir === "-") usage12("Output directories cannot be stdout.");
10771
- if (result.force && !result.outputDir) usage12("Force requires an output directory.");
11038
+ if (!result.outputDir && !result.dryRun) usage13("Image extraction requires --output-dir.");
11039
+ if (result.outputDir === "-") usage13("Output directories cannot be stdout.");
11040
+ if (result.force && !result.outputDir) usage13("Force requires an output directory.");
10772
11041
  }
10773
11042
  if ([...seen].some((option) => !allowed.includes(option)))
10774
- usage12("Option does not apply to images list.");
11043
+ usage13("Option does not apply to images list.");
10775
11044
  if (positionals.length !== 1 || !positionals[0])
10776
- usage12("Image inventory requires exactly one input.");
10777
- if (result.scope === "presentation") usage12("Presentation scope has no image owners.");
11045
+ usage13("Image inventory requires exactly one input.");
11046
+ if (result.scope === "presentation") usage13("Presentation scope has no image owners.");
10778
11047
  if (result.token && ["--slide", "--image", "--scope"].some((option) => seen.has(option)))
10779
- usage12("Opaque and simple selectors cannot be combined.");
11048
+ usage13("Opaque and simple selectors cannot be combined.");
10780
11049
  result.input = positionals[0];
10781
11050
  return result;
10782
11051
  }
10783
11052
  if (operation === "batch") {
10784
11053
  const allowed = ["--json", "--limit", "--ops-json", "--ops-file", "--output", "--in-place", "--force", "--dry-run"];
10785
- if ([...seen].some((flag) => !allowed.includes(flag))) usage12("Option does not apply to batch.");
10786
- if (positionals.length !== 1 || !positionals[0]) usage12("Batch requires one input.");
10787
- if (result.animationBatch !== void 0 === (result.opsFile !== void 0)) usage12("Batch requires exactly one operation source.");
11054
+ if ([...seen].some((flag) => !allowed.includes(flag))) usage13("Option does not apply to batch.");
11055
+ if (positionals.length !== 1 || !positionals[0]) usage13("Batch requires one input.");
11056
+ if (result.animationBatch !== void 0 === (result.opsFile !== void 0)) usage13("Batch requires exactly one operation source.");
10788
11057
  result.input = positionals[0];
10789
- if (result.input === "-" && result.opsFile === "-") usage12("Document and batch cannot both use stdin.");
10790
- if (result.inPlace && result.input === "-") usage12("Stdin cannot be edited in place.");
10791
- if (result.inPlace && result.output) usage12("Output and in-place cannot be combined.");
10792
- if (result.animationBatch?.length && !result.dryRun && !result.inPlace && !result.output) usage12("Mutation requires a destination.");
10793
- if (result.force && !result.output) usage12("Force requires an explicit output destination.");
10794
- if (result.output === result.input && result.output !== "-") usage12("Replacing input requires --in-place.");
10795
- if (result.output === "-" && result.json && !result.dryRun) usage12("Binary stdout cannot be combined with JSON.");
11058
+ if (result.input === "-" && result.opsFile === "-") usage13("Document and batch cannot both use stdin.");
11059
+ if (result.inPlace && result.input === "-") usage13("Stdin cannot be edited in place.");
11060
+ if (result.inPlace && result.output) usage13("Output and in-place cannot be combined.");
11061
+ if (result.animationBatch?.length && !result.dryRun && !result.inPlace && !result.output) usage13("Mutation requires a destination.");
11062
+ if (result.force && !result.output) usage13("Force requires an explicit output destination.");
11063
+ if (result.output === result.input && result.output !== "-") usage13("Replacing input requires --in-place.");
11064
+ if (result.output === "-" && result.json && !result.dryRun) usage13("Binary stdout cannot be combined with JSON.");
10796
11065
  return result;
10797
11066
  }
10798
11067
  if (Object.hasOwn(animationSchemas, operation)) {
@@ -10808,21 +11077,21 @@ function parse(raw, maximum, output3) {
10808
11077
  ...mutation2 ? ["--all", "--allow-empty", "--output", "--in-place", "--force", "--dry-run"] : [],
10809
11078
  ...editing ? ["--kind", "--trigger", "--duration", "--delay", "--target"] : []
10810
11079
  ];
10811
- if ([...seen].some((flag) => !allowed.includes(flag))) usage12("Option does not apply to animations.");
10812
- if (positionals.length !== 1 || !positionals[0]) usage12("Animations require one input.");
11080
+ if ([...seen].some((flag) => !allowed.includes(flag))) usage13("Option does not apply to animations.");
11081
+ if (positionals.length !== 1 || !positionals[0]) usage13("Animations require one input.");
10813
11082
  result.input = positionals[0];
10814
- if (result.scope !== void 0 && result.scope !== "slides") usage12("Animations require slides scope.");
10815
- if (result.token && ["--scope", "--slide", "--shape"].some((flag) => seen.has(flag))) usage12("Opaque and simple selectors cannot be combined.");
10816
- if (result.shape !== void 0 && result.slide === void 0) usage12("Shape selection requires a slide.");
11083
+ if (result.scope !== void 0 && result.scope !== "slides") usage13("Animations require slides scope.");
11084
+ if (result.token && ["--scope", "--slide", "--shape"].some((flag) => seen.has(flag))) usage13("Opaque and simple selectors cannot be combined.");
11085
+ if (result.shape !== void 0 && result.slide === void 0) usage13("Shape selection requires a slide.");
10817
11086
  if (mutation2) {
10818
11087
  validateAnimationOptions2(operation.slice(11), result.animationEdit ?? {});
10819
- if (operation !== "animations.add" && !result.token && result.slide === void 0 && !result.all) usage12("Animation mutation requires a selector or --all.");
10820
- if (result.inPlace && result.input === "-") usage12("Stdin cannot be edited in place.");
10821
- if (result.inPlace && result.output) usage12("Output and in-place cannot be combined.");
10822
- if (!result.dryRun && !result.inPlace && !result.output) usage12("Mutation requires a destination.");
10823
- if (result.force && !result.output) usage12("Force requires an explicit output destination.");
10824
- if (result.output === result.input && result.output !== "-") usage12("Replacing input requires --in-place.");
10825
- if (result.output === "-" && result.json && !result.dryRun) usage12("Binary stdout cannot be combined with JSON.");
11088
+ if (operation !== "animations.add" && !result.token && result.slide === void 0 && !result.all) usage13("Animation mutation requires a selector or --all.");
11089
+ if (result.inPlace && result.input === "-") usage13("Stdin cannot be edited in place.");
11090
+ if (result.inPlace && result.output) usage13("Output and in-place cannot be combined.");
11091
+ if (!result.dryRun && !result.inPlace && !result.output) usage13("Mutation requires a destination.");
11092
+ if (result.force && !result.output) usage13("Force requires an explicit output destination.");
11093
+ if (result.output === result.input && result.output !== "-") usage13("Replacing input requires --in-place.");
11094
+ if (result.output === "-" && result.json && !result.dryRun) usage13("Binary stdout cannot be combined with JSON.");
10826
11095
  }
10827
11096
  return result;
10828
11097
  }
@@ -10838,20 +11107,20 @@ function parse(raw, maximum, output3) {
10838
11107
  ...mutation2 ? ["--all", "--allow-empty", "--output", "--in-place", "--force", "--dry-run"] : [],
10839
11108
  ...editing ? ["--kind", "--direction", "--duration", "--advance-after", "--advance-on-click"] : []
10840
11109
  ];
10841
- if ([...seen].some((flag) => !allowed.includes(flag))) usage12("Option does not apply to transitions.");
10842
- if (positionals.length !== 1 || !positionals[0]) usage12("Transitions require one input.");
11110
+ if ([...seen].some((flag) => !allowed.includes(flag))) usage13("Option does not apply to transitions.");
11111
+ if (positionals.length !== 1 || !positionals[0]) usage13("Transitions require one input.");
10843
11112
  result.input = positionals[0];
10844
- if (result.scope !== void 0 && result.scope !== "slides") usage12("Transitions require slides scope.");
10845
- if (result.token && ["--scope", "--slide"].some((flag) => seen.has(flag))) usage12("Opaque and simple selectors cannot be combined.");
11113
+ if (result.scope !== void 0 && result.scope !== "slides") usage13("Transitions require slides scope.");
11114
+ if (result.token && ["--scope", "--slide"].some((flag) => seen.has(flag))) usage13("Opaque and simple selectors cannot be combined.");
10846
11115
  if (mutation2) {
10847
11116
  validateTransitionOptions(operation.slice(12), { ...result.transitionEdit, selection: {} });
10848
- if (!result.token && result.slide === void 0 && !result.all) usage12("Transition mutation requires a selector or --all.");
10849
- if (result.inPlace && result.input === "-") usage12("Stdin cannot be edited in place.");
10850
- if (result.inPlace && result.output) usage12("Output and in-place cannot be combined.");
10851
- if (!result.dryRun && !result.inPlace && !result.output) usage12("Mutation requires a destination.");
10852
- if (result.force && !result.output) usage12("Force requires an explicit output destination.");
10853
- if (result.output === result.input && result.output !== "-") usage12("Replacing input requires --in-place.");
10854
- if (result.output === "-" && result.json && !result.dryRun) usage12("Binary stdout cannot be combined with JSON.");
11117
+ if (!result.token && result.slide === void 0 && !result.all) usage13("Transition mutation requires a selector or --all.");
11118
+ if (result.inPlace && result.input === "-") usage13("Stdin cannot be edited in place.");
11119
+ if (result.inPlace && result.output) usage13("Output and in-place cannot be combined.");
11120
+ if (!result.dryRun && !result.inPlace && !result.output) usage13("Mutation requires a destination.");
11121
+ if (result.force && !result.output) usage13("Force requires an explicit output destination.");
11122
+ if (result.output === result.input && result.output !== "-") usage13("Replacing input requires --in-place.");
11123
+ if (result.output === "-" && result.json && !result.dryRun) usage13("Binary stdout cannot be combined with JSON.");
10855
11124
  }
10856
11125
  return result;
10857
11126
  }
@@ -10892,18 +11161,18 @@ function parse(raw, maximum, output3) {
10892
11161
  if (formatting && [...seen].some(
10893
11162
  (flag) => ["--style-json", "--find", "--with", "--first", "--occurrence"].includes(flag)
10894
11163
  ))
10895
- usage12("Match options do not apply to runs.");
11164
+ usage13("Match options do not apply to runs.");
10896
11165
  if ([...seen].some((flag) => !allowed.includes(flag)))
10897
- usage12("Option does not apply to this text operation.");
10898
- if (positionals.length !== 1 || !positionals[0]) usage12("Text operation requires one input.");
11166
+ usage13("Option does not apply to this text operation.");
11167
+ if (positionals.length !== 1 || !positionals[0]) usage13("Text operation requires one input.");
10899
11168
  if (result.scope === "presentation" || result.scope === "shared")
10900
- usage12("Text operation requires a text-bearing scope.");
11169
+ usage13("Text operation requires a text-bearing scope.");
10901
11170
  if (result.token && ["--scope", "--slide", "--shape", "--paragraph", "--run"].some((flag) => seen.has(flag)))
10902
- usage12("Opaque and simple selectors cannot be combined.");
11171
+ usage13("Opaque and simple selectors cannot be combined.");
10903
11172
  if (result.slide !== void 0 && (result.scope === "notes-master" || result.scope === "handout-master"))
10904
- usage12("Deck-level text master scopes do not accept slide selection.");
11173
+ usage13("Deck-level text master scopes do not accept slide selection.");
10905
11174
  if (result.shape && result.slide === void 0)
10906
- usage12("Shape selection requires an owning slide.");
11175
+ usage13("Shape selection requires an owning slide.");
10907
11176
  result.input = positionals[0];
10908
11177
  if (mutation2) {
10909
11178
  if (fields2)
@@ -10912,7 +11181,7 @@ function parse(raw, maximum, output3) {
10912
11181
  operation.slice(7)
10913
11182
  );
10914
11183
  if (fitting) {
10915
- if (!result.fitEdit?.metrics) usage12("Text fit requires --metrics JSON.");
11184
+ if (!result.fitEdit?.metrics) usage13("Text fit requires --metrics JSON.");
10916
11185
  validateTextFitOptions(result.fitEdit);
10917
11186
  }
10918
11187
  if (frames)
@@ -10926,20 +11195,20 @@ function parse(raw, maximum, output3) {
10926
11195
  if (formatting && !result.all && result.token === void 0 && result.slide === void 0 && result.shape === void 0 && result.paragraphEdit?.paragraph === void 0 && result.runEdit?.paragraph === void 0 && result.runEdit?.run === void 0)
10927
11196
  throw new SelectionError8("missing-selection");
10928
11197
  if (!formatting && (result.find === void 0 || result.with === void 0))
10929
- usage12("Text replace requires find and with.");
11198
+ usage13("Text replace requires find and with.");
10930
11199
  if (!formatting && [result.first === true, result.all === true, result.occurrence !== void 0].filter(
10931
11200
  Boolean
10932
11201
  ).length !== 1)
10933
- usage12("Text replace requires exactly one of first, all or occurrence.");
10934
- if (result.inPlace && result.input === "-") usage12("Stdin cannot be edited in place.");
10935
- if (result.inPlace && result.output) usage12("Output and in-place cannot be combined.");
11202
+ usage13("Text replace requires exactly one of first, all or occurrence.");
11203
+ if (result.inPlace && result.input === "-") usage13("Stdin cannot be edited in place.");
11204
+ if (result.inPlace && result.output) usage13("Output and in-place cannot be combined.");
10936
11205
  if (!result.dryRun && !result.inPlace && !result.output)
10937
- usage12("Mutation requires a destination.");
10938
- if (result.force && !result.output) usage12("Force requires an explicit output destination.");
11206
+ usage13("Mutation requires a destination.");
11207
+ if (result.force && !result.output) usage13("Force requires an explicit output destination.");
10939
11208
  if (result.output === result.input && result.output !== "-")
10940
- usage12("Replacing input requires --in-place.");
11209
+ usage13("Replacing input requires --in-place.");
10941
11210
  if (result.output === "-" && result.json && !result.dryRun)
10942
- usage12("Binary stdout cannot be combined with JSON.");
11211
+ usage13("Binary stdout cannot be combined with JSON.");
10943
11212
  }
10944
11213
  return result;
10945
11214
  }
@@ -10959,11 +11228,11 @@ function parse(raw, maximum, output3) {
10959
11228
  (key) => "--" + [...key].map((c) => c >= "A" && c <= "Z" ? "-" + c.toLowerCase() : c).join("")
10960
11229
  );
10961
11230
  if ([...seen].some((flag) => !flags.includes(flag)))
10962
- usage12("Option does not apply to this shape operation.");
10963
- if (positionals.length !== 1 || !positionals[0]) usage12("Shape operations require one input.");
11231
+ usage13("Option does not apply to this shape operation.");
11232
+ if (positionals.length !== 1 || !positionals[0]) usage13("Shape operations require one input.");
10964
11233
  result.input = positionals[0];
10965
11234
  if (result.token && (result.slide !== void 0 || result.part || result.shape || result.all))
10966
- usage12("Opaque and simple selectors cannot be combined.");
11235
+ usage13("Opaque and simple selectors cannot be combined.");
10967
11236
  if (operation.startsWith("tables."))
10968
11237
  validateTableSelection(
10969
11238
  {
@@ -10981,28 +11250,28 @@ function parse(raw, maximum, output3) {
10981
11250
  if (operation.startsWith("tables.")) {
10982
11251
  if (operation === "tables.merge") {
10983
11252
  if (!result.tableFrom || !result.tableTo)
10984
- usage12("Merge requires from and to coordinates.");
11253
+ usage13("Merge requires from and to coordinates.");
10985
11254
  result.tableStructure = {
10986
11255
  kind: "merge",
10987
11256
  from: tableCell(result.tableFrom),
10988
11257
  to: tableCell(result.tableTo)
10989
11258
  };
10990
11259
  } else if (operation === "tables.split") {
10991
- if (!result.cell) usage12("Split requires one merge origin cell.");
11260
+ if (!result.cell) usage13("Split requires one merge origin cell.");
10992
11261
  result.tableStructure = { kind: "split", cell: tableCell(result.cell) };
10993
11262
  } else if (operation.startsWith("tables.rows.") || operation.startsWith("tables.columns.")) {
10994
11263
  const adding = operation.endsWith(".add");
10995
11264
  if (!result.tablePosition || !(adding ? ["expand", "reject"] : ["shrink", "reject"]).includes(
10996
11265
  result.tableSpanPolicy
10997
11266
  ))
10998
- usage12("A position and explicit span policy are required.");
11267
+ usage13("A position and explicit span policy are required.");
10999
11268
  result.tableStructure = {
11000
11269
  kind: operation.slice(7).split(".").join("-"),
11001
11270
  position: result.tablePosition - 1,
11002
11271
  spanPolicy: result.tableSpanPolicy
11003
11272
  };
11004
11273
  } else {
11005
- if (!result.tableEdit) usage12("A table edit is required.");
11274
+ if (!result.tableEdit) usage13("A table edit is required.");
11006
11275
  validateTableUpdate(
11007
11276
  {
11008
11277
  ...result.tableEdit,
@@ -11013,14 +11282,14 @@ function parse(raw, maximum, output3) {
11013
11282
  }
11014
11283
  } else if (operation === "shapes.remove") {
11015
11284
  if (result.connectorEdit?.detachPolicy !== void 0 && !["detach", "remove"].includes(result.connectorEdit.detachPolicy))
11016
- usage12("Invalid detach policy.");
11285
+ usage13("Invalid detach policy.");
11017
11286
  } else if (connector) {
11018
11287
  if (operation !== "connectors.remove")
11019
11288
  validateConnectorOptions(result.connectorEdit ?? {}, operation === "connectors.add");
11020
11289
  } else if (operation === "shapes.effects.set" || operation === "shapes.drawing.set") {
11021
11290
  if (operation === "shapes.effects.set") {
11022
11291
  if (result.shadowEnabled === void 0 || result.shadowOpacity === void 0 || result.shadowBlur === void 0 || result.shadowColor === void 0)
11023
- usage12("Shadow requires explicit shadow, opacity, blur and color.");
11292
+ usage13("Shadow requires explicit shadow, opacity, blur and color.");
11024
11293
  result.drawingEdit = {
11025
11294
  shadow: result.shadowEnabled ? {
11026
11295
  blur: result.shadowBlur,
@@ -11031,7 +11300,7 @@ function parse(raw, maximum, output3) {
11031
11300
  }
11032
11301
  if (result.drawingFill) {
11033
11302
  if (result.drawingEdit?.fill !== void 0)
11034
- usage12("Structured fill and simple fill flags cannot be mixed.");
11303
+ usage13("Structured fill and simple fill flags cannot be mixed.");
11035
11304
  result.drawingEdit = {
11036
11305
  ...result.drawingEdit,
11037
11306
  fill: result.drawingFill
@@ -11039,9 +11308,9 @@ function parse(raw, maximum, output3) {
11039
11308
  }
11040
11309
  if (result.file !== void 0) {
11041
11310
  if (result.input === "-" && result.file === "-")
11042
- usage12("Document and image cannot both use stdin.");
11311
+ usage13("Document and image cannot both use stdin.");
11043
11312
  if (result.drawingEdit?.fill?.kind !== "picture" || result.drawingEdit.fill.relationshipId !== void 0)
11044
- usage12("File requires picture fill without a relationship ID.");
11313
+ usage13("File requires picture fill without a relationship ID.");
11045
11314
  }
11046
11315
  validateDrawingUpdate(
11047
11316
  result.file !== void 0 && result.drawingEdit?.fill?.kind === "picture" ? {
@@ -11051,7 +11320,7 @@ function parse(raw, maximum, output3) {
11051
11320
  );
11052
11321
  } else if (selectionMutation) {
11053
11322
  if (result.shapes && (result.slide !== void 0 || result.part || result.shape || result.token || result.all || result.allowEmpty))
11054
- usage12("Location arrays and simple or opaque selectors cannot be combined.");
11323
+ usage13("Location arrays and simple or opaque selectors cannot be combined.");
11055
11324
  result.selectionEdit = {
11056
11325
  ...result.selectionEdit,
11057
11326
  action: operation.slice(7),
@@ -11066,9 +11335,9 @@ function parse(raw, maximum, output3) {
11066
11335
  };
11067
11336
  validateShapeSelectionOptions(result.selectionEdit);
11068
11337
  } else if (grouping) {
11069
- if (result.tolerance === void 0) usage12("Grouping requires explicit tolerance.");
11338
+ if (result.tolerance === void 0) usage13("Grouping requires explicit tolerance.");
11070
11339
  if (operation === "shapes.group" && result.shapes === void 0)
11071
- usage12("Grouping requires shape locations.");
11340
+ usage13("Grouping requires shape locations.");
11072
11341
  validateGroupOptions(
11073
11342
  {
11074
11343
  tolerance: result.tolerance,
@@ -11085,30 +11354,30 @@ function parse(raw, maximum, output3) {
11085
11354
  );
11086
11355
  } else if (operation.startsWith("shapes.paths.")) {
11087
11356
  if (result.path !== void 0 && (result.vertices !== void 0 || result.close !== void 0))
11088
- usage12("Path and vertices/close cannot be combined.");
11357
+ usage13("Path and vertices/close cannot be combined.");
11089
11358
  if (result.vertices !== void 0) {
11090
- if (result.close === void 0) usage12("Vertices require explicit --close true|false.");
11359
+ if (result.close === void 0) usage13("Vertices require explicit --close true|false.");
11091
11360
  if (!Array.isArray(result.vertices) || result.vertices.some((vertex) => Array.isArray(vertex)))
11092
- usage12("Vertices require objects with x and y coordinates.");
11361
+ usage13("Vertices require objects with x and y coordinates.");
11093
11362
  result.path = pathFromVertices(result.vertices, result.close);
11094
11363
  }
11095
- if (result.path === void 0) usage12("Path mutation requires --path or --vertices.");
11364
+ if (result.path === void 0) usage13("Path mutation requires --path or --vertices.");
11096
11365
  validateShapePath(result.path);
11097
11366
  if (operation.endsWith(".add"))
11098
11367
  validateShapeOptions({ ...result.shapeEdit, kind: "text-box" }, true);
11099
11368
  } else {
11100
- if (!result.shapeEdit) usage12("Shape mutation requires update fields.");
11369
+ if (!result.shapeEdit) usage13("Shape mutation requires update fields.");
11101
11370
  validateShapeOptions(result.shapeEdit, operation === "shapes.add");
11102
11371
  }
11103
- if (result.inPlace && result.input === "-") usage12("Stdin cannot be edited in place.");
11104
- if (result.inPlace && result.output) usage12("Output and in-place cannot be combined.");
11372
+ if (result.inPlace && result.input === "-") usage13("Stdin cannot be edited in place.");
11373
+ if (result.inPlace && result.output) usage13("Output and in-place cannot be combined.");
11105
11374
  if (!result.dryRun && !result.inPlace && !result.output)
11106
- usage12("Mutation requires a destination.");
11107
- if (result.force && !result.output) usage12("Force requires an explicit output destination.");
11375
+ usage13("Mutation requires a destination.");
11376
+ if (result.force && !result.output) usage13("Force requires an explicit output destination.");
11108
11377
  if (result.output === result.input && result.output !== "-")
11109
- usage12("Replacing input requires --in-place.");
11378
+ usage13("Replacing input requires --in-place.");
11110
11379
  if (result.output === "-" && result.json && !result.dryRun)
11111
- usage12("Binary stdout cannot be combined with JSON.");
11380
+ usage13("Binary stdout cannot be combined with JSON.");
11112
11381
  }
11113
11382
  return result;
11114
11383
  }
@@ -11123,53 +11392,53 @@ function parse(raw, maximum, output3) {
11123
11392
  (key) => key === "placeholders" ? "--placeholders-json" : "--" + [...key].map((char) => char >= "A" && char <= "Z" ? "-" + char.toLowerCase() : char).join("")
11124
11393
  );
11125
11394
  if ([...seen].some((flag) => !flags.includes(flag)))
11126
- usage12("Option does not apply to this shared-content operation.");
11395
+ usage13("Option does not apply to this shared-content operation.");
11127
11396
  if (positionals.length !== 1 || !positionals[0])
11128
- usage12("Shared-content operations require one input.");
11397
+ usage13("Shared-content operations require one input.");
11129
11398
  result.input = positionals[0];
11130
11399
  if (mutation2 && !applying && !background && result.scope === void 0)
11131
- usage12("Shared-content mutation requires explicit scope.");
11400
+ usage13("Shared-content mutation requires explicit scope.");
11132
11401
  if (result.scope !== void 0 && !(theme ? ["shared"] : background ? ["slides", "layouts", "masters", "shared"] : applying ? ["slides"] : layout ? ["layouts", "shared"] : ["masters", "shared"]).includes(result.scope))
11133
- usage12("Scope does not match this shared-content operation.");
11402
+ usage13("Scope does not match this shared-content operation.");
11134
11403
  if (applying && result.token && result.scope !== void 0)
11135
- usage12("Opaque selectors cannot be combined with scope.");
11404
+ usage13("Opaque selectors cannot be combined with scope.");
11136
11405
  if (result.token && (result.part || result.slide !== void 0 || result.shape || result.all))
11137
- usage12("Opaque and simple selectors cannot be combined.");
11406
+ usage13("Opaque and simple selectors cannot be combined.");
11138
11407
  if (result.part && result.slide !== void 0)
11139
- usage12("Part and slide selectors cannot be combined.");
11408
+ usage13("Part and slide selectors cannot be combined.");
11140
11409
  const edit = result.masterEdit;
11141
- if (operation === "masters.add" && !edit?.name) usage12("Master creation requires a name.");
11410
+ if (operation === "masters.add" && !edit?.name) usage13("Master creation requires a name.");
11142
11411
  if (operation === "masters.set" && edit?.name === void 0 && edit?.text === void 0)
11143
- usage12("Master set requires name or text.");
11412
+ usage13("Master set requires name or text.");
11144
11413
  if (operation === "masters.set" && edit?.text !== void 0 && !result.shape && !result.token)
11145
- usage12("Master text edits require a selected text shape.");
11414
+ usage13("Master text edits require a selected text shape.");
11146
11415
  if (operation === "layouts.add" && (!edit?.name || !edit.master))
11147
- usage12("Layout creation requires name and master.");
11416
+ usage13("Layout creation requires name and master.");
11148
11417
  if (operation === "layouts.set" && !edit && !result.layoutEdit)
11149
- usage12("Layout set requires update fields.");
11418
+ usage13("Layout set requires update fields.");
11150
11419
  if (operation === "layouts.set" && edit?.text !== void 0 && !result.shape && !result.token)
11151
- usage12("Layout text requires a selected shape.");
11420
+ usage13("Layout text requires a selected shape.");
11152
11421
  if (layout && mutation2 && operation !== "layouts.add" && !result.part && !result.token && result.slide === void 0 && !result.all)
11153
- usage12("Layout mutation requires an explicit selector.");
11422
+ usage13("Layout mutation requires an explicit selector.");
11154
11423
  if (applying && (!result.layoutEdit?.layout || !["type-index", "reject-unmatched"].includes(result.layoutEdit.placeholderPolicy)))
11155
- usage12("Layout application requires layout and placeholder policy.");
11424
+ usage13("Layout application requires layout and placeholder policy.");
11156
11425
  if (operation === "shapes.add" && (edit?.kind !== "text-box" || [edit.x, edit.y, edit.width, edit.height].some((value) => value === void 0)))
11157
- usage12("Master shape creation requires text-box kind and explicit geometry.");
11426
+ usage13("Master shape creation requires text-box kind and explicit geometry.");
11158
11427
  if (operation === "shapes.set" && (!edit || !result.shape && !result.token))
11159
- usage12("Shape edits require update fields and a selected shape.");
11428
+ usage13("Shape edits require update fields and a selected shape.");
11160
11429
  if (operation === "themes.set" && (!result.themeEdit || result.themeEdit.colorSlot === void 0 !== (result.themeEdit.color === void 0) || result.themeEdit.fontSlot === void 0 !== (result.themeEdit.font === void 0)))
11161
- usage12("Theme set requires paired palette or font values, or a name.");
11430
+ usage13("Theme set requires paired palette or font values, or a name.");
11162
11431
  if (result.themeEdit?.colorSlot !== void 0 && !themeColorSlots.includes(result.themeEdit.colorSlot))
11163
- usage12("Unknown theme color slot.");
11432
+ usage13("Unknown theme color slot.");
11164
11433
  if (result.themeEdit?.fontSlot !== void 0 && !themeFontSlots.includes(result.themeEdit.fontSlot))
11165
- usage12("Unknown theme font slot.");
11434
+ usage13("Unknown theme font slot.");
11166
11435
  if (background && result.scope === "shared" && !result.part && !result.token)
11167
- usage12("Shared background scope requires an exact part or selector.");
11436
+ usage13("Shared background scope requires an exact part or selector.");
11168
11437
  if (operation === "backgrounds.set") {
11169
11438
  if (!result.part && !result.token && result.slide === void 0 && !result.all)
11170
- usage12("Background mutation requires a selector or all.");
11439
+ usage13("Background mutation requires a selector or all.");
11171
11440
  if (result.file === "-" && result.input === "-")
11172
- usage12("Presentation and image cannot both read stdin.");
11441
+ usage13("Presentation and image cannot both read stdin.");
11173
11442
  const edit2 = result.backgroundEdit;
11174
11443
  const required = {
11175
11444
  solid: ["color"],
@@ -11178,24 +11447,24 @@ function parse(raw, maximum, output3) {
11178
11447
  inherit: [],
11179
11448
  "style-reference": ["styleIndex", "styleColor"]
11180
11449
  };
11181
- if (!edit2?.kind || !Object.hasOwn(required, edit2.kind)) usage12("Background kind is required.");
11450
+ if (!edit2?.kind || !Object.hasOwn(required, edit2.kind)) usage13("Background kind is required.");
11182
11451
  const fields2 = { ...edit2, ...result.file === void 0 ? {} : { file: result.file } };
11183
11452
  const keys = required[edit2.kind];
11184
11453
  if (keys.some((key) => !Object.hasOwn(fields2, key)) || Object.keys(fields2).some(
11185
11454
  (key) => key !== "kind" && !keys.includes(key) && !(edit2.kind === "gradient" && key === "angle")
11186
11455
  ))
11187
- usage12("Background payload does not match its kind.");
11456
+ usage13("Background payload does not match its kind.");
11188
11457
  }
11189
11458
  if (mutation2) {
11190
- if (result.inPlace && result.input === "-") usage12("Stdin cannot be edited in place.");
11191
- if (result.inPlace && result.output) usage12("Output and in-place cannot be combined.");
11459
+ if (result.inPlace && result.input === "-") usage13("Stdin cannot be edited in place.");
11460
+ if (result.inPlace && result.output) usage13("Output and in-place cannot be combined.");
11192
11461
  if (!result.dryRun && !result.inPlace && !result.output)
11193
- usage12("Mutation requires a destination.");
11194
- if (result.force && !result.output) usage12("Force requires an explicit output destination.");
11462
+ usage13("Mutation requires a destination.");
11463
+ if (result.force && !result.output) usage13("Force requires an explicit output destination.");
11195
11464
  if (result.output === result.input && result.output !== "-")
11196
- usage12("Replacing input requires --in-place.");
11465
+ usage13("Replacing input requires --in-place.");
11197
11466
  if (result.output === "-" && result.json && !result.dryRun)
11198
- usage12("Binary stdout cannot be combined with JSON.");
11467
+ usage13("Binary stdout cannot be combined with JSON.");
11199
11468
  }
11200
11469
  return result;
11201
11470
  }
@@ -11222,20 +11491,20 @@ function parse(raw, maximum, output3) {
11222
11491
  ] : []
11223
11492
  ];
11224
11493
  if ([...seen].some((flag) => !allowed.includes(flag)))
11225
- usage12("Option does not apply to this settings operation.");
11226
- if (positionals.length !== 1 || !positionals[0]) usage12("Settings require one input.");
11494
+ usage13("Option does not apply to this settings operation.");
11495
+ if (positionals.length !== 1 || !positionals[0]) usage13("Settings require one input.");
11227
11496
  result.input = positionals[0];
11228
11497
  if (mutation2) {
11229
- if (!result.settings) usage12("Settings set requires update fields.");
11230
- if (result.inPlace && result.input === "-") usage12("Stdin cannot be edited in place.");
11231
- if (result.inPlace && result.output) usage12("Output and in-place cannot be combined.");
11498
+ if (!result.settings) usage13("Settings set requires update fields.");
11499
+ if (result.inPlace && result.input === "-") usage13("Stdin cannot be edited in place.");
11500
+ if (result.inPlace && result.output) usage13("Output and in-place cannot be combined.");
11232
11501
  if (!result.dryRun && !result.inPlace && !result.output)
11233
- usage12("Mutation requires a destination.");
11234
- if (result.force && !result.output) usage12("Force requires an explicit output destination.");
11502
+ usage13("Mutation requires a destination.");
11503
+ if (result.force && !result.output) usage13("Force requires an explicit output destination.");
11235
11504
  if (result.output === result.input && result.output !== "-")
11236
- usage12("Replacing input requires --in-place.");
11505
+ usage13("Replacing input requires --in-place.");
11237
11506
  if (result.output === "-" && result.json && !result.dryRun)
11238
- usage12("Binary stdout cannot be combined with JSON.");
11507
+ usage13("Binary stdout cannot be combined with JSON.");
11239
11508
  }
11240
11509
  return result;
11241
11510
  }
@@ -11252,32 +11521,32 @@ function parse(raw, maximum, output3) {
11252
11521
  ...["add", "set"].includes(action) ? ["--name", "--slides", "--position"] : []
11253
11522
  ];
11254
11523
  if ([...seen].some((flag) => !allowed.includes(flag)))
11255
- usage12("Option does not apply to this membership operation.");
11524
+ usage13("Option does not apply to this membership operation.");
11256
11525
  if (positionals.length !== 1 || !positionals[0])
11257
- usage12("Membership operations require one input.");
11526
+ usage13("Membership operations require one input.");
11258
11527
  result.input = positionals[0];
11259
11528
  if (result.scope !== void 0 && result.scope !== "presentation")
11260
- usage12("Membership operations require presentation scope.");
11529
+ usage13("Membership operations require presentation scope.");
11261
11530
  if (result.token && ["--slide", "--scope", "--all"].some((flag) => seen.has(flag)))
11262
- usage12("Opaque and simple selectors cannot be combined.");
11531
+ usage13("Opaque and simple selectors cannot be combined.");
11263
11532
  if (action === "add" && (result.membership?.name === void 0 || !result.membership.slides))
11264
- usage12("Membership creation requires name and slides.");
11265
- if (action === "set" && !result.membership) usage12("Membership set requires update fields.");
11533
+ usage13("Membership creation requires name and slides.");
11534
+ if (action === "set" && !result.membership) usage13("Membership set requires update fields.");
11266
11535
  if (mutation2) {
11267
- if (result.inPlace && result.input === "-") usage12("Stdin cannot be edited in place.");
11268
- if (result.inPlace && result.output) usage12("Output and in-place cannot be combined.");
11536
+ if (result.inPlace && result.input === "-") usage13("Stdin cannot be edited in place.");
11537
+ if (result.inPlace && result.output) usage13("Output and in-place cannot be combined.");
11269
11538
  if (!result.dryRun && !result.inPlace && !result.output)
11270
- usage12("Mutation requires a destination.");
11271
- if (result.force && !result.output) usage12("Force requires an explicit output destination.");
11539
+ usage13("Mutation requires a destination.");
11540
+ if (result.force && !result.output) usage13("Force requires an explicit output destination.");
11272
11541
  if (result.output === result.input && result.output !== "-")
11273
- usage12("Replacing input requires --in-place.");
11542
+ usage13("Replacing input requires --in-place.");
11274
11543
  if (result.output === "-" && result.json && !result.dryRun)
11275
- usage12("Binary stdout cannot be combined with JSON.");
11544
+ usage13("Binary stdout cannot be combined with JSON.");
11276
11545
  }
11277
11546
  return result;
11278
11547
  }
11279
11548
  if (result.allowEmpty && !slideMutation)
11280
- usage12("Allow-empty requires a supported slide mutation.");
11549
+ usage13("Allow-empty requires a supported slide mutation.");
11281
11550
  if (operation === "slides.merge" || operation === "slides.split") {
11282
11551
  const allowed = [
11283
11552
  "--json",
@@ -11294,36 +11563,36 @@ function parse(raw, maximum, output3) {
11294
11563
  ] : ["--slides", "--output-dir", "--allow-partial-output"]
11295
11564
  ];
11296
11565
  if ([...seen].some((option) => !allowed.includes(option)))
11297
- usage12("Option does not apply to this assembly operation.");
11566
+ usage13("Option does not apply to this assembly operation.");
11298
11567
  if (positionals.length !== 1 || !positionals[0])
11299
- usage12("Assembly requires one destination or source input.");
11568
+ usage13("Assembly requires one destination or source input.");
11300
11569
  result.input = positionals[0];
11301
11570
  if (operation === "slides.split") {
11302
- if (!result.splitSlides) usage12("Split requires --slides.");
11303
- if (!result.outputDir && !result.dryRun) usage12("Split requires --output-dir.");
11304
- if (result.outputDir === "-") usage12("Output directories cannot be stdout.");
11305
- if (result.force && !result.outputDir) usage12("Force requires an output directory.");
11571
+ if (!result.splitSlides) usage13("Split requires --slides.");
11572
+ if (!result.outputDir && !result.dryRun) usage13("Split requires --output-dir.");
11573
+ if (result.outputDir === "-") usage13("Output directories cannot be stdout.");
11574
+ if (result.force && !result.outputDir) usage13("Force requires an output directory.");
11306
11575
  } else {
11307
11576
  if (!result.sources || !result.importing?.themePolicy)
11308
- usage12("Merge requires sources and an explicit theme policy.");
11577
+ usage13("Merge requires sources and an explicit theme policy.");
11309
11578
  if ([result.input, ...result.sources].filter((path) => path === "-").length > 1)
11310
- usage12("Only one input may consume stdin.");
11311
- if (result.inPlace && result.input === "-") usage12("Stdin cannot be edited in place.");
11312
- if (result.inPlace && result.output) usage12("Output and in-place cannot be combined.");
11579
+ usage13("Only one input may consume stdin.");
11580
+ if (result.inPlace && result.input === "-") usage13("Stdin cannot be edited in place.");
11581
+ if (result.inPlace && result.output) usage13("Output and in-place cannot be combined.");
11313
11582
  if (!result.dryRun && !result.inPlace && !result.output)
11314
- usage12("Merge requires a destination.");
11315
- if (result.force && !result.output) usage12("Force requires an explicit output destination.");
11583
+ usage13("Merge requires a destination.");
11584
+ if (result.force && !result.output) usage13("Force requires an explicit output destination.");
11316
11585
  if (result.output === result.input && result.output !== "-")
11317
- usage12("Replacing input requires --in-place.");
11586
+ usage13("Replacing input requires --in-place.");
11318
11587
  if (result.sources.includes(result.inPlace ? result.input : result.output ?? "") && (result.inPlace || result.output !== "-"))
11319
- usage12("Merge output cannot replace a source.");
11588
+ usage13("Merge output cannot replace a source.");
11320
11589
  if (result.output === "-" && result.json && !result.dryRun)
11321
- usage12("Binary stdout cannot be combined with JSON.");
11590
+ usage13("Binary stdout cannot be combined with JSON.");
11322
11591
  }
11323
11592
  return result;
11324
11593
  }
11325
11594
  if (operation === "create") {
11326
- if (positionals.length) usage12("Creation takes no input positional arguments.");
11595
+ if (positionals.length) usage13("Creation takes no input positional arguments.");
11327
11596
  const allowed = [
11328
11597
  "--width",
11329
11598
  "--height",
@@ -11341,11 +11610,11 @@ function parse(raw, maximum, output3) {
11341
11610
  "--dry-run"
11342
11611
  ];
11343
11612
  if ([...seen].some((option) => !allowed.includes(option)))
11344
- usage12("Option does not apply to creation.");
11345
- if (!result.output && !result.dryRun) usage12("Creation requires an output destination.");
11346
- if (result.force && !result.output) usage12("Force requires an explicit output destination.");
11613
+ usage13("Option does not apply to creation.");
11614
+ if (!result.output && !result.dryRun) usage13("Creation requires an output destination.");
11615
+ if (result.force && !result.output) usage13("Force requires an explicit output destination.");
11347
11616
  if (result.output === "-" && result.json && !result.dryRun)
11348
- usage12("Binary stdout cannot be combined with JSON.");
11617
+ usage13("Binary stdout cannot be combined with JSON.");
11349
11618
  return result;
11350
11619
  }
11351
11620
  if (operation === "slides.import") {
@@ -11363,14 +11632,14 @@ function parse(raw, maximum, output3) {
11363
11632
  "--dry-run"
11364
11633
  ];
11365
11634
  if ([...seen].some((option) => !allowed.includes(option)))
11366
- usage12("Option does not apply to slide import.");
11635
+ usage13("Option does not apply to slide import.");
11367
11636
  if (!result.source || !result.importing?.sourceSlides)
11368
- usage12("Import requires source and source slides.");
11369
- if (positionals[0] === "-" && result.source === "-") usage12("Only one input may consume stdin.");
11637
+ usage13("Import requires source and source slides.");
11638
+ if (positionals[0] === "-" && result.source === "-") usage13("Only one input may consume stdin.");
11370
11639
  if (result.output === result.source && result.output !== "-")
11371
- usage12("Import output cannot replace its source.");
11640
+ usage13("Import output cannot replace its source.");
11372
11641
  if (result.inPlace && positionals[0] === result.source)
11373
- usage12("Import in-place destination must differ from source.");
11642
+ usage13("Import in-place destination must differ from source.");
11374
11643
  } else if (operation === "slides.add") {
11375
11644
  const allowed = [
11376
11645
  "--layout",
@@ -11389,11 +11658,11 @@ function parse(raw, maximum, output3) {
11389
11658
  "--dry-run"
11390
11659
  ];
11391
11660
  if ([...seen].some((option) => !allowed.includes(option)))
11392
- usage12("Option does not apply to slide addition.");
11661
+ usage13("Option does not apply to slide addition.");
11393
11662
  if (positionals.length !== 1 || !positionals[0])
11394
- usage12("Slide addition requires exactly one input.");
11663
+ usage13("Slide addition requires exactly one input.");
11395
11664
  result.input = positionals[0];
11396
- if (!result.addition?.layout) usage12("Slide addition requires --layout.");
11665
+ if (!result.addition?.layout) usage13("Slide addition requires --layout.");
11397
11666
  } else if (slideMutation) {
11398
11667
  const allowed = [
11399
11668
  "--selection-json",
@@ -11413,29 +11682,29 @@ function parse(raw, maximum, output3) {
11413
11682
  ...operation === "slides.set" ? ["--name", "--hidden"] : []
11414
11683
  ];
11415
11684
  if ([...seen].some((option) => !allowed.includes(option)))
11416
- usage12("Option does not apply to this slide mutation.");
11685
+ usage13("Option does not apply to this slide mutation.");
11417
11686
  if (seen.has("--selection-json") && ["--slide", "--select", "--scope", "--all"].some((flag) => seen.has(flag)))
11418
- usage12("Structured and simple selectors cannot be combined.");
11687
+ usage13("Structured and simple selectors cannot be combined.");
11419
11688
  if (!seen.has("--selection-json") && result.slide === void 0 && !result.token && !result.all)
11420
- usage12("Slide mutation requires a selector or --all.");
11689
+ usage13("Slide mutation requires a selector or --all.");
11421
11690
  if (operation !== "slides.remove" && (!result.mutation || (operation === "slides.move" || operation === "slides.duplicate") && result.mutation.position === void 0))
11422
- usage12("Slide mutation requires update fields; move/duplicate require --position.");
11691
+ usage13("Slide mutation requires update fields; move/duplicate require --position.");
11423
11692
  if (result.scope !== void 0 && result.scope !== "slides")
11424
- usage12("Slide mutations require slides scope.");
11693
+ usage13("Slide mutations require slides scope.");
11425
11694
  } else if (operation === "validate") {
11426
11695
  if ([...seen].some((flag) => flag !== "--json" && flag !== "--limit"))
11427
- usage12("Option does not apply to validation.");
11696
+ usage13("Option does not apply to validation.");
11428
11697
  if (result.limits && ["maxOutputs", "maxOutputBytes"].some((name) => Object.hasOwn(result.limits, name)))
11429
- usage12("Output limits do not apply to validation.");
11430
- if (positionals.length !== 1 || !positionals[0]) usage12("Validation requires exactly one nonempty input.");
11698
+ usage13("Output limits do not apply to validation.");
11699
+ if (positionals.length !== 1 || !positionals[0]) usage13("Validation requires exactly one nonempty input.");
11431
11700
  result.input = positionals[0];
11432
11701
  return result;
11433
11702
  } else if (operation !== "inspect" && !xml) {
11434
11703
  if ([...seen].some((option) => option !== "--json" && !(operation === "capabilities" && option === "--limit")))
11435
- usage12("Selection options require inspect.");
11704
+ usage13("Selection options require inspect.");
11436
11705
  if (operation === "capabilities") {
11437
- if (result.limits && Object.hasOwn(result.limits, "maxOutputs")) usage12("Output-count limits do not apply to capabilities.");
11438
- if (positionals.length > 1 || positionals[0] === "") usage12("Capabilities accepts at most one nonempty input.");
11706
+ if (result.limits && Object.hasOwn(result.limits, "maxOutputs")) usage13("Output-count limits do not apply to capabilities.");
11707
+ if (positionals.length > 1 || positionals[0] === "") usage13("Capabilities accepts at most one nonempty input.");
11439
11708
  if (positionals[0] !== void 0) result.input = positionals[0];
11440
11709
  return result;
11441
11710
  }
@@ -11496,43 +11765,43 @@ function parse(raw, maximum, output3) {
11496
11765
  result.schemaPath = positionals.join(".");
11497
11766
  return result;
11498
11767
  }
11499
- if (positionals.length) usage12("Unexpected input.");
11768
+ if (positionals.length) usage13("Unexpected input.");
11500
11769
  return result;
11501
11770
  }
11502
- if (positionals.length !== 1) usage12("Inspection requires exactly one input.");
11771
+ if (positionals.length !== 1) usage13("Inspection requires exactly one input.");
11503
11772
  result.input = positionals[0];
11504
- if (result.input.length === 0) usage12("Input path must not be empty.");
11773
+ if (result.input.length === 0) usage13("Input path must not be empty.");
11505
11774
  if (result.token && ["--slide", "--shape", "--part", "--scope", "--all"].some((option) => seen.has(option)))
11506
- usage12("Opaque and simple selectors cannot be combined.");
11775
+ usage13("Opaque and simple selectors cannot be combined.");
11507
11776
  if (result.part && result.slide !== void 0)
11508
- usage12("Part and slide selectors cannot be combined.");
11777
+ usage13("Part and slide selectors cannot be combined.");
11509
11778
  if (result.shape && result.slide === void 0 && !result.part)
11510
- usage12("Shape selection requires an owning slide or part.");
11779
+ usage13("Shape selection requires an owning slide or part.");
11511
11780
  if (result.slide !== void 0 && result.scope !== void 0 && result.scope !== "slides")
11512
- usage12("Slide positions require slides scope.");
11781
+ usage13("Slide positions require slides scope.");
11513
11782
  const mutationOptions = ["--file", "--output", "--in-place", "--force", "--dry-run"];
11514
11783
  if (operation !== "xml.set" && operation !== "slides.add" && operation !== "slides.import" && !slideMutation && mutationOptions.some((option) => seen.has(option)))
11515
- usage12("Publication options require xml set.");
11784
+ usage13("Publication options require xml set.");
11516
11785
  if (!xml && operation !== "inspect" && operation !== "slides.add" && operation !== "slides.import" && !slideMutation && result.limits)
11517
- usage12("Limit overrides require inspect, XML operations or slides add.");
11518
- if (operation !== "xml.get" && result.pretty) usage12("Pretty output requires xml get.");
11786
+ usage13("Limit overrides require inspect, XML operations or slides add.");
11787
+ if (operation !== "xml.get" && result.pretty) usage13("Pretty output requires xml get.");
11519
11788
  if (xml) {
11520
11789
  if (result.slide !== void 0 || result.shape || result.all)
11521
- usage12("XML operations require one part selector.");
11522
- if (!result.part && !result.token) usage12("XML operations require a part or opaque selector.");
11790
+ usage13("XML operations require one part selector.");
11791
+ if (!result.part && !result.token) usage13("XML operations require a part or opaque selector.");
11523
11792
  }
11524
11793
  if (operation === "xml.set" || operation === "slides.add" || operation === "slides.import" || slideMutation) {
11525
- if (operation === "xml.set" && !result.file) usage12("XML replacement requires --file.");
11526
- if (result.input === "-" && result.file === "-") usage12("Only one input may consume stdin.");
11527
- if (result.inPlace && result.input === "-") usage12("Stdin cannot be edited in place.");
11528
- if (result.inPlace && result.output) usage12("Output and in-place cannot be combined.");
11794
+ if (operation === "xml.set" && !result.file) usage13("XML replacement requires --file.");
11795
+ if (result.input === "-" && result.file === "-") usage13("Only one input may consume stdin.");
11796
+ if (result.inPlace && result.input === "-") usage13("Stdin cannot be edited in place.");
11797
+ if (result.inPlace && result.output) usage13("Output and in-place cannot be combined.");
11529
11798
  if (!result.dryRun && !result.inPlace && !result.output)
11530
- usage12("Mutation requires a destination.");
11531
- if (result.force && !result.output) usage12("Force requires an explicit output destination.");
11799
+ usage13("Mutation requires a destination.");
11800
+ if (result.force && !result.output) usage13("Force requires an explicit output destination.");
11532
11801
  if (result.output === result.input && result.output !== "-")
11533
- usage12("Replacing input requires --in-place.");
11802
+ usage13("Replacing input requires --in-place.");
11534
11803
  if (result.output === "-" && result.json && !result.dryRun)
11535
- usage12("Binary stdout cannot be combined with JSON.");
11804
+ usage13("Binary stdout cannot be combined with JSON.");
11536
11805
  }
11537
11806
  return result;
11538
11807
  }
@@ -11601,7 +11870,7 @@ async function transferLocations(bytes, budget) {
11601
11870
  (edge) => relationshipNamespaces.some((namespace) => edge.type === `${namespace}/officeDocument`)
11602
11871
  );
11603
11872
  const root = roots.length === 1 ? roots[0].targetPart : void 0;
11604
- if (!root) throw new OfficeError16("invalid-opc", "Presentation part is missing.", "index");
11873
+ if (!root) throw new OfficeError19("invalid-opc", "Presentation part is missing.", "index");
11605
11874
  const relationshipNamespace = roots[0].type.slice(0, -"/officeDocument".length);
11606
11875
  const xml = budget.xml(reader.get(root));
11607
11876
  const fingerprint = Array.from(sha2564(bytes), (byte) => byte.toString(16).padStart(2, "0")).join(
@@ -11620,7 +11889,7 @@ async function transferLocations(bytes, budget) {
11620
11889
  (edge) => edge.id === reference && edge.type === `${relationshipNamespace}/slide`
11621
11890
  )?.targetPart;
11622
11891
  if (!id || !owner || !reader.has(owner))
11623
- throw new OfficeError16("invalid-opc", "Referenced slide is missing.", "index");
11892
+ throw new OfficeError19("invalid-opc", "Referenced slide is missing.", "index");
11624
11893
  return {
11625
11894
  fingerprint,
11626
11895
  scope: "slides",
@@ -11688,6 +11957,7 @@ async function executeRequest(request, options2, owned) {
11688
11957
  if (request.args?.[0] instanceof Uint8Array && request.args[0].length === 4 && request.args[0].every((byte, index) => byte === [100, 105, 102, 102][index]))
11689
11958
  return executeDiffCommand(request, options2);
11690
11959
  const output3 = { json: false, operation: "help" };
11960
+ let retainedExtraction;
11691
11961
  let result;
11692
11962
  let exitCode = 0;
11693
11963
  let stagedOutput;
@@ -11702,7 +11972,7 @@ async function executeRequest(request, options2, owned) {
11702
11972
  let allowPartialOutput = false;
11703
11973
  try {
11704
11974
  request.signal.throwIfAborted();
11705
- if (!Array.isArray(request.args)) usage12("Arguments must be byte arrays.");
11975
+ if (!Array.isArray(request.args)) usage13("Arguments must be byte arrays.");
11706
11976
  const args = parse(request.args, options2.maxArgumentBytes, output3);
11707
11977
  if (args.limits) {
11708
11978
  const validation = options2.context.validationLimits;
@@ -11728,7 +11998,70 @@ async function executeRequest(request, options2, owned) {
11728
11998
  output3.json = args.json;
11729
11999
  output3.operation = args.operation;
11730
12000
  const operation2 = args.operation;
11731
- if (args.operation === "slides.set" && request.streaming) {
12001
+ if (args.operation === "pack" && request.streaming) {
12002
+ if (args.creation?.author !== void 0 || args.creation?.timestamp !== void 0) throw new OfficeError19("unsupported-edit", "Pack metadata overrides are unavailable; source properties are preserved.", "validate-intent");
12003
+ const streaming = request.streaming, context = { ...options2.context, signal: request.signal, workingStorage: streaming.workingStorage };
12004
+ const input = await streaming.openInput(args.manifest, Math.min(context.limits.maxBytes, context.xmlLimits.maxBytes));
12005
+ const manifest = await openRetainedPackManifest(input.stream(), context, { manifest: args.manifest, ...args.output === void 0 ? {} : { output: args.output } });
12006
+ owned.push(manifest);
12007
+ let total = 0;
12008
+ const packed = await stageRetainedPackage(manifest.members(), async function* (part) {
12009
+ const source3 = await streaming.openInput(await manifest.path(part), Math.min(context.limits.maxBytes, context.archiveLimits.maxEntryBytes, context.archiveLimits.maxTotalBytes - total));
12010
+ total += source3.size;
12011
+ yield* source3.stream();
12012
+ }, context, args.creation?.kind ? { kind: args.creation.kind } : {});
12013
+ owned.push(packed);
12014
+ if (packed.size > options2.maxOutputBytes) throw new OfficeError19("resource-limit", "Packed output exceeds byte limit.", "validate-intent");
12015
+ const dryRun = args.dryRun ?? false;
12016
+ result = {
12017
+ version: 1,
12018
+ operation: operation2,
12019
+ ok: true,
12020
+ warnings: [],
12021
+ errors: [],
12022
+ locations: [],
12023
+ affected: packed.count,
12024
+ data: { effects: ["packed"], outputs: dryRun ? [] : [{ path: args.output, sha256: packed.fingerprint, bytes: packed.size }], fingerprint: dryRun ? null : packed.fingerprint, dryRun }
12025
+ };
12026
+ human = `${dryRun ? "Validated" : "Packed"} ${packed.count} package part(s)
12027
+ `;
12028
+ if (args.output && args.output !== "-") {
12029
+ if (!request.publishOutput) throw Object.assign(new Error("Output publication unavailable."), { code: "publication-unsupported" });
12030
+ publication = { outputPath: args.output, protectedInputPaths: manifest.paths(), bytes: packed.bytes(), originalBytes: input, inPlace: false, force: args.force ?? false, dryRun };
12031
+ } else if (args.output === "-" && !dryRun) stagedOutput = { close: packed.close, async write(sink) {
12032
+ for await (const bytes of packed.bytes()) await sink.write(bytes);
12033
+ } };
12034
+ } else if (args.operation === "extract" && request.streaming && (!request.publishOutputs || request.publishOutputStreams) && (!request.preflightOutput || request.preflightOutputStream)) {
12035
+ retainedExtraction = await prepareRetainedExtraction(args, request, options2);
12036
+ owned.push(retainedExtraction);
12037
+ result = success(operation2, null);
12038
+ } else if (args.operation === "xml.set" && request.streaming) {
12039
+ if (args.token) decodeSelectionToken2(args.token);
12040
+ const streaming = request.streaming, context = { ...options2.context, signal: request.signal, workingStorage: streaming.workingStorage };
12041
+ if (!context.validationLimits) throw new OfficeError19("invalid-value", "XML operations require explicit validation limits.", "usage");
12042
+ const input = await streaming.openInput(args.input, Math.min(context.limits.maxBytes, context.archiveLimits.maxArchiveBytes));
12043
+ const maxReplacementBytes = Math.min(context.validationLimits.maxBytes, context.archiveLimits.maxEntryBytes), file = args.file;
12044
+ async function* replacement() {
12045
+ const source3 = await streaming.openInput(file, maxReplacementBytes);
12046
+ yield* source3.stream();
12047
+ }
12048
+ const destination = args.inPlace ? args.input : args.output, dryRun = args.dryRun ?? false;
12049
+ const staged = await stageRetainedXmlReplacement(input, replacement(), {
12050
+ ...args.token === void 0 ? {} : { token: args.token },
12051
+ ...args.slide === void 0 ? {} : { slide: args.slide },
12052
+ ...args.shape === void 0 ? {} : { shape: args.shape },
12053
+ ...args.part === void 0 ? {} : { part: args.part },
12054
+ ...args.scope === void 0 ? {} : { scope: args.scope },
12055
+ ...args.all === void 0 ? {} : { all: args.all }
12056
+ }, context, { json: args.json, dryRun, ...destination === void 0 ? {} : { destination }, maxOutputBytes: options2.maxOutputBytes });
12057
+ owned.push(staged);
12058
+ stagedOutput = staged.output;
12059
+ if (destination && destination !== "-") {
12060
+ if (!request.publishOutput) throw Object.assign(new Error("Output publication capability is unavailable."), { code: "publication-unsupported" });
12061
+ publication = { inputPath: args.input, outputPath: destination, bytes: staged.bytes(), originalBytes: input, inPlace: args.inPlace ?? false, force: args.force ?? false, dryRun };
12062
+ }
12063
+ result = success(operation2, null);
12064
+ } else if (args.operation === "slides.set" && request.streaming) {
11732
12065
  if (args.token) decodeSelectionToken2(args.token);
11733
12066
  const input = await request.streaming.openInput(args.input, Math.min(options2.context.limits.maxBytes, options2.context.archiveLimits.maxArchiveBytes));
11734
12067
  const destination = args.inPlace ? args.input : args.output;
@@ -11745,7 +12078,7 @@ async function executeRequest(request, options2, owned) {
11745
12078
  publication = { inputPath: args.input, outputPath: destination, bytes: staged.bytes(), originalBytes: input, inPlace: args.inPlace ?? false, force: args.force ?? false, dryRun };
11746
12079
  }
11747
12080
  result = success(operation2, null);
11748
- } else if ((args.operation === "inspect" || args.operation === "text.get" || args.operation === "fields.list" || args.operation === "fields.get" || args.operation === "xml.get") && request.streaming) {
12081
+ } else if ((args.operation === "inspect" || args.operation === "text.get" || args.operation === "fields.list" || args.operation === "fields.get" || args.operation === "text.frames.list" || args.operation === "text.frames.get" || args.operation === "xml.get") && request.streaming) {
11749
12082
  if (args.token) decodeSelectionToken2(args.token);
11750
12083
  const input = await request.streaming.openInput(args.input, Math.min(options2.context.limits.maxBytes, options2.context.archiveLimits.maxArchiveBytes));
11751
12084
  const hash = sha2564.create();
@@ -11780,7 +12113,7 @@ async function executeRequest(request, options2, owned) {
11780
12113
  }, context, { json: args.json, maxOutputBytes: options2.maxOutputBytes });
11781
12114
  } catch (error) {
11782
12115
  failed = true;
11783
- if (error instanceof OfficeError16 && error.code === "resource-limit" && error.phase === "publish") return outputLimitFailure(operation2, args.json);
12116
+ if (error instanceof OfficeError19 && error.code === "resource-limit" && error.phase === "publish") return outputLimitFailure(operation2, args.json);
11784
12117
  throw error;
11785
12118
  } finally {
11786
12119
  try {
@@ -11805,7 +12138,7 @@ async function executeRequest(request, options2, owned) {
11805
12138
  let failed = false;
11806
12139
  try {
11807
12140
  validation = await openRetainedPresentationValidation(archive, context, limits);
11808
- if (!validation.valid) throw new OfficeError16("invalid-opc", "Presentation semantic validation failed.", "index");
12141
+ if (!validation.valid) throw new OfficeError19("invalid-opc", "Presentation semantic validation failed.", "index");
11809
12142
  result = success(operation2, { valid: true, schema: validation.schema, rules: validation.rules, issues: [] });
11810
12143
  } catch (error) {
11811
12144
  failed = true;
@@ -11820,15 +12153,15 @@ async function executeRequest(request, options2, owned) {
11820
12153
  const bytes = await request.readInput(args.input, maxBytes);
11821
12154
  const reader = await readPackage3(bytes, { ...options2.context, signal: request.signal });
11822
12155
  const validation = validatePresentation(reader, limits);
11823
- if (!validation.valid) throw new OfficeError16("invalid-opc", "Presentation semantic validation failed.", "index");
12156
+ if (!validation.valid) throw new OfficeError19("invalid-opc", "Presentation semantic validation failed.", "index");
11824
12157
  result = success(operation2, validation);
11825
12158
  }
11826
12159
  human = "Presentation is semantically valid; XML schema validation not checked.\n";
11827
12160
  } else if (args.operation === "help") {
11828
- const usage13 = args.schemaPath === "validate" ? "Usage: pptx validate INPUT [--json] [--limit NAME=VALUE]\nBounded semantic validation; XML schema validation is not checked.\n" : args.schemaPath && Object.hasOwn(packageToolsSchemas, args.schemaPath) ? packageToolsUsage : args.schemaPath === "objects.add" ? objectsAddUsage : args.schemaPath && Object.hasOwn(opaqueSchemas, args.schemaPath) ? opaqueUsage : args.schemaPath?.startsWith("equations.") ? equationsUsage : args.schemaPath === "text.fit" ? "Usage: pptx text fit INPUT --metrics JSON [selection] [output]\nSelection: --slide N --shape NAME | --select TOKEN | --all\nOutput: --output PATH | --in-place | --dry-run\n--font-family NAME --min-size N --max-size N\n--bold true|false --italic true|false --wrap true|false\n--margin-left LENGTH --margin-right LENGTH\n--margin-top LENGTH --margin-bottom LENGTH --line-spacing MULTIPLIER\n--json --allow-empty --force --scope SCOPE --limit NAME=VALUE\nDefaults: Calibri, 1..18pt, regular, wrap, line spacing 1.\nSupplied scalar metrics; horizontal single-column shapes with local extents.\nNo host font discovery. Platform rendering may differ.\n" : args.schemaPath?.startsWith("text.frames.") ? frameHelp : args.schemaPath?.startsWith("text.paragraphs.") ? paragraphHelp : args.schemaPath?.startsWith("text.runs.") ? runHelp : help;
12161
+ const usage14 = args.schemaPath === "validate" ? "Usage: pptx validate INPUT [--json] [--limit NAME=VALUE]\nBounded semantic validation; XML schema validation is not checked.\n" : args.schemaPath && Object.hasOwn(packageToolsSchemas, args.schemaPath) ? packageToolsUsage : args.schemaPath === "objects.add" ? objectsAddUsage : args.schemaPath && Object.hasOwn(opaqueSchemas, args.schemaPath) ? opaqueUsage : args.schemaPath?.startsWith("equations.") ? equationsUsage : args.schemaPath === "text.fit" ? "Usage: pptx text fit INPUT --metrics JSON [selection] [output]\nSelection: --slide N --shape NAME | --select TOKEN | --all\nOutput: --output PATH | --in-place | --dry-run\n--font-family NAME --min-size N --max-size N\n--bold true|false --italic true|false --wrap true|false\n--margin-left LENGTH --margin-right LENGTH\n--margin-top LENGTH --margin-bottom LENGTH --line-spacing MULTIPLIER\n--json --allow-empty --force --scope SCOPE --limit NAME=VALUE\nDefaults: Calibri, 1..18pt, regular, wrap, line spacing 1.\nSupplied scalar metrics; horizontal single-column shapes with local extents.\nNo host font discovery. Platform rendering may differ.\n" : args.schemaPath?.startsWith("text.frames.") ? frameHelp : args.schemaPath?.startsWith("text.paragraphs.") ? paragraphHelp : args.schemaPath?.startsWith("text.runs.") ? runHelp : help;
11829
12162
  let resolvedUsage = args.schemaPath === "shapes.remove" ? "Usage: pptx shapes remove INPUT --slide N --shape NAME [--detach-policy detach|remove] [output]\nSelection also accepts --select TOKEN or --all. Referenced targets require explicit policy.\nDetach keeps connectors with free coordinates; remove deletes affected connectors. Timing references reject deletion.\nOutput: --output PATH | --in-place | --dry-run; --force --json --limit NAME=VALUE.\n" : args.schemaPath?.startsWith("tables.") ? "Usage: pptx tables list|get|add|set|merge|split INPUT [--slide N --table N --cell row,column] [properties] [output]\nMerge: --from row,column --to row,column; split: --cell row,column (merge origin).\nRows/columns: tables rows|columns add|remove INPUT --position N --span-policy expand|shrink|reject\nInsertion accepts expand/reject; deletion accepts shrink/reject. Partial intersecting merges fail.\nAdd: --rows N --columns N --left LENGTH --top LENGTH --width LENGTH --height LENGTH [--data JSON]\nPlaceholder add: --slide N --placeholder IDX --rows N --columns N. Inherits position/width; rows set height.\nSet: --text TEXT (one cell), --data JSON, --row-height LENGTH, --column-width LENGTH, --style ID\nFormatting: --fill RGB --border-color RGB --border-width LENGTH --margin-left|right|top|bottom LENGTH\nStyle flags: --first-row|last-row|first-col|last-col|horz-band|vert-band true|false; --vertical-anchor top|middle|bottom\nOutput: --output PATH or --in-place; --dry-run validates without publication. Selectors are one-based.\n" : args.schemaPath?.startsWith("connectors.") ? "Usage: pptx connectors list|get|add|set|remove INPUT [selection] [properties] [output]\nSelection: --slide N [--shape NAME | --all] | --select TOKEN.\nAdd requires --kind STRAIGHT|ELBOW|CURVE --begin-x LENGTH --begin-y LENGTH --end-x LENGTH --end-y LENGTH.\nAttach: --begin-target LOCATION_JSON --end-target LOCATION_JSON --site N (zero-based).\nSet target null to detach one endpoint; --detach-policy detach detaches both, remove removes the connector.\nLengths use explicit emu/in/cm/mm/pt in parent coordinates. --name TEXT sets the name.\nLine: --line-color RGB|solid|null --line-width LENGTH|null. Solid preserves existing solid color.\nOutput: --output PATH | --in-place | --dry-run; --force --json --limit NAME=VALUE.\nTargets: rect/ellipse/roundRect sites 0..3. Grouped connectors require same-parent targets.\nNonzero-rotated coordinate edits reject; arbitrary routing/guide geometry is preserve-only.\n" : ["shapes.move", "shapes.align", "shapes.distribute", "shapes.duplicate"].includes(
11830
12163
  args.schemaPath ?? ""
11831
- ) ? "Usage: pptx shapes move|align|distribute|duplicate INPUT [selection] --coordinate-system slide|group [output]\nSelection: --shapes JSON Location array, or --slide N [--shape NAME | --all], or --select TOKEN.\nMove: --order front|back|forward|backward OR --position N (one-based).\nAlign: --alignment left|center|right|top|middle|bottom. Distribute: --axis horizontal|vertical.\nDuplicate: --offset-x LENGTH --offset-y LENGTH (explicit units, signed offsets).\nHidden siblings participate; locked selections fail. Mixed slides or parent groups fail.\nOutput: --output PATH | --in-place | --dry-run; --force, --json, --limit NAME=VALUE.\n" : args.schemaPath?.startsWith("shapes.paths.") ? "Usage: pptx shapes paths list|get|add|set INPUT [selection] [path] [output]\nRead: list|get INPUT [selection]. Add/set require --path JSON or --vertices JSON.\nPath: {unit:emu,width,height,commands:[move|line|quadratic|cubic|close]}\nCoordinates: integer local EMUs, -2147483647..2147483647; viewport 1..2147483647.\nAt most 4096 commands; explicit closure; command order preserved without winding evaluation.\nAlternatively --vertices JSON --close true|false uses {x,y} local EMU vertices and a derived viewport.\nAdd placement: --left LENGTH --top LENGTH --width LENGTH --height LENGTH.\nAdd accepts shape name, text, paint and metadata properties. Lengths require emu/in/cm/mm/pt.\nSelection: --slide N [--shape NAME] | --part URI --scope SCOPE | --select TOKEN.\nSet: selects one shape unless --all; --allow-empty accepts zero matches.\nScopes: slides (default), layouts, masters; shared requires --part URI.\nOutput: --output PATH | --in-place | --dry-run; --force --json --limit NAME=VALUE.\nUnsupported formulas, arcs and arbitrary existing geometry are preserve-only.\n" : ["shapes.group", "shapes.ungroup"].includes(args.schemaPath ?? "") ? "Usage: pptx shapes group|ungroup INPUT --tolerance LENGTH [selection] [output]\nGroup: --shapes JSON array of at least two inspected Location objects.\nShapes must be distinct contiguous siblings; original IDs and z-order are retained.\nUngroup: --slide N --shape NAME | --select TOKEN; selects one group.\nSelection: --part URI --scope SCOPE. Exact cardinality; --all/--allow-empty are unsupported.\nTolerance is explicit nonnegative EMU precision using emu/in/cm/mm/pt lengths.\nIdentity groups preserve child XML; transformed ungrouping supports nested groups and rectangles\nwithout text, styles or strokes.\nTransformed ungrouping supports quarter-turn rotation chains only.\nWorld geometry must remain within tolerance; unsupported geometry and references fail.\nOutput: --output PATH | --in-place | --dry-run; --force --json --limit NAME=VALUE.\n" : args.schemaPath?.startsWith("shapes.drawing.") || args.schemaPath === "shapes.effects.set" ? "Usage: pptx shapes drawing get|set INPUT [selection] [paint] [output]\n pptx shapes effects set INPUT [selection] --shadow true|false\n --opacity RATIO --shadow-blur LENGTH --shadow-color COLOR [output]\nPaint: --fill-kind inherit|none|solid|gradient|pattern|picture\n --color COLOR; gradient: --stops JSON --angle DEGREES\n pattern: --pattern PRESET [--foreground COLOR --background COLOR]\n picture: --file PATH --mode stretch|tile\nAdvanced paint: --fill JSON --line JSON --shadow-inherit true|false\nCOLOR is six-digit RGB or JSON with rgb/theme, optional brightness and opacity.\nSelection: --slide N --shape NAME | --part URI --scope SCOPE | --select TOKEN\nScopes: slides (default), layouts, masters; shared requires a part.\nSet selects one shape unless --all; --allow-empty accepts zero matches.\nOutput: --output PATH | --in-place | --dry-run; --force --json --limit NAME=VALUE.\nLengths require emu/in/cm/mm/pt. Simple shadows have zero offset.\nComplex effects and 3D remain intact; editing unsupported effects fails.\n" : args.schemaPath?.startsWith("shapes.") ? "Usage: pptx shapes list|get|add|set INPUT [selection] [properties] [output]\nSelection: --slide N --shape NAME | --select TOKEN; --part URI --scope SCOPE\nScopes: slides (default), layouts, masters; shared requires a part.\nAdd: --kind text-box|PRESET --left LENGTH --top LENGTH --width LENGTH --height LENGTH\nProperties: --name TEXT --text TEXT --title TEXT --description TEXT --alt-text TEXT\n --locked true|false|null --rotation DEGREES --fill RGB --line-color RGB --line-width LENGTH\n --flip-horizontal true|false --flip-vertical true|false\n --adjustments JSON_ARRAY (normalized preset values in guide order)\n Geometry uses parent coordinates; inspection corners use slide EMUs.\nLengths require emu/in/cm/mm/pt. Presets use enum names or numeric values from schema.\nNull clears direct title/description/lock; null fill/line color disables fill/line.\nOmitted values stay unchanged.\nNull line width restores inherited width.\nFill/line color solid selects solid fill; existing solid colors are retained.\nShape IDs are read-only. Unsupported geometry and advanced formatting are preserve-only.\nOutput: --output PATH | --in-place | --dry-run; --force --json --limit NAME=VALUE\nSet: --all edits every match; --allow-empty accepts zero matches.\n" : args.schemaPath?.startsWith("fields.") ? "Usage: pptx fields list|get|set|add|remove INPUT [options]\nSelection: --slide N --shape NAME | --select TOKEN\n --scope SCOPE --json --limit NAME=VALUE\nMutation: --all --allow-empty\nOutput: --output PATH | --in-place | --dry-run; --force\nSet/add: --kind slide-number|date|footer|header\n --update preserve|explicit --text TEXT --timestamp UTC\nAdd requires --kind and one text body; appends to its last paragraph.\nPreserve is default: retains the cache (empty on add), rejects text/time.\nExplicit requires text; date fields also require a caller UTC timestamp.\nNo field evaluation, automatic numbering or inherited-content flattening.\nList/get are read-only; get requires one field. Remove accepts no policy.\n" : usage13;
12164
+ ) ? "Usage: pptx shapes move|align|distribute|duplicate INPUT [selection] --coordinate-system slide|group [output]\nSelection: --shapes JSON Location array, or --slide N [--shape NAME | --all], or --select TOKEN.\nMove: --order front|back|forward|backward OR --position N (one-based).\nAlign: --alignment left|center|right|top|middle|bottom. Distribute: --axis horizontal|vertical.\nDuplicate: --offset-x LENGTH --offset-y LENGTH (explicit units, signed offsets).\nHidden siblings participate; locked selections fail. Mixed slides or parent groups fail.\nOutput: --output PATH | --in-place | --dry-run; --force, --json, --limit NAME=VALUE.\n" : args.schemaPath?.startsWith("shapes.paths.") ? "Usage: pptx shapes paths list|get|add|set INPUT [selection] [path] [output]\nRead: list|get INPUT [selection]. Add/set require --path JSON or --vertices JSON.\nPath: {unit:emu,width,height,commands:[move|line|quadratic|cubic|close]}\nCoordinates: integer local EMUs, -2147483647..2147483647; viewport 1..2147483647.\nAt most 4096 commands; explicit closure; command order preserved without winding evaluation.\nAlternatively --vertices JSON --close true|false uses {x,y} local EMU vertices and a derived viewport.\nAdd placement: --left LENGTH --top LENGTH --width LENGTH --height LENGTH.\nAdd accepts shape name, text, paint and metadata properties. Lengths require emu/in/cm/mm/pt.\nSelection: --slide N [--shape NAME] | --part URI --scope SCOPE | --select TOKEN.\nSet: selects one shape unless --all; --allow-empty accepts zero matches.\nScopes: slides (default), layouts, masters; shared requires --part URI.\nOutput: --output PATH | --in-place | --dry-run; --force --json --limit NAME=VALUE.\nUnsupported formulas, arcs and arbitrary existing geometry are preserve-only.\n" : ["shapes.group", "shapes.ungroup"].includes(args.schemaPath ?? "") ? "Usage: pptx shapes group|ungroup INPUT --tolerance LENGTH [selection] [output]\nGroup: --shapes JSON array of at least two inspected Location objects.\nShapes must be distinct contiguous siblings; original IDs and z-order are retained.\nUngroup: --slide N --shape NAME | --select TOKEN; selects one group.\nSelection: --part URI --scope SCOPE. Exact cardinality; --all/--allow-empty are unsupported.\nTolerance is explicit nonnegative EMU precision using emu/in/cm/mm/pt lengths.\nIdentity groups preserve child XML; transformed ungrouping supports nested groups and rectangles\nwithout text, styles or strokes.\nTransformed ungrouping supports quarter-turn rotation chains only.\nWorld geometry must remain within tolerance; unsupported geometry and references fail.\nOutput: --output PATH | --in-place | --dry-run; --force --json --limit NAME=VALUE.\n" : args.schemaPath?.startsWith("shapes.drawing.") || args.schemaPath === "shapes.effects.set" ? "Usage: pptx shapes drawing get|set INPUT [selection] [paint] [output]\n pptx shapes effects set INPUT [selection] --shadow true|false\n --opacity RATIO --shadow-blur LENGTH --shadow-color COLOR [output]\nPaint: --fill-kind inherit|none|solid|gradient|pattern|picture\n --color COLOR; gradient: --stops JSON --angle DEGREES\n pattern: --pattern PRESET [--foreground COLOR --background COLOR]\n picture: --file PATH --mode stretch|tile\nAdvanced paint: --fill JSON --line JSON --shadow-inherit true|false\nCOLOR is six-digit RGB or JSON with rgb/theme, optional brightness and opacity.\nSelection: --slide N --shape NAME | --part URI --scope SCOPE | --select TOKEN\nScopes: slides (default), layouts, masters; shared requires a part.\nSet selects one shape unless --all; --allow-empty accepts zero matches.\nOutput: --output PATH | --in-place | --dry-run; --force --json --limit NAME=VALUE.\nLengths require emu/in/cm/mm/pt. Simple shadows have zero offset.\nComplex effects and 3D remain intact; editing unsupported effects fails.\n" : args.schemaPath?.startsWith("shapes.") ? "Usage: pptx shapes list|get|add|set INPUT [selection] [properties] [output]\nSelection: --slide N --shape NAME | --select TOKEN; --part URI --scope SCOPE\nScopes: slides (default), layouts, masters; shared requires a part.\nAdd: --kind text-box|PRESET --left LENGTH --top LENGTH --width LENGTH --height LENGTH\nProperties: --name TEXT --text TEXT --title TEXT --description TEXT --alt-text TEXT\n --locked true|false|null --rotation DEGREES --fill RGB --line-color RGB --line-width LENGTH\n --flip-horizontal true|false --flip-vertical true|false\n --adjustments JSON_ARRAY (normalized preset values in guide order)\n Geometry uses parent coordinates; inspection corners use slide EMUs.\nLengths require emu/in/cm/mm/pt. Presets use enum names or numeric values from schema.\nNull clears direct title/description/lock; null fill/line color disables fill/line.\nOmitted values stay unchanged.\nNull line width restores inherited width.\nFill/line color solid selects solid fill; existing solid colors are retained.\nShape IDs are read-only. Unsupported geometry and advanced formatting are preserve-only.\nOutput: --output PATH | --in-place | --dry-run; --force --json --limit NAME=VALUE\nSet: --all edits every match; --allow-empty accepts zero matches.\n" : args.schemaPath?.startsWith("fields.") ? "Usage: pptx fields list|get|set|add|remove INPUT [options]\nSelection: --slide N --shape NAME | --select TOKEN\n --scope SCOPE --json --limit NAME=VALUE\nMutation: --all --allow-empty\nOutput: --output PATH | --in-place | --dry-run; --force\nSet/add: --kind slide-number|date|footer|header\n --update preserve|explicit --text TEXT --timestamp UTC\nAdd requires --kind and one text body; appends to its last paragraph.\nPreserve is default: retains the cache (empty on add), rejects text/time.\nExplicit requires text; date fields also require a caller UTC timestamp.\nNo field evaluation, automatic numbering or inherited-content flattening.\nList/get are read-only; get requires one field. Remove accepts no policy.\n" : usage14;
11832
12165
  if (args.schemaPath === "diff") resolvedUsage = diffUsage;
11833
12166
  if (args.schemaPath?.startsWith("comments.")) resolvedUsage = commentsUsage;
11834
12167
  if (args.schemaPath?.startsWith("notes.")) resolvedUsage = notesUsage;
@@ -12177,11 +12510,11 @@ ${JSON.stringify(result.data, null, 2)}
12177
12510
  try {
12178
12511
  text2 = new TextDecoder("utf-8", { fatal: true }).decode(encoded2);
12179
12512
  } catch {
12180
- usage12("Batch JSON must be UTF-8.");
12513
+ usage13("Batch JSON must be UTF-8.");
12181
12514
  }
12182
12515
  items = parseAnimationBatch(commandJson(text2));
12183
12516
  }
12184
- if (items.length && !args.dryRun && !args.inPlace && !args.output) usage12("Mutation requires a destination.");
12517
+ if (items.length && !args.dryRun && !args.inPlace && !args.output) usage13("Mutation requires a destination.");
12185
12518
  const bytes = await request.readInput(args.input, Math.min(context.limits.maxBytes, context.archiveLimits.maxArchiveBytes));
12186
12519
  const index = await readSelectionIndex2(bytes, context);
12187
12520
  const changed = await mutateAnimationsBatch(bytes, resolveAnimationBatch(items, index), context);
@@ -13416,13 +13749,13 @@ ${item.parts.map((part) => ` ${part}
13416
13749
  const inputs = [];
13417
13750
  for (const path of [args.input, ...args.sources ?? []]) {
13418
13751
  if (remaining < 1)
13419
- throw new OfficeError16("resource-limit", "Combined input limit exceeded.", "admit");
13752
+ throw new OfficeError19("resource-limit", "Combined input limit exceeded.", "admit");
13420
13753
  const bytes = await request.readInput(
13421
13754
  path,
13422
13755
  Math.min(remaining, context.archiveLimits.maxArchiveBytes)
13423
13756
  );
13424
13757
  if (bytes.length > remaining || bytes.length > context.archiveLimits.maxArchiveBytes)
13425
- throw new OfficeError16("resource-limit", "Combined input limit exceeded.", "admit");
13758
+ throw new OfficeError19("resource-limit", "Combined input limit exceeded.", "admit");
13426
13759
  remaining -= bytes.length;
13427
13760
  inputs.push(await budget.read(bytes));
13428
13761
  }
@@ -13523,7 +13856,7 @@ ${JSON.stringify(result.data, null, 2)}
13523
13856
  }
13524
13857
  } else if (args.operation === "create") {
13525
13858
  if (args.template)
13526
- throw new OfficeError16(
13859
+ throw new OfficeError19(
13527
13860
  "unsupported-profile",
13528
13861
  "Template-based creation is unavailable.",
13529
13862
  "validate-intent"
@@ -13575,7 +13908,7 @@ ${JSON.stringify(result.data, null, 2)}
13575
13908
  );
13576
13909
  } catch (error) {
13577
13910
  if (error && typeof error === "object" && "code" in error && error.code === "resource-limit")
13578
- throw new OfficeError16("resource-limit", "Input limit exceeded.", "admit");
13911
+ throw new OfficeError19("resource-limit", "Input limit exceeded.", "admit");
13579
13912
  throw error;
13580
13913
  }
13581
13914
  const index = await readSelectionIndex2(bytes, { ...options2.context, signal: request.signal });
@@ -13720,7 +14053,7 @@ ${JSON.stringify(result.data, null, 2)}
13720
14053
  const part = metadata2 ?? records[0].part;
13721
14054
  const validationLimits = options2.context.validationLimits;
13722
14055
  if (!validationLimits)
13723
- throw new OfficeError16(
14056
+ throw new OfficeError19(
13724
14057
  "invalid-value",
13725
14058
  "XML operations require explicit validation limits.",
13726
14059
  "usage"
@@ -13796,10 +14129,10 @@ ${xml.xml}
13796
14129
  await stagedOutput?.close().catch(() => {
13797
14130
  });
13798
14131
  stagedOutput = void 0;
13799
- if (error instanceof OfficeError16 && error.code === "resource-limit" && error.phase === "publish") return outputLimitFailure(output3.operation, output3.json);
14132
+ if (error instanceof OfficeError19 && error.code === "resource-limit" && error.phase === "publish") return outputLimitFailure(output3.operation, output3.json);
13800
14133
  if (request.signal.aborted)
13801
14134
  return { exitCode: 130, stdout: new Uint8Array(), stderr: new Uint8Array() };
13802
- const office = error instanceof OfficeError16 ? error : void 0;
14135
+ const office = error instanceof OfficeError19 ? error : void 0;
13803
14136
  const capabilityCode = error && typeof error === "object" && "code" in error ? error.code : void 0;
13804
14137
  const limit = office?.code === "resource-limit" || capabilityCode === "resource-limit";
13805
14138
  const unsupported = capabilityCode === "publication-unsupported";
@@ -13825,6 +14158,7 @@ ${xml.xml}
13825
14158
  human = `pptx: ${diagnostic.code}: ${diagnostic.message}
13826
14159
  `;
13827
14160
  }
14161
+ if (retainedExtraction && result.ok) return retainedExtraction.publish();
13828
14162
  const { json, operation } = output3;
13829
14163
  const encoded = (stagedOutput ? new Uint8Array() : binary) ?? new TextEncoder().encode(
13830
14164
  json ? `${JSON.stringify(result)}
@@ -13901,7 +14235,7 @@ ${JSON.stringify(failure.data)}
13901
14235
  } catch (error) {
13902
14236
  if (request.signal.aborted)
13903
14237
  return { exitCode: 130, stdout: new Uint8Array(), stderr: new Uint8Array() };
13904
- const office = error instanceof OfficeError16 ? error : void 0;
14238
+ const office = error instanceof OfficeError19 ? error : void 0;
13905
14239
  const rawCode = error && typeof error === "object" && "code" in error ? error.code : void 0;
13906
14240
  const code = typeof rawCode === "string" && [
13907
14241
  "resource-limit",
@@ -13983,7 +14317,7 @@ async function execute(request, options2) {
13983
14317
  }
13984
14318
  }
13985
14319
  function createPptxCommandEngine(settings = {}) {
13986
- const context = resourceContext(settings.context);
14320
+ const context = resourceContext2(settings.context);
13987
14321
  const options2 = {
13988
14322
  maxArgumentBytes: settings.maxArgumentBytes ?? Infinity,
13989
14323
  maxOutputBytes: settings.maxOutputBytes ?? Infinity,