@graphrefly/graphrefly 0.36.0 → 0.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/dist/{chunk-J6TGRQUP.js → chunk-2YFDSYEF.js} +1 -1
  2. package/dist/{chunk-JUJEPZOI.js → chunk-4BDQXBXE.js} +1 -1
  3. package/dist/chunk-5BGFS2XH.js +1 -0
  4. package/dist/chunk-6773HURD.js +1 -0
  5. package/dist/{chunk-AQC53OWG.js → chunk-6KZZ6XQE.js} +1 -1
  6. package/dist/{chunk-5CPPC75H.js → chunk-6VFC334U.js} +1 -1
  7. package/dist/{chunk-KUVDFOJH.js → chunk-7KZZLWZ6.js} +1 -1
  8. package/dist/{chunk-Q7EUZ6NN.js → chunk-B5S7KTGP.js} +1 -1
  9. package/dist/chunk-CMTN3KPT.js +80 -0
  10. package/dist/chunk-DQJLC6YY.js +1 -0
  11. package/dist/chunk-DSOVKKTI.js +1 -0
  12. package/dist/chunk-FAYEMS5M.js +1 -0
  13. package/dist/chunk-FWGIZP3W.js +1 -0
  14. package/dist/{chunk-5Z3AFBN7.js → chunk-G7JN6LCB.js} +1 -1
  15. package/dist/{chunk-PCD2MU7X.js → chunk-IBGE62GZ.js} +1 -1
  16. package/dist/{chunk-MYFR67PY.js → chunk-K5C67OGE.js} +1 -1
  17. package/dist/chunk-KJEAIIIY.js +43 -0
  18. package/dist/chunk-LV3ACS5J.js +1 -0
  19. package/dist/{chunk-7LYIKMW5.js → chunk-NBGPXQSP.js} +1 -1
  20. package/dist/chunk-NN3QPJ6U.js +1 -0
  21. package/dist/{chunk-T6RPUERH.js → chunk-NSAZ6PR6.js} +1 -1
  22. package/dist/{chunk-KCE6WWJE.js → chunk-NV63VQHI.js} +1 -1
  23. package/dist/{chunk-PYEIPRSZ.js → chunk-O245YLM5.js} +1 -1
  24. package/dist/{chunk-K5ZXJPWU.js → chunk-O2BLVQU4.js} +1 -1
  25. package/dist/chunk-PHXZRR6C.js +1 -0
  26. package/dist/{chunk-I57VSGRB.js → chunk-POCWFIJ7.js} +1 -1
  27. package/dist/{chunk-TQSTS3BY.js → chunk-QEVSIVSF.js} +1 -1
  28. package/dist/chunk-QMC2PLNM.js +7 -0
  29. package/dist/chunk-QOJFR6GS.js +1 -0
  30. package/dist/{chunk-MQZWA3DF.js → chunk-RZ5HKPGI.js} +1 -1
  31. package/dist/{chunk-XINLP35X.js → chunk-SFK7MN7S.js} +1 -1
  32. package/dist/{chunk-YOUAVGHJ.js → chunk-SP5O2MIX.js} +1 -1
  33. package/dist/chunk-TB7JKSVS.js +61 -0
  34. package/dist/{chunk-6G5YD37E.js → chunk-TMVY7OWG.js} +1 -1
  35. package/dist/{chunk-F36TA3ET.js → chunk-UAXFKMAG.js} +1 -1
  36. package/dist/{chunk-AACJX2L7.js → chunk-UVLZX2OU.js} +1 -1
  37. package/dist/chunk-XIMFHEKV.js +1 -0
  38. package/dist/{chunk-LO3LO2TO.js → chunk-XLMYQB6F.js} +1 -1
  39. package/dist/{chunk-44QWWUA3.js → chunk-XLYF4LBH.js} +1 -1
  40. package/dist/compat/index.cjs +9 -9
  41. package/dist/compat/index.d.cts +7 -7
  42. package/dist/compat/index.d.ts +7 -7
  43. package/dist/compat/index.js +1 -1
  44. package/dist/compat/nestjs/index.cjs +9 -9
  45. package/dist/compat/nestjs/index.d.cts +5 -5
  46. package/dist/compat/nestjs/index.d.ts +5 -5
  47. package/dist/compat/nestjs/index.js +1 -1
  48. package/dist/compat/zustand/index.cjs +7 -7
  49. package/dist/compat/zustand/index.d.cts +3 -3
  50. package/dist/compat/zustand/index.d.ts +3 -3
  51. package/dist/compat/zustand/index.js +1 -1
  52. package/dist/{composite-_XckYx2e.d.cts → composite-CgG0MqHm.d.cts} +8 -1
  53. package/dist/{composite-CT_mApQD.d.ts → composite-DTOlDuch.d.ts} +8 -1
  54. package/dist/core/index.cjs +1 -1
  55. package/dist/core/index.d.cts +2 -2
  56. package/dist/core/index.d.ts +2 -2
  57. package/dist/core/index.js +1 -1
  58. package/dist/extra/index.cjs +19 -19
  59. package/dist/extra/index.d.cts +5 -5
  60. package/dist/extra/index.d.ts +5 -5
  61. package/dist/extra/index.js +1 -1
  62. package/dist/extra/node.cjs +2 -2
  63. package/dist/extra/node.d.cts +107 -1
  64. package/dist/extra/node.d.ts +107 -1
  65. package/dist/extra/node.js +2 -2
  66. package/dist/extra/operators.cjs +1 -1
  67. package/dist/extra/operators.js +1 -1
  68. package/dist/extra/reactive.d.cts +1 -1
  69. package/dist/extra/reactive.d.ts +1 -1
  70. package/dist/extra/reactive.js +1 -1
  71. package/dist/extra/sources.cjs +1 -1
  72. package/dist/extra/sources.js +1 -1
  73. package/dist/extra/storage-tiers-browser.d.cts +76 -5
  74. package/dist/extra/storage-tiers-browser.d.ts +76 -5
  75. package/dist/extra/storage-tiers-node.d.cts +137 -13
  76. package/dist/extra/storage-tiers-node.d.ts +137 -13
  77. package/dist/extra/storage-tiers.d.cts +151 -23
  78. package/dist/extra/storage-tiers.d.ts +151 -23
  79. package/dist/graph/index.cjs +7 -7
  80. package/dist/graph/index.d.cts +4 -4
  81. package/dist/graph/index.d.ts +4 -4
  82. package/dist/graph/index.js +1 -1
  83. package/dist/{graph-Cv-8x0ZI.d.ts → graph-BjW1taJl.d.ts} +243 -11
  84. package/dist/{graph-kTltt95s.d.cts → graph-CHsVwf9S.d.cts} +243 -11
  85. package/dist/{index-CZAixNU3.d.ts → index-5dNRlW7J.d.ts} +3 -3
  86. package/dist/{index-DtSVSKnd.d.ts → index-AUqWe_fX.d.ts} +7 -4
  87. package/dist/{index-DLyQC5Ww.d.ts → index-B-ORMr3k.d.ts} +2 -2
  88. package/dist/{index-C4ig7whw.d.cts → index-B2IUcH13.d.cts} +2 -2
  89. package/dist/{index-KeBhbNg3.d.ts → index-BFaALJxR.d.ts} +2 -2
  90. package/dist/{index-CsD0fqnO.d.ts → index-BI1wMfyc.d.ts} +2 -2
  91. package/dist/{index-DxxvGTXp.d.ts → index-BUFCHvOR.d.ts} +2 -2
  92. package/dist/{index-HCp5ua_i.d.cts → index-BWUMIt7J.d.cts} +3 -3
  93. package/dist/{index-DHv2M7s8.d.cts → index-BaSy4L6w.d.cts} +37 -17
  94. package/dist/{index-BhkPzu-Z.d.cts → index-BgzPO43H.d.cts} +2 -2
  95. package/dist/{index-BsZlbHM5.d.cts → index-BhzwpIJc.d.cts} +1 -1
  96. package/dist/{index-BC-xjOrd.d.cts → index-BkQqf1EF.d.cts} +80 -7
  97. package/dist/{index-BBdwz2BW.d.ts → index-BmWuVdER.d.ts} +2 -2
  98. package/dist/{index-CVhBdCMf.d.ts → index-Bn0uZEL4.d.ts} +2 -2
  99. package/dist/{index-33mF4XyU.d.cts → index-BpMZzX9P.d.cts} +2 -2
  100. package/dist/{index-ZhKyR8co.d.cts → index-Bpr0Pwgl.d.cts} +2 -2
  101. package/dist/{index-2URa-V4S.d.cts → index-BqcgiSQg.d.cts} +2 -2
  102. package/dist/{index-DzYTXMBz.d.ts → index-BsZk9T8y.d.ts} +1 -1
  103. package/dist/{index-CvUrRb4m.d.cts → index-BsgxnHN8.d.cts} +2 -2
  104. package/dist/index-Bub6x_D4.d.cts +427 -0
  105. package/dist/{index-BZ1V5GzX.d.ts → index-BwOsJfLJ.d.ts} +2 -2
  106. package/dist/{index-BuMzxRO2.d.ts → index-Byp771zP.d.ts} +1 -1
  107. package/dist/{index-DKp1CIbG.d.cts → index-C-3UXnHT.d.cts} +1 -1
  108. package/dist/{index-GaW6Welt.d.cts → index-C56XZiDe.d.cts} +2 -2
  109. package/dist/{index-k67aNfqC.d.cts → index-CAV-3RpJ.d.cts} +2 -2
  110. package/dist/{index-DmtWMP0X.d.cts → index-CAbHN_rP.d.cts} +1 -1
  111. package/dist/{index-BTJxM-wZ.d.ts → index-CEVzBWeB.d.ts} +2 -2
  112. package/dist/{index-BVNGEX7d.d.cts → index-CM-i58FY.d.cts} +2 -2
  113. package/dist/{index-EfPb77rT.d.cts → index-CQsqqEVz.d.cts} +1 -1
  114. package/dist/{index-Cot94_82.d.ts → index-CijfwEWx.d.ts} +2 -2
  115. package/dist/{index-PluovH45.d.cts → index-Ckil6miL.d.cts} +2 -2
  116. package/dist/{index-XxSeddWP.d.cts → index-CpdnP-0y.d.cts} +1 -1
  117. package/dist/{index-Pu1Wa7en.d.ts → index-CrlHFsiT.d.ts} +37 -17
  118. package/dist/{index-BWH17rK_.d.cts → index-Czk3r0yA.d.cts} +37 -3
  119. package/dist/{index-BlRVj-7Q.d.cts → index-D-B7U42V.d.cts} +2 -2
  120. package/dist/{index-B4s70vYf.d.ts → index-D-HZ7sP4.d.ts} +2 -2
  121. package/dist/{index-Cjrpx2Mg.d.cts → index-D7-RSD93.d.cts} +2 -2
  122. package/dist/{index-kBUQj-rT.d.ts → index-D9vBTuzo.d.ts} +2 -2
  123. package/dist/{index-DzCQt2FJ.d.cts → index-DJNAWzcH.d.cts} +2 -2
  124. package/dist/{index-DSSsxS7B.d.ts → index-DJVQ-t07.d.ts} +2 -2
  125. package/dist/{index-BwYGLgmI.d.ts → index-DKrIuF-r.d.ts} +2 -2
  126. package/dist/{index-DXSLMoma.d.ts → index-DOU1Ee_k.d.ts} +1 -1
  127. package/dist/{index-DlccEIi3.d.ts → index-DTDVDzhA.d.ts} +37 -3
  128. package/dist/{index-B5UR87KG.d.ts → index-DY2f2b9z.d.ts} +4 -2
  129. package/dist/{index-D8IyqHvT.d.cts → index-DeSsvHDD.d.cts} +4 -2
  130. package/dist/index-Di7OdwlO.d.ts +427 -0
  131. package/dist/{index-isdlyeeO.d.ts → index-DqICM_I7.d.ts} +80 -7
  132. package/dist/{index-DFe2Pk2u.d.ts → index-ML6vHKXK.d.ts} +1 -1
  133. package/dist/{index-RJIY7QVW.d.cts → index-UsU9ptzs.d.cts} +7 -4
  134. package/dist/{index-jA_OwwNg.d.ts → index-Vz7KPfgz.d.ts} +1 -1
  135. package/dist/index.cjs +50 -50
  136. package/dist/index.d.cts +32 -32
  137. package/dist/index.d.ts +32 -32
  138. package/dist/index.js +1 -1
  139. package/dist/meta-BYqlATmg.d.ts +98 -0
  140. package/dist/meta-DreaEM_a.d.cts +98 -0
  141. package/dist/patterns/ai/browser.cjs +2 -2
  142. package/dist/patterns/ai/browser.js +1 -1
  143. package/dist/patterns/ai/index.cjs +21 -21
  144. package/dist/patterns/ai/index.d.cts +9 -9
  145. package/dist/patterns/ai/index.d.ts +9 -9
  146. package/dist/patterns/ai/index.js +1 -1
  147. package/dist/patterns/ai/node.js +1 -1
  148. package/dist/patterns/audit/index.cjs +7 -7
  149. package/dist/patterns/audit/index.d.cts +5 -5
  150. package/dist/patterns/audit/index.d.ts +5 -5
  151. package/dist/patterns/audit/index.js +1 -1
  152. package/dist/patterns/cqrs/index.cjs +7 -7
  153. package/dist/patterns/cqrs/index.d.cts +4 -4
  154. package/dist/patterns/cqrs/index.d.ts +4 -4
  155. package/dist/patterns/cqrs/index.js +1 -1
  156. package/dist/patterns/demo-shell/index.cjs +8 -8
  157. package/dist/patterns/demo-shell/index.d.cts +4 -4
  158. package/dist/patterns/demo-shell/index.d.ts +4 -4
  159. package/dist/patterns/demo-shell/index.js +1 -1
  160. package/dist/patterns/domain-templates/index.cjs +7 -7
  161. package/dist/patterns/domain-templates/index.d.cts +3 -3
  162. package/dist/patterns/domain-templates/index.d.ts +3 -3
  163. package/dist/patterns/domain-templates/index.js +1 -1
  164. package/dist/patterns/graphspec/index.cjs +21 -21
  165. package/dist/patterns/graphspec/index.d.cts +3 -3
  166. package/dist/patterns/graphspec/index.d.ts +3 -3
  167. package/dist/patterns/graphspec/index.js +1 -1
  168. package/dist/patterns/guarded-execution/index.cjs +7 -7
  169. package/dist/patterns/guarded-execution/index.d.cts +6 -6
  170. package/dist/patterns/guarded-execution/index.d.ts +6 -6
  171. package/dist/patterns/guarded-execution/index.js +1 -1
  172. package/dist/patterns/harness/index.cjs +12 -12
  173. package/dist/patterns/harness/index.d.cts +8 -8
  174. package/dist/patterns/harness/index.d.ts +8 -8
  175. package/dist/patterns/harness/index.js +1 -1
  176. package/dist/patterns/job-queue/index.cjs +7 -7
  177. package/dist/patterns/job-queue/index.d.cts +4 -4
  178. package/dist/patterns/job-queue/index.d.ts +4 -4
  179. package/dist/patterns/job-queue/index.js +1 -1
  180. package/dist/patterns/lens/index.cjs +7 -7
  181. package/dist/patterns/lens/index.d.cts +4 -4
  182. package/dist/patterns/lens/index.d.ts +4 -4
  183. package/dist/patterns/lens/index.js +1 -1
  184. package/dist/patterns/memory/index.cjs +7 -7
  185. package/dist/patterns/memory/index.d.cts +6 -4
  186. package/dist/patterns/memory/index.d.ts +6 -4
  187. package/dist/patterns/memory/index.js +1 -1
  188. package/dist/patterns/messaging/index.cjs +7 -7
  189. package/dist/patterns/messaging/index.d.cts +4 -4
  190. package/dist/patterns/messaging/index.d.ts +4 -4
  191. package/dist/patterns/messaging/index.js +1 -1
  192. package/dist/patterns/orchestration/index.cjs +7 -7
  193. package/dist/patterns/orchestration/index.d.cts +4 -4
  194. package/dist/patterns/orchestration/index.d.ts +4 -4
  195. package/dist/patterns/orchestration/index.js +1 -1
  196. package/dist/patterns/process/index.cjs +1 -1
  197. package/dist/patterns/process/index.d.cts +5 -5
  198. package/dist/patterns/process/index.d.ts +5 -5
  199. package/dist/patterns/process/index.js +1 -1
  200. package/dist/patterns/reactive-layout/index.cjs +8 -8
  201. package/dist/patterns/reactive-layout/index.d.cts +4 -4
  202. package/dist/patterns/reactive-layout/index.d.ts +4 -4
  203. package/dist/patterns/reactive-layout/index.js +1 -1
  204. package/dist/patterns/reduction/index.cjs +7 -7
  205. package/dist/patterns/reduction/index.d.cts +3 -3
  206. package/dist/patterns/reduction/index.d.ts +3 -3
  207. package/dist/patterns/reduction/index.js +1 -1
  208. package/dist/patterns/refine-loop/index.cjs +8 -8
  209. package/dist/patterns/refine-loop/index.d.cts +5 -5
  210. package/dist/patterns/refine-loop/index.d.ts +5 -5
  211. package/dist/patterns/refine-loop/index.js +1 -1
  212. package/dist/patterns/resilient-pipeline/index.cjs +1 -1
  213. package/dist/patterns/resilient-pipeline/index.d.cts +4 -4
  214. package/dist/patterns/resilient-pipeline/index.d.ts +4 -4
  215. package/dist/patterns/resilient-pipeline/index.js +1 -1
  216. package/dist/patterns/surface/index.cjs +14 -14
  217. package/dist/patterns/surface/index.d.cts +4 -4
  218. package/dist/patterns/surface/index.d.ts +4 -4
  219. package/dist/patterns/surface/index.js +1 -1
  220. package/dist/{pipeline-graph-DdBoRu37.d.ts → pipeline-graph-9JBbmRxA.d.ts} +2 -2
  221. package/dist/{pipeline-graph-BlLBWSZ2.d.cts → pipeline-graph-DuHpXSOn.d.cts} +2 -2
  222. package/dist/{reactive-layout-D9zqqaqK.d.cts → reactive-layout-BMLDB4Vd.d.cts} +1 -1
  223. package/dist/{reactive-layout-Btv0-efV.d.ts → reactive-layout-D-tRiNhg.d.ts} +1 -1
  224. package/dist/{reactive-log-jirQsxMY.d.ts → reactive-log-BgWSA1fg.d.ts} +28 -1
  225. package/dist/{reactive-log-ScpWyqny.d.cts → reactive-log-C3IMAGpT.d.cts} +28 -1
  226. package/dist/resilience-LGBK236C.js +1 -0
  227. package/dist/{topology-tree-CJsT24DP.d.ts → topology-tree-D47-nI6Z.d.ts} +1 -1
  228. package/dist/{topology-tree-C50l9ARE.d.cts → topology-tree-jrZue3ao.d.cts} +1 -1
  229. package/package.json +1 -1
  230. package/dist/chunk-3U7IIQB2.js +0 -1
  231. package/dist/chunk-533RQFF6.js +0 -1
  232. package/dist/chunk-5CZ3KIRJ.js +0 -1
  233. package/dist/chunk-5KPIYVCC.js +0 -7
  234. package/dist/chunk-5RTZ6DXG.js +0 -1
  235. package/dist/chunk-A5HZZYRK.js +0 -1
  236. package/dist/chunk-CGA5RXO6.js +0 -1
  237. package/dist/chunk-DBPFMCVH.js +0 -1
  238. package/dist/chunk-GWOKTENT.js +0 -1
  239. package/dist/chunk-JJTF75VS.js +0 -1
  240. package/dist/chunk-KL7CILPL.js +0 -1
  241. package/dist/chunk-M27MVZCP.js +0 -1
  242. package/dist/chunk-N2GCKKKH.js +0 -43
  243. package/dist/chunk-QKUWS7CO.js +0 -80
  244. package/dist/chunk-YBA5N4XY.js +0 -61
  245. package/dist/index-CI_yjtua.d.ts +0 -139
  246. package/dist/index-D9qoEOj_.d.cts +0 -139
  247. package/dist/meta-BGO6C7K9.d.cts +0 -41
  248. package/dist/meta-CC6EPdpK.d.ts +0 -41
  249. package/dist/resilience-OBU472D2.js +0 -1
@@ -1,8 +1,97 @@
1
1
  import { A as Actor, p as GraphReFlyConfig, V as VersioningLevel, a as Node, b as Messages, K as NodeSink } from './node-fSc-hCv8.js';
2
- import { b as DescribeNodeOutput, D as DescribeDetail, a as DescribeField } from './meta-CC6EPdpK.js';
2
+ import { b as DescribeNodeOutput, D as DescribeDetail, a as DescribeField } from './meta-BYqlATmg.js';
3
3
  import { StorageHandle } from './extra/storage-core.js';
4
4
  import { SnapshotStorageTier } from './extra/storage-tiers.js';
5
5
 
6
+ /**
7
+ * Pure structural diff over `GraphDescribeOutput` snapshots.
8
+ *
9
+ * Produces a {@link DescribeChangeset} of {@link DescribeEvent}s describing the
10
+ * topology delta from `prev` → `next`. Used by `Graph.describe({ reactive:
11
+ * "diff" })` internally and re-exported here for static-snapshot diffing
12
+ * (e.g. computing the topology delta between two persisted snapshots without
13
+ * spinning up a live graph).
14
+ *
15
+ * Topology-only — no value/state events. The data layer lives in
16
+ * `Graph.observe`. Per Tier 1.5.1 (locked Session A.1), `DescribeEvent` and
17
+ * {@link ObserveEvent} have disjoint type sets so a consumer can route both
18
+ * streams without ambiguity.
19
+ *
20
+ * `flushedAt_ns` is taken from `core/clock.ts`'s `monotonicNs()` so callers can
21
+ * order changesets across the same process without wall-clock skew.
22
+ *
23
+ * @module
24
+ */
25
+
26
+ /**
27
+ * Meta dictionary attached to a node, as surfaced by
28
+ * {@link DescribeNodeOutput.meta}. Aliased here so {@link DescribeEvent}'s
29
+ * `node-meta-changed` variant has a stable, narrow type.
30
+ */
31
+ type Meta = Record<string, unknown>;
32
+ /**
33
+ * One topology delta between two `describe()` snapshots. Disjoint from
34
+ * `ObserveEvent` (the data-layer envelope).
35
+ */
36
+ type DescribeEvent = {
37
+ type: "node-added";
38
+ path: string;
39
+ node: DescribeNodeOutput;
40
+ } | {
41
+ type: "node-removed";
42
+ path: string;
43
+ } | {
44
+ type: "node-meta-changed";
45
+ path: string;
46
+ prevMeta: Meta;
47
+ nextMeta: Meta;
48
+ } | {
49
+ type: "edge-added";
50
+ from: string;
51
+ to: string;
52
+ } | {
53
+ type: "edge-removed";
54
+ from: string;
55
+ to: string;
56
+ } | {
57
+ type: "subgraph-mounted";
58
+ path: string;
59
+ } | {
60
+ type: "subgraph-unmounted";
61
+ path: string;
62
+ };
63
+ /**
64
+ * Coalesced batch of {@link DescribeEvent}s emitted as a single DATA wave by
65
+ * `Graph.describe({ reactive: "diff" })` per outermost batch flush.
66
+ *
67
+ * `flushedAt_ns` is monotonic (from `core/clock.ts`); compare against another
68
+ * changeset's `flushedAt_ns` to order them. `events` is empty only when
69
+ * `topologyDiff` is called with two structurally identical snapshots; reactive
70
+ * variants suppress empty changesets so consumers don't see no-op DATA waves.
71
+ */
72
+ type DescribeChangeset = {
73
+ events: ReadonlyArray<DescribeEvent>;
74
+ flushedAt_ns: number;
75
+ };
76
+ /**
77
+ * Pure topology delta from `prev` → `next`. No I/O, no node references — purely
78
+ * over the JSON shape `Graph.describe()` returns.
79
+ *
80
+ * Event ordering within a changeset:
81
+ * 1. `subgraph-mounted` (added subgraphs first — their nodes follow)
82
+ * 2. `node-added`
83
+ * 3. `node-meta-changed`
84
+ * 4. `edge-added`
85
+ * 5. `edge-removed`
86
+ * 6. `node-removed`
87
+ * 7. `subgraph-unmounted` (last — node removals already reported)
88
+ *
89
+ * Each group is emitted in code-point sort order on the path / `${from}->${to}`
90
+ * key so the changeset is deterministic across runs (useful for snapshot
91
+ * tests and golden-output assertions).
92
+ */
93
+ declare function topologyDiff(prev: GraphDescribeOutput, next: GraphDescribeOutput): DescribeChangeset;
94
+
6
95
  /**
7
96
  * Causal walkback over a {@link Graph.describe} snapshot (roadmap §9.2).
8
97
  *
@@ -222,6 +311,25 @@ interface GraphOptions {
222
311
  * time — not mutable afterward (ring buffers can't resize cleanly).
223
312
  */
224
313
  traceCapacity?: number;
314
+ /**
315
+ * Tier 1.5.3 Phase 2.5 (Session A.1 lock + Phase 2.5 design DG1=B, 2026-04-27).
316
+ * Top-level factory identifier for Graph-returning factories (`agentMemory`,
317
+ * `harnessLoop`, `pipelineGraph`, etc.). When set, `describe()` surfaces
318
+ * `factory` + `factoryArgs` at the top of `GraphDescribeOutput` so consumers
319
+ * can identify provenance, and `compileSpec` can delegate reconstruction to
320
+ * `catalog.graphFactories[factory]` with `factoryArgs`. Prefer the
321
+ * post-construction `Graph.prototype.tagFactory(name, args?)` mutator inside
322
+ * the factory body over passing here directly.
323
+ */
324
+ factory?: string;
325
+ /**
326
+ * JSON-serializable subset of the construction args. For non-JSON fields
327
+ * (LLMAdapter, callbacks, embedders), prefer the {@link placeholderArgs}
328
+ * helper which substitutes descriptive `"<Node>"` / `"<function>"` strings
329
+ * (DG2 = ii). Catalog `graphFactories` recipients receive this back during
330
+ * `compileSpec` to recreate the graph with the user-supplied runtime ctx.
331
+ */
332
+ factoryArgs?: unknown;
225
333
  [key: string]: unknown;
226
334
  }
227
335
  /** Filter for {@link Graph.describe} — object-style partial match or predicate. */
@@ -247,7 +355,32 @@ type GraphActorOptions = {
247
355
  };
248
356
  /** Options for {@link Graph.describe} (Phase 3.3b progressive disclosure). */
249
357
  type GraphDescribeOptions = {
250
- actor?: Actor;
358
+ /**
359
+ * Scope `describe()` to what `actor` is allowed to observe. Accepts a
360
+ * static {@link Actor} (resolved at call time) or a `Node<Actor>` — when a
361
+ * Node is passed and `reactive: true` is set, the reactive describe handle
362
+ * subscribes to the actor node and re-derives whenever the actor changes,
363
+ * so harnesses that bind a reactive actor (e.g. per-turn `currentActor`
364
+ * state) get a single live describe Node instead of re-calling
365
+ * `describe({ actor })` per turn.
366
+ *
367
+ * **Cache-undefined semantics:** when a `Node<Actor>` is supplied whose
368
+ * `cache` is `undefined` (e.g. a `producer` that has not yet emitted),
369
+ * describe is treated identically to `actor: undefined` — i.e. **no
370
+ * scoping** (full visibility). This matches every other Node-cache read in
371
+ * the codebase, but means a not-yet-active actor node degrades to "describe
372
+ * everything." Activate the actor node (subscribe + emit, or seed via
373
+ * `state(initial)`) before calling `describe` if you rely on guard
374
+ * scoping. In `reactive: true` mode the describe re-derives once the
375
+ * actor node populates.
376
+ *
377
+ * **Terminal-type handling:** if the supplied `Node<Actor>` emits
378
+ * `COMPLETE`, `ERROR`, or `TEARDOWN`, the reactive describe releases the
379
+ * actor subscription and re-derives one last time against the final
380
+ * `actor.cache` value. Subsequent describe outputs reflect that frozen
381
+ * cache until `handle.dispose()` runs.
382
+ */
383
+ actor?: Actor | Node<Actor>;
251
384
  /**
252
385
  * Node filter. Filters operate on whatever fields the chosen `detail` level
253
386
  * provides. For `metaHas` and `status` filters, use `detail: "standard"` or
@@ -307,14 +440,18 @@ type GraphDescribeOptions = {
307
440
  */
308
441
  asciiCharset?: "unicode" | "ascii";
309
442
  /**
310
- * Reactive describe (D2): when `true`, return `{ node, dispose }` where `node`
311
- * emits a fresh `GraphDescribeOutput` (or format string, if `format` is set)
312
- * every time the graph state settles. Same coalescing as
313
- * {@link Graph.explain} with `{ reactive: true }` — one recompute per
314
- * outermost drain via the batch-flush hook, so large batched mutations
315
- * don't amplify describe work per event.
316
- */
317
- reactive?: boolean;
443
+ * Reactive describe (D2):
444
+ * - `true` return `{ node, dispose }` where `node` emits a fresh
445
+ * `GraphDescribeOutput` (or format string, if `format` is set) every time
446
+ * the graph state settles. Same coalescing as {@link Graph.explain} with
447
+ * `{ reactive: true }`.
448
+ * - `"diff"` return `{ node, dispose }` where `node` emits a
449
+ * {@link DescribeChangeset} per topology change. Empty changesets are
450
+ * suppressed; the initial cache is a synthetic full-add diff so a fresh
451
+ * subscriber sees the current topology as adds via push-on-subscribe.
452
+ * (Tier 1.5.1 — Session A.1 lock).
453
+ */
454
+ reactive?: boolean | "diff";
318
455
  /** Reactive-only: name for the backing derived node (default `"describe"`). */
319
456
  reactiveName?: string;
320
457
  };
@@ -332,6 +469,16 @@ type GraphDescribeOutput = {
332
469
  to: string;
333
470
  }>;
334
471
  subgraphs: string[];
472
+ /**
473
+ * Top-level factory identifier (Tier 1.5.3 Phase 2.5 — DG1=B). Present when
474
+ * the graph was constructed by a Graph-returning factory that called
475
+ * `Graph.prototype.tagFactory(name, args?)` (or set `GraphOptions.factory`).
476
+ * Used by `compileSpec` for catalog-based reconstruction via
477
+ * `catalog.graphFactories[factory]`.
478
+ */
479
+ factory?: string;
480
+ /** JSON-serializable construction args paired with `factory`. */
481
+ factoryArgs?: unknown;
335
482
  /**
336
483
  * Re-read the live graph with higher detail (Phase 3.3b).
337
484
  * Returns a new `GraphDescribeOutput`; the original remains a snapshot.
@@ -494,6 +641,26 @@ type GraphObserveAll = {
494
641
  * - `"full"` — standard + timeline + causal + derived.
495
642
  */
496
643
  type ObserveDetail = "minimal" | "standard" | "full";
644
+ /**
645
+ * Tier name for {@link ObserveEvent} filtering. Aligns with spec §1.2 message
646
+ * tier semantics — each `ObserveTier` corresponds to one or more protocol
647
+ * message types. Used by {@link ObserveOptions.tiers} to scope observation to
648
+ * a subset of event categories (e.g. `tiers: ["error", "complete", "teardown"]`
649
+ * for failure-only health monitoring).
650
+ */
651
+ type ObserveTier = ObserveEvent["type"];
652
+ /**
653
+ * Coalesced batch of {@link ObserveEvent}s emitted as one DATA wave per
654
+ * outermost batch flush by `Graph.observe({ reactive: true })`.
655
+ *
656
+ * Disjoint from `DescribeChangeset` (the topology-layer envelope). Each event
657
+ * carries its own `path` so consumers route per-path without unwrapping the
658
+ * envelope first. `flushedAt_ns` is monotonic via `core/clock.ts`.
659
+ */
660
+ type ObserveChangeset = {
661
+ events: ReadonlyArray<ObserveEvent>;
662
+ flushedAt_ns: number;
663
+ };
497
664
  /** Options for structured observation modes on {@link Graph.observe}. */
498
665
  type ObserveOptions = {
499
666
  actor?: Actor;
@@ -511,6 +678,27 @@ type ObserveOptions = {
511
678
  * `"minimal"` filters to DATA-only events.
512
679
  */
513
680
  detail?: ObserveDetail;
681
+ /**
682
+ * Filter observed events to these tiers only. When omitted, all event types
683
+ * are delivered. Applies to both the structured callback and the reactive
684
+ * variants (`observe({ reactive: true })`).
685
+ *
686
+ * Example: `tiers: ["error", "complete", "teardown"]` for failure-only
687
+ * health monitoring; `tiers: ["data"]` for value-flow tracking.
688
+ */
689
+ tiers?: readonly ObserveTier[];
690
+ /**
691
+ * Return a `Node<ObserveChangeset>` that emits one DATA wave per outermost
692
+ * batch flush, with all observed events for that flush coalesced into a
693
+ * single changeset. Auto-enables structured mode (the reactive variant
694
+ * delivers {@link ObserveEvent}s, not raw messages).
695
+ *
696
+ * Coalescing matches `describe({ reactive: true })`'s `registerBatchFlushHook`
697
+ * mechanism — N events in one batch → one changeset DATA wave at flush.
698
+ */
699
+ reactive?: boolean;
700
+ /** Optional name for the reactive changeset node when `reactive: true`. */
701
+ reactiveName?: string;
514
702
  /**
515
703
  * When set, auto-enables structured mode and attaches a logger.
516
704
  * - `"pretty"` — colored one-line output per event.
@@ -730,7 +918,24 @@ declare class Graph {
730
918
  * equal the reserved meta segment `__meta__`).
731
919
  * @param opts - See {@link GraphOptions}. Stored frozen on the instance.
732
920
  */
921
+ /** Tier 1.5.3 Phase 2.5 — top-level factory tag for Graph-returning factories. */
922
+ private _factory?;
923
+ private _factoryArgs?;
733
924
  constructor(name: string, opts?: GraphOptions);
925
+ /**
926
+ * Tag this graph with its constructing factory's identifier and args.
927
+ * Used by Graph-returning factories (`agentMemory`, `harnessLoop`,
928
+ * `pipelineGraph`, etc.) so `describe()` exposes provenance and
929
+ * `compileSpec` can delegate reconstruction to
930
+ * `catalog.graphFactories[factory]`. Tier 1.5.3 Phase 2.5 (DG1=B).
931
+ *
932
+ * `factoryArgs` should be JSON-serializable. For non-JSON fields
933
+ * (LLMAdapter, callbacks, etc.), use {@link placeholderArgs} to
934
+ * substitute descriptive strings (DG2=ii).
935
+ *
936
+ * Returns `this` for fluent chaining inside factory bodies.
937
+ */
938
+ tagFactory(factory: string, factoryArgs?: unknown): this;
734
939
  /**
735
940
  * Walk ancestors up through `_parent`. Returns the chain starting at this
736
941
  * instance, ending at the root (a graph with no parent). O(depth).
@@ -990,6 +1195,9 @@ declare class Graph {
990
1195
  reactive: true;
991
1196
  format: "json" | "pretty" | "mermaid" | "mermaid-url" | "d2" | "ascii";
992
1197
  }): ReactiveDescribeHandle<string>;
1198
+ describe(options: GraphDescribeOptions & {
1199
+ reactive: "diff";
1200
+ }): ReactiveDescribeHandle<DescribeChangeset>;
993
1201
  describe(options: GraphDescribeOptions & {
994
1202
  reactive: true;
995
1203
  }): ReactiveDescribeHandle<GraphDescribeOutput>;
@@ -1051,6 +1259,14 @@ declare class Graph {
1051
1259
  };
1052
1260
  private _explainStatic;
1053
1261
  private _describeReactive;
1262
+ /**
1263
+ * Reactive topology-diff variant of `describe()`. Wraps `_describeReactive`'s
1264
+ * snapshot stream and emits a `DescribeChangeset` per change, suppressing
1265
+ * empty changesets. The initial cache is a synthetic full-add diff so a
1266
+ * fresh subscriber sees the current topology as a single `node-added` /
1267
+ * `edge-added` / `subgraph-mounted` payload via push-on-subscribe.
1268
+ */
1269
+ private _describeReactiveDiff;
1054
1270
  private _explainReactive;
1055
1271
  /**
1056
1272
  * @internal Collect all qualified paths in this graph tree matching a
@@ -1077,10 +1293,26 @@ declare class Graph {
1077
1293
  * `ObserveResult` is also an `AsyncIterable<ObserveEvent>` — use
1078
1294
  * `for await (const ev of result)` for pull-based consumption.
1079
1295
  */
1296
+ observe(path: string, options: ObserveOptions & {
1297
+ reactive: true;
1298
+ }): Node<ObserveChangeset>;
1299
+ observe(options: ObserveOptions & {
1300
+ reactive: true;
1301
+ }): Node<ObserveChangeset>;
1080
1302
  observe(path: string, options?: ObserveOptions & StructuredTriggers): ObserveResult;
1081
1303
  observe(path: string, options?: ObserveOptions): GraphObserveOne;
1082
1304
  observe(options: ObserveOptions & StructuredTriggers): ObserveResult;
1083
1305
  observe(options?: ObserveOptions): GraphObserveAll;
1306
+ /**
1307
+ * Reactive observe variant — wraps the structured observer and emits one
1308
+ * `ObserveChangeset` DATA per outermost batch flush, with all observed
1309
+ * events for that flush coalesced into a single envelope. Tier filter
1310
+ * (`options.tiers`) drops out-of-scope events before accumulation.
1311
+ *
1312
+ * Cleanup is producer-bound: the structured observer is torn down when the
1313
+ * last consumer of the returned node unsubscribes.
1314
+ */
1315
+ private _observeReactive;
1084
1316
  /** Dispatch helper — builds a unified observer + its expand closure. */
1085
1317
  private _buildStructuredObserver;
1086
1318
  /**
@@ -1457,4 +1689,4 @@ declare function reachable(described: GraphDescribeOutput, from: string, directi
1457
1689
  }): ReachableResult;
1458
1690
  declare function reachable(described: GraphDescribeOutput, from: string, direction: ReachableDirection, options?: ReachableOptions): string[];
1459
1691
 
1460
- export { type ReachableOptions as A, type TraceEntry as B, type CausalChain as C, type DescribeFilter as D, type ExplainPathOptions as E, diffForWAL as F, Graph as G, explainPath as H, graphProfile as I, mermaidLiveUrl as J, reachable as K, type NodeProfile as N, type ObserveDetail as O, type ReachableDirection as R, SNAPSHOT_VERSION as S, type TopologyEvent as T, type GraphOptions as a, type GraphPersistSnapshot as b, type GraphDescribeOptions as c, type GraphDescribeOutput as d, type CausalStep as e, GRAPH_META_SEGMENT as f, type GraphActorOptions as g, type GraphAttachStorageOptions as h, type GraphCheckpointRecord as i, type GraphDiagramDirection as j, type GraphDiagramOptions as k, type GraphDiffChange as l, type GraphDiffResult as m, type GraphFactoryContext as n, type GraphNodeFactory as o, type GraphObserveAll as p, type GraphObserveOne as q, type GraphProfileOptions as r, type GraphProfileResult as s, type GraphVersionChange as t, type GraphWALDiff as u, type ObserveEvent as v, type ObserveOptions as w, type ObserveResult as x, type ObserveTheme as y, type ObserveThemeName as z };
1692
+ export { type ObserveTheme as A, type ObserveThemeName as B, type CausalChain as C, type DescribeFilter as D, type ExplainPathOptions as E, type ReachableOptions as F, Graph as G, type TraceEntry as H, diffForWAL as I, explainPath as J, graphProfile as K, mermaidLiveUrl as L, type Meta as M, type NodeProfile as N, type ObserveDetail as O, reachable as P, topologyDiff as Q, type ReachableDirection as R, SNAPSHOT_VERSION as S, type TopologyEvent as T, type GraphOptions as a, type GraphPersistSnapshot as b, type GraphDescribeOptions as c, type GraphDescribeOutput as d, type CausalStep as e, type DescribeChangeset as f, type DescribeEvent as g, GRAPH_META_SEGMENT as h, type GraphActorOptions as i, type GraphAttachStorageOptions as j, type GraphCheckpointRecord as k, type GraphDiagramDirection as l, type GraphDiagramOptions as m, type GraphDiffChange as n, type GraphDiffResult as o, type GraphFactoryContext as p, type GraphNodeFactory as q, type GraphObserveAll as r, type GraphObserveOne as s, type GraphProfileOptions as t, type GraphProfileResult as u, type GraphVersionChange as v, type GraphWALDiff as w, type ObserveEvent as x, type ObserveOptions as y, type ObserveResult as z };