kaabalah 5.5.1 → 6.0.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 (66) hide show
  1. package/README.md +72 -0
  2. package/dist/astrology/index.d.mts +16 -1
  3. package/dist/astrology/index.d.ts +16 -1
  4. package/dist/astrology/index.js +55 -51
  5. package/dist/astrology/index.mjs +1 -1
  6. package/dist/{chunk-BJUCABP4.js → chunk-3HYK4Q4B.js} +123 -10
  7. package/dist/chunk-3HYK4Q4B.js.map +1 -0
  8. package/dist/{chunk-27IU6FA2.mjs → chunk-3SFBJHP2.mjs} +3 -3
  9. package/dist/{chunk-27IU6FA2.mjs.map → chunk-3SFBJHP2.mjs.map} +1 -1
  10. package/dist/chunk-4NMXTZX4.mjs +525 -0
  11. package/dist/chunk-4NMXTZX4.mjs.map +1 -0
  12. package/dist/{chunk-T6Y4DLMA.mjs → chunk-5NCI7UPZ.mjs} +176 -11
  13. package/dist/chunk-5NCI7UPZ.mjs.map +1 -0
  14. package/dist/chunk-7IXAG4KW.mjs +2136 -0
  15. package/dist/chunk-7IXAG4KW.mjs.map +1 -0
  16. package/dist/{chunk-HGEWHDIX.js → chunk-DU5HI6CU.js} +176 -10
  17. package/dist/chunk-DU5HI6CU.js.map +1 -0
  18. package/dist/{chunk-PEAOQ7YH.js → chunk-EVQ432JA.js} +23 -23
  19. package/dist/{chunk-PEAOQ7YH.js.map → chunk-EVQ432JA.js.map} +1 -1
  20. package/dist/{chunk-PPSRTX52.mjs → chunk-IHQPXEB7.mjs} +123 -11
  21. package/dist/chunk-IHQPXEB7.mjs.map +1 -0
  22. package/dist/{chunk-W5UTGQI2.mjs → chunk-S6BFRUJQ.mjs} +3 -3
  23. package/dist/{chunk-W5UTGQI2.mjs.map → chunk-S6BFRUJQ.mjs.map} +1 -1
  24. package/dist/chunk-XB6PXEKO.js +529 -0
  25. package/dist/chunk-XB6PXEKO.js.map +1 -0
  26. package/dist/chunk-XNJ6UHWN.js +2150 -0
  27. package/dist/chunk-XNJ6UHWN.js.map +1 -0
  28. package/dist/{chunk-ZQ2ZZPOW.js → chunk-XTVGQXCL.js} +4 -4
  29. package/dist/{chunk-ZQ2ZZPOW.js.map → chunk-XTVGQXCL.js.map} +1 -1
  30. package/dist/cli.js +1817 -97
  31. package/dist/cli.js.map +1 -1
  32. package/dist/{registry-DOiHyH-r.d.mts → constants-DbFwuCjR.d.mts} +1 -177
  33. package/dist/{registry-DOiHyH-r.d.ts → constants-DbFwuCjR.d.ts} +1 -177
  34. package/dist/core/index.d.mts +66 -3
  35. package/dist/core/index.d.ts +66 -3
  36. package/dist/core/index.js +55 -39
  37. package/dist/core/index.mjs +2 -2
  38. package/dist/correspondence-model-D8c42J4c.d.mts +281 -0
  39. package/dist/correspondence-model-DhmBYoMf.d.ts +281 -0
  40. package/dist/gematria/index.d.mts +2 -1
  41. package/dist/gematria/index.d.ts +2 -1
  42. package/dist/gematria/index.js +5 -5
  43. package/dist/gematria/index.mjs +2 -2
  44. package/dist/index.d.mts +5 -4
  45. package/dist/index.d.ts +5 -4
  46. package/dist/index.js +179 -119
  47. package/dist/index.mjs +6 -6
  48. package/dist/numerology/index.js +18 -18
  49. package/dist/numerology/index.mjs +3 -3
  50. package/dist/tarot/index.d.mts +157 -2
  51. package/dist/tarot/index.d.ts +157 -2
  52. package/dist/tarot/index.js +46 -4
  53. package/dist/tarot/index.mjs +3 -1
  54. package/package.json +1 -1
  55. package/dist/chunk-3IPH7UTM.mjs +0 -878
  56. package/dist/chunk-3IPH7UTM.mjs.map +0 -1
  57. package/dist/chunk-AD7T42HJ.js +0 -4
  58. package/dist/chunk-AD7T42HJ.js.map +0 -1
  59. package/dist/chunk-BJUCABP4.js.map +0 -1
  60. package/dist/chunk-FYR5Z7M2.js +0 -882
  61. package/dist/chunk-FYR5Z7M2.js.map +0 -1
  62. package/dist/chunk-HGEWHDIX.js.map +0 -1
  63. package/dist/chunk-PPSRTX52.mjs.map +0 -1
  64. package/dist/chunk-RFSO3JRG.mjs +0 -3
  65. package/dist/chunk-RFSO3JRG.mjs.map +0 -1
  66. package/dist/chunk-T6Y4DLMA.mjs.map +0 -1
package/README.md CHANGED
@@ -72,6 +72,63 @@ const gematriaValue = calculateGematria('kaabalah');
72
72
  const spread = getRandomSpread(3, true);
73
73
  ```
74
74
 
75
+ ### Canonical Tarot Image Resolution
76
+
77
+ ```typescript
78
+ import { id, KaabalahTypes } from "kaabalah/core";
79
+ import {
80
+ getTarotArchetype,
81
+ getTarotRepresentation,
82
+ resolveTarotImageUrl
83
+ } from "kaabalah/tarot";
84
+
85
+ const archetype = getTarotArchetype({
86
+ pathId: id(KaabalahTypes.PATH, 2)
87
+ });
88
+
89
+ const riderWaite = getTarotRepresentation({ pathSlug: "beth" }, "rider-waite");
90
+ const papusImageUrl = resolveTarotImageUrl(
91
+ { tarotCardFilename: "02_the_high_priestess" },
92
+ "papus_pt"
93
+ );
94
+
95
+ // Persist the canonical archetype ID (for example `path:2`), not the image URL.
96
+ ```
97
+
98
+ The tarot resolver currently supports major-card archetypes only. Use `path:<1-22>` as the canonical persisted key, and treat path slugs, major-card filenames, and major-card numbers as lookup aliases.
99
+
100
+ ### Canonical Tarot Spreads
101
+
102
+ ```typescript
103
+ import {
104
+ drawTarotSpread,
105
+ getTarotSpread,
106
+ listTarotSpreads,
107
+ validateTarotSpreadSelection
108
+ } from "kaabalah/tarot";
109
+
110
+ const spreads = listTarotSpreads();
111
+ const treeOfLife = getTarotSpread("tree-of-life-reading");
112
+
113
+ const drawn = drawTarotSpread({
114
+ spreadId: "event-reading",
115
+ context: { inquirerGender: "man" },
116
+ includeInverted: true
117
+ });
118
+
119
+ const validation = validateTarotSpreadSelection({
120
+ spreadId: drawn.spread.spreadId,
121
+ context: drawn.context,
122
+ cards: drawn.cards.map((card) => ({
123
+ slotKey: card.slotKey,
124
+ cardNumber: card.cardNumber,
125
+ isInverted: card.isInverted
126
+ }))
127
+ });
128
+ ```
129
+
130
+ Downstream apps should consume `spreadId`, `slotKey`, and the slot constraint metadata from the library instead of hardcoding spread semantics. Persist the reading state as canonical spread/card data such as `spreadId`, `slotKey`, `cardNumber`, `isInverted`, and app-side notes.
131
+
75
132
  ## CLI
76
133
 
77
134
  Kaabalah includes a command-line interface for quick calculations without writing code.
@@ -185,6 +242,21 @@ npm run dev
185
242
 
186
243
  The astrological calculations use the Swiss Ephemeris library, compiled to WebAssembly for use in both Node.js and browser environments.
187
244
 
245
+ For Node apps that need stable runtime asset paths, use the exported helper instead of probing `node_modules/kaabalah` manually:
246
+
247
+ ```typescript
248
+ import { getSwissEph, resolveSwissEphRuntimeAssets } from "kaabalah/astrology";
249
+
250
+ const assets = resolveSwissEphRuntimeAssets({
251
+ wasmPathCandidates: ["./vendor/kaabalah/swisseph.node.wasm"],
252
+ ephePathCandidates: ["./vendor/kaabalah/ephe"]
253
+ });
254
+
255
+ await getSwissEph(assets);
256
+ ```
257
+
258
+ If no app-specific candidates are provided, the helper falls back to the package-bundled Node assets. In browser environments it stays filesystem-free and returns the bundled browser defaults.
259
+
188
260
  ## License
189
261
 
190
262
  This project is licensed under the AGPL-3.0 license. See the LICENSE file for details.
@@ -73,6 +73,21 @@ interface PlanetPosition {
73
73
  }
74
74
  declare const normalizeAngle: (deg: number) => number;
75
75
 
76
+ type RuntimeAssetSource = "explicit" | "env" | "candidate" | "bundled";
77
+ interface SwissEphRuntimeAssetPaths {
78
+ wasmPath: string;
79
+ ephePath: string;
80
+ wasmPathSource: RuntimeAssetSource;
81
+ ephePathSource: RuntimeAssetSource;
82
+ }
83
+ interface ResolveSwissEphRuntimeAssetsOptions {
84
+ wasmPath?: string;
85
+ ephePath?: string;
86
+ wasmPathCandidates?: string[];
87
+ ephePathCandidates?: string[];
88
+ env?: Record<string, string | undefined>;
89
+ }
90
+ declare function resolveSwissEphRuntimeAssets(options?: ResolveSwissEphRuntimeAssetsOptions): SwissEphRuntimeAssetPaths;
76
91
  /**
77
92
  * Initializes and returns the Swiss Ephemeris instance.
78
93
  * In a browser environment, assets are loaded relative to the script.
@@ -593,4 +608,4 @@ interface SolarReturnChart {
593
608
  */
594
609
  declare function getSolarReturnChart(options: SolarReturnOptions): Promise<SolarReturnChart>;
595
610
 
596
- export { ASTROCARTOGRAPHY_DEFAULT_PLANETS, type AngleType, type AnnualProfection, type AspectEdge, type AspectName, type AspectPerfection, type AspectSpec, type AstrocartographyHorizonLine, type AstrocartographyHorizonPoint, type AstrocartographyLineProximity, type AstrocartographyMap, type AstrocartographyMapOptions, type AstrocartographyMeridianLine, type AstrocartographyParan, type AstrocartographyQueryOptions, type AstrocartographyQueryResult, type AzaltResult, type BirthChart, type BirthChartOptions, CalcFlag, type CompositeChart, type CompositeChartOptions, DEFAULT_ASPECT_SPECS, DOMICILE_RULERS, type DecanResult, type DodecatemoriaResult, EXALTATIONS, type EssentialDignityResult, type FirdariaMajorPeriod, type FirdariaOptions, type FirdariaPlanet, type FirdariaResult, type FirdariaSubPeriod, HouseSystem, type HydratedNode, type HydratedPlanet, type MonthlyProfection, type MonthlyProfectionsResult, PLANET_AND_NODE_NAMES, Planet, type PlanetEquatorial, RiseTransitFlag, SIGNS, SLOW_PLANETS, type Sign, type SolarReturnChart, type SolarReturnOptions, type SynastryChart, type SynastryChartOptions, type TraditionalPlanet, type TransitAspectEdge, type TransitAspectPoint, type TransitChart, type TransitChartOptions, type TransitPlanet, type TransitRangeOptions, type TransitRangeResult, type TwoChartOptions, VirtualNodes, type ZodiacPosition, closeSwissEph, computeAspects, computeAstrocartographyMap, computeEquatorialPositions, computeGMST, computeHorizonLongitude, computeICLongitude, computeMCLongitude, computeMidpoints, computeSynastryAspects, computeTransitAspects, findHouseOf, findParansAtLatitude, formatDegreeMinutes, geographicAngularDifference, getAnnualProfection, getAspectMatch, getBirthChart, getCompositeChart, getDecan, getDetriment, getDodecatemoria, getDomicileRuler, getEssentialDignity, getExaltation, getFall, getFirdaria, getMonthlyProfections, getOppositeSign, getSolarReturnChart, getSwissEph, getSynastryChart, getTransitChart, getTransitRange, getZodiacPosition, normalizeAngle, queryAstrocartographyLocation, shorterArcMidpoint };
611
+ export { ASTROCARTOGRAPHY_DEFAULT_PLANETS, type AngleType, type AnnualProfection, type AspectEdge, type AspectName, type AspectPerfection, type AspectSpec, type AstrocartographyHorizonLine, type AstrocartographyHorizonPoint, type AstrocartographyLineProximity, type AstrocartographyMap, type AstrocartographyMapOptions, type AstrocartographyMeridianLine, type AstrocartographyParan, type AstrocartographyQueryOptions, type AstrocartographyQueryResult, type AzaltResult, type BirthChart, type BirthChartOptions, CalcFlag, type CompositeChart, type CompositeChartOptions, DEFAULT_ASPECT_SPECS, DOMICILE_RULERS, type DecanResult, type DodecatemoriaResult, EXALTATIONS, type EssentialDignityResult, type FirdariaMajorPeriod, type FirdariaOptions, type FirdariaPlanet, type FirdariaResult, type FirdariaSubPeriod, HouseSystem, type HydratedNode, type HydratedPlanet, type MonthlyProfection, type MonthlyProfectionsResult, PLANET_AND_NODE_NAMES, Planet, type PlanetEquatorial, type ResolveSwissEphRuntimeAssetsOptions, RiseTransitFlag, SIGNS, SLOW_PLANETS, type Sign, type SolarReturnChart, type SolarReturnOptions, type SwissEphRuntimeAssetPaths, type SynastryChart, type SynastryChartOptions, type TraditionalPlanet, type TransitAspectEdge, type TransitAspectPoint, type TransitChart, type TransitChartOptions, type TransitPlanet, type TransitRangeOptions, type TransitRangeResult, type TwoChartOptions, VirtualNodes, type ZodiacPosition, closeSwissEph, computeAspects, computeAstrocartographyMap, computeEquatorialPositions, computeGMST, computeHorizonLongitude, computeICLongitude, computeMCLongitude, computeMidpoints, computeSynastryAspects, computeTransitAspects, findHouseOf, findParansAtLatitude, formatDegreeMinutes, geographicAngularDifference, getAnnualProfection, getAspectMatch, getBirthChart, getCompositeChart, getDecan, getDetriment, getDodecatemoria, getDomicileRuler, getEssentialDignity, getExaltation, getFall, getFirdaria, getMonthlyProfections, getOppositeSign, getSolarReturnChart, getSwissEph, getSynastryChart, getTransitChart, getTransitRange, getZodiacPosition, normalizeAngle, queryAstrocartographyLocation, resolveSwissEphRuntimeAssets, shorterArcMidpoint };
@@ -73,6 +73,21 @@ interface PlanetPosition {
73
73
  }
74
74
  declare const normalizeAngle: (deg: number) => number;
75
75
 
76
+ type RuntimeAssetSource = "explicit" | "env" | "candidate" | "bundled";
77
+ interface SwissEphRuntimeAssetPaths {
78
+ wasmPath: string;
79
+ ephePath: string;
80
+ wasmPathSource: RuntimeAssetSource;
81
+ ephePathSource: RuntimeAssetSource;
82
+ }
83
+ interface ResolveSwissEphRuntimeAssetsOptions {
84
+ wasmPath?: string;
85
+ ephePath?: string;
86
+ wasmPathCandidates?: string[];
87
+ ephePathCandidates?: string[];
88
+ env?: Record<string, string | undefined>;
89
+ }
90
+ declare function resolveSwissEphRuntimeAssets(options?: ResolveSwissEphRuntimeAssetsOptions): SwissEphRuntimeAssetPaths;
76
91
  /**
77
92
  * Initializes and returns the Swiss Ephemeris instance.
78
93
  * In a browser environment, assets are loaded relative to the script.
@@ -593,4 +608,4 @@ interface SolarReturnChart {
593
608
  */
594
609
  declare function getSolarReturnChart(options: SolarReturnOptions): Promise<SolarReturnChart>;
595
610
 
596
- export { ASTROCARTOGRAPHY_DEFAULT_PLANETS, type AngleType, type AnnualProfection, type AspectEdge, type AspectName, type AspectPerfection, type AspectSpec, type AstrocartographyHorizonLine, type AstrocartographyHorizonPoint, type AstrocartographyLineProximity, type AstrocartographyMap, type AstrocartographyMapOptions, type AstrocartographyMeridianLine, type AstrocartographyParan, type AstrocartographyQueryOptions, type AstrocartographyQueryResult, type AzaltResult, type BirthChart, type BirthChartOptions, CalcFlag, type CompositeChart, type CompositeChartOptions, DEFAULT_ASPECT_SPECS, DOMICILE_RULERS, type DecanResult, type DodecatemoriaResult, EXALTATIONS, type EssentialDignityResult, type FirdariaMajorPeriod, type FirdariaOptions, type FirdariaPlanet, type FirdariaResult, type FirdariaSubPeriod, HouseSystem, type HydratedNode, type HydratedPlanet, type MonthlyProfection, type MonthlyProfectionsResult, PLANET_AND_NODE_NAMES, Planet, type PlanetEquatorial, RiseTransitFlag, SIGNS, SLOW_PLANETS, type Sign, type SolarReturnChart, type SolarReturnOptions, type SynastryChart, type SynastryChartOptions, type TraditionalPlanet, type TransitAspectEdge, type TransitAspectPoint, type TransitChart, type TransitChartOptions, type TransitPlanet, type TransitRangeOptions, type TransitRangeResult, type TwoChartOptions, VirtualNodes, type ZodiacPosition, closeSwissEph, computeAspects, computeAstrocartographyMap, computeEquatorialPositions, computeGMST, computeHorizonLongitude, computeICLongitude, computeMCLongitude, computeMidpoints, computeSynastryAspects, computeTransitAspects, findHouseOf, findParansAtLatitude, formatDegreeMinutes, geographicAngularDifference, getAnnualProfection, getAspectMatch, getBirthChart, getCompositeChart, getDecan, getDetriment, getDodecatemoria, getDomicileRuler, getEssentialDignity, getExaltation, getFall, getFirdaria, getMonthlyProfections, getOppositeSign, getSolarReturnChart, getSwissEph, getSynastryChart, getTransitChart, getTransitRange, getZodiacPosition, normalizeAngle, queryAstrocartographyLocation, shorterArcMidpoint };
611
+ export { ASTROCARTOGRAPHY_DEFAULT_PLANETS, type AngleType, type AnnualProfection, type AspectEdge, type AspectName, type AspectPerfection, type AspectSpec, type AstrocartographyHorizonLine, type AstrocartographyHorizonPoint, type AstrocartographyLineProximity, type AstrocartographyMap, type AstrocartographyMapOptions, type AstrocartographyMeridianLine, type AstrocartographyParan, type AstrocartographyQueryOptions, type AstrocartographyQueryResult, type AzaltResult, type BirthChart, type BirthChartOptions, CalcFlag, type CompositeChart, type CompositeChartOptions, DEFAULT_ASPECT_SPECS, DOMICILE_RULERS, type DecanResult, type DodecatemoriaResult, EXALTATIONS, type EssentialDignityResult, type FirdariaMajorPeriod, type FirdariaOptions, type FirdariaPlanet, type FirdariaResult, type FirdariaSubPeriod, HouseSystem, type HydratedNode, type HydratedPlanet, type MonthlyProfection, type MonthlyProfectionsResult, PLANET_AND_NODE_NAMES, Planet, type PlanetEquatorial, type ResolveSwissEphRuntimeAssetsOptions, RiseTransitFlag, SIGNS, SLOW_PLANETS, type Sign, type SolarReturnChart, type SolarReturnOptions, type SwissEphRuntimeAssetPaths, type SynastryChart, type SynastryChartOptions, type TraditionalPlanet, type TransitAspectEdge, type TransitAspectPoint, type TransitChart, type TransitChartOptions, type TransitPlanet, type TransitRangeOptions, type TransitRangeResult, type TwoChartOptions, VirtualNodes, type ZodiacPosition, closeSwissEph, computeAspects, computeAstrocartographyMap, computeEquatorialPositions, computeGMST, computeHorizonLongitude, computeICLongitude, computeMCLongitude, computeMidpoints, computeSynastryAspects, computeTransitAspects, findHouseOf, findParansAtLatitude, formatDegreeMinutes, geographicAngularDifference, getAnnualProfection, getAspectMatch, getBirthChart, getCompositeChart, getDecan, getDetriment, getDodecatemoria, getDomicileRuler, getEssentialDignity, getExaltation, getFall, getFirdaria, getMonthlyProfections, getOppositeSign, getSolarReturnChart, getSwissEph, getSynastryChart, getTransitChart, getTransitRange, getZodiacPosition, normalizeAngle, queryAstrocartographyLocation, resolveSwissEphRuntimeAssets, shorterArcMidpoint };
@@ -1,209 +1,213 @@
1
1
  'use strict';
2
2
 
3
- var chunkHGEWHDIX_js = require('../chunk-HGEWHDIX.js');
3
+ var chunkDU5HI6CU_js = require('../chunk-DU5HI6CU.js');
4
4
  require('../chunk-FM7WUVZV.js');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "ASTROCARTOGRAPHY_DEFAULT_PLANETS", {
9
9
  enumerable: true,
10
- get: function () { return chunkHGEWHDIX_js.ASTROCARTOGRAPHY_DEFAULT_PLANETS; }
10
+ get: function () { return chunkDU5HI6CU_js.ASTROCARTOGRAPHY_DEFAULT_PLANETS; }
11
11
  });
12
12
  Object.defineProperty(exports, "CalcFlag", {
13
13
  enumerable: true,
14
- get: function () { return chunkHGEWHDIX_js.CalcFlag; }
14
+ get: function () { return chunkDU5HI6CU_js.CalcFlag; }
15
15
  });
16
16
  Object.defineProperty(exports, "DEFAULT_ASPECT_SPECS", {
17
17
  enumerable: true,
18
- get: function () { return chunkHGEWHDIX_js.DEFAULT_ASPECT_SPECS; }
18
+ get: function () { return chunkDU5HI6CU_js.DEFAULT_ASPECT_SPECS; }
19
19
  });
20
20
  Object.defineProperty(exports, "DOMICILE_RULERS", {
21
21
  enumerable: true,
22
- get: function () { return chunkHGEWHDIX_js.DOMICILE_RULERS; }
22
+ get: function () { return chunkDU5HI6CU_js.DOMICILE_RULERS; }
23
23
  });
24
24
  Object.defineProperty(exports, "EXALTATIONS", {
25
25
  enumerable: true,
26
- get: function () { return chunkHGEWHDIX_js.EXALTATIONS; }
26
+ get: function () { return chunkDU5HI6CU_js.EXALTATIONS; }
27
27
  });
28
28
  Object.defineProperty(exports, "HouseSystem", {
29
29
  enumerable: true,
30
- get: function () { return chunkHGEWHDIX_js.HouseSystem; }
30
+ get: function () { return chunkDU5HI6CU_js.HouseSystem; }
31
31
  });
32
32
  Object.defineProperty(exports, "PLANET_AND_NODE_NAMES", {
33
33
  enumerable: true,
34
- get: function () { return chunkHGEWHDIX_js.PLANET_AND_NODE_NAMES; }
34
+ get: function () { return chunkDU5HI6CU_js.PLANET_AND_NODE_NAMES; }
35
35
  });
36
36
  Object.defineProperty(exports, "Planet", {
37
37
  enumerable: true,
38
- get: function () { return chunkHGEWHDIX_js.Planet; }
38
+ get: function () { return chunkDU5HI6CU_js.Planet; }
39
39
  });
40
40
  Object.defineProperty(exports, "RiseTransitFlag", {
41
41
  enumerable: true,
42
- get: function () { return chunkHGEWHDIX_js.RiseTransitFlag; }
42
+ get: function () { return chunkDU5HI6CU_js.RiseTransitFlag; }
43
43
  });
44
44
  Object.defineProperty(exports, "SIGNS", {
45
45
  enumerable: true,
46
- get: function () { return chunkHGEWHDIX_js.SIGNS; }
46
+ get: function () { return chunkDU5HI6CU_js.SIGNS; }
47
47
  });
48
48
  Object.defineProperty(exports, "SLOW_PLANETS", {
49
49
  enumerable: true,
50
- get: function () { return chunkHGEWHDIX_js.SLOW_PLANETS; }
50
+ get: function () { return chunkDU5HI6CU_js.SLOW_PLANETS; }
51
51
  });
52
52
  Object.defineProperty(exports, "VirtualNodes", {
53
53
  enumerable: true,
54
- get: function () { return chunkHGEWHDIX_js.VirtualNodes; }
54
+ get: function () { return chunkDU5HI6CU_js.VirtualNodes; }
55
55
  });
56
56
  Object.defineProperty(exports, "closeSwissEph", {
57
57
  enumerable: true,
58
- get: function () { return chunkHGEWHDIX_js.closeSwissEph; }
58
+ get: function () { return chunkDU5HI6CU_js.closeSwissEph; }
59
59
  });
60
60
  Object.defineProperty(exports, "computeAspects", {
61
61
  enumerable: true,
62
- get: function () { return chunkHGEWHDIX_js.computeAspects; }
62
+ get: function () { return chunkDU5HI6CU_js.computeAspects; }
63
63
  });
64
64
  Object.defineProperty(exports, "computeAstrocartographyMap", {
65
65
  enumerable: true,
66
- get: function () { return chunkHGEWHDIX_js.computeAstrocartographyMap; }
66
+ get: function () { return chunkDU5HI6CU_js.computeAstrocartographyMap; }
67
67
  });
68
68
  Object.defineProperty(exports, "computeEquatorialPositions", {
69
69
  enumerable: true,
70
- get: function () { return chunkHGEWHDIX_js.computeEquatorialPositions; }
70
+ get: function () { return chunkDU5HI6CU_js.computeEquatorialPositions; }
71
71
  });
72
72
  Object.defineProperty(exports, "computeGMST", {
73
73
  enumerable: true,
74
- get: function () { return chunkHGEWHDIX_js.computeGMST; }
74
+ get: function () { return chunkDU5HI6CU_js.computeGMST; }
75
75
  });
76
76
  Object.defineProperty(exports, "computeHorizonLongitude", {
77
77
  enumerable: true,
78
- get: function () { return chunkHGEWHDIX_js.computeHorizonLongitude; }
78
+ get: function () { return chunkDU5HI6CU_js.computeHorizonLongitude; }
79
79
  });
80
80
  Object.defineProperty(exports, "computeICLongitude", {
81
81
  enumerable: true,
82
- get: function () { return chunkHGEWHDIX_js.computeICLongitude; }
82
+ get: function () { return chunkDU5HI6CU_js.computeICLongitude; }
83
83
  });
84
84
  Object.defineProperty(exports, "computeMCLongitude", {
85
85
  enumerable: true,
86
- get: function () { return chunkHGEWHDIX_js.computeMCLongitude; }
86
+ get: function () { return chunkDU5HI6CU_js.computeMCLongitude; }
87
87
  });
88
88
  Object.defineProperty(exports, "computeMidpoints", {
89
89
  enumerable: true,
90
- get: function () { return chunkHGEWHDIX_js.computeMidpoints; }
90
+ get: function () { return chunkDU5HI6CU_js.computeMidpoints; }
91
91
  });
92
92
  Object.defineProperty(exports, "computeSynastryAspects", {
93
93
  enumerable: true,
94
- get: function () { return chunkHGEWHDIX_js.computeSynastryAspects; }
94
+ get: function () { return chunkDU5HI6CU_js.computeSynastryAspects; }
95
95
  });
96
96
  Object.defineProperty(exports, "computeTransitAspects", {
97
97
  enumerable: true,
98
- get: function () { return chunkHGEWHDIX_js.computeTransitAspects; }
98
+ get: function () { return chunkDU5HI6CU_js.computeTransitAspects; }
99
99
  });
100
100
  Object.defineProperty(exports, "findHouseOf", {
101
101
  enumerable: true,
102
- get: function () { return chunkHGEWHDIX_js.findHouseOf; }
102
+ get: function () { return chunkDU5HI6CU_js.findHouseOf; }
103
103
  });
104
104
  Object.defineProperty(exports, "findParansAtLatitude", {
105
105
  enumerable: true,
106
- get: function () { return chunkHGEWHDIX_js.findParansAtLatitude; }
106
+ get: function () { return chunkDU5HI6CU_js.findParansAtLatitude; }
107
107
  });
108
108
  Object.defineProperty(exports, "formatDegreeMinutes", {
109
109
  enumerable: true,
110
- get: function () { return chunkHGEWHDIX_js.formatDegreeMinutes; }
110
+ get: function () { return chunkDU5HI6CU_js.formatDegreeMinutes; }
111
111
  });
112
112
  Object.defineProperty(exports, "geographicAngularDifference", {
113
113
  enumerable: true,
114
- get: function () { return chunkHGEWHDIX_js.geographicAngularDifference; }
114
+ get: function () { return chunkDU5HI6CU_js.geographicAngularDifference; }
115
115
  });
116
116
  Object.defineProperty(exports, "getAnnualProfection", {
117
117
  enumerable: true,
118
- get: function () { return chunkHGEWHDIX_js.getAnnualProfection; }
118
+ get: function () { return chunkDU5HI6CU_js.getAnnualProfection; }
119
119
  });
120
120
  Object.defineProperty(exports, "getAspectMatch", {
121
121
  enumerable: true,
122
- get: function () { return chunkHGEWHDIX_js.getAspectMatch; }
122
+ get: function () { return chunkDU5HI6CU_js.getAspectMatch; }
123
123
  });
124
124
  Object.defineProperty(exports, "getBirthChart", {
125
125
  enumerable: true,
126
- get: function () { return chunkHGEWHDIX_js.getBirthChart; }
126
+ get: function () { return chunkDU5HI6CU_js.getBirthChart; }
127
127
  });
128
128
  Object.defineProperty(exports, "getCompositeChart", {
129
129
  enumerable: true,
130
- get: function () { return chunkHGEWHDIX_js.getCompositeChart; }
130
+ get: function () { return chunkDU5HI6CU_js.getCompositeChart; }
131
131
  });
132
132
  Object.defineProperty(exports, "getDecan", {
133
133
  enumerable: true,
134
- get: function () { return chunkHGEWHDIX_js.getDecan; }
134
+ get: function () { return chunkDU5HI6CU_js.getDecan; }
135
135
  });
136
136
  Object.defineProperty(exports, "getDetriment", {
137
137
  enumerable: true,
138
- get: function () { return chunkHGEWHDIX_js.getDetriment; }
138
+ get: function () { return chunkDU5HI6CU_js.getDetriment; }
139
139
  });
140
140
  Object.defineProperty(exports, "getDodecatemoria", {
141
141
  enumerable: true,
142
- get: function () { return chunkHGEWHDIX_js.getDodecatemoria; }
142
+ get: function () { return chunkDU5HI6CU_js.getDodecatemoria; }
143
143
  });
144
144
  Object.defineProperty(exports, "getDomicileRuler", {
145
145
  enumerable: true,
146
- get: function () { return chunkHGEWHDIX_js.getDomicileRuler; }
146
+ get: function () { return chunkDU5HI6CU_js.getDomicileRuler; }
147
147
  });
148
148
  Object.defineProperty(exports, "getEssentialDignity", {
149
149
  enumerable: true,
150
- get: function () { return chunkHGEWHDIX_js.getEssentialDignity; }
150
+ get: function () { return chunkDU5HI6CU_js.getEssentialDignity; }
151
151
  });
152
152
  Object.defineProperty(exports, "getExaltation", {
153
153
  enumerable: true,
154
- get: function () { return chunkHGEWHDIX_js.getExaltation; }
154
+ get: function () { return chunkDU5HI6CU_js.getExaltation; }
155
155
  });
156
156
  Object.defineProperty(exports, "getFall", {
157
157
  enumerable: true,
158
- get: function () { return chunkHGEWHDIX_js.getFall; }
158
+ get: function () { return chunkDU5HI6CU_js.getFall; }
159
159
  });
160
160
  Object.defineProperty(exports, "getFirdaria", {
161
161
  enumerable: true,
162
- get: function () { return chunkHGEWHDIX_js.getFirdaria; }
162
+ get: function () { return chunkDU5HI6CU_js.getFirdaria; }
163
163
  });
164
164
  Object.defineProperty(exports, "getMonthlyProfections", {
165
165
  enumerable: true,
166
- get: function () { return chunkHGEWHDIX_js.getMonthlyProfections; }
166
+ get: function () { return chunkDU5HI6CU_js.getMonthlyProfections; }
167
167
  });
168
168
  Object.defineProperty(exports, "getOppositeSign", {
169
169
  enumerable: true,
170
- get: function () { return chunkHGEWHDIX_js.getOppositeSign; }
170
+ get: function () { return chunkDU5HI6CU_js.getOppositeSign; }
171
171
  });
172
172
  Object.defineProperty(exports, "getSolarReturnChart", {
173
173
  enumerable: true,
174
- get: function () { return chunkHGEWHDIX_js.getSolarReturnChart; }
174
+ get: function () { return chunkDU5HI6CU_js.getSolarReturnChart; }
175
175
  });
176
176
  Object.defineProperty(exports, "getSwissEph", {
177
177
  enumerable: true,
178
- get: function () { return chunkHGEWHDIX_js.getSwissEph; }
178
+ get: function () { return chunkDU5HI6CU_js.getSwissEph; }
179
179
  });
180
180
  Object.defineProperty(exports, "getSynastryChart", {
181
181
  enumerable: true,
182
- get: function () { return chunkHGEWHDIX_js.getSynastryChart; }
182
+ get: function () { return chunkDU5HI6CU_js.getSynastryChart; }
183
183
  });
184
184
  Object.defineProperty(exports, "getTransitChart", {
185
185
  enumerable: true,
186
- get: function () { return chunkHGEWHDIX_js.getTransitChart; }
186
+ get: function () { return chunkDU5HI6CU_js.getTransitChart; }
187
187
  });
188
188
  Object.defineProperty(exports, "getTransitRange", {
189
189
  enumerable: true,
190
- get: function () { return chunkHGEWHDIX_js.getTransitRange; }
190
+ get: function () { return chunkDU5HI6CU_js.getTransitRange; }
191
191
  });
192
192
  Object.defineProperty(exports, "getZodiacPosition", {
193
193
  enumerable: true,
194
- get: function () { return chunkHGEWHDIX_js.getZodiacPosition; }
194
+ get: function () { return chunkDU5HI6CU_js.getZodiacPosition; }
195
195
  });
196
196
  Object.defineProperty(exports, "normalizeAngle", {
197
197
  enumerable: true,
198
- get: function () { return chunkHGEWHDIX_js.normalizeAngle; }
198
+ get: function () { return chunkDU5HI6CU_js.normalizeAngle; }
199
199
  });
200
200
  Object.defineProperty(exports, "queryAstrocartographyLocation", {
201
201
  enumerable: true,
202
- get: function () { return chunkHGEWHDIX_js.queryAstrocartographyLocation; }
202
+ get: function () { return chunkDU5HI6CU_js.queryAstrocartographyLocation; }
203
+ });
204
+ Object.defineProperty(exports, "resolveSwissEphRuntimeAssets", {
205
+ enumerable: true,
206
+ get: function () { return chunkDU5HI6CU_js.resolveSwissEphRuntimeAssets; }
203
207
  });
204
208
  Object.defineProperty(exports, "shorterArcMidpoint", {
205
209
  enumerable: true,
206
- get: function () { return chunkHGEWHDIX_js.shorterArcMidpoint; }
210
+ get: function () { return chunkDU5HI6CU_js.shorterArcMidpoint; }
207
211
  });
208
212
  //# sourceMappingURL=index.js.map
209
213
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- export { ASTROCARTOGRAPHY_DEFAULT_PLANETS, CalcFlag, DEFAULT_ASPECT_SPECS, DOMICILE_RULERS, EXALTATIONS, HouseSystem, PLANET_AND_NODE_NAMES, Planet, RiseTransitFlag, SIGNS, SLOW_PLANETS, VirtualNodes, closeSwissEph, computeAspects, computeAstrocartographyMap, computeEquatorialPositions, computeGMST, computeHorizonLongitude, computeICLongitude, computeMCLongitude, computeMidpoints, computeSynastryAspects, computeTransitAspects, findHouseOf, findParansAtLatitude, formatDegreeMinutes, geographicAngularDifference, getAnnualProfection, getAspectMatch, getBirthChart, getCompositeChart, getDecan, getDetriment, getDodecatemoria, getDomicileRuler, getEssentialDignity, getExaltation, getFall, getFirdaria, getMonthlyProfections, getOppositeSign, getSolarReturnChart, getSwissEph, getSynastryChart, getTransitChart, getTransitRange, getZodiacPosition, normalizeAngle, queryAstrocartographyLocation, shorterArcMidpoint } from '../chunk-T6Y4DLMA.mjs';
1
+ export { ASTROCARTOGRAPHY_DEFAULT_PLANETS, CalcFlag, DEFAULT_ASPECT_SPECS, DOMICILE_RULERS, EXALTATIONS, HouseSystem, PLANET_AND_NODE_NAMES, Planet, RiseTransitFlag, SIGNS, SLOW_PLANETS, VirtualNodes, closeSwissEph, computeAspects, computeAstrocartographyMap, computeEquatorialPositions, computeGMST, computeHorizonLongitude, computeICLongitude, computeMCLongitude, computeMidpoints, computeSynastryAspects, computeTransitAspects, findHouseOf, findParansAtLatitude, formatDegreeMinutes, geographicAngularDifference, getAnnualProfection, getAspectMatch, getBirthChart, getCompositeChart, getDecan, getDetriment, getDodecatemoria, getDomicileRuler, getEssentialDignity, getExaltation, getFall, getFirdaria, getMonthlyProfections, getOppositeSign, getSolarReturnChart, getSwissEph, getSynastryChart, getTransitChart, getTransitRange, getZodiacPosition, normalizeAngle, queryAstrocartographyLocation, resolveSwissEphRuntimeAssets, shorterArcMidpoint } from '../chunk-5NCI7UPZ.mjs';
2
2
  import '../chunk-WY6NIR2V.mjs';
3
3
  //# sourceMappingURL=index.mjs.map
4
4
  //# sourceMappingURL=index.mjs.map
@@ -2109,6 +2109,11 @@ var COLORS_DATA = {
2109
2109
  }
2110
2110
  };
2111
2111
 
2112
+ // src/core/correspondence-model.ts
2113
+ function makeCorrespondenceId(left, right) {
2114
+ return [left, right].sort().join("<->");
2115
+ }
2116
+
2112
2117
  // src/core/types.ts
2113
2118
  var KaabalahTypes = /* @__PURE__ */ ((KaabalahTypes2) => {
2114
2119
  KaabalahTypes2["SPHERE"] = "sphere";
@@ -6495,7 +6500,13 @@ var ModuleManager = class {
6495
6500
  if (!loadedSystem) {
6496
6501
  throw new Error(`System ${systemKey} not found`);
6497
6502
  }
6498
- loadedSystem.LOADERS.base(this.t);
6503
+ this.t.runWithMutationSource(
6504
+ {
6505
+ kind: "system",
6506
+ system: systemKey
6507
+ },
6508
+ () => loadedSystem.LOADERS.base(this.t)
6509
+ );
6499
6510
  this.activeSystem = systemKey;
6500
6511
  this.loadedParts.clear();
6501
6512
  this.loadedParts.add("base");
@@ -6515,13 +6526,28 @@ var ModuleManager = class {
6515
6526
  if (this.loadedParts.has(partKey)) {
6516
6527
  return;
6517
6528
  }
6518
- system.LOADERS[partKey](this.t);
6529
+ this.t.runWithMutationSource(
6530
+ {
6531
+ kind: "part",
6532
+ system: this.activeSystem,
6533
+ part: partKey
6534
+ },
6535
+ () => system.LOADERS[partKey](this.t)
6536
+ );
6519
6537
  this.loadedParts.add(partKey);
6520
6538
  const possiblePartBridges = system.BRIDGES.filter(
6521
6539
  (b) => b.needs.includes(partKey) && !this.bridgedParts.has(b.id) && b.needs.every((n) => this.loadedParts.has(n))
6522
6540
  );
6523
6541
  for (const bridge of possiblePartBridges) {
6524
- bridge.run(this.t);
6542
+ this.t.runWithMutationSource(
6543
+ {
6544
+ kind: "bridge",
6545
+ system: this.activeSystem,
6546
+ bridgeId: bridge.id,
6547
+ parts: [...bridge.needs]
6548
+ },
6549
+ () => bridge.run(this.t)
6550
+ );
6525
6551
  this.bridgedParts.add(bridge.id);
6526
6552
  }
6527
6553
  }
@@ -6558,7 +6584,15 @@ var ModuleManager = class {
6558
6584
  throw new Error(`Bridge ${bridgeKey} not found`);
6559
6585
  }
6560
6586
  if (!this.bridgedParts.has(bridge.id) && bridge.needs.every((n) => this.loadedParts.has(n))) {
6561
- bridge.run(this.t);
6587
+ this.t.runWithMutationSource(
6588
+ {
6589
+ kind: "bridge",
6590
+ system: this.activeSystem,
6591
+ bridgeId: bridge.id,
6592
+ parts: [...bridge.needs]
6593
+ },
6594
+ () => bridge.run(this.t)
6595
+ );
6562
6596
  this.bridgedParts.add(bridge.id);
6563
6597
  }
6564
6598
  }
@@ -6594,12 +6628,60 @@ var ModuleManager = class {
6594
6628
  };
6595
6629
 
6596
6630
  // src/core/tree-of-life.ts
6631
+ function mergeCorrespondenceMetadata(current, next) {
6632
+ if (!current) {
6633
+ return next ? { ...next } : void 0;
6634
+ }
6635
+ if (!next) {
6636
+ return { ...current };
6637
+ }
6638
+ return {
6639
+ ...current,
6640
+ ...next,
6641
+ tags: [.../* @__PURE__ */ new Set([...current.tags ?? [], ...next.tags ?? []])],
6642
+ attributes: {
6643
+ ...current.attributes ?? {},
6644
+ ...next.attributes ?? {}
6645
+ }
6646
+ };
6647
+ }
6648
+ function mergeCorrespondenceSources(current, next) {
6649
+ const seen = /* @__PURE__ */ new Set();
6650
+ const merged = [];
6651
+ for (const source of [...current, next]) {
6652
+ const key = JSON.stringify(source);
6653
+ if (seen.has(key)) {
6654
+ continue;
6655
+ }
6656
+ seen.add(key);
6657
+ merged.push({
6658
+ ...source,
6659
+ ...source.kind === "bridge" ? { parts: [...source.parts] } : {}
6660
+ });
6661
+ }
6662
+ return merged;
6663
+ }
6597
6664
  var TreeOfLife = class {
6598
6665
  constructor() {
6599
6666
  this.nodes = /* @__PURE__ */ new Map();
6600
6667
  this.adjacent = /* @__PURE__ */ new Map();
6668
+ this.edges = /* @__PURE__ */ new Map();
6669
+ this.mutationSources = [{ kind: "manual" }];
6601
6670
  this.modules = new ModuleManager(this);
6602
6671
  }
6672
+ getCurrentMutationSource() {
6673
+ return this.mutationSources[this.mutationSources.length - 1] ?? {
6674
+ kind: "manual"
6675
+ };
6676
+ }
6677
+ runWithMutationSource(source, fn) {
6678
+ this.mutationSources.push(source);
6679
+ try {
6680
+ return fn();
6681
+ } finally {
6682
+ this.mutationSources.pop();
6683
+ }
6684
+ }
6603
6685
  /**
6604
6686
  * Loads the tree of life system to be used
6605
6687
  * @param systemKey - the key of the system to load
@@ -6661,28 +6743,57 @@ var TreeOfLife = class {
6661
6743
  getNodes() {
6662
6744
  return [...this.nodes.values()];
6663
6745
  }
6746
+ getEdge(left, right) {
6747
+ return this.edges.get(makeCorrespondenceId(left, right));
6748
+ }
6749
+ getEdges(nodeId) {
6750
+ if (!nodeId) {
6751
+ return [...this.edges.values()];
6752
+ }
6753
+ return [...this.adjacent.get(nodeId) ?? []].map((relatedNodeId) => this.getEdge(nodeId, relatedNodeId)).filter((edge) => Boolean(edge));
6754
+ }
6664
6755
  /**
6665
6756
  * Links two nodes bi-directionally
6666
6757
  * @param firstNode - the id of the first node
6667
6758
  * @param secondNode - the id of the second node
6668
6759
  */
6669
- link(firstNode, secondNode) {
6760
+ link(firstNode, secondNode, options = {}) {
6670
6761
  if (!this.nodes.has(firstNode) || !this.nodes.has(secondNode)) {
6671
6762
  throw new Error("unknown node id");
6672
6763
  }
6673
6764
  if (firstNode === secondNode) {
6674
6765
  return;
6675
6766
  }
6676
- if (this.adjacent.has(firstNode) && this.adjacent.get(firstNode)?.has(secondNode)) {
6677
- return;
6678
- }
6767
+ const edgeId = makeCorrespondenceId(firstNode, secondNode);
6768
+ const source = options.source ?? this.getCurrentMutationSource();
6769
+ const existingEdge = this.edges.get(edgeId);
6679
6770
  const put = (leftNode, rightNode) => {
6680
6771
  const set = this.adjacent.get(leftNode) ?? /* @__PURE__ */ new Set();
6681
6772
  set.add(rightNode);
6682
6773
  this.adjacent.set(leftNode, set);
6683
6774
  };
6775
+ if (existingEdge) {
6776
+ this.edges.set(edgeId, {
6777
+ ...existingEdge,
6778
+ metadata: mergeCorrespondenceMetadata(
6779
+ existingEdge.metadata,
6780
+ options.metadata
6781
+ ),
6782
+ sources: mergeCorrespondenceSources(existingEdge.sources, source)
6783
+ });
6784
+ put(firstNode, secondNode);
6785
+ put(secondNode, firstNode);
6786
+ return;
6787
+ }
6684
6788
  put(firstNode, secondNode);
6685
6789
  put(secondNode, firstNode);
6790
+ this.edges.set(edgeId, {
6791
+ id: edgeId,
6792
+ left: firstNode,
6793
+ right: secondNode,
6794
+ metadata: mergeCorrespondenceMetadata(void 0, options.metadata),
6795
+ sources: mergeCorrespondenceSources([], source)
6796
+ });
6686
6797
  }
6687
6798
  /**
6688
6799
  * Gets the current node and all its direct relations, or, when filtered by node type, only the direct relations of that type.
@@ -6767,6 +6878,7 @@ var TreeOfLife = class {
6767
6878
  const neighbors = this.adjacent.get(id2);
6768
6879
  if (neighbors) {
6769
6880
  for (const neighbor of neighbors) {
6881
+ this.edges.delete(makeCorrespondenceId(id2, neighbor));
6770
6882
  const set = this.adjacent.get(neighbor);
6771
6883
  if (!set) {
6772
6884
  continue;
@@ -6982,6 +7094,7 @@ exports.WESTERN_ZODIAC_SIGNS = WESTERN_ZODIAC_SIGNS;
6982
7094
  exports.WesternAstrologyTypes = WesternAstrologyTypes;
6983
7095
  exports.createTree = createTree;
6984
7096
  exports.id = id;
7097
+ exports.makeCorrespondenceId = makeCorrespondenceId;
6985
7098
  exports.parseId = parseId;
6986
- //# sourceMappingURL=chunk-BJUCABP4.js.map
6987
- //# sourceMappingURL=chunk-BJUCABP4.js.map
7099
+ //# sourceMappingURL=chunk-3HYK4Q4B.js.map
7100
+ //# sourceMappingURL=chunk-3HYK4Q4B.js.map