@arcgis/ai-components 5.2.0-next.10 → 5.2.0-next.101
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.md +4 -2
- package/README.md +2 -2
- package/dist/agent-utils/FunctionAgent.d.ts +2 -2
- package/dist/agent-utils/LLMAgent.d.ts +7 -4
- package/dist/agent-utils/LLMAgent.js +4 -2
- package/dist/agent-utils/WorkflowAgent.d.ts +2 -2
- package/dist/agent-utils/WorkflowAgent.js +14 -15
- package/dist/agent-utils/index.d.ts +177 -0
- package/dist/agent-utils/index.js +167 -0
- package/dist/agent-utils/middlewares/trace.d.ts +2 -0
- package/dist/agent-utils/middlewares/trace.js +25 -33
- package/dist/agent-utils/tools/FunctionTool.d.ts +2 -2
- package/dist/agent-utils/types.d.ts +37 -8
- package/dist/agent-utils/workflows/ConditionalWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/LoopWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/ParallelWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/RouterWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/SequentialWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/SwitchWorkflow.d.ts +2 -2
- package/dist/agentic-workflow/AgenticWorkflowRuntime.d.ts +24 -0
- package/dist/agentic-workflow/Edge.d.ts +16 -0
- package/dist/agentic-workflow/WebAgent.d.ts +39 -0
- package/dist/agentic-workflow/jsonTypes.d.ts +189 -0
- package/dist/agentic-workflow/nodes/AgentNode.d.ts +28 -0
- package/dist/agentic-workflow/nodes/BaseNode.d.ts +35 -0
- package/dist/agentic-workflow/nodes/EndMessageNode.d.ts +25 -0
- package/dist/agentic-workflow/nodes/StartNode.d.ts +21 -0
- package/dist/agentic-workflow/nodes/tools/ArcgisTool.d.ts +21 -0
- package/dist/agentic-workflow/types.d.ts +29 -0
- package/dist/agents/tools/filter/clearFilters/adapter.d.ts +8 -0
- package/dist/agents/tools/filter/clearFilters/adapter.js +22 -0
- package/dist/agents/tools/filter/resetMap/adapter.d.ts +8 -0
- package/dist/agents/tools/filter/resetMap/adapter.js +22 -0
- package/dist/agents/tools/filter/setFeatureEffect/adapter.d.ts +8 -0
- package/dist/agents/tools/filter/setFeatureEffect/adapter.js +121 -0
- package/dist/agents/tools/help/listFields/adapter.d.ts +11 -0
- package/dist/agents/tools/help/listFields/adapter.js +30 -0
- package/dist/agents/tools/navigation/goToAddress/adapter.d.ts +10 -0
- package/dist/agents/tools/navigation/goToAddress/adapter.js +60 -0
- package/dist/agents/tools/navigation/goToBookmark/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToBookmark/adapter.js +30 -0
- package/dist/agents/tools/navigation/goToFeatures/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToFeatures/adapter.js +50 -0
- package/dist/agents/tools/navigation/goToFullExtent/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToFullExtent/adapter.js +27 -0
- package/dist/agents/tools/navigation/goToHomeExtent/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToHomeExtent/adapter.js +24 -0
- package/dist/agents/tools/navigation/goToLayer/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToLayer/adapter.js +26 -0
- package/dist/agents/tools/navigation/goToScale/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToScale/adapter.js +21 -0
- package/dist/agents/tools/navigation/goToViewpoint/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToViewpoint/adapter.js +42 -0
- package/dist/agents/tools/navigation/goToZoom/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToZoom/adapter.js +21 -0
- package/dist/agents/tools/query/getAttribute/adapter.d.ts +8 -0
- package/dist/agents/tools/query/getAttribute/adapter.js +40 -0
- package/dist/agents/tools/query/getStatistics/adapter.d.ts +8 -0
- package/dist/agents/tools/query/getStatistics/adapter.js +157 -0
- package/dist/agents/tools/query/getTopFeatures/adapter.d.ts +8 -0
- package/dist/agents/tools/query/getTopFeatures/adapter.js +144 -0
- package/dist/agents/tools/query/queryFeatures/adapter.d.ts +8 -0
- package/dist/agents/tools/query/queryFeatures/adapter.js +130 -0
- package/dist/agents/tools/search/findRelevantFields/adapter.d.ts +8 -0
- package/dist/agents/tools/search/findRelevantFields/adapter.js +57 -0
- package/dist/agents/tools/search/findRelevantLayers/adapter.d.ts +8 -0
- package/dist/agents/tools/search/findRelevantLayers/adapter.js +38 -0
- package/dist/cdn/22KHSDJI.js +2 -0
- package/dist/cdn/2EY3BQQX.js +2 -0
- package/dist/cdn/{SWOXSJ62.js → 2O4DON37.js} +1 -1
- package/dist/cdn/34O57OGV.js +2 -0
- package/dist/cdn/{5W7S2RS4.js → 3UEKINYC.js} +1 -1
- package/dist/cdn/4OGR5QKS.js +2 -0
- package/dist/cdn/5FL5BTTX.js +66 -0
- package/dist/cdn/5HBAJ57P.js +2 -0
- package/dist/cdn/5K5ZY267.js +2 -0
- package/dist/cdn/5MK44FNO.js +2 -0
- package/dist/cdn/5WYRJMBW.js +2 -0
- package/dist/cdn/5X7EG7D2.js +2 -0
- package/dist/cdn/5XZLS7UO.js +2 -0
- package/dist/cdn/5ZFUGNRN.js +2 -0
- package/dist/cdn/655YIKL3.js +11 -0
- package/dist/cdn/6ECRQVHY.js +2 -0
- package/dist/cdn/6OOZSZRJ.js +2 -0
- package/dist/cdn/{D3TNNRP4.js → 6P44KOKX.js} +1 -1
- package/dist/cdn/6YYPVU7H.js +3 -0
- package/dist/cdn/7BCQMK6D.js +2 -0
- package/dist/cdn/7SRLZQVC.js +5 -0
- package/dist/cdn/7V6OSTFC.js +2 -0
- package/dist/cdn/7VAQUCBU.js +9 -0
- package/dist/cdn/7VUSIGEM.js +2 -0
- package/dist/cdn/ACJTJLZN.js +2 -0
- package/dist/cdn/AI6DYOKR.js +181 -0
- package/dist/cdn/AKD5UOVX.js +2 -0
- package/dist/cdn/ANRQWYU2.js +2 -0
- package/dist/cdn/{ZS2TZ6BF.js → AOVJ34QE.js} +1 -1
- package/dist/cdn/APFZY4PI.js +2 -0
- package/dist/cdn/B2JDVLA6.js +2 -0
- package/dist/cdn/BE7BRJZD.js +2 -0
- package/dist/cdn/{FL4W4VYN.js → BL273EGZ.js} +17 -1
- package/dist/cdn/C4FEETBZ.js +2 -0
- package/dist/cdn/C4JT4S5E.js +2 -0
- package/dist/cdn/CCC6LBMY.js +2 -0
- package/dist/cdn/{5ZZGKP7N.js → CEKOEHB3.js} +1 -1
- package/dist/cdn/CJMUJXPL.js +2 -0
- package/dist/cdn/COH3QXWG.js +4 -0
- package/dist/cdn/CP5BVGJU.js +2 -0
- package/dist/cdn/D5UFYQHN.js +44 -0
- package/dist/cdn/EWLXNGKH.js +208 -0
- package/dist/cdn/EYOWRGDP.js +2 -0
- package/dist/cdn/F5NIRETW.js +2 -0
- package/dist/cdn/FDOMMK2M.js +2 -0
- package/dist/cdn/FG647IP6.js +2 -0
- package/dist/cdn/FJO4KNOZ.js +2 -0
- package/dist/cdn/FUF3NAU7.js +2 -0
- package/dist/cdn/FXP5UIQU.js +156 -0
- package/dist/cdn/{T537PKP4.js → FYZATVB3.js} +1 -1
- package/dist/cdn/G2EGT3CF.js +6 -0
- package/dist/cdn/G3SF6U2U.js +2 -0
- package/dist/cdn/G7OMHU2B.js +2 -0
- package/dist/cdn/HAEFC2SJ.js +2 -0
- package/dist/cdn/HDACNIZF.js +2 -0
- package/dist/cdn/HHFNQR6Z.js +2 -0
- package/dist/cdn/HHUQXL3R.js +2 -0
- package/dist/cdn/IBZ2NEAO.js +2 -0
- package/dist/cdn/{FX7UOGHP.js → ICBIUFK7.js} +1 -1
- package/dist/cdn/ICQCK5D3.js +2 -0
- package/dist/cdn/IHP25JWI.js +99 -0
- package/dist/cdn/IJVMUS2L.js +14 -0
- package/dist/cdn/J6A4AS7E.js +22 -0
- package/dist/cdn/J6SZIQJA.js +2 -0
- package/dist/cdn/JCOA24UH.js +3 -0
- package/dist/cdn/{NE7E52YR.js → JEBRN3EU.js} +9 -3
- package/dist/cdn/JO5ETMPS.js +2 -0
- package/dist/cdn/K2R6XVK3.js +2 -0
- package/dist/cdn/KITIP6J2.js +2 -0
- package/dist/cdn/KWD2ECTM.js +2 -0
- package/dist/cdn/{MODWHY3R.js → LAYVGCPL.js} +6 -4
- package/dist/cdn/{7RCQFLPP.js → LK7ZIQW6.js} +1 -1
- package/dist/cdn/LLUGJKAQ.js +2 -0
- package/dist/cdn/MWYBF3F3.js +66 -0
- package/dist/cdn/{VMXLYWUK.js → MXTXJKFE.js} +1 -1
- package/dist/cdn/MY47B3CE.js +3 -0
- package/dist/cdn/NEV6OZN3.js +71 -0
- package/dist/cdn/NNXISHCA.js +14 -0
- package/dist/cdn/NZSOJ726.js +2 -0
- package/dist/cdn/O4NVW75A.js +2 -0
- package/dist/cdn/OE3GW5LE.js +2 -0
- package/dist/cdn/{23EQTPO3.js → OKVLGJAG.js} +1 -1
- package/dist/cdn/ONQ6JSBJ.js +2 -0
- package/dist/cdn/OX64WOEL.js +22 -0
- package/dist/cdn/{LQ6R5YRN.js → PQ2DPOFM.js} +1 -1
- package/dist/cdn/PUHRBGKB.js +2 -0
- package/dist/cdn/Q57QWN5W.js +2 -0
- package/dist/cdn/QUKNPVAF.js +2 -0
- package/dist/cdn/R2PQVY4O.js +2 -0
- package/dist/cdn/R74ZHFA6.js +2 -0
- package/dist/cdn/RBE55SWR.js +2 -0
- package/dist/cdn/RHYNE5OE.js +2 -0
- package/dist/cdn/RLEHNAIA.js +2 -0
- package/dist/cdn/RVSTAUQS.js +2 -0
- package/dist/cdn/{X2ZDYHCG.js → SDWWUWAF.js} +10 -5
- package/dist/cdn/{GTLS44GI.js → SXM4NUT5.js} +1 -1
- package/dist/cdn/SZ2QSSB3.js +2 -0
- package/dist/cdn/T4RIGOXB.js +2 -0
- package/dist/cdn/TCH5I5LS.js +2 -0
- package/dist/cdn/TEPP7YPR.js +2 -0
- package/dist/cdn/TMVF2W5N.js +36 -0
- package/dist/cdn/TPULIO6I.js +34 -0
- package/dist/cdn/UDRKUVZP.js +2 -0
- package/dist/cdn/{6YMR4QSD.js → UHEYPSOR.js} +1 -1
- package/dist/cdn/UHNVDALX.js +18 -0
- package/dist/cdn/UZLQALHY.js +2 -0
- package/dist/cdn/V6HOUZPZ.js +2 -0
- package/dist/cdn/VAXH6RUQ.js +134 -0
- package/dist/cdn/VLLZ2FFU.js +2 -0
- package/dist/cdn/VOKXKU7M.js +56 -0
- package/dist/cdn/VXFQANGJ.js +2 -0
- package/dist/cdn/WGO5SER7.js +6 -0
- package/dist/cdn/WJXXOKGA.js +9 -0
- package/dist/cdn/WKTQVBFJ.js +2 -0
- package/dist/cdn/{2SJAOYZT.js → WSWB3B7B.js} +1 -1
- package/dist/cdn/XX6GHMNR.js +2 -0
- package/dist/cdn/Y7XD7ZRD.js +2 -0
- package/dist/cdn/YEZ3AMNX.js +2 -0
- package/dist/cdn/YLVJA4ZE.js +2 -0
- package/dist/cdn/Z5HWPSZN.js +2 -0
- package/dist/cdn/Z5W4V7RC.js +2 -0
- package/dist/cdn/ZDV4K4WG.js +2 -0
- package/dist/cdn/ZOEMBHRF.js +2 -0
- package/dist/cdn/ZRVZMPFN.js +2 -0
- package/dist/cdn/{ZTBA5PM7.js → ZU2FHVNK.js} +1 -1
- package/dist/cdn/agent-utils/index.js +2 -0
- package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +3 -0
- package/dist/cdn/agent-utils/middlewares/middleware.js +2 -0
- package/dist/cdn/agent-utils/middlewares/trace.js +2 -0
- package/dist/cdn/assets/assistant/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/assistant-message/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/assistant-message-loading/t9n/messages.en.json +1 -0
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/adapter.js +1295 -2104
- package/dist/chunks/arcgisKnowledgeGraph.js +128 -72
- package/dist/chunks/arcgis_knowledge_current_lc_context.js +19 -2
- package/dist/chunks/arcgis_knowledge_current_map_context.js +31 -2
- package/dist/chunks/arcgis_knowledge_cypher_query_prompt.js +102 -0
- package/dist/chunks/arcgis_knowledge_summarize_result_prompt.js +116 -27
- package/dist/chunks/baseAgentState.js +58 -0
- package/dist/chunks/converterUtils.js +66 -41
- package/dist/chunks/dataExplorationGraph.js +131 -182
- package/dist/chunks/data_explore_query_prompt.js +9 -4
- package/dist/chunks/fetchAgentContext.js +13 -0
- package/dist/chunks/fetchService.js +10 -0
- package/dist/chunks/fieldStatistics.js +79 -0
- package/dist/chunks/formatFeatureAttributes.js +132 -0
- package/dist/chunks/generateLayerDescriptions.js +259 -282
- package/dist/chunks/helpGraph.js +35 -25
- package/dist/chunks/help_prompt.js +34 -17
- package/dist/chunks/index.js +11 -0
- package/dist/chunks/intent_prompt.js +16 -0
- package/dist/chunks/layerStylingGraph.js +39 -33
- package/dist/chunks/mergeWhereClauses.js +15 -0
- package/dist/chunks/navigationGraph.js +140 -116
- package/dist/chunks/navigation_intent_prompt.js +8 -2
- package/dist/chunks/orchestrator.js +444 -233
- package/dist/chunks/resolvePointGeometryFilter.js +92 -0
- package/dist/chunks/state.js +21 -27
- package/dist/chunks/toolCallResponse.js +14 -10
- package/dist/chunks/utils2.js +11 -11
- package/dist/components/arcgis-assistant/customElement.d.ts +82 -1
- package/dist/components/arcgis-assistant/customElement.js +332 -183
- package/dist/components/arcgis-assistant-agent/customElement.d.ts +13 -1
- package/dist/components/arcgis-assistant-agent/customElement.js +614 -10
- package/dist/components/arcgis-assistant-chat/customElement.js +22 -17
- package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +20 -4
- package/dist/components/arcgis-assistant-help-agent/customElement.js +29 -7
- package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -0
- package/dist/components/arcgis-assistant-interrupt/customElement.js +11 -12
- package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +12 -8
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.d.ts +7 -7
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +40 -16
- package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +30 -7
- package/dist/components/arcgis-assistant-message/customElement.d.ts +3 -0
- package/dist/components/arcgis-assistant-message/customElement.js +9 -8
- package/dist/components/arcgis-assistant-message-block/customElement.js +1 -1
- package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +3 -0
- package/dist/components/arcgis-assistant-message-loading/customElement.js +11 -10
- package/dist/components/arcgis-assistant-message-text/customElement.d.ts +1 -0
- package/dist/components/arcgis-assistant-message-text/customElement.js +12 -12
- package/dist/components/arcgis-assistant-navigation-agent/customElement.js +18 -4
- package/dist/components/arcgis-assistant-speech-input/customElement.js +34 -52
- package/dist/components/arcgis-assistant-user-message/customElement.d.ts +2 -0
- package/dist/components/arcgis-assistant-user-message/customElement.js +15 -10
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +6 -6
- package/dist/oauth-callback.html +1 -1
- package/dist/orchestrator/orchestrator/orchestratorEvents.d.ts +78 -0
- package/dist/types/lumina.d.ts +5 -4
- package/dist/types/preact.d.ts +5 -4
- package/dist/types/react.d.ts +5 -4
- package/dist/types/stencil.d.ts +7 -6
- package/dist/utils/index.d.ts +65 -38
- package/dist/utils/index.js +56 -55
- package/package.json +32 -12
- package/dist/cdn/462JBSEV.js +0 -422
- package/dist/cdn/5QAHYX7Y.js +0 -5
- package/dist/cdn/64PJB5NU.js +0 -2
- package/dist/cdn/6AWNQHCO.js +0 -4
- package/dist/cdn/AXDZBBNL.js +0 -45
- package/dist/cdn/BIV2IPHH.js +0 -2
- package/dist/cdn/CCY4TSBO.js +0 -2
- package/dist/cdn/CTSALWEP.js +0 -2
- package/dist/cdn/D2N2NSRQ.js +0 -72
- package/dist/cdn/DOV5ZJ7M.js +0 -2
- package/dist/cdn/EEUCKMU7.js +0 -2
- package/dist/cdn/EGHBXLNG.js +0 -2
- package/dist/cdn/ETRWZ3MS.js +0 -108
- package/dist/cdn/EWI4V3GQ.js +0 -36
- package/dist/cdn/F2AHA4GB.js +0 -54
- package/dist/cdn/I6HNBTWY.js +0 -2
- package/dist/cdn/JBHNHHWO.js +0 -3
- package/dist/cdn/JOFUPKIB.js +0 -2
- package/dist/cdn/KMQ3SP4I.js +0 -5
- package/dist/cdn/KUEOKIQR.js +0 -2
- package/dist/cdn/LKRAPK4A.js +0 -165
- package/dist/cdn/NXKKG5TK.js +0 -2
- package/dist/cdn/OBUZ7HBN.js +0 -2
- package/dist/cdn/OIVRK7HT.js +0 -2
- package/dist/cdn/RUURNLTP.js +0 -2
- package/dist/cdn/RVOAPUBN.js +0 -2
- package/dist/cdn/TSZPHE7L.js +0 -22
- package/dist/cdn/VAZNJSKA.js +0 -16
- package/dist/cdn/VNQN5ZQO.js +0 -14
- package/dist/cdn/WIDTPVSU.js +0 -2
- package/dist/cdn/XER22VYQ.js +0 -3
- package/dist/cdn/YIMNOUTF.js +0 -2
|
@@ -1,64 +1,83 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { StateGraph as
|
|
3
|
-
import {
|
|
2
|
+
import { StateGraph as E, START as $, END as R } from "@langchain/langgraph/web";
|
|
3
|
+
import { g as T, t as C, r as F, N as k } from "./adapter.js";
|
|
4
4
|
import "@arcgis/core/identity/IdentityManager.js";
|
|
5
5
|
import "@arcgis/core/portal/Portal.js";
|
|
6
|
-
import
|
|
6
|
+
import "@arcgis/core/request.js";
|
|
7
|
+
import "@arcgis/toolkit/string";
|
|
8
|
+
import { h as L, i as M } from "./generateLayerDescriptions.js";
|
|
7
9
|
import "@langchain/core/messages";
|
|
8
10
|
import "@langchain/core/callbacks/dispatch/web";
|
|
11
|
+
import "@langchain/core/callbacks/base";
|
|
9
12
|
import "@langchain/openai";
|
|
13
|
+
import "@arcgis/core/config.js";
|
|
10
14
|
import "@arcgis/core/core/reactiveUtils.js";
|
|
11
15
|
import "@arcgis/core/layers/FeatureLayer.js";
|
|
12
|
-
import "
|
|
16
|
+
import { goToAddressTool as A } from "../agents/tools/navigation/goToAddress/adapter.js";
|
|
17
|
+
import { goToBookmarkTool as _ } from "../agents/tools/navigation/goToBookmark/adapter.js";
|
|
18
|
+
import { goToFeaturesTool as I } from "../agents/tools/navigation/goToFeatures/adapter.js";
|
|
19
|
+
import { goToFullExtentTool as q } from "../agents/tools/navigation/goToFullExtent/adapter.js";
|
|
20
|
+
import { goToHomeExtentTool as Z } from "../agents/tools/navigation/goToHomeExtent/adapter.js";
|
|
21
|
+
import { goToLayerTool as V } from "../agents/tools/navigation/goToLayer/adapter.js";
|
|
22
|
+
import { goToScaleTool as j } from "../agents/tools/navigation/goToScale/adapter.js";
|
|
23
|
+
import { goToViewpointTool as P } from "../agents/tools/navigation/goToViewpoint/adapter.js";
|
|
24
|
+
import { goToZoomTool as z } from "../agents/tools/navigation/goToZoom/adapter.js";
|
|
25
|
+
import { f as w } from "./fetchAgentContext.js";
|
|
26
|
+
import { h as G } from "./toolCallResponse.js";
|
|
27
|
+
import { s as p } from "./index.js";
|
|
13
28
|
import "@langchain/core/prompts";
|
|
14
|
-
import { ToolNode as
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
R,
|
|
19
|
-
L,
|
|
20
|
-
M,
|
|
29
|
+
import { ToolNode as O } from "@langchain/langgraph/prebuilt";
|
|
30
|
+
import S from "zod";
|
|
31
|
+
import { f as y } from "./fetchService.js";
|
|
32
|
+
const f = [
|
|
21
33
|
A,
|
|
22
34
|
_,
|
|
23
35
|
I,
|
|
24
36
|
q,
|
|
25
|
-
Z
|
|
37
|
+
Z,
|
|
38
|
+
V,
|
|
39
|
+
j,
|
|
40
|
+
P,
|
|
41
|
+
z
|
|
26
42
|
];
|
|
27
|
-
async function
|
|
28
|
-
const o = await T("navigation_tool_prompt"), { mapView: s } =
|
|
29
|
-
(
|
|
43
|
+
async function B(e, t) {
|
|
44
|
+
const o = await T("navigation_tool_prompt"), { mapView: s } = w(t, ["mapView"]), c = s.map.bookmarks?.map((u) => u.name).filter(Boolean) ?? [], m = e.vectorSearchLayerResults?.length > 0 ? e.vectorSearchLayerResults.map(
|
|
45
|
+
(u, b) => `${b + 1}. layerId=${u.id} | title=${u.title ?? ""} | name=${u.name ?? ""} | score=${u.score.toFixed(2)}`
|
|
30
46
|
).join(`
|
|
31
|
-
`) : "",
|
|
32
|
-
${
|
|
33
|
-
`)}` : "",
|
|
34
|
-
${
|
|
35
|
-
${
|
|
47
|
+
`) : "", l = e.vectorSearchFieldResults?.length > 0 ? JSON.stringify(e.vectorSearchFieldResults, null, 2) : "", r = e.intent === "goToBookmark" && c.length ? `Available bookmarks:
|
|
48
|
+
${c.map((u) => `- ${u}`).join(`
|
|
49
|
+
`)}` : "", a = (e.intent === "goToLayer" || e.intent === "goToFeatures") && e.vectorSearchLayerResults?.length ? `Candidate layers:
|
|
50
|
+
${m}` : "", i = e.intent === "goToFeatures" && e.vectorSearchFieldResults?.length ? `Candidate fields:
|
|
51
|
+
${l}` : "", h = {
|
|
36
52
|
intent: e.intent,
|
|
37
|
-
bookmarksSection:
|
|
38
|
-
layersSection:
|
|
39
|
-
fieldsSection:
|
|
53
|
+
bookmarksSection: r,
|
|
54
|
+
layersSection: a,
|
|
55
|
+
fieldsSection: i,
|
|
40
56
|
currentZoom: s.zoom,
|
|
41
57
|
assignedTask: e.agentExecutionContext.assignedTask,
|
|
42
58
|
userRequest: e.agentExecutionContext.userRequest,
|
|
43
59
|
priorSteps: e.agentExecutionContext.priorSteps
|
|
44
|
-
}, n = await
|
|
60
|
+
}, n = await L({
|
|
45
61
|
promptText: o,
|
|
46
62
|
modelTier: "fast",
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
63
|
+
config: t,
|
|
64
|
+
inputVariables: h,
|
|
65
|
+
tools: f
|
|
66
|
+
});
|
|
67
|
+
await G(n, t);
|
|
68
|
+
const g = (n.tool_calls?.length ?? 0) > 0, v = typeof n.text == "string" ? n.text.trim() : "", N = v.length > 0;
|
|
50
69
|
return {
|
|
51
70
|
...e,
|
|
52
71
|
navigationInternalState: {
|
|
53
72
|
...e.navigationInternalState,
|
|
54
|
-
toolCallMessage:
|
|
73
|
+
toolCallMessage: g ? n : void 0
|
|
55
74
|
},
|
|
56
75
|
// No tool call => surface fallback text now. Tool call => tool node will set output.
|
|
57
|
-
outputMessage:
|
|
58
|
-
status:
|
|
76
|
+
outputMessage: g ? e.outputMessage : v,
|
|
77
|
+
status: g ? e.status : N ? "success" : "failed"
|
|
59
78
|
};
|
|
60
79
|
}
|
|
61
|
-
const
|
|
80
|
+
const D = (e) => {
|
|
62
81
|
const t = typeof e == "string" ? e : String(e);
|
|
63
82
|
try {
|
|
64
83
|
const o = JSON.parse(t);
|
|
@@ -69,45 +88,48 @@ const B = (e) => {
|
|
|
69
88
|
}
|
|
70
89
|
return { text: t };
|
|
71
90
|
};
|
|
72
|
-
async function
|
|
73
|
-
const o = new
|
|
91
|
+
async function J(e, t) {
|
|
92
|
+
const o = new O(f, { handleToolErrors: !1 });
|
|
74
93
|
try {
|
|
75
94
|
const s = e.navigationInternalState.toolCallMessage;
|
|
76
95
|
if (!s)
|
|
77
96
|
throw new Error("navigationToolCalling: missing navigationInternalState.toolCallMessage");
|
|
78
|
-
const { messages:
|
|
97
|
+
const { messages: d } = await o.invoke(
|
|
79
98
|
{
|
|
80
99
|
messages: [s]
|
|
81
100
|
},
|
|
82
101
|
t
|
|
83
102
|
);
|
|
84
|
-
let
|
|
85
|
-
for (const
|
|
86
|
-
const a =
|
|
87
|
-
a.text && (
|
|
88
|
-
`)
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
103
|
+
let c = "", m, l;
|
|
104
|
+
for (const r of d) {
|
|
105
|
+
const a = D(r.content), i = r.artifact;
|
|
106
|
+
a.text && (c += `${a.text}
|
|
107
|
+
`);
|
|
108
|
+
const h = i?.sharedStatePatch ?? a.sharedStatePatch;
|
|
109
|
+
h && (m = {
|
|
110
|
+
...m,
|
|
111
|
+
...h
|
|
112
|
+
}), i?.sharedResourceAdditions && (l = [...l ?? [], ...i.sharedResourceAdditions]);
|
|
92
113
|
}
|
|
93
|
-
return await
|
|
114
|
+
return await p({ text: `Finished executing navigation tool: ${c}` }, t), {
|
|
94
115
|
...e,
|
|
95
|
-
outputMessage:
|
|
96
|
-
sharedStatePatch:
|
|
116
|
+
outputMessage: c,
|
|
117
|
+
sharedStatePatch: m,
|
|
118
|
+
sharedResourceAdditions: l,
|
|
97
119
|
status: "success",
|
|
98
|
-
summary:
|
|
120
|
+
summary: c ? C(c) : "Navigation executed.",
|
|
99
121
|
navigationInternalState: {
|
|
100
122
|
...e.navigationInternalState,
|
|
101
123
|
toolCallMessage: void 0
|
|
102
124
|
}
|
|
103
125
|
};
|
|
104
126
|
} catch (s) {
|
|
105
|
-
const
|
|
106
|
-
return await
|
|
127
|
+
const d = s instanceof Error ? s.message : String(s);
|
|
128
|
+
return await p({ text: `Navigation tool execution failed: ${d}` }, t), {
|
|
107
129
|
...e,
|
|
108
|
-
outputMessage: `Navigation tool execution failed: ${
|
|
130
|
+
outputMessage: `Navigation tool execution failed: ${d}`,
|
|
109
131
|
status: "failed",
|
|
110
|
-
summary: `Navigation tool execution failed: ${
|
|
132
|
+
summary: `Navigation tool execution failed: ${d}`,
|
|
111
133
|
navigationInternalState: {
|
|
112
134
|
...e.navigationInternalState,
|
|
113
135
|
toolCallMessage: void 0
|
|
@@ -115,113 +137,115 @@ async function D(e, t) {
|
|
|
115
137
|
};
|
|
116
138
|
}
|
|
117
139
|
}
|
|
118
|
-
async function
|
|
119
|
-
const o = await T("navigation_intent_prompt"), { mapView: s } =
|
|
140
|
+
async function H(e, t) {
|
|
141
|
+
const o = await T("navigation_intent_prompt"), { mapView: s } = w(t, ["mapView"]), d = f.map((n) => ({
|
|
120
142
|
name: n.name,
|
|
121
143
|
description: n.description,
|
|
122
144
|
schema: n.schema
|
|
123
|
-
})),
|
|
124
|
-
${
|
|
125
|
-
`)}` : "",
|
|
126
|
-
tools:
|
|
145
|
+
})), m = s.map.bookmarks?.map((n) => n.name).filter(Boolean) ?? [], l = m.length ? `Available bookmarks:
|
|
146
|
+
${m.map((n) => `- ${n}`).join(`
|
|
147
|
+
`)}` : "No bookmarks are available in this map.", r = {
|
|
148
|
+
tools: d.map(({ name: n, description: g, schema: v }) => `${n}: ${g}, ${JSON.stringify(v)}`).join(`
|
|
127
149
|
`),
|
|
128
|
-
bookmarks:
|
|
150
|
+
bookmarks: l,
|
|
129
151
|
assignedTask: e.agentExecutionContext.assignedTask,
|
|
130
152
|
userRequest: e.agentExecutionContext.userRequest,
|
|
131
153
|
priorSteps: e.agentExecutionContext.priorSteps
|
|
132
|
-
},
|
|
133
|
-
intent:
|
|
134
|
-
}),
|
|
154
|
+
}, a = S.object({
|
|
155
|
+
intent: S.string()
|
|
156
|
+
}), i = await M({
|
|
135
157
|
promptText: o,
|
|
136
|
-
|
|
137
|
-
|
|
158
|
+
config: t,
|
|
159
|
+
inputVariables: r,
|
|
160
|
+
schema: a,
|
|
138
161
|
modelTier: "fast"
|
|
139
|
-
}),
|
|
140
|
-
return { ...e, intent:
|
|
162
|
+
}), h = typeof i.intent == "string" ? i.intent.trim().replace(/^"|"$/gu, "") : "";
|
|
163
|
+
return { ...e, intent: h || "" };
|
|
141
164
|
}
|
|
142
|
-
const
|
|
165
|
+
const U = 0.7, W = async (e, t) => {
|
|
143
166
|
try {
|
|
144
|
-
await
|
|
167
|
+
await p(
|
|
145
168
|
{ text: `Similarity search to find layers: ${e.agentExecutionContext.assignedTask}` },
|
|
146
169
|
t
|
|
147
170
|
);
|
|
148
|
-
const o =
|
|
171
|
+
const o = y(t, "layerSearch"), s = y(t, "layersAndFieldsRegistry"), d = y(t, "embeddingCache"), m = (await o.searchLayers({
|
|
149
172
|
text: e.agentExecutionContext.assignedTask,
|
|
150
|
-
minScore:
|
|
151
|
-
embeddingCache:
|
|
152
|
-
})).map(({ id:
|
|
153
|
-
const
|
|
173
|
+
minScore: U,
|
|
174
|
+
embeddingCache: d
|
|
175
|
+
})).map(({ id: r, score: a }) => {
|
|
176
|
+
const i = s.get(r)?.layerItem;
|
|
154
177
|
return {
|
|
155
|
-
id:
|
|
156
|
-
title:
|
|
157
|
-
name:
|
|
158
|
-
score:
|
|
178
|
+
id: r,
|
|
179
|
+
title: i?.title,
|
|
180
|
+
name: i?.name ?? void 0,
|
|
181
|
+
score: a
|
|
159
182
|
};
|
|
160
183
|
});
|
|
161
|
-
let
|
|
162
|
-
return
|
|
163
|
-
${
|
|
164
|
-
`)}` :
|
|
184
|
+
let l;
|
|
185
|
+
return m.length > 0 ? l = `Vector search completed. Matching layers:
|
|
186
|
+
${m.map((r) => `- layerId=${r.id} | title=${r.title ?? ""} | name=${r.name ?? ""} | score=${r.score.toFixed(2)}`).join(`
|
|
187
|
+
`)}` : l = "Vector search completed. No matching layers found.", await p({ text: l }, t), {
|
|
165
188
|
...e,
|
|
166
|
-
vectorSearchLayerResults:
|
|
189
|
+
vectorSearchLayerResults: m
|
|
167
190
|
};
|
|
168
191
|
} catch (o) {
|
|
169
|
-
throw await
|
|
192
|
+
throw await p(
|
|
170
193
|
{ text: `Error during vector search layers: ${o instanceof Error ? o.message : String(o)}` },
|
|
171
194
|
t
|
|
172
195
|
), o;
|
|
173
196
|
}
|
|
174
|
-
},
|
|
197
|
+
}, x = 0.7, K = 10, Q = async (e, t) => {
|
|
175
198
|
try {
|
|
176
|
-
await
|
|
199
|
+
await p(
|
|
177
200
|
{ text: `Similarity search to find fields: ${e.agentExecutionContext.assignedTask}` },
|
|
178
201
|
t
|
|
179
202
|
);
|
|
180
|
-
const o =
|
|
181
|
-
if (
|
|
182
|
-
return await
|
|
183
|
-
const
|
|
203
|
+
const o = y(t, "fieldSearch"), s = y(t, "layersAndFieldsRegistry"), d = y(t, "embeddingCache"), c = e.vectorSearchLayerResults?.map((a) => a.id) ?? [];
|
|
204
|
+
if (c.length === 0)
|
|
205
|
+
return await p({ text: "No candidate layers for field search" }, t), e;
|
|
206
|
+
const l = (await o.searchFields({
|
|
184
207
|
text: e.agentExecutionContext.assignedTask,
|
|
185
|
-
layerIds:
|
|
186
|
-
minScore:
|
|
187
|
-
topResults:
|
|
188
|
-
embeddingCache:
|
|
189
|
-
})).map(({ layerId:
|
|
190
|
-
const
|
|
208
|
+
layerIds: c,
|
|
209
|
+
minScore: x,
|
|
210
|
+
topResults: K,
|
|
211
|
+
embeddingCache: d
|
|
212
|
+
})).map(({ layerId: a, results: i }) => {
|
|
213
|
+
const h = s.get(a)?.fieldRegistry;
|
|
191
214
|
return {
|
|
192
|
-
layerId:
|
|
193
|
-
layerName: s.get(
|
|
194
|
-
results:
|
|
195
|
-
const
|
|
215
|
+
layerId: a,
|
|
216
|
+
layerName: s.get(a)?.layerItem.name,
|
|
217
|
+
results: i.map((n) => {
|
|
218
|
+
const g = h?.get(n.name);
|
|
196
219
|
return {
|
|
197
220
|
name: n.name,
|
|
198
221
|
score: n.score,
|
|
199
|
-
type:
|
|
200
|
-
alias:
|
|
201
|
-
description:
|
|
202
|
-
statistics:
|
|
222
|
+
type: g?.type,
|
|
223
|
+
alias: g?.alias,
|
|
224
|
+
description: g?.description,
|
|
225
|
+
statistics: g?.statistics,
|
|
226
|
+
domain: g?.domain
|
|
203
227
|
};
|
|
204
228
|
})
|
|
205
229
|
};
|
|
206
230
|
});
|
|
207
|
-
let
|
|
208
|
-
return
|
|
209
|
-
${
|
|
210
|
-
(
|
|
211
|
-
${
|
|
231
|
+
let r;
|
|
232
|
+
return l.length > 0 ? r = `Vector search completed. Matching layers and fields:
|
|
233
|
+
${l.map(
|
|
234
|
+
(a) => `${a.layerName ?? a.layerId}:
|
|
235
|
+
${a.results.map((i) => ` - ${i.name} (${i.score.toFixed(2)})`).join(`
|
|
212
236
|
`)}`
|
|
213
237
|
).join(`
|
|
214
|
-
`)}` :
|
|
238
|
+
`)}` : r = `No vector search field results found for score over ${x}.`, await p({ text: r }, t), {
|
|
215
239
|
...e,
|
|
216
|
-
vectorSearchFieldResults:
|
|
240
|
+
vectorSearchFieldResults: l
|
|
217
241
|
};
|
|
218
242
|
} catch (o) {
|
|
219
|
-
throw await
|
|
243
|
+
throw await p(
|
|
220
244
|
{ text: `Error during vector search fields: ${o instanceof Error ? o.message : String(o)}` },
|
|
221
245
|
t
|
|
222
246
|
), o;
|
|
223
247
|
}
|
|
224
|
-
},
|
|
248
|
+
}, X = (e, t) => F(["layerSearch", "layersAndFieldsRegistry"], "Navigation Agent")(e, t), Y = () => new E(k).addNode("requireNavigationServices", X).addNode("intentLLM", H).addNode("vectorSearchLayers", W).addNode("vectorSearchFields", Q).addNode("agent", B).addNode("tools", J).addEdge($, "requireNavigationServices").addEdge("requireNavigationServices", "intentLLM").addConditionalEdges(
|
|
225
249
|
"intentLLM",
|
|
226
250
|
(t) => t.intent === "goToLayer" || t.intent === "goToFeatures" ? "vectorSearchLayers" : "agent",
|
|
227
251
|
{
|
|
@@ -235,7 +259,7 @@ ${r.results.map((d) => ` - ${d.name} (${d.score.toFixed(2)})`).join(`
|
|
|
235
259
|
vectorSearchFields: "vectorSearchFields",
|
|
236
260
|
agent: "agent"
|
|
237
261
|
}
|
|
238
|
-
).addEdge("vectorSearchFields", "agent").addEdge("agent", "tools").addEdge("tools",
|
|
262
|
+
).addEdge("vectorSearchFields", "agent").addEdge("agent", "tools").addEdge("tools", R), ee = String.raw`- **navigation** — Enables users to interact with the map by navigating to specific locations, layers, features, or extents.
|
|
239
263
|
This includes zooming, panning, centering, or geocoding based on user input. The agent is designed to handle explicit map movement requests. NOTE: DO NOT call this agent if the user asks "show me...", that is meant to be handled by another agent. If the query is about where a certain address is, call this agent.
|
|
240
264
|
|
|
241
265
|
Supported actions:
|
|
@@ -254,13 +278,13 @@ ${r.results.map((d) => ` - ${d.name} (${d.score.toFixed(2)})`).join(`
|
|
|
254
278
|
_Example: “Center the map on San Francisco at scale 50000”_
|
|
255
279
|
_Example: “Zoom to the features in the schools layer where city = 'Austin'”_
|
|
256
280
|
_Example: “Go to the Downtown bookmark”_
|
|
257
|
-
_Example: “Where is Mount Rainier?”_`,
|
|
281
|
+
_Example: “Where is Mount Rainier?”_`, Le = {
|
|
258
282
|
id: "navigation",
|
|
259
283
|
name: "Navigation Agent",
|
|
260
|
-
description:
|
|
261
|
-
createGraph:
|
|
262
|
-
workspace:
|
|
284
|
+
description: ee,
|
|
285
|
+
createGraph: Y,
|
|
286
|
+
workspace: k
|
|
263
287
|
};
|
|
264
288
|
export {
|
|
265
|
-
|
|
289
|
+
Le as N
|
|
266
290
|
};
|
|
@@ -36,8 +36,14 @@ This is the order of preference in case of overlap:
|
|
|
36
36
|
|
|
37
37
|
For example, "Where is Yosemite National Park". This is an address, but:
|
|
38
38
|
A map that contains a bookmark with Yosemite National Park should prefer the bookmark.
|
|
39
|
-
|
|
40
|
-
If these do not exist, geocode and go to that address.
|
|
39
|
+
If bookmark does not exist, a map that has the National Parks layer, for example, should prefer the feature.
|
|
40
|
+
If both of these do not exist, geocode and go to that address.
|
|
41
|
+
|
|
42
|
+
Additional mapping guidance:
|
|
43
|
+
|
|
44
|
+
- "zoom/go to [layer]" with no filter → prefer \`goToLayer\`.
|
|
45
|
+
- "zoom/go to [features] where/with ..." (has a condition/filter) → prefer \`goToFeatures\`.
|
|
46
|
+
- Explicit numeric zoom/scale/viewpoint requests → prefer the matching zoom/scale/viewpoint tool.
|
|
41
47
|
|
|
42
48
|
Return the name of the tool as a string.
|
|
43
49
|
`;
|