klio 1.4.5 → 1.4.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "klio",
3
- "version": "1.4.5",
3
+ "version": "1.4.6",
4
4
  "description": "A CLI for astrological calculations",
5
5
  "main": "src/main.js",
6
6
  "bin": {
@@ -281,6 +281,39 @@ function calculateHouses(julianDay, houseSystem = 'K', useBirthLocation = false)
281
281
  });
282
282
  }
283
283
 
284
+ // Function to calculate astrological angles from house cusps
285
+ function calculateAstrologicalAngles(houseCusps) {
286
+ // House cusps are in houseCusps[0] to houseCusps[11]
287
+ // In most house systems:
288
+ // ASC (Ascendant) = House 1 cusp (index 0)
289
+ // MC (Medium Coeli/Midheaven) = House 10 cusp (index 9)
290
+ // DESC (Descendant) = House 7 cusp (index 6)
291
+ // IC (Imum Coeli) = House 4 cusp (index 3)
292
+
293
+ return {
294
+ asc: houseCusps[0], // Ascendant
295
+ mc: houseCusps[9], // Medium Coeli (Midheaven)
296
+ desc: houseCusps[6], // Descendant
297
+ ic: houseCusps[3] // Imum Coeli
298
+ };
299
+ }
300
+
301
+ // Function to convert longitude to sign and degree
302
+ function longitudeToSignDegree(longitude) {
303
+ // Normalize longitude to 0-360 range
304
+ longitude = longitude % 360;
305
+ if (longitude < 0) longitude += 360;
306
+
307
+ // Calculate sign (0-11) and degree within sign (0-30)
308
+ const signIndex = Math.floor(longitude / 30);
309
+ const degreeInSign = longitude % 30;
310
+
311
+ return {
312
+ sign: signs[signIndex],
313
+ degree: degreeInSign.toFixed(2)
314
+ };
315
+ }
316
+
284
317
  // Function to determine the house for a planet
285
318
  function getPlanetHouse(planetLongitude, houseCusps) {
286
319
  // Normalize planet longitude to 0-360 range
@@ -2745,5 +2778,7 @@ module.exports = {
2745
2778
  calculateAspectStatistics,
2746
2779
  calculatePlanetComboAspects,
2747
2780
  showPlanetComboAspects,
2748
- calculateNextPlanetIngress
2781
+ calculateNextPlanetIngress,
2782
+ calculateAstrologicalAngles,
2783
+ longitudeToSignDegree
2749
2784
  };
package/src/cli/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  const { Command } = require('commander');
2
2
  const { planets, signs } = require('../astrology/astrologyConstants');
3
3
  const { showRetrogradePlanets } = require('../astrology/retrogradeService');
4
- const { getCurrentTimeInTimezone, showAspectFigures, analyzeElementDistribution, getTimezoneOffset, calculateJulianDayUTC, calculateHouses, getAstrologicalData, getPlanetHouse, showPlanetAspects, calculatePlanetAspects, getAllActiveAspects, showAllActiveAspects, getBirthDataFromConfig, getPersonDataFromConfig, detectAspectFigures, calculatePersonalTransits, showPersonalTransitAspects, showCombinedAnalysis, calculatePersonalTransitAspects, determineAspectPhase, findExactAspectTime, findLastExactAspectTime, getAspectAngle, getFutureAspects, getPastAspects, analyzeCSVWithDatetime, analyzeHouseDistributionSignificance, analyzeAspectDistributionSignificance, analyzeSignDistributionSignificance, calculateAspectStatistics, calculatePlanetComboAspects, showPlanetComboAspects, getCriticalPlanets, getHouseSystemCode, calculateNextPlanetIngress } = require('../astrology/astrologyService');
4
+ const { getCurrentTimeInTimezone, showAspectFigures, analyzeElementDistribution, getTimezoneOffset, calculateJulianDayUTC, calculateHouses, getAstrologicalData, getPlanetHouse, showPlanetAspects, calculatePlanetAspects, getAllActiveAspects, showAllActiveAspects, getBirthDataFromConfig, getPersonDataFromConfig, detectAspectFigures, calculatePersonalTransits, showPersonalTransitAspects, showCombinedAnalysis, calculatePersonalTransitAspects, determineAspectPhase, findExactAspectTime, findLastExactAspectTime, getAspectAngle, getFutureAspects, getPastAspects, analyzeCSVWithDatetime, analyzeHouseDistributionSignificance, analyzeAspectDistributionSignificance, analyzeSignDistributionSignificance, calculateAspectStatistics, calculatePlanetComboAspects, showPlanetComboAspects, getCriticalPlanets, getHouseSystemCode, calculateNextPlanetIngress, calculateAstrologicalAngles, longitudeToSignDegree } = require('../astrology/astrologyService');
5
5
  const { performSetup, showConfigStatus, loadConfig, setAIModel, askAIModel, setPerson1, setPerson2, setPerson, getPersonData, listPeople, deletePerson } = require('../config/configService');
6
6
  const { parseAppleHealthXML } = require('../health/healthService');
7
7
  const { analyzeStepsByPlanetSign, analyzeStressByPlanetAspects, analyzePlanetAspectsForSleep } = require('../health/healthAnalysis');
@@ -1394,6 +1394,34 @@ program
1394
1394
 
1395
1395
  console.log('================================================================================');
1396
1396
 
1397
+ // Show astrological angles if houses were calculated
1398
+ if (houses) {
1399
+ console.log('\nAstrological Angles:');
1400
+ console.log('================================================================================');
1401
+ console.log('| Angle | Sign | Degree |');
1402
+ console.log('================================================================================');
1403
+
1404
+ const angles = calculateAstrologicalAngles(houses.house);
1405
+
1406
+ // ASC (Ascendant)
1407
+ const ascData = longitudeToSignDegree(angles.asc);
1408
+ console.log(`| ASC | ${ascData.sign.padEnd(10)} | ${ascData.degree.padEnd(6)}° |`);
1409
+
1410
+ // MC (Medium Coeli/Midheaven)
1411
+ const mcData = longitudeToSignDegree(angles.mc);
1412
+ console.log(`| MC | ${mcData.sign.padEnd(10)} | ${mcData.degree.padEnd(6)}° |`);
1413
+
1414
+ // DESC (Descendant)
1415
+ const descData = longitudeToSignDegree(angles.desc);
1416
+ console.log(`| DESC | ${descData.sign.padEnd(10)} | ${descData.degree.padEnd(6)}° |`);
1417
+
1418
+ // IC (Imum Coeli)
1419
+ const icData = longitudeToSignDegree(angles.ic);
1420
+ console.log(`| IC | ${icData.sign.padEnd(10)} | ${icData.degree.padEnd(6)}° |`);
1421
+
1422
+ console.log('================================================================================');
1423
+ }
1424
+
1397
1425
  if (birthData) {
1398
1426
  if (useNatalPositions) {
1399
1427
  console.log('\nThis analysis shows your natal planet positions.');
@@ -1430,6 +1458,18 @@ program
1430
1458
  };
1431
1459
  }
1432
1460
 
1461
+ // Add astrological angles to AI data if houses were calculated
1462
+ let anglesData = null;
1463
+ if (houses) {
1464
+ const angles = calculateAstrologicalAngles(houses.house);
1465
+ anglesData = {
1466
+ asc: longitudeToSignDegree(angles.asc),
1467
+ mc: longitudeToSignDegree(angles.mc),
1468
+ desc: longitudeToSignDegree(angles.desc),
1469
+ ic: longitudeToSignDegree(angles.ic)
1470
+ };
1471
+ }
1472
+
1433
1473
  const aiData = {
1434
1474
  planet: 'alle',
1435
1475
  sign: 'Multiple',
@@ -1438,7 +1478,8 @@ program
1438
1478
  element: 'Multiple',
1439
1479
  decan: 'Multiple',
1440
1480
  allPlanetData: allPlanetData,
1441
- houseSystem: houseSystem
1481
+ houseSystem: houseSystem,
1482
+ astrologicalAngles: anglesData
1442
1483
  };
1443
1484
 
1444
1485
  await askAIModel(actualOptions.p, aiData);