@poe-platform/safe-bash 0.1.812 → 0.1.813

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (329) hide show
  1. package/dist/audio-ast/id3-source.d.ts +27 -0
  2. package/dist/audio-ast/index.d.ts +4 -0
  3. package/dist/audio-ast/index.js +996 -596
  4. package/dist/audio-ast/mp3-source.d.ts +18 -0
  5. package/dist/audio-ast/ogg-source.d.ts +25 -0
  6. package/dist/audio-ast/ogg-stream-source.d.ts +22 -0
  7. package/dist/image-ast/index.js +139 -9
  8. package/dist/mp4-ast/containers/adapters.d.ts +7 -0
  9. package/dist/office-xml/retained-xml-document.d.ts +8 -0
  10. package/dist/pdf-ast/ast.d.ts +2 -0
  11. package/dist/pdf-ast/content/dictionary-cursor.d.ts +15 -0
  12. package/dist/pdf-ast/content/range-operator-parser.d.ts +4 -0
  13. package/dist/pdf-ast/content/stored-dictionary.d.ts +10 -0
  14. package/dist/pdf-ast/cos/lexer.d.ts +8 -5
  15. package/dist/pdf-ast/cos/object-reader.d.ts +4 -3
  16. package/dist/pdf-ast/cos/range-parser.d.ts +4 -0
  17. package/dist/pdf-ast/cos/retained-objects.d.ts +1 -0
  18. package/dist/pdf-ast/cos/retained-writer.d.ts +1 -0
  19. package/dist/pdf-ast/cos/value-parser.d.ts +9 -0
  20. package/dist/pdf-ast/edit/retained-append-attachments.d.ts +13 -0
  21. package/dist/pdf-ast/edit/retained-bookmarks.d.ts +13 -0
  22. package/dist/pdf-ast/edit/retained-graph.d.ts +6 -0
  23. package/dist/pdf-ast/edit/retained-save.d.ts +2 -0
  24. package/dist/pdf-ast/edit/retained-stamps.d.ts +9 -0
  25. package/dist/pdf-ast/fonts/resolve.d.ts +3 -1
  26. package/dist/pdf-ast/index.d.ts +3 -1
  27. package/dist/pdf-ast/index.js +1557 -770
  28. package/dist/safe-bash/audio-ast.browser.js +6 -1
  29. package/dist/safe-bash/chunks/{chunk-HHSOUC3Z.js → chunk-HPQE675Q.js} +1 -1
  30. package/dist/safe-bash/chunks/{chunk-BUYRKFW2.js → chunk-I6ECNJMR.js} +1 -1
  31. package/dist/safe-bash/chunks/{pdftk-WRYEP3CA.js → pdftk-Y2TX74LY.js} +2 -1
  32. package/dist/safe-bash/command-chunks/biff-4ALVARRF-7SRX6R6N.js +5192 -0
  33. package/dist/safe-bash/command-chunks/{chunk-EHSM5ZQS.js → chunk-2DGJOOXM.js} +8 -8
  34. package/dist/safe-bash/command-chunks/{chunk-Q6S57NOQ.js → chunk-2E2H7MBH.js} +7 -7
  35. package/dist/safe-bash/command-chunks/{chunk-MMBZTYXO.js → chunk-2PQRZDNR.js} +221 -0
  36. package/dist/safe-bash/command-chunks/{chunk-NARD63DY.js → chunk-2V6FOLXV.js} +22 -66
  37. package/dist/safe-bash/command-chunks/{chunk-56NYSX65.js → chunk-2Z3WRRFT.js} +9 -9
  38. package/dist/safe-bash/command-chunks/chunk-3D24WDND.js +63 -0
  39. package/dist/safe-bash/command-chunks/{chunk-47NEG4UO.js → chunk-3JST2Q7G.js} +219 -43
  40. package/dist/safe-bash/command-chunks/{chunk-WGG6G2KG.js → chunk-3LJAXFH5.js} +7 -7
  41. package/dist/safe-bash/command-chunks/{chunk-AHA6IWAJ.js → chunk-3TYDSGAH.js} +6 -6
  42. package/dist/safe-bash/command-chunks/{chunk-YSMNXMAO.js → chunk-3Y4XZB24.js} +4 -4
  43. package/dist/safe-bash/command-chunks/{chunk-ZIIO6GRY.js → chunk-4PBNMKAT.js} +7 -7
  44. package/dist/safe-bash/command-chunks/{chunk-JFYWVQ4V.js → chunk-4Z6W5EOC.js} +8 -8
  45. package/dist/safe-bash/command-chunks/{chunk-GEM47B2P.js → chunk-57DDYKE5.js} +7 -7
  46. package/dist/safe-bash/command-chunks/{chunk-4CKFNXRN.js → chunk-5IFRAI7Y.js} +1 -1
  47. package/dist/safe-bash/command-chunks/{chunk-RHYJVTJO.js → chunk-5KGEZ3RW.js} +2 -2
  48. package/dist/safe-bash/command-chunks/{chunk-A5FZBR7X.js → chunk-5MFDRSGG.js} +4 -4
  49. package/dist/safe-bash/command-chunks/{chunk-7GKKMNL6.js → chunk-5P6I2T63.js} +8 -8
  50. package/dist/safe-bash/command-chunks/{chunk-6M6TM5Z5.js → chunk-5VQVZPP3.js} +3 -3
  51. package/dist/safe-bash/command-chunks/{chunk-MIRL7HTF.js → chunk-6244HYJY.js} +1 -1
  52. package/dist/safe-bash/command-chunks/chunk-63EMPQ7Z.js +115 -0
  53. package/dist/safe-bash/command-chunks/{chunk-XRVKWGVQ.js → chunk-6CY5BHBS.js} +6 -6
  54. package/dist/safe-bash/command-chunks/{chunk-XVP6V5K3.js → chunk-6IWE7PTK.js} +6 -6
  55. package/dist/safe-bash/command-chunks/{chunk-6QBMND4A.js → chunk-6SRHWVEB.js} +1 -1
  56. package/dist/safe-bash/command-chunks/chunk-6ZHQB453.js +35 -0
  57. package/dist/safe-bash/command-chunks/chunk-73NYFNAS.js +173 -0
  58. package/dist/safe-bash/command-chunks/{chunk-2JSDKQ4J.js → chunk-7NXTEWPR.js} +119 -44
  59. package/dist/safe-bash/command-chunks/{chunk-554Z6IKP.js → chunk-7PRL6RJ6.js} +2 -2
  60. package/dist/safe-bash/command-chunks/{chunk-SDTPO2VV.js → chunk-7PZHWMK6.js} +7 -7
  61. package/dist/safe-bash/command-chunks/{chunk-XZ2FWFNV.js → chunk-7QZ2HP2F.js} +6 -6
  62. package/dist/safe-bash/command-chunks/{chunk-OEJM666F.js → chunk-7UC2Q6Z6.js} +5 -5
  63. package/dist/safe-bash/command-chunks/{chunk-COKYZUBW.js → chunk-AJI55RS7.js} +1 -1
  64. package/dist/safe-bash/command-chunks/{chunk-WXRYDALR.js → chunk-BBAB7LC4.js} +4 -4
  65. package/dist/safe-bash/command-chunks/{chunk-QYMEASQ6.js → chunk-BEHUSUOY.js} +4 -4
  66. package/dist/safe-bash/command-chunks/{chunk-Z2JW6M2D.js → chunk-BK7ISUJL.js} +3 -3
  67. package/dist/safe-bash/command-chunks/{chunk-33YCKZZX.js → chunk-C5KLFZGT.js} +6 -6
  68. package/dist/safe-bash/command-chunks/{chunk-TVH4JORU.js → chunk-C5QDEB3I.js} +3 -3
  69. package/dist/safe-bash/command-chunks/{chunk-N4R2SHSS.js → chunk-CCZZVCHX.js} +2 -2
  70. package/dist/safe-bash/command-chunks/{chunk-2VLAXKTS.js → chunk-CTDC4LJT.js} +121 -85
  71. package/dist/safe-bash/command-chunks/{chunk-S6R3IB36.js → chunk-D55REQA3.js} +1 -1
  72. package/dist/safe-bash/command-chunks/{chunk-Y4EYCZFT.js → chunk-D6WJY6QO.js} +10 -10
  73. package/dist/safe-bash/command-chunks/{chunk-2CORNDGF.js → chunk-DBLHCJJU.js} +2 -2
  74. package/dist/safe-bash/command-chunks/{chunk-SPW4GW4Z.js → chunk-DFI7QF3M.js} +2 -2
  75. package/dist/safe-bash/command-chunks/{chunk-456PHA3L.js → chunk-DMCI6T6N.js} +1 -1
  76. package/dist/safe-bash/command-chunks/{chunk-TW73OXPR.js → chunk-EJTNVXWF.js} +6 -6
  77. package/dist/safe-bash/command-chunks/{chunk-QD7ZRDUN.js → chunk-ET2VPDUA.js} +1 -1
  78. package/dist/safe-bash/command-chunks/{chunk-CJQSAATC.js → chunk-EXOQGXEU.js} +26 -26
  79. package/dist/safe-bash/command-chunks/{chunk-CRV2Q3PB.js → chunk-EZ4NQIPL.js} +1 -1
  80. package/dist/safe-bash/command-chunks/chunk-FWKLBDMK.js +0 -0
  81. package/dist/safe-bash/command-chunks/{chunk-22MOB45U.js → chunk-FWPVQGYK.js} +6 -6
  82. package/dist/safe-bash/command-chunks/{chunk-QC5RMGSA.js → chunk-G3RUXKVY.js} +3 -3
  83. package/dist/safe-bash/command-chunks/{chunk-JYUJAF4L.js → chunk-G7NENPYV.js} +4 -0
  84. package/dist/safe-bash/command-chunks/{chunk-KCOJA7EM.js → chunk-GKILM4HZ.js} +7 -7
  85. package/dist/safe-bash/command-chunks/{chunk-HTVIYLVB.js → chunk-GNXTMSYN.js} +4 -4
  86. package/dist/safe-bash/command-chunks/{chunk-D2ASPM7R.js → chunk-GOBUDKZ3.js} +3 -3
  87. package/dist/safe-bash/command-chunks/{chunk-RNSKXOG3.js → chunk-GVWVRPG6.js} +6 -6
  88. package/dist/safe-bash/command-chunks/{chunk-FDCIPJBQ.js → chunk-HCKYUQ3L.js} +7 -7
  89. package/dist/safe-bash/command-chunks/{chunk-AGLK7OJR.js → chunk-HDSIIQBS.js} +1 -1
  90. package/dist/safe-bash/command-chunks/{chunk-DM2CPMB4.js → chunk-HKOMXGJS.js} +2 -2
  91. package/dist/safe-bash/command-chunks/{chunk-IT7TAC3F.js → chunk-HVW53ARH.js} +16 -16
  92. package/dist/safe-bash/command-chunks/{chunk-M7QE2MN7.js → chunk-I4GMCWAT.js} +6 -6
  93. package/dist/safe-bash/command-chunks/{chunk-HWQ2UHMT.js → chunk-IHSOOSNC.js} +9 -9
  94. package/dist/safe-bash/command-chunks/{chunk-LCZDBW55.js → chunk-JAHJWVGF.js} +5 -5
  95. package/dist/safe-bash/command-chunks/{chunk-MOZD7RUY.js → chunk-JORIVUPM.js} +27 -11
  96. package/dist/safe-bash/command-chunks/{chunk-PMAM4N33.js → chunk-JUJHYPYL.js} +9 -9
  97. package/dist/safe-bash/command-chunks/{chunk-ENT3IV2G.js → chunk-KBUBSMCQ.js} +12 -12
  98. package/dist/safe-bash/command-chunks/{chunk-ZXR6LXV5.js → chunk-KCE5D4Z4.js} +48 -4
  99. package/dist/safe-bash/command-chunks/{chunk-FIIAYCWS.js → chunk-KZ5ODST6.js} +2 -2
  100. package/dist/safe-bash/command-chunks/{chunk-PNGDJA6M.js → chunk-LD7BONZY.js} +2 -2
  101. package/dist/safe-bash/command-chunks/{chunk-KJ4XXZIL.js → chunk-M3Z5PU2M.js} +582 -59
  102. package/dist/safe-bash/command-chunks/{chunk-LXLLA4PM.js → chunk-MKX4JAZ6.js} +17 -17
  103. package/dist/safe-bash/command-chunks/{chunk-RQIQ75W5.js → chunk-MNHBQBF6.js} +5 -5
  104. package/dist/safe-bash/command-chunks/{chunk-A2CLZMQZ.js → chunk-MPKY37QR.js} +1 -1
  105. package/dist/safe-bash/command-chunks/{chunk-K5GB2YMN.js → chunk-MUUWBZIC.js} +10 -10
  106. package/dist/safe-bash/command-chunks/{chunk-JOCFI7TG.js → chunk-N32GSM3J.js} +1 -1
  107. package/dist/safe-bash/command-chunks/{chunk-EUT24Y5Z.js → chunk-NKTULXVD.js} +8 -8
  108. package/dist/safe-bash/command-chunks/{chunk-5HPU7D36.js → chunk-NMPED6L5.js} +4 -4
  109. package/dist/safe-bash/command-chunks/{chunk-QZZ73J2O.js → chunk-NPFHUS4X.js} +6 -6
  110. package/dist/safe-bash/command-chunks/{chunk-X7FA7ZD5.js → chunk-O675URF4.js} +8 -8
  111. package/dist/safe-bash/command-chunks/{chunk-R6EGGK5M.js → chunk-P7EL2FWW.js} +7 -7
  112. package/dist/safe-bash/command-chunks/{chunk-YS25EI54.js → chunk-PCCFLPUQ.js} +2 -2
  113. package/dist/safe-bash/command-chunks/{chunk-RRL3Y562.js → chunk-PI6MOMHA.js} +11 -11
  114. package/dist/safe-bash/command-chunks/{chunk-26VCZHLJ.js → chunk-PIOQBOEK.js} +1 -1
  115. package/dist/safe-bash/command-chunks/chunk-PK36TVXB.js +175 -0
  116. package/dist/safe-bash/command-chunks/{chunk-3Q247UDJ.js → chunk-PKLJRB7W.js} +264 -129
  117. package/dist/safe-bash/command-chunks/{chunk-6CCQI6XZ.js → chunk-PSCOXGCA.js} +12 -12
  118. package/dist/safe-bash/command-chunks/{chunk-XPD636C4.js → chunk-PVGZMLC6.js} +3 -3
  119. package/dist/safe-bash/command-chunks/{chunk-JQVHUSDD.js → chunk-PXWS3Q7L.js} +5 -5
  120. package/dist/safe-bash/command-chunks/{chunk-HDJVJTCK.js → chunk-QFF5KBOM.js} +9 -9
  121. package/dist/safe-bash/command-chunks/{chunk-MPUHH2KR.js → chunk-QM2HZJSJ.js} +3 -3
  122. package/dist/safe-bash/command-chunks/{chunk-UAXSE3XE.js → chunk-R2BMZAHG.js} +5 -5
  123. package/dist/safe-bash/command-chunks/{chunk-KB7DUBVL.js → chunk-RGOQKIG6.js} +5 -5
  124. package/dist/safe-bash/command-chunks/{chunk-D2KZ66W4.js → chunk-RLCQ7BN3.js} +187 -39
  125. package/dist/safe-bash/command-chunks/{chunk-B5LDP7AA.js → chunk-S2N2V5U4.js} +2 -2
  126. package/dist/safe-bash/command-chunks/{chunk-OA75SGN2.js → chunk-SGPCXAG7.js} +7 -7
  127. package/dist/safe-bash/command-chunks/{chunk-QUM3SYAJ.js → chunk-SYSX46IV.js} +3 -3
  128. package/dist/safe-bash/command-chunks/chunk-T3E5RV3U.js +737 -0
  129. package/dist/safe-bash/command-chunks/{chunk-YORJDX4V.js → chunk-T5ERNELL.js} +4 -4
  130. package/dist/safe-bash/command-chunks/{chunk-ZEX53S5I.js → chunk-T6C5QP7T.js} +6368 -6230
  131. package/dist/safe-bash/command-chunks/{chunk-ATTWQVR2.js → chunk-TKRLZIFI.js} +17 -17
  132. package/dist/safe-bash/command-chunks/{chunk-ZMHEGDU2.js → chunk-TODWFDYB.js} +2 -2
  133. package/dist/safe-bash/command-chunks/{chunk-XVLWZTPY.js → chunk-TQEB4DH4.js} +543 -144
  134. package/dist/safe-bash/command-chunks/{chunk-36XGIPOG.js → chunk-U5TWQFZY.js} +1 -1
  135. package/dist/safe-bash/command-chunks/{chunk-APEWTWCC.js → chunk-UAF4IX5H.js} +6 -6
  136. package/dist/safe-bash/command-chunks/{chunk-6VPQ3CDZ.js → chunk-V37D6AHO.js} +5 -5
  137. package/dist/safe-bash/command-chunks/{chunk-RID6VYS3.js → chunk-V6XBEYPC.js} +8 -8
  138. package/dist/safe-bash/command-chunks/{chunk-WJCN2IXI.js → chunk-VQOINPVF.js} +2 -2
  139. package/dist/safe-bash/command-chunks/{chunk-W5YSINXC.js → chunk-VVWXY6IA.js} +6 -6
  140. package/dist/safe-bash/command-chunks/{chunk-HKATEVAP.js → chunk-WPVBUVFK.js} +6 -6
  141. package/dist/safe-bash/command-chunks/{chunk-UYWSIIUX.js → chunk-X53AEG36.js} +7 -7
  142. package/dist/safe-bash/command-chunks/{chunk-L5MCW6CM.js → chunk-X64XGIXZ.js} +9 -155
  143. package/dist/safe-bash/command-chunks/{chunk-Q73EMLLZ.js → chunk-X6RHJ6YN.js} +84 -5
  144. package/dist/safe-bash/command-chunks/{chunk-7PVHO47B.js → chunk-XG6UWQV5.js} +6 -6
  145. package/dist/safe-bash/command-chunks/{chunk-NQDIT667.js → chunk-XIDGHIGB.js} +5 -5
  146. package/dist/safe-bash/command-chunks/{chunk-CV7M2QJU.js → chunk-XLYIVBAR.js} +7 -7
  147. package/dist/safe-bash/command-chunks/{chunk-WVMHRNXZ.js → chunk-YUXTK3XA.js} +3 -3
  148. package/dist/safe-bash/command-chunks/{chunk-SPLOIABU.js → chunk-YXD6VGVG.js} +3 -3
  149. package/dist/safe-bash/command-chunks/{chunk-2ZFLMWOX.js → chunk-Z5BIM5B7.js} +1 -1
  150. package/dist/safe-bash/command-chunks/chunk-ZYLGNIGA.js +156 -0
  151. package/dist/safe-bash/command-chunks/{command-engine-BCUQGJJ4.js → command-engine-X3OLN7N6.js} +150 -67
  152. package/dist/safe-bash/command-chunks/{engine-LAUEWYSQ-DQCEI5HE.js → engine-XUCIFZ7V-LJFGZM6O.js} +1 -1
  153. package/dist/safe-bash/command-chunks/paradox-4FCZE53D-LQPGVMEL.js +365 -0
  154. package/dist/safe-bash/commands/pandoc/index.browser.js +1 -1
  155. package/dist/safe-bash/full-core.browser.js +2 -2
  156. package/dist/safe-bash/plugins/index.browser.js +2 -2
  157. package/dist/safe-bash-command-diff/diff.js +1 -1
  158. package/dist/safe-bash-command-diff/index.js +1 -1
  159. package/dist/safe-bash-command-ffmpeg/index.js +1 -1
  160. package/dist/safe-bash-command-ffprobe/index.js +2 -2
  161. package/dist/safe-bash-command-ffprobe/media.d.ts +3 -1
  162. package/dist/safe-bash-command-ffprobe/media.js +2 -2
  163. package/dist/safe-bash-command-html-to-markdown/budget.js +2 -1
  164. package/dist/safe-bash-command-html-to-markdown/entities.js +4 -3
  165. package/dist/safe-bash-command-html-to-markdown/index.js +564 -110
  166. package/dist/safe-bash-command-html-to-markdown/input.js +6 -5
  167. package/dist/safe-bash-command-html-to-markdown/options.js +2 -1
  168. package/dist/safe-bash-command-html-to-markdown/parser.js +5 -4
  169. package/dist/safe-bash-command-html-to-markdown/render.js +6 -5
  170. package/dist/safe-bash-command-html-to-markdown/text.js +3 -2
  171. package/dist/safe-bash-command-htmlq/index.js +361 -37
  172. package/dist/safe-bash-command-htmlq/tree.d.ts +3 -2
  173. package/dist/safe-bash-command-pandoc/command.js +7 -7
  174. package/dist/safe-bash-command-pandoc/index.js +55 -55
  175. package/dist/safe-bash-command-patch/index.js +6 -6
  176. package/dist/safe-bash-command-patch/patch-envelope.js +53 -3
  177. package/dist/safe-bash-command-patch/patch-formats.d.ts +2 -2
  178. package/dist/safe-bash-command-patch/patch-formats.js +2 -2
  179. package/dist/safe-bash-command-patch/patch-gnu-reject.d.ts +2 -1
  180. package/dist/safe-bash-command-patch/patch-gnu-reject.js +4 -3
  181. package/dist/safe-bash-command-patch/patch-publication.js +2 -1
  182. package/dist/safe-bash-command-patch/patch.js +6 -6
  183. package/dist/safe-bash-command-patch/unified.d.ts +10 -2
  184. package/dist/safe-bash-command-patch/unified.js +1 -1
  185. package/dist/safe-bash-command-pdftk/index.d.ts +6 -2
  186. package/dist/safe-bash-command-pdftk/index.js +830 -271
  187. package/dist/safe-bash-command-pptx/command-engine.d.ts +3 -0
  188. package/dist/safe-bash-command-pptx/engine.js +1 -1
  189. package/dist/safe-bash-command-pptx/index.js +9 -2
  190. package/dist/safe-bash-command-soffice/index.js +1 -1
  191. package/dist/safe-bash-command-ssconvert/index.js +2 -2
  192. package/dist/safe-bash-command-xmllint/index.js +22 -31
  193. package/dist/safe-bash-presentation-engine/accessibility.js +31 -30
  194. package/dist/safe-bash-presentation-engine/animation-editing.js +16 -15
  195. package/dist/safe-bash-presentation-engine/animations.js +16 -15
  196. package/dist/safe-bash-presentation-engine/backgrounds.js +17 -16
  197. package/dist/safe-bash-presentation-engine/bytes.js +3 -3
  198. package/dist/safe-bash-presentation-engine/chart-editing.js +34 -33
  199. package/dist/safe-bash-presentation-engine/chart-object-operations.js +25 -24
  200. package/dist/safe-bash-presentation-engine/charts.js +31 -30
  201. package/dist/safe-bash-presentation-engine/command-placeholder.js +59 -56
  202. package/dist/safe-bash-presentation-engine/comments.js +17 -16
  203. package/dist/safe-bash-presentation-engine/connector-operations.js +32 -31
  204. package/dist/safe-bash-presentation-engine/connectors.js +29 -28
  205. package/dist/safe-bash-presentation-engine/content-types.js +4 -4
  206. package/dist/safe-bash-presentation-engine/creation.js +6 -6
  207. package/dist/safe-bash-presentation-engine/diff.js +32 -31
  208. package/dist/safe-bash-presentation-engine/drawing-enums.d.ts +10 -10
  209. package/dist/safe-bash-presentation-engine/drawing-format.js +20 -19
  210. package/dist/safe-bash-presentation-engine/drawing-operations.js +31 -30
  211. package/dist/safe-bash-presentation-engine/drawing-schema.js +21 -20
  212. package/dist/safe-bash-presentation-engine/equations.js +17 -16
  213. package/dist/safe-bash-presentation-engine/errors.js +2 -2
  214. package/dist/safe-bash-presentation-engine/fields.js +17 -16
  215. package/dist/safe-bash-presentation-engine/font-metrics.js +3 -3
  216. package/dist/safe-bash-presentation-engine/image-extraction.js +20 -19
  217. package/dist/safe-bash-presentation-engine/image-formatting.js +32 -31
  218. package/dist/safe-bash-presentation-engine/image-insertion.js +18 -17
  219. package/dist/safe-bash-presentation-engine/image-replacement.js +21 -20
  220. package/dist/safe-bash-presentation-engine/image-value.js +4 -4
  221. package/dist/safe-bash-presentation-engine/images.js +19 -18
  222. package/dist/safe-bash-presentation-engine/index.d.ts +5 -1
  223. package/dist/safe-bash-presentation-engine/index.js +109 -96
  224. package/dist/safe-bash-presentation-engine/layouts.js +16 -15
  225. package/dist/safe-bash-presentation-engine/length.js +3 -3
  226. package/dist/safe-bash-presentation-engine/links.js +16 -15
  227. package/dist/safe-bash-presentation-engine/masters.js +15 -14
  228. package/dist/safe-bash-presentation-engine/media-editing.js +24 -23
  229. package/dist/safe-bash-presentation-engine/media-extraction.js +17 -16
  230. package/dist/safe-bash-presentation-engine/media.js +16 -15
  231. package/dist/safe-bash-presentation-engine/memberships.js +15 -14
  232. package/dist/safe-bash-presentation-engine/notes.js +16 -15
  233. package/dist/safe-bash-presentation-engine/ole-enum.js +4 -4
  234. package/dist/safe-bash-presentation-engine/ole-insertion.js +20 -19
  235. package/dist/safe-bash-presentation-engine/opaque-objects.js +9 -9
  236. package/dist/safe-bash-presentation-engine/package-reader.js +5 -5
  237. package/dist/safe-bash-presentation-engine/package-tools.d.ts +3 -0
  238. package/dist/safe-bash-presentation-engine/package-tools.js +27 -17
  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 +58 -55
  242. package/dist/safe-bash-presentation-engine/presentation-settings.js +14 -13
  243. package/dist/safe-bash-presentation-engine/properties.js +16 -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-archive-staging.d.ts +19 -0
  247. package/dist/safe-bash-presentation-engine/retained-extraction-output.d.ts +18 -0
  248. package/dist/safe-bash-presentation-engine/retained-inspection.js +14 -12
  249. package/dist/safe-bash-presentation-engine/retained-package-extraction.d.ts +22 -0
  250. package/dist/safe-bash-presentation-engine/retained-package-packing.d.ts +19 -0
  251. package/dist/safe-bash-presentation-engine/retained-package.d.ts +2 -0
  252. package/dist/safe-bash-presentation-engine/retained-package.js +6 -4
  253. package/dist/safe-bash-presentation-engine/retained-text.js +19 -17
  254. package/dist/safe-bash-presentation-engine/retained-xml-parts.d.ts +5 -1
  255. package/dist/safe-bash-presentation-engine/retained-xml-publication.d.ts +18 -0
  256. package/dist/safe-bash-presentation-engine/retained-xml-replacement.d.ts +13 -0
  257. package/dist/safe-bash-presentation-engine/sanitize.js +17 -16
  258. package/dist/safe-bash-presentation-engine/selectors.js +10 -10
  259. package/dist/safe-bash-presentation-engine/shape-groups.js +31 -30
  260. package/dist/safe-bash-presentation-engine/shape-operations.js +30 -29
  261. package/dist/safe-bash-presentation-engine/shape-path-operations.js +32 -31
  262. package/dist/safe-bash-presentation-engine/shape-paths.js +16 -15
  263. package/dist/safe-bash-presentation-engine/shape-presets.js +3 -3
  264. package/dist/safe-bash-presentation-engine/shape-selection.js +31 -30
  265. package/dist/safe-bash-presentation-engine/shape-transforms.js +18 -17
  266. package/dist/safe-bash-presentation-engine/shapes.d.ts +1 -1
  267. package/dist/safe-bash-presentation-engine/shapes.js +27 -26
  268. package/dist/safe-bash-presentation-engine/slide-copy.js +17 -16
  269. package/dist/safe-bash-presentation-engine/slide-import.js +18 -17
  270. package/dist/safe-bash-presentation-engine/slide-merge-split.js +20 -19
  271. package/dist/safe-bash-presentation-engine/slide-model.js +43 -42
  272. package/dist/safe-bash-presentation-engine/slide-removal.js +18 -17
  273. package/dist/safe-bash-presentation-engine/slide-transfer-budget.js +9 -9
  274. package/dist/safe-bash-presentation-engine/slides.js +19 -16
  275. package/dist/safe-bash-presentation-engine/table-operations.js +33 -32
  276. package/dist/safe-bash-presentation-engine/table-spans.js +32 -31
  277. package/dist/safe-bash-presentation-engine/tables.js +31 -30
  278. package/dist/safe-bash-presentation-engine/tags.js +16 -15
  279. package/dist/safe-bash-presentation-engine/template-bindings.js +33 -32
  280. package/dist/safe-bash-presentation-engine/template-repeat.js +40 -39
  281. package/dist/safe-bash-presentation-engine/text-fitting.js +27 -26
  282. package/dist/safe-bash-presentation-engine/text-frames.js +27 -26
  283. package/dist/safe-bash-presentation-engine/text-paragraphs.js +27 -26
  284. package/dist/safe-bash-presentation-engine/text-reading.js +11 -11
  285. package/dist/safe-bash-presentation-engine/text-replacement.js +17 -16
  286. package/dist/safe-bash-presentation-engine/text-runs.js +20 -19
  287. package/dist/safe-bash-presentation-engine/themes.js +16 -15
  288. package/dist/safe-bash-presentation-engine/transitions.js +16 -15
  289. package/dist/safe-bash-presentation-engine/validation.js +10 -9
  290. package/dist/safe-bash-presentation-engine/xml-parts.d.ts +2 -0
  291. package/dist/safe-bash-presentation-engine/xml-parts.js +23 -15
  292. package/dist/safe-bash-presentation-engine/xml-view.js +3 -3
  293. package/dist/safe-bash-presentation-engine/xml.js +3 -3
  294. package/dist/safe-bash-regex-engine/index.js +1 -1
  295. package/dist/safe-bash-regex-engine/python-glob.js +1 -1
  296. package/dist/safe-bash-regex-engine/text/regex.d.ts +19 -0
  297. package/dist/safe-bash-regex-engine/text/regex.js +1 -1
  298. package/dist/safe-bash-xml-engine/document.js +3 -3
  299. package/dist/safe-bash-xml-engine/evaluate.js +1 -1
  300. package/dist/safe-bash-xml-engine/index.d.ts +1 -0
  301. package/dist/safe-bash-xml-engine/index.js +8 -4
  302. package/dist/safe-bash-xml-engine/query.js +2 -2
  303. package/dist/safe-bash-xml-engine/recovery.d.ts +10 -0
  304. package/dist/safe-bash-xml-engine/stored-document.d.ts +1 -1
  305. package/dist/safe-bash-xml-engine/stored-document.js +1 -1
  306. package/dist/safe-bash-xml-engine/stored-evaluate.js +1 -1
  307. package/dist/spreadsheet-engine/formulas/functions/python-printf.js +56 -33
  308. package/dist/spreadsheet-format-xls/biff-encrypted-properties.d.ts +1 -1
  309. package/dist/spreadsheet-format-xls/biff-encrypted-properties.js +47 -18
  310. package/dist/spreadsheet-format-xls/biff-properties-merge.d.ts +6 -2
  311. package/dist/spreadsheet-format-xls/biff-properties-merge.js +413 -296
  312. package/dist/spreadsheet-format-xls/biff-properties-write.js +40 -23
  313. package/dist/spreadsheet-format-xls/biff-properties.js +3 -68
  314. package/dist/spreadsheet-format-xls/biff-property-index.d.ts +23 -0
  315. package/dist/spreadsheet-format-xls/biff-property-index.js +93 -0
  316. package/dist/spreadsheet-format-xls/biff-property-name.d.ts +4 -0
  317. package/dist/spreadsheet-format-xls/biff-property-name.js +114 -0
  318. package/dist/spreadsheet-format-xls/biff-property-text.d.ts +6 -0
  319. package/dist/spreadsheet-format-xls/biff-property-text.js +68 -0
  320. package/dist/spreadsheet-format-xls/biff-property-transcode.d.ts +5 -0
  321. package/dist/spreadsheet-format-xls/biff-property-transcode.js +45 -0
  322. package/package.json +6 -3
  323. package/dist/safe-bash/command-chunks/biff-YKPDH35C-MVQIWNKV.js +0 -4974
  324. package/dist/safe-bash/command-chunks/chunk-5Q22ZLNC.js +0 -127
  325. package/dist/safe-bash/command-chunks/chunk-JKLOBSMP.js +0 -56
  326. package/dist/safe-bash/command-chunks/chunk-JYTESTBS.js +0 -99
  327. package/dist/safe-bash/command-chunks/chunk-ZEGNRZV2.js +0 -333
  328. package/dist/safe-bash/command-chunks/paradox-ZWWXYY4J-JYOSWSBL.js +0 -362
  329. package/dist/spreadsheet-format-xls/biff-properties-layout.js +0 -56
@@ -1,10 +1,11 @@
1
1
  import {
2
2
  Inputs
3
- } from "../safe-bash/command-chunks/chunk-YS25EI54.js";
4
- import "../safe-bash/command-chunks/chunk-N4R2SHSS.js";
5
- import "../safe-bash/command-chunks/chunk-QUM3SYAJ.js";
6
- import "../safe-bash/command-chunks/chunk-SPW4GW4Z.js";
7
- import "../safe-bash/command-chunks/chunk-AGLK7OJR.js";
3
+ } from "../safe-bash/command-chunks/chunk-PCCFLPUQ.js";
4
+ import "../safe-bash/command-chunks/chunk-CCZZVCHX.js";
5
+ import "../safe-bash/command-chunks/chunk-SYSX46IV.js";
6
+ import "../safe-bash/command-chunks/chunk-DFI7QF3M.js";
7
+ import "../safe-bash/command-chunks/chunk-HDSIIQBS.js";
8
+ import "../safe-bash/command-chunks/chunk-6ZHQB453.js";
8
9
  import "../safe-bash/command-chunks/chunk-65DS4IOB.js";
9
10
  export {
10
11
  Inputs
@@ -3,7 +3,8 @@ import {
3
3
  argumentsFor,
4
4
  helpText,
5
5
  settings
6
- } from "../safe-bash/command-chunks/chunk-26VCZHLJ.js";
6
+ } from "../safe-bash/command-chunks/chunk-PIOQBOEK.js";
7
+ import "../safe-bash/command-chunks/chunk-6ZHQB453.js";
7
8
  import "../safe-bash/command-chunks/chunk-65DS4IOB.js";
8
9
  export {
9
10
  HtmlUsageError,
@@ -1,10 +1,11 @@
1
1
  import {
2
2
  Parser,
3
3
  blockTags
4
- } from "../safe-bash/command-chunks/chunk-N4R2SHSS.js";
5
- import "../safe-bash/command-chunks/chunk-QUM3SYAJ.js";
6
- import "../safe-bash/command-chunks/chunk-SPW4GW4Z.js";
7
- import "../safe-bash/command-chunks/chunk-AGLK7OJR.js";
4
+ } from "../safe-bash/command-chunks/chunk-CCZZVCHX.js";
5
+ import "../safe-bash/command-chunks/chunk-SYSX46IV.js";
6
+ import "../safe-bash/command-chunks/chunk-DFI7QF3M.js";
7
+ import "../safe-bash/command-chunks/chunk-HDSIIQBS.js";
8
+ import "../safe-bash/command-chunks/chunk-6ZHQB453.js";
8
9
  import "../safe-bash/command-chunks/chunk-65DS4IOB.js";
9
10
  export {
10
11
  Parser,
@@ -1,21 +1,22 @@
1
1
  import {
2
2
  blockTags
3
- } from "../safe-bash/command-chunks/chunk-N4R2SHSS.js";
3
+ } from "../safe-bash/command-chunks/chunk-CCZZVCHX.js";
4
4
  import {
5
5
  destination,
6
6
  escapeText
7
- } from "../safe-bash/command-chunks/chunk-QUM3SYAJ.js";
7
+ } from "../safe-bash/command-chunks/chunk-SYSX46IV.js";
8
8
  import {
9
9
  htmlSpace,
10
10
  normalizeText,
11
11
  trimText
12
- } from "../safe-bash/command-chunks/chunk-SPW4GW4Z.js";
12
+ } from "../safe-bash/command-chunks/chunk-DFI7QF3M.js";
13
13
  import {
14
14
  Builder
15
- } from "../safe-bash/command-chunks/chunk-AGLK7OJR.js";
15
+ } from "../safe-bash/command-chunks/chunk-HDSIIQBS.js";
16
+ import "../safe-bash/command-chunks/chunk-6ZHQB453.js";
16
17
  import "../safe-bash/command-chunks/chunk-65DS4IOB.js";
17
18
 
18
- // packages/safe-bash-command-html-to-markdown/src/render.ts
19
+ // packages/safe-bash-command-html-to-markdown/dist/render.js
19
20
  var format = (tag) => tag === "em" || tag === "i" ? "em" : tag === "strong" || tag === "b" ? "strong" : tag === "del" || tag === "s" ? "del" : void 0;
20
21
  var inlineAtoms = /* @__PURE__ */ new Set(["a", "img", "code", "br"]);
21
22
  var Renderer = class {
@@ -2,8 +2,9 @@ import {
2
2
  htmlSpace,
3
3
  normalizeText,
4
4
  trimText
5
- } from "../safe-bash/command-chunks/chunk-SPW4GW4Z.js";
6
- import "../safe-bash/command-chunks/chunk-AGLK7OJR.js";
5
+ } from "../safe-bash/command-chunks/chunk-DFI7QF3M.js";
6
+ import "../safe-bash/command-chunks/chunk-HDSIIQBS.js";
7
+ import "../safe-bash/command-chunks/chunk-6ZHQB453.js";
7
8
  import "../safe-bash/command-chunks/chunk-65DS4IOB.js";
8
9
  export {
9
10
  htmlSpace,
@@ -108,6 +108,9 @@ var HtmlBudget = class {
108
108
  }
109
109
  };
110
110
 
111
+ // packages/safe-bash-command-htmlq/src/tree.ts
112
+ import { yieldTurn } from "../safe-bash-contracts/yield.js";
113
+
111
114
  // packages/safe-bash-command-htmlq/src/entities.ts
112
115
  var entities_exports = {};
113
116
  __reExport(entities_exports, entities_star);
@@ -392,6 +395,186 @@ var HtmlTokenizer = class {
392
395
  }
393
396
  };
394
397
 
398
+ // packages/safe-bash-command-htmlq/src/streaming-tokenizer.ts
399
+ var StreamingHtmlTokenizer = class {
400
+ constructor(source, budget) {
401
+ this.budget = budget;
402
+ this.input = source[Symbol.asyncIterator]();
403
+ }
404
+ budget;
405
+ buffer = "";
406
+ ended = false;
407
+ input;
408
+ async peek(length = 1) {
409
+ while (!this.ended && this.buffer.length < length) {
410
+ const next = await this.input.next();
411
+ this.budget.check();
412
+ if (next.done) this.ended = true;
413
+ else this.buffer += next.value;
414
+ }
415
+ return this.buffer.slice(0, length);
416
+ }
417
+ async close() {
418
+ if (!this.ended) await this.input.return?.();
419
+ }
420
+ async next(raw, foreign = false) {
421
+ if (!await this.peek()) return void 0;
422
+ let frame = "";
423
+ const take = async (length = 1) => {
424
+ const value = await this.peek(length);
425
+ this.budget.bound("tokenBytes", (frame.length + value.length) * 2);
426
+ frame += value;
427
+ this.buffer = this.buffer.slice(value.length);
428
+ };
429
+ const until = async (delimiter2) => {
430
+ while (await this.peek()) {
431
+ if (await this.peek(delimiter2.length) === delimiter2) {
432
+ await take(delimiter2.length);
433
+ break;
434
+ }
435
+ await take();
436
+ }
437
+ };
438
+ if (raw) {
439
+ let scriptState = "data";
440
+ while (await this.peek()) {
441
+ let end = raw === "plaintext" ? this.buffer.length : this.buffer.indexOf("<");
442
+ if (end < 0) end = this.buffer.length;
443
+ if (raw === "script" && scriptState !== "data") {
444
+ const dash = this.buffer.indexOf("-");
445
+ if (dash >= 0) end = Math.min(end, dash);
446
+ }
447
+ if (end > 0) {
448
+ await take(end);
449
+ continue;
450
+ }
451
+ if (raw !== "plaintext") {
452
+ if (raw === "script") {
453
+ if (scriptState === "data" && await this.peek(4) === "<!--") {
454
+ scriptState = "escaped";
455
+ await take(4);
456
+ continue;
457
+ }
458
+ if (scriptState !== "data" && await this.peek(3) === "-->") {
459
+ scriptState = "data";
460
+ await take(3);
461
+ continue;
462
+ }
463
+ const opening = (0, entities_exports.asciiLower)(await this.peek(8));
464
+ if (scriptState === "escaped" && opening.startsWith("<script") && delimiter(opening[7])) {
465
+ scriptState = "double";
466
+ await take(7);
467
+ continue;
468
+ }
469
+ const closing = (0, entities_exports.asciiLower)(await this.peek(9));
470
+ if (scriptState === "double" && closing.startsWith("<\/script") && delimiter(closing[8])) {
471
+ scriptState = "escaped";
472
+ await take(8);
473
+ continue;
474
+ }
475
+ }
476
+ if (scriptState !== "double" && await this.peek(2) === "</") {
477
+ const closing = (0, entities_exports.asciiLower)(await this.peek(raw.length + 3));
478
+ if (closing.slice(2, 2 + raw.length) === raw && delimiter(closing[2 + raw.length])) break;
479
+ }
480
+ }
481
+ await take();
482
+ }
483
+ if (frame) return new HtmlTokenizer(frame, this.budget).next(raw, foreign);
484
+ }
485
+ if (await this.peek() !== "<") {
486
+ while (await this.peek() && this.buffer[0] !== "<") {
487
+ const end = this.buffer.indexOf("<");
488
+ await take(end < 0 ? this.buffer.length : end);
489
+ }
490
+ } else if (foreign && await this.peek(9) === "<![CDATA[") {
491
+ await take(9);
492
+ await until("]]>");
493
+ } else if (await this.peek(4) === "<!--") {
494
+ await take(4);
495
+ let state = "start";
496
+ while (await this.peek()) {
497
+ const c = await this.peek();
498
+ await take();
499
+ if (state === "start" || state === "startDash") {
500
+ if (c === ">") break;
501
+ state = c === "-" ? state === "start" ? "startDash" : "end" : "data";
502
+ } else if (state === "data") {
503
+ if (c === "-") state = "dash";
504
+ } else if (state === "dash") state = c === "-" ? "end" : "data";
505
+ else if (state === "end") {
506
+ if (c === ">") break;
507
+ if (c !== "-") state = c === "!" ? "bang" : "data";
508
+ } else {
509
+ if (c === ">") break;
510
+ state = c === "-" ? "dash" : "data";
511
+ }
512
+ }
513
+ } else if ((0, entities_exports.asciiLower)(await this.peek(9)) === "<!doctype") {
514
+ await take(9);
515
+ await until(">");
516
+ } else {
517
+ await take();
518
+ const closing = await this.peek() === "/";
519
+ if (closing) await take();
520
+ const first = await this.peek();
521
+ if (!asciiLetter(first)) {
522
+ if (closing || first === "!" || first === "?") await until(">");
523
+ } else {
524
+ while (await this.peek() && !delimiter(await this.peek())) await take();
525
+ let state = "before";
526
+ let quote = "";
527
+ while (await this.peek()) {
528
+ const c = await this.peek();
529
+ if (state === "quoted") {
530
+ await take();
531
+ if (c === quote) state = "before";
532
+ continue;
533
+ }
534
+ if (c === ">") {
535
+ await take();
536
+ break;
537
+ }
538
+ if (state === "before") {
539
+ await take();
540
+ if (!(0, entities_exports.htmlSpace)(c) && c !== "/") state = "name";
541
+ } else if (state === "name") {
542
+ if (c === "=") {
543
+ await take();
544
+ state = "value";
545
+ } else if ((0, entities_exports.htmlSpace)(c) || c === "/") state = "after";
546
+ else await take();
547
+ } else if (state === "after") {
548
+ if ((0, entities_exports.htmlSpace)(c)) await take();
549
+ else if (c === "=") {
550
+ await take();
551
+ state = "value";
552
+ } else state = "before";
553
+ } else if (state === "value") {
554
+ await take();
555
+ if (!(0, entities_exports.htmlSpace)(c)) {
556
+ if (c === '"' || c === "'") {
557
+ quote = c;
558
+ state = "quoted";
559
+ } else state = "unquoted";
560
+ }
561
+ } else {
562
+ await take();
563
+ if ((0, entities_exports.htmlSpace)(c)) state = "before";
564
+ }
565
+ }
566
+ }
567
+ }
568
+ return new HtmlTokenizer(frame, this.budget).next(void 0, foreign);
569
+ }
570
+ };
571
+ function delimiter(c) {
572
+ return c !== void 0 && ((0, entities_exports.htmlSpace)(c) || c === "/" || c === ">");
573
+ }
574
+ function asciiLetter(c) {
575
+ return c >= "A" && c <= "Z" || c >= "a" && c <= "z";
576
+ }
577
+
395
578
  // packages/safe-bash-command-htmlq/src/tree.ts
396
579
  function allSpace(data) {
397
580
  for (const c of data) if (!(0, entities_exports.htmlSpace)(c)) return false;
@@ -514,6 +697,7 @@ function originalSource(node) {
514
697
  );
515
698
  if (owner.mutated)
516
699
  throw new HtmlError("E_MUTATED", "Original source does not represent the mutated tree");
700
+ if (owner.source === void 0) throw new HtmlError("E_UNSUPPORTED", "Original source was not retained");
517
701
  return owner.source;
518
702
  }
519
703
  function unlink(node) {
@@ -751,20 +935,79 @@ var svgAttributes = Object.fromEntries(
751
935
  "zoomAndPan"
752
936
  ].map((name) => [name.toLowerCase(), name])
753
937
  );
754
- async function parseHtml(source, options) {
938
+ async function parseHtml(source, options, originalSource2 = "retain") {
939
+ const budget = new HtmlBudget(options);
940
+ const owner = { source: originalSource2 === "retain" ? "" : void 0, mutated: false };
941
+ async function* normalized() {
942
+ let first = true, carriage = false;
943
+ for await (const original of decodedHtml(source, options)) {
944
+ if (owner.source !== void 0) {
945
+ budget.charge("retainedBytes", original.length * 2);
946
+ owner.source += original;
947
+ }
948
+ let text = "";
949
+ for (const character of original) {
950
+ budget.charge("work", 1);
951
+ if (first) {
952
+ first = false;
953
+ if (character === "\uFEFF") continue;
954
+ }
955
+ if (carriage && character === "\n") {
956
+ carriage = false;
957
+ continue;
958
+ }
959
+ carriage = character === "\r";
960
+ text += carriage ? "\n" : character;
961
+ }
962
+ yield text;
963
+ }
964
+ }
965
+ const tokenizer = new StreamingHtmlTokenizer(normalized(), budget);
966
+ const tree = buildTree(owner, budget);
967
+ let step = tree.next();
968
+ let failure;
969
+ try {
970
+ while (!step.done) step = tree.next(await tokenizer.next(step.value.raw, step.value.foreign));
971
+ } catch (error) {
972
+ failure = { error };
973
+ }
974
+ try {
975
+ await tokenizer.close();
976
+ } catch (error) {
977
+ if (failure) throw new AggregateError([failure.error, error], "HTML input and cleanup failed");
978
+ throw error;
979
+ }
980
+ if (failure) throw failure.error;
981
+ return step.value;
982
+ }
983
+ async function* decodedHtml(source, options) {
755
984
  const budget = new HtmlBudget(options);
756
985
  const decoder = new TextDecoder("utf-8", { fatal: false, ignoreBOM: true });
757
- let original = "";
758
986
  const iterator = source[Symbol.asyncIterator]();
759
- let complete = false;
987
+ let complete = false, sinceYield = 0;
760
988
  let failed = false;
761
989
  let failure;
990
+ const closeInput = async () => {
991
+ if (!complete && iterator.return) {
992
+ try {
993
+ await iterator.return();
994
+ } catch (cleanup) {
995
+ if (failed) throw new AggregateError([failure, cleanup], "HTML input and cleanup failed");
996
+ throw cleanup;
997
+ }
998
+ }
999
+ };
762
1000
  const abort = () => {
763
1001
  throw new HtmlError("E_CANCELLED", "HTML invocation cancelled");
764
1002
  };
765
1003
  try {
766
1004
  while (true) {
767
1005
  budget.charge("work", 1);
1006
+ if (++sinceYield >= 4096) {
1007
+ await yieldTurn();
1008
+ budget.check();
1009
+ sinceYield = 0;
1010
+ }
768
1011
  let listener = () => {
769
1012
  };
770
1013
  const cancellation = new Promise((_, reject) => {
@@ -791,29 +1034,29 @@ async function parseHtml(source, options) {
791
1034
  budget.charge("inputBytes", byteLength2);
792
1035
  budget.charge("retainedBytes", byteLength2 * 2);
793
1036
  budget.charge("work", byteLength2);
794
- const text = decoder.decode(chunk, { stream: true });
795
- budget.charge("decodedBytes", text.length * 2);
796
- original += text;
1037
+ for (let offset = 0; offset < byteLength2; offset += 4096) {
1038
+ if (sinceYield >= 4096) {
1039
+ await yieldTurn();
1040
+ budget.check();
1041
+ sinceYield = 0;
1042
+ }
1043
+ sinceYield += Math.min(4096, byteLength2 - offset);
1044
+ const text = decoder.decode(Uint8Array.prototype.subarray.call(chunk, offset, Math.min(byteLength2, offset + 4096)), { stream: true });
1045
+ budget.charge("decodedBytes", text.length * 2);
1046
+ yield text;
1047
+ }
797
1048
  }
798
1049
  } catch (error) {
799
1050
  failed = true;
800
1051
  failure = error;
801
- }
802
- if (!complete && iterator.return) {
803
- try {
804
- await iterator.return();
805
- } catch (cleanup) {
806
- if (failed)
807
- throw new AggregateError([failure, cleanup], "HTML input and cleanup failed");
808
- throw cleanup;
809
- }
1052
+ } finally {
1053
+ await closeInput();
810
1054
  }
811
1055
  if (failed) throw failure;
812
1056
  const tail = decoder.decode();
813
1057
  budget.charge("decodedBytes", tail.length * 2);
814
1058
  budget.charge("retainedBytes", tail.length * 2);
815
- original += tail;
816
- return parseHtmlSync(original, options, budget);
1059
+ yield tail;
817
1060
  }
818
1061
  function parseHtmlSync(original, options, existingBudget) {
819
1062
  const budget = existingBudget ?? new HtmlBudget(options);
@@ -832,7 +1075,13 @@ function parseHtmlSync(original, options, existingBudget) {
832
1075
  } else normalized += original[i];
833
1076
  }
834
1077
  }
835
- const owner = { source: original, mutated: false };
1078
+ const tree = buildTree({ source: original, mutated: false }, budget);
1079
+ const tokenizer = new HtmlTokenizer(normalized, budget);
1080
+ let step = tree.next();
1081
+ while (!step.done) step = tree.next(tokenizer.next(step.value.raw, step.value.foreign));
1082
+ return step.value;
1083
+ }
1084
+ function* buildTree(owner, budget) {
836
1085
  const make = (kind, name = "", data = "", namespace = "html") => {
837
1086
  budget.charge("nodes", 1);
838
1087
  budget.charge("retainedBytes", 128 + (name.length + data.length) * 2);
@@ -1035,12 +1284,11 @@ function parseHtmlSync(original, options, existingBudget) {
1035
1284
  last.data += data;
1036
1285
  } else append(parent, make("text", "", data), before);
1037
1286
  };
1038
- const tokenizer = new HtmlTokenizer(normalized, budget);
1039
1287
  let token;
1040
- while (token = tokenizer.next(
1041
- current().namespace === "html" && (rawElements.has(current().name) || current().name === "title" || current().name === "textarea") ? current().name : void 0,
1042
- current().namespace !== "html"
1043
- )) {
1288
+ while (token = yield {
1289
+ raw: current().namespace === "html" && (rawElements.has(current().name) || current().name === "title" || current().name === "textarea") ? current().name : void 0,
1290
+ foreign: current().namespace !== "html"
1291
+ }) {
1044
1292
  budget.charge("work", stack.length + active.length + 1);
1045
1293
  if (token.kind === "doctype") {
1046
1294
  if (mode === "beforeHead") append(document, make("doctype", "", token.data), html);
@@ -1553,7 +1801,7 @@ function* inclusiveHtmlDescendants(root, options) {
1553
1801
 
1554
1802
  // packages/safe-bash-command-htmlq/src/selectors.ts
1555
1803
  var cssSpace = (c) => c === " " || c === " " || c === "\n" || c === "\r" || c === "\f";
1556
- function asciiLower2(s) {
1804
+ function asciiLower3(s) {
1557
1805
  let out = "", changed = false;
1558
1806
  for (let i = 0; i < s.length; i++) {
1559
1807
  const n = s.charCodeAt(i);
@@ -1696,7 +1944,7 @@ var Parser = class {
1696
1944
  expected = this.peek() === '"' || this.peek() === "'" ? this.quoted() : this.identifier();
1697
1945
  this.spaces();
1698
1946
  if (this.peek() !== "]") {
1699
- const flag = asciiLower2(this.identifier());
1947
+ const flag = asciiLower3(this.identifier());
1700
1948
  if (flag !== "i" && flag !== "s") this.fail();
1701
1949
  insensitive = flag === "i";
1702
1950
  this.spaces();
@@ -1705,7 +1953,7 @@ var Parser = class {
1705
1953
  if (this.take() !== "]") this.fail();
1706
1954
  tests.push({ kind: "attribute", value, operator, expected, insensitive });
1707
1955
  } else {
1708
- const value = asciiLower2(this.identifier());
1956
+ const value = asciiLower3(this.identifier());
1709
1957
  if (value === "not") {
1710
1958
  if (inNot || this.take() !== "(") this.fail();
1711
1959
  const negated = this.list(true);
@@ -1787,13 +2035,13 @@ var Parser = class {
1787
2035
  spaces();
1788
2036
  let end = source.length;
1789
2037
  while (end > at && cssSpace(source[end - 1])) end--;
1790
- const word = asciiLower2(source.slice(at, end));
2038
+ const word = asciiLower3(source.slice(at, end));
1791
2039
  if (word === "odd") return [2, 1];
1792
2040
  if (word === "even") return [2, 0];
1793
2041
  let sign = "";
1794
2042
  if (source[at] === "+" || source[at] === "-") sign = source[at++];
1795
2043
  const number = digits();
1796
- if (asciiLower2(source[at] ?? "") !== "n") {
2044
+ if (asciiLower3(source[at] ?? "") !== "n") {
1797
2045
  spaces();
1798
2046
  if (!number || at !== source.length) this.fail();
1799
2047
  return [0, integer(sign + number)];
@@ -1814,7 +2062,7 @@ var Parser = class {
1814
2062
  function attribute(node, name, budget) {
1815
2063
  budget.charge("work", name.length);
1816
2064
  budget.charge("retainedBytes", name.length * 2);
1817
- const expected = node.namespace === "html" ? asciiLower2(name) : name;
2065
+ const expected = node.namespace === "html" ? asciiLower3(name) : name;
1818
2066
  for (const a of node.attributes) {
1819
2067
  budget.charge("work", a.name.length + expected.length + 1);
1820
2068
  if (a.namespace === "none" && a.name === expected) return a.value;
@@ -1847,7 +2095,7 @@ function matchesTest(node, test, budget) {
1847
2095
  if (test.kind === "type") {
1848
2096
  budget.charge("work", node.name.length + test.value.length);
1849
2097
  budget.charge("retainedBytes", test.value.length * 2);
1850
- return test.namespace !== "none" && (test.value === "*" || node.name === (node.namespace === "html" ? asciiLower2(test.value) : test.value));
2098
+ return test.namespace !== "none" && (test.value === "*" || node.name === (node.namespace === "html" ? asciiLower3(test.value) : test.value));
1851
2099
  }
1852
2100
  if (test.kind === "id") {
1853
2101
  const value = attribute(node, "id", budget);
@@ -1863,8 +2111,8 @@ function matchesTest(node, test, budget) {
1863
2111
  budget.charge("work", value.length + expected.length);
1864
2112
  if (test.insensitive) {
1865
2113
  budget.charge("retainedBytes", (value.length + expected.length) * 4);
1866
- value = asciiLower2(value);
1867
- expected = asciiLower2(expected);
2114
+ value = asciiLower3(value);
2115
+ expected = asciiLower3(expected);
1868
2116
  }
1869
2117
  switch (test.operator) {
1870
2118
  case "":
@@ -2222,7 +2470,7 @@ function evalSyncHtmlq(inBytes, opArgs, readFileSync, writeFileSync) {
2222
2470
  }
2223
2471
 
2224
2472
  // packages/safe-bash-command-htmlq/src/behavior.ts
2225
- import { yieldTurn } from "../safe-bash-contracts/yield.js";
2473
+ import { yieldTurn as yieldTurn2 } from "../safe-bash-contracts/yield.js";
2226
2474
 
2227
2475
  // packages/safe-bash-command-htmlq/src/information.ts
2228
2476
  var help = `Like jq, but for HTML.
@@ -2284,7 +2532,7 @@ async function* projectHtmlq(source, args, invocation) {
2284
2532
  budget.check();
2285
2533
  return;
2286
2534
  }
2287
- const document = await parseHtml(source, invocation);
2535
+ const document = await parseHtml(source, invocation, "discard");
2288
2536
  let base = baseUrl(args.base);
2289
2537
  if (args.detectBase) {
2290
2538
  const first = selectHtml(document, "base", invocation).next().value;
@@ -2360,7 +2608,7 @@ async function* projectHtmlq(source, args, invocation) {
2360
2608
  let selectedIndex = 0;
2361
2609
  for (const node of nodes) {
2362
2610
  if (selectedIndex % 64 === 0) {
2363
- await yieldTurn(invocation.signal);
2611
+ await yieldTurn2(invocation.signal);
2364
2612
  invocation.signal.throwIfAborted();
2365
2613
  }
2366
2614
  const isFirstNode = selectedIndex++ === 0;
@@ -2443,6 +2691,79 @@ import { FsError } from "../safe-bash-contracts/errors.js";
2443
2691
  import { writeBytes } from "../safe-bash-contracts/io.js";
2444
2692
  import { createOutputOperation } from "../safe-bash-contracts/output.js";
2445
2693
  import { shellValueByteLength } from "../safe-bash-contracts/value.js";
2694
+
2695
+ // packages/safe-bash-command-htmlq/src/staged-output.ts
2696
+ import { normalizePath } from "@poe-platform/safe-fs/core";
2697
+ async function publishStagedHtmlq(fs, path, source, signal) {
2698
+ const target = await fs.prepareStagingResolution(normalizePath(path), { signal });
2699
+ target.validate();
2700
+ if (target.destination && target.destination.type !== "file")
2701
+ throw new HtmlError("E_UNSUPPORTED", "Output must be a regular VFS file");
2702
+ let stage;
2703
+ let failure;
2704
+ try {
2705
+ const parentPath = target.path.slice(0, target.path.lastIndexOf("/"));
2706
+ stage = await fs.createStagedFile(
2707
+ `${parentPath}/.htmlq-${crypto.randomUUID()}`,
2708
+ "output",
2709
+ { type: "file", data: new Uint8Array() },
2710
+ {
2711
+ parent: target.parent,
2712
+ retainCleanup: true,
2713
+ signal,
2714
+ mode: target.destination ? target.destination.mode & 4095 : 438
2715
+ }
2716
+ );
2717
+ if (!stage.writer || !stage.cleanup)
2718
+ throw new HtmlError("E_UNSUPPORTED", "Output requires retained staging handles");
2719
+ signal.throwIfAborted();
2720
+ for await (const bytes of source) {
2721
+ for (let offset = 0; offset < bytes.length; offset += 16384) {
2722
+ signal.throwIfAborted();
2723
+ await stage.writer.write(bytes.slice(offset, offset + 16384), { signal });
2724
+ }
2725
+ }
2726
+ const stat = await stage.writer.finish({ signal });
2727
+ signal.throwIfAborted();
2728
+ target.validate();
2729
+ await fs.publishStagedFile({ ...stage, file: { ...stage.file, stat } }, target.path, {
2730
+ parent: target.parent,
2731
+ destination: target.destination,
2732
+ ancestors: target.ancestors,
2733
+ commitGuard: target.validate,
2734
+ preserveIdentity: target.destination !== null,
2735
+ signal
2736
+ });
2737
+ } catch (error) {
2738
+ failure = { error };
2739
+ }
2740
+ const cleanupErrors = [];
2741
+ if (stage?.cleanup) {
2742
+ try {
2743
+ await stage.cleanup.remove();
2744
+ } catch (error) {
2745
+ cleanupErrors.push(error);
2746
+ }
2747
+ try {
2748
+ await stage.cleanup.close();
2749
+ } catch (error) {
2750
+ cleanupErrors.push(error);
2751
+ }
2752
+ } else if (stage) {
2753
+ try {
2754
+ await fs.removeStagedFile(stage);
2755
+ } catch (error) {
2756
+ cleanupErrors.push(error);
2757
+ }
2758
+ }
2759
+ if (cleanupErrors.length) {
2760
+ if (failure) cleanupErrors.unshift(failure.error);
2761
+ throw new AggregateError(cleanupErrors, "htmlq staged output cleanup failed");
2762
+ }
2763
+ if (failure) throw failure.error;
2764
+ }
2765
+
2766
+ // packages/safe-bash-command-htmlq/src/command.ts
2446
2767
  function admittedLimits(overrides = {}) {
2447
2768
  const limits = { ...defaultHtmlLimits, ...overrides };
2448
2769
  for (const name of Object.keys(defaultHtmlLimits)) {
@@ -2654,10 +2975,11 @@ async function htmlq(context, configuration = {}) {
2654
2975
  }
2655
2976
  } else {
2656
2977
  const path = args.output.startsWith("/") ? args.output : `${context.cwd}/${args.output}`;
2657
- const caps = await context.fs.capabilitiesFor?.(path, { signal: options.signal }) ?? context.fs.capabilities;
2978
+ const caps = await context.fs.capabilitiesFor?.(path, { signal: options.signal, stagingResolution: true }) ?? context.fs.capabilities;
2658
2979
  const streaming = caps.atomicFilePublication ? context.fs.publishFileConditional : void 0;
2980
+ const staged = caps.atomicFileStaging && caps.atomicStagedFileMutation && caps.atomicStagingAncestry && caps.retainedStagingWrite && caps.retainedStagingCleanup && caps.synchronousStagingResolution && caps.guardedStagingPublication && context.fs.prepareStagingResolution && context.fs.createStagedFile && context.fs.publishStagedFile && context.fs.removeStagedFile;
2659
2981
  const buffered = caps.atomicFileMutation || caps.trustedOwnedStaging ? context.fs.writeFileConditional : void 0;
2660
- if (caps.write === false || caps.readOnly || !streaming && !buffered)
2982
+ if (caps.write === false || caps.readOnly || !streaming && !staged && !buffered)
2661
2983
  throw new HtmlError(
2662
2984
  "E_UNSUPPORTED",
2663
2985
  "Output requires atomic conditional VFS publication"
@@ -2680,6 +3002,8 @@ async function htmlq(context, configuration = {}) {
2680
3002
  signal: options.signal,
2681
3003
  maxBytes: options.limits.outputBytes
2682
3004
  });
3005
+ } else if (staged) {
3006
+ await publishStagedHtmlq(context.fs, path, rendered, options.signal);
2683
3007
  } else {
2684
3008
  const chunks = [];
2685
3009
  let size = 0;
@@ -1,6 +1,6 @@
1
1
  import { HtmlBudget, type MutableHtmlNode as HtmlNode, type HtmlNode as PublicHtmlNode, type HtmlOptions } from "./contracts.js";
2
2
  interface Owner {
3
- source: string;
3
+ source: string | undefined;
4
4
  mutated: boolean;
5
5
  }
6
6
  export type FastMutableNode = HtmlNode & {
@@ -16,6 +16,7 @@ export declare function originalSource(node: PublicHtmlNode): string;
16
16
  export declare function detachHtmlNode(node: PublicHtmlNode, options: HtmlOptions): void;
17
17
  /** Replace an existing attribute through engine ownership; preserve insertion order. */
18
18
  export declare function replaceHtmlAttribute(node: PublicHtmlNode, name: string, value: string, options: HtmlOptions): void;
19
- export declare function parseHtml(source: AsyncIterable<Uint8Array>, options: HtmlOptions): Promise<PublicHtmlNode>;
19
+ /** Original-source retention is optional for projections and normalized output. */
20
+ export declare function parseHtml(source: AsyncIterable<Uint8Array>, options: HtmlOptions, originalSource?: "retain" | "discard"): Promise<PublicHtmlNode>;
20
21
  export declare function parseHtmlSync(original: string, options: HtmlOptions, existingBudget?: HtmlBudget): PublicHtmlNode;
21
22
  export {};