@tomtom-org/maps-sdk-plugin-agent-toolkit 0.10.1 → 0.11.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 +22 -19
- package/dist/index.d.ts +73 -30
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/{worker-libs-Cn3Jhheb.js → worker-libs-CMKEtQq0.js} +2 -2
- package/dist/{worker-libs-Cn3Jhheb.js.map → worker-libs-CMKEtQq0.js.map} +1 -1
- package/package.json +3 -3
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
123
|
| `setMapStyling` | Set or reset base-map styling knobs — label/icon/road sizes, exit numbers, shields, 3D buildings, congestion colours, map colours, presets, or a whole theme from a few colours or an image |
|
|
123
|
-
|
|
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/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BaseMapModule, CustomGeoJSONLayerSpec, CustomGeoJSONModule, GeometriesModule, GeometryFillStyle, POIsModule, PlaceConnectionDisplay, PlacesModule, PlanningWaypoint, RoutingModule, StylingModule, TomTomMap, TrafficAreaAnalyticsModule, TrafficAreaAnalyticsModuleConfig, TrafficFlowModule,
|
|
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, StylingModule, 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. */
|
|
@@ -1177,7 +1177,7 @@ type PlacesStateEvents = {
|
|
|
1177
1177
|
* State for the places layer: an append-only history of place results plus per-entry display
|
|
1178
1178
|
* modules.
|
|
1179
1179
|
*
|
|
1180
|
-
* Each entry owns a single PlacesModule (switched in place via `
|
|
1180
|
+
* Each entry owns a single PlacesModule (switched in place via `updateConfig` when the marker
|
|
1181
1181
|
* type changes — an entry only renders under one marker type at a time) and a dedicated
|
|
1182
1182
|
* GeometriesModule, lazy-initialised on first show. Display state lives on the entry, so two
|
|
1183
1183
|
* entries can be rendered side by side under different marker types without sharing a single source.
|
|
@@ -1206,7 +1206,7 @@ declare class PlacesState implements StateSlice {
|
|
|
1206
1206
|
/**
|
|
1207
1207
|
* Lazy-init and return the entry's PlacesModule, switched to `markerType`. An entry only
|
|
1208
1208
|
* ever renders under one marker type at a time, so the same module is reused — flipping marker
|
|
1209
|
-
* types calls `
|
|
1209
|
+
* types calls `updateConfig` in place. Throws when the entry id is unknown.
|
|
1210
1210
|
*/
|
|
1211
1211
|
getEntryPlacesModule(entryId: string, markerType: PlacesMarkerType): Promise<PlacesModule>;
|
|
1212
1212
|
/**
|
|
@@ -1335,7 +1335,7 @@ type PlacesEntry = BaseEntry<Place[]> & {
|
|
|
1335
1335
|
_geometryByPlaceId?: Record<string, PolygonFeature<CommonPlaceProps>>;
|
|
1336
1336
|
/**
|
|
1337
1337
|
* 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 `
|
|
1338
|
+
* so a single PlacesModule covers all of them — `_showEntryAs` switches it via `updateConfig({ markerType })`.
|
|
1339
1339
|
* A dedicated GeometriesModule renders the entry's boundary polygons.
|
|
1340
1340
|
* Lazy-initialised via PlacesState helpers — undefined until first show.
|
|
1341
1341
|
*/
|
|
@@ -1377,17 +1377,17 @@ type ReachableRange = {
|
|
|
1377
1377
|
*/
|
|
1378
1378
|
type RangesEntry = BaseEntry<ReachableRange[]> & {
|
|
1379
1379
|
/**
|
|
1380
|
-
* Per-entry display modules. Each entry owns a dedicated
|
|
1381
|
-
* isochrone polygons
|
|
1380
|
+
* Per-entry display modules. Each entry owns a dedicated ReachableRangesModule (for the
|
|
1381
|
+
* isochrone polygons, and their fill style), a GeometriesModule (for the same polygons in a
|
|
1382
|
+
* consumer's own style) and a PlacesModule (for the origin pin(s)), so display state lives
|
|
1382
1383
|
* on the entry instead of a shared slice-level module. Lazy-initialised via RangeState
|
|
1383
1384
|
* helpers — undefined until first show.
|
|
1384
1385
|
*/
|
|
1385
1386
|
_modules?: {
|
|
1387
|
+
ranges?: ReachableRangesModule;
|
|
1386
1388
|
geometries?: GeometriesModule;
|
|
1387
1389
|
places?: PlacesModule;
|
|
1388
1390
|
};
|
|
1389
|
-
/** Fill style that the geometries module is currently configured with. */
|
|
1390
|
-
_shownFillStyle?: GeometryFillStyle;
|
|
1391
1391
|
/** True while any of this entry's modules are rendering on the map. */
|
|
1392
1392
|
_shown?: boolean;
|
|
1393
1393
|
};
|
|
@@ -1418,7 +1418,7 @@ type RangeStateEvents = {
|
|
|
1418
1418
|
*
|
|
1419
1419
|
* Stores semantic summaries of calculated ranges (origin, budgets).
|
|
1420
1420
|
* Also retains raw polygon geometry internally for use in geometry searches
|
|
1421
|
-
* (e.g. discoverPlaces withinRange). Displayed on the map via
|
|
1421
|
+
* (e.g. discoverPlaces withinRange). Displayed on the map via ReachableRangesModule.
|
|
1422
1422
|
*
|
|
1423
1423
|
* @group Agent Toolkit
|
|
1424
1424
|
*/
|
|
@@ -1444,9 +1444,16 @@ declare class RangeState implements ShownEntriesSlice {
|
|
|
1444
1444
|
*/
|
|
1445
1445
|
setEntryMode(mode: EntryMode): Promise<void>;
|
|
1446
1446
|
/**
|
|
1447
|
-
* Lazy-init the entry's
|
|
1447
|
+
* Lazy-init the entry's ReachableRangesModule (for the isochrone/isodistance polygons),
|
|
1448
1448
|
* applying the requested fill style. Throws on unknown id.
|
|
1449
1449
|
*/
|
|
1450
|
+
getEntryRangesModule(entryId: string, fillStyle?: GeometryFillStyle): Promise<ReachableRangesModule>;
|
|
1451
|
+
/**
|
|
1452
|
+
* Lazy-init the entry's plain GeometriesModule, for drawing the entry's polygons in a style of
|
|
1453
|
+
* your own (per-feature colours, border widths) rather than as reachable-range bands.
|
|
1454
|
+
* Updates only the fill style when it changes, keeping the styling applied since. Throws on
|
|
1455
|
+
* unknown id.
|
|
1456
|
+
*/
|
|
1450
1457
|
getEntryGeometriesModule(entryId: string, fillStyle?: GeometryFillStyle): Promise<GeometriesModule>;
|
|
1451
1458
|
/**
|
|
1452
1459
|
* Lazy-init the entry's origin-pin PlacesModule. Each entry maintains its own pin module
|
|
@@ -1466,7 +1473,7 @@ declare class RangeState implements ShownEntriesSlice {
|
|
|
1466
1473
|
/** Hide every module on the entry (clear). No-op when the entry is unknown. */
|
|
1467
1474
|
hideEntry(entryId: string): Promise<void>;
|
|
1468
1475
|
/**
|
|
1469
|
-
* Drop a single entry from history. Hides it from the map first (clears its
|
|
1476
|
+
* Drop a single entry from history. Hides it from the map first (clears its ranges +
|
|
1470
1477
|
* origin-pin modules) then removes it from `_entries`. Emits `entries-change`. No-op when
|
|
1471
1478
|
* the id is unknown.
|
|
1472
1479
|
*/
|
|
@@ -2292,7 +2299,7 @@ type TrafficIncidentsEntry = BaseEntry<TrafficIncident[]> & {
|
|
|
2292
2299
|
* via `TrafficIncidentsState.getEntryModule` — undefined until first show. Subscribe to
|
|
2293
2300
|
* clicks via `module.events.on('click', ...)` once retrieved.
|
|
2294
2301
|
*/
|
|
2295
|
-
_module?:
|
|
2302
|
+
_module?: TrafficIncidentDetailsModule;
|
|
2296
2303
|
/** True while this entry is currently rendered on the map. */
|
|
2297
2304
|
_shown?: boolean;
|
|
2298
2305
|
/**
|
|
@@ -2390,7 +2397,7 @@ type TrafficIncidentsStateEvents = {
|
|
|
2390
2397
|
};
|
|
2391
2398
|
/**
|
|
2392
2399
|
* State for traffic incidents: entry history and map rendering via per-entry
|
|
2393
|
-
*
|
|
2400
|
+
* TrafficIncidentDetailsModule. Each entry can be a separate area; under the default
|
|
2394
2401
|
* `multiple` mode several entries can render at once.
|
|
2395
2402
|
*
|
|
2396
2403
|
* Each entry owns its own module (lazy-init on first show) plus an optional per-entry
|
|
@@ -2442,11 +2449,11 @@ declare class TrafficIncidentsState implements StateSlice {
|
|
|
2442
2449
|
*/
|
|
2443
2450
|
replaceEntryData(entryId: TrafficIncidentsEntry['id'], data: TrafficIncident[], sampledAt: number): Promise<boolean>;
|
|
2444
2451
|
/**
|
|
2445
|
-
* Lazy-init and return the entry's
|
|
2452
|
+
* Lazy-init and return the entry's TrafficIncidentDetailsModule. Consumers subscribe to
|
|
2446
2453
|
* clicks directly on the returned module via `module.events.on('click', ...)`;
|
|
2447
2454
|
* Throws on unknown entry id.
|
|
2448
2455
|
*/
|
|
2449
|
-
getEntryModule(entryId: TrafficIncidentsEntry['id']): Promise<
|
|
2456
|
+
getEntryModule(entryId: TrafficIncidentsEntry['id']): Promise<TrafficIncidentDetailsModule>;
|
|
2450
2457
|
/**
|
|
2451
2458
|
* Render an entry on the map. Lazy-inits its module, pushes the entry's incidents, and
|
|
2452
2459
|
* (when `fitBounds` is true) fits the camera to the entry's bbox. Emits `shown-change`
|
|
@@ -2824,17 +2831,6 @@ export declare const prepareMultiInputs: (ids: MultiInputIds, state: ToolState)
|
|
|
2824
2831
|
* @ignore
|
|
2825
2832
|
*/
|
|
2826
2833
|
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
2834
|
/**
|
|
2839
2835
|
* Names injected into the sandbox by analyseData / processData, in fixed order.
|
|
2840
2836
|
*
|
|
@@ -3279,6 +3275,30 @@ export type ResolvedAreaDisclosure = {
|
|
|
3279
3275
|
};
|
|
3280
3276
|
export declare const isResolveError: (r: unknown) => r is ResolveError;
|
|
3281
3277
|
//#endregion
|
|
3278
|
+
//#region src/tools/shared/route-utils.d.ts
|
|
3279
|
+
/**
|
|
3280
|
+
* @module agent-toolkit-tools
|
|
3281
|
+
*
|
|
3282
|
+
* The `routeUtils` namespace injected into sandboxed model-authored code, so a routes input can be
|
|
3283
|
+
* sliced and measured without re-implementing it. Its own module because the worker entry
|
|
3284
|
+
* (`sandbox/sdk-utils-worker-entry.ts`) is bundled standalone at SDK build time, so importing it
|
|
3285
|
+
* from `multi-input.ts` would pull that module's prompt text into the worker bundle.
|
|
3286
|
+
*
|
|
3287
|
+
* Every function here depends only on `@turf/turf` — available in the worker as `self.turf` — and
|
|
3288
|
+
* pure local helpers, which is what makes the set portable into the sandbox.
|
|
3289
|
+
*/
|
|
3290
|
+
/**
|
|
3291
|
+
* @ignore
|
|
3292
|
+
*/
|
|
3293
|
+
export declare const routeUtils: {
|
|
3294
|
+
readonly calculateProgressAtRoutePoint: (route: import("@tomtom-org/maps-sdk/core").Route, pathIndex: number) => import("@tomtom-org/maps-sdk/core").RouteProgressAtPoint | undefined;
|
|
3295
|
+
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;
|
|
3296
|
+
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;
|
|
3297
|
+
readonly getRouteProgressBetween: (route: import("@tomtom-org/maps-sdk/core").Route, startPathIndex: number, endPathIndex: number) => import("@tomtom-org/maps-sdk/core").RouteSegmentProgress | undefined;
|
|
3298
|
+
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;
|
|
3299
|
+
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;
|
|
3300
|
+
};
|
|
3301
|
+
//#endregion
|
|
3282
3302
|
//#region src/tools/shared/routes-schema-doc.d.ts
|
|
3283
3303
|
/**
|
|
3284
3304
|
* @module agent-toolkit-tools
|
|
@@ -4683,7 +4703,8 @@ export type MapAgentInstance<CS extends ToolState = ToolState> = ToolLoopAgent &
|
|
|
4683
4703
|
* ```typescript
|
|
4684
4704
|
* import { createMapAgent } from '@tomtom-org/maps-sdk-plugin-agent-toolkit';
|
|
4685
4705
|
* import { openai } from '@ai-sdk/openai';
|
|
4686
|
-
* import {
|
|
4706
|
+
* import { useChat } from '@ai-sdk/react';
|
|
4707
|
+
* import { DirectChatTransport } from 'ai';
|
|
4687
4708
|
*
|
|
4688
4709
|
* const agent = createMapAgent(map, { model: openai('gpt-4o') });
|
|
4689
4710
|
*
|
|
@@ -4810,4 +4831,26 @@ type ClarifyIntentToolOptions = {
|
|
|
4810
4831
|
*/
|
|
4811
4832
|
export declare const createClarifyIntentTool: (options?: ClarifyIntentToolOptions) => ToolEntry;
|
|
4812
4833
|
//#endregion
|
|
4813
|
-
|
|
4834
|
+
//#region src/tools/utilities/get-current-location.d.ts
|
|
4835
|
+
type GetCurrentLocationToolOptions = {
|
|
4836
|
+
/**
|
|
4837
|
+
* Send the exact position, the device's accuracy and the fix's timestamp to the model, from a
|
|
4838
|
+
* fresh high-accuracy fix. Defaults to `false`: the position is rounded to 3 decimals (about
|
|
4839
|
+
* 100 m) from a fix up to a minute old, with no timestamp.
|
|
4840
|
+
*/
|
|
4841
|
+
fullPrecision?: boolean;
|
|
4842
|
+
};
|
|
4843
|
+
/**
|
|
4844
|
+
* Build a getCurrentLocation {@link ToolEntry}. Pass the result to `createMapAgent`'s `tools` option
|
|
4845
|
+
* to replace the built-in default, for example to send the exact position:
|
|
4846
|
+
*
|
|
4847
|
+
* ```typescript
|
|
4848
|
+
* createMapAgent(map, {
|
|
4849
|
+
* model,
|
|
4850
|
+
* tools: { getCurrentLocation: createGetCurrentLocationTool({ fullPrecision: true }) },
|
|
4851
|
+
* });
|
|
4852
|
+
* ```
|
|
4853
|
+
*/
|
|
4854
|
+
export declare const createGetCurrentLocationTool: (options?: GetCurrentLocationToolOptions) => ToolEntry;
|
|
4855
|
+
//#endregion
|
|
4856
|
+
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 };
|