@mapbox/mcp-server 0.17.0-dev → 0.17.0-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/resources/BaseResource.d.ts +7 -0
- package/dist/commonjs/resources/BaseResource.d.ts.map +1 -1
- package/dist/commonjs/resources/BaseResource.js +13 -2
- package/dist/commonjs/resources/BaseResource.js.map +1 -1
- package/dist/commonjs/resources/category-list/CategoryListResource.d.ts +7 -2
- package/dist/commonjs/resources/category-list/CategoryListResource.d.ts.map +1 -1
- package/dist/commonjs/resources/category-list/CategoryListResource.js +14 -4
- package/dist/commonjs/resources/category-list/CategoryListResource.js.map +1 -1
- package/dist/commonjs/resources/place-photo/PlacePhotoResource.d.ts +1 -1
- package/dist/commonjs/resources/place-photo/PlacePhotoResource.js +2 -2
- package/dist/commonjs/resources/place-photo/PlacePhotoResource.js.map +1 -1
- package/dist/commonjs/resources/resourceRegistry.d.ts +2 -1
- package/dist/commonjs/resources/resourceRegistry.d.ts.map +1 -1
- package/dist/commonjs/resources/resourceRegistry.js +10 -5
- package/dist/commonjs/resources/resourceRegistry.js.map +1 -1
- package/dist/commonjs/resources/tool-response/ToolResponseResource.d.ts +6 -5
- package/dist/commonjs/resources/tool-response/ToolResponseResource.d.ts.map +1 -1
- package/dist/commonjs/resources/tool-response/ToolResponseResource.js +29 -5
- package/dist/commonjs/resources/tool-response/ToolResponseResource.js.map +1 -1
- package/dist/commonjs/resources/ui-apps/StaticMapViewerUIResource.d.ts +28 -0
- package/dist/commonjs/resources/ui-apps/StaticMapViewerUIResource.d.ts.map +1 -0
- package/dist/commonjs/resources/ui-apps/StaticMapViewerUIResource.js +64 -0
- package/dist/commonjs/resources/ui-apps/StaticMapViewerUIResource.js.map +1 -0
- package/dist/commonjs/resources/ui-apps/mapAppHtml.d.ts.map +1 -1
- package/dist/commonjs/resources/ui-apps/mapAppHtml.js +936 -223
- package/dist/commonjs/resources/ui-apps/mapAppHtml.js.map +1 -1
- package/dist/commonjs/resources/ui-apps/staticMapViewerHtml.d.ts +17 -0
- package/dist/commonjs/resources/ui-apps/staticMapViewerHtml.d.ts.map +1 -0
- package/dist/commonjs/resources/ui-apps/staticMapViewerHtml.js +180 -0
- package/dist/commonjs/resources/ui-apps/staticMapViewerHtml.js.map +1 -0
- package/dist/commonjs/tools/render-map-tool/RenderMapTool.d.ts.map +1 -1
- package/dist/commonjs/tools/render-map-tool/RenderMapTool.input.schema.d.ts +1 -0
- package/dist/commonjs/tools/render-map-tool/RenderMapTool.input.schema.d.ts.map +1 -1
- package/dist/commonjs/tools/render-map-tool/RenderMapTool.input.schema.js +10 -6
- package/dist/commonjs/tools/render-map-tool/RenderMapTool.input.schema.js.map +1 -1
- package/dist/commonjs/tools/render-map-tool/RenderMapTool.js +26 -12
- package/dist/commonjs/tools/render-map-tool/RenderMapTool.js.map +1 -1
- package/dist/commonjs/tools/render-map-tool/RenderMapTool.output.schema.d.ts +1 -0
- package/dist/commonjs/tools/render-map-tool/RenderMapTool.output.schema.d.ts.map +1 -1
- package/dist/commonjs/tools/resource-reader-tool/ResourceReaderTool.d.ts.map +1 -1
- package/dist/commonjs/tools/resource-reader-tool/ResourceReaderTool.js +43 -9
- package/dist/commonjs/tools/resource-reader-tool/ResourceReaderTool.js.map +1 -1
- package/dist/commonjs/tools/static-map-image-tool/StaticMapImageTool.d.ts +8 -1
- package/dist/commonjs/tools/static-map-image-tool/StaticMapImageTool.d.ts.map +1 -1
- package/dist/commonjs/tools/static-map-image-tool/StaticMapImageTool.js +113 -90
- package/dist/commonjs/tools/static-map-image-tool/StaticMapImageTool.js.map +1 -1
- package/dist/commonjs/tools/static-map-image-tool/buildStaticMapRequestUrl.d.ts +23 -0
- package/dist/commonjs/tools/static-map-image-tool/buildStaticMapRequestUrl.d.ts.map +1 -0
- package/dist/commonjs/tools/static-map-image-tool/buildStaticMapRequestUrl.js +84 -0
- package/dist/commonjs/tools/static-map-image-tool/buildStaticMapRequestUrl.js.map +1 -0
- package/dist/commonjs/utils/mapAppPayload.d.ts +15 -6
- package/dist/commonjs/utils/mapAppPayload.d.ts.map +1 -1
- package/dist/commonjs/utils/mapAppPayload.js +2 -1
- package/dist/commonjs/utils/mapAppPayload.js.map +1 -1
- package/dist/commonjs/utils/mapboxPublicToken.d.ts +5 -1
- package/dist/commonjs/utils/mapboxPublicToken.d.ts.map +1 -1
- package/dist/commonjs/utils/mapboxPublicToken.js +6 -1
- package/dist/commonjs/utils/mapboxPublicToken.js.map +1 -1
- package/dist/commonjs/utils/responseRef.d.ts +1 -1
- package/dist/commonjs/utils/responseRef.d.ts.map +1 -1
- package/dist/commonjs/utils/responseRef.js +1 -1
- package/dist/commonjs/utils/responseRef.js.map +1 -1
- package/dist/commonjs/version.json +3 -3
- package/dist/esm/resources/BaseResource.d.ts +7 -0
- package/dist/esm/resources/BaseResource.d.ts.map +1 -1
- package/dist/esm/resources/BaseResource.js +13 -2
- package/dist/esm/resources/BaseResource.js.map +1 -1
- package/dist/esm/resources/category-list/CategoryListResource.d.ts +7 -2
- package/dist/esm/resources/category-list/CategoryListResource.d.ts.map +1 -1
- package/dist/esm/resources/category-list/CategoryListResource.js +14 -4
- package/dist/esm/resources/category-list/CategoryListResource.js.map +1 -1
- package/dist/esm/resources/place-photo/PlacePhotoResource.d.ts +1 -1
- package/dist/esm/resources/place-photo/PlacePhotoResource.js +2 -2
- package/dist/esm/resources/place-photo/PlacePhotoResource.js.map +1 -1
- package/dist/esm/resources/resourceRegistry.d.ts +2 -1
- package/dist/esm/resources/resourceRegistry.d.ts.map +1 -1
- package/dist/esm/resources/resourceRegistry.js +10 -5
- package/dist/esm/resources/resourceRegistry.js.map +1 -1
- package/dist/esm/resources/tool-response/ToolResponseResource.d.ts +6 -5
- package/dist/esm/resources/tool-response/ToolResponseResource.d.ts.map +1 -1
- package/dist/esm/resources/tool-response/ToolResponseResource.js +29 -5
- package/dist/esm/resources/tool-response/ToolResponseResource.js.map +1 -1
- package/dist/esm/resources/ui-apps/StaticMapViewerUIResource.d.ts +28 -0
- package/dist/esm/resources/ui-apps/StaticMapViewerUIResource.d.ts.map +1 -0
- package/dist/esm/resources/ui-apps/StaticMapViewerUIResource.js +59 -0
- package/dist/esm/resources/ui-apps/StaticMapViewerUIResource.js.map +1 -0
- package/dist/esm/resources/ui-apps/mapAppHtml.d.ts.map +1 -1
- package/dist/esm/resources/ui-apps/mapAppHtml.js +936 -223
- package/dist/esm/resources/ui-apps/mapAppHtml.js.map +1 -1
- package/dist/esm/resources/ui-apps/staticMapViewerHtml.d.ts +17 -0
- package/dist/esm/resources/ui-apps/staticMapViewerHtml.d.ts.map +1 -0
- package/dist/esm/resources/ui-apps/staticMapViewerHtml.js +177 -0
- package/dist/esm/resources/ui-apps/staticMapViewerHtml.js.map +1 -0
- package/dist/esm/tools/render-map-tool/RenderMapTool.d.ts.map +1 -1
- package/dist/esm/tools/render-map-tool/RenderMapTool.input.schema.d.ts +1 -0
- package/dist/esm/tools/render-map-tool/RenderMapTool.input.schema.d.ts.map +1 -1
- package/dist/esm/tools/render-map-tool/RenderMapTool.input.schema.js +10 -6
- package/dist/esm/tools/render-map-tool/RenderMapTool.input.schema.js.map +1 -1
- package/dist/esm/tools/render-map-tool/RenderMapTool.js +26 -12
- package/dist/esm/tools/render-map-tool/RenderMapTool.js.map +1 -1
- package/dist/esm/tools/render-map-tool/RenderMapTool.output.schema.d.ts +1 -0
- package/dist/esm/tools/render-map-tool/RenderMapTool.output.schema.d.ts.map +1 -1
- package/dist/esm/tools/resource-reader-tool/ResourceReaderTool.d.ts.map +1 -1
- package/dist/esm/tools/resource-reader-tool/ResourceReaderTool.js +43 -9
- package/dist/esm/tools/resource-reader-tool/ResourceReaderTool.js.map +1 -1
- package/dist/esm/tools/static-map-image-tool/StaticMapImageTool.d.ts +8 -1
- package/dist/esm/tools/static-map-image-tool/StaticMapImageTool.d.ts.map +1 -1
- package/dist/esm/tools/static-map-image-tool/StaticMapImageTool.js +114 -91
- package/dist/esm/tools/static-map-image-tool/StaticMapImageTool.js.map +1 -1
- package/dist/esm/tools/static-map-image-tool/buildStaticMapRequestUrl.d.ts +23 -0
- package/dist/esm/tools/static-map-image-tool/buildStaticMapRequestUrl.d.ts.map +1 -0
- package/dist/esm/tools/static-map-image-tool/buildStaticMapRequestUrl.js +78 -0
- package/dist/esm/tools/static-map-image-tool/buildStaticMapRequestUrl.js.map +1 -0
- package/dist/esm/utils/mapAppPayload.d.ts +15 -6
- package/dist/esm/utils/mapAppPayload.d.ts.map +1 -1
- package/dist/esm/utils/mapAppPayload.js +2 -1
- package/dist/esm/utils/mapAppPayload.js.map +1 -1
- package/dist/esm/utils/mapboxPublicToken.d.ts +5 -1
- package/dist/esm/utils/mapboxPublicToken.d.ts.map +1 -1
- package/dist/esm/utils/mapboxPublicToken.js +6 -1
- package/dist/esm/utils/mapboxPublicToken.js.map +1 -1
- package/dist/esm/utils/responseRef.d.ts +1 -1
- package/dist/esm/utils/responseRef.d.ts.map +1 -1
- package/dist/esm/utils/responseRef.js +1 -1
- package/dist/esm/utils/responseRef.js.map +1 -1
- package/dist/esm/version.json +3 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapAppHtml.js","sourceRoot":"","sources":["../../../../src/resources/ui-apps/mapAppHtml.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,kCAAkC;AAIlC;;;;;;;;;GASG;AAEH,yEAAyE;AACzE,wEAAwE;AACxE,6EAA6E;AAC7E,8CAA8C;AAC9C,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AAE1C,MAAM,UAAU,gBAAgB,CAAC,MAKhC;IACC,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;IAC5C,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,IAAI,yBAAyB,CAAC;IACpE,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,IAAI,iBAAiB,CAAC;IAExD,MAAM,iBA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAsmF1C,CAAC;AACT,CAAC;AAED,SAAS,eAAe,CAAC,CAAS;IAChC,OAAO,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP App page for static_map_image_tool: shows the map image from the tool
|
|
3
|
+
* result at full width, inline in the chat.
|
|
4
|
+
*
|
|
5
|
+
* Hosts show a plain image result as a small thumbnail, and a model can't put
|
|
6
|
+
* that image in its own reply. This page gets the whole tool result from the
|
|
7
|
+
* host (ui/notifications/tool-result) and draws the image item as a data:
|
|
8
|
+
* URL, so it needs no token and makes no request. When the image went to a
|
|
9
|
+
* resource ref instead, it falls back to the public-token URL in the
|
|
10
|
+
* result's text, and only for the Mapbox API origin.
|
|
11
|
+
*
|
|
12
|
+
* Kept free of backslashes: this script lives in a template literal.
|
|
13
|
+
*/
|
|
14
|
+
export declare function renderStaticMapViewerHtml(params: {
|
|
15
|
+
apiEndpoint: string;
|
|
16
|
+
}): string;
|
|
17
|
+
//# sourceMappingURL=staticMapViewerHtml.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"staticMapViewerHtml.d.ts","sourceRoot":"","sources":["../../../../src/resources/ui-apps/staticMapViewerHtml.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE;IAChD,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,MAAM,CA+JT"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
// Copyright (c) Mapbox, Inc.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
/**
|
|
4
|
+
* MCP App page for static_map_image_tool: shows the map image from the tool
|
|
5
|
+
* result at full width, inline in the chat.
|
|
6
|
+
*
|
|
7
|
+
* Hosts show a plain image result as a small thumbnail, and a model can't put
|
|
8
|
+
* that image in its own reply. This page gets the whole tool result from the
|
|
9
|
+
* host (ui/notifications/tool-result) and draws the image item as a data:
|
|
10
|
+
* URL, so it needs no token and makes no request. When the image went to a
|
|
11
|
+
* resource ref instead, it falls back to the public-token URL in the
|
|
12
|
+
* result's text, and only for the Mapbox API origin.
|
|
13
|
+
*
|
|
14
|
+
* Kept free of backslashes: this script lives in a template literal.
|
|
15
|
+
*/
|
|
16
|
+
export function renderStaticMapViewerHtml(params) {
|
|
17
|
+
let apiOrigin = 'https://api.mapbox.com';
|
|
18
|
+
try {
|
|
19
|
+
apiOrigin = new URL(params.apiEndpoint).origin;
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
// Keep the default; an invalid endpoint can't serve images anyway.
|
|
23
|
+
}
|
|
24
|
+
return `<!doctype html>
|
|
25
|
+
<html>
|
|
26
|
+
<head>
|
|
27
|
+
<meta charset="utf-8">
|
|
28
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
29
|
+
<title>Static map</title>
|
|
30
|
+
<style>
|
|
31
|
+
html, body { margin: 0; padding: 0; background: transparent; }
|
|
32
|
+
#map { display: none; width: 100%; height: auto; border-radius: 8px; }
|
|
33
|
+
#message {
|
|
34
|
+
display: none; padding: 12px;
|
|
35
|
+
font: 14px system-ui, -apple-system, sans-serif; color: #64748b;
|
|
36
|
+
}
|
|
37
|
+
</style>
|
|
38
|
+
</head>
|
|
39
|
+
<body>
|
|
40
|
+
<img id="map" alt="Static map">
|
|
41
|
+
<div id="message"></div>
|
|
42
|
+
<script>
|
|
43
|
+
(function() {
|
|
44
|
+
var API_ORIGIN = ${JSON.stringify(apiOrigin)};
|
|
45
|
+
var IMAGE_TYPES = ['image/png', 'image/jpeg'];
|
|
46
|
+
var img = document.getElementById('map');
|
|
47
|
+
var messageEl = document.getElementById('message');
|
|
48
|
+
|
|
49
|
+
var messageId = 0;
|
|
50
|
+
var pending = {};
|
|
51
|
+
function send(message) {
|
|
52
|
+
try { window.parent.postMessage(message, '*'); } catch (_) {}
|
|
53
|
+
}
|
|
54
|
+
function request(method, params) {
|
|
55
|
+
var id = ++messageId;
|
|
56
|
+
send({ jsonrpc: '2.0', id: id, method: method, params: params || {} });
|
|
57
|
+
return new Promise(function(resolve, reject) {
|
|
58
|
+
pending[id] = { resolve: resolve, reject: reject };
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function notify(method, params) {
|
|
62
|
+
send({ jsonrpc: '2.0', method: method, params: params || {} });
|
|
63
|
+
}
|
|
64
|
+
function reportSize() {
|
|
65
|
+
var height = img.style.display === 'block'
|
|
66
|
+
? img.offsetHeight
|
|
67
|
+
: messageEl.offsetHeight;
|
|
68
|
+
if (height > 0) notify('ui/notifications/size-changed', { height: height });
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function showMessage(text) {
|
|
72
|
+
img.style.display = 'none';
|
|
73
|
+
messageEl.textContent = text;
|
|
74
|
+
messageEl.style.display = 'block';
|
|
75
|
+
reportSize();
|
|
76
|
+
}
|
|
77
|
+
function showImage(src, alt) {
|
|
78
|
+
messageEl.style.display = 'none';
|
|
79
|
+
img.alt = alt || 'Static map';
|
|
80
|
+
img.onload = reportSize;
|
|
81
|
+
img.onerror = function() { showMessage("The map image couldn't be loaded."); };
|
|
82
|
+
img.src = src;
|
|
83
|
+
img.style.display = 'block';
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// The tool's text starts "Static map image (WxH, style) ..." when the image
|
|
87
|
+
// is attached; use that as the alt text.
|
|
88
|
+
function altFrom(texts) {
|
|
89
|
+
for (var i = 0; i < texts.length; i++) {
|
|
90
|
+
var t = texts[i];
|
|
91
|
+
if (t.indexOf('Static map image (') === 0) {
|
|
92
|
+
return t.slice(0, t.indexOf(')') + 1);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return 'Static map';
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// A public-token URL for the Mapbox API in the result's text (its
|
|
99
|
+
// "Image URL:" line, or the link line when the viewer shows the map).
|
|
100
|
+
// Only that origin, and only with a public token.
|
|
101
|
+
function urlFrom(texts) {
|
|
102
|
+
var prefix = API_ORIGIN + '/';
|
|
103
|
+
for (var i = 0; i < texts.length; i++) {
|
|
104
|
+
var t = texts[i];
|
|
105
|
+
var start = t.indexOf(prefix);
|
|
106
|
+
while (start !== -1) {
|
|
107
|
+
var end = start;
|
|
108
|
+
while (end < t.length && ' )]>"'.indexOf(t.charAt(end)) === -1 &&
|
|
109
|
+
t.charCodeAt(end) > 32) {
|
|
110
|
+
end++;
|
|
111
|
+
}
|
|
112
|
+
var url = t.slice(start, end);
|
|
113
|
+
if (url.indexOf('access_token=pk.') !== -1) return url;
|
|
114
|
+
start = t.indexOf(prefix, end);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function handleToolResult(result) {
|
|
121
|
+
var content = (result && Array.isArray(result.content)) ? result.content : [];
|
|
122
|
+
var texts = [];
|
|
123
|
+
var image = null;
|
|
124
|
+
for (var i = 0; i < content.length; i++) {
|
|
125
|
+
var c = content[i];
|
|
126
|
+
if (!c) continue;
|
|
127
|
+
if (c.type === 'text' && typeof c.text === 'string') texts.push(c.text);
|
|
128
|
+
if (c.type === 'image' && typeof c.data === 'string' &&
|
|
129
|
+
IMAGE_TYPES.indexOf(c.mimeType) !== -1 && !image) {
|
|
130
|
+
image = c;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (result && result.isError) {
|
|
134
|
+
showMessage(texts.join(' ') || 'The static map could not be made.');
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (image) {
|
|
138
|
+
showImage('data:' + image.mimeType + ';base64,' + image.data, altFrom(texts));
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
var url = urlFrom(texts);
|
|
142
|
+
if (url) {
|
|
143
|
+
showImage(url, 'Static map');
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
showMessage("The map image isn't available here.");
|
|
147
|
+
}
|
|
148
|
+
window.__handleToolResult = handleToolResult;
|
|
149
|
+
|
|
150
|
+
window.addEventListener('message', function(event) {
|
|
151
|
+
var message = event.data;
|
|
152
|
+
if (!message || typeof message !== 'object') return;
|
|
153
|
+
if (message.id !== undefined && pending[message.id]) {
|
|
154
|
+
var handlers = pending[message.id];
|
|
155
|
+
delete pending[message.id];
|
|
156
|
+
if (message.error) handlers.reject(new Error(message.error.message));
|
|
157
|
+
else handlers.resolve(message.result);
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
if (message.method === 'ui/notifications/tool-result' && message.params) {
|
|
161
|
+
handleToolResult(message.params);
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
window.addEventListener('resize', reportSize);
|
|
165
|
+
|
|
166
|
+
function initialized() { notify('ui/notifications/initialized', {}); }
|
|
167
|
+
request('ui/initialize', {
|
|
168
|
+
protocolVersion: '2026-01-26',
|
|
169
|
+
appCapabilities: {},
|
|
170
|
+
appInfo: { name: 'Mapbox Static Map', version: '1.0.0' }
|
|
171
|
+
}).then(initialized, initialized);
|
|
172
|
+
})();
|
|
173
|
+
</script>
|
|
174
|
+
</body>
|
|
175
|
+
</html>`;
|
|
176
|
+
}
|
|
177
|
+
//# sourceMappingURL=staticMapViewerHtml.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"staticMapViewerHtml.js","sourceRoot":"","sources":["../../../../src/resources/ui-apps/staticMapViewerHtml.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,kCAAkC;AAElC;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,yBAAyB,CAAC,MAEzC;IACC,IAAI,SAAS,GAAG,wBAAwB,CAAC;IACzC,IAAI,CAAC;QACH,SAAS,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC;IACjD,CAAC;IAAC,MAAM,CAAC;QACP,mEAAmE;IACrE,CAAC;IACD,OAAO;;;;;;;;;;;;;;;;;;;;qBAoBY,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAmItC,CAAC;AACT,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderMapTool.d.ts","sourceRoot":"","sources":["../../../../src/tools/render-map-tool/RenderMapTool.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACd,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAEL,KAAK,SAAS,EACf,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,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gBAE/B,MAAM,EAAE;QAClB,WAAW,EAAE,WAAW,CAAC;QACzB,WAAW,CAAC,EAAE,MAAM,MAAM,CAAC;KAC5B;IAiBK,GAAG,CACP,QAAQ,EAAE,OAAO,EAEjB,KAAK,CAAC,EAAE,aAAa,GACpB,OAAO,CAAC,cAAc,CAAC;IA4J1B;;;;;;;OAOG;IACH,OAAO,CAAC,eAAe;CAoExB;AAED,YAAY,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -90,6 +90,7 @@ export declare const RenderMapInputSchema: z.ZodObject<{
|
|
|
90
90
|
standard: "standard";
|
|
91
91
|
"standard-satellite": "standard-satellite";
|
|
92
92
|
}>>;
|
|
93
|
+
showTraffic: z.ZodOptional<z.ZodBoolean>;
|
|
93
94
|
}, z.core.$strip>;
|
|
94
95
|
export type RenderMapInput = z.infer<typeof RenderMapInputSchema>;
|
|
95
96
|
//# sourceMappingURL=RenderMapTool.input.schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderMapTool.input.schema.d.ts","sourceRoot":"","sources":["../../../../src/tools/render-map-tool/RenderMapTool.input.schema.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAsJxB,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"RenderMapTool.input.schema.d.ts","sourceRoot":"","sources":["../../../../src/tools/render-map-tool/RenderMapTool.input.schema.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAsJxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsD/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -52,19 +52,19 @@ const markerSchema = z.object({
|
|
|
52
52
|
id: z
|
|
53
53
|
.string()
|
|
54
54
|
.optional()
|
|
55
|
-
.describe('A Mapbox POI\'s mapbox_id — e.g. the "Mapbox ID" field printed by category_search_tool/search_and_geocode_tool. Set this on a hand-composed POI marker to get the same auto-enriching results
|
|
55
|
+
.describe('A Mapbox POI\'s mapbox_id — e.g. the "Mapbox ID" field printed by category_search_tool/search_and_geocode_tool. Set this on a hand-composed POI marker to get the same auto-enriching results carousel card (popularity score, photo and today\'s hours when available, via one batched Place Details lookup) that a payload_refs-based search result gets automatically. Leave `style` and `label` unset for such a place: it is drawn as a white pin with an icon for its category, like search results. Set `style: "numbered"` with a `label` only when the number means something, such as a visit order. Omit `id` for non-POI markers (route endpoints, waypoints, etc.).'),
|
|
56
56
|
name: z
|
|
57
57
|
.string()
|
|
58
58
|
.optional()
|
|
59
|
-
.describe('Display name for the results
|
|
59
|
+
.describe('Display name for the results carousel card (and under its pin when selected). Only used when `id` is also set; falls back to "Result N" if omitted.'),
|
|
60
60
|
category: z
|
|
61
61
|
.string()
|
|
62
62
|
.optional()
|
|
63
|
-
.describe('Category shown
|
|
63
|
+
.describe('Category shown on the results carousel card (e.g. "Coffee Shop"), also used to pick the pin\'s icon. Only used when `id` is also set.'),
|
|
64
64
|
distanceMeters: z
|
|
65
65
|
.number()
|
|
66
66
|
.optional()
|
|
67
|
-
.describe('Distance in meters, shown
|
|
67
|
+
.describe('Distance in meters, shown on the results carousel card. Only used when `id` is also set.')
|
|
68
68
|
});
|
|
69
69
|
const legendEntrySchema = z.object({
|
|
70
70
|
label: z.string(),
|
|
@@ -144,7 +144,7 @@ export const RenderMapInputSchema = z.object({
|
|
|
144
144
|
markers: z
|
|
145
145
|
.array(markerSchema)
|
|
146
146
|
.optional()
|
|
147
|
-
.describe("Inline point markers (start/end, numbered visits, POI pins, etc.). Use only for hand-composed payloads. For POI markers, set `id` to the place's mapbox_id to get an auto-enriching results
|
|
147
|
+
.describe("Inline point markers (start/end, numbered visits, POI pins, etc.). Use only for hand-composed payloads. For POI markers, set `id` to the place's mapbox_id to get an auto-enriching results carousel card (see markerSchema's `id` field) instead of just a pin."),
|
|
148
148
|
legend: z
|
|
149
149
|
.array(legendEntrySchema)
|
|
150
150
|
.optional()
|
|
@@ -156,6 +156,10 @@ export const RenderMapInputSchema = z.object({
|
|
|
156
156
|
baseStyle: z
|
|
157
157
|
.enum(['standard', 'standard-satellite'])
|
|
158
158
|
.optional()
|
|
159
|
-
.describe('Which Mapbox-owned base style to load; defaults to "standard". "standard-satellite" is the same Standard style family rendered over global satellite imagery instead of a vector basemap — same config-property system and bottom/middle/top slots apply, but it has no theme and no flat-color overrides like colorWater/colorBuildings (there\'s no vector surface to recolor). See https://docs.mapbox.com/map-styles/reference/standard-satellite/ for its supported baseMapConfig properties.')
|
|
159
|
+
.describe('Which Mapbox-owned base style to load; defaults to "standard". "standard-satellite" is the same Standard style family rendered over global satellite imagery instead of a vector basemap — same config-property system and bottom/middle/top slots apply, but it has no theme and no flat-color overrides like colorWater/colorBuildings (there\'s no vector surface to recolor). See https://docs.mapbox.com/map-styles/reference/standard-satellite/ for its supported baseMapConfig properties.'),
|
|
160
|
+
showTraffic: z
|
|
161
|
+
.boolean()
|
|
162
|
+
.optional()
|
|
163
|
+
.describe('Show live traffic congestion (light/moderate/heavy/severe) on every road in view, from Mapbox Traffic. Use when the user asks to see traffic or congestion in an area. Works on both base styles. Left out, the map keeps whatever the user picked with its Traffic button.')
|
|
160
164
|
});
|
|
161
165
|
//# sourceMappingURL=RenderMapTool.input.schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderMapTool.input.schema.js","sourceRoot":"","sources":["../../../../src/tools/render-map-tool/RenderMapTool.input.schema.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,kCAAkC;AAElC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;GAOG;AAEH,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,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V,QAAQ,CACP,oeAAoe,CACre;IACH,WAAW,EAAE,CAAC;SACX,OAAO,EAAE;SACT,QAAQ,EAAE;SACV,QAAQ,CACP,6QAA6Q,CAC9Q;CACJ,CAAC,CAAC"}
|
|
@@ -39,16 +39,24 @@ export class RenderMapTool extends BaseTool {
|
|
|
39
39
|
'hand-composed payloads from raw GeoJSON. For a hand-composed POI marker ' +
|
|
40
40
|
'(e.g. built from category_search_tool/search_and_geocode_tool/' +
|
|
41
41
|
"place_details_tool output), set `markers[].id` to the place's mapbox_id " +
|
|
42
|
-
'— this gets it the same auto-enriching results
|
|
42
|
+
'— this gets it the same auto-enriching results carousel (popularity ' +
|
|
43
43
|
'score and photo) that a payload_refs-based search result gets ' +
|
|
44
44
|
'automatically, with no extra tool calls. ' +
|
|
45
45
|
'To restyle the base map itself (e.g. "make the water red", switch to night ' +
|
|
46
46
|
'lighting, hide POI labels) pass `baseMapConfig`. To switch to satellite ' +
|
|
47
47
|
'imagery, pass `baseStyle: "standard-satellite"` (defaults to "standard"). ' +
|
|
48
|
-
'
|
|
49
|
-
'
|
|
50
|
-
'
|
|
51
|
-
'
|
|
48
|
+
'To show live traffic congestion on the roads in view, pass ' +
|
|
49
|
+
'`showTraffic: true`. The map also has Satellite and Traffic buttons ' +
|
|
50
|
+
'users can toggle themselves. ' +
|
|
51
|
+
'Every call redraws the map from scratch: only the traffic and satellite ' +
|
|
52
|
+
'settings carry over from the previous call. So to restyle an ' +
|
|
53
|
+
'already-drawn map or toggle traffic without losing its content, re-pass ' +
|
|
54
|
+
'the same `payload_refs`/`layers` alongside ' +
|
|
55
|
+
'`baseMapConfig`/`baseStyle`/`showTraffic` rather than sending them alone. ' +
|
|
56
|
+
"After rendering places, don't list them again in your reply: the map's " +
|
|
57
|
+
'cards already show each name, category, price level, distance and hours. ' +
|
|
58
|
+
'Answer the question or add what the cards leave out (like the phone ' +
|
|
59
|
+
'number or address) instead.';
|
|
52
60
|
annotations = {
|
|
53
61
|
title: 'Render Map',
|
|
54
62
|
readOnlyHint: true,
|
|
@@ -128,7 +136,9 @@ export class RenderMapTool extends BaseTool {
|
|
|
128
136
|
const selfFetchNote = selfFetchCount > 0
|
|
129
137
|
? ` The map will also fetch and draw ${selfFetchCount} additional layer${selfFetchCount === 1 ? '' : 's'} directly from the Mapbox API once it loads.`
|
|
130
138
|
: '';
|
|
131
|
-
const baseMapConfigNote = payload.baseMapConfig ||
|
|
139
|
+
const baseMapConfigNote = payload.baseMapConfig ||
|
|
140
|
+
payload.baseStyle ||
|
|
141
|
+
payload.showTraffic !== undefined
|
|
132
142
|
? ' Updated the base map style.'
|
|
133
143
|
: '';
|
|
134
144
|
const text = `Rendered map with ${layerCount} layer${layerCount === 1 ? '' : 's'}` +
|
|
@@ -242,24 +252,26 @@ export class RenderMapTool extends BaseTool {
|
|
|
242
252
|
camera: input.camera,
|
|
243
253
|
summary: input.summary,
|
|
244
254
|
baseMapConfig: input.baseMapConfig,
|
|
245
|
-
baseStyle: input.baseStyle
|
|
255
|
+
baseStyle: input.baseStyle,
|
|
256
|
+
showTraffic: input.showTraffic
|
|
246
257
|
};
|
|
247
258
|
const hasInlineContent = (inline.layers && inline.layers.length > 0) ||
|
|
248
259
|
(inline.markers && inline.markers.length > 0);
|
|
249
260
|
const all = [...fromRefs];
|
|
250
|
-
// baseMapConfig/baseStyle-only calls (e.g. "now turn the
|
|
251
|
-
// "switch to satellite" with no new data)
|
|
252
|
-
// treated like summary/legend.
|
|
261
|
+
// baseMapConfig/baseStyle/showTraffic-only calls (e.g. "now turn the
|
|
262
|
+
// water red", "switch to satellite" or "show traffic" with no new data)
|
|
263
|
+
// are renderable on their own — treated like summary/legend.
|
|
253
264
|
if (hasInlineContent ||
|
|
254
265
|
inline.summary ||
|
|
255
266
|
inline.legend ||
|
|
256
267
|
inline.baseMapConfig ||
|
|
257
|
-
inline.baseStyle
|
|
268
|
+
inline.baseStyle ||
|
|
269
|
+
inline.showTraffic !== undefined)
|
|
258
270
|
all.push(inline);
|
|
259
271
|
if (all.length === 0)
|
|
260
272
|
return { payload: null, unresolvedRefs };
|
|
261
273
|
const merged = mergeMapPayloads(all);
|
|
262
|
-
// Inline summary/camera/legend/baseMapConfig/baseStyle take precedence when provided.
|
|
274
|
+
// Inline summary/camera/legend/baseMapConfig/baseStyle/showTraffic take precedence when provided.
|
|
263
275
|
if (input.summary)
|
|
264
276
|
merged.summary = input.summary;
|
|
265
277
|
if (input.camera)
|
|
@@ -270,6 +282,8 @@ export class RenderMapTool extends BaseTool {
|
|
|
270
282
|
merged.baseMapConfig = input.baseMapConfig;
|
|
271
283
|
if (input.baseStyle)
|
|
272
284
|
merged.baseStyle = input.baseStyle;
|
|
285
|
+
if (input.showTraffic !== undefined)
|
|
286
|
+
merged.showTraffic = input.showTraffic;
|
|
273
287
|
return { payload: merged, unresolvedRefs };
|
|
274
288
|
}
|
|
275
289
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderMapTool.js","sourceRoot":"","sources":["../../../../src/tools/render-map-tool/RenderMapTool.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,kCAAkC;AAElC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAKpE,OAAO,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EACL,SAAS,EAEV,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,oBAAoB,EAErB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEzE,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EACL,cAAc,EACd,mBAAmB,EACpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAG/D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,aAAc,SAAQ,QAGlC;IACU,IAAI,GAAG,iBAAiB,CAAC;IACzB,WAAW,GAClB,gDAAgD;QAChD,6EAA6E;QAC7E,6EAA6E;QAC7E,qEAAqE;QACrE,sEAAsE;QACtE,kCAAkC;QAClC,mEAAmE;QACnE,0EAA0E;QAC1E,gEAAgE;QAChE,0EAA0E;QAC1E,
|
|
1
|
+
{"version":3,"file":"RenderMapTool.js","sourceRoot":"","sources":["../../../../src/tools/render-map-tool/RenderMapTool.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,kCAAkC;AAElC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAKpE,OAAO,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EACL,SAAS,EAEV,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,oBAAoB,EAErB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEzE,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EACL,cAAc,EACd,mBAAmB,EACpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EA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,WAAW,KAAK,SAAS;YAEhC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnB,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;QAE/D,MAAM,MAAM,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC;QACrC,kGAAkG;QAClG,IAAI,KAAK,CAAC,OAAO;YAAE,MAAM,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAClD,IAAI,KAAK,CAAC,MAAM;YAAE,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAChD,IAAI,KAAK,CAAC,MAAM;YAAE,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAC/C,IAAI,KAAK,CAAC,aAAa;YAAE,MAAM,CAAC,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC;QACpE,IAAI,KAAK,CAAC,SAAS;YAAE,MAAM,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;QACxD,IAAI,KAAK,CAAC,WAAW,KAAK,SAAS;YAAE,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;IAC7C,CAAC;CACF"}
|
|
@@ -145,6 +145,7 @@ export declare const RenderMapOutputSchema: z.ZodObject<{
|
|
|
145
145
|
standard: "standard";
|
|
146
146
|
"standard-satellite": "standard-satellite";
|
|
147
147
|
}>>>;
|
|
148
|
+
showTraffic: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
148
149
|
}, z.core.$strip>>;
|
|
149
150
|
}, z.core.$loose>;
|
|
150
151
|
export type RenderMapOutput = z.infer<typeof RenderMapOutputSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderMapTool.output.schema.d.ts","sourceRoot":"","sources":["../../../../src/tools/render-map-tool/RenderMapTool.output.schema.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"RenderMapTool.output.schema.d.ts","sourceRoot":"","sources":["../../../../src/tools/render-map-tool/RenderMapTool.output.schema.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiBlB,CAAC;AAEjB,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceReaderTool.d.ts","sourceRoot":"","sources":["../../../../src/tools/resource-reader-tool/ResourceReaderTool.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACd,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;AACrF,OAAO,EAAE,8BAA8B,EAAE,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"ResourceReaderTool.d.ts","sourceRoot":"","sources":["../../../../src/tools/resource-reader-tool/ResourceReaderTool.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACd,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;AACrF,OAAO,EAAE,8BAA8B,EAAE,MAAM,uCAAuC,CAAC;AAQvF;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,QAAQ,CAC9C,OAAO,6BAA6B,EACpC,OAAO,8BAA8B,CACtC;IACC,IAAI,SAA0B;IAC9B,WAAW,SACmkB;IAC9kB,WAAW;;;;;;MAMT;;IASI,GAAG,CACP,QAAQ,EAAE,OAAO,EAEjB,KAAK,CAAC,EAAE,aAAa,GACpB,OAAO,CAAC,cAAc,CAAC;YA+BZ,OAAO;IAwHrB;;OAEG;YACW,sBAAsB;CAMrC"}
|
|
@@ -4,13 +4,17 @@ import { BaseTool } from '../BaseTool.js';
|
|
|
4
4
|
import { ResourceReaderToolInputSchema } from './ResourceReaderTool.input.schema.js';
|
|
5
5
|
import { ResourceReaderToolOutputSchema } from './ResourceReaderTool.output.schema.js';
|
|
6
6
|
import { getResourceByUri } from '../../resources/resourceRegistry.js';
|
|
7
|
+
import { isSelfFetchRef } from '../../utils/selfFetchRef.js';
|
|
8
|
+
// Base64 grows a blob by about a third, so this keeps an image result under
|
|
9
|
+
// Claude Desktop's 1 MB tool-result cap (same limit as static_map_image_tool).
|
|
10
|
+
const BLOB_INLINE_LIMIT = 700 * 1024;
|
|
7
11
|
/**
|
|
8
12
|
* Tool for reading MCP resources via the tool interface.
|
|
9
13
|
* This provides a fallback mechanism for clients that don't support the MCP resource API.
|
|
10
14
|
*/
|
|
11
15
|
export class ResourceReaderTool extends BaseTool {
|
|
12
16
|
name = 'resource_reader_tool';
|
|
13
|
-
description = 'Reads an MCP resource by URI. This tool is a fallback for clients that do not support the native MCP resource API. Supports reading category lists and other
|
|
17
|
+
description = 'Reads an MCP resource by URI. This tool is a fallback for clients that do not support the native MCP resource API. Supports reading category lists and the mapbox:// refs other tools return (mapbox://temp/..., mapbox://response/..., mapbox://inline/..., mapbox://compute/...); pass a ref exactly as returned. mapbox://selffetch/... refs are not readable: pass them to render_map_tool in payload_refs, which fetches the data itself. Use "mapbox://categories" for default categories or "mapbox://categories/{language}" for localized versions (e.g., "mapbox://categories/ja" for Japanese).';
|
|
14
18
|
annotations = {
|
|
15
19
|
title: 'Resource Reader Tool',
|
|
16
20
|
readOnlyHint: true,
|
|
@@ -49,6 +53,17 @@ export class ResourceReaderTool extends BaseTool {
|
|
|
49
53
|
}
|
|
50
54
|
}
|
|
51
55
|
async execute(input, extra) {
|
|
56
|
+
if (isSelfFetchRef(input.uri)) {
|
|
57
|
+
return {
|
|
58
|
+
content: [
|
|
59
|
+
{
|
|
60
|
+
type: 'text',
|
|
61
|
+
text: `${input.uri} is not a readable resource. Pass it unchanged to render_map_tool in payload_refs; the map fetches its data itself.`
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
isError: true
|
|
65
|
+
};
|
|
66
|
+
}
|
|
52
67
|
// Find the resource by URI
|
|
53
68
|
const resource = getResourceByUri(input.uri);
|
|
54
69
|
if (!resource) {
|
|
@@ -86,17 +101,36 @@ export class ResourceReaderTool extends BaseTool {
|
|
|
86
101
|
catch (validationError) {
|
|
87
102
|
this.log('warning', `Output schema validation failed: ${validationError instanceof Error ? validationError.message : 'Unknown validation error'}`);
|
|
88
103
|
}
|
|
89
|
-
//
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
104
|
+
// A blob goes back once, not as base64 text plus a copy in
|
|
105
|
+
// structuredContent: an image the host can show, or a short note when
|
|
106
|
+
// it's too big to send (or isn't an image).
|
|
107
|
+
if ('blob' in content && typeof content.blob === 'string') {
|
|
108
|
+
const mimeType = content.mimeType ?? 'application/octet-stream';
|
|
109
|
+
const bytes = Math.floor((content.blob.length * 3) / 4);
|
|
110
|
+
const structuredContent = { uri: content.uri, mimeType };
|
|
111
|
+
if ((mimeType === 'image/png' || mimeType === 'image/jpeg') &&
|
|
112
|
+
bytes <= BLOB_INLINE_LIMIT) {
|
|
113
|
+
return {
|
|
114
|
+
content: [{ type: 'image', data: content.blob, mimeType }],
|
|
115
|
+
structuredContent,
|
|
116
|
+
isError: false
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
return {
|
|
120
|
+
content: [
|
|
121
|
+
{
|
|
122
|
+
type: 'text',
|
|
123
|
+
text: `${input.uri} holds ${mimeType} data (${Math.round(bytes / 1024)} KB), too large to return through this tool. For a static map, give the user the image link from static_map_image_tool's result, or call it again with a smaller size.`
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
structuredContent,
|
|
127
|
+
isError: false
|
|
128
|
+
};
|
|
96
129
|
}
|
|
97
|
-
|
|
130
|
+
if (!('text' in content) || typeof content.text !== 'string') {
|
|
98
131
|
throw new Error('Resource content must contain either text or blob');
|
|
99
132
|
}
|
|
133
|
+
const textContent = content.text;
|
|
100
134
|
return {
|
|
101
135
|
content: [
|
|
102
136
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceReaderTool.js","sourceRoot":"","sources":["../../../../src/tools/resource-reader-tool/ResourceReaderTool.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,kCAAkC;AAElC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAM1C,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;AACrF,OAAO,EAAE,8BAA8B,EAAE,MAAM,uCAAuC,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"ResourceReaderTool.js","sourceRoot":"","sources":["../../../../src/tools/resource-reader-tool/ResourceReaderTool.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,kCAAkC;AAElC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAM1C,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;AACrF,OAAO,EAAE,8BAA8B,EAAE,MAAM,uCAAuC,CAAC;AACvF,OAAO,EAAE,gBAAg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I,CAAC,CAAC,MAAM,IAAI,OAAO,CAAC,IAAI,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC7D,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;YACvE,CAAC;YACD,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;YAEjC,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,WAAW;qBAClB;iBACF;gBACD,iBAAiB,EAAE,OAAO;gBAC1B,OAAO,EAAE,KAAK;aACf,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,YAAY,GAChB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACzD,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,0BAA0B,KAAK,CAAC,GAAG,KAAK,YAAY,EAAE;qBAC7D;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,sBAAsB;QAClC,MAAM,EAAE,eAAe,EAAE,GACvB,MAAM,MAAM,CAAC,qCAAqC,CAAC,CAAC;QACtD,MAAM,SAAS,GAAG,eAAe,EAAE,CAAC;QACpC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,CAAkB,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjE,CAAC;CACF"}
|
|
@@ -13,10 +13,17 @@ export declare class StaticMapImageTool extends MapboxApiBasedTool<typeof Static
|
|
|
13
13
|
idempotentHint: boolean;
|
|
14
14
|
openWorldHint: boolean;
|
|
15
15
|
};
|
|
16
|
+
readonly meta: {
|
|
17
|
+
ui: {
|
|
18
|
+
resourceUri: string;
|
|
19
|
+
csp: {
|
|
20
|
+
resourceDomains: string[];
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
16
24
|
constructor(params: {
|
|
17
25
|
httpRequest: HttpRequest;
|
|
18
26
|
});
|
|
19
|
-
private encodeOverlay;
|
|
20
27
|
protected execute(input: z.infer<typeof StaticMapImageInputSchema>, accessToken: string): Promise<CallToolResult>;
|
|
21
28
|
}
|
|
22
29
|
//# sourceMappingURL=StaticMapImageTool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StaticMapImageTool.d.ts","sourceRoot":"","sources":["../../../../src/tools/static-map-image-tool/StaticMapImageTool.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"StaticMapImageTool.d.ts","sourceRoot":"","sources":["../../../../src/tools/static-map-image-tool/StaticMapImageTool.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAqBnE,qBAAa,kBAAmB,SAAQ,kBAAkB,CACxD,OAAO,yBAAyB,CACjC;IACC,IAAI,SAA2B;IAC/B,WAAW,SAC6Y;IACxZ,WAAW;;;;;;MAMT;IAKF,QAAQ,CAAC,IAAI;;;;;;;MAKX;gBAEU,MAAM,EAAE;QAAE,WAAW,EAAE,WAAW,CAAA;KAAE;cAOhC,OAAO,CACrB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,EAChD,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,cAAc,CAAC;CAwI3B"}
|