@arcgis/ai-components 5.2.0-next.113 → 5.2.0-next.114

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 (262) hide show
  1. package/dist/agent-utils/LLMAgent.js +78 -53
  2. package/dist/agent-utils/types.d.ts +3 -0
  3. package/dist/agents/tools/filter/setFeatureEffect/adapter.js +17 -17
  4. package/dist/agents/tools/query/getStatistics/adapter.js +5 -5
  5. package/dist/agents/tools/query/getTopFeatures/adapter.js +3 -3
  6. package/dist/agents/tools/query/queryFeatures/adapter.js +1 -1
  7. package/dist/cdn/{EYY367WR.js → 2642ADON.js} +1 -1
  8. package/dist/cdn/{TWU3QXAS.js → 4PKMJMND.js} +1 -1
  9. package/dist/cdn/{IH26MIYY.js → 4XTSGMV7.js} +1 -1
  10. package/dist/cdn/{DG27JEYG.js → 64IWQ7A4.js} +1 -1
  11. package/dist/cdn/{HMNBUGH2.js → AKOLZ4JN.js} +1 -1
  12. package/dist/cdn/{4AQBRGO2.js → AXY6RA5N.js} +1 -1
  13. package/dist/cdn/{HHP5YLUI.js → C2RSZ3VK.js} +1 -1
  14. package/dist/cdn/{SZRJTQ54.js → CA3RNGPN.js} +1 -1
  15. package/dist/cdn/CLRFKSAT.js +2 -0
  16. package/dist/cdn/EJ7QJLUE.js +2 -0
  17. package/dist/cdn/{AVZ5Y6BK.js → ES54NWOB.js} +1 -1
  18. package/dist/cdn/{EDXTPEEU.js → FYIZOGHC.js} +1 -1
  19. package/dist/cdn/{TO2NY7EA.js → FZTNWDOU.js} +1 -1
  20. package/dist/cdn/{EVMIYZWD.js → H4BVWDNV.js} +1 -1
  21. package/dist/cdn/{JICNSK6Y.js → H5DD7DRB.js} +1 -1
  22. package/dist/cdn/{5A355PGH.js → HHQTKKYE.js} +1 -1
  23. package/dist/cdn/{7KSFIRXB.js → HXEAVHLM.js} +1 -1
  24. package/dist/cdn/IMRIVNHX.js +2 -0
  25. package/dist/cdn/{HMIDFTEI.js → J3D2JL4H.js} +1 -1
  26. package/dist/cdn/{AHCXG7XF.js → JNOH4PD5.js} +1 -1
  27. package/dist/cdn/{POZYDAU2.js → JO7U7E24.js} +1 -1
  28. package/dist/cdn/KA3S22NQ.js +2 -0
  29. package/dist/cdn/{ENM3L4AC.js → L3K457Y6.js} +1 -1
  30. package/dist/cdn/{TYATJUNF.js → LUYP76B7.js} +1 -1
  31. package/dist/cdn/{BL273EGZ.js → OT5ECP4V.js} +2 -0
  32. package/dist/cdn/{POL6HKCG.js → PMILRLSD.js} +1 -1
  33. package/dist/cdn/{VNLSYVPE.js → Q5WITJ3L.js} +1 -1
  34. package/dist/cdn/{BBPD2AS7.js → QXOOEBIR.js} +1 -1
  35. package/dist/cdn/{SITY6L4S.js → RGOCE3QN.js} +1 -1
  36. package/dist/cdn/{33SFAZQG.js → RMLCWLJC.js} +1 -1
  37. package/dist/cdn/{2MWUBKWI.js → TAMMDFVT.js} +1 -1
  38. package/dist/cdn/{33PB7ALY.js → TAWMLPK2.js} +1 -1
  39. package/dist/cdn/TGYRNH5D.js +2 -0
  40. package/dist/cdn/{LAVFUDUG.js → U7SYNCYR.js} +1 -1
  41. package/dist/cdn/{H6P3WP5D.js → UT6JA4TK.js} +1 -1
  42. package/dist/cdn/{RXF2NUOL.js → VF4BIBQT.js} +1 -1
  43. package/dist/cdn/{QNXI3WOF.js → XOULSLM7.js} +2 -2
  44. package/dist/cdn/Y27GVWWU.js +2 -0
  45. package/dist/cdn/{7EHOFQ2P.js → Y5O6VNSQ.js} +1 -1
  46. package/dist/cdn/{DWH23NJN.js → YR7EYQ4X.js} +1 -1
  47. package/dist/cdn/{DE26DAW5.js → YYDZAPJP.js} +1 -1
  48. package/dist/cdn/{C7JPWFZE.js → ZGQ27DU2.js} +1 -1
  49. package/dist/cdn/agent-utils/index.js +1 -1
  50. package/dist/cdn/assets/assistant/t9n/messages.ar.json +1 -1
  51. package/dist/cdn/assets/assistant/t9n/messages.bg.json +1 -1
  52. package/dist/cdn/assets/assistant/t9n/messages.bs.json +1 -1
  53. package/dist/cdn/assets/assistant/t9n/messages.ca.json +1 -1
  54. package/dist/cdn/assets/assistant/t9n/messages.cs.json +1 -1
  55. package/dist/cdn/assets/assistant/t9n/messages.da.json +1 -1
  56. package/dist/cdn/assets/assistant/t9n/messages.de.json +1 -1
  57. package/dist/cdn/assets/assistant/t9n/messages.el.json +1 -1
  58. package/dist/cdn/assets/assistant/t9n/messages.es.json +1 -1
  59. package/dist/cdn/assets/assistant/t9n/messages.et.json +1 -1
  60. package/dist/cdn/assets/assistant/t9n/messages.fi.json +1 -1
  61. package/dist/cdn/assets/assistant/t9n/messages.fr.json +1 -1
  62. package/dist/cdn/assets/assistant/t9n/messages.he.json +1 -1
  63. package/dist/cdn/assets/assistant/t9n/messages.hr.json +1 -1
  64. package/dist/cdn/assets/assistant/t9n/messages.hu.json +1 -1
  65. package/dist/cdn/assets/assistant/t9n/messages.id.json +1 -1
  66. package/dist/cdn/assets/assistant/t9n/messages.it.json +1 -1
  67. package/dist/cdn/assets/assistant/t9n/messages.ja.json +1 -1
  68. package/dist/cdn/assets/assistant/t9n/messages.ko.json +1 -1
  69. package/dist/cdn/assets/assistant/t9n/messages.lt.json +1 -1
  70. package/dist/cdn/assets/assistant/t9n/messages.lv.json +1 -1
  71. package/dist/cdn/assets/assistant/t9n/messages.nl.json +1 -1
  72. package/dist/cdn/assets/assistant/t9n/messages.no.json +1 -1
  73. package/dist/cdn/assets/assistant/t9n/messages.pl.json +1 -1
  74. package/dist/cdn/assets/assistant/t9n/messages.pt-BR.json +1 -1
  75. package/dist/cdn/assets/assistant/t9n/messages.pt-PT.json +1 -1
  76. package/dist/cdn/assets/assistant/t9n/messages.ro.json +1 -1
  77. package/dist/cdn/assets/assistant/t9n/messages.ru.json +1 -1
  78. package/dist/cdn/assets/assistant/t9n/messages.sk.json +1 -1
  79. package/dist/cdn/assets/assistant/t9n/messages.sl.json +1 -1
  80. package/dist/cdn/assets/assistant/t9n/messages.sr.json +1 -1
  81. package/dist/cdn/assets/assistant/t9n/messages.sv.json +1 -1
  82. package/dist/cdn/assets/assistant/t9n/messages.th.json +1 -1
  83. package/dist/cdn/assets/assistant/t9n/messages.tr.json +1 -1
  84. package/dist/cdn/assets/assistant/t9n/messages.uk.json +1 -1
  85. package/dist/cdn/assets/assistant/t9n/messages.vi.json +1 -1
  86. package/dist/cdn/assets/assistant/t9n/messages.zh-CN.json +1 -1
  87. package/dist/cdn/assets/assistant/t9n/messages.zh-HK.json +1 -1
  88. package/dist/cdn/assets/assistant/t9n/messages.zh-TW.json +1 -1
  89. package/dist/cdn/assets/assistant-interrupt/t9n/messages.ar.json +1 -1
  90. package/dist/cdn/assets/assistant-interrupt/t9n/messages.bg.json +1 -1
  91. package/dist/cdn/assets/assistant-interrupt/t9n/messages.bs.json +1 -1
  92. package/dist/cdn/assets/assistant-interrupt/t9n/messages.ca.json +1 -1
  93. package/dist/cdn/assets/assistant-interrupt/t9n/messages.cs.json +1 -1
  94. package/dist/cdn/assets/assistant-interrupt/t9n/messages.da.json +1 -1
  95. package/dist/cdn/assets/assistant-interrupt/t9n/messages.de.json +1 -1
  96. package/dist/cdn/assets/assistant-interrupt/t9n/messages.el.json +1 -1
  97. package/dist/cdn/assets/assistant-interrupt/t9n/messages.es.json +1 -1
  98. package/dist/cdn/assets/assistant-interrupt/t9n/messages.et.json +1 -1
  99. package/dist/cdn/assets/assistant-interrupt/t9n/messages.fi.json +1 -1
  100. package/dist/cdn/assets/assistant-interrupt/t9n/messages.fr.json +1 -1
  101. package/dist/cdn/assets/assistant-interrupt/t9n/messages.he.json +1 -1
  102. package/dist/cdn/assets/assistant-interrupt/t9n/messages.hr.json +1 -1
  103. package/dist/cdn/assets/assistant-interrupt/t9n/messages.hu.json +1 -1
  104. package/dist/cdn/assets/assistant-interrupt/t9n/messages.id.json +1 -1
  105. package/dist/cdn/assets/assistant-interrupt/t9n/messages.it.json +1 -1
  106. package/dist/cdn/assets/assistant-interrupt/t9n/messages.ja.json +1 -1
  107. package/dist/cdn/assets/assistant-interrupt/t9n/messages.ko.json +1 -1
  108. package/dist/cdn/assets/assistant-interrupt/t9n/messages.lt.json +1 -1
  109. package/dist/cdn/assets/assistant-interrupt/t9n/messages.lv.json +1 -1
  110. package/dist/cdn/assets/assistant-interrupt/t9n/messages.nl.json +1 -1
  111. package/dist/cdn/assets/assistant-interrupt/t9n/messages.no.json +1 -1
  112. package/dist/cdn/assets/assistant-interrupt/t9n/messages.pl.json +1 -1
  113. package/dist/cdn/assets/assistant-interrupt/t9n/messages.pt-BR.json +1 -1
  114. package/dist/cdn/assets/assistant-interrupt/t9n/messages.pt-PT.json +1 -1
  115. package/dist/cdn/assets/assistant-interrupt/t9n/messages.ro.json +1 -1
  116. package/dist/cdn/assets/assistant-interrupt/t9n/messages.ru.json +1 -1
  117. package/dist/cdn/assets/assistant-interrupt/t9n/messages.sk.json +1 -1
  118. package/dist/cdn/assets/assistant-interrupt/t9n/messages.sl.json +1 -1
  119. package/dist/cdn/assets/assistant-interrupt/t9n/messages.sr.json +1 -1
  120. package/dist/cdn/assets/assistant-interrupt/t9n/messages.sv.json +1 -1
  121. package/dist/cdn/assets/assistant-interrupt/t9n/messages.th.json +1 -1
  122. package/dist/cdn/assets/assistant-interrupt/t9n/messages.tr.json +1 -1
  123. package/dist/cdn/assets/assistant-interrupt/t9n/messages.uk.json +1 -1
  124. package/dist/cdn/assets/assistant-interrupt/t9n/messages.vi.json +1 -1
  125. package/dist/cdn/assets/assistant-interrupt/t9n/messages.zh-CN.json +1 -1
  126. package/dist/cdn/assets/assistant-interrupt/t9n/messages.zh-HK.json +1 -1
  127. package/dist/cdn/assets/assistant-interrupt/t9n/messages.zh-TW.json +1 -1
  128. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.ar.json +1 -0
  129. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.bg.json +1 -0
  130. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.bs.json +1 -0
  131. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.ca.json +1 -0
  132. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.cs.json +1 -0
  133. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.da.json +1 -0
  134. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.de.json +1 -0
  135. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.el.json +1 -0
  136. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.es.json +1 -0
  137. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.et.json +1 -0
  138. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.fi.json +1 -0
  139. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.fr.json +1 -0
  140. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.he.json +1 -0
  141. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.hr.json +1 -0
  142. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.hu.json +1 -0
  143. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.id.json +1 -0
  144. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.it.json +1 -0
  145. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.ja.json +1 -0
  146. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.ko.json +1 -0
  147. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.lt.json +1 -0
  148. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.lv.json +1 -0
  149. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.nl.json +1 -0
  150. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.no.json +1 -0
  151. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.pl.json +1 -0
  152. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.pt-BR.json +1 -0
  153. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.pt-PT.json +1 -0
  154. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.ro.json +1 -0
  155. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.ru.json +1 -0
  156. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.sk.json +1 -0
  157. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.sl.json +1 -0
  158. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.sr.json +1 -0
  159. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.sv.json +1 -0
  160. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.th.json +1 -0
  161. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.tr.json +1 -0
  162. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.uk.json +1 -0
  163. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.vi.json +1 -0
  164. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.zh-CN.json +1 -0
  165. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.zh-HK.json +1 -0
  166. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.zh-TW.json +1 -0
  167. package/dist/cdn/assets/assistant-message/t9n/messages.ar.json +1 -0
  168. package/dist/cdn/assets/assistant-message/t9n/messages.bg.json +1 -0
  169. package/dist/cdn/assets/assistant-message/t9n/messages.bs.json +1 -0
  170. package/dist/cdn/assets/assistant-message/t9n/messages.ca.json +1 -0
  171. package/dist/cdn/assets/assistant-message/t9n/messages.cs.json +1 -0
  172. package/dist/cdn/assets/assistant-message/t9n/messages.da.json +1 -0
  173. package/dist/cdn/assets/assistant-message/t9n/messages.de.json +1 -0
  174. package/dist/cdn/assets/assistant-message/t9n/messages.el.json +1 -0
  175. package/dist/cdn/assets/assistant-message/t9n/messages.es.json +1 -0
  176. package/dist/cdn/assets/assistant-message/t9n/messages.et.json +1 -0
  177. package/dist/cdn/assets/assistant-message/t9n/messages.fi.json +1 -0
  178. package/dist/cdn/assets/assistant-message/t9n/messages.fr.json +1 -0
  179. package/dist/cdn/assets/assistant-message/t9n/messages.he.json +1 -0
  180. package/dist/cdn/assets/assistant-message/t9n/messages.hr.json +1 -0
  181. package/dist/cdn/assets/assistant-message/t9n/messages.hu.json +1 -0
  182. package/dist/cdn/assets/assistant-message/t9n/messages.id.json +1 -0
  183. package/dist/cdn/assets/assistant-message/t9n/messages.it.json +1 -0
  184. package/dist/cdn/assets/assistant-message/t9n/messages.ja.json +1 -0
  185. package/dist/cdn/assets/assistant-message/t9n/messages.ko.json +1 -0
  186. package/dist/cdn/assets/assistant-message/t9n/messages.lt.json +1 -0
  187. package/dist/cdn/assets/assistant-message/t9n/messages.lv.json +1 -0
  188. package/dist/cdn/assets/assistant-message/t9n/messages.nl.json +1 -0
  189. package/dist/cdn/assets/assistant-message/t9n/messages.no.json +1 -0
  190. package/dist/cdn/assets/assistant-message/t9n/messages.pl.json +1 -0
  191. package/dist/cdn/assets/assistant-message/t9n/messages.pt-BR.json +1 -0
  192. package/dist/cdn/assets/assistant-message/t9n/messages.pt-PT.json +1 -0
  193. package/dist/cdn/assets/assistant-message/t9n/messages.ro.json +1 -0
  194. package/dist/cdn/assets/assistant-message/t9n/messages.ru.json +1 -0
  195. package/dist/cdn/assets/assistant-message/t9n/messages.sk.json +1 -0
  196. package/dist/cdn/assets/assistant-message/t9n/messages.sl.json +1 -0
  197. package/dist/cdn/assets/assistant-message/t9n/messages.sr.json +1 -0
  198. package/dist/cdn/assets/assistant-message/t9n/messages.sv.json +1 -0
  199. package/dist/cdn/assets/assistant-message/t9n/messages.th.json +1 -0
  200. package/dist/cdn/assets/assistant-message/t9n/messages.tr.json +1 -0
  201. package/dist/cdn/assets/assistant-message/t9n/messages.uk.json +1 -0
  202. package/dist/cdn/assets/assistant-message/t9n/messages.vi.json +1 -0
  203. package/dist/cdn/assets/assistant-message/t9n/messages.zh-CN.json +1 -0
  204. package/dist/cdn/assets/assistant-message/t9n/messages.zh-HK.json +1 -0
  205. package/dist/cdn/assets/assistant-message/t9n/messages.zh-TW.json +1 -0
  206. package/dist/cdn/assets/assistant-message-loading/t9n/messages.ar.json +1 -0
  207. package/dist/cdn/assets/assistant-message-loading/t9n/messages.bg.json +1 -0
  208. package/dist/cdn/assets/assistant-message-loading/t9n/messages.bs.json +1 -0
  209. package/dist/cdn/assets/assistant-message-loading/t9n/messages.ca.json +1 -0
  210. package/dist/cdn/assets/assistant-message-loading/t9n/messages.cs.json +1 -0
  211. package/dist/cdn/assets/assistant-message-loading/t9n/messages.da.json +1 -0
  212. package/dist/cdn/assets/assistant-message-loading/t9n/messages.de.json +1 -0
  213. package/dist/cdn/assets/assistant-message-loading/t9n/messages.el.json +1 -0
  214. package/dist/cdn/assets/assistant-message-loading/t9n/messages.es.json +1 -0
  215. package/dist/cdn/assets/assistant-message-loading/t9n/messages.et.json +1 -0
  216. package/dist/cdn/assets/assistant-message-loading/t9n/messages.fi.json +1 -0
  217. package/dist/cdn/assets/assistant-message-loading/t9n/messages.fr.json +1 -0
  218. package/dist/cdn/assets/assistant-message-loading/t9n/messages.he.json +1 -0
  219. package/dist/cdn/assets/assistant-message-loading/t9n/messages.hr.json +1 -0
  220. package/dist/cdn/assets/assistant-message-loading/t9n/messages.hu.json +1 -0
  221. package/dist/cdn/assets/assistant-message-loading/t9n/messages.id.json +1 -0
  222. package/dist/cdn/assets/assistant-message-loading/t9n/messages.it.json +1 -0
  223. package/dist/cdn/assets/assistant-message-loading/t9n/messages.ja.json +1 -0
  224. package/dist/cdn/assets/assistant-message-loading/t9n/messages.ko.json +1 -0
  225. package/dist/cdn/assets/assistant-message-loading/t9n/messages.lt.json +1 -0
  226. package/dist/cdn/assets/assistant-message-loading/t9n/messages.lv.json +1 -0
  227. package/dist/cdn/assets/assistant-message-loading/t9n/messages.nl.json +1 -0
  228. package/dist/cdn/assets/assistant-message-loading/t9n/messages.no.json +1 -0
  229. package/dist/cdn/assets/assistant-message-loading/t9n/messages.pl.json +1 -0
  230. package/dist/cdn/assets/assistant-message-loading/t9n/messages.pt-BR.json +1 -0
  231. package/dist/cdn/assets/assistant-message-loading/t9n/messages.pt-PT.json +1 -0
  232. package/dist/cdn/assets/assistant-message-loading/t9n/messages.ro.json +1 -0
  233. package/dist/cdn/assets/assistant-message-loading/t9n/messages.ru.json +1 -0
  234. package/dist/cdn/assets/assistant-message-loading/t9n/messages.sk.json +1 -0
  235. package/dist/cdn/assets/assistant-message-loading/t9n/messages.sl.json +1 -0
  236. package/dist/cdn/assets/assistant-message-loading/t9n/messages.sr.json +1 -0
  237. package/dist/cdn/assets/assistant-message-loading/t9n/messages.sv.json +1 -0
  238. package/dist/cdn/assets/assistant-message-loading/t9n/messages.th.json +1 -0
  239. package/dist/cdn/assets/assistant-message-loading/t9n/messages.tr.json +1 -0
  240. package/dist/cdn/assets/assistant-message-loading/t9n/messages.uk.json +1 -0
  241. package/dist/cdn/assets/assistant-message-loading/t9n/messages.vi.json +1 -0
  242. package/dist/cdn/assets/assistant-message-loading/t9n/messages.zh-CN.json +1 -0
  243. package/dist/cdn/assets/assistant-message-loading/t9n/messages.zh-HK.json +1 -0
  244. package/dist/cdn/assets/assistant-message-loading/t9n/messages.zh-TW.json +1 -0
  245. package/dist/cdn/index.js +1 -1
  246. package/dist/chunks/SKILL.js +1 -1
  247. package/dist/chunks/SKILL2.js +1 -1
  248. package/dist/chunks/dataExplorationAgent.js +3 -3
  249. package/dist/chunks/intent_prompt.js +2 -0
  250. package/dist/chunks/resolveGeometryFilter.js +149 -0
  251. package/dist/chunks/state.js +50 -39
  252. package/dist/docs/api.json +1 -1
  253. package/dist/docs/docs.json +1 -1
  254. package/dist/docs/web-types.json +1 -1
  255. package/package.json +5 -5
  256. package/dist/cdn/4IU63OWQ.js +0 -2
  257. package/dist/cdn/JQYLMTDP.js +0 -2
  258. package/dist/cdn/OMF6ITSG.js +0 -2
  259. package/dist/cdn/SHI76XUV.js +0 -2
  260. package/dist/cdn/UHICISBZ.js +0 -2
  261. package/dist/cdn/ZFOG3KXV.js +0 -2
  262. package/dist/chunks/resolvePointGeometryFilter.js +0 -92
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import b from"./QNXI3WOF.js";import{a}from"./ONQ6JSBJ.js";export default $arcgis.t(([{a:o}])=>{var n=({config:t})=>{let{mapView:e}=a(t,["mapView"]),i=e.map,r=Number.isFinite(e.zoom)?e.zoom:void 0;return JSON.stringify({availableBookmarks:i.bookmarks?.map(({name:s})=>s).filter(Boolean)??[],currentZoom:r},null,2)},l=[async()=>(await import("./CFAC4FN3.js")).default],c=o({id:"navigation",name:"Navigation Agent",description:"Navigates the map for explicit zoom, center, address, bookmark, layer, feature, extent, scale, and viewpoint requests. Use for questions asking where a place is or to resolve an address or place as a reusable spatial anchor for a proximity request. Resolves only the location; it does not query, display, filter, or highlight feature data.",skillLoaders:l,modelTier:"default",systemPrompt:"You are an ArcGIS map navigation agent.",runtimeContextLoader:n,fallbackMessage:"Navigation request completed.",failureMessage:"I couldn't complete the navigation request."});return c},b)
2
+ import b from"./XOULSLM7.js";import{a}from"./ONQ6JSBJ.js";export default $arcgis.t(([{a:o}])=>{var n=({config:t})=>{let{mapView:e}=a(t,["mapView"]),i=e.map,r=Number.isFinite(e.zoom)?e.zoom:void 0;return JSON.stringify({availableBookmarks:i.bookmarks?.map(({name:s})=>s).filter(Boolean)??[],currentZoom:r},null,2)},l=[async()=>(await import("./CFAC4FN3.js")).default],c=o({id:"navigation",name:"Navigation Agent",description:"Navigates the map for explicit zoom, center, address, bookmark, layer, feature, extent, scale, and viewpoint requests. Use for questions asking where a place is or to resolve an address or place as a reusable spatial anchor for a proximity request. Resolves only the location; it does not query, display, filter, or highlight feature data.",skillLoaders:l,modelTier:"default",systemPrompt:"You are an ArcGIS map navigation agent.",runtimeContextLoader:n,fallbackMessage:"Navigation request completed.",failureMessage:"I couldn't complete the navigation request."});return c},b)
@@ -1,3 +1,3 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as I}from"./5BBXNT75.js";import b from"./7EHOFQ2P.js";import{a as $}from"./434TAA3J.js";import{b as D}from"./6OOZSZRJ.js";import{a as M}from"./3UEKINYC.js";import"./RLEHNAIA.js";import a from"./DG27JEYG.js";import"./FS7GXTTQ.js";import{g as A,h,k as C,l as P,n as d,t as v,u as f,v as T,x as y,z as L}from"./COH3QXWG.js";import"./R74ZHFA6.js";import"./V7Y22FRP.js";import"./AXTQU5YL.js";import"./LOQ2PKV5.js";import"./IYLFJCJ2.js";import"./VXFQANGJ.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([B,{whenOnce:F,watch:q,when:V},j,,U,,,H,{property:b,subclass:W},,{b:R}])=>{var G=A`:host{display:block;width:var(--arcgis-internal-panel-width, 100%);height:var(--arcgis-internal-expand-max-height, 100%);--calcite-panel-content-bottom-space: 0}.footer-container{display:flex;flex-direction:column;flex:1 1 0;gap:var(--calcite-spacing-md)}.content-container{display:flex;flex-direction:column;flex:1 1 0;min-height:0;position:relative;overflow:auto}.suggested-prompts-container{display:flex;justify-content:center;width:100%;background:var(--calcite-panel-background-color, var(--calcite-color-background))}.suggested-prompts{display:block;padding:var(--calcite-spacing-md);max-width:100%;box-sizing:border-box}.error-notice{padding:var(--calcite-spacing-sm)}.interrupt-waiting-message{font-style:italic;color:var(--calcite-color-text-2)}`;function S(o){return o.trim()?I.lexer(o).filter(t=>t.type!=="space").map(t=>I.parser([t])):[]}var w=class{constructor(){this._stableParts=[],this._stableText="",this._rawText=""}push(t){return this._rawText+=t,this._advanceStableBoundary(),this.getParts()}finalize(){let t=this._rawText.slice(this._stableText.length);return t.trim()&&(this._stableParts.push(...S(t)),this._stableText=this._rawText),this._stableParts}getParts(){let t=this._trimIncompleteTail(this._rawText.slice(this._stableText.length)),e=t.trim()?S(t):[];return[...this._stableParts,...e]}reset(){this._stableParts=[],this._stableText="",this._rawText=""}_advanceStableBoundary(){let t=this._rawText.slice(this._stableText.length),e=this._lastSafeBoundary(t);if(e<=0)return;let s=t.slice(0,e);this._stableParts.push(...S(s)),this._stableText+=s}_lastSafeBoundary(t){let e=t.split(`
2
+ import{a as I}from"./5BBXNT75.js";import b from"./Y5O6VNSQ.js";import{a as $}from"./434TAA3J.js";import{b as D}from"./6OOZSZRJ.js";import{a as M}from"./3UEKINYC.js";import"./RLEHNAIA.js";import a from"./64IWQ7A4.js";import"./FS7GXTTQ.js";import{g as A,h,k as C,l as P,n as d,t as v,u as f,v as T,x as y,z as L}from"./COH3QXWG.js";import"./R74ZHFA6.js";import"./V7Y22FRP.js";import"./AXTQU5YL.js";import"./LOQ2PKV5.js";import"./IYLFJCJ2.js";import"./VXFQANGJ.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([B,{whenOnce:F,watch:q,when:V},j,,U,,,H,{property:b,subclass:W},,{b:R}])=>{var G=A`:host{display:block;width:var(--arcgis-internal-panel-width, 100%);height:var(--arcgis-internal-expand-max-height, 100%);--calcite-panel-content-bottom-space: 0}.footer-container{display:flex;flex-direction:column;flex:1 1 0;gap:var(--calcite-spacing-md)}.content-container{display:flex;flex-direction:column;flex:1 1 0;min-height:0;position:relative;overflow:auto}.suggested-prompts-container{display:flex;justify-content:center;width:100%;background:var(--calcite-panel-background-color, var(--calcite-color-background))}.suggested-prompts{display:block;padding:var(--calcite-spacing-md);max-width:100%;box-sizing:border-box}.error-notice{padding:var(--calcite-spacing-sm)}.interrupt-waiting-message{font-style:italic;color:var(--calcite-color-text-2)}`;function S(o){return o.trim()?I.lexer(o).filter(t=>t.type!=="space").map(t=>I.parser([t])):[]}var w=class{constructor(){this._stableParts=[],this._stableText="",this._rawText=""}push(t){return this._rawText+=t,this._advanceStableBoundary(),this.getParts()}finalize(){let t=this._rawText.slice(this._stableText.length);return t.trim()&&(this._stableParts.push(...S(t)),this._stableText=this._rawText),this._stableParts}getParts(){let t=this._trimIncompleteTail(this._rawText.slice(this._stableText.length)),e=t.trim()?S(t):[];return[...this._stableParts,...e]}reset(){this._stableParts=[],this._stableText="",this._rawText=""}_advanceStableBoundary(){let t=this._rawText.slice(this._stableText.length),e=this._lastSafeBoundary(t);if(e<=0)return;let s=t.slice(0,e);this._stableParts.push(...S(s)),this._stableText+=s}_lastSafeBoundary(t){let e=t.split(`
3
3
  `),s=!1,r=0,i=0;for(let l of e)/^\s*(```|~~~)/u.test(l)&&(s=!s),i+=l.length+1,l.trim()===""&&!s&&(r=i);return r<t.length?r:0}_trimIncompleteTail(t){let e=t.lastIndexOf("<");if(e!==-1&&!t.includes(">",e))return t.slice(0,e);let s=this._earliestUnclosedTag(t);if(s!==-1)return t.slice(0,s);let r=t.lastIndexOf("[");if(r!==-1){let i=t.slice(r);if(!/\[[^\]]*\]\([^)]*\)/u.test(i))return t.slice(0,r)}return t}_earliestUnclosedTag(t){let e=new Set(["br","img","hr","input","meta","link","area","base","col","embed","source","track","wbr"]),s=/<(\/?)([a-zA-Z][\w-]*)\b[^>]*?(\/?)>/gu,r=[];for(let i=s.exec(t);i;i=s.exec(t)){let[,l,a,n]=i,c=a.toLowerCase();if(!(e.has(c)||n==="/"))if(l==="/"){for(let g=r.length-1;g>=0;g--)if(r[g].name===c){r.splice(g);break}}else r.push({name:c,index:i.index})}return r.length?r[0].index:-1}};function Z(o){let t=new w;return t.push(o),t.finalize()}var J=async o=>await new Promise(t=>setTimeout(t,o));async function*K(o,{chunkSize:t=15,delay:e=50}={}){let s=new w;for(let r=0;r<o.length;r+=t)yield s.push(o.slice(r,r+t)),await J(e);yield s.finalize()}var Q=Object.defineProperty,X=Object.getOwnPropertyDescriptor,m=(o,t,e,s)=>{for(var r=s>1?void 0:s?X(t,e):t,i=o.length-1,l;i>=0;i--)(l=o[i])&&(r=(s?l(t,e,r):l(r))||r);return s&&r&&Q(t,e,r),r},O=o=>!o||typeof o!="object"?!1:o.name==="AbortError";async function*z(o,t,e,s,r=!1){if(r){if(s?.aborted){yield{type:"cancelled",log:e,runId:t};return}yield{type:"block-data",blockType:"text",data:{parts:Z(o)},runId:t};return}for await(let i of K(o)){if(s?.aborted){yield{type:"cancelled",log:e,runId:t};return}yield{type:"block-data",blockType:"text",data:{parts:i},runId:t}}}var p=class extends H{constructor(o){super(o),this.view=null,this.streamingDisabled=!1,this.runtimeEventsEnabled=!1,this.loading=!1,this.processing=!1,this.processingStep=""}async load(){this._set("loading",!0);try{await this._initialize()}finally{this._set("loading",!1)}}destroy(){this.orchestrator?.dispose(),super.destroy()}async _initialize(){this.removeHandles(),await Promise.all([this.portal.load(),this.view?.when()]),this.view&&await F(()=>!this.view.updating),this._set("orchestrator",await R.init({agents:[...this.agents],runtimeEventsEnabled:this.runtimeEventsEnabled,view:this.view??void 0})),this.addHandles([q(()=>[this.view,this.agents],()=>{this._initialize()})])}clearChatHistory(){this.orchestrator?.newConversation()}async*ask(o,t,e){if(!this.orchestrator)throw new Error("Orchestrator not initialized yet.");this._set("processing",!0),this._set("processingStep","");let s=[],r,i="pending";try{let l=this.orchestrator.ask(o,t);for await(let a of l)switch(i=a.runId,a.type){case"runtime":{yield{type:"runtime",event:a,runId:i};break}case"trace":{this._set("processingStep",a.data.text),s.push(a.data.text);break}case"completed":{this._set("processing",!1),this._set("processingStep","");let n=a.result,c=!!n.content.length,g=!!r?.length;if(!c&&!g){yield{type:"completed",error:"No response received.",log:s,runId:i};return}let u=n.content;if(yield{type:"block-start",blockType:"text",runId:i},yield*z(u,i,s,e,this.streamingDisabled),yield{type:"block-end",blockType:"text",runId:i},g)for(let k of r){if(e?.aborted){yield{type:"cancelled",log:s,runId:i};return}let{type:_,data:E}=k;if(yield{type:"block-start",blockType:_,runId:i},_==="text"){let N=typeof E?.content=="string"?E.content:"";yield*z(N,i,s,e,this.streamingDisabled)}else yield{type:"block-data",blockType:_,data:E,runId:i};yield{type:"block-end",blockType:_,runId:i}}yield{type:"completed",response:u,blocks:r,log:s,runId:i};return}case"ux-suggestion":{let n=a.suggestion;r=r?[...r,n]:[n];break}case"interrupt":{let{kind:n,message:c,metadata:g}=a.interrupt,u=Array.isArray(g)?g.filter(_=>typeof _=="string"):[],k=(()=>{switch(n){case"booleanChoice":return{type:"boolean-choice",message:c,options:u};case"singleSelection":return{type:"single-select",message:c,options:u};case"multipleSelection":return{type:"multi-select",message:c,options:u};case"textInput":return{type:"text-input",message:c};default:return{type:n,message:c,options:u}}})();this._set("processingStep","Waiting for user input..."),yield{type:"interrupt",payload:k,runId:i};break}case"cancelled":{yield{type:"cancelled",log:s,runId:i};return}case"error":{if(e?.aborted||O(a.error)){yield{type:"cancelled",log:s,runId:i};return}yield{type:"completed",error:a.error.message,log:s,runId:i};return}default:{console.warn("Unknown event type:",a);break}}}catch(l){if(e?.aborted||O(l)){yield{type:"cancelled",log:s,runId:i};return}console.warn("Error during message processing:",l),yield{type:"completed",error:"An error occurred during message processing.",log:s,runId:"error"};return}finally{this._set("processing",!1)}}cancel(){this.orchestrator?.cancel()}};m([b({readOnly:!0})],p.prototype,"orchestrator",2);m([b()],p.prototype,"agents",2);m([b()],p.prototype,"portal",2);m([b()],p.prototype,"view",2);m([b()],p.prototype,"streamingDisabled",2);m([b()],p.prototype,"runtimeEventsEnabled",2);m([b({readOnly:!0})],p.prototype,"loading",2);m([b({readOnly:!0})],p.prototype,"processing",2);m([b({readOnly:!0})],p.prototype,"processingStep",2);p=m([W("OrchestratorController")],p);var Y="Embeddings resource 'embeddings-v01.json' not found in the webmap portal item.",tt="Embeddings not found for this web map.",et="https://developers.arcgis.com/javascript/latest/agentic-apps/ai-webmap-setup/#embeddings",x=class extends T{constructor(){super(...arguments),this._messages=D({blocking:!0}),this.#t=v(),this.#o=v(),this.#i=v(),this.#e=null,this.#r=new Map,this.#s=j.getDefault(),this.#a=t=>{t.stopPropagation(),this.cancelInterrupt()},this.#n=t=>{t.stopPropagation();let e=t.detail;this.submitInterrupt(e)},this.#l=t=>{t.stopPropagation(),this.keepSuggestedPrompts||(this.suggestedPrompts=[]);let e=t.detail;this._inputValue="",this.arcgisSubmit.emit(e),this.submitMessage(e)},this.#c=t=>{if(this._canceling=!0,t.stopPropagation(),this.arcgisCancel.emit(),this._interrupt){this.orchestrator?.cancelInterrupt(),this._interrupt=null;return}this._orchestratorController?.cancel(),this.#e?.abort(),this.#e=null},this.#h=t=>{t.stopPropagation();let e=t.detail;this.arcgisFeedback.emit(e)},this.#g=t=>{t.stopPropagation();let e=t.detail;this._inputValue=e.prompt,this.arcgisPromptSelect.emit(e)},this.#u=t=>{this.arcgisSlottableRequest.emit(t.detail)},this._orchestratorController=null,this._interrupt=null,this._interruptDetails=[],this._error=null,this._inputValue="",this._isAnswering=!1,this._canceling=!1,this.messages=new B([]),this.referenceElement=null,this.suggestedPrompts=[],this.feedbackEnabled=!1,this.keepSuggestedPrompts=!1,this.streamingDisabled=!1,this.runtimeEventsEnabled=!1,this.logEnabled=!1,this.copyEnabled=!1,this.voiceInputEnabled=!1,this.readAloudEnabled=!1,this.assistantAvatarEnabled=!1,this.userAvatarEnabled=!1,this.arcgisCancel=d(),this.arcgisError=d(),this.arcgisFeedback=d(),this.arcgisInterrupt=d(),this.arcgisInterruptCancel=d(),this.arcgisInterruptSubmit=d(),this.arcgisPromptSelect=d(),this.arcgisReady=d(),this.arcgisResponse=d(),this.arcgisRuntime=d({bubbles:!1,composed:!1}),this.arcgisSlottableRequest=d({bubbles:!1,composed:!1}),this.arcgisSubmit=d()}static{this.properties={_orchestratorController:16,_interrupt:16,_interruptDetails:16,_error:16,_inputValue:16,_isAnswering:16,_signedInUserId:16,_canceling:16,_isSignedIn:16,_user:16,awaitingResponse:32,awaitingResponseStep:32,interrupt:32,messages:0,orchestrator:32,entryMessage:1,heading:1,description:1,referenceElement:1,alwaysUseAgentId:1,allowedAgentIds:0,suggestedPrompts:0,feedbackEnabled:5,keepSuggestedPrompts:5,streamingDisabled:5,runtimeEventsEnabled:5,logEnabled:5,copyEnabled:5,voiceInputEnabled:5,readAloudEnabled:5,assistantAvatarEnabled:5,userAvatarEnabled:5}}static{this.styles=G}#t;#o;#i;#e;#r;#s;#a;#n;#l;#c;#h;#g;#u;get _isSignedIn(){return!!this.#s?.user||!!this._signedInUserId}get _user(){return this.#s?.user?.fullName||this.#s?.user?.username}get awaitingResponse(){return this._orchestratorController?.processing??!1}get awaitingResponseStep(){return this._orchestratorController?.processingStep??""}get interrupt(){return this._interrupt}get orchestrator(){return this._orchestratorController?.orchestrator}cancelInterrupt(){this.arcgisInterruptCancel.emit(),this.orchestrator?.cancelInterrupt(),this._interrupt=null}async clearChatHistory(){this._reset(),this._orchestratorController?.clearChatHistory()}register(t){this.#r.set(t.agent.id,t),this._orchestratorController&&this.#d()}submitInterrupt(t){this.arcgisInterruptSubmit.emit(t),this._interrupt&&(this._interruptDetails=[...this._interruptDetails,{interrupt:this._interrupt,response:t}]),this.orchestrator?.resumeInterrupt(t),this._interrupt=null}async submitMessage(t){let e=t.trim();if(!e||(this.messages.push({id:Date.now().toString(),role:"user",content:e}),!this._orchestratorController))return;this.#e=new AbortController,this._orchestratorController.streamingDisabled=this.streamingDisabled;let s=this.alwaysUseAgentId?{routing:"direct",agentId:this.alwaysUseAgentId}:{routing:"auto",agentIds:this.allowedAgentIds},r=this._orchestratorController.ask(e,s,this.#e?.signal);for await(let i of r){let l=i.runId,a=this.messages.at(-1);switch(i.type){case"runtime":this.arcgisRuntime.emit(i.event);break;case"block-start":{this._isAnswering=!0;let n={type:i.blockType,isPending:!0};if(a?.role==="assistant"&&a.id===l){let c=[...a.blocks??[],n];this.messages.splice(-1,1,{...a,blocks:c})}else this.messages.push({role:"assistant",blocks:[n],id:l,isStreaming:!0,interrupts:this._interruptDetails}),this._interruptDetails=[];break}case"block-data":{if(a?.role!=="assistant"||a?.id!==l)break;let n=[...a.blocks??[]],c=n[n.length-1],{blockType:g,data:u}=i;if(c?.type!==g||!c.isPending)break;g==="text"?n[n.length-1]={...c,data:{...c.data,parts:u?.parts}}:n[n.length-1]={...c,data:{...c.data,...u??{}}},this.messages.splice(-1,1,{...a,blocks:n});break}case"block-end":{if(a?.role!=="assistant"||a?.id!==l)break;let n=[...a.blocks??[]],c=n[n.length-1];if(c?.type!==i.blockType||!c.isPending)break;let g=c;n[n.length-1]={...g,data:{...g.data},isPending:!1},this.messages.splice(-1,1,{...a,blocks:n});break}case"completed":i.error?(this.messages.push({role:"assistant",log:i.log,error:i.error,id:l,interrupts:this._interruptDetails}),this._interruptDetails=[]):a?.role==="assistant"&&a.id===l&&this.messages.splice(-1,1,{...a,content:i.response,blocks:a.blocks?.map(n=>({...n,data:{...n.data},isPending:!1}))??[],isStreaming:!1,log:i.log}),this._isAnswering=!1,this.#e=null,this._canceling=!1;break;case"interrupt":this._interrupt={...i.payload,id:l},this.arcgisInterrupt.emit(this._interrupt);break;case"cancelled":a?.role==="assistant"&&a.id===l?this.messages.splice(-1,1,{...a,blocks:a.blocks?.filter(n=>n.type==="text"||!n.isPending)??[],isStreaming:!1,log:i.log,error:`(${this._messages.stoppedByUserLabel})`}):(this.messages.push({role:"assistant",log:i.log,error:`(${this._messages.stoppedByUserLabel})`,id:l,interrupts:this._interruptDetails}),this._interruptDetails=[]),this._isAnswering=!1,this.#e=null,this._canceling=!1;break}}}unregister(t){this.#r.delete(t),this._orchestratorController&&this.#d()}load(){this.manager.onLifecycle(this._reset.bind(this))}loaded(){this.manager.onLifecycle(()=>{this.#t.value?.addEventListener("arcgisPromptSelect",this.#g),this.#t.value?.addEventListener("arcgisSubmit",this.#l),this.#t.value?.addEventListener("arcgisCancel",this.#c),this.#t.value?.addEventListener("arcgisFeedback",this.#h);let t=V(()=>!!this._interrupt&&!!this.#i.value,()=>{let s=this.#i.value;s.removeEventListener("arcgisSubmit",this.#n),s.removeEventListener("arcgisCancel",this.#a),s.addEventListener("arcgisSubmit",this.#n,{once:!0}),s.addEventListener("arcgisCancel",this.#a,{once:!0})}),e=this.messages.on("after-add",s=>{let r=s.item;r.role==="assistant"&&(r.error||r.content)&&this.arcgisResponse.emit(r)});return queueMicrotask(()=>{this.#p()}),()=>{t.remove(),e.remove(),this.#t.value?.removeEventListener("arcgisPromptSelect",this.#g),this.#i.value?.removeEventListener("arcgisSubmit",this.#n),this.#i.value?.removeEventListener("arcgisCancel",this.#a),this.#t.value?.removeEventListener("arcgisSubmit",this.#l),this.#t.value?.removeEventListener("arcgisCancel",this.#c),this.#t.value?.removeEventListener("arcgisFeedback",this.#h),this._orchestratorController?.destroy(),this._orchestratorController=null}})}willUpdate(t){this.hasUpdated&&t.has("runtimeEventsEnabled")&&this._orchestratorController&&(this._orchestratorController.destroy(),this._orchestratorController=null,this.#p())}async#m(){await U.checkSignInStatus(this.#s.url);let t=await this.#s.load();if(!t.helperServices?.aiAssistantServices?.url)throw new Error(this._messages.serviceUrlNotAvailableMessage);let e=!1,s=await t.fetchSettings();if(s.aiConfig?e=s.aiConfig.aiForOrg?.enabled===!0&&s.aiConfig.aiForOrg?.aiCapabilities?.aiAgents?.enabled===!0:e=s.aiAssistantsEnabled===!0,!e)throw new Error(this._messages.aiAssistantsNotEnabledMessage);if(!t.isPortal&&t?.user?.privileges?.includes("portal:user:useAIAssistants")!==!0)throw new Error(this._messages.userPrivilegesNotSufficientMessage)}async#d(){try{this._error=null;let t=M(this.el,this.referenceElement);await t?.componentOnReady();let e=[...this.#r.values()];return e.length?(await this.#m(),this._orchestratorController?.destroy(),this._orchestratorController=new p({agents:e,portal:this.#s,runtimeEventsEnabled:this.runtimeEventsEnabled,streamingDisabled:this.streamingDisabled,view:t?.view}),await this._orchestratorController.load(),this.requestUpdate(),!0):(this._error=this._messages.noAgentsFoundMessage,!1)}catch(t){return this._error=t?.message??this._messages.orchestratorInitializationErrorMessage,P(this)(t),!1}}async#p(){await this.#d()?this.arcgisReady.emit():this._error&&this.arcgisError.emit(new Error(this._error))}_reset(){this._orchestratorController?.cancel(),this.#e?.abort(),this._interrupt=null,this.messages.removeAll(),this._error=null,this._inputValue="",this._signedInUserId=void 0}_renderEntryMessage(){return this._isSignedIn?this._error?this._renderErrorNotice():this.entryMessage?this.messages.length>0?null:h`<calcite-notice open kind=brand closable icon width=full><div slot=message>${this.entryMessage}</div></calcite-notice>`:h`<slot name=entry-message></slot>`:this._renderSignInNotice()}_renderSignInNotice(){let t=this.#s;return h`<calcite-notice slot=entry-message open kind=brand icon width=full><div slot=message>${this._messages.signInRequiredMessage}</div>${t?h`<calcite-link slot=link @click=${async()=>{try{let e=await U.getCredential(`${t.url}/sharing`);this._signedInUserId=e.userId,this._error=null,this.requestUpdate(),await this.#p()}catch(e){this._error=e?.message??this._messages.signInErrorMessage,this.arcgisError.emit(new Error(this._error)),C("error",this,"Error signing in:",{detail:{error:e}})}}} target=_blank title=${this._messages.signInToArcGISOnlineLabel??y}>${this._messages.signInLabel}</calcite-link>`:h`<div slot=link>${this._messages.noPortalInformationMessage}</div>`}</calcite-notice>`}_renderErrorNotice(){return this._error?h`<calcite-notice slot=entry-message open kind=brand icon width=full>${this._error===Y?h`<div slot=message>${tt}</div><calcite-link slot=link .href=${et} target=_blank title=${this._messages.learnAboutWebMapEmbeddingsLabel??y}>${this._messages.readMoreLabel}</calcite-link>`:h`<div slot=message>${this._error}</div>`}</calcite-notice>`:null}render(){return h`<calcite-panel .loading=${!this._orchestratorController&&!this._error||this._orchestratorController?.loading} .heading=${this.heading??this._messages.assistantLabel} .description=${this.description} ${f(this.#t)}><slot name=header-actions-start slot=header-actions-start></slot><slot name=header-actions-end slot=header-actions-end></slot><div class="content-container"><arcgis-assistant-chat .loading=${this.awaitingResponse} .messages=${this.messages} .interrupt=${this._interrupt}><slot name=message-starter slot=message-starter></slot><slot name=messages slot=messages>${this.messages.map(t=>t.role==="assistant"?h`<arcgis-assistant-message .message=${t} .feedbackEnabled=${this.feedbackEnabled} .logEnabled=${this.logEnabled} .copyEnabled=${this.copyEnabled} .readAloudEnabled=${this.readAloudEnabled} @arcgisSlottableRequest=${this.#u} .assistantAvatarEnabled=${this.assistantAvatarEnabled}>${t.blocks?.map((e,s)=>h`<slot name=${$(t.id,s)??y} slot=${$(t.id,s)??y}><arcgis-assistant-message-block .block=${e}></arcgis-assistant-message-block></slot>`)}</arcgis-assistant-message>`:h`<arcgis-assistant-user-message .message=${t} .user=${this._user} .userAvatarEnabled=${this.userAvatarEnabled}></arcgis-assistant-user-message>`)}</slot>${this._interrupt?h`<div slot=message-loading><div class="interrupt-waiting-message">${this._messages.waitingForUserInputMessage}</div></div>`:h`<slot name=message-loading slot=message-loading><arcgis-assistant-message-loading .loading=${this.awaitingResponse} .loadingMessage=${this.awaitingResponseStep} .assistantAvatarEnabled=${this.assistantAvatarEnabled} .interrupts=${this._interruptDetails}></arcgis-assistant-message-loading></slot>`}</arcgis-assistant-chat></div>${this._interrupt?h`<slot name=interrupt><arcgis-assistant-interrupt slot=content-bottom .type=${this._interrupt.type} .message=${this._interrupt.message} .options=${this._interrupt.options} ${f(this.#i)}></arcgis-assistant-interrupt></slot>`:this.suggestedPrompts?.length?h`<div class="suggested-prompts-container" slot=content-bottom><arcgis-assistant-suggested-prompts class="suggested-prompts" .prompts=${this.suggestedPrompts}></arcgis-assistant-suggested-prompts></div>`:null}<div class="footer-container" slot=footer>${this._renderEntryMessage()}<slot name=chat-entry><arcgis-assistant-chat-entry .awaitingResponse=${this.awaitingResponse||this._isAnswering} .inputValue=${this._inputValue} .messages=${this.messages} .voiceInputEnabled=${this.voiceInputEnabled} .disabled=${this._canceling||!this._isSignedIn||!!this._interrupt||!!this._error} ${f(this.#o)}><slot name=entry-actions-start slot=entry-actions-start></slot><slot name=entry-actions-end slot=entry-actions-end><calcite-button .iconStart=${this.awaitingResponse||this._isAnswering?"circle-stop":"send"} @click=${()=>{this.#o.value?.submitMessage()}} round>${this.awaitingResponse||this._isAnswering?this._messages.stopButtonLabel:this._messages.askButtonLabel}</calcite-button></slot></arcgis-assistant-chat-entry></slot><slot name=footer-content></slot></div></calcite-panel>`}};L("arcgis-assistant",x);return x},"core/Collection","core/reactiveUtils","portal/Portal","request","identity/IdentityManager","config","layers/FeatureLayer","core/Accessor","core/accessorSupport/decorators",a,b)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import p from"./HMNBUGH2.js";import n from"./QNXI3WOF.js";import{a as o,c as m}from"./V6HOUZPZ.js";import"./TWU3QXAS.js";import l from"./VWP2B4LB.js";import"./5Q2XRQS6.js";import k from"./K7YQIJFT.js";import j from"./H6P3WP5D.js";import h from"./SZRJTQ54.js";import g from"./AVZ5Y6BK.js";import f from"./CCC6LBMY.js";import"./34O57OGV.js";import"./LXPGQNXQ.js";import"./FDOMMK2M.js";import e from"./WVP73XWD.js";import"./Z5XQLSYH.js";import"./OZAZ277H.js";import d from"./AVRS6UCQ.js";import"./K5JVB6FU.js";import"./FCI6M62J.js";import"./BFZ5S7NF.js";import"./3UEKINYC.js";import"./RLEHNAIA.js";import c from"./DG27JEYG.js";import"./FS7GXTTQ.js";import"./WXQ26G5Q.js";import"./MJSIYEWN.js";import b from"./AHCXG7XF.js";import a from"./UHICISBZ.js";import"./ONQ6JSBJ.js";import{v as i,z as r}from"./COH3QXWG.js";import"./R74ZHFA6.js";import"./V7Y22FRP.js";import"./AXTQU5YL.js";import"./LOQ2PKV5.js";import"./IYLFJCJ2.js";import"./VXFQANGJ.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([,,,,,,,,,,,,,,,,,,,,,,p])=>{var t=class extends i{constructor(){super(...arguments),this.agent=p}static{this.properties={referenceElement:1}}#t;#i;getContext(){if(!this.#t)throw new Error("arcgis-assistant-navigation-agent requires a mapView");return{mapView:this.#t}}load(){this.#t=o(this,"arcgis-assistant-navigation-agent"),this.#i=m(this)}disconnectedCallback(){this.#i?.unregister(this.agent.id),super.disconnectedCallback()}};r("arcgis-assistant-navigation-agent",t);return t},"identity/IdentityManager","portal/Portal","request","config","core/reactiveUtils","layers/FeatureLayer","intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","rest/knowledgeGraphService",a,b,c,d,e,f,g,h,j,k,l,n,p)
2
+ import p from"./AKOLZ4JN.js";import n from"./XOULSLM7.js";import{a as o,c as m}from"./V6HOUZPZ.js";import"./4PKMJMND.js";import l from"./VWP2B4LB.js";import"./5Q2XRQS6.js";import k from"./K7YQIJFT.js";import j from"./UT6JA4TK.js";import h from"./CA3RNGPN.js";import g from"./ES54NWOB.js";import f from"./CCC6LBMY.js";import"./34O57OGV.js";import"./LXPGQNXQ.js";import"./FDOMMK2M.js";import e from"./WVP73XWD.js";import"./Z5XQLSYH.js";import"./OZAZ277H.js";import d from"./AVRS6UCQ.js";import"./K5JVB6FU.js";import"./FCI6M62J.js";import"./BFZ5S7NF.js";import"./3UEKINYC.js";import"./RLEHNAIA.js";import c from"./64IWQ7A4.js";import"./FS7GXTTQ.js";import"./WXQ26G5Q.js";import"./MJSIYEWN.js";import b from"./JNOH4PD5.js";import a from"./KA3S22NQ.js";import"./ONQ6JSBJ.js";import{v as i,z as r}from"./COH3QXWG.js";import"./R74ZHFA6.js";import"./V7Y22FRP.js";import"./AXTQU5YL.js";import"./LOQ2PKV5.js";import"./IYLFJCJ2.js";import"./VXFQANGJ.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([,,,,,,,,,,,,,,,,,,,,,,p])=>{var t=class extends i{constructor(){super(...arguments),this.agent=p}static{this.properties={referenceElement:1}}#t;#i;getContext(){if(!this.#t)throw new Error("arcgis-assistant-navigation-agent requires a mapView");return{mapView:this.#t}}load(){this.#t=o(this,"arcgis-assistant-navigation-agent"),this.#i=m(this)}disconnectedCallback(){this.#i?.unregister(this.agent.id),super.disconnectedCallback()}};r("arcgis-assistant-navigation-agent",t);return t},"identity/IdentityManager","portal/Portal","request","config","core/reactiveUtils","layers/FeatureLayer","intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","rest/knowledgeGraphService",a,b,c,d,e,f,g,h,j,k,l,n,p)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import b from"./CCC6LBMY.js";import{a as B,b as S}from"./34O57OGV.js";import a from"./UHICISBZ.js";import{a as g}from"./ONQ6JSBJ.js";import{Dc as h}from"./IYLFJCJ2.js";import{a as e}from"./VXFQANGJ.js";export default $arcgis.t(([k,j,{a:m,d:b,e:w,f:F},{d:T}])=>{var q=i=>i.flatMap(t=>t.split(",")).map(t=>t.trim()).map(t=>t.split(/\s+/u)[0]?.replace(/^"|"$/gu,"")).filter(t=>!!t),R=async(i,t,n,a,d)=>{let s=n.map?.allLayers.find(o=>o.id===i.layerId),c=await n.whenLayerView(s),u=s.title??i.layerId,l;if(a){let o=await b(a,n);if("error"in o)return{tool:"getTopFeatures",layerName:u,summary:"Geometry lookup failed",details:{error:o.error}};if(!o.geometry)return{tool:"getTopFeatures",layerName:u,summary:"No features found for geometry filter",details:{error:`No features found matching: ${"where"in a?a.where:"unknown criteria"}`}};l=o.geometry}else d&&(l=n.extent.clone());let y=t.groupByFields&&t.groupByFields.length>0,f=s.objectIdField,p=i.outFields.includes("*")?["*"]:[...new Set([...i.outFields,f])];try{let o;if(y){let r=new k({where:i.where||"1=1",outFields:p,orderByFields:i.orderByFields,geometry:l,spatialRelationship:l?"intersects":void 0,distance:a?.distance,units:a?.units,topFilter:new j({topCount:t.topCount,groupByFields:t.groupByFields,orderByFields:t.orderByFields})});o=await s.queryTopFeatures(r)}else{let r=s.createQuery();r.where=S(s.definitionExpression,i.where||"1=1"),r.outFields=p.length?p:["*"],r.orderByFields=t.orderByFields,r.returnGeometry=!1,r.num=t.topCount,l&&(r.geometry=l,r.spatialRelationship="intersects"),a?.distance&&(r.distance=a.distance),a?.units&&(r.units=a.units),r.outSpatialReference=n.spatialReference;let v=[...new Set([...i.outFields,...q(t.orderByFields)])],N=B(c,v,d??!1);try{o=N?await c.queryFeatures(r):await s.queryFeatures(r)}catch(x){console.warn("Client-side query failed, falling back to server:",x),o=await s.queryFeatures(r)}}let C=o.features.map(r=>r.attributes[f]),{attributes:I}=T(s,o,n.timeZone);return{tool:"getTopFeatures",layerName:u,summary:`Top ${t.topCount} features extracted`,details:{topCount:t.topCount,attributes:I,objectIds:C,objectIdField:f,where:i.where,orderByFields:t.orderByFields,...y&&{groupByFields:t.groupByFields}}}}catch(o){return{tool:"getTopFeatures",layerName:u,summary:"Query failed",details:{error:o instanceof Error?o.message:String(o)}}}},D=async({targetLayer:i,topFilter:t,geometryFilter:n,useCurrentExtent:a},d)=>{let{mapView:s}=g(d,["mapView"]),c=F(n,d.state?.agentExecutionContext?.sharedResources),u=await R(i,t,s,c,a);return JSON.stringify(u,null,2)},E=e.object({layerId:e.string().describe("The layerId of the layer containing the geometry by which to filter."),where:e.string().describe("The SQL-92 where clause representing the features from which to filter."),distance:e.number().optional().describe("The buffer distance around the geometry."),units:m.optional().describe("The units for the distance buffer.")}),L=e.object({point:e.object({x:e.number().describe("X coordinate (longitude) from navigation result"),y:e.number().describe("Y coordinate (latitude) from navigation result"),spatialReference:e.object({wkid:e.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:e.number().optional().describe("Optional buffer distance around the point."),units:m.optional().describe("The units for the distance buffer.")}),U=e.object({targetLayer:e.object({layerId:e.string().describe("The layerId of the layer containing the field from which to get a value."),where:e.string().describe("The SQL-92 where clause representing the feature from which to get an attribute value."),orderByFields:e.array(e.string().describe("The field(s) and order for which to sort the resulting features.")),outFields:e.array(e.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:e.union([E,L,w]).optional().describe("Geometry filter for spatial queries. Use 'sharedResourceId' with an ID from listSharedResources for a previously geocoded location. Use 'point' for inline coordinates or 'layerId/where' for features from another layer."),topFilter:e.object({topCount:e.number().describe("Number of top features to return per group."),orderByFields:e.array(e.string().describe("Field(s) to rank by with ASC/DESC. Must be existing field names, not aggregate functions.")),groupByFields:e.array(e.string().describe("Field(s) to group results by. Returns top N per group."))}).required(),useCurrentExtent:e.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).")}),Y=h(D,{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:U});return Y},"rest/support/TopFeaturesQuery","rest/support/TopFilter",a,b)
2
+ import b from"./CCC6LBMY.js";import{a as B,b as S}from"./34O57OGV.js";import a from"./KA3S22NQ.js";import{a as g}from"./ONQ6JSBJ.js";import{Dc as h}from"./IYLFJCJ2.js";import{a as e}from"./VXFQANGJ.js";export default $arcgis.t(([k,j,{a:m,d:b,e:w,f:F},{d:T}])=>{var q=i=>i.flatMap(t=>t.split(",")).map(t=>t.trim()).map(t=>t.split(/\s+/u)[0]?.replace(/^"|"$/gu,"")).filter(t=>!!t),R=async(i,t,n,a,d)=>{let s=n.map?.allLayers.find(o=>o.id===i.layerId),c=await n.whenLayerView(s),u=s.title??i.layerId,l;if(a){let o=await b(a,n);if("error"in o)return{tool:"getTopFeatures",layerName:u,summary:"Geometry lookup failed",details:{error:o.error}};if(!o.geometry)return{tool:"getTopFeatures",layerName:u,summary:"No features found for geometry filter",details:{error:`No features found matching: ${"where"in a?a.where:"unknown criteria"}`}};l=o.geometry}else d&&(l=n.extent.clone());let y=t.groupByFields&&t.groupByFields.length>0,f=s.objectIdField,p=i.outFields.includes("*")?["*"]:[...new Set([...i.outFields,f])];try{let o;if(y){let r=new k({where:i.where||"1=1",outFields:p,orderByFields:i.orderByFields,geometry:l,spatialRelationship:l?"intersects":void 0,distance:a?.distance,units:a?.units,topFilter:new j({topCount:t.topCount,groupByFields:t.groupByFields,orderByFields:t.orderByFields})});o=await s.queryTopFeatures(r)}else{let r=s.createQuery();r.where=S(s.definitionExpression,i.where||"1=1"),r.outFields=p.length?p:["*"],r.orderByFields=t.orderByFields,r.returnGeometry=!1,r.num=t.topCount,l&&(r.geometry=l,r.spatialRelationship="intersects"),a?.distance&&(r.distance=a.distance),a?.units&&(r.units=a.units),r.outSpatialReference=n.spatialReference;let v=[...new Set([...i.outFields,...q(t.orderByFields)])],N=B(c,v,d??!1);try{o=N?await c.queryFeatures(r):await s.queryFeatures(r)}catch(x){console.warn("Client-side query failed, falling back to server:",x),o=await s.queryFeatures(r)}}let C=o.features.map(r=>r.attributes[f]),{attributes:I}=T(s,o,n.timeZone);return{tool:"getTopFeatures",layerName:u,summary:`Top ${t.topCount} features extracted`,details:{topCount:t.topCount,attributes:I,objectIds:C,objectIdField:f,where:i.where,orderByFields:t.orderByFields,...y&&{groupByFields:t.groupByFields}}}}catch(o){return{tool:"getTopFeatures",layerName:u,summary:"Query failed",details:{error:o instanceof Error?o.message:String(o)}}}},D=async({targetLayer:i,topFilter:t,geometryFilter:n,useCurrentExtent:a},d)=>{let{mapView:s}=g(d,["mapView"]),c=F(n,d.state?.agentExecutionContext?.sharedResources),u=await R(i,t,s,c,a);return JSON.stringify(u,null,2)},E=e.object({layerId:e.string().describe("The layerId of the layer containing the geometry by which to filter."),where:e.string().describe("The SQL-92 where clause representing the features from which to filter."),distance:e.number().optional().describe("The buffer distance around the geometry."),units:m.optional().describe("The units for the distance buffer.")}),L=e.object({point:e.object({x:e.number().describe("X coordinate (longitude) from navigation result"),y:e.number().describe("Y coordinate (latitude) from navigation result"),spatialReference:e.object({wkid:e.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:e.number().optional().describe("Optional buffer distance around the point."),units:m.optional().describe("The units for the distance buffer.")}),U=e.object({targetLayer:e.object({layerId:e.string().describe("The layerId of the layer containing the field from which to get a value."),where:e.string().describe("The SQL-92 where clause representing the feature from which to get an attribute value."),orderByFields:e.array(e.string().describe("The field(s) and order for which to sort the resulting features.")),outFields:e.array(e.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:e.union([E,L,w]).optional().describe("Geometry filter for spatial queries. Use 'sharedResourceId' with an ID from listSharedResources for a previously geocoded location. Use 'point' for inline coordinates or 'layerId/where' for features from another layer."),topFilter:e.object({topCount:e.number().describe("Number of top features to return per group."),orderByFields:e.array(e.string().describe("Field(s) to rank by with ASC/DESC. Must be existing field names, not aggregate functions.")),groupByFields:e.array(e.string().describe("Field(s) to group results by. Returns top N per group."))}).required(),useCurrentExtent:e.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).")}),Y=h(D,{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:U});return Y},"rest/support/TopFeaturesQuery","rest/support/TopFilter",a,b)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{d as b}from"./FS7GXTTQ.js";import{Ya as G,ka as u,r as E,s as y}from"./LOQ2PKV5.js";var x=new Set(["agentExecutionContext","outputMessage","summary","status","sharedResourceAdditions"]);function O(r){let o=[...new Set([...r].filter(t=>x.has(t)))];if(o.length!==0)throw new Error(`custom state cannot define reserved runtime fields: ${o.join(", ")}.`)}function $(r){let o=Object.entries(r);return Object.fromEntries(o.map(([t,n])=>[t,u({reducer:(s,h)=>h,default:()=>n})]))}function S(r={}){O(Object.keys(r));let o=$(r);return u.Root({...o,agentExecutionContext:u({reducer:(t,n)=>({...t,...n}),default:b}),outputMessage:u({reducer:(t="",n)=>typeof n=="string"&&n.trim()?n:t,default:()=>""}),summary:u({reducer:(t="",n)=>typeof n=="string"?n:t,default:()=>""}),status:u({reducer:(t,n)=>n??t,default:()=>{}}),sharedResourceAdditions:u({reducer:(t,n)=>n,default:()=>{}})})}function M(r,o=[]){let t=new Set(o);for(let s of r)for(let h of Object.keys(s.shape??{}))t.add(h);let n=Object.fromEntries([...t].map(s=>[s,void 0]));return S(n)}function P(r,o,t,n={}){let{agent:s,entryNode:h,middlewares:f=[]}=n,i=new G(t);if(Object.keys(r).length===0)throw new Error("Graph requires at least one node.");if(o.length===0)throw new Error("Graph requires at least one edge.");if(f.length>0&&!s)throw new Error("Graph middleware requires agent metadata.");let a=new Set(Object.keys(r)),l=new Map,g=new Map;for(let e of a)l.set(e,0),g.set(e,0);for(let e of o)"to"in e?(a.has(e.from)&&g.set(e.from,(g.get(e.from)??0)+1),a.has(e.to)&&l.set(e.to,(l.get(e.to)??0)+1)):a.has(e.from)&&g.set(e.from,(g.get(e.from)??0)+1);for(let[e,d]of Object.entries(r)){let w=N(s,e,f,async(c,p)=>await Promise.resolve(d(c,p))),m=async(c,p)=>await w(c,p);i=i.addNode(e,m)}for(let e of o)if("to"in e){let d=e.from,w=e.to;if(!a.has(d))throw new Error(`Graph edge references unknown from-node: ${d}`);if(!a.has(w))throw new Error(`Graph edge references unknown to-node: ${w}`);i.addEdge(d,w)}else{let d=e.from;if(!a.has(d))throw new Error(`Graph conditional edge references unknown from-node: ${d}`);i.addConditionalEdges(d,async(w,m)=>{let c=await e.decide(w,m);if(!c)return y;if(!a.has(c))throw new Error(`Graph conditional edge returned unknown node: ${c}`);return c})}let k=R(a,l,h);i.addEdge(E,k);let j=[...a].filter(e=>(g.get(e)??0)===0);for(let e of j)i.addEdge(e,y);return i}function N(r,o,t,n){return!t.length||!r?n:async(s,h)=>await t.reduceRight((f,i)=>async a=>await i.handler(a,f),async f=>{let i=await n(f.state,f.config);return{...f.state,...i}})({agent:r,config:h,nodeName:o,state:s})}function R(r,o,t){if(t){if(!r.has(t))throw new Error(`Graph entry node references unknown node: ${t}`);return t}let n=[...r].filter(s=>(o.get(s)??0)===0);if(n.length!==1)throw new Error(`Graph could not infer a single entry node (found ${n.length}). Provide an explicit entryNode or ensure exactly one node has no incoming edges.`);return n[0]}export{O as a,$ as b,S as c,M as d,P as e};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import"./UZLQALHY.js";var e='---\nname: query\ndescription: Answers questions about feature-layer data, including counts, matching records, field values, aggregates, rankings, and spatially constrained results. Use when the user asks to inspect or summarize map data.\nallowed-tools: findRelevantLayers findRelevantFields getAttribute getStatistics getTopFeatures queryFeatures\n---\n\n# Query\n\n- When the task refers to geometry produced by an earlier agent, call `listSharedResources` with `point`, `polyline` and `polygon` as the requested kinds. If a resource description clearly matches, pass its exact ID as `geometryFilter.sharedResourceId` and use `where: "1=1"` unless the user requests an additional attribute filter. If no resource clearly matches, state that the spatial constraint is unavailable and do not guess geometry.\n- Start with `findRelevantLayers` unless a previous tool result from this run explicitly identifies the relevant layer ID. Use the assigned task as the semantic query.\n- If no relevant layers are returned, explain that no matching map layer was found and stop. Never invent a layer ID.\n- Before querying, call `findRelevantFields` with only relevant layer IDs. Use only the exact field names and categorical values returned by `findRelevantFields`.\n- Set `includeSummaryStatistics` to true when the requested answer directly depends on whole-layer numeric summary statistics such as average, minimum, maximum, sum, variance, standard deviation, null count, or range. Otherwise leave it false and use `getStatistics` later if analysis requires statistics under an attribute or spatial constraint.\n- Use statistics returned by `findRelevantFields` when they directly answer an unfiltered whole-layer question. Use `getStatistics` when a where clause or spatial constraint must be applied.\n- Use `queryFeatures` to count, find, or list matching features. It is the default query tool.\n- Use `getTopFeatures` for highest, lowest, first, last, or top-N records ranked by an existing field.\n- Use `getAttribute` only when retrieving a particular attribute from a specifically identified feature.\n- Use real field names rather than aliases in SQL-92 where clauses. Use `1=1` when no attribute filter is requested.\n- Set `useCurrentExtent` only when the user explicitly refers to the current view or visible map area.\n- If the request asks to visually show, display, highlight, map, filter, reveal, emphasize, hide, include, or exclude matching features, preserve the information needed for a visual operation in the working context: layer ID, where clause, geometry filter, `useCurrentExtent`, object IDs when available, and count. Preserve the exact values returned or used by tools so another skill can reuse them without repeating discovery.\n- Only answer requests about the current map\'s layers, features, fields, spatial relationships, or supported map actions. Do not use general model knowledge to answer unrelated requests, even when the assigned task or user asks for it. For an unsupported request, respond only: "I can help with questions about the data and features in this map."\n- Answer the assigned question directly. Do not provide unsolicited recommendations about dataset design, publishing, classification, grouping, future analysis, or alternate workflows.\n- Ask for clarification only when the requested result is genuinely ambiguous or cannot be computed reliably from the available layers and fields.\n- Base the final answer only on returned tool data. State failures or empty results directly and do not fabricate values.\n';export{e as default};
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import b from"./CCC6LBMY.js";import{a as x,b as O}from"./34O57OGV.js";import a from"./UHICISBZ.js";import{a as L}from"./ONQ6JSBJ.js";import{Dc as T}from"./IYLFJCJ2.js";import{a as e}from"./VXFQANGJ.js";export default $arcgis.t(([{a:p,b:g,c:b,d:v,e:R,f:j},{d:N}])=>{var w=25,k=i=>i.flatMap(r=>r.split(",")).map(r=>r.trim()).map(r=>r.split(/\s+/u)[0]?.replace(/^"|"$/gu,"")).filter(r=>!!r),E=async(i,r,t,l)=>{let s=r.map?.allLayers.find(u=>u.id===i.layerId),d=await r.whenLayerView(s),f=s.title??i.layerId,h;if(t){let u=await v(t,r);if("error"in u){let o={error:u.error};if(b(t)){let c=r.map?.allLayers.find(m=>m.id===t.layerId);o.geometryLayerName=c?.title??c?.id,o.geometryLayerId=t.layerId,o.geometryWhere=t.where}else g(t)&&(o.point=t.point);return{tool:"queryFeatures",layerName:f,summary:"Geometry lookup failed",details:o}}if(!u.geometry){let o={};if(b(t)){let c=r.map?.allLayers.find(m=>m.id===t.layerId);o.error=`No features found matching: ${t.where}`,o.geometryLayerName=c?.title??c?.id,o.geometryLayerId=t.layerId,o.geometryWhere=t.where}else g(t)&&(o.error="Failed to create point geometry",o.point=t.point);return{tool:"queryFeatures",layerName:f,summary:"No features found for geometry filter",details:o}}h=u.geometry}else l&&(h=r.extent.clone());let C=[...new Set([...i.outFields,...k(i.orderByFields)])],F=x(d,C,l??!1),I=s.objectIdField,a=s.createQuery();a.where=O(s.definitionExpression,i.where||"1=1"),a.outFields=i.outFields.includes("*")?["*"]:[...new Set([...i.outFields,I])],a.orderByFields=i.orderByFields,h&&(a.geometry=h,a.spatialRelationship="intersects"),t?.distance&&(a.distance=t.distance),t?.units&&(a.units=t.units),a.outSpatialReference=r.spatialReference;let n,y;try{n=F?await d.queryFeatureCount(a):await s.queryFeatureCount(a),n>0&&n<=w&&(y=F?await d.queryFeatures(a):await s.queryFeatures(a))}catch(u){console.warn("Client-side query failed, falling back to server:",u),n=await s.queryFeatureCount(a),n>0&&n<=w&&(y=await s.queryFeatures(a))}let{objectIds:q,attributes:S}=y?N(s,y,r.timeZone):{objectIds:void 0,attributes:void 0};return{tool:"queryFeatures",layerName:f,summary:`${n} features found`,details:{totalCount:n,where:i.where,orderByFields:i.orderByFields,outFields:i.outFields,...q&&{objectIds:q,objectIdField:I},...S&&{attributes:S},...n>w&&{note:`${n} features found.`}}}};async function W({targetLayer:i,geometryFilter:r,useCurrentExtent:t},l){let{mapView:s}=L(l,["mapView"]),d=j(r,l.state?.agentExecutionContext?.sharedResources),f=await E(i,s,d,t);return JSON.stringify(f,null,2)}var B=e.object({layerId:e.string().describe("The layerId of the layer containing the geometry by which to filter."),where:e.string().describe("The SQL-92 where clause representing the features from which to filter."),distance:e.number().optional().describe("The buffer distance around the geometry."),units:p.optional().describe("The units for the distance buffer.")}),U=e.object({point:e.object({x:e.number().describe("X coordinate (longitude) from navigation result"),y:e.number().describe("Y coordinate (latitude) from navigation result"),spatialReference:e.object({wkid:e.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:e.number().optional().describe("Optional buffer distance around the point."),units:p.optional().describe("The units for the distance buffer.")}),D=e.object({targetLayer:e.object({layerId:e.string().describe("The layerId of the layer containing the field from which to get a value."),where:e.string().describe("SQL-92 where clause. IMPORTANT: When using geometryFilter.point or geometryFilter.sharedResourceId 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:e.array(e.string().describe("The field(s) and order for which to sort the resulting features.")),outFields:e.array(e.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:e.union([B,U,R]).optional().describe("Geometry filter for spatial queries. Use 'sharedResourceId' with an ID from listSharedResources for a previously geocoded location. Use 'point' for inline coordinates or 'layerId/where' for features from another layer."),useCurrentExtent:e.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).")}),H=T(W,{name:"queryFeatures",description:`Queries features from a layer. Returns the total count of matching features, plus individual feature attributes if \u226425 features match.
2
+ import b from"./CCC6LBMY.js";import{a as x,b as O}from"./34O57OGV.js";import a from"./KA3S22NQ.js";import{a as L}from"./ONQ6JSBJ.js";import{Dc as T}from"./IYLFJCJ2.js";import{a as e}from"./VXFQANGJ.js";export default $arcgis.t(([{a:p,b:g,c:b,d:v,e:R,f:j},{d:N}])=>{var w=25,k=i=>i.flatMap(r=>r.split(",")).map(r=>r.trim()).map(r=>r.split(/\s+/u)[0]?.replace(/^"|"$/gu,"")).filter(r=>!!r),E=async(i,r,t,l)=>{let s=r.map?.allLayers.find(u=>u.id===i.layerId),d=await r.whenLayerView(s),f=s.title??i.layerId,h;if(t){let u=await v(t,r);if("error"in u){let o={error:u.error};if(b(t)){let c=r.map?.allLayers.find(m=>m.id===t.layerId);o.geometryLayerName=c?.title??c?.id,o.geometryLayerId=t.layerId,o.geometryWhere=t.where}else g(t)&&(o.point=t.point);return{tool:"queryFeatures",layerName:f,summary:"Geometry lookup failed",details:o}}if(!u.geometry){let o={};if(b(t)){let c=r.map?.allLayers.find(m=>m.id===t.layerId);o.error=`No features found matching: ${t.where}`,o.geometryLayerName=c?.title??c?.id,o.geometryLayerId=t.layerId,o.geometryWhere=t.where}else g(t)&&(o.error="Failed to create point geometry",o.point=t.point);return{tool:"queryFeatures",layerName:f,summary:"No features found for geometry filter",details:o}}h=u.geometry}else l&&(h=r.extent.clone());let C=[...new Set([...i.outFields,...k(i.orderByFields)])],F=x(d,C,l??!1),I=s.objectIdField,a=s.createQuery();a.where=O(s.definitionExpression,i.where||"1=1"),a.outFields=i.outFields.includes("*")?["*"]:[...new Set([...i.outFields,I])],a.orderByFields=i.orderByFields,h&&(a.geometry=h,a.spatialRelationship="intersects"),t?.distance&&(a.distance=t.distance),t?.units&&(a.units=t.units),a.outSpatialReference=r.spatialReference;let n,y;try{n=F?await d.queryFeatureCount(a):await s.queryFeatureCount(a),n>0&&n<=w&&(y=F?await d.queryFeatures(a):await s.queryFeatures(a))}catch(u){console.warn("Client-side query failed, falling back to server:",u),n=await s.queryFeatureCount(a),n>0&&n<=w&&(y=await s.queryFeatures(a))}let{objectIds:q,attributes:S}=y?N(s,y,r.timeZone):{objectIds:void 0,attributes:void 0};return{tool:"queryFeatures",layerName:f,summary:`${n} features found`,details:{totalCount:n,where:i.where,orderByFields:i.orderByFields,outFields:i.outFields,...q&&{objectIds:q,objectIdField:I},...S&&{attributes:S},...n>w&&{note:`${n} features found.`}}}};async function W({targetLayer:i,geometryFilter:r,useCurrentExtent:t},l){let{mapView:s}=L(l,["mapView"]),d=j(r,l.state?.agentExecutionContext?.sharedResources),f=await E(i,s,d,t);return JSON.stringify(f,null,2)}var B=e.object({layerId:e.string().describe("The layerId of the layer containing the geometry by which to filter."),where:e.string().describe("The SQL-92 where clause representing the features from which to filter."),distance:e.number().optional().describe("The buffer distance around the geometry."),units:p.optional().describe("The units for the distance buffer.")}),U=e.object({point:e.object({x:e.number().describe("X coordinate (longitude) from navigation result"),y:e.number().describe("Y coordinate (latitude) from navigation result"),spatialReference:e.object({wkid:e.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:e.number().optional().describe("Optional buffer distance around the point."),units:p.optional().describe("The units for the distance buffer.")}),D=e.object({targetLayer:e.object({layerId:e.string().describe("The layerId of the layer containing the field from which to get a value."),where:e.string().describe("SQL-92 where clause. IMPORTANT: When using geometryFilter.point or geometryFilter.sharedResourceId 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:e.array(e.string().describe("The field(s) and order for which to sort the resulting features.")),outFields:e.array(e.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:e.union([B,U,R]).optional().describe("Geometry filter for spatial queries. Use 'sharedResourceId' with an ID from listSharedResources for a previously geocoded location. Use 'point' for inline coordinates or 'layerId/where' for features from another layer."),useCurrentExtent:e.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).")}),H=T(W,{name:"queryFeatures",description:`Queries features from a layer. Returns the total count of matching features, plus individual feature attributes if \u226425 features match.
3
3
 
4
4
  USE THIS TOOL FOR:
5
5
  - "Show / display / list features where..." \u2014 finding and listing features
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import b from"./AHCXG7XF.js";import a from"./UHICISBZ.js";import"./ONQ6JSBJ.js";import"./IYLFJCJ2.js";import"./VXFQANGJ.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([,a])=>{return a},a,b)
2
+ import b from"./JNOH4PD5.js";import a from"./KA3S22NQ.js";import"./ONQ6JSBJ.js";import"./IYLFJCJ2.js";import"./VXFQANGJ.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([,a])=>{return a},a,b)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import c from"./SZRJTQ54.js";import b from"./CCC6LBMY.js";import"./34O57OGV.js";import a from"./UHICISBZ.js";import"./ONQ6JSBJ.js";import"./IYLFJCJ2.js";import"./VXFQANGJ.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([,,a])=>{return a},a,b,c)
2
+ import c from"./ES54NWOB.js";import b from"./CCC6LBMY.js";import"./34O57OGV.js";import a from"./KA3S22NQ.js";import"./ONQ6JSBJ.js";import"./IYLFJCJ2.js";import"./VXFQANGJ.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([,,a])=>{return a},a,b,c)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{c as i,e as c}from"./JQYLMTDP.js";export default $arcgis.t(([m,{subclass:p}])=>{function a(t){return t?Object.keys(t.shape??{}):[]}function d(t){let e={};for(let n of t)for(let s of a(n))e[s]=void 0;return e}function g(t,e){return Object.fromEntries(e.filter(n=>Object.hasOwn(t,n)).map(n=>[n,t[n]]))}function l(t,e){return`${t.id}_${e}`}function h(t,e){let n=e.inputSchema;return n?{...g(t,a(n)),agentExecutionContext:t.agentExecutionContext,outputMessage:t.outputMessage,status:void 0,summary:""}:{...t,status:void 0,summary:""}}function x(t,e){return t.outputSchema?g(e,a(t.outputSchema)):{}}function y(t){let e={outputMessage:t.outputMessage,status:t.status,summary:t.summary};return t.agentExecutionContext&&(e.agentExecutionContext=t.agentExecutionContext),e}function v(t,e){return async(n,s)=>{let o=await t.run(h(n,t),s),r=x(t,o);return e||o.status==="failed"?{...r,...y(o)}:{...r,outputMessage:o.outputMessage}}}var w=Object.getOwnPropertyDescriptor,E=(t,e,n,s)=>{for(var o=s>1?void 0:s?w(e,n):e,r=t.length-1,u;r>=0;r--)(u=t[r])&&(o=u(o)||o);return o},f=class extends m{generate(){let t=this.getAgents();this.validateAgents(t);for(let r of t)r.generate();let e=d(t.flatMap(r=>r.getSchemas())),n=i(e),s=this.buildNodes(t),o=this.buildEdges(t);return{workspace:n,createGraph:()=>c(s,o,n,{entryNode:this.getEntryNode(t)})}}buildNodes(t){let e={};for(let[n,s]of t.entries())e[l(s,n)]=v(s,this.isTerminalAgent(t,n));return e}validateAgents(t){if(!t.length)throw new Error("Workflow requires at least one agent.")}};f=E([p("BaseWorkflow")],f);return{a:a,b:d,c:l,d:f}},"core/Accessor","core/accessorSupport/decorators")
2
+ import{c as i,e as c}from"./CLRFKSAT.js";export default $arcgis.t(([m,{subclass:p}])=>{function a(t){return t?Object.keys(t.shape??{}):[]}function d(t){let e={};for(let n of t)for(let s of a(n))e[s]=void 0;return e}function g(t,e){return Object.fromEntries(e.filter(n=>Object.hasOwn(t,n)).map(n=>[n,t[n]]))}function l(t,e){return`${t.id}_${e}`}function h(t,e){let n=e.inputSchema;return n?{...g(t,a(n)),agentExecutionContext:t.agentExecutionContext,outputMessage:t.outputMessage,status:void 0,summary:""}:{...t,status:void 0,summary:""}}function x(t,e){return t.outputSchema?g(e,a(t.outputSchema)):{}}function y(t){let e={outputMessage:t.outputMessage,status:t.status,summary:t.summary};return t.agentExecutionContext&&(e.agentExecutionContext=t.agentExecutionContext),e}function v(t,e){return async(n,s)=>{let o=await t.run(h(n,t),s),r=x(t,o);return e||o.status==="failed"?{...r,...y(o)}:{...r,outputMessage:o.outputMessage}}}var w=Object.getOwnPropertyDescriptor,E=(t,e,n,s)=>{for(var o=s>1?void 0:s?w(e,n):e,r=t.length-1,u;r>=0;r--)(u=t[r])&&(o=u(o)||o);return o},f=class extends m{generate(){let t=this.getAgents();this.validateAgents(t);for(let r of t)r.generate();let e=d(t.flatMap(r=>r.getSchemas())),n=i(e),s=this.buildNodes(t),o=this.buildEdges(t);return{workspace:n,createGraph:()=>c(s,o,n,{entryNode:this.getEntryNode(t)})}}buildNodes(t){let e={};for(let[n,s]of t.entries())e[l(s,n)]=v(s,this.isTerminalAgent(t,n));return e}validateAgents(t){if(!t.length)throw new Error("Workflow requires at least one agent.")}};f=E([p("BaseWorkflow")],f);return{a:a,b:d,c:l,d:f}},"core/Accessor","core/accessorSupport/decorators")
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import a from"./EVMIYZWD.js";import{c as C,e as N}from"./JQYLMTDP.js";import"./FS7GXTTQ.js";import"./LOQ2PKV5.js";import"./IYLFJCJ2.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([{property:B,subclass:D},{a:h,b:S,c:p,d:A}])=>{var G=Object.defineProperty,z=Object.getOwnPropertyDescriptor,P=(t,e,s,n)=>{for(var r=n>1?void 0:n?z(e,s):e,o=t.length-1,a;o>=0;o--)(a=t[o])&&(r=(n?a(e,s,r):a(r))||r);return n&&r&&G(e,s,r),r},x=class extends A{constructor(t){super(t)}getAgents(){return this.agents}generate(){let t=this.getAgents();this.validateAgents(t);for(let o of t)o.generate();let e=S(t.flatMap(o=>o.getSchemas()));for(let[o]of t.entries())e[_(o)]=void 0;let s=C(e),n=this.buildNodes(t),r=this.buildEdges(t);return{workspace:s,createGraph:()=>N(n,r,s,{entryNode:this.getEntryNode(t)})}}getEntryNode(t){return y}isTerminalAgent(t,e){return!1}buildNodes(t){let e={};for(let[s,n]of t.entries()){let r=_(s),o=p(n,s);e[o]=async(a,u)=>{let l=await n.run(F(a,n),u),i={},m=i;return m[r]=l,i}}return e[y]=()=>({}),e[k]=s=>R(s,t),e}buildEdges(t){return[...t.map((e,s)=>({from:y,to:p(e,s)})),...t.map((e,s)=>({from:p(e,s),to:k}))]}};P([B()],x.prototype,"agents",2);x=P([D("ParallelWorkflow")],x);var y="__parallel_fanOut",k="__parallel_join";function _(t){return`__parallel_update_${t}`}function W(t,e){return Object.fromEntries(e.filter(s=>Object.hasOwn(t,s)).map(s=>[s,t[s]]))}function F(t,e){let s=e.inputSchema;return s?{...W(t,h(s)),agentExecutionContext:t.agentExecutionContext,outputMessage:t.outputMessage,status:void 0,summary:""}:{...t,status:void 0,summary:""}}function I(t,e){return t.outputSchema?W(e,h(t.outputSchema)):{}}function K(t,e){let s=t.agentExecutionContext?.messages??[],n=e.agentExecutionContext?.messages??[];return n.length>s.length?n.slice(s.length):void 0}function R(t,e){let s=[],n=[],r=[],o={},a={},u=new Set;for(let[m,J]of e.entries()){let E=_(m),d=t[E];if(a[E]=void 0,!d||typeof d!="object")continue;let c=d,b=c.outputMessage,O=K(t,c),v=c.summary,$=I(J,c),w=b.trim();typeof b=="string"&&w&&s.push(w);let j=v.trim();typeof v=="string"&&j&&n.push(j),Array.isArray(O)&&r.push(...O),c.status&&u.add(c.status);for(let[f,g]of Object.entries($))if(!(g===void 0||f.startsWith("__parallel_update_"))&&!M(t[f],g)){if(!Object.hasOwn(o,f)){o[f]=g;continue}if(!M(o[f],g))throw new Error(`ParallelWorkflow detected conflicting updates for state key "${f}".`)}}let l={...a,...o},i=l;return r.length>0&&(i.agentExecutionContext={...t.agentExecutionContext,messages:[...t.agentExecutionContext.messages,...r]}),s.length&&(i.outputMessage=s.join(`
2
+ import a from"./H4BVWDNV.js";import{c as C,e as N}from"./CLRFKSAT.js";import"./FS7GXTTQ.js";import"./LOQ2PKV5.js";import"./IYLFJCJ2.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([{property:B,subclass:D},{a:h,b:S,c:p,d:A}])=>{var G=Object.defineProperty,z=Object.getOwnPropertyDescriptor,P=(t,e,s,n)=>{for(var r=n>1?void 0:n?z(e,s):e,o=t.length-1,a;o>=0;o--)(a=t[o])&&(r=(n?a(e,s,r):a(r))||r);return n&&r&&G(e,s,r),r},x=class extends A{constructor(t){super(t)}getAgents(){return this.agents}generate(){let t=this.getAgents();this.validateAgents(t);for(let o of t)o.generate();let e=S(t.flatMap(o=>o.getSchemas()));for(let[o]of t.entries())e[_(o)]=void 0;let s=C(e),n=this.buildNodes(t),r=this.buildEdges(t);return{workspace:s,createGraph:()=>N(n,r,s,{entryNode:this.getEntryNode(t)})}}getEntryNode(t){return y}isTerminalAgent(t,e){return!1}buildNodes(t){let e={};for(let[s,n]of t.entries()){let r=_(s),o=p(n,s);e[o]=async(a,u)=>{let l=await n.run(F(a,n),u),i={},m=i;return m[r]=l,i}}return e[y]=()=>({}),e[k]=s=>R(s,t),e}buildEdges(t){return[...t.map((e,s)=>({from:y,to:p(e,s)})),...t.map((e,s)=>({from:p(e,s),to:k}))]}};P([B()],x.prototype,"agents",2);x=P([D("ParallelWorkflow")],x);var y="__parallel_fanOut",k="__parallel_join";function _(t){return`__parallel_update_${t}`}function W(t,e){return Object.fromEntries(e.filter(s=>Object.hasOwn(t,s)).map(s=>[s,t[s]]))}function F(t,e){let s=e.inputSchema;return s?{...W(t,h(s)),agentExecutionContext:t.agentExecutionContext,outputMessage:t.outputMessage,status:void 0,summary:""}:{...t,status:void 0,summary:""}}function I(t,e){return t.outputSchema?W(e,h(t.outputSchema)):{}}function K(t,e){let s=t.agentExecutionContext?.messages??[],n=e.agentExecutionContext?.messages??[];return n.length>s.length?n.slice(s.length):void 0}function R(t,e){let s=[],n=[],r=[],o={},a={},u=new Set;for(let[m,J]of e.entries()){let E=_(m),d=t[E];if(a[E]=void 0,!d||typeof d!="object")continue;let c=d,b=c.outputMessage,O=K(t,c),v=c.summary,$=I(J,c),w=b.trim();typeof b=="string"&&w&&s.push(w);let j=v.trim();typeof v=="string"&&j&&n.push(j),Array.isArray(O)&&r.push(...O),c.status&&u.add(c.status);for(let[f,g]of Object.entries($))if(!(g===void 0||f.startsWith("__parallel_update_"))&&!M(t[f],g)){if(!Object.hasOwn(o,f)){o[f]=g;continue}if(!M(o[f],g))throw new Error(`ParallelWorkflow detected conflicting updates for state key "${f}".`)}}let l={...a,...o},i=l;return r.length>0&&(i.agentExecutionContext={...t.agentExecutionContext,messages:[...t.agentExecutionContext.messages,...r]}),s.length&&(i.outputMessage=s.join(`
3
3
 
4
4
  `)),n.length&&(i.summary=n.join(`
5
5
 
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as A}from"./XQ3NBBQ3.js";import b from"./QNXI3WOF.js";import{a as y}from"./FDOMMK2M.js";import a from"./DG27JEYG.js";import{a as i}from"./V7Y22FRP.js";import{J as f,Ya as S,r as u,s as p}from"./LOQ2PKV5.js";export default $arcgis.t(([,,,,,,{p:x},{b:w,d:E,j:I,k:L,l:v,m:F,n:$,o:C,p:N,q:R,r:T,s:_,t:b,u:h}])=>{var M=async(t,a)=>{let e=t.tool_calls??[];if(e.length===0){await i({text:`LLM did not request any tool calls: ${String(t?.content)}`},a);return}await Promise.all(e.map(async r=>await i({text:`LLM invoked ${r.name} tool with arguments: ${JSON.stringify(r.args,null,2)}`},a)))},k=.7,P=10,z=async(t,a)=>{try{await i({text:"Similarity search to find fields"},a);let e=y(a,"fieldSearch"),r=y(a,"layersAndFieldsRegistry"),n=y(a,"embeddingCache"),o=await e.searchFields({text:t.agentExecutionContext.assignedTask,layerIds:t.vectorSearchLayerIds,minScore:k,topResults:P,embeddingCache:n}),m=o.map(({layerId:c,results:d})=>{let g=d.map(s=>` - ${s.name} (${s.score.toFixed(2)})`).join(`
2
+ import{a as A}from"./XQ3NBBQ3.js";import b from"./XOULSLM7.js";import{a as y}from"./FDOMMK2M.js";import a from"./64IWQ7A4.js";import{a as i}from"./V7Y22FRP.js";import{J as f,Ya as S,r as u,s as p}from"./LOQ2PKV5.js";export default $arcgis.t(([,,,,,,{p:x},{b:w,d:E,j:I,k:L,l:v,m:F,n:$,o:C,p:N,q:R,r:T,s:_,t:b,u:h}])=>{var M=async(t,a)=>{let e=t.tool_calls??[];if(e.length===0){await i({text:`LLM did not request any tool calls: ${String(t?.content)}`},a);return}await Promise.all(e.map(async r=>await i({text:`LLM invoked ${r.name} tool with arguments: ${JSON.stringify(r.args,null,2)}`},a)))},k=.7,P=10,z=async(t,a)=>{try{await i({text:"Similarity search to find fields"},a);let e=y(a,"fieldSearch"),r=y(a,"layersAndFieldsRegistry"),n=y(a,"embeddingCache"),o=await e.searchFields({text:t.agentExecutionContext.assignedTask,layerIds:t.vectorSearchLayerIds,minScore:k,topResults:P,embeddingCache:n}),m=o.map(({layerId:c,results:d})=>{let g=d.map(s=>` - ${s.name} (${s.score.toFixed(2)})`).join(`
3
3
  `);return`${r.get(c)?.layerItem.name??c}:
4
4
  ${g}`}).join(`
5
5
  `),l;return o.length>0?l=`Vector search completed. Matching layers and fields with scores:
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import n from"./33SFAZQG.js";import"./XQ3NBBQ3.js";import m from"./QNXI3WOF.js";import{c as s,d as p}from"./V6HOUZPZ.js";import"./TWU3QXAS.js";import l from"./VWP2B4LB.js";import"./5Q2XRQS6.js";import k from"./K7YQIJFT.js";import j from"./H6P3WP5D.js";import i from"./SZRJTQ54.js";import h from"./AVZ5Y6BK.js";import g from"./CCC6LBMY.js";import"./34O57OGV.js";import"./LXPGQNXQ.js";import"./FDOMMK2M.js";import f from"./WVP73XWD.js";import"./Z5XQLSYH.js";import"./OZAZ277H.js";import d from"./AVRS6UCQ.js";import"./K5JVB6FU.js";import"./FCI6M62J.js";import"./BFZ5S7NF.js";import"./3UEKINYC.js";import"./RLEHNAIA.js";import c from"./DG27JEYG.js";import"./FS7GXTTQ.js";import"./WXQ26G5Q.js";import"./MJSIYEWN.js";import b from"./AHCXG7XF.js";import a from"./UHICISBZ.js";import"./ONQ6JSBJ.js";import{v as e,z as o}from"./COH3QXWG.js";import"./R74ZHFA6.js";import"./V7Y22FRP.js";import"./AXTQU5YL.js";import"./LOQ2PKV5.js";import"./IYLFJCJ2.js";import"./VXFQANGJ.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([,,,,,,,,,{fetchKnowledgeGraph:n},,,,,,,,,,,,,m])=>{var r=class extends e{constructor(){super(...arguments),this.agent=m}static{this.properties={referenceElement:1,serviceUrl:3,context:0}}#i;#r;#t;#e;get serviceUrl(){return this.#r}set serviceUrl(t){this.#r=t}async getContext(){let t=this.context?{...this.context,knowledgeGraph:void 0,view:void 0}:{};if(this.#i)return{...t,view:this.#i};if(this.#t)try{let i=await this.#t;return{...t,knowledgeGraph:i}}catch(i){console.error("Failed to load knowledge graph via service URL:",i)}if(!this.context?.knowledgeGraph&&!this.context?.view)throw new Error("arcgis-assistant-knowledge-agent requires either a knowledgeGraph or view in context, and neither were provided");return this.context}willUpdate(t){t.has("serviceUrl")&&this.serviceUrl?this.#t=n(this.serviceUrl):this.#t=void 0}load(){this.#i=p(this)??void 0,this.#e=s(this)}disconnectedCallback(){this.#e?.unregister(this.agent.id),super.disconnectedCallback()}};o("arcgis-assistant-knowledge-agent",r);return r},"identity/IdentityManager","portal/Portal","request","config","core/reactiveUtils","layers/FeatureLayer","intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","rest/knowledgeGraphService",a,b,c,d,f,g,h,i,j,k,l,m,n)
2
+ import n from"./RMLCWLJC.js";import"./XQ3NBBQ3.js";import m from"./XOULSLM7.js";import{c as s,d as p}from"./V6HOUZPZ.js";import"./4PKMJMND.js";import l from"./VWP2B4LB.js";import"./5Q2XRQS6.js";import k from"./K7YQIJFT.js";import j from"./UT6JA4TK.js";import i from"./CA3RNGPN.js";import h from"./ES54NWOB.js";import g from"./CCC6LBMY.js";import"./34O57OGV.js";import"./LXPGQNXQ.js";import"./FDOMMK2M.js";import f from"./WVP73XWD.js";import"./Z5XQLSYH.js";import"./OZAZ277H.js";import d from"./AVRS6UCQ.js";import"./K5JVB6FU.js";import"./FCI6M62J.js";import"./BFZ5S7NF.js";import"./3UEKINYC.js";import"./RLEHNAIA.js";import c from"./64IWQ7A4.js";import"./FS7GXTTQ.js";import"./WXQ26G5Q.js";import"./MJSIYEWN.js";import b from"./JNOH4PD5.js";import a from"./KA3S22NQ.js";import"./ONQ6JSBJ.js";import{v as e,z as o}from"./COH3QXWG.js";import"./R74ZHFA6.js";import"./V7Y22FRP.js";import"./AXTQU5YL.js";import"./LOQ2PKV5.js";import"./IYLFJCJ2.js";import"./VXFQANGJ.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([,,,,,,,,,{fetchKnowledgeGraph:n},,,,,,,,,,,,,m])=>{var r=class extends e{constructor(){super(...arguments),this.agent=m}static{this.properties={referenceElement:1,serviceUrl:3,context:0}}#i;#r;#t;#e;get serviceUrl(){return this.#r}set serviceUrl(t){this.#r=t}async getContext(){let t=this.context?{...this.context,knowledgeGraph:void 0,view:void 0}:{};if(this.#i)return{...t,view:this.#i};if(this.#t)try{let i=await this.#t;return{...t,knowledgeGraph:i}}catch(i){console.error("Failed to load knowledge graph via service URL:",i)}if(!this.context?.knowledgeGraph&&!this.context?.view)throw new Error("arcgis-assistant-knowledge-agent requires either a knowledgeGraph or view in context, and neither were provided");return this.context}willUpdate(t){t.has("serviceUrl")&&this.serviceUrl?this.#t=n(this.serviceUrl):this.#t=void 0}load(){this.#i=p(this)??void 0,this.#e=s(this)}disconnectedCallback(){this.#e?.unregister(this.agent.id),super.disconnectedCallback()}};o("arcgis-assistant-knowledge-agent",r);return r},"identity/IdentityManager","portal/Portal","request","config","core/reactiveUtils","layers/FeatureLayer","intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","rest/knowledgeGraphService",a,b,c,d,f,g,h,i,j,k,l,m,n)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import"./UZLQALHY.js";var e='---\nname: filter\ndescription: Changes feature emphasis on the map by including, excluding, highlighting, dimming, or clearing filtered features. Use when the user asks to visually filter feature-layer data.\nallowed-tools: findRelevantLayers findRelevantFields setFeatureEffect resetMap clearFilters\n---\n\n# Filter\n\n- Use `clearFilters` when the user asks only to remove feature filters or effects. Use `resetMap` only when the user asks to reset the broader map state.\n- Reuse a preceding query result from this run whenever it contains the layer ID and filtering criteria needed for the visual operation. Do not repeat layer or field discovery in that case.\n- A preceding query result may provide the layer ID, where clause, geometry filter, `useCurrentExtent`, object IDs, and count. Preserve and reuse those values rather than reconstructing them.\n- When the task refers to geometry produced by an earlier agent, call `listSharedResources` with `point`, `polyline` and `polygon` as the requested kinds. If a resource description clearly matches the referenced geometry, pass its exact ID as `geometryFilter.sharedResourceId` and use `where: "1=1"` unless the user requests an additional attribute filter. If no resource clearly matches, state that the spatial constraint is unavailable and do not guess geometry.\n- If no usable preceding query result exists, start with `findRelevantLayers`. Use the assigned task as the semantic query. If no relevant layers are returned, explain that no matching map layer was found and stop. Never invent a layer ID.\n- When discovery is required, call `findRelevantFields` with only relevant layer IDs before constructing a filter. Use only the exact field names and categorical values returned by `findRelevantFields`.\n- Leave `includeSummaryStatistics` false unless the filter criteria explicitly depend on a requested numeric summary.\n- Use real field names rather than aliases in SQL-92 where clauses. Use `1=1` when no attribute filter is requested.\n- For highlight, show, include, exclude, or other visual-filter requests with feature criteria, call `setFeatureEffect` using the same layer ID, where clause, geometry filter, and `useCurrentExtent` value determined by the preceding query or discovery steps.\n- If a preceding query returned object IDs for ranked, top-N, or otherwise selected records, pass those object IDs to `setFeatureEffect` instead of rebuilding the selection using only a where clause.\n- Prefer the default feature effects unless the user explicitly requests a particular visual treatment.\n- Set `useCurrentExtent` only when the user explicitly refers to the current view or visible map area.\n- When available, use the preceding query result for feature counts or attribute details in the final response.\n- Report the `setFeatureEffect` outcome faithfully. Do not claim that a map effect was applied when the tool failed or no matching layer or field was found.\n';export{e as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import p from"./5A355PGH.js";import"./XQ3NBBQ3.js";import n from"./QNXI3WOF.js";import{a as o,c as m}from"./V6HOUZPZ.js";import"./TWU3QXAS.js";import l from"./VWP2B4LB.js";import"./5Q2XRQS6.js";import k from"./K7YQIJFT.js";import j from"./H6P3WP5D.js";import h from"./SZRJTQ54.js";import g from"./AVZ5Y6BK.js";import f from"./CCC6LBMY.js";import"./34O57OGV.js";import"./LXPGQNXQ.js";import"./FDOMMK2M.js";import e from"./WVP73XWD.js";import"./Z5XQLSYH.js";import"./OZAZ277H.js";import d from"./AVRS6UCQ.js";import"./K5JVB6FU.js";import"./FCI6M62J.js";import"./BFZ5S7NF.js";import"./3UEKINYC.js";import"./RLEHNAIA.js";import c from"./DG27JEYG.js";import"./FS7GXTTQ.js";import"./WXQ26G5Q.js";import"./MJSIYEWN.js";import b from"./AHCXG7XF.js";import a from"./UHICISBZ.js";import"./ONQ6JSBJ.js";import{v as i,z as r}from"./COH3QXWG.js";import"./R74ZHFA6.js";import"./V7Y22FRP.js";import"./AXTQU5YL.js";import"./LOQ2PKV5.js";import"./IYLFJCJ2.js";import"./VXFQANGJ.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([,,,,,,,,,,,,,,,,,,,,,,{b:p}])=>{var t=class extends i{constructor(){super(...arguments),this.agent=p}static{this.properties={referenceElement:1}}#t;#i;getContext(){if(!this.#t)throw new Error("arcgis-assistant-layer-styling-agent requires a mapView");return{mapView:this.#t}}load(){this.#t=o(this,"arcgis-assistant-layer-styling-agent"),this.#i=m(this)}disconnectedCallback(){this.#i?.unregister(this.agent.id),super.disconnectedCallback()}};r("arcgis-assistant-layer-styling-agent",t);return t},"identity/IdentityManager","portal/Portal","request","config","core/reactiveUtils","layers/FeatureLayer","intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","rest/knowledgeGraphService",a,b,c,d,e,f,g,h,j,k,l,n,p)
2
+ import p from"./HHQTKKYE.js";import"./XQ3NBBQ3.js";import n from"./XOULSLM7.js";import{a as o,c as m}from"./V6HOUZPZ.js";import"./4PKMJMND.js";import l from"./VWP2B4LB.js";import"./5Q2XRQS6.js";import k from"./K7YQIJFT.js";import j from"./UT6JA4TK.js";import h from"./CA3RNGPN.js";import g from"./ES54NWOB.js";import f from"./CCC6LBMY.js";import"./34O57OGV.js";import"./LXPGQNXQ.js";import"./FDOMMK2M.js";import e from"./WVP73XWD.js";import"./Z5XQLSYH.js";import"./OZAZ277H.js";import d from"./AVRS6UCQ.js";import"./K5JVB6FU.js";import"./FCI6M62J.js";import"./BFZ5S7NF.js";import"./3UEKINYC.js";import"./RLEHNAIA.js";import c from"./64IWQ7A4.js";import"./FS7GXTTQ.js";import"./WXQ26G5Q.js";import"./MJSIYEWN.js";import b from"./JNOH4PD5.js";import a from"./KA3S22NQ.js";import"./ONQ6JSBJ.js";import{v as i,z as r}from"./COH3QXWG.js";import"./R74ZHFA6.js";import"./V7Y22FRP.js";import"./AXTQU5YL.js";import"./LOQ2PKV5.js";import"./IYLFJCJ2.js";import"./VXFQANGJ.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([,,,,,,,,,,,,,,,,,,,,,,{b:p}])=>{var t=class extends i{constructor(){super(...arguments),this.agent=p}static{this.properties={referenceElement:1}}#t;#i;getContext(){if(!this.#t)throw new Error("arcgis-assistant-layer-styling-agent requires a mapView");return{mapView:this.#t}}load(){this.#t=o(this,"arcgis-assistant-layer-styling-agent"),this.#i=m(this)}disconnectedCallback(){this.#i?.unregister(this.agent.id),super.disconnectedCallback()}};r("arcgis-assistant-layer-styling-agent",t);return t},"identity/IdentityManager","portal/Portal","request","config","core/reactiveUtils","layers/FeatureLayer","intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","rest/knowledgeGraphService",a,b,c,d,e,f,g,h,j,k,l,n,p)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import a from"./UHICISBZ.js";import{a as h}from"./ONQ6JSBJ.js";import{Dc as p}from"./IYLFJCJ2.js";import{a as e}from"./VXFQANGJ.js";export default $arcgis.t(([w,I,{a:u,d:m,e:b,f:y}])=>{var x=async(t,o,f,n,r,c)=>{let a=t.map?.allLayers.find(s=>s.id===o);if(!a)return{success:!1,error:`Layer '${o}' not found.`};let i=a.createQuery();i.where=f??"1=1",n&&(i.geometry=n,i.spatialRelationship="intersects",r&&(i.distance=r),c&&(i.units=c));try{let{extent:s,count:l}=await a.queryExtent(i);return!s||l===0?{success:!1,error:`No features found for filter (where: ${i.where}${n?", spatial filter used":""})`}:(await t.goTo(s),{success:!0})}catch(s){return{success:!1,error:s instanceof Error?s.message:String(s)}}},v=async(t,o,f,n,r,c)=>{let a=o.map?.allLayers.find(d=>d.id===t.layerId);if(!a)return`Could not find target layer with ID: ${t.layerId}`;let i;if(r){let d=await m(r,o);if("error"in d)return d.error;i=d.geometry}if(a.featureEffect=null,a.featureEffect=new w({filter:new I({...t.objectIds?.length?{objectIds:t.objectIds}:{where:t.where},geometry:i,spatialRelationship:"intersects",distance:r?.distance,units:r?.units}),includedEffect:f,excludedEffect:n}),a.visible=!0,c)return`Applied feature effects to "${a.title??t.layerId}" within current map extent.`;let s=t.objectIds?.length?`${a.objectIdField} IN (${t.objectIds.join(",")})`:t.where,l=await x(o,t.layerId,s,i,r?.distance,r?.units),g=a.title??t.layerId;return l.success?`Applied feature effects to target layer "${a.title??t.layerId}"${r&&"layerId"in r?` using geometry from layer "${r.layerId}"`:""}.`:`Applied filter to "${g}" but no features matched. ${l.error}`},j=async({targetLayer:t,geometryFilter:o,useCurrentExtent:f,includedEffect:n="drop-shadow(2px, 2px, 2px, gray)",excludedEffect:r="grayscale(100%) opacity(60%) blur(2px)"},c)=>{let{mapView:a}=h(c,["mapView"]),i=y(o,c.state?.agentExecutionContext?.sharedResources);return await v(t,a,n,r,i,f)},E=e.object({layerId:e.string().describe("The layerId of the layer containing the geometry by which to filter."),where:e.string().describe("The SQL-92 where clause representing the features from which to filter."),distance:e.number().optional().describe("The buffer distance around the geometry."),units:u.optional().describe("The units for the distance buffer.")}),T=e.object({point:e.object({x:e.number().describe("X coordinate (longitude) from navigation result"),y:e.number().describe("Y coordinate (latitude) from navigation result"),spatialReference:e.object({wkid:e.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:e.number().optional().describe("Optional buffer distance around the point."),units:u.optional().describe("The units for the distance buffer.")}),$=e.object({targetLayer:e.object({layerId:e.string().describe("The layerId of the layer on which to set a feature effect."),where:e.string().describe("The SQL-92 where clause representing the features to emphasize."),objectIds:e.array(e.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:e.union([E,T,b]).optional().describe("Optional spatial filter. Use 'sharedResourceId' with an ID from listSharedResources for a previously geocoded location."),useCurrentExtent:e.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:e.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:e.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.")}),A=p(j,{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:$});return A},"layers/support/FeatureEffect","layers/support/FeatureFilter",a)
2
+ import a from"./KA3S22NQ.js";import{a as h}from"./ONQ6JSBJ.js";import{Dc as p}from"./IYLFJCJ2.js";import{a as e}from"./VXFQANGJ.js";export default $arcgis.t(([w,I,{a:u,d:m,e:b,f:y}])=>{var x=async(t,o,f,n,r,c)=>{let a=t.map?.allLayers.find(s=>s.id===o);if(!a)return{success:!1,error:`Layer '${o}' not found.`};let i=a.createQuery();i.where=f??"1=1",n&&(i.geometry=n,i.spatialRelationship="intersects",r&&(i.distance=r),c&&(i.units=c));try{let{extent:s,count:l}=await a.queryExtent(i);return!s||l===0?{success:!1,error:`No features found for filter (where: ${i.where}${n?", spatial filter used":""})`}:(await t.goTo(s),{success:!0})}catch(s){return{success:!1,error:s instanceof Error?s.message:String(s)}}},v=async(t,o,f,n,r,c)=>{let a=o.map?.allLayers.find(d=>d.id===t.layerId);if(!a)return`Could not find target layer with ID: ${t.layerId}`;let i;if(r){let d=await m(r,o);if("error"in d)return d.error;i=d.geometry}if(a.featureEffect=null,a.featureEffect=new w({filter:new I({...t.objectIds?.length?{objectIds:t.objectIds}:{where:t.where},geometry:i,spatialRelationship:"intersects",distance:r?.distance,units:r?.units}),includedEffect:f,excludedEffect:n}),a.visible=!0,c)return`Applied feature effects to "${a.title??t.layerId}" within current map extent.`;let s=t.objectIds?.length?`${a.objectIdField} IN (${t.objectIds.join(",")})`:t.where,l=await x(o,t.layerId,s,i,r?.distance,r?.units),g=a.title??t.layerId;return l.success?`Applied feature effects to target layer "${a.title??t.layerId}"${r&&"layerId"in r?` using geometry from layer "${r.layerId}"`:""}.`:`Applied filter to "${g}" but no features matched. ${l.error}`},j=async({targetLayer:t,geometryFilter:o,useCurrentExtent:f,includedEffect:n="drop-shadow(2px, 2px, 2px, gray)",excludedEffect:r="grayscale(100%) opacity(60%) blur(2px)"},c)=>{let{mapView:a}=h(c,["mapView"]),i=y(o,c.state?.agentExecutionContext?.sharedResources);return await v(t,a,n,r,i,f)},E=e.object({layerId:e.string().describe("The layerId of the layer containing the geometry by which to filter."),where:e.string().describe("The SQL-92 where clause representing the features from which to filter."),distance:e.number().optional().describe("The buffer distance around the geometry."),units:u.optional().describe("The units for the distance buffer.")}),T=e.object({point:e.object({x:e.number().describe("X coordinate (longitude) from navigation result"),y:e.number().describe("Y coordinate (latitude) from navigation result"),spatialReference:e.object({wkid:e.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:e.number().optional().describe("Optional buffer distance around the point."),units:u.optional().describe("The units for the distance buffer.")}),$=e.object({targetLayer:e.object({layerId:e.string().describe("The layerId of the layer on which to set a feature effect."),where:e.string().describe("The SQL-92 where clause representing the features to emphasize."),objectIds:e.array(e.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:e.union([E,T,b]).optional().describe("Optional spatial filter. Use 'sharedResourceId' with an ID from listSharedResources for a previously geocoded location."),useCurrentExtent:e.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:e.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:e.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.")}),A=p(j,{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:$});return A},"layers/support/FeatureEffect","layers/support/FeatureFilter",a)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import a from"./EVMIYZWD.js";import"./JQYLMTDP.js";import"./FS7GXTTQ.js";import"./LOQ2PKV5.js";import"./IYLFJCJ2.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([{property:d,subclass:f},{a:u,c:i,d:c}])=>{var m=Object.defineProperty,g=Object.getOwnPropertyDescriptor,p=(e,o,r,t)=>{for(var s=t>1?void 0:t?g(o,r):o,a=e.length-1,n;a>=0;a--)(n=e[a])&&(s=(t?n(o,r,s):n(s))||s);return t&&s&&m(o,r,s),s},l=class extends c{constructor(e){super(e)}getAgents(){return this.agents}getEntryNode(e){return e[0]?i(e[0],0):void 0}isTerminalAgent(e,o){return o===e.length-1}validateAgents(e){super.validateAgents(e);let o=new Map;for(let[r,t]of e.entries()){let s=e[r-1];if(t.outputSchema)for(let a of u(t.outputSchema)){let n=o.get(a)??[];n.push(`${t.name} [${r}]`),o.set(a,n)}if(!(r===0||!t.inputSchema||s?.outputSchema))throw new Error(`Workflow agent "${t.name}" declares an input schema, so upstream agent "${s.name}" must declare an output schema.`)}for(let[r,t]of o.entries())t.length>1&&console.warn(`Workflow output field "${r}" is declared by multiple steps (${t.join(", ")}). Later steps will overwrite earlier values in shared state.`)}buildEdges(e){return e.length===1?[{from:i(e[0],0),decide:()=>{}}]:e.slice(0,-1).map((o,r)=>({from:i(o,r),decide:t=>t.status==="failed"?void 0:i(e[r+1],r+1)}))}};p([d()],l.prototype,"agents",2);l=p([f("SequentialWorkflow")],l);return l},"core/accessorSupport/decorators",a)
2
+ import a from"./H4BVWDNV.js";import"./CLRFKSAT.js";import"./FS7GXTTQ.js";import"./LOQ2PKV5.js";import"./IYLFJCJ2.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([{property:d,subclass:f},{a:u,c:i,d:c}])=>{var m=Object.defineProperty,g=Object.getOwnPropertyDescriptor,p=(e,o,r,t)=>{for(var s=t>1?void 0:t?g(o,r):o,a=e.length-1,n;a>=0;a--)(n=e[a])&&(s=(t?n(o,r,s):n(s))||s);return t&&s&&m(o,r,s),s},l=class extends c{constructor(e){super(e)}getAgents(){return this.agents}getEntryNode(e){return e[0]?i(e[0],0):void 0}isTerminalAgent(e,o){return o===e.length-1}validateAgents(e){super.validateAgents(e);let o=new Map;for(let[r,t]of e.entries()){let s=e[r-1];if(t.outputSchema)for(let a of u(t.outputSchema)){let n=o.get(a)??[];n.push(`${t.name} [${r}]`),o.set(a,n)}if(!(r===0||!t.inputSchema||s?.outputSchema))throw new Error(`Workflow agent "${t.name}" declares an input schema, so upstream agent "${s.name}" must declare an output schema.`)}for(let[r,t]of o.entries())t.length>1&&console.warn(`Workflow output field "${r}" is declared by multiple steps (${t.join(", ")}). Later steps will overwrite earlier values in shared state.`)}buildEdges(e){return e.length===1?[{from:i(e[0],0),decide:()=>{}}]:e.slice(0,-1).map((o,r)=>({from:i(o,r),decide:t=>t.status==="failed"?void 0:i(e[r+1],r+1)}))}};p([d()],l.prototype,"agents",2);l=p([f("SequentialWorkflow")],l);return l},"core/accessorSupport/decorators",a)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as r}from"./VXFQANGJ.js";export default $arcgis.t(([y,m,g,f])=>{var p=["feet","kilometers","meters","miles","nautical-miles","us-nautical-miles"],d=r.enum(p);var u=750;function h(e){return"point"in e&&e.point!==void 0}function b(e){return"layerId"in e&&e.layerId!==void 0}function w(e){return"polygon"in e&&e.polygon!==void 0}function R(e){return"polyline"in e&&e.polyline!==void 0}var F=async(e,i)=>{if(h(e)){let{point:t}=e;return{geometry:new y({x:t.x,y:t.y,spatialReference:t.spatialReference?{wkid:t.spatialReference.wkid}:i.spatialReference})}}if(w(e))return{geometry:new m({rings:e.polygon.rings,spatialReference:e.polygon.spatialReference})};if(R(e))return{geometry:new g({paths:e.polyline.paths,spatialReference:e.polyline.spatialReference})};if(b(e)){let t=i.map?.allLayers.find(n=>n.id===e.layerId);if(!t)return{error:`Could not find geometry layer with ID: ${e.layerId}`};let o=t.title??t.id,a=e.where?.trim()||"1=1";try{let n=await t.queryFeatures({where:a,returnGeometry:!0,outSpatialReference:i.spatialReference,num:u+1});if(!n.features.length)return{error:`No features found in geometry layer "${o}" with the specified where clause: ${a}`};if(n.features.length>u)return{error:`Geometry filter for layer "${o}" matched too many features (${n.features.length}+). Please narrow the geometry layer filter.`};let s=n.features.map(c=>c.geometry).filter(c=>!!c);if(!s.length)return{error:"No valid geometries found for the matched geometry layer features."};let l=s.length===1?s[0]:f.executeMany(s);return l?(l.spatialReference||(l.spatialReference=i.spatialReference),{geometry:l}):{error:"Failed to combine geometries from geometry layer."}}catch(n){return{error:`Failed to query geometry: ${String(n)}`}}}return{error:"Invalid geometry configuration provided"}},I=r.object({id:r.string()}),j=r.discriminatedUnion("kind",[r.object({id:r.string(),kind:r.literal("point"),payload:r.object({x:r.number(),y:r.number(),spatialReference:r.object({wkid:r.number()}).optional()})}),r.object({id:r.string(),kind:r.literal("polyline"),payload:r.object({paths:r.array(r.array(r.array(r.number()))),spatialReference:r.object({wkid:r.number()}).optional()})}),r.object({id:r.string(),kind:r.literal("polygon"),payload:r.object({rings:r.array(r.array(r.array(r.number()))),spatialReference:r.object({wkid:r.number()}).optional()})})]),U=r.object({sharedResourceId:r.string().describe("ID of a point, polyline, or polygon returned by listSharedResources."),distance:r.number().optional().describe("Optional buffer distance around the geometry."),units:d.optional().describe("The units for the distance buffer.")}),q=(e,i)=>{if(!e||!("sharedResourceId"in e))return e;if(!i)throw new Error("Shared resources are unavailable in the tool runtime state.");let t=i.find(a=>{let n=I.safeParse(a);return n.success&&n.data.id===e.sharedResourceId});if(!t)throw new Error(`Shared resource not found: ${e.sharedResourceId}`);let o=j.safeParse(t);if(!o.success)throw new Error(`Shared resource ${e.sharedResourceId} does not contain valid point, polyline, or polygon geometry.`);switch(o.data.kind){case"point":return{point:o.data.payload,distance:e.distance,units:e.units};case"polyline":return{polyline:o.data.payload,distance:e.distance,units:e.units};case"polygon":return{polygon:o.data.payload,distance:e.distance,units:e.units}}};return{a:d,b:h,c:b,d:F,e:U,f:q}},"geometry/Point","geometry/Polygon","geometry/Polyline","geometry/operators/unionOperator")
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import a from"./EVMIYZWD.js";import"./JQYLMTDP.js";import"./FS7GXTTQ.js";import"./LOQ2PKV5.js";import"./IYLFJCJ2.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([{property:g,subclass:y},{c:p,d:w}])=>{var b=Object.defineProperty,k=Object.getOwnPropertyDescriptor,v=e=>{throw TypeError(e)},h=(e,t,r,s)=>{for(var n=s>1?void 0:s?k(t,r):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(n=(s?a(t,r,n):a(n))||n);return s&&n&&b(t,r,n),n},A=(e,t,r)=>t.has(e)||v("Cannot "+r),M=(e,t,r)=>t.has(e)?v("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),m=(e,t,r)=>(A(e,t,"access private method"),r),c,u,i=class extends w{constructor(e){super(e),M(this,c)}getAgents(){let e=Object.values(this.agentsMap);return this.defaultAgent?e.concat(this.defaultAgent):e}buildNodes(e){let t=super.buildNodes(e);return t[d]=()=>({}),t}buildEdges(e){m(this,c,u).call(this);let t=this.resolver,r=new Map;for(let[o,[a]]of Object.entries(this.agentsMap).entries())r.set(a,p(e[o],o));let{defaultAgent:s}=this,n=s?p(s,e.length-1):void 0;return[{from:d,decide:async(o,a)=>{let l=await Promise.resolve(t(o,a));if(!l)return;let f=r.get(l);if(f)return f;if(s)return n;throw new Error(`SwitchWorkflow resolver returned unknown case: ${l}. Expected one of: ${Object.keys(this.agentsMap).join(", ")||"(none)"}.`)}}]}getEntryNode(){return d}isTerminalAgent(){return!0}validateAgents(e){m(this,c,u).call(this),super.validateAgents(e)}};c=new WeakSet;u=function(){if(!Object.keys(this.agentsMap).length)throw new Error("SwitchWorkflow requires a non-empty agentsMap.")};h([g()],i.prototype,"agentsMap",2);h([g()],i.prototype,"resolver",2);h([g()],i.prototype,"defaultAgent",2);i=h([y("SwitchWorkflow")],i);var d="__switch_decide";return i},"core/accessorSupport/decorators",a)
2
+ import a from"./H4BVWDNV.js";import"./CLRFKSAT.js";import"./FS7GXTTQ.js";import"./LOQ2PKV5.js";import"./IYLFJCJ2.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([{property:g,subclass:y},{c:p,d:w}])=>{var b=Object.defineProperty,k=Object.getOwnPropertyDescriptor,v=e=>{throw TypeError(e)},h=(e,t,r,s)=>{for(var n=s>1?void 0:s?k(t,r):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(n=(s?a(t,r,n):a(n))||n);return s&&n&&b(t,r,n),n},A=(e,t,r)=>t.has(e)||v("Cannot "+r),M=(e,t,r)=>t.has(e)?v("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),m=(e,t,r)=>(A(e,t,"access private method"),r),c,u,i=class extends w{constructor(e){super(e),M(this,c)}getAgents(){let e=Object.values(this.agentsMap);return this.defaultAgent?e.concat(this.defaultAgent):e}buildNodes(e){let t=super.buildNodes(e);return t[d]=()=>({}),t}buildEdges(e){m(this,c,u).call(this);let t=this.resolver,r=new Map;for(let[o,[a]]of Object.entries(this.agentsMap).entries())r.set(a,p(e[o],o));let{defaultAgent:s}=this,n=s?p(s,e.length-1):void 0;return[{from:d,decide:async(o,a)=>{let l=await Promise.resolve(t(o,a));if(!l)return;let f=r.get(l);if(f)return f;if(s)return n;throw new Error(`SwitchWorkflow resolver returned unknown case: ${l}. Expected one of: ${Object.keys(this.agentsMap).join(", ")||"(none)"}.`)}}]}getEntryNode(){return d}isTerminalAgent(){return!0}validateAgents(e){m(this,c,u).call(this),super.validateAgents(e)}};c=new WeakSet;u=function(){if(!Object.keys(this.agentsMap).length)throw new Error("SwitchWorkflow requires a non-empty agentsMap.")};h([g()],i.prototype,"agentsMap",2);h([g()],i.prototype,"resolver",2);h([g()],i.prototype,"defaultAgent",2);i=h([y("SwitchWorkflow")],i);var d="__switch_decide";return i},"core/accessorSupport/decorators",a)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{c}from"./JQYLMTDP.js";export default $arcgis.t(([l,{property:i,subclass:y},{watch:d}])=>{var w=Object.defineProperty,g=Object.getOwnPropertyDescriptor,t=(s,a,p,o)=>{for(var r=o>1?void 0:o?g(a,p):a,h=s.length-1,n;h>=0;h--)(n=s[h])&&(r=(o?n(a,p,r):n(r))||r);return o&&r&&w(a,p,r),r},m=()=>{throw new Error("createGraph method not implemented.")},e=class extends l{constructor(){super(...arguments),this.description="",this.middlewares=[],this.createGraph=m,this.workspace=c()}initialize(){this.addHandles([d(()=>[this.name,this.description],()=>this.generate(),{initial:!0,sync:!0}),d(()=>this.createGraph,()=>this._compiledGraph=void 0)])}get id(){return this.name.replace(/\s+/gu,"-").toLowerCase()}get registration(){return{id:this.id,name:this.name,description:this.description,createGraph:this.createGraph,workspace:this.workspace}}async run(s={},a){return this.createGraph===m&&this.generate(),this._compiledGraph=this._compiledGraph??this.createGraph().compile(),await this._compiledGraph.invoke(s,a)}};t([i({readOnly:!0})],e.prototype,"id",1);t([i()],e.prototype,"name",2);t([i()],e.prototype,"description",2);t([i()],e.prototype,"middlewares",2);t([i({readOnly:!0})],e.prototype,"createGraph",2);t([i({readOnly:!0})],e.prototype,"workspace",2);t([i({readOnly:!0})],e.prototype,"registration",1);e=t([y("BaseAgent")],e);return e},"core/Accessor","core/accessorSupport/decorators","core/reactiveUtils")
2
+ import{c}from"./CLRFKSAT.js";export default $arcgis.t(([l,{property:i,subclass:y},{watch:d}])=>{var w=Object.defineProperty,g=Object.getOwnPropertyDescriptor,t=(s,a,p,o)=>{for(var r=o>1?void 0:o?g(a,p):a,h=s.length-1,n;h>=0;h--)(n=s[h])&&(r=(o?n(a,p,r):n(r))||r);return o&&r&&w(a,p,r),r},m=()=>{throw new Error("createGraph method not implemented.")},e=class extends l{constructor(){super(...arguments),this.description="",this.middlewares=[],this.createGraph=m,this.workspace=c()}initialize(){this.addHandles([d(()=>[this.name,this.description],()=>this.generate(),{initial:!0,sync:!0}),d(()=>this.createGraph,()=>this._compiledGraph=void 0)])}get id(){return this.name.replace(/\s+/gu,"-").toLowerCase()}get registration(){return{id:this.id,name:this.name,description:this.description,createGraph:this.createGraph,workspace:this.workspace}}async run(s={},a){return this.createGraph===m&&this.generate(),this._compiledGraph=this._compiledGraph??this.createGraph().compile(),await this._compiledGraph.invoke(s,a)}};t([i({readOnly:!0})],e.prototype,"id",1);t([i()],e.prototype,"name",2);t([i()],e.prototype,"description",2);t([i()],e.prototype,"middlewares",2);t([i({readOnly:!0})],e.prototype,"createGraph",2);t([i({readOnly:!0})],e.prototype,"workspace",2);t([i({readOnly:!0})],e.prototype,"registration",1);e=t([y("BaseAgent")],e);return e},"core/Accessor","core/accessorSupport/decorators","core/reactiveUtils")
@@ -120,6 +120,8 @@ Do not leave ambiguous references like "these", "those", "them", "this", or "it"
120
120
 
121
121
  - Keep the task short, specific, and directly executable
122
122
  - Keep wording close to the user\u2019s request with minimal transformation
123
+ - Do not expand the assigned task into unsolicited recommendations, implementation advice, publishing guidance, classification proposals, future analysis, or other work the selected agent was not asked to perform.
124
+ - Route a request to an agent only when the request fits that agent's registered description, supported actions, and available app context. Do not route unrelated general-knowledge, advice, opinion, political, health, security, or other out-of-scope requests to an agent merely because the user asks for that agent by name.
123
125
  - When resolving follow-up references, only replace the ambiguous reference with the resolved prior context; keep the rest of the user\u2019s wording as close as possible.
124
126
 
125
127
  - Use only information explicitly present in the user request or provided context
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import x from"./4IU63OWQ.js";import w from"./VNLSYVPE.js";import t from"./33SFAZQG.js";import s from"./5A355PGH.js";import{a as $}from"./XQ3NBBQ3.js";import r from"./HMNBUGH2.js";import q from"./QNXI3WOF.js";import"./TWU3QXAS.js";import p from"./VWP2B4LB.js";import{a as ne}from"./5Q2XRQS6.js";import o from"./RHYNE5OE.js";import n from"./K7YQIJFT.js";import m from"./H6P3WP5D.js";import l from"./SZRJTQ54.js";import k from"./AVZ5Y6BK.js";import i from"./CCC6LBMY.js";import"./34O57OGV.js";import{a as K}from"./LXPGQNXQ.js";import{a as u}from"./FDOMMK2M.js";import h from"./WVP73XWD.js";import{a as Y}from"./Z5XQLSYH.js";import{a as ee}from"./OZAZ277H.js";import g from"./AVRS6UCQ.js";import{a as ae}from"./K5JVB6FU.js";import{a as se}from"./FCI6M62J.js";import{a as oe}from"./BFZ5S7NF.js";import f from"./7EHOFQ2P.js";import e from"./DG27JEYG.js";import{e as G,f as D}from"./FS7GXTTQ.js";import"./WXQ26G5Q.js";import"./MJSIYEWN.js";import c from"./AHCXG7XF.js";import a from"./UHICISBZ.js";import{a as b}from"./ONQ6JSBJ.js";import"./R74ZHFA6.js";import{a as d,b as H}from"./V7Y22FRP.js";import"./AXTQU5YL.js";import{Ya as T,r as v,s as y}from"./LOQ2PKV5.js";import{ta as j}from"./IYLFJCJ2.js";import{a as M}from"./VXFQANGJ.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([be,Se,,,,,,,{b:O,g:P,h:Z,i:W,j:B,k:R,l:C,m:J,n:_,o:q,p:S,q:Q,r:U},{a:F,b:Te},te,X,{a:N},,,,,ie,re,{b:k,c:L,d:x,e:w,f:A,g:le,h:I,i:ce,v:z},pe,{a:E,b:ue},me,ge,de])=>{var ke=async e=>{let t=e.allLayers.toArray(),a=[],r=new Map;for(let s of t)if(s instanceof be){let o=(async()=>{let i=await Q(s),n=await U(s,i);r.set(s.id,{layerItem:n,fieldRegistry:i})})();a.push(o)}return await Promise.all(a),r},$e=async e=>{await Se.whenOnce(()=>e.ready);let t=await ke(e.map),{layers:a}=await Me(t),r={schemaVersion:P,modified:Date.now(),embeddings:{modelProvider:W,model:B,dimensions:Z,templates:{layer:R,field:C}},layers:a},s=J.safeParse(r);if(!s.success)throw console.error("Schema Mismatch:",s.error.format()),new Error("Webmap embedding generation failed validation.");return s.data},Me=async e=>{let t=[],a=[];for(let[o,{fieldRegistry:i,layerItem:n}]of e.entries()){let l=he(R,{name:n.name,title:n.title,description:n.description});t.push(l);let c={id:o,name:n.name??"",title:n.title,description:n.description,vector:[],fields:[]};for(let[,m]of i.entries()){let g=he(C,{name:m.name,alias:m.alias,description:m.description});t.push(g),c.fields.push({name:m.name,alias:m.alias,description:m.description,vector:[]})}a.push(c)}let r=await F(t),s=0;return{layers:a.map(o=>(o.vector=r[s++],o.fields.forEach(i=>{i.vector=r[s++]}),o))}},he=(e,t)=>e.replace(/\{(\w+)\}/gu,(a,r)=>t[r]??""),Re=(e,t)=>{if(e.length!==t.length)throw new Error("Vectors must be the same length");let a=0,r=0,s=0;for(let n=0;n<e.length;++n){let l=e[n],c=t[n];a+=l*c,r+=l*l,s+=c*c}let o=Math.sqrt(r*s);if(o===0)return 0;let i=a/o;return Math.max(-1,Math.min(1,i))},V=[X,Y,ee,te,ae,se,oe,re,ne];async function Ce(e,t){let a=await x("navigation_tool_prompt"),{mapView:r}=b(t,["mapView"]),s=r.map.bookmarks?.map(f=>f.name).filter(Boolean)??[],o=e.vectorSearchLayerResults?.length>0?e.vectorSearchLayerResults.map((f,ve)=>`${ve+1}. layerId=${f.id} | title=${f.title??""} | name=${f.name??""} | score=${f.score.toFixed(2)}`).join(`
2
+ import x from"./TGYRNH5D.js";import w from"./Q5WITJ3L.js";import t from"./RMLCWLJC.js";import s from"./HHQTKKYE.js";import{a as $}from"./XQ3NBBQ3.js";import r from"./AKOLZ4JN.js";import q from"./XOULSLM7.js";import"./4PKMJMND.js";import p from"./VWP2B4LB.js";import{a as ne}from"./5Q2XRQS6.js";import o from"./RHYNE5OE.js";import n from"./K7YQIJFT.js";import m from"./UT6JA4TK.js";import l from"./CA3RNGPN.js";import k from"./ES54NWOB.js";import i from"./CCC6LBMY.js";import"./34O57OGV.js";import{a as K}from"./LXPGQNXQ.js";import{a as u}from"./FDOMMK2M.js";import h from"./WVP73XWD.js";import{a as Y}from"./Z5XQLSYH.js";import{a as ee}from"./OZAZ277H.js";import g from"./AVRS6UCQ.js";import{a as ae}from"./K5JVB6FU.js";import{a as se}from"./FCI6M62J.js";import{a as oe}from"./BFZ5S7NF.js";import f from"./Y5O6VNSQ.js";import e from"./64IWQ7A4.js";import{e as G,f as D}from"./FS7GXTTQ.js";import"./WXQ26G5Q.js";import"./MJSIYEWN.js";import c from"./JNOH4PD5.js";import a from"./KA3S22NQ.js";import{a as b}from"./ONQ6JSBJ.js";import"./R74ZHFA6.js";import{a as d,b as H}from"./V7Y22FRP.js";import"./AXTQU5YL.js";import{Ya as T,r as v,s as y}from"./LOQ2PKV5.js";import{ta as j}from"./IYLFJCJ2.js";import{a as M}from"./VXFQANGJ.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([be,Se,,,,,,,{b:O,g:P,h:Z,i:W,j:B,k:R,l:C,m:J,n:_,o:q,p:S,q:Q,r:U},{a:F,b:Te},te,X,{a:N},,,,,ie,re,{b:k,c:L,d:x,e:w,f:A,g:le,h:I,i:ce,v:z},pe,{a:E,b:ue},me,ge,de])=>{var ke=async e=>{let t=e.allLayers.toArray(),a=[],r=new Map;for(let s of t)if(s instanceof be){let o=(async()=>{let i=await Q(s),n=await U(s,i);r.set(s.id,{layerItem:n,fieldRegistry:i})})();a.push(o)}return await Promise.all(a),r},$e=async e=>{await Se.whenOnce(()=>e.ready);let t=await ke(e.map),{layers:a}=await Me(t),r={schemaVersion:P,modified:Date.now(),embeddings:{modelProvider:W,model:B,dimensions:Z,templates:{layer:R,field:C}},layers:a},s=J.safeParse(r);if(!s.success)throw console.error("Schema Mismatch:",s.error.format()),new Error("Webmap embedding generation failed validation.");return s.data},Me=async e=>{let t=[],a=[];for(let[o,{fieldRegistry:i,layerItem:n}]of e.entries()){let l=he(R,{name:n.name,title:n.title,description:n.description});t.push(l);let c={id:o,name:n.name??"",title:n.title,description:n.description,vector:[],fields:[]};for(let[,m]of i.entries()){let g=he(C,{name:m.name,alias:m.alias,description:m.description});t.push(g),c.fields.push({name:m.name,alias:m.alias,description:m.description,vector:[]})}a.push(c)}let r=await F(t),s=0;return{layers:a.map(o=>(o.vector=r[s++],o.fields.forEach(i=>{i.vector=r[s++]}),o))}},he=(e,t)=>e.replace(/\{(\w+)\}/gu,(a,r)=>t[r]??""),Re=(e,t)=>{if(e.length!==t.length)throw new Error("Vectors must be the same length");let a=0,r=0,s=0;for(let n=0;n<e.length;++n){let l=e[n],c=t[n];a+=l*c,r+=l*l,s+=c*c}let o=Math.sqrt(r*s);if(o===0)return 0;let i=a/o;return Math.max(-1,Math.min(1,i))},V=[X,Y,ee,te,ae,se,oe,re,ne];async function Ce(e,t){let a=await x("navigation_tool_prompt"),{mapView:r}=b(t,["mapView"]),s=r.map.bookmarks?.map(f=>f.name).filter(Boolean)??[],o=e.vectorSearchLayerResults?.length>0?e.vectorSearchLayerResults.map((f,ve)=>`${ve+1}. layerId=${f.id} | title=${f.title??""} | name=${f.name??""} | score=${f.score.toFixed(2)}`).join(`
3
3
  `):"",i=e.vectorSearchFieldResults?.length>0?JSON.stringify(e.vectorSearchFieldResults,null,2):"",n=e.intent==="goToBookmark"&&s.length?`Available bookmarks:
4
4
  ${s.map(f=>`- ${f}`).join(`
5
5
  `)}`:"",l=(e.intent==="goToLayer"||e.intent==="goToFeatures")&&e.vectorSearchLayerResults?.length?`Candidate layers:
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import a from"./QNXI3WOF.js";export default $arcgis.t(([{a:i}])=>{var d=(s,e)=>{let n=Array.from(s?.values()??[]).map(({fieldRegistry:r,layerItem:t})=>{let a=Array.from(r.values(),({name:o})=>o);return{title:t.title,description:t.description,fields:a.slice(0,10),additionalFieldCount:Math.max(a.length-10,0)}}),l=(e?.list()??[]).map(({agent:{description:r,id:t,name:a}})=>({id:t,name:a,description:r}));return JSON.stringify({layers:n,agents:l},null,2)},p=({config:s})=>{let e=s?.configurable?.services;return d(e?.layersAndFieldsRegistry,e?.agentRegistry)},c=[async()=>(await import("./74CVYM72.js")).default],m=i({id:"help",name:"Help Agent",description:"Answers questions about the current map, its layers and fields, and available assistant capabilities. Use for general help, unsupported map actions, and unrelated requests that should be redirected to map-related questions.",skillLoaders:c,modelTier:"default",systemPrompt:"You are an ArcGIS map help agent.",runtimeContextLoader:p,fallbackMessage:"Help request completed.",failureMessage:"I couldn't complete the help request."});return m},a)
2
+ import a from"./XOULSLM7.js";export default $arcgis.t(([{a:i}])=>{var d=(s,e)=>{let n=Array.from(s?.values()??[]).map(({fieldRegistry:r,layerItem:t})=>{let a=Array.from(r.values(),({name:o})=>o);return{title:t.title,description:t.description,fields:a.slice(0,10),additionalFieldCount:Math.max(a.length-10,0)}}),l=(e?.list()??[]).map(({agent:{description:r,id:t,name:a}})=>({id:t,name:a,description:r}));return JSON.stringify({layers:n,agents:l},null,2)},p=({config:s})=>{let e=s?.configurable?.services;return d(e?.layersAndFieldsRegistry,e?.agentRegistry)},c=[async()=>(await import("./74CVYM72.js")).default],m=i({id:"help",name:"Help Agent",description:"Answers questions about the current map, its layers and fields, and available assistant capabilities. Use for general help, unsupported map actions, and unrelated requests that should be redirected to map-related questions.",skillLoaders:c,modelTier:"default",systemPrompt:"You are an ArcGIS map help agent.",runtimeContextLoader:p,fallbackMessage:"Help request completed.",failureMessage:"I couldn't complete the help request."});return m},a)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import n from"./VNLSYVPE.js";import m from"./QNXI3WOF.js";import{a as o,c as p}from"./V6HOUZPZ.js";import"./TWU3QXAS.js";import l from"./VWP2B4LB.js";import"./5Q2XRQS6.js";import k from"./K7YQIJFT.js";import j from"./H6P3WP5D.js";import h from"./SZRJTQ54.js";import g from"./AVZ5Y6BK.js";import f from"./CCC6LBMY.js";import"./34O57OGV.js";import"./LXPGQNXQ.js";import"./FDOMMK2M.js";import e from"./WVP73XWD.js";import"./Z5XQLSYH.js";import"./OZAZ277H.js";import d from"./AVRS6UCQ.js";import"./K5JVB6FU.js";import"./FCI6M62J.js";import"./BFZ5S7NF.js";import"./3UEKINYC.js";import"./RLEHNAIA.js";import c from"./DG27JEYG.js";import"./FS7GXTTQ.js";import"./WXQ26G5Q.js";import"./MJSIYEWN.js";import b from"./AHCXG7XF.js";import a from"./UHICISBZ.js";import"./ONQ6JSBJ.js";import{v as i,z as r}from"./COH3QXWG.js";import"./R74ZHFA6.js";import"./V7Y22FRP.js";import"./AXTQU5YL.js";import"./LOQ2PKV5.js";import"./IYLFJCJ2.js";import"./VXFQANGJ.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([,,,,,,,,,,,,,,,,,,,,,,m])=>{var t=class extends i{constructor(){super(...arguments),this.agent=m}static{this.properties={referenceElement:1}}#t;#i;getContext(){if(!this.#t)throw new Error("arcgis-assistant-help-agent requires a mapView");return{mapView:this.#t}}load(){this.#t=o(this,"arcgis-assistant-help-agent"),this.#i=p(this)}disconnectedCallback(){this.#i?.unregister(this.agent.id),super.disconnectedCallback()}};r("arcgis-assistant-help-agent",t);return t},"identity/IdentityManager","portal/Portal","request","config","core/reactiveUtils","layers/FeatureLayer","intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","rest/knowledgeGraphService",a,b,c,d,e,f,g,h,j,k,l,m,n)
2
+ import n from"./Q5WITJ3L.js";import m from"./XOULSLM7.js";import{a as o,c as p}from"./V6HOUZPZ.js";import"./4PKMJMND.js";import l from"./VWP2B4LB.js";import"./5Q2XRQS6.js";import k from"./K7YQIJFT.js";import j from"./UT6JA4TK.js";import h from"./CA3RNGPN.js";import g from"./ES54NWOB.js";import f from"./CCC6LBMY.js";import"./34O57OGV.js";import"./LXPGQNXQ.js";import"./FDOMMK2M.js";import e from"./WVP73XWD.js";import"./Z5XQLSYH.js";import"./OZAZ277H.js";import d from"./AVRS6UCQ.js";import"./K5JVB6FU.js";import"./FCI6M62J.js";import"./BFZ5S7NF.js";import"./3UEKINYC.js";import"./RLEHNAIA.js";import c from"./64IWQ7A4.js";import"./FS7GXTTQ.js";import"./WXQ26G5Q.js";import"./MJSIYEWN.js";import b from"./JNOH4PD5.js";import a from"./KA3S22NQ.js";import"./ONQ6JSBJ.js";import{v as i,z as r}from"./COH3QXWG.js";import"./R74ZHFA6.js";import"./V7Y22FRP.js";import"./AXTQU5YL.js";import"./LOQ2PKV5.js";import"./IYLFJCJ2.js";import"./VXFQANGJ.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([,,,,,,,,,,,,,,,,,,,,,,m])=>{var t=class extends i{constructor(){super(...arguments),this.agent=m}static{this.properties={referenceElement:1}}#t;#i;getContext(){if(!this.#t)throw new Error("arcgis-assistant-help-agent requires a mapView");return{mapView:this.#t}}load(){this.#t=o(this,"arcgis-assistant-help-agent"),this.#i=p(this)}disconnectedCallback(){this.#i?.unregister(this.agent.id),super.disconnectedCallback()}};r("arcgis-assistant-help-agent",t);return t},"identity/IdentityManager","portal/Portal","request","config","core/reactiveUtils","layers/FeatureLayer","intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","rest/knowledgeGraphService",a,b,c,d,e,f,g,h,j,k,l,m,n)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import c from"./AVZ5Y6BK.js";import b from"./CCC6LBMY.js";import"./34O57OGV.js";import a from"./UHICISBZ.js";import"./ONQ6JSBJ.js";import"./IYLFJCJ2.js";import"./VXFQANGJ.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([,,a])=>{return a},a,b,c)
2
+ import c from"./CA3RNGPN.js";import b from"./CCC6LBMY.js";import"./34O57OGV.js";import a from"./KA3S22NQ.js";import"./ONQ6JSBJ.js";import"./IYLFJCJ2.js";import"./VXFQANGJ.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([,,a])=>{return a},a,b,c)
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as R}from"./XQ3NBBQ3.js";import b from"./QNXI3WOF.js";import a from"./DG27JEYG.js";import{a as c,b as k}from"./V7Y22FRP.js";import{A as f,Ya as x,r as w,s as d}from"./LOQ2PKV5.js";import{ta as u}from"./IYLFJCJ2.js";export default $arcgis.t(([,,,,,,{n:_,p:b},{A:S,B:M,C:T,D:E,E:C,F:G,G:N,b:v,d:m,e:h,w:y,x:A,y:K,z:q}])=>{var z=[M,T,G,E,S,N,C];async function $(e,a){let o=await m("arcgis_knowledge_tool_prompt"),s=A(a),n={assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps,contextType:s},r=await b({promptText:o,messages:e.arcgisKnowledgeMessages,inputVariables:n,tools:z,config:a}),i=(r.tool_calls?.length??0)>0,t=typeof r.text=="string"?r.text.trim():"",l=t.length>0,p=r.text;return!i&&(s==="map"||s==="knowledgeGraph")?{...e,arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,r],outputMessage:s==="map"?"No tools were found for the current view and prompt. Maps do not support changing nonspatial visibility, layout changes, or generation from queries.":"No tools were found for the current prompt and knowledge graph service. A knowledge graph service only supports search and query.",status:"success"}:{...e,arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,r],outputMessage:i?p:t,status:i?e.status:l?"success":"failed",summary:p?h(p):"ArcGIS Knowledge Agent tool executed."}}var L={generateCypher:"generated-cypher-query",queryGraphData:"graph-query-result",searchGraphData:"graph-search-result",addRecords:"added-records",applyLayout:"applied-layout",changeNonspatialVisibility:"changed-nonspatial-visibility",createLinkChart:"created-link-chart"};function I(e){return!!e&&e.status==="success"&&!!L[e.toolName]}function D(e){return{type:L[e.toolName],data:e.details}}async function F(e,a){let o=new v(z,{handleToolErrors:!1});try{let s=await o.invoke({messages:e.arcgisKnowledgeMessages},a),n=[];for(let t of s.messages){let l;if(typeof t.content!="string")throw new Error(`Unexpected tool message content type: ${typeof t.content}. Expected string.`);try{l=JSON.parse(t.content)}catch{throw new Error(`Failed to parse tool message content as JSON. Tool: ${t.name??"unknown"}.
2
+ import{a as R}from"./XQ3NBBQ3.js";import b from"./XOULSLM7.js";import a from"./64IWQ7A4.js";import{a as c,b as k}from"./V7Y22FRP.js";import{A as f,Ya as x,r as w,s as d}from"./LOQ2PKV5.js";import{ta as u}from"./IYLFJCJ2.js";export default $arcgis.t(([,,,,,,{n:_,p:b},{A:S,B:M,C:T,D:E,E:C,F:G,G:N,b:v,d:m,e:h,w:y,x:A,y:K,z:q}])=>{var z=[M,T,G,E,S,N,C];async function $(e,a){let o=await m("arcgis_knowledge_tool_prompt"),s=A(a),n={assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps,contextType:s},r=await b({promptText:o,messages:e.arcgisKnowledgeMessages,inputVariables:n,tools:z,config:a}),i=(r.tool_calls?.length??0)>0,t=typeof r.text=="string"?r.text.trim():"",l=t.length>0,p=r.text;return!i&&(s==="map"||s==="knowledgeGraph")?{...e,arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,r],outputMessage:s==="map"?"No tools were found for the current view and prompt. Maps do not support changing nonspatial visibility, layout changes, or generation from queries.":"No tools were found for the current prompt and knowledge graph service. A knowledge graph service only supports search and query.",status:"success"}:{...e,arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,r],outputMessage:i?p:t,status:i?e.status:l?"success":"failed",summary:p?h(p):"ArcGIS Knowledge Agent tool executed."}}var L={generateCypher:"generated-cypher-query",queryGraphData:"graph-query-result",searchGraphData:"graph-search-result",addRecords:"added-records",applyLayout:"applied-layout",changeNonspatialVisibility:"changed-nonspatial-visibility",createLinkChart:"created-link-chart"};function I(e){return!!e&&e.status==="success"&&!!L[e.toolName]}function D(e){return{type:L[e.toolName],data:e.details}}async function F(e,a){let o=new v(z,{handleToolErrors:!1});try{let s=await o.invoke({messages:e.arcgisKnowledgeMessages},a),n=[];for(let t of s.messages){let l;if(typeof t.content!="string")throw new Error(`Unexpected tool message content type: ${typeof t.content}. Expected string.`);try{l=JSON.parse(t.content)}catch{throw new Error(`Failed to parse tool message content as JSON. Tool: ${t.name??"unknown"}.
3
3
 
4
4
  Original Content: ${t.content}`)}if(!l||typeof l!="object"||!("toolName"in l))throw new Error(`Parsed tool message content does not have expected structure. Parsed content: ${JSON.stringify(l)}`);n.push(l)}await c({text:`Finished executing ArcGIS Knowledge Agent tools: ${s.messages.filter(t=>t.name).map(t=>t.name).join(", ")}`},a);let r=n.filter(t=>typeof t!="string").map(t=>`- Called Tool: ${t.toolName}, Status: ${t.status}`),i=n[0];return i&&I(i)&&await k(D(i),a),{...e,outputMessage:r.join(`
5
5
  `),summary:r.length?h(r.join(`
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import a from"./EVMIYZWD.js";import"./JQYLMTDP.js";import"./FS7GXTTQ.js";import"./LOQ2PKV5.js";import"./IYLFJCJ2.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([{property:g,subclass:p},{c:d,d:u}])=>{var f=Object.defineProperty,w=Object.getOwnPropertyDescriptor,c=(e,r,n,o)=>{for(var t=o>1?void 0:o?w(r,n):r,i=e.length-1,a;i>=0;i--)(a=e[i])&&(t=(o?a(r,n,t):a(t))||t);return o&&t&&f(r,n,t),t},s=class extends u{constructor(e){super(e)}getAgents(){return this.agents}buildNodes(e){let r=super.buildNodes(e);return r[l]=()=>({}),r}buildEdges(e){let r=this.condition;if(!r)throw new Error("ConditionalWorkflow requires a condition.");let n=d(e[0],0),o=d(e[1],1);return[{from:l,decide:async(t,i)=>await Promise.resolve(r(t,i))?n:o}]}getEntryNode(){return l}isTerminalAgent(){return!0}validateAgents(e){if(super.validateAgents(e),e.length!==2)throw new Error(`ConditionalWorkflow requires exactly 2 agents; received ${e.length}.`)}};c([g()],s.prototype,"condition",2);c([g()],s.prototype,"agents",2);s=c([p("ConditionalWorkflow")],s);var l="__conditional_decide";return s},"core/accessorSupport/decorators",a)
2
+ import a from"./H4BVWDNV.js";import"./CLRFKSAT.js";import"./FS7GXTTQ.js";import"./LOQ2PKV5.js";import"./IYLFJCJ2.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([{property:g,subclass:p},{c:d,d:u}])=>{var f=Object.defineProperty,w=Object.getOwnPropertyDescriptor,c=(e,r,n,o)=>{for(var t=o>1?void 0:o?w(r,n):r,i=e.length-1,a;i>=0;i--)(a=e[i])&&(t=(o?a(r,n,t):a(t))||t);return o&&t&&f(r,n,t),t},s=class extends u{constructor(e){super(e)}getAgents(){return this.agents}buildNodes(e){let r=super.buildNodes(e);return r[l]=()=>({}),r}buildEdges(e){let r=this.condition;if(!r)throw new Error("ConditionalWorkflow requires a condition.");let n=d(e[0],0),o=d(e[1],1);return[{from:l,decide:async(t,i)=>await Promise.resolve(r(t,i))?n:o}]}getEntryNode(){return l}isTerminalAgent(){return!0}validateAgents(e){if(super.validateAgents(e),e.length!==2)throw new Error(`ConditionalWorkflow requires exactly 2 agents; received ${e.length}.`)}};c([g()],s.prototype,"condition",2);c([g()],s.prototype,"agents",2);s=c([p("ConditionalWorkflow")],s);var l="__conditional_decide";return s},"core/accessorSupport/decorators",a)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{b as L,c as M}from"./V6HOUZPZ.js";import{a as B}from"./TWU3QXAS.js";import"./3UEKINYC.js";import"./RLEHNAIA.js";import d from"./SHI76XUV.js";import"./P4XZMBU5.js";import b from"./TYATJUNF.js";import{a as V,b as F,e as H}from"./JQYLMTDP.js";import a from"./DG27JEYG.js";import{e as $}from"./FS7GXTTQ.js";import{v as D,z as q}from"./COH3QXWG.js";import"./R74ZHFA6.js";import{c as U}from"./UCTC4JN4.js";import"./V7Y22FRP.js";import"./QRMRID2M.js";import"./AXTQU5YL.js";import{J as W,_ as E,ka as J}from"./LOQ2PKV5.js";import"./IYLFJCJ2.js";import"./VXFQANGJ.js";import{Dd as c}from"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([Q,ie,{property:a,subclass:h},_,C,,,,,,,G,z])=>{var ae=Object.defineProperty,ce=Object.getOwnPropertyDescriptor,y=(e,t,r,s)=>{for(var o=s>1?void 0:s?ce(t,r):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(o=(s?i(t,r,o):i(o))||o);return s&&o&&ae(t,r,o),o},p=class extends C{constructor(e){super(e)}static fromJSON(e){return new p({id:e.id,sourceAnchorId:e.source_anchor_id,sourceNodeId:e.source_node_id,targetAnchorId:e.target_anchor_id,targetNodeId:e.target_node_id})}};y([a()],p.prototype,"id",2);y([a()],p.prototype,"sourceAnchorId",2);y([a()],p.prototype,"sourceNodeId",2);y([a()],p.prototype,"targetAnchorId",2);y([a()],p.prototype,"targetNodeId",2);p=y([h("Edge")],p);var pe=Object.defineProperty,de=Object.getOwnPropertyDescriptor,I=(e,t,r,s)=>{for(var o=s>1?void 0:s?de(t,r):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(o=(s?i(t,r,o):i(o))||o);return s&&o&&pe(t,r,o),o},d=class extends C{constructor(e){super(e)}async load(){return await Promise.resolve(this)}compile(e){return{runtimeNode:this.createRuntimeNode(),edges:e.outgoingEdges.map(t=>({from:this.id,to:t.targetNodeId}))}}static fromJSON(e){throw new Error("BaseNode is abstract and cannot be instantiated directly.")}};I([a()],d.prototype,"id",2);I([a()],d.prototype,"label",2);I([a()],d.prototype,"type",2);d=I([h("BaseNode")],d);function X(e){let t=new Set(e.required),r=Object.fromEntries(Object.entries(e.properties).map(([s,o])=>{let n=Y(o);return[s,t.has(s)?n:n.optional()]}));return c.object(r)}function Y(e){let t;switch(e.type){case"array":t=c.array(e.items?Y(e.items):c.unknown());break;case"boolean":t=c.boolean();break;case"number":t=c.number();break;case"object":t=X({properties:e.properties??{},required:e.required});break;case"string":t=e.enum?.length?c.enum(e.enum):c.string();break}return e.description?t.describe(e.description):t}var ue=Object.defineProperty,me=Object.getOwnPropertyDescriptor,j=(e,t,r,s)=>{for(var o=s>1?void 0:s?me(t,r):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(o=(s?i(t,r,o):i(o))||o);return s&&o&&ue(t,r,o),o},he=e=>e.replace(/_([a-z])/gu,(t,r)=>r.toUpperCase()),l=class extends C{constructor(e){super(e),this.type="arcgis-tool"}async createRuntimeTools(){if(!this.name)throw new Error("ArcgisTool name is required");return[await B(he(this.name))]}static fromJSON(e){return new l({name:e.name,requireApproval:e.require_approval})}};j([a()],l.prototype,"name",2);j([a()],l.prototype,"requireApproval",2);j([a()],l.prototype,"type",2);l=j([h("ArcgisTool")],l);var le=Object.defineProperty,ge=Object.getOwnPropertyDescriptor,Z=e=>{throw TypeError(e)},w=(e,t,r,s)=>{for(var o=s>1?void 0:s?ge(t,r):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(o=(s?i(t,r,o):i(o))||o);return s&&o&&le(t,r,o),o},fe=(e,t,r)=>t.has(e)||Z("Cannot "+r),ye=(e,t,r)=>t.has(e)?Z("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),we=(e,t,r)=>(fe(e,t,"access private method"),r),k,ee,u=class extends d{constructor(e){super(e),ye(this,k),this.type="agent-node"}createRuntimeNode(){let e;return async(t,r)=>{e??=we(this,k,ee).call(this);let s=await(await e).run(t,r),o=this.outputSchema?.safeParse(s);if(o&&!o.success)throw o.error;let n=o?.data,i=n??s.outputMessage;return{agentExecutionContext:s.agentExecutionContext,...n?{}:{outputMessage:s.outputMessage},status:s.status,summary:s.summary,nodes:{[this.id]:{output:i}}}}}compile(e){let t=e.outgoingEdges[0]?.targetNodeId;return{runtimeNode:this.createRuntimeNode(),edges:[{from:this.id,decide:r=>r.status==="failed"?void 0:t}],schemas:[c.object({output:this.outputSchema??c.string()})]}}static fromJSON(e){let t=new u({id:e.id,label:e.label,prompt:e.prompt?.content,type:"agent-node",modelTier:e.llm_model?.model_tier});return e.structured_output&&(t.outputSchema=X(e.structured_output)),t.tools=e.tools?.filter(r=>r.type==="arcgis_tool").map(r=>l.fromJSON(r)),t}};k=new WeakSet;ee=async function(){let e=this.prompt;if(!e?.trim())throw new Error(`WebAgent agent node "${this.id}" requires a prompt.`);let t=[];if(this.tools)for(let r of this.tools){let s=await r.createRuntimeTools();t.push(...s)}return new z({name:this.id,outputSchema:this.outputSchema,modelTier:this.modelTier,prompt:e,tools:t})};w([a()],u.prototype,"type",2);w([a()],u.prototype,"prompt",2);w([a()],u.prototype,"outputSchema",2);w([a()],u.prototype,"tools",2);w([a()],u.prototype,"modelTier",2);u=w([h("AgentNode")],u);var be=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,T=(e,t,r,s)=>{for(var o=s>1?void 0:s?Ne(t,r):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(o=(s?i(t,r,o):i(o))||o);return s&&o&&be(t,r,o),o},g=class extends d{constructor(e){super(e),this.type="end-message-node"}createRuntimeNode(){return async e=>{let t=await E.fromTemplate(this.message,{templateFormat:"mustache"}).format(e);return{outputMessage:t,status:"success",summary:t}}}compile(e){return{runtimeNode:this.createRuntimeNode(),edges:[]}}static fromJSON(e){let t=new g({id:e.id,label:e.label,type:"end-message-node"});return t.message=e.message,t}};T([a()],g.prototype,"type",2);T([a()],g.prototype,"message",2);g=T([h("EndMessageNode")],g);var Oe=Object.defineProperty,Se=Object.getOwnPropertyDescriptor,te=e=>{throw TypeError(e)},O=(e,t,r,s)=>{for(var o=s>1?void 0:s?Se(t,r):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(o=(s?i(t,r,o):i(o))||o);return s&&o&&Oe(t,r,o),o},_e=(e,t,r)=>t.has(e)||te("Cannot "+r),ve=(e,t,r)=>t.has(e)?te("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),K=(e,t,r)=>(_e(e,t,"access private method"),r),v,re,oe,m=class extends d{constructor(e){super(e),ve(this,v),this.type="human-in-the-loop-node",this.conditions=[]}createRuntimeNode(){return async(e,t)=>{let r=Ie(t,this.id),s=`${r}:${this.id}`,o=U(t);if(o===void 0||!Ae(o,this.response?.type))throw new W({agentId:r,id:s,kind:je(this.response?.type),message:await K(this,v,re).call(this,e),metadata:K(this,v,oe).call(this,e)});return{nodes:{[this.id]:{output:o}}}}}compile(e){return{runtimeNode:this.createRuntimeNode(),edges:[{from:this.id,decide:t=>{if(!this.conditions.length)return e.outgoingEdges[0]?.targetNodeId;let r=t.nodes?.[this.id]?.output,s=this.conditions.find(o=>Ee(o.optionValue,r));if(s)return e.outgoingEdges.find(o=>o.sourceAnchorId===s.sourceAnchorId)?.targetNodeId}}]}}static fromJSON(e){let t=new m({id:e.id,label:e.label,type:"human-in-the-loop-node"});return t.message=e.message,t.response=e.response,t.conditions=(e.conditions??[]).map(({optionValue:r,source_anchor_id:s})=>({optionValue:r,sourceAnchorId:s})),t}};v=new WeakSet;re=async function(e){if(this.message?.source==="generated")throw new Error(`Human-in-the-loop node "${this.id}" does not support generated messages yet.`);let t=this.message?.content;if(!t)throw new Error(`Human-in-the-loop node "${this.id}" requires a message content.`);return await E.fromTemplate(t,{templateFormat:"mustache"}).format(e)};oe=function(e){let t=this.response;if(!t||t.type==="confirmation"||t.type==="textInput")return;let r=t.choices;return r?.source==="fixed"?r.items?.map(s=>s.value??s.label??""):r?.source==="reference"?Je(e,r.reference)?.map(String):void 0};O([a()],m.prototype,"type",2);O([a()],m.prototype,"message",2);O([a()],m.prototype,"response",2);O([a()],m.prototype,"conditions",2);m=O([h("HumanInTheLoopNode")],m);function Ie(e,t){let r=e?.configurable?.agentId;return typeof r=="string"&&r?r:t}function je(e){switch(e){case"singleSelect":return"singleSelection";case"multipleSelect":return"multipleSelection";case"textInput":return"textInput";default:return"booleanChoice"}}function Ae(e,t){switch(t){case"confirmation":return typeof e=="boolean";case"singleSelect":return typeof e=="string"||Array.isArray(e)&&e.length===1&&typeof e[0]=="string";case"multipleSelect":return Array.isArray(e)&&e.every(r=>typeof r=="string");case"textInput":return typeof e=="string";default:return!0}}function Ee(e,t){return Array.isArray(t)?t.some(r=>r===e):t===e}function Je(e,t){if(!t)return;let r=t.split(".").reduce((s,o)=>{if(s&&typeof s=="object"&&o in s)return s[o]},e);return Array.isArray(r)?r:typeof r=="string"?[r]:void 0}var ke=Object.defineProperty,xe=Object.getOwnPropertyDescriptor,se=(e,t,r,s)=>{for(var o=s>1?void 0:s?xe(t,r):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(o=(s?i(t,r,o):i(o))||o);return s&&o&&ke(t,r,o),o},N=class extends d{constructor(e){super(e),this.type="start-node"}createRuntimeNode(){return e=>({question:e.agentExecutionContext.userRequest})}static fromJSON(e){return new N({id:e.id,label:e.label,type:"start-node"})}};se([a()],N.prototype,"type",2);N=se([h("StartNode")],N);function Pe(e){switch(e.type){case"agent_node":return u.fromJSON(e);case"end_message_node":return g.fromJSON(e);case"human_in_the_loop_node":return m.fromJSON(e);case"start_node":return N.fromJSON(e);default:throw new Error(`WebAgent node "${e.id}" uses unsupported type "${e.type}".`)}}function Ce(e={}){let t=Object.keys(e);if(V(t),t.includes("nodes"))throw new Error("node state cannot define reserved field: nodes.");let r=F(e);return J.Root({...r,nodes:J({reducer:(s,o)=>({...s,...o}),default:()=>({})}),...$()})}function ne(e,t={}){let r=new Set;for(let o of e)for(let n of Object.keys(o.shape??{}))n!=="nodes"&&r.add(n);let s=Object.fromEntries([...r].map(o=>[o,t[o]]));for(let[o,n]of Object.entries(t))s[o]=n;return Ce(s)}var x=class e{constructor(t,r,s){this.sourceJSON=t,this.edges=r,this.nodes=s,this._loaded=!1}static fromJSON(t){return new e(t,t.graph.edges.map(r=>p.fromJSON(r)),t.graph.nodes.map(r=>Pe(r)))}async load(){return this._loadPromise??=Promise.all(this.nodes.map(async t=>await t.load())).then(()=>{this._loaded=!0}),await this._loadPromise,this}getSchemas(){let t=Object.fromEntries(this._getNodeCompilations().flatMap((r,s)=>{let o=this.nodes[s];return r.schemas?.map(n=>[o.id,n])??[]}));return[c.object({loopCounts:c.record(c.string(),c.number()).optional(),nodes:c.object(t).partial().optional(),question:c.string().optional(),variables:this._getVariablesSchema()})]}generate(){this._assertLoaded(),this._nodeCompilations=void 0;let t=this._getNodeCompilations(),r=Object.fromEntries(this.sourceJSON.variables.map(({key:b,value:A})=>[b,A])),s=ne(this.getSchemas(),{variables:r}),o=this.nodes.find(b=>b.type==="start-node")?.id,n={},i=[];for(let[b,A]of this.nodes.entries()){let S=t[b];S&&(S.runtimeNode&&(n[A.id]=S.runtimeNode),i.push(...S.edges))}return{createGraph:()=>H(n,i,s,{entryNode:o}),workspace:s}}_assertLoaded(){if(!this._loaded)throw new Error("AgenticWorkflowRuntime must be loaded before it can generate a graph.")}_getNodeCompilations(){return this._assertLoaded(),this._nodeCompilations??=this.nodes.map(t=>t.compile({outgoingEdges:this.edges.filter(r=>r.sourceNodeId===t.id)}))}_getVariablesSchema(){return c.object(Object.fromEntries(this.sourceJSON.variables.map(({key:t})=>[t,c.unknown()])))}},Te=Object.defineProperty,Re=Object.getOwnPropertyDescriptor,R=(e,t,r,s)=>{for(var o=s>1?void 0:s?Re(t,r):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(o=(s?i(t,r,o):i(o))||o);return s&&o&&Te(t,r,o),o},De=()=>{throw new Error("WebAgent must be loaded before it can run.")},f=class extends G{constructor(e){super(e)}async load(){if(this.portalItem){try{await this.portalItem.load()}catch(r){throw new _("web-agent:load-portal-item","Failed to load portal item",{error:r})}let t=await this.portalItem.fetchData();if(this.sourceJSON=t,!this.portalItem.title)throw new _("web-agent:missing-title","The portal item is missing a title")}if(!this.sourceJSON)throw new _("web-agent:missing-source-json","The source JSON is missing");if(!this.sourceJSON.description)throw new _("web-agent:missing-description","The source JSON is missing a description");let e=x.fromJSON(this.sourceJSON);return await e.load(),this._runtime=e,this.description=this.sourceJSON.description,this.name=this.portalItem?.title??`web-agent-${Date.now()}`,this.generate(),this}getSchemas(){return this._runtime?.getSchemas()??[]}generate(){if(!this._runtime){this._set("workspace",ne([])),this._set("createGraph",De);return}let{createGraph:e,workspace:t}=this._runtime.generate();this._set("workspace",t),this._set("createGraph",e)}};R([a({type:Q})],f.prototype,"portalItem",2);R([a()],f.prototype,"sourceJSON",2);f=R([h("WebAgent")],f);var P=class extends D{static{this.properties={agent:0,context:0,itemId:1,workflow:0}}#e;async getContext(){return L(this.context)?await this.context():this.context}async load(){let t;if(this.itemId){let r=ie.getDefault();t=new f({portalItem:new Q({id:this.itemId,portal:r})})}else this.workflow&&(t=new f({sourceJSON:this.workflow}));if(t&&(await t.load(),this.agent=t.registration),!this.agent)throw new Error("Failed to initialize the assistant agent because the agent registration is missing.");this.#e=M(this)}disconnectedCallback(){this.#e?.unregister(this.agent.id),super.disconnectedCallback()}};q("arcgis-assistant-agent",P);return P},"portal/PortalItem","portal/Portal","core/accessorSupport/decorators","core/Error","core/Accessor","identity/IdentityManager","request","config","core/reactiveUtils","layers/FeatureLayer",a,b,d)
2
+ import{b as L,c as M}from"./V6HOUZPZ.js";import{a as B}from"./4PKMJMND.js";import"./3UEKINYC.js";import"./RLEHNAIA.js";import d from"./Y27GVWWU.js";import"./P4XZMBU5.js";import b from"./LUYP76B7.js";import{a as V,b as F,e as H}from"./CLRFKSAT.js";import a from"./64IWQ7A4.js";import{e as $}from"./FS7GXTTQ.js";import{v as D,z as q}from"./COH3QXWG.js";import"./R74ZHFA6.js";import{c as U}from"./UCTC4JN4.js";import"./V7Y22FRP.js";import"./QRMRID2M.js";import"./AXTQU5YL.js";import{J as W,_ as E,ka as J}from"./LOQ2PKV5.js";import"./IYLFJCJ2.js";import"./VXFQANGJ.js";import{Dd as c}from"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([Q,ie,{property:a,subclass:h},_,C,,,,,,,G,z])=>{var ae=Object.defineProperty,ce=Object.getOwnPropertyDescriptor,y=(e,t,r,s)=>{for(var o=s>1?void 0:s?ce(t,r):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(o=(s?i(t,r,o):i(o))||o);return s&&o&&ae(t,r,o),o},p=class extends C{constructor(e){super(e)}static fromJSON(e){return new p({id:e.id,sourceAnchorId:e.source_anchor_id,sourceNodeId:e.source_node_id,targetAnchorId:e.target_anchor_id,targetNodeId:e.target_node_id})}};y([a()],p.prototype,"id",2);y([a()],p.prototype,"sourceAnchorId",2);y([a()],p.prototype,"sourceNodeId",2);y([a()],p.prototype,"targetAnchorId",2);y([a()],p.prototype,"targetNodeId",2);p=y([h("Edge")],p);var pe=Object.defineProperty,de=Object.getOwnPropertyDescriptor,I=(e,t,r,s)=>{for(var o=s>1?void 0:s?de(t,r):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(o=(s?i(t,r,o):i(o))||o);return s&&o&&pe(t,r,o),o},d=class extends C{constructor(e){super(e)}async load(){return await Promise.resolve(this)}compile(e){return{runtimeNode:this.createRuntimeNode(),edges:e.outgoingEdges.map(t=>({from:this.id,to:t.targetNodeId}))}}static fromJSON(e){throw new Error("BaseNode is abstract and cannot be instantiated directly.")}};I([a()],d.prototype,"id",2);I([a()],d.prototype,"label",2);I([a()],d.prototype,"type",2);d=I([h("BaseNode")],d);function X(e){let t=new Set(e.required),r=Object.fromEntries(Object.entries(e.properties).map(([s,o])=>{let n=Y(o);return[s,t.has(s)?n:n.optional()]}));return c.object(r)}function Y(e){let t;switch(e.type){case"array":t=c.array(e.items?Y(e.items):c.unknown());break;case"boolean":t=c.boolean();break;case"number":t=c.number();break;case"object":t=X({properties:e.properties??{},required:e.required});break;case"string":t=e.enum?.length?c.enum(e.enum):c.string();break}return e.description?t.describe(e.description):t}var ue=Object.defineProperty,me=Object.getOwnPropertyDescriptor,j=(e,t,r,s)=>{for(var o=s>1?void 0:s?me(t,r):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(o=(s?i(t,r,o):i(o))||o);return s&&o&&ue(t,r,o),o},he=e=>e.replace(/_([a-z])/gu,(t,r)=>r.toUpperCase()),l=class extends C{constructor(e){super(e),this.type="arcgis-tool"}async createRuntimeTools(){if(!this.name)throw new Error("ArcgisTool name is required");return[await B(he(this.name))]}static fromJSON(e){return new l({name:e.name,requireApproval:e.require_approval})}};j([a()],l.prototype,"name",2);j([a()],l.prototype,"requireApproval",2);j([a()],l.prototype,"type",2);l=j([h("ArcgisTool")],l);var le=Object.defineProperty,ge=Object.getOwnPropertyDescriptor,Z=e=>{throw TypeError(e)},w=(e,t,r,s)=>{for(var o=s>1?void 0:s?ge(t,r):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(o=(s?i(t,r,o):i(o))||o);return s&&o&&le(t,r,o),o},fe=(e,t,r)=>t.has(e)||Z("Cannot "+r),ye=(e,t,r)=>t.has(e)?Z("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),we=(e,t,r)=>(fe(e,t,"access private method"),r),k,ee,u=class extends d{constructor(e){super(e),ye(this,k),this.type="agent-node"}createRuntimeNode(){let e;return async(t,r)=>{e??=we(this,k,ee).call(this);let s=await(await e).run(t,r),o=this.outputSchema?.safeParse(s);if(o&&!o.success)throw o.error;let n=o?.data,i=n??s.outputMessage;return{agentExecutionContext:s.agentExecutionContext,...n?{}:{outputMessage:s.outputMessage},status:s.status,summary:s.summary,nodes:{[this.id]:{output:i}}}}}compile(e){let t=e.outgoingEdges[0]?.targetNodeId;return{runtimeNode:this.createRuntimeNode(),edges:[{from:this.id,decide:r=>r.status==="failed"?void 0:t}],schemas:[c.object({output:this.outputSchema??c.string()})]}}static fromJSON(e){let t=new u({id:e.id,label:e.label,prompt:e.prompt?.content,type:"agent-node",modelTier:e.llm_model?.model_tier});return e.structured_output&&(t.outputSchema=X(e.structured_output)),t.tools=e.tools?.filter(r=>r.type==="arcgis_tool").map(r=>l.fromJSON(r)),t}};k=new WeakSet;ee=async function(){let e=this.prompt;if(!e?.trim())throw new Error(`WebAgent agent node "${this.id}" requires a prompt.`);let t=[];if(this.tools)for(let r of this.tools){let s=await r.createRuntimeTools();t.push(...s)}return new z({name:this.id,outputSchema:this.outputSchema,modelTier:this.modelTier,prompt:e,tools:t})};w([a()],u.prototype,"type",2);w([a()],u.prototype,"prompt",2);w([a()],u.prototype,"outputSchema",2);w([a()],u.prototype,"tools",2);w([a()],u.prototype,"modelTier",2);u=w([h("AgentNode")],u);var be=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,T=(e,t,r,s)=>{for(var o=s>1?void 0:s?Ne(t,r):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(o=(s?i(t,r,o):i(o))||o);return s&&o&&be(t,r,o),o},g=class extends d{constructor(e){super(e),this.type="end-message-node"}createRuntimeNode(){return async e=>{let t=await E.fromTemplate(this.message,{templateFormat:"mustache"}).format(e);return{outputMessage:t,status:"success",summary:t}}}compile(e){return{runtimeNode:this.createRuntimeNode(),edges:[]}}static fromJSON(e){let t=new g({id:e.id,label:e.label,type:"end-message-node"});return t.message=e.message,t}};T([a()],g.prototype,"type",2);T([a()],g.prototype,"message",2);g=T([h("EndMessageNode")],g);var Oe=Object.defineProperty,Se=Object.getOwnPropertyDescriptor,te=e=>{throw TypeError(e)},O=(e,t,r,s)=>{for(var o=s>1?void 0:s?Se(t,r):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(o=(s?i(t,r,o):i(o))||o);return s&&o&&Oe(t,r,o),o},_e=(e,t,r)=>t.has(e)||te("Cannot "+r),ve=(e,t,r)=>t.has(e)?te("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),K=(e,t,r)=>(_e(e,t,"access private method"),r),v,re,oe,m=class extends d{constructor(e){super(e),ve(this,v),this.type="human-in-the-loop-node",this.conditions=[]}createRuntimeNode(){return async(e,t)=>{let r=Ie(t,this.id),s=`${r}:${this.id}`,o=U(t);if(o===void 0||!Ae(o,this.response?.type))throw new W({agentId:r,id:s,kind:je(this.response?.type),message:await K(this,v,re).call(this,e),metadata:K(this,v,oe).call(this,e)});return{nodes:{[this.id]:{output:o}}}}}compile(e){return{runtimeNode:this.createRuntimeNode(),edges:[{from:this.id,decide:t=>{if(!this.conditions.length)return e.outgoingEdges[0]?.targetNodeId;let r=t.nodes?.[this.id]?.output,s=this.conditions.find(o=>Ee(o.optionValue,r));if(s)return e.outgoingEdges.find(o=>o.sourceAnchorId===s.sourceAnchorId)?.targetNodeId}}]}}static fromJSON(e){let t=new m({id:e.id,label:e.label,type:"human-in-the-loop-node"});return t.message=e.message,t.response=e.response,t.conditions=(e.conditions??[]).map(({optionValue:r,source_anchor_id:s})=>({optionValue:r,sourceAnchorId:s})),t}};v=new WeakSet;re=async function(e){if(this.message?.source==="generated")throw new Error(`Human-in-the-loop node "${this.id}" does not support generated messages yet.`);let t=this.message?.content;if(!t)throw new Error(`Human-in-the-loop node "${this.id}" requires a message content.`);return await E.fromTemplate(t,{templateFormat:"mustache"}).format(e)};oe=function(e){let t=this.response;if(!t||t.type==="confirmation"||t.type==="textInput")return;let r=t.choices;return r?.source==="fixed"?r.items?.map(s=>s.value??s.label??""):r?.source==="reference"?Je(e,r.reference)?.map(String):void 0};O([a()],m.prototype,"type",2);O([a()],m.prototype,"message",2);O([a()],m.prototype,"response",2);O([a()],m.prototype,"conditions",2);m=O([h("HumanInTheLoopNode")],m);function Ie(e,t){let r=e?.configurable?.agentId;return typeof r=="string"&&r?r:t}function je(e){switch(e){case"singleSelect":return"singleSelection";case"multipleSelect":return"multipleSelection";case"textInput":return"textInput";default:return"booleanChoice"}}function Ae(e,t){switch(t){case"confirmation":return typeof e=="boolean";case"singleSelect":return typeof e=="string"||Array.isArray(e)&&e.length===1&&typeof e[0]=="string";case"multipleSelect":return Array.isArray(e)&&e.every(r=>typeof r=="string");case"textInput":return typeof e=="string";default:return!0}}function Ee(e,t){return Array.isArray(t)?t.some(r=>r===e):t===e}function Je(e,t){if(!t)return;let r=t.split(".").reduce((s,o)=>{if(s&&typeof s=="object"&&o in s)return s[o]},e);return Array.isArray(r)?r:typeof r=="string"?[r]:void 0}var ke=Object.defineProperty,xe=Object.getOwnPropertyDescriptor,se=(e,t,r,s)=>{for(var o=s>1?void 0:s?xe(t,r):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(o=(s?i(t,r,o):i(o))||o);return s&&o&&ke(t,r,o),o},N=class extends d{constructor(e){super(e),this.type="start-node"}createRuntimeNode(){return e=>({question:e.agentExecutionContext.userRequest})}static fromJSON(e){return new N({id:e.id,label:e.label,type:"start-node"})}};se([a()],N.prototype,"type",2);N=se([h("StartNode")],N);function Pe(e){switch(e.type){case"agent_node":return u.fromJSON(e);case"end_message_node":return g.fromJSON(e);case"human_in_the_loop_node":return m.fromJSON(e);case"start_node":return N.fromJSON(e);default:throw new Error(`WebAgent node "${e.id}" uses unsupported type "${e.type}".`)}}function Ce(e={}){let t=Object.keys(e);if(V(t),t.includes("nodes"))throw new Error("node state cannot define reserved field: nodes.");let r=F(e);return J.Root({...r,nodes:J({reducer:(s,o)=>({...s,...o}),default:()=>({})}),...$()})}function ne(e,t={}){let r=new Set;for(let o of e)for(let n of Object.keys(o.shape??{}))n!=="nodes"&&r.add(n);let s=Object.fromEntries([...r].map(o=>[o,t[o]]));for(let[o,n]of Object.entries(t))s[o]=n;return Ce(s)}var x=class e{constructor(t,r,s){this.sourceJSON=t,this.edges=r,this.nodes=s,this._loaded=!1}static fromJSON(t){return new e(t,t.graph.edges.map(r=>p.fromJSON(r)),t.graph.nodes.map(r=>Pe(r)))}async load(){return this._loadPromise??=Promise.all(this.nodes.map(async t=>await t.load())).then(()=>{this._loaded=!0}),await this._loadPromise,this}getSchemas(){let t=Object.fromEntries(this._getNodeCompilations().flatMap((r,s)=>{let o=this.nodes[s];return r.schemas?.map(n=>[o.id,n])??[]}));return[c.object({loopCounts:c.record(c.string(),c.number()).optional(),nodes:c.object(t).partial().optional(),question:c.string().optional(),variables:this._getVariablesSchema()})]}generate(){this._assertLoaded(),this._nodeCompilations=void 0;let t=this._getNodeCompilations(),r=Object.fromEntries(this.sourceJSON.variables.map(({key:b,value:A})=>[b,A])),s=ne(this.getSchemas(),{variables:r}),o=this.nodes.find(b=>b.type==="start-node")?.id,n={},i=[];for(let[b,A]of this.nodes.entries()){let S=t[b];S&&(S.runtimeNode&&(n[A.id]=S.runtimeNode),i.push(...S.edges))}return{createGraph:()=>H(n,i,s,{entryNode:o}),workspace:s}}_assertLoaded(){if(!this._loaded)throw new Error("AgenticWorkflowRuntime must be loaded before it can generate a graph.")}_getNodeCompilations(){return this._assertLoaded(),this._nodeCompilations??=this.nodes.map(t=>t.compile({outgoingEdges:this.edges.filter(r=>r.sourceNodeId===t.id)}))}_getVariablesSchema(){return c.object(Object.fromEntries(this.sourceJSON.variables.map(({key:t})=>[t,c.unknown()])))}},Te=Object.defineProperty,Re=Object.getOwnPropertyDescriptor,R=(e,t,r,s)=>{for(var o=s>1?void 0:s?Re(t,r):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(o=(s?i(t,r,o):i(o))||o);return s&&o&&Te(t,r,o),o},De=()=>{throw new Error("WebAgent must be loaded before it can run.")},f=class extends G{constructor(e){super(e)}async load(){if(this.portalItem){try{await this.portalItem.load()}catch(r){throw new _("web-agent:load-portal-item","Failed to load portal item",{error:r})}let t=await this.portalItem.fetchData();if(this.sourceJSON=t,!this.portalItem.title)throw new _("web-agent:missing-title","The portal item is missing a title")}if(!this.sourceJSON)throw new _("web-agent:missing-source-json","The source JSON is missing");if(!this.sourceJSON.description)throw new _("web-agent:missing-description","The source JSON is missing a description");let e=x.fromJSON(this.sourceJSON);return await e.load(),this._runtime=e,this.description=this.sourceJSON.description,this.name=this.portalItem?.title??`web-agent-${Date.now()}`,this.generate(),this}getSchemas(){return this._runtime?.getSchemas()??[]}generate(){if(!this._runtime){this._set("workspace",ne([])),this._set("createGraph",De);return}let{createGraph:e,workspace:t}=this._runtime.generate();this._set("workspace",t),this._set("createGraph",e)}};R([a({type:Q})],f.prototype,"portalItem",2);R([a()],f.prototype,"sourceJSON",2);f=R([h("WebAgent")],f);var P=class extends D{static{this.properties={agent:0,context:0,itemId:1,workflow:0}}#e;async getContext(){return L(this.context)?await this.context():this.context}async load(){let t;if(this.itemId){let r=ie.getDefault();t=new f({portalItem:new Q({id:this.itemId,portal:r})})}else this.workflow&&(t=new f({sourceJSON:this.workflow}));if(t&&(await t.load(),this.agent=t.registration),!this.agent)throw new Error("Failed to initialize the assistant agent because the agent registration is missing.");this.#e=M(this)}disconnectedCallback(){this.#e?.unregister(this.agent.id),super.disconnectedCallback()}};q("arcgis-assistant-agent",P);return P},"portal/PortalItem","portal/Portal","core/accessorSupport/decorators","core/Error","core/Accessor","identity/IdentityManager","request","config","core/reactiveUtils","layers/FeatureLayer",a,b,d)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import a from"./XOULSLM7.js";export default $arcgis.t(([{a:e}])=>{var t=[async()=>(await import("./EJ7QJLUE.js")).default,async()=>(await import("./IMRIVNHX.js")).default],s=e({id:"dataExploration",name:"Data Exploration Agent",description:"Explores feature-layer data and applies data-driven map filters using on-demand query and filter skills.",skillLoaders:t,modelTier:"default",systemPrompt:"You are an ArcGIS data exploration agent.",instructions:"Answer only questions about the current map's layers, features, fields, spatial relationships, or supported map actions, using returned tool results. Do not answer unrelated general-knowledge, advice, opinion, political, health, security, or other non-map requests, even when the user asks for this agent. For an unsupported request, respond only: 'I can help with questions about the data and features in this map.' Report directly relevant findings, requested calculations, and limitations that affect the answer. Do not provide unsolicited advice about dataset design, publishing, classification, grouping, future analysis, or alternative questions. Ask a clarifying question only when a map-related request cannot be answered reliably as written. A request can require both query and filter skills. Treat show, display, highlight, map, filter, reveal, emphasize, include, or exclude as visual map intent when the request targets matching features. For visual map intent, do not stop after query. First use query to identify/count the matching features, then load the filter skill and call setFeatureEffect with the same layer, where clause, geometry filter, extent setting, or object IDs. Use only tool results to describe data or map changes.",fallbackMessage:"Data exploration request completed.",failureMessage:"I couldn't complete the data exploration request."});return s},a)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import a from"./EVMIYZWD.js";import{e as l}from"./JQYLMTDP.js";import"./FS7GXTTQ.js";import"./LOQ2PKV5.js";import"./IYLFJCJ2.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([{property:g,subclass:u},{d:w}])=>{var f=Object.defineProperty,m=Object.getOwnPropertyDescriptor,c=(o,r,n,s)=>{for(var e=s>1?void 0:s?m(r,n):r,a=o.length-1,t;a>=0;a--)(t=o[a])&&(e=(s?t(r,n,e):t(e))||e);return s&&e&&f(r,n,e),e},p=class extends w{constructor(o){super(o)}getAgents(){return this.workflow.getAgents()}generate(){let o=this.workflow.generate(),r=o.workspace,n=o.createGraph().compile(),{decideContinue:s}=this,e={[i]:async(t,d)=>await n.invoke(t,d)},a=[{from:i,decide:async(t,d)=>await Promise.resolve(s(t,d))?i:void 0}];return{workspace:r,createGraph:()=>l(e,a,r,{entryNode:i})}}buildEdges(){throw new Error("LoopWorkflow overrides generate(); buildEdges should not be called.")}getEntryNode(){return i}isTerminalAgent(){return!0}};c([g()],p.prototype,"workflow",2);c([g()],p.prototype,"decideContinue",2);p=c([u("LoopWorkflow")],p);var i="__loop_body";return p},"core/accessorSupport/decorators",a)
2
+ import a from"./H4BVWDNV.js";import{e as l}from"./CLRFKSAT.js";import"./FS7GXTTQ.js";import"./LOQ2PKV5.js";import"./IYLFJCJ2.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([{property:g,subclass:u},{d:w}])=>{var f=Object.defineProperty,m=Object.getOwnPropertyDescriptor,c=(o,r,n,s)=>{for(var e=s>1?void 0:s?m(r,n):r,a=o.length-1,t;a>=0;a--)(t=o[a])&&(e=(s?t(r,n,e):t(e))||e);return s&&e&&f(r,n,e),e},p=class extends w{constructor(o){super(o)}getAgents(){return this.workflow.getAgents()}generate(){let o=this.workflow.generate(),r=o.workspace,n=o.createGraph().compile(),{decideContinue:s}=this,e={[i]:async(t,d)=>await n.invoke(t,d)},a=[{from:i,decide:async(t,d)=>await Promise.resolve(s(t,d))?i:void 0}];return{workspace:r,createGraph:()=>l(e,a,r,{entryNode:i})}}buildEdges(){throw new Error("LoopWorkflow overrides generate(); buildEdges should not be called.")}getEntryNode(){return i}isTerminalAgent(){return!0}};c([g()],p.prototype,"workflow",2);c([g()],p.prototype,"decideContinue",2);p=c([u("LoopWorkflow")],p);var i="__loop_body";return p},"core/accessorSupport/decorators",a)