@graphrefly/graphrefly 0.46.0 → 0.47.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 (68) 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-WKSWLSCX.js → chunk-22SG74BD.js} +2 -2
  12. package/dist/{chunk-OO5BM6CJ.js → chunk-5IMMNARC.js} +2 -2
  13. package/dist/{chunk-KIIXR252.js → chunk-EHRRQ4IC.js} +2 -2
  14. package/dist/{chunk-HULCUY35.js → chunk-GWRNLJNW.js} +2 -2
  15. package/dist/{chunk-5THCXDWY.js → chunk-JKTC747G.js} +2 -2
  16. package/dist/{chunk-RGL53X5G.js → chunk-TNX5ZGDJ.js} +3 -3
  17. package/dist/{chunk-LBAJK24K.js → chunk-VLAGJZSL.js} +11 -3
  18. package/dist/chunk-VLAGJZSL.js.map +1 -0
  19. package/dist/chunk-Z65DVDEQ.js +146 -0
  20. package/dist/chunk-Z65DVDEQ.js.map +1 -0
  21. package/dist/{chunk-GBCENOLN.js → chunk-ZT4WMQW4.js} +3 -3
  22. package/dist/{chunk-FR6RGA3B.js → chunk-ZVXXDWIB.js} +19 -14
  23. package/dist/{chunk-FR6RGA3B.js.map → chunk-ZVXXDWIB.js.map} +1 -1
  24. package/dist/compat/index.cjs +156 -93
  25. package/dist/compat/index.cjs.map +1 -1
  26. package/dist/compat/index.d.cts +3 -3
  27. package/dist/compat/index.d.ts +3 -3
  28. package/dist/compat/index.js +2 -2
  29. package/dist/compat/nestjs/index.cjs +156 -93
  30. package/dist/compat/nestjs/index.cjs.map +1 -1
  31. package/dist/compat/nestjs/index.d.cts +4 -4
  32. package/dist/compat/nestjs/index.d.ts +4 -4
  33. package/dist/compat/nestjs/index.js +4 -5
  34. package/dist/{index-5SU_O78r.d.cts → index-B_p8tnvf.d.cts} +19 -3
  35. package/dist/{index-CEXCtYYJ.d.ts → index-_HDSmPyp.d.ts} +19 -3
  36. package/dist/index.cjs +77 -18
  37. package/dist/index.cjs.map +1 -1
  38. package/dist/index.d.cts +1 -2
  39. package/dist/index.d.ts +1 -2
  40. package/dist/index.js +9 -9
  41. package/dist/observable-B25XqCbZ.d.cts +59 -0
  42. package/dist/observable-B25XqCbZ.d.ts +59 -0
  43. package/dist/presets/ai/index.js +5 -5
  44. package/dist/presets/harness/index.js +7 -7
  45. package/dist/presets/index.js +8 -8
  46. package/dist/solutions/index.js +6 -6
  47. package/dist/utils/ai/index.js +3 -3
  48. package/dist/utils/index.cjs +8 -3
  49. package/dist/utils/index.cjs.map +1 -1
  50. package/dist/utils/index.js +3 -3
  51. package/dist/utils/memory/index.cjs +8 -3
  52. package/dist/utils/memory/index.cjs.map +1 -1
  53. package/dist/utils/memory/index.d.cts +78 -0
  54. package/dist/utils/memory/index.d.ts +78 -0
  55. package/dist/utils/memory/index.js +1 -1
  56. package/package.json +1 -5
  57. package/dist/chunk-3QZY5BI7.js +0 -92
  58. package/dist/chunk-3QZY5BI7.js.map +0 -1
  59. package/dist/chunk-LBAJK24K.js.map +0 -1
  60. package/dist/observable-BXQoW1P-.d.cts +0 -36
  61. package/dist/observable-BXQoW1P-.d.ts +0 -36
  62. /package/dist/{chunk-WKSWLSCX.js.map → chunk-22SG74BD.js.map} +0 -0
  63. /package/dist/{chunk-OO5BM6CJ.js.map → chunk-5IMMNARC.js.map} +0 -0
  64. /package/dist/{chunk-KIIXR252.js.map → chunk-EHRRQ4IC.js.map} +0 -0
  65. /package/dist/{chunk-HULCUY35.js.map → chunk-GWRNLJNW.js.map} +0 -0
  66. /package/dist/{chunk-5THCXDWY.js.map → chunk-JKTC747G.js.map} +0 -0
  67. /package/dist/{chunk-RGL53X5G.js.map → chunk-TNX5ZGDJ.js.map} +0 -0
  68. /package/dist/{chunk-GBCENOLN.js.map → chunk-ZT4WMQW4.js.map} +0 -0
@@ -1005,43 +1005,97 @@ function materialize(key, factories, parent, opts) {
1005
1005
 
1006
1006
  // src/base/composition/observable.ts
1007
1007
  var import_core6 = require("@graphrefly/pure-ts/core");
1008
- var import_rxjs = require("rxjs");
1008
+ var OBSERVABLE_KEY = typeof Symbol === "function" && Symbol.observable || "@@observable";
1009
+ function normalizeObserver(observer) {
1010
+ return typeof observer === "function" ? { next: observer } : observer;
1011
+ }
1012
+ function makeInterop(onSubscribe) {
1013
+ const obs = {
1014
+ subscribe(rawObserver) {
1015
+ const observer = normalizeObserver(rawObserver);
1016
+ let closed = false;
1017
+ let teardown;
1018
+ let teardownPending = false;
1019
+ const runTeardown = () => {
1020
+ if (teardown) teardown();
1021
+ else teardownPending = true;
1022
+ };
1023
+ const guarded = {
1024
+ get closed() {
1025
+ return closed;
1026
+ },
1027
+ next(value) {
1028
+ if (!closed) observer.next?.(value);
1029
+ },
1030
+ error(err) {
1031
+ if (closed) return;
1032
+ closed = true;
1033
+ try {
1034
+ observer.error?.(err);
1035
+ } finally {
1036
+ runTeardown();
1037
+ }
1038
+ },
1039
+ complete() {
1040
+ if (closed) return;
1041
+ closed = true;
1042
+ try {
1043
+ observer.complete?.();
1044
+ } finally {
1045
+ runTeardown();
1046
+ }
1047
+ }
1048
+ };
1049
+ teardown = onSubscribe(guarded);
1050
+ if (teardownPending) teardown();
1051
+ return {
1052
+ unsubscribe() {
1053
+ if (closed) return;
1054
+ closed = true;
1055
+ teardown?.();
1056
+ }
1057
+ };
1058
+ }
1059
+ };
1060
+ obs[OBSERVABLE_KEY] = function() {
1061
+ return this;
1062
+ };
1063
+ return obs;
1064
+ }
1009
1065
  function toObservable(node32, options) {
1010
1066
  if (options?.raw) {
1011
- return new import_rxjs.Observable((subscriber) => {
1012
- const unsub = node32.subscribe((msgs) => {
1013
- if (subscriber.closed) return;
1014
- subscriber.next(msgs);
1067
+ return makeInterop((observer) => {
1068
+ return node32.subscribe((msgs) => {
1069
+ if (observer.closed) return;
1070
+ observer.next?.(msgs);
1015
1071
  for (const m of msgs) {
1016
1072
  if (m[0] === import_core6.ERROR) {
1017
- subscriber.error(m[1]);
1073
+ observer.error?.(m[1]);
1018
1074
  return;
1019
1075
  }
1020
1076
  if (m[0] === import_core6.COMPLETE) {
1021
- subscriber.complete();
1077
+ observer.complete?.();
1022
1078
  return;
1023
1079
  }
1024
1080
  }
1025
1081
  });
1026
- return unsub;
1027
1082
  });
1028
1083
  }
1029
- return new import_rxjs.Observable((subscriber) => {
1030
- const unsub = node32.subscribe((msgs) => {
1084
+ return makeInterop((observer) => {
1085
+ return node32.subscribe((msgs) => {
1031
1086
  for (const m of msgs) {
1032
- if (subscriber.closed) return;
1087
+ if (observer.closed) return;
1033
1088
  if (m[0] === import_core6.DATA) {
1034
- subscriber.next(m[1]);
1089
+ observer.next?.(m[1]);
1035
1090
  } else if (m[0] === import_core6.ERROR) {
1036
- subscriber.error(m[1]);
1091
+ observer.error?.(m[1]);
1037
1092
  return;
1038
1093
  } else if (m[0] === import_core6.COMPLETE) {
1039
- subscriber.complete();
1094
+ observer.complete?.();
1040
1095
  return;
1041
1096
  }
1042
1097
  }
1043
1098
  });
1044
- return unsub;
1045
1099
  });
1046
1100
  }
1047
1101