@graphrefly/graphrefly 0.46.0 → 0.47.1

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 (99) hide show
  1. package/dist/base/composition/index.cjs +69 -15
  2. package/dist/base/composition/index.cjs.map +1 -1
  3. package/dist/base/composition/index.d.cts +1 -2
  4. package/dist/base/composition/index.d.ts +1 -2
  5. package/dist/base/composition/index.js +1 -1
  6. package/dist/base/index.cjs +69 -15
  7. package/dist/base/index.cjs.map +1 -1
  8. package/dist/base/index.d.cts +1 -2
  9. package/dist/base/index.d.ts +1 -2
  10. package/dist/base/index.js +1 -1
  11. package/dist/{chunk-CGHORL6G.js → chunk-7ADWWI2T.js} +2 -2
  12. package/dist/{chunk-RGL53X5G.js → chunk-B4AKFXGE.js} +4 -4
  13. package/dist/{chunk-FW23JYNQ.js → chunk-CEVNQ74M.js} +2 -2
  14. package/dist/{chunk-JGFRAFDL.js → chunk-FVINAAKA.js} +3 -3
  15. package/dist/{chunk-WKSWLSCX.js → chunk-J5WFUEO4.js} +2 -2
  16. package/dist/{chunk-HULCUY35.js → chunk-K7PDZYQE.js} +4 -4
  17. package/dist/{chunk-Z6EGP5D7.js → chunk-LDCSZ72P.js} +2 -2
  18. package/dist/{chunk-KIIXR252.js → chunk-MTTRCEJT.js} +2 -2
  19. package/dist/{chunk-Q3EYOCZB.js → chunk-NPRP3MCV.js} +111 -2
  20. package/dist/chunk-NPRP3MCV.js.map +1 -0
  21. package/dist/{chunk-5THCXDWY.js → chunk-RGMTUZCL.js} +3 -3
  22. package/dist/{chunk-FR6RGA3B.js → chunk-U225SKB4.js} +472 -37
  23. package/dist/chunk-U225SKB4.js.map +1 -0
  24. package/dist/{chunk-GBCENOLN.js → chunk-V4Y3TM7U.js} +5 -5
  25. package/dist/{chunk-LBAJK24K.js → chunk-VLAGJZSL.js} +11 -3
  26. package/dist/chunk-VLAGJZSL.js.map +1 -0
  27. package/dist/{chunk-OO5BM6CJ.js → chunk-YXCPV26R.js} +2 -2
  28. package/dist/chunk-Z65DVDEQ.js +146 -0
  29. package/dist/chunk-Z65DVDEQ.js.map +1 -0
  30. package/dist/compat/index.cjs +156 -93
  31. package/dist/compat/index.cjs.map +1 -1
  32. package/dist/compat/index.d.cts +3 -3
  33. package/dist/compat/index.d.ts +3 -3
  34. package/dist/compat/index.js +2 -2
  35. package/dist/compat/nestjs/index.cjs +156 -93
  36. package/dist/compat/nestjs/index.cjs.map +1 -1
  37. package/dist/compat/nestjs/index.d.cts +4 -4
  38. package/dist/compat/nestjs/index.d.ts +4 -4
  39. package/dist/compat/nestjs/index.js +4 -5
  40. package/dist/{index-5SU_O78r.d.cts → index-B_p8tnvf.d.cts} +19 -3
  41. package/dist/{index-CEXCtYYJ.d.ts → index-_HDSmPyp.d.ts} +19 -3
  42. package/dist/index.cjs +1449 -856
  43. package/dist/index.cjs.map +1 -1
  44. package/dist/index.d.cts +3 -4
  45. package/dist/index.d.ts +3 -4
  46. package/dist/index.js +36 -14
  47. package/dist/index.js.map +1 -1
  48. package/dist/observable-B25XqCbZ.d.cts +59 -0
  49. package/dist/observable-B25XqCbZ.d.ts +59 -0
  50. package/dist/presets/ai/index.cjs.map +1 -1
  51. package/dist/presets/ai/index.js +6 -6
  52. package/dist/presets/harness/index.cjs.map +1 -1
  53. package/dist/presets/harness/index.js +9 -9
  54. package/dist/presets/index.cjs.map +1 -1
  55. package/dist/presets/index.js +13 -13
  56. package/dist/presets/inspect/index.cjs.map +1 -1
  57. package/dist/presets/inspect/index.js +4 -4
  58. package/dist/solutions/index.cjs.map +1 -1
  59. package/dist/solutions/index.js +10 -10
  60. package/dist/utils/ai/index.cjs.map +1 -1
  61. package/dist/utils/ai/index.js +5 -5
  62. package/dist/utils/index.cjs +939 -400
  63. package/dist/utils/index.cjs.map +1 -1
  64. package/dist/utils/index.d.cts +2 -2
  65. package/dist/utils/index.d.ts +2 -2
  66. package/dist/utils/index.js +28 -6
  67. package/dist/utils/inspect/index.cjs.map +1 -1
  68. package/dist/utils/inspect/index.js +2 -2
  69. package/dist/utils/memory/index.cjs +470 -40
  70. package/dist/utils/memory/index.cjs.map +1 -1
  71. package/dist/utils/memory/index.d.cts +669 -2
  72. package/dist/utils/memory/index.d.ts +669 -2
  73. package/dist/utils/memory/index.js +19 -1
  74. package/dist/utils/messaging/index.cjs +109 -0
  75. package/dist/utils/messaging/index.cjs.map +1 -1
  76. package/dist/utils/messaging/index.d.cts +115 -2
  77. package/dist/utils/messaging/index.d.ts +115 -2
  78. package/dist/utils/messaging/index.js +5 -1
  79. package/dist/utils/orchestration/index.cjs.map +1 -1
  80. package/dist/utils/orchestration/index.js +2 -2
  81. package/package.json +1 -5
  82. package/dist/chunk-3QZY5BI7.js +0 -92
  83. package/dist/chunk-3QZY5BI7.js.map +0 -1
  84. package/dist/chunk-FR6RGA3B.js.map +0 -1
  85. package/dist/chunk-LBAJK24K.js.map +0 -1
  86. package/dist/chunk-Q3EYOCZB.js.map +0 -1
  87. package/dist/observable-BXQoW1P-.d.cts +0 -36
  88. package/dist/observable-BXQoW1P-.d.ts +0 -36
  89. /package/dist/{chunk-CGHORL6G.js.map → chunk-7ADWWI2T.js.map} +0 -0
  90. /package/dist/{chunk-RGL53X5G.js.map → chunk-B4AKFXGE.js.map} +0 -0
  91. /package/dist/{chunk-FW23JYNQ.js.map → chunk-CEVNQ74M.js.map} +0 -0
  92. /package/dist/{chunk-JGFRAFDL.js.map → chunk-FVINAAKA.js.map} +0 -0
  93. /package/dist/{chunk-WKSWLSCX.js.map → chunk-J5WFUEO4.js.map} +0 -0
  94. /package/dist/{chunk-HULCUY35.js.map → chunk-K7PDZYQE.js.map} +0 -0
  95. /package/dist/{chunk-Z6EGP5D7.js.map → chunk-LDCSZ72P.js.map} +0 -0
  96. /package/dist/{chunk-KIIXR252.js.map → chunk-MTTRCEJT.js.map} +0 -0
  97. /package/dist/{chunk-5THCXDWY.js.map → chunk-RGMTUZCL.js.map} +0 -0
  98. /package/dist/{chunk-GBCENOLN.js.map → chunk-V4Y3TM7U.js.map} +0 -0
  99. /package/dist/{chunk-OO5BM6CJ.js.map → chunk-YXCPV26R.js.map} +0 -0
@@ -487,43 +487,97 @@ function materialize(key, factories, parent, opts) {
487
487
 
488
488
  // src/base/composition/observable.ts
489
489
  var import_core6 = require("@graphrefly/pure-ts/core");
490
- var import_rxjs = require("rxjs");
490
+ var OBSERVABLE_KEY = typeof Symbol === "function" && Symbol.observable || "@@observable";
491
+ function normalizeObserver(observer) {
492
+ return typeof observer === "function" ? { next: observer } : observer;
493
+ }
494
+ function makeInterop(onSubscribe) {
495
+ const obs = {
496
+ subscribe(rawObserver) {
497
+ const observer = normalizeObserver(rawObserver);
498
+ let closed = false;
499
+ let teardown;
500
+ let teardownPending = false;
501
+ const runTeardown = () => {
502
+ if (teardown) teardown();
503
+ else teardownPending = true;
504
+ };
505
+ const guarded = {
506
+ get closed() {
507
+ return closed;
508
+ },
509
+ next(value) {
510
+ if (!closed) observer.next?.(value);
511
+ },
512
+ error(err) {
513
+ if (closed) return;
514
+ closed = true;
515
+ try {
516
+ observer.error?.(err);
517
+ } finally {
518
+ runTeardown();
519
+ }
520
+ },
521
+ complete() {
522
+ if (closed) return;
523
+ closed = true;
524
+ try {
525
+ observer.complete?.();
526
+ } finally {
527
+ runTeardown();
528
+ }
529
+ }
530
+ };
531
+ teardown = onSubscribe(guarded);
532
+ if (teardownPending) teardown();
533
+ return {
534
+ unsubscribe() {
535
+ if (closed) return;
536
+ closed = true;
537
+ teardown?.();
538
+ }
539
+ };
540
+ }
541
+ };
542
+ obs[OBSERVABLE_KEY] = function() {
543
+ return this;
544
+ };
545
+ return obs;
546
+ }
491
547
  function toObservable(node8, options) {
492
548
  if (options?.raw) {
493
- return new import_rxjs.Observable((subscriber) => {
494
- const unsub = node8.subscribe((msgs) => {
495
- if (subscriber.closed) return;
496
- subscriber.next(msgs);
549
+ return makeInterop((observer) => {
550
+ return node8.subscribe((msgs) => {
551
+ if (observer.closed) return;
552
+ observer.next?.(msgs);
497
553
  for (const m of msgs) {
498
554
  if (m[0] === import_core6.ERROR) {
499
- subscriber.error(m[1]);
555
+ observer.error?.(m[1]);
500
556
  return;
501
557
  }
502
558
  if (m[0] === import_core6.COMPLETE) {
503
- subscriber.complete();
559
+ observer.complete?.();
504
560
  return;
505
561
  }
506
562
  }
507
563
  });
508
- return unsub;
509
564
  });
510
565
  }
511
- return new import_rxjs.Observable((subscriber) => {
512
- const unsub = node8.subscribe((msgs) => {
566
+ return makeInterop((observer) => {
567
+ return node8.subscribe((msgs) => {
513
568
  for (const m of msgs) {
514
- if (subscriber.closed) return;
569
+ if (observer.closed) return;
515
570
  if (m[0] === import_core6.DATA) {
516
- subscriber.next(m[1]);
571
+ observer.next?.(m[1]);
517
572
  } else if (m[0] === import_core6.ERROR) {
518
- subscriber.error(m[1]);
573
+ observer.error?.(m[1]);
519
574
  return;
520
575
  } else if (m[0] === import_core6.COMPLETE) {
521
- subscriber.complete();
576
+ observer.complete?.();
522
577
  return;
523
578
  }
524
579
  }
525
580
  });
526
- return unsub;
527
581
  });
528
582
  }
529
583