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,18 @@
1
+ import type { AssetTypePluginDescriptor } from './plugins/contract.js';
2
+ /** The built-in descriptors, in registration order (image before slice, video before chroma-key-video). */
3
+ export declare const BUILT_IN_DESCRIPTORS: AssetTypePluginDescriptor<unknown, unknown>[];
4
+ /** Unique HTML file-picker accept extensions derived from descriptor claims. */
5
+ export declare function acceptedExtensions(descriptors?: AssetTypePluginDescriptor<unknown, unknown>[]): string[];
6
+ /**
7
+ * Types an ingested file of this extension could become — derived from the
8
+ * descriptors' `accepts` claims. Raster images and video containers are
9
+ * ambiguous (image/slice, video/chroma-key-video) — the editor dialog prompts
10
+ * once, the CLI requires `--type`; audio is unambiguous.
11
+ */
12
+ export declare function typesForFileName(fileName: string, descriptors?: AssetTypePluginDescriptor<unknown, unknown>[]): string[];
13
+ /**
14
+ * Propose a camelCase asset id from a file name: split on non-alphanumeric
15
+ * runs and case boundaries, drop a `@2x`-style scale suffix, lowercase the
16
+ * first word, capitalize the rest, strip leading digits.
17
+ */
18
+ export declare function proposeAssetId(fileName: string): string;
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Ingestion helpers shared by every ingest surface: the editor's
3
+ * drag & drop dialog and the CLI's `asset ingest` command both resolve a
4
+ * dropped file name to its candidate asset types and propose an asset id the
5
+ * same way — one implementation, in core.
6
+ */
7
+ import { audioPlugin } from './plugins/audio.js';
8
+ import { chromaKeyVideoPlugin } from './plugins/chroma-key-video.js';
9
+ import { imagePlugin } from './plugins/image.js';
10
+ import { slicePlugin } from './plugins/slice.js';
11
+ import { videoPlugin } from './plugins/video.js';
12
+ /** The built-in descriptors, in registration order (image before slice, video before chroma-key-video). */
13
+ export const BUILT_IN_DESCRIPTORS = [
14
+ imagePlugin,
15
+ slicePlugin,
16
+ videoPlugin,
17
+ chromaKeyVideoPlugin,
18
+ audioPlugin
19
+ ];
20
+ /** Unique HTML file-picker accept extensions derived from descriptor claims. */
21
+ export function acceptedExtensions(descriptors = BUILT_IN_DESCRIPTORS) {
22
+ return [...new Set(descriptors.flatMap((descriptor) => descriptor.accepts))]
23
+ .sort()
24
+ .map((extension) => `.${extension}`);
25
+ }
26
+ /**
27
+ * Types an ingested file of this extension could become — derived from the
28
+ * descriptors' `accepts` claims. Raster images and video containers are
29
+ * ambiguous (image/slice, video/chroma-key-video) — the editor dialog prompts
30
+ * once, the CLI requires `--type`; audio is unambiguous.
31
+ */
32
+ export function typesForFileName(fileName, descriptors = BUILT_IN_DESCRIPTORS) {
33
+ const extension = fileName.slice(fileName.lastIndexOf('.') + 1).toLowerCase();
34
+ return descriptors
35
+ .filter((descriptor) => descriptor.accepts.includes(extension))
36
+ .map((descriptor) => descriptor.type);
37
+ }
38
+ /**
39
+ * Propose a camelCase asset id from a file name: split on non-alphanumeric
40
+ * runs and case boundaries, drop a `@2x`-style scale suffix, lowercase the
41
+ * first word, capitalize the rest, strip leading digits.
42
+ */
43
+ export function proposeAssetId(fileName) {
44
+ const stem = fileName.replace(/\.[^.]+$/, '').replace(/(?:@|[-_])\dx$/i, '');
45
+ const words = stem
46
+ .replace(/([a-z0-9])([A-Z])/g, '$1 $2')
47
+ .split(/[^a-zA-Z0-9]+/)
48
+ .filter(Boolean);
49
+ if (words.length === 0)
50
+ return 'asset';
51
+ const joined = words
52
+ .map((word, index) => index === 0 ? word.toLowerCase() : word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
53
+ .join('');
54
+ const withoutLeadingDigits = joined.replace(/^[0-9]+/, '');
55
+ if (!withoutLeadingDigits)
56
+ return 'asset';
57
+ return withoutLeadingDigits.charAt(0).toLowerCase() + withoutLeadingDigits.slice(1);
58
+ }
@@ -0,0 +1,54 @@
1
+ /**
2
+ * The library file model — the single source of truth for all asset metadata
3
+ * and manifest membership. One JSON file in the host repo, committed,
4
+ * serialized deterministically (recursively sorted keys) to minimize merge
5
+ * conflicts.
6
+ */
7
+ export type AssetId = string;
8
+ export type ManifestName = string;
9
+ export interface AssetRecord {
10
+ /** Asset type — which plugin owns this asset ('image' | 'slice' | …). */
11
+ type: string;
12
+ /** Raw file path, relative to the configured raw directory. */
13
+ raw: string;
14
+ /** Content hash (sha256 hex) of the raw file the parameters were authored against. */
15
+ rawHash: string;
16
+ /** Plugin-owned parameter blob, validated against the owning plugin's schema. */
17
+ parameters: unknown;
18
+ /** Empty + unreferenced = inert; referenced assets still deliver as passive members. */
19
+ manifests: ManifestName[];
20
+ }
21
+ /**
22
+ * Per-manifest data. A delivery unit needs no metadata to function, but may
23
+ * carry an optional editor appearance — a color and/or an emoji — so
24
+ * the editor can tag the manifest's label everywhere. Both are chosen from the
25
+ * fixed sets in `manifest-appearance.ts` and validated at every mutation entry
26
+ * point; parsing only enforces that they are strings when present.
27
+ */
28
+ export interface ManifestRecord {
29
+ /** Optional color tag — a `#rrggbb` value from the fixed palette. */
30
+ color?: string;
31
+ /** Optional emoji tag — one of the fixed emoji set. */
32
+ emoji?: string;
33
+ }
34
+ export interface Library {
35
+ version: 1;
36
+ /** Persisted nested folder paths. The raw/proxy root is implicit. */
37
+ folders: string[];
38
+ assets: Record<AssetId, AssetRecord>;
39
+ manifests: Record<ManifestName, ManifestRecord>;
40
+ }
41
+ /** A fresh, empty library. */
42
+ export declare function createEmptyLibrary(): Library;
43
+ /**
44
+ * Parse and structurally validate a library file's JSON text. Throws with a
45
+ * clear message on any malformed part; plugin parameter validation is a
46
+ * separate, plugin-owned step.
47
+ */
48
+ export declare function parseLibrary(json: string): Library;
49
+ /**
50
+ * Serialize a library deterministically: recursively sorted keys, tab-indented,
51
+ * trailing newline. Same library → byte-identical file, whatever the in-memory
52
+ * insertion order was.
53
+ */
54
+ export declare function serializeLibrary(library: Library): string;
@@ -0,0 +1,138 @@
1
+ import { folderPathError } from './folder-path.js';
2
+ /** A fresh, empty library. */
3
+ export function createEmptyLibrary() {
4
+ return { version: 1, folders: [], assets: {}, manifests: {} };
5
+ }
6
+ function isRecord(value) {
7
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
8
+ }
9
+ /**
10
+ * Keys that are prototype-pollution hazards as record keys: assigning
11
+ * `assets["__proto__"] = …` on a plain object replaces its prototype instead
12
+ * of adding an entry. Rejected outright at parse time — id *validity* beyond
13
+ * this is a validator concern (reported as issues, not parse failures).
14
+ */
15
+ const DANGEROUS_KEYS = ['__proto__', 'constructor', 'prototype'];
16
+ function assertSafeKey(kind, key) {
17
+ if (DANGEROUS_KEYS.includes(key)) {
18
+ throw new Error(`Library ${kind} key "${key}" is not allowed.`);
19
+ }
20
+ }
21
+ function parseAssetRecord(id, value) {
22
+ if (!isRecord(value)) {
23
+ throw new Error(`Library asset "${id}" must be an object.`);
24
+ }
25
+ if (typeof value.type !== 'string' || value.type.length === 0) {
26
+ throw new Error(`Library asset "${id}" is missing a string "type".`);
27
+ }
28
+ if (typeof value.raw !== 'string' || value.raw.length === 0) {
29
+ throw new Error(`Library asset "${id}" is missing a string "raw" file name.`);
30
+ }
31
+ if (typeof value.rawHash !== 'string' || value.rawHash.length === 0) {
32
+ throw new Error(`Library asset "${id}" is missing a string "rawHash".`);
33
+ }
34
+ if (!('parameters' in value)) {
35
+ throw new Error(`Library asset "${id}" is missing "parameters".`);
36
+ }
37
+ if (!Array.isArray(value.manifests) ||
38
+ value.manifests.some((entry) => typeof entry !== 'string')) {
39
+ throw new Error(`Library asset "${id}" must have a "manifests" array of strings.`);
40
+ }
41
+ return {
42
+ type: value.type,
43
+ raw: value.raw,
44
+ rawHash: value.rawHash,
45
+ parameters: value.parameters,
46
+ manifests: value.manifests
47
+ };
48
+ }
49
+ function parseManifestRecord(name, value) {
50
+ const record = {};
51
+ if ('color' in value && value.color !== undefined) {
52
+ if (typeof value.color !== 'string') {
53
+ throw new Error(`Library manifest "${name}" has a non-string "color".`);
54
+ }
55
+ record.color = value.color;
56
+ }
57
+ if ('emoji' in value && value.emoji !== undefined) {
58
+ if (typeof value.emoji !== 'string') {
59
+ throw new Error(`Library manifest "${name}" has a non-string "emoji".`);
60
+ }
61
+ record.emoji = value.emoji;
62
+ }
63
+ return record;
64
+ }
65
+ /**
66
+ * Parse and structurally validate a library file's JSON text. Throws with a
67
+ * clear message on any malformed part; plugin parameter validation is a
68
+ * separate, plugin-owned step.
69
+ */
70
+ export function parseLibrary(json) {
71
+ let value;
72
+ try {
73
+ value = JSON.parse(json);
74
+ }
75
+ catch (cause) {
76
+ throw new Error(`Library file is not valid JSON: ${cause instanceof Error ? cause.message : String(cause)}`);
77
+ }
78
+ if (!isRecord(value)) {
79
+ throw new Error('Library file must contain a JSON object.');
80
+ }
81
+ if (value.version !== 1) {
82
+ throw new Error(`Unsupported library version ${JSON.stringify(value.version)} (expected 1).`);
83
+ }
84
+ if (!isRecord(value.assets)) {
85
+ throw new Error('Library "assets" must be an object.');
86
+ }
87
+ if (!isRecord(value.manifests)) {
88
+ throw new Error('Library "manifests" must be an object.');
89
+ }
90
+ if (value.folders !== undefined &&
91
+ (!Array.isArray(value.folders) || value.folders.some((entry) => typeof entry !== 'string'))) {
92
+ throw new Error('Library "folders" must be an array of strings.');
93
+ }
94
+ const folders = value.folders === undefined ? [] : value.folders;
95
+ for (const folder of folders) {
96
+ const problem = folderPathError(folder);
97
+ if (problem)
98
+ throw new Error(`Invalid library folder: ${problem}`);
99
+ }
100
+ const assets = {};
101
+ for (const [id, record] of Object.entries(value.assets)) {
102
+ assertSafeKey('asset', id);
103
+ assets[id] = parseAssetRecord(id, record);
104
+ }
105
+ const manifests = {};
106
+ for (const [name, record] of Object.entries(value.manifests)) {
107
+ assertSafeKey('manifest', name);
108
+ if (!isRecord(record)) {
109
+ throw new Error(`Library manifest "${name}" must be an object.`);
110
+ }
111
+ manifests[name] = parseManifestRecord(name, record);
112
+ }
113
+ return { version: 1, folders, assets, manifests };
114
+ }
115
+ /** Recursively sort object keys so serialization is order-independent. */
116
+ function sortValue(value) {
117
+ if (Array.isArray(value)) {
118
+ return value.map(sortValue);
119
+ }
120
+ if (typeof value === 'object' && value !== null) {
121
+ const sorted = {};
122
+ for (const key of Object.keys(value).sort()) {
123
+ const entry = value[key];
124
+ if (entry !== undefined)
125
+ sorted[key] = sortValue(entry);
126
+ }
127
+ return sorted;
128
+ }
129
+ return value;
130
+ }
131
+ /**
132
+ * Serialize a library deterministically: recursively sorted keys, tab-indented,
133
+ * trailing newline. Same library → byte-identical file, whatever the in-memory
134
+ * insertion order was.
135
+ */
136
+ export function serializeLibrary(library) {
137
+ return `${JSON.stringify(sortValue({ ...library, folders: [...library.folders].sort() }), null, '\t')}\n`;
138
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Manifest appearance: each manifest may carry a color and an emoji,
3
+ * chosen from these fixed sets, so the editor can tag its label everywhere and
4
+ * make asset↔manifest membership visually scannable. The sets are the closed
5
+ * palette both the editor pickers and the CLI validate against — storing a
6
+ * value outside them is rejected at every mutation entry point.
7
+ */
8
+ /** One selectable manifest color: a stable display name and its hex value. */
9
+ export interface ManifestColor {
10
+ /** Human-readable palette name (used by the CLI's `--color <name|hex>`). */
11
+ name: string;
12
+ /** The stored value — a lowercase `#rrggbb` hex string. */
13
+ value: string;
14
+ }
15
+ /**
16
+ * The fixed color palette. Values are the SSOT stored in the library; names are
17
+ * an ergonomic CLI alias. A Figma-like spread of distinct, saturated hues.
18
+ */
19
+ export declare const MANIFEST_COLORS: readonly ManifestColor[];
20
+ /** The fixed emoji set — 63 visually distinct choices (an 8×8 picker grid with a clear cell). */
21
+ export declare const MANIFEST_EMOJIS: readonly string[];
22
+ /** Whether `value` is one of the fixed color values (`#rrggbb`, lowercased). */
23
+ export declare function isManifestColor(value: string): boolean;
24
+ /** Whether `emoji` is one of the fixed emojis. */
25
+ export declare function isManifestEmoji(emoji: string): boolean;
26
+ /**
27
+ * Resolve a CLI-supplied color token (either a palette name like `blue` or a
28
+ * hex value like `#3b82f6`, case-insensitively) to its stored hex value, or
29
+ * `null` when it matches no palette entry.
30
+ */
31
+ export declare function resolveManifestColor(token: string): string | null;
32
+ /** Why a color value is invalid, as a human-readable message — or `null` when valid. */
33
+ export declare function manifestColorError(value: string): string | null;
34
+ /** Why an emoji is invalid, as a human-readable message — or `null` when valid. */
35
+ export declare function manifestEmojiError(emoji: string): string | null;
@@ -0,0 +1,123 @@
1
+ /**
2
+ * Manifest appearance: each manifest may carry a color and an emoji,
3
+ * chosen from these fixed sets, so the editor can tag its label everywhere and
4
+ * make asset↔manifest membership visually scannable. The sets are the closed
5
+ * palette both the editor pickers and the CLI validate against — storing a
6
+ * value outside them is rejected at every mutation entry point.
7
+ */
8
+ /**
9
+ * The fixed color palette. Values are the SSOT stored in the library; names are
10
+ * an ergonomic CLI alias. A Figma-like spread of distinct, saturated hues.
11
+ */
12
+ export const MANIFEST_COLORS = [
13
+ { name: 'slate', value: '#64748b' },
14
+ { name: 'red', value: '#ef4444' },
15
+ { name: 'orange', value: '#f97316' },
16
+ { name: 'amber', value: '#f59e0b' },
17
+ { name: 'yellow', value: '#eab308' },
18
+ { name: 'lime', value: '#84cc16' },
19
+ { name: 'green', value: '#22c55e' },
20
+ { name: 'teal', value: '#14b8a6' },
21
+ { name: 'cyan', value: '#06b6d4' },
22
+ { name: 'blue', value: '#3b82f6' },
23
+ { name: 'indigo', value: '#6366f1' },
24
+ { name: 'violet', value: '#8b5cf6' },
25
+ { name: 'pink', value: '#ec4899' }
26
+ ];
27
+ /** The fixed emoji set — 63 visually distinct choices (an 8×8 picker grid with a clear cell). */
28
+ export const MANIFEST_EMOJIS = [
29
+ '🗂️',
30
+ '🏠',
31
+ '🎯',
32
+ '⭐',
33
+ '🔥',
34
+ '💎',
35
+ '🎨',
36
+ '🧩',
37
+ '🚀',
38
+ '🎵',
39
+ '🏆',
40
+ '⚡',
41
+ '🌟',
42
+ '🍀',
43
+ '🎁',
44
+ '📦',
45
+ '🗺️',
46
+ '🔑',
47
+ '🛒',
48
+ '❤️',
49
+ '🐙',
50
+ '🎲',
51
+ '🌈',
52
+ '🧪',
53
+ '🎪',
54
+ '🎭',
55
+ '🎬',
56
+ '🎤',
57
+ '🎧',
58
+ '🎸',
59
+ '🥁',
60
+ '🔔',
61
+ '💡',
62
+ '🔮',
63
+ '🧭',
64
+ '⏰',
65
+ '📸',
66
+ '🖼️',
67
+ '📚',
68
+ '✏️',
69
+ '🖌️',
70
+ '🧲',
71
+ '⚙️',
72
+ '🛠️',
73
+ '🔧',
74
+ '🧰',
75
+ '🔌',
76
+ '🔋',
77
+ '🌍',
78
+ '🌙',
79
+ '☀️',
80
+ '❄️',
81
+ '🌊',
82
+ '🍄',
83
+ '🌵',
84
+ '🌸',
85
+ '🍎',
86
+ '🍕',
87
+ '🍩',
88
+ '☕',
89
+ '🐳',
90
+ '🦄',
91
+ '🐝'
92
+ ];
93
+ /** Whether `value` is one of the fixed color values (`#rrggbb`, lowercased). */
94
+ export function isManifestColor(value) {
95
+ return MANIFEST_COLORS.some((color) => color.value === value);
96
+ }
97
+ /** Whether `emoji` is one of the fixed emojis. */
98
+ export function isManifestEmoji(emoji) {
99
+ return MANIFEST_EMOJIS.includes(emoji);
100
+ }
101
+ /**
102
+ * Resolve a CLI-supplied color token (either a palette name like `blue` or a
103
+ * hex value like `#3b82f6`, case-insensitively) to its stored hex value, or
104
+ * `null` when it matches no palette entry.
105
+ */
106
+ export function resolveManifestColor(token) {
107
+ const normalized = token.trim().toLowerCase();
108
+ const match = MANIFEST_COLORS.find((color) => color.value === normalized || color.name === normalized);
109
+ return match ? match.value : null;
110
+ }
111
+ /** Why a color value is invalid, as a human-readable message — or `null` when valid. */
112
+ export function manifestColorError(value) {
113
+ if (isManifestColor(value))
114
+ return null;
115
+ return (`"${value}" is not a selectable manifest color — choose one of: ` +
116
+ `${MANIFEST_COLORS.map((color) => `${color.name} (${color.value})`).join(', ')}.`);
117
+ }
118
+ /** Why an emoji is invalid, as a human-readable message — or `null` when valid. */
119
+ export function manifestEmojiError(emoji) {
120
+ if (isManifestEmoji(emoji))
121
+ return null;
122
+ return `"${emoji}" is not a selectable manifest emoji — choose one of: ${MANIFEST_EMOJIS.join(' ')}.`;
123
+ }
@@ -0,0 +1,104 @@
1
+ /**
2
+ * The generated-entry data types shared by codegen (server) and the runtime:
3
+ * exactly what a generated manifest module passes to `createManifest` per
4
+ * asset. Data only — behavior lives in the runtime directory.
5
+ */
6
+ import type { ChromaKeyParameters } from './chroma-key.js';
7
+ import type { Slicing } from './slice-data.js';
8
+ /**
9
+ * Pre-inline manifest-entry data. Reference fields may still contain
10
+ * `{ $asset }` markers; codegen narrows this to `ManifestEntry` after inlining.
11
+ */
12
+ export type ManifestEntryData = {
13
+ kind: string;
14
+ src: string;
15
+ } & Record<string, unknown>;
16
+ export interface ImageManifestEntry {
17
+ kind: 'image';
18
+ /** Delivered proxy URL (`proxyBasePath` + proxy file name). */
19
+ src: string;
20
+ /** Intrinsic pixel dimensions of the delivered proxy. */
21
+ width: number;
22
+ height: number;
23
+ }
24
+ export interface SliceManifestEntry {
25
+ kind: 'slice';
26
+ /** Delivered proxy URL (`proxyBasePath` + proxy file name). */
27
+ src: string;
28
+ slicing: Slicing;
29
+ /** Pixel dimensions of the delivered image the insets are measured in. */
30
+ sourceWidth: number;
31
+ sourceHeight: number;
32
+ }
33
+ export interface VideoManifestEntry {
34
+ kind: 'video';
35
+ /** Delivered proxy URL (`proxyBasePath` + proxy file name). */
36
+ src: string;
37
+ /** Intrinsic pixel dimensions of the delivered proxy. */
38
+ width: number;
39
+ height: number;
40
+ durationMs: number;
41
+ }
42
+ export interface ChromaKeyVideoManifestEntry {
43
+ kind: 'chroma-key-video';
44
+ /** Delivered proxy URL (`proxyBasePath` + proxy file name). */
45
+ src: string;
46
+ /** Intrinsic pixel dimensions of the delivered proxy. */
47
+ width: number;
48
+ height: number;
49
+ durationMs: number;
50
+ chromaKey: ChromaKeyParameters;
51
+ /** Grayscale shape mask — the referenced image's entry, inlined by codegen. */
52
+ mask?: ImageManifestEntry;
53
+ /** WebGL2-unavailable fallback — the referenced image's entry, inlined by codegen. */
54
+ fallback?: ImageManifestEntry;
55
+ }
56
+ export interface AudioManifestEntry {
57
+ kind: 'audio';
58
+ /** Delivered proxy URL (`proxyBasePath` + proxy file name). */
59
+ src: string;
60
+ durationMs: number;
61
+ }
62
+ export type ManifestEntry = ImageManifestEntry | SliceManifestEntry | VideoManifestEntry | ChromaKeyVideoManifestEntry | AudioManifestEntry;
63
+ /** Preload options of the image kind: decode the fetched file up front. */
64
+ export interface ImagePreloadOptions {
65
+ /** Decode via an HTMLImageElement after fetching (default true). */
66
+ decode?: boolean;
67
+ }
68
+ /**
69
+ * Preload options of the slice kind. A slice is image-backed, so it carries
70
+ * the same decode switch — typed per kind (not shared), so kinds can diverge.
71
+ */
72
+ export interface SlicePreloadOptions {
73
+ /** Decode via an HTMLImageElement after fetching (default true). */
74
+ decode?: boolean;
75
+ }
76
+ /**
77
+ * Preload options of the video kind. Retention (full fetch + object URL) is
78
+ * always on — no options yet; the namespaced slot is the API.
79
+ */
80
+ export interface VideoPreloadOptions {
81
+ }
82
+ /**
83
+ * Preload options of the chroma-key-video kind. No options yet; the
84
+ * namespaced slot is the API.
85
+ */
86
+ export interface ChromaKeyVideoPreloadOptions {
87
+ }
88
+ /** Preload options of the audio kind. Retention is always on — no options yet. */
89
+ export interface AudioPreloadOptions {
90
+ }
91
+ /**
92
+ * Options for `Manifest.preload()`, namespaced per asset kind exactly like
93
+ * plugin configuration lives under `plugins.<type>` in `fundus.config.ts`
94
+ *; each kind that has preload options declares its own type here,
95
+ * and adding a kind is purely additive. An option applies to every entry of
96
+ * that kind, including entries reached via the inlined reference closure.
97
+ */
98
+ export interface PreloadOptions {
99
+ image?: ImagePreloadOptions;
100
+ slice?: SlicePreloadOptions;
101
+ video?: VideoPreloadOptions;
102
+ chromaKeyVideo?: ChromaKeyVideoPreloadOptions;
103
+ audio?: AudioPreloadOptions;
104
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Automatic closure membership: a referenced asset is a
3
+ * *passive member* of every manifest its referrer is in — derived from the
4
+ * reference graph, never stored in the library (explicit membership stays the
5
+ * only persisted fact). This is the single place the membership and delivery
6
+ * picture is computed; server processing, codegen, delivered-size accounting,
7
+ * and the editor state payload all consume it — no parallel closure walks.
8
+ */
9
+ import type { AssetId, Library, ManifestName } from './library.js';
10
+ import { type ReferencesByAsset } from './reference-graph.js';
11
+ /** One derived passive membership, with the attribution that explains it. */
12
+ export interface PassiveMember {
13
+ assetId: AssetId;
14
+ /**
15
+ * The explicit members of the manifest whose reference closure contains
16
+ * this asset — the answer to "why is this here". Attribution is to the
17
+ * explicit-member *roots*, so a chain `a → b → c` attributes both `b` and
18
+ * `c` to `a` (sorted, at least one entry).
19
+ */
20
+ via: AssetId[];
21
+ }
22
+ /** One manifest's full membership picture: explicit (stored) + passive (derived). */
23
+ export interface ManifestMembership {
24
+ /** Members stored in the library — the manifest's typed API surface (sorted). */
25
+ explicitMemberIds: AssetId[];
26
+ /**
27
+ * Members derived from the reference graph: in the explicit members'
28
+ * reference closure without being explicit themselves. Delivered and
29
+ * preloaded with the manifest, but inlined-only in the generated module —
30
+ * never a top-level typed property. Sorted by asset id. An asset that is
31
+ * both explicit and referenced is an explicit member, full stop.
32
+ */
33
+ passiveMembers: PassiveMember[];
34
+ /** The delivery set: explicit ∪ passive. */
35
+ deliveredAssetIds: Set<AssetId>;
36
+ }
37
+ /**
38
+ * Membership per manifest name. Covers every name in `library.manifests` plus
39
+ * any name an asset record points at — a record referencing an unknown
40
+ * manifest is a validation error, but delivery semantics must not silently
41
+ * flip on a hand-edited library, so such names still deliver here.
42
+ */
43
+ export type LibraryMembership = Record<ManifestName, ManifestMembership>;
44
+ /**
45
+ * Compute the full membership picture from a library and its collected
46
+ * references: for each manifest the explicit members, the passive members
47
+ * (`referenceClosure(explicit) − explicit`) with their via-attribution, and
48
+ * the resulting delivery set.
49
+ */
50
+ export declare function computeLibraryMembership(library: Library, referencesByAsset: ReferencesByAsset): LibraryMembership;
51
+ /**
52
+ * Every asset delivered by at least one manifest, explicitly or passively —
53
+ * the processing set (assets outside it are inert). An asset is
54
+ * *unreachable* (nothing delivers it) exactly when it is missing here.
55
+ */
56
+ export declare function allDeliveredAssetIds(membership: LibraryMembership): Set<AssetId>;
@@ -0,0 +1,54 @@
1
+ import { compareCodeUnits } from './canonicalize.js';
2
+ import { referenceClosure } from './reference-graph.js';
3
+ /**
4
+ * Compute the full membership picture from a library and its collected
5
+ * references: for each manifest the explicit members, the passive members
6
+ * (`referenceClosure(explicit) − explicit`) with their via-attribution, and
7
+ * the resulting delivery set.
8
+ */
9
+ export function computeLibraryMembership(library, referencesByAsset) {
10
+ const manifestNames = new Set(Object.keys(library.manifests));
11
+ for (const record of Object.values(library.assets)) {
12
+ for (const manifestName of record.manifests)
13
+ manifestNames.add(manifestName);
14
+ }
15
+ const membership = {};
16
+ for (const manifestName of [...manifestNames].sort(compareCodeUnits)) {
17
+ const explicitMemberIds = Object.entries(library.assets)
18
+ .filter(([, record]) => record.manifests.includes(manifestName))
19
+ .map(([assetId]) => assetId)
20
+ .sort(compareCodeUnits);
21
+ const explicitMemberSet = new Set(explicitMemberIds);
22
+ const deliveredAssetIds = new Set(explicitMemberIds);
23
+ const viaByPassiveAssetId = new Map();
24
+ for (const explicitMemberId of explicitMemberIds) {
25
+ for (const reachedAssetId of referenceClosure([explicitMemberId], referencesByAsset)) {
26
+ deliveredAssetIds.add(reachedAssetId);
27
+ if (explicitMemberSet.has(reachedAssetId))
28
+ continue;
29
+ const via = viaByPassiveAssetId.get(reachedAssetId) ?? [];
30
+ // Explicit members iterate sorted, so `via` stays sorted for free.
31
+ via.push(explicitMemberId);
32
+ viaByPassiveAssetId.set(reachedAssetId, via);
33
+ }
34
+ }
35
+ const passiveMembers = [...viaByPassiveAssetId.entries()]
36
+ .map(([assetId, via]) => ({ assetId, via }))
37
+ .sort((a, b) => compareCodeUnits(a.assetId, b.assetId));
38
+ membership[manifestName] = { explicitMemberIds, passiveMembers, deliveredAssetIds };
39
+ }
40
+ return membership;
41
+ }
42
+ /**
43
+ * Every asset delivered by at least one manifest, explicitly or passively —
44
+ * the processing set (assets outside it are inert). An asset is
45
+ * *unreachable* (nothing delivers it) exactly when it is missing here.
46
+ */
47
+ export function allDeliveredAssetIds(membership) {
48
+ const delivered = new Set();
49
+ for (const manifestMembership of Object.values(membership)) {
50
+ for (const assetId of manifestMembership.deliveredAssetIds)
51
+ delivered.add(assetId);
52
+ }
53
+ return delivered;
54
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Audio plugin (core part): a raw audio file delivered as one transcoded
3
+ * proxy. Fundus delivers URLs + metadata only — playback belongs to the host's
4
+ * audio engine, so there is no runtime component; the typed handle
5
+ * is the `AudioManifestEntry` itself.
6
+ */
7
+ import type { AssetTypePluginDescriptor } from './contract.js';
8
+ export interface AudioPreset {
9
+ codec: 'opus' | 'aac';
10
+ /** Target bitrate in kilobits per second (`-b:a`). */
11
+ bitrateKbps: number;
12
+ container: 'webm' | 'm4a';
13
+ }
14
+ export interface AudioPluginConfig {
15
+ /** Named presets; merged over the built-in defaults. */
16
+ presets?: Record<string, AudioPreset>;
17
+ }
18
+ export interface AudioParameters {
19
+ /** Preset name, resolved against the audio plugin config's presets. */
20
+ preset: string;
21
+ }
22
+ /** Built-in presets, always available; host config merges over them. */
23
+ export declare const AUDIO_BUILT_IN_PRESETS: Record<string, AudioPreset>;
24
+ export declare function validateAudioPreset(name: string, value: unknown): AudioPreset;
25
+ export declare const AUDIO_EXTENSIONS: readonly string[];
26
+ export declare const audioPlugin: AssetTypePluginDescriptor<AudioParameters, AudioPluginConfig>;