@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;;;AAqBlC,
|
|
1
|
+
{"version":3,"file":"mapAppHtml.js","sourceRoot":"","sources":["../../../../src/resources/ui-apps/mapAppHtml.ts"],"names":[],"mappings":";AAAA,6BAA6B;AAC7B,kCAAkC;;;AAqBlC,4CAkzFC;AAn0FD;;;;;;;;;GASG;AAEH,yEAAyE;AACzE,wEAAwE;AACxE,6EAA6E;AAC7E,8CAA8C;AACjC,QAAA,iBAAiB,GAAG,QAAQ,CAAC;AAE1C,SAAgB,gBAAgB,CAAC,MAKhC;IACC,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC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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,180 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Mapbox, Inc.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.renderStaticMapViewerHtml = renderStaticMapViewerHtml;
|
|
6
|
+
/**
|
|
7
|
+
* MCP App page for static_map_image_tool: shows the map image from the tool
|
|
8
|
+
* result at full width, inline in the chat.
|
|
9
|
+
*
|
|
10
|
+
* Hosts show a plain image result as a small thumbnail, and a model can't put
|
|
11
|
+
* that image in its own reply. This page gets the whole tool result from the
|
|
12
|
+
* host (ui/notifications/tool-result) and draws the image item as a data:
|
|
13
|
+
* URL, so it needs no token and makes no request. When the image went to a
|
|
14
|
+
* resource ref instead, it falls back to the public-token URL in the
|
|
15
|
+
* result's text, and only for the Mapbox API origin.
|
|
16
|
+
*
|
|
17
|
+
* Kept free of backslashes: this script lives in a template literal.
|
|
18
|
+
*/
|
|
19
|
+
function renderStaticMapViewerHtml(params) {
|
|
20
|
+
let apiOrigin = 'https://api.mapbox.com';
|
|
21
|
+
try {
|
|
22
|
+
apiOrigin = new URL(params.apiEndpoint).origin;
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
// Keep the default; an invalid endpoint can't serve images anyway.
|
|
26
|
+
}
|
|
27
|
+
return `<!doctype html>
|
|
28
|
+
<html>
|
|
29
|
+
<head>
|
|
30
|
+
<meta charset="utf-8">
|
|
31
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
32
|
+
<title>Static map</title>
|
|
33
|
+
<style>
|
|
34
|
+
html, body { margin: 0; padding: 0; background: transparent; }
|
|
35
|
+
#map { display: none; width: 100%; height: auto; border-radius: 8px; }
|
|
36
|
+
#message {
|
|
37
|
+
display: none; padding: 12px;
|
|
38
|
+
font: 14px system-ui, -apple-system, sans-serif; color: #64748b;
|
|
39
|
+
}
|
|
40
|
+
</style>
|
|
41
|
+
</head>
|
|
42
|
+
<body>
|
|
43
|
+
<img id="map" alt="Static map">
|
|
44
|
+
<div id="message"></div>
|
|
45
|
+
<script>
|
|
46
|
+
(function() {
|
|
47
|
+
var API_ORIGIN = ${JSON.stringify(apiOrigin)};
|
|
48
|
+
var IMAGE_TYPES = ['image/png', 'image/jpeg'];
|
|
49
|
+
var img = document.getElementById('map');
|
|
50
|
+
var messageEl = document.getElementById('message');
|
|
51
|
+
|
|
52
|
+
var messageId = 0;
|
|
53
|
+
var pending = {};
|
|
54
|
+
function send(message) {
|
|
55
|
+
try { window.parent.postMessage(message, '*'); } catch (_) {}
|
|
56
|
+
}
|
|
57
|
+
function request(method, params) {
|
|
58
|
+
var id = ++messageId;
|
|
59
|
+
send({ jsonrpc: '2.0', id: id, method: method, params: params || {} });
|
|
60
|
+
return new Promise(function(resolve, reject) {
|
|
61
|
+
pending[id] = { resolve: resolve, reject: reject };
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function notify(method, params) {
|
|
65
|
+
send({ jsonrpc: '2.0', method: method, params: params || {} });
|
|
66
|
+
}
|
|
67
|
+
function reportSize() {
|
|
68
|
+
var height = img.style.display === 'block'
|
|
69
|
+
? img.offsetHeight
|
|
70
|
+
: messageEl.offsetHeight;
|
|
71
|
+
if (height > 0) notify('ui/notifications/size-changed', { height: height });
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function showMessage(text) {
|
|
75
|
+
img.style.display = 'none';
|
|
76
|
+
messageEl.textContent = text;
|
|
77
|
+
messageEl.style.display = 'block';
|
|
78
|
+
reportSize();
|
|
79
|
+
}
|
|
80
|
+
function showImage(src, alt) {
|
|
81
|
+
messageEl.style.display = 'none';
|
|
82
|
+
img.alt = alt || 'Static map';
|
|
83
|
+
img.onload = reportSize;
|
|
84
|
+
img.onerror = function() { showMessage("The map image couldn't be loaded."); };
|
|
85
|
+
img.src = src;
|
|
86
|
+
img.style.display = 'block';
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// The tool's text starts "Static map image (WxH, style) ..." when the image
|
|
90
|
+
// is attached; use that as the alt text.
|
|
91
|
+
function altFrom(texts) {
|
|
92
|
+
for (var i = 0; i < texts.length; i++) {
|
|
93
|
+
var t = texts[i];
|
|
94
|
+
if (t.indexOf('Static map image (') === 0) {
|
|
95
|
+
return t.slice(0, t.indexOf(')') + 1);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return 'Static map';
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// A public-token URL for the Mapbox API in the result's text (its
|
|
102
|
+
// "Image URL:" line, or the link line when the viewer shows the map).
|
|
103
|
+
// Only that origin, and only with a public token.
|
|
104
|
+
function urlFrom(texts) {
|
|
105
|
+
var prefix = API_ORIGIN + '/';
|
|
106
|
+
for (var i = 0; i < texts.length; i++) {
|
|
107
|
+
var t = texts[i];
|
|
108
|
+
var start = t.indexOf(prefix);
|
|
109
|
+
while (start !== -1) {
|
|
110
|
+
var end = start;
|
|
111
|
+
while (end < t.length && ' )]>"'.indexOf(t.charAt(end)) === -1 &&
|
|
112
|
+
t.charCodeAt(end) > 32) {
|
|
113
|
+
end++;
|
|
114
|
+
}
|
|
115
|
+
var url = t.slice(start, end);
|
|
116
|
+
if (url.indexOf('access_token=pk.') !== -1) return url;
|
|
117
|
+
start = t.indexOf(prefix, end);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function handleToolResult(result) {
|
|
124
|
+
var content = (result && Array.isArray(result.content)) ? result.content : [];
|
|
125
|
+
var texts = [];
|
|
126
|
+
var image = null;
|
|
127
|
+
for (var i = 0; i < content.length; i++) {
|
|
128
|
+
var c = content[i];
|
|
129
|
+
if (!c) continue;
|
|
130
|
+
if (c.type === 'text' && typeof c.text === 'string') texts.push(c.text);
|
|
131
|
+
if (c.type === 'image' && typeof c.data === 'string' &&
|
|
132
|
+
IMAGE_TYPES.indexOf(c.mimeType) !== -1 && !image) {
|
|
133
|
+
image = c;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if (result && result.isError) {
|
|
137
|
+
showMessage(texts.join(' ') || 'The static map could not be made.');
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
if (image) {
|
|
141
|
+
showImage('data:' + image.mimeType + ';base64,' + image.data, altFrom(texts));
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
var url = urlFrom(texts);
|
|
145
|
+
if (url) {
|
|
146
|
+
showImage(url, 'Static map');
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
showMessage("The map image isn't available here.");
|
|
150
|
+
}
|
|
151
|
+
window.__handleToolResult = handleToolResult;
|
|
152
|
+
|
|
153
|
+
window.addEventListener('message', function(event) {
|
|
154
|
+
var message = event.data;
|
|
155
|
+
if (!message || typeof message !== 'object') return;
|
|
156
|
+
if (message.id !== undefined && pending[message.id]) {
|
|
157
|
+
var handlers = pending[message.id];
|
|
158
|
+
delete pending[message.id];
|
|
159
|
+
if (message.error) handlers.reject(new Error(message.error.message));
|
|
160
|
+
else handlers.resolve(message.result);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
if (message.method === 'ui/notifications/tool-result' && message.params) {
|
|
164
|
+
handleToolResult(message.params);
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
window.addEventListener('resize', reportSize);
|
|
168
|
+
|
|
169
|
+
function initialized() { notify('ui/notifications/initialized', {}); }
|
|
170
|
+
request('ui/initialize', {
|
|
171
|
+
protocolVersion: '2026-01-26',
|
|
172
|
+
appCapabilities: {},
|
|
173
|
+
appInfo: { name: 'Mapbox Static Map', version: '1.0.0' }
|
|
174
|
+
}).then(initialized, initialized);
|
|
175
|
+
})();
|
|
176
|
+
</script>
|
|
177
|
+
</body>
|
|
178
|
+
</html>`;
|
|
179
|
+
}
|
|
180
|
+
//# 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,8DAiKC;AA9KD;;;;;;;;;;;;GAYG;AACH,SAAgB,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,oBAAoB,EACpB,KAAK,cAAc,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAoBzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,aAAc,SAAQ,QAAQ,CACzC,OAAO,oBAAoB,EAC3B,OAAO,qBAAqB,CAC7B;IACC,QAAQ,CAAC,IAAI,qBAAqB;IAClC,QAAQ,CAAC,WAAW,
|
|
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,oBAAoB,EACpB,KAAK,cAAc,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAoBzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,aAAc,SAAQ,QAAQ,CACzC,OAAO,oBAAoB,EAC3B,OAAO,qBAAqB,CAC7B;IACC,QAAQ,CAAC,IAAI,qBAAqB;IAClC,QAAQ,CAAC,WAAW,SA4BY;IAEhC,QAAQ,CAAC,WAAW;;;;;;MAMlB;IAEF,QAAQ,CAAC,IAAI,EAAE;QAAE,EAAE,EAAE;YAAE,WAAW,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,SAAS,CAAA;SAAE,CAAA;KAAE,CAAC;IAE/D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAc;IAC1C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAe;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"}
|
|
@@ -55,19 +55,19 @@ const markerSchema = zod_1.z.object({
|
|
|
55
55
|
id: zod_1.z
|
|
56
56
|
.string()
|
|
57
57
|
.optional()
|
|
58
|
-
.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
|
|
58
|
+
.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.).'),
|
|
59
59
|
name: zod_1.z
|
|
60
60
|
.string()
|
|
61
61
|
.optional()
|
|
62
|
-
.describe('Display name for the results
|
|
62
|
+
.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.'),
|
|
63
63
|
category: zod_1.z
|
|
64
64
|
.string()
|
|
65
65
|
.optional()
|
|
66
|
-
.describe('Category shown
|
|
66
|
+
.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.'),
|
|
67
67
|
distanceMeters: zod_1.z
|
|
68
68
|
.number()
|
|
69
69
|
.optional()
|
|
70
|
-
.describe('Distance in meters, shown
|
|
70
|
+
.describe('Distance in meters, shown on the results carousel card. Only used when `id` is also set.')
|
|
71
71
|
});
|
|
72
72
|
const legendEntrySchema = zod_1.z.object({
|
|
73
73
|
label: zod_1.z.string(),
|
|
@@ -147,7 +147,7 @@ exports.RenderMapInputSchema = zod_1.z.object({
|
|
|
147
147
|
markers: zod_1.z
|
|
148
148
|
.array(markerSchema)
|
|
149
149
|
.optional()
|
|
150
|
-
.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
|
|
150
|
+
.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."),
|
|
151
151
|
legend: zod_1.z
|
|
152
152
|
.array(legendEntrySchema)
|
|
153
153
|
.optional()
|
|
@@ -159,6 +159,10 @@ exports.RenderMapInputSchema = zod_1.z.object({
|
|
|
159
159
|
baseStyle: zod_1.z
|
|
160
160
|
.enum(['standard', 'standard-satellite'])
|
|
161
161
|
.optional()
|
|
162
|
-
.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.')
|
|
162
|
+
.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.'),
|
|
163
|
+
showTraffic: zod_1.z
|
|
164
|
+
.boolean()
|
|
165
|
+
.optional()
|
|
166
|
+
.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.')
|
|
163
167
|
});
|
|
164
168
|
//# 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,6BAAwB;AAExB;;;;;;;GAOG;AAEH,MAAM,WAAW,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3B,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;IACpE,IAAI,EAAE,OAAC;SACJ,IAAI,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;SAC1C,QAAQ,CAAC,sBAAsB,CAAC;IACnC,IAAI,EAAE,OAAC;SACJ,OAAO,EAAE;SACT,QAAQ,CACP,uJAAuJ,CACxJ;IACH,KAAK,EAAE,OAAC;SACL,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC;SAC/B,QAAQ,EAAE;SACV,QAAQ,CACP,+GAA+G,CAChH;IACH,MAAM,EAAE,OAAC;SACN,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC;SAC/B,QAAQ,EAAE;SACV,QAAQ,CACP,sFAAsF,CACvF;IACH,IAAI,EAAE,OAAC;SACJ,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;SACjC,QAAQ,EAAE;SACV,QAAQ,CACP,6YAA6Y,CAC9Y;CACJ,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5B,WAAW,EAAE,OAAC;SACX,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;SACjB,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,uBAAuB,CAAC;IACpC,KAAK,EAAE,OAAC;SACL,IAAI,CAAC,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;SACzC,QAAQ,EAAE;SACV,QAAQ,CACP,8JAA8J,CAC/J;IACH,KAAK,EAAE,OAAC;SACL,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,+DAA+D,CAAC;IAC5E,KAAK,EAAE,OAAC;SACL,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,0DAA0D,CAAC;IACvE,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;IACzE,EAAE,EAAE,OAAC;SACF,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,
|
|
1
|
+
{"version":3,"file":"RenderMapTool.input.schema.js","sourceRoot":"","sources":["../../../../src/tools/render-map-tool/RenderMapTool.input.schema.ts"],"names":[],"mappings":";AAA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AC;AAES,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C;;;;;;OAMG;IACH,YAAY,EAAE,OAAC;SACZ,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;SACjB,QAAQ,EAAE;SACV,QAAQ,CACP,8OAA8O,CAC/O;IACH,OAAO,EAAE,OAAC;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,4HAA4H,CAC7H;IACH,MAAM,EAAE,OAAC;SACN,KAAK,CAAC,WAAW,CAAC;SAClB,QAAQ,EAAE;SACV,QAAQ,CACP,wIAAwI,CACzI;IACH,OAAO,EAAE,OAAC;SACP,KAAK,CAAC,YAAY,CAAC;SACnB,QAAQ,EAAE;SACV,QAAQ,CACP,kQAAkQ,CACnQ;IACH,MAAM,EAAE,OAAC;SACN,KAAK,CAAC,iBAAiB,CAAC;SACxB,QAAQ,EAAE;SACV,QAAQ,CAAC,0DAA0D,CAAC;IACvE,MAAM,EAAE,YAAY;SACjB,QAAQ,EAAE;SACV,QAAQ,CACP,kFAAkF,CACnF;IACH,aAAa,EAAE,mBAAmB,CAAC,QAAQ,EAAE;IAC7C,SAAS,EAAE,OAAC;SACT,IAAI,CAAC,CAAC,UAAU,EAAE,oBAAoB,CAAC,CAAC;SACxC,QAAQ,EAAE;SACV,QAAQ,CACP,oeAAoe,CACre;IACH,WAAW,EAAE,OAAC;SACX,OAAO,EAAE;SACT,QAAQ,EAAE;SACV,QAAQ,CACP,6QAA6Q,CAC9Q;CACJ,CAAC,CAAC"}
|
|
@@ -42,16 +42,24 @@ class RenderMapTool extends BaseTool_js_1.BaseTool {
|
|
|
42
42
|
'hand-composed payloads from raw GeoJSON. For a hand-composed POI marker ' +
|
|
43
43
|
'(e.g. built from category_search_tool/search_and_geocode_tool/' +
|
|
44
44
|
"place_details_tool output), set `markers[].id` to the place's mapbox_id " +
|
|
45
|
-
'— this gets it the same auto-enriching results
|
|
45
|
+
'— this gets it the same auto-enriching results carousel (popularity ' +
|
|
46
46
|
'score and photo) that a payload_refs-based search result gets ' +
|
|
47
47
|
'automatically, with no extra tool calls. ' +
|
|
48
48
|
'To restyle the base map itself (e.g. "make the water red", switch to night ' +
|
|
49
49
|
'lighting, hide POI labels) pass `baseMapConfig`. To switch to satellite ' +
|
|
50
50
|
'imagery, pass `baseStyle: "standard-satellite"` (defaults to "standard"). ' +
|
|
51
|
-
'
|
|
52
|
-
'
|
|
53
|
-
'
|
|
54
|
-
'
|
|
51
|
+
'To show live traffic congestion on the roads in view, pass ' +
|
|
52
|
+
'`showTraffic: true`. The map also has Satellite and Traffic buttons ' +
|
|
53
|
+
'users can toggle themselves. ' +
|
|
54
|
+
'Every call redraws the map from scratch: only the traffic and satellite ' +
|
|
55
|
+
'settings carry over from the previous call. So to restyle an ' +
|
|
56
|
+
'already-drawn map or toggle traffic without losing its content, re-pass ' +
|
|
57
|
+
'the same `payload_refs`/`layers` alongside ' +
|
|
58
|
+
'`baseMapConfig`/`baseStyle`/`showTraffic` rather than sending them alone. ' +
|
|
59
|
+
"After rendering places, don't list them again in your reply: the map's " +
|
|
60
|
+
'cards already show each name, category, price level, distance and hours. ' +
|
|
61
|
+
'Answer the question or add what the cards leave out (like the phone ' +
|
|
62
|
+
'number or address) instead.';
|
|
55
63
|
annotations = {
|
|
56
64
|
title: 'Render Map',
|
|
57
65
|
readOnlyHint: true,
|
|
@@ -131,7 +139,9 @@ class RenderMapTool extends BaseTool_js_1.BaseTool {
|
|
|
131
139
|
const selfFetchNote = selfFetchCount > 0
|
|
132
140
|
? ` The map will also fetch and draw ${selfFetchCount} additional layer${selfFetchCount === 1 ? '' : 's'} directly from the Mapbox API once it loads.`
|
|
133
141
|
: '';
|
|
134
|
-
const baseMapConfigNote = payload.baseMapConfig ||
|
|
142
|
+
const baseMapConfigNote = payload.baseMapConfig ||
|
|
143
|
+
payload.baseStyle ||
|
|
144
|
+
payload.showTraffic !== undefined
|
|
135
145
|
? ' Updated the base map style.'
|
|
136
146
|
: '';
|
|
137
147
|
const text = `Rendered map with ${layerCount} layer${layerCount === 1 ? '' : 's'}` +
|
|
@@ -245,24 +255,26 @@ class RenderMapTool extends BaseTool_js_1.BaseTool {
|
|
|
245
255
|
camera: input.camera,
|
|
246
256
|
summary: input.summary,
|
|
247
257
|
baseMapConfig: input.baseMapConfig,
|
|
248
|
-
baseStyle: input.baseStyle
|
|
258
|
+
baseStyle: input.baseStyle,
|
|
259
|
+
showTraffic: input.showTraffic
|
|
249
260
|
};
|
|
250
261
|
const hasInlineContent = (inline.layers && inline.layers.length > 0) ||
|
|
251
262
|
(inline.markers && inline.markers.length > 0);
|
|
252
263
|
const all = [...fromRefs];
|
|
253
|
-
// baseMapConfig/baseStyle-only calls (e.g. "now turn the
|
|
254
|
-
// "switch to satellite" with no new data)
|
|
255
|
-
// treated like summary/legend.
|
|
264
|
+
// baseMapConfig/baseStyle/showTraffic-only calls (e.g. "now turn the
|
|
265
|
+
// water red", "switch to satellite" or "show traffic" with no new data)
|
|
266
|
+
// are renderable on their own — treated like summary/legend.
|
|
256
267
|
if (hasInlineContent ||
|
|
257
268
|
inline.summary ||
|
|
258
269
|
inline.legend ||
|
|
259
270
|
inline.baseMapConfig ||
|
|
260
|
-
inline.baseStyle
|
|
271
|
+
inline.baseStyle ||
|
|
272
|
+
inline.showTraffic !== undefined)
|
|
261
273
|
all.push(inline);
|
|
262
274
|
if (all.length === 0)
|
|
263
275
|
return { payload: null, unresolvedRefs };
|
|
264
276
|
const merged = (0, storeMapPayload_js_1.mergeMapPayloads)(all);
|
|
265
|
-
// Inline summary/camera/legend/baseMapConfig/baseStyle take precedence when provided.
|
|
277
|
+
// Inline summary/camera/legend/baseMapConfig/baseStyle/showTraffic take precedence when provided.
|
|
266
278
|
if (input.summary)
|
|
267
279
|
merged.summary = input.summary;
|
|
268
280
|
if (input.camera)
|
|
@@ -273,6 +285,8 @@ class RenderMapTool extends BaseTool_js_1.BaseTool {
|
|
|
273
285
|
merged.baseMapConfig = input.baseMapConfig;
|
|
274
286
|
if (input.baseStyle)
|
|
275
287
|
merged.baseStyle = input.baseStyle;
|
|
288
|
+
if (input.showTraffic !== undefined)
|
|
289
|
+
merged.showTraffic = input.showTraffic;
|
|
276
290
|
return { payload: merged, unresolvedRefs };
|
|
277
291
|
}
|
|
278
292
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderMapTool.js","sourceRoot":"","sources":["../../../../src/tools/render-map-tool/RenderMapTool.ts"],"names":[],"mappings":";AAAA,6BAA6B;AAC7B,kCAAkC;;;AAElC,4CAAoE;AAKpE,uDAAyE;AACzE,gDAA0C;AAC1C,uEAG8C;AAC9C,mFAGyC;AACzC,qFAAyE;AAEzE,uEAMwC;AACxC,6DAA4E;AAC5E,iEAGqC;AACrC,yEAIyC;AACzC,yDAA+D;AAG/D;;;;;;;;;;;;;;;GAeG;AACH,MAAa,aAAc,SAAQ,sBAGlC;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,4CAAoE;AAKpE,uDAAyE;AACzE,gDAA0C;AAC1C,uEAG8C;AAC9C,mFAGyC;AACzC,qFAAyE;AAEzE,uEAMwC;AACxC,6DAA4E;AAC5E,iEAGqC;AACrC,yEAIyC;AACzC,yDAA+D;AAG/D;;;;;;;;;;;;;;;GAeG;AACH,MAAa,aAAc,SAAQ,sBAGlC;IACU,IAAI,GAAG,iBAAiB,CAAC;IACzB,WAAW,GAClB,gDAAgD;QAChD,6EAA6E;QAC7E,6EAA6E;QAC7E,qEAA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O,EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;QAE/D,MAAM,MAAM,GAAG,IAAA,qCAAgB,EAAC,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;AAhTD,sCAgTC"}
|
|
@@ -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"}
|
|
@@ -7,13 +7,17 @@ const BaseTool_js_1 = require("../BaseTool.js");
|
|
|
7
7
|
const ResourceReaderTool_input_schema_js_1 = require("./ResourceReaderTool.input.schema.js");
|
|
8
8
|
const ResourceReaderTool_output_schema_js_1 = require("./ResourceReaderTool.output.schema.js");
|
|
9
9
|
const resourceRegistry_js_1 = require("../../resources/resourceRegistry.js");
|
|
10
|
+
const selfFetchRef_js_1 = require("../../utils/selfFetchRef.js");
|
|
11
|
+
// Base64 grows a blob by about a third, so this keeps an image result under
|
|
12
|
+
// Claude Desktop's 1 MB tool-result cap (same limit as static_map_image_tool).
|
|
13
|
+
const BLOB_INLINE_LIMIT = 700 * 1024;
|
|
10
14
|
/**
|
|
11
15
|
* Tool for reading MCP resources via the tool interface.
|
|
12
16
|
* This provides a fallback mechanism for clients that don't support the MCP resource API.
|
|
13
17
|
*/
|
|
14
18
|
class ResourceReaderTool extends BaseTool_js_1.BaseTool {
|
|
15
19
|
name = 'resource_reader_tool';
|
|
16
|
-
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
|
|
20
|
+
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).';
|
|
17
21
|
annotations = {
|
|
18
22
|
title: 'Resource Reader Tool',
|
|
19
23
|
readOnlyHint: true,
|
|
@@ -52,6 +56,17 @@ class ResourceReaderTool extends BaseTool_js_1.BaseTool {
|
|
|
52
56
|
}
|
|
53
57
|
}
|
|
54
58
|
async execute(input, extra) {
|
|
59
|
+
if ((0, selfFetchRef_js_1.isSelfFetchRef)(input.uri)) {
|
|
60
|
+
return {
|
|
61
|
+
content: [
|
|
62
|
+
{
|
|
63
|
+
type: 'text',
|
|
64
|
+
text: `${input.uri} is not a readable resource. Pass it unchanged to render_map_tool in payload_refs; the map fetches its data itself.`
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
isError: true
|
|
68
|
+
};
|
|
69
|
+
}
|
|
55
70
|
// Find the resource by URI
|
|
56
71
|
const resource = (0, resourceRegistry_js_1.getResourceByUri)(input.uri);
|
|
57
72
|
if (!resource) {
|
|
@@ -89,17 +104,36 @@ class ResourceReaderTool extends BaseTool_js_1.BaseTool {
|
|
|
89
104
|
catch (validationError) {
|
|
90
105
|
this.log('warning', `Output schema validation failed: ${validationError instanceof Error ? validationError.message : 'Unknown validation error'}`);
|
|
91
106
|
}
|
|
92
|
-
//
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
107
|
+
// A blob goes back once, not as base64 text plus a copy in
|
|
108
|
+
// structuredContent: an image the host can show, or a short note when
|
|
109
|
+
// it's too big to send (or isn't an image).
|
|
110
|
+
if ('blob' in content && typeof content.blob === 'string') {
|
|
111
|
+
const mimeType = content.mimeType ?? 'application/octet-stream';
|
|
112
|
+
const bytes = Math.floor((content.blob.length * 3) / 4);
|
|
113
|
+
const structuredContent = { uri: content.uri, mimeType };
|
|
114
|
+
if ((mimeType === 'image/png' || mimeType === 'image/jpeg') &&
|
|
115
|
+
bytes <= BLOB_INLINE_LIMIT) {
|
|
116
|
+
return {
|
|
117
|
+
content: [{ type: 'image', data: content.blob, mimeType }],
|
|
118
|
+
structuredContent,
|
|
119
|
+
isError: false
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
content: [
|
|
124
|
+
{
|
|
125
|
+
type: 'text',
|
|
126
|
+
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.`
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
structuredContent,
|
|
130
|
+
isError: false
|
|
131
|
+
};
|
|
99
132
|
}
|
|
100
|
-
|
|
133
|
+
if (!('text' in content) || typeof content.text !== 'string') {
|
|
101
134
|
throw new Error('Resource content must contain either text or blob');
|
|
102
135
|
}
|
|
136
|
+
const textContent = content.text;
|
|
103
137
|
return {
|
|
104
138
|
content: [
|
|
105
139
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceReaderTool.js","sourceRoot":"","sources":["../../../../src/tools/resource-reader-tool/ResourceReaderTool.ts"],"names":[],"mappings":";AAAA,6BAA6B;AAC7B,kCAAkC;;;AAElC,gDAA0C;AAM1C,6FAAqF;AACrF,+FAAuF;AACvF,6EAAuE;
|
|
1
|
+
{"version":3,"file":"ResourceReaderTool.js","sourceRoot":"","sources":["../../../../src/tools/resource-reader-tool/ResourceReaderTool.ts"],"names":[],"mappings":";AAAA,6BAA6B;AAC7B,kCAAkC;;;AAElC,gDAA0C;AAM1C,6FAAqF;AACrF,+FAAuF;AACvF,6EAAuE;AACvE,iEAA6D;AAE7D,4EAA4E;AAC5E,+EAA+E;AAC/E,MAAM,iBAAiB,GAAG,GAAG,GAAG,IAAI,CAAC;AAErC;;;GAGG;AACH,MAAa,kBAAmB,SAAQ,sBAGvC;IACC,IAAI,GAAG,sBAAsB,CAAC;IAC9B,WAAW,GACT,2kBAA2kB,CAAC;IAC9kB,WAAW,GAAG;QACZ,KAAK,EAAE,sBAAsB;QAC7B,YAAY,EAA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BAC1B,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;AA1LD,gDA0LC"}
|
|
@@ -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"}
|