@graphrefly/graphrefly 0.16.0 → 0.17.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 (47) hide show
  1. package/dist/{chunk-RLVFZDCE.js → chunk-2PORF4RP.js} +3 -3
  2. package/dist/{chunk-YX263TXI.js → chunk-646OG3PO.js} +2 -2
  3. package/dist/{chunk-VZY2B2LU.js → chunk-BV3TPSBK.js} +1 -2
  4. package/dist/chunk-BV3TPSBK.js.map +1 -0
  5. package/dist/chunk-EBNKJULL.js +231 -0
  6. package/dist/chunk-EBNKJULL.js.map +1 -0
  7. package/dist/{chunk-ITDVOCFO.js → chunk-F2ULI3Q3.js} +2 -2
  8. package/dist/{chunk-3BLRREFM.js → chunk-IHJHBADD.js} +3 -3
  9. package/dist/{chunk-LKP7IWRV.js → chunk-R6OHUUYB.js} +3 -3
  10. package/dist/{chunk-26A4E7J7.js → chunk-XJ6EMQ22.js} +4 -4
  11. package/dist/{chunk-RZSQ7P2C.js → chunk-YXROQFXZ.js} +3 -3
  12. package/dist/compat/nestjs/index.cjs +0 -1
  13. package/dist/compat/nestjs/index.cjs.map +1 -1
  14. package/dist/compat/nestjs/index.js +7 -7
  15. package/dist/core/index.cjs +0 -1
  16. package/dist/core/index.cjs.map +1 -1
  17. package/dist/core/index.js +3 -3
  18. package/dist/extra/index.cjs +0 -1
  19. package/dist/extra/index.cjs.map +1 -1
  20. package/dist/extra/index.js +3 -3
  21. package/dist/graph/index.cjs +125 -3
  22. package/dist/graph/index.cjs.map +1 -1
  23. package/dist/graph/index.d.cts +1 -1
  24. package/dist/graph/index.d.ts +1 -1
  25. package/dist/graph/index.js +10 -6
  26. package/dist/{index-Db27z6Ki.d.cts → index-4OIX-q0C.d.cts} +88 -3
  27. package/dist/{index-BR19vQME.d.ts → index-D7y9Q8W4.d.ts} +88 -3
  28. package/dist/index.cjs +193 -45
  29. package/dist/index.cjs.map +1 -1
  30. package/dist/index.d.cts +51 -8
  31. package/dist/index.d.ts +51 -8
  32. package/dist/index.js +85 -57
  33. package/dist/index.js.map +1 -1
  34. package/dist/patterns/reactive-layout/index.cjs +0 -1
  35. package/dist/patterns/reactive-layout/index.cjs.map +1 -1
  36. package/dist/patterns/reactive-layout/index.js +4 -4
  37. package/package.json +1 -1
  38. package/dist/chunk-SHRJH2DN.js +0 -107
  39. package/dist/chunk-SHRJH2DN.js.map +0 -1
  40. package/dist/chunk-VZY2B2LU.js.map +0 -1
  41. /package/dist/{chunk-RLVFZDCE.js.map → chunk-2PORF4RP.js.map} +0 -0
  42. /package/dist/{chunk-YX263TXI.js.map → chunk-646OG3PO.js.map} +0 -0
  43. /package/dist/{chunk-ITDVOCFO.js.map → chunk-F2ULI3Q3.js.map} +0 -0
  44. /package/dist/{chunk-3BLRREFM.js.map → chunk-IHJHBADD.js.map} +0 -0
  45. /package/dist/{chunk-LKP7IWRV.js.map → chunk-R6OHUUYB.js.map} +0 -0
  46. /package/dist/{chunk-26A4E7J7.js.map → chunk-XJ6EMQ22.js.map} +0 -0
  47. /package/dist/{chunk-RZSQ7P2C.js.map → chunk-YXROQFXZ.js.map} +0 -0
@@ -1,3 +1,3 @@
1
- export { D as DeltaCheckpoint, E as EvictedSubgraphInfo, a as EvictionPolicy, G as GraphCodec, J as JsonCodec, L as LazyGraphCodec, W as WALEntry, c as createDagCborCodec, b as createDagCborZstdCodec, n as negotiateCodec, r as replayWAL } from '../index-Db27z6Ki.cjs';
1
+ export { D as DeltaCheckpoint, E as EvictedSubgraphInfo, b as EvictionPolicy, c as GraphCodec, a as GraphProfileOptions, G as GraphProfileResult, J as JsonCodec, L as LazyGraphCodec, N as NodeProfile, W as WALEntry, d as createDagCborCodec, e as createDagCborZstdCodec, g as graphProfile, n as negotiateCodec, r as replayWAL, s as sizeof } from '../index-4OIX-q0C.cjs';
2
2
  export { A as AutoCheckpointAdapter, D as DescribeFilter, d as GRAPH_META_SEGMENT, G as Graph, e as GraphActorOptions, b as GraphAutoCheckpointHandle, c as GraphAutoCheckpointOptions, f as GraphCheckpointRecord, g as GraphDescribeOptions, h as GraphDescribeOutput, i as GraphDiagramDirection, j as GraphDiagramOptions, k as GraphDiffChange, l as GraphDiffResult, m as GraphDumpOptions, n as GraphFactoryContext, o as GraphNodeFactory, p as GraphObserveAll, q as GraphObserveOne, a as GraphOptions, r as GraphPersistSnapshot, s as GraphSpyHandle, t as GraphSpyOptions, u as GraphSpyTheme, v as GraphSpyThemeName, O as ObserveDetail, w as ObserveEvent, x as ObserveOptions, y as ObserveResult, R as ReachableDirection, z as ReachableOptions, T as TraceEntry, B as reachable } from '../graph-fCsaaVIa.cjs';
3
3
  import '../meta-BV4pj9ML.cjs';
@@ -1,3 +1,3 @@
1
- export { D as DeltaCheckpoint, E as EvictedSubgraphInfo, a as EvictionPolicy, G as GraphCodec, J as JsonCodec, L as LazyGraphCodec, W as WALEntry, c as createDagCborCodec, b as createDagCborZstdCodec, n as negotiateCodec, r as replayWAL } from '../index-BR19vQME.js';
1
+ export { D as DeltaCheckpoint, E as EvictedSubgraphInfo, b as EvictionPolicy, c as GraphCodec, a as GraphProfileOptions, G as GraphProfileResult, J as JsonCodec, L as LazyGraphCodec, N as NodeProfile, W as WALEntry, d as createDagCborCodec, e as createDagCborZstdCodec, g as graphProfile, n as negotiateCodec, r as replayWAL, s as sizeof } from '../index-D7y9Q8W4.js';
2
2
  export { A as AutoCheckpointAdapter, D as DescribeFilter, d as GRAPH_META_SEGMENT, G as Graph, e as GraphActorOptions, b as GraphAutoCheckpointHandle, c as GraphAutoCheckpointOptions, f as GraphCheckpointRecord, g as GraphDescribeOptions, h as GraphDescribeOutput, i as GraphDiagramDirection, j as GraphDiagramOptions, k as GraphDiffChange, l as GraphDiffResult, m as GraphDumpOptions, n as GraphFactoryContext, o as GraphNodeFactory, p as GraphObserveAll, q as GraphObserveOne, a as GraphOptions, r as GraphPersistSnapshot, s as GraphSpyHandle, t as GraphSpyOptions, u as GraphSpyTheme, v as GraphSpyThemeName, O as ObserveDetail, w as ObserveEvent, x as ObserveOptions, y as ObserveResult, R as ReachableDirection, z as ReachableOptions, T as TraceEntry, B as reachable } from '../graph-Dc-P9BVm.js';
3
3
  import '../meta-BV4pj9ML.js';
@@ -2,24 +2,28 @@ import {
2
2
  JsonCodec,
3
3
  createDagCborCodec,
4
4
  createDagCborZstdCodec,
5
+ graphProfile,
5
6
  negotiateCodec,
6
- replayWAL
7
- } from "../chunk-SHRJH2DN.js";
7
+ replayWAL,
8
+ sizeof
9
+ } from "../chunk-EBNKJULL.js";
8
10
  import {
9
11
  GRAPH_META_SEGMENT,
10
12
  Graph,
11
13
  reachable
12
- } from "../chunk-3BLRREFM.js";
13
- import "../chunk-ITDVOCFO.js";
14
- import "../chunk-VZY2B2LU.js";
14
+ } from "../chunk-IHJHBADD.js";
15
+ import "../chunk-F2ULI3Q3.js";
16
+ import "../chunk-BV3TPSBK.js";
15
17
  export {
16
18
  GRAPH_META_SEGMENT,
17
19
  Graph,
18
20
  JsonCodec,
19
21
  createDagCborCodec,
20
22
  createDagCborZstdCodec,
23
+ graphProfile,
21
24
  negotiateCodec,
22
25
  reachable,
23
- replayWAL
26
+ replayWAL,
27
+ sizeof
24
28
  };
25
29
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import { r as GraphPersistSnapshot, A as AutoCheckpointAdapter, D as DescribeFilter, d as GRAPH_META_SEGMENT, G as Graph, e as GraphActorOptions, b as GraphAutoCheckpointHandle, c as GraphAutoCheckpointOptions, f as GraphCheckpointRecord, g as GraphDescribeOptions, h as GraphDescribeOutput, i as GraphDiagramDirection, j as GraphDiagramOptions, k as GraphDiffChange, l as GraphDiffResult, m as GraphDumpOptions, n as GraphFactoryContext, o as GraphNodeFactory, p as GraphObserveAll, q as GraphObserveOne, a as GraphOptions, s as GraphSpyHandle, t as GraphSpyOptions, u as GraphSpyTheme, v as GraphSpyThemeName, O as ObserveDetail, w as ObserveEvent, x as ObserveOptions, y as ObserveResult, R as ReachableDirection, z as ReachableOptions, T as TraceEntry, B as reachable } from './graph-fCsaaVIa.cjs';
1
+ import { r as GraphPersistSnapshot, G as Graph, A as AutoCheckpointAdapter, D as DescribeFilter, d as GRAPH_META_SEGMENT, e as GraphActorOptions, b as GraphAutoCheckpointHandle, c as GraphAutoCheckpointOptions, f as GraphCheckpointRecord, g as GraphDescribeOptions, h as GraphDescribeOutput, i as GraphDiagramDirection, j as GraphDiagramOptions, k as GraphDiffChange, l as GraphDiffResult, m as GraphDumpOptions, n as GraphFactoryContext, o as GraphNodeFactory, p as GraphObserveAll, q as GraphObserveOne, a as GraphOptions, s as GraphSpyHandle, t as GraphSpyOptions, u as GraphSpyTheme, v as GraphSpyThemeName, O as ObserveDetail, w as ObserveEvent, x as ObserveOptions, y as ObserveResult, R as ReachableDirection, z as ReachableOptions, T as TraceEntry, B as reachable } from './graph-fCsaaVIa.cjs';
2
2
 
3
3
  /**
4
4
  * GraphCodec — pluggable serialization for graph snapshots (Phase 8.6).
@@ -178,6 +178,86 @@ declare function negotiateCodec(localPreference: readonly GraphCodec[], remoteCo
178
178
  */
179
179
  declare function replayWAL(entries: readonly WALEntry[]): GraphPersistSnapshot;
180
180
 
181
+ /**
182
+ * Graph profiling and inspection utilities.
183
+ *
184
+ * Provides per-node memory estimation, connectivity stats, and hotspot
185
+ * detection. Non-invasive — reads from `describe()` and node internals
186
+ * without modifying state.
187
+ *
188
+ * @module
189
+ */
190
+
191
+ /** Per-node profile entry. */
192
+ interface NodeProfile {
193
+ /** Qualified path within the graph. */
194
+ path: string;
195
+ /** Node type (state, derived, producer, effect). */
196
+ type: string;
197
+ /** Node status (disconnected, dirty, settled, errored, completed). */
198
+ status: string;
199
+ /** Approximate retained bytes for the node's cached value. */
200
+ valueSizeBytes: number;
201
+ /** Number of downstream subscribers (sinks). */
202
+ subscriberCount: number;
203
+ /** Number of upstream dependencies. */
204
+ depCount: number;
205
+ }
206
+ /** Aggregate graph profile. */
207
+ interface GraphProfileResult {
208
+ /** Total node count. */
209
+ nodeCount: number;
210
+ /** Total edge count. */
211
+ edgeCount: number;
212
+ /** Subgraph count. */
213
+ subgraphCount: number;
214
+ /** All node profiles. */
215
+ nodes: NodeProfile[];
216
+ /** Total approximate value memory across all nodes. */
217
+ totalValueSizeBytes: number;
218
+ /** Nodes sorted by valueSizeBytes descending (top N). */
219
+ hotspots: NodeProfile[];
220
+ }
221
+ /** Options for {@link graphProfile}. */
222
+ interface GraphProfileOptions {
223
+ /** Limit hotspot list (default 10). */
224
+ topN?: number;
225
+ /** Include subgraph nodes recursively (default true). */
226
+ recursive?: boolean;
227
+ }
228
+ /**
229
+ * Profile a graph's memory and connectivity characteristics.
230
+ *
231
+ * Uses `describe({ detail: "standard" })` for node metadata and direct
232
+ * `NodeImpl` access for subscriber counts and cached values.
233
+ *
234
+ * @param graph - The graph to profile.
235
+ * @param opts - Optional configuration.
236
+ * @returns Aggregate profile with per-node details and hotspots.
237
+ */
238
+ declare function graphProfile(graph: Graph, opts?: GraphProfileOptions): GraphProfileResult;
239
+
240
+ /**
241
+ * Approximate in-memory size estimation for arbitrary JS values.
242
+ *
243
+ * Uses a recursive walk with cycle detection. Not exact — provides a
244
+ * reasonable approximation for profiling and hotspot detection.
245
+ *
246
+ * @module
247
+ * @internal
248
+ */
249
+ /**
250
+ * Estimate the approximate retained memory (in bytes) of a JS value.
251
+ *
252
+ * Handles primitives, plain objects, arrays, Maps, Sets, and nested
253
+ * combinations. Uses a `WeakSet` for cycle detection — cyclic refs
254
+ * are counted once.
255
+ *
256
+ * @param value - The value to measure.
257
+ * @returns Approximate size in bytes.
258
+ */
259
+ declare function sizeof(value: unknown): number;
260
+
181
261
  /**
182
262
  * Graph container: registry, wiring, introspection (Phase 1).
183
263
  */
@@ -207,12 +287,15 @@ declare const index_GraphObserveAll: typeof GraphObserveAll;
207
287
  declare const index_GraphObserveOne: typeof GraphObserveOne;
208
288
  declare const index_GraphOptions: typeof GraphOptions;
209
289
  declare const index_GraphPersistSnapshot: typeof GraphPersistSnapshot;
290
+ type index_GraphProfileOptions = GraphProfileOptions;
291
+ type index_GraphProfileResult = GraphProfileResult;
210
292
  declare const index_GraphSpyHandle: typeof GraphSpyHandle;
211
293
  declare const index_GraphSpyOptions: typeof GraphSpyOptions;
212
294
  declare const index_GraphSpyTheme: typeof GraphSpyTheme;
213
295
  declare const index_GraphSpyThemeName: typeof GraphSpyThemeName;
214
296
  declare const index_JsonCodec: typeof JsonCodec;
215
297
  type index_LazyGraphCodec = LazyGraphCodec;
298
+ type index_NodeProfile = NodeProfile;
216
299
  declare const index_ObserveDetail: typeof ObserveDetail;
217
300
  declare const index_ObserveEvent: typeof ObserveEvent;
218
301
  declare const index_ObserveOptions: typeof ObserveOptions;
@@ -223,11 +306,13 @@ declare const index_TraceEntry: typeof TraceEntry;
223
306
  type index_WALEntry = WALEntry;
224
307
  declare const index_createDagCborCodec: typeof createDagCborCodec;
225
308
  declare const index_createDagCborZstdCodec: typeof createDagCborZstdCodec;
309
+ declare const index_graphProfile: typeof graphProfile;
226
310
  declare const index_negotiateCodec: typeof negotiateCodec;
227
311
  declare const index_reachable: typeof reachable;
228
312
  declare const index_replayWAL: typeof replayWAL;
313
+ declare const index_sizeof: typeof sizeof;
229
314
  declare namespace index {
230
- export { index_AutoCheckpointAdapter as AutoCheckpointAdapter, type index_DeltaCheckpoint as DeltaCheckpoint, index_DescribeFilter as DescribeFilter, type index_EvictedSubgraphInfo as EvictedSubgraphInfo, type index_EvictionPolicy as EvictionPolicy, index_GRAPH_META_SEGMENT as GRAPH_META_SEGMENT, index_Graph as Graph, index_GraphActorOptions as GraphActorOptions, index_GraphAutoCheckpointHandle as GraphAutoCheckpointHandle, index_GraphAutoCheckpointOptions as GraphAutoCheckpointOptions, index_GraphCheckpointRecord as GraphCheckpointRecord, type index_GraphCodec as GraphCodec, index_GraphDescribeOptions as GraphDescribeOptions, index_GraphDescribeOutput as GraphDescribeOutput, index_GraphDiagramDirection as GraphDiagramDirection, index_GraphDiagramOptions as GraphDiagramOptions, index_GraphDiffChange as GraphDiffChange, index_GraphDiffResult as GraphDiffResult, index_GraphDumpOptions as GraphDumpOptions, index_GraphFactoryContext as GraphFactoryContext, index_GraphNodeFactory as GraphNodeFactory, index_GraphObserveAll as GraphObserveAll, index_GraphObserveOne as GraphObserveOne, index_GraphOptions as GraphOptions, index_GraphPersistSnapshot as GraphPersistSnapshot, index_GraphSpyHandle as GraphSpyHandle, index_GraphSpyOptions as GraphSpyOptions, index_GraphSpyTheme as GraphSpyTheme, index_GraphSpyThemeName as GraphSpyThemeName, index_JsonCodec as JsonCodec, type index_LazyGraphCodec as LazyGraphCodec, index_ObserveDetail as ObserveDetail, index_ObserveEvent as ObserveEvent, index_ObserveOptions as ObserveOptions, index_ObserveResult as ObserveResult, index_ReachableDirection as ReachableDirection, index_ReachableOptions as ReachableOptions, index_TraceEntry as TraceEntry, type index_WALEntry as WALEntry, index_createDagCborCodec as createDagCborCodec, index_createDagCborZstdCodec as createDagCborZstdCodec, index_negotiateCodec as negotiateCodec, index_reachable as reachable, index_replayWAL as replayWAL };
315
+ export { index_AutoCheckpointAdapter as AutoCheckpointAdapter, type index_DeltaCheckpoint as DeltaCheckpoint, index_DescribeFilter as DescribeFilter, type index_EvictedSubgraphInfo as EvictedSubgraphInfo, type index_EvictionPolicy as EvictionPolicy, index_GRAPH_META_SEGMENT as GRAPH_META_SEGMENT, index_Graph as Graph, index_GraphActorOptions as GraphActorOptions, index_GraphAutoCheckpointHandle as GraphAutoCheckpointHandle, index_GraphAutoCheckpointOptions as GraphAutoCheckpointOptions, index_GraphCheckpointRecord as GraphCheckpointRecord, type index_GraphCodec as GraphCodec, index_GraphDescribeOptions as GraphDescribeOptions, index_GraphDescribeOutput as GraphDescribeOutput, index_GraphDiagramDirection as GraphDiagramDirection, index_GraphDiagramOptions as GraphDiagramOptions, index_GraphDiffChange as GraphDiffChange, index_GraphDiffResult as GraphDiffResult, index_GraphDumpOptions as GraphDumpOptions, index_GraphFactoryContext as GraphFactoryContext, index_GraphNodeFactory as GraphNodeFactory, index_GraphObserveAll as GraphObserveAll, index_GraphObserveOne as GraphObserveOne, index_GraphOptions as GraphOptions, index_GraphPersistSnapshot as GraphPersistSnapshot, type index_GraphProfileOptions as GraphProfileOptions, type index_GraphProfileResult as GraphProfileResult, index_GraphSpyHandle as GraphSpyHandle, index_GraphSpyOptions as GraphSpyOptions, index_GraphSpyTheme as GraphSpyTheme, index_GraphSpyThemeName as GraphSpyThemeName, index_JsonCodec as JsonCodec, type index_LazyGraphCodec as LazyGraphCodec, type index_NodeProfile as NodeProfile, index_ObserveDetail as ObserveDetail, index_ObserveEvent as ObserveEvent, index_ObserveOptions as ObserveOptions, index_ObserveResult as ObserveResult, index_ReachableDirection as ReachableDirection, index_ReachableOptions as ReachableOptions, index_TraceEntry as TraceEntry, type index_WALEntry as WALEntry, index_createDagCborCodec as createDagCborCodec, index_createDagCborZstdCodec as createDagCborZstdCodec, index_graphProfile as graphProfile, index_negotiateCodec as negotiateCodec, index_reachable as reachable, index_replayWAL as replayWAL, index_sizeof as sizeof };
231
316
  }
232
317
 
233
- export { type DeltaCheckpoint as D, type EvictedSubgraphInfo as E, type GraphCodec as G, JsonCodec as J, type LazyGraphCodec as L, type WALEntry as W, type EvictionPolicy as a, createDagCborZstdCodec as b, createDagCborCodec as c, index as i, negotiateCodec as n, replayWAL as r };
318
+ export { type DeltaCheckpoint as D, type EvictedSubgraphInfo as E, type GraphProfileResult as G, JsonCodec as J, type LazyGraphCodec as L, type NodeProfile as N, type WALEntry as W, type GraphProfileOptions as a, type EvictionPolicy as b, type GraphCodec as c, createDagCborCodec as d, createDagCborZstdCodec as e, graphProfile as g, index as i, negotiateCodec as n, replayWAL as r, sizeof as s };
@@ -1,4 +1,4 @@
1
- import { r as GraphPersistSnapshot, A as AutoCheckpointAdapter, D as DescribeFilter, d as GRAPH_META_SEGMENT, G as Graph, e as GraphActorOptions, b as GraphAutoCheckpointHandle, c as GraphAutoCheckpointOptions, f as GraphCheckpointRecord, g as GraphDescribeOptions, h as GraphDescribeOutput, i as GraphDiagramDirection, j as GraphDiagramOptions, k as GraphDiffChange, l as GraphDiffResult, m as GraphDumpOptions, n as GraphFactoryContext, o as GraphNodeFactory, p as GraphObserveAll, q as GraphObserveOne, a as GraphOptions, s as GraphSpyHandle, t as GraphSpyOptions, u as GraphSpyTheme, v as GraphSpyThemeName, O as ObserveDetail, w as ObserveEvent, x as ObserveOptions, y as ObserveResult, R as ReachableDirection, z as ReachableOptions, T as TraceEntry, B as reachable } from './graph-Dc-P9BVm.js';
1
+ import { r as GraphPersistSnapshot, G as Graph, A as AutoCheckpointAdapter, D as DescribeFilter, d as GRAPH_META_SEGMENT, e as GraphActorOptions, b as GraphAutoCheckpointHandle, c as GraphAutoCheckpointOptions, f as GraphCheckpointRecord, g as GraphDescribeOptions, h as GraphDescribeOutput, i as GraphDiagramDirection, j as GraphDiagramOptions, k as GraphDiffChange, l as GraphDiffResult, m as GraphDumpOptions, n as GraphFactoryContext, o as GraphNodeFactory, p as GraphObserveAll, q as GraphObserveOne, a as GraphOptions, s as GraphSpyHandle, t as GraphSpyOptions, u as GraphSpyTheme, v as GraphSpyThemeName, O as ObserveDetail, w as ObserveEvent, x as ObserveOptions, y as ObserveResult, R as ReachableDirection, z as ReachableOptions, T as TraceEntry, B as reachable } from './graph-Dc-P9BVm.js';
2
2
 
3
3
  /**
4
4
  * GraphCodec — pluggable serialization for graph snapshots (Phase 8.6).
@@ -178,6 +178,86 @@ declare function negotiateCodec(localPreference: readonly GraphCodec[], remoteCo
178
178
  */
179
179
  declare function replayWAL(entries: readonly WALEntry[]): GraphPersistSnapshot;
180
180
 
181
+ /**
182
+ * Graph profiling and inspection utilities.
183
+ *
184
+ * Provides per-node memory estimation, connectivity stats, and hotspot
185
+ * detection. Non-invasive — reads from `describe()` and node internals
186
+ * without modifying state.
187
+ *
188
+ * @module
189
+ */
190
+
191
+ /** Per-node profile entry. */
192
+ interface NodeProfile {
193
+ /** Qualified path within the graph. */
194
+ path: string;
195
+ /** Node type (state, derived, producer, effect). */
196
+ type: string;
197
+ /** Node status (disconnected, dirty, settled, errored, completed). */
198
+ status: string;
199
+ /** Approximate retained bytes for the node's cached value. */
200
+ valueSizeBytes: number;
201
+ /** Number of downstream subscribers (sinks). */
202
+ subscriberCount: number;
203
+ /** Number of upstream dependencies. */
204
+ depCount: number;
205
+ }
206
+ /** Aggregate graph profile. */
207
+ interface GraphProfileResult {
208
+ /** Total node count. */
209
+ nodeCount: number;
210
+ /** Total edge count. */
211
+ edgeCount: number;
212
+ /** Subgraph count. */
213
+ subgraphCount: number;
214
+ /** All node profiles. */
215
+ nodes: NodeProfile[];
216
+ /** Total approximate value memory across all nodes. */
217
+ totalValueSizeBytes: number;
218
+ /** Nodes sorted by valueSizeBytes descending (top N). */
219
+ hotspots: NodeProfile[];
220
+ }
221
+ /** Options for {@link graphProfile}. */
222
+ interface GraphProfileOptions {
223
+ /** Limit hotspot list (default 10). */
224
+ topN?: number;
225
+ /** Include subgraph nodes recursively (default true). */
226
+ recursive?: boolean;
227
+ }
228
+ /**
229
+ * Profile a graph's memory and connectivity characteristics.
230
+ *
231
+ * Uses `describe({ detail: "standard" })` for node metadata and direct
232
+ * `NodeImpl` access for subscriber counts and cached values.
233
+ *
234
+ * @param graph - The graph to profile.
235
+ * @param opts - Optional configuration.
236
+ * @returns Aggregate profile with per-node details and hotspots.
237
+ */
238
+ declare function graphProfile(graph: Graph, opts?: GraphProfileOptions): GraphProfileResult;
239
+
240
+ /**
241
+ * Approximate in-memory size estimation for arbitrary JS values.
242
+ *
243
+ * Uses a recursive walk with cycle detection. Not exact — provides a
244
+ * reasonable approximation for profiling and hotspot detection.
245
+ *
246
+ * @module
247
+ * @internal
248
+ */
249
+ /**
250
+ * Estimate the approximate retained memory (in bytes) of a JS value.
251
+ *
252
+ * Handles primitives, plain objects, arrays, Maps, Sets, and nested
253
+ * combinations. Uses a `WeakSet` for cycle detection — cyclic refs
254
+ * are counted once.
255
+ *
256
+ * @param value - The value to measure.
257
+ * @returns Approximate size in bytes.
258
+ */
259
+ declare function sizeof(value: unknown): number;
260
+
181
261
  /**
182
262
  * Graph container: registry, wiring, introspection (Phase 1).
183
263
  */
@@ -207,12 +287,15 @@ declare const index_GraphObserveAll: typeof GraphObserveAll;
207
287
  declare const index_GraphObserveOne: typeof GraphObserveOne;
208
288
  declare const index_GraphOptions: typeof GraphOptions;
209
289
  declare const index_GraphPersistSnapshot: typeof GraphPersistSnapshot;
290
+ type index_GraphProfileOptions = GraphProfileOptions;
291
+ type index_GraphProfileResult = GraphProfileResult;
210
292
  declare const index_GraphSpyHandle: typeof GraphSpyHandle;
211
293
  declare const index_GraphSpyOptions: typeof GraphSpyOptions;
212
294
  declare const index_GraphSpyTheme: typeof GraphSpyTheme;
213
295
  declare const index_GraphSpyThemeName: typeof GraphSpyThemeName;
214
296
  declare const index_JsonCodec: typeof JsonCodec;
215
297
  type index_LazyGraphCodec = LazyGraphCodec;
298
+ type index_NodeProfile = NodeProfile;
216
299
  declare const index_ObserveDetail: typeof ObserveDetail;
217
300
  declare const index_ObserveEvent: typeof ObserveEvent;
218
301
  declare const index_ObserveOptions: typeof ObserveOptions;
@@ -223,11 +306,13 @@ declare const index_TraceEntry: typeof TraceEntry;
223
306
  type index_WALEntry = WALEntry;
224
307
  declare const index_createDagCborCodec: typeof createDagCborCodec;
225
308
  declare const index_createDagCborZstdCodec: typeof createDagCborZstdCodec;
309
+ declare const index_graphProfile: typeof graphProfile;
226
310
  declare const index_negotiateCodec: typeof negotiateCodec;
227
311
  declare const index_reachable: typeof reachable;
228
312
  declare const index_replayWAL: typeof replayWAL;
313
+ declare const index_sizeof: typeof sizeof;
229
314
  declare namespace index {
230
- export { index_AutoCheckpointAdapter as AutoCheckpointAdapter, type index_DeltaCheckpoint as DeltaCheckpoint, index_DescribeFilter as DescribeFilter, type index_EvictedSubgraphInfo as EvictedSubgraphInfo, type index_EvictionPolicy as EvictionPolicy, index_GRAPH_META_SEGMENT as GRAPH_META_SEGMENT, index_Graph as Graph, index_GraphActorOptions as GraphActorOptions, index_GraphAutoCheckpointHandle as GraphAutoCheckpointHandle, index_GraphAutoCheckpointOptions as GraphAutoCheckpointOptions, index_GraphCheckpointRecord as GraphCheckpointRecord, type index_GraphCodec as GraphCodec, index_GraphDescribeOptions as GraphDescribeOptions, index_GraphDescribeOutput as GraphDescribeOutput, index_GraphDiagramDirection as GraphDiagramDirection, index_GraphDiagramOptions as GraphDiagramOptions, index_GraphDiffChange as GraphDiffChange, index_GraphDiffResult as GraphDiffResult, index_GraphDumpOptions as GraphDumpOptions, index_GraphFactoryContext as GraphFactoryContext, index_GraphNodeFactory as GraphNodeFactory, index_GraphObserveAll as GraphObserveAll, index_GraphObserveOne as GraphObserveOne, index_GraphOptions as GraphOptions, index_GraphPersistSnapshot as GraphPersistSnapshot, index_GraphSpyHandle as GraphSpyHandle, index_GraphSpyOptions as GraphSpyOptions, index_GraphSpyTheme as GraphSpyTheme, index_GraphSpyThemeName as GraphSpyThemeName, index_JsonCodec as JsonCodec, type index_LazyGraphCodec as LazyGraphCodec, index_ObserveDetail as ObserveDetail, index_ObserveEvent as ObserveEvent, index_ObserveOptions as ObserveOptions, index_ObserveResult as ObserveResult, index_ReachableDirection as ReachableDirection, index_ReachableOptions as ReachableOptions, index_TraceEntry as TraceEntry, type index_WALEntry as WALEntry, index_createDagCborCodec as createDagCborCodec, index_createDagCborZstdCodec as createDagCborZstdCodec, index_negotiateCodec as negotiateCodec, index_reachable as reachable, index_replayWAL as replayWAL };
315
+ export { index_AutoCheckpointAdapter as AutoCheckpointAdapter, type index_DeltaCheckpoint as DeltaCheckpoint, index_DescribeFilter as DescribeFilter, type index_EvictedSubgraphInfo as EvictedSubgraphInfo, type index_EvictionPolicy as EvictionPolicy, index_GRAPH_META_SEGMENT as GRAPH_META_SEGMENT, index_Graph as Graph, index_GraphActorOptions as GraphActorOptions, index_GraphAutoCheckpointHandle as GraphAutoCheckpointHandle, index_GraphAutoCheckpointOptions as GraphAutoCheckpointOptions, index_GraphCheckpointRecord as GraphCheckpointRecord, type index_GraphCodec as GraphCodec, index_GraphDescribeOptions as GraphDescribeOptions, index_GraphDescribeOutput as GraphDescribeOutput, index_GraphDiagramDirection as GraphDiagramDirection, index_GraphDiagramOptions as GraphDiagramOptions, index_GraphDiffChange as GraphDiffChange, index_GraphDiffResult as GraphDiffResult, index_GraphDumpOptions as GraphDumpOptions, index_GraphFactoryContext as GraphFactoryContext, index_GraphNodeFactory as GraphNodeFactory, index_GraphObserveAll as GraphObserveAll, index_GraphObserveOne as GraphObserveOne, index_GraphOptions as GraphOptions, index_GraphPersistSnapshot as GraphPersistSnapshot, type index_GraphProfileOptions as GraphProfileOptions, type index_GraphProfileResult as GraphProfileResult, index_GraphSpyHandle as GraphSpyHandle, index_GraphSpyOptions as GraphSpyOptions, index_GraphSpyTheme as GraphSpyTheme, index_GraphSpyThemeName as GraphSpyThemeName, index_JsonCodec as JsonCodec, type index_LazyGraphCodec as LazyGraphCodec, type index_NodeProfile as NodeProfile, index_ObserveDetail as ObserveDetail, index_ObserveEvent as ObserveEvent, index_ObserveOptions as ObserveOptions, index_ObserveResult as ObserveResult, index_ReachableDirection as ReachableDirection, index_ReachableOptions as ReachableOptions, index_TraceEntry as TraceEntry, type index_WALEntry as WALEntry, index_createDagCborCodec as createDagCborCodec, index_createDagCborZstdCodec as createDagCborZstdCodec, index_graphProfile as graphProfile, index_negotiateCodec as negotiateCodec, index_reachable as reachable, index_replayWAL as replayWAL, index_sizeof as sizeof };
231
316
  }
232
317
 
233
- export { type DeltaCheckpoint as D, type EvictedSubgraphInfo as E, type GraphCodec as G, JsonCodec as J, type LazyGraphCodec as L, type WALEntry as W, type EvictionPolicy as a, createDagCborZstdCodec as b, createDagCborCodec as c, index as i, negotiateCodec as n, replayWAL as r };
318
+ export { type DeltaCheckpoint as D, type EvictedSubgraphInfo as E, type GraphProfileResult as G, JsonCodec as J, type LazyGraphCodec as L, type NodeProfile as N, type WALEntry as W, type GraphProfileOptions as a, type EvictionPolicy as b, type GraphCodec as c, createDagCborCodec as d, createDagCborZstdCodec as e, graphProfile as g, index as i, negotiateCodec as n, replayWAL as r, sizeof as s };