@arcgis/ai-components 5.2.0-next.9 → 5.2.0-next.91

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.
Files changed (315) hide show
  1. package/LICENSE.md +4 -2
  2. package/README.md +2 -2
  3. package/dist/agent-utils/FunctionAgent.d.ts +2 -2
  4. package/dist/agent-utils/LLMAgent.d.ts +7 -4
  5. package/dist/agent-utils/LLMAgent.js +4 -2
  6. package/dist/agent-utils/WorkflowAgent.d.ts +2 -2
  7. package/dist/agent-utils/WorkflowAgent.js +14 -15
  8. package/dist/agent-utils/index.d.ts +177 -0
  9. package/dist/agent-utils/index.js +167 -0
  10. package/dist/agent-utils/middlewares/trace.d.ts +2 -0
  11. package/dist/agent-utils/middlewares/trace.js +25 -33
  12. package/dist/agent-utils/tools/FunctionTool.d.ts +2 -2
  13. package/dist/agent-utils/types.d.ts +37 -8
  14. package/dist/agent-utils/workflows/ConditionalWorkflow.d.ts +2 -2
  15. package/dist/agent-utils/workflows/LoopWorkflow.d.ts +2 -2
  16. package/dist/agent-utils/workflows/ParallelWorkflow.d.ts +2 -2
  17. package/dist/agent-utils/workflows/RouterWorkflow.d.ts +2 -2
  18. package/dist/agent-utils/workflows/SequentialWorkflow.d.ts +2 -2
  19. package/dist/agent-utils/workflows/SwitchWorkflow.d.ts +2 -2
  20. package/dist/agentic-workflow/AgenticWorkflowRuntime.d.ts +24 -0
  21. package/dist/agentic-workflow/Edge.d.ts +16 -0
  22. package/dist/agentic-workflow/WebAgent.d.ts +39 -0
  23. package/dist/agentic-workflow/jsonTypes.d.ts +189 -0
  24. package/dist/agentic-workflow/nodes/AgentNode.d.ts +28 -0
  25. package/dist/agentic-workflow/nodes/BaseNode.d.ts +35 -0
  26. package/dist/agentic-workflow/nodes/EndMessageNode.d.ts +25 -0
  27. package/dist/agentic-workflow/nodes/StartNode.d.ts +21 -0
  28. package/dist/agentic-workflow/nodes/tools/ArcgisTool.d.ts +21 -0
  29. package/dist/agentic-workflow/types.d.ts +29 -0
  30. package/dist/agents/tools/filter/clearFilters/adapter.d.ts +8 -0
  31. package/dist/agents/tools/filter/clearFilters/adapter.js +22 -0
  32. package/dist/agents/tools/filter/resetMap/adapter.d.ts +8 -0
  33. package/dist/agents/tools/filter/resetMap/adapter.js +22 -0
  34. package/dist/agents/tools/filter/setFeatureEffect/adapter.d.ts +8 -0
  35. package/dist/agents/tools/filter/setFeatureEffect/adapter.js +109 -0
  36. package/dist/agents/tools/help/listFields/adapter.d.ts +11 -0
  37. package/dist/agents/tools/help/listFields/adapter.js +30 -0
  38. package/dist/agents/tools/navigation/goToAddress/adapter.d.ts +10 -0
  39. package/dist/agents/tools/navigation/goToAddress/adapter.js +52 -0
  40. package/dist/agents/tools/navigation/goToBookmark/adapter.d.ts +8 -0
  41. package/dist/agents/tools/navigation/goToBookmark/adapter.js +30 -0
  42. package/dist/agents/tools/navigation/goToFeatures/adapter.d.ts +8 -0
  43. package/dist/agents/tools/navigation/goToFeatures/adapter.js +50 -0
  44. package/dist/agents/tools/navigation/goToFullExtent/adapter.d.ts +8 -0
  45. package/dist/agents/tools/navigation/goToFullExtent/adapter.js +27 -0
  46. package/dist/agents/tools/navigation/goToHomeExtent/adapter.d.ts +8 -0
  47. package/dist/agents/tools/navigation/goToHomeExtent/adapter.js +24 -0
  48. package/dist/agents/tools/navigation/goToLayer/adapter.d.ts +8 -0
  49. package/dist/agents/tools/navigation/goToLayer/adapter.js +26 -0
  50. package/dist/agents/tools/navigation/goToScale/adapter.d.ts +8 -0
  51. package/dist/agents/tools/navigation/goToScale/adapter.js +21 -0
  52. package/dist/agents/tools/navigation/goToViewpoint/adapter.d.ts +8 -0
  53. package/dist/agents/tools/navigation/goToViewpoint/adapter.js +42 -0
  54. package/dist/agents/tools/navigation/goToZoom/adapter.d.ts +8 -0
  55. package/dist/agents/tools/navigation/goToZoom/adapter.js +21 -0
  56. package/dist/agents/tools/query/getAttribute/adapter.d.ts +8 -0
  57. package/dist/agents/tools/query/getAttribute/adapter.js +40 -0
  58. package/dist/agents/tools/query/getStatistics/adapter.d.ts +8 -0
  59. package/dist/agents/tools/query/getStatistics/adapter.js +154 -0
  60. package/dist/agents/tools/query/getTopFeatures/adapter.d.ts +8 -0
  61. package/dist/agents/tools/query/getTopFeatures/adapter.js +141 -0
  62. package/dist/agents/tools/query/queryFeatures/adapter.d.ts +8 -0
  63. package/dist/agents/tools/query/queryFeatures/adapter.js +127 -0
  64. package/dist/agents/tools/search/findRelevantFields/adapter.d.ts +8 -0
  65. package/dist/agents/tools/search/findRelevantFields/adapter.js +57 -0
  66. package/dist/agents/tools/search/findRelevantLayers/adapter.d.ts +8 -0
  67. package/dist/agents/tools/search/findRelevantLayers/adapter.js +38 -0
  68. package/dist/cdn/2EY3BQQX.js +2 -0
  69. package/dist/cdn/2PTPBAIN.js +2 -0
  70. package/dist/cdn/34O57OGV.js +2 -0
  71. package/dist/cdn/{AMP6IALT.js → 3UEKINYC.js} +1 -1
  72. package/dist/cdn/434TAA3J.js +2 -0
  73. package/dist/cdn/4EBLRHYE.js +2 -0
  74. package/dist/cdn/4HDDRBIY.js +2 -0
  75. package/dist/cdn/4KOV2NEI.js +9 -0
  76. package/dist/cdn/4NJ2FF7H.js +2 -0
  77. package/dist/cdn/4OGR5QKS.js +2 -0
  78. package/dist/cdn/4WIDLQUH.js +2 -0
  79. package/dist/cdn/5FL5BTTX.js +66 -0
  80. package/dist/cdn/5WYRJMBW.js +2 -0
  81. package/dist/cdn/5X7EG7D2.js +2 -0
  82. package/dist/cdn/5ZFUGNRN.js +2 -0
  83. package/dist/cdn/6HF36IKA.js +2 -0
  84. package/dist/cdn/6KFMRBAA.js +2 -0
  85. package/dist/cdn/6VJXUIXY.js +3 -0
  86. package/dist/cdn/7BCQMK6D.js +2 -0
  87. package/dist/cdn/7DFXYMEA.js +2 -0
  88. package/dist/cdn/7M6VKBTK.js +6 -0
  89. package/dist/cdn/7SRLZQVC.js +5 -0
  90. package/dist/cdn/7V6OSTFC.js +2 -0
  91. package/dist/cdn/7VAQUCBU.js +9 -0
  92. package/dist/cdn/7ZFAFKJT.js +2 -0
  93. package/dist/cdn/ACJTJLZN.js +2 -0
  94. package/dist/cdn/AI6DYOKR.js +181 -0
  95. package/dist/cdn/{ZS2TZ6BF.js → AOVJ34QE.js} +1 -1
  96. package/dist/cdn/APFZY4PI.js +2 -0
  97. package/dist/cdn/AT4XVTJR.js +44 -0
  98. package/dist/cdn/AZCIDPML.js +2 -0
  99. package/dist/cdn/{FL4W4VYN.js → BL273EGZ.js} +17 -1
  100. package/dist/cdn/C5ZL5Z52.js +18 -0
  101. package/dist/cdn/CCC6LBMY.js +2 -0
  102. package/dist/cdn/{5ZZGKP7N.js → CEKOEHB3.js} +1 -1
  103. package/dist/cdn/CJMUJXPL.js +2 -0
  104. package/dist/cdn/COL6QYGQ.js +2 -0
  105. package/dist/cdn/CP5BVGJU.js +2 -0
  106. package/dist/cdn/CZM4URK7.js +2 -0
  107. package/dist/cdn/DP6O6PMH.js +2 -0
  108. package/dist/cdn/{V2P4AIGG.js → EKB7CAMM.js} +1 -1
  109. package/dist/cdn/EWLXNGKH.js +208 -0
  110. package/dist/cdn/EYNEYD34.js +2 -0
  111. package/dist/cdn/FDDQ67BG.js +2 -0
  112. package/dist/cdn/FDOMMK2M.js +2 -0
  113. package/dist/cdn/FQH3HOFH.js +2 -0
  114. package/dist/cdn/{GGSZM7KV.js → FUZ77UGP.js} +6 -4
  115. package/dist/cdn/{ZLXN7NMF.js → FYZATVB3.js} +10 -8
  116. package/dist/cdn/GFEOVHJK.js +2 -0
  117. package/dist/cdn/HHFNQR6Z.js +2 -0
  118. package/dist/cdn/HIPQ3VRW.js +2 -0
  119. package/dist/cdn/HKSFWTWK.js +14 -0
  120. package/dist/cdn/HMUWQCXU.js +2 -0
  121. package/dist/cdn/IBZ2NEAO.js +2 -0
  122. package/dist/cdn/{FX7UOGHP.js → ICBIUFK7.js} +1 -1
  123. package/dist/cdn/IHP25JWI.js +99 -0
  124. package/dist/cdn/J6A4AS7E.js +22 -0
  125. package/dist/cdn/J6SZIQJA.js +2 -0
  126. package/dist/cdn/{NE7E52YR.js → JEBRN3EU.js} +9 -3
  127. package/dist/cdn/JJJZ7FOM.js +2 -0
  128. package/dist/cdn/JKIESH74.js +2 -0
  129. package/dist/cdn/JO5ETMPS.js +2 -0
  130. package/dist/cdn/K2R6XVK3.js +2 -0
  131. package/dist/cdn/KCU4FWF7.js +2 -0
  132. package/dist/cdn/KITIP6J2.js +2 -0
  133. package/dist/cdn/KWD2ECTM.js +2 -0
  134. package/dist/cdn/{7RCQFLPP.js → LK7ZIQW6.js} +1 -1
  135. package/dist/cdn/LLUGJKAQ.js +2 -0
  136. package/dist/cdn/LPR72QZF.js +36 -0
  137. package/dist/cdn/{DHOVCT6R.js → MKOQJXQQ.js} +1 -1
  138. package/dist/cdn/MWYBF3F3.js +66 -0
  139. package/dist/cdn/NEV6OZN3.js +71 -0
  140. package/dist/cdn/OAKRPM7D.js +2 -0
  141. package/dist/cdn/{23EQTPO3.js → OKVLGJAG.js} +1 -1
  142. package/dist/cdn/OL5656NI.js +2 -0
  143. package/dist/cdn/ONQ6JSBJ.js +2 -0
  144. package/dist/cdn/OWTGH34K.js +2 -0
  145. package/dist/cdn/OYSPNIJI.js +156 -0
  146. package/dist/cdn/PEYYWXFE.js +2 -0
  147. package/dist/cdn/PKUDO2RC.js +3 -0
  148. package/dist/cdn/{LQ6R5YRN.js → PQ2DPOFM.js} +1 -1
  149. package/dist/cdn/PSYRZMX2.js +2 -0
  150. package/dist/cdn/PUHRBGKB.js +2 -0
  151. package/dist/cdn/Q57QWN5W.js +2 -0
  152. package/dist/cdn/QCFICJ7U.js +3 -0
  153. package/dist/cdn/QNNGPA3Q.js +2 -0
  154. package/dist/cdn/R74ZHFA6.js +2 -0
  155. package/dist/cdn/RBE55SWR.js +2 -0
  156. package/dist/cdn/RHYNE5OE.js +2 -0
  157. package/dist/cdn/RLEHNAIA.js +2 -0
  158. package/dist/cdn/RSNGZQCQ.js +2 -0
  159. package/dist/cdn/{X2ZDYHCG.js → SDWWUWAF.js} +10 -5
  160. package/dist/cdn/SHD6YFSR.js +2 -0
  161. package/dist/cdn/SUYWKYWI.js +22 -0
  162. package/dist/cdn/SZ2QSSB3.js +2 -0
  163. package/dist/cdn/T4RIGOXB.js +2 -0
  164. package/dist/cdn/{3PKJWIC3.js → TMZ6DF22.js} +1 -1
  165. package/dist/cdn/TPULIO6I.js +34 -0
  166. package/dist/cdn/U2D53TAX.js +14 -0
  167. package/dist/cdn/{6YMR4QSD.js → UHEYPSOR.js} +1 -1
  168. package/dist/cdn/UHZG7SKO.js +2 -0
  169. package/dist/cdn/UZLQALHY.js +2 -0
  170. package/dist/cdn/V52XWEGV.js +11 -0
  171. package/dist/cdn/V6F3HEK7.js +2 -0
  172. package/dist/cdn/V6HOUZPZ.js +2 -0
  173. package/dist/cdn/VAXH6RUQ.js +134 -0
  174. package/dist/cdn/VLLZ2FFU.js +2 -0
  175. package/dist/cdn/VNJMTA6O.js +2 -0
  176. package/dist/cdn/VOKXKU7M.js +56 -0
  177. package/dist/cdn/VXFQANGJ.js +2 -0
  178. package/dist/cdn/W5JPJWMM.js +2 -0
  179. package/dist/cdn/WKTQVBFJ.js +2 -0
  180. package/dist/cdn/WNNMKCKS.js +2 -0
  181. package/dist/cdn/WP7ORLSB.js +6 -0
  182. package/dist/cdn/WR2SQX3J.js +2 -0
  183. package/dist/cdn/X3COUAXY.js +4 -0
  184. package/dist/cdn/Y7XD7ZRD.js +2 -0
  185. package/dist/cdn/YEZ3AMNX.js +2 -0
  186. package/dist/cdn/YLVJA4ZE.js +2 -0
  187. package/dist/cdn/YQSU6IUO.js +2 -0
  188. package/dist/cdn/Z5W4V7RC.js +2 -0
  189. package/dist/cdn/ZLWWWTH4.js +2 -0
  190. package/dist/cdn/ZOEMBHRF.js +2 -0
  191. package/dist/cdn/ZQMBJ6MI.js +2 -0
  192. package/dist/cdn/{ZTBA5PM7.js → ZU2FHVNK.js} +1 -1
  193. package/dist/cdn/ZVGUAOXE.js +2 -0
  194. package/dist/cdn/agent-utils/index.js +2 -0
  195. package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +3 -0
  196. package/dist/cdn/agent-utils/middlewares/middleware.js +2 -0
  197. package/dist/cdn/agent-utils/middlewares/trace.js +2 -0
  198. package/dist/cdn/assets/assistant/t9n/messages.en.json +1 -1
  199. package/dist/cdn/assets/assistant-interrupt/t9n/messages.en.json +1 -1
  200. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.en.json +1 -0
  201. package/dist/cdn/assets/assistant-message/t9n/messages.en.json +1 -0
  202. package/dist/cdn/assets/assistant-message-loading/t9n/messages.en.json +1 -0
  203. package/dist/cdn/index.js +1 -1
  204. package/dist/chunks/adapter.js +1299 -2113
  205. package/dist/chunks/arcgisKnowledgeGraph.js +128 -72
  206. package/dist/chunks/arcgis_knowledge_current_lc_context.js +19 -2
  207. package/dist/chunks/arcgis_knowledge_current_map_context.js +31 -2
  208. package/dist/chunks/arcgis_knowledge_cypher_query_prompt.js +102 -0
  209. package/dist/chunks/arcgis_knowledge_summarize_result_prompt.js +116 -27
  210. package/dist/chunks/baseAgentState.js +56 -0
  211. package/dist/chunks/converterUtils.js +66 -41
  212. package/dist/chunks/dataExplorationGraph.js +133 -177
  213. package/dist/chunks/data_explore_query_prompt.js +9 -4
  214. package/dist/chunks/fetchAgentContext.js +13 -0
  215. package/dist/chunks/fetchService.js +10 -0
  216. package/dist/chunks/fieldStatistics.js +79 -0
  217. package/dist/chunks/formatFeatureAttributes.js +132 -0
  218. package/dist/chunks/generateLayerDescriptions.js +259 -282
  219. package/dist/chunks/helpGraph.js +35 -25
  220. package/dist/chunks/help_prompt.js +34 -17
  221. package/dist/chunks/index.js +11 -0
  222. package/dist/chunks/intent_prompt.js +16 -0
  223. package/dist/chunks/layerStylingGraph.js +37 -31
  224. package/dist/chunks/mergeWhereClauses.js +15 -0
  225. package/dist/chunks/navigationGraph.js +124 -103
  226. package/dist/chunks/navigation_intent_prompt.js +8 -2
  227. package/dist/chunks/orchestrator.js +298 -139
  228. package/dist/chunks/slottableRequestUtils.js +3 -7
  229. package/dist/chunks/state.js +21 -27
  230. package/dist/chunks/summarize_query_response_prompt.js +9 -7
  231. package/dist/chunks/toolCallResponse.js +14 -10
  232. package/dist/chunks/types.js +59 -0
  233. package/dist/chunks/utils2.js +11 -11
  234. package/dist/components/arcgis-assistant/customElement.d.ts +72 -0
  235. package/dist/components/arcgis-assistant/customElement.js +416 -172
  236. package/dist/components/arcgis-assistant/index.js +2 -3
  237. package/dist/components/arcgis-assistant/types.d.ts +14 -1
  238. package/dist/components/arcgis-assistant-agent/customElement.d.ts +13 -1
  239. package/dist/components/arcgis-assistant-agent/customElement.js +614 -10
  240. package/dist/components/arcgis-assistant-chat/customElement.d.ts +2 -1
  241. package/dist/components/arcgis-assistant-chat/customElement.js +23 -18
  242. package/dist/components/arcgis-assistant-chat-entry/customElement.d.ts +2 -0
  243. package/dist/components/arcgis-assistant-chat-entry/customElement.js +25 -18
  244. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +20 -4
  245. package/dist/components/arcgis-assistant-help-agent/customElement.js +29 -7
  246. package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -0
  247. package/dist/components/arcgis-assistant-interrupt/customElement.js +17 -14
  248. package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +24 -0
  249. package/dist/components/arcgis-assistant-interrupt-preview/index.js +2 -0
  250. package/dist/components/arcgis-assistant-knowledge-agent/customElement.d.ts +7 -7
  251. package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +40 -16
  252. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +30 -7
  253. package/dist/components/arcgis-assistant-message/customElement.d.ts +5 -0
  254. package/dist/components/arcgis-assistant-message/customElement.js +29 -26
  255. package/dist/components/arcgis-assistant-message/index.js +2 -0
  256. package/dist/components/arcgis-assistant-message-block/customElement.js +18 -11
  257. package/dist/components/arcgis-assistant-message-block/index.js +1 -0
  258. package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +7 -0
  259. package/dist/components/arcgis-assistant-message-loading/customElement.js +8 -7
  260. package/dist/components/arcgis-assistant-message-loading/index.js +1 -0
  261. package/dist/components/arcgis-assistant-message-text/customElement.d.ts +1 -0
  262. package/dist/components/arcgis-assistant-message-text/customElement.js +12 -12
  263. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +18 -4
  264. package/dist/components/arcgis-assistant-speech-input/customElement.js +34 -52
  265. package/dist/components/arcgis-assistant-suggested-prompts/customElement.js +8 -8
  266. package/dist/components/arcgis-assistant-user-message/customElement.d.ts +2 -0
  267. package/dist/components/arcgis-assistant-user-message/customElement.js +15 -10
  268. package/dist/docs/api.json +1 -1
  269. package/dist/docs/docs.json +1 -1
  270. package/dist/docs/vscode.html-custom-data.json +1 -1
  271. package/dist/docs/web-types.json +1 -1
  272. package/dist/loader.js +9 -8
  273. package/dist/oauth-callback.html +1 -1
  274. package/dist/orchestrator/orchestrator/orchestratorEvents.d.ts +78 -0
  275. package/dist/types/lumina.d.ts +10 -8
  276. package/dist/types/preact.d.ts +10 -8
  277. package/dist/types/react.d.ts +10 -8
  278. package/dist/types/stencil.d.ts +12 -10
  279. package/dist/utils/index.d.ts +8 -8
  280. package/dist/utils/index.js +56 -55
  281. package/package.json +32 -12
  282. package/dist/cdn/2AXF774U.js +0 -2
  283. package/dist/cdn/462JBSEV.js +0 -422
  284. package/dist/cdn/53ZCUPKK.js +0 -22
  285. package/dist/cdn/5QAHYX7Y.js +0 -5
  286. package/dist/cdn/5XRDJL7R.js +0 -14
  287. package/dist/cdn/7BCR6TUO.js +0 -2
  288. package/dist/cdn/7GH7VSB2.js +0 -2
  289. package/dist/cdn/7PLV4QH6.js +0 -2
  290. package/dist/cdn/AXDZBBNL.js +0 -45
  291. package/dist/cdn/DDLZOMUY.js +0 -2
  292. package/dist/cdn/EECZLT6C.js +0 -166
  293. package/dist/cdn/ETRWZ3MS.js +0 -108
  294. package/dist/cdn/F2AHA4GB.js +0 -54
  295. package/dist/cdn/FX5JFRDL.js +0 -2
  296. package/dist/cdn/H7422XUG.js +0 -2
  297. package/dist/cdn/HB5A5R2E.js +0 -2
  298. package/dist/cdn/I6HNBTWY.js +0 -2
  299. package/dist/cdn/I7SRZPVS.js +0 -72
  300. package/dist/cdn/IG6YKZH3.js +0 -3
  301. package/dist/cdn/JVIKKZND.js +0 -3
  302. package/dist/cdn/KMQ3SP4I.js +0 -5
  303. package/dist/cdn/MH5RPXHM.js +0 -2
  304. package/dist/cdn/NVI3I46B.js +0 -2
  305. package/dist/cdn/OAVEHGB6.js +0 -2
  306. package/dist/cdn/OH64RMOR.js +0 -4
  307. package/dist/cdn/P26NON3Z.js +0 -16
  308. package/dist/cdn/QR54T33D.js +0 -2
  309. package/dist/cdn/RVOAPUBN.js +0 -2
  310. package/dist/cdn/S3VPZFWQ.js +0 -36
  311. package/dist/cdn/SXDLXCIM.js +0 -2
  312. package/dist/cdn/TR7RL3IK.js +0 -2
  313. package/dist/cdn/USMDJUFS.js +0 -2
  314. package/dist/cdn/Y333DGV6.js +0 -2
  315. package/dist/cdn/YIMNOUTF.js +0 -2
@@ -1,64 +1,83 @@
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 { k as F, m as R, n as L, o as M, p as A, u as _, v as I, w as q, x as Z, g as T, y as k, t as j, f as u, r as P, N as w } from "./adapter.js";
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 { j as V, s as h, i as z } from "./generateLayerDescriptions.js";
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 "@arcgis/core/request.js";
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 G } from "@langchain/langgraph/prebuilt";
15
- import x from "zod";
16
- const S = [
17
- F,
18
- R,
19
- L,
20
- M,
29
+ import { ToolNode as O } from "@langchain/langgraph/prebuilt";
30
+ import S from "zod";
31
+ import { f as u } 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 O(e, t) {
28
- const o = await T("navigation_tool_prompt"), { mapView: s } = k(t), i = s.map.bookmarks?.map((p) => p.name).filter(Boolean) ?? [], c = e.vectorSearchLayerResults?.length > 0 ? e.vectorSearchLayerResults.map(
29
- (p, b) => `${b + 1}. layerId=${p.id} | title=${p.title ?? ""} | name=${p.name ?? ""} | score=${p.score.toFixed(2)}`
43
+ async function B(e, t) {
44
+ 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(
45
+ (h, b) => `${b + 1}. layerId=${h.id} | title=${h.title ?? ""} | name=${h.name ?? ""} | score=${h.score.toFixed(2)}`
30
46
  ).join(`
31
- `) : "", l = e.vectorSearchFieldResults?.length > 0 ? JSON.stringify(e.vectorSearchFieldResults, null, 2) : "", a = e.intent === "goToBookmark" && i.length ? `Available bookmarks:
32
- ${i.map((p) => `- ${p}`).join(`
33
- `)}` : "", r = (e.intent === "goToLayer" || e.intent === "goToFeatures") && e.vectorSearchLayerResults?.length ? `Candidate layers:
34
- ${c}` : "", d = e.intent === "goToFeatures" && e.vectorSearchFieldResults?.length ? `Candidate fields:
35
- ${l}` : "", y = {
47
+ `) : "", c = e.vectorSearchFieldResults?.length > 0 ? JSON.stringify(e.vectorSearchFieldResults, null, 2) : "", a = e.intent === "goToBookmark" && i.length ? `Available bookmarks:
48
+ ${i.map((h) => `- ${h}`).join(`
49
+ `)}` : "", s = (e.intent === "goToLayer" || e.intent === "goToFeatures") && e.vectorSearchLayerResults?.length ? `Candidate layers:
50
+ ${l}` : "", d = e.intent === "goToFeatures" && e.vectorSearchFieldResults?.length ? `Candidate fields:
51
+ ${c}` : "", y = {
36
52
  intent: e.intent,
37
53
  bookmarksSection: a,
38
- layersSection: r,
54
+ layersSection: s,
39
55
  fieldsSection: d,
40
- currentZoom: s.zoom,
56
+ currentZoom: r.zoom,
41
57
  assignedTask: e.agentExecutionContext.assignedTask,
42
58
  userRequest: e.agentExecutionContext.userRequest,
43
59
  priorSteps: e.agentExecutionContext.priorSteps
44
- }, n = await V({
60
+ }, n = await L({
45
61
  promptText: o,
46
62
  modelTier: "fast",
63
+ config: t,
47
64
  inputVariables: y,
48
- tools: S
49
- }), m = (n.tool_calls?.length ?? 0) > 0, v = typeof n.text == "string" ? n.text.trim() : "", N = v.length > 0;
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: m ? n : void 0
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: m ? e.outputMessage : v,
58
- status: m ? e.status : N ? "success" : "failed"
76
+ outputMessage: g ? e.outputMessage : v,
77
+ status: g ? e.status : N ? "success" : "failed"
59
78
  };
60
79
  }
61
- const B = (e) => {
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,45 @@ const B = (e) => {
69
88
  }
70
89
  return { text: t };
71
90
  };
72
- async function D(e, t) {
73
- const o = new G(S);
91
+ async function J(e, t) {
92
+ const o = new O(f, { handleToolErrors: !1 });
74
93
  try {
75
- const s = e.navigationInternalState.toolCallMessage;
76
- if (!s)
94
+ const r = e.navigationInternalState.toolCallMessage;
95
+ if (!r)
77
96
  throw new Error("navigationToolCalling: missing navigationInternalState.toolCallMessage");
78
- const { messages: g } = await o.invoke(
97
+ const { messages: m } = await o.invoke(
79
98
  {
80
- messages: [s]
99
+ messages: [r]
81
100
  },
82
101
  t
83
102
  );
84
- let i = "", c;
85
- for (const l of g) {
86
- const a = B(l.content);
103
+ let i = "", l;
104
+ for (const c of m) {
105
+ const a = D(c.content);
87
106
  a.text && (i += `${a.text}
88
- `), a.sharedStatePatch && (c = {
89
- ...c,
107
+ `), a.sharedStatePatch && (l = {
108
+ ...l,
90
109
  ...a.sharedStatePatch
91
110
  });
92
111
  }
93
- return await h({ text: `Finished executing navigation tool: ${i}` }, t), {
112
+ return await p({ text: `Finished executing navigation tool: ${i}` }, t), {
94
113
  ...e,
95
114
  outputMessage: i,
96
- sharedStatePatch: c,
115
+ sharedStatePatch: l,
97
116
  status: "success",
98
- summary: i ? j(i) : "Navigation executed.",
117
+ summary: i ? F(i) : "Navigation executed.",
99
118
  navigationInternalState: {
100
119
  ...e.navigationInternalState,
101
120
  toolCallMessage: void 0
102
121
  }
103
122
  };
104
- } catch (s) {
105
- const g = s instanceof Error ? s.message : String(s);
106
- return await h({ text: `Navigation tool execution failed: ${g}` }, t), {
123
+ } catch (r) {
124
+ const m = r instanceof Error ? r.message : String(r);
125
+ return await p({ text: `Navigation tool execution failed: ${m}` }, t), {
107
126
  ...e,
108
- outputMessage: `Navigation tool execution failed: ${g}`,
127
+ outputMessage: `Navigation tool execution failed: ${m}`,
109
128
  status: "failed",
110
- summary: `Navigation tool execution failed: ${g}`,
129
+ summary: `Navigation tool execution failed: ${m}`,
111
130
  navigationInternalState: {
112
131
  ...e.navigationInternalState,
113
132
  toolCallMessage: void 0
@@ -115,113 +134,115 @@ async function D(e, t) {
115
134
  };
116
135
  }
117
136
  }
118
- async function J(e, t) {
119
- const o = await T("navigation_intent_prompt"), { mapView: s } = k(t), g = S.map((n) => ({
137
+ async function H(e, t) {
138
+ const o = await T("navigation_intent_prompt"), { mapView: r } = w(t, ["mapView"]), m = f.map((n) => ({
120
139
  name: n.name,
121
140
  description: n.description,
122
141
  schema: n.schema
123
- })), c = s.map.bookmarks?.map((n) => n.name).filter(Boolean) ?? [], l = c.length ? `Available bookmarks:
124
- ${c.map((n) => `- ${n}`).join(`
125
- `)}` : "", a = {
126
- tools: g.map(({ name: n, description: m, schema: v }) => `${n}: ${m}, ${JSON.stringify(v)}`).join(`
142
+ })), l = r.map.bookmarks?.map((n) => n.name).filter(Boolean) ?? [], c = l.length ? `Available bookmarks:
143
+ ${l.map((n) => `- ${n}`).join(`
144
+ `)}` : "No bookmarks are available in this map.", a = {
145
+ tools: m.map(({ name: n, description: g, schema: v }) => `${n}: ${g}, ${JSON.stringify(v)}`).join(`
127
146
  `),
128
- bookmarks: l,
147
+ bookmarks: c,
129
148
  assignedTask: e.agentExecutionContext.assignedTask,
130
149
  userRequest: e.agentExecutionContext.userRequest,
131
150
  priorSteps: e.agentExecutionContext.priorSteps
132
- }, r = x.object({
133
- intent: x.string()
134
- }), d = await z({
151
+ }, s = S.object({
152
+ intent: S.string()
153
+ }), d = await M({
135
154
  promptText: o,
155
+ config: t,
136
156
  inputVariables: a,
137
- schema: r,
157
+ schema: s,
138
158
  modelTier: "fast"
139
159
  }), y = typeof d.intent == "string" ? d.intent.trim().replace(/^"|"$/gu, "") : "";
140
160
  return { ...e, intent: y || "" };
141
161
  }
142
- const H = 0.7, U = async (e, t) => {
162
+ const U = 0.7, W = async (e, t) => {
143
163
  try {
144
- await h(
164
+ await p(
145
165
  { text: `Similarity search to find layers: ${e.agentExecutionContext.assignedTask}` },
146
166
  t
147
167
  );
148
- const o = u(t, "layerSearch"), s = u(t, "layersAndFieldsRegistry"), g = u(t, "embeddingCache"), c = (await o.searchLayers({
168
+ const o = u(t, "layerSearch"), r = u(t, "layersAndFieldsRegistry"), m = u(t, "embeddingCache"), l = (await o.searchLayers({
149
169
  text: e.agentExecutionContext.assignedTask,
150
- minScore: H,
151
- embeddingCache: g
152
- })).map(({ id: a, score: r }) => {
153
- const d = s.get(a)?.layerItem;
170
+ minScore: U,
171
+ embeddingCache: m
172
+ })).map(({ id: a, score: s }) => {
173
+ const d = r.get(a)?.layerItem;
154
174
  return {
155
175
  id: a,
156
176
  title: d?.title,
157
177
  name: d?.name ?? void 0,
158
- score: r
178
+ score: s
159
179
  };
160
180
  });
161
- let l;
162
- return c.length > 0 ? l = `Vector search completed. Matching layers:
163
- ${c.map((a) => `- layerId=${a.id} | title=${a.title ?? ""} | name=${a.name ?? ""} | score=${a.score.toFixed(2)}`).join(`
164
- `)}` : l = "Vector search completed. No matching layers found.", await h({ text: l }, t), {
181
+ let c;
182
+ return l.length > 0 ? c = `Vector search completed. Matching layers:
183
+ ${l.map((a) => `- layerId=${a.id} | title=${a.title ?? ""} | name=${a.name ?? ""} | score=${a.score.toFixed(2)}`).join(`
184
+ `)}` : c = "Vector search completed. No matching layers found.", await p({ text: c }, t), {
165
185
  ...e,
166
- vectorSearchLayerResults: c
186
+ vectorSearchLayerResults: l
167
187
  };
168
188
  } catch (o) {
169
- throw await h(
189
+ throw await p(
170
190
  { text: `Error during vector search layers: ${o instanceof Error ? o.message : String(o)}` },
171
191
  t
172
192
  ), o;
173
193
  }
174
- }, f = 0.7, W = 10, K = async (e, t) => {
194
+ }, x = 0.7, K = 10, Q = async (e, t) => {
175
195
  try {
176
- await h(
196
+ await p(
177
197
  { text: `Similarity search to find fields: ${e.agentExecutionContext.assignedTask}` },
178
198
  t
179
199
  );
180
- const o = u(t, "fieldSearch"), s = u(t, "layersAndFieldsRegistry"), g = u(t, "embeddingCache"), i = e.vectorSearchLayerResults?.map((r) => r.id) ?? [];
200
+ const o = u(t, "fieldSearch"), r = u(t, "layersAndFieldsRegistry"), m = u(t, "embeddingCache"), i = e.vectorSearchLayerResults?.map((s) => s.id) ?? [];
181
201
  if (i.length === 0)
182
- return await h({ text: "No candidate layers for field search" }, t), e;
183
- const l = (await o.searchFields({
202
+ return await p({ text: "No candidate layers for field search" }, t), e;
203
+ const c = (await o.searchFields({
184
204
  text: e.agentExecutionContext.assignedTask,
185
205
  layerIds: i,
186
- minScore: f,
187
- topResults: W,
188
- embeddingCache: g
189
- })).map(({ layerId: r, results: d }) => {
190
- const y = s.get(r)?.fieldRegistry;
206
+ minScore: x,
207
+ topResults: K,
208
+ embeddingCache: m
209
+ })).map(({ layerId: s, results: d }) => {
210
+ const y = r.get(s)?.fieldRegistry;
191
211
  return {
192
- layerId: r,
193
- layerName: s.get(r)?.layerItem.name,
212
+ layerId: s,
213
+ layerName: r.get(s)?.layerItem.name,
194
214
  results: d.map((n) => {
195
- const m = y?.get(n.name);
215
+ const g = y?.get(n.name);
196
216
  return {
197
217
  name: n.name,
198
218
  score: n.score,
199
- type: m?.type,
200
- alias: m?.alias,
201
- description: m?.description,
202
- statistics: m?.statistics
219
+ type: g?.type,
220
+ alias: g?.alias,
221
+ description: g?.description,
222
+ statistics: g?.statistics,
223
+ domain: g?.domain
203
224
  };
204
225
  })
205
226
  };
206
227
  });
207
228
  let a;
208
- return l.length > 0 ? a = `Vector search completed. Matching layers and fields:
209
- ${l.map(
210
- (r) => `${r.layerName ?? r.layerId}:
211
- ${r.results.map((d) => ` - ${d.name} (${d.score.toFixed(2)})`).join(`
229
+ return c.length > 0 ? a = `Vector search completed. Matching layers and fields:
230
+ ${c.map(
231
+ (s) => `${s.layerName ?? s.layerId}:
232
+ ${s.results.map((d) => ` - ${d.name} (${d.score.toFixed(2)})`).join(`
212
233
  `)}`
213
234
  ).join(`
214
- `)}` : a = `No vector search field results found for score over ${f}.`, await h({ text: a }, t), {
235
+ `)}` : a = `No vector search field results found for score over ${x}.`, await p({ text: a }, t), {
215
236
  ...e,
216
- vectorSearchFieldResults: l
237
+ vectorSearchFieldResults: c
217
238
  };
218
239
  } catch (o) {
219
- throw await h(
240
+ throw await p(
220
241
  { text: `Error during vector search fields: ${o instanceof Error ? o.message : String(o)}` },
221
242
  t
222
243
  ), o;
223
244
  }
224
- }, Q = (e, t) => P(["layerSearch", "layersAndFieldsRegistry"], "Navigation Agent")(e, t), X = () => new E(w).addNode("requireNavigationServices", Q).addNode("intentLLM", J).addNode("vectorSearchLayers", U).addNode("vectorSearchFields", K).addNode("agent", O).addNode("tools", D).addEdge($, "requireNavigationServices").addEdge("requireNavigationServices", "intentLLM").addConditionalEdges(
245
+ }, 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
246
  "intentLLM",
226
247
  (t) => t.intent === "goToLayer" || t.intent === "goToFeatures" ? "vectorSearchLayers" : "agent",
227
248
  {
@@ -235,7 +256,7 @@ ${r.results.map((d) => ` - ${d.name} (${d.score.toFixed(2)})`).join(`
235
256
  vectorSearchFields: "vectorSearchFields",
236
257
  agent: "agent"
237
258
  }
238
- ).addEdge("vectorSearchFields", "agent").addEdge("agent", "tools").addEdge("tools", C), Y = String.raw`- **navigation** — Enables users to interact with the map by navigating to specific locations, layers, features, or extents.
259
+ ).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
260
  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
261
 
241
262
  Supported actions:
@@ -254,13 +275,13 @@ ${r.results.map((d) => ` - ${d.name} (${d.score.toFixed(2)})`).join(`
254
275
  _Example: “Center the map on San Francisco at scale 50000”_
255
276
  _Example: “Zoom to the features in the schools layer where city = 'Austin'”_
256
277
  _Example: “Go to the Downtown bookmark”_
257
- _Example: “Where is Mount Rainier?”_`, pe = {
278
+ _Example: “Where is Mount Rainier?”_`, Le = {
258
279
  id: "navigation",
259
280
  name: "Navigation Agent",
260
- description: Y,
261
- createGraph: X,
262
- workspace: w
281
+ description: ee,
282
+ createGraph: Y,
283
+ workspace: k
263
284
  };
264
285
  export {
265
- pe as N
286
+ Le as N
266
287
  };
@@ -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
- A map that has the National Parks layer, for example, should prefer the feature.
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
  `;