@zodiacs/engine 1.0.0 → 2.0.0-rc.2

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 (70) hide show
  1. package/CHANGELOG.md +1244 -0
  2. package/LICENSING.md +172 -27
  3. package/NOTICE +78 -12
  4. package/README.md +344 -59
  5. package/dist/{api-WbxJ4Wj-.d.ts → api-C_SVd9BJ.d.ts} +39 -3
  6. package/dist/{ayanamsa--YQ46fET.d.ts → ayanamsa-Clgkekhh.d.ts} +2 -1
  7. package/dist/calc.d.ts +91 -4
  8. package/dist/calc.js +368 -126
  9. package/dist/chunk-CV53HA7R.js +87 -0
  10. package/dist/chunk-EEW7746S.js +83 -0
  11. package/dist/{chunk-WS3TDSP3.js → chunk-FVGA776A.js} +7 -3
  12. package/dist/chunk-HNVGWN3S.js +852 -0
  13. package/dist/chunk-I3L4POY7.js +18 -0
  14. package/dist/{chunk-FTX3JDJA.js → chunk-IXFUYEUF.js} +65 -29
  15. package/dist/{chunk-7TRLIFFI.js → chunk-LWZS7HI3.js} +1 -1
  16. package/dist/{chunk-CHSYDKBL.js → chunk-N4UQLCBN.js} +3 -3
  17. package/dist/{chunk-YIITY7Q7.js → chunk-NX4PHQBL.js} +34 -22
  18. package/dist/chunk-OVXQQEXL.js +41 -0
  19. package/dist/{chunk-SRXBTP5H.js → chunk-PNXIA7MI.js} +217 -192
  20. package/dist/chunk-RMBWKZI2.js +130 -0
  21. package/dist/{chunk-DMGHYCDI.js → chunk-SCRO6HWB.js} +5 -3
  22. package/dist/{chunk-OG4OYTJJ.js → chunk-T6F4FYYS.js} +1 -129
  23. package/dist/chunk-UXY4RU57.js +48 -0
  24. package/dist/{chunk-PFGUCNOK.js → chunk-WONTOC5W.js} +7 -6
  25. package/dist/conventions.d.ts +70 -0
  26. package/dist/conventions.js +26 -0
  27. package/dist/crossings.d.ts +15 -4
  28. package/dist/de440-pack.d.ts +43 -0
  29. package/dist/de440-pack.js +16 -0
  30. package/dist/de440.d.ts +113 -0
  31. package/dist/de440.js +19 -0
  32. package/dist/ephemeris-D1lM832F.d.ts +64 -0
  33. package/dist/geo.d.ts +28 -7
  34. package/dist/geo.js +2 -2
  35. package/dist/houses-extra.d.ts +5 -4
  36. package/dist/{houses-CFERsAlK.d.ts → houses-icK01yXi.d.ts} +3 -3
  37. package/dist/index.d.ts +8 -6
  38. package/dist/index.js +40 -28
  39. package/dist/{internal-math-DJJ8BYex.d.ts → internal-math-BGX23p4h.d.ts} +2 -2
  40. package/dist/internal-math.d.ts +4 -3
  41. package/dist/internal-math.js +14 -12
  42. package/dist/internal.d.ts +16 -7
  43. package/dist/internal.js +25 -4
  44. package/dist/lite-composite.js +114 -0
  45. package/dist/lite-declinations.js +253 -0
  46. package/dist/lite-dignities.js +333 -0
  47. package/dist/lite-sect.js +72 -0
  48. package/dist/lite.d.ts +82 -0
  49. package/dist/lite.js +4 -0
  50. package/dist/receipt.d.ts +3 -2
  51. package/dist/receipt.js +156 -67
  52. package/dist/{rulers-Dla6h_Sm.d.ts → rulers-CpS9qkvu.d.ts} +1 -1
  53. package/dist/sky.d.ts +4 -3
  54. package/dist/sky.js +17 -10
  55. package/dist/techniques.d.ts +102 -6
  56. package/dist/techniques.js +131 -56
  57. package/dist/time-bands-CZA9AlLg.d.ts +36 -0
  58. package/dist/time-scale-DIFNa0gz.d.ts +47 -0
  59. package/dist/time.d.ts +81 -0
  60. package/dist/time.js +74 -0
  61. package/dist/timing.d.ts +6 -5
  62. package/dist/timing.js +24 -17
  63. package/dist/types-BCnyWBQZ.d.ts +352 -0
  64. package/dist/vedic.d.ts +112 -4
  65. package/dist/vedic.js +369 -14
  66. package/dist/window.d.ts +22 -2
  67. package/dist/window.js +86 -28
  68. package/dist/{zone-history-ghdyO0Sc.d.ts → zone-history-0XzMGx9V.d.ts} +32 -10
  69. package/package.json +24 -3
  70. package/dist/types-B-yb_tGL.d.ts +0 -240
package/dist/window.js CHANGED
@@ -1,37 +1,46 @@
1
- import {
2
- dateFrom
3
- } from "./chunk-CPALRSPC.js";
4
- import {
5
- validateBirthSettings
6
- } from "./chunk-PFGUCNOK.js";
7
1
  import {
8
2
  bodyLongitude,
3
+ ephemerisAt,
9
4
  gastHours,
10
5
  onChartClock,
11
- tilt
12
- } from "./chunk-SRXBTP5H.js";
6
+ refuseUnderSource
7
+ } from "./chunk-PNXIA7MI.js";
8
+ import {
9
+ dateFrom
10
+ } from "./chunk-CPALRSPC.js";
11
+ import {
12
+ ASPECTS,
13
+ ASPECT_TYPES,
14
+ ENGINE_VERSION,
15
+ matchAspect,
16
+ separation
17
+ } from "./chunk-T6F4FYYS.js";
18
+ import "./chunk-EEW7746S.js";
13
19
  import {
14
20
  REFERENCE_SPAN,
15
21
  elapsedDays,
16
22
  timeBasis
17
23
  } from "./chunk-B5LKF437.js";
18
- import "./chunk-BHJXUY67.js";
24
+ import "./chunk-UXY4RU57.js";
25
+ import "./chunk-HNVGWN3S.js";
26
+ import {
27
+ tilt
28
+ } from "./chunk-CV53HA7R.js";
19
29
  import {
20
30
  computeAngles,
21
31
  computeHouses,
22
32
  houseOf,
23
33
  isPolarUndefinedHouseSystem
24
- } from "./chunk-DMGHYCDI.js";
34
+ } from "./chunk-SCRO6HWB.js";
25
35
  import {
26
- ASPECTS,
27
- ASPECT_TYPES,
28
- ENGINE_VERSION,
29
36
  SIGN_SLUGS,
30
- matchAspect,
31
37
  normalizeLongitude,
32
- separation,
33
38
  signIndexForLongitude
34
- } from "./chunk-OG4OYTJJ.js";
39
+ } from "./chunk-RMBWKZI2.js";
40
+ import "./chunk-BHJXUY67.js";
41
+ import {
42
+ validateBirthSettings
43
+ } from "./chunk-WONTOC5W.js";
35
44
 
36
45
  // src/window-ranges.ts
37
46
  var DEG = Math.PI / 180;
@@ -169,6 +178,7 @@ var BODIES = [
169
178
  var NORTH = 10;
170
179
  var SOUTH = 11;
171
180
  var RATES = /* @__PURE__ */ BODIES.map((body) => WINDOW_RATE_BOUNDS[body]);
181
+ var DEFLECTION_JITTER = 1.8 / 3600;
172
182
  var PAIRS = [];
173
183
  for (let first = 0; first < 10; first += 1) {
174
184
  for (let second = first + 1; second < 10; second += 1) PAIRS.push([first, second]);
@@ -215,7 +225,7 @@ function firstWhere(holds, from, to) {
215
225
  return high;
216
226
  }
217
227
  var onePiece = (a, b) => Number.isNaN(elapsedDays(timeBasis(a, "utc"), timeBasis(b, "utc"), Number.NaN));
218
- function seamsIn(start, end) {
228
+ function seamsIn(start, end, source) {
219
229
  const steps = [];
220
230
  let from = start - 1;
221
231
  while (from < end && !onePiece(from, end)) {
@@ -223,14 +233,26 @@ function seamsIn(start, end) {
223
233
  steps.push(at - 1, at, at + 1);
224
234
  from = at;
225
235
  }
226
- return { bodies: BODIES.map(() => steps), angles: steps };
236
+ return { bodies: BODIES.map(() => [...steps, ...sourceSteps(start, end, source)]), angles: steps };
237
+ }
238
+ function sourceSteps(start, end, source) {
239
+ if (!source?.steps) return [];
240
+ const tt = (time) => timeBasis(time, "utc").ttDays;
241
+ const found = [];
242
+ for (const step of source.steps(tt(start - 1), tt(end))) {
243
+ if (!(tt(end) >= step)) continue;
244
+ const at = tt(start - 1) >= step ? start - 1 : firstWhere((time) => tt(time) >= step, start - 1, end);
245
+ for (let near = at - 2; near <= at + 2; near += 1) found.push(near);
246
+ }
247
+ return found;
227
248
  }
228
249
  var Sky = class {
229
- constructor(latitude, longitude, system, seams) {
250
+ constructor(latitude, longitude, system, seams, source = null) {
230
251
  this.latitude = latitude;
231
252
  this.longitude = longitude;
232
253
  this.system = system;
233
254
  this.seams = seams;
255
+ this.source = source;
234
256
  this.tanPhi = Math.tan(latitude * DEG2);
235
257
  const values = SENSITIVE_RAMC[system];
236
258
  this.sensitive = values ? values[latitude >= 0 ? 0 : 1] : [];
@@ -239,6 +261,7 @@ var Sky = class {
239
261
  longitude;
240
262
  system;
241
263
  seams;
264
+ source;
242
265
  instants = /* @__PURE__ */ new Map();
243
266
  evaluations = 0;
244
267
  violations = 0;
@@ -266,6 +289,35 @@ var Sky = class {
266
289
  }
267
290
  return value;
268
291
  }
292
+ /** The bound on a body's longitude rate, degrees a day: its WINDOW_RATE_BOUNDS entry. */
293
+ rate(index) {
294
+ return RATES[index];
295
+ }
296
+ /**
297
+ * The most the Sun's light deflection may displace a body's longitude at
298
+ * any instant of [t1, t2], degrees: on a source that bends light at the
299
+ * Sun (the DE440 pack's reduction, src/de440/reduce.ts), for Mercury to
300
+ * Pluto within a degree of the Sun in longitude, DEFLECTION_JITTER, and
301
+ * otherwise nothing. The reduction bends light outside the Sun's disc and
302
+ * not behind it (from 1.1.0-rc.12), so the place is the undeflected place,
303
+ * whose rate the body's bound covers, plus a displacement of at most
304
+ * 4GM/c²R = 1.7512″ (light passing at the limb), which steps to nothing
305
+ * where the body passes behind the limb. The search takes that
306
+ * displacement as it takes the true node's jitter. Farther than a degree
307
+ * in longitude the deflection's rate is under 0.002 degrees a day, inside
308
+ * what every rate bound has in hand (each is about twice the body's
309
+ * largest rate), and the disc is far away. Through 1.1.0-rc.11 the
310
+ * reduction bent light behind the disc too, without limit towards the
311
+ * centre, and the rate bound grew as the inverse square of the elongation
312
+ * instead.
313
+ */
314
+ bend(index, t1, t2) {
315
+ if (!this.source || index < 2 || index >= NORTH) return 0;
316
+ const days = (t2 - t1) / DAY;
317
+ const against = RATES[index] + RATES[0];
318
+ const apart = Math.min(Math.abs(signedDelta(this.lon(t1, 0), this.lon(t1, index))), Math.abs(signedDelta(this.lon(t2, 0), this.lon(t2, index))));
319
+ return apart - against * days >= 1 ? 0 : DEFLECTION_JITTER;
320
+ }
269
321
  node(time) {
270
322
  return bodyLongitude("North Node", new Date(time));
271
323
  }
@@ -343,10 +395,10 @@ var Interval = class {
343
395
  const known = this.bodies[index];
344
396
  if (known !== void 0) return known;
345
397
  const { sky, t1, t2 } = this;
346
- const reach = RATES[index] * (t2 - t1) / DAY;
347
- const jitter = index >= NORTH ? 2 * Math.max(nodeJitter(t1), nodeJitter(t2)) : 0;
398
+ const reach = sky.rate(index) * (t2 - t1) / DAY;
399
+ const jitter = 2 * (index >= NORTH ? Math.max(nodeJitter(t1), nodeJitter(t2)) : sky.bend(index, t1, t2));
348
400
  let range;
349
- if (reach + jitter >= 90 || this.jumps(sky.seams.bodies[index])) range = null;
401
+ if (!(reach + jitter < 90) || this.jumps(sky.seams.bodies[index])) range = null;
350
402
  else {
351
403
  const l1 = sky.lon(t1, index);
352
404
  const step = signedDelta(l1, sky.lon(t2, index));
@@ -366,13 +418,15 @@ var Interval = class {
366
418
  if (this.jumps(sky.seams.bodies[first]) || this.jumps(sky.seams.bodies[second])) return true;
367
419
  const s1 = separation(sky.lon(t1, first), sky.lon(t1, second));
368
420
  const s2 = separation(sky.lon(t2, first), sky.lon(t2, second));
369
- const reach = (RATES[first] + RATES[second]) * (t2 - t1) / DAY;
370
- if (Math.abs(s2 - s1) > reach + 1e-12) {
421
+ const reach = (sky.rate(first) + sky.rate(second)) * (t2 - t1) / DAY;
422
+ const jitter = 2 * (sky.bend(first, t1, t2) + sky.bend(second, t1, t2));
423
+ if (!(reach < 360)) return true;
424
+ if (Math.abs(s2 - s1) > reach + jitter + 1e-12) {
371
425
  this.violation();
372
426
  return true;
373
427
  }
374
- const lo = (s1 + s2 - reach) / 2 - BAND;
375
- const hi = (s1 + s2 + reach) / 2 + BAND;
428
+ const lo = (s1 + s2 - reach) / 2 - jitter - BAND;
429
+ const hi = (s1 + s2 + reach) / 2 + jitter + BAND;
376
430
  const edges = first < 2 ? LUMINARY_ORB_EDGES : ORB_EDGES;
377
431
  return edges.some((edge) => edge >= lo && edge <= hi);
378
432
  }
@@ -823,6 +877,7 @@ function change(id, from, to, system) {
823
877
  return { feature: "house-system", from: from === 1 ? "whole" : system, to: to === 1 ? "whole" : system };
824
878
  }
825
879
  function birthWindow(input) {
880
+ refuseUnderSource("birthWindow");
826
881
  if (!input || typeof input !== "object") throw new RangeError("input must be an object.");
827
882
  const settings = validateBirthSettings({
828
883
  latitude: input.latitude,
@@ -839,7 +894,8 @@ function birthWindow(input) {
839
894
  }
840
895
  const system = settings.houseSystem ?? "whole";
841
896
  const { start, end, rounding } = resolvedWindow(input);
842
- const sky = new Sky(latitude, longitude, system, seamsIn(start, end));
897
+ const chosen = ephemerisAt(start);
898
+ const sky = new Sky(latitude, longitude, system, seamsIn(start, end, chosen.from), chosen.from);
843
899
  const ids = Array.from({ length: SYSTEM + 1 }, (_, id) => id).filter(
844
900
  (id) => id !== SYSTEM || isPolarUndefinedHouseSystem(system)
845
901
  );
@@ -923,6 +979,7 @@ function birthWindow(input) {
923
979
  if (fallback) flags.push("polar-fallback");
924
980
  if (sky.violations > 0) flags.push("bound-exceeded");
925
981
  if (unresolved.length > 0) flags.push("node-unresolved");
982
+ if (chosen.fallback === "de440-unavailable") flags.push(chosen.fallback);
926
983
  return {
927
984
  schema: BIRTH_WINDOW_SCHEMA,
928
985
  verification: WINDOW_VERIFICATION,
@@ -947,7 +1004,8 @@ function birthWindow(input) {
947
1004
  };
948
1005
  }),
949
1006
  flags,
950
- engineVersion: ENGINE_VERSION
1007
+ engineVersion: ENGINE_VERSION,
1008
+ ephemeris: chosen.ephemeris
951
1009
  };
952
1010
  }
953
1011
  export {
@@ -1,4 +1,5 @@
1
- import { B as BodyName, f as AspectType, Z as ZodiacSign, T as TimeScaleName, H as HouseSystem, g as ChartFlag, d as Chart, h as BirthInput } from './types-B-yb_tGL.js';
1
+ import { a as TimeScaleName } from './time-scale-DIFNa0gz.js';
2
+ import { B as BodyName, f as AspectType, Z as ZodiacSign, H as HouseSystem, g as ChartFlag, d as Chart, h as BirthInput } from './types-BCnyWBQZ.js';
2
3
  import { DeltaTSegment } from './deltat.js';
3
4
 
4
5
  /**
@@ -49,8 +50,14 @@ interface NatalLocalResolution {
49
50
  offsetMinutes: number;
50
51
  /** Forward wall-clock shift; positive only for a reported gap. */
51
52
  gapShiftMinutes: number;
53
+ /**
54
+ * How a repeated or skipped wall time was read. `fold` is the pass taken:
55
+ * "later" only where the caller chose it and `inputFlags` has `dst-fold`,
56
+ * "earlier" otherwise. An engine from before the choice existed refuses a
57
+ * record with "later" as `unsupported_feature`.
58
+ */
52
59
  policy: {
53
- fold: "earlier";
60
+ fold: "earlier" | "later";
54
61
  gap: "shift-forward";
55
62
  };
56
63
  calendar?: "gregorian" | "julian";
@@ -82,8 +89,9 @@ interface NatalProvenanceClaims {
82
89
  icuVersion?: string;
83
90
  tzdbVersion?: string;
84
91
  };
92
+ /** The receipt's own ephemeris: astronomy-engine, or with a DE440 chart its pack (jpl-de440 and the pack's SHA-256). */
85
93
  ephemeris?: {
86
- name: "astronomy-engine";
94
+ name: "astronomy-engine" | "jpl-de440";
87
95
  version: string;
88
96
  };
89
97
  }
@@ -104,10 +112,12 @@ interface NatalEnvelopeContext {
104
112
  */
105
113
  type NatalConventionSet = Readonly<Record<string, string>>;
106
114
  /**
107
- * Every conventions set a receipt may carry, newest first: index 0 is the set
108
- * this release writes, and the codec reads every set here. A minor release may
109
- * add a set at the front, so take a set by its content, not by an index other
110
- * than 0.
115
+ * Every conventions set a receipt may carry: index 0 is the set this release
116
+ * writes for a chart from astronomy-engine; then the earlier sets, newest
117
+ * first; and last the set it writes for a chart from a DE440 pack (from
118
+ * 1.1.0-rc.3), placed there so that no earlier set's index moved. The codec
119
+ * reads every set here. A minor release may add a set at the front, so take a
120
+ * set by its content, not by an index other than 0.
111
121
  */
112
122
  declare const NATAL_RECEIPT_CONVENTION_SETS: readonly NatalConventionSet[];
113
123
  /** What a receipt says its numbers were checked against, as named statements. */
@@ -134,12 +144,13 @@ interface NatalReceipt {
134
144
  /** Only time-resolution assertions may be supplied to this draft's creator. */
135
145
  inputFlags: ChartFlag[];
136
146
  resultFlags: ChartFlag[];
137
- /** From the current conventions set on, the engine also names its ephemeris. */
147
+ /** From the rc.8 conventions set on, the engine also names its ephemeris. */
138
148
  engine: {
139
149
  name: "@zodiacs/engine";
140
150
  version: string;
151
+ /** astronomy-engine and its version, or `jpl-de440` and the SHA-256 of the pack. */
141
152
  ephemeris?: {
142
- name: "astronomy-engine";
153
+ name: "astronomy-engine" | "jpl-de440";
143
154
  version: string;
144
155
  };
145
156
  };
@@ -148,6 +159,12 @@ interface NatalReceipt {
148
159
  }) | null;
149
160
  conventions: NatalConventionSet;
150
161
  coverage: NatalCoverage;
162
+ /**
163
+ * From 1.1.0-rc.1's set on: the ids, in the Zodiacs conventions registry's
164
+ * syntax, that this receipt and its result name, as natalConventionIds
165
+ * (./conventions) gives them.
166
+ */
167
+ conventionIds?: string[];
151
168
  }
152
169
  /** A body as a natal record holds it. Its shape changes only with a new conventions set. */
153
170
  interface NatalBodyRecord {
@@ -220,7 +237,12 @@ interface NatalRecordedResult {
220
237
  }
221
238
  interface NatalEnvelope {
222
239
  schema: typeof NATAL_ENVELOPE_SCHEMA;
223
- /** This draft implements no optional required features; unknown ones fail closed. */
240
+ /**
241
+ * `convention-ids` with the conventions set from 1.1.0-rc.1 on, so that an
242
+ * earlier engine refuses the record as `unsupported_feature`, and none with
243
+ * an earlier set; `convention-ids` then `ephemeris-jpl-de440` with the DE440
244
+ * set. Unknown features fail closed.
245
+ */
224
246
  requiredFeatures: string[];
225
247
  receipt: NatalReceipt;
226
248
  /** `deltaT` from the rc.8 set on, `timeScale` from the time-basis set on. */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zodiacs/engine",
3
- "version": "1.0.0",
4
- "description": "Browser-first astrology calculations used by Zodiacs.org: tropical charts; one calculation API with bounds and receipts in ./calc; birth-time windows in ./window; returns, relationship charts, the void-of-course Moon, patterns and dignities in ./techniques; house positions and cusp speeds in ./houses; rise, set, transit and planetary hours in ./sky; Hellenistic timing techniques and planetary returns in ./timing; and the sidereal zodiac and Jyotish techniques in ./vedic.",
3
+ "version": "2.0.0-rc.2",
4
+ "description": "Browser-first astrology calculations used by Zodiacs.org: tropical charts; one calculation API with bounds and receipts in ./calc; birth-time windows in ./window; returns, relationship charts, the void-of-course Moon, patterns and dignities in ./techniques; house positions and cusp speeds in ./houses; rise, set, transit and planetary hours in ./sky; Hellenistic timing techniques and planetary returns in ./timing; the time basis and the frame of date, without the ephemeris, in ./time; declination parallels, sect, composite midpoints and dignities, without the ephemeris, in ./lite; positions from JPL's DE440 by default, from a pack it ships (./de440/pack), or from a caller's pack in ./de440; and the sidereal zodiac and Jyotish techniques in ./vedic.",
5
5
  "license": "MIT AND CC-BY-4.0",
6
6
  "keywords": [
7
7
  "astrology",
@@ -33,6 +33,10 @@
33
33
  "types": "./dist/calc.d.ts",
34
34
  "import": "./dist/calc.js"
35
35
  },
36
+ "./conventions": {
37
+ "types": "./dist/conventions.d.ts",
38
+ "import": "./dist/conventions.js"
39
+ },
36
40
  "./crossings": {
37
41
  "types": "./dist/crossings.d.ts",
38
42
  "import": "./dist/crossings.js"
@@ -57,6 +61,10 @@
57
61
  "types": "./dist/internal-math.d.ts",
58
62
  "import": "./dist/internal-math.js"
59
63
  },
64
+ "./lite": {
65
+ "types": "./dist/lite.d.ts",
66
+ "import": "./dist/lite.js"
67
+ },
60
68
  "./receipt": {
61
69
  "types": "./dist/receipt.d.ts",
62
70
  "import": "./dist/receipt.js"
@@ -69,6 +77,18 @@
69
77
  "types": "./dist/techniques.d.ts",
70
78
  "import": "./dist/techniques.js"
71
79
  },
80
+ "./time": {
81
+ "types": "./dist/time.d.ts",
82
+ "import": "./dist/time.js"
83
+ },
84
+ "./de440": {
85
+ "types": "./dist/de440.d.ts",
86
+ "import": "./dist/de440.js"
87
+ },
88
+ "./de440/pack": {
89
+ "types": "./dist/de440-pack.d.ts",
90
+ "import": "./dist/de440-pack.js"
91
+ },
72
92
  "./timing": {
73
93
  "types": "./dist/timing.d.ts",
74
94
  "import": "./dist/timing.js"
@@ -98,7 +118,7 @@
98
118
  "access": "public"
99
119
  },
100
120
  "scripts": {
101
- "build": "tsup src/index.ts src/crossings.ts src/deltat.ts src/geo.ts src/receipt.ts src/techniques.ts src/timing.ts src/vedic.ts src/internal.ts src/internal-math.ts src/calc.ts src/window.ts src/houses-extra.ts src/sky.ts --format esm --dts --clean --splitting --metafile --tsconfig tsconfig.build.json",
121
+ "build": "tsup src/index.ts src/crossings.ts src/deltat.ts src/geo.ts src/receipt.ts src/techniques.ts src/timing.ts src/vedic.ts src/internal.ts src/internal-math.ts src/calc.ts src/window.ts src/houses-extra.ts src/sky.ts src/conventions.ts src/time.ts src/de440.ts src/de440-pack.ts --format esm --dts --clean --splitting --metafile --tsconfig tsconfig.build.json && node scripts/build-lite.mjs",
102
122
  "docs": "typedoc --options typedoc.json",
103
123
  "exports:smoke": "node scripts/module-resolution-smoke.mjs",
104
124
  "consumer:smoke": "node scripts/verify-packed-consumer.mjs",
@@ -116,6 +136,7 @@
116
136
  },
117
137
  "devDependencies": {
118
138
  "@types/node": "^22.19.19",
139
+ "esbuild": "0.27.7",
119
140
  "tsup": "^8.5.1",
120
141
  "typedoc": "^0.28.20",
121
142
  "typescript": "^5.9.3",
@@ -1,240 +0,0 @@
1
- import { DeltaT } from './deltat.js';
2
-
3
- /** The scale an input instant is on. UTC unless a caller says otherwise. */
4
- type TimeScaleName = "utc" | "ut1" | "tt";
5
- /**
6
- * The ΔT model name for a value derived from leap seconds and IERS UT1 − UTC:
7
- * a chart's from 1972 to the end of the IERS UT1 table. DELTA_T_MODEL names
8
- * the model used at every other instant.
9
- */
10
- declare const DELTA_T_IERS_MODEL = "iers-utc/1";
11
- /** UT1 − UTC as used: IERS observed or predicted, or 0 within 0.9 s outside the table. */
12
- interface Ut1MinusUtc {
13
- seconds: number;
14
- sigma: number;
15
- source: "observed" | "predicted" | "fallback";
16
- }
17
- /** TAI − UTC, s; `listed` is false after the list expires and its last value is carried. */
18
- interface LeapSeconds {
19
- taiMinusUtc: number;
20
- listed: boolean;
21
- }
22
- /** How an instant became UT1 and TT: "iers" (leap seconds, IERS UT1 − UTC), "delta-t" (read as UT1, the ΔT model) or "pinned". */
23
- interface TimeScale {
24
- input: TimeScaleName;
25
- basis: "iers" | "delta-t" | "pinned";
26
- /** Null before 1972. */
27
- ut1MinusUtc: Ut1MinusUtc | null;
28
- /** Null where TT did not come from the leap seconds. */
29
- leapSeconds: LeapSeconds | null;
30
- }
31
-
32
- /** Public, serializable vocabulary shared by the chart APIs. */
33
-
34
- type DateInput = Date | string | number;
35
- type ZodiacSign = "aries" | "taurus" | "gemini" | "cancer" | "leo" | "virgo" | "libra" | "scorpio" | "sagittarius" | "capricorn" | "aquarius" | "pisces";
36
- type Element = "fire" | "earth" | "air" | "water";
37
- type Modality = "cardinal" | "fixed" | "mutable";
38
- type Polarity = "day" | "night";
39
- type HouseNumber = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
40
- interface SignDefinition {
41
- readonly slug: ZodiacSign;
42
- readonly name: string;
43
- readonly element: Element;
44
- readonly modality: Modality;
45
- readonly polarity: Polarity;
46
- readonly naturalHouse: HouseNumber;
47
- }
48
- type BodyName = "Sun" | "Moon" | "Mercury" | "Venus" | "Mars" | "Jupiter" | "Saturn" | "Uranus" | "Neptune" | "Pluto" | "North Node" | "South Node";
49
- type HouseSystem = "whole" | "placidus" | "porphyry" | "equal" | "equal-mc" | "vehlow" | "koch" | "regiomontanus" | "campanus" | "topocentric" | "alcabitius" | "morinus" | "meridian";
50
- type ChartFlag = "dst-gap" | "dst-fold" | "lmt" | "no-time" | "polar-fallback" | "outside-reference-span";
51
- /**
52
- * A resolved birth instant. Use `resolveBirth` from `@zodiacs/engine/geo`
53
- * when starting from a local wall time and IANA timezone.
54
- */
55
- interface BirthInput {
56
- /**
57
- * The instant, on the scale `timeScale` names: UTC by default, and UT1 or
58
- * TT when `timeScale` says so. The field keeps its name on every scale,
59
- * because receipts record it under that name (docs/time.md).
60
- */
61
- utc: DateInput;
62
- /** "utc" (default), "ut1" or "tt" (docs/time.md). */
63
- timeScale?: TimeScaleName;
64
- latitude?: number;
65
- longitude?: number;
66
- houseSystem?: HouseSystem;
67
- /** False means `utc` is a caller-supplied reference instant and suppresses angles/houses.
68
- * It does not establish a UTC-noon or local-noon convention by itself. */
69
- timeKnown?: boolean;
70
- /** Up to 64 known flags. Duplicate claims normalize to one value. Time flags
71
- * are caller assertions; no-time/polar-fallback echoes must match calculation.
72
- * natalChart returns canonical semantic flags, not the raw submitted array. */
73
- flags?: readonly ChartFlag[];
74
- /**
75
- * Fix ΔT (TT − UT1) at this many seconds instead of the engine's time
76
- * basis; UT1 still comes from the instant. The chart then reports
77
- * `deltaT.model` "pinned". Finite, at most 1e10 in size.
78
- */
79
- deltaT?: number;
80
- }
81
- interface ChartInput {
82
- /** The instant as given, on the scale `timeScale` names (UTC when it is absent), as BirthInput.utc. */
83
- utc: Date;
84
- /** Present when the instant is not UTC. */
85
- timeScale?: Exclude<TimeScaleName, "utc">;
86
- /** A caller's fixed ΔT in seconds; the engine's model when absent. */
87
- deltaT?: number;
88
- latitude?: number;
89
- longitude?: number;
90
- houseSystem: HouseSystem;
91
- timeKnown: boolean;
92
- flags?: readonly ChartFlag[];
93
- }
94
- interface BodyPosition {
95
- body: BodyName;
96
- /** Tropical ecliptic longitude of date, degrees in [0, 360). */
97
- lon: number;
98
- /** Ecliptic latitude, degrees (zero for the Moon nodes). */
99
- lat: number;
100
- /**
101
- * Longitude speed in degrees/day, the derivative of `lon` over plus/minus
102
- * 0.001 day (the nodes: plus/minus 0.25 day); negative means retrograde.
103
- */
104
- speed: number;
105
- retrograde: boolean;
106
- sign: ZodiacSign;
107
- /** Longitude inside `sign`, degrees in [0, 30). */
108
- degree: number;
109
- }
110
- /** A chart point that is not a body; see `chartPoints`. */
111
- type PointName = "Mean Node" | "Mean South Node" | "Black Moon Lilith" | "Vertex" | "East Point" | "Lot of Fortune" | "Lot of Spirit" | "Lot of Eros" | "Lot of Necessity" | "Lot of Courage" | "Lot of Victory" | "Lot of Nemesis";
112
- /** Day when the Sun is above the horizon, night when it is below. */
113
- type Sect = "day" | "night";
114
- interface PointPosition {
115
- point: PointName;
116
- /** Tropical longitude of date, degrees in [0, 360). */
117
- lon: number;
118
- /** Ecliptic latitude, degrees; zero except for Black Moon Lilith. */
119
- lat: number;
120
- /**
121
- * Longitude speed in degrees/day, the derivative of `lon` over plus/minus
122
- * 0.001 day, for the mean node and Black Moon Lilith; null for the points the
123
- * chart's angles fix.
124
- */
125
- speed: number | null;
126
- sign: ZodiacSign;
127
- /** Longitude inside `sign`, degrees in [0, 30). */
128
- degree: number;
129
- }
130
- interface ChartPoints {
131
- /** The chart's sect; null when it has no angles. */
132
- sect: Sect | null;
133
- /**
134
- * The mean node and its opposite point and Black Moon Lilith always; the
135
- * Vertex, the East Point and the seven lots only when the chart has angles.
136
- */
137
- points: PointPosition[];
138
- }
139
- interface Angles {
140
- asc: number;
141
- mc: number;
142
- dsc: number;
143
- ic: number;
144
- }
145
- interface Houses {
146
- system: HouseSystem;
147
- /** Cusp longitudes; array index zero is the first house. */
148
- cusps: number[];
149
- }
150
- type AspectType = "conjunction" | "sextile" | "square" | "trine" | "opposition";
151
- interface Aspect {
152
- a: BodyName;
153
- b: BodyName;
154
- type: AspectType;
155
- /** Deviation from exact, in degrees. */
156
- orb: number;
157
- /**
158
- * True only when the orb is strictly decreasing at the chart instant, judged
159
- * from the two longitude speeds. False when separating, when exact, and when
160
- * the relative speed is below STATIONARY_RELATIVE_SPEED; aspectMotion tells
161
- * the last case apart.
162
- */
163
- applying: boolean;
164
- }
165
- interface Chart {
166
- input: ChartInput;
167
- bodies: BodyPosition[];
168
- /** Present only when a time and coordinates are available. */
169
- angles: Angles | null;
170
- houses: Houses | null;
171
- aspects: Aspect[];
172
- flags: ChartFlag[];
173
- /** The ΔT (TT − UT1) the chart was computed with, its band and its source. */
174
- deltaT: DeltaT;
175
- /** How the instant became UT1 (for the angles) and TT (for the positions). */
176
- timeScale: TimeScale;
177
- engineVersion: string;
178
- }
179
- interface MinimalBody {
180
- body: string;
181
- lon: number;
182
- }
183
- interface InterAspect {
184
- /** Body in the first chart (or the moving body for `transits`). */
185
- a: string;
186
- aLon: number;
187
- /** Body in the second chart (or the natal body for `transits`). */
188
- b: string;
189
- bLon: number;
190
- type: AspectType;
191
- orb: number;
192
- }
193
- interface PairSummary {
194
- aspects: InterAspect[];
195
- top: InterAspect[];
196
- counts: Record<AspectType, number>;
197
- easeful: number;
198
- charged: number;
199
- elements: {
200
- a: Record<Element, number>;
201
- b: Record<Element, number>;
202
- };
203
- modalities: {
204
- a: Record<Modality, number>;
205
- b: Record<Modality, number>;
206
- };
207
- }
208
- interface SynastryResult extends PairSummary {
209
- a: Chart;
210
- b: Chart;
211
- }
212
- interface TransitResult {
213
- natal: Chart;
214
- at: Date;
215
- positions: BodyPosition[];
216
- /** Moving-body-to-natal-body aspects, sorted by orb. */
217
- aspects: InterAspect[];
218
- }
219
- type MoonPhaseName = "New Moon" | "Waxing Crescent" | "First Quarter" | "Waxing Gibbous" | "Full Moon" | "Waning Gibbous" | "Last Quarter" | "Waning Crescent";
220
- interface MoonPhase {
221
- at: Date;
222
- /** Elongation Moon minus Sun: 0 = new, 180 = full. */
223
- angle: number;
224
- /** Illuminated fraction in [0, 1]. */
225
- illumination: number;
226
- name: MoonPhaseName;
227
- waxing: boolean;
228
- }
229
- /** This package's version, as package.json names it. A string: it changes with every release. */
230
- declare const ENGINE_VERSION: string;
231
- /**
232
- * The ephemeris underneath every position. The dependency is pinned to this
233
- * exact version, so receipts can name it without asking the caller.
234
- */
235
- declare const EPHEMERIS: Readonly<{
236
- name: "astronomy-engine";
237
- version: string;
238
- }>;
239
-
240
- export { type Angles as A, type BodyName as B, type ChartInput as C, type DateInput as D, type Element as E, type HouseSystem as H, type InterAspect as I, type LeapSeconds as L, type MoonPhase as M, type PairSummary as P, type SynastryResult as S, type TimeScaleName as T, type Ut1MinusUtc as U, type ZodiacSign as Z, type Houses as a, type HouseNumber as b, type BodyPosition as c, type Chart as d, type TimeScale as e, type AspectType as f, type ChartFlag as g, type BirthInput as h, type ChartPoints as i, type TransitResult as j, type Sect as k, type MinimalBody as l, type Modality as m, type Aspect as n, DELTA_T_IERS_MODEL as o, ENGINE_VERSION as p, EPHEMERIS as q, type MoonPhaseName as r, type PointName as s, type PointPosition as t, type Polarity as u, type SignDefinition as v };