@graphrefly/graphrefly 0.31.0 → 0.32.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-2JNT5NDF.js +61 -0
- package/dist/{chunk-KN4Q5MQO.js → chunk-2RH4QNDQ.js} +1 -1
- package/dist/chunk-4JBKKUCJ.js +7 -0
- package/dist/{chunk-WLPVGXQ6.js → chunk-4YGJ7KZ6.js} +1 -1
- package/dist/{chunk-3Q2WXM6X.js → chunk-5PBXUVHI.js} +1 -1
- package/dist/{chunk-WYJTXYWX.js → chunk-7EMUF2RY.js} +1 -1
- package/dist/chunk-7JZ3YORY.js +80 -0
- package/dist/{chunk-I4U3TPK2.js → chunk-7QS77X6G.js} +1 -1
- package/dist/{chunk-ZM7C2FUM.js → chunk-BU4SUZSA.js} +1 -1
- package/dist/{chunk-GF5T7PGC.js → chunk-CNXUW2CU.js} +1 -1
- package/dist/{chunk-Z3UWIJ3A.js → chunk-EIFHFDFD.js} +1 -1
- package/dist/{chunk-3JRKP4BH.js → chunk-JAHAJU4G.js} +1 -1
- package/dist/{chunk-4ZPO2EL5.js → chunk-JYMNVEH6.js} +1 -1
- package/dist/{chunk-4KAUNEKV.js → chunk-KD3IYBTD.js} +1 -1
- package/dist/{chunk-X2VHDT26.js → chunk-LG73TUF4.js} +2 -2
- package/dist/{chunk-JXRZXP3N.js → chunk-LJGPOJHS.js} +1 -1
- package/dist/{chunk-YQJPYEAL.js → chunk-M2VFLRPJ.js} +1 -1
- package/dist/{chunk-7EQPXQ7H.js → chunk-MFNOZ5E6.js} +1 -1
- package/dist/{chunk-YZ6VYLFD.js → chunk-PWKLZ2XU.js} +1 -1
- package/dist/{chunk-OKQUPJRY.js → chunk-TOCCHQI6.js} +1 -1
- package/dist/{chunk-PZP4MEXK.js → chunk-UXEB35L4.js} +1 -1
- package/dist/{chunk-EBQ6FXKW.js → chunk-VXJX3ZZP.js} +1 -1
- package/dist/{chunk-7EJTWGKW.js → chunk-WE32AFFA.js} +1 -1
- package/dist/{chunk-JMGGCSIC.js → chunk-WF3V5X2L.js} +1 -1
- package/dist/{chunk-YZKGGMPT.js → chunk-X4OOM6QU.js} +1 -1
- package/dist/{chunk-5LJAQTSS.js → chunk-ZWETYYQG.js} +1 -1
- package/dist/compat/index.cjs +1 -1
- package/dist/compat/index.d.cts +5 -5
- package/dist/compat/index.d.ts +5 -5
- package/dist/compat/index.js +1 -1
- package/dist/compat/nestjs/index.cjs +1 -1
- package/dist/compat/nestjs/index.d.cts +3 -3
- package/dist/compat/nestjs/index.d.ts +3 -3
- package/dist/compat/nestjs/index.js +1 -1
- package/dist/compat/zustand/index.cjs +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/extra/index.cjs +1 -1
- package/dist/extra/index.d.cts +2 -2
- package/dist/extra/index.d.ts +2 -2
- package/dist/extra/index.js +1 -1
- package/dist/graph/index.cjs +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-CWeI0aHd.d.ts → graph-BOhEGJ6E.d.ts} +10 -0
- package/dist/{graph-C4Uxwv0T.d.cts → graph-CdJeX7O7.d.cts} +10 -0
- package/dist/{index-B-z8WaSd.d.cts → index-BDLy6CQ9.d.cts} +1 -1
- package/dist/{index-iBp74eGU.d.cts → index-BJDXj9Wf.d.cts} +2 -2
- package/dist/{index-BBINVimG.d.ts → index-BUZPTPSQ.d.ts} +2 -2
- package/dist/{index-DnrZghBB.d.ts → index-BbcSZCAG.d.ts} +1 -1
- package/dist/{index-lKuLYmHO.d.cts → index-BiGeETJs.d.cts} +1 -1
- package/dist/{index-Dm3_D5Ta.d.cts → index-BmZb8fNF.d.cts} +2 -2
- package/dist/{index-Docdiu9a.d.ts → index-Bnmttu35.d.ts} +1 -1
- package/dist/{index-CZChc85Q.d.cts → index-BuN2wGJs.d.cts} +297 -22
- package/dist/{index-Cy7eFeIX.d.cts → index-BwdPDWI4.d.cts} +1 -1
- package/dist/{index-DylQCKEL.d.cts → index-BzxU4yhV.d.cts} +11 -2
- package/dist/{index-D9Y_u6BG.d.cts → index-C-Gsh-0a.d.cts} +2 -2
- package/dist/{index-DD7RhHNJ.d.cts → index-C22aTC1X.d.cts} +4 -4
- package/dist/{index-yIdWFo2b.d.cts → index-C4QTaDli.d.cts} +2 -2
- package/dist/{index-CJymKyzT.d.ts → index-C7RqYbOZ.d.ts} +1 -1
- package/dist/{index-C5Ghnp5B.d.ts → index-C9qCLIN4.d.ts} +2 -2
- package/dist/{index-DVNLe3pS.d.cts → index-CCdg0JLX.d.cts} +1 -1
- package/dist/{index-B5iVOD7w.d.ts → index-CEoU-r-g.d.ts} +2 -2
- package/dist/{index-CfFYyLR8.d.ts → index-CHfBm51k.d.ts} +11 -2
- package/dist/{index-BXzl1NDD.d.ts → index-CNyiYQWF.d.ts} +4 -4
- package/dist/{index-C6NBfXj-.d.ts → index-CVevMZ0n.d.ts} +2 -2
- package/dist/{index-DGb1awva.d.ts → index-CZUzi6Dy.d.ts} +2 -2
- package/dist/{index-FrYrV-Vf.d.ts → index-Ckl03Q0s.d.ts} +1 -1
- package/dist/{index-Bvi5uJxX.d.ts → index-CmSjld-4.d.ts} +1 -1
- package/dist/{index-9iguV3bF.d.cts → index-CnjUhRbs.d.cts} +2 -2
- package/dist/{index-C98oJsEs.d.cts → index-D3HcdZ4d.d.cts} +1 -1
- package/dist/{index-IZ3l_vQ9.d.ts → index-DD1czHj3.d.ts} +1 -1
- package/dist/{index-gJQqJTKx.d.cts → index-DNhTQReY.d.cts} +1 -1
- package/dist/{index-UZO988ox.d.cts → index-DSawGt8n.d.cts} +2 -2
- package/dist/{index-CcpEvuPl.d.cts → index-DUkuH3jP.d.cts} +1 -1
- package/dist/{index-CRAkoq-y.d.cts → index-DY2QbdoP.d.cts} +1 -1
- package/dist/{index-CvS9IuTG.d.ts → index-Dbmj0iYR.d.ts} +1 -1
- package/dist/{index-Bd6oFZqO.d.ts → index-DhlAMlm9.d.ts} +297 -22
- package/dist/{index-BMe3pCom.d.cts → index-DlGaEBW5.d.cts} +2 -2
- package/dist/{index-CotRMjtJ.d.ts → index-Dp_pS7Bw.d.ts} +1 -1
- package/dist/{index-DxMS0cHM.d.ts → index-Dxk-pUQI.d.ts} +2 -2
- package/dist/{index-DBQUKh59.d.cts → index-EGjF6iSY.d.cts} +3 -3
- package/dist/{index-D9HrBx2J.d.ts → index-LGzAYqdR.d.ts} +1 -1
- package/dist/{index-DR3gf_DG.d.cts → index-LzCJ0kMT.d.cts} +2 -2
- package/dist/{index-RQg6lTrN.d.ts → index-MV2yGIAq.d.ts} +2 -2
- package/dist/{index-Bs3-LC83.d.cts → index-_BXz9K7b.d.cts} +1 -1
- package/dist/{index-SSGqF8mI.d.cts → index-aBqZUx3B.d.cts} +1 -1
- package/dist/{index-CFW32Dy1.d.ts → index-eYHRkoK-.d.ts} +1 -1
- package/dist/{index-CwhcFzTA.d.ts → index-gXTVbSax.d.ts} +2 -2
- package/dist/{index-D-kHVedZ.d.cts → index-j33Lfb1G.d.cts} +22 -1
- package/dist/{index-BEpRsvhg.d.ts → index-lpGUhTBn.d.ts} +3 -3
- package/dist/{index-CcS0t-l2.d.ts → index-zMQIQuDu.d.ts} +22 -1
- package/dist/index.cjs +53 -50
- package/dist/index.d.cts +26 -26
- package/dist/index.d.ts +26 -26
- package/dist/index.js +1 -1
- package/dist/patterns/ai/index.cjs +21 -18
- package/dist/patterns/ai/index.d.cts +6 -6
- package/dist/patterns/ai/index.d.ts +6 -6
- package/dist/patterns/ai/index.js +1 -1
- package/dist/patterns/audit/index.cjs +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.cjs +1 -1
- package/dist/patterns/cqrs/index.d.cts +2 -2
- package/dist/patterns/cqrs/index.d.ts +2 -2
- package/dist/patterns/cqrs/index.js +1 -1
- package/dist/patterns/demo-shell/index.cjs +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.cjs +5 -5
- 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.cjs +27 -25
- 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 +5 -5
- 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 +12 -11
- package/dist/patterns/harness/index.d.cts +5 -5
- package/dist/patterns/harness/index.d.ts +5 -5
- package/dist/patterns/harness/index.js +1 -1
- package/dist/patterns/job-queue/index.cjs +1 -1
- package/dist/patterns/job-queue/index.d.cts +2 -2
- package/dist/patterns/job-queue/index.d.ts +2 -2
- package/dist/patterns/job-queue/index.js +1 -1
- package/dist/patterns/lens/index.cjs +1 -1
- package/dist/patterns/lens/index.d.cts +3 -3
- package/dist/patterns/lens/index.d.ts +3 -3
- package/dist/patterns/lens/index.js +1 -1
- package/dist/patterns/memory/index.cjs +1 -1
- package/dist/patterns/memory/index.d.cts +2 -2
- package/dist/patterns/memory/index.d.ts +2 -2
- package/dist/patterns/memory/index.js +1 -1
- package/dist/patterns/messaging/index.cjs +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.cjs +7 -7
- package/dist/patterns/orchestration/index.d.cts +2 -2
- package/dist/patterns/orchestration/index.d.ts +2 -2
- package/dist/patterns/orchestration/index.js +1 -1
- package/dist/patterns/reactive-layout/index.cjs +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.cjs +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.cjs +3 -3
- 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.d.cts +3 -3
- package/dist/patterns/resilient-pipeline/index.d.ts +3 -3
- package/dist/patterns/resilient-pipeline/index.js +1 -1
- package/dist/patterns/surface/index.cjs +15 -13
- 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/{reactive-layout-BAr6-_o5.d.ts → reactive-layout-Bq0rA2Wb.d.ts} +1 -1
- package/dist/{reactive-layout-5oEn8lHM.d.cts → reactive-layout-Dhhe54Oj.d.cts} +1 -1
- package/dist/{topology-tree-CVREibAc.d.cts → topology-tree-CpSjvIXp.d.cts} +1 -1
- package/dist/{topology-tree-CkjojcB6.d.ts → topology-tree-DAbCV2Yw.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-ASDKRNOJ.js +0 -60
- package/dist/chunk-PSQNYY72.js +0 -7
- package/dist/chunk-XEFAMCEA.js +0 -78
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export { T as ToObservableOptions, t as toObservable } from '../../observable-ITikPXz3.js';
|
|
2
|
-
export { A as ACTOR_KEY, a as ActorExtractor, C as COMMAND_HANDLERS, b as CQRS_EVENT_HANDLERS, c as CRON_HANDLERS, d as CommandHandler, e as CommandHandlerMeta, E as EVENT_HANDLERS, f as EventHandler, g as EventHandlerMeta, G as GRAPHREFLY_REQUEST_GRAPH, h as GRAPHREFLY_ROOT_GRAPH, j as GraphCron, k as GraphCronMeta, l as GraphInterval, m as GraphIntervalMeta, n as GraphReflyCqrsOptions, o as GraphReflyEventExplorer, p as GraphReflyFeatureOptions, q as GraphReflyGuard, r as GraphReflyGuardImpl, s as GraphReflyModule, t as GraphReflyRootOptions, I as INTERVAL_HANDLERS, u as InjectCqrsGraph, v as InjectGraph, w as InjectNode, O as ObserveGateway, x as ObserveGatewayOptions, y as ObserveSSEOptions, z as ObserveSubscriptionOptions, B as ObserveWsCommand, D as ObserveWsMessage, F as OnGraphEvent, H as OnGraphEventMeta, Q as QUERY_HANDLERS, J as QueryHandler, K as QueryHandlerMeta, S as SAGA_HANDLERS, L as SagaHandler, M as SagaHandlerMeta, N as fromHeader, P as fromJwtPayload, R as getActor, T as getGraphToken, U as getNodeToken, V as observeSSE, W as observeSubscription } from '../../index-
|
|
2
|
+
export { A as ACTOR_KEY, a as ActorExtractor, C as COMMAND_HANDLERS, b as CQRS_EVENT_HANDLERS, c as CRON_HANDLERS, d as CommandHandler, e as CommandHandlerMeta, E as EVENT_HANDLERS, f as EventHandler, g as EventHandlerMeta, G as GRAPHREFLY_REQUEST_GRAPH, h as GRAPHREFLY_ROOT_GRAPH, j as GraphCron, k as GraphCronMeta, l as GraphInterval, m as GraphIntervalMeta, n as GraphReflyCqrsOptions, o as GraphReflyEventExplorer, p as GraphReflyFeatureOptions, q as GraphReflyGuard, r as GraphReflyGuardImpl, s as GraphReflyModule, t as GraphReflyRootOptions, I as INTERVAL_HANDLERS, u as InjectCqrsGraph, v as InjectGraph, w as InjectNode, O as ObserveGateway, x as ObserveGatewayOptions, y as ObserveSSEOptions, z as ObserveSubscriptionOptions, B as ObserveWsCommand, D as ObserveWsMessage, F as OnGraphEvent, H as OnGraphEventMeta, Q as QUERY_HANDLERS, J as QueryHandler, K as QueryHandlerMeta, S as SAGA_HANDLERS, L as SagaHandler, M as SagaHandlerMeta, N as fromHeader, P as fromJwtPayload, R as getActor, T as getGraphToken, U as getNodeToken, V as observeSSE, W as observeSubscription } from '../../index-CZUzi6Dy.js';
|
|
3
3
|
import 'rxjs';
|
|
4
4
|
import '../../node-BVV7G1bq.js';
|
|
5
5
|
import '@nestjs/common';
|
|
6
6
|
import '@nestjs/core';
|
|
7
|
-
import '../../graph-
|
|
7
|
+
import '../../graph-BOhEGJ6E.js';
|
|
8
8
|
import '../../meta-BMwx3ExI.js';
|
|
9
9
|
import '../../extra/storage-core.js';
|
|
10
|
-
import '../../index-
|
|
10
|
+
import '../../index-DD1czHj3.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as B,B as C,C as D,D as E,E as F,F as G,a as b,b as c,c as d,d as e,e as f,f as g,g as h,h as i,i as j,j as k,k as l,l as m,m as n,n as o,o as p,p as q,q as r,r as s,s as t,t as u,u as v,v as w,w as x,x as y,y as z,z as A}from"../../chunk-
|
|
1
|
+
import{A as B,B as C,C as D,D as E,E as F,F as G,a as b,b as c,c as d,d as e,e as f,f as g,g as h,h as i,i as j,j as k,k as l,l as m,m as n,n as o,o as p,p as q,q as r,r as s,s as t,t as u,u as v,v as w,w as x,x as y,y as z,z as A}from"../../chunk-CNXUW2CU.js";import"../../chunk-EIFHFDFD.js";import"../../chunk-K54OKWNY.js";import"../../chunk-CZVYLXFK.js";import"../../chunk-MFNOZ5E6.js";import{a}from"../../chunk-5QDBSZBV.js";import"../../chunk-XRSHMHEG.js";import"../../chunk-4JBKKUCJ.js";import"../../chunk-SGS4OJGS.js";import"../../chunk-ESMPEKEV.js";import"../../chunk-N2KKISCE.js";import"../../chunk-UMH3HSP7.js";import"../../chunk-7AJKUA36.js";import"../../chunk-CK2E7BTU.js";import"../../chunk-QYADASLV.js";export{A as ACTOR_KEY,i as COMMAND_HANDLERS,j as CQRS_EVENT_HANDLERS,h as CRON_HANDLERS,s as CommandHandler,f as EVENT_HANDLERS,t as EventHandler,c as GRAPHREFLY_REQUEST_GRAPH,b as GRAPHREFLY_ROOT_GRAPH,r as GraphCron,q as GraphInterval,w as GraphReflyEventExplorer,F as GraphReflyGuard,E as GraphReflyGuardImpl,G as GraphReflyModule,g as INTERVAL_HANDLERS,n as InjectCqrsGraph,m as InjectGraph,o as InjectNode,z as ObserveGateway,p as OnGraphEvent,k as QUERY_HANDLERS,u as QueryHandler,l as SAGA_HANDLERS,v as SagaHandler,C as fromHeader,B as fromJwtPayload,D as getActor,d as getGraphToken,e as getNodeToken,x as observeSSE,y as observeSubscription,a as toObservable};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
`)}function Zt(t){if(t.version!==de)throw new Error(`unsupported snapshot version ${String(t.version)} (expected ${de})`);for(let e of["name","nodes","edges","subgraphs"])if(!(e in t))throw new Error(`snapshot missing required key "${e}"`);if(typeof t.name!="string")throw new TypeError("snapshot 'name' must be a string");if(typeof t.nodes!="object"||t.nodes===null||Array.isArray(t.nodes))throw new TypeError("snapshot 'nodes' must be an object");if(!Array.isArray(t.edges))throw new TypeError("snapshot 'edges' must be an array");if(!Array.isArray(t.subgraphs))throw new TypeError("snapshot 'subgraphs' must be an array")}function nr(t,e){let n=new WeakMap,r=(s,o)=>{if(Object.is(s,o))return!0;if(s==null||o==null||typeof s!="object"||typeof o!="object")return!1;let i=n.get(s);if(i==null&&(i=new WeakSet,n.set(s,i)),i.has(o))return!0;i.add(o);let a=s.constructor,l=o.constructor;if(a!==l)return!1;if(s instanceof Date)return s.getTime()===o.getTime();if(s instanceof RegExp)return s.source===o.source&&s.flags===o.flags;if(Array.isArray(s)){let h=o;if(s.length!==h.length)return!1;for(let f=0;f<s.length;f++)if(!r(s[f],h[f]))return!1;return!0}if(s instanceof Map){let h=o;if(s.size!==h.size)return!1;for(let[f,d]of s)if(!h.has(f)||!r(d,h.get(f)))return!1;return!0}if(s instanceof Set){let h=o;if(s.size!==h.size)return!1;for(let f of s){let d=!1;for(let g of h)if(r(f,g)){d=!0;break}if(!d)return!1}return!0}if(ArrayBuffer.isView(s)){let h=s,f=o;if(h.length!==f.length)return!1;for(let d=0;d<h.length;d++)if(h[d]!==f[d])return!1;return!0}let u=Object.keys(s),c=Object.keys(o);if(u.length!==c.length)return!1;let p=new Set(c);for(let h of u)if(!p.has(h)||!r(s[h],o[h]))return!1;return!0};return r(t,e)}function ft(t){if(t===null||typeof t!="object")return t;if(Array.isArray(t))return t.map(ft);let e=t,n=Object.keys(e).sort(),r={};for(let s of n)r[s]=ft(e[s]);return r}function rr(t){return t.replaceAll("\\","\\\\").replaceAll('"','\\"')}function sr(t){return t.replaceAll("\\","\\\\").replaceAll('"','\\"')}function or(t){return t==="TD"?"down":t==="BT"?"up":t==="RL"?"left":"right"}function tn(t){let e=new Set,n=[];function r(s,o){let i=`${s}\0${o}`;e.has(i)||(e.add(i),n.push([s,o]))}for(let[s,o]of Object.entries(t.nodes)){let i=o.deps;if(i)for(let a of i)r(a,s)}for(let s of t.edges)r(s.from,s.to);return n}function nn(t){if(t===void 0)return"LR";if(t==="TD"||t==="LR"||t==="BT"||t==="RL")return t;throw new Error(`invalid diagram direction ${String(t)}; expected one of: TD, LR, BT, RL`)}function ir(t,e){let n=e.includeEdges??!0,r=e.includeSubgraphs??!0,{expand:s,...o}=t,i={...o,edges:n?t.edges:[],subgraphs:r?t.subgraphs:[]},a=JSON.stringify(ft(i),null,e.indent??2);return e.logger?.(a),a}function ar(t,e){let n=e.includeEdges??!0,r=e.includeSubgraphs??!0,s=[];s.push(`Graph ${t.name}`),s.push("Nodes:");for(let i of Object.keys(t.nodes).sort()){let a=t.nodes[i];s.push(`- ${i} (${a.type}/${a.status}): ${Fe(a.value)}`)}if(n){s.push("Edges:");for(let i of t.edges)s.push(`- ${i.from} -> ${i.to}`)}if(r){s.push("Subgraphs:");for(let i of t.subgraphs)s.push(`- ${i}`)}let o=s.join(`
|
|
5
5
|
`);return e.logger?.(o),o}function rn(t,e){let n=nn(e.direction),r=Object.keys(t.nodes).sort(),s=new Map;for(let i=0;i<r.length;i+=1)s.set(r[i],`n${i}`);let o=[`flowchart ${n}`];for(let i of r){let a=s.get(i);o.push(` ${a}["${rr(i)}"]`)}for(let[i,a]of tn(t)){let l=s.get(i),u=s.get(a);!l||!u||o.push(` ${l} --> ${u}`)}return o.join(`
|
|
6
6
|
`)}function ur(t,e){let n=rn(t,e);return lr(n)}function lr(t,e){let n=e?.theme??"default",r=e?.autoSync??!0,o=JSON.stringify({code:t,mermaid:{theme:n},autoSync:r}),i=new TextEncoder().encode(o),a="";for(let u=0;u<i.length;u++)a+=String.fromCharCode(i[u]);return`https://mermaid.live/edit#base64:${globalThis.btoa(a).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}`}function cr(t,e){let n=nn(e.direction),r=Object.keys(t.nodes).sort(),s=new Map;for(let i=0;i<r.length;i+=1)s.set(r[i],`n${i}`);let o=[`direction: ${or(n)}`];for(let i of r){let a=s.get(i);o.push(`${a}: "${sr(i)}"`)}for(let[i,a]of tn(t)){let l=s.get(i),u=s.get(a);!l||!u||o.push(`${l} -> ${u}`)}return o.join(`
|
|
7
|
-
`)}function dr(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function $e(t){let e="^";for(let n=0;n<t.length;n+=1){let r=t[n];if(r==="*"){e+=".*";continue}if(r==="?"){e+=".";continue}if(r==="["){let s=t.indexOf("]",n+1);if(s<=n+1){e+="\\[";continue}let o=t.slice(n+1,s);o.startsWith("!")&&(o=`^${o.slice(1)}`),o=o.replace(/\\/g,"\\\\"),e+=`[${o}]`,n=s;continue}e+=dr(r)}return e+="$",new RegExp(e)}var fr={data:"\x1B[32m",dirty:"\x1B[33m",resolved:"\x1B[36m",invalidate:"\x1B[93m",pause:"\x1B[90m",resume:"\x1B[96m",complete:"\x1B[34m",error:"\x1B[31m",teardown:"\x1B[91m",derived:"\x1B[35m",path:"\x1B[90m",reset:"\x1B[0m"},pr={data:"",dirty:"",resolved:"",invalidate:"",pause:"",resume:"",complete:"",error:"",teardown:"",derived:"",path:"",reset:""};function Fe(t){if(typeof t=="string")return JSON.stringify(t);if(typeof t=="number"||typeof t=="boolean"||t==null)return String(t);try{return JSON.stringify(t)}catch{return"[unserializable]"}}function hr(t){return t==="none"?pr:t==="ansi"||t==null?fr:{data:t.data??"",dirty:t.dirty??"",resolved:t.resolved??"",invalidate:t.invalidate??"",pause:t.pause??"",resume:t.resume??"",complete:t.complete??"",error:t.error??"",teardown:t.teardown??"",derived:t.derived??"",path:t.path??"",reset:t.reset??""}}function Qt(t){if(t==null)return{};let e=t.detail;return e==="full"?{...t,structured:t.structured??!0,timeline:t.timeline??!0,causal:t.causal??!0,derived:t.derived??!0}:e==="minimal"?{...t,structured:t.structured??!0}:t.format==="stage-log"?{...t,structured:t.structured??!0,timeline:t.timeline??!0}:t}function gr(t,e,n){for(let r=0;r<t.length;r++){let s=t.charCodeAt(r);if(s<32||s===127)throw new Error(`Graph "${e}": ${n} "${t}" must not contain control character (U+${s.toString(16).padStart(4,"0").toUpperCase()} at index ${r})`)}}function dt(t,e,n){if(t==="")throw new Error(`Graph "${e}": ${n} name must be non-empty`);if(t.includes(M))throw new Error(`Graph "${e}": ${n} "${t}" must not contain '${M}' (path separator)`);if(t===Y)throw new Error(`Graph "${e}": ${n} name "${Y}" is reserved for meta companion paths`);gr(t,e,n)}function mr(t,e){if(t==="")throw new Error(`Graph "${e}": resolve path must be non-empty`);let n=t.split(M);for(let r of n)if(r==="")throw new Error(`Graph "${e}": resolve path has empty segment`);return n}function br(t,e){let n=!1;for(let s of t)if(!e.isMetaPassthrough(s[0])){n=!0;break}return n?t.filter(s=>e.isMetaPassthrough(s[0])):t}function sn(t){for(let e of t._mounts.values())sn(e);for(let e of t._nodes.values())try{e.down([[H]],{internal:!0})}catch{}}var _e=class t{name;opts;config;_nodes=new Map;_nodeToName=new WeakMap;_mounts=new Map;_parent=void 0;_storageDisposers=new Set;_disposers=new Set;_topology;_topologyEmitters=new Set;constructor(e,n){if(e==="")throw new Error("Graph name must be non-empty");if(e.includes(M))throw new Error(`Graph name must not contain '${M}' (got "${e}")`);if(e===Y)throw new Error(`Graph name "${Y}" is reserved for meta companion paths`);this.name=e,this.opts=Object.freeze({...n??{}}),this.config=n?.config??le,this._traceRing=new ve(n?.traceCapacity??1e3),n?.versioning!=null&&this.setVersioning(n.versioning)}ancestors(e=!0){let n=[],r=e?this:this._parent;for(;r!=null;)n.push(r),r=r._parent;return n}get topology(){return this._topology==null&&(this._topology=At(e=>{let n=r=>{e.emit(r)};return this._topologyEmitters.add(n),()=>{this._topologyEmitters.delete(n)}},{name:`${this.name}_topology`})),this._topology}_emitTopology(e){if(!(this._topology==null||this._topologyEmitters.size===0))for(let n of this._topologyEmitters)n(e)}add(e,n){let r=e.name,s=n?.name??r;if(s==null||s==="")throw new Error(`Graph "${this.name}": graph.add requires a non-empty name \u2014 pass via opts.name or set it on the node (e.g. state(0, { name: "x" }))`);let o=s,i=n?.annotation;if(dt(o,this.name,"add"),this._mounts.has(o))throw new Error(`Graph "${this.name}": name "${o}" is already a mount point`);if(this._nodes.has(o))throw new Error(`Graph "${this.name}": node "${o}" already exists`);let a=this._nodeToName.get(e);if(a!==void 0)throw new Error(`Graph "${this.name}": node instance already registered as "${a}"`);return this._nodes.set(o,e),this._nodeToName.set(e,o),this._emitTopology({kind:"added",name:o,nodeKind:"node"}),i!=null&&(this._annotations.set(o,i),this.config.inspectorEnabled&&this._traceRing.push({path:o,annotation:i,timestamp_ns:ue()})),e}setVersioning(e){if(e!=null)for(let n of this._nodes.values())n instanceof I&&n._applyVersioning(e)}remove(e){dt(e,this.name,"remove");let n=this._mounts.get(e);if(n){let o={kind:"mount",nodes:[],mounts:[]},i=[];n._collectObserveTargets("",i);for(let[a,l]of i)a.includes(`${M}${Y}${M}`)||o.nodes.push(a);return o.nodes.sort(),o.mounts.push(e),o.mounts.push(...n._collectSubgraphs(`${e}${M}`)),this._mounts.delete(e),n._parent=void 0,sn(n),this._emitTopology({kind:"removed",name:e,nodeKind:"mount",audit:o}),o}let r=this._nodes.get(e);if(!r)throw new Error(`Graph "${this.name}": unknown node or mount "${e}"`);this._nodes.delete(e),this._nodeToName.delete(r),r.down([[H]],{internal:!0});let s={kind:"node",nodes:[e],mounts:[]};return this._emitTopology({kind:"removed",name:e,nodeKind:"node",audit:s}),s}removeAll(e){let n=typeof e=="function"?e:(()=>{let o=$e(e);return i=>o.test(i)})(),r={kind:"mount",nodes:[],mounts:[]},s=[...this._nodes.keys(),...this._mounts.keys()].filter(o=>n(o));for(let o of s){let i=this.remove(o);r.nodes.push(...i.nodes),r.mounts.push(...i.mounts)}return r.nodes.sort(),r.mounts.sort(),r}[Symbol.iterator](){let e=[...this._nodes.keys()].sort(),n=this._nodes,r=0;return{[Symbol.iterator](){return this},next(){if(r>=e.length)return{value:void 0,done:!0};let s=e[r++];return{value:[s,n.get(s)],done:!1}}}}node(e){if(e==="")throw new Error(`Graph "${this.name}": node name must be non-empty`);if(e.includes(M))return this.resolve(e);let n=this._nodes.get(e);if(!n)throw new Error(`Graph "${this.name}": unknown node "${e}"`);return n}get(e){return this.node(e).cache}set(e,n,r){let s=r?.internal===!0;this.node(e).down([[$,n]],{actor:r?.actor,internal:s,delivery:"write"})}setAll(e,n){let r=Symbol.iterator in e?e:Object.entries(e);wt(()=>{for(let[s,o]of r)this.set(s,o,n)})}invalidate(e,n){let r=n?.internal===!0;this.node(e).down([[K]],{actor:n?.actor,internal:r,delivery:"write"})}error(e,n,r){let s=r?.internal===!0;this.node(e).down([[P,n]],{actor:r?.actor,internal:s,delivery:"write"})}complete(e,n){let r=n?.internal===!0;this.node(e).down([[q]],{actor:n?.actor,internal:r,delivery:"write"})}edges(e){let n=e?.recursive===!0,r=new Map;if(!n){for(let[l,u]of this._nodes)r.set(u,l);let a=[];for(let[l,u]of this._nodes)if(u instanceof I)for(let c of u._deps){let p=r.get(c.node);p!=null&&a.push([p,l])}return a.sort((l,u)=>l[0]<u[0]?-1:l[0]>u[0]?1:l[1]<u[1]?-1:l[1]>u[1]?1:0),a}let s=[];this._collectObserveTargets("",s);let o=new Map;for(let[a,l]of s)o.set(l,a);let i=[];for(let[a,l]of s)if(l instanceof I)for(let u of l._deps){let c=o.get(u.node);c!=null&&i.push([c,a])}return i.sort((a,l)=>a[0]<l[0]?-1:a[0]>l[0]?1:a[1]<l[1]?-1:a[1]>l[1]?1:0),i}mount(e,n){if(dt(e,this.name,"mount"),this._nodes.has(e))throw new Error(`Graph "${this.name}": cannot mount at "${e}" \u2014 node with that name exists`);if(this._mounts.has(e))throw new Error(`Graph "${this.name}": mount "${e}" already exists`);if(n===this)throw new Error(`Graph "${this.name}": cannot mount a graph into itself`);if(n._parent!=null)throw new Error(`Graph "${this.name}": this child graph is already mounted on "${n._parent.name}"`);for(let r=this;r!=null;r=r._parent)if(r===n)throw new Error(`Graph "${this.name}": mount("${e}", \u2026) would create a mount cycle`);return this._mounts.set(e,n),n._parent=this,this._emitTopology({kind:"added",name:e,nodeKind:"mount"}),n}resolve(e){let n=mr(e,this.name);return this._resolveFromSegments(n)}tryResolve(e){try{return this.resolve(e)}catch{return}}_resolveFromSegments(e){let n=e;if(n[0]===this.name&&(n=n.slice(1),n.length===0))throw new Error(`Graph "${this.name}": resolve path ends at graph name only`);let r=n[0],s=n.slice(1);if(s.length===0){let a=this._nodes.get(r);if(a)return a;throw this._mounts.has(r)?new Error(`Graph "${this.name}": path ends at subgraph "${r}" \u2014 not a node (GRAPHREFLY-SPEC \xA73.5)`):new Error(`Graph "${this.name}": unknown name "${r}"`)}let o=this._nodes.get(r);if(o&&s.length>0&&s[0]===Y)return this._resolveMetaChainFromNode(o,s,n.join(M));let i=this._mounts.get(r);if(!i)throw this._nodes.has(r)?new Error(`Graph "${this.name}": "${r}" is a node; trailing path "${s.join(M)}" is invalid`):new Error(`Graph "${this.name}": unknown mount or node "${r}"`);return i.resolve(s.join(M))}_resolveMetaChainFromNode(e,n,r){let s=e,o=0,i=[...n];for(;o<i.length;){if(i[o]!==Y)throw new Error(`Graph "${this.name}": expected ${Y} segment in meta path "${r}"`);if(o+1>=i.length)throw new Error(`Graph "${this.name}": meta path requires a key after ${Y} in "${r}"`);let a=i[o+1],l=s.meta[a];if(!l)throw new Error(`Graph "${this.name}": unknown meta "${a}" in path "${r}"`);s=l,o+=2}return s}signal(e,n){if(n?.internal!==!0){for(let s of e)if(this.config.messageTier(s[0])===3)throw new Error(`Graph "${this.name}": Graph.signal() rejects tier-3 messages (DATA / RESOLVED). Broadcast is for control-plane tiers (START / DIRTY / INVALIDATE / PAUSE / RESUME / COMPLETE / ERROR / TEARDOWN). For per-node value writes, use Graph.set or graph.node(name).down(...).`)}let r=[];if(this._signalDeliver(e,n??{},new Set,r),r.length>0)throw r[0]}_signalDeliver(e,n,r,s){for(let l of this._mounts.values())l._signalDeliver(e,n,r,s);let i=n.internal===!0?{internal:!0}:{actor:n.actor,delivery:"signal"},a=br(e,this.config);for(let l of[...this._nodes.keys()].sort()){let u=this._nodes.get(l);if(!r.has(u)){r.add(u);try{u.down(e,i)}catch(c){if(c instanceof U)throw c;s.push(c)}a.length!==0&&this._signalMetaSubtree(u,a,r,i,s)}}}_signalMetaSubtree(e,n,r,s,o){for(let i of Object.keys(e.meta).sort()){let a=e.meta[i];if(!r.has(a)){r.add(a);try{a.down(n,s)}catch(l){if(l instanceof U)throw l;o.push(l)}this._signalMetaSubtree(a,n,r,s,o)}}}describe(e){if(e?.reactive===!0)return this._describeReactive(e);let n=e?.actor,r=e?.filter,s=Re(e?.detail,e?.fields),o=e?.format==="spec",i=o?Re("minimal"):s,a=[];this._collectObserveTargets("",a);let l=new Map;for(let[x,w]of a)l.set(w,x);let u=[];{let x=a.map(([,N])=>N),w=new Set(l.values()),O=0;for(;x.length>0;){let N=x.shift();if(N instanceof I)for(let R of N._deps){let S=R.node;if(l.has(S))continue;let D=S.name??"",k=D;if(!k||w.has(k))if(D){let G=2;for(;w.has(`${D}#${G}`);)G++;k=`${D}#${G}`}else for(k=`__internal__/${O++}`;w.has(k);)k=`__internal__/${O++}`;l.set(S,k),w.add(k),u.push([k,S]),x.push(S)}}}let c=[...a,...u],p={};for(let[x,w]of c){if(n!=null&&!w.allowsObserve(n))continue;let O=ut(w,i),N=w instanceof I?w._deps.map(k=>l.get(k.node)??k.node.name??""):[],{name:R,...S}=O,D={...S,deps:N};if(!o){let k=this._annotations.get(x);k!=null&&(D.annotation=k)}if(r!=null)if(typeof r=="function"){let k=r;if(!(k.length>=2?k(x,D):k(D)))continue}else{let k=!0;for(let[G,B]of Object.entries(r)){let W=G==="deps_includes"?"depsIncludes":G==="meta_has"?"metaHas":G;if(W==="depsIncludes"){if(!D.deps.includes(String(B))){k=!1;break}continue}if(W==="metaHas"){if(!Object.hasOwn(D.meta??{},String(B))){k=!1;break}continue}if(D[W]!==B){k=!1;break}}if(!k)continue}p[x]=D}let h=new Set(Object.keys(p)),f=[];for(let[x,w]of c)if(w instanceof I)for(let O of w._deps){let N=l.get(O.node);N!=null&&f.push([N,x])}f.sort((x,w)=>x[0]<w[0]?-1:x[0]>w[0]?1:x[1]<w[1]?-1:x[1]>w[1]?1:0);let d=f.map(([x,w])=>({from:x,to:w}));(n!=null||r!=null)&&(d=d.filter(x=>h.has(x.from)&&h.has(x.to)));let g=this._collectSubgraphs(""),b=n!=null||r!=null?g.filter(x=>{let w=`${x}${M}`;return[...h].some(O=>O===x||O.startsWith(w))}):g,v=this,_=e,m={name:this.name,nodes:p,edges:d,subgraphs:b,expand(x){let w={..._,format:void 0};return Array.isArray(x)?(w.fields=x,w.detail=void 0):(w.detail=x,w.fields=void 0),v.describe(w)}},y=e??{},T=y.format;return T==="json"?ir(m,y):T==="pretty"?ar(m,y):T==="mermaid"?rn(m,y):T==="mermaid-url"?ur(m,y):T==="d2"?cr(m,y):T==="ascii"?zt(m,y):m}_collectSubgraphs(e){let n=[];for(let r of[...this._mounts.keys()].sort()){let s=e===""?r:`${e}${r}`;n.push(s),n.push(...this._mounts.get(r)._collectSubgraphs(`${s}${M}`))}return n}resourceProfile(e){return Jt(this,e)}reachable(e,n,r={}){return r.withDetail===!0?en(this.describe(),e,n,{...r,withDetail:!0}):en(this.describe(),e,n,r)}explain(e,n,r){return r?.reactive===!0?this._explainReactive(e,n,r):this._explainStatic(e,n,r)}_explainStatic(e,n,r){let s=this.describe({detail:"full"}),o=new Map(this._annotations),i=new Map;for(let[a,l]of Object.entries(s.nodes))l.lastMutation!=null&&i.set(a,l.lastMutation);return Ut(s,e,n,{...r?.maxDepth!=null?{maxDepth:r.maxDepth}:{},...r?.findCycle===!0?{findCycle:!0}:{},annotations:o,lastMutations:i})}_describeReactive(e){let n={...e,reactive:!1},r=e.reactiveName??"describe",s=0,o=ce(s,{name:`${r}_version`}),i=this.observe({timeline:!0,structured:!0}),a=!1,l=!1,u=()=>{a||l||(a=!0,be(()=>{a=!1,!l&&(s+=1,o.emit(s))}))},c=i.onEvent(b=>{let v=b.type;v!=="data"&&v!=="error"&&v!=="complete"&&v!=="teardown"||u()}),p=[],h=new WeakSet,f=b=>{if(h.has(b)||l)return;h.add(b);let v=b.topology.subscribe(_=>{for(let m of _){if(m[0]!==$)continue;let y=m[1];if(u(),y.kind==="added"&&y.nodeKind==="mount"){let T=b._mounts.get(y.name);T!=null&&f(T)}}});p.push(v);for(let _ of b._mounts.keys()){let m=b._mounts.get(_);m!=null&&f(m)}};f(this);let d;try{d=it([o],()=>this.describe(n),{name:r,describeKind:"derived",meta:{domain:"audit",kind:"describe"},equals:(b,v)=>b===v})}catch(b){c();for(let v of p)v();throw i.dispose(),b}let g=lt(d);return{node:d,dispose(){l=!0,c();for(let b of p)b();p.length=0,i.dispose(),g()}}}_explainReactive(e,n,r){let s=0,o=ce(s,{name:"explain_version"}),i=this.observe({timeline:!0,structured:!0}),a=!1,l=!1,u=i.onEvent(f=>{let d=f.type;d!=="data"&&d!=="error"&&d!=="complete"&&d!=="teardown"||a||l||(a=!0,be(()=>{a=!1,!l&&(s+=1,o.emit(s))}))}),c={...r?.maxDepth!=null?{maxDepth:r.maxDepth}:{},...r?.findCycle===!0?{findCycle:!0}:{}},p;try{p=it([o],()=>this._explainStatic(e,n,c),{name:r?.name??"explain",describeKind:"derived",meta:{domain:"audit",kind:"explain_path",from:e,to:n},equals:(f,d)=>f.found===d.found&&f.reason===d.reason&&f.steps.length===d.steps.length&&vr(f.steps,d.steps)})}catch(f){throw u(),i.dispose(),f}let h=lt(p);return{node:p,dispose(){l=!0,u(),i.dispose(),h()}}}_pathsMatching(e){let n=$e(e),r=[];return this._collectObserveTargets("",r),r.map(([s])=>s).filter(s=>n.test(s))}_collectObserveTargets(e,n){for(let r of[...this._mounts.keys()].sort()){let s=e===""?r:`${e}${M}${r}`;this._mounts.get(r)._collectObserveTargets(s,n)}for(let r of[...this._nodes.keys()].sort()){let s=this._nodes.get(r),o=e===""?r:`${e}${M}${r}`;n.push([o,s]),this._appendMetaObserveTargets(o,s,n)}}_appendMetaObserveTargets(e,n,r){for(let s of Object.keys(n.meta).sort()){let o=n.meta[s],i=`${e}${M}${Y}${M}${s}`;r.push([i,o]),this._appendMetaObserveTargets(i,o,r)}}observe(e,n){let r=typeof e=="string",o=Qt(r?n:e),i=o.structured===!0||o.timeline===!0||o.causal===!0||o.derived===!0||o.detail==="minimal"||o.detail==="full"||o.format!=null,a=o.actor;if(r){let c=e,p=this.resolve(c);if(a!=null&&!p.allowsObserve(a))throw new U({actor:a,action:"observe",nodeName:c});return i?this._buildStructuredObserver([[c,p]],o,"one"):{subscribe(h){return p.subscribe(h)},up(h){try{p.up?.(h)}catch(f){if(f instanceof U)return;throw f}}}}let l=[];this._collectObserveTargets("",l),l.sort((c,p)=>c[0]<p[0]?-1:c[0]>p[0]?1:0);let u=a==null?l:l.filter(([,c])=>c.allowsObserve(a));return i?this._buildStructuredObserver(u,o,"all"):{subscribe:c=>{let p=u.map(([h,f])=>f.subscribe(d=>{c(h,d)}));return()=>{for(let h of p)h()}},up:(c,p)=>{try{this.resolve(c).up?.(p)}catch(h){if(h instanceof U)return;throw h}}}}_buildStructuredObserver(e,n,r){let s=r==="one"?e[0]?.[0]:void 0,o=i=>{if(r==="one"&&s!=null){let c=this.resolve(s);return this._buildStructuredObserver([[s,c]],i,"one")}let a=[];this._collectObserveTargets("",a),a.sort((c,p)=>c[0]<p[0]?-1:c[0]>p[0]?1:0);let l=i.actor,u=l==null?a:a.filter(([,c])=>c.allowsObserve(l));return this._buildStructuredObserver(u,i,"all")};return this._createObserveResult(e,n,o)}_createObserveResult(e,n,r){let s=n.timeline===!0,o=n.causal===!0,i=n.derived===!0,a=n.detail==="minimal",l=this.config.inspectorEnabled,u=(o||i)&&l,c=n.maxEvents,p=c!=null&&c>0?new ve(c):null,h=[],f=new Set,d={},g=new Set,b=0,v=0,_=0,m=0,y=0,T=0,x=!1,w=!1,O=0,N=new Map,R=new Map,S=new Map,D=E=>{p?p.push(E):h.push(E);for(let C of f)C(E)},k=()=>s?{timestamp_ns:ue(),in_batch:Te(),batch_id:O}:{},G=(E,C)=>{if(!(!u||!(E instanceof I)))return E._setInspectorHook(j=>{if(j.kind==="dep_message")N.set(E,j.depIndex);else if(j.kind==="run"){let fe=j.batchData.map((A,F)=>A!=null&&A.length>0?A.at(-1):j.prevData[F]);R.set(E,fe);let V=j.batchData.map(A=>A!=null?[...A]:void 0);S.set(E,V),i&&D({type:"derived",path:C,dep_values:fe,dep_batches:V,...k()})}})},B=E=>{let C=N.get(E),j=R.get(E);if(!o||j==null)return{};let V=(C!=null&&C>=0&&E instanceof I?E._deps[C]:void 0)?.node,A=V?.v,F=S.get(E);return{trigger_dep_index:C,trigger_dep_name:V?.name,...A!=null?{trigger_version:{id:A.id,version:A.version}}:{},dep_values:[...j],...F!=null?{dep_batches:F}:{}}},W=[],te=[];for(let[E,C]of e){let j=G(C,E);j&&W.push(j),te.push(C.subscribe(fe=>{O++;for(let V of fe){let A=V[0],F=k();if(A===$){d[E]=V[1];let Ve=C instanceof I?C.lastMutation?.actor??oe:oe;D({type:"data",path:E,data:V[1],actor:Ve,...F,...B(C)})}else if(a)A===J?b++:A===X?v++:A===K?_++:A===Z?m++:A===Q?y++:A===H?T++:A===q&&!g.has(E)?x=!0:A===P&&(w=!0,g.add(E));else if(A===J)b++,D({type:"dirty",path:E,...F});else if(A===X)v++,D({type:"resolved",path:E,...F,...B(C)});else if(A===K)_++,D({type:"invalidate",path:E,...F});else if(A===Z)m++,D({type:"pause",path:E,lockId:V[1],...F});else if(A===Q)y++,D({type:"resume",path:E,lockId:V[1],...F});else if(A===q)g.has(E)||(x=!0),D({type:"complete",path:E,...F});else if(A===P){w=!0,g.add(E);let Ve=C instanceof I?C.lastMutation?.actor??oe:oe;D({type:"error",path:E,data:V[1],actor:Ve,...F})}else A===H&&(T++,D({type:"teardown",path:E,...F}))}}))}let He=!1,Be=()=>{if(!He){He=!0;for(let E of te)E();for(let E of W)E();for(let E of xe)E({value:void 0,done:!0});xe.length=0}},je=[],xe=[];f.add(E=>{let C=xe.shift();C?C({value:E,done:!1}):je.push(E)});let pt={get values(){return d},get dirtyCount(){return b},get resolvedCount(){return v},get invalidateCount(){return _},get pauseCount(){return m},get resumeCount(){return y},get teardownCount(){return T},get events(){return p?p.toArray():[...h]},get anyCompletedCleanly(){return x},get anyErrored(){return w},get completedWithoutErrors(){return x&&!w},onEvent(E){return f.add(E),()=>f.delete(E)},dispose:Be,expand(E){Be();let C={...n};return typeof E=="string"?C.detail=E:Object.assign(C,E),r(Qt(C))},[Symbol.asyncIterator](){return{next(){return je.length>0?Promise.resolve({value:je.shift(),done:!1}):He?Promise.resolve({value:void 0,done:!0}):new Promise(E=>xe.push(E))},return(){return Be(),Promise.resolve({value:void 0,done:!0})}}}};return n.format!=null&&this._attachFormatLogger(pt,n),pt}_attachFormatLogger(e,n){let r=n.format;if(r==null)return;let s=n.logger??(d=>console.log(d)),o=n.includeTypes?new Set(n.includeTypes):null,i=n.excludeTypes?new Set(n.excludeTypes):null,a=o==null&&i==null?()=>!0:d=>(o==null||o.has(d))&&(i==null||!i.has(d)),l=hr(n.theme),u=r==="stage-log"?ue():0,c=d=>d==null?"":n.stageLabels?.[d]??d,p=(d,g)=>d.length>g?`${d.slice(0,g-1)}\u2026`:d,h=d=>d.type==="data"||d.type==="error"?p(Fe(d.data),120):"",f=d=>{if(r==="stage-log"){let w=(ue()-u)/1e9,O=c(d.path).padEnd(9);if(d.type==="data"){let N=h(d);return`[${w.toFixed(3)}s] ${O} \u2190${N?` ${N}`:""}`}if(d.type==="error"){let N=h(d);return`[${w.toFixed(3)}s] ${O} \u2717${N?` ${N}`:""}`}return d.type==="complete"?`[${w.toFixed(3)}s] ${O} \u25A0 complete`:`[${w.toFixed(3)}s] ${O} ${d.type}`}if(r==="json")try{return JSON.stringify(d)}catch{return JSON.stringify({type:d.type,path:d.path,data:"[unserializable]"})}let g=l[d.type]??"",b=d.path?`${l.path}${d.path}${l.reset} `:"",v=d.type==="data"||d.type==="error",_=d.type==="pause"||d.type==="resume",m=v?` ${Fe(d.data)}`:_?` ${Fe(d.lockId)}`:"",y=d.type==="data"||d.type==="resolved"||d.type==="derived"?d:void 0,T=y?.trigger_dep_name!=null?` <- ${y.trigger_dep_name}`:y?.trigger_dep_index!=null?` <- #${y.trigger_dep_index}`:"",x=d.in_batch?" [batch]":"";return`${b}${g}${d.type.toUpperCase()}${l.reset}${m}${T}${x}`};e.onEvent(d=>{a(d.type)&&s(f(d),d)})}addDisposer(e){return this._disposers.add(e),()=>{this._disposers.delete(e)}}destroy(){Xt(this._disposers,this.name),this.signal([[H]],{internal:!0}),Xt(this._storageDisposers,this.name);for(let e of[...this._mounts.values()])e._parent=void 0,e._destroyClearOnly();this._mounts.clear(),this._nodes.clear(),this._parent=void 0}_destroyClearOnly(){for(let e of[...this._mounts.values()])e._parent=void 0,e._destroyClearOnly();this._mounts.clear(),this._nodes.clear(),this._parent=void 0}snapshot(e){let{expand:n,...r}=this.describe({detail:"full"}),s={};for(let a of Object.keys(r.nodes).sort()){let{lastMutation:l,guard:u,...c}=r.nodes[a];s[a]=c}let o=[...r.subgraphs].sort(),i={...r,version:1,nodes:s,subgraphs:o};if(e?.format==null)return i;if(e.format==="json-string")return JSON.stringify(i);if(e.format==="bytes"){if(e.codec==null)throw new Error("snapshot({format: 'bytes'}) requires a `codec` name");let a=this.config.lookupCodec(e.codec);if(a==null)throw new Error(`snapshot: codec "${e.codec}" is not registered on this graph's config. Call config.registerCodec(...) before creating nodes.`);return yt(a,a.encode(i))}throw new Error(`snapshot: unknown format "${String(e.format)}"`)}static decode(e,n){let r=n?.config??le,{codec:s,codecVersion:o,payload:i}=vt(e,r);return s.decode(i,o)}restore(e,n){if(Zt(e),e.name!==this.name)throw new Error(`Graph "${this.name}": restore snapshot name "${e.name}" does not match this graph`);let r=n?.only==null?null:(Array.isArray(n.only)?n.only:[n.only]).map(o=>$e(o)),s=n?.includeProducers===!0;for(let o of Object.keys(e.nodes).sort()){if(r!==null&&!r.some(a=>a.test(o)))continue;let i=e.nodes[o];if(i!==void 0){if(!("value"in i)||i.value===void 0){"value"in i&&i.value===void 0&&n?.onError?.(o,new Error(`restore: slice.value is undefined for "${o}" (undefined is the global SENTINEL; not valid DATA)`));continue}if(!(i.type==="derived"||i.type==="effect")&&!(i.type==="producer"&&!s)){if(i.v!=null){let l=this.tryResolve(o)?.v;if(l!=null&&l.id===i.v.id&&l.version===i.v.version)continue}try{this.set(o,i.value)}catch(a){n?.onError?.(o,a)}}}}}static fromSnapshot(e,n){Zt(e);let r=typeof n=="function"?n:n?.build,s=typeof n=="function"?void 0:n?.factories,o=new t(e.name);if(r)return r(o),o.restore(e),o;for(let f of[...e.subgraphs].sort((d,g)=>{let b=d.split(M).length,v=g.split(M).length;return b!==v?b-v:d<g?-1:d>g?1:0})){let d=f.split(M),g=o;for(let b of d)g._mounts.has(b)||g.mount(b,new t(b)),g=g._mounts.get(b)}let i=s?Object.entries(s).map(([f,d])=>({re:$e(f),factory:d})):[],a=f=>{for(let d of i)if(d.re.test(f))return d.factory},l=f=>{let d=f.split(M),g=d.pop();if(g==null||g.length===0)throw new Error(`invalid snapshot path "${f}"`);let b=o;for(let v of d){let _=b._mounts.get(v);if(!_)throw new Error(`unknown mount "${v}" in path "${f}"`);b=_}return[b,g]},u=Object.entries(e.nodes).filter(([f])=>!f.includes(`${M}${Y}${M}`)).sort((f,d)=>f[0]<d[0]?-1:f[0]>d[0]?1:0),c=new Map(u),p=new Map,h=!0;for(;c.size>0&&h;){h=!1;for(let[f,d]of[...c.entries()]){let g=d?.deps??[];if(!g.every(T=>p.has(T)))continue;let[b,v]=l(f),_={...d?.meta??{}},m=a(f),y;if(d?.type==="state")y=ce(d.value,{meta:_});else{if(m==null)continue;y=m(v,{path:f,type:d.type,value:d.value,meta:_,deps:g,resolvedDeps:g.map(T=>p.get(T))})}b.add(y,{name:v}),p.set(f,y),c.delete(f),h=!0}}if(c.size>0){let f=[...c.keys()].sort().join(", ");throw new Error(`Graph.fromSnapshot could not reconstruct nodes without build callback: ${f}. Pass matching factories via fromSnapshot(data, { factories: { pattern: factoryFn } }).`)}return o.restore(e),o}toJSON(){return this.snapshot()}attachStorage(e,n={}){let r=e.map(u=>({tier:u,debounceMs:Math.max(0,u.debounceMs??0),compactEvery:Math.max(1,u.compactEvery??10),timer:void 0,seq:0,lastSnapshot:void 0,lastFingerprint:"",disposed:!1,savePending:void 0}));n.autoRestore===!0&&this._cascadeRestore(e,n.onError);let s=(u,c)=>{if(u.disposed)return;let p=tr(c.nodes);if(u.lastSnapshot!=null&&p!==""&&p===u.lastFingerprint)return;let h=u.seq+1,f=Ee(),b=u.lastSnapshot==null||h%u.compactEvery===0?{mode:"full",snapshot:c,seq:h,timestamp_ns:f,format_version:de}:{mode:"diff",diff:yr(u.lastSnapshot,c),seq:h,timestamp_ns:f,format_version:de};if(u.tier.filter&&!u.tier.filter(this.name,b))return;let v;try{v=u.tier.save(this.name,b)}catch(_){n.onError?.(_,u.tier);return}if(v&&typeof v.then=="function"){let y=(u.savePending??Promise.resolve()).then(()=>v,()=>v).then(()=>{u.disposed||(u.seq=h,u.lastSnapshot=c,u.lastFingerprint=p)},T=>{n.onError?.(T,u.tier)});u.savePending=y.finally(()=>{u.savePending===y&&(u.savePending=void 0)})}else u.seq=h,u.lastSnapshot=c,u.lastFingerprint=p},o=(u,c)=>{try{s(u,c)}catch(p){n.onError?.(p,u.tier)}},i=(u,c)=>{if(!c.some(d=>{let g=this.config.messageTier(d[0]);return g>=3&&g<5}))return;if(n.filter){let d=this.tryResolve(u);if(d==null)return;let g=ut(d,Re("standard"));if(!n.filter(u,g))return}let h,f=()=>(h==null&&(h=this.snapshot()),h);for(let d of r)d.disposed||(d.debounceMs===0?o(d,f()):(d.timer==null&&(d.timer=new Ae),d.timer.start(d.debounceMs,()=>{d.disposed||o(d,this.snapshot())})))},a;if(n.paths!=null){let c=(typeof n.paths=="string"?this._pathsMatching(n.paths):n.paths).map(p=>{let h=this.tryResolve(p);return h==null?()=>{}:h.subscribe(f=>i(p,f))});a=()=>{for(let p of c)p()}}else a=this.observe().subscribe((u,c)=>i(u,c));let l=()=>{a();for(let u of r)u.disposed=!0,u.timer?.cancel();this._storageDisposers.delete(l)};return this._storageDisposers.add(l),{dispose:l}}async _cascadeRestore(e,n){for(let r of e){let s;try{s=await r.load(this.name)}catch(i){n?.(i,r);continue}if(s==null||typeof s!="object"||Array.isArray(s))continue;let o=s;try{if(o.mode==="full"&&o.snapshot!=null)return this.restore(o.snapshot),!0;if(o.version===de&&o.nodes!=null)return this.restore(o),!0}catch(i){n?.(i,r)}}return!1}static async fromStorage(e,n,r){for(let s of n){let o;try{o=await s.load(e)}catch(l){r?.onError?.(l,s);continue}if(o==null||typeof o!="object"||Array.isArray(o))continue;let i=o,a=i.mode==="full"&&i.snapshot!=null?i.snapshot:i.version===de&&i.nodes!=null?i:void 0;if(a!=null)try{return t.fromSnapshot(a,r)}catch(l){r?.onError?.(l,s)}}throw new Error(`Graph.fromStorage: no tier held a restorable record for "${e}" across ${n.length} tier(s)`)}_annotations=new Map;_traceRing;trace(e,n,r){if(e!=null&&n!=null){if(this.tryResolve(e)==null)return;if(this._annotations.set(e,n),this.config.inspectorEnabled){let s={path:e,annotation:n,timestamp_ns:ue(),...r?.actor!=null?{actor:r.actor}:{}};this._traceRing.push(s)}return}return e!=null?this.config.inspectorEnabled?this._annotations.get(e):void 0:this.config.inspectorEnabled?this._traceRing.toArray():[]}annotation(e){return this._annotations.get(e)}clearTrace(){this._annotations.clear(),this._traceRing.clear()}pruneTrace(e){let n=this._traceRing.toArray().filter(s=>!e(s)),r=this._traceRing.size-n.length;this._traceRing.clear();for(let s of n)this._traceRing.push(s);return r}static diff(e,n){let r=new Set(Object.keys(e.nodes)),s=new Set(Object.keys(n.nodes)),o=[...s].filter(_=>!r.has(_)).sort(),i=[...r].filter(_=>!s.has(_)).sort(),a=[],l=[];for(let _ of r){if(!s.has(_))continue;let m=e.nodes[_],y=n.nodes[_],T=m.v,x=y.v;T!=null&&x!=null&&T.id===x.id&&T.version!==x.version&&l.push({path:_,id:T.id,from:T.version,to:x.version});let w=T!=null&&x!=null&&T.id===x.id&&T.version===x.version;for(let O of["type","status","sentinel"]){let N=m[O],R=y[O];N!==R&&a.push({path:_,field:O,from:N,to:R})}if(!w)for(let O of["value","meta"]){let N=m[O],R=y[O];nr(N,R)||a.push({path:_,field:O,from:N,to:R})}}let u=_=>`${_.from} ${_.to}`,c=new Set(e.edges.map(u)),p=new Set(n.edges.map(u)),h=n.edges.filter(_=>!c.has(u(_))),f=e.edges.filter(_=>!p.has(u(_))),d=new Set(e.subgraphs),g=new Set(n.subgraphs),b=[...g].filter(_=>!d.has(_)).sort(),v=[...d].filter(_=>!g.has(_)).sort();return{nodesAdded:o,nodesRemoved:i,nodesChanged:a,versionChanges:l,edgesAdded:h,edgesRemoved:f,subgraphsAdded:b,subgraphsRemoved:v}}};function yr(t,e){let n=_e.diff(t,e),r={};for(let s of n.nodesAdded){let o=e.nodes[s];o!=null&&(r[s]=o)}return{...n,nodesAddedFull:r}}function en(t,e,n,r={}){let s={paths:[],depths:new Map,truncated:!1};if(!e)return r.withDetail?s:[];if(!r.both&&n!=="upstream"&&n!=="downstream")throw new Error('reachable: direction must be "upstream" or "downstream"');let o=r.maxDepth;if(o!=null&&(!Number.isInteger(o)||o<0))throw new Error("reachable: maxDepth must be an integer >= 0");if(o===0)return r.withDetail?s:[];let i=new Map,a=new Map,l=new Map,u=new Map,c=new Set;for(let[m,y]of Object.entries(t.nodes)){if(!m)continue;c.add(m);let T=y.deps??[];i.set(m,T);for(let x of T)x&&(c.add(x),a.has(x)||a.set(x,new Set),a.get(x).add(m))}for(let m of t.edges){if(m==null||typeof m!="object")continue;let y=typeof m.from=="string"?m.from:"",T=typeof m.to=="string"?m.to:"";!y||!T||(c.add(y),c.add(T),u.has(y)||u.set(y,new Set),u.get(y).add(T),l.has(T)||l.set(T,new Set),l.get(T).add(y))}if(!c.has(e))return r.withDetail?s:[];let p=r.both===!0,h=m=>{if(p){let w=i.get(m)??[],O=l.get(m),N=a.get(m),R=u.get(m),S=[...w];return O&&S.push(...O),N&&S.push(...N),R&&S.push(...R),S}if(n==="upstream"){let w=i.get(m)??[],O=l.get(m);return O?[...w,...O]:w}let y=a.get(m),T=u.get(m),x=y?[...y]:[];return T&&x.push(...T),x},f=new Set([e]),d=new Map,g=[{path:e,depth:0}],b=0,v=!1;for(;b<g.length;){let m=g[b++];if(o!=null&&m.depth>=o){h(m.path).length>0&&(v=!0);continue}for(let y of h(m.path))!y||f.has(y)||(f.add(y),d.set(y,m.depth+1),g.push({path:y,depth:m.depth+1}))}let _=[...d.keys()].sort((m,y)=>m<y?-1:m>y?1:0);return r.withDetail?{paths:_,depths:d,truncated:v}:_}function vr(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],s=e[n];if(r.path!==s.path||r.type!==s.type||r.status!==s.status||r.hop!==s.hop||r.dep_index!==s.dep_index||r.annotation!==s.annotation||r.value!==s.value||r.lastMutation!==s.lastMutation)return!1;let o=r.v,i=s.v;if(o!==i&&(o==null||i==null||o.id!==i.id||o.version!==i.version))return!1}return!0}var _r=()=>!1;function xr(t){let e=new _e("zustand"),n=ce(void 0,{name:"state",equals:_r});e.add(n,{name:"state"});let r=()=>n.cache,s=(a,l)=>{let u=n.cache,c=typeof a=="function"?a(u):a;n.emit(l?c:{...u,...c})},o={getState:r,setState:s,getInitialState:()=>i,subscribe:a=>{let l=!0,u=n.cache;return n.subscribe(c=>{for(let[p,h]of c)if(p===$){if(l){l=!1;continue}a(h,u),u=h}})},destroy:e.destroy.bind(e)},i=t(s,r,o);return n.emit(i),Object.assign(e,o)}0&&(module.exports={create});
|
|
7
|
+
`)}function dr(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function $e(t){let e="^";for(let n=0;n<t.length;n+=1){let r=t[n];if(r==="*"){e+=".*";continue}if(r==="?"){e+=".";continue}if(r==="["){let s=t.indexOf("]",n+1);if(s<=n+1){e+="\\[";continue}let o=t.slice(n+1,s);o.startsWith("!")&&(o=`^${o.slice(1)}`),o=o.replace(/\\/g,"\\\\"),e+=`[${o}]`,n=s;continue}e+=dr(r)}return e+="$",new RegExp(e)}var fr={data:"\x1B[32m",dirty:"\x1B[33m",resolved:"\x1B[36m",invalidate:"\x1B[93m",pause:"\x1B[90m",resume:"\x1B[96m",complete:"\x1B[34m",error:"\x1B[31m",teardown:"\x1B[91m",derived:"\x1B[35m",path:"\x1B[90m",reset:"\x1B[0m"},pr={data:"",dirty:"",resolved:"",invalidate:"",pause:"",resume:"",complete:"",error:"",teardown:"",derived:"",path:"",reset:""};function Fe(t){if(typeof t=="string")return JSON.stringify(t);if(typeof t=="number"||typeof t=="boolean"||t==null)return String(t);try{return JSON.stringify(t)}catch{return"[unserializable]"}}function hr(t){return t==="none"?pr:t==="ansi"||t==null?fr:{data:t.data??"",dirty:t.dirty??"",resolved:t.resolved??"",invalidate:t.invalidate??"",pause:t.pause??"",resume:t.resume??"",complete:t.complete??"",error:t.error??"",teardown:t.teardown??"",derived:t.derived??"",path:t.path??"",reset:t.reset??""}}function Qt(t){if(t==null)return{};let e=t.detail;return e==="full"?{...t,structured:t.structured??!0,timeline:t.timeline??!0,causal:t.causal??!0,derived:t.derived??!0}:e==="minimal"?{...t,structured:t.structured??!0}:t.format==="stage-log"?{...t,structured:t.structured??!0,timeline:t.timeline??!0}:t}function gr(t,e,n){for(let r=0;r<t.length;r++){let s=t.charCodeAt(r);if(s<32||s===127)throw new Error(`Graph "${e}": ${n} "${t}" must not contain control character (U+${s.toString(16).padStart(4,"0").toUpperCase()} at index ${r})`)}}function dt(t,e,n){if(t==="")throw new Error(`Graph "${e}": ${n} name must be non-empty`);if(t.includes(M))throw new Error(`Graph "${e}": ${n} "${t}" must not contain '${M}' (path separator)`);if(t===Y)throw new Error(`Graph "${e}": ${n} name "${Y}" is reserved for meta companion paths`);gr(t,e,n)}function mr(t,e){if(t==="")throw new Error(`Graph "${e}": resolve path must be non-empty`);let n=t.split(M);for(let r of n)if(r==="")throw new Error(`Graph "${e}": resolve path has empty segment`);return n}function br(t,e){let n=!1;for(let s of t)if(!e.isMetaPassthrough(s[0])){n=!0;break}return n?t.filter(s=>e.isMetaPassthrough(s[0])):t}function sn(t){for(let e of t._mounts.values())sn(e);for(let e of t._nodes.values())try{e.down([[H]],{internal:!0})}catch{}}var _e=class t{name;opts;config;_nodes=new Map;_nodeToName=new WeakMap;_mounts=new Map;_parent=void 0;_storageDisposers=new Set;_disposers=new Set;_destroyed=!1;_topology;_topologyEmitters=new Set;constructor(e,n){if(e==="")throw new Error("Graph name must be non-empty");if(e.includes(M))throw new Error(`Graph name must not contain '${M}' (got "${e}")`);if(e===Y)throw new Error(`Graph name "${Y}" is reserved for meta companion paths`);this.name=e,this.opts=Object.freeze({...n??{}}),this.config=n?.config??le,this._traceRing=new ve(n?.traceCapacity??1e3),n?.versioning!=null&&this.setVersioning(n.versioning)}ancestors(e=!0){let n=[],r=e?this:this._parent;for(;r!=null;)n.push(r),r=r._parent;return n}get topology(){return this._topology==null&&(this._topology=At(e=>{let n=r=>{e.emit(r)};return this._topologyEmitters.add(n),()=>{this._topologyEmitters.delete(n)}},{name:`${this.name}_topology`})),this._topology}_emitTopology(e){if(!(this._topology==null||this._topologyEmitters.size===0))for(let n of this._topologyEmitters)n(e)}add(e,n){let r=e.name,s=n?.name??r;if(s==null||s==="")throw new Error(`Graph "${this.name}": graph.add requires a non-empty name \u2014 pass via opts.name or set it on the node (e.g. state(0, { name: "x" }))`);let o=s,i=n?.annotation;if(dt(o,this.name,"add"),this._mounts.has(o))throw new Error(`Graph "${this.name}": name "${o}" is already a mount point`);if(this._nodes.has(o))throw new Error(`Graph "${this.name}": node "${o}" already exists`);let a=this._nodeToName.get(e);if(a!==void 0)throw new Error(`Graph "${this.name}": node instance already registered as "${a}"`);return this._nodes.set(o,e),this._nodeToName.set(e,o),this._emitTopology({kind:"added",name:o,nodeKind:"node"}),i!=null&&(this._annotations.set(o,i),this.config.inspectorEnabled&&this._traceRing.push({path:o,annotation:i,timestamp_ns:ue()})),e}setVersioning(e){if(e!=null)for(let n of this._nodes.values())n instanceof I&&n._applyVersioning(e)}remove(e){dt(e,this.name,"remove");let n=this._mounts.get(e);if(n){let o={kind:"mount",nodes:[],mounts:[]},i=[];n._collectObserveTargets("",i);for(let[a,l]of i)a.includes(`${M}${Y}${M}`)||o.nodes.push(a);return o.nodes.sort(),o.mounts.push(e),o.mounts.push(...n._collectSubgraphs(`${e}${M}`)),this._mounts.delete(e),n._parent=void 0,sn(n),this._emitTopology({kind:"removed",name:e,nodeKind:"mount",audit:o}),o}let r=this._nodes.get(e);if(!r)throw new Error(`Graph "${this.name}": unknown node or mount "${e}"`);this._nodes.delete(e),this._nodeToName.delete(r),r.down([[H]],{internal:!0});let s={kind:"node",nodes:[e],mounts:[]};return this._emitTopology({kind:"removed",name:e,nodeKind:"node",audit:s}),s}removeAll(e){let n=typeof e=="function"?e:(()=>{let o=$e(e);return i=>o.test(i)})(),r={kind:"mount",nodes:[],mounts:[]},s=[...this._nodes.keys(),...this._mounts.keys()].filter(o=>n(o));for(let o of s){let i=this.remove(o);r.nodes.push(...i.nodes),r.mounts.push(...i.mounts)}return r.nodes.sort(),r.mounts.sort(),r}[Symbol.iterator](){let e=[...this._nodes.keys()].sort(),n=this._nodes,r=0;return{[Symbol.iterator](){return this},next(){if(r>=e.length)return{value:void 0,done:!0};let s=e[r++];return{value:[s,n.get(s)],done:!1}}}}node(e){if(e==="")throw new Error(`Graph "${this.name}": node name must be non-empty`);if(e.includes(M))return this.resolve(e);let n=this._nodes.get(e);if(!n)throw new Error(`Graph "${this.name}": unknown node "${e}"`);return n}get(e){return this.node(e).cache}set(e,n,r){let s=r?.internal===!0;this.node(e).down([[$,n]],{actor:r?.actor,internal:s,delivery:"write"})}setAll(e,n){let r=Symbol.iterator in e?e:Object.entries(e);wt(()=>{for(let[s,o]of r)this.set(s,o,n)})}invalidate(e,n){let r=n?.internal===!0;this.node(e).down([[K]],{actor:n?.actor,internal:r,delivery:"write"})}error(e,n,r){let s=r?.internal===!0;this.node(e).down([[P,n]],{actor:r?.actor,internal:s,delivery:"write"})}complete(e,n){let r=n?.internal===!0;this.node(e).down([[q]],{actor:n?.actor,internal:r,delivery:"write"})}edges(e){let n=e?.recursive===!0,r=new Map;if(!n){for(let[l,u]of this._nodes)r.set(u,l);let a=[];for(let[l,u]of this._nodes)if(u instanceof I)for(let c of u._deps){let p=r.get(c.node);p!=null&&a.push([p,l])}return a.sort((l,u)=>l[0]<u[0]?-1:l[0]>u[0]?1:l[1]<u[1]?-1:l[1]>u[1]?1:0),a}let s=[];this._collectObserveTargets("",s);let o=new Map;for(let[a,l]of s)o.set(l,a);let i=[];for(let[a,l]of s)if(l instanceof I)for(let u of l._deps){let c=o.get(u.node);c!=null&&i.push([c,a])}return i.sort((a,l)=>a[0]<l[0]?-1:a[0]>l[0]?1:a[1]<l[1]?-1:a[1]>l[1]?1:0),i}mount(e,n){if(dt(e,this.name,"mount"),this._nodes.has(e))throw new Error(`Graph "${this.name}": cannot mount at "${e}" \u2014 node with that name exists`);if(this._mounts.has(e))throw new Error(`Graph "${this.name}": mount "${e}" already exists`);if(n===this)throw new Error(`Graph "${this.name}": cannot mount a graph into itself`);if(n._parent!=null)throw new Error(`Graph "${this.name}": this child graph is already mounted on "${n._parent.name}"`);for(let r=this;r!=null;r=r._parent)if(r===n)throw new Error(`Graph "${this.name}": mount("${e}", \u2026) would create a mount cycle`);return this._mounts.set(e,n),n._parent=this,this._emitTopology({kind:"added",name:e,nodeKind:"mount"}),n}resolve(e){let n=mr(e,this.name);return this._resolveFromSegments(n)}tryResolve(e){try{return this.resolve(e)}catch{return}}_resolveFromSegments(e){let n=e;if(n[0]===this.name&&(n=n.slice(1),n.length===0))throw new Error(`Graph "${this.name}": resolve path ends at graph name only`);let r=n[0],s=n.slice(1);if(s.length===0){let a=this._nodes.get(r);if(a)return a;throw this._mounts.has(r)?new Error(`Graph "${this.name}": path ends at subgraph "${r}" \u2014 not a node (GRAPHREFLY-SPEC \xA73.5)`):new Error(`Graph "${this.name}": unknown name "${r}"`)}let o=this._nodes.get(r);if(o&&s.length>0&&s[0]===Y)return this._resolveMetaChainFromNode(o,s,n.join(M));let i=this._mounts.get(r);if(!i)throw this._nodes.has(r)?new Error(`Graph "${this.name}": "${r}" is a node; trailing path "${s.join(M)}" is invalid`):new Error(`Graph "${this.name}": unknown mount or node "${r}"`);return i.resolve(s.join(M))}_resolveMetaChainFromNode(e,n,r){let s=e,o=0,i=[...n];for(;o<i.length;){if(i[o]!==Y)throw new Error(`Graph "${this.name}": expected ${Y} segment in meta path "${r}"`);if(o+1>=i.length)throw new Error(`Graph "${this.name}": meta path requires a key after ${Y} in "${r}"`);let a=i[o+1],l=s.meta[a];if(!l)throw new Error(`Graph "${this.name}": unknown meta "${a}" in path "${r}"`);s=l,o+=2}return s}signal(e,n){if(n?.internal!==!0){for(let s of e)if(this.config.messageTier(s[0])===3)throw new Error(`Graph "${this.name}": Graph.signal() rejects tier-3 messages (DATA / RESOLVED). Broadcast is for control-plane tiers (START / DIRTY / INVALIDATE / PAUSE / RESUME / COMPLETE / ERROR / TEARDOWN). For per-node value writes, use Graph.set or graph.node(name).down(...).`)}let r=[];if(this._signalDeliver(e,n??{},new Set,r),r.length>0)throw r[0]}_signalDeliver(e,n,r,s){for(let l of this._mounts.values())l._signalDeliver(e,n,r,s);let i=n.internal===!0?{internal:!0}:{actor:n.actor,delivery:"signal"},a=br(e,this.config);for(let l of[...this._nodes.keys()].sort()){let u=this._nodes.get(l);if(!r.has(u)){r.add(u);try{u.down(e,i)}catch(c){if(c instanceof U)throw c;s.push(c)}a.length!==0&&this._signalMetaSubtree(u,a,r,i,s)}}}_signalMetaSubtree(e,n,r,s,o){for(let i of Object.keys(e.meta).sort()){let a=e.meta[i];if(!r.has(a)){r.add(a);try{a.down(n,s)}catch(l){if(l instanceof U)throw l;o.push(l)}this._signalMetaSubtree(a,n,r,s,o)}}}describe(e){if(e?.reactive===!0)return this._describeReactive(e);let n=e?.actor,r=e?.filter,s=Re(e?.detail,e?.fields),o=e?.format==="spec",i=o?Re("minimal"):s,a=[];this._collectObserveTargets("",a);let l=new Map;for(let[x,w]of a)l.set(w,x);let u=[];{let x=a.map(([,N])=>N),w=new Set(l.values()),O=0;for(;x.length>0;){let N=x.shift();if(N instanceof I)for(let R of N._deps){let S=R.node;if(l.has(S))continue;let D=S.name??"",k=D;if(!k||w.has(k))if(D){let G=2;for(;w.has(`${D}#${G}`);)G++;k=`${D}#${G}`}else for(k=`__internal__/${O++}`;w.has(k);)k=`__internal__/${O++}`;l.set(S,k),w.add(k),u.push([k,S]),x.push(S)}}}let c=[...a,...u],p={};for(let[x,w]of c){if(n!=null&&!w.allowsObserve(n))continue;let O=ut(w,i),N=w instanceof I?w._deps.map(k=>l.get(k.node)??k.node.name??""):[],{name:R,...S}=O,D={...S,deps:N};if(!o){let k=this._annotations.get(x);k!=null&&(D.annotation=k)}if(r!=null)if(typeof r=="function"){let k=r;if(!(k.length>=2?k(x,D):k(D)))continue}else{let k=!0;for(let[G,B]of Object.entries(r)){let W=G==="deps_includes"?"depsIncludes":G==="meta_has"?"metaHas":G;if(W==="depsIncludes"){if(!D.deps.includes(String(B))){k=!1;break}continue}if(W==="metaHas"){if(!Object.hasOwn(D.meta??{},String(B))){k=!1;break}continue}if(D[W]!==B){k=!1;break}}if(!k)continue}p[x]=D}let h=new Set(Object.keys(p)),f=[];for(let[x,w]of c)if(w instanceof I)for(let O of w._deps){let N=l.get(O.node);N!=null&&f.push([N,x])}f.sort((x,w)=>x[0]<w[0]?-1:x[0]>w[0]?1:x[1]<w[1]?-1:x[1]>w[1]?1:0);let d=f.map(([x,w])=>({from:x,to:w}));(n!=null||r!=null)&&(d=d.filter(x=>h.has(x.from)&&h.has(x.to)));let g=this._collectSubgraphs(""),b=n!=null||r!=null?g.filter(x=>{let w=`${x}${M}`;return[...h].some(O=>O===x||O.startsWith(w))}):g,v=this,_=e,m={name:this.name,nodes:p,edges:d,subgraphs:b,expand(x){let w={..._,format:void 0};return Array.isArray(x)?(w.fields=x,w.detail=void 0):(w.detail=x,w.fields=void 0),v.describe(w)}},y=e??{},T=y.format;return T==="json"?ir(m,y):T==="pretty"?ar(m,y):T==="mermaid"?rn(m,y):T==="mermaid-url"?ur(m,y):T==="d2"?cr(m,y):T==="ascii"?zt(m,y):m}_collectSubgraphs(e){let n=[];for(let r of[...this._mounts.keys()].sort()){let s=e===""?r:`${e}${r}`;n.push(s),n.push(...this._mounts.get(r)._collectSubgraphs(`${s}${M}`))}return n}resourceProfile(e){return Jt(this,e)}reachable(e,n,r={}){return r.withDetail===!0?en(this.describe(),e,n,{...r,withDetail:!0}):en(this.describe(),e,n,r)}explain(e,n,r){return r?.reactive===!0?this._explainReactive(e,n,r):this._explainStatic(e,n,r)}_explainStatic(e,n,r){let s=this.describe({detail:"full"}),o=new Map(this._annotations),i=new Map;for(let[a,l]of Object.entries(s.nodes))l.lastMutation!=null&&i.set(a,l.lastMutation);return Ut(s,e,n,{...r?.maxDepth!=null?{maxDepth:r.maxDepth}:{},...r?.findCycle===!0?{findCycle:!0}:{},annotations:o,lastMutations:i})}_describeReactive(e){let n={...e,reactive:!1},r=e.reactiveName??"describe",s=0,o=ce(s,{name:`${r}_version`}),i=this.observe({timeline:!0,structured:!0}),a=!1,l=!1,u=()=>{a||l||(a=!0,be(()=>{a=!1,!l&&(s+=1,o.emit(s))}))},c=i.onEvent(b=>{let v=b.type;v!=="data"&&v!=="error"&&v!=="complete"&&v!=="teardown"||u()}),p=[],h=new WeakSet,f=b=>{if(h.has(b)||l)return;h.add(b);let v=b.topology.subscribe(_=>{for(let m of _){if(m[0]!==$)continue;let y=m[1];if(u(),y.kind==="added"&&y.nodeKind==="mount"){let T=b._mounts.get(y.name);T!=null&&f(T)}}});p.push(v);for(let _ of b._mounts.keys()){let m=b._mounts.get(_);m!=null&&f(m)}};f(this);let d;try{d=it([o],()=>this.describe(n),{name:r,describeKind:"derived",meta:{domain:"audit",kind:"describe"},equals:(b,v)=>b===v})}catch(b){c();for(let v of p)v();throw i.dispose(),b}let g=lt(d);return{node:d,dispose(){l=!0,c();for(let b of p)b();p.length=0,i.dispose(),g()}}}_explainReactive(e,n,r){let s=0,o=ce(s,{name:"explain_version"}),i=this.observe({timeline:!0,structured:!0}),a=!1,l=!1,u=i.onEvent(f=>{let d=f.type;d!=="data"&&d!=="error"&&d!=="complete"&&d!=="teardown"||a||l||(a=!0,be(()=>{a=!1,!l&&(s+=1,o.emit(s))}))}),c={...r?.maxDepth!=null?{maxDepth:r.maxDepth}:{},...r?.findCycle===!0?{findCycle:!0}:{}},p;try{p=it([o],()=>this._explainStatic(e,n,c),{name:r?.name??"explain",describeKind:"derived",meta:{domain:"audit",kind:"explain_path",from:e,to:n},equals:(f,d)=>f.found===d.found&&f.reason===d.reason&&f.steps.length===d.steps.length&&vr(f.steps,d.steps)})}catch(f){throw u(),i.dispose(),f}let h=lt(p);return{node:p,dispose(){l=!0,u(),i.dispose(),h()}}}_pathsMatching(e){let n=$e(e),r=[];return this._collectObserveTargets("",r),r.map(([s])=>s).filter(s=>n.test(s))}_collectObserveTargets(e,n){for(let r of[...this._mounts.keys()].sort()){let s=e===""?r:`${e}${M}${r}`;this._mounts.get(r)._collectObserveTargets(s,n)}for(let r of[...this._nodes.keys()].sort()){let s=this._nodes.get(r),o=e===""?r:`${e}${M}${r}`;n.push([o,s]),this._appendMetaObserveTargets(o,s,n)}}_appendMetaObserveTargets(e,n,r){for(let s of Object.keys(n.meta).sort()){let o=n.meta[s],i=`${e}${M}${Y}${M}${s}`;r.push([i,o]),this._appendMetaObserveTargets(i,o,r)}}observe(e,n){let r=typeof e=="string",o=Qt(r?n:e),i=o.structured===!0||o.timeline===!0||o.causal===!0||o.derived===!0||o.detail==="minimal"||o.detail==="full"||o.format!=null,a=o.actor;if(r){let c=e,p=this.resolve(c);if(a!=null&&!p.allowsObserve(a))throw new U({actor:a,action:"observe",nodeName:c});return i?this._buildStructuredObserver([[c,p]],o,"one"):{subscribe(h){return p.subscribe(h)},up(h){try{p.up?.(h)}catch(f){if(f instanceof U)return;throw f}}}}let l=[];this._collectObserveTargets("",l),l.sort((c,p)=>c[0]<p[0]?-1:c[0]>p[0]?1:0);let u=a==null?l:l.filter(([,c])=>c.allowsObserve(a));return i?this._buildStructuredObserver(u,o,"all"):{subscribe:c=>{let p=u.map(([h,f])=>f.subscribe(d=>{c(h,d)}));return()=>{for(let h of p)h()}},up:(c,p)=>{try{this.resolve(c).up?.(p)}catch(h){if(h instanceof U)return;throw h}}}}_buildStructuredObserver(e,n,r){let s=r==="one"?e[0]?.[0]:void 0,o=i=>{if(r==="one"&&s!=null){let c=this.resolve(s);return this._buildStructuredObserver([[s,c]],i,"one")}let a=[];this._collectObserveTargets("",a),a.sort((c,p)=>c[0]<p[0]?-1:c[0]>p[0]?1:0);let l=i.actor,u=l==null?a:a.filter(([,c])=>c.allowsObserve(l));return this._buildStructuredObserver(u,i,"all")};return this._createObserveResult(e,n,o)}_createObserveResult(e,n,r){let s=n.timeline===!0,o=n.causal===!0,i=n.derived===!0,a=n.detail==="minimal",l=this.config.inspectorEnabled,u=(o||i)&&l,c=n.maxEvents,p=c!=null&&c>0?new ve(c):null,h=[],f=new Set,d={},g=new Set,b=0,v=0,_=0,m=0,y=0,T=0,x=!1,w=!1,O=0,N=new Map,R=new Map,S=new Map,D=E=>{p?p.push(E):h.push(E);for(let C of f)C(E)},k=()=>s?{timestamp_ns:ue(),in_batch:Te(),batch_id:O}:{},G=(E,C)=>{if(!(!u||!(E instanceof I)))return E._setInspectorHook(j=>{if(j.kind==="dep_message")N.set(E,j.depIndex);else if(j.kind==="run"){let fe=j.batchData.map((A,F)=>A!=null&&A.length>0?A.at(-1):j.prevData[F]);R.set(E,fe);let V=j.batchData.map(A=>A!=null?[...A]:void 0);S.set(E,V),i&&D({type:"derived",path:C,dep_values:fe,dep_batches:V,...k()})}})},B=E=>{let C=N.get(E),j=R.get(E);if(!o||j==null)return{};let V=(C!=null&&C>=0&&E instanceof I?E._deps[C]:void 0)?.node,A=V?.v,F=S.get(E);return{trigger_dep_index:C,trigger_dep_name:V?.name,...A!=null?{trigger_version:{id:A.id,version:A.version}}:{},dep_values:[...j],...F!=null?{dep_batches:F}:{}}},W=[],te=[];for(let[E,C]of e){let j=G(C,E);j&&W.push(j),te.push(C.subscribe(fe=>{O++;for(let V of fe){let A=V[0],F=k();if(A===$){d[E]=V[1];let Ve=C instanceof I?C.lastMutation?.actor??oe:oe;D({type:"data",path:E,data:V[1],actor:Ve,...F,...B(C)})}else if(a)A===J?b++:A===X?v++:A===K?_++:A===Z?m++:A===Q?y++:A===H?T++:A===q&&!g.has(E)?x=!0:A===P&&(w=!0,g.add(E));else if(A===J)b++,D({type:"dirty",path:E,...F});else if(A===X)v++,D({type:"resolved",path:E,...F,...B(C)});else if(A===K)_++,D({type:"invalidate",path:E,...F});else if(A===Z)m++,D({type:"pause",path:E,lockId:V[1],...F});else if(A===Q)y++,D({type:"resume",path:E,lockId:V[1],...F});else if(A===q)g.has(E)||(x=!0),D({type:"complete",path:E,...F});else if(A===P){w=!0,g.add(E);let Ve=C instanceof I?C.lastMutation?.actor??oe:oe;D({type:"error",path:E,data:V[1],actor:Ve,...F})}else A===H&&(T++,D({type:"teardown",path:E,...F}))}}))}let He=!1,Be=()=>{if(!He){He=!0;for(let E of te)E();for(let E of W)E();for(let E of xe)E({value:void 0,done:!0});xe.length=0}},je=[],xe=[];f.add(E=>{let C=xe.shift();C?C({value:E,done:!1}):je.push(E)});let pt={get values(){return d},get dirtyCount(){return b},get resolvedCount(){return v},get invalidateCount(){return _},get pauseCount(){return m},get resumeCount(){return y},get teardownCount(){return T},get events(){return p?p.toArray():[...h]},get anyCompletedCleanly(){return x},get anyErrored(){return w},get completedWithoutErrors(){return x&&!w},onEvent(E){return f.add(E),()=>f.delete(E)},dispose:Be,expand(E){Be();let C={...n};return typeof E=="string"?C.detail=E:Object.assign(C,E),r(Qt(C))},[Symbol.asyncIterator](){return{next(){return je.length>0?Promise.resolve({value:je.shift(),done:!1}):He?Promise.resolve({value:void 0,done:!0}):new Promise(E=>xe.push(E))},return(){return Be(),Promise.resolve({value:void 0,done:!0})}}}};return n.format!=null&&this._attachFormatLogger(pt,n),pt}_attachFormatLogger(e,n){let r=n.format;if(r==null)return;let s=n.logger??(d=>console.log(d)),o=n.includeTypes?new Set(n.includeTypes):null,i=n.excludeTypes?new Set(n.excludeTypes):null,a=o==null&&i==null?()=>!0:d=>(o==null||o.has(d))&&(i==null||!i.has(d)),l=hr(n.theme),u=r==="stage-log"?ue():0,c=d=>d==null?"":n.stageLabels?.[d]??d,p=(d,g)=>d.length>g?`${d.slice(0,g-1)}\u2026`:d,h=d=>d.type==="data"||d.type==="error"?p(Fe(d.data),120):"",f=d=>{if(r==="stage-log"){let w=(ue()-u)/1e9,O=c(d.path).padEnd(9);if(d.type==="data"){let N=h(d);return`[${w.toFixed(3)}s] ${O} \u2190${N?` ${N}`:""}`}if(d.type==="error"){let N=h(d);return`[${w.toFixed(3)}s] ${O} \u2717${N?` ${N}`:""}`}return d.type==="complete"?`[${w.toFixed(3)}s] ${O} \u25A0 complete`:`[${w.toFixed(3)}s] ${O} ${d.type}`}if(r==="json")try{return JSON.stringify(d)}catch{return JSON.stringify({type:d.type,path:d.path,data:"[unserializable]"})}let g=l[d.type]??"",b=d.path?`${l.path}${d.path}${l.reset} `:"",v=d.type==="data"||d.type==="error",_=d.type==="pause"||d.type==="resume",m=v?` ${Fe(d.data)}`:_?` ${Fe(d.lockId)}`:"",y=d.type==="data"||d.type==="resolved"||d.type==="derived"?d:void 0,T=y?.trigger_dep_name!=null?` <- ${y.trigger_dep_name}`:y?.trigger_dep_index!=null?` <- #${y.trigger_dep_index}`:"",x=d.in_batch?" [batch]":"";return`${b}${g}${d.type.toUpperCase()}${l.reset}${m}${T}${x}`};e.onEvent(d=>{a(d.type)&&s(f(d),d)})}addDisposer(e){return this._disposers.add(e),()=>{this._disposers.delete(e)}}destroy(){Xt(this._disposers,this.name),this.signal([[H]],{internal:!0}),Xt(this._storageDisposers,this.name);for(let e of[...this._mounts.values()])e._parent=void 0,e._destroyClearOnly();this._mounts.clear(),this._nodes.clear(),this._parent=void 0,this._destroyed=!0}get destroyed(){return this._destroyed}_destroyClearOnly(){for(let e of[...this._mounts.values()])e._parent=void 0,e._destroyClearOnly();this._mounts.clear(),this._nodes.clear(),this._parent=void 0,this._destroyed=!0}snapshot(e){let{expand:n,...r}=this.describe({detail:"full"}),s={};for(let a of Object.keys(r.nodes).sort()){let{lastMutation:l,guard:u,...c}=r.nodes[a];s[a]=c}let o=[...r.subgraphs].sort(),i={...r,version:1,nodes:s,subgraphs:o};if(e?.format==null)return i;if(e.format==="json-string")return JSON.stringify(i);if(e.format==="bytes"){if(e.codec==null)throw new Error("snapshot({format: 'bytes'}) requires a `codec` name");let a=this.config.lookupCodec(e.codec);if(a==null)throw new Error(`snapshot: codec "${e.codec}" is not registered on this graph's config. Call config.registerCodec(...) before creating nodes.`);return yt(a,a.encode(i))}throw new Error(`snapshot: unknown format "${String(e.format)}"`)}static decode(e,n){let r=n?.config??le,{codec:s,codecVersion:o,payload:i}=vt(e,r);return s.decode(i,o)}restore(e,n){if(Zt(e),e.name!==this.name)throw new Error(`Graph "${this.name}": restore snapshot name "${e.name}" does not match this graph`);let r=n?.only==null?null:(Array.isArray(n.only)?n.only:[n.only]).map(o=>$e(o)),s=n?.includeProducers===!0;for(let o of Object.keys(e.nodes).sort()){if(r!==null&&!r.some(a=>a.test(o)))continue;let i=e.nodes[o];if(i!==void 0){if(!("value"in i)||i.value===void 0){"value"in i&&i.value===void 0&&n?.onError?.(o,new Error(`restore: slice.value is undefined for "${o}" (undefined is the global SENTINEL; not valid DATA)`));continue}if(!(i.type==="derived"||i.type==="effect")&&!(i.type==="producer"&&!s)){if(i.v!=null){let l=this.tryResolve(o)?.v;if(l!=null&&l.id===i.v.id&&l.version===i.v.version)continue}try{this.set(o,i.value)}catch(a){n?.onError?.(o,a)}}}}}static fromSnapshot(e,n){Zt(e);let r=typeof n=="function"?n:n?.build,s=typeof n=="function"?void 0:n?.factories,o=new t(e.name);if(r)return r(o),o.restore(e),o;for(let f of[...e.subgraphs].sort((d,g)=>{let b=d.split(M).length,v=g.split(M).length;return b!==v?b-v:d<g?-1:d>g?1:0})){let d=f.split(M),g=o;for(let b of d)g._mounts.has(b)||g.mount(b,new t(b)),g=g._mounts.get(b)}let i=s?Object.entries(s).map(([f,d])=>({re:$e(f),factory:d})):[],a=f=>{for(let d of i)if(d.re.test(f))return d.factory},l=f=>{let d=f.split(M),g=d.pop();if(g==null||g.length===0)throw new Error(`invalid snapshot path "${f}"`);let b=o;for(let v of d){let _=b._mounts.get(v);if(!_)throw new Error(`unknown mount "${v}" in path "${f}"`);b=_}return[b,g]},u=Object.entries(e.nodes).filter(([f])=>!f.includes(`${M}${Y}${M}`)).sort((f,d)=>f[0]<d[0]?-1:f[0]>d[0]?1:0),c=new Map(u),p=new Map,h=!0;for(;c.size>0&&h;){h=!1;for(let[f,d]of[...c.entries()]){let g=d?.deps??[];if(!g.every(T=>p.has(T)))continue;let[b,v]=l(f),_={...d?.meta??{}},m=a(f),y;if(d?.type==="state")y=ce(d.value,{meta:_});else{if(m==null)continue;y=m(v,{path:f,type:d.type,value:d.value,meta:_,deps:g,resolvedDeps:g.map(T=>p.get(T))})}b.add(y,{name:v}),p.set(f,y),c.delete(f),h=!0}}if(c.size>0){let f=[...c.keys()].sort().join(", ");throw new Error(`Graph.fromSnapshot could not reconstruct nodes without build callback: ${f}. Pass matching factories via fromSnapshot(data, { factories: { pattern: factoryFn } }).`)}return o.restore(e),o}toJSON(){return this.snapshot()}attachStorage(e,n={}){let r=e.map(u=>({tier:u,debounceMs:Math.max(0,u.debounceMs??0),compactEvery:Math.max(1,u.compactEvery??10),timer:void 0,seq:0,lastSnapshot:void 0,lastFingerprint:"",disposed:!1,savePending:void 0}));n.autoRestore===!0&&this._cascadeRestore(e,n.onError);let s=(u,c)=>{if(u.disposed)return;let p=tr(c.nodes);if(u.lastSnapshot!=null&&p!==""&&p===u.lastFingerprint)return;let h=u.seq+1,f=Ee(),b=u.lastSnapshot==null||h%u.compactEvery===0?{mode:"full",snapshot:c,seq:h,timestamp_ns:f,format_version:de}:{mode:"diff",diff:yr(u.lastSnapshot,c),seq:h,timestamp_ns:f,format_version:de};if(u.tier.filter&&!u.tier.filter(this.name,b))return;let v;try{v=u.tier.save(this.name,b)}catch(_){n.onError?.(_,u.tier);return}if(v&&typeof v.then=="function"){let y=(u.savePending??Promise.resolve()).then(()=>v,()=>v).then(()=>{u.disposed||(u.seq=h,u.lastSnapshot=c,u.lastFingerprint=p)},T=>{n.onError?.(T,u.tier)});u.savePending=y.finally(()=>{u.savePending===y&&(u.savePending=void 0)})}else u.seq=h,u.lastSnapshot=c,u.lastFingerprint=p},o=(u,c)=>{try{s(u,c)}catch(p){n.onError?.(p,u.tier)}},i=(u,c)=>{if(!c.some(d=>{let g=this.config.messageTier(d[0]);return g>=3&&g<5}))return;if(n.filter){let d=this.tryResolve(u);if(d==null)return;let g=ut(d,Re("standard"));if(!n.filter(u,g))return}let h,f=()=>(h==null&&(h=this.snapshot()),h);for(let d of r)d.disposed||(d.debounceMs===0?o(d,f()):(d.timer==null&&(d.timer=new Ae),d.timer.start(d.debounceMs,()=>{d.disposed||o(d,this.snapshot())})))},a;if(n.paths!=null){let c=(typeof n.paths=="string"?this._pathsMatching(n.paths):n.paths).map(p=>{let h=this.tryResolve(p);return h==null?()=>{}:h.subscribe(f=>i(p,f))});a=()=>{for(let p of c)p()}}else a=this.observe().subscribe((u,c)=>i(u,c));let l=()=>{a();for(let u of r)u.disposed=!0,u.timer?.cancel();this._storageDisposers.delete(l)};return this._storageDisposers.add(l),{dispose:l}}async _cascadeRestore(e,n){for(let r of e){let s;try{s=await r.load(this.name)}catch(i){n?.(i,r);continue}if(s==null||typeof s!="object"||Array.isArray(s))continue;let o=s;try{if(o.mode==="full"&&o.snapshot!=null)return this.restore(o.snapshot),!0;if(o.version===de&&o.nodes!=null)return this.restore(o),!0}catch(i){n?.(i,r)}}return!1}static async fromStorage(e,n,r){for(let s of n){let o;try{o=await s.load(e)}catch(l){r?.onError?.(l,s);continue}if(o==null||typeof o!="object"||Array.isArray(o))continue;let i=o,a=i.mode==="full"&&i.snapshot!=null?i.snapshot:i.version===de&&i.nodes!=null?i:void 0;if(a!=null)try{return t.fromSnapshot(a,r)}catch(l){r?.onError?.(l,s)}}throw new Error(`Graph.fromStorage: no tier held a restorable record for "${e}" across ${n.length} tier(s)`)}_annotations=new Map;_traceRing;trace(e,n,r){if(e!=null&&n!=null){if(this.tryResolve(e)==null)return;if(this._annotations.set(e,n),this.config.inspectorEnabled){let s={path:e,annotation:n,timestamp_ns:ue(),...r?.actor!=null?{actor:r.actor}:{}};this._traceRing.push(s)}return}return e!=null?this.config.inspectorEnabled?this._annotations.get(e):void 0:this.config.inspectorEnabled?this._traceRing.toArray():[]}annotation(e){return this._annotations.get(e)}clearTrace(){this._annotations.clear(),this._traceRing.clear()}pruneTrace(e){let n=this._traceRing.toArray().filter(s=>!e(s)),r=this._traceRing.size-n.length;this._traceRing.clear();for(let s of n)this._traceRing.push(s);return r}static diff(e,n){let r=new Set(Object.keys(e.nodes)),s=new Set(Object.keys(n.nodes)),o=[...s].filter(_=>!r.has(_)).sort(),i=[...r].filter(_=>!s.has(_)).sort(),a=[],l=[];for(let _ of r){if(!s.has(_))continue;let m=e.nodes[_],y=n.nodes[_],T=m.v,x=y.v;T!=null&&x!=null&&T.id===x.id&&T.version!==x.version&&l.push({path:_,id:T.id,from:T.version,to:x.version});let w=T!=null&&x!=null&&T.id===x.id&&T.version===x.version;for(let O of["type","status","sentinel"]){let N=m[O],R=y[O];N!==R&&a.push({path:_,field:O,from:N,to:R})}if(!w)for(let O of["value","meta"]){let N=m[O],R=y[O];nr(N,R)||a.push({path:_,field:O,from:N,to:R})}}let u=_=>`${_.from} ${_.to}`,c=new Set(e.edges.map(u)),p=new Set(n.edges.map(u)),h=n.edges.filter(_=>!c.has(u(_))),f=e.edges.filter(_=>!p.has(u(_))),d=new Set(e.subgraphs),g=new Set(n.subgraphs),b=[...g].filter(_=>!d.has(_)).sort(),v=[...d].filter(_=>!g.has(_)).sort();return{nodesAdded:o,nodesRemoved:i,nodesChanged:a,versionChanges:l,edgesAdded:h,edgesRemoved:f,subgraphsAdded:b,subgraphsRemoved:v}}};function yr(t,e){let n=_e.diff(t,e),r={};for(let s of n.nodesAdded){let o=e.nodes[s];o!=null&&(r[s]=o)}return{...n,nodesAddedFull:r}}function en(t,e,n,r={}){let s={paths:[],depths:new Map,truncated:!1};if(!e)return r.withDetail?s:[];if(!r.both&&n!=="upstream"&&n!=="downstream")throw new Error('reachable: direction must be "upstream" or "downstream"');let o=r.maxDepth;if(o!=null&&(!Number.isInteger(o)||o<0))throw new Error("reachable: maxDepth must be an integer >= 0");if(o===0)return r.withDetail?s:[];let i=new Map,a=new Map,l=new Map,u=new Map,c=new Set;for(let[m,y]of Object.entries(t.nodes)){if(!m)continue;c.add(m);let T=y.deps??[];i.set(m,T);for(let x of T)x&&(c.add(x),a.has(x)||a.set(x,new Set),a.get(x).add(m))}for(let m of t.edges){if(m==null||typeof m!="object")continue;let y=typeof m.from=="string"?m.from:"",T=typeof m.to=="string"?m.to:"";!y||!T||(c.add(y),c.add(T),u.has(y)||u.set(y,new Set),u.get(y).add(T),l.has(T)||l.set(T,new Set),l.get(T).add(y))}if(!c.has(e))return r.withDetail?s:[];let p=r.both===!0,h=m=>{if(p){let w=i.get(m)??[],O=l.get(m),N=a.get(m),R=u.get(m),S=[...w];return O&&S.push(...O),N&&S.push(...N),R&&S.push(...R),S}if(n==="upstream"){let w=i.get(m)??[],O=l.get(m);return O?[...w,...O]:w}let y=a.get(m),T=u.get(m),x=y?[...y]:[];return T&&x.push(...T),x},f=new Set([e]),d=new Map,g=[{path:e,depth:0}],b=0,v=!1;for(;b<g.length;){let m=g[b++];if(o!=null&&m.depth>=o){h(m.path).length>0&&(v=!0);continue}for(let y of h(m.path))!y||f.has(y)||(f.add(y),d.set(y,m.depth+1),g.push({path:y,depth:m.depth+1}))}let _=[...d.keys()].sort((m,y)=>m<y?-1:m>y?1:0);return r.withDetail?{paths:_,depths:d,truncated:v}:_}function vr(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],s=e[n];if(r.path!==s.path||r.type!==s.type||r.status!==s.status||r.hop!==s.hop||r.dep_index!==s.dep_index||r.annotation!==s.annotation||r.value!==s.value||r.lastMutation!==s.lastMutation)return!1;let o=r.v,i=s.v;if(o!==i&&(o==null||i==null||o.id!==i.id||o.version!==i.version))return!1}return!0}var _r=()=>!1;function xr(t){let e=new _e("zustand"),n=ce(void 0,{name:"state",equals:_r});e.add(n,{name:"state"});let r=()=>n.cache,s=(a,l)=>{let u=n.cache,c=typeof a=="function"?a(u):a;n.emit(l?c:{...u,...c})},o={getState:r,setState:s,getInitialState:()=>i,subscribe:a=>{let l=!0,u=n.cache;return n.subscribe(c=>{for(let[p,h]of c)if(p===$){if(l){l=!1;continue}a(h,u),u=h}})},destroy:e.destroy.bind(e)},i=t(s,r,o);return n.emit(i),Object.assign(e,o)}0&&(module.exports={create});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import '../../graph-
|
|
2
|
-
export { S as StateCreator, a as StoreApi, c as create } from '../../index-
|
|
1
|
+
import '../../graph-CdJeX7O7.cjs';
|
|
2
|
+
export { S as StateCreator, a as StoreApi, c as create } from '../../index-DY2QbdoP.cjs';
|
|
3
3
|
import '../../node-BVV7G1bq.cjs';
|
|
4
4
|
import '../../meta-COtmHLwT.cjs';
|
|
5
5
|
import '../../extra/storage-core.cjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import '../../graph-
|
|
2
|
-
export { S as StateCreator, a as StoreApi, c as create } from '../../index-
|
|
1
|
+
import '../../graph-BOhEGJ6E.js';
|
|
2
|
+
export { S as StateCreator, a as StoreApi, c as create } from '../../index-CmSjld-4.js';
|
|
3
3
|
import '../../node-BVV7G1bq.js';
|
|
4
4
|
import '../../meta-BMwx3ExI.js';
|
|
5
5
|
import '../../extra/storage-core.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-JYMNVEH6.js";import"../../chunk-4JBKKUCJ.js";import"../../chunk-SGS4OJGS.js";import"../../chunk-ESMPEKEV.js";import"../../chunk-N2KKISCE.js";import"../../chunk-UMH3HSP7.js";import"../../chunk-7AJKUA36.js";import"../../chunk-CK2E7BTU.js";import"../../chunk-QYADASLV.js";export{a as create};
|
package/dist/extra/index.cjs
CHANGED
|
@@ -21,4 +21,4 @@ ${m}
|
|
|
21
21
|
`)}function mo(t){if(t.version!==ut)throw new Error(`unsupported snapshot version ${String(t.version)} (expected ${ut})`);for(let e of["name","nodes","edges","subgraphs"])if(!(e in t))throw new Error(`snapshot missing required key "${e}"`);if(typeof t.name!="string")throw new TypeError("snapshot 'name' must be a string");if(typeof t.nodes!="object"||t.nodes===null||Array.isArray(t.nodes))throw new TypeError("snapshot 'nodes' must be an object");if(!Array.isArray(t.edges))throw new TypeError("snapshot 'edges' must be an array");if(!Array.isArray(t.subgraphs))throw new TypeError("snapshot 'subgraphs' must be an array")}function za(t,e){let n=new WeakMap,r=(s,o)=>{if(Object.is(s,o))return!0;if(s==null||o==null||typeof s!="object"||typeof o!="object")return!1;let i=n.get(s);if(i==null&&(i=new WeakSet,n.set(s,i)),i.has(o))return!0;i.add(o);let a=s.constructor,d=o.constructor;if(a!==d)return!1;if(s instanceof Date)return s.getTime()===o.getTime();if(s instanceof RegExp)return s.source===o.source&&s.flags===o.flags;if(Array.isArray(s)){let f=o;if(s.length!==f.length)return!1;for(let h=0;h<s.length;h++)if(!r(s[h],f[h]))return!1;return!0}if(s instanceof Map){let f=o;if(s.size!==f.size)return!1;for(let[h,l]of s)if(!f.has(h)||!r(l,f.get(h)))return!1;return!0}if(s instanceof Set){let f=o;if(s.size!==f.size)return!1;for(let h of s){let l=!1;for(let m of f)if(r(h,m)){l=!0;break}if(!l)return!1}return!0}if(ArrayBuffer.isView(s)){let f=s,h=o;if(f.length!==h.length)return!1;for(let l=0;l<f.length;l++)if(f[l]!==h[l])return!1;return!0}let u=Object.keys(s),c=Object.keys(o);if(u.length!==c.length)return!1;let p=new Set(c);for(let f of u)if(!p.has(f)||!r(s[f],o[f]))return!1;return!0};return r(t,e)}function qn(t){if(t===null||typeof t!="object")return t;if(Array.isArray(t))return t.map(qn);let e=t,n=Object.keys(e).sort(),r={};for(let s of n)r[s]=qn(e[s]);return r}function ja(t){return t.replaceAll("\\","\\\\").replaceAll('"','\\"')}function Ha(t){return t.replaceAll("\\","\\\\").replaceAll('"','\\"')}function Wa(t){return t==="TD"?"down":t==="BT"?"up":t==="RL"?"left":"right"}function yo(t){let e=new Set,n=[];function r(s,o){let i=`${s}\0${o}`;e.has(i)||(e.add(i),n.push([s,o]))}for(let[s,o]of Object.entries(t.nodes)){let i=o.deps;if(i)for(let a of i)r(a,s)}for(let s of t.edges)r(s.from,s.to);return n}function vo(t){if(t===void 0)return"LR";if(t==="TD"||t==="LR"||t==="BT"||t==="RL")return t;throw new Error(`invalid diagram direction ${String(t)}; expected one of: TD, LR, BT, RL`)}function Ua(t,e){let n=e.includeEdges??!0,r=e.includeSubgraphs??!0,{expand:s,...o}=t,i={...o,edges:n?t.edges:[],subgraphs:r?t.subgraphs:[]},a=JSON.stringify(qn(i),null,e.indent??2);return e.logger?.(a),a}function qa(t,e){let n=e.includeEdges??!0,r=e.includeSubgraphs??!0,s=[];s.push(`Graph ${t.name}`),s.push("Nodes:");for(let i of Object.keys(t.nodes).sort()){let a=t.nodes[i];s.push(`- ${i} (${a.type}/${a.status}): ${tn(a.value)}`)}if(n){s.push("Edges:");for(let i of t.edges)s.push(`- ${i.from} -> ${i.to}`)}if(r){s.push("Subgraphs:");for(let i of t.subgraphs)s.push(`- ${i}`)}let o=s.join(`
|
|
22
22
|
`);return e.logger?.(o),o}function To(t,e){let n=vo(e.direction),r=Object.keys(t.nodes).sort(),s=new Map;for(let i=0;i<r.length;i+=1)s.set(r[i],`n${i}`);let o=[`flowchart ${n}`];for(let i of r){let a=s.get(i);o.push(` ${a}["${ja(i)}"]`)}for(let[i,a]of yo(t)){let d=s.get(i),u=s.get(a);!d||!u||o.push(` ${d} --> ${u}`)}return o.join(`
|
|
23
23
|
`)}function Ja(t,e){let n=To(t,e);return Ya(n)}function Ya(t,e){let n=e?.theme??"default",r=e?.autoSync??!0,o=JSON.stringify({code:t,mermaid:{theme:n},autoSync:r}),i=new TextEncoder().encode(o),a="";for(let u=0;u<i.length;u++)a+=String.fromCharCode(i[u]);return`https://mermaid.live/edit#base64:${globalThis.btoa(a).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}`}function Qa(t,e){let n=vo(e.direction),r=Object.keys(t.nodes).sort(),s=new Map;for(let i=0;i<r.length;i+=1)s.set(r[i],`n${i}`);let o=[`direction: ${Wa(n)}`];for(let i of r){let a=s.get(i);o.push(`${a}: "${Ha(i)}"`)}for(let[i,a]of yo(t)){let d=s.get(i),u=s.get(a);!d||!u||o.push(`${d} -> ${u}`)}return o.join(`
|
|
24
|
-
`)}function Xa(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function en(t){let e="^";for(let n=0;n<t.length;n+=1){let r=t[n];if(r==="*"){e+=".*";continue}if(r==="?"){e+=".";continue}if(r==="["){let s=t.indexOf("]",n+1);if(s<=n+1){e+="\\[";continue}let o=t.slice(n+1,s);o.startsWith("!")&&(o=`^${o.slice(1)}`),o=o.replace(/\\/g,"\\\\"),e+=`[${o}]`,n=s;continue}e+=Xa(r)}return e+="$",new RegExp(e)}var Za={data:"\x1B[32m",dirty:"\x1B[33m",resolved:"\x1B[36m",invalidate:"\x1B[93m",pause:"\x1B[90m",resume:"\x1B[96m",complete:"\x1B[34m",error:"\x1B[31m",teardown:"\x1B[91m",derived:"\x1B[35m",path:"\x1B[90m",reset:"\x1B[0m"},eu={data:"",dirty:"",resolved:"",invalidate:"",pause:"",resume:"",complete:"",error:"",teardown:"",derived:"",path:"",reset:""};function tn(t){if(typeof t=="string")return JSON.stringify(t);if(typeof t=="number"||typeof t=="boolean"||t==null)return String(t);try{return JSON.stringify(t)}catch{return"[unserializable]"}}function tu(t){return t==="none"?eu:t==="ansi"||t==null?Za:{data:t.data??"",dirty:t.dirty??"",resolved:t.resolved??"",invalidate:t.invalidate??"",pause:t.pause??"",resume:t.resume??"",complete:t.complete??"",error:t.error??"",teardown:t.teardown??"",derived:t.derived??"",path:t.path??"",reset:t.reset??""}}function go(t){if(t==null)return{};let e=t.detail;return e==="full"?{...t,structured:t.structured??!0,timeline:t.timeline??!0,causal:t.causal??!0,derived:t.derived??!0}:e==="minimal"?{...t,structured:t.structured??!0}:t.format==="stage-log"?{...t,structured:t.structured??!0,timeline:t.timeline??!0}:t}function nu(t,e,n){for(let r=0;r<t.length;r++){let s=t.charCodeAt(r);if(s<32||s===127)throw new Error(`Graph "${e}": ${n} "${t}" must not contain control character (U+${s.toString(16).padStart(4,"0").toUpperCase()} at index ${r})`)}}function Un(t,e,n){if(t==="")throw new Error(`Graph "${e}": ${n} name must be non-empty`);if(t.includes(Z))throw new Error(`Graph "${e}": ${n} "${t}" must not contain '${Z}' (path separator)`);if(t===Me)throw new Error(`Graph "${e}": ${n} name "${Me}" is reserved for meta companion paths`);nu(t,e,n)}function ru(t,e){if(t==="")throw new Error(`Graph "${e}": resolve path must be non-empty`);let n=t.split(Z);for(let r of n)if(r==="")throw new Error(`Graph "${e}": resolve path has empty segment`);return n}function ou(t,e){let n=!1;for(let s of t)if(!e.isMetaPassthrough(s[0])){n=!0;break}return n?t.filter(s=>e.isMetaPassthrough(s[0])):t}function wo(t){for(let e of t._mounts.values())wo(e);for(let e of t._nodes.values())try{e.down([[K]],{internal:!0})}catch{}}var xt=class t{name;opts;config;_nodes=new Map;_nodeToName=new WeakMap;_mounts=new Map;_parent=void 0;_storageDisposers=new Set;_disposers=new Set;_topology;_topologyEmitters=new Set;constructor(e,n){if(e==="")throw new Error("Graph name must be non-empty");if(e.includes(Z))throw new Error(`Graph name must not contain '${Z}' (got "${e}")`);if(e===Me)throw new Error(`Graph name "${Me}" is reserved for meta companion paths`);this.name=e,this.opts=Object.freeze({...n??{}}),this.config=n?.config??le,this._traceRing=new qe(n?.traceCapacity??1e3),n?.versioning!=null&&this.setVersioning(n.versioning)}ancestors(e=!0){let n=[],r=e?this:this._parent;for(;r!=null;)n.push(r),r=r._parent;return n}get topology(){return this._topology==null&&(this._topology=R(e=>{let n=r=>{e.emit(r)};return this._topologyEmitters.add(n),()=>{this._topologyEmitters.delete(n)}},{name:`${this.name}_topology`})),this._topology}_emitTopology(e){if(!(this._topology==null||this._topologyEmitters.size===0))for(let n of this._topologyEmitters)n(e)}add(e,n){let r=e.name,s=n?.name??r;if(s==null||s==="")throw new Error(`Graph "${this.name}": graph.add requires a non-empty name \u2014 pass via opts.name or set it on the node (e.g. state(0, { name: "x" }))`);let o=s,i=n?.annotation;if(Un(o,this.name,"add"),this._mounts.has(o))throw new Error(`Graph "${this.name}": name "${o}" is already a mount point`);if(this._nodes.has(o))throw new Error(`Graph "${this.name}": node "${o}" already exists`);let a=this._nodeToName.get(e);if(a!==void 0)throw new Error(`Graph "${this.name}": node instance already registered as "${a}"`);return this._nodes.set(o,e),this._nodeToName.set(e,o),this._emitTopology({kind:"added",name:o,nodeKind:"node"}),i!=null&&(this._annotations.set(o,i),this.config.inspectorEnabled&&this._traceRing.push({path:o,annotation:i,timestamp_ns:ne()})),e}setVersioning(e){if(e!=null)for(let n of this._nodes.values())n instanceof oe&&n._applyVersioning(e)}remove(e){Un(e,this.name,"remove");let n=this._mounts.get(e);if(n){let o={kind:"mount",nodes:[],mounts:[]},i=[];n._collectObserveTargets("",i);for(let[a,d]of i)a.includes(`${Z}${Me}${Z}`)||o.nodes.push(a);return o.nodes.sort(),o.mounts.push(e),o.mounts.push(...n._collectSubgraphs(`${e}${Z}`)),this._mounts.delete(e),n._parent=void 0,wo(n),this._emitTopology({kind:"removed",name:e,nodeKind:"mount",audit:o}),o}let r=this._nodes.get(e);if(!r)throw new Error(`Graph "${this.name}": unknown node or mount "${e}"`);this._nodes.delete(e),this._nodeToName.delete(r),r.down([[K]],{internal:!0});let s={kind:"node",nodes:[e],mounts:[]};return this._emitTopology({kind:"removed",name:e,nodeKind:"node",audit:s}),s}removeAll(e){let n=typeof e=="function"?e:(()=>{let o=en(e);return i=>o.test(i)})(),r={kind:"mount",nodes:[],mounts:[]},s=[...this._nodes.keys(),...this._mounts.keys()].filter(o=>n(o));for(let o of s){let i=this.remove(o);r.nodes.push(...i.nodes),r.mounts.push(...i.mounts)}return r.nodes.sort(),r.mounts.sort(),r}[Symbol.iterator](){let e=[...this._nodes.keys()].sort(),n=this._nodes,r=0;return{[Symbol.iterator](){return this},next(){if(r>=e.length)return{value:void 0,done:!0};let s=e[r++];return{value:[s,n.get(s)],done:!1}}}}node(e){if(e==="")throw new Error(`Graph "${this.name}": node name must be non-empty`);if(e.includes(Z))return this.resolve(e);let n=this._nodes.get(e);if(!n)throw new Error(`Graph "${this.name}": unknown node "${e}"`);return n}get(e){return this.node(e).cache}set(e,n,r){let s=r?.internal===!0;this.node(e).down([[w,n]],{actor:r?.actor,internal:s,delivery:"write"})}setAll(e,n){let r=Symbol.iterator in e?e:Object.entries(e);j(()=>{for(let[s,o]of r)this.set(s,o,n)})}invalidate(e,n){let r=n?.internal===!0;this.node(e).down([[ve]],{actor:n?.actor,internal:r,delivery:"write"})}error(e,n,r){let s=r?.internal===!0;this.node(e).down([[N,n]],{actor:r?.actor,internal:s,delivery:"write"})}complete(e,n){let r=n?.internal===!0;this.node(e).down([[_]],{actor:n?.actor,internal:r,delivery:"write"})}edges(e){let n=e?.recursive===!0,r=new Map;if(!n){for(let[d,u]of this._nodes)r.set(u,d);let a=[];for(let[d,u]of this._nodes)if(u instanceof oe)for(let c of u._deps){let p=r.get(c.node);p!=null&&a.push([p,d])}return a.sort((d,u)=>d[0]<u[0]?-1:d[0]>u[0]?1:d[1]<u[1]?-1:d[1]>u[1]?1:0),a}let s=[];this._collectObserveTargets("",s);let o=new Map;for(let[a,d]of s)o.set(d,a);let i=[];for(let[a,d]of s)if(d instanceof oe)for(let u of d._deps){let c=o.get(u.node);c!=null&&i.push([c,a])}return i.sort((a,d)=>a[0]<d[0]?-1:a[0]>d[0]?1:a[1]<d[1]?-1:a[1]>d[1]?1:0),i}mount(e,n){if(Un(e,this.name,"mount"),this._nodes.has(e))throw new Error(`Graph "${this.name}": cannot mount at "${e}" \u2014 node with that name exists`);if(this._mounts.has(e))throw new Error(`Graph "${this.name}": mount "${e}" already exists`);if(n===this)throw new Error(`Graph "${this.name}": cannot mount a graph into itself`);if(n._parent!=null)throw new Error(`Graph "${this.name}": this child graph is already mounted on "${n._parent.name}"`);for(let r=this;r!=null;r=r._parent)if(r===n)throw new Error(`Graph "${this.name}": mount("${e}", \u2026) would create a mount cycle`);return this._mounts.set(e,n),n._parent=this,this._emitTopology({kind:"added",name:e,nodeKind:"mount"}),n}resolve(e){let n=ru(e,this.name);return this._resolveFromSegments(n)}tryResolve(e){try{return this.resolve(e)}catch{return}}_resolveFromSegments(e){let n=e;if(n[0]===this.name&&(n=n.slice(1),n.length===0))throw new Error(`Graph "${this.name}": resolve path ends at graph name only`);let r=n[0],s=n.slice(1);if(s.length===0){let a=this._nodes.get(r);if(a)return a;throw this._mounts.has(r)?new Error(`Graph "${this.name}": path ends at subgraph "${r}" \u2014 not a node (GRAPHREFLY-SPEC \xA73.5)`):new Error(`Graph "${this.name}": unknown name "${r}"`)}let o=this._nodes.get(r);if(o&&s.length>0&&s[0]===Me)return this._resolveMetaChainFromNode(o,s,n.join(Z));let i=this._mounts.get(r);if(!i)throw this._nodes.has(r)?new Error(`Graph "${this.name}": "${r}" is a node; trailing path "${s.join(Z)}" is invalid`):new Error(`Graph "${this.name}": unknown mount or node "${r}"`);return i.resolve(s.join(Z))}_resolveMetaChainFromNode(e,n,r){let s=e,o=0,i=[...n];for(;o<i.length;){if(i[o]!==Me)throw new Error(`Graph "${this.name}": expected ${Me} segment in meta path "${r}"`);if(o+1>=i.length)throw new Error(`Graph "${this.name}": meta path requires a key after ${Me} in "${r}"`);let a=i[o+1],d=s.meta[a];if(!d)throw new Error(`Graph "${this.name}": unknown meta "${a}" in path "${r}"`);s=d,o+=2}return s}signal(e,n){if(n?.internal!==!0){for(let s of e)if(this.config.messageTier(s[0])===3)throw new Error(`Graph "${this.name}": Graph.signal() rejects tier-3 messages (DATA / RESOLVED). Broadcast is for control-plane tiers (START / DIRTY / INVALIDATE / PAUSE / RESUME / COMPLETE / ERROR / TEARDOWN). For per-node value writes, use Graph.set or graph.node(name).down(...).`)}let r=[];if(this._signalDeliver(e,n??{},new Set,r),r.length>0)throw r[0]}_signalDeliver(e,n,r,s){for(let d of this._mounts.values())d._signalDeliver(e,n,r,s);let i=n.internal===!0?{internal:!0}:{actor:n.actor,delivery:"signal"},a=ou(e,this.config);for(let d of[...this._nodes.keys()].sort()){let u=this._nodes.get(d);if(!r.has(u)){r.add(u);try{u.down(e,i)}catch(c){if(c instanceof Ne)throw c;s.push(c)}a.length!==0&&this._signalMetaSubtree(u,a,r,i,s)}}}_signalMetaSubtree(e,n,r,s,o){for(let i of Object.keys(e.meta).sort()){let a=e.meta[i];if(!r.has(a)){r.add(a);try{a.down(n,s)}catch(d){if(d instanceof Ne)throw d;o.push(d)}this._signalMetaSubtree(a,n,r,s,o)}}}describe(e){if(e?.reactive===!0)return this._describeReactive(e);let n=e?.actor,r=e?.filter,s=Ut(e?.detail,e?.fields),o=e?.format==="spec",i=o?Ut("minimal"):s,a=[];this._collectObserveTargets("",a);let d=new Map;for(let[x,E]of a)d.set(E,x);let u=[];{let x=a.map(([,M])=>M),E=new Set(d.values()),S=0;for(;x.length>0;){let M=x.shift();if(M instanceof oe)for(let I of M._deps){let D=I.node;if(d.has(D))continue;let L=D.name??"",O=L;if(!O||E.has(O))if(L){let $=2;for(;E.has(`${L}#${$}`);)$++;O=`${L}#${$}`}else for(O=`__internal__/${S++}`;E.has(O);)O=`__internal__/${S++}`;d.set(D,O),E.add(O),u.push([O,D]),x.push(D)}}}let c=[...a,...u],p={};for(let[x,E]of c){if(n!=null&&!E.allowsObserve(n))continue;let S=Hn(E,i),M=E instanceof oe?E._deps.map(O=>d.get(O.node)??O.node.name??""):[],{name:I,...D}=S,L={...D,deps:M};if(!o){let O=this._annotations.get(x);O!=null&&(L.annotation=O)}if(r!=null)if(typeof r=="function"){let O=r;if(!(O.length>=2?O(x,L):O(L)))continue}else{let O=!0;for(let[$,ee]of Object.entries(r)){let z=$==="deps_includes"?"depsIncludes":$==="meta_has"?"metaHas":$;if(z==="depsIncludes"){if(!L.deps.includes(String(ee))){O=!1;break}continue}if(z==="metaHas"){if(!Object.hasOwn(L.meta??{},String(ee))){O=!1;break}continue}if(L[z]!==ee){O=!1;break}}if(!O)continue}p[x]=L}let f=new Set(Object.keys(p)),h=[];for(let[x,E]of c)if(E instanceof oe)for(let S of E._deps){let M=d.get(S.node);M!=null&&h.push([M,x])}h.sort((x,E)=>x[0]<E[0]?-1:x[0]>E[0]?1:x[1]<E[1]?-1:x[1]>E[1]?1:0);let l=h.map(([x,E])=>({from:x,to:E}));(n!=null||r!=null)&&(l=l.filter(x=>f.has(x.from)&&f.has(x.to)));let m=this._collectSubgraphs(""),b=n!=null||r!=null?m.filter(x=>{let E=`${x}${Z}`;return[...f].some(S=>S===x||S.startsWith(E))}):m,g=this,y=e,v={name:this.name,nodes:p,edges:l,subgraphs:b,expand(x){let E={...y,format:void 0};return Array.isArray(x)?(E.fields=x,E.detail=void 0):(E.detail=x,E.fields=void 0),g.describe(E)}},T=e??{},k=T.format;return k==="json"?Ua(v,T):k==="pretty"?qa(v,T):k==="mermaid"?To(v,T):k==="mermaid-url"?Ja(v,T):k==="d2"?Qa(v,T):k==="ascii"?io(v,T):v}_collectSubgraphs(e){let n=[];for(let r of[...this._mounts.keys()].sort()){let s=e===""?r:`${e}${r}`;n.push(s),n.push(...this._mounts.get(r)._collectSubgraphs(`${s}${Z}`))}return n}resourceProfile(e){return po(this,e)}reachable(e,n,r={}){return r.withDetail===!0?bo(this.describe(),e,n,{...r,withDetail:!0}):bo(this.describe(),e,n,r)}explain(e,n,r){return r?.reactive===!0?this._explainReactive(e,n,r):this._explainStatic(e,n,r)}_explainStatic(e,n,r){let s=this.describe({detail:"full"}),o=new Map(this._annotations),i=new Map;for(let[a,d]of Object.entries(s.nodes))d.lastMutation!=null&&i.set(a,d.lastMutation);return ao(s,e,n,{...r?.maxDepth!=null?{maxDepth:r.maxDepth}:{},...r?.findCycle===!0?{findCycle:!0}:{},annotations:o,lastMutations:i})}_describeReactive(e){let n={...e,reactive:!1},r=e.reactiveName??"describe",s=0,o=F(s,{name:`${r}_version`}),i=this.observe({timeline:!0,structured:!0}),a=!1,d=!1,u=()=>{a||d||(a=!0,ht(()=>{a=!1,!d&&(s+=1,o.emit(s))}))},c=i.onEvent(b=>{let g=b.type;g!=="data"&&g!=="error"&&g!=="complete"&&g!=="teardown"||u()}),p=[],f=new WeakSet,h=b=>{if(f.has(b)||d)return;f.add(b);let g=b.topology.subscribe(y=>{for(let v of y){if(v[0]!==w)continue;let T=v[1];if(u(),T.kind==="added"&&T.nodeKind==="mount"){let k=b._mounts.get(T.name);k!=null&&h(k)}}});p.push(g);for(let y of b._mounts.keys()){let v=b._mounts.get(y);v!=null&&h(v)}};h(this);let l;try{l=xe([o],()=>this.describe(n),{name:r,describeKind:"derived",meta:{domain:"audit",kind:"describe"},equals:(b,g)=>b===g})}catch(b){c();for(let g of p)g();throw i.dispose(),b}let m=It(l);return{node:l,dispose(){d=!0,c();for(let b of p)b();p.length=0,i.dispose(),m()}}}_explainReactive(e,n,r){let s=0,o=F(s,{name:"explain_version"}),i=this.observe({timeline:!0,structured:!0}),a=!1,d=!1,u=i.onEvent(h=>{let l=h.type;l!=="data"&&l!=="error"&&l!=="complete"&&l!=="teardown"||a||d||(a=!0,ht(()=>{a=!1,!d&&(s+=1,o.emit(s))}))}),c={...r?.maxDepth!=null?{maxDepth:r.maxDepth}:{},...r?.findCycle===!0?{findCycle:!0}:{}},p;try{p=xe([o],()=>this._explainStatic(e,n,c),{name:r?.name??"explain",describeKind:"derived",meta:{domain:"audit",kind:"explain_path",from:e,to:n},equals:(h,l)=>h.found===l.found&&h.reason===l.reason&&h.steps.length===l.steps.length&&iu(h.steps,l.steps)})}catch(h){throw u(),i.dispose(),h}let f=It(p);return{node:p,dispose(){d=!0,u(),i.dispose(),f()}}}_pathsMatching(e){let n=en(e),r=[];return this._collectObserveTargets("",r),r.map(([s])=>s).filter(s=>n.test(s))}_collectObserveTargets(e,n){for(let r of[...this._mounts.keys()].sort()){let s=e===""?r:`${e}${Z}${r}`;this._mounts.get(r)._collectObserveTargets(s,n)}for(let r of[...this._nodes.keys()].sort()){let s=this._nodes.get(r),o=e===""?r:`${e}${Z}${r}`;n.push([o,s]),this._appendMetaObserveTargets(o,s,n)}}_appendMetaObserveTargets(e,n,r){for(let s of Object.keys(n.meta).sort()){let o=n.meta[s],i=`${e}${Z}${Me}${Z}${s}`;r.push([i,o]),this._appendMetaObserveTargets(i,o,r)}}observe(e,n){let r=typeof e=="string",o=go(r?n:e),i=o.structured===!0||o.timeline===!0||o.causal===!0||o.derived===!0||o.detail==="minimal"||o.detail==="full"||o.format!=null,a=o.actor;if(r){let c=e,p=this.resolve(c);if(a!=null&&!p.allowsObserve(a))throw new Ne({actor:a,action:"observe",nodeName:c});return i?this._buildStructuredObserver([[c,p]],o,"one"):{subscribe(f){return p.subscribe(f)},up(f){try{p.up?.(f)}catch(h){if(h instanceof Ne)return;throw h}}}}let d=[];this._collectObserveTargets("",d),d.sort((c,p)=>c[0]<p[0]?-1:c[0]>p[0]?1:0);let u=a==null?d:d.filter(([,c])=>c.allowsObserve(a));return i?this._buildStructuredObserver(u,o,"all"):{subscribe:c=>{let p=u.map(([f,h])=>h.subscribe(l=>{c(f,l)}));return()=>{for(let f of p)f()}},up:(c,p)=>{try{this.resolve(c).up?.(p)}catch(f){if(f instanceof Ne)return;throw f}}}}_buildStructuredObserver(e,n,r){let s=r==="one"?e[0]?.[0]:void 0,o=i=>{if(r==="one"&&s!=null){let c=this.resolve(s);return this._buildStructuredObserver([[s,c]],i,"one")}let a=[];this._collectObserveTargets("",a),a.sort((c,p)=>c[0]<p[0]?-1:c[0]>p[0]?1:0);let d=i.actor,u=d==null?a:a.filter(([,c])=>c.allowsObserve(d));return this._buildStructuredObserver(u,i,"all")};return this._createObserveResult(e,n,o)}_createObserveResult(e,n,r){let s=n.timeline===!0,o=n.causal===!0,i=n.derived===!0,a=n.detail==="minimal",d=this.config.inspectorEnabled,u=(o||i)&&d,c=n.maxEvents,p=c!=null&&c>0?new qe(c):null,f=[],h=new Set,l={},m=new Set,b=0,g=0,y=0,v=0,T=0,k=0,x=!1,E=!1,S=0,M=new Map,I=new Map,D=new Map,L=P=>{p?p.push(P):f.push(P);for(let q of h)q(P)},O=()=>s?{timestamp_ns:ne(),in_batch:_t(),batch_id:S}:{},$=(P,q)=>{if(!(!u||!(P instanceof oe)))return P._setInspectorHook(pe=>{if(pe.kind==="dep_message")M.set(P,pe.depIndex);else if(pe.kind==="run"){let Ge=pe.batchData.map((U,ce)=>U!=null&&U.length>0?U.at(-1):pe.prevData[ce]);I.set(P,Ge);let be=pe.batchData.map(U=>U!=null?[...U]:void 0);D.set(P,be),i&&L({type:"derived",path:q,dep_values:Ge,dep_batches:be,...O()})}})},ee=P=>{let q=M.get(P),pe=I.get(P);if(!o||pe==null)return{};let be=(q!=null&&q>=0&&P instanceof oe?P._deps[q]:void 0)?.node,U=be?.v,ce=D.get(P);return{trigger_dep_index:q,trigger_dep_name:be?.name,...U!=null?{trigger_version:{id:U.id,version:U.version}}:{},dep_values:[...pe],...ce!=null?{dep_batches:ce}:{}}},z=[],te=[];for(let[P,q]of e){let pe=$(q,P);pe&&z.push(pe),te.push(q.subscribe(Ge=>{S++;for(let be of Ge){let U=be[0],ce=O();if(U===w){l[P]=be[1];let Pe=q instanceof oe?q.lastMutation?.actor??et:et;L({type:"data",path:P,data:be[1],actor:Pe,...ce,...ee(q)})}else if(a)U===G?b++:U===A?g++:U===ve?y++:U===me?v++:U===Te?T++:U===K?k++:U===_&&!m.has(P)?x=!0:U===N&&(E=!0,m.add(P));else if(U===G)b++,L({type:"dirty",path:P,...ce});else if(U===A)g++,L({type:"resolved",path:P,...ce,...ee(q)});else if(U===ve)y++,L({type:"invalidate",path:P,...ce});else if(U===me)v++,L({type:"pause",path:P,lockId:be[1],...ce});else if(U===Te)T++,L({type:"resume",path:P,lockId:be[1],...ce});else if(U===_)m.has(P)||(x=!0),L({type:"complete",path:P,...ce});else if(U===N){E=!0,m.add(P);let Pe=q instanceof oe?q.lastMutation?.actor??et:et;L({type:"error",path:P,data:be[1],actor:Pe,...ce})}else U===K&&(k++,L({type:"teardown",path:P,...ce}))}}))}let ke=!1,De=()=>{if(!ke){ke=!0;for(let P of te)P();for(let P of z)P();for(let P of ge)P({value:void 0,done:!0});ge.length=0}},_e=[],ge=[];h.add(P=>{let q=ge.shift();q?q({value:P,done:!1}):_e.push(P)});let Ve={get values(){return l},get dirtyCount(){return b},get resolvedCount(){return g},get invalidateCount(){return y},get pauseCount(){return v},get resumeCount(){return T},get teardownCount(){return k},get events(){return p?p.toArray():[...f]},get anyCompletedCleanly(){return x},get anyErrored(){return E},get completedWithoutErrors(){return x&&!E},onEvent(P){return h.add(P),()=>h.delete(P)},dispose:De,expand(P){De();let q={...n};return typeof P=="string"?q.detail=P:Object.assign(q,P),r(go(q))},[Symbol.asyncIterator](){return{next(){return _e.length>0?Promise.resolve({value:_e.shift(),done:!1}):ke?Promise.resolve({value:void 0,done:!0}):new Promise(P=>ge.push(P))},return(){return De(),Promise.resolve({value:void 0,done:!0})}}}};return n.format!=null&&this._attachFormatLogger(Ve,n),Ve}_attachFormatLogger(e,n){let r=n.format;if(r==null)return;let s=n.logger??(l=>console.log(l)),o=n.includeTypes?new Set(n.includeTypes):null,i=n.excludeTypes?new Set(n.excludeTypes):null,a=o==null&&i==null?()=>!0:l=>(o==null||o.has(l))&&(i==null||!i.has(l)),d=tu(n.theme),u=r==="stage-log"?ne():0,c=l=>l==null?"":n.stageLabels?.[l]??l,p=(l,m)=>l.length>m?`${l.slice(0,m-1)}\u2026`:l,f=l=>l.type==="data"||l.type==="error"?p(tn(l.data),120):"",h=l=>{if(r==="stage-log"){let E=(ne()-u)/1e9,S=c(l.path).padEnd(9);if(l.type==="data"){let M=f(l);return`[${E.toFixed(3)}s] ${S} \u2190${M?` ${M}`:""}`}if(l.type==="error"){let M=f(l);return`[${E.toFixed(3)}s] ${S} \u2717${M?` ${M}`:""}`}return l.type==="complete"?`[${E.toFixed(3)}s] ${S} \u25A0 complete`:`[${E.toFixed(3)}s] ${S} ${l.type}`}if(r==="json")try{return JSON.stringify(l)}catch{return JSON.stringify({type:l.type,path:l.path,data:"[unserializable]"})}let m=d[l.type]??"",b=l.path?`${d.path}${l.path}${d.reset} `:"",g=l.type==="data"||l.type==="error",y=l.type==="pause"||l.type==="resume",v=g?` ${tn(l.data)}`:y?` ${tn(l.lockId)}`:"",T=l.type==="data"||l.type==="resolved"||l.type==="derived"?l:void 0,k=T?.trigger_dep_name!=null?` <- ${T.trigger_dep_name}`:T?.trigger_dep_index!=null?` <- #${T.trigger_dep_index}`:"",x=l.in_batch?" [batch]":"";return`${b}${m}${l.type.toUpperCase()}${d.reset}${v}${k}${x}`};e.onEvent(l=>{a(l.type)&&s(h(l),l)})}addDisposer(e){return this._disposers.add(e),()=>{this._disposers.delete(e)}}destroy(){ho(this._disposers,this.name),this.signal([[K]],{internal:!0}),ho(this._storageDisposers,this.name);for(let e of[...this._mounts.values()])e._parent=void 0,e._destroyClearOnly();this._mounts.clear(),this._nodes.clear(),this._parent=void 0}_destroyClearOnly(){for(let e of[...this._mounts.values()])e._parent=void 0,e._destroyClearOnly();this._mounts.clear(),this._nodes.clear(),this._parent=void 0}snapshot(e){let{expand:n,...r}=this.describe({detail:"full"}),s={};for(let a of Object.keys(r.nodes).sort()){let{lastMutation:d,guard:u,...c}=r.nodes[a];s[a]=c}let o=[...r.subgraphs].sort(),i={...r,version:1,nodes:s,subgraphs:o};if(e?.format==null)return i;if(e.format==="json-string")return JSON.stringify(i);if(e.format==="bytes"){if(e.codec==null)throw new Error("snapshot({format: 'bytes'}) requires a `codec` name");let a=this.config.lookupCodec(e.codec);if(a==null)throw new Error(`snapshot: codec "${e.codec}" is not registered on this graph's config. Call config.registerCodec(...) before creating nodes.`);return rr(a,a.encode(i))}throw new Error(`snapshot: unknown format "${String(e.format)}"`)}static decode(e,n){let r=n?.config??le,{codec:s,codecVersion:o,payload:i}=or(e,r);return s.decode(i,o)}restore(e,n){if(mo(e),e.name!==this.name)throw new Error(`Graph "${this.name}": restore snapshot name "${e.name}" does not match this graph`);let r=n?.only==null?null:(Array.isArray(n.only)?n.only:[n.only]).map(o=>en(o)),s=n?.includeProducers===!0;for(let o of Object.keys(e.nodes).sort()){if(r!==null&&!r.some(a=>a.test(o)))continue;let i=e.nodes[o];if(i!==void 0){if(!("value"in i)||i.value===void 0){"value"in i&&i.value===void 0&&n?.onError?.(o,new Error(`restore: slice.value is undefined for "${o}" (undefined is the global SENTINEL; not valid DATA)`));continue}if(!(i.type==="derived"||i.type==="effect")&&!(i.type==="producer"&&!s)){if(i.v!=null){let d=this.tryResolve(o)?.v;if(d!=null&&d.id===i.v.id&&d.version===i.v.version)continue}try{this.set(o,i.value)}catch(a){n?.onError?.(o,a)}}}}}static fromSnapshot(e,n){mo(e);let r=typeof n=="function"?n:n?.build,s=typeof n=="function"?void 0:n?.factories,o=new t(e.name);if(r)return r(o),o.restore(e),o;for(let h of[...e.subgraphs].sort((l,m)=>{let b=l.split(Z).length,g=m.split(Z).length;return b!==g?b-g:l<m?-1:l>m?1:0})){let l=h.split(Z),m=o;for(let b of l)m._mounts.has(b)||m.mount(b,new t(b)),m=m._mounts.get(b)}let i=s?Object.entries(s).map(([h,l])=>({re:en(h),factory:l})):[],a=h=>{for(let l of i)if(l.re.test(h))return l.factory},d=h=>{let l=h.split(Z),m=l.pop();if(m==null||m.length===0)throw new Error(`invalid snapshot path "${h}"`);let b=o;for(let g of l){let y=b._mounts.get(g);if(!y)throw new Error(`unknown mount "${g}" in path "${h}"`);b=y}return[b,m]},u=Object.entries(e.nodes).filter(([h])=>!h.includes(`${Z}${Me}${Z}`)).sort((h,l)=>h[0]<l[0]?-1:h[0]>l[0]?1:0),c=new Map(u),p=new Map,f=!0;for(;c.size>0&&f;){f=!1;for(let[h,l]of[...c.entries()]){let m=l?.deps??[];if(!m.every(k=>p.has(k)))continue;let[b,g]=d(h),y={...l?.meta??{}},v=a(h),T;if(l?.type==="state")T=F(l.value,{meta:y});else{if(v==null)continue;T=v(g,{path:h,type:l.type,value:l.value,meta:y,deps:m,resolvedDeps:m.map(k=>p.get(k))})}b.add(T,{name:g}),p.set(h,T),c.delete(h),f=!0}}if(c.size>0){let h=[...c.keys()].sort().join(", ");throw new Error(`Graph.fromSnapshot could not reconstruct nodes without build callback: ${h}. Pass matching factories via fromSnapshot(data, { factories: { pattern: factoryFn } }).`)}return o.restore(e),o}toJSON(){return this.snapshot()}attachStorage(e,n={}){let r=e.map(u=>({tier:u,debounceMs:Math.max(0,u.debounceMs??0),compactEvery:Math.max(1,u.compactEvery??10),timer:void 0,seq:0,lastSnapshot:void 0,lastFingerprint:"",disposed:!1,savePending:void 0}));n.autoRestore===!0&&this._cascadeRestore(e,n.onError);let s=(u,c)=>{if(u.disposed)return;let p=Ka(c.nodes);if(u.lastSnapshot!=null&&p!==""&&p===u.lastFingerprint)return;let f=u.seq+1,h=re(),b=u.lastSnapshot==null||f%u.compactEvery===0?{mode:"full",snapshot:c,seq:f,timestamp_ns:h,format_version:ut}:{mode:"diff",diff:su(u.lastSnapshot,c),seq:f,timestamp_ns:h,format_version:ut};if(u.tier.filter&&!u.tier.filter(this.name,b))return;let g;try{g=u.tier.save(this.name,b)}catch(y){n.onError?.(y,u.tier);return}if(g&&typeof g.then=="function"){let T=(u.savePending??Promise.resolve()).then(()=>g,()=>g).then(()=>{u.disposed||(u.seq=f,u.lastSnapshot=c,u.lastFingerprint=p)},k=>{n.onError?.(k,u.tier)});u.savePending=T.finally(()=>{u.savePending===T&&(u.savePending=void 0)})}else u.seq=f,u.lastSnapshot=c,u.lastFingerprint=p},o=(u,c)=>{try{s(u,c)}catch(p){n.onError?.(p,u.tier)}},i=(u,c)=>{if(!c.some(l=>{let m=this.config.messageTier(l[0]);return m>=3&&m<5}))return;if(n.filter){let l=this.tryResolve(u);if(l==null)return;let m=Hn(l,Ut("standard"));if(!n.filter(u,m))return}let f,h=()=>(f==null&&(f=this.snapshot()),f);for(let l of r)l.disposed||(l.debounceMs===0?o(l,h()):(l.timer==null&&(l.timer=new Oe),l.timer.start(l.debounceMs,()=>{l.disposed||o(l,this.snapshot())})))},a;if(n.paths!=null){let c=(typeof n.paths=="string"?this._pathsMatching(n.paths):n.paths).map(p=>{let f=this.tryResolve(p);return f==null?()=>{}:f.subscribe(h=>i(p,h))});a=()=>{for(let p of c)p()}}else a=this.observe().subscribe((u,c)=>i(u,c));let d=()=>{a();for(let u of r)u.disposed=!0,u.timer?.cancel();this._storageDisposers.delete(d)};return this._storageDisposers.add(d),{dispose:d}}async _cascadeRestore(e,n){for(let r of e){let s;try{s=await r.load(this.name)}catch(i){n?.(i,r);continue}if(s==null||typeof s!="object"||Array.isArray(s))continue;let o=s;try{if(o.mode==="full"&&o.snapshot!=null)return this.restore(o.snapshot),!0;if(o.version===ut&&o.nodes!=null)return this.restore(o),!0}catch(i){n?.(i,r)}}return!1}static async fromStorage(e,n,r){for(let s of n){let o;try{o=await s.load(e)}catch(d){r?.onError?.(d,s);continue}if(o==null||typeof o!="object"||Array.isArray(o))continue;let i=o,a=i.mode==="full"&&i.snapshot!=null?i.snapshot:i.version===ut&&i.nodes!=null?i:void 0;if(a!=null)try{return t.fromSnapshot(a,r)}catch(d){r?.onError?.(d,s)}}throw new Error(`Graph.fromStorage: no tier held a restorable record for "${e}" across ${n.length} tier(s)`)}_annotations=new Map;_traceRing;trace(e,n,r){if(e!=null&&n!=null){if(this.tryResolve(e)==null)return;if(this._annotations.set(e,n),this.config.inspectorEnabled){let s={path:e,annotation:n,timestamp_ns:ne(),...r?.actor!=null?{actor:r.actor}:{}};this._traceRing.push(s)}return}return e!=null?this.config.inspectorEnabled?this._annotations.get(e):void 0:this.config.inspectorEnabled?this._traceRing.toArray():[]}annotation(e){return this._annotations.get(e)}clearTrace(){this._annotations.clear(),this._traceRing.clear()}pruneTrace(e){let n=this._traceRing.toArray().filter(s=>!e(s)),r=this._traceRing.size-n.length;this._traceRing.clear();for(let s of n)this._traceRing.push(s);return r}static diff(e,n){let r=new Set(Object.keys(e.nodes)),s=new Set(Object.keys(n.nodes)),o=[...s].filter(y=>!r.has(y)).sort(),i=[...r].filter(y=>!s.has(y)).sort(),a=[],d=[];for(let y of r){if(!s.has(y))continue;let v=e.nodes[y],T=n.nodes[y],k=v.v,x=T.v;k!=null&&x!=null&&k.id===x.id&&k.version!==x.version&&d.push({path:y,id:k.id,from:k.version,to:x.version});let E=k!=null&&x!=null&&k.id===x.id&&k.version===x.version;for(let S of["type","status","sentinel"]){let M=v[S],I=T[S];M!==I&&a.push({path:y,field:S,from:M,to:I})}if(!E)for(let S of["value","meta"]){let M=v[S],I=T[S];za(M,I)||a.push({path:y,field:S,from:M,to:I})}}let u=y=>`${y.from} ${y.to}`,c=new Set(e.edges.map(u)),p=new Set(n.edges.map(u)),f=n.edges.filter(y=>!c.has(u(y))),h=e.edges.filter(y=>!p.has(u(y))),l=new Set(e.subgraphs),m=new Set(n.subgraphs),b=[...m].filter(y=>!l.has(y)).sort(),g=[...l].filter(y=>!m.has(y)).sort();return{nodesAdded:o,nodesRemoved:i,nodesChanged:a,versionChanges:d,edgesAdded:f,edgesRemoved:h,subgraphsAdded:b,subgraphsRemoved:g}}};function su(t,e){let n=xt.diff(t,e),r={};for(let s of n.nodesAdded){let o=e.nodes[s];o!=null&&(r[s]=o)}return{...n,nodesAddedFull:r}}function bo(t,e,n,r={}){let s={paths:[],depths:new Map,truncated:!1};if(!e)return r.withDetail?s:[];if(!r.both&&n!=="upstream"&&n!=="downstream")throw new Error('reachable: direction must be "upstream" or "downstream"');let o=r.maxDepth;if(o!=null&&(!Number.isInteger(o)||o<0))throw new Error("reachable: maxDepth must be an integer >= 0");if(o===0)return r.withDetail?s:[];let i=new Map,a=new Map,d=new Map,u=new Map,c=new Set;for(let[v,T]of Object.entries(t.nodes)){if(!v)continue;c.add(v);let k=T.deps??[];i.set(v,k);for(let x of k)x&&(c.add(x),a.has(x)||a.set(x,new Set),a.get(x).add(v))}for(let v of t.edges){if(v==null||typeof v!="object")continue;let T=typeof v.from=="string"?v.from:"",k=typeof v.to=="string"?v.to:"";!T||!k||(c.add(T),c.add(k),u.has(T)||u.set(T,new Set),u.get(T).add(k),d.has(k)||d.set(k,new Set),d.get(k).add(T))}if(!c.has(e))return r.withDetail?s:[];let p=r.both===!0,f=v=>{if(p){let E=i.get(v)??[],S=d.get(v),M=a.get(v),I=u.get(v),D=[...E];return S&&D.push(...S),M&&D.push(...M),I&&D.push(...I),D}if(n==="upstream"){let E=i.get(v)??[],S=d.get(v);return S?[...E,...S]:E}let T=a.get(v),k=u.get(v),x=T?[...T]:[];return k&&x.push(...k),x},h=new Set([e]),l=new Map,m=[{path:e,depth:0}],b=0,g=!1;for(;b<m.length;){let v=m[b++];if(o!=null&&v.depth>=o){f(v.path).length>0&&(g=!0);continue}for(let T of f(v.path))!T||h.has(T)||(h.add(T),l.set(T,v.depth+1),m.push({path:T,depth:v.depth+1}))}let y=[...l.keys()].sort((v,T)=>v<T?-1:v>T?1:0);return r.withDetail?{paths:y,depths:l,truncated:g}:y}function iu(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],s=e[n];if(r.path!==s.path||r.type!==s.type||r.status!==s.status||r.hop!==s.hop||r.dep_index!==s.dep_index||r.annotation!==s.annotation||r.value!==s.value||r.lastMutation!==s.lastMutation)return!1;let o=r.v,i=s.v;if(o!==i&&(o==null||i==null||o.id!==i.id||o.version!==i.version))return!1}return!0}function au(t,e,n,r){let s=new xt(t,r);s.add(e,{name:"source"});let o=F(n,{meta:{kind:"stratify_rules"}});s.add(o,{name:"rules"});for(let i of n)uu(s,e,o,i);return s}function uu(t,e,n,r){let s=`branch/${r.name}`,o=Symbol("noValue"),i=!1,a=!1,d=!1,u=o,c=!1,p=n.cache??[];function f(m){if(d){d=!1;let b=u;if(u=o,b!==o){let g=p.find(v=>v.name===r.name),y=!1;try{y=g?.classify(b)??!1}catch{y=!1}y?(c=!1,m.emit(b)):c&&(c=!1,m.down([[G],[A]]))}else c?(c=!1,m.down([[G],[A]])):m.down([[A]])}}let h=B([],(m,b)=>{let g=e.subscribe(v=>{for(let T of v)l(T,0,b)}),y=n.subscribe(v=>{for(let T of v)l(T,1,b)});return()=>{g(),y()}},{describeKind:"derived",meta:{kind:"stratify_branch",branch:r.name},completeWhenDepsComplete:!1});function l(m,b,g){let y=m[0];return y===G?(b===0?(i=!0,c=!0):a=!0,!0):y===w||y===A?(b===0?(i=!1,d=!0,u=y===w?m[1]:o):(y===w&&(p=m[1]),a=!1),i||a||f(g),!0):y===_||y===N||y===K?(i=!1,a=!1,d=!1,u=o,c=!1,b===0&&g.down([m]),!0):b===1}if(t.add(h,{name:s}),r.ops){let m=r.ops(h),b=`branch/${r.name}/out`;t.add(m,{name:b})}}At();ye();X();we();ue();Ie();X();var du=new Map([[ve,"INVALIDATE"],[me,"PAUSE"],[Te,"RESUME"],[K,"TEARDOWN"],[_,"COMPLETE"],[N,"ERROR"]]),cu=new Map([["INVALIDATE",ve],["PAUSE",me],["RESUME",Te],["TEARDOWN",K],["COMPLETE",_],["ERROR",N]]);function Je(t){let e=du.get(t);return e||(Symbol.keyFor(t)??"UNKNOWN")}function dt(t){let e=cu.get(t);if(e)return e;if(t&&t!=="UNKNOWN")return Symbol.for(t)}function ct(t){return t instanceof Error?{message:t.message,name:t.name,stack:t.stack}:{message:String(t),name:"Error"}}function lt(t){let e=new Error(t.message);return e.name=t.name,t.stack&&(e.stack=t.stack),e}function Ye(t){if(typeof MessagePort<"u"&&t instanceof MessagePort)return{post(e,n){t.postMessage(e,n??[])},listen(e){let n=r=>e(r.data);return t.addEventListener("message",n),t.start(),()=>t.removeEventListener("message",n)},terminate(){t.close()}};if(typeof SharedWorker<"u"&&t instanceof SharedWorker)return Ye(t.port);if(typeof Worker<"u"&&t instanceof Worker)return{post(e,n){t.postMessage(e,n??[])},listen(e){let n=r=>e(r.data);return t.addEventListener("message",n),()=>t.removeEventListener("message",n)},terminate(){t.terminate()}};if(typeof BroadcastChannel<"u"&&t instanceof BroadcastChannel)return{post(e,n){n&&n.length>0&&console.warn("[graphrefly] WorkerTransport: BroadcastChannel does not support Transferable objects. The transfer argument is ignored and objects will be cloned instead."),t.postMessage(e)},listen(e){let n=r=>e(r.data);return t.addEventListener("message",n),()=>t.removeEventListener("message",n)},terminate(){t.close()}};if(typeof ServiceWorker<"u"&&t instanceof ServiceWorker)return{post(e,n){t.postMessage(e,n??[])},listen(e){let n=r=>{r.source===t&&e(r.data)};return navigator.serviceWorker.addEventListener("message",n),()=>navigator.serviceWorker.removeEventListener("message",n)}};throw new Error("createTransport: unsupported target type. Expected Worker, SharedWorker, ServiceWorker, BroadcastChannel, or MessagePort.")}function lu(t){return typeof t=="object"&&t!==null&&typeof t.post=="function"&&typeof t.listen=="function"}function xo(t,e){let n=lu(t)?t:Ye(t),r=e.name??"workerBridge",s=Object.entries(e.expose??{}),o=e.import??[],i=e.transfer??{},a=F("connecting",{name:`${r}::meta::status`}),d=F(null,{name:`${r}::meta::error`}),u=new Map,c=new Map;for(let y of o){let v=F(void 0,{name:`${r}::${y}`});u.set(y,v)}let p;if(s.length>0){let y=s.map(([,k])=>k),v=B(y,(k,x)=>{let E={};for(let S=0;S<s.length;S++){let[M]=s[S],I=k[S];I!=null&&I.length>0&&(E[M]=I.at(-1))}Object.keys(E).length!==0&&x.emit(E)},{name:`${r}::aggregated`,partial:!0});p=Mt([v],k=>{let x=k[0];if(x==null||Object.keys(x).length===0)return;let E=[];for(let I of Object.keys(x)){let D=i[I];D&&E.push(...D(x[I]))}let S;for(let[I,D]of s)I in x&&D.v!=null&&(S==null&&(S={}),S[I]=D.v.version);let M={t:"b",u:x,...S?{v:S}:{}};try{n.post(M,E.length>0?E:void 0)}catch(I){d.down([[w,I instanceof Error?I:new Error(String(I))]])}}).subscribe(()=>{})}let f=!1,h=n.listen(y=>{if(f)return;let v=y;switch(v.t){case"r":{j(()=>{for(let[k,x]of Object.entries(v.stores)){let E=u.get(k);E&&E.down([[w,x]])}}),a.down([[w,"connected"]]);let T={};for(let[k,x]of s)T[k]=x.cache;n.post({t:"i",stores:T});break}case"v":{let T=u.get(v.s);T&&T.down([[w,v.d]]);break}case"b":{j(()=>{for(let[T,k]of Object.entries(v.u)){let x=v.v?.[T];if(x!=null){let S=c.get(T);if(S!=null&&x<=S)continue;c.set(T,x)}let E=u.get(T);E&&E.down([[w,k]])}});break}case"e":{let T=u.get(v.s);T&&T.down([[N,lt(v.err)]]);break}case"s":{let T=dt(v.sig);if(!T)break;let k=v.s==="*"?[...u.values()]:u.has(v.s)?[u.get(v.s)]:[];for(let x of k)x.down(v.d===void 0?[[T]]:[[T,v.d]]);break}}}),l=[];for(let[y,v]of s){let T=v.subscribe((k=>{if(!f)for(let x of k){let E=x[0];E!==w&&(le.isLocalOnly(E)||(E===N?n.post({t:"e",s:y,err:ct(x[1])}):n.post({t:"s",s:y,sig:Je(E),d:x.length>1?x[1]:void 0})))}}));l.push(T)}let m;if(e.timeoutMs!=null&&e.timeoutMs>0){let y=We(e.timeoutMs),v=Bt(a,k=>k==="connected");m=Fn(vt(Lt(y,()=>"timeout"),Lt(v,()=>"ready"))).subscribe(k=>{for(let x of k)x[0]===w&&x[1]==="timeout"&&(d.down([[w,new Error("Worker bridge handshake timeout")]]),b())})}function b(){if(!f){f=!0,m?.(),n.post({t:"s",s:"*",sig:Je(K)}),p&&p();for(let y of l)y();l.length=0,h(),a.down([[w,"closed"]]),c.clear(),u.clear()}}let g={meta:{status:a,error:d},destroy:b};for(let[y,v]of u)g[y]=v;return g}ye();X();we();ue();function fu(t){return typeof t=="object"&&t!==null&&typeof t.post=="function"&&typeof t.listen=="function"}function ko(t,e){let n=fu(t)?t:Ye(t),r=e.import??[],s=e.transfer??{},o=new Map,i=new Map,a={};for(let b of r){let g=F(void 0,{name:`worker::${b}`});o.set(b,g),a[b]=g}let d=e.expose(a),u=Object.entries(d),c,p=!1;if(u.length>0){let b=u.map(([,v])=>v),g=B(b,(v,T)=>{let k={};for(let x=0;x<u.length;x++){let[E]=u[x],S=v[x];S!=null&&S.length>0&&(k[E]=S.at(-1))}Object.keys(k).length!==0&&T.emit(k)},{name:"workerSelf::aggregated",partial:!0});c=Mt([g],v=>{if(p)return;let T=v[0];if(T==null||Object.keys(T).length===0)return;let k=[];for(let S of Object.keys(T)){let M=s[S];M&&k.push(...M(T[S]))}let x;for(let[S,M]of u)S in T&&M.v!=null&&(x==null&&(x={}),x[S]=M.v.version);let E={t:"b",u:T,...x?{v:x}:{}};try{n.post(E,k.length>0?k:void 0)}catch{}}).subscribe(()=>{})}let f=[];for(let[b,g]of u){let y=g.subscribe((v=>{if(!p)for(let T of v){let k=T[0];k!==w&&(le.isLocalOnly(k)||(k===N?n.post({t:"e",s:b,err:ct(T[1])}):n.post({t:"s",s:b,sig:Je(k),d:T.length>1?T[1]:void 0})))}}));f.push(y)}let h=n.listen(b=>{if(p)return;let g=b;switch(g.t){case"i":{j(()=>{for(let[y,v]of Object.entries(g.stores)){let T=o.get(y);T&&T.down([[w,v]])}});break}case"v":{let y=o.get(g.s);y&&y.down([[w,g.d]]);break}case"b":{j(()=>{for(let[y,v]of Object.entries(g.u)){let T=g.v?.[y];if(T!=null){let x=i.get(y);if(x!=null&&T<=x)continue;i.set(y,T)}let k=o.get(y);k&&k.down([[w,v]])}});break}case"e":{let y=o.get(g.s);y&&y.down([[N,lt(g.err)]]);break}case"s":{let y=dt(g.sig);if(!y)break;if(y===K&&g.s==="*"){m();return}let v=g.s==="*"?[...o.values()]:o.has(g.s)?[o.get(g.s)]:[];for(let T of v)T.down(g.d===void 0?[[y]]:[[y,g.d]]);break}}}),l={};for(let[b,g]of u)l[b]=g.cache;n.post({t:"r",stores:l});function m(){if(!p){p=!0,c&&c();for(let b of f)b();f.length=0,h(),n.terminate?.(),i.clear(),o.clear()}}return{destroy:m}}0&&(module.exports={CircuitOpenError,ContentAddressedMissError,NS_PER_MS,NS_PER_SEC,NativeIndexBackend,NativeListBackend,NativeLogBackend,NativeMapBackend,NativePubSubBackend,RateLimiterOverflowError,ResettableTimer,TimeoutError,audit,awaitSettled,buffer,bufferCount,bufferTime,cached,canonicalJson,cascadingCache,catchError,checkpointToRedis,checkpointToS3,circuitBreaker,combine,combineLatest,concat,concatMap,constant,contentAddressedStorage,createTransport,createWatermarkController,csvRows,debounce,debounceTime,decorrelatedJitter,delay,deserializeError,dictStorage,distill,distinctUntilChanged,elementAt,empty,escapeRegexChar,exhaustMap,exponential,externalBundle,externalProducer,fallback,fibonacci,filter,find,first,firstValueFrom,firstWhere,flatMap,forEach,fromAny,fromAsyncIter,fromCSV,fromClickHouseWatch,fromCron,fromDrizzle,fromEvent,fromHTTP,fromHTTPPoll,fromHTTPStream,fromIter,fromKafka,fromKysely,fromMCP,fromNATS,fromNDJSON,fromOTel,fromPrisma,fromPrometheus,fromPromise,fromPulsar,fromRabbitMQ,fromRaf,fromRedisStream,fromSSE,fromSqlite,fromSqliteCursor,fromStatsD,fromSyslog,fromTimer,fromWebSocket,fromWebSocketReconnect,fromWebhook,globToRegExp,interval,keepalive,last,linear,lru,makeHttpError,map,matchesAnyPattern,matchesCron,memoryStorage,merge,mergeMap,nameToSignal,ndjsonRows,never,nodeSignal,of,onFirstData,pairwise,parseCron,parsePrometheusText,parseSSEStream,parseStatsD,parseSyslog,pausable,pubsub,race,rateLimiter,reactiveCounter,reactiveIndex,reactiveList,reactiveLog,reactiveMap,reactiveSink,reduce,repeat,replay,rescue,resolveBackoffPreset,retry,retrySource,sample,scan,serializeError,share,shareReplay,signalToName,singleFromAny,singleNodeFromAny,skip,sortJsonValue,stableJsonString,stratify,switchMap,take,takeUntil,takeWhile,tap,tapFirst,throttle,throttleTime,throwError,timeout,toArray,toCSV,toClickHouse,toFile,toHTTP,toKafka,toLoki,toMongo,toNATS,toObservable,toPostgres,toPulsar,toRabbitMQ,toReadableStream,toRedisStream,toS3,toSSE,toSSEBytes,toSqlite,toTempo,toWebSocket,tokenBucket,valve,verifiable,window,windowCount,windowTime,withBreaker,withLatestFrom,withMaxAttempts,withStatus,workerBridge,workerSelf,zip});
|
|
24
|
+
`)}function Xa(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function en(t){let e="^";for(let n=0;n<t.length;n+=1){let r=t[n];if(r==="*"){e+=".*";continue}if(r==="?"){e+=".";continue}if(r==="["){let s=t.indexOf("]",n+1);if(s<=n+1){e+="\\[";continue}let o=t.slice(n+1,s);o.startsWith("!")&&(o=`^${o.slice(1)}`),o=o.replace(/\\/g,"\\\\"),e+=`[${o}]`,n=s;continue}e+=Xa(r)}return e+="$",new RegExp(e)}var Za={data:"\x1B[32m",dirty:"\x1B[33m",resolved:"\x1B[36m",invalidate:"\x1B[93m",pause:"\x1B[90m",resume:"\x1B[96m",complete:"\x1B[34m",error:"\x1B[31m",teardown:"\x1B[91m",derived:"\x1B[35m",path:"\x1B[90m",reset:"\x1B[0m"},eu={data:"",dirty:"",resolved:"",invalidate:"",pause:"",resume:"",complete:"",error:"",teardown:"",derived:"",path:"",reset:""};function tn(t){if(typeof t=="string")return JSON.stringify(t);if(typeof t=="number"||typeof t=="boolean"||t==null)return String(t);try{return JSON.stringify(t)}catch{return"[unserializable]"}}function tu(t){return t==="none"?eu:t==="ansi"||t==null?Za:{data:t.data??"",dirty:t.dirty??"",resolved:t.resolved??"",invalidate:t.invalidate??"",pause:t.pause??"",resume:t.resume??"",complete:t.complete??"",error:t.error??"",teardown:t.teardown??"",derived:t.derived??"",path:t.path??"",reset:t.reset??""}}function go(t){if(t==null)return{};let e=t.detail;return e==="full"?{...t,structured:t.structured??!0,timeline:t.timeline??!0,causal:t.causal??!0,derived:t.derived??!0}:e==="minimal"?{...t,structured:t.structured??!0}:t.format==="stage-log"?{...t,structured:t.structured??!0,timeline:t.timeline??!0}:t}function nu(t,e,n){for(let r=0;r<t.length;r++){let s=t.charCodeAt(r);if(s<32||s===127)throw new Error(`Graph "${e}": ${n} "${t}" must not contain control character (U+${s.toString(16).padStart(4,"0").toUpperCase()} at index ${r})`)}}function Un(t,e,n){if(t==="")throw new Error(`Graph "${e}": ${n} name must be non-empty`);if(t.includes(Z))throw new Error(`Graph "${e}": ${n} "${t}" must not contain '${Z}' (path separator)`);if(t===Me)throw new Error(`Graph "${e}": ${n} name "${Me}" is reserved for meta companion paths`);nu(t,e,n)}function ru(t,e){if(t==="")throw new Error(`Graph "${e}": resolve path must be non-empty`);let n=t.split(Z);for(let r of n)if(r==="")throw new Error(`Graph "${e}": resolve path has empty segment`);return n}function ou(t,e){let n=!1;for(let s of t)if(!e.isMetaPassthrough(s[0])){n=!0;break}return n?t.filter(s=>e.isMetaPassthrough(s[0])):t}function wo(t){for(let e of t._mounts.values())wo(e);for(let e of t._nodes.values())try{e.down([[K]],{internal:!0})}catch{}}var xt=class t{name;opts;config;_nodes=new Map;_nodeToName=new WeakMap;_mounts=new Map;_parent=void 0;_storageDisposers=new Set;_disposers=new Set;_destroyed=!1;_topology;_topologyEmitters=new Set;constructor(e,n){if(e==="")throw new Error("Graph name must be non-empty");if(e.includes(Z))throw new Error(`Graph name must not contain '${Z}' (got "${e}")`);if(e===Me)throw new Error(`Graph name "${Me}" is reserved for meta companion paths`);this.name=e,this.opts=Object.freeze({...n??{}}),this.config=n?.config??le,this._traceRing=new qe(n?.traceCapacity??1e3),n?.versioning!=null&&this.setVersioning(n.versioning)}ancestors(e=!0){let n=[],r=e?this:this._parent;for(;r!=null;)n.push(r),r=r._parent;return n}get topology(){return this._topology==null&&(this._topology=R(e=>{let n=r=>{e.emit(r)};return this._topologyEmitters.add(n),()=>{this._topologyEmitters.delete(n)}},{name:`${this.name}_topology`})),this._topology}_emitTopology(e){if(!(this._topology==null||this._topologyEmitters.size===0))for(let n of this._topologyEmitters)n(e)}add(e,n){let r=e.name,s=n?.name??r;if(s==null||s==="")throw new Error(`Graph "${this.name}": graph.add requires a non-empty name \u2014 pass via opts.name or set it on the node (e.g. state(0, { name: "x" }))`);let o=s,i=n?.annotation;if(Un(o,this.name,"add"),this._mounts.has(o))throw new Error(`Graph "${this.name}": name "${o}" is already a mount point`);if(this._nodes.has(o))throw new Error(`Graph "${this.name}": node "${o}" already exists`);let a=this._nodeToName.get(e);if(a!==void 0)throw new Error(`Graph "${this.name}": node instance already registered as "${a}"`);return this._nodes.set(o,e),this._nodeToName.set(e,o),this._emitTopology({kind:"added",name:o,nodeKind:"node"}),i!=null&&(this._annotations.set(o,i),this.config.inspectorEnabled&&this._traceRing.push({path:o,annotation:i,timestamp_ns:ne()})),e}setVersioning(e){if(e!=null)for(let n of this._nodes.values())n instanceof oe&&n._applyVersioning(e)}remove(e){Un(e,this.name,"remove");let n=this._mounts.get(e);if(n){let o={kind:"mount",nodes:[],mounts:[]},i=[];n._collectObserveTargets("",i);for(let[a,d]of i)a.includes(`${Z}${Me}${Z}`)||o.nodes.push(a);return o.nodes.sort(),o.mounts.push(e),o.mounts.push(...n._collectSubgraphs(`${e}${Z}`)),this._mounts.delete(e),n._parent=void 0,wo(n),this._emitTopology({kind:"removed",name:e,nodeKind:"mount",audit:o}),o}let r=this._nodes.get(e);if(!r)throw new Error(`Graph "${this.name}": unknown node or mount "${e}"`);this._nodes.delete(e),this._nodeToName.delete(r),r.down([[K]],{internal:!0});let s={kind:"node",nodes:[e],mounts:[]};return this._emitTopology({kind:"removed",name:e,nodeKind:"node",audit:s}),s}removeAll(e){let n=typeof e=="function"?e:(()=>{let o=en(e);return i=>o.test(i)})(),r={kind:"mount",nodes:[],mounts:[]},s=[...this._nodes.keys(),...this._mounts.keys()].filter(o=>n(o));for(let o of s){let i=this.remove(o);r.nodes.push(...i.nodes),r.mounts.push(...i.mounts)}return r.nodes.sort(),r.mounts.sort(),r}[Symbol.iterator](){let e=[...this._nodes.keys()].sort(),n=this._nodes,r=0;return{[Symbol.iterator](){return this},next(){if(r>=e.length)return{value:void 0,done:!0};let s=e[r++];return{value:[s,n.get(s)],done:!1}}}}node(e){if(e==="")throw new Error(`Graph "${this.name}": node name must be non-empty`);if(e.includes(Z))return this.resolve(e);let n=this._nodes.get(e);if(!n)throw new Error(`Graph "${this.name}": unknown node "${e}"`);return n}get(e){return this.node(e).cache}set(e,n,r){let s=r?.internal===!0;this.node(e).down([[w,n]],{actor:r?.actor,internal:s,delivery:"write"})}setAll(e,n){let r=Symbol.iterator in e?e:Object.entries(e);j(()=>{for(let[s,o]of r)this.set(s,o,n)})}invalidate(e,n){let r=n?.internal===!0;this.node(e).down([[ve]],{actor:n?.actor,internal:r,delivery:"write"})}error(e,n,r){let s=r?.internal===!0;this.node(e).down([[N,n]],{actor:r?.actor,internal:s,delivery:"write"})}complete(e,n){let r=n?.internal===!0;this.node(e).down([[_]],{actor:n?.actor,internal:r,delivery:"write"})}edges(e){let n=e?.recursive===!0,r=new Map;if(!n){for(let[d,u]of this._nodes)r.set(u,d);let a=[];for(let[d,u]of this._nodes)if(u instanceof oe)for(let c of u._deps){let p=r.get(c.node);p!=null&&a.push([p,d])}return a.sort((d,u)=>d[0]<u[0]?-1:d[0]>u[0]?1:d[1]<u[1]?-1:d[1]>u[1]?1:0),a}let s=[];this._collectObserveTargets("",s);let o=new Map;for(let[a,d]of s)o.set(d,a);let i=[];for(let[a,d]of s)if(d instanceof oe)for(let u of d._deps){let c=o.get(u.node);c!=null&&i.push([c,a])}return i.sort((a,d)=>a[0]<d[0]?-1:a[0]>d[0]?1:a[1]<d[1]?-1:a[1]>d[1]?1:0),i}mount(e,n){if(Un(e,this.name,"mount"),this._nodes.has(e))throw new Error(`Graph "${this.name}": cannot mount at "${e}" \u2014 node with that name exists`);if(this._mounts.has(e))throw new Error(`Graph "${this.name}": mount "${e}" already exists`);if(n===this)throw new Error(`Graph "${this.name}": cannot mount a graph into itself`);if(n._parent!=null)throw new Error(`Graph "${this.name}": this child graph is already mounted on "${n._parent.name}"`);for(let r=this;r!=null;r=r._parent)if(r===n)throw new Error(`Graph "${this.name}": mount("${e}", \u2026) would create a mount cycle`);return this._mounts.set(e,n),n._parent=this,this._emitTopology({kind:"added",name:e,nodeKind:"mount"}),n}resolve(e){let n=ru(e,this.name);return this._resolveFromSegments(n)}tryResolve(e){try{return this.resolve(e)}catch{return}}_resolveFromSegments(e){let n=e;if(n[0]===this.name&&(n=n.slice(1),n.length===0))throw new Error(`Graph "${this.name}": resolve path ends at graph name only`);let r=n[0],s=n.slice(1);if(s.length===0){let a=this._nodes.get(r);if(a)return a;throw this._mounts.has(r)?new Error(`Graph "${this.name}": path ends at subgraph "${r}" \u2014 not a node (GRAPHREFLY-SPEC \xA73.5)`):new Error(`Graph "${this.name}": unknown name "${r}"`)}let o=this._nodes.get(r);if(o&&s.length>0&&s[0]===Me)return this._resolveMetaChainFromNode(o,s,n.join(Z));let i=this._mounts.get(r);if(!i)throw this._nodes.has(r)?new Error(`Graph "${this.name}": "${r}" is a node; trailing path "${s.join(Z)}" is invalid`):new Error(`Graph "${this.name}": unknown mount or node "${r}"`);return i.resolve(s.join(Z))}_resolveMetaChainFromNode(e,n,r){let s=e,o=0,i=[...n];for(;o<i.length;){if(i[o]!==Me)throw new Error(`Graph "${this.name}": expected ${Me} segment in meta path "${r}"`);if(o+1>=i.length)throw new Error(`Graph "${this.name}": meta path requires a key after ${Me} in "${r}"`);let a=i[o+1],d=s.meta[a];if(!d)throw new Error(`Graph "${this.name}": unknown meta "${a}" in path "${r}"`);s=d,o+=2}return s}signal(e,n){if(n?.internal!==!0){for(let s of e)if(this.config.messageTier(s[0])===3)throw new Error(`Graph "${this.name}": Graph.signal() rejects tier-3 messages (DATA / RESOLVED). Broadcast is for control-plane tiers (START / DIRTY / INVALIDATE / PAUSE / RESUME / COMPLETE / ERROR / TEARDOWN). For per-node value writes, use Graph.set or graph.node(name).down(...).`)}let r=[];if(this._signalDeliver(e,n??{},new Set,r),r.length>0)throw r[0]}_signalDeliver(e,n,r,s){for(let d of this._mounts.values())d._signalDeliver(e,n,r,s);let i=n.internal===!0?{internal:!0}:{actor:n.actor,delivery:"signal"},a=ou(e,this.config);for(let d of[...this._nodes.keys()].sort()){let u=this._nodes.get(d);if(!r.has(u)){r.add(u);try{u.down(e,i)}catch(c){if(c instanceof Ne)throw c;s.push(c)}a.length!==0&&this._signalMetaSubtree(u,a,r,i,s)}}}_signalMetaSubtree(e,n,r,s,o){for(let i of Object.keys(e.meta).sort()){let a=e.meta[i];if(!r.has(a)){r.add(a);try{a.down(n,s)}catch(d){if(d instanceof Ne)throw d;o.push(d)}this._signalMetaSubtree(a,n,r,s,o)}}}describe(e){if(e?.reactive===!0)return this._describeReactive(e);let n=e?.actor,r=e?.filter,s=Ut(e?.detail,e?.fields),o=e?.format==="spec",i=o?Ut("minimal"):s,a=[];this._collectObserveTargets("",a);let d=new Map;for(let[x,E]of a)d.set(E,x);let u=[];{let x=a.map(([,M])=>M),E=new Set(d.values()),S=0;for(;x.length>0;){let M=x.shift();if(M instanceof oe)for(let I of M._deps){let D=I.node;if(d.has(D))continue;let L=D.name??"",O=L;if(!O||E.has(O))if(L){let $=2;for(;E.has(`${L}#${$}`);)$++;O=`${L}#${$}`}else for(O=`__internal__/${S++}`;E.has(O);)O=`__internal__/${S++}`;d.set(D,O),E.add(O),u.push([O,D]),x.push(D)}}}let c=[...a,...u],p={};for(let[x,E]of c){if(n!=null&&!E.allowsObserve(n))continue;let S=Hn(E,i),M=E instanceof oe?E._deps.map(O=>d.get(O.node)??O.node.name??""):[],{name:I,...D}=S,L={...D,deps:M};if(!o){let O=this._annotations.get(x);O!=null&&(L.annotation=O)}if(r!=null)if(typeof r=="function"){let O=r;if(!(O.length>=2?O(x,L):O(L)))continue}else{let O=!0;for(let[$,ee]of Object.entries(r)){let z=$==="deps_includes"?"depsIncludes":$==="meta_has"?"metaHas":$;if(z==="depsIncludes"){if(!L.deps.includes(String(ee))){O=!1;break}continue}if(z==="metaHas"){if(!Object.hasOwn(L.meta??{},String(ee))){O=!1;break}continue}if(L[z]!==ee){O=!1;break}}if(!O)continue}p[x]=L}let f=new Set(Object.keys(p)),h=[];for(let[x,E]of c)if(E instanceof oe)for(let S of E._deps){let M=d.get(S.node);M!=null&&h.push([M,x])}h.sort((x,E)=>x[0]<E[0]?-1:x[0]>E[0]?1:x[1]<E[1]?-1:x[1]>E[1]?1:0);let l=h.map(([x,E])=>({from:x,to:E}));(n!=null||r!=null)&&(l=l.filter(x=>f.has(x.from)&&f.has(x.to)));let m=this._collectSubgraphs(""),b=n!=null||r!=null?m.filter(x=>{let E=`${x}${Z}`;return[...f].some(S=>S===x||S.startsWith(E))}):m,g=this,y=e,v={name:this.name,nodes:p,edges:l,subgraphs:b,expand(x){let E={...y,format:void 0};return Array.isArray(x)?(E.fields=x,E.detail=void 0):(E.detail=x,E.fields=void 0),g.describe(E)}},T=e??{},k=T.format;return k==="json"?Ua(v,T):k==="pretty"?qa(v,T):k==="mermaid"?To(v,T):k==="mermaid-url"?Ja(v,T):k==="d2"?Qa(v,T):k==="ascii"?io(v,T):v}_collectSubgraphs(e){let n=[];for(let r of[...this._mounts.keys()].sort()){let s=e===""?r:`${e}${r}`;n.push(s),n.push(...this._mounts.get(r)._collectSubgraphs(`${s}${Z}`))}return n}resourceProfile(e){return po(this,e)}reachable(e,n,r={}){return r.withDetail===!0?bo(this.describe(),e,n,{...r,withDetail:!0}):bo(this.describe(),e,n,r)}explain(e,n,r){return r?.reactive===!0?this._explainReactive(e,n,r):this._explainStatic(e,n,r)}_explainStatic(e,n,r){let s=this.describe({detail:"full"}),o=new Map(this._annotations),i=new Map;for(let[a,d]of Object.entries(s.nodes))d.lastMutation!=null&&i.set(a,d.lastMutation);return ao(s,e,n,{...r?.maxDepth!=null?{maxDepth:r.maxDepth}:{},...r?.findCycle===!0?{findCycle:!0}:{},annotations:o,lastMutations:i})}_describeReactive(e){let n={...e,reactive:!1},r=e.reactiveName??"describe",s=0,o=F(s,{name:`${r}_version`}),i=this.observe({timeline:!0,structured:!0}),a=!1,d=!1,u=()=>{a||d||(a=!0,ht(()=>{a=!1,!d&&(s+=1,o.emit(s))}))},c=i.onEvent(b=>{let g=b.type;g!=="data"&&g!=="error"&&g!=="complete"&&g!=="teardown"||u()}),p=[],f=new WeakSet,h=b=>{if(f.has(b)||d)return;f.add(b);let g=b.topology.subscribe(y=>{for(let v of y){if(v[0]!==w)continue;let T=v[1];if(u(),T.kind==="added"&&T.nodeKind==="mount"){let k=b._mounts.get(T.name);k!=null&&h(k)}}});p.push(g);for(let y of b._mounts.keys()){let v=b._mounts.get(y);v!=null&&h(v)}};h(this);let l;try{l=xe([o],()=>this.describe(n),{name:r,describeKind:"derived",meta:{domain:"audit",kind:"describe"},equals:(b,g)=>b===g})}catch(b){c();for(let g of p)g();throw i.dispose(),b}let m=It(l);return{node:l,dispose(){d=!0,c();for(let b of p)b();p.length=0,i.dispose(),m()}}}_explainReactive(e,n,r){let s=0,o=F(s,{name:"explain_version"}),i=this.observe({timeline:!0,structured:!0}),a=!1,d=!1,u=i.onEvent(h=>{let l=h.type;l!=="data"&&l!=="error"&&l!=="complete"&&l!=="teardown"||a||d||(a=!0,ht(()=>{a=!1,!d&&(s+=1,o.emit(s))}))}),c={...r?.maxDepth!=null?{maxDepth:r.maxDepth}:{},...r?.findCycle===!0?{findCycle:!0}:{}},p;try{p=xe([o],()=>this._explainStatic(e,n,c),{name:r?.name??"explain",describeKind:"derived",meta:{domain:"audit",kind:"explain_path",from:e,to:n},equals:(h,l)=>h.found===l.found&&h.reason===l.reason&&h.steps.length===l.steps.length&&iu(h.steps,l.steps)})}catch(h){throw u(),i.dispose(),h}let f=It(p);return{node:p,dispose(){d=!0,u(),i.dispose(),f()}}}_pathsMatching(e){let n=en(e),r=[];return this._collectObserveTargets("",r),r.map(([s])=>s).filter(s=>n.test(s))}_collectObserveTargets(e,n){for(let r of[...this._mounts.keys()].sort()){let s=e===""?r:`${e}${Z}${r}`;this._mounts.get(r)._collectObserveTargets(s,n)}for(let r of[...this._nodes.keys()].sort()){let s=this._nodes.get(r),o=e===""?r:`${e}${Z}${r}`;n.push([o,s]),this._appendMetaObserveTargets(o,s,n)}}_appendMetaObserveTargets(e,n,r){for(let s of Object.keys(n.meta).sort()){let o=n.meta[s],i=`${e}${Z}${Me}${Z}${s}`;r.push([i,o]),this._appendMetaObserveTargets(i,o,r)}}observe(e,n){let r=typeof e=="string",o=go(r?n:e),i=o.structured===!0||o.timeline===!0||o.causal===!0||o.derived===!0||o.detail==="minimal"||o.detail==="full"||o.format!=null,a=o.actor;if(r){let c=e,p=this.resolve(c);if(a!=null&&!p.allowsObserve(a))throw new Ne({actor:a,action:"observe",nodeName:c});return i?this._buildStructuredObserver([[c,p]],o,"one"):{subscribe(f){return p.subscribe(f)},up(f){try{p.up?.(f)}catch(h){if(h instanceof Ne)return;throw h}}}}let d=[];this._collectObserveTargets("",d),d.sort((c,p)=>c[0]<p[0]?-1:c[0]>p[0]?1:0);let u=a==null?d:d.filter(([,c])=>c.allowsObserve(a));return i?this._buildStructuredObserver(u,o,"all"):{subscribe:c=>{let p=u.map(([f,h])=>h.subscribe(l=>{c(f,l)}));return()=>{for(let f of p)f()}},up:(c,p)=>{try{this.resolve(c).up?.(p)}catch(f){if(f instanceof Ne)return;throw f}}}}_buildStructuredObserver(e,n,r){let s=r==="one"?e[0]?.[0]:void 0,o=i=>{if(r==="one"&&s!=null){let c=this.resolve(s);return this._buildStructuredObserver([[s,c]],i,"one")}let a=[];this._collectObserveTargets("",a),a.sort((c,p)=>c[0]<p[0]?-1:c[0]>p[0]?1:0);let d=i.actor,u=d==null?a:a.filter(([,c])=>c.allowsObserve(d));return this._buildStructuredObserver(u,i,"all")};return this._createObserveResult(e,n,o)}_createObserveResult(e,n,r){let s=n.timeline===!0,o=n.causal===!0,i=n.derived===!0,a=n.detail==="minimal",d=this.config.inspectorEnabled,u=(o||i)&&d,c=n.maxEvents,p=c!=null&&c>0?new qe(c):null,f=[],h=new Set,l={},m=new Set,b=0,g=0,y=0,v=0,T=0,k=0,x=!1,E=!1,S=0,M=new Map,I=new Map,D=new Map,L=P=>{p?p.push(P):f.push(P);for(let q of h)q(P)},O=()=>s?{timestamp_ns:ne(),in_batch:_t(),batch_id:S}:{},$=(P,q)=>{if(!(!u||!(P instanceof oe)))return P._setInspectorHook(pe=>{if(pe.kind==="dep_message")M.set(P,pe.depIndex);else if(pe.kind==="run"){let Ge=pe.batchData.map((U,ce)=>U!=null&&U.length>0?U.at(-1):pe.prevData[ce]);I.set(P,Ge);let be=pe.batchData.map(U=>U!=null?[...U]:void 0);D.set(P,be),i&&L({type:"derived",path:q,dep_values:Ge,dep_batches:be,...O()})}})},ee=P=>{let q=M.get(P),pe=I.get(P);if(!o||pe==null)return{};let be=(q!=null&&q>=0&&P instanceof oe?P._deps[q]:void 0)?.node,U=be?.v,ce=D.get(P);return{trigger_dep_index:q,trigger_dep_name:be?.name,...U!=null?{trigger_version:{id:U.id,version:U.version}}:{},dep_values:[...pe],...ce!=null?{dep_batches:ce}:{}}},z=[],te=[];for(let[P,q]of e){let pe=$(q,P);pe&&z.push(pe),te.push(q.subscribe(Ge=>{S++;for(let be of Ge){let U=be[0],ce=O();if(U===w){l[P]=be[1];let Pe=q instanceof oe?q.lastMutation?.actor??et:et;L({type:"data",path:P,data:be[1],actor:Pe,...ce,...ee(q)})}else if(a)U===G?b++:U===A?g++:U===ve?y++:U===me?v++:U===Te?T++:U===K?k++:U===_&&!m.has(P)?x=!0:U===N&&(E=!0,m.add(P));else if(U===G)b++,L({type:"dirty",path:P,...ce});else if(U===A)g++,L({type:"resolved",path:P,...ce,...ee(q)});else if(U===ve)y++,L({type:"invalidate",path:P,...ce});else if(U===me)v++,L({type:"pause",path:P,lockId:be[1],...ce});else if(U===Te)T++,L({type:"resume",path:P,lockId:be[1],...ce});else if(U===_)m.has(P)||(x=!0),L({type:"complete",path:P,...ce});else if(U===N){E=!0,m.add(P);let Pe=q instanceof oe?q.lastMutation?.actor??et:et;L({type:"error",path:P,data:be[1],actor:Pe,...ce})}else U===K&&(k++,L({type:"teardown",path:P,...ce}))}}))}let ke=!1,De=()=>{if(!ke){ke=!0;for(let P of te)P();for(let P of z)P();for(let P of ge)P({value:void 0,done:!0});ge.length=0}},_e=[],ge=[];h.add(P=>{let q=ge.shift();q?q({value:P,done:!1}):_e.push(P)});let Ve={get values(){return l},get dirtyCount(){return b},get resolvedCount(){return g},get invalidateCount(){return y},get pauseCount(){return v},get resumeCount(){return T},get teardownCount(){return k},get events(){return p?p.toArray():[...f]},get anyCompletedCleanly(){return x},get anyErrored(){return E},get completedWithoutErrors(){return x&&!E},onEvent(P){return h.add(P),()=>h.delete(P)},dispose:De,expand(P){De();let q={...n};return typeof P=="string"?q.detail=P:Object.assign(q,P),r(go(q))},[Symbol.asyncIterator](){return{next(){return _e.length>0?Promise.resolve({value:_e.shift(),done:!1}):ke?Promise.resolve({value:void 0,done:!0}):new Promise(P=>ge.push(P))},return(){return De(),Promise.resolve({value:void 0,done:!0})}}}};return n.format!=null&&this._attachFormatLogger(Ve,n),Ve}_attachFormatLogger(e,n){let r=n.format;if(r==null)return;let s=n.logger??(l=>console.log(l)),o=n.includeTypes?new Set(n.includeTypes):null,i=n.excludeTypes?new Set(n.excludeTypes):null,a=o==null&&i==null?()=>!0:l=>(o==null||o.has(l))&&(i==null||!i.has(l)),d=tu(n.theme),u=r==="stage-log"?ne():0,c=l=>l==null?"":n.stageLabels?.[l]??l,p=(l,m)=>l.length>m?`${l.slice(0,m-1)}\u2026`:l,f=l=>l.type==="data"||l.type==="error"?p(tn(l.data),120):"",h=l=>{if(r==="stage-log"){let E=(ne()-u)/1e9,S=c(l.path).padEnd(9);if(l.type==="data"){let M=f(l);return`[${E.toFixed(3)}s] ${S} \u2190${M?` ${M}`:""}`}if(l.type==="error"){let M=f(l);return`[${E.toFixed(3)}s] ${S} \u2717${M?` ${M}`:""}`}return l.type==="complete"?`[${E.toFixed(3)}s] ${S} \u25A0 complete`:`[${E.toFixed(3)}s] ${S} ${l.type}`}if(r==="json")try{return JSON.stringify(l)}catch{return JSON.stringify({type:l.type,path:l.path,data:"[unserializable]"})}let m=d[l.type]??"",b=l.path?`${d.path}${l.path}${d.reset} `:"",g=l.type==="data"||l.type==="error",y=l.type==="pause"||l.type==="resume",v=g?` ${tn(l.data)}`:y?` ${tn(l.lockId)}`:"",T=l.type==="data"||l.type==="resolved"||l.type==="derived"?l:void 0,k=T?.trigger_dep_name!=null?` <- ${T.trigger_dep_name}`:T?.trigger_dep_index!=null?` <- #${T.trigger_dep_index}`:"",x=l.in_batch?" [batch]":"";return`${b}${m}${l.type.toUpperCase()}${d.reset}${v}${k}${x}`};e.onEvent(l=>{a(l.type)&&s(h(l),l)})}addDisposer(e){return this._disposers.add(e),()=>{this._disposers.delete(e)}}destroy(){ho(this._disposers,this.name),this.signal([[K]],{internal:!0}),ho(this._storageDisposers,this.name);for(let e of[...this._mounts.values()])e._parent=void 0,e._destroyClearOnly();this._mounts.clear(),this._nodes.clear(),this._parent=void 0,this._destroyed=!0}get destroyed(){return this._destroyed}_destroyClearOnly(){for(let e of[...this._mounts.values()])e._parent=void 0,e._destroyClearOnly();this._mounts.clear(),this._nodes.clear(),this._parent=void 0,this._destroyed=!0}snapshot(e){let{expand:n,...r}=this.describe({detail:"full"}),s={};for(let a of Object.keys(r.nodes).sort()){let{lastMutation:d,guard:u,...c}=r.nodes[a];s[a]=c}let o=[...r.subgraphs].sort(),i={...r,version:1,nodes:s,subgraphs:o};if(e?.format==null)return i;if(e.format==="json-string")return JSON.stringify(i);if(e.format==="bytes"){if(e.codec==null)throw new Error("snapshot({format: 'bytes'}) requires a `codec` name");let a=this.config.lookupCodec(e.codec);if(a==null)throw new Error(`snapshot: codec "${e.codec}" is not registered on this graph's config. Call config.registerCodec(...) before creating nodes.`);return rr(a,a.encode(i))}throw new Error(`snapshot: unknown format "${String(e.format)}"`)}static decode(e,n){let r=n?.config??le,{codec:s,codecVersion:o,payload:i}=or(e,r);return s.decode(i,o)}restore(e,n){if(mo(e),e.name!==this.name)throw new Error(`Graph "${this.name}": restore snapshot name "${e.name}" does not match this graph`);let r=n?.only==null?null:(Array.isArray(n.only)?n.only:[n.only]).map(o=>en(o)),s=n?.includeProducers===!0;for(let o of Object.keys(e.nodes).sort()){if(r!==null&&!r.some(a=>a.test(o)))continue;let i=e.nodes[o];if(i!==void 0){if(!("value"in i)||i.value===void 0){"value"in i&&i.value===void 0&&n?.onError?.(o,new Error(`restore: slice.value is undefined for "${o}" (undefined is the global SENTINEL; not valid DATA)`));continue}if(!(i.type==="derived"||i.type==="effect")&&!(i.type==="producer"&&!s)){if(i.v!=null){let d=this.tryResolve(o)?.v;if(d!=null&&d.id===i.v.id&&d.version===i.v.version)continue}try{this.set(o,i.value)}catch(a){n?.onError?.(o,a)}}}}}static fromSnapshot(e,n){mo(e);let r=typeof n=="function"?n:n?.build,s=typeof n=="function"?void 0:n?.factories,o=new t(e.name);if(r)return r(o),o.restore(e),o;for(let h of[...e.subgraphs].sort((l,m)=>{let b=l.split(Z).length,g=m.split(Z).length;return b!==g?b-g:l<m?-1:l>m?1:0})){let l=h.split(Z),m=o;for(let b of l)m._mounts.has(b)||m.mount(b,new t(b)),m=m._mounts.get(b)}let i=s?Object.entries(s).map(([h,l])=>({re:en(h),factory:l})):[],a=h=>{for(let l of i)if(l.re.test(h))return l.factory},d=h=>{let l=h.split(Z),m=l.pop();if(m==null||m.length===0)throw new Error(`invalid snapshot path "${h}"`);let b=o;for(let g of l){let y=b._mounts.get(g);if(!y)throw new Error(`unknown mount "${g}" in path "${h}"`);b=y}return[b,m]},u=Object.entries(e.nodes).filter(([h])=>!h.includes(`${Z}${Me}${Z}`)).sort((h,l)=>h[0]<l[0]?-1:h[0]>l[0]?1:0),c=new Map(u),p=new Map,f=!0;for(;c.size>0&&f;){f=!1;for(let[h,l]of[...c.entries()]){let m=l?.deps??[];if(!m.every(k=>p.has(k)))continue;let[b,g]=d(h),y={...l?.meta??{}},v=a(h),T;if(l?.type==="state")T=F(l.value,{meta:y});else{if(v==null)continue;T=v(g,{path:h,type:l.type,value:l.value,meta:y,deps:m,resolvedDeps:m.map(k=>p.get(k))})}b.add(T,{name:g}),p.set(h,T),c.delete(h),f=!0}}if(c.size>0){let h=[...c.keys()].sort().join(", ");throw new Error(`Graph.fromSnapshot could not reconstruct nodes without build callback: ${h}. Pass matching factories via fromSnapshot(data, { factories: { pattern: factoryFn } }).`)}return o.restore(e),o}toJSON(){return this.snapshot()}attachStorage(e,n={}){let r=e.map(u=>({tier:u,debounceMs:Math.max(0,u.debounceMs??0),compactEvery:Math.max(1,u.compactEvery??10),timer:void 0,seq:0,lastSnapshot:void 0,lastFingerprint:"",disposed:!1,savePending:void 0}));n.autoRestore===!0&&this._cascadeRestore(e,n.onError);let s=(u,c)=>{if(u.disposed)return;let p=Ka(c.nodes);if(u.lastSnapshot!=null&&p!==""&&p===u.lastFingerprint)return;let f=u.seq+1,h=re(),b=u.lastSnapshot==null||f%u.compactEvery===0?{mode:"full",snapshot:c,seq:f,timestamp_ns:h,format_version:ut}:{mode:"diff",diff:su(u.lastSnapshot,c),seq:f,timestamp_ns:h,format_version:ut};if(u.tier.filter&&!u.tier.filter(this.name,b))return;let g;try{g=u.tier.save(this.name,b)}catch(y){n.onError?.(y,u.tier);return}if(g&&typeof g.then=="function"){let T=(u.savePending??Promise.resolve()).then(()=>g,()=>g).then(()=>{u.disposed||(u.seq=f,u.lastSnapshot=c,u.lastFingerprint=p)},k=>{n.onError?.(k,u.tier)});u.savePending=T.finally(()=>{u.savePending===T&&(u.savePending=void 0)})}else u.seq=f,u.lastSnapshot=c,u.lastFingerprint=p},o=(u,c)=>{try{s(u,c)}catch(p){n.onError?.(p,u.tier)}},i=(u,c)=>{if(!c.some(l=>{let m=this.config.messageTier(l[0]);return m>=3&&m<5}))return;if(n.filter){let l=this.tryResolve(u);if(l==null)return;let m=Hn(l,Ut("standard"));if(!n.filter(u,m))return}let f,h=()=>(f==null&&(f=this.snapshot()),f);for(let l of r)l.disposed||(l.debounceMs===0?o(l,h()):(l.timer==null&&(l.timer=new Oe),l.timer.start(l.debounceMs,()=>{l.disposed||o(l,this.snapshot())})))},a;if(n.paths!=null){let c=(typeof n.paths=="string"?this._pathsMatching(n.paths):n.paths).map(p=>{let f=this.tryResolve(p);return f==null?()=>{}:f.subscribe(h=>i(p,h))});a=()=>{for(let p of c)p()}}else a=this.observe().subscribe((u,c)=>i(u,c));let d=()=>{a();for(let u of r)u.disposed=!0,u.timer?.cancel();this._storageDisposers.delete(d)};return this._storageDisposers.add(d),{dispose:d}}async _cascadeRestore(e,n){for(let r of e){let s;try{s=await r.load(this.name)}catch(i){n?.(i,r);continue}if(s==null||typeof s!="object"||Array.isArray(s))continue;let o=s;try{if(o.mode==="full"&&o.snapshot!=null)return this.restore(o.snapshot),!0;if(o.version===ut&&o.nodes!=null)return this.restore(o),!0}catch(i){n?.(i,r)}}return!1}static async fromStorage(e,n,r){for(let s of n){let o;try{o=await s.load(e)}catch(d){r?.onError?.(d,s);continue}if(o==null||typeof o!="object"||Array.isArray(o))continue;let i=o,a=i.mode==="full"&&i.snapshot!=null?i.snapshot:i.version===ut&&i.nodes!=null?i:void 0;if(a!=null)try{return t.fromSnapshot(a,r)}catch(d){r?.onError?.(d,s)}}throw new Error(`Graph.fromStorage: no tier held a restorable record for "${e}" across ${n.length} tier(s)`)}_annotations=new Map;_traceRing;trace(e,n,r){if(e!=null&&n!=null){if(this.tryResolve(e)==null)return;if(this._annotations.set(e,n),this.config.inspectorEnabled){let s={path:e,annotation:n,timestamp_ns:ne(),...r?.actor!=null?{actor:r.actor}:{}};this._traceRing.push(s)}return}return e!=null?this.config.inspectorEnabled?this._annotations.get(e):void 0:this.config.inspectorEnabled?this._traceRing.toArray():[]}annotation(e){return this._annotations.get(e)}clearTrace(){this._annotations.clear(),this._traceRing.clear()}pruneTrace(e){let n=this._traceRing.toArray().filter(s=>!e(s)),r=this._traceRing.size-n.length;this._traceRing.clear();for(let s of n)this._traceRing.push(s);return r}static diff(e,n){let r=new Set(Object.keys(e.nodes)),s=new Set(Object.keys(n.nodes)),o=[...s].filter(y=>!r.has(y)).sort(),i=[...r].filter(y=>!s.has(y)).sort(),a=[],d=[];for(let y of r){if(!s.has(y))continue;let v=e.nodes[y],T=n.nodes[y],k=v.v,x=T.v;k!=null&&x!=null&&k.id===x.id&&k.version!==x.version&&d.push({path:y,id:k.id,from:k.version,to:x.version});let E=k!=null&&x!=null&&k.id===x.id&&k.version===x.version;for(let S of["type","status","sentinel"]){let M=v[S],I=T[S];M!==I&&a.push({path:y,field:S,from:M,to:I})}if(!E)for(let S of["value","meta"]){let M=v[S],I=T[S];za(M,I)||a.push({path:y,field:S,from:M,to:I})}}let u=y=>`${y.from} ${y.to}`,c=new Set(e.edges.map(u)),p=new Set(n.edges.map(u)),f=n.edges.filter(y=>!c.has(u(y))),h=e.edges.filter(y=>!p.has(u(y))),l=new Set(e.subgraphs),m=new Set(n.subgraphs),b=[...m].filter(y=>!l.has(y)).sort(),g=[...l].filter(y=>!m.has(y)).sort();return{nodesAdded:o,nodesRemoved:i,nodesChanged:a,versionChanges:d,edgesAdded:f,edgesRemoved:h,subgraphsAdded:b,subgraphsRemoved:g}}};function su(t,e){let n=xt.diff(t,e),r={};for(let s of n.nodesAdded){let o=e.nodes[s];o!=null&&(r[s]=o)}return{...n,nodesAddedFull:r}}function bo(t,e,n,r={}){let s={paths:[],depths:new Map,truncated:!1};if(!e)return r.withDetail?s:[];if(!r.both&&n!=="upstream"&&n!=="downstream")throw new Error('reachable: direction must be "upstream" or "downstream"');let o=r.maxDepth;if(o!=null&&(!Number.isInteger(o)||o<0))throw new Error("reachable: maxDepth must be an integer >= 0");if(o===0)return r.withDetail?s:[];let i=new Map,a=new Map,d=new Map,u=new Map,c=new Set;for(let[v,T]of Object.entries(t.nodes)){if(!v)continue;c.add(v);let k=T.deps??[];i.set(v,k);for(let x of k)x&&(c.add(x),a.has(x)||a.set(x,new Set),a.get(x).add(v))}for(let v of t.edges){if(v==null||typeof v!="object")continue;let T=typeof v.from=="string"?v.from:"",k=typeof v.to=="string"?v.to:"";!T||!k||(c.add(T),c.add(k),u.has(T)||u.set(T,new Set),u.get(T).add(k),d.has(k)||d.set(k,new Set),d.get(k).add(T))}if(!c.has(e))return r.withDetail?s:[];let p=r.both===!0,f=v=>{if(p){let E=i.get(v)??[],S=d.get(v),M=a.get(v),I=u.get(v),D=[...E];return S&&D.push(...S),M&&D.push(...M),I&&D.push(...I),D}if(n==="upstream"){let E=i.get(v)??[],S=d.get(v);return S?[...E,...S]:E}let T=a.get(v),k=u.get(v),x=T?[...T]:[];return k&&x.push(...k),x},h=new Set([e]),l=new Map,m=[{path:e,depth:0}],b=0,g=!1;for(;b<m.length;){let v=m[b++];if(o!=null&&v.depth>=o){f(v.path).length>0&&(g=!0);continue}for(let T of f(v.path))!T||h.has(T)||(h.add(T),l.set(T,v.depth+1),m.push({path:T,depth:v.depth+1}))}let y=[...l.keys()].sort((v,T)=>v<T?-1:v>T?1:0);return r.withDetail?{paths:y,depths:l,truncated:g}:y}function iu(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],s=e[n];if(r.path!==s.path||r.type!==s.type||r.status!==s.status||r.hop!==s.hop||r.dep_index!==s.dep_index||r.annotation!==s.annotation||r.value!==s.value||r.lastMutation!==s.lastMutation)return!1;let o=r.v,i=s.v;if(o!==i&&(o==null||i==null||o.id!==i.id||o.version!==i.version))return!1}return!0}function au(t,e,n,r){let s=new xt(t,r);s.add(e,{name:"source"});let o=F(n,{meta:{kind:"stratify_rules"}});s.add(o,{name:"rules"});for(let i of n)uu(s,e,o,i);return s}function uu(t,e,n,r){let s=`branch/${r.name}`,o=Symbol("noValue"),i=!1,a=!1,d=!1,u=o,c=!1,p=n.cache??[];function f(m){if(d){d=!1;let b=u;if(u=o,b!==o){let g=p.find(v=>v.name===r.name),y=!1;try{y=g?.classify(b)??!1}catch{y=!1}y?(c=!1,m.emit(b)):c&&(c=!1,m.down([[G],[A]]))}else c?(c=!1,m.down([[G],[A]])):m.down([[A]])}}let h=B([],(m,b)=>{let g=e.subscribe(v=>{for(let T of v)l(T,0,b)}),y=n.subscribe(v=>{for(let T of v)l(T,1,b)});return()=>{g(),y()}},{describeKind:"derived",meta:{kind:"stratify_branch",branch:r.name},completeWhenDepsComplete:!1});function l(m,b,g){let y=m[0];return y===G?(b===0?(i=!0,c=!0):a=!0,!0):y===w||y===A?(b===0?(i=!1,d=!0,u=y===w?m[1]:o):(y===w&&(p=m[1]),a=!1),i||a||f(g),!0):y===_||y===N||y===K?(i=!1,a=!1,d=!1,u=o,c=!1,b===0&&g.down([m]),!0):b===1}if(t.add(h,{name:s}),r.ops){let m=r.ops(h),b=`branch/${r.name}/out`;t.add(m,{name:b})}}At();ye();X();we();ue();Ie();X();var du=new Map([[ve,"INVALIDATE"],[me,"PAUSE"],[Te,"RESUME"],[K,"TEARDOWN"],[_,"COMPLETE"],[N,"ERROR"]]),cu=new Map([["INVALIDATE",ve],["PAUSE",me],["RESUME",Te],["TEARDOWN",K],["COMPLETE",_],["ERROR",N]]);function Je(t){let e=du.get(t);return e||(Symbol.keyFor(t)??"UNKNOWN")}function dt(t){let e=cu.get(t);if(e)return e;if(t&&t!=="UNKNOWN")return Symbol.for(t)}function ct(t){return t instanceof Error?{message:t.message,name:t.name,stack:t.stack}:{message:String(t),name:"Error"}}function lt(t){let e=new Error(t.message);return e.name=t.name,t.stack&&(e.stack=t.stack),e}function Ye(t){if(typeof MessagePort<"u"&&t instanceof MessagePort)return{post(e,n){t.postMessage(e,n??[])},listen(e){let n=r=>e(r.data);return t.addEventListener("message",n),t.start(),()=>t.removeEventListener("message",n)},terminate(){t.close()}};if(typeof SharedWorker<"u"&&t instanceof SharedWorker)return Ye(t.port);if(typeof Worker<"u"&&t instanceof Worker)return{post(e,n){t.postMessage(e,n??[])},listen(e){let n=r=>e(r.data);return t.addEventListener("message",n),()=>t.removeEventListener("message",n)},terminate(){t.terminate()}};if(typeof BroadcastChannel<"u"&&t instanceof BroadcastChannel)return{post(e,n){n&&n.length>0&&console.warn("[graphrefly] WorkerTransport: BroadcastChannel does not support Transferable objects. The transfer argument is ignored and objects will be cloned instead."),t.postMessage(e)},listen(e){let n=r=>e(r.data);return t.addEventListener("message",n),()=>t.removeEventListener("message",n)},terminate(){t.close()}};if(typeof ServiceWorker<"u"&&t instanceof ServiceWorker)return{post(e,n){t.postMessage(e,n??[])},listen(e){let n=r=>{r.source===t&&e(r.data)};return navigator.serviceWorker.addEventListener("message",n),()=>navigator.serviceWorker.removeEventListener("message",n)}};throw new Error("createTransport: unsupported target type. Expected Worker, SharedWorker, ServiceWorker, BroadcastChannel, or MessagePort.")}function lu(t){return typeof t=="object"&&t!==null&&typeof t.post=="function"&&typeof t.listen=="function"}function xo(t,e){let n=lu(t)?t:Ye(t),r=e.name??"workerBridge",s=Object.entries(e.expose??{}),o=e.import??[],i=e.transfer??{},a=F("connecting",{name:`${r}::meta::status`}),d=F(null,{name:`${r}::meta::error`}),u=new Map,c=new Map;for(let y of o){let v=F(void 0,{name:`${r}::${y}`});u.set(y,v)}let p;if(s.length>0){let y=s.map(([,k])=>k),v=B(y,(k,x)=>{let E={};for(let S=0;S<s.length;S++){let[M]=s[S],I=k[S];I!=null&&I.length>0&&(E[M]=I.at(-1))}Object.keys(E).length!==0&&x.emit(E)},{name:`${r}::aggregated`,partial:!0});p=Mt([v],k=>{let x=k[0];if(x==null||Object.keys(x).length===0)return;let E=[];for(let I of Object.keys(x)){let D=i[I];D&&E.push(...D(x[I]))}let S;for(let[I,D]of s)I in x&&D.v!=null&&(S==null&&(S={}),S[I]=D.v.version);let M={t:"b",u:x,...S?{v:S}:{}};try{n.post(M,E.length>0?E:void 0)}catch(I){d.down([[w,I instanceof Error?I:new Error(String(I))]])}}).subscribe(()=>{})}let f=!1,h=n.listen(y=>{if(f)return;let v=y;switch(v.t){case"r":{j(()=>{for(let[k,x]of Object.entries(v.stores)){let E=u.get(k);E&&E.down([[w,x]])}}),a.down([[w,"connected"]]);let T={};for(let[k,x]of s)T[k]=x.cache;n.post({t:"i",stores:T});break}case"v":{let T=u.get(v.s);T&&T.down([[w,v.d]]);break}case"b":{j(()=>{for(let[T,k]of Object.entries(v.u)){let x=v.v?.[T];if(x!=null){let S=c.get(T);if(S!=null&&x<=S)continue;c.set(T,x)}let E=u.get(T);E&&E.down([[w,k]])}});break}case"e":{let T=u.get(v.s);T&&T.down([[N,lt(v.err)]]);break}case"s":{let T=dt(v.sig);if(!T)break;let k=v.s==="*"?[...u.values()]:u.has(v.s)?[u.get(v.s)]:[];for(let x of k)x.down(v.d===void 0?[[T]]:[[T,v.d]]);break}}}),l=[];for(let[y,v]of s){let T=v.subscribe((k=>{if(!f)for(let x of k){let E=x[0];E!==w&&(le.isLocalOnly(E)||(E===N?n.post({t:"e",s:y,err:ct(x[1])}):n.post({t:"s",s:y,sig:Je(E),d:x.length>1?x[1]:void 0})))}}));l.push(T)}let m;if(e.timeoutMs!=null&&e.timeoutMs>0){let y=We(e.timeoutMs),v=Bt(a,k=>k==="connected");m=Fn(vt(Lt(y,()=>"timeout"),Lt(v,()=>"ready"))).subscribe(k=>{for(let x of k)x[0]===w&&x[1]==="timeout"&&(d.down([[w,new Error("Worker bridge handshake timeout")]]),b())})}function b(){if(!f){f=!0,m?.(),n.post({t:"s",s:"*",sig:Je(K)}),p&&p();for(let y of l)y();l.length=0,h(),a.down([[w,"closed"]]),c.clear(),u.clear()}}let g={meta:{status:a,error:d},destroy:b};for(let[y,v]of u)g[y]=v;return g}ye();X();we();ue();function fu(t){return typeof t=="object"&&t!==null&&typeof t.post=="function"&&typeof t.listen=="function"}function ko(t,e){let n=fu(t)?t:Ye(t),r=e.import??[],s=e.transfer??{},o=new Map,i=new Map,a={};for(let b of r){let g=F(void 0,{name:`worker::${b}`});o.set(b,g),a[b]=g}let d=e.expose(a),u=Object.entries(d),c,p=!1;if(u.length>0){let b=u.map(([,v])=>v),g=B(b,(v,T)=>{let k={};for(let x=0;x<u.length;x++){let[E]=u[x],S=v[x];S!=null&&S.length>0&&(k[E]=S.at(-1))}Object.keys(k).length!==0&&T.emit(k)},{name:"workerSelf::aggregated",partial:!0});c=Mt([g],v=>{if(p)return;let T=v[0];if(T==null||Object.keys(T).length===0)return;let k=[];for(let S of Object.keys(T)){let M=s[S];M&&k.push(...M(T[S]))}let x;for(let[S,M]of u)S in T&&M.v!=null&&(x==null&&(x={}),x[S]=M.v.version);let E={t:"b",u:T,...x?{v:x}:{}};try{n.post(E,k.length>0?k:void 0)}catch{}}).subscribe(()=>{})}let f=[];for(let[b,g]of u){let y=g.subscribe((v=>{if(!p)for(let T of v){let k=T[0];k!==w&&(le.isLocalOnly(k)||(k===N?n.post({t:"e",s:b,err:ct(T[1])}):n.post({t:"s",s:b,sig:Je(k),d:T.length>1?T[1]:void 0})))}}));f.push(y)}let h=n.listen(b=>{if(p)return;let g=b;switch(g.t){case"i":{j(()=>{for(let[y,v]of Object.entries(g.stores)){let T=o.get(y);T&&T.down([[w,v]])}});break}case"v":{let y=o.get(g.s);y&&y.down([[w,g.d]]);break}case"b":{j(()=>{for(let[y,v]of Object.entries(g.u)){let T=g.v?.[y];if(T!=null){let x=i.get(y);if(x!=null&&T<=x)continue;i.set(y,T)}let k=o.get(y);k&&k.down([[w,v]])}});break}case"e":{let y=o.get(g.s);y&&y.down([[N,lt(g.err)]]);break}case"s":{let y=dt(g.sig);if(!y)break;if(y===K&&g.s==="*"){m();return}let v=g.s==="*"?[...o.values()]:o.has(g.s)?[o.get(g.s)]:[];for(let T of v)T.down(g.d===void 0?[[y]]:[[y,g.d]]);break}}}),l={};for(let[b,g]of u)l[b]=g.cache;n.post({t:"r",stores:l});function m(){if(!p){p=!0,c&&c();for(let b of f)b();f.length=0,h(),n.terminate?.(),i.clear(),o.clear()}}return{destroy:m}}0&&(module.exports={CircuitOpenError,ContentAddressedMissError,NS_PER_MS,NS_PER_SEC,NativeIndexBackend,NativeListBackend,NativeLogBackend,NativeMapBackend,NativePubSubBackend,RateLimiterOverflowError,ResettableTimer,TimeoutError,audit,awaitSettled,buffer,bufferCount,bufferTime,cached,canonicalJson,cascadingCache,catchError,checkpointToRedis,checkpointToS3,circuitBreaker,combine,combineLatest,concat,concatMap,constant,contentAddressedStorage,createTransport,createWatermarkController,csvRows,debounce,debounceTime,decorrelatedJitter,delay,deserializeError,dictStorage,distill,distinctUntilChanged,elementAt,empty,escapeRegexChar,exhaustMap,exponential,externalBundle,externalProducer,fallback,fibonacci,filter,find,first,firstValueFrom,firstWhere,flatMap,forEach,fromAny,fromAsyncIter,fromCSV,fromClickHouseWatch,fromCron,fromDrizzle,fromEvent,fromHTTP,fromHTTPPoll,fromHTTPStream,fromIter,fromKafka,fromKysely,fromMCP,fromNATS,fromNDJSON,fromOTel,fromPrisma,fromPrometheus,fromPromise,fromPulsar,fromRabbitMQ,fromRaf,fromRedisStream,fromSSE,fromSqlite,fromSqliteCursor,fromStatsD,fromSyslog,fromTimer,fromWebSocket,fromWebSocketReconnect,fromWebhook,globToRegExp,interval,keepalive,last,linear,lru,makeHttpError,map,matchesAnyPattern,matchesCron,memoryStorage,merge,mergeMap,nameToSignal,ndjsonRows,never,nodeSignal,of,onFirstData,pairwise,parseCron,parsePrometheusText,parseSSEStream,parseStatsD,parseSyslog,pausable,pubsub,race,rateLimiter,reactiveCounter,reactiveIndex,reactiveList,reactiveLog,reactiveMap,reactiveSink,reduce,repeat,replay,rescue,resolveBackoffPreset,retry,retrySource,sample,scan,serializeError,share,shareReplay,signalToName,singleFromAny,singleNodeFromAny,skip,sortJsonValue,stableJsonString,stratify,switchMap,take,takeUntil,takeWhile,tap,tapFirst,throttle,throttleTime,throwError,timeout,toArray,toCSV,toClickHouse,toFile,toHTTP,toKafka,toLoki,toMongo,toNATS,toObservable,toPostgres,toPulsar,toRabbitMQ,toReadableStream,toRedisStream,toS3,toSSE,toSSEBytes,toSqlite,toTempo,toWebSocket,tokenBucket,valve,verifiable,window,windowCount,windowTime,withBreaker,withLatestFrom,withMaxAttempts,withStatus,workerBridge,workerSelf,zip});
|
package/dist/extra/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AckableMessage, a as AdapterHandlers, B as BatchMessage, b as BridgeMessage, c as BufferedSinkHandle, d as BundleTriad, C as CSVRow, e as CacheEvictionPolicy, f as CascadingCache, g as CascadingCacheOptions, h as CheckpointToRedisOptions, i as CheckpointToS3Options, j as ClickHouseClientLike, k as ClickHouseInsertClientLike, l as ClickHouseRow, m as CronSchedule, D as DrizzleQueryLike, E as EmitTriad, n as ErrorMessage, o as ExternalBundleOptions, p as ExternalRegister, F as FileWriterLike, q as FromCSVOptions, r as FromClickHouseWatchOptions, s as FromDrizzleOptions, t as FromHTTPOptions, u as FromHTTPPollOptions, v as FromHTTPStreamOptions, w as FromKafkaOptions, x as FromKyselyOptions, y as FromMCPOptions, z as FromNATSOptions, G as FromNDJSONOptions, H as FromOTelOptions, I as FromPrismaOptions, J as FromPrometheusOptions, K as FromPulsarOptions, L as FromRabbitMQOptions, M as FromRedisStreamOptions, N as FromSSEOptions, O as FromSqliteOptions, P as FromStatsDOptions, Q as FromSyslogOptions, R as FromWebSocketReconnectOptions, S as HTTPBundle, T as InitMessage, U as KafkaConsumerLike, V as KafkaMessage, W as KafkaProducerLike, X as KyselyQueryLike, Y as LokiClientLike, Z as LokiStream, _ as MCPClientLike, $ as MongoCollectionLike, a0 as NATSClientLike, a1 as NATSMessage, a2 as NATSSubscriptionLike, a3 as NativePubSubBackend, a4 as OTelBundle, a5 as OTelLog, a6 as OTelMetric, a7 as OTelRegister, a8 as OTelSpan, a9 as ParseSSEStreamOptions, aa as PostgresClientLike, ab as PrismaModelLike, ac as PrometheusMetric, ad as PubSubBackend, ae as PubSubHub, af as PubSubHubOptions, ag as PulsarConsumerLike, ah as PulsarMessage, ai as PulsarProducerLike, aj as RabbitMQChannelLike, ak as RabbitMQMessage, al as ReactiveSinkBackpressureOptions, am as ReactiveSinkConfig, an as ReactiveSinkHandle, ao as ReactiveSinkOptions, ap as ReactiveSinkRetryOptions, aq as ReadyMessage, ar as RedisCheckpointClientLike, as as RedisClientLike, at as RedisStreamEntry, au as ResettableTimer, av as S3ClientLike, aw as SSEEvent, ax as SignalMessage, ay as SingleFromAnyOptions, az as SinkFailure, aA as SinkHandle, aB as SinkTransportError, aC as SqliteDbLike, aD as SqliteIterableDbLike, aE as StatsDMetric, aF as StatsDRegister, aG as StratifyOptions, aH as StratifyRule, aI as SyslogMessage, aJ as SyslogRegister, aK as TempoClientLike, aL as ToCSVOptions, aM as ToClickHouseOptions, aN as ToFileOptions, aO as ToHTTPOptions, aP as ToKafkaOptions, aQ as ToLokiOptions, aR as ToMongoOptions, aS as ToNATSOptions, aT as ToPostgresOptions, aU as ToPulsarOptions, aV as ToRabbitMQOptions, aW as ToRedisStreamOptions, aX as ToS3Options, aY as ToSSEOptions, aZ as ToSqliteOptions, a_ as ToTempoOptions, a$ as ToWebSocketOptions, b0 as ValueMessage, b1 as WatermarkController, b2 as WatermarkOptions, b3 as WebSocketLike, b4 as WebSocketMessageEventLike, b5 as WebSocketRegister, b6 as WebhookRegister, b7 as WorkerBridge, b8 as WorkerBridgeOptions, b9 as WorkerSelfHandle, ba as WorkerSelfOptions, bb as WorkerTransport, bc as cascadingCache, bd as checkpointToRedis, be as checkpointToS3, bf as createTransport, bg as createWatermarkController, bh as csvRows, bi as deserializeError, bj as externalBundle, bk as externalProducer, bm as fromCSV, bn as fromClickHouseWatch, bo as fromDrizzle, bp as fromHTTP, bq as fromHTTPPoll, br as fromHTTPStream, bs as fromKafka, bt as fromKysely, bu as fromMCP, bv as fromNATS, bw as fromNDJSON, bx as fromOTel, by as fromPrisma, bz as fromPrometheus, bA as fromPulsar, bB as fromRabbitMQ, bC as fromRedisStream, bD as fromSSE, bE as fromSqlite, bF as fromSqliteCursor, bG as fromStatsD, bH as fromSyslog, bI as fromWebSocket, bJ as fromWebSocketReconnect, bK as fromWebhook, bL as lru, bM as makeHttpError, bN as matchesCron, bO as nameToSignal, bP as ndjsonRows, bQ as parseCron, bR as parsePrometheusText, bS as parseSSEStream, bT as parseStatsD, bU as parseSyslog, bV as pubsub, bW as reactiveSink, bX as serializeError, bY as signalToName, bZ as singleFromAny, b_ as singleNodeFromAny, b$ as stratify, c0 as toCSV, c1 as toClickHouse, c2 as toFile, c3 as toHTTP, c4 as toKafka, c5 as toLoki, c6 as toMongo, c7 as toNATS, c8 as toPostgres, c9 as toPulsar, ca as toRabbitMQ, cb as toReadableStream, cc as toRedisStream, cd as toS3, ce as toSSE, cf as toSSEBytes, cg as toSqlite, ch as toTempo, ci as toWebSocket, cj as workerBridge, ck as workerSelf } from '../index-
|
|
1
|
+
export { A as AckableMessage, a as AdapterHandlers, B as BatchMessage, b as BridgeMessage, c as BufferedSinkHandle, d as BundleTriad, C as CSVRow, e as CacheEvictionPolicy, f as CascadingCache, g as CascadingCacheOptions, h as CheckpointToRedisOptions, i as CheckpointToS3Options, j as ClickHouseClientLike, k as ClickHouseInsertClientLike, l as ClickHouseRow, m as CronSchedule, D as DrizzleQueryLike, E as EmitTriad, n as ErrorMessage, o as ExternalBundleOptions, p as ExternalRegister, F as FileWriterLike, q as FromCSVOptions, r as FromClickHouseWatchOptions, s as FromDrizzleOptions, t as FromHTTPOptions, u as FromHTTPPollOptions, v as FromHTTPStreamOptions, w as FromKafkaOptions, x as FromKyselyOptions, y as FromMCPOptions, z as FromNATSOptions, G as FromNDJSONOptions, H as FromOTelOptions, I as FromPrismaOptions, J as FromPrometheusOptions, K as FromPulsarOptions, L as FromRabbitMQOptions, M as FromRedisStreamOptions, N as FromSSEOptions, O as FromSqliteOptions, P as FromStatsDOptions, Q as FromSyslogOptions, R as FromWebSocketReconnectOptions, S as HTTPBundle, T as InitMessage, U as KafkaConsumerLike, V as KafkaMessage, W as KafkaProducerLike, X as KyselyQueryLike, Y as LokiClientLike, Z as LokiStream, _ as MCPClientLike, $ as MongoCollectionLike, a0 as NATSClientLike, a1 as NATSMessage, a2 as NATSSubscriptionLike, a3 as NativePubSubBackend, a4 as OTelBundle, a5 as OTelLog, a6 as OTelMetric, a7 as OTelRegister, a8 as OTelSpan, a9 as ParseSSEStreamOptions, aa as PostgresClientLike, ab as PrismaModelLike, ac as PrometheusMetric, ad as PubSubBackend, ae as PubSubHub, af as PubSubHubOptions, ag as PulsarConsumerLike, ah as PulsarMessage, ai as PulsarProducerLike, aj as RabbitMQChannelLike, ak as RabbitMQMessage, al as ReactiveSinkBackpressureOptions, am as ReactiveSinkConfig, an as ReactiveSinkHandle, ao as ReactiveSinkOptions, ap as ReactiveSinkRetryOptions, aq as ReadyMessage, ar as RedisCheckpointClientLike, as as RedisClientLike, at as RedisStreamEntry, au as ResettableTimer, av as S3ClientLike, aw as SSEEvent, ax as SignalMessage, ay as SingleFromAnyOptions, az as SinkFailure, aA as SinkHandle, aB as SinkTransportError, aC as SqliteDbLike, aD as SqliteIterableDbLike, aE as StatsDMetric, aF as StatsDRegister, aG as StratifyOptions, aH as StratifyRule, aI as SyslogMessage, aJ as SyslogRegister, aK as TempoClientLike, aL as ToCSVOptions, aM as ToClickHouseOptions, aN as ToFileOptions, aO as ToHTTPOptions, aP as ToKafkaOptions, aQ as ToLokiOptions, aR as ToMongoOptions, aS as ToNATSOptions, aT as ToPostgresOptions, aU as ToPulsarOptions, aV as ToRabbitMQOptions, aW as ToRedisStreamOptions, aX as ToS3Options, aY as ToSSEOptions, aZ as ToSqliteOptions, a_ as ToTempoOptions, a$ as ToWebSocketOptions, b0 as ValueMessage, b1 as WatermarkController, b2 as WatermarkOptions, b3 as WebSocketLike, b4 as WebSocketMessageEventLike, b5 as WebSocketRegister, b6 as WebhookRegister, b7 as WorkerBridge, b8 as WorkerBridgeOptions, b9 as WorkerSelfHandle, ba as WorkerSelfOptions, bb as WorkerTransport, bc as cascadingCache, bd as checkpointToRedis, be as checkpointToS3, bf as createTransport, bg as createWatermarkController, bh as csvRows, bi as deserializeError, bj as externalBundle, bk as externalProducer, bm as fromCSV, bn as fromClickHouseWatch, bo as fromDrizzle, bp as fromHTTP, bq as fromHTTPPoll, br as fromHTTPStream, bs as fromKafka, bt as fromKysely, bu as fromMCP, bv as fromNATS, bw as fromNDJSON, bx as fromOTel, by as fromPrisma, bz as fromPrometheus, bA as fromPulsar, bB as fromRabbitMQ, bC as fromRedisStream, bD as fromSSE, bE as fromSqlite, bF as fromSqliteCursor, bG as fromStatsD, bH as fromSyslog, bI as fromWebSocket, bJ as fromWebSocketReconnect, bK as fromWebhook, bL as lru, bM as makeHttpError, bN as matchesCron, bO as nameToSignal, bP as ndjsonRows, bQ as parseCron, bR as parsePrometheusText, bS as parseSSEStream, bT as parseStatsD, bU as parseSyslog, bV as pubsub, bW as reactiveSink, bX as serializeError, bY as signalToName, bZ as singleFromAny, b_ as singleNodeFromAny, b$ as stratify, c0 as toCSV, c1 as toClickHouse, c2 as toFile, c3 as toHTTP, c4 as toKafka, c5 as toLoki, c6 as toMongo, c7 as toNATS, c8 as toPostgres, c9 as toPulsar, ca as toRabbitMQ, cb as toReadableStream, cc as toRedisStream, cd as toS3, ce as toSSE, cf as toSSEBytes, cg as toSqlite, ch as toTempo, ci as toWebSocket, cj as workerBridge, ck as workerSelf } from '../index-DNhTQReY.cjs';
|
|
2
2
|
export { B as BackoffPreset, d as BackoffStrategy, e as CircuitBreaker, a as CircuitBreakerOptions, f as CircuitOpenError, C as CircuitState, E as ExponentialBackoffOptions, F as FallbackInput, J as JitterMode, N as NS_PER_MS, c as NS_PER_SEC, R as RateLimiterOptions, g as RateLimiterOverflowError, h as RateLimiterOverflowPolicy, b as RetryOptions, i as RetrySourceOptions, S as StatusValue, T as TimeoutError, j as TokenBucket, W as WithBreakerBundle, k as WithStatusBundle, l as circuitBreaker, m as constant, n as decorrelatedJitter, o as exponential, p as fallback, q as fibonacci, r as linear, s as rateLimiter, t as resolveBackoffPreset, u as retry, v as retrySource, w as timeout, x as tokenBucket, y as withBreaker, z as withMaxAttempts, A as withStatus } from '../resilience-Q6Bt_7y0.cjs';
|
|
3
3
|
export { D as DistillBundle, a as DistillOptions, E as Extraction, V as VerifiableBundle, b as VerifiableOptions, c as VerifyValue, d as distill, v as verifiable } from '../composite-CH0S8DFn.cjs';
|
|
4
4
|
export { C as ContentAddressedMissError, a as ContentAddressedMode, b as ContentAddressedStorage, c as ContentAddressedStorageOptions, d as canonicalJson, e as contentAddressedStorage } from '../content-addressed-storage-DqIWCmZG.cjs';
|
|
@@ -10,6 +10,6 @@ export { M as MapBackend, N as NativeMapBackend, b as NativeMapBackendOptions, R
|
|
|
10
10
|
export { AsyncSourceOpts, EventTargetLike, FromCronOptions, NodeInput, ReactiveCounterBundle, awaitSettled, cached, empty, escapeRegexChar, firstValueFrom, firstWhere, forEach, fromAny, fromAsyncIter, fromCron, fromEvent, fromIter, fromPromise, fromRaf, fromTimer, globToRegExp, keepalive, matchesAnyPattern, never, nodeSignal, of, reactiveCounter, replay, share, shareReplay, throwError, toArray } from './sources.cjs';
|
|
11
11
|
export { StorageHandle, StorageTier, dictStorage, memoryStorage, sortJsonValue, stableJsonString } from './storage-core.cjs';
|
|
12
12
|
import '../node-BVV7G1bq.cjs';
|
|
13
|
-
import '../graph-
|
|
13
|
+
import '../graph-CdJeX7O7.cjs';
|
|
14
14
|
import '../meta-COtmHLwT.cjs';
|
|
15
15
|
import 'rxjs';
|
package/dist/extra/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AckableMessage, a as AdapterHandlers, B as BatchMessage, b as BridgeMessage, c as BufferedSinkHandle, d as BundleTriad, C as CSVRow, e as CacheEvictionPolicy, f as CascadingCache, g as CascadingCacheOptions, h as CheckpointToRedisOptions, i as CheckpointToS3Options, j as ClickHouseClientLike, k as ClickHouseInsertClientLike, l as ClickHouseRow, m as CronSchedule, D as DrizzleQueryLike, E as EmitTriad, n as ErrorMessage, o as ExternalBundleOptions, p as ExternalRegister, F as FileWriterLike, q as FromCSVOptions, r as FromClickHouseWatchOptions, s as FromDrizzleOptions, t as FromHTTPOptions, u as FromHTTPPollOptions, v as FromHTTPStreamOptions, w as FromKafkaOptions, x as FromKyselyOptions, y as FromMCPOptions, z as FromNATSOptions, G as FromNDJSONOptions, H as FromOTelOptions, I as FromPrismaOptions, J as FromPrometheusOptions, K as FromPulsarOptions, L as FromRabbitMQOptions, M as FromRedisStreamOptions, N as FromSSEOptions, O as FromSqliteOptions, P as FromStatsDOptions, Q as FromSyslogOptions, R as FromWebSocketReconnectOptions, S as HTTPBundle, T as InitMessage, U as KafkaConsumerLike, V as KafkaMessage, W as KafkaProducerLike, X as KyselyQueryLike, Y as LokiClientLike, Z as LokiStream, _ as MCPClientLike, $ as MongoCollectionLike, a0 as NATSClientLike, a1 as NATSMessage, a2 as NATSSubscriptionLike, a3 as NativePubSubBackend, a4 as OTelBundle, a5 as OTelLog, a6 as OTelMetric, a7 as OTelRegister, a8 as OTelSpan, a9 as ParseSSEStreamOptions, aa as PostgresClientLike, ab as PrismaModelLike, ac as PrometheusMetric, ad as PubSubBackend, ae as PubSubHub, af as PubSubHubOptions, ag as PulsarConsumerLike, ah as PulsarMessage, ai as PulsarProducerLike, aj as RabbitMQChannelLike, ak as RabbitMQMessage, al as ReactiveSinkBackpressureOptions, am as ReactiveSinkConfig, an as ReactiveSinkHandle, ao as ReactiveSinkOptions, ap as ReactiveSinkRetryOptions, aq as ReadyMessage, ar as RedisCheckpointClientLike, as as RedisClientLike, at as RedisStreamEntry, au as ResettableTimer, av as S3ClientLike, aw as SSEEvent, ax as SignalMessage, ay as SingleFromAnyOptions, az as SinkFailure, aA as SinkHandle, aB as SinkTransportError, aC as SqliteDbLike, aD as SqliteIterableDbLike, aE as StatsDMetric, aF as StatsDRegister, aG as StratifyOptions, aH as StratifyRule, aI as SyslogMessage, aJ as SyslogRegister, aK as TempoClientLike, aL as ToCSVOptions, aM as ToClickHouseOptions, aN as ToFileOptions, aO as ToHTTPOptions, aP as ToKafkaOptions, aQ as ToLokiOptions, aR as ToMongoOptions, aS as ToNATSOptions, aT as ToPostgresOptions, aU as ToPulsarOptions, aV as ToRabbitMQOptions, aW as ToRedisStreamOptions, aX as ToS3Options, aY as ToSSEOptions, aZ as ToSqliteOptions, a_ as ToTempoOptions, a$ as ToWebSocketOptions, b0 as ValueMessage, b1 as WatermarkController, b2 as WatermarkOptions, b3 as WebSocketLike, b4 as WebSocketMessageEventLike, b5 as WebSocketRegister, b6 as WebhookRegister, b7 as WorkerBridge, b8 as WorkerBridgeOptions, b9 as WorkerSelfHandle, ba as WorkerSelfOptions, bb as WorkerTransport, bc as cascadingCache, bd as checkpointToRedis, be as checkpointToS3, bf as createTransport, bg as createWatermarkController, bh as csvRows, bi as deserializeError, bj as externalBundle, bk as externalProducer, bm as fromCSV, bn as fromClickHouseWatch, bo as fromDrizzle, bp as fromHTTP, bq as fromHTTPPoll, br as fromHTTPStream, bs as fromKafka, bt as fromKysely, bu as fromMCP, bv as fromNATS, bw as fromNDJSON, bx as fromOTel, by as fromPrisma, bz as fromPrometheus, bA as fromPulsar, bB as fromRabbitMQ, bC as fromRedisStream, bD as fromSSE, bE as fromSqlite, bF as fromSqliteCursor, bG as fromStatsD, bH as fromSyslog, bI as fromWebSocket, bJ as fromWebSocketReconnect, bK as fromWebhook, bL as lru, bM as makeHttpError, bN as matchesCron, bO as nameToSignal, bP as ndjsonRows, bQ as parseCron, bR as parsePrometheusText, bS as parseSSEStream, bT as parseStatsD, bU as parseSyslog, bV as pubsub, bW as reactiveSink, bX as serializeError, bY as signalToName, bZ as singleFromAny, b_ as singleNodeFromAny, b$ as stratify, c0 as toCSV, c1 as toClickHouse, c2 as toFile, c3 as toHTTP, c4 as toKafka, c5 as toLoki, c6 as toMongo, c7 as toNATS, c8 as toPostgres, c9 as toPulsar, ca as toRabbitMQ, cb as toReadableStream, cc as toRedisStream, cd as toS3, ce as toSSE, cf as toSSEBytes, cg as toSqlite, ch as toTempo, ci as toWebSocket, cj as workerBridge, ck as workerSelf } from '../index-
|
|
1
|
+
export { A as AckableMessage, a as AdapterHandlers, B as BatchMessage, b as BridgeMessage, c as BufferedSinkHandle, d as BundleTriad, C as CSVRow, e as CacheEvictionPolicy, f as CascadingCache, g as CascadingCacheOptions, h as CheckpointToRedisOptions, i as CheckpointToS3Options, j as ClickHouseClientLike, k as ClickHouseInsertClientLike, l as ClickHouseRow, m as CronSchedule, D as DrizzleQueryLike, E as EmitTriad, n as ErrorMessage, o as ExternalBundleOptions, p as ExternalRegister, F as FileWriterLike, q as FromCSVOptions, r as FromClickHouseWatchOptions, s as FromDrizzleOptions, t as FromHTTPOptions, u as FromHTTPPollOptions, v as FromHTTPStreamOptions, w as FromKafkaOptions, x as FromKyselyOptions, y as FromMCPOptions, z as FromNATSOptions, G as FromNDJSONOptions, H as FromOTelOptions, I as FromPrismaOptions, J as FromPrometheusOptions, K as FromPulsarOptions, L as FromRabbitMQOptions, M as FromRedisStreamOptions, N as FromSSEOptions, O as FromSqliteOptions, P as FromStatsDOptions, Q as FromSyslogOptions, R as FromWebSocketReconnectOptions, S as HTTPBundle, T as InitMessage, U as KafkaConsumerLike, V as KafkaMessage, W as KafkaProducerLike, X as KyselyQueryLike, Y as LokiClientLike, Z as LokiStream, _ as MCPClientLike, $ as MongoCollectionLike, a0 as NATSClientLike, a1 as NATSMessage, a2 as NATSSubscriptionLike, a3 as NativePubSubBackend, a4 as OTelBundle, a5 as OTelLog, a6 as OTelMetric, a7 as OTelRegister, a8 as OTelSpan, a9 as ParseSSEStreamOptions, aa as PostgresClientLike, ab as PrismaModelLike, ac as PrometheusMetric, ad as PubSubBackend, ae as PubSubHub, af as PubSubHubOptions, ag as PulsarConsumerLike, ah as PulsarMessage, ai as PulsarProducerLike, aj as RabbitMQChannelLike, ak as RabbitMQMessage, al as ReactiveSinkBackpressureOptions, am as ReactiveSinkConfig, an as ReactiveSinkHandle, ao as ReactiveSinkOptions, ap as ReactiveSinkRetryOptions, aq as ReadyMessage, ar as RedisCheckpointClientLike, as as RedisClientLike, at as RedisStreamEntry, au as ResettableTimer, av as S3ClientLike, aw as SSEEvent, ax as SignalMessage, ay as SingleFromAnyOptions, az as SinkFailure, aA as SinkHandle, aB as SinkTransportError, aC as SqliteDbLike, aD as SqliteIterableDbLike, aE as StatsDMetric, aF as StatsDRegister, aG as StratifyOptions, aH as StratifyRule, aI as SyslogMessage, aJ as SyslogRegister, aK as TempoClientLike, aL as ToCSVOptions, aM as ToClickHouseOptions, aN as ToFileOptions, aO as ToHTTPOptions, aP as ToKafkaOptions, aQ as ToLokiOptions, aR as ToMongoOptions, aS as ToNATSOptions, aT as ToPostgresOptions, aU as ToPulsarOptions, aV as ToRabbitMQOptions, aW as ToRedisStreamOptions, aX as ToS3Options, aY as ToSSEOptions, aZ as ToSqliteOptions, a_ as ToTempoOptions, a$ as ToWebSocketOptions, b0 as ValueMessage, b1 as WatermarkController, b2 as WatermarkOptions, b3 as WebSocketLike, b4 as WebSocketMessageEventLike, b5 as WebSocketRegister, b6 as WebhookRegister, b7 as WorkerBridge, b8 as WorkerBridgeOptions, b9 as WorkerSelfHandle, ba as WorkerSelfOptions, bb as WorkerTransport, bc as cascadingCache, bd as checkpointToRedis, be as checkpointToS3, bf as createTransport, bg as createWatermarkController, bh as csvRows, bi as deserializeError, bj as externalBundle, bk as externalProducer, bm as fromCSV, bn as fromClickHouseWatch, bo as fromDrizzle, bp as fromHTTP, bq as fromHTTPPoll, br as fromHTTPStream, bs as fromKafka, bt as fromKysely, bu as fromMCP, bv as fromNATS, bw as fromNDJSON, bx as fromOTel, by as fromPrisma, bz as fromPrometheus, bA as fromPulsar, bB as fromRabbitMQ, bC as fromRedisStream, bD as fromSSE, bE as fromSqlite, bF as fromSqliteCursor, bG as fromStatsD, bH as fromSyslog, bI as fromWebSocket, bJ as fromWebSocketReconnect, bK as fromWebhook, bL as lru, bM as makeHttpError, bN as matchesCron, bO as nameToSignal, bP as ndjsonRows, bQ as parseCron, bR as parsePrometheusText, bS as parseSSEStream, bT as parseStatsD, bU as parseSyslog, bV as pubsub, bW as reactiveSink, bX as serializeError, bY as signalToName, bZ as singleFromAny, b_ as singleNodeFromAny, b$ as stratify, c0 as toCSV, c1 as toClickHouse, c2 as toFile, c3 as toHTTP, c4 as toKafka, c5 as toLoki, c6 as toMongo, c7 as toNATS, c8 as toPostgres, c9 as toPulsar, ca as toRabbitMQ, cb as toReadableStream, cc as toRedisStream, cd as toS3, ce as toSSE, cf as toSSEBytes, cg as toSqlite, ch as toTempo, ci as toWebSocket, cj as workerBridge, ck as workerSelf } from '../index-C7RqYbOZ.js';
|
|
2
2
|
export { B as BackoffPreset, d as BackoffStrategy, e as CircuitBreaker, a as CircuitBreakerOptions, f as CircuitOpenError, C as CircuitState, E as ExponentialBackoffOptions, F as FallbackInput, J as JitterMode, N as NS_PER_MS, c as NS_PER_SEC, R as RateLimiterOptions, g as RateLimiterOverflowError, h as RateLimiterOverflowPolicy, b as RetryOptions, i as RetrySourceOptions, S as StatusValue, T as TimeoutError, j as TokenBucket, W as WithBreakerBundle, k as WithStatusBundle, l as circuitBreaker, m as constant, n as decorrelatedJitter, o as exponential, p as fallback, q as fibonacci, r as linear, s as rateLimiter, t as resolveBackoffPreset, u as retry, v as retrySource, w as timeout, x as tokenBucket, y as withBreaker, z as withMaxAttempts, A as withStatus } from '../resilience-CludlzcP.js';
|
|
3
3
|
export { D as DistillBundle, a as DistillOptions, E as Extraction, V as VerifiableBundle, b as VerifiableOptions, c as VerifyValue, d as distill, v as verifiable } from '../composite-BY9hMxN7.js';
|
|
4
4
|
export { C as ContentAddressedMissError, a as ContentAddressedMode, b as ContentAddressedStorage, c as ContentAddressedStorageOptions, d as canonicalJson, e as contentAddressedStorage } from '../content-addressed-storage-BUiREIuj.js';
|
|
@@ -10,6 +10,6 @@ export { M as MapBackend, N as NativeMapBackend, b as NativeMapBackendOptions, R
|
|
|
10
10
|
export { AsyncSourceOpts, EventTargetLike, FromCronOptions, NodeInput, ReactiveCounterBundle, awaitSettled, cached, empty, escapeRegexChar, firstValueFrom, firstWhere, forEach, fromAny, fromAsyncIter, fromCron, fromEvent, fromIter, fromPromise, fromRaf, fromTimer, globToRegExp, keepalive, matchesAnyPattern, never, nodeSignal, of, reactiveCounter, replay, share, shareReplay, throwError, toArray } from './sources.js';
|
|
11
11
|
export { StorageHandle, StorageTier, dictStorage, memoryStorage, sortJsonValue, stableJsonString } from './storage-core.js';
|
|
12
12
|
import '../node-BVV7G1bq.js';
|
|
13
|
-
import '../graph-
|
|
13
|
+
import '../graph-BOhEGJ6E.js';
|
|
14
14
|
import '../meta-BMwx3ExI.js';
|
|
15
15
|
import 'rxjs';
|
package/dist/extra/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Yb,b as Zb,c as gc,d as hc,e as tc,f as uc,g as vc,h as wc,i as xc,j as yc,k as zc}from"../chunk-
|
|
1
|
+
import{a as Yb,b as Zb,c as gc,d as hc,e as tc,f as uc,g as vc,h as wc,i as xc,j as yc,k as zc}from"../chunk-LJGPOJHS.js";import{a as sc}from"../chunk-5PBXUVHI.js";import{a as ac,b as bc}from"../chunk-7QMVU3IX.js";import{$ as Wb,A as vb,B as wb,C as xb,D as yb,E as zb,F as Ab,G as Bb,H as Cb,I as Db,J as Eb,K as Fb,L as Gb,M as Hb,N as Ib,O as Jb,P as Kb,Q as Lb,R as Mb,S as Nb,T as Ob,U as Pb,V as Qb,W as Rb,X as Sb,Y as Tb,Z as Ub,_ as Vb,a as ba,aa as Xb,b as ca,ba as fc,c as Za,d as _a,e as $a,f as ab,g as bb,h as cb,i as db,j as eb,k as fb,l as gb,m as hb,n as ib,o as jb,p as kb,q as lb,r as mb,s as nb,t as ob,u as pb,v as qb,w as rb,x as sb,y as tb,z as ub}from"../chunk-Y26UN6J5.js";import{a as n,b as o,c as p,d as q,e as r,f as s,g as t,h as u,i as v,j as w,k as x,l as y}from"../chunk-RWGJQQLT.js";import{b as cc,c as dc,d as ec,e as mc,f as nc}from"../chunk-4VXL3UZK.js";import{a as ic,b as jc}from"../chunk-DWIAG62L.js";import{a as kc,b as lc}from"../chunk-4UUDNFYG.js";import{a as _b,b as $b}from"../chunk-LWGLBCMU.js";import{a,b as _}from"../chunk-5QDBSZBV.js";import{a as $,b as aa}from"../chunk-XRSHMHEG.js";import"../chunk-4JBKKUCJ.js";import"../chunk-SGS4OJGS.js";import{a as m}from"../chunk-ESMPEKEV.js";import"../chunk-N2KKISCE.js";import{a as oc,b as pc,c as qc,d as rc}from"../chunk-I6VIH3VA.js";import{A as Da,B as Ea,C as Fa,D as Ga,E as Ha,F as Ia,G as Ja,I as Ka,J as La,K as Ma,L as Na,M as Oa,N as Pa,O as Qa,P as Ra,Q as Sa,R as Ta,S as Ua,T as Va,U as Wa,V as Xa,W as Ya,a as da,b as ea,c as fa,d as ga,e as ha,f as ia,g as ja,h as ka,i as la,j as ma,k as na,l as oa,m as pa,n as qa,o as ra,p as sa,q as ta,r as ua,s as va,t as wa,u as xa,v as ya,w as za,x as Aa,y as Ba,z as Ca}from"../chunk-WQ7I7JVU.js";import{a as d,b as e,c as f,d as g,e as h,f as i,g as j,h as k,i as l}from"../chunk-4VVTGLXJ.js";import{A as X,B as Y,C as Z,a as b,b as c,c as z,d as A,e as B,f as C,g as D,h as E,i as F,j as G,k as H,l as I,m as J,n as K,o as L,p as M,q as N,r as O,s as P,t as Q,u as R,v as S,w as T,x as U,y as V,z as W}from"../chunk-UMH3HSP7.js";import"../chunk-7AJKUA36.js";import"../chunk-CK2E7BTU.js";import"../chunk-QYADASLV.js";export{p as CircuitOpenError,cc as ContentAddressedMissError,d as NS_PER_MS,e as NS_PER_SEC,ic as NativeIndexBackend,kc as NativeListBackend,$ as NativeLogBackend,_b as NativeMapBackend,gc as NativePubSubBackend,t as RateLimiterOverflowError,m as ResettableTimer,w as TimeoutError,Ja as audit,V as awaitSettled,Ka as buffer,La as bufferCount,Na as bufferTime,S as cached,dc as canonicalJson,Zb as cascadingCache,Ya as catchError,Rb as checkpointToRedis,Qb as checkpointToS3,q as circuitBreaker,ua as combine,Va as combineLatest,ya as concat,Ca as concatMap,f as constant,ec as contentAddressedStorage,xc as createTransport,_ as createWatermarkController,yb as csvRows,Ga as debounce,Wa as debounceTime,j as decorrelatedJitter,Fa as delay,wc as deserializeError,rc as dictStorage,bc as distill,sa as distinctUntilChanged,oa as elementAt,L as empty,z as escapeRegexChar,Ba as exhaustMap,h as exponential,ca as externalBundle,ba as externalProducer,x as fallback,i as fibonacci,ea as filter,na as find,la as first,T as firstValueFrom,U as firstWhere,Ea as flatMap,O as forEach,J as fromAny,I as fromAsyncIter,xb as fromCSV,Bb as fromClickHouseWatch,E as fromCron,Wb as fromDrizzle,F as fromEvent,ab as fromHTTP,ib as fromHTTPPoll,hb as fromHTTPStream,G as fromIter,tb as fromKafka,Xb as fromKysely,lb as fromMCP,Eb as fromNATS,Ab as fromNDJSON,mb as fromOTel,Vb as fromPrisma,rb as fromPrometheus,H as fromPromise,Cb as fromPulsar,Gb as fromRabbitMQ,D as fromRaf,vb as fromRedisStream,gb as fromSSE,Sb as fromSqlite,Tb as fromSqliteCursor,pb as fromStatsD,nb as fromSyslog,C as fromTimer,_a as fromWebSocket,kb as fromWebSocketReconnect,$a as fromWebhook,A as globToRegExp,Qa as interval,Y as keepalive,ma as last,g as linear,Yb as lru,fc as makeHttpError,da as map,B as matchesAnyPattern,c as matchesCron,qc as memoryStorage,wa as merge,Da as mergeMap,uc as nameToSignal,zb as ndjsonRows,M as never,W as nodeSignal,K as of,qa as onFirstData,ta as pairwise,b as parseCron,sb as parsePrometheusText,fb as parseSSEStream,qb as parseStatsD,ob as parseSyslog,Sa as pausable,hc as pubsub,za as race,u as rateLimiter,Z as reactiveCounter,jc as reactiveIndex,lc as reactiveList,aa as reactiveLog,$b as reactiveMap,Za as reactiveSink,ga as reduce,Ra as repeat,R as replay,Ta as rescue,l as resolveBackoffPreset,n as retry,o as retrySource,Ia as sample,fa as scan,vc as serializeError,Q as share,X as shareReplay,tc as signalToName,mc as singleFromAny,nc as singleNodeFromAny,ia as skip,oc as sortJsonValue,pc as stableJsonString,sc as stratify,Aa as switchMap,ha as take,ka as takeUntil,ja as takeWhile,pa as tap,ra as tapFirst,Ha as throttle,Xa as throttleTime,N as throwError,y as timeout,P as toArray,Jb as toCSV,Kb as toClickHouse,Ib as toFile,bb as toHTTP,ub as toKafka,Ob as toLoki,Nb as toMongo,Fb as toNATS,a as toObservable,Mb as toPostgres,Db as toPulsar,Hb as toRabbitMQ,eb as toReadableStream,wb as toRedisStream,Lb as toS3,cb as toSSE,db as toSSEBytes,Ub as toSqlite,Pb as toTempo,jb as toWebSocket,s as tokenBucket,Ua as valve,ac as verifiable,Pa as window,Ma as windowCount,Oa as windowTime,r as withBreaker,va as withLatestFrom,k as withMaxAttempts,v as withStatus,yc as workerBridge,zc as workerSelf,xa as zip};
|