@oasys/oecs 0.4.0 → 0.5.1

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 (273) hide show
  1. package/CHANGELOG.md +636 -0
  2. package/README.md +47 -32
  3. package/dist/core/ecs/access_check.d.cts +77 -0
  4. package/dist/core/ecs/access_check.d.ts +8 -8
  5. package/dist/core/ecs/access_check.d.ts.map +1 -1
  6. package/dist/core/ecs/archetype.d.cts +486 -0
  7. package/dist/core/ecs/archetype.d.ts +25 -13
  8. package/dist/core/ecs/archetype.d.ts.map +1 -1
  9. package/dist/core/ecs/archetype_graph.d.cts +96 -0
  10. package/dist/core/ecs/archetype_graph.d.ts +96 -0
  11. package/dist/core/ecs/archetype_graph.d.ts.map +1 -0
  12. package/dist/core/ecs/builtin_relations.d.cts +43 -0
  13. package/dist/core/ecs/builtin_relations.d.ts +8 -8
  14. package/dist/core/ecs/builtin_relations.d.ts.map +1 -1
  15. package/dist/core/ecs/command_log.d.cts +116 -0
  16. package/dist/core/ecs/command_log.d.ts +13 -10
  17. package/dist/core/ecs/command_log.d.ts.map +1 -1
  18. package/dist/core/ecs/component.d.cts +201 -0
  19. package/dist/core/ecs/component.d.ts +100 -5
  20. package/dist/core/ecs/component.d.ts.map +1 -1
  21. package/dist/core/ecs/compute_backend.d.cts +37 -0
  22. package/dist/core/ecs/compute_backend.d.ts +2 -2
  23. package/dist/core/ecs/debug_names.d.cts +7 -0
  24. package/dist/core/ecs/debug_names.d.ts +7 -0
  25. package/dist/core/ecs/debug_names.d.ts.map +1 -0
  26. package/dist/core/ecs/deferred_commands.d.cts +55 -0
  27. package/dist/core/ecs/deferred_commands.d.ts +55 -0
  28. package/dist/core/ecs/deferred_commands.d.ts.map +1 -0
  29. package/dist/core/ecs/dispatch_trace.d.cts +93 -0
  30. package/dist/core/ecs/dispatch_trace.d.ts +3 -3
  31. package/dist/core/ecs/ecs.d.cts +580 -0
  32. package/dist/core/ecs/ecs.d.ts +340 -293
  33. package/dist/core/ecs/ecs.d.ts.map +1 -1
  34. package/dist/core/ecs/ecs_memory.d.cts +179 -0
  35. package/dist/core/ecs/ecs_memory.d.ts +1 -1
  36. package/dist/core/ecs/entity.d.cts +34 -0
  37. package/dist/core/ecs/entity.d.ts +8 -2
  38. package/dist/core/ecs/entity.d.ts.map +1 -1
  39. package/dist/core/ecs/entity_allocator.d.cts +59 -0
  40. package/dist/core/ecs/entity_allocator.d.ts +59 -0
  41. package/dist/core/ecs/entity_allocator.d.ts.map +1 -0
  42. package/dist/core/ecs/event.d.cts +79 -0
  43. package/dist/core/ecs/event.d.ts +36 -11
  44. package/dist/core/ecs/event.d.ts.map +1 -1
  45. package/dist/core/ecs/event_registry.d.cts +22 -0
  46. package/dist/core/ecs/event_registry.d.ts +22 -0
  47. package/dist/core/ecs/event_registry.d.ts.map +1 -0
  48. package/dist/core/ecs/facades.d.cts +158 -0
  49. package/dist/core/ecs/facades.d.ts +158 -0
  50. package/dist/core/ecs/facades.d.ts.map +1 -0
  51. package/dist/core/ecs/frame_stepper.d.cts +58 -0
  52. package/dist/core/ecs/frame_stepper.d.ts +58 -0
  53. package/dist/core/ecs/frame_stepper.d.ts.map +1 -0
  54. package/dist/core/ecs/frame_trace.d.cts +133 -0
  55. package/dist/core/ecs/frame_trace.d.ts +5 -5
  56. package/dist/core/ecs/frame_trace.d.ts.map +1 -1
  57. package/dist/core/ecs/host_commands.d.cts +284 -0
  58. package/dist/core/ecs/host_commands.d.ts +77 -45
  59. package/dist/core/ecs/host_commands.d.ts.map +1 -1
  60. package/dist/core/ecs/index.d.cts +46 -0
  61. package/dist/core/ecs/index.d.ts +45 -40
  62. package/dist/core/ecs/index.d.ts.map +1 -1
  63. package/dist/core/ecs/observer.d.cts +173 -0
  64. package/dist/core/ecs/observer.d.ts +44 -13
  65. package/dist/core/ecs/observer.d.ts.map +1 -1
  66. package/dist/core/ecs/query.d.cts +734 -0
  67. package/dist/core/ecs/query.d.ts +267 -90
  68. package/dist/core/ecs/query.d.ts.map +1 -1
  69. package/dist/core/ecs/ref.d.cts +31 -0
  70. package/dist/core/ecs/ref.d.ts +3 -3
  71. package/dist/core/ecs/ref.d.ts.map +1 -1
  72. package/dist/core/ecs/relation.d.cts +243 -0
  73. package/dist/core/ecs/relation.d.ts +26 -14
  74. package/dist/core/ecs/relation.d.ts.map +1 -1
  75. package/dist/core/ecs/relation_service.d.cts +235 -0
  76. package/dist/core/ecs/relation_service.d.ts +235 -0
  77. package/dist/core/ecs/relation_service.d.ts.map +1 -0
  78. package/dist/core/ecs/resource.d.cts +53 -0
  79. package/dist/core/ecs/resource.d.ts +25 -5
  80. package/dist/core/ecs/resource.d.ts.map +1 -1
  81. package/dist/core/ecs/resource_registry.d.cts +20 -0
  82. package/dist/core/ecs/resource_registry.d.ts +20 -0
  83. package/dist/core/ecs/resource_registry.d.ts.map +1 -0
  84. package/dist/core/ecs/resume.d.cts +85 -0
  85. package/dist/core/ecs/resume.d.ts +6 -6
  86. package/dist/core/ecs/resume.d.ts.map +1 -1
  87. package/dist/core/ecs/run_condition.d.cts +81 -0
  88. package/dist/core/ecs/run_condition.d.ts +16 -10
  89. package/dist/core/ecs/run_condition.d.ts.map +1 -1
  90. package/dist/core/ecs/schedule.d.cts +142 -0
  91. package/dist/core/ecs/schedule.d.ts +15 -6
  92. package/dist/core/ecs/schedule.d.ts.map +1 -1
  93. package/dist/core/ecs/snapshot_service.d.cts +94 -0
  94. package/dist/core/ecs/snapshot_service.d.ts +94 -0
  95. package/dist/core/ecs/snapshot_service.d.ts.map +1 -0
  96. package/dist/core/ecs/sparse_store.d.cts +110 -0
  97. package/dist/core/ecs/sparse_store.d.ts +5 -2
  98. package/dist/core/ecs/sparse_store.d.ts.map +1 -1
  99. package/dist/core/ecs/store.d.cts +937 -0
  100. package/dist/core/ecs/store.d.ts +144 -356
  101. package/dist/core/ecs/store.d.ts.map +1 -1
  102. package/dist/core/ecs/store_layout_listener.d.cts +23 -0
  103. package/dist/core/ecs/system.d.cts +250 -0
  104. package/dist/core/ecs/system.d.ts +138 -22
  105. package/dist/core/ecs/system.d.ts.map +1 -1
  106. package/dist/{utils/arrays.d.ts → core/ecs/utils/arrays.d.cts} +1 -0
  107. package/dist/core/ecs/utils/error.d.cts +61 -0
  108. package/dist/core/ecs/utils/error.d.ts +12 -2
  109. package/dist/core/ecs/utils/error.d.ts.map +1 -1
  110. package/dist/core/store/action_ring.d.cts +136 -0
  111. package/dist/core/store/allocator.d.cts +238 -0
  112. package/dist/core/store/allocator.d.ts.map +1 -1
  113. package/dist/core/store/buffer_backed_column.d.cts +69 -0
  114. package/dist/core/store/buffer_backed_column.d.ts +2 -2
  115. package/dist/core/store/column_store.d.cts +273 -0
  116. package/dist/core/store/column_store.d.ts +18 -10
  117. package/dist/core/store/column_store.d.ts.map +1 -1
  118. package/dist/core/store/command_dispatch.d.cts +52 -0
  119. package/dist/core/store/command_ring.d.cts +107 -0
  120. package/dist/core/store/descriptor.d.cts +80 -0
  121. package/dist/core/store/descriptor.d.ts +1 -1
  122. package/dist/core/store/descriptor.d.ts.map +1 -1
  123. package/dist/core/store/entity_index.d.cts +108 -0
  124. package/dist/core/store/event_ring.d.cts +95 -0
  125. package/dist/core/store/extend.d.cts +39 -0
  126. package/dist/core/store/extend.d.ts +3 -73
  127. package/dist/core/store/extend.d.ts.map +1 -1
  128. package/dist/core/store/grow.d.cts +34 -0
  129. package/dist/core/store/grow.d.ts +4 -9
  130. package/dist/core/store/grow.d.ts.map +1 -1
  131. package/dist/core/store/header.d.cts +64 -0
  132. package/dist/core/store/header.d.ts +1 -1
  133. package/dist/core/store/header.d.ts.map +1 -1
  134. package/dist/core/store/index.d.cts +17 -0
  135. package/dist/core/store/index.d.ts +16 -15
  136. package/dist/core/store/index.d.ts.map +1 -1
  137. package/dist/core/store/layout_ops.d.cts +152 -0
  138. package/dist/core/store/layout_ops.d.ts +152 -0
  139. package/dist/core/store/layout_ops.d.ts.map +1 -0
  140. package/dist/core/store/region_table.d.cts +74 -0
  141. package/dist/core/store/region_table.d.ts +1 -1
  142. package/dist/core/store/region_table.d.ts.map +1 -1
  143. package/dist/core/store/snapshot.d.cts +43 -0
  144. package/dist/core/store/snapshot.d.ts +2 -2
  145. package/dist/core/store/state_hash.d.cts +38 -0
  146. package/dist/core/store/state_hash.d.ts +1 -1
  147. package/dist/core/store/store_regions.d.cts +38 -0
  148. package/dist/core/store/store_regions.d.ts +1 -1
  149. package/dist/core/store/vendored_abi/abi.d.ts +43 -0
  150. package/dist/core/store/{__generated__ → vendored_abi}/abi.d.ts.map +1 -1
  151. package/dist/dev_flag.d.cts +2 -0
  152. package/dist/dev_flag.d.ts +2 -0
  153. package/dist/dev_flag.d.ts.map +1 -0
  154. package/dist/extensions/editor/editor.d.cts +172 -0
  155. package/dist/extensions/editor/editor.d.ts +65 -42
  156. package/dist/extensions/editor/editor.d.ts.map +1 -1
  157. package/dist/extensions/editor/field_handle.d.cts +40 -0
  158. package/dist/extensions/editor/field_handle.d.ts +10 -5
  159. package/dist/extensions/editor/field_handle.d.ts.map +1 -1
  160. package/dist/extensions/editor/index.cjs +1 -1
  161. package/dist/extensions/editor/index.d.cts +21 -0
  162. package/dist/extensions/editor/index.d.ts +2 -2
  163. package/dist/extensions/editor/index.js +130 -100
  164. package/dist/extensions/reactive/ecs_sync.d.cts +214 -0
  165. package/dist/extensions/reactive/ecs_sync.d.ts +26 -22
  166. package/dist/extensions/reactive/ecs_sync.d.ts.map +1 -1
  167. package/dist/extensions/reactive/index.cjs +1 -1
  168. package/dist/extensions/reactive/index.d.cts +23 -0
  169. package/dist/extensions/reactive/index.d.ts +1 -1
  170. package/dist/extensions/reactive/index.js +106 -116
  171. package/dist/extensions/solid/index.cjs +1 -1
  172. package/dist/extensions/solid/index.d.cts +6 -0
  173. package/dist/extensions/solid/index.d.ts +2 -2
  174. package/dist/extensions/solid/index.js +8 -4
  175. package/dist/extensions/solid/kernel_solid.d.cts +45 -0
  176. package/dist/extensions/solid/kernel_solid.d.ts +6 -3
  177. package/dist/extensions/solid/kernel_solid.d.ts.map +1 -1
  178. package/dist/host_commands-BI8pEmjH.js +2326 -0
  179. package/dist/host_commands-CxhpzMx9.cjs +1 -0
  180. package/dist/index.cjs +1 -2
  181. package/dist/index.d.cts +66 -0
  182. package/dist/index.d.ts +50 -1
  183. package/dist/index.d.ts.map +1 -1
  184. package/dist/index.js +4489 -5898
  185. package/dist/internal.cjs +2 -0
  186. package/dist/internal.d.cts +20 -0
  187. package/dist/internal.d.ts +20 -0
  188. package/dist/internal.d.ts.map +1 -0
  189. package/dist/internal.js +141 -0
  190. package/dist/primitives.cjs +1 -1
  191. package/dist/primitives.d.cts +18 -0
  192. package/dist/primitives.d.ts +6 -6
  193. package/dist/primitives.js +24 -23
  194. package/dist/reactive/array.d.ts +24 -0
  195. package/dist/reactive/array.d.ts.map +1 -0
  196. package/dist/reactive/index.cjs +1 -0
  197. package/dist/reactive/index.d.cts +11 -0
  198. package/dist/reactive/index.d.ts +11 -0
  199. package/dist/reactive/index.d.ts.map +1 -0
  200. package/dist/reactive/index.js +18 -0
  201. package/dist/reactive/interop.d.cts +19 -0
  202. package/dist/{core/reactive → reactive}/interop.d.ts +1 -1
  203. package/dist/reactive/interop.d.ts.map +1 -0
  204. package/dist/reactive/kernel.d.cts +73 -0
  205. package/dist/{core/reactive → reactive}/kernel.d.ts +5 -3
  206. package/dist/reactive/kernel.d.ts.map +1 -0
  207. package/dist/reactive/map.d.ts +16 -0
  208. package/dist/reactive/map.d.ts.map +1 -0
  209. package/dist/reactive/shallow.d.cts +11 -0
  210. package/dist/reactive/shallow.d.ts +11 -0
  211. package/dist/reactive/shallow.d.ts.map +1 -0
  212. package/dist/reactive/struct.d.cts +10 -0
  213. package/dist/{core/reactive → reactive}/struct.d.ts +1 -1
  214. package/dist/reactive/struct.d.ts.map +1 -0
  215. package/dist/shallow-DQ8aG51_.cjs +1 -0
  216. package/dist/shallow-DfnAm9vG.js +150 -0
  217. package/dist/shared-BU1Cd40h.js +103 -0
  218. package/dist/shared-BymrGTyR.cjs +1 -0
  219. package/dist/shared.cjs +1 -1
  220. package/dist/shared.d.cts +22 -0
  221. package/dist/shared.d.ts +2 -2
  222. package/dist/shared.js +1 -1
  223. package/dist/topological_sort-BDvEyb9W.cjs +1 -0
  224. package/dist/topological_sort-DK6EjpWa.js +135 -0
  225. package/dist/type_primitives/assertions.d.cts +32 -0
  226. package/dist/type_primitives/assertions.d.ts +13 -1
  227. package/dist/type_primitives/assertions.d.ts.map +1 -1
  228. package/dist/type_primitives/binary_heap/binary_heap.d.cts +37 -0
  229. package/dist/type_primitives/bitset/bitset.d.cts +54 -0
  230. package/dist/type_primitives/brand.d.cts +23 -0
  231. package/dist/type_primitives/error.d.cts +16 -0
  232. package/dist/type_primitives/error.d.ts +4 -3
  233. package/dist/type_primitives/error.d.ts.map +1 -1
  234. package/dist/type_primitives/index.d.cts +13 -0
  235. package/dist/type_primitives/index.d.ts +9 -9
  236. package/dist/type_primitives/sparse_map/sparse_map.d.cts +30 -0
  237. package/dist/type_primitives/sparse_set/sparse_set.d.cts +28 -0
  238. package/dist/type_primitives/topological_sort/topological_sort.d.cts +29 -0
  239. package/dist/type_primitives/typed_arrays/typed_arrays.d.cts +127 -0
  240. package/dist/typed_arrays-BcXcnzB4.js +258 -0
  241. package/dist/typed_arrays-D3NmwtCG.cjs +1 -0
  242. package/dist/utils/error.d.cts +6 -0
  243. package/dist/version.d.cts +10 -0
  244. package/dist/version.d.ts +10 -0
  245. package/dist/version.d.ts.map +1 -0
  246. package/package.json +102 -19
  247. package/dist/array-CxbPyiHO.cjs +0 -1
  248. package/dist/array-uFR7Q8fU.js +0 -132
  249. package/dist/core/reactive/array.d.ts.map +0 -1
  250. package/dist/core/reactive/index.cjs +0 -1
  251. package/dist/core/reactive/index.d.ts +0 -10
  252. package/dist/core/reactive/index.d.ts.map +0 -1
  253. package/dist/core/reactive/index.js +0 -17
  254. package/dist/core/reactive/interop.d.ts.map +0 -1
  255. package/dist/core/reactive/kernel.d.ts.map +0 -1
  256. package/dist/core/reactive/map.d.ts.map +0 -1
  257. package/dist/core/reactive/struct.d.ts.map +0 -1
  258. package/dist/log/console_sink.d.ts +0 -4
  259. package/dist/log/console_sink.d.ts.map +0 -1
  260. package/dist/log/index.d.ts +0 -3
  261. package/dist/log/index.d.ts.map +0 -1
  262. package/dist/log/logger.d.ts +0 -27
  263. package/dist/log/logger.d.ts.map +0 -1
  264. package/dist/shared-BXSZnxx4.cjs +0 -1
  265. package/dist/shared-C678TAPY.js +0 -99
  266. package/dist/topological_sort-DlRpSrxu.js +0 -391
  267. package/dist/topological_sort-WAT-VHb-.cjs +0 -1
  268. package/dist/utils/arrays.d.ts.map +0 -1
  269. package/dist/utils/constants.d.ts.map +0 -1
  270. /package/dist/{utils/constants.d.ts → core/ecs/utils/constants.d.cts} +0 -0
  271. /package/dist/core/store/{__generated__/abi.d.ts → vendored_abi/abi.d.cts} +0 -0
  272. /package/dist/{core/reactive/array.d.ts → reactive/array.d.cts} +0 -0
  273. /package/dist/{core/reactive/map.d.ts → reactive/map.d.cts} +0 -0
@@ -0,0 +1,172 @@
1
+ import { ComponentDef, ComponentHandle, ComponentSchema, EntityID, CompleteFieldValues, HostCommand, HostCommandQueue, SpawnEntries } from '../../core/ecs/index.cjs';
2
+ /**
3
+ * Reads the committed value of one `(entity, component, field)` slot — the editor
4
+ * uses it to seed a `setField` inverse with the value the edit replaced. Wire it
5
+ * to the reactive read channel (e.g. a `reactiveMap`/`reactiveStruct` projection)
6
+ * or to `ecs.getField`; `undefined` for an unknown slot falls back to `0`.
7
+ */
8
+ export type FieldReader = (entityId: EntityID, def: ComponentDef, field: string) => number | undefined;
9
+ /**
10
+ * A reified, undoable unit of editor work: the `forward` commands and their
11
+ * `inverse`, both plain `HostCommand` data on the one bus. The arrays are mutable
12
+ * internally (the spawn/despawn id finalizers patch a slot at apply time) but the
13
+ * type handed back from {@link Editor.transaction} is read-only.
14
+ */
15
+ export interface EditorTransaction {
16
+ readonly forward: readonly HostCommand[];
17
+ readonly inverse: readonly HostCommand[];
18
+ }
19
+ /**
20
+ * Accumulates the `forward`/`inverse` commands for ONE transaction. Each method
21
+ * appends a forward command and its inverse, computing the inverse from the
22
+ * shadow / read channel where needed. Spawn and despawn install id-finalizers
23
+ * (via `HostCommand.onSpawned`) that patch the apply-time id into the right slot.
24
+ *
25
+ * Obtained from {@link Editor.transaction}; not constructed directly.
26
+ */
27
+ export declare class TransactionBuilder {
28
+ private readonly readField;
29
+ private readonly shadow;
30
+ /** Values staged by THIS build, layered over the editor's shared shadow. Kept
31
+ * transaction-local so an aborted build (the callback throws before commit)
32
+ * leaves the shared shadow untouched — a phantom staged value would poison
33
+ * `pendingField` and seed the NEXT edit's inverse with a value the world never
34
+ * held. The one merge point into the shared shadow is commit's `applyShadow`. */
35
+ private readonly staged;
36
+ /** @internal */
37
+ constructor(readField: FieldReader, shadow: Map<string, number>);
38
+ private get _txn();
39
+ /**
40
+ * Spawn an entity carrying `components`. Inverse: despawn the created entity,
41
+ * finalized once the spawn applies (the id only exists post-flush). `onSpawned`
42
+ * also forwards the new id to the caller. The finalizer re-fires on redo, so the
43
+ * inverse tracks the current id.
44
+ */
45
+ spawn<Defs extends readonly ComponentDef[]>(components: SpawnEntries<Defs>, onSpawned?: (entityId: EntityID) => void): this;
46
+ /**
47
+ * Despawn `entityId`. Inverse: respawn from `restore` (the components+values to
48
+ * recreate — read them from the channel before despawning). Undo respawns the
49
+ * DATA, not the identity: the new entity gets a fresh id, and the respawn's
50
+ * `onSpawned` rewrites this despawn's target so redo removes the respawned
51
+ * entity rather than the dead original.
52
+ */
53
+ despawn<Defs extends readonly ComponentDef[]>(entityId: EntityID, restore: SpawnEntries<Defs>): this;
54
+ /**
55
+ * Set `field` of `def` on `entityId` to `value`. Inverse: set it back to the value
56
+ * this edit replaced — read from the staged overlay / shadow (so stacked edits,
57
+ * within one build or before a commit, invert correctly) or, failing that, the
58
+ * read channel (`0` if unknown).
59
+ */
60
+ setField<S extends ComponentSchema>(entityId: EntityID, def: ComponentDef<S>, field: string & keyof S, value: number): this;
61
+ /** Attach `def` (with complete `values`) to `entityId`. Inverse: remove it.
62
+ * Bare `add` — the namespaced-handle grammar (matches `ctx.commands.add` and
63
+ * the queue's `add`), not `addComponent`. */
64
+ add<S extends ComponentSchema>(entityId: EntityID, def: ComponentDef<S>, values: CompleteFieldValues<S>): this;
65
+ /**
66
+ * Detach `def` from `entityId`. Inverse: re-add it from `restore` (the field values
67
+ * to recreate — read them from the channel before removing). Bare `remove` — see `add`.
68
+ */
69
+ remove<S extends ComponentSchema>(entityId: EntityID, def: ComponentDef<S>, restore: CompleteFieldValues<S>): this;
70
+ /** Disable `entityId`. Inverse: enable it. */
71
+ disable(entityId: EntityID): this;
72
+ /** Enable `entityId`. Inverse: disable it. */
73
+ enable(entityId: EntityID): this;
74
+ }
75
+ /**
76
+ * The editor's undo/redo manager over a {@link HostCommandQueue}. Each action is a
77
+ * reified {@link EditorTransaction} pushed onto the undo stack; `undo()`/`redo()`
78
+ * enqueue its inverse/forward on the SAME bus. The single-action methods
79
+ * (`spawn`, `setField`, …) are sugar for one-command transactions; `transaction`
80
+ * groups several into one undo entry.
81
+ *
82
+ * Construct with the queue and a {@link FieldReader} for the committed read
83
+ * channel (used to seed `setField` inverses).
84
+ */
85
+ export declare class Editor {
86
+ private readonly queue;
87
+ private readonly readField;
88
+ private readonly undoStack;
89
+ private readonly redoStack;
90
+ /** onChange subscribers — see {@link onChange}. */
91
+ private readonly listeners;
92
+ /** Per-`(entity, component, field)` shadow of edited values, for inverse correctness. */
93
+ private readonly shadow;
94
+ constructor(queue: HostCommandQueue, readField: FieldReader);
95
+ /**
96
+ * Group several actions into ONE undo entry. Build them on the passed
97
+ * {@link TransactionBuilder}; the whole group commits (enqueues its forward
98
+ * commands) and lands on the undo stack atomically, clearing the redo stack.
99
+ */
100
+ transaction(build: (tx: TransactionBuilder) => void): EditorTransaction;
101
+ /** Spawn `components` as its own undo entry. `onSpawned` reports the new id. */
102
+ spawn<Defs extends readonly ComponentDef[]>(components: SpawnEntries<Defs>, onSpawned?: (entityId: EntityID) => void): EditorTransaction;
103
+ /** Despawn `entityId` as its own undo entry; `restore` recreates it on undo. */
104
+ despawn<Defs extends readonly ComponentDef[]>(entityId: EntityID, restore: SpawnEntries<Defs>): EditorTransaction;
105
+ /** Set one field as its own undo entry. */
106
+ setField<S extends ComponentSchema>(entityId: EntityID, def: ComponentDef<S>, field: string & keyof S, value: number): EditorTransaction;
107
+ /** Attach a component as its own undo entry. Bare `add` (see `TransactionBuilder.add`). */
108
+ add<S extends ComponentSchema>(entityId: EntityID, def: ComponentDef<S>, values: CompleteFieldValues<S>): EditorTransaction;
109
+ /** Detach a component as its own undo entry; `restore` re-adds it on undo. Bare `remove`. */
110
+ remove<S extends ComponentSchema>(entityId: EntityID, def: ComponentDef<S>, restore: CompleteFieldValues<S>): EditorTransaction;
111
+ /** Disable `entityId` as its own undo entry. */
112
+ disable(entityId: EntityID): EditorTransaction;
113
+ /** Enable `entityId` as its own undo entry. */
114
+ enable(entityId: EntityID): EditorTransaction;
115
+ /**
116
+ * Undo the most recent transaction: enqueue its inverse commands (in reverse
117
+ * order — a group unwinds last-action-first) on the bus and move it to the redo
118
+ * stack. Returns `false` if the undo stack is empty.
119
+ */
120
+ undo(): boolean;
121
+ /**
122
+ * Redo the most recently undone transaction: re-enqueue its forward commands on
123
+ * the bus and move it back to the undo stack. Returns `false` if the redo stack
124
+ * is empty.
125
+ */
126
+ redo(): boolean;
127
+ /** Drop both stacks (e.g. on load). Does not touch the world. */
128
+ clear(): void;
129
+ /** Current stack depths — for an "Undo (3)" / "Redo" affordance. */
130
+ depths(): {
131
+ undo: number;
132
+ redo: number;
133
+ };
134
+ /** `true` when `undo()` would do something — allocation-free (M10). */
135
+ get canUndo(): boolean;
136
+ /** `true` when `redo()` would do something — allocation-free (M10). */
137
+ get canRedo(): boolean;
138
+ /**
139
+ * Subscribe to undo/redo-stack changes: fires after every commit, undo,
140
+ * redo, and clear — the push signal an "Undo (3)" affordance needs instead
141
+ * of polling `depths()` per frame (M10). Returns an unsubscribe function.
142
+ * Callbacks run synchronously in subscription order; read `canUndo` /
143
+ * `canRedo` / `depths()` inside.
144
+ */
145
+ onChange(cb: () => void): () => void;
146
+ private notify;
147
+ /** Read one committed `(entity, component, field)` slot through the reader
148
+ * this editor was constructed with — the default read for `fieldHandle`
149
+ * when no channel thunk is supplied (M11). */
150
+ committedField(entityId: EntityID, def: ComponentDef, field: string): number | undefined;
151
+ /**
152
+ * The pending value the editor believes for a field that the committed read
153
+ * channel has NOT caught up to yet (the shadow), or `undefined` if none. Lets an
154
+ * inspector echo an edit between the `set` and the tick that commits it.
155
+ *
156
+ * Self-resolving: once the read channel reports the shadowed value (the edit
157
+ * landed) — or reports `undefined` (the slot is gone: entity despawned or
158
+ * component removed) — the entry is dropped and this returns `undefined`, so
159
+ * `pending` does not outlive its set→commit window and shadow a later external
160
+ * write, nor a dead slot's lifetime. The one
161
+ * residual: if an external write changes the field to a *different* value within
162
+ * the same window before this is next consulted, `pending` can read stale until
163
+ * the next edit to the slot. `value` (the read channel) is always the source of
164
+ * truth; `pending` is only the optimistic bridge.
165
+ */
166
+ pendingField(entityId: EntityID, def: ComponentHandle, field: string): number | undefined;
167
+ /** Enqueue forward commands, record the transaction, clear redo, sync shadow. */
168
+ private commit;
169
+ /** Keep the setField shadow in step with the commands just enqueued. */
170
+ private applyShadow;
171
+ }
172
+ //# sourceMappingURL=editor.d.ts.map
@@ -1,11 +1,11 @@
1
- import { ComponentDef, ComponentHandle, ComponentSchema, EntityID, FieldValues, HostCommand, HostCommandQueue, SpawnEntry } from '../../core/ecs';
1
+ import { ComponentDef, ComponentHandle, ComponentSchema, EntityID, CompleteFieldValues, HostCommand, HostCommandQueue, SpawnEntries } from '../../core/ecs/index.js';
2
2
  /**
3
3
  * Reads the committed value of one `(entity, component, field)` slot — the editor
4
4
  * uses it to seed a `setField` inverse with the value the edit replaced. Wire it
5
5
  * to the reactive read channel (e.g. a `reactiveMap`/`reactiveStruct` projection)
6
- * or to `world.getField`; `undefined` for an unknown slot falls back to `0`.
6
+ * or to `ecs.getField`; `undefined` for an unknown slot falls back to `0`.
7
7
  */
8
- export type FieldReader = (eid: EntityID, def: ComponentDef, field: string) => number | undefined;
8
+ export type FieldReader = (entityId: EntityID, def: ComponentDef, field: string) => number | undefined;
9
9
  /**
10
10
  * A reified, undoable unit of editor work: the `forward` commands and their
11
11
  * `inverse`, both plain `HostCommand` data on the one bus. The arrays are mutable
@@ -16,11 +16,6 @@ export interface EditorTransaction {
16
16
  readonly forward: readonly HostCommand[];
17
17
  readonly inverse: readonly HostCommand[];
18
18
  }
19
- /** Internal, mutable transaction the id-finalizers patch in place. */
20
- interface MutableTxn {
21
- forward: HostCommand[];
22
- inverse: HostCommand[];
23
- }
24
19
  /**
25
20
  * Accumulates the `forward`/`inverse` commands for ONE transaction. Each method
26
21
  * appends a forward command and its inverse, computing the inverse from the
@@ -32,42 +27,50 @@ interface MutableTxn {
32
27
  export declare class TransactionBuilder {
33
28
  private readonly readField;
34
29
  private readonly shadow;
35
- /** @internal */
36
- readonly _txn: MutableTxn;
30
+ /** Values staged by THIS build, layered over the editor's shared shadow. Kept
31
+ * transaction-local so an aborted build (the callback throws before commit)
32
+ * leaves the shared shadow untouched — a phantom staged value would poison
33
+ * `pendingField` and seed the NEXT edit's inverse with a value the world never
34
+ * held. The one merge point into the shared shadow is commit's `applyShadow`. */
35
+ private readonly staged;
37
36
  /** @internal */
38
37
  constructor(readField: FieldReader, shadow: Map<string, number>);
38
+ private get _txn();
39
39
  /**
40
40
  * Spawn an entity carrying `components`. Inverse: despawn the created entity,
41
41
  * finalized once the spawn applies (the id only exists post-flush). `onSpawned`
42
42
  * also forwards the new id to the caller. The finalizer re-fires on redo, so the
43
43
  * inverse tracks the current id.
44
44
  */
45
- spawn(components: readonly SpawnEntry[], onSpawned?: (eid: EntityID) => void): this;
45
+ spawn<Defs extends readonly ComponentDef[]>(components: SpawnEntries<Defs>, onSpawned?: (entityId: EntityID) => void): this;
46
46
  /**
47
- * Despawn `eid`. Inverse: respawn from `restore` (the components+values to
47
+ * Despawn `entityId`. Inverse: respawn from `restore` (the components+values to
48
48
  * recreate — read them from the channel before despawning). Undo respawns the
49
49
  * DATA, not the identity: the new entity gets a fresh id, and the respawn's
50
50
  * `onSpawned` rewrites this despawn's target so redo removes the respawned
51
51
  * entity rather than the dead original.
52
52
  */
53
- despawn(eid: EntityID, restore: readonly SpawnEntry[]): this;
53
+ despawn<Defs extends readonly ComponentDef[]>(entityId: EntityID, restore: SpawnEntries<Defs>): this;
54
54
  /**
55
- * Set `field` of `def` on `eid` to `value`. Inverse: set it back to the value
56
- * this edit replaced — read from the shadow (so stacked edits before a commit
57
- * invert correctly) or, failing that, the read channel (`0` if unknown).
55
+ * Set `field` of `def` on `entityId` to `value`. Inverse: set it back to the value
56
+ * this edit replaced — read from the staged overlay / shadow (so stacked edits,
57
+ * within one build or before a commit, invert correctly) or, failing that, the
58
+ * read channel (`0` if unknown).
58
59
  */
59
- setField<S extends ComponentSchema>(eid: EntityID, def: ComponentDef<S>, field: string & keyof S, value: number): this;
60
- /** Add `def` (with complete `values`) to `eid`. Inverse: remove it. */
61
- addComponent<S extends ComponentSchema>(eid: EntityID, def: ComponentDef<S>, values: FieldValues<S>): this;
60
+ setField<S extends ComponentSchema>(entityId: EntityID, def: ComponentDef<S>, field: string & keyof S, value: number): this;
61
+ /** Attach `def` (with complete `values`) to `entityId`. Inverse: remove it.
62
+ * Bare `add` the namespaced-handle grammar (matches `ctx.commands.add` and
63
+ * the queue's `add`), not `addComponent`. */
64
+ add<S extends ComponentSchema>(entityId: EntityID, def: ComponentDef<S>, values: CompleteFieldValues<S>): this;
62
65
  /**
63
- * Remove `def` from `eid`. Inverse: re-add it from `restore` (the field values
64
- * to recreate — read them from the channel before removing).
66
+ * Detach `def` from `entityId`. Inverse: re-add it from `restore` (the field values
67
+ * to recreate — read them from the channel before removing). Bare `remove` — see `add`.
65
68
  */
66
- removeComponent<S extends ComponentSchema>(eid: EntityID, def: ComponentDef<S>, restore: FieldValues<S>): this;
67
- /** Disable `eid`. Inverse: enable it. */
68
- disable(eid: EntityID): this;
69
- /** Enable `eid`. Inverse: disable it. */
70
- enable(eid: EntityID): this;
69
+ remove<S extends ComponentSchema>(entityId: EntityID, def: ComponentDef<S>, restore: CompleteFieldValues<S>): this;
70
+ /** Disable `entityId`. Inverse: enable it. */
71
+ disable(entityId: EntityID): this;
72
+ /** Enable `entityId`. Inverse: disable it. */
73
+ enable(entityId: EntityID): this;
71
74
  }
72
75
  /**
73
76
  * The editor's undo/redo manager over a {@link HostCommandQueue}. Each action is a
@@ -84,6 +87,8 @@ export declare class Editor {
84
87
  private readonly readField;
85
88
  private readonly undoStack;
86
89
  private readonly redoStack;
90
+ /** onChange subscribers — see {@link onChange}. */
91
+ private readonly listeners;
87
92
  /** Per-`(entity, component, field)` shadow of edited values, for inverse correctness. */
88
93
  private readonly shadow;
89
94
  constructor(queue: HostCommandQueue, readField: FieldReader);
@@ -94,19 +99,19 @@ export declare class Editor {
94
99
  */
95
100
  transaction(build: (tx: TransactionBuilder) => void): EditorTransaction;
96
101
  /** Spawn `components` as its own undo entry. `onSpawned` reports the new id. */
97
- spawn(components: readonly SpawnEntry[], onSpawned?: (eid: EntityID) => void): EditorTransaction;
98
- /** Despawn `eid` as its own undo entry; `restore` recreates it on undo. */
99
- despawn(eid: EntityID, restore: readonly SpawnEntry[]): EditorTransaction;
102
+ spawn<Defs extends readonly ComponentDef[]>(components: SpawnEntries<Defs>, onSpawned?: (entityId: EntityID) => void): EditorTransaction;
103
+ /** Despawn `entityId` as its own undo entry; `restore` recreates it on undo. */
104
+ despawn<Defs extends readonly ComponentDef[]>(entityId: EntityID, restore: SpawnEntries<Defs>): EditorTransaction;
100
105
  /** Set one field as its own undo entry. */
101
- setField<S extends ComponentSchema>(eid: EntityID, def: ComponentDef<S>, field: string & keyof S, value: number): EditorTransaction;
102
- /** Add a component as its own undo entry. */
103
- addComponent<S extends ComponentSchema>(eid: EntityID, def: ComponentDef<S>, values: FieldValues<S>): EditorTransaction;
104
- /** Remove a component as its own undo entry; `restore` re-adds it on undo. */
105
- removeComponent<S extends ComponentSchema>(eid: EntityID, def: ComponentDef<S>, restore: FieldValues<S>): EditorTransaction;
106
- /** Disable `eid` as its own undo entry. */
107
- disable(eid: EntityID): EditorTransaction;
108
- /** Enable `eid` as its own undo entry. */
109
- enable(eid: EntityID): EditorTransaction;
106
+ setField<S extends ComponentSchema>(entityId: EntityID, def: ComponentDef<S>, field: string & keyof S, value: number): EditorTransaction;
107
+ /** Attach a component as its own undo entry. Bare `add` (see `TransactionBuilder.add`). */
108
+ add<S extends ComponentSchema>(entityId: EntityID, def: ComponentDef<S>, values: CompleteFieldValues<S>): EditorTransaction;
109
+ /** Detach a component as its own undo entry; `restore` re-adds it on undo. Bare `remove`. */
110
+ remove<S extends ComponentSchema>(entityId: EntityID, def: ComponentDef<S>, restore: CompleteFieldValues<S>): EditorTransaction;
111
+ /** Disable `entityId` as its own undo entry. */
112
+ disable(entityId: EntityID): EditorTransaction;
113
+ /** Enable `entityId` as its own undo entry. */
114
+ enable(entityId: EntityID): EditorTransaction;
110
115
  /**
111
116
  * Undo the most recent transaction: enqueue its inverse commands (in reverse
112
117
  * order — a group unwinds last-action-first) on the bus and move it to the redo
@@ -126,24 +131,42 @@ export declare class Editor {
126
131
  undo: number;
127
132
  redo: number;
128
133
  };
134
+ /** `true` when `undo()` would do something — allocation-free (M10). */
135
+ get canUndo(): boolean;
136
+ /** `true` when `redo()` would do something — allocation-free (M10). */
137
+ get canRedo(): boolean;
138
+ /**
139
+ * Subscribe to undo/redo-stack changes: fires after every commit, undo,
140
+ * redo, and clear — the push signal an "Undo (3)" affordance needs instead
141
+ * of polling `depths()` per frame (M10). Returns an unsubscribe function.
142
+ * Callbacks run synchronously in subscription order; read `canUndo` /
143
+ * `canRedo` / `depths()` inside.
144
+ */
145
+ onChange(cb: () => void): () => void;
146
+ private notify;
147
+ /** Read one committed `(entity, component, field)` slot through the reader
148
+ * this editor was constructed with — the default read for `fieldHandle`
149
+ * when no channel thunk is supplied (M11). */
150
+ committedField(entityId: EntityID, def: ComponentDef, field: string): number | undefined;
129
151
  /**
130
152
  * The pending value the editor believes for a field that the committed read
131
153
  * channel has NOT caught up to yet (the shadow), or `undefined` if none. Lets an
132
154
  * inspector echo an edit between the `set` and the tick that commits it.
133
155
  *
134
156
  * Self-resolving: once the read channel reports the shadowed value (the edit
135
- * landed), the entry is dropped and this returns `undefined` so `pending` does
136
- * not outlive its set→commit window and shadow a later external write. The one
157
+ * landed) or reports `undefined` (the slot is gone: entity despawned or
158
+ * component removed) the entry is dropped and this returns `undefined`, so
159
+ * `pending` does not outlive its set→commit window and shadow a later external
160
+ * write, nor a dead slot's lifetime. The one
137
161
  * residual: if an external write changes the field to a *different* value within
138
162
  * the same window before this is next consulted, `pending` can read stale until
139
163
  * the next edit to the slot. `value` (the read channel) is always the source of
140
164
  * truth; `pending` is only the optimistic bridge.
141
165
  */
142
- pendingField(eid: EntityID, def: ComponentHandle, field: string): number | undefined;
166
+ pendingField(entityId: EntityID, def: ComponentHandle, field: string): number | undefined;
143
167
  /** Enqueue forward commands, record the transaction, clear redo, sync shadow. */
144
168
  private commit;
145
169
  /** Keep the setField shadow in step with the commands just enqueued. */
146
170
  private applyShadow;
147
171
  }
148
- export {};
149
172
  //# sourceMappingURL=editor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../src/extensions/editor/editor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,KAAK,EACX,YAAY,EACZ,eAAe,EACf,eAAe,EACf,QAAQ,EACR,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,MAAM,gBAAgB,CAAC;AAExB;;;;;GAKG;AACH,MAAM,MAAM,WAAW,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EAAE,GAAG,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAkBzF,iFAAiF;IACjF,OAAO,CAAC,MAAM;IAad,wEAAwE;IACxE,OAAO,CAAC,WAAW;CAOnB"}
@@ -0,0 +1,40 @@
1
+ import { ComponentDef, ComponentSchema, EntityID } from '../../core/ecs/index.cjs';
2
+ import { Editor } from './editor.cjs';
3
+ /**
4
+ * A two-way handle on one `(entity, component, field)` slot. `value` reads the
5
+ * reactive channel (tracked, if read in a tracking scope); `set` enqueues an
6
+ * undoable `setField` command via the editor.
7
+ */
8
+ export interface FieldHandle {
9
+ /**
10
+ * The field's current value through the reactive read channel — `undefined`
11
+ * until the channel has it (e.g. before the spawn's first commit). Read inside
12
+ * a tracking scope to subscribe to the channel; the value reflects the last
13
+ * COMMITTED tick, so a fresh `set` shows up on the next tick.
14
+ */
15
+ readonly value: number | undefined;
16
+ /** Enqueue an undoable `setField` for this slot; applied at the next tick. */
17
+ set(value: number): void;
18
+ /**
19
+ * The editor's pending (not-yet-committed) value for this slot, or `undefined`
20
+ * if none — a NON-reactive read of the editor shadow, for an optimistic echo
21
+ * between the `set` and its commit. Self-resolves to `undefined` once the read
22
+ * channel catches up, so it does not outlive the edit. Not a substitute for
23
+ * `value` in a tracking scope (it does not subscribe); `value` is the source of
24
+ * truth.
25
+ */
26
+ readonly pending: number | undefined;
27
+ }
28
+ /**
29
+ * Build a {@link FieldHandle} for one `(entityId, def, field)` slot. `read` is the
30
+ * tracked read of the reactive channel for this field (e.g.
31
+ * `() => sync.map.get(entityId)?.x`); `set` routes through `editor.setField`, so the
32
+ * edit is queued, batched, and undoable.
33
+ *
34
+ * `read` is optional (M11): omitted, the handle reads through the editor's own
35
+ * committed-channel reader (`editor.committedField`). That default is correct
36
+ * but NOT reactive — supply the channel thunk when the handle's `value` must
37
+ * subscribe inside a tracking scope.
38
+ */
39
+ export declare function fieldHandle<S extends ComponentSchema>(editor: Editor, entityId: EntityID, def: ComponentDef<S>, field: string & keyof S, read?: () => number | undefined): FieldHandle;
40
+ //# sourceMappingURL=field_handle.d.ts.map
@@ -1,5 +1,5 @@
1
- import { ComponentDef, ComponentSchema, EntityID } from '../../core/ecs';
2
- import { Editor } from './editor';
1
+ import { ComponentDef, ComponentSchema, EntityID } from '../../core/ecs/index.js';
2
+ import { Editor } from './editor.js';
3
3
  /**
4
4
  * A two-way handle on one `(entity, component, field)` slot. `value` reads the
5
5
  * reactive channel (tracked, if read in a tracking scope); `set` enqueues an
@@ -26,10 +26,15 @@ export interface FieldHandle {
26
26
  readonly pending: number | undefined;
27
27
  }
28
28
  /**
29
- * Build a {@link FieldHandle} for one `(eid, def, field)` slot. `read` is the
29
+ * Build a {@link FieldHandle} for one `(entityId, def, field)` slot. `read` is the
30
30
  * tracked read of the reactive channel for this field (e.g.
31
- * `() => sync.map.get(eid)?.x`); `set` routes through `editor.setField`, so the
31
+ * `() => sync.map.get(entityId)?.x`); `set` routes through `editor.setField`, so the
32
32
  * edit is queued, batched, and undoable.
33
+ *
34
+ * `read` is optional (M11): omitted, the handle reads through the editor's own
35
+ * committed-channel reader (`editor.committedField`). That default is correct
36
+ * but NOT reactive — supply the channel thunk when the handle's `value` must
37
+ * subscribe inside a tracking scope.
33
38
  */
34
- export declare function fieldHandle<S extends ComponentSchema>(editor: Editor, eid: EntityID, def: ComponentDef<S>, field: string & keyof S, read: () => number | undefined): FieldHandle;
39
+ export declare function fieldHandle<S extends ComponentSchema>(editor: Editor, entityId: EntityID, def: ComponentDef<S>, field: string & keyof S, read?: () => number | undefined): FieldHandle;
35
40
  //# sourceMappingURL=field_handle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"field_handle.d.ts","sourceRoot":"","sources":["../../../src/extensions/editor/field_handle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC9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AAC,EACpB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,EACvB,IAAI,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,GAC7B,WAAW,CAYb"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function o(i,t,n){return`${i}:${t.id}:${n}`}class a{constructor(t,n){this.readField=t,this.shadow=n}_txn={forward:[],inverse:[]};spawn(t,n){const e={kind:"despawn",eid:0};return this._txn.inverse.push(e),this._txn.forward.push({kind:"spawn",components:t,onSpawned:s=>{e.eid=s,n?.(s)}}),this}despawn(t,n){const e={kind:"despawn",eid:t};return this._txn.forward.push(e),this._txn.inverse.push({kind:"spawn",components:n,onSpawned:s=>{e.eid=s}}),this}setField(t,n,e,s){const r=o(t,n,e),d=this.shadow.get(r)??this.readField(t,n,e)??0;return this.shadow.set(r,s),this._txn.forward.push({kind:"set_field",eid:t,def:n,field:e,value:s}),this._txn.inverse.push({kind:"set_field",eid:t,def:n,field:e,value:d}),this}addComponent(t,n,e){return this._txn.forward.push({kind:"add_component",eid:t,def:n,values:e}),this._txn.inverse.push({kind:"remove_component",eid:t,def:n}),this}removeComponent(t,n,e){return this._txn.forward.push({kind:"remove_component",eid:t,def:n}),this._txn.inverse.push({kind:"add_component",eid:t,def:n,values:e}),this}disable(t){return this._txn.forward.push({kind:"disable",eid:t}),this._txn.inverse.push({kind:"enable",eid:t}),this}enable(t){return this._txn.forward.push({kind:"enable",eid:t}),this._txn.inverse.push({kind:"disable",eid:t}),this}}class h{constructor(t,n){this.queue=t,this.readField=n}undoStack=[];redoStack=[];shadow=new Map;transaction(t){const n=new a(this.readField,this.shadow);return t(n),this.commit(n._txn)}spawn(t,n){return this.transaction(e=>e.spawn(t,n))}despawn(t,n){return this.transaction(e=>e.despawn(t,n))}setField(t,n,e,s){return this.transaction(r=>r.setField(t,n,e,s))}addComponent(t,n,e){return this.transaction(s=>s.addComponent(t,n,e))}removeComponent(t,n,e){return this.transaction(s=>s.removeComponent(t,n,e))}disable(t){return this.transaction(n=>n.disable(t))}enable(t){return this.transaction(n=>n.enable(t))}undo(){const t=this.undoStack.pop();if(t===void 0)return!1;const n=t.inverse.slice().reverse();for(const e of n)this.queue.push(e);return this.applyShadow(n),this.redoStack.push(t),!0}redo(){const t=this.redoStack.pop();if(t===void 0)return!1;for(const n of t.forward)this.queue.push(n);return this.applyShadow(t.forward),this.undoStack.push(t),!0}clear(){this.undoStack.length=0,this.redoStack.length=0,this.shadow.clear()}depths(){return{undo:this.undoStack.length,redo:this.redoStack.length}}pendingField(t,n,e){const s=o(t,n,e),r=this.shadow.get(s);if(r!==void 0){if(this.readField(t,n,e)===r){this.shadow.delete(s);return}return r}}commit(t){if(t.forward.length===0)return t;for(const n of t.forward)this.queue.push(n);return this.applyShadow(t.forward),this.undoStack.push(t),this.redoStack.length=0,t}applyShadow(t){for(const n of t)n.kind==="set_field"&&this.shadow.set(o(n.eid,n.def,n.field),n.value)}}function u(i,t,n,e,s){return{get value(){return s()},set(r){i.setField(t,n,e,r)},get pending(){return i.pendingField(t,n,e)}}}exports.Editor=h;exports.TransactionBuilder=a;exports.fieldHandle=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function o(r,t,e){return`${r}:${t.id}:${e}`}const a=new WeakMap;class h{constructor(t,e){this.readField=t,this.shadow=e,a.set(this,{forward:[],inverse:[]})}staged=new Map;get _txn(){return a.get(this)}spawn(t,e){const s={kind:"despawn",eid:0};return this._txn.inverse.push(s),this._txn.forward.push({kind:"spawn",components:t,onSpawned:n=>{s.eid=n,e?.(n)}}),this}despawn(t,e){const s={kind:"despawn",eid:t};return this._txn.forward.push(s),this._txn.inverse.push({kind:"spawn",components:e,onSpawned:n=>{s.eid=n}}),this}setField(t,e,s,n){const i=o(t,e,s),d=this.staged.get(i)??this.shadow.get(i)??this.readField(t,e,s)??0;return this.staged.set(i,n),this._txn.forward.push({kind:"set_field",eid:t,def:e,field:s,value:n}),this._txn.inverse.push({kind:"set_field",eid:t,def:e,field:s,value:d}),this}add(t,e,s){return this._txn.forward.push({kind:"add_component",eid:t,def:e,values:s}),this._txn.inverse.push({kind:"remove_component",eid:t,def:e}),this}remove(t,e,s){return this._txn.forward.push({kind:"remove_component",eid:t,def:e}),this._txn.inverse.push({kind:"add_component",eid:t,def:e,values:s}),this}disable(t){return this._txn.forward.push({kind:"disable",eid:t}),this._txn.inverse.push({kind:"enable",eid:t}),this}enable(t){return this._txn.forward.push({kind:"enable",eid:t}),this._txn.inverse.push({kind:"disable",eid:t}),this}}class u{constructor(t,e){this.queue=t,this.readField=e}undoStack=[];redoStack=[];listeners=[];shadow=new Map;transaction(t){const e=new h(this.readField,this.shadow);return t(e),this.commit(a.get(e))}spawn(t,e){return this.transaction(s=>s.spawn(t,e))}despawn(t,e){return this.transaction(s=>s.despawn(t,e))}setField(t,e,s,n){return this.transaction(i=>i.setField(t,e,s,n))}add(t,e,s){return this.transaction(n=>n.add(t,e,s))}remove(t,e,s){return this.transaction(n=>n.remove(t,e,s))}disable(t){return this.transaction(e=>e.disable(t))}enable(t){return this.transaction(e=>e.enable(t))}undo(){const t=this.undoStack.pop();if(t===void 0)return!1;const e=t.inverse.slice().reverse();for(const s of e)this.queue.push(s);return this.applyShadow(e),this.redoStack.push(t),this.notify(),!0}redo(){const t=this.redoStack.pop();if(t===void 0)return!1;for(const e of t.forward)this.queue.push(e);return this.applyShadow(t.forward),this.undoStack.push(t),this.notify(),!0}clear(){this.undoStack.length=0,this.redoStack.length=0,this.shadow.clear(),this.notify()}depths(){return{undo:this.undoStack.length,redo:this.redoStack.length}}get canUndo(){return this.undoStack.length>0}get canRedo(){return this.redoStack.length>0}onChange(t){return this.listeners.push(t),()=>{const e=this.listeners.indexOf(t);e!==-1&&this.listeners.splice(e,1)}}notify(){for(const t of this.listeners.slice())t()}committedField(t,e,s){return this.readField(t,e,s)}pendingField(t,e,s){const n=o(t,e,s),i=this.shadow.get(n);if(i===void 0)return;const d=this.readField(t,e,s);if(d===i||d===void 0){this.shadow.delete(n);return}return i}commit(t){if(t.forward.length===0)return t;for(const e of t.forward)this.queue.push(e);return this.applyShadow(t.forward),this.undoStack.push(t),this.redoStack.length=0,this.notify(),t}applyShadow(t){for(const e of t)e.kind==="set_field"&&this.shadow.set(o(e.eid,e.def,e.field),e.value)}}function c(r,t,e,s,n){return{get value(){return n!==void 0?n():r.committedField(t,e,s)},set(i){r.setField(t,e,s,i)},get pending(){return r.pendingField(t,e,s)}}}exports.Editor=u;exports.TransactionBuilder=h;exports.fieldHandle=c;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * The host write seam's EDITOR layer (#701) — layer 2 of #681 / PATTERNS §85.
3
+ *
4
+ * Reified undo/redo + the inspector field-handle, built on the shipped typed
5
+ * `HostCommandQueue` (#698). Application policy, so it lives here in
6
+ * `engine-extensions`, not engine core — and it pulls NO third-party / framework
7
+ * dependency (the field-handle reads through a caller-supplied thunk).
8
+ *
9
+ * - `Editor` — reified `EditorTransaction`s on undo/redo stacks, with
10
+ * transaction grouping; `undo()`/`redo()` enqueue the inverse/forward on the
11
+ * SAME bus, applied at the next schedule head (undo is just another command).
12
+ * - `fieldHandle` — pairs a reactive-channel read with a `setField` command, so
13
+ * an inspector field feels two-way while staying safe and undoable.
14
+ *
15
+ * Reachable as `@oasys/oecs/editor`. Pair it with
16
+ * `@oasys/oecs/reactive-sync`'s `syncFieldsToMap` /
17
+ * `syncSingletonToStruct` for the read channel the field-handle reads through.
18
+ */
19
+ export { Editor, TransactionBuilder, type EditorTransaction, type FieldReader } from './editor.cjs';
20
+ export { fieldHandle, type FieldHandle } from './field_handle.cjs';
21
+ //# sourceMappingURL=index.d.ts.map
@@ -16,6 +16,6 @@
16
16
  * `@oasys/oecs/reactive-sync`'s `syncFieldsToMap` /
17
17
  * `syncSingletonToStruct` for the read channel the field-handle reads through.
18
18
  */
19
- export { Editor, TransactionBuilder, type EditorTransaction, type FieldReader } from './editor';
20
- export { fieldHandle, type FieldHandle } from './field_handle';
19
+ export { Editor, TransactionBuilder, type EditorTransaction, type FieldReader } from './editor.js';
20
+ export { fieldHandle, type FieldHandle } from './field_handle.js';
21
21
  //# sourceMappingURL=index.d.ts.map