kriya-ephemeris-vedic
v0.1.2
Published
Browser-shippable Vedic/sidereal computation: ayanamsa, nakshatra, divisional (varga) charts, panchanga, and Vimshottari dasha. Companion to kriya-ephemeris and kriya-ephemeris-timelords -- separate package so pros who don't use Vedic mode don't pay its b
Readme
kriya-ephemeris-vedic
Browser-shippable Vedic/sidereal computation, factored out of the
Kriya astrology API engine. A separate package from kriya-ephemeris
and kriya-ephemeris-timelords (both peer dependencies) so pros who
don't use Vedic mode don't pay its bundle-size cost.
Status
v0.1.0 — full offline closure for ayanamsa/sidereal conversion,
nakshatra, divisional (varga) charts, panchanga, and Vimshottari
dasha. This is the full scope needed to make a real Vedic chart view
work offline (positions + nakshatra + dasha trail), not just the raw
ayanamsa formula in isolation — see "Scope note" below.
Surface
Single entry point (kriya-ephemeris-vedic), re-exporting:
- Ayanamsa —
ayanamsaDeg,siderealLongitudeDeg,SUPPORTED_AYANAMSAS(Lahiri, Raman, KP, Fagan-Bradley, Yukteswar). Same "epoch value + linear IAU-precession-rate drift" shape as the fixed-star precession model inkriya-ephemeris-stars— no fixed- star ephemeris lookup, no periodic precession terms. - Nakshatra —
nakshatraOf,NAKSHATRA_NAMES,NAKSHATRA_LORDS. 27 lunar mansions + Vimshottari lord + pada from a sidereal longitude. - Varga (divisional charts) —
allVargasplus 16 individual functions (rashithroughshashtiamsa, D1–D60). - Panchanga —
panchanga()(tithi, karana, yoga, nakshatra, vara from Sun/Moon tropical longitudes + ayanamsa + JD). - Vimshottari dasha —
vimshottariDasha,activeDashaAt. 120-year cycle, 1–5 levels deep, with the same activation-chain enrichment (computeActivationChain) used by zodiacal releasing — this package depends onkriya-ephemeris-timelordsfor that shared helper.
Scope note
The raw ayanamsa formula alone is ~40 lines and was the original
framing of this extraction ask. But no real Vedic chart works with
just a longitude shift — the engine's own computeVedicChart()
(server-side chart assembly) always pairs ayanamsa with nakshatra,
dasha, and varga to produce what a Vedic-mode chart view actually
shows. This package ships that full, real scope rather than a formula
nobody could use standalone.
Out of scope (server-only via the API, or simply not extracted)
- Chart-assembly glue (VSOP/ELP body positions, house computation, response-shape assembly) — stays engine-side, same boundary as the other extracted packages.
- The rest of
lib/ephemeris/vedic/(~3,700 more lines: yogas, ashtakavarga, shadbala, tajika-*, kalachakra-dasha, KP sub-lords, etc.) — Vedic-analysis-on-top-of-a-sidereal-chart, not needed for ayanamsa/nakshatra/dasha/varga to work. Revisit if a specific feature needs one of these.
Engine integration
The engine consumes this package in place of the code that used to
live in lib/ephemeris/vedic/{ayanamsa,nakshatra,varga,panchanga,dasha}.ts.
Bridge files at the original paths re-export the package surface with
exact named re-exports (not export *) — several of these files have
direct importers elsewhere in lib/ephemeris/vedic/ (KP sub-lords,
Navatara, Kalachakra dasha, Mudda dasha, etc.) and in
lib/ephemeris/electional/muhurta.ts, none of which are part of this
extraction, so their existing import surface had to stay byte-exact.
Parity guarantee
Every export of this package produces byte-identical output to the engine's pre-carve-out implementation — logic is unchanged arithmetic with only import paths repointed. Parity is locked in by the engine's existing test suite, including exact-value assertions (Lahiri ayanamsa at J2000 = 23.85306°, cross-checked against Astrodienst/ Jagannatha Hora; three golden celebrity charts — Gandhi, Vivekananda, Indira Gandhi — cross-checked against AstroSage for exact Moon rasi, nakshatra, pada, ascendant rasi, and active mahadasha lord), all of which pass unchanged against the bridge.
