@poe-platform/safe-bash 0.1.810 → 0.1.812

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 (276) hide show
  1. package/dist/audio-ast/flac-source.d.ts +13 -0
  2. package/dist/audio-ast/index.d.ts +2 -0
  3. package/dist/audio-ast/index.js +253 -179
  4. package/dist/audio-ast/vorbis.d.ts +14 -0
  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/qpdf-json-document.d.ts +2 -1
  11. package/dist/pdf-ast/cos/value-parser.d.ts +23 -2
  12. package/dist/pdf-ast/extract/retained-form-field-details.d.ts +20 -0
  13. package/dist/pdf-ast/extract/retained-form-fields.d.ts +17 -4
  14. package/dist/pdf-ast/index.d.ts +1 -0
  15. package/dist/pdf-ast/index.js +844 -384
  16. package/dist/pdf-ast/retained-document.d.ts +6 -0
  17. package/dist/safe-bash/audio-ast.browser.js +3 -1
  18. package/dist/safe-bash/chunks/{chunk-65TFMAZU.js → chunk-BUYRKFW2.js} +8 -35
  19. package/dist/safe-bash/chunks/{chunk-ZA5FQ34E.js → chunk-TPG55BAQ.js} +0 -2
  20. package/dist/safe-bash/command-chunks/{biff-ORSHM4YX-QYPGRDAZ.js → biff-YKPDH35C-MVQIWNKV.js} +2192 -2155
  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-DCD32BEY.js → chunk-2JSDKQ4J.js} +201 -84
  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-D5AYP2UM.js → chunk-3Q247UDJ.js} +26 -16
  28. package/dist/safe-bash/command-chunks/{chunk-32ADKP5E.js → chunk-456PHA3L.js} +1 -1
  29. package/dist/safe-bash/command-chunks/{chunk-UJXP3T6R.js → chunk-4CKFNXRN.js} +1 -1
  30. package/dist/safe-bash/command-chunks/{chunk-5L6GHFRW.js → chunk-554Z6IKP.js} +2 -2
  31. package/dist/safe-bash/command-chunks/{chunk-ORZRWT62.js → chunk-56NYSX65.js} +9 -9
  32. package/dist/safe-bash/command-chunks/{chunk-53JP3S6H.js → chunk-5HPU7D36.js} +4 -4
  33. package/dist/safe-bash/command-chunks/{chunk-HARUYHH7.js → chunk-5HUICAWD.js} +1 -1
  34. package/dist/safe-bash/command-chunks/{chunk-IC5GJI7E.js → chunk-5Q22ZLNC.js} +6 -6
  35. package/dist/safe-bash/command-chunks/{chunk-YO3V5RLY.js → chunk-6CCQI6XZ.js} +12 -12
  36. package/dist/safe-bash/command-chunks/{chunk-EO2IVGV7.js → chunk-6M6TM5Z5.js} +3 -3
  37. package/dist/safe-bash/command-chunks/{chunk-Z54Z3KRN.js → chunk-6QBMND4A.js} +1 -1
  38. package/dist/safe-bash/command-chunks/{chunk-INX4JMQ6.js → chunk-6VPQ3CDZ.js} +5 -5
  39. package/dist/safe-bash/command-chunks/{chunk-VGXVN3BX.js → chunk-7GKKMNL6.js} +8 -8
  40. package/dist/safe-bash/command-chunks/{chunk-TZJC67W3.js → chunk-7PVHO47B.js} +6 -6
  41. package/dist/safe-bash/command-chunks/{chunk-CM3C7AXJ.js → chunk-A2CLZMQZ.js} +1 -1
  42. package/dist/safe-bash/command-chunks/{chunk-ASR27KHW.js → chunk-A5FZBR7X.js} +4 -4
  43. package/dist/safe-bash/command-chunks/{chunk-DMDHE5KC.js → chunk-AHA6IWAJ.js} +6 -6
  44. package/dist/safe-bash/command-chunks/{chunk-PTZ55XXN.js → chunk-APEWTWCC.js} +6 -6
  45. package/dist/safe-bash/command-chunks/{chunk-YUVH6CE4.js → chunk-ATTWQVR2.js} +17 -17
  46. package/dist/safe-bash/command-chunks/{chunk-2VCKUNDZ.js → chunk-B2C3UPJS.js} +27 -17
  47. package/dist/safe-bash/command-chunks/{chunk-JON5DB3Z.js → chunk-B5LDP7AA.js} +2 -2
  48. package/dist/safe-bash/command-chunks/{chunk-YTFWPJ3F.js → chunk-CJQSAATC.js} +26 -26
  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-VPDSQPSN.js → chunk-DM2CPMB4.js} +2 -2
  53. package/dist/safe-bash/command-chunks/{chunk-3DTDMEOP.js → chunk-EAGIJ4VW.js} +1 -1
  54. package/dist/safe-bash/command-chunks/{chunk-JW6CMBF2.js → chunk-EHSM5ZQS.js} +8 -8
  55. package/dist/safe-bash/command-chunks/{chunk-WIOH7ZQN.js → chunk-ENT3IV2G.js} +12 -12
  56. package/dist/safe-bash/command-chunks/{chunk-5IE4LJGB.js → chunk-EUT24Y5Z.js} +8 -8
  57. package/dist/safe-bash/command-chunks/{chunk-WC2OCF4H.js → chunk-FDCIPJBQ.js} +7 -7
  58. package/dist/safe-bash/command-chunks/{chunk-COKZFXHG.js → chunk-FIIAYCWS.js} +2 -2
  59. package/dist/safe-bash/command-chunks/{chunk-MWVFP2HY.js → chunk-GEM47B2P.js} +7 -7
  60. package/dist/safe-bash/command-chunks/{chunk-EHL6B34L.js → chunk-HDJVJTCK.js} +9 -9
  61. package/dist/safe-bash/command-chunks/{chunk-JMM3MNAY.js → chunk-HKATEVAP.js} +6 -6
  62. package/dist/safe-bash/command-chunks/{chunk-VWY3EAVQ.js → chunk-HTVIYLVB.js} +4 -4
  63. package/dist/safe-bash/command-chunks/{chunk-CHR2OD2U.js → chunk-HWQ2UHMT.js} +9 -9
  64. package/dist/safe-bash/command-chunks/{chunk-Z4QJMDK3.js → chunk-IT7TAC3F.js} +16 -16
  65. package/dist/safe-bash/command-chunks/{chunk-EWS4KYJE.js → chunk-JFYWVQ4V.js} +8 -8
  66. package/dist/safe-bash/command-chunks/{chunk-ZCX63QWA.js → chunk-JOCFI7TG.js} +1 -1
  67. package/dist/safe-bash/command-chunks/{chunk-F5WTH4O4.js → chunk-JQVHUSDD.js} +5 -5
  68. package/dist/safe-bash/command-chunks/{chunk-O4VJEGL6.js → chunk-K5GB2YMN.js} +10 -10
  69. package/dist/safe-bash/command-chunks/{chunk-27C3NT5V.js → chunk-KB7DUBVL.js} +5 -5
  70. package/dist/safe-bash/command-chunks/{chunk-4DZ32PI7.js → chunk-KCOJA7EM.js} +7 -7
  71. package/dist/safe-bash/command-chunks/{chunk-CAXJ4RLF.js → chunk-KJ4XXZIL.js} +12 -12
  72. package/dist/safe-bash/command-chunks/{chunk-U6QHTC5J.js → chunk-L5MCW6CM.js} +4 -4
  73. package/dist/safe-bash/command-chunks/{chunk-LVL3A7YE.js → chunk-LCZDBW55.js} +5 -5
  74. package/dist/safe-bash/command-chunks/{chunk-DJVRDUCA.js → chunk-LXLLA4PM.js} +17 -17
  75. package/dist/safe-bash/command-chunks/{chunk-K7AGAS3K.js → chunk-M7QE2MN7.js} +6 -6
  76. package/dist/safe-bash/command-chunks/{chunk-SWT6ILF2.js → chunk-MPUHH2KR.js} +3 -3
  77. package/dist/safe-bash/command-chunks/{chunk-3ZWBBS6U.js → chunk-NARD63DY.js} +437 -34
  78. package/dist/safe-bash/command-chunks/{chunk-DC3OJLRB.js → chunk-NQDIT667.js} +5 -5
  79. package/dist/safe-bash/command-chunks/{chunk-LWZVDDJA.js → chunk-NUGQQDGE.js} +5 -1
  80. package/dist/safe-bash/command-chunks/{chunk-MFLQZLFR.js → chunk-OA75SGN2.js} +7 -7
  81. package/dist/safe-bash/command-chunks/{chunk-5LATYOF7.js → chunk-OEJM666F.js} +5 -5
  82. package/dist/safe-bash/command-chunks/{chunk-AF25YYIO.js → chunk-PMAM4N33.js} +9 -9
  83. package/dist/safe-bash/command-chunks/{chunk-KMMAJ6H6.js → chunk-PNGDJA6M.js} +2 -2
  84. package/dist/safe-bash/command-chunks/{chunk-62BHPSKJ.js → chunk-Q6S57NOQ.js} +7 -7
  85. package/dist/safe-bash/command-chunks/{chunk-KJ3PEDI2.js → chunk-Q73EMLLZ.js} +146 -4
  86. package/dist/safe-bash/command-chunks/{chunk-FXKBM5KJ.js → chunk-QC5RMGSA.js} +3 -3
  87. package/dist/safe-bash/command-chunks/{chunk-UQ6UIZMM.js → chunk-QD7ZRDUN.js} +1 -1
  88. package/dist/safe-bash/command-chunks/{chunk-JHUYZZGV.js → chunk-QYMEASQ6.js} +4 -4
  89. package/dist/safe-bash/command-chunks/{chunk-3GY5VDIX.js → chunk-QZZ73J2O.js} +6 -6
  90. package/dist/safe-bash/command-chunks/{chunk-S2CYIGWH.js → chunk-R6EGGK5M.js} +7 -7
  91. package/dist/safe-bash/command-chunks/{chunk-7AVN3OBH.js → chunk-RHYJVTJO.js} +2 -2
  92. package/dist/safe-bash/command-chunks/{chunk-EWGDSO6U.js → chunk-RID6VYS3.js} +8 -8
  93. package/dist/safe-bash/command-chunks/{chunk-MMBRBANA.js → chunk-RNSKXOG3.js} +6 -6
  94. package/dist/safe-bash/command-chunks/{chunk-D3ZRZTY5.js → chunk-RQIQ75W5.js} +5 -5
  95. package/dist/safe-bash/command-chunks/{chunk-DWKQPLRT.js → chunk-RRL3Y562.js} +11 -11
  96. package/dist/safe-bash/command-chunks/{chunk-NXCMXD74.js → chunk-S6R3IB36.js} +1 -1
  97. package/dist/safe-bash/command-chunks/{chunk-XUPKFHAQ.js → chunk-SDTPO2VV.js} +7 -7
  98. package/dist/safe-bash/command-chunks/{chunk-PIAGKRFW.js → chunk-SPLOIABU.js} +3 -3
  99. package/dist/safe-bash/command-chunks/{chunk-Z5QOVRVH.js → chunk-SU26FZLJ.js} +1 -1
  100. package/dist/safe-bash/command-chunks/{chunk-WLTJDNSQ.js → chunk-TVH4JORU.js} +3 -3
  101. package/dist/safe-bash/command-chunks/{chunk-6XVMWFHD.js → chunk-TW73OXPR.js} +6 -6
  102. package/dist/safe-bash/command-chunks/{chunk-SFO43CID.js → chunk-UAXSE3XE.js} +5 -5
  103. package/dist/safe-bash/command-chunks/{chunk-K35BSUHO.js → chunk-UYWSIIUX.js} +7 -7
  104. package/dist/safe-bash/command-chunks/{chunk-2E2YEDVB.js → chunk-W5YSINXC.js} +6 -6
  105. package/dist/safe-bash/command-chunks/{chunk-EYNT4OEJ.js → chunk-WGG6G2KG.js} +7 -7
  106. package/dist/safe-bash/command-chunks/{chunk-DVQBZXMQ.js → chunk-WJCN2IXI.js} +2 -2
  107. package/dist/safe-bash/command-chunks/{chunk-XBZ4ZWGL.js → chunk-WVMHRNXZ.js} +3 -3
  108. package/dist/safe-bash/command-chunks/{chunk-7GXUCQI4.js → chunk-WXRYDALR.js} +4 -4
  109. package/dist/safe-bash/command-chunks/{chunk-S4IIOSRA.js → chunk-X7FA7ZD5.js} +8 -8
  110. package/dist/safe-bash/command-chunks/{chunk-DPR5CYQV.js → chunk-XITDDJFT.js} +2 -0
  111. package/dist/safe-bash/command-chunks/{chunk-SFCERNHU.js → chunk-XPD636C4.js} +3 -3
  112. package/dist/safe-bash/command-chunks/{chunk-HYDWQLJ3.js → chunk-XRVKWGVQ.js} +6 -6
  113. package/dist/safe-bash/command-chunks/{chunk-ZEPDT6I5.js → chunk-XVLWZTPY.js} +249 -51
  114. package/dist/safe-bash/command-chunks/{chunk-3UJWHRK4.js → chunk-XVP6V5K3.js} +6 -6
  115. package/dist/safe-bash/command-chunks/{chunk-KTI3BULE.js → chunk-XZ2FWFNV.js} +6 -6
  116. package/dist/safe-bash/command-chunks/{chunk-QK3CHRGL.js → chunk-Y4EYCZFT.js} +10 -10
  117. package/dist/safe-bash/command-chunks/{chunk-GTWVMFBK.js → chunk-YORJDX4V.js} +4 -4
  118. package/dist/safe-bash/command-chunks/{chunk-H6F5SN2N.js → chunk-YSMNXMAO.js} +4 -4
  119. package/dist/safe-bash/command-chunks/{chunk-SE5SJ4JT.js → chunk-Z2JW6M2D.js} +3 -3
  120. package/dist/safe-bash/command-chunks/{chunk-WH3TIOTS.js → chunk-ZEGNRZV2.js} +9 -2
  121. package/dist/safe-bash/command-chunks/{chunk-BYZUOF6X.js → chunk-ZEX53S5I.js} +4010 -3980
  122. package/dist/safe-bash/command-chunks/{chunk-HQYFRQ5W.js → chunk-ZIIO6GRY.js} +7 -7
  123. package/dist/safe-bash/command-chunks/{chunk-NTRZMQZP.js → chunk-ZMHEGDU2.js} +2 -2
  124. package/dist/safe-bash/command-chunks/{chunk-EYBXHGA6.js → chunk-ZXR6LXV5.js} +2 -2
  125. package/dist/safe-bash/command-chunks/{command-engine-BEWABZ75.js → command-engine-BCUQGJJ4.js} +58 -21
  126. package/dist/safe-bash/command-chunks/{engine-MEPOXIXT-WZMRHACG.js → engine-LAUEWYSQ-DQCEI5HE.js} +1 -1
  127. package/dist/safe-bash/command-chunks/pdf-XHHFTOT4-UJJYOYJ2.js +573 -0
  128. package/dist/safe-bash/commands/diff-patch/index.js +0 -3
  129. package/dist/safe-bash/commands/diff3/index.js +0 -2
  130. package/dist/safe-bash/full-core.browser.js +2 -2
  131. package/dist/safe-bash/plugins/index.browser.js +2 -2
  132. package/dist/safe-bash/plugins/index.js +3 -1
  133. package/dist/safe-bash/plugins/portable-commands.d.ts +1 -1
  134. package/dist/safe-bash/plugins/portable-commands.js +5 -3
  135. package/dist/safe-bash/registry-entry.browser.js +1 -1
  136. package/dist/safe-bash-command-apply-patch/apply.js +4 -4
  137. package/dist/safe-bash-command-apply-patch/index.js +4 -4
  138. package/dist/safe-bash-command-apply-patch/matcher.js +2 -2
  139. package/dist/safe-bash-command-apply-patch/parser.js +2 -2
  140. package/dist/safe-bash-command-apply-patch/shared.d.ts +2 -0
  141. package/dist/safe-bash-command-apply-patch/shared.js +1 -1
  142. package/dist/safe-bash-command-diff/index.js +0 -2
  143. package/dist/safe-bash-command-diff3/index.js +830 -56
  144. package/dist/safe-bash-command-ffmpeg/index.js +1 -1
  145. package/dist/safe-bash-command-ffprobe/index.js +2 -2
  146. package/dist/safe-bash-command-ffprobe/media.js +2 -2
  147. package/dist/safe-bash-command-html-to-markdown/index.js +75 -21
  148. package/dist/safe-bash-command-pandoc/command.js +3 -3
  149. package/dist/safe-bash-command-pandoc/execution.d.ts +2 -2
  150. package/dist/safe-bash-command-pandoc/index.d.ts +1 -1
  151. package/dist/safe-bash-command-pandoc/index.js +14 -14
  152. package/dist/safe-bash-command-pandoc/lua-filters.js +2 -2
  153. package/dist/safe-bash-command-pandoc/types.d.ts +17 -2
  154. package/dist/safe-bash-command-patch/index.js +2 -2
  155. package/dist/safe-bash-command-patch/patch-publication.js +1 -1
  156. package/dist/safe-bash-command-patch/patch.js +2 -2
  157. package/dist/safe-bash-command-pdftk/index.js +649 -265
  158. package/dist/safe-bash-command-pptx/command-engine.d.ts +12 -3
  159. package/dist/safe-bash-command-pptx/engine.d.ts +2 -2
  160. package/dist/safe-bash-command-pptx/engine.js +1 -1
  161. package/dist/safe-bash-command-qpdf/index.js +115 -9
  162. package/dist/safe-bash-command-soffice/index.js +1 -1
  163. package/dist/safe-bash-command-ssconvert/index.js +2 -2
  164. package/dist/safe-bash-command-xq/index.js +45 -29
  165. package/dist/safe-bash-diff-engine/document.d.ts +2 -1
  166. package/dist/safe-bash-diff-engine/document.js +7 -4
  167. package/dist/safe-bash-presentation-engine/accessibility.js +30 -30
  168. package/dist/safe-bash-presentation-engine/animation-editing.js +15 -15
  169. package/dist/safe-bash-presentation-engine/animations.js +15 -15
  170. package/dist/safe-bash-presentation-engine/backgrounds.js +16 -16
  171. package/dist/safe-bash-presentation-engine/bytes.js +3 -3
  172. package/dist/safe-bash-presentation-engine/chart-editing.js +33 -33
  173. package/dist/safe-bash-presentation-engine/chart-object-operations.js +24 -24
  174. package/dist/safe-bash-presentation-engine/charts.js +30 -30
  175. package/dist/safe-bash-presentation-engine/command-placeholder.js +56 -55
  176. package/dist/safe-bash-presentation-engine/comments.js +16 -16
  177. package/dist/safe-bash-presentation-engine/connector-operations.js +31 -31
  178. package/dist/safe-bash-presentation-engine/connectors.js +28 -28
  179. package/dist/safe-bash-presentation-engine/content-types.js +4 -4
  180. package/dist/safe-bash-presentation-engine/creation.js +6 -6
  181. package/dist/safe-bash-presentation-engine/diff.js +31 -31
  182. package/dist/safe-bash-presentation-engine/drawing-format.js +19 -19
  183. package/dist/safe-bash-presentation-engine/drawing-operations.js +30 -30
  184. package/dist/safe-bash-presentation-engine/drawing-schema.js +20 -20
  185. package/dist/safe-bash-presentation-engine/equations.js +16 -16
  186. package/dist/safe-bash-presentation-engine/errors.js +2 -2
  187. package/dist/safe-bash-presentation-engine/fields.js +16 -16
  188. package/dist/safe-bash-presentation-engine/font-metrics.js +3 -3
  189. package/dist/safe-bash-presentation-engine/image-extraction.js +19 -19
  190. package/dist/safe-bash-presentation-engine/image-formatting.js +31 -31
  191. package/dist/safe-bash-presentation-engine/image-insertion.js +17 -17
  192. package/dist/safe-bash-presentation-engine/image-replacement.js +20 -20
  193. package/dist/safe-bash-presentation-engine/image-value.js +4 -4
  194. package/dist/safe-bash-presentation-engine/images.js +18 -18
  195. package/dist/safe-bash-presentation-engine/index.d.ts +1 -1
  196. package/dist/safe-bash-presentation-engine/index.js +99 -95
  197. package/dist/safe-bash-presentation-engine/layouts.js +15 -15
  198. package/dist/safe-bash-presentation-engine/length.js +3 -3
  199. package/dist/safe-bash-presentation-engine/links.js +15 -15
  200. package/dist/safe-bash-presentation-engine/masters.js +14 -14
  201. package/dist/safe-bash-presentation-engine/media-editing.js +23 -23
  202. package/dist/safe-bash-presentation-engine/media-extraction.js +16 -16
  203. package/dist/safe-bash-presentation-engine/media.js +15 -15
  204. package/dist/safe-bash-presentation-engine/memberships.js +14 -14
  205. package/dist/safe-bash-presentation-engine/notes.js +15 -15
  206. package/dist/safe-bash-presentation-engine/ole-enum.js +4 -4
  207. package/dist/safe-bash-presentation-engine/ole-insertion.js +19 -19
  208. package/dist/safe-bash-presentation-engine/opaque-objects.js +9 -9
  209. package/dist/safe-bash-presentation-engine/package-reader.js +5 -5
  210. package/dist/safe-bash-presentation-engine/package-tools.js +15 -15
  211. package/dist/safe-bash-presentation-engine/package-uri.js +3 -3
  212. package/dist/safe-bash-presentation-engine/package-writer.js +4 -4
  213. package/dist/safe-bash-presentation-engine/presentation-model.js +55 -54
  214. package/dist/safe-bash-presentation-engine/presentation-settings.js +13 -13
  215. package/dist/safe-bash-presentation-engine/properties.js +15 -15
  216. package/dist/safe-bash-presentation-engine/relationships.js +4 -4
  217. package/dist/safe-bash-presentation-engine/resource-limits.js +1 -1
  218. package/dist/safe-bash-presentation-engine/retained-inspection.js +12 -12
  219. package/dist/safe-bash-presentation-engine/retained-package.js +4 -4
  220. package/dist/safe-bash-presentation-engine/retained-slide-publication.d.ts +24 -0
  221. package/dist/safe-bash-presentation-engine/retained-slide-settings.d.ts +15 -0
  222. package/dist/safe-bash-presentation-engine/retained-text.js +17 -17
  223. package/dist/safe-bash-presentation-engine/sanitize.js +16 -16
  224. package/dist/safe-bash-presentation-engine/selectors.js +10 -10
  225. package/dist/safe-bash-presentation-engine/shape-groups.js +30 -30
  226. package/dist/safe-bash-presentation-engine/shape-operations.js +29 -29
  227. package/dist/safe-bash-presentation-engine/shape-path-operations.js +31 -31
  228. package/dist/safe-bash-presentation-engine/shape-paths.js +15 -15
  229. package/dist/safe-bash-presentation-engine/shape-presets.js +3 -3
  230. package/dist/safe-bash-presentation-engine/shape-selection.js +30 -30
  231. package/dist/safe-bash-presentation-engine/shape-transforms.js +17 -17
  232. package/dist/safe-bash-presentation-engine/shapes.js +26 -26
  233. package/dist/safe-bash-presentation-engine/slide-copy.js +16 -16
  234. package/dist/safe-bash-presentation-engine/slide-import.js +17 -17
  235. package/dist/safe-bash-presentation-engine/slide-merge-split.js +19 -19
  236. package/dist/safe-bash-presentation-engine/slide-model.js +42 -42
  237. package/dist/safe-bash-presentation-engine/slide-removal.js +17 -17
  238. package/dist/safe-bash-presentation-engine/slide-transfer-budget.js +9 -9
  239. package/dist/safe-bash-presentation-engine/slides.d.ts +3 -0
  240. package/dist/safe-bash-presentation-engine/slides.js +24 -16
  241. package/dist/safe-bash-presentation-engine/table-operations.js +32 -32
  242. package/dist/safe-bash-presentation-engine/table-spans.js +31 -31
  243. package/dist/safe-bash-presentation-engine/tables.js +30 -30
  244. package/dist/safe-bash-presentation-engine/tags.js +15 -15
  245. package/dist/safe-bash-presentation-engine/template-bindings.js +32 -32
  246. package/dist/safe-bash-presentation-engine/template-repeat.js +39 -39
  247. package/dist/safe-bash-presentation-engine/text-fitting.js +26 -26
  248. package/dist/safe-bash-presentation-engine/text-frames.js +26 -26
  249. package/dist/safe-bash-presentation-engine/text-paragraphs.js +26 -26
  250. package/dist/safe-bash-presentation-engine/text-reading.js +11 -11
  251. package/dist/safe-bash-presentation-engine/text-replacement.js +16 -16
  252. package/dist/safe-bash-presentation-engine/text-runs.js +19 -19
  253. package/dist/safe-bash-presentation-engine/themes.js +15 -15
  254. package/dist/safe-bash-presentation-engine/transitions.js +15 -15
  255. package/dist/safe-bash-presentation-engine/validation.js +9 -9
  256. package/dist/safe-bash-presentation-engine/xml-parts.js +15 -15
  257. package/dist/safe-bash-presentation-engine/xml-view.js +3 -3
  258. package/dist/safe-bash-presentation-engine/xml.js +3 -3
  259. package/dist/safe-bash-xml-engine/json.d.ts +1 -0
  260. package/dist/safe-bash-xml-engine/json.js +203 -0
  261. package/dist/safe-bash-xml-engine/stored-json.d.ts +5 -0
  262. package/dist/spreadsheet-engine/rendering/print/bidi-runs.d.ts +5 -0
  263. package/dist/spreadsheet-engine/rendering/print/bidi-runs.js +35 -0
  264. package/dist/spreadsheet-engine/rendering/print/control-bidi.d.ts +8 -0
  265. package/dist/spreadsheet-engine/rendering/print/control-bidi.js +80 -0
  266. package/dist/spreadsheet-format-xls/biff-encrypted-properties.d.ts +4 -4
  267. package/dist/spreadsheet-format-xls/biff-encrypted-properties.js +76 -30
  268. package/dist/spreadsheet-format-xls/biff-encryption.js +1 -1
  269. package/dist/spreadsheet-format-xls/biff-metadata.d.ts +1 -0
  270. package/dist/spreadsheet-format-xls/biff-metadata.js +2 -2
  271. package/dist/spreadsheet-format-xls/biff-property-bytes.d.ts +4 -1
  272. package/dist/spreadsheet-format-xls/biff-property-bytes.js +1 -1
  273. package/dist/spreadsheet-format-xls/biff-range.js +1 -1
  274. package/dist/spreadsheet-format-xls/biff-write-metadata.js +10 -1
  275. package/package.json +5 -2
  276. package/dist/safe-bash/command-chunks/pdf-LOZAXXS6-ERI57IAV.js +0 -557
@@ -17,9 +17,11 @@ export interface AdmittedCommandEngineOptions {
17
17
  }
18
18
  import type { PptxPublicationRequest } from "../safe-bash-presentation-engine/publication.js";
19
19
  export type { PptxPublicationRequest } from "../safe-bash-presentation-engine/publication.js";
20
- export interface PptxCommandRequest {
21
- readonly streaming?: import("./streaming-inputs.js").PptxStreamingIO;
22
- readonly publishOutput?: (publication: PptxPublicationRequest) => Promise<void>;
20
+ export type PptxStreamPublicationRequest = Omit<PptxPublicationRequest, "bytes" | "originalBytes"> & {
21
+ readonly bytes: import("../safe-bash-contracts/index.js").ByteSource;
22
+ readonly originalBytes: import("./streaming-inputs.js").PptxRetainedInput;
23
+ };
24
+ interface PptxRequestBase {
23
25
  readonly preflightOutput?: (publication: PptxPublicationRequest) => Promise<void>;
24
26
  /** Trusted adapter transaction: either every requested file is published or none is. */
25
27
  readonly publishOutputs?: (publications: readonly PptxPublicationRequest[]) => Promise<void>;
@@ -27,6 +29,13 @@ export interface PptxCommandRequest {
27
29
  readonly signal: AbortSignal;
28
30
  readonly readInput: (path: string, maxBytes: number) => Promise<Uint8Array>;
29
31
  }
32
+ export type PptxCommandRequest = PptxRequestBase & ({
33
+ readonly streaming?: undefined;
34
+ readonly publishOutput?: (publication: PptxPublicationRequest) => Promise<void>;
35
+ } | {
36
+ readonly streaming: import("./streaming-inputs.js").PptxStreamingIO;
37
+ readonly publishOutput?: (publication: PptxPublicationRequest | PptxStreamPublicationRequest) => Promise<void>;
38
+ });
30
39
  export interface PptxCommandOutput {
31
40
  readonly exitCode: number;
32
41
  readonly stdout: Uint8Array;
@@ -1,4 +1,4 @@
1
1
  export * from "../safe-bash-presentation-engine/index.js";
2
- import type { PptxCommandEngine, PptxCommandEngineOptions, PptxCommandRequest, PptxCommandOutput, PptxPublicationRequest } from "./command-engine.js";
3
- export type { PptxCommandEngine, PptxCommandEngineOptions, PptxCommandRequest, PptxCommandOutput, PptxPublicationRequest };
2
+ import type { PptxCommandEngine, PptxCommandEngineOptions, PptxCommandRequest, PptxCommandOutput, PptxPublicationRequest, PptxStreamPublicationRequest } from "./command-engine.js";
3
+ export type { PptxCommandEngine, PptxCommandEngineOptions, PptxCommandRequest, PptxCommandOutput, PptxPublicationRequest, PptxStreamPublicationRequest };
4
4
  export declare function createPptxCommandEngine(settings?: PptxCommandEngineOptions): PptxCommandEngine;
@@ -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-BEWABZ75.js"));
30
+ const mod = await (cachedPptxEngineMod ??= import("../safe-bash/command-chunks/command-engine-BCUQGJJ4.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-CHR2OD2U.js";
13
+ } from "../safe-bash/command-chunks/chunk-HWQ2UHMT.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-MEPOXIXT-WZMRHACG.js")).createEngine(u), true, wr);
722
+ var H = de(async (u) => (await import("../safe-bash/command-chunks/engine-LAUEWYSQ-DQCEI5HE.js")).createEngine(u), true, wr);
723
723
  var Do = H.createSsconvertCommand;
724
724
  var To = H.createSsconvertCommands;
725
725
  var Uo = H.ssconvertCommands;
@@ -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,8 @@
1
- import { PagedStorage } from "@poe-platform/safe-fs/storage";
1
+ import { PagedStorage, type PagedStorageCache } from "@poe-platform/safe-fs/storage";
2
2
  import { type ByteSource, type CommandContext } from "../safe-bash-contracts/index.js";
3
3
  export interface DocumentBudget {
4
4
  readonly context: CommandContext;
5
+ readonly documentCache?: PagedStorageCache;
5
6
  step(amount?: number): void;
6
7
  checkpoint(): void | Promise<void>;
7
8
  }
@@ -11,8 +11,8 @@ async function closeDocumentResources(resources) {
11
11
  var IndexedDocument = class {
12
12
  constructor(budget, pages = 16) {
13
13
  this.budget = budget;
14
- this.data = new PagedStorage(budget.context, pages);
15
- this.index = new PagedStorage(budget.context, pages);
14
+ this.data = new PagedStorage(budget.context, pages, budget.documentCache);
15
+ this.index = new PagedStorage(budget.context, pages, budget.documentCache);
16
16
  budget.context.registerCleanup?.(() => this.close());
17
17
  }
18
18
  budget;
@@ -87,8 +87,10 @@ var IndexedDocument = class {
87
87
  const bytes = await this.index.read(8 + position * 24, 24);
88
88
  const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
89
89
  const line = { start: view.getFloat64(0, true), end: view.getFloat64(8, true), hash: view.getUint32(16, true) };
90
- if (this.cache.size === 256) this.cache.delete(this.cache.keys().next().value);
91
- this.cache.set(position, line);
90
+ if (!this.budget.documentCache) {
91
+ if (this.cache.size === 256) this.cache.delete(this.cache.keys().next().value);
92
+ this.cache.set(position, line);
93
+ }
92
94
  return line;
93
95
  }
94
96
  async equal(position, other, otherPosition) {
@@ -110,6 +112,7 @@ var IndexedDocument = class {
110
112
  return true;
111
113
  }
112
114
  retainComparison(position, line, bytes) {
115
+ if (this.budget.documentCache) return;
113
116
  if (this.comparisons.has(position)) return;
114
117
  if (this.comparisons.size === 512) this.comparisons.delete(this.comparisons.keys().next().value);
115
118
  this.comparisons.set(position, { line, bytes });
@@ -2,38 +2,38 @@ import {
2
2
  mutateAccessibility,
3
3
  readAccessibility,
4
4
  validateAccessibilityUpdate
5
- } from "../safe-bash/command-chunks/chunk-27C3NT5V.js";
6
- import "../safe-bash/command-chunks/chunk-6XVMWFHD.js";
7
- import "../safe-bash/command-chunks/chunk-Z4QJMDK3.js";
8
- import "../safe-bash/command-chunks/chunk-ZCX63QWA.js";
9
- import "../safe-bash/command-chunks/chunk-UJXP3T6R.js";
10
- import "../safe-bash/command-chunks/chunk-CHJL6JMU.js";
11
- import "../safe-bash/command-chunks/chunk-CM3C7AXJ.js";
12
- import "../safe-bash/command-chunks/chunk-KTI3BULE.js";
13
- import "../safe-bash/command-chunks/chunk-HONWGFDA.js";
14
- import "../safe-bash/command-chunks/chunk-7GXUCQI4.js";
15
- import "../safe-bash/command-chunks/chunk-JHUYZZGV.js";
16
- import "../safe-bash/command-chunks/chunk-53JP3S6H.js";
17
- import "../safe-bash/command-chunks/chunk-7AVN3OBH.js";
18
- import "../safe-bash/command-chunks/chunk-H6F5SN2N.js";
19
- import "../safe-bash/command-chunks/chunk-KCTV4NVX.js";
20
- import "../safe-bash/command-chunks/chunk-Z54Z3KRN.js";
5
+ } from "../safe-bash/command-chunks/chunk-KB7DUBVL.js";
6
+ import "../safe-bash/command-chunks/chunk-TW73OXPR.js";
7
+ import "../safe-bash/command-chunks/chunk-IT7TAC3F.js";
8
+ import "../safe-bash/command-chunks/chunk-JOCFI7TG.js";
9
+ import "../safe-bash/command-chunks/chunk-4CKFNXRN.js";
10
+ import "../safe-bash/command-chunks/chunk-COKYZUBW.js";
11
+ import "../safe-bash/command-chunks/chunk-A2CLZMQZ.js";
12
+ import "../safe-bash/command-chunks/chunk-XZ2FWFNV.js";
13
+ import "../safe-bash/command-chunks/chunk-33YCKZZX.js";
14
+ import "../safe-bash/command-chunks/chunk-WXRYDALR.js";
15
+ import "../safe-bash/command-chunks/chunk-QYMEASQ6.js";
16
+ import "../safe-bash/command-chunks/chunk-5HPU7D36.js";
17
+ import "../safe-bash/command-chunks/chunk-RHYJVTJO.js";
18
+ import "../safe-bash/command-chunks/chunk-YSMNXMAO.js";
19
+ import "../safe-bash/command-chunks/chunk-CRV2Q3PB.js";
20
+ import "../safe-bash/command-chunks/chunk-6QBMND4A.js";
21
21
  import "../safe-bash/command-chunks/chunk-HR2Y6YEP.js";
22
- import "../safe-bash/command-chunks/chunk-ORZRWT62.js";
23
- import "../safe-bash/command-chunks/chunk-VPDSQPSN.js";
24
- import "../safe-bash/command-chunks/chunk-S4IIOSRA.js";
25
- import "../safe-bash/command-chunks/chunk-SFCERNHU.js";
26
- import "../safe-bash/command-chunks/chunk-KMMAJ6H6.js";
27
- import "../safe-bash/command-chunks/chunk-MMBRBANA.js";
28
- import "../safe-bash/command-chunks/chunk-FXKBM5KJ.js";
29
- import "../safe-bash/command-chunks/chunk-6UHGIWFX.js";
30
- import "../safe-bash/command-chunks/chunk-5L6GHFRW.js";
31
- import "../safe-bash/command-chunks/chunk-DVQBZXMQ.js";
32
- import "../safe-bash/command-chunks/chunk-NTRZMQZP.js";
33
- import "../safe-bash/command-chunks/chunk-AXWPJRY6.js";
22
+ import "../safe-bash/command-chunks/chunk-56NYSX65.js";
23
+ import "../safe-bash/command-chunks/chunk-DM2CPMB4.js";
24
+ import "../safe-bash/command-chunks/chunk-X7FA7ZD5.js";
25
+ import "../safe-bash/command-chunks/chunk-XPD636C4.js";
26
+ import "../safe-bash/command-chunks/chunk-PNGDJA6M.js";
27
+ import "../safe-bash/command-chunks/chunk-RNSKXOG3.js";
28
+ import "../safe-bash/command-chunks/chunk-QC5RMGSA.js";
29
+ import "../safe-bash/command-chunks/chunk-2ZFLMWOX.js";
30
+ import "../safe-bash/command-chunks/chunk-554Z6IKP.js";
31
+ import "../safe-bash/command-chunks/chunk-WJCN2IXI.js";
32
+ import "../safe-bash/command-chunks/chunk-ZMHEGDU2.js";
33
+ import "../safe-bash/command-chunks/chunk-36XGIPOG.js";
34
34
  import "../safe-bash/command-chunks/chunk-ZITBS2EB.js";
35
- import "../safe-bash/command-chunks/chunk-NXCMXD74.js";
36
- import "../safe-bash/command-chunks/chunk-KJ3PEDI2.js";
35
+ import "../safe-bash/command-chunks/chunk-S6R3IB36.js";
36
+ import "../safe-bash/command-chunks/chunk-Q73EMLLZ.js";
37
37
  import "../safe-bash/command-chunks/chunk-37XCUS43.js";
38
38
  import "../safe-bash/command-chunks/chunk-IOEUZ4EA.js";
39
39
  import "../safe-bash/command-chunks/chunk-E6SK3OU2.js";
@@ -3,22 +3,22 @@ import {
3
3
  mutateAnimations,
4
4
  mutateAnimationsBatch,
5
5
  validateAnimationOptions
6
- } from "../safe-bash/command-chunks/chunk-DC3OJLRB.js";
7
- import "../safe-bash/command-chunks/chunk-ORZRWT62.js";
8
- import "../safe-bash/command-chunks/chunk-VPDSQPSN.js";
9
- import "../safe-bash/command-chunks/chunk-S4IIOSRA.js";
10
- import "../safe-bash/command-chunks/chunk-SFCERNHU.js";
11
- import "../safe-bash/command-chunks/chunk-KMMAJ6H6.js";
12
- import "../safe-bash/command-chunks/chunk-MMBRBANA.js";
13
- import "../safe-bash/command-chunks/chunk-FXKBM5KJ.js";
14
- import "../safe-bash/command-chunks/chunk-6UHGIWFX.js";
15
- import "../safe-bash/command-chunks/chunk-5L6GHFRW.js";
16
- import "../safe-bash/command-chunks/chunk-DVQBZXMQ.js";
17
- import "../safe-bash/command-chunks/chunk-NTRZMQZP.js";
18
- import "../safe-bash/command-chunks/chunk-AXWPJRY6.js";
6
+ } from "../safe-bash/command-chunks/chunk-NQDIT667.js";
7
+ import "../safe-bash/command-chunks/chunk-56NYSX65.js";
8
+ import "../safe-bash/command-chunks/chunk-DM2CPMB4.js";
9
+ import "../safe-bash/command-chunks/chunk-X7FA7ZD5.js";
10
+ import "../safe-bash/command-chunks/chunk-XPD636C4.js";
11
+ import "../safe-bash/command-chunks/chunk-PNGDJA6M.js";
12
+ import "../safe-bash/command-chunks/chunk-RNSKXOG3.js";
13
+ import "../safe-bash/command-chunks/chunk-QC5RMGSA.js";
14
+ import "../safe-bash/command-chunks/chunk-2ZFLMWOX.js";
15
+ import "../safe-bash/command-chunks/chunk-554Z6IKP.js";
16
+ import "../safe-bash/command-chunks/chunk-WJCN2IXI.js";
17
+ import "../safe-bash/command-chunks/chunk-ZMHEGDU2.js";
18
+ import "../safe-bash/command-chunks/chunk-36XGIPOG.js";
19
19
  import "../safe-bash/command-chunks/chunk-ZITBS2EB.js";
20
- import "../safe-bash/command-chunks/chunk-NXCMXD74.js";
21
- import "../safe-bash/command-chunks/chunk-KJ3PEDI2.js";
20
+ import "../safe-bash/command-chunks/chunk-S6R3IB36.js";
21
+ import "../safe-bash/command-chunks/chunk-Q73EMLLZ.js";
22
22
  import "../safe-bash/command-chunks/chunk-37XCUS43.js";
23
23
  import "../safe-bash/command-chunks/chunk-IOEUZ4EA.js";
24
24
  import "../safe-bash/command-chunks/chunk-E6SK3OU2.js";
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  readAnimations
3
- } from "../safe-bash/command-chunks/chunk-TZJC67W3.js";
4
- import "../safe-bash/command-chunks/chunk-ORZRWT62.js";
5
- import "../safe-bash/command-chunks/chunk-VPDSQPSN.js";
6
- import "../safe-bash/command-chunks/chunk-S4IIOSRA.js";
7
- import "../safe-bash/command-chunks/chunk-SFCERNHU.js";
8
- import "../safe-bash/command-chunks/chunk-KMMAJ6H6.js";
9
- import "../safe-bash/command-chunks/chunk-MMBRBANA.js";
10
- import "../safe-bash/command-chunks/chunk-FXKBM5KJ.js";
11
- import "../safe-bash/command-chunks/chunk-6UHGIWFX.js";
12
- import "../safe-bash/command-chunks/chunk-5L6GHFRW.js";
13
- import "../safe-bash/command-chunks/chunk-DVQBZXMQ.js";
14
- import "../safe-bash/command-chunks/chunk-NTRZMQZP.js";
15
- import "../safe-bash/command-chunks/chunk-AXWPJRY6.js";
3
+ } from "../safe-bash/command-chunks/chunk-7PVHO47B.js";
4
+ import "../safe-bash/command-chunks/chunk-56NYSX65.js";
5
+ import "../safe-bash/command-chunks/chunk-DM2CPMB4.js";
6
+ import "../safe-bash/command-chunks/chunk-X7FA7ZD5.js";
7
+ import "../safe-bash/command-chunks/chunk-XPD636C4.js";
8
+ import "../safe-bash/command-chunks/chunk-PNGDJA6M.js";
9
+ import "../safe-bash/command-chunks/chunk-RNSKXOG3.js";
10
+ import "../safe-bash/command-chunks/chunk-QC5RMGSA.js";
11
+ import "../safe-bash/command-chunks/chunk-2ZFLMWOX.js";
12
+ import "../safe-bash/command-chunks/chunk-554Z6IKP.js";
13
+ import "../safe-bash/command-chunks/chunk-WJCN2IXI.js";
14
+ import "../safe-bash/command-chunks/chunk-ZMHEGDU2.js";
15
+ import "../safe-bash/command-chunks/chunk-36XGIPOG.js";
16
16
  import "../safe-bash/command-chunks/chunk-ZITBS2EB.js";
17
- import "../safe-bash/command-chunks/chunk-NXCMXD74.js";
18
- import "../safe-bash/command-chunks/chunk-KJ3PEDI2.js";
17
+ import "../safe-bash/command-chunks/chunk-S6R3IB36.js";
18
+ import "../safe-bash/command-chunks/chunk-Q73EMLLZ.js";
19
19
  import "../safe-bash/command-chunks/chunk-37XCUS43.js";
20
20
  import "../safe-bash/command-chunks/chunk-IOEUZ4EA.js";
21
21
  import "../safe-bash/command-chunks/chunk-E6SK3OU2.js";
@@ -1,23 +1,23 @@
1
1
  import {
2
2
  mutateBackground,
3
3
  readBackgrounds
4
- } from "../safe-bash/command-chunks/chunk-PTZ55XXN.js";
5
- import "../safe-bash/command-chunks/chunk-7AVN3OBH.js";
6
- import "../safe-bash/command-chunks/chunk-ORZRWT62.js";
7
- import "../safe-bash/command-chunks/chunk-VPDSQPSN.js";
8
- import "../safe-bash/command-chunks/chunk-S4IIOSRA.js";
9
- import "../safe-bash/command-chunks/chunk-SFCERNHU.js";
10
- import "../safe-bash/command-chunks/chunk-KMMAJ6H6.js";
11
- import "../safe-bash/command-chunks/chunk-MMBRBANA.js";
12
- import "../safe-bash/command-chunks/chunk-FXKBM5KJ.js";
13
- import "../safe-bash/command-chunks/chunk-6UHGIWFX.js";
14
- import "../safe-bash/command-chunks/chunk-5L6GHFRW.js";
15
- import "../safe-bash/command-chunks/chunk-DVQBZXMQ.js";
16
- import "../safe-bash/command-chunks/chunk-NTRZMQZP.js";
17
- import "../safe-bash/command-chunks/chunk-AXWPJRY6.js";
4
+ } from "../safe-bash/command-chunks/chunk-APEWTWCC.js";
5
+ import "../safe-bash/command-chunks/chunk-RHYJVTJO.js";
6
+ import "../safe-bash/command-chunks/chunk-56NYSX65.js";
7
+ import "../safe-bash/command-chunks/chunk-DM2CPMB4.js";
8
+ import "../safe-bash/command-chunks/chunk-X7FA7ZD5.js";
9
+ import "../safe-bash/command-chunks/chunk-XPD636C4.js";
10
+ import "../safe-bash/command-chunks/chunk-PNGDJA6M.js";
11
+ import "../safe-bash/command-chunks/chunk-RNSKXOG3.js";
12
+ import "../safe-bash/command-chunks/chunk-QC5RMGSA.js";
13
+ import "../safe-bash/command-chunks/chunk-2ZFLMWOX.js";
14
+ import "../safe-bash/command-chunks/chunk-554Z6IKP.js";
15
+ import "../safe-bash/command-chunks/chunk-WJCN2IXI.js";
16
+ import "../safe-bash/command-chunks/chunk-ZMHEGDU2.js";
17
+ import "../safe-bash/command-chunks/chunk-36XGIPOG.js";
18
18
  import "../safe-bash/command-chunks/chunk-ZITBS2EB.js";
19
- import "../safe-bash/command-chunks/chunk-NXCMXD74.js";
20
- import "../safe-bash/command-chunks/chunk-KJ3PEDI2.js";
19
+ import "../safe-bash/command-chunks/chunk-S6R3IB36.js";
20
+ import "../safe-bash/command-chunks/chunk-Q73EMLLZ.js";
21
21
  import "../safe-bash/command-chunks/chunk-37XCUS43.js";
22
22
  import "../safe-bash/command-chunks/chunk-IOEUZ4EA.js";
23
23
  import "../safe-bash/command-chunks/chunk-E6SK3OU2.js";