@cyanheads/nasa-power-mcp-server 0.2.0 → 0.3.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/AGENTS.md +7 -5
- package/CLAUDE.md +7 -5
- package/Dockerfile +3 -3
- package/README.md +35 -8
- package/changelog/0.3.x/0.3.0.md +35 -0
- package/dist/config/server-config.d.ts +1 -0
- package/dist/config/server-config.d.ts.map +1 -1
- package/dist/config/server-config.js +11 -1
- package/dist/config/server-config.js.map +1 -1
- package/dist/index.js +2 -8
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/tools/definitions/comparison-contracts.d.ts +7 -2
- package/dist/mcp-server/tools/definitions/comparison-contracts.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/comparison-contracts.js +3 -1
- package/dist/mcp-server/tools/definitions/comparison-contracts.js.map +1 -1
- package/dist/mcp-server/tools/definitions/nasa-power-compare-locations.tool.d.ts +5 -0
- package/dist/mcp-server/tools/definitions/nasa-power-compare-locations.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/nasa-power-dataframe-describe.tool.d.ts +1 -0
- package/dist/mcp-server/tools/definitions/nasa-power-dataframe-describe.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/nasa-power-get-climatology.tool.d.ts +15 -0
- package/dist/mcp-server/tools/definitions/nasa-power-get-climatology.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/nasa-power-get-climatology.tool.js +21 -3
- package/dist/mcp-server/tools/definitions/nasa-power-get-climatology.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/nasa-power-get-region.tool.d.ts +24 -4
- package/dist/mcp-server/tools/definitions/nasa-power-get-region.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/nasa-power-get-region.tool.js +9 -3
- package/dist/mcp-server/tools/definitions/nasa-power-get-region.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/nasa-power-get-timeseries.tool.d.ts +2 -0
- package/dist/mcp-server/tools/definitions/nasa-power-get-timeseries.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/nasa-power-list-reference.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/nasa-power-list-reference.tool.js +5 -5
- package/dist/mcp-server/tools/definitions/nasa-power-list-reference.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/point-contracts.d.ts +2 -0
- package/dist/mcp-server/tools/definitions/point-contracts.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/point-contracts.js +1 -5
- package/dist/mcp-server/tools/definitions/point-contracts.js.map +1 -1
- package/dist/services/canvas/canvas-service.d.ts +9 -3
- package/dist/services/canvas/canvas-service.d.ts.map +1 -1
- package/dist/services/canvas/canvas-service.js +58 -32
- package/dist/services/canvas/canvas-service.js.map +1 -1
- package/dist/services/canvas/format.d.ts +0 -1
- package/dist/services/canvas/format.d.ts.map +1 -1
- package/dist/services/canvas/format.js +3 -3
- package/dist/services/canvas/format.js.map +1 -1
- package/dist/services/canvas/types.d.ts +11 -1
- package/dist/services/canvas/types.d.ts.map +1 -1
- package/dist/services/canvas/types.js +2 -3
- package/dist/services/canvas/types.js.map +1 -1
- package/dist/services/power/normalize.d.ts.map +1 -1
- package/dist/services/power/normalize.js +24 -8
- package/dist/services/power/normalize.js.map +1 -1
- package/dist/services/power/power-service.d.ts.map +1 -1
- package/dist/services/power/power-service.js +9 -3
- package/dist/services/power/power-service.js.map +1 -1
- package/dist/services/power/presets.d.ts +2 -0
- package/dist/services/power/presets.d.ts.map +1 -1
- package/dist/services/power/presets.js +2 -0
- package/dist/services/power/presets.js.map +1 -1
- package/dist/services/power/types.d.ts +5 -3
- package/dist/services/power/types.d.ts.map +1 -1
- package/dist/services/power/types.js +12 -4
- package/dist/services/power/types.js.map +1 -1
- package/package.json +9 -7
- package/server.json +37 -19
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** @fileoverview Retrieve complete point climatology data. @module mcp-server/tools/definitions/nasa-power-get-climatology.tool */
|
|
2
2
|
import { tool } from '@cyanheads/mcp-ts-core';
|
|
3
|
+
import { CanvasIdSchema } from '@cyanheads/mcp-ts-core/canvas';
|
|
3
4
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
4
5
|
import { formatFaithfully } from '../../../services/canvas/format.js';
|
|
5
6
|
import { NormalizedClimatologyRequestSchema, PowerRequestSchema } from '../../../services/power/index.js';
|
|
@@ -7,13 +8,29 @@ import { PointOutputSchema, presentPoint } from './point-contracts.js';
|
|
|
7
8
|
/** Retrieve source observations with complete scientific provenance. */
|
|
8
9
|
export const getClimatologyTool = tool('nasa_power_get_climatology', {
|
|
9
10
|
title: 'Get NASA POWER climatology',
|
|
10
|
-
description: 'Retrieve complete monthly and annual climatology at latitude/longitude. Optionally supply both startYear and endYear; omitted years use the source product range. Use nasa_power_list_reference for presets and tilted solar aliases.
|
|
11
|
+
description: 'Retrieve complete monthly and annual climatology at latitude/longitude. Optionally supply both startYear and endYear; omitted years use the source product range. Use nasa_power_list_reference for presets and tilted solar aliases. Small profiles remain inline; larger profiles return a complete table handle and bounded preview, preserving orientation text. Supply canvas_id to reuse a returned workspace.',
|
|
11
12
|
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
12
|
-
input: PowerRequestSchema.options[3].omit({ temporalResolution: true })
|
|
13
|
+
input: PowerRequestSchema.options[3].omit({ temporalResolution: true }).extend({
|
|
14
|
+
canvas_id: CanvasIdSchema.optional().describe('Reuse a returned canvas token for an oversized profile'),
|
|
15
|
+
}),
|
|
13
16
|
output: PointOutputSchema.extend({
|
|
14
17
|
request: NormalizedClimatologyRequestSchema.describe('Normalized climatology request and corrections'),
|
|
15
18
|
}),
|
|
16
19
|
errors: [
|
|
20
|
+
{
|
|
21
|
+
reason: 'canvas_required',
|
|
22
|
+
code: JsonRpcErrorCode.ConfigurationError,
|
|
23
|
+
when: 'Oversized observations require an enabled workspace',
|
|
24
|
+
recovery: 'Narrow the request for inline output, or use the npm or Docker distribution with CANVAS_PROVIDER_TYPE=duckdb.',
|
|
25
|
+
thrownBy: 'service',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
reason: 'canvas_not_found',
|
|
29
|
+
code: JsonRpcErrorCode.NotFound,
|
|
30
|
+
when: 'The supplied workspace token is absent or expired',
|
|
31
|
+
recovery: 'Check canvas_id against the producing response, or rerun the producing tool to stage a fresh dataset.',
|
|
32
|
+
thrownBy: 'service',
|
|
33
|
+
},
|
|
17
34
|
{
|
|
18
35
|
reason: 'unsupported_parameter',
|
|
19
36
|
code: JsonRpcErrorCode.ValidationError,
|
|
@@ -82,7 +99,8 @@ export const getClimatologyTool = tool('nasa_power_get_climatology', {
|
|
|
82
99
|
},
|
|
83
100
|
],
|
|
84
101
|
async handler(input, ctx) {
|
|
85
|
-
const
|
|
102
|
+
const { canvas_id, ...request } = input;
|
|
103
|
+
const output = await presentPoint({ ...request, temporalResolution: 'climatology' }, canvas_id, ctx, 'nasa_power_get_climatology');
|
|
86
104
|
return {
|
|
87
105
|
...output,
|
|
88
106
|
request: { ...output.request, temporalResolution: 'climatology' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nasa-power-get-climatology.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/nasa-power-get-climatology.tool.ts"],"names":[],"mappings":"AAAA,mIAAmI;AACnI,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,kCAAkC,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACnG,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACvE,wEAAwE;AACxE,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC,4BAA4B,EAAE;IACnE,KAAK,EAAE,4BAA4B;IACnC,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"nasa-power-get-climatology.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/nasa-power-get-climatology.tool.ts"],"names":[],"mappings":"AAAA,mIAAmI;AACnI,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,kCAAkC,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACnG,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACvE,wEAAwE;AACxE,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC,4BAA4B,EAAE;IACnE,KAAK,EAAE,4BAA4B;IACnC,WAAW,EACT,sZAAsZ;IACxZ,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;IACxD,KAAK,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;QAC7E,SAAS,EAAE,cAAc,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAC3C,wDAAwD,CACzD;KACF,CAAC;IACF,MAAM,EAAE,iBAAiB,CAAC,MAAM,CAAC;QAC/B,OAAO,EAAE,kCAAkC,CAAC,QAAQ,CAClD,gDAAgD,CACjD;KACF,CAAC;IACF,MAAM,EAAE;QACN;YACE,MAAM,EAAE,iBAAiB;YACzB,IAAI,EAAE,gBAAgB,CAAC,kBAAkB;YACzC,IAAI,EAAE,qDAAqD;YAC3D,QAAQ,EACN,+GAA+G;YACjH,QAAQ,EAAE,SAAS;SACpB;QACD;YACE,MAAM,EAA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AE,SAAS;YACnB,SAAS,EAAE,IAAI;SAChB;QACD;YACE,MAAM,EAAE,eAAe;YACvB,IAAI,EAAE,gBAAgB,CAAC,eAAe;YACtC,IAAI,EAAE,gDAAgD;YACtD,QAAQ,EACN,sGAAsG;YACxG,QAAQ,EAAE,SAAS;SACpB;QACD;YACE,MAAM,EAAE,2BAA2B;YACnC,IAAI,EAAE,gBAAgB,CAAC,WAAW;YAClC,IAAI,EAAE,qDAAqD;YAC3D,QAAQ,EACN,iGAAiG;YACnG,QAAQ,EAAE,SAAS;YACnB,SAAS,EAAE,IAAI;SAChB;KACF;IACD,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG;QACtB,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,EAAE,GAAG,KAAK,CAAC;QACxC,MAAM,MAAM,GAAG,MAAM,YAAY,CAC/B,EAAE,GAAG,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,EACjD,SAAS,EACT,GAAG,EACH,4BAA4B,CAC7B,CAAC;QACF,OAAO;YACL,GAAG,MAAM;YACT,OAAO,EAAE,EAAE,GAAG,MAAM,CAAC,OAAO,EAAE,kBAAkB,EAAE,aAAsB,EAAE;SAC3E,CAAC;IACJ,CAAC;IACD,MAAM,EAAE,gBAAgB;CACzB,CAAC,CAAC"}
|
|
@@ -62,14 +62,12 @@ export declare const getRegionTool: import("@cyanheads/mcp-ts-core").ToolDefinit
|
|
|
62
62
|
LST: "LST";
|
|
63
63
|
UTC: "UTC";
|
|
64
64
|
}>>;
|
|
65
|
-
temporalResolution: z.ZodLiteral<"climatology">;
|
|
66
|
-
startYear: z.ZodOptional<z.ZodNumber>;
|
|
67
|
-
endYear: z.ZodOptional<z.ZodNumber>;
|
|
68
65
|
latitudeMin: z.ZodNumber;
|
|
69
66
|
latitudeMax: z.ZodNumber;
|
|
70
67
|
longitudeMin: z.ZodNumber;
|
|
71
68
|
longitudeMax: z.ZodNumber;
|
|
72
69
|
parameter: z.ZodString;
|
|
70
|
+
temporalResolution: z.ZodLiteral<"climatology">;
|
|
73
71
|
canvas_id: z.ZodOptional<z.ZodString>;
|
|
74
72
|
}, z.core.$strict>], "temporalResolution">, z.ZodObject<{
|
|
75
73
|
metadata: z.ZodObject<{
|
|
@@ -107,6 +105,7 @@ export declare const getRegionTool: import("@cyanheads/mcp-ts-core").ToolDefinit
|
|
|
107
105
|
longName: z.ZodOptional<z.ZodString>;
|
|
108
106
|
units: z.ZodOptional<z.ZodString>;
|
|
109
107
|
valueKind: z.ZodEnum<{
|
|
108
|
+
categorical: "categorical";
|
|
110
109
|
number: "number";
|
|
111
110
|
orientation: "orientation";
|
|
112
111
|
}>;
|
|
@@ -196,6 +195,27 @@ export declare const getRegionTool: import("@cyanheads/mcp-ts-core").ToolDefinit
|
|
|
196
195
|
nullable: z.ZodBoolean;
|
|
197
196
|
units: z.ZodOptional<z.ZodString>;
|
|
198
197
|
valueKind: z.ZodOptional<z.ZodEnum<{
|
|
198
|
+
categorical: "categorical";
|
|
199
|
+
number: "number";
|
|
200
|
+
orientation: "orientation";
|
|
201
|
+
}>>;
|
|
202
|
+
}, z.core.$strip>>;
|
|
203
|
+
describeTool: z.ZodLiteral<"nasa_power_dataframe_describe">;
|
|
204
|
+
queryTool: z.ZodLiteral<"nasa_power_dataframe_query">;
|
|
205
|
+
}, z.core.$strip>>;
|
|
206
|
+
summaryCount: z.ZodOptional<z.ZodNumber>;
|
|
207
|
+
summaryDataset: z.ZodOptional<z.ZodObject<{
|
|
208
|
+
canvas_id: z.ZodString;
|
|
209
|
+
table: z.ZodString;
|
|
210
|
+
rowCount: z.ZodNumber;
|
|
211
|
+
expiresAt: z.ZodString;
|
|
212
|
+
columns: z.ZodArray<z.ZodObject<{
|
|
213
|
+
name: z.ZodString;
|
|
214
|
+
type: z.ZodString;
|
|
215
|
+
nullable: z.ZodBoolean;
|
|
216
|
+
units: z.ZodOptional<z.ZodString>;
|
|
217
|
+
valueKind: z.ZodOptional<z.ZodEnum<{
|
|
218
|
+
categorical: "categorical";
|
|
199
219
|
number: "number";
|
|
200
220
|
orientation: "orientation";
|
|
201
221
|
}>>;
|
|
@@ -213,7 +233,7 @@ export declare const getRegionTool: import("@cyanheads/mcp-ts-core").ToolDefinit
|
|
|
213
233
|
readonly reason: "invalid_window";
|
|
214
234
|
readonly code: JsonRpcErrorCode.ValidationError;
|
|
215
235
|
readonly when: "The requested window is reversed or outside source coverage";
|
|
216
|
-
readonly recovery: "Use nasa_power_list_reference topic coverage and send an ordered window
|
|
236
|
+
readonly recovery: "Use nasa_power_list_reference topic coverage and send an ordered window. Omit year fields for regional climatology; use nasa_power_get_climatology for custom point years.";
|
|
217
237
|
readonly thrownBy: "service";
|
|
218
238
|
}, {
|
|
219
239
|
readonly reason: "invalid_correction";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nasa-power-get-region.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/nasa-power-get-region.tool.ts"],"names":[],"mappings":"AAAA,iIAAiI;AACjI,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAUjE,uEAAuE;AACvE,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"nasa-power-get-region.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/nasa-power-get-region.tool.ts"],"names":[],"mappings":"AAAA,iIAAiI;AACjI,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAUjE,uEAAuE;AACvE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAyIxB,CAAC"}
|
|
@@ -8,7 +8,7 @@ import { DatasetHandleSchema, getPowerService, RegionalDatasetSchema, RegionRequ
|
|
|
8
8
|
/** Retrieve one parameter across the complete returned native grid. */
|
|
9
9
|
export const getRegionTool = tool('nasa_power_get_region', {
|
|
10
10
|
title: 'Get NASA POWER region',
|
|
11
|
-
description: 'Retrieve one parameter over ordered latitude/longitude bounds spanning 2–10 degrees per axis, at daily, monthly or climatology resolution. Split antimeridian regions into separate calls. Returns cell identities and separate per-period equal-weight cell statistics, not area-weighted estimates. Oversized
|
|
11
|
+
description: 'Retrieve one parameter over ordered latitude/longitude bounds spanning 2–10 degrees per axis, at daily, monthly or climatology resolution. Regional climatology uses the precomputed source period and accepts no year fields; use nasa_power_get_climatology for custom years at a point. Split antimeridian regions into separate calls. Returns cell identities and separate per-period equal-weight cell statistics, not area-weighted estimates. Oversized observations and summaries stage completely with previews, exact counts and SQL handles; query summaryDataset in summaryIndex order.',
|
|
12
12
|
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
13
13
|
input: z.discriminatedUnion('temporalResolution', [
|
|
14
14
|
RegionRequestSchema.options[0].extend({
|
|
@@ -24,6 +24,12 @@ export const getRegionTool = tool('nasa_power_get_region', {
|
|
|
24
24
|
output: RegionalDatasetSchema.extend({
|
|
25
25
|
rowCount: z.number().int().describe('Exact full normalized observation count'),
|
|
26
26
|
dataset: DatasetHandleSchema.nullable().describe('Full-table handle on overflow, otherwise null'),
|
|
27
|
+
summaryCount: z
|
|
28
|
+
.number()
|
|
29
|
+
.int()
|
|
30
|
+
.optional()
|
|
31
|
+
.describe('Exact complete cross-cell summary count when summaries are staged'),
|
|
32
|
+
summaryDataset: DatasetHandleSchema.optional().describe('Complete cross-cell summaries ordered by summaryIndex; SQL NULL units restore an omitted source unit'),
|
|
27
33
|
}),
|
|
28
34
|
errors: [
|
|
29
35
|
{
|
|
@@ -37,7 +43,7 @@ export const getRegionTool = tool('nasa_power_get_region', {
|
|
|
37
43
|
reason: 'invalid_window',
|
|
38
44
|
code: JsonRpcErrorCode.ValidationError,
|
|
39
45
|
when: 'The requested window is reversed or outside source coverage',
|
|
40
|
-
recovery: 'Use nasa_power_list_reference topic coverage and send an ordered window
|
|
46
|
+
recovery: 'Use nasa_power_list_reference topic coverage and send an ordered window. Omit year fields for regional climatology; use nasa_power_get_climatology for custom point years.',
|
|
41
47
|
thrownBy: 'service',
|
|
42
48
|
},
|
|
43
49
|
{
|
|
@@ -113,7 +119,7 @@ export const getRegionTool = tool('nasa_power_get_region', {
|
|
|
113
119
|
const power = getPowerService();
|
|
114
120
|
const budget = power.createCallBudget(producerCtx);
|
|
115
121
|
const callCtx = { ...producerCtx, signal: budget.signal };
|
|
116
|
-
return canvas.
|
|
122
|
+
return canvas.presentRegion(await power.region(request, callCtx, budget), canvas_id, callCtx, 'nasa_power_get_region');
|
|
117
123
|
});
|
|
118
124
|
},
|
|
119
125
|
format: formatFaithfully,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nasa-power-get-region.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/nasa-power-get-region.tool.ts"],"names":[],"mappings":"AAAA,iIAAiI;AACjI,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AAEnC,uEAAuE;AACvE,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,uBAAuB,EAAE;IACzD,KAAK,EAAE,uBAAuB;IAC9B,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"nasa-power-get-region.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/nasa-power-get-region.tool.ts"],"names":[],"mappings":"AAAA,iIAAiI;AACjI,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AAEnC,uEAAuE;AACvE,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,uBAAuB,EAAE;IACzD,KAAK,EAAE,uBAAuB;IAC9B,WAAW,EACT,skBAAskB;IACxkB,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;IACxD,KAAK,EAAE,CAAC,CAAC,kBAAkB,CAAC,oBAAoB,EAAE;QAChD,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;YACpC,SAAS,EAAE,cAAc,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;SAC5F,CAAC;QACF,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;YACpC,SAAS,EAAE,cAAc,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;SAC5F,CAAC;QACF,mBAAmB,C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AAG,gBAAgB,EAAE,CAAC;QAClC,OAAO,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE;YAC9D,MAAM,KAAK,GAAG,eAAe,EAAE,CAAC;YAChC,MAAM,MAAM,GAAG,KAAK,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;YACnD,MAAM,OAAO,GAAG,EAAE,GAAG,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;YAC1D,OAAO,MAAM,CAAC,aAAa,CACzB,MAAM,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAC5C,SAAS,EACT,OAAO,EACP,uBAAuB,CACxB,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IACD,MAAM,EAAE,gBAAgB;CACzB,CAAC,CAAC"}
|
|
@@ -270,6 +270,7 @@ export declare const getTimeseriesTool: import("@cyanheads/mcp-ts-core").ToolDef
|
|
|
270
270
|
longName: z.ZodOptional<z.ZodString>;
|
|
271
271
|
units: z.ZodOptional<z.ZodString>;
|
|
272
272
|
valueKind: z.ZodEnum<{
|
|
273
|
+
categorical: "categorical";
|
|
273
274
|
number: "number";
|
|
274
275
|
orientation: "orientation";
|
|
275
276
|
}>;
|
|
@@ -333,6 +334,7 @@ export declare const getTimeseriesTool: import("@cyanheads/mcp-ts-core").ToolDef
|
|
|
333
334
|
nullable: z.ZodBoolean;
|
|
334
335
|
units: z.ZodOptional<z.ZodString>;
|
|
335
336
|
valueKind: z.ZodOptional<z.ZodEnum<{
|
|
337
|
+
categorical: "categorical";
|
|
336
338
|
number: "number";
|
|
337
339
|
orientation: "orientation";
|
|
338
340
|
}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nasa-power-get-timeseries.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/nasa-power-get-timeseries.tool.ts"],"names":[],"mappings":"AAAA,iIAAiI;AACjI,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE,wEAAwE;AACxE,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"nasa-power-get-timeseries.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/nasa-power-get-timeseries.tool.ts"],"names":[],"mappings":"AAAA,iIAAiI;AACjI,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE,wEAAwE;AACxE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAwH5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nasa-power-list-reference.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/nasa-power-list-reference.tool.ts"],"names":[],"mappings":"AAAA,6HAA6H;AAC7H,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AA8BjD,4DAA4D;AAC5D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"nasa-power-list-reference.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/nasa-power-list-reference.tool.ts"],"names":[],"mappings":"AAAA,6HAA6H;AAC7H,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AA8BjD,4DAA4D;AAC5D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAuL5B,CAAC"}
|
|
@@ -107,7 +107,7 @@ export const listReferenceTool = tool('nasa_power_list_reference', {
|
|
|
107
107
|
resolutions: ['hourly'],
|
|
108
108
|
description: 'Hourly coverage begins in 2001. Endpoint dates include every source hour; LST labels have no UTC offset.',
|
|
109
109
|
});
|
|
110
|
-
guidance.push('Recent records can be missing because release latency differs by product; current dates are allowed without guaranteeing valid observations.', 'Monthly annual keys and climatology ANN remain separate from monthly records. Custom climatology years must be paired and within current product configuration.');
|
|
110
|
+
guidance.push('Recent records can be missing because release latency differs by product; current dates are allowed without guaranteeing valid observations.', 'Monthly annual keys and climatology ANN remain separate from monthly records. Custom point climatology years must be paired and within current product configuration. Regional climatology accepts no year fields and reports its precomputed source period; use nasa_power_get_climatology for custom point years.');
|
|
111
111
|
}
|
|
112
112
|
else if (topic === 'missing_data') {
|
|
113
113
|
entries.push({
|
|
@@ -123,7 +123,7 @@ export const listReferenceTool = tool('nasa_power_list_reference', {
|
|
|
123
123
|
code: 'observation_mean',
|
|
124
124
|
description: 'Arithmetic means use valid numbers within each period kind. They are not weighted climate normals, annual energy yields or water balances.',
|
|
125
125
|
});
|
|
126
|
-
guidance.push('No complete requested calendar is synthesized. All-null statistics remain null. Annual records never enter monthly means; orientation strings have no numeric
|
|
126
|
+
guidance.push('No complete requested calendar is synthesized. All-null statistics remain null. Annual records never enter monthly means; orientation strings and categorical T_ZONES/TM_ZONES codes have no arithmetic summaries or numeric comparison sort metrics. Climate-zone codes remain numeric in observations and SQL.');
|
|
127
127
|
}
|
|
128
128
|
else if (topic === 'wind_surfaces') {
|
|
129
129
|
for (const [code, description] of Object.entries(WIND_SURFACES))
|
|
@@ -150,10 +150,10 @@ export const listReferenceTool = tool('nasa_power_list_reference', {
|
|
|
150
150
|
available: config.canvas.providerType === 'duckdb',
|
|
151
151
|
dropEnabled: getServerConfig().dataframeDropEnabled,
|
|
152
152
|
tableTtlInMs: POWER_LIMITS.tableTtlMs,
|
|
153
|
-
canvasTtlInMs:
|
|
154
|
-
absoluteLifetimeInMs:
|
|
153
|
+
canvasTtlInMs: config.canvas.ttlMs,
|
|
154
|
+
absoluteLifetimeInMs: config.canvas.absoluteCapMs,
|
|
155
155
|
});
|
|
156
|
-
guidance.push('Use nasa_power_dataframe_describe and nasa_power_dataframe_query with the exact returned canvas_id. Tokens expire and cannot cross processes.', 'Oversized comparison summaries have summaryDatasets handles; query in summaryIndex order and group location summaries by locationId. SQL NULL units restore an omitted source unit.', 'npm and Docker installs stage larger tables in DuckDB by default; the portable MCPB supports inline data only. Narrow the request when no native provider is available.');
|
|
156
|
+
guidance.push('Use nasa_power_dataframe_describe and nasa_power_dataframe_query with the exact returned canvas_id. Tokens expire and cannot cross processes.', 'Oversized comparison summaries have summaryDatasets handles; query in summaryIndex order and group location summaries by locationId. SQL NULL units restore an omitted source unit.', 'Oversized regional summaries have a summaryDataset handle and exact summaryCount; query in summaryIndex order to restore every cross-cell summary.', 'npm and Docker installs stage larger tables in DuckDB by default; the portable MCPB supports inline data only. Narrow the request when no native provider is available.');
|
|
157
157
|
if (getServerConfig().dataframeDropEnabled)
|
|
158
158
|
guidance.push('Use nasa_power_dataframe_drop to remove one explicitly named staged table. Removing the final table retires the canvas; later calls with that token return canvas_not_found.');
|
|
159
159
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nasa-power-list-reference.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/nasa-power-list-reference.tool.ts"],"names":[],"mappings":"AAAA,6HAA6H;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A0G;aAC7G,CACF,CAAC;YACF,QAAQ,CAAC,IAAI,CACX,8IAA8I,EAC9I,
|
|
1
|
+
{"version":3,"file":"nasa-power-list-reference.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/nasa-power-list-reference.tool.ts"],"names":[],"mappings":"AAAA,6HAA6H;AAC7H,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAEnG,MAAM,WAAW,GAAG,CAAC;KAClB,IAAI,CAAC,CAAC,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,CAAC,CAAC;KAC3F,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AAC/B,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC;IACjD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;IACtE,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;IACnF,OAAO,EAAE,CAAC;SACP,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACjB,QAAQ,EAAE;SACV,QAAQ,CAAC,mFAAmF,CAAC;IAChG,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,E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AC5F,CACF,CAAC;YACF,QAAQ,CAAC,IAAI,CACX,uIAAuI,CACxI,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,IAAI,CAAC;gBACX,IAAI,EAAE,YAAY;gBAClB,WAAW,EACT,qNAAqN;gBACvN,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,KAAK,QAAQ;gBAClD,WAAW,EAAE,eAAe,EAAE,CAAC,oBAAoB;gBACnD,YAAY,EAAE,YAAY,CAAC,UAAU;gBACrC,aAAa,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK;gBAClC,oBAAoB,EAAE,MAAM,CAAC,MAAM,CAAC,aAAa;aAClD,CAAC,CAAC;YACH,QAAQ,CAAC,IAAI,CACX,+IAA+I,EAC/I,qLAAqL,EACrL,oJAAoJ,EACpJ,yKAAyK,CAC1K,CAAC;YACF,IAAI,eAAe,EAAE,CAAC,oBAAoB;gBACxC,QAAQ,CAAC,IAAI,CACX,8KAA8K,CAC/K,CAAC;QACN,CAAC;QACD,OAAO;YACL,KAAK;YACL,UAAU,EAAE,YAAY;YACxB,iBAAiB,EAAE;gBACjB,gDAAgD;gBAChD,+CAA+C;aAChD;YACD,OAAO;YACP,QAAQ;SACT,CAAC;IACJ,CAAC;IACD,MAAM,EAAE,gBAAgB;CACzB,CAAC,CAAC"}
|
|
@@ -103,6 +103,7 @@ export declare const PointOutputSchema: z.ZodObject<{
|
|
|
103
103
|
longName: z.ZodOptional<z.ZodString>;
|
|
104
104
|
units: z.ZodOptional<z.ZodString>;
|
|
105
105
|
valueKind: z.ZodEnum<{
|
|
106
|
+
categorical: "categorical";
|
|
106
107
|
number: "number";
|
|
107
108
|
orientation: "orientation";
|
|
108
109
|
}>;
|
|
@@ -166,6 +167,7 @@ export declare const PointOutputSchema: z.ZodObject<{
|
|
|
166
167
|
nullable: z.ZodBoolean;
|
|
167
168
|
units: z.ZodOptional<z.ZodString>;
|
|
168
169
|
valueKind: z.ZodOptional<z.ZodEnum<{
|
|
170
|
+
categorical: "categorical";
|
|
169
171
|
number: "number";
|
|
170
172
|
orientation: "orientation";
|
|
171
173
|
}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"point-contracts.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/point-contracts.ts"],"names":[],"mappings":"AAAA,sHAAsH;AACtH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"point-contracts.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/point-contracts.ts"],"names":[],"mappings":"AAAA,sHAAsH;AACtH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAE3C,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,2BAA2B,CAAC;AAEnC,iFAAiF;AACjF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAK5B,CAAC;AAEH,4FAA4F;AAC5F,wBAAgB,YAAY,CAC1B,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,GAAG,EAAE,OAAO,EACZ,UAAU,EAAE,MAAM,oHASnB"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { z } from '@cyanheads/mcp-ts-core';
|
|
2
|
-
import { POWER_LIMITS } from '../../../config/server-config.js';
|
|
3
2
|
import { getCanvasService } from '../../../services/canvas/index.js';
|
|
4
|
-
import { DatasetHandleSchema, getPowerService, PowerDatasetSchema,
|
|
3
|
+
import { DatasetHandleSchema, getPowerService, PowerDatasetSchema, } from '../../../services/power/index.js';
|
|
5
4
|
/** Full scientific envelope with exact row count and optional staged pointer. */
|
|
6
5
|
export const PointOutputSchema = PowerDatasetSchema.extend({
|
|
7
6
|
rowCount: z.number().int().describe('Exact full normalized observation count'),
|
|
@@ -14,9 +13,6 @@ export function presentPoint(request, canvasId, ctx, sourceTool) {
|
|
|
14
13
|
const budget = power.createCallBudget(producerCtx);
|
|
15
14
|
const callCtx = { ...producerCtx, signal: budget.signal };
|
|
16
15
|
const dataset = await power.point(request, callCtx, budget);
|
|
17
|
-
if (request.temporalResolution === 'climatology' &&
|
|
18
|
-
JSON.stringify(dataset.rows).length > POWER_LIMITS.inlineCharacters)
|
|
19
|
-
throw powerError('dataset_limit', 'Point climatology exceeds the complete inline profile budget.');
|
|
20
16
|
return getCanvasService().present(dataset, canvasId, callCtx, sourceTool);
|
|
21
17
|
});
|
|
22
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"point-contracts.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/point-contracts.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC3C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"point-contracts.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/point-contracts.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,kBAAkB,GAEnB,MAAM,2BAA2B,CAAC;AAEnC,iFAAiF;AACjF,MAAM,CAAC,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,MAAM,CAAC;IACzD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC;IAC9E,OAAO,EAAE,mBAAmB,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAC9C,0EAA0E,CAC3E;CACF,CAAC,CAAC;AAEH,4FAA4F;AAC5F,MAAM,UAAU,YAAY,CAC1B,OAAqB,EACrB,QAA4B,EAC5B,GAAY,EACZ,UAAkB;IAElB,OAAO,gBAAgB,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE;QAC1E,MAAM,KAAK,GAAG,eAAe,EAAE,CAAC;QAChC,MAAM,MAAM,GAAG,KAAK,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;QACnD,MAAM,OAAO,GAAG,EAAE,GAAG,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;QAC1D,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAC5D,OAAO,gBAAgB,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { Context } from '@cyanheads/mcp-ts-core';
|
|
2
2
|
import type { DataCanvas } from '@cyanheads/mcp-ts-core/canvas';
|
|
3
|
+
import type { AppConfig } from '@cyanheads/mcp-ts-core/config';
|
|
3
4
|
import type { StorageService } from '@cyanheads/mcp-ts-core/storage';
|
|
4
5
|
import { type ServerConfig } from '../../config/server-config.js';
|
|
5
|
-
import { type ComparisonDataset, type PresentableDataset, type PresentedDataset, type ScientificColumn } from './types.js';
|
|
6
|
+
import { type ComparisonDataset, type PresentableDataset, type PresentedDataset, type RegionalSummaryDataset, type ScientificColumn } from './types.js';
|
|
6
7
|
type SummaryTable = {
|
|
7
|
-
key: 'buckets' | 'locations';
|
|
8
|
+
key: 'buckets' | 'locations' | 'regional';
|
|
8
9
|
table: string;
|
|
9
10
|
rows: Record<string, string | number | boolean | null | undefined>[];
|
|
10
11
|
columns: ScientificColumn[];
|
|
@@ -15,6 +16,7 @@ export type CanvasServiceOptions = {
|
|
|
15
16
|
storage: StorageService;
|
|
16
17
|
now?: () => number;
|
|
17
18
|
config: ServerConfig;
|
|
19
|
+
canvasLimits?: Pick<AppConfig['canvas'], 'maxCanvasesPerTenant' | 'absoluteCapMs'>;
|
|
18
20
|
reconciliationMs?: number;
|
|
19
21
|
};
|
|
20
22
|
/** Explicit token access, atomic admission, and native-lifecycle reconciliation. */
|
|
@@ -23,6 +25,7 @@ export declare class CanvasService {
|
|
|
23
25
|
private readonly storage;
|
|
24
26
|
private readonly now;
|
|
25
27
|
private readonly config;
|
|
28
|
+
private readonly canvasLimits;
|
|
26
29
|
private readonly records;
|
|
27
30
|
private readonly producers;
|
|
28
31
|
private readonly operations;
|
|
@@ -38,6 +41,9 @@ export declare class CanvasService {
|
|
|
38
41
|
withProducer<T>(kind: 'single' | 'comparison', ctx: Context, run: (ctx: Context) => Promise<T>): Promise<T>;
|
|
39
42
|
/** Stage comparison summaries with observations only when the scientific envelope overflows. */
|
|
40
43
|
presentComparison<T extends ComparisonDataset>(dataset: T, canvasId: string | undefined, ctx: Context, sourceTool: string): Promise<PresentedDataset<T>>;
|
|
44
|
+
/** Stage complete cross-cell summaries when the no-observation regional envelope overflows. */
|
|
45
|
+
presentRegion<T extends RegionalSummaryDataset>(dataset: T, canvasId: string | undefined, ctx: Context, sourceTool: string): Promise<PresentedDataset<T>>;
|
|
46
|
+
private summaryTable;
|
|
41
47
|
/** Preserve the scientific envelope with complete staging and bounded whole-row previews. */
|
|
42
48
|
present<T extends PresentableDataset>(dataset: T, canvasId: string | undefined, ctx: Context, sourceTool: string, related?: SummaryTable[]): Promise<PresentedDataset<T>>;
|
|
43
49
|
/** Inspect only the supplied canvas, including original scientific provenance. */
|
|
@@ -55,7 +61,7 @@ export declare class CanvasService {
|
|
|
55
61
|
type: import("@cyanheads/mcp-ts-core/canvas").ColumnType;
|
|
56
62
|
nullable: boolean;
|
|
57
63
|
units?: string;
|
|
58
|
-
valueKind?: "number" | "orientation";
|
|
64
|
+
valueKind?: "categorical" | "number" | "orientation";
|
|
59
65
|
}[];
|
|
60
66
|
provenance: {
|
|
61
67
|
sourceTool: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canvas-service.d.ts","sourceRoot":"","sources":["../../../src/services/canvas/canvas-service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAGV,UAAU,EAEX,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"canvas-service.d.ts","sourceRoot":"","sources":["../../../src/services/canvas/canvas-service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAGV,UAAU,EAEX,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAI5E,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EAIrB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACtB,MAAM,YAAY,CAAC;AAEpB,KAAK,YAAY,GAAG;IAClB,GAAG,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,CAAC;IACrE,OAAO,EAAE,gBAAgB,EAAE,CAAC;CAC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;IAED,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,MAAM;IAQd,OAAO,CAAC,YAAY;IAGpB,OAAO,CAAC,GAAG;IAIX,OAAO,CAAC,OAAO;IAyCf,OAAO,CAAC,IAAI;IAUZ,OAAO,CAAC,OAAO;IAcf,OAAO,CAAC,OAAO;YA4ED,KAAK;IAoGnB,OAAO,CAAC,YAAY;YAMN,OAAO;YAqCP,cAAc;YAId,aAAa;YAYb,KAAK;CA0CpB;AAED,0EAA0E;AAC1E,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,oBAAoB,GAAG,aAAa,CAEhF;AAED,0DAA0D;AAC1D,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,oBAAoB,GAAG,aAAa,CAG9E;AACD,yDAAyD;AACzD,wBAAgB,gBAAgB,IAAI,aAAa,CAGhD"}
|
|
@@ -12,6 +12,7 @@ export class CanvasService {
|
|
|
12
12
|
storage;
|
|
13
13
|
now;
|
|
14
14
|
config;
|
|
15
|
+
canvasLimits;
|
|
15
16
|
records = new Map();
|
|
16
17
|
producers = new Set();
|
|
17
18
|
operations = new Set();
|
|
@@ -25,6 +26,10 @@ export class CanvasService {
|
|
|
25
26
|
this.storage = options.storage;
|
|
26
27
|
this.now = options.now ?? Date.now;
|
|
27
28
|
this.config = options.config;
|
|
29
|
+
this.canvasLimits = options.canvasLimits ?? {
|
|
30
|
+
maxCanvasesPerTenant: POWER_LIMITS.canvasesPerTenant,
|
|
31
|
+
absoluteCapMs: POWER_LIMITS.canvasAbsoluteTtlMs,
|
|
32
|
+
};
|
|
28
33
|
this.timer = setInterval(() => {
|
|
29
34
|
void this.reconcile().catch(() => {
|
|
30
35
|
/* Individual records retain reservations and log failures. */
|
|
@@ -84,6 +89,30 @@ export class CanvasService {
|
|
|
84
89
|
.flatMap((location) => location.summaries.map((summary) => ({ locationId: location.locationId, ...summary })))
|
|
85
90
|
.map((summary, summaryIndex) => ({ ...summary, summaryIndex })),
|
|
86
91
|
};
|
|
92
|
+
const tables = ['buckets', 'locations'].map((key) => this.summaryTable(key, summaryRows[key]));
|
|
93
|
+
const compact = {
|
|
94
|
+
...dataset,
|
|
95
|
+
summaries: dataset.summaries.slice(0, 1),
|
|
96
|
+
locations: dataset.locations.map((location) => ({
|
|
97
|
+
...location,
|
|
98
|
+
summaries: location.summaries.slice(0, 1),
|
|
99
|
+
summaryCount: location.summaries.length,
|
|
100
|
+
})),
|
|
101
|
+
};
|
|
102
|
+
return this.present(compact, canvasId, ctx, sourceTool, tables);
|
|
103
|
+
}
|
|
104
|
+
/** Stage complete cross-cell summaries when the no-observation regional envelope overflows. */
|
|
105
|
+
presentRegion(dataset, canvasId, ctx, sourceTool) {
|
|
106
|
+
if (this.fits({ ...dataset, rows: [], rowCount: dataset.rows.length, dataset: null }))
|
|
107
|
+
return this.present(dataset, canvasId, ctx, sourceTool);
|
|
108
|
+
const summaries = this.summaryTable('regional', dataset.summaries.map((summary, summaryIndex) => ({ ...summary, summaryIndex })));
|
|
109
|
+
return this.present({
|
|
110
|
+
...dataset,
|
|
111
|
+
summaries: dataset.summaries.slice(0, 1),
|
|
112
|
+
summaryCount: dataset.summaries.length,
|
|
113
|
+
}, canvasId, ctx, sourceTool, [summaries]);
|
|
114
|
+
}
|
|
115
|
+
summaryTable(key, rows) {
|
|
87
116
|
const strings = new Set([
|
|
88
117
|
'parameter',
|
|
89
118
|
'locationId',
|
|
@@ -91,42 +120,30 @@ export class CanvasService {
|
|
|
91
120
|
'bucket',
|
|
92
121
|
'method',
|
|
93
122
|
'periodKind',
|
|
123
|
+
'periodKey',
|
|
94
124
|
'firstReturnedKey',
|
|
95
125
|
'lastReturnedKey',
|
|
96
126
|
'lastValidPeriodKey',
|
|
97
127
|
'lastValidDate',
|
|
98
128
|
]);
|
|
99
129
|
const booleans = new Set(['complete', 'windowClipped']);
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
? '
|
|
111
|
-
:
|
|
112
|
-
? '
|
|
113
|
-
:
|
|
114
|
-
|
|
115
|
-
: 'DOUBLE',
|
|
116
|
-
nullable: true,
|
|
117
|
-
})),
|
|
118
|
-
};
|
|
119
|
-
});
|
|
120
|
-
const compact = {
|
|
121
|
-
...dataset,
|
|
122
|
-
summaries: dataset.summaries.slice(0, 1),
|
|
123
|
-
locations: dataset.locations.map((location) => ({
|
|
124
|
-
...location,
|
|
125
|
-
summaries: location.summaries.slice(0, 1),
|
|
126
|
-
summaryCount: location.summaries.length,
|
|
130
|
+
const names = new Set(rows.flatMap((row) => Object.keys(row)));
|
|
131
|
+
return {
|
|
132
|
+
key,
|
|
133
|
+
table: `power_${randomUUID().replaceAll('-', '')}`,
|
|
134
|
+
rows,
|
|
135
|
+
columns: [...names].map((name) => ({
|
|
136
|
+
name,
|
|
137
|
+
type: strings.has(name)
|
|
138
|
+
? 'VARCHAR'
|
|
139
|
+
: booleans.has(name)
|
|
140
|
+
? 'BOOLEAN'
|
|
141
|
+
: name === 'summaryIndex'
|
|
142
|
+
? 'INTEGER'
|
|
143
|
+
: 'DOUBLE',
|
|
144
|
+
nullable: true,
|
|
127
145
|
})),
|
|
128
146
|
};
|
|
129
|
-
return this.present(compact, canvasId, ctx, sourceTool, tables);
|
|
130
147
|
}
|
|
131
148
|
/** Preserve the scientific envelope with complete staging and bounded whole-row previews. */
|
|
132
149
|
async present(dataset, canvasId, ctx, sourceTool, related = []) {
|
|
@@ -157,6 +174,11 @@ export class CanvasService {
|
|
|
157
174
|
queryTool: 'nasa_power_dataframe_query',
|
|
158
175
|
});
|
|
159
176
|
const relatedHandles = (id, expiresAt) => {
|
|
177
|
+
const regional = related.find((item) => item.key === 'regional');
|
|
178
|
+
if (regional)
|
|
179
|
+
return {
|
|
180
|
+
summaryDataset: handle(id, expiresAt, regional.table, regional.rows.length, regional.columns),
|
|
181
|
+
};
|
|
160
182
|
const buckets = related.find((item) => item.key === 'buckets');
|
|
161
183
|
const locations = related.find((item) => item.key === 'locations');
|
|
162
184
|
return buckets && locations
|
|
@@ -185,6 +207,10 @@ export class CanvasService {
|
|
|
185
207
|
const expiry = (instance, info) => new Date(Math.min(Date.parse(info.expiresAt ?? instance.expiresAt), Date.parse(instance.expiresAt))).toISOString();
|
|
186
208
|
const operation = this.stage(canvas, record, table, dataset.rows, ctx, (instance, info) => {
|
|
187
209
|
const references = relatedHandles(instance.canvasId, expiry(instance, info));
|
|
210
|
+
if (related.length)
|
|
211
|
+
Object.assign(references, {
|
|
212
|
+
dataset: handle(instance.canvasId, expiry(instance, info), table, dataset.rows.length, columns),
|
|
213
|
+
});
|
|
188
214
|
for (const name of [table, ...related.map((item) => item.table)]) {
|
|
189
215
|
const staged = this.registration(record, name);
|
|
190
216
|
Object.assign(staged.provenance.envelope, references);
|
|
@@ -415,8 +441,8 @@ export class CanvasService {
|
|
|
415
441
|
const tenantRecords = records.filter((item) => item.tenant === ctx.tenantId);
|
|
416
442
|
const relatedBytes = related.reduce((sum, item) => sum + Buffer.byteLength(JSON.stringify(item.rows)), 0);
|
|
417
443
|
if (!record &&
|
|
418
|
-
(records.length >=
|
|
419
|
-
tenantRecords.length >=
|
|
444
|
+
(records.length >= this.config.maxCanvasesPerProcess ||
|
|
445
|
+
tenantRecords.length >= this.canvasLimits.maxCanvasesPerTenant))
|
|
420
446
|
throw canvasError('canvas_capacity_exhausted', 'The process or tenant canvas-count limit is exhausted.', this.config.dataframeDropEnabled
|
|
421
447
|
? 'Reuse an explicit live canvas_id, drop all tables from a canvas, or wait for canvas expiry.'
|
|
422
448
|
: 'Reuse an explicit live canvas_id, or wait for canvas expiry.');
|
|
@@ -498,7 +524,7 @@ export class CanvasService {
|
|
|
498
524
|
for (const registration of registrations) {
|
|
499
525
|
const entry = this.registration(record, registration.table);
|
|
500
526
|
await this.storage.set(this.key(record, registration.table), entry.provenance, ctx, {
|
|
501
|
-
ttl:
|
|
527
|
+
ttl: this.canvasLimits.absoluteCapMs / 1_000,
|
|
502
528
|
});
|
|
503
529
|
ctx.signal.throwIfAborted();
|
|
504
530
|
}
|
|
@@ -625,7 +651,7 @@ export class CanvasService {
|
|
|
625
651
|
await this.removeMetadata(record, table);
|
|
626
652
|
}
|
|
627
653
|
if ((record.tables.size === 0 && actual.length === 0) ||
|
|
628
|
-
this.now() - record.created >=
|
|
654
|
+
this.now() - record.created >= this.canvasLimits.absoluteCapMs) {
|
|
629
655
|
await this.canvas.drop(record.id, record.ctx);
|
|
630
656
|
await provider.destroyCanvas(record.id, record.ctx);
|
|
631
657
|
await this.confirmAbsent(record);
|