@tomtom-org/maps-sdk-plugin-agent-toolkit 0.2.7 → 0.2.12
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/README.md +168 -120
- package/dist/index.d.ts +580 -89
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/package.json +12 -10
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ A headless conversational agent that gives Large Language Models tool-based cont
|
|
|
4
4
|
|
|
5
5
|
No UI is included — bring your own chat interface. No LLM provider is bundled — supply any AI SDK-compatible model.
|
|
6
6
|
|
|
7
|
-
> **Full documentation** — guides, architecture diagrams, and tutorials are available at [docs.tomtom.com](https://docs.tomtom.com/maps-sdk-js/guides/plugins/agent-toolkit).
|
|
7
|
+
> **Full documentation** — guides, architecture diagrams, and tutorials are available at [docs.tomtom.com](https://docs.tomtom.com/maps-sdk-js/guides/plugins/agent-toolkit/overview).
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
@@ -49,8 +49,7 @@ console.log(result.text);
|
|
|
49
49
|
### With React (`useChat`)
|
|
50
50
|
|
|
51
51
|
```typescript
|
|
52
|
-
import { DirectChatTransport } from 'ai/react';
|
|
53
|
-
import { useChat } from 'ai/react';
|
|
52
|
+
import { DirectChatTransport, useChat } from 'ai/react';
|
|
54
53
|
|
|
55
54
|
const agent = createMapAgent(map, { model: openai('gpt-4o') });
|
|
56
55
|
|
|
@@ -74,93 +73,121 @@ See [`examples/map-chat-agent`](../../examples/map-chat-agent) for a full workin
|
|
|
74
73
|
|
|
75
74
|
## Tools reference
|
|
76
75
|
|
|
77
|
-
The plugin ships
|
|
76
|
+
The plugin ships a `DEFAULT_TOOLS` registry covering search, routing, traffic, reachable areas, BYOD GeoJSON, base-map control, MapLibre access, and code-generated analysis. All tools are included by default and can be individually removed or replaced via the [`tools` option](#composing-tool-sets). The full per-tool reference lives in the [Agent Toolkit guide](https://docs.tomtom.com/maps-sdk-js/guides/plugins/agent-toolkit/tools).
|
|
78
77
|
|
|
79
|
-
###
|
|
78
|
+
### Location & search
|
|
80
79
|
|
|
81
80
|
| Tool | Description |
|
|
82
81
|
|---|---|
|
|
83
82
|
| `locatePlace` | Resolve a location string (landmark, city, address) to a place; optionally stage as a waypoint |
|
|
84
83
|
| `reverseGeocode` | Convert `[longitude, latitude]` coordinates to an address |
|
|
85
84
|
| `discoverPlaces` | Search for places by text query or POI category within an area |
|
|
85
|
+
| `getPOICategoryCodes` | Look up TomTom POI category codes from natural-language names |
|
|
86
|
+
| `getCurrentLocation` | Get the user's physical GPS location from the browser |
|
|
87
|
+
| `getViewport` | Get current map center, zoom, and bounding box |
|
|
88
|
+
|
|
89
|
+
### Routing & reachable areas
|
|
90
|
+
|
|
91
|
+
| Tool | Description |
|
|
92
|
+
|---|---|
|
|
86
93
|
| `setRoute` | Calculate or recalculate a route — provide `locations` (waypoints), `parameters` (route options), or both |
|
|
87
94
|
| `addWaypointsToRoute` | Extend the current route — prepend a new origin, append a new destination, and/or insert intermediate stops |
|
|
88
95
|
| `removeWaypointsFromRoute` | Remove one or more waypoints by index from the current route |
|
|
89
96
|
| `replaceWaypointInRoute` | Overwrite a single waypoint of the current route in place — origin, destination, or by index |
|
|
90
|
-
| `
|
|
91
|
-
| `
|
|
92
|
-
|
|
97
|
+
| `getCurrentWaypoints` | Get the staged waypoint slots (origin, stops, destination) |
|
|
98
|
+
| `findReachableAreas` | Calculate isochrone/isodistance polygons from one or more origins |
|
|
99
|
+
|
|
100
|
+
### Traffic
|
|
101
|
+
|
|
102
|
+
| Tool | Description |
|
|
103
|
+
|---|---|
|
|
104
|
+
| `getTrafficIncidents` | Fetch traffic incidents within an area (viewport, named place, route corridor, polygon, IDs) |
|
|
105
|
+
| `startTrafficIncidentsMonitor` | Start a live monitor that refreshes incident state on a configurable cadence |
|
|
93
106
|
| `stopTrafficIncidentsMonitor` | Stop the live incident monitor |
|
|
94
|
-
| `analyseIncidents` | Aggregate / count / chart incidents already in state via dynamic JS (categories, top delays, clusters, …) |
|
|
95
107
|
| `focusIncidents` | Highlight a subset of incidents (by id / category / severity) on the map and dim the rest |
|
|
96
108
|
| `getTrafficAreaAnalytics` | Fetch historical traffic analytics (speed, congestion, travel time) for an area |
|
|
97
109
|
| `queryTrafficAnalytics` | Query cached analytics data or check what is currently displayed |
|
|
98
|
-
| `
|
|
99
|
-
| `
|
|
110
|
+
| `toggleTilesTrafficFlow` | Toggle the real-time traffic-flow tile overlay |
|
|
111
|
+
| `toggleTilesTrafficIncidents` | Toggle the real-time traffic-incidents tile overlay |
|
|
112
|
+
| `getShownTileIncidents` | List real-time incidents visible in the current viewport |
|
|
113
|
+
|
|
114
|
+
### Bring-your-own-data (BYOD)
|
|
115
|
+
|
|
116
|
+
| Tool | Description |
|
|
117
|
+
|---|---|
|
|
118
|
+
| `addByodLayer` | Ingest a customer-authored GeoJSON layer from a URL or inline `FeatureCollection` |
|
|
119
|
+
| `recallByod` | List BYOD entries, or retrieve a single entry's full `FeatureCollection` by id |
|
|
120
|
+
| `updateByodDisplay` | Show, hide, or clear BYOD layers on the map |
|
|
121
|
+
|
|
122
|
+
> See the [Bring your own data](https://docs.tomtom.com/maps-sdk-js/guides/plugins/agent-toolkit/byod) guide for ingestion patterns, visibility lifecycle, and how BYOD entries feed into `analyseData` / `processData`.
|
|
123
|
+
|
|
124
|
+
### Unified data tools — scope-aware code generation
|
|
125
|
+
|
|
126
|
+
| Tool | Description |
|
|
127
|
+
|---|---|
|
|
128
|
+
| `analyseData` | Aggregate / chart entries (`places`, `routes`, `incidents`, `geometries`, `trafficAreaAnalytics`, `byod`) via dynamic JS; classifier-emitted scope narrows the schema per turn |
|
|
129
|
+
| `processData` | Transform entries into new `places`, `placeConnections`, `geometries`, `byod`, or a `fitOnMap` camera move via dynamic JS |
|
|
130
|
+
| `executeMaplibreCode` | Execute arbitrary MapLibre JS against the live `Map` instance — escape hatch for custom layers, animations, raster overlays |
|
|
131
|
+
|
|
132
|
+
> See [Code generation](https://docs.tomtom.com/maps-sdk-js/guides/plugins/agent-toolkit/code-generation) for the injected identifiers, output contracts, and threat model (these tools have no sandbox), and [Scope-aware data tools](https://docs.tomtom.com/maps-sdk-js/guides/plugins/agent-toolkit/scope-aware-data-tools) for how the per-turn classifier scope keeps the prompt small.
|
|
133
|
+
|
|
134
|
+
### Map display
|
|
100
135
|
|
|
101
|
-
|
|
136
|
+
| Tool | Description |
|
|
137
|
+
|---|---|
|
|
138
|
+
| `updatePlacesDisplay` | Show, hide, or restyle place entries on the map |
|
|
139
|
+
| `updateRoutesDisplay` | Show, hide, or restyle route entries (line color, waypoint icons, fit camera) |
|
|
140
|
+
| `updateWaypointsDisplay` | Show staged waypoint markers without the route line |
|
|
141
|
+
| `updateTrafficAreaAnalyticsDisplay` | Visualize traffic-area-analytics as hexgrid, heatmap, or tiles |
|
|
142
|
+
| `clearMap` | Remove displayed places, routes, BYOD layers, or all features |
|
|
143
|
+
|
|
144
|
+
### Map control
|
|
102
145
|
|
|
103
146
|
| Tool | Description |
|
|
104
147
|
|---|---|
|
|
105
|
-
| `
|
|
106
|
-
| `
|
|
107
|
-
| `
|
|
108
|
-
| `showWaypoints` | Display staged waypoint markers without the route line |
|
|
109
|
-
| `clearMap` | Remove displayed places, routes, or all features |
|
|
110
|
-
| `getShownPlaces` | List places currently displayed on the map |
|
|
111
|
-
| `getShownRoutes` | List routes currently rendered on the map |
|
|
112
|
-
| `getShownWaypoints` | List waypoint markers currently shown |
|
|
113
|
-
| `getShownRouteSections` | List sections (toll, country, motorway, etc.) of the shown route |
|
|
114
|
-
| `getShownRouteTrafficIncidents` | List traffic incidents overlaid on the shown route |
|
|
115
|
-
| `getShownIncidents` | List real-time incidents visible in the current viewport |
|
|
148
|
+
| `flyTo` | Move the camera to a position or bounding box |
|
|
149
|
+
| `zoomInOrOut` | Adjust the zoom level by a delta |
|
|
150
|
+
| `setPitchBearing` | Tilt (pitch) and/or rotate (bearing) the camera |
|
|
116
151
|
| `getStandardMapStyles` | List available standard map style presets |
|
|
117
152
|
| `setMapStandardStyle` | Switch map style (light, dark, satellite, driving, etc.) |
|
|
118
|
-
| `setRouteTheme` | Color the route line and waypoint icons |
|
|
119
153
|
| `setLanguage` | Change the language for map labels and API responses |
|
|
120
|
-
| `
|
|
121
|
-
| `
|
|
122
|
-
| `toggleTrafficFlow` | Toggle real-time traffic flow overlay |
|
|
123
|
-
| `toggleTrafficIncidents` | Toggle real-time traffic incident markers |
|
|
124
|
-
| `fitRouteSection` | Fit the camera to a specific route section by type and ID |
|
|
154
|
+
| `toggleTilesBaseMapLayerGroups` | Show/hide named layer groups (buildings3D, roadLabels, water, etc.) |
|
|
155
|
+
| `toggleTilesPOIs` | Show/hide built-in map POI icons with optional category filtering |
|
|
125
156
|
|
|
126
|
-
### MapLibre
|
|
157
|
+
### MapLibre direct access
|
|
127
158
|
|
|
128
159
|
| Tool | Description |
|
|
129
160
|
|---|---|
|
|
130
|
-
| `flyTo` | Move the camera to a position or bounding box |
|
|
131
|
-
| `getViewport` | Get current map center, zoom, and bounding box |
|
|
132
161
|
| `getMapStyleLayers` | List MapLibre layer IDs with their paint/layout properties |
|
|
133
162
|
| `setLayoutProperties` | Set MapLibre layout properties on named layers |
|
|
134
163
|
| `setPaintProperties` | Set MapLibre paint properties (colors, widths, opacity) on named layers |
|
|
135
|
-
| `setPitchBearing` | Tilt (pitch) and/or rotate (bearing) the camera |
|
|
136
|
-
| `zoomInOrOut` | Adjust the zoom level by a delta |
|
|
137
|
-
| `executeMaplibreCode` | Execute arbitrary MapLibre JS code for maximum flexibility |
|
|
138
164
|
|
|
139
|
-
### State
|
|
165
|
+
### State & recall
|
|
140
166
|
|
|
141
167
|
| Tool | Description |
|
|
142
168
|
|---|---|
|
|
143
169
|
| `recallPlaces` | Retrieve the history of place lookups from this session |
|
|
144
170
|
| `recallRoutes` | Retrieve previously calculated routes from this session |
|
|
145
|
-
| `recallRanges` | Retrieve stored reachable
|
|
146
|
-
| `recallGeometries` |
|
|
147
|
-
| `
|
|
171
|
+
| `recallRanges` | Retrieve stored reachable-range results |
|
|
172
|
+
| `recallGeometries` | Look up polygon sources by `{ kind, id }` across place footprints, isochrones, and `customGeometries` entries |
|
|
173
|
+
| `recallByod` | Retrieve BYOD entries (see [BYOD](#bring-your-own-data-byod)) |
|
|
174
|
+
| `recallState` | Summarize the current contents of every state slice |
|
|
175
|
+
| `setEntryMode` | Switch a slice between `multiple` (default) and `single` entry modes |
|
|
176
|
+
| `resetState` | Reset one or all state slices |
|
|
148
177
|
|
|
149
|
-
###
|
|
178
|
+
### Utilities
|
|
150
179
|
|
|
151
180
|
| Tool | Description |
|
|
152
181
|
|---|---|
|
|
153
182
|
| `calculateBBox` | Compute a bounding box from GeoJSON features or tool results |
|
|
154
183
|
| `formatDistance` | Format meters into a human-readable string (e.g. "2.5 km") |
|
|
155
184
|
| `formatDuration` | Format seconds into a human-readable string (e.g. "1 h 30 min") |
|
|
156
|
-
| `getCurrentLocation` | Get the user's physical GPS location from the browser |
|
|
157
|
-
| `getRouteProgress` | Get the position along the route at a given time or distance |
|
|
158
|
-
| `getSectionProgress` | Get the distance and travel time for route sections by type |
|
|
159
|
-
| `getSectionBBox` | Get the bounding box of a specific route section |
|
|
160
185
|
| `help` | List available capabilities in summary or searchable detail mode |
|
|
161
186
|
|
|
162
187
|
## Customization
|
|
163
188
|
|
|
189
|
+
> See [Customizing tools](https://docs.tomtom.com/maps-sdk-js/guides/plugins/agent-toolkit/customizing-tools) for the full walkthrough — registry resolution, removing or replacing defaults, adding scopable custom tools, and starting from a blank slate.
|
|
190
|
+
|
|
164
191
|
### `createMapAgent` options
|
|
165
192
|
|
|
166
193
|
```typescript
|
|
@@ -188,6 +215,14 @@ const agent = createMapAgent<MyState>(map, {
|
|
|
188
215
|
// Custom state slices — only custom fields needed, built-in slices are created automatically
|
|
189
216
|
state: { fleet: new FleetState() },
|
|
190
217
|
|
|
218
|
+
// Per-kind data-entry config. `enabled: false` removes the kind from the tool surface
|
|
219
|
+
// (drops its recall/display/fetch tools and the kind from analyseData/processData scope).
|
|
220
|
+
// `entryMode` switches the slice between 'multiple' (default) and 'single' (latest only).
|
|
221
|
+
dataEntries: {
|
|
222
|
+
routes: { entryMode: 'single' },
|
|
223
|
+
byod: { enabled: false },
|
|
224
|
+
},
|
|
225
|
+
|
|
191
226
|
// Intent classifier: omit for default LLM-based, false to disable
|
|
192
227
|
classifier: createDefaultClassifier({ model: openai('gpt-4o-mini') }),
|
|
193
228
|
|
|
@@ -202,6 +237,20 @@ const agent = createMapAgent<MyState>(map, {
|
|
|
202
237
|
|
|
203
238
|
// Max tool-loop iterations (default: 10)
|
|
204
239
|
maxSteps: 15,
|
|
240
|
+
|
|
241
|
+
// Opt into experimental features (subject to change without notice)
|
|
242
|
+
featureFlags: { experimentalSearch: true },
|
|
243
|
+
|
|
244
|
+
// Provider-specific options forwarded to the AI SDK on every step
|
|
245
|
+
providerOptions: {
|
|
246
|
+
openai: { reasoningEffort: 'low', reasoningSummary: 'auto' },
|
|
247
|
+
},
|
|
248
|
+
|
|
249
|
+
// Per-step providerOptions override — e.g. bump reasoning only on code-exec turns
|
|
250
|
+
stepProviderOptions: ({ activeTools }) =>
|
|
251
|
+
activeTools?.includes('processData')
|
|
252
|
+
? { openai: { reasoningEffort: 'medium' } }
|
|
253
|
+
: undefined,
|
|
205
254
|
});
|
|
206
255
|
```
|
|
207
256
|
|
|
@@ -253,7 +302,7 @@ const fleetTools = {
|
|
|
253
302
|
return { vehicleId, position };
|
|
254
303
|
},
|
|
255
304
|
tags: ['fleet'],
|
|
256
|
-
relatedTools: ['
|
|
305
|
+
relatedTools: ['updatePlacesDisplay'],
|
|
257
306
|
},
|
|
258
307
|
} satisfies Record<string, ToolEntry>;
|
|
259
308
|
|
|
@@ -284,34 +333,22 @@ type ToolEntry<S extends ToolState = ToolState> = {
|
|
|
284
333
|
|
|
285
334
|
## State management
|
|
286
335
|
|
|
336
|
+
> See the [State](https://docs.tomtom.com/maps-sdk-js/guides/plugins/agent-toolkit/state) guide for a per-slice deep dive, `entryMode` semantics (`multiple` vs `single`), inspecting state from your application, and adding custom slices.
|
|
337
|
+
|
|
287
338
|
`ToolState` is organized by feature area. Each slice manages lazy-initialized map modules and an append-only history of results produced during the session. Built-in slices:
|
|
288
339
|
|
|
289
340
|
- `PlacesState` — place / geometry entry history
|
|
290
341
|
- `RoutingState` — route history, planning waypoint slots, route parameters
|
|
291
342
|
- `RangeState` — reachable-range entries
|
|
292
|
-
- `CustomGeometriesState` — derived polygon entries produced by `
|
|
343
|
+
- `CustomGeometriesState` — derived polygon entries produced by `processData` (union, difference, h3-coverage, …)
|
|
344
|
+
- `BYODState` — bring-your-own-data GeoJSON layer entries
|
|
293
345
|
- `BaseMapState` — viewport, style, language, raw `mapLibreMap`
|
|
294
346
|
- `TrafficTilesState` — real-time traffic flow + incident tile-overlay visibility
|
|
295
|
-
- `TrafficAreaAnalyticsState` —
|
|
296
|
-
- `TrafficIncidentsState` — fetched incident entries,
|
|
347
|
+
- `TrafficAreaAnalyticsState` — historical traffic-area-analytics entries and per-entry visualisation
|
|
348
|
+
- `TrafficIncidentsState` — fetched incident entries, registered analyses, focused subsets, and the optional polling monitor
|
|
297
349
|
- `MapPOIsState` — POI category visibility and filters
|
|
298
350
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
```typescript
|
|
302
|
-
import { createToolState, type ToolState } from '@tomtom-org/maps-sdk-plugin-agent-toolkit';
|
|
303
|
-
|
|
304
|
-
// Base state
|
|
305
|
-
const state = createToolState(map);
|
|
306
|
-
|
|
307
|
-
// With custom slices
|
|
308
|
-
const state = createToolState(map, {
|
|
309
|
-
fleet: new FleetState(),
|
|
310
|
-
weather: new WeatherCache(),
|
|
311
|
-
});
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
Custom slices are merged alongside built-in state. When using `createMapAgent`, define an interface extending `ToolState` and pass the type parameter — only custom slices need to be provided:
|
|
351
|
+
Built-in slices are constructed automatically by `createMapAgent`. To add custom slices, define an interface extending `ToolState` and pass the type parameter — only the custom fields need to be provided:
|
|
315
352
|
|
|
316
353
|
```typescript
|
|
317
354
|
interface MyState extends ToolState {
|
|
@@ -324,12 +361,12 @@ const agent = createMapAgent<MyState>(map, {
|
|
|
324
361
|
});
|
|
325
362
|
|
|
326
363
|
agent.state.fleet; // FleetState — custom slice
|
|
327
|
-
agent.state.places; //
|
|
364
|
+
agent.state.places; // PlacesState — append-only history of place entries
|
|
328
365
|
```
|
|
329
366
|
|
|
330
367
|
## Intent classifier
|
|
331
368
|
|
|
332
|
-
The intent classifier is an optional per-turn optimization that selects which tools the LLM sees, reducing noise and improving accuracy.
|
|
369
|
+
The intent classifier is an optional per-turn optimization that selects which tools the LLM sees, reducing noise and improving accuracy. See the [How it works](https://docs.tomtom.com/maps-sdk-js/guides/plugins/agent-toolkit/how-it-works) guide for the full two-phase pipeline (classification → tool loop), prompt assembly, and observability hooks.
|
|
333
370
|
|
|
334
371
|
```typescript
|
|
335
372
|
import { createMapAgent, createDefaultClassifier } from '@tomtom-org/maps-sdk-plugin-agent-toolkit';
|
|
@@ -374,38 +411,6 @@ const agent = createMapAgent(map, {
|
|
|
374
411
|
|
|
375
412
|
## Advanced usage
|
|
376
413
|
|
|
377
|
-
### Manual agent setup
|
|
378
|
-
|
|
379
|
-
Bypass `createMapAgent` for maximum control:
|
|
380
|
-
|
|
381
|
-
```typescript
|
|
382
|
-
import { ToolLoopAgent, stepCountIs, tool } from 'ai';
|
|
383
|
-
import { createToolState, DEFAULT_TOOLS, BASE_SYSTEM_PROMPT } from '@tomtom-org/maps-sdk-plugin-agent-toolkit';
|
|
384
|
-
|
|
385
|
-
const state = createToolState(map);
|
|
386
|
-
const { help, ...toolEntries } = DEFAULT_TOOLS; // customize as needed
|
|
387
|
-
|
|
388
|
-
// Convert ToolEntry records to AI SDK tools (bind state)
|
|
389
|
-
const tools = Object.fromEntries(
|
|
390
|
-
Object.entries(toolEntries).map(([name, entry]) => [
|
|
391
|
-
name,
|
|
392
|
-
tool({
|
|
393
|
-
description: entry.description,
|
|
394
|
-
inputSchema: entry.inputSchema,
|
|
395
|
-
outputSchema: entry.outputSchema,
|
|
396
|
-
execute: async (input) => entry.execute(input, state),
|
|
397
|
-
}),
|
|
398
|
-
]),
|
|
399
|
-
);
|
|
400
|
-
|
|
401
|
-
const agent = new ToolLoopAgent({
|
|
402
|
-
model: openai('gpt-4o'),
|
|
403
|
-
tools,
|
|
404
|
-
instructions: BASE_SYSTEM_PROMPT + '\n\nCustom instructions...',
|
|
405
|
-
stopWhen: stepCountIs(15),
|
|
406
|
-
});
|
|
407
|
-
```
|
|
408
|
-
|
|
409
414
|
### Wrapping default tools
|
|
410
415
|
|
|
411
416
|
Add logging, analytics, or custom behavior around existing tools:
|
|
@@ -439,7 +444,6 @@ const agent = createMapAgent(map, {
|
|
|
439
444
|
removeWaypointsFromRoute: false,
|
|
440
445
|
replaceWaypointInRoute: false,
|
|
441
446
|
updateRoutesDisplay: false,
|
|
442
|
-
searchAlongRoute: false,
|
|
443
447
|
},
|
|
444
448
|
});
|
|
445
449
|
```
|
|
@@ -454,7 +458,7 @@ const agent = createMapAgent(map, {
|
|
|
454
458
|
setLanguage: false,
|
|
455
459
|
setLayoutProperties: false,
|
|
456
460
|
setPaintProperties: false,
|
|
457
|
-
|
|
461
|
+
toggleTilesBaseMapLayerGroups: false,
|
|
458
462
|
},
|
|
459
463
|
});
|
|
460
464
|
```
|
|
@@ -474,39 +478,75 @@ agent.destroy(); // Reset all state slices (call on unmount)
|
|
|
474
478
|
|
|
475
479
|
```typescript
|
|
476
480
|
// Main factory
|
|
477
|
-
export { createMapAgent } from '
|
|
481
|
+
export { createMapAgent } from '@tomtom-org/maps-sdk-plugin-agent-toolkit';
|
|
478
482
|
|
|
479
|
-
//
|
|
480
|
-
export {
|
|
483
|
+
// Tool registry and composition
|
|
484
|
+
export {
|
|
485
|
+
DEFAULT_TOOLS,
|
|
486
|
+
getDefaultToolPrompts,
|
|
487
|
+
resolveTools,
|
|
488
|
+
TOOL_NAMES,
|
|
489
|
+
type ToolName,
|
|
490
|
+
} from '@tomtom-org/maps-sdk-plugin-agent-toolkit';
|
|
481
491
|
|
|
482
492
|
// System prompt
|
|
483
|
-
export { BASE_SYSTEM_PROMPT
|
|
493
|
+
export { BASE_SYSTEM_PROMPT } from '@tomtom-org/maps-sdk-plugin-agent-toolkit';
|
|
484
494
|
|
|
485
|
-
//
|
|
486
|
-
export {
|
|
495
|
+
// Data-entry & entry-mode introspection
|
|
496
|
+
export {
|
|
497
|
+
DATA_ENTRY_KIND_TO_SLICE,
|
|
498
|
+
ENTRY_MODE_SLICE_NAMES,
|
|
499
|
+
TOOLS_BY_DATA_ENTRY_KIND,
|
|
500
|
+
type DataEntryConfig,
|
|
501
|
+
type DataEntryKind,
|
|
502
|
+
type EntryDataKind,
|
|
503
|
+
type EntryMode,
|
|
504
|
+
type EntryModeSlice,
|
|
505
|
+
type EntryModeSliceName,
|
|
506
|
+
} from '@tomtom-org/maps-sdk-plugin-agent-toolkit';
|
|
507
|
+
|
|
508
|
+
// Geometries id schema (tagged `{ kind, id }` accepted by analyseData/processData)
|
|
509
|
+
export {
|
|
510
|
+
geometriesIdSchema,
|
|
511
|
+
type GeometriesId,
|
|
512
|
+
type GeometriesIdKind,
|
|
513
|
+
} from '@tomtom-org/maps-sdk-plugin-agent-toolkit';
|
|
487
514
|
|
|
488
|
-
//
|
|
489
|
-
export {
|
|
515
|
+
// State digest (for dev panels / debug UIs)
|
|
516
|
+
export {
|
|
517
|
+
formatStateDigestDiff,
|
|
518
|
+
getStateDigest,
|
|
519
|
+
type StateDigest,
|
|
520
|
+
} from '@tomtom-org/maps-sdk-plugin-agent-toolkit';
|
|
490
521
|
|
|
491
522
|
// Classifier
|
|
492
523
|
export {
|
|
493
|
-
type ClassificationResult,
|
|
494
524
|
classifyUserIntent,
|
|
495
525
|
createDefaultClassifier,
|
|
496
526
|
extractLastUserText,
|
|
497
|
-
|
|
527
|
+
type ClassificationResult,
|
|
528
|
+
type Classifier,
|
|
529
|
+
type ClassifierContext,
|
|
530
|
+
type ClassifierOptions,
|
|
531
|
+
} from '@tomtom-org/maps-sdk-plugin-agent-toolkit';
|
|
498
532
|
|
|
499
|
-
//
|
|
533
|
+
// Traffic-incidents monitor types
|
|
500
534
|
export type {
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
535
|
+
IncidentSnapshot,
|
|
536
|
+
MonitoredArea,
|
|
537
|
+
PollingStatus,
|
|
538
|
+
} from '@tomtom-org/maps-sdk-plugin-agent-toolkit';
|
|
539
|
+
|
|
540
|
+
// Core types — `StateSlice`, `ToolState`, `MapAgentOptions`, `MapAgentInstance`,
|
|
541
|
+
// `ToolEntry`, `ToolEntryBuilder`, `ToolDefinition`, `ToolBuildOptions`,
|
|
542
|
+
// `ToolMetadata`, `ToolName`, `ToolNameHint`, `FeatureFlags`, entry/analysis
|
|
543
|
+
// types (`PlacesEntry`, `PlacesAnalysis`, `RoutesEntry`, `RoutesAnalysis`,
|
|
544
|
+
// `BYODEntry`, `BYODSource`, `CustomGeometriesEntry`, `CustomGeometriesAnalysis`,
|
|
545
|
+
// `GeometryProvenance`, `RangesEntry`, `ReachableRange`, `RouteParams`,
|
|
546
|
+
// `TrafficAreaAnalyticsEntry`, `TrafficAreaAnalyticsAnalysis`,
|
|
547
|
+
// `TrafficAreaAnalyticsParams`, `TrafficIncidentsEntry`, `IncidentsAnalysis`),
|
|
548
|
+
// and more.
|
|
549
|
+
export type * from '@tomtom-org/maps-sdk-plugin-agent-toolkit';
|
|
510
550
|
```
|
|
511
551
|
|
|
512
552
|
## Dependencies
|
|
@@ -529,6 +569,14 @@ export type {
|
|
|
529
569
|
|
|
530
570
|
## References
|
|
531
571
|
|
|
572
|
+
- [Agent Toolkit guides](https://docs.tomtom.com/maps-sdk-js/guides/plugins/agent-toolkit/overview) — full documentation set:
|
|
573
|
+
- [How it works](https://docs.tomtom.com/maps-sdk-js/guides/plugins/agent-toolkit/how-it-works) — two-phase pipeline (classifier + tool loop), prompt assembly, observability
|
|
574
|
+
- [Tools](https://docs.tomtom.com/maps-sdk-js/guides/plugins/agent-toolkit/tools) — per-tool reference
|
|
575
|
+
- [State](https://docs.tomtom.com/maps-sdk-js/guides/plugins/agent-toolkit/state) — per-slice reference, entry modes, custom slices
|
|
576
|
+
- [Customizing tools](https://docs.tomtom.com/maps-sdk-js/guides/plugins/agent-toolkit/customizing-tools) — add, replace, remove, or start from a blank slate
|
|
577
|
+
- [Code generation](https://docs.tomtom.com/maps-sdk-js/guides/plugins/agent-toolkit/code-generation) — `analyseData` / `processData` / `executeMaplibreCode` (threat model included)
|
|
578
|
+
- [Scope-aware data tools](https://docs.tomtom.com/maps-sdk-js/guides/plugins/agent-toolkit/scope-aware-data-tools) — per-turn scope mechanism
|
|
579
|
+
- [Bring your own data](https://docs.tomtom.com/maps-sdk-js/guides/plugins/agent-toolkit/byod) — ingest customer GeoJSON layers
|
|
532
580
|
- [AI SDK v6 documentation](https://ai-sdk.dev/)
|
|
533
581
|
- [TomTom Maps SDK documentation](https://developer.tomtom.com/)
|
|
534
582
|
- [Engineering guidelines](./ENGINEERING-GUIDELINES.md) — tool design standards, state management, system prompt structure
|