@field/cascade 0.2.22

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 (319) hide show
  1. package/AGENTS.md +168 -0
  2. package/ARCHITECTURE.md +137 -0
  3. package/DESIGN.md +161 -0
  4. package/LICENSE +21 -0
  5. package/README.md +229 -0
  6. package/dist/assets/CodeEditor-DR7u0q7p.css +1 -0
  7. package/dist/assets/CodeEditor-DoaNEUaM.js +641 -0
  8. package/dist/assets/CodePanel-B0_2XJ-t.js +2 -0
  9. package/dist/assets/CodePanel-IT1secyI.css +1 -0
  10. package/dist/assets/CustomNodeDialog-026lzecD.js +1 -0
  11. package/dist/assets/CustomNodeDialog-JGYnWY6m.css +1 -0
  12. package/dist/assets/ExportDialog-DOq0flMV.css +1 -0
  13. package/dist/assets/ExportDialog-DWN4nhXI.js +358 -0
  14. package/dist/assets/ProjectSettings-BzT164Yx.js +2 -0
  15. package/dist/assets/ProjectSettings-DdO9xoQz.css +1 -0
  16. package/dist/assets/SettingsDialog-CeK7ytpY.css +1 -0
  17. package/dist/assets/SettingsDialog-DmHb1V0r.js +1 -0
  18. package/dist/assets/VersionHistoryDialog-CWNmHQ-P.css +1 -0
  19. package/dist/assets/VersionHistoryDialog-hH6VsXLX.js +3 -0
  20. package/dist/assets/abap-08VXUWAP.js +1 -0
  21. package/dist/assets/apex-BWPQTe0t.js +1 -0
  22. package/dist/assets/azcli-Bc_sGQ0U.js +1 -0
  23. package/dist/assets/bat-i0X4ZdIN.js +1 -0
  24. package/dist/assets/bicep-B5-_aFwp.js +2 -0
  25. package/dist/assets/cameligo-DMUM7wLl.js +1 -0
  26. package/dist/assets/cascade.jpg +0 -0
  27. package/dist/assets/clojure-Cm7r79vr.js +1 -0
  28. package/dist/assets/codicon-Brq4_Ui5.ttf +0 -0
  29. package/dist/assets/coffee-Ba7i2nA0.js +1 -0
  30. package/dist/assets/core-Bji4aZUU.js +965 -0
  31. package/dist/assets/cpp-C7h46wYY.js +1 -0
  32. package/dist/assets/csharp-BKxtCVv1.js +1 -0
  33. package/dist/assets/csp-bTuwJoIa.js +1 -0
  34. package/dist/assets/css-DIMkf-bt.js +3 -0
  35. package/dist/assets/css.worker-B3ciXF_0.js +93 -0
  36. package/dist/assets/cssMode-B6Z_Q1Kh.js +1 -0
  37. package/dist/assets/cypher-CVaqCwHa.js +1 -0
  38. package/dist/assets/dart-onAF5SnQ.js +1 -0
  39. package/dist/assets/dockerfile-DZFCIeNp.js +1 -0
  40. package/dist/assets/ecl-D05T4iGw.js +1 -0
  41. package/dist/assets/editor-1FQrmyyI.css +1 -0
  42. package/dist/assets/editor.api-jMoW_43X.js +847 -0
  43. package/dist/assets/editor.worker-q-txB4vs.js +30 -0
  44. package/dist/assets/elixir-6RTg0lbw.js +1 -0
  45. package/dist/assets/flow9-C5_-GSwl.js +1 -0
  46. package/dist/assets/freemarker2-DvvPV6m5.js +3 -0
  47. package/dist/assets/fsharp-C8Ef5oNN.js +1 -0
  48. package/dist/assets/geo-CXmCtzMM.js +2 -0
  49. package/dist/assets/go-C-y9NEjX.js +1 -0
  50. package/dist/assets/graphql-fmXr3nnJ.js +1 -0
  51. package/dist/assets/handlebars-B8rfuSIa.js +1 -0
  52. package/dist/assets/hcl-CpzslTdj.js +1 -0
  53. package/dist/assets/html-DyHm6JCp.js +1 -0
  54. package/dist/assets/html.worker-C93Ht9o9.js +506 -0
  55. package/dist/assets/htmlMode-E9XLWE5u.js +1 -0
  56. package/dist/assets/image-BUcQC7PG.js +2076 -0
  57. package/dist/assets/index-BXYXSdgh.js +224 -0
  58. package/dist/assets/index-CrNke7SW.css +1 -0
  59. package/dist/assets/index-client-DN_FvjN8.js +1 -0
  60. package/dist/assets/ini-sBoK_t0W.js +1 -0
  61. package/dist/assets/java-BEtHBSE6.js +1 -0
  62. package/dist/assets/javascript-C_bM5PCN.js +1 -0
  63. package/dist/assets/json.worker-B2V3pomh.js +62 -0
  64. package/dist/assets/jsonMode-BdyVS7G4.js +7 -0
  65. package/dist/assets/julia-Bri6UV-V.js +1 -0
  66. package/dist/assets/kotlin-BOotOW0E.js +1 -0
  67. package/dist/assets/legacy-DIu3XRwl.js +2 -0
  68. package/dist/assets/less-B9JPFI3C.js +2 -0
  69. package/dist/assets/lexon-CfSJPG6W.js +1 -0
  70. package/dist/assets/liquid-CDkn3spA.js +1 -0
  71. package/dist/assets/lspLanguageFeatures-AB5DMAsr.js +4 -0
  72. package/dist/assets/lua-CsQS60Ue.js +1 -0
  73. package/dist/assets/m3-D-oSqn_W.js +1 -0
  74. package/dist/assets/markdown-Cimd5fb3.js +1 -0
  75. package/dist/assets/mdx-BvH_NjDN.js +1 -0
  76. package/dist/assets/mips-CIPQ_RoX.js +1 -0
  77. package/dist/assets/msdax-DauUninz.js +1 -0
  78. package/dist/assets/mysql-SOo6toE5.js +1 -0
  79. package/dist/assets/nodeTypeUtils-CweA3NHd.js +1 -0
  80. package/dist/assets/objective-c-FvmIjYaQ.js +1 -0
  81. package/dist/assets/pascal-DrH0SRf2.js +1 -0
  82. package/dist/assets/pascaligo-D-ptJ9y-.js +1 -0
  83. package/dist/assets/perl-oz_6vUea.js +1 -0
  84. package/dist/assets/pgsql-DTj74zXo.js +1 -0
  85. package/dist/assets/php-nr791fC2.js +1 -0
  86. package/dist/assets/pla-CopQ2nXW.js +1 -0
  87. package/dist/assets/postiats-43DmfD33.js +1 -0
  88. package/dist/assets/powerquery-D3hlyOfw.js +1 -0
  89. package/dist/assets/powershell-DmHpPYUd.js +1 -0
  90. package/dist/assets/projectSettingsApi-C1WvIwfP.js +1 -0
  91. package/dist/assets/protobuf-C531GsRP.js +2 -0
  92. package/dist/assets/pug-Z5eAx3Zn.js +1 -0
  93. package/dist/assets/python-B7uii4fi.js +1 -0
  94. package/dist/assets/qsharp-DkqhCAOL.js +1 -0
  95. package/dist/assets/quill-DjZ69wL_.js +121 -0
  96. package/dist/assets/r-BwWrilGY.js +1 -0
  97. package/dist/assets/razor-Z48fWdJc.js +1 -0
  98. package/dist/assets/redis-ClamHrr6.js +1 -0
  99. package/dist/assets/redshift-DT7zqm-g.js +1 -0
  100. package/dist/assets/restructuredtext-BYgofb2h.js +1 -0
  101. package/dist/assets/ruby-DezsRK8O.js +1 -0
  102. package/dist/assets/rust-DdL9SqIa.js +1 -0
  103. package/dist/assets/sb-CcwsVR0C.js +1 -0
  104. package/dist/assets/scala-DHpiXF5c.js +1 -0
  105. package/dist/assets/scheme-BeGwcela.js +1 -0
  106. package/dist/assets/scss-gp-XZpBa.js +3 -0
  107. package/dist/assets/shell-CC2rA5mh.js +1 -0
  108. package/dist/assets/solidity-BEEn4gHE.js +1 -0
  109. package/dist/assets/sophia-CRfGWb83.js +1 -0
  110. package/dist/assets/sparql-D_Lu-MrJ.js +1 -0
  111. package/dist/assets/sql-NEE52Syq.js +1 -0
  112. package/dist/assets/st-DbInun42.js +1 -0
  113. package/dist/assets/swift-Bxkupp3x.js +1 -0
  114. package/dist/assets/systemverilog-Bz4Y3fRF.js +1 -0
  115. package/dist/assets/tcl-DISqw1ZD.js +1 -0
  116. package/dist/assets/ts.worker-D7T1-Ig5.js +67738 -0
  117. package/dist/assets/tsMode-BDgacVG4.js +11 -0
  118. package/dist/assets/twig-De2hgUGE.js +1 -0
  119. package/dist/assets/typescript-Derb6Oqa.js +1 -0
  120. package/dist/assets/typespec-B8J7ngcE.js +1 -0
  121. package/dist/assets/vb-DV3o63ZY.js +1 -0
  122. package/dist/assets/wgsl-DpFanUEy.js +298 -0
  123. package/dist/assets/workers-BtoMX_pm.js +1 -0
  124. package/dist/assets/xml-B1CaFSrG.js +1 -0
  125. package/dist/assets/yaml-HmIeA0KH.js +1 -0
  126. package/dist/cli/index.js +11377 -0
  127. package/dist/cli/index.js.map +7 -0
  128. package/dist/cli/runtime/io.ts +445 -0
  129. package/dist/cli/runtime/net.ts +19 -0
  130. package/dist/cli/runtime/shell.ts +46 -0
  131. package/dist/cli/runtime/stage.ts +132 -0
  132. package/dist/contracts/capabilities.d.ts +109 -0
  133. package/dist/contracts/capabilities.d.ts.map +1 -0
  134. package/dist/contracts/capabilities.js +11 -0
  135. package/dist/contracts/capabilities.js.map +1 -0
  136. package/dist/contracts/color.d.ts +67 -0
  137. package/dist/contracts/color.d.ts.map +1 -0
  138. package/dist/contracts/color.js +83 -0
  139. package/dist/contracts/color.js.map +1 -0
  140. package/dist/contracts/definition.d.ts +118 -0
  141. package/dist/contracts/definition.d.ts.map +1 -0
  142. package/dist/contracts/definition.js +2 -0
  143. package/dist/contracts/definition.js.map +1 -0
  144. package/dist/contracts/document.d.ts +50 -0
  145. package/dist/contracts/document.d.ts.map +1 -0
  146. package/dist/contracts/document.js +2 -0
  147. package/dist/contracts/document.js.map +1 -0
  148. package/dist/contracts/geometry.d.ts +301 -0
  149. package/dist/contracts/geometry.d.ts.map +1 -0
  150. package/dist/contracts/geometry.js +604 -0
  151. package/dist/contracts/geometry.js.map +1 -0
  152. package/dist/contracts/index.d.ts +8 -0
  153. package/dist/contracts/index.d.ts.map +1 -0
  154. package/dist/contracts/index.js +8 -0
  155. package/dist/contracts/index.js.map +1 -0
  156. package/dist/contracts/schema.d.ts +6 -0
  157. package/dist/contracts/schema.d.ts.map +1 -0
  158. package/dist/contracts/schema.js +85 -0
  159. package/dist/contracts/schema.js.map +1 -0
  160. package/dist/contracts/validate.d.ts +13 -0
  161. package/dist/contracts/validate.d.ts.map +1 -0
  162. package/dist/contracts/validate.js +202 -0
  163. package/dist/contracts/validate.js.map +1 -0
  164. package/dist/contracts/values.d.ts +100 -0
  165. package/dist/contracts/values.d.ts.map +1 -0
  166. package/dist/contracts/values.js +59 -0
  167. package/dist/contracts/values.js.map +1 -0
  168. package/dist/graphs/default-orig.cascade +128 -0
  169. package/dist/graphs/default.cascade +21 -0
  170. package/dist/index.html +19 -0
  171. package/dist/runtime/browser.d.ts +3 -0
  172. package/dist/runtime/browser.d.ts.map +1 -0
  173. package/dist/runtime/browser.js +12 -0
  174. package/dist/runtime/browser.js.map +1 -0
  175. package/dist/runtime/builtins/core/index.d.ts +9 -0
  176. package/dist/runtime/builtins/core/index.d.ts.map +1 -0
  177. package/dist/runtime/builtins/core/index.js +21 -0
  178. package/dist/runtime/builtins/core/index.js.map +1 -0
  179. package/dist/runtime/builtins/core/random.d.ts +66 -0
  180. package/dist/runtime/builtins/core/random.d.ts.map +1 -0
  181. package/dist/runtime/builtins/core/random.js +46 -0
  182. package/dist/runtime/builtins/core/random.js.map +1 -0
  183. package/dist/runtime/builtins/core/remap.d.ts +105 -0
  184. package/dist/runtime/builtins/core/remap.d.ts.map +1 -0
  185. package/dist/runtime/builtins/core/remap.js +43 -0
  186. package/dist/runtime/builtins/core/remap.js.map +1 -0
  187. package/dist/runtime/builtins/core/routing.d.ts +117 -0
  188. package/dist/runtime/builtins/core/routing.d.ts.map +1 -0
  189. package/dist/runtime/builtins/core/routing.js +114 -0
  190. package/dist/runtime/builtins/core/routing.js.map +1 -0
  191. package/dist/runtime/builtins/core/structural.d.ts +86 -0
  192. package/dist/runtime/builtins/core/structural.d.ts.map +1 -0
  193. package/dist/runtime/builtins/core/structural.js +63 -0
  194. package/dist/runtime/builtins/core/structural.js.map +1 -0
  195. package/dist/runtime/builtins/geo/copyToPoints.d.ts +58 -0
  196. package/dist/runtime/builtins/geo/copyToPoints.d.ts.map +1 -0
  197. package/dist/runtime/builtins/geo/copyToPoints.js +35 -0
  198. package/dist/runtime/builtins/geo/copyToPoints.js.map +1 -0
  199. package/dist/runtime/builtins/geo/definitions.d.ts +526 -0
  200. package/dist/runtime/builtins/geo/definitions.d.ts.map +1 -0
  201. package/dist/runtime/builtins/geo/definitions.js +182 -0
  202. package/dist/runtime/builtins/geo/definitions.js.map +1 -0
  203. package/dist/runtime/builtins/geo/generators.d.ts +94 -0
  204. package/dist/runtime/builtins/geo/generators.d.ts.map +1 -0
  205. package/dist/runtime/builtins/geo/generators.js +41 -0
  206. package/dist/runtime/builtins/geo/generators.js.map +1 -0
  207. package/dist/runtime/builtins/geo/index.d.ts +23 -0
  208. package/dist/runtime/builtins/geo/index.d.ts.map +1 -0
  209. package/dist/runtime/builtins/geo/index.js +35 -0
  210. package/dist/runtime/builtins/geo/index.js.map +1 -0
  211. package/dist/runtime/builtins/geo/merge.d.ts +40 -0
  212. package/dist/runtime/builtins/geo/merge.d.ts.map +1 -0
  213. package/dist/runtime/builtins/geo/merge.js +24 -0
  214. package/dist/runtime/builtins/geo/merge.js.map +1 -0
  215. package/dist/runtime/builtins/geo/namespace.d.ts +15 -0
  216. package/dist/runtime/builtins/geo/namespace.d.ts.map +1 -0
  217. package/dist/runtime/builtins/geo/namespace.js +17 -0
  218. package/dist/runtime/builtins/geo/namespace.js.map +1 -0
  219. package/dist/runtime/builtins/geo/svgExport.d.ts +130 -0
  220. package/dist/runtime/builtins/geo/svgExport.d.ts.map +1 -0
  221. package/dist/runtime/builtins/geo/svgExport.js +50 -0
  222. package/dist/runtime/builtins/geo/svgExport.js.map +1 -0
  223. package/dist/runtime/builtins/geo/transform.d.ts +60 -0
  224. package/dist/runtime/builtins/geo/transform.d.ts.map +1 -0
  225. package/dist/runtime/builtins/geo/transform.js +32 -0
  226. package/dist/runtime/builtins/geo/transform.js.map +1 -0
  227. package/dist/runtime/builtins/index.d.ts +9 -0
  228. package/dist/runtime/builtins/index.d.ts.map +1 -0
  229. package/dist/runtime/builtins/index.js +16 -0
  230. package/dist/runtime/builtins/index.js.map +1 -0
  231. package/dist/runtime/definition/architecture.d.ts +8 -0
  232. package/dist/runtime/definition/architecture.d.ts.map +1 -0
  233. package/dist/runtime/definition/architecture.js +112 -0
  234. package/dist/runtime/definition/architecture.js.map +1 -0
  235. package/dist/runtime/definition/extract.d.ts +12 -0
  236. package/dist/runtime/definition/extract.d.ts.map +1 -0
  237. package/dist/runtime/definition/extract.js +151 -0
  238. package/dist/runtime/definition/extract.js.map +1 -0
  239. package/dist/runtime/error.d.ts +8 -0
  240. package/dist/runtime/error.d.ts.map +1 -0
  241. package/dist/runtime/error.js +11 -0
  242. package/dist/runtime/error.js.map +1 -0
  243. package/dist/runtime/geometry/attributes.d.ts +65 -0
  244. package/dist/runtime/geometry/attributes.d.ts.map +1 -0
  245. package/dist/runtime/geometry/attributes.js +201 -0
  246. package/dist/runtime/geometry/attributes.js.map +1 -0
  247. package/dist/runtime/geometry/builder.d.ts +57 -0
  248. package/dist/runtime/geometry/builder.d.ts.map +1 -0
  249. package/dist/runtime/geometry/builder.js +153 -0
  250. package/dist/runtime/geometry/builder.js.map +1 -0
  251. package/dist/runtime/geometry/copy.d.ts +36 -0
  252. package/dist/runtime/geometry/copy.d.ts.map +1 -0
  253. package/dist/runtime/geometry/copy.js +68 -0
  254. package/dist/runtime/geometry/copy.js.map +1 -0
  255. package/dist/runtime/geometry/generate.d.ts +43 -0
  256. package/dist/runtime/geometry/generate.d.ts.map +1 -0
  257. package/dist/runtime/geometry/generate.js +76 -0
  258. package/dist/runtime/geometry/generate.js.map +1 -0
  259. package/dist/runtime/geometry/groups.d.ts +18 -0
  260. package/dist/runtime/geometry/groups.d.ts.map +1 -0
  261. package/dist/runtime/geometry/groups.js +69 -0
  262. package/dist/runtime/geometry/groups.js.map +1 -0
  263. package/dist/runtime/geometry/index.d.ts +23 -0
  264. package/dist/runtime/geometry/index.d.ts.map +1 -0
  265. package/dist/runtime/geometry/index.js +23 -0
  266. package/dist/runtime/geometry/index.js.map +1 -0
  267. package/dist/runtime/geometry/matrix.d.ts +26 -0
  268. package/dist/runtime/geometry/matrix.d.ts.map +1 -0
  269. package/dist/runtime/geometry/matrix.js +27 -0
  270. package/dist/runtime/geometry/matrix.js.map +1 -0
  271. package/dist/runtime/geometry/merge.d.ts +33 -0
  272. package/dist/runtime/geometry/merge.d.ts.map +1 -0
  273. package/dist/runtime/geometry/merge.js +185 -0
  274. package/dist/runtime/geometry/merge.js.map +1 -0
  275. package/dist/runtime/geometry/primitives.d.ts +41 -0
  276. package/dist/runtime/geometry/primitives.d.ts.map +1 -0
  277. package/dist/runtime/geometry/primitives.js +131 -0
  278. package/dist/runtime/geometry/primitives.js.map +1 -0
  279. package/dist/runtime/geometry/promote.d.ts +44 -0
  280. package/dist/runtime/geometry/promote.d.ts.map +1 -0
  281. package/dist/runtime/geometry/promote.js +203 -0
  282. package/dist/runtime/geometry/promote.js.map +1 -0
  283. package/dist/runtime/geometry/resample.d.ts +29 -0
  284. package/dist/runtime/geometry/resample.d.ts.map +1 -0
  285. package/dist/runtime/geometry/resample.js +165 -0
  286. package/dist/runtime/geometry/resample.js.map +1 -0
  287. package/dist/runtime/geometry/svg.d.ts +91 -0
  288. package/dist/runtime/geometry/svg.d.ts.map +1 -0
  289. package/dist/runtime/geometry/svg.js +216 -0
  290. package/dist/runtime/geometry/svg.js.map +1 -0
  291. package/dist/runtime/geometry/transform.d.ts +18 -0
  292. package/dist/runtime/geometry/transform.d.ts.map +1 -0
  293. package/dist/runtime/geometry/transform.js +56 -0
  294. package/dist/runtime/geometry/transform.js.map +1 -0
  295. package/dist/runtime/index.d.ts +5 -0
  296. package/dist/runtime/index.d.ts.map +1 -0
  297. package/dist/runtime/index.js +4 -0
  298. package/dist/runtime/index.js.map +1 -0
  299. package/dist/runtime/node.d.ts +4 -0
  300. package/dist/runtime/node.d.ts.map +1 -0
  301. package/dist/runtime/node.js +12 -0
  302. package/dist/runtime/node.js.map +1 -0
  303. package/dist/runtime/runtime.d.ts +3 -0
  304. package/dist/runtime/runtime.d.ts.map +1 -0
  305. package/dist/runtime/runtime.js +1198 -0
  306. package/dist/runtime/runtime.js.map +1 -0
  307. package/dist/runtime/types.d.ts +241 -0
  308. package/dist/runtime/types.d.ts.map +1 -0
  309. package/dist/runtime/types.js +2 -0
  310. package/dist/runtime/types.js.map +1 -0
  311. package/dist/shell.d.ts +8 -0
  312. package/dist/shell.js +54 -0
  313. package/dist/shell.js.map +7 -0
  314. package/dist/stage.d.ts +7 -0
  315. package/dist/stage.js +84 -0
  316. package/dist/stage.js.map +7 -0
  317. package/dist/studio/panel.d.ts +48 -0
  318. package/doc/PROJECT_AUTHORING.md +360 -0
  319. package/package.json +126 -0
package/AGENTS.md ADDED
@@ -0,0 +1,168 @@
1
+ # Cascade agent guide
2
+
3
+ Cascade is a reusable generative-design graph runtime with an optional Studio UI. Keep authored algorithms independent from the editor so the same graph can run in Studio, on a server, or in a UI-free browser host.
4
+
5
+ ## Start here
6
+
7
+ - `DESIGN.md` — product and architecture source of truth.
8
+ - `ARCHITECTURE.md` — repository boundaries and dependency direction.
9
+ - `packages/contracts/` — public types, deterministic node definitions, capabilities, and schemas.
10
+ - `packages/runtime/` — environment-neutral loading, validation, scheduling, and headless APIs.
11
+ - `src/editor/` — Svelte Studio only; never put runtime behavior here.
12
+ - `server/` — project-scoped Node host, compilation, assets, Python, and shell transport.
13
+ - `spec/` — accepted behavior specifications. Read the relevant spec before changing a file format or public API.
14
+ - `tests/` — executable behavior contracts, including performance and end-to-end authoring workflows.
15
+
16
+ ## Project convention
17
+
18
+ A Cascade project is an ordinary directory or Git repository:
19
+
20
+ ```text
21
+ my-project/
22
+ ├── cascade.json # optional host policy and project settings
23
+ ├── index.cascade # default graph; more .cascade files are allowed
24
+ ├── nodes/
25
+ │ └── Multiply/
26
+ │ └── index.ts # project.Multiply
27
+ ├── assets/
28
+ ├── panels/
29
+ │ └── AssetBrowser/
30
+ │ └── index.ts # optional Studio-only project panel
31
+ ├── package.json
32
+ └── tsconfig.json
33
+ ```
34
+
35
+ Use `cascade new <name>` to create a project. Run `cascade .` from its 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, and `cascade run <graph.cascade>` for headless execution.
36
+
37
+ ## Launch Studio
38
+
39
+ For a browser on the same machine, use the secure loopback default:
40
+
41
+ ```bash
42
+ cascade . --port 3030
43
+ ```
44
+
45
+ For a workstation reached by hostname over a trusted VPN or LAN, bind the
46
+ network interfaces and allow the exact hostname in the browser URL:
47
+
48
+ ```bash
49
+ cascade . --host KURO --port 3030
50
+ ```
51
+
52
+ Open `http://KURO:3030`. Before launching,
53
+ check that the intended port is free or belongs to the expected Cascade process;
54
+ never start a second instance on an occupied/default port or kill an unknown
55
+ process. Verify the named route after startup:
56
+
57
+ ```bash
58
+ curl -fsS http://KURO:3030/health
59
+ curl -fsS http://KURO:3030/api/graph
60
+ ```
61
+
62
+ Remote access is explicit: a specific non-loopback `--host` is also the default
63
+ trusted browser hostname. Use `--trusted-host` only when the bind address and
64
+ browser hostname differ. Hostnames are exact and case-insensitive; wildcard
65
+ binds are rejected. Unknown flags and invalid ports are fatal. Every peer that
66
+ can reach this interface can access trusted project APIs, so use an authenticated
67
+ private VPN/interface and never expose Studio directly to the public internet.
68
+
69
+ Project panels are trusted Studio extensions, not graph/runtime modules. Put them in `panels/<name>/index.ts`, type them from `cascade/studio/panel`, and return an instance disposer from `mount`. A parameter action such as `panel:asset-browser` opens one. Never import a project panel from a node, runtime host, or headless application.
70
+
71
+ ## Create a deterministic node
72
+
73
+ Prefer a statically inspectable definition over legacy setup-time calls:
74
+
75
+ ```ts
76
+ import type { NodeDefinition, NodeExecutionContext } from 'cascade/contracts';
77
+
78
+ export const definition = {
79
+ apiVersion: 1,
80
+ label: 'Multiply',
81
+ runsOn: 'portable',
82
+ inputs: {
83
+ value: { kind: 'data', type: 'float', default: 0 },
84
+ factor: { kind: 'data', type: 'float', default: 2 }
85
+ },
86
+ outputs: {
87
+ result: { kind: 'data', type: 'float' }
88
+ }
89
+ } as const satisfies NodeDefinition;
90
+
91
+ export function execute(context: NodeExecutionContext<typeof definition>) {
92
+ context.outputs.result.set(context.inputs.value * context.inputs.factor);
93
+ }
94
+ ```
95
+
96
+ Definition rules:
97
+
98
+ - Export `definition` as a literal and `execute` as computation only.
99
+ - Keep the definition JSON-like. Parentheses, arrays, `as const`, and `satisfies` are valid; calls, spreads, computed properties, and imported constants are not.
100
+ - Declare `runsOn`: `portable`, `browser`, or `server`.
101
+ - For equivalent browser/server implementations, keep one portable definition
102
+ and have the host registration select the executor. Never expose execution
103
+ location as an artist parameter; parity-test the shared contract.
104
+ - Declare every capability used. File, Python, and shell access are server-only; WebGL is browser-only.
105
+ - Treat graph wires as the primary data boundary. A node may observe only its connected inputs, its props, and declared host capabilities; it must not inspect sibling nodes or the graph to discover data.
106
+ - Deterministic node modules may not retain module-level mutable values, access ambient state such as `globalThis`, browser storage, or `process`, run top-level effects, or import sibling node implementations. `cascade check` reports these as `architecture/*` diagnostics.
107
+ - A cache may memoize computation from wired inputs, but it must never supply unwired data. Make cache use an explicitly labelled prop and keep cache keys derived from the complete wired input and relevant props.
108
+ - Keep model/provider integrations in the project. Cascade core has no Google,
109
+ Anthropic, OpenAI, or generic `ai` capability. Use normal typed outputs such
110
+ as `image` or `asset`, and choose the actual execution path explicitly.
111
+ - Use exact Cascade core types or a namespaced project type such as `project.palette`.
112
+ - Never execute a module to discover its ports or metadata.
113
+
114
+ Use the runtime-native core vocabulary before creating a project wrapper:
115
+
116
+ - `cascade.core.Input` / `cascade.core.Output` define the public graph or subnet boundary.
117
+ - `cascade.core.Subnet` contains nested nodes.
118
+ - `cascade.core.Switch`, `Merge`, and `Select` provide deterministic routing.
119
+ - `cascade.core.Null` passes any value through unchanged so downstream wiring can remain stable while upstream branches are reorganized.
120
+ - `cascade.core.Random` maps explicit integer `seed` and `sample` inputs to a stable float in `[0, 1)`.
121
+ - `cascade.core.Remap` maps scalar ranges and optionally clamps via its `clamp` prop.
122
+
123
+ The geometry set is reserved the same way, under `cascade.geo.*`:
124
+ `Rectangle`, `Circle`, `Transform`, `Merge`, `CopyToPoints`, and `SvgExport`.
125
+ They all speak the one `geometry` type, so any output fits any input, and they
126
+ follow Houdini's parameter names where Houdini has an equivalent node. Geometry
127
+ is +Y up; the flip into SVG's frame lives in `SvgExport` alone.
128
+
129
+ These modules are reserved and need no file under `nodes/`. Do not override a
130
+ `cascade.core.*` module or use ambient random/time state in a portable node.
131
+
132
+ ## Navigate and edit graphs
133
+
134
+ - `.cascade` documents keep nodes and annotations in flat arrays. Nested elements carry `parent: '<subnet-id>'`; their positions are relative to that subnet.
135
+ - Element IDs are globally unique. Connections address node and port IDs, not array positions.
136
+ - Preserve unknown metadata and existing source fields when editing a graph.
137
+ - Validate hierarchy, ports, and connections together. Do not partially mutate a live graph and then repair it.
138
+ - Use the runtime/controller APIs for structural edits when available; do not reach into `_elements`, `_children`, connection arrays, or editor stores.
139
+
140
+ ## Boundaries
141
+
142
+ - Contracts have no runtime dependencies.
143
+ - Runtime depends only on contracts and contains no DOM, Svelte, Express, Node filesystem, or child-process imports.
144
+ - Hosts inject capabilities explicitly.
145
+ - Studio consumes runtime through its controller; custom frontends consume runtime directly.
146
+ - User modules are trusted project code, not a sandbox. Static definitions improve tooling and portability, not isolation.
147
+ - Keep legacy support inside the existing Studio/CLI compatibility engine; do not spread compatibility branches into the deterministic runtime.
148
+
149
+ ## Change workflow
150
+
151
+ Use Node.js 22.13 or newer. Cascade compiles with TypeScript 6; do not move to
152
+ the TypeScript 7 preview until it is stable and the repository gates pass.
153
+
154
+ 1. Add or update a focused regression test.
155
+ 2. Make the smallest change at the owning layer.
156
+ 3. Prefer deletion or an existing utility over another wrapper.
157
+ 4. Run the focused test, then `npm run check`, `npm run test:run`, `npm --prefix server run build`, `npm run build`, and `npm run build:cli` when the affected surface warrants it. Keep the CLI build last because Vite refreshes `dist/`.
158
+ 5. For package/public API changes, also test the packed tarball from an empty temporary project.
159
+
160
+ Do not add dependencies without a concrete need. Do not create extra packages unless they need independent publication or versioning.
161
+
162
+ ## Versioning
163
+
164
+ Cascade `0.2.0` is the 2026 architecture rework. The current release is
165
+ `0.2.22`. Increment the root package and CLI patch version for every committed
166
+ feature or release change (`0.2.22`, `0.2.22`, …), keeping `package.json`, the
167
+ lockfile, and CLI output aligned. Internal private workspaces do not receive
168
+ independent versions unless they become separately published packages.
@@ -0,0 +1,137 @@
1
+ # Cascade architecture
2
+
3
+ Cascade has four layers with one-way dependencies:
4
+
5
+ ```text
6
+ contracts <- runtime <- hosts/controllers <- applications
7
+ ```
8
+
9
+ The graph engine is a reusable product surface. The neutral runtime is ready for headless hosts; Studio is still migrating from its compatibility `Graph`/`Node` implementation and must not be described as migrated yet.
10
+
11
+ ## Contracts
12
+
13
+ `packages/contracts` is dependency-free and owns `.cascade` DTOs and schemas, core and namespaced types, deterministic node definitions, capability interfaces, diagnostics, events, presets, and run results.
14
+
15
+ Contracts contain no DOM, Svelte, Express, filesystem, process, or implementation imports. Public types belong here once; other layers import them rather than recreating variants.
16
+
17
+ ## Runtime
18
+
19
+ `packages/runtime` depends only on contracts and owns definition extraction, module registration, graph validation, scheduling, triggers, cancellation, outputs, hierarchy, inspection, and serialization semantics.
20
+
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
+
23
+ The reserved `cascade.core.*` registry is owned here. `Subnet`, `Input`,
24
+ `Output`, `Switch`, `Merge`, `Select`, 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.
28
+
29
+ ## Hosts
30
+
31
+ Hosts adapt the neutral runtime to an environment:
32
+
33
+ - Node: files, assets, media, Python, and shell.
34
+ - Browser: assets, media, and WebGL.
35
+ - Mixed application: an explicit bridge for serializable server stages.
36
+
37
+ Capabilities are injected. A node’s literal `runsOn` and `capabilities` fields are checked before its `execute` module is loaded.
38
+
39
+ `portable` describes one graph contract, not necessarily one implementation.
40
+ A registration may load an equivalent browser or server executor for that
41
+ contract. The host selects the executor; graphs and artist-facing parameters do
42
+ not contain backend switches. This is appropriate for operations such as crop,
43
+ resize, composite, and encode when both Canvas/WebGL and native implementations
44
+ exist. Both executors must obey the same definition and should share golden
45
+ parity tests for geometry, metadata, and edge cases.
46
+
47
+ `server/` is the project-scoped Node application host. It owns project paths, compilation, HTTP transport, media serving, Python workers, shell policy, and credentials. It is separately manifested and is not a third contracts/runtime workspace.
48
+
49
+ ## Applications and controllers
50
+
51
+ Studio’s Svelte components under `src/editor` own rendering, selection, panels, and interaction state. Its compatibility graph now has one graph-owned cook scheduler, while `StudioGraphController` centralizes an increasing set of structural mutations and publishes view snapshots. Compatibility adapters still present runtime-owned built-ins in Studio; collapse/extract and the remaining legacy nodes must migrate before Studio can consume `packages/runtime` directly.
52
+
53
+ Studio uses Dockview through the public `dockview` API. Code panels lazy-load
54
+ Monaco and its native editor/TypeScript workers rather than adding Monaco to the
55
+ initial application path. Markdown rendering has one Marked/DOMPurify boundary;
56
+ components do not configure parsers or inject unsanitized Markdown themselves.
57
+
58
+ Custom server applications and browser frontends use `cascade/runtime` directly and load no Studio code.
59
+
60
+ ## Distribution
61
+
62
+ 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.
63
+
64
+ Public subpaths are `cascade/contracts`, `cascade/contracts/schema`, `cascade/runtime`, `cascade/runtime/node`, `cascade/runtime/browser`, and the compatibility `cascade/shell`.
65
+
66
+ 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.
67
+
68
+ The packed root tarball contains compiled contracts, runtime, declarations, and a self-contained CLI. It must install and type-resolve from an empty project without workspace links or development dependencies. Additional packages require a concrete independent publication/versioning need.
69
+
70
+ The repository requires Node.js 22.13 or newer and builds with TypeScript 6,
71
+ Vite 8, and the Svelte Vite plugin 7. TypeScript 7 remains deferred while it is
72
+ a preview rather than a stable compiler target.
73
+
74
+ Model providers are deliberately outside Cascade. Projects own provider SDKs,
75
+ credentials, model selection, retries, and result normalization, using the same
76
+ project-node and host boundaries as any other external service. Cascade keeps
77
+ provider-neutral media and asset types, cancellation, progress, and diagnostics.
78
+
79
+ ## Deterministic nodes
80
+
81
+ `nodes/<Name>/index.ts` maps to `project.<Name>`. New modules export one literal `definition` with `apiVersion: 1` and one typed `execute(context)` function.
82
+
83
+ The extractor reads TypeScript syntax and never evaluates the module. Literal primitives, arrays, objects, parentheses, `as const`, and `satisfies` are valid. Identifiers, calls, spreads, computed keys, and other evaluation-dependent syntax are diagnostics.
84
+
85
+ `execute` performs computation only. Ports, props, types, execution locus, and capabilities are fixed by `definition`. Existing dynamic modules stay in the Studio/CLI compatibility engine during migration; the headless runtime never interprets them, and a malformed deterministic definition never falls back to dynamic execution.
86
+
87
+ Deterministic node modules are also statically checked for hidden coupling. They cannot declare module-level runtime values, run top-level effects, access ambient process/browser storage, dynamically import code, or import another node implementation. Nodes exchange project data through typed graph wires; declared props and host capabilities are their only other inputs. This is an enforceable architecture contract for trusted code, not process isolation.
88
+
89
+ ## Graph documents and hierarchy
90
+
91
+ Authored nodes and annotations remain in flat arrays. Optional `parent` IDs describe subnet membership; IDs are globally unique, and child positions are parent-relative. Connections retain their node/port endpoint format across subnet boundaries.
92
+
93
+ Neutral-runtime load order is:
94
+
95
+ 1. Parse and validate authored DTOs.
96
+ 2. Resolve hierarchy, falling back invalid links to root with diagnostics.
97
+ 3. Materialize node definitions and ports.
98
+ 4. Synchronize nested subnet interfaces deepest-first.
99
+ 5. Resolve connections and topology.
100
+ 6. Commit the complete candidate once.
101
+
102
+ The compatibility Studio loader also constructs and validates a complete
103
+ candidate before replacing the live graph. Unknown identifiers in Cascade's
104
+ reserved `cascade.*` namespace fail explicitly; they never become inert base
105
+ nodes or embedded/project modules. Subnet collapse/extract remain the main
106
+ structural transaction gap.
107
+
108
+ Callbacks and destruction hooks run after a valid structural commit. They are not rollback state.
109
+
110
+ ## Execution
111
+
112
+ Data runs follow graph dependencies. Explicit triggers use a FIFO queue, authored fan-out order, monotonic per-run sequence IDs, and cycle rejection. A triggered node receives cooked data ancestors before delivery.
113
+
114
+ 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.
115
+
116
+ ## Security
117
+
118
+ Project node modules are trusted code. Capabilities describe support and portability; they are not a sandbox.
119
+
120
+ All project HTTP APIs require an exact allowed Host. Origin is validated when
121
+ present and hostile or null Origins are rejected; same-origin GETs may omit it.
122
+ Filesystem resolution checks lexical paths and canonical existing targets or
123
+ parents. Project panels may additionally resolve beneath the canonical target
124
+ of the project-owned `shared/` link; other project paths remain root-confined.
125
+
126
+ Shell execution uses configured aliases and `spawn(executable, args, { shell:
127
+ false })`, bounded input/output/time, dangerous request-environment-key
128
+ rejection, process-tree cancellation, redacted audits, and capability-token
129
+ routes. Sensitive routes are enabled on loopback or through explicit exact
130
+ trusted-host configuration; an untrusted remote bind exposes no capability
131
+ bootstrap.
132
+
133
+ ## Compatibility and migration
134
+
135
+ `src/nodes` and `src/engine` remain the Studio compatibility surface while Studio migrates onto the neutral runtime. Runtime-owned algorithms stay in `packages/runtime`; compatibility nodes may adapt them but must not fork their semantics. New features belong at the owning contracts/runtime/host/controller layer.
136
+
137
+ Prefer deletion and direct imports over wrappers. Preserve behavior with focused tests before moving code, then remove the replaced path in the same change when safe.
package/DESIGN.md ADDED
@@ -0,0 +1,161 @@
1
+ # Design
2
+
3
+ ## Source of truth
4
+
5
+ - Status: Active
6
+ - Last refreshed: 2026-08-29
7
+ - Primary product surfaces: reusable graph runtime, optional Studio workbench, headless Node/browser hosts, Inspector, Viewer, node ports, project-defined workbenches
8
+ - Evidence reviewed: `VISION.md`, `ARCHITECTURE.md`, `spec/CASCADE_SUBNET_AND_SHELL_SPEC.md`, `src/types/coreTypes.ts`, `src/editor/Inspector.svelte`, `src/editor/Viewer.svelte`, `src/editor/components/PortEditor.svelte`, `src/editor/components/typeRenderers.ts`, and the approved plans under `.omx/plans/`
9
+
10
+ ## Brand
11
+
12
+ - Personality: technical, direct, calm, precise, and built for expert creative work
13
+ - Trust signals: visible types, explicit execution locus, inspectable intermediate values, honest errors, stable filesystem paths
14
+ - Avoid: generic AI gradients, decorative card grids, excessive shadows, toy-like controls, hidden conversions, and visual noise that competes with outputs
15
+
16
+ ## Product goals
17
+
18
+ - Goals: provide a stable reusable platform for generative design across interactive web work, high-resolution print, motion, video, sound, WebGL, Python, and external-service workflows; separate authored algorithms from platform and Studio concerns; make every graph stage inspectable; let projects reuse deterministic custom nodes without rebuilding file, version, preset, workspace, or execution infrastructure
19
+ - Non-goals: spreadsheet-scale data editing, full 3D DCC tooling, silent expensive conversions, bespoke conditionals for every node type, executing user modules to discover metadata, or requiring the Studio UI to run a graph
20
+ - Success signals: the same `.cascade` graph runs in Studio, a Node server, or a UI-free browser host; node contracts are statically inspectable and TypeScript-checkable; every `CORE_TYPES` member has a useful Inspector and Viewer state; connected/output values are clearly read-only; project renderers plug into the same contract; large values remain responsive
21
+
22
+ ## Personas and jobs
23
+
24
+ - Primary personas: creative coders, technical artists, generative-design engineers
25
+ - User jobs: tune node inputs, understand intermediate outputs, compare execution contexts, detect malformed values, and move fluidly between Python and browser-backed stages
26
+ - Key contexts of use: dense desktop workbenches, long pipelines, large images/geometry, mixed CPU/GPU/server execution
27
+
28
+ ## Information architecture
29
+
30
+ - Primary navigation: canvas selection determines Inspector and Viewer context
31
+ - Core screens: Graph, Inspector, Viewer, Logs/diagnostics
32
+ - Content hierarchy: value preview first, type and shape metadata second, expandable raw structure last
33
+
34
+ ## Design principles
35
+
36
+ - One type, one presentation contract: the same type vocabulary drives ports, Inspector, and Viewer.
37
+ - Progressive disclosure: compact summaries in dense panels; richer previews and metadata in Viewer; raw JSON only on demand.
38
+ - Edit only what can be authored honestly: inputs may edit portable values; connected inputs and outputs are read-only; live GPU textures are inspected, not fabricated through form fields.
39
+ - Expensive context changes stay explicit: texture readback, server materialization, and file writes are actions or nodes, never invisible UI coercions.
40
+ - Project types extend by registration, not central switch statements.
41
+ - The graph runtime is a product surface independent from Studio. Headless hosts consume it now; Studio's compatibility graph has one scheduler/controller boundary but still requires a deliberate built-in and structural-command migration before it consumes the neutral runtime directly.
42
+ - Node metadata is deterministic. A literal exported definition declares ports, properties, types, execution locus, and capabilities; `execute` performs computation only.
43
+ - Hosts provide explicit capabilities. File, Python, media, WebGL, and shell access are never ambient runtime assumptions. Provider-specific AI abstractions belong to projects or embedding hosts, not Cascade core.
44
+ - Neutral-runtime graph loads are atomic. Compatibility Studio collapse/extract are a known migration gap and must move behind transactional structural commands before that guarantee applies to every editor operation.
45
+ - Tradeoff: geometry editors favor transparent structured editing and previews over specialized CAD interactions in this pass.
46
+
47
+ ## Architecture
48
+
49
+ - `@cascade/contracts` is the dependency-free source of truth for graph documents, core and namespaced types, deterministic node definitions, diagnostics, run results, capabilities, and schemas.
50
+ - `@cascade/runtime` is the deterministic environment-neutral graph loader, validator, scheduler, serializer, trigger engine, and hierarchy implementation. It depends only on contracts; dynamic compatibility remains in Studio/CLI during migration.
51
+ - The root `cascade` package is the sole published distribution and CLI owner. It exposes `cascade/contracts`, `cascade/contracts/schema`, `cascade/runtime`, `cascade/runtime/node`, `cascade/runtime/browser`, and the compatibility `cascade/shell` entry point.
52
+ - Node and browser hosts inject only the capabilities they support. Browser-only WebGL and server-only file, Python, and shell capabilities make portability constraints explicit before execution.
53
+ - The Studio owns canvas/view classes and a single `StudioGraphController`; its compatibility `Graph`/`Node` engine is still being reduced. Custom frontends and backend services use the neutral runtime directly and do not load editor code.
54
+ - Python interoperability remains a host capability for exotic libraries and compute stages. Exchange values cross explicit typed node boundaries rather than leaking Python process details into the neutral runtime.
55
+ - Internal packages remain two workspaces until independent versioning or external consumption justifies separate publication. More npm packages are not a goal by themselves.
56
+
57
+ ## Graph and node conventions
58
+
59
+ - A custom node lives at `nodes/<Name>/index.ts`; its folder identity resolves to `project.<Name>`.
60
+ - The module exports a literal `definition` and a typed `execute`. Static inspection accepts JSON-like literals, arrays, parentheses, `as const`, and `satisfies`; identifiers, calls, spreads, computed properties, and other evaluation-dependent syntax are rejected.
61
+ - Deterministic modules have no module-level values or top-level effects, do not access ambient globals or browser storage, and do not import sibling node implementations. Data dependencies are graph wires; props configure the node; hosts inject declared capabilities. Static architecture diagnostics reject violations before execution.
62
+ - `definition.runsOn` is required (`portable`, `browser`, or `server`), and declared capabilities must be valid for that locus.
63
+ - Trigger events are explicit, queued FIFO, and fan out in authored connection order. Data dependencies cook before a gated trigger target. Trigger cycles are rejected.
64
+ - `.cascade` documents retain a flat authored element list. Optional `parent` identifiers describe nested subnets for nodes and annotations; child positions are relative to their parent network.
65
+ - Loading prepares and validates authored elements, hierarchy, executable nodes, ports, connections, pending connections, and topology before one assignment-only structural commit.
66
+ - Existing dynamic modules remain supported by the current Studio/CLI engine during migration. The headless runtime is deterministic-only, and malformed definitions never fall back to dynamic execution.
67
+
68
+ ## Headless and deployment model
69
+
70
+ - `createRuntime()` is the common entry point for Studio, Node services, UI-free browser embeds, tests, and custom web frontends.
71
+ - 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.
72
+ - 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.
73
+ - 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.
74
+ - 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.
75
+
76
+ ## Security boundaries
77
+
78
+ - User node modules are trusted project code, not a sandbox. Deterministic definitions and architecture checks prevent common hidden-state designs and improve inspection, tooling, and portability; hard isolation would additionally require a separate realm or worker per node instance.
79
+ - Shell is a server-only capability backed by one project-scoped service. Projects invoke configured aliases as a fixed executable plus argument array with `shell: false`; arbitrary executables, interpolation, unsafe working directories, dangerous request-time environment overrides, and unbounded output are rejected. The subprocess inherits the server environment before project and allowlisted request overrides are applied.
80
+ - Browser shell transport is loopback-only, uses exact Host and Origin checks plus a process-lifetime random capability token, has route-local request limits, and never logs tokens, paths, arguments, environment, stdin, stdout, or stderr.
81
+ - Timeout, cancellation, and output limits terminate the full process tree and wait for closure before reporting completion.
82
+
83
+ ## Agent workflow contract
84
+
85
+ - Repository guidance must let a code agent find the project manifest, graph documents, nodes, assets, presets, runtime host, and verification commands without reverse-engineering Studio internals.
86
+ - Project creation and node creation use canonical templates and CLI checks. A good agent workflow is: inspect contracts, author a literal definition, implement typed computation, run static definition extraction and TypeScript checks, then run the graph headlessly before opening Studio.
87
+ - Public contracts and examples favor small composable modules, direct imports, explicit capabilities, and deletion of redundant wrappers. Agent guidance must name deprecated compatibility paths and their migration target.
88
+
89
+ ## Visual language
90
+
91
+ - Color: the workbench resolves through one set of semantic tokens in `src/editor/theme.css`, which carries a dark and a light value for each name; the theme setting follows the system unless the artist picks one. Family colors from `TYPE_COLORS` are unchanged, and color still communicates type family, not decoration
92
+ - Typography: system UI font for labels; compact monospace for values, paths, dimensions, and diagnostics
93
+ - Spacing/layout rhythm: dense 4/6/8px rhythm; metadata rows remain scannable without nested card chrome
94
+ - Shape/radius/elevation: 3–4px radii; borders establish hierarchy; shadows reserved for floating dialogs/menus
95
+ - Motion: immediate updates; brief status transitions only; no decorative motion
96
+ - Imagery/iconography: previews use the actual value; icons clarify actions or execution locus only
97
+
98
+ ## Components
99
+
100
+ - Existing components to reuse: `PortEditor`, `JsonTree`, `ColorPicker`, Viewer image zoom/pan behavior, type renderer registry
101
+ - New/changed components: shared `TypeValue` presentation shell, structured JSON editor, image/texture inspector, geometry summary/preview, asset inspector, Viewer output list
102
+ - Variants and states: `compact`, `inspect`, `view`; editable/read-only; empty/loading/error/stale; connected source; truncated/expanded
103
+ - Token/component ownership: `coreTypes.ts` owns semantic type metadata; the presentation registry owns components; Inspector/Viewer only choose context and mode
104
+
105
+ ### Core type presentation contract
106
+
107
+ | Family | Inspector/editor | Viewer |
108
+ | --- | --- | --- |
109
+ | `float`, `int`, `bool`, `string` | native compact controls | large readable value with type metadata |
110
+ | vectors and matrices | labeled numeric fields; integer rounding; identity action for matrices | formatted tuple/grid with dimensions |
111
+ | `color` | swatch plus RGBA fields | swatch, numeric values, colour-space note |
112
+ | `image` | path and descriptor metadata; thumbnail; portable fields editable only when unconnected | zoomable media preview plus size/channels/depth/space/path |
113
+ | `texture` | read-only live GPU metadata and unavailable/stale state | GPU preview when a canvas/source is exposed, otherwise dimensions/format/session metadata |
114
+ | `points`, `lines`, `polyline`, `rects` | count/bounds summary plus validated structured editor for unconnected inputs | lightweight SVG/Canvas2D preview, count, dimensionality, bounds, expandable structure |
115
+ | `mesh` | vertex/triangle/normal/UV summary plus validated structured editor | lightweight projected preview when feasible, statistics, expandable structure |
116
+ | `asset` | validated project-relative path/descriptor editor | media/file metadata and preview when renderable |
117
+ | `array`, `object`, `any` | validated structured editor with tree preview | searchable/expandable tree and concise shape summary |
118
+ | namespaced project types | registered renderer when available; safe generic structured fallback | same registry with richer `view` mode and generic fallback |
119
+
120
+ ## Accessibility
121
+
122
+ - Target standard: WCAG 2.2 AA for interactive controls and text contrast
123
+ - Keyboard/focus behavior: all fields, expanders, reset/copy/open actions, and output selection are keyboard reachable with visible focus
124
+ - Contrast/readability: type color is never the only carrier of meaning; every value includes a textual type label
125
+ - Screen-reader semantics: groups use labels/headings; summaries announce type, shape, editability, and error state
126
+ - Reduced motion and sensory considerations: respect reduced motion; avoid pulsing status effects
127
+
128
+ ## Responsive behavior
129
+
130
+ - Supported breakpoints/devices: desktop-first; Inspector remains usable from 240px width; Viewer adapts to Dockview panel size
131
+ - Layout adaptations: vector/matrix fields wrap or scroll; Viewer metadata collapses beneath previews; structured trees virtualize or truncate large collections
132
+ - Touch/hover differences: no essential information exists only in hover tooltips
133
+
134
+ ## Interaction states
135
+
136
+ - Loading: preserve previous value when possible and show bounded loading status
137
+ - Empty: type-aware “No value” state, not a blank panel
138
+ - Error: inline typed diagnostic with preserved last-known-good preview where applicable
139
+ - Success: edits commit on change/blur and trigger the existing node update/cook path
140
+ - Disabled: connected inputs and all outputs explain why they are read-only
141
+ - Offline/slow network: retain cached preview and show stale/disconnected metadata for file-backed values
142
+
143
+ ## Content voice
144
+
145
+ - Tone: concise, factual, technically precise
146
+ - Terminology: use the canonical type names and “browser”, “GPU”, and “Python/server” execution contexts consistently
147
+ - Microcopy rules: state the condition and recovery; avoid anthropomorphic or generic “something went wrong” text
148
+
149
+ ## Implementation constraints
150
+
151
+ - Framework/styling system: Svelte 5, component-local CSS, existing Dockview workbench
152
+ - Design-token constraints: reuse `TYPE_COLORS` and current neutral palette; do not add a second design-token layer in this pass
153
+ - Performance constraints: never dump unbounded JSON into the DOM; image previews use `/api/media`; geometry previews sample large collections; texture UI avoids GPU readback unless explicitly requested
154
+ - Compatibility constraints: normalize legacy `number`, `boolean`, and `curves`; preserve namespaced project renderers and old image paths via `coerceImageRef`
155
+ - Test/screenshot expectations: unit-test type formatting/normalization and renderer resolution; component-test editing/read-only/error states; production build and Svelte check remain green
156
+
157
+ ## Open questions
158
+
159
+ - [ ] Whether mesh Viewer should gain an interactive WebGL orbit view after the lightweight projected preview proves useful / product / medium impact
160
+ - [ ] Whether project packages can eventually ship Svelte renderers directly rather than app-side registration / architecture / high impact
161
+ - [ ] Whether large structured values need virtualization beyond bounded initial expansion / performance / medium impact
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 FIELD.IO
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.