caelus-mcp 0.6.0 → 0.8.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/dist/src/server.js +61 -1
- package/package.json +2 -2
package/dist/src/server.js
CHANGED
|
@@ -17,7 +17,7 @@ import { dirname, join } from "node:path";
|
|
|
17
17
|
import { fileURLToPath } from "node:url";
|
|
18
18
|
import { createRequire } from "node:module";
|
|
19
19
|
import { realpathSync } from "node:fs";
|
|
20
|
-
import { Engine, BODIES, julianDay, mod, riseSet, crossings, lunarPhases, stations, lunarEclipses, solarEclipses, } from "caelus";
|
|
20
|
+
import { Engine, BODIES, julianDay, mod, riseSet, crossings, lunarPhases, stations, lunarEclipses, solarEclipses, ASPECTS, DEFAULT_ORBS, SIGNS as SIGN_NAMES, dignities, } from "caelus";
|
|
21
21
|
import { loadNodeData } from "caelus/node";
|
|
22
22
|
const require = createRequire(import.meta.url);
|
|
23
23
|
const VERSION = require("caelus-mcp/package.json").version;
|
|
@@ -50,6 +50,25 @@ const ZODIACS = [
|
|
|
50
50
|
];
|
|
51
51
|
const zodiacSchema = z.enum(ZODIACS).default("tropical")
|
|
52
52
|
.describe("tropical (default) or sidereal:<ayanamsa>");
|
|
53
|
+
// ----------------------------------------------------- resource payloads
|
|
54
|
+
const ACCURACY = (() => {
|
|
55
|
+
const swiss = require("caelus/accuracy.json");
|
|
56
|
+
let jpl = null;
|
|
57
|
+
try {
|
|
58
|
+
jpl = require(join(dirname(require.resolve("caelus/package.json")), "horizons-accuracy.json"));
|
|
59
|
+
}
|
|
60
|
+
catch { /* optional, ships with the repo but maybe not the tarball */ }
|
|
61
|
+
return { swiss, jpl };
|
|
62
|
+
})();
|
|
63
|
+
const TRADITIONAL = ["sun", "moon", "mercury", "venus", "mars", "jupiter", "saturn"];
|
|
64
|
+
const GLOSSARY = {
|
|
65
|
+
aspects: Object.fromEntries(Object.entries(ASPECTS).map(([k, deg]) => [k, { degrees: deg, default_orb: DEFAULT_ORBS[k] ?? null }])),
|
|
66
|
+
signs: SIGN_NAMES,
|
|
67
|
+
bodies: BODIES,
|
|
68
|
+
house_systems: HOUSE_SYSTEMS,
|
|
69
|
+
dignities: Object.fromEntries(TRADITIONAL.map((b) => [b, Object.fromEntries(SIGN_NAMES.map((s, i) => [s, dignities(b, i)])
|
|
70
|
+
.filter(([, d]) => d.length))])),
|
|
71
|
+
};
|
|
53
72
|
function jdFromIso(iso) {
|
|
54
73
|
const d = new Date(iso);
|
|
55
74
|
if (Number.isNaN(d.getTime()))
|
|
@@ -424,6 +443,47 @@ export function buildServer() {
|
|
|
424
443
|
events.sort((a, b) => a.t.localeCompare(b.t));
|
|
425
444
|
return text({ start, end, events });
|
|
426
445
|
});
|
|
446
|
+
// --------------------------------------------------------- resources
|
|
447
|
+
server.registerResource("accuracy", "caelus://accuracy", {
|
|
448
|
+
title: "Validation table",
|
|
449
|
+
description: "Per-body accuracy: vs Swiss Ephemeris (swiss) and JPL Horizons apparent positions (jpl).",
|
|
450
|
+
mimeType: "application/json",
|
|
451
|
+
}, async (uri) => ({
|
|
452
|
+
contents: [{ uri: uri.href, mimeType: "application/json", text: JSON.stringify(ACCURACY) }],
|
|
453
|
+
}));
|
|
454
|
+
server.registerResource("glossary", "caelus://glossary", {
|
|
455
|
+
title: "Glossary",
|
|
456
|
+
description: "Machine-readable definitions: aspect angles and default orbs, signs, bodies, the twelve house systems, and essential dignities (domicile/exaltation/detriment/fall).",
|
|
457
|
+
mimeType: "application/json",
|
|
458
|
+
}, async (uri) => ({
|
|
459
|
+
contents: [{ uri: uri.href, mimeType: "application/json", text: JSON.stringify(GLOSSARY) }],
|
|
460
|
+
}));
|
|
461
|
+
// --------------------------------------------------------- prompts
|
|
462
|
+
server.registerPrompt("rectification_session", {
|
|
463
|
+
title: "Birth-time rectification",
|
|
464
|
+
description: "Guide a birth-time rectification: sweep candidate ascendants across the day, then test them against dated life events.",
|
|
465
|
+
argsSchema: {
|
|
466
|
+
date: z.string().describe("Approximate birth DATE, UTC ISO (the time is what we are solving for)"),
|
|
467
|
+
lat: z.string().describe("Birth latitude, north positive"),
|
|
468
|
+
lon: z.string().describe("Birth longitude, EAST positive"),
|
|
469
|
+
events: z.string().optional().describe("Known life events, one per line: 'YYYY-MM-DD: description'"),
|
|
470
|
+
},
|
|
471
|
+
}, ({ date, lat, lon, events }) => ({
|
|
472
|
+
messages: [{
|
|
473
|
+
role: "user",
|
|
474
|
+
content: {
|
|
475
|
+
type: "text",
|
|
476
|
+
text: `Help rectify an uncertain birth time.\n\n`
|
|
477
|
+
+ `Approximate birth: ${date} at lat ${lat}, lon ${lon}. The clock time is unknown.\n`
|
|
478
|
+
+ (events ? `Dated life events:\n${events}\n\n` : "\n")
|
|
479
|
+
+ `Procedure:\n`
|
|
480
|
+
+ `1. Call rectification_grid(date, lat, lon, step_minutes: 15) to get the Ascendant and MC through the day and the times the Ascendant changes sign. Each segment is a candidate window.\n`
|
|
481
|
+
+ `2. For each dated event, call find_aspect_dates and/or sky_events to find the exact transits active on that date.\n`
|
|
482
|
+
+ `3. Prefer the candidate windows whose angles (Ascendant, MC) are triggered by those transits. Narrow to the best window, propose a birth time, and state the supporting evidence and the remaining uncertainty.\n`
|
|
483
|
+
+ `Use the chart tools for all computation; do not invent positions.`,
|
|
484
|
+
},
|
|
485
|
+
}],
|
|
486
|
+
}));
|
|
427
487
|
return server;
|
|
428
488
|
}
|
|
429
489
|
// ---------------------------------------------------------------- main
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "caelus-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "MCP server for caelus chart computation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
16
16
|
"zod": "^3.24.0",
|
|
17
|
-
"caelus": "^0.
|
|
17
|
+
"caelus": "^0.8.0"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"ajv": "^8.17.1"
|