@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
package/dist/graph/index.cjs
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
`)}function an(t){if(t.version!==te)throw new Error(`unsupported snapshot version ${String(t.version)} (expected ${te})`);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 lr(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 p=0;p<s.length;p++)if(!r(s[p],h[p]))return!1;return!0}if(s instanceof Map){let h=o;if(s.size!==h.size)return!1;for(let[p,d]of s)if(!h.has(p)||!r(d,h.get(p)))return!1;return!0}if(s instanceof Set){let h=o;if(s.size!==h.size)return!1;for(let p of s){let d=!1;for(let g of h)if(r(p,g)){d=!0;break}if(!d)return!1}return!0}if(ArrayBuffer.isView(s)){let h=s,p=o;if(h.length!==p.length)return!1;for(let d=0;d<h.length;d++)if(h[d]!==p[d])return!1;return!0}let u=Object.keys(s),c=Object.keys(o);if(u.length!==c.length)return!1;let f=new Set(c);for(let h of u)if(!f.has(h)||!r(s[h],o[h]))return!1;return!0};return r(t,e)}function _t(t){if(t===null||typeof t!="object")return t;if(Array.isArray(t))return t.map(_t);let e=t,n=Object.keys(e).sort(),r={};for(let s of n)r[s]=_t(e[s]);return r}function cr(t){return t.replaceAll("\\","\\\\").replaceAll('"','\\"')}function dr(t){return t.replaceAll("\\","\\\\").replaceAll('"','\\"')}function fr(t){return t==="TD"?"down":t==="BT"?"up":t==="RL"?"left":"right"}function ln(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 cn(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 pr(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(_t(i),null,e.indent??2);return e.logger?.(a),a}function hr(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}): ${Ke(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 dn(t,e){let n=cn(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}["${cr(i)}"]`)}for(let[i,a]of ln(t)){let l=s.get(i),u=s.get(a);!l||!u||o.push(` ${l} --> ${u}`)}return o.join(`
|
|
6
6
|
`)}function gr(t,e){let n=dn(t,e);return xt(n)}function xt(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 mr(t,e){let n=cn(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: ${fr(n)}`];for(let i of r){let a=s.get(i);o.push(`${a}: "${dr(i)}"`)}for(let[i,a]of ln(t)){let l=s.get(i),u=s.get(a);!l||!u||o.push(`${l} -> ${u}`)}return o.join(`
|
|
7
|
-
`)}function br(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function We(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+=br(r)}return e+="$",new RegExp(e)}var yr={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"},vr={data:"",dirty:"",resolved:"",invalidate:"",pause:"",resume:"",complete:"",error:"",teardown:"",derived:"",path:"",reset:""};function Ke(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 _r(t){return t==="none"?vr:t==="ansi"||t==null?yr:{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 un(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 xr(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 vt(t,e,n){if(t==="")throw new Error(`Graph "${e}": ${n} name must be non-empty`);if(t.includes(G))throw new Error(`Graph "${e}": ${n} "${t}" must not contain '${G}' (path separator)`);if(t===j)throw new Error(`Graph "${e}": ${n} name "${j}" is reserved for meta companion paths`);xr(t,e,n)}function wr(t,e){if(t==="")throw new Error(`Graph "${e}": resolve path must be non-empty`);let n=t.split(G);for(let r of n)if(r==="")throw new Error(`Graph "${e}": resolve path has empty segment`);return n}function Or(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 fn(t){for(let e of t._mounts.values())fn(e);for(let e of t._nodes.values())try{e.down([[H]],{internal:!0})}catch{}}var ne=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(G))throw new Error(`Graph name must not contain '${G}' (got "${e}")`);if(e===j)throw new Error(`Graph name "${j}" is reserved for meta companion paths`);this.name=e,this.opts=Object.freeze({...n??{}}),this.config=n?.config??de,this._traceRing=new _e(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=zt(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(vt(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:le()})),e}setVersioning(e){if(e!=null)for(let n of this._nodes.values())n instanceof I&&n._applyVersioning(e)}remove(e){vt(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(`${G}${j}${G}`)||o.nodes.push(a);return o.nodes.sort(),o.mounts.push(e),o.mounts.push(...n._collectSubgraphs(`${e}${G}`)),this._mounts.delete(e),n._parent=void 0,fn(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=We(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(G))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([[P,n]],{actor:r?.actor,internal:s,delivery:"write"})}setAll(e,n){let r=Symbol.iterator in e?e:Object.entries(e);Ct(()=>{for(let[s,o]of r)this.set(s,o,n)})}invalidate(e,n){let r=n?.internal===!0;this.node(e).down([[q]],{actor:n?.actor,internal:r,delivery:"write"})}error(e,n,r){let s=r?.internal===!0;this.node(e).down([[L,n]],{actor:r?.actor,internal:s,delivery:"write"})}complete(e,n){let r=n?.internal===!0;this.node(e).down([[Y]],{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 f=r.get(c.node);f!=null&&a.push([f,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(vt(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=wr(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]===j)return this._resolveMetaChainFromNode(o,s,n.join(G));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(G)}" is invalid`):new Error(`Graph "${this.name}": unknown mount or node "${r}"`);return i.resolve(s.join(G))}_resolveMetaChainFromNode(e,n,r){let s=e,o=0,i=[...n];for(;o<i.length;){if(i[o]!==j)throw new Error(`Graph "${this.name}": expected ${j} segment in meta path "${r}"`);if(o+1>=i.length)throw new Error(`Graph "${this.name}": meta path requires a key after ${j} 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=Or(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 W)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 W)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=Fe(e?.detail,e?.fields),o=e?.format==="spec",i=o?Fe("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(([,k])=>k),w=new Set(l.values()),T=0;for(;x.length>0;){let k=x.shift();if(k instanceof I)for(let R of k._deps){let N=R.node;if(l.has(N))continue;let D=N.name??"",S=D;if(!S||w.has(S))if(D){let $=2;for(;w.has(`${D}#${$}`);)$++;S=`${D}#${$}`}else for(S=`__internal__/${T++}`;w.has(S);)S=`__internal__/${T++}`;l.set(N,S),w.add(S),u.push([S,N]),x.push(N)}}}let c=[...a,...u],f={};for(let[x,w]of c){if(n!=null&&!w.allowsObserve(n))continue;let T=gt(w,i),k=w instanceof I?w._deps.map(S=>l.get(S.node)??S.node.name??""):[],{name:R,...N}=T,D={...N,deps:k};if(!o){let S=this._annotations.get(x);S!=null&&(D.annotation=S)}if(r!=null)if(typeof r=="function"){let S=r;if(!(S.length>=2?S(x,D):S(D)))continue}else{let S=!0;for(let[$,V]of Object.entries(r)){let K=$==="deps_includes"?"depsIncludes":$==="meta_has"?"metaHas":$;if(K==="depsIncludes"){if(!D.deps.includes(String(V))){S=!1;break}continue}if(K==="metaHas"){if(!Object.hasOwn(D.meta??{},String(V))){S=!1;break}continue}if(D[K]!==V){S=!1;break}}if(!S)continue}f[x]=D}let h=new Set(Object.keys(f)),p=[];for(let[x,w]of c)if(w instanceof I)for(let T of w._deps){let k=l.get(T.node);k!=null&&p.push([k,x])}p.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=p.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}${G}`;return[...h].some(T=>T===x||T.startsWith(w))}):g,v=this,_=e,m={name:this.name,nodes:f,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??{},O=y.format;return O==="json"?pr(m,y):O==="pretty"?hr(m,y):O==="mermaid"?dn(m,y):O==="mermaid-url"?gr(m,y):O==="d2"?mr(m,y):O==="ascii"?sn(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}${G}`))}return n}resourceProfile(e){return Ue(this,e)}reachable(e,n,r={}){return r.withDetail===!0?qe(this.describe(),e,n,{...r,withDetail:!0}):qe(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 Re(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=He(s,{name:`${r}_version`}),i=this.observe({timeline:!0,structured:!0}),a=!1,l=!1,u=()=>{a||l||(a=!0,me(()=>{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()}),f=[],h=new WeakSet,p=b=>{if(h.has(b)||l)return;h.add(b);let v=b.topology.subscribe(_=>{for(let m of _){if(m[0]!==P)continue;let y=m[1];if(u(),y.kind==="added"&&y.nodeKind==="mount"){let O=b._mounts.get(y.name);O!=null&&p(O)}}});f.push(v);for(let _ of b._mounts.keys()){let m=b._mounts.get(_);m!=null&&p(m)}};p(this);let d;try{d=mt([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 f)v();throw i.dispose(),b}let g=bt(d);return{node:d,dispose(){l=!0,c();for(let b of f)b();f.length=0,i.dispose(),g()}}}_explainReactive(e,n,r){let s=0,o=He(s,{name:"explain_version"}),i=this.observe({timeline:!0,structured:!0}),a=!1,l=!1,u=i.onEvent(p=>{let d=p.type;d!=="data"&&d!=="error"&&d!=="complete"&&d!=="teardown"||a||l||(a=!0,me(()=>{a=!1,!l&&(s+=1,o.emit(s))}))}),c={...r?.maxDepth!=null?{maxDepth:r.maxDepth}:{},...r?.findCycle===!0?{findCycle:!0}:{}},f;try{f=mt([o],()=>this._explainStatic(e,n,c),{name:r?.name??"explain",describeKind:"derived",meta:{domain:"audit",kind:"explain_path",from:e,to:n},equals:(p,d)=>p.found===d.found&&p.reason===d.reason&&p.steps.length===d.steps.length&&Tr(p.steps,d.steps)})}catch(p){throw u(),i.dispose(),p}let h=bt(f);return{node:f,dispose(){l=!0,u(),i.dispose(),h()}}}_pathsMatching(e){let n=We(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}${G}${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}${G}${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}${G}${j}${G}${s}`;r.push([i,o]),this._appendMetaObserveTargets(i,o,r)}}observe(e,n){let r=typeof e=="string",o=un(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,f=this.resolve(c);if(a!=null&&!f.allowsObserve(a))throw new W({actor:a,action:"observe",nodeName:c});return i?this._buildStructuredObserver([[c,f]],o,"one"):{subscribe(h){return f.subscribe(h)},up(h){try{f.up?.(h)}catch(p){if(p instanceof W)return;throw p}}}}let l=[];this._collectObserveTargets("",l),l.sort((c,f)=>c[0]<f[0]?-1:c[0]>f[0]?1:0);let u=a==null?l:l.filter(([,c])=>c.allowsObserve(a));return i?this._buildStructuredObserver(u,o,"all"):{subscribe:c=>{let f=u.map(([h,p])=>p.subscribe(d=>{c(h,d)}));return()=>{for(let h of f)h()}},up:(c,f)=>{try{this.resolve(c).up?.(f)}catch(h){if(h instanceof W)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,f)=>c[0]<f[0]?-1:c[0]>f[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,f=c!=null&&c>0?new _e(c):null,h=[],p=new Set,d={},g=new Set,b=0,v=0,_=0,m=0,y=0,O=0,x=!1,w=!1,T=0,k=new Map,R=new Map,N=new Map,D=E=>{f?f.push(E):h.push(E);for(let C of p)C(E)},S=()=>s?{timestamp_ns:le(),in_batch:Ce(),batch_id:T}:{},$=(E,C)=>{if(!(!u||!(E instanceof I)))return E._setInspectorHook(B=>{if(B.kind==="dep_message")k.set(E,B.depIndex);else if(B.kind==="run"){let fe=B.batchData.map((A,F)=>A!=null&&A.length>0?A.at(-1):B.prevData[F]);R.set(E,fe);let z=B.batchData.map(A=>A!=null?[...A]:void 0);N.set(E,z),i&&D({type:"derived",path:C,dep_values:fe,dep_batches:z,...S()})}})},V=E=>{let C=k.get(E),B=R.get(E);if(!o||B==null)return{};let z=(C!=null&&C>=0&&E instanceof I?E._deps[C]:void 0)?.node,A=z?.v,F=N.get(E);return{trigger_dep_index:C,trigger_dep_name:z?.name,...A!=null?{trigger_version:{id:A.id,version:A.version}}:{},dep_values:[...B],...F!=null?{dep_batches:F}:{}}},K=[],re=[];for(let[E,C]of e){let B=$(C,E);B&&K.push(B),re.push(C.subscribe(fe=>{T++;for(let z of fe){let A=z[0],F=S();if(A===P){d[E]=z[1];let Ze=C instanceof I?C.lastMutation?.actor??ie:ie;D({type:"data",path:E,data:z[1],actor:Ze,...F,...V(C)})}else if(a)A===J?b++:A===X?v++:A===q?_++:A===Z?m++:A===Q?y++:A===H?O++:A===Y&&!g.has(E)?x=!0:A===L&&(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,...V(C)});else if(A===q)_++,D({type:"invalidate",path:E,...F});else if(A===Z)m++,D({type:"pause",path:E,lockId:z[1],...F});else if(A===Q)y++,D({type:"resume",path:E,lockId:z[1],...F});else if(A===Y)g.has(E)||(x=!0),D({type:"complete",path:E,...F});else if(A===L){w=!0,g.add(E);let Ze=C instanceof I?C.lastMutation?.actor??ie:ie;D({type:"error",path:E,data:z[1],actor:Ze,...F})}else A===H&&(O++,D({type:"teardown",path:E,...F}))}}))}let Ye=!1,Je=()=>{if(!Ye){Ye=!0;for(let E of re)E();for(let E of K)E();for(let E of xe)E({value:void 0,done:!0});xe.length=0}},Xe=[],xe=[];p.add(E=>{let C=xe.shift();C?C({value:E,done:!1}):Xe.push(E)});let Ot={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 O},get events(){return f?f.toArray():[...h]},get anyCompletedCleanly(){return x},get anyErrored(){return w},get completedWithoutErrors(){return x&&!w},onEvent(E){return p.add(E),()=>p.delete(E)},dispose:Je,expand(E){Je();let C={...n};return typeof E=="string"?C.detail=E:Object.assign(C,E),r(un(C))},[Symbol.asyncIterator](){return{next(){return Xe.length>0?Promise.resolve({value:Xe.shift(),done:!1}):Ye?Promise.resolve({value:void 0,done:!0}):new Promise(E=>xe.push(E))},return(){return Je(),Promise.resolve({value:void 0,done:!0})}}}};return n.format!=null&&this._attachFormatLogger(Ot,n),Ot}_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=_r(n.theme),u=r==="stage-log"?le():0,c=d=>d==null?"":n.stageLabels?.[d]??d,f=(d,g)=>d.length>g?`${d.slice(0,g-1)}\u2026`:d,h=d=>d.type==="data"||d.type==="error"?f(Ke(d.data),120):"",p=d=>{if(r==="stage-log"){let w=(le()-u)/1e9,T=c(d.path).padEnd(9);if(d.type==="data"){let k=h(d);return`[${w.toFixed(3)}s] ${T} \u2190${k?` ${k}`:""}`}if(d.type==="error"){let k=h(d);return`[${w.toFixed(3)}s] ${T} \u2717${k?` ${k}`:""}`}return d.type==="complete"?`[${w.toFixed(3)}s] ${T} \u25A0 complete`:`[${w.toFixed(3)}s] ${T} ${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?` ${Ke(d.data)}`:_?` ${Ke(d.lockId)}`:"",y=d.type==="data"||d.type==="resolved"||d.type==="derived"?d:void 0,O=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}${O}${x}`};e.onEvent(d=>{a(d.type)&&s(p(d),d)})}addDisposer(e){return this._disposers.add(e),()=>{this._disposers.delete(e)}}destroy(){on(this._disposers,this.name),this.signal([[H]],{internal:!0}),on(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 Oe(a,a.encode(i))}throw new Error(`snapshot: unknown format "${String(e.format)}"`)}static decode(e,n){let r=n?.config??de,{codec:s,codecVersion:o,payload:i}=Te(e,r);return s.decode(i,o)}restore(e,n){if(an(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=>We(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){an(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 p of[...e.subgraphs].sort((d,g)=>{let b=d.split(G).length,v=g.split(G).length;return b!==v?b-v:d<g?-1:d>g?1:0})){let d=p.split(G),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(([p,d])=>({re:We(p),factory:d})):[],a=p=>{for(let d of i)if(d.re.test(p))return d.factory},l=p=>{let d=p.split(G),g=d.pop();if(g==null||g.length===0)throw new Error(`invalid snapshot path "${p}"`);let b=o;for(let v of d){let _=b._mounts.get(v);if(!_)throw new Error(`unknown mount "${v}" in path "${p}"`);b=_}return[b,g]},u=Object.entries(e.nodes).filter(([p])=>!p.includes(`${G}${j}${G}`)).sort((p,d)=>p[0]<d[0]?-1:p[0]>d[0]?1:0),c=new Map(u),f=new Map,h=!0;for(;c.size>0&&h;){h=!1;for(let[p,d]of[...c.entries()]){let g=d?.deps??[];if(!g.every(O=>f.has(O)))continue;let[b,v]=l(p),_={...d?.meta??{}},m=a(p),y;if(d?.type==="state")y=He(d.value,{meta:_});else{if(m==null)continue;y=m(v,{path:p,type:d.type,value:d.value,meta:_,deps:g,resolvedDeps:g.map(O=>f.get(O))})}b.add(y,{name:v}),f.set(p,y),c.delete(p),h=!0}}if(c.size>0){let p=[...c.keys()].sort().join(", ");throw new Error(`Graph.fromSnapshot could not reconstruct nodes without build callback: ${p}. 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 f=ur(c.nodes);if(u.lastSnapshot!=null&&f!==""&&f===u.lastFingerprint)return;let h=u.seq+1,p=Me(),b=u.lastSnapshot==null||h%u.compactEvery===0?{mode:"full",snapshot:c,seq:h,timestamp_ns:p,format_version:te}:{mode:"diff",diff:wt(u.lastSnapshot,c),seq:h,timestamp_ns:p,format_version:te};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=f)},O=>{n.onError?.(O,u.tier)});u.savePending=y.finally(()=>{u.savePending===y&&(u.savePending=void 0)})}else u.seq=h,u.lastSnapshot=c,u.lastFingerprint=f},o=(u,c)=>{try{s(u,c)}catch(f){n.onError?.(f,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=gt(d,Fe("standard"));if(!n.filter(u,g))return}let h,p=()=>(h==null&&(h=this.snapshot()),h);for(let d of r)d.disposed||(d.debounceMs===0?o(d,p()):(d.timer==null&&(d.timer=new Ve),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(f=>{let h=this.tryResolve(f);return h==null?()=>{}:h.subscribe(p=>i(f,p))});a=()=>{for(let f of c)f()}}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===te&&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===te&&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:le(),...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[_],O=m.v,x=y.v;O!=null&&x!=null&&O.id===x.id&&O.version!==x.version&&l.push({path:_,id:O.id,from:O.version,to:x.version});let w=O!=null&&x!=null&&O.id===x.id&&O.version===x.version;for(let T of["type","status","sentinel"]){let k=m[T],R=y[T];k!==R&&a.push({path:_,field:T,from:k,to:R})}if(!w)for(let T of["value","meta"]){let k=m[T],R=y[T];lr(k,R)||a.push({path:_,field:T,from:k,to:R})}}let u=_=>`${_.from} ${_.to}`,c=new Set(e.edges.map(u)),f=new Set(n.edges.map(u)),h=n.edges.filter(_=>!c.has(u(_))),p=e.edges.filter(_=>!f.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:p,subgraphsAdded:b,subgraphsRemoved:v}}};function wt(t,e){let n=ne.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 qe(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 O=y.deps??[];i.set(m,O);for(let x of O)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:"",O=typeof m.to=="string"?m.to:"";!y||!O||(c.add(y),c.add(O),u.has(y)||u.set(y,new Set),u.get(y).add(O),l.has(O)||l.set(O,new Set),l.get(O).add(y))}if(!c.has(e))return r.withDetail?s:[];let f=r.both===!0,h=m=>{if(f){let w=i.get(m)??[],T=l.get(m),k=a.get(m),R=u.get(m),N=[...w];return T&&N.push(...T),k&&N.push(...k),R&&N.push(...R),N}if(n==="upstream"){let w=i.get(m)??[],T=l.get(m);return T?[...w,...T]:w}let y=a.get(m),O=u.get(m),x=y?[...y]:[];return O&&x.push(...O),x},p=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||p.has(y)||(p.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 Tr(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}ye();function pn(t,e){let n=new Map,r=(s,o)=>{if(n.has(s))return;let i={off:()=>{},prefix:o};n.set(s,i);let a=s.topology.subscribe(l=>{for(let u of l){if(u[0]!==P)continue;let c=u[1];if(e(c,s,o),c.kind==="added"&&c.nodeKind==="mount"){let f=s._mounts.get(c.name);if(f instanceof ne){let h=`${o}${c.name}::`;r(f,h)}}else if(c.kind==="removed"&&c.nodeKind==="mount"){let f=`${o}${c.name}::`;for(let[h,p]of Array.from(n.entries()))h!==t&&p.prefix.startsWith(f)&&(p.off(),n.delete(h))}}});i.off=a;for(let[l,u]of s._mounts)if(u instanceof ne){let c=`${o}${l}::`;r(u,c)}};return r(t,""),()=>{for(let s of n.values())s.off();n.clear()}}function hn(t,e={}){let n=[],r=e.requireFound??!0;if(e.skipDescribe!==!0)try{let u=t.describe(),c=new Set(Object.keys(u.nodes)),f=[];for(let[h,p]of Object.entries(u.nodes))for(let d of p.deps)d!==""&&!c.has(d)&&f.push(`${h} \u2192 ${d}`);for(let h of u.edges)c.has(h.from)||f.push(`edge.from: ${h.from}`),c.has(h.to)||f.push(`edge.to: ${h.to}`);f.length>0?n.push({kind:"describe",ok:!1,reason:`describe() has ${f.length} dangling pointer(s); nodes \u2289 deps`,danglingDeps:f}):n.push({kind:"describe",ok:!0,nodeCount:c.size,edgeCount:u.edges.length})}catch(u){n.push({kind:"describe",ok:!1,reason:`describe() threw: ${u instanceof Error?u.message:String(u)}`})}for(let u of e.formats??[])try{let c=t.describe({format:u});typeof c!="string"||c.length===0?n.push({kind:"describe-format",ok:!1,format:u,reason:`describe({ format: "${u}" }) returned empty or non-string output`}):n.push({kind:"describe-format",ok:!0,format:u,length:c.length})}catch(c){n.push({kind:"describe-format",ok:!1,format:u,reason:c instanceof Error?c.message:String(c)})}for(let u of e.paths??[])try{t.resolve(u),n.push({kind:"observe",ok:!0,path:u})}catch(c){n.push({kind:"observe",ok:!1,path:u,reason:c instanceof Error?c.message:String(c)})}for(let[u,c]of e.pairs??[])try{let f=t.explain(u,c);r&&f.found===!1?n.push({kind:"explain",ok:!1,from:u,to:c,reason:`explain(${u} \u2192 ${c}) found no path${f.reason?`: ${f.reason}`:""}`}):n.push({kind:"explain",ok:!0,from:u,to:c,found:f.found,steps:f.steps.length})}catch(f){n.push({kind:"explain",ok:!1,from:u,to:c,reason:f instanceof Error?f.message:String(f)})}let s=n.filter(u=>!u.ok),o=s.length===0,i=e.paths?.length??0,a=e.pairs?.length??0,l=e.formats?.length??0;return{ok:o,checks:n,failures:s,summary(){let u=[e.skipDescribe===!0?null:"describe",l>0?`${l} format${l===1?"":"s"}`:null,i>0?`${i} observe path${i===1?"":"s"}`:null,a>0?`${a} explain pair${a===1?"":"s"}`:null].filter(f=>f!=null),c=u.length>0?u.join(", "):"describe-only";return o?`validateGraphObservability: OK (${c})`:`validateGraphObservability: ${s.length} failure(s) across ${c}`}}}0&&(module.exports={ENVELOPE_VERSION,GRAPH_META_SEGMENT,Graph,JsonCodec,SIZEOF_OVERHEAD,SIZEOF_SYMBOL,SNAPSHOT_VERSION,createDagCborCodec,createDagCborZstdCodec,decodeEnvelope,diffForWAL,encodeEnvelope,explainPath,graphProfile,mermaidLiveUrl,reachable,registerBuiltinCodecs,replayWAL,sizeof,validateGraphObservability,watchTopologyTree});
|
|
7
|
+
`)}function br(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function We(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+=br(r)}return e+="$",new RegExp(e)}var yr={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"},vr={data:"",dirty:"",resolved:"",invalidate:"",pause:"",resume:"",complete:"",error:"",teardown:"",derived:"",path:"",reset:""};function Ke(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 _r(t){return t==="none"?vr:t==="ansi"||t==null?yr:{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 un(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 xr(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 vt(t,e,n){if(t==="")throw new Error(`Graph "${e}": ${n} name must be non-empty`);if(t.includes(G))throw new Error(`Graph "${e}": ${n} "${t}" must not contain '${G}' (path separator)`);if(t===j)throw new Error(`Graph "${e}": ${n} name "${j}" is reserved for meta companion paths`);xr(t,e,n)}function wr(t,e){if(t==="")throw new Error(`Graph "${e}": resolve path must be non-empty`);let n=t.split(G);for(let r of n)if(r==="")throw new Error(`Graph "${e}": resolve path has empty segment`);return n}function Or(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 fn(t){for(let e of t._mounts.values())fn(e);for(let e of t._nodes.values())try{e.down([[H]],{internal:!0})}catch{}}var ne=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(G))throw new Error(`Graph name must not contain '${G}' (got "${e}")`);if(e===j)throw new Error(`Graph name "${j}" is reserved for meta companion paths`);this.name=e,this.opts=Object.freeze({...n??{}}),this.config=n?.config??de,this._traceRing=new _e(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=zt(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(vt(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:le()})),e}setVersioning(e){if(e!=null)for(let n of this._nodes.values())n instanceof I&&n._applyVersioning(e)}remove(e){vt(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(`${G}${j}${G}`)||o.nodes.push(a);return o.nodes.sort(),o.mounts.push(e),o.mounts.push(...n._collectSubgraphs(`${e}${G}`)),this._mounts.delete(e),n._parent=void 0,fn(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=We(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(G))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([[P,n]],{actor:r?.actor,internal:s,delivery:"write"})}setAll(e,n){let r=Symbol.iterator in e?e:Object.entries(e);Ct(()=>{for(let[s,o]of r)this.set(s,o,n)})}invalidate(e,n){let r=n?.internal===!0;this.node(e).down([[q]],{actor:n?.actor,internal:r,delivery:"write"})}error(e,n,r){let s=r?.internal===!0;this.node(e).down([[L,n]],{actor:r?.actor,internal:s,delivery:"write"})}complete(e,n){let r=n?.internal===!0;this.node(e).down([[Y]],{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 f=r.get(c.node);f!=null&&a.push([f,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(vt(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=wr(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]===j)return this._resolveMetaChainFromNode(o,s,n.join(G));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(G)}" is invalid`):new Error(`Graph "${this.name}": unknown mount or node "${r}"`);return i.resolve(s.join(G))}_resolveMetaChainFromNode(e,n,r){let s=e,o=0,i=[...n];for(;o<i.length;){if(i[o]!==j)throw new Error(`Graph "${this.name}": expected ${j} segment in meta path "${r}"`);if(o+1>=i.length)throw new Error(`Graph "${this.name}": meta path requires a key after ${j} 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=Or(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 W)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 W)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=Fe(e?.detail,e?.fields),o=e?.format==="spec",i=o?Fe("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(([,k])=>k),w=new Set(l.values()),T=0;for(;x.length>0;){let k=x.shift();if(k instanceof I)for(let R of k._deps){let N=R.node;if(l.has(N))continue;let D=N.name??"",S=D;if(!S||w.has(S))if(D){let $=2;for(;w.has(`${D}#${$}`);)$++;S=`${D}#${$}`}else for(S=`__internal__/${T++}`;w.has(S);)S=`__internal__/${T++}`;l.set(N,S),w.add(S),u.push([S,N]),x.push(N)}}}let c=[...a,...u],f={};for(let[x,w]of c){if(n!=null&&!w.allowsObserve(n))continue;let T=gt(w,i),k=w instanceof I?w._deps.map(S=>l.get(S.node)??S.node.name??""):[],{name:R,...N}=T,D={...N,deps:k};if(!o){let S=this._annotations.get(x);S!=null&&(D.annotation=S)}if(r!=null)if(typeof r=="function"){let S=r;if(!(S.length>=2?S(x,D):S(D)))continue}else{let S=!0;for(let[$,V]of Object.entries(r)){let K=$==="deps_includes"?"depsIncludes":$==="meta_has"?"metaHas":$;if(K==="depsIncludes"){if(!D.deps.includes(String(V))){S=!1;break}continue}if(K==="metaHas"){if(!Object.hasOwn(D.meta??{},String(V))){S=!1;break}continue}if(D[K]!==V){S=!1;break}}if(!S)continue}f[x]=D}let h=new Set(Object.keys(f)),p=[];for(let[x,w]of c)if(w instanceof I)for(let T of w._deps){let k=l.get(T.node);k!=null&&p.push([k,x])}p.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=p.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}${G}`;return[...h].some(T=>T===x||T.startsWith(w))}):g,v=this,_=e,m={name:this.name,nodes:f,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??{},O=y.format;return O==="json"?pr(m,y):O==="pretty"?hr(m,y):O==="mermaid"?dn(m,y):O==="mermaid-url"?gr(m,y):O==="d2"?mr(m,y):O==="ascii"?sn(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}${G}`))}return n}resourceProfile(e){return Ue(this,e)}reachable(e,n,r={}){return r.withDetail===!0?qe(this.describe(),e,n,{...r,withDetail:!0}):qe(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 Re(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=He(s,{name:`${r}_version`}),i=this.observe({timeline:!0,structured:!0}),a=!1,l=!1,u=()=>{a||l||(a=!0,me(()=>{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()}),f=[],h=new WeakSet,p=b=>{if(h.has(b)||l)return;h.add(b);let v=b.topology.subscribe(_=>{for(let m of _){if(m[0]!==P)continue;let y=m[1];if(u(),y.kind==="added"&&y.nodeKind==="mount"){let O=b._mounts.get(y.name);O!=null&&p(O)}}});f.push(v);for(let _ of b._mounts.keys()){let m=b._mounts.get(_);m!=null&&p(m)}};p(this);let d;try{d=mt([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 f)v();throw i.dispose(),b}let g=bt(d);return{node:d,dispose(){l=!0,c();for(let b of f)b();f.length=0,i.dispose(),g()}}}_explainReactive(e,n,r){let s=0,o=He(s,{name:"explain_version"}),i=this.observe({timeline:!0,structured:!0}),a=!1,l=!1,u=i.onEvent(p=>{let d=p.type;d!=="data"&&d!=="error"&&d!=="complete"&&d!=="teardown"||a||l||(a=!0,me(()=>{a=!1,!l&&(s+=1,o.emit(s))}))}),c={...r?.maxDepth!=null?{maxDepth:r.maxDepth}:{},...r?.findCycle===!0?{findCycle:!0}:{}},f;try{f=mt([o],()=>this._explainStatic(e,n,c),{name:r?.name??"explain",describeKind:"derived",meta:{domain:"audit",kind:"explain_path",from:e,to:n},equals:(p,d)=>p.found===d.found&&p.reason===d.reason&&p.steps.length===d.steps.length&&Tr(p.steps,d.steps)})}catch(p){throw u(),i.dispose(),p}let h=bt(f);return{node:f,dispose(){l=!0,u(),i.dispose(),h()}}}_pathsMatching(e){let n=We(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}${G}${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}${G}${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}${G}${j}${G}${s}`;r.push([i,o]),this._appendMetaObserveTargets(i,o,r)}}observe(e,n){let r=typeof e=="string",o=un(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,f=this.resolve(c);if(a!=null&&!f.allowsObserve(a))throw new W({actor:a,action:"observe",nodeName:c});return i?this._buildStructuredObserver([[c,f]],o,"one"):{subscribe(h){return f.subscribe(h)},up(h){try{f.up?.(h)}catch(p){if(p instanceof W)return;throw p}}}}let l=[];this._collectObserveTargets("",l),l.sort((c,f)=>c[0]<f[0]?-1:c[0]>f[0]?1:0);let u=a==null?l:l.filter(([,c])=>c.allowsObserve(a));return i?this._buildStructuredObserver(u,o,"all"):{subscribe:c=>{let f=u.map(([h,p])=>p.subscribe(d=>{c(h,d)}));return()=>{for(let h of f)h()}},up:(c,f)=>{try{this.resolve(c).up?.(f)}catch(h){if(h instanceof W)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,f)=>c[0]<f[0]?-1:c[0]>f[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,f=c!=null&&c>0?new _e(c):null,h=[],p=new Set,d={},g=new Set,b=0,v=0,_=0,m=0,y=0,O=0,x=!1,w=!1,T=0,k=new Map,R=new Map,N=new Map,D=E=>{f?f.push(E):h.push(E);for(let C of p)C(E)},S=()=>s?{timestamp_ns:le(),in_batch:Ce(),batch_id:T}:{},$=(E,C)=>{if(!(!u||!(E instanceof I)))return E._setInspectorHook(B=>{if(B.kind==="dep_message")k.set(E,B.depIndex);else if(B.kind==="run"){let fe=B.batchData.map((A,F)=>A!=null&&A.length>0?A.at(-1):B.prevData[F]);R.set(E,fe);let z=B.batchData.map(A=>A!=null?[...A]:void 0);N.set(E,z),i&&D({type:"derived",path:C,dep_values:fe,dep_batches:z,...S()})}})},V=E=>{let C=k.get(E),B=R.get(E);if(!o||B==null)return{};let z=(C!=null&&C>=0&&E instanceof I?E._deps[C]:void 0)?.node,A=z?.v,F=N.get(E);return{trigger_dep_index:C,trigger_dep_name:z?.name,...A!=null?{trigger_version:{id:A.id,version:A.version}}:{},dep_values:[...B],...F!=null?{dep_batches:F}:{}}},K=[],re=[];for(let[E,C]of e){let B=$(C,E);B&&K.push(B),re.push(C.subscribe(fe=>{T++;for(let z of fe){let A=z[0],F=S();if(A===P){d[E]=z[1];let Ze=C instanceof I?C.lastMutation?.actor??ie:ie;D({type:"data",path:E,data:z[1],actor:Ze,...F,...V(C)})}else if(a)A===J?b++:A===X?v++:A===q?_++:A===Z?m++:A===Q?y++:A===H?O++:A===Y&&!g.has(E)?x=!0:A===L&&(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,...V(C)});else if(A===q)_++,D({type:"invalidate",path:E,...F});else if(A===Z)m++,D({type:"pause",path:E,lockId:z[1],...F});else if(A===Q)y++,D({type:"resume",path:E,lockId:z[1],...F});else if(A===Y)g.has(E)||(x=!0),D({type:"complete",path:E,...F});else if(A===L){w=!0,g.add(E);let Ze=C instanceof I?C.lastMutation?.actor??ie:ie;D({type:"error",path:E,data:z[1],actor:Ze,...F})}else A===H&&(O++,D({type:"teardown",path:E,...F}))}}))}let Ye=!1,Je=()=>{if(!Ye){Ye=!0;for(let E of re)E();for(let E of K)E();for(let E of xe)E({value:void 0,done:!0});xe.length=0}},Xe=[],xe=[];p.add(E=>{let C=xe.shift();C?C({value:E,done:!1}):Xe.push(E)});let Ot={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 O},get events(){return f?f.toArray():[...h]},get anyCompletedCleanly(){return x},get anyErrored(){return w},get completedWithoutErrors(){return x&&!w},onEvent(E){return p.add(E),()=>p.delete(E)},dispose:Je,expand(E){Je();let C={...n};return typeof E=="string"?C.detail=E:Object.assign(C,E),r(un(C))},[Symbol.asyncIterator](){return{next(){return Xe.length>0?Promise.resolve({value:Xe.shift(),done:!1}):Ye?Promise.resolve({value:void 0,done:!0}):new Promise(E=>xe.push(E))},return(){return Je(),Promise.resolve({value:void 0,done:!0})}}}};return n.format!=null&&this._attachFormatLogger(Ot,n),Ot}_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=_r(n.theme),u=r==="stage-log"?le():0,c=d=>d==null?"":n.stageLabels?.[d]??d,f=(d,g)=>d.length>g?`${d.slice(0,g-1)}\u2026`:d,h=d=>d.type==="data"||d.type==="error"?f(Ke(d.data),120):"",p=d=>{if(r==="stage-log"){let w=(le()-u)/1e9,T=c(d.path).padEnd(9);if(d.type==="data"){let k=h(d);return`[${w.toFixed(3)}s] ${T} \u2190${k?` ${k}`:""}`}if(d.type==="error"){let k=h(d);return`[${w.toFixed(3)}s] ${T} \u2717${k?` ${k}`:""}`}return d.type==="complete"?`[${w.toFixed(3)}s] ${T} \u25A0 complete`:`[${w.toFixed(3)}s] ${T} ${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?` ${Ke(d.data)}`:_?` ${Ke(d.lockId)}`:"",y=d.type==="data"||d.type==="resolved"||d.type==="derived"?d:void 0,O=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}${O}${x}`};e.onEvent(d=>{a(d.type)&&s(p(d),d)})}addDisposer(e){return this._disposers.add(e),()=>{this._disposers.delete(e)}}destroy(){on(this._disposers,this.name),this.signal([[H]],{internal:!0}),on(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 Oe(a,a.encode(i))}throw new Error(`snapshot: unknown format "${String(e.format)}"`)}static decode(e,n){let r=n?.config??de,{codec:s,codecVersion:o,payload:i}=Te(e,r);return s.decode(i,o)}restore(e,n){if(an(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=>We(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){an(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 p of[...e.subgraphs].sort((d,g)=>{let b=d.split(G).length,v=g.split(G).length;return b!==v?b-v:d<g?-1:d>g?1:0})){let d=p.split(G),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(([p,d])=>({re:We(p),factory:d})):[],a=p=>{for(let d of i)if(d.re.test(p))return d.factory},l=p=>{let d=p.split(G),g=d.pop();if(g==null||g.length===0)throw new Error(`invalid snapshot path "${p}"`);let b=o;for(let v of d){let _=b._mounts.get(v);if(!_)throw new Error(`unknown mount "${v}" in path "${p}"`);b=_}return[b,g]},u=Object.entries(e.nodes).filter(([p])=>!p.includes(`${G}${j}${G}`)).sort((p,d)=>p[0]<d[0]?-1:p[0]>d[0]?1:0),c=new Map(u),f=new Map,h=!0;for(;c.size>0&&h;){h=!1;for(let[p,d]of[...c.entries()]){let g=d?.deps??[];if(!g.every(O=>f.has(O)))continue;let[b,v]=l(p),_={...d?.meta??{}},m=a(p),y;if(d?.type==="state")y=He(d.value,{meta:_});else{if(m==null)continue;y=m(v,{path:p,type:d.type,value:d.value,meta:_,deps:g,resolvedDeps:g.map(O=>f.get(O))})}b.add(y,{name:v}),f.set(p,y),c.delete(p),h=!0}}if(c.size>0){let p=[...c.keys()].sort().join(", ");throw new Error(`Graph.fromSnapshot could not reconstruct nodes without build callback: ${p}. 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 f=ur(c.nodes);if(u.lastSnapshot!=null&&f!==""&&f===u.lastFingerprint)return;let h=u.seq+1,p=Me(),b=u.lastSnapshot==null||h%u.compactEvery===0?{mode:"full",snapshot:c,seq:h,timestamp_ns:p,format_version:te}:{mode:"diff",diff:wt(u.lastSnapshot,c),seq:h,timestamp_ns:p,format_version:te};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=f)},O=>{n.onError?.(O,u.tier)});u.savePending=y.finally(()=>{u.savePending===y&&(u.savePending=void 0)})}else u.seq=h,u.lastSnapshot=c,u.lastFingerprint=f},o=(u,c)=>{try{s(u,c)}catch(f){n.onError?.(f,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=gt(d,Fe("standard"));if(!n.filter(u,g))return}let h,p=()=>(h==null&&(h=this.snapshot()),h);for(let d of r)d.disposed||(d.debounceMs===0?o(d,p()):(d.timer==null&&(d.timer=new Ve),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(f=>{let h=this.tryResolve(f);return h==null?()=>{}:h.subscribe(p=>i(f,p))});a=()=>{for(let f of c)f()}}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===te&&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===te&&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:le(),...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[_],O=m.v,x=y.v;O!=null&&x!=null&&O.id===x.id&&O.version!==x.version&&l.push({path:_,id:O.id,from:O.version,to:x.version});let w=O!=null&&x!=null&&O.id===x.id&&O.version===x.version;for(let T of["type","status","sentinel"]){let k=m[T],R=y[T];k!==R&&a.push({path:_,field:T,from:k,to:R})}if(!w)for(let T of["value","meta"]){let k=m[T],R=y[T];lr(k,R)||a.push({path:_,field:T,from:k,to:R})}}let u=_=>`${_.from} ${_.to}`,c=new Set(e.edges.map(u)),f=new Set(n.edges.map(u)),h=n.edges.filter(_=>!c.has(u(_))),p=e.edges.filter(_=>!f.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:p,subgraphsAdded:b,subgraphsRemoved:v}}};function wt(t,e){let n=ne.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 qe(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 O=y.deps??[];i.set(m,O);for(let x of O)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:"",O=typeof m.to=="string"?m.to:"";!y||!O||(c.add(y),c.add(O),u.has(y)||u.set(y,new Set),u.get(y).add(O),l.has(O)||l.set(O,new Set),l.get(O).add(y))}if(!c.has(e))return r.withDetail?s:[];let f=r.both===!0,h=m=>{if(f){let w=i.get(m)??[],T=l.get(m),k=a.get(m),R=u.get(m),N=[...w];return T&&N.push(...T),k&&N.push(...k),R&&N.push(...R),N}if(n==="upstream"){let w=i.get(m)??[],T=l.get(m);return T?[...w,...T]:w}let y=a.get(m),O=u.get(m),x=y?[...y]:[];return O&&x.push(...O),x},p=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||p.has(y)||(p.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 Tr(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}ye();function pn(t,e){let n=new Map,r=(s,o)=>{if(n.has(s))return;let i={off:()=>{},prefix:o};n.set(s,i);let a=s.topology.subscribe(l=>{for(let u of l){if(u[0]!==P)continue;let c=u[1];if(e(c,s,o),c.kind==="added"&&c.nodeKind==="mount"){let f=s._mounts.get(c.name);if(f instanceof ne){let h=`${o}${c.name}::`;r(f,h)}}else if(c.kind==="removed"&&c.nodeKind==="mount"){let f=`${o}${c.name}::`;for(let[h,p]of Array.from(n.entries()))h!==t&&p.prefix.startsWith(f)&&(p.off(),n.delete(h))}}});i.off=a;for(let[l,u]of s._mounts)if(u instanceof ne){let c=`${o}${l}::`;r(u,c)}};return r(t,""),()=>{for(let s of n.values())s.off();n.clear()}}function hn(t,e={}){let n=[],r=e.requireFound??!0;if(e.skipDescribe!==!0)try{let u=t.describe(),c=new Set(Object.keys(u.nodes)),f=[];for(let[h,p]of Object.entries(u.nodes))for(let d of p.deps)d!==""&&!c.has(d)&&f.push(`${h} \u2192 ${d}`);for(let h of u.edges)c.has(h.from)||f.push(`edge.from: ${h.from}`),c.has(h.to)||f.push(`edge.to: ${h.to}`);f.length>0?n.push({kind:"describe",ok:!1,reason:`describe() has ${f.length} dangling pointer(s); nodes \u2289 deps`,danglingDeps:f}):n.push({kind:"describe",ok:!0,nodeCount:c.size,edgeCount:u.edges.length})}catch(u){n.push({kind:"describe",ok:!1,reason:`describe() threw: ${u instanceof Error?u.message:String(u)}`})}for(let u of e.formats??[])try{let c=t.describe({format:u});typeof c!="string"||c.length===0?n.push({kind:"describe-format",ok:!1,format:u,reason:`describe({ format: "${u}" }) returned empty or non-string output`}):n.push({kind:"describe-format",ok:!0,format:u,length:c.length})}catch(c){n.push({kind:"describe-format",ok:!1,format:u,reason:c instanceof Error?c.message:String(c)})}for(let u of e.paths??[])try{t.resolve(u),n.push({kind:"observe",ok:!0,path:u})}catch(c){n.push({kind:"observe",ok:!1,path:u,reason:c instanceof Error?c.message:String(c)})}for(let[u,c]of e.pairs??[])try{let f=t.explain(u,c);r&&f.found===!1?n.push({kind:"explain",ok:!1,from:u,to:c,reason:`explain(${u} \u2192 ${c}) found no path${f.reason?`: ${f.reason}`:""}`}):n.push({kind:"explain",ok:!0,from:u,to:c,found:f.found,steps:f.steps.length})}catch(f){n.push({kind:"explain",ok:!1,from:u,to:c,reason:f instanceof Error?f.message:String(f)})}let s=n.filter(u=>!u.ok),o=s.length===0,i=e.paths?.length??0,a=e.pairs?.length??0,l=e.formats?.length??0;return{ok:o,checks:n,failures:s,summary(){let u=[e.skipDescribe===!0?null:"describe",l>0?`${l} format${l===1?"":"s"}`:null,i>0?`${i} observe path${i===1?"":"s"}`:null,a>0?`${a} explain pair${a===1?"":"s"}`:null].filter(f=>f!=null),c=u.length>0?u.join(", "):"describe-only";return o?`validateGraphObservability: OK (${c})`:`validateGraphObservability: ${s.length} failure(s) across ${c}`}}}0&&(module.exports={ENVELOPE_VERSION,GRAPH_META_SEGMENT,Graph,JsonCodec,SIZEOF_OVERHEAD,SIZEOF_SYMBOL,SNAPSHOT_VERSION,createDagCborCodec,createDagCborZstdCodec,decodeEnvelope,diffForWAL,encodeEnvelope,explainPath,graphProfile,mermaidLiveUrl,reachable,registerBuiltinCodecs,replayWAL,sizeof,validateGraphObservability,watchTopologyTree});
|
package/dist/graph/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { E as ENVELOPE_VERSION, a as EvictedSubgraphInfo, b as EvictionPolicy, G as GraphCodec, J as JsonCodec, L as LazyGraphCodec, O as ObservabilityCheck, c as ObservabilityDescribeFormat, d as SIZEOF_OVERHEAD, S as SIZEOF_SYMBOL, V as ValidateObservabilityOptions, e as ValidateObservabilityResult, W as WALEntry, f as createDagCborCodec, g as createDagCborZstdCodec, h as decodeEnvelope, i as encodeEnvelope, r as registerBuiltinCodecs, k as replayWAL, s as sizeof, v as validateGraphObservability } from '../index-
|
|
2
|
-
export { C as CausalChain, e as CausalStep, D as DescribeFilter, E as ExplainPathOptions, f as GRAPH_META_SEGMENT, G as Graph, g as GraphActorOptions, h as GraphAttachStorageOptions, i as GraphCheckpointRecord, b as GraphDescribeOptions, c as GraphDescribeOutput, j as GraphDiagramDirection, k as GraphDiagramOptions, l as GraphDiffChange, m as GraphDiffResult, n as GraphFactoryContext, o as GraphNodeFactory, p as GraphObserveAll, q as GraphObserveOne, a as GraphOptions, d as GraphPersistSnapshot, r as GraphProfileOptions, s as GraphProfileResult, t as GraphVersionChange, u as GraphWALDiff, N as NodeProfile, O as ObserveDetail, v as ObserveEvent, w as ObserveOptions, x as ObserveResult, y as ObserveTheme, z as ObserveThemeName, R as ReachableDirection, A as ReachableOptions, S as SNAPSHOT_VERSION, T as TopologyEvent, B as TraceEntry, F as diffForWAL, H as explainPath, I as graphProfile, J as mermaidLiveUrl, K as reachable } from '../graph-
|
|
3
|
-
export { w as watchTopologyTree } from '../topology-tree-
|
|
1
|
+
export { E as ENVELOPE_VERSION, a as EvictedSubgraphInfo, b as EvictionPolicy, G as GraphCodec, J as JsonCodec, L as LazyGraphCodec, O as ObservabilityCheck, c as ObservabilityDescribeFormat, d as SIZEOF_OVERHEAD, S as SIZEOF_SYMBOL, V as ValidateObservabilityOptions, e as ValidateObservabilityResult, W as WALEntry, f as createDagCborCodec, g as createDagCborZstdCodec, h as decodeEnvelope, i as encodeEnvelope, r as registerBuiltinCodecs, k as replayWAL, s as sizeof, v as validateGraphObservability } from '../index-DSawGt8n.cjs';
|
|
2
|
+
export { C as CausalChain, e as CausalStep, D as DescribeFilter, E as ExplainPathOptions, f as GRAPH_META_SEGMENT, G as Graph, g as GraphActorOptions, h as GraphAttachStorageOptions, i as GraphCheckpointRecord, b as GraphDescribeOptions, c as GraphDescribeOutput, j as GraphDiagramDirection, k as GraphDiagramOptions, l as GraphDiffChange, m as GraphDiffResult, n as GraphFactoryContext, o as GraphNodeFactory, p as GraphObserveAll, q as GraphObserveOne, a as GraphOptions, d as GraphPersistSnapshot, r as GraphProfileOptions, s as GraphProfileResult, t as GraphVersionChange, u as GraphWALDiff, N as NodeProfile, O as ObserveDetail, v as ObserveEvent, w as ObserveOptions, x as ObserveResult, y as ObserveTheme, z as ObserveThemeName, R as ReachableDirection, A as ReachableOptions, S as SNAPSHOT_VERSION, T as TopologyEvent, B as TraceEntry, F as diffForWAL, H as explainPath, I as graphProfile, J as mermaidLiveUrl, K as reachable } from '../graph-CdJeX7O7.cjs';
|
|
3
|
+
export { w as watchTopologyTree } from '../topology-tree-CpSjvIXp.cjs';
|
|
4
4
|
import '../node-BVV7G1bq.cjs';
|
|
5
5
|
import '../meta-COtmHLwT.cjs';
|
|
6
6
|
import '../extra/storage-core.cjs';
|
package/dist/graph/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { E as ENVELOPE_VERSION, a as EvictedSubgraphInfo, b as EvictionPolicy, G as GraphCodec, J as JsonCodec, L as LazyGraphCodec, O as ObservabilityCheck, c as ObservabilityDescribeFormat, d as SIZEOF_OVERHEAD, S as SIZEOF_SYMBOL, V as ValidateObservabilityOptions, e as ValidateObservabilityResult, W as WALEntry, f as createDagCborCodec, g as createDagCborZstdCodec, h as decodeEnvelope, i as encodeEnvelope, r as registerBuiltinCodecs, k as replayWAL, s as sizeof, v as validateGraphObservability } from '../index-
|
|
2
|
-
export { C as CausalChain, e as CausalStep, D as DescribeFilter, E as ExplainPathOptions, f as GRAPH_META_SEGMENT, G as Graph, g as GraphActorOptions, h as GraphAttachStorageOptions, i as GraphCheckpointRecord, b as GraphDescribeOptions, c as GraphDescribeOutput, j as GraphDiagramDirection, k as GraphDiagramOptions, l as GraphDiffChange, m as GraphDiffResult, n as GraphFactoryContext, o as GraphNodeFactory, p as GraphObserveAll, q as GraphObserveOne, a as GraphOptions, d as GraphPersistSnapshot, r as GraphProfileOptions, s as GraphProfileResult, t as GraphVersionChange, u as GraphWALDiff, N as NodeProfile, O as ObserveDetail, v as ObserveEvent, w as ObserveOptions, x as ObserveResult, y as ObserveTheme, z as ObserveThemeName, R as ReachableDirection, A as ReachableOptions, S as SNAPSHOT_VERSION, T as TopologyEvent, B as TraceEntry, F as diffForWAL, H as explainPath, I as graphProfile, J as mermaidLiveUrl, K as reachable } from '../graph-
|
|
3
|
-
export { w as watchTopologyTree } from '../topology-tree-
|
|
1
|
+
export { E as ENVELOPE_VERSION, a as EvictedSubgraphInfo, b as EvictionPolicy, G as GraphCodec, J as JsonCodec, L as LazyGraphCodec, O as ObservabilityCheck, c as ObservabilityDescribeFormat, d as SIZEOF_OVERHEAD, S as SIZEOF_SYMBOL, V as ValidateObservabilityOptions, e as ValidateObservabilityResult, W as WALEntry, f as createDagCborCodec, g as createDagCborZstdCodec, h as decodeEnvelope, i as encodeEnvelope, r as registerBuiltinCodecs, k as replayWAL, s as sizeof, v as validateGraphObservability } from '../index-CVevMZ0n.js';
|
|
2
|
+
export { C as CausalChain, e as CausalStep, D as DescribeFilter, E as ExplainPathOptions, f as GRAPH_META_SEGMENT, G as Graph, g as GraphActorOptions, h as GraphAttachStorageOptions, i as GraphCheckpointRecord, b as GraphDescribeOptions, c as GraphDescribeOutput, j as GraphDiagramDirection, k as GraphDiagramOptions, l as GraphDiffChange, m as GraphDiffResult, n as GraphFactoryContext, o as GraphNodeFactory, p as GraphObserveAll, q as GraphObserveOne, a as GraphOptions, d as GraphPersistSnapshot, r as GraphProfileOptions, s as GraphProfileResult, t as GraphVersionChange, u as GraphWALDiff, N as NodeProfile, O as ObserveDetail, v as ObserveEvent, w as ObserveOptions, x as ObserveResult, y as ObserveTheme, z as ObserveThemeName, R as ReachableDirection, A as ReachableOptions, S as SNAPSHOT_VERSION, T as TopologyEvent, B as TraceEntry, F as diffForWAL, H as explainPath, I as graphProfile, J as mermaidLiveUrl, K as reachable } from '../graph-BOhEGJ6E.js';
|
|
3
|
+
export { w as watchTopologyTree } from '../topology-tree-DAbCV2Yw.js';
|
|
4
4
|
import '../node-BVV7G1bq.js';
|
|
5
5
|
import '../meta-BMwx3ExI.js';
|
|
6
6
|
import '../extra/storage-core.js';
|
package/dist/graph/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t,b as u}from"../chunk-
|
|
1
|
+
import{a as t,b as u}from"../chunk-MFNOZ5E6.js";import{b as i,c as j,d as k,e as l,f as m,g as n,h as o,i as p,j as q,k as r,l as s}from"../chunk-4JBKKUCJ.js";import"../chunk-SGS4OJGS.js";import"../chunk-ESMPEKEV.js";import"../chunk-N2KKISCE.js";import"../chunk-UMH3HSP7.js";import{a,b,c,d,e,f,g,h}from"../chunk-7AJKUA36.js";import"../chunk-CK2E7BTU.js";import"../chunk-QYADASLV.js";export{d as ENVELOPE_VERSION,n as GRAPH_META_SEGMENT,q as Graph,a as JsonCodec,j as SIZEOF_OVERHEAD,k as SIZEOF_SYMBOL,o as SNAPSHOT_VERSION,b as createDagCborCodec,c as createDagCborZstdCodec,f as decodeEnvelope,r as diffForWAL,e as encodeEnvelope,i as explainPath,m as graphProfile,p as mermaidLiveUrl,s as reachable,g as registerBuiltinCodecs,h as replayWAL,l as sizeof,u as validateGraphObservability,t as watchTopologyTree};
|
|
@@ -707,6 +707,8 @@ declare class Graph {
|
|
|
707
707
|
_parent: Graph | undefined;
|
|
708
708
|
private readonly _storageDisposers;
|
|
709
709
|
private readonly _disposers;
|
|
710
|
+
/** @internal Set in {@link destroy} / `_destroyClearOnly`; surfaced via {@link destroyed}. */
|
|
711
|
+
private _destroyed;
|
|
710
712
|
/**
|
|
711
713
|
* @internal Lazy `TopologyEvent` producer. Created on first `.topology`
|
|
712
714
|
* access. Zero cost until something subscribes — producer fn only runs when
|
|
@@ -1103,6 +1105,14 @@ declare class Graph {
|
|
|
1103
1105
|
* The instance is left empty and may be reused with {@link Graph.add}.
|
|
1104
1106
|
*/
|
|
1105
1107
|
destroy(): void;
|
|
1108
|
+
/**
|
|
1109
|
+
* `true` once {@link destroy} has run on this graph. Useful for reactive
|
|
1110
|
+
* consumers that hold a Graph reference and want to fail fast / skip
|
|
1111
|
+
* work if the graph went away mid-flight (e.g. a `switchMap` over a
|
|
1112
|
+
* destroyable graph reference). Set after the destroy cascade completes;
|
|
1113
|
+
* stays `true` even if the instance is later reused via {@link add}.
|
|
1114
|
+
*/
|
|
1115
|
+
get destroyed(): boolean;
|
|
1106
1116
|
/** Clear structure after parent already signaled TEARDOWN through this subtree. */
|
|
1107
1117
|
private _destroyClearOnly;
|
|
1108
1118
|
/**
|
|
@@ -707,6 +707,8 @@ declare class Graph {
|
|
|
707
707
|
_parent: Graph | undefined;
|
|
708
708
|
private readonly _storageDisposers;
|
|
709
709
|
private readonly _disposers;
|
|
710
|
+
/** @internal Set in {@link destroy} / `_destroyClearOnly`; surfaced via {@link destroyed}. */
|
|
711
|
+
private _destroyed;
|
|
710
712
|
/**
|
|
711
713
|
* @internal Lazy `TopologyEvent` producer. Created on first `.topology`
|
|
712
714
|
* access. Zero cost until something subscribes — producer fn only runs when
|
|
@@ -1103,6 +1105,14 @@ declare class Graph {
|
|
|
1103
1105
|
* The instance is left empty and may be reused with {@link Graph.add}.
|
|
1104
1106
|
*/
|
|
1105
1107
|
destroy(): void;
|
|
1108
|
+
/**
|
|
1109
|
+
* `true` once {@link destroy} has run on this graph. Useful for reactive
|
|
1110
|
+
* consumers that hold a Graph reference and want to fail fast / skip
|
|
1111
|
+
* work if the graph went away mid-flight (e.g. a `switchMap` over a
|
|
1112
|
+
* destroyable graph reference). Set after the destroy cascade completes;
|
|
1113
|
+
* stays `true` even if the instance is later reused via {@link add}.
|
|
1114
|
+
*/
|
|
1115
|
+
get destroyed(): boolean;
|
|
1106
1116
|
/** Clear structure after parent already signaled TEARDOWN through this subtree. */
|
|
1107
1117
|
private _destroyClearOnly;
|
|
1108
1118
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { A as Actor, a as Node, P as PolicyRuleData, G as GuardAction } from './node-BVV7G1bq.cjs';
|
|
2
|
-
import { G as Graph, a as GraphOptions, d as GraphPersistSnapshot, C as CausalChain } from './graph-
|
|
3
|
-
import { T as TopicGraph } from './index-
|
|
2
|
+
import { G as Graph, a as GraphOptions, d as GraphPersistSnapshot, C as CausalChain } from './graph-CdJeX7O7.cjs';
|
|
3
|
+
import { T as TopicGraph } from './index-BDLy6CQ9.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Audit, policy enforcement, and compliance export (roadmap §9.2).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { A as Actor, a as Node, P as PolicyRuleData, G as GuardAction } from './node-BVV7G1bq.js';
|
|
2
|
-
import { G as Graph, a as GraphOptions, d as GraphPersistSnapshot, C as CausalChain } from './graph-
|
|
3
|
-
import { T as TopicGraph } from './index-
|
|
2
|
+
import { G as Graph, a as GraphOptions, d as GraphPersistSnapshot, C as CausalChain } from './graph-BOhEGJ6E.js';
|
|
3
|
+
import { T as TopicGraph } from './index-Dbmj0iYR.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Audit, policy enforcement, and compliance export (roadmap §9.2).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as Node } from './node-BVV7G1bq.cjs';
|
|
2
2
|
import { R as ReactiveMapBundle } from './reactive-map-IJIfZxoh.cjs';
|
|
3
|
-
import { a as GraphOptions, G as Graph, C as CausalChain } from './graph-
|
|
4
|
-
import { w as watchTopologyTree } from './topology-tree-
|
|
3
|
+
import { a as GraphOptions, G as Graph, C as CausalChain } from './graph-CdJeX7O7.cjs';
|
|
4
|
+
import { w as watchTopologyTree } from './topology-tree-CpSjvIXp.cjs';
|
|
5
5
|
|
|
6
6
|
/** Aggregate topology stats emitted by {@link LensGraph.stats}. */
|
|
7
7
|
interface TopologyStats {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as Node } from './node-BVV7G1bq.js';
|
|
2
2
|
import { S as StatusValue, C as CircuitState, R as RateLimiterOptions, a as CircuitBreakerOptions, b as RetryOptions, F as FallbackInput, N as NS_PER_MS, c as NS_PER_SEC } from './resilience-CludlzcP.js';
|
|
3
|
-
import { B as BudgetConstraint } from './index-
|
|
3
|
+
import { B as BudgetConstraint } from './index-Dp_pS7Bw.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Resilience composition with correct nesting order (roadmap §9.0b).
|