@graphrefly/ts 0.0.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 (210) hide show
  1. package/LICENSE +21 -0
  2. package/dist/adapters/index.cjs +9015 -0
  3. package/dist/adapters/index.cjs.map +1 -0
  4. package/dist/adapters/index.d.cts +678 -0
  5. package/dist/adapters/index.d.ts +678 -0
  6. package/dist/adapters/index.js +2894 -0
  7. package/dist/adapters/index.js.map +1 -0
  8. package/dist/adapters/observe-storage.cjs +260 -0
  9. package/dist/adapters/observe-storage.cjs.map +1 -0
  10. package/dist/adapters/observe-storage.d.cts +77 -0
  11. package/dist/adapters/observe-storage.d.ts +77 -0
  12. package/dist/adapters/observe-storage.js +161 -0
  13. package/dist/adapters/observe-storage.js.map +1 -0
  14. package/dist/append-log-DisvEReb.d.cts +189 -0
  15. package/dist/append-log-DzKMmjxx.d.ts +189 -0
  16. package/dist/chunk-2ILL7HQI.js +1189 -0
  17. package/dist/chunk-2ILL7HQI.js.map +1 -0
  18. package/dist/chunk-4VLAQHZI.js +330 -0
  19. package/dist/chunk-4VLAQHZI.js.map +1 -0
  20. package/dist/chunk-6PHB5CJS.js +229 -0
  21. package/dist/chunk-6PHB5CJS.js.map +1 -0
  22. package/dist/chunk-COHO25CZ.js +2449 -0
  23. package/dist/chunk-COHO25CZ.js.map +1 -0
  24. package/dist/chunk-D6BG7U6A.js +161 -0
  25. package/dist/chunk-D6BG7U6A.js.map +1 -0
  26. package/dist/chunk-DJC4CHLQ.js +818 -0
  27. package/dist/chunk-DJC4CHLQ.js.map +1 -0
  28. package/dist/chunk-DK554R7P.js +67 -0
  29. package/dist/chunk-DK554R7P.js.map +1 -0
  30. package/dist/chunk-DKP56CSW.js +322 -0
  31. package/dist/chunk-DKP56CSW.js.map +1 -0
  32. package/dist/chunk-G4M3NHRJ.js +688 -0
  33. package/dist/chunk-G4M3NHRJ.js.map +1 -0
  34. package/dist/chunk-GAJW5I5P.js +1 -0
  35. package/dist/chunk-GAJW5I5P.js.map +1 -0
  36. package/dist/chunk-GDL26N2T.js +282 -0
  37. package/dist/chunk-GDL26N2T.js.map +1 -0
  38. package/dist/chunk-GTPCOEOZ.js +741 -0
  39. package/dist/chunk-GTPCOEOZ.js.map +1 -0
  40. package/dist/chunk-H2HTHFVN.js +1 -0
  41. package/dist/chunk-H2HTHFVN.js.map +1 -0
  42. package/dist/chunk-HDRL4VQQ.js +218 -0
  43. package/dist/chunk-HDRL4VQQ.js.map +1 -0
  44. package/dist/chunk-I3IHOHCJ.js +2267 -0
  45. package/dist/chunk-I3IHOHCJ.js.map +1 -0
  46. package/dist/chunk-JIMUDQN3.js +965 -0
  47. package/dist/chunk-JIMUDQN3.js.map +1 -0
  48. package/dist/chunk-JR4IKCR2.js +462 -0
  49. package/dist/chunk-JR4IKCR2.js.map +1 -0
  50. package/dist/chunk-K3FXTC3I.js +165 -0
  51. package/dist/chunk-K3FXTC3I.js.map +1 -0
  52. package/dist/chunk-OOEN33FB.js +65 -0
  53. package/dist/chunk-OOEN33FB.js.map +1 -0
  54. package/dist/chunk-PKVBHGBM.js +554 -0
  55. package/dist/chunk-PKVBHGBM.js.map +1 -0
  56. package/dist/chunk-RIIOUTGM.js +1857 -0
  57. package/dist/chunk-RIIOUTGM.js.map +1 -0
  58. package/dist/chunk-SCRFRCGR.js +33 -0
  59. package/dist/chunk-SCRFRCGR.js.map +1 -0
  60. package/dist/chunk-SWTLEQL6.js +53 -0
  61. package/dist/chunk-SWTLEQL6.js.map +1 -0
  62. package/dist/chunk-SZAETNNA.js +1 -0
  63. package/dist/chunk-SZAETNNA.js.map +1 -0
  64. package/dist/chunk-TEW47IVR.js +49 -0
  65. package/dist/chunk-TEW47IVR.js.map +1 -0
  66. package/dist/chunk-Y3ZLRGHC.js +1482 -0
  67. package/dist/chunk-Y3ZLRGHC.js.map +1 -0
  68. package/dist/chunk-Z2ANQ6JW.js +149 -0
  69. package/dist/chunk-Z2ANQ6JW.js.map +1 -0
  70. package/dist/codec-BB7p8fJc.d.cts +38 -0
  71. package/dist/codec-BB7p8fJc.d.ts +38 -0
  72. package/dist/composition/index.cjs +2505 -0
  73. package/dist/composition/index.cjs.map +1 -0
  74. package/dist/composition/index.d.cts +95 -0
  75. package/dist/composition/index.d.ts +95 -0
  76. package/dist/composition/index.js +19 -0
  77. package/dist/composition/index.js.map +1 -0
  78. package/dist/core/index.cjs +2475 -0
  79. package/dist/core/index.cjs.map +1 -0
  80. package/dist/core/index.d.cts +25 -0
  81. package/dist/core/index.d.ts +25 -0
  82. package/dist/core/index.js +74 -0
  83. package/dist/core/index.js.map +1 -0
  84. package/dist/cqrs/index.cjs +595 -0
  85. package/dist/cqrs/index.cjs.map +1 -0
  86. package/dist/cqrs/index.d.cts +200 -0
  87. package/dist/cqrs/index.d.ts +200 -0
  88. package/dist/cqrs/index.js +557 -0
  89. package/dist/cqrs/index.js.map +1 -0
  90. package/dist/data-structures/index.cjs +4277 -0
  91. package/dist/data-structures/index.cjs.map +1 -0
  92. package/dist/data-structures/index.d.cts +22 -0
  93. package/dist/data-structures/index.d.ts +22 -0
  94. package/dist/data-structures/index.js +31 -0
  95. package/dist/data-structures/index.js.map +1 -0
  96. package/dist/describe-BZb7AS2y.d.ts +57 -0
  97. package/dist/describe-Ciu8SUnN.d.cts +57 -0
  98. package/dist/graph/index.cjs +7832 -0
  99. package/dist/graph/index.cjs.map +1 -0
  100. package/dist/graph/index.d.cts +251 -0
  101. package/dist/graph/index.d.ts +251 -0
  102. package/dist/graph/index.js +131 -0
  103. package/dist/graph/index.js.map +1 -0
  104. package/dist/graph-DfdF9zy4.d.ts +666 -0
  105. package/dist/graph-s23RbbFO.d.cts +666 -0
  106. package/dist/index-CAEmLCYF.d.cts +166 -0
  107. package/dist/index-SnzZu3x7.d.ts +166 -0
  108. package/dist/index.cjs +15409 -0
  109. package/dist/index.cjs.map +1 -0
  110. package/dist/index.d.cts +23 -0
  111. package/dist/index.d.ts +23 -0
  112. package/dist/index.js +582 -0
  113. package/dist/index.js.map +1 -0
  114. package/dist/messages-BZqrGGm1.d.cts +55 -0
  115. package/dist/messages-BZqrGGm1.d.ts +55 -0
  116. package/dist/messaging/index.cjs +818 -0
  117. package/dist/messaging/index.cjs.map +1 -0
  118. package/dist/messaging/index.d.cts +235 -0
  119. package/dist/messaging/index.d.ts +235 -0
  120. package/dist/messaging/index.js +767 -0
  121. package/dist/messaging/index.js.map +1 -0
  122. package/dist/observe-event-log-0SVsx7JG.d.cts +88 -0
  123. package/dist/observe-event-log-Dnm76owp.d.ts +88 -0
  124. package/dist/operators/index.cjs +3774 -0
  125. package/dist/operators/index.cjs.map +1 -0
  126. package/dist/operators/index.d.cts +308 -0
  127. package/dist/operators/index.d.ts +308 -0
  128. package/dist/operators/index.js +112 -0
  129. package/dist/operators/index.js.map +1 -0
  130. package/dist/orchestration/index.cjs +3541 -0
  131. package/dist/orchestration/index.cjs.map +1 -0
  132. package/dist/orchestration/index.d.cts +302 -0
  133. package/dist/orchestration/index.d.ts +302 -0
  134. package/dist/orchestration/index.js +1004 -0
  135. package/dist/orchestration/index.js.map +1 -0
  136. package/dist/patterns/index.cjs +1045 -0
  137. package/dist/patterns/index.cjs.map +1 -0
  138. package/dist/patterns/index.d.cts +39 -0
  139. package/dist/patterns/index.d.ts +39 -0
  140. package/dist/patterns/index.js +33 -0
  141. package/dist/patterns/index.js.map +1 -0
  142. package/dist/reactive-collection-BxBqtIOE.d.cts +344 -0
  143. package/dist/reactive-collection-Cb1II1Fi.d.ts +344 -0
  144. package/dist/reactive-collection-storage-BNiEc-Gd.d.ts +217 -0
  145. package/dist/reactive-collection-storage-D-KmjE0J.d.cts +217 -0
  146. package/dist/reactive-map-BcB4KsQR.d.ts +256 -0
  147. package/dist/reactive-map-D-g3dv8I.d.cts +256 -0
  148. package/dist/read-through-B1CYPfq_.d.cts +82 -0
  149. package/dist/read-through-DwyJhGs1.d.ts +82 -0
  150. package/dist/render/index.cjs +250 -0
  151. package/dist/render/index.cjs.map +1 -0
  152. package/dist/render/index.d.cts +58 -0
  153. package/dist/render/index.d.ts +58 -0
  154. package/dist/render/index.js +20 -0
  155. package/dist/render/index.js.map +1 -0
  156. package/dist/resilience-Dig3Q7n0.d.cts +45 -0
  157. package/dist/resilience-Dig3Q7n0.d.ts +45 -0
  158. package/dist/semantic-memory-graph-BYoIlP35.d.cts +356 -0
  159. package/dist/semantic-memory-graph-CxyXLms3.d.ts +356 -0
  160. package/dist/solutions/index.cjs +3249 -0
  161. package/dist/solutions/index.cjs.map +1 -0
  162. package/dist/solutions/index.d.cts +520 -0
  163. package/dist/solutions/index.d.ts +520 -0
  164. package/dist/solutions/index.js +31 -0
  165. package/dist/solutions/index.js.map +1 -0
  166. package/dist/sources/browser.cjs +3095 -0
  167. package/dist/sources/browser.cjs.map +1 -0
  168. package/dist/sources/browser.d.cts +39 -0
  169. package/dist/sources/browser.d.ts +39 -0
  170. package/dist/sources/browser.js +137 -0
  171. package/dist/sources/browser.js.map +1 -0
  172. package/dist/sources/index.cjs +3021 -0
  173. package/dist/sources/index.cjs.map +1 -0
  174. package/dist/sources/index.d.cts +7 -0
  175. package/dist/sources/index.d.ts +7 -0
  176. package/dist/sources/index.js +63 -0
  177. package/dist/sources/index.js.map +1 -0
  178. package/dist/sources/node.cjs +675 -0
  179. package/dist/sources/node.cjs.map +1 -0
  180. package/dist/sources/node.d.cts +109 -0
  181. package/dist/sources/node.d.ts +109 -0
  182. package/dist/sources/node.js +639 -0
  183. package/dist/sources/node.js.map +1 -0
  184. package/dist/storage/browser.cjs +777 -0
  185. package/dist/storage/browser.cjs.map +1 -0
  186. package/dist/storage/browser.d.cts +40 -0
  187. package/dist/storage/browser.d.ts +40 -0
  188. package/dist/storage/browser.js +275 -0
  189. package/dist/storage/browser.js.map +1 -0
  190. package/dist/storage/index.cjs +1989 -0
  191. package/dist/storage/index.cjs.map +1 -0
  192. package/dist/storage/index.d.cts +92 -0
  193. package/dist/storage/index.d.ts +92 -0
  194. package/dist/storage/index.js +161 -0
  195. package/dist/storage/index.js.map +1 -0
  196. package/dist/storage/node.cjs +898 -0
  197. package/dist/storage/node.cjs.map +1 -0
  198. package/dist/storage/node.d.cts +66 -0
  199. package/dist/storage/node.d.ts +66 -0
  200. package/dist/storage/node.js +402 -0
  201. package/dist/storage/node.js.map +1 -0
  202. package/dist/testing/index.cjs +95 -0
  203. package/dist/testing/index.cjs.map +1 -0
  204. package/dist/testing/index.d.cts +20 -0
  205. package/dist/testing/index.d.ts +20 -0
  206. package/dist/testing/index.js +8 -0
  207. package/dist/testing/index.js.map +1 -0
  208. package/dist/types-bNMSWKqF.d.cts +732 -0
  209. package/dist/types-h12mNYbq.d.ts +732 -0
  210. package/package.json +250 -0
@@ -0,0 +1,666 @@
1
+ import { BatchCtx } from './core/index.cjs';
2
+ import { q as NodeVersionJson, B as Status, N as Node, m as NodeFn, D as Dispatcher, u as NodeVersioningPolicy, C as Ctx, n as NodeOptions, E as EnvironmentDrivers } from './types-bNMSWKqF.cjs';
3
+ import { S as StrictJsonObject, b as StrictJsonValue } from './codec-BB7p8fJc.cjs';
4
+ import { G as GraphTopologyEdge, e as GraphTopologySnapshot, b as DescribeOpts, c as DescribeSnapshot } from './describe-Ciu8SUnN.cjs';
5
+ import { M as Message } from './messages-BZqrGGm1.cjs';
6
+
7
+ /**
8
+ * GraphBlueprint first slice (D173/D177).
9
+ *
10
+ * A blueprint is read-only audit/collaboration evidence over graph.topology(). It is not an
11
+ * authoring spec, checkpoint, restore input, hash owner, or collaboration ownership artifact.
12
+ */
13
+
14
+ declare const GRAPH_BLUEPRINT_VERSION: "graphrefly.blueprint.v1";
15
+ type GraphBlueprintJson = StrictJsonValue;
16
+ type GraphBlueprintProvenance = StrictJsonObject;
17
+ interface NormalizedGraphTopologyNode {
18
+ readonly id: string;
19
+ readonly name?: string;
20
+ readonly factory: string;
21
+ readonly deps: readonly string[];
22
+ readonly meta?: Readonly<Record<string, GraphBlueprintJson>>;
23
+ }
24
+ interface NormalizedGraphTopologySnapshot {
25
+ readonly name?: string;
26
+ readonly nodes: readonly NormalizedGraphTopologyNode[];
27
+ readonly edges: readonly GraphTopologyEdge[];
28
+ readonly subgraphs?: readonly NormalizedGraphTopologySnapshot[];
29
+ }
30
+ type GraphBlueprintDiagnosticCode = "dangling-dep" | "duplicate-node-id" | "island-node";
31
+ interface GraphBlueprintDiagnosticIssue {
32
+ readonly severity: "warning" | "error";
33
+ readonly code: GraphBlueprintDiagnosticCode;
34
+ readonly message: string;
35
+ readonly nodeId?: string;
36
+ readonly from?: string;
37
+ readonly to?: string;
38
+ }
39
+ interface GraphBlueprintDiagnostics {
40
+ readonly ok: boolean;
41
+ readonly issues: readonly GraphBlueprintDiagnosticIssue[];
42
+ }
43
+ type GraphBlueprintHashInput = "strictCanonicalTopologyBytes";
44
+ interface GraphBlueprintHash {
45
+ readonly kind: "topology";
46
+ readonly algorithm: string;
47
+ readonly input: GraphBlueprintHashInput;
48
+ readonly value: string;
49
+ }
50
+ interface GraphBlueprintHashOptions {
51
+ readonly algorithm: string;
52
+ readonly hash: (bytes: Uint8Array) => string | Promise<string>;
53
+ }
54
+ interface GraphBlueprint {
55
+ readonly version: typeof GRAPH_BLUEPRINT_VERSION;
56
+ readonly topology: NormalizedGraphTopologySnapshot;
57
+ readonly diagnostics?: GraphBlueprintDiagnostics;
58
+ readonly provenance?: GraphBlueprintProvenance;
59
+ readonly hash?: GraphBlueprintHash;
60
+ }
61
+ interface GraphBlueprintOptions {
62
+ /** Include graph-local structural diagnostics over the normalized topology. */
63
+ readonly diagnostics?: boolean;
64
+ /** Caller-supplied provenance only; environment enrichment stays outside Graph core (D177). */
65
+ readonly provenance?: GraphBlueprintProvenance;
66
+ }
67
+ declare function normalizeTopology(snapshot: GraphTopologySnapshot | NormalizedGraphTopologySnapshot): NormalizedGraphTopologySnapshot;
68
+ declare function canonicalTopologyJson(snapshot: GraphTopologySnapshot | NormalizedGraphTopologySnapshot): string;
69
+ declare function canonicalTopologyBytes(snapshot: GraphTopologySnapshot | NormalizedGraphTopologySnapshot): Uint8Array;
70
+ declare function withBlueprintHash(blueprint: GraphBlueprint, options: GraphBlueprintHashOptions): GraphBlueprint | Promise<GraphBlueprint>;
71
+ declare function withBlueprintProvenance(blueprint: GraphBlueprint, provenance: GraphBlueprintProvenance): GraphBlueprint;
72
+ declare function graphBlueprintDiagnostics(topology: NormalizedGraphTopologySnapshot): GraphBlueprintDiagnostics;
73
+
74
+ /**
75
+ * Graph checkpoint public data shape (D83/D86/D90/D116).
76
+ *
77
+ * Checkpoint is a graph lifecycle snapshot: strict-JSON-compatible data, no storage I/O,
78
+ * no observe-log replay, and no restore runtime in this first TS slice.
79
+ */
80
+
81
+ declare const GRAPH_CHECKPOINT_VERSION: "graphrefly.checkpoint.v1";
82
+ type GraphCheckpointVersion = typeof GRAPH_CHECKPOINT_VERSION;
83
+ type GraphCheckpointJson = StrictJsonValue;
84
+ type GraphCheckpointValue = {
85
+ kind: "SENTINEL";
86
+ } | {
87
+ kind: "DATA";
88
+ data: GraphCheckpointJson;
89
+ };
90
+ type GraphCheckpointTerminal = {
91
+ kind: "none";
92
+ } | {
93
+ kind: "COMPLETE";
94
+ } | {
95
+ kind: "ERROR";
96
+ error: GraphCheckpointJson;
97
+ };
98
+ type GraphCheckpointFactory = {
99
+ kind: "registry-ref";
100
+ ref: string;
101
+ config?: GraphCheckpointJson;
102
+ configVersion?: GraphCheckpointJson;
103
+ } | {
104
+ kind: "local-only";
105
+ name: string;
106
+ reason: string;
107
+ };
108
+ interface GraphCheckpointNode {
109
+ id: string;
110
+ name?: string;
111
+ factory: GraphCheckpointFactory;
112
+ status: string;
113
+ deps: string[];
114
+ value: GraphCheckpointValue;
115
+ backendState?: GraphCheckpointJson;
116
+ version?: NodeVersionJson;
117
+ terminal: GraphCheckpointTerminal;
118
+ lifecycle: {
119
+ activated: boolean;
120
+ hasCalledFnOnce: boolean;
121
+ };
122
+ ctxState: {
123
+ persist: boolean;
124
+ value: GraphCheckpointValue;
125
+ };
126
+ meta?: {
127
+ [key: string]: GraphCheckpointJson;
128
+ };
129
+ }
130
+ interface GraphCheckpointEdge {
131
+ from: string;
132
+ to: string;
133
+ }
134
+ interface GraphCheckpointMount {
135
+ at: string;
136
+ checkpoint: GraphCheckpoint;
137
+ }
138
+ interface GraphCheckpoint {
139
+ version: GraphCheckpointVersion;
140
+ name?: string;
141
+ nodes: GraphCheckpointNode[];
142
+ edges: GraphCheckpointEdge[];
143
+ mounts?: GraphCheckpointMount[];
144
+ }
145
+
146
+ /**
147
+ * observe / profile inspection shapes (R-observe, R-profile / D39).
148
+ *
149
+ * observe = a read-only enveloped EGRESS (not a graph node). profile = an opt-in
150
+ * accumulated-counter snapshot backed by the dispatcher recorder (counters never live on
151
+ * the thin node, R-node-thin). Per-language (D24, never in parity).
152
+ */
153
+
154
+ /** One item of an observe() stream. The envelope carries node identity + ordering. */
155
+ interface ObserveEvent {
156
+ /** Mount-aware `::` path of the emitting node (shared key with describe/profile). */
157
+ path: string;
158
+ /** The protocol message observed at that node. */
159
+ msg: Message;
160
+ /** messageTier(msg[0]). */
161
+ tier: number;
162
+ /** Graph-local monotonic sequence (D26) — orders events across nodes. */
163
+ seq: number;
164
+ }
165
+ /** A read-only egress: subscribe to the live ObserveEvent stream; call the returned fn to stop. */
166
+ interface ObserveStream {
167
+ subscribe(sink: (e: ObserveEvent) => void): () => void;
168
+ }
169
+ type TopologyEventKind = "node-registered" | "deps-changed" | "node-released" | "mount-changed";
170
+ interface TopologyEvent {
171
+ /** D145 graph inspection/lifecycle event kind. Not a protocol message. */
172
+ readonly kind: TopologyEventKind;
173
+ /** Mount-aware `::` path of the affected registered node. */
174
+ readonly path: string;
175
+ /** Current dep ids after the event, matching describe().nodes[].deps. */
176
+ readonly deps: readonly string[];
177
+ /** Previous dep ids for deps-changed events. */
178
+ readonly prevDeps?: readonly string[];
179
+ /** Factory name for node-registered and node-released events. */
180
+ readonly factory?: string;
181
+ /** Graph-local monotonic sequence shared with observe() ordering. */
182
+ readonly seq: number;
183
+ }
184
+ /** A read-only topology egress stream. It does not activate nodes or emit DATA. */
185
+ interface TopologyStream {
186
+ subscribe(sink: (e: TopologyEvent) => void): () => void;
187
+ }
188
+ /** Predicate used by filterObserve(). */
189
+ type ObservePredicate = (event: ObserveEvent) => boolean;
190
+ /** Equality used by coalesceObserve() for adjacent observe-event suppression. */
191
+ type ObserveEventEquals = (prev: ObserveEvent, next: ObserveEvent) => boolean;
192
+ /**
193
+ * Filter a read-only observe egress stream without turning it into a graph node.
194
+ *
195
+ * The source stream owns ordering and lifecycle; this helper only decides whether to forward each
196
+ * ObserveEvent and returns the source unsubscribe unchanged.
197
+ */
198
+ declare function filterObserve(stream: ObserveStream, predicate: ObservePredicate): ObserveStream;
199
+ /**
200
+ * Suppress adjacent duplicate ObserveEvents while preserving the source stream order.
201
+ *
202
+ * This is egress-side coalescing only: it does not batch, delay, reorder, alter seq values, or add
203
+ * topology to describe(). Pass a custom equality when the caller wants a narrower or wider
204
+ * definition of "duplicate".
205
+ */
206
+ declare function coalesceObserve(stream: ObserveStream, equals?: ObserveEventEquals): ObserveStream;
207
+ /** Per-node profile counters (D39). invokes/duration are dispatcher-backed (R-profile). */
208
+ interface NodeProfile {
209
+ invokes: number;
210
+ totalDurationNs: number;
211
+ lastDurationNs: number;
212
+ status: Status;
213
+ }
214
+ /** profile() snapshot. Shares the mount-aware `::` path key with describe/observe. */
215
+ interface Profile {
216
+ totalInvokes: number;
217
+ nodes: Record<string, NodeProfile>;
218
+ }
219
+
220
+ interface GraphRestoreDefinition<S = never, T = unknown> {
221
+ readonly kind: "definition";
222
+ readonly ref: string;
223
+ readonly fn: (v: S) => T;
224
+ }
225
+ type GraphRestoreEntry = GraphRestoreDescriptor | GraphRestoreDefinition;
226
+ interface GraphRestoreDescriptorContext<C extends GraphCheckpointJson | undefined = GraphCheckpointJson | undefined> {
227
+ readonly graph: Graph;
228
+ readonly id: string;
229
+ readonly name?: string;
230
+ readonly deps: readonly Node<unknown>[];
231
+ readonly config: C;
232
+ readonly configVersion?: GraphCheckpointJson;
233
+ readonly checkpoint: GraphCheckpointNode;
234
+ resolveDefinition<S = unknown, T = unknown>(ref: string): GraphRestoreDefinition<S, T>;
235
+ registerState<T = unknown>(opts?: SugarOpts<T>): Node<unknown>;
236
+ registerNode<T = unknown>(factory: string, deps: readonly Node<unknown>[], fn: NodeFn | null, opts?: SugarOpts<T>): Node<unknown>;
237
+ }
238
+ interface GraphRestoreDescriptor<C extends GraphCheckpointJson | undefined = GraphCheckpointJson | undefined> {
239
+ readonly ref: string;
240
+ validateConfig?(config: GraphCheckpointJson | undefined, configVersion: GraphCheckpointJson | undefined, checkpoint: GraphCheckpointNode): C;
241
+ create(ctx: GraphRestoreDescriptorContext<C>): Node<unknown>;
242
+ }
243
+ type GraphRestoreRegistry = ReadonlyMap<string, GraphRestoreEntry> | Readonly<Record<string, GraphRestoreEntry>>;
244
+ interface RestoreGraphOptions {
245
+ registry: GraphRestoreRegistry;
246
+ dispatcher?: Dispatcher;
247
+ versioning?: NodeVersioningPolicy;
248
+ }
249
+ declare const stateRestoreDescriptor: GraphRestoreDescriptor<undefined>;
250
+ type TakeConfig = {
251
+ n: number;
252
+ };
253
+ type TimerConfig = {
254
+ ms: number;
255
+ };
256
+ type MapConfig = {
257
+ fn: string;
258
+ };
259
+ declare const takeRestoreDescriptor: GraphRestoreDescriptor<TakeConfig>;
260
+ declare const mapRestoreDescriptor: GraphRestoreDescriptor<MapConfig>;
261
+ declare const timerRestoreDescriptor: GraphRestoreDescriptor<TimerConfig>;
262
+ declare const defaultRestoreRegistry: Readonly<Record<string, GraphRestoreDescriptor>>;
263
+ declare function restoreGraph(checkpoint: GraphCheckpoint, options: RestoreGraphOptions): Graph;
264
+
265
+ /**
266
+ * Operators as free-standing factory definitions (D43 / D6 / D40 Catalog-first).
267
+ *
268
+ * Operators are `node` sugar (D6), NOT verbs (D4) and NEVER in parity (D24). Each is a
269
+ * pure {@link Operator} spec — `{factory, body, opts}` — built on the bare `node` primitive
270
+ * (NOT the `derived` verb): `body` reads ctx dep slots positionally and emits via
271
+ * `ctx.down`. Two ways to instantiate:
272
+ *
273
+ * - {@link initNode}(op, deps, opts?) — bare, no Graph; returns a working `Node<T>`.
274
+ * - `g.initNode(op, deps, opts?)` — graph-bound; the SAME call, plus inspection registration
275
+ * (the real factory name lands in the graph's `_entries`, so describe/observe/profile
276
+ * show it — D6/R-describe — while the node stays thin, R-node-thin).
277
+ *
278
+ * The D30 throw→ERROR boundary lives once, in the free {@link initNode} (which `g.initNode`
279
+ * funnels through). The pure-ts `operatorOpts/partialOperatorOpts/gatedOperatorOpts` trio is
280
+ * NOT ported: its sole job (`describeKind:"derived"`) is dead under D6/D39 (factory = the
281
+ * REAL operator name); only the `partial`/`terminalAsRealInput` flags survive, carried
282
+ * per-operator in `op.opts`.
283
+ *
284
+ * Config is folded into the factory (`map(fn)`, `scan(reducer, seed)`, `take(n)`, `merge()`),
285
+ * so fn params are annotated where the source type can't be inferred (RxJS-pipe cost);
286
+ * dep-type safety is recovered by the typed `g.initNode` overloads.
287
+ */
288
+
289
+ /**
290
+ * A free-standing operator definition (D43). `TIn` = the element type each dep delivers
291
+ * (the operator reads `depLatest(ctx, i) as TIn`); `TOut` = the emitted value type.
292
+ * `__in`/`__out` are phantom-only (never assigned) — they let `g.initNode` infer + check the
293
+ * dep tuple against the operator without an explicit type argument.
294
+ */
295
+ interface Operator<TIn = unknown, TOut = unknown> {
296
+ /** Real operator name shown in describe (D6/L1.5) — recorded at `_add` by `g.initNode`. */
297
+ readonly factory: string;
298
+ /** The ctx-body: reads ctx dep slots positionally, emits via `ctx.down`. */
299
+ readonly body: (ctx: Ctx) => void;
300
+ /** Behavioral node options the operator needs (e.g. `partial:true` for combine-family). */
301
+ readonly opts?: Partial<NodeOptions<TOut>>;
302
+ /**
303
+ * D97/D100 restore metadata derived from a named definition or static built-in config.
304
+ * This is semantic metadata only; dispatcher handles stay graph-local runtime state.
305
+ */
306
+ readonly restore?: {
307
+ ref: string;
308
+ config?: GraphCheckpointJson;
309
+ configVersion?: GraphCheckpointJson;
310
+ };
311
+ /** @internal phantom — never set; carries the dep element type for `g.initNode` inference. */
312
+ readonly __in?: TIn;
313
+ /** @internal phantom — never set; carries the output value type. */
314
+ readonly __out?: TOut;
315
+ }
316
+ type MutableRestoreRegistry = Map<string, GraphRestoreEntry> | Record<string, GraphRestoreEntry>;
317
+ type RestoreRegistryEntry = GraphRestoreEntry;
318
+ interface Definition<S = unknown, T = unknown> extends GraphRestoreDefinition<S, T> {
319
+ readonly ref: string;
320
+ readonly fn: (v: S) => T;
321
+ }
322
+ interface DefineOpts {
323
+ registry?: MutableRestoreRegistry;
324
+ }
325
+ declare function restoreRegistry(entries?: readonly GraphRestoreEntry[], base?: GraphRestoreRegistry): Map<string, GraphRestoreEntry>;
326
+ declare function define<S, T>(ref: string, fn: (v: S) => T, opts?: DefineOpts): Definition<S, T>;
327
+ /**
328
+ * Instantiate an operator as a bare `Node<T>` — NO Graph required (D43 bare-node path).
329
+ * Wraps `op.body` in the D30 value-throw→ERROR boundary; merges `op.opts` with caller `opts`
330
+ * (caller wins, so `partial`/`pool`/`dispatcher` overrides take effect). The
331
+ * dispatcher defaults to the process-global (D26) unless `opts.dispatcher` is passed.
332
+ *
333
+ * `g.initNode` is the same call PLUS graph registration; graph inspection
334
+ * (describe/observe/profile) requires that path — a node built bare here is not registered in
335
+ * any graph's index.
336
+ */
337
+ declare function initNode<TIn, TOut>(op: Operator<TIn, TOut>, deps: readonly Node<unknown>[], opts?: NodeOptions<TOut>): Node<TOut>;
338
+ /** map: emit fn(value). A named {@link define} makes the map restorable via the map descriptor (D101). */
339
+ declare function map<S, T>(fn: ((v: S) => T) | Definition<S, T>): Operator<S, T>;
340
+ /** filter: emit value only when pred(value) (else skip the wave). */
341
+ declare function filter<S>(pred: (v: S) => boolean): Operator<S, S>;
342
+ /** scan: stateful accumulator over the upstream (acc seeded once, kept in ctx.state). */
343
+ declare function scan<S, T>(reducer: (acc: T, v: S) => T, seed: T): Operator<S, T>;
344
+ /** take: emit the first n values, then COMPLETE (terminal-is-forever). */
345
+ declare function take<S>(n: number): Operator<S, S>;
346
+ /** distinctUntilChanged: emit only when the value differs from the previous emit. */
347
+ declare function distinctUntilChanged<S>(eq?: (a: S, b: S) => boolean): Operator<S, S>;
348
+ /**
349
+ * merge: interleave several sources — emit each DATA from whichever dep fired. `partial:true`
350
+ * (combine-family): fires on any single dep, not gated on all deps settling.
351
+ */
352
+ declare function merge<T>(): Operator<T, T>;
353
+ /**
354
+ * reduce: accumulate over the whole source, emit ONE final value on the source's COMPLETE
355
+ * (RxJS `reduce`). Unlike {@link scan} (which emits every step), reduce stays quiet until the
356
+ * source terminates. `completeWhenDepsComplete:false + terminalAsRealInput:true`: the fn fires on
357
+ * the source COMPLETE (reading `terminal===true`) and emits the accumulator + COMPLETE. An empty
358
+ * source emits the seed (RxJS parity). A source ERROR auto-forwards (errorWhenDepsError default).
359
+ */
360
+ declare function reduce<S, T>(reducer: (acc: T, v: S) => T, seed: T): Operator<S, T>;
361
+ /**
362
+ * pairwise: emit `[previous, current]` for each consecutive pair; the very first value produces no
363
+ * pair (quiet → undirty RESOLVED). Previous value is kept in `ctx.state`.
364
+ */
365
+ declare function pairwise<S>(): Operator<S, readonly [S, S]>;
366
+ /** skip: drop the first `n` DATA values, then pass the rest through. */
367
+ declare function skip<S>(n: number): Operator<S, S>;
368
+ /**
369
+ * takeWhile: emit values while `pred` holds; on the first value that fails `pred`, COMPLETE
370
+ * WITHOUT emitting it (RxJS default, non-inclusive). Terminal-is-forever once it completes.
371
+ */
372
+ declare function takeWhile<S>(pred: (v: S) => boolean): Operator<S, S>;
373
+ /**
374
+ * first: emit the first value matching `pred` (or simply the first value), then COMPLETE. EDGE
375
+ * (RxJS divergence, flagged — same class as last/find/elementAt): if the source COMPLETEs with no
376
+ * matching value, the substrate auto-cascades a bare COMPLETE (no value); RxJS `first()` throws
377
+ * EmptyError. Could align to `[[ERROR, EmptyError]]` (expressible) if strict RxJS parity is wanted.
378
+ */
379
+ declare function first<S>(pred?: (v: S) => boolean): Operator<S, S>;
380
+ /**
381
+ * last: emit the last value matching `pred` (or the last value) on the source's COMPLETE.
382
+ * `completeWhenDepsComplete:false + terminalAsRealInput:true`. EDGE (RxJS divergence, flagged):
383
+ * RxJS `last()` throws EmptyError when no value matched; we COMPLETE without a value (no throw) —
384
+ * the clean-slate substrate has no "complete-or-throw" terminal and SENTINEL forbids emitting a
385
+ * placeholder.
386
+ */
387
+ declare function last<S>(pred?: (v: S) => boolean): Operator<S, S>;
388
+ /**
389
+ * find: emit the first value matching `pred`, then COMPLETE. EDGE (RxJS divergence, flagged): RxJS
390
+ * `find` emits `undefined` then COMPLETE when nothing matched — but `undefined` IS the SENTINEL
391
+ * (R-sentinel), so a not-found source COMPLETE here emits a bare COMPLETE (no value).
392
+ */
393
+ declare function find<S>(pred: (v: S) => boolean): Operator<S, S>;
394
+ /**
395
+ * elementAt: emit the value at zero-based `index`, then COMPLETE. EDGE (RxJS divergence, flagged):
396
+ * RxJS throws ArgumentOutOfRangeError if the source completes before `index`; we COMPLETE without
397
+ * a value (no throw), consistent with last/find.
398
+ */
399
+ declare function elementAt<S>(index: number): Operator<S, S>;
400
+ /** Observer object for {@link tap} — lifecycle-aware side effects (RxJS tap observer form). */
401
+ interface TapObserver<T> {
402
+ data?: (value: T) => void;
403
+ error?: (err: unknown) => void;
404
+ complete?: () => void;
405
+ }
406
+ /**
407
+ * tap: invoke a side effect on each DATA (function form) or on data/error/complete (observer form);
408
+ * values pass through unchanged. The observer form reads source terminals
409
+ * (`completeWhenDepsComplete:false + errorWhenDepsError:false + terminalAsRealInput:true`) so it can
410
+ * call `error`/`complete` then forward the terminal; the function form lets the substrate
411
+ * auto-cascade terminals.
412
+ */
413
+ declare function tap<S>(fnOrObserver: ((v: S) => void) | TapObserver<S>): Operator<S, S>;
414
+ /**
415
+ * onFirstData (alias `tapFirst`): invoke `fn` exactly once on the first qualifying value (default
416
+ * `where: v => v != null` — null/undefined pass through without counting as "first"), then pass all
417
+ * values through unchanged. The one-shot guard is per-node `ctx.state` (NOT a factory closure, so a
418
+ * second instantiation of the same factory re-arms — R-ctx-state).
419
+ */
420
+ declare function onFirstData<S>(fn: (v: S) => void, opts?: {
421
+ where?: (v: S) => boolean;
422
+ }): Operator<S, S>;
423
+ /** tapFirst: alias of {@link onFirstData} (the one-shot companion to {@link tap}). */
424
+ declare const tapFirst: typeof onFirstData;
425
+ /** Options for {@link settle}. */
426
+ interface SettleOpts<S> {
427
+ /** Consecutive no-change waves before declaring convergence + COMPLETE. */
428
+ quietWaves: number;
429
+ /** Optional hard cap on total waves before forced COMPLETE. */
430
+ maxWaves?: number;
431
+ /** Optional comparator; a DATA equal to the previous one does NOT reset the quiet counter. */
432
+ equals?: (a: S, b: S) => boolean;
433
+ }
434
+ /**
435
+ * settle: forward each DATA unchanged, watch for convergence, COMPLETE once the source has been
436
+ * quiet for `quietWaves` consecutive waves (or `maxWaves` elapsed). "Wave" = one fn invocation
437
+ * (a DATA batch OR a bare undirty RESOLVED end-of-wave). No polling (R-no-polling) — the counter
438
+ * advances only on real upstream waves. `settle`'s own `equals` is a body comparator, NOT the
439
+ * removed substrate `equals` (D49).
440
+ */
441
+ declare function settle<S>(opts: SettleOpts<S>): Operator<S, S>;
442
+ /**
443
+ * rescue (alias `catchError`): replace an upstream ERROR with a recovered value. On source DATA →
444
+ * forward; on source ERROR → emit `recover(err)` as DATA (if `recover` throws, forward THAT as
445
+ * ERROR); on source COMPLETE → COMPLETE. After recovery the source is terminal-errored (dead) so no
446
+ * further values flow — the recovered value is the final cached value (matches the frozen pure-ts
447
+ * reference; it does NOT auto-COMPLETE, RxJS-`catchError(()=>of(x))` divergence, flagged).
448
+ */
449
+ declare function rescue<S>(recover: (err: unknown) => S): Operator<S, S>;
450
+ /** catchError: RxJS-named alias of {@link rescue}. */
451
+ declare const catchError: typeof rescue;
452
+ /** Options for {@link valve}. */
453
+ interface ValveOpts {
454
+ /**
455
+ * Optional AbortController (or a `() => AbortController | undefined` factory): on the control's
456
+ * truthy→falsy edge, `valve` calls `controller.abort()` — cancel an in-flight async boundary
457
+ * (LLM/fetch) the caller threaded `controller.signal` into. An external-resource cleanup (like
458
+ * `ctx.onDeactivation`), NOT an imperative reactive trigger (R-no-imperative).
459
+ */
460
+ abortInFlight?: AbortController | (() => AbortController | undefined);
461
+ }
462
+ /**
463
+ * valve: forward the source's DATA only while `control` (dep 1) is truthy; when closed, stay quiet
464
+ * (undirty RESOLVED). `[source, control]` declared deps + `partial:true` (the control wave can fire
465
+ * before the source ever delivers). `completeWhenDepsComplete:false` — closing the gate (control
466
+ * terminating) does NOT complete the valve; only the SOURCE's terminal (read via
467
+ * `terminalAsRealInput`) is forwarded. The `state`-verb control input is a legitimate external
468
+ * boundary (D4 / D54), not a forbidden imperative trigger.
469
+ */
470
+ declare function valve<S>(opts?: ValveOpts): Operator<S, S>;
471
+
472
+ /**
473
+ * The Graph layer (CSP-2): convenience + inspection entry (D5 / R-graph-role).
474
+ *
475
+ * g.* sugar desugars to dispatcher.register + Node and auto-registers into the graph
476
+ * inspection index (D27: sugar→ctx-fn conversion lives strictly here; the substrate node
477
+ * only ever sees `(ctx)=>void`). The Graph owns naming, describe, mount, and the D30
478
+ * value-level throw→ERROR boundary. The bare node()/dispatcher stay inspection-free
479
+ * (R-node-thin).
480
+ *
481
+ * Canonical authority: ~/src/graphrefly — D3/D5/D27/D30/D36/D37/D39, R-graph-role,
482
+ * R-describe, R-fn-contract, R-edges-derived, R-meta-presentation.
483
+ */
484
+
485
+ /** Map a tuple of Nodes to the tuple of their value types (typed value-level fn args). */
486
+ type DepValues<D extends readonly Node<unknown>[]> = {
487
+ [K in keyof D]: D[K] extends Node<infer V> ? V : never;
488
+ };
489
+ /** Value-level derived fn: receives dep values, returns the next value (undefined = no emit). */
490
+ type DerivedFn<D extends readonly Node<unknown>[], T> = (...values: DepValues<D>) => T | undefined;
491
+ /** Value-level effect fn: receives dep values, optionally returns a deactivation cleanup. */
492
+ type EffectFn<D extends readonly Node<unknown>[]> = (...values: DepValues<D>) => void | (() => void);
493
+ /** Sugar options — node options minus graph-owned dispatcher plus naming/meta. */
494
+ interface SugarOpts<T = unknown> extends Omit<NodeOptions<T>, "dispatcher"> {
495
+ name?: string;
496
+ meta?: Record<string, unknown>;
497
+ /**
498
+ * D95: explicit restorable factory metadata. Static JSON-compatible config may live here;
499
+ * reactive options must remain graph deps. Without this, function-backed nodes are local-only.
500
+ */
501
+ restore?: {
502
+ ref: string;
503
+ config?: unknown;
504
+ configVersion?: unknown;
505
+ };
506
+ }
507
+ interface GraphOptions {
508
+ name?: string;
509
+ /** Bind to a dispatcher (default = process-global, D26). */
510
+ dispatcher?: Dispatcher;
511
+ /** D109 default node runtime versioning policy for graph-owned nodes. Default is nodev0. */
512
+ versioning?: NodeVersioningPolicy;
513
+ /** Graph-owned environment drivers for source/adapter boundaries (D130/D131). */
514
+ environment?: EnvironmentDrivers;
515
+ /**
516
+ * Turn on the dispatcher profile recorder (D39 / F-PERF default off). NOTE: this
517
+ * switches recording on for the WHOLE bound dispatcher (the default is process-global,
518
+ * D26) — every graph sharing it then pays the recorder cost. For isolated profiling
519
+ * use a dedicated dispatcher: `graph({ dispatcher: new Dispatcher(), profile: true })`.
520
+ */
521
+ profile?: boolean;
522
+ }
523
+ /**
524
+ * A state node (L4-Q1): a manual source whose `.set(v)` is `node.down([[DATA, v]])` sugar.
525
+ * Extends the substrate Node so it is usable as a dep AND carries the graph-layer `.set`.
526
+ */
527
+ declare class StateNode<T> extends Node<T> {
528
+ set(v: T): void;
529
+ }
530
+ interface TopologyGroupOptions {
531
+ /** Optional inspection/release reason label for this graph-owned topology group. */
532
+ name?: string;
533
+ }
534
+ interface TopologyGroupReleaseOptions {
535
+ /** Optional diagnostic reason. No protocol/control messages are synthesized. */
536
+ reason?: string;
537
+ }
538
+ /**
539
+ * Graph-owned D152 release group: a label over ordinary graph-registered nodes.
540
+ * The graph registry remains the source of truth; helper-local membership is only
541
+ * a memo for atomic quiescent release.
542
+ */
543
+ interface TopologyGroup {
544
+ readonly name?: string;
545
+ readonly released: boolean;
546
+ add<T extends Node<unknown>>(node: T): T;
547
+ node<T = unknown>(deps?: readonly Node<unknown>[], fn?: NodeFn | null, opts?: SugarOpts<T>): Node<T>;
548
+ state<T>(initial: T, opts?: SugarOpts<T>): StateNode<T>;
549
+ producer<T = unknown>(fn: NodeFn, opts?: SugarOpts<T>): Node<T>;
550
+ derived<const D extends readonly Node<unknown>[], T>(deps: D, fn: DerivedFn<D, T>, opts?: SugarOpts<T>): Node<T>;
551
+ effect<const D extends readonly Node<unknown>[]>(deps: D, fn: EffectFn<D>, opts?: SugarOpts<void>): Node<void>;
552
+ initNode<TIn, TOut>(op: Operator<TIn, TOut>, deps: readonly Node<TIn>[], opts?: SugarOpts<TOut>): Node<TOut>;
553
+ release(opts?: TopologyGroupReleaseOptions): void;
554
+ }
555
+ declare class Graph {
556
+ readonly name?: string;
557
+ private readonly _dispatcher;
558
+ private readonly _versioning;
559
+ private readonly _environment;
560
+ private readonly _core;
561
+ private readonly _entries;
562
+ private readonly _byId;
563
+ private readonly _retiredIds;
564
+ private readonly _mounts;
565
+ private _seq;
566
+ private _clock;
567
+ private _topologyObserverSeq;
568
+ private readonly _topologyObservers;
569
+ private _topologyDelivering;
570
+ private readonly _topologyQueue;
571
+ private _synthSeq;
572
+ private readonly _synthIds;
573
+ constructor(opts?: GraphOptions);
574
+ private _add;
575
+ private _addWithId;
576
+ private _assertDepsLocal;
577
+ private _assertRegisteredNode;
578
+ private _nodeOpts;
579
+ private _construct;
580
+ /** Look up a registered node by its id. */
581
+ find(id: string): Node<unknown> | undefined;
582
+ private _releaseNodes;
583
+ /** ctx-level power surface: a raw `(ctx)=>void` fn (or a passthrough/state when null). */
584
+ node<T = unknown>(deps?: readonly Node<unknown>[], fn?: NodeFn | null, opts?: SugarOpts<T>): Node<T>;
585
+ /** A manual source with `.set(v)` (L4-Q1). */
586
+ state<T>(initial: T, opts?: SugarOpts<T>): StateNode<T>;
587
+ /** ctx-level depless source; its fn runs on activation (R-rom-ram). */
588
+ producer<T = unknown>(fn: NodeFn, opts?: SugarOpts<T>): Node<T>;
589
+ /** value-level pure transform: deps → value (D27 wrapped; D30 throw→ERROR). */
590
+ derived<const D extends readonly Node<unknown>[], T>(deps: D, fn: DerivedFn<D, T>, opts?: SugarOpts<T>): Node<T>;
591
+ /** value-level sink: deps → effect; return value (a fn) becomes onDeactivation (D28). */
592
+ effect<const D extends readonly Node<unknown>[]>(deps: D, fn: EffectFn<D>, opts?: SugarOpts<void>): Node<void>;
593
+ /** Declarative batch (D12): one wave, success→commit / throw→rollback. */
594
+ batch<T>(fn: (bctx: BatchCtx) => T): T;
595
+ /** Embed a child graph addressable under `at` (R-mount; mount has no deps). */
596
+ mount(child: Graph, opts: {
597
+ at: string;
598
+ }): void;
599
+ /**
600
+ * Instantiate an operator (or source) factory as a registered graph node. `deps` are
601
+ * type-checked against the operator's input element type; the output type flows from the
602
+ * operator. A source is a depless operator — pass `[]`. Caller `opts` (name/meta/behavioral
603
+ * overrides) win over the operator's baked-in `opts`.
604
+ */
605
+ initNode<TIn, TOut>(op: Operator<TIn, TOut>, deps: readonly Node<TIn>[], opts?: SugarOpts<TOut>): Node<TOut>;
606
+ /**
607
+ * Graph-owned activation root for internal helper nodes. This is the sanctioned keepalive shape:
608
+ * a graph, not a helper closure, owns the subscription and returns the release handle.
609
+ */
610
+ retain<T>(node: Node<T>, opts?: {
611
+ reason?: string;
612
+ }): () => void;
613
+ /**
614
+ * D152 graph-owned topology/release group. Members are ordinary registered graph nodes;
615
+ * release is quiescent-only and removes ids atomically without synthesizing protocol messages.
616
+ */
617
+ topologyGroup(opts?: TopologyGroupOptions): TopologyGroup;
618
+ /** Live point-in-time structure snapshot (R-describe / D39 / D51). `_prefix` carries the mount path. */
619
+ describe(opts?: DescribeOpts, _prefix?: string): DescribeSnapshot;
620
+ /**
621
+ * D173 pure-structure topology snapshot over the same live truth source as describe().
622
+ * Runtime status/value/version remain on describe(); blueprint metadata is a later envelope.
623
+ */
624
+ topology(): GraphTopologySnapshot;
625
+ /**
626
+ * D177 synchronous audit/collaboration envelope over the pure topology snapshot.
627
+ * Hashing and environment provenance enrichment stay in pure helpers outside Graph core.
628
+ */
629
+ blueprint(opts?: GraphBlueprintOptions): GraphBlueprint;
630
+ private _observeTargets;
631
+ /**
632
+ * observe(path?) = read-only enveloped EGRESS (R-observe / D39). NOT a graph node — it
633
+ * taps the target node(s) via subscribe and forwards each Message as an ObserveEvent.
634
+ * No path = whole graph; an exact id = a single node; otherwise a `::`-prefix subtree.
635
+ */
636
+ observe(path?: string): ObserveStream;
637
+ /**
638
+ * D145 observeTopology(path?) = read-only graph lifecycle egress over the existing
639
+ * graph registry. It is not a graph node, does not subscribe to nodes, and emits no DATA.
640
+ */
641
+ observeTopology(path?: string): TopologyStream;
642
+ private _idForTopologyNode;
643
+ private _topologyDeps;
644
+ private _emitTopologyNodeRegistered;
645
+ private _emitTopologyDepsChanged;
646
+ private _emitTopologyNodeReleased;
647
+ private _emitTopologyMountChanged;
648
+ private _ensureMountedTopologyForwarders;
649
+ private _releaseMountedTopologyForwarders;
650
+ private _emitMountedTopologyEvent;
651
+ private _emitTopologyEvent;
652
+ /**
653
+ * profile() = accumulated-counter snapshot (R-profile / D39). invokes + duration are
654
+ * dispatcher-backed (the invoke funnel, F-DISPATCH-ALL) — counters never live on the
655
+ * thin node (R-node-thin). Requires `graph({ profile: true })` (opt-in, F-PERF).
656
+ */
657
+ profile(): Profile;
658
+ /** Versioned graph lifecycle checkpoint (R-snapshot / D83 / D90). Pure capture, no storage I/O. */
659
+ checkpoint(): GraphCheckpoint;
660
+ private _checkpoint;
661
+ private _checkpointNode;
662
+ }
663
+ /** Construct a Graph (default global dispatcher; L4-Q4). */
664
+ declare function graph(opts?: GraphOptions): Graph;
665
+
666
+ export { type ValveOpts as $, type GraphRestoreDescriptorContext as A, type GraphRestoreEntry as B, type GraphRestoreRegistry as C, type DefineOpts as D, type EffectFn as E, type NormalizedGraphTopologyNode as F, GRAPH_BLUEPRINT_VERSION as G, type NormalizedGraphTopologySnapshot as H, type ObserveEventEquals as I, type ObservePredicate as J, type ObserveStream as K, type Operator as L, type RestoreRegistryEntry as M, type NodeProfile as N, type ObserveEvent as O, type Profile as P, StateNode as Q, type RestoreGraphOptions as R, type SettleOpts as S, type SugarOpts as T, type TapObserver as U, type TopologyEvent as V, type TopologyEventKind as W, type TopologyGroup as X, type TopologyGroupOptions as Y, type TopologyGroupReleaseOptions as Z, type TopologyStream as _, type Definition as a, canonicalTopologyBytes as a0, canonicalTopologyJson as a1, catchError as a2, coalesceObserve as a3, defaultRestoreRegistry as a4, define as a5, distinctUntilChanged as a6, elementAt as a7, filter as a8, filterObserve as a9, valve as aA, withBlueprintHash as aB, withBlueprintProvenance as aC, find as aa, first as ab, graph as ac, graphBlueprintDiagnostics as ad, initNode as ae, last as af, map as ag, mapRestoreDescriptor as ah, merge as ai, normalizeTopology as aj, onFirstData as ak, pairwise as al, reduce as am, rescue as an, restoreGraph as ao, restoreRegistry as ap, scan as aq, settle as ar, skip as as, stateRestoreDescriptor as at, take as au, takeRestoreDescriptor as av, takeWhile as aw, tap as ax, tapFirst as ay, timerRestoreDescriptor as az, type DerivedFn as b, GRAPH_CHECKPOINT_VERSION as c, Graph as d, type GraphBlueprint as e, type GraphBlueprintDiagnosticCode as f, type GraphBlueprintDiagnosticIssue as g, type GraphBlueprintDiagnostics as h, type GraphBlueprintHash as i, type GraphBlueprintHashInput as j, type GraphBlueprintHashOptions as k, type GraphBlueprintJson as l, type GraphBlueprintOptions as m, type GraphBlueprintProvenance as n, type GraphCheckpoint as o, type GraphCheckpointEdge as p, type GraphCheckpointFactory as q, type GraphCheckpointJson as r, type GraphCheckpointMount as s, type GraphCheckpointNode as t, type GraphCheckpointTerminal as u, type GraphCheckpointValue as v, type GraphCheckpointVersion as w, type GraphOptions as x, type GraphRestoreDefinition as y, type GraphRestoreDescriptor as z };