@cyanheads/astronomy-mcp-server 0.4.1 → 0.4.3
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/AGENTS.md +16 -12
- package/CLAUDE.md +16 -12
- package/Dockerfile +3 -3
- package/README.md +39 -14
- package/changelog/0.4.x/0.4.2.md +37 -0
- package/changelog/0.4.x/0.4.3.md +28 -0
- package/dist/mcp-server/prompts/definitions/stargazing-plan.prompt.js +1 -1
- package/dist/mcp-server/prompts/definitions/stargazing-plan.prompt.js.map +1 -1
- package/dist/mcp-server/tools/definitions/find-events.tool.d.ts +31 -4
- package/dist/mcp-server/tools/definitions/find-events.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/find-events.tool.js +96 -24
- package/dist/mcp-server/tools/definitions/find-events.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-ephemeris.tool.d.ts +29 -7
- package/dist/mcp-server/tools/definitions/get-ephemeris.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-ephemeris.tool.js +221 -46
- package/dist/mcp-server/tools/definitions/get-ephemeris.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-moon-phase.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-moon-phase.tool.js +1 -0
- package/dist/mcp-server/tools/definitions/get-moon-phase.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-rise-set.tool.d.ts +49 -2
- package/dist/mcp-server/tools/definitions/get-rise-set.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-rise-set.tool.js +85 -43
- package/dist/mcp-server/tools/definitions/get-rise-set.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-satellite-passes.tool.d.ts +27 -3
- package/dist/mcp-server/tools/definitions/get-satellite-passes.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-satellite-passes.tool.js +98 -23
- package/dist/mcp-server/tools/definitions/get-satellite-passes.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-sky-position.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-sky-position.tool.js +1 -0
- package/dist/mcp-server/tools/definitions/get-sky-position.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/list-visible.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/list-visible.tool.js +1 -0
- package/dist/mcp-server/tools/definitions/list-visible.tool.js.map +1 -1
- package/dist/services/ephemeris/ephemeris-service.d.ts +86 -14
- package/dist/services/ephemeris/ephemeris-service.d.ts.map +1 -1
- package/dist/services/ephemeris/ephemeris-service.js +455 -100
- package/dist/services/ephemeris/ephemeris-service.js.map +1 -1
- package/dist/services/ephemeris/iso-time.d.ts +2 -2
- package/dist/services/ephemeris/iso-time.js +5 -5
- package/dist/services/ephemeris/types.d.ts +42 -1
- package/dist/services/ephemeris/types.d.ts.map +1 -1
- package/dist/services/ephemeris/types.js +16 -0
- package/dist/services/ephemeris/types.js.map +1 -1
- package/dist/services/horizons/horizons-service.d.ts +25 -3
- package/dist/services/horizons/horizons-service.d.ts.map +1 -1
- package/dist/services/horizons/horizons-service.js +154 -15
- package/dist/services/horizons/horizons-service.js.map +1 -1
- package/dist/services/horizons/types.d.ts +8 -4
- package/dist/services/horizons/types.d.ts.map +1 -1
- package/dist/services/satellite/satellite-service.d.ts +48 -10
- package/dist/services/satellite/satellite-service.d.ts.map +1 -1
- package/dist/services/satellite/satellite-service.js +215 -102
- package/dist/services/satellite/satellite-service.js.map +1 -1
- package/dist/services/satellite/types.d.ts +36 -2
- package/dist/services/satellite/types.d.ts.map +1 -1
- package/dist/services/satellite/types.js.map +1 -1
- package/package.json +10 -9
- package/server.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-rise-set.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-rise-set.tool.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"get-rise-set.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-rise-set.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAsEjE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8DxB,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE9D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuLzB,CAAC"}
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview astronomy_get_rise_set — rise, set, and culmination times for a body
|
|
3
|
-
* at a location, plus the Sun's three twilight pairs
|
|
4
|
-
* never-rises cases as null fields with an
|
|
3
|
+
* at a location, plus the Sun's three twilight pairs per cycle and for the night under
|
|
4
|
+
* way at the start. Handles circumpolar / never-rises cases as null fields with an
|
|
5
|
+
* explanatory note. Serves at most `RISE_SET_PER_CALL` cycles per call and names the
|
|
6
|
+
* exact `start` and `count` that continue a longer request, while that start lies
|
|
7
|
+
* inside the supported span.
|
|
5
8
|
* @module mcp-server/tools/definitions/get-rise-set.tool
|
|
6
9
|
*/
|
|
7
10
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
8
11
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
9
12
|
import { getServerConfig } from '../../../config/server-config.js';
|
|
10
13
|
import { num } from '../format-numbers.js';
|
|
11
|
-
import { getEphemerisService } from '../../../services/ephemeris/ephemeris-service.js';
|
|
14
|
+
import { getEphemerisService, SUPPORTED_SPAN } from '../../../services/ephemeris/ephemeris-service.js';
|
|
12
15
|
import { BODY_NAMES } from '../../../services/ephemeris/types.js';
|
|
16
|
+
/** Cycles computed per call; a larger `count` is served this many with a resume notice. */
|
|
17
|
+
const RISE_SET_PER_CALL = 31;
|
|
18
|
+
/** Largest `count` accepted — a year of daily cycles. Past it the schema rejects. */
|
|
19
|
+
const RISE_SET_COUNT_CEILING = 366;
|
|
13
20
|
/** Map the service's camelCase twilight pair to the snake_case wire shape. */
|
|
14
21
|
function toTwilightPair(p) {
|
|
15
22
|
return {
|
|
@@ -19,25 +26,38 @@ function toTwilightPair(p) {
|
|
|
19
26
|
...(p.duskLocal !== undefined ? { dusk_local: p.duskLocal } : {}),
|
|
20
27
|
};
|
|
21
28
|
}
|
|
29
|
+
/** Map all three depths of a twilight set to the wire shape. */
|
|
30
|
+
function toTwilightSet(t) {
|
|
31
|
+
return {
|
|
32
|
+
civil: toTwilightPair(t.civil),
|
|
33
|
+
nautical: toTwilightPair(t.nautical),
|
|
34
|
+
astronomical: toTwilightPair(t.astronomical),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
22
37
|
const TwilightPairSchema = z.object({
|
|
23
38
|
dawn_utc: z
|
|
24
39
|
.string()
|
|
25
40
|
.nullable()
|
|
26
|
-
.describe("Dawn (Sun ascending through the depth) in ISO 8601 UTC, or null
|
|
41
|
+
.describe("Dawn (Sun ascending through the depth) in ISO 8601 UTC, or null when that crossing does not occur during the night. In a cycle, this is the morning after that cycle's set, or after its culmination when it has no set — a day later than the cycle's rise, not the dawn before it."),
|
|
27
42
|
dusk_utc: z
|
|
28
43
|
.string()
|
|
29
44
|
.nullable()
|
|
30
|
-
.describe("Dusk (Sun descending through the depth) in ISO 8601 UTC, or null
|
|
45
|
+
.describe("Dusk (Sun descending through the depth) in ISO 8601 UTC, or null when that crossing does not occur during the night. In a cycle, this is the evening of that cycle's set, or after its culmination when it has no set."),
|
|
31
46
|
dawn_local: z
|
|
32
47
|
.string()
|
|
33
48
|
.nullable()
|
|
34
49
|
.optional()
|
|
35
|
-
.describe(
|
|
50
|
+
.describe('Dawn in observer-local time — the morning that ends the night — present only when a timezone was supplied.'),
|
|
36
51
|
dusk_local: z
|
|
37
52
|
.string()
|
|
38
53
|
.nullable()
|
|
39
54
|
.optional()
|
|
40
|
-
.describe(
|
|
55
|
+
.describe('Dusk in observer-local time — the evening that begins the night — present only when a timezone was supplied.'),
|
|
56
|
+
});
|
|
57
|
+
const TwilightSetSchema = z.object({
|
|
58
|
+
civil: TwilightPairSchema.describe('Civil twilight (Sun at −6°): dusk and the following dawn.'),
|
|
59
|
+
nautical: TwilightPairSchema.describe('Nautical twilight (Sun at −12°): dusk and the following dawn.'),
|
|
60
|
+
astronomical: TwilightPairSchema.describe('Astronomical twilight (Sun at −18°): dusk and the following dawn, bounding the dark-sky window.'),
|
|
41
61
|
});
|
|
42
62
|
export const RiseSetOutput = z.object({
|
|
43
63
|
body: z.string().describe('The body these rise/set cycles are for, echoed from the request.'),
|
|
@@ -47,7 +67,7 @@ export const RiseSetOutput = z.object({
|
|
|
47
67
|
rise_utc: z
|
|
48
68
|
.string()
|
|
49
69
|
.nullable()
|
|
50
|
-
.describe('Rise time in ISO 8601 UTC, or null when the body does not rise in this cycle — because it is circumpolar, or because it was already above the horizon at the search start,
|
|
70
|
+
.describe('Rise time in ISO 8601 UTC, or null when the body does not rise in this cycle — because it is circumpolar, or because it was already above the horizon when the cycle opened (at the search start, or after a day it never set on), so its rise precedes the cycle. The accompanying note says which.'),
|
|
51
71
|
set_utc: z
|
|
52
72
|
.string()
|
|
53
73
|
.nullable()
|
|
@@ -55,7 +75,7 @@ export const RiseSetOutput = z.object({
|
|
|
55
75
|
transit_utc: z
|
|
56
76
|
.string()
|
|
57
77
|
.nullable()
|
|
58
|
-
.describe('Culmination (highest point) time in ISO 8601 UTC, or null when
|
|
78
|
+
.describe('Culmination (highest point) time in ISO 8601 UTC, or null when it falls outside this cycle — before its rise, after its set, or before the search start.'),
|
|
59
79
|
transit_altitude_degrees: z
|
|
60
80
|
.number()
|
|
61
81
|
.nullable()
|
|
@@ -72,14 +92,7 @@ export const RiseSetOutput = z.object({
|
|
|
72
92
|
.string()
|
|
73
93
|
.optional()
|
|
74
94
|
.describe('Culmination time in observer-local time, present only when a timezone was supplied.'),
|
|
75
|
-
twilight:
|
|
76
|
-
.object({
|
|
77
|
-
civil: TwilightPairSchema.describe('Civil twilight (Sun at −6°): dusk and the following dawn.'),
|
|
78
|
-
nautical: TwilightPairSchema.describe('Nautical twilight (Sun at −12°): dusk and the following dawn.'),
|
|
79
|
-
astronomical: TwilightPairSchema.describe('Astronomical twilight (Sun at −18°): dusk and the following dawn, bounding the dark-sky window.'),
|
|
80
|
-
})
|
|
81
|
-
.optional()
|
|
82
|
-
.describe("The three twilight pairs, present only when body is \"sun\". Each pair spans one night: dusk is the evening of this cycle's set and dawn is the following morning, so a cycle's dawn falls a day after its rise. The dawn before a given sunrise is in the previous cycle's pair — start the search a day earlier to get it."),
|
|
95
|
+
twilight: TwilightSetSchema.optional().describe("The three twilight pairs, present only when body is \"sun\". Each pair spans one night: dusk is the evening of this cycle's set — or, in a cycle with no set, the evening after its culmination — and dawn is the following morning, so a cycle's dawn falls a day after its rise. Each is searched only up to the start of the next cycle's day (its sunrise, or its culmination when it has no rise), so an absent crossing is null. A first cycle with no rise, set, or transit is the rest of the day the search started in, inside or at the edge of a polar night; its pairs can include times before `start` that have passed. The dawn before a given sunrise is in the previous cycle's pair; when the first cycle's day begins after `start`, its preceding night is in `night_in_progress`, including polar nights without a sunset."),
|
|
83
96
|
note: z
|
|
84
97
|
.string()
|
|
85
98
|
.optional()
|
|
@@ -87,10 +100,11 @@ export const RiseSetOutput = z.object({
|
|
|
87
100
|
})
|
|
88
101
|
.describe('One rise/set/transit cycle, with twilight when the body is the Sun.'))
|
|
89
102
|
.describe('One entry per rise/set/transit cycle, searching forward from the start time.'),
|
|
103
|
+
night_in_progress: TwilightSetSchema.optional().describe("The night under way at `start`, present only for the Sun when it is below the horizon and the first cycle's day begins after `start`. Each pair is bounded from the previous culmination, or a sunset after it, to the first day's sunrise or culmination. This includes polar nights without a sunset and excludes stale sunsets before an intervening polar day. Times earlier than `start` are included and have already passed; an absent crossing is null. Absent when the first cycle already carries that night, including a rest-of-dark-day cycle. A continuation may repeat here the night the previous call's last cycle carried; its `events` do not repeat. Not one of `events` and not counted by `count`."),
|
|
90
104
|
});
|
|
91
105
|
export const getRiseSetTool = tool('astronomy_get_rise_set', {
|
|
92
106
|
title: 'astronomy-mcp-server: get rise/set times',
|
|
93
|
-
description:
|
|
107
|
+
description: "Compute rise, set, and culmination (transit) times and maximum transit altitude for a body at an observer location. Searches forward from `start` (default now) for `count` daily cycles (default 1), including days without crossings. For the Sun, each cycle carries civil −6°, nautical −12°, and astronomical −18° twilight: dusk after its set or culmination, then dawn before the next day begins. A crossing absent from that night is null. When the Sun is down and the first cycle's day begins after `start`, `night_in_progress` carries the preceding night, including polar nights without a sunset and times before `start` that have passed. A first cycle beginning after the culmination of a dark day instead carries that night itself, with rise, set, and transit null. When a body is already up, the partial first cycle has null rise and the imminent set; no set precedes its own rise. Circumpolar and never-rises cycles have null crossings and explanatory notes. At most 31 cycles are served per call; a count up to 366 returns the first 31 with a notice naming the exact `start` and `count` for the rest, or saying no continuation exists past 2100. A continuation may repeat the preceding night in `night_in_progress`, while cycles continue without overlap. Default elevation is 0 m; pass an IANA `timezone` for local output. Resolve coordinates upstream; this server does not geocode.",
|
|
94
108
|
annotations: { readOnlyHint: true, openWorldHint: false, idempotentHint: true },
|
|
95
109
|
input: z.object({
|
|
96
110
|
body: z
|
|
@@ -118,9 +132,9 @@ export const getRiseSetTool = tool('astronomy_get_rise_set', {
|
|
|
118
132
|
.number()
|
|
119
133
|
.int()
|
|
120
134
|
.min(1)
|
|
121
|
-
.max(
|
|
135
|
+
.max(RISE_SET_COUNT_CEILING)
|
|
122
136
|
.default(1)
|
|
123
|
-
.describe(
|
|
137
|
+
.describe(`Number of forward rise/set cycles to return. Default 1. At most ${RISE_SET_PER_CALL} are computed per call; a count up to ${RISE_SET_COUNT_CEILING} returns the first ${RISE_SET_PER_CALL} with a notice naming the \`start\` and \`count\` that continue the series.`),
|
|
124
138
|
timezone: z
|
|
125
139
|
.string()
|
|
126
140
|
.optional()
|
|
@@ -129,6 +143,16 @@ export const getRiseSetTool = tool('astronomy_get_rise_set', {
|
|
|
129
143
|
output: RiseSetOutput,
|
|
130
144
|
enrichment: {
|
|
131
145
|
totalCount: z.number().describe('Number of rise/set cycles returned.'),
|
|
146
|
+
truncated: z
|
|
147
|
+
.boolean()
|
|
148
|
+
.optional()
|
|
149
|
+
.describe('True when `count` exceeded the per-call cap and only the first cycles came back.'),
|
|
150
|
+
shown: z.number().optional().describe('Number of cycles returned when the cap applied.'),
|
|
151
|
+
cap: z.number().optional().describe('The per-call cycle cap that was applied.'),
|
|
152
|
+
notice: z
|
|
153
|
+
.string()
|
|
154
|
+
.optional()
|
|
155
|
+
.describe('How to retrieve the cycles the per-call cap held back: the exact `start` and `count` to re-call with, or — when the next cycle starts after 2100, the end of the supported span — that no call can continue the series. Absent when every requested cycle came back.'),
|
|
132
156
|
},
|
|
133
157
|
errors: [
|
|
134
158
|
{
|
|
@@ -144,6 +168,7 @@ export const getRiseSetTool = tool('astronomy_get_rise_set', {
|
|
|
144
168
|
reason: 'time_out_of_range',
|
|
145
169
|
code: JsonRpcErrorCode.InvalidParams,
|
|
146
170
|
when: "The requested start instant is outside the engine's high-accuracy span (≈1900–2100).",
|
|
171
|
+
// resolveTime() throws this reason with no hint, so this string is the wire hint.
|
|
147
172
|
recovery: 'Use a start date between 1900 and 2100 and retry.',
|
|
148
173
|
thrownBy: 'service',
|
|
149
174
|
},
|
|
@@ -165,9 +190,26 @@ export const getRiseSetTool = tool('astronomy_get_rise_set', {
|
|
|
165
190
|
longitude: input.longitude,
|
|
166
191
|
elevation: input.elevation,
|
|
167
192
|
};
|
|
168
|
-
const
|
|
193
|
+
const served = Math.min(input.count, RISE_SET_PER_CALL);
|
|
194
|
+
const { events, nightInProgress, resumeAt } = svc.riseSetSearch(input.body, observer, start, served, timezone);
|
|
169
195
|
ctx.log.info('Computed rise/set', { body: input.body, cycles: events.length });
|
|
170
196
|
ctx.enrich.total(events.length);
|
|
197
|
+
if (input.count > served) {
|
|
198
|
+
/**
|
|
199
|
+
* `resumeAt` is where the cycle loop itself would continue, so a call from there
|
|
200
|
+
* returns the next cycles exactly — none repeated, none skipped. The loop computes
|
|
201
|
+
* cycles past 2100 but `start` must lie inside the span, so a resume instant past it
|
|
202
|
+
* names no call: that one would fail time_out_of_range.
|
|
203
|
+
*/
|
|
204
|
+
const returned = `Returned ${events.length} of the ${input.count} requested cycles (${RISE_SET_PER_CALL} per call).`;
|
|
205
|
+
ctx.enrich.truncated({
|
|
206
|
+
shown: events.length,
|
|
207
|
+
cap: RISE_SET_PER_CALL,
|
|
208
|
+
guidance: resumeAt.getUTCFullYear() > SUPPORTED_SPAN.lastYear
|
|
209
|
+
? `${returned} The next cycle starts past the end of the supported span (${SUPPORTED_SPAN.lastYear}), so no call can continue the series.`
|
|
210
|
+
: `${returned} Re-call with start ${resumeAt.toISOString()} and count ${input.count - events.length} for the rest.`,
|
|
211
|
+
});
|
|
212
|
+
}
|
|
171
213
|
const out = {
|
|
172
214
|
body: input.body,
|
|
173
215
|
events: events.map((e) => ({
|
|
@@ -178,17 +220,10 @@ export const getRiseSetTool = tool('astronomy_get_rise_set', {
|
|
|
178
220
|
...(e.riseLocal ? { rise_local: e.riseLocal } : {}),
|
|
179
221
|
...(e.setLocal ? { set_local: e.setLocal } : {}),
|
|
180
222
|
...(e.transitLocal ? { transit_local: e.transitLocal } : {}),
|
|
181
|
-
...(e.twilight
|
|
182
|
-
? {
|
|
183
|
-
twilight: {
|
|
184
|
-
civil: toTwilightPair(e.twilight.civil),
|
|
185
|
-
nautical: toTwilightPair(e.twilight.nautical),
|
|
186
|
-
astronomical: toTwilightPair(e.twilight.astronomical),
|
|
187
|
-
},
|
|
188
|
-
}
|
|
189
|
-
: {}),
|
|
223
|
+
...(e.twilight ? { twilight: toTwilightSet(e.twilight) } : {}),
|
|
190
224
|
...(e.note ? { note: e.note } : {}),
|
|
191
225
|
})),
|
|
226
|
+
...(nightInProgress ? { night_in_progress: toTwilightSet(nightInProgress) } : {}),
|
|
192
227
|
};
|
|
193
228
|
return out;
|
|
194
229
|
},
|
|
@@ -196,6 +231,24 @@ export const getRiseSetTool = tool('astronomy_get_rise_set', {
|
|
|
196
231
|
const count = r.events.length;
|
|
197
232
|
const lines = [`## ${r.body} — ${count} rise/set cycle${count === 1 ? '' : 's'}`];
|
|
198
233
|
const stamp = (utc, local) => `${utc ?? 'none'}${local ? ` (local ${local})` : ''}`;
|
|
234
|
+
const twilightLines = (t) => {
|
|
235
|
+
const fmt = (label, p) => {
|
|
236
|
+
let line = ` ${label}: dawn ${p.dawn_utc ?? 'none'}, dusk ${p.dusk_utc ?? 'none'}`;
|
|
237
|
+
if (p.dawn_local)
|
|
238
|
+
line += `, dawn local ${p.dawn_local}`;
|
|
239
|
+
if (p.dusk_local)
|
|
240
|
+
line += `, dusk local ${p.dusk_local}`;
|
|
241
|
+
return line;
|
|
242
|
+
};
|
|
243
|
+
return [
|
|
244
|
+
fmt('Civil twilight', t.civil),
|
|
245
|
+
fmt('Nautical twilight', t.nautical),
|
|
246
|
+
fmt('Astronomical twilight', t.astronomical),
|
|
247
|
+
];
|
|
248
|
+
};
|
|
249
|
+
if (r.night_in_progress) {
|
|
250
|
+
lines.push('Night in progress (under way at the search start; times before the start have already passed):', ...twilightLines(r.night_in_progress));
|
|
251
|
+
}
|
|
199
252
|
r.events.forEach((e, i) => {
|
|
200
253
|
const alt = e.transit_altitude_degrees === null
|
|
201
254
|
? ''
|
|
@@ -203,19 +256,8 @@ export const getRiseSetTool = tool('astronomy_get_rise_set', {
|
|
|
203
256
|
lines.push(`${i + 1}. Rise ${stamp(e.rise_utc, e.rise_local)} · Set ${stamp(e.set_utc, e.set_local)} · Transit ${stamp(e.transit_utc, e.transit_local)}${alt}`);
|
|
204
257
|
if (e.note)
|
|
205
258
|
lines.push(` ${e.note}`);
|
|
206
|
-
if (e.twilight)
|
|
207
|
-
|
|
208
|
-
let line = ` ${label}: dawn ${p.dawn_utc ?? 'none'}, dusk ${p.dusk_utc ?? 'none'}`;
|
|
209
|
-
if (p.dawn_local)
|
|
210
|
-
line += `, dawn local ${p.dawn_local}`;
|
|
211
|
-
if (p.dusk_local)
|
|
212
|
-
line += `, dusk local ${p.dusk_local}`;
|
|
213
|
-
return line;
|
|
214
|
-
};
|
|
215
|
-
lines.push(fmt('Civil twilight', e.twilight.civil));
|
|
216
|
-
lines.push(fmt('Nautical twilight', e.twilight.nautical));
|
|
217
|
-
lines.push(fmt('Astronomical twilight', e.twilight.astronomical));
|
|
218
|
-
}
|
|
259
|
+
if (e.twilight)
|
|
260
|
+
lines.push(...twilightLines(e.twilight));
|
|
219
261
|
});
|
|
220
262
|
return [{ type: 'text', text: lines.join('\n') }];
|
|
221
263
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-rise-set.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-rise-set.tool.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"get-rise-set.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-rise-set.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,GAAG,EAAE,MAAM,sCAAsC,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAChG,OAAO,EAAE,UAAU,EAAuC,MAAM,+BAA+B,CAAC;AAEhG,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AiB,EAAE,CAAC;YACxB,KAAK,CAAC,IAAI,CACR,gGAAgG,EAChG,GAAG,aAAa,CAAC,CAAC,CAAC,iBAAiB,CAAC,CACtC,CAAC;QACJ,CAAC;QACD,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACxB,MAAM,GAAG,GACP,CAAC,CAAC,wBAAwB,KAAK,IAAI;gBACjC,CAAC,CAAC,EAAE;gBACJ,CAAC,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC,wBAAwB,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;YAC7D,KAAK,CAAC,IAAI,CACR,GAAG,CAAC,GAAG,CAAC,UAAU,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,UAAU,CAAC,UAAU,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC,cAAc,KAAK,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,aAAa,CAAC,GAAG,GAAG,EAAE,CACpJ,CAAC;YACF,IAAI,CAAC,CAAC,IAAI;gBAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;YACvC,IAAI,CAAC,CAAC,QAAQ;gBAAE,KAAK,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC3D,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview astronomy_get_satellite_passes — gated extension. Visible passes of a
|
|
3
3
|
* satellite (by NORAD catalog number, or by a name resolved against the catalog) over
|
|
4
|
-
* an observer, via a CelesTrak GP element set propagated with SGP4 offline
|
|
5
|
-
*
|
|
4
|
+
* an observer, via a CelesTrak GP element set propagated with SGP4 offline, each with
|
|
5
|
+
* the stretch of it visible to the naked eye. Searches at most
|
|
6
|
+
* `SATELLITE_DAYS_PER_CALL` days per call and names the exact `start` and `days` that
|
|
7
|
+
* continue a longer request, while that start stays inside the element set's epoch
|
|
8
|
+
* horizon. Registered only when ASTRONOMY_ENABLE_SATELLITES is set.
|
|
6
9
|
* @module mcp-server/tools/definitions/get-satellite-passes.tool
|
|
7
10
|
*/
|
|
8
11
|
import { z } from '@cyanheads/mcp-ts-core';
|
|
@@ -24,6 +27,14 @@ export declare const SatellitePassesOutput: z.ZodObject<{
|
|
|
24
27
|
peak_azimuth_degrees: z.ZodNumber;
|
|
25
28
|
duration_seconds: z.ZodNumber;
|
|
26
29
|
sunlit: z.ZodBoolean;
|
|
30
|
+
visible_start_utc: z.ZodString;
|
|
31
|
+
visible_end_utc: z.ZodString;
|
|
32
|
+
visible_start_local: z.ZodOptional<z.ZodString>;
|
|
33
|
+
visible_end_local: z.ZodOptional<z.ZodString>;
|
|
34
|
+
visible_start_altitude_degrees: z.ZodNumber;
|
|
35
|
+
visible_end_altitude_degrees: z.ZodNumber;
|
|
36
|
+
visible_start_azimuth_degrees: z.ZodNumber;
|
|
37
|
+
visible_end_azimuth_degrees: z.ZodNumber;
|
|
27
38
|
}, z.core.$strip>>;
|
|
28
39
|
}, z.core.$strip>;
|
|
29
40
|
export type SatellitePassesOutputType = z.infer<typeof SatellitePassesOutput>;
|
|
@@ -53,6 +64,14 @@ export declare const getSatellitePassesTool: import("@cyanheads/mcp-ts-core").To
|
|
|
53
64
|
peak_azimuth_degrees: z.ZodNumber;
|
|
54
65
|
duration_seconds: z.ZodNumber;
|
|
55
66
|
sunlit: z.ZodBoolean;
|
|
67
|
+
visible_start_utc: z.ZodString;
|
|
68
|
+
visible_end_utc: z.ZodString;
|
|
69
|
+
visible_start_local: z.ZodOptional<z.ZodString>;
|
|
70
|
+
visible_end_local: z.ZodOptional<z.ZodString>;
|
|
71
|
+
visible_start_altitude_degrees: z.ZodNumber;
|
|
72
|
+
visible_end_altitude_degrees: z.ZodNumber;
|
|
73
|
+
visible_start_azimuth_degrees: z.ZodNumber;
|
|
74
|
+
visible_end_azimuth_degrees: z.ZodNumber;
|
|
56
75
|
}, z.core.$strip>>;
|
|
57
76
|
}, z.core.$strip>, readonly [{
|
|
58
77
|
readonly reason: "invalid_time";
|
|
@@ -63,7 +82,11 @@ export declare const getSatellitePassesTool: import("@cyanheads/mcp-ts-core").To
|
|
|
63
82
|
}, {
|
|
64
83
|
readonly reason: "time_out_of_range";
|
|
65
84
|
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
66
|
-
readonly when: "The start instant
|
|
85
|
+
readonly when: "The start instant falls outside the years 1900–2100, or more than about a month from the epoch of the current element set — checked on the epoch distance itself, since SGP4 keeps returning positions well past the point where the mean elements describe the orbit.";
|
|
86
|
+
/**
|
|
87
|
+
* Both checks send this hint: resolveTime()'s year-span rejection carries none, so the
|
|
88
|
+
* framework fills it, and SatelliteService writes it verbatim at the epoch-distance throw.
|
|
89
|
+
*/
|
|
67
90
|
readonly recovery: "An element set describes the orbit for weeks either side of its epoch — request a start within about a month of today.";
|
|
68
91
|
readonly thrownBy: "service";
|
|
69
92
|
}, {
|
|
@@ -116,5 +139,6 @@ export declare const getSatellitePassesTool: import("@cyanheads/mcp-ts-core").To
|
|
|
116
139
|
readonly thrownBy: "service";
|
|
117
140
|
}], {
|
|
118
141
|
readonly totalCount: z.ZodNumber;
|
|
142
|
+
readonly notice: z.ZodOptional<z.ZodString>;
|
|
119
143
|
}>;
|
|
120
144
|
//# sourceMappingURL=get-satellite-passes.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-satellite-passes.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-satellite-passes.tool.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"get-satellite-passes.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-satellite-passes.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAajE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiHhC,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE9E,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAyG7B;;;OAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8LP,CAAC"}
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview astronomy_get_satellite_passes — gated extension. Visible passes of a
|
|
3
3
|
* satellite (by NORAD catalog number, or by a name resolved against the catalog) over
|
|
4
|
-
* an observer, via a CelesTrak GP element set propagated with SGP4 offline
|
|
5
|
-
*
|
|
4
|
+
* an observer, via a CelesTrak GP element set propagated with SGP4 offline, each with
|
|
5
|
+
* the stretch of it visible to the naked eye. Searches at most
|
|
6
|
+
* `SATELLITE_DAYS_PER_CALL` days per call and names the exact `start` and `days` that
|
|
7
|
+
* continue a longer request, while that start stays inside the element set's epoch
|
|
8
|
+
* horizon. Registered only when ASTRONOMY_ENABLE_SATELLITES is set.
|
|
6
9
|
* @module mcp-server/tools/definitions/get-satellite-passes.tool
|
|
7
10
|
*/
|
|
8
11
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
9
12
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
13
|
+
import { escapeMarkdownInline } from '@cyanheads/mcp-ts-core/utils';
|
|
10
14
|
import { getServerConfig } from '../../../config/server-config.js';
|
|
11
15
|
import { num } from '../format-numbers.js';
|
|
12
16
|
import { getEphemerisService } from '../../../services/ephemeris/ephemeris-service.js';
|
|
13
17
|
import { getSatelliteService } from '../../../services/satellite/satellite-service.js';
|
|
18
|
+
/** Days searched per call; a larger `days` is served this many with a resume notice. */
|
|
19
|
+
const SATELLITE_DAYS_PER_CALL = 10;
|
|
20
|
+
/** Largest `days` accepted — the element set's own month-long reach. Past it the schema rejects. */
|
|
21
|
+
const SATELLITE_DAYS_CEILING = 30;
|
|
14
22
|
export const SatellitePassesOutput = z.object({
|
|
15
23
|
norad_id: z.number().describe('The NORAD catalog number echoed from the request.'),
|
|
16
24
|
satellite_name: z
|
|
@@ -26,9 +34,13 @@ export const SatellitePassesOutput = z.object({
|
|
|
26
34
|
.object({
|
|
27
35
|
rise_utc: z
|
|
28
36
|
.string()
|
|
29
|
-
.describe('
|
|
30
|
-
peak_utc: z
|
|
31
|
-
|
|
37
|
+
.describe('Rise above the horizon in ISO 8601 UTC, within 1 s of the true crossing. Can fall up to 30 s before `start` when the satellite rose inside the 30-second scan step ending at `start`.'),
|
|
38
|
+
peak_utc: z
|
|
39
|
+
.string()
|
|
40
|
+
.describe('Time of maximum elevation in ISO 8601 UTC, the highest sample of a 30-second scan.'),
|
|
41
|
+
set_utc: z
|
|
42
|
+
.string()
|
|
43
|
+
.describe('Set below the horizon in ISO 8601 UTC, within 1 s of the true crossing.'),
|
|
32
44
|
rise_local: z
|
|
33
45
|
.string()
|
|
34
46
|
.optional()
|
|
@@ -43,23 +55,51 @@ export const SatellitePassesOutput = z.object({
|
|
|
43
55
|
.describe('Set time in observer-local time, present only when a timezone was supplied.'),
|
|
44
56
|
peak_altitude_degrees: z
|
|
45
57
|
.number()
|
|
46
|
-
.describe('Maximum elevation angle during the pass, in degrees.'),
|
|
58
|
+
.describe('Maximum elevation angle during the pass, in degrees, as sampled every 30 seconds.'),
|
|
47
59
|
rise_azimuth_degrees: z
|
|
48
60
|
.number()
|
|
49
|
-
.describe('Azimuth at
|
|
50
|
-
set_azimuth_degrees: z.number().describe('Azimuth at
|
|
61
|
+
.describe('Azimuth at `rise_utc`, in degrees (0=N, 90=E, 180=S, 270=W).'),
|
|
62
|
+
set_azimuth_degrees: z.number().describe('Azimuth at `set_utc`, in degrees.'),
|
|
51
63
|
peak_azimuth_degrees: z.number().describe('Azimuth at peak elevation, in degrees.'),
|
|
52
|
-
duration_seconds: z
|
|
64
|
+
duration_seconds: z
|
|
65
|
+
.number()
|
|
66
|
+
.describe('Pass duration from `rise_utc` to `set_utc`, in seconds.'),
|
|
53
67
|
sunlit: z
|
|
54
68
|
.boolean()
|
|
55
|
-
.describe(
|
|
69
|
+
.describe("True when the satellite is in sunlight at the peak instant. False on a pass that enters Earth's shadow before its peak or leaves it after — the visible_* fields say when it can be seen."),
|
|
70
|
+
visible_start_utc: z
|
|
71
|
+
.string()
|
|
72
|
+
.describe("Start of the visible stretch — above the horizon, sunlit, over a dark sky — in ISO 8601 UTC. Equals `rise_utc` when the pass is visible from its rise; otherwise within 1 s of the moment it leaves Earth's shadow or the sky darkens."),
|
|
73
|
+
visible_end_utc: z
|
|
74
|
+
.string()
|
|
75
|
+
.describe("End of the visible stretch in ISO 8601 UTC. Equals `set_utc` when the pass is visible until it sets; otherwise within 1 s of the moment it enters Earth's shadow or the sky brightens."),
|
|
76
|
+
visible_start_local: z
|
|
77
|
+
.string()
|
|
78
|
+
.optional()
|
|
79
|
+
.describe('Visible-stretch start in observer-local time, present only when a timezone was supplied.'),
|
|
80
|
+
visible_end_local: z
|
|
81
|
+
.string()
|
|
82
|
+
.optional()
|
|
83
|
+
.describe('Visible-stretch end in observer-local time, present only when a timezone was supplied.'),
|
|
84
|
+
visible_start_altitude_degrees: z
|
|
85
|
+
.number()
|
|
86
|
+
.describe('Elevation where the visible stretch starts, in degrees — 0 when it starts at the rise.'),
|
|
87
|
+
visible_end_altitude_degrees: z
|
|
88
|
+
.number()
|
|
89
|
+
.describe('Elevation where the visible stretch ends, in degrees — 0 when it ends at the set.'),
|
|
90
|
+
visible_start_azimuth_degrees: z
|
|
91
|
+
.number()
|
|
92
|
+
.describe('Azimuth where the visible stretch starts, in degrees — where to look first.'),
|
|
93
|
+
visible_end_azimuth_degrees: z
|
|
94
|
+
.number()
|
|
95
|
+
.describe('Azimuth where the visible stretch ends, in degrees.'),
|
|
56
96
|
})
|
|
57
|
-
.describe('One visible pass
|
|
58
|
-
.describe('
|
|
97
|
+
.describe('One visible pass: horizon-to-horizon rise/peak/set geometry, illumination at peak, and the stretch of the pass that is visible to the naked eye.'))
|
|
98
|
+
.describe('Passes whose visible stretch — the satellite above the horizon and sunlit while the Sun is below −6° for the observer — reaches 10° elevation, in the window searched, chronological.'),
|
|
59
99
|
});
|
|
60
100
|
export const getSatellitePassesTool = tool('astronomy_get_satellite_passes', {
|
|
61
101
|
title: 'astronomy-mcp-server: get satellite passes',
|
|
62
|
-
description: "Predict visible passes of a satellite (e.g. the ISS, NORAD 25544) over an observer in the next `days`. Identify the satellite by exactly one of `norad_id` or `name` — supplying both, or neither, is rejected. A few well-known common names resolve directly to their catalog numbers, ignoring case: ISS or International Space Station (25544), Hubble, Hubble Space Telescope, or HST (20580), and Tiangong, CSS, or Chinese Space Station (48274). Any other `name` is matched as a case-insensitive substring of CelesTrak's catalog names, so it resolves only when it picks out a single object: a broader query comes back with the matching objects and their catalog numbers to choose from. Either way the result echoes the query that resolved it as `resolved_from_name`. Fetches the object's current GP element set from CelesTrak, propagates it with SGP4 in-process, and returns each pass's rise, peak, and set times with azimuths and the peak elevation
|
|
102
|
+
description: "Predict visible passes of a satellite (e.g. the ISS, NORAD 25544) over an observer in the next `days`. Identify the satellite by exactly one of `norad_id` or `name` — supplying both, or neither, is rejected. A few well-known common names resolve directly to their catalog numbers, ignoring case: ISS or International Space Station (25544), Hubble, Hubble Space Telescope, or HST (20580), and Tiangong, CSS, or Chinese Space Station (48274). Any other `name` is matched as a case-insensitive substring of CelesTrak's catalog names, so it resolves only when it picks out a single object: a broader query comes back with the matching objects and their catalog numbers to choose from. Either way the result echoes the query that resolved it as `resolved_from_name`. Fetches the object's current GP element set from CelesTrak, propagates it with SGP4 in-process, and returns each pass's rise, peak, and set times with azimuths and the peak elevation, plus the stretch of the pass visible to the naked eye: `visible_start_utc` through `visible_end_utc`, with the elevation and azimuth at each end. A pass is returned when that visible stretch — the satellite above the horizon and sunlit while the Sun is below −6° for the observer — reaches 10° elevation, wherever in the pass it falls. `sunlit` reports illumination at the peak instant, so it is false on a pass seen only before it enters Earth's shadow or after it leaves. Rise, set, and the visible-stretch edges are within 1 s of the true instants; the peak is the highest sample of a 30-second scan. Every returned pass rises in the requested window or in the 30 s before `start`: a pass up longer than that at `start` is omitted rather than reported with `start` as its rise, so back up `start` to see it, while a pass still up when the window ends is reported through its actual set. Searches at most 10 days per call: a larger `days`, up to 30, searches the first 10 and returns a notice naming the exact `start` and `days` that continue the search with no pass repeated or skipped, while that start stays within about a month of the element set's epoch. A `start` further than about a month from the element set's epoch is rejected as out of range on that distance alone, and an element set that will not propagate to a window inside that horizon is rejected as a reentry — so an empty `passes` means only that nothing was visible. CelesTrak publishes only current element sets, so in practice `start` must be within about a month of today. NORAD catalog numbers and catalog names are found at celestrak.org or heavens-above.com. This is a gated, network-backed extension (CelesTrak is keyless but rate-limited; element sets are cached briefly). Default elevation 0 m; pass an IANA timezone for observer-local pass times.",
|
|
63
103
|
annotations: { readOnlyHint: true, openWorldHint: true, idempotentHint: true },
|
|
64
104
|
input: z
|
|
65
105
|
.object({
|
|
@@ -91,9 +131,9 @@ export const getSatellitePassesTool = tool('astronomy_get_satellite_passes', {
|
|
|
91
131
|
.number()
|
|
92
132
|
.int()
|
|
93
133
|
.min(1)
|
|
94
|
-
.max(
|
|
134
|
+
.max(SATELLITE_DAYS_CEILING)
|
|
95
135
|
.default(7)
|
|
96
|
-
.describe(
|
|
136
|
+
.describe(`Number of days ahead to search for passes. Default 7. At most ${SATELLITE_DAYS_PER_CALL} are searched per call; a value up to ${SATELLITE_DAYS_CEILING} searches the first ${SATELLITE_DAYS_PER_CALL} with a notice naming the \`start\` and \`days\` that continue the search.`),
|
|
97
137
|
start: z
|
|
98
138
|
.string()
|
|
99
139
|
.optional()
|
|
@@ -128,7 +168,11 @@ export const getSatellitePassesTool = tool('astronomy_get_satellite_passes', {
|
|
|
128
168
|
}),
|
|
129
169
|
output: SatellitePassesOutput,
|
|
130
170
|
enrichment: {
|
|
131
|
-
totalCount: z.number().describe('Number of visible passes found in the window.'),
|
|
171
|
+
totalCount: z.number().describe('Number of visible passes found in the window searched.'),
|
|
172
|
+
notice: z
|
|
173
|
+
.string()
|
|
174
|
+
.optional()
|
|
175
|
+
.describe("How to search the days the per-call cap held back: the exact `start` and `days` to re-call with, or — when that start would lie more than about a month from the element set's epoch — that no call can search them. Absent when every requested day was searched."),
|
|
132
176
|
},
|
|
133
177
|
errors: [
|
|
134
178
|
{
|
|
@@ -143,7 +187,11 @@ export const getSatellitePassesTool = tool('astronomy_get_satellite_passes', {
|
|
|
143
187
|
{
|
|
144
188
|
reason: 'time_out_of_range',
|
|
145
189
|
code: JsonRpcErrorCode.InvalidParams,
|
|
146
|
-
when: 'The start instant
|
|
190
|
+
when: 'The start instant falls outside the years 1900–2100, or more than about a month from the epoch of the current element set — checked on the epoch distance itself, since SGP4 keeps returning positions well past the point where the mean elements describe the orbit.',
|
|
191
|
+
/**
|
|
192
|
+
* Both checks send this hint: resolveTime()'s year-span rejection carries none, so the
|
|
193
|
+
* framework fills it, and SatelliteService writes it verbatim at the epoch-distance throw.
|
|
194
|
+
*/
|
|
147
195
|
recovery: 'An element set describes the orbit for weeks either side of its epoch — request a start within about a month of today.',
|
|
148
196
|
thrownBy: 'service',
|
|
149
197
|
},
|
|
@@ -224,7 +272,9 @@ export const getSatellitePassesTool = tool('astronomy_get_satellite_passes', {
|
|
|
224
272
|
/**
|
|
225
273
|
* resolveTime() validates the instant (invalid_time / time_out_of_range) and returns
|
|
226
274
|
* now when start is omitted — an Invalid Date here would yield NaN SGP4 positions and a
|
|
227
|
-
* silently empty, falsely-successful pass list.
|
|
275
|
+
* silently empty, falsely-successful pass list. Its year-span rejection carries no
|
|
276
|
+
* hint, so this tool's declared recovery fills it — the one that also covers the
|
|
277
|
+
* epoch-distance check.
|
|
228
278
|
*/
|
|
229
279
|
const start = ephSvc.resolveTime(input.start);
|
|
230
280
|
const observer = {
|
|
@@ -240,13 +290,29 @@ export const getSatellitePassesTool = tool('astronomy_get_satellite_passes', {
|
|
|
240
290
|
? await satSvc.resolveByName(nameQuery, ctx)
|
|
241
291
|
: await satSvc.fetchElementSet(noradId, ctx);
|
|
242
292
|
const formatLocal = timezone ? (d) => ephSvc.formatLocal(d, timezone) : undefined;
|
|
243
|
-
const
|
|
293
|
+
const searchedDays = Math.min(input.days, SATELLITE_DAYS_PER_CALL);
|
|
294
|
+
const result = satSvc.predictPasses(elements, observer, searchedDays, start, formatLocal);
|
|
244
295
|
ctx.log.info('Predicted satellite passes', {
|
|
245
296
|
noradId: result.noradId,
|
|
246
297
|
resolvedFromName: nameQuery,
|
|
247
298
|
passes: result.passes.length,
|
|
248
299
|
});
|
|
249
300
|
ctx.enrich.total(result.passes.length);
|
|
301
|
+
if (input.days > searchedDays) {
|
|
302
|
+
/**
|
|
303
|
+
* `resumeAt` is one scan step past the window's end: this call already reported every
|
|
304
|
+
* pass rising by then, through its set, so a call from there continues the search
|
|
305
|
+
* with none repeated and none skipped. The epoch horizon checks `start` only, so a
|
|
306
|
+
* window opened late in it can end with the resume instant beyond it — that call
|
|
307
|
+
* would fail time_out_of_range, and its recovery cannot reach the days left, so the
|
|
308
|
+
* notice names no call then.
|
|
309
|
+
*/
|
|
310
|
+
const searched = `Searched ${searchedDays} of the ${input.days} requested days (${SATELLITE_DAYS_PER_CALL} per call), through ${result.windowEnd.toISOString()}.`;
|
|
311
|
+
const remaining = input.days - searchedDays;
|
|
312
|
+
ctx.enrich.notice(result.resumeInRange
|
|
313
|
+
? `${searched} Re-call with start ${result.resumeAt.toISOString()} and days ${remaining} for the rest.`
|
|
314
|
+
: `${searched} The remaining ${remaining} days start more than about a month from the element set's epoch, where it no longer describes the orbit, so no call can search them.`);
|
|
315
|
+
}
|
|
250
316
|
const out = {
|
|
251
317
|
norad_id: result.noradId,
|
|
252
318
|
satellite_name: result.satelliteName,
|
|
@@ -264,20 +330,29 @@ export const getSatellitePassesTool = tool('astronomy_get_satellite_passes', {
|
|
|
264
330
|
peak_azimuth_degrees: p.peakAzimuthDegrees,
|
|
265
331
|
duration_seconds: p.durationSeconds,
|
|
266
332
|
sunlit: p.sunlit,
|
|
333
|
+
visible_start_utc: p.visibleStartUtc,
|
|
334
|
+
visible_end_utc: p.visibleEndUtc,
|
|
335
|
+
...(p.visibleStartLocal ? { visible_start_local: p.visibleStartLocal } : {}),
|
|
336
|
+
...(p.visibleEndLocal ? { visible_end_local: p.visibleEndLocal } : {}),
|
|
337
|
+
visible_start_altitude_degrees: p.visibleStartAltitudeDegrees,
|
|
338
|
+
visible_end_altitude_degrees: p.visibleEndAltitudeDegrees,
|
|
339
|
+
visible_start_azimuth_degrees: p.visibleStartAzimuthDegrees,
|
|
340
|
+
visible_end_azimuth_degrees: p.visibleEndAzimuthDegrees,
|
|
267
341
|
})),
|
|
268
342
|
};
|
|
269
343
|
return out;
|
|
270
344
|
},
|
|
271
345
|
format: (r) => {
|
|
272
346
|
const lines = [];
|
|
273
|
-
const nameLabel = r.satellite_name ? `${r.satellite_name} ` : '';
|
|
347
|
+
const nameLabel = r.satellite_name ? `${escapeMarkdownInline(r.satellite_name)} ` : '';
|
|
274
348
|
lines.push(`## ${nameLabel}(NORAD ${r.norad_id}) — ${r.passes.length} visible pass${r.passes.length === 1 ? '' : 'es'}`);
|
|
275
349
|
if (r.resolved_from_name)
|
|
276
|
-
lines.push(`Resolved from the name query "${r.resolved_from_name}".`);
|
|
350
|
+
lines.push(`Resolved from the name query "${escapeMarkdownInline(r.resolved_from_name)}".`);
|
|
277
351
|
if (r.passes.length === 0)
|
|
278
|
-
lines.push('No visible passes in the
|
|
352
|
+
lines.push('No visible passes in the window searched (sunlit satellite over a dark sky, reaching 10°).');
|
|
353
|
+
const local = (stamp) => (stamp ? ` (local ${stamp})` : '');
|
|
279
354
|
for (const p of r.passes) {
|
|
280
|
-
lines.push(`- rise_utc ${p.rise_utc}${
|
|
355
|
+
lines.push(`- rise_utc ${p.rise_utc}${local(p.rise_local)} az ${num(p.rise_azimuth_degrees, 1, '°')} → peak_utc ${p.peak_utc}${local(p.peak_local)} alt ${num(p.peak_altitude_degrees, 1, '°')} az ${num(p.peak_azimuth_degrees, 1, '°')} → set_utc ${p.set_utc}${local(p.set_local)} az ${num(p.set_azimuth_degrees, 1, '°')}, duration ${num(p.duration_seconds, 0, 's')}, sunlit ${p.sunlit}`, ` visible: visible_start_utc ${p.visible_start_utc}${local(p.visible_start_local)} alt ${num(p.visible_start_altitude_degrees, 1, '°')} az ${num(p.visible_start_azimuth_degrees, 1, '°')} → visible_end_utc ${p.visible_end_utc}${local(p.visible_end_local)} alt ${num(p.visible_end_altitude_degrees, 1, '°')} az ${num(p.visible_end_azimuth_degrees, 1, '°')}`);
|
|
281
356
|
}
|
|
282
357
|
return [{ type: 'text', text: lines.join('\n') }];
|
|
283
358
|
},
|