@graphrefly/graphrefly 0.7.0 → 0.8.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 (65) hide show
  1. package/dist/{chunk-L4J2K2RT.js → chunk-A2AJJOSJ.js} +3 -3
  2. package/dist/{chunk-ISGMZ2T3.js → chunk-E7OH6ZAZ.js} +3 -3
  3. package/dist/{chunk-47YJEZUJ.js → chunk-LR2CLSEF.js} +2 -2
  4. package/dist/{chunk-3EVXOI5C.js → chunk-QTZSBQGJ.js} +35 -21
  5. package/dist/chunk-QTZSBQGJ.js.map +1 -0
  6. package/dist/{chunk-ONLYF6GA.js → chunk-TZLX4KIT.js} +3 -3
  7. package/dist/{chunk-FGLZ5QID.js → chunk-UCW3VWMN.js} +4 -4
  8. package/dist/{chunk-BLCXEMAD.js → chunk-WYI7YW54.js} +16 -8
  9. package/dist/chunk-WYI7YW54.js.map +1 -0
  10. package/dist/{chunk-OSR3G3DP.js → chunk-XCZPGOVP.js} +3 -3
  11. package/dist/{chunk-PEBORXRA.js → chunk-YWTP2XRJ.js} +2 -2
  12. package/dist/compat/nestjs/index.cjs +47 -25
  13. package/dist/compat/nestjs/index.cjs.map +1 -1
  14. package/dist/compat/nestjs/index.d.cts +3 -3
  15. package/dist/compat/nestjs/index.d.ts +3 -3
  16. package/dist/compat/nestjs/index.js +7 -7
  17. package/dist/core/index.cjs +34 -20
  18. package/dist/core/index.cjs.map +1 -1
  19. package/dist/core/index.d.cts +1 -1
  20. package/dist/core/index.d.ts +1 -1
  21. package/dist/core/index.js +3 -3
  22. package/dist/extra/index.cjs +34 -20
  23. package/dist/extra/index.cjs.map +1 -1
  24. package/dist/extra/index.d.cts +3 -3
  25. package/dist/extra/index.d.ts +3 -3
  26. package/dist/extra/index.js +3 -3
  27. package/dist/graph/index.cjs +47 -25
  28. package/dist/graph/index.cjs.map +1 -1
  29. package/dist/graph/index.d.cts +2 -2
  30. package/dist/graph/index.d.ts +2 -2
  31. package/dist/graph/index.js +4 -4
  32. package/dist/{graph-B3BoJjcb.d.cts → graph-DqTICAY2.d.cts} +11 -5
  33. package/dist/{graph-CmiUuhaN.d.ts → graph-X9uwnD_z.d.ts} +11 -5
  34. package/dist/{index-D0cx-Yht.d.cts → index-3U0WxdD-.d.cts} +1 -1
  35. package/dist/{index-D1hgSTzr.d.cts → index-BP1t_38S.d.cts} +2 -2
  36. package/dist/{index-CsUq2rrK.d.ts → index-BPCeYDS4.d.ts} +1 -1
  37. package/dist/{index-BrgtEG-C.d.ts → index-BVG5pjin.d.ts} +3 -1
  38. package/dist/{index-D8NIq6om.d.cts → index-BYEgosAX.d.cts} +3 -1
  39. package/dist/{index-BsuKSs4L.d.cts → index-BYa2YMat.d.cts} +2 -2
  40. package/dist/{index-DFFNKYig.d.ts → index-DLO8wnYU.d.ts} +2 -2
  41. package/dist/{index-Bf2X1YSI.d.ts → index-DMv1Etbi.d.ts} +1 -1
  42. package/dist/{index-Bl7hJcc3.d.cts → index-DbwgQ4Cw.d.cts} +1 -1
  43. package/dist/{index-Pm68AYPh.d.ts → index-a5gHmH5b.d.ts} +2 -2
  44. package/dist/index.cjs +47 -25
  45. package/dist/index.cjs.map +1 -1
  46. package/dist/index.d.cts +10 -10
  47. package/dist/index.d.ts +10 -10
  48. package/dist/index.js +16 -16
  49. package/dist/patterns/reactive-layout/index.cjs +47 -25
  50. package/dist/patterns/reactive-layout/index.cjs.map +1 -1
  51. package/dist/patterns/reactive-layout/index.d.cts +2 -2
  52. package/dist/patterns/reactive-layout/index.d.ts +2 -2
  53. package/dist/patterns/reactive-layout/index.js +4 -4
  54. package/dist/{reactive-log-CAXzJ7hw.d.cts → reactive-log-BfX6bOSZ.d.cts} +1 -1
  55. package/dist/{reactive-log-DwNhOe0g.d.ts → reactive-log-RhgIog2Z.d.ts} +1 -1
  56. package/package.json +1 -1
  57. package/dist/chunk-3EVXOI5C.js.map +0 -1
  58. package/dist/chunk-BLCXEMAD.js.map +0 -1
  59. /package/dist/{chunk-L4J2K2RT.js.map → chunk-A2AJJOSJ.js.map} +0 -0
  60. /package/dist/{chunk-ISGMZ2T3.js.map → chunk-E7OH6ZAZ.js.map} +0 -0
  61. /package/dist/{chunk-47YJEZUJ.js.map → chunk-LR2CLSEF.js.map} +0 -0
  62. /package/dist/{chunk-ONLYF6GA.js.map → chunk-TZLX4KIT.js.map} +0 -0
  63. /package/dist/{chunk-FGLZ5QID.js.map → chunk-UCW3VWMN.js.map} +0 -0
  64. /package/dist/{chunk-OSR3G3DP.js.map → chunk-XCZPGOVP.js.map} +0 -0
  65. /package/dist/{chunk-PEBORXRA.js.map → chunk-YWTP2XRJ.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-Bl7hJcc3.cjs';
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-B3BoJjcb.cjs';
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-DbwgQ4Cw.cjs';
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-DqTICAY2.cjs';
3
3
  import '../meta-BJEU8fYz.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-CsUq2rrK.js';
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-CmiUuhaN.js';
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-BPCeYDS4.js';
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-X9uwnD_z.js';
3
3
  import '../meta-BJEU8fYz.js';
@@ -4,14 +4,14 @@ import {
4
4
  createDagCborZstdCodec,
5
5
  negotiateCodec,
6
6
  replayWAL
7
- } from "../chunk-L4J2K2RT.js";
7
+ } from "../chunk-A2AJJOSJ.js";
8
8
  import {
9
9
  GRAPH_META_SEGMENT,
10
10
  Graph,
11
11
  reachable
12
- } from "../chunk-BLCXEMAD.js";
13
- import "../chunk-47YJEZUJ.js";
14
- import "../chunk-3EVXOI5C.js";
12
+ } from "../chunk-WYI7YW54.js";
13
+ import "../chunk-LR2CLSEF.js";
14
+ import "../chunk-QTZSBQGJ.js";
15
15
  export {
16
16
  GRAPH_META_SEGMENT,
17
17
  Graph,
@@ -75,7 +75,7 @@ type GraphDescribeOutput = {
75
75
  };
76
76
  /**
77
77
  * Persisted graph snapshot: {@link GraphDescribeOutput} plus optional format version
78
- * ({@link Graph.snapshot}, {@link Graph.restore}, {@link Graph.fromSnapshot}, {@link Graph.toJSON},
78
+ * ({@link Graph.snapshot}, {@link Graph.restore}, {@link Graph.fromSnapshot}, {@link Graph.toObject},
79
79
  * {@link Graph.toJSONString} — §3.8).
80
80
  */
81
81
  type GraphPersistSnapshot = GraphDescribeOutput & {
@@ -515,18 +515,24 @@ declare class Graph {
515
515
  */
516
516
  static fromSnapshot(data: GraphPersistSnapshot, build?: (g: Graph) => void): Graph;
517
517
  /**
518
- * Plain snapshot with **recursively sorted object keys** for deterministic serialization (§3.8).
518
+ * Plain snapshot object with **recursively sorted object keys** for deterministic serialization (§3.8).
519
519
  *
520
520
  * @remarks
521
- * ECMAScript `JSON.stringify(graph)` invokes this method; it must return a plain object, not an
522
- * already-stringified JSON string (otherwise the graph would be double-encoded).
523
521
  * For a single UTF-8 string with a trailing newline (convenient for git), use {@link Graph.toJSONString}.
524
522
  *
525
523
  * @returns Same object as {@link Graph.snapshot}.
526
524
  */
525
+ toObject(): GraphPersistSnapshot;
526
+ /**
527
+ * ECMAScript `JSON.stringify` hook — delegates to {@link Graph.toObject}.
528
+ *
529
+ * @remarks
530
+ * Must return a plain object (not a string) so `JSON.stringify(graph)` works correctly
531
+ * without double-encoding.
532
+ */
527
533
  toJSON(): GraphPersistSnapshot;
528
534
  /**
529
- * Deterministic JSON **text**: `JSON.stringify` of {@link Graph.toJSON} plus a trailing newline (§3.8).
535
+ * Deterministic JSON **text**: `JSON.stringify` of {@link Graph.toObject} plus a trailing newline (§3.8).
530
536
  *
531
537
  * @returns Stable string suitable for diffs.
532
538
  */
@@ -75,7 +75,7 @@ type GraphDescribeOutput = {
75
75
  };
76
76
  /**
77
77
  * Persisted graph snapshot: {@link GraphDescribeOutput} plus optional format version
78
- * ({@link Graph.snapshot}, {@link Graph.restore}, {@link Graph.fromSnapshot}, {@link Graph.toJSON},
78
+ * ({@link Graph.snapshot}, {@link Graph.restore}, {@link Graph.fromSnapshot}, {@link Graph.toObject},
79
79
  * {@link Graph.toJSONString} — §3.8).
80
80
  */
81
81
  type GraphPersistSnapshot = GraphDescribeOutput & {
@@ -515,18 +515,24 @@ declare class Graph {
515
515
  */
516
516
  static fromSnapshot(data: GraphPersistSnapshot, build?: (g: Graph) => void): Graph;
517
517
  /**
518
- * Plain snapshot with **recursively sorted object keys** for deterministic serialization (§3.8).
518
+ * Plain snapshot object with **recursively sorted object keys** for deterministic serialization (§3.8).
519
519
  *
520
520
  * @remarks
521
- * ECMAScript `JSON.stringify(graph)` invokes this method; it must return a plain object, not an
522
- * already-stringified JSON string (otherwise the graph would be double-encoded).
523
521
  * For a single UTF-8 string with a trailing newline (convenient for git), use {@link Graph.toJSONString}.
524
522
  *
525
523
  * @returns Same object as {@link Graph.snapshot}.
526
524
  */
525
+ toObject(): GraphPersistSnapshot;
526
+ /**
527
+ * ECMAScript `JSON.stringify` hook — delegates to {@link Graph.toObject}.
528
+ *
529
+ * @remarks
530
+ * Must return a plain object (not a string) so `JSON.stringify(graph)` works correctly
531
+ * without double-encoding.
532
+ */
527
533
  toJSON(): GraphPersistSnapshot;
528
534
  /**
529
- * Deterministic JSON **text**: `JSON.stringify` of {@link Graph.toJSON} plus a trailing newline (§3.8).
535
+ * Deterministic JSON **text**: `JSON.stringify` of {@link Graph.toObject} plus a trailing newline (§3.8).
530
536
  *
531
537
  * @returns Stable string suitable for diffs.
532
538
  */
@@ -1,5 +1,5 @@
1
1
  import { N as Node } from './meta-BJEU8fYz.cjs';
2
- import { G as Graph } from './graph-B3BoJjcb.cjs';
2
+ import { G as Graph } from './graph-DqTICAY2.cjs';
3
3
 
4
4
  /** Pluggable measurement backend. */
5
5
  interface MeasurementAdapter {
@@ -1,6 +1,6 @@
1
1
  import { N as Node, a as NodeOptions, M as Message, k as Messages } from './meta-BJEU8fYz.cjs';
2
- import { G as Graph } from './graph-B3BoJjcb.cjs';
3
- import { V as Versioned, a as ReactiveLogBundle, b as ReactiveLogOptions, R as ReactiveLogSnapshot, l as logSlice, o as observeGraph$, c as observeNode$, r as reactiveLog, t as toMessages$, d as toObservable } from './reactive-log-CAXzJ7hw.cjs';
2
+ import { G as Graph } from './graph-DqTICAY2.cjs';
3
+ import { V as Versioned, a as ReactiveLogBundle, b as ReactiveLogOptions, R as ReactiveLogSnapshot, l as logSlice, o as observeGraph$, c as observeNode$, r as reactiveLog, t as toMessages$, d as toObservable } from './reactive-log-BfX6bOSZ.cjs';
4
4
 
5
5
  /**
6
6
  * Backoff strategies for {@link retry} (roadmap §3.1). Delays are in **nanoseconds**.
@@ -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-CmiUuhaN.js';
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-X9uwnD_z.js';
2
2
 
3
3
  /**
4
4
  * GraphCodec — pluggable serialization for graph snapshots (Phase 8.6).
@@ -276,7 +276,9 @@ declare class DynamicNodeImpl<T = unknown> implements Node<T> {
276
276
  *
277
277
  * Spec: `state(initial, opts?)` is `node([], { initial, ...opts })` (GRAPHREFLY-SPEC §2.7).
278
278
  *
279
- * @param initial - Initial cached value.
279
+ * @param initial - Initial cached value. Because `initial` is provided, `equals` is
280
+ * called on the first {@link Node.down | down()} emission — if the value matches
281
+ * `initial`, the node emits `RESOLVED` instead of `DATA` (spec §2.5).
280
282
  * @param opts - Optional {@link NodeOptions} (excluding `initial`).
281
283
  * @returns `Node<T>` - Stateful node you drive imperatively.
282
284
  *
@@ -276,7 +276,9 @@ declare class DynamicNodeImpl<T = unknown> implements Node<T> {
276
276
  *
277
277
  * Spec: `state(initial, opts?)` is `node([], { initial, ...opts })` (GRAPHREFLY-SPEC §2.7).
278
278
  *
279
- * @param initial - Initial cached value.
279
+ * @param initial - Initial cached value. Because `initial` is provided, `equals` is
280
+ * called on the first {@link Node.down | down()} emission — if the value matches
281
+ * `initial`, the node emits `RESOLVED` instead of `DATA` (spec §2.5).
280
282
  * @param opts - Optional {@link NodeOptions} (excluding `initial`).
281
283
  * @returns `Node<T>` - Stateful node you drive imperatively.
282
284
  *
@@ -1,7 +1,7 @@
1
- import { R as ReactiveLogSnapshot, o as observeGraph$, c as observeNode$, t as toMessages$, d as toObservable } from './reactive-log-CAXzJ7hw.cjs';
1
+ import { R as ReactiveLogSnapshot, o as observeGraph$, c as observeNode$, t as toMessages$, d as toObservable } from './reactive-log-BfX6bOSZ.cjs';
2
2
  import { OnModuleInit, OnModuleDestroy, ExecutionContext, CanActivate, DynamicModule } from '@nestjs/common';
3
3
  import { ModuleRef } from '@nestjs/core';
4
- import { G as Graph, a as GraphOptions, r as GraphPersistSnapshot } from './graph-B3BoJjcb.cjs';
4
+ import { G as Graph, a as GraphOptions, r as GraphPersistSnapshot } from './graph-DqTICAY2.cjs';
5
5
  import { A as Actor, N as Node } from './meta-BJEU8fYz.cjs';
6
6
 
7
7
  /** Class constructor key for decorator registries and Nest `ModuleRef.get()`. */
@@ -1,7 +1,7 @@
1
- import { R as ReactiveLogSnapshot, o as observeGraph$, c as observeNode$, t as toMessages$, d as toObservable } from './reactive-log-DwNhOe0g.js';
1
+ import { R as ReactiveLogSnapshot, o as observeGraph$, c as observeNode$, t as toMessages$, d as toObservable } from './reactive-log-RhgIog2Z.js';
2
2
  import { OnModuleInit, OnModuleDestroy, ExecutionContext, CanActivate, DynamicModule } from '@nestjs/common';
3
3
  import { ModuleRef } from '@nestjs/core';
4
- import { G as Graph, a as GraphOptions, r as GraphPersistSnapshot } from './graph-CmiUuhaN.js';
4
+ import { G as Graph, a as GraphOptions, r as GraphPersistSnapshot } from './graph-X9uwnD_z.js';
5
5
  import { A as Actor, N as Node } from './meta-BJEU8fYz.js';
6
6
 
7
7
  /** Class constructor key for decorator registries and Nest `ModuleRef.get()`. */
@@ -1,5 +1,5 @@
1
1
  import { N as Node } from './meta-BJEU8fYz.js';
2
- import { G as Graph } from './graph-CmiUuhaN.js';
2
+ import { G as Graph } from './graph-X9uwnD_z.js';
3
3
 
4
4
  /** Pluggable measurement backend. */
5
5
  interface MeasurementAdapter {
@@ -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-B3BoJjcb.cjs';
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-DqTICAY2.cjs';
2
2
 
3
3
  /**
4
4
  * GraphCodec — pluggable serialization for graph snapshots (Phase 8.6).
@@ -1,6 +1,6 @@
1
1
  import { N as Node, a as NodeOptions, M as Message, k as Messages } from './meta-BJEU8fYz.js';
2
- import { G as Graph } from './graph-CmiUuhaN.js';
3
- import { V as Versioned, a as ReactiveLogBundle, b as ReactiveLogOptions, R as ReactiveLogSnapshot, l as logSlice, o as observeGraph$, c as observeNode$, r as reactiveLog, t as toMessages$, d as toObservable } from './reactive-log-DwNhOe0g.js';
2
+ import { G as Graph } from './graph-X9uwnD_z.js';
3
+ import { V as Versioned, a as ReactiveLogBundle, b as ReactiveLogOptions, R as ReactiveLogSnapshot, l as logSlice, o as observeGraph$, c as observeNode$, r as reactiveLog, t as toMessages$, d as toObservable } from './reactive-log-RhgIog2Z.js';
4
4
 
5
5
  /**
6
6
  * Backoff strategies for {@link retry} (roadmap §3.1). Delays are in **nanoseconds**.
package/dist/index.cjs CHANGED
@@ -726,6 +726,7 @@ function isV1(info) {
726
726
  }
727
727
 
728
728
  // src/core/node.ts
729
+ var NO_VALUE = /* @__PURE__ */ Symbol.for("graphrefly/NO_VALUE");
729
730
  function createIntBitSet() {
730
731
  let bits = 0;
731
732
  return {
@@ -826,7 +827,6 @@ var NodeImpl = class {
826
827
  _producerStarted = false;
827
828
  _connecting = false;
828
829
  _manualEmitUsed = false;
829
- _hasEmittedData = false;
830
830
  _sinkCount = 0;
831
831
  _singleDepSinkCount = 0;
832
832
  // --- Object/collection state ---
@@ -856,10 +856,10 @@ var NodeImpl = class {
856
856
  this._hasDeps = deps.length > 0;
857
857
  this._autoComplete = opts.completeWhenDepsComplete ?? true;
858
858
  this._isSingleDep = deps.length === 1 && fn != null;
859
- this._cached = opts.initial;
859
+ this._cached = "initial" in opts ? opts.initial : NO_VALUE;
860
860
  this._status = this._hasDeps ? "disconnected" : "settled";
861
861
  this._hashFn = opts.versioningHash ?? defaultHash;
862
- this._versioning = opts.versioning != null ? createVersioning(opts.versioning, this._cached, {
862
+ this._versioning = opts.versioning != null ? createVersioning(opts.versioning, this._cached === NO_VALUE ? void 0 : this._cached, {
863
863
  id: opts.versioningId,
864
864
  hash: this._hashFn
865
865
  }) : void 0;
@@ -943,10 +943,14 @@ var NodeImpl = class {
943
943
  _applyVersioning(level, opts) {
944
944
  if (this._versioning != null) return;
945
945
  this._hashFn = opts?.hash ?? this._hashFn;
946
- this._versioning = createVersioning(level, this._cached, {
947
- id: opts?.id,
948
- hash: this._hashFn
949
- });
946
+ this._versioning = createVersioning(
947
+ level,
948
+ this._cached === NO_VALUE ? void 0 : this._cached,
949
+ {
950
+ id: opts?.id,
951
+ hash: this._hashFn
952
+ }
953
+ );
950
954
  }
951
955
  hasGuard() {
952
956
  return this._guard != null;
@@ -956,7 +960,7 @@ var NodeImpl = class {
956
960
  return this._guard(normalizeActor(actor), "observe");
957
961
  }
958
962
  get() {
959
- return this._cached;
963
+ return this._cached === NO_VALUE ? void 0 : this._cached;
960
964
  }
961
965
  down(messages, options) {
962
966
  if (messages.length === 0) return;
@@ -1013,6 +1017,7 @@ var NodeImpl = class {
1013
1017
  }
1014
1018
  if (this._terminal && this._opts.resubscribable) {
1015
1019
  this._terminal = false;
1020
+ this._cached = NO_VALUE;
1016
1021
  this._status = this._hasDeps ? "disconnected" : "settled";
1017
1022
  this._opts.onResubscribe?.();
1018
1023
  }
@@ -1112,8 +1117,7 @@ var NodeImpl = class {
1112
1117
  const cleanupFn = this._cleanup;
1113
1118
  this._cleanup = void 0;
1114
1119
  cleanupFn?.();
1115
- this._cached = void 0;
1116
- this._hasEmittedData = false;
1120
+ this._cached = NO_VALUE;
1117
1121
  this._lastDepValues = void 0;
1118
1122
  }
1119
1123
  this._status = statusAfterMessage(this._status, m);
@@ -1122,8 +1126,7 @@ var NodeImpl = class {
1122
1126
  }
1123
1127
  if (t === TEARDOWN) {
1124
1128
  if (this._opts.resetOnTeardown) {
1125
- this._cached = void 0;
1126
- this._hasEmittedData = false;
1129
+ this._cached = NO_VALUE;
1127
1130
  }
1128
1131
  const teardownCleanup = this._cleanup;
1129
1132
  this._cleanup = void 0;
@@ -1156,14 +1159,13 @@ var NodeImpl = class {
1156
1159
  const wasDirty = this._status === "dirty";
1157
1160
  let unchanged;
1158
1161
  try {
1159
- unchanged = this._hasEmittedData && this._equals(this._cached, value);
1162
+ unchanged = this._cached !== NO_VALUE && this._equals(this._cached, value);
1160
1163
  } catch (eqErr) {
1161
1164
  const eqMsg = eqErr instanceof Error ? eqErr.message : String(eqErr);
1162
1165
  const wrapped = new Error(`Node "${this.name}": equals threw: ${eqMsg}`, { cause: eqErr });
1163
1166
  this._downInternal([[ERROR, wrapped]]);
1164
1167
  return;
1165
1168
  }
1166
- this._hasEmittedData = true;
1167
1169
  if (unchanged) {
1168
1170
  this._downInternal(wasDirty ? [[RESOLVED]] : [[DIRTY], [RESOLVED]]);
1169
1171
  return;
@@ -1387,7 +1389,7 @@ var DynamicNodeImpl = class {
1387
1389
  _actions;
1388
1390
  _boundEmitToSinks;
1389
1391
  // Mutable state
1390
- _cached;
1392
+ _cached = NO_VALUE;
1391
1393
  _status = "disconnected";
1392
1394
  _terminal = false;
1393
1395
  _connected = false;
@@ -1481,7 +1483,7 @@ var DynamicNodeImpl = class {
1481
1483
  return this._guard(normalizeActor(actor), "observe");
1482
1484
  }
1483
1485
  get() {
1484
- return this._cached;
1486
+ return this._cached === NO_VALUE ? void 0 : this._cached;
1485
1487
  }
1486
1488
  down(messages, options) {
1487
1489
  if (messages.length === 0) return;
@@ -1539,6 +1541,7 @@ var DynamicNodeImpl = class {
1539
1541
  }
1540
1542
  if (this._terminal && this._resubscribable) {
1541
1543
  this._terminal = false;
1544
+ this._cached = NO_VALUE;
1542
1545
  this._status = "disconnected";
1543
1546
  this._onResubscribe?.();
1544
1547
  }
@@ -1616,10 +1619,13 @@ var DynamicNodeImpl = class {
1616
1619
  const t = m[0];
1617
1620
  if (t === DATA) this._cached = m[1];
1618
1621
  if (t === INVALIDATE) {
1619
- this._cached = void 0;
1622
+ this._cached = NO_VALUE;
1623
+ this._status = "dirty";
1620
1624
  }
1621
- if (t === DATA || t === RESOLVED) {
1625
+ if (t === DATA) {
1622
1626
  this._status = "settled";
1627
+ } else if (t === RESOLVED) {
1628
+ this._status = "resolved";
1623
1629
  } else if (t === DIRTY) {
1624
1630
  this._status = "dirty";
1625
1631
  } else if (t === COMPLETE) {
@@ -1630,7 +1636,7 @@ var DynamicNodeImpl = class {
1630
1636
  this._terminal = true;
1631
1637
  }
1632
1638
  if (t === TEARDOWN) {
1633
- if (this._resetOnTeardown) this._cached = void 0;
1639
+ if (this._resetOnTeardown) this._cached = NO_VALUE;
1634
1640
  try {
1635
1641
  this._propagateToMeta(t);
1636
1642
  } finally {
@@ -1653,7 +1659,15 @@ var DynamicNodeImpl = class {
1653
1659
  }
1654
1660
  _emitAutoValue(value) {
1655
1661
  const wasDirty = this._status === "dirty";
1656
- const unchanged = this._equals(this._cached, value);
1662
+ let unchanged;
1663
+ try {
1664
+ unchanged = this._cached !== NO_VALUE && this._equals(this._cached, value);
1665
+ } catch (eqErr) {
1666
+ const eqMsg = eqErr instanceof Error ? eqErr.message : String(eqErr);
1667
+ const wrapped = new Error(`Node "${this.name}": equals threw: ${eqMsg}`, { cause: eqErr });
1668
+ this._downInternal([[ERROR, wrapped]]);
1669
+ return;
1670
+ }
1657
1671
  if (unchanged) {
1658
1672
  this._downInternal(wasDirty ? [[RESOLVED]] : [[DIRTY], [RESOLVED]]);
1659
1673
  return;
@@ -5174,20 +5188,28 @@ var Graph = class _Graph {
5174
5188
  return g;
5175
5189
  }
5176
5190
  /**
5177
- * Plain snapshot with **recursively sorted object keys** for deterministic serialization (§3.8).
5191
+ * Plain snapshot object with **recursively sorted object keys** for deterministic serialization (§3.8).
5178
5192
  *
5179
5193
  * @remarks
5180
- * ECMAScript `JSON.stringify(graph)` invokes this method; it must return a plain object, not an
5181
- * already-stringified JSON string (otherwise the graph would be double-encoded).
5182
5194
  * For a single UTF-8 string with a trailing newline (convenient for git), use {@link Graph.toJSONString}.
5183
5195
  *
5184
5196
  * @returns Same object as {@link Graph.snapshot}.
5185
5197
  */
5186
- toJSON() {
5198
+ toObject() {
5187
5199
  return this.snapshot();
5188
5200
  }
5189
5201
  /**
5190
- * Deterministic JSON **text**: `JSON.stringify` of {@link Graph.toJSON} plus a trailing newline (§3.8).
5202
+ * ECMAScript `JSON.stringify` hook — delegates to {@link Graph.toObject}.
5203
+ *
5204
+ * @remarks
5205
+ * Must return a plain object (not a string) so `JSON.stringify(graph)` works correctly
5206
+ * without double-encoding.
5207
+ */
5208
+ toJSON() {
5209
+ return this.toObject();
5210
+ }
5211
+ /**
5212
+ * Deterministic JSON **text**: `JSON.stringify` of {@link Graph.toObject} plus a trailing newline (§3.8).
5191
5213
  *
5192
5214
  * @returns Stable string suitable for diffs.
5193
5215
  */