@graphrefly/graphrefly 0.24.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/README.md +8 -0
  2. package/dist/{chunk-QOWVNWOC.js → chunk-3ZWCKRHX.js} +27 -25
  3. package/dist/{chunk-QOWVNWOC.js.map → chunk-3ZWCKRHX.js.map} +1 -1
  4. package/dist/chunk-6LDQFTYS.js +102 -0
  5. package/dist/chunk-6LDQFTYS.js.map +1 -0
  6. package/dist/{chunk-5WGT55R4.js → chunk-AMCG74RZ.js} +195 -24
  7. package/dist/chunk-AMCG74RZ.js.map +1 -0
  8. package/dist/{chunk-AOCBDH4T.js → chunk-BVZYTZ5H.js} +76 -103
  9. package/dist/chunk-BVZYTZ5H.js.map +1 -0
  10. package/dist/chunk-FQMKGR6L.js +330 -0
  11. package/dist/chunk-FQMKGR6L.js.map +1 -0
  12. package/dist/chunk-HXZEYDUR.js +94 -0
  13. package/dist/chunk-HXZEYDUR.js.map +1 -0
  14. package/dist/{chunk-IPLKX3L2.js → chunk-IZYUSJC7.js} +16 -14
  15. package/dist/{chunk-IPLKX3L2.js.map → chunk-IZYUSJC7.js.map} +1 -1
  16. package/dist/chunk-J22W6HV3.js +107 -0
  17. package/dist/chunk-J22W6HV3.js.map +1 -0
  18. package/dist/{chunk-HWPIFSW2.js → chunk-JSCT3CR4.js} +6 -4
  19. package/dist/{chunk-HWPIFSW2.js.map → chunk-JSCT3CR4.js.map} +1 -1
  20. package/dist/chunk-JYXEWPH4.js +62 -0
  21. package/dist/chunk-JYXEWPH4.js.map +1 -0
  22. package/dist/chunk-LCE3GF5P.js +866 -0
  23. package/dist/chunk-LCE3GF5P.js.map +1 -0
  24. package/dist/chunk-MJ2NKQQL.js +119 -0
  25. package/dist/chunk-MJ2NKQQL.js.map +1 -0
  26. package/dist/chunk-N6UR7YVY.js +198 -0
  27. package/dist/chunk-N6UR7YVY.js.map +1 -0
  28. package/dist/chunk-OHISZPOJ.js +97 -0
  29. package/dist/chunk-OHISZPOJ.js.map +1 -0
  30. package/dist/{chunk-5DJTTKX3.js → chunk-PHOUUNK7.js} +74 -111
  31. package/dist/chunk-PHOUUNK7.js.map +1 -0
  32. package/dist/{chunk-PY4XCDLR.js → chunk-RB6QPHJ7.js} +8 -6
  33. package/dist/{chunk-PY4XCDLR.js.map → chunk-RB6QPHJ7.js.map} +1 -1
  34. package/dist/chunk-SN4YWWYO.js +171 -0
  35. package/dist/chunk-SN4YWWYO.js.map +1 -0
  36. package/dist/chunk-SX52TAR4.js +110 -0
  37. package/dist/chunk-SX52TAR4.js.map +1 -0
  38. package/dist/{chunk-XOFWRC73.js → chunk-THTWHNU4.js} +319 -24
  39. package/dist/chunk-THTWHNU4.js.map +1 -0
  40. package/dist/{chunk-H4RVA4VE.js → chunk-VYPWMZ6H.js} +2 -2
  41. package/dist/chunk-XGPU467M.js +136 -0
  42. package/dist/chunk-XGPU467M.js.map +1 -0
  43. package/dist/{chunk-TDEXAMGO.js → chunk-ZQMEI34O.js} +206 -574
  44. package/dist/chunk-ZQMEI34O.js.map +1 -0
  45. package/dist/compat/index.cjs +7656 -0
  46. package/dist/compat/index.cjs.map +1 -0
  47. package/dist/compat/index.d.cts +18 -0
  48. package/dist/compat/index.d.ts +18 -0
  49. package/dist/compat/index.js +49 -0
  50. package/dist/compat/index.js.map +1 -0
  51. package/dist/compat/jotai/index.cjs +2048 -0
  52. package/dist/compat/jotai/index.cjs.map +1 -0
  53. package/dist/compat/jotai/index.d.cts +2 -0
  54. package/dist/compat/jotai/index.d.ts +2 -0
  55. package/dist/compat/jotai/index.js +9 -0
  56. package/dist/compat/jotai/index.js.map +1 -0
  57. package/dist/compat/nanostores/index.cjs +2175 -0
  58. package/dist/compat/nanostores/index.cjs.map +1 -0
  59. package/dist/compat/nanostores/index.d.cts +2 -0
  60. package/dist/compat/nanostores/index.d.ts +2 -0
  61. package/dist/compat/nanostores/index.js +23 -0
  62. package/dist/compat/nanostores/index.js.map +1 -0
  63. package/dist/compat/nestjs/index.cjs +350 -16
  64. package/dist/compat/nestjs/index.cjs.map +1 -1
  65. package/dist/compat/nestjs/index.d.cts +6 -6
  66. package/dist/compat/nestjs/index.d.ts +6 -6
  67. package/dist/compat/nestjs/index.js +10 -9
  68. package/dist/compat/react/index.cjs +141 -0
  69. package/dist/compat/react/index.cjs.map +1 -0
  70. package/dist/compat/react/index.d.cts +2 -0
  71. package/dist/compat/react/index.d.ts +2 -0
  72. package/dist/compat/react/index.js +12 -0
  73. package/dist/compat/react/index.js.map +1 -0
  74. package/dist/compat/solid/index.cjs +128 -0
  75. package/dist/compat/solid/index.cjs.map +1 -0
  76. package/dist/compat/solid/index.d.cts +2 -0
  77. package/dist/compat/solid/index.d.ts +2 -0
  78. package/dist/compat/solid/index.js +12 -0
  79. package/dist/compat/solid/index.js.map +1 -0
  80. package/dist/compat/svelte/index.cjs +131 -0
  81. package/dist/compat/svelte/index.cjs.map +1 -0
  82. package/dist/compat/svelte/index.d.cts +2 -0
  83. package/dist/compat/svelte/index.d.ts +2 -0
  84. package/dist/compat/svelte/index.js +12 -0
  85. package/dist/compat/svelte/index.js.map +1 -0
  86. package/dist/compat/vue/index.cjs +146 -0
  87. package/dist/compat/vue/index.cjs.map +1 -0
  88. package/dist/compat/vue/index.d.cts +3 -0
  89. package/dist/compat/vue/index.d.ts +3 -0
  90. package/dist/compat/vue/index.js +12 -0
  91. package/dist/compat/vue/index.js.map +1 -0
  92. package/dist/compat/zustand/index.cjs +4931 -0
  93. package/dist/compat/zustand/index.cjs.map +1 -0
  94. package/dist/compat/zustand/index.d.cts +5 -0
  95. package/dist/compat/zustand/index.d.ts +5 -0
  96. package/dist/compat/zustand/index.js +12 -0
  97. package/dist/compat/zustand/index.js.map +1 -0
  98. package/dist/core/index.cjs +53 -4
  99. package/dist/core/index.cjs.map +1 -1
  100. package/dist/core/index.d.cts +3 -3
  101. package/dist/core/index.d.ts +3 -3
  102. package/dist/core/index.js +26 -24
  103. package/dist/demo-shell-26p5fVxn.d.cts +102 -0
  104. package/dist/demo-shell-DEp-nMTl.d.ts +102 -0
  105. package/dist/extra/index.cjs +290 -110
  106. package/dist/extra/index.cjs.map +1 -1
  107. package/dist/extra/index.d.cts +5 -4
  108. package/dist/extra/index.d.ts +5 -4
  109. package/dist/extra/index.js +8 -5
  110. package/dist/extra/sources.cjs +2486 -0
  111. package/dist/extra/sources.cjs.map +1 -0
  112. package/dist/extra/sources.d.cts +465 -0
  113. package/dist/extra/sources.d.ts +465 -0
  114. package/dist/extra/sources.js +57 -0
  115. package/dist/extra/sources.js.map +1 -0
  116. package/dist/graph/index.cjs +408 -14
  117. package/dist/graph/index.cjs.map +1 -1
  118. package/dist/graph/index.d.cts +5 -5
  119. package/dist/graph/index.d.ts +5 -5
  120. package/dist/graph/index.js +13 -5
  121. package/dist/{graph-D-3JIQme.d.cts → graph-6tZ5jEzr.d.cts} +195 -4
  122. package/dist/{graph-B6NFqv3z.d.ts → graph-DQ69XU0g.d.ts} +195 -4
  123. package/dist/index-B4MP_8V_.d.cts +37 -0
  124. package/dist/index-BEfE8H_G.d.cts +121 -0
  125. package/dist/{index-D7XgsUt7.d.ts → index-BW1z3BN9.d.ts} +169 -127
  126. package/dist/index-BYOHF0zP.d.ts +34 -0
  127. package/dist/index-B_IP40nB.d.cts +36 -0
  128. package/dist/index-Bd_fwmLf.d.cts +45 -0
  129. package/dist/{index-BysCTzJz.d.ts → index-BeIdBfcb.d.cts} +121 -547
  130. package/dist/index-BjI6ty9z.d.ts +121 -0
  131. package/dist/index-Bxb5ZYc9.d.cts +34 -0
  132. package/dist/{index-BJB7t9gg.d.cts → index-C0ZXMaXO.d.cts} +2 -2
  133. package/dist/{index-b5BYtczN.d.cts → index-C8mdwMXc.d.cts} +169 -127
  134. package/dist/index-CDAjUFIv.d.ts +36 -0
  135. package/dist/index-CPgZ5wRl.d.ts +44 -0
  136. package/dist/{index-AMWewNDe.d.cts → index-CUwyr1Kk.d.cts} +33 -4
  137. package/dist/index-CUyrtuOf.d.cts +127 -0
  138. package/dist/{index-C-TXEa7C.d.ts → index-CY2TljO4.d.ts} +2 -2
  139. package/dist/index-CmnuOibw.d.ts +37 -0
  140. package/dist/{index-DiobMNwE.d.ts → index-CuYwdKO-.d.ts} +3 -3
  141. package/dist/index-DFhjO4Gg.d.cts +44 -0
  142. package/dist/{index-1z8vRTCt.d.cts → index-DdD5MVDL.d.ts} +121 -547
  143. package/dist/index-DrISNAOm.d.ts +45 -0
  144. package/dist/index-QBpffFW-.d.cts +86 -0
  145. package/dist/{index-J7Kc0oIQ.d.cts → index-_oMEWlDq.d.cts} +3 -3
  146. package/dist/{index-CYkjxu3s.d.ts → index-eJ6T_qGM.d.ts} +33 -4
  147. package/dist/index-qldRdbQw.d.ts +86 -0
  148. package/dist/index-xdGjv0nO.d.ts +127 -0
  149. package/dist/index.cjs +2334 -195
  150. package/dist/index.cjs.map +1 -1
  151. package/dist/index.d.cts +1007 -648
  152. package/dist/index.d.ts +1007 -648
  153. package/dist/index.js +1204 -1172
  154. package/dist/index.js.map +1 -1
  155. package/dist/{meta-CnkLA_43.d.ts → meta-BGqSZ7mt.d.ts} +1 -1
  156. package/dist/{meta-DWbkoq1s.d.cts → meta-C0-8XW6Q.d.cts} +1 -1
  157. package/dist/{node-B-f-Lu-k.d.cts → node-C_IBuvX2.d.cts} +26 -1
  158. package/dist/{node-B-f-Lu-k.d.ts → node-C_IBuvX2.d.ts} +26 -1
  159. package/dist/{observable-DBnrwcar.d.cts → observable-Crr1jgzx.d.cts} +1 -1
  160. package/dist/{observable-uP-wy_uK.d.ts → observable-DCk45RH5.d.ts} +1 -1
  161. package/dist/patterns/demo-shell.cjs +5604 -0
  162. package/dist/patterns/demo-shell.cjs.map +1 -0
  163. package/dist/patterns/demo-shell.d.cts +6 -0
  164. package/dist/patterns/demo-shell.d.ts +6 -0
  165. package/dist/patterns/demo-shell.js +15 -0
  166. package/dist/patterns/demo-shell.js.map +1 -0
  167. package/dist/patterns/reactive-layout/index.cjs +843 -29
  168. package/dist/patterns/reactive-layout/index.cjs.map +1 -1
  169. package/dist/patterns/reactive-layout/index.d.cts +6 -5
  170. package/dist/patterns/reactive-layout/index.d.ts +6 -5
  171. package/dist/patterns/reactive-layout/index.js +25 -10
  172. package/dist/reactive-layout-BaOQefHu.d.cts +183 -0
  173. package/dist/reactive-layout-D9gejYXE.d.ts +183 -0
  174. package/dist/{storage-BuTdpCI1.d.cts → storage-BMycWEh2.d.ts} +9 -1
  175. package/dist/{storage-F2X1U1x0.d.ts → storage-DiqWHzVI.d.cts} +9 -1
  176. package/package.json +32 -2
  177. package/dist/chunk-5DJTTKX3.js.map +0 -1
  178. package/dist/chunk-5WGT55R4.js.map +0 -1
  179. package/dist/chunk-AOCBDH4T.js.map +0 -1
  180. package/dist/chunk-MW4VAKAO.js +0 -47
  181. package/dist/chunk-MW4VAKAO.js.map +0 -1
  182. package/dist/chunk-TDEXAMGO.js.map +0 -1
  183. package/dist/chunk-XOFWRC73.js.map +0 -1
  184. /package/dist/{chunk-H4RVA4VE.js.map → chunk-VYPWMZ6H.js.map} +0 -0
package/dist/index.d.cts CHANGED
@@ -1,506 +1,36 @@
1
- import { N as Node, a as NodeOptions, b as NodeActions, A as Actor } from './node-B-f-Lu-k.cjs';
2
- export { C as COMPLETE, c as COMPLETE_MSG, d as COMPLETE_ONLY_BATCH, D as DATA, e as DEFAULT_ACTOR, f as DIRTY, g as DIRTY_MSG, h as DIRTY_ONLY_BATCH, i as DepRecord, E as ERROR, F as FnCtx, G as GlobalInspectorEvent, j as GlobalInspectorHook, k as GraphReFlyConfig, l as GuardAction, m as GuardDenied, n as GuardDeniedDetails, H as HashFn, I as INVALIDATE, o as INVALIDATE_MSG, p as INVALIDATE_ONLY_BATCH, M as Message, q as MessageContext, r as MessageTypeRegistration, s as MessageTypeRegistrationInput, t as Messages, u as NodeCtx, v as NodeDescribeKind, w as NodeFn, x as NodeFnCleanup, y as NodeGuard, z as NodeImpl, B as NodeInspectorHook, J as NodeInspectorHookEvent, K as NodeSink, L as NodeStatus, O as NodeTransportOptions, P as NodeVersionInfo, Q as OnMessageHandler, R as OnSubscribeHandler, S as PAUSE, T as PolicyAllow, U as PolicyDeny, V as PolicyRuleData, W as RESOLVED, X as RESOLVED_MSG, Y as RESOLVED_ONLY_BATCH, Z as RESUME, _ as START, $ as START_MSG, a0 as SubscribeContext, a1 as TEARDOWN, a2 as TEARDOWN_MSG, a3 as TEARDOWN_ONLY_BATCH, a4 as V0, a5 as V1, a6 as VersioningLevel, a7 as VersioningOptions, a8 as accessHintForGuard, a9 as advanceVersion, aa as configure, ab as createVersioning, ac as defaultConfig, ad as defaultHash, ae as isV1, af as node, ag as normalizeActor, ah as policy, ai as policyFromRules, aj as registerBuiltins } from './node-B-f-Lu-k.cjs';
3
- import { i as index$b, c as cqrs } from './index-J7Kc0oIQ.cjs';
4
- import { Ref, WatchSource } from 'vue';
5
- import { G as Graph, a as GraphOptions, b as GraphAttachStorageOptions, c as GraphProfileResult, d as GraphProfileOptions } from './graph-D-3JIQme.cjs';
6
- export { D as DescribeFilter, e as GRAPH_META_SEGMENT, f as GraphActorOptions, g as GraphCheckpointRecord, h as GraphDescribeOptions, i 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, r as GraphPersistSnapshot, s as GraphVersionChange, t as GraphWALDiff, N as NodeProfile, O as ObserveDetail, u as ObserveEvent, v as ObserveOptions, w as ObserveResult, x as ObserveTheme, y as ObserveThemeName, R as ReachableDirection, z as ReachableOptions, T as TraceEntry, A as diffForWAL, B as graphProfile, C as reachable } from './graph-D-3JIQme.cjs';
7
- import { D as DerivedFn } from './index-BJB7t9gg.cjs';
8
- export { A as AutoTrackOptions, a as DynamicFn, E as EffectFn, P as PipeOperator, b as ProducerFn, T as TrackFn, c as autoTrackNode, d as batch, i as core, e as derived, f as downWithBatch, g as dynamicNode, h as effect, j as isBatching, m as monotonicNs, p as pipe, k as producer, s as state, w as wallClockNs } from './index-BJB7t9gg.cjs';
9
- import { N as NodeInput, D as DistillBundle, E as Extraction } from './index-1z8vRTCt.cjs';
10
- export { A as AckableMessage, a as AdapterHandlers, b as AsyncSourceOpts, B as BackoffPreset, c as BackoffStrategy, d as BatchMessage, e as BridgeMessage, f as BufferedSinkHandle, g as BundleTriad, C as CSVRow, h as CacheEvictionPolicy, i as CascadingCache, j as CascadingCacheOptions, k as CheckpointToRedisOptions, l as CheckpointToS3Options, m as CircuitBreaker, n as CircuitBreakerOptions, o as CircuitOpenError, p as CircuitState, q as ClickHouseClientLike, r as ClickHouseInsertClientLike, s as ClickHouseRow, t as CronSchedule, u as DistillOptions, v as DrizzleQueryLike, w as EmitTriad, x as ErrorMessage, y as EventTargetLike, z as ExponentialBackoffOptions, F as ExternalBundleOptions, G as ExternalRegister, H as FSEvent, I as FSEventType, J as FallbackInput, K as FileWriterLike, L as FromCSVOptions, M as FromClickHouseWatchOptions, O as FromCronOptions, P as FromDrizzleOptions, Q as FromFSWatchOptions, R as FromGitHookOptions, S as FromHTTPOptions, T as FromHTTPPollOptions, U as FromHTTPStreamOptions, V as FromKafkaOptions, W as FromKyselyOptions, X as FromMCPOptions, Y as FromNATSOptions, Z as FromNDJSONOptions, _ as FromOTelOptions, $ as FromPrismaOptions, a0 as FromPrometheusOptions, a1 as FromPulsarOptions, a2 as FromRabbitMQOptions, a3 as FromRedisStreamOptions, a4 as FromSSEOptions, a5 as FromSqliteOptions, a6 as FromStatsDOptions, a7 as FromSyslogOptions, a8 as FromWebSocketReconnectOptions, a9 as GitEvent, aa as GitHookType, ab as HTTPBundle, ac as IndexBackend, ad as IndexRow, ae as InitMessage, af as JitterMode, ag as KafkaConsumerLike, ah as KafkaMessage, ai as KafkaProducerLike, aj as KyselyQueryLike, ak as ListBackend, al as LogBackend, am as LokiClientLike, an as LokiStream, ao as MCPClientLike, ap as MapBackend, aq as MergeMapOptions, ar as MongoCollectionLike, as as NATSClientLike, at as NATSMessage, au as NATSSubscriptionLike, av as NS_PER_MS, aw as NS_PER_SEC, ax as NativeIndexBackend, ay as NativeListBackend, az as NativeLogBackend, aA as NativeMapBackend, aB as NativeMapBackendOptions, aC as NativePubSubBackend, aD as OTelBundle, aE as OTelLog, aF as OTelMetric, aG as OTelRegister, aH as OTelSpan, aI as PostgresClientLike, aJ as PrismaModelLike, aK as PrometheusMetric, aL as PubSubBackend, aM as PubSubHub, aN as PubSubHubOptions, aO as PulsarConsumerLike, aP as PulsarMessage, aQ as PulsarProducerLike, aR as RabbitMQChannelLike, aS as RabbitMQMessage, aT as RateLimiterOptions, aU as RateLimiterOverflowError, aV as RateLimiterOverflowPolicy, aW as ReactiveCounterBundle, aX as ReactiveIndexBundle, aY as ReactiveIndexOptions, aZ as ReactiveListBundle, a_ as ReactiveListOptions, a$ as ReactiveLogBundle, b0 as ReactiveLogOptions, b1 as ReactiveMapBundle, b2 as ReactiveMapOptions, b3 as ReactiveSinkBackpressureOptions, b4 as ReactiveSinkConfig, b5 as ReactiveSinkHandle, b6 as ReactiveSinkOptions, b7 as ReactiveSinkRetryOptions, b8 as ReadyMessage, b9 as RedisCheckpointClientLike, ba as RedisClientLike, bb as RedisStreamEntry, bc as ResettableTimer, bd as RetryOptions, be as RetrySourceOptions, bf as S3ClientLike, bg as SSEEvent, bh as SignalMessage, bi as SinkFailure, bj as SinkHandle, bk as SinkTransportError, bl as SqliteDbLike, bm as SqliteIterableDbLike, bn as StatsDMetric, bo as StatsDRegister, bp as StatusValue, bq as SyslogMessage, br as SyslogRegister, bs as TapObserver, bt as TempoClientLike, bu as ThrottleOptions, bv as TimeoutError, bw as ToCSVOptions, bx as ToClickHouseOptions, by as ToFileOptions, bz as ToHTTPOptions, bA as ToKafkaOptions, bB as ToLokiOptions, bC as ToMongoOptions, bD as ToNATSOptions, bE as ToPostgresOptions, bF as ToPulsarOptions, bG as ToRabbitMQOptions, bH as ToRedisStreamOptions, bI as ToS3Options, bJ as ToSSEOptions, bK as ToSqliteOptions, bL as ToTempoOptions, bM as ToWebSocketOptions, bN as TokenBucket, bO as UpsertOptions, bP as ValueMessage, bQ as VerifiableBundle, bR as VerifiableOptions, bS as VerifyValue, bT as WatermarkController, bU as WatermarkOptions, bV as WebSocketLike, bW as WebSocketMessageEventLike, bX as WebSocketRegister, bY as WebhookRegister, bZ as WithBreakerBundle, b_ as WithStatusBundle, b$ as WorkerBridge, c0 as WorkerBridgeOptions, c1 as WorkerSelfHandle, c2 as WorkerSelfOptions, c3 as WorkerTransport, c4 as audit, c5 as buffer, c6 as bufferCount, c7 as bufferTime, c8 as cached, c9 as cascadingCache, ca as catchError, cb as checkpointToRedis, cc as checkpointToS3, cd as circuitBreaker, ce as combine, cf as combineLatest, cg as concat, ch as concatMap, ci as constant, cj as createTransport, ck as createWatermarkController, cl as csvRows, cm as debounce, cn as debounceTime, co as decorrelatedJitter, cp as delay, cq as deserializeError, cr as distill, cs as distinctUntilChanged, ct as elementAt, cu as empty, cv as escapeRegexChar, cw as exhaustMap, cx as exponential, cy as externalBundle, cz as externalProducer, cA as extra, cB as fallback, cC as fibonacci, cD as filter, cE as find, cF as first, cG as firstValueFrom, cH as firstWhere, cI as flatMap, cJ as forEach, cK as fromAny, cL as fromAsyncIter, cM as fromCSV, cN as fromClickHouseWatch, cO as fromCron, cP as fromDrizzle, cQ as fromEvent, cR as fromFSWatch, cS as fromGitHook, cT as fromHTTP, cU as fromHTTPPoll, cV as fromHTTPStream, cW as fromIter, cX as fromKafka, cY as fromKysely, cZ as fromMCP, c_ as fromNATS, c$ as fromNDJSON, d0 as fromOTel, d1 as fromPrisma, d2 as fromPrometheus, d3 as fromPromise, d4 as fromPulsar, d5 as fromRabbitMQ, d6 as fromRedisStream, d7 as fromSSE, d8 as fromSqlite, d9 as fromSqliteCursor, da as fromStatsD, db as fromSyslog, dc as fromTimer, dd as fromWebSocket, de as fromWebSocketReconnect, df as fromWebhook, dg as globToRegExp, dh as interval, di as keepalive, dj as last, dk as linear, dl as lru, dm as map, dn as matchesAnyPattern, dp as matchesCron, dq as merge, dr as mergeMap, ds as nameToSignal, dt as ndjsonRows, du as never, dv as of, dw as pairwise, dx as parseCron, dy as parsePrometheusText, dz as parseStatsD, dA as parseSyslog, dB as pausable, dC as pubsub, dD as race, dE as rateLimiter, dF as reactiveCounter, dG as reactiveIndex, dH as reactiveList, dI as reactiveLog, dJ as reactiveMap, dK as reactiveSink, dL as reduce, dM as repeat, dN as replay, dO as rescue, dP as resolveBackoffPreset, dQ as retry, dR as retrySource, dS as sample, dT as scan, dU as serializeError, dV as share, dW as shareReplay, dX as signalToName, dY as skip, dZ as switchMap, d_ as take, d$ as takeUntil, e0 as takeWhile, e1 as tap, e2 as throttle, e3 as throttleTime, e4 as throwError, e5 as timeout, e6 as toArray, e7 as toCSV, e8 as toClickHouse, e9 as toFile, ea as toHTTP, eb as toKafka, ec as toLoki, ed as toMongo, ee as toNATS, ef as toPostgres, eg as toPulsar, eh as toRabbitMQ, ei as toReadableStream, ej as toRedisStream, ek as toS3, el as toSSE, em as toSSEBytes, en as toSqlite, eo as toTempo, ep as toWebSocket, eq as tokenBucket, er as valve, es as verifiable, et as window, eu as windowCount, ev as windowTime, ew as withBreaker, ex as withLatestFrom, ey as withMaxAttempts, ez as withStatus, eA as workerBridge, eB as workerSelf, eC as zip } from './index-1z8vRTCt.cjs';
11
- export { E as ENVELOPE_VERSION, a as EvictedSubgraphInfo, b as EvictionPolicy, G as GraphCodec, J as JsonCodec, L as LazyGraphCodec, O as SIZEOF_OVERHEAD, S as SIZEOF_SYMBOL, W as WALEntry, c as createDagCborCodec, d as createDagCborZstdCodec, e as decodeEnvelope, f as encodeEnvelope, i as graph, r as registerBuiltinCodecs, g as replayWAL, s as sizeof } from './index-AMWewNDe.cjs';
12
- import { S as StorageHandle, a as StorageTier } from './storage-BuTdpCI1.cjs';
13
- export { I as IndexedDbStorageSpec, d as dictStorage, f as fileStorage, b as fromIDBRequest, c as fromIDBTransaction, i as indexedDbStorage, m as memoryStorage, s as sqliteStorage } from './storage-BuTdpCI1.cjs';
14
- import { M as MeasurementAdapter, i as index$c } from './index-b5BYtczN.cjs';
15
- export { D as DescribeDetail, a as DescribeField, b as DescribeNodeOutput, r as resolveDescribeFields } from './meta-DWbkoq1s.cjs';
16
- export { T as ToObservableOptions, t as toObservable } from './observable-DBnrwcar.cjs';
1
+ export { i as compat, a as signals } from './index-BEfE8H_G.cjs';
2
+ import { D as DerivedFn } from './index-C0ZXMaXO.cjs';
3
+ export { A as AutoTrackOptions, a as DynamicFn, E as EffectFn, P as PipeOperator, b as ProducerFn, T as TrackFn, c as autoTrackNode, d as batch, i as core, e as derived, f as downWithBatch, g as dynamicNode, h as effect, j as isBatching, m as monotonicNs, p as pipe, k as producer, s as state, w as wallClockNs } from './index-C0ZXMaXO.cjs';
4
+ import { D as DistillBundle, E as Extraction, R as ReactiveMapBundle, S as StatusValue, C as CircuitState, a as RateLimiterOptions, b as CircuitBreakerOptions, c as RetryOptions, F as FallbackInput, N as NS_PER_MS, d as NS_PER_SEC } from './index-BeIdBfcb.cjs';
5
+ export { A as AckableMessage, e as AdapterHandlers, B as BackoffPreset, f as BackoffStrategy, g as BatchMessage, h as BridgeMessage, i as BufferedSinkHandle, j as BundleTriad, k as CSVRow, l as CacheEvictionPolicy, m as CascadingCache, n as CascadingCacheOptions, o as CheckpointToRedisOptions, p as CheckpointToS3Options, q as CircuitBreaker, r as CircuitOpenError, s as ClickHouseClientLike, t as ClickHouseInsertClientLike, u as ClickHouseRow, v as CronSchedule, w as DistillOptions, x as DrizzleQueryLike, y as EmitTriad, z as ErrorMessage, G as ExponentialBackoffOptions, H as ExternalBundleOptions, I as ExternalRegister, J as FSEvent, K as FSEventType, L as FileWriterLike, M as FromCSVOptions, O as FromClickHouseWatchOptions, P as FromDrizzleOptions, Q as FromFSWatchOptions, T as FromGitHookOptions, U as FromHTTPOptions, V as FromHTTPPollOptions, W as FromHTTPStreamOptions, X as FromKafkaOptions, Y as FromKyselyOptions, Z as FromMCPOptions, _ as FromNATSOptions, $ as FromNDJSONOptions, a0 as FromOTelOptions, a1 as FromPrismaOptions, a2 as FromPrometheusOptions, a3 as FromPulsarOptions, a4 as FromRabbitMQOptions, a5 as FromRedisStreamOptions, a6 as FromSSEOptions, a7 as FromSqliteOptions, a8 as FromStatsDOptions, a9 as FromSyslogOptions, aa as FromWebSocketReconnectOptions, ab as GitEvent, ac as GitHookType, ad as HTTPBundle, ae as IndexBackend, af as IndexRow, ag as InitMessage, ah as JitterMode, ai as KafkaConsumerLike, aj as KafkaMessage, ak as KafkaProducerLike, al as KyselyQueryLike, am as ListBackend, an as LogBackend, ao as LokiClientLike, ap as LokiStream, aq as MCPClientLike, ar as MapBackend, as as MergeMapOptions, at as MongoCollectionLike, au as NATSClientLike, av as NATSMessage, aw as NATSSubscriptionLike, ax as NativeIndexBackend, ay as NativeListBackend, az as NativeLogBackend, aA as NativeMapBackend, aB as NativeMapBackendOptions, aC as NativePubSubBackend, aD as OTelBundle, aE as OTelLog, aF as OTelMetric, aG as OTelRegister, aH as OTelSpan, aI as PostgresClientLike, aJ as PrismaModelLike, aK as PrometheusMetric, aL as PubSubBackend, aM as PubSubHub, aN as PubSubHubOptions, aO as PulsarConsumerLike, aP as PulsarMessage, aQ as PulsarProducerLike, aR as RabbitMQChannelLike, aS as RabbitMQMessage, aT as RateLimiterOverflowError, aU as RateLimiterOverflowPolicy, aV as ReactiveIndexBundle, aW as ReactiveIndexOptions, aX as ReactiveListBundle, aY as ReactiveListOptions, aZ as ReactiveLogBundle, a_ as ReactiveLogOptions, a$ as ReactiveMapOptions, b0 as ReactiveSinkBackpressureOptions, b1 as ReactiveSinkConfig, b2 as ReactiveSinkHandle, b3 as ReactiveSinkOptions, b4 as ReactiveSinkRetryOptions, b5 as ReadyMessage, b6 as RedisCheckpointClientLike, b7 as RedisClientLike, b8 as RedisStreamEntry, b9 as ResettableTimer, ba as RetrySourceOptions, bb as S3ClientLike, bc as SSEEvent, bd as SignalMessage, be as SinkFailure, bf as SinkHandle, bg as SinkTransportError, bh as SqliteDbLike, bi as SqliteIterableDbLike, bj as StatsDMetric, bk as StatsDRegister, bl as SyslogMessage, bm as SyslogRegister, bn as TapObserver, bo as TempoClientLike, bp as ThrottleOptions, bq as TimeoutError, br as ToCSVOptions, bs as ToClickHouseOptions, bt as ToFileOptions, bu as ToHTTPOptions, bv as ToKafkaOptions, bw as ToLokiOptions, bx as ToMongoOptions, by as ToNATSOptions, bz as ToPostgresOptions, bA as ToPulsarOptions, bB as ToRabbitMQOptions, bC as ToRedisStreamOptions, bD as ToS3Options, bE as ToSSEOptions, bF as ToSqliteOptions, bG as ToTempoOptions, bH as ToWebSocketOptions, bI as TokenBucket, bJ as UpsertOptions, bK as ValueMessage, bL as VerifiableBundle, bM as VerifiableOptions, bN as VerifyValue, bO as WatermarkController, bP as WatermarkOptions, bQ as WebSocketLike, bR as WebSocketMessageEventLike, bS as WebSocketRegister, bT as WebhookRegister, bU as WithBreakerBundle, bV as WithStatusBundle, bW as WorkerBridge, bX as WorkerBridgeOptions, bY as WorkerSelfHandle, bZ as WorkerSelfOptions, b_ as WorkerTransport, b$ as audit, c0 as buffer, c1 as bufferCount, c2 as bufferTime, c3 as cascadingCache, c4 as catchError, c5 as checkpointToRedis, c6 as checkpointToS3, c7 as circuitBreaker, c8 as combine, c9 as combineLatest, ca as concat, cb as concatMap, cc as constant, cd as createTransport, ce as createWatermarkController, cf as csvRows, cg as debounce, ch as debounceTime, ci as decorrelatedJitter, cj as delay, ck as deserializeError, cl as distill, cm as distinctUntilChanged, cn as elementAt, co as exhaustMap, cp as exponential, cq as externalBundle, cr as externalProducer, cs as extra, ct as fallback, cu as fibonacci, cv as filter, cw as find, cx as first, cy as flatMap, cz as fromCSV, cA as fromClickHouseWatch, cB as fromDrizzle, cC as fromFSWatch, cD as fromGitHook, cE as fromHTTP, cF as fromHTTPPoll, cG as fromHTTPStream, cH as fromKafka, cI as fromKysely, cJ as fromMCP, cK as fromNATS, cL as fromNDJSON, cM as fromOTel, cN as fromPrisma, cO as fromPrometheus, cP as fromPulsar, cQ as fromRabbitMQ, cR as fromRedisStream, cS as fromSSE, cT as fromSqlite, cU as fromSqliteCursor, cV as fromStatsD, cW as fromSyslog, cX as fromWebSocket, cY as fromWebSocketReconnect, cZ as fromWebhook, c_ as interval, c$ as last, d0 as linear, d1 as lru, d2 as map, d3 as matchesCron, d4 as merge, d5 as mergeMap, d6 as nameToSignal, d7 as ndjsonRows, d8 as pairwise, d9 as parseCron, da as parsePrometheusText, db as parseStatsD, dc as parseSyslog, dd as pausable, de as pubsub, df as race, dg as rateLimiter, dh as reactiveIndex, di as reactiveList, dj as reactiveLog, dk as reactiveMap, dl as reactiveSink, dm as reduce, dn as repeat, dp as rescue, dq as resolveBackoffPreset, dr as retry, ds as retrySource, dt as sample, du as scan, dv as serializeError, dw as signalToName, dx as skip, dy as switchMap, dz as take, dA as takeUntil, dB as takeWhile, dC as tap, dD as throttle, dE as throttleTime, dF as timeout, dG as toCSV, dH as toClickHouse, dI as toFile, dJ as toHTTP, dK as toKafka, dL as toLoki, dM as toMongo, dN as toNATS, dO as toPostgres, dP as toPulsar, dQ as toRabbitMQ, dR as toReadableStream, dS as toRedisStream, dT as toS3, dU as toSSE, dV as toSSEBytes, dW as toSqlite, dX as toTempo, dY as toWebSocket, dZ as tokenBucket, d_ as valve, d$ as verifiable, e0 as window, e1 as windowCount, e2 as windowTime, e3 as withBreaker, e4 as withLatestFrom, e5 as withMaxAttempts, e6 as withStatus, e7 as workerBridge, e8 as workerSelf, e9 as zip } from './index-BeIdBfcb.cjs';
6
+ import { w as watchTopologyTree } from './index-CUwyr1Kk.cjs';
7
+ export { E as ENVELOPE_VERSION, a as EvictedSubgraphInfo, b as EvictionPolicy, G as GraphCodec, J as JsonCodec, L as LazyGraphCodec, O as SIZEOF_OVERHEAD, S as SIZEOF_SYMBOL, W as WALEntry, c as createDagCborCodec, d as createDagCborZstdCodec, e as decodeEnvelope, f as encodeEnvelope, i as graph, r as registerBuiltinCodecs, g as replayWAL, s as sizeof } from './index-CUwyr1Kk.cjs';
8
+ import { N as Node, a as NodeOptions, b as NodeActions, A as Actor, P as PolicyRuleData, G as GuardAction } from './node-C_IBuvX2.cjs';
9
+ export { C as COMPLETE, c as COMPLETE_MSG, d as COMPLETE_ONLY_BATCH, D as DATA, e as DEFAULT_ACTOR, f as DIRTY, g as DIRTY_MSG, h as DIRTY_ONLY_BATCH, i as DepRecord, E as ERROR, F as FnCtx, j as GlobalInspectorEvent, k as GlobalInspectorHook, l as GraphReFlyConfig, m as GuardDenied, n as GuardDeniedDetails, H as HashFn, I as INVALIDATE, o as INVALIDATE_MSG, p as INVALIDATE_ONLY_BATCH, M as Message, q as MessageContext, r as MessageTypeRegistration, s as MessageTypeRegistrationInput, t as Messages, u as NodeCtx, v as NodeDescribeKind, w as NodeFn, x as NodeFnCleanup, y as NodeGuard, z as NodeImpl, B as NodeInspectorHook, J as NodeInspectorHookEvent, K as NodeSink, L as NodeStatus, O as NodeTransportOptions, Q as NodeVersionInfo, R as OnMessageHandler, S as OnSubscribeHandler, T as PAUSE, U as PolicyAllow, V as PolicyDeny, W as RESOLVED, X as RESOLVED_MSG, Y as RESOLVED_ONLY_BATCH, Z as RESUME, _ as START, $ as START_MSG, a0 as SubscribeContext, a1 as TEARDOWN, a2 as TEARDOWN_MSG, a3 as TEARDOWN_ONLY_BATCH, a4 as V0, a5 as V1, a6 as VersioningLevel, a7 as VersioningOptions, a8 as accessHintForGuard, a9 as advanceVersion, aa as configure, ab as createVersioning, ac as defaultConfig, ad as defaultHash, ae as isV1, af as node, ag as normalizeActor, ah as policy, ai as policyFromRules, aj as registerBuiltins } from './node-C_IBuvX2.cjs';
10
+ import { NodeInput } from './extra/sources.cjs';
11
+ export { AsyncSourceOpts, EventTargetLike, FromCronOptions, ReactiveCounterBundle, cached, empty, escapeRegexChar, firstValueFrom, firstWhere, forEach, fromAny, fromAsyncIter, fromCron, fromEvent, fromIter, fromPromise, fromRaf, fromTimer, globToRegExp, keepalive, matchesAnyPattern, never, of, reactiveCounter, replay, share, shareReplay, throwError, toArray } from './extra/sources.cjs';
12
+ import { S as StorageHandle, a as StorageTier } from './storage-DiqWHzVI.cjs';
13
+ export { I as IndexedDbStorageSpec, d as dictStorage, f as fileStorage, b as fromIDBRequest, c as fromIDBTransaction, i as indexedDbStorage, m as memoryStorage, s as sqliteStorage } from './storage-DiqWHzVI.cjs';
14
+ import { G as Graph, a as GraphOptions, b as GraphAttachStorageOptions, c as GraphPersistSnapshot, C as CausalChain, d as GraphDescribeOptions, e as GraphDescribeOutput, D as DescribeFilter, f as GraphProfileResult, g as GraphProfileOptions, h as GraphNodeFactory, i as GraphDiffResult } from './graph-6tZ5jEzr.cjs';
15
+ export { j as CausalStep, E as ExplainPathOptions, k as GRAPH_META_SEGMENT, l as GraphActorOptions, m as GraphCheckpointRecord, n as GraphDiagramDirection, o as GraphDiagramOptions, p as GraphDiffChange, q as GraphFactoryContext, r as GraphObserveAll, s as GraphObserveOne, 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 reachable } from './graph-6tZ5jEzr.cjs';
16
+ import { c as cqrs } from './index-_oMEWlDq.cjs';
17
+ export { i as nestjs } from './index-_oMEWlDq.cjs';
18
+ import { d as demoShell } from './demo-shell-26p5fVxn.cjs';
19
+ import { i as index$3 } from './index-C8mdwMXc.cjs';
20
+ export { D as DescribeDetail, a as DescribeField, b as DescribeNodeOutput, r as resolveDescribeFields } from './meta-C0-8XW6Q.cjs';
21
+ export { T as ToObservableOptions, t as toObservable } from './observable-Crr1jgzx.cjs';
22
+ export { i as jotai } from './index-QBpffFW-.cjs';
23
+ export { i as nanostores } from './index-CUyrtuOf.cjs';
24
+ export { i as react } from './index-DFhjO4Gg.cjs';
25
+ export { i as solid } from './index-B_IP40nB.cjs';
26
+ export { i as svelte } from './index-Bd_fwmLf.cjs';
27
+ export { i as vue } from './index-Bxb5ZYc9.cjs';
28
+ export { i as zustand } from './index-B4MP_8V_.cjs';
17
29
  import '@nestjs/common';
18
30
  import '@nestjs/core';
31
+ import './reactive-layout-BaOQefHu.cjs';
19
32
  import 'rxjs';
20
-
21
- /**
22
- * Options for creating an atom.
23
- *
24
- * @category compat
25
- */
26
- interface AtomOptions {
27
- /** Optional identifier for the underlying node. */
28
- name?: string;
29
- /** Optional companion meta nodes. */
30
- meta?: Record<string, unknown>;
31
- }
32
- /**
33
- * A read-only Jotai-compatible atom.
34
- *
35
- * @category compat
36
- */
37
- interface ReadableAtom<T> {
38
- /** Returns the current cached value. */
39
- get(): T;
40
- /** Subscribes to value changes. Returns an unsubscribe function. */
41
- subscribe(callback: (value: T) => void): () => void;
42
- /** Access to companion meta nodes. */
43
- readonly meta: Record<string, Node>;
44
- /** @internal The underlying GraphReFly node. */
45
- _node: Node<T>;
46
- }
47
- /**
48
- * A writable Jotai-compatible atom.
49
- *
50
- * @category compat
51
- */
52
- interface WritableAtom<T> extends ReadableAtom<T> {
53
- /** Sets a new value. */
54
- set(value: T): void;
55
- /** Updates the value using a transformation function. */
56
- update(fn: (current: T) => T): void;
57
- }
58
- /** Function type for reading other atoms inside a derived atom. */
59
- type GetFn = <V>(a: ReadableAtom<V>) => V;
60
- /** Function type for writing to other atoms inside a writable derived atom. */
61
- type SetFn = <V>(a: WritableAtom<V>, value: V) => void;
62
- /** Function that computes the atom's value. */
63
- type ReadFn<T> = (get: GetFn) => T;
64
- /** Function that handles writes to the atom. */
65
- type WriteFn<T> = (get: GetFn, set: SetFn, value: T) => void;
66
- /**
67
- * Creates a Jotai-compatible atom built on GraphReFly primitives.
68
- *
69
- * Supports three overloads:
70
- * 1. `atom(initial)` — Writable primitive atom (wraps `state()`).
71
- * 2. `atom(read)` — Read-only derived atom (wraps `dynamicNode()`).
72
- * 3. `atom(read, write)` — Writable derived atom.
73
- *
74
- * @param initialOrRead - Initial value or a read function.
75
- * @param writeOrOptions - Write function or options object.
76
- * @param options - Optional configuration.
77
- * @returns WritableAtom or ReadableAtom.
78
- *
79
- * @example
80
- * ```ts
81
- * const count = atom(0);
82
- * count.set(1);
83
- * const doubled = atom((get) => get(count)! * 2);
84
- * ```
85
- *
86
- * @category compat
87
- */
88
- declare function atom$1<T>(initial: T, options?: AtomOptions): WritableAtom<T>;
89
- declare function atom$1<T>(read: ReadFn<T>, options?: AtomOptions): ReadableAtom<T>;
90
- declare function atom$1<T>(read: ReadFn<T>, write: WriteFn<T>, options?: AtomOptions): WritableAtom<T>;
91
-
92
- type index$a_AtomOptions = AtomOptions;
93
- type index$a_GetFn = GetFn;
94
- type index$a_ReadFn<T> = ReadFn<T>;
95
- type index$a_ReadableAtom<T> = ReadableAtom<T>;
96
- type index$a_SetFn = SetFn;
97
- type index$a_WritableAtom<T> = WritableAtom<T>;
98
- type index$a_WriteFn<T> = WriteFn<T>;
99
- declare namespace index$a {
100
- export { type index$a_AtomOptions as AtomOptions, type index$a_GetFn as GetFn, type index$a_ReadFn as ReadFn, type index$a_ReadableAtom as ReadableAtom, type index$a_SetFn as SetFn, type index$a_WritableAtom as WritableAtom, type index$a_WriteFn as WriteFn, atom$1 as atom };
101
- }
102
-
103
- /**
104
- * A Nanostores-compatible atom.
105
- *
106
- * @category compat
107
- */
108
- interface NanoAtom<T> {
109
- /** Get current value. */
110
- get(): T;
111
- /** Set a new value (writable atoms only). */
112
- set(value: T): void;
113
- /** Subscribe to value changes. Callback receives the new value.
114
- * Returns unsubscribe function. Called immediately with current value. */
115
- subscribe(cb: (value: T) => void): () => void;
116
- /** Listen to value changes (no immediate call). Returns unsubscribe. */
117
- listen(cb: (value: T) => void): () => void;
118
- /** The underlying GraphReFly node. */
119
- readonly _node: Node<T>;
120
- }
121
- /**
122
- * A Nanostores-compatible computed store.
123
- *
124
- * @category compat
125
- */
126
- interface NanoComputed<T> {
127
- /** Get current value. */
128
- get(): T;
129
- /** Subscribe to value changes. Called immediately with current value.
130
- * Returns unsubscribe function. */
131
- subscribe(cb: (value: T) => void): () => void;
132
- /** Listen to value changes (no immediate call). Returns unsubscribe. */
133
- listen(cb: (value: T) => void): () => void;
134
- /** The underlying GraphReFly node. */
135
- readonly _node: Node<T>;
136
- }
137
- /**
138
- * A Nanostores-compatible map.
139
- *
140
- * @category compat
141
- */
142
- interface NanoMap<T extends Record<string, unknown>> extends NanoAtom<T> {
143
- /** Set a single key. */
144
- setKey<K extends keyof T>(key: K, value: T[K]): void;
145
- }
146
- /**
147
- * Creates a nanostores-compatible atom.
148
- *
149
- * @param initial - Initial value.
150
- * @returns `NanoAtom<T>`
151
- *
152
- * @category compat
153
- */
154
- declare function atom<T>(initial: T): NanoAtom<T>;
155
- /**
156
- * Creates a nanostores-compatible computed store.
157
- *
158
- * @param stores - One or more atoms/computed stores.
159
- * @param fn - Compute function.
160
- * @returns `NanoComputed<T>`
161
- *
162
- * @category compat
163
- */
164
- declare function computed<T, A>(storeA: NanoAtom<A> | NanoComputed<A>, fn: (a: A) => T): NanoComputed<T>;
165
- declare function computed<T, A, B>(stores: [NanoAtom<A> | NanoComputed<A>, NanoAtom<B> | NanoComputed<B>], fn: (a: A, b: B) => T): NanoComputed<T>;
166
- declare function computed<T, A, B, C>(stores: [
167
- NanoAtom<A> | NanoComputed<A>,
168
- NanoAtom<B> | NanoComputed<B>,
169
- NanoAtom<C> | NanoComputed<C>
170
- ], fn: (a: A, b: B, c: C) => T): NanoComputed<T>;
171
- /**
172
- * Creates a nanostores-compatible map.
173
- *
174
- * @param initial - Initial object value.
175
- * @returns `NanoMap<T>`
176
- *
177
- * @category compat
178
- */
179
- declare function map<T extends Record<string, unknown>>(initial: T): NanoMap<T>;
180
- /**
181
- * Returns the current value of the store.
182
- *
183
- * @category compat
184
- */
185
- declare function getValue<T>(store: NanoAtom<T> | NanoComputed<T>): T;
186
- /**
187
- * Adds a listener for the store start (first listener connected).
188
- *
189
- * @category compat
190
- */
191
- declare function onStart(store: NanoAtom<any> | NanoComputed<any>, cb: () => void): void;
192
- /**
193
- * Adds a listener for the store stop (last listener disconnected).
194
- *
195
- * @category compat
196
- */
197
- declare function onStop(store: NanoAtom<any> | NanoComputed<any>, cb: () => void): void;
198
- /**
199
- * Adds a listener for the store mount (first listener connected).
200
- *
201
- * @returns A cleanup function called when the last listener is removed.
202
- * @category compat
203
- */
204
- declare function onMount(store: NanoAtom<any> | NanoComputed<any>, cb: () => (() => void) | undefined): void;
205
- /**
206
- * Batches multiple store updates.
207
- *
208
- * @category compat
209
- */
210
- declare function action<Args extends any[], Return>(_store: NanoAtom<any> | NanoComputed<any>, _name: string, fn: (...args: Args) => Return): (...args: Args) => Return;
211
-
212
- type index$9_NanoAtom<T> = NanoAtom<T>;
213
- type index$9_NanoComputed<T> = NanoComputed<T>;
214
- type index$9_NanoMap<T extends Record<string, unknown>> = NanoMap<T>;
215
- declare const index$9_action: typeof action;
216
- declare const index$9_atom: typeof atom;
217
- declare const index$9_computed: typeof computed;
218
- declare const index$9_getValue: typeof getValue;
219
- declare const index$9_map: typeof map;
220
- declare const index$9_onMount: typeof onMount;
221
- declare const index$9_onStart: typeof onStart;
222
- declare const index$9_onStop: typeof onStop;
223
- declare namespace index$9 {
224
- export { type index$9_NanoAtom as NanoAtom, type index$9_NanoComputed as NanoComputed, type index$9_NanoMap as NanoMap, index$9_action as action, index$9_atom as atom, index$9_computed as computed, index$9_getValue as getValue, index$9_map as map, index$9_onMount as onMount, index$9_onStart as onStart, index$9_onStop as onStop };
225
- }
226
-
227
- /**
228
- * Subscribe to a read-only `Node<T>` as a React value. Re-renders on node value settlement.
229
- * Subscription lifecycle is tied to React mount/unmount (not node terminal messages).
230
- *
231
- * @param node - Any `Node<T>`.
232
- * @returns `T | undefined` — the current node value, kept in sync via `useSyncExternalStore`.
233
- */
234
- declare function useSubscribe$3<T>(node: Node<T>): T | undefined | null;
235
- /**
236
- * Bind a writable `Node<T>` as a React `[value, setter]` tuple.
237
- * Setting the value always pushes `[[DIRTY], [DATA, value]]`, including `value === undefined`.
238
- * Subscription lifecycle is tied to React mount/unmount (not node terminal messages).
239
- *
240
- * @param node - A `Node<T>` (e.g. state node).
241
- * @returns `[T | undefined, (value: T) => void]` — current value and setter function.
242
- */
243
- declare function useStore$3<T>(node: Node<T>): [T | undefined | null, (value: T) => void];
244
- /** Maps a key to an object of nodes. Used by `useSubscribeRecord`. */
245
- type NodeFactory$3<K, R extends Record<string, any>> = (key: K) => {
246
- [P in keyof R]: Node<R[P]>;
247
- };
248
- /**
249
- * Subscribe to a dynamic set of keyed node records.
250
- * Re-subscribes all per-key fields whenever `keysNode` changes.
251
- * Key re-sync is gated to settled batches (`messageTier >= 3`) to avoid DIRTY-phase churn.
252
- * Guaranteed to clean up strictly with React hook lifecycle, utilizing no global mappings.
253
- *
254
- * @param keysNode - Node of current keys (e.g. node IDs)
255
- * @param factory - Function returning `{ [field]: Node<V> }` for each key.
256
- * @returns `Record<K, R>` — snapshot of resolved values for all keys.
257
- */
258
- declare function useSubscribeRecord$3<K extends string, R extends Record<string, any>>(keysNode: Node<K[]>, factory: NodeFactory$3<K, R>): Record<K, R>;
259
-
260
- declare namespace index$8 {
261
- export { type NodeFactory$3 as NodeFactory, useStore$3 as useStore, useSubscribe$3 as useSubscribe, useSubscribeRecord$3 as useSubscribeRecord };
262
- }
263
-
264
- /**
265
- * Options for creating signals.
266
- *
267
- * @category compat
268
- */
269
- interface SignalOptions {
270
- /** Optional identifier for the underlying node. */
271
- name?: string;
272
- /** Custom equality function for change detection. */
273
- equals?: (a: any, b: any) => boolean;
274
- }
275
- /**
276
- * Common interface for all reactive signals.
277
- *
278
- * @category compat
279
- */
280
- interface AnySignal<T> {
281
- /** Returns the current value of the signal. */
282
- get(): T;
283
- /** @internal The underlying GraphReFly node. */
284
- _node: Node<T>;
285
- }
286
- /**
287
- * TC39 `Signal.State` — a writable signal backed by a GraphReFly `state` node.
288
- * Automatically registers itself as a dependency if read inside a `Computed`.
289
- *
290
- * @example
291
- * ```ts
292
- * const count = new Signal.State(0);
293
- * count.get(); // 0
294
- * count.set(1);
295
- * count.get(); // 1
296
- * ```
297
- */
298
- declare class SignalState<T> implements AnySignal<T> {
299
- /** @internal */
300
- _node: Node<T>;
301
- private readonly _equals;
302
- constructor(initial: T, opts?: SignalOptions);
303
- get(): T;
304
- set(value: T): void;
305
- }
306
- /**
307
- * TC39 `Signal.Computed` — a read-only signal backed by `dynamicNode`.
308
- * Automatically tracks dependencies when `get()` is called on other signals
309
- * during its computation.
310
- *
311
- * @example
312
- * ```ts
313
- * const count = new Signal.State(0);
314
- * const doubled = new Signal.Computed(() => count.get() * 2);
315
- * ```
316
- */
317
- declare class SignalComputed<T> implements AnySignal<T> {
318
- /** @internal */
319
- _node: Node<T>;
320
- constructor(computation: () => T, opts?: SignalOptions);
321
- get(): T;
322
- }
323
- /**
324
- * TC39 Signals-compatible namespace. Wraps GraphReFly primitives.
325
- * Provides auto-tracking conforming to the TS39 signals proposal.
326
- *
327
- * @category compat
328
- */
329
- declare const Signal: {
330
- readonly State: typeof SignalState;
331
- readonly Computed: typeof SignalComputed;
332
- /**
333
- * Subscribes to changes on a signal.
334
- * Returns an unsubscribe callback.
335
- *
336
- * @example
337
- * ```ts
338
- * const count = new Signal.State(0);
339
- * const unsub = Signal.sub(count, v => console.log(v));
340
- * ```
341
- */
342
- readonly sub: <T>(signal: AnySignal<T>, callback: ((value: T) => void) | {
343
- data?: (value: T) => void;
344
- error?: (err: unknown) => void;
345
- complete?: () => void;
346
- }) => (() => void);
347
- };
348
-
349
- type index$7_AnySignal<T> = AnySignal<T>;
350
- declare const index$7_Signal: typeof Signal;
351
- type index$7_SignalComputed<T> = SignalComputed<T>;
352
- declare const index$7_SignalComputed: typeof SignalComputed;
353
- type index$7_SignalOptions = SignalOptions;
354
- type index$7_SignalState<T> = SignalState<T>;
355
- declare const index$7_SignalState: typeof SignalState;
356
- declare namespace index$7 {
357
- export { type index$7_AnySignal as AnySignal, index$7_Signal as Signal, index$7_SignalComputed as SignalComputed, type index$7_SignalOptions as SignalOptions, index$7_SignalState as SignalState };
358
- }
359
-
360
- /** Solid accessor function — returns current value when called. */
361
- type Accessor<T> = () => T;
362
- /**
363
- * Subscribe to a `Node<T>` as a Solid signal. Auto-cleans up with the owning scope.
364
- * Subscription lifecycle is tied to Solid scope cleanup (not node terminal messages).
365
- */
366
- declare function useSubscribe$2<T>(node: Node<T>): Accessor<T | undefined | null>;
367
- /**
368
- * Bind a writable `Node<T>` as a Solid resource tuple `[accessor, setter]`.
369
- * Setter always forwards `[[DIRTY], [DATA, value]]`, including `value === undefined`.
370
- * Subscription lifecycle is tied to Solid scope cleanup (not node terminal messages).
371
- */
372
- declare function useStore$2<T>(node: Node<T>): [Accessor<T | undefined | null>, (v: T) => void];
373
- /** Maps a key to an object of nodes. Used by `useSubscribeRecord`. */
374
- type NodeFactory$2<K, R extends Record<string, any>> = (key: K) => {
375
- [P in keyof R]: Node<R[P]>;
376
- };
377
- /**
378
- * Subscribe to a dynamic set of keyed node records as a Solid accessor.
379
- * Re-subscribes all per-key fields whenever `keys` changes.
380
- * Key re-sync is gated to settled batches (`messageTier >= 3`) to avoid DIRTY-phase churn.
381
- */
382
- declare function useSubscribeRecord$2<K extends string, R extends Record<string, any>>(keysNode: Node<K[]>, factory: NodeFactory$2<K, R>): Accessor<Record<K, R>>;
383
-
384
- type index$6_Accessor<T> = Accessor<T>;
385
- declare namespace index$6 {
386
- export { type index$6_Accessor as Accessor, type NodeFactory$2 as NodeFactory, useStore$2 as useStore, useSubscribe$2 as useSubscribe, useSubscribeRecord$2 as useSubscribeRecord };
387
- }
388
-
389
- /** Svelte store contract — implements the minimal `subscribe` method. */
390
- interface SvelteReadable<T> {
391
- subscribe(run: (value: T) => void): () => void;
392
- }
393
- /** Svelte writable store contract. */
394
- interface SvelteWritable<T> extends SvelteReadable<T> {
395
- set(value: T): void;
396
- update(updater: (value: T) => T): void;
397
- }
398
- /**
399
- * Subscribe to a `Node<T>` as a Svelte readable store (implements Svelte store contract).
400
- * Subscription lifecycle is tied to Svelte store unsubscription (not node terminal messages).
401
- */
402
- declare function useSubscribe$1<T>(node: Node<T>): SvelteReadable<T | undefined | null>;
403
- /**
404
- * Bind a writable `Node<T>` as a Svelte writable store.
405
- * Reads and writes adapt seamlessly.
406
- * Setter/update always forward `[[DIRTY], [DATA, value]]`, including `value === undefined`.
407
- * Subscription lifecycle is tied to Svelte store unsubscription (not node terminal messages).
408
- */
409
- declare function useStore$1<T>(node: Node<T>): SvelteWritable<T | undefined | null>;
410
- /** Maps a key to an object of nodes. Used by `useSubscribeRecord`. */
411
- type NodeFactory$1<K, R extends Record<string, any>> = (key: K) => {
412
- [P in keyof R]: Node<R[P]>;
413
- };
414
- /**
415
- * Subscribe to a dynamic keyed record of nodes as a Svelte readable store.
416
- * Re-subscribes all per-key fields whenever `keysNode` changes.
417
- * Key re-sync is gated to settled batches (`messageTier >= 3`) to avoid DIRTY-phase churn.
418
- */
419
- declare function useSubscribeRecord$1<K extends string, R extends Record<string, any>>(keysNode: Node<K[]>, factory: NodeFactory$1<K, R>): SvelteReadable<Record<K, R>>;
420
-
421
- type index$5_SvelteReadable<T> = SvelteReadable<T>;
422
- type index$5_SvelteWritable<T> = SvelteWritable<T>;
423
- declare namespace index$5 {
424
- export { type NodeFactory$1 as NodeFactory, type index$5_SvelteReadable as SvelteReadable, type index$5_SvelteWritable as SvelteWritable, useStore$1 as useStore, useSubscribe$1 as useSubscribe, useSubscribeRecord$1 as useSubscribeRecord };
425
- }
426
-
427
- /**
428
- * Subscribe to a read-only `Node<T>` as a Vue `Ref<T>`. Auto-unsubscribes on scope disposal.
429
- * Subscription lifecycle is tied to Vue scope disposal (not node terminal messages).
430
- */
431
- declare function useSubscribe<T>(node: Node<T>): Readonly<Ref<T | undefined | null>>;
432
- /**
433
- * Bind a writable `Node<T>` as a Vue `Ref<T>`. Reads and writes are bidirectional.
434
- * Value sets always dispatch `[[DIRTY], [DATA, value]]`, including `value === undefined`.
435
- * Subscription lifecycle is tied to Vue scope disposal (not node terminal messages).
436
- */
437
- declare function useStore<T>(node: Node<T>): Ref<T | undefined | null>;
438
- /** Maps a key to an object of nodes. Used by `useSubscribeRecord` factory. */
439
- type NodeFactory<K, R extends Record<string, any>> = (key: K) => {
440
- [P in keyof R]: Node<R[P]>;
441
- };
442
- /**
443
- * Subscribe to a dynamic set of keyed node records. When keys change,
444
- * old subscriptions are torn down and new ones created automatically.
445
- * Must be called during Vue `setup()`.
446
- */
447
- declare function useSubscribeRecord<K extends string, R extends Record<string, any>>(keys: WatchSource<K[] | undefined>, factory: NodeFactory<K, R>): Readonly<Ref<Record<K, R>>>;
448
-
449
- type index$4_NodeFactory<K, R extends Record<string, any>> = NodeFactory<K, R>;
450
- declare const index$4_useStore: typeof useStore;
451
- declare const index$4_useSubscribe: typeof useSubscribe;
452
- declare const index$4_useSubscribeRecord: typeof useSubscribeRecord;
453
- declare namespace index$4 {
454
- export { type index$4_NodeFactory as NodeFactory, index$4_useStore as useStore, index$4_useSubscribe as useSubscribe, index$4_useSubscribeRecord as useSubscribeRecord };
455
- }
456
-
457
- /** Zustand-compatible Store API. */
458
- interface StoreApi<T> {
459
- getState: () => T;
460
- setState: (partial: T | Partial<T> | ((state: T) => T | Partial<T>), replace?: boolean) => void;
461
- getInitialState: () => T;
462
- subscribe: (listener: (state: T, prevState: T) => void) => () => void;
463
- destroy: () => void;
464
- }
465
- /** Function type for initializing the store. */
466
- type StateCreator<T> = (set: StoreApi<T>["setState"], get: StoreApi<T>["getState"], api: StoreApi<T>) => T;
467
- /**
468
- * Creates a Zustand-compatible store backed by a GraphReFly state node.
469
- * returns an object that is both a Graph and a StoreApi.
470
- *
471
- * @example
472
- * ```ts
473
- * const store = create((set) => ({
474
- * count: 0,
475
- * inc: () => set((s) => ({ count: s.count + 1 }))
476
- * }));
477
- * store.getState().inc();
478
- * ```
479
- *
480
- * @category compat
481
- */
482
- declare function create<T extends object>(initializer: StateCreator<T>): Graph & StoreApi<T>;
483
-
484
- type index$3_StateCreator<T> = StateCreator<T>;
485
- type index$3_StoreApi<T> = StoreApi<T>;
486
- declare const index$3_create: typeof create;
487
- declare namespace index$3 {
488
- export { type index$3_StateCreator as StateCreator, type index$3_StoreApi as StoreApi, index$3_create as create };
489
- }
490
-
491
- /**
492
- * Compat layer: compatibility wrappers for other state management libraries (Phase 5.1b).
493
- *
494
- * Framework adapters are optional peers. Install only what you use:
495
- * - `@graphrefly/graphrefly-ts/compat/react` -> `react`, `react-dom`
496
- * - `@graphrefly/graphrefly-ts/compat/vue` -> `vue`
497
- * - `@graphrefly/graphrefly-ts/compat/svelte` -> `svelte`
498
- * - `@graphrefly/graphrefly-ts/compat/solid` -> `solid-js`
499
- */
500
-
501
- declare namespace index$2 {
502
- export { index$a as jotai, index$9 as nanostores, index$b as nestjs, index$8 as react, index$7 as signals, index$6 as solid, index$5 as svelte, index$4 as vue, index$3 as zustand };
503
- }
33
+ import 'vue';
504
34
 
505
35
  /**
506
36
  * Memory patterns (roadmap §4.3).
@@ -1925,101 +1455,243 @@ declare namespace ai {
1925
1455
  }
1926
1456
 
1927
1457
  /**
1928
- * Three-pane demo shell (roadmap §7.2).
1458
+ * Audit, policy enforcement, and compliance export (roadmap §9.2).
1459
+ *
1460
+ * Three composed factories that wrap any {@link Graph} with the harness
1461
+ * accountability layer:
1929
1462
  *
1930
- * A `Graph("demo-shell")` that dogfoods reactive coordination for the
1931
- * main/side split layout with synchronized cross-highlighting.
1463
+ * - {@link auditTrail} reactive mutation log with by-node/by-actor/by-time
1464
+ * queries.
1465
+ * - {@link policyEnforcer} — reactive ABAC enforcement; in `"audit"` mode
1466
+ * records would-be denials, in `"enforce"` mode pushes guards onto target
1467
+ * nodes so subsequent writes throw {@link GuardDenied}.
1468
+ * - {@link complianceSnapshot} — point-in-time export of graph state +
1469
+ * audit trail + policies for regulatory archival.
1932
1470
  *
1933
- * **Zero framework dependency** — framework bindings wrap pane components only.
1934
- * The shell graph is headless and fully testable.
1471
+ * @module
1935
1472
  */
1936
1473
 
1937
- /** Identifies which pane is the source of a hover event. */
1938
- type HoverPaneType = "visual" | "graph" | "code";
1939
- /** Cross-highlighting hover target. `null` means nothing hovered. */
1940
- type HoverTarget = {
1941
- pane: HoverPaneType;
1942
- id: string;
1943
- } | null;
1944
- /** Which pane is full-screened (null = normal layout). */
1945
- type FullscreenPane = "main" | "graph" | "code" | null;
1946
- /**
1947
- * Cross-referencing registry: maps node paths to code line numbers and
1948
- * visual element selectors. Provided by each demo's `store.ts`.
1949
- */
1950
- type NodeRegistry = Map<string, {
1951
- codeLine: number;
1952
- visualSelector: string;
1953
- }>;
1954
- /** Callbacks for cross-highlighting effect nodes. */
1955
- type HighlightCallbacks = {
1956
- /** Called when code-scroll highlight target changes. */
1957
- codeScroll?: (line: number | null) => void;
1958
- /** Called when visual highlight target changes. */
1959
- visual?: (selector: string | null) => void;
1960
- /** Called when graph highlight target changes. */
1961
- graph?: (nodeId: string | null) => void;
1962
- };
1963
- /** Label dimensions for graph node sizing. */
1964
- type GraphLabelSize = {
1965
- width: number;
1966
- height: number;
1967
- };
1968
- /** Options for {@link demoShell}. */
1969
- type DemoShellOptions = {
1970
- /** Initial main/side split ratio (0–1). Default: `0.65`. */
1971
- mainRatio?: number;
1972
- /** Initial graph/code vertical split in the side pane (0–1). Default: `0.5`. */
1973
- sideSplit?: number;
1974
- /** Initial viewport width in pixels. Default: `1280`. */
1975
- viewportWidth?: number;
1976
- /** Cross-referencing registry for hover→code/visual/graph mapping. */
1977
- nodeRegistry?: NodeRegistry;
1978
- /** Measurement adapter for layout engine integration. When provided, enables layout/* derived nodes. */
1979
- adapter?: MeasurementAdapter;
1980
- /** Font string for layout measurement. Default: `"14px monospace"`. */
1981
- layoutFont?: string;
1982
- /** Callbacks for cross-highlighting effect nodes. When provided, creates effect nodes visible in describe(). */
1983
- onHighlight?: HighlightCallbacks;
1984
- };
1985
- /** Return type of {@link demoShell}. */
1986
- type DemoShellHandle = {
1987
- /** The demo-shell graph. */
1988
- graph: Graph;
1989
- setMainRatio(ratio: number): void;
1990
- setSideSplit(ratio: number): void;
1991
- setFullscreen(pane: FullscreenPane): void;
1992
- setViewportWidth(width: number): void;
1993
- setHoverTarget(target: HoverTarget): void;
1994
- setDemoGraph(g: Graph | null): void;
1995
- bumpGraphTick(): void;
1996
- selectNode(path: string | null): void;
1997
- setMetaDebug(on: boolean): void;
1998
- /** Set code text for layout/code-lines measurement (requires adapter). */
1999
- setCodeText(text: string): void;
2000
- /** Atomic multi-set — wraps core `batch()` for glitch-free updates. */
2001
- batch(fn: () => void): void;
2002
- destroy(): void;
1474
+ /** A single recorded mutation/event in an {@link AuditTrailGraph}. */
1475
+ interface AuditEntry {
1476
+ seq: number;
1477
+ timestamp_ns: number;
1478
+ wall_clock_ns: number;
1479
+ path: string;
1480
+ type: "data" | "dirty" | "resolved" | "invalidate" | "pause" | "resume" | "complete" | "error" | "teardown";
1481
+ actor?: Actor;
1482
+ value?: unknown;
1483
+ error?: unknown;
1484
+ reason?: string;
1485
+ }
1486
+ /** Options for {@link auditTrail}. */
1487
+ interface AuditTrailOptions {
1488
+ name?: string;
1489
+ graph?: GraphOptions;
1490
+ /** Ring-buffer cap for the underlying `reactiveLog`. Default: unbounded. */
1491
+ maxSize?: number;
1492
+ /**
1493
+ * Which event types to record. Default: `["data", "error", "complete",
1494
+ * "teardown"]` the user-meaningful set. Opt in to mid-wave protocol
1495
+ * events (`"dirty"`, `"resolved"`, `"invalidate"`, `"pause"`, `"resume"`)
1496
+ * by listing them explicitly. Note: those tier-1/tier-2 events do not
1497
+ * carry an `actor` (no `lastMutation` populated) — record them only for
1498
+ * protocol-level diagnostics.
1499
+ */
1500
+ includeTypes?: readonly AuditEntry["type"][];
1501
+ /** Per-event filter; return false to skip. */
1502
+ filter?: (entry: AuditEntry) => boolean;
1503
+ }
1504
+ /**
1505
+ * Mounted audit log — `entries` exposes the reactive `AuditEntry[]`; query
1506
+ * helpers are sync convenience wrappers over the cached snapshot.
1507
+ */
1508
+ declare class AuditTrailGraph extends Graph {
1509
+ readonly entries: Node<readonly AuditEntry[]>;
1510
+ readonly count: Node<number>;
1511
+ private readonly _log;
1512
+ private readonly _target;
1513
+ constructor(target: Graph, opts: AuditTrailOptions);
1514
+ /** All entries currently in the ring (snapshot). */
1515
+ all(): readonly AuditEntry[];
1516
+ /** Entries matching `path`. Order preserved. */
1517
+ byNode(path: string): readonly AuditEntry[];
1518
+ /** Entries whose `actor.id` matches. Use `byActorType` for type filtering. */
1519
+ byActor(actorId: string): readonly AuditEntry[];
1520
+ /** Entries whose `actor.type` matches (e.g. `"llm"`, `"human"`). */
1521
+ byActorType(type: string): readonly AuditEntry[];
1522
+ /**
1523
+ * Entries with `timestamp_ns` in `[start_ns, end_ns)` (end exclusive).
1524
+ * Omit `end_ns` to query open-ended.
1525
+ */
1526
+ byTimeRange(start_ns: number, end_ns?: number): readonly AuditEntry[];
1527
+ /** Reference to the audited graph (escape hatch for tooling). */
1528
+ get target(): Graph;
1529
+ }
1530
+ /**
1531
+ * Wraps any {@link Graph} with a reactive audit trail recording every event
1532
+ * matching `includeTypes` (default: data + error + complete + teardown).
1533
+ *
1534
+ * Each entry carries `seq`, `timestamp_ns` (monotonic), `wall_clock_ns`,
1535
+ * `path`, `type`, and when available `actor`, `value`, `error`, and the
1536
+ * `graph.trace()` reasoning annotation for the path.
1537
+ *
1538
+ * The returned graph mounts an `entries` node + `count` derived. Query
1539
+ * helpers (`byNode`, `byActor`, `byTimeRange`) operate on the cached
1540
+ * snapshot synchronously.
1541
+ */
1542
+ declare function auditTrail(target: Graph, opts?: AuditTrailOptions): AuditTrailGraph;
1543
+ /** A single policy denial recorded by {@link PolicyEnforcerGraph}. */
1544
+ interface PolicyViolation {
1545
+ timestamp_ns: number;
1546
+ wall_clock_ns: number;
1547
+ path: string;
1548
+ actor: Actor;
1549
+ action: GuardAction;
1550
+ mode: "audit" | "enforce";
1551
+ /** `"observed"` (audit mode after-the-fact) or `"blocked"` (enforce mode pre-write). */
1552
+ result: "observed" | "blocked";
1553
+ }
1554
+ /** Options for {@link policyEnforcer}. */
1555
+ interface PolicyEnforcerOptions {
1556
+ name?: string;
1557
+ graph?: GraphOptions;
1558
+ /**
1559
+ * `"audit"` (default) — observe events and record would-be denials;
1560
+ * does not block writes. Audit mode requires `lastMutation` attribution
1561
+ * on the audited node — anonymous/internal writes (no `actor` passed,
1562
+ * unguarded node) are skipped silently because the policy cannot be
1563
+ * evaluated without an actor.
1564
+ *
1565
+ * `"enforce"` — push guards onto target nodes so disallowed writes
1566
+ * throw {@link GuardDenied}. Reverted on dispose.
1567
+ */
1568
+ mode?: "audit" | "enforce";
1569
+ /**
1570
+ * Restrict enforcement to specific node paths (qualified). When omitted,
1571
+ * applies to every node visible in `target.describe()` at construction
1572
+ * time (subgraphs are walked transitively) AND subscribes to the full
1573
+ * topology tree via {@link watchTopologyTree}, so nodes added to
1574
+ * `target` OR any transitively-mounted subgraph after construction are
1575
+ * guarded automatically (enforce mode only).
1576
+ *
1577
+ * **Cost:** unrestricted mode runs `describe({detail:"minimal"})` once
1578
+ * at construction (O(N) over the graph tree) plus one topology
1579
+ * subscription per graph instance in the mount tree. Restricted mode
1580
+ * skips both and disables dynamic coverage — callers providing
1581
+ * `paths` must re-create on subgraph changes.
1582
+ */
1583
+ paths?: readonly string[];
1584
+ /** Ring-buffer cap for the violations topic. Default: 1000. */
1585
+ violationsLimit?: number;
1586
+ }
1587
+ /**
1588
+ * Reactive ABAC enforcement layer. Policies are reactive — pass a
1589
+ * `Node<readonly PolicyRuleData[]>` to allow LLMs (or any reactive source)
1590
+ * to update them at runtime; the enforcer rebinds its internal
1591
+ * {@link NodeGuard} on every push.
1592
+ */
1593
+ declare class PolicyEnforcerGraph extends Graph {
1594
+ readonly policies: Node<readonly PolicyRuleData[]>;
1595
+ readonly violations: TopicGraph<PolicyViolation>;
1596
+ readonly violationCount: Node<number>;
1597
+ private readonly _target;
1598
+ private readonly _mode;
1599
+ private _currentGuard;
1600
+ constructor(target: Graph, policies: readonly PolicyRuleData[] | Node<readonly PolicyRuleData[]>, opts: PolicyEnforcerOptions);
1601
+ private _publishViolation;
1602
+ /** Snapshot of recorded violations. */
1603
+ all(): readonly PolicyViolation[];
1604
+ get mode(): "audit" | "enforce";
1605
+ get target(): Graph;
1606
+ }
1607
+ /**
1608
+ * Wraps a {@link Graph} with reactive policy enforcement. Pass either a
1609
+ * static rule list or a {@link Node} of rules (LLM-updatable). Records
1610
+ * `PolicyViolation` entries to `violations` topic; in `"enforce"` mode also
1611
+ * pushes guards onto target nodes so disallowed writes throw.
1612
+ */
1613
+ declare function policyEnforcer(target: Graph, policies: readonly PolicyRuleData[] | Node<readonly PolicyRuleData[]>, opts?: PolicyEnforcerOptions): PolicyEnforcerGraph;
1614
+ /**
1615
+ * Reactive {@link CausalChain} that recomputes whenever the audited graph
1616
+ * changes. Returns a `Node<CausalChain>` suitable for subscription, mounting,
1617
+ * or composition (e.g. inside `graphLens.why(node)`).
1618
+ *
1619
+ * **How it stays live:** an internal `version` state is bumped by an observer
1620
+ * attached to `target.observe()`; the derived chain depends on `version`, so
1621
+ * each mutation triggers a recompute. To avoid stalling on no-op events, only
1622
+ * `data`, `error`, `complete`, and `teardown` bump the version (matching the
1623
+ * audit defaults).
1624
+ */
1625
+ declare function reactiveExplainPath(target: Graph, from: string, to: string, opts?: {
1626
+ maxDepth?: number;
1627
+ name?: string;
1628
+ findCycle?: boolean;
1629
+ }): {
1630
+ node: Node<CausalChain>;
1631
+ dispose: () => void;
2003
1632
  };
1633
+ /** Options for {@link complianceSnapshot}. */
1634
+ interface ComplianceSnapshotOptions {
1635
+ audit?: AuditTrailGraph;
1636
+ policies?: PolicyEnforcerGraph;
1637
+ /** Actor recorded as the snapshot taker. */
1638
+ actor?: Actor;
1639
+ }
1640
+ /** Output of {@link complianceSnapshot}. JSON-serializable. */
1641
+ interface ComplianceSnapshotResult {
1642
+ format_version: 1;
1643
+ timestamp_ns: number;
1644
+ wall_clock_ns: number;
1645
+ actor?: Actor;
1646
+ graph: GraphPersistSnapshot;
1647
+ audit?: {
1648
+ count: number;
1649
+ entries: AuditEntry[];
1650
+ };
1651
+ policies?: {
1652
+ mode: "audit" | "enforce";
1653
+ rules: readonly PolicyRuleData[];
1654
+ violations: readonly PolicyViolation[];
1655
+ };
1656
+ /**
1657
+ * Truncated SHA-256 hex (16 chars / ~64 bits) over a canonical encoding
1658
+ * of every field above (excluding `fingerprint` itself). Deterministic
1659
+ * across runs given identical inputs. Suitable for casual tamper-evidence
1660
+ * and content-addressed dedup; for full cryptographic strength, hash the
1661
+ * canonical JSON externally with Web Crypto / Node `crypto`.
1662
+ */
1663
+ fingerprint: string;
1664
+ }
2004
1665
  /**
2005
- * Creates the three-pane demo shell graph (roadmap §7.2).
1666
+ * One-shot point-in-time export of a {@link Graph}'s state plus optional
1667
+ * audit + policy bundles. Returns a JSON-serializable object with a
1668
+ * deterministic truncated-SHA-256 {@link ComplianceSnapshotResult.fingerprint}
1669
+ * over the canonical payload for tamper-evidence in regulatory archival.
2006
1670
  *
2007
- * All coordination is reactive no polling, no imperative triggers.
2008
- * Framework bindings subscribe to named nodes and drive `state` inputs.
1671
+ * **Cryptographic strength:** the fingerprint is truncated to 64 bits for
1672
+ * compact archival. Collision-resistant for casual integrity checks but NOT
1673
+ * sufficient for adversarial tamper-evidence — pair with a full SHA-256
1674
+ * (or stronger) over the canonical JSON when regulatory requirements demand
1675
+ * collision resistance.
2009
1676
  */
2010
- declare function demoShell(opts?: DemoShellOptions): DemoShellHandle;
1677
+ declare function complianceSnapshot(target: Graph, opts?: ComplianceSnapshotOptions): ComplianceSnapshotResult;
2011
1678
 
2012
- type demoShell$1_DemoShellHandle = DemoShellHandle;
2013
- type demoShell$1_DemoShellOptions = DemoShellOptions;
2014
- type demoShell$1_FullscreenPane = FullscreenPane;
2015
- type demoShell$1_GraphLabelSize = GraphLabelSize;
2016
- type demoShell$1_HighlightCallbacks = HighlightCallbacks;
2017
- type demoShell$1_HoverPaneType = HoverPaneType;
2018
- type demoShell$1_HoverTarget = HoverTarget;
2019
- type demoShell$1_NodeRegistry = NodeRegistry;
2020
- declare const demoShell$1_demoShell: typeof demoShell;
2021
- declare namespace demoShell$1 {
2022
- export { type demoShell$1_DemoShellHandle as DemoShellHandle, type demoShell$1_DemoShellOptions as DemoShellOptions, type demoShell$1_FullscreenPane as FullscreenPane, type demoShell$1_GraphLabelSize as GraphLabelSize, type demoShell$1_HighlightCallbacks as HighlightCallbacks, type demoShell$1_HoverPaneType as HoverPaneType, type demoShell$1_HoverTarget as HoverTarget, type demoShell$1_NodeRegistry as NodeRegistry, demoShell$1_demoShell as demoShell };
1679
+ type audit_AuditEntry = AuditEntry;
1680
+ type audit_AuditTrailGraph = AuditTrailGraph;
1681
+ declare const audit_AuditTrailGraph: typeof AuditTrailGraph;
1682
+ type audit_AuditTrailOptions = AuditTrailOptions;
1683
+ type audit_ComplianceSnapshotOptions = ComplianceSnapshotOptions;
1684
+ type audit_ComplianceSnapshotResult = ComplianceSnapshotResult;
1685
+ type audit_PolicyEnforcerGraph = PolicyEnforcerGraph;
1686
+ declare const audit_PolicyEnforcerGraph: typeof PolicyEnforcerGraph;
1687
+ type audit_PolicyEnforcerOptions = PolicyEnforcerOptions;
1688
+ type audit_PolicyViolation = PolicyViolation;
1689
+ declare const audit_auditTrail: typeof auditTrail;
1690
+ declare const audit_complianceSnapshot: typeof complianceSnapshot;
1691
+ declare const audit_policyEnforcer: typeof policyEnforcer;
1692
+ declare const audit_reactiveExplainPath: typeof reactiveExplainPath;
1693
+ declare namespace audit {
1694
+ export { type audit_AuditEntry as AuditEntry, audit_AuditTrailGraph as AuditTrailGraph, type audit_AuditTrailOptions as AuditTrailOptions, type audit_ComplianceSnapshotOptions as ComplianceSnapshotOptions, type audit_ComplianceSnapshotResult as ComplianceSnapshotResult, audit_PolicyEnforcerGraph as PolicyEnforcerGraph, type audit_PolicyEnforcerOptions as PolicyEnforcerOptions, type audit_PolicyViolation as PolicyViolation, audit_auditTrail as auditTrail, audit_complianceSnapshot as complianceSnapshot, audit_policyEnforcer as policyEnforcer, audit_reactiveExplainPath as reactiveExplainPath };
2023
1695
  }
2024
1696
 
2025
1697
  /**
@@ -2565,6 +2237,135 @@ declare namespace graphspec {
2565
2237
  export { type graphspec_CatalogFnEntry as CatalogFnEntry, type graphspec_CatalogSourceEntry as CatalogSourceEntry, type graphspec_CompileSpecOptions as CompileSpecOptions, type graphspec_ConfigFieldSchema as ConfigFieldSchema, type graphspec_FnFactory as FnFactory, type graphspec_GraphSpec as GraphSpec, type graphspec_GraphSpecCatalog as GraphSpecCatalog, type graphspec_GraphSpecFeedbackEdge as GraphSpecFeedbackEdge, type graphspec_GraphSpecNode as GraphSpecNode, type graphspec_GraphSpecTemplate as GraphSpecTemplate, type graphspec_GraphSpecTemplateRef as GraphSpecTemplateRef, type graphspec_GraphSpecValidation as GraphSpecValidation, type graphspec_LLMComposeOptions as LLMComposeOptions, type graphspec_LLMRefineOptions as LLMRefineOptions, type graphspec_SourceFactory as SourceFactory, type graphspec_SpecDiffEntry as SpecDiffEntry, type graphspec_SpecDiffResult as SpecDiffResult, graphspec_compileSpec as compileSpec, graphspec_decompileGraph as decompileGraph, graphspec_extractFnFactory as extractFnFactory, graphspec_extractSourceFactory as extractSourceFactory, graphspec_generateCatalogPrompt as generateCatalogPrompt, graphspec_isRichFnEntry as isRichFnEntry, graphspec_isRichSourceEntry as isRichSourceEntry, graphspec_llmCompose as llmCompose, graphspec_llmRefine as llmRefine, graphspec_specDiff as specDiff, graphspec_validateSpec as validateSpec, graphspec_validateSpecAgainstCatalog as validateSpecAgainstCatalog };
2566
2238
  }
2567
2239
 
2240
+ /**
2241
+ * Composable safety layer (roadmap §9.0b).
2242
+ *
2243
+ * {@link guardedExecution} wraps any {@link Graph} with:
2244
+ *
2245
+ * - {@link policyEnforcer} — reactive ABAC, policies stored as a `Node` so
2246
+ * LLMs / humans can update them at runtime. Now with full transitive
2247
+ * dynamic coverage via `watchTopologyTree`.
2248
+ * - Scoped {@link GuardedExecutionGraph.scopedDescribe} — delegates to
2249
+ * `target.describe({actor})` so callers see only what the actor is
2250
+ * allowed to see.
2251
+ * - The enforcer's `violations` topic is republished as `violations` on
2252
+ * the wrapper, composable with {@link graphLens}.`health` alerts.
2253
+ *
2254
+ * V1 scope: policies + actor + scoped describe. Budget-as-option is NOT
2255
+ * in V1 — it requires a cost-tracking design that hasn't landed yet.
2256
+ * Callers who need a budget limit today append a budget-aware
2257
+ * {@link PolicyRuleData} to the policies list (check current cost and
2258
+ * `deny` when exhausted).
2259
+ *
2260
+ * @module
2261
+ */
2262
+
2263
+ /** Options for {@link guardedExecution}. */
2264
+ interface GuardedExecutionOptions {
2265
+ /**
2266
+ * Policies enforced against every guarded write. Static list or a live
2267
+ * `Node<readonly PolicyRuleData[]>` (LLM-updatable).
2268
+ *
2269
+ * **Deny-by-default gotcha:** the underlying `policyFromRules()` denies any
2270
+ * action that matches no rule. An empty policies list in `mode: "enforce"`
2271
+ * therefore blocks EVERY write AND every `observe` through the stacked
2272
+ * guard — including `scopedDescribe()`. If you want a permissive base, add
2273
+ * at least `{ effect: "allow", action: "*" }` and layer deny rules on top.
2274
+ * In `mode: "audit"` no guards are stacked, so empty policies are safe.
2275
+ */
2276
+ policies: readonly PolicyRuleData[] | Node<readonly PolicyRuleData[]>;
2277
+ /**
2278
+ * Actor whose perspective drives {@link GuardedExecutionGraph.scopedDescribe}
2279
+ * and {@link GuardedExecutionGraph.describe} — when omitted, callers must
2280
+ * pass `{actor}` explicitly or they get the target's raw describe.
2281
+ */
2282
+ actor?: Actor;
2283
+ /**
2284
+ * `"enforce"` (default) — push guards onto target nodes so disallowed
2285
+ * writes throw {@link GuardDenied}.
2286
+ * `"audit"` — record would-be denials to the `violations` topic without
2287
+ * blocking writes.
2288
+ */
2289
+ mode?: "audit" | "enforce";
2290
+ /** Ring-buffer cap for the `violations` topic. Default 1000 (inherited from policyEnforcer). */
2291
+ violationsLimit?: number;
2292
+ /** Wrapper graph name. Default `${target.name}_guarded`. */
2293
+ name?: string;
2294
+ /** Wrapper graph options. */
2295
+ graph?: GraphOptions;
2296
+ }
2297
+ /**
2298
+ * Wrapper over a target {@link Graph} providing reactive ABAC + scoped
2299
+ * describe. Mounts a {@link PolicyEnforcerGraph} under `enforcer`.
2300
+ *
2301
+ * @category patterns
2302
+ */
2303
+ declare class GuardedExecutionGraph extends Graph {
2304
+ readonly enforcer: PolicyEnforcerGraph;
2305
+ readonly violations: TopicGraph<PolicyViolation>;
2306
+ private readonly _target;
2307
+ private readonly _defaultActor;
2308
+ constructor(target: Graph, opts: GuardedExecutionOptions);
2309
+ /**
2310
+ * Describe the **target** graph scoped to the configured actor. Returns
2311
+ * only nodes the actor is permitted to see (via the target's node guards
2312
+ * filtering `describe()` via `actor`).
2313
+ *
2314
+ * Pass `{actor}` in opts to override the configured actor for this call.
2315
+ * Pass any standard {@link GraphDescribeOptions} fields (`detail`,
2316
+ * `fields`, `filter`) — they apply to the target's describe.
2317
+ *
2318
+ * **Mode interaction:**
2319
+ * - In `mode: "enforce"` (default), the enforcer stacks a policy-derived
2320
+ * guard on every target node. `scopedDescribe({actor})` then filters by
2321
+ * the AND of per-node guards AND the stacked policy guard.
2322
+ * - In `mode: "audit"`, NO guards are stacked — `scopedDescribe` filters
2323
+ * purely by the target's pre-existing per-node guards. If a target has
2324
+ * no node-level guards, the policy rules you pass have no effect on
2325
+ * visibility (they only populate the `violations` topic on writes).
2326
+ */
2327
+ scopedDescribe(opts?: Omit<GraphDescribeOptions, "actor"> & {
2328
+ actor?: Actor;
2329
+ }): GraphDescribeOutput;
2330
+ /** The wrapped graph (escape hatch for tooling). */
2331
+ get target(): Graph;
2332
+ }
2333
+ /**
2334
+ * Wrap a {@link Graph} with {@link policyEnforcer} plus a scoped describe
2335
+ * lens. Returns a {@link GuardedExecutionGraph} that can be mounted, diffed,
2336
+ * or composed with {@link graphLens}.
2337
+ *
2338
+ * @param target - The graph to guard.
2339
+ * @param opts - See {@link GuardedExecutionOptions}.
2340
+ *
2341
+ * @example
2342
+ * ```ts
2343
+ * const guarded = guardedExecution(app, {
2344
+ * actor: { type: "human", id: "alice" },
2345
+ * policies: [
2346
+ * { effect: "allow", action: "read", actorType: "human" },
2347
+ * { effect: "deny", action: "write", pathPattern: "system::*" },
2348
+ * ],
2349
+ * mode: "enforce",
2350
+ * });
2351
+ *
2352
+ * const view = guarded.scopedDescribe({ detail: "standard" });
2353
+ * guarded.violations.events.subscribe(msgs => console.log("violations:", msgs));
2354
+ * ```
2355
+ *
2356
+ * @category patterns
2357
+ */
2358
+ declare function guardedExecution(target: Graph, opts: GuardedExecutionOptions): GuardedExecutionGraph;
2359
+
2360
+ declare const guardedExecution$1_DescribeFilter: typeof DescribeFilter;
2361
+ type guardedExecution$1_GuardedExecutionGraph = GuardedExecutionGraph;
2362
+ declare const guardedExecution$1_GuardedExecutionGraph: typeof GuardedExecutionGraph;
2363
+ type guardedExecution$1_GuardedExecutionOptions = GuardedExecutionOptions;
2364
+ declare const guardedExecution$1_guardedExecution: typeof guardedExecution;
2365
+ declare namespace guardedExecution$1 {
2366
+ export { guardedExecution$1_DescribeFilter as DescribeFilter, guardedExecution$1_GuardedExecutionGraph as GuardedExecutionGraph, type guardedExecution$1_GuardedExecutionOptions as GuardedExecutionOptions, guardedExecution$1_guardedExecution as guardedExecution };
2367
+ }
2368
+
2568
2369
  /**
2569
2370
  * Harness wiring types (roadmap §9.0).
2570
2371
  *
@@ -3118,66 +2919,223 @@ declare function harnessTrace(harness: HarnessGraph, opts?: HarnessTraceOptions)
3118
2919
  * @module
3119
2920
  */
3120
2921
 
3121
- type index$1_CodeChange = CodeChange;
3122
- type index$1_CodeChangeBridgeOptions = CodeChangeBridgeOptions;
3123
- declare const index$1_DEFAULT_DECAY_RATE: typeof DEFAULT_DECAY_RATE;
3124
- declare const index$1_DEFAULT_QUEUE_CONFIGS: typeof DEFAULT_QUEUE_CONFIGS;
3125
- declare const index$1_DEFAULT_SEVERITY_WEIGHTS: typeof DEFAULT_SEVERITY_WEIGHTS;
3126
- type index$1_ErrorClass = ErrorClass;
3127
- type index$1_ErrorClassifier = ErrorClassifier;
3128
- type index$1_EvalDelta = EvalDelta;
3129
- type index$1_EvalIntakeBridgeOptions = EvalIntakeBridgeOptions;
3130
- type index$1_EvalJudgeScore = EvalJudgeScore;
3131
- type index$1_EvalResult = EvalResult;
3132
- type index$1_EvalTaskDelta = EvalTaskDelta;
3133
- type index$1_EvalTaskResult = EvalTaskResult;
3134
- type index$1_ExecuteOutput = ExecuteOutput;
3135
- type index$1_ExecutionResult = ExecutionResult;
3136
- type index$1_HarnessGraph = HarnessGraph;
3137
- declare const index$1_HarnessGraph: typeof HarnessGraph;
3138
- type index$1_HarnessLoopOptions = HarnessLoopOptions;
3139
- type index$1_HarnessProfileResult = HarnessProfileResult;
3140
- type index$1_HarnessTraceHandle = HarnessTraceHandle;
3141
- type index$1_HarnessTraceOptions = HarnessTraceOptions;
3142
- type index$1_IntakeBridgeOptions = IntakeBridgeOptions;
3143
- type index$1_IntakeItem = IntakeItem;
3144
- type index$1_IntakeSource = IntakeSource;
3145
- type index$1_Intervention = Intervention;
3146
- type index$1_LintError = LintError;
3147
- type index$1_NotifyEffectOptions = NotifyEffectOptions;
3148
- type index$1_NotifyTransport<T> = NotifyTransport<T>;
3149
- type index$1_PrioritySignals = PrioritySignals;
3150
- declare const index$1_QUEUE_NAMES: typeof QUEUE_NAMES;
3151
- type index$1_QueueConfig = QueueConfig;
3152
- type index$1_QueueRoute = QueueRoute;
3153
- type index$1_RootCause = RootCause;
3154
- type index$1_Severity = Severity;
3155
- type index$1_StrategyEntry = StrategyEntry;
3156
- type index$1_StrategyKey = StrategyKey;
3157
- type index$1_StrategyModelBundle = StrategyModelBundle;
3158
- type index$1_StrategySnapshot = StrategySnapshot;
3159
- type index$1_TestFailure = TestFailure;
3160
- type index$1_TraceDetail = TraceDetail;
3161
- type index$1_TraceEvent = TraceEvent;
3162
- type index$1_TraceEventType = TraceEventType;
3163
- type index$1_TriagedItem = TriagedItem;
3164
- type index$1_VerifyResult = VerifyResult;
3165
- declare const index$1_affectedTaskFilter: typeof affectedTaskFilter;
3166
- declare const index$1_beforeAfterCompare: typeof beforeAfterCompare;
3167
- declare const index$1_codeChangeBridge: typeof codeChangeBridge;
3168
- declare const index$1_createIntakeBridge: typeof createIntakeBridge;
3169
- declare const index$1_defaultErrorClassifier: typeof defaultErrorClassifier;
3170
- declare const index$1_evalIntakeBridge: typeof evalIntakeBridge;
3171
- declare const index$1_evalSource: typeof evalSource;
3172
- declare const index$1_harnessLoop: typeof harnessLoop;
3173
- declare const index$1_harnessProfile: typeof harnessProfile;
3174
- declare const index$1_harnessTrace: typeof harnessTrace;
3175
- declare const index$1_notifyEffect: typeof notifyEffect;
3176
- declare const index$1_priorityScore: typeof priorityScore;
3177
- declare const index$1_strategyKey: typeof strategyKey;
3178
- declare const index$1_strategyModel: typeof strategyModel;
3179
- declare namespace index$1 {
3180
- export { type index$1_CodeChange as CodeChange, type index$1_CodeChangeBridgeOptions as CodeChangeBridgeOptions, index$1_DEFAULT_DECAY_RATE as DEFAULT_DECAY_RATE, index$1_DEFAULT_QUEUE_CONFIGS as DEFAULT_QUEUE_CONFIGS, index$1_DEFAULT_SEVERITY_WEIGHTS as DEFAULT_SEVERITY_WEIGHTS, type index$1_ErrorClass as ErrorClass, type index$1_ErrorClassifier as ErrorClassifier, type index$1_EvalDelta as EvalDelta, type index$1_EvalIntakeBridgeOptions as EvalIntakeBridgeOptions, type index$1_EvalJudgeScore as EvalJudgeScore, type index$1_EvalResult as EvalResult, type index$1_EvalTaskDelta as EvalTaskDelta, type index$1_EvalTaskResult as EvalTaskResult, type index$1_ExecuteOutput as ExecuteOutput, type index$1_ExecutionResult as ExecutionResult, index$1_HarnessGraph as HarnessGraph, type index$1_HarnessLoopOptions as HarnessLoopOptions, type index$1_HarnessProfileResult as HarnessProfileResult, type index$1_HarnessTraceHandle as HarnessTraceHandle, type index$1_HarnessTraceOptions as HarnessTraceOptions, type index$1_IntakeBridgeOptions as IntakeBridgeOptions, type index$1_IntakeItem as IntakeItem, type index$1_IntakeSource as IntakeSource, type index$1_Intervention as Intervention, type index$1_LintError as LintError, type index$1_NotifyEffectOptions as NotifyEffectOptions, type index$1_NotifyTransport as NotifyTransport, type index$1_PrioritySignals as PrioritySignals, index$1_QUEUE_NAMES as QUEUE_NAMES, type index$1_QueueConfig as QueueConfig, type index$1_QueueRoute as QueueRoute, type index$1_RootCause as RootCause, type index$1_Severity as Severity, type index$1_StrategyEntry as StrategyEntry, type index$1_StrategyKey as StrategyKey, type index$1_StrategyModelBundle as StrategyModelBundle, type index$1_StrategySnapshot as StrategySnapshot, type index$1_TestFailure as TestFailure, type index$1_TraceDetail as TraceDetail, type index$1_TraceEvent as TraceEvent, type index$1_TraceEventType as TraceEventType, type index$1_TriagedItem as TriagedItem, type index$1_VerifyResult as VerifyResult, index$1_affectedTaskFilter as affectedTaskFilter, index$1_beforeAfterCompare as beforeAfterCompare, index$1_codeChangeBridge as codeChangeBridge, index$1_createIntakeBridge as createIntakeBridge, index$1_defaultErrorClassifier as defaultErrorClassifier, index$1_evalIntakeBridge as evalIntakeBridge, index$1_evalSource as evalSource, index$1_harnessLoop as harnessLoop, index$1_harnessProfile as harnessProfile, index$1_harnessTrace as harnessTrace, index$1_notifyEffect as notifyEffect, index$1_priorityScore as priorityScore, index$1_strategyKey as strategyKey, index$1_strategyModel as strategyModel };
2922
+ type index$2_CodeChange = CodeChange;
2923
+ type index$2_CodeChangeBridgeOptions = CodeChangeBridgeOptions;
2924
+ declare const index$2_DEFAULT_DECAY_RATE: typeof DEFAULT_DECAY_RATE;
2925
+ declare const index$2_DEFAULT_QUEUE_CONFIGS: typeof DEFAULT_QUEUE_CONFIGS;
2926
+ declare const index$2_DEFAULT_SEVERITY_WEIGHTS: typeof DEFAULT_SEVERITY_WEIGHTS;
2927
+ type index$2_ErrorClass = ErrorClass;
2928
+ type index$2_ErrorClassifier = ErrorClassifier;
2929
+ type index$2_EvalDelta = EvalDelta;
2930
+ type index$2_EvalIntakeBridgeOptions = EvalIntakeBridgeOptions;
2931
+ type index$2_EvalJudgeScore = EvalJudgeScore;
2932
+ type index$2_EvalResult = EvalResult;
2933
+ type index$2_EvalTaskDelta = EvalTaskDelta;
2934
+ type index$2_EvalTaskResult = EvalTaskResult;
2935
+ type index$2_ExecuteOutput = ExecuteOutput;
2936
+ type index$2_ExecutionResult = ExecutionResult;
2937
+ type index$2_HarnessGraph = HarnessGraph;
2938
+ declare const index$2_HarnessGraph: typeof HarnessGraph;
2939
+ type index$2_HarnessLoopOptions = HarnessLoopOptions;
2940
+ type index$2_HarnessProfileResult = HarnessProfileResult;
2941
+ type index$2_HarnessTraceHandle = HarnessTraceHandle;
2942
+ type index$2_HarnessTraceOptions = HarnessTraceOptions;
2943
+ type index$2_IntakeBridgeOptions = IntakeBridgeOptions;
2944
+ type index$2_IntakeItem = IntakeItem;
2945
+ type index$2_IntakeSource = IntakeSource;
2946
+ type index$2_Intervention = Intervention;
2947
+ type index$2_LintError = LintError;
2948
+ type index$2_NotifyEffectOptions = NotifyEffectOptions;
2949
+ type index$2_NotifyTransport<T> = NotifyTransport<T>;
2950
+ type index$2_PrioritySignals = PrioritySignals;
2951
+ declare const index$2_QUEUE_NAMES: typeof QUEUE_NAMES;
2952
+ type index$2_QueueConfig = QueueConfig;
2953
+ type index$2_QueueRoute = QueueRoute;
2954
+ type index$2_RootCause = RootCause;
2955
+ type index$2_Severity = Severity;
2956
+ type index$2_StrategyEntry = StrategyEntry;
2957
+ type index$2_StrategyKey = StrategyKey;
2958
+ type index$2_StrategyModelBundle = StrategyModelBundle;
2959
+ type index$2_StrategySnapshot = StrategySnapshot;
2960
+ type index$2_TestFailure = TestFailure;
2961
+ type index$2_TraceDetail = TraceDetail;
2962
+ type index$2_TraceEvent = TraceEvent;
2963
+ type index$2_TraceEventType = TraceEventType;
2964
+ type index$2_TriagedItem = TriagedItem;
2965
+ type index$2_VerifyResult = VerifyResult;
2966
+ declare const index$2_affectedTaskFilter: typeof affectedTaskFilter;
2967
+ declare const index$2_beforeAfterCompare: typeof beforeAfterCompare;
2968
+ declare const index$2_codeChangeBridge: typeof codeChangeBridge;
2969
+ declare const index$2_createIntakeBridge: typeof createIntakeBridge;
2970
+ declare const index$2_defaultErrorClassifier: typeof defaultErrorClassifier;
2971
+ declare const index$2_evalIntakeBridge: typeof evalIntakeBridge;
2972
+ declare const index$2_evalSource: typeof evalSource;
2973
+ declare const index$2_harnessLoop: typeof harnessLoop;
2974
+ declare const index$2_harnessProfile: typeof harnessProfile;
2975
+ declare const index$2_harnessTrace: typeof harnessTrace;
2976
+ declare const index$2_notifyEffect: typeof notifyEffect;
2977
+ declare const index$2_priorityScore: typeof priorityScore;
2978
+ declare const index$2_strategyKey: typeof strategyKey;
2979
+ declare const index$2_strategyModel: typeof strategyModel;
2980
+ declare namespace index$2 {
2981
+ export { type index$2_CodeChange as CodeChange, type index$2_CodeChangeBridgeOptions as CodeChangeBridgeOptions, index$2_DEFAULT_DECAY_RATE as DEFAULT_DECAY_RATE, index$2_DEFAULT_QUEUE_CONFIGS as DEFAULT_QUEUE_CONFIGS, index$2_DEFAULT_SEVERITY_WEIGHTS as DEFAULT_SEVERITY_WEIGHTS, type index$2_ErrorClass as ErrorClass, type index$2_ErrorClassifier as ErrorClassifier, type index$2_EvalDelta as EvalDelta, type index$2_EvalIntakeBridgeOptions as EvalIntakeBridgeOptions, type index$2_EvalJudgeScore as EvalJudgeScore, type index$2_EvalResult as EvalResult, type index$2_EvalTaskDelta as EvalTaskDelta, type index$2_EvalTaskResult as EvalTaskResult, type index$2_ExecuteOutput as ExecuteOutput, type index$2_ExecutionResult as ExecutionResult, index$2_HarnessGraph as HarnessGraph, type index$2_HarnessLoopOptions as HarnessLoopOptions, type index$2_HarnessProfileResult as HarnessProfileResult, type index$2_HarnessTraceHandle as HarnessTraceHandle, type index$2_HarnessTraceOptions as HarnessTraceOptions, type index$2_IntakeBridgeOptions as IntakeBridgeOptions, type index$2_IntakeItem as IntakeItem, type index$2_IntakeSource as IntakeSource, type index$2_Intervention as Intervention, type index$2_LintError as LintError, type index$2_NotifyEffectOptions as NotifyEffectOptions, type index$2_NotifyTransport as NotifyTransport, type index$2_PrioritySignals as PrioritySignals, index$2_QUEUE_NAMES as QUEUE_NAMES, type index$2_QueueConfig as QueueConfig, type index$2_QueueRoute as QueueRoute, type index$2_RootCause as RootCause, type index$2_Severity as Severity, type index$2_StrategyEntry as StrategyEntry, type index$2_StrategyKey as StrategyKey, type index$2_StrategyModelBundle as StrategyModelBundle, type index$2_StrategySnapshot as StrategySnapshot, type index$2_TestFailure as TestFailure, type index$2_TraceDetail as TraceDetail, type index$2_TraceEvent as TraceEvent, type index$2_TraceEventType as TraceEventType, type index$2_TriagedItem as TriagedItem, type index$2_VerifyResult as VerifyResult, index$2_affectedTaskFilter as affectedTaskFilter, index$2_beforeAfterCompare as beforeAfterCompare, index$2_codeChangeBridge as codeChangeBridge, index$2_createIntakeBridge as createIntakeBridge, index$2_defaultErrorClassifier as defaultErrorClassifier, index$2_evalIntakeBridge as evalIntakeBridge, index$2_evalSource as evalSource, index$2_harnessLoop as harnessLoop, index$2_harnessProfile as harnessProfile, index$2_harnessTrace as harnessTrace, index$2_notifyEffect as notifyEffect, index$2_priorityScore as priorityScore, index$2_strategyKey as strategyKey, index$2_strategyModel as strategyModel };
2982
+ }
2983
+
2984
+ /** Aggregate topology stats emitted by {@link LensGraph.stats}. */
2985
+ interface TopologyStats {
2986
+ /** Total primary nodes across this graph and all transitively mounted subgraphs. */
2987
+ nodeCount: number;
2988
+ /** Total directed edges (derived from deps; no duplicates). */
2989
+ edgeCount: number;
2990
+ /** Count of mounted subgraphs (transitive). */
2991
+ subgraphCount: number;
2992
+ /** Qualified paths with no upstream deps (source nodes). Sorted. */
2993
+ sources: readonly string[];
2994
+ /** Qualified paths with no downstream consumers in-graph (sink nodes). Sorted. */
2995
+ sinks: readonly string[];
2996
+ /** Longest path from any source to any sink (in edges). `0` for empty graphs. */
2997
+ depth: number;
2998
+ /** `true` if the dep DAG contains a cycle (feedback edge). */
2999
+ hasCycles: boolean;
3000
+ }
3001
+ /** A single health problem entry. */
3002
+ interface HealthProblem {
3003
+ path: string;
3004
+ /** V1 only reports `"errored"`. Future versions may add `"completed"`, `"disconnected"`. */
3005
+ status: "errored";
3006
+ /** First errored upstream ancestor along the dep chain, when one exists and is distinct from `path`. */
3007
+ upstreamCause?: string;
3008
+ }
3009
+ /** Aggregate health snapshot. `ok=true` iff `problems.length === 0`. */
3010
+ interface HealthReport {
3011
+ ok: boolean;
3012
+ problems: readonly HealthProblem[];
3013
+ }
3014
+ /** One per-path flow entry stored in {@link LensGraph.flow}. */
3015
+ interface FlowEntry {
3016
+ path: string;
3017
+ /** Cumulative DATA emissions observed since the lens activated. */
3018
+ count: number;
3019
+ /** `monotonicNs()` at the most recent DATA emission, or `null` if none yet. */
3020
+ lastUpdate_ns: number | null;
3021
+ }
3022
+ /** Options for {@link graphLens}. */
3023
+ interface GraphLensOptions {
3024
+ name?: string;
3025
+ graph?: GraphOptions;
3026
+ /**
3027
+ * Limit which node paths `flow` tracks. When omitted, every path in
3028
+ * `target.describe()` is observed. Recommended for graphs with hundreds
3029
+ * of nodes since each tracked path adds one observe-event dispatch per
3030
+ * DATA emission.
3031
+ */
3032
+ pathFilter?: (path: string) => boolean;
3033
+ /**
3034
+ * LRU cap on the {@link LensGraph.flow} map. When set, the flow tracker
3035
+ * evicts least-recently-used paths (by insertion / set order) once the
3036
+ * entry count exceeds this bound. Omit for unbounded (not recommended
3037
+ * for long-running graphs with churning paths). Passed through to the
3038
+ * underlying {@link reactiveMap}'s `maxSize`.
3039
+ */
3040
+ maxFlowPaths?: number;
3041
+ }
3042
+ /**
3043
+ * Reactive observability surface for a target {@link Graph}.
3044
+ * See {@link graphLens}.
3045
+ *
3046
+ * @category observability
3047
+ */
3048
+ declare class LensGraph extends Graph {
3049
+ /**
3050
+ * Aggregate structural stats — `nodeCount`, `edgeCount`, `sources`,
3051
+ * `sinks`, `depth`, `hasCycles`, `subgraphCount`. Recomputes on every
3052
+ * structural change via {@link watchTopologyTree} (transitive).
3053
+ *
3054
+ * Named `stats` (not `topology`) because `Graph.topology` already names
3055
+ * the raw `TopologyEvent` stream on every graph including `LensGraph`;
3056
+ * giving the lens its own `topology` accessor with an incompatible
3057
+ * `Node<TopologyStats>` type would break Liskov substitutability.
3058
+ */
3059
+ readonly stats: Node<TopologyStats>;
3060
+ readonly health: Node<HealthReport>;
3061
+ /**
3062
+ * Per-path flow tracker — a live {@link ReactiveMapBundle} keyed by
3063
+ * qualified path. Use `.get(path)` / `.has(path)` / `.size` for O(1)
3064
+ * sync queries; subscribe to `.entries` for a reactive snapshot of the
3065
+ * whole map. Lazy — the snapshot is materialized only while `.entries`
3066
+ * has subscribers.
3067
+ *
3068
+ * Shape intentionally differs from `stats` / `health` (which are plain
3069
+ * `Node<Report>`) because `flow` is a keyed collection, not a single
3070
+ * aggregate value. The map shape exposes cheaper queries than any
3071
+ * snapshot-based design.
3072
+ */
3073
+ readonly flow: ReactiveMapBundle<string, FlowEntry>;
3074
+ private readonly _target;
3075
+ constructor(target: Graph, opts?: GraphLensOptions);
3076
+ /**
3077
+ * Live causal chain from `from` to `to`. Recomputes whenever the target
3078
+ * mutates. Disposed automatically when the lens is destroyed.
3079
+ *
3080
+ * **Lifetime note:** every call to `why()` registers a lens-owned disposer
3081
+ * that runs on `lens.destroy()`. The returned `dispose` function releases
3082
+ * the internal subscription but does NOT remove the lens-owned disposer —
3083
+ * so heavy calling (e.g. per render frame) accumulates no-op disposers
3084
+ * until lens teardown. Cache the returned handle for long-lived queries.
3085
+ *
3086
+ * @param from - Qualified path of the upstream endpoint.
3087
+ * @param to - Qualified path of the downstream endpoint.
3088
+ * @param opts - See {@link reactiveExplainPath}.
3089
+ */
3090
+ why(from: string, to: string, opts?: {
3091
+ maxDepth?: number;
3092
+ name?: string;
3093
+ findCycle?: boolean;
3094
+ }): {
3095
+ node: Node<CausalChain>;
3096
+ dispose: () => void;
3097
+ };
3098
+ /** Reference to the lensed graph. */
3099
+ get target(): Graph;
3100
+ }
3101
+ /**
3102
+ * Create a reactive observability lens over a {@link Graph}. Returns a
3103
+ * {@link LensGraph} with three reactive surfaces (`stats`, `health`, `flow`)
3104
+ * plus the `why(from, to)` method.
3105
+ *
3106
+ * The returned graph is detached. Mount it via `target.mount("lens", lens)`
3107
+ * if you want it to appear in the target's `describe()`, or keep it standalone.
3108
+ *
3109
+ * @param target - The graph to observe.
3110
+ * @param opts - See {@link GraphLensOptions}.
3111
+ *
3112
+ * @example
3113
+ * ```ts
3114
+ * const g = new Graph("app");
3115
+ * g.add("counter", state(0));
3116
+ * const lens = graphLens(g);
3117
+ * lens.stats.subscribe((msgs) => console.log(msgs[0]?.[1])); // TopologyStats
3118
+ * // Flow queries — O(1) without subscribing to snapshots:
3119
+ * lens.flow.get("counter"); // FlowEntry | undefined
3120
+ * lens.flow.size; // number
3121
+ * lens.flow.entries.subscribe(...); // reactive snapshot, lazy-materialized
3122
+ * ```
3123
+ *
3124
+ * @category observability
3125
+ */
3126
+ declare function graphLens(target: Graph, opts?: GraphLensOptions): LensGraph;
3127
+
3128
+ type lens_FlowEntry = FlowEntry;
3129
+ type lens_GraphLensOptions = GraphLensOptions;
3130
+ type lens_HealthProblem = HealthProblem;
3131
+ type lens_HealthReport = HealthReport;
3132
+ type lens_LensGraph = LensGraph;
3133
+ declare const lens_LensGraph: typeof LensGraph;
3134
+ type lens_TopologyStats = TopologyStats;
3135
+ declare const lens_graphLens: typeof graphLens;
3136
+ declare const lens_watchTopologyTree: typeof watchTopologyTree;
3137
+ declare namespace lens {
3138
+ export { type lens_FlowEntry as FlowEntry, type lens_GraphLensOptions as GraphLensOptions, type lens_HealthProblem as HealthProblem, type lens_HealthReport as HealthReport, lens_LensGraph as LensGraph, type lens_TopologyStats as TopologyStats, lens_graphLens as graphLens, lens_watchTopologyTree as watchTopologyTree };
3181
3139
  }
3182
3140
 
3183
3141
  /**
@@ -3399,20 +3357,421 @@ declare namespace reduction {
3399
3357
  export { type reduction_BudgetConstraint as BudgetConstraint, type reduction_BudgetGateOptions as BudgetGateOptions, type reduction_EffectivenessEntry as EffectivenessEntry, type reduction_EffectivenessSnapshot as EffectivenessSnapshot, type reduction_EffectivenessTrackerBundle as EffectivenessTrackerBundle, type reduction_EffectivenessTrackerOptions as EffectivenessTrackerOptions, type reduction_FeedbackOptions as FeedbackOptions, type reduction_FunnelOptions as FunnelOptions, type reduction_FunnelStage as FunnelStage, type reduction_ScoredItem as ScoredItem, type reduction_ScorerOptions as ScorerOptions, type reduction_StepRef as StepRef, type reduction_StratifyOptions as StratifyOptions, type reduction_StratifyRule as StratifyRule, reduction_budgetGate as budgetGate, reduction_effectivenessTracker as effectivenessTracker, reduction_feedback as feedback, reduction_funnel as funnel, reduction_scorer as scorer, reduction_stratify as stratify };
3400
3358
  }
3401
3359
 
3360
+ /**
3361
+ * Resilience composition with correct nesting order (roadmap §9.0b).
3362
+ *
3363
+ * {@link resilientPipeline} composes the resilience primitives from
3364
+ * `extra/resilience.ts` in the order discovered during the §9.1 eval runs:
3365
+ *
3366
+ * ```text
3367
+ * rateLimit → budget → breaker → timeout → retry → fallback → status
3368
+ * ```
3369
+ *
3370
+ * Note on retry/timeout ordering: `timeout` is applied BEFORE `retry` so each
3371
+ * retry attempt resubscribes to a fresh deadline (per-attempt semantics). If
3372
+ * `timeout` wrapped `retry`, a single deadline would apply to the entire
3373
+ * retry chain — not what callers expect.
3374
+ *
3375
+ * Every step is optional — omit the option and that layer is skipped. The
3376
+ * returned bundle exposes the final `Node<T>` plus the status/error/breaker
3377
+ * companions so callers can wire them into dashboards, alerts, or
3378
+ * {@link graphLens}.
3379
+ *
3380
+ * Subsumes the pre-1.0 `resilientFetch` template — that template becomes a
3381
+ * preconfigured instance of this factory for the HTTP fetch case.
3382
+ *
3383
+ * @module
3384
+ */
3385
+
3386
+ /** Options for {@link resilientPipeline}. Every field is optional — omit to skip that layer. */
3387
+ interface ResilientPipelineOptions<T> {
3388
+ /** Admission control — at most `maxEvents` DATA per `windowNs`. See {@link rateLimiter}. */
3389
+ rateLimit?: RateLimiterOptions;
3390
+ /** Cost/constraint gate. See {@link budgetGate}. */
3391
+ budget?: ReadonlyArray<BudgetConstraint>;
3392
+ /** Circuit breaker — fail-fast when the downstream resource is unhealthy. See {@link circuitBreaker}. */
3393
+ breaker?: CircuitBreakerOptions;
3394
+ /**
3395
+ * Behavior when the breaker is open:
3396
+ * - `"skip"` — emit RESOLVED (default, lets downstream drop the beat)
3397
+ * - `"error"` — emit a `CircuitOpenError` so `retry`/`fallback` can react
3398
+ *
3399
+ * Only used when `breaker` is provided.
3400
+ */
3401
+ breakerOnOpen?: "skip" | "error";
3402
+ /** Retry policy on terminal ERROR. See {@link retry}. */
3403
+ retry?: RetryOptions;
3404
+ /**
3405
+ * Per-attempt deadline in milliseconds. Converted to ns internally. Omit to skip the timeout wrap.
3406
+ *
3407
+ * Specified in ms (not ns) because callers consistently think in millisecond deadlines;
3408
+ * retry/breaker/ratelimit options take ns to match their primitives exactly.
3409
+ */
3410
+ timeoutMs?: number;
3411
+ /** Final fallback value emitted on terminal ERROR after retry exhausts. See {@link fallback}. */
3412
+ fallback?: FallbackInput<T>;
3413
+ /** Initial status reported by the status node. Default `"pending"`. */
3414
+ initialStatus?: StatusValue;
3415
+ }
3416
+ /** Output bundle of {@link resilientPipeline}. */
3417
+ interface ResilientPipelineBundle<T> {
3418
+ /** The final resilient node. Subscribe to this for DATA emissions. */
3419
+ node: Node<T>;
3420
+ /** Live status: `"pending" | "active" | "completed" | "errored"`. */
3421
+ status: Node<StatusValue>;
3422
+ /** Last error payload, or `null` when not errored. */
3423
+ error: Node<unknown | null>;
3424
+ /** Breaker state when `opts.breaker` was provided; `undefined` otherwise. */
3425
+ breakerState: Node<CircuitState> | undefined;
3426
+ }
3427
+ /**
3428
+ * Compose a resilient pipeline around `source` in the canonical nesting
3429
+ * order — `rateLimit → budget → breaker → timeout → retry → fallback → status`.
3430
+ * Omit any option to skip that layer.
3431
+ *
3432
+ * @param source - Upstream node to wrap.
3433
+ * @param opts - See {@link ResilientPipelineOptions}. All fields optional.
3434
+ *
3435
+ * @example
3436
+ * ```ts
3437
+ * const safeFetch = resilientPipeline(fetchNode, {
3438
+ * rateLimit: { maxEvents: 10, windowNs: NS_PER_SEC },
3439
+ * breaker: { failureThreshold: 5 },
3440
+ * retry: { count: 3, backoff: "exponential" },
3441
+ * timeoutMs: 10_000,
3442
+ * fallback: null,
3443
+ * });
3444
+ * safeFetch.status.subscribe(msgs => console.log(msgs));
3445
+ * ```
3446
+ *
3447
+ * @category patterns
3448
+ */
3449
+ declare function resilientPipeline<T>(source: Node<T>, opts?: ResilientPipelineOptions<T>): ResilientPipelineBundle<T>;
3450
+
3451
+ declare const resilientPipeline$1_NS_PER_MS: typeof NS_PER_MS;
3452
+ declare const resilientPipeline$1_NS_PER_SEC: typeof NS_PER_SEC;
3453
+ type resilientPipeline$1_ResilientPipelineBundle<T> = ResilientPipelineBundle<T>;
3454
+ type resilientPipeline$1_ResilientPipelineOptions<T> = ResilientPipelineOptions<T>;
3455
+ declare const resilientPipeline$1_resilientPipeline: typeof resilientPipeline;
3456
+ declare namespace resilientPipeline$1 {
3457
+ export { resilientPipeline$1_NS_PER_MS as NS_PER_MS, resilientPipeline$1_NS_PER_SEC as NS_PER_SEC, type resilientPipeline$1_ResilientPipelineBundle as ResilientPipelineBundle, type resilientPipeline$1_ResilientPipelineOptions as ResilientPipelineOptions, resilientPipeline$1_resilientPipeline as resilientPipeline };
3458
+ }
3459
+
3460
+ /**
3461
+ * Surface: create a graph from a {@link GraphSpec} (§9.3-core).
3462
+ *
3463
+ * Thin wrapper over {@link compileSpec} that converts the two failure modes
3464
+ * ({@link validateSpec} structural errors, and catalog-aware validation
3465
+ * errors) into typed {@link SurfaceError} throws. Consumers are MCP/CLI
3466
+ * wrappers, not end-user graph code — those should import `compileSpec`
3467
+ * directly.
3468
+ *
3469
+ * @module
3470
+ */
3471
+
3472
+ /** Options for {@link createGraph}. Same shape as {@link CompileSpecOptions}. */
3473
+ type CreateGraphOptions = CompileSpecOptions;
3474
+ /**
3475
+ * Build a {@link Graph} from a parsed {@link GraphSpec} with surface-layer
3476
+ * error typing.
3477
+ *
3478
+ * @throws {SurfaceError} `invalid-spec` for structural errors;
3479
+ * `catalog-error` when fn/source names or config don't match the catalog.
3480
+ */
3481
+ declare function createGraph(spec: GraphSpec, opts?: CreateGraphOptions): Graph;
3482
+
3483
+ /**
3484
+ * Typed errors for the surface layer (§9.3-core).
3485
+ *
3486
+ * The surface layer is consumed by `@graphrefly/mcp-server` and
3487
+ * `@graphrefly/cli`. Both have native error channels (MCP's `isError` flag,
3488
+ * CLI's exit codes), so surface functions throw a {@link SurfaceError}
3489
+ * carrying a structured code + details payload that wrappers can map to
3490
+ * their native shape. No `Result` envelope — keep the callsite idiom
3491
+ * `try/catch` and let each wrapper surface the error its own way.
3492
+ *
3493
+ * @module
3494
+ */
3495
+ /** Structured error codes emitted by the surface layer. JSON-safe. */
3496
+ type SurfaceErrorCode = "invalid-spec" | "graph-not-found" | "graph-exists" | "snapshot-not-found" | "node-not-found" | "reduce-timeout" | "catalog-error" | "restore-failed" | "snapshot-failed" | "tier-no-list" | "internal-error";
3497
+ /** JSON-safe shape surfaces should echo back through the wrapper. */
3498
+ interface SurfaceErrorPayload {
3499
+ code: SurfaceErrorCode;
3500
+ message: string;
3501
+ /** Optional structured detail; must be JSON-safe. */
3502
+ details?: Readonly<Record<string, unknown>>;
3503
+ }
3504
+ /**
3505
+ * Thrown by surface layer functions on failure. `code` is the stable
3506
+ * machine-readable identifier; `details` carries structured context
3507
+ * (e.g. `validateSpec` errors, missing path name). Both fields round-trip
3508
+ * through `toJSON()` for wrappers that serialize errors over the wire.
3509
+ */
3510
+ declare class SurfaceError extends Error {
3511
+ readonly code: SurfaceErrorCode;
3512
+ readonly details?: Readonly<Record<string, unknown>>;
3513
+ constructor(code: SurfaceErrorCode, message: string, details?: Readonly<Record<string, unknown>>);
3514
+ /**
3515
+ * JSON-safe payload for wire serialization. Defensively validates
3516
+ * `details` — if it can't be round-tripped through `JSON.stringify`
3517
+ * (cyclic refs, `BigInt`, `Error` instance not pre-toJSON'd), the
3518
+ * payload falls back to `{code, message}` only rather than crashing
3519
+ * the MCP/CLI wrapper when it serializes this error onto the wire.
3520
+ */
3521
+ toJSON(): SurfaceErrorPayload;
3522
+ }
3523
+ /** Wrap any thrown value as a SurfaceError. Idempotent on existing SurfaceError. */
3524
+ declare function asSurfaceError(err: unknown, fallbackCode?: SurfaceErrorCode): SurfaceError;
3525
+
3526
+ /**
3527
+ * Surface: one-shot `input → pipeline → output` (§9.3-core).
3528
+ *
3529
+ * `runReduction` compiles a {@link GraphSpec}, pushes an input value to a
3530
+ * named state node, awaits the first post-push DATA emission on a named
3531
+ * output, then disposes the graph. Stateless per call — no graphId, no
3532
+ * registry.
3533
+ *
3534
+ * Named `runReduction` (not `reduce`) to avoid collision with the
3535
+ * reactive {@link reduce} operator in `extra/operators.ts`. The MCP tool
3536
+ * name (`graphrefly_reduce`) and CLI subcommand (`graphrefly reduce`) use
3537
+ * the short form; the library export carries the verb.
3538
+ *
3539
+ * The subscribe-before-push ordering is deliberate. `graph.set` propagates
3540
+ * synchronously for sync derived/operator chains; for async sources
3541
+ * (`fromPromise`, `fromAsyncIter`, LLM adapters) the first post-push DATA
3542
+ * arrives on a later tick. Subscribing before the push catches both, and
3543
+ * skipping the priming push-on-subscribe emission avoids resolving with the
3544
+ * stale pre-push cache (spec §2.2).
3545
+ *
3546
+ * @module
3547
+ */
3548
+
3549
+ /** Options for {@link reduce}. */
3550
+ interface ReduceOptions {
3551
+ /** Fn/source catalog for {@link createGraph}. */
3552
+ catalog?: GraphSpecCatalog;
3553
+ /** Path of the state node that receives the input. Default `"input"`. */
3554
+ inputPath?: string;
3555
+ /** Path of the node whose first post-push DATA is the result. Default `"output"`. */
3556
+ outputPath?: string;
3557
+ /** Hard deadline in milliseconds. Default `30_000`. */
3558
+ timeoutMs?: number;
3559
+ }
3560
+ /**
3561
+ * Run a spec as a one-shot reduction: `input → graph → output`.
3562
+ *
3563
+ * Resolves on the first `[DATA, v]` **or** `[RESOLVED]` emitted by
3564
+ * `outputPath` after the input push. The RESOLVED path handles spec
3565
+ * §1.3.3 equals-substitution (output recomputed to a value equal to its
3566
+ * cache, so the graph skips the DATA push) by returning `outputNode.cache`
3567
+ * — the caller always gets the settled value, never hangs on idempotent
3568
+ * inputs.
3569
+ *
3570
+ * @throws {SurfaceError} `invalid-spec` / `catalog-error` (propagated from
3571
+ * {@link createGraph}), `node-not-found` when `inputPath`/`outputPath`
3572
+ * can't be resolved, `reduce-timeout` when `timeoutMs` elapses without
3573
+ * a post-push emission, or the ERROR payload from the graph re-thrown
3574
+ * as `internal-error`.
3575
+ */
3576
+ declare function runReduction(spec: GraphSpec, input: unknown, opts?: ReduceOptions): Promise<unknown>;
3577
+
3578
+ /**
3579
+ * Surface: snapshot save/restore/diff/list over {@link StorageTier} (§9.3-core).
3580
+ *
3581
+ * One-shot snapshot management for stateless callers (MCP tools, CLI
3582
+ * commands) layered on the existing multi-tier auto-checkpoint substrate.
3583
+ * A saved snapshot is a `mode: "full"` {@link GraphCheckpointRecord} with
3584
+ * `seq: 0` — byte-identical to the baseline anchor
3585
+ * {@link Graph.attachStorage} writes on its first flush. An
3586
+ * auto-checkpointed graph can therefore be restored through this surface,
3587
+ * and a surface-saved snapshot can be picked up by `attachStorage({
3588
+ * autoRestore: true })`.
3589
+ *
3590
+ * The wire envelope stays at {@link SNAPSHOT_WIRE_VERSION}; no new format.
3591
+ *
3592
+ * @module
3593
+ */
3594
+
3595
+ /**
3596
+ * Current envelope version. Re-exported from `graph.ts` so the one-shot
3597
+ * surface path and `Graph.attachStorage` write byte-identical
3598
+ * `format_version` fields — no silent wire drift.
3599
+ */
3600
+ declare const SNAPSHOT_WIRE_VERSION = 1;
3601
+ /** Shape returned by {@link saveSnapshot}. */
3602
+ interface SaveSnapshotResult {
3603
+ snapshotId: string;
3604
+ timestamp_ns: number;
3605
+ }
3606
+ /** Options for {@link restoreSnapshot}. */
3607
+ interface RestoreSnapshotOptions {
3608
+ /** Passthrough to `Graph.fromSnapshot`. First matching pattern wins. */
3609
+ factories?: Record<string, GraphNodeFactory>;
3610
+ }
3611
+ /**
3612
+ * Write a graph's current state as a one-shot `mode: "full"` record.
3613
+ *
3614
+ * Uses the same {@link GraphCheckpointRecord} envelope as
3615
+ * {@link Graph.attachStorage} so the two persistence paths interoperate.
3616
+ *
3617
+ * @throws {SurfaceError} `snapshot-failed` when the tier's `save` throws.
3618
+ */
3619
+ declare function saveSnapshot(graph: Graph, snapshotId: string, tier: StorageTier): Promise<SaveSnapshotResult>;
3620
+ /**
3621
+ * Load a snapshot from a tier and materialize it as a new {@link Graph}.
3622
+ *
3623
+ * Uses {@link Graph.fromSnapshot} to reconstruct topology; pass
3624
+ * `factories` when the graph includes non-state nodes that the default
3625
+ * hydrator can't rebuild on its own.
3626
+ *
3627
+ * **Requires a `mode: "full"` record.** Surface-written snapshots from
3628
+ * {@link saveSnapshot} always qualify. Records written by
3629
+ * {@link Graph.attachStorage} with `compactEvery > 1` may be
3630
+ * `mode: "diff"` between compacts — those throw `restore-failed` until
3631
+ * the tier's next compact flush (or until Phase 8.7 WAL replay lands).
3632
+ * If you need interop during development, either call
3633
+ * {@link saveSnapshot} explicitly (always full) or configure
3634
+ * `attachStorage({compactEvery: 1})`.
3635
+ *
3636
+ * @throws {SurfaceError} `snapshot-not-found` on miss; `restore-failed`
3637
+ * when the payload shape doesn't match, when the record is
3638
+ * `mode: "diff"`, or when `Graph.fromSnapshot` rejects.
3639
+ */
3640
+ declare function restoreSnapshot(snapshotId: string, tier: StorageTier, opts?: RestoreSnapshotOptions): Promise<Graph>;
3641
+ /**
3642
+ * Load two snapshots and compute a {@link GraphDiffResult} via static
3643
+ * {@link Graph.diff}. Returns the audit shape (structural + value diff,
3644
+ * no payload); use {@link diffForWAL} directly for WAL-oriented diffs.
3645
+ *
3646
+ * @throws {SurfaceError} `snapshot-not-found` on either miss.
3647
+ */
3648
+ declare function diffSnapshots(snapshotIdA: string, snapshotIdB: string, tier: StorageTier): Promise<GraphDiffResult>;
3649
+ /**
3650
+ * Enumerate snapshot ids on a tier.
3651
+ *
3652
+ * **Scope caveat:** returns every key on the tier, not just those
3653
+ * written by {@link saveSnapshot}. When the same tier also backs
3654
+ * {@link Graph.attachStorage} (for auto-checkpoints keyed by
3655
+ * `graph.name`), those names appear in this list too. Wrappers that
3656
+ * want a namespaced snapshot store should use a dedicated tier or
3657
+ * encode an id prefix on write. Tracked in `docs/optimizations.md`
3658
+ * under "surface `listSnapshots` namespacing".
3659
+ *
3660
+ * @throws {SurfaceError} `tier-no-list` when the tier does not implement
3661
+ * the optional `list()` method. Check `typeof tier.list === "function"`
3662
+ * before calling if you want to branch on capability.
3663
+ */
3664
+ declare function listSnapshots(tier: StorageTier): Promise<readonly string[]>;
3665
+ /**
3666
+ * Delete a snapshot from a tier.
3667
+ *
3668
+ * Silent on miss (clear semantics). `tier.clear` is optional — throws
3669
+ * `snapshot-failed` when the tier is append-only.
3670
+ *
3671
+ * @throws {SurfaceError} `snapshot-failed` when `clear` is unsupported
3672
+ * or throws.
3673
+ */
3674
+ declare function deleteSnapshot(snapshotId: string, tier: StorageTier): Promise<void>;
3675
+
3676
+ /**
3677
+ * Surface layer (§9.3-core) — shared, JSON-safe operations consumed by
3678
+ * `@graphrefly/mcp-server` and `@graphrefly/cli`.
3679
+ *
3680
+ * The surface is a thin projection of existing Graph APIs (`describe`,
3681
+ * `observe`, `explain`, `snapshot`, `restore`, static `diff`), plus two
3682
+ * genuinely new operations:
3683
+ *
3684
+ * 1. {@link createGraph} — `compileSpec` wrapped with typed surface errors.
3685
+ * 2. {@link reduce} — one-shot `input → pipeline → output`.
3686
+ *
3687
+ * Snapshot persistence reuses the {@link StorageTier} substrate introduced
3688
+ * for `Graph.attachStorage`, so one-shot snapshots and auto-checkpoints
3689
+ * share the {@link GraphCheckpointRecord} envelope. No new wire format.
3690
+ *
3691
+ * Errors throw as {@link SurfaceError} — wrappers map to their native
3692
+ * error channel (MCP `isError`, CLI exit code). No `Result<T, E>` wrapper.
3693
+ *
3694
+ * @module
3695
+ */
3696
+
3697
+ type index$1_CatalogFnEntry = CatalogFnEntry;
3698
+ type index$1_CatalogSourceEntry = CatalogSourceEntry;
3699
+ type index$1_ConfigFieldSchema = ConfigFieldSchema;
3700
+ type index$1_CreateGraphOptions = CreateGraphOptions;
3701
+ type index$1_FnFactory = FnFactory;
3702
+ type index$1_GraphSpec = GraphSpec;
3703
+ type index$1_GraphSpecCatalog = GraphSpecCatalog;
3704
+ type index$1_GraphSpecFeedbackEdge = GraphSpecFeedbackEdge;
3705
+ type index$1_GraphSpecNode = GraphSpecNode;
3706
+ type index$1_GraphSpecTemplate = GraphSpecTemplate;
3707
+ type index$1_GraphSpecTemplateRef = GraphSpecTemplateRef;
3708
+ type index$1_GraphSpecValidation = GraphSpecValidation;
3709
+ type index$1_ReduceOptions = ReduceOptions;
3710
+ type index$1_RestoreSnapshotOptions = RestoreSnapshotOptions;
3711
+ declare const index$1_SNAPSHOT_WIRE_VERSION: typeof SNAPSHOT_WIRE_VERSION;
3712
+ type index$1_SaveSnapshotResult = SaveSnapshotResult;
3713
+ type index$1_SourceFactory = SourceFactory;
3714
+ type index$1_SurfaceError = SurfaceError;
3715
+ declare const index$1_SurfaceError: typeof SurfaceError;
3716
+ type index$1_SurfaceErrorCode = SurfaceErrorCode;
3717
+ type index$1_SurfaceErrorPayload = SurfaceErrorPayload;
3718
+ declare const index$1_asSurfaceError: typeof asSurfaceError;
3719
+ declare const index$1_createGraph: typeof createGraph;
3720
+ declare const index$1_deleteSnapshot: typeof deleteSnapshot;
3721
+ declare const index$1_diffSnapshots: typeof diffSnapshots;
3722
+ declare const index$1_listSnapshots: typeof listSnapshots;
3723
+ declare const index$1_restoreSnapshot: typeof restoreSnapshot;
3724
+ declare const index$1_runReduction: typeof runReduction;
3725
+ declare const index$1_saveSnapshot: typeof saveSnapshot;
3726
+ declare namespace index$1 {
3727
+ export { type index$1_CatalogFnEntry as CatalogFnEntry, type index$1_CatalogSourceEntry as CatalogSourceEntry, type index$1_ConfigFieldSchema as ConfigFieldSchema, type index$1_CreateGraphOptions as CreateGraphOptions, type index$1_FnFactory as FnFactory, type index$1_GraphSpec as GraphSpec, type index$1_GraphSpecCatalog as GraphSpecCatalog, type index$1_GraphSpecFeedbackEdge as GraphSpecFeedbackEdge, type index$1_GraphSpecNode as GraphSpecNode, type index$1_GraphSpecTemplate as GraphSpecTemplate, type index$1_GraphSpecTemplateRef as GraphSpecTemplateRef, type index$1_GraphSpecValidation as GraphSpecValidation, type index$1_ReduceOptions as ReduceOptions, type index$1_RestoreSnapshotOptions as RestoreSnapshotOptions, index$1_SNAPSHOT_WIRE_VERSION as SNAPSHOT_WIRE_VERSION, type index$1_SaveSnapshotResult as SaveSnapshotResult, type index$1_SourceFactory as SourceFactory, index$1_SurfaceError as SurfaceError, type index$1_SurfaceErrorCode as SurfaceErrorCode, type index$1_SurfaceErrorPayload as SurfaceErrorPayload, index$1_asSurfaceError as asSurfaceError, index$1_createGraph as createGraph, index$1_deleteSnapshot as deleteSnapshot, index$1_diffSnapshots as diffSnapshots, index$1_listSnapshots as listSnapshots, index$1_restoreSnapshot as restoreSnapshot, index$1_runReduction as runReduction, index$1_saveSnapshot as saveSnapshot };
3728
+ }
3729
+
3402
3730
  /**
3403
3731
  * Patterns layer: domain/solution helpers (Phase 4+).
3404
3732
  */
3405
3733
 
3734
+ type index_CatalogFnEntry = CatalogFnEntry;
3735
+ type index_CatalogSourceEntry = CatalogSourceEntry;
3736
+ type index_ConfigFieldSchema = ConfigFieldSchema;
3737
+ type index_CreateGraphOptions = CreateGraphOptions;
3738
+ type index_FnFactory = FnFactory;
3739
+ type index_GraphSpec = GraphSpec;
3740
+ type index_GraphSpecCatalog = GraphSpecCatalog;
3741
+ type index_GraphSpecFeedbackEdge = GraphSpecFeedbackEdge;
3742
+ type index_GraphSpecNode = GraphSpecNode;
3743
+ type index_GraphSpecTemplate = GraphSpecTemplate;
3744
+ type index_GraphSpecTemplateRef = GraphSpecTemplateRef;
3745
+ type index_GraphSpecValidation = GraphSpecValidation;
3746
+ type index_ReduceOptions = ReduceOptions;
3747
+ type index_RestoreSnapshotOptions = RestoreSnapshotOptions;
3748
+ declare const index_SNAPSHOT_WIRE_VERSION: typeof SNAPSHOT_WIRE_VERSION;
3749
+ type index_SaveSnapshotResult = SaveSnapshotResult;
3750
+ type index_SourceFactory = SourceFactory;
3751
+ type index_SurfaceError = SurfaceError;
3752
+ declare const index_SurfaceError: typeof SurfaceError;
3753
+ type index_SurfaceErrorCode = SurfaceErrorCode;
3754
+ type index_SurfaceErrorPayload = SurfaceErrorPayload;
3406
3755
  declare const index_ai: typeof ai;
3756
+ declare const index_asSurfaceError: typeof asSurfaceError;
3407
3757
  declare const index_cqrs: typeof cqrs;
3758
+ declare const index_createGraph: typeof createGraph;
3759
+ declare const index_deleteSnapshot: typeof deleteSnapshot;
3760
+ declare const index_demoShell: typeof demoShell;
3761
+ declare const index_diffSnapshots: typeof diffSnapshots;
3408
3762
  declare const index_domainTemplates: typeof domainTemplates;
3409
3763
  declare const index_graphspec: typeof graphspec;
3764
+ declare const index_lens: typeof lens;
3765
+ declare const index_listSnapshots: typeof listSnapshots;
3410
3766
  declare const index_memory: typeof memory;
3411
3767
  declare const index_messaging: typeof messaging;
3412
3768
  declare const index_orchestration: typeof orchestration;
3413
3769
  declare const index_reduction: typeof reduction;
3770
+ declare const index_restoreSnapshot: typeof restoreSnapshot;
3771
+ declare const index_runReduction: typeof runReduction;
3772
+ declare const index_saveSnapshot: typeof saveSnapshot;
3414
3773
  declare namespace index {
3415
- export { index_ai as ai, index_cqrs as cqrs, demoShell$1 as demoShell, index_domainTemplates as domainTemplates, index_graphspec as graphspec, index$1 as harness, index$c as layout, index_memory as memory, index_messaging as messaging, index_orchestration as orchestration, index_reduction as reduction };
3774
+ export { type index_CatalogFnEntry as CatalogFnEntry, type index_CatalogSourceEntry as CatalogSourceEntry, type index_ConfigFieldSchema as ConfigFieldSchema, type index_CreateGraphOptions as CreateGraphOptions, type index_FnFactory as FnFactory, type index_GraphSpec as GraphSpec, type index_GraphSpecCatalog as GraphSpecCatalog, type index_GraphSpecFeedbackEdge as GraphSpecFeedbackEdge, type index_GraphSpecNode as GraphSpecNode, type index_GraphSpecTemplate as GraphSpecTemplate, type index_GraphSpecTemplateRef as GraphSpecTemplateRef, type index_GraphSpecValidation as GraphSpecValidation, type index_ReduceOptions as ReduceOptions, type index_RestoreSnapshotOptions as RestoreSnapshotOptions, index_SNAPSHOT_WIRE_VERSION as SNAPSHOT_WIRE_VERSION, type index_SaveSnapshotResult as SaveSnapshotResult, type index_SourceFactory as SourceFactory, index_SurfaceError as SurfaceError, type index_SurfaceErrorCode as SurfaceErrorCode, type index_SurfaceErrorPayload as SurfaceErrorPayload, audit as accountability, index_ai as ai, index_asSurfaceError as asSurfaceError, index_cqrs as cqrs, index_createGraph as createGraph, index_deleteSnapshot as deleteSnapshot, index_demoShell as demoShell, index_diffSnapshots as diffSnapshots, index_domainTemplates as domainTemplates, index_graphspec as graphspec, guardedExecution$1 as guarded, index$2 as harness, index$3 as layout, index_lens as lens, index_listSnapshots as listSnapshots, index_memory as memory, index_messaging as messaging, index_orchestration as orchestration, index_reduction as reduction, resilientPipeline$1 as resilientPipeline, index_restoreSnapshot as restoreSnapshot, index_runReduction as runReduction, index_saveSnapshot as saveSnapshot, index$1 as surface };
3416
3775
  }
3417
3776
 
3418
3777
  /**
@@ -3420,4 +3779,4 @@ declare namespace index {
3420
3779
  */
3421
3780
  declare const version = "0.0.0";
3422
3781
 
3423
- export { Actor, DerivedFn, DistillBundle, Extraction, Graph, GraphAttachStorageOptions, GraphOptions, GraphProfileOptions, GraphProfileResult, Node, NodeActions, NodeInput, NodeOptions, StorageHandle, StorageTier, ai, index$2 as compat, cqrs, demoShell$1 as demoShell, domainTemplates, graphspec, index$1 as harness, index$a as jotai, index$c as layout, memory, messaging, index$9 as nanostores, index$b as nestjs, orchestration, index as patterns, index$8 as react, reduction, index$7 as signals, index$6 as solid, index$5 as svelte, version, index$4 as vue, index$3 as zustand };
3782
+ export { Actor, type CatalogFnEntry, type CatalogSourceEntry, CausalChain, CircuitBreakerOptions, CircuitState, type ConfigFieldSchema, type CreateGraphOptions, DerivedFn, DescribeFilter, DistillBundle, Extraction, FallbackInput, type FnFactory, Graph, GraphAttachStorageOptions, GraphDescribeOptions, GraphDescribeOutput, GraphDiffResult, GraphNodeFactory, GraphOptions, GraphPersistSnapshot, GraphProfileOptions, GraphProfileResult, type GraphSpec, type GraphSpecCatalog, type GraphSpecFeedbackEdge, type GraphSpecNode, type GraphSpecTemplate, type GraphSpecTemplateRef, type GraphSpecValidation, GuardAction, NS_PER_MS, NS_PER_SEC, Node, NodeActions, NodeInput, NodeOptions, PolicyRuleData, RateLimiterOptions, ReactiveMapBundle, type ReduceOptions, type RestoreSnapshotOptions, RetryOptions, SNAPSHOT_WIRE_VERSION, type SaveSnapshotResult, type SourceFactory, StatusValue, StorageHandle, StorageTier, SurfaceError, type SurfaceErrorCode, type SurfaceErrorPayload, audit as accountability, ai, asSurfaceError, cqrs, createGraph, deleteSnapshot, demoShell, diffSnapshots, domainTemplates, graphspec, guardedExecution$1 as guarded, index$2 as harness, index$3 as layout, lens, listSnapshots, memory, messaging, orchestration, index as patterns, reduction, resilientPipeline$1 as resilientPipeline, restoreSnapshot, runReduction, saveSnapshot, index$1 as surface, version, watchTopologyTree };