@tomtom-org/maps-sdk-plugin-agent-toolkit 0.2.5 → 0.2.7
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 +46 -56
- 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
|
|
@@ -927,14 +918,13 @@ export declare type PlacesEntry = {
|
|
|
927
918
|
/** Lazy place-id → boundary polygon index, built on first lookup through PlacesState.getGeometryForPlace. */
|
|
928
919
|
_geometryByPlaceId?: Record<string, PolygonFeature<CommonPlaceProps>>;
|
|
929
920
|
/**
|
|
930
|
-
* Per-entry display modules.
|
|
931
|
-
*
|
|
932
|
-
*
|
|
921
|
+
* Per-entry display modules. An entry is rendered under at most one marker theme at a time,
|
|
922
|
+
* so a single PlacesModule covers all themes — `_showEntryAs` rethemes it via `applyTheme`.
|
|
923
|
+
* A dedicated GeometriesModule renders the entry's boundary polygons.
|
|
924
|
+
* Lazy-initialised via PlacesState helpers — undefined until first show.
|
|
933
925
|
*/
|
|
934
926
|
_modules?: {
|
|
935
|
-
|
|
936
|
-
baseMap?: PlacesModule;
|
|
937
|
-
pinClustered?: PlacesModule;
|
|
927
|
+
places?: PlacesModule;
|
|
938
928
|
geometries?: GeometriesModule;
|
|
939
929
|
};
|
|
940
930
|
/** The marker theme currently rendering this entry, or undefined when hidden. */
|
|
@@ -948,10 +938,10 @@ declare type PlacesMarkerType = 'pin' | 'base-map' | 'pin-clustered';
|
|
|
948
938
|
* State for the places layer: an append-only history of place results plus per-entry display
|
|
949
939
|
* modules.
|
|
950
940
|
*
|
|
951
|
-
* Each entry owns
|
|
952
|
-
*
|
|
953
|
-
*
|
|
954
|
-
* side under different themes without sharing a single source.
|
|
941
|
+
* Each entry owns a single PlacesModule (rethemed in-place via `applyTheme` when the marker
|
|
942
|
+
* type changes — an entry only renders under one theme at a time) and a dedicated
|
|
943
|
+
* GeometriesModule, lazy-initialised on first show. Display state lives on the entry, so two
|
|
944
|
+
* entries can be rendered side by side under different themes without sharing a single source.
|
|
955
945
|
*
|
|
956
946
|
* @group Agent Toolkit
|
|
957
947
|
*/
|
|
@@ -975,24 +965,24 @@ declare class PlacesState implements StateSlice {
|
|
|
975
965
|
*/
|
|
976
966
|
setEntryMode(mode: EntryMode): Promise<void>;
|
|
977
967
|
/**
|
|
978
|
-
* Lazy-init and return the entry's PlacesModule
|
|
979
|
-
*
|
|
980
|
-
*
|
|
968
|
+
* Lazy-init and return the entry's PlacesModule, rethemed to `markerType`. An entry only
|
|
969
|
+
* ever renders under one theme at a time, so the same module is reused — flipping themes
|
|
970
|
+
* calls `applyTheme` in place. Throws when the entry id is unknown.
|
|
981
971
|
*/
|
|
982
|
-
getEntryPlacesModule(entryId: string, markerType: PlacesMarkerType): Promise<
|
|
972
|
+
getEntryPlacesModule(entryId: string, markerType: PlacesMarkerType): Promise<PlacesModule>;
|
|
983
973
|
/**
|
|
984
974
|
* Lazy-init and return the entry's place-geometries module (for POI footprints, municipality
|
|
985
975
|
* outlines). Re-applies themed config when the theme changes. Throws on unknown entry id.
|
|
986
976
|
*/
|
|
987
|
-
getEntryGeometriesModule(entryId: string, theme?: GeometryTheme): Promise<
|
|
977
|
+
getEntryGeometriesModule(entryId: string, theme?: GeometryTheme): Promise<GeometriesModule>;
|
|
988
978
|
private _requireEntry;
|
|
989
979
|
get entries(): readonly PlacesEntry[];
|
|
990
980
|
/**
|
|
991
981
|
* This is used purely to pass data between tools in a context-dependent way,
|
|
992
982
|
* so we assume the most recent entry is the relevant one to show on the map.
|
|
993
983
|
*/
|
|
994
|
-
get latestPlace():
|
|
995
|
-
addPlaceResult(place:
|
|
984
|
+
get latestPlace(): Place[] | undefined;
|
|
985
|
+
addPlaceResult(place: Place | Places, label: string, explicitId?: string, connections?: PlaceConnectionDisplay[], geometries?: PolygonFeature<CommonPlaceProps>[]): string;
|
|
996
986
|
private _uniqueEntryId;
|
|
997
987
|
/**
|
|
998
988
|
* Attach an analysis result to an existing entry. Analysis names are unique
|
|
@@ -1001,27 +991,27 @@ declare class PlacesState implements StateSlice {
|
|
|
1001
991
|
*/
|
|
1002
992
|
addAnalysisToEntry(entryId: string, analysis: PlacesAnalysis): boolean;
|
|
1003
993
|
findPlaceById(placeId: string): {
|
|
1004
|
-
place:
|
|
994
|
+
place: Place;
|
|
1005
995
|
entryId: string;
|
|
1006
996
|
} | undefined;
|
|
1007
997
|
/**
|
|
1008
998
|
* Returns the cached boundary polygon for a place id, or undefined if no geometry has been
|
|
1009
999
|
* fetched for it yet. Builds a lazy place-id → feature index per entry on first lookup.
|
|
1010
1000
|
*/
|
|
1011
|
-
getGeometryForPlace(placeId: string):
|
|
1001
|
+
getGeometryForPlace(placeId: string): PolygonFeature<CommonPlaceProps> | undefined;
|
|
1012
1002
|
/**
|
|
1013
1003
|
* Fetches the boundary polygon for a place from the Geometry Data service and stores it on
|
|
1014
1004
|
* the owning entry. Returns the cached feature if already fetched, or undefined if the place
|
|
1015
1005
|
* is unknown or has no geometry data source.
|
|
1016
1006
|
*/
|
|
1017
|
-
fetchPlaceGeometry(placeId: string): Promise<
|
|
1007
|
+
fetchPlaceGeometry(placeId: string): Promise<PolygonFeature<CommonPlaceProps> | undefined>;
|
|
1018
1008
|
/**
|
|
1019
1009
|
* Batch-fetches boundary polygons for every place in an entry that has a geometry data source
|
|
1020
1010
|
* but is not yet cached. Issues one Geometry Data request per chunk of {@link GEOMETRY_DATA_BATCH_SIZE}
|
|
1021
1011
|
* place ids (the API caps each request) and stores the merged result on `entry.geometries`.
|
|
1022
1012
|
* Returns the full geometries list for the entry, or an empty array if the entry is unknown.
|
|
1023
1013
|
*/
|
|
1024
|
-
fetchGeometriesForEntry(entryId: string): Promise<
|
|
1014
|
+
fetchGeometriesForEntry(entryId: string): Promise<PolygonFeature<CommonPlaceProps>[]>;
|
|
1025
1015
|
/**
|
|
1026
1016
|
* Render the given polygons via the entry's GeometriesModule. The `mode` flag is
|
|
1027
1017
|
* scoped to **this entry's layer only** — it does not touch other entries (use
|
|
@@ -1036,7 +1026,7 @@ declare class PlacesState implements StateSlice {
|
|
|
1036
1026
|
* `entryId` defaults to the latest entry that owns geometries — handy when callers only ever
|
|
1037
1027
|
* render the most-recently produced footprints. Pass an explicit id to target an older one.
|
|
1038
1028
|
*/
|
|
1039
|
-
showPlaceGeometries(features:
|
|
1029
|
+
showPlaceGeometries(features: PolygonFeature<CommonPlaceProps>[], theme?: GeometryTheme, mode?: 'add' | 'replace', entryId?: string): Promise<void>;
|
|
1040
1030
|
private _latestGeometriesEntryId;
|
|
1041
1031
|
private _buildGeometryIndex;
|
|
1042
1032
|
/** IDs of all entries currently shown on the map. */
|
|
@@ -1051,13 +1041,13 @@ declare class PlacesState implements StateSlice {
|
|
|
1051
1041
|
/** Marker type for a specific entry, or undefined if it is not shown. */
|
|
1052
1042
|
getShownMarkerType(id: string): PlacesMarkerType | undefined;
|
|
1053
1043
|
/** Return the union of all features belonging to currently-shown entries. */
|
|
1054
|
-
getShownFeatures():
|
|
1044
|
+
getShownFeatures(): Place[];
|
|
1055
1045
|
/**
|
|
1056
1046
|
* Replace the shown set for `markerType` with exactly these ids and re-render.
|
|
1057
1047
|
* Entries currently shown as `markerType` but absent from `ids` are hidden;
|
|
1058
1048
|
* entries in `ids` are switched to `markerType` (lazy-creating their module).
|
|
1059
1049
|
*/
|
|
1060
|
-
setShownEntries(ids: readonly string[], markerType: PlacesMarkerType): Promise<
|
|
1050
|
+
setShownEntries(ids: readonly string[], markerType: PlacesMarkerType): Promise<Place[]>;
|
|
1061
1051
|
/**
|
|
1062
1052
|
* Add ids to the shown set under `markerType`. Any id previously shown as
|
|
1063
1053
|
* a different marker type is moved (its previous module is cleared, the
|
|
@@ -1066,9 +1056,9 @@ declare class PlacesState implements StateSlice {
|
|
|
1066
1056
|
* Under `entryMode === 'single'` everything else is hidden first, so the
|
|
1067
1057
|
* effective behaviour collapses to "show exactly the last id in the list".
|
|
1068
1058
|
*/
|
|
1069
|
-
addShownEntries(ids: readonly string[], markerType: PlacesMarkerType): Promise<
|
|
1059
|
+
addShownEntries(ids: readonly string[], markerType: PlacesMarkerType): Promise<Place[]>;
|
|
1070
1060
|
/** Remove ids from the shown set and clear their modules. */
|
|
1071
|
-
removeShownEntries(ids: readonly string[]): Promise<
|
|
1061
|
+
removeShownEntries(ids: readonly string[]): Promise<Place[]>;
|
|
1072
1062
|
/** Clear everything from the map (does not touch entries history). */
|
|
1073
1063
|
clearShownEntries(): Promise<void>;
|
|
1074
1064
|
clearShownGeometries(ids?: readonly string[]): Promise<void>;
|
|
@@ -1174,13 +1164,13 @@ declare class RangeState implements ShownEntriesSlice {
|
|
|
1174
1164
|
* Lazy-init the entry's GeometriesModule (for the isochrone/isodistance polygons),
|
|
1175
1165
|
* applying the requested theme. Throws on unknown id.
|
|
1176
1166
|
*/
|
|
1177
|
-
getEntryGeometriesModule(entryId: string, theme?: GeometryTheme): Promise<
|
|
1167
|
+
getEntryGeometriesModule(entryId: string, theme?: GeometryTheme): Promise<GeometriesModule>;
|
|
1178
1168
|
/**
|
|
1179
1169
|
* Lazy-init the entry's origin-pin PlacesModule. Each entry maintains its own pin module
|
|
1180
1170
|
* so multiple ranges entries can be on the map simultaneously without the pins of one
|
|
1181
1171
|
* overwriting another.
|
|
1182
1172
|
*/
|
|
1183
|
-
getEntryPlacesModule(entryId: string): Promise<
|
|
1173
|
+
getEntryPlacesModule(entryId: string): Promise<PlacesModule>;
|
|
1184
1174
|
/**
|
|
1185
1175
|
* Mark this entry as shown — records `_shown = true` and emits `shown-change`. The
|
|
1186
1176
|
* caller is expected to push features into the lazy modules itself; this method only
|
|
@@ -1362,7 +1352,7 @@ declare class RoutingState implements ShownEntriesSlice {
|
|
|
1362
1352
|
* Lazy-init and return an entry's RoutingModule. Throws on unknown id. Callers that need
|
|
1363
1353
|
* to show/hide should prefer the higher-level {@link showEntry} / {@link hideEntry}.
|
|
1364
1354
|
*/
|
|
1365
|
-
getEntryRoutingModule(entryId: string): Promise<
|
|
1355
|
+
getEntryRoutingModule(entryId: string): Promise<RoutingModule>;
|
|
1366
1356
|
/**
|
|
1367
1357
|
* Render the given entry's routes + waypoints on its own RoutingModule.
|
|
1368
1358
|
*
|
|
@@ -1389,21 +1379,21 @@ declare class RoutingState implements ShownEntriesSlice {
|
|
|
1389
1379
|
* "focused route" (e.g. setRouteTheme, getShownRoutes) read off it. Returns undefined
|
|
1390
1380
|
* when no entry is currently shown.
|
|
1391
1381
|
*/
|
|
1392
|
-
get currentEntryModule():
|
|
1382
|
+
get currentEntryModule(): RoutingModule | undefined;
|
|
1393
1383
|
get entries(): readonly RoutesEntry[];
|
|
1394
|
-
get currentRoutes():
|
|
1395
|
-
get currentWaypoints():
|
|
1384
|
+
get currentRoutes(): Routes | undefined;
|
|
1385
|
+
get currentWaypoints(): WaypointLike[] | undefined;
|
|
1396
1386
|
/** Sparse nullable slots being assembled before triggering a route calculation. */
|
|
1397
1387
|
get planningSlots(): PlanningWaypoint[];
|
|
1398
1388
|
get params(): RouteParams;
|
|
1399
|
-
addRoutes(routes:
|
|
1389
|
+
addRoutes(routes: Routes, waypoints: WaypointLike[], label: string): string;
|
|
1400
1390
|
/**
|
|
1401
1391
|
* Attach an analysis result to an existing routes entry. Names are unique within a single
|
|
1402
1392
|
* entry — adding one with an existing name replaces it. Returns true on success, false if
|
|
1403
1393
|
* the entry doesn't exist.
|
|
1404
1394
|
*/
|
|
1405
1395
|
addAnalysisToEntry(entryId: string, analysis: RoutesAnalysis): boolean;
|
|
1406
|
-
setWaypointAt(index: number, waypoint:
|
|
1396
|
+
setWaypointAt(index: number, waypoint: WaypointLike): void;
|
|
1407
1397
|
setParams(params: Partial<RouteParams>): void;
|
|
1408
1398
|
reset(): void;
|
|
1409
1399
|
}
|