fundus 0.0.2 → 0.0.3

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 (300) hide show
  1. package/README.md +58 -0
  2. package/build/client/_app/immutable/assets/0.DLhIsYA_.css.br +0 -0
  3. package/build/client/_app/immutable/assets/0.DLhIsYA_.css.gz +0 -0
  4. package/build/client/_app/immutable/assets/2.wavcNhPC.css +1 -0
  5. package/build/client/_app/immutable/assets/2.wavcNhPC.css.br +0 -0
  6. package/build/client/_app/immutable/assets/2.wavcNhPC.css.gz +0 -0
  7. package/build/client/_app/immutable/assets/3.Cjh_fXPY.css +1 -0
  8. package/build/client/_app/immutable/assets/3.Cjh_fXPY.css.br +0 -0
  9. package/build/client/_app/immutable/assets/3.Cjh_fXPY.css.gz +0 -0
  10. package/build/client/_app/immutable/assets/4.p004hmEN.css +1 -0
  11. package/build/client/_app/immutable/assets/4.p004hmEN.css.br +0 -0
  12. package/build/client/_app/immutable/assets/4.p004hmEN.css.gz +0 -0
  13. package/build/client/_app/immutable/assets/ConfirmDialog.BdKlitwi.css +1 -0
  14. package/build/client/_app/immutable/assets/ConfirmDialog.BdKlitwi.css.br +0 -0
  15. package/build/client/_app/immutable/assets/ConfirmDialog.BdKlitwi.css.gz +0 -0
  16. package/build/client/_app/immutable/assets/LibraryContextMenu.zyZtpKzC.css +1 -0
  17. package/build/client/_app/immutable/assets/LibraryContextMenu.zyZtpKzC.css.br +0 -0
  18. package/build/client/_app/immutable/assets/LibraryContextMenu.zyZtpKzC.css.gz +0 -0
  19. package/build/client/_app/immutable/chunks/BiIto6ft.js +1 -0
  20. package/build/client/_app/immutable/chunks/BiIto6ft.js.br +0 -0
  21. package/build/client/_app/immutable/chunks/BiIto6ft.js.gz +0 -0
  22. package/build/client/_app/immutable/chunks/Bjy-W4x2.js.br +0 -0
  23. package/build/client/_app/immutable/chunks/Bjy-W4x2.js.gz +0 -0
  24. package/build/client/_app/immutable/chunks/CNRz3sSw.js.br +0 -0
  25. package/build/client/_app/immutable/chunks/CNRz3sSw.js.gz +0 -0
  26. package/build/client/_app/immutable/chunks/CO4RBJfa.js.br +0 -0
  27. package/build/client/_app/immutable/chunks/CO4RBJfa.js.gz +0 -0
  28. package/{dist/editor/_app/immutable/chunks/DjvOiDmq.js → build/client/_app/immutable/chunks/CvY6YsFE.js} +1 -1
  29. package/build/client/_app/immutable/chunks/CvY6YsFE.js.br +0 -0
  30. package/build/client/_app/immutable/chunks/CvY6YsFE.js.gz +0 -0
  31. package/build/client/_app/immutable/chunks/DL0_39Ys.js +5 -0
  32. package/build/client/_app/immutable/chunks/DL0_39Ys.js.br +0 -0
  33. package/build/client/_app/immutable/chunks/DL0_39Ys.js.gz +0 -0
  34. package/{dist/editor/_app/immutable/chunks/BfPE5wdt.js → build/client/_app/immutable/chunks/DQ8SXFaX.js} +1 -1
  35. package/build/client/_app/immutable/chunks/DQ8SXFaX.js.br +0 -0
  36. package/build/client/_app/immutable/chunks/DQ8SXFaX.js.gz +0 -0
  37. package/build/client/_app/immutable/chunks/DjdrdRzT.js.br +0 -0
  38. package/build/client/_app/immutable/chunks/DjdrdRzT.js.gz +0 -0
  39. package/build/client/_app/immutable/chunks/xihTtKlq.js.br +1 -0
  40. package/build/client/_app/immutable/chunks/xihTtKlq.js.gz +0 -0
  41. package/{dist/editor/_app/immutable/entry/app.BkqbfI8n.js → build/client/_app/immutable/entry/app.ubN0v9bN.js} +2 -2
  42. package/build/client/_app/immutable/entry/app.ubN0v9bN.js.br +0 -0
  43. package/build/client/_app/immutable/entry/app.ubN0v9bN.js.gz +0 -0
  44. package/build/client/_app/immutable/entry/start.BW8dBDh6.js +1 -0
  45. package/build/client/_app/immutable/entry/start.BW8dBDh6.js.br +0 -0
  46. package/build/client/_app/immutable/entry/start.BW8dBDh6.js.gz +0 -0
  47. package/{dist/editor/_app/immutable/nodes/0.xdMI5GEU.js → build/client/_app/immutable/nodes/0.Dr5ijCIl.js} +1 -1
  48. package/build/client/_app/immutable/nodes/0.Dr5ijCIl.js.br +0 -0
  49. package/build/client/_app/immutable/nodes/0.Dr5ijCIl.js.gz +0 -0
  50. package/{dist/editor/_app/immutable/nodes/1.D9p2tfoJ.js → build/client/_app/immutable/nodes/1.DiIGIRAb.js} +1 -1
  51. package/build/client/_app/immutable/nodes/1.DiIGIRAb.js.br +3 -0
  52. package/build/client/_app/immutable/nodes/1.DiIGIRAb.js.gz +0 -0
  53. package/{dist/editor/_app/immutable/nodes/2.BrA0Hyzu.js → build/client/_app/immutable/nodes/2.B8KYmQcV.js} +3 -3
  54. package/build/client/_app/immutable/nodes/2.B8KYmQcV.js.br +0 -0
  55. package/build/client/_app/immutable/nodes/2.B8KYmQcV.js.gz +0 -0
  56. package/build/client/_app/immutable/nodes/3.B1jc7arT.js +104 -0
  57. package/build/client/_app/immutable/nodes/3.B1jc7arT.js.br +0 -0
  58. package/build/client/_app/immutable/nodes/3.B1jc7arT.js.gz +0 -0
  59. package/build/client/_app/immutable/nodes/4.BPK9n1mH.js +2 -0
  60. package/build/client/_app/immutable/nodes/4.BPK9n1mH.js.br +0 -0
  61. package/build/client/_app/immutable/nodes/4.BPK9n1mH.js.gz +0 -0
  62. package/build/client/_app/version.json +1 -0
  63. package/build/client/_app/version.json.br +0 -0
  64. package/build/client/_app/version.json.gz +0 -0
  65. package/build/env.js +100 -0
  66. package/build/env.js.map +1 -0
  67. package/build/handler.js +22 -0
  68. package/build/handler.js.map +1 -0
  69. package/build/index.js +145 -0
  70. package/build/index.js.map +1 -0
  71. package/build/server/chunks/chunks/context.js-Bw4WWLhG.js +443 -0
  72. package/build/server/chunks/chunks/context.js-Bw4WWLhG.js.map +1 -0
  73. package/build/server/chunks/chunks/core.js-DDntpb72.js +409 -0
  74. package/build/server/chunks/chunks/core.js-DDntpb72.js.map +1 -0
  75. package/build/server/chunks/chunks/env.js-l0sNRNKZ.js +2 -0
  76. package/build/server/chunks/chunks/env.js-l0sNRNKZ.js.map +1 -0
  77. package/build/server/chunks/chunks/exports.js-CLTzaOxn.js +152 -0
  78. package/build/server/chunks/chunks/exports.js-CLTzaOxn.js.map +1 -0
  79. package/build/server/chunks/chunks/folder-path.js-ytx9ucgg.js +64 -0
  80. package/build/server/chunks/chunks/folder-path.js-ytx9ucgg.js.map +1 -0
  81. package/build/server/chunks/chunks/http.js-Dxoa-jtP.js +100 -0
  82. package/build/server/chunks/chunks/http.js-Dxoa-jtP.js.map +1 -0
  83. package/build/server/chunks/chunks/internal.js-BDBSzJId.js +5753 -0
  84. package/build/server/chunks/chunks/internal.js-BDBSzJId.js.map +1 -0
  85. package/build/server/chunks/chunks/internal2.js-BlXt2rfE.js +22 -0
  86. package/build/server/chunks/chunks/internal2.js-BlXt2rfE.js.map +1 -0
  87. package/{dist/operations-DYM-5KVl.js → build/server/chunks/chunks/library-store.js-BP8cL-qD.js} +344 -444
  88. package/build/server/chunks/chunks/library-store.js-BP8cL-qD.js.map +1 -0
  89. package/build/server/chunks/chunks/manifest-appearance.js-DTk355LQ.js +146 -0
  90. package/build/server/chunks/chunks/manifest-appearance.js-DTk355LQ.js.map +1 -0
  91. package/build/server/chunks/chunks/routing.js-y-tryuip.js +213 -0
  92. package/build/server/chunks/chunks/routing.js-y-tryuip.js.map +1 -0
  93. package/build/server/chunks/chunks/shared.js-BWXgl1Xf.js +255 -0
  94. package/build/server/chunks/chunks/shared.js-BWXgl1Xf.js.map +1 -0
  95. package/build/server/chunks/chunks/utils.js-9oI5Oz0w.js +1048 -0
  96. package/build/server/chunks/chunks/utils.js-9oI5Oz0w.js.map +1 -0
  97. package/build/server/chunks/entries/endpoints/api/_...path_/_server.ts.js-WknZVW_S.js +27 -0
  98. package/build/server/chunks/entries/endpoints/api/_...path_/_server.ts.js-WknZVW_S.js.map +1 -0
  99. package/build/server/chunks/entries/endpoints/api/assets/_id_/_server.ts.js-BrZ__-HZ.js +24 -0
  100. package/build/server/chunks/entries/endpoints/api/assets/_id_/_server.ts.js-BrZ__-HZ.js.map +1 -0
  101. package/build/server/chunks/entries/endpoints/api/assets/_server.ts.js-PqADGPXc.js +45 -0
  102. package/build/server/chunks/entries/endpoints/api/assets/_server.ts.js-PqADGPXc.js.map +1 -0
  103. package/build/server/chunks/entries/endpoints/api/assets/delete/_server.ts.js-OqoE5PN-.js +31 -0
  104. package/build/server/chunks/entries/endpoints/api/assets/delete/_server.ts.js-OqoE5PN-.js.map +1 -0
  105. package/build/server/chunks/entries/endpoints/api/assets/move/_server.ts.js-CJ08e1ho.js +31 -0
  106. package/build/server/chunks/entries/endpoints/api/assets/move/_server.ts.js-CJ08e1ho.js.map +1 -0
  107. package/build/server/chunks/entries/endpoints/api/folders/_path_/_server.ts.js-DdF3eK2I.js +38 -0
  108. package/build/server/chunks/entries/endpoints/api/folders/_path_/_server.ts.js-DdF3eK2I.js.map +1 -0
  109. package/build/server/chunks/entries/endpoints/api/folders/_server.ts.js-Cxt6jsJ5.js +31 -0
  110. package/build/server/chunks/entries/endpoints/api/folders/_server.ts.js-Cxt6jsJ5.js.map +1 -0
  111. package/build/server/chunks/entries/endpoints/api/manifests/_name_/_server.ts.js-BWVM2Ntl.js +24 -0
  112. package/build/server/chunks/entries/endpoints/api/manifests/_name_/_server.ts.js-BWVM2Ntl.js.map +1 -0
  113. package/build/server/chunks/entries/endpoints/api/manifests/_server.ts.js-Z2bM-qHM.js +31 -0
  114. package/build/server/chunks/entries/endpoints/api/manifests/_server.ts.js-Z2bM-qHM.js.map +1 -0
  115. package/build/server/chunks/entries/endpoints/api/state/_server.ts.js-BX9H2Z34.js +24 -0
  116. package/build/server/chunks/entries/endpoints/api/state/_server.ts.js-BX9H2Z34.js.map +1 -0
  117. package/build/server/chunks/entries/endpoints/files/_...path_/_server.ts.js-BWHDZ8mz.js +27 -0
  118. package/build/server/chunks/entries/endpoints/files/_...path_/_server.ts.js-BWHDZ8mz.js.map +1 -0
  119. package/build/server/chunks/entries/endpoints/files/proxy/_...path_/_server.ts.js-CR_7mndO.js +24 -0
  120. package/build/server/chunks/entries/endpoints/files/proxy/_...path_/_server.ts.js-CR_7mndO.js.map +1 -0
  121. package/build/server/chunks/entries/endpoints/files/raw/_...path_/_server.ts.js-Cw1PDBvb.js +24 -0
  122. package/build/server/chunks/entries/endpoints/files/raw/_...path_/_server.ts.js-Cw1PDBvb.js.map +1 -0
  123. package/build/server/chunks/entries/hooks.server.js-BHoE0yBi.js +23 -0
  124. package/build/server/chunks/entries/hooks.server.js-BHoE0yBi.js.map +1 -0
  125. package/build/server/chunks/handler-10cx4zHn.js +1475 -0
  126. package/build/server/chunks/handler-10cx4zHn.js.map +1 -0
  127. package/build/server/chunks/index.js-DvPfiC00.js +3789 -0
  128. package/build/server/chunks/index.js-DvPfiC00.js.map +1 -0
  129. package/build/server/chunks/manifest.js-DoPjUnzD.js +149 -0
  130. package/build/server/chunks/manifest.js-DoPjUnzD.js.map +1 -0
  131. package/build/server/chunks/nodes/0.js-Di3qgAtW.js +11 -0
  132. package/build/server/chunks/nodes/0.js-Di3qgAtW.js.map +1 -0
  133. package/build/server/chunks/nodes/1.js-BlWSFIA8.js +7 -0
  134. package/build/server/chunks/nodes/1.js-BlWSFIA8.js.map +1 -0
  135. package/build/server/chunks/nodes/2.js-CO9nSPUN.js +7 -0
  136. package/build/server/chunks/nodes/2.js-CO9nSPUN.js.map +1 -0
  137. package/build/server/chunks/nodes/3.js-C2D6xpEO.js +7 -0
  138. package/build/server/chunks/nodes/3.js-C2D6xpEO.js.map +1 -0
  139. package/build/server/chunks/nodes/4.js-B3IuagJW.js +7 -0
  140. package/build/server/chunks/nodes/4.js-B3IuagJW.js.map +1 -0
  141. package/build/shims.js +33 -0
  142. package/build/shims.js.map +1 -0
  143. package/dist/cli.d.ts +2 -1
  144. package/dist/cli.js +109 -1332
  145. package/dist/config.d.ts +3 -2
  146. package/dist/config.js +2 -2
  147. package/dist/core/api-types.d.ts +141 -0
  148. package/dist/core/api-types.js +1 -0
  149. package/dist/core/asset-id.d.ts +28 -0
  150. package/dist/core/asset-id.js +59 -0
  151. package/dist/core/asset-reference.d.ts +23 -0
  152. package/dist/core/asset-reference.js +15 -0
  153. package/dist/core/canonicalize.d.ts +9 -0
  154. package/dist/core/canonicalize.js +36 -0
  155. package/dist/core/chroma-key.d.ts +30 -0
  156. package/dist/core/chroma-key.js +55 -0
  157. package/dist/core/config.d.ts +35 -0
  158. package/dist/core/config.js +4 -0
  159. package/dist/core/folder-path.d.ts +19 -0
  160. package/dist/core/folder-path.js +86 -0
  161. package/dist/core/index.d.ts +33 -499
  162. package/dist/core/index.js +17 -962
  163. package/dist/core/ingest.d.ts +18 -0
  164. package/dist/core/ingest.js +58 -0
  165. package/dist/core/library.d.ts +54 -0
  166. package/dist/core/library.js +138 -0
  167. package/dist/core/manifest-appearance.d.ts +35 -0
  168. package/dist/core/manifest-appearance.js +123 -0
  169. package/dist/core/manifest-entry.d.ts +104 -0
  170. package/dist/core/manifest-entry.js +1 -0
  171. package/dist/core/manifest-membership.d.ts +56 -0
  172. package/dist/core/manifest-membership.js +54 -0
  173. package/dist/core/plugins/audio.d.ts +26 -0
  174. package/dist/core/plugins/audio.js +44 -0
  175. package/dist/core/plugins/chroma-key-video.d.ts +29 -0
  176. package/dist/core/plugins/chroma-key-video.js +69 -0
  177. package/dist/core/plugins/contract.d.ts +35 -0
  178. package/dist/core/plugins/contract.js +1 -0
  179. package/dist/core/plugins/image.d.ts +30 -0
  180. package/dist/core/plugins/image.js +45 -0
  181. package/dist/core/plugins/slice.d.ts +22 -0
  182. package/dist/core/plugins/slice.js +60 -0
  183. package/dist/core/plugins/video.d.ts +45 -0
  184. package/dist/core/plugins/video.js +77 -0
  185. package/dist/core/reference-graph.d.ts +41 -0
  186. package/dist/core/reference-graph.js +138 -0
  187. package/dist/core/slice-data.d.ts +61 -0
  188. package/dist/core/slice-data.js +49 -0
  189. package/dist/runtime/chroma-key-gl.d.ts +40 -22
  190. package/dist/runtime/chroma-key-gl.js +189 -183
  191. package/dist/runtime/components/ChromaKeyVideo.svelte +3 -3
  192. package/dist/runtime/components/ChromaKeyVideo.svelte.d.ts +21 -0
  193. package/dist/runtime/components/Image.svelte +1 -1
  194. package/dist/runtime/components/Image.svelte.d.ts +9 -0
  195. package/dist/runtime/components/Slice.svelte +1 -1
  196. package/dist/runtime/components/Slice.svelte.d.ts +19 -0
  197. package/dist/runtime/components/SliceCanvas.svelte +3 -3
  198. package/dist/runtime/components/SliceCanvas.svelte.d.ts +10 -0
  199. package/dist/runtime/components/SliceDom.svelte +3 -3
  200. package/dist/runtime/components/SliceDom.svelte.d.ts +10 -0
  201. package/dist/runtime/components/Video.svelte +2 -2
  202. package/dist/runtime/components/Video.svelte.d.ts +18 -0
  203. package/dist/runtime/geometry.d.ts +55 -35
  204. package/dist/runtime/geometry.js +186 -191
  205. package/dist/runtime/index.d.ts +9 -9
  206. package/dist/runtime/index.js +9 -9
  207. package/dist/runtime/kind-handlers.d.ts +33 -24
  208. package/dist/runtime/kind-handlers.js +74 -65
  209. package/dist/runtime/manifest.d.ts +53 -47
  210. package/dist/runtime/manifest.js +133 -113
  211. package/dist/runtime/observe-border-box-size.d.ts +1 -4
  212. package/dist/runtime/observe-border-box-size.js +9 -10
  213. package/dist/runtime/preload-registry.d.ts +22 -8
  214. package/dist/runtime/preload-registry.js +65 -62
  215. package/dist/server/build.d.ts +8 -0
  216. package/dist/server/build.js +25 -0
  217. package/dist/server/check.d.ts +24 -0
  218. package/dist/server/check.js +199 -0
  219. package/dist/server/cli-commands.d.ts +25 -0
  220. package/dist/server/cli-commands.js +1178 -0
  221. package/dist/server/cli-init.d.ts +3 -0
  222. package/dist/server/cli-init.js +53 -0
  223. package/dist/server/cli-io.d.ts +46 -0
  224. package/dist/server/cli-io.js +105 -0
  225. package/dist/server/codegen.d.ts +58 -0
  226. package/dist/server/codegen.js +185 -0
  227. package/dist/server/config-loader.d.ts +34 -0
  228. package/dist/server/config-loader.js +103 -0
  229. package/dist/server/context.d.ts +8 -0
  230. package/dist/server/context.js +19 -0
  231. package/dist/server/folder-filesystem.d.ts +7 -0
  232. package/dist/server/folder-filesystem.js +39 -0
  233. package/dist/server/http.d.ts +12 -0
  234. package/dist/server/http.js +100 -0
  235. package/dist/server/index.d.ts +16 -0
  236. package/dist/server/index.js +9 -0
  237. package/dist/server/job-hash.d.ts +10 -0
  238. package/dist/server/job-hash.js +23 -0
  239. package/dist/server/library-store.d.ts +82 -0
  240. package/dist/server/library-store.js +763 -0
  241. package/dist/server/operations.d.ts +87 -0
  242. package/dist/server/operations.js +427 -0
  243. package/dist/server/plugins/audio.d.ts +7 -0
  244. package/dist/server/plugins/audio.js +27 -0
  245. package/dist/server/plugins/chroma-key-video.d.ts +9 -0
  246. package/dist/server/plugins/chroma-key-video.js +38 -0
  247. package/dist/server/plugins/contract.d.ts +100 -0
  248. package/dist/server/plugins/contract.js +16 -0
  249. package/dist/server/plugins/image.d.ts +8 -0
  250. package/dist/server/plugins/image.js +30 -0
  251. package/dist/server/plugins/slice.d.ts +14 -0
  252. package/dist/server/plugins/slice.js +63 -0
  253. package/dist/server/plugins/video.d.ts +6 -0
  254. package/dist/server/plugins/video.js +29 -0
  255. package/dist/server/plugins.d.ts +23 -0
  256. package/dist/server/plugins.js +33 -0
  257. package/dist/server/processing/audio-processing.d.ts +17 -0
  258. package/dist/server/processing/audio-processing.js +46 -0
  259. package/dist/server/processing/ffmpeg.d.ts +9 -0
  260. package/dist/server/processing/ffmpeg.js +50 -0
  261. package/dist/server/processing/image-processing.d.ts +16 -0
  262. package/dist/server/processing/image-processing.js +26 -0
  263. package/dist/server/processing/media-probe.d.ts +15 -0
  264. package/dist/server/processing/media-probe.js +27 -0
  265. package/dist/server/processing/processor.d.ts +50 -0
  266. package/dist/server/processing/processor.js +158 -0
  267. package/dist/server/processing/video-processing.d.ts +35 -0
  268. package/dist/server/processing/video-processing.js +87 -0
  269. package/dist/server/server.d.ts +13 -0
  270. package/dist/server/server.js +57 -0
  271. package/dist/server/start.d.ts +1 -0
  272. package/dist/server/start.js +33 -0
  273. package/package.json +29 -16
  274. package/dist/build-CZYFLLvl.js +0 -191
  275. package/dist/core/image-Dqmz8FXS.js +0 -54
  276. package/dist/core/reference-graph-CjuHbLDw.d.ts +0 -280
  277. package/dist/core/testing.d.ts +0 -27
  278. package/dist/core/testing.js +0 -80
  279. package/dist/editor/200.html +0 -37
  280. package/dist/editor/_app/immutable/assets/2.DIbbW7U1.css +0 -1
  281. package/dist/editor/_app/immutable/assets/3.C-9vFQ9A.css +0 -1
  282. package/dist/editor/_app/immutable/assets/4.BS8ElpOV.css +0 -1
  283. package/dist/editor/_app/immutable/assets/ConfirmDialog.CHEISE-L.css +0 -1
  284. package/dist/editor/_app/immutable/assets/LibraryContextMenu.CDjCmdV-.css +0 -1
  285. package/dist/editor/_app/immutable/chunks/Cx6qtxJg.js +0 -1
  286. package/dist/editor/_app/immutable/chunks/n7mvYc42.js +0 -5
  287. package/dist/editor/_app/immutable/entry/start.C8HHOLly.js +0 -1
  288. package/dist/editor/_app/immutable/nodes/3.WO7tZH_d.js +0 -104
  289. package/dist/editor/_app/immutable/nodes/4.DQtx17aW.js +0 -2
  290. package/dist/editor/_app/version.json +0 -1
  291. package/dist/index.d.ts +0 -370
  292. package/dist/index.js +0 -4
  293. package/dist/start-Bhnqt9Dc.js +0 -279
  294. package/dist/start-D2IXOrni.js +0 -2
  295. /package/{dist/editor → build/client}/_app/immutable/assets/0.DLhIsYA_.css +0 -0
  296. /package/{dist/editor → build/client}/_app/immutable/chunks/Bjy-W4x2.js +0 -0
  297. /package/{dist/editor → build/client}/_app/immutable/chunks/CNRz3sSw.js +0 -0
  298. /package/{dist/editor → build/client}/_app/immutable/chunks/CO4RBJfa.js +0 -0
  299. /package/{dist/editor → build/client}/_app/immutable/chunks/DjdrdRzT.js +0 -0
  300. /package/{dist/editor → build/client}/_app/immutable/chunks/xihTtKlq.js +0 -0
@@ -0,0 +1,87 @@
1
+ import { type FundusStateDto, type PatchAssetRequestDto, type PatchManifestRequestDto } from '../core/index.js';
2
+ import type { ResolvedFundusConfig } from './config-loader.js';
3
+ import { LibraryStore, type IngestOptions } from './library-store.js';
4
+ import type { ServerPluginRegistry } from './plugins/contract.js';
5
+ /**
6
+ * The CLI's `--parameters` merge semantics (M7): a SHALLOW merge at the top
7
+ * level onto the current parameters — a nested object value replaces the whole
8
+ * current object under that key, a top-level `null` clears an optional field,
9
+ * and an asset reference is set with the normal `{"$asset": "<id>"}` marker.
10
+ * The merged result still passes the owning plugin's full validation.
11
+ */
12
+ export declare function mergeParameterPatch(currentParameters: unknown, patch: unknown): Record<string, unknown>;
13
+ /** A CLI-facing asset change: parameter patch and/or explicit membership set. */
14
+ export interface AssetChangeOptions {
15
+ /** Shallow top-level parameter patch (see mergeParameterPatch). */
16
+ parametersPatch?: unknown;
17
+ /** Replacement for the explicit manifest membership set (declarative). */
18
+ manifests?: string[];
19
+ }
20
+ export declare class FundusOperations {
21
+ #private;
22
+ constructor(config: ResolvedFundusConfig, registry?: ServerPluginRegistry);
23
+ get config(): ResolvedFundusConfig;
24
+ get store(): LibraryStore;
25
+ /** Read-only state snapshot (no processing). */
26
+ state(): Promise<FundusStateDto>;
27
+ /**
28
+ * Ingest an upload: store the raw file + record, then let the owning
29
+ * plugin's optional `seedIngestParameters` derive better starting
30
+ * parameters from the stored raw file (slices: insets from the image
31
+ * dimensions, pixel ratio from the file name — the schema default can't
32
+ * know either). The CLI additionally applies a parameter patch and/or an
33
+ * explicit membership set in the same operation; a failing application
34
+ * rolls the whole ingest back, so a failed ingest leaves nothing behind.
35
+ */
36
+ ingest(options: IngestOptions & AssetChangeOptions): Promise<FundusStateDto>;
37
+ /** Apply a PATCH body: parameters and/or manifests and/or a rename — in that order. */
38
+ patchAsset(id: string, body: PatchAssetRequestDto): Promise<FundusStateDto>;
39
+ moveAsset(id: string, folder: string): Promise<FundusStateDto>;
40
+ /** Move a selected asset set as one editor action and roll back on any failure. */
41
+ moveAssets(assetIds: string[], folder: string): Promise<FundusStateDto>;
42
+ createFolder(path: string): Promise<FundusStateDto>;
43
+ renameFolder(path: string, newName: string): Promise<FundusStateDto>;
44
+ moveFolder(path: string, parent: string): Promise<FundusStateDto>;
45
+ deleteFolder(path: string): Promise<FundusStateDto>;
46
+ /**
47
+ * CLI-facing asset update (M7): shallow-merge a parameter patch and/or
48
+ * replace the explicit manifest membership — validating the *result* before
49
+ * anything is persisted, so a change that would leave the library invalid
50
+ * (dangling or cyclic reference, unknown manifest, invalid parameters) is
51
+ * rejected with nothing written. The REST `patchAsset` keeps the editor's
52
+ * lenient replace semantics.
53
+ */
54
+ setAsset(id: string, changes: AssetChangeOptions): Promise<FundusStateDto>;
55
+ /**
56
+ * CLI-facing rename (M7): rejects a rename that would break references —
57
+ * a referrer keeps pointing at the old id, so renaming a referenced asset
58
+ * introduces dangling-reference errors. Update the referrers first.
59
+ */
60
+ renameAsset(id: string, newId: string): Promise<FundusStateDto>;
61
+ /**
62
+ * Delete an asset: the record, its raw file, and its proxies. With
63
+ * `failOnIntroducedIssues` (the CLI), a delete that would break references
64
+ * (the asset is a reference target) is rejected before anything —
65
+ * including the raw file — is removed; the REST route stays lenient.
66
+ */
67
+ deleteAsset(id: string, options?: {
68
+ failOnIntroducedIssues?: boolean;
69
+ }): Promise<FundusStateDto>;
70
+ /** Delete a selected asset set as one lenient editor mutation. */
71
+ deleteAssets(assetIds: string[]): Promise<FundusStateDto>;
72
+ createManifest(name: string): Promise<FundusStateDto>;
73
+ setManifestAppearance(name: string, appearance: {
74
+ color?: string | null;
75
+ emoji?: string | null;
76
+ }): Promise<FundusStateDto>;
77
+ /** Apply a PATCH body: appearance fields and/or a rename — in that order. */
78
+ patchManifest(name: string, body: PatchManifestRequestDto): Promise<FundusStateDto>;
79
+ /**
80
+ * Rename a manifest: rewrites every asset's membership and replaces the
81
+ * generated module (the old one is pruned as a stray). Host code importing
82
+ * the module must be updated by hand — both the file name and the exported
83
+ * const change with the manifest name.
84
+ */
85
+ renameManifest(name: string, newName: string): Promise<FundusStateDto>;
86
+ deleteManifest(name: string): Promise<FundusStateDto>;
87
+ }
@@ -0,0 +1,427 @@
1
+ /**
2
+ * The one operations layer: builds the state payload and runs
3
+ * every mutation through the autosave chain — write library → process affected
4
+ * assets → regenerate codegen → return fresh state. Both the REST server
5
+ * and the CLI consume this class, so every
6
+ * operation has exactly one implementation and there is no other save path.
7
+ */
8
+ import { join } from 'node:path';
9
+ import { allDeliveredAssetIds, collectAllReferences, compareCodeUnits, computeLibraryMembership, folderOfRawPath, rawFileNameOfPath } from '../core/index.js';
10
+ import { LibraryStore } from './library-store.js';
11
+ import { generateManifestModules } from './codegen.js';
12
+ import { descriptorsByType, serverPluginForType, serverPluginsByType } from './plugins.js';
13
+ import { processAssets, readCurrentProxy } from './processing/processor.js';
14
+ import { encodeRelativePathForUrl } from './folder-filesystem.js';
15
+ /**
16
+ * The CLI's `--parameters` merge semantics (M7): a SHALLOW merge at the top
17
+ * level onto the current parameters — a nested object value replaces the whole
18
+ * current object under that key, a top-level `null` clears an optional field,
19
+ * and an asset reference is set with the normal `{"$asset": "<id>"}` marker.
20
+ * The merged result still passes the owning plugin's full validation.
21
+ */
22
+ export function mergeParameterPatch(currentParameters, patch) {
23
+ if (typeof patch !== 'object' || patch === null || Array.isArray(patch)) {
24
+ throw new Error('The parameter patch must be a JSON object, e.g. {"preset": "default"}.');
25
+ }
26
+ const merged = typeof currentParameters === 'object' &&
27
+ currentParameters !== null &&
28
+ !Array.isArray(currentParameters)
29
+ ? { ...currentParameters }
30
+ : {};
31
+ for (const [key, value] of Object.entries(patch)) {
32
+ if (value === null) {
33
+ delete merged[key];
34
+ }
35
+ else {
36
+ merged[key] = value;
37
+ }
38
+ }
39
+ return merged;
40
+ }
41
+ export class FundusOperations {
42
+ #config;
43
+ #registry;
44
+ #store;
45
+ constructor(config, registry = serverPluginsByType) {
46
+ this.#config = config;
47
+ this.#registry = registry;
48
+ this.#store = new LibraryStore(config, registry);
49
+ }
50
+ get config() {
51
+ return this.#config;
52
+ }
53
+ get store() {
54
+ return this.#store;
55
+ }
56
+ /** Read-only state snapshot (no processing). */
57
+ async state() {
58
+ return this.#buildState(await this.#store.read(), []);
59
+ }
60
+ /**
61
+ * Ingest an upload: store the raw file + record, then let the owning
62
+ * plugin's optional `seedIngestParameters` derive better starting
63
+ * parameters from the stored raw file (slices: insets from the image
64
+ * dimensions, pixel ratio from the file name — the schema default can't
65
+ * know either). The CLI additionally applies a parameter patch and/or an
66
+ * explicit membership set in the same operation; a failing application
67
+ * rolls the whole ingest back, so a failed ingest leaves nothing behind.
68
+ */
69
+ async ingest(options) {
70
+ let library = await this.#store.ingest(options);
71
+ try {
72
+ const plugin = serverPluginForType(options.type, this.#registry);
73
+ if (plugin.seedIngestParameters) {
74
+ const record = library.assets[options.id];
75
+ const seeded = await plugin.seedIngestParameters({
76
+ rawPath: join(this.#config.rawDir, record.raw),
77
+ rawFileName: rawFileNameOfPath(record.raw),
78
+ parameters: plugin.descriptor.validateParameters(record.parameters),
79
+ config: this.#config
80
+ });
81
+ if (seeded !== undefined) {
82
+ library = await this.#store.updateParameters(options.id, seeded);
83
+ }
84
+ }
85
+ if (options.parametersPatch !== undefined || options.manifests !== undefined) {
86
+ library = await this.#applyAssetChanges(library, options.id, {
87
+ parametersPatch: options.parametersPatch,
88
+ manifests: options.manifests
89
+ });
90
+ }
91
+ }
92
+ catch (cause) {
93
+ await this.#store.deleteAsset(options.id);
94
+ throw cause;
95
+ }
96
+ return this.#afterMutation(library);
97
+ }
98
+ /** Apply a PATCH body: parameters and/or manifests and/or a rename — in that order. */
99
+ async patchAsset(id, body) {
100
+ let library = await this.#store.read();
101
+ this.#requireAsset(library, id);
102
+ if (body.parameters !== undefined) {
103
+ library = await this.#store.updateParameters(id, body.parameters);
104
+ }
105
+ if (body.manifests !== undefined) {
106
+ if (!Array.isArray(body.manifests) ||
107
+ body.manifests.some((name) => typeof name !== 'string')) {
108
+ throw new Error('"manifests" must be an array of manifest names.');
109
+ }
110
+ library = await this.#store.setManifests(id, body.manifests);
111
+ }
112
+ if (body.renameTo !== undefined) {
113
+ if (typeof body.renameTo !== 'string') {
114
+ throw new Error('"renameTo" must be a string.');
115
+ }
116
+ library = await this.#store.renameAsset(id, body.renameTo);
117
+ }
118
+ if (body.folder !== undefined) {
119
+ if (typeof body.folder !== 'string')
120
+ throw new Error('"folder" must be a string.');
121
+ library = await this.#store.moveAsset(body.renameTo ?? id, body.folder);
122
+ }
123
+ return this.#afterMutation(library);
124
+ }
125
+ async moveAsset(id, folder) {
126
+ return this.#afterMutation(await this.#store.moveAsset(id, folder));
127
+ }
128
+ /** Move a selected asset set as one editor action and roll back on any failure. */
129
+ async moveAssets(assetIds, folder) {
130
+ const uniqueIds = [...new Set(assetIds)];
131
+ if (uniqueIds.length === 0)
132
+ throw new Error('At least one asset id is required.');
133
+ const originalFolders = new Map();
134
+ const library = await this.#store.read();
135
+ for (const id of uniqueIds) {
136
+ this.#requireAsset(library, id);
137
+ originalFolders.set(id, folderOfRawPath(library.assets[id].raw));
138
+ }
139
+ const movedIds = [];
140
+ try {
141
+ let updated = library;
142
+ for (const id of uniqueIds) {
143
+ if (originalFolders.get(id) === folder)
144
+ continue;
145
+ updated = await this.#store.moveAsset(id, folder);
146
+ movedIds.push(id);
147
+ }
148
+ return this.#afterMutation(updated);
149
+ }
150
+ catch (cause) {
151
+ for (const id of movedIds.reverse()) {
152
+ await this.#store.moveAsset(id, originalFolders.get(id) ?? '');
153
+ }
154
+ throw cause;
155
+ }
156
+ }
157
+ async createFolder(path) {
158
+ return this.#afterMutation(await this.#store.createFolder(path));
159
+ }
160
+ async renameFolder(path, newName) {
161
+ return this.#afterMutation(await this.#store.renameFolder(path, newName));
162
+ }
163
+ async moveFolder(path, parent) {
164
+ return this.#afterMutation(await this.#store.moveFolder(path, parent));
165
+ }
166
+ async deleteFolder(path) {
167
+ const result = await this.#store.deleteFolder(path);
168
+ return this.#afterMutation(result.library);
169
+ }
170
+ /**
171
+ * CLI-facing asset update (M7): shallow-merge a parameter patch and/or
172
+ * replace the explicit manifest membership — validating the *result* before
173
+ * anything is persisted, so a change that would leave the library invalid
174
+ * (dangling or cyclic reference, unknown manifest, invalid parameters) is
175
+ * rejected with nothing written. The REST `patchAsset` keeps the editor's
176
+ * lenient replace semantics.
177
+ */
178
+ async setAsset(id, changes) {
179
+ const library = await this.#store.read();
180
+ this.#requireAsset(library, id);
181
+ return this.#afterMutation(await this.#applyAssetChanges(library, id, changes));
182
+ }
183
+ /**
184
+ * CLI-facing rename (M7): rejects a rename that would break references —
185
+ * a referrer keeps pointing at the old id, so renaming a referenced asset
186
+ * introduces dangling-reference errors. Update the referrers first.
187
+ */
188
+ async renameAsset(id, newId) {
189
+ const library = await this.#store.read();
190
+ this.#requireAsset(library, id);
191
+ // A collision or invalid new id is the store's own (clearer) error; the
192
+ // candidate check covers what the store cannot see: broken references.
193
+ if (newId !== id && !Object.hasOwn(library.assets, newId)) {
194
+ const candidate = structuredClone(library);
195
+ candidate.assets[newId] = candidate.assets[id];
196
+ delete candidate.assets[id];
197
+ await this.#assertNoIntroducedIssues(library, candidate);
198
+ }
199
+ return this.#afterMutation(await this.#store.renameAsset(id, newId));
200
+ }
201
+ /**
202
+ * Delete an asset: the record, its raw file, and its proxies. With
203
+ * `failOnIntroducedIssues` (the CLI), a delete that would break references
204
+ * (the asset is a reference target) is rejected before anything —
205
+ * including the raw file — is removed; the REST route stays lenient.
206
+ */
207
+ async deleteAsset(id, options) {
208
+ if (options?.failOnIntroducedIssues) {
209
+ const library = await this.#store.read();
210
+ this.#requireAsset(library, id);
211
+ const candidate = structuredClone(library);
212
+ delete candidate.assets[id];
213
+ await this.#assertNoIntroducedIssues(library, candidate);
214
+ }
215
+ return this.#afterMutation(await this.#store.deleteAsset(id));
216
+ }
217
+ /** Delete a selected asset set as one lenient editor mutation. */
218
+ async deleteAssets(assetIds) {
219
+ const uniqueIds = [...new Set(assetIds)];
220
+ if (uniqueIds.length === 0)
221
+ throw new Error('At least one asset id is required.');
222
+ return this.#afterMutation(await this.#store.deleteAssets(uniqueIds));
223
+ }
224
+ async createManifest(name) {
225
+ return this.#afterMutation(await this.#store.createManifest(name));
226
+ }
227
+ async setManifestAppearance(name, appearance) {
228
+ return this.#afterMutation(await this.#store.setManifestAppearance(name, appearance));
229
+ }
230
+ /** Apply a PATCH body: appearance fields and/or a rename — in that order. */
231
+ async patchManifest(name, body) {
232
+ let library = await this.#store.setManifestAppearance(name, {
233
+ color: body.color,
234
+ emoji: body.emoji
235
+ });
236
+ if (body.renameTo !== undefined) {
237
+ if (typeof body.renameTo !== 'string') {
238
+ throw new Error('"renameTo" must be a string.');
239
+ }
240
+ library = await this.#store.renameManifest(name, body.renameTo);
241
+ }
242
+ return this.#afterMutation(library);
243
+ }
244
+ /**
245
+ * Rename a manifest: rewrites every asset's membership and replaces the
246
+ * generated module (the old one is pruned as a stray). Host code importing
247
+ * the module must be updated by hand — both the file name and the exported
248
+ * const change with the manifest name.
249
+ */
250
+ async renameManifest(name, newName) {
251
+ return this.#afterMutation(await this.#store.renameManifest(name, newName));
252
+ }
253
+ async deleteManifest(name) {
254
+ return this.#afterMutation(await this.#store.deleteManifest(name));
255
+ }
256
+ /** The autosave chain tail: process + regenerate, then report fresh state. */
257
+ async #afterMutation(library) {
258
+ const pipelineIssues = [];
259
+ const issues = await this.#store.validate(library);
260
+ if (issues.length === 0) {
261
+ try {
262
+ const report = await processAssets(this.#config, library, this.#registry);
263
+ await generateManifestModules(this.#config, library, report.proxies, this.#registry);
264
+ }
265
+ catch (cause) {
266
+ pipelineIssues.push({
267
+ message: `Processing failed: ${cause instanceof Error ? cause.message : String(cause)}`
268
+ });
269
+ }
270
+ }
271
+ return this.#buildState(library, pipelineIssues, issues);
272
+ }
273
+ async #buildState(library, extraIssues, precomputedIssues) {
274
+ const issues = [
275
+ ...(precomputedIssues ?? (await this.#store.validate(library))),
276
+ ...extraIssues
277
+ ];
278
+ const referencesByAsset = collectAllReferences(library, descriptorsByType(this.#registry));
279
+ const membershipByManifest = computeLibraryMembership(library, referencesByAsset);
280
+ const delivered = allDeliveredAssetIds(membershipByManifest);
281
+ // Per asset: the manifests it is a passive member of, with attribution.
282
+ const passiveManifestsByAsset = new Map();
283
+ for (const manifestName of Object.keys(library.manifests).sort(compareCodeUnits)) {
284
+ for (const passiveMember of membershipByManifest[manifestName].passiveMembers) {
285
+ const passiveManifests = passiveManifestsByAsset.get(passiveMember.assetId) ?? [];
286
+ passiveManifests.push({ manifest: manifestName, via: passiveMember.via });
287
+ passiveManifestsByAsset.set(passiveMember.assetId, passiveManifests);
288
+ }
289
+ }
290
+ const incomingByAsset = new Map();
291
+ for (const [referrerId, references] of Object.entries(referencesByAsset)) {
292
+ for (const reference of references) {
293
+ const incoming = incomingByAsset.get(reference.assetId) ?? [];
294
+ incoming.push({ field: reference.field, assetId: referrerId });
295
+ incomingByAsset.set(reference.assetId, incoming);
296
+ }
297
+ }
298
+ const assets = [];
299
+ for (const assetId of Object.keys(library.assets).sort(compareCodeUnits)) {
300
+ const record = library.assets[assetId];
301
+ const warnings = [];
302
+ for (const issue of issues) {
303
+ if (issue.assetId === assetId)
304
+ warnings.push(issue.message);
305
+ }
306
+ // Unreachable: no explicit membership AND no passive membership in any
307
+ // manifest — nothing delivers the asset. A passively delivered asset is
308
+ // fine (it ships inlined into its referrers) and must not warn.
309
+ if (record.manifests.length === 0 && !delivered.has(assetId)) {
310
+ warnings.push('In no manifest and not referenced by any delivered asset — ' +
311
+ 'nothing is processed or generated for it.');
312
+ }
313
+ let proxy = null;
314
+ if (delivered.has(assetId)) {
315
+ try {
316
+ const currentProxy = await readCurrentProxy(assetId, record, this.#config, this.#registry);
317
+ if (currentProxy) {
318
+ proxy = {
319
+ url: `/files/proxy/${encodeRelativePathForUrl(currentProxy.relativePath)}`,
320
+ upToDate: true,
321
+ ...currentProxy
322
+ };
323
+ }
324
+ else {
325
+ warnings.push('Proxy is stale or missing — it will be (re)processed on the next save.');
326
+ }
327
+ }
328
+ catch (cause) {
329
+ warnings.push(cause instanceof Error ? cause.message : String(cause));
330
+ }
331
+ }
332
+ assets.push({
333
+ id: assetId,
334
+ type: record.type,
335
+ raw: record.raw,
336
+ folder: folderOfRawPath(record.raw),
337
+ rawUrl: `/files/raw/${encodeRelativePathForUrl(record.raw)}`,
338
+ rawHash: record.rawHash,
339
+ parameters: record.parameters,
340
+ manifests: record.manifests,
341
+ passiveManifests: passiveManifestsByAsset.get(assetId) ?? [],
342
+ proxy,
343
+ warnings,
344
+ references: {
345
+ outgoing: referencesByAsset[assetId].map((reference) => ({
346
+ field: reference.field,
347
+ assetId: reference.assetId
348
+ })),
349
+ incoming: incomingByAsset.get(assetId) ?? []
350
+ }
351
+ });
352
+ }
353
+ // Per manifest: the membership picture for the manifests view, and the
354
+ // delivered bytes over the full delivery set (explicit ∪ passive),
355
+ // deduplicated — the preload-budget number.
356
+ const proxySizeByAssetId = new Map(assets.filter((asset) => asset.proxy).map((asset) => [asset.id, asset.proxy?.fileSize ?? 0]));
357
+ const manifestMemberships = {};
358
+ const manifestDeliveredBytes = {};
359
+ for (const manifestName of Object.keys(library.manifests).sort(compareCodeUnits)) {
360
+ const membership = membershipByManifest[manifestName];
361
+ manifestMemberships[manifestName] = {
362
+ explicitMemberIds: membership.explicitMemberIds,
363
+ passiveMembers: membership.passiveMembers
364
+ };
365
+ let deliveredBytes = 0;
366
+ for (const deliveredAssetId of membership.deliveredAssetIds) {
367
+ deliveredBytes += proxySizeByAssetId.get(deliveredAssetId) ?? 0;
368
+ }
369
+ manifestDeliveredBytes[manifestName] = deliveredBytes;
370
+ }
371
+ // Per plugin type, the available preset names — straight off the registry
372
+ // Chroma-key-video shares the video preset namespace via its plugin.
373
+ const presetNames = {};
374
+ for (const [type, plugin] of Object.entries(this.#registry)) {
375
+ presetNames[type] = Object.keys(plugin.presets(this.#config)).sort();
376
+ }
377
+ return {
378
+ library,
379
+ assets,
380
+ issues,
381
+ presetNames,
382
+ manifestMemberships,
383
+ manifestDeliveredBytes
384
+ };
385
+ }
386
+ #requireAsset(library, id) {
387
+ // Own-property check — an inherited key ("constructor", "toString", …)
388
+ // must not pass as an existing asset.
389
+ if (!Object.hasOwn(library.assets, id)) {
390
+ throw new Error(`Unknown asset "${id}".`);
391
+ }
392
+ }
393
+ /**
394
+ * Apply a CLI asset change to the store, validating the resulting library
395
+ * on an in-memory candidate first — nothing is persisted when the change
396
+ * would introduce validation issues. Pre-existing issues never block an
397
+ * unrelated mutation (only *introduced* issues are rejected).
398
+ */
399
+ async #applyAssetChanges(library, id, changes) {
400
+ const candidate = structuredClone(library);
401
+ const candidateRecord = candidate.assets[id];
402
+ if (changes.parametersPatch !== undefined) {
403
+ candidateRecord.parameters = serverPluginForType(candidateRecord.type, this.#registry).descriptor.validateParameters(mergeParameterPatch(candidateRecord.parameters, changes.parametersPatch));
404
+ }
405
+ if (changes.manifests !== undefined) {
406
+ candidateRecord.manifests = [...new Set(changes.manifests)].sort();
407
+ }
408
+ await this.#assertNoIntroducedIssues(library, candidate);
409
+ let updated = library;
410
+ if (changes.parametersPatch !== undefined) {
411
+ updated = await this.#store.updateParameters(id, candidateRecord.parameters);
412
+ }
413
+ if (changes.manifests !== undefined) {
414
+ updated = await this.#store.setManifests(id, changes.manifests);
415
+ }
416
+ return updated;
417
+ }
418
+ /** Reject a candidate library that has validation issues the current one lacks. */
419
+ async #assertNoIntroducedIssues(library, candidate) {
420
+ const existingIssueKeys = new Set((await this.#store.validate(library)).map((issue) => `${issue.assetId ?? ''}|${issue.message}`));
421
+ const introduced = (await this.#store.validate(candidate)).filter((issue) => !existingIssueKeys.has(`${issue.assetId ?? ''}|${issue.message}`));
422
+ if (introduced.length > 0) {
423
+ const lines = introduced.map((issue) => ` - ${issue.assetId ? `[${issue.assetId}] ` : ''}${issue.message}`);
424
+ throw new Error(`Rejected — the change would leave the library invalid (nothing was written):\n${lines.join('\n')}`);
425
+ }
426
+ }
427
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Audio plugin (server part): one ffmpeg transcode per preset.
3
+ * No dimensions — the proxy's only output metadata is its duration.
4
+ */
5
+ import { type AudioParameters, type AudioPreset } from '../../core/index.js';
6
+ import { type ServerAssetTypePlugin } from './contract.js';
7
+ export declare const audioServerPlugin: ServerAssetTypePlugin<AudioParameters, AudioPreset>;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Audio plugin (server part): one ffmpeg transcode per preset.
3
+ * No dimensions — the proxy's only output metadata is its duration.
4
+ */
5
+ import { audioPlugin } from '../../core/index.js';
6
+ import { processAudioFile } from '../processing/audio-processing.js';
7
+ import { probeMedia } from '../processing/media-probe.js';
8
+ import { requireProxyField, resolveNamedPreset } from './contract.js';
9
+ export const audioServerPlugin = {
10
+ descriptor: audioPlugin,
11
+ pluginConfig: (config) => config.plugins.audio,
12
+ presets: (config) => config.plugins.audio.presets,
13
+ resolvePreset: (parameters, config) => resolveNamedPreset('audio', parameters.preset, config.plugins.audio.presets),
14
+ proxyExtension: (preset) => preset.container,
15
+ process: (job) => processAudioFile({
16
+ sourcePath: job.sourcePath,
17
+ targetPath: job.targetPath,
18
+ preset: job.preset,
19
+ config: job.config
20
+ }),
21
+ readProxyInfo: (proxyPath, config) => probeMedia(proxyPath, config),
22
+ buildManifestEntry: ({ src, proxy }) => ({
23
+ kind: 'audio',
24
+ src,
25
+ durationMs: requireProxyField(proxy, 'durationMs')
26
+ })
27
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Chroma-key-video plugin (server part): shares the video plugin's transcode
3
+ * pipeline and preset namespace — the keying parameters and the
4
+ * mask/fallback references never reach ffmpeg, they are entry-only data
5
+ * (the descriptor's `processingParameters` keeps them out of the job hash).
6
+ */
7
+ import { type ChromaKeyVideoParameters, type VideoPreset } from '../../core/index.js';
8
+ import { type ServerAssetTypePlugin } from './contract.js';
9
+ export declare const chromaKeyVideoServerPlugin: ServerAssetTypePlugin<ChromaKeyVideoParameters, VideoPreset>;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Chroma-key-video plugin (server part): shares the video plugin's transcode
3
+ * pipeline and preset namespace — the keying parameters and the
4
+ * mask/fallback references never reach ffmpeg, they are entry-only data
5
+ * (the descriptor's `processingParameters` keeps them out of the job hash).
6
+ */
7
+ import { chromaKeyVideoPlugin } from '../../core/index.js';
8
+ import { probeMedia } from '../processing/media-probe.js';
9
+ import { processVideoFile } from '../processing/video-processing.js';
10
+ import { requireProxyField, resolveNamedPreset } from './contract.js';
11
+ export const chromaKeyVideoServerPlugin = {
12
+ descriptor: chromaKeyVideoPlugin,
13
+ // One preset namespace with the video plugin — the config slice,
14
+ // the preset map, and the resolution label are video's.
15
+ pluginConfig: (config) => config.plugins.video,
16
+ presets: (config) => config.plugins.video.presets,
17
+ resolvePreset: (parameters, config) => resolveNamedPreset('video', parameters.preset, config.plugins.video.presets),
18
+ proxyExtension: (preset) => preset.container,
19
+ process: (job) => processVideoFile({
20
+ sourcePath: job.sourcePath,
21
+ targetPath: job.targetPath,
22
+ preset: job.preset,
23
+ maxWidth: job.parameters.maxWidth,
24
+ config: job.config
25
+ }),
26
+ readProxyInfo: (proxyPath, config) => probeMedia(proxyPath, config),
27
+ buildManifestEntry: ({ parameters, src, proxy }) => ({
28
+ kind: 'chroma-key-video',
29
+ src,
30
+ width: requireProxyField(proxy, 'width'),
31
+ height: requireProxyField(proxy, 'height'),
32
+ durationMs: requireProxyField(proxy, 'durationMs'),
33
+ chromaKey: parameters.chromaKey,
34
+ // mask/fallback stay `{ $asset }` markers here — codegen inlines them.
35
+ ...(parameters.mask ? { mask: parameters.mask } : {}),
36
+ ...(parameters.fallback ? { fallback: parameters.fallback } : {})
37
+ })
38
+ };