@graphrefly/graphrefly 0.39.0 → 0.41.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/{cascading-g2_rhhaM.d.ts → cascading-BNfxffgc.d.ts} +1 -1
- package/dist/{cascading-BzuxW0_w.d.cts → cascading-Cxs1eztH.d.cts} +1 -1
- package/dist/chunk-2W553JJC.js +1 -0
- package/dist/{chunk-5LK7XMEV.js → chunk-33N4TU3X.js} +1 -1
- package/dist/chunk-4MKL6Q3K.js +1 -0
- package/dist/chunk-5B3JDG5F.js +1 -0
- package/dist/chunk-5QSXEMXG.js +1 -0
- package/dist/{chunk-R75BMDLA.js → chunk-5TEFC2ZX.js} +1 -1
- package/dist/chunk-5TOPVRN6.js +1 -0
- package/dist/{chunk-INHC33EH.js → chunk-5VEZLQFN.js} +1 -1
- package/dist/{chunk-NQI2C36M.js → chunk-7PQLZMOG.js} +1 -1
- package/dist/{chunk-7NZMZJMW.js → chunk-AI7QC7J6.js} +1 -1
- package/dist/{chunk-L7WY6TZS.js → chunk-AK5RHMC5.js} +1 -1
- package/dist/{chunk-ZOX3LBRV.js → chunk-CGNOWGV6.js} +1 -1
- package/dist/{chunk-INH6FS2G.js → chunk-CYOSWFT2.js} +1 -1
- package/dist/{chunk-GX5LSSRE.js → chunk-EC2WNSZ7.js} +1 -1
- package/dist/{chunk-HAWKGIXM.js → chunk-ELAASRBT.js} +1 -1
- package/dist/{chunk-7QFRK3N3.js → chunk-F7VUYPP6.js} +1 -1
- package/dist/{chunk-LQNOXGET.js → chunk-G3M3IMEV.js} +1 -1
- package/dist/{chunk-HX3EGQ5Z.js → chunk-GI4Q7PNY.js} +1 -1
- package/dist/{chunk-XQ55HO5N.js → chunk-H5SCWHWP.js} +1 -1
- package/dist/{chunk-CGDMTXSY.js → chunk-KNVCCBIU.js} +1 -1
- package/dist/{chunk-IA7DUNGB.js → chunk-L77I47VU.js} +1 -1
- package/dist/{chunk-JNMC2WJ6.js → chunk-M3FQSXEW.js} +1 -1
- package/dist/{chunk-D47YVDR5.js → chunk-OLIKJUKI.js} +1 -1
- package/dist/{chunk-SC7BQDNP.js → chunk-OV5AA6HJ.js} +1 -1
- package/dist/{chunk-7JRF5YEK.js → chunk-POXANAJ6.js} +1 -1
- package/dist/chunk-RSMEXK53.js +43 -0
- package/dist/{chunk-KD4NHLMU.js → chunk-SC27WTSG.js} +1 -1
- package/dist/chunk-TSOYJ743.js +1 -0
- package/dist/{chunk-AU7YTQX7.js → chunk-TT4C7DXW.js} +1 -1
- package/dist/{chunk-TFPZLQ5H.js → chunk-UISPDFJ3.js} +1 -1
- package/dist/{chunk-N7UIBZCW.js → chunk-URJ2VFNC.js} +1 -1
- package/dist/{chunk-GEAO3TL3.js → chunk-VV62MIG4.js} +1 -1
- package/dist/{chunk-VJJLIEAL.js → chunk-VXPLLA4P.js} +1 -1
- package/dist/{chunk-WHIZM6JV.js → chunk-WZYB3JQS.js} +1 -1
- package/dist/{chunk-S2U57TFC.js → chunk-X7QKTXXC.js} +1 -1
- package/dist/{chunk-7SD73DS6.js → chunk-YQRN4CIV.js} +1 -1
- package/dist/chunk-Z6X7B6A4.js +61 -0
- package/dist/{chunk-RF3QZP6D.js → chunk-ZAJ7J7TO.js} +1 -1
- package/dist/compat/index.d.cts +6 -6
- package/dist/compat/index.d.ts +6 -6
- package/dist/compat/index.js +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 +1 -1
- package/dist/compat/zustand/index.d.cts +2 -2
- package/dist/compat/zustand/index.d.ts +2 -2
- package/dist/compat/zustand/index.js +1 -1
- package/dist/{composite-DGatA-JK.d.ts → decay-BnrlbxSv.d.ts} +38 -2
- package/dist/{composite-CKd0e2vz.d.cts → decay-C25AyNAj.d.cts} +38 -2
- package/dist/extra/index.cjs +15 -15
- package/dist/extra/index.d.cts +6 -6
- package/dist/extra/index.d.ts +6 -6
- package/dist/extra/index.js +1 -1
- package/dist/extra/node.js +1 -1
- package/dist/extra/operators.js +1 -1
- package/dist/extra/reactive.d.cts +1 -1
- package/dist/extra/reactive.d.ts +1 -1
- package/dist/extra/reactive.js +1 -1
- package/dist/extra/render/index.d.cts +1 -1
- package/dist/extra/render/index.d.ts +1 -1
- package/dist/extra/sources.cjs +1 -1
- package/dist/extra/sources.js +1 -1
- package/dist/graph/index.d.cts +3 -3
- package/dist/graph/index.d.ts +3 -3
- package/dist/graph/index.js +1 -1
- package/dist/{graph-30XSgtVX.d.ts → graph-BkIkog4h.d.ts} +1 -1
- package/dist/{graph-BUwMAxJI.d.cts → graph-E6likq7w.d.cts} +1 -1
- package/dist/{index-BXd6OMEy.d.ts → index-3k4Gg6-n.d.ts} +2 -2
- package/dist/{index-DszPlZzK.d.ts → index-40ZT4MHj.d.ts} +1 -1
- package/dist/index-8s-Qm-gz.d.ts +218 -0
- package/dist/{index-K-vl_c6A.d.cts → index-A3U3CSve.d.cts} +1 -1
- package/dist/{index-jKLph6cu.d.ts → index-B6iTqKtJ.d.ts} +1 -1
- package/dist/{index-WyFKER-c.d.ts → index-B72TQQHd.d.cts} +3 -3
- package/dist/{index-CmqiJZKM.d.ts → index-BAQrjuZF.d.ts} +64 -6
- package/dist/{index-CusEP3Sv.d.ts → index-BQ1fR4li.d.ts} +1 -1
- package/dist/{index-jr6PuSBt.d.ts → index-BaA-xpSw.d.ts} +2 -2
- package/dist/{index-FVoPvhAu.d.cts → index-Bd91Nmf4.d.cts} +2 -2
- package/dist/{index-PqbnoScQ.d.ts → index-BgjS2b8N.d.ts} +2 -2
- package/dist/{index-DCbE8fFM.d.cts → index-BiHUBEKq.d.cts} +2 -2
- package/dist/{index-DlgHqQxW.d.cts → index-BilOa6AE.d.cts} +6 -32
- package/dist/{index-DoYc8BWK.d.cts → index-BmSQLAZo.d.cts} +2 -2
- package/dist/{index-DlrWu9Hs.d.cts → index-C-dkXOpB.d.cts} +1 -1
- package/dist/{index-C7VV_qOs.d.ts → index-C5cQ7Gfx.d.ts} +2 -2
- package/dist/{index-CPhBvRJU.d.ts → index-C6ZUaos7.d.ts} +1 -1
- package/dist/{index-PlJ3MraE.d.ts → index-CAP3UGsq.d.ts} +1 -1
- package/dist/{index-B41Asm7D.d.ts → index-CD2dBMet.d.ts} +2 -2
- package/dist/{index-C19qqa38.d.ts → index-CG33HeBW.d.ts} +19 -4
- package/dist/index-CGhMJNHb.d.cts +128 -0
- package/dist/{index-BAlaVimV.d.ts → index-CQtWm7jS.d.ts} +2 -2
- package/dist/{index-8R1vzNOx.d.cts → index-CRm0YIzC.d.cts} +2 -2
- package/dist/index-CUIkE1l9.d.cts +230 -0
- package/dist/{index-KlZ_ZUip.d.cts → index-Cczxgd2D.d.ts} +3 -3
- package/dist/{index-DIHcMLr6.d.cts → index-CgnCFhr2.d.cts} +1 -1
- package/dist/{index-BC9VybQs.d.ts → index-Ck35nA-T.d.ts} +2 -2
- package/dist/{index-BndG0cpK.d.cts → index-Cnr1WrlX.d.cts} +1 -1
- package/dist/{index-H_I66pav.d.cts → index-CtFNGe-m.d.cts} +2 -2
- package/dist/index-CuPUehFa.d.cts +218 -0
- package/dist/index-D1Gc7wV5.d.ts +230 -0
- package/dist/{index-CWHtYmSh.d.cts → index-D4uimgee.d.cts} +1 -1
- package/dist/{index-xZYcDqFH.d.cts → index-DGD4_fj6.d.cts} +19 -4
- package/dist/{index-CwP_KAMS.d.cts → index-DGTo1yka.d.cts} +64 -6
- package/dist/{index-BUPVld1w.d.ts → index-DH4fm2Ck.d.ts} +2 -2
- package/dist/{index-DyM4tFAe.d.cts → index-DQQCOIt8.d.cts} +2 -2
- package/dist/{index-BJ26eEjs.d.cts → index-DVAlsmEU.d.cts} +2 -2
- package/dist/{index-DINuaZlJ.d.cts → index-DVDapw2k.d.cts} +1 -1
- package/dist/{index-iTX5IqSP.d.ts → index-DfOK_oL5.d.ts} +208 -203
- package/dist/{index-DTtBpuQy.d.cts → index-DgJc8Zgc.d.cts} +5 -3
- package/dist/{index-BKMdnYnk.d.ts → index-DhLyOHYZ.d.ts} +1 -1
- package/dist/{index-89FczVZ_.d.ts → index-DhnsQfa3.d.ts} +77 -51
- package/dist/{index-L8XI8Zql.d.cts → index-DktLSZOc.d.cts} +2 -2
- package/dist/{index-pVDQcbar.d.cts → index-DpiGqtrs.d.cts} +77 -51
- package/dist/{index-mNwgxC21.d.cts → index-DuRsN9ae.d.cts} +208 -203
- package/dist/{index-B9fmw5n2.d.ts → index-I1cCY3ZI.d.ts} +5 -3
- package/dist/index-N2MAxt7_.d.ts +128 -0
- package/dist/{index-Br3WnqEn.d.ts → index-WSlcjhQF.d.ts} +6 -32
- package/dist/{index-DQUVq1_d.d.ts → index-bXXLSvor.d.ts} +2 -2
- package/dist/{index-BhUaMYm_.d.ts → index-da2V5vPy.d.ts} +1 -1
- package/dist/{index-PsVHpPwP.d.cts → index-t6L2qpHh.d.cts} +2 -2
- package/dist/{index-IwFqHxCs.d.cts → index-tV3AA9hI.d.cts} +1 -1
- package/dist/index.cjs +48 -48
- package/dist/index.d.cts +33 -33
- package/dist/index.d.ts +33 -33
- package/dist/index.js +1 -1
- package/dist/patterns/ai/browser.cjs +5 -5
- package/dist/patterns/ai/browser.d.cts +2 -2
- package/dist/patterns/ai/browser.d.ts +2 -2
- package/dist/patterns/ai/browser.js +1 -1
- package/dist/patterns/ai/index.cjs +14 -14
- package/dist/patterns/ai/index.d.cts +11 -11
- package/dist/patterns/ai/index.d.ts +11 -11
- package/dist/patterns/ai/index.js +1 -1
- package/dist/patterns/ai/node.js +1 -1
- package/dist/patterns/audit/index.d.cts +3 -3
- package/dist/patterns/audit/index.d.ts +3 -3
- package/dist/patterns/audit/index.js +1 -1
- package/dist/patterns/cqrs/index.d.cts +3 -3
- package/dist/patterns/cqrs/index.d.ts +3 -3
- package/dist/patterns/cqrs/index.js +1 -1
- package/dist/patterns/demo-shell/index.d.cts +3 -3
- package/dist/patterns/demo-shell/index.d.ts +3 -3
- package/dist/patterns/demo-shell/index.js +1 -1
- package/dist/patterns/domain-templates/index.d.cts +2 -2
- package/dist/patterns/domain-templates/index.d.ts +2 -2
- package/dist/patterns/domain-templates/index.js +1 -1
- package/dist/patterns/graphspec/index.d.cts +2 -2
- package/dist/patterns/graphspec/index.d.ts +2 -2
- package/dist/patterns/graphspec/index.js +1 -1
- package/dist/patterns/guarded-execution/index.cjs +3 -3
- package/dist/patterns/guarded-execution/index.d.cts +4 -4
- package/dist/patterns/guarded-execution/index.d.ts +4 -4
- package/dist/patterns/guarded-execution/index.js +1 -1
- package/dist/patterns/harness/index.cjs +8 -8
- package/dist/patterns/harness/index.d.cts +7 -7
- package/dist/patterns/harness/index.d.ts +7 -7
- package/dist/patterns/harness/index.js +1 -1
- package/dist/patterns/job-queue/index.cjs +3 -3
- package/dist/patterns/job-queue/index.d.cts +3 -3
- package/dist/patterns/job-queue/index.d.ts +3 -3
- package/dist/patterns/job-queue/index.js +1 -1
- package/dist/patterns/lens/index.cjs +3 -3
- package/dist/patterns/lens/index.d.cts +3 -4
- package/dist/patterns/lens/index.d.ts +3 -4
- package/dist/patterns/lens/index.js +1 -1
- package/dist/patterns/memory/index.cjs +1 -1
- package/dist/patterns/memory/index.d.cts +3 -3
- package/dist/patterns/memory/index.d.ts +3 -3
- package/dist/patterns/memory/index.js +1 -1
- package/dist/patterns/messaging/index.d.cts +2 -2
- package/dist/patterns/messaging/index.d.ts +2 -2
- package/dist/patterns/messaging/index.js +1 -1
- package/dist/patterns/orchestration/index.d.cts +3 -3
- package/dist/patterns/orchestration/index.d.ts +3 -3
- package/dist/patterns/orchestration/index.js +1 -1
- package/dist/patterns/process/index.d.cts +4 -4
- package/dist/patterns/process/index.d.ts +4 -4
- package/dist/patterns/process/index.js +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 +1 -1
- package/dist/patterns/reduction/index.d.cts +2 -2
- package/dist/patterns/reduction/index.d.ts +2 -2
- package/dist/patterns/reduction/index.js +1 -1
- package/dist/patterns/refine-loop/index.d.cts +3 -3
- package/dist/patterns/refine-loop/index.d.ts +3 -3
- package/dist/patterns/refine-loop/index.js +1 -1
- package/dist/patterns/resilient-pipeline/index.cjs +3 -1
- package/dist/patterns/resilient-pipeline/index.d.cts +7 -3
- package/dist/patterns/resilient-pipeline/index.d.ts +7 -3
- package/dist/patterns/resilient-pipeline/index.js +1 -1
- package/dist/patterns/surface/index.d.cts +3 -3
- package/dist/patterns/surface/index.d.ts +3 -3
- package/dist/patterns/surface/index.js +1 -1
- package/dist/{pipeline-graph-D8vKcO_p.d.ts → pipeline-graph-CB4La-UW.d.ts} +2 -2
- package/dist/{pipeline-graph-BQPr2Lqs.d.cts → pipeline-graph-MWrQZXCq.d.cts} +2 -2
- package/dist/{reactive-layout-8CSc0tiA.d.cts → reactive-layout-BtZfUKuL.d.cts} +1 -1
- package/dist/{reactive-layout-DkTXxtSy.d.ts → reactive-layout-KJj4E2dT.d.ts} +1 -1
- package/dist/{reactive-map-B2qfD3hb.d.cts → reactive-map-6P_k3AQM.d.cts} +1 -1
- package/dist/{reactive-map-jFIsE6Kt.d.ts → reactive-map-CjXByDV-.d.ts} +1 -1
- package/dist/{resilience-HTF2LBRS.js → resilience-JISHQD2F.js} +1 -1
- package/dist/{topology-tree-B5Ngw3j0.d.cts → topology-tree-3LBKFsUo.d.cts} +1 -1
- package/dist/{topology-tree-BtvbgMXJ.d.ts → topology-tree-mF7Emqzm.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-5XRI6RM3.js +0 -1
- package/dist/chunk-73PBQNST.js +0 -1
- package/dist/chunk-A6ZSKGUG.js +0 -1
- package/dist/chunk-EWF7KCDJ.js +0 -61
- package/dist/chunk-IUB4NYI2.js +0 -1
- package/dist/chunk-MC4UYY2X.js +0 -1
- package/dist/chunk-XEUANKBO.js +0 -43
- package/dist/chunk-ZJ7SM3G2.js +0 -1
- package/dist/index-BEHmxORq.d.ts +0 -135
- package/dist/index-BM9szD8n.d.cts +0 -113
- package/dist/index-BskfDoZ_.d.ts +0 -113
- package/dist/index-CIRG8Hxp.d.cts +0 -135
- package/dist/index-Cey6VTnX.d.ts +0 -166
- package/dist/index-CpLpJb6A.d.cts +0 -166
package/dist/index-BskfDoZ_.d.ts
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { N as Node } from './node-BYInONRr.js';
|
|
2
|
-
import { S as StatusValue, C as CircuitState, R as RateLimiterOptions, a as CircuitBreakerOptions, b as RetryOptions, F as FallbackInput, N as NS_PER_MS, c as NS_PER_SEC } from './index-CmqiJZKM.js';
|
|
3
|
-
import { B as BudgetConstraint } from './budget-gate-CmmVtasH.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Resilience composition with correct nesting order (roadmap §9.0b).
|
|
7
|
-
*
|
|
8
|
-
* {@link resilientPipeline} composes the resilience primitives from
|
|
9
|
-
* `extra/resilience.ts` in the order discovered during the §9.1 eval runs:
|
|
10
|
-
*
|
|
11
|
-
* ```text
|
|
12
|
-
* rateLimit → budget → breaker → timeout → retry → fallback → status
|
|
13
|
-
* ```
|
|
14
|
-
*
|
|
15
|
-
* Note on retry/timeout ordering: `timeout` is applied BEFORE `retry` so each
|
|
16
|
-
* retry attempt resubscribes to a fresh deadline (per-attempt semantics). If
|
|
17
|
-
* `timeout` wrapped `retry`, a single deadline would apply to the entire
|
|
18
|
-
* retry chain — not what callers expect.
|
|
19
|
-
*
|
|
20
|
-
* Every step is optional — omit the option and that layer is skipped. The
|
|
21
|
-
* returned bundle exposes the final `Node<T>` plus the status/error/breaker
|
|
22
|
-
* companions so callers can wire them into dashboards, alerts, or
|
|
23
|
-
* {@link graphLens}.
|
|
24
|
-
*
|
|
25
|
-
* Subsumes the pre-1.0 `resilientFetch` template — that template becomes a
|
|
26
|
-
* preconfigured instance of this factory for the HTTP fetch case.
|
|
27
|
-
*
|
|
28
|
-
* @module
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
/** Options for {@link resilientPipeline}. Every field is optional — omit to skip that layer. */
|
|
32
|
-
interface ResilientPipelineOptions<T> {
|
|
33
|
-
/**
|
|
34
|
-
* Admission control — at most `maxEvents` DATA per `windowNs`. See {@link rateLimiter}.
|
|
35
|
-
*
|
|
36
|
-
* `maxBuffer` is optional at the pipeline layer (defaults to `Infinity`, preserving
|
|
37
|
-
* the historical unbounded behavior). Pass an explicit positive integer to opt in to
|
|
38
|
-
* a bounded queue. Tier 5.2 will surface backpressure-policy options to callers.
|
|
39
|
-
*/
|
|
40
|
-
rateLimit?: Omit<RateLimiterOptions, "maxBuffer"> & {
|
|
41
|
-
maxBuffer?: number;
|
|
42
|
-
};
|
|
43
|
-
/** Cost/constraint gate. See {@link budgetGate}. */
|
|
44
|
-
budget?: ReadonlyArray<BudgetConstraint>;
|
|
45
|
-
/** Circuit breaker — fail-fast when the downstream resource is unhealthy. See {@link circuitBreaker}. */
|
|
46
|
-
breaker?: CircuitBreakerOptions;
|
|
47
|
-
/**
|
|
48
|
-
* Behavior when the breaker is open:
|
|
49
|
-
* - `"skip"` — emit RESOLVED (default, lets downstream drop the beat)
|
|
50
|
-
* - `"error"` — emit a `CircuitOpenError` so `retry`/`fallback` can react
|
|
51
|
-
*
|
|
52
|
-
* Only used when `breaker` is provided.
|
|
53
|
-
*/
|
|
54
|
-
breakerOnOpen?: "skip" | "error";
|
|
55
|
-
/** Retry policy on terminal ERROR. See {@link retry}. */
|
|
56
|
-
retry?: RetryOptions;
|
|
57
|
-
/**
|
|
58
|
-
* Per-attempt deadline in milliseconds. Converted to ns internally. Omit to skip the timeout wrap.
|
|
59
|
-
*
|
|
60
|
-
* Specified in ms (not ns) because callers consistently think in millisecond deadlines;
|
|
61
|
-
* retry/breaker/ratelimit options take ns to match their primitives exactly.
|
|
62
|
-
*/
|
|
63
|
-
timeoutMs?: number;
|
|
64
|
-
/** Final fallback value emitted on terminal ERROR after retry exhausts. See {@link fallback}. */
|
|
65
|
-
fallback?: FallbackInput<T>;
|
|
66
|
-
/** Initial status reported by the status node. Default `"pending"`. */
|
|
67
|
-
initialStatus?: StatusValue;
|
|
68
|
-
}
|
|
69
|
-
/** Output bundle of {@link resilientPipeline}. */
|
|
70
|
-
interface ResilientPipelineBundle<T> {
|
|
71
|
-
/** The final resilient node. Subscribe to this for DATA emissions. */
|
|
72
|
-
node: Node<T>;
|
|
73
|
-
/** Live status: `"pending" | "running" | "completed" | "errored"`. */
|
|
74
|
-
status: Node<StatusValue>;
|
|
75
|
-
/** Last error payload, or `null` when not errored. */
|
|
76
|
-
error: Node<unknown | null>;
|
|
77
|
-
/** Breaker state when `opts.breaker` was provided; `undefined` otherwise. */
|
|
78
|
-
breakerState: Node<CircuitState> | undefined;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Compose a resilient pipeline around `source` in the canonical nesting
|
|
82
|
-
* order — `rateLimit → budget → breaker → timeout → retry → fallback → status`.
|
|
83
|
-
* Omit any option to skip that layer.
|
|
84
|
-
*
|
|
85
|
-
* @param source - Upstream node to wrap.
|
|
86
|
-
* @param opts - See {@link ResilientPipelineOptions}. All fields optional.
|
|
87
|
-
*
|
|
88
|
-
* @example
|
|
89
|
-
* ```ts
|
|
90
|
-
* const safeFetch = resilientPipeline(fetchNode, {
|
|
91
|
-
* rateLimit: { maxEvents: 10, windowNs: NS_PER_SEC },
|
|
92
|
-
* breaker: { failureThreshold: 5 },
|
|
93
|
-
* retry: { count: 3, backoff: "exponential" },
|
|
94
|
-
* timeoutMs: 10_000,
|
|
95
|
-
* fallback: null,
|
|
96
|
-
* });
|
|
97
|
-
* safeFetch.status.subscribe(msgs => console.log(msgs));
|
|
98
|
-
* ```
|
|
99
|
-
*
|
|
100
|
-
* @category patterns
|
|
101
|
-
*/
|
|
102
|
-
declare function resilientPipeline<T>(source: Node<T>, opts?: ResilientPipelineOptions<T>): ResilientPipelineBundle<T>;
|
|
103
|
-
|
|
104
|
-
declare const index_NS_PER_MS: typeof NS_PER_MS;
|
|
105
|
-
declare const index_NS_PER_SEC: typeof NS_PER_SEC;
|
|
106
|
-
type index_ResilientPipelineBundle<T> = ResilientPipelineBundle<T>;
|
|
107
|
-
type index_ResilientPipelineOptions<T> = ResilientPipelineOptions<T>;
|
|
108
|
-
declare const index_resilientPipeline: typeof resilientPipeline;
|
|
109
|
-
declare namespace index {
|
|
110
|
-
export { index_NS_PER_MS as NS_PER_MS, index_NS_PER_SEC as NS_PER_SEC, type index_ResilientPipelineBundle as ResilientPipelineBundle, type index_ResilientPipelineOptions as ResilientPipelineOptions, index_resilientPipeline as resilientPipeline };
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export { type ResilientPipelineBundle as R, type ResilientPipelineOptions as a, index as i, resilientPipeline as r };
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { P as PolicyRuleData, N as Node, A as Actor } from './node-BYInONRr.cjs';
|
|
2
|
-
import { G as Graph, a as GraphOptions, d as GraphDescribeOptions, b as GraphDescribeOutput, D as DescribeFilter } from './graph-BUwMAxJI.cjs';
|
|
3
|
-
import { P as PolicyGateGraph, a as PolicyViolation } from './index-DoYc8BWK.cjs';
|
|
4
|
-
import { T as TopicGraph } from './index-BndG0cpK.cjs';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Composable safety layer (roadmap §9.0b).
|
|
8
|
-
*
|
|
9
|
-
* {@link guardedExecution} wraps any {@link Graph} with:
|
|
10
|
-
*
|
|
11
|
-
* - {@link policyGate} — reactive ABAC (Tier 2.3 rename of `policyEnforcer`),
|
|
12
|
-
* policies stored as a `Node` so LLMs / humans can update them at runtime.
|
|
13
|
-
* Now with full transitive dynamic coverage via `watchTopologyTree`.
|
|
14
|
-
* - Scoped {@link GuardedExecutionGraph.scopedDescribe} — delegates to
|
|
15
|
-
* `target.describe({actor})` so callers see only what the actor is
|
|
16
|
-
* allowed to see.
|
|
17
|
-
* - The enforcer's `violations` topic is republished as `violations` on
|
|
18
|
-
* the wrapper, composable with {@link graphLens}.`health` alerts.
|
|
19
|
-
*
|
|
20
|
-
* V1 scope: policies + actor + scoped describe. Budget-as-option is NOT
|
|
21
|
-
* in V1 — it requires a cost-tracking design that hasn't landed yet.
|
|
22
|
-
* Callers who need a budget limit today append a budget-aware
|
|
23
|
-
* {@link PolicyRuleData} to the policies list (check current cost and
|
|
24
|
-
* `deny` when exhausted).
|
|
25
|
-
*
|
|
26
|
-
* @module
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
/** Options for {@link guardedExecution}. */
|
|
30
|
-
interface GuardedExecutionOptions {
|
|
31
|
-
/**
|
|
32
|
-
* Policies enforced against every guarded write. Static list or a live
|
|
33
|
-
* `Node<readonly PolicyRuleData[]>` (LLM-updatable).
|
|
34
|
-
*
|
|
35
|
-
* **Deny-by-default gotcha:** the underlying `policyFromRules()` denies any
|
|
36
|
-
* action that matches no rule. An empty policies list in `mode: "enforce"`
|
|
37
|
-
* therefore blocks EVERY write AND every `observe` through the stacked
|
|
38
|
-
* guard — including `scopedDescribe()`. If you want a permissive base, add
|
|
39
|
-
* at least `{ effect: "allow", action: "*" }` and layer deny rules on top.
|
|
40
|
-
* In `mode: "audit"` no guards are stacked, so empty policies are safe.
|
|
41
|
-
*/
|
|
42
|
-
policies: readonly PolicyRuleData[] | Node<readonly PolicyRuleData[]>;
|
|
43
|
-
/**
|
|
44
|
-
* Actor whose perspective drives {@link GuardedExecutionGraph.scopedDescribe}
|
|
45
|
-
* and {@link GuardedExecutionGraph.describe} — when omitted, callers must
|
|
46
|
-
* pass `{actor}` explicitly or they get the target's raw describe.
|
|
47
|
-
*/
|
|
48
|
-
actor?: Actor;
|
|
49
|
-
/**
|
|
50
|
-
* `"enforce"` (default) — push guards onto target nodes so disallowed
|
|
51
|
-
* writes throw {@link GuardDenied}.
|
|
52
|
-
* `"audit"` — record would-be denials to the `violations` topic without
|
|
53
|
-
* blocking writes.
|
|
54
|
-
*/
|
|
55
|
-
mode?: "audit" | "enforce";
|
|
56
|
-
/** Ring-buffer cap for the `violations` topic. Default 1000 (inherited from policyGate). */
|
|
57
|
-
violationsLimit?: number;
|
|
58
|
-
/** Wrapper graph name. Default `${target.name}_guarded`. */
|
|
59
|
-
name?: string;
|
|
60
|
-
/** Wrapper graph options. */
|
|
61
|
-
graph?: GraphOptions;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Wrapper over a target {@link Graph} providing reactive ABAC + scoped
|
|
65
|
-
* describe. Mounts a {@link PolicyGateGraph} under `enforcer`.
|
|
66
|
-
*
|
|
67
|
-
* @category patterns
|
|
68
|
-
*/
|
|
69
|
-
declare class GuardedExecutionGraph extends Graph {
|
|
70
|
-
readonly enforcer: PolicyGateGraph;
|
|
71
|
-
readonly violations: TopicGraph<PolicyViolation>;
|
|
72
|
-
private readonly _target;
|
|
73
|
-
private readonly _defaultActor;
|
|
74
|
-
constructor(target: Graph, opts: GuardedExecutionOptions);
|
|
75
|
-
/**
|
|
76
|
-
* Describe the **target** graph scoped to the configured actor. Returns
|
|
77
|
-
* only nodes the actor is permitted to see (via the target's node guards
|
|
78
|
-
* filtering `describe()` via `actor`).
|
|
79
|
-
*
|
|
80
|
-
* Pass `{actor}` in opts to override the configured actor for this call.
|
|
81
|
-
* Pass any standard {@link GraphDescribeOptions} fields (`detail`,
|
|
82
|
-
* `fields`, `filter`) — they apply to the target's describe.
|
|
83
|
-
*
|
|
84
|
-
* **Mode interaction:**
|
|
85
|
-
* - In `mode: "enforce"` (default), the enforcer stacks a policy-derived
|
|
86
|
-
* guard on every target node. `scopedDescribe({actor})` then filters by
|
|
87
|
-
* the AND of per-node guards AND the stacked policy guard.
|
|
88
|
-
* - In `mode: "audit"`, NO guards are stacked — `scopedDescribe` filters
|
|
89
|
-
* purely by the target's pre-existing per-node guards. If a target has
|
|
90
|
-
* no node-level guards, the policy rules you pass have no effect on
|
|
91
|
-
* visibility (they only populate the `violations` topic on writes).
|
|
92
|
-
*/
|
|
93
|
-
scopedDescribe(opts?: Omit<GraphDescribeOptions, "actor"> & {
|
|
94
|
-
actor?: Actor;
|
|
95
|
-
}): GraphDescribeOutput;
|
|
96
|
-
/** The wrapped graph (escape hatch for tooling). */
|
|
97
|
-
get target(): Graph;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Wrap a {@link Graph} with {@link policyGate} plus a scoped describe
|
|
101
|
-
* lens. Returns a {@link GuardedExecutionGraph} that can be mounted, diffed,
|
|
102
|
-
* or composed with {@link graphLens}.
|
|
103
|
-
*
|
|
104
|
-
* @param target - The graph to guard.
|
|
105
|
-
* @param opts - See {@link GuardedExecutionOptions}.
|
|
106
|
-
*
|
|
107
|
-
* @example
|
|
108
|
-
* ```ts
|
|
109
|
-
* const guarded = guardedExecution(app, {
|
|
110
|
-
* actor: { type: "human", id: "alice" },
|
|
111
|
-
* policies: [
|
|
112
|
-
* { effect: "allow", action: "read", actorType: "human" },
|
|
113
|
-
* { effect: "deny", action: "write", pathPattern: "system::*" },
|
|
114
|
-
* ],
|
|
115
|
-
* mode: "enforce",
|
|
116
|
-
* });
|
|
117
|
-
*
|
|
118
|
-
* const view = guarded.scopedDescribe({ detail: "standard" });
|
|
119
|
-
* guarded.violations.events.subscribe(msgs => console.log("violations:", msgs));
|
|
120
|
-
* ```
|
|
121
|
-
*
|
|
122
|
-
* @category patterns
|
|
123
|
-
*/
|
|
124
|
-
declare function guardedExecution(target: Graph, opts: GuardedExecutionOptions): GuardedExecutionGraph;
|
|
125
|
-
|
|
126
|
-
declare const index_DescribeFilter: typeof DescribeFilter;
|
|
127
|
-
type index_GuardedExecutionGraph = GuardedExecutionGraph;
|
|
128
|
-
declare const index_GuardedExecutionGraph: typeof GuardedExecutionGraph;
|
|
129
|
-
type index_GuardedExecutionOptions = GuardedExecutionOptions;
|
|
130
|
-
declare const index_guardedExecution: typeof guardedExecution;
|
|
131
|
-
declare namespace index {
|
|
132
|
-
export { index_DescribeFilter as DescribeFilter, index_GuardedExecutionGraph as GuardedExecutionGraph, type index_GuardedExecutionOptions as GuardedExecutionOptions, index_guardedExecution as guardedExecution };
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export { GuardedExecutionGraph as G, type GuardedExecutionOptions as a, guardedExecution as g, index as i };
|
package/dist/index-Cey6VTnX.d.ts
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { N as Node } from './node-BYInONRr.js';
|
|
2
|
-
import { R as ReactiveMapBundle } from './reactive-map-jFIsE6Kt.js';
|
|
3
|
-
import { a as GraphOptions, G as Graph, C as CausalChain } from './graph-30XSgtVX.js';
|
|
4
|
-
import { w as watchTopologyTree } from './topology-tree-BtvbgMXJ.js';
|
|
5
|
-
|
|
6
|
-
/** Aggregate topology stats emitted by {@link LensGraph.stats}. */
|
|
7
|
-
interface TopologyStats {
|
|
8
|
-
/** Total primary nodes across this graph and all transitively mounted subgraphs. */
|
|
9
|
-
nodeCount: number;
|
|
10
|
-
/** Total directed edges (derived from deps; no duplicates). */
|
|
11
|
-
edgeCount: number;
|
|
12
|
-
/** Count of mounted subgraphs (transitive). */
|
|
13
|
-
subgraphCount: number;
|
|
14
|
-
/** Qualified paths with no upstream deps (source nodes). Sorted. */
|
|
15
|
-
sources: readonly string[];
|
|
16
|
-
/** Qualified paths with no downstream consumers in-graph (sink nodes). Sorted. */
|
|
17
|
-
sinks: readonly string[];
|
|
18
|
-
/** Longest path from any source to any sink (in edges). `0` for empty graphs. */
|
|
19
|
-
depth: number;
|
|
20
|
-
/** `true` if the dep DAG contains a cycle (feedback edge). */
|
|
21
|
-
hasCycles: boolean;
|
|
22
|
-
}
|
|
23
|
-
/** A single health problem entry. */
|
|
24
|
-
interface HealthProblem {
|
|
25
|
-
path: string;
|
|
26
|
-
/** V1 only reports `"errored"`. Future versions may add `"completed"`, `"disconnected"`. */
|
|
27
|
-
status: "errored";
|
|
28
|
-
/** First errored upstream ancestor along the dep chain, when one exists and is distinct from `path`. */
|
|
29
|
-
upstreamCause?: string;
|
|
30
|
-
}
|
|
31
|
-
/** Aggregate health snapshot. `ok=true` iff `problems.length === 0`. */
|
|
32
|
-
interface HealthReport {
|
|
33
|
-
ok: boolean;
|
|
34
|
-
problems: readonly HealthProblem[];
|
|
35
|
-
}
|
|
36
|
-
/** One per-path flow entry stored in {@link LensGraph.flow}. */
|
|
37
|
-
interface FlowEntry {
|
|
38
|
-
path: string;
|
|
39
|
-
/** Cumulative DATA emissions observed since the lens activated. */
|
|
40
|
-
count: number;
|
|
41
|
-
/** `monotonicNs()` at the most recent DATA emission, or `null` if none yet. */
|
|
42
|
-
lastUpdate_ns: number | null;
|
|
43
|
-
}
|
|
44
|
-
/** Options for {@link graphLens}. */
|
|
45
|
-
interface GraphLensOptions {
|
|
46
|
-
name?: string;
|
|
47
|
-
graph?: GraphOptions;
|
|
48
|
-
/**
|
|
49
|
-
* Limit which node paths `flow` tracks. When omitted, every path in
|
|
50
|
-
* `target.describe()` is observed. Recommended for graphs with hundreds
|
|
51
|
-
* of nodes since each tracked path adds one observe-event dispatch per
|
|
52
|
-
* DATA emission.
|
|
53
|
-
*/
|
|
54
|
-
pathFilter?: (path: string) => boolean;
|
|
55
|
-
/**
|
|
56
|
-
* LRU cap on the {@link LensGraph.flow} map. When set, the flow tracker
|
|
57
|
-
* evicts least-recently-used paths (by insertion / set order) once the
|
|
58
|
-
* entry count exceeds this bound. Omit for unbounded (not recommended
|
|
59
|
-
* for long-running graphs with churning paths). Passed through to the
|
|
60
|
-
* underlying {@link reactiveMap}'s `maxSize`.
|
|
61
|
-
*/
|
|
62
|
-
maxFlowPaths?: number;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Reactive observability surface for a target {@link Graph}.
|
|
66
|
-
* See {@link graphLens}.
|
|
67
|
-
*
|
|
68
|
-
* @category observability
|
|
69
|
-
*/
|
|
70
|
-
declare class LensGraph extends Graph {
|
|
71
|
-
/**
|
|
72
|
-
* Aggregate structural stats — `nodeCount`, `edgeCount`, `sources`,
|
|
73
|
-
* `sinks`, `depth`, `hasCycles`, `subgraphCount`. Recomputes on every
|
|
74
|
-
* structural change via {@link watchTopologyTree} (transitive).
|
|
75
|
-
*
|
|
76
|
-
* Named `stats` (not `topology`) because `Graph.topology` already names
|
|
77
|
-
* the raw `TopologyEvent` stream on every graph including `LensGraph`;
|
|
78
|
-
* giving the lens its own `topology` accessor with an incompatible
|
|
79
|
-
* `Node<TopologyStats>` type would break Liskov substitutability.
|
|
80
|
-
*/
|
|
81
|
-
readonly stats: Node<TopologyStats>;
|
|
82
|
-
readonly health: Node<HealthReport>;
|
|
83
|
-
/**
|
|
84
|
-
* Per-path flow tracker — a live {@link ReactiveMapBundle} keyed by
|
|
85
|
-
* qualified path. Use `.get(path)` / `.has(path)` / `.size` for O(1)
|
|
86
|
-
* sync queries; subscribe to `.entries` for a reactive snapshot of the
|
|
87
|
-
* whole map. Lazy — the snapshot is materialized only while `.entries`
|
|
88
|
-
* has subscribers.
|
|
89
|
-
*
|
|
90
|
-
* Shape intentionally differs from `stats` / `health` (which are plain
|
|
91
|
-
* `Node<Report>`) because `flow` is a keyed collection, not a single
|
|
92
|
-
* aggregate value. The map shape exposes cheaper queries than any
|
|
93
|
-
* snapshot-based design.
|
|
94
|
-
*/
|
|
95
|
-
readonly flow: ReactiveMapBundle<string, FlowEntry>;
|
|
96
|
-
private readonly _target;
|
|
97
|
-
constructor(target: Graph, opts?: GraphLensOptions);
|
|
98
|
-
/**
|
|
99
|
-
* Live causal chain from `from` to `to`. Recomputes whenever the target
|
|
100
|
-
* mutates. Disposed automatically when the lens is destroyed.
|
|
101
|
-
*
|
|
102
|
-
* **Lifetime note:** every call to `why()` registers a lens-owned disposer
|
|
103
|
-
* that runs on `lens.destroy()`. The returned `dispose` function releases
|
|
104
|
-
* the internal subscription but does NOT remove the lens-owned disposer —
|
|
105
|
-
* so heavy calling (e.g. per render frame) accumulates no-op disposers
|
|
106
|
-
* until lens teardown. Cache the returned handle for long-lived queries.
|
|
107
|
-
*
|
|
108
|
-
* Tier 3.5: rebuilt on top of `graph.explain(from, to, { reactive: true })`
|
|
109
|
-
* after the deprecated `reactiveExplainPath` wrapper was deleted.
|
|
110
|
-
*
|
|
111
|
-
* @param from - Qualified path of the upstream endpoint.
|
|
112
|
-
* @param to - Qualified path of the downstream endpoint.
|
|
113
|
-
* @param opts - See {@link Graph.explain} (`{ reactive: true }` overload).
|
|
114
|
-
*/
|
|
115
|
-
why(from: string, to: string, opts?: {
|
|
116
|
-
maxDepth?: number;
|
|
117
|
-
name?: string;
|
|
118
|
-
findCycle?: boolean;
|
|
119
|
-
}): {
|
|
120
|
-
node: Node<CausalChain>;
|
|
121
|
-
dispose: () => void;
|
|
122
|
-
};
|
|
123
|
-
/** Reference to the lensed graph. */
|
|
124
|
-
get target(): Graph;
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Create a reactive observability lens over a {@link Graph}. Returns a
|
|
128
|
-
* {@link LensGraph} with three reactive surfaces (`stats`, `health`, `flow`)
|
|
129
|
-
* plus the `why(from, to)` method.
|
|
130
|
-
*
|
|
131
|
-
* The returned graph is detached. Mount it via `target.mount("lens", lens)`
|
|
132
|
-
* if you want it to appear in the target's `describe()`, or keep it standalone.
|
|
133
|
-
*
|
|
134
|
-
* @param target - The graph to observe.
|
|
135
|
-
* @param opts - See {@link GraphLensOptions}.
|
|
136
|
-
*
|
|
137
|
-
* @example
|
|
138
|
-
* ```ts
|
|
139
|
-
* const g = new Graph("app");
|
|
140
|
-
* g.add(state(0, { name: "counter" }));
|
|
141
|
-
* const lens = graphLens(g);
|
|
142
|
-
* lens.stats.subscribe((msgs) => console.log(msgs[0]?.[1])); // TopologyStats
|
|
143
|
-
* // Flow queries — O(1) without subscribing to snapshots:
|
|
144
|
-
* lens.flow.get("counter"); // FlowEntry | undefined
|
|
145
|
-
* lens.flow.size; // number
|
|
146
|
-
* lens.flow.entries.subscribe(...); // reactive snapshot, lazy-materialized
|
|
147
|
-
* ```
|
|
148
|
-
*
|
|
149
|
-
* @category observability
|
|
150
|
-
*/
|
|
151
|
-
declare function graphLens(target: Graph, opts?: GraphLensOptions): LensGraph;
|
|
152
|
-
|
|
153
|
-
type index_FlowEntry = FlowEntry;
|
|
154
|
-
type index_GraphLensOptions = GraphLensOptions;
|
|
155
|
-
type index_HealthProblem = HealthProblem;
|
|
156
|
-
type index_HealthReport = HealthReport;
|
|
157
|
-
type index_LensGraph = LensGraph;
|
|
158
|
-
declare const index_LensGraph: typeof LensGraph;
|
|
159
|
-
type index_TopologyStats = TopologyStats;
|
|
160
|
-
declare const index_graphLens: typeof graphLens;
|
|
161
|
-
declare const index_watchTopologyTree: typeof watchTopologyTree;
|
|
162
|
-
declare namespace index {
|
|
163
|
-
export { type index_FlowEntry as FlowEntry, type index_GraphLensOptions as GraphLensOptions, type index_HealthProblem as HealthProblem, type index_HealthReport as HealthReport, index_LensGraph as LensGraph, type index_TopologyStats as TopologyStats, index_graphLens as graphLens, index_watchTopologyTree as watchTopologyTree };
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
export { type FlowEntry as F, type GraphLensOptions as G, type HealthProblem as H, LensGraph as L, type TopologyStats as T, type HealthReport as a, graphLens as g, index as i };
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { N as Node } from './node-BYInONRr.cjs';
|
|
2
|
-
import { R as ReactiveMapBundle } from './reactive-map-B2qfD3hb.cjs';
|
|
3
|
-
import { a as GraphOptions, G as Graph, C as CausalChain } from './graph-BUwMAxJI.cjs';
|
|
4
|
-
import { w as watchTopologyTree } from './topology-tree-B5Ngw3j0.cjs';
|
|
5
|
-
|
|
6
|
-
/** Aggregate topology stats emitted by {@link LensGraph.stats}. */
|
|
7
|
-
interface TopologyStats {
|
|
8
|
-
/** Total primary nodes across this graph and all transitively mounted subgraphs. */
|
|
9
|
-
nodeCount: number;
|
|
10
|
-
/** Total directed edges (derived from deps; no duplicates). */
|
|
11
|
-
edgeCount: number;
|
|
12
|
-
/** Count of mounted subgraphs (transitive). */
|
|
13
|
-
subgraphCount: number;
|
|
14
|
-
/** Qualified paths with no upstream deps (source nodes). Sorted. */
|
|
15
|
-
sources: readonly string[];
|
|
16
|
-
/** Qualified paths with no downstream consumers in-graph (sink nodes). Sorted. */
|
|
17
|
-
sinks: readonly string[];
|
|
18
|
-
/** Longest path from any source to any sink (in edges). `0` for empty graphs. */
|
|
19
|
-
depth: number;
|
|
20
|
-
/** `true` if the dep DAG contains a cycle (feedback edge). */
|
|
21
|
-
hasCycles: boolean;
|
|
22
|
-
}
|
|
23
|
-
/** A single health problem entry. */
|
|
24
|
-
interface HealthProblem {
|
|
25
|
-
path: string;
|
|
26
|
-
/** V1 only reports `"errored"`. Future versions may add `"completed"`, `"disconnected"`. */
|
|
27
|
-
status: "errored";
|
|
28
|
-
/** First errored upstream ancestor along the dep chain, when one exists and is distinct from `path`. */
|
|
29
|
-
upstreamCause?: string;
|
|
30
|
-
}
|
|
31
|
-
/** Aggregate health snapshot. `ok=true` iff `problems.length === 0`. */
|
|
32
|
-
interface HealthReport {
|
|
33
|
-
ok: boolean;
|
|
34
|
-
problems: readonly HealthProblem[];
|
|
35
|
-
}
|
|
36
|
-
/** One per-path flow entry stored in {@link LensGraph.flow}. */
|
|
37
|
-
interface FlowEntry {
|
|
38
|
-
path: string;
|
|
39
|
-
/** Cumulative DATA emissions observed since the lens activated. */
|
|
40
|
-
count: number;
|
|
41
|
-
/** `monotonicNs()` at the most recent DATA emission, or `null` if none yet. */
|
|
42
|
-
lastUpdate_ns: number | null;
|
|
43
|
-
}
|
|
44
|
-
/** Options for {@link graphLens}. */
|
|
45
|
-
interface GraphLensOptions {
|
|
46
|
-
name?: string;
|
|
47
|
-
graph?: GraphOptions;
|
|
48
|
-
/**
|
|
49
|
-
* Limit which node paths `flow` tracks. When omitted, every path in
|
|
50
|
-
* `target.describe()` is observed. Recommended for graphs with hundreds
|
|
51
|
-
* of nodes since each tracked path adds one observe-event dispatch per
|
|
52
|
-
* DATA emission.
|
|
53
|
-
*/
|
|
54
|
-
pathFilter?: (path: string) => boolean;
|
|
55
|
-
/**
|
|
56
|
-
* LRU cap on the {@link LensGraph.flow} map. When set, the flow tracker
|
|
57
|
-
* evicts least-recently-used paths (by insertion / set order) once the
|
|
58
|
-
* entry count exceeds this bound. Omit for unbounded (not recommended
|
|
59
|
-
* for long-running graphs with churning paths). Passed through to the
|
|
60
|
-
* underlying {@link reactiveMap}'s `maxSize`.
|
|
61
|
-
*/
|
|
62
|
-
maxFlowPaths?: number;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Reactive observability surface for a target {@link Graph}.
|
|
66
|
-
* See {@link graphLens}.
|
|
67
|
-
*
|
|
68
|
-
* @category observability
|
|
69
|
-
*/
|
|
70
|
-
declare class LensGraph extends Graph {
|
|
71
|
-
/**
|
|
72
|
-
* Aggregate structural stats — `nodeCount`, `edgeCount`, `sources`,
|
|
73
|
-
* `sinks`, `depth`, `hasCycles`, `subgraphCount`. Recomputes on every
|
|
74
|
-
* structural change via {@link watchTopologyTree} (transitive).
|
|
75
|
-
*
|
|
76
|
-
* Named `stats` (not `topology`) because `Graph.topology` already names
|
|
77
|
-
* the raw `TopologyEvent` stream on every graph including `LensGraph`;
|
|
78
|
-
* giving the lens its own `topology` accessor with an incompatible
|
|
79
|
-
* `Node<TopologyStats>` type would break Liskov substitutability.
|
|
80
|
-
*/
|
|
81
|
-
readonly stats: Node<TopologyStats>;
|
|
82
|
-
readonly health: Node<HealthReport>;
|
|
83
|
-
/**
|
|
84
|
-
* Per-path flow tracker — a live {@link ReactiveMapBundle} keyed by
|
|
85
|
-
* qualified path. Use `.get(path)` / `.has(path)` / `.size` for O(1)
|
|
86
|
-
* sync queries; subscribe to `.entries` for a reactive snapshot of the
|
|
87
|
-
* whole map. Lazy — the snapshot is materialized only while `.entries`
|
|
88
|
-
* has subscribers.
|
|
89
|
-
*
|
|
90
|
-
* Shape intentionally differs from `stats` / `health` (which are plain
|
|
91
|
-
* `Node<Report>`) because `flow` is a keyed collection, not a single
|
|
92
|
-
* aggregate value. The map shape exposes cheaper queries than any
|
|
93
|
-
* snapshot-based design.
|
|
94
|
-
*/
|
|
95
|
-
readonly flow: ReactiveMapBundle<string, FlowEntry>;
|
|
96
|
-
private readonly _target;
|
|
97
|
-
constructor(target: Graph, opts?: GraphLensOptions);
|
|
98
|
-
/**
|
|
99
|
-
* Live causal chain from `from` to `to`. Recomputes whenever the target
|
|
100
|
-
* mutates. Disposed automatically when the lens is destroyed.
|
|
101
|
-
*
|
|
102
|
-
* **Lifetime note:** every call to `why()` registers a lens-owned disposer
|
|
103
|
-
* that runs on `lens.destroy()`. The returned `dispose` function releases
|
|
104
|
-
* the internal subscription but does NOT remove the lens-owned disposer —
|
|
105
|
-
* so heavy calling (e.g. per render frame) accumulates no-op disposers
|
|
106
|
-
* until lens teardown. Cache the returned handle for long-lived queries.
|
|
107
|
-
*
|
|
108
|
-
* Tier 3.5: rebuilt on top of `graph.explain(from, to, { reactive: true })`
|
|
109
|
-
* after the deprecated `reactiveExplainPath` wrapper was deleted.
|
|
110
|
-
*
|
|
111
|
-
* @param from - Qualified path of the upstream endpoint.
|
|
112
|
-
* @param to - Qualified path of the downstream endpoint.
|
|
113
|
-
* @param opts - See {@link Graph.explain} (`{ reactive: true }` overload).
|
|
114
|
-
*/
|
|
115
|
-
why(from: string, to: string, opts?: {
|
|
116
|
-
maxDepth?: number;
|
|
117
|
-
name?: string;
|
|
118
|
-
findCycle?: boolean;
|
|
119
|
-
}): {
|
|
120
|
-
node: Node<CausalChain>;
|
|
121
|
-
dispose: () => void;
|
|
122
|
-
};
|
|
123
|
-
/** Reference to the lensed graph. */
|
|
124
|
-
get target(): Graph;
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Create a reactive observability lens over a {@link Graph}. Returns a
|
|
128
|
-
* {@link LensGraph} with three reactive surfaces (`stats`, `health`, `flow`)
|
|
129
|
-
* plus the `why(from, to)` method.
|
|
130
|
-
*
|
|
131
|
-
* The returned graph is detached. Mount it via `target.mount("lens", lens)`
|
|
132
|
-
* if you want it to appear in the target's `describe()`, or keep it standalone.
|
|
133
|
-
*
|
|
134
|
-
* @param target - The graph to observe.
|
|
135
|
-
* @param opts - See {@link GraphLensOptions}.
|
|
136
|
-
*
|
|
137
|
-
* @example
|
|
138
|
-
* ```ts
|
|
139
|
-
* const g = new Graph("app");
|
|
140
|
-
* g.add(state(0, { name: "counter" }));
|
|
141
|
-
* const lens = graphLens(g);
|
|
142
|
-
* lens.stats.subscribe((msgs) => console.log(msgs[0]?.[1])); // TopologyStats
|
|
143
|
-
* // Flow queries — O(1) without subscribing to snapshots:
|
|
144
|
-
* lens.flow.get("counter"); // FlowEntry | undefined
|
|
145
|
-
* lens.flow.size; // number
|
|
146
|
-
* lens.flow.entries.subscribe(...); // reactive snapshot, lazy-materialized
|
|
147
|
-
* ```
|
|
148
|
-
*
|
|
149
|
-
* @category observability
|
|
150
|
-
*/
|
|
151
|
-
declare function graphLens(target: Graph, opts?: GraphLensOptions): LensGraph;
|
|
152
|
-
|
|
153
|
-
type index_FlowEntry = FlowEntry;
|
|
154
|
-
type index_GraphLensOptions = GraphLensOptions;
|
|
155
|
-
type index_HealthProblem = HealthProblem;
|
|
156
|
-
type index_HealthReport = HealthReport;
|
|
157
|
-
type index_LensGraph = LensGraph;
|
|
158
|
-
declare const index_LensGraph: typeof LensGraph;
|
|
159
|
-
type index_TopologyStats = TopologyStats;
|
|
160
|
-
declare const index_graphLens: typeof graphLens;
|
|
161
|
-
declare const index_watchTopologyTree: typeof watchTopologyTree;
|
|
162
|
-
declare namespace index {
|
|
163
|
-
export { type index_FlowEntry as FlowEntry, type index_GraphLensOptions as GraphLensOptions, type index_HealthProblem as HealthProblem, type index_HealthReport as HealthReport, index_LensGraph as LensGraph, type index_TopologyStats as TopologyStats, index_graphLens as graphLens, index_watchTopologyTree as watchTopologyTree };
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
export { type FlowEntry as F, type GraphLensOptions as G, type HealthProblem as H, LensGraph as L, type TopologyStats as T, type HealthReport as a, graphLens as g, index as i };
|