@mapbox/mcp-server 0.14.0 → 0.15.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.
Files changed (191) hide show
  1. package/README.md +11 -0
  2. package/dist/commonjs/index.js +38 -1
  3. package/dist/commonjs/index.js.map +1 -1
  4. package/dist/commonjs/resources/BaseResource.d.ts +18 -0
  5. package/dist/commonjs/resources/BaseResource.d.ts.map +1 -1
  6. package/dist/commonjs/resources/BaseResource.js +26 -4
  7. package/dist/commonjs/resources/BaseResource.js.map +1 -1
  8. package/dist/commonjs/resources/temporary/TemporaryDataResource.d.ts.map +1 -1
  9. package/dist/commonjs/resources/temporary/TemporaryDataResource.js +20 -10
  10. package/dist/commonjs/resources/temporary/TemporaryDataResource.js.map +1 -1
  11. package/dist/commonjs/resources/ui-apps/MapAppUIResource.d.ts.map +1 -1
  12. package/dist/commonjs/resources/ui-apps/MapAppUIResource.js +2 -8
  13. package/dist/commonjs/resources/ui-apps/MapAppUIResource.js.map +1 -1
  14. package/dist/commonjs/resources/ui-apps/mapAppCsp.d.ts +22 -0
  15. package/dist/commonjs/resources/ui-apps/mapAppCsp.d.ts.map +1 -0
  16. package/dist/commonjs/resources/ui-apps/mapAppCsp.js +39 -0
  17. package/dist/commonjs/resources/ui-apps/mapAppCsp.js.map +1 -0
  18. package/dist/commonjs/resources/ui-apps/mapAppHtml.d.ts.map +1 -1
  19. package/dist/commonjs/resources/ui-apps/mapAppHtml.js +71 -9
  20. package/dist/commonjs/resources/ui-apps/mapAppHtml.js.map +1 -1
  21. package/dist/commonjs/tools/BaseTool.d.ts +19 -0
  22. package/dist/commonjs/tools/BaseTool.d.ts.map +1 -1
  23. package/dist/commonjs/tools/BaseTool.js +25 -3
  24. package/dist/commonjs/tools/BaseTool.js.map +1 -1
  25. package/dist/commonjs/tools/directions-tool/DirectionsTool.d.ts.map +1 -1
  26. package/dist/commonjs/tools/directions-tool/DirectionsTool.js +4 -3
  27. package/dist/commonjs/tools/directions-tool/DirectionsTool.js.map +1 -1
  28. package/dist/commonjs/tools/ground-location-tool/GroundLocationTool.d.ts.map +1 -1
  29. package/dist/commonjs/tools/ground-location-tool/GroundLocationTool.js +7 -4
  30. package/dist/commonjs/tools/ground-location-tool/GroundLocationTool.js.map +1 -1
  31. package/dist/commonjs/tools/ground-location-tool/GroundLocationTool.output.schema.d.ts +4 -0
  32. package/dist/commonjs/tools/ground-location-tool/GroundLocationTool.output.schema.d.ts.map +1 -1
  33. package/dist/commonjs/tools/ground-location-tool/GroundLocationTool.output.schema.js +9 -1
  34. package/dist/commonjs/tools/ground-location-tool/GroundLocationTool.output.schema.js.map +1 -1
  35. package/dist/commonjs/tools/isochrone-tool/IsochroneTool.js +1 -1
  36. package/dist/commonjs/tools/place-details-tool/PlaceDetailsTool.d.ts +11 -1
  37. package/dist/commonjs/tools/place-details-tool/PlaceDetailsTool.d.ts.map +1 -1
  38. package/dist/commonjs/tools/place-details-tool/PlaceDetailsTool.input.schema.js +3 -3
  39. package/dist/commonjs/tools/place-details-tool/PlaceDetailsTool.input.schema.js.map +1 -1
  40. package/dist/commonjs/tools/place-details-tool/PlaceDetailsTool.js +132 -141
  41. package/dist/commonjs/tools/place-details-tool/PlaceDetailsTool.js.map +1 -1
  42. package/dist/commonjs/tools/place-details-tool/PlaceDetailsTool.output.schema.d.ts +71 -10
  43. package/dist/commonjs/tools/place-details-tool/PlaceDetailsTool.output.schema.d.ts.map +1 -1
  44. package/dist/commonjs/tools/place-details-tool/PlaceDetailsTool.output.schema.js +86 -10
  45. package/dist/commonjs/tools/place-details-tool/PlaceDetailsTool.output.schema.js.map +1 -1
  46. package/dist/commonjs/tools/render-map-tool/RenderMapTool.d.ts +2 -4
  47. package/dist/commonjs/tools/render-map-tool/RenderMapTool.d.ts.map +1 -1
  48. package/dist/commonjs/tools/render-map-tool/RenderMapTool.input.schema.d.ts +50 -0
  49. package/dist/commonjs/tools/render-map-tool/RenderMapTool.input.schema.d.ts.map +1 -1
  50. package/dist/commonjs/tools/render-map-tool/RenderMapTool.input.schema.js +51 -2
  51. package/dist/commonjs/tools/render-map-tool/RenderMapTool.input.schema.js.map +1 -1
  52. package/dist/commonjs/tools/render-map-tool/RenderMapTool.js +50 -18
  53. package/dist/commonjs/tools/render-map-tool/RenderMapTool.js.map +1 -1
  54. package/dist/commonjs/tools/render-map-tool/RenderMapTool.output.schema.d.ts +50 -0
  55. package/dist/commonjs/tools/render-map-tool/RenderMapTool.output.schema.d.ts.map +1 -1
  56. package/dist/commonjs/tools/search-and-geocode-tool/SearchAndGeocodeTool.d.ts.map +1 -1
  57. package/dist/commonjs/tools/search-and-geocode-tool/SearchAndGeocodeTool.input.schema.d.ts.map +1 -1
  58. package/dist/commonjs/tools/search-and-geocode-tool/SearchAndGeocodeTool.input.schema.js +2 -2
  59. package/dist/commonjs/tools/search-and-geocode-tool/SearchAndGeocodeTool.input.schema.js.map +1 -1
  60. package/dist/commonjs/tools/search-and-geocode-tool/SearchAndGeocodeTool.js +4 -3
  61. package/dist/commonjs/tools/search-and-geocode-tool/SearchAndGeocodeTool.js.map +1 -1
  62. package/dist/commonjs/tools/static-map-image-tool/StaticMapImageTool.d.ts.map +1 -1
  63. package/dist/commonjs/tools/static-map-image-tool/StaticMapImageTool.js +2 -2
  64. package/dist/commonjs/tools/static-map-image-tool/StaticMapImageTool.js.map +1 -1
  65. package/dist/commonjs/utils/jsonSchema2020.d.ts +26 -0
  66. package/dist/commonjs/utils/jsonSchema2020.d.ts.map +1 -0
  67. package/dist/commonjs/utils/jsonSchema2020.js +143 -0
  68. package/dist/commonjs/utils/jsonSchema2020.js.map +1 -0
  69. package/dist/commonjs/utils/jwtUtils.d.ts +48 -0
  70. package/dist/commonjs/utils/jwtUtils.d.ts.map +1 -1
  71. package/dist/commonjs/utils/jwtUtils.js +63 -0
  72. package/dist/commonjs/utils/jwtUtils.js.map +1 -1
  73. package/dist/commonjs/utils/mapAppPayload.d.ts +109 -0
  74. package/dist/commonjs/utils/mapAppPayload.d.ts.map +1 -1
  75. package/dist/commonjs/utils/mapAppPayload.js +38 -2
  76. package/dist/commonjs/utils/mapAppPayload.js.map +1 -1
  77. package/dist/commonjs/utils/selfFetchRef.d.ts.map +1 -1
  78. package/dist/commonjs/utils/selfFetchRef.js +31 -0
  79. package/dist/commonjs/utils/selfFetchRef.js.map +1 -1
  80. package/dist/commonjs/utils/serverInstructions.d.ts +12 -0
  81. package/dist/commonjs/utils/serverInstructions.d.ts.map +1 -0
  82. package/dist/commonjs/utils/serverInstructions.js +28 -0
  83. package/dist/commonjs/utils/serverInstructions.js.map +1 -0
  84. package/dist/commonjs/utils/storeMapPayload.d.ts +11 -11
  85. package/dist/commonjs/utils/storeMapPayload.d.ts.map +1 -1
  86. package/dist/commonjs/utils/storeMapPayload.js +14 -13
  87. package/dist/commonjs/utils/storeMapPayload.js.map +1 -1
  88. package/dist/commonjs/utils/temporaryResourceManager.d.ts +10 -4
  89. package/dist/commonjs/utils/temporaryResourceManager.d.ts.map +1 -1
  90. package/dist/commonjs/utils/temporaryResourceManager.js.map +1 -1
  91. package/dist/commonjs/utils/tracing.d.ts +4 -0
  92. package/dist/commonjs/utils/tracing.d.ts.map +1 -1
  93. package/dist/commonjs/utils/tracing.js +20 -0
  94. package/dist/commonjs/utils/tracing.js.map +1 -1
  95. package/dist/commonjs/version.json +3 -3
  96. package/dist/esm/index.js +39 -2
  97. package/dist/esm/index.js.map +1 -1
  98. package/dist/esm/resources/BaseResource.d.ts +18 -0
  99. package/dist/esm/resources/BaseResource.d.ts.map +1 -1
  100. package/dist/esm/resources/BaseResource.js +26 -4
  101. package/dist/esm/resources/BaseResource.js.map +1 -1
  102. package/dist/esm/resources/temporary/TemporaryDataResource.d.ts.map +1 -1
  103. package/dist/esm/resources/temporary/TemporaryDataResource.js +21 -11
  104. package/dist/esm/resources/temporary/TemporaryDataResource.js.map +1 -1
  105. package/dist/esm/resources/ui-apps/MapAppUIResource.d.ts.map +1 -1
  106. package/dist/esm/resources/ui-apps/MapAppUIResource.js +2 -8
  107. package/dist/esm/resources/ui-apps/MapAppUIResource.js.map +1 -1
  108. package/dist/esm/resources/ui-apps/mapAppCsp.d.ts +22 -0
  109. package/dist/esm/resources/ui-apps/mapAppCsp.d.ts.map +1 -0
  110. package/dist/esm/resources/ui-apps/mapAppCsp.js +36 -0
  111. package/dist/esm/resources/ui-apps/mapAppCsp.js.map +1 -0
  112. package/dist/esm/resources/ui-apps/mapAppHtml.d.ts.map +1 -1
  113. package/dist/esm/resources/ui-apps/mapAppHtml.js +71 -9
  114. package/dist/esm/resources/ui-apps/mapAppHtml.js.map +1 -1
  115. package/dist/esm/tools/BaseTool.d.ts +19 -0
  116. package/dist/esm/tools/BaseTool.d.ts.map +1 -1
  117. package/dist/esm/tools/BaseTool.js +25 -3
  118. package/dist/esm/tools/BaseTool.js.map +1 -1
  119. package/dist/esm/tools/directions-tool/DirectionsTool.d.ts.map +1 -1
  120. package/dist/esm/tools/directions-tool/DirectionsTool.js +5 -4
  121. package/dist/esm/tools/directions-tool/DirectionsTool.js.map +1 -1
  122. package/dist/esm/tools/ground-location-tool/GroundLocationTool.d.ts.map +1 -1
  123. package/dist/esm/tools/ground-location-tool/GroundLocationTool.js +7 -4
  124. package/dist/esm/tools/ground-location-tool/GroundLocationTool.js.map +1 -1
  125. package/dist/esm/tools/ground-location-tool/GroundLocationTool.output.schema.d.ts +4 -0
  126. package/dist/esm/tools/ground-location-tool/GroundLocationTool.output.schema.d.ts.map +1 -1
  127. package/dist/esm/tools/ground-location-tool/GroundLocationTool.output.schema.js +9 -1
  128. package/dist/esm/tools/ground-location-tool/GroundLocationTool.output.schema.js.map +1 -1
  129. package/dist/esm/tools/isochrone-tool/IsochroneTool.js +2 -2
  130. package/dist/esm/tools/place-details-tool/PlaceDetailsTool.d.ts +11 -1
  131. package/dist/esm/tools/place-details-tool/PlaceDetailsTool.d.ts.map +1 -1
  132. package/dist/esm/tools/place-details-tool/PlaceDetailsTool.input.schema.js +3 -3
  133. package/dist/esm/tools/place-details-tool/PlaceDetailsTool.input.schema.js.map +1 -1
  134. package/dist/esm/tools/place-details-tool/PlaceDetailsTool.js +133 -142
  135. package/dist/esm/tools/place-details-tool/PlaceDetailsTool.js.map +1 -1
  136. package/dist/esm/tools/place-details-tool/PlaceDetailsTool.output.schema.d.ts +71 -10
  137. package/dist/esm/tools/place-details-tool/PlaceDetailsTool.output.schema.d.ts.map +1 -1
  138. package/dist/esm/tools/place-details-tool/PlaceDetailsTool.output.schema.js +85 -9
  139. package/dist/esm/tools/place-details-tool/PlaceDetailsTool.output.schema.js.map +1 -1
  140. package/dist/esm/tools/render-map-tool/RenderMapTool.d.ts +2 -4
  141. package/dist/esm/tools/render-map-tool/RenderMapTool.d.ts.map +1 -1
  142. package/dist/esm/tools/render-map-tool/RenderMapTool.input.schema.d.ts +50 -0
  143. package/dist/esm/tools/render-map-tool/RenderMapTool.input.schema.d.ts.map +1 -1
  144. package/dist/esm/tools/render-map-tool/RenderMapTool.input.schema.js +51 -2
  145. package/dist/esm/tools/render-map-tool/RenderMapTool.input.schema.js.map +1 -1
  146. package/dist/esm/tools/render-map-tool/RenderMapTool.js +51 -19
  147. package/dist/esm/tools/render-map-tool/RenderMapTool.js.map +1 -1
  148. package/dist/esm/tools/render-map-tool/RenderMapTool.output.schema.d.ts +50 -0
  149. package/dist/esm/tools/render-map-tool/RenderMapTool.output.schema.d.ts.map +1 -1
  150. package/dist/esm/tools/search-and-geocode-tool/SearchAndGeocodeTool.d.ts.map +1 -1
  151. package/dist/esm/tools/search-and-geocode-tool/SearchAndGeocodeTool.input.schema.d.ts.map +1 -1
  152. package/dist/esm/tools/search-and-geocode-tool/SearchAndGeocodeTool.input.schema.js +2 -2
  153. package/dist/esm/tools/search-and-geocode-tool/SearchAndGeocodeTool.input.schema.js.map +1 -1
  154. package/dist/esm/tools/search-and-geocode-tool/SearchAndGeocodeTool.js +4 -3
  155. package/dist/esm/tools/search-and-geocode-tool/SearchAndGeocodeTool.js.map +1 -1
  156. package/dist/esm/tools/static-map-image-tool/StaticMapImageTool.d.ts.map +1 -1
  157. package/dist/esm/tools/static-map-image-tool/StaticMapImageTool.js +3 -3
  158. package/dist/esm/tools/static-map-image-tool/StaticMapImageTool.js.map +1 -1
  159. package/dist/esm/utils/jsonSchema2020.d.ts +26 -0
  160. package/dist/esm/utils/jsonSchema2020.d.ts.map +1 -0
  161. package/dist/esm/utils/jsonSchema2020.js +138 -0
  162. package/dist/esm/utils/jsonSchema2020.js.map +1 -0
  163. package/dist/esm/utils/jwtUtils.d.ts +48 -0
  164. package/dist/esm/utils/jwtUtils.d.ts.map +1 -1
  165. package/dist/esm/utils/jwtUtils.js +61 -0
  166. package/dist/esm/utils/jwtUtils.js.map +1 -1
  167. package/dist/esm/utils/mapAppPayload.d.ts +109 -0
  168. package/dist/esm/utils/mapAppPayload.d.ts.map +1 -1
  169. package/dist/esm/utils/mapAppPayload.js +38 -2
  170. package/dist/esm/utils/mapAppPayload.js.map +1 -1
  171. package/dist/esm/utils/selfFetchRef.d.ts.map +1 -1
  172. package/dist/esm/utils/selfFetchRef.js +31 -0
  173. package/dist/esm/utils/selfFetchRef.js.map +1 -1
  174. package/dist/esm/utils/serverInstructions.d.ts +12 -0
  175. package/dist/esm/utils/serverInstructions.d.ts.map +1 -0
  176. package/dist/esm/utils/serverInstructions.js +25 -0
  177. package/dist/esm/utils/serverInstructions.js.map +1 -0
  178. package/dist/esm/utils/storeMapPayload.d.ts +11 -11
  179. package/dist/esm/utils/storeMapPayload.d.ts.map +1 -1
  180. package/dist/esm/utils/storeMapPayload.js +14 -13
  181. package/dist/esm/utils/storeMapPayload.js.map +1 -1
  182. package/dist/esm/utils/temporaryResourceManager.d.ts +10 -4
  183. package/dist/esm/utils/temporaryResourceManager.d.ts.map +1 -1
  184. package/dist/esm/utils/temporaryResourceManager.js.map +1 -1
  185. package/dist/esm/utils/tracing.d.ts +4 -0
  186. package/dist/esm/utils/tracing.d.ts.map +1 -1
  187. package/dist/esm/utils/tracing.js +19 -0
  188. package/dist/esm/utils/tracing.js.map +1 -1
  189. package/dist/esm/version.json +3 -3
  190. package/package.json +2 -2
  191. package/patches/{@modelcontextprotocol+sdk+1.29.0.patch → @modelcontextprotocol+sdk+1.30.0.patch} +6 -2
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+ // Copyright (c) Mapbox, Inc.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.JSON_SCHEMA_2020_12 = void 0;
6
+ exports.toJsonSchema2020 = toJsonSchema2020;
7
+ exports.publishJsonSchema2020 = publishJsonSchema2020;
8
+ const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
9
+ exports.JSON_SCHEMA_2020_12 = 'https://json-schema.org/draft/2020-12/schema';
10
+ const JSON_SCHEMA_DRAFT_07 = 'http://json-schema.org/draft-07/schema#';
11
+ function isObject(value) {
12
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
13
+ }
14
+ // Keywords whose value is a single subschema.
15
+ const SUBSCHEMA_KEYWORDS = [
16
+ 'additionalProperties',
17
+ 'contains',
18
+ 'propertyNames',
19
+ 'not',
20
+ 'if',
21
+ 'then',
22
+ 'else'
23
+ ];
24
+ // Keywords whose value is an array of subschemas.
25
+ const SUBSCHEMA_ARRAY_KEYWORDS = ['anyOf', 'oneOf', 'allOf'];
26
+ // Keywords whose value maps names to subschemas — the names themselves are
27
+ // data (e.g. a property literally called "items"), never keywords.
28
+ const SUBSCHEMA_MAP_KEYWORDS = [
29
+ 'properties',
30
+ 'patternProperties',
31
+ '$defs',
32
+ 'dependentSchemas'
33
+ ];
34
+ /**
35
+ * Convert one draft-07 schema node (and everything under it) to its JSON
36
+ * Schema 2020-12 equivalent. Covers what zod's draft-07 output can contain:
37
+ * tuple `items: [...]` → `prefixItems` (with `additionalItems` → `items`),
38
+ * `definitions` → `$defs` (and `#/definitions/` refs to match). Walks only
39
+ * real subschema positions, so property names are never mistaken for
40
+ * keywords.
41
+ */
42
+ function convertNode(node) {
43
+ if (!isObject(node))
44
+ return node;
45
+ const out = { ...node };
46
+ if ('definitions' in out) {
47
+ out.$defs = { ...out.$defs, ...out.definitions };
48
+ delete out.definitions;
49
+ }
50
+ if (typeof out.$ref === 'string' && out.$ref.startsWith('#/definitions/')) {
51
+ out.$ref = '#/$defs/' + out.$ref.slice('#/definitions/'.length);
52
+ }
53
+ if (Array.isArray(out.items)) {
54
+ out.prefixItems = out.items.map(convertNode);
55
+ if ('additionalItems' in out) {
56
+ out.items = convertNode(out.additionalItems);
57
+ delete out.additionalItems;
58
+ }
59
+ else {
60
+ delete out.items;
61
+ }
62
+ }
63
+ else if ('items' in out) {
64
+ out.items = convertNode(out.items);
65
+ }
66
+ for (const key of SUBSCHEMA_KEYWORDS) {
67
+ if (key in out)
68
+ out[key] = convertNode(out[key]);
69
+ }
70
+ for (const key of SUBSCHEMA_ARRAY_KEYWORDS) {
71
+ if (Array.isArray(out[key])) {
72
+ out[key] = out[key].map(convertNode);
73
+ }
74
+ }
75
+ for (const key of SUBSCHEMA_MAP_KEYWORDS) {
76
+ if (isObject(out[key])) {
77
+ out[key] = Object.fromEntries(Object.entries(out[key]).map(([name, sub]) => [
78
+ name,
79
+ convertNode(sub)
80
+ ]));
81
+ }
82
+ }
83
+ return out;
84
+ }
85
+ /**
86
+ * Convert a draft-07 root schema to JSON Schema 2020-12 and label it as
87
+ * such. A schema that already declares another dialect is returned
88
+ * unchanged.
89
+ */
90
+ function toJsonSchema2020(schema) {
91
+ if (!isObject(schema))
92
+ return schema;
93
+ if (schema.$schema !== undefined && schema.$schema !== JSON_SCHEMA_DRAFT_07) {
94
+ return schema;
95
+ }
96
+ const converted = convertNode(schema);
97
+ converted.$schema = exports.JSON_SCHEMA_2020_12;
98
+ return converted;
99
+ }
100
+ /**
101
+ * Make `tools/list` publish JSON Schema 2020-12 instead of draft-07.
102
+ *
103
+ * MCP SDK 1.x's McpServer generates every tool's inputSchema/outputSchema
104
+ * as draft-07 (with no option to change it), but MCP specifies 2020-12 as
105
+ * the default dialect, and newer clients enforce that — Claude Desktop
106
+ * refuses to call any tool whose outputSchema declares draft-07 ("JSON
107
+ * Schema declares an unsupported dialect ... The default validator
108
+ * supports JSON Schema 2020-12 only").
109
+ *
110
+ * McpServer installs its tools/list handler through the public
111
+ * setRequestHandler on first tool registration, so this wraps that method
112
+ * on this one server instance (not a global patch) and converts the
113
+ * schemas in the handler's result. Must be called before any tool is
114
+ * registered.
115
+ */
116
+ function publishJsonSchema2020(server) {
117
+ const inner = server.server;
118
+ const listToolsMethod = types_js_1.ListToolsRequestSchema.shape.method.value;
119
+ const original = inner.setRequestHandler.bind(inner);
120
+ // setRequestHandler's generic signature can't be expressed for a wrapper
121
+ // without re-declaring the SDK's internal schema types.
122
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
123
+ inner.setRequestHandler = (requestSchema, handler) => {
124
+ if (requestSchema?.shape?.method?.value !== listToolsMethod) {
125
+ return original(requestSchema, handler);
126
+ }
127
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
128
+ return original(requestSchema, async (request, extra) => {
129
+ const result = await handler(request, extra);
130
+ return {
131
+ ...result,
132
+ tools: result.tools.map((tool) => ({
133
+ ...tool,
134
+ inputSchema: toJsonSchema2020(tool.inputSchema),
135
+ ...(tool.outputSchema !== undefined && {
136
+ outputSchema: toJsonSchema2020(tool.outputSchema)
137
+ })
138
+ }))
139
+ };
140
+ });
141
+ };
142
+ }
143
+ //# sourceMappingURL=jsonSchema2020.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsonSchema2020.js","sourceRoot":"","sources":["../../../src/utils/jsonSchema2020.ts"],"names":[],"mappings":";AAAA,6BAA6B;AAC7B,kCAAkC;;;AA8FlC,4CAQC;AAkBD,sDA2BC;AAhJD,iEAA4E;AAE/D,QAAA,mBAAmB,GAC9B,8CAA8C,CAAC;AACjD,MAAM,oBAAoB,GAAG,yCAAyC,CAAC;AAIvE,SAAS,QAAQ,CAAC,KAAc;IAC9B,O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IAAI,CAAC,WAAW,CAAC;oBAC/C,GAAG,CAAC,IAAI,CAAC,YAAY,KAAK,SAAS,IAAI;wBACrC,YAAY,EAAE,gBAAgB,CAAC,IAAI,CAAC,YAAY,CAAC;qBAClD,CAAC;iBACH,CAAC,CAAC;aACJ,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
@@ -4,6 +4,54 @@
4
4
  * Mapbox tokens are JWTs whose payload contains the username under the `u` key.
5
5
  * Returns undefined if the token is malformed or missing the `u` field — callers
6
6
  * can decide whether to surface an error or fall back to another auth path.
7
+ *
8
+ * SECURITY: the returned name is an UNVERIFIED claim. This decodes the payload
9
+ * without checking the signature (Mapbox signs with a secret only Mapbox holds,
10
+ * so it cannot be checked here), which means any caller can fabricate a token
11
+ * asserting any username. Use this only where the value is non-authoritative —
12
+ * e.g. building a `/tokens/v2/{username}` request URL, where a forged name
13
+ * simply makes the Mapbox API reject the call. Never use it to decide whether
14
+ * one caller may read another caller's data; use {@link getOwnerKeyFromToken}
15
+ * and {@link ownerKeyMatches} for that.
7
16
  */
8
17
  export declare function getUserNameFromToken(token: string): string | undefined;
18
+ /**
19
+ * Derive the ownership key used to scope temporary resources to the caller.
20
+ *
21
+ * This is a SHA-256 fingerprint of the raw token string — NOT the `u` claim.
22
+ * The distinction is the whole point: `getUserNameFromToken` reads an
23
+ * *unverified* claim out of a token payload that anyone can fabricate, because
24
+ * Mapbox signs its tokens with a secret only Mapbox holds and this server
25
+ * therefore cannot check the signature locally. Scoping a resource by username
26
+ * means anyone who learns a resource URI and a Mapbox username can mint a
27
+ * garbage token asserting `{"u":"<victim>"}` and read that resource.
28
+ *
29
+ * Fingerprinting the token instead makes the check depend on bytes the attacker
30
+ * would have to already possess. An attacker holding the victim's real token
31
+ * does not need this path at all — they can call the Mapbox API directly — so
32
+ * the bypass stops being worth anything. No signature verification and no
33
+ * network round-trip to an introspection endpoint are required, which keeps
34
+ * resource reads at the O(1) cost the temporary-resource cache exists to
35
+ * preserve.
36
+ *
37
+ * Tradeoff: ownership is now per-token rather than per-account. A caller that
38
+ * rotates to a different token mid-session can no longer read resources it
39
+ * created under the previous one; those reads fail closed and surface as the
40
+ * normal "not found or expired" response. With a 30-minute TTL this is a narrow
41
+ * window, and failing closed is the correct direction for an authorization
42
+ * check.
43
+ *
44
+ * Returns undefined for an empty/absent token so callers keep failing closed.
45
+ */
46
+ export declare function getOwnerKeyFromToken(token: string | undefined): string | undefined;
47
+ /**
48
+ * Compare two ownership keys from {@link getOwnerKeyFromToken}.
49
+ *
50
+ * Fails closed when either side is undefined — an unowned resource is never
51
+ * readable. The comparison is constant-time so the check cannot be probed
52
+ * byte-by-byte; SHA-256 preimage resistance already makes a leaked digest
53
+ * useless, but an authorization comparison on a credential-derived value has no
54
+ * reason not to be constant-time.
55
+ */
56
+ export declare function ownerKeyMatches(expected: string | undefined, actual: string | undefined): boolean;
9
57
  //# sourceMappingURL=jwtUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"jwtUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/jwtUtils.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAWtE"}
1
+ {"version":3,"file":"jwtUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/jwtUtils.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAWtE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,MAAM,GAAG,SAAS,CAGpB;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,GACzB,OAAO,CAMT"}
@@ -3,12 +3,24 @@
3
3
  // Licensed under the MIT License.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.getUserNameFromToken = getUserNameFromToken;
6
+ exports.getOwnerKeyFromToken = getOwnerKeyFromToken;
7
+ exports.ownerKeyMatches = ownerKeyMatches;
8
+ const node_crypto_1 = require("node:crypto");
6
9
  /**
7
10
  * Extract the Mapbox username from a JWT access token.
8
11
  *
9
12
  * Mapbox tokens are JWTs whose payload contains the username under the `u` key.
10
13
  * Returns undefined if the token is malformed or missing the `u` field — callers
11
14
  * can decide whether to surface an error or fall back to another auth path.
15
+ *
16
+ * SECURITY: the returned name is an UNVERIFIED claim. This decodes the payload
17
+ * without checking the signature (Mapbox signs with a secret only Mapbox holds,
18
+ * so it cannot be checked here), which means any caller can fabricate a token
19
+ * asserting any username. Use this only where the value is non-authoritative —
20
+ * e.g. building a `/tokens/v2/{username}` request URL, where a forged name
21
+ * simply makes the Mapbox API reject the call. Never use it to decide whether
22
+ * one caller may read another caller's data; use {@link getOwnerKeyFromToken}
23
+ * and {@link ownerKeyMatches} for that.
12
24
  */
13
25
  function getUserNameFromToken(token) {
14
26
  const parts = token.split('.');
@@ -22,4 +34,55 @@ function getUserNameFromToken(token) {
22
34
  return undefined;
23
35
  }
24
36
  }
37
+ /**
38
+ * Derive the ownership key used to scope temporary resources to the caller.
39
+ *
40
+ * This is a SHA-256 fingerprint of the raw token string — NOT the `u` claim.
41
+ * The distinction is the whole point: `getUserNameFromToken` reads an
42
+ * *unverified* claim out of a token payload that anyone can fabricate, because
43
+ * Mapbox signs its tokens with a secret only Mapbox holds and this server
44
+ * therefore cannot check the signature locally. Scoping a resource by username
45
+ * means anyone who learns a resource URI and a Mapbox username can mint a
46
+ * garbage token asserting `{"u":"<victim>"}` and read that resource.
47
+ *
48
+ * Fingerprinting the token instead makes the check depend on bytes the attacker
49
+ * would have to already possess. An attacker holding the victim's real token
50
+ * does not need this path at all — they can call the Mapbox API directly — so
51
+ * the bypass stops being worth anything. No signature verification and no
52
+ * network round-trip to an introspection endpoint are required, which keeps
53
+ * resource reads at the O(1) cost the temporary-resource cache exists to
54
+ * preserve.
55
+ *
56
+ * Tradeoff: ownership is now per-token rather than per-account. A caller that
57
+ * rotates to a different token mid-session can no longer read resources it
58
+ * created under the previous one; those reads fail closed and surface as the
59
+ * normal "not found or expired" response. With a 30-minute TTL this is a narrow
60
+ * window, and failing closed is the correct direction for an authorization
61
+ * check.
62
+ *
63
+ * Returns undefined for an empty/absent token so callers keep failing closed.
64
+ */
65
+ function getOwnerKeyFromToken(token) {
66
+ if (!token)
67
+ return undefined;
68
+ return (0, node_crypto_1.createHash)('sha256').update(token, 'utf-8').digest('hex');
69
+ }
70
+ /**
71
+ * Compare two ownership keys from {@link getOwnerKeyFromToken}.
72
+ *
73
+ * Fails closed when either side is undefined — an unowned resource is never
74
+ * readable. The comparison is constant-time so the check cannot be probed
75
+ * byte-by-byte; SHA-256 preimage resistance already makes a leaked digest
76
+ * useless, but an authorization comparison on a credential-derived value has no
77
+ * reason not to be constant-time.
78
+ */
79
+ function ownerKeyMatches(expected, actual) {
80
+ if (!expected || !actual)
81
+ return false;
82
+ const a = Buffer.from(expected, 'utf-8');
83
+ const b = Buffer.from(actual, 'utf-8');
84
+ if (a.length !== b.length)
85
+ return false;
86
+ return (0, node_crypto_1.timingSafeEqual)(a, b);
87
+ }
25
88
  //# sourceMappingURL=jwtUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"jwtUtils.js","sourceRoot":"","sources":["../../../src/utils/jwtUtils.ts"],"names":[],"mappings":";AAAA,6BAA6B;AAC7B,kCAAkC;;AASlC,oDAWC;AAlBD;;;;;;GAMG;AACH,SAAgB,oBAAoB,CAAC,KAAa;IAChD,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IACzC,IAA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O,IAAA,wBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACnE,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,eAAe,CAC7B,QAA4B,EAC5B,MAA0B;IAE1B,IAAI,CAAC,QAAQ,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IACvC,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACzC,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IACxC,OAAO,IAAA,6BAAe,EAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC/B,CAAC"}
@@ -43,7 +43,62 @@ export interface MapAppLayer {
43
43
  paint?: Record<string, unknown>;
44
44
  /** Mapbox Style spec layout object, passed through to addLayer. */
45
45
  layout?: Record<string, unknown>;
46
+ /**
47
+ * Where to place this layer relative to the Standard base style's own
48
+ * layers ('bottom' | 'middle' | 'top'). Omit to keep the current
49
+ * behavior: the layer renders above everything, including labels.
50
+ */
51
+ slot?: 'bottom' | 'middle' | 'top';
52
+ }
53
+ /**
54
+ * Standard base-style config properties (`map.setConfigProperty('basemap',
55
+ * key, value)`), for restyling the base map itself rather than adding new
56
+ * layers on top of it. Only the currently-documented properties are typed;
57
+ * `.passthrough()` on the Zod schema below lets a Standard property Mapbox
58
+ * ships later flow through without a schema change here. Has no effect if
59
+ * the underlying base style isn't Standard.
60
+ */
61
+ export interface MapAppBaseMapConfig {
62
+ theme?: 'default' | 'faded' | 'monochrome' | 'custom';
63
+ lightPreset?: 'day' | 'dawn' | 'dusk' | 'night';
64
+ colorWater?: string;
65
+ colorLand?: string;
66
+ colorGreenspace?: string;
67
+ colorMotorways?: string;
68
+ colorTrunks?: string;
69
+ colorRoads?: string;
70
+ colorBuildings?: string;
71
+ colorAdminBoundaries?: string;
72
+ colorCommercial?: string;
73
+ colorEducation?: string;
74
+ colorMedical?: string;
75
+ colorIndustrial?: string;
76
+ colorPlaceLabels?: string;
77
+ colorRoadLabels?: string;
78
+ colorPointOfInterestLabels?: string;
79
+ showPointOfInterestLabels?: boolean;
80
+ showTransitLabels?: boolean;
81
+ showPlaceLabels?: boolean;
82
+ showRoadLabels?: boolean;
83
+ showAdminBoundaries?: boolean;
84
+ showIndoor?: boolean;
85
+ showIndoorLabels?: boolean;
86
+ showLandmarkIconLabels?: boolean;
87
+ show3dObjects?: boolean;
88
+ show3dTrees?: boolean;
89
+ show3dFacades?: boolean;
90
+ densityPointOfInterestLabels?: number;
46
91
  }
92
+ /**
93
+ * Which Mapbox-owned base style to load. Both are part of the Standard
94
+ * family (same config-property system and `bottom`/`middle`/`top` slots,
95
+ * per https://docs.mapbox.com/map-styles/reference/), so `baseMapConfig`
96
+ * and `slot` work under either — `standard-satellite` just doesn't support
97
+ * every Standard property (no `theme`, no flat-color overrides like
98
+ * `colorWater`/`colorBuildings`, since imagery replaces those surfaces).
99
+ * Defaults to `standard` when omitted.
100
+ */
101
+ export type MapAppBaseStyle = 'standard' | 'standard-satellite';
47
102
  export interface MapAppMarker {
48
103
  coordinates: [number, number];
49
104
  /**
@@ -109,6 +164,10 @@ export interface MapAppPayload {
109
164
  defer?: MapAppDeferredLayer;
110
165
  /** Layers the iframe fetches and builds itself, post-initial-render. */
111
166
  selfFetch?: MapAppSelfFetch[];
167
+ /** Restyles the Standard base map itself (colors, theme, lightPreset, label visibility). */
168
+ baseMapConfig?: MapAppBaseMapConfig;
169
+ /** Which Mapbox-owned base style to load; defaults to `standard`. */
170
+ baseStyle?: MapAppBaseStyle;
112
171
  }
113
172
  export declare const MapAppPayloadSchema: z.ZodObject<{
114
173
  summary: z.ZodOptional<z.ZodString>;
@@ -150,6 +209,11 @@ export declare const MapAppPayloadSchema: z.ZodObject<{
150
209
  }, z.core.$strip>]>;
151
210
  paint: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
152
211
  layout: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
212
+ slot: z.ZodOptional<z.ZodEnum<{
213
+ bottom: "bottom";
214
+ middle: "middle";
215
+ top: "top";
216
+ }>>;
153
217
  }, z.core.$strip>>;
154
218
  markers: z.ZodOptional<z.ZodArray<z.ZodObject<{
155
219
  coordinates: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
@@ -185,6 +249,51 @@ export declare const MapAppPayloadSchema: z.ZodObject<{
185
249
  }>;
186
250
  params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
187
251
  }, z.core.$strip>>>;
252
+ baseMapConfig: z.ZodOptional<z.ZodObject<{
253
+ theme: z.ZodOptional<z.ZodEnum<{
254
+ default: "default";
255
+ custom: "custom";
256
+ faded: "faded";
257
+ monochrome: "monochrome";
258
+ }>>;
259
+ lightPreset: z.ZodOptional<z.ZodEnum<{
260
+ day: "day";
261
+ dawn: "dawn";
262
+ dusk: "dusk";
263
+ night: "night";
264
+ }>>;
265
+ colorWater: z.ZodOptional<z.ZodString>;
266
+ colorLand: z.ZodOptional<z.ZodString>;
267
+ colorGreenspace: z.ZodOptional<z.ZodString>;
268
+ colorMotorways: z.ZodOptional<z.ZodString>;
269
+ colorTrunks: z.ZodOptional<z.ZodString>;
270
+ colorRoads: z.ZodOptional<z.ZodString>;
271
+ colorBuildings: z.ZodOptional<z.ZodString>;
272
+ colorAdminBoundaries: z.ZodOptional<z.ZodString>;
273
+ colorCommercial: z.ZodOptional<z.ZodString>;
274
+ colorEducation: z.ZodOptional<z.ZodString>;
275
+ colorMedical: z.ZodOptional<z.ZodString>;
276
+ colorIndustrial: z.ZodOptional<z.ZodString>;
277
+ colorPlaceLabels: z.ZodOptional<z.ZodString>;
278
+ colorRoadLabels: z.ZodOptional<z.ZodString>;
279
+ colorPointOfInterestLabels: z.ZodOptional<z.ZodString>;
280
+ showPointOfInterestLabels: z.ZodOptional<z.ZodBoolean>;
281
+ showTransitLabels: z.ZodOptional<z.ZodBoolean>;
282
+ showPlaceLabels: z.ZodOptional<z.ZodBoolean>;
283
+ showRoadLabels: z.ZodOptional<z.ZodBoolean>;
284
+ showAdminBoundaries: z.ZodOptional<z.ZodBoolean>;
285
+ showIndoor: z.ZodOptional<z.ZodBoolean>;
286
+ showIndoorLabels: z.ZodOptional<z.ZodBoolean>;
287
+ showLandmarkIconLabels: z.ZodOptional<z.ZodBoolean>;
288
+ show3dObjects: z.ZodOptional<z.ZodBoolean>;
289
+ show3dTrees: z.ZodOptional<z.ZodBoolean>;
290
+ show3dFacades: z.ZodOptional<z.ZodBoolean>;
291
+ densityPointOfInterestLabels: z.ZodOptional<z.ZodNumber>;
292
+ }, z.core.$loose>>;
293
+ baseStyle: z.ZodOptional<z.ZodEnum<{
294
+ standard: "standard";
295
+ "standard-satellite": "standard-satellite";
296
+ }>>;
188
297
  }, z.core.$strip>;
189
298
  /**
190
299
  * Decode a Mapbox polyline string (precision 5 by default) to a GeoJSON
@@ -1 +1 @@
1
- {"version":3,"file":"mapAppPayload.d.ts","sourceRoot":"","sources":["../../../src/utils/mapAppPayload.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,QAAQ,GAChB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GAChD;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAA;CAAE,GACvD;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,CAAA;CAAE,GACtD;IAAE,IAAI,EAAE,cAA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C,CAAC;CACjC;AAED,MAAM,WAAW,aAAa;IAC5B,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,sDAAsD;IACtD,MAAM,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC7B,6EAA6E;IAC7E,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,0DAA0D;IAC1D,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,wEAAwE;IACxE,SAAS,CAAC,EAAE,eAAe,EAAE,CAAC;IAC9B,4FAA4F;IAC5F,aAAa,CAAC,EAAE,mBAAmB,CAAC;IACpC,qEAAqE;IACrE,SAAS,CAAC,EAAE,eAAe,CAAC;CAC7B;AAwGD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAS9B,CAAC;AAEH;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,MAAM,EACX,SAAS,SAAI,GACZ,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,IAAI,CAiC3B;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,MAAM,GACV,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,IAAI,CAE3B"}
@@ -29,8 +29,42 @@ const MapAppLayerSchema = zod_1.z.object({
29
29
  type: zod_1.z.enum(['fill', 'line', 'circle', 'symbol']),
30
30
  data: zod_1.z.union([FeatureSchema, FeatureCollectionSchema]),
31
31
  paint: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
32
- layout: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional()
32
+ layout: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
33
+ slot: zod_1.z.enum(['bottom', 'middle', 'top']).optional()
33
34
  });
35
+ const MapAppBaseMapConfigSchema = zod_1.z
36
+ .object({
37
+ theme: zod_1.z.enum(['default', 'faded', 'monochrome', 'custom']).optional(),
38
+ lightPreset: zod_1.z.enum(['day', 'dawn', 'dusk', 'night']).optional(),
39
+ colorWater: zod_1.z.string().optional(),
40
+ colorLand: zod_1.z.string().optional(),
41
+ colorGreenspace: zod_1.z.string().optional(),
42
+ colorMotorways: zod_1.z.string().optional(),
43
+ colorTrunks: zod_1.z.string().optional(),
44
+ colorRoads: zod_1.z.string().optional(),
45
+ colorBuildings: zod_1.z.string().optional(),
46
+ colorAdminBoundaries: zod_1.z.string().optional(),
47
+ colorCommercial: zod_1.z.string().optional(),
48
+ colorEducation: zod_1.z.string().optional(),
49
+ colorMedical: zod_1.z.string().optional(),
50
+ colorIndustrial: zod_1.z.string().optional(),
51
+ colorPlaceLabels: zod_1.z.string().optional(),
52
+ colorRoadLabels: zod_1.z.string().optional(),
53
+ colorPointOfInterestLabels: zod_1.z.string().optional(),
54
+ showPointOfInterestLabels: zod_1.z.boolean().optional(),
55
+ showTransitLabels: zod_1.z.boolean().optional(),
56
+ showPlaceLabels: zod_1.z.boolean().optional(),
57
+ showRoadLabels: zod_1.z.boolean().optional(),
58
+ showAdminBoundaries: zod_1.z.boolean().optional(),
59
+ showIndoor: zod_1.z.boolean().optional(),
60
+ showIndoorLabels: zod_1.z.boolean().optional(),
61
+ showLandmarkIconLabels: zod_1.z.boolean().optional(),
62
+ show3dObjects: zod_1.z.boolean().optional(),
63
+ show3dTrees: zod_1.z.boolean().optional(),
64
+ show3dFacades: zod_1.z.boolean().optional(),
65
+ densityPointOfInterestLabels: zod_1.z.number().optional()
66
+ })
67
+ .passthrough();
34
68
  const MapAppMarkerSchema = zod_1.z.object({
35
69
  coordinates: zod_1.z.tuple([zod_1.z.number(), zod_1.z.number()]),
36
70
  style: zod_1.z.enum(['pin', 'numbered', 'start', 'end']).optional(),
@@ -71,7 +105,9 @@ exports.MapAppPayloadSchema = zod_1.z.object({
71
105
  markers: zod_1.z.array(MapAppMarkerSchema).optional(),
72
106
  legend: zod_1.z.array(MapAppLegendEntrySchema).optional(),
73
107
  camera: MapAppCameraSchema.optional(),
74
- selfFetch: zod_1.z.array(MapAppSelfFetchSchema).optional()
108
+ selfFetch: zod_1.z.array(MapAppSelfFetchSchema).optional(),
109
+ baseMapConfig: MapAppBaseMapConfigSchema.optional(),
110
+ baseStyle: zod_1.z.enum(['standard', 'standard-satellite']).optional()
75
111
  });
76
112
  /**
77
113
  * Decode a Mapbox polyline string (precision 5 by default) to a GeoJSON
@@ -1 +1 @@
1
- {"version":3,"file":"mapAppPayload.js","sourceRoot":"","sources":["../../../src/utils/mapAppPayload.ts"],"names":[],"mappings":";AAAA,6BAA6B;AAC7B,kCAAkC;;;AAmNlC,wCAoCC;AAOD,gEAIC;AAhQD,6BAAwB;AA2HxB,6EAA6E;AAC7E,0EAA0E;AAC1E,2EAA2E;AAC3E,iEAAiE;AACjE,kEAAkE;AAClE,MAAM,cAAc,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9B,IAAI,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC;IAChE,WAAW,EAAE,OAAC,CAAC,OAAO,EAAE;CACzB,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7B,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IAC1B,QAAQ,EAAE,cAAc;IACxB,UAAU,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;CACzD,CAAC,CAAC;AAEH,MAAM,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IACvC,IA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../../../src/utils/selfFetchRef.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAIzE,MAAM,MAAM,aAAa,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;AAYpD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,aAAa,EACnB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,MAAM,CAKR;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEnD;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CA2BrE"}
1
+ {"version":3,"file":"selfFetchRef.d.ts","sourceRoot":"","sources":["../../../src/utils/selfFetchRef.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAIzE,MAAM,MAAM,aAAa,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;AAYpD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,aAAa,EACnB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,MAAM,CAKR;AA4CD,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEnD;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CA4BrE"}
@@ -30,6 +30,35 @@ function buildSelfFetchRef(tool, params) {
30
30
  const data = Buffer.from(JSON.stringify(params), 'utf8').toString('base64url');
31
31
  return `${SELF_FETCH_URI_PREFIX}${tool}?data=${data}`;
32
32
  }
33
+ function isNonEmptyNumberArray(value) {
34
+ return (Array.isArray(value) &&
35
+ value.length > 0 &&
36
+ value.every((v) => typeof v === 'number' && Number.isFinite(v)));
37
+ }
38
+ /**
39
+ * Reject refs whose params can't produce a valid API request in the iframe.
40
+ * A ref minted by the tool itself always passes, but the ref format is easy
41
+ * for an LLM to hand-write, and a malformed one would otherwise resolve
42
+ * here, report success to the LLM, and only fail later inside the iframe
43
+ * (e.g. `contours_minutes: 15` instead of `[15]` is silently dropped from
44
+ * the Isochrone request, which then 422s with "You must supply one of
45
+ * contours_meters or contours_minutes"). Failing here routes the ref into
46
+ * render_map_tool's unresolved-refs path, which tells the LLM to re-run
47
+ * the source tool.
48
+ */
49
+ function hasValidSelfFetchParams(tool, params) {
50
+ if (tool === 'isochrone') {
51
+ const coords = params.coordinates;
52
+ if (!coords ||
53
+ typeof coords.longitude !== 'number' ||
54
+ typeof coords.latitude !== 'number') {
55
+ return false;
56
+ }
57
+ return (isNonEmptyNumberArray(params.contours_minutes) ||
58
+ isNonEmptyNumberArray(params.contours_meters));
59
+ }
60
+ return true;
61
+ }
33
62
  function isSelfFetchRef(uri) {
34
63
  return uri.startsWith(SELF_FETCH_URI_PREFIX);
35
64
  }
@@ -67,6 +96,8 @@ function resolveSelfFetchRef(uri) {
67
96
  }
68
97
  if (!params || typeof params !== 'object')
69
98
  return null;
99
+ if (!hasValidSelfFetchParams(tool, params))
100
+ return null;
70
101
  return {
71
102
  layers: [],
72
103
  selfFetch: [{ tool: tool, params }]
@@ -1 +1 @@
1
- {"version":3,"file":"selfFetchRef.js","sourceRoot":"","sources":["../../../src/utils/selfFetchRef.ts"],"names":[],"mappings":";AAAA,6BAA6B;AAC7B,kCAAkC;;AA6BlC,8CAQC;AAED,wCAEC;AAUD,kDA2BC;AA1ED,MAAM,qBAAqB,GAAG,qBAAqB,CAAC;AAIpD,MAAM,gBAAgB,GAA6B;IACjD,YAAY;IACZ,WAAW;IACX,cAAc;IACd,QAAQ;IACR,iBAAiB;IACjB,cAAc;IACd,iBAAiB;CAClB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,SAAgB,iBAAiB,CAC/B,IAAm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C;IACD,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACvD,IAAI,CAAC,uBAAuB,CAAC,IAAqB,EAAE,MAAM,CAAC;QAAE,OAAO,IAAI,CAAC;IAEzE,OAAO;QACL,MAAM,EAAE,EAAE;QACV,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAqB,EAAE,MAAM,EAAE,CAAC;KACrD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Server-level `instructions` returned from `initialize`.
3
+ *
4
+ * Hosts that load tools lazily (Claude Desktop, Claude Code) list only tool
5
+ * names until the model loads a tool, so tool descriptions can't steer
6
+ * which tool gets picked — e.g. a model asked to "show a map" loaded
7
+ * static_map_image_tool because of its name and never saw
8
+ * render_map_tool's "ALWAYS use this tool to display maps". Server
9
+ * instructions are shown up front, so the routing rule lives here.
10
+ */
11
+ export declare function buildServerInstructions(enabledToolNames: readonly string[]): string | undefined;
12
+ //# sourceMappingURL=serverInstructions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serverInstructions.d.ts","sourceRoot":"","sources":["../../../src/utils/serverInstructions.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACrC,gBAAgB,EAAE,SAAS,MAAM,EAAE,GAClC,MAAM,GAAG,SAAS,CAYpB"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ // Copyright (c) Mapbox, Inc.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.buildServerInstructions = buildServerInstructions;
6
+ /**
7
+ * Server-level `instructions` returned from `initialize`.
8
+ *
9
+ * Hosts that load tools lazily (Claude Desktop, Claude Code) list only tool
10
+ * names until the model loads a tool, so tool descriptions can't steer
11
+ * which tool gets picked — e.g. a model asked to "show a map" loaded
12
+ * static_map_image_tool because of its name and never saw
13
+ * render_map_tool's "ALWAYS use this tool to display maps". Server
14
+ * instructions are shown up front, so the routing rule lives here.
15
+ */
16
+ function buildServerInstructions(enabledToolNames) {
17
+ if (!enabledToolNames.includes('render_map_tool'))
18
+ return undefined;
19
+ const lines = [
20
+ 'To show anything on a map, use render_map_tool: it renders an interactive Mapbox GL JS map inline.',
21
+ 'When a tool result includes mapboxRender.ref, pass that ref unchanged in render_map_tool payload_refs (several refs can share one map). Never write or edit a ref by hand.'
22
+ ];
23
+ if (enabledToolNames.includes('static_map_image_tool')) {
24
+ lines.push('Use static_map_image_tool only when the user explicitly asks for a static image file (PNG/JPEG), never as the default way to show a map.');
25
+ }
26
+ return lines.join('\n');
27
+ }
28
+ //# sourceMappingURL=serverInstructions.js.map