@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
@@ -1,75 +0,0 @@
1
- import { ffmpeg } from "./chunk-EKFC4S4M.mjs";
2
- import { parseTime } from "./chunk-F7YUKEI5.mjs";
3
-
4
- // This is the native renderer's contract; the iframe's encoders do not constrain it.
5
- const sampleRates = [44100, 48000, 96000];
6
- let capabilities;
7
- export function renderCapabilities() {
8
- capabilities ??= new Promise((resolve, reject) => {
9
- const child = ffmpeg(["-encoders"]);
10
- let output = "";
11
- child.stdout.on("data", (chunk) => output += chunk.toString());
12
- child.on("error", reject);
13
- child.on("close", (code) => {
14
- if (code !== 0) return reject(new Error("could not inspect native video encoders"));
15
- const has = (name) => new RegExp(`^\\s*[A-Z.]{6}\\s+${name}\\s`, "m").test(output);
16
- const videoCodecs = [...has("libx264") ? ["avc"] : [], ...has("libx265") ? ["hevc"] : []];
17
- resolve({ containers: videoCodecs.length ? ["mp4"] : [], videoCodecs, audioCodecs: has("aac") ? ["aac"] : [], sampleRates, audioOnly: false });
18
- });
19
- }).catch((error) => { capabilities = undefined; throw error; });
20
- return capabilities;
21
- }
22
-
23
- const object = (value, label) => {
24
- if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error(`${label} must be an object`);
25
- return value;
26
- };
27
- const number = (value, label, min, max, integer = false) => {
28
- if (typeof value !== "number" || !Number.isFinite(value) || value < min || value > max || integer && !Number.isInteger(value)) throw new Error(`${label} must be ${integer ? "an integer" : "a number"} between ${min} and ${max}`);
29
- return value;
30
- };
31
- const member = (value, allowed, label) => {
32
- if (!allowed.includes(value)) throw new Error(`unsupported ${label}: ${String(value)}`);
33
- return value;
34
- };
35
- export function validateRenderRequest(input, supported) {
36
- const body = object(input, "render request");
37
- const out = {};
38
- if (body.fileName !== undefined) {
39
- if (typeof body.fileName !== "string" || !body.fileName.trim() || body.fileName.length > 180 || /[\x00-\x1f]/.test(body.fileName)) throw new Error("fileName must be a nonempty filename of at most 180 characters");
40
- out.fileName = body.fileName;
41
- }
42
- if (body.sceneId !== undefined) {
43
- if (typeof body.sceneId !== "string" || !body.sceneId || body.sceneId.length > 1024) throw new Error("sceneId must be a nonempty scene identifier");
44
- out.sceneId = body.sceneId;
45
- }
46
- for (const key of ["from", "to"]) {
47
- if (body[key] === undefined) continue;
48
- const time = parseTime(body[key], 30);
49
- if (time === undefined || !Number.isFinite(time) || time < 0 || typeof body[key] === "string" && body[key].length > 64) throw new Error(`${key} must be a nonnegative time`);
50
- out[key] = body[key];
51
- }
52
- out.depth = body.depth === undefined ? 8 : member(body.depth, [8, 10], "bit depth");
53
- out.allowFontFallback = body.allowFontFallback === true;
54
- if (body.spec === undefined) return out;
55
- const spec = object(body.spec, "spec");
56
- const video = object(spec.video, "spec.video (audio-only export is unavailable)");
57
- const width = number(video.width, "video width", 2, 8192, true);
58
- const height = number(video.height, "video height", 2, 8192, true);
59
- if (width % 2 || height % 2 || width * height > 35389440) throw new Error("video dimensions must be even and no larger than 8K");
60
- const normalized = {
61
- container: member(spec.container, supported.containers, "container"),
62
- video: { width, height, fps: number(video.fps, "video fps", 1, 120), codec: member(video.codec, supported.videoCodecs, "video codec") },
63
- audio: null
64
- };
65
- if (video.bitrate !== undefined) normalized.video.bitrate = number(video.bitrate, "video bitrate", 1000, 1000000000, true);
66
- if (spec.audio !== null) {
67
- const audio = object(spec.audio, "spec.audio");
68
- normalized.audio = { codec: member(audio.codec, supported.audioCodecs, "audio codec"), sampleRate: member(audio.sampleRate, supported.sampleRates, "audio sample rate"), channels: member(audio.channels, [1, 2], "audio channels") };
69
- if (audio.bitrate !== undefined) normalized.audio.bitrate = number(audio.bitrate, "audio bitrate", 16000, 1024000, true);
70
- }
71
- // The explicit codec selects its native encoder. Legacy --depth still applies without a spec.
72
- out.depth = 8;
73
- out.spec = normalized;
74
- return out;
75
- }
@@ -1,295 +0,0 @@
1
- import { randomUUID } from "node:crypto";
2
- import { closeSync, constants, fstatSync, fsyncSync, lstatSync, mkdirSync, openSync, readFileSync, readSync, renameSync, unlinkSync, writeFileSync } from "node:fs";
3
- import { join } from "node:path";
4
- const MAX_BYTES = 16 * 1024 * 1024;
5
- const MAX_ENTRIES = 100;
6
- const STALE = "edit history changed in another editor; reopen the project before editing or undoing";
7
- const message = (error) => error instanceof Error ? error.message : String(error);
8
- const missing = (error) => error instanceof Error && "code" in error && error.code === "ENOENT";
9
- const record = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
10
- const safePath = (path) => !/[\\\0]/.test(path) && path.split("/").every((part) => part !== "" && part !== "." && part !== ".." && part !== ".higgsedit-cache") && !/^[A-Za-z]:/.test(path);
11
- const identity = (stat) => `${stat.dev}:${stat.ino}:${stat.size}:${stat.mtimeNs}:${stat.ctimeNs}`;
12
- function encode(undo, redo, revision, text = (entry) => JSON.stringify(entryValue(entry))) {
13
- return `{"version":1,"revision":${JSON.stringify(revision)},"undo":[${undo.map(text).join(",")}],"redo":[${redo.map(text).join(",")}]}`;
14
- }
15
- const entryValue = ({ name, files }) => ({ name, files: [...files].map(([path, texts]) => ({ path, ...texts })) });
16
- function decode(text) {
17
- let value;
18
- try {
19
- value = JSON.parse(text);
20
- } catch {
21
- return;
22
- }
23
- if (!record(value) || value.version !== 1 || typeof value.revision !== "string" || !Array.isArray(value.undo) || !Array.isArray(value.redo) || value.undo.length + value.redo.length > MAX_ENTRIES) return;
24
- const entries = (stack) => {
25
- const result = [];
26
- for (const entry of stack) {
27
- if (!record(entry) || typeof entry.name !== "string" || !Array.isArray(entry.files) || !entry.files.length) return;
28
- const files = /* @__PURE__ */ new Map();
29
- for (const file of entry.files) {
30
- if (!record(file) || typeof file.path !== "string" || !safePath(file.path) || typeof file.before !== "string" || typeof file.after !== "string" || files.has(file.path)) return;
31
- files.set(file.path, { before: file.before, after: file.after });
32
- }
33
- result.push({ name: entry.name, files });
34
- }
35
- return result;
36
- };
37
- const undo = entries(value.undo), redo = entries(value.redo);
38
- return undo && redo ? { undo, redo } : void 0;
39
- }
40
- class EditHistory {
41
- constructor(dir, onWrite, limits = {}) {
42
- this.dir = dir;
43
- this.onWrite = onWrite;
44
- this.maxBytes = Math.min(MAX_BYTES, limits.maxBytes ?? MAX_BYTES);
45
- this.maxEntries = Math.min(MAX_ENTRIES, limits.maxEntries ?? MAX_ENTRIES);
46
- if (!Number.isSafeInteger(this.maxBytes) || this.maxBytes < 100 || !Number.isSafeInteger(this.maxEntries) || this.maxEntries < 1) throw new Error("invalid edit history limits");
47
- try {
48
- const saved = this.readJournal();
49
- this.revision = saved.revision;
50
- const parsed = saved.text === void 0 ? void 0 : decode(saved.text);
51
- if (parsed) {
52
- const bounded = this.bound(parsed.undo, parsed.redo);
53
- this.undoStack = bounded.undo;
54
- this.redoStack = bounded.redo;
55
- }
56
- } catch {
57
- }
58
- }
59
- dir;
60
- onWrite;
61
- undoStack = [];
62
- redoStack = [];
63
- revision = "missing";
64
- maxBytes;
65
- maxEntries;
66
- // Committed entries never change. Weak keys release evicted history and abandoned transactions.
67
- encoded = /* @__PURE__ */ new WeakMap();
68
- begin(name) {
69
- if (typeof name !== "string") throw new Error("edit history name must be a string");
70
- this.assertCurrent();
71
- const entry = { name, files: /* @__PURE__ */ new Map() };
72
- const previousWrites = /* @__PURE__ */ new Map();
73
- const fileBytes = /* @__PURE__ */ new Map();
74
- let entryBytes = Buffer.byteLength(encode([entry], [], randomUUID()));
75
- let finished = false;
76
- return {
77
- onWrite: (path, text) => {
78
- if (finished) throw new Error("edit history transaction already finished");
79
- const prior = entry.files.get(path);
80
- const current = this.readSource(path);
81
- if (prior && current !== prior.after) throw new Error(`${path} changed outside the editor since ${entry.name}`);
82
- const texts = { before: prior?.before ?? current, after: text };
83
- const bytes = Buffer.byteLength(JSON.stringify({ path, ...texts }));
84
- const nextBytes = entryBytes - (fileBytes.get(path) ?? 0) + bytes + (!prior && entry.files.size ? 1 : 0);
85
- if (nextBytes > this.maxBytes) throw new Error(`edit history size limit exceeded (${this.maxBytes} bytes); split the edit or reduce the affected source files`);
86
- entryBytes = nextBytes;
87
- fileBytes.set(path, bytes);
88
- previousWrites.set(path, current);
89
- entry.files.set(path, texts);
90
- this.encoded.delete(entry);
91
- this.onWrite?.(path, text);
92
- },
93
- commit: () => {
94
- if (finished) throw new Error("edit history transaction already finished");
95
- if (entry.files.size) {
96
- this.checkSources(entry, "after");
97
- this.publish([...this.undoStack, entry], []);
98
- }
99
- finished = true;
100
- },
101
- rollback: () => {
102
- if (finished) return;
103
- this.restore(entry, "after", "before", previousWrites);
104
- finished = true;
105
- }
106
- };
107
- }
108
- state() {
109
- return {
110
- canUndo: this.undoStack.length > 0,
111
- canRedo: this.redoStack.length > 0,
112
- undoName: this.undoStack.at(-1)?.name ?? null,
113
- redoName: this.redoStack.at(-1)?.name ?? null
114
- };
115
- }
116
- undo() {
117
- return this.step(this.undoStack, this.redoStack, "after", "before");
118
- }
119
- redo() {
120
- return this.step(this.redoStack, this.undoStack, "before", "after");
121
- }
122
- step(from, to, expect, write) {
123
- const entry = from.at(-1);
124
- if (!entry) return { ok: false, reason: `nothing to ${write === "before" ? "undo" : "redo"}` };
125
- try {
126
- this.assertCurrent();
127
- this.checkSources(entry, expect);
128
- } catch (error) {
129
- return { ok: false, reason: message(error) };
130
- }
131
- try {
132
- for (const [path, texts] of entry.files) this.write(path, texts[write]);
133
- const remaining = from.slice(0, -1), moved = [...to, entry];
134
- this.publish(write === "before" ? remaining : moved, write === "before" ? moved : remaining);
135
- } catch (error) {
136
- try {
137
- this.restore(entry, write, expect);
138
- } catch (rollbackError) {
139
- return { ok: false, reason: `${message(error)}; rollback failed: ${message(rollbackError)}` };
140
- }
141
- return { ok: false, reason: message(error) };
142
- }
143
- return { ok: true, written: [...entry.files.keys()] };
144
- }
145
- checkSources(entry, expect) {
146
- for (const [path, texts] of entry.files) {
147
- if (this.readSource(path) !== texts[expect]) throw new Error(`${path} changed outside the editor since ${entry.name}`);
148
- }
149
- }
150
- /** A failed write may still contain the original text. Never roll back someone else's version. */
151
- restore(entry, expect, restore, previousWrites) {
152
- const pending = [];
153
- for (const [path, texts] of entry.files) {
154
- const current = this.readSource(path);
155
- if (current === texts[restore]) continue;
156
- if (current !== texts[expect] && current !== previousWrites?.get(path)) throw new Error(`${path} changed outside the editor since ${entry.name}`);
157
- pending.push([path, texts[restore]]);
158
- }
159
- for (const [path, text] of pending) this.write(path, text);
160
- }
161
- readSource(path) {
162
- if (!safePath(path)) throw new Error("unsafe edit history source path");
163
- let target = this.dir;
164
- for (const part of path.split("/")) {
165
- target = join(target, part);
166
- try {
167
- if (lstatSync(target).isSymbolicLink()) throw new Error(`${path} is a symlink; cannot restore edit history`);
168
- } catch (error) {
169
- if (missing(error)) throw new Error(`${path} no longer exists`, { cause: error });
170
- throw error;
171
- }
172
- }
173
- return readFileSync(target, "utf8");
174
- }
175
- write(path, text) {
176
- const target = join(this.dir, path);
177
- this.onWrite?.(path, text);
178
- this.atomicWrite(target, text, lstatSync(target).mode & 511);
179
- }
180
- cacheDir() {
181
- const cache = join(this.dir, ".higgsedit-cache");
182
- try {
183
- const stat = lstatSync(cache);
184
- if (!stat.isDirectory() || stat.isSymbolicLink()) throw new Error("unsafe edit history cache directory");
185
- } catch (error) {
186
- if (!missing(error)) throw error;
187
- }
188
- return cache;
189
- }
190
- readJournal() {
191
- const file = join(this.cacheDir(), "history.json");
192
- let fd;
193
- try {
194
- if (!lstatSync(file).isFile()) throw new Error("edit history journal is not a regular file");
195
- fd = openSync(file, constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK);
196
- } catch (error) {
197
- if (missing(error)) return { revision: "missing" };
198
- throw new Error(`cannot read edit history: ${message(error)}`, { cause: error });
199
- }
200
- try {
201
- const stat = fstatSync(fd, { bigint: true });
202
- if (!stat.isFile()) throw new Error("edit history journal is not a regular file");
203
- const revision = identity(stat);
204
- if (stat.size > BigInt(this.maxBytes)) return { revision };
205
- const bytes = Buffer.alloc(Number(stat.size) + 1);
206
- let length = 0, count = 0;
207
- do {
208
- count = readSync(fd, bytes, length, bytes.length - length, null);
209
- length += count;
210
- } while (count && length < bytes.length);
211
- if (BigInt(length) !== stat.size || identity(fstatSync(fd, { bigint: true })) !== revision) throw new Error("edit history changed while reading");
212
- const data = bytes.subarray(0, length);
213
- return { revision, text: data.toString("utf8") };
214
- } finally {
215
- closeSync(fd);
216
- }
217
- }
218
- assertCurrent() {
219
- let revision;
220
- try {
221
- const stat = lstatSync(join(this.cacheDir(), "history.json"), { bigint: true });
222
- if (!stat.isFile()) throw new Error("edit history journal is not a regular file");
223
- revision = identity(stat);
224
- } catch (error) {
225
- if (!missing(error)) throw error;
226
- revision = "missing";
227
- }
228
- if (revision !== this.revision) throw new Error(STALE);
229
- }
230
- serialized(entry) {
231
- let saved = this.encoded.get(entry);
232
- if (!saved) {
233
- const text = JSON.stringify(entryValue(entry));
234
- saved = { text, bytes: Buffer.byteLength(text) };
235
- this.encoded.set(entry, saved);
236
- }
237
- return saved;
238
- }
239
- bound(undo, redo) {
240
- const revision = randomUUID();
241
- const sized = (stack) => stack.map((entry) => ({ entry, bytes: this.serialized(entry).bytes }));
242
- const keepUndo = sized(undo), keepRedo = sized(redo);
243
- let bytes = Buffer.byteLength(encode([], [], revision)) + [...keepUndo, ...keepRedo].reduce((sum, entry) => sum + entry.bytes, 0);
244
- const separators = () => Math.max(0, keepUndo.length - 1) + Math.max(0, keepRedo.length - 1);
245
- while (keepUndo.length + keepRedo.length > this.maxEntries || bytes + separators() > this.maxBytes) {
246
- const removed = keepUndo.length > 1 || !keepRedo.length ? keepUndo.shift() : keepRedo.shift();
247
- if (!removed) throw new Error("edit history size limit exceeded");
248
- bytes -= removed.bytes;
249
- }
250
- undo = keepUndo.map(({ entry }) => entry);
251
- redo = keepRedo.map(({ entry }) => entry);
252
- return { undo, redo, text: encode(undo, redo, revision, (entry) => this.serialized(entry).text) };
253
- }
254
- publish(undo, redo) {
255
- const next = this.bound(undo, redo);
256
- this.assertCurrent();
257
- const cache = this.cacheDir();
258
- mkdirSync(cache, { recursive: true, mode: 448 });
259
- const target = join(cache, "history.json");
260
- try {
261
- this.revision = this.atomicWrite(target, next.text, 384);
262
- } catch (error) {
263
- throw new Error(`cannot save edit history: ${message(error)}`, { cause: error });
264
- }
265
- this.undoStack = next.undo;
266
- this.redoStack = next.redo;
267
- }
268
- atomicWrite(target, text, mode) {
269
- const tmp = `${target}.higgsedit-${process.pid}-${randomUUID()}.tmp`;
270
- let published = false;
271
- let fd;
272
- try {
273
- fd = openSync(tmp, "wx", mode);
274
- writeFileSync(fd, text);
275
- fsyncSync(fd);
276
- renameSync(tmp, target);
277
- published = true;
278
- return identity(fstatSync(fd, { bigint: true }));
279
- } finally {
280
- try {
281
- if (fd !== void 0) closeSync(fd);
282
- } finally {
283
- if (!published) {
284
- try {
285
- unlinkSync(tmp);
286
- } catch {
287
- }
288
- }
289
- }
290
- }
291
- }
292
- }
293
- export {
294
- EditHistory
295
- };