@arcgis/ai-components 5.1.0-next.11 → 5.1.0-next.111

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 (532) hide show
  1. package/dist/cdn/24MYCR6F.js +3 -0
  2. package/dist/cdn/2TKDD7IY.js +2 -0
  3. package/dist/cdn/47QQSSPB.js +2 -0
  4. package/dist/cdn/4SZDSAFW.js +2 -0
  5. package/dist/cdn/5GV3OWI2.js +2 -0
  6. package/dist/cdn/5H7BG46R.js +72 -0
  7. package/dist/cdn/{ZYQ6U2YH.js → 5PT7ZFXF.js} +46 -6
  8. package/dist/cdn/5X5GJH2L.js +5 -0
  9. package/dist/cdn/6QA7CIBO.js +2 -0
  10. package/dist/cdn/7EXACS27.js +74 -0
  11. package/dist/cdn/ASFDOICU.js +2 -0
  12. package/dist/cdn/BOP6HXCW.js +3 -0
  13. package/dist/cdn/CZFAQXRE.js +2 -0
  14. package/dist/cdn/{LTBEINKG.js → DMLSCJAM.js} +12 -1
  15. package/dist/cdn/EJWQC2SL.js +2 -0
  16. package/dist/cdn/{62K6RJZZ.js → ESTSYVJP.js} +15 -2
  17. package/dist/cdn/EUNEQNYC.js +2 -0
  18. package/dist/cdn/GHPDN2L7.js +2 -0
  19. package/dist/cdn/HFNOF6ZK.js +397 -0
  20. package/dist/cdn/ITH2G6QR.js +2 -0
  21. package/dist/cdn/J2F4YIQI.js +4 -0
  22. package/dist/cdn/JKAITV5Q.js +31 -0
  23. package/dist/cdn/K6LVZHWM.js +45 -0
  24. package/dist/cdn/KDUG6AWZ.js +2 -0
  25. package/dist/cdn/M56MGI7M.js +2 -0
  26. package/dist/cdn/M5ZB2XU3.js +2 -0
  27. package/dist/cdn/MM4TFFXX.js +2 -0
  28. package/dist/cdn/MZJGADGH.js +122 -0
  29. package/dist/cdn/PYVVZRRJ.js +2 -0
  30. package/dist/cdn/Q27QDQVP.js +2 -0
  31. package/dist/cdn/QEYLJYK7.js +2 -0
  32. package/dist/cdn/R5PFKR6I.js +2 -0
  33. package/dist/cdn/RACFQ7G7.js +2 -0
  34. package/dist/cdn/RBLFCUDD.js +2 -0
  35. package/dist/cdn/RLPRKLYJ.js +2 -0
  36. package/dist/cdn/RYEH3CUI.js +107 -0
  37. package/dist/cdn/{W2A22QZU.js → SFREIREB.js} +14 -3
  38. package/dist/cdn/SRNPZKME.js +2 -0
  39. package/dist/cdn/T6OKBDDT.js +283 -0
  40. package/dist/cdn/XLFCW5OF.js +2 -0
  41. package/dist/cdn/{WBSNYWJJ.js → YGW7TUNX.js} +1 -1
  42. package/dist/cdn/YQXI4KVT.js +2 -0
  43. package/dist/cdn/YVTKUITE.js +98 -0
  44. package/dist/cdn/Z7GVYVWK.js +121 -0
  45. package/dist/cdn/ZTRICLZY.js +2 -0
  46. package/dist/cdn/assets/assistant/t9n/messages.ar.json +1 -1
  47. package/dist/cdn/assets/assistant/t9n/messages.bg.json +1 -1
  48. package/dist/cdn/assets/assistant/t9n/messages.bs.json +1 -1
  49. package/dist/cdn/assets/assistant/t9n/messages.ca.json +1 -1
  50. package/dist/cdn/assets/assistant/t9n/messages.cs.json +1 -1
  51. package/dist/cdn/assets/assistant/t9n/messages.da.json +1 -1
  52. package/dist/cdn/assets/assistant/t9n/messages.de.json +1 -1
  53. package/dist/cdn/assets/assistant/t9n/messages.el.json +1 -1
  54. package/dist/cdn/assets/assistant/t9n/messages.en.json +1 -1
  55. package/dist/cdn/assets/assistant/t9n/messages.es.json +1 -1
  56. package/dist/cdn/assets/assistant/t9n/messages.et.json +1 -1
  57. package/dist/cdn/assets/assistant/t9n/messages.fi.json +1 -1
  58. package/dist/cdn/assets/assistant/t9n/messages.fr.json +1 -1
  59. package/dist/cdn/assets/assistant/t9n/messages.he.json +1 -1
  60. package/dist/cdn/assets/assistant/t9n/messages.hr.json +1 -1
  61. package/dist/cdn/assets/assistant/t9n/messages.hu.json +1 -1
  62. package/dist/cdn/assets/assistant/t9n/messages.id.json +1 -1
  63. package/dist/cdn/assets/assistant/t9n/messages.it.json +1 -1
  64. package/dist/cdn/assets/assistant/t9n/messages.ja.json +1 -1
  65. package/dist/cdn/assets/assistant/t9n/messages.ko.json +1 -1
  66. package/dist/cdn/assets/assistant/t9n/messages.lt.json +1 -1
  67. package/dist/cdn/assets/assistant/t9n/messages.lv.json +1 -1
  68. package/dist/cdn/assets/assistant/t9n/messages.nl.json +1 -1
  69. package/dist/cdn/assets/assistant/t9n/messages.no.json +1 -1
  70. package/dist/cdn/assets/assistant/t9n/messages.pl.json +1 -1
  71. package/dist/cdn/assets/assistant/t9n/messages.pt-BR.json +1 -1
  72. package/dist/cdn/assets/assistant/t9n/messages.pt-PT.json +1 -1
  73. package/dist/cdn/assets/assistant/t9n/messages.ro.json +1 -1
  74. package/dist/cdn/assets/assistant/t9n/messages.ru.json +1 -1
  75. package/dist/cdn/assets/assistant/t9n/messages.sk.json +1 -1
  76. package/dist/cdn/assets/assistant/t9n/messages.sl.json +1 -1
  77. package/dist/cdn/assets/assistant/t9n/messages.sr.json +1 -1
  78. package/dist/cdn/assets/assistant/t9n/messages.sv.json +1 -1
  79. package/dist/cdn/assets/assistant/t9n/messages.th.json +1 -1
  80. package/dist/cdn/assets/assistant/t9n/messages.tr.json +1 -1
  81. package/dist/cdn/assets/assistant/t9n/messages.uk.json +1 -1
  82. package/dist/cdn/assets/assistant/t9n/messages.vi.json +1 -1
  83. package/dist/cdn/assets/assistant/t9n/messages.zh-CN.json +1 -1
  84. package/dist/cdn/assets/assistant/t9n/messages.zh-HK.json +1 -1
  85. package/dist/cdn/assets/assistant/t9n/messages.zh-TW.json +1 -1
  86. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.ar.json +1 -1
  87. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.bg.json +1 -1
  88. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.bs.json +1 -1
  89. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.ca.json +1 -1
  90. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.cs.json +1 -1
  91. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.da.json +1 -1
  92. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.de.json +1 -1
  93. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.el.json +1 -1
  94. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.en.json +1 -1
  95. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.es.json +1 -1
  96. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.et.json +1 -1
  97. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.fi.json +1 -1
  98. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.fr.json +1 -1
  99. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.he.json +1 -1
  100. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.hr.json +1 -1
  101. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.hu.json +1 -1
  102. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.id.json +1 -1
  103. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.it.json +1 -1
  104. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.ja.json +1 -1
  105. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.ko.json +1 -1
  106. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.lt.json +1 -1
  107. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.lv.json +1 -1
  108. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.nl.json +1 -1
  109. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.no.json +1 -1
  110. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.pl.json +1 -1
  111. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.pt-BR.json +1 -1
  112. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.pt-PT.json +1 -1
  113. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.ro.json +1 -1
  114. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.ru.json +1 -1
  115. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.sk.json +1 -1
  116. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.sl.json +1 -1
  117. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.sr.json +1 -1
  118. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.sv.json +1 -1
  119. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.th.json +1 -1
  120. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.tr.json +1 -1
  121. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.uk.json +1 -1
  122. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.vi.json +1 -1
  123. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.zh-CN.json +1 -1
  124. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.zh-HK.json +1 -1
  125. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.zh-TW.json +1 -1
  126. package/dist/cdn/assets/assistant-interrupt/t9n/messages.ar.json +1 -1
  127. package/dist/cdn/assets/assistant-interrupt/t9n/messages.bg.json +1 -1
  128. package/dist/cdn/assets/assistant-interrupt/t9n/messages.bs.json +1 -1
  129. package/dist/cdn/assets/assistant-interrupt/t9n/messages.ca.json +1 -1
  130. package/dist/cdn/assets/assistant-interrupt/t9n/messages.cs.json +1 -1
  131. package/dist/cdn/assets/assistant-interrupt/t9n/messages.da.json +1 -1
  132. package/dist/cdn/assets/assistant-interrupt/t9n/messages.de.json +1 -1
  133. package/dist/cdn/assets/assistant-interrupt/t9n/messages.el.json +1 -1
  134. package/dist/cdn/assets/assistant-interrupt/t9n/messages.es.json +1 -1
  135. package/dist/cdn/assets/assistant-interrupt/t9n/messages.et.json +1 -1
  136. package/dist/cdn/assets/assistant-interrupt/t9n/messages.fi.json +1 -1
  137. package/dist/cdn/assets/assistant-interrupt/t9n/messages.fr.json +1 -1
  138. package/dist/cdn/assets/assistant-interrupt/t9n/messages.he.json +1 -1
  139. package/dist/cdn/assets/assistant-interrupt/t9n/messages.hr.json +1 -1
  140. package/dist/cdn/assets/assistant-interrupt/t9n/messages.hu.json +1 -1
  141. package/dist/cdn/assets/assistant-interrupt/t9n/messages.id.json +1 -1
  142. package/dist/cdn/assets/assistant-interrupt/t9n/messages.it.json +1 -1
  143. package/dist/cdn/assets/assistant-interrupt/t9n/messages.ja.json +1 -1
  144. package/dist/cdn/assets/assistant-interrupt/t9n/messages.ko.json +1 -1
  145. package/dist/cdn/assets/assistant-interrupt/t9n/messages.lt.json +1 -1
  146. package/dist/cdn/assets/assistant-interrupt/t9n/messages.lv.json +1 -1
  147. package/dist/cdn/assets/assistant-interrupt/t9n/messages.nl.json +1 -1
  148. package/dist/cdn/assets/assistant-interrupt/t9n/messages.no.json +1 -1
  149. package/dist/cdn/assets/assistant-interrupt/t9n/messages.pl.json +1 -1
  150. package/dist/cdn/assets/assistant-interrupt/t9n/messages.pt-BR.json +1 -1
  151. package/dist/cdn/assets/assistant-interrupt/t9n/messages.pt-PT.json +1 -1
  152. package/dist/cdn/assets/assistant-interrupt/t9n/messages.ro.json +1 -1
  153. package/dist/cdn/assets/assistant-interrupt/t9n/messages.ru.json +1 -1
  154. package/dist/cdn/assets/assistant-interrupt/t9n/messages.sk.json +1 -1
  155. package/dist/cdn/assets/assistant-interrupt/t9n/messages.sl.json +1 -1
  156. package/dist/cdn/assets/assistant-interrupt/t9n/messages.sr.json +1 -1
  157. package/dist/cdn/assets/assistant-interrupt/t9n/messages.sv.json +1 -1
  158. package/dist/cdn/assets/assistant-interrupt/t9n/messages.th.json +1 -1
  159. package/dist/cdn/assets/assistant-interrupt/t9n/messages.tr.json +1 -1
  160. package/dist/cdn/assets/assistant-interrupt/t9n/messages.uk.json +1 -1
  161. package/dist/cdn/assets/assistant-interrupt/t9n/messages.vi.json +1 -1
  162. package/dist/cdn/assets/assistant-interrupt/t9n/messages.zh-CN.json +1 -1
  163. package/dist/cdn/assets/assistant-interrupt/t9n/messages.zh-HK.json +1 -1
  164. package/dist/cdn/assets/assistant-interrupt/t9n/messages.zh-TW.json +1 -1
  165. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.ar.json +1 -0
  166. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.bg.json +1 -0
  167. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.bs.json +1 -0
  168. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.ca.json +1 -0
  169. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.cs.json +1 -0
  170. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.da.json +1 -0
  171. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.de.json +1 -0
  172. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.el.json +1 -0
  173. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.en.json +1 -0
  174. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.es.json +1 -0
  175. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.et.json +1 -0
  176. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.fi.json +1 -0
  177. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.fr.json +1 -0
  178. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.he.json +1 -0
  179. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.hr.json +1 -0
  180. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.hu.json +1 -0
  181. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.id.json +1 -0
  182. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.it.json +1 -0
  183. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.ja.json +1 -0
  184. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.ko.json +1 -0
  185. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.lt.json +1 -0
  186. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.lv.json +1 -0
  187. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.nl.json +1 -0
  188. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.no.json +1 -0
  189. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.pl.json +1 -0
  190. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.pt-BR.json +1 -0
  191. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.pt-PT.json +1 -0
  192. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.ro.json +1 -0
  193. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.ru.json +1 -0
  194. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.sk.json +1 -0
  195. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.sl.json +1 -0
  196. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.sr.json +1 -0
  197. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.sv.json +1 -0
  198. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.th.json +1 -0
  199. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.tr.json +1 -0
  200. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.uk.json +1 -0
  201. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.vi.json +1 -0
  202. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.zh-CN.json +1 -0
  203. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.zh-HK.json +1 -0
  204. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.zh-TW.json +1 -0
  205. package/dist/cdn/assets/assistant-message-footer/t9n/messages.ar.json +1 -0
  206. package/dist/cdn/assets/assistant-message-footer/t9n/messages.bg.json +1 -0
  207. package/dist/cdn/assets/assistant-message-footer/t9n/messages.bs.json +1 -0
  208. package/dist/cdn/assets/assistant-message-footer/t9n/messages.ca.json +1 -0
  209. package/dist/cdn/assets/assistant-message-footer/t9n/messages.cs.json +1 -0
  210. package/dist/cdn/assets/assistant-message-footer/t9n/messages.da.json +1 -0
  211. package/dist/cdn/assets/assistant-message-footer/t9n/messages.de.json +1 -0
  212. package/dist/cdn/assets/assistant-message-footer/t9n/messages.el.json +1 -0
  213. package/dist/cdn/assets/assistant-message-footer/t9n/messages.en.json +1 -0
  214. package/dist/cdn/assets/assistant-message-footer/t9n/messages.es.json +1 -0
  215. package/dist/cdn/assets/assistant-message-footer/t9n/messages.et.json +1 -0
  216. package/dist/cdn/assets/assistant-message-footer/t9n/messages.fi.json +1 -0
  217. package/dist/cdn/assets/assistant-message-footer/t9n/messages.fr.json +1 -0
  218. package/dist/cdn/assets/assistant-message-footer/t9n/messages.he.json +1 -0
  219. package/dist/cdn/assets/assistant-message-footer/t9n/messages.hr.json +1 -0
  220. package/dist/cdn/assets/assistant-message-footer/t9n/messages.hu.json +1 -0
  221. package/dist/cdn/assets/assistant-message-footer/t9n/messages.id.json +1 -0
  222. package/dist/cdn/assets/assistant-message-footer/t9n/messages.it.json +1 -0
  223. package/dist/cdn/assets/assistant-message-footer/t9n/messages.ja.json +1 -0
  224. package/dist/cdn/assets/assistant-message-footer/t9n/messages.ko.json +1 -0
  225. package/dist/cdn/assets/assistant-message-footer/t9n/messages.lt.json +1 -0
  226. package/dist/cdn/assets/assistant-message-footer/t9n/messages.lv.json +1 -0
  227. package/dist/cdn/assets/assistant-message-footer/t9n/messages.nl.json +1 -0
  228. package/dist/cdn/assets/assistant-message-footer/t9n/messages.no.json +1 -0
  229. package/dist/cdn/assets/assistant-message-footer/t9n/messages.pl.json +1 -0
  230. package/dist/cdn/assets/assistant-message-footer/t9n/messages.pt-BR.json +1 -0
  231. package/dist/cdn/assets/assistant-message-footer/t9n/messages.pt-PT.json +1 -0
  232. package/dist/cdn/assets/assistant-message-footer/t9n/messages.ro.json +1 -0
  233. package/dist/cdn/assets/assistant-message-footer/t9n/messages.ru.json +1 -0
  234. package/dist/cdn/assets/assistant-message-footer/t9n/messages.sk.json +1 -0
  235. package/dist/cdn/assets/assistant-message-footer/t9n/messages.sl.json +1 -0
  236. package/dist/cdn/assets/assistant-message-footer/t9n/messages.sr.json +1 -0
  237. package/dist/cdn/assets/assistant-message-footer/t9n/messages.sv.json +1 -0
  238. package/dist/cdn/assets/assistant-message-footer/t9n/messages.th.json +1 -0
  239. package/dist/cdn/assets/assistant-message-footer/t9n/messages.tr.json +1 -0
  240. package/dist/cdn/assets/assistant-message-footer/t9n/messages.uk.json +1 -0
  241. package/dist/cdn/assets/assistant-message-footer/t9n/messages.vi.json +1 -0
  242. package/dist/cdn/assets/assistant-message-footer/t9n/messages.zh-CN.json +1 -0
  243. package/dist/cdn/assets/assistant-message-footer/t9n/messages.zh-HK.json +1 -0
  244. package/dist/cdn/assets/assistant-message-footer/t9n/messages.zh-TW.json +1 -0
  245. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.ar.json +1 -0
  246. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.bg.json +1 -0
  247. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.bs.json +1 -0
  248. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.ca.json +1 -0
  249. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.cs.json +1 -0
  250. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.da.json +1 -0
  251. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.de.json +1 -0
  252. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.el.json +1 -0
  253. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.en.json +1 -0
  254. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.es.json +1 -0
  255. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.et.json +1 -0
  256. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.fi.json +1 -0
  257. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.fr.json +1 -0
  258. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.he.json +1 -0
  259. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.hr.json +1 -0
  260. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.hu.json +1 -0
  261. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.id.json +1 -0
  262. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.it.json +1 -0
  263. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.ja.json +1 -0
  264. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.ko.json +1 -0
  265. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.lt.json +1 -0
  266. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.lv.json +1 -0
  267. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.nl.json +1 -0
  268. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.no.json +1 -0
  269. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.pl.json +1 -0
  270. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.pt-BR.json +1 -0
  271. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.pt-PT.json +1 -0
  272. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.ro.json +1 -0
  273. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.ru.json +1 -0
  274. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.sk.json +1 -0
  275. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.sl.json +1 -0
  276. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.sr.json +1 -0
  277. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.sv.json +1 -0
  278. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.th.json +1 -0
  279. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.tr.json +1 -0
  280. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.uk.json +1 -0
  281. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.vi.json +1 -0
  282. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.zh-CN.json +1 -0
  283. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.zh-HK.json +1 -0
  284. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.zh-TW.json +1 -0
  285. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.ar.json +1 -0
  286. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.bg.json +1 -0
  287. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.bs.json +1 -0
  288. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.ca.json +1 -0
  289. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.cs.json +1 -0
  290. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.da.json +1 -0
  291. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.de.json +1 -0
  292. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.el.json +1 -0
  293. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.en.json +1 -0
  294. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.es.json +1 -0
  295. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.et.json +1 -0
  296. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.fi.json +1 -0
  297. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.fr.json +1 -0
  298. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.he.json +1 -0
  299. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.hr.json +1 -0
  300. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.hu.json +1 -0
  301. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.id.json +1 -0
  302. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.it.json +1 -0
  303. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.ja.json +1 -0
  304. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.ko.json +1 -0
  305. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.lt.json +1 -0
  306. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.lv.json +1 -0
  307. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.nl.json +1 -0
  308. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.no.json +1 -0
  309. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.pl.json +1 -0
  310. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.pt-BR.json +1 -0
  311. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.pt-PT.json +1 -0
  312. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.ro.json +1 -0
  313. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.ru.json +1 -0
  314. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.sk.json +1 -0
  315. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.sl.json +1 -0
  316. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.sr.json +1 -0
  317. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.sv.json +1 -0
  318. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.th.json +1 -0
  319. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.tr.json +1 -0
  320. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.uk.json +1 -0
  321. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.vi.json +1 -0
  322. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.zh-CN.json +1 -0
  323. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.zh-HK.json +1 -0
  324. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.zh-TW.json +1 -0
  325. package/dist/cdn/index.js +1 -1
  326. package/dist/cdn/main.css +1 -1
  327. package/dist/chunks/slottableRequestUtils.js +11 -0
  328. package/dist/chunks/utils.js +30 -14
  329. package/dist/chunks/utils2.js +12 -4
  330. package/dist/components/arcgis-assistant/customElement.d.ts +340 -28
  331. package/dist/components/arcgis-assistant/customElement.js +160 -103
  332. package/dist/components/arcgis-assistant/index.js +11 -2
  333. package/dist/components/arcgis-assistant/types.d.ts +109 -4
  334. package/dist/components/arcgis-assistant-agent/customElement.d.ts +22 -8
  335. package/dist/components/arcgis-assistant-agent/customElement.js +7 -7
  336. package/dist/components/arcgis-assistant-chat/customElement.d.ts +0 -9
  337. package/dist/components/arcgis-assistant-chat/customElement.js +14 -14
  338. package/dist/components/arcgis-assistant-chat/index.js +0 -1
  339. package/dist/components/arcgis-assistant-chat-entry/customElement.d.ts +10 -10
  340. package/dist/components/arcgis-assistant-chat-entry/customElement.js +46 -34
  341. package/dist/components/arcgis-assistant-chat-entry/index.js +1 -2
  342. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.d.ts +73 -6
  343. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +1 -1
  344. package/dist/components/arcgis-assistant-help-agent/customElement.d.ts +46 -6
  345. package/dist/components/arcgis-assistant-help-agent/customElement.js +1 -1
  346. package/dist/components/arcgis-assistant-interrupt/customElement.js +7 -11
  347. package/dist/components/arcgis-assistant-knowledge-agent/customElement.d.ts +144 -0
  348. package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +51 -0
  349. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +1 -1
  350. package/dist/components/arcgis-assistant-message/customElement.js +43 -0
  351. package/dist/components/arcgis-assistant-message/index.js +3 -0
  352. package/dist/components/arcgis-assistant-message-block/customElement.d.ts +8 -0
  353. package/dist/components/arcgis-assistant-message-block/customElement.js +29 -0
  354. package/dist/components/arcgis-assistant-message-block/index.js +2 -0
  355. package/dist/components/arcgis-assistant-message-feedback/customElement.d.ts +23 -0
  356. package/dist/components/arcgis-assistant-message-feedback/customElement.js +36 -0
  357. package/dist/components/arcgis-assistant-message-feedback/index.js +3 -0
  358. package/dist/components/arcgis-assistant-message-footer/customElement.d.ts +25 -0
  359. package/dist/components/arcgis-assistant-message-footer/customElement.js +62 -0
  360. package/dist/components/arcgis-assistant-message-footer/index.js +6 -0
  361. package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +10 -0
  362. package/dist/components/arcgis-assistant-message-loading/customElement.js +23 -0
  363. package/dist/components/arcgis-assistant-message-loading/index.js +4 -0
  364. package/dist/components/arcgis-assistant-message-log/customElement.d.ts +11 -0
  365. package/dist/components/arcgis-assistant-message-log/customElement.js +29 -0
  366. package/dist/components/arcgis-assistant-message-log/index.js +3 -0
  367. package/dist/components/arcgis-assistant-message-read-aloud/customElement.d.ts +19 -0
  368. package/dist/components/arcgis-assistant-message-read-aloud/customElement.js +100 -0
  369. package/dist/components/arcgis-assistant-message-read-aloud/index.d.ts +1 -0
  370. package/dist/components/arcgis-assistant-message-read-aloud/index.js +3 -0
  371. package/dist/components/arcgis-assistant-message-text/customElement.d.ts +7 -0
  372. package/dist/components/arcgis-assistant-message-text/customElement.js +22 -0
  373. package/dist/components/arcgis-assistant-message-text/index.d.ts +1 -0
  374. package/dist/components/arcgis-assistant-message-text/index.js +1 -0
  375. package/dist/components/arcgis-assistant-navigation-agent/customElement.d.ts +53 -6
  376. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +1 -1
  377. package/dist/components/arcgis-assistant-speech-input/customElement.d.ts +31 -0
  378. package/dist/components/arcgis-assistant-speech-input/customElement.js +488 -0
  379. package/dist/components/arcgis-assistant-speech-input/index.d.ts +1 -0
  380. package/dist/components/arcgis-assistant-speech-input/index.js +2 -0
  381. package/dist/components/arcgis-assistant-speech-input/support/types.d.ts +20 -0
  382. package/dist/components/arcgis-assistant-suggested-prompts/customElement.d.ts +16 -0
  383. package/dist/components/arcgis-assistant-suggested-prompts/customElement.js +27 -0
  384. package/dist/components/arcgis-assistant-suggested-prompts/index.d.ts +1 -0
  385. package/dist/components/arcgis-assistant-suggested-prompts/index.js +3 -0
  386. package/dist/components/arcgis-assistant-user-message/customElement.d.ts +10 -0
  387. package/dist/components/arcgis-assistant-user-message/customElement.js +23 -0
  388. package/dist/components/arcgis-assistant-user-message/index.d.ts +1 -0
  389. package/dist/components/arcgis-assistant-user-message/index.js +2 -0
  390. package/dist/docs/api.json +1 -1
  391. package/dist/docs/docs.json +1 -1
  392. package/dist/docs/vscode.html-custom-data.json +1 -1
  393. package/dist/docs/web-types.json +1 -1
  394. package/dist/index.d.ts +58 -28
  395. package/dist/loader.js +16 -9
  396. package/dist/types/lumina.d.ts +65 -27
  397. package/dist/types/preact.d.ts +76 -32
  398. package/dist/types/react.d.ts +87 -37
  399. package/dist/types/stencil.d.ts +65 -27
  400. package/dist/utils/index.d.ts +305 -0
  401. package/dist/utils/index.js +13 -0
  402. package/package.json +17 -12
  403. package/dist/cdn/3GHUM4G5.js +0 -2
  404. package/dist/cdn/46Q4W2ZL.js +0 -2
  405. package/dist/cdn/5TCVCSD2.js +0 -254
  406. package/dist/cdn/6T2EIYO4.js +0 -59
  407. package/dist/cdn/AGZUEMOX.js +0 -2
  408. package/dist/cdn/BSIB6MUI.js +0 -20
  409. package/dist/cdn/D6OOXTNF.js +0 -2
  410. package/dist/cdn/ERJNZQMY.js +0 -3
  411. package/dist/cdn/HN2HMAMX.js +0 -28
  412. package/dist/cdn/JJPTDO6D.js +0 -2
  413. package/dist/cdn/JVR66VPL.js +0 -3
  414. package/dist/cdn/KKHKKCYH.js +0 -17
  415. package/dist/cdn/KQ6LEQHH.js +0 -14
  416. package/dist/cdn/MYKSIL6I.js +0 -2
  417. package/dist/cdn/NE5QLOBJ.js +0 -2
  418. package/dist/cdn/NP6HM6LT.js +0 -2
  419. package/dist/cdn/NXHPOTJH.js +0 -2
  420. package/dist/cdn/OBS3OCJ2.js +0 -77
  421. package/dist/cdn/OJUEJ4RT.js +0 -2
  422. package/dist/cdn/PQHYDFCL.js +0 -2
  423. package/dist/cdn/R3LAOKXQ.js +0 -2
  424. package/dist/cdn/SOWNHB7F.js +0 -30
  425. package/dist/cdn/TTZPL57Z.js +0 -2
  426. package/dist/cdn/VG7GKLZR.js +0 -4
  427. package/dist/cdn/WAO4LVNK.js +0 -67
  428. package/dist/cdn/WFEBJPQ4.js +0 -2
  429. package/dist/cdn/WYD57P2U.js +0 -2
  430. package/dist/cdn/X7WF7TCS.js +0 -2
  431. package/dist/cdn/XTVXT577.js +0 -270
  432. package/dist/cdn/ZGRFMSA2.js +0 -2
  433. package/dist/cdn/assets/assistant-chat-card/t9n/messages.ar.json +0 -1
  434. package/dist/cdn/assets/assistant-chat-card/t9n/messages.bg.json +0 -1
  435. package/dist/cdn/assets/assistant-chat-card/t9n/messages.bs.json +0 -1
  436. package/dist/cdn/assets/assistant-chat-card/t9n/messages.ca.json +0 -1
  437. package/dist/cdn/assets/assistant-chat-card/t9n/messages.cs.json +0 -1
  438. package/dist/cdn/assets/assistant-chat-card/t9n/messages.da.json +0 -1
  439. package/dist/cdn/assets/assistant-chat-card/t9n/messages.de.json +0 -1
  440. package/dist/cdn/assets/assistant-chat-card/t9n/messages.el.json +0 -1
  441. package/dist/cdn/assets/assistant-chat-card/t9n/messages.en.json +0 -1
  442. package/dist/cdn/assets/assistant-chat-card/t9n/messages.es.json +0 -1
  443. package/dist/cdn/assets/assistant-chat-card/t9n/messages.et.json +0 -1
  444. package/dist/cdn/assets/assistant-chat-card/t9n/messages.fi.json +0 -1
  445. package/dist/cdn/assets/assistant-chat-card/t9n/messages.fr.json +0 -1
  446. package/dist/cdn/assets/assistant-chat-card/t9n/messages.he.json +0 -1
  447. package/dist/cdn/assets/assistant-chat-card/t9n/messages.hr.json +0 -1
  448. package/dist/cdn/assets/assistant-chat-card/t9n/messages.hu.json +0 -1
  449. package/dist/cdn/assets/assistant-chat-card/t9n/messages.id.json +0 -1
  450. package/dist/cdn/assets/assistant-chat-card/t9n/messages.it.json +0 -1
  451. package/dist/cdn/assets/assistant-chat-card/t9n/messages.ja.json +0 -1
  452. package/dist/cdn/assets/assistant-chat-card/t9n/messages.ko.json +0 -1
  453. package/dist/cdn/assets/assistant-chat-card/t9n/messages.lt.json +0 -1
  454. package/dist/cdn/assets/assistant-chat-card/t9n/messages.lv.json +0 -1
  455. package/dist/cdn/assets/assistant-chat-card/t9n/messages.nl.json +0 -1
  456. package/dist/cdn/assets/assistant-chat-card/t9n/messages.no.json +0 -1
  457. package/dist/cdn/assets/assistant-chat-card/t9n/messages.pl.json +0 -1
  458. package/dist/cdn/assets/assistant-chat-card/t9n/messages.pt-BR.json +0 -1
  459. package/dist/cdn/assets/assistant-chat-card/t9n/messages.pt-PT.json +0 -1
  460. package/dist/cdn/assets/assistant-chat-card/t9n/messages.ro.json +0 -1
  461. package/dist/cdn/assets/assistant-chat-card/t9n/messages.ru.json +0 -1
  462. package/dist/cdn/assets/assistant-chat-card/t9n/messages.sk.json +0 -1
  463. package/dist/cdn/assets/assistant-chat-card/t9n/messages.sl.json +0 -1
  464. package/dist/cdn/assets/assistant-chat-card/t9n/messages.sr.json +0 -1
  465. package/dist/cdn/assets/assistant-chat-card/t9n/messages.sv.json +0 -1
  466. package/dist/cdn/assets/assistant-chat-card/t9n/messages.th.json +0 -1
  467. package/dist/cdn/assets/assistant-chat-card/t9n/messages.tr.json +0 -1
  468. package/dist/cdn/assets/assistant-chat-card/t9n/messages.uk.json +0 -1
  469. package/dist/cdn/assets/assistant-chat-card/t9n/messages.vi.json +0 -1
  470. package/dist/cdn/assets/assistant-chat-card/t9n/messages.zh-CN.json +0 -1
  471. package/dist/cdn/assets/assistant-chat-card/t9n/messages.zh-HK.json +0 -1
  472. package/dist/cdn/assets/assistant-chat-card/t9n/messages.zh-TW.json +0 -1
  473. package/dist/cdn/assets/assistant-shell/t9n/messages.ar.json +0 -1
  474. package/dist/cdn/assets/assistant-shell/t9n/messages.bg.json +0 -1
  475. package/dist/cdn/assets/assistant-shell/t9n/messages.bs.json +0 -1
  476. package/dist/cdn/assets/assistant-shell/t9n/messages.ca.json +0 -1
  477. package/dist/cdn/assets/assistant-shell/t9n/messages.cs.json +0 -1
  478. package/dist/cdn/assets/assistant-shell/t9n/messages.da.json +0 -1
  479. package/dist/cdn/assets/assistant-shell/t9n/messages.de.json +0 -1
  480. package/dist/cdn/assets/assistant-shell/t9n/messages.el.json +0 -1
  481. package/dist/cdn/assets/assistant-shell/t9n/messages.en.json +0 -1
  482. package/dist/cdn/assets/assistant-shell/t9n/messages.es.json +0 -1
  483. package/dist/cdn/assets/assistant-shell/t9n/messages.et.json +0 -1
  484. package/dist/cdn/assets/assistant-shell/t9n/messages.fi.json +0 -1
  485. package/dist/cdn/assets/assistant-shell/t9n/messages.fr.json +0 -1
  486. package/dist/cdn/assets/assistant-shell/t9n/messages.he.json +0 -1
  487. package/dist/cdn/assets/assistant-shell/t9n/messages.hr.json +0 -1
  488. package/dist/cdn/assets/assistant-shell/t9n/messages.hu.json +0 -1
  489. package/dist/cdn/assets/assistant-shell/t9n/messages.id.json +0 -1
  490. package/dist/cdn/assets/assistant-shell/t9n/messages.it.json +0 -1
  491. package/dist/cdn/assets/assistant-shell/t9n/messages.ja.json +0 -1
  492. package/dist/cdn/assets/assistant-shell/t9n/messages.ko.json +0 -1
  493. package/dist/cdn/assets/assistant-shell/t9n/messages.lt.json +0 -1
  494. package/dist/cdn/assets/assistant-shell/t9n/messages.lv.json +0 -1
  495. package/dist/cdn/assets/assistant-shell/t9n/messages.nl.json +0 -1
  496. package/dist/cdn/assets/assistant-shell/t9n/messages.no.json +0 -1
  497. package/dist/cdn/assets/assistant-shell/t9n/messages.pl.json +0 -1
  498. package/dist/cdn/assets/assistant-shell/t9n/messages.pt-BR.json +0 -1
  499. package/dist/cdn/assets/assistant-shell/t9n/messages.pt-PT.json +0 -1
  500. package/dist/cdn/assets/assistant-shell/t9n/messages.ro.json +0 -1
  501. package/dist/cdn/assets/assistant-shell/t9n/messages.ru.json +0 -1
  502. package/dist/cdn/assets/assistant-shell/t9n/messages.sk.json +0 -1
  503. package/dist/cdn/assets/assistant-shell/t9n/messages.sl.json +0 -1
  504. package/dist/cdn/assets/assistant-shell/t9n/messages.sr.json +0 -1
  505. package/dist/cdn/assets/assistant-shell/t9n/messages.sv.json +0 -1
  506. package/dist/cdn/assets/assistant-shell/t9n/messages.th.json +0 -1
  507. package/dist/cdn/assets/assistant-shell/t9n/messages.tr.json +0 -1
  508. package/dist/cdn/assets/assistant-shell/t9n/messages.uk.json +0 -1
  509. package/dist/cdn/assets/assistant-shell/t9n/messages.vi.json +0 -1
  510. package/dist/cdn/assets/assistant-shell/t9n/messages.zh-CN.json +0 -1
  511. package/dist/cdn/assets/assistant-shell/t9n/messages.zh-HK.json +0 -1
  512. package/dist/cdn/assets/assistant-shell/t9n/messages.zh-TW.json +0 -1
  513. package/dist/components/arcgis-assistant-chat-card/customElement.d.ts +0 -39
  514. package/dist/components/arcgis-assistant-chat-card/customElement.js +0 -87
  515. package/dist/components/arcgis-assistant-chat-card/index.js +0 -8
  516. package/dist/components/arcgis-assistant-chat-card-content/customElement.d.ts +0 -12
  517. package/dist/components/arcgis-assistant-chat-card-content/customElement.js +0 -42
  518. package/dist/components/arcgis-assistant-chat-card-content/index.js +0 -3
  519. package/dist/components/arcgis-assistant-layer-filter-agent/customElement.d.ts +0 -8
  520. package/dist/components/arcgis-assistant-layer-filter-agent/customElement.js +0 -26
  521. package/dist/components/arcgis-assistant-layer-query-agent/customElement.d.ts +0 -8
  522. package/dist/components/arcgis-assistant-layer-query-agent/customElement.js +0 -26
  523. package/dist/components/arcgis-assistant-shell/customElement.d.ts +0 -40
  524. package/dist/components/arcgis-assistant-shell/customElement.js +0 -28
  525. package/dist/components/arcgis-assistant-shell/index.js +0 -6
  526. /package/dist/components/{arcgis-assistant-chat-card-content → arcgis-assistant-knowledge-agent}/index.d.ts +0 -0
  527. /package/dist/components/{arcgis-assistant-layer-filter-agent → arcgis-assistant-knowledge-agent}/index.js +0 -0
  528. /package/dist/components/{arcgis-assistant-chat-card → arcgis-assistant-message-block}/index.d.ts +0 -0
  529. /package/dist/components/{arcgis-assistant-layer-filter-agent → arcgis-assistant-message-feedback}/index.d.ts +0 -0
  530. /package/dist/components/{arcgis-assistant-layer-query-agent → arcgis-assistant-message-footer}/index.d.ts +0 -0
  531. /package/dist/components/{arcgis-assistant-shell → arcgis-assistant-message-loading}/index.d.ts +0 -0
  532. /package/dist/components/{arcgis-assistant-layer-query-agent/index.js → arcgis-assistant-message-log/index.d.ts} +0 -0
@@ -1,16 +1,27 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
2
  import"./CFDTXKJ6.js";var e=`## Navigation Agent - Tool Intent Classifier
3
3
 
4
- You are an assistant that classifies user intent for navigation agent.
4
+ You are an assistant that classifies the assigned task intent for navigation agent.
5
5
 
6
6
  You are given the following tool options:
7
7
  {tools}
8
8
 
9
9
  Bookmarks: {bookmarks}
10
10
 
11
- Use the most recent relevant user question from the chat history. The question will **not** be restated again here.
11
+ Assigned task:
12
+ {assignedTask}
12
13
 
13
- Return exactly one intent (tool name) based on the user's request.
14
+ Latest user request:
15
+ {userRequest}
16
+
17
+ Prior steps:
18
+ {priorSteps}
19
+
20
+ Use the assigned task as the primary instruction for the current query. The question will **not** be restated again here.
21
+ Use the latest user request as supporting context when needed.
22
+ Use prior steps only when the assigned task clearly depends on earlier results.
23
+
24
+ Return exactly one intent (tool name) based on the assigned task.
14
25
  If none apply, return an **empty string**.
15
26
 
16
27
  Choose only from provided tools.
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{g as e,h as a,v as s,y as i}from"./J2F4YIQI.js";import"./CFDTXKJ6.js";var r=e`.container{display:flex;align-items:center;gap:var(--calcite-spacing-md);background:color-mix(in srgb,var(--calcite-color-brand) 25%,transparent);color:var(--calcite-color-text-1);padding:var(--calcite-spacing-md);border-radius:var(--calcite-border-radius);width:fit-content;margin-left:auto;justify-content:flex-end}.avatar{display:flex;align-items:center;justify-content:center}@container (min-width: 480px){.container{max-width:80%}}`,t=class extends s{static{this.properties={content:1,user:1,message:0}}static{this.styles=r}_getContent(){return this.message?.role==="user"?this.message.content:this.content}render(){return a`<div class="container"><div><slot name=content>${this._getContent()}</slot></div><slot name=icon><div class="avatar"><calcite-avatar .fullName=${this.user} scale=s></calcite-avatar></div></slot></div>`}};i("arcgis-assistant-user-message",t);export{t as ArcgisAssistantUserMessage};
@@ -0,0 +1,283 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import a from"./RYEH3CUI.js";import{Bb as K,Fb as q,L as Q,M as de,Q as re,R as B,Za as M,_a as y,a as F,b as T,g as _e,j as ee,k as te,kb as v,q as Fe,qb as qe,u as Me}from"./HFNOF6ZK.js";export default $arcgis.t(([me,Nt,O,{addressToLocations:_t},Ft,Ue,He,Mt,We,Ze,{formatDateOnly:qt,convertDateFormatToIntlOptions:ae,formatTimeOnly:Ct,formatDate:Le},Je,Ye,At,Rt,{createRenderer:Lt},{getSchemesByTag:zt,getSchemes:jt},{getBackgroundColorTheme:ze},{createAgeRenderer:Dt,createContinuousRenderer:Ot},{getSchemesByTag:Se},{createContinuousRenderer:Vt},{createRenderer:Gt},{getSchemesByTag:Pt},{createRenderer:Qt},{getSchemesByTag:Bt},{createRenderer:Kt},{getSchemesByTag:Ut},{createRenderer:Ht},{getSchemesByTag:Wt},{createAgeRenderer:Zt,createContinuousRenderer:Jt},{createRenderer:Yt},{getSchemesByTag:Xt},,{fetchKnowledgeGraph:je,executeQueryStreaming:er,executeSearchStreaming:tr},rr,Xe,De,Oe,ar,{a:l,b:U,c:Ce,d:g,e:I,g:ue,h:pe,i:j}])=>{var Re=e=>Array.isArray(e)&&e.every(Q),Et=e=>typeof e=="object"&&e!=null&&"messages"in e&&Re(e.messages),It=e=>typeof e=="object"&&e!=null&&"lg_tool_call"in e,C=class extends qe{tools;handleToolErrors=!0;trace=!1;constructor(e,t){let{name:r,tags:a,handleToolErrors:o}=t??{};super({name:r,tags:a,func:(n,i)=>this.run(n,i)}),this.tools=e,this.handleToolErrors=o??this.handleToolErrors}async runTool(e,t){let r=this.tools.find(a=>a.name===e.name);try{if(r===void 0)throw new Error(`Tool "${e.name}" not found.`);let a=await r.invoke({...e,type:"tool_call"},t);return Q(a)&&a.getType()==="tool"||te(a)?a:new de({status:"success",name:r.name,content:typeof a=="string"?a:JSON.stringify(a),tool_call_id:e.id})}catch(a){if(!this.handleToolErrors||Me(a))throw a;return new de({status:"error",content:`Error: ${a.message}
3
+ Please fix your mistakes.`,name:e.name,tool_call_id:e.id??""})}}async run(e,t){let r;if(It(e))r=[await this.runTool(e.lg_tool_call,t)];else{let n;if(Re(e))n=e;else if(Et(e))n=e.messages;else throw new Error("ToolNode only accepts BaseMessage[] or { messages: BaseMessage[] } as input.");let i=new Set(n.filter(d=>d.getType()==="tool").map(d=>d.tool_call_id)),s;for(let d=n.length-1;d>=0;d-=1){let c=n[d];if(B(c)){s=c;break}}if(s==null||!B(s))throw new Error("ToolNode only accepts AIMessages as input.");r=await Promise.all(s.tool_calls?.filter(d=>d.id==null||!i.has(d.id)).map(d=>this.runTool(d,t))??[])}if(!r.some(te))return Array.isArray(e)?r:{messages:r};let a=[],o=null;for(let n of r)te(n)?n.graph===ee.PARENT&&Array.isArray(n.goto)&&n.goto.every(i=>_e(i))?o?o.goto.push(...n.goto):o=new ee({graph:ee.PARENT,goto:n.goto}):a.push(n):a.push(Array.isArray(e)?[n]:{messages:[n]});return o&&a.push(o),a}};var $s=v.Root({llmInputMessages:v({reducer:(e,t)=>K([],t),default:()=>[]})});var H=(e,t)=>t??e,et=v.Root({...Ce(),intent:v({reducer:H}),vectorSearchLayerResults:v({reducer:H,default:()=>[]}),vectorSearchFieldResults:v({reducer:H}),navigationInternalState:v({reducer:H,default:()=>({toolCallMessage:void 0})})});async function or(e,t){let r=O.getDefault().helperServices,a=r.geocode.find(p=>p.name==="ArcGIS World Geocoding Service")??r.geocode[0];if(!a)throw new Error("No geocoding service found in helperServices.");let o=a.url,n=`${me.assetsPath?.endsWith("/")?me.assetsPath:`${me.assetsPath}/`}esri/images/search/search-symbol-32.png`,i=(await _t(o,{address:{SingleLine:e},outFields:["Match_addr"]}))?.[0];if(!i?.extent||!i.location)throw new Error(`Could not find location for: ${e}`);let s=new Ft({url:n,width:24,height:24}),d=new Nt({geometry:i.location,symbol:s});t.graphics.removeAll(),t.graphics.add(d),await t.goTo(i.extent);let c={address:i.address??"",location:i.location?i.location.toJSON():null,extent:i.extent?i.extent.toJSON():null};return{text:`Successfully zoomed to ${e}.`,sharedStatePatch:{lastResolvedLocation:{value:c}}}}var nr=["mapView"];function $(e){let t=e?.configurable?.context;if(!t||typeof t!="object")throw new Error("NavigationAgent context missing");let r=nr.filter(a=>!(a in t));if(r.length)throw new Error(`NavigationAgent context missing: ${r.join(", ")}`);return t}async function ir({address:e},t){let{mapView:r}=$(t);return await or(e,r)}var sr=l.object({address:l.string().describe("The full address or place name to locate.")}),lr=y(ir,{name:"goToAddress",description:"Geocodes an address using Esri's World Geocoding Service and zooms the map to that location.",schema:sr});async function cr(e,t){let r=t.map.bookmarks;if(!r||r.length===0)throw new Error("No bookmarks found in the map.");let a=r.find(n=>n.name===e);if(!a)throw new Error(`Bookmark with name "${e}" not found.`);let o=a.viewpoint;if(!o)throw new Error(`Bookmark with name "${e}" does not have a valid viewpoint.`);return await t.goTo(o),{text:`Navigated to bookmark: ${e}`}}async function dr({bookmarkName:e},t){let{mapView:r}=$(t);return await Promise.resolve(cr(e,r))}var ur=M.object({bookmarkName:M.string().describe("The name of the bookmark to navigate to.")}),pr=y(dr,{name:"goToBookmark",description:"Go to the extent of the bookmark with the given name.",schema:ur});async function hr(e,t,r){let a=r.map?.allLayers.find(n=>n.id===e);if(!a)return{text:`Error: Layer with id ${e} not found`};let o=a.createQuery();o.where=t??"1=1";try{let{extent:n,count:i}=await a.queryExtent(o);if(i===0)return{text:`No features found in ${a.title} matching: ${t}`};if(n)await r.goTo(n);else return{text:`Error: Unable to determine extent for ${a.title}`};return{text:`Successfully zoomed to ${i} feature(s) in ${a.title}`}}catch(n){return console.error("Error in goToFeatures:",n),{text:`Error: ${n instanceof Error?n.message:"Unknown error"}`}}}async function mr({layerId:e,where:t},r){let{mapView:a}=$(r);return await hr(e,t,a)}var gr=M.object({layerId:M.string().describe("The layerId of the layer to zoom to."),where:M.string().describe("The sql-92 where clause used to query features to zoom to")}),fr=y(mr,{name:"goToFeatures",description:"Go to the features that match the given filter related to the given layerId.",schema:gr});async function yr(e){let t=new Ue({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:{wkid:4326}}).expand(.7);return await e.goTo(t),{text:"Successfully zoomed to world extent"}}async function wr(e,t){let{mapView:r}=$(t);return await yr(r)}var br=M.object({}),vr=y(wr,{name:"goToFullExtent",description:"Zooms the map to the full world extent using Esri's Geocoding Service.",schema:br});async function xr(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 Sr(e,t){let{mapView:r}=$(t);return await xr(r)}var Tr=l.object({}),Er=y(Sr,{name:"goToHomeExtent",description:"Go to the initial web map view extent",schema:Tr});async function Ir(e,t){await t.when();let r=t.map?.allLayers.find(o=>o.id===e);if(!r)return console.warn(`[goToLayer] No matching FeatureLayer found for: ${e}`),{text:`Could not find layer for: ${e}`};let a;return(r.type==="link-chart"||r.type==="knowledge-graph-sublayer")&&t.map?.activeLinkChartLayer?a=t.map.diagramNodesExtent:a=r.fullExtent,a?(await t.goTo(a),r.visible=!0,{text:`Successfully zoomed to: ${r.title??""}`}):{text:"Layer has no defined extent. Cannot zoom to layer."}}async function kr({layerId:e},t){let{mapView:r}=$(t);return await Ir(e,r)}var $r=M.object({layerId:M.string().describe("The id of the layer to navigate to")}),Nr=y(kr,{name:"goToLayer",description:"Zooms the map view to the full extent of the top matching layer.",schema:$r});async function _r(e,t){return await t.goTo({scale:e}),{text:`Successfully zoomed to: ${e}`}}async function Fr({scale:e},t){let{mapView:r}=$(t);return await _r(e,r)}var Mr=l.object({scale:l.number().describe("The map scale of the view to go to.")}),qr=y(Fr,{name:"goToScale",description:"Go to the specified view scale.",schema:Mr});async function Cr(e,t,r){let a={target:new He({longitude:e.longitude,latitude:e.latitude,spatialReference:{wkid:4326}})};return r?.zoom!==void 0&&(a.zoom=r.zoom),r?.scale!==void 0&&(a.scale=r.scale),await t.goTo(a),{text:`Successfully navigated to: ${[`(${e.latitude}\xB0, ${e.longitude}\xB0)`,r?.zoom!==void 0?`zoom ${r.zoom}`:"",r?.scale!==void 0?`scale 1:${r.scale}`:""].filter(Boolean).join(", ")}`}}async function Ar({center:e,zoom:t,scale:r},a){let{mapView:o}=$(a);return await Cr(e,o,{zoom:t,scale:r})}var Rr=l.object({center:l.object({longitude:l.number().describe("The longitude (x-coordinate) of the point to navigate to."),latitude:l.number().describe("The latitude (y-coordinate) of the point to navigate to.")}),zoom:l.number().optional().describe("The zoom level. Higher values = more zoomed in."),scale:l.number().optional().describe("The map scale. Alternative to zoom. Smaller numbers = more zoomed in.")}),Lr=y(Ar,{name:"goToViewpoint",description:"Go to the specified viewpoint. This can contain a combination of scale, center, zoom, etc.",schema:Rr});async function zr(e,t){return await t.goTo({zoom:e}),{text:`Successfully zoomed to: ${e}`}}async function jr({zoom:e},t){let{mapView:r}=$(t);return await zr(e,r)}var Dr=l.object({zoom:l.number().min(1).max(20).describe("The zoom level of the view to go to.")}),Or=y(jr,{name:"goToZoom",description:'Go to the specified zoom level. If input is generic (e.g. "zoom in", then only zoom to the next appropriate level - increase level for zooming in and decrease for zooming out.).',schema:Dr}),Te=[lr,pr,fr,vr,Er,Nr,qr,Lr,Or],Ve=Object.assign({"../agents/arcgisKnowledge/prompts/arcgis_knowledge_current_lc_context.md":()=>import("./LSGRWCAO.js").then(e=>e.default),"../agents/arcgisKnowledge/prompts/arcgis_knowledge_current_map_context.md":()=>import("./5X5GJH2L.js").then(e=>e.default),"../agents/arcgisKnowledge/prompts/arcgis_knowledge_lucene_generation_prompt.md":()=>import("./YVTKUITE.js").then(e=>e.default),"../agents/arcgisKnowledge/prompts/arcgis_knowledge_summarize_result_prompt.md":()=>import("./K6LVZHWM.js").then(e=>e.default),"../agents/arcgisKnowledge/prompts/arcgis_knowledge_tool_prompt.md":()=>import("./JKAITV5Q.js").then(e=>e.default),"../agents/dataExploration/prompts/data_explore_filter_prompt.md":()=>import("./MZJGADGH.js").then(e=>e.default),"../agents/dataExploration/prompts/data_explore_query_prompt.md":()=>import("./5PT7ZFXF.js").then(e=>e.default),"../agents/dataExploration/prompts/summarize_query_response_prompt.md":()=>import("./7EXACS27.js").then(e=>e.default),"../agents/help/prompts/help_prompt.md":()=>import("./ESTSYVJP.js").then(e=>e.default),"../agents/layerStyling/prompts/layer_styling_prompt.md":()=>import("./CFT5BBC6.js").then(e=>e.default),"../agents/navigation/prompts/navigation_intent_prompt.md":()=>import("./SFREIREB.js").then(e=>e.default),"../agents/navigation/prompts/navigation_tool_prompt.md":()=>import("./DMLSCJAM.js").then(e=>e.default)});async function k(e){let t=Object.entries(Ve).find(([r])=>r.endsWith(`/${e}.md`));if(!t)throw new Error(`Prompt not found: ${e}
4
+ Available prompts:
5
+ ${Object.keys(Ve).join(`
6
+ `)}`);return await t[1]()}async function Vr(e,t){let r=await k("navigation_tool_prompt"),{mapView:a}=$(t),o=a.map.bookmarks?.map(m=>m.name).filter(Boolean)??[],n=e.vectorSearchLayerResults?.length>0?e.vectorSearchLayerResults.map((m,b)=>`${b+1}. layerId=${m.id} | title=${m.title??""} | name=${m.name??""} | score=${m.score.toFixed(2)}`).join(`
7
+ `):"",i=e.vectorSearchFieldResults?.length>0?JSON.stringify(e.vectorSearchFieldResults,null,2):"",s=e.intent==="goToBookmark"&&o.length?`Available bookmarks:
8
+ ${o.map(m=>`- ${m}`).join(`
9
+ `)}`:"",d=(e.intent==="goToLayer"||e.intent==="goToFeatures")&&e.vectorSearchLayerResults?.length?`Candidate layers:
10
+ ${n}`:"",c=e.intent==="goToFeatures"&&e.vectorSearchFieldResults?.length?`Candidate fields:
11
+ ${i}`:"",p={intent:e.intent,bookmarksSection:s,layersSection:d,fieldsSection:c,currentZoom:a.zoom,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps},u=await j({promptText:r,modelTier:"fast",inputVariables:p,tools:Te}),h=(u.tool_calls?.length??0)>0,f=typeof u.text=="string"?u.text.trim():"",w=f.length>0;return{...e,navigationInternalState:{...e.navigationInternalState,toolCallMessage:h?u:void 0},outputMessage:h?e.outputMessage:f,status:h?e.status:w?"success":"failed"}}var R=(e,t=300)=>{let r=e.replace(/\s+/gu," ").replace(/[*_`#>\-]/gu,"").trim();return r.length>t?`${r.slice(0,t)}...`:r},Gr=e=>{let t=typeof e=="string"?e:String(e);try{let r=JSON.parse(t);if(r&&typeof r=="object"&&typeof r.text=="string")return r}catch{console.warn("Failed to parse tool response as JSON:",t)}return{text:t}};async function Pr(e,t){let r=new C(Te);try{let a=e.navigationInternalState.toolCallMessage;if(!a)throw new Error("navigationToolCalling: missing navigationInternalState.toolCallMessage");let{messages:o}=await r.invoke({messages:[a]},t),n="",i;for(let s of o){let d=Gr(s.content);d.text&&(n+=`${d.text}
12
+ `),d.sharedStatePatch&&(i={...i,...d.sharedStatePatch})}return await g({text:`Finished executing navigation tool: ${n}`},t),{...e,outputMessage:n,sharedStatePatch:i,status:"success",summary:n?R(n):"Navigation executed.",navigationInternalState:{...e.navigationInternalState,toolCallMessage:void 0}}}catch(a){let o=a instanceof Error?a.message:String(a);return await g({text:`Navigation tool execution failed: ${o}`},t),{...e,outputMessage:`Navigation tool execution failed: ${o}`,status:"failed",summary:`Navigation tool execution failed: ${o}`,navigationInternalState:{...e.navigationInternalState,toolCallMessage:void 0}}}}async function Qr(e,t){let r=await k("navigation_intent_prompt"),{mapView:a}=$(t),o=Te.map(u=>({name:u.name,description:u.description,schema:u.schema})),n=a.map.bookmarks?.map(u=>u.name).filter(Boolean)??[],i=n.length?`Available bookmarks:
13
+ ${n.map(u=>`- ${u}`).join(`
14
+ `)}`:"",s={tools:o.map(({name:u,description:h,schema:f})=>`${u}: ${h}, ${JSON.stringify(f)}`).join(`
15
+ `),bookmarks:i,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps},d=l.object({intent:l.string()}),c=await pe({promptText:r,inputVariables:s,schema:d,modelTier:"fast"}),p=typeof c.intent=="string"?c.intent.trim().replace(/^"|"$/gu,""):"";return{...e,intent:p||""}}var S=(e,t)=>{let r=e?.configurable?.services?.[t];if(r==null)throw new Error(`${t} missing in config.configurable.services`);return r},Br=.7,Kr=async(e,t)=>{try{await g({text:`Similarity search to find layers: ${e.agentExecutionContext.assignedTask}`},t);let r=S(t,"layerSearch"),a=S(t,"layersAndFieldsRegistry"),o=S(t,"embeddingCache"),n=(await r.searchLayers({text:e.agentExecutionContext.assignedTask,minScore:Br,embeddingCache:o})).map(({id:s,score:d})=>{let c=a.get(s)?.layerItem;return{id:s,title:c?.title,name:c?.name??void 0,score:d}}),i;return n.length>0?i=`Vector search completed. Matching layers:
16
+ ${n.map(s=>`- layerId=${s.id} | title=${s.title??""} | name=${s.name??""} | score=${s.score.toFixed(2)}`).join(`
17
+ `)}`:i="Vector search completed. No matching layers found.",await g({text:i},t),{...e,vectorSearchLayerResults:n}}catch(r){throw await g({text:`Error during vector search layers: ${r instanceof Error?r.message:String(r)}`},t),r}},Ge=.7,Ur=10,Hr=async(e,t)=>{try{await g({text:`Similarity search to find fields: ${e.agentExecutionContext.assignedTask}`},t);let r=S(t,"fieldSearch"),a=S(t,"layersAndFieldsRegistry"),o=S(t,"embeddingCache"),n=e.vectorSearchLayerResults?.map(d=>d.id)??[];if(n.length===0)return await g({text:"No candidate layers for field search"},t),e;let i=(await r.searchFields({text:e.agentExecutionContext.assignedTask,layerIds:n,minScore:Ge,topResults:Ur,embeddingCache:o})).map(({layerId:d,results:c})=>{let p=a.get(d)?.fieldRegistry;return{layerId:d,layerName:a.get(d)?.layerItem.name,results:c.map(u=>{let h=p?.get(u.name);return{name:u.name,score:u.score,type:h?.type,alias:h?.alias,description:h?.description,statistics:h?.statistics}})}}),s;return i.length>0?s=`Vector search completed. Matching layers and fields:
18
+ ${i.map(d=>`${d.layerName??d.layerId}:
19
+ ${d.results.map(c=>` - ${c.name} (${c.score.toFixed(2)})`).join(`
20
+ `)}`).join(`
21
+ `)}`:s=`No vector search field results found for score over ${Ge}.`,await g({text:s},t),{...e,vectorSearchFieldResults:i}}catch(r){throw await g({text:`Error during vector search fields: ${r instanceof Error?r.message:String(r)}`},t),r}},J=(e,t)=>(r,a)=>{let o=a?.configurable?.services;for(let n of e)if(!o?.[n])throw new Error(`${t} requires services.${n} to be available.`);return r},Wr=(e,t)=>J(["layerSearch","layersAndFieldsRegistry"],"Navigation Agent")(e,t),Zr=()=>new q(et).addNode("requireNavigationServices",Wr).addNode("intentLLM",Qr).addNode("vectorSearchLayers",Kr).addNode("vectorSearchFields",Hr).addNode("agent",Vr).addNode("tools",Pr).addEdge(F,"requireNavigationServices").addEdge("requireNavigationServices","intentLLM").addConditionalEdges("intentLLM",e=>e.intent==="goToLayer"||e.intent==="goToFeatures"?"vectorSearchLayers":"agent",{vectorSearchLayers:"vectorSearchLayers",agent:"agent"}).addConditionalEdges("vectorSearchLayers",e=>e.intent==="goToFeatures"?"vectorSearchFields":"agent",{vectorSearchFields:"vectorSearchFields",agent:"agent"}).addEdge("vectorSearchFields","agent").addEdge("agent","tools").addEdge("tools",T),Jr=String.raw`- **navigation** — Enables users to interact with the map by navigating to specific locations, layers, features, or extents.
22
+ 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.
23
+
24
+ Supported actions:
25
+ - **Zooming**: Adjust the map's zoom level (e.g., "Zoom to level 10", "Zoom in").
26
+ - **Viewpoints**: Navigate to a specific center point with optional zoom or scale (e.g., "Center the map on San Francisco at zoom level 16").
27
+ - **Scales**: Set the map to a specific scale (e.g., "Set the map scale to 1:50,000").
28
+ - **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
29
+ - **Features**: Zoom to features in a layer that match a filter (e.g., "Zoom to all schools in the city").
30
+ - **Bookmarks**: Navigate to a predefined bookmark extent (e.g., "Go to the Downtown bookmark").
31
+ - **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").
32
+ - **Addresses**: Zoom to an address or place name (e.g., "Zoom to 1600 Pennsylvania Ave").
33
+
34
+ _Example: “Zoom to Texas”_
35
+ _Example: “Go to the water mains layer”_
36
+ _Example: “Zoom to to the extent of my link chart”_
37
+ _Example: “Center the map on San Francisco at scale 50000”_
38
+ _Example: “Zoom to the features in the schools layer where city = 'Austin'”_
39
+ _Example: “Go to the Downtown bookmark”_
40
+ _Example: “Where is Mount Rainier?”_`,Ml={id:"navigation",name:"Navigation Agent",description:Jr,createGraph:Zr,workspace:et},tt=v.Root({...U(),vectorSearchLayerIds:v(),vectorSearchFieldResults:v(),layerFieldInfo:v(),queryResponse:v(),dataExplorationMessages:v({reducer:K,default:()=>[]})}),Yr=async(e,t)=>(await g({text:"Exiting Data Exploration agent"},t),e),Ee=async(e,t)=>{let r=e.tool_calls??[];if(r.length===0){await g({text:`LLM did not request any tool calls: ${String(e?.content)}`},t);return}await Promise.all(r.map(async a=>await g({text:`LLM invoked ${a.name} tool with arguments: ${JSON.stringify(a.args,null,2)}`},t)))},Xr=["mapView"];function L(e){let t=e?.configurable?.context;if(!t||typeof t!="object")throw new Error("DataExplorationAgent context missing");let r=Xr.filter(a=>!(a in t));if(r.length)throw new Error(`DataExplorationAgent context missing: ${r.join(", ")}`);return t}var ea=e=>{let t=e.map?.allLayers.filter(a=>a.type==="feature"),r=0;return t?.forEach(a=>{let o=a;o.featureEffect&&(o.featureEffect=null,r++)}),r>0?`Cleared filters from ${r} layer(s). View unchanged.`:"No active filters to clear. View unchanged."},ta=async(e,t)=>{let{mapView:r}=L(t);return ea(r)},ra=y(ta,{name:"clearFilters",description:"Clears all feature effects/filters from the map but does NOT change the current view. Use when user says 'clear filters', 'reset filters', 'remove filters', 'show all features', or wants to remove emphasis without navigating anywhere.",schema:l.object({})}),aa=async e=>{e.map?.allLayers.filter(r=>r.type==="feature")?.forEach(r=>{let a=r;a.featureEffect&&(a.featureEffect=null)});let t=e.map.initialViewProperties?.viewpoint?.targetGeometry;return t?(await e.goTo(t),"Cleared all filters and returned to home extent."):"Cleared all filters. Could not determine home extent."},oa=async(e,t)=>{let{mapView:r}=L(t);return await aa(r)},na=y(oa,{name:"resetMap",description:"Clears all feature effects/filters from the map AND zooms to the home extent (initial map view). Use when user says 'reset map', 'reset the map', 'start over', or wants to both clear filters and return to the initial view.",schema:l.object({})});function ne(e){return"point"in e&&e.point!==void 0}function W(e){return"layerId"in e&&e.layerId!==void 0}var le=async(e,t)=>{if(ne(e)){let{point:r}=e;return{geometry:new He({x:r.x,y:r.y,spatialReference:r.spatialReference?{wkid:r.spatialReference.wkid}:t.spatialReference})}}if(W(e)){let r=t.map?.allLayers.find(o=>o.id===e.layerId);if(!r)return{error:`Could not find geometry layer with ID: ${e.layerId}`};let a=r.title??r.id;try{let o=await r.queryFeatures({where:e.where,returnGeometry:!0,outSpatialReference:t.spatialReference});if(!o.features.length)return{error:`No features found in geometry layer "${a}" with the specified where clause: ${e.where}`};let n;if(o.features.length===1){let i=o.features[0].geometry;if(!i)return{error:"The geometry of the first feature is undefined or null."};n=i}else{let i=o.features.map(d=>d.geometry),s=Ze.executeMany(i);if(!s)return{error:"Failed to create a combined geometry."};n=s}return n.spatialReference||(n.spatialReference=t.spatialReference),{geometry:n}}catch(o){return{error:`Failed to query geometry: ${String(o)}`}}}return{error:"Invalid geometry configuration provided"}},ia=async(e,t,r,a,o,n)=>{let i=e.map?.allLayers.find(d=>d.id===t);if(!i)return{success:!1,error:`Layer '${t}' not found.`};let s=i.createQuery();s.where=r??"1=1",a&&(s.geometry=a,s.spatialRelationship="intersects",o&&(s.distance=o),n&&(s.units=n));try{let{extent:d,count:c}=await i.queryExtent(s);return!d||c===0?{success:!1,error:`No features found for filter (where: ${s.where}${a?", spatial filter used":""})`}:(await e.goTo(d),{success:!0})}catch(d){return{success:!1,error:d instanceof Error?d.message:String(d)}}},sa=async(e,t,r,a,o,n)=>{let i=t.map?.allLayers.find(u=>u.id===e.layerId);if(!i)return`Could not find target layer with ID: ${e.layerId}`;let s;if(o){let u=await le(o,t);if("error"in u)return u.error;s=u.geometry}if(i.featureEffect=null,i.featureEffect=new Mt({filter:new We({...e.objectIds?.length?{objectIds:e.objectIds}:{where:e.where},geometry:s,spatialRelationship:"intersects",distance:o?.distance,units:o?.units}),includedEffect:r,excludedEffect:a}),i.visible=!0,n)return`Applied feature effects to "${i.title??e.layerId}" within current map extent.`;let d=e.objectIds?.length?`${i.objectIdField} IN (${e.objectIds.join(",")})`:e.where,c=await ia(t,e.layerId,d,s,o?.distance,o?.units),p=i.title??e.layerId;return c.success?`Applied feature effects to target layer "${i.title??e.layerId}"${o&&"layerId"in o?` using geometry from layer "${o.layerId}"`:""}.`:`Applied filter to "${p}" but no features matched. ${c.error}`},la=["feet","kilometers","meters","miles","nautical-miles","us-nautical-miles"],z=l.enum(la),ca=async({targetLayer:e,geometryFilter:t,useCurrentExtent:r,includedEffect:a="drop-shadow(2px, 2px, 2px, gray)",excludedEffect:o="grayscale(100%) opacity(60%) blur(2px)"},n)=>{let{mapView:i}=L(n);return await sa(e,i,a,o,t,r)},da=l.object({layerId:l.string().describe("The layerId of the layer containing the geometry by which to filter."),where:l.string().describe("The SQL-92 where clause representing the features from which to filter."),distance:l.number().optional().describe("The buffer distance around the geometry."),units:z.optional().describe("The units for the distance buffer.")}),ua=l.object({point:l.object({x:l.number().describe("X coordinate (longitude) from navigation result"),y:l.number().describe("Y coordinate (latitude) from navigation result"),spatialReference:l.object({wkid:l.number().describe("Spatial reference WKID (e.g., 4326 for WGS84)")}).optional().describe("Spatial reference. Defaults to map's spatial reference if not provided.")}).describe("Point coordinates from a previous navigation/geocoding result"),distance:l.number().optional().describe("Optional buffer distance around the point."),units:z.optional().describe("The units for the distance buffer.")}),pa=l.object({targetLayer:l.object({layerId:l.string().describe("The layerId of the layer on which to set a feature effect."),where:l.string().describe("The SQL-92 where clause representing the features to emphasize."),objectIds:l.array(l.number()).optional().describe("Array of objectIds from a previous query result. Use this instead of a where clause when the query returned objectIds (e.g. top N results). If provided, takes precedence over where clause.")}),geometryFilter:l.union([da,ua]).optional().describe("Optional geometry-based filtering parameters for spatial queries."),useCurrentExtent:l.boolean().optional().describe("Set to true when the previous query used the current map extent as a spatial filter. This ensures the feature effect applies only to features visible in the current view. Default is false."),includedEffect:l.string().default("drop-shadow(2px, 2px, 2px, gray)").describe("The effect applied to features that meet the filter requirements. Valid effects include: bloom, blur, brightness, contrast, drop-shadow, grayscale, hue-rotate, invert, opacity, saturate, and sepia. Prefer default unless specified."),excludedEffect:l.string().default("grayscale(100%) opacity(60%) blur(2px)").describe("The effect applied to features that do not meet the filter requirements. Valid effects include: bloom, blur, brightness, contrast, drop-shadow, grayscale, hue-rotate, invert, opacity, saturate, and sepia. Prefer default unless specified.")}),ha=y(ca,{name:"setFeatureEffect",description:"Sets a feature effect on a given layer with given filter parameters and feature effects to emphasize certain features that meet a filter requirement. If no feature effect information is provided, then use the default effect provided.",schema:pa}),fe=e=>{if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e=="number"&&Number.isFinite(e)){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}return null},ma=e=>!e||e==="system"?Intl.DateTimeFormat().resolvedOptions().timeZone:e==="unknown"?"UTC":e,ga=e=>{if(typeof e=="string"&&e)return e;let t=fe(e);return t?t.toISOString().slice(0,10):null},rt=()=>{let e=new Date().getTimezoneOffset(),t=e<=0?"+":"-",r=Math.floor(Math.abs(e)/60).toString().padStart(2,"0"),a=(Math.abs(e)%60).toString().padStart(2,"0"),o=`${t}${r}:${a}`;return{userTimezone:Intl.DateTimeFormat().resolvedOptions().timeZone,userTimezoneOffset:o}},fa=(e,t,r)=>{let a=t?.toLowerCase();if(a==="date-only"){let n=ga(e);return n?qt(n,ae("short-date")):e}if(a==="time-only"){if(typeof e=="string"&&e)return Ct(e,ae("long-time"));let n=fe(e);return n?Le(n,{...ae("long-time"),timeZone:"UTC"}):e}let o=fe(e);return o?Le(o,{...ae("short-date-short-time"),timeZone:ma(r)}):e},at=(e,t,r)=>{if(e&&typeof e!="function"){let a="getField"in r&&r.getField?.(e),o=a&&"getFieldDomain"in r&&r.getFieldDomain?r.getFieldDomain(a.name):null;if(o?.type==="coded-value"){let n=o.codedValues.find(i=>i.code===t);return n?n.name:null}}return null},ya=e=>!e||e==="system"?Intl.DateTimeFormat().resolvedOptions().timeZone:e==="unknown"?"UTC":e,wa=e=>{if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e=="number"&&Number.isFinite(e)){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}if(typeof e=="string"&&e){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}return null},ba=(e,t)=>{if(typeof e!="number")return e;let r={};t.minimumFractionDigits!==void 0&&(r.minimumFractionDigits=t.minimumFractionDigits),t.maximumFractionDigits!==void 0&&(r.maximumFractionDigits=t.maximumFractionDigits),t.useGrouping==="always"?r.useGrouping=!0:t.useGrouping==="never"&&(r.useGrouping=!1);try{return new Intl.NumberFormat(void 0,r).format(e)}catch{return e}},va=(e,t,r)=>{let a=wa(e);if(!a)return e;let o={};t.dateStyle?o.dateStyle=t.dateStyle:(t.year&&(o.year=t.year),t.month&&(o.month=t.month)),t.timeStyle&&(o.timeStyle=t.timeStyle),t.timeStyle&&t.hour12==="always"?o.hour12=!0:t.timeStyle&&t.hour12==="never"&&(o.hour12=!1),o.timeZone=ya(r);try{return new Intl.DateTimeFormat(void 0,o).format(a)}catch{return e}},ot=(e,t)=>e.getFieldAlias?.(t)??e.fieldsIndex?.get(t)?.alias??e.fieldsIndex?.get(t)?.name??t,nt=(e,t,r,a,o)=>{if(r==null)return r;let n=e.getFieldConfiguration?.(t)?.fieldFormat;return n?.type==="number"?ba(r,n):n?.type==="date-time"?va(r,n,o):fa(r,a,o)},xa=(e,t,r,a)=>{let o=e.fieldsIndex?.get(t),n=at(t,r,e)??r;return nt(e,t,n,o?.type,a)},Sa=(e,t)=>ot(e,t),it=(e,t,r)=>{let a=e.objectIdField,o=t.features.map(i=>i.attributes[a]),n=t.features.map(i=>{let s=i.attributes,d={};return e.fields.forEach(c=>{if(!Object.hasOwn(s,c.name))return;let p=s[c.name];if(c.name===a){d[c.name]=p;return}let u=at(c.name,p,e)??p,h=ot(e,c.name);d[h]=nt(e,c.name,u,c.type,r)}),d});return{objectIds:o,attributes:n}},Ta=(e,t,r)=>{let a=e.createQuery();return a.outFields=[t],a.where=r||"1=1",a.num=1,a},Ea=async(e,t,r,a)=>{let o=a.map?.allLayers.find(p=>p.id===e),n=Ta(o,t,r.where),i=(await o.queryFeatures(n)).features[0],s=i?i.attributes[t]:null,d=xa(o,t,s,a.timeZone),c=Sa(o,t);return{tool:"getAttribute",layerName:o.title??e,summary:`${c} = ${d}`,details:{fieldName:t,fieldAlias:c!==t?c:void 0,value:d,where:r.where}}};async function Ia({layerId:e,fieldName:t,query:r},a){let{mapView:o}=L(a),n=await Ea(e,t,r,o);return JSON.stringify(n,null,2)}var ka=l.object({layerId:l.string().describe("The layerId of the layer containing the field from which to get a value."),fieldName:l.string().describe("The name of the field/attribute from which to get a field value."),query:l.object({where:l.string().describe("The SQL-92 where clause representing the feature from which to get an attribute value.")})}),$a=y(Ia,{name:"getAttribute",description:"Returns an attribute value for a given feature.",schema:ka}),Ie=(e,t,r)=>r?e.hasAllFeaturesInView&&e.availableFields===t:e.hasAllFeatures&&e.availableFields===t;function ie(e,t){let r=e??"";return t!=null&&t&&(r=r?`(${r}) AND (${t})`:t),r||null}var Na=async e=>{let{targetLayer:t,fieldName:r,statisticType:a,mapView:o,layersAndFieldsRegistry:n,geometryFilter:i}=e,s=o.map?.allLayers.find(x=>x.id===t.layerId);if(!s)throw new Error(`Layer '${t.layerId}' not found.`);let d=await o.whenLayerView(s),c=n.get(t.layerId)?.fieldRegistry.get(r),p=c?.alias;if(!c)throw new Error(`Field '${r}' not found.`);let u,h;if(i){let x=await le(i,o);if("error"in x)throw new Error(x.error);if(!x.geometry)throw W(i)?new Error(`No features found matching: ${i.where}`):new Error("Failed to create geometry");if(W(i)){let E=o.map?.allLayers.find(_=>_.id===i.layerId);u={geometryLayerName:E?.title??E?.id,geometryLayerId:i.layerId,geometryWhere:i.where,distance:i.distance,units:i.units,applied:!0}}else ne(i)&&(u={point:i.point,distance:i.distance,units:i.units,applied:!0});h=new We({geometry:x.geometry,distance:i.distance,units:i.units,spatialRelationship:"intersects"})}let f=Ie(d,[r],!1),w=null,m=null,b=10;if(c.type!=="geometry"&&c.type!=="oid"&&c.type!=="global-id")try{let x={layer:s,useFeaturesInView:f,view:f?o:void 0,field:r,sqlWhere:ie(s.definitionExpression,t.where),...h&&{filter:h},outStatisticTypes:{include:[a]}};w=await Je(x);let E=["string","small-integer","integer"],_=c.domain?.type==="coded-value"?c.domain:null;(E.includes(c.type)||_)&&(m=(await Ye({layer:s,useFeaturesInView:f,view:f?o:void 0,field:r,sqlWhere:ie(s.definitionExpression,t.where),...h&&{filter:h}})).uniqueValueInfos.sort((A,Y)=>Y.count-A.count).slice(0,b)),m&&c.domain?.type==="coded-value"&&(m=m.map(A=>({...A,value:_?_.getName(A.value)??A.value:A.value})))}catch(x){console.error("Statistics error:",x)}return{tool:"getStatistics",layerName:s.title??t.layerId,summary:`${a} = ${typeof w?.[a]=="number"?w[a]:"N/A"}`,details:{fieldName:r,fieldAlias:p,statisticType:a,statistic:w?.[a]??null,summaryStatistics:w,uniqueValues:m,where:t.where,spatialFilterInfo:u}}};async function _a({targetLayer:e,fieldName:t,statisticType:r,geometryFilter:a},o){let n=S(o,"layersAndFieldsRegistry"),{mapView:i}=L(o),s=await Na({targetLayer:e,fieldName:t,statisticType:r,mapView:i,layersAndFieldsRegistry:n,geometryFilter:a});return JSON.stringify(s,null,2)}var Fa=l.object({layerId:l.string().describe("The layerId of the layer containing the geometry by which to filter."),where:l.string().describe("The SQL-92 where clause representing the features from which to filter."),distance:l.number().optional().describe("The buffer distance around the geometry."),units:z.optional().describe("The units for the distance buffer.")}),Ma=l.object({point:l.object({x:l.number().describe("X coordinate (longitude) from navigation result"),y:l.number().describe("Y coordinate (latitude) from navigation result"),spatialReference:l.object({wkid:l.number().describe("Spatial reference WKID (e.g., 4326 for WGS84)")}).optional().describe("Spatial reference. Defaults to map's spatial reference if not provided.")}).describe("Point coordinates from a previous navigation/geocoding result"),distance:l.number().optional().describe("Optional buffer distance around the point."),units:z.optional().describe("The units for the distance buffer.")}),qa=l.object({targetLayer:l.object({layerId:l.string().describe("The layerId of the layer containing the field from which to get a value."),where:l.string().describe("The SQL-92 where clause representing the feature from which to get an attribute value.")}),geometryFilter:l.union([Fa,Ma]).optional().describe("Geometry filter for spatial queries. Use 'point' option with x/y coordinates from navigation results to find features at that location (point-in-polygon). Use 'layerId/where' option to filter by features from another layer."),fieldName:l.string().describe("The name of the field for which to get statistics. STRICTLY DO NOT use OBJECTID. Use any other field"),statisticType:l.enum(["avg","max","median","min","stddev","sum","variance","nullcount","count"]).describe("The statistic type to calculate.")}),Ca=y(_a,{name:"getStatistics",description:`Computes a single aggregate statistic (max, min, avg, sum, median, stddev, variance) for a numeric field across matching features. Also returns frequency analysis for categorical fields.
41
+
42
+ USE THIS TOOL FOR:
43
+ - "What is the average/maximum/minimum/total [field]?" \u2014 aggregate computations
44
+ - "Most common/frequent value of [field]?" \u2014 frequency analysis
45
+ - Questions requiring a mathematical aggregation across many features
46
+
47
+ DO NOT USE FOR:
48
+ - "How many features match X?" \u2014 use queryFeatures instead (it returns totalCount)
49
+ - "Show / list / find features" \u2014 use queryFeatures instead
50
+ - Simple counts of features matching a condition \u2014 use queryFeatures instead
51
+
52
+ Only call this tool when the answer requires computing an aggregate (avg, max, min, sum, median, stddev) over a field's values, not just counting or listing features.`,schema:qa}),Aa=async(e,t,r,a,o)=>{let n=r.map?.allLayers.find(h=>h.id===e.layerId),i=await r.whenLayerView(n),s=n.title??e.layerId,d;if(a){let h=await le(a,r);if("error"in h)return{tool:"getTopFeatures",layerName:s,summary:"Geometry lookup failed",details:{error:h.error}};if(!h.geometry)return{tool:"getTopFeatures",layerName:s,summary:"No features found for geometry filter",details:{error:`No features found matching: ${"where"in a?a.where:"unknown criteria"}`}};d=h.geometry}else o&&(d=r.extent.clone());let c=t.groupByFields&&t.groupByFields.length>0,p=n.objectIdField,u=e.outFields.includes("*")?["*"]:[...new Set([...e.outFields,p])];try{let h;if(c){let m=new At({where:e.where||"1=1",outFields:u,orderByFields:e.orderByFields,geometry:d,spatialRelationship:d?"intersects":void 0,distance:a?.distance,units:a?.units,topFilter:new Rt({topCount:t.topCount,groupByFields:t.groupByFields,orderByFields:t.orderByFields})});h=await n.queryTopFeatures(m)}else{let m=n.createQuery();m.where=ie(n.definitionExpression,e.where||"1=1"),m.outFields=u.length?u:["*"],m.orderByFields=t.orderByFields,m.num=t.topCount,d&&(m.geometry=d,m.spatialRelationship="intersects"),a?.distance&&(m.distance=a.distance),a?.units&&(m.units=a.units),m.outSpatialReference=r.spatialReference;let b=Ie(i,e.outFields,o??!1);try{h=b?await i.queryFeatures(m):await n.queryFeatures(m)}catch(x){console.warn("Client-side query failed, falling back to server:",x),h=await n.queryFeatures(m)}}let f=h.features.map(m=>m.attributes[p]),{attributes:w}=it(n,h,r.timeZone);return{tool:"getTopFeatures",layerName:s,summary:`Top ${t.topCount} features extracted`,details:{topCount:t.topCount,attributes:w,objectIds:f,objectIdField:p,where:e.where,orderByFields:t.orderByFields,...c&&{groupByFields:t.groupByFields}}}}catch(h){return{tool:"getTopFeatures",layerName:s,summary:"Query failed",details:{error:h instanceof Error?h.message:String(h)}}}},Ra=async({targetLayer:e,topFilter:t,geometryFilter:r,useCurrentExtent:a},o)=>{let{mapView:n}=L(o),i=await Aa(e,t,n,r,a);return JSON.stringify(i,null,2)},La=l.object({layerId:l.string().describe("The layerId of the layer containing the geometry by which to filter."),where:l.string().describe("The SQL-92 where clause representing the features from which to filter."),distance:l.number().optional().describe("The buffer distance around the geometry."),units:z.optional().describe("The units for the distance buffer.")}),za=l.object({point:l.object({x:l.number().describe("X coordinate (longitude) from navigation result"),y:l.number().describe("Y coordinate (latitude) from navigation result"),spatialReference:l.object({wkid:l.number().describe("Spatial reference WKID (e.g., 4326 for WGS84)")}).optional().describe("Spatial reference. Defaults to map's spatial reference if not provided.")}).describe("Point coordinates from a previous navigation/geocoding result"),distance:l.number().optional().describe("Optional buffer distance around the point."),units:z.optional().describe("The units for the distance buffer.")}),ja=l.object({targetLayer:l.object({layerId:l.string().describe("The layerId of the layer containing the field from which to get a value."),where:l.string().describe("The SQL-92 where clause representing the feature from which to get an attribute value."),orderByFields:l.array(l.string().describe("The field(s) and order for which to sort the resulting features.")),outFields:l.array(l.string().describe('The fields to include in the output that will be presented to the user. This should include identifying information about the resulting features, like a name or id, along with the values desired in the output. If unsure, choose all fields ("*").').default("*"))}),geometryFilter:l.union([La,za]).optional().describe("Geometry filter for spatial queries. Use 'point' option with x/y coordinates from navigation results to find features at that location (point-in-polygon). Use 'layerId/where' option to filter by features from another layer."),topFilter:l.object({topCount:l.number().describe("Number of top features to return per group."),orderByFields:l.array(l.string().describe("Field(s) to rank by with ASC/DESC. Must be existing field names, not aggregate functions.")),groupByFields:l.array(l.string().describe("Field(s) to group results by. Returns top N per group."))}),useCurrentExtent:l.boolean().optional().describe("Set to true ONLY when user explicitly asks about features 'in my view', 'on my map', 'I am looking at'. Default is false (queries entire layer).")}),Da=y(Ra,{name:"getTopFeatures",description:'Returns top N features ranked by an existing field value. Use for "highest", "lowest", "top N" questions where ranking is based on a field that already exists in the data (e.g., population, value, date, depth). orderByFields must be actual field names with ASC/DESC. Do NOT use aggregate functions like COUNT(), SUM(), AVG() - those require getStatistics.',schema:ja}),ge=25,Oa=async(e,t,r,a)=>{let o=t.map?.allLayers.find(m=>m.id===e.layerId),n=await t.whenLayerView(o),i=o.title??e.layerId,s;if(r){let m=await le(r,t);if("error"in m){let b={error:m.error};if(W(r)){let x=t.map?.allLayers.find(E=>E.id===r.layerId);b.geometryLayerName=x?.title??x?.id,b.geometryLayerId=r.layerId,b.geometryWhere=r.where}else ne(r)&&(b.point=r.point);return{tool:"queryFeatures",layerName:i,summary:"Geometry lookup failed",details:b}}if(!m.geometry){let b={};if(W(r)){let x=t.map?.allLayers.find(E=>E.id===r.layerId);b.error=`No features found matching: ${r.where}`,b.geometryLayerName=x?.title??x?.id,b.geometryLayerId=r.layerId,b.geometryWhere=r.where}else ne(r)&&(b.error="Failed to create point geometry",b.point=r.point);return{tool:"queryFeatures",layerName:i,summary:"No features found for geometry filter",details:b}}s=m.geometry}else a&&(s=t.extent.clone());let d=Ie(n,e.outFields,a??!1),c=o.objectIdField,p=o.createQuery();p.where=ie(o.definitionExpression,e.where||"1=1"),p.outFields=e.outFields.includes("*")?["*"]:[...new Set([...e.outFields,c])],p.orderByFields=e.orderByFields,s&&(p.geometry=s,p.spatialRelationship="intersects"),r?.distance&&(p.distance=r.distance),r?.units&&(p.units=r.units),p.outSpatialReference=t.spatialReference;let u,h;try{u=d?await n.queryFeatureCount(p):await o.queryFeatureCount(p),u>0&&u<=ge&&(h=d?await n.queryFeatures(p):await o.queryFeatures(p))}catch(m){console.warn("Client-side query failed, falling back to server:",m),u=await o.queryFeatureCount(p),u>0&&u<=ge&&(h=await o.queryFeatures(p))}let{objectIds:f,attributes:w}=h?it(o,h,t.timeZone):{objectIds:void 0,attributes:void 0};return{tool:"queryFeatures",layerName:i,summary:`${u} features found`,details:{totalCount:u,where:e.where,orderByFields:e.orderByFields,outFields:e.outFields,...f&&{objectIds:f,objectIdField:c},...w&&{attributes:w},...u>ge&&{note:`${u} features found.`}}}};async function Va({targetLayer:e,geometryFilter:t,useCurrentExtent:r},a){let{mapView:o}=L(a),n=await Oa(e,o,t,r);return JSON.stringify(n,null,2)}var Ga=l.object({layerId:l.string().describe("The layerId of the layer containing the geometry by which to filter."),where:l.string().describe("The SQL-92 where clause representing the features from which to filter."),distance:l.number().optional().describe("The buffer distance around the geometry."),units:z.optional().describe("The units for the distance buffer.")}),Pa=l.object({point:l.object({x:l.number().describe("X coordinate (longitude) from navigation result"),y:l.number().describe("Y coordinate (latitude) from navigation result"),spatialReference:l.object({wkid:l.number().describe("Spatial reference WKID (e.g., 4326 for WGS84)")}).optional().describe("Spatial reference. Defaults to map's spatial reference if not provided.")}).describe("Point coordinates from a previous navigation/geocoding result"),distance:l.number().optional().describe("Optional buffer distance around the point."),units:z.optional().describe("The units for the distance buffer.")}),Qa=l.object({targetLayer:l.object({layerId:l.string().describe("The layerId of the layer containing the field from which to get a value."),where:l.string().describe("SQL-92 where clause. IMPORTANT: When using geometryFilter.point for point-in-polygon queries, set this to '1=1' to return all features that intersect the point. Only add attribute filters if the user specifically requests them in addition to the spatial query."),orderByFields:l.array(l.string().describe("The field(s) and order for which to sort the resulting features.")),outFields:l.array(l.string().describe('The fields to include in the output that will be presented to the user. This should include identifying information about the resulting features, like a name or id, along with the values desired in the output. If unsure, choose all fields ("*").').default("*"))}),geometryFilter:l.union([Ga,Pa]).optional().describe("Geometry filter for spatial queries. Use 'point' option with x/y coordinates from navigation results to find features at that location (point-in-polygon). Use 'layerId/where' option to filter by features from another layer."),useCurrentExtent:l.boolean().optional().describe("Set to true ONLY when user explicitly asks about features 'in my view', 'on my map', 'I am looking at', OR when the user refers back to features previously identified using the current extent (e.g. 'these', 'those', 'them', 'the same ones'). Default is false (queries entire layer).")}),Ba=y(Va,{name:"queryFeatures",description:`Queries features from a layer. Returns the total count of matching features, plus individual feature attributes if \u226425 features match.
53
+
54
+ USE THIS TOOL FOR:
55
+ - "Show / display / list features where..." \u2014 finding and listing features
56
+ - "How many X are Y?" \u2014 counting features that match a condition
57
+ - "Which features..." / "Find features..." \u2014 identifying specific features
58
+ - Spatial queries \u2014 finding features near/within/intersecting other features
59
+ - Any question where the user wants to SEE or COUNT matching features
60
+
61
+ This is the DEFAULT tool for most queries. When in doubt, use this tool.`,schema:Qa}),st=[$a,Ca,Da,Ba],lt=[ha,na,ra],Ka=async(e,t)=>{await g({text:"Requesting LLM for layer filter results"},t);let r=await k("data_explore_filter_prompt");if(!t?.configurable)throw new Error("config.configurable is required for layer filter tools");let{userTimezone:a,userTimezoneOffset:o}=rt(),n={layerFieldInfo:e.layerFieldInfo,userTimezone:a,userTimezoneOffset:o,queryResponse:e.queryResponse,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps},i=await j({promptText:r,modelTier:"advanced",messages:e.dataExplorationMessages,inputVariables:n,tools:lt}),s=[...e.dataExplorationMessages,i];if(!((i.tool_calls?.length??0)>0))return await g({text:"LLM determined no filter changes needed"},t),{...e,dataExplorationMessages:s};let d=[...s,i],c=i.content.toString();return await Ee(i,t),{...e,dataExplorationMessages:d,outputMessage:c}},Ua=async(e,t)=>{await g({text:"Requesting LLM for layer query results"},t);let r=await k("data_explore_query_prompt");if(!t?.configurable)throw new Error("config.configurable is required for layer query tools");let{userTimezone:a,userTimezoneOffset:o}=rt(),n={layerFieldInfo:e.layerFieldInfo,userTimezone:a,userTimezoneOffset:o,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps},i=await j({promptText:r,modelTier:"advanced",messages:e.dataExplorationMessages,inputVariables:n,tools:st}),s=i.content.toString();return await Ee(i,t),{...e,dataExplorationMessages:[...e.dataExplorationMessages,i],outputMessage:s,status:"success",summary:s?R(s):"Query executed."}},Ha=async(e,t)=>{try{await g({text:"Requesting LLM for summary on query results"},t);let r=await k("summarize_query_response_prompt"),a={queryResponse:e.queryResponse,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps},o=await ue({promptText:r,modelTier:"fast",messages:e.dataExplorationMessages,inputVariables:a}),n=typeof o=="string"?o:o.content,i=new re(n);await g({text:`Received response from LLM: ${n}`},t);let s=n;return{...e,outputMessage:s,status:"success",summary:s?R(s):"Summary generated.",dataExplorationMessages:[...e.dataExplorationMessages,i]}}catch(r){throw await g({text:"Error during filter LLM request"},t),new Error(`Error during filter LLM request: ${r instanceof Error?r.message:String(r)}`)}};async function Wa(e,t){let r=await new C(lt).invoke({messages:e.dataExplorationMessages},t);return await g({text:`Finished executing layer filter tool: ${r.messages.map(a=>a.content).join(", ")}`},t),{...e}}var Za=new C(st);async function Ja(e,t){let{messages:r}=await Za.invoke({messages:e.dataExplorationMessages},t),a=[],o=[];for(let n of r){let i=n.content,s;typeof i!="string"&&(s={tool:n.name??"unknown",layerName:"unknown",summary:"Query failed",details:{error:"Skipping non-string tool output:",raw:i}});try{typeof i=="string"?s=JSON.parse(i):s={tool:n.name??"unknown",layerName:"unknown",summary:"Query failed",details:{error:"Invalid tool output type",raw:i}}}catch{s={tool:n.name??"unknown",layerName:"unknown",summary:"Query failed",details:{error:i}}}a.push(s),s.details&&typeof s.details=="object"&&"error"in s.details?o.push(`- ${s.tool}: Error - ${String(s.details.error)}`):o.push(`- ${s.layerName}: ${s.summary}`)}return await g({text:`Finished executing layer query tool: ${o.join(", ")}`},t),{...e,dataExplorationMessages:[...e.dataExplorationMessages,...r],queryResponse:a,status:"success",outputMessage:o.join(`
62
+ `),summary:o.length>0?R(o.join(`
63
+ `)):"Query executed."}}var Ya=10,Xa=["string","small-integer","integer"],eo=async(e,t,{includeSummaryStatistics:r=!0,includeUniqueValues:a=!0}={})=>{let o=null,n=null;try{if(t.type!=="geometry"&&t.type!=="oid"&&t.type!=="global-id"){r&&(o=await Je({layer:e,field:t.name}));let i=t.domain?.type==="coded-value"?t.domain:null;a&&(Xa.includes(t.type)||i)&&(n=(await Ye({layer:e,field:t.name})).uniqueValueInfos.sort((s,d)=>d.count-s.count).slice(0,Ya),i&&(n=n.map(s=>({...s,value:i.getName(s.value)??s.value}))))}}catch(i){console.error(`Error fetching statistics for field ${t.name}:`,i)}return{summaryStatistics:o,uniqueValues:n}};function to(e,t){return["string","small-integer","integer"].includes(e)||t==="coded-value"}async function ro(e,t,r,a=!0){let o=[],n=[],i=[];for(let s of e){let d=function(w){let m=t.get(w)?.layerItem;return m?[m.name&&`Name: ${m.name}`,m.title&&`Title: ${m.title}`,m.description&&`Description: ${m.description}`].filter(Boolean).join(" | "):w},{layerId:c,results:p}=s,u=r.map?.allLayers.find(w=>w.id===c),h=t.get(c)?.fieldRegistry;if(!h)continue;let f=o.find(w=>w.layerId===c);f||(f={layerId:c,layerSummary:d(c),fieldInfos:[]},o.push(f));for(let w of p){let m=h.get(w.name);if(!m)continue;let b=m.statistics,x=a&&!b?.summaryStatistics,E=to(m.type,m.domain?.type)&&!b?.uniqueValues,_=x||E;if(i.push({layerId:c,fieldName:m.name,didFetchStatistics:_}),_){let A=eo(u,m,{includeSummaryStatistics:x,includeUniqueValues:E}).then(Y=>{let X={summaryStatistics:b?.summaryStatistics??null,uniqueValues:b?.uniqueValues??null};x&&(X.summaryStatistics=Y.summaryStatistics),E&&(X.uniqueValues=Y.uniqueValues),h.set(m.name,{...m,statistics:X}),m.statistics=X});n.push(A)}f.fieldInfos.push(m)}}return await Promise.all(n),{layerFieldInfo:o,didFetchStatistics:n.length>0,fieldStatisticsFetchStatus:i}}var Pe=/\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;function ao(e,t){return Pe.test(e)||Pe.test(t)}var oo=async(e,t)=>{try{await g({text:"Preparing field information for vector search results"},t);let r=S(t,"layersAndFieldsRegistry"),{mapView:a}=L(t),{assignedTask:o,userRequest:n}=e.agentExecutionContext,i=ao(o,n),{layerFieldInfo:s,didFetchStatistics:d,fieldStatisticsFetchStatus:c}=await ro(e.vectorSearchFieldResults,r,a,i);d?await g({text:"Statistics fetched"},t):await g({text:"Statistics skipped"},t);for(let p of c)await g({text:` - ${p.fieldName} - stats ${p.didFetchStatistics?"fetched":"skipped"}`},t);return await g({text:"Field information prepared"},t),{...e,layerFieldInfo:s}}catch(r){throw await g({text:"Error during fetching statistics"},t),new Error(`Error during fetching statistics: ${r instanceof Error?r.message:String(r)}`)}},Qe=.7,no=10,io=async(e,t)=>{try{await g({text:"Similarity search to find fields"},t);let r=S(t,"fieldSearch"),a=S(t,"layersAndFieldsRegistry"),o=S(t,"embeddingCache"),n=await r.searchFields({text:e.agentExecutionContext.assignedTask,layerIds:e.vectorSearchLayerIds,minScore:Qe,topResults:no,embeddingCache:o}),i=n.map(({layerId:d,results:c})=>{let p=c.map(u=>` - ${u.name} (${u.score.toFixed(2)})`).join(`
64
+ `);return`${a.get(d)?.layerItem.name??d}:
65
+ ${p}`}).join(`
66
+ `),s;return n.length>0?s=`Vector search completed. Matching layers and fields with scores:
67
+ ${i}`:s=`No vector search results found for score over ${Qe}.`,await g({text:s},t),{...e,vectorSearchFieldResults:n}}catch(r){throw await g({text:`Error during vector search: ${r instanceof Error?r.message:String(r)}`},t),new Error(`Vector search failed: ${r instanceof Error?r.message:String(r)}`)}},so=.7,lo=async(e,t)=>{try{await g({text:`Similarity search to find layers: ${e.agentExecutionContext.assignedTask}`},t);let r=S(t,"layerSearch"),a=S(t,"layersAndFieldsRegistry"),o=S(t,"embeddingCache"),n=await r.searchLayers({text:e.agentExecutionContext.assignedTask,minScore:so,embeddingCache:o}),i=n.map(c=>c.id),s=n.map(({id:c,score:p})=>`${a.get(c)?.layerItem.name??c} (${p.toFixed(2)})`).join(`
68
+ `),d;return i.length>0?d=`Vector search completed. Matching layers with scores:
69
+ ${s}`:d="Vector search completed. No matching layers found.",await g({text:d},t),{...e,vectorSearchLayerIds:i}}catch(r){throw await g({text:`Error during vector search: ${r instanceof Error?r.message:String(r)}`},t),new Error(`Vector search failed: ${r instanceof Error?r.message:String(r)}`)}},co=(e,t)=>J(["layerSearch","fieldSearch","layersAndFieldsRegistry"],"Data Exploration Agent")(e,t),uo=()=>new q(tt).addNode("requireDataExplorationServices",co).addNode("vectorSearchLayers",lo).addNode("vectorSearchFields",io).addNode("fieldStatistics",oo).addNode("queryAgent",Ua).addNode("queryTools",Ja).addNode("summarizeQueryResponseLLM",Ha).addNode("filterAgent",Ka).addNode("filterTools",Wa).addNode("earlyExit",Yr).addEdge(F,"requireDataExplorationServices").addEdge("requireDataExplorationServices","vectorSearchLayers").addConditionalEdges("vectorSearchLayers",e=>e.vectorSearchLayerIds.length?"vectorSearchFields":"earlyExit").addConditionalEdges("vectorSearchFields",e=>e.vectorSearchFieldResults.length?"fieldStatistics":"earlyExit").addEdge("fieldStatistics","queryAgent").addConditionalEdges("queryAgent",e=>(e.dataExplorationMessages[e.dataExplorationMessages.length-1]?.tool_calls?.length??0)>0?"queryTools":"filterAgent").addConditionalEdges("queryTools",e=>e.queryResponse.length?"summarizeQueryResponseLLM":"filterAgent").addEdge("summarizeQueryResponseLLM","filterAgent").addConditionalEdges("filterAgent",e=>(e.dataExplorationMessages[e.dataExplorationMessages.length-1]?.tool_calls?.length??0)>0?"filterTools":T).addEdge("filterTools",T).addEdge("earlyExit",T),po=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).
70
+ 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.
71
+ _Example: “Only show stations where Brand is Shell”_
72
+ _Example: “Make Shell stations stand out on the map”_
73
+ _Example: “Gray out all stations that aren’t Shell”_
74
+ 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.
75
+ _Example: “How many features are there?”_
76
+ _Example: “What’s the average population?”_
77
+ _Example: “Which values are in the status field?”_`,ql={id:"dataExploration",name:"Data Exploration Agent",description:po,createGraph:uo,workspace:tt},Be=.7,ho=10,mo=async(e,t)=>{try{await g({text:"Similarity search to find fields"},t);let r=S(t,"fieldSearch"),a=S(t,"layersAndFieldsRegistry"),o=S(t,"embeddingCache"),n=await r.searchFields({text:e.agentExecutionContext.assignedTask,layerIds:e.vectorSearchLayerIds,minScore:Be,topResults:ho,embeddingCache:o}),i=n.map(({layerId:d,results:c})=>{let p=c.map(u=>` - ${u.name} (${u.score.toFixed(2)})`).join(`
78
+ `);return`${a.get(d)?.layerItem.name??d}:
79
+ ${p}`}).join(`
80
+ `),s;return n.length>0?s=`Vector search completed. Matching layers and fields with scores:
81
+ ${i}`:s=`No vector search results found for score over ${Be}.`,await g({text:s},t),{...e,vectorSearchFieldResults:n}}catch(r){throw await g({text:`Error during vector search: ${r instanceof Error?r.message:String(r)}`},t),new Error(`Vector search failed: ${r instanceof Error?r.message:String(r)}`)}},go=.7,fo=async(e,t)=>{try{await g({text:`Similarity search to find layers: ${e.agentExecutionContext.assignedTask}`},t);let r=S(t,"layerSearch"),a=S(t,"layersAndFieldsRegistry"),o=await r.searchLayers({text:e.agentExecutionContext.assignedTask,minScore:go}),n=o.map(d=>d.id),i=o.map(({id:d,score:c})=>`${a.get(d)?.layerItem.name??d} (${c.toFixed(2)})`).join(`
82
+ `),s;return n.length>0?s=`Vector search completed. Matching layers with scores:
83
+ ${i}`:s="Vector search completed. No matching layers found.",await g({text:s},t),{...e,vectorSearchLayerIds:n}}catch(r){throw await g({text:`Error during vector search: ${r instanceof Error?r.message:String(r)}`},t),new Error(`Vector search failed: ${r instanceof Error?r.message:String(r)}`)}};async function yo(e){let{fields:t,layer:r,view:a,styleName:o,colorSchemeTags:n}=e,i;return n?i=zt({basemapTheme:await ze(a),geometryType:r.geometryType,includedTags:n,numColors:Math.min(t.length,8)})[0]:i=jt({basemapTheme:await ze(a),geometryType:r.geometryType,numColors:Math.min(t.length,8)}).primaryScheme,{layer:r,view:a,attributes:t.map(s=>({field:s,label:r.fields.find(d=>d.name===s)?.alias??""})).slice(0,8),outlineOptimizationEnabled:!0,sizeOptimizationEnabled:!0,includeSizeVariable:o.includes("Size"),pieChartScheme:i}}async function wo(e){return await Lt(e)}async function bo({arcgisMap:e,arcgisMapView:t,layerId:r,fields:a,colorSchemes:o,includeSize:n}){let i=t,s=e?.allLayers.find(c=>c.id===r);if(!s)return`Could not find layer for id: ${r}`;let d={styleName:n?"chart-size":"chart",fields:a,layer:s,view:i,colorSchemeTags:o};try{let c=await yo(d),p=await wo(c);return s.renderer=p.renderer,s.visible=!0,`Chart renderer applied to layer: ${s.title??s.id} using fields ${a.join(", ")}`}catch(c){return`Error applying chart renderer: ${c instanceof Error?c.message:String(c)}`}}var vo=["mapView"];function N(e){let t=e?.configurable?.context;if(!t||typeof t!="object")throw new Error("LayerStylingAgent context missing");let r=vo.filter(a=>!(a in t));if(r.length)throw new Error(`LayerStylingAgent context missing: ${r.join(", ")}`);return t}async function xo({layerId:e,fields:t,colorSchemes:r,includeSize:a},o){let{mapView:n}=N(o);return await I({type:"show-legend",data:{layerIds:[e]}},o),await bo({arcgisMap:n.map,arcgisMapView:n,layerId:e,fields:t,colorSchemes:r,includeSize:a})}var So=l.object({layerId:l.string().describe("The id of the layer to apply the chart renderer to"),fields:l.array(l.string()).describe("The fields to use for the chart renderer (multiple numeric fields)"),colorSchemes:l.array(l.string()).optional().describe("Optional color scheme tags to use"),includeSize:l.boolean().optional().describe("Whether to vary the chart size (chart-size)")}),To=y(xo,{name:"chart",description:`Label: Charts
84
+ Description: Show the values of two or more categories as a proportion of the total using a pie chart.
85
+ Keywords: pie, chart, all categories, breakdown, proportion
86
+ Example: Show the total number of homes built in each decade using a pie chart for each feature.
87
+ Fields: This style requires 2-8 number fields.
88
+
89
+ Label: Charts and Size
90
+ Description: Show the values of two or more categories as a proportion of the total using a pie chart and use size to capture the total amount or magnitude.
91
+ Keywords: pie, chart, all categories, breakdown, proportion, total, amount, how much, sum, graduated size, proportional size
92
+ Example: Show the total number of homes built in each decade using a pie chart for each feature and vary the size of each chart based on the total of all categories.
93
+ Fields: This style requires 2-8 number fields.`,schema:So});function Eo(e){let{fields:t,layer:r,view:a,theme:o,colorSchemeTags:n}=e,i=t[0],s;return n&&(s=Se({geometryType:r.geometryType,includedTags:n,theme:o||"high-to-low"})[0]),{layer:r,view:a,startTime:i,endTime:new Date,theme:o,sizeOptimizationEnabled:!0,outlineOptimizationEnabled:!0,colorScheme:s}}async function Io(e){return await Dt(e)}async function ko({arcgisMap:e,arcgisMapView:t,layerId:r,fields:a,colorSchemes:o,theme:n}){let i=t,s=e?.allLayers.find(c=>c.id===r);if(!s)return`Could not find layer for id: ${r}`;let d={styleName:"color-age",fields:a,layer:s,view:i,colorSchemeTags:o,theme:n};try{let c=Eo(d),p=await Io(c);return s.renderer=p.renderer,s.visible=!0,`Color-age renderer applied to layer: ${s.title??s.id} using fields ${a.join(", ")}`}catch(c){return`Error applying color-age renderer: ${c instanceof Error?c.message:String(c)}`}}async function $o({layerId:e,fields:t,colorSchemes:r,theme:a},o){let{mapView:n}=N(o);return await I({type:"show-legend",data:{layerIds:[e]}},o),await ko({arcgisMap:n.map,arcgisMapView:n,layerId:e,fields:t,colorSchemes:r,theme:a})}var No=l.object({layerId:l.string().describe("The id of the layer to apply the color-age renderer to"),fields:l.array(l.string()).describe("The field(s) to use for the color-age renderer (temporal/date data)"),colorSchemes:l.array(l.string()).optional().describe("Optional color scheme tags to use"),theme:l.enum(["above-and-below","above","below","centered-on","extremes","high-to-low"]).optional().describe("Optional theme for the color ramp")}),_o=y($o,{name:"color-age",description:`Label: Age (color)
94
+ Description: Use colors along a continuous color ramp to represent the age of features. Age reflects the length of time from a start date to an end date.
95
+ Keywords: since, age, how old, how long
96
+ Example: Show the age of each feature based on its reported date.
97
+ Fields: This style requires at least one field with a date type.`,schema:No});function Fo(e){let{fields:t,layer:r,view:a,colorSchemeTags:o}=e,{theme:n}=e,i=t[1],s=t[0],d;return o&&(d=Se({geometryType:r.geometryType,includedTags:o,theme:n||"high-to-low"})[0]),{layer:r,view:a,field:s,normalizationField:i,theme:n,sizeOptimizationEnabled:!0,outlineOptimizationEnabled:!0,colorScheme:d}}async function Mo(e){return await Ot(e)}async function qo({arcgisMap:e,arcgisMapView:t,layerId:r,fields:a,colorSchemes:o,theme:n}){let i=t,s=e?.allLayers.find(c=>c.id===r);if(!s)return`Could not find layer for id: ${r}`;let d={styleName:"color",fields:a,layer:s,view:i,colorSchemeTags:o,theme:n};try{let c=Fo(d),p=await Mo(c);return s.renderer=p.renderer,s.visible=!0,`Color renderer applied to layer: ${s.title??s.id} using fields ${a.join(", ")}`}catch(c){return`Error applying color renderer: ${c instanceof Error?c.message:String(c)}`}}async function Co({layerId:e,fields:t,colorSchemes:r,theme:a},o){let{mapView:n}=N(o);return await I({type:"show-legend",data:{layerIds:[e]}},o),await qo({arcgisMap:n.map,arcgisMapView:n,layerId:e,fields:t,colorSchemes:r,theme:a})}var Ao=l.object({layerId:l.string().describe("The id of the layer to apply the color renderer to"),fields:l.array(l.string()).describe("The field(s) to use for the color renderer"),colorSchemes:l.array(l.string()).optional().describe("Optional color scheme tags to use"),theme:l.enum(["above-and-below","above","below","centered-on","extremes","high-to-low"]).optional().describe("Optional theme for the color ramp")}),Ro=y(Co,{name:"color",description:`Label: Counts and Amounts (color)
98
+ Description: Vary color along a continuous color ramp to represent numeric or ranked data.
99
+ Keywords: graduated color, choropleth, continuous color, hue, color, gradation, saturation, lightness, percent, rate, ratio, index, how much, increase, decrease
100
+ Example: Color each feature based on the population density.
101
+ Fields: This style requires a single field with a number type. A second number field may be specified for normalizing the value of the first field.`,schema:Ao});function Lo(e){let{fields:t,layer:r,view:a,colorSchemeTags:o,theme:n}=e,i,s,d=t[0];return o&&(s=Se({geometryType:r.geometryType,includedTags:o,theme:n||"high-to-low"})[0]),{layer:r,view:a,field:d,normalizationField:i,theme:n,colorOptions:{colorScheme:s}}}async function zo(e){return await Vt(e)}async function jo({arcgisMap:e,arcgisMapView:t,layerId:r,fields:a,colorSchemes:o,theme:n}){let i=t,s=e?.allLayers.find(c=>c.id===r);if(!s)return`Could not find layer for id: ${r}`;let d={styleName:"color-size-univariate",fields:a,layer:s,view:i,colorSchemeTags:o,theme:n};try{let c=Lo(d),p=await zo(c);return s.renderer=p.renderer,s.visible=!0,`Color-size-univariate renderer applied to layer: ${s.title??s.id} using fields ${a.join(", ")}`}catch(c){return`Error applying color-size-univariate renderer: ${c instanceof Error?c.message:String(c)}`}}async function Do({layerId:e,fields:t,colorSchemes:r,theme:a},o){let{mapView:n}=N(o);return await I({type:"show-legend",data:{layerIds:[e]}},o),await jo({arcgisMap:n.map,arcgisMapView:n,layerId:e,fields:t,colorSchemes:r,theme:a})}var Oo=l.object({layerId:l.string().describe("The id of the layer to apply the color-size univariate renderer to"),fields:l.array(l.string()).describe("The fields to use for the color-size univariate renderer"),colorSchemes:l.array(l.string()).optional().describe("Optional color scheme tags to use"),theme:l.enum(["above-and-below","above","below","centered-on","extremes","high-to-low"]).optional().describe("Optional theme for the color and size ramps")}),Vo=y(Do,{name:"color-size-univariate",description:`Label: Color and Size (univariate)
102
+ Description: Vary symbol size and color based on the values of two numeric attributes.
103
+ Keywords: continuous color, hue, color, size, gradation, saturation, lightness, percent, rate, ratio, index, how much, increase, decrease, amount
104
+ Example: Color each feature based on the percentage of the population that owns a home and vary the size of each point based on total population.
105
+ Fields: This style requires at least two fields: one determining the color of each feature, the other determining the size of each feature. Each field may be normalized by an additional normalization field.`,schema:Oo});function Go(e){let{fields:t,layer:r,view:a,colorSchemeTags:o}=e,n;return o&&(n=Pt({includedTags:o,numColors:Math.min(t.length,8)})[0]),{layer:r,view:a,legendOptions:{unit:"units"},attributes:t.map(i=>({field:i,label:r.fields.find(s=>s.name===i)?.alias??""})).slice(0,8),outlineOptimizationEnabled:!0,dotDensityScheme:n}}async function Po(e){return await Gt(e)}async function Qo({arcgisMap:e,arcgisMapView:t,layerId:r,fields:a,colorSchemes:o}){let n=t,i=e?.allLayers.find(d=>d.id===r);if(!i)return`Could not find layer for id: ${r}`;let s={styleName:"dot-density",fields:a,layer:i,view:n,colorSchemeTags:o};try{let d=Go(s),c=await Po(d);return i.renderer=c.renderer,i.visible=!0,`Dot Density renderer applied to layer: ${i.title??i.id} using fields ${a.join(", ")}`}catch(d){return`Error applying dot density renderer: ${d instanceof Error?d.message:String(d)}`}}async function Bo({layerId:e,fields:t,colorSchemes:r},a){let{mapView:o}=N(a);return await I({type:"show-legend",data:{layerIds:[e]}},a),await Qo({arcgisMap:o.map,arcgisMapView:o,layerId:e,fields:t,colorSchemes:r})}var Ko=l.object({layerId:l.string().describe("The id of the layer to apply the dot density renderer to"),fields:l.array(l.string()).describe("The field(s) to use for the dot density renderer (population or count data)"),colorSchemes:l.array(l.string()).optional().describe("Optional color scheme tags to use")}),Uo=y(Bo,{name:"dot-density",description:`Dot Density
106
+ Use dot density to visualize the distribution of one attribute or compare the density of multiple attributes. This is only valid for polygon layers.
107
+ **Use cases:**
108
+ - Population distribution visualization
109
+ - Comparing multiple categories within areas
110
+ - Showing spatial distribution patterns
111
+ **Examples:**
112
+ - Show the density of the population based on various race/ethnic groups
113
+ - Visualize distribution of different crops across regions
114
+ - Display demographic patterns within census tracts
115
+ **Fields:** Requires 2-8 number fields.
116
+ **Keywords:** density, how much, how many, total, number, amount`,schema:Ko});function Ho(e){let{fields:t,layer:r,view:a,colorSchemeTags:o}=e,n,i=t[0];return o&&(n=Bt({includedTags:o,basemap:a.map?.basemap||"topo"})[0]),{layer:r,view:a,field:i,heatmapScheme:n}}async function Wo(e){return await Qt(e)}async function Zo({arcgisMap:e,arcgisMapView:t,layerId:r,fields:a,colorSchemes:o}){let n=t,i=e?.allLayers.find(d=>d.id===r);if(!i)return`Could not find layer for id: ${r}`;let s={styleName:"heatmap",fields:a,layer:i,view:n,colorSchemeTags:o};try{let d=Ho(s),c=await Wo(d);return i.renderer=c.renderer,i.visible=!0,`Heatmap renderer applied to layer: ${i.title??i.id} using fields ${a.join(", ")}`}catch(d){return`Error applying heatmap renderer: ${d instanceof Error?d.message:String(d)}`}}async function Jo({layerId:e,fields:t,colorSchemes:r},a){let{mapView:o}=N(a);return await I({type:"show-legend",data:{layerIds:[e]}},a),await Zo({arcgisMap:o.map,arcgisMapView:o,layerId:e,fields:t,colorSchemes:r})}var Yo=l.object({layerId:l.string().describe("The id of the layer to apply the heatmap renderer to"),fields:l.array(l.string()).describe("The field(s) to use for the heatmap renderer (typically point density)"),colorSchemes:l.array(l.string()).optional().describe("Optional color scheme tags to use")}),Xo=y(Jo,{name:"heatmap",description:`Label: Heat Map
117
+ Description: Show areas of high density with colors that appear to glow hotter. This is only valid for point layers.
118
+ Keywords: density, heatmap, hot spots, pattern, cluster
119
+ Example: Create a heatmap
120
+ Fields: This typically requires zero or one field of type number.`,schema:Yo});function en(e){let{fields:t,layer:r,view:a,styleName:o,colorSchemeTags:n}=e,i;return n&&(i=Ut({geometryType:r.geometryType,includedTags:n,numColors:Math.min(t.length,10)})[0]),{layer:r,view:a,fields:t.map(s=>({name:s})).slice(0,9),outlineOptimizationEnabled:!0,sizeOptimizationEnabled:!0,includeSizeVariable:o.includes("Size"),predominanceScheme:i}}async function tn(e){return await Kt(e)}async function rn({arcgisMap:e,arcgisMapView:t,layerId:r,fields:a,colorSchemes:o,includeSize:n}){let i=t,s=e?.allLayers.find(c=>c.id===r);if(!s)return`Could not find layer for id: ${r}`;let d={styleName:n?"predominance-size":"predominance",fields:a,layer:s,view:i,colorSchemeTags:o};try{let c=en(d),p=await tn(c);return s.renderer=p.renderer,s.visible=!0,`Predominance renderer applied to layer: ${s.title??s.id} using fields ${a.join(", ")}`}catch(c){return`Error applying predominance renderer: ${c instanceof Error?c.message:String(c)}`}}async function an({layerId:e,fields:t,colorSchemes:r,includeSize:a},o){let{mapView:n}=N(o);return await I({type:"show-legend",data:{layerIds:[e]}},o),await rn({arcgisMap:n.map,arcgisMapView:n,layerId:e,fields:t,colorSchemes:r,includeSize:a})}var on=l.object({layerId:l.string().describe("The id of the layer to apply the predominance renderer to"),fields:l.array(l.string()).describe("The fields to use for the predominance renderer (competing categories)"),colorSchemes:l.array(l.string()).optional().describe("Optional color scheme tags to use"),includeSize:l.boolean().optional().describe("Whether to include size visualization (predominance-size)")}),nn=y(an,{name:"predominance",description:`Label: Predominant category
121
+ Description: Compare attributes that share a common subject and unit of measurement to see which has the highest value.
122
+ Keywords: predominant, winner, won, competing, most, most common, most frequent, dominant, prevalent, top
123
+ Example: Using fields for Corn Acres, Wheat Acres, and Cotton Acres, show the predominant crop harvested in each area.
124
+ Fields: This style relies on 2-10 number fields.
125
+
126
+ Label: Predominant category and Size
127
+ Description: Compare attributes that share a common subject and unit of measurement to see which has the highest value. Also varies the size of each symbol based on the total of all categories.
128
+ Keywords: predominant, winner, won, competing, most, most common, most frequent, dominant, prevalent, top, amount, total, how much, proportional size, graduated size, sum
129
+ Example: Show the predominant crop in each area and vary the size of each symbol based on the total of all categories.
130
+ Fields: This style relies on 2-10 number fields.`,schema:on});function sn(e){let{fields:t,layer:r,view:a,colorSchemeTags:o}=e,n,i={field:t[0]},s={field:t[1]};return o&&(n=Wt({geometryType:r.geometryType,includedTags:o})[0]),{layer:r,view:a,field1:i,field2:s,outlineOptimizationEnabled:!0,sizeOptimizationEnabled:!0,relationshipScheme:n}}async function ln(e){return await Ht(e)}async function cn({arcgisMap:e,arcgisMapView:t,layerId:r,fields:a,colorSchemes:o}){let n=t,i=e?.allLayers.find(d=>d.id===r);if(!i)return`Could not find layer for id: ${r}`;let s={styleName:"relationship",fields:a,layer:i,view:n,colorSchemeTags:o};try{let d=sn(s),c=await ln(d);return i.renderer=c.renderer,i.visible=!0,`Relationship renderer applied to layer: ${i.title??i.id} using fields ${a.join(", ")}`}catch(d){return`Error applying relationship renderer: ${d instanceof Error?d.message:String(d)}`}}async function dn({layerId:e,fields:t,colorSchemes:r},a){let{mapView:o}=N(a);return await I({type:"show-legend",data:{layerIds:[e]}},a),await cn({arcgisMap:o.map,arcgisMapView:o,layerId:e,fields:t,colorSchemes:r})}var un=l.object({layerId:l.string().describe("The id of the layer to apply the relationship renderer to"),fields:l.array(l.string()).describe("The two fields to use for the relationship renderer (bivariate visualization)"),colorSchemes:l.array(l.string()).optional().describe("Optional color scheme tags to use")}),pn=y(dn,{name:"relationship",description:`Label: Relationship
131
+ Description: Overlays two color ramps to represent the relationship between two numeric attributes.
132
+ Keywords: relationship, correlation, compare, related, bivariate choropleth, bivariate color
133
+ Example: Show the relationship between tree height and carbon storage
134
+ Fields: This style requires two number fields.`,schema:un});function hn(e){let{fields:t,layer:r,view:a,theme:o}=e,n=t[0];return{layer:r,view:a,startTime:n,endTime:new Date,theme:o,sizeOptimizationEnabled:!0,outlineOptimizationEnabled:!0}}async function mn(e){return await Zt(e)}async function gn({arcgisMap:e,arcgisMapView:t,layerId:r,fields:a,colorSchemes:o,theme:n}){let i=t,s=e?.allLayers.find(c=>c.id===r);if(!s)return`Could not find layer for id: ${r}`;let d={styleName:"size-age",fields:a,layer:s,view:i,colorSchemeTags:o,theme:n};try{let c=hn(d),p=await mn(c);return s.renderer=p.renderer,s.visible=!0,`Size-age renderer applied to layer: ${s.title??s.id} using fields ${a.join(", ")}`}catch(c){return`Error applying size-age renderer: ${c instanceof Error?c.message:String(c)}`}}async function fn({layerId:e,fields:t,colorSchemes:r,theme:a},o){let{mapView:n}=N(o);return await I({type:"show-legend",data:{layerIds:[e]}},o),await gn({arcgisMap:n.map,arcgisMapView:n,layerId:e,fields:t,colorSchemes:r,theme:a})}var yn=l.object({layerId:l.string().describe("The id of the layer to apply the size-age renderer to"),fields:l.array(l.string()).describe("The field(s) to use for the size-age renderer (temporal data with size)"),colorSchemes:l.array(l.string()).optional().describe("Optional color scheme tags to use"),theme:l.enum(["above-and-below","above","below","centered-on","extremes","high-to-low"]).optional().describe("Optional theme for the size ramp")}),wn=y(fn,{name:"size-age",description:`Label: Age (size)
135
+ Description: Vary symbol sizes along a continuous ramp to represent the age of features. Age reflects the length of time from a start date to an end date.
136
+ Keywords: since, age, how old, how long
137
+ Example: Change the size of features so older features are larger than new features.
138
+ Fields: This style requires at least one field with a date type.`,schema:yn});function bn(e){let{fields:t,layer:r,view:a}=e,{theme:o}=e,n=t[1],i=t[0];return{layer:r,view:a,field:i,normalizationField:n,theme:o,sizeOptimizationEnabled:!0,outlineOptimizationEnabled:!0}}async function vn(e){return await Jt(e)}async function xn({arcgisMap:e,arcgisMapView:t,layerId:r,fields:a,colorSchemes:o,theme:n}){let i=t,s=e?.allLayers.find(c=>c.id===r);if(!s)return`Could not find layer for id: ${r}`;let d={styleName:"size",fields:a,layer:s,view:i,colorSchemeTags:o,theme:n};try{let c=bn(d),p=await vn(c);return s.renderer=p.renderer,s.visible=!0,`Size renderer applied to layer: ${s.title??s.id} using fields ${a.join(", ")}`}catch(c){return`Error applying size renderer: ${c instanceof Error?c.message:String(c)}`}}async function Sn({layerId:e,fields:t,colorSchemes:r,theme:a},o){let{mapView:n}=N(o);return await I({type:"show-legend",data:{layerIds:[e]}},o),await xn({arcgisMap:n.map,arcgisMapView:n,layerId:e,fields:t,colorSchemes:r,theme:a})}var Tn=l.object({layerId:l.string().describe("The id of the layer to apply the size renderer to"),fields:l.array(l.string()).describe("The field(s) to use for the size renderer (numeric data)"),colorSchemes:l.array(l.string()).optional().describe("Optional color scheme tags to use"),theme:l.enum(["above-and-below","above","below","centered-on","extremes","high-to-low"]).optional().describe("Optional theme for the size ramp")}),En=y(Sn,{name:"size",description:`Label: Counts and Amounts (size)
139
+ Description: Vary symbol sizes along a continuous ramp to represent numeric or ranked data.
140
+ Keywords: graduated size, proportional size, how much, total, number, amount, size
141
+ Example: Vary the size of each point based on the total population.
142
+ Fields: This style requires a single field with a number type. A second number field may be specified for normalizing the value of the first field.
143
+
144
+ Label: Continuous Timeline (size)
145
+ Description: Vary symbol sizes along a continuous ramp to represent dates.
146
+ Keywords: graduated size, proportional size, classed size, how much, total, number, when
147
+ Example: Vary the size of each feature based on the date a ticket was completed.
148
+ Fields: This style requires a single field with a date type.`,schema:Tn});function In(e){let{fields:t,layer:r,view:a,colorSchemeTags:o}=e,n=t[0],i=t[1],s=t[2],d;return o&&(d=Xt({geometryType:r.geometryType,includedTags:o})[0]),{layer:r,view:a,field:n,field2:i,field3:s,outlineOptimizationEnabled:!0,sizeOptimizationEnabled:!0,typeScheme:d}}async function kn(e){return await Yt(e)}async function $n({arcgisMap:e,arcgisMapView:t,layerId:r,fields:a,colorSchemes:o,theme:n}){let i=t,s=e?.allLayers.find(c=>c.id===r);if(!s)return`Could not find layer for id: ${r}`;let d={styleName:"type",fields:a,layer:s,view:i,colorSchemeTags:o,theme:n};try{let c=In(d),p=await kn(c);return s.renderer=p.renderer,s.visible=!0,`Type renderer applied to layer: ${s.title??s.id} using fields ${a.join(", ")}`}catch(c){return`Error applying type renderer: ${c instanceof Error?c.message:String(c)}`}}async function Nn({layerId:e,fields:t,colorSchemes:r,theme:a},o){let{mapView:n}=N(o);return await I({type:"show-legend",data:{layerIds:[e]}},o),await $n({arcgisMap:n.map,arcgisMapView:n,layerId:e,fields:t,colorSchemes:r,theme:a})}var _n=l.object({layerId:l.string().describe("The id of the layer to apply the type renderer to"),fields:l.array(l.string()).describe("The field(s) to use for the type renderer (categorical data)"),colorSchemes:l.array(l.string()).optional().describe("Optional color scheme tags to use"),theme:l.enum(["above-and-below","above","below","centered-on","extremes","high-to-low"]).optional().describe("Optional theme for the color scheme")}),Fn=y(Nn,{name:"type",description:`Label: Types (unique symbols)
149
+ Description: Represent features as categories with different symbol colors or shapes. Examples include type of tree, road class, or province name.
150
+ Keywords: categorical, category, type, unique, discrete, point of interest, region, group
151
+ Example: Color each feature based on the region it belongs to
152
+ Fields: This style requires a single field which may be a string, number, or date type. It is usually a string.`,schema:_n}),ct=[To,_o,Ro,Vo,Uo,Xo,nn,pn,wn,En,Fn],dt=(e,t=3)=>{let r=e.map((o,n)=>o.type==="human"?n:-1).filter(o=>o!==-1);if(r.length===0)return[];let a=r.length>t?r[r.length-t]:r[0];return e.slice(a)},Mn=async(e,t)=>{await g({text:"Requesting LLM for layer query results"},t);let r=await k("navigation_intent_prompt");if(!t?.configurable)throw new Error("config.configurable is required for layer query tools");let a={layerFieldInfo:e.layerFieldInfo},o=await j({promptText:r,modelTier:"advanced",messages:dt(e.agentExecutionContext.messages),inputVariables:a,tools:ct});return await Ee(o,t),{...e,agentExecutionContext:{...e.agentExecutionContext,messages:[...e.agentExecutionContext.messages,o]}}};async function qn(e,t){let r=await new C(ct).invoke({messages:dt(e.agentExecutionContext.messages)},t),a=r.messages.map(n=>n.text).join(`
153
+ `);await g({text:`Finished executing layer filter tool: ${a}`},t);let o=r.messages.map(n=>n.text).join(`
154
+ `);return{...e,outputMessage:o}}var ut=v.Root({...U(),vectorSearchLayerIds:v(),vectorSearchFieldResults:v(),layerFieldInfo:v(),selectedLayerId:v()}),Cn=async(e,t)=>(await g({text:"Exiting Layer Styling agent"},t),e),An=async(e,t)=>{try{await g({text:"Populating layer and field info"},t);let r=[];for(let a of e.vectorSearchFieldResults){let o=function(p){let u=s.get(p)?.layerItem;return u?[u.name&&`Name: ${u.name}`,u.title&&`Title: ${u.title}`,u.description&&`Description: ${u.description}`].filter(Boolean).join(" | "):p},{layerId:n,results:i}=a,s=S(t,"layersAndFieldsRegistry"),d=s.get(n)?.fieldRegistry;if(!d)continue;let c=r.find(p=>p.layerId===n);c||(c={layerId:n,layerSummary:o(n),fieldInfos:[]},r.push(c));for(let p of i){let u=d.get(p.name);u&&c.fieldInfos.push(u)}}return await g({text:"Populated layerFieldInfo"},t),{...e,layerFieldInfo:r}}catch(r){throw await g({text:"Error populating layerFieldInfo"},t),new Error(`Error populating layerFieldInfo: ${r instanceof Error?r.message:String(r)}`)}},Rn=(e,t)=>{let r=e.vectorSearchLayerIds??[];if(r.length<=1)return{...e,selectedLayerId:e.vectorSearchLayerIds[0]};let{hitlResponse:a}=t.configurable;if(a?.agentId!==Ke.id||a.id!=="reviewLayerSelection"){let n={agentId:Ke.id,id:"reviewLayerSelection",kind:"singleSelection",message:"Choose a layer to apply the styles.",metadata:[...r]};throw new Fe(n)}let o=null;return Array.isArray(a.payload)&&a.payload.length>0&&(o=a.payload[0]),{...e,selectedLayerId:o??e.vectorSearchLayerIds[0]}},Ln=(e,t)=>J(["layerSearch","fieldSearch","layersAndFieldsRegistry"],"Layer Styling Agent")(e,t),zn=()=>new q(ut).addNode("requireLayerStylingServices",Ln).addNode("vectorSearchLayers",fo).addNode("layerSelectionHITL",Rn).addNode("vectorSearchFields",mo).addNode("populateLayerFieldInfo",An).addNode("agent",Mn).addNode("tools",qn).addNode("earlyExit",Cn).addEdge(F,"requireLayerStylingServices").addEdge("requireLayerStylingServices","vectorSearchLayers").addConditionalEdges("layerSelectionHITL",e=>e.vectorSearchLayerIds.length?"vectorSearchFields":"earlyExit").addConditionalEdges("vectorSearchFields",e=>e.vectorSearchFieldResults.length?"populateLayerFieldInfo":"earlyExit").addEdge("populateLayerFieldInfo","agent").addEdge("agent","tools").addEdge("tools",T).addEdge("earlyExit",T),jn=String.raw`- **layerStyling** — User wants to change how features are drawn or styled on the map based on their data, such as applying color, size, transparency, symbols, or charts according to field values.
155
+ _Example: “Color points by sales amount”_
156
+ _Example: “Show population density with a color gradient”_
157
+ _Example: “Create a relationship map between height and depth”_
158
+ _Example: “Vary circle sizes according to population”_`,Ke={id:"layerStyling",name:"Layer Styling Agent",description:jn,createGraph:zn,workspace:ut},pt=v.Root({...U(),helpInternalState:v({reducer:H,default:()=>({toolCallMessage:void 0})})}),Dn=(e,t)=>{let r=Array.from(e.values()).find(({layerItem:n})=>n.title?.toLowerCase().includes(t.toLowerCase()));if(!r){let n=Array.from(e.values()).map(i=>i.layerItem.title).join(", ");return`Could not find a layer matching "${t}". Available layers: ${n}`}let a=Array.from(r.fieldRegistry.values()),o=a.map(n=>`- **${n.alias||n.name}** (\`${n.name}\`, ${n.type})${n.description?`: ${n.description}`:""}`).join(`
159
+ `);return`**${r.layerItem.title}** has ${a.length} field(s):
160
+
161
+ ${o}`},On=async({layerTitle:e},t)=>{let r=S(t,"layersAndFieldsRegistry");return Dn(r,e)},Vn=y(On,{name:"listLayerFields",description:"Lists all fields for a given layer by title. Use ONLY when the user explicitly asks to see fields, columns, or attributes of a specific named layer. Do NOT call this tool for general help questions, capability overviews, or layer listing.",schema:l.object({layerTitle:l.string().describe("The title or partial title of the layer to list fields for.")})}),ht=[Vn],Gn=e=>{if(!e||e.size===0)return"No layers available in this map.";let t=Array.from(e.values()).map(({layerItem:r,fieldRegistry:a},o)=>{let n=Array.from(a.values()).map(s=>s.name).slice(0,10).join(", "),i=a.size>10?` (and ${a.size-10} more)`:"";return`${o+1}. "${r.title}". Description: ${r.description}
162
+ Fields: ${n}${i}`}).join(`
163
+
164
+ `);return`This map contains ${e.size} layer(s):
165
+
166
+ ${t}`},Pn=e=>{let t=e?.list()??[];return t.length?t.map(r=>`- ${r.agent.name}: ${r.agent.description}`).join(`
167
+ `):"No agents currently available."};async function Qn(e,t){let r=await k("help_prompt"),a=S(t,"layersAndFieldsRegistry"),o=S(t,"agentRegistry");try{let n=await j({promptText:r,modelTier:"fast",tools:ht,inputVariables:{layerSummary:Gn(a),agents:Pn(o),assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps}}),i=(n.tool_calls?.length??0)>0,s=typeof n.text=="string"?n.text.trim():"";return{...e,helpInternalState:{...e.helpInternalState,toolCallMessage:i?n:void 0},outputMessage:i?e.outputMessage:s,summary:i?"Prepared help tool call from assigned task.":"Provided map-related help based on the assigned task.",status:i?e.status:"success"}}catch(n){let i=n instanceof Error?n.message:String(n);return{...e,outputMessage:`Error invoking help agent: ${i}`,summary:"Help agent execution failed.",status:"failed"}}}var Bn=(e,t)=>J(["agentRegistry"],"Help Agent")(e,t);async function Kn(e,t){let r=new C(ht);try{let a=e.helpInternalState.toolCallMessage;if(!a)throw new Error("helpToolCalling: missing helpInternalState.toolCallMessage");let o=(await r.invoke({messages:[a]},t)).messages.map(n=>n.text).join(`
168
+ `);return await g({text:`Finished executing help tool: ${o}`},t),{...e,outputMessage:o,status:"success",summary:o?R(o):"Help executed.",helpInternalState:{...e.helpInternalState,toolCallMessage:void 0}}}catch(a){let o=a instanceof Error?a.message:String(a);return await g({text:`Help tool execution failed: ${o}`},t),{...e,outputMessage:`Help tool execution failed: ${o}`,status:"failed",summary:`Help tool execution failed: ${o}`,helpInternalState:{...e.helpInternalState,toolCallMessage:void 0}}}}var Un=()=>new q(pt).addNode("requireHelpServices",Bn).addNode("agent",Qn).addNode("tools",Kn).addEdge(F,"requireHelpServices").addEdge("requireHelpServices","agent").addConditionalEdges("agent",e=>e.helpInternalState.toolCallMessage?"tools":T).addEdge("tools",T),Hn=String.raw`- **help** — Enables users to ask questions about the map, layers, fields, and it's capabilities.
169
+
170
+ _Example: “Tell me about this map”_
171
+ _Example: “List all layers in this map”_
172
+ _Example: “List fields in protected areas layer”_
173
+ _Example: “What agents are available to me?”_
174
+ _Example: “What can you do?”_
175
+ _Example: “What can I ask”_
176
+
177
+ Even if the user asks unrelated queries like "What are the vowels in English alphabet" or "How to cook", call this agent.
178
+
179
+ 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 accordingly.
180
+ _Example: "Create a chart"_
181
+ _Example: "Create a table"_`,Cl={id:"help",name:"Help Agent",description:Hn,createGraph:Un,workspace:pt},mt=v.Root({...U(),intent:v({reducer:(e,t)=>t}),arcgisKnowledgeMessages:v({reducer:K,default:()=>[]}),arcgisKnowledgeToolResult:v({reducer:(e,t)=>t,default:()=>null})}),oe={conversationId:""};function ke(e){let t=e.map?.allLayers.filter(r=>r.type==="knowledge-graph");if(!t||t?.length!==1)throw new Error("The Knowledge Agent currently only supports maps with exactly one Knowledge Graph Layer.")}function G(e){return!!e?.map&&!("activeLinkChartLayer"in e.map)}function ce(e){let t=e?.configurable?.context;if(!t||typeof t!="object")throw new Error("ArcgisKnowledgeAgent context missing");if(!("view"in t))throw new Error("View context missing");let r=t.view;return r.map&&!("activeLinkChartLayer"in r.map)&&ke(r),{view:r}}function Wn(e){let t=e?.configurable?.context;if(gt(e)==="knowledgeGraph")return"knowledgeGraph";let r=t.view;return G(r)?(ke(r),"map"):"linkChart"}async function P(e){let t=e?.configurable?.context;if(gt(e)==="knowledgeGraph")return t;{let r=t.view.map;if(r&&"activeLinkChartLayer"in r){let a=r.knowledgeGraph.url;if(!a)throw new Error("Knowledge graph url missing from link chart.");return{knowledgeGraph:await je(a)}}else{ke(t.view);let a=(t.view.map?.allLayers.find(o=>o.type==="knowledge-graph")).url;if(!a)throw new Error("Knowledge graph url missing from map.");return{knowledgeGraph:await je(a)}}}}function gt(e){let t=e?.configurable?.context;if(!t||typeof t!="object")throw new Error("ArcgisKnowledgeAgent context missing");if("knowledgeGraph"in t&&"view"in t)throw new Error("Knowledge Graph context should only have a view or knowledgeGraph, but never both.");if("knowledgeGraph"in t)return"knowledgeGraph";if("view"in t)return"view";throw new Error("ArcgisKnowledgeAgent context must have either a view or knowledgeGraph property.")}var ye=class{constructor(t){this.dataModel=t,this.kind="GraphQueryGenerationRequest",this.explainQuery=!0,this.schemaInformation=se.fromDataModel(t)}},se=class e{constructor(){this.schemaType="ArcgisGraphSchema",this.entityTypes=[],this.relationshipTypes=[],this.identifierInfo={mappingInfo:{identifierMapsTo:"UniformPropertyIdentifier",identifierPropertyName:"globalid"}}}static fromDataModel(t){let r=new e;for(let a of t.entityTypes)r.entityTypes.push(Z.fromEntityType(a));for(let a of t.relationshipTypes)r.relationshipTypes.push(we.fromRelationshipType(a));return r.identifierInfo={mappingInfo:{identifierMapsTo:Zn(t.identifierInfo.identifierMappingInfo.identifierInfoType),identifierPropertyName:t.identifierInfo.identifierMappingInfo.uniformPropertyIdentifier.identifierPropertyName}},r.spatialReference=JSON.parse(JSON.stringify(t.spatialReference)),r}static getDataModelTypesSummary(t){let r=t.entityTypes.map(o=>o.name).join(", "),a=t.relationshipTypes.map(o=>o.name).join(", ");return`Entity Types: ${r}.
182
+ Relationship Types: ${a}.`}},Z=class e{constructor(){this.name="",this.properties=[]}static fromEntityType(t){let r=new e;r.name=t.name,r.alias=t.alias?t.alias:void 0,r.role=Jn(t.role);for(let a of t.properties){let o={name:a.name,alias:a.alias?a.alias:void 0,fieldType:a.fieldType,role:Yn(a.role),geometryDef:a.fieldType==="esriFieldTypeGeometry"?{geometryType:a.geometryType??"esriGeometryAny",hasM:a.hasM?a.hasM:void 0,hasZ:a.hasZ?a.hasZ:void 0}:void 0};r.properties.push(o)}return r}},we=class extends Z{constructor(){super(...arguments),this.observedEndPoints=[]}static fromRelationshipType(t){let r=Z.fromEntityType(t);r.observedEndPoints=[];for(let a of t.endPoints)r.observedEndPoints.push({originEntityType:a.originEntityType,destinationEntityType:a.destinationEntityType});return r}},Zn=e=>{switch(e){case"esriIdentifierInfoTypeUNSPECIFIED":return"UNSPECIFIED";case"esriIdentifierInfoTypeDatabaseNative":return"DatabaseNative";case"esriIdentifierInfoTypeUniformProperty":return"UniformPropertyIdentifier";default:return e}},Jn=e=>{switch(e){case"Regular":return"esriGraphNamedObjectRegular";case"Provenance":return"esriGraphNamedObjectProvenance";case"Document":return"esriGraphNamedObjectDocument";default:return e}};function Yn(e){switch(e){case"esriGraphPropertyRegular":return"Regular";case"esriGraphPropertyDocumentName":return"Document_Name";case"esriGraphPropertyDocumentTitle":return"Document_Title";case"esriGraphPropertyDocumentUrl":return"Document_Url";case"esriGraphPropertyDocumentText":return"Document_Text";case"esriGraphPropertyDocumentKeywords":return"Document_Keywords";case"esriGraphPropertyDocumentContentType":return"Document_ContentType";case"esriGraphPropertyDocumentMetadata":return"Document_Metadata";case"esriGraphPropertyDocumentFileExtension":return"Document_FileExtension";case"esriGraphPropertyProvenanceInstanceId":return"Provenance_InstanceId";case"esriGraphPropertyProvenanceSourceType":return"Provenance_SourceType";case"esriGraphPropertyProvenanceSourceName":return"Provenance_SourceName";case"esriGraphPropertyProvenanceSource":return"Provenance_Source";case"esriGraphPropertyProvenanceComment":return"Provenance_Comment";case"esriGraphPropertyProvenanceTypeName":return"Provenance_TypeName";case"esriGraphPropertyProvenancePropertyName":return"Provenance_PropertyName";default:return"Regular"}}function Xn(e,t){return t?`${e}
183
+
184
+ Your previous attempt to generate a cypher query failed. See the details below and generate a new cypher query that avoids this error.
185
+
186
+ Attempt Number: ${t.attemptCount}
187
+ Execution Error: ${t.executionError}
188
+ Failed Query:
189
+ ${t.failedGraphQuery}`:e}async function ei(e,t,r,a){let{graphQuery:o,explanation:n}=await $e(e,t,r,a);return`Generated Graph Query:
190
+ ${o}
191
+
192
+ Explanation: ${n}`}async function $e(e,t,r,a,o){let n={message:Xn(e,o),context:new ye(t)};oe.conversationId&&(n.conversationId=oe.conversationId),await g({text:"Attempting to generate a cypher query from your prompt..."},a);let i=await De(`${r}/chat`,{method:"post",body:JSON.stringify(n),headers:{"Content-Type":"application/json",token:Oe.findCredential(O.getDefault().url)?.token??""}});if(i.httpStatus!==200)throw new Error(`Graph query service returned an error: ${i.httpStatus}`,{cause:i.data});oe.conversationId||(oe.conversationId=i.data.conversationId);let s=!1,d=Date.now(),c=i.data.sequenceNumber,p="",u="",h=1;for(;!s;){await new Promise(w=>setTimeout(w,1e3)),await g({text:`Periodically requesting status of job from ArcGIS AI Services${"...".substring(0,h)}`},a),h=h%3+1;let f=await De(`${r}/chat`,{method:"post",body:JSON.stringify({conversationId:i.data.conversationId,inquiryId:i.data.inquiryId,ackSequenceNumber:c}),headers:{"Content-Type":"application/json",token:Oe.findCredential(O.getDefault().url)?.token??""}});if(f.httpStatus!==200)throw new Error(`Graph query service polling returned an error: ${f.httpStatus}`,{cause:f.data});if(f.data.context)p=f.data.context.graphQuery,u=f.data.message||"";else if(!f.data.hasMore)s=!0;else if(Date.now()-d>6e4)throw new Error("Graph query service polling timed out after 1 minute.");c=f.data.sequenceNumber}return{graphQuery:p,explanation:u}}var D=3;function ft(e,t=100){let r={};for(let a of Object.entries(e.properties??{})){let[o,n]=a;typeof n=="string"&&n.length>t?r[o]=`${n.slice(0,t)}... (truncated, original length: ${n.length})`:r[o]=n}return e.properties=r,e}function Ne(e){return typeof e!="object"||e===null?String(e):"details"in e&&typeof e.details=="object"&&e.details!==null&&"errorMessage"in e.details&&typeof e.details.errorMessage=="string"?e.details.errorMessage:"message"in e&&typeof e.message=="string"?e.message:String(e)}var ti=async({kg:e,queryParams:t,targetStructure:r,targetStructureReducer:a,requestOptions:o,queryRowLimit:n,queryTimeoutMs:i})=>{let s=null,d=r,c=new AbortController,p=o?.signal,u=()=>{c.abort(p?.reason)};p&&(p.aborted?c.abort(p.reason):p.addEventListener("abort",u,{once:!0}));try{let h=await er(e,t,o);s=h.resultHeader;let f=h.resultRowsStream.getReader(),w=0,m=Date.now(),b=!1;for(;;){let{done:x,value:E}=await f.read();if(x)break;if(!b&&i&&Date.now()-m>i)return c.abort(),{type:"timeout"};for(let _ of E){if(w++,n&&w>n)return c.abort(),{type:"success",rowLimitReached:!0,resultHeader:s,processedResult:d};d=a(d,_)}}}catch(h){return c.signal.aborted?{type:"aborted"}:{type:"error",errorMessage:Ne(h),error:h}}finally{p?.removeEventListener("abort",u)}return{type:"success",rowLimitReached:!1,resultHeader:s,processedResult:d}};async function yt({prompt:e,kg:t,graphQueryServiceUrl:r,targetStructure:a,targetStructureReducer:o,requestOptions:n,queryRowLimit:i,queryTimeoutMs:s,config:d}){let c;for(let p=1;p<=D;p++){let u;try{u=await $e(e,t.dataModel,r,d,c)}catch(w){return{type:"generation-error",errorMessage:Ne(w),error:w}}await g({text:`Attempting to execute query: ${u.graphQuery.substring(0,500)}${u.graphQuery.length>500?"...":""}`},d);let h=await ti({kg:t,queryParams:new Xe({openCypherQuery:u.graphQuery}),targetStructure:a,targetStructureReducer:o,requestOptions:n,queryRowLimit:i,queryTimeoutMs:s}),f=h.type==="aborted"?"Query execution was aborted.":h.type==="timeout"?"Query execution timed out.":h.type==="error"?`Query failed with error: ${h.errorMessage}`:"";if(h.type==="success")return{type:"success",graphQuery:u.graphQuery,explanation:u.explanation,rowLimitReached:h.rowLimitReached,resultHeader:h.resultHeader,processedResult:h.processedResult};if(h.type==="aborted")return{type:"aborted",errorMessage:f,graphQuery:u.graphQuery,explanation:u.explanation};if(p>=D)return h.type==="timeout"?{type:"timeout",errorMessage:f,graphQuery:u.graphQuery,explanation:u.explanation}:{type:"execution-error",errorMessage:f,error:h.error,graphQuery:u.graphQuery,explanation:u.explanation};c={failedGraphQuery:u.graphQuery,executionError:f,attemptCount:p},await g({text:`Attempt ${p} failed with error: ${f}. Retrying...`},d)}throw new Error(`Failed to execute generated cypher due to an unexpected error after ${D} attempts.`)}var ri=async({kg:e,searchQuery:t,typeCategoryFilter:r,namedTypesFilter:a,searchResultLimit:o,requestOptions:n})=>{let i=[],s=[r];r==="both"&&!e.serviceDefinition.serviceCapabilities.searchCapabilities.searchTypeFilterCapabilities.includes("esriTypeBoth")&&(s=["entity","relationship"]);let d=o??1/0;try{for(let c of s){let p=d-i.length;if(p<=0)break;let u=(await tr(e,new rr({searchQuery:t,typeCategoryFilter:c,namedTypesFilter:a??void 0,num:p}),n)).resultRowsStream.getReader(),h=!1;for(;!h;){let{done:f,value:w}=await u.read();if(f){h=!0;break}for(let m of w)for(let b of m)i.push(b)}}}catch(c){return console.log('Error when running graph search with query: "',t,'" - error: ',c),n?.signal?.aborted?{type:"aborted"}:{type:"error",errorMessage:Ne(c),error:c}}return{type:"success",results:i}};function ai(e,t){V(e,r=>{t.set(`${r.typeName}__${r.id}`,{id:r.id,typeName:r.typeName})})}function V(e,t){if(!(!e||typeof e!="object")){if(ni(e))for(let r of e.path)V(r,t);else if(oi(e))t(e);else if(Array.isArray(e))for(let r of e)V(r,t);else if(ii(e))for(let r of Object.values(e.properties??{}))V(r,t)}}function oi(e){return!e||typeof e!="object"||Array.isArray(e)?!1:"id"in e&&"typeName"in e}function ni(e){return!e||typeof e!="object"||Array.isArray(e)?!1:e&&"path"in e&&Array.isArray(e.path)}function ii(e){return!e||typeof e!="object"||Array.isArray(e)||"id"in e?!1:"properties"in e&&typeof e.properties=="object"}function si(e,t){let r=[];for(let a of[...t.dataModel.entityTypes,...t.dataModel.relationshipTypes]){let o=e.getMemberIdsByType(a.name);for(let n of o)r.push({id:n,typeName:a.name})}return r}function li(e){let t=[],r=[],a=e?.allLayers.find(o=>o.type==="knowledge-graph")?.inclusionModeDefinition;if(a?.generateAllSublayers)return{allNamedTypesFullyDynamic:!0,idTypePairs:t,dynamicTypes:r};for(let[o,n]of a?.namedTypeDefinitions??[])if(n.useAllData)r.push(o);else for(let[i]of n.members)t.push({id:i,typeName:o});return{allNamedTypesFullyDynamic:!1,idTypePairs:t,dynamicTypes:r}}async function ci(e,t,r,a,o){let{view:n}=a,i=await yt({prompt:e,kg:t,graphQueryServiceUrl:r,targetStructure:new Map,targetStructureReducer:(u,h)=>{for(let f of h)ai(f,u);return u},requestOptions:{signal:o?.signal,timeout:o?.timeout},config:o});if(i.type!=="success"){let u=i.type==="generation-error"?i.errorMessage:`${i.errorMessage} Cypher query: ${i.graphQuery}`;throw new Error(`Failed to add records to the link chart. ${u}`)}let{graphQuery:s,explanation:d,processedResult:c}=i,p=Array.from(c.values());if(await g({text:`Query Results parsed into ${p.length} unique relationships and entities. Atempting to add to link chart...`},o),!G(n)&&n?.map){let u=n.map;return await u.addRecords(p),n.goTo(u.diagramNodesExtent??new Ue),`Link Chart updated successfully. Cypher Query used:
193
+ ${s}
194
+
195
+ Explanation: ${d}`}else return await n?.map?.allLayers.find(u=>u.type==="knowledge-graph")?.addRecords(p),`Map updated successfully. Cypher Query used:
196
+ ${s}
197
+
198
+ Explanation: ${d}`}var wt="addRecords",di=l.object({prompt:l.string().describe("The user's inquiry into the knowledge graph that needs to be run.")}),ui=async({prompt:e},t)=>{let{knowledgeGraph:r}=await P(t),a=ce(t),{view:o}=a,n=O.getDefault().helperServices,i=e;if(G(o)){let d=o.map,{allNamedTypesFullyDynamic:c,idTypePairs:p,dynamicTypes:u}=li(d),h=await k("arcgis_knowledge_current_map_context");if(i=`${e}
199
+
200
+ ${h}${JSON.stringify(p)} and all entities or relationships with the the following typeNames in the array: ${JSON.stringify(u)}`,c)throw new Error("No records have been added to the map because all data in the knowledge graph is contained in the map.")}else{let d=o.map,c=await k("arcgis_knowledge_current_lc_context"),p=si(d,r);i=`${e}
201
+
202
+ ${c}${JSON.stringify(p)}`}let s=await ci(i,r,`${n.aiAssistantServices.url}${n.aiAssistantServices.graphQueryAssistant}`,a,t);return{toolName:wt,status:"success",summary:s}},pi=y(ui,{name:wt,description:"Adds records (entities or relationships) to the current link chart visualization from an inquiry into the knowledge graph data. The inquiry will retrieve data from the graph database that will serve as the basis for the records to be added to the link chart. The user should have explicitly requested to add records to the current link chart from their prompt.",schema:di});async function hi(e,t){return await t.map?.applyLayout(e),`Successfully applied layout: ${e}.`}var be="applyLayout",mi=l.object({layout:l.enum(["organic-standard","organic-community","basic-grid","hierarchical-bottom-to-top","radial-root-centric","tree-left-to-right","geographic-organic-standard","chronological-mono-timeline","chronological-multi-timeline"]).describe("The layout mode to apply to the link chart. The value must be one of the following: organic-standard, organic-community, basic-grid, hierarchical-bottom-to-top, radial-root-centric, tree-left-to-right, geographic-organic-standard, chronological-mono-timeline, chronological-multi-timeline")}),gi=async({layout:e},t)=>{let{view:r}=ce(t);if(G(r))return{toolName:be,status:"error",errorMessage:"The applyLayout tool can only be used with a LinkChartView.",error:new Error};{let a=await hi(e,r);return{toolName:be,status:"success",summary:a}}},fi=y(gi,{name:be,description:"Apply a diagram layout to the link chart",schema:mi});function yi(e,t){return t.map?.changeNonspatialDataDisplay(e),`Successfully applied nonspatial visibility setting: ${e}.`}var ve="changeNonspatialVisibility",wi=l.object({setting:l.enum(["hidden","visible"]).describe("The setting of nonspatial visibility")}),bi=async({setting:e},t)=>{let{view:r}=ce(t);if(G(r))return{toolName:ve,status:"error",errorMessage:"The changeNonspatialVisibility tool can only be used with a LinkChartView.",error:new Error};{let a=yi(e,r);return{toolName:ve,status:"success",summary:a}}},vi=y(bi,{name:ve,description:"Change whether or not nonspatial data is visible in the link chart. The value must be either 'hidden' or 'visible'.",schema:wi});async function xi(e,t,r,a,o){let n;for(let i=1;i<=D;i++){let{graphQuery:s,explanation:d}=await $e(e,t.dataModel,r,o,n);try{await g({text:`Attempting to create link chart from derived query: ${s}`},o);let c=await ar.fromCypherQuery(t,new Xe({openCypherQuery:s}));return await g({text:"Link chart created successfully, loading..."},o),a.map=c,await c.load(),await a.when(),`Link chart created successfully. Cypher Query used to create the link chart:
203
+ ${s}
204
+
205
+ Explanation: ${d}`}catch(c){if(i>=D)throw new Error(`Failed to create link chart after ${D} attempts. Last error: ${c.message}`);n={failedGraphQuery:s,executionError:c.message,attemptCount:i},await g({text:`Attempt ${i} to create link chart failed with error: ${c}. Retrying ...`},o)}}throw new Error(`Failed to create link chart after ${D} attempts.`)}var xe="createLinkChart",Si=l.object({prompt:l.string().describe("The user's inquiry into the knowledge graph that needs to be transformed into a link chart visualization.")}),Ti=async({prompt:e},t)=>{let{knowledgeGraph:r}=await P(t),{view:a}=ce(t);if(G(a))return{toolName:xe,status:"error",errorMessage:"The createLinkChart tool can only be used with a LinkChartView.",error:new Error};{let o=O.getDefault().helperServices,n=await xi(e,r,`${o.aiAssistantServices.url}${o.aiAssistantServices.graphQueryAssistant}`,a,t);return{toolName:xe,status:"success",summary:n}}},Ei=y(Ti,{name:xe,description:"Creates a new link chart visualization from an inquiry into the knowledge graph data. The inquiry will retrieve data from the graph database that will serve as the basis for the new link chart. The user should have explicitly requested the creation of a new link chart from their prompt.",schema:Si}),bt="queryGraphData",Ii=l.object({prompt:l.string().describe(`The user's inquiry into the knowledge graph, from which a cypher query will be generated and executed to answer the inquiry. IMPORTANT:
206
+
207
+ REQUEST LIMIT: If the user does not specifically request for no limits or an explicit limit to be placed on the query, or the number of rows will not be limited by e.g. the number of entity or relationship types in the graph, ensure that the generated query has a reasonable row limit (e.g. 10 rows).
208
+
209
+ DESCRIPTIVE COLUMN NAMES: If the user's prompt does not explicitly request for specific column names in the result, ensure that the generated query has descriptive column names (using AS statements) to make the results easier to understand when displayed in a table format.`)}),ki=async({prompt:e},t)=>{let{knowledgeGraph:r}=await P(t),a=O.getDefault().helperServices,o=await yt({prompt:e,kg:r,graphQueryServiceUrl:`${a.aiAssistantServices.url}${a.aiAssistantServices.graphQueryAssistant}`,targetStructure:new Array,targetStructureReducer:(u,h)=>(u.push(h),u),requestOptions:{signal:t?.signal,timeout:t?.timeout},config:t});if(o.type!=="success"){let u=o.type==="generation-error"?o.errorMessage:`${o.errorMessage} Cypher query: ${o.graphQuery}`;throw new Error(`Failed to query the knowledge graph. ${u}`)}let{graphQuery:n,processedResult:i,resultHeader:s}=o,d=s.headerKeys;for(let u of i)for(let h of u)V(h,f=>ft(f));let c=50,p=i.slice(0,c).map(u=>JSON.stringify(u));return{toolName:bt,status:"success",summary:`To answer the inquiry, the following cypher query was executed against the knowledge graph:
210
+
211
+ \`\`\`cypher
212
+ ${n}
213
+ \`\`\`
214
+
215
+ Query Results:
216
+ ${p.length} result(s) found.
217
+
218
+ Column Headers: ${d.join(", ")}
219
+
220
+ ${p.length>c?`Showing top ${c} results:
221
+
222
+ `:`Results:
223
+
224
+ `}${p.join(`
225
+ `)}
226
+ `,details:{generatedQuery:n,resultHeader:s,queryResults:i}}},$i=y(ki,{name:bt,description:"Allows users to explore the data in their knowledge graph via cypher query. Generates and executes a cypher query based on the user's inquiry into the knowledge graph, and displays the results in the chat pane without modifying the user's link chart if any. Use this tool when the user is asking an exploratory question about their data as a whole that can be answered via cypher query, for example 'What are the top 5 suppliers by total parts cost?' or 'How many employees do we have in each department?'.",schema:Ii}),vt="generateCypher",Ni=l.object({prompt:l.string().describe("The user's inquiry into the knowledge graph that needs to be translated into a cypher query.")}),_i=async({prompt:e},t)=>{let{knowledgeGraph:r}=await P(t),a=O.getDefault().helperServices,o=await ei(e,r.dataModel,`${a.aiAssistantServices.url}${a.aiAssistantServices.graphQueryAssistant}`,t);return{toolName:vt,status:"success",summary:o}},Fi=y(_i,{name:vt,description:"Generates an Open Cypher query based on the user's prompt which represents an inquiry into the data of the knowledge service and its graph database, attempting to filter based on certain conditions and traverse specified relationships. The generated query should be syntactically correct and optimized for performance.",schema:Ni}),Mi=e=>{let t=e.dataModel,r=new Map;for(let s of t.searchIndexes)if(s.supportedCategory!=="esriTypeMetaEntityProvenance")for(let[d,c]of s.searchProperties.entries()){let p=r.get(d)??new Set;c.propertyNames.forEach(u=>p.add(u)),r.set(d,p)}let a=t.entityTypes.filter(s=>r.has(s.name)),o=t.relationshipTypes.filter(s=>r.has(s.name)),n=`Entity Types:
227
+ ${a.map(({name:s})=>`${s}: [${Array.from(r.get(s)??[]).join(", ")}]`).join(`
228
+ `)}`,i=`Relationship Types:
229
+ ${o.map(({name:s})=>`${s}: [${Array.from(r.get(s)??[]).join(", ")}]`).join(`
230
+ `)}`;return`${n}
231
+
232
+ ${i}`};async function qi(e,t){let r=await k("arcgis_knowledge_lucene_generation_prompt"),a={inquiry:e,dataModelForSearch:Mi(t)},o=l.enum(["entity","relationship","both"]).describe("The graph element category to search against - entity, relationship, or both"),n=l.number().int().positive().nullable().describe("The maximum number of search results to return. Default to 10 if not specified by the user, or set to null if the user specifically requests no limits or all results."),i=l.array(l.enum(t.dataModel.entityTypes.map(d=>d.name).concat(t.dataModel.relationshipTypes.map(d=>d.name)))).min(1),s=l.object({query:l.string().describe("A lucene syntax query string to be executed against the knowledge graph search API"),typeFilters:i.nullable().describe("Nullable list of entity or relationship types from the graph to limit the search to. If set to null, search will execute against all named types with indexed properties in the graph"),typeCategoryFilter:o,resultLimit:n});return await pe({promptText:r,inputVariables:a,schema:s})}var xt="searchGraphData",Ci=l.object({prompt:l.string().describe("The user's inquiry into the knowledge graph, from which a lucene search query will be generated and executed against the graph to return relevant results.")}),Ai=async({prompt:e},t)=>{let{knowledgeGraph:r}=await P(t);await g({text:"Generating search query for the user inquiry"},t);let a=await qi(e,r);await g({text:"Executing graph search with generated search query"},t);let o=await ri({kg:r,searchQuery:a.query,typeCategoryFilter:a.typeCategoryFilter,namedTypesFilter:a.typeFilters,searchResultLimit:a.resultLimit,requestOptions:{signal:t?.signal,timeout:t?.timeout}});if(o.type!=="success")throw new Error(`Graph search failed with error: ${o.type==="error"?o.errorMessage:"aborted"}`);for(let s of o.results)V(s,d=>ft(d));let n=10,i=o.results.slice(0,n);return{toolName:xt,status:"success",summary:`To answer the query, the following lucene query was generated and executed:
233
+ Query: ${a.query}
234
+ Type Category Filter: ${a.typeCategoryFilter}
235
+ Named Type Filters: ${a.typeFilters?a.typeFilters.join(", "):"None"}
236
+ Result Limit: ${a.resultLimit??"No limit"}
237
+
238
+ Search Results: ${o.results.length} result(s) found.
239
+
240
+ ${o.results.length>n?`Showing top ${n} results:
241
+
242
+ `:""}${i.map(s=>JSON.stringify(s)).join(`
243
+ `)}`,details:{generatedQuery:a,searchResults:{...o}}}},Ri=y(Ai,{name:xt,description:"Allows users to search the knowledge graph for text matching their inquiry, using lucene search syntax, against indexed string properties defined on their entities and relationships. Use this tool when the user asks a question about their knowledge graph data as a whole, that could be answered via lucene text search of properties stored on graph elements, e.g requiring fuzzy matching. Otherwise if the inquiry is looking for connected records (e.g. paths), data aggregations, etc explore the data via the queryGraphData tool.",schema:Ci}),St=[fi,vi,Fi,Ei,pi,Ri,$i];async function Li(e,t){let r=await k("arcgis_knowledge_tool_prompt"),a=Wn(t),o={assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps,contextType:a},n=await j({promptText:r,messages:e.arcgisKnowledgeMessages,inputVariables:o,tools:St}),i=(n.tool_calls?.length??0)>0,s=typeof n.text=="string"?n.text.trim():"",d=s.length>0,c=n.content.toString();return!i&&(a==="map"||a==="knowledgeGraph")?{...e,arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,n],outputMessage:a==="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,n],outputMessage:i?c:s,status:i?e.status:d?"success":"failed",summary:c?R(c):"ArcGIS Knowledge Agent tool executed."}}async function zi(e,t){let r=new C(St);try{let a=await r.invoke({messages:e.arcgisKnowledgeMessages},t),o=[];for(let i of a.messages){let s;if(typeof i.content!="string")throw new Error(`Unexpected tool message content type: ${typeof i.content}. Expected string.`);try{s=JSON.parse(i.content)}catch{throw new Error(`Failed to parse tool message content as JSON. Tool: ${i.name??"unknown"}`)}if(!s||typeof s!="object"||!("toolName"in s))throw new Error(`Parsed tool message content does not have expected structure. Parsed content: ${JSON.stringify(s)}`);o.push(s)}await g({text:`Finished executing ArcGIS Knowledge Agent tools: ${a.messages.filter(i=>i.name).map(i=>i.name).join(", ")}`},t);let n=o.filter(i=>typeof i!="string").map(i=>`- Called Tool: ${i.toolName}, Status: ${i.status}`);return{...e,outputMessage:n.join(`
244
+ `),summary:n.length?R(n.join(`
245
+ `)):"ArcGIS Knowledge Agent did not execute any tools or return any results.",arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,...a.messages],arcgisKnowledgeToolResult:o}}catch(a){let o=a instanceof Error?a.message:String(a);return await g({text:`ArcGIS Knowledge Agent tool execution failed: ${o}`},t),{...e,outputMessage:`ArcGIS Knowledge Agent tool execution failed: ${o}`,status:"failed",summary:`ArcGIS Knowledge Agent tool execution failed: ${o}`,arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages]}}}var ji=(e,t)=>J([],"ArcgisKnowledge Agent")(e,t);async function Di(e,t){let r=(e.arcgisKnowledgeToolResult??[]).map(d=>({...d,details:void 0})),{knowledgeGraph:a}=await P(t),o=se.getDataModelTypesSummary(a.dataModel),n={assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,toolResult:r,dataModelSummary:o},i=await ue({promptText:await k("arcgis_knowledge_summarize_result_prompt"),modelTier:"default",inputVariables:n}),s=typeof i=="string"?i:i.content;return{...e,outputMessage:s,status:"success",summary:R(s),arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,new re(s)]}}var Oi=()=>new q(mt).addNode("requireArcgisKnowledgeServices",ji).addNode("agent",Li).addNode("tools",zi).addNode("summarizationLLM",Di).addEdge(F,"requireArcgisKnowledgeServices").addEdge("requireArcgisKnowledgeServices","agent").addConditionalEdges("agent",e=>(e.arcgisKnowledgeMessages[e.arcgisKnowledgeMessages.length-1]?.tool_calls?.length??0)>0?"tools":T).addConditionalEdges("tools",e=>e.status==="failed"?T:"summarizationLLM").addEdge("summarizationLLM",T),Vi=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).
246
+ 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.
247
+ 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,
248
+ 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
249
+ that exist out from specified entities and adding those to the link chart, changing whether or not nonspatial data is visible, or changing the layout of the link chart.
250
+ This agent is designed to handle requests that manipulate the specific link chart.
251
+ For knowledge graph data more generally, the agent can generate Open Cypher queries based on user prompts that represent inquiries into the data of the knowledge service and its graph database,
252
+ and can alternatively use those queries to create a new link chart visualization from the results if requested.
253
+
254
+ Supported actions:
255
+ - **Change or Apply Layout**: Changes the current layout visualization strategy of the link chart (e.g., "Change the layout to basic-grid", "Apply hierarchical layout"). Valid layout types include organic-standard, organic-community, basic-grid, hierarchical-bottom-to-top, radial-root-centric, tree-left-to-right, geographic-organic-standard, chronological-mono-timeline. A best effort should be made to transform the user's request into one of these layout types.
256
+ - **Change Nonspatial Data Visibility**: Changes whether or not nonspatial data is visible on the link chart (e.g., "Show nonspatial data", "Hide nonspatial data"). Valid settings are "hidden" and "visible". A best effort should be made to transform the user's request into one of these settings.
257
+ - **Generate a cypher query**: Generates an Open Cypher query based on the user's prompt which represents an inquiry into the data of the knowledge service and its graph database, attempting to filter based on certain conditions and traverse specified relationships. The generated query should be syntactically correct and optimized for performance. The user should explicitly request that a cypher query be returned - if they do not, the purpose of the query is for one of the other tools or skills.
258
+ - **Create a New Link Chart from a user prompt**: Identifies that the users prompt is an inquiry into the data of the knowledge service and its graph database and creates a new link chart from the results. The user should have requested that a link chart be created or made(or similar term) from their prompt
259
+ - **Add Records (entities or relationships)**: Identifies that the users prompt is an inquiry into the data of the knowledge graph service and its graph database, and that the user wants to take the result of the inquiry and add those entities and/or relationships to the link chart. The generated query should be syntactically correct and optimized for performance.
260
+ - **Search Graph Data**: Generates and runs a lucene syntax query based on the user's prompt, returning matching entity and relationship records from the knowledge graph.
261
+ - **Query Graph Data**: Generates and executes a cypher query based on the user's prompt, and displays the results in the chat pane, allowing the user to explore the data in their knowledge graph.
262
+
263
+ _example: "Change the layout to hierarchical-bottom-to-top"_
264
+ _example: "Apply radial-root-centric layout"_
265
+ _example: "Show nonspatial data"_
266
+ _example: "Hide nonspatial data"_
267
+ _example: "Turn off nonspatial visibility"_
268
+ _example: "Generate a cypher query to find all entities connected to 'Entity A' via 'Relationship X' that were created after 2020"_
269
+ _example: "Generate a query to find all employees of Company Esri who joined after 2015 and are located in California"_
270
+ _example: "Tell me how to find all products supplied by Supplier Y that have a price greater than $1000"_
271
+ _example: "Create a new link chart showing all entities related to 'Entity B' through 'Relationship Y'"_
272
+ _example: "Find all people who work for Microsoft and put them on a new link chart"_
273
+ _example: "Add all entities connected to 'Entity C' via 'Relationship Z' to the current link chart"_
274
+ _example: "Add all the people who work for Esri to the current link chart, and all the cars that they drive"_
275
+ _example: "Find all the products supplied by Supplier X and add them to my visualization"_
276
+ _example: "Expand the link chart from 'Entity D' to show its direct connections"_
277
+ _example: "Find all the cars and then add everything up to two hops away from them on the link chart"_
278
+ _example: "Connect Emma and Rob on the link chart if there is a relationship between them"
279
+ _example: "Discover and add all the relationships originating at 'Entity E' to the link chart"_
280
+ _example: "Show me all entities with a name similar to 'Smith' and add them to the link chart"_
281
+ _example: "Find reports in my graph that have a title similar to 'Quarterly Earnings'"_
282
+ _example: "Find John Smith and all people he has made phone calls to in the last year"_
283
+ _example: "What is the average age of all people who work for Esri?"_`,Al={id:"arcgisKnowledge",name:"ArcgisKnowledge Agent",description:Vi,createGraph:Oi,workspace:mt};return{a:Ml,b:ql,c:Ke,d:Cl,e:Al}},"config","Graphic","portal/Portal","rest/locator","symbols/PictureMarkerSymbol","geometry/Extent","geometry/Point","layers/support/FeatureEffect","layers/support/FeatureFilter","geometry/operators/unionOperator","intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","rest/support/TopFeaturesQuery","rest/support/TopFilter","smartMapping/renderers/pieChart","smartMapping/symbology/pieChart","views/support/colorUtils","smartMapping/renderers/color","smartMapping/symbology/color","smartMapping/renderers/univariateColorSize","smartMapping/renderers/dotDensity","smartMapping/symbology/dotDensity","smartMapping/renderers/heatmap","smartMapping/symbology/heatmap","smartMapping/renderers/predominance","smartMapping/symbology/predominance","smartMapping/renderers/relationship","smartMapping/symbology/relationship","smartMapping/renderers/size","smartMapping/renderers/type","smartMapping/symbology/type","views/LinkChartView","rest/knowledgeGraphService","rest/knowledgeGraph/GraphSearchStreaming","rest/knowledgeGraph/GraphQueryStreaming","request","identity/IdentityManager","WebLinkChart",a)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{b as r}from"./M56MGI7M.js";import{z as o}from"./J2F4YIQI.js";var s=r(o);export{s as a};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- var a=(n,t)=>{let e=n;for(;e;){if(e===t)return!0;if(!e.parentNode)return!1;e.parentNode instanceof ShadowRoot?e=e.parentNode.host:e=e.parentNode}return!1},f=(n,t,e)=>{let s=l(t).subscribe;return s(o=>{o.some(r=>a(n,r.target))&&e()})},c={},l=n=>{let t=n.join(","),e=c[t];if(e!==void 0)return e;let s=new Set,o=new MutationObserver(r=>s.forEach(u=>u(r)));globalThis.document&&o.observe(document.documentElement,{attributes:!0,attributeFilter:n,subtree:!0});let i={subscribe:r=>(s.add(r),()=>{s.delete(r),s.size===0&&(o.disconnect(),c[t]=void 0)})};return c[t]=i,i},d=(n,t)=>{let e=n;for(;e;){let s=e.closest?.(t);if(s)return s;let o=e.getRootNode?.();if(o===globalThis.document)return;e=o.host}};var h=(n,t,e)=>d(n,`[${t}]`)?.getAttribute(t)??e;export{f as a,d as b,h as c};
2
+ var l=(n,t)=>{let e=n;for(;e;){if(e===t)return!0;if(!e.parentNode)return!1;e.parentNode instanceof ShadowRoot?e=e.parentNode.host:e=e.parentNode}return!1},f=(n,t,e)=>{let s=u(t).subscribe;return s(o=>{o.some(r=>l(n,r.target))&&e()})},c={},u=n=>{let t=n.join(","),e=c[t];if(e!==void 0)return e;let s=new Set,o=new MutationObserver(r=>s.forEach(a=>a(r)));globalThis.document&&o.observe(document.documentElement,{attributes:!0,attributeFilter:n,subtree:!0});let i={subscribe:r=>(s.add(r),()=>{s.delete(r),s.size===0&&(o.disconnect(),c[t]=void 0)})};return c[t]=i,i},d=(n,t)=>{let e=n;for(;e;){let s=e.closest?.(t);if(s)return s;let o=e.getRootNode?.();if(o===globalThis.document)return;e=o?.host}};var m=(n,t,e)=>d(n,`[${t}]`)?.getAttribute(t)??e;export{f as a,d as b,m as c};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import b from"./T6OKBDDT.js";import a from"./RYEH3CUI.js";import"./HFNOF6ZK.js";import{c as o,d as n}from"./EJWQC2SL.js";import"./47QQSSPB.js";import"./YGW7TUNX.js";import{v as i,y as s}from"./J2F4YIQI.js";import"./CFDTXKJ6.js";export default $arcgis.t(([{fetchKnowledgeGraph:h},,{e:a}])=>{var r=class extends i{constructor(){super(...arguments),this.agent=a}static{this.properties={referenceElement:1,serviceUrl:3,context:0}}#t;#r;#e;get serviceUrl(){return this.#r}set serviceUrl(e){this.#r=e}async getContext(){let e=this.context?{...this.context,knowledgeGraph:void 0,view:void 0}:{};if(this.#t)return{...e,view:this.#t};if(this.#e)try{let t=await this.#e;return{...e,knowledgeGraph:t}}catch(t){console.error("Failed to load knowledge graph via service URL:",t)}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(e){e.has("serviceUrl")&&this.serviceUrl?this.#e=h(this.serviceUrl):this.#e=void 0}load(){this.#t=n(this)??void 0,o(this)}};s("arcgis-assistant-knowledge-agent",r);return r},"rest/knowledgeGraphService",a,b)