@zodiacs/engine 0.1.1-rc.15 → 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/CHANGELOG.md +891 -0
- package/LICENSING.md +192 -12
- package/NOTICE +96 -2
- package/README.md +296 -66
- package/dist/{api-CoB_kqE3.d.ts → api-WbxJ4Wj-.d.ts} +15 -10
- package/dist/ayanamsa--YQ46fET.d.ts +134 -0
- package/dist/calc.d.ts +390 -0
- package/dist/calc.js +1039 -0
- package/dist/chunk-47ERTK5X.js +27 -0
- package/dist/chunk-7TRLIFFI.js +56 -0
- package/dist/chunk-A3U2ZS2W.js +29 -0
- package/dist/{chunk-KHBLFXFG.js → chunk-B5LKF437.js} +29 -28
- package/dist/{chunk-ONBZ4HK7.js → chunk-BHJXUY67.js} +4 -2
- package/dist/{chunk-OYGRVGXD.js → chunk-CHSYDKBL.js} +3 -3
- package/dist/{chunk-ZHVI3KWJ.js → chunk-DMGHYCDI.js} +4 -4
- package/dist/{chunk-CWI4YUDL.js → chunk-FTX3JDJA.js} +21 -18
- package/dist/{chunk-MFF3VKO3.js → chunk-OG4OYTJJ.js} +47 -42
- package/dist/{chunk-ZZPITHQS.js → chunk-SRXBTP5H.js} +199 -65
- package/dist/{chunk-AECKV73C.js → chunk-TSS2SZWQ.js} +8 -2
- package/dist/chunk-WS3TDSP3.js +474 -0
- package/dist/chunk-YIITY7Q7.js +483 -0
- package/dist/crossings.d.ts +8 -7
- package/dist/crossings.js +1 -1
- package/dist/deltat.d.ts +28 -3
- package/dist/deltat.js +1 -1
- package/dist/geo.d.ts +33 -12
- package/dist/geo.js +17 -458
- package/dist/{internal-math-BbktkHCc.d.ts → houses-CFERsAlK.d.ts} +14 -160
- package/dist/houses-extra.d.ts +95 -0
- package/dist/houses-extra.js +339 -0
- package/dist/index.d.ts +34 -48
- package/dist/index.js +31 -23
- package/dist/internal-math-DJJ8BYex.d.ts +174 -0
- package/dist/internal-math.d.ts +3 -2
- package/dist/internal-math.js +2 -2
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +5 -5
- package/dist/receipt.d.ts +2 -243
- package/dist/receipt.js +78 -37
- package/dist/reference-span-CILpclrz.d.ts +40 -0
- package/dist/rulers-Dla6h_Sm.d.ts +15 -0
- package/dist/sky.d.ts +173 -0
- package/dist/sky.js +379 -0
- package/dist/techniques.d.ts +453 -0
- package/dist/techniques.js +823 -0
- package/dist/timing.d.ts +113 -17
- package/dist/timing.js +98 -64
- package/dist/{types-BsWaqwU_.d.ts → types-B-yb_tGL.d.ts} +23 -11
- package/dist/vedic.d.ts +42 -124
- package/dist/vedic.js +44 -458
- package/dist/window.d.ts +180 -0
- package/dist/window.js +960 -0
- package/dist/zone-history-ghdyO0Sc.d.ts +268 -0
- package/package.json +25 -3
package/dist/receipt.d.ts
CHANGED
|
@@ -1,244 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import './types-B-yb_tGL.js';
|
|
2
2
|
import './deltat.js';
|
|
3
|
-
|
|
4
|
-
/** Zodiacs-owned draft vocabulary; not an industry interoperability standard. */
|
|
5
|
-
declare const NATAL_ENVELOPE_SCHEMA = "zodiacs.natal-envelope.draft-v1";
|
|
6
|
-
declare const NATAL_RECEIPT_SCHEMA = "zodiacs.calculation-receipt.draft-v1";
|
|
7
|
-
declare const NATAL_DIAGNOSTIC_SCHEMA = "zodiacs.natal-diagnostic.draft-v1";
|
|
8
|
-
declare const NATAL_ENVELOPE_LIMITS: Readonly<{
|
|
9
|
-
bytes: 65536;
|
|
10
|
-
depth: 12;
|
|
11
|
-
nodes: 4096;
|
|
12
|
-
}>;
|
|
13
|
-
type NatalEnvelopeErrorCode = "invalid_json" | "invalid_shape" | "invalid_value" | "inconsistent_result" | "invalid_context" | "size_limit" | "complexity_limit" | "unsupported_version" | "unsupported_feature";
|
|
14
|
-
declare class NatalEnvelopeError extends Error {
|
|
15
|
-
readonly code: NatalEnvelopeErrorCode;
|
|
16
|
-
constructor(code: NatalEnvelopeErrorCode);
|
|
17
|
-
}
|
|
18
|
-
type NatalJsonValue = null | boolean | number | string | NatalJsonValue[] | NatalJsonObject;
|
|
19
|
-
interface NatalJsonObject {
|
|
20
|
-
[key: string]: NatalJsonValue;
|
|
21
|
-
}
|
|
22
|
-
type NatalReference = "supplied-instant" | "utc-noon" | "local-noon";
|
|
23
|
-
/** A clock change a local resolution records. */
|
|
24
|
-
interface NatalZoneTransition {
|
|
25
|
-
at: string;
|
|
26
|
-
offsetBeforeMinutes: number;
|
|
27
|
-
offsetAfterMinutes: number;
|
|
28
|
-
cause: "dst" | "legal-change" | "date-line";
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Captured assertions, checked arithmetically without consulting today's
|
|
32
|
-
* Intl/tzdb. The fields after `policy` are optional from the time-basis
|
|
33
|
-
* conventions set on, so a record in rc.14's shape is accepted, and absent
|
|
34
|
-
* before it; each one given is checked. `resolveLocalToUtc` returns the whole
|
|
35
|
-
* object as `localResolution` (docs/time.md).
|
|
36
|
-
*/
|
|
37
|
-
interface NatalLocalResolution {
|
|
38
|
-
/** The proleptic Gregorian date resolved. */
|
|
39
|
-
date: string;
|
|
40
|
-
time: string;
|
|
41
|
-
timeZone: string;
|
|
42
|
-
/** Offset at the resolved instant, minutes east of UTC; may be fractional. */
|
|
43
|
-
offsetMinutes: number;
|
|
44
|
-
/** Forward wall-clock shift; positive only for a reported gap. */
|
|
45
|
-
gapShiftMinutes: number;
|
|
46
|
-
policy: {
|
|
47
|
-
fold: "earlier";
|
|
48
|
-
gap: "shift-forward";
|
|
49
|
-
};
|
|
50
|
-
calendar?: "gregorian" | "julian";
|
|
51
|
-
writtenDate?: string;
|
|
52
|
-
tzdbVersion?: string | null;
|
|
53
|
-
dataForm?: "main+backzone" | "main" | "host";
|
|
54
|
-
clock?: "local-mean-time" | "legal";
|
|
55
|
-
transition?: NatalZoneTransition | null;
|
|
56
|
-
localMeanTime?: {
|
|
57
|
-
longitude: number;
|
|
58
|
-
zoneOffsetMinutes: number;
|
|
59
|
-
} | null;
|
|
60
|
-
}
|
|
61
|
-
/** Supplied facts are claims, including hashes. This codec authenticates none of them. */
|
|
62
|
-
interface NatalProvenanceClaims {
|
|
63
|
-
source?: {
|
|
64
|
-
repository: string;
|
|
65
|
-
commit: string;
|
|
66
|
-
};
|
|
67
|
-
artifact?: {
|
|
68
|
-
sha256: string;
|
|
69
|
-
packageVersion: string;
|
|
70
|
-
distributionRepository?: string;
|
|
71
|
-
distributionCommit?: string;
|
|
72
|
-
};
|
|
73
|
-
runtime?: {
|
|
74
|
-
name: string;
|
|
75
|
-
version?: string;
|
|
76
|
-
icuVersion?: string;
|
|
77
|
-
tzdbVersion?: string;
|
|
78
|
-
};
|
|
79
|
-
ephemeris?: {
|
|
80
|
-
name: "astronomy-engine";
|
|
81
|
-
version: string;
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
interface NatalEnvelopeContext {
|
|
85
|
-
/** Omission never infers noon, including when timeKnown is false. */
|
|
86
|
-
reference?: NatalReference;
|
|
87
|
-
/** Original validated ISO spelling when captured; no zone/offset meaning is inferred. */
|
|
88
|
-
sourceInstant?: string | null;
|
|
89
|
-
localResolution?: NatalLocalResolution | null;
|
|
90
|
-
provenance?: NatalProvenanceClaims;
|
|
91
|
-
/** Optional JSON data only. Never executed, rendered, fetched or used for replay. */
|
|
92
|
-
extensions?: NatalJsonObject;
|
|
93
|
-
}
|
|
94
|
-
/** The conventions engine versions 0.1.1-rc.3 to rc.6 recorded. Their receipts stay readable. */
|
|
95
|
-
declare const CONVENTIONS_RC3: Readonly<{
|
|
96
|
-
readonly calendar: "proleptic-gregorian";
|
|
97
|
-
readonly zodiac: "tropical";
|
|
98
|
-
readonly planetPositions: "apparent-geocentric-ecliptic-of-date";
|
|
99
|
-
readonly moonPosition: "astronomy-engine-ecliptic-geo-moon";
|
|
100
|
-
readonly moonNodes: "instantaneous-geocentric-moon-orbit-plane";
|
|
101
|
-
readonly angles: "gast-and-mean-obliquity";
|
|
102
|
-
readonly longitudeUnit: "degrees-[0,360)";
|
|
103
|
-
readonly speed: "degrees-per-day;central-difference-plus-minus-0.25-day";
|
|
104
|
-
readonly aspects: "major-aspects;sun-moon-eight-planets;no-nodes";
|
|
105
|
-
}>;
|
|
106
|
-
/** The conventions engine version 0.1.1-rc.7 recorded. Its receipts stay readable. */
|
|
107
|
-
declare const CONVENTIONS_RC7: Readonly<{
|
|
108
|
-
readonly angles: "gast-and-true-obliquity";
|
|
109
|
-
readonly speed: "degrees-per-day;central-difference-plus-minus-0.001-day;nodes-plus-minus-0.25-day";
|
|
110
|
-
readonly aspects: "major-aspects;sun-moon-eight-planets;no-nodes;applying-instantaneous-orb-rate";
|
|
111
|
-
readonly calendar: "proleptic-gregorian";
|
|
112
|
-
readonly zodiac: "tropical";
|
|
113
|
-
readonly planetPositions: "apparent-geocentric-ecliptic-of-date";
|
|
114
|
-
readonly moonPosition: "astronomy-engine-ecliptic-geo-moon";
|
|
115
|
-
readonly moonNodes: "instantaneous-geocentric-moon-orbit-plane";
|
|
116
|
-
readonly longitudeUnit: "degrees-[0,360)";
|
|
117
|
-
}>;
|
|
118
|
-
/**
|
|
119
|
-
* The conventions engine versions 0.1.1-rc.8 to rc.14 recorded: the planets
|
|
120
|
-
* corrected for light time and aberration but not for gravitational
|
|
121
|
-
* deflection, the Moon's series for neither, and the instant read as UT1.
|
|
122
|
-
* Their receipts stay readable.
|
|
123
|
-
*/
|
|
124
|
-
declare const CONVENTIONS_RC8: Readonly<{
|
|
125
|
-
readonly planetPositions: "aberrated-geocentric-ecliptic-of-date;no-deflection";
|
|
126
|
-
readonly moonPosition: "astronomy-engine-ecliptic-geo-moon;no-light-time;no-aberration";
|
|
127
|
-
readonly deltaT: "tt-minus-ut1;ut1-read-as-utc;value-in-result";
|
|
128
|
-
readonly angles: "gast-and-true-obliquity";
|
|
129
|
-
readonly speed: "degrees-per-day;central-difference-plus-minus-0.001-day;nodes-plus-minus-0.25-day";
|
|
130
|
-
readonly aspects: "major-aspects;sun-moon-eight-planets;no-nodes;applying-instantaneous-orb-rate";
|
|
131
|
-
readonly calendar: "proleptic-gregorian";
|
|
132
|
-
readonly zodiac: "tropical";
|
|
133
|
-
readonly moonNodes: "instantaneous-geocentric-moon-orbit-plane";
|
|
134
|
-
readonly longitudeUnit: "degrees-[0,360)";
|
|
135
|
-
}>;
|
|
136
|
-
/**
|
|
137
|
-
* The conventions this engine records: the rc.8 set, with the time basis in
|
|
138
|
-
* the result (`result.timeScale`, docs/time.md) and local times resolved on
|
|
139
|
-
* the shipped tzdb history before 1970, their flags from its records.
|
|
140
|
-
*/
|
|
141
|
-
declare const CONVENTIONS: Readonly<{
|
|
142
|
-
readonly deltaT: "tt-minus-ut1;value-in-result";
|
|
143
|
-
readonly timeScale: "tt-from-leap-seconds-and-ut1-from-iers-1972-to-table-end;delta-t-model-otherwise;in-result";
|
|
144
|
-
readonly localTime: "tzdb-shards-before-1970;host-intl-from-1970;flags-from-transition-record";
|
|
145
|
-
readonly planetPositions: "aberrated-geocentric-ecliptic-of-date;no-deflection";
|
|
146
|
-
readonly moonPosition: "astronomy-engine-ecliptic-geo-moon;no-light-time;no-aberration";
|
|
147
|
-
readonly angles: "gast-and-true-obliquity";
|
|
148
|
-
readonly speed: "degrees-per-day;central-difference-plus-minus-0.001-day;nodes-plus-minus-0.25-day";
|
|
149
|
-
readonly aspects: "major-aspects;sun-moon-eight-planets;no-nodes;applying-instantaneous-orb-rate";
|
|
150
|
-
readonly calendar: "proleptic-gregorian";
|
|
151
|
-
readonly zodiac: "tropical";
|
|
152
|
-
readonly moonNodes: "instantaneous-geocentric-moon-orbit-plane";
|
|
153
|
-
readonly longitudeUnit: "degrees-[0,360)";
|
|
154
|
-
}>;
|
|
155
|
-
type ConventionSet = typeof CONVENTIONS | typeof CONVENTIONS_RC8 | typeof CONVENTIONS_RC7 | typeof CONVENTIONS_RC3;
|
|
156
|
-
/** Every conventions set a receipt may carry, the current one first. */
|
|
157
|
-
declare const NATAL_RECEIPT_CONVENTION_SETS: readonly [
|
|
158
|
-
typeof CONVENTIONS,
|
|
159
|
-
typeof CONVENTIONS_RC8,
|
|
160
|
-
typeof CONVENTIONS_RC7,
|
|
161
|
-
typeof CONVENTIONS_RC3
|
|
162
|
-
];
|
|
163
|
-
declare const COVERAGE: Readonly<{
|
|
164
|
-
readonly assessment: "finite-reference-cases-only";
|
|
165
|
-
readonly broadDateRange: "not-certified";
|
|
166
|
-
readonly angleExclusions: "exact-geographic-poles-and-ecliptic-horizon-coincidence";
|
|
167
|
-
readonly inputSyntax: "not-an-astronomical-accuracy-guarantee";
|
|
168
|
-
}>;
|
|
169
|
-
interface NatalReceipt {
|
|
170
|
-
schema: typeof NATAL_RECEIPT_SCHEMA;
|
|
171
|
-
/** On the scale `timeScale` names; UTC before the time-basis set. */
|
|
172
|
-
instant: string;
|
|
173
|
-
timeScale?: TimeScaleName;
|
|
174
|
-
sourceInstant: string | null;
|
|
175
|
-
/** Caller declaration, not verification of a human birth time's precision. */
|
|
176
|
-
timeKnown: boolean;
|
|
177
|
-
reference: NatalReference;
|
|
178
|
-
localResolution: NatalLocalResolution | null;
|
|
179
|
-
coordinates: {
|
|
180
|
-
latitude: number;
|
|
181
|
-
longitude: number;
|
|
182
|
-
} | null;
|
|
183
|
-
houses: {
|
|
184
|
-
requested: HouseSystem;
|
|
185
|
-
actual: HouseSystem | null;
|
|
186
|
-
absenceReason: "unknown-time" | "missing-location" | null;
|
|
187
|
-
};
|
|
188
|
-
/** Only time-resolution assertions may be supplied to this draft's creator. */
|
|
189
|
-
inputFlags: ChartFlag[];
|
|
190
|
-
resultFlags: ChartFlag[];
|
|
191
|
-
/** From the current conventions set on, the engine also names its ephemeris. */
|
|
192
|
-
engine: {
|
|
193
|
-
name: "@zodiacs/engine";
|
|
194
|
-
version: string;
|
|
195
|
-
ephemeris?: {
|
|
196
|
-
name: "astronomy-engine";
|
|
197
|
-
version: string;
|
|
198
|
-
};
|
|
199
|
-
};
|
|
200
|
-
provenance: (NatalProvenanceClaims & {
|
|
201
|
-
status: "claimed";
|
|
202
|
-
}) | null;
|
|
203
|
-
conventions: ConventionSet;
|
|
204
|
-
coverage: typeof COVERAGE;
|
|
205
|
-
}
|
|
206
|
-
interface NatalEnvelope {
|
|
207
|
-
schema: typeof NATAL_ENVELOPE_SCHEMA;
|
|
208
|
-
/** This draft implements no optional required features; unknown ones fail closed. */
|
|
209
|
-
requiredFeatures: string[];
|
|
210
|
-
receipt: NatalReceipt;
|
|
211
|
-
/** `deltaT` from the rc.8 set on, `timeScale` from the time-basis set on. */
|
|
212
|
-
result: Pick<Chart, "bodies" | "angles" | "houses" | "aspects"> & Partial<Pick<Chart, "deltaT" | "timeScale">>;
|
|
213
|
-
extensions?: NatalJsonObject;
|
|
214
|
-
}
|
|
215
|
-
type NatalEnvelopeParseResult = {
|
|
216
|
-
ok: true;
|
|
217
|
-
envelope: NatalEnvelope;
|
|
218
|
-
} | {
|
|
219
|
-
ok: false;
|
|
220
|
-
code: NatalEnvelopeErrorCode;
|
|
221
|
-
};
|
|
222
|
-
interface NatalDiagnostic {
|
|
223
|
-
schema: typeof NATAL_DIAGNOSTIC_SCHEMA;
|
|
224
|
-
status: "redacted-not-anonymous";
|
|
225
|
-
timeKnown: boolean;
|
|
226
|
-
houses: NatalReceipt["houses"];
|
|
227
|
-
inputFlags: ChartFlag[];
|
|
228
|
-
resultFlags: ChartFlag[];
|
|
229
|
-
}
|
|
230
|
-
/**
|
|
231
|
-
* Capture a fresh full Chart, not a legacy summary. Checks declared consistency,
|
|
232
|
-
* not ephemeris accuracy, historical timezone truth, origin, or authenticity.
|
|
233
|
-
* Optional properties must be omitted rather than set to undefined.
|
|
234
|
-
*/
|
|
235
|
-
declare function createNatalEnvelope(chart: Chart, context?: NatalEnvelopeContext): NatalEnvelope;
|
|
236
|
-
/** Bounded JSON entry point. Unknown versions/features never become calculation input. */
|
|
237
|
-
declare function parseNatalEnvelope(json: string): NatalEnvelopeParseResult;
|
|
238
|
-
declare function serializeNatalEnvelope(envelope: NatalEnvelope): string;
|
|
239
|
-
/** Replay the recorded request/instant, never a fallback house system or today's tzdb. */
|
|
240
|
-
declare function natalReplayInput(envelope: NatalEnvelope): BirthInput;
|
|
241
|
-
/** A fresh fixed allowlist: no claimed identifiers, versions, hashes, or input/result values. */
|
|
242
|
-
declare function redactNatalEnvelope(envelope: NatalEnvelope): NatalDiagnostic;
|
|
243
|
-
|
|
244
|
-
export { NATAL_DIAGNOSTIC_SCHEMA, NATAL_ENVELOPE_LIMITS, NATAL_ENVELOPE_SCHEMA, NATAL_RECEIPT_CONVENTION_SETS, NATAL_RECEIPT_SCHEMA, type NatalDiagnostic, type NatalEnvelope, type NatalEnvelopeContext, NatalEnvelopeError, type NatalEnvelopeErrorCode, type NatalEnvelopeParseResult, type NatalJsonObject, type NatalJsonValue, type NatalLocalResolution, type NatalProvenanceClaims, type NatalReceipt, type NatalReference, type NatalZoneTransition, createNatalEnvelope, natalReplayInput, parseNatalEnvelope, redactNatalEnvelope, serializeNatalEnvelope };
|
|
3
|
+
export { a as NATAL_DIAGNOSTIC_SCHEMA, b as NATAL_ENVELOPE_LIMITS, c as NATAL_ENVELOPE_SCHEMA, d as NATAL_RECEIPT_CONVENTION_SETS, e as NATAL_RECEIPT_SCHEMA, f as NatalAnglesRecord, g as NatalAspectRecord, h as NatalBodyRecord, i as NatalConventionSet, j as NatalCoverage, k as NatalDeltaTRecord, l as NatalDiagnostic, m as NatalEnvelope, n as NatalEnvelopeContext, o as NatalEnvelopeError, p as NatalEnvelopeErrorCode, q as NatalEnvelopeParseResult, r as NatalHousesRecord, s as NatalJsonObject, t as NatalJsonValue, N as NatalLocalResolution, u as NatalProvenanceClaims, v as NatalReceipt, w as NatalRecordedResult, x as NatalReference, y as NatalTimeScaleRecord, z as NatalZoneTransition, A as createNatalEnvelope, B as natalReplayInput, C as parseNatalEnvelope, D as redactNatalEnvelope, E as serializeNatalEnvelope } from './zone-history-ghdyO0Sc.js';
|
package/dist/receipt.js
CHANGED
|
@@ -11,20 +11,20 @@ import {
|
|
|
11
11
|
UT1_DATA,
|
|
12
12
|
outsideReferenceSpan,
|
|
13
13
|
timeBasis
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-B5LKF437.js";
|
|
15
15
|
import {
|
|
16
16
|
DELTA_T_MODEL,
|
|
17
17
|
DELTA_T_TABLE,
|
|
18
18
|
deltaTAt
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-BHJXUY67.js";
|
|
20
20
|
import {
|
|
21
21
|
ASPECTS,
|
|
22
|
-
|
|
22
|
+
ASPECT_BODY_SET,
|
|
23
23
|
ASPECT_TYPES,
|
|
24
24
|
EPHEMERIS,
|
|
25
25
|
SIGNS,
|
|
26
26
|
aspectMotion
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-OG4OYTJJ.js";
|
|
28
28
|
|
|
29
29
|
// src/receipt-json.ts
|
|
30
30
|
function parseReceiptJson(json, limits) {
|
|
@@ -159,7 +159,7 @@ function compareVersions(a, b) {
|
|
|
159
159
|
var NATAL_ENVELOPE_SCHEMA = "zodiacs.natal-envelope.draft-v1";
|
|
160
160
|
var NATAL_RECEIPT_SCHEMA = "zodiacs.calculation-receipt.draft-v1";
|
|
161
161
|
var NATAL_DIAGNOSTIC_SCHEMA = "zodiacs.natal-diagnostic.draft-v1";
|
|
162
|
-
var NATAL_ENVELOPE_LIMITS = Object.freeze({ bytes: 65536, depth: 12, nodes: 4096 });
|
|
162
|
+
var NATAL_ENVELOPE_LIMITS = /* @__PURE__ */ Object.freeze({ bytes: 65536, depth: 12, nodes: 4096 });
|
|
163
163
|
var ERROR_CODES = /* @__PURE__ */ new Set([
|
|
164
164
|
"invalid_json",
|
|
165
165
|
"invalid_shape",
|
|
@@ -182,7 +182,7 @@ var NatalEnvelopeError = class extends Error {
|
|
|
182
182
|
ERROR_BRAND.set(this, fixed);
|
|
183
183
|
}
|
|
184
184
|
};
|
|
185
|
-
var CONVENTIONS_RC3 = Object.freeze({
|
|
185
|
+
var CONVENTIONS_RC3 = /* @__PURE__ */ Object.freeze({
|
|
186
186
|
calendar: "proleptic-gregorian",
|
|
187
187
|
zodiac: "tropical",
|
|
188
188
|
planetPositions: "apparent-geocentric-ecliptic-of-date",
|
|
@@ -193,33 +193,45 @@ var CONVENTIONS_RC3 = Object.freeze({
|
|
|
193
193
|
speed: "degrees-per-day;central-difference-plus-minus-0.25-day",
|
|
194
194
|
aspects: "major-aspects;sun-moon-eight-planets;no-nodes"
|
|
195
195
|
});
|
|
196
|
-
var CONVENTIONS_RC7 = Object.freeze({
|
|
196
|
+
var CONVENTIONS_RC7 = /* @__PURE__ */ (() => Object.freeze({
|
|
197
197
|
...CONVENTIONS_RC3,
|
|
198
198
|
angles: "gast-and-true-obliquity",
|
|
199
199
|
speed: "degrees-per-day;central-difference-plus-minus-0.001-day;nodes-plus-minus-0.25-day",
|
|
200
200
|
aspects: "major-aspects;sun-moon-eight-planets;no-nodes;applying-instantaneous-orb-rate"
|
|
201
|
-
});
|
|
202
|
-
var CONVENTIONS_RC8 = Object.freeze({
|
|
201
|
+
}))();
|
|
202
|
+
var CONVENTIONS_RC8 = /* @__PURE__ */ (() => Object.freeze({
|
|
203
203
|
...CONVENTIONS_RC7,
|
|
204
204
|
planetPositions: "aberrated-geocentric-ecliptic-of-date;no-deflection",
|
|
205
205
|
moonPosition: "astronomy-engine-ecliptic-geo-moon;no-light-time;no-aberration",
|
|
206
206
|
deltaT: "tt-minus-ut1;ut1-read-as-utc;value-in-result"
|
|
207
|
-
});
|
|
208
|
-
var
|
|
207
|
+
}))();
|
|
208
|
+
var CONVENTIONS_RC15 = /* @__PURE__ */ (() => Object.freeze({
|
|
209
209
|
...CONVENTIONS_RC8,
|
|
210
210
|
deltaT: "tt-minus-ut1;value-in-result",
|
|
211
211
|
timeScale: "tt-from-leap-seconds-and-ut1-from-iers-1972-to-table-end;delta-t-model-otherwise;in-result",
|
|
212
212
|
localTime: "tzdb-shards-before-1970;host-intl-from-1970;flags-from-transition-record"
|
|
213
|
-
});
|
|
214
|
-
var
|
|
213
|
+
}))();
|
|
214
|
+
var CONVENTIONS = /* @__PURE__ */ (() => Object.freeze({
|
|
215
|
+
...CONVENTIONS_RC15,
|
|
216
|
+
moonPosition: "astronomy-engine-geo-moon;no-light-time;no-aberration",
|
|
217
|
+
nutation: "iau2000b;equation-of-equinoxes-with-two-complementary-terms"
|
|
218
|
+
}))();
|
|
219
|
+
var NATAL_RECEIPT_CONVENTION_SETS = /* @__PURE__ */ Object.freeze([
|
|
220
|
+
CONVENTIONS,
|
|
221
|
+
CONVENTIONS_RC15,
|
|
222
|
+
CONVENTIONS_RC8,
|
|
223
|
+
CONVENTIONS_RC7,
|
|
224
|
+
CONVENTIONS_RC3
|
|
225
|
+
]);
|
|
215
226
|
var RC3_TO_RC6 = /^0\.1\.1-rc\.[3-6](?:\+[A-Za-z0-9.-]+)?$/;
|
|
216
227
|
var RC7 = /^0\.1\.1-rc\.7(?:\+[A-Za-z0-9.-]+)?$/;
|
|
217
228
|
var RC8_TO_RC14 = /^0\.1\.1-rc\.(?:[89]|1[0-4])(?:\+[A-Za-z0-9.-]+)?$/;
|
|
229
|
+
var RC15 = /^0\.1\.1-rc\.15(?:\+[A-Za-z0-9.-]+)?$/;
|
|
218
230
|
var before = (version2, release) => compareVersions(version2, release) < 0;
|
|
219
|
-
var
|
|
231
|
+
var NUTATION_RELEASE = "0.1.1-rc.16";
|
|
220
232
|
var RC9_RELEASE = "0.1.1-rc.9";
|
|
221
233
|
var RC10_RELEASE = "0.1.1-rc.10";
|
|
222
|
-
var COVERAGE = Object.freeze({
|
|
234
|
+
var COVERAGE = /* @__PURE__ */ Object.freeze({
|
|
223
235
|
assessment: "finite-reference-cases-only",
|
|
224
236
|
broadDateRange: "not-certified",
|
|
225
237
|
angleExclusions: "exact-geographic-poles-and-ecliptic-horizon-coincidence",
|
|
@@ -264,6 +276,14 @@ var HOUSE_SYSTEMS_BEFORE_RC10 = HOUSE_SYSTEMS.filter(
|
|
|
264
276
|
var POLAR_UNDEFINED = ["placidus", "koch"];
|
|
265
277
|
var TURNING_WITH_ASCENDANT = ["regiomontanus", "campanus", "topocentric"];
|
|
266
278
|
var HOSTILE_KEYS = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
|
|
279
|
+
var BODY_RECORD = ["body", "lon", "lat", "speed", "retrograde", "sign", "degree"];
|
|
280
|
+
var ANGLES_RECORD = ["asc", "mc", "dsc", "ic"];
|
|
281
|
+
var HOUSES_RECORD = ["system", "cusps"];
|
|
282
|
+
var ASPECT_RECORD = ["a", "b", "type", "orb", "applying"];
|
|
283
|
+
var DELTA_T_RECORD = ["seconds", "sigma", "model", "table", "tableDigest", "segment"];
|
|
284
|
+
var TIME_SCALE_RECORD = ["input", "basis", "ut1MinusUtc", "leapSeconds"];
|
|
285
|
+
var UT1_RECORD = ["seconds", "sigma", "source"];
|
|
286
|
+
var LEAP_SECONDS_RECORD = ["taiMinusUtc", "listed"];
|
|
267
287
|
function fail(code) {
|
|
268
288
|
throw new NatalEnvelopeError(code);
|
|
269
289
|
}
|
|
@@ -345,6 +365,24 @@ function fields(value, required, optional = []) {
|
|
|
345
365
|
if (required.some((key) => !Object.hasOwn(value, key)) || Object.keys(value).some((key) => !required.includes(key) && !optional.includes(key)))
|
|
346
366
|
fail("invalid_shape");
|
|
347
367
|
}
|
|
368
|
+
function list(value) {
|
|
369
|
+
if (!Array.isArray(value)) fail("invalid_shape");
|
|
370
|
+
return value;
|
|
371
|
+
}
|
|
372
|
+
function kept(value, keys) {
|
|
373
|
+
const from = record(value);
|
|
374
|
+
const out = {};
|
|
375
|
+
for (const key of keys) if (Object.hasOwn(from, key)) out[key] = from[key];
|
|
376
|
+
return out;
|
|
377
|
+
}
|
|
378
|
+
function timeScaleKept(value) {
|
|
379
|
+
const timeScale = kept(value, TIME_SCALE_RECORD);
|
|
380
|
+
if (timeScale.ut1MinusUtc !== null && timeScale.ut1MinusUtc !== void 0)
|
|
381
|
+
timeScale.ut1MinusUtc = kept(timeScale.ut1MinusUtc, UT1_RECORD);
|
|
382
|
+
if (timeScale.leapSeconds !== null && timeScale.leapSeconds !== void 0)
|
|
383
|
+
timeScale.leapSeconds = kept(timeScale.leapSeconds, LEAP_SECONDS_RECORD);
|
|
384
|
+
return timeScale;
|
|
385
|
+
}
|
|
348
386
|
function choice(value, choices) {
|
|
349
387
|
if (typeof value !== "string" || !choices.includes(value)) fail("invalid_value");
|
|
350
388
|
return value;
|
|
@@ -425,7 +463,7 @@ var J2000_MS = Date.UTC(2e3, 0, 1, 12);
|
|
|
425
463
|
var IERS_SEGMENTS = ["observed", "predicted", "fallback"];
|
|
426
464
|
function validateDeltaT(value, instant, timeBasis2) {
|
|
427
465
|
const deltaT = record(value);
|
|
428
|
-
fields(deltaT,
|
|
466
|
+
fields(deltaT, DELTA_T_RECORD);
|
|
429
467
|
const seconds = number(deltaT.seconds, -1e10, 1e10);
|
|
430
468
|
if (deltaT.model === "pinned") {
|
|
431
469
|
if (deltaT.sigma !== null || deltaT.table !== null || deltaT.tableDigest !== null || deltaT.segment !== "pinned")
|
|
@@ -455,19 +493,19 @@ function same(actual, expected) {
|
|
|
455
493
|
}
|
|
456
494
|
function validateTimeScale(value, deltaT, instant, scale) {
|
|
457
495
|
const timeScale = record(value);
|
|
458
|
-
fields(timeScale,
|
|
496
|
+
fields(timeScale, TIME_SCALE_RECORD);
|
|
459
497
|
const basis = choice(timeScale.basis, ["iers", "delta-t", "pinned"]);
|
|
460
498
|
const { ut1MinusUtc, leapSeconds } = timeScale;
|
|
461
499
|
if (ut1MinusUtc !== null) {
|
|
462
500
|
const ut1 = record(ut1MinusUtc);
|
|
463
|
-
fields(ut1,
|
|
501
|
+
fields(ut1, UT1_RECORD);
|
|
464
502
|
number(ut1.seconds, -1, 1);
|
|
465
503
|
number(ut1.sigma, 0, 1);
|
|
466
504
|
choice(ut1.source, IERS_SEGMENTS);
|
|
467
505
|
}
|
|
468
506
|
if (leapSeconds !== null) {
|
|
469
507
|
const leap = record(leapSeconds);
|
|
470
|
-
fields(leap,
|
|
508
|
+
fields(leap, LEAP_SECONDS_RECORD);
|
|
471
509
|
if (!Number.isInteger(number(leap.taiMinusUtc, 10, 100))) fail("invalid_value");
|
|
472
510
|
bool(leap.listed);
|
|
473
511
|
}
|
|
@@ -476,7 +514,8 @@ function validateTimeScale(value, deltaT, instant, scale) {
|
|
|
476
514
|
fail("inconsistent_result");
|
|
477
515
|
if (deltaT.tableDigest === UT1_DATA.digest || deltaT.tableDigest === DELTA_T_TABLE.digest) {
|
|
478
516
|
const expected = timeBasis(Date.parse(instant), scale);
|
|
479
|
-
if (!same(deltaT, expected.deltaT) || !same(timeScale, expected.timeScale))
|
|
517
|
+
if (!same(deltaT, kept(expected.deltaT, DELTA_T_RECORD)) || !same(timeScale, timeScaleKept(expected.timeScale)))
|
|
518
|
+
fail("inconsistent_result");
|
|
480
519
|
}
|
|
481
520
|
}
|
|
482
521
|
function validateResult(value, instantaneousApplying, instant, scale) {
|
|
@@ -499,7 +538,7 @@ function validateResult(value, instantaneousApplying, instant, scale) {
|
|
|
499
538
|
const speeds = /* @__PURE__ */ new Map();
|
|
500
539
|
for (const item of result.bodies) {
|
|
501
540
|
const body = record(item);
|
|
502
|
-
fields(body,
|
|
541
|
+
fields(body, BODY_RECORD);
|
|
503
542
|
const name = choice(body.body, BODIES);
|
|
504
543
|
if (names.has(name)) fail("invalid_value");
|
|
505
544
|
names.add(name);
|
|
@@ -515,12 +554,12 @@ function validateResult(value, instantaneousApplying, instant, scale) {
|
|
|
515
554
|
if (result.angles === null !== (result.houses === null)) fail("inconsistent_result");
|
|
516
555
|
if (result.angles !== null) {
|
|
517
556
|
const angles = record(result.angles);
|
|
518
|
-
fields(angles,
|
|
557
|
+
fields(angles, ANGLES_RECORD);
|
|
519
558
|
for (const angle of Object.values(angles)) longitude(angle);
|
|
520
559
|
if (!angularClose(angles.dsc, angles.asc + 180) || !angularClose(angles.ic, angles.mc + 180))
|
|
521
560
|
fail("inconsistent_result");
|
|
522
561
|
const houses = record(result.houses);
|
|
523
|
-
fields(houses,
|
|
562
|
+
fields(houses, HOUSES_RECORD);
|
|
524
563
|
const system = choice(houses.system, HOUSE_SYSTEMS);
|
|
525
564
|
if (!Array.isArray(houses.cusps) || houses.cusps.length !== 12) fail("invalid_shape");
|
|
526
565
|
const cusps = houses.cusps.map(longitude);
|
|
@@ -566,14 +605,14 @@ function validateResult(value, instantaneousApplying, instant, scale) {
|
|
|
566
605
|
const pairs = /* @__PURE__ */ new Set();
|
|
567
606
|
for (const item of result.aspects) {
|
|
568
607
|
const aspect = record(item);
|
|
569
|
-
fields(aspect,
|
|
608
|
+
fields(aspect, ASPECT_RECORD);
|
|
570
609
|
const a = choice(
|
|
571
610
|
aspect.a,
|
|
572
|
-
BODIES.filter((body) =>
|
|
611
|
+
BODIES.filter((body) => ASPECT_BODY_SET.has(body))
|
|
573
612
|
);
|
|
574
613
|
const b = choice(
|
|
575
614
|
aspect.b,
|
|
576
|
-
BODIES.filter((body) =>
|
|
615
|
+
BODIES.filter((body) => ASPECT_BODY_SET.has(body))
|
|
577
616
|
);
|
|
578
617
|
const key = [a, b].sort().join("/");
|
|
579
618
|
if (a === b || pairs.has(key)) fail("inconsistent_result");
|
|
@@ -789,8 +828,8 @@ function validateEnvelope(input) {
|
|
|
789
828
|
if (timeKnown && Math.abs(coords.latitude) === 90) fail("unsupported_feature");
|
|
790
829
|
}
|
|
791
830
|
const conventions = conventionSet(receipt.conventions);
|
|
792
|
-
const
|
|
793
|
-
const
|
|
831
|
+
const timeBasis2 = conventions === CONVENTIONS || conventions === CONVENTIONS_RC15;
|
|
832
|
+
const current = timeBasis2 || conventions === CONVENTIONS_RC8;
|
|
794
833
|
if (timeBasis2 !== Object.hasOwn(receipt, "timeScale")) fail("invalid_shape");
|
|
795
834
|
const scale = timeBasis2 ? choice(receipt.timeScale, TIME_SCALE_NAMES) : null;
|
|
796
835
|
const result = validateResult(
|
|
@@ -831,7 +870,7 @@ function validateEnvelope(input) {
|
|
|
831
870
|
}
|
|
832
871
|
validateProvenance(receipt.provenance, engineVersion);
|
|
833
872
|
validateLocal(receipt.localResolution, receipt, timeBasis2);
|
|
834
|
-
if (conventions === CONVENTIONS_RC3 && !RC3_TO_RC6.test(engineVersion) || conventions === CONVENTIONS_RC7 && !RC7.test(engineVersion) || conventions === CONVENTIONS_RC8 && !RC8_TO_RC14.test(engineVersion) ||
|
|
873
|
+
if (conventions === CONVENTIONS_RC3 && !RC3_TO_RC6.test(engineVersion) || conventions === CONVENTIONS_RC7 && !RC7.test(engineVersion) || conventions === CONVENTIONS_RC8 && !RC8_TO_RC14.test(engineVersion) || conventions === CONVENTIONS_RC15 && !RC15.test(engineVersion) || conventions === CONVENTIONS && before(engineVersion, NUTATION_RELEASE) || !HOUSE_SYSTEMS_BEFORE_RC9.includes(requested) && before(engineVersion, RC9_RELEASE) || !HOUSE_SYSTEMS_BEFORE_RC10.includes(requested) && before(engineVersion, RC10_RELEASE))
|
|
835
874
|
fail("inconsistent_result");
|
|
836
875
|
fixedFields(receipt.coverage, COVERAGE);
|
|
837
876
|
if (envelope.extensions !== void 0) record(envelope.extensions);
|
|
@@ -850,7 +889,7 @@ function checked(input) {
|
|
|
850
889
|
function createNatalEnvelope(chart, context = {}) {
|
|
851
890
|
return guarded(() => {
|
|
852
891
|
const source = record(cloneData(chart, true));
|
|
853
|
-
|
|
892
|
+
const required = [
|
|
854
893
|
"input",
|
|
855
894
|
"bodies",
|
|
856
895
|
"angles",
|
|
@@ -860,7 +899,8 @@ function createNatalEnvelope(chart, context = {}) {
|
|
|
860
899
|
"deltaT",
|
|
861
900
|
"timeScale",
|
|
862
901
|
"engineVersion"
|
|
863
|
-
]
|
|
902
|
+
];
|
|
903
|
+
if (required.some((key) => !Object.hasOwn(source, key))) fail("invalid_shape");
|
|
864
904
|
const input = record(source.input);
|
|
865
905
|
fields(
|
|
866
906
|
input,
|
|
@@ -906,13 +946,14 @@ function createNatalEnvelope(chart, context = {}) {
|
|
|
906
946
|
conventions: { ...CONVENTIONS },
|
|
907
947
|
coverage: { ...COVERAGE }
|
|
908
948
|
},
|
|
949
|
+
// The fields the record's conventions set names, and only those.
|
|
909
950
|
result: {
|
|
910
|
-
bodies: source.bodies,
|
|
911
|
-
angles: source.angles,
|
|
912
|
-
houses:
|
|
913
|
-
aspects: source.aspects,
|
|
914
|
-
deltaT: source.deltaT,
|
|
915
|
-
timeScale: source.timeScale
|
|
951
|
+
bodies: list(source.bodies).map((body) => kept(body, BODY_RECORD)),
|
|
952
|
+
angles: source.angles === null ? null : kept(source.angles, ANGLES_RECORD),
|
|
953
|
+
houses: houses === null ? null : kept(houses, HOUSES_RECORD),
|
|
954
|
+
aspects: list(source.aspects).map((aspect) => kept(aspect, ASPECT_RECORD)),
|
|
955
|
+
deltaT: kept(source.deltaT, DELTA_T_RECORD),
|
|
956
|
+
timeScale: timeScaleKept(source.timeScale)
|
|
916
957
|
},
|
|
917
958
|
...supplied.extensions === void 0 ? {} : { extensions: supplied.extensions }
|
|
918
959
|
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The span over which this engine's positions have been compared with an
|
|
3
|
+
* independent ephemeris: from 1800-01-01T00:00Z up to, not including,
|
|
4
|
+
* 2200-01-01T00:00Z. Charts outside it are still computed, and carry the
|
|
5
|
+
* `outside-reference-span` flag.
|
|
6
|
+
*/
|
|
7
|
+
declare const REFERENCE_SPAN: Readonly<{
|
|
8
|
+
readonly from: "1800-01-01T00:00:00.000Z";
|
|
9
|
+
readonly to: "2200-01-01T00:00:00.000Z";
|
|
10
|
+
}>;
|
|
11
|
+
/**
|
|
12
|
+
* The span of Terrestrial Time over which the ephemeris is evaluated at all:
|
|
13
|
+
* the years astronomy-engine 2.1.19 itself tabulates, J2000 ± 730,000 days of
|
|
14
|
+
* TT (0001-04-30T12:00 to 3998-09-03T12:00 TT). That is the range of its Pluto
|
|
15
|
+
* model's state table; for any other time its source says: "The target time is
|
|
16
|
+
* outside the year range 0000..4000. Calculate it by crawling backward from 0000
|
|
17
|
+
* or forward from 4000. ... This is super slow." Beyond the table its other
|
|
18
|
+
* series diverge as well: on 30000-06-01 the Sun came out 29° off the ecliptic.
|
|
19
|
+
*
|
|
20
|
+
* Every instant a calculation evaluates, the instant and its speed samples, must
|
|
21
|
+
* lie inside on the calculation's own ΔT clock, or the call throws RangeError.
|
|
22
|
+
* With the model ΔT, instants from 0001-05-01T00:00Z to 3998-09-02T00:00Z are
|
|
23
|
+
* always inside. Being inside is not an accuracy claim: see REFERENCE_SPAN.
|
|
24
|
+
*/
|
|
25
|
+
declare const EPHEMERIS_SPAN: Readonly<{
|
|
26
|
+
/** The scale of the bounds, as a label, like `fromTT` and `toTT`: not a TimeScaleName, which is lowercase. */
|
|
27
|
+
readonly timeScale: "TT";
|
|
28
|
+
/** Days of Terrestrial Time from J2000.0, 2000-01-01T12:00 TT, inclusive. */
|
|
29
|
+
readonly daysFromJ2000: Readonly<{
|
|
30
|
+
readonly from: -730000;
|
|
31
|
+
readonly to: 730000;
|
|
32
|
+
}>;
|
|
33
|
+
/** The same bounds as Terrestrial Time labels (not UTC). */
|
|
34
|
+
readonly fromTT: "0001-04-30T12:00:00";
|
|
35
|
+
readonly toTT: "3998-09-03T12:00:00";
|
|
36
|
+
}>;
|
|
37
|
+
/** True when the instant lies outside REFERENCE_SPAN. */
|
|
38
|
+
declare function outsideReferenceSpan(utc: Date): boolean;
|
|
39
|
+
|
|
40
|
+
export { EPHEMERIS_SPAN as E, REFERENCE_SPAN as R, outsideReferenceSpan as o };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Z as ZodiacSign } from './types-B-yb_tGL.js';
|
|
2
|
+
|
|
3
|
+
/** The seven visible planets of the traditional rulership scheme. */
|
|
4
|
+
type TraditionalPlanet = "Sun" | "Moon" | "Mercury" | "Venus" | "Mars" | "Jupiter" | "Saturn";
|
|
5
|
+
/**
|
|
6
|
+
* The traditional domicile ruler of each sign; the outer planets rule none.
|
|
7
|
+
* The same rulers as `@zodiacs/engine/techniques`'s DOMICILE_RULERS and
|
|
8
|
+
* `@zodiacs/engine/vedic`'s SIGN_LORDS. Each entry point carries its own copy,
|
|
9
|
+
* so that none imports another; a test keeps the three equal.
|
|
10
|
+
*/
|
|
11
|
+
declare const TRADITIONAL_RULERS: Readonly<Record<ZodiacSign, TraditionalPlanet>>;
|
|
12
|
+
/** The seven planets in descending order of their spheres, Saturn to the Moon. */
|
|
13
|
+
declare const CHALDEAN_ORDER: readonly TraditionalPlanet[];
|
|
14
|
+
|
|
15
|
+
export { CHALDEAN_ORDER as C, type TraditionalPlanet as T, TRADITIONAL_RULERS as a };
|