fundus 0.0.2 → 0.0.4
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 +73 -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.ohi-TClG.css +1 -0
- package/build/client/_app/immutable/assets/2.ohi-TClG.css.br +0 -0
- package/build/client/_app/immutable/assets/2.ohi-TClG.css.gz +0 -0
- package/build/client/_app/immutable/assets/3.JwgtcTEd.css +1 -0
- package/build/client/_app/immutable/assets/3.JwgtcTEd.css.br +0 -0
- package/build/client/_app/immutable/assets/3.JwgtcTEd.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.CMefGNE2.css +1 -0
- package/build/client/_app/immutable/assets/LibraryContextMenu.CMefGNE2.css.br +0 -0
- package/build/client/_app/immutable/assets/LibraryContextMenu.CMefGNE2.css.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/build/client/_app/immutable/chunks/DOpBpjxS.js +108 -0
- package/build/client/_app/immutable/chunks/DOpBpjxS.js.br +0 -0
- package/build/client/_app/immutable/chunks/DOpBpjxS.js.gz +0 -0
- package/{dist/editor/_app/immutable/chunks/BfPE5wdt.js → build/client/_app/immutable/chunks/DVEQFclp.js} +1 -1
- package/build/client/_app/immutable/chunks/DVEQFclp.js.br +1 -0
- package/build/client/_app/immutable/chunks/DVEQFclp.js.gz +0 -0
- package/{dist/editor/_app/immutable/chunks/DjvOiDmq.js → build/client/_app/immutable/chunks/DiFoWL2c.js} +1 -1
- package/build/client/_app/immutable/chunks/DiFoWL2c.js.br +0 -0
- package/build/client/_app/immutable/chunks/DiFoWL2c.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DkADHpZF.js +1 -0
- package/build/client/_app/immutable/chunks/DkADHpZF.js.br +0 -0
- package/build/client/_app/immutable/chunks/DkADHpZF.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.CKgtYXQb.js} +2 -2
- package/build/client/_app/immutable/entry/app.CKgtYXQb.js.br +0 -0
- package/build/client/_app/immutable/entry/app.CKgtYXQb.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.CYZu5qE1.js +1 -0
- package/build/client/_app/immutable/entry/start.CYZu5qE1.js.br +0 -0
- package/build/client/_app/immutable/entry/start.CYZu5qE1.js.gz +0 -0
- package/{dist/editor/_app/immutable/nodes/0.xdMI5GEU.js → build/client/_app/immutable/nodes/0.I_1SApYQ.js} +1 -1
- package/build/client/_app/immutable/nodes/0.I_1SApYQ.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.I_1SApYQ.js.gz +0 -0
- package/{dist/editor/_app/immutable/nodes/1.D9p2tfoJ.js → build/client/_app/immutable/nodes/1.v6eUTnWq.js} +1 -1
- package/build/client/_app/immutable/nodes/1.v6eUTnWq.js.br +2 -0
- package/build/client/_app/immutable/nodes/1.v6eUTnWq.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.DoA7Dfl-.js +3 -0
- package/build/client/_app/immutable/nodes/2.DoA7Dfl-.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.DoA7Dfl-.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.C-DO70Bs.js +1 -0
- package/build/client/_app/immutable/nodes/3.C-DO70Bs.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.C-DO70Bs.js.gz +0 -0
- package/build/client/_app/immutable/nodes/4.CALOuSyz.js +2 -0
- package/build/client/_app/immutable/nodes/4.CALOuSyz.js.br +0 -0
- package/build/client/_app/immutable/nodes/4.CALOuSyz.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-BUZqFfWG.js +429 -0
- package/build/server/chunks/chunks/context.js-BUZqFfWG.js.map +1 -0
- package/build/server/chunks/chunks/core.js-xfrkaQpS.js +458 -0
- package/build/server/chunks/chunks/core.js-xfrkaQpS.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-C0rwMMtk.js +152 -0
- package/build/server/chunks/chunks/exports.js-C0rwMMtk.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-DvopzwKh.js +100 -0
- package/build/server/chunks/chunks/http.js-DvopzwKh.js.map +1 -0
- package/build/server/chunks/chunks/internal.js-DGo2jPcg.js +5753 -0
- package/build/server/chunks/chunks/internal.js-DGo2jPcg.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-ZLudCJlT.js} +463 -492
- package/build/server/chunks/chunks/library-store.js-ZLudCJlT.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-B1gC9MiJ.js +255 -0
- package/build/server/chunks/chunks/shared.js-B1gC9MiJ.js.map +1 -0
- package/build/server/chunks/chunks/utils.js-DnEJ3UjO.js +1048 -0
- package/build/server/chunks/chunks/utils.js-DnEJ3UjO.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/_...path_/_server.ts.js-Cq5gXVQT.js +27 -0
- package/build/server/chunks/entries/endpoints/api/_...path_/_server.ts.js-Cq5gXVQT.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/assets/_id_/_server.ts.js-RXbedi8q.js +24 -0
- package/build/server/chunks/entries/endpoints/api/assets/_id_/_server.ts.js-RXbedi8q.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/assets/_server.ts.js-D7Qae9vU.js +45 -0
- package/build/server/chunks/entries/endpoints/api/assets/_server.ts.js-D7Qae9vU.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/assets/delete/_server.ts.js-DtO20kgB.js +31 -0
- package/build/server/chunks/entries/endpoints/api/assets/delete/_server.ts.js-DtO20kgB.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/assets/move/_server.ts.js-BUebPbd5.js +31 -0
- package/build/server/chunks/entries/endpoints/api/assets/move/_server.ts.js-BUebPbd5.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/folders/_path_/_server.ts.js-BjT2qPMT.js +38 -0
- package/build/server/chunks/entries/endpoints/api/folders/_path_/_server.ts.js-BjT2qPMT.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/folders/_server.ts.js-DYRLsoT7.js +31 -0
- package/build/server/chunks/entries/endpoints/api/folders/_server.ts.js-DYRLsoT7.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/manifests/_name_/_server.ts.js-BbN2fGNN.js +24 -0
- package/build/server/chunks/entries/endpoints/api/manifests/_name_/_server.ts.js-BbN2fGNN.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/manifests/_server.ts.js-b_MKZ41b.js +31 -0
- package/build/server/chunks/entries/endpoints/api/manifests/_server.ts.js-b_MKZ41b.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/state/_server.ts.js-evEfMpvn.js +24 -0
- package/build/server/chunks/entries/endpoints/api/state/_server.ts.js-evEfMpvn.js.map +1 -0
- package/build/server/chunks/entries/endpoints/files/_...path_/_server.ts.js-C04XE_1w.js +27 -0
- package/build/server/chunks/entries/endpoints/files/_...path_/_server.ts.js-C04XE_1w.js.map +1 -0
- package/build/server/chunks/entries/endpoints/files/proxy/_...path_/_server.ts.js-DB8TdoEv.js +24 -0
- package/build/server/chunks/entries/endpoints/files/proxy/_...path_/_server.ts.js-DB8TdoEv.js.map +1 -0
- package/build/server/chunks/entries/endpoints/files/raw/_...path_/_server.ts.js-BrpaijZO.js +24 -0
- package/build/server/chunks/entries/endpoints/files/raw/_...path_/_server.ts.js-BrpaijZO.js.map +1 -0
- package/build/server/chunks/entries/hooks.server.js-BJJwZW_I.js +23 -0
- package/build/server/chunks/entries/hooks.server.js-BJJwZW_I.js.map +1 -0
- package/build/server/chunks/handler-DnbS2t1B.js +1475 -0
- package/build/server/chunks/handler-DnbS2t1B.js.map +1 -0
- package/build/server/chunks/index.js-g77q3Boj.js +3789 -0
- package/build/server/chunks/index.js-g77q3Boj.js.map +1 -0
- package/build/server/chunks/manifest.js-qmEXbstS.js +149 -0
- package/build/server/chunks/manifest.js-qmEXbstS.js.map +1 -0
- package/build/server/chunks/nodes/0.js-Bk6IZ-vD.js +11 -0
- package/build/server/chunks/nodes/0.js-Bk6IZ-vD.js.map +1 -0
- package/build/server/chunks/nodes/1.js-H-qwo4GJ.js +7 -0
- package/build/server/chunks/nodes/1.js-H-qwo4GJ.js.map +1 -0
- package/build/server/chunks/nodes/2.js-DRpXVLwp.js +7 -0
- package/build/server/chunks/nodes/2.js-DRpXVLwp.js.map +1 -0
- package/build/server/chunks/nodes/3.js-CDEzNFeU.js +7 -0
- package/build/server/chunks/nodes/3.js-CDEzNFeU.js.map +1 -0
- package/build/server/chunks/nodes/4.js-BKL7LSSm.js +7 -0
- package/build/server/chunks/nodes/4.js-BKL7LSSm.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 +116 -1336
- 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 +24 -0
- package/dist/core/ingest.js +42 -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/registry.d.ts +16 -0
- package/dist/core/plugins/registry.js +52 -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 -30
- package/dist/runtime/kind-handlers.js +85 -67
- 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 +35 -0
- package/dist/server/config-loader.js +79 -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 +17 -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 +8 -0
- package/dist/server/plugins/audio.js +41 -0
- package/dist/server/plugins/chroma-key-video.d.ts +9 -0
- package/dist/server/plugins/chroma-key-video.js +40 -0
- package/dist/server/plugins/config.d.ts +13 -0
- package/dist/server/plugins/config.js +32 -0
- package/dist/server/plugins/contract.d.ts +114 -0
- package/dist/server/plugins/contract.js +16 -0
- package/dist/server/plugins/image.d.ts +9 -0
- package/dist/server/plugins/image.js +43 -0
- package/dist/server/plugins/slice.d.ts +15 -0
- package/dist/server/plugins/slice.js +76 -0
- package/dist/server/plugins/video.d.ts +7 -0
- package/dist/server/plugins/video.js +54 -0
- package/dist/server/plugins.d.ts +23 -0
- package/dist/server/plugins.js +35 -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 +13 -0
- package/dist/server/start.js +80 -0
- package/package.json +31 -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/DjdrdRzT.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/2.BrA0Hyzu.js +0 -3
- 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/xihTtKlq.js +0 -0
package/dist/build-CZYFLLvl.js
DELETED
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
import { _ as strayGeneratedModuleNames, a as deliveredAssetIds, c as isProxyFileName, f as listRelativeFiles, g as renderManifestModule, h as manifestModuleFileName, i as sha256Hex, l as processAssets, m as generateManifestModules, n as LibraryStore, p as buildManifestEntries, s as expectedProxyRelativePath, u as readCurrentProxy, v as descriptorsByType, w as loadConfig, x as serverPluginsByType } from "./operations-DYM-5KVl.js";
|
|
2
|
-
import { readFile } from "node:fs/promises";
|
|
3
|
-
import { join } from "node:path";
|
|
4
|
-
import { collectAllReferences, compareCodeUnits, computeLibraryMembership, rawFileNameOfPath } from "#fundus/core";
|
|
5
|
-
import { existsSync } from "node:fs";
|
|
6
|
-
//#region src/check.ts
|
|
7
|
-
/**
|
|
8
|
-
* `fundus check` — the verify-only CI gate: no writes, ever. It
|
|
9
|
-
* fails when the library does not validate, when a committed proxy is stale,
|
|
10
|
-
* missing, or orphaned, or when a generated manifest module differs from an
|
|
11
|
-
* in-memory regeneration. Warnings (unreachable asset, raw-hash drift) are
|
|
12
|
-
* treated as errors unless `--allow-warnings` downgrades them — errors are
|
|
13
|
-
* never downgradable.
|
|
14
|
-
*/
|
|
15
|
-
/** The human rendering of a finding — `[assetId] message`, as `fundus check` prints it. */
|
|
16
|
-
function formatCheckFinding(finding) {
|
|
17
|
-
return `${finding.assetId ? `[${finding.assetId}] ` : ""}${finding.message}`;
|
|
18
|
-
}
|
|
19
|
-
async function runCheck(projectRoot, registry = serverPluginsByType) {
|
|
20
|
-
const config = await loadConfig(projectRoot);
|
|
21
|
-
const store = new LibraryStore(config, registry);
|
|
22
|
-
const library = await store.read();
|
|
23
|
-
const report = {
|
|
24
|
-
errors: [],
|
|
25
|
-
warnings: [],
|
|
26
|
-
assetCount: Object.keys(library.assets).length,
|
|
27
|
-
manifestCount: Object.keys(library.manifests).length
|
|
28
|
-
};
|
|
29
|
-
const issues = await store.validate(library);
|
|
30
|
-
for (const issue of issues) report.errors.push({
|
|
31
|
-
kind: "validation",
|
|
32
|
-
message: issue.message,
|
|
33
|
-
...issue.assetId !== void 0 ? { assetId: issue.assetId } : {}
|
|
34
|
-
});
|
|
35
|
-
const delivered = deliveredAssetIds(library, registry);
|
|
36
|
-
const expectedProxyPaths = /* @__PURE__ */ new Set();
|
|
37
|
-
const proxies = {};
|
|
38
|
-
let proxiesComplete = true;
|
|
39
|
-
for (const assetId of [...delivered].sort(compareCodeUnits)) {
|
|
40
|
-
const record = library.assets[assetId];
|
|
41
|
-
let proxy;
|
|
42
|
-
try {
|
|
43
|
-
proxy = await readCurrentProxy(assetId, record, config, registry);
|
|
44
|
-
} catch (cause) {
|
|
45
|
-
if (!issues.some((issue) => issue.assetId === assetId)) report.errors.push({
|
|
46
|
-
kind: "proxy-unresolvable",
|
|
47
|
-
message: cause instanceof Error ? cause.message : String(cause),
|
|
48
|
-
assetId
|
|
49
|
-
});
|
|
50
|
-
proxiesComplete = false;
|
|
51
|
-
continue;
|
|
52
|
-
}
|
|
53
|
-
if (!proxy) {
|
|
54
|
-
const relativePath = expectedProxyRelativePath(assetId, record, config, registry);
|
|
55
|
-
expectedProxyPaths.add(relativePath);
|
|
56
|
-
report.errors.push({
|
|
57
|
-
kind: "proxy-missing",
|
|
58
|
-
message: `Proxy "${relativePath}" is missing or stale — run \`fundus build\` and commit the result.`,
|
|
59
|
-
assetId,
|
|
60
|
-
fileName: relativePath
|
|
61
|
-
});
|
|
62
|
-
proxiesComplete = false;
|
|
63
|
-
continue;
|
|
64
|
-
}
|
|
65
|
-
expectedProxyPaths.add(proxy.relativePath);
|
|
66
|
-
proxies[assetId] = proxy;
|
|
67
|
-
}
|
|
68
|
-
if (existsSync(config.proxyDir)) for (const relativePath of (await listRelativeFiles(config.proxyDir)).sort()) {
|
|
69
|
-
if (!isProxyFileName(rawFileNameOfPath(relativePath)) || expectedProxyPaths.has(relativePath)) continue;
|
|
70
|
-
report.errors.push({
|
|
71
|
-
kind: "proxy-orphaned",
|
|
72
|
-
message: `Orphaned proxy "${relativePath}" — no asset expects it; run \`fundus build\` and commit the result.`,
|
|
73
|
-
fileName: relativePath
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
if (issues.length === 0 && proxiesComplete) {
|
|
77
|
-
await checkGeneratedModules(report, library, config, proxies, registry);
|
|
78
|
-
await checkStrayModules(report, library, config);
|
|
79
|
-
}
|
|
80
|
-
collectUnreachableAssets(report, library, delivered);
|
|
81
|
-
await collectRawHashDrift(report, library, config);
|
|
82
|
-
return report;
|
|
83
|
-
}
|
|
84
|
-
async function checkGeneratedModules(report, library, config, proxies, registry) {
|
|
85
|
-
const referencesByAsset = collectAllReferences(library, descriptorsByType(registry));
|
|
86
|
-
const membershipByManifest = computeLibraryMembership(library, referencesByAsset);
|
|
87
|
-
for (const manifestName of Object.keys(library.manifests).sort(compareCodeUnits)) {
|
|
88
|
-
const fileName = manifestModuleFileName(manifestName);
|
|
89
|
-
const modulePath = join(config.manifestsDir, fileName);
|
|
90
|
-
let expectedContent;
|
|
91
|
-
try {
|
|
92
|
-
expectedContent = renderManifestModule(manifestName, buildManifestEntries({
|
|
93
|
-
membership: membershipByManifest[manifestName],
|
|
94
|
-
library,
|
|
95
|
-
proxies,
|
|
96
|
-
config,
|
|
97
|
-
referencesByAsset,
|
|
98
|
-
registry
|
|
99
|
-
}));
|
|
100
|
-
} catch (cause) {
|
|
101
|
-
report.errors.push({
|
|
102
|
-
kind: "module-regeneration-failed",
|
|
103
|
-
message: `Cannot regenerate module "${fileName}": ${cause instanceof Error ? cause.message : String(cause)}`,
|
|
104
|
-
manifest: manifestName,
|
|
105
|
-
fileName
|
|
106
|
-
});
|
|
107
|
-
continue;
|
|
108
|
-
}
|
|
109
|
-
if (!existsSync(modulePath)) {
|
|
110
|
-
report.errors.push({
|
|
111
|
-
kind: "module-missing",
|
|
112
|
-
message: `Generated module "${fileName}" is missing — run \`fundus build\` and commit the result.`,
|
|
113
|
-
manifest: manifestName,
|
|
114
|
-
fileName
|
|
115
|
-
});
|
|
116
|
-
continue;
|
|
117
|
-
}
|
|
118
|
-
if (await readFile(modulePath, "utf8") !== expectedContent) report.errors.push({
|
|
119
|
-
kind: "module-out-of-sync",
|
|
120
|
-
message: `Generated module "${fileName}" is out of sync with the library — run \`fundus build\` and commit the result.`,
|
|
121
|
-
manifest: manifestName,
|
|
122
|
-
fileName
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
async function checkStrayModules(report, library, config) {
|
|
127
|
-
const expectedFileNames = new Set(Object.keys(library.manifests).map((manifestName) => manifestModuleFileName(manifestName)));
|
|
128
|
-
for (const fileName of await strayGeneratedModuleNames(config.manifestsDir, expectedFileNames)) report.errors.push({
|
|
129
|
-
kind: "module-stray",
|
|
130
|
-
message: `Stray generated module "${fileName}" — its manifest no longer exists; run \`fundus build\`.`,
|
|
131
|
-
fileName
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* The unreachable-asset warning: fires only when nothing delivers the asset —
|
|
136
|
-
* no explicit membership AND no passive membership in any manifest. An asset
|
|
137
|
-
* that is only passively delivered (referenced by a delivered asset) is fine.
|
|
138
|
-
*/
|
|
139
|
-
function collectUnreachableAssets(report, library, delivered) {
|
|
140
|
-
for (const [assetId, record] of Object.entries(library.assets)) if (record.manifests.length === 0 && !delivered.has(assetId)) report.warnings.push({
|
|
141
|
-
kind: "unreachable-asset",
|
|
142
|
-
message: "In no manifest and not referenced by any delivered asset — nothing is processed or generated for it.",
|
|
143
|
-
assetId
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Raw-hash drift: a raw file replaced on disk while the library still pins the
|
|
148
|
-
* old content hash. The proxy name derives from the *recorded* hash, so the
|
|
149
|
-
* name check alone would keep passing while the delivered pixels are outdated.
|
|
150
|
-
*/
|
|
151
|
-
async function collectRawHashDrift(report, library, config) {
|
|
152
|
-
for (const [assetId, record] of Object.entries(library.assets)) {
|
|
153
|
-
const rawPath = join(config.rawDir, record.raw);
|
|
154
|
-
if (!existsSync(rawPath)) continue;
|
|
155
|
-
if (sha256Hex(new Uint8Array(await readFile(rawPath))) !== record.rawHash) report.warnings.push({
|
|
156
|
-
kind: "raw-hash-drift",
|
|
157
|
-
message: `Raw file "${record.raw}" changed since it was ingested (hash drift) — re-ingest or update it through the editor, then run \`fundus build\`.`,
|
|
158
|
-
assetId,
|
|
159
|
-
fileName: record.raw
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
//#endregion
|
|
164
|
-
//#region src/build.ts
|
|
165
|
-
/**
|
|
166
|
-
* `fundus build` — headless pipeline run: validate the library, process all
|
|
167
|
-
* stale/missing proxies, prune orphans, regenerate every manifest module.
|
|
168
|
-
* Throws on validation errors (the CLI exits non-zero).
|
|
169
|
-
*/
|
|
170
|
-
async function runBuild(projectRoot, registry = serverPluginsByType) {
|
|
171
|
-
const config = await loadConfig(projectRoot);
|
|
172
|
-
const store = new LibraryStore(config, registry);
|
|
173
|
-
const library = await store.read();
|
|
174
|
-
await store.syncFolders(library);
|
|
175
|
-
const issues = await store.validate(library);
|
|
176
|
-
if (issues.length > 0) {
|
|
177
|
-
const lines = issues.map((issue) => ` - ${formatCheckFinding({
|
|
178
|
-
kind: "validation",
|
|
179
|
-
assetId: issue.assetId,
|
|
180
|
-
message: issue.message
|
|
181
|
-
})}`);
|
|
182
|
-
throw new Error(`Library validation failed:\n${lines.join("\n")}`);
|
|
183
|
-
}
|
|
184
|
-
const processing = await processAssets(config, library, registry);
|
|
185
|
-
return {
|
|
186
|
-
processing,
|
|
187
|
-
codegen: await generateManifestModules(config, library, processing.proxies, registry)
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
//#endregion
|
|
191
|
-
export { formatCheckFinding as n, runCheck as r, runBuild as t };
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
//#region src/asset-reference.ts
|
|
2
|
-
/** Whether a value is a well-formed asset-reference marker. */
|
|
3
|
-
function isAssetReference(value) {
|
|
4
|
-
return typeof value === "object" && value !== null && !Array.isArray(value) && typeof value.$asset === "string" && value.$asset !== "";
|
|
5
|
-
}
|
|
6
|
-
//#endregion
|
|
7
|
-
//#region src/plugins/image.ts
|
|
8
|
-
const IMAGE_FORMATS = [
|
|
9
|
-
"webp",
|
|
10
|
-
"png",
|
|
11
|
-
"avif",
|
|
12
|
-
"jpeg"
|
|
13
|
-
];
|
|
14
|
-
/** Built-in presets, always available; host config merges over them. */
|
|
15
|
-
const IMAGE_BUILT_IN_PRESETS = { default: {
|
|
16
|
-
format: "webp",
|
|
17
|
-
quality: 82
|
|
18
|
-
} };
|
|
19
|
-
function validateImagePreset(name, value) {
|
|
20
|
-
if (typeof value !== "object" || value === null || Array.isArray(value)) throw new Error(`Image preset "${name}" must be an object.`);
|
|
21
|
-
const record = value;
|
|
22
|
-
if (typeof record.format !== "string" || !IMAGE_FORMATS.includes(record.format)) throw new Error(`Image preset "${name}" needs a "format" of ${IMAGE_FORMATS.map((format) => `'${format}'`).join(" | ")}.`);
|
|
23
|
-
if (record.quality !== void 0 && typeof record.quality !== "number") throw new Error(`Image preset "${name}" has a non-number "quality".`);
|
|
24
|
-
return {
|
|
25
|
-
format: record.format,
|
|
26
|
-
quality: record.quality
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
const RASTER_IMAGE_EXTENSIONS = [
|
|
30
|
-
"png",
|
|
31
|
-
"jpg",
|
|
32
|
-
"jpeg",
|
|
33
|
-
"webp",
|
|
34
|
-
"avif"
|
|
35
|
-
];
|
|
36
|
-
const imagePlugin = {
|
|
37
|
-
type: "image",
|
|
38
|
-
accepts: [...RASTER_IMAGE_EXTENSIONS],
|
|
39
|
-
defaultParameters: () => ({ preset: "default" }),
|
|
40
|
-
validateParameters(value) {
|
|
41
|
-
if (typeof value !== "object" || value === null || Array.isArray(value)) throw new Error("Image parameters must be an object.");
|
|
42
|
-
const record = value;
|
|
43
|
-
if (typeof record.preset !== "string" || record.preset.length === 0) throw new Error("Image parameters need a non-empty string \"preset\".");
|
|
44
|
-
if (record.targetWidth !== void 0) {
|
|
45
|
-
if (typeof record.targetWidth !== "number" || !Number.isInteger(record.targetWidth) || record.targetWidth <= 0) throw new Error("Image \"targetWidth\" must be a positive integer when set.");
|
|
46
|
-
}
|
|
47
|
-
return {
|
|
48
|
-
preset: record.preset,
|
|
49
|
-
...record.targetWidth !== void 0 ? { targetWidth: record.targetWidth } : {}
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
//#endregion
|
|
54
|
-
export { isAssetReference as a, validateImagePreset as i, RASTER_IMAGE_EXTENSIONS as n, imagePlugin as r, IMAGE_BUILT_IN_PRESETS as t };
|
|
@@ -1,280 +0,0 @@
|
|
|
1
|
-
//#region src/library.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* The library file model — the single source of truth for all asset metadata
|
|
4
|
-
* and manifest membership. One JSON file in the host repo, committed,
|
|
5
|
-
* serialized deterministically (recursively sorted keys) to minimize merge
|
|
6
|
-
* conflicts.
|
|
7
|
-
*/
|
|
8
|
-
type AssetId = string;
|
|
9
|
-
type ManifestName = string;
|
|
10
|
-
interface AssetRecord {
|
|
11
|
-
/** Asset type — which plugin owns this asset ('image' | 'slice' | …). */
|
|
12
|
-
type: string;
|
|
13
|
-
/** Raw file path, relative to the configured raw directory. */
|
|
14
|
-
raw: string;
|
|
15
|
-
/** Content hash (sha256 hex) of the raw file the parameters were authored against. */
|
|
16
|
-
rawHash: string;
|
|
17
|
-
/** Plugin-owned parameter blob, validated against the owning plugin's schema. */
|
|
18
|
-
parameters: unknown;
|
|
19
|
-
/** Empty + unreferenced = inert; referenced assets still deliver as passive members. */
|
|
20
|
-
manifests: ManifestName[];
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Per-manifest data. A delivery unit needs no metadata to function, but may
|
|
24
|
-
* carry an optional editor appearance — a color and/or an emoji — so
|
|
25
|
-
* the editor can tag the manifest's label everywhere. Both are chosen from the
|
|
26
|
-
* fixed sets in `manifest-appearance.ts` and validated at every mutation entry
|
|
27
|
-
* point; parsing only enforces that they are strings when present.
|
|
28
|
-
*/
|
|
29
|
-
interface ManifestRecord {
|
|
30
|
-
/** Optional color tag — a `#rrggbb` value from the fixed palette. */
|
|
31
|
-
color?: string;
|
|
32
|
-
/** Optional emoji tag — one of the fixed emoji set. */
|
|
33
|
-
emoji?: string;
|
|
34
|
-
}
|
|
35
|
-
interface Library {
|
|
36
|
-
version: 1;
|
|
37
|
-
/** Persisted nested folder paths. The raw/proxy root is implicit. */
|
|
38
|
-
folders: string[];
|
|
39
|
-
assets: Record<AssetId, AssetRecord>;
|
|
40
|
-
manifests: Record<ManifestName, ManifestRecord>;
|
|
41
|
-
}
|
|
42
|
-
/** A fresh, empty library. */
|
|
43
|
-
declare function createEmptyLibrary(): Library;
|
|
44
|
-
/**
|
|
45
|
-
* Parse and structurally validate a library file's JSON text. Throws with a
|
|
46
|
-
* clear message on any malformed part; plugin parameter validation is a
|
|
47
|
-
* separate, plugin-owned step.
|
|
48
|
-
*/
|
|
49
|
-
declare function parseLibrary(json: string): Library;
|
|
50
|
-
/**
|
|
51
|
-
* Serialize a library deterministically: recursively sorted keys, tab-indented,
|
|
52
|
-
* trailing newline. Same library → byte-identical file, whatever the in-memory
|
|
53
|
-
* insertion order was.
|
|
54
|
-
*/
|
|
55
|
-
declare function serializeLibrary(library: Library): string;
|
|
56
|
-
//#endregion
|
|
57
|
-
//#region src/asset-reference.d.ts
|
|
58
|
-
/**
|
|
59
|
-
* The asset-reference schema primitive: a plugin parameter field may
|
|
60
|
-
* point at another asset, written as `{ "$asset": "<id>" }` in the library
|
|
61
|
-
* JSON. References keep type-specific composition out of the core — a plugin
|
|
62
|
-
* declares *which* of its fields are references (`collectReferences` on the
|
|
63
|
-
* plugin contract); the core only knows "this asset points at that asset".
|
|
64
|
-
*/
|
|
65
|
-
/** The in-library shape of a reference: `{ "$asset": "characterIdleMask" }`. */
|
|
66
|
-
interface AssetReference {
|
|
67
|
-
$asset: string;
|
|
68
|
-
}
|
|
69
|
-
/** Whether a value is a well-formed asset-reference marker. */
|
|
70
|
-
declare function isAssetReference(value: unknown): value is AssetReference;
|
|
71
|
-
/**
|
|
72
|
-
* One reference a plugin found in an asset's parameters. `field` is the
|
|
73
|
-
* dot-path of the parameter field holding the reference (for messages);
|
|
74
|
-
* `expectedTypes` constrains the target's asset type (empty = any type).
|
|
75
|
-
*/
|
|
76
|
-
interface CollectedReference {
|
|
77
|
-
field: string;
|
|
78
|
-
assetId: string;
|
|
79
|
-
expectedTypes: readonly string[];
|
|
80
|
-
}
|
|
81
|
-
//#endregion
|
|
82
|
-
//#region src/plugins/contract.d.ts
|
|
83
|
-
interface AssetTypePluginDescriptor<TParameters, TPluginConfig = unknown> {
|
|
84
|
-
/** Asset type key, e.g. 'image' | 'slice'. */
|
|
85
|
-
type: string;
|
|
86
|
-
/** Ingestion: lowercase file extensions (without dot) claimed by this type. */
|
|
87
|
-
accepts: string[];
|
|
88
|
-
/** Parameters a freshly ingested asset starts with. */
|
|
89
|
-
defaultParameters(pluginConfig: TPluginConfig): TParameters;
|
|
90
|
-
/** Validate an unknown parameter blob; returns the typed value or throws. */
|
|
91
|
-
validateParameters(value: unknown): TParameters;
|
|
92
|
-
/**
|
|
93
|
-
* Enumerate the asset references in a validated parameter value.
|
|
94
|
-
* A plugin that declares reference fields must list every one of them here —
|
|
95
|
-
* core and server never introspect parameter blobs to find references.
|
|
96
|
-
* Omitted = the type declares no references (image, slice).
|
|
97
|
-
*/
|
|
98
|
-
collectReferences?(parameters: TParameters): CollectedReference[];
|
|
99
|
-
/**
|
|
100
|
-
* The subset of a validated parameter value the plugin's server-side
|
|
101
|
-
* `process()` actually consumes — the canonicalized form of this value feeds
|
|
102
|
-
* the job hash, so only these fields can force a reprocess.
|
|
103
|
-
* Entry-only parameters (chroma-key tuning, asset references) must be left
|
|
104
|
-
* out: they change the generated manifest entry, not the proxy bytes.
|
|
105
|
-
* Omitted = every parameter is processing-relevant (image, slice, video,
|
|
106
|
-
* audio).
|
|
107
|
-
*/
|
|
108
|
-
processingParameters?(parameters: TParameters): unknown;
|
|
109
|
-
}
|
|
110
|
-
//#endregion
|
|
111
|
-
//#region src/api-types.d.ts
|
|
112
|
-
/** One end of a reference edge: the parameter field and the asset across it. */
|
|
113
|
-
interface AssetReferenceLinkDto {
|
|
114
|
-
/** Dot-path of the referrer's parameter field holding the reference. */
|
|
115
|
-
field: string;
|
|
116
|
-
/** The asset on the other side: the target (outgoing) or the referrer (incoming). */
|
|
117
|
-
assetId: string;
|
|
118
|
-
}
|
|
119
|
-
/** An asset's reference edges in both directions. */
|
|
120
|
-
interface AssetReferencesDto {
|
|
121
|
-
outgoing: AssetReferenceLinkDto[];
|
|
122
|
-
incoming: AssetReferenceLinkDto[];
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* One derived passive membership of an asset: the manifest it
|
|
126
|
-
* is pulled into and the explicit-member roots whose reference closure pulls
|
|
127
|
-
* it in ("via characterGreenscreen" — the editor's attribution).
|
|
128
|
-
*/
|
|
129
|
-
interface PassiveManifestMembershipDto {
|
|
130
|
-
manifest: string;
|
|
131
|
-
via: string[];
|
|
132
|
-
}
|
|
133
|
-
/** One passive member of a manifest, with explicit-root attribution. */
|
|
134
|
-
interface PassiveMemberDto {
|
|
135
|
-
assetId: string;
|
|
136
|
-
via: string[];
|
|
137
|
-
}
|
|
138
|
-
/** One manifest's membership picture for the manifests view. */
|
|
139
|
-
interface ManifestMembershipDto {
|
|
140
|
-
/** Members stored in the library — the manifest's typed API surface. */
|
|
141
|
-
explicitMemberIds: string[];
|
|
142
|
-
/** Members derived from the reference graph, with via-attribution. */
|
|
143
|
-
passiveMembers: PassiveMemberDto[];
|
|
144
|
-
}
|
|
145
|
-
/** One asset's derived, display-ready status alongside the raw library record. */
|
|
146
|
-
interface AssetStateDto {
|
|
147
|
-
id: string;
|
|
148
|
-
type: string;
|
|
149
|
-
/** Raw file name (relative to the raw dir). */
|
|
150
|
-
raw: string;
|
|
151
|
-
/** Explicit folder path, or the empty string for the implicit root. */
|
|
152
|
-
folder: string;
|
|
153
|
-
/** URL the Fundus server serves the raw file under (`/files/raw/<fileName>`). */
|
|
154
|
-
rawUrl: string;
|
|
155
|
-
rawHash: string;
|
|
156
|
-
parameters: unknown;
|
|
157
|
-
manifests: string[];
|
|
158
|
-
/** Derived passive memberships with attribution, sorted by manifest name. */
|
|
159
|
-
passiveManifests: PassiveManifestMembershipDto[];
|
|
160
|
-
/** Delivered proxy status; `null` while the asset is not delivered or unprocessed. */
|
|
161
|
-
proxy: ProxyStateDto | null;
|
|
162
|
-
/** Human-readable warnings: unreachable asset, stale proxy, validation problems. */
|
|
163
|
-
warnings: string[];
|
|
164
|
-
/** Reference edges in both directions (empty lists for reference-free types). */
|
|
165
|
-
references: AssetReferencesDto;
|
|
166
|
-
}
|
|
167
|
-
interface ProxyStateDto {
|
|
168
|
-
/** Basename of the proxy file. */
|
|
169
|
-
fileName: string;
|
|
170
|
-
/** Path relative to proxyDir, including the mirrored asset folder. */
|
|
171
|
-
relativePath: string;
|
|
172
|
-
/** URL the Fundus server serves the proxy under (`/files/proxy/<fileName>`). */
|
|
173
|
-
url: string;
|
|
174
|
-
/** Whether the file named by the current job hash exists. */
|
|
175
|
-
upToDate: boolean;
|
|
176
|
-
/** Intrinsic pixel dimensions; absent for audio proxies. */
|
|
177
|
-
width?: number;
|
|
178
|
-
height?: number;
|
|
179
|
-
/** Media duration; present for video and audio proxies. */
|
|
180
|
-
durationMs?: number;
|
|
181
|
-
fileSize: number;
|
|
182
|
-
}
|
|
183
|
-
/** The full editor state payload returned by `GET /api/state` and every mutation. */
|
|
184
|
-
interface FundusStateDto {
|
|
185
|
-
library: Library;
|
|
186
|
-
assets: AssetStateDto[];
|
|
187
|
-
/** Library-level validation issues (per asset where attributable). */
|
|
188
|
-
issues: ValidationIssueDto[];
|
|
189
|
-
/** Available preset names per asset type (from the merged plugin config). */
|
|
190
|
-
presetNames: Record<string, string[]>;
|
|
191
|
-
/** Per manifest: explicit + passive member lists (the manifests view data). */
|
|
192
|
-
manifestMemberships: Record<string, ManifestMembershipDto>;
|
|
193
|
-
/**
|
|
194
|
-
* Delivered bytes per manifest over its full delivery set (explicit ∪
|
|
195
|
-
* passive members), deduplicated — the preload-budget number.
|
|
196
|
-
*/
|
|
197
|
-
manifestDeliveredBytes: Record<string, number>;
|
|
198
|
-
}
|
|
199
|
-
interface ValidationIssueDto {
|
|
200
|
-
assetId?: string;
|
|
201
|
-
message: string;
|
|
202
|
-
}
|
|
203
|
-
/** Body of `PATCH /api/assets/:id` — all fields optional, applied together. */
|
|
204
|
-
interface PatchAssetRequestDto {
|
|
205
|
-
parameters?: unknown;
|
|
206
|
-
manifests?: string[];
|
|
207
|
-
renameTo?: string;
|
|
208
|
-
/** Move the asset to this registered folder; empty string means root. */
|
|
209
|
-
folder?: string;
|
|
210
|
-
}
|
|
211
|
-
interface CreateFolderRequestDto {
|
|
212
|
-
path: string;
|
|
213
|
-
}
|
|
214
|
-
interface PatchFolderRequestDto {
|
|
215
|
-
/** Replacement name for the final path segment. */
|
|
216
|
-
name?: string;
|
|
217
|
-
/** Move the folder below this registered parent; empty string means root. */
|
|
218
|
-
parent?: string;
|
|
219
|
-
}
|
|
220
|
-
interface MoveAssetsRequestDto {
|
|
221
|
-
assetIds: string[];
|
|
222
|
-
/** Registered destination folder; empty string means root. */
|
|
223
|
-
folder: string;
|
|
224
|
-
}
|
|
225
|
-
interface DeleteAssetsRequestDto {
|
|
226
|
-
assetIds: string[];
|
|
227
|
-
}
|
|
228
|
-
/** Body of `POST /api/manifests`. */
|
|
229
|
-
interface CreateManifestRequestDto {
|
|
230
|
-
name: string;
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Body of `PATCH /api/manifests/:name` — the manifest's editor appearance
|
|
234
|
-
* and/or a rename. A `null` clears that field; an omitted field is left
|
|
235
|
-
* unchanged.
|
|
236
|
-
*/
|
|
237
|
-
interface PatchManifestRequestDto {
|
|
238
|
-
color?: string | null;
|
|
239
|
-
emoji?: string | null;
|
|
240
|
-
renameTo?: string;
|
|
241
|
-
}
|
|
242
|
-
/** Error payload for non-2xx API responses. */
|
|
243
|
-
interface ApiErrorDto {
|
|
244
|
-
error: {
|
|
245
|
-
message: string;
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
//#endregion
|
|
249
|
-
//#region src/reference-graph.d.ts
|
|
250
|
-
/** The plugin registry shape shared by server and tests: type → descriptor. */
|
|
251
|
-
type PluginDescriptorRegistry = Record<string, AssetTypePluginDescriptor<unknown, unknown>>;
|
|
252
|
-
/** Per-asset outgoing references, keyed by asset id (every asset gets a key). */
|
|
253
|
-
type ReferencesByAsset = Record<AssetId, CollectedReference[]>;
|
|
254
|
-
/**
|
|
255
|
-
* Ask each asset's owning plugin for the references in its parameters. Assets
|
|
256
|
-
* whose type is unknown or whose parameters do not validate contribute no
|
|
257
|
-
* references — those problems are reported by the regular validation pass.
|
|
258
|
-
*/
|
|
259
|
-
declare function collectAllReferences(library: Library, plugins: PluginDescriptorRegistry): ReferencesByAsset;
|
|
260
|
-
/**
|
|
261
|
-
* Reference *errors* (they block build/codegen): a reference to an unknown
|
|
262
|
-
* asset, a target whose type is not among the field's expected types, and
|
|
263
|
-
* cycles (composition is acyclic by nature).
|
|
264
|
-
*/
|
|
265
|
-
declare function referenceErrors(library: Library, referencesByAsset: ReferencesByAsset): ValidationIssueDto[];
|
|
266
|
-
/**
|
|
267
|
-
* The transitive reference closure of a set of assets, including the starting
|
|
268
|
-
* set — the assets that must be delivered so the starting set renders as
|
|
269
|
-
* authored. Tolerates cycles and ignores dangling targets (both are reported
|
|
270
|
-
* as errors by `referenceErrors`).
|
|
271
|
-
*/
|
|
272
|
-
declare function referenceClosure(assetIds: Iterable<AssetId>, referencesByAsset: ReferencesByAsset): Set<AssetId>;
|
|
273
|
-
/**
|
|
274
|
-
* A dependencies-first order over `assetIds` and everything they transitively
|
|
275
|
-
* reference — the build order that lets each entry inline its references from
|
|
276
|
-
* already-built entries. Throws on a cycle (with the cycle path).
|
|
277
|
-
*/
|
|
278
|
-
declare function topologicalReferenceOrder(assetIds: Iterable<AssetId>, referencesByAsset: ReferencesByAsset): AssetId[];
|
|
279
|
-
//#endregion
|
|
280
|
-
export { Library as A, ValidationIssueDto as C, isAssetReference as D, CollectedReference as E, serializeLibrary as F, ManifestRecord as M, createEmptyLibrary as N, AssetId as O, parseLibrary as P, ProxyStateDto as S, AssetReference as T, PassiveManifestMembershipDto as _, referenceErrors as a, PatchFolderRequestDto as b, AssetReferenceLinkDto as c, CreateFolderRequestDto as d, CreateManifestRequestDto as f, MoveAssetsRequestDto as g, ManifestMembershipDto as h, referenceClosure as i, ManifestName as j, AssetRecord as k, AssetReferencesDto as l, FundusStateDto as m, ReferencesByAsset as n, topologicalReferenceOrder as o, DeleteAssetsRequestDto as p, collectAllReferences as r, ApiErrorDto as s, PluginDescriptorRegistry as t, AssetStateDto as u, PassiveMemberDto as v, AssetTypePluginDescriptor as w, PatchManifestRequestDto as x, PatchAssetRequestDto as y };
|
package/dist/core/testing.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { A as Library, T as AssetReference, k as AssetRecord, t as PluginDescriptorRegistry, w as AssetTypePluginDescriptor } from "./reference-graph-CjuHbLDw.js";
|
|
2
|
-
|
|
3
|
-
//#region src/testing.d.ts
|
|
4
|
-
interface ReferenceFixtureParameters {
|
|
5
|
-
/** An image reference — mirrors chroma-key-video's `mask`/`fallback` fields. */
|
|
6
|
-
mask?: AssetReference;
|
|
7
|
-
/** A same-type reference so chains and cycles are constructible. */
|
|
8
|
-
next?: AssetReference;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* The fixture plugin: type `reference-fixture`, two optional reference fields.
|
|
12
|
-
* `mask` expects an `image` target, `next` expects another `reference-fixture`.
|
|
13
|
-
*/
|
|
14
|
-
declare const referenceFixturePlugin: AssetTypePluginDescriptor<ReferenceFixtureParameters, unknown>;
|
|
15
|
-
/** A minimal fixture-type asset record for graph tests. */
|
|
16
|
-
declare function referenceFixtureRecord(options: {
|
|
17
|
-
parameters?: ReferenceFixtureParameters;
|
|
18
|
-
manifests?: string[];
|
|
19
|
-
}): AssetRecord;
|
|
20
|
-
/** A minimal image asset record for graph tests. */
|
|
21
|
-
declare function imageFixtureRecord(options?: {
|
|
22
|
-
manifests?: string[];
|
|
23
|
-
}): AssetRecord;
|
|
24
|
-
declare function libraryWith(assets: Library['assets'], manifests?: string[]): Library;
|
|
25
|
-
declare const fixturePluginRegistry: PluginDescriptorRegistry;
|
|
26
|
-
//#endregion
|
|
27
|
-
export { ReferenceFixtureParameters, fixturePluginRegistry, imageFixtureRecord, libraryWith, referenceFixturePlugin, referenceFixtureRecord };
|
package/dist/core/testing.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { a as isAssetReference, r as imagePlugin } from "./image-Dqmz8FXS.js";
|
|
2
|
-
//#region src/testing.ts
|
|
3
|
-
/**
|
|
4
|
-
* Test fixtures shared across the Fundus packages (imported as
|
|
5
|
-
* `@fundus/core/testing`, never from the main entry point). The reference
|
|
6
|
-
* fixture plugin stays environment-free while exercising reference graphs,
|
|
7
|
-
* codegen inlining, warnings, and editor state shapes.
|
|
8
|
-
*/
|
|
9
|
-
function validateOptionalReference(label, value) {
|
|
10
|
-
if (value === void 0) return void 0;
|
|
11
|
-
if (!isAssetReference(value)) throw new Error(`Fixture "${label}" must be an asset reference ({ "$asset": "<id>" }).`);
|
|
12
|
-
return { $asset: value.$asset };
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* The fixture plugin: type `reference-fixture`, two optional reference fields.
|
|
16
|
-
* `mask` expects an `image` target, `next` expects another `reference-fixture`.
|
|
17
|
-
*/
|
|
18
|
-
const referenceFixturePlugin = {
|
|
19
|
-
type: "reference-fixture",
|
|
20
|
-
accepts: ["png"],
|
|
21
|
-
defaultParameters: () => ({}),
|
|
22
|
-
validateParameters(value) {
|
|
23
|
-
if (typeof value !== "object" || value === null || Array.isArray(value)) throw new Error("Fixture parameters must be an object.");
|
|
24
|
-
const record = value;
|
|
25
|
-
const mask = validateOptionalReference("mask", record.mask);
|
|
26
|
-
const next = validateOptionalReference("next", record.next);
|
|
27
|
-
return {
|
|
28
|
-
...mask !== void 0 ? { mask } : {},
|
|
29
|
-
...next !== void 0 ? { next } : {}
|
|
30
|
-
};
|
|
31
|
-
},
|
|
32
|
-
collectReferences(parameters) {
|
|
33
|
-
const references = [];
|
|
34
|
-
if (parameters.mask) references.push({
|
|
35
|
-
field: "mask",
|
|
36
|
-
assetId: parameters.mask.$asset,
|
|
37
|
-
expectedTypes: ["image"]
|
|
38
|
-
});
|
|
39
|
-
if (parameters.next) references.push({
|
|
40
|
-
field: "next",
|
|
41
|
-
assetId: parameters.next.$asset,
|
|
42
|
-
expectedTypes: ["reference-fixture"]
|
|
43
|
-
});
|
|
44
|
-
return references;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
/** A minimal fixture-type asset record for graph tests. */
|
|
48
|
-
function referenceFixtureRecord(options) {
|
|
49
|
-
return {
|
|
50
|
-
type: referenceFixturePlugin.type,
|
|
51
|
-
raw: "fixture.png",
|
|
52
|
-
rawHash: "fixturehash",
|
|
53
|
-
parameters: options.parameters ?? {},
|
|
54
|
-
manifests: options.manifests ?? []
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
/** A minimal image asset record for graph tests. */
|
|
58
|
-
function imageFixtureRecord(options = {}) {
|
|
59
|
-
return {
|
|
60
|
-
type: "image",
|
|
61
|
-
raw: "image.png",
|
|
62
|
-
rawHash: "imagehash",
|
|
63
|
-
parameters: { preset: "default" },
|
|
64
|
-
manifests: options.manifests ?? []
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
function libraryWith(assets, manifests = ["main"]) {
|
|
68
|
-
return {
|
|
69
|
-
version: 1,
|
|
70
|
-
folders: [],
|
|
71
|
-
assets,
|
|
72
|
-
manifests: Object.fromEntries(manifests.map((name) => [name, {}]))
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
const fixturePluginRegistry = {
|
|
76
|
-
[imagePlugin.type]: imagePlugin,
|
|
77
|
-
[referenceFixturePlugin.type]: referenceFixturePlugin
|
|
78
|
-
};
|
|
79
|
-
//#endregion
|
|
80
|
-
export { fixturePluginRegistry, imageFixtureRecord, libraryWith, referenceFixturePlugin, referenceFixtureRecord };
|
package/dist/editor/200.html
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
-
<link href="/_app/immutable/entry/start.C8HHOLly.js" rel="modulepreload">
|
|
7
|
-
<link href="/_app/immutable/chunks/DjvOiDmq.js" rel="modulepreload">
|
|
8
|
-
<link href="/_app/immutable/chunks/CNRz3sSw.js" rel="modulepreload">
|
|
9
|
-
<link href="/_app/immutable/entry/app.BkqbfI8n.js" rel="modulepreload">
|
|
10
|
-
<link href="/_app/immutable/chunks/xihTtKlq.js" rel="modulepreload">
|
|
11
|
-
<link href="/_app/immutable/nodes/0.xdMI5GEU.js" rel="modulepreload">
|
|
12
|
-
<link href="/_app/immutable/chunks/BfPE5wdt.js" rel="modulepreload">
|
|
13
|
-
<link href="/_app/immutable/chunks/CO4RBJfa.js" rel="modulepreload">
|
|
14
|
-
|
|
15
|
-
<link href="/_app/immutable/assets/0.DLhIsYA_.css" rel="stylesheet">
|
|
16
|
-
</head>
|
|
17
|
-
<body data-sveltekit-preload-data="hover">
|
|
18
|
-
<div style="display: contents">
|
|
19
|
-
<script>
|
|
20
|
-
{
|
|
21
|
-
__sveltekit_csqgqe = {
|
|
22
|
-
base: ""
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const element = document.currentScript.parentElement;
|
|
26
|
-
|
|
27
|
-
Promise.all([
|
|
28
|
-
import("/_app/immutable/entry/start.C8HHOLly.js"),
|
|
29
|
-
import("/_app/immutable/entry/app.BkqbfI8n.js")
|
|
30
|
-
]).then(([kit, app]) => {
|
|
31
|
-
kit.start(app, element);
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
</script>
|
|
35
|
-
</div>
|
|
36
|
-
</body>
|
|
37
|
-
</html>
|