kaabalah 5.6.0 → 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.
package/README.md CHANGED
@@ -97,6 +97,38 @@ const papusImageUrl = resolveTarotImageUrl(
97
97
 
98
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
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
+
100
132
  ## CLI
101
133
 
102
134
  Kaabalah includes a command-line interface for quick calculations without writing code.
@@ -210,6 +242,21 @@ npm run dev
210
242
 
211
243
  The astrological calculations use the Swiss Ephemeris library, compiled to WebAssembly for use in both Node.js and browser environments.
212
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
+
213
260
  ## License
214
261
 
215
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
@@ -479,6 +479,169 @@ var DEFAULT_FLAGS = 2 /* SWISS_EPH */ | 256 /* SPEED */;
479
479
  var REQUIRED_EPHE_FILES = ["seas_18.se1", "semo_18.se1", "sepl_18.se1"];
480
480
  var NODE_EPHE_MOUNT_POINT = "/ephefs";
481
481
  var NODE_EPHE_MEMFS_PATH = "/ephemem";
482
+ function emitRuntimeNotice(message) {
483
+ if (typeof process !== "undefined" && process.stderr && typeof process.stderr.write === "function") {
484
+ process.stderr.write(`${message}
485
+ `);
486
+ return;
487
+ }
488
+ console.info(message);
489
+ }
490
+ var SWISS_EPH_RUNTIME_WASM_ENV_KEYS = [
491
+ "KAABALAH_SWISSEPH_WASM_PATH",
492
+ "KAABALAH_WASM_PATH"
493
+ ];
494
+ var SWISS_EPH_RUNTIME_EPHE_ENV_KEYS = [
495
+ "KAABALAH_SWISSEPH_EPHE_PATH",
496
+ "KAABALAH_EPHE_PATH"
497
+ ];
498
+ function getRuntimeEnv(env) {
499
+ if (env) {
500
+ return env;
501
+ }
502
+ if (typeof process !== "undefined" && process.env) {
503
+ return process.env;
504
+ }
505
+ return {};
506
+ }
507
+ function firstDefinedEnvValue(env, keys) {
508
+ for (const key of keys) {
509
+ const value = env[key];
510
+ if (typeof value === "string" && value.length > 0) {
511
+ return value;
512
+ }
513
+ }
514
+ return void 0;
515
+ }
516
+ function getBundledNodeSwissEphAssets(options) {
517
+ if (options.bundledNodeWasmPath && options.bundledNodeEphePath) {
518
+ return {
519
+ wasmPaths: [options.bundledNodeWasmPath],
520
+ ephePaths: [options.bundledNodeEphePath]
521
+ };
522
+ }
523
+ const resolvePath = options.nodePathResolve ?? ((...paths) => __require("path").resolve(...paths));
524
+ return {
525
+ wasmPaths: [
526
+ options.bundledNodeWasmPath,
527
+ resolvePath(__dirname, swisseph_node_default),
528
+ resolvePath(__dirname, "../../wasm/build/swisseph.node.wasm"),
529
+ resolvePath(__dirname, "../wasm/build/swisseph.node.wasm")
530
+ ].filter((value) => typeof value === "string"),
531
+ ephePaths: [
532
+ options.bundledNodeEphePath,
533
+ resolvePath(__dirname, "../../ephe"),
534
+ resolvePath(__dirname, "../ephe")
535
+ ].filter((value) => typeof value === "string")
536
+ };
537
+ }
538
+ function getBundledBrowserSwissEphAssets(options) {
539
+ return {
540
+ wasmPath: options.bundledBrowserWasmPath ?? swisseph_web_default,
541
+ ephePath: options.bundledBrowserEphePath ?? "../ephe"
542
+ };
543
+ }
544
+ function formatCandidatePaths(paths) {
545
+ return paths.length > 0 ? paths.join(", ") : "(none)";
546
+ }
547
+ function resolveBundledRuntimeAssetPath(label, bundledPaths, existsSync) {
548
+ for (const bundledPath of bundledPaths) {
549
+ if (existsSync(bundledPath)) {
550
+ return {
551
+ path: bundledPath,
552
+ source: "bundled"
553
+ };
554
+ }
555
+ }
556
+ throw new Error(
557
+ `Unable to resolve Swiss Ephemeris ${label}. Bundled paths checked: ${formatCandidatePaths(
558
+ bundledPaths
559
+ )}.`
560
+ );
561
+ }
562
+ function resolveRuntimeAssetPath(label, explicitPath, envPath, candidatePaths, bundledPaths, existsSync) {
563
+ if (explicitPath) {
564
+ if (!existsSync(explicitPath)) {
565
+ throw new Error(
566
+ `Swiss Ephemeris ${label} override does not exist: "${explicitPath}".`
567
+ );
568
+ }
569
+ return {
570
+ path: explicitPath,
571
+ source: "explicit"
572
+ };
573
+ }
574
+ if (envPath) {
575
+ if (!existsSync(envPath)) {
576
+ throw new Error(
577
+ `Swiss Ephemeris ${label} from environment does not exist: "${envPath}".`
578
+ );
579
+ }
580
+ return {
581
+ path: envPath,
582
+ source: "env"
583
+ };
584
+ }
585
+ for (const candidatePath of candidatePaths) {
586
+ if (existsSync(candidatePath)) {
587
+ return {
588
+ path: candidatePath,
589
+ source: "candidate"
590
+ };
591
+ }
592
+ }
593
+ try {
594
+ return resolveBundledRuntimeAssetPath(label, bundledPaths, existsSync);
595
+ } catch (error) {
596
+ throw new Error(
597
+ `Unable to resolve Swiss Ephemeris ${label}. Checked candidate paths: ${formatCandidatePaths(
598
+ candidatePaths
599
+ )}. ${toError(error).message}`
600
+ );
601
+ }
602
+ }
603
+ function resolveSwissEphRuntimeAssetsInternal(options = {}) {
604
+ const isBrowser = options.isBrowser ?? typeof window !== "undefined";
605
+ if (isBrowser) {
606
+ const bundledAssets2 = getBundledBrowserSwissEphAssets(options);
607
+ return {
608
+ wasmPath: options.wasmPath ?? bundledAssets2.wasmPath,
609
+ ephePath: options.ephePath ?? bundledAssets2.ephePath,
610
+ wasmPathSource: options.wasmPath ? "explicit" : "bundled",
611
+ ephePathSource: options.ephePath ? "explicit" : "bundled"
612
+ };
613
+ }
614
+ const env = getRuntimeEnv(options.env);
615
+ const existsSync = options.existsSync ?? ((path) => __require("fs").existsSync(path));
616
+ const bundledAssets = getBundledNodeSwissEphAssets(options);
617
+ const envWasmPath = firstDefinedEnvValue(env, SWISS_EPH_RUNTIME_WASM_ENV_KEYS);
618
+ const envEphePath = firstDefinedEnvValue(env, SWISS_EPH_RUNTIME_EPHE_ENV_KEYS);
619
+ const resolvedWasm = resolveRuntimeAssetPath(
620
+ "wasmPath",
621
+ options.wasmPath,
622
+ envWasmPath,
623
+ options.wasmPathCandidates ?? [],
624
+ bundledAssets.wasmPaths,
625
+ existsSync
626
+ );
627
+ const resolvedEphe = resolveRuntimeAssetPath(
628
+ "ephePath",
629
+ options.ephePath,
630
+ envEphePath,
631
+ options.ephePathCandidates ?? [],
632
+ bundledAssets.ephePaths,
633
+ existsSync
634
+ );
635
+ return {
636
+ wasmPath: resolvedWasm.path,
637
+ ephePath: resolvedEphe.path,
638
+ wasmPathSource: resolvedWasm.source,
639
+ ephePathSource: resolvedEphe.source
640
+ };
641
+ }
642
+ function resolveSwissEphRuntimeAssets(options = {}) {
643
+ return resolveSwissEphRuntimeAssetsInternal(options);
644
+ }
482
645
  function normalizeVirtualPath(path) {
483
646
  if (path === "/") {
484
647
  return path;
@@ -652,15 +815,17 @@ async function getSwissEph(options = {}) {
652
815
  }
653
816
  try {
654
817
  const isBrowser = typeof window !== "undefined";
655
- const wasmUrl = isBrowser ? swisseph_web_default : swisseph_node_default;
656
- const finalWasmPath = options.wasmPath || (isBrowser ? wasmUrl : __require("path").resolve(__dirname, wasmUrl));
818
+ const runtimeAssets = resolveSwissEphRuntimeAssets({
819
+ wasmPath: options.wasmPath,
820
+ ephePath: options.ephePath
821
+ });
822
+ const finalWasmPath = runtimeAssets.wasmPath;
657
823
  const moduleFactory = isBrowser ? (await import('./swisseph.web-TSFJI7DQ.mjs')).default : (await import('./swisseph.node-6H4ISR7M.mjs')).default;
658
824
  const module = await moduleFactory({
659
825
  locateFile: () => finalWasmPath
660
826
  });
661
827
  const instance = new SwissEph(module);
662
- const defaultEphePath = isBrowser ? "../ephe" : __require("path").resolve(__dirname, "../ephe");
663
- const finalEphePath = options.ephePath || defaultEphePath;
828
+ const finalEphePath = runtimeAssets.ephePath;
664
829
  if (isBrowser) {
665
830
  const epheFsPath = "/ephe";
666
831
  try {
@@ -688,16 +853,16 @@ async function getSwissEph(options = {}) {
688
853
  `Failed to materialize browser ephemeris files at "${epheFsPath}". Missing: ${browserCheck.missingFiles.join(", ")}.`
689
854
  );
690
855
  }
691
- console.info(`Setting ephemeris path to: ${epheFsPath}`);
856
+ emitRuntimeNotice(`Setting ephemeris path to: ${epheFsPath}`);
692
857
  instance.setEphemerisPath(epheFsPath);
693
858
  } else {
694
859
  const resolution = resolveNodeEphemerisPath(module, finalEphePath);
695
860
  if (resolution.strategy === "nodefs-mount") {
696
- console.info(`Setting ephemeris path to: ${resolution.path} (mounted from ${finalEphePath})`);
861
+ emitRuntimeNotice(`Setting ephemeris path to: ${resolution.path} (mounted from ${finalEphePath})`);
697
862
  } else if (resolution.strategy === "memfs-copy") {
698
- console.info(`Setting ephemeris path to: ${resolution.path} (copied from ${finalEphePath})`);
863
+ emitRuntimeNotice(`Setting ephemeris path to: ${resolution.path} (copied from ${finalEphePath})`);
699
864
  } else {
700
- console.info(`Setting ephemeris path to: ${resolution.path}`);
865
+ emitRuntimeNotice(`Setting ephemeris path to: ${resolution.path}`);
701
866
  }
702
867
  instance.setEphemerisPath(resolution.path);
703
868
  }
@@ -1985,6 +2150,6 @@ async function getSolarReturnChart(options) {
1985
2150
  };
1986
2151
  }
1987
2152
 
1988
- 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 };
1989
- //# sourceMappingURL=chunk-T6Y4DLMA.mjs.map
1990
- //# sourceMappingURL=chunk-T6Y4DLMA.mjs.map
2153
+ 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 };
2154
+ //# sourceMappingURL=chunk-5NCI7UPZ.mjs.map
2155
+ //# sourceMappingURL=chunk-5NCI7UPZ.mjs.map