@tomtom-org/maps-sdk-plugin-agent-toolkit 0.10.1 → 0.12.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.
- package/README.md +23 -20
- package/THIRD_PARTY.txt +1 -1
- package/dist/THIRD_PARTY.txt +1 -1
- package/dist/index.d.ts +80 -33
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/third-party.json +1 -1
- package/dist/{worker-libs-Cn3Jhheb.js → worker-libs-DWDQlHOr.js} +2 -2
- package/dist/{worker-libs-Cn3Jhheb.js.map → worker-libs-DWDQlHOr.js.map} +1 -1
- package/package.json +11 -12
package/README.md
CHANGED
|
@@ -57,8 +57,8 @@ console.log(result.text);
|
|
|
57
57
|
|
|
58
58
|
### With React (`useChat`)
|
|
59
59
|
|
|
60
|
-
```
|
|
61
|
-
import { DirectChatTransport } from 'ai';
|
|
60
|
+
```tsx
|
|
61
|
+
import { DirectChatTransport, isTextUIPart } from 'ai';
|
|
62
62
|
import { useChat } from '@ai-sdk/react';
|
|
63
63
|
|
|
64
64
|
const agent = createMapAgent(map, { model: openai('gpt-4o') });
|
|
@@ -70,10 +70,10 @@ function ChatPanel() {
|
|
|
70
70
|
|
|
71
71
|
return (
|
|
72
72
|
<div>
|
|
73
|
-
{messages.map((
|
|
74
|
-
<div key={
|
|
73
|
+
{messages.map((message) => (
|
|
74
|
+
<div key={message.id}>{message.parts.filter(isTextUIPart).map((part) => part.text).join('')}</div>
|
|
75
75
|
))}
|
|
76
|
-
<input onKeyDown={(
|
|
76
|
+
<input onKeyDown={(event) => event.key === 'Enter' && sendMessage({ text: event.currentTarget.value })} />
|
|
77
77
|
</div>
|
|
78
78
|
);
|
|
79
79
|
}
|
|
@@ -105,29 +105,37 @@ The plugin ships a `DEFAULT_TOOLS` registry covering search, routing, traffic, r
|
|
|
105
105
|
| `removeWaypointsFromRoute` | Remove one or more waypoints by index from the current route |
|
|
106
106
|
| `replaceWaypointInRoute` | Overwrite a single waypoint of the current route in place — origin, destination, or by index |
|
|
107
107
|
| `getCurrentWaypoints` | Get the staged waypoint slots (origin, stops, destination) |
|
|
108
|
+
| `startRouteMonitor` | Recalculate an already-calculated route on a cadence (default 60 s) so its live-traffic delays stay current |
|
|
109
|
+
| `stopRouteMonitor` | Stop recalculating a route; the entry keeps its last data |
|
|
108
110
|
| `findReachableAreas` | Calculate isochrone/isodistance polygons from one or more origins (private preview: the API key needs Calculate Reachable Range access) |
|
|
109
111
|
|
|
110
112
|
### Traffic
|
|
111
113
|
|
|
112
114
|
| Tool | Description |
|
|
113
115
|
|---|---|
|
|
114
|
-
| `getTrafficIncidents` | Fetch traffic incidents within an area (viewport, named place, route corridor, polygon, IDs) |
|
|
115
|
-
| `
|
|
116
|
-
| `
|
|
116
|
+
| `getTrafficIncidents` | Fetch traffic incidents within an area (viewport, named place, route corridor, polygon, IDs); the entry keeps refreshing by default |
|
|
117
|
+
| `setTrafficIncidentsMonitor` | Turn background refreshing of an already-loaded incidents entry on or off |
|
|
118
|
+
| `clusterIncidents` | Group loaded incidents into hotspots (DBSCAN) with road and category labels, delay totals and trends |
|
|
117
119
|
| `focusIncidents` | Highlight a subset of incidents (by id / category / severity) on the map and dim the rest |
|
|
118
120
|
| `getTrafficAreaAnalytics` | Fetch historical traffic analytics (speed, congestion, travel time) for an area |
|
|
119
|
-
| `queryTrafficAnalytics` | Query cached analytics data or check what is currently displayed |
|
|
120
121
|
| `toggleTilesTrafficFlow` | Toggle the real-time traffic-flow tile overlay |
|
|
121
122
|
| `toggleTilesTrafficIncidents` | Toggle the real-time traffic-incidents tile overlay |
|
|
122
|
-
| `setMapStyling` | Set or reset
|
|
123
|
-
|
|
123
|
+
| `setMapStyling` | Set or reset how the map looks — label/icon/road sizes, exit numbers and road arrows, POI and hillshade looks, congestion colours, map colours, map presets, or a whole theme from a few colours or an image |
|
|
124
|
+
|
|
125
|
+
### Trackers
|
|
126
|
+
|
|
127
|
+
| Tool | Description |
|
|
128
|
+
|---|---|
|
|
129
|
+
| `createTracker` | Watch loaded entries with generated code and log an alert when its condition turns true (e.g. an incident near a hospital) |
|
|
130
|
+
| `getTrackers` | List the active trackers and whether each is firing |
|
|
131
|
+
| `getTrackerHistory` | Read the alerts and events trackers have logged, for one tracker or since a time |
|
|
132
|
+
| `clearTracker` | Stop a tracker; the entries it watched stay |
|
|
124
133
|
|
|
125
134
|
### Bring-your-own-data (BYOD)
|
|
126
135
|
|
|
127
136
|
| Tool | Description |
|
|
128
137
|
|---|---|
|
|
129
138
|
| `addByodSource` | Ingest a customer-authored GeoJSON source (URL or inline `FeatureCollection`) and profile its shape; the entry has no layers and renders nothing until the agent sets them via `setByodLayers` |
|
|
130
|
-
| `recallByod` | List BYOD entries, or retrieve a single entry's full `FeatureCollection` by id |
|
|
131
139
|
| `setByodLayers` | Restyle a BYOD entry — replace its MapLibre layers (type + data-driven paint) using the entry's data `profile` |
|
|
132
140
|
| `updateByodDisplay` | Show, hide, or clear BYOD layers on the map |
|
|
133
141
|
|
|
@@ -139,6 +147,7 @@ The plugin ships a `DEFAULT_TOOLS` registry covering search, routing, traffic, r
|
|
|
139
147
|
|---|---|
|
|
140
148
|
| `analyseData` | Aggregate / chart entries (`places`, `routes`, `incidents`, `geometries`, `trafficAreaAnalytics`, `byod`) via dynamic JS; classifier-emitted scope narrows the schema per turn |
|
|
141
149
|
| `processData` | Transform entries into new `places`, `placeConnections`, `geometries`, `byod`, or a `fitOnMap` camera move via dynamic JS |
|
|
150
|
+
| `monitorAnalysis` | Start or stop recomputing an `analyseData` analysis whenever its source entries change |
|
|
142
151
|
| `executeMaplibreCode` | Execute arbitrary MapLibre JS against the live `Map` instance — escape hatch for custom layers, animations, raster overlays |
|
|
143
152
|
|
|
144
153
|
> 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, 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.
|
|
@@ -188,12 +197,7 @@ const agent = createMapAgent(map, {
|
|
|
188
197
|
|
|
189
198
|
| Tool | Description |
|
|
190
199
|
|---|---|
|
|
191
|
-
| `
|
|
192
|
-
| `recallRoutes` | Retrieve previously calculated routes from this session |
|
|
193
|
-
| `recallRanges` | Retrieve stored reachable-range results |
|
|
194
|
-
| `recallGeometries` | Look up polygon sources by `{ kind, id }` across place footprints, isochrones, and `customGeometries` entries |
|
|
195
|
-
| `recallByod` | Retrieve BYOD entries (see [BYOD](#bring-your-own-data-byod)) |
|
|
196
|
-
| `recallState` | Summarize the current contents of every state slice |
|
|
200
|
+
| `recallState` | Read session state: a snapshot of every slice, one kind's entries (`places`, `routes`, `ranges`, `geometries`, `byod`, …), or one entry by `{ kind, id }` |
|
|
197
201
|
| `setEntryMode` | Switch a slice between `multiple` (default) and `single` entry modes |
|
|
198
202
|
| `resetState` | Reset one or all state slices |
|
|
199
203
|
|
|
@@ -202,8 +206,7 @@ const agent = createMapAgent(map, {
|
|
|
202
206
|
| Tool | Description |
|
|
203
207
|
|---|---|
|
|
204
208
|
| `calculateBBox` | Compute a bounding box from GeoJSON features or tool results |
|
|
205
|
-
| `
|
|
206
|
-
| `formatDuration` | Format seconds into a human-readable string (e.g. "1 h 30 min") |
|
|
209
|
+
| `clarifyIntent` | Ask the user to resolve a genuinely ambiguous or missing input, as a few numbered choices plus a free answer |
|
|
207
210
|
| `help` | List available capabilities in summary or searchable detail mode |
|
|
208
211
|
|
|
209
212
|
## Customization
|
package/THIRD_PARTY.txt
CHANGED
|
@@ -49,7 +49,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
49
49
|
---
|
|
50
50
|
|
|
51
51
|
Name: ai
|
|
52
|
-
Version: 6.0.
|
|
52
|
+
Version: 6.0.300
|
|
53
53
|
License: Apache-2.0
|
|
54
54
|
Bundled: false (peer dependency)
|
|
55
55
|
Description: AI SDK by Vercel - build apps like ChatGPT, Claude, Gemini, and more with a single interface for any model using the Vercel AI Gateway or go direct to OpenAI, Anthropic, Google, or any other model provider.
|
package/dist/THIRD_PARTY.txt
CHANGED
|
@@ -39,7 +39,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
39
39
|
---
|
|
40
40
|
|
|
41
41
|
Name: ai
|
|
42
|
-
Version: 6.0.
|
|
42
|
+
Version: 6.0.300
|
|
43
43
|
License: Apache-2.0
|
|
44
44
|
Bundled: false (peer dependency)
|
|
45
45
|
Description: AI SDK by Vercel - build apps like ChatGPT, Claude, Gemini, and more with a single interface for any model using the Vercel AI Gateway or go direct to OpenAI, Anthropic, Google, or any other model provider.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BaseMapModule, CustomGeoJSONLayerSpec, CustomGeoJSONModule, GeometriesModule, GeometryFillStyle, POIsModule, PlaceConnectionDisplay, PlacesModule, PlanningWaypoint, RoutingModule,
|
|
2
|
-
import { BBox, CommonPlaceProps, GeographyType, Place, Places, PolygonFeature, PolygonFeatures, Route, Routes, TrafficAreaAnalytics, TrafficIncident, WaypointLike } from "@tomtom-org/maps-sdk/core";
|
|
1
|
+
import { BaseMapModule, CustomGeoJSONLayerSpec, CustomGeoJSONModule, GeometriesModule, GeometryFillStyle, POIsModule, PlaceConnectionDisplay, PlacesModule, PlanningWaypoint, ReachableRangesModule, RoutingModule, StylingFoundationsModule, TerrainModule, TomTomMap, TrafficAreaAnalyticsModule, TrafficAreaAnalyticsModuleConfig, TrafficFlowModule, TrafficIncidentDetailsModule, TrafficIncidentsModule } from "@tomtom-org/maps-sdk/map";
|
|
2
|
+
import { BBox, CommonPlaceProps, GeographyType, Place, Places, PolygonFeature, PolygonFeatures, ReachableRangeBudget, Route, Routes, TrafficAreaAnalytics, TrafficIncident, WaypointLike } from "@tomtom-org/maps-sdk/core";
|
|
3
3
|
import { ChartConfiguration } from "chart.js";
|
|
4
4
|
import { Map as Map$1 } from "maplibre-gl";
|
|
5
5
|
import { z } from "zod";
|
|
6
|
-
import { GeoBias,
|
|
6
|
+
import { GeoBias, TrafficIncidentDetailsByBBoxParams } from "@tomtom-org/maps-sdk/services";
|
|
7
7
|
import { LanguageModel, ModelMessage, PrepareStepFunction, ToolLoopAgent } from "ai";
|
|
8
8
|
//#region src/engine/engine.d.ts
|
|
9
9
|
/** What {@link JobEngine.register} needs to mint a {@link Job}. `run` and `onOrphaned` are owner closures. */
|
|
@@ -701,18 +701,21 @@ type BYODEntry = BaseEntry<FeatureCollection$1> & {
|
|
|
701
701
|
* State for base map display: style, language, viewport and layers.
|
|
702
702
|
*
|
|
703
703
|
* Provides direct access to the TomTomMap and MapLibre instances alongside
|
|
704
|
-
* lazy-initialized BaseMapModule and
|
|
704
|
+
* lazy-initialized BaseMapModule, StylingFoundationsModule and TerrainModule.
|
|
705
705
|
*
|
|
706
706
|
* @group Agent Toolkit
|
|
707
707
|
*/
|
|
708
708
|
declare class BaseMapState implements StateSlice {
|
|
709
709
|
readonly ttMap: TomTomMap;
|
|
710
710
|
private _baseMapModule?;
|
|
711
|
-
private
|
|
711
|
+
private _stylingFoundationsModule?;
|
|
712
|
+
private _terrainModule?;
|
|
712
713
|
constructor(ttMap: TomTomMap);
|
|
713
714
|
get mapLibreMap(): Map$1;
|
|
714
715
|
getBaseMapModule(): Promise<BaseMapModule>;
|
|
715
|
-
|
|
716
|
+
getStylingFoundationsModule(): Promise<StylingFoundationsModule>;
|
|
717
|
+
getTerrainModule(): Promise<TerrainModule>;
|
|
718
|
+
get terrainModule(): TerrainModule | undefined;
|
|
716
719
|
reset(): void;
|
|
717
720
|
}
|
|
718
721
|
//#endregion
|
|
@@ -1177,7 +1180,7 @@ type PlacesStateEvents = {
|
|
|
1177
1180
|
* State for the places layer: an append-only history of place results plus per-entry display
|
|
1178
1181
|
* modules.
|
|
1179
1182
|
*
|
|
1180
|
-
* Each entry owns a single PlacesModule (switched in place via `
|
|
1183
|
+
* Each entry owns a single PlacesModule (switched in place via `updateConfig` when the marker
|
|
1181
1184
|
* type changes — an entry only renders under one marker type at a time) and a dedicated
|
|
1182
1185
|
* GeometriesModule, lazy-initialised on first show. Display state lives on the entry, so two
|
|
1183
1186
|
* entries can be rendered side by side under different marker types without sharing a single source.
|
|
@@ -1206,7 +1209,7 @@ declare class PlacesState implements StateSlice {
|
|
|
1206
1209
|
/**
|
|
1207
1210
|
* Lazy-init and return the entry's PlacesModule, switched to `markerType`. An entry only
|
|
1208
1211
|
* ever renders under one marker type at a time, so the same module is reused — flipping marker
|
|
1209
|
-
* types calls `
|
|
1212
|
+
* types calls `updateConfig` in place. Throws when the entry id is unknown.
|
|
1210
1213
|
*/
|
|
1211
1214
|
getEntryPlacesModule(entryId: string, markerType: PlacesMarkerType): Promise<PlacesModule>;
|
|
1212
1215
|
/**
|
|
@@ -1335,7 +1338,7 @@ type PlacesEntry = BaseEntry<Place[]> & {
|
|
|
1335
1338
|
_geometryByPlaceId?: Record<string, PolygonFeature<CommonPlaceProps>>;
|
|
1336
1339
|
/**
|
|
1337
1340
|
* Per-entry display modules. An entry is rendered under at most one marker type at a time,
|
|
1338
|
-
* so a single PlacesModule covers all of them — `_showEntryAs` switches it via `
|
|
1341
|
+
* so a single PlacesModule covers all of them — `_showEntryAs` switches it via `updateConfig({ markerType })`.
|
|
1339
1342
|
* A dedicated GeometriesModule renders the entry's boundary polygons.
|
|
1340
1343
|
* Lazy-initialised via PlacesState helpers — undefined until first show.
|
|
1341
1344
|
*/
|
|
@@ -1377,17 +1380,17 @@ type ReachableRange = {
|
|
|
1377
1380
|
*/
|
|
1378
1381
|
type RangesEntry = BaseEntry<ReachableRange[]> & {
|
|
1379
1382
|
/**
|
|
1380
|
-
* Per-entry display modules. Each entry owns a dedicated
|
|
1381
|
-
* isochrone polygons
|
|
1383
|
+
* Per-entry display modules. Each entry owns a dedicated ReachableRangesModule (for the
|
|
1384
|
+
* isochrone polygons, and their fill style), a GeometriesModule (for the same polygons in a
|
|
1385
|
+
* consumer's own style) and a PlacesModule (for the origin pin(s)), so display state lives
|
|
1382
1386
|
* on the entry instead of a shared slice-level module. Lazy-initialised via RangeState
|
|
1383
1387
|
* helpers — undefined until first show.
|
|
1384
1388
|
*/
|
|
1385
1389
|
_modules?: {
|
|
1390
|
+
ranges?: ReachableRangesModule;
|
|
1386
1391
|
geometries?: GeometriesModule;
|
|
1387
1392
|
places?: PlacesModule;
|
|
1388
1393
|
};
|
|
1389
|
-
/** Fill style that the geometries module is currently configured with. */
|
|
1390
|
-
_shownFillStyle?: GeometryFillStyle;
|
|
1391
1394
|
/** True while any of this entry's modules are rendering on the map. */
|
|
1392
1395
|
_shown?: boolean;
|
|
1393
1396
|
};
|
|
@@ -1418,7 +1421,7 @@ type RangeStateEvents = {
|
|
|
1418
1421
|
*
|
|
1419
1422
|
* Stores semantic summaries of calculated ranges (origin, budgets).
|
|
1420
1423
|
* Also retains raw polygon geometry internally for use in geometry searches
|
|
1421
|
-
* (e.g. discoverPlaces withinRange). Displayed on the map via
|
|
1424
|
+
* (e.g. discoverPlaces withinRange). Displayed on the map via ReachableRangesModule.
|
|
1422
1425
|
*
|
|
1423
1426
|
* @group Agent Toolkit
|
|
1424
1427
|
*/
|
|
@@ -1444,9 +1447,16 @@ declare class RangeState implements ShownEntriesSlice {
|
|
|
1444
1447
|
*/
|
|
1445
1448
|
setEntryMode(mode: EntryMode): Promise<void>;
|
|
1446
1449
|
/**
|
|
1447
|
-
* Lazy-init the entry's
|
|
1450
|
+
* Lazy-init the entry's ReachableRangesModule (for the isochrone/isodistance polygons),
|
|
1448
1451
|
* applying the requested fill style. Throws on unknown id.
|
|
1449
1452
|
*/
|
|
1453
|
+
getEntryRangesModule(entryId: string, fillStyle?: GeometryFillStyle): Promise<ReachableRangesModule>;
|
|
1454
|
+
/**
|
|
1455
|
+
* Lazy-init the entry's plain GeometriesModule, for drawing the entry's polygons in a style of
|
|
1456
|
+
* your own (per-feature colours, border widths) rather than as reachable-range bands.
|
|
1457
|
+
* Updates only the fill style when it changes, keeping the styling applied since. Throws on
|
|
1458
|
+
* unknown id.
|
|
1459
|
+
*/
|
|
1450
1460
|
getEntryGeometriesModule(entryId: string, fillStyle?: GeometryFillStyle): Promise<GeometriesModule>;
|
|
1451
1461
|
/**
|
|
1452
1462
|
* Lazy-init the entry's origin-pin PlacesModule. Each entry maintains its own pin module
|
|
@@ -1466,7 +1476,7 @@ declare class RangeState implements ShownEntriesSlice {
|
|
|
1466
1476
|
/** Hide every module on the entry (clear). No-op when the entry is unknown. */
|
|
1467
1477
|
hideEntry(entryId: string): Promise<void>;
|
|
1468
1478
|
/**
|
|
1469
|
-
* Drop a single entry from history. Hides it from the map first (clears its
|
|
1479
|
+
* Drop a single entry from history. Hides it from the map first (clears its ranges +
|
|
1470
1480
|
* origin-pin modules) then removes it from `_entries`. Emits `entries-change`. No-op when
|
|
1471
1481
|
* the id is unknown.
|
|
1472
1482
|
*/
|
|
@@ -2292,7 +2302,7 @@ type TrafficIncidentsEntry = BaseEntry<TrafficIncident[]> & {
|
|
|
2292
2302
|
* via `TrafficIncidentsState.getEntryModule` — undefined until first show. Subscribe to
|
|
2293
2303
|
* clicks via `module.events.on('click', ...)` once retrieved.
|
|
2294
2304
|
*/
|
|
2295
|
-
_module?:
|
|
2305
|
+
_module?: TrafficIncidentDetailsModule;
|
|
2296
2306
|
/** True while this entry is currently rendered on the map. */
|
|
2297
2307
|
_shown?: boolean;
|
|
2298
2308
|
/**
|
|
@@ -2390,7 +2400,7 @@ type TrafficIncidentsStateEvents = {
|
|
|
2390
2400
|
};
|
|
2391
2401
|
/**
|
|
2392
2402
|
* State for traffic incidents: entry history and map rendering via per-entry
|
|
2393
|
-
*
|
|
2403
|
+
* TrafficIncidentDetailsModule. Each entry can be a separate area; under the default
|
|
2394
2404
|
* `multiple` mode several entries can render at once.
|
|
2395
2405
|
*
|
|
2396
2406
|
* Each entry owns its own module (lazy-init on first show) plus an optional per-entry
|
|
@@ -2442,11 +2452,11 @@ declare class TrafficIncidentsState implements StateSlice {
|
|
|
2442
2452
|
*/
|
|
2443
2453
|
replaceEntryData(entryId: TrafficIncidentsEntry['id'], data: TrafficIncident[], sampledAt: number): Promise<boolean>;
|
|
2444
2454
|
/**
|
|
2445
|
-
* Lazy-init and return the entry's
|
|
2455
|
+
* Lazy-init and return the entry's TrafficIncidentDetailsModule. Consumers subscribe to
|
|
2446
2456
|
* clicks directly on the returned module via `module.events.on('click', ...)`;
|
|
2447
2457
|
* Throws on unknown entry id.
|
|
2448
2458
|
*/
|
|
2449
|
-
getEntryModule(entryId: TrafficIncidentsEntry['id']): Promise<
|
|
2459
|
+
getEntryModule(entryId: TrafficIncidentsEntry['id']): Promise<TrafficIncidentDetailsModule>;
|
|
2450
2460
|
/**
|
|
2451
2461
|
* Render an entry on the map. Lazy-inits its module, pushes the entry's incidents, and
|
|
2452
2462
|
* (when `fitBounds` is true) fits the camera to the entry's bbox. Emits `shown-change`
|
|
@@ -2824,17 +2834,6 @@ export declare const prepareMultiInputs: (ids: MultiInputIds, state: ToolState)
|
|
|
2824
2834
|
* @ignore
|
|
2825
2835
|
*/
|
|
2826
2836
|
export declare const BY_ENTRY_VIEWS_DOC: string;
|
|
2827
|
-
/**
|
|
2828
|
-
* @ignore
|
|
2829
|
-
*/
|
|
2830
|
-
export declare const routeUtils: {
|
|
2831
|
-
readonly calculateProgressAtRoutePoint: (route: Route, pathIndex: number) => import("@tomtom-org/maps-sdk/core").RouteProgressAtPoint | undefined;
|
|
2832
|
-
readonly getCoordinateAtRouteProgress: (route: Route, query: import("@tomtom-org/maps-sdk/core").RouteProgressQuery) => import("@tomtom-org/maps-sdk/core").RouteCoordinateAtProgress | undefined;
|
|
2833
|
-
readonly getProgressAtNearestRoutePoint: (route: Route, point: import("@tomtom-org/maps-sdk/core").HasLngLat) => import("@tomtom-org/maps-sdk/core").RouteCoordinateAtProgress | undefined;
|
|
2834
|
-
readonly getRouteProgressBetween: (route: Route, startPathIndex: number, endPathIndex: number) => import("@tomtom-org/maps-sdk/core").RouteSegmentProgress | undefined;
|
|
2835
|
-
readonly getRouteProgressForSection: (route: Route, section: import("@tomtom-org/maps-sdk/core").SectionProps) => import("@tomtom-org/maps-sdk/core").RouteSegmentProgress | undefined;
|
|
2836
|
-
readonly getSectionBBox: (route: Route, section: import("@tomtom-org/maps-sdk/core").SectionProps) => import("@tomtom-org/maps-sdk/core").OptionalBBox;
|
|
2837
|
-
};
|
|
2838
2837
|
/**
|
|
2839
2838
|
* Names injected into the sandbox by analyseData / processData, in fixed order.
|
|
2840
2839
|
*
|
|
@@ -3279,6 +3278,30 @@ export type ResolvedAreaDisclosure = {
|
|
|
3279
3278
|
};
|
|
3280
3279
|
export declare const isResolveError: (r: unknown) => r is ResolveError;
|
|
3281
3280
|
//#endregion
|
|
3281
|
+
//#region src/tools/shared/route-utils.d.ts
|
|
3282
|
+
/**
|
|
3283
|
+
* @module agent-toolkit-tools
|
|
3284
|
+
*
|
|
3285
|
+
* The `routeUtils` namespace injected into sandboxed model-authored code, so a routes input can be
|
|
3286
|
+
* sliced and measured without re-implementing it. Its own module because the worker entry
|
|
3287
|
+
* (`sandbox/sdk-utils-worker-entry.ts`) is bundled standalone at SDK build time, so importing it
|
|
3288
|
+
* from `multi-input.ts` would pull that module's prompt text into the worker bundle.
|
|
3289
|
+
*
|
|
3290
|
+
* Every function here depends only on `@turf/turf` — available in the worker as `self.turf` — and
|
|
3291
|
+
* pure local helpers, which is what makes the set portable into the sandbox.
|
|
3292
|
+
*/
|
|
3293
|
+
/**
|
|
3294
|
+
* @ignore
|
|
3295
|
+
*/
|
|
3296
|
+
export declare const routeUtils: {
|
|
3297
|
+
readonly calculateProgressAtRoutePoint: (route: import("@tomtom-org/maps-sdk/core").Route, pathIndex: number) => import("@tomtom-org/maps-sdk/core").RouteProgressAtPoint | undefined;
|
|
3298
|
+
readonly getCoordinateAtRouteProgress: (route: import("@tomtom-org/maps-sdk/core").Route, query: import("@tomtom-org/maps-sdk/core").RouteProgressQuery) => import("@tomtom-org/maps-sdk/core").RouteCoordinateAtProgress | undefined;
|
|
3299
|
+
readonly getProgressAtNearestRoutePoint: (route: import("@tomtom-org/maps-sdk/core").Route, point: import("@tomtom-org/maps-sdk/core").HasLngLat) => import("@tomtom-org/maps-sdk/core").RouteCoordinateAtProgress | undefined;
|
|
3300
|
+
readonly getRouteProgressBetween: (route: import("@tomtom-org/maps-sdk/core").Route, startPathIndex: number, endPathIndex: number) => import("@tomtom-org/maps-sdk/core").RouteSegmentProgress | undefined;
|
|
3301
|
+
readonly getRouteProgressForSection: (route: import("@tomtom-org/maps-sdk/core").Route, section: import("@tomtom-org/maps-sdk/core").SectionProps) => import("@tomtom-org/maps-sdk/core").RouteSegmentProgress | undefined;
|
|
3302
|
+
readonly getSectionBBox: (route: import("@tomtom-org/maps-sdk/core").Route, section: import("@tomtom-org/maps-sdk/core").SectionProps) => import("@tomtom-org/maps-sdk/core").OptionalBBox;
|
|
3303
|
+
};
|
|
3304
|
+
//#endregion
|
|
3282
3305
|
//#region src/tools/shared/routes-schema-doc.d.ts
|
|
3283
3306
|
/**
|
|
3284
3307
|
* @module agent-toolkit-tools
|
|
@@ -3939,6 +3962,7 @@ export declare const DEFAULT_TOOLS: {
|
|
|
3939
3962
|
setMapStandardStyle: ToolDefinition;
|
|
3940
3963
|
setLanguage: ToolDefinition;
|
|
3941
3964
|
toggleTilesPOIs: ToolDefinition;
|
|
3965
|
+
toggleTilesBaseMapLayerGroups: ToolDefinition;
|
|
3942
3966
|
setMapStyling: ToolDefinition;
|
|
3943
3967
|
toggleTilesTrafficFlow: ToolDefinition;
|
|
3944
3968
|
toggleTilesTrafficIncidents: ToolDefinition;
|
|
@@ -4683,7 +4707,8 @@ export type MapAgentInstance<CS extends ToolState = ToolState> = ToolLoopAgent &
|
|
|
4683
4707
|
* ```typescript
|
|
4684
4708
|
* import { createMapAgent } from '@tomtom-org/maps-sdk-plugin-agent-toolkit';
|
|
4685
4709
|
* import { openai } from '@ai-sdk/openai';
|
|
4686
|
-
* import {
|
|
4710
|
+
* import { useChat } from '@ai-sdk/react';
|
|
4711
|
+
* import { DirectChatTransport } from 'ai';
|
|
4687
4712
|
*
|
|
4688
4713
|
* const agent = createMapAgent(map, { model: openai('gpt-4o') });
|
|
4689
4714
|
*
|
|
@@ -4810,4 +4835,26 @@ type ClarifyIntentToolOptions = {
|
|
|
4810
4835
|
*/
|
|
4811
4836
|
export declare const createClarifyIntentTool: (options?: ClarifyIntentToolOptions) => ToolEntry;
|
|
4812
4837
|
//#endregion
|
|
4813
|
-
|
|
4838
|
+
//#region src/tools/utilities/get-current-location.d.ts
|
|
4839
|
+
type GetCurrentLocationToolOptions = {
|
|
4840
|
+
/**
|
|
4841
|
+
* Send the exact position, the device's accuracy and the fix's timestamp to the model, from a
|
|
4842
|
+
* fresh high-accuracy fix. Defaults to `false`: the position is rounded to 3 decimals (about
|
|
4843
|
+
* 100 m) from a fix up to a minute old, with no timestamp.
|
|
4844
|
+
*/
|
|
4845
|
+
fullPrecision?: boolean;
|
|
4846
|
+
};
|
|
4847
|
+
/**
|
|
4848
|
+
* Build a getCurrentLocation {@link ToolEntry}. Pass the result to `createMapAgent`'s `tools` option
|
|
4849
|
+
* to replace the built-in default, for example to send the exact position:
|
|
4850
|
+
*
|
|
4851
|
+
* ```typescript
|
|
4852
|
+
* createMapAgent(map, {
|
|
4853
|
+
* model,
|
|
4854
|
+
* tools: { getCurrentLocation: createGetCurrentLocationTool({ fullPrecision: true }) },
|
|
4855
|
+
* });
|
|
4856
|
+
* ```
|
|
4857
|
+
*/
|
|
4858
|
+
export declare const createGetCurrentLocationTool: (options?: GetCurrentLocationToolOptions) => ToolEntry;
|
|
4859
|
+
//#endregion
|
|
4860
|
+
export type { AnalysesEvents, AnalysisRecord, BYODAnalysis, BYODDataProfile, BYODEntry, BYODPropertyProfile, BYODSource, ByodSourceUrlValidation, ByodSourceUrlValidator, ClarifyIntentQuestion, ClarifyIntentToolOptions, ClassificationResult, ClassifierOptions, ClusterResult, ClusterTrend, ClusteringOutput, ClusteringParams, CustomGeometriesAnalysis, CustomGeometriesEntry, DataEntryConfig, DataEntryKind, EntryAnalysis, EntryMode, EntryModeSlice, EntryModeSliceName, GeometryProvenance, GetCurrentLocationToolOptions, IncidentSnapshot, IncidentsAnalysis, MemberRef, MonitoredArea, PlacesAnalysis, PlacesEntry, PollingStatus, RangesEntry, ReachableRange, RouteParams, RoutesAnalysis, RoutesEntry, StateDigest, SystemPromptSection, SystemPromptSectionOverrides, ToolName, Tracker, TrackerEvent, TrackerEventStatus, TrackerEventType, TrackerStateEvents, TrafficAreaAnalyticsAnalysis, TrafficAreaAnalyticsEntry, TrafficAreaAnalyticsParams, TrafficIncidentsEntry, Verdict };
|