@arcgis/ai-components 5.2.0-next.1 → 5.2.0-next.100

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 (325) 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 +26 -24
  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 +121 -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 +60 -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 +157 -0
  60. package/dist/agents/tools/query/getTopFeatures/adapter.d.ts +8 -0
  61. package/dist/agents/tools/query/getTopFeatures/adapter.js +144 -0
  62. package/dist/agents/tools/query/queryFeatures/adapter.d.ts +8 -0
  63. package/dist/agents/tools/query/queryFeatures/adapter.js +130 -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/22KHSDJI.js +2 -0
  69. package/dist/cdn/2EY3BQQX.js +2 -0
  70. package/dist/cdn/2O4DON37.js +2 -0
  71. package/dist/cdn/34O57OGV.js +2 -0
  72. package/dist/cdn/{AMP6IALT.js → 3UEKINYC.js} +1 -1
  73. package/dist/cdn/434TAA3J.js +2 -0
  74. package/dist/cdn/4OGR5QKS.js +2 -0
  75. package/dist/cdn/5FL5BTTX.js +66 -0
  76. package/dist/cdn/5HBAJ57P.js +2 -0
  77. package/dist/cdn/5K5ZY267.js +2 -0
  78. package/dist/cdn/5MK44FNO.js +2 -0
  79. package/dist/cdn/5WYRJMBW.js +2 -0
  80. package/dist/cdn/5X7EG7D2.js +2 -0
  81. package/dist/cdn/5XZLS7UO.js +2 -0
  82. package/dist/cdn/5ZFUGNRN.js +2 -0
  83. package/dist/cdn/655YIKL3.js +11 -0
  84. package/dist/cdn/6ECRQVHY.js +2 -0
  85. package/dist/cdn/6OOZSZRJ.js +2 -0
  86. package/dist/cdn/{3PKJWIC3.js → 6P44KOKX.js} +1 -1
  87. package/dist/cdn/6YYPVU7H.js +3 -0
  88. package/dist/cdn/7BCQMK6D.js +2 -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/7VUSIGEM.js +2 -0
  93. package/dist/cdn/ACJTJLZN.js +2 -0
  94. package/dist/cdn/AI6DYOKR.js +181 -0
  95. package/dist/cdn/AKD5UOVX.js +2 -0
  96. package/dist/cdn/ANRQWYU2.js +2 -0
  97. package/dist/cdn/{ZS2TZ6BF.js → AOVJ34QE.js} +1 -1
  98. package/dist/cdn/APFZY4PI.js +2 -0
  99. package/dist/cdn/B2JDVLA6.js +2 -0
  100. package/dist/cdn/BE7BRJZD.js +2 -0
  101. package/dist/cdn/{FL4W4VYN.js → BL273EGZ.js} +17 -1
  102. package/dist/cdn/C4FEETBZ.js +2 -0
  103. package/dist/cdn/C4JT4S5E.js +2 -0
  104. package/dist/cdn/CCC6LBMY.js +2 -0
  105. package/dist/cdn/{5ZZGKP7N.js → CEKOEHB3.js} +1 -1
  106. package/dist/cdn/CJMUJXPL.js +2 -0
  107. package/dist/cdn/COH3QXWG.js +4 -0
  108. package/dist/cdn/CP5BVGJU.js +2 -0
  109. package/dist/cdn/D5UFYQHN.js +44 -0
  110. package/dist/cdn/EWLXNGKH.js +208 -0
  111. package/dist/cdn/EYOWRGDP.js +2 -0
  112. package/dist/cdn/F5NIRETW.js +2 -0
  113. package/dist/cdn/FDOMMK2M.js +2 -0
  114. package/dist/cdn/FG647IP6.js +2 -0
  115. package/dist/cdn/FJO4KNOZ.js +2 -0
  116. package/dist/cdn/FUF3NAU7.js +2 -0
  117. package/dist/cdn/FXP5UIQU.js +156 -0
  118. package/dist/cdn/{ZLXN7NMF.js → FYZATVB3.js} +10 -8
  119. package/dist/cdn/G2EGT3CF.js +6 -0
  120. package/dist/cdn/G3SF6U2U.js +2 -0
  121. package/dist/cdn/G7OMHU2B.js +2 -0
  122. package/dist/cdn/HAEFC2SJ.js +2 -0
  123. package/dist/cdn/HDACNIZF.js +2 -0
  124. package/dist/cdn/HHFNQR6Z.js +2 -0
  125. package/dist/cdn/HHUQXL3R.js +2 -0
  126. package/dist/cdn/IBZ2NEAO.js +2 -0
  127. package/dist/cdn/{FX7UOGHP.js → ICBIUFK7.js} +1 -1
  128. package/dist/cdn/ICQCK5D3.js +2 -0
  129. package/dist/cdn/IHP25JWI.js +99 -0
  130. package/dist/cdn/IJVMUS2L.js +14 -0
  131. package/dist/cdn/J6A4AS7E.js +22 -0
  132. package/dist/cdn/J6SZIQJA.js +2 -0
  133. package/dist/cdn/JCOA24UH.js +3 -0
  134. package/dist/cdn/{NE7E52YR.js → JEBRN3EU.js} +9 -3
  135. package/dist/cdn/JO5ETMPS.js +2 -0
  136. package/dist/cdn/K2R6XVK3.js +2 -0
  137. package/dist/cdn/KITIP6J2.js +2 -0
  138. package/dist/cdn/KWD2ECTM.js +2 -0
  139. package/dist/cdn/{4HU7735A.js → LAYVGCPL.js} +6 -4
  140. package/dist/cdn/{7RCQFLPP.js → LK7ZIQW6.js} +1 -1
  141. package/dist/cdn/LLUGJKAQ.js +2 -0
  142. package/dist/cdn/MWYBF3F3.js +66 -0
  143. package/dist/cdn/{V2P4AIGG.js → MXTXJKFE.js} +1 -1
  144. package/dist/cdn/MY47B3CE.js +3 -0
  145. package/dist/cdn/NEV6OZN3.js +71 -0
  146. package/dist/cdn/NNXISHCA.js +14 -0
  147. package/dist/cdn/NZSOJ726.js +2 -0
  148. package/dist/cdn/O4NVW75A.js +2 -0
  149. package/dist/cdn/OE3GW5LE.js +2 -0
  150. package/dist/cdn/{23EQTPO3.js → OKVLGJAG.js} +1 -1
  151. package/dist/cdn/ONQ6JSBJ.js +2 -0
  152. package/dist/cdn/OX64WOEL.js +22 -0
  153. package/dist/cdn/{LQ6R5YRN.js → PQ2DPOFM.js} +1 -1
  154. package/dist/cdn/PUHRBGKB.js +2 -0
  155. package/dist/cdn/Q57QWN5W.js +2 -0
  156. package/dist/cdn/QUKNPVAF.js +2 -0
  157. package/dist/cdn/R2PQVY4O.js +2 -0
  158. package/dist/cdn/R74ZHFA6.js +2 -0
  159. package/dist/cdn/RBE55SWR.js +2 -0
  160. package/dist/cdn/RHYNE5OE.js +2 -0
  161. package/dist/cdn/RLEHNAIA.js +2 -0
  162. package/dist/cdn/RVSTAUQS.js +2 -0
  163. package/dist/cdn/{X2ZDYHCG.js → SDWWUWAF.js} +10 -5
  164. package/dist/cdn/SXM4NUT5.js +2 -0
  165. package/dist/cdn/SZ2QSSB3.js +2 -0
  166. package/dist/cdn/T4RIGOXB.js +2 -0
  167. package/dist/cdn/TCH5I5LS.js +2 -0
  168. package/dist/cdn/TEPP7YPR.js +2 -0
  169. package/dist/cdn/TMVF2W5N.js +36 -0
  170. package/dist/cdn/TPULIO6I.js +34 -0
  171. package/dist/cdn/UDRKUVZP.js +2 -0
  172. package/dist/cdn/{6YMR4QSD.js → UHEYPSOR.js} +1 -1
  173. package/dist/cdn/UHNVDALX.js +18 -0
  174. package/dist/cdn/UZLQALHY.js +2 -0
  175. package/dist/cdn/V6HOUZPZ.js +2 -0
  176. package/dist/cdn/VAXH6RUQ.js +134 -0
  177. package/dist/cdn/VLLZ2FFU.js +2 -0
  178. package/dist/cdn/VOKXKU7M.js +56 -0
  179. package/dist/cdn/VXFQANGJ.js +2 -0
  180. package/dist/cdn/WGO5SER7.js +6 -0
  181. package/dist/cdn/WJXXOKGA.js +9 -0
  182. package/dist/cdn/WKTQVBFJ.js +2 -0
  183. package/dist/cdn/{DHOVCT6R.js → WSWB3B7B.js} +1 -1
  184. package/dist/cdn/XX6GHMNR.js +2 -0
  185. package/dist/cdn/Y7XD7ZRD.js +2 -0
  186. package/dist/cdn/YEZ3AMNX.js +2 -0
  187. package/dist/cdn/YLVJA4ZE.js +2 -0
  188. package/dist/cdn/Z5HWPSZN.js +2 -0
  189. package/dist/cdn/Z5W4V7RC.js +2 -0
  190. package/dist/cdn/ZDV4K4WG.js +2 -0
  191. package/dist/cdn/ZOEMBHRF.js +2 -0
  192. package/dist/cdn/ZRVZMPFN.js +2 -0
  193. package/dist/cdn/{ZTBA5PM7.js → ZU2FHVNK.js} +1 -1
  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/cdn/main.css +1 -1
  205. package/dist/chunks/adapter.js +1299 -2113
  206. package/dist/chunks/arcgisKnowledgeGraph.js +128 -72
  207. package/dist/chunks/arcgis_knowledge_current_lc_context.js +19 -2
  208. package/dist/chunks/arcgis_knowledge_current_map_context.js +31 -2
  209. package/dist/chunks/arcgis_knowledge_cypher_query_prompt.js +102 -0
  210. package/dist/chunks/arcgis_knowledge_summarize_result_prompt.js +116 -27
  211. package/dist/chunks/baseAgentState.js +58 -0
  212. package/dist/chunks/converterUtils.js +66 -41
  213. package/dist/chunks/dataExplorationGraph.js +135 -179
  214. package/dist/chunks/data_explore_query_prompt.js +9 -4
  215. package/dist/chunks/fetchAgentContext.js +13 -0
  216. package/dist/chunks/fetchService.js +10 -0
  217. package/dist/chunks/fieldStatistics.js +79 -0
  218. package/dist/chunks/formatFeatureAttributes.js +132 -0
  219. package/dist/chunks/generateLayerDescriptions.js +250 -246
  220. package/dist/chunks/helpGraph.js +35 -25
  221. package/dist/chunks/help_prompt.js +34 -17
  222. package/dist/chunks/index.js +11 -0
  223. package/dist/chunks/intent_prompt.js +16 -0
  224. package/dist/chunks/layerStylingGraph.js +37 -31
  225. package/dist/chunks/mergeWhereClauses.js +15 -0
  226. package/dist/chunks/navigationGraph.js +135 -111
  227. package/dist/chunks/navigation_intent_prompt.js +8 -2
  228. package/dist/chunks/orchestrator.js +530 -280
  229. package/dist/chunks/resolvePointGeometryFilter.js +92 -0
  230. package/dist/chunks/slottableRequestUtils.js +3 -7
  231. package/dist/chunks/state.js +21 -27
  232. package/dist/chunks/summarize_query_response_prompt.js +9 -7
  233. package/dist/chunks/toolCallResponse.js +14 -10
  234. package/dist/chunks/utils2.js +11 -11
  235. package/dist/components/arcgis-assistant/customElement.d.ts +96 -0
  236. package/dist/components/arcgis-assistant/customElement.js +398 -149
  237. package/dist/components/arcgis-assistant/index.js +2 -3
  238. package/dist/components/arcgis-assistant/types.d.ts +14 -1
  239. package/dist/components/arcgis-assistant-agent/customElement.d.ts +13 -1
  240. package/dist/components/arcgis-assistant-agent/customElement.js +614 -10
  241. package/dist/components/arcgis-assistant-chat/customElement.d.ts +8 -2
  242. package/dist/components/arcgis-assistant-chat/customElement.js +23 -18
  243. package/dist/components/arcgis-assistant-chat-entry/customElement.d.ts +4 -1
  244. package/dist/components/arcgis-assistant-chat-entry/customElement.js +25 -18
  245. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +20 -4
  246. package/dist/components/arcgis-assistant-help-agent/customElement.js +29 -7
  247. package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +8 -1
  248. package/dist/components/arcgis-assistant-interrupt/customElement.js +17 -14
  249. package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +24 -0
  250. package/dist/components/arcgis-assistant-interrupt-preview/index.js +2 -0
  251. package/dist/components/arcgis-assistant-knowledge-agent/customElement.d.ts +7 -7
  252. package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +40 -16
  253. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +30 -7
  254. package/dist/components/arcgis-assistant-message/customElement.d.ts +26 -0
  255. package/dist/components/arcgis-assistant-message/customElement.js +29 -26
  256. package/dist/components/arcgis-assistant-message/index.d.ts +1 -0
  257. package/dist/components/arcgis-assistant-message/index.js +2 -0
  258. package/dist/components/arcgis-assistant-message-block/customElement.d.ts +1 -1
  259. package/dist/components/arcgis-assistant-message-block/customElement.js +18 -11
  260. package/dist/components/arcgis-assistant-message-block/index.js +1 -0
  261. package/dist/components/arcgis-assistant-message-feedback/customElement.d.ts +4 -1
  262. package/dist/components/arcgis-assistant-message-footer/customElement.d.ts +4 -1
  263. package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +11 -1
  264. package/dist/components/arcgis-assistant-message-loading/customElement.js +8 -7
  265. package/dist/components/arcgis-assistant-message-loading/index.js +1 -0
  266. package/dist/components/arcgis-assistant-message-log/customElement.d.ts +4 -1
  267. package/dist/components/arcgis-assistant-message-read-aloud/customElement.d.ts +4 -1
  268. package/dist/components/arcgis-assistant-message-text/customElement.d.ts +5 -1
  269. package/dist/components/arcgis-assistant-message-text/customElement.js +12 -12
  270. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +18 -4
  271. package/dist/components/arcgis-assistant-speech-input/customElement.d.ts +6 -1
  272. package/dist/components/arcgis-assistant-speech-input/customElement.js +34 -52
  273. package/dist/components/arcgis-assistant-suggested-prompts/customElement.d.ts +4 -1
  274. package/dist/components/arcgis-assistant-suggested-prompts/customElement.js +8 -8
  275. package/dist/components/arcgis-assistant-user-message/customElement.d.ts +6 -1
  276. package/dist/components/arcgis-assistant-user-message/customElement.js +15 -10
  277. package/dist/docs/api.json +1 -1
  278. package/dist/docs/docs.json +1 -1
  279. package/dist/docs/vscode.html-custom-data.json +1 -1
  280. package/dist/docs/web-types.json +1 -1
  281. package/dist/index.d.ts +4 -0
  282. package/dist/loader.js +9 -8
  283. package/dist/oauth-callback.html +1 -1
  284. package/dist/orchestrator/orchestrator/orchestratorEvents.d.ts +78 -0
  285. package/dist/types/lumina.d.ts +14 -7
  286. package/dist/types/preact.d.ts +15 -7
  287. package/dist/types/react.d.ts +16 -7
  288. package/dist/types/stencil.d.ts +16 -9
  289. package/dist/utils/index.d.ts +135 -65
  290. package/dist/utils/index.js +55 -50
  291. package/package.json +32 -12
  292. package/dist/cdn/2AXF774U.js +0 -2
  293. package/dist/cdn/462JBSEV.js +0 -422
  294. package/dist/cdn/5QAHYX7Y.js +0 -5
  295. package/dist/cdn/7BCR6TUO.js +0 -2
  296. package/dist/cdn/7GH7VSB2.js +0 -2
  297. package/dist/cdn/7PLV4QH6.js +0 -2
  298. package/dist/cdn/AO7BQHKC.js +0 -2
  299. package/dist/cdn/AXDZBBNL.js +0 -45
  300. package/dist/cdn/DDLZOMUY.js +0 -2
  301. package/dist/cdn/F2AHA4GB.js +0 -54
  302. package/dist/cdn/FHVXO2WG.js +0 -166
  303. package/dist/cdn/FX5JFRDL.js +0 -2
  304. package/dist/cdn/GSEPHN3A.js +0 -106
  305. package/dist/cdn/H7422XUG.js +0 -2
  306. package/dist/cdn/HB5A5R2E.js +0 -2
  307. package/dist/cdn/JY6LLOUJ.js +0 -22
  308. package/dist/cdn/KMQ3SP4I.js +0 -5
  309. package/dist/cdn/MDVYQQUG.js +0 -14
  310. package/dist/cdn/MH5RPXHM.js +0 -2
  311. package/dist/cdn/NAUXSHIE.js +0 -72
  312. package/dist/cdn/NVI3I46B.js +0 -2
  313. package/dist/cdn/OAVEHGB6.js +0 -2
  314. package/dist/cdn/OH64RMOR.js +0 -4
  315. package/dist/cdn/ON2V5XI2.js +0 -3
  316. package/dist/cdn/P6OPJQMC.js +0 -3
  317. package/dist/cdn/QR54T33D.js +0 -2
  318. package/dist/cdn/RVOAPUBN.js +0 -2
  319. package/dist/cdn/S6W6HV4T.js +0 -36
  320. package/dist/cdn/SXDLXCIM.js +0 -2
  321. package/dist/cdn/USMDJUFS.js +0 -2
  322. package/dist/cdn/V5YEZSRY.js +0 -16
  323. package/dist/cdn/Y333DGV6.js +0 -2
  324. package/dist/cdn/YIMNOUTF.js +0 -2
  325. package/dist/cdn/YY2SBO3V.js +0 -2
@@ -0,0 +1,3 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import a from"./D5UFYQHN.js";import{b as E}from"./R74ZHFA6.js";import{a as p}from"./7VAQUCBU.js";import{Ya as M,a as I,b,ea as $,y as S}from"./EWLXNGKH.js";import{La as k,ea as C,qa as A}from"./AI6DYOKR.js";export default $arcgis.t(([N,P,T,G,z,{a:_,b:D,c:R,e:L,f:W,m:q}])=>{var B=async e=>{let t=await Q(),n=await _("default"),s=P.getDefault(),r=(await N.getCredential(`${s.url}/sharing`)).token,a={type:"generateEmbeddings",webmapEmbeddings:e,auth:{apiUrl:n,token:r}};return t.postMessage(a),await new Promise((i,o)=>{let d=u=>{u.data==="completed"&&(t.removeEventListener("message",d),i())},c=u=>{t.removeEventListener("message",d),o(u instanceof Error?u:new Error("Embeddings worker error"))};t.addEventListener("message",d),t.addEventListener("error",c,{once:!0})}),t},Q=async()=>{{let e=(await import("./OKVLGJAG.js")).default;return new e}},J=e=>{e.currentIntent="none"},K=async(e,t)=>{let n=R(t);if(e.agentExecutionContext.userRequest){let r=new A(e.agentExecutionContext.userRequest.trim());e.agentExecutionContext.messages=[...e.agentExecutionContext.messages,r],J(e)}let s=n?.services.agentRegistry.list().map(r=>r.agent.id)??[];return await p({text:`Available agents: ${[...s].join(", ")}`},t),await p({text:"Analyzing user input"},t),e},V=async(e,t)=>(await p({text:"Exiting..."},t),e),F=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),X=(e,t)=>{if(!F(e)){e!==void 0&&console.warn(`Agent "${t}" returned invalid sharedStatePatch. Ignoring it.`);return}let n={};for(let[s,r]of Object.entries(e)){if(!F(r)||!("value"in r)){console.warn(`Agent "${t}" returned invalid sharedStatePatch entry for key "${s}". Ignoring that entry.`);continue}n[s]={value:r.value}}return n},Y=e=>{let{previousSharedState:t,patch:n,agentId:s}=e;if(!n)return t;let r=Date.now(),a={...t};for(let[i,o]of Object.entries(n))o?.value!==void 0&&(a[i]={value:o.value,meta:{updatedByAgentId:s,updatedAt:r}});return a},Z=256,ee=new Set(["point","polyline","polygon","extent","custom"]),te=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),re=(e,t)=>{if(e===void 0)return;if(!Array.isArray(e)){console.warn(`Agent "${t}" returned invalid sharedResourceAdditions. Ignoring it.`);return}let n=[];for(let[s,r]of e.entries()){if(!te(r)||typeof r.kind!="string"||!ee.has(r.kind)||typeof r.description!="string"||!r.description.trim()||!("payload"in r)||r.payload===void 0){console.warn(`Agent "${t}" returned invalid sharedResourceAdditions entry at index ${s}. Ignoring that entry.`);continue}let a;try{a=structuredClone(r.payload)}catch{console.warn(`Agent "${t}" returned invalid sharedResourceAdditions entry at index ${s}. Ignoring that entry.`);continue}n.push({kind:r.kind,description:r.description.trim().slice(0,Z),payload:a})}return n.length?n:void 0},ne=e=>{let{previousSharedResources:t,additions:n,agentId:s}=e;if(!n?.length)return t;let r=Date.now(),a=n.map(i=>({...i,id:E(),meta:{createdByAgentId:s,createdAt:r}}));return[...t,...a].slice(-50)},j=e=>typeof e!="string"?void 0:e.trim()||void 0,se=e=>{switch(e){case"failed":return"Agent failed without a summary.";case"unknown":return"Agent returned with unknown status.";case"success":return"Agent completed without a summary.";default:return"Agent completed without a summary."}},ae=(e,t)=>{let n=j(t?.outputMessage),s=j(t?.summary),r=t?.status,a=r==="success"||r==="failed"?r:"unknown";a==="unknown"&&console.warn(`Agent "${e}" returned missing/invalid status. Defaulting to "unknown".`);let i=X(t?.sharedStatePatch,e),o=re(t?.sharedResourceAdditions,e);return{outputMessage:n,summary:s??n??se(a),status:a,sharedStatePatch:i,sharedResourceAdditions:o}},H=4e3,ie=async(e,t)=>{let n=R(t);if(t?.signal?.aborted)return await p({text:"Run cancelled; skipping agent execution"},t),{...e,currentIntent:"none",requiresFollowUp:!1};let{agentRegistry:s}=n?.services??{},r=s?.get(e.currentIntent);if(!r)return console.warn(`No agent found for intent: ${e.currentIntent}`),e;await p({text:`Executing registered agent: ${r.agent.name}`},t);let a={...t??{},metadata:{...t?.metadata,agentId:r.agent.id},configurable:{...n??{},agentId:r.agent.id,context:r.getContext?await r.getContext():void 0}},i;try{let c=await r.agent.createGraph().compile().invoke({agentExecutionContext:{...e.agentExecutionContext,messages:[...e.agentExecutionContext.messages],priorSteps:structuredClone(e.agentExecutionContext.priorSteps??[]),sharedState:structuredClone(e.agentExecutionContext.sharedState??{}),sharedResources:structuredClone(e.agentExecutionContext.sharedResources??[])}},a);i=ae(r.agent.name,c),await p({text:`Finished executing registered agent: ${r.agent.name}`},t)}catch(c){if(S(c)||t?.signal?.aborted||c instanceof Error&&c.name==="AbortError")throw c;let u=c instanceof Error?c.message:String(c);console.error(`Agent "${r.agent.name}" failed:`,c),await p({text:`Registered agent failed: ${r.agent.name}. ${u}`},t),i={status:"failed",outputMessage:`Agent execution failed: ${u}`,summary:`Agent execution failed: ${u}`}}let o=i.outputMessage,d=[...e.agentExecutionContext.messages];if(o){let c=o.length>H?`${o.slice(0,H-14)}
3
+ [truncated]`:o;d.push(new C(c))}return{...e,stepCount:e.stepCount+1,lastExecutedAgent:r.agent.id,requiresFollowUp:i.status==="failed"?!0:e.requiresFollowUp,finalOutputMessage:o??"",agentExecutionContext:{...e.agentExecutionContext,messages:d,priorSteps:[...e.agentExecutionContext.priorSteps??[],{agentId:r.agent.id,assignedTask:e.agentExecutionContext.assignedTask,summary:i?.summary||"No summary provided.",status:i?.status||"unknown"}],sharedState:Y({previousSharedState:e.agentExecutionContext.sharedState,patch:i.sharedStatePatch,agentId:r.agent.id}),sharedResources:ne({previousSharedResources:e.agentExecutionContext.sharedResources,additions:i.sharedResourceAdditions,agentId:r.agent.id})}}},oe=async(e,t)=>{if(e.routing.mode!=="direct")throw new Error("Direct agent assignment requires direct routing.");return await p({text:`Doing a direct route to agent: ${e.routing.agentId}`},t),{...e,currentIntent:e.routing.agentId,requiresFollowUp:!1,agentExecutionContext:{...e.agentExecutionContext,assignedTask:e.agentExecutionContext.userRequest}}},de=3,ce=e=>e.routing.mode==="direct"?"assignDirectAgent":"intentLLM",ue=e=>e.routing.mode==="direct"||e.stepCount>=de||!e.requiresFollowUp?"exit":"intentLLM",ge=()=>new M(D).addNode("ingestInput",K).addNode("assignDirectAgent",oe).addNode("intentLLM",W).addNode("executeRegisteredAgent",ie).addNode("exit",V).addEdge(I,"ingestInput").addConditionalEdges("ingestInput",ce).addEdge("assignDirectAgent","executeRegisteredAgent").addConditionalEdges("intentLLM",e=>e.currentIntent==="none"||e.currentIntent===e.lastExecutedAgent?"exit":"executeRegisteredAgent").addConditionalEdges("executeRegisteredAgent",ue).addEdge("exit",b),le=(e,t)=>{let n=e.output?.usage_metadata??t.usage_metadata,s=e.output?.llmOutput?.tokenUsage,r=n?.input_tokens??s?.promptTokens,a=n?.output_tokens??s?.completionTokens,i=n?.total_tokens??s?.totalTokens;if(r===void 0||a===void 0||i===void 0)return;let o=n?.input_token_details?.cache_read,d=n?.output_token_details?.reasoning;return{input:r,output:a,total:i,...o!==void 0&&{cacheRead:o},...d!==void 0&&{reasoning:d}}},he=(e,t,n,s)=>{switch(e){case"chat_model":case"llm":return"model";case"tool":case"retriever":return e;case"chain":return!s||t==="LangGraph"?"workflow":n===t?"node":"chain";default:return}},pe=e=>{if(e instanceof Error)return{message:e.message,name:e.name};let t=e,n=typeof t?.message=="string"?t.message:String(e??"Unknown runtime error"),s=typeof t?.name=="string"?t.name:void 0;return{message:n,...s&&{name:s}}},me=({event:e,runId:t,parentSpanId:n,timestamp:s})=>{let r=/^on_(.+)_(start|end|error)$/u.exec(e.event);if(!r)return;let[,a,i]=r,o=e.metadata??{},d=o.langgraph_node,c=he(a,e.name,d,n);if(!c)return;let u=o.agentId,m=o.model??o.ls_model_name,l=e.data,g=i==="end"&&c==="model"?le(l,o):void 0,y=e.tags?.includes("langsmith:hidden")||d==="__start__",h={...m&&{model:m},...g&&{tokenUsage:g},...y&&{internal:!0}},w={id:e.run_id,...n&&{parentId:n},label:e.name,type:c,...Object.keys(h).length&&{metadata:h}},v={runId:t,timestamp:s,type:"runtime",...u&&{agentId:u}};switch(i){case"start":return{...v,phase:"started",span:{...w,...l?.input!==void 0&&{input:l.input}}};case"end":return{...v,phase:"completed",span:{...w,...l?.output!==void 0&&{output:l.output}}};case"error":return{...v,phase:"failed",span:{...w,error:pe(l?.error)}};default:return}},f=class{constructor(){this.agentRegistry=new Map}register(t){let{agent:n}=t;if(this.agentRegistry.has(n.id))throw new Error(`Duplicate agent id: ${n.id}`);this.agentRegistry.set(n.id,t)}get(t){return this.agentRegistry.get(t)}list(){return[...this.agentRegistry.values()]}},x=class{constructor(t,n){this.graph=t,this.config={...n}}async waitForUser(){return await new Promise((t,n)=>{this.resolveWait=t,this.rejectWait=n})}handle(t,n){try{let s={agentId:t.agentId,id:t.id,payload:n},r=this.graph.streamEvents(null,{...this.config,configurable:{...this.config.configurable,hitlResponse:s},subgraphs:!0,version:"v2"});this.resolveWait?.(r)}catch(s){this.rejectWait?.(s)}finally{this.resolveWait=void 0,this.rejectWait=void 0}}cancel(){this.rejectWait&&(this.rejectWait(new Error("Request cancelled by user.")),this.resolveWait=void 0,this.rejectWait=void 0)}},ye=async e=>{try{return await(await L()).embedDocuments(e)}catch(t){throw console.error("Failed to generate embeddings:",t),t}},U=async(e,t)=>{let n=t.get(e);if(n)return n;let s=await ye([e]);return t.set(e,s[0]),s[0]};async function we(e,t,n,s){let r=`req-${Date.now()}`,a={type:"layerSearch",precomputedEmbedding:s?await U(e,s):void 0,requestId:r,minScore:n};return await new Promise(i=>{let o=d=>{d.data.requestId===r&&i(d.data.results)};t.addEventListener("message",o,{once:!0}),t.postMessage(a)})}function fe(e){let{worker:t}=e;return{async searchLayers({text:n,minScore:s,embeddingCache:r}){return await we(n,t,s,r)}}}var ve=async({combinedQuery:e,layerIds:t,embeddingsWorker:n,minScore:s,topResults:r,embeddingCache:a})=>{let i=`req-${Date.now()}`,o=a?await U(e,a):void 0,d={type:"fieldSearch",layerIdForFieldsSearch:t,precomputedEmbedding:o,requestId:i,minScore:s,topResults:r};return await new Promise(c=>{let u=m=>{if(m.data.requestId!==i)return;let l=m.data.results.map(({layerId:g,results:y})=>({layerId:g,results:y}));c(l)};n.addEventListener("message",u,{once:!0}),n.postMessage(d)})};function Ee(e){let{worker:t}=e;return{async searchFields({text:n,layerIds:s,minScore:r,topResults:a,embeddingCache:i}){return await ve({combinedQuery:n,layerIds:s,embeddingsWorker:t,minScore:r,topResults:a,embeddingCache:i})}}}var Re=e=>{let t=q.safeParse(e);if(!t.success)throw new Error("Embeddings response validation failed. Regenerate embeddings.");return t.data},xe=(e,t)=>{let n=new Map,s=new Map;if(t.allLayers.forEach(r=>{r instanceof G&&s.set(r.id,r)}),e.length!==s.size)throw new Error("Layer count mismatch during registry restoration. Regenerate embeddings.");for(let r of e){let a=s.get(r.id);if(!a)throw new Error(`Layer with ID ${r.id} not found in the original map during registry restoration. Regenerate embeddings.`);if(r.fields.length!==a.fields.length)throw new Error(`Field count mismatch for layer ID ${r.id} during registry restoration. Regenerate embeddings.`);let i={name:r.name,title:r.title,description:r.description},o=new Map;for(let d of r.fields){let c=a.fieldsIndex.get(d.name);if(!c)throw new Error(`Field with name ${d.name} not found in the original layer ${r.id} during registry restoration. Regenerate embeddings.`);o.set(d.name,{name:d.name,alias:a.getFieldAlias(d.name)??d.alias,description:d.description,type:c.type||"unknown",valueType:c.valueType||"unknown",domain:a.getFieldDomain(d.name)??void 0})}n.set(r.id,{layerItem:i,fieldRegistry:o})}return n},Ie=async e=>{try{return(await z(e,{responseType:"json"})).data}catch(t){throw new Error(`Failed to fetch data from ${e}: ${String(t)}`)}},be=async e=>{let t=e.map;if(!t?.portalItem)throw new Error("WebMap portal item is missing.");let{resources:n}=await t.portalItem.fetchResources(),s=n.find(a=>a.resource.path==="embeddings-v01.json");if(!s?.resource.url)throw new Error("Embeddings resource 'embeddings-v01.json' not found in the webmap portal item.");let r=await Ie(s.resource.url);return Re(r)},O=class e{constructor(){this.orchestratorReady=!1,this.chatHistory=[],this.priorSteps=[],this.sharedState={},this.sharedResources=[],this.agentRegistry=new f,this.activeRunId="",this.cancelledRunIds=new Set,this.parentRunIds=new Map,this.activeRuntimeSpans=new Map,this.runtimeEventsEnabled=!1,this.streamEpoch=0}static async init(t){let n=new e;n.runtimeEventsEnabled=t.runtimeEventsEnabled??!1;try{if(t.view?.map){await T.whenOnce(()=>t.view.ready);let s=await be(t.view),r=xe(s.layers,t.view.map);n.layersAndFieldsRegistry=r,n.embeddingsWorker=await B(s)}return t.agents?.forEach(s=>{n.agentRegistry.register(s)}),n.orchestratorReady=!0,n}catch(s){throw console.error("Orchestrator initialization failed:",s),s}}async*ask(t,n={}){if(!this.orchestratorReady)throw new Error("Orchestrator is not ready yet.");if(!this.agentRegistry.list().length)throw new Error("Orchestrator has no registered agents.");let s=this.createRequestAgentRegistry(n);if(!s.list().length)throw new Error("Orchestrator has no agents selected for this request.");if(++this.streamEpoch,!t.trim())return;let r=E();this.parentRunIds.clear(),this.activeRuntimeSpans.clear(),this.activeRunId=r,this.activeAbortController=new AbortController,this.graph||(this.graph=ge().compile({checkpointer:new $}));let a=this.embeddingsWorker?fe({worker:this.embeddingsWorker}):void 0,i=this.embeddingsWorker?Ee({worker:this.embeddingsWorker}):void 0,o=new Map,d=n.routing==="direct"?{mode:"direct",agentId:n.agentId}:{mode:"auto"},c={thread_id:r,hitlResponse:null,services:{layerSearch:a,fieldSearch:i,layersAndFieldsRegistry:this.layersAndFieldsRegistry,agentRegistry:s,embeddingCache:o}},u={version:"v2",streamMode:"custom",signal:this.activeAbortController.signal,...this.runtimeEventsEnabled&&{callbacks:[this.createHierarchyCallback()]},configurable:c,subgraphs:!0},m=this.graph?.streamEvents({routing:d,agentExecutionContext:{userRequest:t,messages:this.chatHistory,priorSteps:this.priorSteps,sharedState:this.sharedState,sharedResources:this.sharedResources}},u),l=++this.streamEpoch;if(yield*this.pipeStream(m,l,r),this.isRunCancelled(r)){yield*this.createCancellationEvents(r);return}for(;;){if(this.isRunCancelled(r)){yield*this.createCancellationEvents(r);return}let y=(await this.graph.getState(u,{subgraphs:!0})).tasks.find(h=>h.interrupts.length>0)?.interrupts[0]?.value;if(!y)break;this.currentInterrupt=y,this.interruptHandler=new x(this.graph,u),yield*this.closeActiveRuntimeSpans(r,"interrupted"),yield{runId:r,timestamp:Date.now(),type:"interrupt",interrupt:y};try{let h=await this.interruptHandler.waitForUser(),w=++this.streamEpoch;yield*this.pipeStream(h,w,r)}catch(h){if(this.isRunCancelled(r)){yield*this.createCancellationEvents(r);return}if(h){yield{runId:r,timestamp:Date.now(),type:"error",error:{message:h?.message}};return}}}if(this.isRunCancelled(r)){yield*this.createCancellationEvents(r);return}let g=(await this.graph.getState(u,{subgraphs:!0})).values;if(this.isRunCancelled(r)){yield*this.createCancellationEvents(r);return}this.chatHistory=g.agentExecutionContext.messages.length?g.agentExecutionContext.messages:this.chatHistory,this.priorSteps=g.agentExecutionContext.priorSteps?.slice(-5)??[],this.sharedState=g.agentExecutionContext.sharedState??{},this.sharedResources=g.agentExecutionContext.sharedResources??[],yield{runId:r,timestamp:Date.now(),type:"completed",result:{content:g.finalOutputMessage}}}newConversation(){this.chatHistory=[],this.priorSteps=[],this.sharedState={},this.sharedResources=[]}resumeInterrupt(t){if(!this.currentInterrupt||!this.interruptHandler)throw new Error("No pending interrupt to resume.");this.interruptHandler.handle(this.currentInterrupt,t)}cancelInterrupt(){this.interruptHandler&&this.interruptHandler.cancel()}cancel(){this.activeRunId&&(this.cancelledRunIds.add(this.activeRunId),this.activeAbortController?.abort(),++this.streamEpoch,this.interruptHandler?.cancel())}async*pipeStream(t,n,s){try{for await(let r of t){if(this.isRunCancelled(s)||n!==this.streamEpoch)break;if(this.runtimeEventsEnabled){let a=me({event:r,runId:s,parentSpanId:this.parentRunIds.get(r.run_id),timestamp:Date.now()});a&&(a.phase==="started"?this.activeRuntimeSpans.set(a.span.id,a):this.activeRuntimeSpans.delete(a.span.id),yield a)}r.event==="on_custom_event"&&r.name==="trace_message"?yield{runId:s,timestamp:Date.now(),type:"trace",data:r.data}:r.name==="graph_ux_suggestion"&&(yield{runId:s,timestamp:Date.now(),type:"ux-suggestion",suggestion:r.data})}}catch(r){if(!this.isRunCancelled(s))throw r}}*createCancellationEvents(t){yield*this.closeActiveRuntimeSpans(t,"cancelled"),yield{runId:t,timestamp:Date.now(),type:"cancelled",reason:"user"}}*closeActiveRuntimeSpans(t,n){let s=Date.now(),r=[...this.activeRuntimeSpans.values()].reverse();this.activeRuntimeSpans.clear();for(let a of r){let{input:i,...o}=a.span;yield{type:"runtime",phase:n,runId:t,timestamp:s,...a.agentId&&{agentId:a.agentId},span:o}}}createHierarchyCallback(){let t=(n,s)=>{s&&this.parentRunIds.set(n,s)};return k.fromMethods({handleLLMStart:(n,s,r,a)=>t(r,a),handleChatModelStart:(n,s,r,a)=>t(r,a),handleChainStart:(n,s,r,a)=>t(r,a),handleToolStart:(n,s,r,a)=>t(r,a),handleRetrieverStart:(n,s,r,a)=>t(r,a)})}isRunCancelled(t){return this.cancelledRunIds.has(t)}createRequestAgentRegistry(t){let n=t.routing==="direct"?[t.agentId]:t.agentIds,s=n?n.map(a=>{let i=this.agentRegistry.get(a);if(!i)throw new Error(`Agent is not registered: ${a}`);return i}):this.agentRegistry.list(),r=new f;return s.forEach(a=>r.register(a)),r}dispose(){this.sharedResources=[],this.embeddingsWorker&&(this.embeddingsWorker.terminate(),this.embeddingsWorker=void 0),this.orchestratorReady=!1}};return{a:ye,b:O}},"identity/IdentityManager","portal/Portal","core/reactiveUtils","layers/FeatureLayer","request",a)
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"./YIMNOUTF.js";var e=`## Navigation Agent - Tool Intent Classifier
2
+ import"./UZLQALHY.js";var e=`## Navigation Agent - Tool Intent Classifier
3
3
 
4
4
  You are an assistant that classifies the assigned task intent for navigation agent.
5
5
 
@@ -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 \u2192 prefer \`goToLayer\`.
45
+ - "zoom/go to [features] where/with ..." (has a condition/filter) \u2192 prefer \`goToFeatures\`.
46
+ - Explicit numeric zoom/scale/viewpoint requests \u2192 prefer the matching zoom/scale/viewpoint tool.
41
47
 
42
48
  Return the name of the tool as a string.
43
49
  `;export{e as default};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a}from"./LLUGJKAQ.js";import"./ONQ6JSBJ.js";import"./AI6DYOKR.js";import"./VXFQANGJ.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export{a as goToHomeExtentTool};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as c}from"./ONQ6JSBJ.js";import{Dc as a}from"./AI6DYOKR.js";import{a as t}from"./VXFQANGJ.js";async function i(o,e){return await e.goTo({scale:o}),{text:`Successfully zoomed to: ${o}`}}async function r({scale:o},e){let{mapView:s}=c(e,["mapView"]);return await i(o,s)}var m=t.object({scale:t.number().describe("The map scale of the view to go to.")}),p=a(r,{name:"goToScale",description:"Go to the specified view scale.",schema:m});export{p as a};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as c}from"./ONQ6JSBJ.js";import{Dc as n}from"./AI6DYOKR.js";import{a as e}from"./VXFQANGJ.js";export default $arcgis.t(([m])=>{async function r(t,a,o){let i={target:new m({longitude:t.longitude,latitude:t.latitude,spatialReference:{wkid:4326}})};return o?.zoom!==void 0&&(i.zoom=o.zoom),o?.scale!==void 0&&(i.scale=o.scale),await a.goTo(i),{text:`Successfully navigated to: ${[`(${t.latitude}\xB0, ${t.longitude}\xB0)`,o?.zoom!==void 0?`zoom ${o.zoom}`:"",o?.scale!==void 0?`scale 1:${o.scale}`:""].filter(Boolean).join(", ")}`}}async function s({center:t,zoom:a,scale:o},i){let{mapView:l}=c(i,["mapView"]);return await r(t,l,{zoom:a,scale:o})}var d=e.object({center:e.object({longitude:e.number().describe("The longitude (x-coordinate) of the point to navigate to."),latitude:e.number().describe("The latitude (y-coordinate) of the point to navigate to.")}),zoom:e.number().optional().describe("The zoom level. Higher values = more zoomed in."),scale:e.number().optional().describe("The map scale. Alternative to zoom. Smaller numbers = more zoomed in.")}),g=n(s,{name:"goToViewpoint",description:"Go to the specified viewpoint. This can contain a combination of scale, center, zoom, etc.",schema:d});return g},"geometry/Point")
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import a from"./CCC6LBMY.js";import{a as m}from"./ONQ6JSBJ.js";import{Dc as f}from"./AI6DYOKR.js";import{a as o}from"./VXFQANGJ.js";export default $arcgis.t(([{b:c,c:h}])=>{var g=(a,e,i)=>{let t=a.createQuery();return t.outFields=[e],t.where=i||"1=1",t.num=1,t},w=async(a,e,i,t)=>{let r=t.map?.allLayers.find(y=>y.id===a),n=g(r,e,i.where),s=(await r.queryFeatures(n)).features[0],d=s?s.attributes[e]:null,u=c(r,e,d,t.timeZone),l=h(r,e);return{tool:"getAttribute",layerName:r.title??a,summary:`${l} = ${u}`,details:{fieldName:e,fieldAlias:l!==e?l:void 0,value:u,where:i.where}}};async function b({layerId:a,fieldName:e,query:i},t){let{mapView:r}=m(t,["mapView"]),n=await w(a,e,i,r);return JSON.stringify(n,null,2)}var p=o.object({layerId:o.string().describe("The layerId of the layer containing the field from which to get a value."),fieldName:o.string().describe("The name of the field/attribute from which to get a field value."),query:o.object({where:o.string().describe("The SQL-92 where clause representing the feature from which to get an attribute value.")})}),q=f(b,{name:"getAttribute",description:"Returns an attribute value for a given feature.",schema:p});return q},a)
@@ -1,7 +1,9 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import c from"./FHVXO2WG.js";import a from"./GSEPHN3A.js";import{Fb as k,Q as x,a as y,b as l}from"./462JBSEV.js";import{c as b,d as A}from"./HB5A5R2E.js";import"./AMP6IALT.js";import"./OAVEHGB6.js";import{v as w,y as f}from"./OH64RMOR.js";import"./YIMNOUTF.js";export default $arcgis.t(([,,,,,,,,,,,,,{fetchKnowledgeGraph:J},{f:c,k:v,m:_},{K:u,L:K,M:S,N:M,O:G,P:T,Q:C,R:N,S:R,T:z,U:F,a:q,m:g,n:d,p:E}])=>{var L=[T,C,z,N,G,F,R];async function I(e,a){let i=await g("arcgis_knowledge_tool_prompt"),s=K(a),n={assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps,contextType:s},r=await _({promptText:i,messages:e.arcgisKnowledgeMessages,inputVariables:n,tools:L}),t=(r.tool_calls?.length??0)>0,o=typeof r.text=="string"?r.text.trim():"",h=o.length>0,p=r.content.toString();return!t&&(s==="map"||s==="knowledgeGraph")?{...e,arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,r],outputMessage:s==="map"?"No tools were found for the current view and prompt. Maps do not support changing nonspatial visibility, layout changes, or generation from queries.":"No tools were found for the current prompt and knowledge graph service. A knowledge graph service only supports search and query.",status:"success"}:{...e,arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,r],outputMessage:t?p:o,status:t?e.status:h?"success":"failed",summary:p?d(p):"ArcGIS Knowledge Agent tool executed."}}async function U(e,a){let i=new q(L);try{let s=await i.invoke({messages:e.arcgisKnowledgeMessages},a),n=[];for(let t of s.messages){let o;if(typeof t.content!="string")throw new Error(`Unexpected tool message content type: ${typeof t.content}. Expected string.`);try{o=JSON.parse(t.content)}catch{throw new Error(`Failed to parse tool message content as JSON. Tool: ${t.name??"unknown"}`)}if(!o||typeof o!="object"||!("toolName"in o))throw new Error(`Parsed tool message content does not have expected structure. Parsed content: ${JSON.stringify(o)}`);n.push(o)}await c({text:`Finished executing ArcGIS Knowledge Agent tools: ${s.messages.filter(t=>t.name).map(t=>t.name).join(", ")}`},a);let r=n.filter(t=>typeof t!="string").map(t=>`- Called Tool: ${t.toolName}, Status: ${t.status}`);return{...e,outputMessage:r.join(`
3
- `),summary:r.length?d(r.join(`
4
- `)):"ArcGIS Knowledge Agent did not execute any tools or return any results.",arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,...s.messages],arcgisKnowledgeToolResult:n}}catch(s){let n=s instanceof Error?s.message:String(s);return await c({text:`ArcGIS Knowledge Agent tool execution failed: ${n}`},a),{...e,outputMessage:`ArcGIS Knowledge Agent tool execution failed: ${n}`,status:"failed",summary:`ArcGIS Knowledge Agent tool execution failed: ${n}`,arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages]}}}var D=(e,a)=>E([],"ArcgisKnowledge Agent")(e,a);async function j(e,a){let i=(e.arcgisKnowledgeToolResult??[]).map(h=>({...h,details:void 0})),{knowledgeGraph:s}=await S(a),n=M.getDataModelTypesSummary(s.dataModel),r={assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,toolResult:i,dataModelSummary:n},t=await v({promptText:await g("arcgis_knowledge_summarize_result_prompt"),modelTier:"default",inputVariables:r}),o=typeof t=="string"?t:t.content;return{...e,outputMessage:o,status:"success",summary:d(o),arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,new x(o)]}}var O=()=>new k(u).addNode("requireArcgisKnowledgeServices",D).addNode("agent",I).addNode("tools",U).addNode("summarizationLLM",j).addEdge(y,"requireArcgisKnowledgeServices").addEdge("requireArcgisKnowledgeServices","agent").addConditionalEdges("agent",e=>(e.arcgisKnowledgeMessages[e.arcgisKnowledgeMessages.length-1]?.tool_calls?.length??0)>0?"tools":l).addConditionalEdges("tools",e=>e.status==="failed"?l:"summarizationLLM").addEdge("summarizationLLM",l),V=String.raw`The purpose of this agent is to work with Knowledge Graph data, a graph database technology that represents and stores data as interconnected entities (nodes) and relationships (edges).
2
+ import b from"./FXP5UIQU.js";import a from"./D5UFYQHN.js";import{a as c,b as k}from"./7VAQUCBU.js";import{Ya as x,a as w,b as d,j as f}from"./EWLXNGKH.js";import{ea as u}from"./AI6DYOKR.js";export default $arcgis.t(([,,,,,,{n:_,p:b},{A:M,B:T,C:E,D:C,E:G,F:N,G:R,a:v,c:m,d:h,e:A,w:y,x:K,y:q,z:S}])=>{var z=[T,E,N,C,M,R,G];async function $(e,a){let s=await m("arcgis_knowledge_tool_prompt"),o=K(a),n={assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps,contextType:o},r=await b({promptText:s,messages:e.arcgisKnowledgeMessages,inputVariables:n,tools:z,config:a}),i=(r.tool_calls?.length??0)>0,t=typeof r.text=="string"?r.text.trim():"",l=t.length>0,p=r.content.toString();return!i&&(o==="map"||o==="knowledgeGraph")?{...e,arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,r],outputMessage:o==="map"?"No tools were found for the current view and prompt. Maps do not support changing nonspatial visibility, layout changes, or generation from queries.":"No tools were found for the current prompt and knowledge graph service. A knowledge graph service only supports search and query.",status:"success"}:{...e,arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,r],outputMessage:i?p:t,status:i?e.status:l?"success":"failed",summary:p?h(p):"ArcGIS Knowledge Agent tool executed."}}var L={generateCypher:"generated-cypher-query",queryGraphData:"graph-query-result",searchGraphData:"graph-search-result",addRecords:"added-records",applyLayout:"applied-layout",changeNonspatialVisibility:"changed-nonspatial-visibility",createLinkChart:"created-link-chart"};function I(e){return!!e&&e.status==="success"&&!!L[e.toolName]}function D(e){return{type:L[e.toolName],data:e.details}}async function F(e,a){let s=new v(z,{handleToolErrors:!1});try{let o=await s.invoke({messages:e.arcgisKnowledgeMessages},a),n=[];for(let t of o.messages){let l;if(typeof t.content!="string")throw new Error(`Unexpected tool message content type: ${typeof t.content}. Expected string.`);try{l=JSON.parse(t.content)}catch{throw new Error(`Failed to parse tool message content as JSON. Tool: ${t.name??"unknown"}.
3
+
4
+ Original Content: ${t.content}`)}if(!l||typeof l!="object"||!("toolName"in l))throw new Error(`Parsed tool message content does not have expected structure. Parsed content: ${JSON.stringify(l)}`);n.push(l)}await c({text:`Finished executing ArcGIS Knowledge Agent tools: ${o.messages.filter(t=>t.name).map(t=>t.name).join(", ")}`},a);let r=n.filter(t=>typeof t!="string").map(t=>`- Called Tool: ${t.toolName}, Status: ${t.status}`),i=n[0];return i&&I(i)&&await k(D(i),a),{...e,outputMessage:r.join(`
5
+ `),summary:r.length?h(r.join(`
6
+ `)):"ArcGIS Knowledge Agent did not execute any tools or return any results.",arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,...o.messages],arcgisKnowledgeToolResult:n}}catch(o){let n=o instanceof Error?o.message:String(o);return await c({text:`ArcGIS Knowledge Agent tool execution failed unexpectedly: ${n}`},a),{...e,outputMessage:`ArcGIS Knowledge Agent tool execution failed unexpectedly: ${n}`,status:"failed",summary:h(`ArcGIS Knowledge Agent tool execution failed unexpectedly: ${n}`),arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages]}}}var V=(e,a)=>A([],"ArcgisKnowledge Agent")(e,a);async function O(e,a){let s=(e.arcgisKnowledgeToolResult??[]).map(l=>({...l,details:void 0})),{knowledgeGraph:o}=await q(a),n=S.getDataModelTypesSummary(o.dataModel),r={assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,toolResult:s,dataModelSummary:n},i=await _({promptText:await m("arcgis_knowledge_summarize_result_prompt"),modelTier:"default",inputVariables:r,config:a}),t=typeof i=="string"?i:i.content;return{...e,outputMessage:t,status:"success",summary:h(t),arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,new u(t)]}}async function j(e){let a=e.arcgisKnowledgeToolResult?.[0],s=a?.status==="success"?a.summary:"ArcGIS Knowledge Agent tool execution failed.";return{...e,outputMessage:s,status:"success",summary:h(s),arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,new u(s)]}}function g(e){return async(a,s)=>s?.signal?.aborted?(await c({text:"Knowledge Agent execution cancelled"},s),new f({goto:d,update:{outputMessage:"Knowledge Agent execution cancelled",summary:"Knowledge Agent execution cancelled",status:"failed"}})):await e(a,s)}var J=()=>new x(y).addNode("requireArcgisKnowledgeServices",V).addNode("agent",g($)).addNode("tools",g(F)).addNode("summarizationLLM",g(O)).addNode("finalizeToolSummary",g(j)).addEdge(w,"requireArcgisKnowledgeServices").addEdge("requireArcgisKnowledgeServices","agent").addConditionalEdges("agent",e=>(e.arcgisKnowledgeMessages[e.arcgisKnowledgeMessages.length-1]?.tool_calls?.length??0)>0?"tools":d).addConditionalEdges("tools",e=>{if(e.status==="failed")return d;let a=e.arcgisKnowledgeToolResult?.[0];return a?.status==="success"&&["applyLayout","changeNonspatialVisibility"].includes(a.toolName)?"finalizeToolSummary":"summarizationLLM"}).addEdge("summarizationLLM",d).addEdge("finalizeToolSummary",d),P=String.raw`The purpose of this agent is to work with Knowledge Graph data, a graph database technology that represents and stores data as interconnected entities (nodes) and relationships (edges).
5
7
  This agent has two categories of skills: those that work with an active link chart visualization of a subset of the data in the knowledge graph, and those that work with the knowledge graph data more generally against the entire dataset in the service and database.
6
8
  For link charts, the agent enables users to interact with a link chart by adding new entities (also called nodes) or relationships (also called edges), removing existing entities or relationships,
7
9
  expanding the graph from particular entities, finding relationships between specified entities on the link chart and adding them to the link chart, finding all relationships
@@ -39,4 +41,4 @@ _example: "Discover and add all the relationships originating at 'Entity E' to t
39
41
  _example: "Show me all entities with a name similar to 'Smith' and add them to the link chart"_
40
42
  _example: "Find reports in my graph that have a title similar to 'Quarterly Earnings'"_
41
43
  _example: "Find John Smith and all people he has made phone calls to in the last year"_
42
- _example: "What is the average age of all people who work for Esri?"_`,$={id:"arcgisKnowledge",name:"ArcgisKnowledge Agent",description:V,createGraph:O,workspace:u};var m=class extends w{constructor(){super(...arguments),this.agent=$}static{this.properties={referenceElement:1,serviceUrl:3,context:0}}#t;#a;#e;get serviceUrl(){return this.#a}set serviceUrl(a){this.#a=a}async getContext(){let a=this.context?{...this.context,knowledgeGraph:void 0,view:void 0}:{};if(this.#t)return{...a,view:this.#t};if(this.#e)try{let i=await this.#e;return{...a,knowledgeGraph:i}}catch(i){console.error("Failed to load knowledge graph via service URL:",i)}if(!this.context?.knowledgeGraph&&!this.context?.view)throw new Error("arcgis-assistant-knowledge-agent requires either a knowledgeGraph or view in context, and neither were provided");return this.context}willUpdate(a){a.has("serviceUrl")&&this.serviceUrl?this.#e=J(this.serviceUrl):this.#e=void 0}load(){this.#t=A(this)??void 0,b(this)}};f("arcgis-assistant-knowledge-agent",m);return m},"identity/IdentityManager","portal/Portal","core/reactiveUtils","layers/FeatureLayer","request","intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","identity/IdentityManager","portal/Portal","core/reactiveUtils","layers/FeatureLayer","request","rest/knowledgeGraphService",a,c)
44
+ _example: "What is the average age of all people who work for Esri?"_`,le={id:"arcgisKnowledge",name:"ArcgisKnowledge Agent",description:P,createGraph:J,workspace:y};return le},"identity/IdentityManager","portal/Portal","request","config","core/reactiveUtils","layers/FeatureLayer",a,b)
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"./YIMNOUTF.js";var e=`This Feature Layer is part of a Feature Service. The Feature Layer contains various fields, each with its own name, type, and description.
2
+ import"./UZLQALHY.js";var e=`This Feature Layer is part of a Feature Service. The Feature Layer contains various fields, each with its own name, type, and description.
3
3
  The Feature Layer is a collection of geographic features that represent real-world entities. Each feature in the layer has attributes that provide additional information about the feature. The layer may include point, line, or polygon geometries, depending on the type of data it represents.
4
4
  The geometry type for this layer is {layerGeometryType}.
5
5
 
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as n}from"./ONQ6JSBJ.js";import{Dc as o}from"./AI6DYOKR.js";import{a as i}from"./VXFQANGJ.js";async function a(e){let t=e.map.initialViewProperties?.viewpoint?.targetGeometry;if(t)await e.goTo(t);else throw new Error("Initial extent is undefined");return{text:"Successfully zoomed to home extent"}}async function m(e,t){let{mapView:r}=n(t,["mapView"]);return await a(r)}var s=i.object({}),f=o(m,{name:"goToHomeExtent",description:"Go to the initial web map view extent",schema:s});export{f as a};