@tomtom-org/maps-sdk-plugin-agent-toolkit 0.2.4 → 0.2.6
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 +28 -13
- package/dist/index.d.ts +1411 -150
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/package.json +17 -11
package/README.md
CHANGED
|
@@ -74,7 +74,7 @@ See [`examples/map-chat-agent`](../../examples/map-chat-agent) for a full workin
|
|
|
74
74
|
|
|
75
75
|
## Tools reference
|
|
76
76
|
|
|
77
|
-
The plugin ships
|
|
77
|
+
The plugin ships 52 tools organized into five categories. All tools are included by default and can be individually removed or replaced via the [`tools` option](#composing-tool-sets).
|
|
78
78
|
|
|
79
79
|
### Service tools — fetch data from TomTom APIs
|
|
80
80
|
|
|
@@ -83,12 +83,16 @@ The plugin ships 53 tools organized into five categories. All tools are included
|
|
|
83
83
|
| `locatePlace` | Resolve a location string (landmark, city, address) to a place; optionally stage as a waypoint |
|
|
84
84
|
| `reverseGeocode` | Convert `[longitude, latitude]` coordinates to an address |
|
|
85
85
|
| `discoverPlaces` | Search for places by text query or POI category within an area |
|
|
86
|
-
| `
|
|
87
|
-
| `
|
|
88
|
-
| `
|
|
89
|
-
| `
|
|
86
|
+
| `setRoute` | Calculate or recalculate a route — provide `locations` (waypoints), `parameters` (route options), or both |
|
|
87
|
+
| `addWaypointsToRoute` | Extend the current route — prepend a new origin, append a new destination, and/or insert intermediate stops |
|
|
88
|
+
| `removeWaypointsFromRoute` | Remove one or more waypoints by index from the current route |
|
|
89
|
+
| `replaceWaypointInRoute` | Overwrite a single waypoint of the current route in place — origin, destination, or by index |
|
|
90
90
|
| `getPOICategoryCodes` | Look up TomTom POI category codes from natural-language names |
|
|
91
|
-
| `getTrafficIncidents` | Fetch traffic incidents by bounding box or IDs |
|
|
91
|
+
| `getTrafficIncidents` | Fetch traffic incidents by bounding box or IDs (one-shot) |
|
|
92
|
+
| `startTrafficIncidentsMonitor` | Start the live incident monitor — pairs with `getTrafficIncidents`, refreshes incident state on a configurable cadence so subsequent reads stay fresh |
|
|
93
|
+
| `stopTrafficIncidentsMonitor` | Stop the live incident monitor |
|
|
94
|
+
| `analyseIncidents` | Aggregate / count / chart incidents already in state via dynamic JS (categories, top delays, clusters, …) |
|
|
95
|
+
| `focusIncidents` | Highlight a subset of incidents (by id / category / severity) on the map and dim the rest |
|
|
92
96
|
| `getTrafficAreaAnalytics` | Fetch historical traffic analytics (speed, congestion, travel time) for an area |
|
|
93
97
|
| `queryTrafficAnalytics` | Query cached analytics data or check what is currently displayed |
|
|
94
98
|
| `searchAlongRoute` | Search for POIs along a calculated route, ranked by detour cost |
|
|
@@ -139,6 +143,7 @@ The plugin ships 53 tools organized into five categories. All tools are included
|
|
|
139
143
|
| `recallPlaces` | Retrieve the history of place lookups from this session |
|
|
140
144
|
| `recallRoutes` | Retrieve previously calculated routes from this session |
|
|
141
145
|
| `recallRanges` | Retrieve stored reachable range results |
|
|
146
|
+
| `recallGeometries` | List/inspect every polygon source in state (place footprints, isochrones, custom-geometries) — call before passing IDs to `processGeometries` / `analyseGeometries` |
|
|
142
147
|
| `getCurrentWaypoints` | Get the staged waypoint slots (origin, stops, destination) |
|
|
143
148
|
|
|
144
149
|
### Utility tools — pure computation helpers
|
|
@@ -279,7 +284,17 @@ type ToolEntry<S extends ToolState = ToolState> = {
|
|
|
279
284
|
|
|
280
285
|
## State management
|
|
281
286
|
|
|
282
|
-
`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:
|
|
287
|
+
`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
|
+
|
|
289
|
+
- `PlacesState` — place / geometry entry history
|
|
290
|
+
- `RoutingState` — route history, planning waypoint slots, route parameters
|
|
291
|
+
- `RangeState` — reachable-range entries
|
|
292
|
+
- `CustomGeometriesState` — derived polygon entries produced by `processGeometries` (union, difference, h3-coverage, …)
|
|
293
|
+
- `BaseMapState` — viewport, style, language, raw `mapLibreMap`
|
|
294
|
+
- `TrafficTilesState` — real-time traffic flow + incident tile-overlay visibility
|
|
295
|
+
- `TrafficAreaAnalyticsState` — cached traffic-area-analytics result + current visualisation config
|
|
296
|
+
- `TrafficIncidentsState` — fetched incident entries, per-entry analyses, focused subsets, and the live `IncidentsMonitor`
|
|
297
|
+
- `MapPOIsState` — POI category visibility and filters
|
|
283
298
|
|
|
284
299
|
Create state manually for advanced scenarios:
|
|
285
300
|
|
|
@@ -309,7 +324,7 @@ const agent = createMapAgent<MyState>(map, {
|
|
|
309
324
|
});
|
|
310
325
|
|
|
311
326
|
agent.state.fleet; // FleetState — custom slice
|
|
312
|
-
agent.state.places; //
|
|
327
|
+
agent.state.places; // PlacesStates — registry of named place-display buckets
|
|
313
328
|
```
|
|
314
329
|
|
|
315
330
|
## Intent classifier
|
|
@@ -419,11 +434,11 @@ createMapAgent(map, { model, tools: { discoverPlaces: wrappedDiscover } });
|
|
|
419
434
|
const agent = createMapAgent(map, {
|
|
420
435
|
model,
|
|
421
436
|
tools: {
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
437
|
+
setRoute: false,
|
|
438
|
+
addWaypointsToRoute: false,
|
|
439
|
+
removeWaypointsFromRoute: false,
|
|
440
|
+
replaceWaypointInRoute: false,
|
|
441
|
+
updateRoutesDisplay: false,
|
|
427
442
|
searchAlongRoute: false,
|
|
428
443
|
},
|
|
429
444
|
});
|