@arcgis/ai-components 5.2.0-next.11 → 5.2.0-next.110

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 (371) hide show
  1. package/LICENSE.md +4 -2
  2. package/README.md +2 -2
  3. package/dist/agent-utils/BaseAgent.js +1 -1
  4. package/dist/agent-utils/FunctionAgent.js +1 -1
  5. package/dist/agent-utils/LLMAgent.d.ts +5 -2
  6. package/dist/agent-utils/LLMAgent.js +7 -4
  7. package/dist/agent-utils/WorkflowAgent.js +15 -16
  8. package/dist/agent-utils/index.d.ts +78 -0
  9. package/dist/agent-utils/index.js +117 -98
  10. package/dist/agent-utils/middlewares/humanInTheLoop.js +1 -1
  11. package/dist/agent-utils/middlewares/middleware.js +1 -1
  12. package/dist/agent-utils/middlewares/trace.d.ts +2 -0
  13. package/dist/agent-utils/middlewares/trace.js +1 -1
  14. package/dist/agent-utils/middlewares/types.js +1 -1
  15. package/dist/agent-utils/tools/FunctionTool.js +1 -1
  16. package/dist/agent-utils/types.d.ts +13 -13
  17. package/dist/agent-utils/workflows/ConditionalWorkflow.js +1 -1
  18. package/dist/agent-utils/workflows/LoopWorkflow.js +1 -1
  19. package/dist/agent-utils/workflows/ParallelWorkflow.js +1 -1
  20. package/dist/agent-utils/workflows/RouterWorkflow.js +1 -1
  21. package/dist/agent-utils/workflows/SequentialWorkflow.js +1 -1
  22. package/dist/agent-utils/workflows/SwitchWorkflow.js +1 -1
  23. package/dist/agentic-workflow/AgenticWorkflowRuntime.d.ts +24 -0
  24. package/dist/agentic-workflow/Edge.d.ts +16 -0
  25. package/dist/agentic-workflow/WebAgent.d.ts +39 -0
  26. package/dist/agentic-workflow/jsonTypes.d.ts +189 -0
  27. package/dist/agentic-workflow/nodes/AgentNode.d.ts +28 -0
  28. package/dist/agentic-workflow/nodes/BaseNode.d.ts +35 -0
  29. package/dist/agentic-workflow/nodes/EndMessageNode.d.ts +25 -0
  30. package/dist/agentic-workflow/nodes/StartNode.d.ts +21 -0
  31. package/dist/agentic-workflow/nodes/tools/ArcgisTool.d.ts +21 -0
  32. package/dist/agentic-workflow/types.d.ts +29 -0
  33. package/dist/agents/runtime/skill/createSkillAgent.d.ts +31 -0
  34. package/dist/agents/runtime/skill/createSkillAgent.js +260 -0
  35. package/dist/agents/runtime/skill/loadAgentSkills.d.ts +16 -0
  36. package/dist/agents/runtime/skill/types.d.ts +28 -0
  37. package/dist/agents/runtime/skill/types.js +2 -0
  38. package/dist/agents/tools/filter/clearFilters/adapter.d.ts +8 -0
  39. package/dist/agents/tools/filter/clearFilters/adapter.js +22 -0
  40. package/dist/agents/tools/filter/resetMap/adapter.d.ts +8 -0
  41. package/dist/agents/tools/filter/resetMap/adapter.js +22 -0
  42. package/dist/agents/tools/filter/setFeatureEffect/adapter.d.ts +8 -0
  43. package/dist/agents/tools/filter/setFeatureEffect/adapter.js +122 -0
  44. package/dist/agents/tools/help/listFields/adapter.d.ts +11 -0
  45. package/dist/agents/tools/help/listFields/adapter.js +30 -0
  46. package/dist/agents/tools/navigation/goToAddress/adapter.d.ts +10 -0
  47. package/dist/agents/tools/navigation/goToAddress/adapter.js +60 -0
  48. package/dist/agents/tools/navigation/goToBookmark/adapter.d.ts +8 -0
  49. package/dist/agents/tools/navigation/goToBookmark/adapter.js +30 -0
  50. package/dist/agents/tools/navigation/goToFeatures/adapter.d.ts +8 -0
  51. package/dist/agents/tools/navigation/goToFeatures/adapter.js +50 -0
  52. package/dist/agents/tools/navigation/goToFullExtent/adapter.d.ts +8 -0
  53. package/dist/agents/tools/navigation/goToFullExtent/adapter.js +27 -0
  54. package/dist/agents/tools/navigation/goToHomeExtent/adapter.d.ts +8 -0
  55. package/dist/agents/tools/navigation/goToHomeExtent/adapter.js +24 -0
  56. package/dist/agents/tools/navigation/goToLayer/adapter.d.ts +8 -0
  57. package/dist/agents/tools/navigation/goToLayer/adapter.js +26 -0
  58. package/dist/agents/tools/navigation/goToScale/adapter.d.ts +8 -0
  59. package/dist/agents/tools/navigation/goToScale/adapter.js +21 -0
  60. package/dist/agents/tools/navigation/goToViewpoint/adapter.d.ts +8 -0
  61. package/dist/agents/tools/navigation/goToViewpoint/adapter.js +42 -0
  62. package/dist/agents/tools/navigation/goToZoom/adapter.d.ts +8 -0
  63. package/dist/agents/tools/navigation/goToZoom/adapter.js +21 -0
  64. package/dist/agents/tools/query/getAttribute/adapter.d.ts +8 -0
  65. package/dist/agents/tools/query/getAttribute/adapter.js +40 -0
  66. package/dist/agents/tools/query/getStatistics/adapter.d.ts +8 -0
  67. package/dist/agents/tools/query/getStatistics/adapter.js +158 -0
  68. package/dist/agents/tools/query/getTopFeatures/adapter.d.ts +8 -0
  69. package/dist/agents/tools/query/getTopFeatures/adapter.js +145 -0
  70. package/dist/agents/tools/query/queryFeatures/adapter.d.ts +8 -0
  71. package/dist/agents/tools/query/queryFeatures/adapter.js +131 -0
  72. package/dist/agents/tools/search/findRelevantFields/adapter.d.ts +8 -0
  73. package/dist/agents/tools/search/findRelevantFields/adapter.js +57 -0
  74. package/dist/agents/tools/search/findRelevantLayers/adapter.d.ts +8 -0
  75. package/dist/agents/tools/search/findRelevantLayers/adapter.js +38 -0
  76. package/dist/agents/tools/shared/resolveToolArtifact.d.ts +22 -0
  77. package/dist/agents/tools/shared/resolveToolArtifact.js +20 -0
  78. package/dist/agents/tools/shared/types.d.ts +22 -0
  79. package/dist/agents/tools/shared/types.js +6 -0
  80. package/dist/cdn/24EIZVUM.js +2 -0
  81. package/dist/cdn/25MBI4PD.js +2 -0
  82. package/dist/cdn/275FFTBE.js +2 -0
  83. package/dist/cdn/27CK3JHY.js +2 -0
  84. package/dist/cdn/2F4TPWZQ.js +2 -0
  85. package/dist/cdn/2LVYAXHG.js +44 -0
  86. package/dist/cdn/2UJPYWWZ.js +3 -0
  87. package/dist/cdn/2WXXSZP5.js +2 -0
  88. package/dist/cdn/{Q7TL5Q5N.js → 3KNLFIM3.js} +2 -2
  89. package/dist/cdn/3PPXAIRE.js +14 -0
  90. package/dist/cdn/45BDE3MG.js +2 -0
  91. package/dist/cdn/477I66FH.js +56 -0
  92. package/dist/cdn/4CFCV47G.js +2 -0
  93. package/dist/cdn/4IWDBEMN.js +34 -0
  94. package/dist/cdn/4OI4QEV7.js +6 -0
  95. package/dist/cdn/{DXVU45KM.js → 4VBOTWC3.js} +2 -2
  96. package/dist/cdn/4YOG5F3W.js +2 -0
  97. package/dist/cdn/53KIFJFA.js +4 -0
  98. package/dist/cdn/5X23DDDZ.js +2 -0
  99. package/dist/cdn/65LCK3GG.js +3 -0
  100. package/dist/cdn/6KWGSXIN.js +2 -0
  101. package/dist/cdn/7DOYUO7L.js +71 -0
  102. package/dist/cdn/{WAIFKDR3.js → 7UBTNDV6.js} +2 -2
  103. package/dist/cdn/7Y43R7QJ.js +2 -0
  104. package/dist/cdn/A6LBMS7A.js +2 -0
  105. package/dist/cdn/AP3KPOHN.js +2 -0
  106. package/dist/cdn/AUCKEB52.js +2 -0
  107. package/dist/cdn/B3HXSEBN.js +2 -0
  108. package/dist/cdn/BBEGLIZC.js +2 -0
  109. package/dist/cdn/BJMGT6GV.js +19 -0
  110. package/dist/cdn/BTOBEN7Q.js +2 -0
  111. package/dist/cdn/BTTCBEPW.js +2 -0
  112. package/dist/cdn/BVUCNXC5.js +2 -0
  113. package/dist/cdn/CAOMMQSY.js +66 -0
  114. package/dist/cdn/CKUUYQLO.js +2 -0
  115. package/dist/cdn/{ZEYIBYSF.js → CSE6BHOJ.js} +2 -2
  116. package/dist/cdn/CX2HJ67C.js +2 -0
  117. package/dist/cdn/EGRRZTF6.js +2 -0
  118. package/dist/cdn/EK3PM4L5.js +2 -0
  119. package/dist/cdn/EXMEB4X2.js +2 -0
  120. package/dist/cdn/EYGZJKVD.js +2 -0
  121. package/dist/cdn/{24QNMEFG.js → FDRAKF5D.js} +2 -2
  122. package/dist/cdn/FHBRXZLV.js +2 -0
  123. package/dist/cdn/{5CV7R5IS.js → FK2CVSXW.js} +6 -6
  124. package/dist/cdn/FLUI6GCU.js +2 -0
  125. package/dist/cdn/{ZTBA5PM7.js → FPH52WOH.js} +2 -2
  126. package/dist/cdn/FRYS2PZJ.js +2 -0
  127. package/dist/cdn/FSLQCZRN.js +2 -0
  128. package/dist/cdn/{LQ6R5YRN.js → FTTLFIBV.js} +2 -2
  129. package/dist/cdn/FV6FHLYW.js +2 -0
  130. package/dist/cdn/G24MNC7D.js +6 -0
  131. package/dist/cdn/{F6QHMKF5.js → GW3IVAAZ.js} +2 -2
  132. package/dist/cdn/HI3XKFHD.js +2 -0
  133. package/dist/cdn/HKIA5PWU.js +2 -0
  134. package/dist/cdn/{6ZW7Z36F.js → HMMYCSOK.js} +4 -4
  135. package/dist/cdn/HNTSDY3J.js +2 -0
  136. package/dist/cdn/HV7MVIQV.js +2 -0
  137. package/dist/cdn/I3SUE2TR.js +2 -0
  138. package/dist/cdn/I72ST4JR.js +134 -0
  139. package/dist/cdn/{T537PKP4.js → IHUWQOMK.js} +2 -2
  140. package/dist/cdn/JMXXRRKQ.js +22 -0
  141. package/dist/cdn/JUNMTIB3.js +2 -0
  142. package/dist/cdn/{6YMR4QSD.js → JYNHWJUZ.js} +2 -2
  143. package/dist/cdn/KAX4A7SF.js +2 -0
  144. package/dist/cdn/KBSXHSBX.js +2 -0
  145. package/dist/cdn/KKCLHXHG.js +2 -0
  146. package/dist/cdn/L2HLFWCV.js +72 -0
  147. package/dist/cdn/{7RCQFLPP.js → L3BTURBA.js} +2 -2
  148. package/dist/cdn/LBTGOMCT.js +2 -0
  149. package/dist/cdn/LIRT72WY.js +2 -0
  150. package/dist/cdn/LL324IL6.js +2 -0
  151. package/dist/cdn/LLY5A2E2.js +2 -0
  152. package/dist/cdn/LXIKAXUT.js +2 -0
  153. package/dist/cdn/M2U456J5.js +181 -0
  154. package/dist/cdn/M3KKORBG.js +2 -0
  155. package/dist/cdn/M5B6X46F.js +2 -0
  156. package/dist/cdn/{X2ZDYHCG.js → MZUDIQQH.js} +11 -6
  157. package/dist/cdn/NBDOPGSN.js +2 -0
  158. package/dist/cdn/NGR5NVZE.js +2 -0
  159. package/dist/cdn/{5ZZGKP7N.js → NNPA3NLK.js} +2 -2
  160. package/dist/cdn/NV7CL4S3.js +2 -0
  161. package/dist/cdn/{5W7S2RS4.js → OALQBAZR.js} +2 -2
  162. package/dist/cdn/OF3TAARW.js +2 -0
  163. package/dist/cdn/{AZGGTNA3.js → OXC2WP7W.js} +2 -2
  164. package/dist/cdn/PJPP6LOS.js +3 -0
  165. package/dist/cdn/PUZ6RAFQ.js +2 -0
  166. package/dist/cdn/QAX6UF4L.js +99 -0
  167. package/dist/cdn/{NE7E52YR.js → QTEPFTAU.js} +10 -4
  168. package/dist/cdn/ROS22KOA.js +2 -0
  169. package/dist/cdn/RSM7MEVT.js +9 -0
  170. package/dist/cdn/SBNNJ5WA.js +2 -0
  171. package/dist/cdn/SDX46GZY.js +2 -0
  172. package/dist/cdn/SI22EJLC.js +2 -0
  173. package/dist/cdn/SJMAKF4P.js +2 -0
  174. package/dist/cdn/SNG3WODY.js +2 -0
  175. package/dist/cdn/STOGCXJH.js +2 -0
  176. package/dist/cdn/SUC2MIGE.js +2 -0
  177. package/dist/cdn/SXYKNDOF.js +2 -0
  178. package/dist/cdn/SZ2L5556.js +2 -0
  179. package/dist/cdn/T6W6F4TF.js +2 -0
  180. package/dist/cdn/TB2GJALS.js +2 -0
  181. package/dist/cdn/TFAJNKBC.js +2 -0
  182. package/dist/cdn/TLPZELG3.js +2 -0
  183. package/dist/cdn/TXZQZR3I.js +2 -0
  184. package/dist/cdn/UAZPINUQ.js +2 -0
  185. package/dist/cdn/UGIHS7OA.js +2 -0
  186. package/dist/cdn/{FX7UOGHP.js → V266DJ5V.js} +2 -2
  187. package/dist/cdn/V4PJMCJZ.js +2 -0
  188. package/dist/cdn/{P7DG5T3Z.js → V52GSTOC.js} +2 -2
  189. package/dist/cdn/VGLBH473.js +2 -0
  190. package/dist/cdn/VK6CCPTG.js +2 -0
  191. package/dist/cdn/{ZS2TZ6BF.js → VLPELJUS.js} +2 -2
  192. package/dist/cdn/VT5EWFH7.js +2 -0
  193. package/dist/cdn/{7CYGX4F4.js → VXLKTQ36.js} +2 -2
  194. package/dist/cdn/W54XYT2A.js +2 -0
  195. package/dist/cdn/X42ACC66.js +5 -0
  196. package/dist/cdn/XNUWVZN7.js +2 -0
  197. package/dist/cdn/XOTPSCNF.js +2 -0
  198. package/dist/cdn/XRVGYRXL.js +14 -0
  199. package/dist/cdn/XV7RMYLR.js +2 -0
  200. package/dist/cdn/XVJFPZTW.js +2 -0
  201. package/dist/cdn/XZF7Y6B2.js +2 -0
  202. package/dist/cdn/{UPEEHMSY.js → Y4TYL2AL.js} +2 -2
  203. package/dist/cdn/Y4ZOB6UH.js +2 -0
  204. package/dist/cdn/Y6CV2NZR.js +2 -0
  205. package/dist/cdn/YIXASZUW.js +2 -0
  206. package/dist/cdn/YOW3YKWR.js +11 -0
  207. package/dist/cdn/{23EQTPO3.js → ZA7ZU2F7.js} +2 -2
  208. package/dist/cdn/ZJWR4W2S.js +208 -0
  209. package/dist/cdn/ZWIKFBOU.js +2 -0
  210. package/dist/cdn/ZY3JQCZQ.js +179 -0
  211. package/dist/cdn/agent-utils/index.js +2 -2
  212. package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +2 -2
  213. package/dist/cdn/agent-utils/middlewares/middleware.js +2 -2
  214. package/dist/cdn/agent-utils/middlewares/trace.js +2 -2
  215. package/dist/cdn/assets/assistant/t9n/messages.en.json +1 -1
  216. package/dist/cdn/assets/assistant-interrupt/t9n/messages.en.json +1 -1
  217. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.en.json +1 -0
  218. package/dist/cdn/assets/assistant-message/t9n/messages.en.json +1 -0
  219. package/dist/cdn/assets/assistant-message-loading/t9n/messages.en.json +1 -0
  220. package/dist/cdn/index.js +2 -2
  221. package/dist/chunks/BaseWorkflow.js +1 -1
  222. package/dist/chunks/SKILL.js +5 -0
  223. package/dist/chunks/SKILL2.js +5 -0
  224. package/dist/chunks/SKILL3.js +22 -0
  225. package/dist/chunks/SKILL4.js +5 -0
  226. package/dist/chunks/adapter.js +1127 -2011
  227. package/dist/chunks/aiFactory.js +94 -0
  228. package/dist/chunks/arcgisKnowledgeGraph.js +97 -77
  229. package/dist/chunks/arcgisToolRegistry.js +88 -0
  230. package/dist/chunks/arcgis_knowledge_current_lc_context.js +20 -3
  231. package/dist/chunks/arcgis_knowledge_current_map_context.js +32 -3
  232. package/dist/chunks/arcgis_knowledge_cypher_query_prompt.js +102 -0
  233. package/dist/chunks/arcgis_knowledge_lucene_generation_prompt.js +1 -1
  234. package/dist/chunks/arcgis_knowledge_summarize_result_prompt.js +117 -28
  235. package/dist/chunks/arcgis_knowledge_tool_prompt.js +1 -1
  236. package/dist/chunks/baseAgentState.js +58 -0
  237. package/dist/chunks/converterUtils.js +67 -42
  238. package/dist/chunks/dataExplorationAgent.js +19 -0
  239. package/dist/chunks/data_explore_filter_prompt.js +1 -1
  240. package/dist/chunks/data_explore_query_prompt.js +10 -5
  241. package/dist/chunks/embeddings.worker.js +1 -1
  242. package/dist/chunks/fetchAgentContext.js +13 -0
  243. package/dist/chunks/fetchService.js +10 -0
  244. package/dist/chunks/fieldStatistics.js +79 -0
  245. package/dist/chunks/field_descriptions_prompt.js +1 -1
  246. package/dist/chunks/formatFeatureAttributes.js +132 -0
  247. package/dist/chunks/generateLayerDescriptions.js +190 -311
  248. package/dist/chunks/graph.js +1 -1
  249. package/dist/chunks/helpAgent.js +34 -0
  250. package/dist/chunks/help_prompt.js +35 -18
  251. package/dist/chunks/index.js +1 -1
  252. package/dist/chunks/intent_prompt.js +3 -3
  253. package/dist/chunks/layerStylingGraph.js +102 -84
  254. package/dist/chunks/layer_descriptions_prompt.js +1 -1
  255. package/dist/chunks/layer_styling_prompt.js +1 -1
  256. package/dist/chunks/mergeWhereClauses.js +15 -0
  257. package/dist/chunks/navigationAgent.js +27 -0
  258. package/dist/chunks/navigation_intent_prompt.js +9 -3
  259. package/dist/chunks/navigation_tool_prompt.js +1 -1
  260. package/dist/chunks/orchestrator.js +446 -235
  261. package/dist/chunks/requireAgentServices.js +11 -0
  262. package/dist/chunks/resolvePointGeometryFilter.js +92 -0
  263. package/dist/chunks/runtime.js +1 -1
  264. package/dist/chunks/slottableRequestUtils.js +1 -1
  265. package/dist/chunks/state.js +22 -28
  266. package/dist/chunks/summarize_query_response_prompt.js +1 -1
  267. package/dist/chunks/useT9n.js +1 -1
  268. package/dist/chunks/utils.js +1 -1
  269. package/dist/chunks/utils2.js +12 -12
  270. package/dist/chunks/utils3.js +1 -1
  271. package/dist/components/arcgis-assistant/customElement.d.ts +102 -1
  272. package/dist/components/arcgis-assistant/customElement.js +332 -184
  273. package/dist/components/arcgis-assistant-agent/customElement.d.ts +13 -1
  274. package/dist/components/arcgis-assistant-agent/customElement.js +533 -11
  275. package/dist/components/arcgis-assistant-chat/customElement.js +23 -18
  276. package/dist/components/arcgis-assistant-chat-entry/customElement.js +1 -1
  277. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +35 -9
  278. package/dist/components/arcgis-assistant-help-agent/customElement.js +32 -9
  279. package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -0
  280. package/dist/components/arcgis-assistant-interrupt/customElement.js +12 -13
  281. package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +13 -9
  282. package/dist/components/arcgis-assistant-knowledge-agent/customElement.d.ts +1 -1
  283. package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +41 -17
  284. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +31 -8
  285. package/dist/components/arcgis-assistant-message/customElement.d.ts +3 -0
  286. package/dist/components/arcgis-assistant-message/customElement.js +10 -9
  287. package/dist/components/arcgis-assistant-message-block/customElement.js +2 -2
  288. package/dist/components/arcgis-assistant-message-feedback/customElement.js +1 -1
  289. package/dist/components/arcgis-assistant-message-footer/customElement.js +1 -1
  290. package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +3 -0
  291. package/dist/components/arcgis-assistant-message-loading/customElement.js +12 -11
  292. package/dist/components/arcgis-assistant-message-log/customElement.js +1 -1
  293. package/dist/components/arcgis-assistant-message-read-aloud/customElement.js +1 -1
  294. package/dist/components/arcgis-assistant-message-text/customElement.d.ts +1 -0
  295. package/dist/components/arcgis-assistant-message-text/customElement.js +13 -13
  296. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +34 -10
  297. package/dist/components/arcgis-assistant-speech-input/customElement.js +35 -53
  298. package/dist/components/arcgis-assistant-suggested-prompts/customElement.js +1 -1
  299. package/dist/components/arcgis-assistant-user-message/customElement.d.ts +2 -0
  300. package/dist/components/arcgis-assistant-user-message/customElement.js +16 -11
  301. package/dist/docs/api.json +1 -1
  302. package/dist/docs/docs.json +1 -1
  303. package/dist/docs/vscode.html-custom-data.json +1 -1
  304. package/dist/docs/web-types.json +1 -1
  305. package/dist/index.js +1 -1
  306. package/dist/loader.js +7 -7
  307. package/dist/oauth-callback.html +1 -1
  308. package/dist/orchestrator/models/types.d.ts +1 -0
  309. package/dist/orchestrator/orchestrator/orchestratorEvents.d.ts +78 -0
  310. package/dist/orchestrator/providers/arcgis/aiFactory.d.ts +15 -0
  311. package/dist/orchestrator/types/types.d.ts +17 -0
  312. package/dist/types/lumina.d.ts +5 -4
  313. package/dist/types/preact.d.ts +5 -4
  314. package/dist/types/react.d.ts +5 -4
  315. package/dist/types/stencil.d.ts +7 -6
  316. package/dist/utils/index.d.ts +75 -39
  317. package/dist/utils/index.js +708 -84
  318. package/package.json +35 -12
  319. package/dist/cdn/34SG44C3.js +0 -72
  320. package/dist/cdn/3JGWGKT6.js +0 -2
  321. package/dist/cdn/3NBDVZ2I.js +0 -2
  322. package/dist/cdn/3VOQD2MR.js +0 -2
  323. package/dist/cdn/434TAA3J.js +0 -2
  324. package/dist/cdn/53NTYC4I.js +0 -2
  325. package/dist/cdn/5QAHYX7Y.js +0 -5
  326. package/dist/cdn/AXDZBBNL.js +0 -45
  327. package/dist/cdn/B7WJFBOZ.js +0 -2
  328. package/dist/cdn/BX7FSMUU.js +0 -56
  329. package/dist/cdn/CHPQM77M.js +0 -181
  330. package/dist/cdn/DHKUXLU3.js +0 -179
  331. package/dist/cdn/DQSEBKOX.js +0 -2
  332. package/dist/cdn/DZ2QWNUA.js +0 -3
  333. package/dist/cdn/EBISDZ5H.js +0 -2
  334. package/dist/cdn/ERL2CB2Y.js +0 -14
  335. package/dist/cdn/F2AHA4GB.js +0 -54
  336. package/dist/cdn/FUIGPHBH.js +0 -2
  337. package/dist/cdn/H2CHHGGH.js +0 -2
  338. package/dist/cdn/HWKDNS4K.js +0 -4
  339. package/dist/cdn/IMQ4TVHF.js +0 -16
  340. package/dist/cdn/IOD3GDA7.js +0 -2
  341. package/dist/cdn/IR7PTESF.js +0 -2
  342. package/dist/cdn/IRZDTYO2.js +0 -2
  343. package/dist/cdn/JIWK6QK6.js +0 -2
  344. package/dist/cdn/JLKGS6Y5.js +0 -36
  345. package/dist/cdn/K3JCH4XW.js +0 -2
  346. package/dist/cdn/KHXUWZHB.js +0 -2
  347. package/dist/cdn/KMQ3SP4I.js +0 -5
  348. package/dist/cdn/LIFK3QSD.js +0 -2
  349. package/dist/cdn/NXKKG5TK.js +0 -2
  350. package/dist/cdn/O3EN27N5.js +0 -2
  351. package/dist/cdn/O3RFFPU3.js +0 -6
  352. package/dist/cdn/PBO6FZN6.js +0 -2
  353. package/dist/cdn/Q3ZW4FYA.js +0 -3
  354. package/dist/cdn/Q6LRANX6.js +0 -2
  355. package/dist/cdn/QCSN44H4.js +0 -2
  356. package/dist/cdn/R56X6ZKR.js +0 -161
  357. package/dist/cdn/RUURNLTP.js +0 -2
  358. package/dist/cdn/T43LEBBE.js +0 -47
  359. package/dist/cdn/TR4GFL7X.js +0 -2
  360. package/dist/cdn/WNS5ZUF5.js +0 -2
  361. package/dist/cdn/X4XY5HIE.js +0 -2
  362. package/dist/cdn/XOH56EQ2.js +0 -2
  363. package/dist/cdn/XON27U6U.js +0 -2
  364. package/dist/cdn/YIMNOUTF.js +0 -2
  365. package/dist/cdn/YLN2BZ5J.js +0 -2
  366. package/dist/cdn/YUKR4AZW.js +0 -2
  367. package/dist/cdn/Z2G7MP5L.js +0 -22
  368. package/dist/chunks/dataExplorationGraph.js +0 -310
  369. package/dist/chunks/helpGraph.js +0 -126
  370. package/dist/chunks/navigationGraph.js +0 -270
  371. package/dist/chunks/toolCallResponse.js +0 -31
@@ -1,55 +1,86 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import { g as p } from "../chunks/orchestrator.js";
3
- import { O as ue } from "../chunks/orchestrator.js";
4
- import { s as h, a as A } from "../chunks/index.js";
5
- import { g as S, a as v, W as w, f, l as y, d as $, m as b, b as E, s as L, i as P, e as M, h as T, j as R, k, c as x } from "../chunks/generateLayerDescriptions.js";
6
- import D from "@arcgis/core/layers/FeatureLayer.js";
7
- import * as W from "@arcgis/core/core/reactiveUtils.js";
8
- import { N as F } from "../chunks/navigationGraph.js";
9
- import { L as C } from "../chunks/layerStylingGraph.js";
10
- import { D as N } from "../chunks/dataExplorationGraph.js";
11
- import { H as z } from "../chunks/helpGraph.js";
12
- import { A as H } from "../chunks/arcgisKnowledgeGraph.js";
13
- const I = async (e) => {
14
- const t = e.allLayers.toArray(), s = [], o = /* @__PURE__ */ new Map();
15
- for (const a of t)
16
- if (a instanceof D) {
17
- const m = (async () => {
18
- const r = await S(a), n = await v(a, r);
19
- o.set(a.id, { layerItem: n, fieldRegistry: r });
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
2
+ import { g as q } from "../chunks/orchestrator.js";
3
+ import { O as fa } from "../chunks/orchestrator.js";
4
+ import { s as d, a as Q } from "../chunks/index.js";
5
+ import { c as B, d as J, W as U, f as _, l as I, e as K, m as X, h as Y, s as ee, i as v, j as D, a as z } from "../chunks/generateLayerDescriptions.js";
6
+ import { c as te } from "../chunks/aiFactory.js";
7
+ import ae from "@arcgis/core/layers/FeatureLayer.js";
8
+ import * as oe from "@arcgis/core/core/reactiveUtils.js";
9
+ import { a as se, d as re } from "../chunks/baseAgentState.js";
10
+ import { N as ne } from "../chunks/navigationAgent.js";
11
+ import { StateGraph as T, START as b, END as x } from "@langchain/langgraph/web";
12
+ import { e as S, t as E, N as G, x as P, y as ie, D as V, z as le, H } from "../chunks/adapter.js";
13
+ import "@arcgis/core/identity/IdentityManager.js";
14
+ import "@arcgis/core/portal/Portal.js";
15
+ import "@arcgis/core/request.js";
16
+ import "@arcgis/toolkit/string";
17
+ import { AIMessage as ce } from "@langchain/core/messages";
18
+ import "@langchain/core/callbacks/dispatch/web";
19
+ import "@langchain/core/callbacks/base";
20
+ import "@langchain/openai";
21
+ import "@arcgis/core/config.js";
22
+ import { goToAddressTool as de } from "../agents/tools/navigation/goToAddress/adapter.js";
23
+ import { goToBookmarkTool as me } from "../agents/tools/navigation/goToBookmark/adapter.js";
24
+ import { goToFeaturesTool as pe } from "../agents/tools/navigation/goToFeatures/adapter.js";
25
+ import { goToFullExtentTool as ge } from "../agents/tools/navigation/goToFullExtent/adapter.js";
26
+ import { goToHomeExtentTool as ue } from "../agents/tools/navigation/goToHomeExtent/adapter.js";
27
+ import { goToLayerTool as he } from "../agents/tools/navigation/goToLayer/adapter.js";
28
+ import { goToScaleTool as ye } from "../agents/tools/navigation/goToScale/adapter.js";
29
+ import { goToViewpointTool as fe } from "../agents/tools/navigation/goToViewpoint/adapter.js";
30
+ import { goToZoomTool as xe } from "../agents/tools/navigation/goToZoom/adapter.js";
31
+ import { f as $ } from "../chunks/fetchAgentContext.js";
32
+ import { h as w, L as Se } from "../chunks/layerStylingGraph.js";
33
+ import "@langchain/core/prompts";
34
+ import { ToolNode as M } from "@langchain/langgraph/prebuilt";
35
+ import k from "zod";
36
+ import { f as u } from "../chunks/fetchService.js";
37
+ import { r as L } from "../chunks/requireAgentServices.js";
38
+ import { D as ve } from "../chunks/dataExplorationAgent.js";
39
+ import { b as j } from "../chunks/formatFeatureAttributes.js";
40
+ import { b as Ee } from "../chunks/fieldStatistics.js";
41
+ import { H as we } from "../chunks/helpAgent.js";
42
+ import { listLayerFieldsTool as Te } from "../agents/tools/help/listFields/adapter.js";
43
+ import { A as be } from "../chunks/arcgisKnowledgeGraph.js";
44
+ const $e = async (e) => {
45
+ const t = e.allLayers.toArray(), a = [], o = /* @__PURE__ */ new Map();
46
+ for (const n of t)
47
+ if (n instanceof ae) {
48
+ const s = (async () => {
49
+ const r = await B(n), l = await J(n, r);
50
+ o.set(n.id, { layerItem: l, fieldRegistry: r });
20
51
  })();
21
- s.push(m);
52
+ a.push(s);
22
53
  }
23
- return await Promise.all(s), o;
24
- }, O = async (e) => {
25
- await W.whenOnce(() => e.ready);
26
- const t = await I(e.map), { layers: s } = await U(t), o = {
27
- schemaVersion: L,
54
+ return await Promise.all(a), o;
55
+ }, Me = async (e) => {
56
+ await oe.whenOnce(() => e.ready);
57
+ const t = await $e(e.map), { layers: a } = await Le(t), o = {
58
+ schemaVersion: ee,
28
59
  modified: Date.now(),
29
60
  embeddings: {
30
- modelProvider: E,
31
- model: b,
32
- dimensions: $,
61
+ modelProvider: Y,
62
+ model: X,
63
+ dimensions: K,
33
64
  templates: {
34
- layer: y,
35
- field: f
65
+ layer: I,
66
+ field: _
36
67
  }
37
68
  },
38
- layers: s
39
- }, a = w.safeParse(o);
40
- if (!a.success)
41
- throw console.error("Schema Mismatch:", a.error.format()), new Error("Webmap embedding generation failed validation.");
42
- return a.data;
43
- }, U = async (e) => {
44
- const t = [], s = [];
45
- for (const [r, { fieldRegistry: n, layerItem: i }] of e.entries()) {
46
- const l = g(y, {
69
+ layers: a
70
+ }, n = U.safeParse(o);
71
+ if (!n.success)
72
+ throw console.error("Schema Mismatch:", n.error.format()), new Error("Webmap embedding generation failed validation.");
73
+ return n.data;
74
+ }, Le = async (e) => {
75
+ const t = [], a = [];
76
+ for (const [r, { fieldRegistry: l, layerItem: i }] of e.entries()) {
77
+ const c = C(I, {
47
78
  name: i.name,
48
79
  title: i.title,
49
80
  description: i.description
50
81
  });
51
- t.push(l);
52
- const d = {
82
+ t.push(c);
83
+ const m = {
53
84
  id: r,
54
85
  name: i.name ?? "",
55
86
  title: i.title,
@@ -57,60 +88,653 @@ const I = async (e) => {
57
88
  vector: [],
58
89
  fields: []
59
90
  };
60
- for (const [, c] of n.entries()) {
61
- const u = g(f, {
62
- name: c.name,
63
- alias: c.alias,
64
- description: c.description
91
+ for (const [, g] of l.entries()) {
92
+ const p = C(_, {
93
+ name: g.name,
94
+ alias: g.alias,
95
+ description: g.description
65
96
  });
66
- t.push(u), d.fields.push({
67
- name: c.name,
68
- alias: c.alias,
69
- description: c.description,
97
+ t.push(p), m.fields.push({
98
+ name: g.name,
99
+ alias: g.alias,
100
+ description: g.description,
70
101
  vector: []
71
102
  });
72
103
  }
73
- s.push(d);
104
+ a.push(m);
74
105
  }
75
- const o = await p(t);
76
- let a = 0;
77
- return { layers: s.map((r) => (r.vector = o[a++], r.fields.forEach((n) => {
78
- n.vector = o[a++];
106
+ const o = await q(t);
107
+ let n = 0;
108
+ return { layers: a.map((r) => (r.vector = o[n++], r.fields.forEach((l) => {
109
+ l.vector = o[n++];
79
110
  }), r)) };
80
- }, g = (e, t) => e.replace(/\{(\w+)\}/gu, (s, o) => t[o] ?? ""), V = (e, t) => {
111
+ }, C = (e, t) => e.replace(/\{(\w+)\}/gu, (a, o) => t[o] ?? ""), Re = (e, t) => {
81
112
  if (e.length !== t.length)
82
113
  throw new Error("Vectors must be the same length");
83
- let s = 0, o = 0, a = 0;
84
- for (let n = 0; n < e.length; ++n) {
85
- const i = e[n], l = t[n];
86
- s += i * l, o += i * i, a += l * l;
114
+ let a = 0, o = 0, n = 0;
115
+ for (let l = 0; l < e.length; ++l) {
116
+ const i = e[l], c = t[l];
117
+ a += i * c, o += i * i, n += c * c;
87
118
  }
88
- const m = Math.sqrt(o * a);
89
- if (m === 0)
119
+ const s = Math.sqrt(o * n);
120
+ if (s === 0)
90
121
  return 0;
91
- const r = s / m;
122
+ const r = a / s;
92
123
  return Math.max(-1, Math.min(1, r));
93
- }, Y = M, Z = P, ee = T, te = h, ae = p, se = V, oe = F, re = C, ne = N, ie = z, ce = H, me = O, le = () => R(), de = () => k(), ge = async (e, t) => await A(e, t), pe = async ({
124
+ }, R = [
125
+ de,
126
+ me,
127
+ pe,
128
+ ge,
129
+ ue,
130
+ he,
131
+ ye,
132
+ fe,
133
+ xe
134
+ ];
135
+ async function ke(e, t) {
136
+ const a = await S("navigation_tool_prompt"), { mapView: o } = $(t, ["mapView"]), s = o.map.bookmarks?.map((f) => f.name).filter(Boolean) ?? [], r = e.vectorSearchLayerResults?.length > 0 ? e.vectorSearchLayerResults.map(
137
+ (f, Z) => `${Z + 1}. layerId=${f.id} | title=${f.title ?? ""} | name=${f.name ?? ""} | score=${f.score.toFixed(2)}`
138
+ ).join(`
139
+ `) : "", l = e.vectorSearchFieldResults?.length > 0 ? JSON.stringify(e.vectorSearchFieldResults, null, 2) : "", i = e.intent === "goToBookmark" && s.length ? `Available bookmarks:
140
+ ${s.map((f) => `- ${f}`).join(`
141
+ `)}` : "", c = (e.intent === "goToLayer" || e.intent === "goToFeatures") && e.vectorSearchLayerResults?.length ? `Candidate layers:
142
+ ${r}` : "", m = e.intent === "goToFeatures" && e.vectorSearchFieldResults?.length ? `Candidate fields:
143
+ ${l}` : "", g = {
144
+ intent: e.intent,
145
+ bookmarksSection: i,
146
+ layersSection: c,
147
+ fieldsSection: m,
148
+ currentZoom: o.zoom,
149
+ assignedTask: e.agentExecutionContext.assignedTask,
150
+ userRequest: e.agentExecutionContext.userRequest,
151
+ priorSteps: e.agentExecutionContext.priorSteps
152
+ }, p = await v({
153
+ promptText: a,
154
+ modelTier: "fast",
155
+ config: t,
156
+ inputVariables: g,
157
+ tools: R
158
+ });
159
+ await w(p, t);
160
+ const h = (p.tool_calls?.length ?? 0) > 0, y = typeof p.text == "string" ? p.text.trim() : "", W = y.length > 0;
161
+ return {
162
+ ...e,
163
+ navigationInternalState: {
164
+ ...e.navigationInternalState,
165
+ toolCallMessage: h ? p : void 0
166
+ },
167
+ // No tool call => surface fallback text now. Tool call => tool node will set output.
168
+ outputMessage: h ? e.outputMessage : y,
169
+ status: h ? e.status : W ? "success" : "failed"
170
+ };
171
+ }
172
+ const Ce = (e) => {
173
+ const t = typeof e == "string" ? e : String(e);
174
+ try {
175
+ const a = JSON.parse(t);
176
+ if (a && typeof a == "object" && typeof a.text == "string")
177
+ return a;
178
+ } catch {
179
+ console.warn("Failed to parse tool response as JSON:", t);
180
+ }
181
+ return { text: t };
182
+ };
183
+ async function Ae(e, t) {
184
+ const a = new M(R, { handleToolErrors: !1 });
185
+ try {
186
+ const o = e.navigationInternalState.toolCallMessage;
187
+ if (!o)
188
+ throw new Error("navigationToolCalling: missing navigationInternalState.toolCallMessage");
189
+ const { messages: n } = await a.invoke(
190
+ {
191
+ messages: [o]
192
+ },
193
+ t
194
+ );
195
+ let s = "", r, l;
196
+ for (const i of n) {
197
+ const c = Ce(i.content), m = i.artifact;
198
+ c.text && (s += `${c.text}
199
+ `);
200
+ const g = m?.sharedStatePatch ?? c.sharedStatePatch;
201
+ g && (r = {
202
+ ...r,
203
+ ...g
204
+ }), m?.sharedResourceAdditions && (l = [...l ?? [], ...m.sharedResourceAdditions]);
205
+ }
206
+ return await d({ text: `Finished executing navigation tool: ${s}` }, t), {
207
+ ...e,
208
+ outputMessage: s,
209
+ sharedStatePatch: r,
210
+ sharedResourceAdditions: l,
211
+ status: "success",
212
+ summary: s ? E(s) : "Navigation executed.",
213
+ navigationInternalState: {
214
+ ...e.navigationInternalState,
215
+ toolCallMessage: void 0
216
+ }
217
+ };
218
+ } catch (o) {
219
+ const n = o instanceof Error ? o.message : String(o);
220
+ return await d({ text: `Navigation tool execution failed: ${n}` }, t), {
221
+ ...e,
222
+ outputMessage: `Navigation tool execution failed: ${n}`,
223
+ status: "failed",
224
+ summary: `Navigation tool execution failed: ${n}`,
225
+ navigationInternalState: {
226
+ ...e.navigationInternalState,
227
+ toolCallMessage: void 0
228
+ }
229
+ };
230
+ }
231
+ }
232
+ async function Fe(e, t) {
233
+ const a = await S("navigation_intent_prompt"), { mapView: o } = $(t, ["mapView"]), n = R.map((p) => ({
234
+ name: p.name,
235
+ description: p.description,
236
+ schema: p.schema
237
+ })), r = o.map.bookmarks?.map((p) => p.name).filter(Boolean) ?? [], l = r.length ? `Available bookmarks:
238
+ ${r.map((p) => `- ${p}`).join(`
239
+ `)}` : "No bookmarks are available in this map.", i = {
240
+ tools: n.map(({ name: p, description: h, schema: y }) => `${p}: ${h}, ${JSON.stringify(y)}`).join(`
241
+ `),
242
+ bookmarks: l,
243
+ assignedTask: e.agentExecutionContext.assignedTask,
244
+ userRequest: e.agentExecutionContext.userRequest,
245
+ priorSteps: e.agentExecutionContext.priorSteps
246
+ }, c = k.object({
247
+ intent: k.string()
248
+ }), m = await D({
249
+ promptText: a,
250
+ config: t,
251
+ inputVariables: i,
252
+ schema: c,
253
+ modelTier: "fast"
254
+ }), g = typeof m.intent == "string" ? m.intent.trim().replace(/^"|"$/gu, "") : "";
255
+ return { ...e, intent: g || "" };
256
+ }
257
+ const Ne = 0.7, qe = async (e, t) => {
258
+ try {
259
+ await d(
260
+ { text: `Similarity search to find layers: ${e.agentExecutionContext.assignedTask}` },
261
+ t
262
+ );
263
+ const a = u(t, "layerSearch"), o = u(t, "layersAndFieldsRegistry"), n = u(t, "embeddingCache"), r = (await a.searchLayers({
264
+ text: e.agentExecutionContext.assignedTask,
265
+ minScore: Ne,
266
+ embeddingCache: n
267
+ })).map(({ id: i, score: c }) => {
268
+ const m = o.get(i)?.layerItem;
269
+ return {
270
+ id: i,
271
+ title: m?.title,
272
+ name: m?.name ?? void 0,
273
+ score: c
274
+ };
275
+ });
276
+ let l;
277
+ return r.length > 0 ? l = `Vector search completed. Matching layers:
278
+ ${r.map((i) => `- layerId=${i.id} | title=${i.title ?? ""} | name=${i.name ?? ""} | score=${i.score.toFixed(2)}`).join(`
279
+ `)}` : l = "Vector search completed. No matching layers found.", await d({ text: l }, t), {
280
+ ...e,
281
+ vectorSearchLayerResults: r
282
+ };
283
+ } catch (a) {
284
+ throw await d(
285
+ { text: `Error during vector search layers: ${a instanceof Error ? a.message : String(a)}` },
286
+ t
287
+ ), a;
288
+ }
289
+ }, A = 0.7, _e = 10, Ie = async (e, t) => {
290
+ try {
291
+ await d(
292
+ { text: `Similarity search to find fields: ${e.agentExecutionContext.assignedTask}` },
293
+ t
294
+ );
295
+ const a = u(t, "fieldSearch"), o = u(t, "layersAndFieldsRegistry"), n = u(t, "embeddingCache"), s = e.vectorSearchLayerResults?.map((c) => c.id) ?? [];
296
+ if (s.length === 0)
297
+ return await d({ text: "No candidate layers for field search" }, t), e;
298
+ const l = (await a.searchFields({
299
+ text: e.agentExecutionContext.assignedTask,
300
+ layerIds: s,
301
+ minScore: A,
302
+ topResults: _e,
303
+ embeddingCache: n
304
+ })).map(({ layerId: c, results: m }) => {
305
+ const g = o.get(c)?.fieldRegistry;
306
+ return {
307
+ layerId: c,
308
+ layerName: o.get(c)?.layerItem.name,
309
+ results: m.map((p) => {
310
+ const h = g?.get(p.name);
311
+ return {
312
+ name: p.name,
313
+ score: p.score,
314
+ type: h?.type,
315
+ alias: h?.alias,
316
+ description: h?.description,
317
+ statistics: h?.statistics,
318
+ domain: h?.domain
319
+ };
320
+ })
321
+ };
322
+ });
323
+ let i;
324
+ return l.length > 0 ? i = `Vector search completed. Matching layers and fields:
325
+ ${l.map(
326
+ (c) => `${c.layerName ?? c.layerId}:
327
+ ${c.results.map((m) => ` - ${m.name} (${m.score.toFixed(2)})`).join(`
328
+ `)}`
329
+ ).join(`
330
+ `)}` : i = `No vector search field results found for score over ${A}.`, await d({ text: i }, t), {
331
+ ...e,
332
+ vectorSearchFieldResults: l
333
+ };
334
+ } catch (a) {
335
+ throw await d(
336
+ { text: `Error during vector search fields: ${a instanceof Error ? a.message : String(a)}` },
337
+ t
338
+ ), a;
339
+ }
340
+ }, De = (e, t) => L(["layerSearch", "layersAndFieldsRegistry"], "Navigation Agent")(e, t), ze = () => new T(G).addNode("requireNavigationServices", De).addNode("intentLLM", Fe).addNode("vectorSearchLayers", qe).addNode("vectorSearchFields", Ie).addNode("agent", ke).addNode("tools", Ae).addEdge(b, "requireNavigationServices").addEdge("requireNavigationServices", "intentLLM").addConditionalEdges(
341
+ "intentLLM",
342
+ (t) => t.intent === "goToLayer" || t.intent === "goToFeatures" ? "vectorSearchLayers" : "agent",
343
+ {
344
+ vectorSearchLayers: "vectorSearchLayers",
345
+ agent: "agent"
346
+ }
347
+ ).addConditionalEdges(
348
+ "vectorSearchLayers",
349
+ (t) => t.intent === "goToFeatures" ? "vectorSearchFields" : "agent",
350
+ {
351
+ vectorSearchFields: "vectorSearchFields",
352
+ agent: "agent"
353
+ }
354
+ ).addEdge("vectorSearchFields", "agent").addEdge("agent", "tools").addEdge("tools", x), Ge = String.raw`- **navigation** — Enables users to interact with the map by navigating to specific locations, layers, features, or extents.
355
+ 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.
356
+
357
+ Supported actions:
358
+ - **Zooming**: Adjust the map's zoom level (e.g., "Zoom to level 10", "Zoom in").
359
+ - **Viewpoints**: Navigate to a specific center point with optional zoom or scale (e.g., "Center the map on San Francisco at zoom level 16").
360
+ - **Scales**: Set the map to a specific scale (e.g., "Set the map scale to 1:50,000").
361
+ - **Layers**: Zoom to the full extent of a specific layer (e.g., "Go to the water mains layer"). For the purposes of link charts, if the user requests to go to the extent of a link chart or the entities/nodes within it, that should be treated as a request to use the goToLayer tool on the link chart layer
362
+ - **Features**: Zoom to features in a layer that match a filter (e.g., "Zoom to all schools in the city").
363
+ - **Bookmarks**: Navigate to a predefined bookmark extent (e.g., "Go to the Downtown bookmark").
364
+ - **Extents**: Reset to the initial web map extent or zoom to the full world extent (e.g., "Reset the map", "Zoom to the full world extent").
365
+ - **Addresses**: Zoom to an address or place name (e.g., "Zoom to 1600 Pennsylvania Ave").
366
+
367
+ _Example: “Zoom to Texas”_
368
+ _Example: “Go to the water mains layer”_
369
+ _Example: “Zoom to to the extent of my link chart”_
370
+ _Example: “Center the map on San Francisco at scale 50000”_
371
+ _Example: “Zoom to the features in the schools layer where city = 'Austin'”_
372
+ _Example: “Go to the Downtown bookmark”_
373
+ _Example: “Where is Mount Rainier?”_`, Pe = {
374
+ id: "navigationGraph",
375
+ name: "Navigation Graph Agent",
376
+ description: Ge,
377
+ createGraph: ze,
378
+ workspace: G
379
+ }, Ve = async (e, t) => (await d({ text: "Exiting Data Exploration agent" }, t), e), He = async (e, t) => {
380
+ await d({ text: "Requesting LLM for layer filter results" }, t);
381
+ const o = await S("data_explore_filter_prompt");
382
+ if (!t?.configurable)
383
+ throw new Error("config.configurable is required for layer filter tools");
384
+ const { userTimezone: n, userTimezoneOffset: s } = j(), r = {
385
+ layerFieldInfo: e.layerFieldInfo,
386
+ userTimezone: n,
387
+ userTimezoneOffset: s,
388
+ queryResponse: e.queryResponse,
389
+ assignedTask: e.agentExecutionContext.assignedTask,
390
+ userRequest: e.agentExecutionContext.userRequest,
391
+ priorSteps: e.agentExecutionContext.priorSteps
392
+ }, l = await v({
393
+ promptText: o,
394
+ modelTier: "default",
395
+ config: t,
396
+ messages: e.dataExplorationMessages,
397
+ inputVariables: r,
398
+ tools: P
399
+ }), i = [...e.dataExplorationMessages, l];
400
+ if (!((l.tool_calls?.length ?? 0) > 0))
401
+ return await d({ text: "LLM determined no filter changes needed" }, t), {
402
+ ...e,
403
+ dataExplorationMessages: i
404
+ // Don't overwrite outputMessage if query already set it
405
+ };
406
+ const m = i, g = l.content.toString();
407
+ return await w(l, t), { ...e, dataExplorationMessages: m, outputMessage: g };
408
+ }, je = async (e, t) => {
409
+ await d({ text: "Requesting LLM for layer query results" }, t);
410
+ const o = await S("data_explore_query_prompt");
411
+ if (!t?.configurable)
412
+ throw new Error("config.configurable is required for layer query tools");
413
+ const { userTimezone: n, userTimezoneOffset: s } = j(), r = e.agentExecutionContext.sharedState, l = r.lastNavigatedFeatures?.value, i = r.lastResolvedLocation?.value;
414
+ let c = "none";
415
+ if (l != null)
416
+ try {
417
+ c = JSON.stringify(l);
418
+ } catch {
419
+ c = "none";
420
+ }
421
+ let m = "none";
422
+ if (i != null)
423
+ try {
424
+ m = JSON.stringify({
425
+ address: i.address,
426
+ location: i.location
427
+ });
428
+ } catch {
429
+ m = "none";
430
+ }
431
+ const g = {
432
+ layerFieldInfo: e.layerFieldInfo,
433
+ userTimezone: n,
434
+ userTimezoneOffset: s,
435
+ assignedTask: e.agentExecutionContext.assignedTask,
436
+ userRequest: e.agentExecutionContext.userRequest,
437
+ priorSteps: e.agentExecutionContext.priorSteps,
438
+ lastNavigatedFeatures: c,
439
+ lastResolvedLocation: m
440
+ }, p = await v({
441
+ promptText: o,
442
+ modelTier: "default",
443
+ config: t,
444
+ messages: e.dataExplorationMessages,
445
+ inputVariables: g,
446
+ tools: ie
447
+ }), h = (p.tool_calls?.length ?? 0) > 0, y = p.content.toString();
448
+ return await w(p, t), {
449
+ ...e,
450
+ dataExplorationMessages: [...e.dataExplorationMessages, p],
451
+ // Only emit output here when no tools are being called.
452
+ // For tool-calling flows, downstream summarizer nodes provide the final user-facing message.
453
+ ...h ? {} : { outputMessage: y },
454
+ status: "success",
455
+ summary: y && !h ? E(y) : "Query planning completed."
456
+ };
457
+ }, Oe = async (e, t) => {
458
+ try {
459
+ await d({ text: "Requesting LLM for summary on query results" }, t);
460
+ const o = await S("summarize_query_response_prompt"), n = {
461
+ queryResponse: e.queryResponse,
462
+ assignedTask: e.agentExecutionContext.assignedTask,
463
+ userRequest: e.agentExecutionContext.userRequest,
464
+ priorSteps: e.agentExecutionContext.priorSteps
465
+ }, s = await z({
466
+ promptText: o,
467
+ modelTier: "fast",
468
+ config: t,
469
+ messages: e.dataExplorationMessages,
470
+ inputVariables: n
471
+ }), r = typeof s == "string" ? s : s.content, l = new ce(r);
472
+ await d({ text: `Received response from LLM: ${r}` }, t);
473
+ const i = r;
474
+ return {
475
+ ...e,
476
+ outputMessage: i,
477
+ status: "success",
478
+ summary: i ? E(i) : "Summary generated.",
479
+ dataExplorationMessages: [...e.dataExplorationMessages, l]
480
+ };
481
+ } catch (a) {
482
+ throw await d({ text: "Error during filter LLM request" }, t), new Error(`Error during filter LLM request: ${a instanceof Error ? a.message : String(a)}`);
483
+ }
484
+ };
485
+ async function We(e, t) {
486
+ if ((e.queryResponse ?? []).some((s) => {
487
+ const r = s.details;
488
+ return typeof r == "object" && r !== null && "error" in r;
489
+ }))
490
+ return await d({ text: "Skipping layer filter tool because query response contains an error." }, t), { ...e };
491
+ const n = await new M(P, { handleToolErrors: !1 }).invoke(
492
+ {
493
+ messages: e.dataExplorationMessages
494
+ },
495
+ t
496
+ );
497
+ return await d(
498
+ { text: `Finished executing layer filter tool: ${n.messages.map((s) => s.content).join(", ")}` },
499
+ t
500
+ ), { ...e };
501
+ }
502
+ const F = /\b(average|avg|mean|median|max(?:imum)?|min(?:imum)?|sum|total|count|std(?:dev|\s*deviation)|variance|null\s*count|missing\s*values?|range)\b/iu;
503
+ function Ze(e, t) {
504
+ return F.test(e) || F.test(t);
505
+ }
506
+ const Qe = async (e, t) => {
507
+ try {
508
+ await d({ text: "Preparing field information for vector search results" }, t);
509
+ const a = u(t, "layersAndFieldsRegistry"), { mapView: o } = $(t, ["mapView"]), { assignedTask: n, userRequest: s } = e.agentExecutionContext, r = Ze(n, s), { layerFieldInfo: l, didFetchStatistics: i, fieldStatisticsFetchStatus: c } = await Ee(
510
+ e.vectorSearchFieldResults,
511
+ a,
512
+ o,
513
+ r
514
+ );
515
+ i ? await d({ text: "Statistics fetched" }, t) : await d({ text: "Statistics skipped" }, t);
516
+ for (const m of c)
517
+ await d(
518
+ {
519
+ text: ` - ${m.fieldName} - stats ${m.didFetchStatistics ? "fetched" : "skipped"}`
520
+ },
521
+ t
522
+ );
523
+ return await d({ text: "Field information prepared" }, t), { ...e, layerFieldInfo: l };
524
+ } catch (a) {
525
+ throw await d({ text: "Error during fetching statistics" }, t), new Error(`Error during fetching statistics: ${a instanceof Error ? a.message : String(a)}`);
526
+ }
527
+ }, N = 0.7, Be = 10, Je = async (e, t) => {
528
+ try {
529
+ await d({ text: "Similarity search to find fields" }, t);
530
+ const a = u(t, "fieldSearch"), o = u(t, "layersAndFieldsRegistry"), n = u(t, "embeddingCache"), s = await a.searchFields({
531
+ text: e.agentExecutionContext.assignedTask,
532
+ layerIds: e.vectorSearchLayerIds,
533
+ minScore: N,
534
+ topResults: Be,
535
+ embeddingCache: n
536
+ }), r = s.map(({ layerId: i, results: c }) => {
537
+ const m = c.map((g) => ` - ${g.name} (${g.score.toFixed(2)})`).join(`
538
+ `);
539
+ return `${o.get(i)?.layerItem.name ?? i}:
540
+ ${m}`;
541
+ }).join(`
542
+ `);
543
+ let l;
544
+ return s.length > 0 ? l = `Vector search completed. Matching layers and fields with scores:
545
+ ${r}` : l = `No vector search results found for score over ${N}.`, await d({ text: l }, t), {
546
+ ...e,
547
+ vectorSearchFieldResults: s
548
+ };
549
+ } catch (a) {
550
+ throw await d(
551
+ { text: `Error during vector search: ${a instanceof Error ? a.message : String(a)}` },
552
+ t
553
+ ), new Error(`Vector search failed: ${a instanceof Error ? a.message : String(a)}`);
554
+ }
555
+ }, Ue = 0.7, Ke = async (e, t) => {
556
+ try {
557
+ await d(
558
+ { text: `Similarity search to find layers: ${e.agentExecutionContext.assignedTask}` },
559
+ t
560
+ );
561
+ const a = u(t, "layerSearch"), o = u(t, "layersAndFieldsRegistry"), n = u(t, "embeddingCache"), s = await a.searchLayers({
562
+ text: e.agentExecutionContext.assignedTask,
563
+ minScore: Ue,
564
+ embeddingCache: n
565
+ }), r = s.map((c) => c.id), l = s.map(({ id: c, score: m }) => `${o.get(c)?.layerItem.name ?? c} (${m.toFixed(2)})`).join(`
566
+ `);
567
+ let i;
568
+ return r.length > 0 ? i = `Vector search completed. Matching layers with scores:
569
+ ${l}` : i = "Vector search completed. No matching layers found.", await d({ text: i }, t), {
570
+ ...e,
571
+ vectorSearchLayerIds: r
572
+ };
573
+ } catch (a) {
574
+ throw await d(
575
+ { text: `Error during vector search: ${a instanceof Error ? a.message : String(a)}` },
576
+ t
577
+ ), new Error(`Vector search failed: ${a instanceof Error ? a.message : String(a)}`);
578
+ }
579
+ }, Xe = (e, t) => L(["layerSearch", "fieldSearch", "layersAndFieldsRegistry"], "Data Exploration Agent")(
580
+ e,
581
+ t
582
+ ), Ye = () => new T(V).addNode("requireDataExplorationServices", Xe).addNode("vectorSearchLayers", Ke).addNode("vectorSearchFields", Je).addNode("fieldStatistics", Qe).addNode("queryAgent", je).addNode("queryTools", le).addNode("summarizeQueryResponseLLM", Oe).addNode("filterAgent", He).addNode("filterTools", We).addNode("earlyExit", Ve).addEdge(b, "requireDataExplorationServices").addEdge("requireDataExplorationServices", "vectorSearchLayers").addConditionalEdges(
583
+ "vectorSearchLayers",
584
+ (t) => t.vectorSearchLayerIds.length ? "vectorSearchFields" : "earlyExit"
585
+ ).addConditionalEdges(
586
+ "vectorSearchFields",
587
+ (t) => t.vectorSearchFieldResults.length ? "fieldStatistics" : "earlyExit"
588
+ ).addEdge("fieldStatistics", "queryAgent").addConditionalEdges("queryAgent", (t) => (t.dataExplorationMessages[t.dataExplorationMessages.length - 1]?.tool_calls?.length ?? 0) > 0 ? "queryTools" : "filterAgent").addConditionalEdges(
589
+ "queryTools",
590
+ (t) => t.queryResponse.length ? "summarizeQueryResponseLLM" : "filterAgent"
591
+ ).addEdge("summarizeQueryResponseLLM", "filterAgent").addConditionalEdges("filterAgent", (t) => (t.dataExplorationMessages[t.dataExplorationMessages.length - 1]?.tool_calls?.length ?? 0) > 0 ? "filterTools" : x).addEdge("filterTools", x).addEdge("earlyExit", x), et = String.raw`- **data exploration** — User is asking about the feature layer’s data (e.g. counts, summaries, statistics, field values), either for all features, a subset based on a condition, or for a subset based on the current view. And/Or user wants to include or exclude features based on field values, or visually style features differently (e.g., highlight or deemphasize them).
592
+ The Data Exploration Agent will automatically zoom to the affected features for action taken by this agent. In this case, no need to call navigation tool separately.
593
+ _Example: “Only show stations where Brand is Shell”_
594
+ _Example: “Make Shell stations stand out on the map”_
595
+ _Example: “Gray out all stations that aren’t Shell”_
596
+ This also includes questions that ask which feature meets a given condition or where a particular feature in the data is located (e.g., “Where is the spring with the highest elevation?”). However, this agent does not handle addresses.
597
+ _Example: “How many features are there?”_
598
+ _Example: “What’s the average population?”_
599
+ _Example: “Which values are in the status field?”_
600
+
601
+ This agent does NOT handle help/metadata requests such as listing available layers, listing field names/columns/attributes for a layer, or capability guidance.`, tt = {
602
+ id: "dataExplorationGraph",
603
+ name: "Data Exploration Graph Agent",
604
+ description: et,
605
+ createGraph: Ye,
606
+ workspace: V
607
+ }, O = [Te], at = (e) => {
608
+ if (!e || e.size === 0)
609
+ return "No layers available in this map.";
610
+ const t = Array.from(e.values()).map(({ layerItem: a, fieldRegistry: o }, n) => {
611
+ const s = Array.from(o.values()).map((l) => l.name).slice(0, 10).join(", "), r = o.size > 10 ? ` (and ${o.size - 10} more)` : "";
612
+ return `${n + 1}. "${a.title}". Description: ${a.description}
613
+ Fields: ${s}${r}`;
614
+ }).join(`
615
+
616
+ `);
617
+ return `This map contains ${e.size} layer(s):
618
+
619
+ ${t}`;
620
+ }, ot = (e) => {
621
+ const t = e?.list() ?? [];
622
+ return t.length ? t.map((a) => `- ${a.agent.name}: ${a.agent.description}`).join(`
623
+ `) : "No agents currently available.";
624
+ };
625
+ async function st(e, t) {
626
+ const a = await S("help_prompt"), o = u(t, "layersAndFieldsRegistry"), n = u(t, "agentRegistry");
627
+ try {
628
+ const s = await v({
629
+ promptText: a,
630
+ modelTier: "default",
631
+ config: t,
632
+ tools: O,
633
+ inputVariables: {
634
+ layerSummary: at(o),
635
+ agents: ot(n),
636
+ assignedTask: e.agentExecutionContext.assignedTask,
637
+ userRequest: e.agentExecutionContext.userRequest,
638
+ priorSteps: e.agentExecutionContext.priorSteps
639
+ }
640
+ });
641
+ await w(s, t);
642
+ const r = (s.tool_calls?.length ?? 0) > 0, l = typeof s.text == "string" ? s.text.trim() : "";
643
+ return {
644
+ ...e,
645
+ helpInternalState: {
646
+ ...e.helpInternalState,
647
+ toolCallMessage: r ? s : void 0
648
+ },
649
+ outputMessage: r ? e.outputMessage : l,
650
+ summary: r ? "Prepared help tool call from assigned task." : "Provided map-related help based on the assigned task.",
651
+ status: r ? e.status : "success"
652
+ };
653
+ } catch (s) {
654
+ const r = s instanceof Error ? s.message : String(s);
655
+ return {
656
+ ...e,
657
+ outputMessage: `Error invoking help agent: ${r}`,
658
+ summary: "Help agent execution failed.",
659
+ status: "failed"
660
+ };
661
+ }
662
+ }
663
+ const rt = (e, t) => L(["agentRegistry"], "Help Agent")(e, t);
664
+ async function nt(e, t) {
665
+ const a = new M(O, { handleToolErrors: !1 });
666
+ try {
667
+ const o = e.helpInternalState.toolCallMessage;
668
+ if (!o)
669
+ throw new Error("helpToolCalling: missing helpInternalState.toolCallMessage");
670
+ const s = (await a.invoke({ messages: [o] }, t)).messages.map((r) => r.text).join(`
671
+ `);
672
+ return await d({ text: `Finished executing help tool: ${s}` }, t), {
673
+ ...e,
674
+ outputMessage: s,
675
+ status: "success",
676
+ summary: s ? E(s) : "Help executed.",
677
+ helpInternalState: {
678
+ ...e.helpInternalState,
679
+ toolCallMessage: void 0
680
+ }
681
+ };
682
+ } catch (o) {
683
+ const n = o instanceof Error ? o.message : String(o);
684
+ return await d({ text: `Help tool execution failed: ${n}` }, t), {
685
+ ...e,
686
+ outputMessage: `Help tool execution failed: ${n}`,
687
+ status: "failed",
688
+ summary: `Help tool execution failed: ${n}`,
689
+ helpInternalState: {
690
+ ...e.helpInternalState,
691
+ toolCallMessage: void 0
692
+ }
693
+ };
694
+ }
695
+ }
696
+ const it = () => new T(H).addNode("requireHelpServices", rt).addNode("agent", st).addNode("tools", nt).addEdge(b, "requireHelpServices").addEdge("requireHelpServices", "agent").addConditionalEdges("agent", (t) => t.helpInternalState.toolCallMessage ? "tools" : x).addEdge("tools", x), lt = String.raw`- **help** — Enables users to ask questions about the map, layers, fields, and it's capabilities.
697
+
698
+ _Example: “Tell me about this map”_
699
+ _Example: “List all layers in this map”_
700
+ _Example: “List fields in protected areas layer”_
701
+ _Example: “What agents are available to me?”_
702
+ _Example: “What can you do?”_
703
+ _Example: “What can I ask”_
704
+
705
+ If the user asks unrelated queries like "What are the vowels in English alphabet" or "How to cook", call this agent so it can politely refuse and redirect to map-related questions.
706
+
707
+ IF the user asks map related queries, but those that are not performed by any of the agents, call this agent so we can respond that the requested action is not supported.
708
+ _Example: "Create a chart"_
709
+ _Example: "Create a table"_`, ct = {
710
+ id: "helpGraph",
711
+ name: "Help Graph Agent",
712
+ description: lt,
713
+ createGraph: it,
714
+ workspace: H
715
+ }, Ut = z, Kt = D, Xt = v, Yt = d, ea = q, ta = Re, aa = ne, oa = Pe, sa = Se, ra = ve, na = tt, ia = we, la = ct, ca = be, da = Me, ma = () => se(), pa = () => re(), ga = async (e, t) => await Q(e, t), ua = async ({
94
716
  modelTier: e = "default",
95
- temperature: t = 0,
96
- config: s
97
- } = {}) => await x({ modelTier: e, temperature: t, config: s });
717
+ config: t
718
+ } = {}) => await te({ modelTier: e, config: t });
98
719
  export {
99
- ce as ArcgisKnowledgeAgent,
100
- ne as DataExplorationAgent,
101
- ie as HelpAgent,
102
- re as LayerStylingAgent,
103
- oe as NavigationAgent,
104
- ue as Orchestrator,
105
- se as cosineSimilarity,
106
- le as createAgentRuntimeState,
107
- de as createAgentRuntimeStateWithSharedState,
108
- pe as createChatModel,
109
- me as createWebmapEmbeddings,
110
- ae as getEmbeddings,
111
- Z as invokeStructuredPrompt,
112
- Y as invokeTextPrompt,
113
- ee as invokeToolPrompt,
114
- te as sendTraceMessage,
115
- ge as sendUXSuggestion
720
+ ca as ArcgisKnowledgeAgent,
721
+ ra as DataExplorationAgent,
722
+ na as DataExplorationGraphAgent,
723
+ ia as HelpAgent,
724
+ la as HelpGraphAgent,
725
+ sa as LayerStylingAgent,
726
+ aa as NavigationAgent,
727
+ oa as NavigationGraphAgent,
728
+ fa as Orchestrator,
729
+ ta as cosineSimilarity,
730
+ ma as createAgentRuntimeState,
731
+ pa as createAgentRuntimeStateWithSharedState,
732
+ ua as createChatModel,
733
+ da as createWebmapEmbeddings,
734
+ ea as getEmbeddings,
735
+ Kt as invokeStructuredPrompt,
736
+ Ut as invokeTextPrompt,
737
+ Xt as invokeToolPrompt,
738
+ Yt as sendTraceMessage,
739
+ ga as sendUXSuggestion
116
740
  };