@graphrefly/graphrefly 0.26.0 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-CaR_912Q.d.cts +1033 -0
- package/dist/ai-WlRltJV7.d.ts +1033 -0
- package/dist/audit-ClmqGOCx.d.cts +245 -0
- package/dist/audit-DRlSzBu9.d.ts +245 -0
- package/dist/{chunk-JYXEWPH4.js → chunk-APFNLIRG.js} +2 -2
- package/dist/chunk-AT5LKYNL.js +395 -0
- package/dist/chunk-AT5LKYNL.js.map +1 -0
- package/dist/{chunk-AMCG74RZ.js → chunk-BQ6RQQFF.js} +215 -2128
- package/dist/chunk-BQ6RQQFF.js.map +1 -0
- package/dist/{chunk-IZYUSJC7.js → chunk-DST5DKZS.js} +6 -4
- package/dist/{chunk-IZYUSJC7.js.map → chunk-DST5DKZS.js.map} +1 -1
- package/dist/{chunk-LCE3GF5P.js → chunk-GTE6PWRZ.js} +2 -2
- package/dist/{chunk-RB6QPHJ7.js → chunk-J2VBW3DZ.js} +2 -93
- package/dist/chunk-J2VBW3DZ.js.map +1 -0
- package/dist/{chunk-FQMKGR6L.js → chunk-JWBCY4NC.js} +3 -3
- package/dist/chunk-K2AUJHVP.js +2251 -0
- package/dist/chunk-K2AUJHVP.js.map +1 -0
- package/dist/chunk-NC6S43JJ.js +456 -0
- package/dist/chunk-NC6S43JJ.js.map +1 -0
- package/dist/chunk-OFVJBJXR.js +98 -0
- package/dist/chunk-OFVJBJXR.js.map +1 -0
- package/dist/{chunk-6LDQFTYS.js → chunk-OU5CQKNW.js} +2 -2
- package/dist/{chunk-THTWHNU4.js → chunk-PF7GRZMW.js} +5 -5
- package/dist/chunk-RNHBMHKA.js +1665 -0
- package/dist/chunk-RNHBMHKA.js.map +1 -0
- package/dist/{chunk-SN4YWWYO.js → chunk-WBZOVTYK.js} +11 -11
- package/dist/chunk-WKNUIZOY.js +354 -0
- package/dist/chunk-WKNUIZOY.js.map +1 -0
- package/dist/{chunk-ZQMEI34O.js → chunk-X3VMZYBT.js} +3 -3
- package/dist/chunk-X5R3GL6H.js +525 -0
- package/dist/chunk-X5R3GL6H.js.map +1 -0
- package/dist/compat/index.d.cts +14 -14
- package/dist/compat/index.d.ts +14 -14
- package/dist/compat/index.js +17 -16
- package/dist/compat/jotai/index.d.cts +2 -2
- package/dist/compat/jotai/index.d.ts +2 -2
- package/dist/compat/nanostores/index.d.cts +2 -2
- package/dist/compat/nanostores/index.d.ts +2 -2
- package/dist/compat/nestjs/index.d.cts +6 -6
- package/dist/compat/nestjs/index.d.ts +6 -6
- package/dist/compat/nestjs/index.js +7 -6
- package/dist/compat/react/index.d.cts +2 -2
- package/dist/compat/react/index.d.ts +2 -2
- package/dist/compat/solid/index.d.cts +2 -2
- package/dist/compat/solid/index.d.ts +2 -2
- package/dist/compat/svelte/index.d.cts +2 -2
- package/dist/compat/svelte/index.d.ts +2 -2
- package/dist/compat/vue/index.d.cts +2 -2
- package/dist/compat/vue/index.d.ts +2 -2
- package/dist/compat/zustand/index.d.cts +5 -5
- package/dist/compat/zustand/index.d.ts +5 -5
- package/dist/compat/zustand/index.js +3 -3
- package/dist/composite-C7PcQvcs.d.cts +303 -0
- package/dist/composite-aUCvjZVR.d.ts +303 -0
- package/dist/core/index.d.cts +4 -3
- package/dist/core/index.d.ts +4 -3
- package/dist/{demo-shell-DEp-nMTl.d.ts → demo-shell-BDkOptd6.d.ts} +2 -2
- package/dist/{demo-shell-26p5fVxn.d.cts → demo-shell-Crid1WdR.d.cts} +2 -2
- package/dist/extra/index.d.cts +5 -4
- package/dist/extra/index.d.ts +5 -4
- package/dist/extra/index.js +68 -62
- package/dist/extra/sources.d.cts +1 -1
- package/dist/extra/sources.d.ts +1 -1
- package/dist/graph/index.d.cts +5 -5
- package/dist/graph/index.d.ts +5 -5
- package/dist/graph/index.js +3 -3
- package/dist/{graph-DQ69XU0g.d.ts → graph-CCwGKLCm.d.ts} +4 -4
- package/dist/{graph-6tZ5jEzr.d.cts → graph-DNCrvZSn.d.cts} +4 -4
- package/dist/{index-qldRdbQw.d.ts → index-3lsddbbS.d.ts} +1 -1
- package/dist/{index-Bxb5ZYc9.d.cts → index-B1tloyhO.d.cts} +1 -1
- package/dist/{index-eJ6T_qGM.d.ts → index-B6D3QNSA.d.ts} +2 -2
- package/dist/{index-B4MP_8V_.d.cts → index-B6EhDnjH.d.cts} +1 -1
- package/dist/{index-CmnuOibw.d.ts → index-B9B7_HEY.d.ts} +1 -1
- package/dist/{index-BeIdBfcb.d.cts → index-BHlKbUwO.d.cts} +16 -315
- package/dist/{index-CuYwdKO-.d.ts → index-BPVt8kqc.d.ts} +3 -3
- package/dist/index-BaSM3aYt.d.ts +195 -0
- package/dist/{index-BjI6ty9z.d.ts → index-BuEoe-Qu.d.ts} +9 -9
- package/dist/{index-DdD5MVDL.d.ts → index-BwfLUNw4.d.ts} +16 -315
- package/dist/{index-QBpffFW-.d.cts → index-ByQxazQJ.d.cts} +1 -1
- package/dist/{index-xdGjv0nO.d.ts → index-C0svESO4.d.ts} +1 -1
- package/dist/{index-BW1z3BN9.d.ts → index-C8oil6M6.d.ts} +3 -3
- package/dist/{index-C8mdwMXc.d.cts → index-CI3DprxP.d.cts} +3 -3
- package/dist/{index-CUwyr1Kk.d.cts → index-CO8uBlUh.d.cts} +2 -2
- package/dist/{index-DrISNAOm.d.ts → index-CxFrXH4m.d.ts} +1 -1
- package/dist/{index-BEfE8H_G.d.cts → index-D8wS_PeY.d.cts} +9 -9
- package/dist/{index-CUyrtuOf.d.cts → index-DO_6JN9Z.d.cts} +1 -1
- package/dist/index-DVGiGFGT.d.cts +195 -0
- package/dist/{index-DFhjO4Gg.d.cts → index-DYme44FM.d.cts} +1 -1
- package/dist/{index-_oMEWlDq.d.cts → index-DlLp-2Xn.d.cts} +3 -3
- package/dist/{index-CPgZ5wRl.d.ts → index-Dzk2hrlR.d.ts} +1 -1
- package/dist/{index-Bd_fwmLf.d.cts → index-VHqptjhu.d.cts} +1 -1
- package/dist/{index-CDAjUFIv.d.ts → index-VdHQMPy1.d.ts} +1 -1
- package/dist/{index-B_IP40nB.d.cts → index-Xi3u0HCQ.d.cts} +1 -1
- package/dist/{index-BYOHF0zP.d.ts → index-wEn0eFe8.d.ts} +1 -1
- package/dist/index.d.cts +35 -1692
- package/dist/index.d.ts +35 -1692
- package/dist/index.js +307 -3731
- package/dist/index.js.map +1 -1
- package/dist/memory-C6Z2tGpC.d.cts +139 -0
- package/dist/memory-li6FL5RM.d.ts +139 -0
- package/dist/messaging-Gt4LPbyA.d.cts +269 -0
- package/dist/messaging-XDoYablx.d.ts +269 -0
- package/dist/{meta-C0-8XW6Q.d.cts → meta-BxCA7rcr.d.cts} +1 -1
- package/dist/{meta-BGqSZ7mt.d.ts → meta-CbznRPYJ.d.ts} +1 -1
- package/dist/{node-C_IBuvX2.d.cts → node-BmerH3kS.d.cts} +1 -1
- package/dist/{node-C_IBuvX2.d.ts → node-BmerH3kS.d.ts} +1 -1
- package/dist/{observable-DCk45RH5.d.ts → observable-BgGUwcqp.d.ts} +1 -1
- package/dist/{observable-Crr1jgzx.d.cts → observable-DJt_AxzQ.d.cts} +1 -1
- package/dist/patterns/ai.cjs +7930 -0
- package/dist/patterns/ai.cjs.map +1 -0
- package/dist/patterns/ai.d.cts +10 -0
- package/dist/patterns/ai.d.ts +10 -0
- package/dist/patterns/ai.js +71 -0
- package/dist/patterns/ai.js.map +1 -0
- package/dist/patterns/audit.cjs +5805 -0
- package/dist/patterns/audit.cjs.map +1 -0
- package/dist/patterns/audit.d.cts +6 -0
- package/dist/patterns/audit.d.ts +6 -0
- package/dist/patterns/audit.js +29 -0
- package/dist/patterns/audit.js.map +1 -0
- package/dist/patterns/demo-shell.d.cts +6 -6
- package/dist/patterns/demo-shell.d.ts +6 -6
- package/dist/patterns/demo-shell.js +4 -4
- package/dist/patterns/memory.cjs +5283 -0
- package/dist/patterns/memory.cjs.map +1 -0
- package/dist/patterns/memory.d.cts +5 -0
- package/dist/patterns/memory.d.ts +5 -0
- package/dist/patterns/memory.js +20 -0
- package/dist/patterns/memory.js.map +1 -0
- package/dist/patterns/reactive-layout/index.d.cts +6 -6
- package/dist/patterns/reactive-layout/index.d.ts +6 -6
- package/dist/patterns/reactive-layout/index.js +4 -4
- package/dist/{reactive-layout-BaOQefHu.d.cts → reactive-layout-MQP--J3F.d.cts} +2 -2
- package/dist/{reactive-layout-D9gejYXE.d.ts → reactive-layout-u5Ulnqag.d.ts} +2 -2
- package/dist/{storage-BMycWEh2.d.ts → storage-CMjUUuxn.d.ts} +2 -2
- package/dist/{storage-DiqWHzVI.d.cts → storage-DdWlZo6U.d.cts} +2 -2
- package/dist/sugar-CCOxXK1e.d.ts +201 -0
- package/dist/sugar-D02n5JjF.d.cts +201 -0
- package/package.json +32 -2
- package/dist/chunk-AMCG74RZ.js.map +0 -1
- package/dist/chunk-RB6QPHJ7.js.map +0 -1
- package/dist/index-C0ZXMaXO.d.cts +0 -392
- package/dist/index-CY2TljO4.d.ts +0 -392
- /package/dist/{chunk-JYXEWPH4.js.map → chunk-APFNLIRG.js.map} +0 -0
- /package/dist/{chunk-LCE3GF5P.js.map → chunk-GTE6PWRZ.js.map} +0 -0
- /package/dist/{chunk-FQMKGR6L.js.map → chunk-JWBCY4NC.js.map} +0 -0
- /package/dist/{chunk-6LDQFTYS.js.map → chunk-OU5CQKNW.js.map} +0 -0
- /package/dist/{chunk-THTWHNU4.js.map → chunk-PF7GRZMW.js.map} +0 -0
- /package/dist/{chunk-SN4YWWYO.js.map → chunk-WBZOVTYK.js.map} +0 -0
- /package/dist/{chunk-ZQMEI34O.js.map → chunk-X3VMZYBT.js.map} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,1699 +1,42 @@
|
|
|
1
|
-
export { i as compat, a as signals } from './index-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
export {
|
|
14
|
-
import { G as
|
|
15
|
-
export {
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export { i as
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export { i as
|
|
28
|
-
export { i as
|
|
1
|
+
export { i as compat, a as signals } from './index-BuEoe-Qu.js';
|
|
2
|
+
export { b as batch, i as core, d as downWithBatch, a as isBatching, m as monotonicNs, w as wallClockNs } from './index-BaSM3aYt.js';
|
|
3
|
+
import { S as StatusValue, C as CircuitState, R as RateLimiterOptions, a as CircuitBreakerOptions, b as RetryOptions, F as FallbackInput, N as NS_PER_MS, c as NS_PER_SEC } from './index-BwfLUNw4.js';
|
|
4
|
+
export { A as AckableMessage, d as AdapterHandlers, B as BackoffPreset, e as BackoffStrategy, f as BatchMessage, g as BridgeMessage, h as BufferedSinkHandle, i as BundleTriad, j as CSVRow, k as CacheEvictionPolicy, l as CascadingCache, m as CascadingCacheOptions, n as CheckpointToRedisOptions, o as CheckpointToS3Options, p as CircuitBreaker, q as CircuitOpenError, r as ClickHouseClientLike, s as ClickHouseInsertClientLike, t as ClickHouseRow, u as CronSchedule, D as DrizzleQueryLike, E as EmitTriad, v as ErrorMessage, w as ExponentialBackoffOptions, x as ExternalBundleOptions, y as ExternalRegister, z as FSEvent, G as FSEventType, H as FileWriterLike, I as FromCSVOptions, J as FromClickHouseWatchOptions, K as FromDrizzleOptions, L as FromFSWatchOptions, M as FromGitHookOptions, O as FromHTTPOptions, P as FromHTTPPollOptions, Q as FromHTTPStreamOptions, T as FromKafkaOptions, U as FromKyselyOptions, V as FromMCPOptions, W as FromNATSOptions, X as FromNDJSONOptions, Y as FromOTelOptions, Z as FromPrismaOptions, _ as FromPrometheusOptions, $ as FromPulsarOptions, a0 as FromRabbitMQOptions, a1 as FromRedisStreamOptions, a2 as FromSSEOptions, a3 as FromSqliteOptions, a4 as FromStatsDOptions, a5 as FromSyslogOptions, a6 as FromWebSocketReconnectOptions, a7 as GitEvent, a8 as GitHookType, a9 as HTTPBundle, aa as IndexBackend, ab as IndexRow, ac as InitMessage, ad as JitterMode, ae as KafkaConsumerLike, af as KafkaMessage, ag as KafkaProducerLike, ah as KyselyQueryLike, ai as ListBackend, aj as LogBackend, ak as LokiClientLike, al as LokiStream, am as MCPClientLike, an as MergeMapOptions, ao as MongoCollectionLike, ap as NATSClientLike, aq as NATSMessage, ar as NATSSubscriptionLike, as as NativeIndexBackend, at as NativeListBackend, au as NativeLogBackend, av as NativePubSubBackend, aw as OTelBundle, ax as OTelLog, ay as OTelMetric, az as OTelRegister, aA as OTelSpan, aB as PostgresClientLike, aC as PrismaModelLike, aD as PrometheusMetric, aE as PubSubBackend, aF as PubSubHub, aG as PubSubHubOptions, aH as PulsarConsumerLike, aI as PulsarMessage, aJ as PulsarProducerLike, aK as RabbitMQChannelLike, aL as RabbitMQMessage, aM as RateLimiterOverflowError, aN as RateLimiterOverflowPolicy, aO as ReactiveIndexBundle, aP as ReactiveIndexOptions, aQ as ReactiveListBundle, aR as ReactiveListOptions, aS as ReactiveLogBundle, aT as ReactiveLogOptions, aU as ReactiveSinkBackpressureOptions, aV as ReactiveSinkConfig, aW as ReactiveSinkHandle, aX as ReactiveSinkOptions, aY as ReactiveSinkRetryOptions, aZ as ReadyMessage, a_ as RedisCheckpointClientLike, a$ as RedisClientLike, b0 as RedisStreamEntry, b1 as ResettableTimer, b2 as RetrySourceOptions, b3 as S3ClientLike, b4 as SSEEvent, b5 as SignalMessage, b6 as SinkFailure, b7 as SinkHandle, b8 as SinkTransportError, b9 as SqliteDbLike, ba as SqliteIterableDbLike, bb as StatsDMetric, bc as StatsDRegister, bd as SyslogMessage, be as SyslogRegister, bf as TapObserver, bg as TempoClientLike, bh as ThrottleOptions, bi as TimeoutError, bj as ToCSVOptions, bk as ToClickHouseOptions, bl as ToFileOptions, bm as ToHTTPOptions, bn as ToKafkaOptions, bo as ToLokiOptions, bp as ToMongoOptions, bq as ToNATSOptions, br as ToPostgresOptions, bs as ToPulsarOptions, bt as ToRabbitMQOptions, bu as ToRedisStreamOptions, bv as ToS3Options, bw as ToSSEOptions, bx as ToSqliteOptions, by as ToTempoOptions, bz as ToWebSocketOptions, bA as TokenBucket, bB as UpsertOptions, bC as ValueMessage, bD as WatermarkController, bE as WatermarkOptions, bF as WebSocketLike, bG as WebSocketMessageEventLike, bH as WebSocketRegister, bI as WebhookRegister, bJ as WithBreakerBundle, bK as WithStatusBundle, bL as WorkerBridge, bM as WorkerBridgeOptions, bN as WorkerSelfHandle, bO as WorkerSelfOptions, bP as WorkerTransport, bQ as audit, bR as buffer, bS as bufferCount, bT as bufferTime, bU as cascadingCache, bV as catchError, bW as checkpointToRedis, bX as checkpointToS3, bY as circuitBreaker, bZ as combine, b_ as combineLatest, b$ as concat, c0 as concatMap, c1 as constant, c2 as createTransport, c3 as createWatermarkController, c4 as csvRows, c5 as debounce, c6 as debounceTime, c7 as decorrelatedJitter, c8 as delay, c9 as deserializeError, ca as distinctUntilChanged, cb as elementAt, cc as exhaustMap, cd as exponential, ce as externalBundle, cf as externalProducer, cg as extra, ch as fallback, ci as fibonacci, cj as filter, ck as find, cl as first, cm as flatMap, cn as fromCSV, co as fromClickHouseWatch, cp as fromDrizzle, cq as fromFSWatch, cr as fromGitHook, cs as fromHTTP, ct as fromHTTPPoll, cu as fromHTTPStream, cv as fromKafka, cw as fromKysely, cx as fromMCP, cy as fromNATS, cz as fromNDJSON, cA as fromOTel, cB as fromPrisma, cC as fromPrometheus, cD as fromPulsar, cE as fromRabbitMQ, cF as fromRedisStream, cG as fromSSE, cH as fromSqlite, cI as fromSqliteCursor, cJ as fromStatsD, cK as fromSyslog, cL as fromWebSocket, cM as fromWebSocketReconnect, cN as fromWebhook, cO as interval, cP as last, cQ as linear, cR as lru, cS as map, cT as matchesCron, cU as merge, cV as mergeMap, cW as nameToSignal, cX as ndjsonRows, cY as pairwise, cZ as parseCron, c_ as parsePrometheusText, c$ as parseStatsD, d0 as parseSyslog, d1 as pausable, d2 as pubsub, d3 as race, d4 as rateLimiter, d5 as reactiveIndex, d6 as reactiveList, d7 as reactiveLog, d8 as reactiveSink, d9 as reduce, da as repeat, db as rescue, dc as resolveBackoffPreset, dd as retry, de as retrySource, df as sample, dg as scan, dh as serializeError, di as signalToName, dj as skip, dk as switchMap, dl as take, dm as takeUntil, dn as takeWhile, dp as tap, dq as throttle, dr as throttleTime, ds as timeout, dt as toCSV, du as toClickHouse, dv as toFile, dw as toHTTP, dx as toKafka, dy as toLoki, dz as toMongo, dA as toNATS, dB as toPostgres, dC as toPulsar, dD as toRabbitMQ, dE as toReadableStream, dF as toRedisStream, dG as toS3, dH as toSSE, dI as toSSEBytes, dJ as toSqlite, dK as toTempo, dL as toWebSocket, dM as tokenBucket, dN as valve, dO as window, dP as windowCount, dQ as windowTime, dR as withBreaker, dS as withLatestFrom, dT as withMaxAttempts, dU as withStatus, dV as workerBridge, dW as workerSelf, dX as zip } from './index-BwfLUNw4.js';
|
|
5
|
+
import { w as watchTopologyTree } from './index-B6D3QNSA.js';
|
|
6
|
+
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-B6D3QNSA.js';
|
|
7
|
+
import { L as LLMAdapter, G as GateController, a as ai, o as orchestration } from './ai-WlRltJV7.js';
|
|
8
|
+
import { P as PolicyEnforcerGraph, a as PolicyViolation, b as audit } from './audit-DRlSzBu9.js';
|
|
9
|
+
import { c as cqrs } from './index-BPVt8kqc.js';
|
|
10
|
+
export { i as nestjs } from './index-BPVt8kqc.js';
|
|
11
|
+
import { d as demoShell } from './demo-shell-BDkOptd6.js';
|
|
12
|
+
import { N as Node, P as PolicyRuleData, A as Actor, a as NodeOptions } from './node-BmerH3kS.js';
|
|
13
|
+
export { C as COMPLETE, b as COMPLETE_MSG, c as COMPLETE_ONLY_BATCH, D as DATA, d as DEFAULT_ACTOR, e as DIRTY, f as DIRTY_MSG, g as DIRTY_ONLY_BATCH, h as DepRecord, E as ERROR, F as FnCtx, G as GlobalInspectorEvent, i as GlobalInspectorHook, j as GraphReFlyConfig, k as GuardAction, l as GuardDenied, m as GuardDeniedDetails, H as HashFn, I as INVALIDATE, n as INVALIDATE_MSG, o as INVALIDATE_ONLY_BATCH, M as Message, p as MessageContext, q as MessageTypeRegistration, r as MessageTypeRegistrationInput, s as Messages, t as NodeActions, 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-BmerH3kS.js';
|
|
14
|
+
import { G as GraphOptions, a as Graph, b as GraphDescribeOptions, c as GraphDescribeOutput, D as DescribeFilter, d as GraphProfileResult, e as GraphProfileOptions, C as CausalChain, f as GraphNodeFactory, g as GraphDiffResult } from './graph-CCwGKLCm.js';
|
|
15
|
+
export { h as CausalStep, E as ExplainPathOptions, i as GRAPH_META_SEGMENT, j as GraphActorOptions, k as GraphAttachStorageOptions, l as GraphCheckpointRecord, m as GraphDiagramDirection, n as GraphDiagramOptions, o as GraphDiffChange, p as GraphFactoryContext, q as GraphObserveAll, r as GraphObserveOne, s as GraphPersistSnapshot, 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-CCwGKLCm.js';
|
|
16
|
+
import { T as TopicGraph, m as messaging } from './messaging-XDoYablx.js';
|
|
17
|
+
import { R as ReactiveMapBundle } from './composite-aUCvjZVR.js';
|
|
18
|
+
export { D as DistillBundle, a as DistillOptions, E as Extraction, M as MapBackend, N as NativeMapBackend, b as NativeMapBackendOptions, c as ReactiveMapOptions, V as VerifiableBundle, d as VerifiableOptions, e as VerifyValue, f as distill, r as reactiveMap, v as verifiable } from './composite-aUCvjZVR.js';
|
|
19
|
+
import { m as memory } from './memory-li6FL5RM.js';
|
|
20
|
+
import { i as index$3 } from './index-C8oil6M6.js';
|
|
21
|
+
import { S as StorageTier } from './storage-CMjUUuxn.js';
|
|
22
|
+
export { I as IndexedDbStorageSpec, a as StorageHandle, d as dictStorage, f as fileStorage, b as fromIDBRequest, c as fromIDBTransaction, i as indexedDbStorage, m as memoryStorage, s as sqliteStorage } from './storage-CMjUUuxn.js';
|
|
23
|
+
export { AsyncSourceOpts, EventTargetLike, FromCronOptions, NodeInput, 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.js';
|
|
24
|
+
export { A as AutoTrackOptions, D as DerivedFn, a as DynamicFn, E as EffectFn, P as PipeOperator, b as ProducerFn, T as TrackFn, c as autoTrackNode, d as derived, e as dynamicNode, f as effect, p as pipe, g as producer, s as state } from './sugar-CCOxXK1e.js';
|
|
25
|
+
export { D as DescribeDetail, a as DescribeField, b as DescribeNodeOutput, r as resolveDescribeFields } from './meta-CbznRPYJ.js';
|
|
26
|
+
export { T as ToObservableOptions, t as toObservable } from './observable-BgGUwcqp.js';
|
|
27
|
+
export { i as jotai } from './index-3lsddbbS.js';
|
|
28
|
+
export { i as nanostores } from './index-C0svESO4.js';
|
|
29
|
+
export { i as react } from './index-Dzk2hrlR.js';
|
|
30
|
+
export { i as solid } from './index-VdHQMPy1.js';
|
|
31
|
+
export { i as svelte } from './index-CxFrXH4m.js';
|
|
32
|
+
export { i as vue } from './index-wEn0eFe8.js';
|
|
33
|
+
export { i as zustand } from './index-B9B7_HEY.js';
|
|
29
34
|
import '@nestjs/common';
|
|
30
35
|
import '@nestjs/core';
|
|
31
|
-
import './reactive-layout-
|
|
36
|
+
import './reactive-layout-u5Ulnqag.js';
|
|
32
37
|
import 'rxjs';
|
|
33
38
|
import 'vue';
|
|
34
39
|
|
|
35
|
-
/**
|
|
36
|
-
* Memory patterns (roadmap §4.3).
|
|
37
|
-
*
|
|
38
|
-
* Domain-layer helpers composed from GraphRefly primitives. `vectorIndex` uses
|
|
39
|
-
* an exact-search backend by default; an HNSW adapter can be injected as an
|
|
40
|
-
* optional dependency.
|
|
41
|
-
*/
|
|
42
|
-
|
|
43
|
-
type CollectionPolicy = "fifo" | "lru";
|
|
44
|
-
type VectorBackend = "flat" | "hnsw";
|
|
45
|
-
type LightCollectionEntry<T> = {
|
|
46
|
-
readonly id: string;
|
|
47
|
-
readonly value: T;
|
|
48
|
-
readonly createdAtNs: number;
|
|
49
|
-
readonly lastAccessNs: number;
|
|
50
|
-
};
|
|
51
|
-
type LightCollectionOptions = {
|
|
52
|
-
name?: string;
|
|
53
|
-
maxSize?: number;
|
|
54
|
-
policy?: CollectionPolicy;
|
|
55
|
-
};
|
|
56
|
-
type LightCollectionBundle<T> = {
|
|
57
|
-
readonly entries: Node<ReadonlyMap<string, LightCollectionEntry<T>>>;
|
|
58
|
-
upsert: (id: string, value: T) => void;
|
|
59
|
-
remove: (id: string) => void;
|
|
60
|
-
clear: () => void;
|
|
61
|
-
get: (id: string) => T | undefined;
|
|
62
|
-
has: (id: string) => boolean;
|
|
63
|
-
};
|
|
64
|
-
type CollectionEntry<T> = LightCollectionEntry<T> & {
|
|
65
|
-
readonly baseScore: number;
|
|
66
|
-
};
|
|
67
|
-
type RankedCollectionEntry<T> = CollectionEntry<T> & {
|
|
68
|
-
readonly score: number;
|
|
69
|
-
};
|
|
70
|
-
type CollectionOptions<T> = {
|
|
71
|
-
maxSize?: number;
|
|
72
|
-
policy?: CollectionPolicy;
|
|
73
|
-
/**
|
|
74
|
-
* Produces a base score at insert/update time.
|
|
75
|
-
*/
|
|
76
|
-
score?: (value: T) => number;
|
|
77
|
-
/**
|
|
78
|
-
* Exponential decay rate per second. 0 disables decay.
|
|
79
|
-
*/
|
|
80
|
-
decayRate?: number;
|
|
81
|
-
/**
|
|
82
|
-
* Minimum score floor after decay.
|
|
83
|
-
*/
|
|
84
|
-
minScore?: number;
|
|
85
|
-
};
|
|
86
|
-
type CollectionGraph<T> = Graph & {
|
|
87
|
-
upsert: (id: string, value: T, opts?: {
|
|
88
|
-
score?: number;
|
|
89
|
-
}) => void;
|
|
90
|
-
remove: (id: string) => void;
|
|
91
|
-
clear: () => void;
|
|
92
|
-
getItem: (id: string) => CollectionEntry<T> | undefined;
|
|
93
|
-
};
|
|
94
|
-
type VectorRecord<TMeta> = {
|
|
95
|
-
readonly id: string;
|
|
96
|
-
readonly vector: readonly number[];
|
|
97
|
-
readonly meta?: TMeta;
|
|
98
|
-
};
|
|
99
|
-
type VectorSearchResult<TMeta> = {
|
|
100
|
-
readonly id: string;
|
|
101
|
-
readonly score: number;
|
|
102
|
-
readonly meta?: TMeta;
|
|
103
|
-
};
|
|
104
|
-
type HnswAdapter<TMeta> = {
|
|
105
|
-
upsert: (id: string, vector: readonly number[], meta?: TMeta) => void;
|
|
106
|
-
remove: (id: string) => void;
|
|
107
|
-
clear: () => void;
|
|
108
|
-
search: (query: readonly number[], k: number) => ReadonlyArray<VectorSearchResult<TMeta>>;
|
|
109
|
-
};
|
|
110
|
-
type VectorIndexOptions<TMeta> = {
|
|
111
|
-
backend?: VectorBackend;
|
|
112
|
-
dimension?: number;
|
|
113
|
-
/**
|
|
114
|
-
* Optional dependency seam for HNSW.
|
|
115
|
-
*/
|
|
116
|
-
hnswFactory?: () => HnswAdapter<TMeta>;
|
|
117
|
-
};
|
|
118
|
-
type VectorIndexBundle<TMeta> = {
|
|
119
|
-
readonly backend: VectorBackend;
|
|
120
|
-
readonly entries: Node<ReadonlyMap<string, VectorRecord<TMeta>>>;
|
|
121
|
-
upsert: (id: string, vector: readonly number[], meta?: TMeta) => void;
|
|
122
|
-
remove: (id: string) => void;
|
|
123
|
-
clear: () => void;
|
|
124
|
-
search: (query: readonly number[], k?: number) => ReadonlyArray<VectorSearchResult<TMeta>>;
|
|
125
|
-
};
|
|
126
|
-
type KnowledgeEdge<TRelation extends string = string> = {
|
|
127
|
-
readonly from: string;
|
|
128
|
-
readonly to: string;
|
|
129
|
-
readonly relation: TRelation;
|
|
130
|
-
readonly weight: number;
|
|
131
|
-
};
|
|
132
|
-
type KnowledgeGraphGraph<TEntity, TRelation extends string = string> = Graph & {
|
|
133
|
-
upsertEntity: (id: string, value: TEntity) => void;
|
|
134
|
-
removeEntity: (id: string) => void;
|
|
135
|
-
link: (from: string, to: string, relation: TRelation, weight?: number) => void;
|
|
136
|
-
unlink: (from: string, to: string, relation?: TRelation) => void;
|
|
137
|
-
related: (id: string, relation?: TRelation) => ReadonlyArray<KnowledgeEdge<TRelation>>;
|
|
138
|
-
};
|
|
139
|
-
declare function decay(baseScore: number, ageSeconds: number, ratePerSecond: number, minScore?: number): number;
|
|
140
|
-
declare function lightCollection<T>(opts?: LightCollectionOptions): LightCollectionBundle<T>;
|
|
141
|
-
declare function collection<T>(name: string, opts?: CollectionOptions<T>): CollectionGraph<T>;
|
|
142
|
-
declare function vectorIndex<TMeta>(opts?: VectorIndexOptions<TMeta>): VectorIndexBundle<TMeta>;
|
|
143
|
-
declare function knowledgeGraph<TEntity, TRelation extends string = string>(name: string): KnowledgeGraphGraph<TEntity, TRelation>;
|
|
144
|
-
|
|
145
|
-
type memory_CollectionEntry<T> = CollectionEntry<T>;
|
|
146
|
-
type memory_CollectionGraph<T> = CollectionGraph<T>;
|
|
147
|
-
type memory_CollectionOptions<T> = CollectionOptions<T>;
|
|
148
|
-
type memory_CollectionPolicy = CollectionPolicy;
|
|
149
|
-
type memory_HnswAdapter<TMeta> = HnswAdapter<TMeta>;
|
|
150
|
-
type memory_KnowledgeEdge<TRelation extends string = string> = KnowledgeEdge<TRelation>;
|
|
151
|
-
type memory_KnowledgeGraphGraph<TEntity, TRelation extends string = string> = KnowledgeGraphGraph<TEntity, TRelation>;
|
|
152
|
-
type memory_LightCollectionBundle<T> = LightCollectionBundle<T>;
|
|
153
|
-
type memory_LightCollectionEntry<T> = LightCollectionEntry<T>;
|
|
154
|
-
type memory_LightCollectionOptions = LightCollectionOptions;
|
|
155
|
-
type memory_RankedCollectionEntry<T> = RankedCollectionEntry<T>;
|
|
156
|
-
type memory_VectorBackend = VectorBackend;
|
|
157
|
-
type memory_VectorIndexBundle<TMeta> = VectorIndexBundle<TMeta>;
|
|
158
|
-
type memory_VectorIndexOptions<TMeta> = VectorIndexOptions<TMeta>;
|
|
159
|
-
type memory_VectorRecord<TMeta> = VectorRecord<TMeta>;
|
|
160
|
-
type memory_VectorSearchResult<TMeta> = VectorSearchResult<TMeta>;
|
|
161
|
-
declare const memory_collection: typeof collection;
|
|
162
|
-
declare const memory_decay: typeof decay;
|
|
163
|
-
declare const memory_knowledgeGraph: typeof knowledgeGraph;
|
|
164
|
-
declare const memory_lightCollection: typeof lightCollection;
|
|
165
|
-
declare const memory_vectorIndex: typeof vectorIndex;
|
|
166
|
-
declare namespace memory {
|
|
167
|
-
export { type memory_CollectionEntry as CollectionEntry, type memory_CollectionGraph as CollectionGraph, type memory_CollectionOptions as CollectionOptions, type memory_CollectionPolicy as CollectionPolicy, type memory_HnswAdapter as HnswAdapter, type memory_KnowledgeEdge as KnowledgeEdge, type memory_KnowledgeGraphGraph as KnowledgeGraphGraph, type memory_LightCollectionBundle as LightCollectionBundle, type memory_LightCollectionEntry as LightCollectionEntry, type memory_LightCollectionOptions as LightCollectionOptions, type memory_RankedCollectionEntry as RankedCollectionEntry, type memory_VectorBackend as VectorBackend, type memory_VectorIndexBundle as VectorIndexBundle, type memory_VectorIndexOptions as VectorIndexOptions, type memory_VectorRecord as VectorRecord, type memory_VectorSearchResult as VectorSearchResult, memory_collection as collection, memory_decay as decay, memory_knowledgeGraph as knowledgeGraph, memory_lightCollection as lightCollection, memory_vectorIndex as vectorIndex };
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* Messaging patterns (roadmap §4.2).
|
|
172
|
-
*
|
|
173
|
-
* Pulsar-inspired messaging features modeled as graph factories:
|
|
174
|
-
* - `topic()` for append-only topic streams
|
|
175
|
-
* - `subscription()` for cursor-based consumers
|
|
176
|
-
* - `jobQueue()` for queue claim/ack flow
|
|
177
|
-
*/
|
|
178
|
-
|
|
179
|
-
type TopicOptions = {
|
|
180
|
-
graph?: GraphOptions;
|
|
181
|
-
retainedLimit?: number;
|
|
182
|
-
};
|
|
183
|
-
declare class TopicGraph<T> extends Graph {
|
|
184
|
-
private readonly _log;
|
|
185
|
-
readonly events: Node<readonly T[]>;
|
|
186
|
-
/**
|
|
187
|
-
* Most recently published value, or `null` when the topic has no entries
|
|
188
|
-
* yet. Spec §5.12 reserves `undefined` as the protocol-internal "never
|
|
189
|
-
* sent DATA" sentinel — `null` is the idiomatic "empty / no value" signal
|
|
190
|
-
* for domain nodes. F7.
|
|
191
|
-
*
|
|
192
|
-
* **Caveat when `T` itself includes `null`** (e.g., `topic<number | null>`):
|
|
193
|
-
* `latest === null` is ambiguous — it could mean "no publish yet" OR "a
|
|
194
|
-
* `null` value was published". Use {@link hasLatest} to disambiguate, or
|
|
195
|
-
* observe {@link events} directly and track length yourself.
|
|
196
|
-
*/
|
|
197
|
-
readonly latest: Node<T | null>;
|
|
198
|
-
/**
|
|
199
|
-
* Reactive `true` once the topic has at least one published entry.
|
|
200
|
-
* Disambiguates "`null` never published" from "`null` was published" when
|
|
201
|
-
* `T` includes `null`.
|
|
202
|
-
*/
|
|
203
|
-
readonly hasLatest: Node<boolean>;
|
|
204
|
-
constructor(name: string, opts?: TopicOptions);
|
|
205
|
-
publish(value: T): void;
|
|
206
|
-
retained(): readonly T[];
|
|
207
|
-
}
|
|
208
|
-
type SubscriptionOptions = {
|
|
209
|
-
graph?: GraphOptions;
|
|
210
|
-
cursor?: number;
|
|
211
|
-
};
|
|
212
|
-
declare class SubscriptionGraph<T> extends Graph {
|
|
213
|
-
readonly source: Node<readonly T[]>;
|
|
214
|
-
readonly cursor: Node<number>;
|
|
215
|
-
readonly available: Node<readonly T[]>;
|
|
216
|
-
/**
|
|
217
|
-
* Reference to the upstream topic graph. Intentionally NOT mounted
|
|
218
|
-
* under this subscription: a subscription is a VIEW over an
|
|
219
|
-
* externally-owned topic. Double-mounting (e.g. hub-owned topic +
|
|
220
|
-
* sub-mount here) would make either-side teardown leave the other
|
|
221
|
-
* holding a dead reference. Node-level `derived([topicEvents], …)`
|
|
222
|
-
* still wires the data dependency across graph boundaries. D1(e).
|
|
223
|
-
*/
|
|
224
|
-
readonly topic: TopicGraph<T>;
|
|
225
|
-
constructor(name: string, topicGraph: TopicGraph<T>, opts?: SubscriptionOptions);
|
|
226
|
-
ack(count?: number): number;
|
|
227
|
-
pull(limit?: number, opts?: {
|
|
228
|
-
ack?: boolean;
|
|
229
|
-
}): readonly T[];
|
|
230
|
-
}
|
|
231
|
-
type JobState = "queued" | "inflight";
|
|
232
|
-
type JobEnvelope<T> = {
|
|
233
|
-
id: string;
|
|
234
|
-
payload: T;
|
|
235
|
-
attempts: number;
|
|
236
|
-
metadata: Readonly<Record<string, unknown>>;
|
|
237
|
-
state: JobState;
|
|
238
|
-
};
|
|
239
|
-
type JobQueueOptions = {
|
|
240
|
-
graph?: GraphOptions;
|
|
241
|
-
};
|
|
242
|
-
declare class JobQueueGraph<T> extends Graph {
|
|
243
|
-
private readonly _pending;
|
|
244
|
-
private readonly _jobs;
|
|
245
|
-
private _seq;
|
|
246
|
-
readonly pending: Node<readonly string[]>;
|
|
247
|
-
readonly jobs: Node<ReadonlyMap<string, JobEnvelope<T>>>;
|
|
248
|
-
readonly depth: Node<number>;
|
|
249
|
-
constructor(name: string, opts?: JobQueueOptions);
|
|
250
|
-
enqueue(payload: T, opts?: {
|
|
251
|
-
id?: string;
|
|
252
|
-
metadata?: Record<string, unknown>;
|
|
253
|
-
}): string;
|
|
254
|
-
claim(limit?: number): readonly JobEnvelope<T>[];
|
|
255
|
-
ack(id: string): boolean;
|
|
256
|
-
nack(id: string, opts?: {
|
|
257
|
-
requeue?: boolean;
|
|
258
|
-
}): boolean;
|
|
259
|
-
}
|
|
260
|
-
type JobFlowOptions = {
|
|
261
|
-
graph?: GraphOptions;
|
|
262
|
-
stages?: readonly string[];
|
|
263
|
-
maxPerPump?: number;
|
|
264
|
-
};
|
|
265
|
-
declare class JobFlowGraph<T> extends Graph {
|
|
266
|
-
private readonly _stageNames;
|
|
267
|
-
private readonly _queues;
|
|
268
|
-
private readonly _completed;
|
|
269
|
-
readonly completed: Node<readonly JobEnvelope<T>[]>;
|
|
270
|
-
readonly completedCount: Node<number>;
|
|
271
|
-
constructor(name: string, opts?: JobFlowOptions);
|
|
272
|
-
stages(): readonly string[];
|
|
273
|
-
queue(stage: string): JobQueueGraph<T>;
|
|
274
|
-
enqueue(payload: T, opts?: {
|
|
275
|
-
id?: string;
|
|
276
|
-
metadata?: Record<string, unknown>;
|
|
277
|
-
}): string;
|
|
278
|
-
retainedCompleted(): readonly JobEnvelope<T>[];
|
|
279
|
-
}
|
|
280
|
-
type TopicBridgeOptions<TIn, TOut> = {
|
|
281
|
-
graph?: GraphOptions;
|
|
282
|
-
cursor?: number;
|
|
283
|
-
maxPerPump?: number;
|
|
284
|
-
map?: (value: TIn) => TOut | undefined;
|
|
285
|
-
};
|
|
286
|
-
declare class TopicBridgeGraph<TIn, TOut = TIn> extends Graph {
|
|
287
|
-
private readonly _sourceSub;
|
|
288
|
-
private readonly _target;
|
|
289
|
-
readonly bridgedCount: Node<number>;
|
|
290
|
-
constructor(name: string, sourceTopic: TopicGraph<TIn>, targetTopic: TopicGraph<TOut>, opts?: TopicBridgeOptions<TIn, TOut>);
|
|
291
|
-
}
|
|
292
|
-
type MessagingHubOptions = {
|
|
293
|
-
graph?: GraphOptions;
|
|
294
|
-
/**
|
|
295
|
-
* Default `TopicOptions` applied to every topic created via `topic(name)`
|
|
296
|
-
* without explicit options. Per-call opts override. Default: `{}`
|
|
297
|
-
* (unbounded retention per topic unless `retainedLimit` is set per call).
|
|
298
|
-
*/
|
|
299
|
-
defaultTopicOptions?: TopicOptions;
|
|
300
|
-
};
|
|
301
|
-
/**
|
|
302
|
-
* Lazy Pulsar-inspired topic registry. Manages a named set of {@link TopicGraph}
|
|
303
|
-
* instances with retention + cursor semantics. Topics are created on first
|
|
304
|
-
* access; `removeTopic(name)` unmounts and tears down via {@link Graph.remove}.
|
|
305
|
-
*
|
|
306
|
-
* **Relationship to `pubsub()` in `src/extra/pubsub.ts`:** `pubsub` is a
|
|
307
|
-
* lightweight last-value state hub (no retention, no cursors). `MessagingHubGraph`
|
|
308
|
-
* is the full messaging hub — retained message logs, cursor-based subscriptions,
|
|
309
|
-
* and pattern-layer lifecycle management.
|
|
310
|
-
*
|
|
311
|
-
* @category patterns
|
|
312
|
-
*/
|
|
313
|
-
declare class MessagingHubGraph extends Graph {
|
|
314
|
-
private readonly _topics;
|
|
315
|
-
private _version;
|
|
316
|
-
private readonly _defaultTopicOptions;
|
|
317
|
-
constructor(name: string, opts?: MessagingHubOptions);
|
|
318
|
-
/** Monotonic counter advancing on topic create/remove. */
|
|
319
|
-
get version(): number;
|
|
320
|
-
/** Number of topics currently in the hub. */
|
|
321
|
-
get size(): number;
|
|
322
|
-
/** Checks topic existence without creating. */
|
|
323
|
-
has(name: string): boolean;
|
|
324
|
-
/** Iterator over topic names. */
|
|
325
|
-
topicNames(): IterableIterator<string>;
|
|
326
|
-
/**
|
|
327
|
-
* Returns the {@link TopicGraph} for `name`, creating lazily on first call.
|
|
328
|
-
* Subsequent calls with the same name return the same instance (options on
|
|
329
|
-
* repeat calls are ignored — the topic is already configured).
|
|
330
|
-
*/
|
|
331
|
-
topic<T = unknown>(name: string, opts?: TopicOptions): TopicGraph<T>;
|
|
332
|
-
/**
|
|
333
|
-
* Publishes a value to the topic, lazily creating it on first publish.
|
|
334
|
-
*
|
|
335
|
-
* **Late-subscriber caveat:** the topic is created lazily, so subscribers
|
|
336
|
-
* that attach AFTER a publish only see the retained window (governed by
|
|
337
|
-
* `retainedLimit` on `TopicOptions` / `defaultTopicOptions`). If
|
|
338
|
-
* `retainedLimit === 0` is set explicitly, early publishes are
|
|
339
|
-
* effectively dropped — prefer an unset `retainedLimit` (unbounded
|
|
340
|
-
* retention) or subscribe before publishing when late-subscribers matter.
|
|
341
|
-
*/
|
|
342
|
-
publish<T = unknown>(name: string, value: T): void;
|
|
343
|
-
/**
|
|
344
|
-
* Bulk publish — issues all publishes inside one outer batch. New topics
|
|
345
|
-
* are created on demand. No-op if `entries` yields nothing.
|
|
346
|
-
*
|
|
347
|
-
* **Iterable consumption (F6):** `entries` is consumed once (single-pass)
|
|
348
|
-
* INSIDE the batch frame. If the iterator throws mid-way, the batch is
|
|
349
|
-
* discarded and NO publishes are visible to subscribers (all-or-nothing).
|
|
350
|
-
* Pass an array or `Set` for multi-shot callers.
|
|
351
|
-
*/
|
|
352
|
-
publishMany(entries: Iterable<[string, unknown]>): void;
|
|
353
|
-
/**
|
|
354
|
-
* Creates a {@link SubscriptionGraph} over a named topic. The topic is
|
|
355
|
-
* lazily created if missing. Subscription lifecycle is owned by the caller —
|
|
356
|
-
* the hub does NOT mount the subscription.
|
|
357
|
-
*
|
|
358
|
-
* @param subName - Local name for the subscription graph.
|
|
359
|
-
* @param topicName - Hub topic to subscribe to.
|
|
360
|
-
* @param opts - `SubscriptionOptions` (initial cursor, etc.).
|
|
361
|
-
*/
|
|
362
|
-
subscribe<T = unknown>(subName: string, topicName: string, opts?: SubscriptionOptions): SubscriptionGraph<T>;
|
|
363
|
-
/**
|
|
364
|
-
* Unmounts and tears down the topic's graph. Returns `true` if the topic
|
|
365
|
-
* existed. Subscribers receive `TEARDOWN` via {@link Graph.remove}.
|
|
366
|
-
*/
|
|
367
|
-
removeTopic(name: string): boolean;
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* Creates a Pulsar-inspired topic graph (append-only retained stream + latest value).
|
|
371
|
-
*/
|
|
372
|
-
declare function topic<T>(name: string, opts?: TopicOptions): TopicGraph<T>;
|
|
373
|
-
/**
|
|
374
|
-
* Creates a lazy Pulsar-inspired messaging hub. Topics are created on first access
|
|
375
|
-
* via `hub.topic(name)`; `hub.publish(name, value)` shortcuts through the registry.
|
|
376
|
-
*
|
|
377
|
-
* @example
|
|
378
|
-
* ```ts
|
|
379
|
-
* import { messagingHub } from "@graphrefly/graphrefly-ts";
|
|
380
|
-
*
|
|
381
|
-
* const hub = messagingHub("main", { defaultTopicOptions: { retainedLimit: 256 } });
|
|
382
|
-
* hub.publish("orders", { id: 1 });
|
|
383
|
-
* hub.publishMany([["shipments", { id: 1 }], ["orders", { id: 2 }]]);
|
|
384
|
-
* const sub = hub.subscribe("orders-worker", "orders", { cursor: 0 });
|
|
385
|
-
* ```
|
|
386
|
-
*/
|
|
387
|
-
declare function messagingHub(name: string, opts?: MessagingHubOptions): MessagingHubGraph;
|
|
388
|
-
/**
|
|
389
|
-
* Creates a cursor-based subscription graph over a topic.
|
|
390
|
-
*/
|
|
391
|
-
declare function subscription<T>(name: string, topicGraph: TopicGraph<T>, opts?: SubscriptionOptions): SubscriptionGraph<T>;
|
|
392
|
-
/**
|
|
393
|
-
* Creates a Pulsar-inspired job queue graph with claim/ack/nack workflow.
|
|
394
|
-
*/
|
|
395
|
-
declare function jobQueue<T>(name: string, opts?: JobQueueOptions): JobQueueGraph<T>;
|
|
396
|
-
/**
|
|
397
|
-
* Creates an autonomous multi-stage queue chain graph.
|
|
398
|
-
*/
|
|
399
|
-
declare function jobFlow<T>(name: string, opts?: JobFlowOptions): JobFlowGraph<T>;
|
|
400
|
-
/**
|
|
401
|
-
* Creates an autonomous cursor-based topic relay graph.
|
|
402
|
-
*/
|
|
403
|
-
declare function topicBridge<TIn, TOut = TIn>(name: string, sourceTopic: TopicGraph<TIn>, targetTopic: TopicGraph<TOut>, opts?: TopicBridgeOptions<TIn, TOut>): TopicBridgeGraph<TIn, TOut>;
|
|
404
|
-
|
|
405
|
-
type messaging_JobEnvelope<T> = JobEnvelope<T>;
|
|
406
|
-
type messaging_JobFlowGraph<T> = JobFlowGraph<T>;
|
|
407
|
-
declare const messaging_JobFlowGraph: typeof JobFlowGraph;
|
|
408
|
-
type messaging_JobFlowOptions = JobFlowOptions;
|
|
409
|
-
type messaging_JobQueueGraph<T> = JobQueueGraph<T>;
|
|
410
|
-
declare const messaging_JobQueueGraph: typeof JobQueueGraph;
|
|
411
|
-
type messaging_JobQueueOptions = JobQueueOptions;
|
|
412
|
-
type messaging_JobState = JobState;
|
|
413
|
-
type messaging_MessagingHubGraph = MessagingHubGraph;
|
|
414
|
-
declare const messaging_MessagingHubGraph: typeof MessagingHubGraph;
|
|
415
|
-
type messaging_MessagingHubOptions = MessagingHubOptions;
|
|
416
|
-
type messaging_SubscriptionGraph<T> = SubscriptionGraph<T>;
|
|
417
|
-
declare const messaging_SubscriptionGraph: typeof SubscriptionGraph;
|
|
418
|
-
type messaging_SubscriptionOptions = SubscriptionOptions;
|
|
419
|
-
type messaging_TopicBridgeGraph<TIn, TOut = TIn> = TopicBridgeGraph<TIn, TOut>;
|
|
420
|
-
declare const messaging_TopicBridgeGraph: typeof TopicBridgeGraph;
|
|
421
|
-
type messaging_TopicBridgeOptions<TIn, TOut> = TopicBridgeOptions<TIn, TOut>;
|
|
422
|
-
type messaging_TopicGraph<T> = TopicGraph<T>;
|
|
423
|
-
declare const messaging_TopicGraph: typeof TopicGraph;
|
|
424
|
-
type messaging_TopicOptions = TopicOptions;
|
|
425
|
-
declare const messaging_jobFlow: typeof jobFlow;
|
|
426
|
-
declare const messaging_jobQueue: typeof jobQueue;
|
|
427
|
-
declare const messaging_messagingHub: typeof messagingHub;
|
|
428
|
-
declare const messaging_subscription: typeof subscription;
|
|
429
|
-
declare const messaging_topic: typeof topic;
|
|
430
|
-
declare const messaging_topicBridge: typeof topicBridge;
|
|
431
|
-
declare namespace messaging {
|
|
432
|
-
export { type messaging_JobEnvelope as JobEnvelope, messaging_JobFlowGraph as JobFlowGraph, type messaging_JobFlowOptions as JobFlowOptions, messaging_JobQueueGraph as JobQueueGraph, type messaging_JobQueueOptions as JobQueueOptions, type messaging_JobState as JobState, messaging_MessagingHubGraph as MessagingHubGraph, type messaging_MessagingHubOptions as MessagingHubOptions, messaging_SubscriptionGraph as SubscriptionGraph, type messaging_SubscriptionOptions as SubscriptionOptions, messaging_TopicBridgeGraph as TopicBridgeGraph, type messaging_TopicBridgeOptions as TopicBridgeOptions, messaging_TopicGraph as TopicGraph, type messaging_TopicOptions as TopicOptions, messaging_jobFlow as jobFlow, messaging_jobQueue as jobQueue, messaging_messagingHub as messagingHub, messaging_subscription as subscription, messaging_topic as topic, messaging_topicBridge as topicBridge };
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
/**
|
|
436
|
-
* Orchestration patterns (roadmap §4.1).
|
|
437
|
-
*
|
|
438
|
-
* Domain-layer helpers that build workflow shapes on top of core + extra primitives.
|
|
439
|
-
* Exported under the `patterns.orchestration` namespace to avoid collisions with
|
|
440
|
-
* Phase 2 operator names (for example `gate`, `forEach`).
|
|
441
|
-
*/
|
|
442
|
-
|
|
443
|
-
type StepRef$1 = string | Node<unknown>;
|
|
444
|
-
type OrchestrationMeta = {
|
|
445
|
-
orchestration?: true;
|
|
446
|
-
orchestration_type?: string;
|
|
447
|
-
};
|
|
448
|
-
type OrchestrationStepOptions = Omit<NodeOptions<unknown>, "describeKind" | "name" | "meta"> & {
|
|
449
|
-
deps?: ReadonlyArray<StepRef$1>;
|
|
450
|
-
meta?: Record<string, unknown> & OrchestrationMeta;
|
|
451
|
-
};
|
|
452
|
-
type BranchResult<T> = {
|
|
453
|
-
branch: "then" | "else";
|
|
454
|
-
value: T;
|
|
455
|
-
};
|
|
456
|
-
type SensorControls<T> = {
|
|
457
|
-
node: Node<T>;
|
|
458
|
-
push(value: T): void;
|
|
459
|
-
error(err: unknown): void;
|
|
460
|
-
complete(): void;
|
|
461
|
-
};
|
|
462
|
-
type LoopOptions = Omit<OrchestrationStepOptions, "deps"> & {
|
|
463
|
-
iterations?: number | StepRef$1;
|
|
464
|
-
};
|
|
465
|
-
type WaitOptions = Omit<OrchestrationStepOptions, "deps">;
|
|
466
|
-
type SubPipelineBuilder = (sub: Graph) => void;
|
|
467
|
-
/**
|
|
468
|
-
* Creates an orchestration graph container.
|
|
469
|
-
*/
|
|
470
|
-
declare function pipeline(name: string, opts?: GraphOptions): Graph;
|
|
471
|
-
/**
|
|
472
|
-
* Registers a workflow task node.
|
|
473
|
-
*/
|
|
474
|
-
declare function task<T>(graph: Graph, name: string, run: DerivedFn<T>, opts?: OrchestrationStepOptions): Node<T>;
|
|
475
|
-
/**
|
|
476
|
-
* Emits tagged branch outcomes (`then` / `else`) for each source value.
|
|
477
|
-
*/
|
|
478
|
-
declare function branch<T>(graph: Graph, name: string, source: StepRef$1, predicate: (value: T) => boolean, opts?: Omit<OrchestrationStepOptions, "deps">): Node<BranchResult<T>>;
|
|
479
|
-
/**
|
|
480
|
-
* Forwards source values only while `control` is truthy.
|
|
481
|
-
*/
|
|
482
|
-
declare function valve<T>(graph: Graph, name: string, source: StepRef$1, control: StepRef$1, opts?: Omit<OrchestrationStepOptions, "deps">): Node<T>;
|
|
483
|
-
type ApprovalOptions = Omit<OrchestrationStepOptions, "deps"> & {
|
|
484
|
-
isApproved?: (value: unknown) => boolean;
|
|
485
|
-
};
|
|
486
|
-
/**
|
|
487
|
-
* Human/LLM approval gate over a source value.
|
|
488
|
-
*/
|
|
489
|
-
declare function approval<T>(graph: Graph, name: string, source: StepRef$1, approver: StepRef$1, opts?: ApprovalOptions): Node<T>;
|
|
490
|
-
interface GateOptions {
|
|
491
|
-
/** Maximum queue size. Oldest values are FIFO-dropped when exceeded. Default: Infinity. */
|
|
492
|
-
maxPending?: number;
|
|
493
|
-
/** Start in open mode (auto-approve). Default: false. */
|
|
494
|
-
startOpen?: boolean;
|
|
495
|
-
meta?: Record<string, unknown>;
|
|
496
|
-
}
|
|
497
|
-
/** Control surface returned by {@link gate}. */
|
|
498
|
-
interface GateController<T> {
|
|
499
|
-
/** The output node registered in the graph (subscribe to receive approved values). */
|
|
500
|
-
node: Node<T>;
|
|
501
|
-
/** Reactive queue of values waiting for approval. */
|
|
502
|
-
pending: Node<T[]>;
|
|
503
|
-
/** Derived count of pending items. */
|
|
504
|
-
count: Node<number>;
|
|
505
|
-
/** Whether the gate is currently open (auto-approving). */
|
|
506
|
-
isOpen: Node<boolean>;
|
|
507
|
-
/** Approve and forward the next `count` pending values (default: 1). */
|
|
508
|
-
approve(count?: number): void;
|
|
509
|
-
/** Reject (discard) the next `count` pending values (default: 1). */
|
|
510
|
-
reject(count?: number): void;
|
|
511
|
-
/**
|
|
512
|
-
* Transform and forward `count` pending values (default: 1).
|
|
513
|
-
* `fn` receives `(value, index, pending)` — Array.map-style.
|
|
514
|
-
*/
|
|
515
|
-
modify(fn: (value: T, index: number, pending: readonly T[]) => T, count?: number): void;
|
|
516
|
-
/** Flush all pending values and auto-approve future values. */
|
|
517
|
-
open(): void;
|
|
518
|
-
/** Re-enable manual gating (stop auto-approving). */
|
|
519
|
-
close(): void;
|
|
520
|
-
}
|
|
521
|
-
/**
|
|
522
|
-
* Human-in-the-loop gate: queues incoming values from `source` and lets an external
|
|
523
|
-
* controller {@link GateController.approve approve}, {@link GateController.reject reject},
|
|
524
|
-
* or {@link GateController.modify modify} them before forwarding downstream.
|
|
525
|
-
*
|
|
526
|
-
* Observable surfaces (`pending`, `count`, `isOpen`) are reactive nodes registered in
|
|
527
|
-
* the graph. The gate output node is also registered.
|
|
528
|
-
*/
|
|
529
|
-
declare function gate<T>(graph: Graph, name: string, source: StepRef$1, opts?: GateOptions): GateController<T>;
|
|
530
|
-
/**
|
|
531
|
-
* Registers a workflow side-effect step that runs `run` for each upstream
|
|
532
|
-
* DATA value.
|
|
533
|
-
*
|
|
534
|
-
* `run` receives the full `NodeActions` and is the **sole emission point** —
|
|
535
|
-
* call `actions.emit(v)` or `actions.down(msgs)` inside `run` to produce
|
|
536
|
-
* downstream output. If `run` does not emit, this step acts as a pure
|
|
537
|
-
* side-effect sink (graph-observable but no output). Throwing inside `run`
|
|
538
|
-
* terminates the step with ERROR.
|
|
539
|
-
*/
|
|
540
|
-
declare function forEach<T>(graph: Graph, name: string, source: StepRef$1, run: (value: T, actions: NodeActions) => void, opts?: Omit<OrchestrationStepOptions, "deps">): Node<T>;
|
|
541
|
-
/**
|
|
542
|
-
* Registers a join step that emits a tuple of latest dependency values.
|
|
543
|
-
*/
|
|
544
|
-
declare function join<T extends readonly unknown[]>(graph: Graph, name: string, deps: {
|
|
545
|
-
[K in keyof T]: StepRef$1;
|
|
546
|
-
}, opts?: Omit<OrchestrationStepOptions, "deps">): Node<T>;
|
|
547
|
-
/**
|
|
548
|
-
* Registers a loop step that applies `iterate` to each source value N times.
|
|
549
|
-
*/
|
|
550
|
-
declare function loop<T>(graph: Graph, name: string, source: StepRef$1, iterate: (value: T, iteration: number, actions: NodeActions) => T, opts?: LoopOptions): Node<T>;
|
|
551
|
-
/**
|
|
552
|
-
* Mounts and returns a child workflow graph.
|
|
553
|
-
*/
|
|
554
|
-
declare function subPipeline(graph: Graph, name: string, childOrBuild?: Graph | SubPipelineBuilder, opts?: GraphOptions): Graph;
|
|
555
|
-
/**
|
|
556
|
-
* Registers a producer-style sensor source and returns imperative controls.
|
|
557
|
-
*/
|
|
558
|
-
declare function sensor<T>(graph: Graph, name: string, initial?: T, opts?: Omit<NodeOptions<unknown>, "name" | "describeKind" | "meta"> & {
|
|
559
|
-
meta?: Record<string, unknown>;
|
|
560
|
-
}): SensorControls<T>;
|
|
561
|
-
/**
|
|
562
|
-
* Registers a delayed-forwarding step (value-level wait).
|
|
563
|
-
*/
|
|
564
|
-
declare function wait<T>(graph: Graph, name: string, source: StepRef$1, ms: number, opts?: WaitOptions): Node<T>;
|
|
565
|
-
/**
|
|
566
|
-
* Registers an error-recovery step for a source.
|
|
567
|
-
*/
|
|
568
|
-
declare function onFailure<T>(graph: Graph, name: string, source: StepRef$1, recover: (err: unknown, actions: NodeActions) => T, opts?: Omit<OrchestrationStepOptions, "deps">): Node<T>;
|
|
569
|
-
|
|
570
|
-
type orchestration_ApprovalOptions = ApprovalOptions;
|
|
571
|
-
type orchestration_BranchResult<T> = BranchResult<T>;
|
|
572
|
-
type orchestration_GateController<T> = GateController<T>;
|
|
573
|
-
type orchestration_GateOptions = GateOptions;
|
|
574
|
-
type orchestration_LoopOptions = LoopOptions;
|
|
575
|
-
type orchestration_OrchestrationStepOptions = OrchestrationStepOptions;
|
|
576
|
-
type orchestration_SensorControls<T> = SensorControls<T>;
|
|
577
|
-
type orchestration_SubPipelineBuilder = SubPipelineBuilder;
|
|
578
|
-
type orchestration_WaitOptions = WaitOptions;
|
|
579
|
-
declare const orchestration_approval: typeof approval;
|
|
580
|
-
declare const orchestration_branch: typeof branch;
|
|
581
|
-
declare const orchestration_forEach: typeof forEach;
|
|
582
|
-
declare const orchestration_gate: typeof gate;
|
|
583
|
-
declare const orchestration_join: typeof join;
|
|
584
|
-
declare const orchestration_loop: typeof loop;
|
|
585
|
-
declare const orchestration_onFailure: typeof onFailure;
|
|
586
|
-
declare const orchestration_pipeline: typeof pipeline;
|
|
587
|
-
declare const orchestration_sensor: typeof sensor;
|
|
588
|
-
declare const orchestration_subPipeline: typeof subPipeline;
|
|
589
|
-
declare const orchestration_task: typeof task;
|
|
590
|
-
declare const orchestration_valve: typeof valve;
|
|
591
|
-
declare const orchestration_wait: typeof wait;
|
|
592
|
-
declare namespace orchestration {
|
|
593
|
-
export { type orchestration_ApprovalOptions as ApprovalOptions, type orchestration_BranchResult as BranchResult, type orchestration_GateController as GateController, type orchestration_GateOptions as GateOptions, type orchestration_LoopOptions as LoopOptions, type orchestration_OrchestrationStepOptions as OrchestrationStepOptions, type orchestration_SensorControls as SensorControls, type StepRef$1 as StepRef, type orchestration_SubPipelineBuilder as SubPipelineBuilder, type orchestration_WaitOptions as WaitOptions, orchestration_approval as approval, orchestration_branch as branch, orchestration_forEach as forEach, orchestration_gate as gate, orchestration_join as join, orchestration_loop as loop, orchestration_onFailure as onFailure, orchestration_pipeline as pipeline, orchestration_sensor as sensor, orchestration_subPipeline as subPipeline, orchestration_task as task, orchestration_valve as valve, orchestration_wait as wait };
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
/**
|
|
597
|
-
* AI surface patterns (roadmap §4.4).
|
|
598
|
-
*
|
|
599
|
-
* Domain-layer factories for LLM-backed agents, chat, tool registries, and
|
|
600
|
-
* agentic memory. Composed from core + extra + Phase 3–4.3 primitives.
|
|
601
|
-
*/
|
|
602
|
-
|
|
603
|
-
/** A single chat message in a conversation. */
|
|
604
|
-
type ChatMessage = {
|
|
605
|
-
readonly role: "system" | "user" | "assistant" | "tool";
|
|
606
|
-
readonly content: string;
|
|
607
|
-
readonly name?: string;
|
|
608
|
-
readonly toolCallId?: string;
|
|
609
|
-
readonly toolCalls?: readonly ToolCall[];
|
|
610
|
-
readonly metadata?: Record<string, unknown>;
|
|
611
|
-
};
|
|
612
|
-
/** A tool invocation request from an LLM. */
|
|
613
|
-
type ToolCall = {
|
|
614
|
-
readonly id: string;
|
|
615
|
-
readonly name: string;
|
|
616
|
-
readonly arguments: Record<string, unknown>;
|
|
617
|
-
};
|
|
618
|
-
/** The response from an LLM invocation. */
|
|
619
|
-
type LLMResponse = {
|
|
620
|
-
readonly content: string;
|
|
621
|
-
readonly toolCalls?: readonly ToolCall[];
|
|
622
|
-
readonly usage?: {
|
|
623
|
-
readonly inputTokens: number;
|
|
624
|
-
readonly outputTokens: number;
|
|
625
|
-
};
|
|
626
|
-
readonly finishReason?: string;
|
|
627
|
-
readonly metadata?: Record<string, unknown>;
|
|
628
|
-
};
|
|
629
|
-
/** Provider-agnostic LLM client adapter protocol. */
|
|
630
|
-
type LLMAdapter = {
|
|
631
|
-
invoke(messages: readonly ChatMessage[], opts?: LLMInvokeOptions): NodeInput<LLMResponse>;
|
|
632
|
-
stream(messages: readonly ChatMessage[], opts?: LLMInvokeOptions): AsyncIterable<string>;
|
|
633
|
-
};
|
|
634
|
-
type LLMInvokeOptions = {
|
|
635
|
-
model?: string;
|
|
636
|
-
temperature?: number;
|
|
637
|
-
maxTokens?: number;
|
|
638
|
-
tools?: readonly ToolDefinition[];
|
|
639
|
-
systemPrompt?: string;
|
|
640
|
-
signal?: AbortSignal;
|
|
641
|
-
};
|
|
642
|
-
/** A tool definition for LLM consumption. */
|
|
643
|
-
type ToolDefinition = {
|
|
644
|
-
readonly name: string;
|
|
645
|
-
readonly description: string;
|
|
646
|
-
readonly parameters: Record<string, unknown>;
|
|
647
|
-
readonly handler: (args: Record<string, unknown>) => NodeInput<unknown>;
|
|
648
|
-
/**
|
|
649
|
-
* V0 version of the backing node at `knobsAsTools()` call time (§6.0b).
|
|
650
|
-
* Snapshot — re-call `knobsAsTools()` to refresh.
|
|
651
|
-
*/
|
|
652
|
-
readonly version?: {
|
|
653
|
-
id: string;
|
|
654
|
-
version: number;
|
|
655
|
-
};
|
|
656
|
-
};
|
|
657
|
-
type AgentLoopStatus = "idle" | "thinking" | "acting" | "done" | "error";
|
|
658
|
-
/**
|
|
659
|
-
* A single chunk from any streaming source (LLM tokens, WebSocket, SSE, file tail).
|
|
660
|
-
* Generic enough for any streaming source, not just LLM.
|
|
661
|
-
*/
|
|
662
|
-
type StreamChunk = {
|
|
663
|
-
/** Identifier for the stream source (adapter name, URL, etc.). */
|
|
664
|
-
readonly source: string;
|
|
665
|
-
/** This chunk's content. */
|
|
666
|
-
readonly token: string;
|
|
667
|
-
/** Full accumulated text so far. */
|
|
668
|
-
readonly accumulated: string;
|
|
669
|
-
/** 0-based chunk counter. */
|
|
670
|
-
readonly index: number;
|
|
671
|
-
};
|
|
672
|
-
type FromLLMOptions = {
|
|
673
|
-
name?: string;
|
|
674
|
-
model?: string;
|
|
675
|
-
temperature?: number;
|
|
676
|
-
maxTokens?: number;
|
|
677
|
-
tools?: readonly ToolDefinition[];
|
|
678
|
-
systemPrompt?: string;
|
|
679
|
-
};
|
|
680
|
-
/**
|
|
681
|
-
* Reactive LLM invocation adapter. Returns a derived node that re-invokes
|
|
682
|
-
* the LLM whenever the messages dep changes.
|
|
683
|
-
*
|
|
684
|
-
* Uses `switchMap` internally — new invocations cancel stale in-flight ones.
|
|
685
|
-
*/
|
|
686
|
-
declare function fromLLM(adapter: LLMAdapter, messages: NodeInput<readonly ChatMessage[]>, opts?: FromLLMOptions): Node<LLMResponse | null>;
|
|
687
|
-
type StreamingPromptNodeOptions = {
|
|
688
|
-
name?: string;
|
|
689
|
-
model?: string;
|
|
690
|
-
temperature?: number;
|
|
691
|
-
maxTokens?: number;
|
|
692
|
-
/** Output format — `"json"` attempts JSON.parse on the final accumulated text. Default: `"text"`. */
|
|
693
|
-
format?: "text" | "json";
|
|
694
|
-
systemPrompt?: string;
|
|
695
|
-
};
|
|
696
|
-
/**
|
|
697
|
-
* Bundle returned by {@link streamingPromptNode}.
|
|
698
|
-
*/
|
|
699
|
-
type StreamingPromptNodeHandle<T> = {
|
|
700
|
-
/** Final parsed result (emits once per invocation, after stream completes). */
|
|
701
|
-
output: Node<T | null>;
|
|
702
|
-
/** Live stream topic — subscribe to `stream.latest` or `stream.events` for chunks. */
|
|
703
|
-
stream: TopicGraph<StreamChunk>;
|
|
704
|
-
/** Tear down the keepalive subscription and release resources. */
|
|
705
|
-
dispose: () => void;
|
|
706
|
-
};
|
|
707
|
-
/**
|
|
708
|
-
* Streaming LLM transform: wraps a prompt template + adapter into a reactive
|
|
709
|
-
* streaming pipeline. Re-invokes the LLM whenever any dep changes; the
|
|
710
|
-
* previous in-flight stream is canceled automatically via `switchMap`.
|
|
711
|
-
*
|
|
712
|
-
* Each token chunk is published to a {@link TopicGraph} as a {@link StreamChunk}.
|
|
713
|
-
* Extractors can mount on the topic independently (see {@link streamExtractor}).
|
|
714
|
-
* Zero overhead if nobody subscribes to the stream topic.
|
|
715
|
-
*
|
|
716
|
-
* The `output` node emits the final parsed result (like {@link promptNode}).
|
|
717
|
-
* The async boundary is handled by `fromAny` (spec §5.10 compliant).
|
|
718
|
-
*/
|
|
719
|
-
declare function streamingPromptNode<T = string>(adapter: LLMAdapter, deps: readonly Node<unknown>[], prompt: string | ((...depValues: unknown[]) => string), opts?: StreamingPromptNodeOptions): StreamingPromptNodeHandle<T>;
|
|
720
|
-
/**
|
|
721
|
-
* Mounts an extractor function on a streaming topic. Returns a derived node
|
|
722
|
-
* that emits extracted values as chunks arrive.
|
|
723
|
-
*
|
|
724
|
-
* `extractFn` receives the accumulated text from the latest chunk and returns
|
|
725
|
-
* the extracted value, or `null` if nothing detected yet. This is the building
|
|
726
|
-
* block for keyword flags, tool call detection, cost metering, etc.
|
|
727
|
-
*
|
|
728
|
-
* @param streamTopic - The stream topic to extract from.
|
|
729
|
-
* @param extractFn - `(accumulated: string) => T | null`.
|
|
730
|
-
* @param opts - Optional name.
|
|
731
|
-
* @returns Derived node emitting extracted values.
|
|
732
|
-
*/
|
|
733
|
-
declare function streamExtractor<T>(streamTopic: TopicGraph<StreamChunk>, extractFn: (accumulated: string) => T | null, opts?: {
|
|
734
|
-
name?: string;
|
|
735
|
-
/**
|
|
736
|
-
* Optional structural equals for the extractor output. When two
|
|
737
|
-
* consecutive chunks produce structurally-equal outputs, the framework
|
|
738
|
-
* emits `RESOLVED` instead of `DATA`, saving downstream work. Default:
|
|
739
|
-
* reference equality (`Object.is`). The library cannot know your
|
|
740
|
-
* output shape — supply this when your `extractFn` returns structured
|
|
741
|
-
* objects or arrays.
|
|
742
|
-
*/
|
|
743
|
-
equals?: (a: T | null, b: T | null) => boolean;
|
|
744
|
-
}): Node<T | null>;
|
|
745
|
-
/** A keyword match detected in the stream. */
|
|
746
|
-
type KeywordFlag = {
|
|
747
|
-
readonly label: string;
|
|
748
|
-
readonly pattern: RegExp;
|
|
749
|
-
readonly match: string;
|
|
750
|
-
readonly position: number;
|
|
751
|
-
};
|
|
752
|
-
type KeywordFlagExtractorOptions = {
|
|
753
|
-
patterns: readonly {
|
|
754
|
-
pattern: RegExp;
|
|
755
|
-
label: string;
|
|
756
|
-
}[];
|
|
757
|
-
name?: string;
|
|
758
|
-
/**
|
|
759
|
-
* Maximum length of any pattern's literal text. Used as an overlap window
|
|
760
|
-
* when cursoring through the accumulated stream so matches that span
|
|
761
|
-
* chunk boundaries aren't missed. Default: 128.
|
|
762
|
-
*/
|
|
763
|
-
maxPatternLength?: number;
|
|
764
|
-
};
|
|
765
|
-
/**
|
|
766
|
-
* Mounts a keyword-flag extractor on a streaming topic. Scans accumulated text
|
|
767
|
-
* for all configured patterns and emits an array of matches.
|
|
768
|
-
*
|
|
769
|
-
* Use cases: design invariant violations (`setTimeout`, `EventEmitter`), PII
|
|
770
|
-
* detection (SSN, email, phone), toxicity keywords, off-track reasoning.
|
|
771
|
-
*
|
|
772
|
-
* **Streaming optimization.** Maintains a cursor across chunks in `ctx.store`
|
|
773
|
-
* so each chunk scans only the delta region `accumulated.slice(scannedTo -
|
|
774
|
-
* maxPatternLength)` — not the full string. Default structural equals
|
|
775
|
-
* suppresses DATA emission when no new flags were found this chunk.
|
|
776
|
-
*/
|
|
777
|
-
declare function keywordFlagExtractor(streamTopic: TopicGraph<StreamChunk>, opts: KeywordFlagExtractorOptions): Node<readonly KeywordFlag[]>;
|
|
778
|
-
/** A tool call detected in the stream. */
|
|
779
|
-
type ExtractedToolCall = {
|
|
780
|
-
readonly name: string;
|
|
781
|
-
readonly arguments: Record<string, unknown>;
|
|
782
|
-
readonly raw: string;
|
|
783
|
-
readonly startIndex: number;
|
|
784
|
-
};
|
|
785
|
-
/**
|
|
786
|
-
* Mounts a tool-call extractor on a streaming topic. Scans accumulated text
|
|
787
|
-
* for complete JSON objects containing `"name"` and `"arguments"` keys (the
|
|
788
|
-
* standard tool_call shape). Partial JSON is ignored until the closing brace.
|
|
789
|
-
*
|
|
790
|
-
* Feeds into the tool interception chain for reactive tool gating mid-stream.
|
|
791
|
-
*
|
|
792
|
-
* **Streaming optimization.** Maintains a cursor (`scanFrom`) in `ctx.store`
|
|
793
|
-
* so each chunk resumes brace-scanning from the position after the last
|
|
794
|
-
* complete parse (or the last incomplete open brace). Already-parsed objects
|
|
795
|
-
* are not re-parsed. Default structural equals suppresses DATA emission when
|
|
796
|
-
* no new tool call completed this chunk.
|
|
797
|
-
*/
|
|
798
|
-
declare function toolCallExtractor(streamTopic: TopicGraph<StreamChunk>, opts?: {
|
|
799
|
-
name?: string;
|
|
800
|
-
}): Node<readonly ExtractedToolCall[]>;
|
|
801
|
-
/** A cost meter reading from the stream. */
|
|
802
|
-
type CostMeterReading = {
|
|
803
|
-
readonly chunkCount: number;
|
|
804
|
-
readonly charCount: number;
|
|
805
|
-
readonly estimatedTokens: number;
|
|
806
|
-
};
|
|
807
|
-
type CostMeterOptions = {
|
|
808
|
-
/** Characters per token approximation. Default: 4 (GPT-family). */
|
|
809
|
-
charsPerToken?: number;
|
|
810
|
-
name?: string;
|
|
811
|
-
};
|
|
812
|
-
/**
|
|
813
|
-
* Mounts a cost meter on a streaming topic. Counts chunks, characters, and
|
|
814
|
-
* estimates token count. Compose with `budgetGate` for hard-stop when LLM
|
|
815
|
-
* output exceeds budget mid-generation.
|
|
816
|
-
*
|
|
817
|
-
* Default structural equals suppresses DATA emission when two consecutive
|
|
818
|
-
* readings are identical (same chunk count + char count + token estimate).
|
|
819
|
-
*/
|
|
820
|
-
declare function costMeterExtractor(streamTopic: TopicGraph<StreamChunk>, opts?: CostMeterOptions): Node<CostMeterReading>;
|
|
821
|
-
/** Options for {@link redactor}. */
|
|
822
|
-
type RedactorOptions = {
|
|
823
|
-
name?: string;
|
|
824
|
-
};
|
|
825
|
-
/**
|
|
826
|
-
* Stream extractor that replaces matched patterns in the accumulated text.
|
|
827
|
-
*
|
|
828
|
-
* Returns a derived node emitting a sanitized `StreamChunk` on every chunk:
|
|
829
|
-
* `accumulated` and `token` have matched substrings replaced by `replaceFn`.
|
|
830
|
-
* The default `replaceFn` replaces with `"[REDACTED]"`.
|
|
831
|
-
*
|
|
832
|
-
* Compose with `contentGate` for in-flight safety pipelines.
|
|
833
|
-
*
|
|
834
|
-
* @param streamTopic - Streaming topic to monitor.
|
|
835
|
-
* @param patterns - Array of RegExps to match against accumulated text.
|
|
836
|
-
* @param replaceFn - Replacement producer (default: always `"[REDACTED]"`).
|
|
837
|
-
*/
|
|
838
|
-
declare function redactor(streamTopic: TopicGraph<StreamChunk>, patterns: RegExp[], replaceFn?: (match: string, pattern: RegExp) => string, opts?: RedactorOptions): Node<StreamChunk>;
|
|
839
|
-
/** Content safety decision. */
|
|
840
|
-
type ContentDecision = "allow" | "block" | "review";
|
|
841
|
-
/** Options for {@link contentGate}. */
|
|
842
|
-
type ContentGateOptions = {
|
|
843
|
-
/**
|
|
844
|
-
* Hard-block threshold multiplier (default 1.5).
|
|
845
|
-
* Scores above `threshold * hardMultiplier` emit `"block"`.
|
|
846
|
-
* Scores between `threshold` and that emit `"review"`.
|
|
847
|
-
*/
|
|
848
|
-
hardMultiplier?: number;
|
|
849
|
-
name?: string;
|
|
850
|
-
};
|
|
851
|
-
/**
|
|
852
|
-
* Derived node that classifies accumulated stream text as `"allow"`,
|
|
853
|
-
* `"review"`, or `"block"` based on a classifier score.
|
|
854
|
-
*
|
|
855
|
-
* Emits a three-way decision on every new chunk:
|
|
856
|
-
* - `"allow"` — score below `threshold`
|
|
857
|
-
* - `"review"` — score in `[threshold, threshold × hardMultiplier)`
|
|
858
|
-
* - `"block"` — score at or above `threshold × hardMultiplier`
|
|
859
|
-
*
|
|
860
|
-
* Wire the output into a `valve` (automatic) or `gate` (human approval).
|
|
861
|
-
* This node does not itself control flow — it just classifies.
|
|
862
|
-
*
|
|
863
|
-
* @param streamTopic - Streaming topic to classify.
|
|
864
|
-
* @param classifier - `(accumulated: string) => number` scoring function, or
|
|
865
|
-
* a `Node<number>` for live scores.
|
|
866
|
-
* @param threshold - Score at which output becomes "review" or "block".
|
|
867
|
-
*/
|
|
868
|
-
declare function contentGate(streamTopic: TopicGraph<StreamChunk>, classifier: ((accumulated: string) => number) | Node<number>, threshold: number, opts?: ContentGateOptions): Node<ContentDecision>;
|
|
869
|
-
type GatedStreamOptions = StreamingPromptNodeOptions & {
|
|
870
|
-
/** Gate options (maxPending, startOpen). */
|
|
871
|
-
gate?: Omit<GateOptions, "meta">;
|
|
872
|
-
};
|
|
873
|
-
/**
|
|
874
|
-
* Bundle returned by {@link gatedStream}.
|
|
875
|
-
*/
|
|
876
|
-
type GatedStreamHandle<T> = {
|
|
877
|
-
/** Final parsed result (after gate approval). */
|
|
878
|
-
output: Node<T | null>;
|
|
879
|
-
/** Live stream topic — subscribe to `stream.latest` for chunks. */
|
|
880
|
-
stream: TopicGraph<StreamChunk>;
|
|
881
|
-
/** Gate controller — approve, reject (aborts in-flight stream), modify. */
|
|
882
|
-
gate: GateController<T | null>;
|
|
883
|
-
/** Tear down everything. */
|
|
884
|
-
dispose: () => void;
|
|
885
|
-
};
|
|
886
|
-
/**
|
|
887
|
-
* Streaming LLM transform with human-in-the-loop gate integration.
|
|
888
|
-
*
|
|
889
|
-
* Composes {@link streamingPromptNode} with {@link gate} so that:
|
|
890
|
-
* - `gate.reject()` discards the pending value **and** aborts the in-flight
|
|
891
|
-
* stream (cancels the `AbortController`).
|
|
892
|
-
* - `gate.modify()` transforms the pending value before forwarding downstream.
|
|
893
|
-
* - `gate.approve()` forwards the final result as normal.
|
|
894
|
-
*
|
|
895
|
-
* The abort-on-reject works by toggling an internal cancel signal that causes
|
|
896
|
-
* the `switchMap` inside `streamingPromptNode` to restart with an empty message
|
|
897
|
-
* list, which triggers the `AbortController.abort()` in the async generator's
|
|
898
|
-
* `finally` block.
|
|
899
|
-
*/
|
|
900
|
-
declare function gatedStream<T = string>(graph: Graph, name: string, adapter: LLMAdapter, deps: readonly Node<unknown>[], prompt: string | ((...depValues: unknown[]) => string), opts?: GatedStreamOptions): GatedStreamHandle<T>;
|
|
901
|
-
type PromptNodeOptions = {
|
|
902
|
-
name?: string;
|
|
903
|
-
model?: string;
|
|
904
|
-
temperature?: number;
|
|
905
|
-
maxTokens?: number;
|
|
906
|
-
/** Output format — `"json"` attempts JSON.parse on the response. Default: `"text"`. */
|
|
907
|
-
format?: "text" | "json";
|
|
908
|
-
/** Number of retries on transient errors. Default: 0. */
|
|
909
|
-
retries?: number;
|
|
910
|
-
/** Cache LLM responses for identical inputs. Default: false. */
|
|
911
|
-
cache?: boolean;
|
|
912
|
-
systemPrompt?: string;
|
|
913
|
-
meta?: Record<string, unknown>;
|
|
914
|
-
};
|
|
915
|
-
/**
|
|
916
|
-
* Universal LLM transform: wraps a prompt template + model adapter into a reactive derived node.
|
|
917
|
-
* Re-invokes the LLM whenever any dep changes. Suitable for triage, QA, hypothesis, parity, etc.
|
|
918
|
-
*
|
|
919
|
-
* @param adapter - LLM adapter (provider-agnostic).
|
|
920
|
-
* @param deps - Input nodes whose values feed the prompt.
|
|
921
|
-
* @param prompt - Static string or template function receiving dep values.
|
|
922
|
-
* @param opts - Optional configuration.
|
|
923
|
-
* @returns `Node` emitting LLM responses (string or parsed JSON).
|
|
924
|
-
*/
|
|
925
|
-
declare function promptNode<T = string>(adapter: LLMAdapter, deps: readonly Node<unknown>[], prompt: string | ((...depValues: unknown[]) => string), opts?: PromptNodeOptions): Node<T | null>;
|
|
926
|
-
type ChatStreamOptions = {
|
|
927
|
-
graph?: GraphOptions;
|
|
928
|
-
maxMessages?: number;
|
|
929
|
-
};
|
|
930
|
-
declare class ChatStreamGraph extends Graph {
|
|
931
|
-
private readonly _log;
|
|
932
|
-
readonly messages: Node<readonly ChatMessage[]>;
|
|
933
|
-
readonly latest: Node<ChatMessage | null>;
|
|
934
|
-
readonly messageCount: Node<number>;
|
|
935
|
-
constructor(name: string, opts?: ChatStreamOptions);
|
|
936
|
-
append(role: ChatMessage["role"], content: string, extra?: Partial<ChatMessage>): void;
|
|
937
|
-
appendToolResult(callId: string, content: string): void;
|
|
938
|
-
clear(): void;
|
|
939
|
-
allMessages(): readonly ChatMessage[];
|
|
940
|
-
}
|
|
941
|
-
declare function chatStream(name: string, opts?: ChatStreamOptions): ChatStreamGraph;
|
|
942
|
-
type ToolRegistryOptions = {
|
|
943
|
-
graph?: GraphOptions;
|
|
944
|
-
};
|
|
945
|
-
declare class ToolRegistryGraph extends Graph {
|
|
946
|
-
readonly definitions: Node<ReadonlyMap<string, ToolDefinition>>;
|
|
947
|
-
readonly schemas: Node<readonly ToolDefinition[]>;
|
|
948
|
-
constructor(name: string, opts?: ToolRegistryOptions);
|
|
949
|
-
register(tool: ToolDefinition): void;
|
|
950
|
-
unregister(name: string): void;
|
|
951
|
-
execute(name: string, args: Record<string, unknown>): Promise<unknown>;
|
|
952
|
-
getDefinition(name: string): ToolDefinition | undefined;
|
|
953
|
-
}
|
|
954
|
-
declare function toolRegistry(name: string, opts?: ToolRegistryOptions): ToolRegistryGraph;
|
|
955
|
-
/**
|
|
956
|
-
* Assembles a system prompt from reactive sections. Each section is a
|
|
957
|
-
* `NodeInput<string>` — the prompt updates when any section changes.
|
|
958
|
-
*/
|
|
959
|
-
type SystemPromptHandle = Node<string> & {
|
|
960
|
-
dispose: () => void;
|
|
961
|
-
};
|
|
962
|
-
declare function systemPromptBuilder(sections: readonly NodeInput<string>[], opts?: {
|
|
963
|
-
separator?: string;
|
|
964
|
-
name?: string;
|
|
965
|
-
}): SystemPromptHandle;
|
|
966
|
-
type LLMExtractorOptions = {
|
|
967
|
-
adapter: LLMAdapter;
|
|
968
|
-
model?: string;
|
|
969
|
-
temperature?: number;
|
|
970
|
-
maxTokens?: number;
|
|
971
|
-
};
|
|
972
|
-
/**
|
|
973
|
-
* Returns an `extractFn` callback for `distill()` that invokes an LLM to
|
|
974
|
-
* extract structured memories from raw input.
|
|
975
|
-
*
|
|
976
|
-
* The system prompt should instruct the LLM to return JSON matching
|
|
977
|
-
* `Extraction<TMem>` shape: `{ upsert: [{ key, value }], remove?: [key] }`.
|
|
978
|
-
*/
|
|
979
|
-
declare function llmExtractor<TRaw, TMem>(systemPrompt: string, opts: LLMExtractorOptions): (raw: TRaw, existing: ReadonlyMap<string, TMem>) => NodeInput<Extraction<TMem>>;
|
|
980
|
-
type LLMConsolidatorOptions = LLMExtractorOptions;
|
|
981
|
-
/**
|
|
982
|
-
* Returns a `consolidateFn` callback for `distill()` that invokes an LLM to
|
|
983
|
-
* cluster and merge related memories.
|
|
984
|
-
*/
|
|
985
|
-
declare function llmConsolidator<TMem>(systemPrompt: string, opts: LLMConsolidatorOptions): (entries: ReadonlyMap<string, TMem>) => NodeInput<Extraction<TMem>>;
|
|
986
|
-
/** Scores for the three admission dimensions. Each 0–1. */
|
|
987
|
-
type AdmissionScores = {
|
|
988
|
-
readonly persistence: number;
|
|
989
|
-
readonly structure: number;
|
|
990
|
-
readonly personalValue: number;
|
|
991
|
-
};
|
|
992
|
-
type AdmissionScore3DOptions = {
|
|
993
|
-
/** Custom scoring function. Default: rule-based (all dimensions 0.5). */
|
|
994
|
-
scoreFn?: (raw: unknown) => AdmissionScores;
|
|
995
|
-
/** Minimum persistence score to admit (default 0.3). */
|
|
996
|
-
persistenceThreshold?: number;
|
|
997
|
-
/** Minimum personalValue score to admit (default 0.3). */
|
|
998
|
-
personalValueThreshold?: number;
|
|
999
|
-
/** Require structure score > 0 to admit (default false). */
|
|
1000
|
-
requireStructured?: boolean;
|
|
1001
|
-
};
|
|
1002
|
-
/**
|
|
1003
|
-
* Creates a 3D admission filter function compatible with `agentMemory`'s
|
|
1004
|
-
* `admissionFilter` option. Scores each candidate on persistence, structure,
|
|
1005
|
-
* and personalValue, then applies thresholds.
|
|
1006
|
-
*/
|
|
1007
|
-
declare function admissionFilter3D(opts?: AdmissionScore3DOptions): (raw: unknown) => boolean;
|
|
1008
|
-
type MemoryTier = "permanent" | "active" | "archived";
|
|
1009
|
-
type MemoryTiersOptions<TMem> = {
|
|
1010
|
-
/** Exponential decay rate per second for active tier.
|
|
1011
|
-
* Default: 7-day half-life ≈ ln(2)/(7×86400) ≈ 0.00000114. */
|
|
1012
|
-
decayRate?: number;
|
|
1013
|
-
/** Max entries in the active tier before archiving lowest-scored (default 1000). */
|
|
1014
|
-
maxActive?: number;
|
|
1015
|
-
/** Score threshold below which active entries get archived (default 0.1). */
|
|
1016
|
-
archiveThreshold?: number;
|
|
1017
|
-
/** Predicate: true → entry belongs in permanent tier (default: never). */
|
|
1018
|
-
permanentFilter?: (key: string, mem: TMem) => boolean;
|
|
1019
|
-
/** Storage tier for the archive. Omit to disable archiving. */
|
|
1020
|
-
archiveTier?: StorageTier;
|
|
1021
|
-
/** Options forwarded to `graph.attachStorage` for the archive tier. */
|
|
1022
|
-
archiveStorageOptions?: GraphAttachStorageOptions;
|
|
1023
|
-
};
|
|
1024
|
-
type MemoryTiersBundle<TMem> = {
|
|
1025
|
-
/** Permanent tier: never evicted. */
|
|
1026
|
-
readonly permanent: LightCollectionBundle<TMem>;
|
|
1027
|
-
/** Active entries node (reactive, holds ReadonlyMap). */
|
|
1028
|
-
readonly activeEntries: Node<unknown>;
|
|
1029
|
-
/** Archive storage handle (null if no tier configured). */
|
|
1030
|
-
readonly archiveHandle: StorageHandle | null;
|
|
1031
|
-
/** Classify a key into its current tier. */
|
|
1032
|
-
tierOf: (key: string) => MemoryTier;
|
|
1033
|
-
/** Move a key to the permanent tier. */
|
|
1034
|
-
markPermanent: (key: string, value: TMem) => void;
|
|
1035
|
-
};
|
|
1036
|
-
type RetrievalQuery = {
|
|
1037
|
-
readonly text?: string;
|
|
1038
|
-
readonly vector?: readonly number[];
|
|
1039
|
-
readonly entityIds?: readonly string[];
|
|
1040
|
-
};
|
|
1041
|
-
type RetrievalPipelineOptions<TMem> = {
|
|
1042
|
-
/** Max candidates from vector search (default 20). */
|
|
1043
|
-
topK?: number;
|
|
1044
|
-
/** KG expansion depth in hops (default 1). */
|
|
1045
|
-
graphDepth?: number;
|
|
1046
|
-
/** Token budget for final packing (default 2000). */
|
|
1047
|
-
budget?: number;
|
|
1048
|
-
/** Cost function for budget packing. */
|
|
1049
|
-
cost: (mem: TMem) => number;
|
|
1050
|
-
/** Score function for ranking. */
|
|
1051
|
-
score: (mem: TMem, context: unknown) => number;
|
|
1052
|
-
};
|
|
1053
|
-
/** A single entry in the retrieval result, with causal trace metadata. */
|
|
1054
|
-
type RetrievalEntry<TMem> = {
|
|
1055
|
-
readonly key: string;
|
|
1056
|
-
readonly value: TMem;
|
|
1057
|
-
readonly score: number;
|
|
1058
|
-
readonly sources: ReadonlyArray<"vector" | "graph" | "store">;
|
|
1059
|
-
};
|
|
1060
|
-
/** Causal trace for a retrieval run. */
|
|
1061
|
-
type RetrievalTrace<TMem> = {
|
|
1062
|
-
readonly vectorCandidates: ReadonlyArray<VectorSearchResult<TMem>>;
|
|
1063
|
-
readonly graphExpanded: ReadonlyArray<string>;
|
|
1064
|
-
readonly ranked: ReadonlyArray<RetrievalEntry<TMem>>;
|
|
1065
|
-
readonly packed: ReadonlyArray<RetrievalEntry<TMem>>;
|
|
1066
|
-
};
|
|
1067
|
-
type AgentMemoryOptions<TMem = unknown> = {
|
|
1068
|
-
graph?: GraphOptions;
|
|
1069
|
-
/** LLM adapter for extraction and consolidation. */
|
|
1070
|
-
adapter?: LLMAdapter;
|
|
1071
|
-
/** System prompt for the extractor LLM. */
|
|
1072
|
-
extractPrompt?: string;
|
|
1073
|
-
/** Custom extractFn (overrides adapter + extractPrompt). */
|
|
1074
|
-
extractFn?: (raw: unknown, existing: ReadonlyMap<string, TMem>) => NodeInput<Extraction<TMem>>;
|
|
1075
|
-
/** System prompt for the consolidation LLM. */
|
|
1076
|
-
consolidatePrompt?: string;
|
|
1077
|
-
/** Custom consolidateFn (overrides adapter + consolidatePrompt). */
|
|
1078
|
-
consolidateFn?: (entries: ReadonlyMap<string, TMem>) => NodeInput<Extraction<TMem>>;
|
|
1079
|
-
/** Reactive trigger for consolidation (caller supplies e.g. `fromTimer`). */
|
|
1080
|
-
consolidateTrigger?: NodeInput<unknown>;
|
|
1081
|
-
/** Score function for budget packing (required). */
|
|
1082
|
-
score: (mem: TMem, context: unknown) => number;
|
|
1083
|
-
/** Cost function for budget packing (required). */
|
|
1084
|
-
cost: (mem: TMem) => number;
|
|
1085
|
-
/** Token budget for compact view (default 2000). */
|
|
1086
|
-
budget?: number;
|
|
1087
|
-
/** Context node for scoring. */
|
|
1088
|
-
context?: NodeInput<unknown>;
|
|
1089
|
-
/** Admission filter (default: admit all). */
|
|
1090
|
-
admissionFilter?: (candidate: unknown) => boolean;
|
|
1091
|
-
/** Vector index dimensions (> 0 enables vector index for retrieval). */
|
|
1092
|
-
vectorDimensions?: number;
|
|
1093
|
-
/** Extract embedding vector from a memory entry (enables vector index). */
|
|
1094
|
-
embedFn?: (mem: TMem) => readonly number[] | undefined;
|
|
1095
|
-
/** Enable knowledge graph for entity/relation tracking. */
|
|
1096
|
-
enableKnowledgeGraph?: boolean;
|
|
1097
|
-
/** Extract entities and relations from a memory entry. */
|
|
1098
|
-
entityFn?: (key: string, mem: TMem) => {
|
|
1099
|
-
entities?: Array<{
|
|
1100
|
-
id: string;
|
|
1101
|
-
value: unknown;
|
|
1102
|
-
}>;
|
|
1103
|
-
relations?: Array<{
|
|
1104
|
-
from: string;
|
|
1105
|
-
to: string;
|
|
1106
|
-
relation: string;
|
|
1107
|
-
weight?: number;
|
|
1108
|
-
}>;
|
|
1109
|
-
} | undefined;
|
|
1110
|
-
/** 3-tier storage configuration. Omit to use single-tier (existing behavior). */
|
|
1111
|
-
tiers?: MemoryTiersOptions<TMem>;
|
|
1112
|
-
/** Retrieval pipeline configuration. Requires vector index or knowledge graph. */
|
|
1113
|
-
retrieval?: {
|
|
1114
|
-
/** Max candidates from vector search (default 20). */
|
|
1115
|
-
topK?: number;
|
|
1116
|
-
/** KG expansion depth in hops (default 1). */
|
|
1117
|
-
graphDepth?: number;
|
|
1118
|
-
};
|
|
1119
|
-
/** Periodic reflection/consolidation configuration. */
|
|
1120
|
-
reflection?: {
|
|
1121
|
-
/** Interval in ms between consolidation runs (default 300_000 = 5 min). */
|
|
1122
|
-
interval?: number;
|
|
1123
|
-
/** Enable/disable periodic reflection (default true when consolidateFn is available). */
|
|
1124
|
-
enabled?: boolean;
|
|
1125
|
-
};
|
|
1126
|
-
};
|
|
1127
|
-
type AgentMemoryGraph<TMem = unknown> = Graph & {
|
|
1128
|
-
readonly distillBundle: DistillBundle<TMem>;
|
|
1129
|
-
readonly compact: Node<Array<{
|
|
1130
|
-
key: string;
|
|
1131
|
-
value: TMem;
|
|
1132
|
-
score: number;
|
|
1133
|
-
}>>;
|
|
1134
|
-
readonly size: Node<number>;
|
|
1135
|
-
/** Vector index bundle (null if not enabled). */
|
|
1136
|
-
readonly vectors: VectorIndexBundle<TMem> | null;
|
|
1137
|
-
/** Knowledge graph (null if not enabled). */
|
|
1138
|
-
readonly kg: KnowledgeGraphGraph<unknown, string> | null;
|
|
1139
|
-
/** Memory tiers bundle (null if not configured). */
|
|
1140
|
-
readonly memoryTiers: MemoryTiersBundle<TMem> | null;
|
|
1141
|
-
/** Retrieval result node (null if no retrieval pipeline configured). */
|
|
1142
|
-
readonly retrieval: Node<ReadonlyArray<RetrievalEntry<TMem>>> | null;
|
|
1143
|
-
/** Latest retrieval trace for observability (null if no retrieval pipeline). */
|
|
1144
|
-
readonly retrievalTrace: Node<RetrievalTrace<TMem> | null> | null;
|
|
1145
|
-
/**
|
|
1146
|
-
* Execute a retrieval query (null if no retrieval pipeline).
|
|
1147
|
-
*
|
|
1148
|
-
* **Synchronous consumer API** — returns the result immediately and batch-writes
|
|
1149
|
-
* `retrieval` and `retrievalTrace` state nodes for observers. Reads the store
|
|
1150
|
-
* snapshot and context value **at call time** (external-boundary read).
|
|
1151
|
-
*
|
|
1152
|
-
* **Do not call from inside a reactive fn body** (derived fn, subscribe callback,
|
|
1153
|
-
* effect body). The cache reads would become transitive protocol violations and
|
|
1154
|
-
* may observe wave-progressive rather than wave-final state.
|
|
1155
|
-
*
|
|
1156
|
-
* **Caller-batch caveat:** if invoked inside a caller's `batch(() => ...)` alongside
|
|
1157
|
-
* upstream store mutations, the store snapshot reflects what has been committed to
|
|
1158
|
-
* `store.entries.cache` at call time. State-backed stores update cache synchronously
|
|
1159
|
-
* so batched inserts are visible; derived-backed store transforms may defer. If you
|
|
1160
|
-
* need fresh state after batched mutations, call `retrieve` after the batch returns.
|
|
1161
|
-
*/
|
|
1162
|
-
readonly retrieve: ((query: RetrievalQuery) => ReadonlyArray<RetrievalEntry<TMem>>) | null;
|
|
1163
|
-
};
|
|
1164
|
-
declare function agentMemory<TMem = unknown>(name: string, source: NodeInput<unknown>, opts: AgentMemoryOptions<TMem>): AgentMemoryGraph<TMem>;
|
|
1165
|
-
type AgentLoopOptions = {
|
|
1166
|
-
graph?: GraphOptions;
|
|
1167
|
-
adapter: LLMAdapter;
|
|
1168
|
-
tools?: readonly ToolDefinition[];
|
|
1169
|
-
systemPrompt?: string;
|
|
1170
|
-
maxTurns?: number;
|
|
1171
|
-
stopWhen?: (response: LLMResponse) => boolean;
|
|
1172
|
-
onToolCall?: (call: ToolCall) => void;
|
|
1173
|
-
maxMessages?: number;
|
|
1174
|
-
model?: string;
|
|
1175
|
-
temperature?: number;
|
|
1176
|
-
maxTokens?: number;
|
|
1177
|
-
};
|
|
1178
|
-
declare class AgentLoopGraph extends Graph {
|
|
1179
|
-
readonly chat: ChatStreamGraph;
|
|
1180
|
-
readonly tools: ToolRegistryGraph;
|
|
1181
|
-
readonly status: Node<AgentLoopStatus>;
|
|
1182
|
-
readonly turnCount: Node<number>;
|
|
1183
|
-
readonly lastResponse: Node<LLMResponse | null>;
|
|
1184
|
-
private readonly _statusState;
|
|
1185
|
-
private readonly _turnCountState;
|
|
1186
|
-
private readonly _adapter;
|
|
1187
|
-
private readonly _maxTurns;
|
|
1188
|
-
private readonly _stopWhen?;
|
|
1189
|
-
private readonly _onToolCall?;
|
|
1190
|
-
private readonly _systemPrompt?;
|
|
1191
|
-
private readonly _model?;
|
|
1192
|
-
private readonly _temperature?;
|
|
1193
|
-
private readonly _maxTokens?;
|
|
1194
|
-
private _running;
|
|
1195
|
-
private _abortController;
|
|
1196
|
-
constructor(name: string, opts: AgentLoopOptions);
|
|
1197
|
-
/**
|
|
1198
|
-
* Start the agent loop with a user message. The loop runs reactively:
|
|
1199
|
-
* think (LLM call) → act (tool execution) → repeat until done.
|
|
1200
|
-
*
|
|
1201
|
-
* Messages accumulate across calls. Call `chat.clear()` before `run()`
|
|
1202
|
-
* to reset conversation history.
|
|
1203
|
-
*/
|
|
1204
|
-
run(userMessage: string): Promise<LLMResponse | null>;
|
|
1205
|
-
private _invokeLLM;
|
|
1206
|
-
private _shouldStop;
|
|
1207
|
-
destroy(): void;
|
|
1208
|
-
}
|
|
1209
|
-
declare function agentLoop(name: string, opts: AgentLoopOptions): AgentLoopGraph;
|
|
1210
|
-
/** OpenAI function-calling tool schema. */
|
|
1211
|
-
type OpenAIToolSchema = {
|
|
1212
|
-
readonly type: "function";
|
|
1213
|
-
readonly function: {
|
|
1214
|
-
readonly name: string;
|
|
1215
|
-
readonly description: string;
|
|
1216
|
-
readonly parameters: Record<string, unknown>;
|
|
1217
|
-
};
|
|
1218
|
-
};
|
|
1219
|
-
/** MCP (Model Context Protocol) tool schema. */
|
|
1220
|
-
type McpToolSchema = {
|
|
1221
|
-
readonly name: string;
|
|
1222
|
-
readonly description: string;
|
|
1223
|
-
readonly inputSchema: Record<string, unknown>;
|
|
1224
|
-
};
|
|
1225
|
-
/** Result of {@link knobsAsTools}. */
|
|
1226
|
-
type KnobsAsToolsResult = {
|
|
1227
|
-
/** OpenAI function-calling tool schemas. */
|
|
1228
|
-
readonly openai: readonly OpenAIToolSchema[];
|
|
1229
|
-
/** MCP tool schemas. */
|
|
1230
|
-
readonly mcp: readonly McpToolSchema[];
|
|
1231
|
-
/** GraphReFly ToolDefinitions with handlers that call `graph.set()`. */
|
|
1232
|
-
readonly definitions: readonly ToolDefinition[];
|
|
1233
|
-
};
|
|
1234
|
-
/**
|
|
1235
|
-
* Derive tool schemas from a graph's writable (knob) nodes.
|
|
1236
|
-
*
|
|
1237
|
-
* Knobs are state nodes whose `meta.access` is `"llm"`, `"both"`, or absent
|
|
1238
|
-
* (default: writable). Each knob becomes a tool that calls `graph.set()`.
|
|
1239
|
-
*
|
|
1240
|
-
* Speaks **domain language** (spec §5.4): the returned schemas use node names
|
|
1241
|
-
* and meta descriptions — no protocol internals exposed.
|
|
1242
|
-
*
|
|
1243
|
-
* @param graph - The graph to introspect.
|
|
1244
|
-
* @param actor - Optional actor for guard-scoped describe.
|
|
1245
|
-
* @returns OpenAI, MCP, and GraphReFly tool schemas.
|
|
1246
|
-
*/
|
|
1247
|
-
declare function knobsAsTools(graph: Graph, actor?: Actor): KnobsAsToolsResult;
|
|
1248
|
-
type GaugesAsContextOptions = {
|
|
1249
|
-
/** Group gauges by `meta.tags` (default true). */
|
|
1250
|
-
groupByTags?: boolean;
|
|
1251
|
-
/** Separator between gauge lines (default "\n"). */
|
|
1252
|
-
separator?: string;
|
|
1253
|
-
/**
|
|
1254
|
-
* V0 delta mode (§6.0b): only include nodes whose `v.version` exceeds
|
|
1255
|
-
* the corresponding entry in this map. Nodes without V0 or not in the
|
|
1256
|
-
* map are always included. Callers maintain this map across calls.
|
|
1257
|
-
*
|
|
1258
|
-
* The `id` field guards against node replacement: if a node is removed
|
|
1259
|
-
* and re-added under the same name (new id), it is always included.
|
|
1260
|
-
*/
|
|
1261
|
-
sinceVersion?: ReadonlyMap<string, {
|
|
1262
|
-
id: string;
|
|
1263
|
-
version: number;
|
|
1264
|
-
}>;
|
|
1265
|
-
};
|
|
1266
|
-
/**
|
|
1267
|
-
* Format a graph's readable (gauge) nodes as a context string for LLM
|
|
1268
|
-
* system prompts.
|
|
1269
|
-
*
|
|
1270
|
-
* Gauges are nodes with `meta.description` or `meta.format`. Values are
|
|
1271
|
-
* formatted using `meta.format` and `meta.unit` hints.
|
|
1272
|
-
*
|
|
1273
|
-
* @param graph - The graph to introspect.
|
|
1274
|
-
* @param actor - Optional actor for guard-scoped describe.
|
|
1275
|
-
* @param options - Formatting options.
|
|
1276
|
-
* @returns A formatted string ready for system prompt injection.
|
|
1277
|
-
*/
|
|
1278
|
-
declare function gaugesAsContext(graph: Graph, actor?: Actor, options?: GaugesAsContextOptions): string;
|
|
1279
|
-
/** Validation result from {@link validateGraphDef}. */
|
|
1280
|
-
type GraphDefValidation = {
|
|
1281
|
-
readonly valid: boolean;
|
|
1282
|
-
readonly errors: readonly string[];
|
|
1283
|
-
};
|
|
1284
|
-
/**
|
|
1285
|
-
* Validate an LLM-generated graph definition before passing to
|
|
1286
|
-
* `Graph.fromSnapshot()`.
|
|
1287
|
-
*
|
|
1288
|
-
* Checks:
|
|
1289
|
-
* - Required fields: `name`, `nodes`, `edges`
|
|
1290
|
-
* - Node types are valid enum values
|
|
1291
|
-
* - Edge `from`/`to` reference existing nodes
|
|
1292
|
-
* - No duplicate edge entries
|
|
1293
|
-
*
|
|
1294
|
-
* @param def - The graph definition to validate (parsed JSON).
|
|
1295
|
-
* @returns Validation result with errors array.
|
|
1296
|
-
*/
|
|
1297
|
-
declare function validateGraphDef(def: unknown): GraphDefValidation;
|
|
1298
|
-
type GraphFromSpecOptions = {
|
|
1299
|
-
model?: string;
|
|
1300
|
-
temperature?: number;
|
|
1301
|
-
maxTokens?: number;
|
|
1302
|
-
/** Callback to construct topology before values are applied (passed to `Graph.fromSnapshot`). */
|
|
1303
|
-
build?: (g: Graph) => void;
|
|
1304
|
-
/** Extra instructions appended to the system prompt. */
|
|
1305
|
-
systemPromptExtra?: string;
|
|
1306
|
-
};
|
|
1307
|
-
/**
|
|
1308
|
-
* Ask an LLM to compose a Graph from a natural-language description.
|
|
1309
|
-
*
|
|
1310
|
-
* The LLM returns a JSON graph definition which is validated and then
|
|
1311
|
-
* constructed via `Graph.fromSnapshot()`.
|
|
1312
|
-
*
|
|
1313
|
-
* @param naturalLanguage - The problem/use-case description.
|
|
1314
|
-
* @param adapter - LLM adapter for the generation call.
|
|
1315
|
-
* @param opts - Model options and optional `build` callback for node factories.
|
|
1316
|
-
* @returns A constructed Graph.
|
|
1317
|
-
* @throws On invalid LLM output or validation failure.
|
|
1318
|
-
*/
|
|
1319
|
-
declare function graphFromSpec(naturalLanguage: string, adapter: LLMAdapter, opts?: GraphFromSpecOptions): Promise<Graph>;
|
|
1320
|
-
/** A single operation in a strategy plan. */
|
|
1321
|
-
type StrategyOperation = {
|
|
1322
|
-
readonly type: "add_node";
|
|
1323
|
-
readonly name: string;
|
|
1324
|
-
readonly nodeType: string;
|
|
1325
|
-
readonly meta?: Record<string, unknown>;
|
|
1326
|
-
readonly initial?: unknown;
|
|
1327
|
-
} | {
|
|
1328
|
-
readonly type: "remove_node";
|
|
1329
|
-
readonly name: string;
|
|
1330
|
-
} | {
|
|
1331
|
-
readonly type: "connect";
|
|
1332
|
-
readonly from: string;
|
|
1333
|
-
readonly to: string;
|
|
1334
|
-
} | {
|
|
1335
|
-
readonly type: "disconnect";
|
|
1336
|
-
readonly from: string;
|
|
1337
|
-
readonly to: string;
|
|
1338
|
-
} | {
|
|
1339
|
-
readonly type: "set_value";
|
|
1340
|
-
readonly name: string;
|
|
1341
|
-
readonly value: unknown;
|
|
1342
|
-
} | {
|
|
1343
|
-
readonly type: "update_meta";
|
|
1344
|
-
readonly name: string;
|
|
1345
|
-
readonly key: string;
|
|
1346
|
-
readonly value: unknown;
|
|
1347
|
-
};
|
|
1348
|
-
/** Structured strategy plan returned by {@link suggestStrategy}. */
|
|
1349
|
-
type StrategyPlan = {
|
|
1350
|
-
readonly summary: string;
|
|
1351
|
-
readonly operations: readonly StrategyOperation[];
|
|
1352
|
-
readonly reasoning: string;
|
|
1353
|
-
};
|
|
1354
|
-
type SuggestStrategyOptions = {
|
|
1355
|
-
model?: string;
|
|
1356
|
-
temperature?: number;
|
|
1357
|
-
maxTokens?: number;
|
|
1358
|
-
actor?: Actor;
|
|
1359
|
-
};
|
|
1360
|
-
/**
|
|
1361
|
-
* Ask an LLM to analyze a graph and suggest topology/parameter changes
|
|
1362
|
-
* to solve a stated problem.
|
|
1363
|
-
*
|
|
1364
|
-
* Returns a structured plan — does NOT auto-apply. The caller reviews
|
|
1365
|
-
* and selectively applies operations.
|
|
1366
|
-
*
|
|
1367
|
-
* @param graph - The graph to analyze.
|
|
1368
|
-
* @param problem - Natural-language problem statement.
|
|
1369
|
-
* @param adapter - LLM adapter for the analysis call.
|
|
1370
|
-
* @param opts - Model and actor options.
|
|
1371
|
-
* @returns A structured strategy plan.
|
|
1372
|
-
* @throws On invalid LLM output.
|
|
1373
|
-
*/
|
|
1374
|
-
declare function suggestStrategy(graph: Graph, problem: string, adapter: LLMAdapter, opts?: SuggestStrategyOptions): Promise<StrategyPlan>;
|
|
1375
|
-
|
|
1376
|
-
type ai_AdmissionScore3DOptions = AdmissionScore3DOptions;
|
|
1377
|
-
type ai_AdmissionScores = AdmissionScores;
|
|
1378
|
-
type ai_AgentLoopGraph = AgentLoopGraph;
|
|
1379
|
-
declare const ai_AgentLoopGraph: typeof AgentLoopGraph;
|
|
1380
|
-
type ai_AgentLoopOptions = AgentLoopOptions;
|
|
1381
|
-
type ai_AgentLoopStatus = AgentLoopStatus;
|
|
1382
|
-
type ai_AgentMemoryGraph<TMem = unknown> = AgentMemoryGraph<TMem>;
|
|
1383
|
-
type ai_AgentMemoryOptions<TMem = unknown> = AgentMemoryOptions<TMem>;
|
|
1384
|
-
type ai_ChatMessage = ChatMessage;
|
|
1385
|
-
type ai_ChatStreamGraph = ChatStreamGraph;
|
|
1386
|
-
declare const ai_ChatStreamGraph: typeof ChatStreamGraph;
|
|
1387
|
-
type ai_ChatStreamOptions = ChatStreamOptions;
|
|
1388
|
-
type ai_ContentDecision = ContentDecision;
|
|
1389
|
-
type ai_ContentGateOptions = ContentGateOptions;
|
|
1390
|
-
type ai_CostMeterOptions = CostMeterOptions;
|
|
1391
|
-
type ai_CostMeterReading = CostMeterReading;
|
|
1392
|
-
type ai_ExtractedToolCall = ExtractedToolCall;
|
|
1393
|
-
type ai_FromLLMOptions = FromLLMOptions;
|
|
1394
|
-
type ai_GatedStreamHandle<T> = GatedStreamHandle<T>;
|
|
1395
|
-
type ai_GatedStreamOptions = GatedStreamOptions;
|
|
1396
|
-
type ai_GaugesAsContextOptions = GaugesAsContextOptions;
|
|
1397
|
-
type ai_GraphDefValidation = GraphDefValidation;
|
|
1398
|
-
type ai_GraphFromSpecOptions = GraphFromSpecOptions;
|
|
1399
|
-
type ai_KeywordFlag = KeywordFlag;
|
|
1400
|
-
type ai_KeywordFlagExtractorOptions = KeywordFlagExtractorOptions;
|
|
1401
|
-
type ai_KnobsAsToolsResult = KnobsAsToolsResult;
|
|
1402
|
-
type ai_LLMAdapter = LLMAdapter;
|
|
1403
|
-
type ai_LLMConsolidatorOptions = LLMConsolidatorOptions;
|
|
1404
|
-
type ai_LLMExtractorOptions = LLMExtractorOptions;
|
|
1405
|
-
type ai_LLMInvokeOptions = LLMInvokeOptions;
|
|
1406
|
-
type ai_LLMResponse = LLMResponse;
|
|
1407
|
-
type ai_McpToolSchema = McpToolSchema;
|
|
1408
|
-
type ai_MemoryTier = MemoryTier;
|
|
1409
|
-
type ai_MemoryTiersBundle<TMem> = MemoryTiersBundle<TMem>;
|
|
1410
|
-
type ai_MemoryTiersOptions<TMem> = MemoryTiersOptions<TMem>;
|
|
1411
|
-
type ai_OpenAIToolSchema = OpenAIToolSchema;
|
|
1412
|
-
type ai_PromptNodeOptions = PromptNodeOptions;
|
|
1413
|
-
type ai_RedactorOptions = RedactorOptions;
|
|
1414
|
-
type ai_RetrievalEntry<TMem> = RetrievalEntry<TMem>;
|
|
1415
|
-
type ai_RetrievalPipelineOptions<TMem> = RetrievalPipelineOptions<TMem>;
|
|
1416
|
-
type ai_RetrievalQuery = RetrievalQuery;
|
|
1417
|
-
type ai_RetrievalTrace<TMem> = RetrievalTrace<TMem>;
|
|
1418
|
-
type ai_StrategyOperation = StrategyOperation;
|
|
1419
|
-
type ai_StrategyPlan = StrategyPlan;
|
|
1420
|
-
type ai_StreamChunk = StreamChunk;
|
|
1421
|
-
type ai_StreamingPromptNodeHandle<T> = StreamingPromptNodeHandle<T>;
|
|
1422
|
-
type ai_StreamingPromptNodeOptions = StreamingPromptNodeOptions;
|
|
1423
|
-
type ai_SuggestStrategyOptions = SuggestStrategyOptions;
|
|
1424
|
-
type ai_SystemPromptHandle = SystemPromptHandle;
|
|
1425
|
-
type ai_ToolCall = ToolCall;
|
|
1426
|
-
type ai_ToolDefinition = ToolDefinition;
|
|
1427
|
-
type ai_ToolRegistryGraph = ToolRegistryGraph;
|
|
1428
|
-
declare const ai_ToolRegistryGraph: typeof ToolRegistryGraph;
|
|
1429
|
-
type ai_ToolRegistryOptions = ToolRegistryOptions;
|
|
1430
|
-
declare const ai_admissionFilter3D: typeof admissionFilter3D;
|
|
1431
|
-
declare const ai_agentLoop: typeof agentLoop;
|
|
1432
|
-
declare const ai_agentMemory: typeof agentMemory;
|
|
1433
|
-
declare const ai_chatStream: typeof chatStream;
|
|
1434
|
-
declare const ai_contentGate: typeof contentGate;
|
|
1435
|
-
declare const ai_costMeterExtractor: typeof costMeterExtractor;
|
|
1436
|
-
declare const ai_fromLLM: typeof fromLLM;
|
|
1437
|
-
declare const ai_gatedStream: typeof gatedStream;
|
|
1438
|
-
declare const ai_gaugesAsContext: typeof gaugesAsContext;
|
|
1439
|
-
declare const ai_graphFromSpec: typeof graphFromSpec;
|
|
1440
|
-
declare const ai_keywordFlagExtractor: typeof keywordFlagExtractor;
|
|
1441
|
-
declare const ai_knobsAsTools: typeof knobsAsTools;
|
|
1442
|
-
declare const ai_llmConsolidator: typeof llmConsolidator;
|
|
1443
|
-
declare const ai_llmExtractor: typeof llmExtractor;
|
|
1444
|
-
declare const ai_promptNode: typeof promptNode;
|
|
1445
|
-
declare const ai_redactor: typeof redactor;
|
|
1446
|
-
declare const ai_streamExtractor: typeof streamExtractor;
|
|
1447
|
-
declare const ai_streamingPromptNode: typeof streamingPromptNode;
|
|
1448
|
-
declare const ai_suggestStrategy: typeof suggestStrategy;
|
|
1449
|
-
declare const ai_systemPromptBuilder: typeof systemPromptBuilder;
|
|
1450
|
-
declare const ai_toolCallExtractor: typeof toolCallExtractor;
|
|
1451
|
-
declare const ai_toolRegistry: typeof toolRegistry;
|
|
1452
|
-
declare const ai_validateGraphDef: typeof validateGraphDef;
|
|
1453
|
-
declare namespace ai {
|
|
1454
|
-
export { type ai_AdmissionScore3DOptions as AdmissionScore3DOptions, type ai_AdmissionScores as AdmissionScores, ai_AgentLoopGraph as AgentLoopGraph, type ai_AgentLoopOptions as AgentLoopOptions, type ai_AgentLoopStatus as AgentLoopStatus, type ai_AgentMemoryGraph as AgentMemoryGraph, type ai_AgentMemoryOptions as AgentMemoryOptions, type ai_ChatMessage as ChatMessage, ai_ChatStreamGraph as ChatStreamGraph, type ai_ChatStreamOptions as ChatStreamOptions, type ai_ContentDecision as ContentDecision, type ai_ContentGateOptions as ContentGateOptions, type ai_CostMeterOptions as CostMeterOptions, type ai_CostMeterReading as CostMeterReading, type ai_ExtractedToolCall as ExtractedToolCall, type ai_FromLLMOptions as FromLLMOptions, type ai_GatedStreamHandle as GatedStreamHandle, type ai_GatedStreamOptions as GatedStreamOptions, type ai_GaugesAsContextOptions as GaugesAsContextOptions, type ai_GraphDefValidation as GraphDefValidation, type ai_GraphFromSpecOptions as GraphFromSpecOptions, type ai_KeywordFlag as KeywordFlag, type ai_KeywordFlagExtractorOptions as KeywordFlagExtractorOptions, type ai_KnobsAsToolsResult as KnobsAsToolsResult, type ai_LLMAdapter as LLMAdapter, type ai_LLMConsolidatorOptions as LLMConsolidatorOptions, type ai_LLMExtractorOptions as LLMExtractorOptions, type ai_LLMInvokeOptions as LLMInvokeOptions, type ai_LLMResponse as LLMResponse, type ai_McpToolSchema as McpToolSchema, type ai_MemoryTier as MemoryTier, type ai_MemoryTiersBundle as MemoryTiersBundle, type ai_MemoryTiersOptions as MemoryTiersOptions, type ai_OpenAIToolSchema as OpenAIToolSchema, type ai_PromptNodeOptions as PromptNodeOptions, type ai_RedactorOptions as RedactorOptions, type ai_RetrievalEntry as RetrievalEntry, type ai_RetrievalPipelineOptions as RetrievalPipelineOptions, type ai_RetrievalQuery as RetrievalQuery, type ai_RetrievalTrace as RetrievalTrace, type ai_StrategyOperation as StrategyOperation, type ai_StrategyPlan as StrategyPlan, type ai_StreamChunk as StreamChunk, type ai_StreamingPromptNodeHandle as StreamingPromptNodeHandle, type ai_StreamingPromptNodeOptions as StreamingPromptNodeOptions, type ai_SuggestStrategyOptions as SuggestStrategyOptions, type ai_SystemPromptHandle as SystemPromptHandle, type ai_ToolCall as ToolCall, type ai_ToolDefinition as ToolDefinition, ai_ToolRegistryGraph as ToolRegistryGraph, type ai_ToolRegistryOptions as ToolRegistryOptions, ai_admissionFilter3D as admissionFilter3D, ai_agentLoop as agentLoop, ai_agentMemory as agentMemory, ai_chatStream as chatStream, ai_contentGate as contentGate, ai_costMeterExtractor as costMeterExtractor, ai_fromLLM as fromLLM, ai_gatedStream as gatedStream, ai_gaugesAsContext as gaugesAsContext, ai_graphFromSpec as graphFromSpec, ai_keywordFlagExtractor as keywordFlagExtractor, ai_knobsAsTools as knobsAsTools, ai_llmConsolidator as llmConsolidator, ai_llmExtractor as llmExtractor, ai_promptNode as promptNode, ai_redactor as redactor, ai_streamExtractor as streamExtractor, ai_streamingPromptNode as streamingPromptNode, ai_suggestStrategy as suggestStrategy, ai_systemPromptBuilder as systemPromptBuilder, ai_toolCallExtractor as toolCallExtractor, ai_toolRegistry as toolRegistry, ai_validateGraphDef as validateGraphDef };
|
|
1455
|
-
}
|
|
1456
|
-
|
|
1457
|
-
/**
|
|
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:
|
|
1462
|
-
*
|
|
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.
|
|
1470
|
-
*
|
|
1471
|
-
* @module
|
|
1472
|
-
*/
|
|
1473
|
-
|
|
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;
|
|
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
|
-
}
|
|
1665
|
-
/**
|
|
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.
|
|
1670
|
-
*
|
|
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.
|
|
1676
|
-
*/
|
|
1677
|
-
declare function complianceSnapshot(target: Graph, opts?: ComplianceSnapshotOptions): ComplianceSnapshotResult;
|
|
1678
|
-
|
|
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 };
|
|
1695
|
-
}
|
|
1696
|
-
|
|
1697
40
|
/**
|
|
1698
41
|
* Domain templates (roadmap §8.2).
|
|
1699
42
|
*
|
|
@@ -3779,4 +2122,4 @@ declare namespace index {
|
|
|
3779
2122
|
*/
|
|
3780
2123
|
declare const version = "0.0.0";
|
|
3781
2124
|
|
|
3782
|
-
export { Actor, type CatalogFnEntry, type CatalogSourceEntry, CausalChain, CircuitBreakerOptions, CircuitState, type ConfigFieldSchema, type CreateGraphOptions,
|
|
2125
|
+
export { Actor, type CatalogFnEntry, type CatalogSourceEntry, CausalChain, CircuitBreakerOptions, CircuitState, type ConfigFieldSchema, type CreateGraphOptions, DescribeFilter, FallbackInput, type FnFactory, Graph, GraphDescribeOptions, GraphDescribeOutput, GraphDiffResult, GraphNodeFactory, GraphOptions, GraphProfileOptions, GraphProfileResult, type GraphSpec, type GraphSpecCatalog, type GraphSpecFeedbackEdge, type GraphSpecNode, type GraphSpecTemplate, type GraphSpecTemplateRef, type GraphSpecValidation, NS_PER_MS, NS_PER_SEC, Node, NodeOptions, PolicyRuleData, RateLimiterOptions, ReactiveMapBundle, type ReduceOptions, type RestoreSnapshotOptions, RetryOptions, SNAPSHOT_WIRE_VERSION, type SaveSnapshotResult, type SourceFactory, StatusValue, 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 };
|