@tomtom-org/maps-sdk-plugin-agent-toolkit 0.5.4 → 0.6.1
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 -3
- package/THIRD_PARTY.txt +498 -0
- package/dist/THIRD_PARTY.txt +245 -24
- package/dist/index.d.ts +260 -234
- 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 +19 -16
- 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[];
|
|
@@ -2856,20 +2866,24 @@ declare const packSandboxArgs: (sandbox: SandboxInputs, libs: {
|
|
|
2856
2866
|
* sandboxed code. `Places` is a FeatureCollection of Point Features; only the
|
|
2857
2867
|
* `properties` shape (the TomTom-specific bit) is documented here.
|
|
2858
2868
|
*
|
|
2869
|
+
* @remarks
|
|
2870
|
+
* Takes {@link FeatureFlags} so a future flag can vary the doc; no flag
|
|
2871
|
+
* currently does, so every caller gets the same text.
|
|
2872
|
+
*
|
|
2859
2873
|
* @ignore
|
|
2860
2874
|
*/
|
|
2861
|
-
declare const buildPlacesSchemaDoc: (
|
|
2875
|
+
export declare const buildPlacesSchemaDoc: (_flags: FeatureFlags) => string;
|
|
2862
2876
|
/**
|
|
2863
|
-
*
|
|
2864
|
-
*
|
|
2877
|
+
* Places schema doc — preserved as a named constant so non-flag-aware tools
|
|
2878
|
+
* keep working.
|
|
2865
2879
|
*
|
|
2866
2880
|
* @ignore
|
|
2867
2881
|
*/
|
|
2868
|
-
declare const PLACES_SCHEMA_DOC: string;
|
|
2882
|
+
export declare const PLACES_SCHEMA_DOC: string;
|
|
2869
2883
|
//#endregion
|
|
2870
2884
|
//#region src/tools/shared/resolve-poi-categories.d.ts
|
|
2871
2885
|
/** Outcome of {@link resolvePoiCategories}. @ignore */
|
|
2872
|
-
type ResolvedPoiCategories = {
|
|
2886
|
+
export type ResolvedPoiCategories = {
|
|
2873
2887
|
/** Final search filter — known codes plus codes resolved from natural-language synonyms. */
|
|
2874
2888
|
resolved: POICategory[] | undefined;
|
|
2875
2889
|
/** Inputs that matched neither an exact code nor any synonym. */
|
|
@@ -2884,10 +2898,10 @@ type ResolvedPoiCategories = {
|
|
|
2884
2898
|
*
|
|
2885
2899
|
* @ignore
|
|
2886
2900
|
*/
|
|
2887
|
-
declare const resolvePoiCategories: (poiCategories: string[] | undefined) => Promise<ResolvedPoiCategories>;
|
|
2901
|
+
export declare const resolvePoiCategories: (poiCategories: string[] | undefined, options?: ToolExecuteOptions) => Promise<ResolvedPoiCategories>;
|
|
2888
2902
|
//#endregion
|
|
2889
2903
|
//#region src/tools/shared/resolve-range.d.ts
|
|
2890
|
-
declare const getRangePolygons: (state: ToolState, rangeId: string) => {
|
|
2904
|
+
export declare const getRangePolygons: (state: ToolState, rangeId: string) => {
|
|
2891
2905
|
polygons: (Polygon | MultiPolygon)[];
|
|
2892
2906
|
} | {
|
|
2893
2907
|
error: string;
|
|
@@ -2900,21 +2914,21 @@ declare const getRangePolygons: (state: ToolState, rangeId: string) => {
|
|
|
2900
2914
|
*
|
|
2901
2915
|
* @ignore
|
|
2902
2916
|
*/
|
|
2903
|
-
declare const positionSchema: z.ZodArray<z.ZodNumber>;
|
|
2917
|
+
export declare const positionSchema: z.ZodArray<z.ZodNumber>;
|
|
2904
2918
|
/** @ignore */
|
|
2905
|
-
declare const geoJsonBBoxSchema: z.ZodArray<z.ZodNumber>;
|
|
2919
|
+
export declare const geoJsonBBoxSchema: z.ZodArray<z.ZodNumber>;
|
|
2906
2920
|
/** @ignore */
|
|
2907
|
-
declare const polygonInputSchema: z.ZodObject<{
|
|
2921
|
+
export declare const polygonInputSchema: z.ZodObject<{
|
|
2908
2922
|
type: z.ZodLiteral<"Polygon">;
|
|
2909
2923
|
coordinates: z.ZodArray<z.ZodArray<z.ZodArray<z.ZodNumber>>>;
|
|
2910
2924
|
}, z.core.$strip>;
|
|
2911
2925
|
/** @ignore */
|
|
2912
|
-
declare const multiPolygonInputSchema: z.ZodObject<{
|
|
2926
|
+
export declare const multiPolygonInputSchema: z.ZodObject<{
|
|
2913
2927
|
type: z.ZodLiteral<"MultiPolygon">;
|
|
2914
2928
|
coordinates: z.ZodArray<z.ZodArray<z.ZodArray<z.ZodArray<z.ZodNumber>>>>;
|
|
2915
2929
|
}, z.core.$strip>;
|
|
2916
2930
|
/** @ignore */
|
|
2917
|
-
declare const geometryInputSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
2931
|
+
export declare const geometryInputSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
2918
2932
|
type: z.ZodLiteral<"Polygon">;
|
|
2919
2933
|
coordinates: z.ZodArray<z.ZodArray<z.ZodArray<z.ZodNumber>>>;
|
|
2920
2934
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -2929,7 +2943,7 @@ declare const geometryInputSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
2929
2943
|
*
|
|
2930
2944
|
* @ignore
|
|
2931
2945
|
*/
|
|
2932
|
-
declare const placesEntryIDsSchema: ({ verb, extra }: {
|
|
2946
|
+
export declare const placesEntryIDsSchema: ({ verb, extra }: {
|
|
2933
2947
|
verb: string;
|
|
2934
2948
|
extra?: string;
|
|
2935
2949
|
}) => z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -2939,7 +2953,7 @@ declare const placesEntryIDsSchema: ({ verb, extra }: {
|
|
|
2939
2953
|
*
|
|
2940
2954
|
* @ignore
|
|
2941
2955
|
*/
|
|
2942
|
-
declare const routesEntryIDsSchema: ({ verb, extra }: {
|
|
2956
|
+
export declare const routesEntryIDsSchema: ({ verb, extra }: {
|
|
2943
2957
|
verb: string;
|
|
2944
2958
|
extra?: string;
|
|
2945
2959
|
}) => z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -2951,7 +2965,7 @@ declare const routesEntryIDsSchema: ({ verb, extra }: {
|
|
|
2951
2965
|
*
|
|
2952
2966
|
* @ignore
|
|
2953
2967
|
*/
|
|
2954
|
-
declare const placesEntryIdHintSchema: z.ZodOptional<z.ZodString>;
|
|
2968
|
+
export declare const placesEntryIdHintSchema: z.ZodOptional<z.ZodString>;
|
|
2955
2969
|
/**
|
|
2956
2970
|
* Reusable `mode` field for show-on-map options that render polygons into an entry's
|
|
2957
2971
|
* own `GeometriesModule`. Controls how the new polygons combine with what is **already
|
|
@@ -2961,7 +2975,7 @@ declare const placesEntryIdHintSchema: z.ZodOptional<z.ZodString>;
|
|
|
2961
2975
|
*
|
|
2962
2976
|
* @ignore
|
|
2963
2977
|
*/
|
|
2964
|
-
declare const showModeSchema: z.ZodOptional<z.ZodEnum<{
|
|
2978
|
+
export declare const showModeSchema: z.ZodOptional<z.ZodEnum<{
|
|
2965
2979
|
add: "add";
|
|
2966
2980
|
replace: "replace";
|
|
2967
2981
|
}>>;
|
|
@@ -2972,7 +2986,7 @@ declare const showModeSchema: z.ZodOptional<z.ZodEnum<{
|
|
|
2972
2986
|
*
|
|
2973
2987
|
* @ignore
|
|
2974
2988
|
*/
|
|
2975
|
-
declare const showPlaceGeometriesSchema: z.ZodOptional<z.ZodObject<{
|
|
2989
|
+
export declare const showPlaceGeometriesSchema: z.ZodOptional<z.ZodObject<{
|
|
2976
2990
|
show: z.ZodOptional<z.ZodBoolean>;
|
|
2977
2991
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
2978
2992
|
add: "add";
|
|
@@ -2992,7 +3006,7 @@ declare const showPlaceGeometriesSchema: z.ZodOptional<z.ZodObject<{
|
|
|
2992
3006
|
*
|
|
2993
3007
|
* @ignore
|
|
2994
3008
|
*/
|
|
2995
|
-
declare const geometryDisplayConfigSchema: z.ZodObject<{
|
|
3009
|
+
export declare const geometryDisplayConfigSchema: z.ZodObject<{
|
|
2996
3010
|
theme: z.ZodOptional<z.ZodEnum<{
|
|
2997
3011
|
filled: "filled";
|
|
2998
3012
|
outline: "outline";
|
|
@@ -3011,9 +3025,9 @@ declare const geometryDisplayConfigSchema: z.ZodObject<{
|
|
|
3011
3025
|
*
|
|
3012
3026
|
* @ignore
|
|
3013
3027
|
*/
|
|
3014
|
-
declare const markerTypeSchema: z.ZodEnum<{
|
|
3015
|
-
"base-map": "base-map";
|
|
3028
|
+
export declare const markerTypeSchema: z.ZodEnum<{
|
|
3016
3029
|
pin: "pin";
|
|
3030
|
+
"base-map": "base-map";
|
|
3017
3031
|
"pin-clustered": "pin-clustered";
|
|
3018
3032
|
none: "none";
|
|
3019
3033
|
}>;
|
|
@@ -3025,12 +3039,12 @@ declare const markerTypeSchema: z.ZodEnum<{
|
|
|
3025
3039
|
*
|
|
3026
3040
|
* @ignore
|
|
3027
3041
|
*/
|
|
3028
|
-
declare const hidePreviousEntriesSchema: (entryNoun: string) => z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodArray<z.ZodString>]>>;
|
|
3042
|
+
export declare const hidePreviousEntriesSchema: (entryNoun: string) => z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodArray<z.ZodString>]>>;
|
|
3029
3043
|
/** @ignore */
|
|
3030
|
-
declare const showPlacesSchema: z.ZodObject<{
|
|
3044
|
+
export declare const showPlacesSchema: z.ZodObject<{
|
|
3031
3045
|
markerType: z.ZodEnum<{
|
|
3032
|
-
"base-map": "base-map";
|
|
3033
3046
|
pin: "pin";
|
|
3047
|
+
"base-map": "base-map";
|
|
3034
3048
|
"pin-clustered": "pin-clustered";
|
|
3035
3049
|
none: "none";
|
|
3036
3050
|
}>;
|
|
@@ -3041,7 +3055,7 @@ declare const showPlacesSchema: z.ZodObject<{
|
|
|
3041
3055
|
hidePreviousEntries: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodArray<z.ZodString>]>>;
|
|
3042
3056
|
}, z.core.$strip>;
|
|
3043
3057
|
/** @ignore */
|
|
3044
|
-
declare const shownSchema: z.ZodObject<{
|
|
3058
|
+
export declare const shownSchema: z.ZodObject<{
|
|
3045
3059
|
markerType: z.ZodBoolean;
|
|
3046
3060
|
zoomMode: z.ZodBoolean;
|
|
3047
3061
|
}, z.core.$strip>;
|
|
@@ -3054,7 +3068,7 @@ declare const shownSchema: z.ZodObject<{
|
|
|
3054
3068
|
*
|
|
3055
3069
|
* @ignore
|
|
3056
3070
|
*/
|
|
3057
|
-
declare const showByodSchema: z.ZodObject<{
|
|
3071
|
+
export declare const showByodSchema: z.ZodObject<{
|
|
3058
3072
|
zoomMode: z.ZodEnum<{
|
|
3059
3073
|
none: "none";
|
|
3060
3074
|
auto: "auto";
|
|
@@ -3062,7 +3076,7 @@ declare const showByodSchema: z.ZodObject<{
|
|
|
3062
3076
|
hidePreviousEntries: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodArray<z.ZodString>]>>;
|
|
3063
3077
|
}, z.core.$strip>;
|
|
3064
3078
|
/** @ignore */
|
|
3065
|
-
declare const shownByodSchema: z.ZodObject<{
|
|
3079
|
+
export declare const shownByodSchema: z.ZodObject<{
|
|
3066
3080
|
zoomMode: z.ZodBoolean;
|
|
3067
3081
|
}, z.core.$strip>;
|
|
3068
3082
|
/**
|
|
@@ -3070,7 +3084,7 @@ declare const shownByodSchema: z.ZodObject<{
|
|
|
3070
3084
|
* `viewport` flag. Spread into each consumer's `z.object({...})`.
|
|
3071
3085
|
* @ignore
|
|
3072
3086
|
*/
|
|
3073
|
-
declare const withinSharedFields: {
|
|
3087
|
+
export declare const withinSharedFields: {
|
|
3074
3088
|
mode: z.ZodLiteral<"within">;
|
|
3075
3089
|
viewport: z.ZodOptional<z.ZodLiteral<true>>;
|
|
3076
3090
|
};
|
|
@@ -3080,7 +3094,7 @@ declare const withinSharedFields: {
|
|
|
3080
3094
|
* postal codes, etc.). Optional everywhere; defaults to `'place'`.
|
|
3081
3095
|
* @ignore
|
|
3082
3096
|
*/
|
|
3083
|
-
declare const queryAsSchema: z.ZodOptional<z.ZodEnum<{
|
|
3097
|
+
export declare const queryAsSchema: z.ZodOptional<z.ZodEnum<{
|
|
3084
3098
|
poi: "poi";
|
|
3085
3099
|
place: "place";
|
|
3086
3100
|
}>>;
|
|
@@ -3088,7 +3102,7 @@ declare const queryAsSchema: z.ZodOptional<z.ZodEnum<{
|
|
|
3088
3102
|
* locatePlace's `within` schema — exactly one of viewport / boundingBox / query / placeId.
|
|
3089
3103
|
* @ignore
|
|
3090
3104
|
*/
|
|
3091
|
-
declare const withinWhereSchema: z.ZodObject<{
|
|
3105
|
+
export declare const withinWhereSchema: z.ZodObject<{
|
|
3092
3106
|
boundingBox: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
3093
3107
|
query: z.ZodOptional<z.ZodString>;
|
|
3094
3108
|
queryAs: z.ZodOptional<z.ZodEnum<{
|
|
@@ -3100,7 +3114,7 @@ declare const withinWhereSchema: z.ZodObject<{
|
|
|
3100
3114
|
viewport: z.ZodOptional<z.ZodLiteral<true>>;
|
|
3101
3115
|
}, z.core.$strip>;
|
|
3102
3116
|
/** @ignore */
|
|
3103
|
-
declare const nearbyWhereSchema: z.ZodObject<{
|
|
3117
|
+
export declare const nearbyWhereSchema: z.ZodObject<{
|
|
3104
3118
|
mode: z.ZodLiteral<"nearby">;
|
|
3105
3119
|
position: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
3106
3120
|
viewport: z.ZodOptional<z.ZodLiteral<true>>;
|
|
@@ -3112,7 +3126,7 @@ declare const nearbyWhereSchema: z.ZodObject<{
|
|
|
3112
3126
|
radiusMeters: z.ZodOptional<z.ZodNumber>;
|
|
3113
3127
|
}, z.core.$strip>;
|
|
3114
3128
|
/** @ignore */
|
|
3115
|
-
declare const globalWhereSchema: z.ZodObject<{
|
|
3129
|
+
export declare const globalWhereSchema: z.ZodObject<{
|
|
3116
3130
|
mode: z.ZodLiteral<"global">;
|
|
3117
3131
|
}, z.core.$strip>;
|
|
3118
3132
|
/**
|
|
@@ -3120,7 +3134,7 @@ declare const globalWhereSchema: z.ZodObject<{
|
|
|
3120
3134
|
* discoverPlaces builds its own union in discover-places.ts using the plural-form within schema.
|
|
3121
3135
|
* @ignore
|
|
3122
3136
|
*/
|
|
3123
|
-
declare const whereSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
3137
|
+
export declare const whereSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
3124
3138
|
boundingBox: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
3125
3139
|
query: z.ZodOptional<z.ZodString>;
|
|
3126
3140
|
queryAs: z.ZodOptional<z.ZodEnum<{
|
|
@@ -3148,7 +3162,7 @@ declare const whereSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
3148
3162
|
* Spread into each tool's `z.object({...})` alongside any tool-specific fields.
|
|
3149
3163
|
* @ignore
|
|
3150
3164
|
*/
|
|
3151
|
-
declare const sharedWithinFields: {
|
|
3165
|
+
export declare const sharedWithinFields: {
|
|
3152
3166
|
queries: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
3153
3167
|
query: z.ZodString;
|
|
3154
3168
|
queryAs: z.ZodOptional<z.ZodEnum<{
|
|
@@ -3178,7 +3192,7 @@ declare const sharedWithinFields: {
|
|
|
3178
3192
|
* stored isochrones and is resolved caller-side.
|
|
3179
3193
|
* @ignore
|
|
3180
3194
|
*/
|
|
3181
|
-
declare const areaWhereSchema: z.ZodObject<{
|
|
3195
|
+
export declare const areaWhereSchema: z.ZodObject<{
|
|
3182
3196
|
viewport: z.ZodOptional<z.ZodBoolean>;
|
|
3183
3197
|
boundingBox: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
3184
3198
|
queries: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -3202,10 +3216,10 @@ declare const areaWhereSchema: z.ZodObject<{
|
|
|
3202
3216
|
}, z.core.$strip>>;
|
|
3203
3217
|
}, z.core.$strip>;
|
|
3204
3218
|
/** The `where` fields resolve-where.ts resolves — inferred from {@link areaWhereSchema}. */
|
|
3205
|
-
type AreaWhere = z.infer<typeof areaWhereSchema>;
|
|
3219
|
+
export type AreaWhere = z.infer<typeof areaWhereSchema>;
|
|
3206
3220
|
//#endregion
|
|
3207
3221
|
//#region src/tools/shared/resolve-where.d.ts
|
|
3208
|
-
type WhereContext = {
|
|
3222
|
+
export type WhereContext = {
|
|
3209
3223
|
viewport(): {
|
|
3210
3224
|
bbox?: BBox;
|
|
3211
3225
|
center?: Position;
|
|
@@ -3220,16 +3234,16 @@ type WhereContext = {
|
|
|
3220
3234
|
error: string;
|
|
3221
3235
|
};
|
|
3222
3236
|
};
|
|
3223
|
-
type ResolveAreasOptions = {
|
|
3237
|
+
export type ResolveAreasOptions = {
|
|
3224
3238
|
kind: ResolveKind;
|
|
3225
3239
|
};
|
|
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 = {
|
|
3240
|
+
export type ResolveKind = 'within' | 'nearby' | 'global';
|
|
3241
|
+
export type AreaSource = 'viewport' | 'boundingBox' | 'query' | 'placeId' | 'geometries' | 'route';
|
|
3242
|
+
export declare function resolveWhere(opts: ResolveAreasOptions, where?: AreaWhere, ctx?: WhereContext): Promise<ResolveError | ResolvedArea[]> | ResolvedBias | Promise<ResolvedBias>;
|
|
3243
|
+
export declare const resolveWithin: (where: AreaWhere, ctx: WhereContext) => Promise<ResolvedArea[] | ResolveError>;
|
|
3244
|
+
export declare const resolveNearby: (where: AreaWhere, ctx: WhereContext) => Promise<ResolvedBias>;
|
|
3245
|
+
export declare const resolveGlobal: () => ResolvedBias;
|
|
3246
|
+
export type ResolvedArea = {
|
|
3233
3247
|
bbox: BBox;
|
|
3234
3248
|
polygon?: Polygon | MultiPolygon;
|
|
3235
3249
|
/** The GROUNDED match label — `freeformAddress, <countryCode>` for a `query` area — i.e. what the
|
|
@@ -3241,19 +3255,19 @@ type ResolvedArea = {
|
|
|
3241
3255
|
* grounded `label` ("matched"). Absent for non-query sources. */
|
|
3242
3256
|
query?: string;
|
|
3243
3257
|
};
|
|
3244
|
-
type ResolveError = {
|
|
3258
|
+
export type ResolveError = {
|
|
3245
3259
|
error: string;
|
|
3246
3260
|
};
|
|
3247
|
-
type ResolvedBias = {
|
|
3261
|
+
export type ResolvedBias = {
|
|
3248
3262
|
position?: Position;
|
|
3249
3263
|
label?: string;
|
|
3250
3264
|
query?: string;
|
|
3251
3265
|
};
|
|
3252
|
-
type ResolvedAreaDisclosure = {
|
|
3266
|
+
export type ResolvedAreaDisclosure = {
|
|
3253
3267
|
query?: string;
|
|
3254
3268
|
matched: string;
|
|
3255
3269
|
};
|
|
3256
|
-
declare const isResolveError: (r: unknown) => r is ResolveError;
|
|
3270
|
+
export declare const isResolveError: (r: unknown) => r is ResolveError;
|
|
3257
3271
|
//#endregion
|
|
3258
3272
|
//#region src/tools/shared/routes-schema-doc.d.ts
|
|
3259
3273
|
/**
|
|
@@ -3265,7 +3279,7 @@ declare const isResolveError: (r: unknown) => r is ResolveError;
|
|
|
3265
3279
|
* Only the non-GeoJSON-standard bits are spelled out — `Route` is a LineString Feature.
|
|
3266
3280
|
*/
|
|
3267
3281
|
/** @ignore */
|
|
3268
|
-
declare const ROUTES_SCHEMA_DOC: string;
|
|
3282
|
+
export declare const ROUTES_SCHEMA_DOC: string;
|
|
3269
3283
|
//#endregion
|
|
3270
3284
|
//#region src/tools/shared/show-byod-on-map.d.ts
|
|
3271
3285
|
/**
|
|
@@ -3276,11 +3290,11 @@ declare const ROUTES_SCHEMA_DOC: string;
|
|
|
3276
3290
|
*
|
|
3277
3291
|
* @ignore
|
|
3278
3292
|
*/
|
|
3279
|
-
declare const showByodOnMap: (state: ToolState, byodEntryId: string, show: z.infer<typeof showByodSchema>) => Promise<z.infer<typeof shownByodSchema>>;
|
|
3293
|
+
export declare const showByodOnMap: (state: ToolState, byodEntryId: string, show: z.infer<typeof showByodSchema>) => Promise<z.infer<typeof shownByodSchema>>;
|
|
3280
3294
|
//#endregion
|
|
3281
3295
|
//#region src/tools/shared/show-entry-geometries.d.ts
|
|
3282
3296
|
/** @ignore */
|
|
3283
|
-
type ShowEntryGeometriesResult = {
|
|
3297
|
+
export type ShowEntryGeometriesResult = {
|
|
3284
3298
|
fetched: number;
|
|
3285
3299
|
shown: boolean;
|
|
3286
3300
|
};
|
|
@@ -3293,24 +3307,24 @@ type ShowEntryGeometriesResult = {
|
|
|
3293
3307
|
*
|
|
3294
3308
|
* @ignore
|
|
3295
3309
|
*/
|
|
3296
|
-
declare const showEntryGeometries: (state: ToolState, placesEntryId: string, config: NonNullable<z.infer<typeof showPlaceGeometriesSchema
|
|
3310
|
+
export declare const showEntryGeometries: (state: ToolState, placesEntryId: string, config: NonNullable<z.infer<typeof showPlaceGeometriesSchema>>, options?: ToolExecuteOptions) => Promise<ShowEntryGeometriesResult>;
|
|
3297
3311
|
//#endregion
|
|
3298
3312
|
//#region src/tools/shared/show-places-on-map.d.ts
|
|
3299
3313
|
/** @ignore */
|
|
3300
|
-
declare const showResultsOnMap: (state: ToolState, placesEntryIds: readonly string[], show: z.infer<typeof showPlacesSchema>) => Promise<z.infer<typeof shownSchema>>;
|
|
3314
|
+
export declare const showResultsOnMap: (state: ToolState, placesEntryIds: readonly string[], show: z.infer<typeof showPlacesSchema>) => Promise<z.infer<typeof shownSchema>>;
|
|
3301
3315
|
//#endregion
|
|
3302
3316
|
//#region src/tools/shared/tool-state-where-context.d.ts
|
|
3303
3317
|
/** Adapts the live `ToolState` to the narrow `WhereContext` the resolver depends on. Keeping this
|
|
3304
3318
|
* mapping in one place is what lets resolveAreas stay testable without a ToolState. */
|
|
3305
|
-
declare const toolStateToWhereContext: (state: ToolState) => WhereContext;
|
|
3319
|
+
export declare const toolStateToWhereContext: (state: ToolState, options?: ToolExecuteOptions) => WhereContext;
|
|
3306
3320
|
//#endregion
|
|
3307
3321
|
//#region src/tools/shared/viewport-bias.d.ts
|
|
3308
3322
|
/** @ignore */
|
|
3309
|
-
declare const MIN_VIEWPORT_BIAS_ZOOM = 6;
|
|
3323
|
+
export declare const MIN_VIEWPORT_BIAS_ZOOM = 6;
|
|
3310
3324
|
/** @ignore */
|
|
3311
|
-
declare const getViewportBias: (map: BaseMapState, minZoom?: number) => Position | undefined;
|
|
3325
|
+
export declare const getViewportBias: (map: BaseMapState, minZoom?: number) => Position | undefined;
|
|
3312
3326
|
/** @ignore */
|
|
3313
|
-
declare const getViewportBoundingBox: (map: BaseMapState) => BBox;
|
|
3327
|
+
export declare const getViewportBoundingBox: (map: BaseMapState) => BBox;
|
|
3314
3328
|
//#endregion
|
|
3315
3329
|
//#region src/state/custom-geometries/entry.d.ts
|
|
3316
3330
|
/**
|
|
@@ -3504,7 +3518,7 @@ type DataEntryConfig = {
|
|
|
3504
3518
|
*
|
|
3505
3519
|
* @group Agent Toolkit
|
|
3506
3520
|
*/
|
|
3507
|
-
declare const DATA_ENTRY_KIND_TO_SLICE: {
|
|
3521
|
+
export declare const DATA_ENTRY_KIND_TO_SLICE: {
|
|
3508
3522
|
readonly places: "places";
|
|
3509
3523
|
readonly routes: "routing";
|
|
3510
3524
|
readonly incidents: "trafficIncidents";
|
|
@@ -3533,7 +3547,7 @@ type EntryModeSliceName = { [K in keyof ToolState]: ToolState[K] extends EntryMo
|
|
|
3533
3547
|
*
|
|
3534
3548
|
* @group Agent Toolkit
|
|
3535
3549
|
*/
|
|
3536
|
-
declare const ENTRY_MODE_SLICE_NAMES: readonly EntryModeSliceName[];
|
|
3550
|
+
export declare const ENTRY_MODE_SLICE_NAMES: readonly EntryModeSliceName[];
|
|
3537
3551
|
/**
|
|
3538
3552
|
* State slice that owns a set of "entries" (routes, ranges) where each entry can be hidden
|
|
3539
3553
|
* individually by id and the slice exposes the currently-shown set. Implemented by
|
|
@@ -3769,7 +3783,7 @@ type SystemPromptSectionOverrides = Partial<Record<SystemPromptSection, string>>
|
|
|
3769
3783
|
*
|
|
3770
3784
|
* @group Agent Toolkit
|
|
3771
3785
|
*/
|
|
3772
|
-
declare const SYSTEM_PROMPT_SECTIONS: Record<SystemPromptSection, string>;
|
|
3786
|
+
export declare const SYSTEM_PROMPT_SECTIONS: Record<SystemPromptSection, string>;
|
|
3773
3787
|
/**
|
|
3774
3788
|
* Composes the base system prompt from {@link SYSTEM_PROMPT_SECTIONS}, applying
|
|
3775
3789
|
* any per-section overrides.
|
|
@@ -3795,7 +3809,7 @@ declare const SYSTEM_PROMPT_SECTIONS: Record<SystemPromptSection, string>;
|
|
|
3795
3809
|
*
|
|
3796
3810
|
* @group Agent Toolkit
|
|
3797
3811
|
*/
|
|
3798
|
-
declare const composeSystemPrompt: (overrides?: SystemPromptSectionOverrides) => string;
|
|
3812
|
+
export declare const composeSystemPrompt: (overrides?: SystemPromptSectionOverrides) => string;
|
|
3799
3813
|
/**
|
|
3800
3814
|
* The base system prompt that teaches the LLM how to use the agent toolkit tools.
|
|
3801
3815
|
*
|
|
@@ -3817,7 +3831,7 @@ declare const composeSystemPrompt: (overrides?: SystemPromptSectionOverrides) =>
|
|
|
3817
3831
|
*
|
|
3818
3832
|
* @group Agent Toolkit
|
|
3819
3833
|
*/
|
|
3820
|
-
declare const BASE_SYSTEM_PROMPT: string;
|
|
3834
|
+
export declare const BASE_SYSTEM_PROMPT: string;
|
|
3821
3835
|
/**
|
|
3822
3836
|
* Inputs to {@link buildSystemPrompt}.
|
|
3823
3837
|
*
|
|
@@ -3852,7 +3866,7 @@ type BuildSystemPromptOptions = {
|
|
|
3852
3866
|
* @internal
|
|
3853
3867
|
* @ignore
|
|
3854
3868
|
*/
|
|
3855
|
-
declare const buildSystemPrompt: ({ customPrompt, prefix, suffix }?: BuildSystemPromptOptions) => string;
|
|
3869
|
+
export declare const buildSystemPrompt: ({ customPrompt, prefix, suffix }?: BuildSystemPromptOptions) => string;
|
|
3856
3870
|
//#endregion
|
|
3857
3871
|
//#region src/tools/tool-registry.d.ts
|
|
3858
3872
|
/**
|
|
@@ -3865,7 +3879,7 @@ declare const buildSystemPrompt: ({ customPrompt, prefix, suffix }?: BuildSystem
|
|
|
3865
3879
|
*
|
|
3866
3880
|
* @group Agent Toolkit
|
|
3867
3881
|
*/
|
|
3868
|
-
declare const DEFAULT_TOOLS: {
|
|
3882
|
+
export declare const DEFAULT_TOOLS: {
|
|
3869
3883
|
locatePlace: ToolDefinition;
|
|
3870
3884
|
reverseGeocode: ToolDefinition;
|
|
3871
3885
|
discoverPlaces: ToolDefinition;
|
|
@@ -3904,6 +3918,8 @@ declare const DEFAULT_TOOLS: {
|
|
|
3904
3918
|
setLanguage: ToolDefinition;
|
|
3905
3919
|
toggleTilesBaseMapLayerGroups: ToolDefinition;
|
|
3906
3920
|
toggleTilesPOIs: ToolDefinition;
|
|
3921
|
+
describeMapStyling: ToolDefinition;
|
|
3922
|
+
setMapStyling: ToolDefinition;
|
|
3907
3923
|
toggleTilesTrafficFlow: ToolDefinition;
|
|
3908
3924
|
toggleTilesTrafficIncidents: ToolDefinition;
|
|
3909
3925
|
getMapStyleLayers: ToolDefinition;
|
|
@@ -3932,7 +3948,7 @@ type ToolName = keyof typeof DEFAULT_TOOLS;
|
|
|
3932
3948
|
*
|
|
3933
3949
|
* @group Agent Toolkit
|
|
3934
3950
|
*/
|
|
3935
|
-
declare const TOOL_NAMES: ToolName[];
|
|
3951
|
+
export declare const TOOL_NAMES: ToolName[];
|
|
3936
3952
|
/**
|
|
3937
3953
|
* Default tool names that should be dropped from the registry when a {@link DataEntryKind}
|
|
3938
3954
|
* is disabled. Only default-tool names are listed here — user-supplied custom tools are
|
|
@@ -3944,7 +3960,7 @@ declare const TOOL_NAMES: ToolName[];
|
|
|
3944
3960
|
*
|
|
3945
3961
|
* @group Agent Toolkit
|
|
3946
3962
|
*/
|
|
3947
|
-
declare const TOOLS_BY_DATA_ENTRY_KIND: Record<DataEntryKind, readonly ToolName[]>;
|
|
3963
|
+
export declare const TOOLS_BY_DATA_ENTRY_KIND: Record<DataEntryKind, readonly ToolName[]>;
|
|
3948
3964
|
/**
|
|
3949
3965
|
* Returns each default tool's `examplePrompts` keyed by tool name. Builders are
|
|
3950
3966
|
* materialised with empty {@link ToolBuildOptions} so the prompts reflect the
|
|
@@ -3955,7 +3971,7 @@ declare const TOOLS_BY_DATA_ENTRY_KIND: Record<DataEntryKind, readonly ToolName[
|
|
|
3955
3971
|
*
|
|
3956
3972
|
* @group Agent Toolkit
|
|
3957
3973
|
*/
|
|
3958
|
-
declare const getDefaultToolPrompts: () => Record<ToolName, readonly string[]>;
|
|
3974
|
+
export declare const getDefaultToolPrompts: () => Record<ToolName, readonly string[]>;
|
|
3959
3975
|
//#endregion
|
|
3960
3976
|
//#region src/utils/types/intent-classifier.d.ts
|
|
3961
3977
|
/**
|
|
@@ -4025,14 +4041,14 @@ type ConversationMessage = {
|
|
|
4025
4041
|
*
|
|
4026
4042
|
* @group Agent Toolkit
|
|
4027
4043
|
*/
|
|
4028
|
-
declare const classifyUserIntent: (conversation: ConversationMessage[], options: ClassifierOptions) => Promise<ClassificationResult>;
|
|
4044
|
+
export declare const classifyUserIntent: (conversation: ConversationMessage[], options: ClassifierOptions) => Promise<ClassificationResult>;
|
|
4029
4045
|
/**
|
|
4030
4046
|
* Extracts the text content of the last user message in a message array.
|
|
4031
4047
|
* Returns null if no user message is found or if content has no text.
|
|
4032
4048
|
*
|
|
4033
4049
|
* @group Agent Toolkit
|
|
4034
4050
|
*/
|
|
4035
|
-
declare const extractLastUserText: (messages: ReadonlyArray<ModelMessage>) => string | null;
|
|
4051
|
+
export declare const extractLastUserText: (messages: ReadonlyArray<ModelMessage>) => string | null;
|
|
4036
4052
|
/**
|
|
4037
4053
|
* Creates the default LLM-based classifier. Uses structured generation to select
|
|
4038
4054
|
* the minimal tool set for each user message.
|
|
@@ -4043,7 +4059,7 @@ declare const extractLastUserText: (messages: ReadonlyArray<ModelMessage>) => st
|
|
|
4043
4059
|
*
|
|
4044
4060
|
* @group Agent Toolkit
|
|
4045
4061
|
*/
|
|
4046
|
-
declare const createDefaultClassifier: (options: {
|
|
4062
|
+
export declare const createDefaultClassifier: (options: {
|
|
4047
4063
|
model: LanguageModel;
|
|
4048
4064
|
maxHistoryMessages?: number;
|
|
4049
4065
|
maxHistoryMessageLength?: number;
|
|
@@ -4060,7 +4076,7 @@ type ProviderOptions = Record<string, Record<string, JSONValue | undefined>>;
|
|
|
4060
4076
|
*
|
|
4061
4077
|
* @group Agent Toolkit
|
|
4062
4078
|
*/
|
|
4063
|
-
type ToolNameHint = ToolName | (string & {});
|
|
4079
|
+
export type ToolNameHint = ToolName | (string & {});
|
|
4064
4080
|
/**
|
|
4065
4081
|
* Tool-facing union of state slices that own analysable entries — the
|
|
4066
4082
|
* vocabulary used by tools that read from multiple slices (`analyseData`,
|
|
@@ -4075,7 +4091,7 @@ type ToolNameHint = ToolName | (string & {});
|
|
|
4075
4091
|
*
|
|
4076
4092
|
* @group Agent Toolkit
|
|
4077
4093
|
*/
|
|
4078
|
-
type EntryDataKind = 'places' | 'routes' | 'incidents' | 'customGeometries' | 'trafficAreaAnalytics' | 'byod';
|
|
4094
|
+
export type EntryDataKind = 'places' | 'routes' | 'incidents' | 'customGeometries' | 'trafficAreaAnalytics' | 'byod';
|
|
4079
4095
|
/**
|
|
4080
4096
|
* State passed to tool factory functions. Organized by feature area,
|
|
4081
4097
|
* each sub-state mixes lazy module access with the current service data
|
|
@@ -4096,7 +4112,7 @@ type EntryDataKind = 'places' | 'routes' | 'incidents' | 'customGeometries' | 't
|
|
|
4096
4112
|
* }
|
|
4097
4113
|
* ```
|
|
4098
4114
|
*/
|
|
4099
|
-
type ToolState = {
|
|
4115
|
+
export type ToolState = {
|
|
4100
4116
|
/** Places layer: PlacesModule plus an append-only search history. */
|
|
4101
4117
|
places: PlacesState;
|
|
4102
4118
|
/** Map POI layer: visibility, filtering, and category management. */
|
|
@@ -4153,7 +4169,7 @@ type ToolState = {
|
|
|
4153
4169
|
*
|
|
4154
4170
|
* @group Agent Toolkit
|
|
4155
4171
|
*/
|
|
4156
|
-
type CodeExecutionConfig = {
|
|
4172
|
+
export type CodeExecutionConfig = {
|
|
4157
4173
|
/** Wall-clock budget per isolated (browser) run, in ms. Default: 5000. */
|
|
4158
4174
|
timeoutMs?: number;
|
|
4159
4175
|
/**
|
|
@@ -4164,6 +4180,23 @@ type CodeExecutionConfig = {
|
|
|
4164
4180
|
*/
|
|
4165
4181
|
loadWorkerLibrarySource?: () => string | Promise<string>;
|
|
4166
4182
|
};
|
|
4183
|
+
/**
|
|
4184
|
+
* Per-call options handed to a tool's `execute`, separate from its parsed input.
|
|
4185
|
+
*
|
|
4186
|
+
* `signal` is the AI SDK's own `abortSignal` for the tool call — it fires when the model's
|
|
4187
|
+
* turn is cancelled. Forward it to any `@tomtom-org/maps-sdk/services` call the tool makes
|
|
4188
|
+
* (as `signal`) so a cancelled turn also cancels its in-flight HTTP requests.
|
|
4189
|
+
*
|
|
4190
|
+
* Do NOT forward it into work that outlives the turn — a monitor's recurring tick, or any
|
|
4191
|
+
* deferred job. Those fire after the signal has aborted, and a monitor treats a rejected tick
|
|
4192
|
+
* as fatal (it clears its own interval), so a leaked signal kills the monitor rather than
|
|
4193
|
+
* cancelling a request.
|
|
4194
|
+
*
|
|
4195
|
+
* @group Agent Toolkit
|
|
4196
|
+
*/
|
|
4197
|
+
export type ToolExecuteOptions = {
|
|
4198
|
+
signal?: AbortSignal;
|
|
4199
|
+
};
|
|
4167
4200
|
/**
|
|
4168
4201
|
* A tool definition — the universal format for both built-in and third-party tools.
|
|
4169
4202
|
* Combines execution (inputSchema + execute) with classifier metadata.
|
|
@@ -4177,7 +4210,7 @@ type CodeExecutionConfig = {
|
|
|
4177
4210
|
*
|
|
4178
4211
|
* @group Agent Toolkit
|
|
4179
4212
|
*/
|
|
4180
|
-
type ToolEntry<S extends ToolState = ToolState, Scope = unknown> = {
|
|
4213
|
+
export type ToolEntry<S extends ToolState = ToolState, Scope = unknown> = {
|
|
4181
4214
|
/** Description of the tool's purpose. */
|
|
4182
4215
|
description: string;
|
|
4183
4216
|
/** Zod schema defining the tool's input parameters. */
|
|
@@ -4193,7 +4226,7 @@ type ToolEntry<S extends ToolState = ToolState, Scope = unknown> = {
|
|
|
4193
4226
|
* This tags the request so TomTom's traffic analytics attribute it to agent-toolkit; an
|
|
4194
4227
|
* untagged call is picked up by the guard test in `tools/shared/tests/agent-headers.test.ts`.
|
|
4195
4228
|
*/
|
|
4196
|
-
execute: (input: any, state: S) => Promise<any>;
|
|
4229
|
+
execute: (input: any, state: S, options?: ToolExecuteOptions) => Promise<any>;
|
|
4197
4230
|
/** Compact one-liner for the intent classifier prompt. */
|
|
4198
4231
|
classificationPrompt?: string;
|
|
4199
4232
|
/** Category tags (e.g. 'location', 'routing'). */
|
|
@@ -4243,7 +4276,7 @@ type ToolEntry<S extends ToolState = ToolState, Scope = unknown> = {
|
|
|
4243
4276
|
*
|
|
4244
4277
|
* @group Agent Toolkit
|
|
4245
4278
|
*/
|
|
4246
|
-
type ToolMetadata = {
|
|
4279
|
+
export type ToolMetadata = {
|
|
4247
4280
|
/** Tool identifier, derived from the config key. */
|
|
4248
4281
|
name: string;
|
|
4249
4282
|
/** Description of the tool's purpose. Used by the SDK's system prompt. */
|
|
@@ -4272,7 +4305,7 @@ type ToolMetadata = {
|
|
|
4272
4305
|
*
|
|
4273
4306
|
* @group Agent Toolkit
|
|
4274
4307
|
*/
|
|
4275
|
-
type ClassifierContext = {
|
|
4308
|
+
export type ClassifierContext = {
|
|
4276
4309
|
/** Full message history for the current conversation. */
|
|
4277
4310
|
messages: ReadonlyArray<ModelMessage>;
|
|
4278
4311
|
/** Metadata for all registered tools. */
|
|
@@ -4284,7 +4317,7 @@ type ClassifierContext = {
|
|
|
4284
4317
|
*
|
|
4285
4318
|
* @group Agent Toolkit
|
|
4286
4319
|
*/
|
|
4287
|
-
type Classifier = (context: ClassifierContext) => Promise<ClassificationResult | null>;
|
|
4320
|
+
export type Classifier = (context: ClassifierContext) => Promise<ClassificationResult | null>;
|
|
4288
4321
|
/**
|
|
4289
4322
|
* Feature-flag bag for {@link createMapAgent}. Toggles in-flight or
|
|
4290
4323
|
* opt-in agent-toolkit behaviour. Individual flags vary in stability —
|
|
@@ -4296,23 +4329,16 @@ type Classifier = (context: ClassifierContext) => Promise<ClassificationResult |
|
|
|
4296
4329
|
*
|
|
4297
4330
|
* @group Agent Toolkit
|
|
4298
4331
|
*/
|
|
4299
|
-
type FeatureFlags = {
|
|
4332
|
+
export type FeatureFlags = {
|
|
4300
4333
|
/**
|
|
4301
|
-
*
|
|
4302
|
-
* backend (and expose its richer input surface — `municipalities`,
|
|
4303
|
-
* multiple `boundingBoxes`, `placeTypes`, `areaId`, `areaTags`). When
|
|
4304
|
-
* `false`/unset, `discoverPlaces` uses the stable default search
|
|
4305
|
-
* service and a reduced input schema that matches what the default
|
|
4306
|
-
* service supports.
|
|
4307
|
-
*
|
|
4308
|
-
* **Internal experiment.** Not part of the public agent-toolkit
|
|
4309
|
-
* contract; subject to removal at any time.
|
|
4334
|
+
* No feature flags are currently defined.
|
|
4310
4335
|
*
|
|
4311
|
-
* @
|
|
4312
|
-
*
|
|
4313
|
-
*
|
|
4336
|
+
* @remarks
|
|
4337
|
+
* The bag is kept because the tool builders (`ToolEntryBuilder`,
|
|
4338
|
+
* `buildDiscoverPlacesSchema`, …) thread it through as their extension
|
|
4339
|
+
* point for schema and description variation. A future flag is added here.
|
|
4314
4340
|
*/
|
|
4315
|
-
|
|
4341
|
+
readonly [flag: string]: never;
|
|
4316
4342
|
};
|
|
4317
4343
|
/**
|
|
4318
4344
|
* Build-time options passed to a {@link ToolEntryBuilder}. Lets each tool
|
|
@@ -4325,7 +4351,7 @@ type FeatureFlags = {
|
|
|
4325
4351
|
*
|
|
4326
4352
|
* @group Agent Toolkit
|
|
4327
4353
|
*/
|
|
4328
|
-
type ToolBuildOptions<Scope = unknown> = {
|
|
4354
|
+
export type ToolBuildOptions<Scope = unknown> = {
|
|
4329
4355
|
/** Active feature flags. */
|
|
4330
4356
|
featureFlags?: FeatureFlags;
|
|
4331
4357
|
/**
|
|
@@ -4356,7 +4382,7 @@ type ToolBuildOptions<Scope = unknown> = {
|
|
|
4356
4382
|
*
|
|
4357
4383
|
* @group Agent Toolkit
|
|
4358
4384
|
*/
|
|
4359
|
-
type ToolEntryBuilder<S extends ToolState = ToolState, Scope = unknown> = (options: ToolBuildOptions<Scope>) => ToolEntry<S, Scope>;
|
|
4385
|
+
export type ToolEntryBuilder<S extends ToolState = ToolState, Scope = unknown> = (options: ToolBuildOptions<Scope>) => ToolEntry<S, Scope>;
|
|
4360
4386
|
/**
|
|
4361
4387
|
* A registered tool definition: either a static {@link ToolEntry} or a
|
|
4362
4388
|
* {@link ToolEntryBuilder} that builds one from {@link ToolBuildOptions} at
|
|
@@ -4369,13 +4395,13 @@ type ToolEntryBuilder<S extends ToolState = ToolState, Scope = unknown> = (optio
|
|
|
4369
4395
|
*
|
|
4370
4396
|
* @group Agent Toolkit
|
|
4371
4397
|
*/
|
|
4372
|
-
type ToolDefinition<S extends ToolState = ToolState, Scope = any> = ToolEntry<S, Scope> | ToolEntryBuilder<S, Scope>;
|
|
4398
|
+
export type ToolDefinition<S extends ToolState = ToolState, Scope = any> = ToolEntry<S, Scope> | ToolEntryBuilder<S, Scope>;
|
|
4373
4399
|
/**
|
|
4374
4400
|
* Per-tool execution outcome reported to {@link MapAgentOptions.onToolExecute}.
|
|
4375
4401
|
*
|
|
4376
4402
|
* @group Agent Toolkit
|
|
4377
4403
|
*/
|
|
4378
|
-
type ToolExecutionInfo = {
|
|
4404
|
+
export type ToolExecutionInfo = {
|
|
4379
4405
|
/** Registered tool name (the `defaultTools` key). */
|
|
4380
4406
|
toolName: string;
|
|
4381
4407
|
/** Wall-clock duration of `execute`, in milliseconds (includes any network/IO). */
|
|
@@ -4390,7 +4416,7 @@ type ToolExecutionInfo = {
|
|
|
4390
4416
|
*
|
|
4391
4417
|
* @group Agent Toolkit
|
|
4392
4418
|
*/
|
|
4393
|
-
type OnToolExecute = (info: ToolExecutionInfo) => void;
|
|
4419
|
+
export type OnToolExecute = (info: ToolExecutionInfo) => void;
|
|
4394
4420
|
/**
|
|
4395
4421
|
* Options for creating an agent toolkit.
|
|
4396
4422
|
*
|
|
@@ -4410,7 +4436,7 @@ type OnToolExecute = (info: ToolExecutionInfo) => void;
|
|
|
4410
4436
|
* });
|
|
4411
4437
|
* ```
|
|
4412
4438
|
*/
|
|
4413
|
-
type MapAgentOptions<CS extends ToolState = ToolState> = {
|
|
4439
|
+
export type MapAgentOptions<CS extends ToolState = ToolState> = {
|
|
4414
4440
|
/** AI SDK language model instance. REQUIRED — no default provider. */
|
|
4415
4441
|
model: LanguageModel;
|
|
4416
4442
|
/**
|
|
@@ -4614,7 +4640,7 @@ type MapAgentOptions<CS extends ToolState = ToolState> = {
|
|
|
4614
4640
|
*
|
|
4615
4641
|
* @group Agent Toolkit
|
|
4616
4642
|
*/
|
|
4617
|
-
type MapAgentInstance<CS extends ToolState = ToolState> = ToolLoopAgent & {
|
|
4643
|
+
export type MapAgentInstance<CS extends ToolState = ToolState> = ToolLoopAgent & {
|
|
4618
4644
|
/** Live agent state (built-in + custom slices). */
|
|
4619
4645
|
readonly state: CS;
|
|
4620
4646
|
/** Tear down: resets all state slices that have a reset() method. */
|
|
@@ -4659,7 +4685,7 @@ type MapAgentInstance<CS extends ToolState = ToolState> = ToolLoopAgent & {
|
|
|
4659
4685
|
* ```
|
|
4660
4686
|
* @group Agent Toolkit
|
|
4661
4687
|
*/
|
|
4662
|
-
declare const createMapAgent: <CS extends ToolState = ToolState>(map: TomTomMap, options: MapAgentOptions<CS>) => MapAgentInstance<CS>;
|
|
4688
|
+
export declare const createMapAgent: <CS extends ToolState = ToolState>(map: TomTomMap, options: MapAgentOptions<CS>) => MapAgentInstance<CS>;
|
|
4663
4689
|
//#endregion
|
|
4664
4690
|
//#region src/resolve-tools.d.ts
|
|
4665
4691
|
/**
|
|
@@ -4679,11 +4705,11 @@ declare const createMapAgent: <CS extends ToolState = ToolState>(map: TomTomMap,
|
|
|
4679
4705
|
*
|
|
4680
4706
|
* @group Agent Toolkit
|
|
4681
4707
|
*/
|
|
4682
|
-
declare const resolveTools: <S extends ToolState>(defaults: Record<string, ToolDefinition<S>>, overrides?: { [K in ToolNameHint]?: ToolEntry<S> | false | undefined; }) => Record<string, ToolDefinition<S>>;
|
|
4708
|
+
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
4709
|
//#endregion
|
|
4684
4710
|
//#region src/tools/utilities/clarify-user-intent.d.ts
|
|
4685
4711
|
/** A single clarification question shown to the user. Exported so a host can type its form state. */
|
|
4686
|
-
declare const questionSchema: z.ZodObject<{
|
|
4712
|
+
export declare const questionSchema: z.ZodObject<{
|
|
4687
4713
|
id: z.ZodString;
|
|
4688
4714
|
question: z.ZodString;
|
|
4689
4715
|
options: z.ZodArray<z.ZodString>;
|
|
@@ -4694,7 +4720,7 @@ type ClarifyIntentQuestion = z.infer<typeof questionSchema>;
|
|
|
4694
4720
|
/**
|
|
4695
4721
|
* Input schema for {@link executeClarifyIntent}.
|
|
4696
4722
|
*/
|
|
4697
|
-
declare const clarifyIntentSchema: z.ZodObject<{
|
|
4723
|
+
export declare const clarifyIntentSchema: z.ZodObject<{
|
|
4698
4724
|
intro: z.ZodOptional<z.ZodString>;
|
|
4699
4725
|
questions: z.ZodArray<z.ZodObject<{
|
|
4700
4726
|
id: z.ZodString;
|
|
@@ -4710,7 +4736,7 @@ declare const clarifyIntentSchema: z.ZodObject<{
|
|
|
4710
4736
|
* (CLARIFY_FORM_PROMPT and CLARIFY_PROSE_PROMPT both tell the agent to STOP and wait), so repeating it
|
|
4711
4737
|
* in the result would be redundant.
|
|
4712
4738
|
*/
|
|
4713
|
-
declare const clarifyIntentOutputSchema: z.ZodObject<{
|
|
4739
|
+
export declare const clarifyIntentOutputSchema: z.ZodObject<{
|
|
4714
4740
|
status: z.ZodLiteral<"awaiting_user_response">;
|
|
4715
4741
|
intro: z.ZodOptional<z.ZodString>;
|
|
4716
4742
|
questions: z.ZodArray<z.ZodObject<{
|
|
@@ -4721,9 +4747,9 @@ declare const clarifyIntentOutputSchema: z.ZodObject<{
|
|
|
4721
4747
|
}, z.core.$strip>>;
|
|
4722
4748
|
}, z.core.$strip>;
|
|
4723
4749
|
/** 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;
|
|
4750
|
+
export declare const CLARIFY_FORM_PROMPT: string;
|
|
4725
4751
|
/** 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;
|
|
4752
|
+
export declare const CLARIFY_PROSE_PROMPT: string;
|
|
4727
4753
|
/** Per-call overrides accepted by {@link createClarifyIntentTool}. */
|
|
4728
4754
|
type ClarifyIntentToolOptions = {
|
|
4729
4755
|
/** Replace the default tool description (e.g. add domain-specific guidance). */
|
|
@@ -4762,6 +4788,6 @@ type ClarifyIntentToolOptions = {
|
|
|
4762
4788
|
* });
|
|
4763
4789
|
* ```
|
|
4764
4790
|
*/
|
|
4765
|
-
declare const createClarifyIntentTool: (options?: ClarifyIntentToolOptions) => ToolEntry;
|
|
4791
|
+
export declare const createClarifyIntentTool: (options?: ClarifyIntentToolOptions) => ToolEntry;
|
|
4766
4792
|
//#endregion
|
|
4767
|
-
export {
|
|
4793
|
+
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 };
|