@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,40 @@
1
+ /**
2
+ * RelationshipAgent (system-contracts §7) — an active connection between two bodies. It is not
3
+ * merely a rendered line: it carries strength, tension, and memory; it strengthens with use and
4
+ * decays over time; it can transfer attention and emit thresholded events.
5
+ *
6
+ * The dynamics here are pure (plain state + dt), so they are deterministic and node-testable. The
7
+ * rendering (a line, a current) and the DOM event dispatch live in the field loop / feedback layer.
8
+ */
9
+ import { Thresholder } from "./event-agent.js";
10
+ export const DEFAULT_RELATIONSHIP_DYNAMICS = {
11
+ strengthen: 1.5,
12
+ decay: 0.3,
13
+ remember: 0.2,
14
+ };
15
+ const clamp01 = (n) => (n < 0 ? 0 : n > 1 ? 1 : n);
16
+ /**
17
+ * Advance a relationship one step. `active` is whether it was exercised this tick (a click, a
18
+ * traversal, attention flowing across it); `tension` is the current strain. Strengthens toward 1
19
+ * while active, decays toward 0 while idle, and memory follows more slowly — so a long-used
20
+ * relationship stays warm after a pause, while a one-off fades.
21
+ */
22
+ export function updateRelationship(r, active, tension, dt, dyn = DEFAULT_RELATIONSHIP_DYNAMICS) {
23
+ r.active = active;
24
+ r.tension = clamp01(tension);
25
+ r.strength = clamp01(r.strength + (active ? dyn.strengthen : -dyn.decay) * dt);
26
+ r.memory = clamp01(r.memory + (active ? dyn.remember : -dyn.remember * 0.5) * dt);
27
+ }
28
+ /**
29
+ * Attention transferred across a relationship: a fraction of the source body's attention flows to
30
+ * the target, scaled by the live strength. Pure — returns the amount to add at `to` and remove at
31
+ * `from` (the caller applies it, conserving the budget).
32
+ */
33
+ export function attentionTransfer(r, fromAttention, rate = 0.25) {
34
+ return fromAttention * r.strength * rate;
35
+ }
36
+ /** Build a watched relationship with a sensible strengthen/weaken threshold. */
37
+ export function watchRelationship(agent, debounceMs = 400) {
38
+ return { agent, threshold: new Thresholder({ enter: 0.6, exit: 0.3, debounceMs }) };
39
+ }
40
+ //# sourceMappingURL=relationship.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relationship.js","sourceRoot":"","sources":["../../src/agents/relationship.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AA4B/C,MAAM,CAAC,MAAM,6BAA6B,GAAyB;IACjE,UAAU,EAAE,GAAG;IACf,KAAK,EAAE,GAAG;IACV,QAAQ,EAAE,GAAG;CACd,CAAC;AAEF,MAAM,OAAO,GAAG,CAAC,CAAS,EAAU,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as field participation. The pointer is a wake, the
3
+ * focused element a first-class attention source, the selection a capture, scroll a current. It
4
+ * must respect reduced motion, keyboard accessibility, pointer absence, and touch.
5
+ *
6
+ * Pure state + update so it is node-testable; the engine feeds it raw input and reads the resulting
7
+ * field source. Under reduced motion, travel-heavy response is suppressed: the pointer wake stops
8
+ * but focus still produces an accessible (static) attention source.
9
+ */
10
+ export interface UserAgentState {
11
+ /** pointer position in field space; null when the pointer is absent. */
12
+ px: number | null;
13
+ py: number | null;
14
+ /** pointer velocity (px/tick), eased. */
15
+ vx: number;
16
+ vy: number;
17
+ /** id of the focused body, or null. */
18
+ focusId: string | null;
19
+ /** id of the selected/captured body, or null. */
20
+ selectionId: string | null;
21
+ /** eased scroll speed (a current). */
22
+ scrollV: number;
23
+ /** honor prefers-reduced-motion — suppress travel-heavy response. */
24
+ reducedMotion: boolean;
25
+ }
26
+ export declare function createUserAgent(reducedMotion?: boolean): UserAgentState;
27
+ export interface UserInput {
28
+ pointer?: {
29
+ x: number;
30
+ y: number;
31
+ } | null;
32
+ focusId?: string | null;
33
+ selectionId?: string | null;
34
+ scrollV?: number;
35
+ }
36
+ /** Advance the UserAgent from one input frame. Pure (mutates and returns the state). */
37
+ export declare function updateUserAgent(u: UserAgentState, input: UserInput, ease_k?: number): UserAgentState;
38
+ /**
39
+ * The field source the UserAgent projects, after accessibility gating. Under reduced motion the
40
+ * pointer wake (a moving source) is dropped, but a focused element still yields a static attention
41
+ * source — so meaning survives without motion (the §8 / Accessibility Contract rule).
42
+ */
43
+ export interface UserFieldSource {
44
+ /** a moving pointer wake, if active and motion is allowed. */
45
+ wake: {
46
+ x: number;
47
+ y: number;
48
+ vx: number;
49
+ vy: number;
50
+ } | null;
51
+ /** an accessible attention source from focus (present even under reduced motion). */
52
+ focus: string | null;
53
+ /** a capture from selection. */
54
+ capture: string | null;
55
+ }
56
+ export declare function userFieldSource(u: UserAgentState): UserFieldSource;
57
+ //# sourceMappingURL=user-agent.d.ts.map
@@ -0,0 +1 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rB,gCAAgC;IAChC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,cAAc,GAAG,eAAe,CAOlE"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * UserAgent (system-contracts §8) — user input as field participation. The pointer is a wake, the
3
+ * focused element a first-class attention source, the selection a capture, scroll a current. It
4
+ * must respect reduced motion, keyboard accessibility, pointer absence, and touch.
5
+ *
6
+ * Pure state + update so it is node-testable; the engine feeds it raw input and reads the resulting
7
+ * field source. Under reduced motion, travel-heavy response is suppressed: the pointer wake stops
8
+ * but focus still produces an accessible (static) attention source.
9
+ */
10
+ export function createUserAgent(reducedMotion = false) {
11
+ return { px: null, py: null, vx: 0, vy: 0, focusId: null, selectionId: null, scrollV: 0, reducedMotion };
12
+ }
13
+ const ease = (cur, next, k) => cur + (next - cur) * k;
14
+ /** Advance the UserAgent from one input frame. Pure (mutates and returns the state). */
15
+ export function updateUserAgent(u, input, ease_k = 0.3) {
16
+ if ('pointer' in input) {
17
+ const p = input.pointer ?? null;
18
+ if (p && u.px != null && u.py != null) {
19
+ u.vx = ease(u.vx, p.x - u.px, ease_k);
20
+ u.vy = ease(u.vy, p.y - u.py, ease_k);
21
+ }
22
+ else {
23
+ u.vx = 0;
24
+ u.vy = 0;
25
+ }
26
+ u.px = p ? p.x : null;
27
+ u.py = p ? p.y : null;
28
+ }
29
+ if ('focusId' in input)
30
+ u.focusId = input.focusId ?? null;
31
+ if ('selectionId' in input)
32
+ u.selectionId = input.selectionId ?? null;
33
+ if (input.scrollV != null)
34
+ u.scrollV = ease(u.scrollV, input.scrollV, ease_k);
35
+ return u;
36
+ }
37
+ export function userFieldSource(u) {
38
+ const moving = u.px != null && u.py != null && (Math.abs(u.vx) > 0.01 || Math.abs(u.vy) > 0.01);
39
+ return {
40
+ wake: !u.reducedMotion && moving ? { x: u.px, y: u.py, vx: u.vx, vy: u.vy } : null,
41
+ focus: u.focusId,
42
+ capture: u.sel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CAAC"}
@@ -0,0 +1,101 @@
1
+ /**
2
+ * The canonical catalog — the single source of truth.
3
+ *
4
+ * Lifted from the prototype's `ds-data.js` (`DS_FORCES` / `DS_FORMATIONS` /
5
+ * `DS_CONDITIONS`), which the design treats as the authority. Force identity
6
+ * **colors are canonical**; disciplines inherit their mapped force's color.
7
+ * See `docs/engine-reference/forces-system.md` §6 (forces), §7 (formations), §5 (conditions),
8
+ * §15 (disciplines).
9
+ *
10
+ * This is the *designed* nine (the implemented prototype set). Extended,
11
+ * physical, and cosmology forces (§20) live in their own modules once built.
12
+ */
13
+ import type { Formation } from '../core/types.ts';
14
+ /** The canonical nine force ids (the implemented set). */
15
+ export type ForceId = 'attract' | 'jet' | 'tether' | 'wall' | 'stream' | 'repel' | 'viscosity' | 'swirl' | 'sink';
16
+ export interface ForceDef {
17
+ id: ForceId;
18
+ name: string;
19
+ /** canonical identity color (the authority). */
20
+ color: string;
21
+ /** plain-language gloss. */
22
+ does: string;
23
+ /** the discipline this force maps to (§15). */
24
+ discipline: string;
25
+ /** the verb shown on the discipline card. */
26
+ verb: string;
27
+ /** the engine `data-body` tokens that realize it. */
28
+ body: string;
29
+ /** default authoring attributes. */
30
+ attrs: Record<string, string>;
31
+ /** one-line law (see the falloff-accuracy note, §6 — "inverse-square" here
32
+ * is the prototype's metaphor; the engine falloff is bounded `(1−d/d_max)ⁿ`,
33
+ * the true `1/d²` law is the `gravity` primitive, §20.10). */
34
+ law: string;
35
+ }
36
+ export declare const FORCES: readonly ForceDef[];
37
+ export declare const FORCE_BY: Readonly<Record<ForceId, ForceDef>>;
38
+ /** The canonical palette, in force order. Wave/Currents and the accent journey
39
+ * draw from this — never a separate constant (§24.4). */
40
+ export declare const PALETTE: readonly string[];
41
+ /** The site scroll accent journey (§9). */
42
+ export declare const ACCENT_JOURNEY: readonly string[];
43
+ /** A `data-body` token's application class. */
44
+ export type BodyTokenKind = 'modifier' | 'force' | 'source';
45
+ /** Modifier tokens in their formalized application order (`spotlight → screen → resonate`).
46
+ * The order is part of the contract: authoring `data-body="resonate spotlight attract"`
47
+ * evaluates the modifiers in THIS order, not authored order. (Today's modifiers compose
48
+ * commutatively — gates OR, strength multipliers multiply — so the formalization changes
49
+ * no existing behavior; it pins the contract for modifiers where order will matter.) */
50
+ export declare const MODIFIER_ORDER: readonly string[];
51
+ /** Class-[S] source tokens — they CREATE matter and must be budgeted: every [S] body
52
+ * declares at least one of `data-life` / `data-cap` / `data-budget` / `data-sink`,
53
+ * or the scanner's dev guard warns and applies {@link SOURCE_DEFAULT_LIFE} /
54
+ * {@link SOURCE_DEFAULT_CAP} (workover §"Source and sink rules"). */
55
+ export declare const SOURCE_TOKENS: readonly string[];
56
+ /** The safe default budget the source guard applies to an unbudgeted [S] body:
57
+ * each emitted particle lives this many frames (`data-life="300"`). */
58
+ export declare const SOURCE_DEFAULT_LIFE = 300;
59
+ /** …and the body sustains at most this many live particles (`data-cap="120"`);
60
+ * the emission rate is clamped to `cap / life` per frame. */
61
+ export declare const SOURCE_DEFAULT_CAP = 120;
62
+ /** Classify one `data-body` token (unknown tokens are plain forces). */
63
+ export declare function classifyBodyToken(token: string): BodyTokenKind;
64
+ /** A body's tokens split into the three application classes (workover §"Modifier contract"). */
65
+ export interface ClassifiedTokens {
66
+ /** modifier tokens, sorted into the formalized order (`spotlight → screen → resonate`). */
67
+ modifiers: string[];
68
+ /** core force tokens (including unknown tokens — unchanged behavior), authored order. */
69
+ forces: string[];
70
+ /** class-[S] source tokens, authored order. */
71
+ sources: string[];
72
+ }
73
+ /** Split a body's tokens into `{ modifiers, forces, sources }`. Pure; preserves authored
74
+ * order within each class except modifiers, which sort into {@link MODIFIER_ORDER}. */
75
+ export declare function classifyBodyTokens(tokens: readonly string[]): ClassifiedTokens;
76
+ export type FormationId = 'ambient' | 'wells' | 'lanes' | 'scatter' | 'accretion';
77
+ export interface FormationDef {
78
+ id: FormationId;
79
+ name: string;
80
+ /** the page section it backs (the journey, §7.1). */
81
+ section: string;
82
+ color: string;
83
+ cue: string;
84
+ /** the numeric bias preset applied to every free particle (`FORMS`). */
85
+ preset: Formation;
86
+ }
87
+ export declare const FORMATIONS: readonly FormationDef[];
88
+ export declare const FORMATION_BY: Readonly<Record<FormationId, FormationDef>>;
89
+ /** Section → formation mapping for the scroll journey (§7.1, `SECTION_FORM`). */
90
+ export declare const SECTION_FORM: Readonly<Record<string, FormationId>>;
91
+ export type ConditionId = '' | 'active' | 'fast' | 'slow' | 'hot' | 'cool' | 'scrolling';
92
+ export interface ConditionDef {
93
+ id: ConditionId;
94
+ name: string;
95
+ desc: string;
96
+ /** selective gates read each particle (act only on free agents, §5). */
97
+ selective: boolean;
98
+ }
99
+ export declare const CONDITIONS: readonly ConditionDef[];
100
+ export declare const CONDITION_BY: Readonly<Record<ConditionId, ConditionDef>>;
101
+ //# sourceMappingURL=forces.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forces.config.d.ts","sourceRoot":"","sources":["../../src/config/forces.config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,0DAA0D;AAC1D,MAAM,MAAM,OAAO,GACf,SAAS,GACT,KAAK,GACL,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,OAAO,GACP,WAAW,GACX,OAAO,GACP,MAAM,CAAC;AAEX,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,UAAU,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IA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IACb,qDAAqD;IACrD,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,wEAAwE;IACxE,MAAM,EAAE,SAAS,CAAC;CACnB;AAED,eAAO,MAAM,UAAU,EAAE,SAAS,YAAY,EAyCpC,CAAC;AAEX,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,YAAY,CAAC,CAIlE,CAAC;AAEJ,iFAAiF;AACjF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAM9D,CAAC;AAIF,MAAM,MAAM,WAAW,GACnB,EAAE,GACF,QAAQ,GACR,MAAM,GACN,MAAM,GACN,KAAK,GACL,MAAM,GACN,WAAW,CAAC;AAEhB,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,WAAW,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,UAAU,EAAE,SAAS,YAAY,EAQpC,CAAC;AAEX,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,YAAY,CAAC,CAIlE,CAAC"}
@@ -0,0 +1,239 @@
1
+ /**
2
+ * The canonical catalog — the single source of truth.
3
+ *
4
+ * Lifted from the prototype's `ds-data.js` (`DS_FORCES` / `DS_FORMATIONS` /
5
+ * `DS_CONDITIONS`), which the design treats as the authority. Force identity
6
+ * **colors are canonical**; disciplines inherit their mapped force's color.
7
+ * See `docs/engine-reference/forces-system.md` §6 (forces), §7 (formations), §5 (conditions),
8
+ * §15 (disciplines).
9
+ *
10
+ * This is the *designed* nine (the implemented prototype set). Extended,
11
+ * physical, and cosmology forces (§20) live in their own modules once built.
12
+ */
13
+ export const FORCES = [
14
+ {
15
+ id: 'attract',
16
+ name: 'Attract',
17
+ color: '#4da3ff',
18
+ does: 'Pulls matter into a well',
19
+ discipline: 'Product strategy',
20
+ verb: 'gives direction',
21
+ body: 'attract',
22
+ attrs: { 'data-strength': '1', 'data-range': '300' },
23
+ law: 'a soft gravity-like well, bent into a spiral',
24
+ },
25
+ {
26
+ id: 'jet',
27
+ name: 'Jet',
28
+ color: '#a78bfa',
29
+ does: 'Draws matter in, jets it out',
30
+ discipline: 'AI systems',
31
+ verb: 'adapts response',
32
+ body: 'jet',
33
+ attrs: { 'data-angle': '0', 'data-strength': '1', 'data-range': '300' },
34
+ law: 'recycles the field into a stream',
35
+ },
36
+ {
37
+ id: 'tether',
38
+ name: 'Tether',
39
+ color: '#86e57f',
40
+ does: 'Tethers matter to a radius',
41
+ discipline: 'Software architecture',
42
+ verb: 'gives structure',
43
+ body: 'tether',
44
+ attrs: { 'data-strength': '1', 'data-range': '260' },
45
+ law: 'a rest length — a leash, not a drain',
46
+ },
47
+ {
48
+ id: 'wall',
49
+ name: 'Wall',
50
+ color: '#c4b5fd',
51
+ does: 'A surface that bounces — throws sparks',
52
+ discipline: 'Experience design',
53
+ verb: 'the human surface',
54
+ body: 'wall',
55
+ attrs: {},
56
+ law: 'elastic bounce off the bounding box',
57
+ },
58
+ {
59
+ id: 'stream',
60
+ name: 'Stream',
61
+ color: '#7dd3fc',
62
+ does: 'Blows a directional current',
63
+ discipline: 'Motion',
64
+ verb: 'reveals motion',
65
+ body: 'stream',
66
+ attrs: { 'data-angle': '0', 'data-strength': '1', 'data-range': '340' },
67
+ law: 'constant force along a heading',
68
+ },
69
+ {
70
+ id: 'repel',
71
+ name: 'Repel',
72
+ color: '#ff9d5c',
73
+ does: 'Pushes matter away',
74
+ discipline: 'Commerce',
75
+ verb: 'market pressure',
76
+ body: 'repel',
77
+ attrs: { 'data-strength': '1.1', 'data-range': '300' },
78
+ law: 'inverted well — carves a clean void',
79
+ },
80
+ {
81
+ id: 'viscosity',
82
+ name: 'Viscosity',
83
+ color: '#8da2c0',
84
+ does: 'Thickens the medium',
85
+ discipline: 'Physical production',
86
+ verb: 'adds constraint',
87
+ body: 'viscosity',
88
+ attrs: { 'data-strength': '1', 'data-range': '300' },
89
+ law: 'viscosity — bleeds momentum off',
90
+ },
91
+ {
92
+ id: 'swirl',
93
+ name: 'Swirl',
94
+ color: '#2dd4bf',
95
+ does: 'Spins matter into a swirl',
96
+ discipline: 'Creative technology',
97
+ verb: 'spins it together',
98
+ body: 'swirl',
99
+ attrs: { 'data-spin': '1', 'data-strength': '1', 'data-range': '320' },
100
+ law: 'tangential force — circles, never collapses',
101
+ },
102
+ {
103
+ id: 'sink',
104
+ name: 'Sink',
105
+ color: '#ff6e9c',
106
+ does: 'Swallows matter, then pops',
107
+ discipline: 'Attention',
108
+ verb: 'holds, then releases',
109
+ body: 'sink attract',
110
+ // §21.2 naming: the sink's captured count is `b.accreted` (was `b.mass`), its
111
+ // limit is `capacity` (was `maxMass`), and the CSS fill var is `--load` (alias
112
+ // `--mass`). `data-max` is the authoring alias for capacity.
113
+ attrs: {
114
+ 'data-absorb': '64',
115
+ 'data-max': '30',
116
+ 'data-strength': '0.8',
117
+ 'data-range': '360',
118
+ },
119
+ law: 'accretion, then supernova',
120
+ },
121
+ ];
122
+ export const FORCE_BY = Object.fromEntries(FORCES.map((f) => [f.id, f]));
123
+ /** The canonical palette, in force order. Wave/Currents and the accent journey
124
+ * draw from this — never a separate constant (§24.4). */
125
+ export const PALETTE = FORCES.map((f) => f.color);
126
+ /** The site scroll accent journey (§9). */
127
+ export const ACCENT_JOURNEY = [
128
+ '#4da3ff',
129
+ '#2dd4bf',
130
+ '#a78bfa',
131
+ '#ff6e9c',
132
+ '#ff9d5c',
133
+ ];
134
+ /** Modifier tokens in their formalized application order (`spotlight → screen → resonate`).
135
+ * The order is part of the contract: authoring `data-body="resonate spotlight attract"`
136
+ * evaluates the modifiers in THIS order, not authored order. (Today's modifiers compose
137
+ * commutatively — gates OR, strength multipliers multiply — so the formalization changes
138
+ * no existing behavior; it pins the contract for modifiers where order will matter.) */
139
+ export const MODIFIER_ORDER = ['spotlight', 'screen', 'resonate'];
140
+ /** Class-[S] source tokens — they CREATE matter and must be budgeted: every [S] body
141
+ * declares at least one of `data-life` / `data-cap` / `data-budget` / `data-sink`,
142
+ * or the scanner's dev guard warns and applies {@link SOURCE_DEFAULT_LIFE} /
143
+ * {@link SOURCE_DEFAULT_CAP} (workover §"Source and sink rules"). */
144
+ export const SOURCE_TOKENS = ['spawn'];
145
+ /** The safe default budget the source guard applies to an unbudgeted [S] body:
146
+ * each emitted particle lives this many frames (`data-life="300"`). */
147
+ export const SOURCE_DEFAULT_LIFE = 300;
148
+ /** …and the body sustains at most this many live particles (`data-cap="120"`);
149
+ * the emission rate is clamped to `cap / life` per frame. */
150
+ export const SOURCE_DEFAULT_CAP = 120;
151
+ /** Classify one `data-body` token (unknown tokens are plain forces). */
152
+ export function classifyBodyToken(token) {
153
+ if (MODIFIER_ORDER.includes(token))
154
+ return 'modifier';
155
+ if (SOURCE_TOKENS.includes(token))
156
+ return 'source';
157
+ return 'force';
158
+ }
159
+ /** Split a body's tokens into `{ modifiers, forces, sources }`. Pure; preserves authored
160
+ * order within each class except modifiers, which sort into {@link MODIFIER_ORDER}. */
161
+ export function classifyBodyTokens(tokens) {
162
+ const modifiers = [];
163
+ const forces = [];
164
+ const sources = [];
165
+ for (const t of tokens) {
166
+ const kind = classifyBodyToken(t);
167
+ if (kind === 'modifier')
168
+ modifiers.push(t);
169
+ else if (kind === 'source')
170
+ sources.push(t);
171
+ else
172
+ forces.push(t);
173
+ }
174
+ if (modifiers.length > 1)
175
+ modifiers.sort((a, b) => MODIFIER_ORDER.indexOf(a) - MODIFIER_ORDER.indexOf(b));
176
+ return { modifiers, forces, sources };
177
+ }
178
+ export const FORMATIONS = [
179
+ {
180
+ id: 'ambient',
181
+ name: 'Ambient',
182
+ section: 'Hero',
183
+ color: '#4da3ff',
184
+ cue: 'resting drift',
185
+ preset: { driftX: 0, wander: 1.0, orbit: 0.1, spread: 0, conv: 0 },
186
+ },
187
+ {
188
+ id: 'wells',
189
+ name: 'Wells',
190
+ section: 'Work',
191
+ color: '#2dd4bf',
192
+ cue: 'matter pools',
193
+ preset: { driftX: 0, wander: 0.7, orbit: 0.85, spread: 0, conv: 0 },
194
+ },
195
+ {
196
+ id: 'lanes',
197
+ name: 'Lanes',
198
+ section: 'Writing',
199
+ color: '#ff9d5c',
200
+ cue: 'a current carries',
201
+ preset: { driftX: 0.55, wander: 0.5, orbit: 0, spread: 0, conv: 0 },
202
+ },
203
+ {
204
+ id: 'scatter',
205
+ name: 'Scatter',
206
+ section: 'Practice',
207
+ color: '#a78bfa',
208
+ cue: 'energy dispersed',
209
+ preset: { driftX: 0, wander: 1.7, orbit: 0, spread: 0.6, conv: 0 },
210
+ },
211
+ {
212
+ id: 'accretion',
213
+ name: 'Accretion',
214
+ section: 'Contact',
215
+ color: '#ffce6b',
216
+ cue: 'everything gathers',
217
+ preset: { driftX: 0, wander: 0.6, orbit: 0.4, spread: 0, conv: 0.6 },
218
+ },
219
+ ];
220
+ export const FORMATION_BY = Object.fromEntries(FORMATIONS.map((f) => [f.id, f]));
221
+ /** Section → formation mapping for the scroll journey (§7.1, `SECTION_FORM`). */
222
+ export const SECTION_FORM = {
223
+ top: 'ambient',
224
+ capabilities: 'scatter',
225
+ work: 'wells',
226
+ writing: 'lanes',
227
+ contact: 'accretion',
228
+ };
229
+ export const CONDITIONS = [
230
+ { id: '', name: 'Always', desc: 'Acts on every particle, every frame.', selective: false },
231
+ { id: 'active', name: 'Active', desc: 'Only while the body is engaged.', selective: false },
232
+ { id: 'fast', name: 'Fast', desc: 'Only on fast-moving matter (v² > 0.9).', selective: true },
233
+ { id: 'slow', name: 'Slow', desc: 'Only on calm matter (v² < 0.22).', selective: true },
234
+ { id: 'hot', name: 'Hot', desc: 'Only on energized matter (heat > 0.3).', selective: true },
235
+ { id: 'cool', name: 'Cool', desc: 'Only on calm, un-energized matter (heat < 0.08).', selective: true },
236
+ { id: 'scrolling', name: 'Scrolling', desc: 'Only while the page is scrolling.', selective: false },
237
+ ];
238
+ export const CONDITION_BY = Object.fromEntries(CONDITIONS.map((c) => [c.id, c]));
239
+ //# sourceMappingURL=forces.config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forces.config.js","sourceRoot":"","sources":["../../src/config/forces.config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAqCH,MAAM,CAAC,MAAM,MAAM,GAAwB;IACzC;QACE,EAAE,EAAE,SAAS;QACb,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,0BAA0B;QAChC,UAAU,EAAE,kBAAkB;QAC9B,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,EAAE,eAAe,EAAE,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE;QACpD,GAAG,EAAE,8CAA8C;KACpD;IACD;QACE,EAAE,EAAE,KAAK;QACT,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,8BAA8B;QACpC,UAAU,EAAE,YAAY;QACxB,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE;QACvE,GAAG,EAAE,kCAAkC;KACxC;IACD;QACE,EAAE,EAAE,QAAQ;QACZ,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,4BAA4B;QAClC,UAAU,EAAE,uBAAuB;QACnC,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,EAAE,eAAe,EAAE,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE;QACpD,GAAG,EAAE,sCAAsC;KAC5C;IACD;QACE,EAAE,EAAE,MAAM;QACV,IAAI,EAAE,MAAM;QACZ,KAAK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AC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAGlD,CAAC"}
@@ -0,0 +1,134 @@
1
+ /**
2
+ * The Field Manual catalog — the *complete, public-facing definition* of every force
3
+ * in the system: its family, token, the per-frame formula (transcribed from
4
+ * `docs/engine-reference/forces-system.md` §6/§20.3/§20.10), the `data-*` attributes it reads, and a
5
+ * one-line description.
6
+ *
7
+ * This is the single source the UI renders (the manual on fundamental-engine.com) and the
8
+ * shared reference for developers. A test cross-checks it against the registered
9
+ * force arrays, so the catalog can never silently fall out of sync with the engine —
10
+ * every force the engine knows has a definition here, and vice versa.
11
+ */
12
+ /** Which register a force belongs to (§20.1). */
13
+ export type ForceFamily = 'canonical' | 'natural' | 'extended';
14
+ /** One force's complete definition for the manual. */
15
+ export interface ManualEntry {
16
+ family: ForceFamily;
17
+ /** the `data-body` token. */
18
+ token: string;
19
+ /** display name. */
20
+ label: string;
21
+ /** a two-letter periodic-table style symbol — the force's compact identity. */
22
+ symbol: string;
23
+ /** the per-frame law, in plain text. */
24
+ formula: string;
25
+ /** the `data-*` attribute suffixes it reads (without the `data-` prefix). */
26
+ attrs: readonly string[];
27
+ /** one-line technical description (the manual register). */
28
+ desc: string;
29
+ /** a sensory one-line headline — what the force feels like. */
30
+ summary: string;
31
+ /** the functional one-liner — what the force does, plainly. */
32
+ effect: string;
33
+ /** the force's canonical accent color (§20.2 reconciliation). */
34
+ color: string;
35
+ /** a one-line real-world use — what you'd reach for this force to do in a UI. */
36
+ example: string;
37
+ /**
38
+ * True when the force only acts while `b.on` is true (element is engaged / data-hot).
39
+ * Propagate emits waves, spawn creates particles — both silently idle without engagement.
40
+ * Demo templates should add `data-hot` so hover activates the effect.
41
+ */
42
+ requiresEngagement?: boolean;
43
+ /**
44
+ * Concrete Δv per frame at a reference point: strength=1, range=280, d=100px, one frame.
45
+ * Lets developers calibrate forces without running the Lab.
46
+ * Format: "Δv ≈ X px/frame at d=100px (S=1, r=280)"
47
+ */
48
+ calibration?: string;
49
+ }
50
+ /**
51
+ * The canonical color for every registered force (§20.2 reconciliation). The nine
52
+ * mirror `forces.config.ts`; the designed-extended forces take the §20.2 registry
53
+ * colors; the §20.10 natural primitives (added after that table) get principled,
54
+ * clash-free accents. A test pins the nine to `FORCE_BY` so they can't drift.
55
+ */
56
+ export declare const FORCE_COLORS: Record<string, string>;
57
+ /**
58
+ * A one-line real-world use for each force — the spirit of the original manual's
59
+ * "real use example" captions (the canonical nine are adapted from them; the rest
60
+ * are authored). The UI renders this alongside a live demo of the force.
61
+ */
62
+ export declare const FORCE_EXAMPLES: Record<string, string>;
63
+ /**
64
+ * A two-letter symbol for every force — a periodic-table style identity used by the
65
+ * design system and the Lab's SYMBOL view. Mostly the first two letters, with curated
66
+ * exceptions so each is unique and reads well (memory → My, magnetism → Mg,
67
+ * crystallize → Cz, propagate → Pg, spotlight → Sl, pigment → Pm).
68
+ */
69
+ export declare const FORCE_SYMBOLS: Record<string, string>;
70
+ /**
71
+ * A sensory one-line headline for every force — what it *feels* like, the register the
72
+ * Lab's force card leads with. Distinct from `desc` (technical) and `example` (UI use).
73
+ * Four entries (gravity·morph·resonate·spotlight) are written to match this engine's real
74
+ * physics rather than the design bundle's simplified reading of those names.
75
+ */
76
+ export declare const FORCE_SUMMARIES: Record<string, string>;
77
+ /** The functional one-liner for every force — what it does, plainly (the Lab's EFFECT line). */
78
+ export declare const FORCE_EFFECTS: Record<string, string>;
79
+ /** Every force with its color, symbol, copy, and calibration state merged in. Grouped by `family`. */
80
+ export declare const MANUAL_FORCES: readonly ManualEntry[];
81
+ /** A preset definition: its name, the primitive tokens it composes, and a real use (§20.9). */
82
+ export interface ManualPreset {
83
+ name: string;
84
+ tokens: readonly string[];
85
+ desc: string;
86
+ example: string;
87
+ }
88
+ /** The cosmology/weather presets, as compositions (§20.9). */
89
+ export declare const MANUAL_PRESETS: readonly ManualPreset[];
90
+ /** The `data-when` condition gates (§5). */
91
+ export declare const MANUAL_CONDITIONS: readonly {
92
+ id: string;
93
+ desc: string;
94
+ }[];
95
+ /** The four fundamental fields field-ui translates into interface behavior. */
96
+ export type FundamentalField = 'gravity' | 'electromagnetic' | 'strong' | 'weak';
97
+ /** The four fundamental fields as a runtime list (for validation + iteration). */
98
+ export declare const FUNDAMENTAL_FIELDS: readonly FundamentalField[];
99
+ /**
100
+ * How a token sits in the translation model:
101
+ * - `designed` — a designed UI verb (the canonical forces + designed-extended); not a natural force.
102
+ * - `primitive` — a direct engine expression of a fundamental field (gravity, charge, magnetism…).
103
+ * - `derived` — an effective behavior from many interactions or scalar fields (thermal, diffuse…).
104
+ * - `analogue` — a material/structural analogue of strong/weak (cohesion, crystallize, morph…).
105
+ * - `transport` — motion ALONG field structure (fieldflow, pigment), not a force itself.
106
+ * - `metric` — a persistence/measurement signal, not physics (memory).
107
+ */
108
+ export type ForceKind = 'designed' | 'primitive' | 'derived' | 'analogue' | 'transport' | 'metric';
109
+ /** Every force token's translation kind (covers all of MANUAL_FORCES; checked by a test). */
110
+ export declare const FORCE_KIND: Record<string, ForceKind>;
111
+ /** The fundamental-field parent for tokens that translate one (omitted for designed/derived/metric/transport with no single parent). */
112
+ export declare const FORCE_FIELD: Record<string, FundamentalField>;
113
+ /** A token's translation classification: its kind, and its fundamental-field parent if it has one. */
114
+ export declare function classifyForce(token: string): {
115
+ kind: ForceKind | undefined;
116
+ field: FundamentalField | undefined;
117
+ };
118
+ /** One fundamental field, its interface translation, and the engine tokens that express it. */
119
+ export interface NaturalFieldInfo {
120
+ field: FundamentalField;
121
+ /** display title. */
122
+ title: string;
123
+ /** the interface behavior it translates into. */
124
+ translation: string;
125
+ /** one-line gloss. */
126
+ summary: string;
127
+ /** interface needs this field serves. */
128
+ interfaceUses: readonly string[];
129
+ /** the engine tokens that express this field (derived from FORCE_FIELD). */
130
+ expressions: readonly string[];
131
+ }
132
+ /** The four fundamental fields as interface grammar — the spine of the Natural Field Translation System. */
133
+ export declare const NATURAL_FIELDS: readonly NaturalFieldInfo[];
134
+ //# sourceMappingURL=manual.d.ts.map