@tomtom-org/maps-sdk-plugin-agent-toolkit 0.5.4 → 0.6.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/LICENSE.txt +37 -461
- package/README.md +2 -0
- package/THIRD_PARTY.txt +498 -0
- package/dist/THIRD_PARTY.txt +245 -24
- package/dist/index.d.ts +248 -219
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/third-party.json +69 -0
- package/dist/worker-libs-C794xj9c.js +2 -0
- package/dist/{worker-libs-C4wkkDH7.js.map → worker-libs-C794xj9c.js.map} +1 -1
- package/package.json +16 -14
- package/dist/worker-libs-C4wkkDH7.js +0 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BaseMapModule, CustomGeoJSONLayerSpec, CustomGeoJSONModule, GeometriesModule, GeometryTheme, HillshadeModule, POIsModule, PlaceConnectionDisplay, PlacesModule, PlanningWaypoint, RoutingModule, TomTomMap, TrafficAreaAnalyticsConfig, TrafficAreaAnalyticsModule, TrafficFlowModule, TrafficIncidentOverlayModule, TrafficIncidentsModule } from "@tomtom-org/maps-sdk/map";
|
|
1
|
+
import { BaseMapModule, CustomGeoJSONLayerSpec, CustomGeoJSONModule, GeometriesModule, GeometryTheme, HillshadeModule, POIsModule, PlaceConnectionDisplay, PlacesModule, PlanningWaypoint, RoutingModule, StylingModule, TomTomMap, TrafficAreaAnalyticsConfig, TrafficAreaAnalyticsModule, TrafficFlowModule, TrafficIncidentOverlayModule, TrafficIncidentsModule } from "@tomtom-org/maps-sdk/map";
|
|
2
2
|
import { BBox, CommonPlaceProps, GeographyType, POICategory, Place, Places, PolygonFeature, PolygonFeatures, 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 { ReachableRangeBudget, TrafficIncidentDetailsByBBoxParams } from "@tomtom-org/maps-sdk/services";
|
|
6
|
+
import { GeoBias, ReachableRangeBudget, 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. */
|
|
@@ -78,7 +78,7 @@ declare class JobHandle implements Job {
|
|
|
78
78
|
}
|
|
79
79
|
//#endregion
|
|
80
80
|
//#region src/tools/shared/sandbox-code.d.ts
|
|
81
|
-
type AnalysisOutputFormat = 'json' | 'chart';
|
|
81
|
+
export type AnalysisOutputFormat = 'json' | 'chart';
|
|
82
82
|
/**
|
|
83
83
|
* Compact sandbox-code blurb shared by `process-places`, `process-geometries`,
|
|
84
84
|
* `analyse-places`, `analyse-geometries`, and `analyse-routes`. Keeps the
|
|
@@ -89,11 +89,11 @@ type AnalysisOutputFormat = 'json' | 'chart';
|
|
|
89
89
|
*
|
|
90
90
|
* @ignore
|
|
91
91
|
*/
|
|
92
|
-
declare const buildSandboxCodePrompt: (injected: readonly string[]) => string;
|
|
92
|
+
export declare const buildSandboxCodePrompt: (injected: readonly string[]) => string;
|
|
93
93
|
/** Chart.js chart types accepted by the analyse-* tools when `outputFormat: "chart"`. */
|
|
94
|
-
declare const CHART_TYPES: Set<string>;
|
|
94
|
+
export declare const CHART_TYPES: Set<string>;
|
|
95
95
|
/** Lightweight structural check that a sandbox return value is a Chart.js config. */
|
|
96
|
-
declare const isChartConfiguration: (value: unknown) => value is ChartConfiguration;
|
|
96
|
+
export declare const isChartConfiguration: (value: unknown) => value is ChartConfiguration;
|
|
97
97
|
/**
|
|
98
98
|
* GeoJSON Feature with a Polygon or MultiPolygon geometry. Generic over
|
|
99
99
|
* `properties` so callers that need a narrower property shape (e.g. place
|
|
@@ -101,11 +101,11 @@ declare const isChartConfiguration: (value: unknown) => value is ChartConfigurat
|
|
|
101
101
|
*
|
|
102
102
|
* @ignore
|
|
103
103
|
*/
|
|
104
|
-
declare const isPolygonFeature: <P = unknown>(value: unknown) => value is PolygonFeature<P>;
|
|
104
|
+
export declare const isPolygonFeature: <P = unknown>(value: unknown) => value is PolygonFeature<P>;
|
|
105
105
|
/** @ignore */
|
|
106
|
-
declare const isPolygonFeatureArray: <P = unknown>(value: unknown) => value is PolygonFeature<P>[];
|
|
106
|
+
export declare const isPolygonFeatureArray: <P = unknown>(value: unknown) => value is PolygonFeature<P>[];
|
|
107
107
|
/** Shared `describe()` text for the analyse-* `outputFormat` enum field. */
|
|
108
|
-
declare const ANALYSE_OUTPUT_FORMAT_DESCRIPTION: string;
|
|
108
|
+
export declare const ANALYSE_OUTPUT_FORMAT_DESCRIPTION: string;
|
|
109
109
|
/**
|
|
110
110
|
* Builds the shared "return value" blurb for the analyse-* tools' `code` field.
|
|
111
111
|
* Encodes the JSON-only contract, the Chart.js config shape, and the
|
|
@@ -116,7 +116,7 @@ declare const ANALYSE_OUTPUT_FORMAT_DESCRIPTION: string;
|
|
|
116
116
|
* @param chartLabelExample Optional inline code snippet illustrating a
|
|
117
117
|
* multi-line `string[]` label using the tool's domain. Omitted when empty.
|
|
118
118
|
*/
|
|
119
|
-
declare const buildAnalyseReturnPrompt: (jsonExamples: string, chartLabelExample?: string) => string;
|
|
119
|
+
export declare const buildAnalyseReturnPrompt: (jsonExamples: string, chartLabelExample?: string) => string;
|
|
120
120
|
/**
|
|
121
121
|
* Validates the value returned by analyse-* sandboxed code: rejects
|
|
122
122
|
* `undefined`, JSON-normalizes via `toJsonSafe`, and — when
|
|
@@ -126,15 +126,15 @@ declare const buildAnalyseReturnPrompt: (jsonExamples: string, chartLabelExample
|
|
|
126
126
|
*
|
|
127
127
|
* @ignore
|
|
128
128
|
*/
|
|
129
|
-
declare const validateAnalysisResult: (analysis: unknown, outputFormat: AnalysisOutputFormat) => {
|
|
129
|
+
export declare const validateAnalysisResult: (analysis: unknown, outputFormat: AnalysisOutputFormat) => {
|
|
130
130
|
value: unknown;
|
|
131
131
|
} | {
|
|
132
132
|
error: string;
|
|
133
133
|
};
|
|
134
134
|
/** @ignore */
|
|
135
|
-
declare const sandboxedGlobalShadows: readonly ["fetch", "XMLHttpRequest", "WebSocket", "EventSource", "localStorage", "sessionStorage", "indexedDB", "document", "window", "globalThis", "self", "navigator", "importScripts", "process"];
|
|
135
|
+
export declare const sandboxedGlobalShadows: readonly ["fetch", "XMLHttpRequest", "WebSocket", "EventSource", "localStorage", "sessionStorage", "indexedDB", "document", "window", "globalThis", "self", "navigator", "importScripts", "process"];
|
|
136
136
|
/** @ignore */
|
|
137
|
-
declare const WORKER_PROVIDED_PARAMS: readonly ["turf", "h3", "routeUtils", "log", "cluster"];
|
|
137
|
+
export declare const WORKER_PROVIDED_PARAMS: readonly ["turf", "h3", "routeUtils", "log", "cluster"];
|
|
138
138
|
/**
|
|
139
139
|
* Pluggable strategy for executing sandbox code. The default
|
|
140
140
|
* {@link mainThreadExecutor} compiles + runs in the host realm; an alternative
|
|
@@ -146,7 +146,7 @@ declare const WORKER_PROVIDED_PARAMS: readonly ["turf", "h3", "routeUtils", "log
|
|
|
146
146
|
*
|
|
147
147
|
* @group Agent Toolkit
|
|
148
148
|
*/
|
|
149
|
-
type SandboxExecutor = {
|
|
149
|
+
export type SandboxExecutor = {
|
|
150
150
|
run<Result = unknown>(code: string, paramNames: readonly string[], args: readonly unknown[], verb: string): Promise<{
|
|
151
151
|
value: Result;
|
|
152
152
|
} | {
|
|
@@ -163,7 +163,7 @@ type SandboxExecutor = {
|
|
|
163
163
|
*
|
|
164
164
|
* @ignore
|
|
165
165
|
*/
|
|
166
|
-
declare const mainThreadExecutor: SandboxExecutor;
|
|
166
|
+
export declare const mainThreadExecutor: SandboxExecutor;
|
|
167
167
|
/**
|
|
168
168
|
* Compiles `code` as the body of an `async` function that takes the named
|
|
169
169
|
* `paramNames`, sanitises injected redeclarations, runs it with `args`, and
|
|
@@ -187,13 +187,13 @@ declare const mainThreadExecutor: SandboxExecutor;
|
|
|
187
187
|
*
|
|
188
188
|
* @ignore
|
|
189
189
|
*/
|
|
190
|
-
declare const runSandboxedFn: <Result = unknown>(code: string, paramNames: readonly string[], args: readonly unknown[], verb: string, executor: SandboxExecutor) => Promise<{
|
|
190
|
+
export declare const runSandboxedFn: <Result = unknown>(code: string, paramNames: readonly string[], args: readonly unknown[], verb: string, executor: SandboxExecutor) => Promise<{
|
|
191
191
|
value: Result;
|
|
192
192
|
} | {
|
|
193
193
|
error: string;
|
|
194
194
|
}>;
|
|
195
195
|
/** @ignore */
|
|
196
|
-
declare const stripInjectedRedeclarations: (code: string, identifiers: readonly string[]) => string;
|
|
196
|
+
export declare const stripInjectedRedeclarations: (code: string, identifiers: readonly string[]) => string;
|
|
197
197
|
/**
|
|
198
198
|
* Builds an LLM-facing error string for sandboxed code execution failures.
|
|
199
199
|
* Appends a `Hint:` suffix when the error matches a common pattern so the
|
|
@@ -201,7 +201,7 @@ declare const stripInjectedRedeclarations: (code: string, identifiers: readonly
|
|
|
201
201
|
* in the prefix (e.g. `"Analysis"`, `"Process"`).
|
|
202
202
|
*/
|
|
203
203
|
/** @ignore */
|
|
204
|
-
declare const formatSandboxExecutionError: (verb: string, error: unknown) => string;
|
|
204
|
+
export declare const formatSandboxExecutionError: (verb: string, error: unknown) => string;
|
|
205
205
|
//#endregion
|
|
206
206
|
//#region src/state/events.d.ts
|
|
207
207
|
/**
|
|
@@ -709,10 +709,12 @@ declare class BaseMapState implements StateSlice {
|
|
|
709
709
|
readonly ttMap: TomTomMap;
|
|
710
710
|
private _baseMapModule?;
|
|
711
711
|
private _hillshadeModule?;
|
|
712
|
+
private _stylingModule?;
|
|
712
713
|
constructor(ttMap: TomTomMap);
|
|
713
714
|
get mapLibreMap(): Map$1;
|
|
714
715
|
getBaseMapModule(): Promise<BaseMapModule>;
|
|
715
716
|
getHillshadeModule(): Promise<HillshadeModule>;
|
|
717
|
+
getStylingModule(): Promise<StylingModule>;
|
|
716
718
|
reset(): void;
|
|
717
719
|
}
|
|
718
720
|
//#endregion
|
|
@@ -720,7 +722,7 @@ declare class BaseMapState implements StateSlice {
|
|
|
720
722
|
/**
|
|
721
723
|
* @module agent-toolkit-tools
|
|
722
724
|
*/
|
|
723
|
-
declare const AGENT_TOOLKIT_ID = "AgentToolkit";
|
|
725
|
+
export declare const AGENT_TOOLKIT_ID = "AgentToolkit";
|
|
724
726
|
/**
|
|
725
727
|
* The `tomtom-user-agent` value identifying agent-toolkit traffic. Shared by both paths that carry
|
|
726
728
|
* it — {@link withAgentToolkitHeaders} on service calls, `createMapAgent` on the map — so the two
|
|
@@ -728,7 +730,7 @@ declare const AGENT_TOOLKIT_ID = "AgentToolkit";
|
|
|
728
730
|
*
|
|
729
731
|
* @ignore
|
|
730
732
|
*/
|
|
731
|
-
declare const AGENT_TOOLKIT_USER_AGENT: string;
|
|
733
|
+
export declare const AGENT_TOOLKIT_USER_AGENT: string;
|
|
732
734
|
/**
|
|
733
735
|
* Tags an SDK service call as coming from agent-toolkit, via the SDK's own supported per-call
|
|
734
736
|
* `tomtom-user-agent` override (see `generateTomTomHeaders`, `core/src/util/headers.ts`) — reuses
|
|
@@ -739,7 +741,7 @@ declare const AGENT_TOOLKIT_USER_AGENT: string;
|
|
|
739
741
|
*
|
|
740
742
|
* @ignore
|
|
741
743
|
*/
|
|
742
|
-
declare const withAgentToolkitHeaders: <P extends object>(params: P) => P;
|
|
744
|
+
export declare const withAgentToolkitHeaders: <P extends object>(params: P) => P;
|
|
743
745
|
//#endregion
|
|
744
746
|
//#region src/tools/shared/entry-kinds.d.ts
|
|
745
747
|
/**
|
|
@@ -749,14 +751,14 @@ declare const withAgentToolkitHeaders: <P extends object>(params: P) => P;
|
|
|
749
751
|
*
|
|
750
752
|
* @ignore
|
|
751
753
|
*/
|
|
752
|
-
declare const ALL_ENTRY_DATA_KINDS: readonly ["places", "routes", "incidents", "customGeometries", "trafficAreaAnalytics", "byod"];
|
|
754
|
+
export declare const ALL_ENTRY_DATA_KINDS: readonly ["places", "routes", "incidents", "customGeometries", "trafficAreaAnalytics", "byod"];
|
|
753
755
|
/**
|
|
754
756
|
* Per-kind scope envelope. The classifier emits one of these in `toolScopes.<toolName>`
|
|
755
757
|
* to narrow which kinds the tool's per-turn input schema and code-doc mention.
|
|
756
758
|
*
|
|
757
759
|
* @ignore
|
|
758
760
|
*/
|
|
759
|
-
type EntryKindScope = {
|
|
761
|
+
export type EntryKindScope = {
|
|
760
762
|
kinds: readonly EntryDataKind[];
|
|
761
763
|
};
|
|
762
764
|
/**
|
|
@@ -766,7 +768,7 @@ type EntryKindScope = {
|
|
|
766
768
|
*
|
|
767
769
|
* @ignore
|
|
768
770
|
*/
|
|
769
|
-
declare const buildEntryKindScopeSchema: (enabled: readonly EntryDataKind[]) => z.ZodObject<{
|
|
771
|
+
export declare const buildEntryKindScopeSchema: (enabled: readonly EntryDataKind[]) => z.ZodObject<{
|
|
770
772
|
kinds: z.ZodArray<z.ZodEnum<{
|
|
771
773
|
places: "places";
|
|
772
774
|
routes: "routes";
|
|
@@ -796,7 +798,7 @@ type FieldBuildOptions = {
|
|
|
796
798
|
*
|
|
797
799
|
* @ignore
|
|
798
800
|
*/
|
|
799
|
-
type EntryKindMeta = {
|
|
801
|
+
export type EntryKindMeta = {
|
|
800
802
|
fieldName: string;
|
|
801
803
|
fieldLabel: string;
|
|
802
804
|
buildField: (options: FieldBuildOptions) => z.ZodTypeAny;
|
|
@@ -810,7 +812,7 @@ type EntryKindMeta = {
|
|
|
810
812
|
*
|
|
811
813
|
* @ignore
|
|
812
814
|
*/
|
|
813
|
-
declare const ENTRY_KIND_META: Record<EntryDataKind, EntryKindMeta>;
|
|
815
|
+
export declare const ENTRY_KIND_META: Record<EntryDataKind, EntryKindMeta>;
|
|
814
816
|
/**
|
|
815
817
|
* Resolve the set of kinds active for a single per-turn build: the intersection of
|
|
816
818
|
* the agent's enabled kinds and the classifier's per-turn scope. `scope === undefined`
|
|
@@ -818,7 +820,7 @@ declare const ENTRY_KIND_META: Record<EntryDataKind, EntryKindMeta>;
|
|
|
818
820
|
*
|
|
819
821
|
* @ignore
|
|
820
822
|
*/
|
|
821
|
-
declare const resolveActiveKinds: (enabled: readonly EntryDataKind[], scope: EntryKindScope | undefined) => readonly EntryDataKind[];
|
|
823
|
+
export declare const resolveActiveKinds: (enabled: readonly EntryDataKind[], scope: EntryKindScope | undefined) => readonly EntryDataKind[];
|
|
822
824
|
/**
|
|
823
825
|
* Predicate form of {@link resolveActiveKinds} for a single kind. Used when generating
|
|
824
826
|
* tool-specific fields (e.g. analyseData's `monitor`) that should only appear when
|
|
@@ -826,21 +828,21 @@ declare const resolveActiveKinds: (enabled: readonly EntryDataKind[], scope: Ent
|
|
|
826
828
|
*
|
|
827
829
|
* @ignore
|
|
828
830
|
*/
|
|
829
|
-
declare const isKindActive: (enabled: readonly EntryDataKind[], scope: EntryKindScope | undefined, kind: EntryDataKind) => boolean;
|
|
831
|
+
export declare const isKindActive: (enabled: readonly EntryDataKind[], scope: EntryKindScope | undefined, kind: EntryDataKind) => boolean;
|
|
830
832
|
/**
|
|
831
833
|
* Slash-joined list of scoped `*EntryIDs` field labels — used in "At least one of `A` / `B`
|
|
832
834
|
* must be set." messages and in per-field hints. Order follows {@link ALL_ENTRY_DATA_KINDS}.
|
|
833
835
|
*
|
|
834
836
|
* @ignore
|
|
835
837
|
*/
|
|
836
|
-
declare const buildEntryFieldList: (active: readonly EntryDataKind[]) => string;
|
|
838
|
+
export declare const buildEntryFieldList: (active: readonly EntryDataKind[]) => string;
|
|
837
839
|
/**
|
|
838
840
|
* Join the per-kind sandbox-doc fragments in canonical order for the supplied active set.
|
|
839
841
|
* Returns the multi-line "Each input is …" block.
|
|
840
842
|
*
|
|
841
843
|
* @ignore
|
|
842
844
|
*/
|
|
843
|
-
declare const buildEntryKindSandboxDocs: (active: readonly EntryDataKind[]) => string;
|
|
845
|
+
export declare const buildEntryKindSandboxDocs: (active: readonly EntryDataKind[]) => string;
|
|
844
846
|
/**
|
|
845
847
|
* Join the per-kind deep schema-doc fragments in canonical order for the supplied active
|
|
846
848
|
* set. Empty when no active kind has a schema doc (only places / routes / customGeometries
|
|
@@ -848,7 +850,7 @@ declare const buildEntryKindSandboxDocs: (active: readonly EntryDataKind[]) => s
|
|
|
848
850
|
*
|
|
849
851
|
* @ignore
|
|
850
852
|
*/
|
|
851
|
-
declare const buildEntryKindSchemaDocs: (active: readonly EntryDataKind[]) => string;
|
|
853
|
+
export declare const buildEntryKindSchemaDocs: (active: readonly EntryDataKind[]) => string;
|
|
852
854
|
/**
|
|
853
855
|
* Build the input-shape Record passed into `z.object({...})`. Both tools share this
|
|
854
856
|
* shape — each kind in the active set contributes its `*EntryIDs` field via
|
|
@@ -857,7 +859,7 @@ declare const buildEntryKindSchemaDocs: (active: readonly EntryDataKind[]) => st
|
|
|
857
859
|
*
|
|
858
860
|
* @ignore
|
|
859
861
|
*/
|
|
860
|
-
declare const buildEntryIdFields: (active: readonly EntryDataKind[], options: FieldBuildOptions) => Record<string, z.ZodTypeAny>;
|
|
862
|
+
export declare const buildEntryIdFields: (active: readonly EntryDataKind[], options: FieldBuildOptions) => Record<string, z.ZodTypeAny>;
|
|
861
863
|
/**
|
|
862
864
|
* Set of LLM-input objects that contain any `*EntryIDs` field. Used by the shared
|
|
863
865
|
* "at least one of …" refine so both tools agree on what counts as "input present".
|
|
@@ -868,37 +870,37 @@ declare const buildEntryIdFields: (active: readonly EntryDataKind[], options: Fi
|
|
|
868
870
|
*
|
|
869
871
|
* @ignore
|
|
870
872
|
*/
|
|
871
|
-
declare const hasAnyEntryIds: (value: Record<string, unknown>) => boolean;
|
|
873
|
+
export declare const hasAnyEntryIds: (value: Record<string, unknown>) => boolean;
|
|
872
874
|
/**
|
|
873
875
|
* Message used by the shared "at least one of …" refine. Lists the active kinds'
|
|
874
876
|
* field labels and the slash-joined recall-tool hints for the same set.
|
|
875
877
|
*
|
|
876
878
|
* @ignore
|
|
877
879
|
*/
|
|
878
|
-
declare const buildAtLeastOneEntryIdMessage: (active: readonly EntryDataKind[]) => string;
|
|
880
|
+
export declare const buildAtLeastOneEntryIdMessage: (active: readonly EntryDataKind[]) => string;
|
|
879
881
|
//#endregion
|
|
880
882
|
//#region src/tools/shared/fit-on-map.d.ts
|
|
881
883
|
/** @ignore */
|
|
882
|
-
declare const fitOnMapInputSchema: z.ZodUnion<readonly [z.ZodArray<z.ZodNumber>, z.ZodObject<{
|
|
884
|
+
export declare const fitOnMapInputSchema: z.ZodUnion<readonly [z.ZodArray<z.ZodNumber>, z.ZodObject<{
|
|
883
885
|
bbox: z.ZodArray<z.ZodNumber>;
|
|
884
886
|
padding: z.ZodOptional<z.ZodNumber>;
|
|
885
887
|
animate: z.ZodOptional<z.ZodBoolean>;
|
|
886
888
|
}, z.core.$strip>]>;
|
|
887
889
|
/** @ignore */
|
|
888
|
-
declare const fittedReportSchema: z.ZodObject<{
|
|
890
|
+
export declare const fittedReportSchema: z.ZodObject<{
|
|
889
891
|
bbox: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
|
|
890
892
|
padding: z.ZodNumber;
|
|
891
893
|
}, z.core.$strip>;
|
|
892
894
|
/** @ignore */
|
|
893
|
-
type FitOnMapInput = BBox | {
|
|
895
|
+
export type FitOnMapInput = BBox | {
|
|
894
896
|
bbox: BBox;
|
|
895
897
|
padding?: number;
|
|
896
898
|
animate?: boolean;
|
|
897
899
|
};
|
|
898
900
|
/** Doc blurb to inline in sandboxed-code descriptions. @ignore */
|
|
899
|
-
declare const FIT_ON_MAP_DOC: string;
|
|
901
|
+
export declare const FIT_ON_MAP_DOC: string;
|
|
900
902
|
/** @ignore */
|
|
901
|
-
declare const isFitOnMapInput: (value: unknown) => value is FitOnMapInput;
|
|
903
|
+
export declare const isFitOnMapInput: (value: unknown) => value is FitOnMapInput;
|
|
902
904
|
/**
|
|
903
905
|
* Apply a sandbox-returned `fitOnMap` directive: move the camera to the bbox
|
|
904
906
|
* with the requested padding/animation, and return a normalized record for
|
|
@@ -906,7 +908,7 @@ declare const isFitOnMapInput: (value: unknown) => value is FitOnMapInput;
|
|
|
906
908
|
*
|
|
907
909
|
* @ignore
|
|
908
910
|
*/
|
|
909
|
-
declare const applyFitOnMap: (state: ToolState, fit: FitOnMapInput) => z.infer<typeof fittedReportSchema>;
|
|
911
|
+
export declare const applyFitOnMap: (state: ToolState, fit: FitOnMapInput) => z.infer<typeof fittedReportSchema>;
|
|
910
912
|
//#endregion
|
|
911
913
|
//#region src/tools/shared/geocode-areas.d.ts
|
|
912
914
|
/**
|
|
@@ -916,17 +918,17 @@ declare const applyFitOnMap: (state: ToolState, fit: FitOnMapInput) => z.infer<t
|
|
|
916
918
|
* it. Excludes `Country` (too coarse) and `PostalCodeArea` (homonym noise — "A10" → a Kazakh
|
|
917
919
|
* postcode).
|
|
918
920
|
*/
|
|
919
|
-
declare const AREA_GEOGRAPHY_TYPES: GeographyType[];
|
|
921
|
+
export declare const AREA_GEOGRAPHY_TYPES: GeographyType[];
|
|
920
922
|
/**
|
|
921
923
|
* Geocodes `query` restricted to administrative AREA geographies (not streets/POIs), biased toward
|
|
922
924
|
* `bias` (the map centre). Because `geographyTypes` filters to areas, every result carries a
|
|
923
925
|
* `boundingBox`. Callers choose among the candidates (e.g. the one nearest the current view) — a
|
|
924
926
|
* centre bias is used rather than a hard viewport-bbox filter so out-of-view areas still resolve.
|
|
925
927
|
*/
|
|
926
|
-
declare const geocodeAreas: (query: string, opts?: {
|
|
928
|
+
export declare const geocodeAreas: (query: string, opts?: {
|
|
927
929
|
bias?: Position;
|
|
928
930
|
limit?: number;
|
|
929
|
-
}) => Promise<Place[]>;
|
|
931
|
+
}, execOptions?: ToolExecuteOptions) => Promise<Place[]>;
|
|
930
932
|
//#endregion
|
|
931
933
|
//#region src/tools/shared/geometries-id.d.ts
|
|
932
934
|
/**
|
|
@@ -934,7 +936,7 @@ declare const geocodeAreas: (query: string, opts?: {
|
|
|
934
936
|
*
|
|
935
937
|
* @group Agent Toolkit
|
|
936
938
|
*/
|
|
937
|
-
type GeometriesIdKind = 'place' | 'places' | 'ranges' | 'customGeometries';
|
|
939
|
+
export type GeometriesIdKind = 'place' | 'places' | 'ranges' | 'customGeometries';
|
|
938
940
|
/**
|
|
939
941
|
* Tagged geometries id. The Zod schema is exposed so tools can plug it
|
|
940
942
|
* straight into their input shape (`z.array(geometriesIdSchema).min(1)`)
|
|
@@ -942,7 +944,7 @@ type GeometriesIdKind = 'place' | 'places' | 'ranges' | 'customGeometries';
|
|
|
942
944
|
*
|
|
943
945
|
* @group Agent Toolkit
|
|
944
946
|
*/
|
|
945
|
-
declare const geometriesIdSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
947
|
+
export declare const geometriesIdSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
946
948
|
kind: z.ZodLiteral<"place">;
|
|
947
949
|
id: z.ZodString;
|
|
948
950
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -960,7 +962,7 @@ declare const geometriesIdSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
960
962
|
*
|
|
961
963
|
* @group Agent Toolkit
|
|
962
964
|
*/
|
|
963
|
-
type GeometriesId = z.infer<typeof geometriesIdSchema>;
|
|
965
|
+
export type GeometriesId = z.infer<typeof geometriesIdSchema>;
|
|
964
966
|
/**
|
|
965
967
|
* Shared `geometriesEntryIDs` input schema for tools that read polygons from
|
|
966
968
|
* session state (`processData`, `analyseData`). One canonical
|
|
@@ -969,7 +971,7 @@ type GeometriesId = z.infer<typeof geometriesIdSchema>;
|
|
|
969
971
|
*
|
|
970
972
|
* @ignore
|
|
971
973
|
*/
|
|
972
|
-
declare const geometriesEntryIDsSchema: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
974
|
+
export declare const geometriesEntryIDsSchema: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
973
975
|
kind: z.ZodLiteral<"place">;
|
|
974
976
|
id: z.ZodString;
|
|
975
977
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -988,19 +990,19 @@ declare const geometriesEntryIDsSchema: z.ZodArray<z.ZodDiscriminatedUnion<[z.Zo
|
|
|
988
990
|
*
|
|
989
991
|
* @ignore
|
|
990
992
|
*/
|
|
991
|
-
declare const GEOMETRIES_PROPS_DOC: string;
|
|
993
|
+
export declare const GEOMETRIES_PROPS_DOC: string;
|
|
992
994
|
/**
|
|
993
995
|
* Shared description for `skipped` arrays in tool outputs.
|
|
994
996
|
*
|
|
995
997
|
* @ignore
|
|
996
998
|
*/
|
|
997
|
-
declare const GEOMETRIES_SKIPPED_DESC = "Source ids that could not contribute (unknown id, no geometry data source, fetch failure, or empty entry).";
|
|
999
|
+
export declare const GEOMETRIES_SKIPPED_DESC = "Source ids that could not contribute (unknown id, no geometry data source, fetch failure, or empty entry).";
|
|
998
1000
|
/**
|
|
999
1001
|
* Shared description for `sourceIds` arrays in tool outputs.
|
|
1000
1002
|
*
|
|
1001
1003
|
* @ignore
|
|
1002
1004
|
*/
|
|
1003
|
-
declare const GEOMETRIES_SOURCE_IDS_DESC = "Tagged input ids that contributed at least one polygon to the run, in input order.";
|
|
1005
|
+
export declare const GEOMETRIES_SOURCE_IDS_DESC = "Tagged input ids that contributed at least one polygon to the run, in input order.";
|
|
1004
1006
|
//#endregion
|
|
1005
1007
|
//#region src/tools/shared/geometries-schema-doc.d.ts
|
|
1006
1008
|
/**
|
|
@@ -1013,7 +1015,7 @@ declare const GEOMETRIES_SOURCE_IDS_DESC = "Tagged input ids that contributed at
|
|
|
1013
1015
|
* spelled out here.
|
|
1014
1016
|
*/
|
|
1015
1017
|
/** @ignore */
|
|
1016
|
-
declare const GEOMETRIES_SCHEMA_DOC: string;
|
|
1018
|
+
export declare const GEOMETRIES_SCHEMA_DOC: string;
|
|
1017
1019
|
//#endregion
|
|
1018
1020
|
//#region src/state/custom-geometries/analysis.d.ts
|
|
1019
1021
|
/**
|
|
@@ -1094,7 +1096,7 @@ type StateDigest = {
|
|
|
1094
1096
|
*
|
|
1095
1097
|
* @group Agent Toolkit
|
|
1096
1098
|
*/
|
|
1097
|
-
declare const getStateDigest: (state: ToolState) => StateDigest;
|
|
1099
|
+
export declare const getStateDigest: (state: ToolState) => StateDigest;
|
|
1098
1100
|
/**
|
|
1099
1101
|
* Produce a compact, LLM-readable summary of the differences between two digests, or `null` when
|
|
1100
1102
|
* nothing changed. The output is short enough to prepend to a user prompt without bloating the
|
|
@@ -1110,7 +1112,7 @@ declare const getStateDigest: (state: ToolState) => StateDigest;
|
|
|
1110
1112
|
*
|
|
1111
1113
|
* @group Agent Toolkit
|
|
1112
1114
|
*/
|
|
1113
|
-
declare const formatStateDigestDiff: (prev: StateDigest, next: StateDigest) => string | null;
|
|
1115
|
+
export declare const formatStateDigestDiff: (prev: StateDigest, next: StateDigest) => string | null;
|
|
1114
1116
|
//#endregion
|
|
1115
1117
|
//#region src/state/map-pois/state.d.ts
|
|
1116
1118
|
/**
|
|
@@ -1141,45 +1143,15 @@ declare class MapPOIsState implements StateSlice {
|
|
|
1141
1143
|
*/
|
|
1142
1144
|
type PlacesAnalysis = EntryAnalysis;
|
|
1143
1145
|
//#endregion
|
|
1144
|
-
//#region src/state/places/
|
|
1146
|
+
//#region src/state/places/state.d.ts
|
|
1145
1147
|
/**
|
|
1146
|
-
*
|
|
1147
|
-
*
|
|
1148
|
-
*
|
|
1149
|
-
*
|
|
1150
|
-
* @ignore
|
|
1148
|
+
* The marker looks an entry can be rendered with: individual pins, base-map POIs, or clustered
|
|
1149
|
+
* pins. A type-checked subset of the SDK's {@link PlacesTheme} — `circle-icon` is not offered to
|
|
1150
|
+
* the agent. Every tool enum for marker types derives from this array rather than repeating it.
|
|
1151
1151
|
*/
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
/**
|
|
1156
|
-
* Boundary polygons attached to this entry. One feature per place that has a geometry data
|
|
1157
|
-
* source (populated lazily via PlacesState.fetchPlaceGeometry), or a standalone result list
|
|
1158
|
-
* produced by tools like `processData`. Each feature's `id` is the geometry-data-source id
|
|
1159
|
-
* (`place.properties.dataSources.geometry.id`), matching the response shape of `geometryData`.
|
|
1160
|
-
*/
|
|
1161
|
-
geometries?: PolygonFeature<CommonPlaceProps>[];
|
|
1162
|
-
/** Lazy place-id → Place index, built on first ID lookup through PlacesState.findPlaceById. */
|
|
1163
|
-
_byId?: Record<string, Place>;
|
|
1164
|
-
/** Lazy place-id → boundary polygon index, built on first lookup through PlacesState.getGeometryForPlace. */
|
|
1165
|
-
_geometryByPlaceId?: Record<string, PolygonFeature<CommonPlaceProps>>;
|
|
1166
|
-
/**
|
|
1167
|
-
* Per-entry display modules. An entry is rendered under at most one marker theme at a time,
|
|
1168
|
-
* so a single PlacesModule covers all themes — `_showEntryAs` rethemes it via `applyTheme`.
|
|
1169
|
-
* A dedicated GeometriesModule renders the entry's boundary polygons.
|
|
1170
|
-
* Lazy-initialised via PlacesState helpers — undefined until first show.
|
|
1171
|
-
*/
|
|
1172
|
-
_modules?: {
|
|
1173
|
-
places?: PlacesModule;
|
|
1174
|
-
geometries?: GeometriesModule;
|
|
1175
|
-
};
|
|
1176
|
-
/** The marker theme currently rendering this entry, or undefined when hidden. */
|
|
1177
|
-
_shownAs?: 'pin' | 'base-map' | 'pin-clustered';
|
|
1178
|
-
};
|
|
1179
|
-
//#endregion
|
|
1180
|
-
//#region src/state/places/state.d.ts
|
|
1181
|
-
/** How an entry is rendered on the map: as individual pins, base-map POIs, or clustered pins. */
|
|
1182
|
-
type PlacesMarkerType = 'pin' | 'base-map' | 'pin-clustered';
|
|
1152
|
+
declare const placesMarkerTypes: readonly ["pin", "base-map", "pin-clustered"];
|
|
1153
|
+
/** How an entry is rendered on the map — one of {@link placesMarkerTypes}. */
|
|
1154
|
+
type PlacesMarkerType = (typeof placesMarkerTypes)[number];
|
|
1183
1155
|
/**
|
|
1184
1156
|
* Events fired by {@link PlacesState}. Subscribe via `state.places.events.on(type, handler)`.
|
|
1185
1157
|
*
|
|
@@ -1270,14 +1242,14 @@ declare class PlacesState implements StateSlice {
|
|
|
1270
1242
|
* the owning entry. Returns the cached feature if already fetched, or undefined if the place
|
|
1271
1243
|
* is unknown or has no geometry data source.
|
|
1272
1244
|
*/
|
|
1273
|
-
fetchPlaceGeometry(placeId: string): Promise<PolygonFeature<CommonPlaceProps> | undefined>;
|
|
1245
|
+
fetchPlaceGeometry(placeId: string, options?: ToolExecuteOptions): Promise<PolygonFeature<CommonPlaceProps> | undefined>;
|
|
1274
1246
|
/**
|
|
1275
1247
|
* Batch-fetches boundary polygons for every place in an entry that has a geometry data source
|
|
1276
1248
|
* but is not yet cached. Issues one Geometry Data request per chunk of {@link GEOMETRY_DATA_BATCH_SIZE}
|
|
1277
1249
|
* place ids (the API caps each request) and stores the merged result on `entry.geometries`.
|
|
1278
1250
|
* Returns the full geometries list for the entry, or an empty array if the entry is unknown.
|
|
1279
1251
|
*/
|
|
1280
|
-
fetchGeometriesForEntry(entryId: string): Promise<PolygonFeature<CommonPlaceProps>[]>;
|
|
1252
|
+
fetchGeometriesForEntry(entryId: string, options?: ToolExecuteOptions): Promise<PolygonFeature<CommonPlaceProps>[]>;
|
|
1281
1253
|
/**
|
|
1282
1254
|
* Render the given polygons via the entry's GeometriesModule. The `mode` flag is
|
|
1283
1255
|
* scoped to **this entry's layer only** — it does not touch other entries (use
|
|
@@ -1344,6 +1316,42 @@ declare class PlacesState implements StateSlice {
|
|
|
1344
1316
|
reset(): void;
|
|
1345
1317
|
}
|
|
1346
1318
|
//#endregion
|
|
1319
|
+
//#region src/state/places/entry.d.ts
|
|
1320
|
+
/**
|
|
1321
|
+
* A single entry in the place search history.
|
|
1322
|
+
*
|
|
1323
|
+
* @group Agent Toolkit
|
|
1324
|
+
*
|
|
1325
|
+
* @ignore
|
|
1326
|
+
*/
|
|
1327
|
+
type PlacesEntry = BaseEntry<Place[]> & {
|
|
1328
|
+
/** Connections (lines between places) produced alongside this entry, rendered via PlacesModule.showConnections. */
|
|
1329
|
+
connections?: PlaceConnectionDisplay[];
|
|
1330
|
+
/**
|
|
1331
|
+
* Boundary polygons attached to this entry. One feature per place that has a geometry data
|
|
1332
|
+
* source (populated lazily via PlacesState.fetchPlaceGeometry), or a standalone result list
|
|
1333
|
+
* produced by tools like `processData`. Each feature's `id` is the geometry-data-source id
|
|
1334
|
+
* (`place.properties.dataSources.geometry.id`), matching the response shape of `geometryData`.
|
|
1335
|
+
*/
|
|
1336
|
+
geometries?: PolygonFeature<CommonPlaceProps>[];
|
|
1337
|
+
/** Lazy place-id → Place index, built on first ID lookup through PlacesState.findPlaceById. */
|
|
1338
|
+
_byId?: Record<string, Place>;
|
|
1339
|
+
/** Lazy place-id → boundary polygon index, built on first lookup through PlacesState.getGeometryForPlace. */
|
|
1340
|
+
_geometryByPlaceId?: Record<string, PolygonFeature<CommonPlaceProps>>;
|
|
1341
|
+
/**
|
|
1342
|
+
* Per-entry display modules. An entry is rendered under at most one marker theme at a time,
|
|
1343
|
+
* so a single PlacesModule covers all themes — `_showEntryAs` rethemes it via `applyTheme`.
|
|
1344
|
+
* A dedicated GeometriesModule renders the entry's boundary polygons.
|
|
1345
|
+
* Lazy-initialised via PlacesState helpers — undefined until first show.
|
|
1346
|
+
*/
|
|
1347
|
+
_modules?: {
|
|
1348
|
+
places?: PlacesModule;
|
|
1349
|
+
geometries?: GeometriesModule;
|
|
1350
|
+
};
|
|
1351
|
+
/** The marker theme currently rendering this entry, or undefined when hidden. */
|
|
1352
|
+
_shownAs?: PlacesMarkerType;
|
|
1353
|
+
};
|
|
1354
|
+
//#endregion
|
|
1347
1355
|
//#region src/state/range/entry.d.ts
|
|
1348
1356
|
/**
|
|
1349
1357
|
* A single reachable area, scoped to one origin and one set of budgets.
|
|
@@ -1815,7 +1823,7 @@ declare class RoutingState implements ShownEntriesSlice {
|
|
|
1815
1823
|
*
|
|
1816
1824
|
* @group Agent Toolkit
|
|
1817
1825
|
*/
|
|
1818
|
-
interface StateSlice {
|
|
1826
|
+
export interface StateSlice {
|
|
1819
1827
|
reset(): void;
|
|
1820
1828
|
}
|
|
1821
1829
|
//#endregion
|
|
@@ -2561,29 +2569,24 @@ declare class TrafficTilesState implements StateSlice {
|
|
|
2561
2569
|
*
|
|
2562
2570
|
* @ignore
|
|
2563
2571
|
*/
|
|
2564
|
-
declare const hidePreviousShownEntries: (slice: ShownEntriesSlice, keepEntryIds: readonly string[], selector: "all" | readonly string[] | undefined) => Promise<void>;
|
|
2572
|
+
export declare const hidePreviousShownEntries: (slice: ShownEntriesSlice, keepEntryIds: readonly string[], selector: "all" | readonly string[] | undefined) => Promise<void>;
|
|
2565
2573
|
//#endregion
|
|
2566
2574
|
//#region src/tools/shared/locate-places.d.ts
|
|
2567
|
-
type
|
|
2568
|
-
position: Position;
|
|
2569
|
-
} | {
|
|
2570
|
-
boundingBox: BBox;
|
|
2571
|
-
};
|
|
2572
|
-
type QueryAs = 'poi' | 'place';
|
|
2575
|
+
export type QueryAs = 'poi' | 'place';
|
|
2573
2576
|
/**
|
|
2574
2577
|
* Resolves a query string to up to `limit` Places. POI search when `queryAs === 'poi'`, geocoding
|
|
2575
2578
|
* otherwise. Optional `bias` narrows the search to a region.
|
|
2576
2579
|
*/
|
|
2577
|
-
declare const locatePlaces: (query: string, queryAs: QueryAs, options: {
|
|
2580
|
+
export declare const locatePlaces: (query: string, queryAs: QueryAs, options: {
|
|
2578
2581
|
limit: number;
|
|
2579
|
-
bias?:
|
|
2580
|
-
}) => Promise<Place[]>;
|
|
2582
|
+
bias?: GeoBias;
|
|
2583
|
+
}, execOptions?: ToolExecuteOptions) => Promise<Place[]>;
|
|
2581
2584
|
/** Convenience wrapper around {@link locatePlaces} for the single-result case. */
|
|
2582
|
-
declare const locatePlace: (query: string, queryAs: QueryAs, bias?:
|
|
2585
|
+
export declare const locatePlace: (query: string, queryAs: QueryAs, bias?: GeoBias, execOptions?: ToolExecuteOptions) => Promise<Place | null>;
|
|
2583
2586
|
//#endregion
|
|
2584
2587
|
//#region src/tools/shared/location-input.d.ts
|
|
2585
2588
|
/** @ignore */
|
|
2586
|
-
type ResolvedLocation = {
|
|
2589
|
+
export type ResolvedLocation = {
|
|
2587
2590
|
/** Resolved place: a Place (with address metadata) or a bare [lng, lat] tuple. */
|
|
2588
2591
|
place: WaypointLike;
|
|
2589
2592
|
position: Position;
|
|
@@ -2592,7 +2595,7 @@ type ResolvedLocation = {
|
|
|
2592
2595
|
query?: string;
|
|
2593
2596
|
};
|
|
2594
2597
|
/** @ignore */
|
|
2595
|
-
declare const locationInputSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
2598
|
+
export declare const locationInputSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
2596
2599
|
query: z.ZodString;
|
|
2597
2600
|
queryAs: z.ZodEnum<{
|
|
2598
2601
|
poi: "poi";
|
|
@@ -2604,11 +2607,18 @@ declare const locationInputSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
2604
2607
|
placeIdOrEntryId: z.ZodString;
|
|
2605
2608
|
}, z.core.$strip>]>;
|
|
2606
2609
|
/** @ignore */
|
|
2607
|
-
type LocationInput = z.infer<typeof locationInputSchema>;
|
|
2610
|
+
export type LocationInput = z.infer<typeof locationInputSchema>;
|
|
2611
|
+
/**
|
|
2612
|
+
* Names a location input in an error message, without resolving it — so the model reads back the
|
|
2613
|
+
* same thing it sent.
|
|
2614
|
+
*
|
|
2615
|
+
* @ignore
|
|
2616
|
+
*/
|
|
2617
|
+
export declare const labelForLocationInput: (location: LocationInput) => string;
|
|
2608
2618
|
//#endregion
|
|
2609
2619
|
//#region src/tools/shared/state-inputs.d.ts
|
|
2610
2620
|
/** @ignore */
|
|
2611
|
-
declare const skippedSourceSchema: z.ZodObject<{
|
|
2621
|
+
export declare const skippedSourceSchema: z.ZodObject<{
|
|
2612
2622
|
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2613
2623
|
kind: z.ZodLiteral<"place">;
|
|
2614
2624
|
id: z.ZodString;
|
|
@@ -2625,16 +2635,16 @@ declare const skippedSourceSchema: z.ZodObject<{
|
|
|
2625
2635
|
reason: z.ZodString;
|
|
2626
2636
|
}, z.core.$strip>;
|
|
2627
2637
|
/** @ignore */
|
|
2628
|
-
type SkippedSource = z.infer<typeof skippedSourceSchema>;
|
|
2638
|
+
export type SkippedSource = z.infer<typeof skippedSourceSchema>;
|
|
2629
2639
|
/** @ignore */
|
|
2630
|
-
type AffectedEntry = {
|
|
2640
|
+
export type AffectedEntry = {
|
|
2631
2641
|
/** Unqualified entry id within the owning slice. */
|
|
2632
2642
|
id: string;
|
|
2633
2643
|
/** Which slice the entry lives in (only kinds that carry analyses are tracked). */
|
|
2634
2644
|
kind: 'places' | 'customGeometries';
|
|
2635
2645
|
};
|
|
2636
2646
|
/** @ignore */
|
|
2637
|
-
type CollectedGeometries = {
|
|
2647
|
+
export type CollectedGeometries = {
|
|
2638
2648
|
geometries: PolygonFeature[];
|
|
2639
2649
|
/** Place objects whose footprints contributed (used to seed processData provenance). */
|
|
2640
2650
|
sourcePlaces: Place[];
|
|
@@ -2661,7 +2671,7 @@ type CollectedGeometries = {
|
|
|
2661
2671
|
*
|
|
2662
2672
|
* @ignore
|
|
2663
2673
|
*/
|
|
2664
|
-
declare const collectInputGeometries: (sources: readonly GeometriesId[], state: ToolState) => Promise<{
|
|
2674
|
+
export declare const collectInputGeometries: (sources: readonly GeometriesId[], state: ToolState) => Promise<{
|
|
2665
2675
|
value: CollectedGeometries;
|
|
2666
2676
|
} | {
|
|
2667
2677
|
error: string;
|
|
@@ -2674,7 +2684,7 @@ declare const collectInputGeometries: (sources: readonly GeometriesId[], state:
|
|
|
2674
2684
|
*
|
|
2675
2685
|
* @ignore
|
|
2676
2686
|
*/
|
|
2677
|
-
declare const findPlacesByEntry: (placesEntryIDs: readonly string[] | undefined, state: ToolState) => {
|
|
2687
|
+
export declare const findPlacesByEntry: (placesEntryIDs: readonly string[] | undefined, state: ToolState) => {
|
|
2678
2688
|
value: Record<string, Places> | undefined;
|
|
2679
2689
|
} | {
|
|
2680
2690
|
error: string;
|
|
@@ -2690,7 +2700,7 @@ type FeatureCollection<F> = {
|
|
|
2690
2700
|
*
|
|
2691
2701
|
* @ignore
|
|
2692
2702
|
*/
|
|
2693
|
-
type MultiInputIds = {
|
|
2703
|
+
export type MultiInputIds = {
|
|
2694
2704
|
placesEntryIDs?: readonly string[];
|
|
2695
2705
|
routesEntryIDs?: readonly string[];
|
|
2696
2706
|
incidentsEntryIDs?: readonly string[];
|
|
@@ -2703,7 +2713,7 @@ type MultiInputIds = {
|
|
|
2703
2713
|
*
|
|
2704
2714
|
* @ignore
|
|
2705
2715
|
*/
|
|
2706
|
-
type ResolvedEntries = {
|
|
2716
|
+
export type ResolvedEntries = {
|
|
2707
2717
|
places: PlacesEntry[];
|
|
2708
2718
|
routes: RoutesEntry[];
|
|
2709
2719
|
incidents: TrafficIncidentsEntry[];
|
|
@@ -2712,7 +2722,7 @@ type ResolvedEntries = {
|
|
|
2712
2722
|
};
|
|
2713
2723
|
/** Newest `timestamp` across every resolved source entry, or undefined when none carry one. The
|
|
2714
2724
|
* canonical `sampledAt` for a recurring sandbox run over these inputs. */
|
|
2715
|
-
declare const latestTimestamp: (resolved: ResolvedEntries) => number | undefined;
|
|
2725
|
+
export declare const latestTimestamp: (resolved: ResolvedEntries) => number | undefined;
|
|
2716
2726
|
/**
|
|
2717
2727
|
* Sandbox-facing inputs. Each kind is exposed as a single `<kind>ByEntry` record keyed by the entry id
|
|
2718
2728
|
* the caller passed in `<kind>EntryIDs`; the field is `undefined` when its kind wasn't requested. There
|
|
@@ -2721,7 +2731,7 @@ declare const latestTimestamp: (resolved: ResolvedEntries) => number | undefined
|
|
|
2721
2731
|
*
|
|
2722
2732
|
* @ignore
|
|
2723
2733
|
*/
|
|
2724
|
-
type SandboxInputs = {
|
|
2734
|
+
export type SandboxInputs = {
|
|
2725
2735
|
/**
|
|
2726
2736
|
* Per-entry places, keyed by entry id. Each value is a FeatureCollection of that one entry's places.
|
|
2727
2737
|
*/
|
|
@@ -2758,7 +2768,7 @@ type SandboxInputs = {
|
|
|
2758
2768
|
*
|
|
2759
2769
|
* @ignore
|
|
2760
2770
|
*/
|
|
2761
|
-
type GeometriesMeta = {
|
|
2771
|
+
export type GeometriesMeta = {
|
|
2762
2772
|
affectedEntries: AffectedEntry[];
|
|
2763
2773
|
sourceIds: GeometriesId[];
|
|
2764
2774
|
skipped: SkippedSource[];
|
|
@@ -2769,7 +2779,7 @@ type GeometriesMeta = {
|
|
|
2769
2779
|
*
|
|
2770
2780
|
* @ignore
|
|
2771
2781
|
*/
|
|
2772
|
-
type PreparedInputs = {
|
|
2782
|
+
export type PreparedInputs = {
|
|
2773
2783
|
resolved: ResolvedEntries;
|
|
2774
2784
|
sandbox: SandboxInputs;
|
|
2775
2785
|
geometries: GeometriesMeta;
|
|
@@ -2781,7 +2791,7 @@ type PreparedInputs = {
|
|
|
2781
2791
|
*
|
|
2782
2792
|
* @ignore
|
|
2783
2793
|
*/
|
|
2784
|
-
declare const prepareMultiInputs: (ids: MultiInputIds, state: ToolState) => Promise<{
|
|
2794
|
+
export declare const prepareMultiInputs: (ids: MultiInputIds, state: ToolState) => Promise<{
|
|
2785
2795
|
value: PreparedInputs;
|
|
2786
2796
|
} | {
|
|
2787
2797
|
error: string;
|
|
@@ -2794,11 +2804,11 @@ declare const prepareMultiInputs: (ids: MultiInputIds, state: ToolState) => Prom
|
|
|
2794
2804
|
*
|
|
2795
2805
|
* @ignore
|
|
2796
2806
|
*/
|
|
2797
|
-
declare const BY_ENTRY_VIEWS_DOC: string;
|
|
2807
|
+
export declare const BY_ENTRY_VIEWS_DOC: string;
|
|
2798
2808
|
/**
|
|
2799
2809
|
* @ignore
|
|
2800
2810
|
*/
|
|
2801
|
-
declare const routeUtils: {
|
|
2811
|
+
export declare const routeUtils: {
|
|
2802
2812
|
readonly calculateProgressAtRoutePoint: (route: Route, pathIndex: number) => import("@tomtom-org/maps-sdk/core").RouteProgressAtPoint | undefined;
|
|
2803
2813
|
readonly getCoordinateAtRouteProgress: (route: Route, query: import("@tomtom-org/maps-sdk/core").RouteProgressQuery) => import("@tomtom-org/maps-sdk/core").RouteCoordinateAtProgress | undefined;
|
|
2804
2814
|
readonly getProgressAtNearestRoutePoint: (route: Route, point: import("@tomtom-org/maps-sdk/core").HasLngLat) => import("@tomtom-org/maps-sdk/core").RouteCoordinateAtProgress | undefined;
|
|
@@ -2811,7 +2821,7 @@ declare const routeUtils: {
|
|
|
2811
2821
|
*
|
|
2812
2822
|
* @ignore
|
|
2813
2823
|
*/
|
|
2814
|
-
declare const MULTI_INPUT_SANDBOX_PARAMS: readonly ["placesByEntry", "routesByEntry", "incidentsByEntry", "geometriesByEntry", "trafficAreaAnalyticsByEntry", "byodByEntry", "h3", "turf", "routeUtils", "cluster"];
|
|
2824
|
+
export declare const MULTI_INPUT_SANDBOX_PARAMS: readonly ["placesByEntry", "routesByEntry", "incidentsByEntry", "geometriesByEntry", "trafficAreaAnalyticsByEntry", "byodByEntry", "h3", "turf", "routeUtils", "cluster"];
|
|
2815
2825
|
/**
|
|
2816
2826
|
* Common "tools available in the sandbox" prompt section, shared verbatim by
|
|
2817
2827
|
* analyseData and processData so the injected-library docs live in ONE place and the
|
|
@@ -2825,7 +2835,7 @@ declare const MULTI_INPUT_SANDBOX_PARAMS: readonly ["placesByEntry", "routesByEn
|
|
|
2825
2835
|
*
|
|
2826
2836
|
* @ignore
|
|
2827
2837
|
*/
|
|
2828
|
-
declare const buildSandboxToolsDoc: (active: readonly EntryDataKind[], scoped: boolean) => string;
|
|
2838
|
+
export declare const buildSandboxToolsDoc: (active: readonly EntryDataKind[], scoped: boolean) => string;
|
|
2829
2839
|
/**
|
|
2830
2840
|
* Pack `prepared.sandbox` into the positional argument array expected by
|
|
2831
2841
|
* `runSandboxedFn`, in the same order as {@link MULTI_INPUT_SANDBOX_PARAMS}.
|
|
@@ -2845,7 +2855,7 @@ declare const buildSandboxToolsDoc: (active: readonly EntryDataKind[], scoped: b
|
|
|
2845
2855
|
*
|
|
2846
2856
|
* @ignore
|
|
2847
2857
|
*/
|
|
2848
|
-
declare const packSandboxArgs: (sandbox: SandboxInputs, libs: {
|
|
2858
|
+
export declare const packSandboxArgs: (sandbox: SandboxInputs, libs: {
|
|
2849
2859
|
h3: unknown;
|
|
2850
2860
|
turf: unknown;
|
|
2851
2861
|
}) => readonly unknown[];
|
|
@@ -2858,18 +2868,18 @@ declare const packSandboxArgs: (sandbox: SandboxInputs, libs: {
|
|
|
2858
2868
|
*
|
|
2859
2869
|
* @ignore
|
|
2860
2870
|
*/
|
|
2861
|
-
declare const buildPlacesSchemaDoc: (flags: FeatureFlags) => string;
|
|
2871
|
+
export declare const buildPlacesSchemaDoc: (flags: FeatureFlags) => string;
|
|
2862
2872
|
/**
|
|
2863
2873
|
* Default-flag (`experimentalSearch: false`) Places schema doc — preserved as a
|
|
2864
2874
|
* named constant so non-flag-aware tools keep working.
|
|
2865
2875
|
*
|
|
2866
2876
|
* @ignore
|
|
2867
2877
|
*/
|
|
2868
|
-
declare const PLACES_SCHEMA_DOC: string;
|
|
2878
|
+
export declare const PLACES_SCHEMA_DOC: string;
|
|
2869
2879
|
//#endregion
|
|
2870
2880
|
//#region src/tools/shared/resolve-poi-categories.d.ts
|
|
2871
2881
|
/** Outcome of {@link resolvePoiCategories}. @ignore */
|
|
2872
|
-
type ResolvedPoiCategories = {
|
|
2882
|
+
export type ResolvedPoiCategories = {
|
|
2873
2883
|
/** Final search filter — known codes plus codes resolved from natural-language synonyms. */
|
|
2874
2884
|
resolved: POICategory[] | undefined;
|
|
2875
2885
|
/** Inputs that matched neither an exact code nor any synonym. */
|
|
@@ -2884,10 +2894,10 @@ type ResolvedPoiCategories = {
|
|
|
2884
2894
|
*
|
|
2885
2895
|
* @ignore
|
|
2886
2896
|
*/
|
|
2887
|
-
declare const resolvePoiCategories: (poiCategories: string[] | undefined) => Promise<ResolvedPoiCategories>;
|
|
2897
|
+
export declare const resolvePoiCategories: (poiCategories: string[] | undefined, options?: ToolExecuteOptions) => Promise<ResolvedPoiCategories>;
|
|
2888
2898
|
//#endregion
|
|
2889
2899
|
//#region src/tools/shared/resolve-range.d.ts
|
|
2890
|
-
declare const getRangePolygons: (state: ToolState, rangeId: string) => {
|
|
2900
|
+
export declare const getRangePolygons: (state: ToolState, rangeId: string) => {
|
|
2891
2901
|
polygons: (Polygon | MultiPolygon)[];
|
|
2892
2902
|
} | {
|
|
2893
2903
|
error: string;
|
|
@@ -2900,21 +2910,21 @@ declare const getRangePolygons: (state: ToolState, rangeId: string) => {
|
|
|
2900
2910
|
*
|
|
2901
2911
|
* @ignore
|
|
2902
2912
|
*/
|
|
2903
|
-
declare const positionSchema: z.ZodArray<z.ZodNumber>;
|
|
2913
|
+
export declare const positionSchema: z.ZodArray<z.ZodNumber>;
|
|
2904
2914
|
/** @ignore */
|
|
2905
|
-
declare const geoJsonBBoxSchema: z.ZodArray<z.ZodNumber>;
|
|
2915
|
+
export declare const geoJsonBBoxSchema: z.ZodArray<z.ZodNumber>;
|
|
2906
2916
|
/** @ignore */
|
|
2907
|
-
declare const polygonInputSchema: z.ZodObject<{
|
|
2917
|
+
export declare const polygonInputSchema: z.ZodObject<{
|
|
2908
2918
|
type: z.ZodLiteral<"Polygon">;
|
|
2909
2919
|
coordinates: z.ZodArray<z.ZodArray<z.ZodArray<z.ZodNumber>>>;
|
|
2910
2920
|
}, z.core.$strip>;
|
|
2911
2921
|
/** @ignore */
|
|
2912
|
-
declare const multiPolygonInputSchema: z.ZodObject<{
|
|
2922
|
+
export declare const multiPolygonInputSchema: z.ZodObject<{
|
|
2913
2923
|
type: z.ZodLiteral<"MultiPolygon">;
|
|
2914
2924
|
coordinates: z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodNumber>>>>;
|
|
2915
2925
|
}, z.core.$strip>;
|
|
2916
2926
|
/** @ignore */
|
|
2917
|
-
declare const geometryInputSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
2927
|
+
export declare const geometryInputSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
2918
2928
|
type: z.ZodLiteral<"Polygon">;
|
|
2919
2929
|
coordinates: z.ZodArray<z.ZodArray<z.ZodArray<z.ZodNumber>>>;
|
|
2920
2930
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -2929,7 +2939,7 @@ declare const geometryInputSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
2929
2939
|
*
|
|
2930
2940
|
* @ignore
|
|
2931
2941
|
*/
|
|
2932
|
-
declare const placesEntryIDsSchema: ({ verb, extra }: {
|
|
2942
|
+
export declare const placesEntryIDsSchema: ({ verb, extra }: {
|
|
2933
2943
|
verb: string;
|
|
2934
2944
|
extra?: string;
|
|
2935
2945
|
}) => z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -2939,7 +2949,7 @@ declare const placesEntryIDsSchema: ({ verb, extra }: {
|
|
|
2939
2949
|
*
|
|
2940
2950
|
* @ignore
|
|
2941
2951
|
*/
|
|
2942
|
-
declare const routesEntryIDsSchema: ({ verb, extra }: {
|
|
2952
|
+
export declare const routesEntryIDsSchema: ({ verb, extra }: {
|
|
2943
2953
|
verb: string;
|
|
2944
2954
|
extra?: string;
|
|
2945
2955
|
}) => z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -2951,7 +2961,7 @@ declare const routesEntryIDsSchema: ({ verb, extra }: {
|
|
|
2951
2961
|
*
|
|
2952
2962
|
* @ignore
|
|
2953
2963
|
*/
|
|
2954
|
-
declare const placesEntryIdHintSchema: z.ZodOptional<z.ZodString>;
|
|
2964
|
+
export declare const placesEntryIdHintSchema: z.ZodOptional<z.ZodString>;
|
|
2955
2965
|
/**
|
|
2956
2966
|
* Reusable `mode` field for show-on-map options that render polygons into an entry's
|
|
2957
2967
|
* own `GeometriesModule`. Controls how the new polygons combine with what is **already
|
|
@@ -2961,7 +2971,7 @@ declare const placesEntryIdHintSchema: z.ZodOptional<z.ZodString>;
|
|
|
2961
2971
|
*
|
|
2962
2972
|
* @ignore
|
|
2963
2973
|
*/
|
|
2964
|
-
declare const showModeSchema: z.ZodOptional<z.ZodEnum<{
|
|
2974
|
+
export declare const showModeSchema: z.ZodOptional<z.ZodEnum<{
|
|
2965
2975
|
add: "add";
|
|
2966
2976
|
replace: "replace";
|
|
2967
2977
|
}>>;
|
|
@@ -2972,7 +2982,7 @@ declare const showModeSchema: z.ZodOptional<z.ZodEnum<{
|
|
|
2972
2982
|
*
|
|
2973
2983
|
* @ignore
|
|
2974
2984
|
*/
|
|
2975
|
-
declare const showPlaceGeometriesSchema: z.ZodOptional<z.ZodObject<{
|
|
2985
|
+
export declare const showPlaceGeometriesSchema: z.ZodOptional<z.ZodObject<{
|
|
2976
2986
|
show: z.ZodOptional<z.ZodBoolean>;
|
|
2977
2987
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
2978
2988
|
add: "add";
|
|
@@ -2992,7 +3002,7 @@ declare const showPlaceGeometriesSchema: z.ZodOptional<z.ZodObject<{
|
|
|
2992
3002
|
*
|
|
2993
3003
|
* @ignore
|
|
2994
3004
|
*/
|
|
2995
|
-
declare const geometryDisplayConfigSchema: z.ZodObject<{
|
|
3005
|
+
export declare const geometryDisplayConfigSchema: z.ZodObject<{
|
|
2996
3006
|
theme: z.ZodOptional<z.ZodEnum<{
|
|
2997
3007
|
filled: "filled";
|
|
2998
3008
|
outline: "outline";
|
|
@@ -3011,9 +3021,9 @@ declare const geometryDisplayConfigSchema: z.ZodObject<{
|
|
|
3011
3021
|
*
|
|
3012
3022
|
* @ignore
|
|
3013
3023
|
*/
|
|
3014
|
-
declare const markerTypeSchema: z.ZodEnum<{
|
|
3015
|
-
"base-map": "base-map";
|
|
3024
|
+
export declare const markerTypeSchema: z.ZodEnum<{
|
|
3016
3025
|
pin: "pin";
|
|
3026
|
+
"base-map": "base-map";
|
|
3017
3027
|
"pin-clustered": "pin-clustered";
|
|
3018
3028
|
none: "none";
|
|
3019
3029
|
}>;
|
|
@@ -3025,12 +3035,12 @@ declare const markerTypeSchema: z.ZodEnum<{
|
|
|
3025
3035
|
*
|
|
3026
3036
|
* @ignore
|
|
3027
3037
|
*/
|
|
3028
|
-
declare const hidePreviousEntriesSchema: (entryNoun: string) => z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodArray<z.ZodString>]>>;
|
|
3038
|
+
export declare const hidePreviousEntriesSchema: (entryNoun: string) => z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodArray<z.ZodString>]>>;
|
|
3029
3039
|
/** @ignore */
|
|
3030
|
-
declare const showPlacesSchema: z.ZodObject<{
|
|
3040
|
+
export declare const showPlacesSchema: z.ZodObject<{
|
|
3031
3041
|
markerType: z.ZodEnum<{
|
|
3032
|
-
"base-map": "base-map";
|
|
3033
3042
|
pin: "pin";
|
|
3043
|
+
"base-map": "base-map";
|
|
3034
3044
|
"pin-clustered": "pin-clustered";
|
|
3035
3045
|
none: "none";
|
|
3036
3046
|
}>;
|
|
@@ -3041,7 +3051,7 @@ declare const showPlacesSchema: z.ZodObject<{
|
|
|
3041
3051
|
hidePreviousEntries: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodArray<z.ZodString>]>>;
|
|
3042
3052
|
}, z.core.$strip>;
|
|
3043
3053
|
/** @ignore */
|
|
3044
|
-
declare const shownSchema: z.ZodObject<{
|
|
3054
|
+
export declare const shownSchema: z.ZodObject<{
|
|
3045
3055
|
markerType: z.ZodBoolean;
|
|
3046
3056
|
zoomMode: z.ZodBoolean;
|
|
3047
3057
|
}, z.core.$strip>;
|
|
@@ -3054,7 +3064,7 @@ declare const shownSchema: z.ZodObject<{
|
|
|
3054
3064
|
*
|
|
3055
3065
|
* @ignore
|
|
3056
3066
|
*/
|
|
3057
|
-
declare const showByodSchema: z.ZodObject<{
|
|
3067
|
+
export declare const showByodSchema: z.ZodObject<{
|
|
3058
3068
|
zoomMode: z.ZodEnum<{
|
|
3059
3069
|
none: "none";
|
|
3060
3070
|
auto: "auto";
|
|
@@ -3062,7 +3072,7 @@ declare const showByodSchema: z.ZodObject<{
|
|
|
3062
3072
|
hidePreviousEntries: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodArray<z.ZodString>]>>;
|
|
3063
3073
|
}, z.core.$strip>;
|
|
3064
3074
|
/** @ignore */
|
|
3065
|
-
declare const shownByodSchema: z.ZodObject<{
|
|
3075
|
+
export declare const shownByodSchema: z.ZodObject<{
|
|
3066
3076
|
zoomMode: z.ZodBoolean;
|
|
3067
3077
|
}, z.core.$strip>;
|
|
3068
3078
|
/**
|
|
@@ -3070,7 +3080,7 @@ declare const shownByodSchema: z.ZodObject<{
|
|
|
3070
3080
|
* `viewport` flag. Spread into each consumer's `z.object({...})`.
|
|
3071
3081
|
* @ignore
|
|
3072
3082
|
*/
|
|
3073
|
-
declare const withinSharedFields: {
|
|
3083
|
+
export declare const withinSharedFields: {
|
|
3074
3084
|
mode: z.ZodLiteral<"within">;
|
|
3075
3085
|
viewport: z.ZodOptional<z.ZodLiteral<true>>;
|
|
3076
3086
|
};
|
|
@@ -3080,7 +3090,7 @@ declare const withinSharedFields: {
|
|
|
3080
3090
|
* postal codes, etc.). Optional everywhere; defaults to `'place'`.
|
|
3081
3091
|
* @ignore
|
|
3082
3092
|
*/
|
|
3083
|
-
declare const queryAsSchema: z.ZodOptional<z.ZodEnum<{
|
|
3093
|
+
export declare const queryAsSchema: z.ZodOptional<z.ZodEnum<{
|
|
3084
3094
|
poi: "poi";
|
|
3085
3095
|
place: "place";
|
|
3086
3096
|
}>>;
|
|
@@ -3088,7 +3098,7 @@ declare const queryAsSchema: z.ZodOptional<z.ZodEnum<{
|
|
|
3088
3098
|
* locatePlace's `within` schema — exactly one of viewport / boundingBox / query / placeId.
|
|
3089
3099
|
* @ignore
|
|
3090
3100
|
*/
|
|
3091
|
-
declare const withinWhereSchema: z.ZodObject<{
|
|
3101
|
+
export declare const withinWhereSchema: z.ZodObject<{
|
|
3092
3102
|
boundingBox: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
3093
3103
|
query: z.ZodOptional<z.ZodString>;
|
|
3094
3104
|
queryAs: z.ZodOptional<z.ZodEnum<{
|
|
@@ -3100,7 +3110,7 @@ declare const withinWhereSchema: z.ZodObject<{
|
|
|
3100
3110
|
viewport: z.ZodOptional<z.ZodLiteral<true>>;
|
|
3101
3111
|
}, z.core.$strip>;
|
|
3102
3112
|
/** @ignore */
|
|
3103
|
-
declare const nearbyWhereSchema: z.ZodObject<{
|
|
3113
|
+
export declare const nearbyWhereSchema: z.ZodObject<{
|
|
3104
3114
|
mode: z.ZodLiteral<"nearby">;
|
|
3105
3115
|
position: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
3106
3116
|
viewport: z.ZodOptional<z.ZodLiteral<true>>;
|
|
@@ -3112,7 +3122,7 @@ declare const nearbyWhereSchema: z.ZodObject<{
|
|
|
3112
3122
|
radiusMeters: z.ZodOptional<z.ZodNumber>;
|
|
3113
3123
|
}, z.core.$strip>;
|
|
3114
3124
|
/** @ignore */
|
|
3115
|
-
declare const globalWhereSchema: z.ZodObject<{
|
|
3125
|
+
export declare const globalWhereSchema: z.ZodObject<{
|
|
3116
3126
|
mode: z.ZodLiteral<"global">;
|
|
3117
3127
|
}, z.core.$strip>;
|
|
3118
3128
|
/**
|
|
@@ -3120,7 +3130,7 @@ declare const globalWhereSchema: z.ZodObject<{
|
|
|
3120
3130
|
* discoverPlaces builds its own union in discover-places.ts using the plural-form within schema.
|
|
3121
3131
|
* @ignore
|
|
3122
3132
|
*/
|
|
3123
|
-
declare const whereSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
3133
|
+
export declare const whereSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
3124
3134
|
boundingBox: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
3125
3135
|
query: z.ZodOptional<z.ZodString>;
|
|
3126
3136
|
queryAs: z.ZodOptional<z.ZodEnum<{
|
|
@@ -3148,7 +3158,7 @@ declare const whereSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
3148
3158
|
* Spread into each tool's `z.object({...})` alongside any tool-specific fields.
|
|
3149
3159
|
* @ignore
|
|
3150
3160
|
*/
|
|
3151
|
-
declare const sharedWithinFields: {
|
|
3161
|
+
export declare const sharedWithinFields: {
|
|
3152
3162
|
queries: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
3153
3163
|
query: z.ZodString;
|
|
3154
3164
|
queryAs: z.ZodOptional<z.ZodEnum<{
|
|
@@ -3178,7 +3188,7 @@ declare const sharedWithinFields: {
|
|
|
3178
3188
|
* stored isochrones and is resolved caller-side.
|
|
3179
3189
|
* @ignore
|
|
3180
3190
|
*/
|
|
3181
|
-
declare const areaWhereSchema: z.ZodObject<{
|
|
3191
|
+
export declare const areaWhereSchema: z.ZodObject<{
|
|
3182
3192
|
viewport: z.ZodOptional<z.ZodBoolean>;
|
|
3183
3193
|
boundingBox: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
3184
3194
|
queries: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -3202,10 +3212,10 @@ declare const areaWhereSchema: z.ZodObject<{
|
|
|
3202
3212
|
}, z.core.$strip>>;
|
|
3203
3213
|
}, z.core.$strip>;
|
|
3204
3214
|
/** The `where` fields resolve-where.ts resolves — inferred from {@link areaWhereSchema}. */
|
|
3205
|
-
type AreaWhere = z.infer<typeof areaWhereSchema>;
|
|
3215
|
+
export type AreaWhere = z.infer<typeof areaWhereSchema>;
|
|
3206
3216
|
//#endregion
|
|
3207
3217
|
//#region src/tools/shared/resolve-where.d.ts
|
|
3208
|
-
type WhereContext = {
|
|
3218
|
+
export type WhereContext = {
|
|
3209
3219
|
viewport(): {
|
|
3210
3220
|
bbox?: BBox;
|
|
3211
3221
|
center?: Position;
|
|
@@ -3220,16 +3230,16 @@ type WhereContext = {
|
|
|
3220
3230
|
error: string;
|
|
3221
3231
|
};
|
|
3222
3232
|
};
|
|
3223
|
-
type ResolveAreasOptions = {
|
|
3233
|
+
export type ResolveAreasOptions = {
|
|
3224
3234
|
kind: ResolveKind;
|
|
3225
3235
|
};
|
|
3226
|
-
type ResolveKind = 'within' | 'nearby' | 'global';
|
|
3227
|
-
type AreaSource = 'viewport' | 'boundingBox' | 'query' | 'placeId' | 'geometries' | 'route';
|
|
3228
|
-
declare function resolveWhere(opts: ResolveAreasOptions, where?: AreaWhere, ctx?: WhereContext): Promise<ResolveError | ResolvedArea[]> | ResolvedBias | Promise<ResolvedBias>;
|
|
3229
|
-
declare const resolveWithin: (where: AreaWhere, ctx: WhereContext) => Promise<ResolvedArea[] | ResolveError>;
|
|
3230
|
-
declare const resolveNearby: (where: AreaWhere, ctx: WhereContext) => Promise<ResolvedBias>;
|
|
3231
|
-
declare const resolveGlobal: () => ResolvedBias;
|
|
3232
|
-
type ResolvedArea = {
|
|
3236
|
+
export type ResolveKind = 'within' | 'nearby' | 'global';
|
|
3237
|
+
export type AreaSource = 'viewport' | 'boundingBox' | 'query' | 'placeId' | 'geometries' | 'route';
|
|
3238
|
+
export declare function resolveWhere(opts: ResolveAreasOptions, where?: AreaWhere, ctx?: WhereContext): Promise<ResolveError | ResolvedArea[]> | ResolvedBias | Promise<ResolvedBias>;
|
|
3239
|
+
export declare const resolveWithin: (where: AreaWhere, ctx: WhereContext) => Promise<ResolvedArea[] | ResolveError>;
|
|
3240
|
+
export declare const resolveNearby: (where: AreaWhere, ctx: WhereContext) => Promise<ResolvedBias>;
|
|
3241
|
+
export declare const resolveGlobal: () => ResolvedBias;
|
|
3242
|
+
export type ResolvedArea = {
|
|
3233
3243
|
bbox: BBox;
|
|
3234
3244
|
polygon?: Polygon | MultiPolygon;
|
|
3235
3245
|
/** The GROUNDED match label — `freeformAddress, <countryCode>` for a `query` area — i.e. what the
|
|
@@ -3241,19 +3251,19 @@ type ResolvedArea = {
|
|
|
3241
3251
|
* grounded `label` ("matched"). Absent for non-query sources. */
|
|
3242
3252
|
query?: string;
|
|
3243
3253
|
};
|
|
3244
|
-
type ResolveError = {
|
|
3254
|
+
export type ResolveError = {
|
|
3245
3255
|
error: string;
|
|
3246
3256
|
};
|
|
3247
|
-
type ResolvedBias = {
|
|
3257
|
+
export type ResolvedBias = {
|
|
3248
3258
|
position?: Position;
|
|
3249
3259
|
label?: string;
|
|
3250
3260
|
query?: string;
|
|
3251
3261
|
};
|
|
3252
|
-
type ResolvedAreaDisclosure = {
|
|
3262
|
+
export type ResolvedAreaDisclosure = {
|
|
3253
3263
|
query?: string;
|
|
3254
3264
|
matched: string;
|
|
3255
3265
|
};
|
|
3256
|
-
declare const isResolveError: (r: unknown) => r is ResolveError;
|
|
3266
|
+
export declare const isResolveError: (r: unknown) => r is ResolveError;
|
|
3257
3267
|
//#endregion
|
|
3258
3268
|
//#region src/tools/shared/routes-schema-doc.d.ts
|
|
3259
3269
|
/**
|
|
@@ -3265,7 +3275,7 @@ declare const isResolveError: (r: unknown) => r is ResolveError;
|
|
|
3265
3275
|
* Only the non-GeoJSON-standard bits are spelled out — `Route` is a LineString Feature.
|
|
3266
3276
|
*/
|
|
3267
3277
|
/** @ignore */
|
|
3268
|
-
declare const ROUTES_SCHEMA_DOC: string;
|
|
3278
|
+
export declare const ROUTES_SCHEMA_DOC: string;
|
|
3269
3279
|
//#endregion
|
|
3270
3280
|
//#region src/tools/shared/show-byod-on-map.d.ts
|
|
3271
3281
|
/**
|
|
@@ -3276,11 +3286,11 @@ declare const ROUTES_SCHEMA_DOC: string;
|
|
|
3276
3286
|
*
|
|
3277
3287
|
* @ignore
|
|
3278
3288
|
*/
|
|
3279
|
-
declare const showByodOnMap: (state: ToolState, byodEntryId: string, show: z.infer<typeof showByodSchema>) => Promise<z.infer<typeof shownByodSchema>>;
|
|
3289
|
+
export declare const showByodOnMap: (state: ToolState, byodEntryId: string, show: z.infer<typeof showByodSchema>) => Promise<z.infer<typeof shownByodSchema>>;
|
|
3280
3290
|
//#endregion
|
|
3281
3291
|
//#region src/tools/shared/show-entry-geometries.d.ts
|
|
3282
3292
|
/** @ignore */
|
|
3283
|
-
type ShowEntryGeometriesResult = {
|
|
3293
|
+
export type ShowEntryGeometriesResult = {
|
|
3284
3294
|
fetched: number;
|
|
3285
3295
|
shown: boolean;
|
|
3286
3296
|
};
|
|
@@ -3293,24 +3303,24 @@ type ShowEntryGeometriesResult = {
|
|
|
3293
3303
|
*
|
|
3294
3304
|
* @ignore
|
|
3295
3305
|
*/
|
|
3296
|
-
declare const showEntryGeometries: (state: ToolState, placesEntryId: string, config: NonNullable<z.infer<typeof showPlaceGeometriesSchema
|
|
3306
|
+
export declare const showEntryGeometries: (state: ToolState, placesEntryId: string, config: NonNullable<z.infer<typeof showPlaceGeometriesSchema>>, options?: ToolExecuteOptions) => Promise<ShowEntryGeometriesResult>;
|
|
3297
3307
|
//#endregion
|
|
3298
3308
|
//#region src/tools/shared/show-places-on-map.d.ts
|
|
3299
3309
|
/** @ignore */
|
|
3300
|
-
declare const showResultsOnMap: (state: ToolState, placesEntryIds: readonly string[], show: z.infer<typeof showPlacesSchema>) => Promise<z.infer<typeof shownSchema>>;
|
|
3310
|
+
export declare const showResultsOnMap: (state: ToolState, placesEntryIds: readonly string[], show: z.infer<typeof showPlacesSchema>) => Promise<z.infer<typeof shownSchema>>;
|
|
3301
3311
|
//#endregion
|
|
3302
3312
|
//#region src/tools/shared/tool-state-where-context.d.ts
|
|
3303
3313
|
/** Adapts the live `ToolState` to the narrow `WhereContext` the resolver depends on. Keeping this
|
|
3304
3314
|
* mapping in one place is what lets resolveAreas stay testable without a ToolState. */
|
|
3305
|
-
declare const toolStateToWhereContext: (state: ToolState) => WhereContext;
|
|
3315
|
+
export declare const toolStateToWhereContext: (state: ToolState, options?: ToolExecuteOptions) => WhereContext;
|
|
3306
3316
|
//#endregion
|
|
3307
3317
|
//#region src/tools/shared/viewport-bias.d.ts
|
|
3308
3318
|
/** @ignore */
|
|
3309
|
-
declare const MIN_VIEWPORT_BIAS_ZOOM = 6;
|
|
3319
|
+
export declare const MIN_VIEWPORT_BIAS_ZOOM = 6;
|
|
3310
3320
|
/** @ignore */
|
|
3311
|
-
declare const getViewportBias: (map: BaseMapState, minZoom?: number) => Position | undefined;
|
|
3321
|
+
export declare const getViewportBias: (map: BaseMapState, minZoom?: number) => Position | undefined;
|
|
3312
3322
|
/** @ignore */
|
|
3313
|
-
declare const getViewportBoundingBox: (map: BaseMapState) => BBox;
|
|
3323
|
+
export declare const getViewportBoundingBox: (map: BaseMapState) => BBox;
|
|
3314
3324
|
//#endregion
|
|
3315
3325
|
//#region src/state/custom-geometries/entry.d.ts
|
|
3316
3326
|
/**
|
|
@@ -3504,7 +3514,7 @@ type DataEntryConfig = {
|
|
|
3504
3514
|
*
|
|
3505
3515
|
* @group Agent Toolkit
|
|
3506
3516
|
*/
|
|
3507
|
-
declare const DATA_ENTRY_KIND_TO_SLICE: {
|
|
3517
|
+
export declare const DATA_ENTRY_KIND_TO_SLICE: {
|
|
3508
3518
|
readonly places: "places";
|
|
3509
3519
|
readonly routes: "routing";
|
|
3510
3520
|
readonly incidents: "trafficIncidents";
|
|
@@ -3533,7 +3543,7 @@ type EntryModeSliceName = { [K in keyof ToolState]: ToolState[K] extends EntryMo
|
|
|
3533
3543
|
*
|
|
3534
3544
|
* @group Agent Toolkit
|
|
3535
3545
|
*/
|
|
3536
|
-
declare const ENTRY_MODE_SLICE_NAMES: readonly EntryModeSliceName[];
|
|
3546
|
+
export declare const ENTRY_MODE_SLICE_NAMES: readonly EntryModeSliceName[];
|
|
3537
3547
|
/**
|
|
3538
3548
|
* State slice that owns a set of "entries" (routes, ranges) where each entry can be hidden
|
|
3539
3549
|
* individually by id and the slice exposes the currently-shown set. Implemented by
|
|
@@ -3769,7 +3779,7 @@ type SystemPromptSectionOverrides = Partial<Record<SystemPromptSection, string>>
|
|
|
3769
3779
|
*
|
|
3770
3780
|
* @group Agent Toolkit
|
|
3771
3781
|
*/
|
|
3772
|
-
declare const SYSTEM_PROMPT_SECTIONS: Record<SystemPromptSection, string>;
|
|
3782
|
+
export declare const SYSTEM_PROMPT_SECTIONS: Record<SystemPromptSection, string>;
|
|
3773
3783
|
/**
|
|
3774
3784
|
* Composes the base system prompt from {@link SYSTEM_PROMPT_SECTIONS}, applying
|
|
3775
3785
|
* any per-section overrides.
|
|
@@ -3795,7 +3805,7 @@ declare const SYSTEM_PROMPT_SECTIONS: Record<SystemPromptSection, string>;
|
|
|
3795
3805
|
*
|
|
3796
3806
|
* @group Agent Toolkit
|
|
3797
3807
|
*/
|
|
3798
|
-
declare const composeSystemPrompt: (overrides?: SystemPromptSectionOverrides) => string;
|
|
3808
|
+
export declare const composeSystemPrompt: (overrides?: SystemPromptSectionOverrides) => string;
|
|
3799
3809
|
/**
|
|
3800
3810
|
* The base system prompt that teaches the LLM how to use the agent toolkit tools.
|
|
3801
3811
|
*
|
|
@@ -3817,7 +3827,7 @@ declare const composeSystemPrompt: (overrides?: SystemPromptSectionOverrides) =>
|
|
|
3817
3827
|
*
|
|
3818
3828
|
* @group Agent Toolkit
|
|
3819
3829
|
*/
|
|
3820
|
-
declare const BASE_SYSTEM_PROMPT: string;
|
|
3830
|
+
export declare const BASE_SYSTEM_PROMPT: string;
|
|
3821
3831
|
/**
|
|
3822
3832
|
* Inputs to {@link buildSystemPrompt}.
|
|
3823
3833
|
*
|
|
@@ -3852,7 +3862,7 @@ type BuildSystemPromptOptions = {
|
|
|
3852
3862
|
* @internal
|
|
3853
3863
|
* @ignore
|
|
3854
3864
|
*/
|
|
3855
|
-
declare const buildSystemPrompt: ({ customPrompt, prefix, suffix }?: BuildSystemPromptOptions) => string;
|
|
3865
|
+
export declare const buildSystemPrompt: ({ customPrompt, prefix, suffix }?: BuildSystemPromptOptions) => string;
|
|
3856
3866
|
//#endregion
|
|
3857
3867
|
//#region src/tools/tool-registry.d.ts
|
|
3858
3868
|
/**
|
|
@@ -3865,7 +3875,7 @@ declare const buildSystemPrompt: ({ customPrompt, prefix, suffix }?: BuildSystem
|
|
|
3865
3875
|
*
|
|
3866
3876
|
* @group Agent Toolkit
|
|
3867
3877
|
*/
|
|
3868
|
-
declare const DEFAULT_TOOLS: {
|
|
3878
|
+
export declare const DEFAULT_TOOLS: {
|
|
3869
3879
|
locatePlace: ToolDefinition;
|
|
3870
3880
|
reverseGeocode: ToolDefinition;
|
|
3871
3881
|
discoverPlaces: ToolDefinition;
|
|
@@ -3904,6 +3914,8 @@ declare const DEFAULT_TOOLS: {
|
|
|
3904
3914
|
setLanguage: ToolDefinition;
|
|
3905
3915
|
toggleTilesBaseMapLayerGroups: ToolDefinition;
|
|
3906
3916
|
toggleTilesPOIs: ToolDefinition;
|
|
3917
|
+
describeMapStyling: ToolDefinition;
|
|
3918
|
+
setMapStyling: ToolDefinition;
|
|
3907
3919
|
toggleTilesTrafficFlow: ToolDefinition;
|
|
3908
3920
|
toggleTilesTrafficIncidents: ToolDefinition;
|
|
3909
3921
|
getMapStyleLayers: ToolDefinition;
|
|
@@ -3932,7 +3944,7 @@ type ToolName = keyof typeof DEFAULT_TOOLS;
|
|
|
3932
3944
|
*
|
|
3933
3945
|
* @group Agent Toolkit
|
|
3934
3946
|
*/
|
|
3935
|
-
declare const TOOL_NAMES: ToolName[];
|
|
3947
|
+
export declare const TOOL_NAMES: ToolName[];
|
|
3936
3948
|
/**
|
|
3937
3949
|
* Default tool names that should be dropped from the registry when a {@link DataEntryKind}
|
|
3938
3950
|
* is disabled. Only default-tool names are listed here — user-supplied custom tools are
|
|
@@ -3944,7 +3956,7 @@ declare const TOOL_NAMES: ToolName[];
|
|
|
3944
3956
|
*
|
|
3945
3957
|
* @group Agent Toolkit
|
|
3946
3958
|
*/
|
|
3947
|
-
declare const TOOLS_BY_DATA_ENTRY_KIND: Record<DataEntryKind, readonly ToolName[]>;
|
|
3959
|
+
export declare const TOOLS_BY_DATA_ENTRY_KIND: Record<DataEntryKind, readonly ToolName[]>;
|
|
3948
3960
|
/**
|
|
3949
3961
|
* Returns each default tool's `examplePrompts` keyed by tool name. Builders are
|
|
3950
3962
|
* materialised with empty {@link ToolBuildOptions} so the prompts reflect the
|
|
@@ -3955,7 +3967,7 @@ declare const TOOLS_BY_DATA_ENTRY_KIND: Record<DataEntryKind, readonly ToolName[
|
|
|
3955
3967
|
*
|
|
3956
3968
|
* @group Agent Toolkit
|
|
3957
3969
|
*/
|
|
3958
|
-
declare const getDefaultToolPrompts: () => Record<ToolName, readonly string[]>;
|
|
3970
|
+
export declare const getDefaultToolPrompts: () => Record<ToolName, readonly string[]>;
|
|
3959
3971
|
//#endregion
|
|
3960
3972
|
//#region src/utils/types/intent-classifier.d.ts
|
|
3961
3973
|
/**
|
|
@@ -4025,14 +4037,14 @@ type ConversationMessage = {
|
|
|
4025
4037
|
*
|
|
4026
4038
|
* @group Agent Toolkit
|
|
4027
4039
|
*/
|
|
4028
|
-
declare const classifyUserIntent: (conversation: ConversationMessage[], options: ClassifierOptions) => Promise<ClassificationResult>;
|
|
4040
|
+
export declare const classifyUserIntent: (conversation: ConversationMessage[], options: ClassifierOptions) => Promise<ClassificationResult>;
|
|
4029
4041
|
/**
|
|
4030
4042
|
* Extracts the text content of the last user message in a message array.
|
|
4031
4043
|
* Returns null if no user message is found or if content has no text.
|
|
4032
4044
|
*
|
|
4033
4045
|
* @group Agent Toolkit
|
|
4034
4046
|
*/
|
|
4035
|
-
declare const extractLastUserText: (messages: ReadonlyArray<ModelMessage>) => string | null;
|
|
4047
|
+
export declare const extractLastUserText: (messages: ReadonlyArray<ModelMessage>) => string | null;
|
|
4036
4048
|
/**
|
|
4037
4049
|
* Creates the default LLM-based classifier. Uses structured generation to select
|
|
4038
4050
|
* the minimal tool set for each user message.
|
|
@@ -4043,7 +4055,7 @@ declare const extractLastUserText: (messages: ReadonlyArray<ModelMessage>) => st
|
|
|
4043
4055
|
*
|
|
4044
4056
|
* @group Agent Toolkit
|
|
4045
4057
|
*/
|
|
4046
|
-
declare const createDefaultClassifier: (options: {
|
|
4058
|
+
export declare const createDefaultClassifier: (options: {
|
|
4047
4059
|
model: LanguageModel;
|
|
4048
4060
|
maxHistoryMessages?: number;
|
|
4049
4061
|
maxHistoryMessageLength?: number;
|
|
@@ -4060,7 +4072,7 @@ type ProviderOptions = Record<string, Record<string, JSONValue | undefined>>;
|
|
|
4060
4072
|
*
|
|
4061
4073
|
* @group Agent Toolkit
|
|
4062
4074
|
*/
|
|
4063
|
-
type ToolNameHint = ToolName | (string & {});
|
|
4075
|
+
export type ToolNameHint = ToolName | (string & {});
|
|
4064
4076
|
/**
|
|
4065
4077
|
* Tool-facing union of state slices that own analysable entries — the
|
|
4066
4078
|
* vocabulary used by tools that read from multiple slices (`analyseData`,
|
|
@@ -4075,7 +4087,7 @@ type ToolNameHint = ToolName | (string & {});
|
|
|
4075
4087
|
*
|
|
4076
4088
|
* @group Agent Toolkit
|
|
4077
4089
|
*/
|
|
4078
|
-
type EntryDataKind = 'places' | 'routes' | 'incidents' | 'customGeometries' | 'trafficAreaAnalytics' | 'byod';
|
|
4090
|
+
export type EntryDataKind = 'places' | 'routes' | 'incidents' | 'customGeometries' | 'trafficAreaAnalytics' | 'byod';
|
|
4079
4091
|
/**
|
|
4080
4092
|
* State passed to tool factory functions. Organized by feature area,
|
|
4081
4093
|
* each sub-state mixes lazy module access with the current service data
|
|
@@ -4096,7 +4108,7 @@ type EntryDataKind = 'places' | 'routes' | 'incidents' | 'customGeometries' | 't
|
|
|
4096
4108
|
* }
|
|
4097
4109
|
* ```
|
|
4098
4110
|
*/
|
|
4099
|
-
type ToolState = {
|
|
4111
|
+
export type ToolState = {
|
|
4100
4112
|
/** Places layer: PlacesModule plus an append-only search history. */
|
|
4101
4113
|
places: PlacesState;
|
|
4102
4114
|
/** Map POI layer: visibility, filtering, and category management. */
|
|
@@ -4153,7 +4165,7 @@ type ToolState = {
|
|
|
4153
4165
|
*
|
|
4154
4166
|
* @group Agent Toolkit
|
|
4155
4167
|
*/
|
|
4156
|
-
type CodeExecutionConfig = {
|
|
4168
|
+
export type CodeExecutionConfig = {
|
|
4157
4169
|
/** Wall-clock budget per isolated (browser) run, in ms. Default: 5000. */
|
|
4158
4170
|
timeoutMs?: number;
|
|
4159
4171
|
/**
|
|
@@ -4164,6 +4176,23 @@ type CodeExecutionConfig = {
|
|
|
4164
4176
|
*/
|
|
4165
4177
|
loadWorkerLibrarySource?: () => string | Promise<string>;
|
|
4166
4178
|
};
|
|
4179
|
+
/**
|
|
4180
|
+
* Per-call options handed to a tool's `execute`, separate from its parsed input.
|
|
4181
|
+
*
|
|
4182
|
+
* `signal` is the AI SDK's own `abortSignal` for the tool call — it fires when the model's
|
|
4183
|
+
* turn is cancelled. Forward it to any `@tomtom-org/maps-sdk/services` call the tool makes
|
|
4184
|
+
* (as `signal`) so a cancelled turn also cancels its in-flight HTTP requests.
|
|
4185
|
+
*
|
|
4186
|
+
* Do NOT forward it into work that outlives the turn — a monitor's recurring tick, or any
|
|
4187
|
+
* deferred job. Those fire after the signal has aborted, and a monitor treats a rejected tick
|
|
4188
|
+
* as fatal (it clears its own interval), so a leaked signal kills the monitor rather than
|
|
4189
|
+
* cancelling a request.
|
|
4190
|
+
*
|
|
4191
|
+
* @group Agent Toolkit
|
|
4192
|
+
*/
|
|
4193
|
+
export type ToolExecuteOptions = {
|
|
4194
|
+
signal?: AbortSignal;
|
|
4195
|
+
};
|
|
4167
4196
|
/**
|
|
4168
4197
|
* A tool definition — the universal format for both built-in and third-party tools.
|
|
4169
4198
|
* Combines execution (inputSchema + execute) with classifier metadata.
|
|
@@ -4177,7 +4206,7 @@ type CodeExecutionConfig = {
|
|
|
4177
4206
|
*
|
|
4178
4207
|
* @group Agent Toolkit
|
|
4179
4208
|
*/
|
|
4180
|
-
type ToolEntry<S extends ToolState = ToolState, Scope = unknown> = {
|
|
4209
|
+
export type ToolEntry<S extends ToolState = ToolState, Scope = unknown> = {
|
|
4181
4210
|
/** Description of the tool's purpose. */
|
|
4182
4211
|
description: string;
|
|
4183
4212
|
/** Zod schema defining the tool's input parameters. */
|
|
@@ -4193,7 +4222,7 @@ type ToolEntry<S extends ToolState = ToolState, Scope = unknown> = {
|
|
|
4193
4222
|
* This tags the request so TomTom's traffic analytics attribute it to agent-toolkit; an
|
|
4194
4223
|
* untagged call is picked up by the guard test in `tools/shared/tests/agent-headers.test.ts`.
|
|
4195
4224
|
*/
|
|
4196
|
-
execute: (input: any, state: S) => Promise<any>;
|
|
4225
|
+
execute: (input: any, state: S, options?: ToolExecuteOptions) => Promise<any>;
|
|
4197
4226
|
/** Compact one-liner for the intent classifier prompt. */
|
|
4198
4227
|
classificationPrompt?: string;
|
|
4199
4228
|
/** Category tags (e.g. 'location', 'routing'). */
|
|
@@ -4243,7 +4272,7 @@ type ToolEntry<S extends ToolState = ToolState, Scope = unknown> = {
|
|
|
4243
4272
|
*
|
|
4244
4273
|
* @group Agent Toolkit
|
|
4245
4274
|
*/
|
|
4246
|
-
type ToolMetadata = {
|
|
4275
|
+
export type ToolMetadata = {
|
|
4247
4276
|
/** Tool identifier, derived from the config key. */
|
|
4248
4277
|
name: string;
|
|
4249
4278
|
/** Description of the tool's purpose. Used by the SDK's system prompt. */
|
|
@@ -4272,7 +4301,7 @@ type ToolMetadata = {
|
|
|
4272
4301
|
*
|
|
4273
4302
|
* @group Agent Toolkit
|
|
4274
4303
|
*/
|
|
4275
|
-
type ClassifierContext = {
|
|
4304
|
+
export type ClassifierContext = {
|
|
4276
4305
|
/** Full message history for the current conversation. */
|
|
4277
4306
|
messages: ReadonlyArray<ModelMessage>;
|
|
4278
4307
|
/** Metadata for all registered tools. */
|
|
@@ -4284,7 +4313,7 @@ type ClassifierContext = {
|
|
|
4284
4313
|
*
|
|
4285
4314
|
* @group Agent Toolkit
|
|
4286
4315
|
*/
|
|
4287
|
-
type Classifier = (context: ClassifierContext) => Promise<ClassificationResult | null>;
|
|
4316
|
+
export type Classifier = (context: ClassifierContext) => Promise<ClassificationResult | null>;
|
|
4288
4317
|
/**
|
|
4289
4318
|
* Feature-flag bag for {@link createMapAgent}. Toggles in-flight or
|
|
4290
4319
|
* opt-in agent-toolkit behaviour. Individual flags vary in stability —
|
|
@@ -4296,7 +4325,7 @@ type Classifier = (context: ClassifierContext) => Promise<ClassificationResult |
|
|
|
4296
4325
|
*
|
|
4297
4326
|
* @group Agent Toolkit
|
|
4298
4327
|
*/
|
|
4299
|
-
type FeatureFlags = {
|
|
4328
|
+
export type FeatureFlags = {
|
|
4300
4329
|
/**
|
|
4301
4330
|
* Route `discoverPlaces` through the experimental exploration search
|
|
4302
4331
|
* backend (and expose its richer input surface — `municipalities`,
|
|
@@ -4325,7 +4354,7 @@ type FeatureFlags = {
|
|
|
4325
4354
|
*
|
|
4326
4355
|
* @group Agent Toolkit
|
|
4327
4356
|
*/
|
|
4328
|
-
type ToolBuildOptions<Scope = unknown> = {
|
|
4357
|
+
export type ToolBuildOptions<Scope = unknown> = {
|
|
4329
4358
|
/** Active feature flags. */
|
|
4330
4359
|
featureFlags?: FeatureFlags;
|
|
4331
4360
|
/**
|
|
@@ -4356,7 +4385,7 @@ type ToolBuildOptions<Scope = unknown> = {
|
|
|
4356
4385
|
*
|
|
4357
4386
|
* @group Agent Toolkit
|
|
4358
4387
|
*/
|
|
4359
|
-
type ToolEntryBuilder<S extends ToolState = ToolState, Scope = unknown> = (options: ToolBuildOptions<Scope>) => ToolEntry<S, Scope>;
|
|
4388
|
+
export type ToolEntryBuilder<S extends ToolState = ToolState, Scope = unknown> = (options: ToolBuildOptions<Scope>) => ToolEntry<S, Scope>;
|
|
4360
4389
|
/**
|
|
4361
4390
|
* A registered tool definition: either a static {@link ToolEntry} or a
|
|
4362
4391
|
* {@link ToolEntryBuilder} that builds one from {@link ToolBuildOptions} at
|
|
@@ -4369,13 +4398,13 @@ type ToolEntryBuilder<S extends ToolState = ToolState, Scope = unknown> = (optio
|
|
|
4369
4398
|
*
|
|
4370
4399
|
* @group Agent Toolkit
|
|
4371
4400
|
*/
|
|
4372
|
-
type ToolDefinition<S extends ToolState = ToolState, Scope = any> = ToolEntry<S, Scope> | ToolEntryBuilder<S, Scope>;
|
|
4401
|
+
export type ToolDefinition<S extends ToolState = ToolState, Scope = any> = ToolEntry<S, Scope> | ToolEntryBuilder<S, Scope>;
|
|
4373
4402
|
/**
|
|
4374
4403
|
* Per-tool execution outcome reported to {@link MapAgentOptions.onToolExecute}.
|
|
4375
4404
|
*
|
|
4376
4405
|
* @group Agent Toolkit
|
|
4377
4406
|
*/
|
|
4378
|
-
type ToolExecutionInfo = {
|
|
4407
|
+
export type ToolExecutionInfo = {
|
|
4379
4408
|
/** Registered tool name (the `defaultTools` key). */
|
|
4380
4409
|
toolName: string;
|
|
4381
4410
|
/** Wall-clock duration of `execute`, in milliseconds (includes any network/IO). */
|
|
@@ -4390,7 +4419,7 @@ type ToolExecutionInfo = {
|
|
|
4390
4419
|
*
|
|
4391
4420
|
* @group Agent Toolkit
|
|
4392
4421
|
*/
|
|
4393
|
-
type OnToolExecute = (info: ToolExecutionInfo) => void;
|
|
4422
|
+
export type OnToolExecute = (info: ToolExecutionInfo) => void;
|
|
4394
4423
|
/**
|
|
4395
4424
|
* Options for creating an agent toolkit.
|
|
4396
4425
|
*
|
|
@@ -4410,7 +4439,7 @@ type OnToolExecute = (info: ToolExecutionInfo) => void;
|
|
|
4410
4439
|
* });
|
|
4411
4440
|
* ```
|
|
4412
4441
|
*/
|
|
4413
|
-
type MapAgentOptions<CS extends ToolState = ToolState> = {
|
|
4442
|
+
export type MapAgentOptions<CS extends ToolState = ToolState> = {
|
|
4414
4443
|
/** AI SDK language model instance. REQUIRED — no default provider. */
|
|
4415
4444
|
model: LanguageModel;
|
|
4416
4445
|
/**
|
|
@@ -4614,7 +4643,7 @@ type MapAgentOptions<CS extends ToolState = ToolState> = {
|
|
|
4614
4643
|
*
|
|
4615
4644
|
* @group Agent Toolkit
|
|
4616
4645
|
*/
|
|
4617
|
-
type MapAgentInstance<CS extends ToolState = ToolState> = ToolLoopAgent & {
|
|
4646
|
+
export type MapAgentInstance<CS extends ToolState = ToolState> = ToolLoopAgent & {
|
|
4618
4647
|
/** Live agent state (built-in + custom slices). */
|
|
4619
4648
|
readonly state: CS;
|
|
4620
4649
|
/** Tear down: resets all state slices that have a reset() method. */
|
|
@@ -4659,7 +4688,7 @@ type MapAgentInstance<CS extends ToolState = ToolState> = ToolLoopAgent & {
|
|
|
4659
4688
|
* ```
|
|
4660
4689
|
* @group Agent Toolkit
|
|
4661
4690
|
*/
|
|
4662
|
-
declare const createMapAgent: <CS extends ToolState = ToolState>(map: TomTomMap, options: MapAgentOptions<CS>) => MapAgentInstance<CS>;
|
|
4691
|
+
export declare const createMapAgent: <CS extends ToolState = ToolState>(map: TomTomMap, options: MapAgentOptions<CS>) => MapAgentInstance<CS>;
|
|
4663
4692
|
//#endregion
|
|
4664
4693
|
//#region src/resolve-tools.d.ts
|
|
4665
4694
|
/**
|
|
@@ -4679,11 +4708,11 @@ declare const createMapAgent: <CS extends ToolState = ToolState>(map: TomTomMap,
|
|
|
4679
4708
|
*
|
|
4680
4709
|
* @group Agent Toolkit
|
|
4681
4710
|
*/
|
|
4682
|
-
declare const resolveTools: <S extends ToolState>(defaults: Record<string, ToolDefinition<S>>, overrides?: { [K in ToolNameHint]?: ToolEntry<S> | false | undefined; }) => Record<string, ToolDefinition<S>>;
|
|
4711
|
+
export declare const resolveTools: <S extends ToolState>(defaults: Record<string, ToolDefinition<S>>, overrides?: { [K in ToolNameHint]?: ToolEntry<S> | false | undefined; }) => Record<string, ToolDefinition<S>>;
|
|
4683
4712
|
//#endregion
|
|
4684
4713
|
//#region src/tools/utilities/clarify-user-intent.d.ts
|
|
4685
4714
|
/** A single clarification question shown to the user. Exported so a host can type its form state. */
|
|
4686
|
-
declare const questionSchema: z.ZodObject<{
|
|
4715
|
+
export declare const questionSchema: z.ZodObject<{
|
|
4687
4716
|
id: z.ZodString;
|
|
4688
4717
|
question: z.ZodString;
|
|
4689
4718
|
options: z.ZodArray<z.ZodString>;
|
|
@@ -4694,7 +4723,7 @@ type ClarifyIntentQuestion = z.infer<typeof questionSchema>;
|
|
|
4694
4723
|
/**
|
|
4695
4724
|
* Input schema for {@link executeClarifyIntent}.
|
|
4696
4725
|
*/
|
|
4697
|
-
declare const clarifyIntentSchema: z.ZodObject<{
|
|
4726
|
+
export declare const clarifyIntentSchema: z.ZodObject<{
|
|
4698
4727
|
intro: z.ZodOptional<z.ZodString>;
|
|
4699
4728
|
questions: z.ZodArray<z.ZodObject<{
|
|
4700
4729
|
id: z.ZodString;
|
|
@@ -4710,7 +4739,7 @@ declare const clarifyIntentSchema: z.ZodObject<{
|
|
|
4710
4739
|
* (CLARIFY_FORM_PROMPT and CLARIFY_PROSE_PROMPT both tell the agent to STOP and wait), so repeating it
|
|
4711
4740
|
* in the result would be redundant.
|
|
4712
4741
|
*/
|
|
4713
|
-
declare const clarifyIntentOutputSchema: z.ZodObject<{
|
|
4742
|
+
export declare const clarifyIntentOutputSchema: z.ZodObject<{
|
|
4714
4743
|
status: z.ZodLiteral<"awaiting_user_response">;
|
|
4715
4744
|
intro: z.ZodOptional<z.ZodString>;
|
|
4716
4745
|
questions: z.ZodArray<z.ZodObject<{
|
|
@@ -4721,9 +4750,9 @@ declare const clarifyIntentOutputSchema: z.ZodObject<{
|
|
|
4721
4750
|
}, z.core.$strip>>;
|
|
4722
4751
|
}, z.core.$strip>;
|
|
4723
4752
|
/** Usage contract appended to the description when the host renders the form: silent turn, questions not restated in prose. */
|
|
4724
|
-
declare const CLARIFY_FORM_PROMPT: string;
|
|
4753
|
+
export declare const CLARIFY_FORM_PROMPT: string;
|
|
4725
4754
|
/** Usage contract appended to the description when there is no form: the model also writes the questions as prose so any UI shows them. */
|
|
4726
|
-
declare const CLARIFY_PROSE_PROMPT: string;
|
|
4755
|
+
export declare const CLARIFY_PROSE_PROMPT: string;
|
|
4727
4756
|
/** Per-call overrides accepted by {@link createClarifyIntentTool}. */
|
|
4728
4757
|
type ClarifyIntentToolOptions = {
|
|
4729
4758
|
/** Replace the default tool description (e.g. add domain-specific guidance). */
|
|
@@ -4762,6 +4791,6 @@ type ClarifyIntentToolOptions = {
|
|
|
4762
4791
|
* });
|
|
4763
4792
|
* ```
|
|
4764
4793
|
*/
|
|
4765
|
-
declare const createClarifyIntentTool: (options?: ClarifyIntentToolOptions) => ToolEntry;
|
|
4794
|
+
export declare const createClarifyIntentTool: (options?: ClarifyIntentToolOptions) => ToolEntry;
|
|
4766
4795
|
//#endregion
|
|
4767
|
-
export {
|
|
4796
|
+
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, 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 };
|