@interstellar-tools/mcp 1.1.0 → 1.2.1
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 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +4 -0
- package/dist/server.js.map +1 -1
- package/dist/tools/geodesy.d.ts +3 -0
- package/dist/tools/geodesy.d.ts.map +1 -0
- package/dist/tools/geodesy.js +109 -0
- package/dist/tools/geodesy.js.map +1 -0
- package/dist/tools/maps.d.ts +3 -0
- package/dist/tools/maps.d.ts.map +1 -0
- package/dist/tools/maps.js +61 -0
- package/dist/tools/maps.js.map +1 -0
- package/dist/tools/shape.d.ts +27 -0
- package/dist/tools/shape.d.ts.map +1 -0
- package/dist/tools/shape.js +81 -0
- package/dist/tools/shape.js.map +1 -0
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -88,8 +88,17 @@ returned as `{ "rad": …, "deg": … }`.
|
|
|
88
88
|
| `convert_anomaly` | Mean ↔ eccentric ↔ true anomaly (elliptic orbits) |
|
|
89
89
|
| `convert_time` | Duration between units, attoseconds to gigayears |
|
|
90
90
|
| `convert_distance` | Distance between units, metres to gigaparsecs |
|
|
91
|
+
| `great_circle_distance` | Distance and central angle between two points on a body |
|
|
92
|
+
| `horizon_distance` | How far an observer at a height can see |
|
|
93
|
+
| `geodetic_to_body_fixed` | Body-fixed x, y, z from latitude, longitude and height |
|
|
94
|
+
| `body_fixed_to_geodetic` | Latitude, longitude and height from body-fixed x, y, z |
|
|
95
|
+
| `project_point` | Map x and y of a point in one of seven projections |
|
|
91
96
|
| `find_body` | Look up planets, moons, stars, comets, … by name or id |
|
|
92
97
|
|
|
98
|
+
The geodesy and map tools take the shape of the body as a `body` id from
|
|
99
|
+
`find_body`, such as `"mars"`, or as radii in metres. For GPS coordinates on
|
|
100
|
+
Earth, the ellipsoid tools also take `"wgs84"`.
|
|
101
|
+
|
|
93
102
|
All tools are pure and offline: no network access, no side effects.
|
|
94
103
|
|
|
95
104
|
## Resources
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAcpE,eAAO,MAAM,WAAW,uBAAuB,CAAC;AAEhD,kFAAkF;AAClF,eAAO,MAAM,cAAc,EAAE,MAEpB,CAAC;AAEV;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,QAAO,SAoB/B,CAAC"}
|
package/dist/server.js
CHANGED
|
@@ -3,7 +3,9 @@ import { createRequire } from 'node:module';
|
|
|
3
3
|
import { registerBodies } from './bodies.js';
|
|
4
4
|
import { registerAnomalyTools } from './tools/anomalies.js';
|
|
5
5
|
import { registerDistanceTools } from './tools/distance.js';
|
|
6
|
+
import { registerGeodesyTools } from './tools/geodesy.js';
|
|
6
7
|
import { registerManoeuvreTools } from './tools/manoeuvres.js';
|
|
8
|
+
import { registerMapTools } from './tools/maps.js';
|
|
7
9
|
import { registerOrbitTools } from './tools/orbits.js';
|
|
8
10
|
import { registerStateVectorTools } from './tools/state-vectors.js';
|
|
9
11
|
import { registerTimeTools } from './tools/time.js';
|
|
@@ -32,6 +34,8 @@ export const createServer = () => {
|
|
|
32
34
|
registerAnomalyTools(server);
|
|
33
35
|
registerTimeTools(server);
|
|
34
36
|
registerDistanceTools(server);
|
|
37
|
+
registerGeodesyTools(server);
|
|
38
|
+
registerMapTools(server);
|
|
35
39
|
registerBodies(server);
|
|
36
40
|
return server;
|
|
37
41
|
};
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mapp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BAAqB,CAAC,MAAM,CAAC,CAAC;IAC9B,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAC7B,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACzB,cAAc,CAAC,MAAM,CAAC,CAAC;IAEvB,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geodesy.d.ts","sourceRoot":"","sources":["../../src/tools/geodesy.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAiCzE,eAAO,MAAM,oBAAoB,GAAI,QAAQ,SAAS,SAiJrD,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { bodyFixedToGeodetic, centralAngle, eccentricitySquaredOblateSpheroid, geodeticToBodyFixed, horizonDistance, horizonSurfaceDistance } from '@interstellar-tools/equations';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { ellipsoidInput, resolveEllipsoid, resolveSphere, sphereInput } from './shape.js';
|
|
4
|
+
import { angleOutput, angleOutputSchema, angleSchema, PURE_TOOL, result, toRadians, vectorOutputSchema, vectorSchema } from './shared.js';
|
|
5
|
+
const latitudeSchema = (which) => angleSchema.describe(`Latitude${which}, north positive, in [-90°, 90°], e.g. { "value": 18.44, "unit": "deg" }.`);
|
|
6
|
+
const longitudeSchema = (which) => angleSchema.describe(`Longitude${which}, east positive, e.g. { "value": 77.45, "unit": "deg" }.`);
|
|
7
|
+
const ellipsoidOutput = {
|
|
8
|
+
equatorial_radius_m: z.number(),
|
|
9
|
+
polar_radius_m: z.number()
|
|
10
|
+
};
|
|
11
|
+
export const registerGeodesyTools = (server) => {
|
|
12
|
+
server.registerTool('great_circle_distance', {
|
|
13
|
+
title: 'Great-circle distance',
|
|
14
|
+
description: 'Shortest distance between two points along the surface of a sphere, and the central angle between them, from their latitudes and longitudes. Uses the body’s mean radius; on an oblate body like Earth the error is up to about 0.5%.',
|
|
15
|
+
inputSchema: {
|
|
16
|
+
from_latitude: latitudeSchema(' of the first point'),
|
|
17
|
+
from_longitude: longitudeSchema(' of the first point'),
|
|
18
|
+
to_latitude: latitudeSchema(' of the second point'),
|
|
19
|
+
to_longitude: longitudeSchema(' of the second point'),
|
|
20
|
+
...sphereInput
|
|
21
|
+
},
|
|
22
|
+
outputSchema: {
|
|
23
|
+
distance_m: z.number(),
|
|
24
|
+
central_angle: angleOutputSchema,
|
|
25
|
+
radius_m: z.number()
|
|
26
|
+
},
|
|
27
|
+
annotations: PURE_TOOL
|
|
28
|
+
}, ({ from_latitude, from_longitude, to_latitude, to_longitude, ...shape }) => {
|
|
29
|
+
const radius_m = resolveSphere(shape);
|
|
30
|
+
const angle = centralAngle(toRadians(from_latitude), toRadians(from_longitude), toRadians(to_latitude), toRadians(to_longitude));
|
|
31
|
+
return result({
|
|
32
|
+
distance_m: radius_m * angle,
|
|
33
|
+
central_angle: angleOutput(angle),
|
|
34
|
+
radius_m
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
server.registerTool('horizon_distance', {
|
|
38
|
+
title: 'Distance to the horizon',
|
|
39
|
+
description: 'How far an observer at a height above a sphere can see: the straight-line distance to the horizon, and the distance along the surface to it. No atmospheric refraction.',
|
|
40
|
+
inputSchema: {
|
|
41
|
+
height_m: z
|
|
42
|
+
.number()
|
|
43
|
+
.nonnegative()
|
|
44
|
+
.describe('Height of the observer above the surface, in metres.'),
|
|
45
|
+
...sphereInput
|
|
46
|
+
},
|
|
47
|
+
outputSchema: {
|
|
48
|
+
distance_m: z.number(),
|
|
49
|
+
surface_distance_m: z.number(),
|
|
50
|
+
radius_m: z.number()
|
|
51
|
+
},
|
|
52
|
+
annotations: PURE_TOOL
|
|
53
|
+
}, ({ height_m, ...shape }) => {
|
|
54
|
+
const radius_m = resolveSphere(shape);
|
|
55
|
+
return result({
|
|
56
|
+
distance_m: horizonDistance(height_m, radius_m),
|
|
57
|
+
surface_distance_m: horizonSurfaceDistance(height_m, radius_m),
|
|
58
|
+
radius_m
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
server.registerTool('geodetic_to_body_fixed', {
|
|
62
|
+
title: 'Geodetic to body-fixed coordinates',
|
|
63
|
+
description: 'Body-fixed Cartesian position [x, y, z] of a point given by geodetic latitude, longitude and height above an oblate ellipsoid. x points to latitude 0, longitude 0; z to the north pole. On Earth, use body "wgs84" for GPS coordinates.',
|
|
64
|
+
inputSchema: {
|
|
65
|
+
latitude: latitudeSchema(' (geodetic)'),
|
|
66
|
+
longitude: longitudeSchema(''),
|
|
67
|
+
height_m: z
|
|
68
|
+
.number()
|
|
69
|
+
.finite()
|
|
70
|
+
.describe('Height above the ellipsoid, in metres.'),
|
|
71
|
+
...ellipsoidInput
|
|
72
|
+
},
|
|
73
|
+
outputSchema: { r_m: vectorOutputSchema, ...ellipsoidOutput },
|
|
74
|
+
annotations: PURE_TOOL
|
|
75
|
+
}, ({ latitude, longitude, height_m, ...shape }) => {
|
|
76
|
+
const { a, c } = resolveEllipsoid(shape);
|
|
77
|
+
return result({
|
|
78
|
+
r_m: geodeticToBodyFixed(toRadians(latitude), toRadians(longitude), height_m, a, eccentricitySquaredOblateSpheroid(a, c)),
|
|
79
|
+
equatorial_radius_m: a,
|
|
80
|
+
polar_radius_m: c
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
server.registerTool('body_fixed_to_geodetic', {
|
|
84
|
+
title: 'Body-fixed to geodetic coordinates',
|
|
85
|
+
description: 'Geodetic latitude, longitude and height above an oblate ellipsoid, from a body-fixed Cartesian position [x, y, z]. The inverse of geodetic_to_body_fixed. On Earth, use body "wgs84" for GPS coordinates.',
|
|
86
|
+
inputSchema: {
|
|
87
|
+
r_m: vectorSchema('Body-fixed position [x, y, z], in metres.'),
|
|
88
|
+
...ellipsoidInput
|
|
89
|
+
},
|
|
90
|
+
outputSchema: {
|
|
91
|
+
latitude: angleOutputSchema,
|
|
92
|
+
longitude: angleOutputSchema,
|
|
93
|
+
height_m: z.number(),
|
|
94
|
+
...ellipsoidOutput
|
|
95
|
+
},
|
|
96
|
+
annotations: PURE_TOOL
|
|
97
|
+
}, ({ r_m, ...shape }) => {
|
|
98
|
+
const { a, c } = resolveEllipsoid(shape);
|
|
99
|
+
const { phi, lambda, h } = bodyFixedToGeodetic(...r_m, a, eccentricitySquaredOblateSpheroid(a, c));
|
|
100
|
+
return result({
|
|
101
|
+
latitude: angleOutput(phi),
|
|
102
|
+
longitude: angleOutput(lambda),
|
|
103
|
+
height_m: h,
|
|
104
|
+
equatorial_radius_m: a,
|
|
105
|
+
polar_radius_m: c
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
//# sourceMappingURL=geodesy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geodesy.js","sourceRoot":"","sources":["../../src/tools/geodesy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,YAAY,EACZ,iCAAiC,EACjC,mBAAmB,EACnB,eAAe,EACf,sBAAsB,EACvB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,WAAW,EACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,SAAS,EACT,MAAM,EACN,SAAS,EACT,kBAAkB,EAClB,YAAY,EACb,MAAM,aAAa,CAAC;AAErB,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,EAAE,CACvC,WAAW,CAAC,QAAQ,CAClB,WAAW,KAAK,2EAA2E,CAC5F,CAAC;AACJ,MAAM,eAAe,GAAG,CAAC,KAAa,EAAE,EAAE,CACxC,WAAW,CAAC,QAAQ,CAClB,YAAY,KAAK,0DAA0D,CAC5E,CAAC;AACJ,MAAM,eAAe,GAAG;IACtB,mBAAmB,EAAE,CAAC,CAAC,MAAM,E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AyC,CAAC;AA+BzE,eAAO,MAAM,gBAAgB,GAAI,QAAQ,SAAS,SAuEjD,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { equirectangular, lambertAzimuthalEqualArea, mercator, mollweide, orthographic, sinusoidal, stereographic } from '@interstellar-tools/maps';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { resolveSphere, sphereInput } from './shape.js';
|
|
4
|
+
import { angleSchema, PURE_TOOL, result, toRadians } from './shared.js';
|
|
5
|
+
const PROJECTIONS = {
|
|
6
|
+
equirectangular,
|
|
7
|
+
mercator,
|
|
8
|
+
sinusoidal,
|
|
9
|
+
mollweide,
|
|
10
|
+
lambert_azimuthal_equal_area: lambertAzimuthalEqualArea,
|
|
11
|
+
stereographic,
|
|
12
|
+
orthographic
|
|
13
|
+
};
|
|
14
|
+
const PROJECTION_NAMES = Object.keys(PROJECTIONS);
|
|
15
|
+
// The projections that take a centre latitude, and the one with a standard
|
|
16
|
+
// parallel
|
|
17
|
+
const CENTRED = new Set([
|
|
18
|
+
'equirectangular',
|
|
19
|
+
'lambert_azimuthal_equal_area',
|
|
20
|
+
'stereographic',
|
|
21
|
+
'orthographic'
|
|
22
|
+
]);
|
|
23
|
+
export const registerMapTools = (server) => {
|
|
24
|
+
server.registerTool('project_point', {
|
|
25
|
+
title: 'Project a point onto a map',
|
|
26
|
+
description: 'Map coordinates x (east) and y (north), in metres on a sphere, of a latitude and longitude in one of seven projections. equirectangular: plain latitude–longitude grid, as most planetary maps use. mercator: keeps angles, for navigation and web maps; no poles. sinusoidal and mollweide: keep areas, whole-world maps. lambert_azimuthal_equal_area: keeps areas around a centre point. stereographic: keeps angles around a centre point, for polar maps. orthographic: the globe as seen from far away; only the near hemisphere.',
|
|
27
|
+
inputSchema: {
|
|
28
|
+
projection: z.enum(PROJECTION_NAMES).describe('The map projection.'),
|
|
29
|
+
latitude: angleSchema.describe('Latitude of the point, north positive, in [-90°, 90°].'),
|
|
30
|
+
longitude: angleSchema.describe('Longitude of the point, east positive.'),
|
|
31
|
+
...sphereInput,
|
|
32
|
+
center_longitude: angleSchema
|
|
33
|
+
.optional()
|
|
34
|
+
.describe('Longitude of the map’s centre (the central meridian). Defaults to 0.'),
|
|
35
|
+
center_latitude: angleSchema
|
|
36
|
+
.optional()
|
|
37
|
+
.describe('Latitude of the map’s centre, for equirectangular and the azimuthal projections (lambert_azimuthal_equal_area, stereographic, orthographic); 90° gives a north polar map. Defaults to 0.'),
|
|
38
|
+
standard_parallel: angleSchema
|
|
39
|
+
.optional()
|
|
40
|
+
.describe('For equirectangular only: the latitude where the map is true to scale east–west, often the latitude of the area mapped. Defaults to 0, the equator.')
|
|
41
|
+
},
|
|
42
|
+
outputSchema: { x_m: z.number(), y_m: z.number(), radius_m: z.number() },
|
|
43
|
+
annotations: PURE_TOOL
|
|
44
|
+
}, ({ projection, latitude, longitude, center_longitude, center_latitude, standard_parallel, ...shape }) => {
|
|
45
|
+
if (center_latitude && !CENTRED.has(projection))
|
|
46
|
+
throw new Error(`${projection} has no center_latitude: it is centred on the equator.`);
|
|
47
|
+
if (standard_parallel && projection !== 'equirectangular')
|
|
48
|
+
throw new Error('Only equirectangular takes a standard_parallel.');
|
|
49
|
+
const radius_m = resolveSphere(shape);
|
|
50
|
+
const options = {};
|
|
51
|
+
if (center_longitude)
|
|
52
|
+
options.lambda0 = toRadians(center_longitude);
|
|
53
|
+
if (center_latitude)
|
|
54
|
+
options.phi0 = toRadians(center_latitude);
|
|
55
|
+
if (standard_parallel)
|
|
56
|
+
options.phi1 = toRadians(standard_parallel);
|
|
57
|
+
const { x, y } = PROJECTIONS[projection](toRadians(latitude), toRadians(longitude), radius_m, options);
|
|
58
|
+
return result({ x_m: x, y_m: y, radius_m });
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=maps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maps.js","sourceRoot":"","sources":["../../src/tools/maps.ts"],"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ACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** A body or a radius in metres: the sphere tools take one of them. */
|
|
3
|
+
export declare const sphereInput: {
|
|
4
|
+
body: z.ZodOptional<z.ZodString>;
|
|
5
|
+
radius_m: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
};
|
|
7
|
+
/** A body or two radii in metres: the ellipsoid tools take one of them. */
|
|
8
|
+
export declare const ellipsoidInput: {
|
|
9
|
+
body: z.ZodOptional<z.ZodString>;
|
|
10
|
+
equatorial_radius_m: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
polar_radius_m: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
};
|
|
13
|
+
/** The radius of a sphere, from a body's mean radius or a given radius. */
|
|
14
|
+
export declare const resolveSphere: ({ body, radius_m }: {
|
|
15
|
+
body?: string;
|
|
16
|
+
radius_m?: number;
|
|
17
|
+
}) => number;
|
|
18
|
+
/** The radii of an oblate ellipsoid, from a body or given radii. */
|
|
19
|
+
export declare const resolveEllipsoid: ({ body, equatorial_radius_m, polar_radius_m }: {
|
|
20
|
+
body?: string;
|
|
21
|
+
equatorial_radius_m?: number;
|
|
22
|
+
polar_radius_m?: number;
|
|
23
|
+
}) => {
|
|
24
|
+
a: number;
|
|
25
|
+
c: number;
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=shape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shape.d.ts","sourceRoot":"","sources":["../../src/tools/shape.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgBxB,uEAAuE;AACvE,eAAO,MAAM,WAAW;;;CASvB,CAAC;AAEF,2EAA2E;AAC3E,eAAO,MAAM,cAAc;;;;CAc1B,CAAC;AAsBF,2EAA2E;AAC3E,eAAO,MAAM,aAAa,GAAI,oBAG3B;IACD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,KAAG,MAcH,CAAC;AAEF,oEAAoE;AACpE,eAAO,MAAM,gBAAgB,GAAI,+CAI9B;IACD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,KAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CA4CzB,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { WGS84 } from '@interstellar-tools/constants';
|
|
2
|
+
import { convertDistanceUnit } from '@interstellar-tools/equations';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { DATASETS } from '../bodies.js';
|
|
5
|
+
// The shape of a body, from the datasets or given in metres, for the geodesy
|
|
6
|
+
// and map tools
|
|
7
|
+
const describeBody = (extra) => z
|
|
8
|
+
.string()
|
|
9
|
+
.min(1)
|
|
10
|
+
.optional()
|
|
11
|
+
.describe(`Body id from find_body, such as "earth", "mars" or "moon"${extra}. Give this or the radius in metres, not both.`);
|
|
12
|
+
/** A body or a radius in metres: the sphere tools take one of them. */
|
|
13
|
+
export const sphereInput = {
|
|
14
|
+
body: describeBody(''),
|
|
15
|
+
radius_m: z
|
|
16
|
+
.number()
|
|
17
|
+
.positive()
|
|
18
|
+
.optional()
|
|
19
|
+
.describe('Radius of the sphere, in metres. Earth’s mean radius is 6371008.4.')
|
|
20
|
+
};
|
|
21
|
+
/** A body or two radii in metres: the ellipsoid tools take one of them. */
|
|
22
|
+
export const ellipsoidInput = {
|
|
23
|
+
body: describeBody(', or "wgs84" for the ellipsoid GPS uses'),
|
|
24
|
+
equatorial_radius_m: z
|
|
25
|
+
.number()
|
|
26
|
+
.positive()
|
|
27
|
+
.optional()
|
|
28
|
+
.describe('Equatorial radius a of the ellipsoid, in metres.'),
|
|
29
|
+
polar_radius_m: z
|
|
30
|
+
.number()
|
|
31
|
+
.positive()
|
|
32
|
+
.optional()
|
|
33
|
+
.describe('Polar radius c of the ellipsoid, in metres, no larger than the equatorial radius.')
|
|
34
|
+
};
|
|
35
|
+
const metres = (distance) => convertDistanceUnit(distance, 'm').value;
|
|
36
|
+
const findBody = (id) => {
|
|
37
|
+
const needle = id.trim().toLowerCase();
|
|
38
|
+
for (const { data } of Object.values(DATASETS))
|
|
39
|
+
for (const body of data)
|
|
40
|
+
if (body.id === needle)
|
|
41
|
+
return body;
|
|
42
|
+
throw new Error(`Unknown body: ${id}. Use the id that find_body returns, such as "mars".`);
|
|
43
|
+
};
|
|
44
|
+
/** The radius of a sphere, from a body's mean radius or a given radius. */
|
|
45
|
+
export const resolveSphere = ({ body, radius_m }) => {
|
|
46
|
+
if ((body === undefined) === (radius_m === undefined))
|
|
47
|
+
throw new Error('Give either body or radius_m.');
|
|
48
|
+
if (radius_m !== undefined)
|
|
49
|
+
return radius_m;
|
|
50
|
+
const found = findBody(body);
|
|
51
|
+
if (!found.radius)
|
|
52
|
+
throw new Error(`${found.id} has no radius in the datasets: give radius_m.`);
|
|
53
|
+
return metres(found.radius);
|
|
54
|
+
};
|
|
55
|
+
/** The radii of an oblate ellipsoid, from a body or given radii. */
|
|
56
|
+
export const resolveEllipsoid = ({ body, equatorial_radius_m, polar_radius_m }) => {
|
|
57
|
+
const radii = [equatorial_radius_m, polar_radius_m].filter((r) => r !== undefined).length;
|
|
58
|
+
if (body !== undefined && radii > 0)
|
|
59
|
+
throw new Error('Give either body or equatorial_radius_m and polar_radius_m, not both.');
|
|
60
|
+
if (body === undefined) {
|
|
61
|
+
if (radii < 2)
|
|
62
|
+
throw new Error('Give either body, or both equatorial_radius_m and polar_radius_m.');
|
|
63
|
+
if (polar_radius_m > equatorial_radius_m)
|
|
64
|
+
throw new Error('polar_radius_m must be no larger than equatorial_radius_m: the tools take an oblate ellipsoid.');
|
|
65
|
+
return { a: equatorial_radius_m, c: polar_radius_m };
|
|
66
|
+
}
|
|
67
|
+
const found = body.trim().toLowerCase() === 'wgs84'
|
|
68
|
+
? { id: 'wgs84', ellipsoid: WGS84 }
|
|
69
|
+
: findBody(body);
|
|
70
|
+
if (found.ellipsoid?.alongOrbitRadius)
|
|
71
|
+
throw new Error(`${found.id} is a triaxial ellipsoid, and geodetic coordinates need an oblate one. To approximate it, give equatorial_radius_m and polar_radius_m.`);
|
|
72
|
+
if (found.ellipsoid)
|
|
73
|
+
return {
|
|
74
|
+
a: metres(found.ellipsoid.equatorialRadius),
|
|
75
|
+
c: metres(found.ellipsoid.polarRadius)
|
|
76
|
+
};
|
|
77
|
+
// No measured shape: a sphere of the mean radius
|
|
78
|
+
const r = resolveSphere({ body });
|
|
79
|
+
return { a: r, c: r };
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=shape.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shape.js","sourceRoot":"","sources":["../../src/tools/shape.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAKpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,6EAA6E;AAC7E,gBAAgB;AAEhB,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,EAAE,CACrC,CAAC;KACE,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,QAAQ,EAAE;KACV,QAAQ,CACP,4DAA4D,KAAK,gDAAgD,CAClH,CAAC;AAEN,uEAAuE;AACvE,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,YAAY,CAAC,EAAE,CAAC;IACtB,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,EAAE;SACV,QAAQ,CACP,oEAAoE,CACrE;CACJ,CAAC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C3C,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC;SACvC,CAAC;IAEJ,iDAAiD;IACjD,MAAM,CAAC,GAAG,aAAa,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IAElC,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACxB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interstellar-tools/mcp",
|
|
3
|
-
"version": "1.1
|
|
4
|
-
"description": "Model Context Protocol (MCP) server exposing interstellar-tools orbital mechanics
|
|
3
|
+
"version": "1.2.1",
|
|
4
|
+
"description": "Model Context Protocol (MCP) server exposing interstellar-tools orbital mechanics, geodesy and map projection calculations and celestial body datasets to AI assistants.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
7
7
|
"model-context-protocol",
|
|
@@ -52,15 +52,16 @@
|
|
|
52
52
|
"start": "node dist/bin.js",
|
|
53
53
|
"test": "tsx --test **/__tests__/**/*.spec.ts",
|
|
54
54
|
"pretest:ci": "rm -rf coverage && mkdir -p coverage",
|
|
55
|
-
"test:ci": "glob-bin -c \"node --import tsx --test --no-warnings --experimental-test-coverage --test-reporter=cobertura --test-reporter-destination=coverage/cobertura-coverage.xml --test-reporter=spec --test-reporter-destination=stdout\" \"**/__tests__/**/*.spec.ts\""
|
|
55
|
+
"test:ci": "glob-bin -c \"node --import tsx --test --no-warnings --experimental-test-coverage --test-coverage-include='src/**' --test-coverage-exclude='**/__tests__/**' --test-coverage-lines=98.9 --test-coverage-branches=91.7 --test-coverage-functions=93.6 --test-reporter=cobertura --test-reporter-destination=coverage/cobertura-coverage.xml --test-reporter=spec --test-reporter-destination=stdout\" \"**/__tests__/**/*.spec.ts\""
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@interstellar-tools/constants": "^1.
|
|
58
|
+
"@interstellar-tools/constants": "^1.1.1",
|
|
59
59
|
"@interstellar-tools/equations": "^1.8.0",
|
|
60
|
+
"@interstellar-tools/maps": "^0.11.0",
|
|
60
61
|
"@interstellar-tools/temporal": "^1.0.0",
|
|
61
62
|
"@interstellar-tools/types": "^1.0.0",
|
|
62
|
-
"@modelcontextprotocol/sdk": "1.32.2",
|
|
63
|
-
"zod": "4.6.7"
|
|
63
|
+
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
64
|
+
"zod": "^4.6.7"
|
|
64
65
|
},
|
|
65
66
|
"devDependencies": {
|
|
66
67
|
"@types/node": "^24.19.2",
|