@higgsfield/video-editor-mcp 1.0.7 → 1.1.1-dev.0

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 (189) hide show
  1. package/THIRD_PARTY_NOTICES.md +24 -24
  2. package/dist/cli.mjs +134 -125
  3. package/dist/index.html +136 -133
  4. package/dist/launcher.mjs +90 -90
  5. package/dist/server.mjs +1553 -1389
  6. package/node_modules/@higgsfield/higgsedit/README.md +181 -1
  7. package/node_modules/@higgsfield/higgsedit/dist/capture-page.js +902 -314
  8. package/node_modules/@higgsfield/higgsedit/dist/chunk-2JYLVSVV.mjs +1594 -0
  9. package/node_modules/@higgsfield/higgsedit/dist/chunk-2WKNH7OL.mjs +16 -0
  10. package/node_modules/@higgsfield/higgsedit/dist/{chunk-OMKZ5BXM.mjs → chunk-5LTTL3Q3.mjs} +1 -1
  11. package/node_modules/@higgsfield/higgsedit/dist/chunk-7PYXSJS7.mjs +717 -0
  12. package/node_modules/@higgsfield/higgsedit/dist/{chunk-MLJAIZGP.mjs → chunk-BH2QF635.mjs} +33 -326
  13. package/node_modules/@higgsfield/higgsedit/dist/{chunk-WZR5PZM7.mjs → chunk-BV5COOQZ.mjs} +250 -161
  14. package/node_modules/@higgsfield/higgsedit/dist/{chunk-HTCYVKFX.mjs → chunk-C3GSB3XZ.mjs} +8 -7
  15. package/node_modules/@higgsfield/higgsedit/dist/{chunk-CYH2EUQV.mjs → chunk-DVN4LUXV.mjs} +13 -4
  16. package/node_modules/@higgsfield/higgsedit/dist/chunk-F4CMIG5G.mjs +36 -0
  17. package/node_modules/@higgsfield/higgsedit/dist/chunk-IEPPEDEU.mjs +33 -0
  18. package/node_modules/@higgsfield/higgsedit/dist/{chunk-UVAZ6I6U.mjs → chunk-KIWGVAPJ.mjs} +16 -12
  19. package/node_modules/@higgsfield/higgsedit/dist/{chunk-L6QDNSL3.mjs → chunk-L5LWBA6A.mjs} +5 -5
  20. package/node_modules/@higgsfield/higgsedit/dist/chunk-LMQR3DHT.mjs +37 -0
  21. package/node_modules/@higgsfield/higgsedit/dist/chunk-LTKMGZ6T.mjs +58 -0
  22. package/node_modules/@higgsfield/higgsedit/dist/{chunk-VI6IV6JP.mjs → chunk-MV2JTTBQ.mjs} +65 -47
  23. package/node_modules/@higgsfield/higgsedit/dist/{chunk-4D6AXU4B.mjs → chunk-NARTAWRN.mjs} +50 -30
  24. package/node_modules/@higgsfield/higgsedit/dist/{chunk-27NBQ5FA.mjs → chunk-NUXTKQNM.mjs} +33 -21
  25. package/node_modules/@higgsfield/higgsedit/dist/chunk-OCIZ36XD.mjs +40 -0
  26. package/node_modules/@higgsfield/higgsedit/dist/{chunk-MK6PL7N4.mjs → chunk-OF6RMSM2.mjs} +19 -17
  27. package/node_modules/@higgsfield/higgsedit/dist/{chunk-6BETMESC.mjs → chunk-P2BGHTRR.mjs} +2 -2
  28. package/node_modules/@higgsfield/higgsedit/dist/{chunk-EKFC4S4M.mjs → chunk-PAHMD6SU.mjs} +5 -0
  29. package/node_modules/@higgsfield/higgsedit/dist/{chunk-QVLAEV3U.mjs → chunk-PFQYUJQL.mjs} +3 -4
  30. package/node_modules/@higgsfield/higgsedit/dist/chunk-QJTILFBS.mjs +335 -0
  31. package/node_modules/@higgsfield/higgsedit/dist/chunk-QQ3GGKDN.mjs +21 -0
  32. package/node_modules/@higgsfield/higgsedit/dist/chunk-TH7TK67K.mjs +23 -0
  33. package/node_modules/@higgsfield/higgsedit/dist/{chunk-SIMO6I3D.mjs → chunk-UDL5AHKO.mjs} +163 -158
  34. package/node_modules/@higgsfield/higgsedit/dist/chunk-UMWOUQN3.mjs +60 -0
  35. package/node_modules/@higgsfield/higgsedit/dist/{chunk-3AIM3THH.mjs → chunk-VLM5EOWJ.mjs} +4 -4
  36. package/node_modules/@higgsfield/higgsedit/dist/chunk-WENFTPXQ.mjs +403 -0
  37. package/node_modules/@higgsfield/higgsedit/dist/chunk-YLVXQIPX.mjs +464 -0
  38. package/node_modules/@higgsfield/higgsedit/dist/editor/.vite/manifest.json +559 -506
  39. package/node_modules/@higgsfield/higgsedit/dist/editor/assets/agent-corner-bottom-q4hZltI-.svg +431 -0
  40. package/node_modules/@higgsfield/higgsedit/dist/editor/assets/agent-corner-top-BJYI-I24.svg +431 -0
  41. package/node_modules/@higgsfield/higgsedit/dist/editor/assets/confirmation-BTnwl3LS.css +1 -0
  42. package/node_modules/@higgsfield/higgsedit/dist/editor/assets/drag-Bt_t4HZO.css +1 -0
  43. package/node_modules/@higgsfield/higgsedit/dist/editor/assets/local-B3OTAV_A.css +1 -0
  44. package/node_modules/@higgsfield/higgsedit/dist/editor/assets/menubar-2Y1Y2XJt.css +1 -0
  45. package/node_modules/@higgsfield/higgsedit/dist/editor/assets/model-DdE4hCgf.css +1 -0
  46. package/node_modules/@higgsfield/higgsedit/dist/editor/assets/{IconText1-CzbCrP7v.css → notifications-B08L1jSe.css} +1 -1
  47. package/node_modules/@higgsfield/higgsedit/dist/editor/assets/{panel-g852pZf_.css → panel-BRN_AbBM.css} +1 -1
  48. package/node_modules/@higgsfield/higgsedit/dist/editor/assets/panel-CYELNqrv.css +1 -0
  49. package/node_modules/@higgsfield/higgsedit/dist/editor/assets/panel-DYLpT6oA.css +1 -0
  50. package/node_modules/@higgsfield/higgsedit/dist/editor/assets/panel-v84HaGTZ.css +1 -0
  51. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconChainLink1-Bxb1Or0F.js +1 -0
  52. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/{IconCheckmark2Medium-daaES9uF.js → IconCheckmark2Medium-hegaz9mQ.js} +1 -1
  53. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/{IconChevronDownSmall-BhTBJk26.js → IconChevronDownSmall-DaruzJwU.js} +1 -1
  54. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconClosedCaptioning-BPqcqKsD.js +1 -0
  55. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/{IconCrossMedium-acfnCXOM.js → IconCrossMedium-BsPFJzc6.js} +1 -1
  56. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconOpenaiFilled-D1fzthmi.js +1 -0
  57. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/{IconPause-pTeVSvUe.js → IconPause-ClNg8pao.js} +1 -1
  58. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/{IconPlayFilled-CwdgIuDG.js → IconPlayFilled-CHb-7GSx.js} +1 -1
  59. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconSparklesSoftFilled-o7o33KRn.js +1 -0
  60. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/ai-composer-B9h-eaki.js +567 -0
  61. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/auto-layout-BO20Tg4B.js +1 -0
  62. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/{button-CjG6GcgF.js → button-Cg0U0zpV.js} +1 -1
  63. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/canvas-Bw4CVzfw.js +1 -0
  64. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/capabilities-BCd4-zPF.js +1 -0
  65. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/commands-QeSqAbCt.js +1 -0
  66. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/components-tXMtIZNL.js +51 -0
  67. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/confirmation-CO2PHR_z.js +1 -0
  68. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/dom-6aoQn29n.js +1 -0
  69. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/drag-Dw8b_vO2.js +1 -0
  70. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/{editing-CjWbiCxv.js → editing-Cy-SaOyB.js} +1 -1
  71. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/edits-CqLBqir0.js +1 -0
  72. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/export-dialog-BjBskOe3.js +2 -0
  73. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/factories-Bw_iQrUL.js +1 -0
  74. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/id3-CSR0NCRI.js +2 -0
  75. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/import-DP49i4ke.js +1 -0
  76. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/import-error-CMz9sLPe.js +1 -0
  77. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/ingest-DsmIc415.js +1 -0
  78. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/jsx-runtime-B5yqYJvp.js +1 -0
  79. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/{media-Bwjxu-0U.js → media-DQw6vU_T.js} +1 -1
  80. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/menubar-D31srALX.js +1 -0
  81. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/meters-D0nZVEJs.js +1 -0
  82. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/mode-DEG6doKF.js +1 -0
  83. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/model-Duf9fszJ.js +2 -0
  84. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/model-DyAkLA69.js +1 -0
  85. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/notifications-DqWZNIrK.js +9 -0
  86. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/palette-HT83gWgL.js +1 -0
  87. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-B5Mvm6dg.js +7 -0
  88. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-BC90wyvd.js +1 -0
  89. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-Bw_ZJ2JI.js +3 -0
  90. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-DNS060Nt.js +3 -0
  91. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-DSgxIrEq.js +2 -0
  92. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-DgBttE5O.js +1 -0
  93. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-assets-_T2bHsHW.js +771 -0
  94. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-inspector-DfHvAt5X.js +2 -0
  95. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-nBZvHlkA.js +1 -0
  96. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-timeline-DsCpJVSt.js +327 -0
  97. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-viewport-CEhZwZ67.js +280 -0
  98. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/projects-2_tW9Do7.js +1 -0
  99. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/react-dom-1uB7Vbbb.js +1 -0
  100. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/schemas-CddYAOcj.js +64 -0
  101. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/session-BpFeKAI2.js +1 -0
  102. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/src-BLG3tYBa.js +2 -0
  103. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/styles-e2n2A_JN.js +284 -0
  104. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/supercomputer-CuV0zYKd.js +24 -0
  105. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/tabs-XeAgs9cs.js +1 -0
  106. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/toggle-DbNEaSIl.js +1 -0
  107. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/transport-C8Ll3qFl.js +69 -0
  108. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/transport-bar-Dv1LPFbu.js +1 -0
  109. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/useOpenInteractionType-HWSfSsp2.js +1 -0
  110. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/useRenderElement-D4SOg3N_.js +1 -0
  111. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/value-EB7YmAdS.js +1 -0
  112. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/writeback-support-fj5rA9k3.js +1 -0
  113. package/node_modules/@higgsfield/higgsedit/dist/editor/editor-B-WAkLt7.js +372 -0
  114. package/node_modules/@higgsfield/higgsedit/dist/higgsedit.mjs +39 -24
  115. package/node_modules/@higgsfield/higgsedit/dist/jsx/hooks.d.ts +26 -0
  116. package/node_modules/@higgsfield/higgsedit/dist/jsx/index.d.ts +17 -0
  117. package/node_modules/@higgsfield/higgsedit/dist/jsx/inspect.d.ts +42 -0
  118. package/node_modules/@higgsfield/higgsedit/dist/jsx/jsx-runtime.d.ts +28 -0
  119. package/node_modules/@higgsfield/higgsedit/dist/jsx/svg.d.ts +9 -0
  120. package/node_modules/@higgsfield/higgsedit/dist/jsx/time.d.ts +6 -0
  121. package/node_modules/@higgsfield/higgsedit/dist/jsx/types.d.ts +420 -0
  122. package/node_modules/@higgsfield/higgsedit/package.json +28 -20
  123. package/package.json +4 -3
  124. package/plugin/.codex-plugin/plugin.json +1 -1
  125. package/plugin/plugin.json +1 -1
  126. package/plugin/skills/video-editing/references/caption-titling.md +1 -1
  127. package/plugin/skills/video-editing/references/local-setup.md +3 -3
  128. package/node_modules/@higgsfield/higgsedit/dist/chunk-C6SASQHE.mjs +0 -424
  129. package/node_modules/@higgsfield/higgsedit/dist/chunk-FZ5U36SQ.mjs +0 -83
  130. package/node_modules/@higgsfield/higgsedit/dist/chunk-QLPCYN6K.mjs +0 -292
  131. package/node_modules/@higgsfield/higgsedit/dist/editor/assets/edit-drag-D2EV5ddd.css +0 -1
  132. package/node_modules/@higgsfield/higgsedit/dist/editor/assets/editor-CuRHT75g.css +0 -1
  133. package/node_modules/@higgsfield/higgsedit/dist/editor/assets/panel-DnuQD7ja.css +0 -1
  134. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/FieldControl-B0fenhBJ.js +0 -2
  135. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconChainLink1-Cwv1X7hi.js +0 -1
  136. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconEyeOpen-BqTT9_VV.js +0 -1
  137. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconEyeSlash-Whv58c1m.js +0 -1
  138. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconPencil-Dr17k_7e.js +0 -1
  139. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconPlay-BroH3ziH.js +0 -1
  140. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconPlusSmall-43T9aE3d.js +0 -1
  141. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconText1-BaP_p9DW.js +0 -1
  142. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconTrashCan-DX2w2AIC.js +0 -1
  143. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/ai-composer-C-l0eIdP.js +0 -560
  144. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/captions-Cd-bDG3G.js +0 -1
  145. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/clip-highlight-DpAvcA4x.js +0 -1
  146. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/components-e3ZbUVns.js +0 -1
  147. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/disposables-CwUPjcuA.js +0 -1
  148. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/drag-HLBkto5o.js +0 -1
  149. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/dropdown-BJ04G_X3.js +0 -1
  150. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/edit-drag-Bg6LggKC.js +0 -1
  151. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/edits-a2IixhrN.js +0 -1
  152. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/export-dialog-4I4gqI5V.js +0 -2
  153. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/face-tracker-DzVfjVOO.js +0 -1
  154. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/fit-imported-media-CaCB0x0b.js +0 -1
  155. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/generation-queue-DuL2F4-_.js +0 -1
  156. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/import-error-CMARA0Hy.js +0 -1
  157. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/jsx-runtime-B-hcVAMW.js +0 -1
  158. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/menubar-Bs26OdwP.js +0 -1
  159. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/meters-YEr9OQjq.js +0 -1
  160. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/paints-DS2Msf91.js +0 -67
  161. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/palette-CcS9IcAC.js +0 -1
  162. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-7M3uQokX.js +0 -1
  163. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-BBK1NyG-.js +0 -1
  164. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-CHZTs7By.js +0 -4
  165. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-DaSOa3MP.js +0 -2
  166. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-DlK3RYVo.js +0 -1
  167. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-Dst5OKWu.js +0 -2
  168. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-H_ZoDiKK.js +0 -2
  169. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-Rn9Z7Eek.js +0 -3
  170. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-assets-FAghGFG3.js +0 -678
  171. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-inspector-DEqULBNF.js +0 -260
  172. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-timeline-0GYNz1uc.js +0 -333
  173. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-viewport-DOWjJi5-.js +0 -317
  174. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/projects-BBJc7h5_.js +0 -2
  175. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/session-B9sZaFKC.js +0 -1
  176. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/supercomputer-CX-LCL6Y.js +0 -24
  177. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/tabs-CvKQ-eas.js +0 -1
  178. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/toggle-CrzrwiDZ.js +0 -1
  179. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/transport-BgRfk-Qq.js +0 -69
  180. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/transport-bar-C9nqAfE2.js +0 -1
  181. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/typography-C5-w9LOu-kD3uLKkf.js +0 -1
  182. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/useOpenInteractionType-DbrQ6Ehu.js +0 -1
  183. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/useRenderElement-bbxXdYq0.js +0 -1
  184. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/writeback-support-BZfNpkmB.js +0 -1
  185. package/node_modules/@higgsfield/higgsedit/dist/editor/editor-Csn2_T_e.js +0 -293
  186. package/node_modules/@higgsfield/higgsedit/dist/export-settings.mjs +0 -75
  187. package/node_modules/@higgsfield/higgsedit/dist/history.mjs +0 -295
  188. package/node_modules/@higgsfield/higgsedit/dist/media-upload.mjs +0 -381
  189. package/node_modules/@higgsfield/higgsedit/dist/proxy.mjs +0 -170
@@ -10,26 +10,28 @@ import {
10
10
  packagedAsset,
11
11
  readBody,
12
12
  sendFile
13
- } from "./chunk-QLPCYN6K.mjs";
14
- import {
15
- flag,
16
- flags
17
- } from "./chunk-MCVD2ZQV.mjs";
18
- import "./chunk-SIMO6I3D.mjs";
13
+ } from "./chunk-7PYXSJS7.mjs";
14
+ import "./chunk-UDL5AHKO.mjs";
15
+ import "./chunk-LTKMGZ6T.mjs";
19
16
  import {
20
17
  launch
21
- } from "./chunk-6BETMESC.mjs";
18
+ } from "./chunk-P2BGHTRR.mjs";
19
+ import {
20
+ ffmpeg,
21
+ probe
22
+ } from "./chunk-PAHMD6SU.mjs";
23
+ import "./chunk-NUXTKQNM.mjs";
24
+ import "./chunk-2VKQHJMM.mjs";
22
25
  import {
23
26
  encodeMaskFile
24
- } from "./chunk-WZR5PZM7.mjs";
27
+ } from "./chunk-BV5COOQZ.mjs";
25
28
  import {
26
29
  parseTime
27
30
  } from "./chunk-F7YUKEI5.mjs";
28
31
  import {
29
- ffmpeg,
30
- probe
31
- } from "./chunk-EKFC4S4M.mjs";
32
- import "./chunk-2VKQHJMM.mjs";
32
+ flag,
33
+ flags
34
+ } from "./chunk-MCVD2ZQV.mjs";
33
35
  import "./chunk-75WO2NOF.mjs";
34
36
 
35
37
  // src/segment.ts
@@ -407,6 +409,8 @@ export {
407
409
  modelCached,
408
410
  modelDir,
409
411
  ortDir,
412
+ point,
413
+ prompts,
410
414
  runSegment,
411
415
  segment,
412
416
  segmentBundle
@@ -5,14 +5,14 @@ const require = __higgseditRequire(import.meta.url);
5
5
  const __filename = __higgseditPath(import.meta.url);
6
6
  const __dirname = __filename.slice(0, __filename.lastIndexOf("/"));
7
7
  import {
8
- flag
9
- } from "./chunk-MCVD2ZQV.mjs";
8
+ findTool
9
+ } from "./chunk-PAHMD6SU.mjs";
10
10
  import {
11
11
  parseTranscript
12
- } from "./chunk-WZR5PZM7.mjs";
12
+ } from "./chunk-BV5COOQZ.mjs";
13
13
  import {
14
- findTool
15
- } from "./chunk-EKFC4S4M.mjs";
14
+ flag
15
+ } from "./chunk-MCVD2ZQV.mjs";
16
16
 
17
17
  // src/transcribe.ts
18
18
  import { execFile } from "node:child_process";
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __higgseditRequire } from "node:module";
3
+ import { fileURLToPath as __higgseditPath } from "node:url";
4
+ const require = __higgseditRequire(import.meta.url);
5
+ const __filename = __higgseditPath(import.meta.url);
6
+ const __dirname = __filename.slice(0, __filename.lastIndexOf("/"));
7
+ import {
8
+ FONT_CATEGORIES,
9
+ fontListText,
10
+ listFonts
11
+ } from "./chunk-NUXTKQNM.mjs";
12
+ import "./chunk-2VKQHJMM.mjs";
13
+ import "./chunk-BV5COOQZ.mjs";
14
+ import "./chunk-F7YUKEI5.mjs";
15
+ import {
16
+ flag
17
+ } from "./chunk-MCVD2ZQV.mjs";
18
+ import "./chunk-75WO2NOF.mjs";
19
+
20
+ // src/fonts/cli.ts
21
+ async function runFonts(args, print) {
22
+ const category = flag(args, "category");
23
+ if (category && !FONT_CATEGORIES.includes(category)) throw new Error(`unknown --category ${category}; use ${FONT_CATEGORIES.join(", ")}`);
24
+ const limit = flag(args, "limit");
25
+ const query = {
26
+ ...args.positional[0] ? { family: args.positional[0] } : {},
27
+ ...category ? { category } : {},
28
+ ...args.flags.cached === true ? { cached: true } : {},
29
+ ...limit ? { limit: Number(limit) } : {}
30
+ };
31
+ const list = await listFonts(query);
32
+ print(list, () => fontListText(list));
33
+ return 0;
34
+ }
35
+ export {
36
+ runFonts
37
+ };
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __higgseditRequire } from "node:module";
3
+ import { fileURLToPath as __higgseditPath } from "node:url";
4
+ const require = __higgseditRequire(import.meta.url);
5
+ const __filename = __higgseditPath(import.meta.url);
6
+ const __dirname = __filename.slice(0, __filename.lastIndexOf("/"));
7
+
8
+ // src/project.ts
9
+ import { existsSync, readdirSync, readFileSync, statSync } from "node:fs";
10
+ import { join, relative, resolve, sep } from "node:path";
11
+ var SOURCE = /\.(tsx|ts|jsx|js)$/;
12
+ var SKIP = /* @__PURE__ */ new Set(["node_modules", "media", "renders", "dist"]);
13
+ function sourceFiles(dir, sub = "") {
14
+ const out = [];
15
+ for (const entry of readdirSync(join(dir, sub), { withFileTypes: true })) {
16
+ if (entry.name.startsWith(".") || SKIP.has(entry.name)) continue;
17
+ const rel2 = sub ? `${sub}/${entry.name}` : entry.name;
18
+ if (entry.isDirectory()) out.push(...sourceFiles(dir, rel2));
19
+ else if (SOURCE.test(entry.name) && !entry.name.endsWith(".d.ts")) out.push(rel2);
20
+ }
21
+ return out.toSorted();
22
+ }
23
+ var FONT = /\.(ttf|otf|woff2?)$/i;
24
+ var SKIP_FONTS = /* @__PURE__ */ new Set(["node_modules", "renders", "dist"]);
25
+ function fontFiles(dir, sub = "") {
26
+ const out = [];
27
+ for (const entry of readdirSync(join(dir, sub), { withFileTypes: true })) {
28
+ if (entry.name.startsWith(".") || SKIP_FONTS.has(entry.name)) continue;
29
+ const rel2 = sub ? `${sub}/${entry.name}` : entry.name;
30
+ if (entry.isDirectory()) out.push(...fontFiles(dir, rel2));
31
+ else if (FONT.test(entry.name)) out.push(rel2);
32
+ }
33
+ return out.toSorted();
34
+ }
35
+ function readSources(dir) {
36
+ return Object.fromEntries(sourceFiles(dir).map((f) => [f, readFileSync(join(dir, f), "utf8")]));
37
+ }
38
+ function inside(dir, rel2) {
39
+ const root = resolve(dir);
40
+ const target = resolve(root, rel2.replace(/^\/+/, ""));
41
+ if (target !== root && !target.startsWith(root + sep)) return void 0;
42
+ return target;
43
+ }
44
+ function assertProject(dir) {
45
+ const root = resolve(dir);
46
+ if (!existsSync(root) || !statSync(root).isDirectory()) throw new Error(`${dir} is not a directory`);
47
+ return root;
48
+ }
49
+ var rel = (dir, abs) => relative(dir, abs).split(sep).join("/");
50
+
51
+ export {
52
+ sourceFiles,
53
+ fontFiles,
54
+ readSources,
55
+ inside,
56
+ assertProject,
57
+ rel
58
+ };
@@ -210447,11 +210447,11 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
210447
210447
  return { fileName: textChanges2.fileName, textChanges: [{ start: { line: 0, offset: 0 }, end: { line: 0, offset: 0 }, newText: change.newText }] };
210448
210448
  }
210449
210449
  function getLocationInNewDocument(oldText, renameFilename, renameLocation, edits) {
210450
- const newText = applyEdits(oldText, renameFilename, edits);
210450
+ const newText = applyEdits2(oldText, renameFilename, edits);
210451
210451
  const { line: line2, character } = computeLineAndCharacterOfPosition(computeLineStarts(newText), renameLocation);
210452
210452
  return { line: line2 + 1, offset: character + 1 };
210453
210453
  }
210454
- function applyEdits(text, textFilename, edits) {
210454
+ function applyEdits2(text, textFilename, edits) {
210455
210455
  for (const { fileName, textChanges: textChanges2 } of edits) {
210456
210456
  if (fileName !== textFilename) {
210457
210457
  continue;
@@ -211589,12 +211589,12 @@ var require_commonjs = __commonJS({
211589
211589
  }
211590
211590
  });
211591
211591
 
211592
- // ../../node_modules/.pnpm/brace-expansion@5.0.12/node_modules/brace-expansion/dist/commonjs/index.js
211592
+ // ../../node_modules/.pnpm/brace-expansion@5.0.9/node_modules/brace-expansion/dist/commonjs/index.js
211593
211593
  var require_commonjs2 = __commonJS({
211594
- "../../node_modules/.pnpm/brace-expansion@5.0.12/node_modules/brace-expansion/dist/commonjs/index.js"(exports) {
211594
+ "../../node_modules/.pnpm/brace-expansion@5.0.9/node_modules/brace-expansion/dist/commonjs/index.js"(exports) {
211595
211595
  "use strict";
211596
211596
  Object.defineProperty(exports, "__esModule", { value: true });
211597
- exports.EXPANSION_MAX_REWRITES = exports.EXPANSION_MAX_DEPTH = exports.EXPANSION_MAX_LENGTH = exports.EXPANSION_MAX = void 0;
211597
+ exports.EXPANSION_MAX_LENGTH = exports.EXPANSION_MAX = void 0;
211598
211598
  exports.expand = expand;
211599
211599
  var balanced_match_1 = require_commonjs();
211600
211600
  var escSlash = "\0SLASH" + Math.random() + "\0";
@@ -211614,8 +211614,6 @@ var require_commonjs2 = __commonJS({
211614
211614
  var periodPattern = /\\\./g;
211615
211615
  exports.EXPANSION_MAX = 1e5;
211616
211616
  exports.EXPANSION_MAX_LENGTH = 4e6;
211617
- exports.EXPANSION_MAX_DEPTH = 1e3;
211618
- exports.EXPANSION_MAX_REWRITES = 1e3;
211619
211617
  function numeric(str) {
211620
211618
  return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
211621
211619
  }
@@ -211625,44 +211623,36 @@ var require_commonjs2 = __commonJS({
211625
211623
  function unescapeBraces(str) {
211626
211624
  return str.replace(escSlashPattern, "\\").replace(escOpenPattern, "{").replace(escClosePattern, "}").replace(escCommaPattern, ",").replace(escPeriodPattern, ".");
211627
211625
  }
211628
- function pushAll(target, items) {
211629
- for (let i = 0; i < items.length; i++) {
211630
- target.push(items[i]);
211631
- }
211632
- }
211633
211626
  function parseCommaParts(str) {
211634
- const parts = [];
211635
- let carry = "";
211636
- for (; ; ) {
211637
- const m = (0, balanced_match_1.balanced)("{", "}", str);
211638
- if (!m) {
211639
- const tail = str.split(",");
211640
- tail[0] = carry + tail[0];
211641
- pushAll(parts, tail);
211642
- return parts;
211643
- }
211644
- const { pre, body, post } = m;
211645
- const p = pre.split(",");
211646
- p[0] = carry + p[0];
211647
- p[p.length - 1] += "{" + body + "}";
211648
- if (!post.length) {
211649
- pushAll(parts, p);
211650
- return parts;
211651
- }
211652
- carry = p.pop();
211653
- pushAll(parts, p);
211654
- str = post;
211627
+ if (!str) {
211628
+ return [""];
211655
211629
  }
211630
+ const parts = [];
211631
+ const m = (0, balanced_match_1.balanced)("{", "}", str);
211632
+ if (!m) {
211633
+ return str.split(",");
211634
+ }
211635
+ const { pre, body, post } = m;
211636
+ const p = pre.split(",");
211637
+ p[p.length - 1] += "{" + body + "}";
211638
+ const postParts = parseCommaParts(post);
211639
+ if (post.length) {
211640
+ ;
211641
+ p[p.length - 1] += postParts.shift();
211642
+ p.push.apply(p, postParts);
211643
+ }
211644
+ parts.push.apply(parts, p);
211645
+ return parts;
211656
211646
  }
211657
211647
  function expand(str, options = {}) {
211658
211648
  if (!str) {
211659
211649
  return [];
211660
211650
  }
211661
- const { max = exports.EXPANSION_MAX, maxLength = exports.EXPANSION_MAX_LENGTH, maxDepth = exports.EXPANSION_MAX_DEPTH, maxRewrites = exports.EXPANSION_MAX_REWRITES } = options;
211651
+ const { max = exports.EXPANSION_MAX, maxLength = exports.EXPANSION_MAX_LENGTH } = options;
211662
211652
  if (str.slice(0, 2) === "{}") {
211663
211653
  str = "\\{\\}" + str.slice(2);
211664
211654
  }
211665
- return expand_(escapeBraces(str), max, maxLength, maxDepth, 0, maxRewrites, true).map(unescapeBraces);
211655
+ return expand_(escapeBraces(str), max, maxLength, true).map(unescapeBraces);
211666
211656
  }
211667
211657
  function embrace(str) {
211668
211658
  return "{" + str + "}";
@@ -211740,12 +211730,8 @@ var require_commonjs2 = __commonJS({
211740
211730
  }
211741
211731
  return N;
211742
211732
  }
211743
- function expand_(str, max, maxLength, maxDepth, depth, maxRewrites, isTop) {
211744
- if (depth > maxDepth) {
211745
- return [str];
211746
- }
211733
+ function expand_(str, max, maxLength, isTop) {
211747
211734
  let acc = [""];
211748
- let rewrites = 0;
211749
211735
  let dropEmpties = false;
211750
211736
  let firstGroup = true;
211751
211737
  for (; ; ) {
@@ -211767,8 +211753,7 @@ var require_commonjs2 = __commonJS({
211767
211753
  const isSequence = isNumericSequence || isAlphaSequence;
211768
211754
  const isOptions = m.body.indexOf(",") >= 0;
211769
211755
  if (!isSequence && !isOptions) {
211770
- if (rewrites < maxRewrites && m.post.match(/,(?!,).*\}/)) {
211771
- rewrites++;
211756
+ if (m.post.match(/,(?!,).*\}/)) {
211772
211757
  str = m.pre + "{" + m.body + escClose + m.post;
211773
211758
  isTop = true;
211774
211759
  continue;
@@ -211785,7 +211770,7 @@ var require_commonjs2 = __commonJS({
211785
211770
  } else {
211786
211771
  let n = parseCommaParts(m.body);
211787
211772
  if (n.length === 1 && n[0] !== void 0) {
211788
- n = expand_(n[0], max, maxLength, maxDepth, depth + 1, maxRewrites, false).map(embrace);
211773
+ n = expand_(n[0], max, maxLength, false).map(embrace);
211789
211774
  if (n.length === 1) {
211790
211775
  acc = combine(acc, pre + n[0], [""], max, maxLength, dropEmpties && !m.post.length);
211791
211776
  if (!m.post.length)
@@ -211803,7 +211788,7 @@ var require_commonjs2 = __commonJS({
211803
211788
  values = [];
211804
211789
  let valuesLength = 0;
211805
211790
  outer: for (let j = 0; j < n.length; j++) {
211806
- const expanded = expand_(n[j], max, maxLength, maxDepth, depth + 1, maxRewrites, false);
211791
+ const expanded = expand_(n[j], max, maxLength, false);
211807
211792
  for (let k = 0; k < expanded.length; k++) {
211808
211793
  const v = expanded[k];
211809
211794
  if (dropsEmpties && !v)
@@ -241774,6 +241759,9 @@ Node text: ${this.#forgottenText}`;
241774
241759
  }
241775
241760
  });
241776
241761
 
241762
+ // ../../packages/writeback/src/edit.ts
241763
+ var import_ts_morph3 = __toESM(require_ts_morph(), 1);
241764
+
241777
241765
  // ../../packages/writeback/src/inspect.ts
241778
241766
  var import_ts_morph2 = __toESM(require_ts_morph(), 1);
241779
241767
 
@@ -241972,7 +241960,8 @@ function inspectVariables(dir) {
241972
241960
  import { randomInt } from "node:crypto";
241973
241961
  function idAllocator(taken) {
241974
241962
  return (tag) => {
241975
- const prefix = tag.replace(/[^A-Za-z0-9]/g, "").toLowerCase() || "el";
241963
+ const name = tag.replace(/[^A-Za-z0-9]/g, "");
241964
+ const prefix = (/^[A-Z]/.test(name) ? name.replace(/([a-z0-9])([A-Z])/g, "$1-$2") : name).toLowerCase() || "el";
241976
241965
  for (; ; ) {
241977
241966
  const id = `${prefix}-${randomInt(36 ** 4).toString(36).padStart(4, "0")}`;
241978
241967
  if (!taken.has(id)) {
@@ -242009,7 +241998,6 @@ function stampProject(dir) {
242009
241998
  }
242010
241999
 
242011
242000
  // ../../packages/writeback/src/edit.ts
242012
- var import_ts_morph3 = __toESM(require_ts_morph(), 1);
242013
242001
  var Refused = class extends Error {
242014
242002
  refusal;
242015
242003
  constructor(refusal) {
@@ -242338,6 +242326,19 @@ ${indent}</${tagName(parent)}>`);
242338
242326
  ${childIndent}${child}
242339
242327
  ${indent}`);
242340
242328
  }
242329
+ function ensureImport(file, name, from) {
242330
+ const sf = file.sourceFile;
242331
+ const bound = sf.getLocal(name)?.getDeclarations();
242332
+ if (bound) {
242333
+ const spec = bound.length === 1 ? bound[0].asKind(import_ts_morph3.SyntaxKind.ImportSpecifier) : void 0;
242334
+ const decl = spec?.getImportDeclaration();
242335
+ if (spec && decl && !spec.getAliasNode() && !spec.isTypeOnly() && !decl.isTypeOnly() && decl.getModuleSpecifierValue() === from) return;
242336
+ refuse("invalid", `${name} is already bound in ${file.path} to something other than the import from ${from}`, bound[0]);
242337
+ }
242338
+ const same = sf.getImportDeclarations().find((d) => d.getModuleSpecifierValue() === from && !d.isTypeOnly() && !d.getNamespaceImport());
242339
+ if (same) same.addNamedImport(name);
242340
+ else sf.addImportDeclaration({ namedImports: [name], moduleSpecifier: from });
242341
+ }
242341
242342
  function cutElement(file, tag) {
242342
242343
  const element = elementOf(tag);
242343
242344
  let start = element.getStart();
@@ -242451,8 +242452,12 @@ function applyProjectEdit(project, key, edit, options) {
242451
242452
  landed = setText(project, found, scope, edit.text);
242452
242453
  break;
242453
242454
  case "insert": {
242454
- if (!isIntrinsic(edit.tag)) refuse("invalid", `<${edit.tag}> is not a higgsedit element`);
242455
+ if (edit.import) {
242456
+ if (!IDENT.test(edit.tag) || !isComponentTag(edit.tag)) refuse("invalid", `<${edit.tag}> is not a component name`);
242457
+ if (!edit.import.from) refuse("invalid", "import.from is empty");
242458
+ } else if (!isIntrinsic(edit.tag)) refuse("invalid", `<${edit.tag}> is not a higgsedit element`);
242455
242459
  refuseInLoop(project, found.tag, "insert");
242460
+ if (edit.import) ensureImport(found.file, edit.tag, edit.import.from);
242456
242461
  const taken = new Set(project.allTags().flatMap(({ tag }) => idOf(tag) ?? []));
242457
242462
  newId = idAllocator(taken)(edit.tag);
242458
242463
  const attrs = [`id="${newId}"`, ...Object.entries(edit.props ?? {}).map(([k, v]) => `${k}=${initializerText(v)}`)].join(" ");
@@ -242579,13 +242584,26 @@ function describeText(project, found, scope) {
242579
242584
  }
242580
242585
 
242581
242586
  export {
242587
+ require_ts_morph,
242588
+ BUILTIN_COMPONENTS,
242589
+ LOOP_COMPONENTS,
242590
+ listSources,
242582
242591
  tagName,
242592
+ elementOf,
242593
+ attributeOf,
242583
242594
  idOf,
242584
242595
  isComponentTag,
242596
+ tagsIn,
242585
242597
  SourceProject,
242586
242598
  isIntrinsicTag,
242599
+ locateConst,
242587
242600
  inspectVariables,
242601
+ idAllocator,
242588
242602
  stampProject,
242603
+ literalText,
242604
+ initializerText,
242605
+ isLiteral,
242606
+ literalValue,
242589
242607
  parseKey,
242590
242608
  applyEdit,
242591
242609
  applyEdits,
@@ -8,28 +8,30 @@ import {
8
8
  json,
9
9
  readBody,
10
10
  startServer
11
- } from "./chunk-QLPCYN6K.mjs";
11
+ } from "./chunk-7PYXSJS7.mjs";
12
12
  import {
13
13
  bundlePackages,
14
- compileProject,
14
+ compileProject
15
+ } from "./chunk-UDL5AHKO.mjs";
16
+ import {
15
17
  fontFiles,
16
18
  inside,
17
19
  readSources
18
- } from "./chunk-SIMO6I3D.mjs";
20
+ } from "./chunk-LTKMGZ6T.mjs";
19
21
  import {
20
22
  capturePage,
21
23
  launch
22
- } from "./chunk-6BETMESC.mjs";
23
- import {
24
- parseTime
25
- } from "./chunk-F7YUKEI5.mjs";
24
+ } from "./chunk-P2BGHTRR.mjs";
26
25
  import {
27
26
  colourTags,
28
27
  ffmpeg,
29
28
  matrixOf,
30
29
  probe,
31
30
  probeAudio
32
- } from "./chunk-EKFC4S4M.mjs";
31
+ } from "./chunk-PAHMD6SU.mjs";
32
+ import {
33
+ parseTime
34
+ } from "./chunk-F7YUKEI5.mjs";
33
35
 
34
36
  // src/render.ts
35
37
  import { once } from "node:events";
@@ -205,28 +207,42 @@ async function openCapture(dir, depth, allowFontFallback = false, options = {})
205
207
  const server = await startServer(dir, handlers);
206
208
  let browser;
207
209
  let page;
208
- let info;
209
210
  try {
210
211
  browser = await launch();
211
212
  page = await capturePage(browser, server.origin);
213
+ } catch (error) {
214
+ await browser?.close();
215
+ await server.close();
216
+ throw error;
217
+ }
218
+ const load = async () => {
212
219
  const modules = compileProject(readSources(dir));
213
220
  const fonts = fontFiles(dir);
214
221
  const packages = (await bundlePackages(dir)).code;
215
- info = await page.evaluate(
216
- ({ modules, fonts, packages, origin, depth, options }) => globalThis.higgsedit.load({ modules, fonts, packages, mediaBase: `${origin}/project`, depth, ...options, ...depth === 10 ? { hostFrames: `${origin}/__higgsedit/media` } : {} }),
222
+ const info = await page.evaluate(
223
+ ({ modules: modules2, fonts: fonts2, packages: packages2, origin, depth: depth2, options: options2 }) => globalThis.higgsedit.load({ modules: modules2, fonts: fonts2, packages: packages2, mediaBase: `${origin}/project`, depth: depth2, ...options2, ...depth2 === 10 ? { hostFrames: `${origin}/__higgsedit/media` } : {} }),
217
224
  { modules, fonts, packages, origin: server.origin, depth, options }
218
225
  );
226
+ return info.composition;
227
+ };
228
+ let composition;
229
+ try {
230
+ composition = await load();
219
231
  } catch (error) {
220
232
  for (const decoder of decoders.values()) decoder.close();
221
- try { await browser?.close(); } finally { await server.close(); }
233
+ await browser.close();
234
+ await server.close();
222
235
  throw error;
223
236
  }
224
- return {
237
+ const session = {
225
238
  page,
226
239
  browser,
227
240
  server,
228
- composition: info.composition,
229
- sourceFps: info.sourceFps ?? info.composition.fps,
241
+ composition,
242
+ async reload() {
243
+ session.composition = await load();
244
+ return session.composition;
245
+ },
230
246
  decoders,
231
247
  sink(onBody) {
232
248
  const id = String(++sinkId);
@@ -241,9 +257,11 @@ async function openCapture(dir, depth, allowFontFallback = false, options = {})
241
257
  },
242
258
  async close() {
243
259
  for (const d of decoders.values()) d.close();
244
- try { await browser.close(); } finally { await server.close(); }
260
+ await browser.close();
261
+ await server.close();
245
262
  }
246
263
  };
264
+ return session;
247
265
  }
248
266
  var api = (page) => ({
249
267
  png: (frame2) => page.evaluate((f) => globalThis.higgsedit.png(f), frame2),
@@ -269,9 +287,9 @@ var toFrame = (value, fps, fallback, sourceFps = fps) => {
269
287
  var FFMPEG_CODECS = { x264: "libx264", x265: "libx265", videotoolbox: "hevc_videotoolbox" };
270
288
  function videoArgs(opts, encoder) {
271
289
  const tags = ["-colorspace", "bt709", "-color_primaries", "bt709", "-color_trc", "bt709", "-color_range", "tv"];
272
- const quality = opts.spec?.video.bitrate !== undefined ? ["-b:v", String(opts.spec.video.bitrate)] : ["-crf", String(opts.crf ?? 18)];
290
+ const quality = opts.spec?.video.bitrate === void 0 ? ["-crf", String(opts.crf ?? 18)] : ["-b:v", String(opts.spec.video.bitrate)];
273
291
  if (encoder === "videotoolbox") {
274
- return ["-c:v", "hevc_videotoolbox", "-profile:v", opts.depth === 10 ? "main10" : "main", "-q:v", "70", "-tag:v", "hvc1", ...tags];
292
+ return ["-c:v", "hevc_videotoolbox", "-profile:v", opts.depth === 10 ? "main10" : "main", ...opts.spec?.video.bitrate === void 0 ? ["-q:v", "70"] : quality, "-tag:v", "hvc1", ...tags];
275
293
  }
276
294
  if (encoder === "x265") {
277
295
  return [
@@ -346,11 +364,10 @@ async function audioMix(session, dir, span) {
346
364
  if (audio.length) filters.push(`${audio.map((_, i) => `[a${i + 1}]`).join("")}amix=inputs=${audio.length}:normalize=0:duration=longest,apad[a]`);
347
365
  return { audio, inputs, filters };
348
366
  }
349
- var AUDIO_CODEC = ["-c:a", "aac", "-b:a", "192k"];
350
- function audioArgs(opts) {
367
+ var audioCodec = (opts) => {
351
368
  const audio = opts.spec?.audio;
352
- return audio ? ["-c:a", "aac", "-b:a", String(audio.bitrate ?? 192000), "-ar", String(audio.sampleRate), "-ac", String(audio.channels)] : AUDIO_CODEC;
353
- }
369
+ return ["-c:a", "aac", "-b:a", String(audio?.bitrate ?? 192e3), ...audio ? ["-ar", String(audio.sampleRate), "-ac", String(audio.channels)] : []];
370
+ };
354
371
  function cancelled() {
355
372
  const error = new Error("render cancelled");
356
373
  error.name = "RenderCancelledError";
@@ -365,8 +382,8 @@ function progress(opts, log, started, done, count) {
365
382
  }
366
383
  async function renderWith(session, dir, opts, log) {
367
384
  const { width, height, fps, frames: total } = session.composition;
368
- const first = Math.max(0, toFrame(opts.from, fps, 0, session.sourceFps));
369
- const last = Math.min(total, toFrame(opts.to, fps, total, session.sourceFps));
385
+ const first = Math.max(0, toFrame(opts.from, fps, 0, session.composition.sourceFps));
386
+ const last = Math.min(total, toFrame(opts.to, fps, total, session.composition.sourceFps));
370
387
  if (last <= first) throw new Error(`nothing to render between frame ${first} and ${last}`);
371
388
  const span = { first, last, count: last - first, t0: first / fps, duration: (last - first) / fps };
372
389
  const encoder = await pickEncoder(session, opts, log);
@@ -416,7 +433,7 @@ async function encodeWithFfmpeg(session, opts, codec, out, span, mix, log, start
416
433
  const pixFmt = opts.depth === 10 ? "rgbaf16le" : "rgba";
417
434
  const outFmt = opts.depth === 10 ? "yuv420p10le" : "yuv420p";
418
435
  const filters = [`[0:v]scale=out_color_matrix=bt709:out_range=limited:flags=accurate_rnd+full_chroma_int,format=${outFmt},setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709:range=tv[v]`, ...mix.filters];
419
- const maps = ["-map", "[v]", ...mix.audio.length ? ["-map", "[a]", ...audioArgs(opts)] : []];
436
+ const maps = ["-map", "[v]", ...mix.audio.length ? ["-map", "[a]", ...audioCodec(opts)] : []];
420
437
  const encoder = ffmpeg(
421
438
  [
422
439
  "-y",
@@ -491,7 +508,7 @@ async function encodeInPage(session, opts, out, span, mix, log, started) {
491
508
  const sink = session.sink(async (position, body) => {
492
509
  await file.write(body, 0, body.length, position);
493
510
  });
494
- await page.encodeStart({ url: sink, codec: opts.spec?.video.codec ?? opts.webcodecsCodec ?? "avc", ...opts.spec?.video.bitrate === undefined ? { quantizer: opts.crf ?? 18 } : {}, bitrate: opts.spec?.video.bitrate ?? fallbackBitrate(width, height, fps) });
511
+ await page.encodeStart({ url: sink, codec: opts.spec?.video.codec ?? opts.webcodecsCodec ?? "avc", ...opts.spec?.video.bitrate === void 0 ? { quantizer: opts.crf ?? 18 } : {}, bitrate: opts.spec?.video.bitrate ?? fallbackBitrate(width, height, fps) });
495
512
  for (let f = span.first; f < span.last; f++) {
496
513
  if (opts.signal?.aborted) {
497
514
  await page.encodeCancel();
@@ -504,16 +521,13 @@ async function encodeInPage(session, opts, out, span, mix, log, started) {
504
521
  progress(opts, log, started, f - span.first + 1, span.count);
505
522
  }
506
523
  ({ codec } = await page.encodeEnd());
507
- } catch (error) {
508
- await page.encodeCancel().catch(() => {});
509
- throw error;
510
524
  } finally {
511
525
  await file.close();
512
526
  }
513
527
  const hevc = !codec.startsWith("avc1");
514
528
  const retag = `${hevc ? "hevc" : "h264"}_metadata=colour_primaries=1`;
515
529
  const tag = hevc ? ["-tag:v", "hvc1"] : [];
516
- const audio = mix.audio.length ? ["-filter_complex", mix.filters.join(";"), "-map", "[a]", ...audioArgs(opts)] : [];
530
+ const audio = mix.audio.length ? ["-filter_complex", mix.filters.join(";"), "-map", "[a]", ...audioCodec(opts)] : [];
517
531
  const muxer = ffmpeg(["-y", "-i", video, ...mix.inputs, "-map", "0:v", "-c:v", "copy", "-bsf:v", retag, ...tag, "-color_primaries", "bt709", ...audio, "-t", span.duration.toFixed(6), "-movflags", "+faststart", out]);
518
532
  let stderr = "";
519
533
  muxer.stderr.on("data", (d) => stderr += d.toString());
@@ -589,8 +603,14 @@ async function verify(dir, count, depth, allowFontFallback = false) {
589
603
  }
590
604
 
591
605
  export {
606
+ FontLoadError,
607
+ openCapture,
608
+ api,
609
+ gainFilter,
610
+ rateFilter,
592
611
  render,
593
612
  frame,
594
613
  sheet,
614
+ shuffle,
595
615
  verify
596
616
  };