@arcgis/ai-components 5.2.0-next.8 → 5.2.0-next.84
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 +3 -2
- package/dist/agent-utils/WorkflowAgent.d.ts +2 -2
- 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 +183 -0
- package/dist/agentic-workflow/nodes/AgentNode.d.ts +27 -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 +109 -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 +52 -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 +154 -0
- package/dist/agents/tools/query/getTopFeatures/adapter.d.ts +8 -0
- package/dist/agents/tools/query/getTopFeatures/adapter.js +141 -0
- package/dist/agents/tools/query/queryFeatures/adapter.d.ts +8 -0
- package/dist/agents/tools/query/queryFeatures/adapter.js +127 -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/2EY3BQQX.js +2 -0
- package/dist/cdn/34O57OGV.js +2 -0
- package/dist/cdn/3POGAH2X.js +2 -0
- package/dist/cdn/3SEKXQVK.js +9 -0
- package/dist/cdn/{AMP6IALT.js → 3UEKINYC.js} +1 -1
- package/dist/cdn/434TAA3J.js +2 -0
- package/dist/cdn/4HDDRBIY.js +2 -0
- package/dist/cdn/4NJ2FF7H.js +2 -0
- package/dist/cdn/4OGR5QKS.js +2 -0
- package/dist/cdn/4QGVOLW6.js +22 -0
- package/dist/cdn/4WIDLQUH.js +2 -0
- package/dist/cdn/5WYRJMBW.js +2 -0
- package/dist/cdn/5X7EG7D2.js +2 -0
- package/dist/cdn/5ZFUGNRN.js +2 -0
- package/dist/cdn/6HF36IKA.js +2 -0
- package/dist/cdn/6KFMRBAA.js +2 -0
- package/dist/cdn/6NHYXISD.js +2 -0
- package/dist/cdn/6U4GTCLJ.js +66 -0
- package/dist/cdn/7BCQMK6D.js +2 -0
- package/dist/cdn/7FY7WAA5.js +2 -0
- package/dist/cdn/7GMCLVSZ.js +2 -0
- package/dist/cdn/7M6VKBTK.js +6 -0
- package/dist/cdn/{GGSZM7KV.js → 7Q5EESAR.js} +6 -4
- package/dist/cdn/7SRLZQVC.js +5 -0
- package/dist/cdn/7TXR75RG.js +2 -0
- package/dist/cdn/7V6OSTFC.js +2 -0
- package/dist/cdn/7VAQUCBU.js +9 -0
- package/dist/cdn/7ZFAFKJT.js +2 -0
- package/dist/cdn/ACJTJLZN.js +2 -0
- package/dist/cdn/AI6DYOKR.js +181 -0
- package/dist/cdn/{ZS2TZ6BF.js → AOVJ34QE.js} +1 -1
- package/dist/cdn/APFZY4PI.js +2 -0
- package/dist/cdn/AT4XVTJR.js +44 -0
- package/dist/cdn/AZ5G7YZH.js +3 -0
- package/dist/cdn/{FL4W4VYN.js → BL273EGZ.js} +17 -1
- package/dist/cdn/BM3WFHJG.js +2 -0
- package/dist/cdn/{DHOVCT6R.js → BPCBE7J6.js} +1 -1
- 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/CP5BVGJU.js +2 -0
- package/dist/cdn/CZM4URK7.js +2 -0
- package/dist/cdn/DPALM2OW.js +2 -0
- package/dist/cdn/E7JZ7GUW.js +18 -0
- package/dist/cdn/EMLOVMD4.js +2 -0
- package/dist/cdn/EWLXNGKH.js +208 -0
- package/dist/cdn/F2J6BMMX.js +36 -0
- package/dist/cdn/FAR3DFFK.js +2 -0
- package/dist/cdn/FDOMMK2M.js +2 -0
- package/dist/cdn/{ZLXN7NMF.js → FYZATVB3.js} +10 -8
- package/dist/cdn/GFEOVHJK.js +2 -0
- package/dist/cdn/HDM2D2GD.js +2 -0
- package/dist/cdn/HHFNQR6Z.js +2 -0
- package/dist/cdn/HMUWQCXU.js +2 -0
- package/dist/cdn/I3ONG4AX.js +2 -0
- package/dist/cdn/IBZ2NEAO.js +2 -0
- package/dist/cdn/{FX7UOGHP.js → ICBIUFK7.js} +1 -1
- package/dist/cdn/IFJM5XEQ.js +2 -0
- package/dist/cdn/IHP25JWI.js +99 -0
- package/dist/cdn/J6A4AS7E.js +22 -0
- package/dist/cdn/J6SZIQJA.js +2 -0
- package/dist/cdn/{NE7E52YR.js → JEBRN3EU.js} +9 -3
- package/dist/cdn/JKIESH74.js +2 -0
- package/dist/cdn/JO5ETMPS.js +2 -0
- package/dist/cdn/JWIE3YK3.js +2 -0
- package/dist/cdn/K2R6XVK3.js +2 -0
- package/dist/cdn/KITIP6J2.js +2 -0
- package/dist/cdn/KPO4XX6J.js +2 -0
- package/dist/cdn/KWD2ECTM.js +2 -0
- package/dist/cdn/L7XTRDFM.js +3 -0
- package/dist/cdn/{7RCQFLPP.js → LK7ZIQW6.js} +1 -1
- package/dist/cdn/LLUGJKAQ.js +2 -0
- package/dist/cdn/LMPNXXTQ.js +2 -0
- package/dist/cdn/LYKCYBGB.js +2 -0
- package/dist/cdn/{3PKJWIC3.js → M2L5R4LA.js} +1 -1
- package/dist/cdn/{V2P4AIGG.js → M4URMXDS.js} +1 -1
- package/dist/cdn/MDAKBX7N.js +2 -0
- package/dist/cdn/MWYBF3F3.js +66 -0
- package/dist/cdn/NEV6OZN3.js +71 -0
- package/dist/cdn/NQDOAPE3.js +2 -0
- package/dist/cdn/OAKRPM7D.js +2 -0
- package/dist/cdn/{23EQTPO3.js → OKVLGJAG.js} +1 -1
- package/dist/cdn/ONMNQBPO.js +2 -0
- package/dist/cdn/ONQ6JSBJ.js +2 -0
- package/dist/cdn/OWTGH34K.js +2 -0
- package/dist/cdn/{LQ6R5YRN.js → PQ2DPOFM.js} +1 -1
- package/dist/cdn/PSYRZMX2.js +2 -0
- package/dist/cdn/PUHRBGKB.js +2 -0
- package/dist/cdn/Q57QWN5W.js +2 -0
- package/dist/cdn/QNNGPA3Q.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/RV55GABG.js +2 -0
- package/dist/cdn/RWWOOC7S.js +2 -0
- package/dist/cdn/{X2ZDYHCG.js → SDWWUWAF.js} +10 -5
- package/dist/cdn/T4RIGOXB.js +2 -0
- package/dist/cdn/TACBKKBI.js +2 -0
- package/dist/cdn/TMJMDCSA.js +4 -0
- package/dist/cdn/TPULIO6I.js +34 -0
- package/dist/cdn/U2D53TAX.js +14 -0
- package/dist/cdn/UEEH5ZQK.js +156 -0
- package/dist/cdn/{6YMR4QSD.js → UHEYPSOR.js} +1 -1
- package/dist/cdn/UHZG7SKO.js +2 -0
- package/dist/cdn/UZLQALHY.js +2 -0
- package/dist/cdn/V52XWEGV.js +11 -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/VNJMTA6O.js +2 -0
- package/dist/cdn/VOKXKU7M.js +56 -0
- package/dist/cdn/VXFQANGJ.js +2 -0
- package/dist/cdn/WKTQVBFJ.js +2 -0
- package/dist/cdn/WLH47YFC.js +14 -0
- package/dist/cdn/WP7ORLSB.js +6 -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/Z5W4V7RC.js +2 -0
- package/dist/cdn/ZLWWWTH4.js +2 -0
- package/dist/cdn/ZOEMBHRF.js +2 -0
- package/dist/cdn/ZQMBJ6MI.js +2 -0
- package/dist/cdn/ZRESBCJL.js +2 -0
- package/dist/cdn/{ZTBA5PM7.js → ZU2FHVNK.js} +1 -1
- package/dist/cdn/ZUNLFO6M.js +3 -0
- 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 +1294 -2112
- package/dist/chunks/arcgisKnowledgeGraph.js +127 -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 +56 -0
- package/dist/chunks/converterUtils.js +66 -41
- package/dist/chunks/dataExplorationGraph.js +132 -177
- 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 +34 -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 +36 -31
- package/dist/chunks/mergeWhereClauses.js +15 -0
- package/dist/chunks/navigationGraph.js +123 -103
- package/dist/chunks/navigation_intent_prompt.js +8 -2
- package/dist/chunks/orchestrator.js +205 -175
- package/dist/chunks/slottableRequestUtils.js +3 -7
- package/dist/chunks/state.js +21 -27
- package/dist/chunks/summarize_query_response_prompt.js +9 -7
- package/dist/chunks/toolCallResponse.js +13 -10
- package/dist/chunks/types.js +59 -0
- package/dist/chunks/utils2.js +11 -11
- package/dist/components/arcgis-assistant/customElement.d.ts +56 -0
- package/dist/components/arcgis-assistant/customElement.js +387 -155
- package/dist/components/arcgis-assistant/index.js +2 -3
- package/dist/components/arcgis-assistant/types.d.ts +14 -1
- package/dist/components/arcgis-assistant-agent/customElement.d.ts +13 -1
- package/dist/components/arcgis-assistant-agent/customElement.js +608 -10
- package/dist/components/arcgis-assistant-chat/customElement.d.ts +2 -1
- package/dist/components/arcgis-assistant-chat/customElement.js +23 -18
- package/dist/components/arcgis-assistant-chat-entry/customElement.d.ts +2 -0
- package/dist/components/arcgis-assistant-chat-entry/customElement.js +25 -18
- package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +19 -3
- package/dist/components/arcgis-assistant-help-agent/customElement.js +28 -6
- package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -0
- package/dist/components/arcgis-assistant-interrupt/customElement.js +17 -14
- package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +24 -0
- package/dist/components/arcgis-assistant-interrupt-preview/index.js +2 -0
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.d.ts +7 -7
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +39 -16
- package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +29 -6
- package/dist/components/arcgis-assistant-message/customElement.d.ts +5 -0
- package/dist/components/arcgis-assistant-message/customElement.js +29 -26
- package/dist/components/arcgis-assistant-message/index.js +2 -0
- package/dist/components/arcgis-assistant-message-block/customElement.js +18 -11
- package/dist/components/arcgis-assistant-message-block/index.js +1 -0
- package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +7 -0
- package/dist/components/arcgis-assistant-message-loading/customElement.js +8 -7
- package/dist/components/arcgis-assistant-message-loading/index.js +1 -0
- 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 +17 -3
- package/dist/components/arcgis-assistant-speech-input/customElement.js +29 -46
- package/dist/components/arcgis-assistant-suggested-prompts/customElement.js +8 -8
- 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 +9 -8
- package/dist/oauth-callback.html +1 -1
- package/dist/types/lumina.d.ts +9 -8
- package/dist/types/preact.d.ts +9 -8
- package/dist/types/react.d.ts +9 -8
- package/dist/types/stencil.d.ts +11 -10
- package/dist/utils/index.d.ts +10 -10
- package/dist/utils/index.js +56 -55
- package/package.json +32 -12
- package/dist/cdn/2AXF774U.js +0 -2
- package/dist/cdn/462JBSEV.js +0 -422
- package/dist/cdn/53ZCUPKK.js +0 -22
- package/dist/cdn/5QAHYX7Y.js +0 -5
- package/dist/cdn/5XRDJL7R.js +0 -14
- package/dist/cdn/7BCR6TUO.js +0 -2
- package/dist/cdn/7GH7VSB2.js +0 -2
- package/dist/cdn/7PLV4QH6.js +0 -2
- package/dist/cdn/AO7BQHKC.js +0 -2
- package/dist/cdn/AXDZBBNL.js +0 -45
- package/dist/cdn/DDLZOMUY.js +0 -2
- package/dist/cdn/EECZLT6C.js +0 -166
- package/dist/cdn/ETRWZ3MS.js +0 -108
- package/dist/cdn/F2AHA4GB.js +0 -54
- package/dist/cdn/FX5JFRDL.js +0 -2
- package/dist/cdn/H7422XUG.js +0 -2
- package/dist/cdn/HB5A5R2E.js +0 -2
- package/dist/cdn/I6HNBTWY.js +0 -2
- package/dist/cdn/IG6YKZH3.js +0 -3
- package/dist/cdn/KMQ3SP4I.js +0 -5
- package/dist/cdn/MH5RPXHM.js +0 -2
- package/dist/cdn/NAUXSHIE.js +0 -72
- package/dist/cdn/NVI3I46B.js +0 -2
- package/dist/cdn/OAVEHGB6.js +0 -2
- package/dist/cdn/OH64RMOR.js +0 -4
- package/dist/cdn/P26NON3Z.js +0 -16
- package/dist/cdn/P6OPJQMC.js +0 -3
- package/dist/cdn/QR54T33D.js +0 -2
- package/dist/cdn/RVOAPUBN.js +0 -2
- package/dist/cdn/S3VPZFWQ.js +0 -36
- package/dist/cdn/SXDLXCIM.js +0 -2
- package/dist/cdn/USMDJUFS.js +0 -2
- package/dist/cdn/Y333DGV6.js +0 -2
- package/dist/cdn/YIMNOUTF.js +0 -2
|
@@ -1,64 +1,82 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
import { StateGraph as E, START as $, END as C } from "@langchain/langgraph/web";
|
|
3
|
-
import {
|
|
3
|
+
import { g as T, t as F, r as R, 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";
|
|
9
11
|
import "@langchain/openai";
|
|
12
|
+
import "@arcgis/core/config.js";
|
|
10
13
|
import "@arcgis/core/core/reactiveUtils.js";
|
|
11
14
|
import "@arcgis/core/layers/FeatureLayer.js";
|
|
12
|
-
import "
|
|
15
|
+
import { goToAddressTool as A } from "../agents/tools/navigation/goToAddress/adapter.js";
|
|
16
|
+
import { goToBookmarkTool as _ } from "../agents/tools/navigation/goToBookmark/adapter.js";
|
|
17
|
+
import { goToFeaturesTool as I } from "../agents/tools/navigation/goToFeatures/adapter.js";
|
|
18
|
+
import { goToFullExtentTool as q } from "../agents/tools/navigation/goToFullExtent/adapter.js";
|
|
19
|
+
import { goToHomeExtentTool as Z } from "../agents/tools/navigation/goToHomeExtent/adapter.js";
|
|
20
|
+
import { goToLayerTool as V } from "../agents/tools/navigation/goToLayer/adapter.js";
|
|
21
|
+
import { goToScaleTool as j } from "../agents/tools/navigation/goToScale/adapter.js";
|
|
22
|
+
import { goToViewpointTool as P } from "../agents/tools/navigation/goToViewpoint/adapter.js";
|
|
23
|
+
import { goToZoomTool as z } from "../agents/tools/navigation/goToZoom/adapter.js";
|
|
24
|
+
import { f as w } from "./fetchAgentContext.js";
|
|
25
|
+
import { h as G } from "./toolCallResponse.js";
|
|
26
|
+
import { s as p } from "./index.js";
|
|
13
27
|
import "@langchain/core/prompts";
|
|
14
|
-
import { ToolNode as
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
R,
|
|
19
|
-
L,
|
|
20
|
-
M,
|
|
28
|
+
import { ToolNode as O } from "@langchain/langgraph/prebuilt";
|
|
29
|
+
import S from "zod";
|
|
30
|
+
import { f as u } from "./fetchService.js";
|
|
31
|
+
const f = [
|
|
21
32
|
A,
|
|
22
33
|
_,
|
|
23
34
|
I,
|
|
24
35
|
q,
|
|
25
|
-
Z
|
|
36
|
+
Z,
|
|
37
|
+
V,
|
|
38
|
+
j,
|
|
39
|
+
P,
|
|
40
|
+
z
|
|
26
41
|
];
|
|
27
|
-
async function
|
|
28
|
-
const o = await T("navigation_tool_prompt"), { mapView:
|
|
29
|
-
(
|
|
42
|
+
async function B(e, t) {
|
|
43
|
+
const o = await T("navigation_tool_prompt"), { mapView: r } = w(t, ["mapView"]), i = r.map.bookmarks?.map((h) => h.name).filter(Boolean) ?? [], l = e.vectorSearchLayerResults?.length > 0 ? e.vectorSearchLayerResults.map(
|
|
44
|
+
(h, b) => `${b + 1}. layerId=${h.id} | title=${h.title ?? ""} | name=${h.name ?? ""} | score=${h.score.toFixed(2)}`
|
|
30
45
|
).join(`
|
|
31
|
-
`) : "",
|
|
32
|
-
${i.map((
|
|
33
|
-
`)}` : "",
|
|
34
|
-
${
|
|
35
|
-
${
|
|
46
|
+
`) : "", c = e.vectorSearchFieldResults?.length > 0 ? JSON.stringify(e.vectorSearchFieldResults, null, 2) : "", a = e.intent === "goToBookmark" && i.length ? `Available bookmarks:
|
|
47
|
+
${i.map((h) => `- ${h}`).join(`
|
|
48
|
+
`)}` : "", s = (e.intent === "goToLayer" || e.intent === "goToFeatures") && e.vectorSearchLayerResults?.length ? `Candidate layers:
|
|
49
|
+
${l}` : "", d = e.intent === "goToFeatures" && e.vectorSearchFieldResults?.length ? `Candidate fields:
|
|
50
|
+
${c}` : "", y = {
|
|
36
51
|
intent: e.intent,
|
|
37
52
|
bookmarksSection: a,
|
|
38
|
-
layersSection:
|
|
53
|
+
layersSection: s,
|
|
39
54
|
fieldsSection: d,
|
|
40
|
-
currentZoom:
|
|
55
|
+
currentZoom: r.zoom,
|
|
41
56
|
assignedTask: e.agentExecutionContext.assignedTask,
|
|
42
57
|
userRequest: e.agentExecutionContext.userRequest,
|
|
43
58
|
priorSteps: e.agentExecutionContext.priorSteps
|
|
44
|
-
}, n = await
|
|
59
|
+
}, n = await L({
|
|
45
60
|
promptText: o,
|
|
46
61
|
modelTier: "fast",
|
|
62
|
+
config: t,
|
|
47
63
|
inputVariables: y,
|
|
48
|
-
tools:
|
|
49
|
-
})
|
|
64
|
+
tools: f
|
|
65
|
+
});
|
|
66
|
+
await G(n, t);
|
|
67
|
+
const g = (n.tool_calls?.length ?? 0) > 0, v = typeof n.text == "string" ? n.text.trim() : "", N = v.length > 0;
|
|
50
68
|
return {
|
|
51
69
|
...e,
|
|
52
70
|
navigationInternalState: {
|
|
53
71
|
...e.navigationInternalState,
|
|
54
|
-
toolCallMessage:
|
|
72
|
+
toolCallMessage: g ? n : void 0
|
|
55
73
|
},
|
|
56
74
|
// No tool call => surface fallback text now. Tool call => tool node will set output.
|
|
57
|
-
outputMessage:
|
|
58
|
-
status:
|
|
75
|
+
outputMessage: g ? e.outputMessage : v,
|
|
76
|
+
status: g ? e.status : N ? "success" : "failed"
|
|
59
77
|
};
|
|
60
78
|
}
|
|
61
|
-
const
|
|
79
|
+
const D = (e) => {
|
|
62
80
|
const t = typeof e == "string" ? e : String(e);
|
|
63
81
|
try {
|
|
64
82
|
const o = JSON.parse(t);
|
|
@@ -69,45 +87,45 @@ const B = (e) => {
|
|
|
69
87
|
}
|
|
70
88
|
return { text: t };
|
|
71
89
|
};
|
|
72
|
-
async function
|
|
73
|
-
const o = new
|
|
90
|
+
async function J(e, t) {
|
|
91
|
+
const o = new O(f, { handleToolErrors: !1 });
|
|
74
92
|
try {
|
|
75
|
-
const
|
|
76
|
-
if (!
|
|
93
|
+
const r = e.navigationInternalState.toolCallMessage;
|
|
94
|
+
if (!r)
|
|
77
95
|
throw new Error("navigationToolCalling: missing navigationInternalState.toolCallMessage");
|
|
78
|
-
const { messages:
|
|
96
|
+
const { messages: m } = await o.invoke(
|
|
79
97
|
{
|
|
80
|
-
messages: [
|
|
98
|
+
messages: [r]
|
|
81
99
|
},
|
|
82
100
|
t
|
|
83
101
|
);
|
|
84
|
-
let i = "",
|
|
85
|
-
for (const
|
|
86
|
-
const a =
|
|
102
|
+
let i = "", l;
|
|
103
|
+
for (const c of m) {
|
|
104
|
+
const a = D(c.content);
|
|
87
105
|
a.text && (i += `${a.text}
|
|
88
|
-
`), a.sharedStatePatch && (
|
|
89
|
-
...
|
|
106
|
+
`), a.sharedStatePatch && (l = {
|
|
107
|
+
...l,
|
|
90
108
|
...a.sharedStatePatch
|
|
91
109
|
});
|
|
92
110
|
}
|
|
93
|
-
return await
|
|
111
|
+
return await p({ text: `Finished executing navigation tool: ${i}` }, t), {
|
|
94
112
|
...e,
|
|
95
113
|
outputMessage: i,
|
|
96
|
-
sharedStatePatch:
|
|
114
|
+
sharedStatePatch: l,
|
|
97
115
|
status: "success",
|
|
98
|
-
summary: i ?
|
|
116
|
+
summary: i ? F(i) : "Navigation executed.",
|
|
99
117
|
navigationInternalState: {
|
|
100
118
|
...e.navigationInternalState,
|
|
101
119
|
toolCallMessage: void 0
|
|
102
120
|
}
|
|
103
121
|
};
|
|
104
|
-
} catch (
|
|
105
|
-
const
|
|
106
|
-
return await
|
|
122
|
+
} catch (r) {
|
|
123
|
+
const m = r instanceof Error ? r.message : String(r);
|
|
124
|
+
return await p({ text: `Navigation tool execution failed: ${m}` }, t), {
|
|
107
125
|
...e,
|
|
108
|
-
outputMessage: `Navigation tool execution failed: ${
|
|
126
|
+
outputMessage: `Navigation tool execution failed: ${m}`,
|
|
109
127
|
status: "failed",
|
|
110
|
-
summary: `Navigation tool execution failed: ${
|
|
128
|
+
summary: `Navigation tool execution failed: ${m}`,
|
|
111
129
|
navigationInternalState: {
|
|
112
130
|
...e.navigationInternalState,
|
|
113
131
|
toolCallMessage: void 0
|
|
@@ -115,113 +133,115 @@ async function D(e, t) {
|
|
|
115
133
|
};
|
|
116
134
|
}
|
|
117
135
|
}
|
|
118
|
-
async function
|
|
119
|
-
const o = await T("navigation_intent_prompt"), { mapView:
|
|
136
|
+
async function H(e, t) {
|
|
137
|
+
const o = await T("navigation_intent_prompt"), { mapView: r } = w(t, ["mapView"]), m = f.map((n) => ({
|
|
120
138
|
name: n.name,
|
|
121
139
|
description: n.description,
|
|
122
140
|
schema: n.schema
|
|
123
|
-
})),
|
|
124
|
-
${
|
|
125
|
-
`)}` : "", a = {
|
|
126
|
-
tools:
|
|
141
|
+
})), l = r.map.bookmarks?.map((n) => n.name).filter(Boolean) ?? [], c = l.length ? `Available bookmarks:
|
|
142
|
+
${l.map((n) => `- ${n}`).join(`
|
|
143
|
+
`)}` : "No bookmarks are available in this map.", a = {
|
|
144
|
+
tools: m.map(({ name: n, description: g, schema: v }) => `${n}: ${g}, ${JSON.stringify(v)}`).join(`
|
|
127
145
|
`),
|
|
128
|
-
bookmarks:
|
|
146
|
+
bookmarks: c,
|
|
129
147
|
assignedTask: e.agentExecutionContext.assignedTask,
|
|
130
148
|
userRequest: e.agentExecutionContext.userRequest,
|
|
131
149
|
priorSteps: e.agentExecutionContext.priorSteps
|
|
132
|
-
},
|
|
133
|
-
intent:
|
|
134
|
-
}), d = await
|
|
150
|
+
}, s = S.object({
|
|
151
|
+
intent: S.string()
|
|
152
|
+
}), d = await M({
|
|
135
153
|
promptText: o,
|
|
154
|
+
config: t,
|
|
136
155
|
inputVariables: a,
|
|
137
|
-
schema:
|
|
156
|
+
schema: s,
|
|
138
157
|
modelTier: "fast"
|
|
139
158
|
}), y = typeof d.intent == "string" ? d.intent.trim().replace(/^"|"$/gu, "") : "";
|
|
140
159
|
return { ...e, intent: y || "" };
|
|
141
160
|
}
|
|
142
|
-
const
|
|
161
|
+
const U = 0.7, W = async (e, t) => {
|
|
143
162
|
try {
|
|
144
|
-
await
|
|
163
|
+
await p(
|
|
145
164
|
{ text: `Similarity search to find layers: ${e.agentExecutionContext.assignedTask}` },
|
|
146
165
|
t
|
|
147
166
|
);
|
|
148
|
-
const o = u(t, "layerSearch"),
|
|
167
|
+
const o = u(t, "layerSearch"), r = u(t, "layersAndFieldsRegistry"), m = u(t, "embeddingCache"), l = (await o.searchLayers({
|
|
149
168
|
text: e.agentExecutionContext.assignedTask,
|
|
150
|
-
minScore:
|
|
151
|
-
embeddingCache:
|
|
152
|
-
})).map(({ id: a, score:
|
|
153
|
-
const d =
|
|
169
|
+
minScore: U,
|
|
170
|
+
embeddingCache: m
|
|
171
|
+
})).map(({ id: a, score: s }) => {
|
|
172
|
+
const d = r.get(a)?.layerItem;
|
|
154
173
|
return {
|
|
155
174
|
id: a,
|
|
156
175
|
title: d?.title,
|
|
157
176
|
name: d?.name ?? void 0,
|
|
158
|
-
score:
|
|
177
|
+
score: s
|
|
159
178
|
};
|
|
160
179
|
});
|
|
161
|
-
let
|
|
162
|
-
return
|
|
163
|
-
${
|
|
164
|
-
`)}` :
|
|
180
|
+
let c;
|
|
181
|
+
return l.length > 0 ? c = `Vector search completed. Matching layers:
|
|
182
|
+
${l.map((a) => `- layerId=${a.id} | title=${a.title ?? ""} | name=${a.name ?? ""} | score=${a.score.toFixed(2)}`).join(`
|
|
183
|
+
`)}` : c = "Vector search completed. No matching layers found.", await p({ text: c }, t), {
|
|
165
184
|
...e,
|
|
166
|
-
vectorSearchLayerResults:
|
|
185
|
+
vectorSearchLayerResults: l
|
|
167
186
|
};
|
|
168
187
|
} catch (o) {
|
|
169
|
-
throw await
|
|
188
|
+
throw await p(
|
|
170
189
|
{ text: `Error during vector search layers: ${o instanceof Error ? o.message : String(o)}` },
|
|
171
190
|
t
|
|
172
191
|
), o;
|
|
173
192
|
}
|
|
174
|
-
},
|
|
193
|
+
}, x = 0.7, K = 10, Q = async (e, t) => {
|
|
175
194
|
try {
|
|
176
|
-
await
|
|
195
|
+
await p(
|
|
177
196
|
{ text: `Similarity search to find fields: ${e.agentExecutionContext.assignedTask}` },
|
|
178
197
|
t
|
|
179
198
|
);
|
|
180
|
-
const o = u(t, "fieldSearch"),
|
|
199
|
+
const o = u(t, "fieldSearch"), r = u(t, "layersAndFieldsRegistry"), m = u(t, "embeddingCache"), i = e.vectorSearchLayerResults?.map((s) => s.id) ?? [];
|
|
181
200
|
if (i.length === 0)
|
|
182
|
-
return await
|
|
183
|
-
const
|
|
201
|
+
return await p({ text: "No candidate layers for field search" }, t), e;
|
|
202
|
+
const c = (await o.searchFields({
|
|
184
203
|
text: e.agentExecutionContext.assignedTask,
|
|
185
204
|
layerIds: i,
|
|
186
|
-
minScore:
|
|
187
|
-
topResults:
|
|
188
|
-
embeddingCache:
|
|
189
|
-
})).map(({ layerId:
|
|
190
|
-
const y =
|
|
205
|
+
minScore: x,
|
|
206
|
+
topResults: K,
|
|
207
|
+
embeddingCache: m
|
|
208
|
+
})).map(({ layerId: s, results: d }) => {
|
|
209
|
+
const y = r.get(s)?.fieldRegistry;
|
|
191
210
|
return {
|
|
192
|
-
layerId:
|
|
193
|
-
layerName:
|
|
211
|
+
layerId: s,
|
|
212
|
+
layerName: r.get(s)?.layerItem.name,
|
|
194
213
|
results: d.map((n) => {
|
|
195
|
-
const
|
|
214
|
+
const g = y?.get(n.name);
|
|
196
215
|
return {
|
|
197
216
|
name: n.name,
|
|
198
217
|
score: n.score,
|
|
199
|
-
type:
|
|
200
|
-
alias:
|
|
201
|
-
description:
|
|
202
|
-
statistics:
|
|
218
|
+
type: g?.type,
|
|
219
|
+
alias: g?.alias,
|
|
220
|
+
description: g?.description,
|
|
221
|
+
statistics: g?.statistics,
|
|
222
|
+
domain: g?.domain
|
|
203
223
|
};
|
|
204
224
|
})
|
|
205
225
|
};
|
|
206
226
|
});
|
|
207
227
|
let a;
|
|
208
|
-
return
|
|
209
|
-
${
|
|
210
|
-
(
|
|
211
|
-
${
|
|
228
|
+
return c.length > 0 ? a = `Vector search completed. Matching layers and fields:
|
|
229
|
+
${c.map(
|
|
230
|
+
(s) => `${s.layerName ?? s.layerId}:
|
|
231
|
+
${s.results.map((d) => ` - ${d.name} (${d.score.toFixed(2)})`).join(`
|
|
212
232
|
`)}`
|
|
213
233
|
).join(`
|
|
214
|
-
`)}` : a = `No vector search field results found for score over ${
|
|
234
|
+
`)}` : a = `No vector search field results found for score over ${x}.`, await p({ text: a }, t), {
|
|
215
235
|
...e,
|
|
216
|
-
vectorSearchFieldResults:
|
|
236
|
+
vectorSearchFieldResults: c
|
|
217
237
|
};
|
|
218
238
|
} catch (o) {
|
|
219
|
-
throw await
|
|
239
|
+
throw await p(
|
|
220
240
|
{ text: `Error during vector search fields: ${o instanceof Error ? o.message : String(o)}` },
|
|
221
241
|
t
|
|
222
242
|
), o;
|
|
223
243
|
}
|
|
224
|
-
},
|
|
244
|
+
}, X = (e, t) => R(["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
245
|
"intentLLM",
|
|
226
246
|
(t) => t.intent === "goToLayer" || t.intent === "goToFeatures" ? "vectorSearchLayers" : "agent",
|
|
227
247
|
{
|
|
@@ -235,7 +255,7 @@ ${r.results.map((d) => ` - ${d.name} (${d.score.toFixed(2)})`).join(`
|
|
|
235
255
|
vectorSearchFields: "vectorSearchFields",
|
|
236
256
|
agent: "agent"
|
|
237
257
|
}
|
|
238
|
-
).addEdge("vectorSearchFields", "agent").addEdge("agent", "tools").addEdge("tools", C),
|
|
258
|
+
).addEdge("vectorSearchFields", "agent").addEdge("agent", "tools").addEdge("tools", C), ee = String.raw`- **navigation** — Enables users to interact with the map by navigating to specific locations, layers, features, or extents.
|
|
239
259
|
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
260
|
|
|
241
261
|
Supported actions:
|
|
@@ -254,13 +274,13 @@ ${r.results.map((d) => ` - ${d.name} (${d.score.toFixed(2)})`).join(`
|
|
|
254
274
|
_Example: “Center the map on San Francisco at scale 50000”_
|
|
255
275
|
_Example: “Zoom to the features in the schools layer where city = 'Austin'”_
|
|
256
276
|
_Example: “Go to the Downtown bookmark”_
|
|
257
|
-
_Example: “Where is Mount Rainier?”_`,
|
|
277
|
+
_Example: “Where is Mount Rainier?”_`, Re = {
|
|
258
278
|
id: "navigation",
|
|
259
279
|
name: "Navigation Agent",
|
|
260
|
-
description:
|
|
261
|
-
createGraph:
|
|
262
|
-
workspace:
|
|
280
|
+
description: ee,
|
|
281
|
+
createGraph: Y,
|
|
282
|
+
workspace: k
|
|
263
283
|
};
|
|
264
284
|
export {
|
|
265
|
-
|
|
285
|
+
Re as N
|
|
266
286
|
};
|
|
@@ -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
|
`;
|