@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
@@ -0,0 +1,13 @@
1
+ import type { AudioProbeSource } from "./wav-source.js";
2
+ import type { AudioAst } from "./types.js";
3
+ /** UTF-8 comment bytes; block identity preserves replacement across comment blocks. */
4
+ export interface FlacCommentSpan {
5
+ readonly block: number;
6
+ readonly offset: number;
7
+ readonly length: number;
8
+ }
9
+ /** Strict FLAC validation without AST/picture/frame models. onComment avoids collecting tag strings. */
10
+ export declare function probeFlacSource(source: AudioProbeSource, options?: {
11
+ signal?: AbortSignal;
12
+ onComment?: (span: FlacCommentSpan) => Promise<void>;
13
+ }): Promise<Omit<AudioAst, "data" | "nodes" | "pictures">>;
@@ -1,3 +1,5 @@
1
+ export { normalizeVorbisCommentKey } from "./vorbis.js";
2
+ export { probeFlacSource, type FlacCommentSpan } from "./flac-source.js";
1
3
  export { probeWavSource, type AudioProbeSource, type WavTagSpan } from "./wav-source.js";
2
4
  export * from "./types.js";
3
5
  export { decodePcm, encodeWav } from "./wav.js";
@@ -74,6 +74,253 @@ function duration(samples, sampleRate) {
74
74
  return samples / sampleRate;
75
75
  }
76
76
 
77
+ // packages/audio-ast/src/vorbis.ts
78
+ var names = {
79
+ TITLE: "title",
80
+ ARTIST: "artist",
81
+ ALBUM: "album",
82
+ ALBUMARTIST: "albumArtist",
83
+ TRACKNUMBER: "track",
84
+ DISCNUMBER: "disc",
85
+ DATE: "date",
86
+ GENRE: "genre",
87
+ COMMENT: "comment",
88
+ DESCRIPTION: "comment",
89
+ ENCODER: "encoder",
90
+ COPYRIGHT: "copyright"
91
+ };
92
+ function parseComments(bytes) {
93
+ const r = new Reader(bytes), vendorSize = r.u32(0, true), vendor = new TextDecoder().decode(r.slice(4, vendorSize));
94
+ let offset = 4 + vendorSize;
95
+ const count = r.u32(offset, true);
96
+ offset += 4;
97
+ if (count > (bytes.length - offset) / 4) throw new Error("Invalid Vorbis comment count");
98
+ const tags = {}, comments = [];
99
+ for (let i = 0; i < count; i++) {
100
+ const size = r.u32(offset, true);
101
+ offset += 4;
102
+ const value = new TextDecoder().decode(r.slice(offset, size));
103
+ offset += size;
104
+ comments.push(value);
105
+ addVorbisComment(tags, value);
106
+ }
107
+ return { tags, vendor, comments, size: offset };
108
+ }
109
+ function encodeComments(tags, vendor = "poe-code/audio-ast") {
110
+ const encoder = new TextEncoder(), v = encoder.encode(vendor), comments = [];
111
+ for (const [name, value] of Object.entries(tags)) {
112
+ const key = Object.keys(names).find((key2) => names[key2] === name) ?? name.toUpperCase();
113
+ if (key.includes("=") || Array.from(key).some((c) => c.charCodeAt(0) < 32 || c.charCodeAt(0) > 125))
114
+ throw new Error("Invalid Vorbis comment key");
115
+ for (const part of value.split("\n")) {
116
+ const bytes = encoder.encode(`${key}=${part}`);
117
+ comments.push(join([uint32(bytes.length, true), bytes]));
118
+ }
119
+ }
120
+ return join([uint32(v.length, true), v, uint32(comments.length, true), ...comments]);
121
+ }
122
+ function parsePicture(bytes) {
123
+ const r = new Reader(bytes), type = r.u32(0), mimeSize = r.u32(4), mime = r.text(8, mimeSize);
124
+ let offset = 8 + mimeSize;
125
+ const descriptionSize = r.u32(offset);
126
+ offset += 4;
127
+ const description = new TextDecoder().decode(r.slice(offset, descriptionSize));
128
+ offset += descriptionSize;
129
+ const width = r.u32(offset), height = r.u32(offset + 4), depth = r.u32(offset + 8), colors = r.u32(offset + 12), size = r.u32(offset + 16);
130
+ offset += 20;
131
+ const data = r.slice(offset, size);
132
+ if (offset + size !== bytes.length) throw new Error("Trailing FLAC picture bytes");
133
+ return { type, mime, description, width, height, depth, colors, data };
134
+ }
135
+ function encodePicture(p) {
136
+ const description = new TextEncoder().encode(p.description), mime = ascii(p.mime);
137
+ return join([
138
+ uint32(p.type),
139
+ uint32(mime.length),
140
+ mime,
141
+ uint32(description.length),
142
+ description,
143
+ uint32(p.width ?? 0),
144
+ uint32(p.height ?? 0),
145
+ uint32(p.depth ?? 0),
146
+ uint32(p.colors ?? 0),
147
+ uint32(p.data.length),
148
+ p.data
149
+ ]);
150
+ }
151
+ function pictureBase64(picture) {
152
+ const bytes = encodePicture(picture);
153
+ let binary = "";
154
+ for (let i = 0; i < bytes.length; i += 8192)
155
+ binary += String.fromCharCode(...bytes.subarray(i, i + 8192));
156
+ return btoa(binary);
157
+ }
158
+ function addVorbisComment(tags, value) {
159
+ const split = value.indexOf("=");
160
+ if (split > 0) {
161
+ const name = normalizeVorbisCommentKey(value.slice(0, split));
162
+ tags[name] = tags[name] ? `${tags[name]}
163
+ ${value.slice(split + 1)}` : value.slice(split + 1);
164
+ }
165
+ }
166
+ function normalizeVorbisCommentKey(value) {
167
+ const key = value.toUpperCase();
168
+ return names[key] ?? key;
169
+ }
170
+
171
+ // packages/audio-ast/src/flac.ts
172
+ function parseFlac(bytes) {
173
+ const r = new Reader(bytes), nodes = [], pictures = [];
174
+ const tags = {};
175
+ let offset = 4, last = false, stream;
176
+ while (!last) {
177
+ const header = r.u8(offset), type = header & 127, size = r.u24(offset + 1);
178
+ last = !!(header & 128);
179
+ const data = r.slice(offset + 4, size), node = {
180
+ type: [
181
+ "STREAMINFO",
182
+ "PADDING",
183
+ "APPLICATION",
184
+ "SEEKTABLE",
185
+ "VORBIS_COMMENT",
186
+ "CUESHEET",
187
+ "PICTURE"
188
+ ][type] ?? `BLOCK_${type}`,
189
+ offset,
190
+ size: size + 4,
191
+ data
192
+ };
193
+ nodes.push(node);
194
+ const block = new Reader(data);
195
+ if (type === 0) {
196
+ if (stream || offset !== 4 || size !== 34)
197
+ throw new Error("FLAC requires first unique STREAMINFO");
198
+ stream = flacStream(block, bytes.length);
199
+ const { sampleRate, channels, bitsPerSample, samples } = stream;
200
+ node.fields = {
201
+ minBlockSize: block.u16(0),
202
+ maxBlockSize: block.u16(2),
203
+ minFrameSize: block.u24(4),
204
+ maxFrameSize: block.u24(7),
205
+ sampleRate,
206
+ channels,
207
+ bitsPerSample,
208
+ totalSamples: samples,
209
+ md5: Array.from(block.slice(18, 16), (b) => b.toString(16).padStart(2, "0")).join("")
210
+ };
211
+ } else if (type === 4) {
212
+ const parsed = parseComments(data);
213
+ if (parsed.size !== size) throw new Error("Trailing Vorbis comment bytes");
214
+ Object.assign(tags, parsed.tags);
215
+ node.fields = { vendor: parsed.vendor, comments: parsed.comments };
216
+ } else if (type === 6) pictures.push(parsePicture(data));
217
+ else if (type === 3) {
218
+ if (size % 18) throw new Error("Invalid FLAC seek table");
219
+ const points = [];
220
+ for (let pos = 0; pos < size; pos += 18)
221
+ points.push({
222
+ sample: block.u64(pos),
223
+ offset: block.u64(pos + 8),
224
+ samples: block.u16(pos + 16)
225
+ });
226
+ node.fields = { points };
227
+ } else if (type === 127) throw new Error("Invalid FLAC metadata block");
228
+ offset += 4 + size;
229
+ }
230
+ if (!stream) throw new Error("Missing FLAC STREAMINFO");
231
+ if (offset < bytes.length)
232
+ nodes.push({
233
+ type: "FRAMES",
234
+ offset,
235
+ size: bytes.length - offset,
236
+ data: r.slice(offset, bytes.length - offset)
237
+ });
238
+ return {
239
+ format: "flac",
240
+ data: bytes,
241
+ nodes,
242
+ tags,
243
+ pictures,
244
+ streams: [stream],
245
+ duration: stream.duration,
246
+ bitrate: stream.bitrate
247
+ };
248
+ }
249
+ function flacStream(block, byteLength) {
250
+ const packed = block.u64(10), sampleRate = Number(packed >> 44n), channels = Number(packed >> 41n & 7n) + 1, bitsPerSample = Number(packed >> 36n & 31n) + 1, samples = Number(packed & 0xfffffffffn), seconds2 = duration(samples, sampleRate);
251
+ return { codec: "flac", sampleRate, channels, bitsPerSample, samples, duration: seconds2, bitrate: seconds2 ? byteLength * 8 / seconds2 : 0 };
252
+ }
253
+
254
+ // packages/audio-ast/src/flac-source.ts
255
+ async function probeFlacSource(source, options = {}) {
256
+ const check = (offset2, length, end = source.size) => {
257
+ options.signal?.throwIfAborted();
258
+ if (!Number.isSafeInteger(source.size) || !Number.isSafeInteger(offset2) || !Number.isSafeInteger(length) || offset2 < 0 || length < 0 || length > end - offset2)
259
+ throw new Error("Truncated or invalid audio structure");
260
+ };
261
+ const read = async (offset2, length, end = source.size) => {
262
+ check(offset2, length, end);
263
+ const bytes = await source.read(offset2, length);
264
+ options.signal?.throwIfAborted();
265
+ if (bytes.length !== length) throw new Error("Truncated or invalid audio structure");
266
+ return new Reader(bytes);
267
+ };
268
+ if ((await read(0, 4)).text(0, 4) !== "fLaC") throw new Error("Expected FLAC signature");
269
+ let offset = 4, last = false, stream;
270
+ const tags = {};
271
+ while (!last) {
272
+ const header = await read(offset, 4), type = header.u8(0) & 127, length = header.u24(1), start = offset + 4, end = start + length;
273
+ last = !!(header.u8(0) & 128);
274
+ check(start, length);
275
+ if (type === 0) {
276
+ if (stream || offset !== 4 || length !== 34) throw new Error("FLAC requires first unique STREAMINFO");
277
+ stream = flacStream(await read(start, 34, end), source.size);
278
+ } else if (type === 4) {
279
+ const vendorLength = (await read(start, 4, end)).u32(0, true);
280
+ check(start + 4, vendorLength, end);
281
+ let pos = start + 4 + vendorLength;
282
+ const count = (await read(pos, 4, end)).u32(0, true);
283
+ pos += 4;
284
+ if (count > (end - pos) / 4) throw new Error("Invalid Vorbis comment count");
285
+ const blockTags = {};
286
+ for (let i = 0; i < count; i++) {
287
+ const size = (await read(pos, 4, end)).u32(0, true);
288
+ pos += 4;
289
+ check(pos, size, end);
290
+ if (options.onComment) {
291
+ await options.onComment({ block: offset, offset: pos, length: size });
292
+ options.signal?.throwIfAborted();
293
+ } else {
294
+ const decoder = new TextDecoder();
295
+ let text2 = "";
296
+ for (let at = 0; at < size; at += 16384) text2 += decoder.decode((await read(pos + at, Math.min(16384, size - at), end)).bytes, { stream: true });
297
+ addVorbisComment(blockTags, text2 + decoder.decode());
298
+ }
299
+ pos += size;
300
+ }
301
+ if (pos !== end) throw new Error("Trailing Vorbis comment bytes");
302
+ Object.assign(tags, blockTags);
303
+ } else if (type === 6) {
304
+ const prefix = await read(start, 8, end), mimeLength = prefix.u32(4);
305
+ check(start + 8, mimeLength, end);
306
+ let pos = start + 8 + mimeLength;
307
+ const descriptionLength = (await read(pos, 4, end)).u32(0);
308
+ pos += 4;
309
+ check(pos, descriptionLength, end);
310
+ pos += descriptionLength;
311
+ const size = (await read(pos, 20, end)).u32(16);
312
+ pos += 20;
313
+ check(pos, size, end);
314
+ if (pos + size !== end) throw new Error("Trailing FLAC picture bytes");
315
+ } else if (type === 3 && length % 18) throw new Error("Invalid FLAC seek table");
316
+ else if (type === 127) throw new Error("Invalid FLAC metadata block");
317
+ offset = end;
318
+ }
319
+ if (!stream) throw new Error("Missing FLAC STREAMINFO");
320
+ options.signal?.throwIfAborted();
321
+ return { format: "flac", streams: [stream], tags, duration: stream.duration, bitrate: stream.bitrate };
322
+ }
323
+
77
324
  // packages/audio-ast/src/wav.ts
78
325
  var infoNames = {
79
326
  INAM: "title",
@@ -543,7 +790,7 @@ function transformAudio(pcm, effects) {
543
790
  }
544
791
 
545
792
  // packages/audio-ast/src/id3.ts
546
- var names = {
793
+ var names2 = {
547
794
  TIT2: "title",
548
795
  TPE1: "artist",
549
796
  TPE2: "albumArtist",
@@ -636,7 +883,7 @@ function parseId3(bytes) {
636
883
  if (version === 4 && frameFlags & 1) prefix += 4;
637
884
  data = data.subarray(prefix);
638
885
  if (id.startsWith("T") && id !== "TXXX" && id !== "TXX")
639
- tags[names[id] ?? id] = text(data.subarray(1), data[0]);
886
+ tags[names2[id] ?? id] = text(data.subarray(1), data[0]);
640
887
  else if (id === "COMM" || id === "COM") {
641
888
  const encoding = data[0], end = terminated(data, 4, encoding), width = encoding === 1 || encoding === 2 ? 2 : 1;
642
889
  tags.comment = text(data.subarray(end + width), encoding);
@@ -676,13 +923,13 @@ function encodeId3(tags, retained = [], pictures = []) {
676
923
  if (flags & (node.fields?.version === 3 ? 192 : 12)) {
677
924
  throw new Error(`Cannot safely rewrite transformed ID3 frame ${node.type}`);
678
925
  }
679
- if (node.type === "APIC" || node.type === "PIC" || names[node.type] || node.type.startsWith("T") && node.type !== "TXXX" && node.type !== "TXX" || node.type === "COMM" || node.type === "COM")
926
+ if (node.type === "APIC" || node.type === "PIC" || names2[node.type] || node.type.startsWith("T") && node.type !== "TXXX" && node.type !== "TXX" || node.type === "COMM" || node.type === "COM")
680
927
  continue;
681
928
  if (node.type.length === 4 && !node.fields?.flags) frame(node.type, node.data);
682
929
  else throw new Error(`Cannot safely rewrite ID3 frame ${node.type}`);
683
930
  }
684
931
  for (const [name, value] of Object.entries(tags)) {
685
- const id = Object.keys(names).find((key) => key.length === 4 && names[key] === name) ?? name;
932
+ const id = Object.keys(names2).find((key) => key.length === 4 && names2[key] === name) ?? name;
686
933
  if (name === "comment")
687
934
  frame(
688
935
  "COMM",
@@ -865,181 +1112,6 @@ function parseMp3(bytes) {
865
1112
  };
866
1113
  }
867
1114
 
868
- // packages/audio-ast/src/vorbis.ts
869
- var names2 = {
870
- TITLE: "title",
871
- ARTIST: "artist",
872
- ALBUM: "album",
873
- ALBUMARTIST: "albumArtist",
874
- TRACKNUMBER: "track",
875
- DISCNUMBER: "disc",
876
- DATE: "date",
877
- GENRE: "genre",
878
- COMMENT: "comment",
879
- DESCRIPTION: "comment",
880
- ENCODER: "encoder",
881
- COPYRIGHT: "copyright"
882
- };
883
- function parseComments(bytes) {
884
- const r = new Reader(bytes), vendorSize = r.u32(0, true), vendor = new TextDecoder().decode(r.slice(4, vendorSize));
885
- let offset = 4 + vendorSize;
886
- const count = r.u32(offset, true);
887
- offset += 4;
888
- if (count > (bytes.length - offset) / 4) throw new Error("Invalid Vorbis comment count");
889
- const tags = {}, comments = [];
890
- for (let i = 0; i < count; i++) {
891
- const size = r.u32(offset, true);
892
- offset += 4;
893
- const value = new TextDecoder().decode(r.slice(offset, size));
894
- offset += size;
895
- comments.push(value);
896
- const split = value.indexOf("=");
897
- if (split > 0) {
898
- const key = value.slice(0, split).toUpperCase(), name = names2[key] ?? key;
899
- tags[name] = tags[name] ? `${tags[name]}
900
- ${value.slice(split + 1)}` : value.slice(split + 1);
901
- }
902
- }
903
- return { tags, vendor, comments, size: offset };
904
- }
905
- function encodeComments(tags, vendor = "poe-code/audio-ast") {
906
- const encoder = new TextEncoder(), v = encoder.encode(vendor), comments = [];
907
- for (const [name, value] of Object.entries(tags)) {
908
- const key = Object.keys(names2).find((key2) => names2[key2] === name) ?? name.toUpperCase();
909
- if (key.includes("=") || Array.from(key).some((c) => c.charCodeAt(0) < 32 || c.charCodeAt(0) > 125))
910
- throw new Error("Invalid Vorbis comment key");
911
- for (const part of value.split("\n")) {
912
- const bytes = encoder.encode(`${key}=${part}`);
913
- comments.push(join([uint32(bytes.length, true), bytes]));
914
- }
915
- }
916
- return join([uint32(v.length, true), v, uint32(comments.length, true), ...comments]);
917
- }
918
- function parsePicture(bytes) {
919
- const r = new Reader(bytes), type = r.u32(0), mimeSize = r.u32(4), mime = r.text(8, mimeSize);
920
- let offset = 8 + mimeSize;
921
- const descriptionSize = r.u32(offset);
922
- offset += 4;
923
- const description = new TextDecoder().decode(r.slice(offset, descriptionSize));
924
- offset += descriptionSize;
925
- const width = r.u32(offset), height = r.u32(offset + 4), depth = r.u32(offset + 8), colors = r.u32(offset + 12), size = r.u32(offset + 16);
926
- offset += 20;
927
- const data = r.slice(offset, size);
928
- if (offset + size !== bytes.length) throw new Error("Trailing FLAC picture bytes");
929
- return { type, mime, description, width, height, depth, colors, data };
930
- }
931
- function encodePicture(p) {
932
- const description = new TextEncoder().encode(p.description), mime = ascii(p.mime);
933
- return join([
934
- uint32(p.type),
935
- uint32(mime.length),
936
- mime,
937
- uint32(description.length),
938
- description,
939
- uint32(p.width ?? 0),
940
- uint32(p.height ?? 0),
941
- uint32(p.depth ?? 0),
942
- uint32(p.colors ?? 0),
943
- uint32(p.data.length),
944
- p.data
945
- ]);
946
- }
947
- function pictureBase64(picture) {
948
- const bytes = encodePicture(picture);
949
- let binary = "";
950
- for (let i = 0; i < bytes.length; i += 8192)
951
- binary += String.fromCharCode(...bytes.subarray(i, i + 8192));
952
- return btoa(binary);
953
- }
954
-
955
- // packages/audio-ast/src/flac.ts
956
- function parseFlac(bytes) {
957
- const r = new Reader(bytes), nodes = [], pictures = [];
958
- const tags = {};
959
- let offset = 4, last = false, stream;
960
- while (!last) {
961
- const header = r.u8(offset), type = header & 127, size = r.u24(offset + 1);
962
- last = !!(header & 128);
963
- const data = r.slice(offset + 4, size), node = {
964
- type: [
965
- "STREAMINFO",
966
- "PADDING",
967
- "APPLICATION",
968
- "SEEKTABLE",
969
- "VORBIS_COMMENT",
970
- "CUESHEET",
971
- "PICTURE"
972
- ][type] ?? `BLOCK_${type}`,
973
- offset,
974
- size: size + 4,
975
- data
976
- };
977
- nodes.push(node);
978
- const block = new Reader(data);
979
- if (type === 0) {
980
- if (stream || offset !== 4 || size !== 34)
981
- throw new Error("FLAC requires first unique STREAMINFO");
982
- const packed = block.u64(10), sampleRate = Number(packed >> 44n), channels = Number(packed >> 41n & 7n) + 1, bitsPerSample = Number(packed >> 36n & 31n) + 1, samples = Number(packed & 0xfffffffffn);
983
- const seconds2 = duration(samples, sampleRate);
984
- stream = {
985
- codec: "flac",
986
- sampleRate,
987
- channels,
988
- bitsPerSample,
989
- samples,
990
- duration: seconds2,
991
- bitrate: seconds2 ? bytes.length * 8 / seconds2 : 0
992
- };
993
- node.fields = {
994
- minBlockSize: block.u16(0),
995
- maxBlockSize: block.u16(2),
996
- minFrameSize: block.u24(4),
997
- maxFrameSize: block.u24(7),
998
- sampleRate,
999
- channels,
1000
- bitsPerSample,
1001
- totalSamples: samples,
1002
- md5: Array.from(block.slice(18, 16), (b) => b.toString(16).padStart(2, "0")).join("")
1003
- };
1004
- } else if (type === 4) {
1005
- const parsed = parseComments(data);
1006
- if (parsed.size !== size) throw new Error("Trailing Vorbis comment bytes");
1007
- Object.assign(tags, parsed.tags);
1008
- node.fields = { vendor: parsed.vendor, comments: parsed.comments };
1009
- } else if (type === 6) pictures.push(parsePicture(data));
1010
- else if (type === 3) {
1011
- if (size % 18) throw new Error("Invalid FLAC seek table");
1012
- const points = [];
1013
- for (let pos = 0; pos < size; pos += 18)
1014
- points.push({
1015
- sample: block.u64(pos),
1016
- offset: block.u64(pos + 8),
1017
- samples: block.u16(pos + 16)
1018
- });
1019
- node.fields = { points };
1020
- } else if (type === 127) throw new Error("Invalid FLAC metadata block");
1021
- offset += 4 + size;
1022
- }
1023
- if (!stream) throw new Error("Missing FLAC STREAMINFO");
1024
- if (offset < bytes.length)
1025
- nodes.push({
1026
- type: "FRAMES",
1027
- offset,
1028
- size: bytes.length - offset,
1029
- data: r.slice(offset, bytes.length - offset)
1030
- });
1031
- return {
1032
- format: "flac",
1033
- data: bytes,
1034
- nodes,
1035
- tags,
1036
- pictures,
1037
- streams: [stream],
1038
- duration: stream.duration,
1039
- bitrate: stream.bitrate
1040
- };
1041
- }
1042
-
1043
1115
  // packages/audio-ast/src/ogg.ts
1044
1116
  function oggCrc(bytes) {
1045
1117
  let crc = 0;
@@ -1626,9 +1698,11 @@ export {
1626
1698
  extractChannels,
1627
1699
  fade,
1628
1700
  normalize,
1701
+ normalizeVorbisCommentKey,
1629
1702
  pad,
1630
1703
  parseAudio,
1631
1704
  probeAudio,
1705
+ probeFlacSource,
1632
1706
  probeWavSource,
1633
1707
  remix,
1634
1708
  resample,
@@ -0,0 +1,14 @@
1
+ import type { AudioPicture, AudioTags } from "./types.js";
2
+ export declare function parseComments(bytes: Uint8Array): {
3
+ tags: AudioTags;
4
+ vendor: string;
5
+ comments: string[];
6
+ size: number;
7
+ };
8
+ export declare function encodeComments(tags: AudioTags, vendor?: string): Uint8Array;
9
+ export declare function parsePicture(bytes: Uint8Array): AudioPicture;
10
+ export declare function encodePicture(p: AudioPicture): Uint8Array;
11
+ export declare function pictureBase64(picture: AudioPicture): string;
12
+ /** Preserve normalization and duplicate joining for decoded Vorbis comments. */
13
+ export declare function addVorbisComment(tags: AudioTags, value: string): void;
14
+ export declare function normalizeVorbisCommentKey(value: string): string;
@@ -1762,7 +1762,7 @@ async function openPdfImage(source, fs, directory, signal, options, storage) {
1762
1762
  if (failure) throw failure.error;
1763
1763
  };
1764
1764
  try {
1765
- document = await PdfRetainedDocument.open(retained, { fs, directory }, { signal, recovery: "repair", chunkBytes: 16384, maxNodes: 1 / 0, maxTokenBytes: 1 / 0, maxRecursionDepth: 1 / 0, maxPageTreeDepth: 1 / 0, xref: { arrayStorage: values, storedArrayKeys: ["Index"] }, valueArrays: { stringStorage: values, storedStringKeys: ["ActualText"], arrayStorage: values, storedArrayKeys: ["Contents", "Annots", "Kids", "Widths", "W", "Differences", "ON", "OFF", "OCGs"], storedArrayPaths: [["ExtGState", "*", "D"]] } });
1765
+ document = await PdfRetainedDocument.open(retained, { fs, directory }, { signal, recovery: "repair", chunkBytes: 16384, maxNodes: 1 / 0, maxTokenBytes: 1 / 0, maxRecursionDepth: 1 / 0, maxPageTreeDepth: 1 / 0, xref: { arrayStorage: values, storedArrayKeys: ["Index"] }, valueArrays: { containerStorage: values, stringStorage: values, storedStringKeys: ["ActualText"], arrayStorage: values, storedArrayKeys: ["Contents", "Annots", "Kids", "Widths", "W", "Differences", "ON", "OFF", "OCGs"], storedArrayPaths: [["ExtGState", "*", "D"]] } });
1766
1766
  let pages = 0, selected;
1767
1767
  for await (let page of document.pages())
1768
1768
  pages++, page.index <= Math.max(0, settings.page ?? 0) && (selected = page);
@@ -1,6 +1,17 @@
1
1
  import type { PagedStorage } from "@poe-platform/safe-fs/storage";
2
2
  import type { BackedJson } from "./backed-json.js";
3
+ type Mode = "value" | "arrayFirst" | "keyFirst" | "key" | "colon" | "separator" | "done";
4
+ type NumberState = "start" | "minus" | "zero" | "int" | "dot" | "frac" | "exp" | "expSign" | "expDigits";
5
+ export interface JsonSyntaxContext {
6
+ readonly mode: Mode;
7
+ readonly token: "string" | "number" | "keyword" | undefined;
8
+ readonly number: NumberState;
9
+ readonly escape: boolean;
10
+ readonly hex: number;
11
+ readonly container: "array" | "object" | undefined;
12
+ }
3
13
  /** JSON syntax and duplicate-key validation over streamed UTF-16 fragments.
4
14
  * Numeric spellings stay on tape; format-specific range/rounding validation is
5
15
  * separate. Both nesting state and the key index live in caller storage. */
6
- export declare function parseBackedJson(chunks: AsyncIterable<string>, tree: BackedJson, index: PagedStorage, cooperate: (units?: number) => Promise<void>, error: (offset: number, message: string, tokenOffset?: number) => never, validateNumber?: (node: number, offset: number) => Promise<void>, allowDuplicateKeys?: boolean, checkDepth?: (depth: number, container?: boolean) => void, node?: (kind: "object" | "array" | "key" | "scalar", complete?: boolean) => void, reference?: () => void, retained?: (bytes: number) => void): Promise<void>;
16
+ export declare function parseBackedJson(chunks: AsyncIterable<string>, tree: BackedJson, index: PagedStorage, cooperate: (units?: number) => Promise<void>, onError: (offset: number, message: string, tokenOffset?: number, context?: JsonSyntaxContext) => never, validateNumber?: (node: number, offset: number) => Promise<void>, allowDuplicateKeys?: boolean, checkDepth?: (depth: number, container?: boolean) => void, node?: (kind: "object" | "array" | "key" | "scalar", complete?: boolean) => void, reference?: () => void, retained?: (bytes: number) => void): Promise<void>;
17
+ export {};
@@ -1,4 +1,4 @@
1
1
  export { BackedJson } from "./backed-json.js";
2
- export { parseBackedJson } from "./backed-json-parser.js";
2
+ export { parseBackedJson, type JsonSyntaxContext } from "./backed-json-parser.js";
3
3
  export { JsonNumberError, readJsonNumber } from "./json-number.js";
4
4
  export { indexJsonObjects } from "./object-order.js";
@@ -2,3 +2,4 @@ export * from "./office-errors.js";
2
2
  export * from "./office-resources.js";
3
3
  export * from "./retained-xml.js";
4
4
  export * from "./retained-xml-document.js";
5
+ export * from "./retained-xml-edits.js";
@@ -0,0 +1,22 @@
1
+ import type { ByteSource } from "../office-package/index.js";
2
+ import { type RetainedXmlContext } from './office-resources.js';
3
+ import { type RetainedXml, type XmlRange } from './retained-xml.js';
4
+ export interface RetainedXmlEdit {
5
+ /** Original decoded UTF-8 coordinates. Edits must be ordered and disjoint;
6
+ * consecutive zero-length insertions at the same coordinate preserve order. */
7
+ readonly range: XmlRange;
8
+ /** Borrowed UTF-8 replacement, consumed before the next edit is requested. */
9
+ readonly replacement: ByteSource;
10
+ }
11
+ export interface StagedXmlMutation {
12
+ readonly byteLength: number;
13
+ bytes(): ByteSource;
14
+ write(sink: {
15
+ write(bytes: Uint8Array): Promise<void>;
16
+ }): Promise<void>;
17
+ close(): Promise<void>;
18
+ }
19
+ /** Admit source and result, then expose an owned staged mutation. The edit
20
+ * factory may traverse the immutable lexical view; that view expires before
21
+ * return. Neither a whole XML part nor the edit collection is retained in RAM. */
22
+ export declare function stageRetainedXmlEdits(source: ByteSource, edits: (original: RetainedXml) => AsyncIterable<RetainedXmlEdit>, settings: RetainedXmlContext): Promise<StagedXmlMutation>;
@@ -1,3 +1,4 @@
1
+ import { type JsonSyntaxContext } from "../../json-ast/index.js";
1
2
  import { type PdfCosRef } from "../ast.js";
2
3
  import { PdfFileSource } from "../source.js";
3
4
  import type { PdfRetainedDocument } from "../retained-document.js";
@@ -6,7 +7,7 @@ export interface ApplyQpdfJsonOptions {
6
7
  /** The caller retains ownership of datafile handles. */
7
8
  readonly dataFile?: (path: string) => Promise<PdfFileSource | undefined>;
8
9
  readonly maxInputBytes?: number;
9
- readonly syntaxError?: (offset: number, message: string, tokenOffset?: number) => never;
10
+ readonly syntaxError?: (offset: number, message: string, tokenOffset?: number, context?: JsonSyntaxContext) => never;
10
11
  }
11
12
  /** A mutable JSON-import document backed only by the caller filesystem. Apply
12
13
  * updates sequentially and publish chunks only after all updates succeed.
@@ -1,7 +1,9 @@
1
- import type { PdfCosNode, PdfCosDict, PdfPixelStorage } from "../ast.js";
1
+ import type { PdfCosNode, PdfCosDict, PdfDictEntry, PdfPixelStorage, PdfStoredItems } from "../ast.js";
2
2
  import type { CosToken } from "./lexer.js";
3
3
  export interface ValueArrayStorage {
4
4
  readonly arrayStorage?: PdfPixelStorage;
5
+ /** Back suspended parser containers; selected descriptors must share this storage. */
6
+ readonly containerStorage?: PdfPixelStorage;
5
7
  /** Select decoded source strings without changing other string consumers. */
6
8
  readonly stringStorage?: PdfPixelStorage;
7
9
  readonly storedStringKeys?: readonly string[];
@@ -14,11 +16,30 @@ export interface ValueArrayStorage {
14
16
  readonly arrayPathPrefix?: readonly string[];
15
17
  readonly storeRootArray?: boolean;
16
18
  }
19
+ export type ValueContainer = ({
20
+ kind: "array";
21
+ start: number;
22
+ items: PdfCosNode[];
23
+ storedItems?: PdfStoredItems;
24
+ tail: number;
25
+ } | {
26
+ kind: "dict";
27
+ start: number;
28
+ entries: PdfDictEntry[];
29
+ key?: PdfDictEntry["key"];
30
+ }) & {
31
+ path: readonly (string | null)[];
32
+ };
17
33
  export type ValueWork<T> = Generator<void | "token" | PdfCosDict | {
18
34
  kind: "array-append";
19
35
  node: PdfCosNode;
20
36
  previous: number;
21
- }, T, CosToken | PdfCosNode | number | undefined>;
37
+ } | {
38
+ kind: "container-push";
39
+ container: ValueContainer;
40
+ } | {
41
+ kind: "container-pop";
42
+ }, T, CosToken | PdfCosNode | ValueContainer | number | undefined>;
22
43
  export declare function parseValueSteps(lexer: {
23
44
  offset: number;
24
45
  setStringStorage?: (storage: PdfPixelStorage | undefined) => void;
@@ -0,0 +1,20 @@
1
+ import type { PdfIndexStorage } from "../cos/object-index.js";
2
+ import type { PdfFormFieldInfo } from "../edit/forms.js";
3
+ import type { PdfRetainedDocument } from "../retained-document.js";
4
+ import { type RetainedFieldOptions } from "./retained-form-fields.js";
5
+ /** Borrowed field metadata. Consume values/options before advancing the field
6
+ * iterator. Both iterators close when their field or document is released. */
7
+ export interface PdfRetainedFormFieldDetails {
8
+ readonly name: string;
9
+ readonly type: PdfFormFieldInfo["type"];
10
+ readonly flags: number;
11
+ readonly justification: "Left" | "Centered" | "Right";
12
+ readonly maxLength: number | undefined;
13
+ readonly altName: string | undefined;
14
+ readonly defaultValue: string | undefined;
15
+ readonly stateValue: string | undefined;
16
+ readonly checked: boolean | undefined;
17
+ values(): AsyncGenerator<string, void, void>;
18
+ options(): AsyncGenerator<string, void, void>;
19
+ }
20
+ export declare function walkRetainedFormFieldDetails(document: PdfRetainedDocument, storage: PdfIndexStorage, options?: RetainedFieldOptions): AsyncGenerator<PdfRetainedFormFieldDetails, void, void>;