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.
- package/README.md +58 -0
- package/build/client/_app/immutable/assets/0.DLhIsYA_.css.br +0 -0
- package/build/client/_app/immutable/assets/0.DLhIsYA_.css.gz +0 -0
- package/build/client/_app/immutable/assets/2.wavcNhPC.css +1 -0
- package/build/client/_app/immutable/assets/2.wavcNhPC.css.br +0 -0
- package/build/client/_app/immutable/assets/2.wavcNhPC.css.gz +0 -0
- package/build/client/_app/immutable/assets/3.Cjh_fXPY.css +1 -0
- package/build/client/_app/immutable/assets/3.Cjh_fXPY.css.br +0 -0
- package/build/client/_app/immutable/assets/3.Cjh_fXPY.css.gz +0 -0
- package/build/client/_app/immutable/assets/4.p004hmEN.css +1 -0
- package/build/client/_app/immutable/assets/4.p004hmEN.css.br +0 -0
- package/build/client/_app/immutable/assets/4.p004hmEN.css.gz +0 -0
- package/build/client/_app/immutable/assets/ConfirmDialog.BdKlitwi.css +1 -0
- package/build/client/_app/immutable/assets/ConfirmDialog.BdKlitwi.css.br +0 -0
- package/build/client/_app/immutable/assets/ConfirmDialog.BdKlitwi.css.gz +0 -0
- package/build/client/_app/immutable/assets/LibraryContextMenu.zyZtpKzC.css +1 -0
- package/build/client/_app/immutable/assets/LibraryContextMenu.zyZtpKzC.css.br +0 -0
- package/build/client/_app/immutable/assets/LibraryContextMenu.zyZtpKzC.css.gz +0 -0
- package/build/client/_app/immutable/chunks/BiIto6ft.js +1 -0
- package/build/client/_app/immutable/chunks/BiIto6ft.js.br +0 -0
- package/build/client/_app/immutable/chunks/BiIto6ft.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Bjy-W4x2.js.br +0 -0
- package/build/client/_app/immutable/chunks/Bjy-W4x2.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CNRz3sSw.js.br +0 -0
- package/build/client/_app/immutable/chunks/CNRz3sSw.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CO4RBJfa.js.br +0 -0
- package/build/client/_app/immutable/chunks/CO4RBJfa.js.gz +0 -0
- package/{dist/editor/_app/immutable/chunks/DjvOiDmq.js → build/client/_app/immutable/chunks/CvY6YsFE.js} +1 -1
- package/build/client/_app/immutable/chunks/CvY6YsFE.js.br +0 -0
- package/build/client/_app/immutable/chunks/CvY6YsFE.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DL0_39Ys.js +5 -0
- package/build/client/_app/immutable/chunks/DL0_39Ys.js.br +0 -0
- package/build/client/_app/immutable/chunks/DL0_39Ys.js.gz +0 -0
- package/{dist/editor/_app/immutable/chunks/BfPE5wdt.js → build/client/_app/immutable/chunks/DQ8SXFaX.js} +1 -1
- package/build/client/_app/immutable/chunks/DQ8SXFaX.js.br +0 -0
- package/build/client/_app/immutable/chunks/DQ8SXFaX.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DjdrdRzT.js.br +0 -0
- package/build/client/_app/immutable/chunks/DjdrdRzT.js.gz +0 -0
- package/build/client/_app/immutable/chunks/xihTtKlq.js.br +1 -0
- package/build/client/_app/immutable/chunks/xihTtKlq.js.gz +0 -0
- package/{dist/editor/_app/immutable/entry/app.BkqbfI8n.js → build/client/_app/immutable/entry/app.ubN0v9bN.js} +2 -2
- package/build/client/_app/immutable/entry/app.ubN0v9bN.js.br +0 -0
- package/build/client/_app/immutable/entry/app.ubN0v9bN.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.BW8dBDh6.js +1 -0
- package/build/client/_app/immutable/entry/start.BW8dBDh6.js.br +0 -0
- package/build/client/_app/immutable/entry/start.BW8dBDh6.js.gz +0 -0
- package/{dist/editor/_app/immutable/nodes/0.xdMI5GEU.js → build/client/_app/immutable/nodes/0.Dr5ijCIl.js} +1 -1
- package/build/client/_app/immutable/nodes/0.Dr5ijCIl.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.Dr5ijCIl.js.gz +0 -0
- package/{dist/editor/_app/immutable/nodes/1.D9p2tfoJ.js → build/client/_app/immutable/nodes/1.DiIGIRAb.js} +1 -1
- package/build/client/_app/immutable/nodes/1.DiIGIRAb.js.br +3 -0
- package/build/client/_app/immutable/nodes/1.DiIGIRAb.js.gz +0 -0
- package/{dist/editor/_app/immutable/nodes/2.BrA0Hyzu.js → build/client/_app/immutable/nodes/2.B8KYmQcV.js} +3 -3
- package/build/client/_app/immutable/nodes/2.B8KYmQcV.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.B8KYmQcV.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.B1jc7arT.js +104 -0
- package/build/client/_app/immutable/nodes/3.B1jc7arT.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.B1jc7arT.js.gz +0 -0
- package/build/client/_app/immutable/nodes/4.BPK9n1mH.js +2 -0
- package/build/client/_app/immutable/nodes/4.BPK9n1mH.js.br +0 -0
- package/build/client/_app/immutable/nodes/4.BPK9n1mH.js.gz +0 -0
- package/build/client/_app/version.json +1 -0
- package/build/client/_app/version.json.br +0 -0
- package/build/client/_app/version.json.gz +0 -0
- package/build/env.js +100 -0
- package/build/env.js.map +1 -0
- package/build/handler.js +22 -0
- package/build/handler.js.map +1 -0
- package/build/index.js +145 -0
- package/build/index.js.map +1 -0
- package/build/server/chunks/chunks/context.js-Bw4WWLhG.js +443 -0
- package/build/server/chunks/chunks/context.js-Bw4WWLhG.js.map +1 -0
- package/build/server/chunks/chunks/core.js-DDntpb72.js +409 -0
- package/build/server/chunks/chunks/core.js-DDntpb72.js.map +1 -0
- package/build/server/chunks/chunks/env.js-l0sNRNKZ.js +2 -0
- package/build/server/chunks/chunks/env.js-l0sNRNKZ.js.map +1 -0
- package/build/server/chunks/chunks/exports.js-CLTzaOxn.js +152 -0
- package/build/server/chunks/chunks/exports.js-CLTzaOxn.js.map +1 -0
- package/build/server/chunks/chunks/folder-path.js-ytx9ucgg.js +64 -0
- package/build/server/chunks/chunks/folder-path.js-ytx9ucgg.js.map +1 -0
- package/build/server/chunks/chunks/http.js-Dxoa-jtP.js +100 -0
- package/build/server/chunks/chunks/http.js-Dxoa-jtP.js.map +1 -0
- package/build/server/chunks/chunks/internal.js-BDBSzJId.js +5753 -0
- package/build/server/chunks/chunks/internal.js-BDBSzJId.js.map +1 -0
- package/build/server/chunks/chunks/internal2.js-BlXt2rfE.js +22 -0
- package/build/server/chunks/chunks/internal2.js-BlXt2rfE.js.map +1 -0
- package/{dist/operations-DYM-5KVl.js → build/server/chunks/chunks/library-store.js-BP8cL-qD.js} +344 -444
- package/build/server/chunks/chunks/library-store.js-BP8cL-qD.js.map +1 -0
- package/build/server/chunks/chunks/manifest-appearance.js-DTk355LQ.js +146 -0
- package/build/server/chunks/chunks/manifest-appearance.js-DTk355LQ.js.map +1 -0
- package/build/server/chunks/chunks/routing.js-y-tryuip.js +213 -0
- package/build/server/chunks/chunks/routing.js-y-tryuip.js.map +1 -0
- package/build/server/chunks/chunks/shared.js-BWXgl1Xf.js +255 -0
- package/build/server/chunks/chunks/shared.js-BWXgl1Xf.js.map +1 -0
- package/build/server/chunks/chunks/utils.js-9oI5Oz0w.js +1048 -0
- package/build/server/chunks/chunks/utils.js-9oI5Oz0w.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/_...path_/_server.ts.js-WknZVW_S.js +27 -0
- package/build/server/chunks/entries/endpoints/api/_...path_/_server.ts.js-WknZVW_S.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/assets/_id_/_server.ts.js-BrZ__-HZ.js +24 -0
- package/build/server/chunks/entries/endpoints/api/assets/_id_/_server.ts.js-BrZ__-HZ.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/assets/_server.ts.js-PqADGPXc.js +45 -0
- package/build/server/chunks/entries/endpoints/api/assets/_server.ts.js-PqADGPXc.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/assets/delete/_server.ts.js-OqoE5PN-.js +31 -0
- package/build/server/chunks/entries/endpoints/api/assets/delete/_server.ts.js-OqoE5PN-.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/assets/move/_server.ts.js-CJ08e1ho.js +31 -0
- package/build/server/chunks/entries/endpoints/api/assets/move/_server.ts.js-CJ08e1ho.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/folders/_path_/_server.ts.js-DdF3eK2I.js +38 -0
- package/build/server/chunks/entries/endpoints/api/folders/_path_/_server.ts.js-DdF3eK2I.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/folders/_server.ts.js-Cxt6jsJ5.js +31 -0
- package/build/server/chunks/entries/endpoints/api/folders/_server.ts.js-Cxt6jsJ5.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/manifests/_name_/_server.ts.js-BWVM2Ntl.js +24 -0
- package/build/server/chunks/entries/endpoints/api/manifests/_name_/_server.ts.js-BWVM2Ntl.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/manifests/_server.ts.js-Z2bM-qHM.js +31 -0
- package/build/server/chunks/entries/endpoints/api/manifests/_server.ts.js-Z2bM-qHM.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/state/_server.ts.js-BX9H2Z34.js +24 -0
- package/build/server/chunks/entries/endpoints/api/state/_server.ts.js-BX9H2Z34.js.map +1 -0
- package/build/server/chunks/entries/endpoints/files/_...path_/_server.ts.js-BWHDZ8mz.js +27 -0
- package/build/server/chunks/entries/endpoints/files/_...path_/_server.ts.js-BWHDZ8mz.js.map +1 -0
- package/build/server/chunks/entries/endpoints/files/proxy/_...path_/_server.ts.js-CR_7mndO.js +24 -0
- package/build/server/chunks/entries/endpoints/files/proxy/_...path_/_server.ts.js-CR_7mndO.js.map +1 -0
- package/build/server/chunks/entries/endpoints/files/raw/_...path_/_server.ts.js-Cw1PDBvb.js +24 -0
- package/build/server/chunks/entries/endpoints/files/raw/_...path_/_server.ts.js-Cw1PDBvb.js.map +1 -0
- package/build/server/chunks/entries/hooks.server.js-BHoE0yBi.js +23 -0
- package/build/server/chunks/entries/hooks.server.js-BHoE0yBi.js.map +1 -0
- package/build/server/chunks/handler-10cx4zHn.js +1475 -0
- package/build/server/chunks/handler-10cx4zHn.js.map +1 -0
- package/build/server/chunks/index.js-DvPfiC00.js +3789 -0
- package/build/server/chunks/index.js-DvPfiC00.js.map +1 -0
- package/build/server/chunks/manifest.js-DoPjUnzD.js +149 -0
- package/build/server/chunks/manifest.js-DoPjUnzD.js.map +1 -0
- package/build/server/chunks/nodes/0.js-Di3qgAtW.js +11 -0
- package/build/server/chunks/nodes/0.js-Di3qgAtW.js.map +1 -0
- package/build/server/chunks/nodes/1.js-BlWSFIA8.js +7 -0
- package/build/server/chunks/nodes/1.js-BlWSFIA8.js.map +1 -0
- package/build/server/chunks/nodes/2.js-CO9nSPUN.js +7 -0
- package/build/server/chunks/nodes/2.js-CO9nSPUN.js.map +1 -0
- package/build/server/chunks/nodes/3.js-C2D6xpEO.js +7 -0
- package/build/server/chunks/nodes/3.js-C2D6xpEO.js.map +1 -0
- package/build/server/chunks/nodes/4.js-B3IuagJW.js +7 -0
- package/build/server/chunks/nodes/4.js-B3IuagJW.js.map +1 -0
- package/build/shims.js +33 -0
- package/build/shims.js.map +1 -0
- package/dist/cli.d.ts +2 -1
- package/dist/cli.js +109 -1332
- package/dist/config.d.ts +3 -2
- package/dist/config.js +2 -2
- package/dist/core/api-types.d.ts +141 -0
- package/dist/core/api-types.js +1 -0
- package/dist/core/asset-id.d.ts +28 -0
- package/dist/core/asset-id.js +59 -0
- package/dist/core/asset-reference.d.ts +23 -0
- package/dist/core/asset-reference.js +15 -0
- package/dist/core/canonicalize.d.ts +9 -0
- package/dist/core/canonicalize.js +36 -0
- package/dist/core/chroma-key.d.ts +30 -0
- package/dist/core/chroma-key.js +55 -0
- package/dist/core/config.d.ts +35 -0
- package/dist/core/config.js +4 -0
- package/dist/core/folder-path.d.ts +19 -0
- package/dist/core/folder-path.js +86 -0
- package/dist/core/index.d.ts +33 -499
- package/dist/core/index.js +17 -962
- package/dist/core/ingest.d.ts +18 -0
- package/dist/core/ingest.js +58 -0
- package/dist/core/library.d.ts +54 -0
- package/dist/core/library.js +138 -0
- package/dist/core/manifest-appearance.d.ts +35 -0
- package/dist/core/manifest-appearance.js +123 -0
- package/dist/core/manifest-entry.d.ts +104 -0
- package/dist/core/manifest-entry.js +1 -0
- package/dist/core/manifest-membership.d.ts +56 -0
- package/dist/core/manifest-membership.js +54 -0
- package/dist/core/plugins/audio.d.ts +26 -0
- package/dist/core/plugins/audio.js +44 -0
- package/dist/core/plugins/chroma-key-video.d.ts +29 -0
- package/dist/core/plugins/chroma-key-video.js +69 -0
- package/dist/core/plugins/contract.d.ts +35 -0
- package/dist/core/plugins/contract.js +1 -0
- package/dist/core/plugins/image.d.ts +30 -0
- package/dist/core/plugins/image.js +45 -0
- package/dist/core/plugins/slice.d.ts +22 -0
- package/dist/core/plugins/slice.js +60 -0
- package/dist/core/plugins/video.d.ts +45 -0
- package/dist/core/plugins/video.js +77 -0
- package/dist/core/reference-graph.d.ts +41 -0
- package/dist/core/reference-graph.js +138 -0
- package/dist/core/slice-data.d.ts +61 -0
- package/dist/core/slice-data.js +49 -0
- package/dist/runtime/chroma-key-gl.d.ts +40 -22
- package/dist/runtime/chroma-key-gl.js +189 -183
- package/dist/runtime/components/ChromaKeyVideo.svelte +3 -3
- package/dist/runtime/components/ChromaKeyVideo.svelte.d.ts +21 -0
- package/dist/runtime/components/Image.svelte +1 -1
- package/dist/runtime/components/Image.svelte.d.ts +9 -0
- package/dist/runtime/components/Slice.svelte +1 -1
- package/dist/runtime/components/Slice.svelte.d.ts +19 -0
- package/dist/runtime/components/SliceCanvas.svelte +3 -3
- package/dist/runtime/components/SliceCanvas.svelte.d.ts +10 -0
- package/dist/runtime/components/SliceDom.svelte +3 -3
- package/dist/runtime/components/SliceDom.svelte.d.ts +10 -0
- package/dist/runtime/components/Video.svelte +2 -2
- package/dist/runtime/components/Video.svelte.d.ts +18 -0
- package/dist/runtime/geometry.d.ts +55 -35
- package/dist/runtime/geometry.js +186 -191
- package/dist/runtime/index.d.ts +9 -9
- package/dist/runtime/index.js +9 -9
- package/dist/runtime/kind-handlers.d.ts +33 -24
- package/dist/runtime/kind-handlers.js +74 -65
- package/dist/runtime/manifest.d.ts +53 -47
- package/dist/runtime/manifest.js +133 -113
- package/dist/runtime/observe-border-box-size.d.ts +1 -4
- package/dist/runtime/observe-border-box-size.js +9 -10
- package/dist/runtime/preload-registry.d.ts +22 -8
- package/dist/runtime/preload-registry.js +65 -62
- package/dist/server/build.d.ts +8 -0
- package/dist/server/build.js +25 -0
- package/dist/server/check.d.ts +24 -0
- package/dist/server/check.js +199 -0
- package/dist/server/cli-commands.d.ts +25 -0
- package/dist/server/cli-commands.js +1178 -0
- package/dist/server/cli-init.d.ts +3 -0
- package/dist/server/cli-init.js +53 -0
- package/dist/server/cli-io.d.ts +46 -0
- package/dist/server/cli-io.js +105 -0
- package/dist/server/codegen.d.ts +58 -0
- package/dist/server/codegen.js +185 -0
- package/dist/server/config-loader.d.ts +34 -0
- package/dist/server/config-loader.js +103 -0
- package/dist/server/context.d.ts +8 -0
- package/dist/server/context.js +19 -0
- package/dist/server/folder-filesystem.d.ts +7 -0
- package/dist/server/folder-filesystem.js +39 -0
- package/dist/server/http.d.ts +12 -0
- package/dist/server/http.js +100 -0
- package/dist/server/index.d.ts +16 -0
- package/dist/server/index.js +9 -0
- package/dist/server/job-hash.d.ts +10 -0
- package/dist/server/job-hash.js +23 -0
- package/dist/server/library-store.d.ts +82 -0
- package/dist/server/library-store.js +763 -0
- package/dist/server/operations.d.ts +87 -0
- package/dist/server/operations.js +427 -0
- package/dist/server/plugins/audio.d.ts +7 -0
- package/dist/server/plugins/audio.js +27 -0
- package/dist/server/plugins/chroma-key-video.d.ts +9 -0
- package/dist/server/plugins/chroma-key-video.js +38 -0
- package/dist/server/plugins/contract.d.ts +100 -0
- package/dist/server/plugins/contract.js +16 -0
- package/dist/server/plugins/image.d.ts +8 -0
- package/dist/server/plugins/image.js +30 -0
- package/dist/server/plugins/slice.d.ts +14 -0
- package/dist/server/plugins/slice.js +63 -0
- package/dist/server/plugins/video.d.ts +6 -0
- package/dist/server/plugins/video.js +29 -0
- package/dist/server/plugins.d.ts +23 -0
- package/dist/server/plugins.js +33 -0
- package/dist/server/processing/audio-processing.d.ts +17 -0
- package/dist/server/processing/audio-processing.js +46 -0
- package/dist/server/processing/ffmpeg.d.ts +9 -0
- package/dist/server/processing/ffmpeg.js +50 -0
- package/dist/server/processing/image-processing.d.ts +16 -0
- package/dist/server/processing/image-processing.js +26 -0
- package/dist/server/processing/media-probe.d.ts +15 -0
- package/dist/server/processing/media-probe.js +27 -0
- package/dist/server/processing/processor.d.ts +50 -0
- package/dist/server/processing/processor.js +158 -0
- package/dist/server/processing/video-processing.d.ts +35 -0
- package/dist/server/processing/video-processing.js +87 -0
- package/dist/server/server.d.ts +13 -0
- package/dist/server/server.js +57 -0
- package/dist/server/start.d.ts +1 -0
- package/dist/server/start.js +33 -0
- package/package.json +29 -16
- package/dist/build-CZYFLLvl.js +0 -191
- package/dist/core/image-Dqmz8FXS.js +0 -54
- package/dist/core/reference-graph-CjuHbLDw.d.ts +0 -280
- package/dist/core/testing.d.ts +0 -27
- package/dist/core/testing.js +0 -80
- package/dist/editor/200.html +0 -37
- package/dist/editor/_app/immutable/assets/2.DIbbW7U1.css +0 -1
- package/dist/editor/_app/immutable/assets/3.C-9vFQ9A.css +0 -1
- package/dist/editor/_app/immutable/assets/4.BS8ElpOV.css +0 -1
- package/dist/editor/_app/immutable/assets/ConfirmDialog.CHEISE-L.css +0 -1
- package/dist/editor/_app/immutable/assets/LibraryContextMenu.CDjCmdV-.css +0 -1
- package/dist/editor/_app/immutable/chunks/Cx6qtxJg.js +0 -1
- package/dist/editor/_app/immutable/chunks/n7mvYc42.js +0 -5
- package/dist/editor/_app/immutable/entry/start.C8HHOLly.js +0 -1
- package/dist/editor/_app/immutable/nodes/3.WO7tZH_d.js +0 -104
- package/dist/editor/_app/immutable/nodes/4.DQtx17aW.js +0 -2
- package/dist/editor/_app/version.json +0 -1
- package/dist/index.d.ts +0 -370
- package/dist/index.js +0 -4
- package/dist/start-Bhnqt9Dc.js +0 -279
- package/dist/start-D2IXOrni.js +0 -2
- /package/{dist/editor → build/client}/_app/immutable/assets/0.DLhIsYA_.css +0 -0
- /package/{dist/editor → build/client}/_app/immutable/chunks/Bjy-W4x2.js +0 -0
- /package/{dist/editor → build/client}/_app/immutable/chunks/CNRz3sSw.js +0 -0
- /package/{dist/editor → build/client}/_app/immutable/chunks/CO4RBJfa.js +0 -0
- /package/{dist/editor → build/client}/_app/immutable/chunks/DjdrdRzT.js +0 -0
- /package/{dist/editor → build/client}/_app/immutable/chunks/xihTtKlq.js +0 -0
package/dist/config.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
1
|
+
/** Node-safe configuration helpers for `fundus.config.ts`. */
|
|
2
|
+
export { defineConfig } from './core/index.js';
|
|
3
|
+
export type { FundusConfig } from './core/index.js';
|
package/dist/config.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export { defineConfig };
|
|
1
|
+
/** Node-safe configuration helpers for `fundus.config.ts`. */
|
|
2
|
+
export { defineConfig } from './core/index.js';
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared derived-state and dev-server REST API types. They live in core so the
|
|
3
|
+
* editor stays typed without depending on the Node-only server package.
|
|
4
|
+
*/
|
|
5
|
+
import type { Library } from './library.js';
|
|
6
|
+
/** One end of a reference edge: the parameter field and the asset across it. */
|
|
7
|
+
export interface AssetReferenceLinkDto {
|
|
8
|
+
/** Dot-path of the referrer's parameter field holding the reference. */
|
|
9
|
+
field: string;
|
|
10
|
+
/** The asset on the other side: the target (outgoing) or the referrer (incoming). */
|
|
11
|
+
assetId: string;
|
|
12
|
+
}
|
|
13
|
+
/** An asset's reference edges in both directions. */
|
|
14
|
+
export interface AssetReferencesDto {
|
|
15
|
+
outgoing: AssetReferenceLinkDto[];
|
|
16
|
+
incoming: AssetReferenceLinkDto[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* One derived passive membership of an asset: the manifest it
|
|
20
|
+
* is pulled into and the explicit-member roots whose reference closure pulls
|
|
21
|
+
* it in ("via characterGreenscreen" — the editor's attribution).
|
|
22
|
+
*/
|
|
23
|
+
export interface PassiveManifestMembershipDto {
|
|
24
|
+
manifest: string;
|
|
25
|
+
via: string[];
|
|
26
|
+
}
|
|
27
|
+
/** One passive member of a manifest, with explicit-root attribution. */
|
|
28
|
+
export interface PassiveMemberDto {
|
|
29
|
+
assetId: string;
|
|
30
|
+
via: string[];
|
|
31
|
+
}
|
|
32
|
+
/** One manifest's membership picture for the manifests view. */
|
|
33
|
+
export interface ManifestMembershipDto {
|
|
34
|
+
/** Members stored in the library — the manifest's typed API surface. */
|
|
35
|
+
explicitMemberIds: string[];
|
|
36
|
+
/** Members derived from the reference graph, with via-attribution. */
|
|
37
|
+
passiveMembers: PassiveMemberDto[];
|
|
38
|
+
}
|
|
39
|
+
/** One asset's derived, display-ready status alongside the raw library record. */
|
|
40
|
+
export interface AssetStateDto {
|
|
41
|
+
id: string;
|
|
42
|
+
type: string;
|
|
43
|
+
/** Raw file name (relative to the raw dir). */
|
|
44
|
+
raw: string;
|
|
45
|
+
/** Explicit folder path, or the empty string for the implicit root. */
|
|
46
|
+
folder: string;
|
|
47
|
+
/** URL the Fundus server serves the raw file under (`/files/raw/<fileName>`). */
|
|
48
|
+
rawUrl: string;
|
|
49
|
+
rawHash: string;
|
|
50
|
+
parameters: unknown;
|
|
51
|
+
manifests: string[];
|
|
52
|
+
/** Derived passive memberships with attribution, sorted by manifest name. */
|
|
53
|
+
passiveManifests: PassiveManifestMembershipDto[];
|
|
54
|
+
/** Delivered proxy status; `null` while the asset is not delivered or unprocessed. */
|
|
55
|
+
proxy: ProxyStateDto | null;
|
|
56
|
+
/** Human-readable warnings: unreachable asset, stale proxy, validation problems. */
|
|
57
|
+
warnings: string[];
|
|
58
|
+
/** Reference edges in both directions (empty lists for reference-free types). */
|
|
59
|
+
references: AssetReferencesDto;
|
|
60
|
+
}
|
|
61
|
+
export interface ProxyStateDto {
|
|
62
|
+
/** Basename of the proxy file. */
|
|
63
|
+
fileName: string;
|
|
64
|
+
/** Path relative to proxyDir, including the mirrored asset folder. */
|
|
65
|
+
relativePath: string;
|
|
66
|
+
/** URL the Fundus server serves the proxy under (`/files/proxy/<fileName>`). */
|
|
67
|
+
url: string;
|
|
68
|
+
/** Whether the file named by the current job hash exists. */
|
|
69
|
+
upToDate: boolean;
|
|
70
|
+
/** Intrinsic pixel dimensions; absent for audio proxies. */
|
|
71
|
+
width?: number;
|
|
72
|
+
height?: number;
|
|
73
|
+
/** Media duration; present for video and audio proxies. */
|
|
74
|
+
durationMs?: number;
|
|
75
|
+
fileSize: number;
|
|
76
|
+
}
|
|
77
|
+
/** The full editor state payload returned by `GET /api/state` and every mutation. */
|
|
78
|
+
export interface FundusStateDto {
|
|
79
|
+
library: Library;
|
|
80
|
+
assets: AssetStateDto[];
|
|
81
|
+
/** Library-level validation issues (per asset where attributable). */
|
|
82
|
+
issues: ValidationIssueDto[];
|
|
83
|
+
/** Available preset names per asset type (from the merged plugin config). */
|
|
84
|
+
presetNames: Record<string, string[]>;
|
|
85
|
+
/** Per manifest: explicit + passive member lists (the manifests view data). */
|
|
86
|
+
manifestMemberships: Record<string, ManifestMembershipDto>;
|
|
87
|
+
/**
|
|
88
|
+
* Delivered bytes per manifest over its full delivery set (explicit ∪
|
|
89
|
+
* passive members), deduplicated — the preload-budget number.
|
|
90
|
+
*/
|
|
91
|
+
manifestDeliveredBytes: Record<string, number>;
|
|
92
|
+
}
|
|
93
|
+
export interface ValidationIssueDto {
|
|
94
|
+
assetId?: string;
|
|
95
|
+
message: string;
|
|
96
|
+
}
|
|
97
|
+
/** Body of `PATCH /api/assets/:id` — all fields optional, applied together. */
|
|
98
|
+
export interface PatchAssetRequestDto {
|
|
99
|
+
parameters?: unknown;
|
|
100
|
+
manifests?: string[];
|
|
101
|
+
renameTo?: string;
|
|
102
|
+
/** Move the asset to this registered folder; empty string means root. */
|
|
103
|
+
folder?: string;
|
|
104
|
+
}
|
|
105
|
+
export interface CreateFolderRequestDto {
|
|
106
|
+
path: string;
|
|
107
|
+
}
|
|
108
|
+
export interface PatchFolderRequestDto {
|
|
109
|
+
/** Replacement name for the final path segment. */
|
|
110
|
+
name?: string;
|
|
111
|
+
/** Move the folder below this registered parent; empty string means root. */
|
|
112
|
+
parent?: string;
|
|
113
|
+
}
|
|
114
|
+
export interface MoveAssetsRequestDto {
|
|
115
|
+
assetIds: string[];
|
|
116
|
+
/** Registered destination folder; empty string means root. */
|
|
117
|
+
folder: string;
|
|
118
|
+
}
|
|
119
|
+
export interface DeleteAssetsRequestDto {
|
|
120
|
+
assetIds: string[];
|
|
121
|
+
}
|
|
122
|
+
/** Body of `POST /api/manifests`. */
|
|
123
|
+
export interface CreateManifestRequestDto {
|
|
124
|
+
name: string;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Body of `PATCH /api/manifests/:name` — the manifest's editor appearance
|
|
128
|
+
* and/or a rename. A `null` clears that field; an omitted field is left
|
|
129
|
+
* unchanged.
|
|
130
|
+
*/
|
|
131
|
+
export interface PatchManifestRequestDto {
|
|
132
|
+
color?: string | null;
|
|
133
|
+
emoji?: string | null;
|
|
134
|
+
renameTo?: string;
|
|
135
|
+
}
|
|
136
|
+
/** Error payload for non-2xx API responses. */
|
|
137
|
+
export interface ApiErrorDto {
|
|
138
|
+
error: {
|
|
139
|
+
message: string;
|
|
140
|
+
};
|
|
141
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asset ids are the SSOT keys and the generated property names on manifests
|
|
3
|
+
* are stable, human-readable camelCase slugs that must be valid JS
|
|
4
|
+
* identifiers and must not collide with `Manifest` class members.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Names an asset id may never take: current and future members of the runtime
|
|
8
|
+
* `Manifest` class (entries become direct properties on it), plus inherited
|
|
9
|
+
* `Object.prototype` members that would shadow-collide, plus keys that are
|
|
10
|
+
* prototype-pollution hazards when used as record keys (`prototype`;
|
|
11
|
+
* `__proto__` already fails the camelCase pattern).
|
|
12
|
+
*/
|
|
13
|
+
export declare const RESERVED_ASSET_IDS: readonly string[];
|
|
14
|
+
/**
|
|
15
|
+
* Whether `id` is a valid asset id: a camelCase JS identifier (lowercase
|
|
16
|
+
* letter, then letters/digits) that is not a reserved `Manifest` member name.
|
|
17
|
+
*/
|
|
18
|
+
export declare function isValidAssetId(id: string): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Why an id is invalid, as a human-readable message — or `null` when valid.
|
|
21
|
+
* Lets the editor and the validator surface the precise reason.
|
|
22
|
+
*/
|
|
23
|
+
export declare function assetIdError(id: string): string | null;
|
|
24
|
+
/**
|
|
25
|
+
* Manifest names deliberately share the asset-id grammar because each name
|
|
26
|
+
* becomes a generated JavaScript module export.
|
|
27
|
+
*/
|
|
28
|
+
export declare function manifestNameError(name: string): string | null;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asset ids are the SSOT keys and the generated property names on manifests
|
|
3
|
+
* are stable, human-readable camelCase slugs that must be valid JS
|
|
4
|
+
* identifiers and must not collide with `Manifest` class members.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Names an asset id may never take: current and future members of the runtime
|
|
8
|
+
* `Manifest` class (entries become direct properties on it), plus inherited
|
|
9
|
+
* `Object.prototype` members that would shadow-collide, plus keys that are
|
|
10
|
+
* prototype-pollution hazards when used as record keys (`prototype`;
|
|
11
|
+
* `__proto__` already fails the camelCase pattern).
|
|
12
|
+
*/
|
|
13
|
+
export const RESERVED_ASSET_IDS = [
|
|
14
|
+
'preload',
|
|
15
|
+
'release',
|
|
16
|
+
'entries',
|
|
17
|
+
'constructor',
|
|
18
|
+
'prototype',
|
|
19
|
+
'hasOwnProperty',
|
|
20
|
+
'isPrototypeOf',
|
|
21
|
+
'propertyIsEnumerable',
|
|
22
|
+
'toLocaleString',
|
|
23
|
+
'toString',
|
|
24
|
+
'valueOf'
|
|
25
|
+
];
|
|
26
|
+
const ASSET_ID_PATTERN = /^[a-z][A-Za-z0-9]*$/;
|
|
27
|
+
/**
|
|
28
|
+
* Whether `id` is a valid asset id: a camelCase JS identifier (lowercase
|
|
29
|
+
* letter, then letters/digits) that is not a reserved `Manifest` member name.
|
|
30
|
+
*/
|
|
31
|
+
export function isValidAssetId(id) {
|
|
32
|
+
return ASSET_ID_PATTERN.test(id) && !RESERVED_ASSET_IDS.includes(id);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Why an id is invalid, as a human-readable message — or `null` when valid.
|
|
36
|
+
* Lets the editor and the validator surface the precise reason.
|
|
37
|
+
*/
|
|
38
|
+
export function assetIdError(id) {
|
|
39
|
+
if (!ASSET_ID_PATTERN.test(id)) {
|
|
40
|
+
return `"${id}" is not a valid asset id — use a camelCase identifier starting with a lowercase letter (e.g. "navigationPanel").`;
|
|
41
|
+
}
|
|
42
|
+
if (RESERVED_ASSET_IDS.includes(id)) {
|
|
43
|
+
return `"${id}" is reserved (it collides with a Manifest member name).`;
|
|
44
|
+
}
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Manifest names deliberately share the asset-id grammar because each name
|
|
49
|
+
* becomes a generated JavaScript module export.
|
|
50
|
+
*/
|
|
51
|
+
export function manifestNameError(name) {
|
|
52
|
+
if (!ASSET_ID_PATTERN.test(name)) {
|
|
53
|
+
return `"${name}" is not a valid manifest name — use a camelCase identifier starting with a lowercase letter (e.g. "mainCatalog").`;
|
|
54
|
+
}
|
|
55
|
+
if (RESERVED_ASSET_IDS.includes(name)) {
|
|
56
|
+
return `"${name}" is reserved (it collides with a Manifest member name).`;
|
|
57
|
+
}
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The asset-reference schema primitive: a plugin parameter field may
|
|
3
|
+
* point at another asset, written as `{ "$asset": "<id>" }` in the library
|
|
4
|
+
* JSON. References keep type-specific composition out of the core — a plugin
|
|
5
|
+
* declares *which* of its fields are references (`collectReferences` on the
|
|
6
|
+
* plugin contract); the core only knows "this asset points at that asset".
|
|
7
|
+
*/
|
|
8
|
+
/** The in-library shape of a reference: `{ "$asset": "characterIdleMask" }`. */
|
|
9
|
+
export interface AssetReference {
|
|
10
|
+
$asset: string;
|
|
11
|
+
}
|
|
12
|
+
/** Whether a value is a well-formed asset-reference marker. */
|
|
13
|
+
export declare function isAssetReference(value: unknown): value is AssetReference;
|
|
14
|
+
/**
|
|
15
|
+
* One reference a plugin found in an asset's parameters. `field` is the
|
|
16
|
+
* dot-path of the parameter field holding the reference (for messages);
|
|
17
|
+
* `expectedTypes` constrains the target's asset type (empty = any type).
|
|
18
|
+
*/
|
|
19
|
+
export interface CollectedReference {
|
|
20
|
+
field: string;
|
|
21
|
+
assetId: string;
|
|
22
|
+
expectedTypes: readonly string[];
|
|
23
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The asset-reference schema primitive: a plugin parameter field may
|
|
3
|
+
* point at another asset, written as `{ "$asset": "<id>" }` in the library
|
|
4
|
+
* JSON. References keep type-specific composition out of the core — a plugin
|
|
5
|
+
* declares *which* of its fields are references (`collectReferences` on the
|
|
6
|
+
* plugin contract); the core only knows "this asset points at that asset".
|
|
7
|
+
*/
|
|
8
|
+
/** Whether a value is a well-formed asset-reference marker. */
|
|
9
|
+
export function isAssetReference(value) {
|
|
10
|
+
return (typeof value === 'object' &&
|
|
11
|
+
value !== null &&
|
|
12
|
+
!Array.isArray(value) &&
|
|
13
|
+
typeof value.$asset === 'string' &&
|
|
14
|
+
value.$asset !== '');
|
|
15
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable JSON for hash inputs: recursively sorted keys, no whitespace,
|
|
3
|
+
* `undefined` object values dropped. Two parameter objects that differ only in
|
|
4
|
+
* key order (or in explicitly-undefined optionals) canonicalize identically,
|
|
5
|
+
* so the derived job hash — and thus the proxy file name — stays stable.
|
|
6
|
+
*/
|
|
7
|
+
export declare function canonicalizeParameters(parameters: unknown): string;
|
|
8
|
+
/** Deterministic UTF-16 code-unit ordering, independent of host locale. */
|
|
9
|
+
export declare function compareCodeUnits(left: string, right: string): number;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable JSON for hash inputs: recursively sorted keys, no whitespace,
|
|
3
|
+
* `undefined` object values dropped. Two parameter objects that differ only in
|
|
4
|
+
* key order (or in explicitly-undefined optionals) canonicalize identically,
|
|
5
|
+
* so the derived job hash — and thus the proxy file name — stays stable.
|
|
6
|
+
*/
|
|
7
|
+
export function canonicalizeParameters(parameters) {
|
|
8
|
+
return stringify(parameters);
|
|
9
|
+
}
|
|
10
|
+
/** Deterministic UTF-16 code-unit ordering, independent of host locale. */
|
|
11
|
+
export function compareCodeUnits(left, right) {
|
|
12
|
+
return left < right ? -1 : left > right ? 1 : 0;
|
|
13
|
+
}
|
|
14
|
+
function stringify(value) {
|
|
15
|
+
if (value === undefined)
|
|
16
|
+
return 'null';
|
|
17
|
+
if (value === null || typeof value === 'number' || typeof value === 'boolean') {
|
|
18
|
+
return JSON.stringify(value);
|
|
19
|
+
}
|
|
20
|
+
if (typeof value === 'string')
|
|
21
|
+
return JSON.stringify(value);
|
|
22
|
+
if (Array.isArray(value)) {
|
|
23
|
+
return `[${value.map(stringify).join(',')}]`;
|
|
24
|
+
}
|
|
25
|
+
if (typeof value === 'object') {
|
|
26
|
+
const record = value;
|
|
27
|
+
const parts = [];
|
|
28
|
+
for (const key of Object.keys(record).sort()) {
|
|
29
|
+
if (record[key] === undefined)
|
|
30
|
+
continue;
|
|
31
|
+
parts.push(`${JSON.stringify(key)}:${stringify(record[key])}`);
|
|
32
|
+
}
|
|
33
|
+
return `{${parts.join(',')}}`;
|
|
34
|
+
}
|
|
35
|
+
throw new Error(`Cannot canonicalize a ${typeof value} value.`);
|
|
36
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chroma-key parameter data: the keying values the chroma-key-video plugin
|
|
3
|
+
* stores per asset and the runtime's WebGL renderer consumes. The parameter
|
|
4
|
+
* names and defaults follow the public UnityChromakey shader; this module is
|
|
5
|
+
* environment-free data only — the GL engine lives in the runtime directory.
|
|
6
|
+
*/
|
|
7
|
+
export interface ChromaKeyParameters {
|
|
8
|
+
/** RGB 0–1 each. The greenscreen color to key out. */
|
|
9
|
+
keyColor: [number, number, number];
|
|
10
|
+
/** Chroma distance below which a pixel is fully keyed. */
|
|
11
|
+
colorCutoff: number;
|
|
12
|
+
/** Chroma distance band over which the key fades out. */
|
|
13
|
+
colorFeathering: number;
|
|
14
|
+
/** Blend toward the 3×3-blurred mask, 0 = unfeathered. */
|
|
15
|
+
maskFeathering: number;
|
|
16
|
+
/** Lower smoothstep edge re-hardening the feathered mask. */
|
|
17
|
+
sharpening: number;
|
|
18
|
+
/** How strongly green spill is pulled toward the red/blue average. */
|
|
19
|
+
despill: number;
|
|
20
|
+
/** Luminance removed by the despill that is added back. */
|
|
21
|
+
despillLuminanceAdd: number;
|
|
22
|
+
}
|
|
23
|
+
/** The upstream shader's property defaults — a freshly ingested asset starts here. */
|
|
24
|
+
export declare const DEFAULT_CHROMA_KEY_PARAMETERS: ChromaKeyParameters;
|
|
25
|
+
/**
|
|
26
|
+
* Validate an unknown chroma-key blob: every field required, every channel and
|
|
27
|
+
* scalar a finite number. Values are clamped into 0–1 (slider float artifacts
|
|
28
|
+
* must not invalidate a library), non-numbers throw.
|
|
29
|
+
*/
|
|
30
|
+
export declare function validateChromaKeyParameters(value: unknown): ChromaKeyParameters;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chroma-key parameter data: the keying values the chroma-key-video plugin
|
|
3
|
+
* stores per asset and the runtime's WebGL renderer consumes. The parameter
|
|
4
|
+
* names and defaults follow the public UnityChromakey shader; this module is
|
|
5
|
+
* environment-free data only — the GL engine lives in the runtime directory.
|
|
6
|
+
*/
|
|
7
|
+
/** The upstream shader's property defaults — a freshly ingested asset starts here. */
|
|
8
|
+
export const DEFAULT_CHROMA_KEY_PARAMETERS = {
|
|
9
|
+
keyColor: [0, 1, 0],
|
|
10
|
+
colorCutoff: 0.2,
|
|
11
|
+
colorFeathering: 0.33,
|
|
12
|
+
maskFeathering: 1,
|
|
13
|
+
sharpening: 0.5,
|
|
14
|
+
despill: 1,
|
|
15
|
+
despillLuminanceAdd: 0.2
|
|
16
|
+
};
|
|
17
|
+
const SCALAR_KEYS = [
|
|
18
|
+
'colorCutoff',
|
|
19
|
+
'colorFeathering',
|
|
20
|
+
'maskFeathering',
|
|
21
|
+
'sharpening',
|
|
22
|
+
'despill',
|
|
23
|
+
'despillLuminanceAdd'
|
|
24
|
+
];
|
|
25
|
+
function clampUnit(value) {
|
|
26
|
+
return Math.min(1, Math.max(0, value));
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Validate an unknown chroma-key blob: every field required, every channel and
|
|
30
|
+
* scalar a finite number. Values are clamped into 0–1 (slider float artifacts
|
|
31
|
+
* must not invalidate a library), non-numbers throw.
|
|
32
|
+
*/
|
|
33
|
+
export function validateChromaKeyParameters(value) {
|
|
34
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
|
|
35
|
+
throw new Error('"chromaKey" must be an object.');
|
|
36
|
+
}
|
|
37
|
+
const record = value;
|
|
38
|
+
const keyColor = record.keyColor;
|
|
39
|
+
if (!Array.isArray(keyColor) ||
|
|
40
|
+
keyColor.length !== 3 ||
|
|
41
|
+
keyColor.some((channel) => typeof channel !== 'number' || !Number.isFinite(channel))) {
|
|
42
|
+
throw new Error('"chromaKey.keyColor" must be an array of three numbers (RGB, 0–1 each).');
|
|
43
|
+
}
|
|
44
|
+
const result = {
|
|
45
|
+
keyColor: [clampUnit(keyColor[0]), clampUnit(keyColor[1]), clampUnit(keyColor[2])]
|
|
46
|
+
};
|
|
47
|
+
for (const key of SCALAR_KEYS) {
|
|
48
|
+
const scalar = record[key];
|
|
49
|
+
if (typeof scalar !== 'number' || !Number.isFinite(scalar)) {
|
|
50
|
+
throw new Error(`"chromaKey.${key}" must be a number (0–1).`);
|
|
51
|
+
}
|
|
52
|
+
result[key] = clampUnit(scalar);
|
|
53
|
+
}
|
|
54
|
+
return result;
|
|
55
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host configuration: `fundus.config.ts` in the host project root
|
|
3
|
+
* default-exports `defineConfig({ … })`. All paths are host-project-root
|
|
4
|
+
* relative; the server's config loader resolves them to absolute paths and
|
|
5
|
+
* merges built-in plugin preset defaults.
|
|
6
|
+
*/
|
|
7
|
+
import type { AudioPluginConfig } from './plugins/audio.js';
|
|
8
|
+
import type { ImagePluginConfig } from './plugins/image.js';
|
|
9
|
+
import type { SlicePluginConfig } from './plugins/slice.js';
|
|
10
|
+
import type { VideoPluginConfig } from './plugins/video.js';
|
|
11
|
+
export interface FundusConfig {
|
|
12
|
+
/** Directory holding the raw originals (never delivered). */
|
|
13
|
+
rawDir: string;
|
|
14
|
+
/** Directory processed proxies are written to (conventionally under `static/`). */
|
|
15
|
+
proxyDir: string;
|
|
16
|
+
/** URL prefix baked into generated proxy `src` values, e.g. '/fundus/'. */
|
|
17
|
+
proxyBasePath: string;
|
|
18
|
+
/** Path of the library JSON file (the SSOT). */
|
|
19
|
+
library: string;
|
|
20
|
+
/** Directory the generated manifest modules land in. */
|
|
21
|
+
manifestsDir: string;
|
|
22
|
+
/**
|
|
23
|
+
* Per-plugin configuration; each plugin owns its namespace and schema.
|
|
24
|
+
* chroma-key-video has no namespace — it shares the video plugin's presets
|
|
25
|
+
* (and ffmpeg/ffprobe path overrides) .
|
|
26
|
+
*/
|
|
27
|
+
plugins?: {
|
|
28
|
+
image?: ImagePluginConfig;
|
|
29
|
+
slice?: SlicePluginConfig;
|
|
30
|
+
video?: VideoPluginConfig;
|
|
31
|
+
audio?: AudioPluginConfig;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/** Identity helper so the host config file gets full typing + completion. */
|
|
35
|
+
export declare function defineConfig(config: FundusConfig): FundusConfig;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** The implicit raw/proxy root. Explicit folders are always non-empty paths. */
|
|
2
|
+
export declare const ROOT_FOLDER = "";
|
|
3
|
+
/** Fundus-owned file that preserves explicit empty folders in source control. */
|
|
4
|
+
export declare const FOLDER_SENTINEL = ".gitkeep";
|
|
5
|
+
/** Validate one human-facing folder name (a single path segment). */
|
|
6
|
+
export declare function folderNameError(name: string): string | null;
|
|
7
|
+
/** Normalize a validated, portable relative folder path to NFC + POSIX separators. */
|
|
8
|
+
export declare function normalizeFolderPath(path: string): string;
|
|
9
|
+
/** Validate a non-root, POSIX-relative folder path. */
|
|
10
|
+
export declare function folderPathError(path: string): string | null;
|
|
11
|
+
/** Case-insensitive, Unicode-normalized key used to prevent portable path collisions. */
|
|
12
|
+
export declare function portableFolderPathKey(path: string): string;
|
|
13
|
+
export declare function parentFolderPath(path: string): string;
|
|
14
|
+
export declare function folderNameOf(path: string): string;
|
|
15
|
+
export declare function joinFolderPath(parent: string, name: string): string;
|
|
16
|
+
export declare function folderOfRawPath(rawPath: string): string;
|
|
17
|
+
export declare function rawFileNameOfPath(rawPath: string): string;
|
|
18
|
+
export declare function isFolderOrDescendant(path: string, ancestor: string): boolean;
|
|
19
|
+
export declare function replaceFolderPrefix(path: string, from: string, to: string): string;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/** The implicit raw/proxy root. Explicit folders are always non-empty paths. */
|
|
2
|
+
export const ROOT_FOLDER = '';
|
|
3
|
+
/** Fundus-owned file that preserves explicit empty folders in source control. */
|
|
4
|
+
export const FOLDER_SENTINEL = '.gitkeep';
|
|
5
|
+
const CONTROL_CHARACTERS = /[\u0000-\u001f\u007f]/;
|
|
6
|
+
const WINDOWS_FORBIDDEN_CHARACTERS = /[<>:"|?*]/;
|
|
7
|
+
const WINDOWS_RESERVED_NAME = /^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\..*)?$/i;
|
|
8
|
+
/** Validate one human-facing folder name (a single path segment). */
|
|
9
|
+
export function folderNameError(name) {
|
|
10
|
+
if (name.length === 0)
|
|
11
|
+
return 'Folder names must not be empty.';
|
|
12
|
+
if (name !== name.trim())
|
|
13
|
+
return 'Folder names must not start or end with whitespace.';
|
|
14
|
+
if (name === '.' || name === '..')
|
|
15
|
+
return `"${name}" is not a valid folder name.`;
|
|
16
|
+
if (name.includes('/') || name.includes('\\')) {
|
|
17
|
+
return 'Folder names must not contain path separators.';
|
|
18
|
+
}
|
|
19
|
+
if (CONTROL_CHARACTERS.test(name))
|
|
20
|
+
return 'Folder names must not contain control characters.';
|
|
21
|
+
if (WINDOWS_FORBIDDEN_CHARACTERS.test(name)) {
|
|
22
|
+
return 'Folder names must not contain Windows-reserved characters (: * ? " < > |).';
|
|
23
|
+
}
|
|
24
|
+
if (name.endsWith('.'))
|
|
25
|
+
return 'Folder names must not end with a dot.';
|
|
26
|
+
if (name.toLocaleLowerCase('en-US') === 'root') {
|
|
27
|
+
return `"${name}" is reserved for the implicit Fundus root folder.`;
|
|
28
|
+
}
|
|
29
|
+
if (name.toLocaleLowerCase('en-US') === FOLDER_SENTINEL) {
|
|
30
|
+
return `"${name}" is reserved for Fundus folder management.`;
|
|
31
|
+
}
|
|
32
|
+
if (WINDOWS_RESERVED_NAME.test(name)) {
|
|
33
|
+
return `"${name}" is a reserved filesystem name.`;
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
/** Normalize a validated, portable relative folder path to NFC + POSIX separators. */
|
|
38
|
+
export function normalizeFolderPath(path) {
|
|
39
|
+
return path
|
|
40
|
+
.split('/')
|
|
41
|
+
.map((segment) => segment.normalize('NFC'))
|
|
42
|
+
.join('/');
|
|
43
|
+
}
|
|
44
|
+
/** Validate a non-root, POSIX-relative folder path. */
|
|
45
|
+
export function folderPathError(path) {
|
|
46
|
+
if (path.length === 0)
|
|
47
|
+
return 'The root is implicit and cannot be registered as a folder.';
|
|
48
|
+
if (path.startsWith('/') || path.endsWith('/')) {
|
|
49
|
+
return 'Folder paths must be relative and must not start or end with a slash.';
|
|
50
|
+
}
|
|
51
|
+
for (const segment of path.split('/')) {
|
|
52
|
+
const problem = folderNameError(segment);
|
|
53
|
+
if (problem)
|
|
54
|
+
return `Invalid folder path "${path}": ${problem}`;
|
|
55
|
+
}
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
/** Case-insensitive, Unicode-normalized key used to prevent portable path collisions. */
|
|
59
|
+
export function portableFolderPathKey(path) {
|
|
60
|
+
return normalizeFolderPath(path).toLocaleLowerCase('en-US');
|
|
61
|
+
}
|
|
62
|
+
export function parentFolderPath(path) {
|
|
63
|
+
const separator = path.lastIndexOf('/');
|
|
64
|
+
return separator === -1 ? ROOT_FOLDER : path.slice(0, separator);
|
|
65
|
+
}
|
|
66
|
+
export function folderNameOf(path) {
|
|
67
|
+
const separator = path.lastIndexOf('/');
|
|
68
|
+
return separator === -1 ? path : path.slice(separator + 1);
|
|
69
|
+
}
|
|
70
|
+
export function joinFolderPath(parent, name) {
|
|
71
|
+
return parent === ROOT_FOLDER ? name : `${parent}/${name}`;
|
|
72
|
+
}
|
|
73
|
+
export function folderOfRawPath(rawPath) {
|
|
74
|
+
return parentFolderPath(rawPath);
|
|
75
|
+
}
|
|
76
|
+
export function rawFileNameOfPath(rawPath) {
|
|
77
|
+
return folderNameOf(rawPath);
|
|
78
|
+
}
|
|
79
|
+
export function isFolderOrDescendant(path, ancestor) {
|
|
80
|
+
return path === ancestor || path.startsWith(`${ancestor}/`);
|
|
81
|
+
}
|
|
82
|
+
export function replaceFolderPrefix(path, from, to) {
|
|
83
|
+
if (path === from)
|
|
84
|
+
return to;
|
|
85
|
+
return `${to}${path.slice(from.length)}`;
|
|
86
|
+
}
|