@graphrefly/graphrefly 0.25.0 → 0.27.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.
- package/README.md +8 -0
- package/dist/ai-CaR_912Q.d.cts +1033 -0
- package/dist/ai-WlRltJV7.d.ts +1033 -0
- package/dist/audit-ClmqGOCx.d.cts +245 -0
- package/dist/audit-DRlSzBu9.d.ts +245 -0
- package/dist/{chunk-QOWVNWOC.js → chunk-3ZWCKRHX.js} +27 -25
- package/dist/{chunk-QOWVNWOC.js.map → chunk-3ZWCKRHX.js.map} +1 -1
- package/dist/chunk-APFNLIRG.js +62 -0
- package/dist/chunk-APFNLIRG.js.map +1 -0
- package/dist/chunk-AT5LKYNL.js +395 -0
- package/dist/chunk-AT5LKYNL.js.map +1 -0
- package/dist/{chunk-IAHGTNOZ.js → chunk-BQ6RQQFF.js} +351 -2095
- package/dist/chunk-BQ6RQQFF.js.map +1 -0
- package/dist/{chunk-L2GLW2U7.js → chunk-BVZYTZ5H.js} +9 -103
- package/dist/chunk-BVZYTZ5H.js.map +1 -0
- package/dist/{chunk-EVR6UFUV.js → chunk-DST5DKZS.js} +19 -15
- package/dist/{chunk-EVR6UFUV.js.map → chunk-DST5DKZS.js.map} +1 -1
- package/dist/{chunk-TKE3JGOH.js → chunk-GTE6PWRZ.js} +5 -692
- package/dist/chunk-GTE6PWRZ.js.map +1 -0
- package/dist/chunk-HXZEYDUR.js +94 -0
- package/dist/chunk-HXZEYDUR.js.map +1 -0
- package/dist/chunk-J22W6HV3.js +107 -0
- package/dist/chunk-J22W6HV3.js.map +1 -0
- package/dist/{chunk-PY4XCDLR.js → chunk-J2VBW3DZ.js} +6 -95
- package/dist/chunk-J2VBW3DZ.js.map +1 -0
- package/dist/{chunk-HWPIFSW2.js → chunk-JSCT3CR4.js} +6 -4
- package/dist/{chunk-HWPIFSW2.js.map → chunk-JSCT3CR4.js.map} +1 -1
- package/dist/chunk-JWBCY4NC.js +330 -0
- package/dist/chunk-JWBCY4NC.js.map +1 -0
- package/dist/chunk-K2AUJHVP.js +2251 -0
- package/dist/chunk-K2AUJHVP.js.map +1 -0
- package/dist/chunk-MJ2NKQQL.js +119 -0
- package/dist/chunk-MJ2NKQQL.js.map +1 -0
- package/dist/chunk-N6UR7YVY.js +198 -0
- package/dist/chunk-N6UR7YVY.js.map +1 -0
- package/dist/chunk-NC6S43JJ.js +456 -0
- package/dist/chunk-NC6S43JJ.js.map +1 -0
- package/dist/chunk-OFVJBJXR.js +98 -0
- package/dist/chunk-OFVJBJXR.js.map +1 -0
- package/dist/chunk-OHISZPOJ.js +97 -0
- package/dist/chunk-OHISZPOJ.js.map +1 -0
- package/dist/chunk-OU5CQKNW.js +102 -0
- package/dist/chunk-OU5CQKNW.js.map +1 -0
- package/dist/{chunk-XOFWRC73.js → chunk-PF7GRZMW.js} +316 -21
- package/dist/chunk-PF7GRZMW.js.map +1 -0
- package/dist/{chunk-5DJTTKX3.js → chunk-PHOUUNK7.js} +74 -111
- package/dist/chunk-PHOUUNK7.js.map +1 -0
- package/dist/chunk-RNHBMHKA.js +1665 -0
- package/dist/chunk-RNHBMHKA.js.map +1 -0
- package/dist/chunk-SX52TAR4.js +110 -0
- package/dist/chunk-SX52TAR4.js.map +1 -0
- package/dist/{chunk-H4RVA4VE.js → chunk-VYPWMZ6H.js} +2 -2
- package/dist/chunk-WBZOVTYK.js +171 -0
- package/dist/chunk-WBZOVTYK.js.map +1 -0
- package/dist/chunk-WKNUIZOY.js +354 -0
- package/dist/chunk-WKNUIZOY.js.map +1 -0
- package/dist/chunk-X3VMZYBT.js +713 -0
- package/dist/chunk-X3VMZYBT.js.map +1 -0
- package/dist/chunk-X5R3GL6H.js +525 -0
- package/dist/chunk-X5R3GL6H.js.map +1 -0
- package/dist/chunk-XGPU467M.js +136 -0
- package/dist/chunk-XGPU467M.js.map +1 -0
- package/dist/compat/index.cjs +7656 -0
- package/dist/compat/index.cjs.map +1 -0
- package/dist/compat/index.d.cts +18 -0
- package/dist/compat/index.d.ts +18 -0
- package/dist/compat/index.js +50 -0
- package/dist/compat/index.js.map +1 -0
- package/dist/compat/jotai/index.cjs +2048 -0
- package/dist/compat/jotai/index.cjs.map +1 -0
- package/dist/compat/jotai/index.d.cts +2 -0
- package/dist/compat/jotai/index.d.ts +2 -0
- package/dist/compat/jotai/index.js +9 -0
- package/dist/compat/jotai/index.js.map +1 -0
- package/dist/compat/nanostores/index.cjs +2175 -0
- package/dist/compat/nanostores/index.cjs.map +1 -0
- package/dist/compat/nanostores/index.d.cts +2 -0
- package/dist/compat/nanostores/index.d.ts +2 -0
- package/dist/compat/nanostores/index.js +23 -0
- package/dist/compat/nanostores/index.js.map +1 -0
- package/dist/compat/nestjs/index.cjs +350 -16
- package/dist/compat/nestjs/index.cjs.map +1 -1
- package/dist/compat/nestjs/index.d.cts +6 -6
- package/dist/compat/nestjs/index.d.ts +6 -6
- package/dist/compat/nestjs/index.js +11 -9
- package/dist/compat/react/index.cjs +141 -0
- package/dist/compat/react/index.cjs.map +1 -0
- package/dist/compat/react/index.d.cts +2 -0
- package/dist/compat/react/index.d.ts +2 -0
- package/dist/compat/react/index.js +12 -0
- package/dist/compat/react/index.js.map +1 -0
- package/dist/compat/solid/index.cjs +128 -0
- package/dist/compat/solid/index.cjs.map +1 -0
- package/dist/compat/solid/index.d.cts +2 -0
- package/dist/compat/solid/index.d.ts +2 -0
- package/dist/compat/solid/index.js +12 -0
- package/dist/compat/solid/index.js.map +1 -0
- package/dist/compat/svelte/index.cjs +131 -0
- package/dist/compat/svelte/index.cjs.map +1 -0
- package/dist/compat/svelte/index.d.cts +2 -0
- package/dist/compat/svelte/index.d.ts +2 -0
- package/dist/compat/svelte/index.js +12 -0
- package/dist/compat/svelte/index.js.map +1 -0
- package/dist/compat/vue/index.cjs +146 -0
- package/dist/compat/vue/index.cjs.map +1 -0
- package/dist/compat/vue/index.d.cts +3 -0
- package/dist/compat/vue/index.d.ts +3 -0
- package/dist/compat/vue/index.js +12 -0
- package/dist/compat/vue/index.js.map +1 -0
- package/dist/compat/zustand/index.cjs +4931 -0
- package/dist/compat/zustand/index.cjs.map +1 -0
- package/dist/compat/zustand/index.d.cts +5 -0
- package/dist/compat/zustand/index.d.ts +5 -0
- package/dist/compat/zustand/index.js +12 -0
- package/dist/compat/zustand/index.js.map +1 -0
- package/dist/composite-C7PcQvcs.d.cts +303 -0
- package/dist/composite-aUCvjZVR.d.ts +303 -0
- package/dist/core/index.cjs +53 -4
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +4 -3
- package/dist/core/index.d.ts +4 -3
- package/dist/core/index.js +26 -24
- package/dist/demo-shell-BDkOptd6.d.ts +102 -0
- package/dist/demo-shell-Crid1WdR.d.cts +102 -0
- package/dist/extra/index.cjs +222 -110
- package/dist/extra/index.cjs.map +1 -1
- package/dist/extra/index.d.cts +6 -4
- package/dist/extra/index.d.ts +6 -4
- package/dist/extra/index.js +72 -65
- package/dist/extra/sources.cjs +2486 -0
- package/dist/extra/sources.cjs.map +1 -0
- package/dist/extra/sources.d.cts +465 -0
- package/dist/extra/sources.d.ts +465 -0
- package/dist/extra/sources.js +57 -0
- package/dist/extra/sources.js.map +1 -0
- package/dist/graph/index.cjs +408 -14
- package/dist/graph/index.cjs.map +1 -1
- package/dist/graph/index.d.cts +5 -5
- package/dist/graph/index.d.ts +5 -5
- package/dist/graph/index.js +13 -5
- package/dist/{graph-D-3JIQme.d.cts → graph-CCwGKLCm.d.ts} +195 -4
- package/dist/{graph-B6NFqv3z.d.ts → graph-DNCrvZSn.d.cts} +195 -4
- package/dist/index-3lsddbbS.d.ts +86 -0
- package/dist/index-B1tloyhO.d.cts +34 -0
- package/dist/{index-CYkjxu3s.d.ts → index-B6D3QNSA.d.ts} +33 -4
- package/dist/index-B6EhDnjH.d.cts +37 -0
- package/dist/index-B9B7_HEY.d.ts +37 -0
- package/dist/{index-Ds23Wvou.d.ts → index-BHlKbUwO.d.cts} +131 -883
- package/dist/{index-DiobMNwE.d.ts → index-BPVt8kqc.d.ts} +3 -3
- package/dist/index-BaSM3aYt.d.ts +195 -0
- package/dist/index-BuEoe-Qu.d.ts +121 -0
- package/dist/{index-Ch0IpIO0.d.cts → index-BwfLUNw4.d.ts} +131 -883
- package/dist/index-ByQxazQJ.d.cts +86 -0
- package/dist/index-C0svESO4.d.ts +127 -0
- package/dist/{index-OXImXMq6.d.ts → index-C8oil6M6.d.ts} +18 -196
- package/dist/{index-DKE1EATr.d.cts → index-CI3DprxP.d.cts} +18 -196
- package/dist/{index-AMWewNDe.d.cts → index-CO8uBlUh.d.cts} +33 -4
- package/dist/index-CxFrXH4m.d.ts +45 -0
- package/dist/index-D8wS_PeY.d.cts +121 -0
- package/dist/index-DO_6JN9Z.d.cts +127 -0
- package/dist/index-DVGiGFGT.d.cts +195 -0
- package/dist/index-DYme44FM.d.cts +44 -0
- package/dist/{index-J7Kc0oIQ.d.cts → index-DlLp-2Xn.d.cts} +3 -3
- package/dist/index-Dzk2hrlR.d.ts +44 -0
- package/dist/index-VHqptjhu.d.cts +45 -0
- package/dist/index-VdHQMPy1.d.ts +36 -0
- package/dist/index-Xi3u0HCQ.d.cts +36 -0
- package/dist/index-wEn0eFe8.d.ts +34 -0
- package/dist/index.cjs +1780 -176
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +784 -2082
- package/dist/index.d.ts +784 -2082
- package/dist/index.js +955 -4349
- package/dist/index.js.map +1 -1
- package/dist/memory-C6Z2tGpC.d.cts +139 -0
- package/dist/memory-li6FL5RM.d.ts +139 -0
- package/dist/messaging-Gt4LPbyA.d.cts +269 -0
- package/dist/messaging-XDoYablx.d.ts +269 -0
- package/dist/{meta-DWbkoq1s.d.cts → meta-BxCA7rcr.d.cts} +1 -1
- package/dist/{meta-CnkLA_43.d.ts → meta-CbznRPYJ.d.ts} +1 -1
- package/dist/{node-B-f-Lu-k.d.cts → node-BmerH3kS.d.cts} +26 -1
- package/dist/{node-B-f-Lu-k.d.ts → node-BmerH3kS.d.ts} +26 -1
- package/dist/{observable-uP-wy_uK.d.ts → observable-BgGUwcqp.d.ts} +1 -1
- package/dist/{observable-DBnrwcar.d.cts → observable-DJt_AxzQ.d.cts} +1 -1
- package/dist/patterns/ai.cjs +7930 -0
- package/dist/patterns/ai.cjs.map +1 -0
- package/dist/patterns/ai.d.cts +10 -0
- package/dist/patterns/ai.d.ts +10 -0
- package/dist/patterns/ai.js +71 -0
- package/dist/patterns/ai.js.map +1 -0
- package/dist/patterns/audit.cjs +5805 -0
- package/dist/patterns/audit.cjs.map +1 -0
- package/dist/patterns/audit.d.cts +6 -0
- package/dist/patterns/audit.d.ts +6 -0
- package/dist/patterns/audit.js +29 -0
- package/dist/patterns/audit.js.map +1 -0
- package/dist/patterns/demo-shell.cjs +5604 -0
- package/dist/patterns/demo-shell.cjs.map +1 -0
- package/dist/patterns/demo-shell.d.cts +6 -0
- package/dist/patterns/demo-shell.d.ts +6 -0
- package/dist/patterns/demo-shell.js +15 -0
- package/dist/patterns/demo-shell.js.map +1 -0
- package/dist/patterns/memory.cjs +5283 -0
- package/dist/patterns/memory.cjs.map +1 -0
- package/dist/patterns/memory.d.cts +5 -0
- package/dist/patterns/memory.d.ts +5 -0
- package/dist/patterns/memory.js +20 -0
- package/dist/patterns/memory.js.map +1 -0
- package/dist/patterns/reactive-layout/index.cjs +355 -13
- package/dist/patterns/reactive-layout/index.cjs.map +1 -1
- package/dist/patterns/reactive-layout/index.d.cts +6 -5
- package/dist/patterns/reactive-layout/index.d.ts +6 -5
- package/dist/patterns/reactive-layout/index.js +15 -12
- package/dist/reactive-layout-MQP--J3F.d.cts +183 -0
- package/dist/reactive-layout-u5Ulnqag.d.ts +183 -0
- package/dist/{storage-BuTdpCI1.d.cts → storage-CMjUUuxn.d.ts} +10 -2
- package/dist/{storage-F2X1U1x0.d.ts → storage-DdWlZo6U.d.cts} +10 -2
- package/dist/sugar-CCOxXK1e.d.ts +201 -0
- package/dist/sugar-D02n5JjF.d.cts +201 -0
- package/package.json +63 -3
- package/dist/chunk-5DJTTKX3.js.map +0 -1
- package/dist/chunk-IAHGTNOZ.js.map +0 -1
- package/dist/chunk-L2GLW2U7.js.map +0 -1
- package/dist/chunk-MW4VAKAO.js +0 -47
- package/dist/chunk-MW4VAKAO.js.map +0 -1
- package/dist/chunk-PY4XCDLR.js.map +0 -1
- package/dist/chunk-TKE3JGOH.js.map +0 -1
- package/dist/chunk-XOFWRC73.js.map +0 -1
- package/dist/index-BJB7t9gg.d.cts +0 -392
- package/dist/index-C-TXEa7C.d.ts +0 -392
- /package/dist/{chunk-H4RVA4VE.js.map → chunk-VYPWMZ6H.js.map} +0 -0
package/dist/graph/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { E as ENVELOPE_VERSION, a as EvictedSubgraphInfo, b as EvictionPolicy, G as GraphCodec, J as JsonCodec, L as LazyGraphCodec, O as SIZEOF_OVERHEAD, S as SIZEOF_SYMBOL, W as WALEntry, c as createDagCborCodec, d as createDagCborZstdCodec, e as decodeEnvelope, f as encodeEnvelope, r as registerBuiltinCodecs, g as replayWAL, s as sizeof } from '../index-
|
|
2
|
-
export { D as DescribeFilter,
|
|
3
|
-
import '../node-
|
|
4
|
-
import '../meta-
|
|
5
|
-
import '../storage-
|
|
1
|
+
export { E as ENVELOPE_VERSION, a as EvictedSubgraphInfo, b as EvictionPolicy, G as GraphCodec, J as JsonCodec, L as LazyGraphCodec, O as SIZEOF_OVERHEAD, S as SIZEOF_SYMBOL, W as WALEntry, c as createDagCborCodec, d as createDagCborZstdCodec, e as decodeEnvelope, f as encodeEnvelope, r as registerBuiltinCodecs, g as replayWAL, s as sizeof, w as watchTopologyTree } from '../index-CO8uBlUh.cjs';
|
|
2
|
+
export { C as CausalChain, h as CausalStep, D as DescribeFilter, E as ExplainPathOptions, i as GRAPH_META_SEGMENT, a as Graph, j as GraphActorOptions, k as GraphAttachStorageOptions, l as GraphCheckpointRecord, b as GraphDescribeOptions, c as GraphDescribeOutput, m as GraphDiagramDirection, n as GraphDiagramOptions, o as GraphDiffChange, g as GraphDiffResult, p as GraphFactoryContext, f as GraphNodeFactory, q as GraphObserveAll, r as GraphObserveOne, G as GraphOptions, s as GraphPersistSnapshot, e as GraphProfileOptions, d as GraphProfileResult, t as GraphVersionChange, u as GraphWALDiff, N as NodeProfile, O as ObserveDetail, v as ObserveEvent, w as ObserveOptions, x as ObserveResult, y as ObserveTheme, z as ObserveThemeName, R as ReachableDirection, A as ReachableOptions, S as SNAPSHOT_VERSION, T as TopologyEvent, B as TraceEntry, F as diffForWAL, H as explainPath, I as graphProfile, J as reachable } from '../graph-DNCrvZSn.cjs';
|
|
3
|
+
import '../node-BmerH3kS.cjs';
|
|
4
|
+
import '../meta-BxCA7rcr.cjs';
|
|
5
|
+
import '../storage-DdWlZo6U.cjs';
|
package/dist/graph/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { E as ENVELOPE_VERSION, a as EvictedSubgraphInfo, b as EvictionPolicy, G as GraphCodec, J as JsonCodec, L as LazyGraphCodec, O as SIZEOF_OVERHEAD, S as SIZEOF_SYMBOL, W as WALEntry, c as createDagCborCodec, d as createDagCborZstdCodec, e as decodeEnvelope, f as encodeEnvelope, r as registerBuiltinCodecs, g as replayWAL, s as sizeof } from '../index-
|
|
2
|
-
export { D as DescribeFilter,
|
|
3
|
-
import '../node-
|
|
4
|
-
import '../meta-
|
|
5
|
-
import '../storage-
|
|
1
|
+
export { E as ENVELOPE_VERSION, a as EvictedSubgraphInfo, b as EvictionPolicy, G as GraphCodec, J as JsonCodec, L as LazyGraphCodec, O as SIZEOF_OVERHEAD, S as SIZEOF_SYMBOL, W as WALEntry, c as createDagCborCodec, d as createDagCborZstdCodec, e as decodeEnvelope, f as encodeEnvelope, r as registerBuiltinCodecs, g as replayWAL, s as sizeof, w as watchTopologyTree } from '../index-B6D3QNSA.js';
|
|
2
|
+
export { C as CausalChain, h as CausalStep, D as DescribeFilter, E as ExplainPathOptions, i as GRAPH_META_SEGMENT, a as Graph, j as GraphActorOptions, k as GraphAttachStorageOptions, l as GraphCheckpointRecord, b as GraphDescribeOptions, c as GraphDescribeOutput, m as GraphDiagramDirection, n as GraphDiagramOptions, o as GraphDiffChange, g as GraphDiffResult, p as GraphFactoryContext, f as GraphNodeFactory, q as GraphObserveAll, r as GraphObserveOne, G as GraphOptions, s as GraphPersistSnapshot, e as GraphProfileOptions, d as GraphProfileResult, t as GraphVersionChange, u as GraphWALDiff, N as NodeProfile, O as ObserveDetail, v as ObserveEvent, w as ObserveOptions, x as ObserveResult, y as ObserveTheme, z as ObserveThemeName, R as ReachableDirection, A as ReachableOptions, S as SNAPSHOT_VERSION, T as TopologyEvent, B as TraceEntry, F as diffForWAL, H as explainPath, I as graphProfile, J as reachable } from '../graph-CCwGKLCm.js';
|
|
3
|
+
import '../node-BmerH3kS.js';
|
|
4
|
+
import '../meta-CbznRPYJ.js';
|
|
5
|
+
import '../storage-CMjUUuxn.js';
|
package/dist/graph/index.js
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
watchTopologyTree
|
|
3
|
+
} from "../chunk-OU5CQKNW.js";
|
|
2
4
|
import {
|
|
3
5
|
GRAPH_META_SEGMENT,
|
|
4
6
|
Graph,
|
|
5
7
|
OVERHEAD,
|
|
6
8
|
SIZEOF_SYMBOL,
|
|
9
|
+
SNAPSHOT_VERSION,
|
|
7
10
|
diffForWAL,
|
|
11
|
+
explainPath,
|
|
8
12
|
graphProfile,
|
|
9
13
|
reachable,
|
|
10
14
|
sizeof
|
|
11
|
-
} from "../chunk-
|
|
12
|
-
import "../chunk-
|
|
15
|
+
} from "../chunk-PF7GRZMW.js";
|
|
16
|
+
import "../chunk-VYPWMZ6H.js";
|
|
13
17
|
import "../chunk-7TAQJHQV.js";
|
|
14
18
|
import {
|
|
15
19
|
ENVELOPE_VERSION,
|
|
@@ -20,7 +24,8 @@ import {
|
|
|
20
24
|
encodeEnvelope,
|
|
21
25
|
registerBuiltinCodecs,
|
|
22
26
|
replayWAL
|
|
23
|
-
} from "../chunk-
|
|
27
|
+
} from "../chunk-PHOUUNK7.js";
|
|
28
|
+
import "../chunk-SX52TAR4.js";
|
|
24
29
|
export {
|
|
25
30
|
ENVELOPE_VERSION,
|
|
26
31
|
GRAPH_META_SEGMENT,
|
|
@@ -28,15 +33,18 @@ export {
|
|
|
28
33
|
JsonCodec,
|
|
29
34
|
OVERHEAD as SIZEOF_OVERHEAD,
|
|
30
35
|
SIZEOF_SYMBOL,
|
|
36
|
+
SNAPSHOT_VERSION,
|
|
31
37
|
createDagCborCodec,
|
|
32
38
|
createDagCborZstdCodec,
|
|
33
39
|
decodeEnvelope,
|
|
34
40
|
diffForWAL,
|
|
35
41
|
encodeEnvelope,
|
|
42
|
+
explainPath,
|
|
36
43
|
graphProfile,
|
|
37
44
|
reachable,
|
|
38
45
|
registerBuiltinCodecs,
|
|
39
46
|
replayWAL,
|
|
40
|
-
sizeof
|
|
47
|
+
sizeof,
|
|
48
|
+
watchTopologyTree
|
|
41
49
|
};
|
|
42
50
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,111 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { b as DescribeNodeOutput, D as DescribeDetail, a as DescribeField } from './meta-
|
|
3
|
-
import {
|
|
1
|
+
import { A as Actor, j as GraphReFlyConfig, a6 as VersioningLevel, N as Node, s as Messages, K as NodeSink } from './node-BmerH3kS.js';
|
|
2
|
+
import { b as DescribeNodeOutput, D as DescribeDetail, a as DescribeField } from './meta-CbznRPYJ.js';
|
|
3
|
+
import { S as StorageTier, a as StorageHandle } from './storage-CMjUUuxn.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Causal walkback over a {@link Graph.describe} snapshot (roadmap §9.2).
|
|
7
|
+
*
|
|
8
|
+
* `explainPath` finds the shortest dep-chain from `from` to `to` and returns a
|
|
9
|
+
* step-by-step {@link CausalChain} enriched with each node's current value,
|
|
10
|
+
* status, last-mutation actor, and any `graph.trace()` reasoning annotation.
|
|
11
|
+
*
|
|
12
|
+
* Pure function over the snapshot — peer to {@link reachable}. The
|
|
13
|
+
* {@link Graph.explain} instance method auto-passes `describe({detail:"standard"})`
|
|
14
|
+
* plus runtime annotations and `lastMutation` so callers get rich output by
|
|
15
|
+
* default.
|
|
16
|
+
*
|
|
17
|
+
* @module
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/** One node along the causal chain returned by {@link explainPath}. */
|
|
21
|
+
interface CausalStep {
|
|
22
|
+
/** Qualified node path. */
|
|
23
|
+
path: string;
|
|
24
|
+
/** Node kind (`state` / `derived` / `producer` / etc.). */
|
|
25
|
+
type: DescribeNodeOutput["type"];
|
|
26
|
+
/** Status as of the source snapshot. */
|
|
27
|
+
status?: DescribeNodeOutput["status"];
|
|
28
|
+
/** Cached value at snapshot time (omitted when describe didn't include it). */
|
|
29
|
+
value?: unknown;
|
|
30
|
+
/** Hop distance from `from` (0 = `from`, N = `to`). */
|
|
31
|
+
hop: number;
|
|
32
|
+
/** Reason annotation set via `graph.trace(path, reason)`, when present. */
|
|
33
|
+
reason?: string;
|
|
34
|
+
/** Most recent guarded mutation, when known. */
|
|
35
|
+
lastMutation?: Readonly<{
|
|
36
|
+
actor: Actor;
|
|
37
|
+
timestamp_ns: number;
|
|
38
|
+
}>;
|
|
39
|
+
/** V0/V1 versioning info, when present. */
|
|
40
|
+
v?: DescribeNodeOutput["v"];
|
|
41
|
+
/** Index of this step in the next step's `deps` (i.e. which dep slot fed forward). */
|
|
42
|
+
dep_index?: number;
|
|
43
|
+
/**
|
|
44
|
+
* All dep slots when the same dep appears multiple times in the next
|
|
45
|
+
* step's `deps`. Present only for multi-edge connections; `dep_index`
|
|
46
|
+
* always equals `dep_indices[0]` when set.
|
|
47
|
+
*/
|
|
48
|
+
dep_indices?: number[];
|
|
49
|
+
}
|
|
50
|
+
/** Outcome of an {@link explainPath} call. */
|
|
51
|
+
interface CausalChain {
|
|
52
|
+
from: string;
|
|
53
|
+
to: string;
|
|
54
|
+
/** True when a path was found. */
|
|
55
|
+
found: boolean;
|
|
56
|
+
/** Why the chain may be empty/incomplete. `"ok"` when `found` is true. */
|
|
57
|
+
reason: "ok" | "no-such-from" | "no-such-to" | "no-path" | "max-depth-exceeded";
|
|
58
|
+
/** Ordered steps — first element is `from`, last is `to`. Empty when `!found`. */
|
|
59
|
+
steps: readonly CausalStep[];
|
|
60
|
+
/** Pretty multi-line rendering. Always present, even on failure (one-line message). */
|
|
61
|
+
text: string;
|
|
62
|
+
/** JSON-serializable form (drops `text` to keep payloads compact). */
|
|
63
|
+
toJSON(): {
|
|
64
|
+
from: string;
|
|
65
|
+
to: string;
|
|
66
|
+
found: boolean;
|
|
67
|
+
reason: CausalChain["reason"];
|
|
68
|
+
steps: readonly CausalStep[];
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/** Options for {@link explainPath}. */
|
|
72
|
+
interface ExplainPathOptions {
|
|
73
|
+
/** Maximum hop distance to search. Omit for unbounded. */
|
|
74
|
+
maxDepth?: number;
|
|
75
|
+
/** Per-path reasoning annotations (typically `graph.trace()` output map). */
|
|
76
|
+
annotations?: ReadonlyMap<string, string>;
|
|
77
|
+
/** Per-path `lastMutation` map (overrides describe-derived values). */
|
|
78
|
+
lastMutations?: ReadonlyMap<string, Readonly<{
|
|
79
|
+
actor: Actor;
|
|
80
|
+
timestamp_ns: number;
|
|
81
|
+
}>>;
|
|
82
|
+
/**
|
|
83
|
+
* When `true` and `from === to`, search for a non-trivial cycle (path
|
|
84
|
+
* back to `from` through ≥1 other node) instead of returning the trivial
|
|
85
|
+
* single-step. Use when debugging feedback loops (COMPOSITION-GUIDE §7).
|
|
86
|
+
* If no real cycle exists, falls back to the trivial single-step. Default
|
|
87
|
+
* `false` — backward-compatible.
|
|
88
|
+
*/
|
|
89
|
+
findCycle?: boolean;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Walks backward from `to` through `deps` to find the shortest path to `from`,
|
|
93
|
+
* then assembles an ordered, enriched {@link CausalChain}.
|
|
94
|
+
*
|
|
95
|
+
* @param described - `graph.describe()` output (any detail level; richer detail → richer steps).
|
|
96
|
+
* @param from - Path of the upstream node (the cause).
|
|
97
|
+
* @param to - Path of the downstream node (the effect).
|
|
98
|
+
* @param opts - Optional `maxDepth` and per-path annotation overlays.
|
|
99
|
+
* @returns A {@link CausalChain} — `found:false` with a `reason` when no path exists.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```ts
|
|
103
|
+
* import { explainPath } from "@graphrefly/graphrefly-ts";
|
|
104
|
+
* const chain = explainPath(graph.describe({ detail: "standard" }), "input", "result");
|
|
105
|
+
* console.log(chain.text);
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
declare function explainPath(described: GraphDescribeOutput, from: string, to: string, opts?: ExplainPathOptions): CausalChain;
|
|
4
109
|
|
|
5
110
|
/**
|
|
6
111
|
* Graph profiling and inspection utilities.
|
|
@@ -263,6 +368,27 @@ type GraphAttachStorageOptions = {
|
|
|
263
368
|
/** Surfaced on tier save errors and autoRestore failures. */
|
|
264
369
|
onError?: (error: unknown, tier: StorageTier) => void;
|
|
265
370
|
};
|
|
371
|
+
/**
|
|
372
|
+
* Event emitted by {@link Graph.topology} on every structural change to the
|
|
373
|
+
* graph's own registry. Does NOT include value mutations (use `observe()` for
|
|
374
|
+
* those) or transitively nested subgraph events (subscribe to each mounted
|
|
375
|
+
* child's `topology` for that).
|
|
376
|
+
*
|
|
377
|
+
* - `"added"` — `name` is the local key registered via {@link Graph.add}
|
|
378
|
+
* (`nodeKind: "node"`) or {@link Graph.mount} (`nodeKind: "mount"`).
|
|
379
|
+
* - `"removed"` — emitted AFTER {@link Graph.remove} completes teardown.
|
|
380
|
+
* `audit` is the full {@link GraphRemoveAudit} returned to the caller.
|
|
381
|
+
*/
|
|
382
|
+
type TopologyEvent = {
|
|
383
|
+
kind: "added";
|
|
384
|
+
name: string;
|
|
385
|
+
nodeKind: "node" | "mount";
|
|
386
|
+
} | {
|
|
387
|
+
kind: "removed";
|
|
388
|
+
name: string;
|
|
389
|
+
nodeKind: "node" | "mount";
|
|
390
|
+
audit: GraphRemoveAudit;
|
|
391
|
+
};
|
|
266
392
|
/** Direction options for diagram export helpers. */
|
|
267
393
|
type GraphDiagramDirection = "TD" | "LR" | "BT" | "RL";
|
|
268
394
|
/** Options for {@link Graph.toMermaid} / {@link Graph.toD2}. */
|
|
@@ -276,6 +402,13 @@ type GraphDiagramOptions = {
|
|
|
276
402
|
*/
|
|
277
403
|
direction?: GraphDiagramDirection;
|
|
278
404
|
};
|
|
405
|
+
/**
|
|
406
|
+
* Snapshot format version (§3.8). Exported so the surface layer's
|
|
407
|
+
* `saveSnapshot` writes the same `format_version` as
|
|
408
|
+
* `Graph.attachStorage` — one source of truth prevents silent wire
|
|
409
|
+
* drift between auto-checkpoint and one-shot persistence paths.
|
|
410
|
+
*/
|
|
411
|
+
declare const SNAPSHOT_VERSION = 1;
|
|
279
412
|
/**
|
|
280
413
|
* Option shapes that trigger structured-mode dispatch in {@link Graph.observe}.
|
|
281
414
|
* Presence of any of these fields (truthy) → returns {@link ObserveResult};
|
|
@@ -500,6 +633,20 @@ declare class Graph {
|
|
|
500
633
|
_parent: Graph | undefined;
|
|
501
634
|
private readonly _storageDisposers;
|
|
502
635
|
private readonly _disposers;
|
|
636
|
+
/**
|
|
637
|
+
* @internal Lazy `TopologyEvent` producer. Created on first `.topology`
|
|
638
|
+
* access. Zero cost until something subscribes — producer fn only runs when
|
|
639
|
+
* the first sink attaches, registering one handler into
|
|
640
|
+
* {@link Graph._topologyEmitters}.
|
|
641
|
+
*/
|
|
642
|
+
private _topology;
|
|
643
|
+
/**
|
|
644
|
+
* @internal Active emit handlers for the topology producer. Each entry is
|
|
645
|
+
* the closure registered by the producer fn on activation; cleared on
|
|
646
|
+
* deactivation. `_emitTopology` broadcasts through every entry (there is at
|
|
647
|
+
* most one per activation cycle of the producer).
|
|
648
|
+
*/
|
|
649
|
+
private readonly _topologyEmitters;
|
|
503
650
|
/**
|
|
504
651
|
* @param name - Non-empty graph id (must not contain `::` and must not
|
|
505
652
|
* equal the reserved meta segment `__meta__`).
|
|
@@ -513,6 +660,33 @@ declare class Graph {
|
|
|
513
660
|
* @param includeSelf - Include `this` in the chain (default `true`).
|
|
514
661
|
*/
|
|
515
662
|
ancestors(includeSelf?: boolean): Graph[];
|
|
663
|
+
/**
|
|
664
|
+
* Reactive stream of structural changes to this graph's own registry
|
|
665
|
+
* (add / mount / remove). Value mutations live on `observe()`; this
|
|
666
|
+
* companion only fires when the topology shape changes.
|
|
667
|
+
*
|
|
668
|
+
* Lazy: the underlying node is created on first access and activates when
|
|
669
|
+
* something subscribes. No emission replay — late subscribers do not
|
|
670
|
+
* receive historical events and should snapshot via {@link Graph.describe}
|
|
671
|
+
* before listening for incremental changes. Events that fire while the
|
|
672
|
+
* producer has zero subscribers are dropped (no retention).
|
|
673
|
+
*
|
|
674
|
+
* Own-graph only: a parent's `topology` does NOT emit for structural
|
|
675
|
+
* changes inside a mounted child. Transitive consumers subscribe to each
|
|
676
|
+
* child's topology separately (recurse through `topology`'s own "added"
|
|
677
|
+
* events with `nodeKind: "mount"` to discover new children).
|
|
678
|
+
*
|
|
679
|
+
* See {@link TopologyEvent} for payload shape.
|
|
680
|
+
*
|
|
681
|
+
* @category observability
|
|
682
|
+
*/
|
|
683
|
+
get topology(): Node<TopologyEvent>;
|
|
684
|
+
/**
|
|
685
|
+
* @internal Fire a {@link TopologyEvent} to every active subscriber of
|
|
686
|
+
* `this.topology`. No-op when the topology node has never been accessed or
|
|
687
|
+
* currently has no sinks — zero cost for graphs nobody observes.
|
|
688
|
+
*/
|
|
689
|
+
private _emitTopology;
|
|
516
690
|
/**
|
|
517
691
|
* Registers a node under a local name. Fails if the name is already used,
|
|
518
692
|
* reserved by a mount, the same node instance is already registered, or
|
|
@@ -734,6 +908,23 @@ declare class Graph {
|
|
|
734
908
|
withDetail: true;
|
|
735
909
|
}): ReachableResult;
|
|
736
910
|
reachable(from: string, direction: ReachableDirection, opts?: ReachableOptions): string[];
|
|
911
|
+
/**
|
|
912
|
+
* Causal walkback: shortest dep-chain from `from` to `to`, enriched with
|
|
913
|
+
* each node's value, status, last-mutation actor, and reasoning annotation
|
|
914
|
+
* from {@link Graph.trace}. Wraps {@link explainPath} (roadmap §9.2).
|
|
915
|
+
*
|
|
916
|
+
* @param from - Upstream node (the cause).
|
|
917
|
+
* @param to - Downstream node (the effect).
|
|
918
|
+
* @param opts - Optional `maxDepth` and `findCycle`. When `findCycle:true`
|
|
919
|
+
* and `from === to`, returns the shortest cycle through other nodes
|
|
920
|
+
* (useful for diagnosing feedback loops, COMPOSITION-GUIDE §7).
|
|
921
|
+
* Annotations and lastMutations are collected automatically from the
|
|
922
|
+
* live graph.
|
|
923
|
+
*/
|
|
924
|
+
explain(from: string, to: string, opts?: {
|
|
925
|
+
maxDepth?: number;
|
|
926
|
+
findCycle?: boolean;
|
|
927
|
+
}): CausalChain;
|
|
737
928
|
/**
|
|
738
929
|
* @internal Collect all qualified paths in this graph tree matching a
|
|
739
930
|
* glob pattern. Used by scoped autoCheckpoint subscription.
|
|
@@ -1125,4 +1316,4 @@ declare function reachable(described: GraphDescribeOutput, from: string, directi
|
|
|
1125
1316
|
}): ReachableResult;
|
|
1126
1317
|
declare function reachable(described: GraphDescribeOutput, from: string, direction: ReachableDirection, options?: ReachableOptions): string[];
|
|
1127
1318
|
|
|
1128
|
-
export {
|
|
1319
|
+
export { type ReachableOptions as A, type TraceEntry as B, type CausalChain as C, type DescribeFilter as D, type ExplainPathOptions as E, diffForWAL as F, type GraphOptions as G, explainPath as H, graphProfile as I, reachable as J, type NodeProfile as N, type ObserveDetail as O, type ReachableDirection as R, SNAPSHOT_VERSION as S, type TopologyEvent as T, Graph as a, type GraphDescribeOptions as b, type GraphDescribeOutput as c, type GraphProfileResult as d, type GraphProfileOptions as e, type GraphNodeFactory as f, type GraphDiffResult as g, type CausalStep as h, GRAPH_META_SEGMENT as i, type GraphActorOptions as j, type GraphAttachStorageOptions as k, type GraphCheckpointRecord as l, type GraphDiagramDirection as m, type GraphDiagramOptions as n, type GraphDiffChange as o, type GraphFactoryContext as p, type GraphObserveAll as q, type GraphObserveOne as r, type GraphPersistSnapshot 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 };
|
|
@@ -1,6 +1,111 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { b as DescribeNodeOutput, D as DescribeDetail, a as DescribeField } from './meta-
|
|
3
|
-
import {
|
|
1
|
+
import { A as Actor, j as GraphReFlyConfig, a6 as VersioningLevel, N as Node, s as Messages, K as NodeSink } from './node-BmerH3kS.cjs';
|
|
2
|
+
import { b as DescribeNodeOutput, D as DescribeDetail, a as DescribeField } from './meta-BxCA7rcr.cjs';
|
|
3
|
+
import { S as StorageTier, a as StorageHandle } from './storage-DdWlZo6U.cjs';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Causal walkback over a {@link Graph.describe} snapshot (roadmap §9.2).
|
|
7
|
+
*
|
|
8
|
+
* `explainPath` finds the shortest dep-chain from `from` to `to` and returns a
|
|
9
|
+
* step-by-step {@link CausalChain} enriched with each node's current value,
|
|
10
|
+
* status, last-mutation actor, and any `graph.trace()` reasoning annotation.
|
|
11
|
+
*
|
|
12
|
+
* Pure function over the snapshot — peer to {@link reachable}. The
|
|
13
|
+
* {@link Graph.explain} instance method auto-passes `describe({detail:"standard"})`
|
|
14
|
+
* plus runtime annotations and `lastMutation` so callers get rich output by
|
|
15
|
+
* default.
|
|
16
|
+
*
|
|
17
|
+
* @module
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/** One node along the causal chain returned by {@link explainPath}. */
|
|
21
|
+
interface CausalStep {
|
|
22
|
+
/** Qualified node path. */
|
|
23
|
+
path: string;
|
|
24
|
+
/** Node kind (`state` / `derived` / `producer` / etc.). */
|
|
25
|
+
type: DescribeNodeOutput["type"];
|
|
26
|
+
/** Status as of the source snapshot. */
|
|
27
|
+
status?: DescribeNodeOutput["status"];
|
|
28
|
+
/** Cached value at snapshot time (omitted when describe didn't include it). */
|
|
29
|
+
value?: unknown;
|
|
30
|
+
/** Hop distance from `from` (0 = `from`, N = `to`). */
|
|
31
|
+
hop: number;
|
|
32
|
+
/** Reason annotation set via `graph.trace(path, reason)`, when present. */
|
|
33
|
+
reason?: string;
|
|
34
|
+
/** Most recent guarded mutation, when known. */
|
|
35
|
+
lastMutation?: Readonly<{
|
|
36
|
+
actor: Actor;
|
|
37
|
+
timestamp_ns: number;
|
|
38
|
+
}>;
|
|
39
|
+
/** V0/V1 versioning info, when present. */
|
|
40
|
+
v?: DescribeNodeOutput["v"];
|
|
41
|
+
/** Index of this step in the next step's `deps` (i.e. which dep slot fed forward). */
|
|
42
|
+
dep_index?: number;
|
|
43
|
+
/**
|
|
44
|
+
* All dep slots when the same dep appears multiple times in the next
|
|
45
|
+
* step's `deps`. Present only for multi-edge connections; `dep_index`
|
|
46
|
+
* always equals `dep_indices[0]` when set.
|
|
47
|
+
*/
|
|
48
|
+
dep_indices?: number[];
|
|
49
|
+
}
|
|
50
|
+
/** Outcome of an {@link explainPath} call. */
|
|
51
|
+
interface CausalChain {
|
|
52
|
+
from: string;
|
|
53
|
+
to: string;
|
|
54
|
+
/** True when a path was found. */
|
|
55
|
+
found: boolean;
|
|
56
|
+
/** Why the chain may be empty/incomplete. `"ok"` when `found` is true. */
|
|
57
|
+
reason: "ok" | "no-such-from" | "no-such-to" | "no-path" | "max-depth-exceeded";
|
|
58
|
+
/** Ordered steps — first element is `from`, last is `to`. Empty when `!found`. */
|
|
59
|
+
steps: readonly CausalStep[];
|
|
60
|
+
/** Pretty multi-line rendering. Always present, even on failure (one-line message). */
|
|
61
|
+
text: string;
|
|
62
|
+
/** JSON-serializable form (drops `text` to keep payloads compact). */
|
|
63
|
+
toJSON(): {
|
|
64
|
+
from: string;
|
|
65
|
+
to: string;
|
|
66
|
+
found: boolean;
|
|
67
|
+
reason: CausalChain["reason"];
|
|
68
|
+
steps: readonly CausalStep[];
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/** Options for {@link explainPath}. */
|
|
72
|
+
interface ExplainPathOptions {
|
|
73
|
+
/** Maximum hop distance to search. Omit for unbounded. */
|
|
74
|
+
maxDepth?: number;
|
|
75
|
+
/** Per-path reasoning annotations (typically `graph.trace()` output map). */
|
|
76
|
+
annotations?: ReadonlyMap<string, string>;
|
|
77
|
+
/** Per-path `lastMutation` map (overrides describe-derived values). */
|
|
78
|
+
lastMutations?: ReadonlyMap<string, Readonly<{
|
|
79
|
+
actor: Actor;
|
|
80
|
+
timestamp_ns: number;
|
|
81
|
+
}>>;
|
|
82
|
+
/**
|
|
83
|
+
* When `true` and `from === to`, search for a non-trivial cycle (path
|
|
84
|
+
* back to `from` through ≥1 other node) instead of returning the trivial
|
|
85
|
+
* single-step. Use when debugging feedback loops (COMPOSITION-GUIDE §7).
|
|
86
|
+
* If no real cycle exists, falls back to the trivial single-step. Default
|
|
87
|
+
* `false` — backward-compatible.
|
|
88
|
+
*/
|
|
89
|
+
findCycle?: boolean;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Walks backward from `to` through `deps` to find the shortest path to `from`,
|
|
93
|
+
* then assembles an ordered, enriched {@link CausalChain}.
|
|
94
|
+
*
|
|
95
|
+
* @param described - `graph.describe()` output (any detail level; richer detail → richer steps).
|
|
96
|
+
* @param from - Path of the upstream node (the cause).
|
|
97
|
+
* @param to - Path of the downstream node (the effect).
|
|
98
|
+
* @param opts - Optional `maxDepth` and per-path annotation overlays.
|
|
99
|
+
* @returns A {@link CausalChain} — `found:false` with a `reason` when no path exists.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```ts
|
|
103
|
+
* import { explainPath } from "@graphrefly/graphrefly-ts";
|
|
104
|
+
* const chain = explainPath(graph.describe({ detail: "standard" }), "input", "result");
|
|
105
|
+
* console.log(chain.text);
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
declare function explainPath(described: GraphDescribeOutput, from: string, to: string, opts?: ExplainPathOptions): CausalChain;
|
|
4
109
|
|
|
5
110
|
/**
|
|
6
111
|
* Graph profiling and inspection utilities.
|
|
@@ -263,6 +368,27 @@ type GraphAttachStorageOptions = {
|
|
|
263
368
|
/** Surfaced on tier save errors and autoRestore failures. */
|
|
264
369
|
onError?: (error: unknown, tier: StorageTier) => void;
|
|
265
370
|
};
|
|
371
|
+
/**
|
|
372
|
+
* Event emitted by {@link Graph.topology} on every structural change to the
|
|
373
|
+
* graph's own registry. Does NOT include value mutations (use `observe()` for
|
|
374
|
+
* those) or transitively nested subgraph events (subscribe to each mounted
|
|
375
|
+
* child's `topology` for that).
|
|
376
|
+
*
|
|
377
|
+
* - `"added"` — `name` is the local key registered via {@link Graph.add}
|
|
378
|
+
* (`nodeKind: "node"`) or {@link Graph.mount} (`nodeKind: "mount"`).
|
|
379
|
+
* - `"removed"` — emitted AFTER {@link Graph.remove} completes teardown.
|
|
380
|
+
* `audit` is the full {@link GraphRemoveAudit} returned to the caller.
|
|
381
|
+
*/
|
|
382
|
+
type TopologyEvent = {
|
|
383
|
+
kind: "added";
|
|
384
|
+
name: string;
|
|
385
|
+
nodeKind: "node" | "mount";
|
|
386
|
+
} | {
|
|
387
|
+
kind: "removed";
|
|
388
|
+
name: string;
|
|
389
|
+
nodeKind: "node" | "mount";
|
|
390
|
+
audit: GraphRemoveAudit;
|
|
391
|
+
};
|
|
266
392
|
/** Direction options for diagram export helpers. */
|
|
267
393
|
type GraphDiagramDirection = "TD" | "LR" | "BT" | "RL";
|
|
268
394
|
/** Options for {@link Graph.toMermaid} / {@link Graph.toD2}. */
|
|
@@ -276,6 +402,13 @@ type GraphDiagramOptions = {
|
|
|
276
402
|
*/
|
|
277
403
|
direction?: GraphDiagramDirection;
|
|
278
404
|
};
|
|
405
|
+
/**
|
|
406
|
+
* Snapshot format version (§3.8). Exported so the surface layer's
|
|
407
|
+
* `saveSnapshot` writes the same `format_version` as
|
|
408
|
+
* `Graph.attachStorage` — one source of truth prevents silent wire
|
|
409
|
+
* drift between auto-checkpoint and one-shot persistence paths.
|
|
410
|
+
*/
|
|
411
|
+
declare const SNAPSHOT_VERSION = 1;
|
|
279
412
|
/**
|
|
280
413
|
* Option shapes that trigger structured-mode dispatch in {@link Graph.observe}.
|
|
281
414
|
* Presence of any of these fields (truthy) → returns {@link ObserveResult};
|
|
@@ -500,6 +633,20 @@ declare class Graph {
|
|
|
500
633
|
_parent: Graph | undefined;
|
|
501
634
|
private readonly _storageDisposers;
|
|
502
635
|
private readonly _disposers;
|
|
636
|
+
/**
|
|
637
|
+
* @internal Lazy `TopologyEvent` producer. Created on first `.topology`
|
|
638
|
+
* access. Zero cost until something subscribes — producer fn only runs when
|
|
639
|
+
* the first sink attaches, registering one handler into
|
|
640
|
+
* {@link Graph._topologyEmitters}.
|
|
641
|
+
*/
|
|
642
|
+
private _topology;
|
|
643
|
+
/**
|
|
644
|
+
* @internal Active emit handlers for the topology producer. Each entry is
|
|
645
|
+
* the closure registered by the producer fn on activation; cleared on
|
|
646
|
+
* deactivation. `_emitTopology` broadcasts through every entry (there is at
|
|
647
|
+
* most one per activation cycle of the producer).
|
|
648
|
+
*/
|
|
649
|
+
private readonly _topologyEmitters;
|
|
503
650
|
/**
|
|
504
651
|
* @param name - Non-empty graph id (must not contain `::` and must not
|
|
505
652
|
* equal the reserved meta segment `__meta__`).
|
|
@@ -513,6 +660,33 @@ declare class Graph {
|
|
|
513
660
|
* @param includeSelf - Include `this` in the chain (default `true`).
|
|
514
661
|
*/
|
|
515
662
|
ancestors(includeSelf?: boolean): Graph[];
|
|
663
|
+
/**
|
|
664
|
+
* Reactive stream of structural changes to this graph's own registry
|
|
665
|
+
* (add / mount / remove). Value mutations live on `observe()`; this
|
|
666
|
+
* companion only fires when the topology shape changes.
|
|
667
|
+
*
|
|
668
|
+
* Lazy: the underlying node is created on first access and activates when
|
|
669
|
+
* something subscribes. No emission replay — late subscribers do not
|
|
670
|
+
* receive historical events and should snapshot via {@link Graph.describe}
|
|
671
|
+
* before listening for incremental changes. Events that fire while the
|
|
672
|
+
* producer has zero subscribers are dropped (no retention).
|
|
673
|
+
*
|
|
674
|
+
* Own-graph only: a parent's `topology` does NOT emit for structural
|
|
675
|
+
* changes inside a mounted child. Transitive consumers subscribe to each
|
|
676
|
+
* child's topology separately (recurse through `topology`'s own "added"
|
|
677
|
+
* events with `nodeKind: "mount"` to discover new children).
|
|
678
|
+
*
|
|
679
|
+
* See {@link TopologyEvent} for payload shape.
|
|
680
|
+
*
|
|
681
|
+
* @category observability
|
|
682
|
+
*/
|
|
683
|
+
get topology(): Node<TopologyEvent>;
|
|
684
|
+
/**
|
|
685
|
+
* @internal Fire a {@link TopologyEvent} to every active subscriber of
|
|
686
|
+
* `this.topology`. No-op when the topology node has never been accessed or
|
|
687
|
+
* currently has no sinks — zero cost for graphs nobody observes.
|
|
688
|
+
*/
|
|
689
|
+
private _emitTopology;
|
|
516
690
|
/**
|
|
517
691
|
* Registers a node under a local name. Fails if the name is already used,
|
|
518
692
|
* reserved by a mount, the same node instance is already registered, or
|
|
@@ -734,6 +908,23 @@ declare class Graph {
|
|
|
734
908
|
withDetail: true;
|
|
735
909
|
}): ReachableResult;
|
|
736
910
|
reachable(from: string, direction: ReachableDirection, opts?: ReachableOptions): string[];
|
|
911
|
+
/**
|
|
912
|
+
* Causal walkback: shortest dep-chain from `from` to `to`, enriched with
|
|
913
|
+
* each node's value, status, last-mutation actor, and reasoning annotation
|
|
914
|
+
* from {@link Graph.trace}. Wraps {@link explainPath} (roadmap §9.2).
|
|
915
|
+
*
|
|
916
|
+
* @param from - Upstream node (the cause).
|
|
917
|
+
* @param to - Downstream node (the effect).
|
|
918
|
+
* @param opts - Optional `maxDepth` and `findCycle`. When `findCycle:true`
|
|
919
|
+
* and `from === to`, returns the shortest cycle through other nodes
|
|
920
|
+
* (useful for diagnosing feedback loops, COMPOSITION-GUIDE §7).
|
|
921
|
+
* Annotations and lastMutations are collected automatically from the
|
|
922
|
+
* live graph.
|
|
923
|
+
*/
|
|
924
|
+
explain(from: string, to: string, opts?: {
|
|
925
|
+
maxDepth?: number;
|
|
926
|
+
findCycle?: boolean;
|
|
927
|
+
}): CausalChain;
|
|
737
928
|
/**
|
|
738
929
|
* @internal Collect all qualified paths in this graph tree matching a
|
|
739
930
|
* glob pattern. Used by scoped autoCheckpoint subscription.
|
|
@@ -1125,4 +1316,4 @@ declare function reachable(described: GraphDescribeOutput, from: string, directi
|
|
|
1125
1316
|
}): ReachableResult;
|
|
1126
1317
|
declare function reachable(described: GraphDescribeOutput, from: string, direction: ReachableDirection, options?: ReachableOptions): string[];
|
|
1127
1318
|
|
|
1128
|
-
export {
|
|
1319
|
+
export { type ReachableOptions as A, type TraceEntry as B, type CausalChain as C, type DescribeFilter as D, type ExplainPathOptions as E, diffForWAL as F, type GraphOptions as G, explainPath as H, graphProfile as I, reachable as J, type NodeProfile as N, type ObserveDetail as O, type ReachableDirection as R, SNAPSHOT_VERSION as S, type TopologyEvent as T, Graph as a, type GraphDescribeOptions as b, type GraphDescribeOutput as c, type GraphProfileResult as d, type GraphProfileOptions as e, type GraphNodeFactory as f, type GraphDiffResult as g, type CausalStep as h, GRAPH_META_SEGMENT as i, type GraphActorOptions as j, type GraphAttachStorageOptions as k, type GraphCheckpointRecord as l, type GraphDiagramDirection as m, type GraphDiagramOptions as n, type GraphDiffChange as o, type GraphFactoryContext as p, type GraphObserveAll as q, type GraphObserveOne as r, type GraphPersistSnapshot 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 };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { N as Node } from './node-BmerH3kS.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Options for creating an atom.
|
|
5
|
+
*
|
|
6
|
+
* @category compat
|
|
7
|
+
*/
|
|
8
|
+
interface AtomOptions {
|
|
9
|
+
/** Optional identifier for the underlying node. */
|
|
10
|
+
name?: string;
|
|
11
|
+
/** Optional companion meta nodes. */
|
|
12
|
+
meta?: Record<string, unknown>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A read-only Jotai-compatible atom.
|
|
16
|
+
*
|
|
17
|
+
* @category compat
|
|
18
|
+
*/
|
|
19
|
+
interface ReadableAtom<T> {
|
|
20
|
+
/** Returns the current cached value. */
|
|
21
|
+
get(): T;
|
|
22
|
+
/** Subscribes to value changes. Returns an unsubscribe function. */
|
|
23
|
+
subscribe(callback: (value: T) => void): () => void;
|
|
24
|
+
/** Access to companion meta nodes. */
|
|
25
|
+
readonly meta: Record<string, Node>;
|
|
26
|
+
/** @internal The underlying GraphReFly node. */
|
|
27
|
+
_node: Node<T>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A writable Jotai-compatible atom.
|
|
31
|
+
*
|
|
32
|
+
* @category compat
|
|
33
|
+
*/
|
|
34
|
+
interface WritableAtom<T> extends ReadableAtom<T> {
|
|
35
|
+
/** Sets a new value. */
|
|
36
|
+
set(value: T): void;
|
|
37
|
+
/** Updates the value using a transformation function. */
|
|
38
|
+
update(fn: (current: T) => T): void;
|
|
39
|
+
}
|
|
40
|
+
/** Function type for reading other atoms inside a derived atom. */
|
|
41
|
+
type GetFn = <V>(a: ReadableAtom<V>) => V;
|
|
42
|
+
/** Function type for writing to other atoms inside a writable derived atom. */
|
|
43
|
+
type SetFn = <V>(a: WritableAtom<V>, value: V) => void;
|
|
44
|
+
/** Function that computes the atom's value. */
|
|
45
|
+
type ReadFn<T> = (get: GetFn) => T;
|
|
46
|
+
/** Function that handles writes to the atom. */
|
|
47
|
+
type WriteFn<T> = (get: GetFn, set: SetFn, value: T) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Creates a Jotai-compatible atom built on GraphReFly primitives.
|
|
50
|
+
*
|
|
51
|
+
* Supports three overloads:
|
|
52
|
+
* 1. `atom(initial)` — Writable primitive atom (wraps `state()`).
|
|
53
|
+
* 2. `atom(read)` — Read-only derived atom (wraps `dynamicNode()`).
|
|
54
|
+
* 3. `atom(read, write)` — Writable derived atom.
|
|
55
|
+
*
|
|
56
|
+
* @param initialOrRead - Initial value or a read function.
|
|
57
|
+
* @param writeOrOptions - Write function or options object.
|
|
58
|
+
* @param options - Optional configuration.
|
|
59
|
+
* @returns WritableAtom or ReadableAtom.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* const count = atom(0);
|
|
64
|
+
* count.set(1);
|
|
65
|
+
* const doubled = atom((get) => get(count)! * 2);
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* @category compat
|
|
69
|
+
*/
|
|
70
|
+
declare function atom<T>(initial: T, options?: AtomOptions): WritableAtom<T>;
|
|
71
|
+
declare function atom<T>(read: ReadFn<T>, options?: AtomOptions): ReadableAtom<T>;
|
|
72
|
+
declare function atom<T>(read: ReadFn<T>, write: WriteFn<T>, options?: AtomOptions): WritableAtom<T>;
|
|
73
|
+
|
|
74
|
+
type index_AtomOptions = AtomOptions;
|
|
75
|
+
type index_GetFn = GetFn;
|
|
76
|
+
type index_ReadFn<T> = ReadFn<T>;
|
|
77
|
+
type index_ReadableAtom<T> = ReadableAtom<T>;
|
|
78
|
+
type index_SetFn = SetFn;
|
|
79
|
+
type index_WritableAtom<T> = WritableAtom<T>;
|
|
80
|
+
type index_WriteFn<T> = WriteFn<T>;
|
|
81
|
+
declare const index_atom: typeof atom;
|
|
82
|
+
declare namespace index {
|
|
83
|
+
export { type index_AtomOptions as AtomOptions, type index_GetFn as GetFn, type index_ReadFn as ReadFn, type index_ReadableAtom as ReadableAtom, type index_SetFn as SetFn, type index_WritableAtom as WritableAtom, type index_WriteFn as WriteFn, index_atom as atom };
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export { type AtomOptions as A, type GetFn as G, type ReadFn as R, type SetFn as S, type WritableAtom as W, type ReadableAtom as a, type WriteFn as b, atom as c, index as i };
|