@graphrefly/graphrefly 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +30 -14
  2. package/dist/{chunk-5X3LAO3B.js → chunk-3EVXOI5C.js} +50 -5
  3. package/dist/chunk-3EVXOI5C.js.map +1 -0
  4. package/dist/chunk-47YJEZUJ.js +106 -0
  5. package/dist/chunk-47YJEZUJ.js.map +1 -0
  6. package/dist/{chunk-6W5SGIGB.js → chunk-BLCXEMAD.js} +129 -25
  7. package/dist/chunk-BLCXEMAD.js.map +1 -0
  8. package/dist/{chunk-QW7H3ICI.js → chunk-FGLZ5QID.js} +4 -4
  9. package/dist/{chunk-CP6MNKAA.js → chunk-ISGMZ2T3.js} +10 -4
  10. package/dist/{chunk-CP6MNKAA.js.map → chunk-ISGMZ2T3.js.map} +1 -1
  11. package/dist/{chunk-HP7OKEOE.js → chunk-L4J2K2RT.js} +3 -3
  12. package/dist/chunk-L4J2K2RT.js.map +1 -0
  13. package/dist/{chunk-V3UACY6A.js → chunk-ONLYF6GA.js} +790 -203
  14. package/dist/chunk-ONLYF6GA.js.map +1 -0
  15. package/dist/{chunk-Z4Y4FMQN.js → chunk-OSR3G3DP.js} +7 -7
  16. package/dist/{chunk-KWXPDASV.js → chunk-PEBORXRA.js} +2 -2
  17. package/dist/chunk-WZ2Z2CRV.js +32 -0
  18. package/dist/chunk-WZ2Z2CRV.js.map +1 -0
  19. package/dist/compat/nestjs/index.cjs +226 -41
  20. package/dist/compat/nestjs/index.cjs.map +1 -1
  21. package/dist/compat/nestjs/index.d.cts +4 -4
  22. package/dist/compat/nestjs/index.d.ts +4 -4
  23. package/dist/compat/nestjs/index.js +8 -7
  24. package/dist/core/index.cjs +134 -20
  25. package/dist/core/index.cjs.map +1 -1
  26. package/dist/core/index.d.cts +2 -2
  27. package/dist/core/index.d.ts +2 -2
  28. package/dist/core/index.js +10 -4
  29. package/dist/extra/index.cjs +863 -206
  30. package/dist/extra/index.cjs.map +1 -1
  31. package/dist/extra/index.d.cts +4 -4
  32. package/dist/extra/index.d.ts +4 -4
  33. package/dist/extra/index.js +22 -3
  34. package/dist/graph/index.cjs +226 -41
  35. package/dist/graph/index.cjs.map +1 -1
  36. package/dist/graph/index.d.cts +3 -3
  37. package/dist/graph/index.d.ts +3 -3
  38. package/dist/graph/index.js +4 -4
  39. package/dist/{graph-CL_ZDAj9.d.cts → graph-B3BoJjcb.d.cts} +58 -7
  40. package/dist/{graph-D18qmsNm.d.ts → graph-CmiUuhaN.d.ts} +58 -7
  41. package/dist/{index-B7eOdgEx.d.ts → index-Bf2X1YSI.d.ts} +3 -3
  42. package/dist/{index-BvhgZRHK.d.cts → index-Bl7hJcc3.d.cts} +4 -2
  43. package/dist/{index-Bvy_6CaN.d.ts → index-BrgtEG-C.d.ts} +47 -4
  44. package/dist/{index-D_geH2Bm.d.cts → index-BsuKSs4L.d.cts} +3 -3
  45. package/dist/{index-BtK55IE2.d.ts → index-CsUq2rrK.d.ts} +4 -2
  46. package/dist/{index-C3BMRmmp.d.cts → index-D0cx-Yht.d.cts} +3 -3
  47. package/dist/{index-Bk_idZm1.d.cts → index-D1hgSTzr.d.cts} +406 -61
  48. package/dist/{index-C5mqLhMX.d.cts → index-D8NIq6om.d.cts} +47 -4
  49. package/dist/{index-CP_QvbWu.d.ts → index-DFFNKYig.d.ts} +3 -3
  50. package/dist/{index-B2jmzVxL.d.ts → index-Pm68AYPh.d.ts} +406 -61
  51. package/dist/index.cjs +2929 -1775
  52. package/dist/index.cjs.map +1 -1
  53. package/dist/index.d.cts +112 -14
  54. package/dist/index.d.ts +112 -14
  55. package/dist/index.js +392 -27
  56. package/dist/index.js.map +1 -1
  57. package/dist/{meta-BsF6Sag9.d.cts → meta-BJEU8fYz.d.cts} +31 -4
  58. package/dist/{meta-BsF6Sag9.d.ts → meta-BJEU8fYz.d.ts} +31 -4
  59. package/dist/patterns/reactive-layout/index.cjs +226 -41
  60. package/dist/patterns/reactive-layout/index.cjs.map +1 -1
  61. package/dist/patterns/reactive-layout/index.d.cts +3 -3
  62. package/dist/patterns/reactive-layout/index.d.ts +3 -3
  63. package/dist/patterns/reactive-layout/index.js +4 -4
  64. package/dist/{reactive-log-BfvfNWQh.d.cts → reactive-log-CAXzJ7hw.d.cts} +2 -2
  65. package/dist/{reactive-log-ohLmTXoZ.d.ts → reactive-log-DwNhOe0g.d.ts} +2 -2
  66. package/package.json +29 -18
  67. package/dist/chunk-5X3LAO3B.js.map +0 -1
  68. package/dist/chunk-6W5SGIGB.js.map +0 -1
  69. package/dist/chunk-HP7OKEOE.js.map +0 -1
  70. package/dist/chunk-O3PI7W45.js +0 -68
  71. package/dist/chunk-O3PI7W45.js.map +0 -1
  72. package/dist/chunk-V3UACY6A.js.map +0 -1
  73. /package/dist/{chunk-QW7H3ICI.js.map → chunk-FGLZ5QID.js.map} +0 -0
  74. /package/dist/{chunk-Z4Y4FMQN.js.map → chunk-OSR3G3DP.js.map} +0 -0
  75. /package/dist/{chunk-KWXPDASV.js.map → chunk-PEBORXRA.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- import { i as Messages, N as Node, j as NodeDescribeKind, k as NodeGuard, a as NodeOptions, a0 as NodeInspectorHook, m as NodeStatus, A as Actor, n as NodeTransportOptions, l as NodeSink, S as SubscribeHints, c as NodeFn, C as COMPLETE, D as DATA, d as DEFAULT_ACTOR, e as DIRTY, f as DescribeNodeOutput, E as ERROR, G as GuardAction, g as GuardDenied, h as GuardDeniedDetails, H as HashFn, I as INVALIDATE, M as Message, b as NodeActions, o as NodeVersionInfo, O as OnMessageHandler, P as PAUSE, p as PolicyAllow, q as PolicyDeny, r as PolicyRuleData, R as RESOLVED, s as RESUME, T as TEARDOWN, V as V0, t as V1, u as VersioningLevel, v as VersioningOptions, w as accessHintForGuard, x as advanceVersion, y as createVersioning, z as defaultHash, B as describeNode, F as isKnownMessageType, J as isPhase2Message, K as isTerminalMessage, L as isV1, Q as knownMessageTypes, U as messageTier, W as metaSnapshot, X as node, Y as normalizeActor, Z as policy, _ as policyFromRules, $ as propagatesToMeta } from './meta-BsF6Sag9.cjs';
1
+ import { k as Messages, N as Node, l as NodeDescribeKind, m as NodeGuard, a as NodeOptions, a3 as NodeInspectorHook, o as NodeStatus, A as Actor, p as NodeTransportOptions, n as NodeSink, S as SubscribeHints, c as NodeFn, C as COMPLETE, D as DATA, d as DEFAULT_ACTOR, e as DIRTY, f as DescribeDetail, g as DescribeField, h as DescribeNodeOutput, E as ERROR, G as GuardAction, i as GuardDenied, j as GuardDeniedDetails, H as HashFn, I as INVALIDATE, M as Message, b as NodeActions, q as NodeVersionInfo, O as OnMessageHandler, P as PAUSE, r as PolicyAllow, s as PolicyDeny, t as PolicyRuleData, R as RESOLVED, u as RESUME, T as TEARDOWN, V as V0, v as V1, w as VersioningLevel, x as VersioningOptions, y as accessHintForGuard, z as advanceVersion, B as createVersioning, F as defaultHash, J as describeNode, K as isKnownMessageType, L as isPhase2Message, Q as isTerminalMessage, U as isV1, W as knownMessageTypes, X as messageTier, Y as metaSnapshot, Z as node, _ as normalizeActor, $ as policy, a0 as policyFromRules, a1 as propagatesToMeta, a2 as resolveDescribeFields } from './meta-BJEU8fYz.cjs';
2
2
 
3
3
  /**
4
4
  * Returns whether the current call stack is inside a batch scope **or** while
@@ -97,6 +97,9 @@ declare function partitionForBatch(messages: Messages): {
97
97
  * @param emit — Sink callback. May be called up to three times per invocation
98
98
  * (immediate, deferred, terminal) when not batching.
99
99
  * @param messages — Full `[[Type, Data?], ...]` array for one emission.
100
+ * @param phase — Starting delivery phase (`2` = data, `3` = terminal). Default `2`.
101
+ * @param options - Optional configuration.
102
+ * @option strategy | `"partition"` or `"sequential"` | `"partition"` | `"partition"` groups by tier; `"sequential"` preserves message order within each tier using `messageTier()` classification.
100
103
  * @returns `void` — delivery is performed through `emit` callbacks, synchronously
101
104
  * or deferred into the active batch queue.
102
105
  *
@@ -109,7 +112,9 @@ declare function partitionForBatch(messages: Messages): {
109
112
  *
110
113
  * @category core
111
114
  */
112
- declare function emitWithBatch(emit: (messages: Messages) => void, messages: Messages, phase?: 2 | 3): void;
115
+ declare function emitWithBatch(emit: (messages: Messages) => void, messages: Messages, phase?: 2 | 3, options?: {
116
+ strategy?: "partition" | "sequential";
117
+ }): void;
113
118
 
114
119
  /**
115
120
  * Centralised timestamp utilities.
@@ -369,6 +374,39 @@ type PipeOperator = (n: Node) => Node;
369
374
  */
370
375
  declare function pipe(source: Node, ...ops: PipeOperator[]): Node;
371
376
 
377
+ /**
378
+ * Creates a resettable deadline timer for internal timeout, retry, and rate-limiting use.
379
+ *
380
+ * @remarks **Centralised primitive:** wraps `setTimeout`/`clearTimeout` with a generation guard
381
+ * so that stale callbacks never fire after `cancel()` or a new `start()`.
382
+ *
383
+ * @remarks **Spec §5.10 exception:** resilience operators (`timeout`, `retry`, `rateLimiter`)
384
+ * need raw timers — `fromTimer` creates a new Node per reset, which is too heavy here.
385
+ *
386
+ * @example
387
+ * ```ts
388
+ * import { ResettableTimer } from "@graphrefly/graphrefly-ts";
389
+ *
390
+ * const timer = new ResettableTimer();
391
+ * timer.start(1000, () => console.log("fired"));
392
+ * timer.cancel(); // cancels before firing
393
+ * timer.start(500, () => console.log("new deadline"));
394
+ * console.log(timer.pending); // true
395
+ * ```
396
+ *
397
+ * @category core
398
+ */
399
+ declare class ResettableTimer {
400
+ private _timer;
401
+ private _gen;
402
+ /** Schedule callback after delayMs. Cancels any pending timer. */
403
+ start(delayMs: number, callback: () => void): void;
404
+ /** Cancel the pending timer (if any). */
405
+ cancel(): void;
406
+ /** Whether a timer is currently pending. */
407
+ get pending(): boolean;
408
+ }
409
+
372
410
  /**
373
411
  * Core layer: message protocol, node primitive, lifecycle (Phase 0).
374
412
  */
@@ -378,6 +416,8 @@ declare const index_COMPLETE: typeof COMPLETE;
378
416
  declare const index_DATA: typeof DATA;
379
417
  declare const index_DEFAULT_ACTOR: typeof DEFAULT_ACTOR;
380
418
  declare const index_DIRTY: typeof DIRTY;
419
+ declare const index_DescribeDetail: typeof DescribeDetail;
420
+ declare const index_DescribeField: typeof DescribeField;
381
421
  declare const index_DescribeNodeOutput: typeof DescribeNodeOutput;
382
422
  type index_DynGet = DynGet;
383
423
  type index_DynamicNodeFn<T> = DynamicNodeFn<T>;
@@ -410,6 +450,8 @@ declare const index_PolicyDeny: typeof PolicyDeny;
410
450
  declare const index_PolicyRuleData: typeof PolicyRuleData;
411
451
  declare const index_RESOLVED: typeof RESOLVED;
412
452
  declare const index_RESUME: typeof RESUME;
453
+ type index_ResettableTimer = ResettableTimer;
454
+ declare const index_ResettableTimer: typeof ResettableTimer;
413
455
  declare const index_SubscribeHints: typeof SubscribeHints;
414
456
  declare const index_TEARDOWN: typeof TEARDOWN;
415
457
  declare const index_V0: typeof V0;
@@ -443,10 +485,11 @@ declare const index_policy: typeof policy;
443
485
  declare const index_policyFromRules: typeof policyFromRules;
444
486
  declare const index_producer: typeof producer;
445
487
  declare const index_propagatesToMeta: typeof propagatesToMeta;
488
+ declare const index_resolveDescribeFields: typeof resolveDescribeFields;
446
489
  declare const index_state: typeof state;
447
490
  declare const index_wallClockNs: typeof wallClockNs;
448
491
  declare namespace index {
449
- export { index_Actor as Actor, index_COMPLETE as COMPLETE, index_DATA as DATA, index_DEFAULT_ACTOR as DEFAULT_ACTOR, index_DIRTY as DIRTY, index_DescribeNodeOutput as DescribeNodeOutput, type index_DynGet as DynGet, type index_DynamicNodeFn as DynamicNodeFn, index_DynamicNodeImpl as DynamicNodeImpl, type index_DynamicNodeOptions as DynamicNodeOptions, index_ERROR as ERROR, index_GuardAction as GuardAction, index_GuardDenied as GuardDenied, index_GuardDeniedDetails as GuardDeniedDetails, index_HashFn as HashFn, index_INVALIDATE as INVALIDATE, index_Message as Message, index_Messages as Messages, index_Node as Node, index_NodeActions as NodeActions, index_NodeDescribeKind as NodeDescribeKind, index_NodeFn as NodeFn, index_NodeGuard as NodeGuard, index_NodeOptions as NodeOptions, index_NodeSink as NodeSink, index_NodeStatus as NodeStatus, index_NodeTransportOptions as NodeTransportOptions, index_NodeVersionInfo as NodeVersionInfo, index_OnMessageHandler as OnMessageHandler, index_PAUSE as PAUSE, type index_PipeOperator as PipeOperator, index_PolicyAllow as PolicyAllow, index_PolicyDeny as PolicyDeny, index_PolicyRuleData as PolicyRuleData, index_RESOLVED as RESOLVED, index_RESUME as RESUME, index_SubscribeHints as SubscribeHints, index_TEARDOWN as TEARDOWN, index_V0 as V0, index_V1 as V1, index_VersioningLevel as VersioningLevel, index_VersioningOptions as VersioningOptions, index_accessHintForGuard as accessHintForGuard, index_advanceVersion as advanceVersion, index_batch as batch, index_createVersioning as createVersioning, index_defaultHash as defaultHash, index_derived as derived, index_describeNode as describeNode, index_dynamicNode as dynamicNode, index_effect as effect, index_emitWithBatch as emitWithBatch, index_isBatching as isBatching, index_isKnownMessageType as isKnownMessageType, index_isPhase2Message as isPhase2Message, index_isTerminalMessage as isTerminalMessage, index_isV1 as isV1, index_knownMessageTypes as knownMessageTypes, index_messageTier as messageTier, index_metaSnapshot as metaSnapshot, index_monotonicNs as monotonicNs, index_node as node, index_normalizeActor as normalizeActor, index_partitionForBatch as partitionForBatch, index_pipe as pipe, index_policy as policy, index_policyFromRules as policyFromRules, index_producer as producer, index_propagatesToMeta as propagatesToMeta, index_state as state, index_wallClockNs as wallClockNs };
492
+ export { index_Actor as Actor, index_COMPLETE as COMPLETE, index_DATA as DATA, index_DEFAULT_ACTOR as DEFAULT_ACTOR, index_DIRTY as DIRTY, index_DescribeDetail as DescribeDetail, index_DescribeField as DescribeField, index_DescribeNodeOutput as DescribeNodeOutput, type index_DynGet as DynGet, type index_DynamicNodeFn as DynamicNodeFn, index_DynamicNodeImpl as DynamicNodeImpl, type index_DynamicNodeOptions as DynamicNodeOptions, index_ERROR as ERROR, index_GuardAction as GuardAction, index_GuardDenied as GuardDenied, index_GuardDeniedDetails as GuardDeniedDetails, index_HashFn as HashFn, index_INVALIDATE as INVALIDATE, index_Message as Message, index_Messages as Messages, index_Node as Node, index_NodeActions as NodeActions, index_NodeDescribeKind as NodeDescribeKind, index_NodeFn as NodeFn, index_NodeGuard as NodeGuard, index_NodeOptions as NodeOptions, index_NodeSink as NodeSink, index_NodeStatus as NodeStatus, index_NodeTransportOptions as NodeTransportOptions, index_NodeVersionInfo as NodeVersionInfo, index_OnMessageHandler as OnMessageHandler, index_PAUSE as PAUSE, type index_PipeOperator as PipeOperator, index_PolicyAllow as PolicyAllow, index_PolicyDeny as PolicyDeny, index_PolicyRuleData as PolicyRuleData, index_RESOLVED as RESOLVED, index_RESUME as RESUME, index_ResettableTimer as ResettableTimer, index_SubscribeHints as SubscribeHints, index_TEARDOWN as TEARDOWN, index_V0 as V0, index_V1 as V1, index_VersioningLevel as VersioningLevel, index_VersioningOptions as VersioningOptions, index_accessHintForGuard as accessHintForGuard, index_advanceVersion as advanceVersion, index_batch as batch, index_createVersioning as createVersioning, index_defaultHash as defaultHash, index_derived as derived, index_describeNode as describeNode, index_dynamicNode as dynamicNode, index_effect as effect, index_emitWithBatch as emitWithBatch, index_isBatching as isBatching, index_isKnownMessageType as isKnownMessageType, index_isPhase2Message as isPhase2Message, index_isTerminalMessage as isTerminalMessage, index_isV1 as isV1, index_knownMessageTypes as knownMessageTypes, index_messageTier as messageTier, index_metaSnapshot as metaSnapshot, index_monotonicNs as monotonicNs, index_node as node, index_normalizeActor as normalizeActor, index_partitionForBatch as partitionForBatch, index_pipe as pipe, index_policy as policy, index_policyFromRules as policyFromRules, index_producer as producer, index_propagatesToMeta as propagatesToMeta, index_resolveDescribeFields as resolveDescribeFields, index_state as state, index_wallClockNs as wallClockNs };
450
493
  }
451
494
 
452
- export { type DynGet as D, type PipeOperator as P, type DynamicNodeFn as a, DynamicNodeImpl as b, type DynamicNodeOptions as c, batch as d, derived as e, dynamicNode as f, effect as g, emitWithBatch as h, index as i, isBatching as j, pipe as k, producer as l, monotonicNs as m, partitionForBatch as p, state as s, wallClockNs as w };
495
+ export { type DynGet as D, type PipeOperator as P, ResettableTimer as R, type DynamicNodeFn as a, DynamicNodeImpl as b, type DynamicNodeOptions as c, batch as d, derived as e, dynamicNode as f, effect as g, emitWithBatch as h, index as i, isBatching as j, pipe as k, producer as l, monotonicNs as m, partitionForBatch as p, state as s, wallClockNs as w };
@@ -1,8 +1,8 @@
1
- import { R as ReactiveLogSnapshot, o as observeGraph$, c as observeNode$, t as toMessages$, d as toObservable } from './reactive-log-ohLmTXoZ.js';
1
+ import { R as ReactiveLogSnapshot, o as observeGraph$, c as observeNode$, t as toMessages$, d as toObservable } from './reactive-log-DwNhOe0g.js';
2
2
  import { OnModuleInit, OnModuleDestroy, ExecutionContext, CanActivate, DynamicModule } from '@nestjs/common';
3
3
  import { ModuleRef } from '@nestjs/core';
4
- import { G as Graph, a as GraphOptions, q as GraphPersistSnapshot } from './graph-D18qmsNm.js';
5
- import { A as Actor, N as Node } from './meta-BsF6Sag9.js';
4
+ import { G as Graph, a as GraphOptions, r as GraphPersistSnapshot } from './graph-CmiUuhaN.js';
5
+ import { A as Actor, N as Node } from './meta-BJEU8fYz.js';
6
6
 
7
7
  /** Class constructor key for decorator registries and Nest `ModuleRef.get()`. */
8
8
  type DecoratorHostConstructor = abstract new (...args: unknown[]) => unknown;