Code-first video & image, rendered natively on WebGPU.
rm react dep
okanasl0658361d80e1
diff --git a/nodes/node-apply-lut/package.json b/nodes/node-apply-lut/package.jsonindex 23ed3919..dfecbb7b 100644--- a/nodes/node-apply-lut/package.json+++ b/nodes/node-apply-lut/package.json@@ -7,7 +7,7 @@"kind": "effect"},"type": "module",- "license": "APGL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-apply-lut/tsconfig.json b/nodes/node-apply-lut/tsconfig.jsonindex 7e10f91f..8ecf1346 100644--- a/nodes/node-apply-lut/tsconfig.json+++ b/nodes/node-apply-lut/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-audio-compressor/package.json b/nodes/node-audio-compressor/package.jsonindex 15bd0326..09681f12 100644--- a/nodes/node-audio-compressor/package.json+++ b/nodes/node-audio-compressor/package.json@@ -1,6 +1,7 @@{"name": "@gitframes/node-audio-compressor","version": "1.3.2",+ "license": "Apache-2.0","private": false,"gitframes": {"type": "AudioCompressor",diff --git a/nodes/node-audio-compressor/tsconfig.json b/nodes/node-audio-compressor/tsconfig.jsonindex e0cb7990..474ae843 100644--- a/nodes/node-audio-compressor/tsconfig.json+++ b/nodes/node-audio-compressor/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-audio-delay/package.json b/nodes/node-audio-delay/package.jsonindex b7ec19f4..549017ee 100644--- a/nodes/node-audio-delay/package.json+++ b/nodes/node-audio-delay/package.json@@ -1,6 +1,7 @@{"name": "@gitframes/node-audio-delay","version": "1.3.2",+ "license": "Apache-2.0","private": false,"gitframes": {"type": "AudioDelay",diff --git a/nodes/node-audio-delay/tsconfig.json b/nodes/node-audio-delay/tsconfig.jsonindex e0cb7990..474ae843 100644--- a/nodes/node-audio-delay/tsconfig.json+++ b/nodes/node-audio-delay/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-audio-fade/package.json b/nodes/node-audio-fade/package.jsonindex ce4108eb..375485e2 100644--- a/nodes/node-audio-fade/package.json+++ b/nodes/node-audio-fade/package.json@@ -1,6 +1,7 @@{"name": "@gitframes/node-audio-fade","version": "1.3.2",+ "license": "Apache-2.0","private": false,"gitframes": {"type": "AudioFade",diff --git a/nodes/node-audio-fade/tsconfig.json b/nodes/node-audio-fade/tsconfig.jsonindex e0cb7990..474ae843 100644--- a/nodes/node-audio-fade/tsconfig.json+++ b/nodes/node-audio-fade/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-audio-noise-gate/package.json b/nodes/node-audio-noise-gate/package.jsonindex 4bcdab61..0aa2e826 100644--- a/nodes/node-audio-noise-gate/package.json+++ b/nodes/node-audio-noise-gate/package.json@@ -1,6 +1,7 @@{"name": "@gitframes/node-audio-noise-gate","version": "1.3.2",+ "license": "Apache-2.0","private": false,"gitframes": {"type": "AudioNoiseGate",diff --git a/nodes/node-audio-noise-gate/tsconfig.json b/nodes/node-audio-noise-gate/tsconfig.jsonindex e0cb7990..474ae843 100644--- a/nodes/node-audio-noise-gate/tsconfig.json+++ b/nodes/node-audio-noise-gate/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-audio-parametric-eq/package.json b/nodes/node-audio-parametric-eq/package.jsonindex 74d6cf4e..f0b21d29 100644--- a/nodes/node-audio-parametric-eq/package.json+++ b/nodes/node-audio-parametric-eq/package.json@@ -1,6 +1,7 @@{"name": "@gitframes/node-audio-parametric-eq","version": "1.3.2",+ "license": "Apache-2.0","private": false,"gitframes": {"type": "AudioParametricEq",diff --git a/nodes/node-audio-parametric-eq/tsconfig.json b/nodes/node-audio-parametric-eq/tsconfig.jsonindex e0cb7990..474ae843 100644--- a/nodes/node-audio-parametric-eq/tsconfig.json+++ b/nodes/node-audio-parametric-eq/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-audio-reverb/package.json b/nodes/node-audio-reverb/package.jsonindex 3a70109e..d5fb07d9 100644--- a/nodes/node-audio-reverb/package.json+++ b/nodes/node-audio-reverb/package.json@@ -1,6 +1,7 @@{"name": "@gitframes/node-audio-reverb","version": "1.3.2",+ "license": "Apache-2.0","private": false,"gitframes": {"type": "AudioReverb",diff --git a/nodes/node-audio-reverb/tsconfig.json b/nodes/node-audio-reverb/tsconfig.jsonindex e0cb7990..474ae843 100644--- a/nodes/node-audio-reverb/tsconfig.json+++ b/nodes/node-audio-reverb/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-audio-signal-extractor/package.json b/nodes/node-audio-signal-extractor/package.jsonindex 3c3b8e80..756f8d27 100644--- a/nodes/node-audio-signal-extractor/package.json+++ b/nodes/node-audio-signal-extractor/package.json@@ -7,7 +7,7 @@"kind": "audio"},"type": "module",- "license": "AGPL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-audio-signal-extractor/tsconfig.json b/nodes/node-audio-signal-extractor/tsconfig.jsonindex 7d60bce0..8ecf1346 100644--- a/nodes/node-audio-signal-extractor/tsconfig.json+++ b/nodes/node-audio-signal-extractor/tsconfig.json@@ -1,11 +1,10 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {"@/*": ["./src/*"]},- "jsx": "react-jsx","experimentalDecorators": true,"emitDecoratorMetadata": true},diff --git a/nodes/node-blur/package.json b/nodes/node-blur/package.jsonindex 24dad1c4..e075f240 100644--- a/nodes/node-blur/package.json+++ b/nodes/node-blur/package.json@@ -9,7 +9,7 @@"custom": true},"type": "module",- "license": "APGL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-blur/tsconfig.json b/nodes/node-blur/tsconfig.jsonindex 7e10f91f..8ecf1346 100644--- a/nodes/node-blur/tsconfig.json+++ b/nodes/node-blur/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-camera-parallax-3d/package.json b/nodes/node-camera-parallax-3d/package.jsonindex 25cf7e1e..5dbb1093 100644--- a/nodes/node-camera-parallax-3d/package.json+++ b/nodes/node-camera-parallax-3d/package.json@@ -7,7 +7,7 @@"kind": "effect"},"type": "module",- "license": "APGL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-camera-parallax-3d/tsconfig.json b/nodes/node-camera-parallax-3d/tsconfig.jsonindex 7e10f91f..8ecf1346 100644--- a/nodes/node-camera-parallax-3d/tsconfig.json+++ b/nodes/node-camera-parallax-3d/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-canvas-generator/package.json b/nodes/node-canvas-generator/package.jsonindex 257b90d8..2d222075 100644--- a/nodes/node-canvas-generator/package.json+++ b/nodes/node-canvas-generator/package.json@@ -1,6 +1,7 @@{"name": "@gitframes/node-canvas-generator","version": "1.3.2",+ "license": "Apache-2.0","private": false,"gitframes": {"type": "CanvasGenerator",diff --git a/nodes/node-canvas-generator/tsconfig.json b/nodes/node-canvas-generator/tsconfig.jsonindex 3bc46723..8c3717bb 100644--- a/nodes/node-canvas-generator/tsconfig.json+++ b/nodes/node-canvas-generator/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-caption-editor/package.json b/nodes/node-caption-editor/package.jsonindex af36c3ae..dfde75f9 100644--- a/nodes/node-caption-editor/package.json+++ b/nodes/node-caption-editor/package.json@@ -1,6 +1,7 @@{"name": "@gitframes/node-caption-editor","version": "1.3.2",+ "license": "Apache-2.0","private": false,"gitframes": {"type": "CaptionEditor",diff --git a/nodes/node-caption-editor/tsconfig.json b/nodes/node-caption-editor/tsconfig.jsonindex 7e10f91f..8ecf1346 100644--- a/nodes/node-caption-editor/tsconfig.json+++ b/nodes/node-caption-editor/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-caption-generator/package.json b/nodes/node-caption-generator/package.jsonindex 7d7cd537..54e7e5f3 100644--- a/nodes/node-caption-generator/package.json+++ b/nodes/node-caption-generator/package.json@@ -1,6 +1,7 @@{"name": "@gitframes/node-caption-generator","version": "1.3.2",+ "license": "Apache-2.0","private": false,"gitframes": {"type": "CaptionGenerator",diff --git a/nodes/node-caption-generator/tsconfig.json b/nodes/node-caption-generator/tsconfig.jsonindex 7e10f91f..8ecf1346 100644--- a/nodes/node-caption-generator/tsconfig.json+++ b/nodes/node-caption-generator/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-channel-merger/package.json b/nodes/node-channel-merger/package.jsonindex 5ac1e4e0..49af4d31 100644--- a/nodes/node-channel-merger/package.json+++ b/nodes/node-channel-merger/package.json@@ -7,7 +7,7 @@"kind": "effect"},"type": "module",- "license": "AGPL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-channel-merger/tsconfig.json b/nodes/node-channel-merger/tsconfig.jsonindex 7e10f91f..8ecf1346 100644--- a/nodes/node-channel-merger/tsconfig.json+++ b/nodes/node-channel-merger/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-channel-splitter/package.json b/nodes/node-channel-splitter/package.jsonindex c665d738..c58d55f5 100644--- a/nodes/node-channel-splitter/package.json+++ b/nodes/node-channel-splitter/package.json@@ -7,7 +7,7 @@"kind": "effect"},"type": "module",- "license": "AGPL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-channel-splitter/tsconfig.json b/nodes/node-channel-splitter/tsconfig.jsonindex 7e10f91f..8ecf1346 100644--- a/nodes/node-channel-splitter/tsconfig.json+++ b/nodes/node-channel-splitter/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-color-balance/package.json b/nodes/node-color-balance/package.jsonindex 7799a31c..58306d70 100644--- a/nodes/node-color-balance/package.json+++ b/nodes/node-color-balance/package.json@@ -8,7 +8,7 @@"schema": "ColorBalanceNodeConfigSchema"},"type": "module",- "license": "AGPL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-color-balance/tsconfig.json b/nodes/node-color-balance/tsconfig.jsonindex 938ce468..88b1208d 100644--- a/nodes/node-color-balance/tsconfig.json+++ b/nodes/node-color-balance/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","esModuleInterop": true,diff --git a/nodes/node-colorkey/package.json b/nodes/node-colorkey/package.jsonindex b3e01d10..07c0d1ad 100644--- a/nodes/node-colorkey/package.json+++ b/nodes/node-colorkey/package.json@@ -1,6 +1,7 @@{"name": "@gitframes/node-colorkey","version": "1.3.2",+ "license": "Apache-2.0","private": false,"gitframes": {"type": "ColorKey",diff --git a/nodes/node-colorkey/tsconfig.json b/nodes/node-colorkey/tsconfig.jsonindex 3bc46723..8c3717bb 100644--- a/nodes/node-colorkey/tsconfig.json+++ b/nodes/node-colorkey/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-compositor/package.json b/nodes/node-compositor/package.jsonindex 3c8a6e5c..3be64ff6 100644--- a/nodes/node-compositor/package.json+++ b/nodes/node-compositor/package.json@@ -7,7 +7,7 @@"kind": "utility"},"type": "module",- "license": "APGL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-compositor/tsconfig.json b/nodes/node-compositor/tsconfig.jsonindex 26c5307a..f9615455 100644--- a/nodes/node-compositor/tsconfig.json+++ b/nodes/node-compositor/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","lib": ["ES2022", "ESNext", "DOM", "DOM.Iterable"],diff --git a/nodes/node-corner-pin/package.json b/nodes/node-corner-pin/package.jsonindex 7bcbd6f4..4c03bd46 100644--- a/nodes/node-corner-pin/package.json+++ b/nodes/node-corner-pin/package.json@@ -1,6 +1,7 @@{"name": "@gitframes/node-corner-pin","version": "1.3.2",+ "license": "Apache-2.0","private": false,"gitframes": {"type": "CornerPin",diff --git a/nodes/node-corner-pin/tsconfig.json b/nodes/node-corner-pin/tsconfig.jsonindex 3bc46723..8c3717bb 100644--- a/nodes/node-corner-pin/tsconfig.json+++ b/nodes/node-corner-pin/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-crop/package.json b/nodes/node-crop/package.jsonindex b053e5cb..9df05b21 100644--- a/nodes/node-crop/package.json+++ b/nodes/node-crop/package.json@@ -1,6 +1,7 @@{"name": "@gitframes/node-crop","version": "1.3.2",+ "license": "Apache-2.0","private": false,"gitframes": {"type": "Crop",diff --git a/nodes/node-crop/tsconfig.json b/nodes/node-crop/tsconfig.jsonindex 3bc46723..8c3717bb 100644--- a/nodes/node-crop/tsconfig.json+++ b/nodes/node-crop/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-curves/package.json b/nodes/node-curves/package.jsonindex 8871cba7..35527512 100644--- a/nodes/node-curves/package.json+++ b/nodes/node-curves/package.json@@ -1,6 +1,7 @@{"name": "@gitframes/node-curves","version": "1.3.2",+ "license": "Apache-2.0","private": false,"gitframes": {"type": "Curves",diff --git a/nodes/node-curves/tsconfig.json b/nodes/node-curves/tsconfig.jsonindex 938ce468..88b1208d 100644--- a/nodes/node-curves/tsconfig.json+++ b/nodes/node-curves/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","esModuleInterop": true,diff --git a/nodes/node-deflicker/package.json b/nodes/node-deflicker/package.jsonindex f37ee604..17c0c78c 100644--- a/nodes/node-deflicker/package.json+++ b/nodes/node-deflicker/package.json@@ -10,7 +10,7 @@]},"type": "module",- "license": "AGPL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-deflicker/tsconfig.json b/nodes/node-deflicker/tsconfig.jsonindex 7e10f91f..8ecf1346 100644--- a/nodes/node-deflicker/tsconfig.json+++ b/nodes/node-deflicker/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-displacement-map/package.json b/nodes/node-displacement-map/package.jsonindex 3f393fbe..a354416d 100644--- a/nodes/node-displacement-map/package.json+++ b/nodes/node-displacement-map/package.json@@ -7,7 +7,7 @@"kind": "effect"},"type": "module",- "license": "APGL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-displacement-map/tsconfig.json b/nodes/node-displacement-map/tsconfig.jsonindex 7e10f91f..8ecf1346 100644--- a/nodes/node-displacement-map/tsconfig.json+++ b/nodes/node-displacement-map/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-extract-frame/package.json b/nodes/node-extract-frame/package.jsonindex 6c2ce129..3c082045 100644--- a/nodes/node-extract-frame/package.json+++ b/nodes/node-extract-frame/package.json@@ -1,6 +1,7 @@{"name": "@gitframes/node-extract-frame","version": "1.3.2",+ "license": "Apache-2.0","private": false,"gitframes": {"type": "ExtractFrame",diff --git a/nodes/node-extract-frame/tsconfig.json b/nodes/node-extract-frame/tsconfig.jsonindex 3bc46723..8c3717bb 100644--- a/nodes/node-extract-frame/tsconfig.json+++ b/nodes/node-extract-frame/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-extract-lut/package.json b/nodes/node-extract-lut/package.jsonindex c7e22628..da7605ac 100644--- a/nodes/node-extract-lut/package.json+++ b/nodes/node-extract-lut/package.json@@ -7,7 +7,7 @@"kind": "effect"},"type": "module",- "license": "APGL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-extract-lut/tsconfig.json b/nodes/node-extract-lut/tsconfig.jsonindex 7e10f91f..8ecf1346 100644--- a/nodes/node-extract-lut/tsconfig.json+++ b/nodes/node-extract-lut/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-film-grain/package.json b/nodes/node-film-grain/package.jsonindex 69c8f4a5..1cc2a9be 100644--- a/nodes/node-film-grain/package.json+++ b/nodes/node-film-grain/package.json@@ -7,7 +7,7 @@"kind": "effect"},"type": "module",- "license": "APGL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-film-grain/tsconfig.json b/nodes/node-film-grain/tsconfig.jsonindex 7e10f91f..8ecf1346 100644--- a/nodes/node-film-grain/tsconfig.json+++ b/nodes/node-film-grain/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-flip/package.json b/nodes/node-flip/package.jsonindex 18abeee3..82c3987d 100644--- a/nodes/node-flip/package.json+++ b/nodes/node-flip/package.json@@ -7,7 +7,7 @@"kind": "effect"},"type": "module",- "license": "APGL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-flip/tsconfig.json b/nodes/node-flip/tsconfig.jsonindex 7e10f91f..8ecf1346 100644--- a/nodes/node-flip/tsconfig.json+++ b/nodes/node-flip/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-gradient-map/package.json b/nodes/node-gradient-map/package.jsonindex cedf0bd4..b27a8cd7 100644--- a/nodes/node-gradient-map/package.json+++ b/nodes/node-gradient-map/package.json@@ -7,7 +7,7 @@"kind": "effect"},"type": "module",- "license": "AGPL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-gradient-map/tsconfig.json b/nodes/node-gradient-map/tsconfig.jsonindex 938ce468..88b1208d 100644--- a/nodes/node-gradient-map/tsconfig.json+++ b/nodes/node-gradient-map/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","esModuleInterop": true,diff --git a/nodes/node-halftone-screen/package.json b/nodes/node-halftone-screen/package.jsonindex e178faee..7858a415 100644--- a/nodes/node-halftone-screen/package.json+++ b/nodes/node-halftone-screen/package.json@@ -7,7 +7,7 @@"kind": "effect"},"type": "module",- "license": "APGL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-halftone-screen/tsconfig.json b/nodes/node-halftone-screen/tsconfig.jsonindex 7e10f91f..8ecf1346 100644--- a/nodes/node-halftone-screen/tsconfig.json+++ b/nodes/node-halftone-screen/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-high-pass/package.json b/nodes/node-high-pass/package.jsonindex 204cfce4..4b809232 100644--- a/nodes/node-high-pass/package.json+++ b/nodes/node-high-pass/package.json@@ -7,7 +7,7 @@"kind": "effect"},"type": "module",- "license": "APGL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-high-pass/tsconfig.json b/nodes/node-high-pass/tsconfig.jsonindex 7e10f91f..8ecf1346 100644--- a/nodes/node-high-pass/tsconfig.json+++ b/nodes/node-high-pass/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-kenburns/package.json b/nodes/node-kenburns/package.jsonindex 4dbfcb68..31f6e6c6 100644--- a/nodes/node-kenburns/package.json+++ b/nodes/node-kenburns/package.json@@ -1,6 +1,7 @@{"name": "@gitframes/node-kenburns","version": "1.3.2",+ "license": "Apache-2.0","private": false,"gitframes": {"type": "KenBurns",diff --git a/nodes/node-kenburns/tsconfig.json b/nodes/node-kenburns/tsconfig.jsonindex 3bc46723..8c3717bb 100644--- a/nodes/node-kenburns/tsconfig.json+++ b/nodes/node-kenburns/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-layer-style/package.json b/nodes/node-layer-style/package.jsonindex d13b69e3..38d308d4 100644--- a/nodes/node-layer-style/package.json+++ b/nodes/node-layer-style/package.json@@ -7,7 +7,7 @@"kind": "effect"},"type": "module",- "license": "APGL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-layer-style/tsconfig.json b/nodes/node-layer-style/tsconfig.jsonindex 7e10f91f..8ecf1346 100644--- a/nodes/node-layer-style/tsconfig.json+++ b/nodes/node-layer-style/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-levels/package.json b/nodes/node-levels/package.jsonindex 77a2c44f..cd3d61c5 100644--- a/nodes/node-levels/package.json+++ b/nodes/node-levels/package.json@@ -1,6 +1,7 @@{"name": "@gitframes/node-levels","version": "1.3.2",+ "license": "Apache-2.0","private": false,"gitframes": {"type": "Levels",diff --git a/nodes/node-levels/tsconfig.json b/nodes/node-levels/tsconfig.jsonindex 938ce468..88b1208d 100644--- a/nodes/node-levels/tsconfig.json+++ b/nodes/node-levels/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","esModuleInterop": true,diff --git a/nodes/node-liquify/package.json b/nodes/node-liquify/package.jsonindex 93dae8c9..be9a11d5 100644--- a/nodes/node-liquify/package.json+++ b/nodes/node-liquify/package.json@@ -7,7 +7,7 @@"kind": "effect"},"type": "module",- "license": "APGL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-liquify/tsconfig.json b/nodes/node-liquify/tsconfig.jsonindex 7e10f91f..8ecf1346 100644--- a/nodes/node-liquify/tsconfig.json+++ b/nodes/node-liquify/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-lottie/package.json b/nodes/node-lottie/package.jsonindex 525bfa40..478bba99 100644--- a/nodes/node-lottie/package.json+++ b/nodes/node-lottie/package.json@@ -1,6 +1,7 @@{"name": "@gitframes/node-lottie","version": "1.3.2",+ "license": "Apache-2.0","private": false,"gitframes": {"type": "Lottie",diff --git a/nodes/node-lottie/tsconfig.json b/nodes/node-lottie/tsconfig.jsonindex d89b9502..8ecf1346 100644--- a/nodes/node-lottie/tsconfig.json+++ b/nodes/node-lottie/tsconfig.json@@ -1,8 +1,7 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".",- "jsx": "react-jsx","paths": {"@/*": ["./src/*"]},diff --git a/nodes/node-mask-math/package.json b/nodes/node-mask-math/package.jsonindex e4583697..c81f63e1 100644--- a/nodes/node-mask-math/package.json+++ b/nodes/node-mask-math/package.json@@ -7,7 +7,7 @@"kind": "effect"},"type": "module",- "license": "AGPL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-mask-math/tsconfig.json b/nodes/node-mask-math/tsconfig.jsonindex 7e10f91f..8ecf1346 100644--- a/nodes/node-mask-math/tsconfig.json+++ b/nodes/node-mask-math/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-mesh-warp/package.json b/nodes/node-mesh-warp/package.jsonindex 2d1e5482..37310085 100644--- a/nodes/node-mesh-warp/package.json+++ b/nodes/node-mesh-warp/package.json@@ -1,6 +1,7 @@{"name": "@gitframes/node-mesh-warp","version": "1.3.2",+ "license": "Apache-2.0","private": false,"gitframes": {"type": "MeshWarp",diff --git a/nodes/node-mesh-warp/tsconfig.json b/nodes/node-mesh-warp/tsconfig.jsonindex 3bc46723..8c3717bb 100644--- a/nodes/node-mesh-warp/tsconfig.json+++ b/nodes/node-mesh-warp/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-modulate/package.json b/nodes/node-modulate/package.jsonindex e6fd8d1d..57356d1f 100644--- a/nodes/node-modulate/package.json+++ b/nodes/node-modulate/package.json@@ -1,6 +1,7 @@{"name": "@gitframes/node-modulate","version": "1.3.2",+ "license": "Apache-2.0","private": false,"gitframes": {"type": "Modulate",diff --git a/nodes/node-modulate/tsconfig.json b/nodes/node-modulate/tsconfig.jsonindex 7e10f91f..8ecf1346 100644--- a/nodes/node-modulate/tsconfig.json+++ b/nodes/node-modulate/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-noise-generator/package.json b/nodes/node-noise-generator/package.jsonindex c0d45caa..56121754 100644--- a/nodes/node-noise-generator/package.json+++ b/nodes/node-noise-generator/package.json@@ -7,7 +7,7 @@"kind": "effect"},"type": "module",- "license": "APGL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-noise-generator/tsconfig.json b/nodes/node-noise-generator/tsconfig.jsonindex 7e10f91f..8ecf1346 100644--- a/nodes/node-noise-generator/tsconfig.json+++ b/nodes/node-noise-generator/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-paint/package.json b/nodes/node-paint/package.jsonindex 735821bc..8333b399 100644--- a/nodes/node-paint/package.json+++ b/nodes/node-paint/package.json@@ -1,6 +1,7 @@{"name": "@gitframes/node-paint","version": "1.3.2",+ "license": "Apache-2.0","private": false,"gitframes": {"type": "Paint",diff --git a/nodes/node-paint/tsconfig.json b/nodes/node-paint/tsconfig.jsonindex 3bc46723..8c3717bb 100644--- a/nodes/node-paint/tsconfig.json+++ b/nodes/node-paint/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-patch-heal/package.json b/nodes/node-patch-heal/package.jsonindex b203b3d3..62409577 100644--- a/nodes/node-patch-heal/package.json+++ b/nodes/node-patch-heal/package.json@@ -7,7 +7,7 @@"kind": "effect"},"type": "module",- "license": "APGL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-patch-heal/tsconfig.json b/nodes/node-patch-heal/tsconfig.jsonindex 7e10f91f..8ecf1346 100644--- a/nodes/node-patch-heal/tsconfig.json+++ b/nodes/node-patch-heal/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-procedural-vfx/package.json b/nodes/node-procedural-vfx/package.jsonindex c742ec81..b7ed82d5 100644--- a/nodes/node-procedural-vfx/package.json+++ b/nodes/node-procedural-vfx/package.json@@ -10,7 +10,7 @@"enabled": false},"type": "module",- "license": "APGL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-procedural-vfx/tsconfig.json b/nodes/node-procedural-vfx/tsconfig.jsonindex 7e10f91f..8ecf1346 100644--- a/nodes/node-procedural-vfx/tsconfig.json+++ b/nodes/node-procedural-vfx/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-refine-edge/package.json b/nodes/node-refine-edge/package.jsonindex a7c652d7..babdab0f 100644--- a/nodes/node-refine-edge/package.json+++ b/nodes/node-refine-edge/package.json@@ -7,7 +7,7 @@"kind": "effect"},"type": "module",- "license": "AGPL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-refine-edge/tsconfig.json b/nodes/node-refine-edge/tsconfig.jsonindex 7e10f91f..8ecf1346 100644--- a/nodes/node-refine-edge/tsconfig.json+++ b/nodes/node-refine-edge/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-refraction-caustics/package.json b/nodes/node-refraction-caustics/package.jsonindex f1730a45..c0cc44f6 100644--- a/nodes/node-refraction-caustics/package.json+++ b/nodes/node-refraction-caustics/package.json@@ -7,7 +7,7 @@"kind": "effect"},"type": "module",- "license": "APGL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-refraction-caustics/tsconfig.json b/nodes/node-refraction-caustics/tsconfig.jsonindex 7c7b99ea..c56a1449 100644--- a/nodes/node-refraction-caustics/tsconfig.json+++ b/nodes/node-refraction-caustics/tsconfig.json@@ -3,7 +3,6 @@"compilerOptions": {"module": "NodeNext","moduleResolution": "NodeNext",- "jsx": "react-jsx","types": ["webgpu", "node", "react", "react-dom"]},"include": ["src/**/*"]diff --git a/nodes/node-relight-3d/package.json b/nodes/node-relight-3d/package.jsonindex 12af7165..cdbb0140 100644--- a/nodes/node-relight-3d/package.json+++ b/nodes/node-relight-3d/package.json@@ -7,7 +7,7 @@"kind": "effect"},"type": "module",- "license": "APGL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-relight-3d/tsconfig.json b/nodes/node-relight-3d/tsconfig.jsonindex 7e10f91f..8ecf1346 100644--- a/nodes/node-relight-3d/tsconfig.json+++ b/nodes/node-relight-3d/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-resizer-scaler/package.json b/nodes/node-resizer-scaler/package.jsonindex 52c12e47..4a9f8adb 100644--- a/nodes/node-resizer-scaler/package.json+++ b/nodes/node-resizer-scaler/package.json@@ -7,7 +7,7 @@"kind": "effect"},"type": "module",- "license": "APGL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-resizer-scaler/tsconfig.json b/nodes/node-resizer-scaler/tsconfig.jsonindex 7e10f91f..8ecf1346 100644--- a/nodes/node-resizer-scaler/tsconfig.json+++ b/nodes/node-resizer-scaler/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-selective-color/package.json b/nodes/node-selective-color/package.jsonindex 9b60ec29..9e3505eb 100644--- a/nodes/node-selective-color/package.json+++ b/nodes/node-selective-color/package.json@@ -7,7 +7,7 @@"kind": "effect"},"type": "module",- "license": "AGPL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-selective-color/tsconfig.json b/nodes/node-selective-color/tsconfig.jsonindex 938ce468..88b1208d 100644--- a/nodes/node-selective-color/tsconfig.json+++ b/nodes/node-selective-color/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","esModuleInterop": true,diff --git a/nodes/node-shadows-highlights/package.json b/nodes/node-shadows-highlights/package.jsonindex 25641abe..c1449a37 100644--- a/nodes/node-shadows-highlights/package.json+++ b/nodes/node-shadows-highlights/package.json@@ -7,7 +7,7 @@"kind": "effect"},"type": "module",- "license": "AGPL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-shadows-highlights/tsconfig.json b/nodes/node-shadows-highlights/tsconfig.jsonindex 938ce468..88b1208d 100644--- a/nodes/node-shadows-highlights/tsconfig.json+++ b/nodes/node-shadows-highlights/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","esModuleInterop": true,diff --git a/nodes/node-shape-generator/package.json b/nodes/node-shape-generator/package.jsonindex 17ff8334..565ccc62 100644--- a/nodes/node-shape-generator/package.json+++ b/nodes/node-shape-generator/package.json@@ -7,7 +7,7 @@"kind": "source"},"type": "module",- "license": "AGPL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-shape-generator/tsconfig.json b/nodes/node-shape-generator/tsconfig.jsonindex 7e10f91f..8ecf1346 100644--- a/nodes/node-shape-generator/tsconfig.json+++ b/nodes/node-shape-generator/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-signal-gate/package.json b/nodes/node-signal-gate/package.jsonindex 49660ff2..78a9c23c 100644--- a/nodes/node-signal-gate/package.json+++ b/nodes/node-signal-gate/package.json@@ -7,7 +7,7 @@"kind": "signal"},"type": "module",- "license": "AGPL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-signal-gate/tsconfig.json b/nodes/node-signal-gate/tsconfig.jsonindex d68f8de0..dd6e85b8 100644--- a/nodes/node-signal-gate/tsconfig.json+++ b/nodes/node-signal-gate/tsconfig.json@@ -2,7 +2,6 @@"extends": "@gitframes/tsconfig/base.json","compilerOptions": {"lib": ["ESNext", "DOM"],- "jsx": "react-jsx","types": ["@types/webgpu"]},"include": ["src/**/*"]diff --git a/nodes/node-signal-math/package.json b/nodes/node-signal-math/package.jsonindex 89246e92..c6850435 100644--- a/nodes/node-signal-math/package.json+++ b/nodes/node-signal-math/package.json@@ -7,7 +7,7 @@"kind": "signal"},"type": "module",- "license": "AGPL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-signal-math/tsconfig.json b/nodes/node-signal-math/tsconfig.jsonindex 7d60bce0..8ecf1346 100644--- a/nodes/node-signal-math/tsconfig.json+++ b/nodes/node-signal-math/tsconfig.json@@ -1,11 +1,10 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {"@/*": ["./src/*"]},- "jsx": "react-jsx","experimentalDecorators": true,"emitDecoratorMetadata": true},diff --git a/nodes/node-signal/package.json b/nodes/node-signal/package.jsonindex e561a68a..5dbd5155 100644--- a/nodes/node-signal/package.json+++ b/nodes/node-signal/package.json@@ -7,7 +7,7 @@"kind": "signal"},"type": "module",- "license": "APGL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-signal/tsconfig.json b/nodes/node-signal/tsconfig.jsonindex 7d60bce0..8ecf1346 100644--- a/nodes/node-signal/tsconfig.json+++ b/nodes/node-signal/tsconfig.json@@ -1,11 +1,10 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {"@/*": ["./src/*"]},- "jsx": "react-jsx","experimentalDecorators": true,"emitDecoratorMetadata": true},diff --git a/nodes/node-stereo-panning/package.json b/nodes/node-stereo-panning/package.jsonindex c49f04f7..fff0bb15 100644--- a/nodes/node-stereo-panning/package.json+++ b/nodes/node-stereo-panning/package.json@@ -1,6 +1,7 @@{"name": "@gitframes/node-stereo-panning","version": "1.3.2",+ "license": "Apache-2.0","private": false,"gitframes": {"type": "StereoPanning",diff --git a/nodes/node-stereo-panning/tsconfig.json b/nodes/node-stereo-panning/tsconfig.jsonindex e0cb7990..474ae843 100644--- a/nodes/node-stereo-panning/tsconfig.json+++ b/nodes/node-stereo-panning/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-svg/package.json b/nodes/node-svg/package.jsonindex 475bbfce..8be81421 100644--- a/nodes/node-svg/package.json+++ b/nodes/node-svg/package.json@@ -1,6 +1,7 @@{"name": "@gitframes/node-svg","version": "1.3.2",+ "license": "Apache-2.0","private": false,"gitframes": {"type": "Svg",diff --git a/nodes/node-svg/tsconfig.json b/nodes/node-svg/tsconfig.jsonindex 7e10f91f..8ecf1346 100644--- a/nodes/node-svg/tsconfig.json+++ b/nodes/node-svg/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-text/package.json b/nodes/node-text/package.jsonindex 3cda554d..2385219b 100644--- a/nodes/node-text/package.json+++ b/nodes/node-text/package.json@@ -7,7 +7,7 @@"kind": "source"},"type": "module",- "license": "APGL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-text/tsconfig.json b/nodes/node-text/tsconfig.jsonindex 7e10f91f..8ecf1346 100644--- a/nodes/node-text/tsconfig.json+++ b/nodes/node-text/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-tile-offset/package.json b/nodes/node-tile-offset/package.jsonindex 87452fed..b082656b 100644--- a/nodes/node-tile-offset/package.json+++ b/nodes/node-tile-offset/package.json@@ -7,7 +7,7 @@"kind": "effect"},"type": "module",- "license": "AGPL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-tile-offset/tsconfig.json b/nodes/node-tile-offset/tsconfig.jsonindex 7e10f91f..8ecf1346 100644--- a/nodes/node-tile-offset/tsconfig.json+++ b/nodes/node-tile-offset/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-unsharp-mask/package.json b/nodes/node-unsharp-mask/package.jsonindex c1c17ca2..079adb67 100644--- a/nodes/node-unsharp-mask/package.json+++ b/nodes/node-unsharp-mask/package.json@@ -7,7 +7,7 @@"kind": "effect"},"type": "module",- "license": "APGL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-unsharp-mask/tsconfig.json b/nodes/node-unsharp-mask/tsconfig.jsonindex 7e10f91f..8ecf1346 100644--- a/nodes/node-unsharp-mask/tsconfig.json+++ b/nodes/node-unsharp-mask/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-vignette/package.json b/nodes/node-vignette/package.jsonindex 66a0606b..3c34452f 100644--- a/nodes/node-vignette/package.json+++ b/nodes/node-vignette/package.json@@ -8,7 +8,7 @@"schema": "VignetteNodeConfigSchema"},"type": "module",- "license": "APGL-3.0",+ "license": "Apache-2.0","exports": {".": {"types": "./dist/index.d.mts",diff --git a/nodes/node-vignette/tsconfig.json b/nodes/node-vignette/tsconfig.jsonindex 7e10f91f..8ecf1346 100644--- a/nodes/node-vignette/tsconfig.json+++ b/nodes/node-vignette/tsconfig.json@@ -1,5 +1,5 @@{- "extends": "@gitframes/tsconfig/react-library.json",+ "extends": "@gitframes/tsconfig/node-library.json","compilerOptions": {"baseUrl": ".","paths": {diff --git a/nodes/node-vision/package.json b/nodes/node-vision/package.jsonindex 3f1ef73b..87d9c8b9 100644--- a/nodes/node-vision/package.json+++ b/nodes/node-vision/package.json@@ -1,6 +1,7 @@{"name": "@gitframes/node-vision","version": "1.3.2",+ "license": "Apache-2.0","private": false,"gitframes": {"type": "Vision",diff --git a/package.json b/package.jsonindex 359579ed..e4abfd08 100644--- a/package.json+++ b/package.json@@ -9,6 +9,7 @@"check:deps": "pnpm -r exec node -e \"console.log(process.cwd())\"","check:plugins": "node scripts/validate-agent-plugin.mjs","generate:effects": "tsx --conditions development scripts/generate-effects.mts",+ "generate:node-renderers": "tsx scripts/generate-node-renderers.mts","sync:effects-catalog": "node scripts/sync-effects-catalog.mjs","changeset": "changeset","version:packages": "changeset version && node scripts/sync-plugin-version.mjs",@@ -58,10 +59,6 @@"@seydx/node-av-win32-arm64-msvc": "6.0.0","@seydx/node-av-win32-arm64-mingw": "6.0.0","mediabunny": "^1.51.0",- "react": "^19.2.4",- "react-dom": "^19.2.4",- "@types/react": "^19.2.4",- "@types/react-dom": "^19.2.3","tar@<=7.5.3": ">=7.5.4","tar@<7.5.7": ">=7.5.7","tar@<=7.5.2": ">=7.5.3",@@ -200,4 +197,4 @@"webgpu"],"name": "gitframes-monorepo"-}\ No newline at end of file+}diff --git a/packages/client-utils/package.json b/packages/client-utils/package.jsonindex 5c9cfbd3..f312e773 100644--- a/packages/client-utils/package.json+++ b/packages/client-utils/package.json@@ -7,7 +7,7 @@},"type": "module","sideEffects": false,- "license": "APGL-3.0",+ "license": "Apache-2.0","module": "./dist/index.mjs","types": "./dist/index.d.mts","exports": {diff --git a/packages/compositions/package.json b/packages/compositions/package.jsonindex 78c811ce..a8e21752 100644--- a/packages/compositions/package.json+++ b/packages/compositions/package.json@@ -4,7 +4,7 @@"private": false,"type": "module","sideEffects": false,- "license": "APGL-3.0",+ "license": "Apache-2.0","module": "./dist/index.mjs","types": "./dist/index.d.mts","exports": {@@ -41,7 +41,6 @@"@gitframes/core": "workspace:*","@gitframes/server-utils": "workspace:*","@gitframes/tsconfig": "workspace:*",- "@types/react": "^19.2.4","@webgpu/types": "^0.1.70","dotenv": "^16.4.5","tsdown": "^0.19.0",@@ -52,7 +51,6 @@},"peerDependencies": {"mediabunny": "*",- "react": "^19.2.4","zod": "^4.3.6"},"dependencies": {diff --git a/packages/compositions/src/compositions/browser-render.tsx b/packages/compositions/src/compositions/browser-render.tsxdeleted file mode 100644index a55c0ab0..00000000--- a/packages/compositions/src/compositions/browser-render.tsx+++ /dev/null@@ -1,1090 +0,0 @@-/**- * browser-video-renderer.tsx- *- * Architecture- * ────────────- * ┌─────────────────────────────────────────────────────────────────┐- * │ AudioMuxer (no React deps) │- * │ · subscribe / getSnapshot → useSyncExternalStore contract │- * │ · run() → mixing + encoding with cooperative yielding │- * │ · abort() → AbortSignal cancellation │- * └─────────────────────────────────────────────────────────────────┘- * ▲ useSyncExternalStore- * ┌─────────────────────────────────────────────────────────────────┐- * │ BrowserVideoRendererInner │- * │ Effect 1: muxer init (output, sources, OPFS target) │- * │ Effect 2: video frame loop → setVideoFramesDone(true) │- * │ Effect 3: audio kick-off when videoFramesDone │- * │ Effect 4: finalization when audioState.phase === "done" │- * │ Effect 5: progress bridge audioState → onProgress prop │- * │ Effect 6: error bridge audioState → onError prop │- * └─────────────────────────────────────────────────────────────────┘- *- * Why FPS dropped to 2-3 during audio processing (and how it's fixed)- * ────────────────────────────────────────────────────────────────────- *- * ROOT CAUSE 1 — Main-thread monopoly- * The old audio chunk loop ran entirely on the JS main thread. Each- * iteration allocated a Float32Array, interleaved channel data, and- * called `await audioSource.add()`. Consecutive microtask continuations- * never returned control to the browser's rendering pipeline; the- * compositor thread was starved waiting for a JS task to complete before- * it could issue a new paint frame.- *- * ROOT CAUSE 2 — React scheduler saturation- * `onProgress("audio", pct)` was called on every chunk (up to ~100×/sec- * for long clips). Each call triggered a parent setState, enqueuing a- * React reconciliation. When updates arrived faster than the reconciler- * could drain them, React degraded to synchronous rendering to clear the- * backlog — which blocked the main thread even longer.- *- * ROOT CAUSE 3 — AudioEncoder backpressure- * mediabunny's AudioSampleSource.add() awaits the encoder's internal- * queue. Under load it parks the caller in a microtask continuation and- * immediately resumes on the same task. The browser task scheduler never- * saw an idle slot to run its rendering pipeline.- *- * ROOT CAUSE 4 — Entangled concerns- * Audio encoding lived inside the video frame useEffect. The render loop- * and the encoder competed for the same task slot and the same React- * reconciliation pass.- *- * FIX — yieldToMain() between every audio chunk- * `scheduler.yield()` (Chrome 115+) is the correct primitive: it- * explicitly yields to the browser's task queue at "user-blocking"- * priority, guaranteeing a paint opportunity between chunks. The- * `setTimeout(0)` fallback provides equivalent semantics on older- * browsers (>4 ms clamped, sufficient for ~60 FPS).- * Progress notifications are throttled to ≤12 updates/sec to avoid- * overwhelming the React scheduler.- */--import { getMediaType, type VirtualMediaData } from "@gitframes/core";-import {- clearAllVideoCache,- RenderProvider,- useRenderContext,-} from "@gitframes/webgpu-renderers";-import { registerMp3Encoder } from "@mediabunny/mp3-encoder";-import {- AudioSample,- AudioSampleSource,- BufferTarget,- canEncodeAudio,- canEncodeVideo,- Mp3OutputFormat,- Mp4OutputFormat,- Output,- QUALITY_VERY_HIGH,- StreamTarget,- VideoSample,- VideoSampleSource,- WebMOutputFormat,-} from "mediabunny";-import type React from "react";-import { useEffect, useRef, useState, useSyncExternalStore } from "react";-import { mixAudioTracks } from "../utils/audio-extractor.js";-import { CanvasComposition } from "./canvas-composition.js";--const isNode =- typeof process !== "undefined" && Boolean(process.versions?.node);--// Register custom MP3 encoder fallback for browsers lacking native WebCodecs MP3 encoding-if (typeof window !== "undefined" && !isNode) {- canEncodeAudio("mp3")- .then((supported) => {- if (!supported) {- registerMp3Encoder();- }- })- .catch(() => {});-}--// ─── delay-render compatibility ──────────────────────────────────────--/**- * Blocks until all delayRender handles are cleared, or the timeout- * expires. The initial 100 ms sleep gives React one full render cycle to- * register any new handles before we start polling.- *- * NOTE: The 100 ms floor sets a hard upper bound on video encoding throughput- * (~10 FPS maximum) when delayRender handles are not in use. If you control the- * config, consider reducing this to 0 ms after verifying no handles- * are ever registered synchronously before the first poll.- */-const waitForDelayRender = async (timeoutMs = 30_000): Promise<void> => {- await new Promise((resolve) => setTimeout(resolve, 100));-- const start = Date.now();- return new Promise<void>((resolve) => {- const check = () => {- const handles: unknown[] =- typeof window !== "undefined" &&- (window as unknown as { renderer_delayRenderHandles?: unknown[] })- .renderer_delayRenderHandles- ? (- window as unknown as {- renderer_delayRenderHandles: unknown[];- }- ).renderer_delayRenderHandles- : [];-- const globalDelays =- typeof globalThis !== "undefined"- ? (globalThis as any).__GATEWAI_DELAYS__- : null;-- const hasBrowserDelays = handles.length > 0;- const hasGlobalDelays =- globalDelays instanceof Set && globalDelays.size > 0;-- if (!hasBrowserDelays && !hasGlobalDelays) {- resolve();- return;- }-- if (Date.now() - start > timeoutMs) {- console.warn("[BrowserRenderer] waitForDelayRender timed out:", {- browserHandles: handles,- globalDelays: globalDelays ? Array.from(globalDelays) : [],- });- resolve();- return;- }-- setTimeout(check, 50);- };- check();- });-};--// ─── Browser render support check ─────────────────────────────────────────────--export const checkBrowserRenderSupport = async (- format: "mp4" | "webm" | "gif" | "mp3",- isAudioOnly = false,- audioCodecOverride?: "aac" | "opus" | "mp3",-): Promise<{ supported: boolean; reason?: string }> => {- if (typeof window === "undefined") {- return { supported: false, reason: "Server-side context" };- }-- if (!("VideoEncoder" in window) || !("AudioEncoder" in window)) {- return {- supported: false,- reason: "Browser does not support WebCodecs (VideoEncoder/AudioEncoder).",- };- }-- if (format === "gif") {- return {- supported: false,- reason: `${format.toUpperCase()} export format is not supported for Browser rendering.`,- };- }-- const resolvedQuality = QUALITY_VERY_HIGH;-- const isWebM = format === "webm";- const isMp3 = format === "mp3";- const videoCodec = isWebM ? "vp8" : "avc";- const audioCodec =- audioCodecOverride ?? (isMp3 ? "mp3" : isWebM ? "opus" : "aac");-- // Check audio encoding support- try {- const isAudioSupported = await canEncodeAudio(audioCodec, {- numberOfChannels: 2,- sampleRate: 48_000,- bitrate: resolvedQuality,- });-- if (!isAudioSupported) {- if (audioCodec === "aac") {- // AAC unsupported → try opus fallback for mp4- const isOpusSupported = await canEncodeAudio("opus", {- numberOfChannels: 2,- sampleRate: 48_000,- bitrate: resolvedQuality,- });- if (!isOpusSupported) {- return {- supported: false,- reason:- "Neither AAC nor Opus audio encoding is supported by this browser.",- };- }- } else {- return {- supported: false,- reason: `${audioCodec.toUpperCase()} audio encoding is not supported by this browser.`,- };- }- }- } catch (e) {- return {- supported: false,- reason: `Failed to verify audio encoder support for ${audioCodec}: ${- e instanceof Error ? e.message : String(e)- }`,- };- }-- // Check video encoding support (skipped for mp3 / audio-only)- if (!isMp3 && !isAudioOnly) {- try {- const isVideoSupported = await canEncodeVideo(videoCodec, {- width: 1920,- height: 1080,- bitrate: resolvedQuality,- });-- if (!isVideoSupported) {- return {- supported: false,- reason: `${videoCodec.toUpperCase()} video encoding is not supported by your browser/hardware.`,- };- }- } catch (e) {- // Assume supported if the check itself throws — better a graceful failure- // during encoding than a false negative here.- console.warn(- "[BrowserRenderer] VideoEncoder support check failed, assuming supported:",- e,- );- }- }-- return { supported: true };-};--// ─── Cooperative scheduler yield ──────────────────────────────────────────────-//-// scheduler.yield() (Chrome 115+) yields to the browser's task queue at-// "user-blocking" priority, guaranteeing a paint/input opportunity between-// audio chunks. On older browsers setTimeout(0) provides equivalent semantics-// (clamped to ≥4 ms, still sufficient for smooth 60 FPS progress updates).-//-// IMPORTANT: This is the single most impactful change for audio-phase FPS.-// Without it, the tight await-loop inside #encodeChunks() never lets the-// compositor issue a new frame — hence the perceived 2-3 FPS.--const yieldToMain = (): Promise<void> => {- const sched = (globalThis as Record<string, unknown>).scheduler as- | { yield?: () => Promise<void> }- | undefined;- return typeof sched?.yield === "function"- ? sched.yield()- : new Promise<void>((resolve) => setTimeout(resolve, 0));-};--// ─── AudioMuxer — zero React dependencies ─────────────────────────────────────--export type AudioMuxPhase = "idle" | "mixing" | "encoding" | "done" | "error";--export interface AudioMuxState {- phase: AudioMuxPhase;- /** 0-100; meaningful during the "encoding" phase */- progress: number;- error: Error | null;-}--/**- * Self-contained audio mixing + encoding engine.- *- * Exposes the `useSyncExternalStore` contract (subscribe / getSnapshot) so- * the component can react to state changes without prop-drilling callbacks- * into the async pipeline.- *- * Usage:- * const muxer = useMemo(() => new AudioMuxer(), []);- * const state = useSyncExternalStore(muxer.subscribe, muxer.getSnapshot);- * useEffect(() => { void muxer.run(...) }, [videoFramesDone]);- * useEffect(() => () => muxer.abort(), []);- */-export class AudioMuxer {- #state: AudioMuxState = { phase: "idle", progress: 0, error: null };- #listeners = new Set<() => void>();- #abortController: AbortController | null = null;-- // ── useSyncExternalStore contract ─────────────────────────────────────────-- readonly subscribe = (listener: () => void): (() => void) => {- this.#listeners.add(listener);- return () => {- this.#listeners.delete(listener);- };- };-- readonly getSnapshot = (): AudioMuxState => this.#state;-- // ── Control ───────────────────────────────────────────────────────────────-- /** Cancel any in-flight run and reset to idle. Safe to call multiple times. */- abort(): void {- this.#abortController?.abort(- new DOMException("AudioMuxer aborted", "AbortError"),- );- this.#abortController = null;- // Don't overwrite an error state — the error useEffect needs to read it- if (this.#state.phase !== "error") {- this.#setState({ phase: "idle", progress: 0, error: null });- }- }-- // ── Entry point ───────────────────────────────────────────────────────────-- /**- * Mix virtual media audio and feed it into the provided AudioSampleSource.- *- * Calling run() while a previous run is in-flight cancels the previous- * run before starting. Throws on error (error state is also written to- * the snapshot for the component to observe).- */- async run(- virtualMedia: VirtualMediaData,- fps: number,- sampleRate: number,- device: GPUDevice,- audioSource: AudioSampleSource,- ): Promise<void> {- // Cancel any previous in-flight run- this.#abortController?.abort();- this.#abortController = new AbortController();- const { signal } = this.#abortController;-- this.#setState({ phase: "mixing", progress: 0, error: null });-- try {- await this.#execute(- virtualMedia,- fps,- sampleRate,- device,- audioSource,- signal,- );- } catch (err) {- if (signal.aborted) return; // intentional abort — not an error- const error = err instanceof Error ? err : new Error(String(err));- this.#setState({ phase: "error", error });- throw error;- }- }-- // ── Private ───────────────────────────────────────────────────────────────-- #setState(patch: Partial<AudioMuxState>): void {- this.#state = { ...this.#state, ...patch };- // useSyncExternalStore requires synchronous notification- for (const listener of this.#listeners) listener();- }-- async #execute(- virtualMedia: VirtualMediaData,- fps: number,- sampleRate: number,- device: GPUDevice,- audioSource: AudioSampleSource,- signal: AbortSignal,- ): Promise<void> {- // ── Phase 1: GPU audio mixing ─────────────────────────────────────────- //- // mixAudioTracks performs WebGPU compute work + a blocking readback.- // Yielding before it lets the browser flush any pending composites from- // the final video frame before we kick off GPU work again, preventing- // the GPU timeline from backing up.- await yieldToMain();- if (signal.aborted) return;-- let channels: Float32Array[];- let actualSampleRate: number;-- try {- const mixed = await mixAudioTracks(virtualMedia, fps, sampleRate, device);- channels = mixed.channels;- actualSampleRate = mixed.sampleRate;- } catch (err) {- throw new Error(- `Audio track mixing failed: ${- err instanceof Error ? err.message : String(err)- }`,- );- }-- if (signal.aborted) return;-- if (channels.length === 0) {- this.#setState({ phase: "done", progress: 100 });- return;- }-- // ── Phase 2: Encode in cooperative chunks ────────────────────────────- this.#setState({ phase: "encoding", progress: 0 });- await this.#encodeChunks(channels, actualSampleRate, audioSource, signal);- }-- async #encodeChunks(- channels: Float32Array[],- sampleRate: number,- audioSource: AudioSampleSource,- signal: AbortSignal,- ): Promise<void> {- const numChannels = channels.length;- const totalSamples = channels[0].length;-- // 100 ms per chunk — balance between throughput and responsiveness.- // Smaller chunks yield more frequently (smoother UI) but increase- // encoder overhead (more AudioSample objects, more IPC round-trips).- const chunkSize = Math.round(0.1 * sampleRate);-- // ── Throttle progress notifications ──────────────────────────────────- // React reconciler overhead becomes measurable above ~60 setState/sec.- // At 48 kHz / 4,800 samples per chunk = 10 chunks/sec, we're already- // within budget, but guard against low sample rates or tiny chunks.- const PROGRESS_INTERVAL_MS = 80; // ≈12 updates/sec max- let lastProgressAt = 0;-- for (let offset = 0; offset < totalSamples; offset += chunkSize) {- if (signal.aborted) return;-- // ─────────────────────────────────────────────────────────────────- // KEY FIX: yield BEFORE the work, not after.- //- // Yielding *before* guarantees the browser gets a task slot even if- // the subsequent await (audioSource.add) resolves on a microtask.- // Without this yield, the entire loop runs as a single long task from- // the browser's perspective, blocking paint for the full duration.- // ─────────────────────────────────────────────────────────────────- await yieldToMain();- if (signal.aborted) return;-- const chunkLen = Math.min(chunkSize, totalSamples - offset);-- // Interleave planar channels → [L₀, R₀, L₁, R₁, …]- const interleaved = new Float32Array(chunkLen * numChannels);- for (let i = 0; i < chunkLen; i++) {- for (let ch = 0; ch < numChannels; ch++) {- interleaved[i * numChannels + ch] = channels[ch]?.[offset + i] ?? 0;- }- }-- const sample = new AudioSample({- data: interleaved,- format: "f32",- numberOfChannels: numChannels,- sampleRate,- timestamp: offset / sampleRate,- });-- try {- await audioSource.add(sample);- } finally {- // Always close — AudioSample holds a reference to a SharedArrayBuffer- // backing the encoder; leaking it exhausts the encoder's buffer pool.- sample.close();- }-- const now = performance.now();- if (now - lastProgressAt >= PROGRESS_INTERVAL_MS) {- this.#setState({- phase: "encoding",- progress: Math.round(((offset + chunkLen) / totalSamples) * 100),- });- lastProgressAt = now;- }- }-- this.#setState({ phase: "done", progress: 100 });- }-}--// ─── Component types ──────────────────────────────────────────────────────────--interface BrowserRenderProps {- nodeId: string;- virtualMedia: VirtualMediaData;- format: "mp4" | "webm" | "gif" | "mp3";- audioCodec?: "aac" | "opus" | "mp3";- fps: number;- width: number;- height: number;- onProgress: (stage: string, percent: number) => void;- onComplete: (blob: Blob) => void;- onError: (error: Error) => void;-}--// ─── Encoder state (non-reactive, mutated during async loop) ──────────────────--interface EncoderState {- initialized: boolean;- finalized: boolean; // guards against double-finalize between effect and cleanup- output: Output | null;- videoSource: VideoSampleSource | null;- audioSource: AudioSampleSource | null;- target: StreamTarget | BufferTarget | null;- fileHandle: FileSystemFileHandle | null;- totalFrames: number;- frameIndex: number;-}--// ─── BrowserVideoRendererInner ─────────────────────────────────────────────────--const BrowserVideoRendererInner: React.FC<BrowserRenderProps> = ({- nodeId,- virtualMedia,- format,- audioCodec: audioCodecProp,- fps,- width,- height,- onProgress,- onComplete,- onError,-}) => {- const ctx = useRenderContext();- const [frame, setFrame] = useState<number>(-1);- const [videoFramesDone, setVideoFramesDone] = useState(false);- const activeRef = useRef<boolean>(true);-- const isAudioOnly = getMediaType(virtualMedia) === "Audio";- const isMp3 = format === "mp3";- const skipVideo = isMp3 || isAudioOnly;-- // ── Stable callback refs (prevent effect restarts on parent re-renders) ───- const onProgressRef = useRef(onProgress);- const onCompleteRef = useRef(onComplete);- const onErrorRef = useRef(onError);- useEffect(() => {- onProgressRef.current = onProgress;- onCompleteRef.current = onComplete;- onErrorRef.current = onError;- });-- // ── AudioMuxer: one stable instance per component mount ──────────────────- const audioMuxerRef = useRef<AudioMuxer>(null!);- if (!audioMuxerRef.current) {- audioMuxerRef.current = new AudioMuxer();- }-- // Subscribe to muxer state — this is the only source of truth for audio phase- const audioState = useSyncExternalStore(- audioMuxerRef.current.subscribe,- audioMuxerRef.current.getSnapshot,- );-- // ── Encoder state (non-reactive mutable ref) ─────────────────────────────- const stateRef = useRef<EncoderState>({- initialized: false,- finalized: false,- output: null,- videoSource: null,- audioSource: null,- target: null,- fileHandle: null,- totalFrames: 0,- frameIndex: 0,- });-- // ── Cleanup ───────────────────────────────────────────────────────────────-- const cleanup = async () => {- audioMuxerRef.current.abort();- const state = stateRef.current;- if (state.output && !state.finalized) {- state.finalized = true;- try {- await state.output.finalize();- } catch (_) {- // Best-effort — we're tearing down anyway- }- }- state.output = null;- state.videoSource = null;- state.audioSource = null;- state.target = null;- if (state.fileHandle) {- try {- const root = await navigator.storage.getDirectory();- await root.removeEntry(state.fileHandle.name);- } catch (_) {}- state.fileHandle = null;- }- };-- useEffect(() => {- activeRef.current = true;- return () => {- activeRef.current = false;- void cleanup();- };- // eslint-disable-next-line react-hooks/exhaustive-deps- }, []);-- // ── Effect 1: Muxer initialization ───────────────────────────────────────-- useEffect(() => {- if (!ctx || stateRef.current.initialized || !activeRef.current) return;-- let effectActive = true;-- const init = async () => {- try {- await waitForDelayRender();- if (!effectActive || !activeRef.current) return;-- const durationMs = virtualMedia.metadata?.durationMs ?? 1_000;- const totalFrames = Math.max(1, Math.round((durationMs / 1_000) * fps));-- if (format === "gif") {- throw new Error(- `${format.toUpperCase()} export is not supported for Browser rendering. ` +- "Please select MP4 or WebM, or switch to Server rendering.",- );- }-- const resolvedQuality = QUALITY_VERY_HIGH;-- const isWebM = format === "webm";- const videoCodec = isWebM ? "vp8" : "avc";- let audioCodec: "mp3" | "opus" | "aac" =- audioCodecProp ?? (isMp3 ? "mp3" : isWebM ? "opus" : "aac");-- if (audioCodec === "aac") {- try {- const aacOk = await canEncodeAudio("aac", {- numberOfChannels: 2,- sampleRate: 48_000,- bitrate: resolvedQuality,- });- if (!aacOk) {- console.warn(- "[BrowserRenderer] AAC not supported, falling back to Opus.",- );- audioCodec = "opus";- }- } catch {- console.warn(- "[BrowserRenderer] AAC check failed, falling back to Opus.",- );- audioCodec = "opus";- }- }-- if (!effectActive || !activeRef.current) return;-- onProgressRef.current("initializing", 0);-- // ── OPFS target (preferred) or in-memory BufferTarget ─────────────- let target: StreamTarget | BufferTarget;- let fileHandle: FileSystemFileHandle | null = null;-- const opfsAvailable =- typeof navigator !== "undefined" &&- typeof navigator.storage?.getDirectory === "function";-- if (opfsAvailable) {- try {- const root = await navigator.storage.getDirectory();- const filename = `export-${nodeId}-${Math.random()- .toString(36)- .slice(2)}.tmp`;- fileHandle = await root.getFileHandle(filename, { create: true });- const writable = await fileHandle.createWritable();-- target = new StreamTarget(- new WritableStream<unknown>({- async write(chunk) {- const c = chunk as { position: number; data: ArrayBuffer };- await writable.write({- type: "write",- position: c.position,- data: c.data,- });- },- async close() {- await writable.close();- },- async abort(reason) {- await writable.abort(reason);- },- }) as unknown as WritableStream<unknown>,- { chunked: true },- );- } catch (e) {- console.warn(- "[BrowserRenderer] OPFS unavailable, falling back to BufferTarget:",- e,- );- target = new BufferTarget();- }- } else {- target = new BufferTarget();- }-- if (!effectActive || !activeRef.current) return;-- const output = new Output({- format: isMp3- ? new Mp3OutputFormat()- : isWebM- ? new WebMOutputFormat()- : new Mp4OutputFormat(),- target,- });-- let videoSource: VideoSampleSource | null = null;- if (!skipVideo) {- videoSource = new VideoSampleSource({- codec: videoCodec,- bitrate: resolvedQuality,- });- output.addVideoTrack(videoSource);- }-- const audioSource = new AudioSampleSource({- codec: audioCodec,- bitrate: resolvedQuality,- });- output.addAudioTrack(audioSource);-- await output.start();-- if (!effectActive || !activeRef.current) {- await output.finalize();- return;- }-- stateRef.current = {- initialized: true,- finalized: false,- output,- videoSource,- audioSource,- target,- fileHandle,- totalFrames,- frameIndex: 0,- };-- if (skipVideo) {- // No frames to render — go straight to audio- setVideoFramesDone(true);- } else {- setFrame(0);- }- } catch (err) {- if (effectActive && activeRef.current) {- onErrorRef.current(- err instanceof Error ? err : new Error(String(err)),- );- }- }- };-- void init();- return () => {- effectActive = false;- clearAllVideoCache(ctx?.device);- };- }, [ctx, nodeId, format, fps, virtualMedia]);-- // ── Effect 2: Video frame render loop ─────────────────────────────────────- //- // Processes one frame per effect invocation. On completion of the last- // frame it sets videoFramesDone → true, which triggers Effect 3 (audio).- // Audio is never touched here — clean separation of concerns.-- useEffect(() => {- const state = stateRef.current;-- if (- !ctx ||- !state.initialized ||- frame !== state.frameIndex ||- !activeRef.current ||- skipVideo- ) {- return;- }-- let frameActive = true;-- const processFrame = async () => {- try {- // 1. Wait for CanvasComposition to signal this frame is drawn- const renderKey = `browser-render-${nodeId}-${frame}`;- const renderPromise = new Promise<void>((resolve) => {- const resolvers = ((- window as unknown as {- __frameRenderResolvers?: Map<- string,- { rendered: boolean; resolver?: () => void }- >;- }- ).__frameRenderResolvers ??= new Map());-- const existing = resolvers.get(renderKey);- if (existing?.rendered) {- resolve();- resolvers.delete(renderKey);- } else if (existing) {- existing.resolver = resolve;- } else {- resolvers.set(renderKey, { rendered: false, resolver: resolve });- }- });-- await waitForDelayRender();- await renderPromise;- if (!frameActive || !activeRef.current) return;-- // 2. Read pixels from WebGPU surface- let pixels: Uint8Array;- try {- const surfacePixels = await ctx.surface.readPixels();- pixels = new Uint8Array(- surfacePixels.buffer,- surfacePixels.byteOffset,- surfacePixels.byteLength,- );- } catch (pixelErr) {- throw new Error(- `WebGPU readPixels failed: ${- pixelErr instanceof Error ? pixelErr.message : String(pixelErr)- }. Your GPU may be out of memory — try Server rendering.`,- );- }-- if (!frameActive || !activeRef.current) return;-- // 3. Wrap pixels in a VideoFrame and hand to the encoder- let vf: VideoFrame;- try {- vf = new (- window as unknown as {- VideoFrame: new (data: Uint8Array, init: object) => VideoFrame;- }- ).VideoFrame(pixels, {- format: "RGBA",- codedWidth: width,- codedHeight: height,- timestamp: (frame / fps) * 1_000_000,- });- } catch (vfErr) {- throw new Error(- "Failed to construct VideoFrame — browser may be out of memory. " +- "Try reducing resolution/FPS or switch to Server rendering.",- );- }-- try {- const sample = new VideoSample(vf, {- duration: 1 / fps,- timestamp: frame / fps,- });- try {- await state.videoSource!.add(sample);- } catch (encErr) {- throw new Error(- `Video frame encoding failed: ${- encErr instanceof Error ? encErr.message : String(encErr)- }`,- );- } finally {- sample.close();- }- } finally {- vf.close();- }-- if (!frameActive || !activeRef.current) return;-- const nextFrame = frame + 1;- state.frameIndex = nextFrame;-- if (nextFrame < state.totalFrames) {- onProgressRef.current(- "rendering",- Math.round((nextFrame / state.totalFrames) * 100),- );- setFrame(nextFrame);- } else {- console.log(- "[BrowserRenderer] All video frames encoded, handing off to AudioMuxer.",- );- setVideoFramesDone(true);- }- } catch (err) {- if (frameActive && activeRef.current) {- onErrorRef.current(- err instanceof Error ? err : new Error(String(err)),- );- }- }- };-- void processFrame();- return () => {- frameActive = false;- };- }, [frame, ctx, fps, format, width, height, nodeId, skipVideo]);-- // ── Effect 3: Kick off AudioMuxer once video is done ─────────────────────-- useEffect(() => {- if (!videoFramesDone || !ctx || !activeRef.current) return;-- const { audioSource, initialized } = stateRef.current;- if (!initialized || !audioSource) return;-- console.log("[BrowserRenderer] Starting AudioMuxer.run()");-- void audioMuxerRef.current- .run(virtualMedia, fps, 48_000, ctx.device, audioSource)- .catch((err) => {- // Error state is also written to the snapshot — Effect 6 (error- // bridge) forwards it to onError. No double-dispatch needed here.- console.error("[BrowserRenderer] AudioMuxer.run() threw:", err);- });- // eslint-disable-next-line react-hooks/exhaustive-deps- }, [videoFramesDone]);-- // ── Effect 4: Finalize mux + yield Blob once audio is done ───────────────-- useEffect(() => {- if (audioState.phase !== "done" || !activeRef.current) return;-- const finalize = async () => {- const state = stateRef.current;- if (!state.output || state.finalized) return;-- state.finalized = true;- onProgressRef.current("finalizing", 100);-- try {- await state.output.finalize();- } catch (finalErr) {- if (activeRef.current) {- onErrorRef.current(- new Error(- `Finalizing output muxer failed: ${- finalErr instanceof Error ? finalErr.message : String(finalErr)- }. This is typically caused by insufficient system memory — ` +- "please switch to Server rendering.",- ),- );- }- return;- }-- if (!activeRef.current) return;-- const mimeType = isAudioOnly- ? format === "webm"- ? "audio/webm"- : "audio/mp4"- : isMp3- ? "audio/mpeg"- : format === "webm"- ? "video/webm"- : "video/mp4";-- let blob: Blob;- if (state.fileHandle) {- const raw = await state.fileHandle.getFile();- blob = new File([raw], `export-${nodeId}.${format}`, {- type: mimeType,- });- } else {- const bufferTarget = state.target as BufferTarget;- if (!bufferTarget.buffer) {- onErrorRef.current(- new Error(- "Muxing completed but output buffer is empty — browser may be out of memory.",- ),- );- return;- }- blob = new Blob([bufferTarget.buffer], { type: mimeType });- }-- onCompleteRef.current(blob);- };-- void finalize();- // eslint-disable-next-line react-hooks/exhaustive-deps- }, [audioState.phase]);-- // ── Effect 5: Audio muxer state → onProgress bridge ──────────────────────- //- // useSyncExternalStore deliberately avoids calling onProgress directly- // from AudioMuxer (which has no knowledge of the prop). This effect is the- // single bridge between the two worlds.-- useEffect(() => {- switch (audioState.phase) {- case "mixing":- onProgressRef.current("audio", 0);- break;- case "encoding":- onProgressRef.current("audio", audioState.progress);- break;- }- }, [audioState.phase, audioState.progress]);-- // ── Effect 6: Audio muxer error → onError bridge ─────────────────────────-- useEffect(() => {- if (audioState.phase === "error" && audioState.error && activeRef.current) {- onErrorRef.current(audioState.error);- }- }, [audioState.phase, audioState.error]);-- // ── Render ────────────────────────────────────────────────────────────────-- // Audio-only and mp3 formats don't need a visible canvas- if (skipVideo) return null;- // Not yet initialized- if (frame < 0) return null;-- return (- <CanvasComposition- renderId={`browser-render-${nodeId}`}- virtualMedia={virtualMedia}- containerWidth={width}- containerHeight={height}- frame={frame}- fps={fps}- />- );-};--// ─── BrowserVideoRenderer (public wrapper) ────────────────────────────────────--export const BrowserVideoRenderer: React.FC<BrowserRenderProps> = (props) => {- const containerRef = useRef<HTMLDivElement>(null);-- return (- <div- ref={containerRef}- style={{- position: "fixed",- // Render off-screen; still in the DOM so WebGPU surface stays alive- top: -10_000,- left: -10_000,- width: props.width,- height: props.height,- pointerEvents: "none",- }}- >- <RenderProvider- containerRef={containerRef}- width={props.width}- height={props.height}- >- <BrowserVideoRendererInner {...props} />- </RenderProvider>- </div>- );-};diff --git a/packages/compositions/src/compositions/canvas-composition.tsx b/packages/compositions/src/compositions/canvas-composition.tssimilarity index 75%rename from packages/compositions/src/compositions/canvas-composition.tsxrename to packages/compositions/src/compositions/canvas-composition.tsindex fd6ab4f1..33e0626d 100644--- a/packages/compositions/src/compositions/canvas-composition.tsx+++ b/packages/compositions/src/compositions/canvas-composition.ts@@ -1,4 +1,3 @@-import { getEnv } from "@gitframes/client-utils";import {type ConnectedInput,type FrameContext,@@ -17,7 +16,6 @@ import {webgpuRegistry,} from "@gitframes/node-sdk";import {- clearVideoNodeState,drawCaptionNode,drawGifNode,drawImageNode,@@ -26,17 +24,10 @@ import {drawSignalNode,drawSvgNode,drawVideoNode,- lutStore,- mediaDecoderCache,type RenderContextValue,- SlugFontCache,signalRegistry,- useRenderContext,} from "@gitframes/webgpu-renderers";-import React, { memo } from "react";import { computeRenderParams } from "../utils/apply-operations.js";-import { normalizeTimeline } from "../utils/normalization.js";-import { useCompositionState } from "./scene.js";// Cache segment ranges per (segments reference) to avoid recomputation each frameconst segmentRangeCache = new WeakMap<@@ -703,227 +694,3 @@ export async function drawCompositionTree(}}}--export const CanvasComposition: React.FC<NodeRenderProps> = memo((props) => {- const ctx = useRenderContext();- const { renderId, virtualMedia: rawVirtualMedia } = props;- const state = useCompositionState(renderId);-- const { virtualMedia, fps } = React.useMemo(() => {- const fpsValue = props.fps ?? state.fps;- const normalized = normalizeTimeline(rawVirtualMedia, fpsValue);- return { virtualMedia: normalized, fps: fpsValue };- }, [rawVirtualMedia, state.fps, props.fps]);-- const frame = props.frame ?? state.frame;-- const isMountedRef = React.useRef(false);- const latestTaskRef = React.useRef<{- ctx: RenderContextValue;- virtualMedia: VirtualMediaData;- frame: number;- fps: number;- props: NodeRenderProps;- } | null>(null);- const isRenderingRef = React.useRef(false);-- const [fontUpdateTick, forceUpdate] = React.useState(0);- React.useEffect(() => {- const unsubscribe = SlugFontCache.addListener(() => {- if (isMountedRef.current) {- forceUpdate((t) => t + 1);- }- });- return unsubscribe;- }, []);-- React.useEffect(() => {- const cdnDomain = getEnv("R2_CUSTOM_DOMAIN") as string;- if (!cdnDomain) {- console.error("[CanvasComposition] R2_CUSTOM_DOMAIN is not defined.");- return;- }- const url = `https://${cdnDomain}/static/NotoColorEmoji.ttf`;- SlugFontCache.preloadEmojiFontFace(url).catch((err) => {- console.error("[CanvasComposition] Failed to preload emoji font:", err);- });- }, []);-- const [lutUpdateTick, setLutUpdateTick] = React.useState(0);- React.useEffect(() => {- const unsubscribe = lutStore.onChange(() => {- if (isMountedRef.current) {- setLutUpdateTick((t) => t + 1);- }- });- return unsubscribe;- }, []);-- React.useLayoutEffect(() => {- isMountedRef.current = true;- return () => {- isMountedRef.current = false;-- // 1. Clear media decoders associated with this composition- mediaDecoderCache.clearNode(renderId);-- // 2. Clear video node state (cached fallback textures)- clearVideoNodeState(renderId, ctx?.device);-- // 3. Clear any delay handles associated with this composition- if (- typeof globalThis !== "undefined" &&- (globalThis as any).__GATEWAI_DELAYS__- ) {- const delays = (globalThis as any).__GATEWAI_DELAYS__;- if (delays instanceof Set) {- for (const handle of delays) {- if (typeof handle === "string" && handle.startsWith(renderId)) {- delays.delete(handle);- }- }- }- }-- if (- typeof window !== "undefined" &&- (window as any).renderer_delayRenderHandles- ) {- const handles = (window as any).renderer_delayRenderHandles;- if (Array.isArray(handles)) {- const filtered = handles.filter(- (handle) =>- !(typeof handle === "string" && handle.startsWith(renderId)),- );- (window as any).renderer_delayRenderHandles = filtered;- }- }- };- }, [renderId, ctx]);-- React.useLayoutEffect(() => {- if (!ctx || !virtualMedia) return;-- latestTaskRef.current = {- ctx,- virtualMedia,- frame,- fps,- props,- };-- const triggerRender = async () => {- if (isRenderingRef.current) return;- isRenderingRef.current = true;-- while (latestTaskRef.current && isMountedRef.current) {- const task = latestTaskRef.current;- if (task.ctx !== ctx) {- // Context changed (e.g. device lost), let the other effect handle it- break;- }- latestTaskRef.current = null;-- try {- const { device, surface, renderer } = task.ctx;- const targetW = surface.width;- const targetH = surface.height;- if (targetW === 0 || targetH === 0) continue;-- const encoder = device.createCommandEncoder();- const stableTex = renderer.getTemporaryTexture(targetW, targetH);- const stableView = stableTex.createView();-- // Initial clear of the stable texture- const clearPass = renderer.beginFrame(- encoder,- stableView,- { r: 0, g: 0, b: 0, a: 0 },- targetW,- targetH,- "clear",- );- clearPass.end();-- await drawCompositionTree(- task.ctx,- encoder,- stableView,- stableTex,- targetW,- targetH,- task.virtualMedia,- {- ...task.props,- frame: task.frame,- fps: task.fps,- isPlaying: task.props.isPlaying ?? state.isPlaying,- isVideoMode: task.virtualMedia.operation.dataType === "Video",- excludeTextures: [stableTex],- },- );-- if (latestTaskRef.current !== null) {- // A newer task was scheduled while we were awaiting. Discard this stale frame.- continue;- }-- if (isMountedRef.current && !renderer.isDestroyed) {- // Get FRESH canvas view right before submission- const blitW = surface.width;- const blitH = surface.height;- if (blitW > 0 && blitH > 0) {- const canvasView = surface.getCurrentTextureView();- const blitPass = renderer.beginFrame(- encoder,- canvasView,- { r: 0, g: 0, b: 0, a: 0 },- blitW,- blitH,- "clear",- );- renderer.drawTexture(blitPass, stableTex, {- x: 0,- y: 0,- width: blitW,- height: blitH,- });- blitPass.end();- }-- device.queue.submit([encoder.finish()]);- surface.present();-- // Synchronize with the frame capture process to avoid black frames- const key = `${task.props.renderId}-${task.frame}`;- if (!(window as any).__frameRenderResolvers) {- (window as any).__frameRenderResolvers = new Map();- }- const status = (window as any).__frameRenderResolvers.get(key);- if (status) {- status.rendered = true;- if (status.resolver) {- status.resolver();- }- } else {- (window as any).__frameRenderResolvers.set(key, {- rendered: true,- });- }- }- } catch (err) {- console.error("Error drawing WebGPU composition tree:", err);- }- }-- isRenderingRef.current = false;- if (latestTaskRef.current && isMountedRef.current) {- void triggerRender();- }- };-- void triggerRender();- }, [ctx, virtualMedia, frame, fps, props, fontUpdateTick, lutUpdateTick]);-- return null;-});diff --git a/packages/compositions/src/compositions/composition-state.ts b/packages/compositions/src/compositions/composition-state.tsnew file mode 100644index 00000000..dce28b51--- /dev/null+++ b/packages/compositions/src/compositions/composition-state.ts@@ -0,0 +1,75 @@+import type { VirtualMediaData } from "@gitframes/core";++const DEFAULT_STATE = { frame: 0, fps: 30, isPlaying: false };++class CompositionStateStore {+ private states = new Map<+ string,+ { frame: number; fps: number; isPlaying: boolean }+ >();+ private listeners = new Map<string, Set<() => void>>();++ setState(key: string, frame: number, fps: number, isPlaying?: boolean) {+ const current = this.states.get(key);+ const resolvedPlaying =+ isPlaying !== undefined ? isPlaying : (current?.isPlaying ?? false);+ if (+ current?.frame === frame &&+ current?.fps === fps &&+ current?.isPlaying === resolvedPlaying+ )+ return;+ this.states.set(key, { frame, fps, isPlaying: resolvedPlaying });+ this.notify(key);+ }++ getState(key: string) {+ if (this.states.has(key)) return this.states.get(key)!;+ for (const [storeKey, value] of this.states.entries()) {+ if (key.startsWith(storeKey)) return value;+ }+ return DEFAULT_STATE;+ }++ subscribe(key: string, listener: () => void) {+ if (!this.listeners.has(key)) this.listeners.set(key, new Set());+ this.listeners.get(key)!.add(listener);+ return () => {+ const set = this.listeners.get(key);+ set?.delete(listener);+ if (set?.size === 0) {+ this.listeners.delete(key);+ this.states.delete(key);+ }+ };+ }++ clearKey(key: string) {+ this.states.delete(key);+ }++ private notify(key: string) {+ for (const [listenerKey, set] of this.listeners.entries()) {+ if (listenerKey === key || listenerKey.startsWith(key)) {+ set.forEach((l) => l());+ }+ }+ }+}++export const compositionStateStore = new CompositionStateStore();++export interface SceneProps {+ viewportWidth: number;+ viewportHeight: number;+ containerWidth?: number;+ containerHeight?: number;+ virtualMedia?: VirtualMediaData;+ backgroundColor?: string;+ type?: "Video" | "Audio" | "Image";+ volume?: number;+ renderId?: string;+ frame?: number;+ fps?: number;+ [key: string]: unknown;+}diff --git a/packages/compositions/src/compositions/lut-renderer.tsx b/packages/compositions/src/compositions/lut-renderer.tsxdeleted file mode 100644index 282816f0..00000000--- a/packages/compositions/src/compositions/lut-renderer.tsx+++ /dev/null@@ -1,788 +0,0 @@-/// <reference types="webgpu" />--import {- ensureDevice,- lutStore,- lutViewerWgsl,-} from "@gitframes/webgpu-renderers";-import type React from "react";-import { useCallback, useEffect, useRef, useState } from "react";--// ─── Types ────────────────────────────────────────────────────────────────────--interface LutRendererProps {- renderId: string;- src: string;- viewportWidth: number;- viewportHeight: number;-}--// ─── Sub-components ───────────────────────────────────────────────────────────--/**- * Precision viewport-marker brackets, like a professional camera viewfinder.- */-const CornerBrackets: React.FC = () => {- const positions = [- { style: { top: 10, left: 10 }, rotate: "0deg" },- { style: { top: 10, right: 10 }, rotate: "90deg" },- { style: { bottom: 10, right: 10 }, rotate: "180deg" },- { style: { bottom: 10, left: 10 }, rotate: "270deg" },- ] as const;-- return (- <>- {positions.map((p, i) => (- <svg- key={i}- width={14}- height={14}- viewBox="0 0 14 14"- fill="none"- style={{- position: "absolute",- ...p.style,- transform: `rotate(${p.rotate})`,- opacity: 0.22,- pointerEvents: "none",- }}- >- <path- d="M1 11 L1 1 L11 1"- stroke="white"- strokeWidth="1.5"- strokeLinecap="square"- />- </svg>- ))}- </>- );-};--/**- * Animated loading state — a pulsing orbit rings + scanning grid aesthetic,- * evoking a scope warming up to render the color space.- */-const LoadingOverlay: React.FC = () => (- <div- style={{- position: "absolute",- inset: 0,- background: "#0d0d0f",- display: "flex",- flexDirection: "column",- alignItems: "center",- justifyContent: "center",- gap: 16,- }}- >- {/* Concentric orbit rings */}- <div style={{ position: "relative", width: 52, height: 52 }}>- {([0, 1, 2] as const).map((i) => (- <div- key={i}- style={{- position: "absolute",- inset: `${i * 9}px`,- borderRadius: "50%",- border: "1px solid rgba(255,255,255,0.12)",- animation: `lutPulse ${1.6 + i * 0.35}s ease-in-out infinite`,- animationDelay: `${i * 0.25}s`,- }}- />- ))}- <div- style={{- position: "absolute",- inset: 0,- display: "flex",- alignItems: "center",- justifyContent: "center",- }}- >- <div- style={{- width: 5,- height: 5,- borderRadius: "50%",- background: "rgba(255,255,255,0.35)",- animation: "lutPulse 1.1s ease-in-out infinite",- }}- />- </div>- </div>-- <span- style={{- fontFamily: "ui-monospace, 'SF Mono', Menlo, Consolas, monospace",- fontSize: "9.5px",- letterSpacing: "0.14em",- color: "rgba(255,255,255,0.18)",- textTransform: "uppercase" as const,- }}- >- Initialising LUT- </span>- </div>-);--/**- * Error state — minimal, icon-anchored, no heavy red backgrounds.- */-const ErrorOverlay: React.FC<{ message: string }> = ({ message }) => (- <div- style={{- position: "absolute",- inset: 0,- background: "#0d0d0f",- display: "flex",- flexDirection: "column",- alignItems: "center",- justifyContent: "center",- padding: "2rem",- gap: 10,- }}- >- <div- style={{- width: 38,- height: 38,- borderRadius: "50%",- border: "1px solid rgba(239,68,68,0.2)",- background: "rgba(239,68,68,0.04)",- display: "flex",- alignItems: "center",- justifyContent: "center",- }}- >- <svg width="14" height="14" viewBox="0 0 14 14" fill="none">- <circle- cx="7"- cy="7"- r="6"- stroke="rgba(239,68,68,0.4)"- strokeWidth="1"- />- <path- d="M7 3.5V7.5M7 9.5H7.01"- stroke="rgba(239,68,68,0.55)"- strokeWidth="1.4"- strokeLinecap="round"- />- </svg>- </div>- <span- style={{- fontFamily:- "-apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif",- fontSize: "11.5px",- fontWeight: 500,- color: "rgba(255,255,255,0.35)",- letterSpacing: "-0.01em",- }}- >- Render unavailable- </span>- <span- style={{- fontFamily: "ui-monospace, 'SF Mono', Menlo, Consolas, monospace",- fontSize: "9px",- color: "rgba(255,255,255,0.14)",- textAlign: "center",- maxWidth: 220,- lineHeight: 1.65,- letterSpacing: "0.01em",- }}- >- {message}- </span>- </div>-);--// ─── Keyframe styles injected once ────────────────────────────────────────────--const STYLES = `- @keyframes lutPulse {- 0%, 100% { opacity: 0.25; }- 50% { opacity: 0.85; }- }- @keyframes lutFadeUp {- from { opacity: 0; transform: translateY(3px); }- to { opacity: 1; transform: translateY(0); }- }- .lut-hud-item {- transition: opacity 0.22s ease;- }- .lut-viewport:not(:hover) .lut-hud-item {- opacity: 0;- }- .lut-viewport:hover .lut-hud-item {- opacity: 1;- }- .lut-reset-btn:hover {- background: rgba(255,255,255,0.1) !important;- color: rgba(255,255,255,0.65) !important;- }-`;--// ─── Main Component ───────────────────────────────────────────────────────────--export const LutRenderer: React.FC<LutRendererProps> = ({- src,- viewportWidth,- viewportHeight,-}) => {- const canvasRef = useRef<HTMLCanvasElement | null>(null);- const [error, setError] = useState<string | null>(null);- const [loading, setLoading] = useState(true);- const [isDragging, setIsDragging] = useState(false);- const [zoomDisplay, setZoomDisplay] = useState(2.2);-- // Orbit camera state- const rotationRef = useRef<[number, number]>([0.5, -0.4]);- const zoomRef = useRef<number>(2.2);- const isDraggingRef = useRef(false);- const lastMousePosRef = useRef<[number, number]>([0, 0]);- const lastTouchRef = useRef<[number, number]>([0, 0]);-- const lutName =- src- .split("/")- .pop()- ?.replace(/\.[^.]+$/, "")- .toUpperCase() ?? "LUT";-- const handleReset = useCallback(() => {- rotationRef.current = [0.5, -0.4];- zoomRef.current = 2.2;- setZoomDisplay(2.2);- }, []);-- // Ref refs for dynamic asset swap- const currentLutRef = useRef<any>(null);- const latestSrcRef = useRef(src);- latestSrcRef.current = src;-- // ─── WebGPU Initialisation (Once on mount / canvas ready) ───────────────────- useEffect(() => {- let active = true;- let cleanupWebGPU: (() => void) | undefined;-- async function initWebGPU() {- try {- const canvas = canvasRef.current;- if (!canvas) return;-- // Use the shared singleton device so LUT GPU resources from- // the composition renderer (e.g. ExtractLUT) are directly usable.- const device = await ensureDevice();- if (!active) return;-- const context = canvas.getContext("webgpu");- if (!context) throw new Error("Failed to create WebGPU context.");-- const format = navigator.gpu.getPreferredCanvasFormat();- context.configure({ device, format, alphaMode: "premultiplied" });-- const shaderModule = device.createShaderModule({ code: lutViewerWgsl });-- const uniformBuffer = device.createBuffer({- size: 20, // 5 × f32- usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,- });-- const bindGroupLayout = device.createBindGroupLayout({- entries: [- { binding: 0, visibility: GPUShaderStage.VERTEX, buffer: {} },- ],- });- const bindGroup = device.createBindGroup({- layout: bindGroupLayout,- entries: [{ binding: 0, resource: { buffer: uniformBuffer } }],- });-- let depthTexture = device.createTexture({- size: [canvas.width || 800, canvas.height || 600],- format: "depth24plus",- usage: GPUTextureUsage.RENDER_ATTACHMENT,- });-- const pipelineLayout = device.createPipelineLayout({- bindGroupLayouts: [bindGroupLayout],- });-- const blendState = {- color: {- srcFactor: "src-alpha" as const,- dstFactor: "one-minus-src-alpha" as const,- },- alpha: {},- };- const depthState = {- depthWriteEnabled: true,- depthCompare: "less" as const,- format: "depth24plus" as const,- };-- const pipeline = device.createRenderPipeline({- layout: pipelineLayout,- vertex: {- module: shaderModule,- entryPoint: "vs_main",- buffers: [- {- arrayStride: 24,- stepMode: "instance",- attributes: [- { shaderLocation: 0, offset: 0, format: "float32x3" },- { shaderLocation: 1, offset: 12, format: "float32x3" },- ],- },- ],- },- fragment: {- module: shaderModule,- entryPoint: "fs_main",- targets: [{ format, blend: blendState }],- },- primitive: { topology: "triangle-list" },- depthStencil: depthState,- });-- const wireframePipeline = device.createRenderPipeline({- layout: pipelineLayout,- vertex: { module: shaderModule, entryPoint: "vs_wireframe" },- fragment: {- module: shaderModule,- entryPoint: "fs_wireframe",- targets: [{ format, blend: blendState }],- },- primitive: { topology: "line-list" },- depthStencil: depthState,- });-- let animFrameId = 0;-- function frame() {- if (!active) return;- const c = canvasRef.current;- if (!c) return;-- const rect = c.getBoundingClientRect();- const w = Math.max(- 1,- Math.round(rect.width * window.devicePixelRatio),- );- const h = Math.max(- 1,- Math.round(rect.height * window.devicePixelRatio),- );-- if (c.width !== w || c.height !== h) {- c.width = w;- c.height = h;- depthTexture.destroy();- depthTexture = device.createTexture({- size: [w, h],- format: "depth24plus",- usage: GPUTextureUsage.RENDER_ATTACHMENT,- });- }-- device.queue.writeBuffer(- uniformBuffer,- 0,- new Float32Array([- rotationRef.current[0],- rotationRef.current[1],- zoomRef.current,- w / h,- ]),- );-- const enc = device.createCommandEncoder();- const pass = enc.beginRenderPass({- colorAttachments: [- {- view: context!.getCurrentTexture().createView(),- clearValue: { r: 0.07, g: 0.07, b: 0.08, a: 1.0 },- loadOp: "clear",- storeOp: "store",- },- ],- depthStencilAttachment: {- view: depthTexture.createView(),- depthClearValue: 1.0,- depthLoadOp: "clear",- depthStoreOp: "store",- },- });-- pass.setPipeline(wireframePipeline);- pass.setBindGroup(0, bindGroup);- pass.draw(24, 1, 0, 0);-- const lut = currentLutRef.current;- if (lut) {- pass.setPipeline(pipeline);- pass.setBindGroup(0, bindGroup);- pass.setVertexBuffer(0, lut.vertexBuffer);- pass.draw(6, lut.vertexCount, 0, 0);- }-- pass.end();- device.queue.submit([enc.finish()]);- animFrameId = requestAnimationFrame(frame);- }-- animFrameId = requestAnimationFrame(frame);- cleanupWebGPU = () => {- cancelAnimationFrame(animFrameId);- uniformBuffer.destroy();- depthTexture.destroy();- };- } catch (err) {- if (active) {- setError(err instanceof Error ? err.message : "Error loading LUT");- setLoading(false);- }- }- }-- initWebGPU();- return () => {- active = false;- cleanupWebGPU?.();- };- }, []);-- // ─── Dynamic asset loading (when src changes) ───────────────────- useEffect(() => {- let active = true;-- async function loadLut() {- try {- const device = await ensureDevice();- if (!active) return;-- // 1. Check if already in cache- const cached = lutStore.get(src, device);- if (cached) {- currentLutRef.current = cached;- setLoading(false);- setError(null);- return;- }-- // 2. Try prefix fallback for runtime LUTs to avoid showing loading screen- if (src.startsWith("runtime://lut/")) {- const prefix = src.substring(0, src.lastIndexOf("-") + 1);- if (prefix) {- const fallback = lutStore.getAnyMatching(prefix, device);- if (fallback) {- currentLutRef.current = fallback;- setLoading(false);- }- }- }-- // If no fallback is available at all, show the loading screen- if (!currentLutRef.current) {- setLoading(true);- }- setError(null);-- // 3. Load the asset in the background- const loaded = await lutStore.getOrLoad(src, device);- if (!active) return;-- // Verify this is still the latest requested asset- if (latestSrcRef.current === src) {- currentLutRef.current = loaded;- setLoading(false);- }- } catch (err) {- if (active && latestSrcRef.current === src) {- setError(err instanceof Error ? err.message : "Error loading LUT");- setLoading(false);- }- }- }-- loadLut();- return () => {- active = false;- };- }, [src]);-- // ─── Pointer Handlers ─────────────────────────────────────────────────────-- const handleMouseDown = (e: React.MouseEvent) => {- isDraggingRef.current = true;- setIsDragging(true);- lastMousePosRef.current = [e.clientX, e.clientY];- };-- const handleMouseMove = (e: React.MouseEvent) => {- if (!isDraggingRef.current) return;- const dx = e.clientX - lastMousePosRef.current[0];- const dy = e.clientY - lastMousePosRef.current[1];- lastMousePosRef.current = [e.clientX, e.clientY];- rotationRef.current[0] += dx * 0.005;- rotationRef.current[1] = Math.max(- -Math.PI / 2.1,- Math.min(Math.PI / 2.1, rotationRef.current[1] + dy * 0.005),- );- };-- const handleMouseUp = () => {- isDraggingRef.current = false;- setIsDragging(false);- };-- const handleWheel = (e: React.WheelEvent) => {- const next = Math.max(- 1.1,- Math.min(5.0, zoomRef.current + e.deltaY * 0.002),- );- zoomRef.current = next;- setZoomDisplay(Math.round(next * 10) / 10);- };-- // Touch support- const handleTouchStart = (e: React.TouchEvent) => {- if (e.touches.length === 1) {- isDraggingRef.current = true;- lastTouchRef.current = [e.touches[0].clientX, e.touches[0].clientY];- }- };-- const handleTouchMove = (e: React.TouchEvent) => {- if (!isDraggingRef.current || e.touches.length !== 1) return;- const dx = e.touches[0].clientX - lastTouchRef.current[0];- const dy = e.touches[0].clientY - lastTouchRef.current[1];- lastTouchRef.current = [e.touches[0].clientX, e.touches[0].clientY];- rotationRef.current[0] += dx * 0.005;- rotationRef.current[1] = Math.max(- -Math.PI / 2.1,- Math.min(Math.PI / 2.1, rotationRef.current[1] + dy * 0.005),- );- };-- const handleTouchEnd = () => {- isDraggingRef.current = false;- };-- // ─── Render ───────────────────────────────────────────────────────────────-- const isActive = !loading && !error;-- return (- <>- <style>{STYLES}</style>-- <div- className="lut-viewport nowheel"- style={{- position: "relative",- width: "100%",- aspectRatio: `${viewportWidth} / ${viewportHeight}`,- background: "#0d0d0f",- borderRadius: 10,- overflow: "hidden",- border: isDragging- ? "1px solid rgba(255,255,255,0.14)"- : "1px solid rgba(255,255,255,0.06)",- boxShadow:- "inset 0 0 0 1px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.45)",- transition: "border-color 0.18s ease",- userSelect: "none",- }}- onMouseDown={handleMouseDown}- onMouseMove={handleMouseMove}- onMouseUp={handleMouseUp}- onMouseLeave={handleMouseUp}- onWheel={handleWheel}- onTouchStart={handleTouchStart}- onTouchMove={handleTouchMove}- onTouchEnd={handleTouchEnd}- >- {/* ── WebGPU Canvas ─────────────────────────────────────────────── */}- <canvas- ref={canvasRef}- style={{- display: "block",- width: "100%",- height: "100%",- cursor: isDragging ? "grabbing" : "grab",- touchAction: "none",- }}- />-- {/* ── Viewport Corner Markers ───────────────────────────────────── */}- {isActive && <CornerBrackets />}-- {/* ── LUT Name Badge (top-left) ─────────────────────────────────── */}- {isActive && (- <div- className="lut-hud-item"- style={{- position: "absolute",- top: 12,- left: 12,- display: "flex",- alignItems: "center",- gap: 5,- background: "rgba(0,0,0,0.5)",- backdropFilter: "blur(10px)",- WebkitBackdropFilter: "blur(10px)",- border: "1px solid rgba(255,255,255,0.07)",- borderRadius: 5,- padding: "3px 9px 3px 7px",- animation: "lutFadeUp 0.35s ease",- }}- >- {/* Mini 3-D cube glyph */}- <svg width="9" height="9" viewBox="0 0 9 9" fill="none" aria-hidden>- <path- d="M4.5 0.5L8.5 2.5V6.5L4.5 8.5L0.5 6.5V2.5L4.5 0.5Z"- stroke="rgba(255,255,255,0.28)"- strokeWidth="0.8"- />- <path- d="M4.5 0.5V4.5M4.5 4.5L8.5 2.5M4.5 4.5L0.5 2.5"- stroke="rgba(255,255,255,0.14)"- strokeWidth="0.8"- />- </svg>- <span- style={{- fontFamily:- "ui-monospace, 'SF Mono', Menlo, Consolas, monospace",- fontSize: "9.5px",- letterSpacing: "0.1em",- color: "rgba(255,255,255,0.4)",- textTransform: "uppercase",- }}- >- {lutName}- </span>- </div>- )}-- {/* ── Bottom HUD Bar ────────────────────────────────────────────── */}- {isActive && (- <div- className="lut-hud-item"- style={{- position: "absolute",- bottom: 0,- left: 0,- right: 0,- padding: "14px 12px 10px",- background:- "linear-gradient(to top, rgba(0,0,0,0.55), transparent)",- display: "flex",- alignItems: "center",- justifyContent: "space-between",- pointerEvents: "none",- }}- >- {/* Left: control hints */}- <span- style={{- fontFamily:- "ui-monospace, 'SF Mono', Menlo, Consolas, monospace",- fontSize: "9px",- letterSpacing: "0.1em",- color: "rgba(255,255,255,0.2)",- textTransform: "uppercase",- }}- >- Drag to Rotate · Scroll to Zoom- </span>-- {/* Right: zoom readout + reset */}- <div- style={{- display: "flex",- alignItems: "center",- gap: 6,- pointerEvents: "auto",- }}- >- {/* Zoom badge */}- <div- style={{- background: "rgba(255,255,255,0.05)",- border: "1px solid rgba(255,255,255,0.09)",- borderRadius: 4,- padding: "2px 8px",- display: "flex",- alignItems: "baseline",- gap: 3,- }}- >- <span- style={{- fontFamily:- "ui-monospace, 'SF Mono', Menlo, Consolas, monospace",- fontSize: "8.5px",- color: "rgba(255,255,255,0.22)",- letterSpacing: "0.06em",- textTransform: "uppercase",- }}- >- Z- </span>- <span- style={{- fontFamily:- "ui-monospace, 'SF Mono', Menlo, Consolas, monospace",- fontSize: "10.5px",- color: "rgba(255,255,255,0.5)",- letterSpacing: "0.02em",- }}- >- {zoomDisplay.toFixed(1)}×- </span>- </div>-- {/* Reset button */}- <button- className="lut-reset-btn"- onClick={(e) => {- e.stopPropagation();- handleReset();- }}- title="Reset camera to default view"- style={{- background: "rgba(255,255,255,0.04)",- border: "1px solid rgba(255,255,255,0.09)",- borderRadius: 4,- padding: "3px 8px",- cursor: "pointer",- fontFamily:- "ui-monospace, 'SF Mono', Menlo, Consolas, monospace",- fontSize: "9px",- letterSpacing: "0.08em",- textTransform: "uppercase",- color: "rgba(255,255,255,0.3)",- transition: "background 0.15s, color 0.15s",- }}- >- Reset- </button>- </div>- </div>- )}-- {/* ── Loading Overlay ───────────────────────────────────────────── */}- {loading && <LoadingOverlay />}-- {/* ── Error Overlay ─────────────────────────────────────────────── */}- {error && <ErrorOverlay message={error} />}- </div>- </>- );-};diff --git a/packages/compositions/src/compositions/scene.tsx b/packages/compositions/src/compositions/scene.tsxdeleted file mode 100644index a218fae4..00000000--- a/packages/compositions/src/compositions/scene.tsx+++ /dev/null@@ -1,791 +0,0 @@-import {- getActiveMediaMetadata,- getMediaType,- type VirtualMediaData,-} from "@gitframes/core";-import { type AudioProcessor, audioRegistry } from "@gitframes/node-sdk";-import { PlaybackProvider } from "@gitframes/renderers";-import {- getDevice,- mediaDecoderCache,- RenderProvider,-} from "@gitframes/webgpu-renderers";-import React, {- useCallback,- useEffect,- useId,- useRef,- useSyncExternalStore,-} from "react";-import { computeRenderParams } from "../utils/apply-operations.js";-import { normalizeTimeline } from "../utils/normalization.js";-import { CanvasComposition } from "./canvas-composition.js";-import {- RenderTimelineProvider,- useRenderTimeline,-} from "./timeline-context.js";--// ---// SECTION 1: Audio / Extractor Pipeline (DOM Context)-// ----// React Context to pass down active Web Audio processors from ancestors-export interface AudioProcessorContextValue {- processors: Array<{- opType: string;- virtualMedia: VirtualMediaData;- }>;-}--export const AudioProcessorContext =- React.createContext<AudioProcessorContextValue>({- processors: [],- });--let globalAudioCtx: AudioContext | null = null;-const getGlobalAudioContext = () => {- if (typeof window === "undefined") return null;- if (!globalAudioCtx) {- globalAudioCtx = new (- window.AudioContext || (window as any).webkitAudioContext- )();- }- // Don't eagerly resume here — startPlayback handles resume after user gesture.- // Calling resume() on every getter invocation before a gesture causes browser warnings.- return globalAudioCtx;-};--interface NativeAudioClipProps {- sourceUrl: string;- renderId: string;- clipId?: string;- frame: number;- fps: number;- playbackRate: number;- volume: number;- startFrame: number;- trimStartSec: number;-}--export const NativeAudioClip: React.FC<NativeAudioClipProps> = ({- sourceUrl,- renderId,- clipId,- frame,- fps,- playbackRate,- volume,- startFrame,- trimStartSec,-}) => {- const state = useCompositionState(renderId);- const isPlaying = state.isPlaying;- const activeProcessors = React.useContext(AudioProcessorContext);- const activeProcessorsRef = useRef(activeProcessors);- activeProcessorsRef.current = activeProcessors;-- const { accumulatedSeekOffsetSec } = useRenderTimeline();- const accumulatedSeekOffsetSecRef = useRef(accumulatedSeekOffsetSec);- accumulatedSeekOffsetSecRef.current = accumulatedSeekOffsetSec;-- const audioCtx = getGlobalAudioContext();- const decoderRef = useRef<any | null>(null);- const isPlayingRef = useRef(isPlaying);- isPlayingRef.current = isPlaying;-- const activeNodesRef = useRef<Set<AudioBufferSourceNode>>(new Set());- const gainNodeRef = useRef<GainNode | null>(null);- const currentGeneratorRef = useRef<any | null>(null);- const nextScheduleTimeRef = useRef<number>(0);- const lastStartFrameRef = useRef<number | null>(null);- const playbackStartTimeRef = useRef<number | null>(null);- const playbackStartFrameRef = useRef<number>(0);-- const lastTrimStartSecRef = useRef<number | null>(null);- const lastStartFramePropRef = useRef<number | null>(null);- const lastPlaybackRateRef = useRef<number | null>(null);-- // Setup GainNode- useEffect(() => {- if (!audioCtx) return;- const gainNode = audioCtx.createGain();- gainNode.gain.setValueAtTime(volume, audioCtx.currentTime);- gainNode.connect(audioCtx.destination);- gainNodeRef.current = gainNode;-- return () => {- gainNode.disconnect();- gainNodeRef.current = null;- };- }, [audioCtx]);-- // Update Volume in real-time- useEffect(() => {- if (gainNodeRef.current && audioCtx) {- gainNodeRef.current.gain.setValueAtTime(volume, audioCtx.currentTime);- }- }, [volume, audioCtx]);-- // Initialize Audio Decoder- useEffect(() => {- const decoderKey = clipId || renderId;- const decoder = mediaDecoderCache.getAudio(sourceUrl, decoderKey);- decoderRef.current = decoder;-- if (isPlayingRef.current) {- startPlayback(frame);- }-- return () => {- stopAllNodes();- decoderRef.current = null;- // Note: We don't destroy the decoder here because it's cached and might be needed by the next segment- };- }, [sourceUrl, renderId, clipId]);-- const stopAllNodes = () => {- activeNodesRef.current.forEach((node) => {- try {- node.stop();- } catch (_) {}- try {- node.disconnect();- } catch (_) {}- });- activeNodesRef.current.clear();- currentGeneratorRef.current = null;- playbackStartTimeRef.current = null;- };-- const startPlayback = async (targetFrame: number) => {- stopAllNodes();- const decoder = decoderRef.current;- const audioCtx = getGlobalAudioContext();- const gainNode = gainNodeRef.current;- if (!decoder || !audioCtx || !gainNode) return;-- if (audioCtx.state === "suspended") {- await audioCtx.resume();- }-- // Calculate media timestamp:- // timestamp = (currentFrame - startFrame) / fps * playbackRate + trimStartSec- const localFrame = targetFrame - startFrame;- const mediaTimeSec = (localFrame / fps) * playbackRate + trimStartSec;-- const startTimestamp = Math.max(0, mediaTimeSec);- const generator = decoder.getBuffers(startTimestamp);- currentGeneratorRef.current = generator;-- // We add an initial lookahead offset so Web Audio and WebGPU have sufficient headroom- nextScheduleTimeRef.current = audioCtx.currentTime + 0.15;- lastStartFrameRef.current = targetFrame;-- lastTrimStartSecRef.current = trimStartSec;- lastStartFramePropRef.current = startFrame;- lastPlaybackRateRef.current = playbackRate;-- const scheduleLoop = async () => {- try {- for await (const wrapped of generator) {- if (- !isPlayingRef.current ||- currentGeneratorRef.current !== generator- ) {- break;- }-- if (playbackStartTimeRef.current === null) {- playbackStartTimeRef.current = audioCtx.currentTime + 0.15;- nextScheduleTimeRef.current = audioCtx.currentTime + 0.15;- playbackStartFrameRef.current = targetFrame;- }-- const scheduledTime = nextScheduleTimeRef.current;- const durationSec = wrapped.duration / playbackRate;- const buffer = wrapped.buffer;-- // Upmix to stereo if the buffer is mono to ensure panners / processors can output/work in stereo- let finalBuffer = buffer;- if (buffer.numberOfChannels === 1) {- const stereoBuffer = audioCtx.createBuffer(- 2,- buffer.length,- buffer.sampleRate,- );- const monoData = buffer.getChannelData(0);- stereoBuffer.getChannelData(0).set(monoData);- stereoBuffer.getChannelData(1).set(monoData);- finalBuffer = stereoBuffer;- }-- // Extract underlying PCM channel arrays from the AudioBuffer- const channels: Float32Array[] = [];- for (let c = 0; c < finalBuffer.numberOfChannels; c++) {- channels.push(finalBuffer.getChannelData(c));- }- const device = getDevice();-- const elapsedSec = Math.max(- 0,- scheduledTime - (playbackStartTimeRef.current ?? scheduledTime),- );- const chunkFrame =- playbackStartFrameRef.current + (elapsedSec * fps) / playbackRate;-- for (const procInfo of activeProcessorsRef.current.processors) {- const proc = audioRegistry.get(- procInfo.opType,- ) as AudioProcessor | null;- if (proc) {- const procLocalFrame =- chunkFrame +- accumulatedSeekOffsetSecRef.current * fps -- (procInfo.virtualMedia.operation?.startFrame ?? 0);- const elapsedMs = (procLocalFrame / fps) * 1000;- const durationMs =- getActiveMediaMetadata(procInfo.virtualMedia)?.durationMs ?? 0;-- try {- await proc(- channels,- finalBuffer.sampleRate,- procInfo.virtualMedia,- {- device,- frame:- chunkFrame + accumulatedSeekOffsetSecRef.current * fps,- fps,- elapsedMs,- durationMs,- },- );- } catch (err) {- console.error(`Error in audio plugin ${procInfo.opType}:`, err);- }- }- }-- const sourceNode = audioCtx.createBufferSource();- sourceNode.buffer = finalBuffer;- sourceNode.playbackRate.value = playbackRate;-- sourceNode.connect(gainNode);-- const now = audioCtx.currentTime;- const playTime = Math.max(now + 0.02, scheduledTime);-- sourceNode.start(playTime);- activeNodesRef.current.add(sourceNode);-- sourceNode.onended = () => {- activeNodesRef.current.delete(sourceNode);- };-- nextScheduleTimeRef.current = playTime + durationSec;-- // Throttle generator if we are scheduling more than 400ms in advance- while (nextScheduleTimeRef.current - audioCtx.currentTime > 0.4) {- await new Promise((resolve) => setTimeout(resolve, 50));- if (- !isPlayingRef.current ||- currentGeneratorRef.current !== generator- ) {- break;- }- }- }- } catch (e) {- console.error("NativeAudioClip scheduleLoop error:", e);- }- };-- scheduleLoop();- };-- // Handle play/pause & seek events- useEffect(() => {- if (!decoderRef.current || !audioCtx) return;-- // Keep the audio decoder alive and update the ref in case it was pruned/recreated- const decoderKey = clipId || renderId;- const decoder = mediaDecoderCache.getAudio(sourceUrl, decoderKey);- decoderRef.current = decoder;-- if (isPlaying) {- // If we transitioned to playing, or if we seeked while playing- const elapsedSec = Math.max(- 0,- audioCtx.currentTime -- (playbackStartTimeRef.current ?? audioCtx.currentTime),- );- const expectedFrame =- playbackStartFrameRef.current + (elapsedSec * fps) / playbackRate;- const hasSeekedWhilePlaying =- playbackStartTimeRef.current !== null &&- Math.abs(frame - expectedFrame) > 15;-- const hasParamsChanged =- lastTrimStartSecRef.current !== trimStartSec ||- lastStartFramePropRef.current !== startFrame ||- lastPlaybackRateRef.current !== playbackRate;-- if (- currentGeneratorRef.current === null ||- hasSeekedWhilePlaying ||- hasParamsChanged- ) {- startPlayback(frame);- }- } else {- stopAllNodes();- playbackStartTimeRef.current = null;- lastStartFrameRef.current = null;- }- }, [isPlaying, frame, fps, playbackRate, trimStartSec, startFrame]);-- return null;-};--export const AudioCompositionClip: React.FC<{- renderId: string;- rootRenderId?: string;- virtualMedia: VirtualMediaData;- volume?: number;- playbackRateOverride?: number;- trimStartOverride?: number;- trimEndOverride?: number;- renderingContext?: "visual" | "audio";- fps?: number;- frame?: number;- disableFrameExtraction?: boolean;-}> = (props) => {- const {- renderId,- rootRenderId = props.renderId,- virtualMedia: rawVirtualMedia,- volume = 1,- playbackRateOverride,- trimStartOverride,- trimEndOverride: _trimEndOverride,- } = props;- const rawFrame = props.frame;- let fps = props.fps;- if (!fps) {- console.warn("FPS is missing or smaller than 1. Defaulting to 24.");- fps = 24;- }- const { virtualMedia } = React.useMemo(() => {- const normalized = normalizeTimeline(rawVirtualMedia, fps);- return { virtualMedia: normalized };- }, [rawVirtualMedia, fps]);-- const state = useCompositionState(renderId);- const frame = rawFrame ?? state.frame;- const op = virtualMedia?.operation;-- const parentAudioContext = React.useContext(AudioProcessorContext);- const activeProcessors = React.useMemo(() => {- const hasProcessor = op && audioRegistry.get(op.op) !== null;- if (hasProcessor && op) {- return {- processors: [- { opType: op.op, virtualMedia },- ...parentAudioContext.processors,- ],- };- }- return parentAudioContext;- }, [parentAudioContext, op, virtualMedia]);-- if (!op) return null;-- const opVolume = op.volume ?? 1;- const effectiveVolume = volume * opVolume;-- // 1. Coordinate System- const nodeStartFrame = op.startFrame ?? op.timeline?.startFrame ?? 0;- const localFrame = frame - nodeStartFrame;-- // Multi-Segment Rendering Logic- const segments = op.timeline?.segments || [];-- const {- accumulatedSeekOffsetSec: inheritedSeekOffset,- accumulatedClockOffsetSec: inheritedClockOffset,- } = useRenderTimeline();-- const renderSegmentInstance = (- seg: { startSec: number; endSec?: number } | null,- windowStartFrame: number,- instanceId: string,- ) => {- const segmentSeekOffset = seg ? seg.startSec : 0;- const segmentLocalFrame = localFrame - windowStartFrame;-- const renderChild = (- childVirtualMedia: VirtualMediaData,- overrideProps: Partial<typeof props> = {},- ) => {- const childId = overrideProps.renderId || `${instanceId}-child`;- if (!childVirtualMedia) {- return null;- }- const childOp = childVirtualMedia.operation;- const childStartFrame =- childOp?.startFrame ?? childOp?.timeline?.startFrame ?? 0;- const childDurationMs =- getActiveMediaMetadata(childVirtualMedia)?.durationMs ?? 0;- const childDurationFrames =- childDurationMs > 0 ? Math.round((childDurationMs / 1000) * fps) : null;-- const currentFrame =- segmentLocalFrame + Math.round(segmentSeekOffset * (fps || 30));- if (currentFrame < childStartFrame) {- return null;- }- if (- childDurationFrames !== null &&- currentFrame >= childStartFrame + childDurationFrames- ) {- return null;- }-- const clip = (- <AudioCompositionClip- {...props}- {...overrideProps}- frame={overrideProps.frame ?? currentFrame}- fps={overrideProps.fps ?? fps}- renderId={childId}- rootRenderId={rootRenderId}- virtualMedia={childVirtualMedia}- renderingContext={overrideProps.renderingContext ?? "audio"}- volume={overrideProps.volume ?? effectiveVolume}- />- );-- return clip;- };-- const accumulatedSeekOffsetSec =- op.op === "Compositor" ? 0 : inheritedSeekOffset + segmentSeekOffset;- const accumulatedClockOffsetSec =- inheritedClockOffset + windowStartFrame / (fps || 30);-- // Temporal Barrier: Ensure requested time (frame + inherited seek) is within node duration- const totalEffectiveFrame = localFrame;-- const renderContent = () => {- // Temporal Clipping- if (!seg) {- const durationMs =- getActiveMediaMetadata(virtualMedia)?.durationMs ?? 0;- const durationFrames = Math.round((durationMs / 1000) * fps);- if (totalEffectiveFrame < 0 || totalEffectiveFrame >= durationFrames) {- return null;- }- } else {- const durSec = (seg.endSec ?? 0) - seg.startSec;- const durFrames = Math.max(1, Math.round(durSec * fps));- if (- totalEffectiveFrame < windowStartFrame ||- totalEffectiveFrame >= windowStartFrame + durFrames- ) {- return null;- }- }-- if (op.op === "source") {- const mediaType = getMediaType(virtualMedia);- const params = computeRenderParams(virtualMedia);- if (!params.sourceUrl) return null;-- const finalPlaybackRate = Math.max(- 0.01,- (Number(playbackRateOverride) || 1) * (Number(params.speed) || 1),- );-- const effectiveTrimSec = Math.max(- 0,- (Number(trimStartOverride) || 0) +- (Number(params.trimStartSec) || 0) +- accumulatedSeekOffsetSec,- );-- if (mediaType === "Audio" || mediaType === "Video") {- return (- <NativeAudioClip- sourceUrl={params.sourceUrl}- renderId={rootRenderId}- clipId={instanceId}- frame={frame - Math.round(accumulatedSeekOffsetSec * (fps || 30))}- fps={fps}- playbackRate={finalPlaybackRate}- volume={effectiveVolume * (op.opacity === 0 ? 0 : 1)}- startFrame={nodeStartFrame}- trimStartSec={effectiveTrimSec}- />- );- }-- return null;- }-- if (virtualMedia.children && virtualMedia.children.length > 0) {- return (- <>- {virtualMedia.children.map((child, index) => (- <React.Fragment key={index}>- {renderChild?.(child, {- renderId: `${instanceId}-c${index}`,- })}- </React.Fragment>- ))}- </>- );- }-- return null;- };-- return (- <RenderTimelineProvider- value={{ accumulatedSeekOffsetSec, accumulatedClockOffsetSec }}- >- {renderContent()}- </RenderTimelineProvider>- );- };-- if (segments.length > 0) {- let activeSeg: { startSec: number; endSec?: number } | null = null;- let windowStartFrame = 0;- let currentStart = 0;-- for (const seg of segments) {- const durSec = (seg.endSec ?? 0) - seg.startSec;- const durFrames = Math.max(1, Math.round(durSec * fps));- const start = currentStart;- currentStart += durFrames;-- if (localFrame >= start && localFrame < start + durFrames) {- activeSeg = seg;- windowStartFrame = start;- break;- }- }-- if (!activeSeg) {- return null;- }-- return (- <AudioProcessorContext.Provider value={activeProcessors}>- {renderSegmentInstance(- activeSeg,- windowStartFrame,- `${renderId}-active-seg`,- )}- </AudioProcessorContext.Provider>- );- }-- return (- <AudioProcessorContext.Provider value={activeProcessors}>- {renderSegmentInstance(null, 0, renderId)}- </AudioProcessorContext.Provider>- );-};--const DEFAULT_STATE = { frame: 0, fps: 30, isPlaying: false };--class CompositionStateStore {- private states = new Map<- string,- { frame: number; fps: number; isPlaying: boolean }- >();- private listeners = new Map<string, Set<() => void>>();-- setState(key: string, frame: number, fps: number, isPlaying?: boolean) {- const current = this.states.get(key);- const resolvedPlaying =- isPlaying !== undefined ? isPlaying : (current?.isPlaying ?? false);- if (- current?.frame === frame &&- current?.fps === fps &&- current?.isPlaying === resolvedPlaying- )- return;- this.states.set(key, { frame, fps, isPlaying: resolvedPlaying });- this.notify(key);- }-- getState(key: string) {- if (this.states.has(key)) return this.states.get(key)!;- for (const [storeKey, value] of this.states.entries()) {- if (key.startsWith(storeKey)) return value;- }- return DEFAULT_STATE;- }-- subscribe(key: string, listener: () => void) {- if (!this.listeners.has(key)) this.listeners.set(key, new Set());- this.listeners.get(key)!.add(listener);- return () => {- const set = this.listeners.get(key);- set?.delete(listener);- if (set?.size === 0) {- this.listeners.delete(key);- this.states.delete(key);- }- };- }-- clearKey(key: string) {- this.states.delete(key);- }-- private notify(key: string) {- for (const [listenerKey, set] of this.listeners.entries()) {- if (listenerKey === key || listenerKey.startsWith(key)) {- set.forEach((l) => l());- }- }- }-}--export const compositionStateStore = new CompositionStateStore();--export const useCompositionState = (renderId: string) => {- const isRendering =- typeof globalThis !== "undefined" &&- (globalThis as any).__IS_HEADLESS_RENDERER__ === true;-- if (isRendering) {- return compositionStateStore.getState(renderId);- }-- return useSyncExternalStore(- useCallback(- (onStoreChange: () => void) =>- compositionStateStore.subscribe(renderId, onStoreChange),- [renderId],- ),- () => compositionStateStore.getState(renderId),- () => DEFAULT_STATE,- );-};--export interface SceneProps {- viewportWidth: number;- viewportHeight: number;- containerWidth?: number;- containerHeight?: number;- virtualMedia?: VirtualMediaData;- backgroundColor?: string;- type?: "Video" | "Audio" | "Image";- volume?: number;- renderId?: string;- frame?: number;- fps?: number;- [key: string]: unknown;-}--const noopRenderChild = () => null;--const CompositionSceneInner: React.FC<SceneProps> = ({- viewportWidth,- viewportHeight,- virtualMedia,- type,- backgroundColor = "#00000000",- renderId: propRenderId,- frame: propFrame,- fps: propFps,- ...props-}) => {- const containerRef = useRef<HTMLDivElement>(null);-- // Generate a unique ID for this specific CompositionScene instance- const sceneId = useId();- const finalRenderId = (propRenderId ||- `${sceneId}-root-virtual-media`) as string;-- const state = useCompositionState(finalRenderId);- const fps = (propFps ?? state.fps ?? 24) as number;- const frame = (propFrame ?? state.frame ?? 0) as number;- const isPlaying = state.isPlaying ?? false;-- const resolvedViewportW = viewportWidth || 1080;- const resolvedViewportH = viewportHeight || 1080;- const hasAudio =- virtualMedia?.operation.dataType === "Audio" ||- virtualMedia?.operation.dataType === "Video";-- const renderContent = () => {- if (type === "Audio") {- return (- <>- {virtualMedia && hasAudio && (- <AudioCompositionClip- renderId={finalRenderId}- virtualMedia={virtualMedia}- renderingContext="audio"- fps={fps}- frame={frame}- volume={props.volume}- />- )}- </>- );- }-- return (- <>- {virtualMedia && hasAudio && (- <AudioCompositionClip- renderId={finalRenderId}- virtualMedia={virtualMedia}- renderingContext="audio"- fps={fps}- frame={frame}- volume={props.volume}- />- )}- <div- style={{ width: "100%", height: "100%", position: "relative" }}- ref={containerRef}- >- {virtualMedia && virtualMedia.operation.dataType !== "Audio" && (- <RenderProvider- width={resolvedViewportW}- height={resolvedViewportH}- >- <CanvasComposition- renderChild={noopRenderChild}- renderId={finalRenderId}- virtualMedia={virtualMedia}- containerWidth={resolvedViewportW}- containerHeight={resolvedViewportH}- frame={frame}- fps={fps}- isPlaying={isPlaying}- />- </RenderProvider>- )}- </div>- </>- );- };-- return (- <PlaybackProvider value={{ frame, fps, isPlaying }}>- {renderContent()}- </PlaybackProvider>- );-};--export const CompositionScene: React.FC<SceneProps> = (props) => {- return <CompositionSceneInner {...props} />;-};diff --git a/packages/compositions/src/compositions/timeline-context.tsx b/packages/compositions/src/compositions/timeline-context.tsxdeleted file mode 100644index 61e28005..00000000--- a/packages/compositions/src/compositions/timeline-context.tsx+++ /dev/null@@ -1,22 +0,0 @@-import { createContext, useContext } from "react";--export interface RenderTimelineContextValue {- /**- * Total seek offset into the source media (seconds).- * This is the sum of (segment.startSec - segmentOffsetInComposition).- */- accumulatedSeekOffsetSec: number;- /**- * Total clock offset introduced by <Sequence> shifts (seconds).- */- accumulatedClockOffsetSec: number;-}--const RenderTimelineContext = createContext<RenderTimelineContextValue>({- accumulatedSeekOffsetSec: 0,- accumulatedClockOffsetSec: 0,-});--export const RenderTimelineProvider = RenderTimelineContext.Provider;--export const useRenderTimeline = () => useContext(RenderTimelineContext);diff --git a/packages/compositions/src/index.ts b/packages/compositions/src/index.tsindex b7ecd7d6..72bdb4d8 100644--- a/packages/compositions/src/index.ts+++ b/packages/compositions/src/index.ts@@ -1,8 +1,5 @@-export * from "./compositions/browser-render.js";export * from "./compositions/canvas-composition.js";-export * from "./compositions/lut-renderer.js";-export * from "./compositions/scene.js";-export * from "./compositions/timeline-context.js";+export * from "./compositions/composition-state.js";export * from "./utils/apply-operations.js";export * from "./utils/audio-extractor.js";export * from "./utils/layer-logic.js";diff --git a/packages/compositions/src/virtual-nodes.d.ts b/packages/compositions/src/virtual-nodes.d.tsdeleted file mode 100644index 01eff95c..00000000--- a/packages/compositions/src/virtual-nodes.d.ts+++ /dev/null@@ -1,9 +0,0 @@-declare module "virtual-gatewai-skia-renderers" {- import type { FC } from "react";- import type { NodeRenderProps } from "@gitframes/node-sdk";- export const discoveredRenderers: Record<string, FC<NodeRenderProps>>;- export const discoveredAudioProcessors: Record<- string,- (audioCtx: AudioContext, sourceNode: AudioNode, node: any) => AudioNode- >;-}diff --git a/packages/compositions/tsconfig.json b/packages/compositions/tsconfig.jsonindex 1560fdda..b071a8ca 100644--- a/packages/compositions/tsconfig.json+++ b/packages/compositions/tsconfig.json@@ -2,7 +2,6 @@"extends": "@gitframes/tsconfig/base.json","compilerOptions": {"lib": ["ES2022", "ESNext", "DOM", "DOM.Iterable"],- "jsx": "react-jsx","types": ["@webgpu/types"]},"include": ["."],diff --git a/packages/core/package.json b/packages/core/package.jsonindex c3aa1fe5..7bfaad08 100644--- a/packages/core/package.json+++ b/packages/core/package.json@@ -7,7 +7,7 @@},"type": "module","sideEffects": false,- "license": "APGL-3.0",+ "license": "Apache-2.0","module": "./dist/index.mjs","types": "./dist/index.d.mts","exports": {diff --git a/packages/gitframes/package.json b/packages/gitframes/package.jsonindex f077d228..e9d27591 100644--- a/packages/gitframes/package.json+++ b/packages/gitframes/package.json@@ -54,12 +54,6 @@"import": "./dist/signals/index.mjs","default": "./dist/signals/index.mjs"},- "./react": {- "types": "./dist/react/index.d.mts",- "development": "./src/react/index.ts",- "import": "./dist/react/index.mjs",- "default": "./dist/react/index.mjs"- },"./renderer": {"types": "./dist/renderer/index.d.mts","development": "./src/renderer/index.ts",@@ -93,6 +87,7 @@"earcut": "^3.2.4","fontkit": "^2.0.4","gifuct-js": "^2.1.2",+ "gsap": "^3.15.0","mediabunny": "^1.51.0","nanoid": "^5.1.6","onnxruntime-node": "^1.24.0",@@ -157,18 +152,8 @@"@gitframes/vision": "workspace:*","@types/fontkit": "^2.0.9","@types/node": "^24.1.0",- "@types/react": "^19.2.4",- "react": "^19.2.4","tsdown": "^0.19.0","typescript": "^5.8.3","vitest": "4.1.5"- },- "peerDependencies": {- "react": ">=18"- },- "peerDependenciesMeta": {- "react": {- "optional": true- }}-}\ No newline at end of file+}diff --git a/packages/gitframes/src/react/index.ts b/packages/gitframes/src/react/index.tsdeleted file mode 100644index 054477df..00000000--- a/packages/gitframes/src/react/index.ts+++ /dev/null@@ -1,13 +0,0 @@-export {- CanvasComposition,- CanvasComposition as GitframesPlayer,- drawCompositionTree,- useCompositionState,-} from "@gitframes/compositions";--export {- type RenderContextValue,- RenderProvider,- type RenderProviderProps,- useRenderContext,-} from "@gitframes/webgpu-renderers";diff --git a/packages/gitframes/tsconfig.json b/packages/gitframes/tsconfig.jsonindex 9a3feb5a..0e3bcb17 100644--- a/packages/gitframes/tsconfig.json+++ b/packages/gitframes/tsconfig.json@@ -2,7 +2,6 @@"extends": "@gitframes/tsconfig/base.json","compilerOptions": {"moduleResolution": "bundler",- "jsx": "react-jsx","rootDir": "src","outDir": "dist","module": "ESNext"diff --git a/packages/gitframes/tsdown.config.ts b/packages/gitframes/tsdown.config.tsindex 05660664..b70e991b 100644--- a/packages/gitframes/tsdown.config.ts+++ b/packages/gitframes/tsdown.config.ts@@ -6,7 +6,6 @@ export default defineConfig({"src/effects/index.ts","src/audio/index.ts","src/signals/index.ts",- "src/react/index.ts","src/renderer/index.ts","src/fonts/index.ts",],@@ -38,6 +37,5 @@ export default defineConfig({"pino","file-type","dotenv",- "react",],});diff --git a/packages/media/package.json b/packages/media/package.jsonindex 38341d4a..041e7569 100644--- a/packages/media/package.json+++ b/packages/media/package.json@@ -4,7 +4,7 @@"private": false,"type": "module","sideEffects": false,- "license": "APGL-3.0",+ "license": "Apache-2.0","module": "./dist/server.mjs","types": "./dist/server.d.mts","exports": {diff --git a/packages/media/tsconfig.json b/packages/media/tsconfig.jsonindex 800c435f..61955f6a 100644--- a/packages/media/tsconfig.json+++ b/packages/media/tsconfig.json@@ -1,8 +1,7 @@{"extends": "@gitframes/tsconfig/base.json","compilerOptions": {- "lib": ["ES2022", "DOM", "WebWorker"],- "jsx": "react-jsx"+ "lib": ["ES2022", "DOM", "WebWorker"]},"include": ["shared", "browser", "server"],"exclude": ["dist", "build", "node_modules"]diff --git a/packages/node-sdk/package.json b/packages/node-sdk/package.jsonindex 5575d029..176df228 100644--- a/packages/node-sdk/package.json+++ b/packages/node-sdk/package.json@@ -7,7 +7,7 @@},"type": "module","sideEffects": false,- "license": "APGL-3.0",+ "license": "Apache-2.0","description": "SDK for building Gatewai node plugins","module": "./dist/index.mjs","types": "./dist/index.d.mts",diff --git a/packages/node-sdk/tsconfig.json b/packages/node-sdk/tsconfig.jsonindex 7f7f9cf5..9ac79895 100644--- a/packages/node-sdk/tsconfig.json+++ b/packages/node-sdk/tsconfig.json@@ -3,7 +3,6 @@"compilerOptions": {"experimentalDecorators": true,"emitDecoratorMetadata": true,- "jsx": "react-jsx","lib": ["ES2022", "ESNext", "DOM", "DOM.Iterable"]},"include": ["."],diff --git a/packages/renderer/package.json b/packages/renderer/package.jsonindex 435b7d0b..e1e9af85 100644--- a/packages/renderer/package.json+++ b/packages/renderer/package.json@@ -4,7 +4,7 @@"private": false,"type": "module","sideEffects": false,- "license": "APGL-3.0",+ "license": "Apache-2.0","module": "./dist/index.mjs","types": "./dist/index.d.mts","exports": {@@ -44,6 +44,58 @@"@gitframes/client-utils": "workspace:*","@gitframes/compositions": "workspace:*","@gitframes/core": "workspace:*",+ "@gitframes/node-audio-compressor": "workspace:*",+ "@gitframes/node-audio-delay": "workspace:*",+ "@gitframes/node-audio-fade": "workspace:*",+ "@gitframes/node-audio-noise-gate": "workspace:*",+ "@gitframes/node-audio-parametric-eq": "workspace:*",+ "@gitframes/node-audio-reverb": "workspace:*",+ "@gitframes/node-audio-signal-extractor": "workspace:*",+ "@gitframes/node-blur": "workspace:*",+ "@gitframes/node-camera-parallax-3d": "workspace:*",+ "@gitframes/node-canvas-generator": "workspace:*",+ "@gitframes/node-channel-merger": "workspace:*",+ "@gitframes/node-channel-splitter": "workspace:*",+ "@gitframes/node-color-balance": "workspace:*",+ "@gitframes/node-colorkey": "workspace:*",+ "@gitframes/node-compositor": "workspace:*",+ "@gitframes/node-corner-pin": "workspace:*",+ "@gitframes/node-crop": "workspace:*",+ "@gitframes/node-curves": "workspace:*",+ "@gitframes/node-deflicker": "workspace:*",+ "@gitframes/node-displacement-map": "workspace:*",+ "@gitframes/node-extract-frame": "workspace:*",+ "@gitframes/node-extract-lut": "workspace:*",+ "@gitframes/node-film-grain": "workspace:*",+ "@gitframes/node-flip": "workspace:*",+ "@gitframes/node-gradient-map": "workspace:*",+ "@gitframes/node-halftone-screen": "workspace:*",+ "@gitframes/node-high-pass": "workspace:*",+ "@gitframes/node-kenburns": "workspace:*",+ "@gitframes/node-layer-style": "workspace:*",+ "@gitframes/node-levels": "workspace:*",+ "@gitframes/node-liquify": "workspace:*",+ "@gitframes/node-lut": "workspace:*",+ "@gitframes/node-mask-math": "workspace:*",+ "@gitframes/node-mesh-warp": "workspace:*",+ "@gitframes/node-modulate": "workspace:*",+ "@gitframes/node-noise-generator": "workspace:*",+ "@gitframes/node-paint": "workspace:*",+ "@gitframes/node-patch-heal": "workspace:*",+ "@gitframes/node-refine-edge": "workspace:*",+ "@gitframes/node-refraction-caustics": "workspace:*",+ "@gitframes/node-relight-3d": "workspace:*",+ "@gitframes/node-resizer-scaler": "workspace:*",+ "@gitframes/node-sdk": "workspace:*",+ "@gitframes/node-selective-color": "workspace:*",+ "@gitframes/node-shadows-highlights": "workspace:*",+ "@gitframes/node-shape-generator": "workspace:*",+ "@gitframes/node-signal-gate": "workspace:*",+ "@gitframes/node-stereo-panning": "workspace:*",+ "@gitframes/node-tile-offset": "workspace:*",+ "@gitframes/node-unsharp-mask": "workspace:*",+ "@gitframes/node-vignette": "workspace:*",+ "@gitframes/node-vision": "workspace:*","@gitframes/renderers": "workspace:*","@gitframes/server-utils": "workspace:*","@gitframes/webgpu-renderers": "workspace:*",@@ -52,8 +104,7 @@"mediabunny": "^1.51.0","sharp": "^0.33.5","skia-canvas": "^3.0.8",- "webgpu": "^0.4.0",- "@gitframes/node-sdk": "workspace:*"+ "webgpu": "^0.4.0"},"publishConfig": {"access": "public"diff --git a/packages/renderer/src/dynamic-node-discovery.ts b/packages/renderer/src/dynamic-node-discovery.tsindex c8ff5f62..3e6307a5 100644--- a/packages/renderer/src/dynamic-node-discovery.ts+++ b/packages/renderer/src/dynamic-node-discovery.ts@@ -1,7 +1,12 @@import fs from "node:fs";import path from "node:path";import { fileURLToPath, pathToFileURL } from "node:url";-import { audioRegistry, registerWebGPURenderer } from "@gitframes/node-sdk";+import {+ audioRegistry,+ type NodeRendererPlugin,+ registerWebGPURenderer,+} from "@gitframes/node-sdk";+import { BUILTIN_NODE_RENDERERS } from "./generated/node-renderers.js";import {loadNodeManifests,type NodeManifest,@@ -69,11 +74,15 @@ async function registerNode(manifest: NodeManifest): Promise<void> {if (!entry) return;const mod = await import(pathToFileURL(path.join(manifest.path, entry)).href);- const rendererPlugin = mod?.default;- if (!rendererPlugin) return;-// The op comes from package.json only (`gitframes.type` + `gitframes.aliases`).- const ops = [manifest.type, ...manifest.aliases];+ registerPlugin([manifest.type, ...manifest.aliases], mod?.default);+}++function registerPlugin(+ ops: readonly string[],+ rendererPlugin: NodeRendererPlugin | undefined,+): void {+ if (!rendererPlugin) return;if (rendererPlugin.WebGPURenderer) {for (const op of ops) {registerWebGPURenderer(op, rendererPlugin.WebGPURenderer);@@ -86,15 +95,53 @@ async function registerNode(manifest: NodeManifest): Promise<void> {}}+/**+ * Registers the renderers bundled with this package. They are imported by+ * package name, so they resolve from `node_modules` (or the published bundle)+ * and never depend on a `nodes/` directory on disk.+ */+async function registerBuiltinNodeRenderers(): Promise<void> {+ const failed: string[] = [];+ await Promise.all(+ BUILTIN_NODE_RENDERERS.map(async ({ packageName, ops, load }) => {+ try {+ registerPlugin(ops, (await load()).default);+ } catch (err) {+ failed.push(packageName);+ console.error(+ `[HeadlessWebGPURenderer] Failed to load renderer ${packageName}:`,+ err,+ );+ }+ }),+ );+ if (failed.length === BUILTIN_NODE_RENDERERS.length) {+ // Every op would fall through to an empty frame. Fail loudly instead.+ throw new Error(+ "[HeadlessWebGPURenderer] No built-in node renderers could be loaded.",+ );+ }+}++/**+ * Registers the built-in node renderers, then any extra nodes found in the+ * directory named by `GITFRAMES_NODES_DIR` (local node development). A node in+ * that directory overrides the built-in renderer for the same op.+ */export async function discoverAndRegisterNodeRenderers(): Promise<void> {if (typeof process === "undefined" || !process.versions?.node) {return;}- const nodesDir = findNodesDir();- if (!nodesDir) {+ await registerBuiltinNodeRenderers();++ const extraDir = process.env.GITFRAMES_NODES_DIR;+ if (!extraDir) return;++ const nodesDir = path.resolve(extraDir);+ if (!fs.existsSync(nodesDir)) {console.warn(- "[HeadlessWebGPURenderer] Nodes directory not found or invalid.",+ `[HeadlessWebGPURenderer] GITFRAMES_NODES_DIR does not exist: ${nodesDir}`,);return;}diff --git a/packages/renderer/src/generated/node-renderers.ts b/packages/renderer/src/generated/node-renderers.tsnew file mode 100644index 00000000..ddca6aee--- /dev/null+++ b/packages/renderer/src/generated/node-renderers.ts@@ -0,0 +1,269 @@+// @generated by scripts/generate-node-renderers.mts — do not edit.+// Source of truth: nodes/*/package.json (`gitframes`, `./renderer` export).+// Regenerate with `pnpm run generate:node-renderers`.+import type { NodeRendererPlugin } from "@gitframes/node-sdk";++export interface BuiltinNodeRenderer {+ packageName: string;+ /** Declared op followed by its aliases. */+ ops: readonly string[];+ load: () => Promise<{ default?: NodeRendererPlugin }>;+}++export const BUILTIN_NODE_RENDERERS: readonly BuiltinNodeRenderer[] = [+ {+ packageName: "@gitframes/node-lut",+ ops: ["ApplyLUT"],+ load: () => import("@gitframes/node-lut/renderer"),+ },+ {+ packageName: "@gitframes/node-audio-compressor",+ ops: ["AudioCompressor"],+ load: () => import("@gitframes/node-audio-compressor/renderer"),+ },+ {+ packageName: "@gitframes/node-audio-delay",+ ops: ["AudioDelay"],+ load: () => import("@gitframes/node-audio-delay/renderer"),+ },+ {+ packageName: "@gitframes/node-audio-fade",+ ops: ["AudioFade"],+ load: () => import("@gitframes/node-audio-fade/renderer"),+ },+ {+ packageName: "@gitframes/node-audio-noise-gate",+ ops: ["AudioNoiseGate"],+ load: () => import("@gitframes/node-audio-noise-gate/renderer"),+ },+ {+ packageName: "@gitframes/node-audio-parametric-eq",+ ops: ["AudioParametricEq"],+ load: () => import("@gitframes/node-audio-parametric-eq/renderer"),+ },+ {+ packageName: "@gitframes/node-audio-reverb",+ ops: ["AudioReverb"],+ load: () => import("@gitframes/node-audio-reverb/renderer"),+ },+ {+ packageName: "@gitframes/node-audio-signal-extractor",+ ops: ["AudioSignalExtractor"],+ load: () => import("@gitframes/node-audio-signal-extractor/renderer"),+ },+ {+ packageName: "@gitframes/node-blur",+ ops: ["Blur"],+ load: () => import("@gitframes/node-blur/renderer"),+ },+ {+ packageName: "@gitframes/node-camera-parallax-3d",+ ops: ["CameraParallax3D"],+ load: () => import("@gitframes/node-camera-parallax-3d/renderer"),+ },+ {+ packageName: "@gitframes/node-canvas-generator",+ ops: ["CanvasGenerator"],+ load: () => import("@gitframes/node-canvas-generator/renderer"),+ },+ {+ packageName: "@gitframes/node-channel-merger",+ ops: ["ChannelMerger"],+ load: () => import("@gitframes/node-channel-merger/renderer"),+ },+ {+ packageName: "@gitframes/node-channel-splitter",+ ops: ["ChannelSplitter"],+ load: () => import("@gitframes/node-channel-splitter/renderer"),+ },+ {+ packageName: "@gitframes/node-color-balance",+ ops: ["ColorBalance"],+ load: () => import("@gitframes/node-color-balance/renderer"),+ },+ {+ packageName: "@gitframes/node-colorkey",+ ops: ["ColorKey"],+ load: () => import("@gitframes/node-colorkey/renderer"),+ },+ {+ packageName: "@gitframes/node-compositor",+ ops: ["Compositor"],+ load: () => import("@gitframes/node-compositor/renderer"),+ },+ {+ packageName: "@gitframes/node-corner-pin",+ ops: ["CornerPin"],+ load: () => import("@gitframes/node-corner-pin/renderer"),+ },+ {+ packageName: "@gitframes/node-crop",+ ops: ["Crop"],+ load: () => import("@gitframes/node-crop/renderer"),+ },+ {+ packageName: "@gitframes/node-curves",+ ops: ["Curves"],+ load: () => import("@gitframes/node-curves/renderer"),+ },+ {+ packageName: "@gitframes/node-deflicker",+ ops: ["TemporalDeflicker", "Deflicker"],+ load: () => import("@gitframes/node-deflicker/renderer"),+ },+ {+ packageName: "@gitframes/node-displacement-map",+ ops: ["DisplacementMap"],+ load: () => import("@gitframes/node-displacement-map/renderer"),+ },+ {+ packageName: "@gitframes/node-extract-frame",+ ops: ["ExtractFrame"],+ load: () => import("@gitframes/node-extract-frame/renderer"),+ },+ {+ packageName: "@gitframes/node-extract-lut",+ ops: ["ExtractLUT"],+ load: () => import("@gitframes/node-extract-lut/renderer"),+ },+ {+ packageName: "@gitframes/node-film-grain",+ ops: ["FilmGrain"],+ load: () => import("@gitframes/node-film-grain/renderer"),+ },+ {+ packageName: "@gitframes/node-flip",+ ops: ["Flip"],+ load: () => import("@gitframes/node-flip/renderer"),+ },+ {+ packageName: "@gitframes/node-gradient-map",+ ops: ["GradientMap"],+ load: () => import("@gitframes/node-gradient-map/renderer"),+ },+ {+ packageName: "@gitframes/node-halftone-screen",+ ops: ["HalftoneScreen"],+ load: () => import("@gitframes/node-halftone-screen/renderer"),+ },+ {+ packageName: "@gitframes/node-high-pass",+ ops: ["HighPass"],+ load: () => import("@gitframes/node-high-pass/renderer"),+ },+ {+ packageName: "@gitframes/node-kenburns",+ ops: ["KenBurns"],+ load: () => import("@gitframes/node-kenburns/renderer"),+ },+ {+ packageName: "@gitframes/node-layer-style",+ ops: ["LayerStyle"],+ load: () => import("@gitframes/node-layer-style/renderer"),+ },+ {+ packageName: "@gitframes/node-levels",+ ops: ["Levels"],+ load: () => import("@gitframes/node-levels/renderer"),+ },+ {+ packageName: "@gitframes/node-liquify",+ ops: ["Liquify"],+ load: () => import("@gitframes/node-liquify/renderer"),+ },+ {+ packageName: "@gitframes/node-mask-math",+ ops: ["MaskMath"],+ load: () => import("@gitframes/node-mask-math/renderer"),+ },+ {+ packageName: "@gitframes/node-mesh-warp",+ ops: ["MeshWarp"],+ load: () => import("@gitframes/node-mesh-warp/renderer"),+ },+ {+ packageName: "@gitframes/node-modulate",+ ops: ["Modulate"],+ load: () => import("@gitframes/node-modulate/renderer"),+ },+ {+ packageName: "@gitframes/node-noise-generator",+ ops: ["NoiseGenerator"],+ load: () => import("@gitframes/node-noise-generator/renderer"),+ },+ {+ packageName: "@gitframes/node-paint",+ ops: ["Paint"],+ load: () => import("@gitframes/node-paint/renderer"),+ },+ {+ packageName: "@gitframes/node-patch-heal",+ ops: ["PatchHeal"],+ load: () => import("@gitframes/node-patch-heal/renderer"),+ },+ {+ packageName: "@gitframes/node-refine-edge",+ ops: ["RefineEdge"],+ load: () => import("@gitframes/node-refine-edge/renderer"),+ },+ {+ packageName: "@gitframes/node-refraction-caustics",+ ops: ["RefractionCaustics3D"],+ load: () => import("@gitframes/node-refraction-caustics/renderer"),+ },+ {+ packageName: "@gitframes/node-relight-3d",+ ops: ["Relight3D"],+ load: () => import("@gitframes/node-relight-3d/renderer"),+ },+ {+ packageName: "@gitframes/node-resizer-scaler",+ ops: ["ResizerScaler"],+ load: () => import("@gitframes/node-resizer-scaler/renderer"),+ },+ {+ packageName: "@gitframes/node-selective-color",+ ops: ["SelectiveColor"],+ load: () => import("@gitframes/node-selective-color/renderer"),+ },+ {+ packageName: "@gitframes/node-shadows-highlights",+ ops: ["ShadowsHighlights"],+ load: () => import("@gitframes/node-shadows-highlights/renderer"),+ },+ {+ packageName: "@gitframes/node-shape-generator",+ ops: ["ShapeGenerator"],+ load: () => import("@gitframes/node-shape-generator/renderer"),+ },+ {+ packageName: "@gitframes/node-signal-gate",+ ops: ["SignalGate"],+ load: () => import("@gitframes/node-signal-gate/renderer"),+ },+ {+ packageName: "@gitframes/node-stereo-panning",+ ops: ["StereoPanning"],+ load: () => import("@gitframes/node-stereo-panning/renderer"),+ },+ {+ packageName: "@gitframes/node-tile-offset",+ ops: ["TileOffset"],+ load: () => import("@gitframes/node-tile-offset/renderer"),+ },+ {+ packageName: "@gitframes/node-unsharp-mask",+ ops: ["UnsharpMask"],+ load: () => import("@gitframes/node-unsharp-mask/renderer"),+ },+ {+ packageName: "@gitframes/node-vignette",+ ops: ["Vignette"],+ load: () => import("@gitframes/node-vignette/renderer"),+ },+ {+ packageName: "@gitframes/node-vision",+ ops: ["Vision"],+ load: () => import("@gitframes/node-vision/renderer"),+ },+];diff --git a/packages/renderer/src/tests/node-manifest.test.ts b/packages/renderer/src/tests/node-manifest.test.tsindex 715559e6..f542e7f7 100644--- a/packages/renderer/src/tests/node-manifest.test.ts+++ b/packages/renderer/src/tests/node-manifest.test.ts@@ -6,6 +6,7 @@ import {discoverAndRegisterNodeRenderers,findNodesDir,} from "../dynamic-node-discovery.js";+import { BUILTIN_NODE_RENDERERS } from "../generated/node-renderers.js";import {loadNodeManifests,NODE_KINDS,@@ -143,6 +144,22 @@ describe("parseNodeManifest", () => {});});+describe("BUILTIN_NODE_RENDERERS", () => {+ it("matches the node manifests (run `pnpm run generate:node-renderers`)", () => {+ const expected = loadNodeManifests(nodesDir as string)+ .filter((m) => m.enabled && m.rendererExports)+ .map((m) => ({+ packageName: m.packageName,+ ops: [m.type, ...m.aliases],+ }));+ const actual = BUILTIN_NODE_RENDERERS.map(({ packageName, ops }) => ({+ packageName,+ ops: [...ops],+ }));+ expect(actual).toEqual(expected);+ });+});+describe("discoverAndRegisterNodeRenderers", () => {it("registers declared ops and aliases, and no derived names", async () => {await discoverAndRegisterNodeRenderers();diff --git a/packages/renderers/package.json b/packages/renderers/package.jsonindex 01208f0a..561dfe96 100644--- a/packages/renderers/package.json+++ b/packages/renderers/package.json@@ -4,7 +4,7 @@"private": false,"type": "module","sideEffects": false,- "license": "APGL-3.0",+ "license": "Apache-2.0","module": "./dist/index.mjs","types": "./dist/index.d.mts","exports": {@@ -30,14 +30,10 @@},"devDependencies": {"@gitframes/tsconfig": "workspace:*",- "@types/react": "^19.2.4","tsdown": "^0.19.0","typescript": "^5.8.3","vitest": "^5.0.1"},- "peerDependencies": {- "react": "^19.2.4"- },"publishConfig": {"access": "public"}diff --git a/packages/renderers/src/index.ts b/packages/renderers/src/index.tsindex e256056f..c294c165 100644--- a/packages/renderers/src/index.ts+++ b/packages/renderers/src/index.ts@@ -2,7 +2,6 @@ export * from "./blend.js";export * from "./geometry.js";export * from "./interpolate.js";export * from "./math3d/index.js";-export * from "./playback-context.js";export * from "./spring.js";export * from "./text-measurer.js";export * from "./utils.js";diff --git a/packages/renderers/src/playback-context.tsx b/packages/renderers/src/playback-context.tsxdeleted file mode 100644index c3283083..00000000--- a/packages/renderers/src/playback-context.tsx+++ /dev/null@@ -1,29 +0,0 @@-import { createContext, useContext } from "react";--export interface PlaybackContextValue {- frame: number;- fps: number;- isPlaying: boolean;-}--export const PlaybackContext = createContext<PlaybackContextValue>({- frame: 0,- fps: 24,- isPlaying: false,-});--export const PlaybackProvider = PlaybackContext.Provider;--export const useCurrentFrame = (): number => {- const value = useContext(PlaybackContext);- return value.frame;-};--export const useVideoConfig = () => {- const value = useContext(PlaybackContext);- return {- fps: value.fps,- width: 1920,- height: 1080,- };-};diff --git a/packages/renderers/src/utils.ts b/packages/renderers/src/utils.tsindex fcfdc757..5df4f593 100644--- a/packages/renderers/src/utils.ts+++ b/packages/renderers/src/utils.ts@@ -1,36 +1,4 @@import { registerHeadlessFont } from "@gitframes/webgpu-renderers";-import { useMemo } from "react";--declare global {- var __GATEWAI_DELAYS__: Set<number>;-}--if (typeof globalThis !== "undefined") {- globalThis.__GATEWAI_DELAYS__ = globalThis.__GATEWAI_DELAYS__ || new Set();-}--export const hasDelayRender = (): {- delayRender: (msg: string) => number;- continueRender: (h: number) => void;-} | null => {- return useMemo(() => {- let nextHandle = 0;- return {- delayRender: (_msg: string) => {- const h = nextHandle++;- if (typeof globalThis !== "undefined") {- globalThis.__GATEWAI_DELAYS__.add(h);- }- return h;- },- continueRender: (h: number) => {- if (typeof globalThis !== "undefined") {- globalThis.__GATEWAI_DELAYS__.delete(h);- }- },- };- }, []);-};/*** Preloads a font into the browser or headless environment.diff --git a/packages/renderers/tsconfig.json b/packages/renderers/tsconfig.jsonindex c7d89889..70b7ef06 100644--- a/packages/renderers/tsconfig.json+++ b/packages/renderers/tsconfig.json@@ -1,8 +1,7 @@{"extends": "@gitframes/tsconfig/base.json","compilerOptions": {- "lib": ["ES2022", "ESNext", "DOM", "DOM.Iterable"],- "jsx": "react-jsx"+ "lib": ["ES2022", "ESNext", "DOM", "DOM.Iterable"]},"include": ["."],"exclude": ["dist", "build", "node_modules"]diff --git a/packages/server-utils/package.json b/packages/server-utils/package.jsonindex fe4b98f6..b4e047a4 100644--- a/packages/server-utils/package.json+++ b/packages/server-utils/package.json@@ -4,7 +4,7 @@"private": false,"type": "module","sideEffects": false,- "license": "APGL-3.0",+ "license": "Apache-2.0","module": "./dist/index.mjs","types": "./dist/index.d.mts","exports": {diff --git a/packages/tensor-webgpu/package.json b/packages/tensor-webgpu/package.jsonindex c700aa78..21b2827d 100644--- a/packages/tensor-webgpu/package.json+++ b/packages/tensor-webgpu/package.json@@ -7,7 +7,7 @@},"type": "module","sideEffects": false,- "license": "AGPL-3.0",+ "license": "Apache-2.0","module": "./dist/index.mjs","types": "./dist/index.d.mts","exports": {diff --git a/packages/tsconfig/react-library.json b/packages/tsconfig/node-library.jsonsimilarity index 90%rename from packages/tsconfig/react-library.jsonrename to packages/tsconfig/node-library.jsonindex 8a19acc5..1ae7c001 100644--- a/packages/tsconfig/react-library.json+++ b/packages/tsconfig/node-library.json@@ -4,7 +4,6 @@"compilerOptions": {"skipLibCheck": true,"emitDeclarationOnly": true,- "jsx": "react-jsx","lib": ["ES2022", "ESNext", "DOM", "DOM.Iterable"]}}diff --git a/packages/tsconfig/package.json b/packages/tsconfig/package.jsonindex e3113154..52535192 100644--- a/packages/tsconfig/package.json+++ b/packages/tsconfig/package.json@@ -2,7 +2,7 @@"name": "@gitframes/tsconfig","version": "1.3.2","private": false,- "license": "APGL-3.0",+ "license": "Apache-2.0","publishConfig": {"access": "public"}diff --git a/packages/webgpu-renderers/package.json b/packages/webgpu-renderers/package.jsonindex d2a032e2..a2c99aa3 100644--- a/packages/webgpu-renderers/package.json+++ b/packages/webgpu-renderers/package.json@@ -7,7 +7,7 @@},"type": "module","sideEffects": false,- "license": "AGPL-3.0",+ "license": "Apache-2.0","module": "./dist/index.mjs","types": "./dist/index.d.mts","exports": {@@ -46,14 +46,10 @@"@gitframes/tsconfig": "workspace:*","@types/earcut": "^3.0.0","@types/fontkit": "^2.0.9",- "@types/react": "^19.2.4","@vitest/coverage-v8": "^4.1.5","tsdown": "^0.19.0","typescript": "^5.8.3","vitest": "^4.1.5","vitest-mock-extended": "^4.0.0"- },- "peerDependencies": {- "react": "^19.2.4"}}diff --git a/packages/webgpu-renderers/src/render-context.ts b/packages/webgpu-renderers/src/render-context.tsnew file mode 100644index 00000000..ffde41a1--- /dev/null+++ b/packages/webgpu-renderers/src/render-context.ts@@ -0,0 +1,8 @@+import type { Renderer2D } from "./renderer2d/index.js";+import type { SurfaceProvider } from "./surface-provider.js";++export interface RenderContextValue {+ device: GPUDevice;+ renderer: Renderer2D;+ surface: SurfaceProvider;+}diff --git a/packages/webgpu-renderers/src/render-context.tsx b/packages/webgpu-renderers/src/render-context.tsxdeleted file mode 100644index adf8ff59..00000000--- a/packages/webgpu-renderers/src/render-context.tsx+++ /dev/null@@ -1,105 +0,0 @@-import React, {- createContext,- type ReactNode,- useContext,- useEffect,- useRef,- useState,-} from "react";-import { ensureDevice } from "./device.js";-import { Renderer2D } from "./renderer2d/index.js";-import { SlugFontCache } from "./slug/slug-font-cache.js";-import {- BrowserSurfaceProvider,- type SurfaceProvider,-} from "./surface-provider.js";-import { textureCache } from "./texture-cache.js";--export interface RenderContextValue {- device: GPUDevice;- renderer: Renderer2D;- surface: SurfaceProvider;-}--const RenderContext = createContext<RenderContextValue | null>(null);--export const useRenderContext = (): RenderContextValue => {- const context = useContext(RenderContext);- if (!context) {- throw new Error("useRenderContext must be used within a RenderProvider");- }- return context;-};--export interface RenderProviderProps {- containerRef?: React.RefObject<HTMLDivElement | null>;- width?: number;- height?: number;- canvasStyle?: React.CSSProperties;- children: ReactNode;-}--export const RenderProvider: React.FC<RenderProviderProps> = ({- width = 1920,- height = 1080,- children,-}) => {- const canvasRef = useRef<HTMLCanvasElement>(null);- const [contextValue, setContextValue] = useState<RenderContextValue | null>(- null,- );-- useEffect(() => {- const canvas = canvasRef.current;- if (!canvas) return;-- let isMounted = true;- let renderer: Renderer2D | null = null;- let surface: BrowserSurfaceProvider | null = null;-- const initDevice = () => {- ensureDevice().then((device) => {- if (!isMounted) return;- surface = new BrowserSurfaceProvider(device, canvas);- renderer = new Renderer2D(device, surface.colorFormat);- setContextValue({ device, renderer, surface });-- device.lost.then((lostInfo) => {- if (!isMounted) return;- if (lostInfo.reason === "destroyed") return;-- textureCache.destroy();- SlugFontCache.destroy();-- initDevice();- });- });- };-- initDevice();-- return () => {- isMounted = false;- if (renderer) renderer.destroy();- if (surface) surface.destroy();- textureCache.destroy();- SlugFontCache.destroy();- };- }, []);-- return (- <>- <canvas- ref={canvasRef}- width={width}- height={height}- style={{ width: "100%", height: "100%" }}- />- {contextValue && (- <RenderContext.Provider value={contextValue}>- {children}- </RenderContext.Provider>- )}- </>- );-};diff --git a/packages/webgpu-renderers/src/utils.test.ts b/packages/webgpu-renderers/src/utils.test.tsindex 5d0f315b..5a6d2b6c 100644--- a/packages/webgpu-renderers/src/utils.test.ts+++ b/packages/webgpu-renderers/src/utils.test.ts@@ -1,53 +1,7 @@-import { beforeEach, describe, expect, it, vi } from "vitest";--// Mock React-vi.mock("react", () => {- return {- useMemo: vi.fn().mockImplementation((fn) => fn()),- };-});--import { hasDelayRender, withTempTexture } from "./utils.js";+import { describe, expect, it, vi } from "vitest";+import { withTempTexture } from "./utils.js";describe("utils", () => {- describe("hasDelayRender", () => {- beforeEach(() => {- if (typeof globalThis !== "undefined") {- globalThis.__GATEWAI_DELAYS__ = new Set();- }- });-- it("should return an object with delayRender and continueRender", () => {- const result = hasDelayRender();- expect(result).not.toBeNull();- expect(result).toHaveProperty("delayRender");- expect(result).toHaveProperty("continueRender");- });-- it("should track delays in globalThis.__GATEWAI_DELAYS__", () => {- const result = hasDelayRender();- expect(result).not.toBeNull();- if (!result) return;-- const handle1 = result.delayRender("First render delay");- expect(handle1).toBe(0);- expect(globalThis.__GATEWAI_DELAYS__.has(handle1)).toBe(true);-- const handle2 = result.delayRender("Second render delay");- expect(handle2).toBe(1);- expect(globalThis.__GATEWAI_DELAYS__.has(handle2)).toBe(true);-- // Continue first render- result.continueRender(handle1);- expect(globalThis.__GATEWAI_DELAYS__.has(handle1)).toBe(false);- expect(globalThis.__GATEWAI_DELAYS__.has(handle2)).toBe(true);-- // Continue second render- result.continueRender(handle2);- expect(globalThis.__GATEWAI_DELAYS__.has(handle2)).toBe(false);- });- });-describe("withTempTexture", () => {it("should create, execute callback with texture, and destroy texture", () => {const mockTexture = {diff --git a/packages/webgpu-renderers/src/utils.ts b/packages/webgpu-renderers/src/utils.tsindex bafe30d9..03937d49 100644--- a/packages/webgpu-renderers/src/utils.ts+++ b/packages/webgpu-renderers/src/utils.ts@@ -1,5 +1,3 @@-import { useMemo } from "react";-declare global {var __GATEWAI_DELAYS__: Set<number>;}@@ -8,29 +6,6 @@ if (typeof globalThis !== "undefined") {globalThis.__GATEWAI_DELAYS__ = globalThis.__GATEWAI_DELAYS__ || new Set();}-export const hasDelayRender = (): {- delayRender: (msg: string) => number;- continueRender: (h: number) => void;-} | null => {- return useMemo(() => {- let nextHandle = 0;- return {- delayRender: (_msg: string) => {- const h = nextHandle++;- if (typeof globalThis !== "undefined") {- globalThis.__GATEWAI_DELAYS__.add(h);- }- return h;- },- continueRender: (h: number) => {- if (typeof globalThis !== "undefined") {- globalThis.__GATEWAI_DELAYS__.delete(h);- }- },- };- }, []);-};-export function withTempTexture<T>(device: GPUDevice,desc: GPUTextureDescriptor,diff --git a/packages/webgpu-renderers/tsconfig.json b/packages/webgpu-renderers/tsconfig.jsonindex 21d08e55..67f77eda 100644--- a/packages/webgpu-renderers/tsconfig.json+++ b/packages/webgpu-renderers/tsconfig.json@@ -2,7 +2,6 @@"extends": "@gitframes/tsconfig/base.json","compilerOptions": {"lib": ["ES2022", "ESNext", "DOM", "DOM.Iterable"],- "jsx": "react-jsx","target": "esnext"},"include": ["."],diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex d2c2a597..0575c9bb 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -15,10 +15,6 @@ overrides:'@seydx/node-av-win32-arm64-msvc': 6.0.0'@seydx/node-av-win32-arm64-mingw': 6.0.0mediabunny: ^1.51.0- react: ^19.2.4- react-dom: ^19.2.4- '@types/react': ^19.2.4- '@types/react-dom': ^19.2.3tar@<=7.5.3: '>=7.5.4'tar@<7.5.7: '>=7.5.7'tar@<=7.5.2: '>=7.5.3'@@ -2061,9 +2057,6 @@ importers:mediabunny:specifier: ^1.51.0version: 1.51.0- react:- specifier: ^19.2.4- version: 19.2.4yoga-layout:specifier: ^3.2.1version: 3.2.1@@ -2083,9 +2076,6 @@ importers:'@gitframes/tsconfig':specifier: workspace:*version: link:../tsconfig- '@types/react':- specifier: ^19.2.4- version: 19.2.14'@webgpu/types':specifier: ^0.1.70version: 0.1.70@@ -2165,6 +2155,9 @@ importers:gifuct-js:specifier: ^2.1.2version: 2.1.2+ gsap:+ specifier: ^3.15.0+ version: 3.15.0mediabunny:specifier: ^1.51.0version: 1.51.0@@ -2352,12 +2345,6 @@ importers:'@types/node':specifier: ^24.1.0version: 24.10.14- '@types/react':- specifier: ^19.2.4- version: 19.2.14- react:- specifier: ^19.2.4- version: 19.2.4tsdown:specifier: ^0.19.0version: 0.19.0([email protected])([email protected])@@ -2453,9 +2440,162 @@ importers:'@gitframes/core':specifier: workspace:*version: link:../core+ '@gitframes/node-audio-compressor':+ specifier: workspace:*+ version: link:../../nodes/node-audio-compressor+ '@gitframes/node-audio-delay':+ specifier: workspace:*+ version: link:../../nodes/node-audio-delay+ '@gitframes/node-audio-fade':+ specifier: workspace:*+ version: link:../../nodes/node-audio-fade+ '@gitframes/node-audio-noise-gate':+ specifier: workspace:*+ version: link:../../nodes/node-audio-noise-gate+ '@gitframes/node-audio-parametric-eq':+ specifier: workspace:*+ version: link:../../nodes/node-audio-parametric-eq+ '@gitframes/node-audio-reverb':+ specifier: workspace:*+ version: link:../../nodes/node-audio-reverb+ '@gitframes/node-audio-signal-extractor':+ specifier: workspace:*+ version: link:../../nodes/node-audio-signal-extractor+ '@gitframes/node-blur':+ specifier: workspace:*+ version: link:../../nodes/node-blur+ '@gitframes/node-camera-parallax-3d':+ specifier: workspace:*+ version: link:../../nodes/node-camera-parallax-3d+ '@gitframes/node-canvas-generator':+ specifier: workspace:*+ version: link:../../nodes/node-canvas-generator+ '@gitframes/node-channel-merger':+ specifier: workspace:*+ version: link:../../nodes/node-channel-merger+ '@gitframes/node-channel-splitter':+ specifier: workspace:*+ version: link:../../nodes/node-channel-splitter+ '@gitframes/node-color-balance':+ specifier: workspace:*+ version: link:../../nodes/node-color-balance+ '@gitframes/node-colorkey':+ specifier: workspace:*+ version: link:../../nodes/node-colorkey+ '@gitframes/node-compositor':+ specifier: workspace:*+ version: link:../../nodes/node-compositor+ '@gitframes/node-corner-pin':+ specifier: workspace:*+ version: link:../../nodes/node-corner-pin+ '@gitframes/node-crop':+ specifier: workspace:*+ version: link:../../nodes/node-crop+ '@gitframes/node-curves':+ specifier: workspace:*+ version: link:../../nodes/node-curves+ '@gitframes/node-deflicker':+ specifier: workspace:*+ version: link:../../nodes/node-deflicker+ '@gitframes/node-displacement-map':+ specifier: workspace:*+ version: link:../../nodes/node-displacement-map+ '@gitframes/node-extract-frame':+ specifier: workspace:*+ version: link:../../nodes/node-extract-frame+ '@gitframes/node-extract-lut':+ specifier: workspace:*+ version: link:../../nodes/node-extract-lut+ '@gitframes/node-film-grain':+ specifier: workspace:*+ version: link:../../nodes/node-film-grain+ '@gitframes/node-flip':+ specifier: workspace:*+ version: link:../../nodes/node-flip+ '@gitframes/node-gradient-map':+ specifier: workspace:*+ version: link:../../nodes/node-gradient-map+ '@gitframes/node-halftone-screen':+ specifier: workspace:*+ version: link:../../nodes/node-halftone-screen+ '@gitframes/node-high-pass':+ specifier: workspace:*+ version: link:../../nodes/node-high-pass+ '@gitframes/node-kenburns':+ specifier: workspace:*+ version: link:../../nodes/node-kenburns+ '@gitframes/node-layer-style':+ specifier: workspace:*+ version: link:../../nodes/node-layer-style+ '@gitframes/node-levels':+ specifier: workspace:*+ version: link:../../nodes/node-levels+ '@gitframes/node-liquify':+ specifier: workspace:*+ version: link:../../nodes/node-liquify+ '@gitframes/node-lut':+ specifier: workspace:*+ version: link:../../nodes/node-apply-lut+ '@gitframes/node-mask-math':+ specifier: workspace:*+ version: link:../../nodes/node-mask-math+ '@gitframes/node-mesh-warp':+ specifier: workspace:*+ version: link:../../nodes/node-mesh-warp+ '@gitframes/node-modulate':+ specifier: workspace:*+ version: link:../../nodes/node-modulate+ '@gitframes/node-noise-generator':+ specifier: workspace:*+ version: link:../../nodes/node-noise-generator+ '@gitframes/node-paint':+ specifier: workspace:*+ version: link:../../nodes/node-paint+ '@gitframes/node-patch-heal':+ specifier: workspace:*+ version: link:../../nodes/node-patch-heal+ '@gitframes/node-refine-edge':+ specifier: workspace:*+ version: link:../../nodes/node-refine-edge+ '@gitframes/node-refraction-caustics':+ specifier: workspace:*+ version: link:../../nodes/node-refraction-caustics+ '@gitframes/node-relight-3d':+ specifier: workspace:*+ version: link:../../nodes/node-relight-3d+ '@gitframes/node-resizer-scaler':+ specifier: workspace:*+ version: link:../../nodes/node-resizer-scaler'@gitframes/node-sdk':specifier: workspace:*version: link:../node-sdk+ '@gitframes/node-selective-color':+ specifier: workspace:*+ version: link:../../nodes/node-selective-color+ '@gitframes/node-shadows-highlights':+ specifier: workspace:*+ version: link:../../nodes/node-shadows-highlights+ '@gitframes/node-shape-generator':+ specifier: workspace:*+ version: link:../../nodes/node-shape-generator+ '@gitframes/node-signal-gate':+ specifier: workspace:*+ version: link:../../nodes/node-signal-gate+ '@gitframes/node-stereo-panning':+ specifier: workspace:*+ version: link:../../nodes/node-stereo-panning+ '@gitframes/node-tile-offset':+ specifier: workspace:*+ version: link:../../nodes/node-tile-offset+ '@gitframes/node-unsharp-mask':+ specifier: workspace:*+ version: link:../../nodes/node-unsharp-mask+ '@gitframes/node-vignette':+ specifier: workspace:*+ version: link:../../nodes/node-vignette+ '@gitframes/node-vision':+ specifier: workspace:*+ version: link:../../nodes/node-vision'@gitframes/renderers':specifier: workspace:*version: link:../renderers@@ -2511,16 +2651,10 @@ importers:'@gitframes/webgpu-renderers':specifier: workspace:*version: link:../webgpu-renderers- react:- specifier: ^19.2.4- version: 19.2.4devDependencies:'@gitframes/tsconfig':specifier: workspace:*version: link:../tsconfig- '@types/react':- specifier: ^19.2.4- version: 19.2.14tsdown:specifier: ^0.19.0version: 0.19.0([email protected])([email protected])@@ -2664,9 +2798,6 @@ importers:mediabunny:specifier: ^1.51.0version: 1.51.0- react:- specifier: ^19.2.4- version: 19.2.4sharp:specifier: '>=0.35.0'version: 0.35.3(@types/[email protected])@@ -2686,9 +2817,6 @@ importers:'@types/fontkit':specifier: ^2.0.9version: 2.0.9- '@types/react':- specifier: ^19.2.4- version: 19.2.14'@vitest/coverage-v8':specifier: ^4.1.5version: 4.1.5([email protected])@@ -4632,9 +4760,6 @@ packages:'@types/[email protected]':resolution: {integrity: sha512-OowOUbD1lBCOFIPOZ8xnMIhgqA4sCutMiYOmPHL1PTLt5+y1XA+g2+yC9OOyz8p+deMZqPZLxfMjYIfrKsPeFg==}- '@types/[email protected]':- resolution: {integrity: sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==}-'@vitest/[email protected]':resolution: {integrity: sha512-38C0/Ddb7HcRG0Z4/DUem8x57d2p9jYgp18mkaYswEOQBGsI1CG4f/hjm0ZCeaJfWhSZ4k7jgs29V1Zom7Ki9A==}peerDependencies:@@ -4875,9 +5000,6 @@ packages:resolution: {integrity: sha512-X7sjQzceUhu1u7Y/ylrRZFU2FS6LRiFVp6rKLPg23y3x3c3DOKAwuXGDp+PAGjh6CSnCjYeAul8pcT8bAl+lSA==}engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0}- resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==}-resolution: {integrity: sha512-23XHcCF+coGYevirZceTVD7NdJOqVn+49IHyxgszm+JIiHLoB2TkmPtsYkNWT1pvRSGkc35L6NHs0yHkN2SumA==}engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0}@@ -5727,10 +5849,6 @@ packages:resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==}hasBin: true- resolution: {integrity: sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ==}- engines: {node: '>=0.10.0'}-resolution: {integrity: sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==}engines: {node: '>=6'}@@ -8436,10 +8554,6 @@ snapshots:dependencies:undici-types: 7.16.0- '@types/[email protected]':- dependencies:- csstype: 3.2.3-'@vitest/[email protected]([email protected])':dependencies:'@bcoe/v8-coverage': 1.0.2@@ -8696,8 +8810,6 @@ snapshots:mdn-data: 2.27.1source-map-js: 1.2.1- [email protected]: {}-[email protected](@noble/[email protected]):dependencies:whatwg-mimetype: 5.0.0@@ -9592,8 +9704,6 @@ snapshots:strip-json-comments: 2.0.1optional: true- [email protected]: {}-dependencies:graceful-fs: 4.2.11diff --git a/scripts/generate-node-renderers.mts b/scripts/generate-node-renderers.mtsnew file mode 100644index 00000000..7939988c--- /dev/null+++ b/scripts/generate-node-renderers.mts@@ -0,0 +1,107 @@+#!/usr/bin/env -S tsx --conditions development+// Generates the static list of built-in node renderers that @gitframes/renderer+// registers at startup. Static `import()` specifiers let the published bundle+// (packages/gitframes, `noExternal: /^@gitframes\//`) carry every renderer, so+// rendering does not depend on a `nodes/` directory existing on disk.+//+// pnpm run generate:node-renderers # write the generated file+// pnpm run generate:node-renderers -- --check # fail if the committed file is stale+//+// Source of truth: nodes/<node>/package.json (`gitframes` block, `./renderer`+// export, `gatewai.enabled`). Output (never edit by hand):+// packages/renderer/src/generated/node-renderers.ts+// packages/renderer/package.json `dependencies` (one entry per node below)+import fs from "node:fs";+import path from "node:path";+import { fileURLToPath } from "node:url";+import { loadNodeManifests } from "../packages/renderer/src/node-manifest.ts";++const repoRoot = path.resolve(+ path.dirname(fileURLToPath(import.meta.url)),+ "..",+);+const NODES_DIR = path.join(repoRoot, "nodes");+const RENDERER_PKG = path.join(+ repoRoot,+ "packages",+ "renderer",+ "package.json",+);+const OUT_FILE = path.join(+ repoRoot,+ "packages",+ "renderer",+ "src",+ "generated",+ "node-renderers.ts",+);+const check = process.argv.includes("--check");++const manifests = loadNodeManifests(NODES_DIR).filter(+ (m) => m.enabled && m.rendererExports,+);++const entries = manifests.map((m) => {+ const ops = [m.type, ...m.aliases].map((op) => JSON.stringify(op)).join(", ");+ return [+ "\t{",+ `\t\tpackageName: ${JSON.stringify(m.packageName)},`,+ `\t\tops: [${ops}],`,+ `\t\tload: () => import(${JSON.stringify(`${m.packageName}/renderer`)}),`,+ "\t},",+ ].join("\n");+});++const source = `// @generated by scripts/generate-node-renderers.mts — do not edit.+// Source of truth: nodes/*/package.json (\`gitframes\`, \`./renderer\` export).+// Regenerate with \`pnpm run generate:node-renderers\`.+import type { NodeRendererPlugin } from "@gitframes/node-sdk";++export interface BuiltinNodeRenderer {+ packageName: string;+ /** Declared op followed by its aliases. */+ ops: readonly string[];+ load: () => Promise<{ default?: NodeRendererPlugin }>;+}++export const BUILTIN_NODE_RENDERERS: readonly BuiltinNodeRenderer[] = [+${entries.join("\n")}+];+`;++// Each renderer must be a dependency so pnpm links it and turbo builds it first.+const pkg = JSON.parse(fs.readFileSync(RENDERER_PKG, "utf-8"));+const deps: Record<string, string> = { ...pkg.dependencies };+for (const name of Object.keys(deps)) {+ if (name.startsWith("@gitframes/node-") && name !== "@gitframes/node-sdk") {+ delete deps[name];+ }+}+for (const m of manifests) deps[m.packageName] = "workspace:*";+pkg.dependencies = Object.fromEntries(+ Object.entries(deps).sort(([a], [b]) => a.localeCompare(b)),+);+const pkgSource = `${JSON.stringify(pkg, null, "\t")}\n`;++const outputs: [string, string][] = [+ [OUT_FILE, source],+ [RENDERER_PKG, pkgSource],+];++if (check) {+ const stale = outputs.filter(+ ([file, content]) =>+ !fs.existsSync(file) || fs.readFileSync(file, "utf-8") !== content,+ );+ if (stale.length > 0) {+ console.error(+ `Stale: ${stale.map(([f]) => path.relative(repoRoot, f)).join(", ")}. Run \`pnpm run generate:node-renderers\`.`,+ );+ process.exit(1);+ }+ console.log(`node renderers up to date (${manifests.length} nodes)`);+} else {+ fs.mkdirSync(path.dirname(OUT_FILE), { recursive: true });+ for (const [file, content] of outputs) fs.writeFileSync(file, content);+ console.log(`wrote ${manifests.length} node renderers`);+}