@field/cascade 0.4.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/AGENTS.md +18 -0
  2. package/ARCHITECTURE.md +53 -7
  3. package/CHANGELOG.md +68 -0
  4. package/CONTRIBUTING.md +33 -0
  5. package/DESIGN.md +9 -6
  6. package/README.md +80 -4
  7. package/dist/assets/{CodeEditor-BNOJIDzL.js → CodeEditor-BHej8kM9.js} +7 -7
  8. package/dist/assets/{CodePanel-2wp2G0Fj.js → CodePanel-CT3eirK8.js} +2 -2
  9. package/dist/assets/{CustomNodeDialog-DNqaVBqA.js → CustomNodeDialog-BG0m7_Rv.js} +1 -1
  10. package/dist/assets/{ProjectSettings-DcdYF2E1.js → ProjectSettings-BxoLWJG6.js} +2 -2
  11. package/dist/assets/{SettingsDialog-D2xVvyiR.js → SettingsDialog-r9PzZ22z.js} +1 -1
  12. package/dist/assets/{VersionHistoryDialog-DW288ykF.js → VersionHistoryDialog-B6zUV6Dy.js} +1 -1
  13. package/dist/assets/{core-B1y38i95.js → core-wwx5881P.js} +2 -2
  14. package/dist/assets/{cssMode-BLucnaln.js → cssMode-DY5T2Or0.js} +1 -1
  15. package/dist/assets/definitions-BgCvRHyR.js +1 -0
  16. package/dist/assets/{editor.api-B3Et3Pph.js → editor.api-mkORHEMm.js} +1 -1
  17. package/dist/assets/{freemarker2-DVlPoano.js → freemarker2-CIWlk0sw.js} +1 -1
  18. package/dist/assets/geo-CIxgs0oE.js +1 -0
  19. package/dist/assets/{handlebars-B5FZBAMR.js → handlebars-t4jbj3Br.js} +1 -1
  20. package/dist/assets/{html-FodD8KbR.js → html-Ctx7UOlY.js} +1 -1
  21. package/dist/assets/{htmlMode-CsG57VCD.js → htmlMode-BKNZxVw7.js} +1 -1
  22. package/dist/assets/{image-B3F-nq25.js → image-BCBFz0gD.js} +3 -3
  23. package/dist/assets/index-CeqTfMbr.js +212 -0
  24. package/dist/assets/{index-Y2ock1cw.css → index-ilgbOu6G.css} +1 -1
  25. package/dist/assets/{javascript-B3gonF_H.js → javascript-Da_TJBzH.js} +1 -1
  26. package/dist/assets/{jsonMode-Y3w1ahZg.js → jsonMode-Ftt5d1nV.js} +1 -1
  27. package/dist/assets/{liquid-CTpWXIYO.js → liquid-D5kWYG57.js} +1 -1
  28. package/dist/assets/{lspLanguageFeatures-CODBdKEZ.js → lspLanguageFeatures-B-93LC_L.js} +1 -1
  29. package/dist/assets/{mdx-CDAQJZIz.js → mdx-DGT3C_qs.js} +1 -1
  30. package/dist/assets/nodeTypeUtils-BDJsc2Ks.js +1 -0
  31. package/dist/assets/pop-BJGN5Ac4.js +1 -0
  32. package/dist/assets/{python-LOIlxJU-.js → python-Bz3Eew5S.js} +1 -1
  33. package/dist/assets/{razor-CllPQSHo.js → razor-CFDdKpKI.js} +1 -1
  34. package/dist/assets/{tsMode-CO28ut8t.js → tsMode-BaCINWBI.js} +1 -1
  35. package/dist/assets/{typescript-ruU9wKQ_.js → typescript-BoOWspVs.js} +1 -1
  36. package/dist/assets/{workers-Bc1Ywp4-.js → workers-dSWyDxsQ.js} +1 -1
  37. package/dist/assets/{xml-DoXP2Dh1.js → xml-eFi1_vYt.js} +1 -1
  38. package/dist/assets/{yaml-D9YPyGiJ.js → yaml-a7xrJHxm.js} +1 -1
  39. package/dist/cli/index.js +16266 -12653
  40. package/dist/cli/runtime/io.ts +31 -25
  41. package/dist/contracts/definition.d.ts +21 -2
  42. package/dist/contracts/index.d.ts +2 -0
  43. package/dist/contracts/index.js +2 -0
  44. package/dist/contracts/particles.d.ts +54 -0
  45. package/dist/contracts/particles.js +167 -0
  46. package/dist/contracts/scene.d.ts +129 -0
  47. package/dist/contracts/scene.js +73 -0
  48. package/dist/contracts/schema.js +1 -1
  49. package/dist/contracts/validate.js +4 -2
  50. package/dist/contracts/values.d.ts +3 -2
  51. package/dist/contracts/values.js +9 -0
  52. package/dist/index.html +3 -3
  53. package/dist/io.d.ts +4 -16
  54. package/dist/io.js +26 -8
  55. package/dist/player/app.js +810 -0
  56. package/dist/player/embed.d.ts +4 -0
  57. package/dist/player/embed.js +77 -0
  58. package/dist/player/types.d.ts +35 -0
  59. package/dist/runtime/builtins/core/index.d.ts +3 -2
  60. package/dist/runtime/builtins/core/index.js +6 -2
  61. package/dist/runtime/builtins/core/structural.d.ts +168 -0
  62. package/dist/runtime/builtins/core/structural.js +175 -0
  63. package/dist/runtime/builtins/core/time.d.ts +165 -0
  64. package/dist/runtime/builtins/core/time.js +110 -0
  65. package/dist/runtime/builtins/geo/definitions.d.ts +247 -0
  66. package/dist/runtime/builtins/geo/definitions.js +70 -0
  67. package/dist/runtime/builtins/geo/index.d.ts +2 -1
  68. package/dist/runtime/builtins/geo/index.js +3 -1
  69. package/dist/runtime/builtins/geo/render.d.ts +87 -0
  70. package/dist/runtime/builtins/geo/render.js +87 -0
  71. package/dist/runtime/builtins/geo/svgExport.d.ts +11 -0
  72. package/dist/runtime/builtins/geo/svgExport.js +10 -0
  73. package/dist/runtime/builtins/index.d.ts +5 -2
  74. package/dist/runtime/builtins/index.js +13 -3
  75. package/dist/runtime/builtins/pop/definitions.d.ts +2120 -0
  76. package/dist/runtime/builtins/pop/definitions.js +815 -0
  77. package/dist/runtime/builtins/pop/index.d.ts +2 -0
  78. package/dist/runtime/builtins/pop/index.js +2 -0
  79. package/dist/runtime/builtins/scene/definitions.d.ts +356 -0
  80. package/dist/runtime/builtins/scene/definitions.js +224 -0
  81. package/dist/runtime/builtins/scene/index.d.ts +2 -0
  82. package/dist/runtime/builtins/scene/index.js +2 -0
  83. package/dist/runtime/geometry/render.d.ts +109 -0
  84. package/dist/runtime/geometry/render.js +145 -0
  85. package/dist/runtime/geometry/svg.d.ts +29 -0
  86. package/dist/runtime/geometry/svg.js +11 -5
  87. package/dist/runtime/index.d.ts +1 -0
  88. package/dist/runtime/index.js +1 -0
  89. package/dist/runtime/pop/cache.d.ts +27 -0
  90. package/dist/runtime/pop/cache.js +123 -0
  91. package/dist/runtime/pop/forces.d.ts +202 -0
  92. package/dist/runtime/pop/forces.js +519 -0
  93. package/dist/runtime/pop/index.d.ts +5 -0
  94. package/dist/runtime/pop/index.js +5 -0
  95. package/dist/runtime/pop/state.d.ts +136 -0
  96. package/dist/runtime/pop/state.js +283 -0
  97. package/dist/runtime/pop/trail.d.ts +62 -0
  98. package/dist/runtime/pop/trail.js +142 -0
  99. package/dist/runtime/runtime.js +221 -3
  100. package/dist/runtime/scene/index.d.ts +50 -0
  101. package/dist/runtime/scene/index.js +94 -0
  102. package/dist/studio/panel.d.ts +68 -1
  103. package/doc/HEADLESS_GPU.md +4 -4
  104. package/doc/NODE_REFERENCE.md +372 -1
  105. package/doc/PROJECT_AUTHORING.md +16 -4
  106. package/doc/WEB_PLAYER.md +131 -0
  107. package/package.json +16 -2
  108. package/dist/assets/geo-DhyFdBXX.js +0 -1
  109. package/dist/assets/index-CC6YQw2n.js +0 -212
  110. package/dist/assets/nodeTypeUtils-BBA1JqHx.js +0 -1
package/AGENTS.md CHANGED
@@ -37,6 +37,15 @@ my-project/
37
37
 
38
38
  Use `cascade new <name>` to create a project and `cascade node <Name>` to scaffold a custom node in one. Run `cascade .` from a project root to open Studio, `cascade validate <graph.cascade>` for validation, `cascade check <graph.cascade>` for static definition/type checks, `cascade inspect <graph.cascade>` for a JSON summary, `cascade run <graph.cascade>` for headless execution, and `cascade run <graph.cascade> --frames 1-100` for an offline image sequence. `cascade projects` shows or sets the default projects directory.
39
39
 
40
+ `cascade build <graph.cascade> --out <new-directory>` exports a static browser
41
+ player. Use repeatable `--asset <project-relative-file>` for inputs whose paths
42
+ are computed in code. Read `doc/WEB_PLAYER.md` before exporting: server stages
43
+ and dynamic modules are not supported, assets must be explicit, and an existing
44
+ output directory is never overwritten. Serve the result over HTTP, not file://.
45
+ The player is an application host under `src/player`, not another graph engine.
46
+ Each embed owns an iframe realm, assets, IO bridge and GPU lifecycle. No Studio
47
+ imports or `/api/*` dependency may enter the static deployment.
48
+
40
49
  ## Launch Studio
41
50
 
42
51
  For a browser on the same machine, use the secure loopback default:
@@ -135,6 +144,15 @@ They all speak the one `geometry` type, so any output fits any input, and they
135
144
  follow Houdini's parameter names where Houdini has an equivalent node. Geometry
136
145
  is +Y up; the flip into SVG's frame lives in `SvgExport` alone.
137
146
 
147
+ `cascade.pop.*` uses geometry-native particle state; forces accumulate and the
148
+ solver integrates once. `cascade.core.Feedback` owns previous state and bounded
149
+ history, including nested loops. Trails are geometry, not a second canvas
150
+ history. A checkpoint is only an accelerator: cold and warm runs must match
151
+ complete geometry and trails. `cascade.scene.*` assembles geometry, camera and
152
+ lights; the current renderer draws wireframes/points and does not shade lights.
153
+ Read the generated reference for the complete library rather than extending
154
+ the partial vocabulary examples in this guide.
155
+
138
156
  These modules are reserved and need no file under `nodes/`. Do not override a
139
157
  `cascade.core.*` module or use ambient random/time state in a portable node.
140
158
  Time and randomness reach a parameter as an expression or a keyframe channel,
package/ARCHITECTURE.md CHANGED
@@ -20,11 +20,12 @@ Contracts contain no DOM, Svelte, Express, filesystem, process, or implementatio
20
20
 
21
21
  The runtime is environment-neutral. It works in Node and browsers without importing either platform’s APIs, and it never imports Studio. Registration is sealed after the first graph load. Each graph permits one active run and has explicit lifecycle states.
22
22
 
23
- The reserved `cascade.core.*` registry is owned here. `Subnet`, `Input`,
24
- `Output`, `Switch`, `Merge`, `Select`, `Null`, seeded `Random`, and `Remap` resolve
25
- without a project module loader. Named, typed root Input/Output nodes form an
26
- explicit headless graph interface; typed child Input/Output nodes form a subnet interface.
27
- Randomness is a pure function of an authored seed, never ambient process state.
23
+ Reserved built-ins are registered once in `packages/runtime/src/builtins`:
24
+ core hierarchy/routing/time/camera, geometry operations, particle simulation,
25
+ and scene assembly. They need no project module file. The generated
26
+ [node reference](doc/NODE_REFERENCE.md) owns the complete port/parameter list.
27
+ Named, typed root Input/Output nodes form the public graph interface; child
28
+ Input/Output nodes form a subnet interface. Randomness takes an authored seed.
28
29
 
29
30
  ## Hosts
30
31
 
@@ -67,9 +68,12 @@ Custom server applications and browser frontends use `cascade/runtime` directly
67
68
 
68
69
  ## Distribution
69
70
 
70
- The repository has exactly two internal npm workspaces: `@cascade/contracts` and `@cascade/runtime`. The root `cascade` package is the only published package and the only owner of the executable.
71
+ The repository has exactly two internal npm workspaces: `@cascade/contracts` and `@cascade/runtime`. The root `@field/cascade` package, normally installed under the alias `cascade` in projects, is the only published package and executable owner.
71
72
 
72
- Public subpaths are `cascade/contracts`, `cascade/contracts/schema`, `cascade/runtime`, `cascade/runtime/node`, `cascade/runtime/browser`, `cascade/runtime/expressions`, `cascade/runtime/animation`, `cascade/runtime/definition/extract`, `cascade/io`, `cascade/net`, `cascade/stage`, and the compatibility `cascade/shell`.
73
+ Public subpaths include contracts/schema, runtime and its Node/browser,
74
+ expression, animation, camera, render, scene and definition-extraction entries,
75
+ plus `cascade/io`, `cascade/gpu`, `cascade/net`, `cascade/stage`,
76
+ `cascade/shell`, and `cascade/player`. `package.json` is the exact export map.
73
77
 
74
78
  Studio-only project extensions use the type-only `cascade/studio/panel` contract. They are compiled and loaded only by Studio; the neutral runtime and headless hosts never discover or import them.
75
79
 
@@ -121,6 +125,48 @@ Data runs follow graph dependencies. Explicit triggers use a FIFO queue, authore
121
125
 
122
126
  Execution failures resolve to a failed `RunResult`; API misuse and invalid preflight reject. Cancellation propagates through capability calls. Inspection and output values are immutable snapshots; browser-only live resources remain host-owned handles.
123
127
 
128
+ ### Geometry, simulation and feedback
129
+
130
+ Geometry is a shared typed value with point/vertex/primitive attributes,
131
+ topology and groups, not an editor object. POP uses that same value for
132
+ particle state. Forces accumulate acceleration; the solver integrates once
133
+ per timestep. Trails are geometry and can feed the ordinary render/export nodes.
134
+
135
+ `cascade.core.Feedback` is an explicit stateful container within the data DAG.
136
+ Its children run per step; nested Feedback owns its own descendants. Previous
137
+ state and bounded history are wired values, not sibling lookups. Result and
138
+ history use normal output staging and cancellation, with transient loop state
139
+ released even when a child throws.
140
+
141
+ POP checkpoints accelerate deterministic re-simulation; clearing them must not
142
+ change particles **or trails**. The sparse derived cache is module-local, has a
143
+ 64-checkpoint bound across keys, and copies snapshots at its boundary. It does
144
+ not define simulation state. CLI `--frames` already reuses a loaded runtime,
145
+ so it can benefit from checkpoints within the sequence. Separate CLI launches
146
+ do not share that cache.
147
+
148
+ A `scene` contains geometry, an optional camera and lights. A missing camera
149
+ means the viewer supplies its view; an explicit render requires an authored
150
+ camera. The current shared CPU renderer draws wireframes and points, not lit
151
+ surfaces. Camera derivations belong to `packages/runtime/src/camera`; Studio's
152
+ 3D view and offline rendering use that convention rather than separate matrices.
153
+
154
+ ### Browser player
155
+
156
+ The player is a browser application host under `src/player`, not another graph
157
+ engine or package. Static export compiles definition-v1 project modules into
158
+ browser ESM and supplies assets locally. Studio, Python, shell and project
159
+ server routes are not deployment dependencies. Unsupported server operations
160
+ fail explicitly during export. See [browser player](doc/WEB_PLAYER.md) for the
161
+ build/embed contract and current limitations.
162
+
163
+ Each embed has its own iframe realm, runtime, IO bridge, assets and GPU host.
164
+ This isolates existing ambient `cascade/io` imports without swapping global
165
+ transports between asynchronous runs. Shared browser GPU acquisition lives in
166
+ `src/browser/gpu.ts`, also used by Studio. A future migration to explicit
167
+ capability-only IO could permit direct DOM mounts; that is not implemented by
168
+ the iframe player.
169
+
124
170
  ## Animation
125
171
 
126
172
  A parameter carries up to three bindings: a raw value, an expression, and a keyframe channel. `packages/runtime/src/params/resolve.ts` owns their shared resolution rule: channel, expression, value. A channel that samples takes precedence and leaves the expression stored but inert, so emptying the channel restores it. Studio invokes the resolver from `Node.evalParm`; the deterministic runtime invokes it through `PropAnimator`. Nothing else in Studio may read a prop's `value` directly to obtain an animated parameter; a second rule is how an expression badge and a viewer disagree about the same frame.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,74 @@
2
2
 
3
3
  Notable changes to Cascade. Newest first.
4
4
 
5
+ ## 0.5.2 — 2026-09-10
6
+
7
+ ### Fixed
8
+
9
+ - **The load warm-up no longer reports false errors.** A node's ports are
10
+ created by running its code, so on load a connection into a node that has
11
+ never executed has no port to attach to, and Studio cooks the graph
12
+ repeatedly until the wiring settles. Early passes reached nodes whose
13
+ upstream edge had not bound, those nodes ran with `undefined` on that input
14
+ and threw their own "nothing wired to my image input", and a later pass then
15
+ succeeded — leaving a correct graph and a log full of errors that never
16
+ cleared. Reported against the `volume-field` sketch by someone who had
17
+ verified from the cache files that the render was in fact right.
18
+
19
+ The scheduler now distinguishes an input that is *pending* from one that is
20
+ *missing*: a node with an unbound inbound edge is held back as not-ready
21
+ rather than cooked and failed. Once the warm-up stops making progress the
22
+ graph says so, and an edge that still has not bound is treated as unbindable
23
+ — so a genuinely unwired node errors as it always did, rather than silently
24
+ never cooking.
25
+
26
+ ## 0.5.1 — 2026-09-09
27
+
28
+ - Prepared the 0.5 browser-player release for npm, with updated README and
29
+ cascade.field.io documentation covering web embeds, geometry, subnets,
30
+ particles, Feedback, scenes, animation and bounded Dawn renders for agents.
31
+ - Clarified browser/server execution limits, current wireframe/point rendering,
32
+ explicit asset packaging and same-origin player controls. The npm homepage
33
+ now points to cascade.field.io.
34
+
35
+ ## 0.5.0 — 2026-09-09
36
+
37
+ ### Browser player
38
+
39
+ - `cascade build <graph> --out <new-directory>` exports definition-v1 graphs as
40
+ static pages with a lightweight iframe embed API. Browser execution supports
41
+ assets and WebGPU; server capabilities and dynamic modules are rejected at
42
+ build time. No Studio server is required. See [Web player](doc/WEB_PLAYER.md).
43
+ - Each embed owns its runtime, IO bridge and generated assets. Playback and
44
+ edits serialize, failed cooks pause playback, and disposal releases resources.
45
+ Generated images have immutable paths and explicit retention limits.
46
+ - Browser image loading now decodes bridged assets correctly, including SVG
47
+ bitmaps. Studio and the player share browser GPU acquisition.
48
+
49
+ ### Runtime correctness and performance
50
+
51
+ - POP checkpoint caching enforces its 64-entry bound even for one simulation,
52
+ copies mutable particle state at the boundary, and replays the trail window
53
+ so warm and cold renders agree. Malformed field and trail data report errors.
54
+ - Nested Feedback runs children only in their owning loop, orders dependencies
55
+ across container boundaries, publishes history consistently, and clears
56
+ transient state after failures or cancellation.
57
+
58
+ ### Documentation and verification
59
+
60
+ - Updated architecture, authoring and agent guides for geometry, simulations,
61
+ scenes and static deployment. Added real-browser embed and packed-consumer
62
+ checks alongside focused runtime and IO regressions.
63
+ - Retired archived Quill examples with a recoverable backup; removed incidental
64
+ Quill examples from current guidance while retaining removed-node rejection tests.
65
+ - Streamlined shared player image decoding, MIME inference and cleanup error
66
+ handling without changing the public player contract.
67
+ - Removed unused Studio component props and consolidated CLI execution-style
68
+ checks. Empty/dynamic fallback and mixed-graph rejection remain unchanged.
69
+ - Deleted the unreachable WindowManager UI and its private window/tab components;
70
+ Dockview remains Studio's sole layout host. Removed the commented-out Canvas
71
+ sample initializer. The active Graph/Node compatibility engine is unchanged.
72
+
5
73
  ## 0.4.0 — 2026-09-09
6
74
 
7
75
  ### Documentation
package/CONTRIBUTING.md CHANGED
@@ -13,6 +13,7 @@ for product decisions, and [ARCHITECTURE.md](ARCHITECTURE.md) for dependencies.
13
13
  - `packages/runtime/` owns environment-neutral execution mechanisms.
14
14
  - `server/` owns project files, compilation, processes, and host transports.
15
15
  - `src/editor/` owns Studio interactions and presentation.
16
+ - `src/player/` owns the standalone browser host and embed controls.
16
17
  - Sketch repositories own creative algorithms, providers, and project panels.
17
18
 
18
19
  Keep provider SDKs and client-specific data in projects. Do not add dependencies
@@ -39,11 +40,20 @@ git diff --check
39
40
  `npm run build` also runs `build:cli` through its postbuild hook. Keep a final
40
41
  CLI build after any separate Vite build because Vite refreshes `dist/`. Coordinate
41
42
  rebuilds when running Studio servers serve from that checkout.
43
+ Do not run package builds concurrently with tests that read generated package
44
+ files: the builds replace those directories while tests may be importing them.
42
45
 
43
46
  For public API or packaging changes, run `npm run test:package`, which exercises
44
47
  the packed distribution from a temporary consumer. Built-in node-definition or
45
48
  registry changes also require `npm run build:node-reference`; include its result.
46
49
 
50
+ For player changes, run `npm run test:player` after building the CLI. It opens
51
+ an isolated headless Chrome profile and checks actual pixels, multiple embeds,
52
+ playback and disposal on a static server. Set `CASCADE_CHROME` to the Chrome
53
+ executable on non-macOS systems. `CASCADE_TEST_PLAYER=1 npm run test:package`
54
+ also runs that proof against the installed tarball. GPU package verification
55
+ is opt-in separately with `CASCADE_TEST_DAWN=1`.
56
+
47
57
  For prose-only changes, verify source claims, links, examples, and diff hygiene.
48
58
  When changing generated project instructions in `server/src/projectTemplate.ts`,
49
59
  also run `npx --no-install vitest run tests/project-template.test.ts`.
@@ -69,3 +79,26 @@ Never edit the generated [node reference](doc/NODE_REFERENCE.md) by hand.
69
79
 
70
80
  Release/version rules live in [AGENTS.md](AGENTS.md). Publishing and deployment
71
81
  are separate maintainer actions; a documentation update does not publish a release.
82
+
83
+ With an explicit release request, update the README, feature guides, changelog,
84
+ root package/lock version and `site/index.html` together. Run the checks above
85
+ and `CASCADE_TEST_PLAYER=1 CASCADE_TEST_DAWN=1 npm run test:package` on a supported
86
+ GPU machine before publishing. The packed test checks a fresh consumer, browser
87
+ embeds, native GPU output and the optional-renderer-absent path.
88
+
89
+ The public package is `@field/cascade` (`npm publish --access public`). Check
90
+ `npm whoami` and `npm view @field/cascade dist-tags` first; verify the published
91
+ version and a fresh installation afterward. Git push, npm publication and the
92
+ website deployment are separate operations, not an automatic release pipeline.
93
+
94
+ The documentation website is the static **`site/` directory**, not Studio's
95
+ `dist/`. Its existing Vercel project is `field-io/cascade`:
96
+
97
+ ```sh
98
+ vercel link --cwd site --project cascade --scope field-io --yes
99
+ vercel deploy --cwd site --scope field-io --prod --yes
100
+ ```
101
+
102
+ Confirm the linked project before deployment and check `https://cascade.field.io`
103
+ afterward. Do not deploy the repository root or expose a Studio server as the
104
+ public site. `.vercel` is local deployment metadata and stays ignored.
package/DESIGN.md CHANGED
@@ -3,9 +3,9 @@
3
3
  ## Source of truth
4
4
 
5
5
  - Status: Active
6
- - Last refreshed: 2026-09-08 (0.3.1)
7
- - Primary product surfaces: reusable graph runtime, optional Studio workbench, headless Node/browser hosts, Inspector, Viewer, Timeline, agent console, node ports, project-defined workbenches
8
- - Evidence reviewed: `VISION.md`, `ARCHITECTURE.md`, `CHANGELOG.md`, `spec/CASCADE_SUBNET_AND_SHELL_SPEC.md`, `src/types/coreTypes.ts`, `src/editor/Inspector.svelte`, `src/editor/Viewer.svelte`, `src/editor/panels/TimelinePanel.svelte`, `src/editor/panels/AgentPanel.svelte`, `src/editor/components/PortEditor.svelte`, `src/editor/components/typeRenderers.ts`, `src/nodes/definition/gpuCapability.ts`, `packages/runtime/src/runtime.ts`, `packages/runtime/src/params/`, `packages/runtime/src/expressions/`, `packages/runtime/src/animation/`, `server/src/agent/`, `server/src/security.ts`, and `server/src/cliCommands.ts`
6
+ - Last refreshed: 2026-09-09 (0.4.0 checkout; player work is unreleased)
7
+ - Primary product surfaces: reusable graph runtime, optional Studio workbench, headless Node/browser hosts, static browser player, Inspector, 2D/3D Viewer, Timeline, agent console, node ports, project-defined workbenches
8
+ - Evidence reviewed: `VISION.md`, `ARCHITECTURE.md`, `CHANGELOG.md`, `spec/CASCADE_SUBNET_AND_SHELL_SPEC.md`, `src/types/coreTypes.ts`, `src/editor/Inspector.svelte`, `src/editor/Viewer.svelte`, `src/editor/panels/TimelinePanel.svelte`, `src/editor/panels/AgentPanel.svelte`, `src/editor/components/PortEditor.svelte`, `src/editor/components/typeRenderers.ts`, `src/browser/gpu.ts`, `src/player/`, `packages/runtime/src/runtime.ts`, `packages/runtime/src/params/`, `packages/runtime/src/expressions/`, `packages/runtime/src/animation/`, `server/src/agent/`, `server/src/security.ts`, and `server/src/cliCommands.ts`
9
9
 
10
10
  This document contains both current product rules and intended direction. Sections labelled **Current** describe implemented behavior in the repository. Sections labelled **Target** or **Planned** describe design direction and are not a release commitment. Open questions remain undecided until accepted in a specification or implementation plan.
11
11
 
@@ -31,6 +31,7 @@ This document contains both current product rules and intended direction. Sectio
31
31
 
32
32
  - Primary navigation: canvas selection determines Inspector and Viewer context
33
33
  - Core screens: Graph, Inspector, Viewer, Timeline, Definition, Agent console, Logs/diagnostics
34
+ - The standalone player presents the artwork and minimal playback/error controls, not the graph editor. It launches as a static page or embeds in an iframe. Programmatic controls are same-origin; a cross-origin iframe is display/playback only.
34
35
  - Content hierarchy: value preview first, type and shape metadata second, expandable raw structure last
35
36
 
36
37
  ## Design principles
@@ -79,6 +80,7 @@ This document contains both current product rules and intended direction. Sectio
79
80
  - Registration is sealed after the first graph load. A loaded graph supports inspect, input/property/preset mutation, trigger, run, cancel, subscription, output retrieval, and disposal without editor dependencies.
80
81
  - A loaded deterministic graph owns an explicit caller-controlled clock. `setFrame()` and `setFps()` re-resolve animated props for inspection without cooking; `run({ frame, fps })` resolves the same bindings before execution. The runtime never reads ambient time.
81
82
  - One run is active per graph; there is no hidden run queue. API misuse rejects, while graph execution resolves to an explicit success/failure/cancelled result.
83
+ - Browser-player playback coalesces requested frames; it must not queue unbounded work. Failure pauses playback and exposes its diagnostic. Static assets and generated images are realm-owned; immutable image references preserve Feedback history, and explicit resource limits prevent unbounded retention.
82
84
  - A graph may run wholly in a backend, wholly in a compatible browser, or across an explicitly designed bridge. The runtime never silently moves a stage between hosts.
83
85
  - File loading/saving, format versioning, presets, project paths, and workspace conveniences belong to stable platform services around the neutral runtime, not to individual generative algorithms.
84
86
 
@@ -106,8 +108,8 @@ This document contains both current product rules and intended direction. Sectio
106
108
 
107
109
  ## Components
108
110
 
109
- - **Current:** `PortEditor`, `JsonTree`, `ColorPicker`, `CoreValue`, `StructuredValue`, Viewer image zoom/pan behavior, and the type renderer registry.
110
- - **Planned:** a shared type-value presentation shell, structured JSON editing, richer image and asset inspection, geometry summaries/previews, a Viewer output list, and texture inspection after texture values exist.
111
+ - **Current:** `PortEditor`, `JsonTree`, `ColorPicker`, `CoreValue`, `StructuredValue`, Viewer image zoom/pan, geometry summaries/previews, `SceneViewport` with orbit/track/dolly camera controls, and the type renderer registry. Scene rendering currently shows wireframes and points; lights are represented but do not imply shaded rendering.
112
+ - **Planned:** a shared type-value presentation shell, structured JSON editing, richer image/asset inspection, a Viewer output list, and texture inspection after texture values exist.
111
113
  - Variants and states: `compact`, `inspect`, `view`; editable/read-only; empty/loading/error/stale; connected source; truncated/expanded
112
114
  - Token/component ownership: `coreTypes.ts` owns semantic type metadata; the presentation registry owns components; Inspector/Viewer only choose context and mode
113
115
 
@@ -141,6 +143,7 @@ This table defines the intended presentation contract. Individual rows may be on
141
143
  - Supported breakpoints/devices: desktop-first; Inspector remains usable from 240px width; Viewer adapts to Dockview panel size
142
144
  - Layout adaptations: vector/matrix fields wrap or scroll; Viewer metadata collapses beneath previews; structured trees virtualize or truncate large collections
143
145
  - Touch/hover differences: no essential information exists only in hover tooltips
146
+ - Player embeds fit their container; resize changes the view size, not authored graph resolution. Start paused unless autoplay is requested. Controls need native keyboard semantics and errors remain readable over the artwork.
144
147
 
145
148
  ## Interaction states
146
149
 
@@ -167,6 +170,6 @@ This table defines the intended presentation contract. Individual rows may be on
167
170
 
168
171
  ## Open questions
169
172
 
170
- - [ ] Whether mesh Viewer should gain an interactive WebGL orbit view after the lightweight projected preview proves useful / product / medium impact
173
+ - [ ] Whether scene rendering needs shaded GPU surfaces beyond the current CPU wireframe/point view / product / medium impact
171
174
  - [ ] Whether project packages can eventually ship Svelte renderers directly rather than app-side registration / architecture / high impact
172
175
  - [ ] Whether large structured values need virtualization beyond bounded initial expansion / performance / medium impact
package/README.md CHANGED
@@ -2,25 +2,55 @@
2
2
 
3
3
  Cascade is a TypeScript node-graph runtime and optional visual workspace for generative design. It is built for projects that move between interactive web work, WebGL, print, motion, sound, Python, and external services without rebuilding the surrounding application infrastructure each time.
4
4
 
5
- Created by Marcus Wendt at [FIELD.IO](https://www.field.io).
5
+ Created by Marcus Wendt at [FIELD.IO](https://www.field.io). Free and open source
6
+ under the MIT license. [Getting started and features](https://cascade.field.io).
6
7
 
7
8
  ## What Cascade provides
8
9
 
9
10
  - A typed, inspectable graph model with lazy execution and explicit triggers.
10
11
  - Deterministic custom-node definitions that tools can inspect without running user code.
11
12
  - An environment-neutral runtime for Node services and UI-free browser applications.
13
+ - A standalone browser player: build static pages and embeddable sketches without a Studio server.
12
14
  - A Studio compatibility controller that already presents deterministic definitions alongside dynamic project nodes while its graph engine migrates to the neutral runtime.
13
15
  - Project-native `.cascade` files, assets, presets, and Git-backed version history.
14
16
  - Nested subnets with persistent hierarchy.
17
+ - Geometry-native particles, explicit Feedback loops, bounded simulation checkpoints, and printable trail geometry.
18
+ - Scenes with cameras and lights, a 3D Viewer, and shared CPU wireframe/point rendering.
15
19
  - Expressions on parameters, with Houdini's variables and functions: `$F`, `$FF`, `$T`, `$FPS`, and `ch()` to read another parameter.
16
20
  - Keyframe channels on parameters, edited through a timeline panel with transport, playhead, scrubbing, and a dope sheet.
17
- - Offline rendering with `cascade run`, including `--frames 1-100` for a numbered image sequence, rasterised through Skia rather than a browser.
21
+ - Offline rendering with `cascade run`: Skia for Canvas2D, optional Dawn for compatible WebGPU nodes, and `--frames 1-100` for numbered image sequences.
18
22
  - A coding-agent console per project, running in the project directory, with a watcher that picks up the files it rewrites without a reload.
19
23
  - Explicit browser and server capabilities for WebGPU, files, media, Python, and allowlisted shell commands.
20
24
  - A Svelte Studio with an infinite canvas, Inspector, Viewer, timeline, and project workbench.
21
25
 
22
26
  Cascade separates the generative algorithm from the platform. Custom nodes describe stages of a pipeline; the runtime schedules and validates them; hosts supply environment-specific capabilities; Studio is only one possible frontend.
23
27
 
28
+ ## New in 0.5
29
+
30
+ Build a visual system once, then use its supported host for print, stills,
31
+ motion frames or an interactive web embed. This release adds the standalone
32
+ player and hardens the geometry, simulation and scene tools added during 0.4:
33
+
34
+ - **Web delivery:** `cascade build` packages a compatible graph and its explicit
35
+ assets. Embeds have independent runtimes, playback, parameter/input controls,
36
+ image downloads and disposal; no editor or Cascade API is required.
37
+ - **Geometry and subnets:** compose shapes, transforms and copies through one
38
+ geometry type; organize reusable networks with typed Input/Output boundaries.
39
+ - **Particles and feedback:** wire sources, forces and a solver, retain bounded
40
+ history, and turn particle trails into geometry for SVG or raster output.
41
+ Checkpoint reuse now preserves complete trails; nested Feedback respects loop
42
+ ownership and dependency order.
43
+ - **Scenes and cameras:** assemble geometry, a camera and lights, inspect in the
44
+ 3D Viewer, and use shared camera math for output. Rendering currently draws
45
+ wireframes and points; lights do not yet shade surfaces.
46
+ - **Agent-ready rendering:** static node checks, finite render timeouts and JSON
47
+ image manifests let an agent edit, render and inspect results. Dawn is optional
48
+ native WebGPU for the Node host, not a browser emulator or model integration.
49
+
50
+ Studio now uses only its active Dockview layout; the unreachable old window UI
51
+ has been removed. No new dependencies or graph engine were introduced for the
52
+ player. See the [changelog](CHANGELOG.md) for release details.
53
+
24
54
  ## Install
25
55
 
26
56
  Cascade needs Node.js 22.13 or newer.
@@ -125,6 +155,33 @@ cascade run index.cascade
125
155
 
126
156
  See [Project authoring](doc/PROJECT_AUTHORING.md) for project layout, nodes, `.cascade` files, capabilities, and headless embedding.
127
157
 
158
+ ## Publish a browser sketch
159
+
160
+ The standalone player in Cascade 0.5+ exports compatible definition-v1 graphs to
161
+ static files, without Studio or a Cascade server:
162
+
163
+ ```bash
164
+ cascade build index.cascade --out web-player
165
+ ```
166
+
167
+ Serve the generated directory through a static HTTP server or hosting service.
168
+ Open `index.html`, embed `player.html` in an iframe, or import `embed.js` for
169
+ same-origin controls. Server/Python/shell-dependent graphs must first separate
170
+ or replace those stages; export does not move them into the browser silently.
171
+ See [Browser player](doc/WEB_PLAYER.md) for assets, inputs, animation and limits.
172
+
173
+ For example, after hosting the output at `/artwork/`:
174
+
175
+ ```html
176
+ <iframe src="/artwork/player.html" title="Generative artwork"
177
+ style="width:100%;height:600px;border:0"></iframe>
178
+ ```
179
+
180
+ Ordinary iframe embeds can cross origins. JavaScript controls through the
181
+ generated `embed.js` require the same origin. WebGPU requires a compatible
182
+ browser/device and HTTPS or localhost. Use `--asset assets/photo.png` for a
183
+ file whose path is computed in code; export never copies the whole project.
184
+
128
185
  Projects may also provide trusted, dockable Studio panels as plain TypeScript modules under `panels/`. These extensions remain outside graph documents and are never loaded by headless execution.
129
186
 
130
187
  ## Animation
@@ -172,6 +229,20 @@ Frames are written as `<out>/<node id>.<frame>.<ext>`, zero-padded to at least f
172
229
 
173
230
  Drawing offline goes through Skia rather than a browser. The optional `@napi-rs/canvas` supplies `OffscreenCanvas`, `Image`, `Path2D` and the rest as globals in the Node process, deliberately not `document`, since that is how a node detects its host. So a node that draws on an `OffscreenCanvas` needs no separate headless implementation, and the built-in `cascade.image.*` library rasterises through Skia in Node too, so a graph built from it renders headlessly with no browser involved. A run without the renderer installed still works for graphs that draw nothing, and says what is missing if a cook fails in a canvas-shaped way.
174
231
 
232
+ Compatible definition-v1 GPU nodes use optional Dawn instead. For a bounded
233
+ still render that a test or agent can consume:
234
+
235
+ ```bash
236
+ cascade check index.cascade
237
+ cascade run index.cascade --frames 1 --json --timeout 60000
238
+ ```
239
+
240
+ Check the exit code before parsing the success manifest on stdout, then inspect
241
+ the images listed in `files`; diagnostics go to stderr. Dawn does not make DOM,
242
+ WebGL or browser-only nodes portable, and pixel equality across GPU drivers is
243
+ not guaranteed. See [Headless WebGPU](doc/HEADLESS_GPU.md) for host requirements,
244
+ readback and testing guidance. Cascade does not upload these images to a model.
245
+
175
246
  `--frames` works for an all-dynamic graph and for an all-definition-v1 graph. Definition-v1 runs resolve stored expressions and keyframe channels from the explicit `frame` and `fps` supplied to each deterministic run. A CLI graph that mixes the two node styles is rejected explicitly because there is not yet a bounded adapter between the execution engines.
176
247
 
177
248
  ## The agent console
@@ -295,8 +366,9 @@ a second set of node algorithms.
295
366
  | Studio authoring | Supports dynamic and definition-v1 nodes in one document through the compatibility controller. |
296
367
  | Headless CLI | Executes all-definition-v1 or all-dynamic documents; mixed documents are rejected. Both styles can render frame sequences. |
297
368
  | Embedded runtime | `cascade/runtime` is the neutral definition-v1 API for Node and browser hosts. It does not load Studio or interpret dynamic nodes. |
369
+ | Static browser player | `cascade build` exports definition-v1 browser/portable graphs with assets and optional browser WebGPU. No server operations, dynamic modules or project Studio panels. Same-origin JavaScript controls; ordinary cross-origin iframe embeds. |
298
370
  | GPU | Studio and the optional Dawn CLI host provide a shared device, adapter metadata, limits, and per-node caches. Portable GPU nodes render offscreen and explicitly read RGBA8 pixels through `cascade/gpu`; graph ports still carry images. See [headless GPU rendering](doc/HEADLESS_GPU.md). |
299
- | Standalone HTML export | The existing Studio exporter uses a separate minimal runtime and supports only a subset of graph behavior. Treat it as an experimental convenience, not as a universal deployment artifact. |
371
+ | Studio HTML export | The older Studio exporter uses a separate minimal runtime and supports only a subset of graph behavior. Use `cascade build` for supported definition-v1 web deployment. |
300
372
  | External services | Project-owned and optional. Cascade itself requires no paid provider or model subscription. |
301
373
 
302
374
  ## Repository map
@@ -307,12 +379,14 @@ packages/runtime/ environment-neutral graph runtime and adapters
307
379
  src/editor/ optional Svelte Studio, including the timeline and agent panels
308
380
  src/nodes/ current class-based built-in node libraries (core, geo, image)
309
381
  src/engine/ current compatibility services
310
- src/cli/ the `cascade` command: new, validate, check, inspect, run, Studio
382
+ src/cli/ the `cascade` command: new, validate, check, inspect, run, build, Studio
383
+ src/player/ standalone browser host and iframe controls
311
384
  server/ project-scoped Node host and transports, including the agent session host
312
385
  scripts/ package build, node-reference generation, and release verification tooling
313
386
  tests/ behavior, workflow, security, and performance tests
314
387
  spec/ accepted feature specifications
315
388
  doc/ authoring guides and implementation plans
389
+ site/ static documentation at cascade.field.io
316
390
  ```
317
391
 
318
392
  The root `cascade` package is the distribution and CLI owner. The two internal workspaces define architectural boundaries; they are not independently published until independent versioning or external consumption requires it.
@@ -351,6 +425,8 @@ trusted-host session; an untrusted remote bind does not expose them.
351
425
  - [Node reference](doc/NODE_REFERENCE.md) — every built-in node and its declared ports, generated from the definitions
352
426
  - [Design source of truth](DESIGN.md)
353
427
  - [Architecture](ARCHITECTURE.md)
428
+ - [Browser player](doc/WEB_PLAYER.md)
429
+ - [September quality review and sketch verification](doc/QUALITY_REVIEW_2026-09.md)
354
430
  - [Subnet and shell specification](spec/CASCADE_SUBNET_AND_SHELL_SPEC.md)
355
431
 
356
432
  Inspired by Nodes.io, SideFX Houdini, TouchDesigner, Maya, Cinder, openFrameworks, and Processing.