ether-to-astro 1.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/.env.example +13 -0
- package/.github/pull_request_template.md +16 -0
- package/.github/workflows/release.yml +35 -0
- package/.github/workflows/test.yml +32 -0
- package/AGENTS.md +99 -0
- package/LICENSE +18 -0
- package/NOTICE.md +45 -0
- package/README.md +301 -0
- package/SETUP.md +70 -0
- package/TESTING_SUMMARY.md +238 -0
- package/TEST_SUITE_STATUS.md +218 -0
- package/biome.json +48 -0
- package/dist/astro-service.d.ts +98 -0
- package/dist/astro-service.js +496 -0
- package/dist/chart-types.d.ts +52 -0
- package/dist/chart-types.js +51 -0
- package/dist/charts.d.ts +125 -0
- package/dist/charts.js +324 -0
- package/dist/cli.d.ts +7 -0
- package/dist/cli.js +472 -0
- package/dist/constants.d.ts +81 -0
- package/dist/constants.js +76 -0
- package/dist/eclipses.d.ts +85 -0
- package/dist/eclipses.js +184 -0
- package/dist/ephemeris.d.ts +120 -0
- package/dist/ephemeris.js +379 -0
- package/dist/formatter.d.ts +2 -0
- package/dist/formatter.js +22 -0
- package/dist/houses.d.ts +82 -0
- package/dist/houses.js +169 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +150 -0
- package/dist/loader.d.ts +2 -0
- package/dist/loader.js +31 -0
- package/dist/logger.d.ts +25 -0
- package/dist/logger.js +73 -0
- package/dist/profile-store.d.ts +48 -0
- package/dist/profile-store.js +156 -0
- package/dist/riseset.d.ts +82 -0
- package/dist/riseset.js +185 -0
- package/dist/storage.d.ts +10 -0
- package/dist/storage.js +40 -0
- package/dist/time-utils.d.ts +68 -0
- package/dist/time-utils.js +136 -0
- package/dist/tool-registry.d.ts +35 -0
- package/dist/tool-registry.js +307 -0
- package/dist/tool-result.d.ts +175 -0
- package/dist/tool-result.js +188 -0
- package/dist/transits.d.ts +108 -0
- package/dist/transits.js +263 -0
- package/dist/types.d.ts +450 -0
- package/dist/types.js +161 -0
- package/example-usage.md +131 -0
- package/natal-chart.json +187 -0
- package/package.json +61 -0
- package/scripts/download-ephemeris.js +115 -0
- package/setup.sh +21 -0
- package/src/astro-service.ts +710 -0
- package/src/chart-types.ts +125 -0
- package/src/charts.ts +399 -0
- package/src/cli.ts +694 -0
- package/src/constants.ts +89 -0
- package/src/eclipses.ts +226 -0
- package/src/ephemeris.ts +437 -0
- package/src/formatter.ts +25 -0
- package/src/houses.ts +202 -0
- package/src/index.ts +170 -0
- package/src/loader.ts +36 -0
- package/src/logger.ts +104 -0
- package/src/profile-store.ts +285 -0
- package/src/riseset.ts +229 -0
- package/src/time-utils.ts +167 -0
- package/src/tool-registry.ts +357 -0
- package/src/tool-result.ts +283 -0
- package/src/transits.ts +352 -0
- package/src/types.ts +547 -0
- package/tests/README.md +173 -0
- package/tests/TESTING_STRATEGY.md +178 -0
- package/tests/fixtures/bowen-yang-chart.ts +69 -0
- package/tests/fixtures/calculate-expected.ts +81 -0
- package/tests/fixtures/expected-results.ts +117 -0
- package/tests/fixtures/generate-expected-simple.ts +94 -0
- package/tests/helpers/date-fixtures.ts +15 -0
- package/tests/helpers/ephem.ts +11 -0
- package/tests/helpers/temp.ts +9 -0
- package/tests/setup.ts +11 -0
- package/tests/unit/astro-service.test.ts +323 -0
- package/tests/unit/chart-types.test.ts +18 -0
- package/tests/unit/charts-errors.test.ts +42 -0
- package/tests/unit/charts.test.ts +157 -0
- package/tests/unit/cli-commands.test.ts +82 -0
- package/tests/unit/cli-profiles.test.ts +128 -0
- package/tests/unit/cli.test.ts +191 -0
- package/tests/unit/constants.test.ts +26 -0
- package/tests/unit/correctness-critical.test.ts +408 -0
- package/tests/unit/eclipses.test.ts +108 -0
- package/tests/unit/ephemeris.test.ts +213 -0
- package/tests/unit/error-handling.test.ts +116 -0
- package/tests/unit/formatter.test.ts +29 -0
- package/tests/unit/houses-errors.test.ts +27 -0
- package/tests/unit/houses-validation.test.ts +164 -0
- package/tests/unit/houses.test.ts +205 -0
- package/tests/unit/profile-store.test.ts +163 -0
- package/tests/unit/real-user-charts.test.ts +148 -0
- package/tests/unit/riseset.test.ts +106 -0
- package/tests/unit/solver-edges.test.ts +197 -0
- package/tests/unit/time-utils-temporal.test.ts +303 -0
- package/tests/unit/time-utils.test.ts +173 -0
- package/tests/unit/tool-registry.test.ts +222 -0
- package/tests/unit/tool-result.test.ts +45 -0
- package/tests/unit/transit-correctness.test.ts +78 -0
- package/tests/unit/transits.test.ts +238 -0
- package/tests/validation/README.md +32 -0
- package/tests/validation/adapters/astrolog.ts +306 -0
- package/tests/validation/adapters/internal.ts +184 -0
- package/tests/validation/compare/eclipses.ts +47 -0
- package/tests/validation/compare/houses.ts +76 -0
- package/tests/validation/compare/positions.ts +104 -0
- package/tests/validation/compare/riseSet.ts +48 -0
- package/tests/validation/compare/roots.ts +90 -0
- package/tests/validation/compare/transits.ts +69 -0
- package/tests/validation/fixtures/astrolog-parity/core.ts +194 -0
- package/tests/validation/fixtures/eclipses/core.ts +14 -0
- package/tests/validation/fixtures/houses/core.ts +47 -0
- package/tests/validation/fixtures/positions/core.ts +159 -0
- package/tests/validation/fixtures/rise-set/core.ts +20 -0
- package/tests/validation/fixtures/roots/core.ts +47 -0
- package/tests/validation/fixtures/transits/core.ts +61 -0
- package/tests/validation/fixtures/transits/dst.ts +21 -0
- package/tests/validation/oracle.spec.ts +129 -0
- package/tests/validation/utils/denseRootOracle.ts +269 -0
- package/tests/validation/utils/fixtureTypes.ts +146 -0
- package/tests/validation/utils/report.ts +60 -0
- package/tests/validation/utils/tolerances.ts +23 -0
- package/tests/validation/validation.spec.ts +836 -0
- package/tools/color-picker.html +388 -0
- package/tsconfig.json +17 -0
- package/vitest.config.ts +31 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
export type HouseSystem = 'P' | 'K' | 'W' | 'E' | 'O' | 'R' | 'C' | 'A' | 'V' | 'X' | 'H' | 'T' | 'B';
|
|
2
|
+
export type SolarEclipseType = 'partial' | 'annular' | 'total' | 'annular-total';
|
|
3
|
+
export type LunarEclipseType = 'penumbral' | 'partial' | 'total';
|
|
4
|
+
export type PlanetName = 'Sun' | 'Moon' | 'Mercury' | 'Venus' | 'Mars' | 'Jupiter' | 'Saturn' | 'Uranus' | 'Neptune' | 'Pluto' | 'Chiron' | 'North Node (Mean)' | 'North Node (True)' | 'Ceres' | 'Pallas' | 'Juno' | 'Vesta';
|
|
5
|
+
/**
|
|
6
|
+
* Represents a complete natal birth chart with all necessary data for calculations
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* This is the core data structure for the MCP server. All calculations (transits,
|
|
10
|
+
* houses, charts) are based on this chart data.
|
|
11
|
+
*
|
|
12
|
+
* The julianDay field is calculated during set_natal_chart and should always be
|
|
13
|
+
* present for charts created in the current session.
|
|
14
|
+
*/
|
|
15
|
+
export interface NatalChart {
|
|
16
|
+
name: string;
|
|
17
|
+
/** Birth date and time in local timezone */
|
|
18
|
+
birthDate: {
|
|
19
|
+
/** Full year (e.g., 1990) */
|
|
20
|
+
year: number;
|
|
21
|
+
/** Month number (1-12) */
|
|
22
|
+
month: number;
|
|
23
|
+
/** Day of month (1-31) */
|
|
24
|
+
day: number;
|
|
25
|
+
/** Hour in 24-hour format (0-23) */
|
|
26
|
+
hour: number;
|
|
27
|
+
/** Minute (0-59) */
|
|
28
|
+
minute: number;
|
|
29
|
+
/** Optional seconds for precision */
|
|
30
|
+
second?: number;
|
|
31
|
+
};
|
|
32
|
+
/** Birth location coordinates and timezone */
|
|
33
|
+
location: {
|
|
34
|
+
/** Latitude in decimal degrees (-90 to 90, negative for South) */
|
|
35
|
+
latitude: number;
|
|
36
|
+
/** Longitude in decimal degrees (-180 to 180, negative for West) */
|
|
37
|
+
longitude: number;
|
|
38
|
+
/** IANA timezone identifier (e.g., 'America/New_York') */
|
|
39
|
+
timezone: string;
|
|
40
|
+
};
|
|
41
|
+
/** Optional pre-calculated planet positions (rarely used) */
|
|
42
|
+
planets?: PlanetPosition[];
|
|
43
|
+
/**
|
|
44
|
+
* Cached Julian Day for birth time (UTC)
|
|
45
|
+
* @remarks
|
|
46
|
+
* This is calculated during set_natal_chart and should always be present.
|
|
47
|
+
* Required for chart generation and transit calculations.
|
|
48
|
+
*/
|
|
49
|
+
julianDay?: number;
|
|
50
|
+
/**
|
|
51
|
+
* Preferred house system for calculations
|
|
52
|
+
* @default 'P' (Placidus)
|
|
53
|
+
* @remarks
|
|
54
|
+
* For polar latitudes (>66°), Whole Sign ('W') may be used as fallback.
|
|
55
|
+
*/
|
|
56
|
+
houseSystem?: HouseSystem;
|
|
57
|
+
/**
|
|
58
|
+
* UTC equivalent of birth time
|
|
59
|
+
* @remarks
|
|
60
|
+
* Calculated from local birth time using timezone conversion.
|
|
61
|
+
* Used for Julian Day calculation to avoid timezone bugs.
|
|
62
|
+
*/
|
|
63
|
+
utcDateTime?: {
|
|
64
|
+
/** UTC year */
|
|
65
|
+
year: number;
|
|
66
|
+
/** UTC month */
|
|
67
|
+
month: number;
|
|
68
|
+
/** UTC day */
|
|
69
|
+
day: number;
|
|
70
|
+
/** UTC hour */
|
|
71
|
+
hour: number;
|
|
72
|
+
/** UTC minute */
|
|
73
|
+
minute: number;
|
|
74
|
+
/** Optional UTC seconds */
|
|
75
|
+
second?: number;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Represents a planet's position at a specific time
|
|
80
|
+
*
|
|
81
|
+
* @remarks
|
|
82
|
+
* All angular measurements are in degrees. Longitude is along the ecliptic,
|
|
83
|
+
* latitude is celestial latitude (distance from ecliptic).
|
|
84
|
+
*/
|
|
85
|
+
export interface PlanetPosition {
|
|
86
|
+
/** Swiss Ephemeris planet ID */
|
|
87
|
+
planetId: number;
|
|
88
|
+
/** Planet name (e.g., 'Sun', 'Moon', 'Mercury') */
|
|
89
|
+
planet: PlanetName;
|
|
90
|
+
/**
|
|
91
|
+
* Ecliptic longitude in degrees (0-360)
|
|
92
|
+
* @remarks
|
|
93
|
+
* 0° Aries, 90° Cancer, 180° Libra, 270° Capricorn
|
|
94
|
+
*/
|
|
95
|
+
longitude: number;
|
|
96
|
+
/**
|
|
97
|
+
* Celestial latitude in degrees (-90 to 90)
|
|
98
|
+
* @remarks
|
|
99
|
+
* Positive is north of ecliptic, negative is south
|
|
100
|
+
*/
|
|
101
|
+
latitude: number;
|
|
102
|
+
/** Distance from Earth in AU (Astronomical Units) */
|
|
103
|
+
distance: number;
|
|
104
|
+
/**
|
|
105
|
+
* Daily motion in degrees per day
|
|
106
|
+
* @remarks
|
|
107
|
+
* Positive = direct motion, Negative = retrograde
|
|
108
|
+
*/
|
|
109
|
+
speed: number;
|
|
110
|
+
/** Zodiac sign the planet is in (e.g., 'Aries', 'Taurus') */
|
|
111
|
+
sign: string;
|
|
112
|
+
/** Degree within the sign (0-30) */
|
|
113
|
+
degree: number;
|
|
114
|
+
/**
|
|
115
|
+
* Whether the planet is in retrograde motion
|
|
116
|
+
* @remarks
|
|
117
|
+
* Retrograde means the planet appears to move backward from Earth's perspective
|
|
118
|
+
*/
|
|
119
|
+
isRetrograde: boolean;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Base interface for all transit data
|
|
123
|
+
*
|
|
124
|
+
* @remarks
|
|
125
|
+
* Contains the core transit information shared between internal Transit
|
|
126
|
+
* and serialized TransitData types.
|
|
127
|
+
*/
|
|
128
|
+
interface BaseTransit {
|
|
129
|
+
/** Planet currently transiting (moving) */
|
|
130
|
+
transitingPlanet: PlanetName;
|
|
131
|
+
/** Planet in the natal chart being aspected */
|
|
132
|
+
natalPlanet: PlanetName;
|
|
133
|
+
/** Type of aspect between the planets */
|
|
134
|
+
aspect: AspectType;
|
|
135
|
+
/**
|
|
136
|
+
* Angular distance from exact aspect in degrees
|
|
137
|
+
* @remarks
|
|
138
|
+
* Lower values indicate stronger aspects. 0° is exact.
|
|
139
|
+
*/
|
|
140
|
+
orb: number;
|
|
141
|
+
/**
|
|
142
|
+
* Whether the aspect is applying (getting stronger) or separating (weakening)
|
|
143
|
+
* @remarks
|
|
144
|
+
* true = applying (getting closer to exact)
|
|
145
|
+
* false = separating (moving away from exact)
|
|
146
|
+
*/
|
|
147
|
+
isApplying: boolean;
|
|
148
|
+
/** Status of exact time lookup for this transit */
|
|
149
|
+
exactTimeStatus?: 'within_preview' | 'outside_preview' | 'not_found' | 'unsupported_body';
|
|
150
|
+
/** Current longitude of transiting planet */
|
|
151
|
+
transitLongitude: number;
|
|
152
|
+
/** Longitude of natal planet at birth time */
|
|
153
|
+
natalLongitude: number;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Internal transit representation with Date object
|
|
157
|
+
*
|
|
158
|
+
* @remarks
|
|
159
|
+
* Used for calculations and internal storage. The exactTime is a Date object
|
|
160
|
+
* for precise time comparisons.
|
|
161
|
+
*/
|
|
162
|
+
export interface Transit extends BaseTransit {
|
|
163
|
+
/**
|
|
164
|
+
* Exact time when aspect becomes perfect (0° orb)
|
|
165
|
+
* @remarks
|
|
166
|
+
* May be undefined if aspect is not within orb or exact time not calculated
|
|
167
|
+
*/
|
|
168
|
+
exactTime?: Date;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Serialized transit representation for API responses
|
|
172
|
+
*
|
|
173
|
+
* @remarks
|
|
174
|
+
* Used when sending transit data to MCP clients. The exactTime is an ISO string
|
|
175
|
+
* for JSON serialization.
|
|
176
|
+
*/
|
|
177
|
+
export interface TransitData extends BaseTransit {
|
|
178
|
+
/**
|
|
179
|
+
* Exact time when aspect becomes perfect (0° orb) as ISO string
|
|
180
|
+
* @remarks
|
|
181
|
+
* May be undefined if aspect is not within orb or exact time not calculated
|
|
182
|
+
*/
|
|
183
|
+
exactTime?: string;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Response wrapper for transit data
|
|
187
|
+
*
|
|
188
|
+
* @remarks
|
|
189
|
+
* Contains all transits for a specific date along with metadata
|
|
190
|
+
* about the calculation context.
|
|
191
|
+
*/
|
|
192
|
+
export interface TransitResponse {
|
|
193
|
+
/** ISO date of the transit calculation (YYYY-MM-DD) */
|
|
194
|
+
date: string;
|
|
195
|
+
/** Timezone used for the calculation */
|
|
196
|
+
timezone: string;
|
|
197
|
+
/** Array of all active transits for the date */
|
|
198
|
+
transits: TransitData[];
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Response wrapper for planet position data
|
|
202
|
+
*
|
|
203
|
+
* @remarks
|
|
204
|
+
* Contains positions for all requested planets at a specific time.
|
|
205
|
+
*/
|
|
206
|
+
export interface PlanetPositionResponse {
|
|
207
|
+
/** ISO date of the position calculation (YYYY-MM-DD) */
|
|
208
|
+
date: string;
|
|
209
|
+
/** Timezone used for the calculation */
|
|
210
|
+
timezone: string;
|
|
211
|
+
/** Array of planet positions */
|
|
212
|
+
positions: PlanetPosition[];
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Types of astrological aspects
|
|
216
|
+
*
|
|
217
|
+
* @remarks
|
|
218
|
+
* Aspects are angular relationships between planets that indicate
|
|
219
|
+
* specific types of interactions and energies.
|
|
220
|
+
*/
|
|
221
|
+
export type AspectType = 'conjunction' | 'opposition' | 'square' | 'trine' | 'sextile';
|
|
222
|
+
/**
|
|
223
|
+
* Aspect definitions with angles and default orbs
|
|
224
|
+
*
|
|
225
|
+
* @remarks
|
|
226
|
+
* Each aspect has a specific angular relationship and an orb (tolerance).
|
|
227
|
+
* The orb determines how far from exact the aspect can still be considered active.
|
|
228
|
+
*/
|
|
229
|
+
export declare const ASPECTS: Array<{
|
|
230
|
+
name: AspectType;
|
|
231
|
+
angle: number;
|
|
232
|
+
orb: number;
|
|
233
|
+
}>;
|
|
234
|
+
/**
|
|
235
|
+
* Swiss Ephemeris planet IDs
|
|
236
|
+
*
|
|
237
|
+
* @remarks
|
|
238
|
+
* These are the numeric IDs used by the Swiss Ephemeris library.
|
|
239
|
+
* The `as const` assertion ensures type safety when referencing planets.
|
|
240
|
+
*/
|
|
241
|
+
export declare const PLANETS: {
|
|
242
|
+
/** Sun */
|
|
243
|
+
readonly SUN: 0;
|
|
244
|
+
/** Moon */
|
|
245
|
+
readonly MOON: 1;
|
|
246
|
+
/** Mercury */
|
|
247
|
+
readonly MERCURY: 2;
|
|
248
|
+
/** Venus */
|
|
249
|
+
readonly VENUS: 3;
|
|
250
|
+
/** Mars */
|
|
251
|
+
readonly MARS: 4;
|
|
252
|
+
/** Jupiter */
|
|
253
|
+
readonly JUPITER: 5;
|
|
254
|
+
/** Saturn */
|
|
255
|
+
readonly SATURN: 6;
|
|
256
|
+
/** Uranus */
|
|
257
|
+
readonly URANUS: 7;
|
|
258
|
+
/** Neptune */
|
|
259
|
+
readonly NEPTUNE: 8;
|
|
260
|
+
/** Pluto */
|
|
261
|
+
readonly PLUTO: 9;
|
|
262
|
+
/** Mean North Node (average position) */
|
|
263
|
+
readonly MEAN_NODE: 10;
|
|
264
|
+
/** True North Node (actual position) */
|
|
265
|
+
readonly TRUE_NODE: 11;
|
|
266
|
+
/** Chiron (comet/centaur) */
|
|
267
|
+
readonly CHIRON: 15;
|
|
268
|
+
/** Ceres (dwarf planet/asteroid) */
|
|
269
|
+
readonly CERES: 17;
|
|
270
|
+
/** Pallas (asteroid) */
|
|
271
|
+
readonly PALLAS: 18;
|
|
272
|
+
/** Juno (asteroid) */
|
|
273
|
+
readonly JUNO: 19;
|
|
274
|
+
/** Vesta (asteroid) */
|
|
275
|
+
readonly VESTA: 20;
|
|
276
|
+
};
|
|
277
|
+
/**
|
|
278
|
+
* Type derived from PLANETS constants
|
|
279
|
+
*
|
|
280
|
+
* @remarks
|
|
281
|
+
* Ensures type safety when working with planet IDs.
|
|
282
|
+
* Only values present in PLANETS are valid PlanetId values.
|
|
283
|
+
*/
|
|
284
|
+
export type PlanetId = (typeof PLANETS)[keyof typeof PLANETS];
|
|
285
|
+
/**
|
|
286
|
+
* Mapping from planet IDs to human-readable names
|
|
287
|
+
*
|
|
288
|
+
* @remarks
|
|
289
|
+
* Used for display purposes and converting between numeric IDs
|
|
290
|
+
* and string names. Index signature allows number-based lookup.
|
|
291
|
+
*/
|
|
292
|
+
export declare const PLANET_NAMES: {
|
|
293
|
+
[key: number]: PlanetName;
|
|
294
|
+
};
|
|
295
|
+
/**
|
|
296
|
+
* Personal planets (inner planets)
|
|
297
|
+
*
|
|
298
|
+
* @remarks
|
|
299
|
+
* These planets move quickly and represent personal, day-to-day concerns:
|
|
300
|
+
* - Sun: Identity, vitality
|
|
301
|
+
* - Moon: Emotions, instincts
|
|
302
|
+
* - Mercury: Communication, thinking
|
|
303
|
+
* - Venus: Values, relationships
|
|
304
|
+
* - Mars: Action, desire
|
|
305
|
+
*/
|
|
306
|
+
export declare const PERSONAL_PLANETS: (0 | 1 | 2 | 3 | 4)[];
|
|
307
|
+
/**
|
|
308
|
+
* Slow-moving planets (Jupiter through Pluto)
|
|
309
|
+
*
|
|
310
|
+
* @remarks
|
|
311
|
+
* These planets move slowly and represent generational, societal themes.
|
|
312
|
+
* Note: Includes Jupiter and Saturn (social planets) plus the true outer planets.
|
|
313
|
+
*/
|
|
314
|
+
export declare const OUTER_PLANETS: (8 | 6 | 5 | 7 | 9)[];
|
|
315
|
+
/**
|
|
316
|
+
* Major asteroids
|
|
317
|
+
*
|
|
318
|
+
* @remarks
|
|
319
|
+
* The four main asteroids used in astrology, representing feminine archetypes:
|
|
320
|
+
* - Ceres: Nurturing, agriculture
|
|
321
|
+
* - Pallas: Wisdom, strategy
|
|
322
|
+
* - Juno: Partnership, commitment
|
|
323
|
+
* - Vesta: Devotion, service
|
|
324
|
+
*/
|
|
325
|
+
export declare const ASTEROIDS: (18 | 15 | 17 | 19 | 20)[];
|
|
326
|
+
/**
|
|
327
|
+
* Lunar nodes
|
|
328
|
+
*
|
|
329
|
+
* @remarks
|
|
330
|
+
* The North and South Nodes represent points where the Moon's orbit
|
|
331
|
+
* crosses the ecliptic. They indicate life path and evolutionary direction.
|
|
332
|
+
*/
|
|
333
|
+
export declare const NODES: (10 | 11)[];
|
|
334
|
+
/**
|
|
335
|
+
* Zodiac signs in order
|
|
336
|
+
*
|
|
337
|
+
* @remarks
|
|
338
|
+
* The 12 signs of the tropical zodiac, each spanning 30° of the ecliptic.
|
|
339
|
+
* Used for determining which sign a planet is in.
|
|
340
|
+
*/
|
|
341
|
+
export declare const ZODIAC_SIGNS: string[];
|
|
342
|
+
/**
|
|
343
|
+
* House cusps in Swiss Ephemeris 1-based format
|
|
344
|
+
*
|
|
345
|
+
* @remarks
|
|
346
|
+
* - Index 0: Unused (by convention)
|
|
347
|
+
* - Index 1-12: Houses 1-12
|
|
348
|
+
* - Length: 13
|
|
349
|
+
*
|
|
350
|
+
* The Swiss Ephemeris uses 1-based indexing for house cusps,
|
|
351
|
+
* with index 0 unused by convention.
|
|
352
|
+
*/
|
|
353
|
+
export type HouseCusps = number[];
|
|
354
|
+
/**
|
|
355
|
+
* Complete house system calculation results
|
|
356
|
+
*
|
|
357
|
+
* @remarks
|
|
358
|
+
* Contains the angles (Ascendant, MC) and all house cusps for a given
|
|
359
|
+
* time and location. The cusps array follows Swiss Ephemeris 1-based format.
|
|
360
|
+
*/
|
|
361
|
+
export interface HouseData {
|
|
362
|
+
/**
|
|
363
|
+
* Ascendant angle in degrees (0-360)
|
|
364
|
+
* @remarks
|
|
365
|
+
* The point where the ecliptic crosses the eastern horizon.
|
|
366
|
+
* Represents the self, identity, and personal appearance.
|
|
367
|
+
*/
|
|
368
|
+
ascendant: number;
|
|
369
|
+
/**
|
|
370
|
+
* Midheaven (Medium Coeli) angle in degrees (0-360)
|
|
371
|
+
* @remarks
|
|
372
|
+
* The highest point in the sky at the time of birth.
|
|
373
|
+
* Represents career, public life, and reputation.
|
|
374
|
+
*/
|
|
375
|
+
mc: number;
|
|
376
|
+
/**
|
|
377
|
+
* House cusps in Swiss 1-based format
|
|
378
|
+
* @remarks
|
|
379
|
+
* cusps[1] = House 1, cusps[2] = House 2, ..., cusps[12] = House 12
|
|
380
|
+
* cusps[0] is unused by convention
|
|
381
|
+
*/
|
|
382
|
+
cusps: HouseCusps;
|
|
383
|
+
/**
|
|
384
|
+
* The house system actually used for calculation
|
|
385
|
+
* @remarks
|
|
386
|
+
* May differ from requested system if fallback was used
|
|
387
|
+
* (e.g., Whole Sign for polar latitudes)
|
|
388
|
+
*/
|
|
389
|
+
system: HouseSystem;
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Rise, set, and meridian transit times for a celestial body
|
|
393
|
+
*
|
|
394
|
+
* @remarks
|
|
395
|
+
* Contains the times when a planet rises above the horizon, sets below it,
|
|
396
|
+
* and crosses the upper and lower meridians. Times may be undefined for
|
|
397
|
+
* circumpolar objects (never rise/set) or at extreme latitudes.
|
|
398
|
+
*/
|
|
399
|
+
export interface RiseSetTime {
|
|
400
|
+
/** Planet name */
|
|
401
|
+
planet: string;
|
|
402
|
+
/**
|
|
403
|
+
* Time when planet rises above eastern horizon
|
|
404
|
+
* @remarks
|
|
405
|
+
* Undefined for circumpolar objects (always visible)
|
|
406
|
+
*/
|
|
407
|
+
rise?: Date;
|
|
408
|
+
/**
|
|
409
|
+
* Time when planet sets below western horizon
|
|
410
|
+
* @remarks
|
|
411
|
+
* Undefined for circumpolar objects (always visible)
|
|
412
|
+
*/
|
|
413
|
+
set?: Date;
|
|
414
|
+
/**
|
|
415
|
+
* Time when planet crosses upper meridian (highest point)
|
|
416
|
+
* @remarks
|
|
417
|
+
* This is the planet's "culmination" or "upper transit"
|
|
418
|
+
*/
|
|
419
|
+
upperMeridianTransit?: Date;
|
|
420
|
+
/**
|
|
421
|
+
* Time when planet crosses lower meridian (lowest point)
|
|
422
|
+
* @remarks
|
|
423
|
+
* This is the planet's "lower transit" or "anti-culmination"
|
|
424
|
+
*/
|
|
425
|
+
lowerMeridianTransit?: Date;
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Basic eclipse information
|
|
429
|
+
*
|
|
430
|
+
* @remarks
|
|
431
|
+
* TODO: This should be replaced with a discriminated union for solar vs lunar eclipses
|
|
432
|
+
* with richer phase timing data. See planning documents for details.
|
|
433
|
+
*/
|
|
434
|
+
export interface EclipseInfo {
|
|
435
|
+
/** Type of eclipse: 'solar' or 'lunar' */
|
|
436
|
+
type: 'solar' | 'lunar';
|
|
437
|
+
/** Date of the eclipse */
|
|
438
|
+
date: Date;
|
|
439
|
+
/**
|
|
440
|
+
* Eclipse classification
|
|
441
|
+
* @remarks
|
|
442
|
+
* TODO: Should use constrained union types:
|
|
443
|
+
* - Solar: 'partial' | 'annular' | 'total' | 'annular-total'
|
|
444
|
+
* - Lunar: 'penumbral' | 'partial' | 'total'
|
|
445
|
+
*/
|
|
446
|
+
eclipseType: string;
|
|
447
|
+
/** Time of maximum eclipse */
|
|
448
|
+
maxTime: Date;
|
|
449
|
+
}
|
|
450
|
+
export {};
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Aspect definitions with angles and default orbs
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Each aspect has a specific angular relationship and an orb (tolerance).
|
|
6
|
+
* The orb determines how far from exact the aspect can still be considered active.
|
|
7
|
+
*/
|
|
8
|
+
export const ASPECTS = [
|
|
9
|
+
{ name: 'conjunction', angle: 0, orb: 8 },
|
|
10
|
+
{ name: 'opposition', angle: 180, orb: 8 },
|
|
11
|
+
{ name: 'square', angle: 90, orb: 7 },
|
|
12
|
+
{ name: 'trine', angle: 120, orb: 7 },
|
|
13
|
+
{ name: 'sextile', angle: 60, orb: 6 },
|
|
14
|
+
];
|
|
15
|
+
/**
|
|
16
|
+
* Swiss Ephemeris planet IDs
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* These are the numeric IDs used by the Swiss Ephemeris library.
|
|
20
|
+
* The `as const` assertion ensures type safety when referencing planets.
|
|
21
|
+
*/
|
|
22
|
+
export const PLANETS = {
|
|
23
|
+
/** Sun */
|
|
24
|
+
SUN: 0,
|
|
25
|
+
/** Moon */
|
|
26
|
+
MOON: 1,
|
|
27
|
+
/** Mercury */
|
|
28
|
+
MERCURY: 2,
|
|
29
|
+
/** Venus */
|
|
30
|
+
VENUS: 3,
|
|
31
|
+
/** Mars */
|
|
32
|
+
MARS: 4,
|
|
33
|
+
/** Jupiter */
|
|
34
|
+
JUPITER: 5,
|
|
35
|
+
/** Saturn */
|
|
36
|
+
SATURN: 6,
|
|
37
|
+
/** Uranus */
|
|
38
|
+
URANUS: 7,
|
|
39
|
+
/** Neptune */
|
|
40
|
+
NEPTUNE: 8,
|
|
41
|
+
/** Pluto */
|
|
42
|
+
PLUTO: 9,
|
|
43
|
+
/** Mean North Node (average position) */
|
|
44
|
+
MEAN_NODE: 10,
|
|
45
|
+
/** True North Node (actual position) */
|
|
46
|
+
TRUE_NODE: 11,
|
|
47
|
+
/** Chiron (comet/centaur) */
|
|
48
|
+
CHIRON: 15,
|
|
49
|
+
/** Ceres (dwarf planet/asteroid) */
|
|
50
|
+
CERES: 17,
|
|
51
|
+
/** Pallas (asteroid) */
|
|
52
|
+
PALLAS: 18,
|
|
53
|
+
/** Juno (asteroid) */
|
|
54
|
+
JUNO: 19,
|
|
55
|
+
/** Vesta (asteroid) */
|
|
56
|
+
VESTA: 20,
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Mapping from planet IDs to human-readable names
|
|
60
|
+
*
|
|
61
|
+
* @remarks
|
|
62
|
+
* Used for display purposes and converting between numeric IDs
|
|
63
|
+
* and string names. Index signature allows number-based lookup.
|
|
64
|
+
*/
|
|
65
|
+
export const PLANET_NAMES = {
|
|
66
|
+
0: 'Sun',
|
|
67
|
+
1: 'Moon',
|
|
68
|
+
2: 'Mercury',
|
|
69
|
+
3: 'Venus',
|
|
70
|
+
4: 'Mars',
|
|
71
|
+
5: 'Jupiter',
|
|
72
|
+
6: 'Saturn',
|
|
73
|
+
7: 'Uranus',
|
|
74
|
+
8: 'Neptune',
|
|
75
|
+
9: 'Pluto',
|
|
76
|
+
10: 'North Node (Mean)',
|
|
77
|
+
11: 'North Node (True)',
|
|
78
|
+
15: 'Chiron',
|
|
79
|
+
17: 'Ceres',
|
|
80
|
+
18: 'Pallas',
|
|
81
|
+
19: 'Juno',
|
|
82
|
+
20: 'Vesta',
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Personal planets (inner planets)
|
|
86
|
+
*
|
|
87
|
+
* @remarks
|
|
88
|
+
* These planets move quickly and represent personal, day-to-day concerns:
|
|
89
|
+
* - Sun: Identity, vitality
|
|
90
|
+
* - Moon: Emotions, instincts
|
|
91
|
+
* - Mercury: Communication, thinking
|
|
92
|
+
* - Venus: Values, relationships
|
|
93
|
+
* - Mars: Action, desire
|
|
94
|
+
*/
|
|
95
|
+
export const PERSONAL_PLANETS = [
|
|
96
|
+
PLANETS.SUN,
|
|
97
|
+
PLANETS.MOON,
|
|
98
|
+
PLANETS.MERCURY,
|
|
99
|
+
PLANETS.VENUS,
|
|
100
|
+
PLANETS.MARS,
|
|
101
|
+
];
|
|
102
|
+
/**
|
|
103
|
+
* Slow-moving planets (Jupiter through Pluto)
|
|
104
|
+
*
|
|
105
|
+
* @remarks
|
|
106
|
+
* These planets move slowly and represent generational, societal themes.
|
|
107
|
+
* Note: Includes Jupiter and Saturn (social planets) plus the true outer planets.
|
|
108
|
+
*/
|
|
109
|
+
export const OUTER_PLANETS = [
|
|
110
|
+
PLANETS.JUPITER,
|
|
111
|
+
PLANETS.SATURN,
|
|
112
|
+
PLANETS.URANUS,
|
|
113
|
+
PLANETS.NEPTUNE,
|
|
114
|
+
PLANETS.PLUTO,
|
|
115
|
+
];
|
|
116
|
+
/**
|
|
117
|
+
* Major asteroids
|
|
118
|
+
*
|
|
119
|
+
* @remarks
|
|
120
|
+
* The four main asteroids used in astrology, representing feminine archetypes:
|
|
121
|
+
* - Ceres: Nurturing, agriculture
|
|
122
|
+
* - Pallas: Wisdom, strategy
|
|
123
|
+
* - Juno: Partnership, commitment
|
|
124
|
+
* - Vesta: Devotion, service
|
|
125
|
+
*/
|
|
126
|
+
export const ASTEROIDS = [
|
|
127
|
+
PLANETS.CHIRON,
|
|
128
|
+
PLANETS.CERES,
|
|
129
|
+
PLANETS.PALLAS,
|
|
130
|
+
PLANETS.JUNO,
|
|
131
|
+
PLANETS.VESTA,
|
|
132
|
+
];
|
|
133
|
+
/**
|
|
134
|
+
* Lunar nodes
|
|
135
|
+
*
|
|
136
|
+
* @remarks
|
|
137
|
+
* The North and South Nodes represent points where the Moon's orbit
|
|
138
|
+
* crosses the ecliptic. They indicate life path and evolutionary direction.
|
|
139
|
+
*/
|
|
140
|
+
export const NODES = [PLANETS.MEAN_NODE, PLANETS.TRUE_NODE];
|
|
141
|
+
/**
|
|
142
|
+
* Zodiac signs in order
|
|
143
|
+
*
|
|
144
|
+
* @remarks
|
|
145
|
+
* The 12 signs of the tropical zodiac, each spanning 30° of the ecliptic.
|
|
146
|
+
* Used for determining which sign a planet is in.
|
|
147
|
+
*/
|
|
148
|
+
export const ZODIAC_SIGNS = [
|
|
149
|
+
'Aries',
|
|
150
|
+
'Taurus',
|
|
151
|
+
'Gemini',
|
|
152
|
+
'Cancer',
|
|
153
|
+
'Leo',
|
|
154
|
+
'Virgo',
|
|
155
|
+
'Libra',
|
|
156
|
+
'Scorpio',
|
|
157
|
+
'Sagittarius',
|
|
158
|
+
'Capricorn',
|
|
159
|
+
'Aquarius',
|
|
160
|
+
'Pisces',
|
|
161
|
+
];
|