@fundamental-engine/core 0.4.0

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 (371) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +128 -0
  3. package/dist/agents/element-agent.d.ts +38 -0
  4. package/dist/agents/element-agent.d.ts.map +1 -0
  5. package/dist/agents/element-agent.js +70 -0
  6. package/dist/agents/element-agent.js.map +1 -0
  7. package/dist/agents/event-agent.d.ts +47 -0
  8. package/dist/agents/event-agent.d.ts.map +1 -0
  9. package/dist/agents/event-agent.js +82 -0
  10. package/dist/agents/event-agent.js.map +1 -0
  11. package/dist/agents/index.d.ts +17 -0
  12. package/dist/agents/index.d.ts.map +1 -0
  13. package/dist/agents/index.js +57 -0
  14. package/dist/agents/index.js.map +1 -0
  15. package/dist/agents/region-agents.d.ts +40 -0
  16. package/dist/agents/region-agents.d.ts.map +1 -0
  17. package/dist/agents/region-agents.js +22 -0
  18. package/dist/agents/region-agents.js.map +1 -0
  19. package/dist/agents/relationship.d.ts +55 -0
  20. package/dist/agents/relationship.d.ts.map +1 -0
  21. package/dist/agents/relationship.js +40 -0
  22. package/dist/agents/relationship.js.map +1 -0
  23. package/dist/agents/user-agent.d.ts +57 -0
  24. package/dist/agents/user-agent.d.ts.map +1 -0
  25. package/dist/agents/user-agent.js +45 -0
  26. package/dist/agents/user-agent.js.map +1 -0
  27. package/dist/config/forces.config.d.ts +101 -0
  28. package/dist/config/forces.config.d.ts.map +1 -0
  29. package/dist/config/forces.config.js +239 -0
  30. package/dist/config/forces.config.js.map +1 -0
  31. package/dist/config/manual.d.ts +134 -0
  32. package/dist/config/manual.d.ts.map +1 -0
  33. package/dist/config/manual.js +604 -0
  34. package/dist/config/manual.js.map +1 -0
  35. package/dist/config/palettes.d.ts +18 -0
  36. package/dist/config/palettes.d.ts.map +1 -0
  37. package/dist/config/palettes.js +34 -0
  38. package/dist/config/palettes.js.map +1 -0
  39. package/dist/config/presets.d.ts +48 -0
  40. package/dist/config/presets.d.ts.map +1 -0
  41. package/dist/config/presets.js +87 -0
  42. package/dist/config/presets.js.map +1 -0
  43. package/dist/config/tokens.d.ts +3 -0
  44. package/dist/config/tokens.d.ts.map +1 -0
  45. package/dist/config/tokens.js +16 -0
  46. package/dist/config/tokens.js.map +1 -0
  47. package/dist/conformance/expectations.d.ts +40 -0
  48. package/dist/conformance/expectations.d.ts.map +1 -0
  49. package/dist/conformance/expectations.js +347 -0
  50. package/dist/conformance/expectations.js.map +1 -0
  51. package/dist/conformance/experiments.d.ts +17 -0
  52. package/dist/conformance/experiments.d.ts.map +1 -0
  53. package/dist/conformance/experiments.js +875 -0
  54. package/dist/conformance/experiments.js.map +1 -0
  55. package/dist/conformance/run.d.ts +18 -0
  56. package/dist/conformance/run.d.ts.map +1 -0
  57. package/dist/conformance/run.js +240 -0
  58. package/dist/conformance/run.js.map +1 -0
  59. package/dist/conformance/types.d.ts +100 -0
  60. package/dist/conformance/types.d.ts.map +1 -0
  61. package/dist/conformance/types.js +2 -0
  62. package/dist/conformance/types.js.map +1 -0
  63. package/dist/contracts/guards.d.ts +51 -0
  64. package/dist/contracts/guards.d.ts.map +1 -0
  65. package/dist/contracts/guards.js +100 -0
  66. package/dist/contracts/guards.js.map +1 -0
  67. package/dist/contracts/index.d.ts +18 -0
  68. package/dist/contracts/index.d.ts.map +1 -0
  69. package/dist/contracts/index.js +107 -0
  70. package/dist/contracts/index.js.map +1 -0
  71. package/dist/contracts/passport.d.ts +88 -0
  72. package/dist/contracts/passport.d.ts.map +1 -0
  73. package/dist/contracts/passport.js +135 -0
  74. package/dist/contracts/passport.js.map +1 -0
  75. package/dist/contracts/types.d.ts +120 -0
  76. package/dist/contracts/types.d.ts.map +1 -0
  77. package/dist/contracts/types.js +24 -0
  78. package/dist/contracts/types.js.map +1 -0
  79. package/dist/core/accretion.d.ts +50 -0
  80. package/dist/core/accretion.d.ts.map +1 -0
  81. package/dist/core/accretion.js +98 -0
  82. package/dist/core/accretion.js.map +1 -0
  83. package/dist/core/agents.d.ts +31 -0
  84. package/dist/core/agents.d.ts.map +1 -0
  85. package/dist/core/agents.js +51 -0
  86. package/dist/core/agents.js.map +1 -0
  87. package/dist/core/attention.d.ts +72 -0
  88. package/dist/core/attention.d.ts.map +1 -0
  89. package/dist/core/attention.js +122 -0
  90. package/dist/core/attention.js.map +1 -0
  91. package/dist/core/causality.d.ts +38 -0
  92. package/dist/core/causality.d.ts.map +1 -0
  93. package/dist/core/causality.js +64 -0
  94. package/dist/core/causality.js.map +1 -0
  95. package/dist/core/conditions.d.ts +10 -0
  96. package/dist/core/conditions.d.ts.map +1 -0
  97. package/dist/core/conditions.js +22 -0
  98. package/dist/core/conditions.js.map +1 -0
  99. package/dist/core/currents.d.ts +53 -0
  100. package/dist/core/currents.d.ts.map +1 -0
  101. package/dist/core/currents.js +65 -0
  102. package/dist/core/currents.js.map +1 -0
  103. package/dist/core/dock.d.ts +35 -0
  104. package/dist/core/dock.d.ts.map +1 -0
  105. package/dist/core/dock.js +39 -0
  106. package/dist/core/dock.js.map +1 -0
  107. package/dist/core/events.d.ts +23 -0
  108. package/dist/core/events.d.ts.map +1 -0
  109. package/dist/core/events.js +34 -0
  110. package/dist/core/events.js.map +1 -0
  111. package/dist/core/feedback-sink.d.ts +32 -0
  112. package/dist/core/feedback-sink.d.ts.map +1 -0
  113. package/dist/core/feedback-sink.js +53 -0
  114. package/dist/core/feedback-sink.js.map +1 -0
  115. package/dist/core/feedback.d.ts +11 -0
  116. package/dist/core/feedback.d.ts.map +1 -0
  117. package/dist/core/feedback.js +16 -0
  118. package/dist/core/feedback.js.map +1 -0
  119. package/dist/core/field-store.d.ts +26 -0
  120. package/dist/core/field-store.d.ts.map +1 -0
  121. package/dist/core/field-store.js +54 -0
  122. package/dist/core/field-store.js.map +1 -0
  123. package/dist/core/field.d.ts +18 -0
  124. package/dist/core/field.d.ts.map +1 -0
  125. package/dist/core/field.js +1943 -0
  126. package/dist/core/field.js.map +1 -0
  127. package/dist/core/fieldline-seeds.d.ts +25 -0
  128. package/dist/core/fieldline-seeds.d.ts.map +1 -0
  129. package/dist/core/fieldline-seeds.js +32 -0
  130. package/dist/core/fieldline-seeds.js.map +1 -0
  131. package/dist/core/fieldlines.d.ts +75 -0
  132. package/dist/core/fieldlines.d.ts.map +1 -0
  133. package/dist/core/fieldlines.js +111 -0
  134. package/dist/core/fieldlines.js.map +1 -0
  135. package/dist/core/flow.d.ts +38 -0
  136. package/dist/core/flow.d.ts.map +1 -0
  137. package/dist/core/flow.js +27 -0
  138. package/dist/core/flow.js.map +1 -0
  139. package/dist/core/formations.d.ts +11 -0
  140. package/dist/core/formations.d.ts.map +1 -0
  141. package/dist/core/formations.js +22 -0
  142. package/dist/core/formations.js.map +1 -0
  143. package/dist/core/geometry.d.ts +67 -0
  144. package/dist/core/geometry.d.ts.map +1 -0
  145. package/dist/core/geometry.js +68 -0
  146. package/dist/core/geometry.js.map +1 -0
  147. package/dist/core/heatmap.d.ts +22 -0
  148. package/dist/core/heatmap.d.ts.map +1 -0
  149. package/dist/core/heatmap.js +55 -0
  150. package/dist/core/heatmap.js.map +1 -0
  151. package/dist/core/host.d.ts +46 -0
  152. package/dist/core/host.d.ts.map +1 -0
  153. package/dist/core/host.js +11 -0
  154. package/dist/core/host.js.map +1 -0
  155. package/dist/core/integrator.d.ts +24 -0
  156. package/dist/core/integrator.d.ts.map +1 -0
  157. package/dist/core/integrator.js +375 -0
  158. package/dist/core/integrator.js.map +1 -0
  159. package/dist/core/math.d.ts +37 -0
  160. package/dist/core/math.d.ts.map +1 -0
  161. package/dist/core/math.js +77 -0
  162. package/dist/core/math.js.map +1 -0
  163. package/dist/core/reactions.d.ts +32 -0
  164. package/dist/core/reactions.d.ts.map +1 -0
  165. package/dist/core/reactions.js +45 -0
  166. package/dist/core/reactions.js.map +1 -0
  167. package/dist/core/registry.d.ts +13 -0
  168. package/dist/core/registry.d.ts.map +1 -0
  169. package/dist/core/registry.js +20 -0
  170. package/dist/core/registry.js.map +1 -0
  171. package/dist/core/render-backend.d.ts +46 -0
  172. package/dist/core/render-backend.d.ts.map +1 -0
  173. package/dist/core/render-backend.js +75 -0
  174. package/dist/core/render-backend.js.map +1 -0
  175. package/dist/core/render-modes.d.ts +42 -0
  176. package/dist/core/render-modes.d.ts.map +1 -0
  177. package/dist/core/render-modes.js +141 -0
  178. package/dist/core/render-modes.js.map +1 -0
  179. package/dist/core/reservoir.d.ts +43 -0
  180. package/dist/core/reservoir.d.ts.map +1 -0
  181. package/dist/core/reservoir.js +207 -0
  182. package/dist/core/reservoir.js.map +1 -0
  183. package/dist/core/scalar-grid.d.ts +51 -0
  184. package/dist/core/scalar-grid.d.ts.map +1 -0
  185. package/dist/core/scalar-grid.js +146 -0
  186. package/dist/core/scalar-grid.js.map +1 -0
  187. package/dist/core/scanner.d.ts +59 -0
  188. package/dist/core/scanner.d.ts.map +1 -0
  189. package/dist/core/scanner.js +260 -0
  190. package/dist/core/scanner.js.map +1 -0
  191. package/dist/core/shadow.d.ts +69 -0
  192. package/dist/core/shadow.d.ts.map +1 -0
  193. package/dist/core/shadow.js +84 -0
  194. package/dist/core/shadow.js.map +1 -0
  195. package/dist/core/spatial-hash.d.ts +30 -0
  196. package/dist/core/spatial-hash.d.ts.map +1 -0
  197. package/dist/core/spatial-hash.js +64 -0
  198. package/dist/core/spatial-hash.js.map +1 -0
  199. package/dist/core/streamlines.d.ts +29 -0
  200. package/dist/core/streamlines.d.ts.map +1 -0
  201. package/dist/core/streamlines.js +70 -0
  202. package/dist/core/streamlines.js.map +1 -0
  203. package/dist/core/surface.d.ts +19 -0
  204. package/dist/core/surface.d.ts.map +1 -0
  205. package/dist/core/surface.js +21 -0
  206. package/dist/core/surface.js.map +1 -0
  207. package/dist/core/temporal.d.ts +110 -0
  208. package/dist/core/temporal.d.ts.map +1 -0
  209. package/dist/core/temporal.js +139 -0
  210. package/dist/core/temporal.js.map +1 -0
  211. package/dist/core/thermo.d.ts +48 -0
  212. package/dist/core/thermo.d.ts.map +1 -0
  213. package/dist/core/thermo.js +48 -0
  214. package/dist/core/thermo.js.map +1 -0
  215. package/dist/core/types.d.ts +610 -0
  216. package/dist/core/types.d.ts.map +1 -0
  217. package/dist/core/types.js +2 -0
  218. package/dist/core/types.js.map +1 -0
  219. package/dist/core/weights.d.ts +111 -0
  220. package/dist/core/weights.d.ts.map +1 -0
  221. package/dist/core/weights.js +128 -0
  222. package/dist/core/weights.js.map +1 -0
  223. package/dist/diagnostics/energy.d.ts +21 -0
  224. package/dist/diagnostics/energy.d.ts.map +1 -0
  225. package/dist/diagnostics/energy.js +27 -0
  226. package/dist/diagnostics/energy.js.map +1 -0
  227. package/dist/diagnostics/fields.d.ts +23 -0
  228. package/dist/diagnostics/fields.d.ts.map +1 -0
  229. package/dist/diagnostics/fields.js +30 -0
  230. package/dist/diagnostics/fields.js.map +1 -0
  231. package/dist/diagnostics/index.d.ts +46 -0
  232. package/dist/diagnostics/index.d.ts.map +1 -0
  233. package/dist/diagnostics/index.js +23 -0
  234. package/dist/diagnostics/index.js.map +1 -0
  235. package/dist/diagnostics/modes.d.ts +108 -0
  236. package/dist/diagnostics/modes.d.ts.map +1 -0
  237. package/dist/diagnostics/modes.js +181 -0
  238. package/dist/diagnostics/modes.js.map +1 -0
  239. package/dist/diagnostics/potential.d.ts +30 -0
  240. package/dist/diagnostics/potential.d.ts.map +1 -0
  241. package/dist/diagnostics/potential.js +43 -0
  242. package/dist/diagnostics/potential.js.map +1 -0
  243. package/dist/diagnostics/probes.d.ts +31 -0
  244. package/dist/diagnostics/probes.d.ts.map +1 -0
  245. package/dist/diagnostics/probes.js +61 -0
  246. package/dist/diagnostics/probes.js.map +1 -0
  247. package/dist/diagnostics/render.d.ts +49 -0
  248. package/dist/diagnostics/render.d.ts.map +1 -0
  249. package/dist/diagnostics/render.js +132 -0
  250. package/dist/diagnostics/render.js.map +1 -0
  251. package/dist/export.d.ts +18 -0
  252. package/dist/export.d.ts.map +1 -0
  253. package/dist/export.js +17 -0
  254. package/dist/export.js.map +1 -0
  255. package/dist/forces/extended.d.ts +121 -0
  256. package/dist/forces/extended.d.ts.map +1 -0
  257. package/dist/forces/extended.js +674 -0
  258. package/dist/forces/extended.js.map +1 -0
  259. package/dist/forces/index.d.ts +33 -0
  260. package/dist/forces/index.d.ts.map +1 -0
  261. package/dist/forces/index.js +237 -0
  262. package/dist/forces/index.js.map +1 -0
  263. package/dist/forces/natural.d.ts +106 -0
  264. package/dist/forces/natural.d.ts.map +1 -0
  265. package/dist/forces/natural.js +385 -0
  266. package/dist/forces/natural.js.map +1 -0
  267. package/dist/index.d.ts +59 -0
  268. package/dist/index.d.ts.map +1 -0
  269. package/dist/index.js +71 -0
  270. package/dist/index.js.map +1 -0
  271. package/dist/inspect/budget.d.ts +17 -0
  272. package/dist/inspect/budget.d.ts.map +1 -0
  273. package/dist/inspect/budget.js +19 -0
  274. package/dist/inspect/budget.js.map +1 -0
  275. package/dist/inspect/index.d.ts +10 -0
  276. package/dist/inspect/index.d.ts.map +1 -0
  277. package/dist/inspect/index.js +10 -0
  278. package/dist/inspect/index.js.map +1 -0
  279. package/dist/inspect/report.d.ts +17 -0
  280. package/dist/inspect/report.d.ts.map +1 -0
  281. package/dist/inspect/report.js +44 -0
  282. package/dist/inspect/report.js.map +1 -0
  283. package/dist/inspect/snapshot.d.ts +21 -0
  284. package/dist/inspect/snapshot.d.ts.map +1 -0
  285. package/dist/inspect/snapshot.js +30 -0
  286. package/dist/inspect/snapshot.js.map +1 -0
  287. package/dist/recipes/catalog.d.ts +51 -0
  288. package/dist/recipes/catalog.d.ts.map +1 -0
  289. package/dist/recipes/catalog.js +1496 -0
  290. package/dist/recipes/catalog.js.map +1 -0
  291. package/dist/recipes/charge.d.ts +18 -0
  292. package/dist/recipes/charge.d.ts.map +1 -0
  293. package/dist/recipes/charge.js +27 -0
  294. package/dist/recipes/charge.js.map +1 -0
  295. package/dist/recipes/compile.d.ts +93 -0
  296. package/dist/recipes/compile.d.ts.map +1 -0
  297. package/dist/recipes/compile.js +113 -0
  298. package/dist/recipes/compile.js.map +1 -0
  299. package/dist/recipes/explain.d.ts +8 -0
  300. package/dist/recipes/explain.d.ts.map +1 -0
  301. package/dist/recipes/explain.js +46 -0
  302. package/dist/recipes/explain.js.map +1 -0
  303. package/dist/recipes/gallery.d.ts +6 -0
  304. package/dist/recipes/gallery.d.ts.map +1 -0
  305. package/dist/recipes/gallery.js +6 -0
  306. package/dist/recipes/gallery.js.map +1 -0
  307. package/dist/recipes/gravity.d.ts +16 -0
  308. package/dist/recipes/gravity.d.ts.map +1 -0
  309. package/dist/recipes/gravity.js +27 -0
  310. package/dist/recipes/gravity.js.map +1 -0
  311. package/dist/recipes/index.d.ts +18 -0
  312. package/dist/recipes/index.d.ts.map +1 -0
  313. package/dist/recipes/index.js +36 -0
  314. package/dist/recipes/index.js.map +1 -0
  315. package/dist/recipes/intent.d.ts +44 -0
  316. package/dist/recipes/intent.d.ts.map +1 -0
  317. package/dist/recipes/intent.js +46 -0
  318. package/dist/recipes/intent.js.map +1 -0
  319. package/dist/recipes/schema.d.ts +103 -0
  320. package/dist/recipes/schema.d.ts.map +1 -0
  321. package/dist/recipes/schema.js +123 -0
  322. package/dist/recipes/schema.js.map +1 -0
  323. package/dist/recipes/wayfinding.d.ts +39 -0
  324. package/dist/recipes/wayfinding.d.ts.map +1 -0
  325. package/dist/recipes/wayfinding.js +77 -0
  326. package/dist/recipes/wayfinding.js.map +1 -0
  327. package/dist/semantic/index.d.ts +13 -0
  328. package/dist/semantic/index.d.ts.map +1 -0
  329. package/dist/semantic/index.js +31 -0
  330. package/dist/semantic/index.js.map +1 -0
  331. package/dist/semantic/layers.d.ts +24 -0
  332. package/dist/semantic/layers.d.ts.map +1 -0
  333. package/dist/semantic/layers.js +27 -0
  334. package/dist/semantic/layers.js.map +1 -0
  335. package/dist/semantic/materials.d.ts +20 -0
  336. package/dist/semantic/materials.d.ts.map +1 -0
  337. package/dist/semantic/materials.js +17 -0
  338. package/dist/semantic/materials.js.map +1 -0
  339. package/dist/semantic/states.d.ts +11 -0
  340. package/dist/semantic/states.d.ts.map +1 -0
  341. package/dist/semantic/states.js +26 -0
  342. package/dist/semantic/states.js.map +1 -0
  343. package/dist/visual/channels.d.ts +71 -0
  344. package/dist/visual/channels.d.ts.map +1 -0
  345. package/dist/visual/channels.js +70 -0
  346. package/dist/visual/channels.js.map +1 -0
  347. package/dist/visual/index.d.ts +39 -0
  348. package/dist/visual/index.d.ts.map +1 -0
  349. package/dist/visual/index.js +30 -0
  350. package/dist/visual/index.js.map +1 -0
  351. package/dist/visual/lint.d.ts +41 -0
  352. package/dist/visual/lint.d.ts.map +1 -0
  353. package/dist/visual/lint.js +58 -0
  354. package/dist/visual/lint.js.map +1 -0
  355. package/dist/visual/mapping.d.ts +13 -0
  356. package/dist/visual/mapping.d.ts.map +1 -0
  357. package/dist/visual/mapping.js +43 -0
  358. package/dist/visual/mapping.js.map +1 -0
  359. package/dist/visual/semantic-text.d.ts +28 -0
  360. package/dist/visual/semantic-text.d.ts.map +1 -0
  361. package/dist/visual/semantic-text.js +36 -0
  362. package/dist/visual/semantic-text.js.map +1 -0
  363. package/dist/visual/tokens.d.ts +23 -0
  364. package/dist/visual/tokens.d.ts.map +1 -0
  365. package/dist/visual/tokens.js +54 -0
  366. package/dist/visual/tokens.js.map +1 -0
  367. package/dist/visual/visualization.d.ts +31 -0
  368. package/dist/visual/visualization.d.ts.map +1 -0
  369. package/dist/visual/visualization.js +47 -0
  370. package/dist/visual/visualization.js.map +1 -0
  371. package/package.json +60 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/recipes/index.ts"],"names":[],"mappings":"AAQA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAE7B,+DAA+D;AAC/D,MAAM,CAAC,MAAM,gBAAgB,GAA4B;IACvD;QACE,IAAI,EAAE,uBAAuB;QAC7B,SAAS,EAAE,qJAAqJ;QAChK,SAAS,EAAE,wDAAwD;QACnE,cAAc,EAAE,uCAAuC;QACvD,QAAQ,EAAE,gJAAgJ;QAC1J,WAAW,EAAE,kFAAkF;KAChG;IACD;QACE,IAAI,EAAE,yBAAyB;QAC/B,SAAS,EAAE,2OAA2O;QACtP,SAAS,EAAE,0GAA0G;QACrH,cAAc,EAAE,oGAAoG;QACpH,QAAQ,EAAE,sKAAsK;QAChL,WAAW,EAAE,qFAAqF;KACnG;IACD;QACE,IAAI,EAAE,0BAA0B;QAChC,SAAS,EAAE,uEAAuE;QAClF,SAAS,EAAE,6CAA6C;QACxD,cAAc,EAAE,yEAAyE;QACzF,QAAQ,EAAE,wEAAwE;QAClF,WAAW,EAAE,+DAA+D;KAC7E;CACF,CAAC"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * The intent compiler (authoring-and-recipes §4). Authors describe intent ("draw-focus") and the
3
+ * compiler emits the concrete force tokens, attributes, and render layers. It is inspectable: the
4
+ * compiled output is plain data the author can read back. Tokens use the current names (viscosity,
5
+ * wall — not the legacy drag/reflect).
6
+ */
7
+ import type { RenderLayer } from './schema.ts';
8
+ export interface IntentPreset {
9
+ /** force tokens the intent compiles to. */
10
+ body: string[];
11
+ /** default range in px. */
12
+ range?: number;
13
+ /** enable DOM write-back. */
14
+ feedback?: boolean;
15
+ /** render layers the intent turns on. */
16
+ render?: RenderLayer[];
17
+ }
18
+ /** The intent → composition table (authoring §4), mapped to real force tokens. */
19
+ export declare const INTENT_PRESETS: Readonly<Record<string, IntentPreset>>;
20
+ /** The concrete authoring output a compiled intent produces. */
21
+ export interface CompiledIntent {
22
+ /** the `data-body` value. */
23
+ body: string;
24
+ strength?: number;
25
+ range?: number;
26
+ feedback: boolean;
27
+ render: RenderLayer[];
28
+ /** the data-* attribute set, ready to apply to an element. */
29
+ attributes: Record<string, string>;
30
+ }
31
+ export interface IntentOptions {
32
+ /** maps to data-strength (authoring's data-intensity). */
33
+ intensity?: number;
34
+ /** raises thermal/contrast for risky states (authoring's data-risk). */
35
+ risk?: 'low' | 'medium' | 'high';
36
+ }
37
+ /**
38
+ * Compile an intent + options into a concrete body composition. Returns null for an unknown intent
39
+ * (the author should see that, not get silent defaults).
40
+ */
41
+ export declare function compileIntent(intent: string, opts?: IntentOptions): CompiledIntent | null;
42
+ /** The known intent names, for inspectors / autocomplete. */
43
+ export declare function knownIntents(): string[];
44
+ //# sourceMappingURL=intent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intent.d.ts","sourceRoot":"","sources":["../../src/recipes/intent.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,WAAW,YAAY;IAC3B,2CAA2C;IAC3C,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yCAAyC;IACzC,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;CACxB;AAED,kFAAkF;AAClF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CASjE,CAAC;AAEF,gEAAgE;AAChE,MAAM,WAAW,cAAc;IAC7B,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,8DAA8D;IAC9D,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,aAAa;IAC5B,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wEAAwE;IACxE,IAAI,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;CAClC;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,GAAE,aAAkB,GAAG,cAAc,GAAG,IAAI,CAqB7F;AAED,6DAA6D;AAC7D,wBAAgB,YAAY,IAAI,MAAM,EAAE,CAEvC"}
@@ -0,0 +1,46 @@
1
+ /** The intent → composition table (authoring §4), mapped to real force tokens. */
2
+ export const INTENT_PRESETS = {
3
+ 'draw-focus': { body: ['attract'], range: 280, feedback: true },
4
+ 'clear-space': { body: ['repel'], range: 240 },
5
+ 'show-motion': { body: ['stream'], render: ['trails'] },
6
+ 'show-relationship': { body: ['memory'], render: ['links'] },
7
+ 'contain-energy': { body: ['viscosity', 'wall'] },
8
+ ignite: { body: ['thermal', 'fieldflow'], render: ['heatmap', 'particles'] },
9
+ stabilize: { body: ['viscosity', 'cohesion'] },
10
+ warn: { body: ['repel', 'thermal'], feedback: true },
11
+ };
12
+ /**
13
+ * Compile an intent + options into a concrete body composition. Returns null for an unknown intent
14
+ * (the author should see that, not get silent defaults).
15
+ */
16
+ export function compileIntent(intent, opts = {}) {
17
+ const preset = INTENT_PRESETS[intent];
18
+ if (!preset)
19
+ return null;
20
+ const body = [...preset.body];
21
+ // a high-risk intent adds a thermal warning layer if not already present
22
+ if (opts.risk === 'high' && !body.includes('thermal'))
23
+ body.push('thermal');
24
+ const attributes = { 'data-body': body.join(' ') };
25
+ if (opts.intensity != null)
26
+ attributes['data-strength'] = String(opts.intensity);
27
+ if (preset.range != null)
28
+ attributes['data-range'] = String(preset.range);
29
+ if (preset.feedback)
30
+ attributes['data-feedback'] = '';
31
+ if (preset.render?.length)
32
+ attributes['data-render'] = preset.render.join(' ');
33
+ return {
34
+ body: body.join(' '),
35
+ strength: opts.intensity,
36
+ range: preset.range,
37
+ feedback: preset.feedback ?? false,
38
+ render: preset.render ?? ['particles'],
39
+ attributes,
40
+ };
41
+ }
42
+ /** The known intent names, for inspectors / autocomplete. */
43
+ export function knownIntents() {
44
+ return Object.keys(INTENT_PRESETS);
45
+ }
46
+ //# sourceMappingURL=intent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intent.js","sourceRoot":"","sources":["../../src/recipes/intent.ts"],"names":[],"mappings":"AAmBA,kFAAkF;AAClF,MAAM,CAAC,MAAM,cAAc,GAA2C;IACpE,YAAY,EAAE,EAAE,IAAI,EAAE,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC/D,aAAa,EAAE,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE;IAC9C,aAAa,EAAE,EAAE,IAAI,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE;IACvD,mBAAmB,EAAE,EAAE,IAAI,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE;IAC5D,gBAAgB,EAAE,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE;IACjD,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC,EAAE;IAC5E,SAAS,EAAE,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,UAAU,CAAC,EAAE;IAC9C,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;CACrD,CAAC;AAqBF;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,MAAc,EAAE,OAAsB,EAAE;IACpE,MAAM,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IACtC,IAAI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ceBudget } from '../contracts/types.ts';
2
+ import type { FundamentalField } from '../config/manual.ts';
3
+ export type RenderLayer = 'particles' | 'dots' | 'trails' | 'links' | 'streamlines' | 'metaballs' | 'voronoi' | 'field-lines' | 'heatmap';
4
+ /** A diagnostic mode that reveals a recipe's behavior (the debug / scalar / graph overlays). */
5
+ export type DiagnosticMode = 'force-vectors' | 'contours' | 'potential' | 'energy' | 'topology' | 'inspector' | 'causality' | 'prediction';
6
+ /** One body in a recipe: a force token (or space-separated tokens) + attributes. */
7
+ export interface BodyRecipe {
8
+ body: string;
9
+ strength?: number;
10
+ range?: number;
11
+ spin?: number;
12
+ angle?: number;
13
+ feedback?: boolean;
14
+ scope?: 'local' | 'global';
15
+ /** condition gate for this body (`data-when`) — must be a REGISTERED engine condition id
16
+ * (active, fast, slow, hot, cool, scrolling); validateRecipe rejects unknown ids so a
17
+ * recipe can never declare a gate that silently never passes (#370). Recipe-level
18
+ * `conditions` remain the activation vocabulary; `when` is the executable per-body gate. */
19
+ when?: string;
20
+ }
21
+ export interface RelationshipRecipe {
22
+ from: string;
23
+ to: string;
24
+ type: string;
25
+ strength?: number;
26
+ }
27
+ export interface AccessibilityRecipe {
28
+ /** what replaces motion under prefers-reduced-motion. */
29
+ reducedMotion: string;
30
+ /** how meaning survives without color/motion. */
31
+ meaningWithoutMotion: string;
32
+ }
33
+ export interface ExpectedMetrics {
34
+ particleCount?: number;
35
+ entropyRange?: [number, number];
36
+ energyDriftMax?: number;
37
+ }
38
+ /** Which catalog tier a recipe belongs to. */
39
+ export type RecipeTier = 'core' | 'applied' | 'systems' | 'operational';
40
+ /** A recipe's implementation status. */
41
+ export type RecipeStatus = 'shipped' | 'experimental' | 'planned' | 'conceptual';
42
+ /**
43
+ * A portable field recipe (authoring §5) — the reusable unit that connects the natural-field model,
44
+ * engine primitives, DOM authoring, platform feedback, diagnostics, and the accessibility fallback.
45
+ */
46
+ export interface FieldRecipe {
47
+ /** stable kebab-case id (e.g. `priority-well`) — the recipe's identity across the docs + gallery. */
48
+ id: string;
49
+ name: string;
50
+ intent: string;
51
+ /** which catalog tier the recipe sits in (injected during assembly). */
52
+ tier?: RecipeTier;
53
+ /** the fundamental field this recipe translates (gravity / electromagnetic / strong / weak), if one dominates. */
54
+ naturalField?: FundamentalField;
55
+ /** a short natural-field translation phrase (conceptual), e.g. "priority, convergence, hierarchy". */
56
+ translation?: string;
57
+ /** RUNTIME TOKENS: the strict, real, passported engine forces this recipe composes (= distinct body tokens). */
58
+ primitives: string[];
59
+ /** CONCEPTS: human-facing product language (orbit, spring, trust, staleness) — never runtime tokens. */
60
+ concepts?: string[];
61
+ /** METRICS: measured / semantic state (mass, attention, pressure, confidence) — not forces. */
62
+ metrics: string[];
63
+ /** DIAGNOSTICS: inspection / render modes that reveal this recipe's behavior — not forces. */
64
+ diagnostics: string[];
65
+ /** CONDITIONS: activation logic (dwell, threshold, stale, in-view, focused) — not forces. */
66
+ conditions?: string[];
67
+ bodies: BodyRecipe[];
68
+ relationships?: RelationshipRecipe[];
69
+ render: RenderLayer[];
70
+ /** the reduced-motion + meaning-without-motion equivalent — required: no recipe is motion-only. */
71
+ accessibility: AccessibilityRecipe;
72
+ status?: RecipeStatus;
73
+ budget?: Partial<PerformanceBudget>;
74
+ expected?: ExpectedMetrics;
75
+ notes?: string;
76
+ }
77
+ /** @deprecated renamed to {@link FieldRecipe}. */
78
+ export type SceneRecipe = FieldRecipe;
79
+ /** A reusable render stack (authoring §6). */
80
+ export interface VisualizationPreset {
81
+ name: string;
82
+ layers: RenderLayer[];
83
+ notes?: string;
84
+ }
85
+ /** Every render + diagnostic mode id a recipe may reference (mirrors `RENDER_MODES` + `particles`). */
86
+ export declare const FIELD_MODES: ReadonlySet<string>;
87
+ /** The distinct engine primitives used across a recipe's bodies, in first-seen order. */
88
+ export declare function primitivesOf(bodies: readonly BodyRecipe[]): string[];
89
+ export interface RecipeProblem {
90
+ path: string;
91
+ issue: string;
92
+ }
93
+ /**
94
+ * Validate a recipe's shape and references. Returns every problem (empty = valid). Each force token
95
+ * must be a real, passported force; each render layer + diagnostic must be a known mode; the declared
96
+ * primitives must match the body tokens; the natural field must be one of the four.
97
+ */
98
+ export declare function validateRecipe(r: FieldRecipe): RecipeProblem[];
99
+ /** Serialize a recipe to canonical JSON. */
100
+ export declare function serializeRecipe(r: FieldRecipe): string;
101
+ /** Parse + validate a recipe from JSON; throws on invalid shape. */
102
+ export declare function parseRecipe(json: string): FieldRecipe;
103
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/recipes/schema.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAS5D,MAAM,MAAM,WAAW,GACnB,WAAW,GACX,MAAM,GACN,QAAQ,GACR,OAAO,GACP,aAAa,GACb,WAAW,GACX,SAAS,GACT,aAAa,GACb,SAAS,CAAC;AAEd,gGAAgG;AAChG,MAAM,MAAM,cAAc,GACtB,eAAe,GACf,UAAU,GACV,WAAW,GACX,QAAQ,GACR,UAAU,GACV,WAAW,GACX,WAAW,GACX,YAAY,CAAC;AAEjB,oFAAoF;AACpF,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC3B;;;iGAG6F;IAC7F,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,I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IACnG,aAAa,EAAE,mBAAmB,CAAC;IACnC,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACpC,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,kDAAkD;AAClD,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC;AAEtC,8CAA8C;AAC9C,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAUD,uGAAuG;AACvG,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,MAAM,CAA4D,CAAC;AA8BzG,yFAAyF;AACzF,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,GAAG,MAAM,EAAE,CAUpE;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,WAAW,GAAG,aAAa,EAAE,CA6C9D;AAED,4CAA4C;AAC5C,wBAAgB,eAAe,CAAC,CAAC,EAAE,WAAW,GAAG,MAAM,CAEtD;AAED,oEAAoE;AACpE,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAKrD"}
@@ -0,0 +1,123 @@
1
+ import { FUNDAMENTAL_FIELDS } from "../config/manual.js";
2
+ import { passportFor } from "../contracts/passport.js";
3
+ /** A render layer in a scene's stack (matter / structure / scalar surfaces). */
4
+ /** The engine's registered condition ids (core/conditions.ts) — the executable `when` gates. */
5
+ import { conditions as ENGINE_CONDITION_REGISTRY } from "../core/conditions.js";
6
+ const ENGINE_CONDITIONS = new Set(Object.keys(ENGINE_CONDITION_REGISTRY));
7
+ const RENDER_LAYERS = new Set([
8
+ 'particles', 'dots', 'trails', 'links', 'streamlines', 'metaballs', 'voronoi', 'field-lines', 'heatmap',
9
+ ]);
10
+ const DIAGNOSTIC_MODES = new Set([
11
+ 'force-vectors', 'contours', 'potential', 'energy', 'topology', 'inspector', 'causality', 'prediction',
12
+ ]);
13
+ /** Every render + diagnostic mode id a recipe may reference (mirrors `RENDER_MODES` + `particles`). */
14
+ export const FIELD_MODES = new Set([...RENDER_LAYERS, ...DIAGNOSTIC_MODES]);
15
+ const VALID_FIELDS = new Set(FUNDAMENTAL_FIELDS);
16
+ const VALID_TIERS = new Set(['core', 'applied', 'systems', 'operational']);
17
+ const VALID_STATUS = new Set(['shipped', 'experimental', 'planned', 'conceptual']);
18
+ /**
19
+ * Well-known words that belong to a DIFFERENT lane than runtime tokens. None of these is a passported
20
+ * force, so they can never be a primitive — this map exists only to turn the generic "unknown token"
21
+ * error into a lane-aware one ("'potential' is a diagnostic, not a runtime token"). Keys must never be
22
+ * real tokens (e.g. `pressure`, `memory`, `gate` are tokens and are deliberately absent here).
23
+ */
24
+ const OTHER_LANE = {
25
+ // diagnostics / render modes
26
+ potential: 'diagnostic', topology: 'diagnostic', causality: 'diagnostic', prediction: 'diagnostic',
27
+ energy: 'diagnostic', contours: 'diagnostic', 'field-lines': 'diagnostic', 'force-vectors': 'diagnostic',
28
+ 'velocity-vectors': 'diagnostic', inspector: 'diagnostic', heatmap: 'diagnostic',
29
+ // metrics
30
+ mass: 'metric', attention: 'metric', confidence: 'metric', trust: 'metric', risk: 'metric',
31
+ coherence: 'metric', entropy: 'metric', recency: 'metric', priority: 'metric', density: 'metric',
32
+ // concepts (product language)
33
+ spring: 'concept', orbit: 'concept', drag: 'concept', reflect: 'concept', absorb: 'concept',
34
+ decay: 'concept', staleness: 'concept', handoff: 'concept', emitter: 'concept', consensus: 'concept',
35
+ // conditions
36
+ threshold: 'condition', dwell: 'condition', stale: 'condition', 'in-view': 'condition',
37
+ focused: 'condition', selected: 'condition', related: 'condition', conflicted: 'condition',
38
+ // scheduler phases
39
+ discover: 'phase', read: 'phase', compute: 'phase', write: 'phase', render: 'phase',
40
+ };
41
+ /** The distinct engine primitives used across a recipe's bodies, in first-seen order. */
42
+ export function primitivesOf(bodies) {
43
+ const seen = new Set();
44
+ const out = [];
45
+ for (const b of bodies ?? [])
46
+ for (const t of (b.body ?? '').split(/\s+/).filter(Boolean))
47
+ if (!seen.has(t)) {
48
+ seen.add(t);
49
+ out.push(t);
50
+ }
51
+ return out;
52
+ }
53
+ /**
54
+ * Validate a recipe's shape and references. Returns every problem (empty = valid). Each force token
55
+ * must be a real, passported force; each render layer + diagnostic must be a known mode; the declared
56
+ * primitives must match the body tokens; the natural field must be one of the four.
57
+ */
58
+ export function validateRecipe(r) {
59
+ const problems = [];
60
+ if (!r.id)
61
+ problems.push({ path: 'id', issue: 'required' });
62
+ if (!r.name)
63
+ problems.push({ path: 'name', issue: 'required' });
64
+ if (!Array.isArray(r.bodies) || r.bodies.length === 0)
65
+ problems.push({ path: 'bodies', issue: 'at least one body is required' });
66
+ (r.bodies ?? []).forEach((b, i) => {
67
+ const tokens = (b.body ?? '').split(/\s+/).filter(Boolean);
68
+ if (tokens.length === 0)
69
+ problems.push({ path: `bodies[${i}].body`, issue: 'empty force token list' });
70
+ for (const t of tokens)
71
+ if (!passportFor(t))
72
+ problems.push({ path: `bodies[${i}].body`, issue: `unknown force token "${t}"` });
73
+ // an executable gate must resolve in the engine's condition registry — an unknown id would
74
+ // gate the body shut forever (the silent-contract-gap class this field exists to prevent).
75
+ if (b.when != null && !ENGINE_CONDITIONS.has(b.when))
76
+ problems.push({ path: `bodies[${i}].when`, issue: `unknown condition id "${b.when}" (registered: ${[...ENGINE_CONDITIONS].join(', ')})` });
77
+ });
78
+ // declared primitives must be exactly the distinct body tokens (no drift between data and bodies).
79
+ const derived = primitivesOf(r.bodies ?? []);
80
+ const declared = r.primitives ?? [];
81
+ if (declared.length !== derived.length || derived.some((t) => !declared.includes(t)) || declared.some((t) => !derived.includes(t)))
82
+ problems.push({ path: 'primitives', issue: `must list exactly the body tokens (expected: ${derived.join(', ') || 'none'})` });
83
+ // cross-lane guard: a primitive must be a real runtime token — never a diagnostic, metric, condition, or concept.
84
+ declared.forEach((p, i) => {
85
+ if (passportFor(p))
86
+ return;
87
+ const lane = OTHER_LANE[p];
88
+ problems.push({
89
+ path: `primitives[${i}]`,
90
+ issue: lane ? `"${p}" is a ${lane}, not a runtime token — move it to ${lane === 'phase' ? 'a scheduler phase' : lane + 's'}` : `unknown runtime token "${p}"`,
91
+ });
92
+ });
93
+ (r.render ?? []).forEach((layer, i) => {
94
+ if (!RENDER_LAYERS.has(layer))
95
+ problems.push({ path: `render[${i}]`, issue: `unknown render layer "${layer}"` });
96
+ });
97
+ (r.diagnostics ?? []).forEach((mode, i) => {
98
+ if (!FIELD_MODES.has(mode))
99
+ problems.push({ path: `diagnostics[${i}]`, issue: `unknown diagnostic mode "${mode}"` });
100
+ });
101
+ if (r.naturalField !== undefined && !VALID_FIELDS.has(r.naturalField))
102
+ problems.push({ path: 'naturalField', issue: `unknown fundamental field "${r.naturalField}"` });
103
+ if (r.tier !== undefined && !VALID_TIERS.has(r.tier))
104
+ problems.push({ path: 'tier', issue: `unknown tier "${r.tier}"` });
105
+ if (r.status !== undefined && !VALID_STATUS.has(r.status))
106
+ problems.push({ path: 'status', issue: `unknown status "${r.status}"` });
107
+ if (!r.accessibility || !r.accessibility.reducedMotion || !r.accessibility.meaningWithoutMotion)
108
+ problems.push({ path: 'accessibility', issue: 'reducedMotion + meaningWithoutMotion are required (no recipe is motion-only)' });
109
+ return problems;
110
+ }
111
+ /** Serialize a recipe to canonical JSON. */
112
+ export function serializeRecipe(r) {
113
+ return JSON.stringify(r, null, 2);
114
+ }
115
+ /** Parse + validate a recipe from JSON; throws on invalid shape. */
116
+ export function parseRecipe(json) {
117
+ const r = JSON.parse(json);
118
+ const problems = validateRecipe(r);
119
+ if (problems.length)
120
+ throw new Error(`invalid recipe: ${problems.map((p) => `${p.path} (${p.issue})`).join('; ')}`);
121
+ return r;
122
+ }
123
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/recipes/schema.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,gFAAgF;AAChF,gGAAgG;AAChG,OAAO,EAAE,UAAU,IAAI,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAChF,MAAM,iBAAiB,GAAwB,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC,CAAC;AAiH/F,MAAM,aAAa,GAAwB,IAAI,GAAG,CAAc;IAC9D,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS;CACxG,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAwB,IAAI,GAAG,CAAiB;IACpE,eAAe,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY;CACvG,CAAC,CAAC;AAEH,uGAAuG;AACvG,MAAM,CAAC,MAAM,WAAW,GAAwB,IAAI,GAAG,CAAS,CAAC,GAAG,aAAa,EAAE,GAAG,gBAAgB,CAAC,CAAC,CAAC;AAEzG,MAAM,YAAY,GAAwB,IAAI,GAAG,CAAS,kBAAkB,CAAC,CAAC;AAC9E,MAAM,WAAW,GAAwB,IAAI,GAAG,CAAa,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC;AAC5G,MAAM,YAAY,GAAwB,IAAI,GAAG,CAAe,CAAC,SAAS,EAAE,cAAc,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC;AAEtH;;;;;GAKG;AACH,MAAM,UAAU,GAAq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,CAAC;IACnC,IAAI,QAAQ,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpH,OAAO,CAAC,CAAC;AACX,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * The Wayfinding Field — two experimental `FieldRecipe`s that turn site navigation chrome into a
3
+ * member of the invisible-fields family: the nav's destinations become bodies, and the engine runs
4
+ * signals-only (`render: []`) to write CSS custom properties back onto the links. Nothing is drawn;
5
+ * the only visible thing is the consequence — destinations surfacing and receding. Progressive
6
+ * enhancement: with the engine off (or under reduced motion) the nav degrades to plain, reachable
7
+ * links with a labelled current state.
8
+ *
9
+ * Two distinct variations — by natural field, and by which wayfinding question they answer
10
+ * (the canonical "where am I / where can I go / where have I been", reading-field §):
11
+ * • Wayfinding Field (gravity) — "where am I, what's adjacent" (present-tense orientation).
12
+ * • Wayfinding Current (electromagnetic) — "where have I been" (the path travelled, the current from home).
13
+ *
14
+ * Both pass `validateRecipe` (real passported tokens, known render layers + diagnostics, primitives =
15
+ * body tokens, a fundamental field, a reduced-motion equivalent). They are kept OUT of the canonical
16
+ * 64-recipe `FIELD_RECIPES` catalog (a locked 4×16 of shipped recipes, cited as such across the
17
+ * papers) and marked `experimental` — they surface on the /recipes hub as a labelled experimental
18
+ * group, not folded into the canon.
19
+ */
20
+ import type { FieldRecipe } from './schema.ts';
21
+ /**
22
+ * Variation 1 — orientation by proximity. The current route is a gravity well; conserved attention
23
+ * brightens the destinations nearest it while the rest recede, and `cohesion` writes back
24
+ * `--field-coherence` so adjacency surfaces. The signature visual is a field-line traced from the
25
+ * wordmark (home) to the current destination.
26
+ */
27
+ export declare const WAYFINDING_FIELD: FieldRecipe;
28
+ /**
29
+ * Variation 2 — the journey. A current propagates from the wordmark (home/source) toward the current
30
+ * route along the nav's structure (`fieldflow`); visited destinations sink matter into a faint wake
31
+ * (the Sink/Accretion model) that `memory` holds across client-side navigation, riding along on the
32
+ * persisted field-root.
33
+ */
34
+ export declare const WAYFINDING_CURRENT: FieldRecipe;
35
+ /** The Wayfinding Field variations — experimental nav-chrome recipes, not part of `FIELD_RECIPES`. */
36
+ export declare const WAYFINDING_RECIPES: readonly FieldRecipe[];
37
+ /** Experimental recipes surfaced on the /recipes hub outside the canonical 64. */
38
+ export declare const EXPERIMENTAL_RECIPES: readonly FieldRecipe[];
39
+ //# sourceMappingURL=wayfinding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wayfinding.d.ts","sourceRoot":"","sources":["../../src/recipes/wayfinding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,WA4B9B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,WA8BhC,CAAC;AAEF,sGAAsG;AACtG,eAAO,MAAM,kBAAkB,EAAE,SAAS,WAAW,EAA2C,CAAC;AAKjG,kFAAkF;AAClF,eAAO,MAAM,oBAAoB,EAAE,SAAS,WAAW,EAItD,CAAC"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Variation 1 — orientation by proximity. The current route is a gravity well; conserved attention
3
+ * brightens the destinations nearest it while the rest recede, and `cohesion` writes back
4
+ * `--field-coherence` so adjacency surfaces. The signature visual is a field-line traced from the
5
+ * wordmark (home) to the current destination.
6
+ */
7
+ export const WAYFINDING_FIELD = {
8
+ id: 'wayfinding-field',
9
+ name: 'Wayfinding Field',
10
+ intent: 'orient the visitor in a navigation bar by surfacing where they are and what is adjacent',
11
+ naturalField: 'gravity',
12
+ status: 'experimental',
13
+ primitives: ['attract', 'tether', 'cohesion'],
14
+ concepts: ['wayfinding', 'orientation'],
15
+ conditions: ['in-view', 'focused'],
16
+ bodies: [
17
+ // the current route is the well — attention (conserved) pools toward it
18
+ { body: 'attract', strength: 1.1, range: 300, feedback: true },
19
+ // related destinations stay bound nearby rather than drifting off
20
+ { body: 'tether', strength: 0.6, range: 240 },
21
+ // coherence to the current route, written back as --field-coherence
22
+ { body: 'cohesion', strength: 0.5, range: 260, feedback: true },
23
+ ],
24
+ render: ['field-lines', 'heatmap'],
25
+ metrics: ['attention', 'coherence', 'priority'],
26
+ diagnostics: ['topology', 'field-lines', 'inspector'],
27
+ accessibility: {
28
+ reducedMotion: 'the current destination holds aria-current with a static underline; link weights stop travelling',
29
+ meaningWithoutMotion: 'links keep reading order and a labelled current state; adjacency reads as a visible grouping',
30
+ },
31
+ notes: 'Applied signals-only (render: []) over the nav: the simulation and feedback run, no canvas is drawn, and the only output is CSS custom properties on the links. The current route is a gravity well; conserved attention brightens the destinations nearest it while the rest recede; cohesion writes --field-coherence so adjacency surfaces. The declared render layers (field-lines, heatmap) are the visual vocabulary when the field is drawn — e.g. a field-line traced wordmark → current destination.',
32
+ };
33
+ /**
34
+ * Variation 2 — the journey. A current propagates from the wordmark (home/source) toward the current
35
+ * route along the nav's structure (`fieldflow`); visited destinations sink matter into a faint wake
36
+ * (the Sink/Accretion model) that `memory` holds across client-side navigation, riding along on the
37
+ * persisted field-root.
38
+ */
39
+ export const WAYFINDING_CURRENT = {
40
+ id: 'wayfinding-current',
41
+ name: 'Wayfinding Current',
42
+ intent: 'trace the path a visitor has travelled and the current flowing from home to where they are',
43
+ naturalField: 'electromagnetic',
44
+ status: 'experimental',
45
+ primitives: ['propagate', 'fieldflow', 'sink', 'memory'],
46
+ concepts: ['wake', 'trail', 'provenance', 'accretion'],
47
+ conditions: ['return', 'related'],
48
+ bodies: [
49
+ // the signal travelling home → current route
50
+ { body: 'propagate', strength: 0.9, range: 360, feedback: true },
51
+ // carries the flow along the nav structure (transport, not a push — range 0)
52
+ { body: 'fieldflow', strength: 0.8, range: 0 },
53
+ // visited destinations sink matter into a wake (Sink/Accretion)
54
+ { body: 'sink', strength: 0.5, range: 240 },
55
+ // memory holds the visited trail across navigation
56
+ { body: 'memory', strength: 0.6, range: 280 },
57
+ ],
58
+ render: ['streamlines', 'heatmap', 'field-lines'],
59
+ metrics: ['signal', 'recency', 'memory'],
60
+ diagnostics: ['causality', 'field-lines', 'inspector'],
61
+ accessibility: {
62
+ reducedMotion: 'visited destinations get a static "seen" tick and the path reads as a breadcrumb — no travelling current',
63
+ meaningWithoutMotion: 'the journey is a breadcrumb list home → current; visited links are labelled seen',
64
+ },
65
+ notes: 'Applied signals-only over the nav. A current propagates from the wordmark (home/source) toward the current route along the nav structure (fieldflow carries, it does not push); visited destinations sink matter into a faint wake that memory holds across client-side navigation, riding on the persisted field-root. The declared render layers (streamlines, heatmap, field-lines) are the visual vocabulary when drawn.',
66
+ };
67
+ /** The Wayfinding Field variations — experimental nav-chrome recipes, not part of `FIELD_RECIPES`. */
68
+ export const WAYFINDING_RECIPES = [WAYFINDING_FIELD, WAYFINDING_CURRENT];
69
+ import { CHARGE_RECIPES } from "./charge.js";
70
+ import { GRAVITY_RECIPES } from "./gravity.js";
71
+ /** Experimental recipes surfaced on the /recipes hub outside the canonical 64. */
72
+ export const EXPERIMENTAL_RECIPES = [
73
+ ...WAYFINDING_RECIPES,
74
+ ...CHARGE_RECIPES,
75
+ ...GRAVITY_RECIPES,
76
+ ];
77
+ //# sourceMappingURL=wayfinding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wayfinding.js","sourceRoot":"","sources":["../../src/recipes/wayfinding.ts"],"names":[],"mappings":"AAqBA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAgB;IAC3C,EAAE,EAAE,kBAAkB;IACtB,IAAI,EAAE,kBAAkB;IACxB,MAAM,EAAE,yFAAyF;IACjG,YAAY,EAAE,SAAS;IACvB,MAAM,EAAE,cAAc;IACtB,UAAU,EAAE,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AI,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE;QAChE,6EAA6E;QAC7E,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE;QAC9C,gEAAgE;QAChE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE;QAC3C,mDAAmD;QACnD,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE;KAC9C;IACD,MAAM,EAAE,CAAC,aAAa,EAAE,SAAS,EAAE,aAAa,CAAC;IACjD,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC;IACxC,WAAW,EAAE,CAAC,WAAW,EAAE,aAAa,EAAE,WAAW,CAAC;IACtD,aAAa,EAAE;QACb,aAAa,EACX,0GAA0G;QAC5G,oBAAoB,EAClB,kFAAkF;KACrF;IACD,KAAK,EACH,8ZAA8Z;CACja,CAAC;AAEF,sGAAsG;AACtG,MAAM,CAAC,MAAM,kBAAkB,GAA2B,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC;AAEjG,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,kFAAkF;AAClF,MAAM,CAAC,MAAM,oBAAoB,GAA2B;IAC1D,GAAG,kBAAkB;IACrB,GAAG,cAAc;IACjB,GAAG,eAAe;CACnB,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The semantic layer (BA2 — definition §11 "semantic truth", interaction §15/§23/§24). Maps
3
+ * interface *meaning* to field behavior: semantic layers (meaning→metric), interaction materials
4
+ * (feel→force composition), and field states (state→field behavior). Pure data + helpers — the
5
+ * "semantic truth" mode made concrete.
6
+ */
7
+ import type { ContractMeta } from '../contracts/types.ts';
8
+ export * from './layers.ts';
9
+ export * from './materials.ts';
10
+ export * from './states.ts';
11
+ /** The semantic-mapping contracts (truth mode: semantic). */
12
+ export declare const SEMANTIC_CONTRACTS: readonly ContractMeta[];
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/semantic/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAE5B,6DAA6D;AAC7D,eAAO,MAAM,kBAAkB,EAAE,SAAS,YAAY,EAyBrD,CAAC"}
@@ -0,0 +1,31 @@
1
+ export * from "./layers.js";
2
+ export * from "./materials.js";
3
+ export * from "./states.js";
4
+ /** The semantic-mapping contracts (truth mode: semantic). */
5
+ export const SEMANTIC_CONTRACTS = [
6
+ {
7
+ name: 'Semantic Layer Contract',
8
+ mustExist: 'a mapping from a meaning (importance, confidence, urgency…) to a field metric',
9
+ mayMutate: 'nothing — it produces a metric contribution the agent layer applies',
10
+ sideEffectFree: 'semanticToMetrics is pure',
11
+ testable: 'each layer maps to a real metric; values clamp to [0,1]',
12
+ inspectable: 'the SEMANTIC_LAYERS table',
13
+ },
14
+ {
15
+ name: 'Interaction Material Contract',
16
+ mustExist: 'a material → real force-token composition (feel built from behavior)',
17
+ mayMutate: 'nothing — it yields a data-body token string',
18
+ sideEffectFree: 'materialBody is pure',
19
+ testable: 'every material references real, passported forces',
20
+ inspectable: 'the INTERACTION_MATERIALS table',
21
+ },
22
+ {
23
+ name: 'Field State Contract',
24
+ mustExist: 'a named field state → the field behavior it implies',
25
+ mayMutate: 'nothing — it describes behavior',
26
+ sideEffectFree: 'isFieldState is pure',
27
+ testable: 'every state declares a behavior',
28
+ inspectable: 'the FIELD_STATES table',
29
+ },
30
+ ];
31
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/semantic/index.ts"],"names":[],"mappings":"AAQA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAE5B,6DAA6D;AAC7D,MAAM,CAAC,MAAM,kBAAkB,GAA4B;IACzD;QACE,IAAI,EAAE,yBAAyB;QAC/B,SAAS,EAAE,+EAA+E;QAC1F,SAAS,EAAE,qEAAqE;QAChF,cAAc,EAAE,2BAA2B;QAC3C,QAAQ,EAAE,yDAAyD;QACnE,WAAW,EAAE,2BAA2B;KACzC;IACD;QACE,IAAI,EAAE,+BAA+B;QACrC,SAAS,EAAE,sEAAsE;QACjF,SAAS,EAAE,8CAA8C;QACzD,cAAc,EAAE,sBAAsB;QACtC,QAAQ,EAAE,mDAAmD;QAC7D,WAAW,EAAE,iCAAiC;KAC/C;IACD;QACE,IAAI,EAAE,sBAAsB;QAC5B,SAAS,EAAE,qDAAqD;QAChE,SAAS,EAAE,iCAAiC;QAC5C,cAAc,EAAE,sBAAsB;QACtC,QAAQ,EAAE,iCAAiC;QAC3C,WAAW,EAAE,wBAAwB;KACtC;CACF,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Semantic layers (definition §11, worldclass §8, visual §15, interaction §15) — the
3
+ * meaning→metric mapping that the "semantic truth" mode is about. It maps a piece of interface
4
+ * meaning (importance, confidence, urgency…) to the field metric that expresses it, so authors can
5
+ * drive the field from semantics instead of raw forces. Pure data + a tiny helper; node-testable.
6
+ */
7
+ import type { ElementMetrics } from '../agents/element-agent.ts';
8
+ export type SemanticLayer = 'importance' | 'confidence' | 'uncertainty' | 'urgency' | 'relationship' | 'history' | 'status' | 'hierarchy' | 'interactivity' | 'recency' | 'priority';
9
+ /** Each semantic layer's target field metric (a key of ElementMetrics, or a conceptual one). */
10
+ export interface SemanticMapping {
11
+ /** the metric this meaning drives. */
12
+ metric: keyof ElementMetrics | 'phase' | 'potential';
13
+ /** how it reads visually / behaviorally. */
14
+ response: string;
15
+ }
16
+ /** meaning → field metric (definition §11 / interaction §15 DataAgent merged). */
17
+ export declare const SEMANTIC_LAYERS: Readonly<Record<SemanticLayer, SemanticMapping>>;
18
+ /**
19
+ * Convert a semantic value (0..1) into the `ElementMetrics` contribution it implies, for the layers
20
+ * whose target metric is a real ElementMetric (status→phase and hierarchy→potential are conceptual
21
+ * and returned as `{}`). Pure.
22
+ */
23
+ export declare function semanticToMetrics(layer: SemanticLayer, value: number): ElementMetrics;
24
+ //# sourceMappingURL=layers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layers.d.ts","sourceRoot":"","sources":["../../src/semantic/layers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,MAAM,MAAM,aAAa,GACrB,YAAY,GACZ,YAAY,GACZ,aAAa,GACb,SAAS,GACT,cAAc,GACd,SAAS,GACT,QAAQ,GACR,WAAW,GACX,eAAe,GACf,SAAS,GACT,UAAU,CAAC;AAEf,gGAAgG;AAChG,MAAM,WAAW,eAAe;IAC9B,sCAAsC;IACtC,MAAM,EAAE,MAAM,cAAc,GAAG,OAAO,GAAG,WAAW,CAAC;IACrD,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,kFAAkF;AAClF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,aAAa,EAAE,eAAe,CAAC,CAY5E,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,GAAG,cAAc,CAKrF"}
@@ -0,0 +1,27 @@
1
+ /** meaning → field metric (definition §11 / interaction §15 DataAgent merged). */
2
+ export const SEMANTIC_LAYERS = {
3
+ importance: { metric: 'attention', response: 'strength / attention, stronger presence' },
4
+ confidence: { metric: 'coherence', response: 'cleaner tone, stable hue, clarity' },
5
+ uncertainty: { metric: 'entropy', response: 'disorder, desaturation, blur' },
6
+ urgency: { metric: 'heat', response: 'warmer hue, higher glow' },
7
+ relationship: { metric: 'memory', response: 'topology links / threads' },
8
+ history: { metric: 'memory', response: 'patina, persistent tint, worn paths' },
9
+ status: { metric: 'phase', response: 'material phase (gas/liquid/solid/plasma)' },
10
+ hierarchy: { metric: 'pressure', response: 'potential / rank / depth' },
11
+ interactivity: { metric: 'density', response: 'feedback gain' },
12
+ recency: { metric: 'heat', response: 'recent = hot, cooling over time' },
13
+ priority: { metric: 'attention', response: 'attention share' },
14
+ };
15
+ /**
16
+ * Convert a semantic value (0..1) into the `ElementMetrics` contribution it implies, for the layers
17
+ * whose target metric is a real ElementMetric (status→phase and hierarchy→potential are conceptual
18
+ * and returned as `{}`). Pure.
19
+ */
20
+ export function semanticToMetrics(layer, value) {
21
+ const m = SEMANTIC_LAYERS[layer];
22
+ const v = value < 0 ? 0 : value > 1 ? 1 : value;
23
+ if (m.metric === 'phase' || m.metric === 'potential')
24
+ return {};
25
+ return { [m.metric]: v };
26
+ }
27
+ //# sourceMappingURL=layers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layers.js","sourceRoot":"","sources":["../../src/semantic/layers.ts"],"names":[],"mappings":"AA6BA,kFAAkF;AAClF,MAAM,CAAC,MAAM,eAAe,GAAqD;IAC/E,UAAU,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,yCAAyC,EAAE;IACxF,UAAU,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,mCAAmC,EAAE;IAClF,WAAW,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,8BAA8B,EAAE;IAC5E,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,yBAAyB,EAAE;IAChE,YAAY,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,0BAA0B,EAAE;IACxE,OAAO,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,qCAAqC,EAAE;IAC9E,MAAM,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,0CAA0C,EAAE;IACjF,SAAS,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,0BAA0B,EAAE;IACvE,aAAa,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,eAAe,EAAE;IAC/D,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,iCAAiC,EAAE;IACxE,QAAQ,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,iBAAiB,EAAE;CAC/D,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAoB,EAAE,KAAa;IACnE,MAAM,CAAC,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IACjC,MAAM,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAChD,IAAI,CAAC,CAAC,MAAM,KAAK,OAAO,IAAI,CAAC,CAAC,MAAM,KAAK,WAAW;QAAE,OAAO,EAAE,CAAC;IAChE,OAAO,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,EAAoB,CAAC;AAC7C,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Interaction materials (interaction §24, visual §11). Forces define behavior; materials define
3
+ * *feel*. Each material is a named composition of real force tokens (current names — viscosity, not
4
+ * drag; wall, not reflect) plus a suggested render layer. Validated against the passport registry
5
+ * by the test, so a material can't reference a force that doesn't exist.
6
+ */
7
+ import type { RenderLayer } from '../recipes/schema.ts';
8
+ export type InteractionMaterial = 'glass' | 'rubber' | 'liquid' | 'plasma' | 'dust' | 'metal' | 'fabric' | 'paper' | 'stone' | 'smoke';
9
+ export interface MaterialRecipe {
10
+ /** force tokens that give the material its feel. */
11
+ tokens: string[];
12
+ /** render layers that suit it. */
13
+ render?: RenderLayer[];
14
+ /** the doc's plain description. */
15
+ note: string;
16
+ }
17
+ export declare const INTERACTION_MATERIALS: Readonly<Record<InteractionMaterial, MaterialRecipe>>;
18
+ /** The `data-body` token string for a material. */
19
+ export declare function materialBody(material: InteractionMaterial): string;
20
+ //# sourceMappingURL=materials.d.ts.map