@tomtom-org/maps-sdk-plugin-agent-toolkit 0.2.5 → 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/dist/index.d.ts +34 -43
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/package.json +15 -12
package/dist/index.d.ts
CHANGED
|
@@ -1,34 +1,26 @@
|
|
|
1
1
|
import { BaseMapModule } from '../../../../map/dist';
|
|
2
2
|
import { BBox } from '../../../../core/dist';
|
|
3
3
|
import { BBox as BBox_2 } from '../../../../../core/dist';
|
|
4
|
-
import { CommonPlaceProps } from '
|
|
5
|
-
import {
|
|
6
|
-
import { GeometriesModule } from '../../../map/dist';
|
|
7
|
-
import { GeometriesModule as GeometriesModule_2 } from '../../../../map/dist';
|
|
4
|
+
import { CommonPlaceProps } from '../../../../core/dist';
|
|
5
|
+
import { GeometriesModule } from '../../../../map/dist';
|
|
8
6
|
import { GeometryTheme } from '../../../../map/dist';
|
|
9
7
|
import { HillshadeModule } from '../../../../map/dist';
|
|
10
8
|
import { LanguageModel } from 'ai';
|
|
11
9
|
import { Map as Map_2 } from 'maplibre-gl';
|
|
12
10
|
import { ModelMessage } from 'ai';
|
|
13
|
-
import { Place } from '
|
|
14
|
-
import {
|
|
15
|
-
import { PlaceConnectionDisplay } from '../../../map/dist';
|
|
16
|
-
import { PlaceConnectionDisplay as PlaceConnectionDisplay_2 } from '../../../../map/dist';
|
|
11
|
+
import { Place } from '../../../../core/dist';
|
|
12
|
+
import { PlaceConnectionDisplay } from '../../../../map/dist';
|
|
17
13
|
import { Places } from '../../../../core/dist';
|
|
18
|
-
import { PlacesModule } from '
|
|
19
|
-
import { PlacesModule as PlacesModule_2 } from '../../../../map/dist';
|
|
14
|
+
import { PlacesModule } from '../../../../map/dist';
|
|
20
15
|
import { PlanningWaypoint } from '../../../../map/dist';
|
|
21
16
|
import { POIsModule } from '../../../../map/dist';
|
|
22
|
-
import { PolygonFeature } from '
|
|
23
|
-
import {
|
|
24
|
-
import { PolygonFeatures } from '../../../core/dist';
|
|
17
|
+
import { PolygonFeature } from '../../../../core/dist';
|
|
18
|
+
import { PolygonFeatures } from '../../../../core/dist';
|
|
25
19
|
import { Position } from 'geojson';
|
|
26
20
|
import { PrepareStepFunction } from 'ai';
|
|
27
|
-
import { ReachableRangeBudget } from '
|
|
28
|
-
import { Routes } from '
|
|
29
|
-
import {
|
|
30
|
-
import { RoutingModule } from '../../../map/dist';
|
|
31
|
-
import { RoutingModule as RoutingModule_2 } from '../../../../map/dist';
|
|
21
|
+
import { ReachableRangeBudget } from '../../../../services/dist';
|
|
22
|
+
import { Routes } from '../../../../core/dist';
|
|
23
|
+
import { RoutingModule } from '../../../../map/dist';
|
|
32
24
|
import { TomTomMap } from '../../../../map/dist';
|
|
33
25
|
import { TomTomMap as TomTomMap_2 } from '../../map/dist';
|
|
34
26
|
import { ToolLoopAgent } from 'ai';
|
|
@@ -41,8 +33,7 @@ import { TrafficIncident as TrafficIncident_2 } from '../../../../../core/dist';
|
|
|
41
33
|
import { TrafficIncidentDetailsByBBoxParams } from '../../../../services/dist';
|
|
42
34
|
import { TrafficIncidentOverlayModule } from '../../../../map/dist';
|
|
43
35
|
import { TrafficIncidentsModule } from '../../../../map/dist';
|
|
44
|
-
import { WaypointLike } from '
|
|
45
|
-
import { WaypointLike as WaypointLike_2 } from '../../../../core/dist';
|
|
36
|
+
import { WaypointLike } from '../../../../core/dist';
|
|
46
37
|
import { z } from 'zod';
|
|
47
38
|
|
|
48
39
|
declare type AnalysisOutputFormat = 'json' | 'chart';
|
|
@@ -306,11 +297,11 @@ declare class CustomGeometriesState implements ShownEntriesSlice, StateSlice {
|
|
|
306
297
|
* Append a new entry. If `explicitId` collides, the slice auto-suffixes (`-2`, `-3`, ...).
|
|
307
298
|
* Returns the assigned id. Under `single` mode the new entry replaces every older one.
|
|
308
299
|
*/
|
|
309
|
-
addEntry(features:
|
|
300
|
+
addEntry(features: PolygonFeature<CommonPlaceProps>[], provenance: CustomGeometriesEntry['provenance'], label: string, explicitId?: string): string;
|
|
310
301
|
/** Attach an analysis to an existing entry (replace if a result of the same name exists). */
|
|
311
302
|
addAnalysisToEntry(entryId: string, analysis: CustomGeometriesAnalysis): boolean;
|
|
312
303
|
/** Lazy-init the entry's GeometriesModule, applying / re-applying the requested theme. */
|
|
313
|
-
getEntryGeometriesModule(entryId: string, theme?: GeometryTheme): Promise<
|
|
304
|
+
getEntryGeometriesModule(entryId: string, theme?: GeometryTheme): Promise<GeometriesModule>;
|
|
314
305
|
/**
|
|
315
306
|
* Render this entry's polygons. `mode` is scoped to this entry's own layer:
|
|
316
307
|
* - `'replace'` (default) — show exactly `entry.features`, clearing whatever the
|
|
@@ -979,20 +970,20 @@ declare class PlacesState implements StateSlice {
|
|
|
979
970
|
* keeps a separate module per theme so flipping themes for one entry doesn't disturb
|
|
980
971
|
* another. Throws when the entry id is unknown.
|
|
981
972
|
*/
|
|
982
|
-
getEntryPlacesModule(entryId: string, markerType: PlacesMarkerType): Promise<
|
|
973
|
+
getEntryPlacesModule(entryId: string, markerType: PlacesMarkerType): Promise<PlacesModule>;
|
|
983
974
|
/**
|
|
984
975
|
* Lazy-init and return the entry's place-geometries module (for POI footprints, municipality
|
|
985
976
|
* outlines). Re-applies themed config when the theme changes. Throws on unknown entry id.
|
|
986
977
|
*/
|
|
987
|
-
getEntryGeometriesModule(entryId: string, theme?: GeometryTheme): Promise<
|
|
978
|
+
getEntryGeometriesModule(entryId: string, theme?: GeometryTheme): Promise<GeometriesModule>;
|
|
988
979
|
private _requireEntry;
|
|
989
980
|
get entries(): readonly PlacesEntry[];
|
|
990
981
|
/**
|
|
991
982
|
* This is used purely to pass data between tools in a context-dependent way,
|
|
992
983
|
* so we assume the most recent entry is the relevant one to show on the map.
|
|
993
984
|
*/
|
|
994
|
-
get latestPlace():
|
|
995
|
-
addPlaceResult(place:
|
|
985
|
+
get latestPlace(): Place[] | undefined;
|
|
986
|
+
addPlaceResult(place: Place | Places, label: string, explicitId?: string, connections?: PlaceConnectionDisplay[], geometries?: PolygonFeature<CommonPlaceProps>[]): string;
|
|
996
987
|
private _uniqueEntryId;
|
|
997
988
|
/**
|
|
998
989
|
* Attach an analysis result to an existing entry. Analysis names are unique
|
|
@@ -1001,27 +992,27 @@ declare class PlacesState implements StateSlice {
|
|
|
1001
992
|
*/
|
|
1002
993
|
addAnalysisToEntry(entryId: string, analysis: PlacesAnalysis): boolean;
|
|
1003
994
|
findPlaceById(placeId: string): {
|
|
1004
|
-
place:
|
|
995
|
+
place: Place;
|
|
1005
996
|
entryId: string;
|
|
1006
997
|
} | undefined;
|
|
1007
998
|
/**
|
|
1008
999
|
* Returns the cached boundary polygon for a place id, or undefined if no geometry has been
|
|
1009
1000
|
* fetched for it yet. Builds a lazy place-id → feature index per entry on first lookup.
|
|
1010
1001
|
*/
|
|
1011
|
-
getGeometryForPlace(placeId: string):
|
|
1002
|
+
getGeometryForPlace(placeId: string): PolygonFeature<CommonPlaceProps> | undefined;
|
|
1012
1003
|
/**
|
|
1013
1004
|
* Fetches the boundary polygon for a place from the Geometry Data service and stores it on
|
|
1014
1005
|
* the owning entry. Returns the cached feature if already fetched, or undefined if the place
|
|
1015
1006
|
* is unknown or has no geometry data source.
|
|
1016
1007
|
*/
|
|
1017
|
-
fetchPlaceGeometry(placeId: string): Promise<
|
|
1008
|
+
fetchPlaceGeometry(placeId: string): Promise<PolygonFeature<CommonPlaceProps> | undefined>;
|
|
1018
1009
|
/**
|
|
1019
1010
|
* Batch-fetches boundary polygons for every place in an entry that has a geometry data source
|
|
1020
1011
|
* but is not yet cached. Issues one Geometry Data request per chunk of {@link GEOMETRY_DATA_BATCH_SIZE}
|
|
1021
1012
|
* place ids (the API caps each request) and stores the merged result on `entry.geometries`.
|
|
1022
1013
|
* Returns the full geometries list for the entry, or an empty array if the entry is unknown.
|
|
1023
1014
|
*/
|
|
1024
|
-
fetchGeometriesForEntry(entryId: string): Promise<
|
|
1015
|
+
fetchGeometriesForEntry(entryId: string): Promise<PolygonFeature<CommonPlaceProps>[]>;
|
|
1025
1016
|
/**
|
|
1026
1017
|
* Render the given polygons via the entry's GeometriesModule. The `mode` flag is
|
|
1027
1018
|
* scoped to **this entry's layer only** — it does not touch other entries (use
|
|
@@ -1036,7 +1027,7 @@ declare class PlacesState implements StateSlice {
|
|
|
1036
1027
|
* `entryId` defaults to the latest entry that owns geometries — handy when callers only ever
|
|
1037
1028
|
* render the most-recently produced footprints. Pass an explicit id to target an older one.
|
|
1038
1029
|
*/
|
|
1039
|
-
showPlaceGeometries(features:
|
|
1030
|
+
showPlaceGeometries(features: PolygonFeature<CommonPlaceProps>[], theme?: GeometryTheme, mode?: 'add' | 'replace', entryId?: string): Promise<void>;
|
|
1040
1031
|
private _latestGeometriesEntryId;
|
|
1041
1032
|
private _buildGeometryIndex;
|
|
1042
1033
|
/** IDs of all entries currently shown on the map. */
|
|
@@ -1051,13 +1042,13 @@ declare class PlacesState implements StateSlice {
|
|
|
1051
1042
|
/** Marker type for a specific entry, or undefined if it is not shown. */
|
|
1052
1043
|
getShownMarkerType(id: string): PlacesMarkerType | undefined;
|
|
1053
1044
|
/** Return the union of all features belonging to currently-shown entries. */
|
|
1054
|
-
getShownFeatures():
|
|
1045
|
+
getShownFeatures(): Place[];
|
|
1055
1046
|
/**
|
|
1056
1047
|
* Replace the shown set for `markerType` with exactly these ids and re-render.
|
|
1057
1048
|
* Entries currently shown as `markerType` but absent from `ids` are hidden;
|
|
1058
1049
|
* entries in `ids` are switched to `markerType` (lazy-creating their module).
|
|
1059
1050
|
*/
|
|
1060
|
-
setShownEntries(ids: readonly string[], markerType: PlacesMarkerType): Promise<
|
|
1051
|
+
setShownEntries(ids: readonly string[], markerType: PlacesMarkerType): Promise<Place[]>;
|
|
1061
1052
|
/**
|
|
1062
1053
|
* Add ids to the shown set under `markerType`. Any id previously shown as
|
|
1063
1054
|
* a different marker type is moved (its previous module is cleared, the
|
|
@@ -1066,9 +1057,9 @@ declare class PlacesState implements StateSlice {
|
|
|
1066
1057
|
* Under `entryMode === 'single'` everything else is hidden first, so the
|
|
1067
1058
|
* effective behaviour collapses to "show exactly the last id in the list".
|
|
1068
1059
|
*/
|
|
1069
|
-
addShownEntries(ids: readonly string[], markerType: PlacesMarkerType): Promise<
|
|
1060
|
+
addShownEntries(ids: readonly string[], markerType: PlacesMarkerType): Promise<Place[]>;
|
|
1070
1061
|
/** Remove ids from the shown set and clear their modules. */
|
|
1071
|
-
removeShownEntries(ids: readonly string[]): Promise<
|
|
1062
|
+
removeShownEntries(ids: readonly string[]): Promise<Place[]>;
|
|
1072
1063
|
/** Clear everything from the map (does not touch entries history). */
|
|
1073
1064
|
clearShownEntries(): Promise<void>;
|
|
1074
1065
|
clearShownGeometries(ids?: readonly string[]): Promise<void>;
|
|
@@ -1174,13 +1165,13 @@ declare class RangeState implements ShownEntriesSlice {
|
|
|
1174
1165
|
* Lazy-init the entry's GeometriesModule (for the isochrone/isodistance polygons),
|
|
1175
1166
|
* applying the requested theme. Throws on unknown id.
|
|
1176
1167
|
*/
|
|
1177
|
-
getEntryGeometriesModule(entryId: string, theme?: GeometryTheme): Promise<
|
|
1168
|
+
getEntryGeometriesModule(entryId: string, theme?: GeometryTheme): Promise<GeometriesModule>;
|
|
1178
1169
|
/**
|
|
1179
1170
|
* Lazy-init the entry's origin-pin PlacesModule. Each entry maintains its own pin module
|
|
1180
1171
|
* so multiple ranges entries can be on the map simultaneously without the pins of one
|
|
1181
1172
|
* overwriting another.
|
|
1182
1173
|
*/
|
|
1183
|
-
getEntryPlacesModule(entryId: string): Promise<
|
|
1174
|
+
getEntryPlacesModule(entryId: string): Promise<PlacesModule>;
|
|
1184
1175
|
/**
|
|
1185
1176
|
* Mark this entry as shown — records `_shown = true` and emits `shown-change`. The
|
|
1186
1177
|
* caller is expected to push features into the lazy modules itself; this method only
|
|
@@ -1362,7 +1353,7 @@ declare class RoutingState implements ShownEntriesSlice {
|
|
|
1362
1353
|
* Lazy-init and return an entry's RoutingModule. Throws on unknown id. Callers that need
|
|
1363
1354
|
* to show/hide should prefer the higher-level {@link showEntry} / {@link hideEntry}.
|
|
1364
1355
|
*/
|
|
1365
|
-
getEntryRoutingModule(entryId: string): Promise<
|
|
1356
|
+
getEntryRoutingModule(entryId: string): Promise<RoutingModule>;
|
|
1366
1357
|
/**
|
|
1367
1358
|
* Render the given entry's routes + waypoints on its own RoutingModule.
|
|
1368
1359
|
*
|
|
@@ -1389,21 +1380,21 @@ declare class RoutingState implements ShownEntriesSlice {
|
|
|
1389
1380
|
* "focused route" (e.g. setRouteTheme, getShownRoutes) read off it. Returns undefined
|
|
1390
1381
|
* when no entry is currently shown.
|
|
1391
1382
|
*/
|
|
1392
|
-
get currentEntryModule():
|
|
1383
|
+
get currentEntryModule(): RoutingModule | undefined;
|
|
1393
1384
|
get entries(): readonly RoutesEntry[];
|
|
1394
|
-
get currentRoutes():
|
|
1395
|
-
get currentWaypoints():
|
|
1385
|
+
get currentRoutes(): Routes | undefined;
|
|
1386
|
+
get currentWaypoints(): WaypointLike[] | undefined;
|
|
1396
1387
|
/** Sparse nullable slots being assembled before triggering a route calculation. */
|
|
1397
1388
|
get planningSlots(): PlanningWaypoint[];
|
|
1398
1389
|
get params(): RouteParams;
|
|
1399
|
-
addRoutes(routes:
|
|
1390
|
+
addRoutes(routes: Routes, waypoints: WaypointLike[], label: string): string;
|
|
1400
1391
|
/**
|
|
1401
1392
|
* Attach an analysis result to an existing routes entry. Names are unique within a single
|
|
1402
1393
|
* entry — adding one with an existing name replaces it. Returns true on success, false if
|
|
1403
1394
|
* the entry doesn't exist.
|
|
1404
1395
|
*/
|
|
1405
1396
|
addAnalysisToEntry(entryId: string, analysis: RoutesAnalysis): boolean;
|
|
1406
|
-
setWaypointAt(index: number, waypoint:
|
|
1397
|
+
setWaypointAt(index: number, waypoint: WaypointLike): void;
|
|
1407
1398
|
setParams(params: Partial<RouteParams>): void;
|
|
1408
1399
|
reset(): void;
|
|
1409
1400
|
}
|