@poe-platform/safe-bash 0.1.809 → 0.1.811

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (316) hide show
  1. package/dist/audio-ast/flac-source.d.ts +13 -0
  2. package/dist/audio-ast/index.d.ts +2 -1
  3. package/dist/audio-ast/index.js +254 -179
  4. package/dist/audio-ast/wav-source.d.ts +7 -1
  5. package/dist/image-ast/index.js +1 -1
  6. package/dist/json-ast/backed-json-parser.d.ts +12 -1
  7. package/dist/json-ast/index.d.ts +1 -1
  8. package/dist/office-xml/index.d.ts +1 -0
  9. package/dist/office-xml/retained-xml-edits.d.ts +22 -0
  10. package/dist/pdf-ast/cos/mutable-object-store.d.ts +3 -0
  11. package/dist/pdf-ast/cos/qpdf-json-document.d.ts +43 -0
  12. package/dist/pdf-ast/cos/qpdf-json-values.d.ts +7 -0
  13. package/dist/pdf-ast/index.d.ts +1 -0
  14. package/dist/pdf-ast/index.js +653 -87
  15. package/dist/pdf-ast/retained-document.d.ts +5 -1
  16. package/dist/safe-bash/audio-ast.browser.js +2 -1
  17. package/dist/safe-bash/chunks/{chunk-RQCK77SC.js → chunk-BUYRKFW2.js} +9 -36
  18. package/dist/safe-bash/chunks/{chunk-SOFBGDXG.js → chunk-HHSOUC3Z.js} +32 -0
  19. package/dist/safe-bash/chunks/{chunk-WAZEELYB.js → chunk-TPG55BAQ.js} +10 -7
  20. package/dist/safe-bash/command-chunks/biff-3EFLKBAH-NYWZOYQS.js +4942 -0
  21. package/dist/safe-bash/command-chunks/{chunk-HEHGHIE2.js → chunk-22MOB45U.js} +6 -6
  22. package/dist/safe-bash/command-chunks/{chunk-6DEWZMOL.js → chunk-2CORNDGF.js} +2 -2
  23. package/dist/safe-bash/command-chunks/{chunk-62ZAHKFS.js → chunk-2VCKUNDZ.js} +130 -14
  24. package/dist/safe-bash/command-chunks/{chunk-6UHGIWFX.js → chunk-2ZFLMWOX.js} +1 -1
  25. package/dist/safe-bash/command-chunks/{chunk-HONWGFDA.js → chunk-33YCKZZX.js} +6 -6
  26. package/dist/safe-bash/command-chunks/{chunk-AXWPJRY6.js → chunk-36XGIPOG.js} +1 -1
  27. package/dist/safe-bash/command-chunks/{chunk-32ADKP5E.js → chunk-456PHA3L.js} +1 -1
  28. package/dist/safe-bash/command-chunks/{chunk-UJXP3T6R.js → chunk-4CKFNXRN.js} +1 -1
  29. package/dist/safe-bash/command-chunks/{chunk-5L6GHFRW.js → chunk-554Z6IKP.js} +2 -2
  30. package/dist/safe-bash/command-chunks/{chunk-ORZRWT62.js → chunk-56NYSX65.js} +9 -9
  31. package/dist/safe-bash/command-chunks/{chunk-53JP3S6H.js → chunk-5HPU7D36.js} +4 -4
  32. package/dist/safe-bash/command-chunks/{chunk-NB7JO7FE.js → chunk-5LI2DLNZ.js} +26 -26
  33. package/dist/safe-bash/command-chunks/{chunk-YJJBGN7U.js → chunk-5MB64DWR.js} +9 -9
  34. package/dist/safe-bash/command-chunks/{chunk-3ZWBBS6U.js → chunk-5OO2P27R.js} +340 -34
  35. package/dist/safe-bash/command-chunks/{chunk-IC5GJI7E.js → chunk-5Q22ZLNC.js} +6 -6
  36. package/dist/safe-bash/command-chunks/{chunk-YO3V5RLY.js → chunk-6CCQI6XZ.js} +12 -12
  37. package/dist/safe-bash/command-chunks/{chunk-EO2IVGV7.js → chunk-6M6TM5Z5.js} +3 -3
  38. package/dist/safe-bash/command-chunks/{chunk-Z54Z3KRN.js → chunk-6QBMND4A.js} +1 -1
  39. package/dist/safe-bash/command-chunks/{chunk-INX4JMQ6.js → chunk-6VPQ3CDZ.js} +5 -5
  40. package/dist/safe-bash/command-chunks/chunk-72C3TZ2U.js +826 -0
  41. package/dist/safe-bash/command-chunks/{chunk-VGXVN3BX.js → chunk-7GKKMNL6.js} +8 -8
  42. package/dist/safe-bash/command-chunks/{chunk-TZJC67W3.js → chunk-7PVHO47B.js} +6 -6
  43. package/dist/safe-bash/command-chunks/{chunk-CM3C7AXJ.js → chunk-A2CLZMQZ.js} +1 -1
  44. package/dist/safe-bash/command-chunks/{chunk-ASR27KHW.js → chunk-A5FZBR7X.js} +4 -4
  45. package/dist/safe-bash/command-chunks/{chunk-DMDHE5KC.js → chunk-AHA6IWAJ.js} +6 -6
  46. package/dist/safe-bash/command-chunks/{chunk-PTZ55XXN.js → chunk-APEWTWCC.js} +6 -6
  47. package/dist/safe-bash/command-chunks/{chunk-YUVH6CE4.js → chunk-ATTWQVR2.js} +17 -17
  48. package/dist/safe-bash/command-chunks/{chunk-JON5DB3Z.js → chunk-B5LDP7AA.js} +2 -2
  49. package/dist/safe-bash/command-chunks/{chunk-CHJL6JMU.js → chunk-COKYZUBW.js} +1 -1
  50. package/dist/safe-bash/command-chunks/{chunk-KCTV4NVX.js → chunk-CRV2Q3PB.js} +1 -1
  51. package/dist/safe-bash/command-chunks/{chunk-V3WXPCKN.js → chunk-CV7M2QJU.js} +7 -7
  52. package/dist/safe-bash/command-chunks/{chunk-D7XBUF76.js → chunk-D2ASPM7R.js} +109 -23
  53. package/dist/safe-bash/command-chunks/{chunk-VPDSQPSN.js → chunk-DM2CPMB4.js} +2 -2
  54. package/dist/safe-bash/command-chunks/{chunk-3DTDMEOP.js → chunk-EAGIJ4VW.js} +1 -1
  55. package/dist/safe-bash/command-chunks/{chunk-WFDG3N5R.js → chunk-ECDEPKKW.js} +1 -1
  56. package/dist/safe-bash/command-chunks/{chunk-JW6CMBF2.js → chunk-EHSM5ZQS.js} +8 -8
  57. package/dist/safe-bash/command-chunks/{chunk-WIOH7ZQN.js → chunk-ENT3IV2G.js} +12 -12
  58. package/dist/safe-bash/command-chunks/{chunk-5IE4LJGB.js → chunk-EUT24Y5Z.js} +8 -8
  59. package/dist/safe-bash/command-chunks/{chunk-COKZFXHG.js → chunk-FIIAYCWS.js} +2 -2
  60. package/dist/safe-bash/command-chunks/{chunk-MWVFP2HY.js → chunk-GEM47B2P.js} +7 -7
  61. package/dist/safe-bash/command-chunks/{chunk-OQCJGUI6.js → chunk-HARUYHH7.js} +10 -10
  62. package/dist/safe-bash/command-chunks/{chunk-EHL6B34L.js → chunk-HDJVJTCK.js} +9 -9
  63. package/dist/safe-bash/command-chunks/{chunk-JMM3MNAY.js → chunk-HKATEVAP.js} +6 -6
  64. package/dist/safe-bash/command-chunks/{chunk-NVBUC644.js → chunk-HKGNBH7Z.js} +2 -2
  65. package/dist/safe-bash/command-chunks/{chunk-VWY3EAVQ.js → chunk-HTVIYLVB.js} +4 -4
  66. package/dist/safe-bash/command-chunks/{chunk-Z4QJMDK3.js → chunk-IT7TAC3F.js} +16 -16
  67. package/dist/safe-bash/command-chunks/{chunk-EWS4KYJE.js → chunk-JFYWVQ4V.js} +8 -8
  68. package/dist/safe-bash/command-chunks/{chunk-ZCX63QWA.js → chunk-JOCFI7TG.js} +1 -1
  69. package/dist/safe-bash/command-chunks/{chunk-F5WTH4O4.js → chunk-JQVHUSDD.js} +5 -5
  70. package/dist/safe-bash/command-chunks/{chunk-O4VJEGL6.js → chunk-K5GB2YMN.js} +10 -10
  71. package/dist/safe-bash/command-chunks/{chunk-27C3NT5V.js → chunk-KB7DUBVL.js} +5 -5
  72. package/dist/safe-bash/command-chunks/{chunk-4DZ32PI7.js → chunk-KCOJA7EM.js} +7 -7
  73. package/dist/safe-bash/command-chunks/{chunk-6OKH4X67.js → chunk-KJ4XXZIL.js} +273 -10
  74. package/dist/safe-bash/command-chunks/{chunk-GLVD3JJG.js → chunk-KL3OIBKB.js} +4712 -4654
  75. package/dist/safe-bash/command-chunks/{chunk-U6QHTC5J.js → chunk-L5MCW6CM.js} +4 -4
  76. package/dist/safe-bash/command-chunks/{chunk-LVL3A7YE.js → chunk-LCZDBW55.js} +5 -5
  77. package/dist/safe-bash/command-chunks/{chunk-DJVRDUCA.js → chunk-LXLLA4PM.js} +17 -17
  78. package/dist/safe-bash/command-chunks/{chunk-K7AGAS3K.js → chunk-M7QE2MN7.js} +6 -6
  79. package/dist/safe-bash/command-chunks/chunk-MGBHGZEX.js +12 -0
  80. package/dist/safe-bash/command-chunks/{chunk-SWT6ILF2.js → chunk-MPUHH2KR.js} +3 -3
  81. package/dist/safe-bash/command-chunks/{chunk-DC3OJLRB.js → chunk-NQDIT667.js} +5 -5
  82. package/dist/safe-bash/command-chunks/{chunk-LWZVDDJA.js → chunk-NUGQQDGE.js} +5 -1
  83. package/dist/safe-bash/command-chunks/{chunk-MFLQZLFR.js → chunk-OA75SGN2.js} +7 -7
  84. package/dist/safe-bash/command-chunks/{chunk-5LATYOF7.js → chunk-OEJM666F.js} +5 -5
  85. package/dist/safe-bash/command-chunks/{chunk-AF25YYIO.js → chunk-PMAM4N33.js} +9 -9
  86. package/dist/safe-bash/command-chunks/{chunk-4557HE3J.js → chunk-PMWW7KSB.js} +161 -42
  87. package/dist/safe-bash/command-chunks/{chunk-KMMAJ6H6.js → chunk-PNGDJA6M.js} +2 -2
  88. package/dist/safe-bash/command-chunks/{chunk-62BHPSKJ.js → chunk-Q6S57NOQ.js} +7 -7
  89. package/dist/safe-bash/command-chunks/{chunk-KJ3PEDI2.js → chunk-Q73EMLLZ.js} +146 -4
  90. package/dist/safe-bash/command-chunks/{chunk-FXKBM5KJ.js → chunk-QC5RMGSA.js} +3 -3
  91. package/dist/safe-bash/command-chunks/{chunk-UQ6UIZMM.js → chunk-QD7ZRDUN.js} +1 -1
  92. package/dist/safe-bash/command-chunks/{chunk-JHUYZZGV.js → chunk-QYMEASQ6.js} +4 -4
  93. package/dist/safe-bash/command-chunks/{chunk-3GY5VDIX.js → chunk-QZZ73J2O.js} +6 -6
  94. package/dist/safe-bash/command-chunks/{chunk-S2CYIGWH.js → chunk-R6EGGK5M.js} +7 -7
  95. package/dist/safe-bash/command-chunks/{chunk-7AVN3OBH.js → chunk-RHYJVTJO.js} +2 -2
  96. package/dist/safe-bash/command-chunks/{chunk-EWGDSO6U.js → chunk-RID6VYS3.js} +8 -8
  97. package/dist/safe-bash/command-chunks/{chunk-MMBRBANA.js → chunk-RNSKXOG3.js} +6 -6
  98. package/dist/safe-bash/command-chunks/{chunk-D3ZRZTY5.js → chunk-RQIQ75W5.js} +5 -5
  99. package/dist/safe-bash/command-chunks/{chunk-DWKQPLRT.js → chunk-RRL3Y562.js} +11 -11
  100. package/dist/safe-bash/command-chunks/{chunk-JW3KIZU6.js → chunk-RUXY7GN5.js} +1 -1
  101. package/dist/safe-bash/command-chunks/{chunk-NXCMXD74.js → chunk-S6R3IB36.js} +1 -1
  102. package/dist/safe-bash/command-chunks/{chunk-XUPKFHAQ.js → chunk-SDTPO2VV.js} +7 -7
  103. package/dist/safe-bash/command-chunks/{chunk-PIAGKRFW.js → chunk-SPLOIABU.js} +3 -3
  104. package/dist/safe-bash/command-chunks/{chunk-KELMIFVV.js → chunk-TI52LKLL.js} +1 -1
  105. package/dist/safe-bash/command-chunks/{chunk-WLTJDNSQ.js → chunk-TVH4JORU.js} +3 -3
  106. package/dist/safe-bash/command-chunks/{chunk-6XVMWFHD.js → chunk-TW73OXPR.js} +6 -6
  107. package/dist/safe-bash/command-chunks/{chunk-SFO43CID.js → chunk-UAXSE3XE.js} +5 -5
  108. package/dist/safe-bash/command-chunks/{chunk-K35BSUHO.js → chunk-UYWSIIUX.js} +7 -7
  109. package/dist/safe-bash/command-chunks/{chunk-JJQ72P3V.js → chunk-VCML4T5D.js} +1 -1
  110. package/dist/safe-bash/command-chunks/{chunk-DCD32BEY.js → chunk-VU3EQF7F.js} +91 -53
  111. package/dist/safe-bash/command-chunks/{chunk-2E2YEDVB.js → chunk-W5YSINXC.js} +6 -6
  112. package/dist/safe-bash/command-chunks/{chunk-EYNT4OEJ.js → chunk-WGG6G2KG.js} +7 -7
  113. package/dist/safe-bash/command-chunks/chunk-WH3TIOTS.js +326 -0
  114. package/dist/safe-bash/command-chunks/{chunk-DVQBZXMQ.js → chunk-WJCN2IXI.js} +2 -2
  115. package/dist/safe-bash/command-chunks/{chunk-45FI2IPY.js → chunk-WQ6ABTJU.js} +3 -6
  116. package/dist/safe-bash/command-chunks/{chunk-XBZ4ZWGL.js → chunk-WVMHRNXZ.js} +3 -3
  117. package/dist/safe-bash/command-chunks/{chunk-7GXUCQI4.js → chunk-WXRYDALR.js} +4 -4
  118. package/dist/safe-bash/command-chunks/{chunk-S4IIOSRA.js → chunk-X7FA7ZD5.js} +8 -8
  119. package/dist/safe-bash/command-chunks/{chunk-SFCERNHU.js → chunk-XPD636C4.js} +3 -3
  120. package/dist/safe-bash/command-chunks/{chunk-HYDWQLJ3.js → chunk-XRVKWGVQ.js} +6 -6
  121. package/dist/safe-bash/command-chunks/{chunk-3UJWHRK4.js → chunk-XVP6V5K3.js} +6 -6
  122. package/dist/safe-bash/command-chunks/{chunk-KTI3BULE.js → chunk-XZ2FWFNV.js} +6 -6
  123. package/dist/safe-bash/command-chunks/{chunk-QK3CHRGL.js → chunk-Y4EYCZFT.js} +10 -10
  124. package/dist/safe-bash/command-chunks/{chunk-GTWVMFBK.js → chunk-YORJDX4V.js} +4 -4
  125. package/dist/safe-bash/command-chunks/{chunk-H6F5SN2N.js → chunk-YSMNXMAO.js} +4 -4
  126. package/dist/safe-bash/command-chunks/{chunk-GKYCV6BU.js → chunk-YSY6R6AS.js} +493 -183
  127. package/dist/safe-bash/command-chunks/{chunk-SE5SJ4JT.js → chunk-Z2JW6M2D.js} +3 -3
  128. package/dist/safe-bash/command-chunks/{chunk-5HGEXQVD.js → chunk-ZHRGYR7B.js} +7 -7
  129. package/dist/safe-bash/command-chunks/{chunk-HQYFRQ5W.js → chunk-ZIIO6GRY.js} +7 -7
  130. package/dist/safe-bash/command-chunks/{chunk-NTRZMQZP.js → chunk-ZMHEGDU2.js} +2 -2
  131. package/dist/safe-bash/command-chunks/{chunk-EYBXHGA6.js → chunk-ZXR6LXV5.js} +2 -2
  132. package/dist/safe-bash/command-chunks/{command-engine-P5DFM4OU.js → command-engine-BEWABZ75.js} +10 -3
  133. package/dist/safe-bash/command-chunks/{engine-RU4OFLPO-CPLFYD67.js → engine-AXXFTGCL-QBQNBI6K.js} +1 -1
  134. package/dist/safe-bash/command-chunks/pdf-XHHFTOT4-UJJYOYJ2.js +573 -0
  135. package/dist/safe-bash/commands/audio/index.browser.js +2 -14
  136. package/dist/safe-bash/commands/diff-patch/index.js +0 -5
  137. package/dist/safe-bash/commands/diff3/index.js +0 -2
  138. package/dist/safe-bash/commands/ffprobe/index.browser.js +2 -5
  139. package/dist/safe-bash/commands/pandoc/index.browser.js +3 -1
  140. package/dist/safe-bash/commands/text.js +10 -1
  141. package/dist/safe-bash/core.d.ts +2 -2
  142. package/dist/safe-bash/core.js +2 -2
  143. package/dist/safe-bash/full-core.browser.js +18 -22
  144. package/dist/safe-bash/lazy-optional.d.ts +9 -0
  145. package/dist/safe-bash/lazy-optional.js +24 -0
  146. package/dist/safe-bash/plugins/index.browser.js +5 -3
  147. package/dist/safe-bash/plugins/index.js +3 -1
  148. package/dist/safe-bash/plugins/portable-commands.d.ts +1 -1
  149. package/dist/safe-bash/plugins/portable-commands.js +5 -3
  150. package/dist/safe-bash/registry-entry.browser.js +1 -1
  151. package/dist/safe-bash-command-apply-patch/apply.js +2 -2
  152. package/dist/safe-bash-command-apply-patch/index.js +2 -2
  153. package/dist/safe-bash-command-apply-patch/parser.d.ts +20 -1
  154. package/dist/safe-bash-command-apply-patch/parser.js +1 -1
  155. package/dist/safe-bash-command-diff/index.js +0 -2
  156. package/dist/safe-bash-command-diff3/index.js +830 -56
  157. package/dist/safe-bash-command-ffmpeg/index.js +1 -1
  158. package/dist/safe-bash-command-ffprobe/index.js +3 -2
  159. package/dist/safe-bash-command-ffprobe/media.js +3 -2
  160. package/dist/safe-bash-command-ffprobe/options.d.ts +15 -0
  161. package/dist/safe-bash-command-ffprobe/options.js +7 -0
  162. package/dist/safe-bash-command-html-to-markdown/index.js +75 -21
  163. package/dist/safe-bash-command-media/index.js +2 -2
  164. package/dist/safe-bash-command-media/plugin.js +1 -1
  165. package/dist/safe-bash-command-media/remote.js +2 -2
  166. package/dist/safe-bash-command-pandoc/command.js +8 -8
  167. package/dist/safe-bash-command-pandoc/execution.d.ts +2 -2
  168. package/dist/safe-bash-command-pandoc/index.d.ts +1 -1
  169. package/dist/safe-bash-command-pandoc/index.js +37 -37
  170. package/dist/safe-bash-command-pandoc/lua-filters.js +2 -2
  171. package/dist/safe-bash-command-pandoc/types.d.ts +17 -2
  172. package/dist/safe-bash-command-patch/index.js +2 -2
  173. package/dist/safe-bash-command-patch/patch-publication.d.ts +2 -2
  174. package/dist/safe-bash-command-patch/patch-publication.js +1 -1
  175. package/dist/safe-bash-command-patch/patch.js +2 -2
  176. package/dist/safe-bash-command-pdftk/index.js +616 -265
  177. package/dist/safe-bash-command-pptx/engine.js +1 -1
  178. package/dist/safe-bash-command-qpdf/index.js +115 -9
  179. package/dist/safe-bash-command-soffice/index.js +1 -1
  180. package/dist/safe-bash-command-ssconvert/index.js +2 -2
  181. package/dist/safe-bash-command-xmllint/index.js +137 -30
  182. package/dist/safe-bash-command-xq/index.js +45 -29
  183. package/dist/safe-bash-compression-engine/bounded-codec.js +2 -2
  184. package/dist/safe-bash-compression-engine/codec-loader.js +1 -1
  185. package/dist/safe-bash-compression-engine/files.js +5 -5
  186. package/dist/safe-bash-compression-engine/index.js +4 -4
  187. package/dist/safe-bash-compression-engine/operand.js +5 -5
  188. package/dist/safe-bash-compression-engine/stream.js +4 -4
  189. package/dist/safe-bash-compression-engine/zstd-decode.js +3 -3
  190. package/dist/safe-bash-media-engine/imagemagick.d.ts +2 -0
  191. package/dist/safe-bash-media-engine/index.js +162 -72
  192. package/dist/safe-bash-network-engine/body.d.ts +1 -0
  193. package/dist/safe-bash-network-engine/body.js +1 -1
  194. package/dist/safe-bash-network-engine/transfer.js +11 -3
  195. package/dist/safe-bash-presentation-engine/accessibility.js +30 -30
  196. package/dist/safe-bash-presentation-engine/animation-editing.js +15 -15
  197. package/dist/safe-bash-presentation-engine/animations.js +15 -15
  198. package/dist/safe-bash-presentation-engine/backgrounds.js +16 -16
  199. package/dist/safe-bash-presentation-engine/bytes.js +3 -3
  200. package/dist/safe-bash-presentation-engine/chart-editing.js +33 -33
  201. package/dist/safe-bash-presentation-engine/chart-object-operations.js +24 -24
  202. package/dist/safe-bash-presentation-engine/charts.js +30 -30
  203. package/dist/safe-bash-presentation-engine/command-placeholder.js +55 -54
  204. package/dist/safe-bash-presentation-engine/comments.js +16 -16
  205. package/dist/safe-bash-presentation-engine/connector-operations.js +31 -31
  206. package/dist/safe-bash-presentation-engine/connectors.js +28 -28
  207. package/dist/safe-bash-presentation-engine/content-types.js +4 -4
  208. package/dist/safe-bash-presentation-engine/creation.js +6 -6
  209. package/dist/safe-bash-presentation-engine/diff.js +31 -31
  210. package/dist/safe-bash-presentation-engine/drawing-format.js +19 -19
  211. package/dist/safe-bash-presentation-engine/drawing-operations.js +30 -30
  212. package/dist/safe-bash-presentation-engine/drawing-schema.js +20 -20
  213. package/dist/safe-bash-presentation-engine/equations.js +16 -16
  214. package/dist/safe-bash-presentation-engine/errors.js +2 -2
  215. package/dist/safe-bash-presentation-engine/fields.js +16 -16
  216. package/dist/safe-bash-presentation-engine/font-metrics.js +3 -3
  217. package/dist/safe-bash-presentation-engine/image-extraction.js +19 -19
  218. package/dist/safe-bash-presentation-engine/image-formatting.js +31 -31
  219. package/dist/safe-bash-presentation-engine/image-insertion.js +17 -17
  220. package/dist/safe-bash-presentation-engine/image-replacement.js +20 -20
  221. package/dist/safe-bash-presentation-engine/image-value.js +4 -4
  222. package/dist/safe-bash-presentation-engine/images.js +18 -18
  223. package/dist/safe-bash-presentation-engine/index.d.ts +2 -2
  224. package/dist/safe-bash-presentation-engine/index.js +100 -93
  225. package/dist/safe-bash-presentation-engine/layouts.js +15 -15
  226. package/dist/safe-bash-presentation-engine/length.js +3 -3
  227. package/dist/safe-bash-presentation-engine/links.js +15 -15
  228. package/dist/safe-bash-presentation-engine/masters.js +14 -14
  229. package/dist/safe-bash-presentation-engine/media-editing.js +23 -23
  230. package/dist/safe-bash-presentation-engine/media-extraction.js +16 -16
  231. package/dist/safe-bash-presentation-engine/media.js +15 -15
  232. package/dist/safe-bash-presentation-engine/memberships.js +14 -14
  233. package/dist/safe-bash-presentation-engine/notes.js +15 -15
  234. package/dist/safe-bash-presentation-engine/ole-enum.js +4 -4
  235. package/dist/safe-bash-presentation-engine/ole-insertion.js +19 -19
  236. package/dist/safe-bash-presentation-engine/opaque-objects.js +9 -9
  237. package/dist/safe-bash-presentation-engine/package-reader.js +5 -5
  238. package/dist/safe-bash-presentation-engine/package-tools.js +15 -15
  239. package/dist/safe-bash-presentation-engine/package-uri.js +3 -3
  240. package/dist/safe-bash-presentation-engine/package-writer.js +4 -4
  241. package/dist/safe-bash-presentation-engine/presentation-model.js +54 -53
  242. package/dist/safe-bash-presentation-engine/presentation-settings.js +13 -13
  243. package/dist/safe-bash-presentation-engine/properties.js +15 -15
  244. package/dist/safe-bash-presentation-engine/relationships.js +4 -4
  245. package/dist/safe-bash-presentation-engine/resource-limits.js +1 -1
  246. package/dist/safe-bash-presentation-engine/retained-inspection.js +12 -12
  247. package/dist/safe-bash-presentation-engine/retained-package.js +4 -4
  248. package/dist/safe-bash-presentation-engine/retained-slide-settings.d.ts +15 -0
  249. package/dist/safe-bash-presentation-engine/retained-text.js +19 -19
  250. package/dist/safe-bash-presentation-engine/retained-xml-parts.d.ts +26 -0
  251. package/dist/safe-bash-presentation-engine/sanitize.js +16 -16
  252. package/dist/safe-bash-presentation-engine/selectors.js +10 -10
  253. package/dist/safe-bash-presentation-engine/shape-groups.js +30 -30
  254. package/dist/safe-bash-presentation-engine/shape-operations.js +29 -29
  255. package/dist/safe-bash-presentation-engine/shape-path-operations.js +31 -31
  256. package/dist/safe-bash-presentation-engine/shape-paths.js +15 -15
  257. package/dist/safe-bash-presentation-engine/shape-presets.js +3 -3
  258. package/dist/safe-bash-presentation-engine/shape-selection.js +30 -30
  259. package/dist/safe-bash-presentation-engine/shape-transforms.js +17 -17
  260. package/dist/safe-bash-presentation-engine/shapes.js +26 -26
  261. package/dist/safe-bash-presentation-engine/slide-copy.js +16 -16
  262. package/dist/safe-bash-presentation-engine/slide-import.js +17 -17
  263. package/dist/safe-bash-presentation-engine/slide-merge-split.js +19 -19
  264. package/dist/safe-bash-presentation-engine/slide-model.js +42 -42
  265. package/dist/safe-bash-presentation-engine/slide-removal.js +17 -17
  266. package/dist/safe-bash-presentation-engine/slide-transfer-budget.js +9 -9
  267. package/dist/safe-bash-presentation-engine/slides.d.ts +2 -0
  268. package/dist/safe-bash-presentation-engine/slides.js +21 -16
  269. package/dist/safe-bash-presentation-engine/table-operations.js +32 -32
  270. package/dist/safe-bash-presentation-engine/table-spans.js +31 -31
  271. package/dist/safe-bash-presentation-engine/tables.js +30 -30
  272. package/dist/safe-bash-presentation-engine/tags.js +15 -15
  273. package/dist/safe-bash-presentation-engine/template-bindings.js +32 -32
  274. package/dist/safe-bash-presentation-engine/template-repeat.js +39 -39
  275. package/dist/safe-bash-presentation-engine/text-fitting.js +26 -26
  276. package/dist/safe-bash-presentation-engine/text-frames.js +26 -26
  277. package/dist/safe-bash-presentation-engine/text-paragraphs.js +26 -26
  278. package/dist/safe-bash-presentation-engine/text-reading.js +11 -11
  279. package/dist/safe-bash-presentation-engine/text-replacement.js +16 -16
  280. package/dist/safe-bash-presentation-engine/text-runs.js +19 -19
  281. package/dist/safe-bash-presentation-engine/themes.js +15 -15
  282. package/dist/safe-bash-presentation-engine/transitions.js +15 -15
  283. package/dist/safe-bash-presentation-engine/validation.js +9 -9
  284. package/dist/safe-bash-presentation-engine/xml-parts.d.ts +1 -0
  285. package/dist/safe-bash-presentation-engine/xml-parts.js +19 -13
  286. package/dist/safe-bash-presentation-engine/xml-view.js +3 -3
  287. package/dist/safe-bash-presentation-engine/xml.js +3 -3
  288. package/dist/safe-bash-xml-engine/document.js +1 -1
  289. package/dist/safe-bash-xml-engine/index.js +1 -1
  290. package/dist/safe-bash-xml-engine/json.d.ts +1 -0
  291. package/dist/safe-bash-xml-engine/json.js +203 -0
  292. package/dist/safe-bash-xml-engine/stored-json.d.ts +5 -0
  293. package/dist/spreadsheet-engine/rendering/print/bidi-runs.d.ts +5 -0
  294. package/dist/spreadsheet-engine/rendering/print/bidi-runs.js +35 -0
  295. package/dist/spreadsheet-engine/rendering/print/control-bidi.d.ts +8 -0
  296. package/dist/spreadsheet-engine/rendering/print/control-bidi.js +80 -0
  297. package/dist/spreadsheet-engine/rendering/print/tab-layout.d.ts +11 -0
  298. package/dist/spreadsheet-engine/rendering/print/tab-layout.js +15 -0
  299. package/dist/spreadsheet-engine/rendering/print/text-lines.d.ts +2 -2
  300. package/dist/spreadsheet-engine/rendering/print/text-lines.js +3 -3
  301. package/dist/spreadsheet-format-xls/biff-encrypted-properties.d.ts +5 -1
  302. package/dist/spreadsheet-format-xls/biff-encrypted-properties.js +151 -57
  303. package/dist/spreadsheet-format-xls/biff-encryption.d.ts +1 -1
  304. package/dist/spreadsheet-format-xls/biff-encryption.js +8 -3
  305. package/dist/spreadsheet-format-xls/biff-property-bytes.d.ts +4 -1
  306. package/dist/spreadsheet-format-xls/biff-property-bytes.js +3 -3
  307. package/dist/spreadsheet-format-xls/biff-range.js +1 -1
  308. package/dist/spreadsheet-format-xls/biff.js +11 -3
  309. package/package.json +6 -2
  310. package/dist/safe-bash/chunks/chunk-I2A5ZCPD.js +0 -17
  311. package/dist/safe-bash/chunks/chunk-PQTT2EZP.js +0 -8
  312. package/dist/safe-bash/command-chunks/biff-DS263V2K-2GP4GZT7.js +0 -4868
  313. package/dist/safe-bash/command-chunks/chunk-6ZFYWT3U.js +0 -581
  314. package/dist/safe-bash/command-chunks/chunk-S244SWDH.js +0 -153
  315. package/dist/safe-bash/command-chunks/pdf-T7AWYZGQ-KNAYJ7YF.js +0 -552
  316. /package/dist/safe-bash/command-chunks/{chunk-EMMSXKEJ.js → chunk-4Q4R3VZU.js} +0 -0
@@ -27,7 +27,7 @@ function createPptxCommandEngine(settings = {}) {
27
27
  };
28
28
  return Object.freeze({
29
29
  async execute(request) {
30
- const mod = await (cachedPptxEngineMod ??= import("../safe-bash/command-chunks/command-engine-P5DFM4OU.js"));
30
+ const mod = await (cachedPptxEngineMod ??= import("../safe-bash/command-chunks/command-engine-BEWABZ75.js"));
31
31
  return mod.createPptxCommandEngine(ownedSettings).execute(request);
32
32
  }
33
33
  });
@@ -244,6 +244,65 @@ function* encodeDisplayParts(parts, signal) {
244
244
  if (used) yield buffer.subarray(0, used);
245
245
  }
246
246
 
247
+ // packages/safe-bash-command-qpdf/src/json-input.ts
248
+ var JsonSyntaxFailure = class extends Error {
249
+ constructor(details) {
250
+ super(details[1]);
251
+ this.details = details;
252
+ }
253
+ details;
254
+ };
255
+ async function syntaxMessage(source, failure, signal) {
256
+ const [offset, message, , state] = failure.details;
257
+ let length = 0, line = 1, column = 1, previous = "", prefix = "", window = "", character = "";
258
+ const decoder = new TextDecoder();
259
+ const accept = (text) => {
260
+ for (let index = 0; index < text.length; index++) {
261
+ const char = text[index];
262
+ if (length < 20) prefix += char;
263
+ if (length >= Math.max(0, offset - 10) && length < offset + 10) window += char;
264
+ if (length === offset) character = char;
265
+ if (length < offset) {
266
+ if (char === "\r" || char === "\n" && previous !== "\r") {
267
+ line++;
268
+ column = 1;
269
+ } else if (char !== "\n" || previous !== "\r") column++;
270
+ previous = char;
271
+ }
272
+ length++;
273
+ }
274
+ };
275
+ for await (const bytes of source.stream(0, source.size, signal)) accept(decoder.decode(bytes, { stream: true }));
276
+ accept(decoder.decode());
277
+ const at = (stem) => `${stem} at position ${offset} (line ${line} column ${column})`;
278
+ if (message === "Invalid JSON Unicode escape" || state?.token === "string" && state.hex) return at("Bad Unicode escape in JSON");
279
+ if (message === "Invalid JSON escape") return at("Bad escaped character in JSON");
280
+ if (message === "Invalid JSON string control") return at("Bad control character in string literal in JSON");
281
+ if (message === "Incomplete JSON number") return at(state?.number === "minus" ? "No number after minus sign in JSON" : state?.number === "dot" ? "Unterminated fractional number in JSON" : "Exponent part is missing a number in JSON");
282
+ if (state?.number === "zero" && previous === "0" && character >= "0" && character <= "9") return at("Unexpected number in JSON");
283
+ if (message === "Unexpected trailing JSON") return at("Unexpected non-whitespace character after JSON");
284
+ if (message === "Expected JSON colon" || !state?.token && state?.mode === "colon") return at("Expected ':' after property name in JSON");
285
+ if (message === "Expected JSON comma") return at(state?.container === "array" ? "Expected ',' or ']' after array element in JSON" : "Expected ',' or '}' after property value in JSON");
286
+ if (!state?.token && (state?.mode === "key" || state?.mode === "keyFirst")) return at(state.mode === "key" ? "Expected double-quoted property name in JSON" : "Expected property name or '}' in JSON");
287
+ if (length === offset) {
288
+ if (state?.token === "string" && !state.escape) return at("Unterminated string in JSON");
289
+ return "Unexpected end of JSON input";
290
+ }
291
+ if (length <= 20 && ["undefined", "NaN", "Infinity", "[object Object]"].includes(prefix)) return `"${prefix}" is not valid JSON`;
292
+ const excerpt = length <= 20 ? `"${prefix}"` : `${offset >= 10 ? "..." : ""}"${window}"${offset + 10 < length ? "..." : ""}`;
293
+ return `Unexpected token '${character}', ${excerpt} is not valid JSON`;
294
+ }
295
+ async function applyJsonInput(owner, source, options, signal) {
296
+ try {
297
+ await owner.apply(source.stream(0, source.size, signal), { ...options, syntaxError: (...details) => {
298
+ throw new JsonSyntaxFailure(details);
299
+ } });
300
+ } catch (error) {
301
+ if (error instanceof JsonSyntaxFailure) throw new SyntaxError(await syntaxMessage(source, error, signal));
302
+ throw error;
303
+ }
304
+ }
305
+
247
306
  // packages/safe-bash-command-qpdf/src/json.ts
248
307
  import { IntegerTable as IntegerTable4, PagedStorage as PagedStorage4 } from "@poe-platform/safe-fs/storage";
249
308
  import { PdfError as PdfError2, PdfFileSource, PdfMutableObjectStore as PdfMutableObjectStore2, PdfStagedOutputs, cosArray, cosDict, cosNumber, cosString, decodePdfString as decodePdfString4, dictGet as dictGet2 } from "../pdf-ast/index.js";
@@ -1116,7 +1175,7 @@ async function* pageDisplayParts(document, storage, highest, withImages, signal)
1116
1175
  }
1117
1176
 
1118
1177
  // packages/safe-bash-command-qpdf/src/retained.ts
1119
- import { encryptRetainedPdfChunks, copyRetainedAttachments, editRetainedDocument, PdfDuplicateAttachment, PdfError as PdfError5, PdfFileSource as PdfFileSource2, PdfRetainedDocument as PdfRetainedDocument2, PdfStagedOutputs as PdfStagedOutputs2, saveRetainedDocumentChunks, retainedCosObjects as retainedCosObjects2, serializeRetainedCosDocumentChunks, cosArray as cosArray2, cosDict as cosDict4, cosName, cosNumber as cosNumber2, cosRef, cosString as cosString2, dictGet as dictGet6 } from "../pdf-ast/index.js";
1178
+ import { QpdfJsonDocument, encryptRetainedPdfChunks, copyRetainedAttachments, editRetainedDocument, PdfDuplicateAttachment, PdfError as PdfError5, PdfFileSource as PdfFileSource2, PdfRetainedDocument as PdfRetainedDocument2, PdfStagedOutputs as PdfStagedOutputs2, saveRetainedDocumentChunks, retainedCosObjects as retainedCosObjects2, serializeRetainedCosDocumentChunks, cosArray as cosArray2, cosDict as cosDict4, cosName, cosNumber as cosNumber2, cosRef, cosString as cosString2, dictGet as dictGet6 } from "../pdf-ast/index.js";
1120
1179
  import { FsError } from "../safe-bash-contracts/errors.js";
1121
1180
  import { writeBytes } from "../safe-bash-contracts/io.js";
1122
1181
  import { resolvePath } from "../safe-bash-contracts/path.js";
@@ -1131,6 +1190,8 @@ async function executeRetainedQpdf(context, options, limits, signal, inputBytes
1131
1190
  const storage = { fs: context.fs, directory: resolvePath(context.cwd, context.env.TMPDIR || "/tmp") };
1132
1191
  const inputs = /* @__PURE__ */ new Map();
1133
1192
  let source, document, output, failed = false;
1193
+ const rebuilt = [];
1194
+ let jsonDocument;
1134
1195
  let splitOutputs;
1135
1196
  let jsonOutput;
1136
1197
  let selectionGraph;
@@ -1150,9 +1211,8 @@ async function executeRetainedQpdf(context, options, limits, signal, inputBytes
1150
1211
  try {
1151
1212
  await context.fs.mkdir(storage.directory, { recursive: true, signal });
1152
1213
  const maximum = Math.min(limits.maxInputBytes, context.inputBudget?.maxBytes ?? Infinity);
1153
- for (const candidate of /* @__PURE__ */ new Set([inputName, ...options.pageSpecs.map((spec) => spec.file), ...options.addAttachmentSpecs.map((spec) => spec.file), ...options.copyAttachmentsSpecs.map((spec) => spec.file), ...options.stampSpecs.map((spec) => spec.file)])) {
1154
- signal.throwIfAborted();
1155
- if (!candidate || candidate === "." || candidate === "-") continue;
1214
+ const acquire = async (candidate) => {
1215
+ if (inputs.has(candidate)) return inputs.get(candidate);
1156
1216
  let acquired;
1157
1217
  try {
1158
1218
  acquired = await PdfFileSource2.open(context.fs, resolvePath(context.cwd, candidate), { signal, maxInputBytes: maximum - inputBytes });
@@ -1160,15 +1220,31 @@ async function executeRetainedQpdf(context, options, limits, signal, inputBytes
1160
1220
  signal.throwIfAborted();
1161
1221
  if (error instanceof Error && "code" in error && ["ENOENT", "ENOTDIR", "EACCES", "EISDIR"].includes(String(error.code)) || error instanceof PdfError5 && error.message === "PDF source must be a regular file") {
1162
1222
  inputs.set(candidate, void 0);
1163
- continue;
1223
+ return void 0;
1164
1224
  }
1165
1225
  throw error;
1166
1226
  }
1167
1227
  inputs.set(candidate, acquired);
1168
1228
  inputBytes += acquired.size;
1169
1229
  context.inputBudget?.check(inputBytes);
1230
+ return acquired;
1231
+ };
1232
+ const reconstruct = async () => {
1233
+ const next = await PdfFileSource2.fromStream(context.fs, storage.directory, jsonDocument.chunks(), { signal });
1234
+ rebuilt.push(next);
1235
+ await document?.close();
1236
+ document = void 0;
1237
+ source = next;
1238
+ document = await PdfRetainedDocument2.open(next, storage, { signal, recovery: "strict" });
1239
+ await jsonDocument.close();
1240
+ jsonDocument = void 0;
1241
+ };
1242
+ for (const candidate of /* @__PURE__ */ new Set([inputName, ...options.updateFromJsonFiles, ...options.pageSpecs.map((spec) => spec.file), ...options.addAttachmentSpecs.map((spec) => spec.file), ...options.copyAttachmentsSpecs.map((spec) => spec.file), ...options.stampSpecs.map((spec) => spec.file)])) {
1243
+ signal.throwIfAborted();
1244
+ if (!candidate || candidate === "." || candidate === "-") continue;
1245
+ await acquire(candidate);
1170
1246
  }
1171
- if (inputName === "-" || [...options.pageSpecs, ...options.addAttachmentSpecs, ...options.copyAttachmentsSpecs, ...options.stampSpecs].some((spec) => spec.file === "-")) {
1247
+ if (inputName === "-" || options.updateFromJsonFiles.includes("-") || [...options.pageSpecs, ...options.addAttachmentSpecs, ...options.copyAttachmentsSpecs, ...options.stampSpecs].some((spec) => spec.file === "-")) {
1172
1248
  const acquired = await PdfFileSource2.fromStream(context.fs, storage.directory, context.stdin, { signal, maxInputBytes: maximum - inputBytes });
1173
1249
  inputs.set("-", acquired);
1174
1250
  inputBytes += acquired.size;
@@ -1182,6 +1258,7 @@ async function executeRetainedQpdf(context, options, limits, signal, inputBytes
1182
1258
  infoRef: cosRef(3),
1183
1259
  signal
1184
1260
  }, storage), { signal });
1261
+ rebuilt.push(source);
1185
1262
  } else {
1186
1263
  if (!inputName) return await diagnostic("qpdf: an input file is required\n");
1187
1264
  source = inputs.get(inputName);
@@ -1215,14 +1292,43 @@ async function executeRetainedQpdf(context, options, limits, signal, inputBytes
1215
1292
  throw error;
1216
1293
  }
1217
1294
  }
1295
+ if (options.jsonInput && !useEmpty) {
1296
+ jsonDocument = new QpdfJsonDocument(storage, { signal });
1297
+ try {
1298
+ await applyJsonInput(jsonDocument, source, { dataFile: acquire }, signal);
1299
+ await reconstruct();
1300
+ } catch (error) {
1301
+ signal.throwIfAborted();
1302
+ if (error instanceof RangeError || error instanceof PdfError5 && error.code === "E_LIMIT" || error instanceof FsError) throw error;
1303
+ return await diagnostic(`qpdf: ${inputName}: ${error instanceof Error ? error.message : String(error)}
1304
+ `);
1305
+ }
1306
+ }
1218
1307
  try {
1219
- document = await PdfRetainedDocument2.open(source, storage, { signal, recovery: "repair", ...options.password === void 0 ? {} : { password: options.password } });
1308
+ document ??= await PdfRetainedDocument2.open(source, storage, { signal, recovery: "repair", ...options.password === void 0 ? {} : { password: options.password } });
1220
1309
  } catch (error) {
1221
1310
  signal.throwIfAborted();
1222
1311
  if (!(error instanceof PdfError5) || error.code === "E_LIMIT" || error.code === "E_CAPABILITY" && error.message !== "Invalid PDF password") throw error;
1223
1312
  return await diagnostic(`qpdf: ${inputName}: ${error.message}
1224
1313
  `);
1225
1314
  }
1315
+ if (options.updateFromJsonFiles.length) {
1316
+ jsonDocument = await QpdfJsonDocument.fromDocument(document, source, storage, { signal });
1317
+ for (const path of options.updateFromJsonFiles) {
1318
+ const update = inputs.get(path);
1319
+ if (!update) return await diagnostic(`qpdf: cannot open ${path}
1320
+ `);
1321
+ try {
1322
+ await applyJsonInput(jsonDocument, update, { dataFile: acquire }, signal);
1323
+ } catch (error) {
1324
+ signal.throwIfAborted();
1325
+ if (error instanceof RangeError || error instanceof PdfError5 && error.code === "E_LIMIT" || error instanceof FsError) throw error;
1326
+ return await diagnostic(`qpdf: ${path}: ${error instanceof Error ? error.message : String(error)}
1327
+ `);
1328
+ }
1329
+ }
1330
+ await reconstruct();
1331
+ }
1226
1332
  if (options.showLinearization || options.check || options.showNpages || options.showEncryption || options.showObject || options.showPages || options.showXref || options.listAttachments || options.showAttachmentKey !== void 0) {
1227
1333
  let count = 0, linearized = false, highest = 0, inlineCount = 0;
1228
1334
  let inlinePage, selectedValue, selectedLength;
@@ -1550,7 +1656,7 @@ extract for accessibility: ${encryption.permissions.copy ? "allowed" : "not allo
1550
1656
  if (error instanceof QpdfMissingInput || error instanceof QpdfMissingAttachment) return await diagnostic(error.message);
1551
1657
  throw error;
1552
1658
  } finally {
1553
- const results = await Promise.allSettled([jsonOutput?.close(), splitOutputs?.close(), editedGraph?.close(), document?.close(), selectionGraph?.close(), ...[.../* @__PURE__ */ new Set([...inputs.values(), source, output])].map((input) => input?.close())]);
1659
+ const results = await Promise.allSettled([jsonDocument?.close(), jsonOutput?.close(), splitOutputs?.close(), editedGraph?.close(), document?.close(), selectionGraph?.close(), ...[.../* @__PURE__ */ new Set([...inputs.values(), ...rebuilt, source, output])].map((input) => input?.close())]);
1554
1660
  if (!failed) {
1555
1661
  for (const result of results) if (result.status === "rejected") await Promise.reject(result.reason);
1556
1662
  }
@@ -3889,7 +3995,7 @@ async function qpdf(context, options = {}) {
3889
3995
  if (parsed.options) {
3890
3996
  const defaults = parseQpdfArguments([]).options;
3891
3997
  const retained = Object.entries(parsed.options).every(([key, value]) => {
3892
- if (["inputFile", "outputFile", "password", "replaceInput", "warningExit0", "decrypt", "check", "showNpages", "showEncryption", "showObject", "rawStreamData", "filteredStreamData", "isEncrypted", "requiresPassword", "showPages", "withImages", "showXref", "removeInfo", "removeMetadata", "removeStructure", "removeAcroform", "removePageLabels", "emptyInput", "pageSpecs", "collateCount", "listAttachments", "showAttachmentKey", "showLinearization", "rotateSpecs", "splitPagesGroup", "linearize", "objectStreamsMode", "qdf", "normalizeContentFlag", "streamDataMode", "pageLabelSpecs", "jsonVersion", "jsonKeys", "jsonObjectSelectors", "jsonStreamDataMode", "jsonStreamPrefix", "removeAttachmentKeys", "addAttachmentSpecs", "copyAttachmentsSpecs", "flattenRotation", "encryptConfig", "removeUnreferencedResources", "externalizeInlineImages", "iiMinBytes", "stampSpecs", "flattenAnnotations", "generateAppearances"].includes(key)) return true;
3998
+ if (["inputFile", "outputFile", "password", "replaceInput", "warningExit0", "decrypt", "check", "showNpages", "showEncryption", "showObject", "rawStreamData", "filteredStreamData", "isEncrypted", "requiresPassword", "showPages", "withImages", "showXref", "removeInfo", "removeMetadata", "removeStructure", "removeAcroform", "removePageLabels", "emptyInput", "pageSpecs", "collateCount", "listAttachments", "showAttachmentKey", "showLinearization", "rotateSpecs", "splitPagesGroup", "linearize", "objectStreamsMode", "qdf", "normalizeContentFlag", "streamDataMode", "pageLabelSpecs", "jsonVersion", "jsonKeys", "jsonObjectSelectors", "jsonStreamDataMode", "jsonStreamPrefix", "removeAttachmentKeys", "addAttachmentSpecs", "copyAttachmentsSpecs", "flattenRotation", "encryptConfig", "removeUnreferencedResources", "externalizeInlineImages", "iiMinBytes", "stampSpecs", "flattenAnnotations", "generateAppearances", "jsonInput", "updateFromJsonFiles"].includes(key)) return true;
3893
3999
  const baseline = defaults[key];
3894
4000
  return Array.isArray(value) ? value.length === 0 : value === baseline;
3895
4001
  });
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  openRetainedXml,
3
3
  resolveOfficeResources
4
- } from "../safe-bash/command-chunks/chunk-KJ3PEDI2.js";
4
+ } from "../safe-bash/command-chunks/chunk-Q73EMLLZ.js";
5
5
  import "../safe-bash/command-chunks/chunk-37XCUS43.js";
6
6
  import {
7
7
  createStoredZipArchive,
@@ -10,7 +10,7 @@ import {
10
10
  gt,
11
11
  j,
12
12
  oe
13
- } from "../safe-bash/command-chunks/chunk-YJJBGN7U.js";
13
+ } from "../safe-bash/command-chunks/chunk-5MB64DWR.js";
14
14
  import {
15
15
  a,
16
16
  g,
@@ -719,7 +719,7 @@ var le;
719
719
  function wr(...u) {
720
720
  return le ??= V({ read: readZipArchiveEntries, write: createStoredZipArchive }), le(...u);
721
721
  }
722
- var H = de(async (u) => (await import("../safe-bash/command-chunks/engine-RU4OFLPO-CPLFYD67.js")).createEngine(u), true, wr);
722
+ var H = de(async (u) => (await import("../safe-bash/command-chunks/engine-AXXFTGCL-QBQNBI6K.js")).createEngine(u), true, wr);
723
723
  var Do = H.createSsconvertCommand;
724
724
  var To = H.createSsconvertCommands;
725
725
  var Uo = H.ssconvertCommands;
@@ -6,13 +6,125 @@ import { createXqCommand } from "../safe-bash-command-xq/index.js";
6
6
  import { readXmlChunks, readXmlInput } from "../safe-bash-xml-engine/io.js";
7
7
  import { parseXmlStream, parseXmlSteps, XmlLimitError } from "@poe-platform/safe-fs/core";
8
8
  import {
9
- FsError,
9
+ FsError as FsError2,
10
10
  getCommandArguments,
11
11
  writeBytes
12
12
  } from "../safe-bash-contracts/index.js";
13
13
  import { StoredXPath } from "../safe-bash-xml-engine/stored-evaluate.js";
14
14
  import { StoredXmlDocument } from "../safe-bash-xml-engine/stored-document.js";
15
- import { writeFileOutput } from "../safe-bash-contracts/filesystem-output.js";
15
+
16
+ // packages/safe-bash-command-xmllint/src/file-output.ts
17
+ import { FsError } from "@poe-platform/safe-fs/core";
18
+ import { PagedStorage } from "@poe-platform/safe-fs/storage";
19
+ import { openFileOutput, writeFileOutput } from "../safe-bash-contracts/filesystem-output.js";
20
+ var XmlFileOutput = class {
21
+ constructor(context, path) {
22
+ this.context = context;
23
+ this.path = path;
24
+ context.registerCleanup?.(() => this.close());
25
+ }
26
+ context;
27
+ path;
28
+ staging;
29
+ resolution;
30
+ storage;
31
+ start = 0;
32
+ size = 0;
33
+ closing;
34
+ initialized;
35
+ active;
36
+ async initialize() {
37
+ const { fs, signal } = this.context;
38
+ signal.throwIfAborted();
39
+ const capabilities = await fs.capabilitiesFor?.(this.path, { signal, stagingResolution: true, followFinalSymlink: true }) ?? fs.capabilities;
40
+ if (capabilities.synchronousFollowedStagingResolution && capabilities.guardedStagingPublication && capabilities.atomicFileStaging && capabilities.atomicStagedFileMutation && capabilities.atomicStagingAncestry && capabilities.retainedStagingWrite && capabilities.retainedStagingCleanup && fs.prepareStagingResolution && fs.createStagedFile && fs.publishStagedFile) {
41
+ this.resolution = await fs.prepareStagingResolution(this.path, { signal, followFinalSymlink: true });
42
+ const target = this.resolution;
43
+ target.validate();
44
+ this.staging = await fs.createStagedFile(`${target.ancestors.at(-1).path === "/" ? "" : target.ancestors.at(-1).path}/.xmllint-${crypto.randomUUID()}`, "output", {
45
+ type: "file",
46
+ data: new Uint8Array()
47
+ }, { parent: target.parent, mode: target.destination ? target.destination.mode & 4095 : 438, retainCleanup: true, signal });
48
+ signal.throwIfAborted();
49
+ if (!this.staging.writer || !this.staging.cleanup) throw new FsError("ENOTSUP", { path: this.path, message: "XML output requires retained staging handles" });
50
+ } else {
51
+ this.storage = new PagedStorage(this.context, 4);
52
+ this.start = this.storage.allocate(0);
53
+ }
54
+ }
55
+ write(bytes) {
56
+ if (this.closing) return Promise.reject(new FsError("EBADF", { path: this.path }));
57
+ const task = (async () => {
58
+ await (this.initialized ??= this.initialize());
59
+ this.context.signal.throwIfAborted();
60
+ for (let offset = 0; offset < bytes.length; offset += 16384) {
61
+ const part = bytes.subarray(offset, offset + 16384);
62
+ if (this.staging) await writeFileOutput(this.context, part, (data) => this.staging.writer.write(data, { signal: this.context.signal }));
63
+ else await this.storage.append(part);
64
+ this.size += part.length;
65
+ }
66
+ })();
67
+ this.active = task;
68
+ return task;
69
+ }
70
+ finish() {
71
+ if (this.closing) return Promise.reject(new FsError("EBADF", { path: this.path }));
72
+ const task = (async () => {
73
+ await (this.initialized ??= this.initialize());
74
+ const { fs, signal } = this.context;
75
+ signal.throwIfAborted();
76
+ if (this.staging) {
77
+ const target = this.resolution;
78
+ const stat = await this.staging.writer.finish({ signal });
79
+ signal.throwIfAborted();
80
+ target.validate();
81
+ await fs.publishStagedFile({ ...this.staging, file: { ...this.staging.file, stat } }, target.path, {
82
+ parent: target.parent,
83
+ destination: target.destination,
84
+ ancestors: target.ancestors,
85
+ preserveIdentity: target.destination !== null,
86
+ commitGuard: () => {
87
+ target.validate();
88
+ return true;
89
+ },
90
+ signal
91
+ });
92
+ } else {
93
+ for (let offset = 0; offset < this.size; offset += 16384)
94
+ await writeFileOutput(this.context, await this.storage.read(this.start + offset, Math.min(16384, this.size - offset)), async () => {
95
+ });
96
+ const output = await openFileOutput({ ...this.context, outputBudget: "independent" }, this.path, "w");
97
+ try {
98
+ for (let offset = 0; offset < this.size; offset += 16384)
99
+ await output.sink.write(await this.storage.read(this.start + offset, Math.min(16384, this.size - offset)));
100
+ await output.finish();
101
+ } catch (error) {
102
+ await output.abort(error).catch(() => {
103
+ });
104
+ throw error;
105
+ }
106
+ }
107
+ })();
108
+ this.active = task;
109
+ return task;
110
+ }
111
+ close() {
112
+ return this.closing ??= (async () => {
113
+ await this.active?.catch(() => {
114
+ });
115
+ await this.initialized?.catch(() => {
116
+ });
117
+ if (this.staging?.cleanup) {
118
+ try {
119
+ await this.staging.cleanup.remove();
120
+ } finally {
121
+ await this.staging.cleanup.close();
122
+ }
123
+ } else if (this.staging) await this.context.fs.removeStagedFile?.(this.staging);
124
+ await this.storage?.close();
125
+ })();
126
+ }
127
+ };
16
128
 
17
129
  // packages/safe-bash-command-xmllint/src/output.ts
18
130
  import { XmlQueryError } from "../safe-bash-xml-engine/limits.js";
@@ -226,6 +338,7 @@ async function argumentsFor(context, budget) {
226
338
  async function executeDocument(context, limits, runtime, budget, options, file) {
227
339
  let outputFailed = false;
228
340
  let stored;
341
+ let fileOutput;
229
342
  let completed = false;
230
343
  try {
231
344
  const recoveryMessages = /* @__PURE__ */ new Set();
@@ -267,32 +380,16 @@ async function executeDocument(context, limits, runtime, budget, options, file)
267
380
  await runtime.writeDiagnostic(context.stderr, `xmllint: ${message} (recovered)
268
381
  `, context.signal);
269
382
  const root = await prepareDocument(parsedRoot, options.noblanks ?? false, options.encoding, budget, options.nocdata ?? false);
270
- const documentOutputStart = budget.outputBytes;
271
- const fileChunks = [];
272
- const sink = options.output === void 0 || options.query !== void 0 ? context.stdout : {
273
- async write(bytes) {
274
- fileChunks.push(bytes.slice());
275
- }
276
- };
383
+ if (options.output !== void 0 && options.query === void 0 && !options.noout)
384
+ fileOutput = new XmlFileOutput(context, runtime.pathOf(context, options.output));
277
385
  let encodingStarted = false;
278
386
  async function finish() {
279
387
  await flushWrite();
280
- if (options.output !== void 0 && options.query === void 0 && !options.noout) {
281
- const bytes = new Uint8Array(budget.outputBytes - documentOutputStart);
282
- let offset = 0;
283
- for (const chunk of fileChunks) {
284
- bytes.set(chunk, offset);
285
- offset += chunk.length;
286
- }
287
- const destination = runtime.pathOf(context, options.output);
388
+ if (fileOutput) {
288
389
  try {
289
- await runtime.interruptible(() => writeFileOutput(
290
- context,
291
- bytes,
292
- (data) => context.fs.writeFile(destination, data, { signal: context.signal })
293
- ), context.signal);
390
+ await fileOutput.finish();
294
391
  } catch (error) {
295
- if (error instanceof FsError) throw new XmlQueryError2(error.message, 6);
392
+ if (error instanceof FsError2) throw new XmlQueryError2(error.message, 6);
296
393
  throw error;
297
394
  }
298
395
  }
@@ -306,8 +403,10 @@ async function executeDocument(context, limits, runtime, budget, options, file)
306
403
  outBatchUsed = 0;
307
404
  writesCount++;
308
405
  try {
309
- await writeBytes(sink, slice, context.signal);
406
+ if (fileOutput) await fileOutput.write(slice);
407
+ else await writeBytes(context.stdout, slice, context.signal);
310
408
  } catch (error) {
409
+ if (fileOutput && error instanceof FsError2) throw new XmlQueryError2(error.message, 6);
311
410
  outputFailed = true;
312
411
  throw error;
313
412
  }
@@ -335,8 +434,10 @@ async function executeDocument(context, limits, runtime, budget, options, file)
335
434
  await flushWrite();
336
435
  writesCount++;
337
436
  try {
338
- await writeBytes(sink, bytes, context.signal);
437
+ if (fileOutput) await fileOutput.write(bytes);
438
+ else await writeBytes(context.stdout, bytes, context.signal);
339
439
  } catch (error) {
440
+ if (fileOutput && error instanceof FsError2) throw new XmlQueryError2(error.message, 6);
340
441
  outputFailed = true;
341
442
  throw error;
342
443
  }
@@ -399,15 +500,21 @@ async function executeDocument(context, limits, runtime, budget, options, file)
399
500
  } catch (error) {
400
501
  return reportError(context, runtime, error, outputFailed);
401
502
  } finally {
402
- if (stored) await stored.close().catch((error) => {
403
- if (completed) throw error;
404
- });
503
+ try {
504
+ if (fileOutput) await fileOutput.close().catch((error) => {
505
+ if (completed) throw error;
506
+ });
507
+ } finally {
508
+ if (stored) await stored.close().catch((error) => {
509
+ if (completed) throw error;
510
+ });
511
+ }
405
512
  }
406
513
  }
407
514
  async function reportError(context, runtime, error, outputFailed = false) {
408
515
  context.signal.throwIfAborted();
409
- if (outputFailed || error instanceof FsError && error.code === "EPIPE") throw error;
410
- const status = error instanceof XmlQueryError2 ? error.status : error instanceof XmlLimitError ? 5 : error instanceof SyntaxError || error instanceof FsError ? 1 : void 0;
516
+ if (outputFailed || error instanceof FsError2 && error.code === "EPIPE") throw error;
517
+ const status = error instanceof XmlQueryError2 ? error.status : error instanceof XmlLimitError ? 5 : error instanceof SyntaxError || error instanceof FsError2 ? 1 : void 0;
411
518
  if (status === void 0) throw error;
412
519
  const message = error instanceof Error ? error.message.slice(0, 1e3) : "XML query failed";
413
520
  await runtime.writeDiagnostic(
@@ -3,8 +3,8 @@ import "../safe-bash/command-chunks/chunk-65DS4IOB.js";
3
3
  // packages/safe-bash-command-xq/src/index.ts
4
4
  import { builtInDirectContextExecutors } from "../safe-bash-io-engine/internal.js";
5
5
  import { resolveXmlQueryLimits } from "../safe-bash-xml-engine/limits.js";
6
- import { parseXmlStream, parseXmlSteps, XmlLimitError } from "@poe-platform/safe-fs/core";
7
- import { getCommandArguments, toByteSource } from "../safe-bash-contracts/index.js";
6
+ import { parseXmlSteps, XmlLimitError } from "@poe-platform/safe-fs/core";
7
+ import { getCommandArguments } from "../safe-bash-contracts/index.js";
8
8
  import { readXmlChunks } from "../safe-bash-xml-engine/io.js";
9
9
  import { yieldTurn } from "../safe-bash-contracts/yield.js";
10
10
  import { shellValueByteLength } from "../safe-bash-contracts/value.js";
@@ -13,14 +13,24 @@ import { pathOf } from "../safe-bash-io-engine/internal.js";
13
13
  import { interruptible } from "../safe-bash-query-engine/limits.js";
14
14
  import { XmlBudget, XmlQueryError, XmlQueryLimitError } from "../safe-bash-xml-engine/limits.js";
15
15
  import { executeJq } from "../safe-bash-command-jq/jq.js";
16
- import { Budget, JqError, resolveJqLimits } from "../safe-bash-query-engine/limits.js";
17
- import { stringify } from "../safe-bash-query-engine/input.js";
18
- import { xmlToJson } from "../safe-bash-xml-engine/json.js";
16
+ import { JqError, resolveJqLimits } from "../safe-bash-query-engine/limits.js";
17
+ import { storedXmlToJson } from "../safe-bash-xml-engine/json.js";
18
+ import { StoredXmlDocument } from "../safe-bash-xml-engine/stored-document.js";
19
19
  import { syncCommandEvaluators } from "../safe-bash-contracts/runtime-control.js";
20
20
  var runtime = { yieldTurn, pathOf, interruptible, writeDiagnostic };
21
21
  async function executeXq(context, limits) {
22
22
  const budget = new XmlBudget(limits, context.signal, yieldTurn);
23
+ let active;
24
+ let completed = false, queryStarted = false;
23
25
  try {
26
+ let conversionError2 = function(error) {
27
+ context.signal.throwIfAborted();
28
+ if (error instanceof XmlQueryError) throw new JqError(error.message, error.status);
29
+ if (error instanceof XmlLimitError) throw new JqError(error.message, 5);
30
+ if (error instanceof SyntaxError) throw new JqError(error.message, 1);
31
+ throw error;
32
+ };
33
+ var conversionError = conversionError2;
24
34
  const carrier = getCommandArguments(context);
25
35
  for (let index = 0; index < carrier.args.length; index++) {
26
36
  if (shellValueByteLength(carrier.values[index]) > limits.maxInputBytes)
@@ -44,37 +54,39 @@ async function executeXq(context, limits) {
44
54
  maxSteps: limits.maxSteps,
45
55
  maxResults: limits.maxResults
46
56
  });
47
- const conversionBudget = new Budget(jqLimits, context.signal);
48
- return executeJq(context, jqLimits, async (bytes) => {
57
+ queryStarted = true;
58
+ const result = await executeJq(context, jqLimits, async (bytes) => {
49
59
  try {
60
+ if (active) await active.close();
50
61
  const source = readXmlChunks({ ...context, stdin: bytes }, void 0, budget, runtime);
51
- const root = await parseXmlStream(source, {
52
- ...limits,
53
- maxContentNodes: limits.maxNodes,
54
- expectedEncoding: "UTF-8"
55
- }, (units) => budget.tick(units));
56
- const value = await xmlToJson(root, budget);
57
- conversionBudget.value(value);
58
- return toByteSource(
59
- await stringify(
60
- value,
61
- conversionBudget,
62
- false,
63
- jqLimits.maxValueBytes,
64
- "maxValueBytes"
65
- ) + "\n"
66
- );
62
+ const document = await StoredXmlDocument.parse(source, context, budget);
63
+ active = document;
64
+ return (async function* () {
65
+ let converted = false;
66
+ try {
67
+ yield* storedXmlToJson(document, budget);
68
+ converted = true;
69
+ } catch (error) {
70
+ conversionError2(error);
71
+ } finally {
72
+ try {
73
+ await document.close().catch((error) => {
74
+ if (converted) throw error;
75
+ });
76
+ } finally {
77
+ if (active === document) active = void 0;
78
+ }
79
+ }
80
+ })();
67
81
  } catch (error) {
68
- context.signal.throwIfAborted();
69
- if (error instanceof XmlQueryError) throw new JqError(error.message, error.status);
70
- if (error instanceof XmlLimitError) throw new JqError(error.message, 5);
71
- if (error instanceof SyntaxError) throw new JqError(error.message, 1);
72
- throw error;
82
+ return conversionError2(error);
73
83
  }
74
84
  });
85
+ completed = true;
86
+ return result;
75
87
  } catch (error) {
76
88
  context.signal.throwIfAborted();
77
- if (!(error instanceof XmlQueryError)) throw error;
89
+ if (queryStarted || !(error instanceof XmlQueryError)) throw error;
78
90
  await writeDiagnostic(
79
91
  context.stderr,
80
92
  `${context.command}: ${error.message.slice(0, 1e3)}
@@ -82,6 +94,10 @@ async function executeXq(context, limits) {
82
94
  context.signal
83
95
  );
84
96
  return { exitCode: error.status };
97
+ } finally {
98
+ if (active) await active.close().catch((error) => {
99
+ if (completed) throw error;
100
+ });
85
101
  }
86
102
  }
87
103
  function createXqCommand(options = {}) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  boundedCodec
3
- } from "../safe-bash/command-chunks/chunk-JW3KIZU6.js";
4
- import "../safe-bash/command-chunks/chunk-EMMSXKEJ.js";
3
+ } from "../safe-bash/command-chunks/chunk-RUXY7GN5.js";
4
+ import "../safe-bash/command-chunks/chunk-4Q4R3VZU.js";
5
5
  import "../safe-bash/command-chunks/chunk-5AQAWIYK.js";
6
6
  import "../safe-bash/command-chunks/chunk-5T7WL5CN.js";
7
7
  import "../safe-bash/command-chunks/chunk-V7IP2PFT.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createCodec,
3
3
  loadRawCodecFactory
4
- } from "../safe-bash/command-chunks/chunk-EMMSXKEJ.js";
4
+ } from "../safe-bash/command-chunks/chunk-4Q4R3VZU.js";
5
5
  import "../safe-bash/command-chunks/chunk-5AQAWIYK.js";
6
6
  import "../safe-bash/command-chunks/chunk-5T7WL5CN.js";
7
7
  import "../safe-bash/command-chunks/chunk-V7IP2PFT.js";
@@ -4,12 +4,12 @@ import {
4
4
  unchangedSource,
5
5
  verifyOperandDestinations,
6
6
  writeFileOperand
7
- } from "../safe-bash/command-chunks/chunk-WFDG3N5R.js";
7
+ } from "../safe-bash/command-chunks/chunk-ECDEPKKW.js";
8
8
  import "../safe-bash/command-chunks/chunk-JMTQ4BB6.js";
9
- import "../safe-bash/command-chunks/chunk-NVBUC644.js";
10
- import "../safe-bash/command-chunks/chunk-KELMIFVV.js";
11
- import "../safe-bash/command-chunks/chunk-JW3KIZU6.js";
12
- import "../safe-bash/command-chunks/chunk-EMMSXKEJ.js";
9
+ import "../safe-bash/command-chunks/chunk-HKGNBH7Z.js";
10
+ import "../safe-bash/command-chunks/chunk-TI52LKLL.js";
11
+ import "../safe-bash/command-chunks/chunk-RUXY7GN5.js";
12
+ import "../safe-bash/command-chunks/chunk-4Q4R3VZU.js";
13
13
  import "../safe-bash/command-chunks/chunk-5AQAWIYK.js";
14
14
  import "../safe-bash/command-chunks/chunk-5T7WL5CN.js";
15
15
  import "../safe-bash/command-chunks/chunk-52DDLGBS.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  DecodedBudget,
3
3
  transform
4
- } from "../safe-bash/command-chunks/chunk-NVBUC644.js";
5
- import "../safe-bash/command-chunks/chunk-KELMIFVV.js";
4
+ } from "../safe-bash/command-chunks/chunk-HKGNBH7Z.js";
5
+ import "../safe-bash/command-chunks/chunk-TI52LKLL.js";
6
6
  import {
7
7
  boundedCodec
8
- } from "../safe-bash/command-chunks/chunk-JW3KIZU6.js";
9
- import "../safe-bash/command-chunks/chunk-EMMSXKEJ.js";
8
+ } from "../safe-bash/command-chunks/chunk-RUXY7GN5.js";
9
+ import "../safe-bash/command-chunks/chunk-4Q4R3VZU.js";
10
10
  import "../safe-bash/command-chunks/chunk-5AQAWIYK.js";
11
11
  import "../safe-bash/command-chunks/chunk-5T7WL5CN.js";
12
12
  import "../safe-bash/command-chunks/chunk-52DDLGBS.js";