kriya-ephemeris
v0.3.0
Published
Browser-shippable astronomical calculation primitives. Shared between the Kriya astrology API engine and downstream offline-capable consumers (Netra v3+).
Readme
kriya-ephemeris
Browser-shippable astronomical calculation primitives, factored out of the Kriya astrology API engine. Pure-arithmetic TypeScript — no I/O, no network, no Node-only APIs — so the same calculation paths run server-side in the engine and client-side in browsers without divergence.
Status
v0.1.1 — full offline closure for classical 10-body charts.
Published to npm (npm install kriya-ephemeris). Tarball gzips
to ~1.5 MB (under the 2 MB compressed footprint goal from the Netra
v3.0 offline-program brief).
Built with tsup (esbuild-based bundler), not a plain tsc emit —
the source tree uses extensionless relative imports throughout
(matching this repo's moduleResolution: bundler convention), and a
raw tsc emit carries that straight into dist/, which plain
Node's native ESM resolver can't follow (it requires explicit .js
extensions, unlike a bundler). v0.1.0 shipped with this bug —
installable but unusable outside a bundler-based consumer — caught
by a real npm install + plain node smoke test, not just a
type-check. Fixed in v0.1.1 by switching the build to bundle (and
therefore resolve) all internal cross-file references at build time.
Surface
| Subpath | What's there |
|---|---|
| kriya-ephemeris/angles | DEG2RAD/RAD2DEG, normalization, DMS conversion |
| kriya-ephemeris/time | Julian-day conversion, ΔT (Espenak & Meeus 2006), mean + true obliquity (IAU 1980 + Laskar 1986), nutation (low-precision + 15-term IAU 1980), sidereal time |
| kriya-ephemeris/coords | Ecliptic ↔ equatorial transforms |
| kriya-ephemeris/bodies | Sun (VSOP87 Earth-derived), Moon (MPP02 + ELP2000 evaluators), planets (VSOP87 + Standish/JPL Kepler approximation), Pluto (RK4 n-body with JPL Horizons trajectory data), motion (longitude rate), phase (angle + illuminated fraction), shared types |
| kriya-ephemeris/houses | All ten systems: Whole-sign, Equal, Porphyry, Placidus, Koch, Regiomontanus, Campanus, Topocentric, Alcabitius, Morinus, plus angle helpers + computeHouses switch |
| kriya-ephemeris/aspects | Major/minor/harmonic aspect detection, declination parallels, harmonic chart longitudes |
| kriya-ephemeris/points | Mean ascending node, true ascending node (top-5 Meeus periodic terms), mean Black Moon Lilith |
Out of scope (server-only via the API)
- AI / Critic / Calibrate / Geocode (HTTP-only by design)
- Asteroids beyond classical 10 (Ceres / Pallas / Juno / Vesta / Chiron)
- Centaurs (Pholus / Nessus) + TNOs (Eris / Haumea / Makemake / Sedna / Quaoar) — driven by the integrator stack, deferred per the v3.0 brief
- Fixed-star catalog (could ship later as a separate WASM module)
- Higher-level features (vedic divisions, Hellenistic time-lords, eclipses, transit scanner, electional, horary, etc.)
Engine integration
The engine consumes this package in place of the same code that used
to live in lib/ephemeris/{angles,time,coords,aspects,houses,points}
and lib/ephemeris/bodies/{types,sun,moon,planet-kepler,planet.data,
kepler-core,motion,phase,vsop87,elp2000,mpp02,pluto}. Bridge files
at the original paths re-export the package surface, so existing
engine call sites are unchanged.
Parity guarantee
Every export of this package produces byte-identical output to the engine's pre-carve-out implementation. Parity is locked in by the engine's existing test suite (1130+ tests across the chart-compute, houses, aspects, points, vedic, hellenistic, electional, and relational layers), all of which now exercise the package via the bridges.
