@adobe/ecs 0.2.1 → 0.2.4

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 (330) hide show
  1. package/README.md +2 -2
  2. package/dist/implementation/compiler/body-access.d.ts +18 -1
  3. package/dist/implementation/compiler/body-access.js +104 -15
  4. package/dist/implementation/compiler/body-access.js.map +1 -1
  5. package/dist/implementation/compiler/describe.d.ts +1 -1
  6. package/dist/implementation/compiler/describe.js +3 -3
  7. package/dist/implementation/compiler/describe.js.map +1 -1
  8. package/dist/implementation/compiler/estree.d.ts +5 -2
  9. package/dist/implementation/compiler/estree.js +8 -5
  10. package/dist/implementation/compiler/estree.js.map +1 -1
  11. package/dist/implementation/compiler/inferred.js +4 -2
  12. package/dist/implementation/compiler/inferred.js.map +1 -1
  13. package/dist/implementation/compiler/signature.js +1 -1
  14. package/dist/implementation/compiler/transform.js +6 -5
  15. package/dist/implementation/compiler/transform.js.map +1 -1
  16. package/dist/implementation/world/activate.js +14 -2
  17. package/dist/implementation/world/activate.js.map +1 -1
  18. package/dist/implementation/world/buffer.d.ts +7 -0
  19. package/dist/implementation/world/buffer.js +7 -0
  20. package/dist/implementation/world/buffer.js.map +1 -1
  21. package/dist/implementation/world/cascade.d.ts +10 -3
  22. package/dist/implementation/world/cascade.js +48 -23
  23. package/dist/implementation/world/cascade.js.map +1 -1
  24. package/dist/implementation/world/commands.js +86 -2
  25. package/dist/implementation/world/commands.js.map +1 -1
  26. package/dist/implementation/world/create.js +53 -2
  27. package/dist/implementation/world/create.js.map +1 -1
  28. package/dist/implementation/world/entities.d.ts +2 -0
  29. package/dist/implementation/world/entities.js +6 -0
  30. package/dist/implementation/world/entities.js.map +1 -1
  31. package/dist/implementation/world/execute.d.ts +4 -4
  32. package/dist/implementation/world/execute.js +132 -83
  33. package/dist/implementation/world/execute.js.map +1 -1
  34. package/dist/implementation/world/finalizers.d.ts +2 -0
  35. package/dist/implementation/world/finalizers.js +24 -3
  36. package/dist/implementation/world/finalizers.js.map +1 -1
  37. package/dist/implementation/world/join.js +22 -4
  38. package/dist/implementation/world/join.js.map +1 -1
  39. package/dist/implementation/world/register.js +2 -2
  40. package/dist/implementation/world/resource-changes.d.ts +18 -0
  41. package/dist/implementation/world/resource-changes.js +66 -0
  42. package/dist/implementation/world/resource-changes.js.map +1 -0
  43. package/dist/implementation/world/rows.d.ts +1 -1
  44. package/dist/implementation/world/rows.js +23 -13
  45. package/dist/implementation/world/rows.js.map +1 -1
  46. package/dist/implementation/world/run-changes.d.ts +38 -0
  47. package/dist/implementation/world/run-changes.js +138 -0
  48. package/dist/implementation/world/run-changes.js.map +1 -0
  49. package/dist/implementation/world/runner.js +19 -15
  50. package/dist/implementation/world/runner.js.map +1 -1
  51. package/dist/implementation/world/sharing.js +1 -1
  52. package/dist/implementation/world/staging.d.ts +4 -0
  53. package/dist/implementation/world/staging.js +15 -3
  54. package/dist/implementation/world/staging.js.map +1 -1
  55. package/dist/implementation/world/state.d.ts +13 -0
  56. package/dist/implementation/world/state.js +13 -1
  57. package/dist/implementation/world/state.js.map +1 -1
  58. package/dist/implementation/world/synchronize.js +72 -22
  59. package/dist/implementation/world/synchronize.js.map +1 -1
  60. package/dist/implementation/world/tables-read.d.ts +9 -0
  61. package/dist/implementation/world/tables-read.js +72 -0
  62. package/dist/implementation/world/tables-read.js.map +1 -0
  63. package/dist/implementation/world/tables.d.ts +10 -0
  64. package/dist/implementation/world/tables.js +401 -0
  65. package/dist/implementation/world/tables.js.map +1 -0
  66. package/dist/implementation/world/thread-observer.js +1 -1
  67. package/dist/implementation/world/thread-observer.js.map +1 -1
  68. package/dist/implementation/world/thread-systems.js +11 -6
  69. package/dist/implementation/world/thread-systems.js.map +1 -1
  70. package/dist/implementation/world/up.js +7 -1
  71. package/dist/implementation/world/up.js.map +1 -1
  72. package/dist/implementation/world/where.d.ts +8 -0
  73. package/dist/implementation/world/where.js +40 -11
  74. package/dist/implementation/world/where.js.map +1 -1
  75. package/dist/index.d.ts +8 -28
  76. package/dist/index.js +4 -9
  77. package/dist/index.js.map +1 -1
  78. package/dist/interface/component/declarations.d.ts +4 -0
  79. package/dist/interface/component/declarations.js +8 -0
  80. package/dist/interface/component/declarations.js.map +1 -0
  81. package/dist/interface/component/declared.d.ts +12 -0
  82. package/dist/interface/component/declared.js +2 -0
  83. package/dist/interface/component/declared.js.map +1 -0
  84. package/dist/interface/component/index.d.ts +2 -0
  85. package/dist/interface/component/index.js +1 -1
  86. package/dist/interface/component/index.js.map +1 -1
  87. package/dist/interface/finalizer/body.d.ts +18 -3
  88. package/dist/interface/finalizer/create.d.ts +7 -5
  89. package/dist/interface/finalizer/create.js +8 -5
  90. package/dist/interface/finalizer/create.js.map +1 -1
  91. package/dist/interface/finalizer/declaration.d.ts +4 -2
  92. package/dist/interface/indexes/declaration-of.d.ts +17 -0
  93. package/dist/interface/indexes/declaration-of.js +20 -0
  94. package/dist/interface/indexes/declaration-of.js.map +1 -0
  95. package/dist/interface/indexes/index.d.ts +1 -0
  96. package/dist/interface/indexes/index.js +1 -0
  97. package/dist/interface/indexes/index.js.map +1 -1
  98. package/dist/interface/registry/names.d.ts +2 -0
  99. package/dist/interface/registry/names.js +9 -0
  100. package/dist/interface/registry/names.js.map +1 -1
  101. package/dist/interface/registry/schedule.d.ts +31 -4
  102. package/dist/interface/registry/schedule.js +185 -24
  103. package/dist/interface/registry/schedule.js.map +1 -1
  104. package/dist/interface/resource/declarations.d.ts +4 -0
  105. package/dist/interface/resource/declarations.js +8 -0
  106. package/dist/interface/resource/declarations.js.map +1 -0
  107. package/dist/interface/resource/index.d.ts +2 -0
  108. package/dist/interface/resource/index.js +1 -1
  109. package/dist/interface/resource/index.js.map +1 -1
  110. package/dist/interface/system/access.d.ts +15 -0
  111. package/dist/interface/system/body.d.ts +11 -6
  112. package/dist/interface/system/check.d.ts +8 -1
  113. package/dist/interface/system/check.js +42 -12
  114. package/dist/interface/system/check.js.map +1 -1
  115. package/dist/interface/system/commands.d.ts +37 -0
  116. package/dist/interface/system/create-resolved.js +1 -1
  117. package/dist/interface/system/create-resolved.js.map +1 -1
  118. package/dist/interface/system/create.d.ts +31 -15
  119. package/dist/interface/system/create.js +8 -7
  120. package/dist/interface/system/create.js.map +1 -1
  121. package/dist/interface/system/declaration.d.ts +9 -2
  122. package/dist/interface/system/describe.d.ts +120 -0
  123. package/dist/interface/system/describe.js +116 -0
  124. package/dist/interface/system/describe.js.map +1 -0
  125. package/dist/interface/system/index.d.ts +1 -0
  126. package/dist/interface/system/index.js +1 -0
  127. package/dist/interface/system/index.js.map +1 -1
  128. package/dist/interface/system/leaf.d.ts +6 -0
  129. package/dist/interface/system/render.js +1 -0
  130. package/dist/interface/system/render.js.map +1 -1
  131. package/dist/interface/system/resolve.d.ts +5 -1
  132. package/dist/interface/system/resolve.js +19 -1
  133. package/dist/interface/system/resolve.js.map +1 -1
  134. package/dist/interface/system/shared-only.d.ts +7 -0
  135. package/dist/interface/system/shared-only.js +2 -0
  136. package/dist/interface/system/shared-only.js.map +1 -0
  137. package/dist/interface/system/tables.d.ts +28 -0
  138. package/dist/interface/system/tables.js +2 -0
  139. package/dist/interface/system/tables.js.map +1 -0
  140. package/dist/interface/world/index.d.ts +1 -1
  141. package/dist/interface/world/table/index.d.ts +27 -0
  142. package/dist/interface/world/table/index.js +3 -0
  143. package/dist/interface/world/table/index.js.map +1 -0
  144. package/dist/interface/world/table/table.d.ts +11 -0
  145. package/dist/interface/world/table/table.js +2 -0
  146. package/dist/interface/world/table/table.js.map +1 -0
  147. package/dist/interface/world/world.d.ts +25 -10
  148. package/dist/world.d.ts +27 -0
  149. package/dist/world.js +27 -0
  150. package/dist/world.js.map +1 -0
  151. package/package.json +11 -2
  152. package/src/exports.test.ts +1 -1
  153. package/src/guide/00-keys.ts +1 -1
  154. package/src/guide/01-resources.md +1 -1
  155. package/src/guide/01-resources.ts +1 -1
  156. package/src/guide/02-entities.ts +2 -2
  157. package/src/guide/03-systems.md +2 -2
  158. package/src/guide/03-systems.out +1 -1
  159. package/src/guide/03-systems.ts +3 -3
  160. package/src/guide/04-ticks.md +1 -1
  161. package/src/guide/04-ticks.ts +3 -3
  162. package/src/guide/05-scheduling.ts +1 -1
  163. package/src/guide/06-sync-points.md +18 -7
  164. package/src/guide/06-sync-points.out +1 -2
  165. package/src/guide/06-sync-points.ts +10 -6
  166. package/src/guide/07-change-filters.ts +2 -2
  167. package/src/guide/08-input.ts +1 -1
  168. package/src/guide/09-rules.ts +1 -1
  169. package/src/guide/11-traits.ts +3 -3
  170. package/src/guide/12-lookups.ts +2 -2
  171. package/src/guide/13-indexes.ts +4 -4
  172. package/src/guide/14-kernels.ts +1 -1
  173. package/src/guide/15-reductions.ts +1 -1
  174. package/src/guide/16-gpu.ts +1 -1
  175. package/src/guide/17-hierarchies.ts +1 -1
  176. package/src/guide/18-identity.out +1 -1
  177. package/src/guide/19-threads.md +4 -2
  178. package/src/guide/19-threads.ts +2 -2
  179. package/src/guide/20-shared.ts +3 -3
  180. package/src/guide/21-dom.md +2 -2
  181. package/src/guide/21-dom.ts +1 -1
  182. package/src/guide/22-canvas.md +1 -1
  183. package/src/guide/22-canvas.ts +1 -1
  184. package/src/guide/CLAUDE.md +1 -1
  185. package/src/guide/guide.test.ts +9 -154
  186. package/src/implementation/compiler/body-access.ts +102 -12
  187. package/src/implementation/compiler/describe.test-helper.ts +1 -1
  188. package/src/implementation/compiler/describe.test.ts +1 -1
  189. package/src/implementation/compiler/describe.ts +3 -3
  190. package/src/implementation/compiler/estree.ts +9 -6
  191. package/src/implementation/compiler/hygiene.test.ts +1 -1
  192. package/src/implementation/compiler/inferred.test.ts +1 -1
  193. package/src/implementation/compiler/inferred.ts +4 -2
  194. package/src/implementation/compiler/plugin.test.ts +2 -2
  195. package/src/implementation/compiler/signature.ts +1 -1
  196. package/src/implementation/compiler/transform.test.ts +43 -23
  197. package/src/implementation/compiler/transform.ts +6 -4
  198. package/src/implementation/world/activate.ts +11 -2
  199. package/src/implementation/world/batches.test.ts +3 -3
  200. package/src/implementation/world/buffer.ts +7 -0
  201. package/src/implementation/world/cascade.ts +46 -22
  202. package/src/implementation/world/change-blocks.test.ts +1 -1
  203. package/src/implementation/world/commands.ts +76 -2
  204. package/src/implementation/world/create.test.ts +8 -8
  205. package/src/implementation/world/create.ts +57 -2
  206. package/src/implementation/world/defaults.test.ts +1 -1
  207. package/src/implementation/world/despawn-where.test.ts +287 -0
  208. package/src/implementation/world/entities.ts +6 -0
  209. package/src/implementation/world/execute.ts +125 -78
  210. package/src/implementation/world/finalizers.test.ts +1 -1
  211. package/src/implementation/world/finalizers.ts +27 -4
  212. package/src/implementation/world/ids.test.ts +1 -1
  213. package/src/implementation/world/index-changed.test.ts +2 -2
  214. package/src/implementation/world/index-joined.test.ts +5 -5
  215. package/src/implementation/world/index-order.test.ts +1 -1
  216. package/src/implementation/world/indexes.test.ts +2 -1
  217. package/src/implementation/world/join.test.ts +23 -4
  218. package/src/implementation/world/join.ts +26 -4
  219. package/src/implementation/world/joined-observer.test.ts +1 -1
  220. package/src/implementation/world/joining-worker.fixture.ts +1 -1
  221. package/src/implementation/world/joining.fixture.ts +1 -1
  222. package/src/implementation/world/joining.test-helper.ts +1 -1
  223. package/src/implementation/world/kernel-spawns.test.ts +1 -1
  224. package/src/implementation/world/names.test.ts +1 -2
  225. package/src/implementation/world/observe-factories.test.ts +2 -2
  226. package/src/implementation/world/observe-ticks-cases.test.ts +1 -1
  227. package/src/implementation/world/observe.test-helper.ts +1 -1
  228. package/src/implementation/world/observer-contained-worker.fixture.ts +1 -1
  229. package/src/implementation/world/observer-contained.test-helper.ts +1 -1
  230. package/src/implementation/world/observer-contained.test.ts +2 -2
  231. package/src/implementation/world/observer-joined.test-helper.ts +4 -4
  232. package/src/implementation/world/observer-joined.test.ts +23 -15
  233. package/src/implementation/world/observer.browser.test.ts +2 -2
  234. package/src/implementation/world/observer.test.ts +8 -8
  235. package/src/implementation/world/optional-workers.fixture.ts +1 -1
  236. package/src/implementation/world/optional.test.ts +7 -7
  237. package/src/implementation/world/perf.md +3 -1
  238. package/src/implementation/world/reclaim.test.ts +3 -3
  239. package/src/implementation/world/register.ts +2 -2
  240. package/src/implementation/world/remote-objects.test-helper.ts +1 -1
  241. package/src/implementation/world/resource-changes.test.ts +61 -0
  242. package/src/implementation/world/resource-changes.ts +67 -0
  243. package/src/implementation/world/rows.ts +24 -13
  244. package/src/implementation/world/rules.test.ts +37 -0
  245. package/src/implementation/world/run-changes.test.ts +88 -0
  246. package/src/implementation/world/run-changes.ts +160 -0
  247. package/src/implementation/world/run-results.test.ts +10 -10
  248. package/src/implementation/world/runner.ts +20 -16
  249. package/src/implementation/world/shared-gpu.browser.test.ts +2 -2
  250. package/src/implementation/world/shared-kernels.test.ts +2 -2
  251. package/src/implementation/world/shared-workers.fixture.ts +2 -2
  252. package/src/implementation/world/shared.test.ts +10 -10
  253. package/src/implementation/world/sharing.ts +1 -1
  254. package/src/implementation/world/staging.ts +16 -3
  255. package/src/implementation/world/state.ts +19 -0
  256. package/src/implementation/world/sync-points.test.ts +135 -0
  257. package/src/implementation/world/synchronize.ts +65 -18
  258. package/src/implementation/world/tables-read.ts +70 -0
  259. package/src/implementation/world/tables.test.ts +369 -0
  260. package/src/implementation/world/tables.ts +368 -0
  261. package/src/implementation/world/tails.test.ts +1 -1
  262. package/src/implementation/world/target.test.ts +2 -2
  263. package/src/implementation/world/thread-observer.ts +1 -1
  264. package/src/implementation/world/thread-systems.test-helper.ts +3 -3
  265. package/src/implementation/world/thread-systems.ts +11 -6
  266. package/src/implementation/world/up.test.ts +13 -1
  267. package/src/implementation/world/up.ts +6 -1
  268. package/src/implementation/world/where.test.ts +4 -4
  269. package/src/implementation/world/where.ts +38 -10
  270. package/src/implementation/world/workers.fixture.ts +2 -2
  271. package/src/index.ts +4 -29
  272. package/src/interface/component/declarations.ts +11 -0
  273. package/src/interface/component/declared.ts +9 -0
  274. package/src/interface/component/index.ts +2 -0
  275. package/src/interface/finalizer/body.ts +13 -3
  276. package/src/interface/finalizer/create.test.ts +3 -1
  277. package/src/interface/finalizer/create.ts +12 -7
  278. package/src/interface/finalizer/declaration.ts +4 -2
  279. package/src/interface/index.type-test.ts +2 -2
  280. package/src/interface/indexes/create.test.ts +10 -0
  281. package/src/interface/indexes/declaration-of.ts +34 -0
  282. package/src/interface/indexes/index.ts +1 -0
  283. package/src/interface/indexes/index.type-test.ts +1 -1
  284. package/src/interface/registry/names.ts +8 -0
  285. package/src/interface/registry/schedule.ts +200 -27
  286. package/src/interface/resource/declarations.ts +11 -0
  287. package/src/interface/resource/index.ts +2 -0
  288. package/src/interface/system/access.ts +16 -0
  289. package/src/interface/system/body.ts +7 -5
  290. package/src/interface/system/check.ts +37 -10
  291. package/src/interface/system/commands.ts +33 -0
  292. package/src/interface/system/commands.type-test.ts +31 -0
  293. package/src/interface/system/create-resolved.ts +1 -1
  294. package/src/interface/system/create.test.ts +21 -13
  295. package/src/interface/system/create.ts +24 -15
  296. package/src/interface/system/declaration.ts +9 -2
  297. package/src/interface/system/describe.test.ts +79 -0
  298. package/src/interface/system/describe.ts +122 -0
  299. package/src/interface/system/index.ts +1 -0
  300. package/src/interface/system/leaf.ts +6 -0
  301. package/src/interface/system/lists.type-test.ts +1 -1
  302. package/src/interface/system/optional.type-test.ts +1 -1
  303. package/src/interface/system/render.ts +1 -0
  304. package/src/interface/system/resolve.ts +25 -2
  305. package/src/interface/system/shared-only.ts +5 -0
  306. package/src/interface/system/shared.type-test.ts +1 -1
  307. package/src/interface/system/system.type-test.ts +26 -20
  308. package/src/interface/system/tables.ts +27 -0
  309. package/src/interface/system/up.type-test.ts +3 -3
  310. package/src/interface/world/index.ts +2 -2
  311. package/src/interface/world/run.type-test.ts +14 -4
  312. package/src/interface/world/table/index.ts +20 -0
  313. package/src/interface/world/table/table.ts +12 -0
  314. package/src/interface/world/world.ts +23 -10
  315. package/src/observe/entity.ts +2 -2
  316. package/src/observe/resource.ts +2 -2
  317. package/src/observe/select.ts +4 -4
  318. package/src/observe/world-state.ts +3 -3
  319. package/src/perftest/benchmarks.ts +19 -1
  320. package/src/perftest/indexes.ts +3 -3
  321. package/src/perftest/loop.ts +1 -1
  322. package/src/perftest/observer.ts +4 -4
  323. package/src/perftest/reads.ts +2 -2
  324. package/src/perftest/remote.ts +5 -5
  325. package/src/perftest/strings.ts +1 -1
  326. package/src/perftest/structural.ts +20 -0
  327. package/src/perftest/suite.ts +1 -1
  328. package/src/perftest/tables.ts +107 -0
  329. package/src/world.test.ts +2 -2
  330. package/src/world.ts +32 -0
@@ -1,6 +1,8 @@
1
1
  import type { Component } from '../component/component.js';
2
2
  import type { Entity } from '../entity/entity.js';
3
3
  import type { Essential, Shared } from '../component/value.js';
4
+ import type { Table } from '../world/table/table.js';
5
+ import type { SharedOnly } from './shared-only.js';
4
6
  import type { ValuesOf } from './values-of.js';
5
7
  /** The value an `add` of one component takes: none for a tag. */
6
8
  type ValueArgument<K extends Essential> = Component<K> extends true ? [value?: true] : [value: Component<K>];
@@ -64,11 +66,46 @@ export type Commands = {
64
66
  */
65
67
  spawn<const C extends readonly Essential[], const P extends Preset<C> = {}>(components: Spawned<C, P>, ...constant: RequiresPreset<C> extends true ? [constant?: P & SharedPreset<C> & Named<C, P>] : [constant?: P & Named<C, P>]): (...values: SpawnValues<C, P>) => Entity;
66
68
  despawn(entity: Entity): void;
69
+ /**
70
+ * Despawns, as a `despawn` of each would, every entity that has each component of `with` and none of `not` once the
71
+ * commands issued before it apply, and every entity spawned at the same sync point that does, whenever spawned.
72
+ * Derived components may be named. `where` keeps it to the archetypes holding these values of shared components,
73
+ * each one required as `with` requires it, as a system's `where` of values does. Never the resource entity. Only on
74
+ * the world's thread: a joined thread's throws.
75
+ */
76
+ despawnWhere<const W extends object = {}>(query: {
77
+ readonly with: readonly [Component.Key, ...Component.Key[]];
78
+ readonly not?: readonly Component.Key[];
79
+ readonly where?: W & SharedOnly<NoInfer<W>> & {
80
+ readonly [K in Shared]?: Component<K>;
81
+ };
82
+ }): void;
67
83
  /** Adds or replaces one component's value, marking it changed. */
68
84
  add<K extends Essential>(entity: Entity, component: K, ...value: ValueArgument<K>): void;
69
85
  /** Adds or replaces the values of `components`, marking them changed. */
70
86
  add<const C extends readonly Essential[]>(entity: Entity, components: C, values: ValuesOf<C>): void;
71
87
  remove(entity: Entity, component: Essential): void;
72
88
  remove(entity: Entity, components: readonly Essential[]): void;
89
+ /**
90
+ * Spawns an entity for each row of `tables`, as a readonly system's `tables` gives them, of each table's components
91
+ * with its columns' values: a block copy per column. Entity values are rewritten as the world's references would
92
+ * leave them had the entities outside the tables despawned: each naming an entity of the tables, a reference, a
93
+ * struct's field or an array's item, names the one spawned for it; a row whose owner reference names an entity
94
+ * outside them isn't spawned, nor anything it owns, through owner references, as despawning its owner would; a
95
+ * weak reference to one is left out of its row, which is spawned without it; any other value naming one is
96
+ * `Entity.none`. Returns, at once, each table's new entities, alive at the sync point. A column's stride must be its
97
+ * component's in this world, and its length its table's count. On the world's thread only.
98
+ * - `existing` maps entities to ones already alive in this world, which stand for them: a row whose entity it maps
99
+ * isn't spawned, its entry in the result is the entity it maps to, and every value naming one it maps names that
100
+ * entity, whether or not it's in the tables. Fails for one that isn't alive.
101
+ * - `resources` sets each resource it names, by key, at the sync point, as commands apply, each value checked
102
+ * against its resource's schema; not one only the world writes, nor one living on another thread.
103
+ */
104
+ spawnTables(tables: readonly Table[], options?: {
105
+ readonly resources?: {
106
+ readonly [key: symbol]: unknown;
107
+ };
108
+ readonly existing?: ReadonlyMap<Entity, Entity>;
109
+ }): Table.Spawned;
73
110
  };
74
111
  export {};
@@ -10,7 +10,7 @@ import { checkLeaf, inputSchemaOf } from './check.js';
10
10
  export const createResolved = (declaration, body, input) => {
11
11
  const name = nameOf(declaration, undefined, "system");
12
12
  const schema = inputSchemaOf(name, body, declaration.components === undefined ? 1 : 2, input);
13
- const system = { kind: "system", name, declaration, input: schema, body };
13
+ const system = { kind: "system", name, declaration, input: schema, body, commands: undefined };
14
14
  checkLeaf(system);
15
15
  claimSystem(system, undefined);
16
16
  return system;
@@ -1 +1 @@
1
- {"version":3,"file":"create-resolved.js","sourceRoot":"","sources":["../../../src/interface/system/create-resolved.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAKtD;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,WAAqB,EAAE,IAAkB,EAAE,KAAe,EAAmB,EAAE;IAC1G,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;IACtD,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IAC9F,MAAM,MAAM,GAA2B,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAClG,SAAS,CAAC,MAAM,CAAC,CAAC;IAClB,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC/B,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC"}
1
+ {"version":3,"file":"create-resolved.js","sourceRoot":"","sources":["../../../src/interface/system/create-resolved.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAKtD;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,WAAqB,EAAE,IAAkB,EAAE,KAAe,EAAmB,EAAE;IAC1G,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;IACtD,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IAC9F,MAAM,MAAM,GAA2B,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACvH,SAAS,CAAC,MAAM,CAAC,CAAC;IAClB,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC/B,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC"}
@@ -9,7 +9,7 @@ import type { Listed, Property } from './property.js';
9
9
  import type { System } from './system.js';
10
10
  import type { OneThread, ThreadedBy, ThreadsOf } from './threads.js';
11
11
  import type { HeldBy } from './values.js';
12
- import type { Shared } from '../component/value.js';
12
+ import type { SharedOnly } from './shared-only.js';
13
13
  type Lookups<D> = Property<D, "lookup">;
14
14
  /** A lookup's `changed` names what it requires: a lookup by entity's `with`, an index lookup's what its index holds. */
15
15
  type LookupChanges<D> = {
@@ -63,10 +63,10 @@ type GpuKernel = {
63
63
  };
64
64
  };
65
65
  /**
66
- * An observer system only reads, after a sync point: its row and resources are read-only, and it never compiles to a
66
+ * A readonly system only reads, after a sync point: its row and resources are read-only, and it never compiles to a
67
67
  * kernel, has no `up`, and is ordered with nothing. That it takes no input is checked at its body.
68
68
  */
69
- type Observer = {
69
+ type Readonly = {
70
70
  readonly kernel?: false;
71
71
  readonly up?: never;
72
72
  readonly before?: never;
@@ -86,11 +86,7 @@ type Where<D> = D extends {
86
86
  };
87
87
  } ? {
88
88
  readonly components?: {
89
- readonly where?: {
90
- readonly [K in Exclude<keyof W, Shared>]: {
91
- readonly "error: where names only shared components, which each archetype holds one value of": K;
92
- };
93
- };
89
+ readonly where?: SharedOnly<W>;
94
90
  };
95
91
  } & (D extends {
96
92
  readonly up: object;
@@ -137,8 +133,28 @@ type Validate<D extends Declaration> = LookupChanges<D> & Where<D> & Conditions<
137
133
  readonly "error: a GPU kernel can't have optional components yet": true;
138
134
  };
139
135
  } : {}) & (D extends {
140
- readonly observer: true;
141
- } ? Observer : {}) & (D extends {
136
+ readonly readonly: true;
137
+ } ? Readonly : {}) & (D extends {
138
+ readonly tables: {
139
+ readonly where: infer W;
140
+ };
141
+ } ? {
142
+ readonly tables?: {
143
+ readonly where?: SharedOnly<W>;
144
+ };
145
+ } : {}) & (D extends {
146
+ readonly tables: object;
147
+ } ? (D extends {
148
+ readonly readonly: true;
149
+ } ? {} : {
150
+ readonly tables?: {
151
+ readonly "error: tables are read by a readonly system": true;
152
+ };
153
+ }) & (Property<D, "components"> extends undefined ? {} : {
154
+ readonly tables?: {
155
+ readonly "error: a system reading tables has no components": true;
156
+ };
157
+ }) : {}) & (D extends {
142
158
  readonly target: string;
143
159
  } ? Targeted : {}) & (D extends {
144
160
  readonly target: string;
@@ -157,7 +173,7 @@ type EntityFields<I> = {
157
173
  /**
158
174
  * What a declaration requires of the input its body takes, checked at the body, since the input is known only once the
159
175
  * body is: a target names an entity field of it, and a system with input doesn't filter on added or changed, as its
160
- * runs pass different input, nor is it an observer. Every check passes for `never`, the input before the body is
176
+ * runs pass different input, nor is it a readonly system. Every check passes for `never`, the input before the body is
161
177
  * inferred.
162
178
  */
163
179
  type Checks<D, I> = [I] extends [never] ? unknown : (D extends {
@@ -175,9 +191,9 @@ type Checks<D, I> = [I] extends [never] ? unknown : (D extends {
175
191
  } ? {
176
192
  readonly "error: a system with input can't filter on added or changed, as its runs pass different input; pass it through a resource": true;
177
193
  } : unknown) & (D extends {
178
- readonly observer: true;
194
+ readonly readonly: true;
179
195
  } ? {
180
- readonly "error: an observer system takes no input": true;
196
+ readonly "error: a readonly system takes no input": true;
181
197
  } : unknown));
182
198
  /** The body of a system that declares nothing, which runs once per run with its resources and commands. */
183
199
  type Alone = (context: Context<{}>) => void;
@@ -200,10 +216,10 @@ type Checked<C> = C extends Alone ? ReturnsNoPromise<C> : C extends CompositeDec
200
216
  * input, with every field of theirs. Throws if a system names a key that isn't registered as its kind, its body writes
201
217
  * a reference, a lookup's rows are read where it writes them or it goes through an index keyed by what it writes, its
202
218
  * rows are ordered by an index it isn't sorted or keyed by what it writes, its object components and resources live on
203
- * different threads, or its reductions, conditions, `up`, `order` or placement can't hold, or it's an observer and
219
+ * different threads, or its reductions, conditions, `up`, `order` or placement can't hold, or it's a readonly system and
204
220
  * writes, reduces, takes input, is a kernel, has `up` or is ordered; if the build couldn't follow how its body uses its
205
221
  * resources, lookups or parent; or if a composite's member isn't a system a constructor returned, or two members
206
- * declare an input field with different schemas. A composite's observer members run after its sync point, ordered
222
+ * declare an input field with different schemas. A composite's readonly members run after its sync point, ordered
207
223
  * with nothing.
208
224
  *
209
225
  * A run of a system without components resolves to what its body returns, or `undefined` when its conditions, resource
@@ -2,7 +2,7 @@ import { takeIdOfDeclaration } from '../registry/ids.js';
2
2
  import { nameOf } from '../registry/items.js';
3
3
  import { claimSystem } from '../registry/program.js';
4
4
  import { checkComposite, checkLeaf, inputSchemaOf } from './check.js';
5
- import { accessOf, compact, componentLists, lookupsLists, resourceUses, upReads, whereReadsOf } from './resolve.js';
5
+ import { accessOf, commandLists, compact, componentLists, lookupsLists, resourceUses, upReads, whereReadsOf } from './resolve.js';
6
6
  // The plugin passes the schema of the body's input as a third argument.
7
7
  export function create(first, second, input) {
8
8
  // The plugin gives its id to the call's first argument: the declaration, the members, or the body made into a
@@ -17,27 +17,28 @@ export function create(first, second, input) {
17
17
  if (body === undefined)
18
18
  throw new Error("A system needs a body, and a composite its systems.");
19
19
  const name = nameOf(first, id, "system");
20
- const declaration = resolve(`System "${name}"`, declared, accessOf(`System "${name}"`, first));
20
+ const access = accessOf(`System "${name}"`, first);
21
+ const declaration = resolve(`System "${name}"`, declared, access);
21
22
  const schema = inputSchemaOf(name, body, declaration.components === undefined ? 1 : 2, input);
22
- const system = { kind: "system", name, declaration, input: schema, body };
23
+ const system = { kind: "system", name, declaration, input: schema, body, commands: commandLists(access) };
23
24
  checkLeaf(system);
24
25
  claimSystem(system, id);
25
26
  return system;
26
27
  }
27
28
  /** A declaration as the world takes it, with what the build inferred its body uses. */
28
29
  const resolve = (what, declared, access) => {
29
- const reading = declared.observer === true;
30
+ const reading = declared.readonly === true;
30
31
  const { components, lookup, up, resources, ...rest } = declared;
31
32
  const uses = resourceUses(what, access, resources?.is);
32
- // What `where`'s predicates read counts as the system's reads, for its order, conflicts and placement.
33
33
  const whereReads = whereReadsOf(what, components, access);
34
34
  const conditions = resources?.is ?? [];
35
- for (const key of whereReads)
35
+ // What `where`'s predicates and `tables` read counts as the system's reads, for its order, conflicts and placement.
36
+ for (const key of [...whereReads, ...declared.tables?.resources ?? []])
36
37
  if (!uses.read.includes(key) && !uses.write.includes(key) && !conditions.includes(key))
37
38
  uses.read.push(key);
38
39
  const resolved = {
39
40
  ...rest,
40
- ...components === undefined ? {} : { components: componentLists(components, access.components, reading, whereReads) },
41
+ ...components === undefined ? {} : { components: componentLists(components, components.whole === true ? null : access.components, reading, whereReads) },
41
42
  ...lookup === undefined ? {} : { lookup: lookupsLists(lookup, access) },
42
43
  ...up === undefined ? {} : { up: { through: up.through, read: upReads(what, access) } },
43
44
  };
@@ -1 +1 @@
1
- {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/interface/system/create.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;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,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AAC1F,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,CAAC,KAAc,EAAuC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAE7F,yFAAyF;AACzF,MAAM,OAAO,GAAG,CAAC,KAAa,EAAE,WAAiC,EAAE,EAAsB,EAAmB,EAAE;IAC1G,MAAM,MAAM,GAAgC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,EAAE,EAAE,EAAE,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;IAClH,cAAc,CAAC,MAAM,CAAC,CAAC;IACvB,WAAW,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACxB,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC"}
@@ -2,6 +2,7 @@ import type { Index } from '../indexes/index-type.js';
2
2
  import type { ComponentAccess, ComponentLists, ResourceAccess, ResourceLists, SystemLookup, SystemLookupLists, Up, UpLists } from './access.js';
3
3
  import type { Shader } from './render.js';
4
4
  import type { System } from './system.js';
5
+ import type { TablesDeclaration } from './tables.js';
5
6
  /**
6
7
  * A system never declares its thread: it runs on the one its object components and resources live on, those it
7
8
  * reads, writes or filters on by change, through its row, lookups, `up` and resources. Without them, a kernel runs on
@@ -60,9 +61,15 @@ export type Declaration = {
60
61
  readonly during?: readonly System<unknown>[];
61
62
  /**
62
63
  * Runs after the last sync point of each run and tick (a tick is a run of the added composite), reading the settled
63
- * state; changes nothing; never ordered; doesn't keep the loop ticking.
64
+ * state, on the thread that added or ran it; changes nothing, its row and resources typed read-only and its context
65
+ * without `commands`; takes no input; never ordered; doesn't keep the loop ticking. A joined thread adds only these.
64
66
  */
65
- readonly observer?: true;
67
+ readonly readonly?: true;
68
+ /**
69
+ * For a readonly system without components: gives its context `tables`, copies of whole archetypes' columns, as
70
+ * `TablesDeclaration` says, read on the world's thread. Its components and resources count as what it reads.
71
+ */
72
+ readonly tables?: TablesDeclaration;
66
73
  };
67
74
  /** A declaration as the world takes it: the build's inferred reads, writes and reductions joined with what it declares. */
68
75
  export type Resolved = Omit<Declaration, "components" | "lookup" | "up" | "resources"> & {
@@ -0,0 +1,120 @@
1
+ import type { System } from './system.js';
2
+ /**
3
+ * Describes how a system or composite runs: its tiers in run order, systems in one tier having no ordering path between
4
+ * them, each with the sync point after it, if any, and its readonly systems apart, which run after its last sync
5
+ * point. For each system, what the build inferred it reads, writes, looks up and commands, whether it takes its row
6
+ * whole, and the systems it follows directly, with what ordered it after each. `text` gives it all to read; the rest
7
+ * is data to assert on.
8
+ */
9
+ export declare const describe: <I, R>(system: System<I, R>) => {
10
+ tiers: {
11
+ systems: {
12
+ /** The system, the value its constructor returned. */
13
+ system: System<unknown, unknown>;
14
+ name: string;
15
+ components: {
16
+ read: symbol[];
17
+ write: readonly symbol[];
18
+ /** What it requires without reading: `with` members it doesn't use, `added` and `changed` filters' among them. */
19
+ has: readonly symbol[];
20
+ optional: readonly symbol[];
21
+ not: readonly symbol[];
22
+ added: readonly symbol[];
23
+ changed: readonly symbol[];
24
+ /** What it reads of each row's parent, through `up`. */
25
+ parent: readonly symbol[];
26
+ };
27
+ resources: {
28
+ read: readonly symbol[];
29
+ write: readonly symbol[];
30
+ reduce: readonly symbol[];
31
+ changed: readonly symbol[];
32
+ is: readonly symbol[];
33
+ not: readonly symbol[];
34
+ };
35
+ lookups: {
36
+ name: string;
37
+ /** The label of the index it looks up through, or null for a lookup by entity. */
38
+ index: string | null;
39
+ read: readonly symbol[];
40
+ }[];
41
+ /** The label of the sorted index ordering its rows, or null. */
42
+ order: string | null;
43
+ /** What its commands name by kind, and whether it despawns; null where the build couldn't follow them. */
44
+ commands: {
45
+ spawn: readonly symbol[];
46
+ add: readonly symbol[];
47
+ remove: readonly symbol[];
48
+ despawn: boolean;
49
+ } | null;
50
+ /** Whether it takes its row whole (`components: { whole: true }`), every member written. */
51
+ whole: boolean;
52
+ /** The systems it follows directly, with what ordered it after each and the keys that need that order. */
53
+ after: {
54
+ system: System<unknown, unknown>;
55
+ name: string;
56
+ because: "before" | "after" | "during" | "reduction";
57
+ conflicts: readonly symbol[];
58
+ }[];
59
+ }[];
60
+ /**
61
+ * Why a sync point follows the tier, applying the commands so far: each system whose commands may change what a
62
+ * later one that follows it uses, through `keys`, none listed where it despawns or a cascade could; null for none.
63
+ */
64
+ sync: {
65
+ from: System<unknown, unknown>;
66
+ to: System<unknown, unknown>;
67
+ keys: readonly symbol[];
68
+ }[] | null;
69
+ }[];
70
+ readonly: {
71
+ /** The system, the value its constructor returned. */
72
+ system: System<unknown, unknown>;
73
+ name: string;
74
+ components: {
75
+ read: symbol[];
76
+ write: readonly symbol[];
77
+ /** What it requires without reading: `with` members it doesn't use, `added` and `changed` filters' among them. */
78
+ has: readonly symbol[];
79
+ optional: readonly symbol[];
80
+ not: readonly symbol[];
81
+ added: readonly symbol[];
82
+ changed: readonly symbol[];
83
+ /** What it reads of each row's parent, through `up`. */
84
+ parent: readonly symbol[];
85
+ };
86
+ resources: {
87
+ read: readonly symbol[];
88
+ write: readonly symbol[];
89
+ reduce: readonly symbol[];
90
+ changed: readonly symbol[];
91
+ is: readonly symbol[];
92
+ not: readonly symbol[];
93
+ };
94
+ lookups: {
95
+ name: string;
96
+ /** The label of the index it looks up through, or null for a lookup by entity. */
97
+ index: string | null;
98
+ read: readonly symbol[];
99
+ }[];
100
+ /** The label of the sorted index ordering its rows, or null. */
101
+ order: string | null;
102
+ /** What its commands name by kind, and whether it despawns; null where the build couldn't follow them. */
103
+ commands: {
104
+ spawn: readonly symbol[];
105
+ add: readonly symbol[];
106
+ remove: readonly symbol[];
107
+ despawn: boolean;
108
+ } | null;
109
+ /** Whether it takes its row whole (`components: { whole: true }`), every member written. */
110
+ whole: boolean;
111
+ /** The systems it follows directly, with what ordered it after each and the keys that need that order. */
112
+ after: {
113
+ system: System<unknown, unknown>;
114
+ name: string;
115
+ because: "before" | "after" | "during" | "reduction";
116
+ conflicts: readonly symbol[];
117
+ }[];
118
+ }[];
119
+ text: string;
120
+ };
@@ -0,0 +1,116 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+ import { indexDefinitionOf } from '../registry/indexes.js';
3
+ import { labelOf } from '../registry/names.js';
4
+ import { requireDefinition } from '../registry/program.js';
5
+ import { isLeaf, placementsOf, scheduleOf } from '../registry/schedule.js';
6
+ const none = [];
7
+ /** A leaf as the system value it is. */
8
+ const asSystem = (leaf) => leaf;
9
+ /** What the build inferred one system uses, and what placed it, as plain data. */
10
+ const describeLeaf = (leaf, placements) => {
11
+ const { components, resources, lookup, up, order } = leaf.declaration;
12
+ const { commands } = leaf;
13
+ return {
14
+ /** The system, the value its constructor returned. */
15
+ system: asSystem(leaf),
16
+ name: leaf.name,
17
+ components: {
18
+ read: [...components?.read ?? none, ...up === undefined ? none : [up.through]],
19
+ write: components?.write ?? none,
20
+ /** What it requires without reading: `with` members it doesn't use, `added` and `changed` filters' among them. */
21
+ has: components?.has ?? none,
22
+ optional: components?.optional ?? none,
23
+ not: components?.not ?? none,
24
+ added: components?.added ?? none,
25
+ changed: components?.changed ?? none,
26
+ /** What it reads of each row's parent, through `up`. */
27
+ parent: up?.read ?? none,
28
+ },
29
+ resources: {
30
+ read: resources?.read ?? none,
31
+ write: resources?.write ?? none,
32
+ reduce: resources?.reduce ?? none,
33
+ changed: resources?.changed ?? none,
34
+ is: resources?.is ?? none,
35
+ not: resources?.not ?? none,
36
+ },
37
+ lookups: Object.entries(lookup ?? {}).map(([name, used]) => ({
38
+ name,
39
+ /** The label of the index it looks up through, or null for a lookup by entity. */
40
+ index: "index" in used && used.index !== undefined ? indexDefinitionOf(used.index)?.name ?? null : null,
41
+ read: used.read ?? none,
42
+ })),
43
+ /** The label of the sorted index ordering its rows, or null. */
44
+ order: indexDefinitionOf(order)?.name ?? null,
45
+ /** What its commands name by kind, and whether it despawns; null where the build couldn't follow them. */
46
+ commands: commands === null ? null : {
47
+ spawn: commands?.spawn ?? none,
48
+ add: commands?.add ?? none,
49
+ remove: commands?.remove ?? none,
50
+ despawn: commands?.despawn === true,
51
+ },
52
+ /** Whether it takes its row whole (`components: { whole: true }`), every member written. */
53
+ whole: components?.whole === true,
54
+ /** The systems it follows directly, with what ordered it after each and the keys that need that order. */
55
+ after: placements.map(placement => ({ system: asSystem(placement.leaf), name: placement.leaf.name, because: placement.because, conflicts: placement.conflicts })),
56
+ };
57
+ };
58
+ const keys = (list) => list.map(labelOf).join(" ");
59
+ /** A system's lines of text, after its name in a column of `width`. */
60
+ const linesOf = (system, width) => {
61
+ const lines = [];
62
+ const add = (label, text) => { if (text !== "")
63
+ lines.push(`${label.padEnd(10)}${text}`); };
64
+ const { components, resources, commands } = system;
65
+ add("reads", keys(components.read));
66
+ add("writes", `${keys(components.write)}${system.whole ? " (its whole row)" : ""}`);
67
+ add("requires", [keys(components.has), components.not.length === 0 ? "" : `not ${keys(components.not)}`, components.optional.length === 0 ? "" : `optional ${keys(components.optional)}`].filter(text => text !== "").join(", "));
68
+ add("filters", [...components.added.map(key => `added ${labelOf(key)}`), ...components.changed.map(key => `changed ${labelOf(key)}`), ...resources.changed.map(key => `changed ${labelOf(key)}`)].join(", "));
69
+ add("parent", keys(components.parent));
70
+ add("resources", [resources.read.length === 0 ? "" : `reads ${keys(resources.read)}`, resources.write.length === 0 ? "" : `writes ${keys(resources.write)}`,
71
+ resources.reduce.length === 0 ? "" : `reduces ${keys(resources.reduce)}`, resources.is.length === 0 ? "" : `while ${keys(resources.is)}`,
72
+ resources.not.length === 0 ? "" : `unless ${keys(resources.not)}`].filter(text => text !== "").join(", "));
73
+ for (const lookup of system.lookups)
74
+ add("looks up", `${lookup.name}${lookup.index === null ? "" : ` through ${lookup.index}`}${lookup.read.length === 0 ? "" : `: ${keys(lookup.read)}`}`);
75
+ if (system.order !== null)
76
+ add("ordered", `by ${system.order}`);
77
+ if (commands === null)
78
+ add("commands", "unknown: the build couldn't follow them");
79
+ else
80
+ add("commands", [commands.spawn.length === 0 ? "" : `spawn ${keys(commands.spawn)}`, commands.add.length === 0 ? "" : `add ${keys(commands.add)}`,
81
+ commands.remove.length === 0 ? "" : `remove ${keys(commands.remove)}`, commands.despawn ? "despawn" : ""].filter(text => text !== "").join(", "));
82
+ add("after", system.after.map(placement => `${placement.name} (${placement.because}${placement.conflicts.length === 0 ? "" : `: ${keys(placement.conflicts)}`})`).join(", "));
83
+ const indent = " ".repeat(width);
84
+ return lines.length === 0 ? [system.name] : lines.map((line, i) => `${i === 0 ? system.name.padEnd(width) : indent}${line}`);
85
+ };
86
+ /**
87
+ * Describes how a system or composite runs: its tiers in run order, systems in one tier having no ordering path between
88
+ * them, each with the sync point after it, if any, and its readonly systems apart, which run after its last sync
89
+ * point. For each system, what the build inferred it reads, writes, looks up and commands, whether it takes its row
90
+ * whole, and the systems it follows directly, with what ordered it after each. `text` gives it all to read; the rest
91
+ * is data to assert on.
92
+ */
93
+ export const describe = (system) => {
94
+ const definition = requireDefinition(system);
95
+ const schedule = scheduleOf(definition);
96
+ const placements = placementsOf(definition);
97
+ const tiers = schedule.tiers.map((tier, t) => ({
98
+ systems: tier.map(leaf => describeLeaf(leaf, placements.get(leaf) ?? none)),
99
+ /**
100
+ * Why a sync point follows the tier, applying the commands so far: each system whose commands may change what a
101
+ * later one that follows it uses, through `keys`, none listed where it despawns or a cascade could; null for none.
102
+ */
103
+ sync: schedule.syncs[t]?.map(reason => ({ from: asSystem(reason.from), to: asSystem(reason.to), keys: reason.keys })) ?? null,
104
+ }));
105
+ const readonly = schedule.observer.flatMap(member => isLeaf(member) ? [describeLeaf(member, none)] : []);
106
+ const width = Math.max(0, ...[...tiers.flatMap(tier => tier.systems), ...readonly].map(described => described.name.length)) + 2;
107
+ const text = [
108
+ ...tiers.flatMap((tier, t) => [
109
+ ...tier.systems.flatMap((described, i) => linesOf(described, width).map((line, l) => `${(i === 0 && l === 0 ? `tier ${t}` : "").padEnd(8)}${line}`)),
110
+ ...(tier.sync ?? none).map((reason, r) => `${(r === 0 ? "sync" : "").padEnd(8)}${reason.from.name}'s commands${reason.keys.length === 0 ? "" : ` of ${keys(reason.keys)}`}, for ${reason.to.name}`),
111
+ ]),
112
+ ...readonly.length === 0 ? none : ["readonly", ...readonly.flatMap(described => linesOf(described, width).map(line => `${"".padEnd(8)}${line}`))],
113
+ ].map(line => line.trimEnd()).join("\n");
114
+ return { tiers, readonly, text };
115
+ };
116
+ //# sourceMappingURL=describe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"describe.js","sourceRoot":"","sources":["../../../src/interface/system/describe.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAkB,MAAM,yBAAyB,CAAC;AAM3F,MAAM,IAAI,GAAqB,EAAE,CAAC;AAElC,wCAAwC;AACxC,MAAM,QAAQ,GAAG,CAAC,IAAU,EAA4B,EAAE,CAAC,IAAI,CAAC;AAEhE,kFAAkF;AAClF,MAAM,YAAY,GAAG,CAAC,IAAU,EAAE,UAAgC,EAAE,EAAE;IAClE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC;IACtE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAC1B,OAAO;QACH,sDAAsD;QACtD,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC;QACtB,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,UAAU,EAAE;YACR,IAAI,EAAE,CAAC,GAAG,UAAU,EAAE,IAAI,IAAI,IAAI,EAA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C,CAAC,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;SACtM,CAAC;QACF,GAAG,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC;KACpJ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACrC,CAAC,CAAC"}
@@ -1,3 +1,4 @@
1
1
  export type { Commands } from './commands.js';
2
2
  export * from './create.js';
3
+ export { describe } from './describe.js';
3
4
  export { render, type RenderContext, type RenderTable } from './render.js';
@@ -1,3 +1,4 @@
1
1
  export * from './create.js';
2
+ export { describe } from './describe.js';
2
3
  export { render } from './render.js';
3
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interface/system/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAwC,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interface/system/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAwC,MAAM,aAAa,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import type { Schema } from '../schema/schema.js';
2
+ import type { CommandLists } from './access.js';
2
3
  import type { Resolved } from './declaration.js';
3
4
  import type { Name } from './name.js';
4
5
  /** The schema of a body's input: an object of named fields. */
@@ -16,4 +17,9 @@ export type Leaf = {
16
17
  readonly declaration: Resolved;
17
18
  readonly input: InputSchema | undefined;
18
19
  readonly body: (...parameters: never[]) => void;
20
+ /**
21
+ * What its body's commands name, as the build inferred them: null where it couldn't follow them, undefined for
22
+ * none. Apart from its declaration, so a module evaluated again with other commands declares the same system.
23
+ */
24
+ readonly commands?: CommandLists | null;
19
25
  };
@@ -33,6 +33,7 @@ export const render = (declaration, body) => {
33
33
  },
34
34
  input: undefined,
35
35
  body,
36
+ commands: undefined,
36
37
  };
37
38
  if (uses.write.length > 0 || uses.reduce.length > 0)
38
39
  throw new Error(`${what} writes or reduces into resources; a render system only reads.`);
@@ -1 +1 @@
1
- {"version":3,"file":"render.js","sourceRoot":"","sources":["../../../src/interface/system/render.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAGrD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAGvD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAsD/D;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAClB,WAAuG,EACvG,IAA6B,EACvB,EAAE;IACR,MAAM,EAAE,GAAG,mBAAmB,CAAC,WAAW,CAAC,CAAC;IAC5C,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,EAAE,EAAE,EAAE,QAAQ,CAAC,CAA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AAClB,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { ComponentAccess, ComponentLists, Lookup, SystemLookup, SystemLookupLists } from './access.js';
1
+ import type { CommandLists, ComponentAccess, ComponentLists, Lookup, SystemLookup, SystemLookupLists } from './access.js';
2
2
  type Key = symbol;
3
3
  /** What a body reads and writes of a group of keys, and those it changes inside their values, read as well. */
4
4
  type Used = {
@@ -23,6 +23,8 @@ export type Access = {
23
23
  readonly up: readonly Key[] | null;
24
24
  /** The resources the predicates of its declaration's `where` read; absent without predicates. */
25
25
  readonly where?: readonly Key[] | null;
26
+ /** What its commands name, keys or lists of them, by kind, and whether it despawns; absent where no build said. */
27
+ readonly commands?: unknown;
26
28
  readonly at: string;
27
29
  };
28
30
  /**
@@ -63,6 +65,8 @@ export declare const resourceUses: (what: string, access: Access, is: readonly K
63
65
  * them, since the world couldn't tell when to evaluate them again.
64
66
  */
65
67
  export declare const whereReadsOf: (what: string, components: ComponentAccess | undefined, access: Access) => readonly Key[];
68
+ /** What a body's commands name, as the world takes it: null where the build couldn't follow them, nothing for none. */
69
+ export declare const commandLists: (access: Access) => CommandLists | null | undefined;
66
70
  /** What a body reads of its parent's values. */
67
71
  export declare const upReads: (what: string, access: Access) => readonly Key[];
68
72
  export {};