kaabalah 5.1.0 → 5.2.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/README.md +9 -1
- package/dist/astrology/index.d.mts +66 -1
- package/dist/astrology/index.d.ts +66 -1
- package/dist/astrology/index.js +42 -14
- package/dist/astrology/index.mjs +1 -1
- package/dist/{chunk-JBMCNKO4.mjs → chunk-2J6CVLH2.mjs} +5 -4
- package/dist/chunk-2J6CVLH2.mjs.map +1 -0
- package/dist/{chunk-FVEVTAM7.js → chunk-2WENLHIP.js} +4 -4
- package/dist/{chunk-FVEVTAM7.js.map → chunk-2WENLHIP.js.map} +1 -1
- package/dist/{chunk-X2SPWMUA.mjs → chunk-5ID55YUP.mjs} +3 -3
- package/dist/{chunk-X2SPWMUA.mjs.map → chunk-5ID55YUP.mjs.map} +1 -1
- package/dist/{chunk-A5ME4PFX.mjs → chunk-CYWQV2RL.mjs} +151 -4
- package/dist/chunk-CYWQV2RL.mjs.map +1 -0
- package/dist/{chunk-7AXRFYPX.js → chunk-IAKSKHGA.js} +157 -3
- package/dist/chunk-IAKSKHGA.js.map +1 -0
- package/dist/{chunk-KUH2YDQ2.js → chunk-T67M2WBD.js} +5 -4
- package/dist/chunk-T67M2WBD.js.map +1 -0
- package/dist/{chunk-KSKAKQTM.mjs → chunk-XSAXO3D2.mjs} +3 -3
- package/dist/{chunk-KSKAKQTM.mjs.map → chunk-XSAXO3D2.mjs.map} +1 -1
- package/dist/{chunk-U77YFJXJ.js → chunk-ZZ3YMT2R.js} +23 -23
- package/dist/{chunk-U77YFJXJ.js.map → chunk-ZZ3YMT2R.js.map} +1 -1
- package/dist/cli.js +303 -35
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +288 -20
- package/dist/cli.mjs.map +1 -1
- package/dist/core/index.js +38 -38
- package/dist/core/index.mjs +1 -1
- package/dist/gematria/index.js +5 -5
- package/dist/gematria/index.mjs +2 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +100 -72
- package/dist/index.mjs +4 -4
- package/dist/numerology/index.js +18 -18
- package/dist/numerology/index.mjs +3 -3
- package/package.json +1 -1
- package/dist/chunk-7AXRFYPX.js.map +0 -1
- package/dist/chunk-A5ME4PFX.mjs.map +0 -1
- package/dist/chunk-JBMCNKO4.mjs.map +0 -1
- package/dist/chunk-KUH2YDQ2.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunk3WVZRLPG_js = require('./chunk-3WVZRLPG.js');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
5
|
+
var chunk2WENLHIP_js = require('./chunk-2WENLHIP.js');
|
|
6
|
+
var chunkZZ3YMT2R_js = require('./chunk-ZZ3YMT2R.js');
|
|
7
|
+
var chunkT67M2WBD_js = require('./chunk-T67M2WBD.js');
|
|
8
8
|
var chunkG5BG73Y5_js = require('./chunk-G5BG73Y5.js');
|
|
9
9
|
var chunkFM7WUVZV_js = require('./chunk-FM7WUVZV.js');
|
|
10
10
|
require('dotenv/config');
|
|
@@ -90,10 +90,20 @@ var COMMANDS = [
|
|
|
90
90
|
},
|
|
91
91
|
{
|
|
92
92
|
name: "tarot:card",
|
|
93
|
-
description: "Look up a specific card
|
|
94
|
-
args: [{ name: "
|
|
93
|
+
description: "Look up a specific card by number or name",
|
|
94
|
+
args: [{ name: "query", type: "string", required: true, description: "Card number (1-78) or name (e.g. 'The Chariot', 'Two of Cups')" }],
|
|
95
95
|
flags: [],
|
|
96
|
-
examples: ["kaabalah tarot:card 7", "kaabalah tarot:card
|
|
96
|
+
examples: ["kaabalah tarot:card 7", 'kaabalah tarot:card "The Chariot" --json', "kaabalah tarot:card chariot --json"]
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: "tarot:spread",
|
|
100
|
+
description: "Look up multiple tarot cards by name or number",
|
|
101
|
+
args: [{ name: "cards", type: "string", required: true, description: "Card names or numbers, space-separated (quote multi-word names)" }],
|
|
102
|
+
flags: [],
|
|
103
|
+
examples: [
|
|
104
|
+
'kaabalah tarot:spread "Two of Cups" "The Chariot" 7',
|
|
105
|
+
`kaabalah tarot:spread --input-json='{"cards":["Two of Cups","The Chariot","7"]}'`
|
|
106
|
+
]
|
|
97
107
|
},
|
|
98
108
|
{
|
|
99
109
|
name: "ifa",
|
|
@@ -151,6 +161,28 @@ var COMMANDS = [
|
|
|
151
161
|
"kaabalah astrology 1990-01-15 --lat=40.7128 --lon=-74.006 --json"
|
|
152
162
|
]
|
|
153
163
|
},
|
|
164
|
+
{
|
|
165
|
+
name: "astrology:synastry",
|
|
166
|
+
description: "Calculate synastry (cross-chart aspects) between two birth charts",
|
|
167
|
+
args: [],
|
|
168
|
+
flags: [
|
|
169
|
+
{ name: "house-system", type: "string", default: "placidus", description: "House system for both charts" }
|
|
170
|
+
],
|
|
171
|
+
examples: [
|
|
172
|
+
`kaabalah astrology:synastry --input-json='{"chartA":{"date":"1990-01-15","time":"14:30","lat":40.71,"lon":-74},"chartB":{"date":"1992-06-20","time":"09:00","lat":51.5,"lon":-0.12}}' --json --compact`
|
|
173
|
+
]
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: "astrology:composite",
|
|
177
|
+
description: "Calculate midpoint composite chart from two birth charts",
|
|
178
|
+
args: [],
|
|
179
|
+
flags: [
|
|
180
|
+
{ name: "house-system", type: "string", default: "placidus", description: "House system for both charts" }
|
|
181
|
+
],
|
|
182
|
+
examples: [
|
|
183
|
+
`kaabalah astrology:composite --input-json='{"chartA":{"date":"1990-01-15","time":"14:30","lat":40.71,"lon":-74},"chartB":{"date":"1992-06-20","time":"09:00","lat":51.5,"lon":-0.12}}' --json --compact`
|
|
184
|
+
]
|
|
185
|
+
},
|
|
154
186
|
{
|
|
155
187
|
name: "help",
|
|
156
188
|
description: "Show help message",
|
|
@@ -438,7 +470,7 @@ function cmdGematria(text, flags) {
|
|
|
438
470
|
exitWithError("INVALID_ARGUMENT", `Text exceeds maximum length of ${MAX_TEXT_LENGTH} characters.`, flags);
|
|
439
471
|
}
|
|
440
472
|
const sanitized = sanitizeInput(text);
|
|
441
|
-
const result =
|
|
473
|
+
const result = chunkZZ3YMT2R_js.calculateGematria(sanitized, {
|
|
442
474
|
missing: getFlagBool(flags, "missing"),
|
|
443
475
|
percentages: getFlagBool(flags, "percentages")
|
|
444
476
|
});
|
|
@@ -481,7 +513,7 @@ function cmdReverseGematria(target, flags, inputPayload) {
|
|
|
481
513
|
let minLength = inputPayload?.minLength != null ? Number(inputPayload.minLength) : getFlagNumber(flags, "min-length") ?? 2;
|
|
482
514
|
let maxLength = inputPayload?.maxLength != null ? Number(inputPayload.maxLength) : getFlagNumber(flags, "max-length") ?? 6;
|
|
483
515
|
const includeDigraphs = inputPayload?.includeDigraphs != null ? Boolean(inputPayload.includeDigraphs) : getFlagBool(flags, "include-digraphs");
|
|
484
|
-
const result =
|
|
516
|
+
const result = chunkZZ3YMT2R_js.reverseGematria({
|
|
485
517
|
targetSynthesis: targetNum,
|
|
486
518
|
maxResults,
|
|
487
519
|
minLength,
|
|
@@ -504,12 +536,12 @@ Reverse Gematria: target synthesis = ${targetNum}
|
|
|
504
536
|
}
|
|
505
537
|
function cmdNumerology(dateStr, flags) {
|
|
506
538
|
const date = parseDate(dateStr, flags);
|
|
507
|
-
const kaabalistic =
|
|
508
|
-
const straight =
|
|
509
|
-
const challenges =
|
|
510
|
-
const energies =
|
|
511
|
-
const personalYear =
|
|
512
|
-
const fibonacci =
|
|
539
|
+
const kaabalistic = chunk2WENLHIP_js.calculateKaabalisticLifePath(date);
|
|
540
|
+
const straight = chunk2WENLHIP_js.calculateStraightAcrossReductionLifePath(date);
|
|
541
|
+
const challenges = chunk2WENLHIP_js.calculateChallenges(date);
|
|
542
|
+
const energies = chunk2WENLHIP_js.getDateEnergies(date);
|
|
543
|
+
const personalYear = chunk2WENLHIP_js.calculatePersonalYear(date);
|
|
544
|
+
const fibonacci = chunk2WENLHIP_js.calculateFibonacciCycle(date, /* @__PURE__ */ new Date());
|
|
513
545
|
if (isJsonMode(flags)) {
|
|
514
546
|
outputJson({ kaabalistic, straight, challenges, energies, personalYear, fibonacci }, flags);
|
|
515
547
|
return;
|
|
@@ -547,7 +579,7 @@ Numerology Profile: ${dateStr}
|
|
|
547
579
|
}
|
|
548
580
|
function cmdLifePath(dateStr, flags) {
|
|
549
581
|
const date = parseDate(dateStr, flags);
|
|
550
|
-
const result =
|
|
582
|
+
const result = chunk2WENLHIP_js.calculateKaabalisticLifePath(date);
|
|
551
583
|
if (isJsonMode(flags)) {
|
|
552
584
|
outputJson(result, flags);
|
|
553
585
|
return;
|
|
@@ -565,7 +597,7 @@ function cmdCycles(dateStr, firstName, flags) {
|
|
|
565
597
|
const date = parseDate(dateStr, flags);
|
|
566
598
|
const today = /* @__PURE__ */ new Date();
|
|
567
599
|
if (firstName) {
|
|
568
|
-
const result =
|
|
600
|
+
const result = chunk2WENLHIP_js.calculatePersonalCycles(date, today, firstName);
|
|
569
601
|
if (isJsonMode(flags)) {
|
|
570
602
|
outputJson(result, flags);
|
|
571
603
|
return;
|
|
@@ -594,7 +626,7 @@ Personal Cycles: ${dateStr} (${firstName})
|
|
|
594
626
|
console.log(` Month ${m.month}: ${m.value.reducedValue}${active}`);
|
|
595
627
|
}
|
|
596
628
|
} else {
|
|
597
|
-
const result =
|
|
629
|
+
const result = chunk2WENLHIP_js.calculateCycles(date, today);
|
|
598
630
|
if (isJsonMode(flags)) {
|
|
599
631
|
outputJson(result, flags);
|
|
600
632
|
return;
|
|
@@ -630,7 +662,7 @@ Heptad Cycles: ${dateStr}
|
|
|
630
662
|
}
|
|
631
663
|
function cmdChallenges(dateStr, flags) {
|
|
632
664
|
const date = parseDate(dateStr, flags);
|
|
633
|
-
const result =
|
|
665
|
+
const result = chunk2WENLHIP_js.calculateChallenges(date);
|
|
634
666
|
if (isJsonMode(flags)) {
|
|
635
667
|
outputJson(result, flags);
|
|
636
668
|
return;
|
|
@@ -648,7 +680,7 @@ Challenges: ${dateStr}
|
|
|
648
680
|
}
|
|
649
681
|
function cmdFibonacci(dateStr, flags) {
|
|
650
682
|
const date = parseDate(dateStr, flags);
|
|
651
|
-
const result =
|
|
683
|
+
const result = chunk2WENLHIP_js.calculateFibonacciCycle(date, /* @__PURE__ */ new Date());
|
|
652
684
|
if (isJsonMode(flags)) {
|
|
653
685
|
outputJson(result, flags);
|
|
654
686
|
return;
|
|
@@ -690,16 +722,19 @@ Tarot Draw: ${count} card${count > 1 ? "s" : ""}
|
|
|
690
722
|
console.log();
|
|
691
723
|
}
|
|
692
724
|
}
|
|
693
|
-
function
|
|
694
|
-
const num = parseInt(
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
725
|
+
function findCardsByQuery(query) {
|
|
726
|
+
const num = parseInt(query, 10);
|
|
727
|
+
if (!isNaN(num)) {
|
|
728
|
+
const card = chunkG5BG73Y5_js.ARKANNUS.find((c) => c.number === num);
|
|
729
|
+
return card ? { cards: [card], exact: true } : { cards: [], exact: false };
|
|
730
|
+
}
|
|
731
|
+
const q = query.toLowerCase();
|
|
732
|
+
const exactMatch = chunkG5BG73Y5_js.ARKANNUS.find((c) => c.tarotCard.toLowerCase() === q);
|
|
733
|
+
if (exactMatch) return { cards: [exactMatch], exact: true };
|
|
734
|
+
const substringMatches = chunkG5BG73Y5_js.ARKANNUS.filter((c) => c.tarotCard.toLowerCase().includes(q));
|
|
735
|
+
return { cards: substringMatches, exact: false };
|
|
736
|
+
}
|
|
737
|
+
function printCard(card) {
|
|
703
738
|
console.log(`
|
|
704
739
|
#${String(card.number).padStart(2, "0")} ${card.tarotCard}`);
|
|
705
740
|
console.log(` Type: ${card.type} | Suit: ${card.suit ?? "major"} | Deck: ${card.deck}`);
|
|
@@ -708,6 +743,44 @@ function cmdTarotCard(numberStr, flags) {
|
|
|
708
743
|
if (card.papusMeaning) console.log(` Papus: ${card.papusMeaning}`);
|
|
709
744
|
console.log();
|
|
710
745
|
}
|
|
746
|
+
function cmdTarotCard(query, flags) {
|
|
747
|
+
const { cards } = findCardsByQuery(query);
|
|
748
|
+
if (cards.length === 0) {
|
|
749
|
+
exitWithError("CARD_NOT_FOUND", `No card found for "${query}". Use a number (1-78) or card name.`, flags);
|
|
750
|
+
}
|
|
751
|
+
if (isJsonMode(flags)) {
|
|
752
|
+
outputJson(cards.length === 1 ? cards[0] : cards, flags);
|
|
753
|
+
return;
|
|
754
|
+
}
|
|
755
|
+
for (const card of cards) {
|
|
756
|
+
printCard(card);
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
function cmdTarotSpread(cardQueries, flags) {
|
|
760
|
+
const results = [];
|
|
761
|
+
for (const q of cardQueries) {
|
|
762
|
+
const { cards } = findCardsByQuery(q);
|
|
763
|
+
if (cards.length === 0) {
|
|
764
|
+
results.push({ query: q, error: true, code: "CARD_NOT_FOUND", message: `No card found for "${q}".` });
|
|
765
|
+
} else if (cards.length === 1) {
|
|
766
|
+
results.push(cards[0]);
|
|
767
|
+
} else {
|
|
768
|
+
results.push(...cards);
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
if (isJsonMode(flags)) {
|
|
772
|
+
outputJson(results, flags);
|
|
773
|
+
return;
|
|
774
|
+
}
|
|
775
|
+
for (const item of results) {
|
|
776
|
+
if ("error" in item && item.error) {
|
|
777
|
+
console.log(`
|
|
778
|
+
\u2717 "${item.query}": ${item.message}`);
|
|
779
|
+
} else {
|
|
780
|
+
printCard(item);
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
}
|
|
711
784
|
function cmdIfa(dateStr, flags) {
|
|
712
785
|
const date = parseDate(dateStr, flags);
|
|
713
786
|
const result = chunk3WVZRLPG_js.calculateOdu(date);
|
|
@@ -728,7 +801,7 @@ Odu: ${dateStr}
|
|
|
728
801
|
console.log();
|
|
729
802
|
}
|
|
730
803
|
function getTree() {
|
|
731
|
-
return
|
|
804
|
+
return chunkT67M2WBD_js.createTree({ system: chunkT67M2WBD_js.SYSTEM, parts: ["westernAstrology", "tarot"] });
|
|
732
805
|
}
|
|
733
806
|
function serializeNode(n) {
|
|
734
807
|
const result = { id: n.id, type: n.type };
|
|
@@ -762,11 +835,11 @@ function cmdTree(flags) {
|
|
|
762
835
|
}
|
|
763
836
|
}
|
|
764
837
|
}
|
|
765
|
-
outputJson({ system:
|
|
838
|
+
outputJson({ system: chunkT67M2WBD_js.SYSTEM, totalNodes: allNodes.length, totalEdges: edges.length, nodes, edges }, flags);
|
|
766
839
|
return;
|
|
767
840
|
}
|
|
768
841
|
console.log(`
|
|
769
|
-
Tree of Life (${
|
|
842
|
+
Tree of Life (${chunkT67M2WBD_js.SYSTEM})
|
|
770
843
|
`);
|
|
771
844
|
console.log(` Total nodes: ${allNodes.length}`);
|
|
772
845
|
const byType = /* @__PURE__ */ new Map();
|
|
@@ -854,6 +927,187 @@ Node types (${Object.keys(counts).length}):
|
|
|
854
927
|
}
|
|
855
928
|
console.log();
|
|
856
929
|
}
|
|
930
|
+
function parseChartInput(input, label, flags) {
|
|
931
|
+
const dateStr = input.date;
|
|
932
|
+
if (!dateStr) {
|
|
933
|
+
exitWithError("MISSING_ARGUMENT", `${label}: "date" is required (YYYY-MM-DD).`, flags);
|
|
934
|
+
}
|
|
935
|
+
parseDate(dateStr, flags);
|
|
936
|
+
const timeStr = input.time ?? "12:00";
|
|
937
|
+
const timeMatch = timeStr.match(/^(\d{1,2}):(\d{2})$/);
|
|
938
|
+
if (!timeMatch) {
|
|
939
|
+
exitWithError("INVALID_ARGUMENT", `${label}: Invalid time format "${timeStr}". Use HH:MM.`, flags);
|
|
940
|
+
}
|
|
941
|
+
const hour = parseInt(timeMatch[1], 10);
|
|
942
|
+
const minute = parseInt(timeMatch[2], 10);
|
|
943
|
+
if (hour < 0 || hour > 23 || minute < 0 || minute > 59) {
|
|
944
|
+
exitWithError("INVALID_ARGUMENT", `${label}: Invalid time "${timeStr}". Hours 0-23, minutes 0-59.`, flags);
|
|
945
|
+
}
|
|
946
|
+
const latitude = input.lat != null ? Number(input.lat) : void 0;
|
|
947
|
+
const longitude = input.lon != null ? Number(input.lon) : void 0;
|
|
948
|
+
if (latitude == null || longitude == null) {
|
|
949
|
+
exitWithError("MISSING_ARGUMENT", `${label}: "lat" and "lon" are required.`, flags);
|
|
950
|
+
}
|
|
951
|
+
if (latitude < -90 || latitude > 90) {
|
|
952
|
+
exitWithError("INVALID_ARGUMENT", `${label}: Latitude must be between -90 and 90, got ${latitude}.`, flags);
|
|
953
|
+
}
|
|
954
|
+
if (longitude < -180 || longitude > 180) {
|
|
955
|
+
exitWithError("INVALID_ARGUMENT", `${label}: Longitude must be between -180 and 180, got ${longitude}.`, flags);
|
|
956
|
+
}
|
|
957
|
+
const houseSystem = input.houseSystem ?? "placidus";
|
|
958
|
+
const houseSystemCode = HOUSE_SYSTEM_MAP[houseSystem.toLowerCase()];
|
|
959
|
+
if (!houseSystemCode) {
|
|
960
|
+
exitWithError("INVALID_ARGUMENT", `${label}: Unknown house system "${houseSystem}". Valid: ${Object.keys(HOUSE_SYSTEM_MAP).join(", ")}`, flags);
|
|
961
|
+
}
|
|
962
|
+
const timezoneStr = input.timezone;
|
|
963
|
+
const timeZoneSettings = {};
|
|
964
|
+
if (timezoneStr) {
|
|
965
|
+
timeZoneSettings.timeZone = timezoneStr;
|
|
966
|
+
} else {
|
|
967
|
+
timeZoneSettings.autoTimeZone = true;
|
|
968
|
+
}
|
|
969
|
+
const dateParts = dateStr.match(/^(\d{4})-(\d{2})-(\d{2})$/);
|
|
970
|
+
const birthDate = new Date(
|
|
971
|
+
parseInt(dateParts[1], 10),
|
|
972
|
+
parseInt(dateParts[2], 10) - 1,
|
|
973
|
+
parseInt(dateParts[3], 10),
|
|
974
|
+
hour,
|
|
975
|
+
minute,
|
|
976
|
+
0
|
|
977
|
+
);
|
|
978
|
+
return { birthDate, latitude, longitude, houseSystem, houseSystemCode, timeZoneSettings, dateStr, timeStr };
|
|
979
|
+
}
|
|
980
|
+
async function initWasm() {
|
|
981
|
+
const path = chunkFM7WUVZV_js.__require("path");
|
|
982
|
+
const wasmPath = path.resolve(__dirname, "../wasm/build/swisseph.node.wasm");
|
|
983
|
+
const ephePath = path.resolve(__dirname, "../ephe");
|
|
984
|
+
const { getSwissEph } = await import('./astrology/index.js');
|
|
985
|
+
await getSwissEph({ wasmPath, ephePath });
|
|
986
|
+
}
|
|
987
|
+
async function cmdAstrologySynastry(flags, inputPayload) {
|
|
988
|
+
if (!inputPayload?.chartA || !inputPayload?.chartB) {
|
|
989
|
+
exitWithError("MISSING_ARGUMENT", `Usage: kaabalah astrology:synastry --input-json='{"chartA":{...},"chartB":{...}}'`, flags);
|
|
990
|
+
}
|
|
991
|
+
const chartAInput = parseChartInput(inputPayload.chartA, "chartA", flags);
|
|
992
|
+
const chartBInput = parseChartInput(inputPayload.chartB, "chartB", flags);
|
|
993
|
+
const { getSynastryChart, closeSwissEph, HouseSystem } = await import('./astrology/index.js');
|
|
994
|
+
try {
|
|
995
|
+
await initWasm();
|
|
996
|
+
} catch (err) {
|
|
997
|
+
exitWithError("WASM_INIT_ERROR", `Failed to initialize Swiss Ephemeris: ${err instanceof Error ? err.message : String(err)}`, flags);
|
|
998
|
+
}
|
|
999
|
+
try {
|
|
1000
|
+
const result = await getSynastryChart({
|
|
1001
|
+
chartA: {
|
|
1002
|
+
date: chartAInput.birthDate,
|
|
1003
|
+
latitude: chartAInput.latitude,
|
|
1004
|
+
longitude: chartAInput.longitude,
|
|
1005
|
+
houseSystem: chartAInput.houseSystemCode,
|
|
1006
|
+
timeZoneSettings: chartAInput.timeZoneSettings
|
|
1007
|
+
},
|
|
1008
|
+
chartB: {
|
|
1009
|
+
date: chartBInput.birthDate,
|
|
1010
|
+
latitude: chartBInput.latitude,
|
|
1011
|
+
longitude: chartBInput.longitude,
|
|
1012
|
+
houseSystem: chartBInput.houseSystemCode,
|
|
1013
|
+
timeZoneSettings: chartBInput.timeZoneSettings
|
|
1014
|
+
},
|
|
1015
|
+
aspectSpecs: inputPayload.aspectSpecs
|
|
1016
|
+
});
|
|
1017
|
+
if (isJsonMode(flags)) {
|
|
1018
|
+
outputJson({
|
|
1019
|
+
...result,
|
|
1020
|
+
input: {
|
|
1021
|
+
chartA: { date: chartAInput.dateStr, time: chartAInput.timeStr, lat: chartAInput.latitude, lon: chartAInput.longitude, houseSystem: chartAInput.houseSystem },
|
|
1022
|
+
chartB: { date: chartBInput.dateStr, time: chartBInput.timeStr, lat: chartBInput.latitude, lon: chartBInput.longitude, houseSystem: chartBInput.houseSystem }
|
|
1023
|
+
}
|
|
1024
|
+
}, flags);
|
|
1025
|
+
} else {
|
|
1026
|
+
console.log(`
|
|
1027
|
+
Synastry Chart
|
|
1028
|
+
`);
|
|
1029
|
+
console.log(` Chart A: ${chartAInput.dateStr} ${chartAInput.timeStr} (${chartAInput.latitude}, ${chartAInput.longitude})`);
|
|
1030
|
+
console.log(` Chart B: ${chartBInput.dateStr} ${chartBInput.timeStr} (${chartBInput.latitude}, ${chartBInput.longitude})`);
|
|
1031
|
+
console.log(`
|
|
1032
|
+
Cross-chart Aspects (${result.aspects.length}):
|
|
1033
|
+
`);
|
|
1034
|
+
for (const a of result.aspects) {
|
|
1035
|
+
console.log(` ${a.planetA.padEnd(14)} ${a.aspect.padEnd(12)} ${a.planetB.padEnd(14)} orb ${a.orb.toFixed(2)}\xB0`);
|
|
1036
|
+
}
|
|
1037
|
+
console.log();
|
|
1038
|
+
}
|
|
1039
|
+
} finally {
|
|
1040
|
+
closeSwissEph();
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
async function cmdAstrologyComposite(flags, inputPayload) {
|
|
1044
|
+
if (!inputPayload?.chartA || !inputPayload?.chartB) {
|
|
1045
|
+
exitWithError("MISSING_ARGUMENT", `Usage: kaabalah astrology:composite --input-json='{"chartA":{...},"chartB":{...}}'`, flags);
|
|
1046
|
+
}
|
|
1047
|
+
const chartAInput = parseChartInput(inputPayload.chartA, "chartA", flags);
|
|
1048
|
+
const chartBInput = parseChartInput(inputPayload.chartB, "chartB", flags);
|
|
1049
|
+
const { getCompositeChart, closeSwissEph, HouseSystem } = await import('./astrology/index.js');
|
|
1050
|
+
try {
|
|
1051
|
+
await initWasm();
|
|
1052
|
+
} catch (err) {
|
|
1053
|
+
exitWithError("WASM_INIT_ERROR", `Failed to initialize Swiss Ephemeris: ${err instanceof Error ? err.message : String(err)}`, flags);
|
|
1054
|
+
}
|
|
1055
|
+
try {
|
|
1056
|
+
const result = await getCompositeChart({
|
|
1057
|
+
chartA: {
|
|
1058
|
+
date: chartAInput.birthDate,
|
|
1059
|
+
latitude: chartAInput.latitude,
|
|
1060
|
+
longitude: chartAInput.longitude,
|
|
1061
|
+
houseSystem: chartAInput.houseSystemCode,
|
|
1062
|
+
timeZoneSettings: chartAInput.timeZoneSettings
|
|
1063
|
+
},
|
|
1064
|
+
chartB: {
|
|
1065
|
+
date: chartBInput.birthDate,
|
|
1066
|
+
latitude: chartBInput.latitude,
|
|
1067
|
+
longitude: chartBInput.longitude,
|
|
1068
|
+
houseSystem: chartBInput.houseSystemCode,
|
|
1069
|
+
timeZoneSettings: chartBInput.timeZoneSettings
|
|
1070
|
+
},
|
|
1071
|
+
aspectSpecs: inputPayload.aspectSpecs
|
|
1072
|
+
});
|
|
1073
|
+
if (isJsonMode(flags)) {
|
|
1074
|
+
outputJson({
|
|
1075
|
+
...result,
|
|
1076
|
+
input: {
|
|
1077
|
+
chartA: { date: chartAInput.dateStr, time: chartAInput.timeStr, lat: chartAInput.latitude, lon: chartAInput.longitude, houseSystem: chartAInput.houseSystem },
|
|
1078
|
+
chartB: { date: chartBInput.dateStr, time: chartBInput.timeStr, lat: chartBInput.latitude, lon: chartBInput.longitude, houseSystem: chartBInput.houseSystem }
|
|
1079
|
+
}
|
|
1080
|
+
}, flags);
|
|
1081
|
+
} else {
|
|
1082
|
+
console.log(`
|
|
1083
|
+
Composite Chart (Midpoint Method)
|
|
1084
|
+
`);
|
|
1085
|
+
console.log(` Chart A: ${chartAInput.dateStr} ${chartAInput.timeStr} (${chartAInput.latitude}, ${chartAInput.longitude})`);
|
|
1086
|
+
console.log(` Chart B: ${chartBInput.dateStr} ${chartBInput.timeStr} (${chartBInput.latitude}, ${chartBInput.longitude})`);
|
|
1087
|
+
console.log(`
|
|
1088
|
+
Composite Planets:`);
|
|
1089
|
+
for (const [name, planet] of Object.entries(result.compositePlanets)) {
|
|
1090
|
+
const zp = planet.zodiacPosition;
|
|
1091
|
+
console.log(` ${name.padEnd(14)} ${zp.sign.padEnd(12)} ${zp.traditionalFormat.padEnd(8)} House ${zp.house}`);
|
|
1092
|
+
}
|
|
1093
|
+
console.log(`
|
|
1094
|
+
Composite House Cusps:`);
|
|
1095
|
+
for (let i = 0; i < result.compositeHouses.length; i++) {
|
|
1096
|
+
const h = result.compositeHouses[i];
|
|
1097
|
+
console.log(` House ${String(i + 1).padStart(2)}: ${h.sign.padEnd(12)} ${h.traditionalFormat}`);
|
|
1098
|
+
}
|
|
1099
|
+
console.log(`
|
|
1100
|
+
Composite Aspects (${result.aspects.length}):
|
|
1101
|
+
`);
|
|
1102
|
+
for (const a of result.aspects) {
|
|
1103
|
+
console.log(` ${a.planetA.padEnd(14)} ${a.aspect.padEnd(12)} ${a.planetB.padEnd(14)} orb ${a.orb.toFixed(2)}\xB0`);
|
|
1104
|
+
}
|
|
1105
|
+
console.log();
|
|
1106
|
+
}
|
|
1107
|
+
} finally {
|
|
1108
|
+
closeSwissEph();
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
857
1111
|
async function cmdAstrology(args, flags, inputPayload) {
|
|
858
1112
|
const dateStr = inputPayload?.date ?? args[0];
|
|
859
1113
|
if (!dateStr) {
|
|
@@ -1068,11 +1322,19 @@ async function main() {
|
|
|
1068
1322
|
await cmdTarot(inputPayload?.count ?? args[1], flags);
|
|
1069
1323
|
break;
|
|
1070
1324
|
case "tarot:card":
|
|
1071
|
-
if (!args[1] && inputPayload?.
|
|
1072
|
-
exitWithError("MISSING_ARGUMENT", "Usage: kaabalah tarot:card <
|
|
1325
|
+
if (!args[1] && inputPayload?.query == null) {
|
|
1326
|
+
exitWithError("MISSING_ARGUMENT", "Usage: kaabalah tarot:card <query>", flags);
|
|
1327
|
+
}
|
|
1328
|
+
cmdTarotCard((inputPayload?.query != null ? String(inputPayload.query) : void 0) ?? args.slice(1).join(" "), flags);
|
|
1329
|
+
break;
|
|
1330
|
+
case "tarot:spread": {
|
|
1331
|
+
const cardQueries = Array.isArray(inputPayload?.cards) ? inputPayload.cards.map(String) : args.slice(1);
|
|
1332
|
+
if (cardQueries.length === 0) {
|
|
1333
|
+
exitWithError("MISSING_ARGUMENT", "Usage: kaabalah tarot:spread <card1> [card2] ...", flags);
|
|
1073
1334
|
}
|
|
1074
|
-
|
|
1335
|
+
cmdTarotSpread(cardQueries, flags);
|
|
1075
1336
|
break;
|
|
1337
|
+
}
|
|
1076
1338
|
case "ifa":
|
|
1077
1339
|
if (!args[1] && !inputPayload?.date) {
|
|
1078
1340
|
exitWithError("MISSING_ARGUMENT", "Usage: kaabalah ifa <YYYY-MM-DD>", flags);
|
|
@@ -1094,6 +1356,12 @@ async function main() {
|
|
|
1094
1356
|
case "astrology":
|
|
1095
1357
|
await cmdAstrology(args.slice(1), flags, inputPayload);
|
|
1096
1358
|
break;
|
|
1359
|
+
case "astrology:synastry":
|
|
1360
|
+
await cmdAstrologySynastry(flags, inputPayload);
|
|
1361
|
+
break;
|
|
1362
|
+
case "astrology:composite":
|
|
1363
|
+
await cmdAstrologyComposite(flags, inputPayload);
|
|
1364
|
+
break;
|
|
1097
1365
|
case "--version":
|
|
1098
1366
|
if (isJsonMode(flags)) {
|
|
1099
1367
|
outputJson({ version: VERSION }, flags);
|