@graphrefly/graphrefly 0.16.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-RLVFZDCE.js → chunk-76YPZQTW.js} +3 -9
- package/dist/{chunk-RLVFZDCE.js.map → chunk-76YPZQTW.js.map} +1 -1
- package/dist/{chunk-VZY2B2LU.js → chunk-BV3TPSBK.js} +1 -2
- package/dist/chunk-BV3TPSBK.js.map +1 -0
- package/dist/{chunk-YX263TXI.js → chunk-F6ORUNO7.js} +19 -52
- package/dist/chunk-F6ORUNO7.js.map +1 -0
- package/dist/chunk-FCLROC4Q.js +231 -0
- package/dist/chunk-FCLROC4Q.js.map +1 -0
- package/dist/{chunk-ITDVOCFO.js → chunk-J7S54G7I.js} +2 -3
- package/dist/{chunk-26A4E7J7.js → chunk-KJGUP35I.js} +4 -10
- package/dist/chunk-KJGUP35I.js.map +1 -0
- package/dist/{chunk-3BLRREFM.js → chunk-LB3RYLSC.js} +207 -174
- package/dist/chunk-LB3RYLSC.js.map +1 -0
- package/dist/{chunk-LKP7IWRV.js → chunk-TNKODJ6E.js} +3 -7
- package/dist/chunk-TNKODJ6E.js.map +1 -0
- package/dist/{chunk-RZSQ7P2C.js → chunk-UVWEKTYC.js} +3 -3
- package/dist/compat/nestjs/index.cjs +221 -225
- package/dist/compat/nestjs/index.cjs.map +1 -1
- package/dist/compat/nestjs/index.d.cts +4 -4
- package/dist/compat/nestjs/index.d.ts +4 -4
- package/dist/compat/nestjs/index.js +7 -13
- package/dist/core/index.cjs +0 -84
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +3 -7
- package/dist/extra/index.cjs +17 -54
- package/dist/extra/index.cjs.map +1 -1
- package/dist/extra/index.d.cts +4 -4
- package/dist/extra/index.d.ts +4 -4
- package/dist/extra/index.js +3 -9
- package/dist/graph/index.cjs +329 -174
- package/dist/graph/index.cjs.map +1 -1
- package/dist/graph/index.d.cts +3 -3
- package/dist/graph/index.d.ts +3 -3
- package/dist/graph/index.js +10 -6
- package/dist/{graph-fCsaaVIa.d.cts → graph-BYFlyNpX.d.cts} +47 -45
- package/dist/{graph-Dc-P9BVm.d.ts → graph-gISB9n3n.d.ts} +47 -45
- package/dist/{index-N704txAA.d.ts → index-7WnwgjMu.d.ts} +5 -7
- package/dist/{index-DWq0P9T6.d.ts → index-B43mC7uY.d.cts} +5 -7
- package/dist/{index-BmoUvOGN.d.ts → index-B80mMeuf.d.ts} +2 -4
- package/dist/{index-DlGMf_Qe.d.cts → index-BqOWSFhr.d.cts} +2 -2
- package/dist/{index-BBVBYPxr.d.cts → index-CEDaJaYE.d.ts} +5 -7
- package/dist/{index-DhXznWyH.d.ts → index-CgKPpiu8.d.ts} +2 -2
- package/dist/{index-Db27z6Ki.d.cts → index-Ci_vPaVm.d.cts} +90 -7
- package/dist/{index-BR19vQME.d.ts → index-DKaB2x0T.d.ts} +90 -7
- package/dist/{index-ClaKZFPl.d.cts → index-D_tUMcpz.d.cts} +5 -7
- package/dist/{index-YlOH1Gw6.d.cts → index-EmzYk-TG.d.cts} +2 -4
- package/dist/index.cjs +503 -282
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +99 -18
- package/dist/index.d.ts +99 -18
- package/dist/index.js +170 -63
- package/dist/index.js.map +1 -1
- package/dist/{meta-BV4pj9ML.d.cts → meta-npl5b97j.d.cts} +1 -53
- package/dist/{meta-BV4pj9ML.d.ts → meta-npl5b97j.d.ts} +1 -53
- package/dist/observable-DFBCBELR.d.cts +36 -0
- package/dist/observable-oAGygKvc.d.ts +36 -0
- package/dist/patterns/reactive-layout/index.cjs +204 -172
- package/dist/patterns/reactive-layout/index.cjs.map +1 -1
- package/dist/patterns/reactive-layout/index.d.cts +3 -3
- package/dist/patterns/reactive-layout/index.d.ts +3 -3
- package/dist/patterns/reactive-layout/index.js +4 -4
- package/package.json +1 -1
- package/dist/chunk-26A4E7J7.js.map +0 -1
- package/dist/chunk-3BLRREFM.js.map +0 -1
- package/dist/chunk-LKP7IWRV.js.map +0 -1
- package/dist/chunk-SHRJH2DN.js +0 -107
- package/dist/chunk-SHRJH2DN.js.map +0 -1
- package/dist/chunk-VZY2B2LU.js.map +0 -1
- package/dist/chunk-YX263TXI.js.map +0 -1
- package/dist/observable-Cz-AWhwR.d.cts +0 -42
- package/dist/observable-DCqlwGyl.d.ts +0 -42
- /package/dist/{chunk-ITDVOCFO.js.map → chunk-J7S54G7I.js.map} +0 -0
- /package/dist/{chunk-RZSQ7P2C.js.map → chunk-UVWEKTYC.js.map} +0 -0
|
@@ -616,57 +616,5 @@ type DescribeDetail = "minimal" | "standard" | "full";
|
|
|
616
616
|
type DescribeField = "type" | "status" | "value" | "deps" | "meta" | "v" | "guard" | "lastMutation" | `meta.${string}`;
|
|
617
617
|
/** Resolve which fields to include based on detail level or explicit field list. */
|
|
618
618
|
declare function resolveDescribeFields(detail?: DescribeDetail, fields?: readonly DescribeField[]): Set<string> | null;
|
|
619
|
-
/**
|
|
620
|
-
* Reads the current cached value of every companion meta field on a node,
|
|
621
|
-
* suitable for merging into `describe()`-style JSON (GRAPHREFLY-SPEC §2.3, §3.6).
|
|
622
|
-
*
|
|
623
|
-
* @remarks
|
|
624
|
-
* Values come from {@link Node.get}, which returns the **last settled** cache.
|
|
625
|
-
* If a meta field is in `"dirty"` status (DIRTY received, DATA pending), the
|
|
626
|
-
* snapshot contains the *previous* value — check `node.meta[key].status` when
|
|
627
|
-
* freshness matters. Avoid calling mid-batch for the same reason.
|
|
628
|
-
*
|
|
629
|
-
* Meta nodes are **not** terminated when their parent receives COMPLETE or
|
|
630
|
-
* ERROR — they remain writable so callers can record post-mortem metadata
|
|
631
|
-
* (e.g. `meta.error`). They *are* torn down when the parent receives TEARDOWN.
|
|
632
|
-
*
|
|
633
|
-
* @param node - The node whose meta fields to snapshot.
|
|
634
|
-
* @returns Plain object of `{ key: value }` pairs (empty if no meta defined).
|
|
635
|
-
* Keys whose companion node's {@link Node.get} throws are omitted.
|
|
636
|
-
*
|
|
637
|
-
* @example
|
|
638
|
-
* ```ts
|
|
639
|
-
* import { core } from "@graphrefly/graphrefly-ts";
|
|
640
|
-
*
|
|
641
|
-
* const n = core.node({ initial: 0, meta: { tag: "a" } });
|
|
642
|
-
* core.metaSnapshot(n); // { tag: "a" }
|
|
643
|
-
* ```
|
|
644
|
-
*/
|
|
645
|
-
declare function metaSnapshot(node: Node): Record<string, unknown>;
|
|
646
|
-
/**
|
|
647
|
-
* Builds a single-node slice of `Graph.describe()` JSON (structure + `meta` snapshot).
|
|
648
|
-
* Parity with graphrefly-py `describe_node`.
|
|
649
|
-
*
|
|
650
|
-
* `type` is inferred from factory configuration, optional `describeKind` in node options,
|
|
651
|
-
* and the last `manualEmitUsed` hint (operator vs derived). {@link effect} sets
|
|
652
|
-
* `describeKind: "effect"`. Nodes not created by {@link node} fall back to `type: "state"` and empty `deps`.
|
|
653
|
-
*
|
|
654
|
-
* @param node - Any `Node` to introspect.
|
|
655
|
-
* @returns `DescribeNodeOutput` suitable for merging into graph describe maps.
|
|
656
|
-
*
|
|
657
|
-
* @example
|
|
658
|
-
* ```ts
|
|
659
|
-
* import { describeNode, state } from "@graphrefly/graphrefly-ts";
|
|
660
|
-
*
|
|
661
|
-
* describeNode(state(0));
|
|
662
|
-
* ```
|
|
663
|
-
*/
|
|
664
|
-
/**
|
|
665
|
-
* Builds a single-node slice for `Graph.describe()`.
|
|
666
|
-
*
|
|
667
|
-
* @param node - Node to introspect.
|
|
668
|
-
* @param includeFields - Set of fields to include, or `null` for all. When omitted, all fields are included (legacy behavior).
|
|
669
|
-
*/
|
|
670
|
-
declare function describeNode(node: Node, includeFields?: Set<string> | null): DescribeNodeOutput;
|
|
671
619
|
|
|
672
|
-
export {
|
|
620
|
+
export { normalizeActor as $, type Actor as A, accessHintForGuard as B, CLEANUP_RESULT as C, DATA as D, ERROR as E, advanceVersion as F, type GuardAction as G, type HashFn as H, INVALIDATE as I, cleanupResult as J, createVersioning as K, defaultHash as L, type Message as M, type Node as N, type OnMessageHandler as O, PAUSE as P, isKnownMessageType as Q, RESOLVED as R, type SubscribeHints as S, TEARDOWN as T, isPhase2Message as U, type V0 as V, isTerminalMessage as W, isV1 as X, knownMessageTypes as Y, messageTier as Z, node as _, type NodeOptions as a, policy as a0, policyFromRules as a1, propagatesToMeta as a2, resolveDescribeFields as a3, type NodeInspectorHook as a4, type NodeActions as b, type NodeFn as c, COMPLETE as d, type CleanupResult as e, DEFAULT_ACTOR as f, DIRTY as g, type DescribeDetail as h, type DescribeField as i, type DescribeNodeOutput as j, GuardDenied as k, type GuardDeniedDetails as l, type Messages as m, type NodeDescribeKind as n, type NodeGuard as o, type NodeSink as p, type NodeStatus as q, type NodeTransportOptions as r, type NodeVersionInfo as s, type PolicyAllow as t, type PolicyDeny as u, type PolicyRuleData as v, RESUME as w, type V1 as x, type VersioningLevel as y, type VersioningOptions as z };
|
|
@@ -616,57 +616,5 @@ type DescribeDetail = "minimal" | "standard" | "full";
|
|
|
616
616
|
type DescribeField = "type" | "status" | "value" | "deps" | "meta" | "v" | "guard" | "lastMutation" | `meta.${string}`;
|
|
617
617
|
/** Resolve which fields to include based on detail level or explicit field list. */
|
|
618
618
|
declare function resolveDescribeFields(detail?: DescribeDetail, fields?: readonly DescribeField[]): Set<string> | null;
|
|
619
|
-
/**
|
|
620
|
-
* Reads the current cached value of every companion meta field on a node,
|
|
621
|
-
* suitable for merging into `describe()`-style JSON (GRAPHREFLY-SPEC §2.3, §3.6).
|
|
622
|
-
*
|
|
623
|
-
* @remarks
|
|
624
|
-
* Values come from {@link Node.get}, which returns the **last settled** cache.
|
|
625
|
-
* If a meta field is in `"dirty"` status (DIRTY received, DATA pending), the
|
|
626
|
-
* snapshot contains the *previous* value — check `node.meta[key].status` when
|
|
627
|
-
* freshness matters. Avoid calling mid-batch for the same reason.
|
|
628
|
-
*
|
|
629
|
-
* Meta nodes are **not** terminated when their parent receives COMPLETE or
|
|
630
|
-
* ERROR — they remain writable so callers can record post-mortem metadata
|
|
631
|
-
* (e.g. `meta.error`). They *are* torn down when the parent receives TEARDOWN.
|
|
632
|
-
*
|
|
633
|
-
* @param node - The node whose meta fields to snapshot.
|
|
634
|
-
* @returns Plain object of `{ key: value }` pairs (empty if no meta defined).
|
|
635
|
-
* Keys whose companion node's {@link Node.get} throws are omitted.
|
|
636
|
-
*
|
|
637
|
-
* @example
|
|
638
|
-
* ```ts
|
|
639
|
-
* import { core } from "@graphrefly/graphrefly-ts";
|
|
640
|
-
*
|
|
641
|
-
* const n = core.node({ initial: 0, meta: { tag: "a" } });
|
|
642
|
-
* core.metaSnapshot(n); // { tag: "a" }
|
|
643
|
-
* ```
|
|
644
|
-
*/
|
|
645
|
-
declare function metaSnapshot(node: Node): Record<string, unknown>;
|
|
646
|
-
/**
|
|
647
|
-
* Builds a single-node slice of `Graph.describe()` JSON (structure + `meta` snapshot).
|
|
648
|
-
* Parity with graphrefly-py `describe_node`.
|
|
649
|
-
*
|
|
650
|
-
* `type` is inferred from factory configuration, optional `describeKind` in node options,
|
|
651
|
-
* and the last `manualEmitUsed` hint (operator vs derived). {@link effect} sets
|
|
652
|
-
* `describeKind: "effect"`. Nodes not created by {@link node} fall back to `type: "state"` and empty `deps`.
|
|
653
|
-
*
|
|
654
|
-
* @param node - Any `Node` to introspect.
|
|
655
|
-
* @returns `DescribeNodeOutput` suitable for merging into graph describe maps.
|
|
656
|
-
*
|
|
657
|
-
* @example
|
|
658
|
-
* ```ts
|
|
659
|
-
* import { describeNode, state } from "@graphrefly/graphrefly-ts";
|
|
660
|
-
*
|
|
661
|
-
* describeNode(state(0));
|
|
662
|
-
* ```
|
|
663
|
-
*/
|
|
664
|
-
/**
|
|
665
|
-
* Builds a single-node slice for `Graph.describe()`.
|
|
666
|
-
*
|
|
667
|
-
* @param node - Node to introspect.
|
|
668
|
-
* @param includeFields - Set of fields to include, or `null` for all. When omitted, all fields are included (legacy behavior).
|
|
669
|
-
*/
|
|
670
|
-
declare function describeNode(node: Node, includeFields?: Set<string> | null): DescribeNodeOutput;
|
|
671
619
|
|
|
672
|
-
export {
|
|
620
|
+
export { normalizeActor as $, type Actor as A, accessHintForGuard as B, CLEANUP_RESULT as C, DATA as D, ERROR as E, advanceVersion as F, type GuardAction as G, type HashFn as H, INVALIDATE as I, cleanupResult as J, createVersioning as K, defaultHash as L, type Message as M, type Node as N, type OnMessageHandler as O, PAUSE as P, isKnownMessageType as Q, RESOLVED as R, type SubscribeHints as S, TEARDOWN as T, isPhase2Message as U, type V0 as V, isTerminalMessage as W, isV1 as X, knownMessageTypes as Y, messageTier as Z, node as _, type NodeOptions as a, policy as a0, policyFromRules as a1, propagatesToMeta as a2, resolveDescribeFields as a3, type NodeInspectorHook as a4, type NodeActions as b, type NodeFn as c, COMPLETE as d, type CleanupResult as e, DEFAULT_ACTOR as f, DIRTY as g, type DescribeDetail as h, type DescribeField as i, type DescribeNodeOutput as j, GuardDenied as k, type GuardDeniedDetails as l, type Messages as m, type NodeDescribeKind as n, type NodeGuard as o, type NodeSink as p, type NodeStatus as q, type NodeTransportOptions as r, type NodeVersionInfo as s, type PolicyAllow as t, type PolicyDeny as u, type PolicyRuleData as v, RESUME as w, type V1 as x, type VersioningLevel as y, type VersioningOptions as z };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { N as Node, m as Messages } from './meta-npl5b97j.cjs';
|
|
3
|
+
|
|
4
|
+
/** Options for {@link toObservable}. */
|
|
5
|
+
type ToObservableOptions = {
|
|
6
|
+
/**
|
|
7
|
+
* When `true`, emit raw `Messages` batches instead of extracted `DATA` values.
|
|
8
|
+
* Terminal batches are still emitted as the final `next()` before the
|
|
9
|
+
* Observable signal (error/complete).
|
|
10
|
+
*/
|
|
11
|
+
raw?: boolean;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Bridge a `Node<T>` to an RxJS `Observable`.
|
|
15
|
+
*
|
|
16
|
+
* Default mode emits the node's value on each `DATA` message. Maps `ERROR` to
|
|
17
|
+
* `subscriber.error()` and `COMPLETE` to `subscriber.complete()`.
|
|
18
|
+
* Protocol-internal signals (DIRTY, RESOLVED, PAUSE, etc.) are skipped.
|
|
19
|
+
*
|
|
20
|
+
* With `{ raw: true }`, emits full `[[Type, Data?], ...]` message batches.
|
|
21
|
+
* The Observable terminates on ERROR or COMPLETE (the terminal batch is still
|
|
22
|
+
* emitted as the final `next()` before the Observable signal).
|
|
23
|
+
*
|
|
24
|
+
* For graph-level observation, use `toObservable(graph.resolve(path))` or
|
|
25
|
+
* subscribe to `graph.observe()` directly.
|
|
26
|
+
*
|
|
27
|
+
* Unsubscribing the Observable unsubscribes the node.
|
|
28
|
+
*/
|
|
29
|
+
declare function toObservable<T>(node: Node<T>, options?: ToObservableOptions & {
|
|
30
|
+
raw?: false;
|
|
31
|
+
}): Observable<T>;
|
|
32
|
+
declare function toObservable<T>(node: Node<T>, options: ToObservableOptions & {
|
|
33
|
+
raw: true;
|
|
34
|
+
}): Observable<Messages>;
|
|
35
|
+
|
|
36
|
+
export { type ToObservableOptions as T, toObservable as t };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { N as Node, m as Messages } from './meta-npl5b97j.js';
|
|
3
|
+
|
|
4
|
+
/** Options for {@link toObservable}. */
|
|
5
|
+
type ToObservableOptions = {
|
|
6
|
+
/**
|
|
7
|
+
* When `true`, emit raw `Messages` batches instead of extracted `DATA` values.
|
|
8
|
+
* Terminal batches are still emitted as the final `next()` before the
|
|
9
|
+
* Observable signal (error/complete).
|
|
10
|
+
*/
|
|
11
|
+
raw?: boolean;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Bridge a `Node<T>` to an RxJS `Observable`.
|
|
15
|
+
*
|
|
16
|
+
* Default mode emits the node's value on each `DATA` message. Maps `ERROR` to
|
|
17
|
+
* `subscriber.error()` and `COMPLETE` to `subscriber.complete()`.
|
|
18
|
+
* Protocol-internal signals (DIRTY, RESOLVED, PAUSE, etc.) are skipped.
|
|
19
|
+
*
|
|
20
|
+
* With `{ raw: true }`, emits full `[[Type, Data?], ...]` message batches.
|
|
21
|
+
* The Observable terminates on ERROR or COMPLETE (the terminal batch is still
|
|
22
|
+
* emitted as the final `next()` before the Observable signal).
|
|
23
|
+
*
|
|
24
|
+
* For graph-level observation, use `toObservable(graph.resolve(path))` or
|
|
25
|
+
* subscribe to `graph.observe()` directly.
|
|
26
|
+
*
|
|
27
|
+
* Unsubscribing the Observable unsubscribes the node.
|
|
28
|
+
*/
|
|
29
|
+
declare function toObservable<T>(node: Node<T>, options?: ToObservableOptions & {
|
|
30
|
+
raw?: false;
|
|
31
|
+
}): Observable<T>;
|
|
32
|
+
declare function toObservable<T>(node: Node<T>, options: ToObservableOptions & {
|
|
33
|
+
raw: true;
|
|
34
|
+
}): Observable<Messages>;
|
|
35
|
+
|
|
36
|
+
export { type ToObservableOptions as T, toObservable as t };
|