@arcgis/ai-components 5.2.0-next.8 → 5.2.0-next.85

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 (313) hide show
  1. package/LICENSE.md +4 -2
  2. package/README.md +2 -2
  3. package/dist/agent-utils/FunctionAgent.d.ts +2 -2
  4. package/dist/agent-utils/LLMAgent.d.ts +7 -4
  5. package/dist/agent-utils/LLMAgent.js +3 -2
  6. package/dist/agent-utils/WorkflowAgent.d.ts +2 -2
  7. package/dist/agent-utils/index.d.ts +177 -0
  8. package/dist/agent-utils/index.js +167 -0
  9. package/dist/agent-utils/middlewares/trace.d.ts +2 -0
  10. package/dist/agent-utils/middlewares/trace.js +25 -33
  11. package/dist/agent-utils/tools/FunctionTool.d.ts +2 -2
  12. package/dist/agent-utils/types.d.ts +37 -8
  13. package/dist/agent-utils/workflows/ConditionalWorkflow.d.ts +2 -2
  14. package/dist/agent-utils/workflows/LoopWorkflow.d.ts +2 -2
  15. package/dist/agent-utils/workflows/ParallelWorkflow.d.ts +2 -2
  16. package/dist/agent-utils/workflows/RouterWorkflow.d.ts +2 -2
  17. package/dist/agent-utils/workflows/SequentialWorkflow.d.ts +2 -2
  18. package/dist/agent-utils/workflows/SwitchWorkflow.d.ts +2 -2
  19. package/dist/agentic-workflow/AgenticWorkflowRuntime.d.ts +24 -0
  20. package/dist/agentic-workflow/Edge.d.ts +16 -0
  21. package/dist/agentic-workflow/WebAgent.d.ts +39 -0
  22. package/dist/agentic-workflow/jsonTypes.d.ts +183 -0
  23. package/dist/agentic-workflow/nodes/AgentNode.d.ts +27 -0
  24. package/dist/agentic-workflow/nodes/BaseNode.d.ts +35 -0
  25. package/dist/agentic-workflow/nodes/EndMessageNode.d.ts +25 -0
  26. package/dist/agentic-workflow/nodes/StartNode.d.ts +21 -0
  27. package/dist/agentic-workflow/nodes/tools/ArcgisTool.d.ts +21 -0
  28. package/dist/agentic-workflow/types.d.ts +29 -0
  29. package/dist/agents/tools/filter/clearFilters/adapter.d.ts +8 -0
  30. package/dist/agents/tools/filter/clearFilters/adapter.js +22 -0
  31. package/dist/agents/tools/filter/resetMap/adapter.d.ts +8 -0
  32. package/dist/agents/tools/filter/resetMap/adapter.js +22 -0
  33. package/dist/agents/tools/filter/setFeatureEffect/adapter.d.ts +8 -0
  34. package/dist/agents/tools/filter/setFeatureEffect/adapter.js +109 -0
  35. package/dist/agents/tools/help/listFields/adapter.d.ts +11 -0
  36. package/dist/agents/tools/help/listFields/adapter.js +30 -0
  37. package/dist/agents/tools/navigation/goToAddress/adapter.d.ts +10 -0
  38. package/dist/agents/tools/navigation/goToAddress/adapter.js +52 -0
  39. package/dist/agents/tools/navigation/goToBookmark/adapter.d.ts +8 -0
  40. package/dist/agents/tools/navigation/goToBookmark/adapter.js +30 -0
  41. package/dist/agents/tools/navigation/goToFeatures/adapter.d.ts +8 -0
  42. package/dist/agents/tools/navigation/goToFeatures/adapter.js +50 -0
  43. package/dist/agents/tools/navigation/goToFullExtent/adapter.d.ts +8 -0
  44. package/dist/agents/tools/navigation/goToFullExtent/adapter.js +27 -0
  45. package/dist/agents/tools/navigation/goToHomeExtent/adapter.d.ts +8 -0
  46. package/dist/agents/tools/navigation/goToHomeExtent/adapter.js +24 -0
  47. package/dist/agents/tools/navigation/goToLayer/adapter.d.ts +8 -0
  48. package/dist/agents/tools/navigation/goToLayer/adapter.js +26 -0
  49. package/dist/agents/tools/navigation/goToScale/adapter.d.ts +8 -0
  50. package/dist/agents/tools/navigation/goToScale/adapter.js +21 -0
  51. package/dist/agents/tools/navigation/goToViewpoint/adapter.d.ts +8 -0
  52. package/dist/agents/tools/navigation/goToViewpoint/adapter.js +42 -0
  53. package/dist/agents/tools/navigation/goToZoom/adapter.d.ts +8 -0
  54. package/dist/agents/tools/navigation/goToZoom/adapter.js +21 -0
  55. package/dist/agents/tools/query/getAttribute/adapter.d.ts +8 -0
  56. package/dist/agents/tools/query/getAttribute/adapter.js +40 -0
  57. package/dist/agents/tools/query/getStatistics/adapter.d.ts +8 -0
  58. package/dist/agents/tools/query/getStatistics/adapter.js +154 -0
  59. package/dist/agents/tools/query/getTopFeatures/adapter.d.ts +8 -0
  60. package/dist/agents/tools/query/getTopFeatures/adapter.js +141 -0
  61. package/dist/agents/tools/query/queryFeatures/adapter.d.ts +8 -0
  62. package/dist/agents/tools/query/queryFeatures/adapter.js +127 -0
  63. package/dist/agents/tools/search/findRelevantFields/adapter.d.ts +8 -0
  64. package/dist/agents/tools/search/findRelevantFields/adapter.js +57 -0
  65. package/dist/agents/tools/search/findRelevantLayers/adapter.d.ts +8 -0
  66. package/dist/agents/tools/search/findRelevantLayers/adapter.js +38 -0
  67. package/dist/cdn/2EY3BQQX.js +2 -0
  68. package/dist/cdn/34O57OGV.js +2 -0
  69. package/dist/cdn/3POGAH2X.js +2 -0
  70. package/dist/cdn/3SEKXQVK.js +9 -0
  71. package/dist/cdn/{AMP6IALT.js → 3UEKINYC.js} +1 -1
  72. package/dist/cdn/434TAA3J.js +2 -0
  73. package/dist/cdn/4HDDRBIY.js +2 -0
  74. package/dist/cdn/4NJ2FF7H.js +2 -0
  75. package/dist/cdn/4OGR5QKS.js +2 -0
  76. package/dist/cdn/4QGVOLW6.js +22 -0
  77. package/dist/cdn/4WIDLQUH.js +2 -0
  78. package/dist/cdn/5WYRJMBW.js +2 -0
  79. package/dist/cdn/5X7EG7D2.js +2 -0
  80. package/dist/cdn/5ZFUGNRN.js +2 -0
  81. package/dist/cdn/6HF36IKA.js +2 -0
  82. package/dist/cdn/6KFMRBAA.js +2 -0
  83. package/dist/cdn/6NHYXISD.js +2 -0
  84. package/dist/cdn/6U4GTCLJ.js +66 -0
  85. package/dist/cdn/7BCQMK6D.js +2 -0
  86. package/dist/cdn/7GMCLVSZ.js +2 -0
  87. package/dist/cdn/7M6VKBTK.js +6 -0
  88. package/dist/cdn/{GGSZM7KV.js → 7Q5EESAR.js} +6 -4
  89. package/dist/cdn/7SRLZQVC.js +5 -0
  90. package/dist/cdn/7TXR75RG.js +2 -0
  91. package/dist/cdn/7V6OSTFC.js +2 -0
  92. package/dist/cdn/7VAQUCBU.js +9 -0
  93. package/dist/cdn/7ZFAFKJT.js +2 -0
  94. package/dist/cdn/ACJTJLZN.js +2 -0
  95. package/dist/cdn/AI6DYOKR.js +181 -0
  96. package/dist/cdn/{ZS2TZ6BF.js → AOVJ34QE.js} +1 -1
  97. package/dist/cdn/APFZY4PI.js +2 -0
  98. package/dist/cdn/AT4XVTJR.js +44 -0
  99. package/dist/cdn/AZ5G7YZH.js +3 -0
  100. package/dist/cdn/{FL4W4VYN.js → BL273EGZ.js} +17 -1
  101. package/dist/cdn/BM3WFHJG.js +2 -0
  102. package/dist/cdn/{DHOVCT6R.js → BPCBE7J6.js} +1 -1
  103. package/dist/cdn/CCC6LBMY.js +2 -0
  104. package/dist/cdn/{5ZZGKP7N.js → CEKOEHB3.js} +1 -1
  105. package/dist/cdn/CJMUJXPL.js +2 -0
  106. package/dist/cdn/CP5BVGJU.js +2 -0
  107. package/dist/cdn/CZM4URK7.js +2 -0
  108. package/dist/cdn/DPALM2OW.js +2 -0
  109. package/dist/cdn/E7JZ7GUW.js +18 -0
  110. package/dist/cdn/EMLOVMD4.js +2 -0
  111. package/dist/cdn/EWLXNGKH.js +208 -0
  112. package/dist/cdn/F2J6BMMX.js +36 -0
  113. package/dist/cdn/FAR3DFFK.js +2 -0
  114. package/dist/cdn/FDOMMK2M.js +2 -0
  115. package/dist/cdn/{ZLXN7NMF.js → FYZATVB3.js} +10 -8
  116. package/dist/cdn/GFEOVHJK.js +2 -0
  117. package/dist/cdn/HDM2D2GD.js +2 -0
  118. package/dist/cdn/HHFNQR6Z.js +2 -0
  119. package/dist/cdn/HMUWQCXU.js +2 -0
  120. package/dist/cdn/I3ONG4AX.js +2 -0
  121. package/dist/cdn/IBZ2NEAO.js +2 -0
  122. package/dist/cdn/{FX7UOGHP.js → ICBIUFK7.js} +1 -1
  123. package/dist/cdn/IFJM5XEQ.js +2 -0
  124. package/dist/cdn/IHP25JWI.js +99 -0
  125. package/dist/cdn/J6A4AS7E.js +22 -0
  126. package/dist/cdn/J6SZIQJA.js +2 -0
  127. package/dist/cdn/{NE7E52YR.js → JEBRN3EU.js} +9 -3
  128. package/dist/cdn/JKIESH74.js +2 -0
  129. package/dist/cdn/JO5ETMPS.js +2 -0
  130. package/dist/cdn/JWIE3YK3.js +2 -0
  131. package/dist/cdn/K2R6XVK3.js +2 -0
  132. package/dist/cdn/KITIP6J2.js +2 -0
  133. package/dist/cdn/KPO4XX6J.js +2 -0
  134. package/dist/cdn/KWD2ECTM.js +2 -0
  135. package/dist/cdn/L7XTRDFM.js +3 -0
  136. package/dist/cdn/{7RCQFLPP.js → LK7ZIQW6.js} +1 -1
  137. package/dist/cdn/LLUGJKAQ.js +2 -0
  138. package/dist/cdn/LMPNXXTQ.js +2 -0
  139. package/dist/cdn/LYKCYBGB.js +2 -0
  140. package/dist/cdn/{3PKJWIC3.js → M2L5R4LA.js} +1 -1
  141. package/dist/cdn/{V2P4AIGG.js → M4URMXDS.js} +1 -1
  142. package/dist/cdn/MDAKBX7N.js +2 -0
  143. package/dist/cdn/MWYBF3F3.js +66 -0
  144. package/dist/cdn/NEV6OZN3.js +71 -0
  145. package/dist/cdn/NQDOAPE3.js +2 -0
  146. package/dist/cdn/OAKRPM7D.js +2 -0
  147. package/dist/cdn/{23EQTPO3.js → OKVLGJAG.js} +1 -1
  148. package/dist/cdn/ONMNQBPO.js +2 -0
  149. package/dist/cdn/ONQ6JSBJ.js +2 -0
  150. package/dist/cdn/OWTGH34K.js +2 -0
  151. package/dist/cdn/{LQ6R5YRN.js → PQ2DPOFM.js} +1 -1
  152. package/dist/cdn/PSYRZMX2.js +2 -0
  153. package/dist/cdn/PUHRBGKB.js +2 -0
  154. package/dist/cdn/Q57QWN5W.js +2 -0
  155. package/dist/cdn/QNNGPA3Q.js +2 -0
  156. package/dist/cdn/R74ZHFA6.js +2 -0
  157. package/dist/cdn/RBE55SWR.js +2 -0
  158. package/dist/cdn/RHYNE5OE.js +2 -0
  159. package/dist/cdn/RLEHNAIA.js +2 -0
  160. package/dist/cdn/RV55GABG.js +2 -0
  161. package/dist/cdn/RWWOOC7S.js +2 -0
  162. package/dist/cdn/{X2ZDYHCG.js → SDWWUWAF.js} +10 -5
  163. package/dist/cdn/T4RIGOXB.js +2 -0
  164. package/dist/cdn/TACBKKBI.js +2 -0
  165. package/dist/cdn/TMJMDCSA.js +4 -0
  166. package/dist/cdn/TPULIO6I.js +34 -0
  167. package/dist/cdn/U2D53TAX.js +14 -0
  168. package/dist/cdn/UEEH5ZQK.js +156 -0
  169. package/dist/cdn/{6YMR4QSD.js → UHEYPSOR.js} +1 -1
  170. package/dist/cdn/UHZG7SKO.js +2 -0
  171. package/dist/cdn/UZLQALHY.js +2 -0
  172. package/dist/cdn/V52XWEGV.js +11 -0
  173. package/dist/cdn/V6HOUZPZ.js +2 -0
  174. package/dist/cdn/VAXH6RUQ.js +134 -0
  175. package/dist/cdn/VLLZ2FFU.js +2 -0
  176. package/dist/cdn/VNJMTA6O.js +2 -0
  177. package/dist/cdn/VOKXKU7M.js +56 -0
  178. package/dist/cdn/VXFQANGJ.js +2 -0
  179. package/dist/cdn/W5G35GO4.js +2 -0
  180. package/dist/cdn/WKTQVBFJ.js +2 -0
  181. package/dist/cdn/WLH47YFC.js +14 -0
  182. package/dist/cdn/WP7ORLSB.js +6 -0
  183. package/dist/cdn/Y7XD7ZRD.js +2 -0
  184. package/dist/cdn/YEZ3AMNX.js +2 -0
  185. package/dist/cdn/YLVJA4ZE.js +2 -0
  186. package/dist/cdn/Z5W4V7RC.js +2 -0
  187. package/dist/cdn/ZLWWWTH4.js +2 -0
  188. package/dist/cdn/ZOEMBHRF.js +2 -0
  189. package/dist/cdn/ZQMBJ6MI.js +2 -0
  190. package/dist/cdn/ZRESBCJL.js +2 -0
  191. package/dist/cdn/{ZTBA5PM7.js → ZU2FHVNK.js} +1 -1
  192. package/dist/cdn/ZUNLFO6M.js +3 -0
  193. package/dist/cdn/agent-utils/index.js +2 -0
  194. package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +3 -0
  195. package/dist/cdn/agent-utils/middlewares/middleware.js +2 -0
  196. package/dist/cdn/agent-utils/middlewares/trace.js +2 -0
  197. package/dist/cdn/assets/assistant/t9n/messages.en.json +1 -1
  198. package/dist/cdn/assets/assistant-interrupt/t9n/messages.en.json +1 -1
  199. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.en.json +1 -0
  200. package/dist/cdn/assets/assistant-message/t9n/messages.en.json +1 -0
  201. package/dist/cdn/assets/assistant-message-loading/t9n/messages.en.json +1 -0
  202. package/dist/cdn/index.js +1 -1
  203. package/dist/chunks/adapter.js +1294 -2112
  204. package/dist/chunks/arcgisKnowledgeGraph.js +127 -72
  205. package/dist/chunks/arcgis_knowledge_current_lc_context.js +19 -2
  206. package/dist/chunks/arcgis_knowledge_current_map_context.js +31 -2
  207. package/dist/chunks/arcgis_knowledge_cypher_query_prompt.js +102 -0
  208. package/dist/chunks/arcgis_knowledge_summarize_result_prompt.js +116 -27
  209. package/dist/chunks/baseAgentState.js +56 -0
  210. package/dist/chunks/converterUtils.js +66 -41
  211. package/dist/chunks/dataExplorationGraph.js +132 -177
  212. package/dist/chunks/data_explore_query_prompt.js +9 -4
  213. package/dist/chunks/fetchAgentContext.js +13 -0
  214. package/dist/chunks/fetchService.js +10 -0
  215. package/dist/chunks/fieldStatistics.js +79 -0
  216. package/dist/chunks/formatFeatureAttributes.js +132 -0
  217. package/dist/chunks/generateLayerDescriptions.js +259 -282
  218. package/dist/chunks/helpGraph.js +34 -25
  219. package/dist/chunks/help_prompt.js +34 -17
  220. package/dist/chunks/index.js +11 -0
  221. package/dist/chunks/intent_prompt.js +16 -0
  222. package/dist/chunks/layerStylingGraph.js +36 -31
  223. package/dist/chunks/mergeWhereClauses.js +15 -0
  224. package/dist/chunks/navigationGraph.js +123 -103
  225. package/dist/chunks/navigation_intent_prompt.js +8 -2
  226. package/dist/chunks/orchestrator.js +205 -175
  227. package/dist/chunks/slottableRequestUtils.js +3 -7
  228. package/dist/chunks/state.js +21 -27
  229. package/dist/chunks/summarize_query_response_prompt.js +9 -7
  230. package/dist/chunks/toolCallResponse.js +13 -10
  231. package/dist/chunks/types.js +59 -0
  232. package/dist/chunks/utils2.js +11 -11
  233. package/dist/components/arcgis-assistant/customElement.d.ts +56 -0
  234. package/dist/components/arcgis-assistant/customElement.js +387 -155
  235. package/dist/components/arcgis-assistant/index.js +2 -3
  236. package/dist/components/arcgis-assistant/types.d.ts +14 -1
  237. package/dist/components/arcgis-assistant-agent/customElement.d.ts +13 -1
  238. package/dist/components/arcgis-assistant-agent/customElement.js +608 -10
  239. package/dist/components/arcgis-assistant-chat/customElement.d.ts +2 -1
  240. package/dist/components/arcgis-assistant-chat/customElement.js +23 -18
  241. package/dist/components/arcgis-assistant-chat-entry/customElement.d.ts +2 -0
  242. package/dist/components/arcgis-assistant-chat-entry/customElement.js +25 -18
  243. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +19 -3
  244. package/dist/components/arcgis-assistant-help-agent/customElement.js +28 -6
  245. package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -0
  246. package/dist/components/arcgis-assistant-interrupt/customElement.js +17 -14
  247. package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +24 -0
  248. package/dist/components/arcgis-assistant-interrupt-preview/index.js +2 -0
  249. package/dist/components/arcgis-assistant-knowledge-agent/customElement.d.ts +7 -7
  250. package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +39 -16
  251. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +29 -6
  252. package/dist/components/arcgis-assistant-message/customElement.d.ts +5 -0
  253. package/dist/components/arcgis-assistant-message/customElement.js +29 -26
  254. package/dist/components/arcgis-assistant-message/index.js +2 -0
  255. package/dist/components/arcgis-assistant-message-block/customElement.js +18 -11
  256. package/dist/components/arcgis-assistant-message-block/index.js +1 -0
  257. package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +7 -0
  258. package/dist/components/arcgis-assistant-message-loading/customElement.js +8 -7
  259. package/dist/components/arcgis-assistant-message-loading/index.js +1 -0
  260. package/dist/components/arcgis-assistant-message-text/customElement.d.ts +1 -0
  261. package/dist/components/arcgis-assistant-message-text/customElement.js +12 -12
  262. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +17 -3
  263. package/dist/components/arcgis-assistant-speech-input/customElement.js +29 -46
  264. package/dist/components/arcgis-assistant-suggested-prompts/customElement.js +8 -8
  265. package/dist/components/arcgis-assistant-user-message/customElement.d.ts +2 -0
  266. package/dist/components/arcgis-assistant-user-message/customElement.js +15 -10
  267. package/dist/docs/api.json +1 -1
  268. package/dist/docs/docs.json +1 -1
  269. package/dist/docs/vscode.html-custom-data.json +1 -1
  270. package/dist/docs/web-types.json +1 -1
  271. package/dist/loader.js +9 -8
  272. package/dist/oauth-callback.html +1 -1
  273. package/dist/types/lumina.d.ts +9 -8
  274. package/dist/types/preact.d.ts +9 -8
  275. package/dist/types/react.d.ts +9 -8
  276. package/dist/types/stencil.d.ts +11 -10
  277. package/dist/utils/index.d.ts +10 -10
  278. package/dist/utils/index.js +56 -55
  279. package/package.json +32 -12
  280. package/dist/cdn/2AXF774U.js +0 -2
  281. package/dist/cdn/462JBSEV.js +0 -422
  282. package/dist/cdn/53ZCUPKK.js +0 -22
  283. package/dist/cdn/5QAHYX7Y.js +0 -5
  284. package/dist/cdn/5XRDJL7R.js +0 -14
  285. package/dist/cdn/7BCR6TUO.js +0 -2
  286. package/dist/cdn/7GH7VSB2.js +0 -2
  287. package/dist/cdn/7PLV4QH6.js +0 -2
  288. package/dist/cdn/AO7BQHKC.js +0 -2
  289. package/dist/cdn/AXDZBBNL.js +0 -45
  290. package/dist/cdn/DDLZOMUY.js +0 -2
  291. package/dist/cdn/EECZLT6C.js +0 -166
  292. package/dist/cdn/ETRWZ3MS.js +0 -108
  293. package/dist/cdn/F2AHA4GB.js +0 -54
  294. package/dist/cdn/FX5JFRDL.js +0 -2
  295. package/dist/cdn/H7422XUG.js +0 -2
  296. package/dist/cdn/HB5A5R2E.js +0 -2
  297. package/dist/cdn/I6HNBTWY.js +0 -2
  298. package/dist/cdn/IG6YKZH3.js +0 -3
  299. package/dist/cdn/KMQ3SP4I.js +0 -5
  300. package/dist/cdn/MH5RPXHM.js +0 -2
  301. package/dist/cdn/NAUXSHIE.js +0 -72
  302. package/dist/cdn/NVI3I46B.js +0 -2
  303. package/dist/cdn/OAVEHGB6.js +0 -2
  304. package/dist/cdn/OH64RMOR.js +0 -4
  305. package/dist/cdn/P26NON3Z.js +0 -16
  306. package/dist/cdn/P6OPJQMC.js +0 -3
  307. package/dist/cdn/QR54T33D.js +0 -2
  308. package/dist/cdn/RVOAPUBN.js +0 -2
  309. package/dist/cdn/S3VPZFWQ.js +0 -36
  310. package/dist/cdn/SXDLXCIM.js +0 -2
  311. package/dist/cdn/USMDJUFS.js +0 -2
  312. package/dist/cdn/Y333DGV6.js +0 -2
  313. package/dist/cdn/YIMNOUTF.js +0 -2
@@ -0,0 +1,156 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import i from"./KWD2ECTM.js";import h from"./U2D53TAX.js";import f from"./OAKRPM7D.js";import e from"./V52XWEGV.js";import c from"./AT4XVTJR.js";import{e as R,f as le}from"./7M6VKBTK.js";import{a as de}from"./5WYRJMBW.js";import{a as ue}from"./YEZ3AMNX.js";import a from"./JKIESH74.js";import{a as b,b as T}from"./7VAQUCBU.js";import{Fa as se,Sa as A,g as ne,j as D,k as P,ka as y,y as ie}from"./EWLXNGKH.js";import{Dc as g,S as $,W as B,fa as N}from"./AI6DYOKR.js";import{a as d}from"./VXFQANGJ.js";export default $arcgis.t(([ve,_,Se,,_e,,{createRenderer:Fe},{getSchemesByTag:Le,getSchemes:Qe},{getBackgroundColorTheme:xe},{createAgeRenderer:Ge,createContinuousRenderer:Ve},{getSchemesByTag:re},{createContinuousRenderer:Be},{createRenderer:Ke},{getSchemesByTag:Ue},{createRenderer:He},{getSchemesByTag:We},{createRenderer:Je},{getSchemesByTag:Ze},{createRenderer:Ye},{getSchemesByTag:Xe},{createAgeRenderer:et,createContinuousRenderer:tt},{createRenderer:rt},{getSchemesByTag:ot},at,ke,,{fetchKnowledgeGraph:Ee,executeQueryStreaming:nt,executeSearchStreaming:it},st,{getBindParametersFromCypherQuery:lt},pe,{o:ce},fe,ye,he,me])=>{var Te=e=>Array.isArray(e)&&e.every($),De=e=>typeof e=="object"&&e!=null&&"messages"in e&&Te(e.messages),Pe=e=>typeof e=="object"&&e!=null&&"lg_tool_call"in e,O=class extends se{tools;handleToolErrors=!0;trace=!1;constructor(e,t){let{name:r,tags:o,handleToolErrors:a}=t??{};super({name:r,tags:o,func:(i,s)=>this.run(i,s)}),this.tools=e,this.handleToolErrors=a??this.handleToolErrors}async runTool(e,t,r){let o=this.tools.find(a=>a.name===e.name);try{if(o===void 0)throw new Error(`Tool "${e.name}" not found.`);let a={...e,type:"tool_call"},i={...t,state:r,toolCallId:e.id??"",config:t,context:t.context,store:t.store??null,writer:t.writer??t.configurable?.writer??null},s=await o.invoke(a,i);return $(s)&&s.getType()==="tool"||P(s)?s:new B({status:"success",name:o.name,content:typeof s=="string"?s:JSON.stringify(s),tool_call_id:e.id})}catch(a){if(!this.handleToolErrors||ie(a))throw a;return new B({status:"error",content:`Error: ${a.message}
3
+ Please fix your mistakes.`,name:e.name,tool_call_id:e.id??""})}}async run(e,t){let r;if(Pe(e)){let{lg_tool_call:i,...s}=e;r=[await this.runTool(i,t,s)]}else{let i;if(Te(e))i=e;else if(De(e))i=e.messages;else throw new Error("ToolNode only accepts BaseMessage[] or { messages: BaseMessage[] } as input.");let s=new Set(i.filter(c=>c.getType()==="tool").map(c=>c.tool_call_id)),n;for(let c=i.length-1;c>=0;c-=1){let l=i[c];if(N(l)){n=l;break}}if(n==null||!N(n))throw new Error("ToolNode only accepts AIMessages as input.");r=await Promise.all(n.tool_calls?.filter(c=>c.id==null||!s.has(c.id)).map(c=>this.runTool(c,t,e))??[])}if(!r.some(P))return Array.isArray(e)?r:{messages:r};let o=[],a=null;for(let i of r)P(i)?i.graph===D.PARENT&&Array.isArray(i.goto)&&i.goto.every(s=>ne(s))?a?a.goto.push(...i.goto):a=new D({graph:D.PARENT,goto:i.goto}):o.push(i):o.push(Array.isArray(e)?[i]:{messages:[i]});return a&&o.push(a),o}};var zo=y.Root({llmInputMessages:y({reducer:(e,t)=>A([],t),default:()=>[]})});var I=(e,t)=>t??e,La=y.Root({...le(),intent:y({reducer:I}),vectorSearchLayerResults:y({reducer:I,default:()=>[]}),vectorSearchFieldResults:y({reducer:I}),navigationInternalState:y({reducer:I,default:()=>({toolCallMessage:void 0})})}),Me=Object.assign({"../agents/arcgisKnowledge/prompts/arcgis_knowledge_current_lc_context.md":()=>import("./J6A4AS7E.js").then(e=>e.default),"../agents/arcgisKnowledge/prompts/arcgis_knowledge_current_map_context.md":()=>import("./TPULIO6I.js").then(e=>e.default),"../agents/arcgisKnowledge/prompts/arcgis_knowledge_cypher_query_prompt.md":()=>import("./IHP25JWI.js").then(e=>e.default),"../agents/arcgisKnowledge/prompts/arcgis_knowledge_lucene_generation_prompt.md":()=>import("./CEKOEHB3.js").then(e=>e.default),"../agents/arcgisKnowledge/prompts/arcgis_knowledge_summarize_result_prompt.md":()=>import("./VAXH6RUQ.js").then(e=>e.default),"../agents/arcgisKnowledge/prompts/arcgis_knowledge_tool_prompt.md":()=>import("./AOVJ34QE.js").then(e=>e.default),"../agents/dataExploration/prompts/data_explore_filter_prompt.md":()=>import("./PQ2DPOFM.js").then(e=>e.default),"../agents/dataExploration/prompts/data_explore_query_prompt.md":()=>import("./SDWWUWAF.js").then(e=>e.default),"../agents/dataExploration/prompts/summarize_query_response_prompt.md":()=>import("./FYZATVB3.js").then(e=>e.default),"../agents/help/prompts/help_prompt.md":()=>import("./NEV6OZN3.js").then(e=>e.default),"../agents/layerStyling/prompts/layer_styling_prompt.md":()=>import("./ICBIUFK7.js").then(e=>e.default),"../agents/navigation/prompts/navigation_intent_prompt.md":()=>import("./JEBRN3EU.js").then(e=>e.default),"../agents/navigation/prompts/navigation_tool_prompt.md":()=>import("./UHEYPSOR.js").then(e=>e.default)});async function L(e){let t=Object.entries(Me).find(([r])=>r.endsWith(`/${e}.md`));if(!t)throw new Error(`Prompt not found: ${e}
4
+ Available prompts:
5
+ ${Object.keys(Me).join(`
6
+ `)}`);return await t[1]()}var ct=(e,t=300)=>{let r=e.replace(/\s+/gu," ").replace(/[*_`#>\-]/gu,"").trim();return r.length>t?`${r.slice(0,t)}...`:r},Qa=(e,t)=>(r,o)=>{let a=o?.configurable?.services;for(let i of e)if(!a?.[i])throw new Error(`${t} requires services.${i} to be available.`);return r},Ga=y.Root({...R(),vectorSearchLayerIds:y(),vectorSearchFieldResults:y(),layerFieldInfo:y(),queryResponse:y(),dataExplorationMessages:y({reducer:A,default:()=>[]})}),dt=[me,he,ye,fe],Va=[pe,ue,de],ut=new O(dt,{handleToolErrors:!1});async function Ba(e,t){let{messages:r}=await ut.invoke({messages:e.dataExplorationMessages},t),o=[],a=[];for(let i of r){let s=i.content,n;typeof s!="string"&&(n={tool:i.name??"unknown",layerName:"unknown",summary:"Query failed",details:{error:"Skipping non-string tool output:",raw:s}});try{typeof s=="string"?n=JSON.parse(s):n={tool:i.name??"unknown",layerName:"unknown",summary:"Query failed",details:{error:"Invalid tool output type",raw:s}}}catch{n={tool:i.name??"unknown",layerName:"unknown",summary:"Query failed",details:{error:s}}}o.push(n),n.details&&typeof n.details=="object"&&"error"in n.details?a.push(`- ${n.tool}: Error - ${String(n.details.error)}`):a.push(`- ${n.layerName}: ${n.summary}`)}return await b({text:`Finished executing layer query tool: ${a.join(", ")}`},t),{...e,dataExplorationMessages:[...e.dataExplorationMessages,...r],queryResponse:o,status:"success",summary:a.length>0?ct(a.join(`
7
+ `)):"Query executed."}}async function pt(e){let{fields:t,layer:r,view:o,styleName:a,colorSchemeTags:i}=e,s;return i?s=Le({basemapTheme:await xe(o),geometryType:r.geometryType,includedTags:i,numColors:Math.min(t.length,8)})[0]:s=Qe({basemapTheme:await xe(o),geometryType:r.geometryType,numColors:Math.min(t.length,8)}).primaryScheme,{layer:r,view:o,attributes:t.map(n=>({field:n,label:r.fields.find(c=>c.name===n)?.alias??""})).slice(0,8),outlineOptimizationEnabled:!0,sizeOptimizationEnabled:!0,includeSizeVariable:a.includes("Size"),pieChartScheme:s}}async function mt(e){return await Fe(e)}async function ht({arcgisMap:e,arcgisMapView:t,layerId:r,fields:o,colorSchemes:a,includeSize:i}){let s=t,n=e?.allLayers.find(l=>l.id===r);if(!n)return`Could not find layer for id: ${r}`;let c={styleName:i?"chart-size":"chart",fields:o,layer:n,view:s,colorSchemeTags:a};try{let l=await pt(c),u=await mt(l);return n.renderer=u.renderer,n.visible=!0,`Chart renderer applied to layer: ${n.title??n.id} using fields ${o.join(", ")}`}catch(l){return`Error applying chart renderer: ${l instanceof Error?l.message:String(l)}`}}var yt=["mapView"];function v(e){let t=e?.configurable?.context;if(!t||typeof t!="object")throw new Error("LayerStylingAgent context missing");let r=yt.filter(o=>!(o in t));if(r.length)throw new Error(`LayerStylingAgent context missing: ${r.join(", ")}`);return t}async function ft({layerId:e,fields:t,colorSchemes:r,includeSize:o},a){let{mapView:i}=v(a);return await T({type:"show-legend",data:{layerIds:[e]}},a),await ht({arcgisMap:i.map,arcgisMapView:i,layerId:e,fields:t,colorSchemes:r,includeSize:o})}var gt=d.object({layerId:d.string().describe("The id of the layer to apply the chart renderer to"),fields:d.array(d.string()).describe("The fields to use for the chart renderer (multiple numeric fields)"),colorSchemes:d.array(d.string()).optional().describe("Optional color scheme tags to use"),includeSize:d.boolean().optional().describe("Whether to vary the chart size (chart-size)")}),Ka=g(ft,{name:"chart",description:`Label: Charts
8
+ Description: Show the values of two or more categories as a proportion of the total using a pie chart.
9
+ Keywords: pie, chart, all categories, breakdown, proportion
10
+ Example: Show the total number of homes built in each decade using a pie chart for each feature.
11
+ Fields: This style requires 2-8 number fields.
12
+
13
+ Label: Charts and Size
14
+ Description: Show the values of two or more categories as a proportion of the total using a pie chart and use size to capture the total amount or magnitude.
15
+ Keywords: pie, chart, all categories, breakdown, proportion, total, amount, how much, sum, graduated size, proportional size
16
+ Example: Show the total number of homes built in each decade using a pie chart for each feature and vary the size of each chart based on the total of all categories.
17
+ Fields: This style requires 2-8 number fields.`,schema:gt});function wt(e){let{fields:t,layer:r,view:o,theme:a,colorSchemeTags:i}=e,s=t[0],n;return i&&(n=re({geometryType:r.geometryType,includedTags:i,theme:a||"high-to-low"})[0]),{layer:r,view:o,startTime:s,endTime:new Date,theme:a,sizeOptimizationEnabled:!0,outlineOptimizationEnabled:!0,colorScheme:n}}async function bt(e){return await Ge(e)}async function Tt({arcgisMap:e,arcgisMapView:t,layerId:r,fields:o,colorSchemes:a,theme:i}){let s=t,n=e?.allLayers.find(l=>l.id===r);if(!n)return`Could not find layer for id: ${r}`;let c={styleName:"color-age",fields:o,layer:n,view:s,colorSchemeTags:a,theme:i};try{let l=wt(c),u=await bt(l);return n.renderer=u.renderer,n.visible=!0,`Color-age renderer applied to layer: ${n.title??n.id} using fields ${o.join(", ")}`}catch(l){return`Error applying color-age renderer: ${l instanceof Error?l.message:String(l)}`}}async function vt({layerId:e,fields:t,colorSchemes:r,theme:o},a){let{mapView:i}=v(a);return await T({type:"show-legend",data:{layerIds:[e]}},a),await Tt({arcgisMap:i.map,arcgisMapView:i,layerId:e,fields:t,colorSchemes:r,theme:o})}var St=d.object({layerId:d.string().describe("The id of the layer to apply the color-age renderer to"),fields:d.array(d.string()).describe("The field(s) to use for the color-age renderer (temporal/date data)"),colorSchemes:d.array(d.string()).optional().describe("Optional color scheme tags to use"),theme:d.enum(["above-and-below","above","below","centered-on","extremes","high-to-low"]).optional().describe("Optional theme for the color ramp")}),Ua=g(vt,{name:"color-age",description:`Label: Age (color)
18
+ Description: Use colors along a continuous color ramp to represent the age of features. Age reflects the length of time from a start date to an end date.
19
+ Keywords: since, age, how old, how long
20
+ Example: Show the age of each feature based on its reported date.
21
+ Fields: This style requires at least one field with a date type.`,schema:St});function xt(e){let{fields:t,layer:r,view:o,colorSchemeTags:a}=e,{theme:i}=e,s=t[1],n=t[0],c;return a&&(c=re({geometryType:r.geometryType,includedTags:a,theme:i||"high-to-low"})[0]),{layer:r,view:o,field:n,normalizationField:s,theme:i,sizeOptimizationEnabled:!0,outlineOptimizationEnabled:!0,colorScheme:c}}async function Et(e){return await Ve(e)}async function Mt({arcgisMap:e,arcgisMapView:t,layerId:r,fields:o,colorSchemes:a,theme:i}){let s=t,n=e?.allLayers.find(l=>l.id===r);if(!n)return`Could not find layer for id: ${r}`;let c={styleName:"color",fields:o,layer:n,view:s,colorSchemeTags:a,theme:i};try{let l=xt(c),u=await Et(l);return n.renderer=u.renderer,n.visible=!0,`Color renderer applied to layer: ${n.title??n.id} using fields ${o.join(", ")}`}catch(l){return`Error applying color renderer: ${l instanceof Error?l.message:String(l)}`}}async function _t({layerId:e,fields:t,colorSchemes:r,theme:o},a){let{mapView:i}=v(a);return await T({type:"show-legend",data:{layerIds:[e]}},a),await Mt({arcgisMap:i.map,arcgisMapView:i,layerId:e,fields:t,colorSchemes:r,theme:o})}var kt=d.object({layerId:d.string().describe("The id of the layer to apply the color renderer to"),fields:d.array(d.string()).describe("The field(s) to use for the color renderer"),colorSchemes:d.array(d.string()).optional().describe("Optional color scheme tags to use"),theme:d.enum(["above-and-below","above","below","centered-on","extremes","high-to-low"]).optional().describe("Optional theme for the color ramp")}),Ha=g(_t,{name:"color",description:`Label: Counts and Amounts (color)
22
+ Description: Vary color along a continuous color ramp to represent numeric or ranked data.
23
+ Keywords: graduated color, choropleth, continuous color, hue, color, gradation, saturation, lightness, percent, rate, ratio, index, how much, increase, decrease
24
+ Example: Color each feature based on the population density.
25
+ Fields: This style requires a single field with a number type. A second number field may be specified for normalizing the value of the first field.`,schema:kt});function $t(e){let{fields:t,layer:r,view:o,colorSchemeTags:a,theme:i}=e,s,n,c=t[0];return a&&(n=re({geometryType:r.geometryType,includedTags:a,theme:i||"high-to-low"})[0]),{layer:r,view:o,field:c,normalizationField:s,theme:i,colorOptions:{colorScheme:n}}}async function Nt(e){return await Be(e)}async function At({arcgisMap:e,arcgisMapView:t,layerId:r,fields:o,colorSchemes:a,theme:i}){let s=t,n=e?.allLayers.find(l=>l.id===r);if(!n)return`Could not find layer for id: ${r}`;let c={styleName:"color-size-univariate",fields:o,layer:n,view:s,colorSchemeTags:a,theme:i};try{let l=$t(c),u=await Nt(l);return n.renderer=u.renderer,n.visible=!0,`Color-size-univariate renderer applied to layer: ${n.title??n.id} using fields ${o.join(", ")}`}catch(l){return`Error applying color-size-univariate renderer: ${l instanceof Error?l.message:String(l)}`}}async function Rt({layerId:e,fields:t,colorSchemes:r,theme:o},a){let{mapView:i}=v(a);return await T({type:"show-legend",data:{layerIds:[e]}},a),await At({arcgisMap:i.map,arcgisMapView:i,layerId:e,fields:t,colorSchemes:r,theme:o})}var It=d.object({layerId:d.string().describe("The id of the layer to apply the color-size univariate renderer to"),fields:d.array(d.string()).describe("The fields to use for the color-size univariate renderer"),colorSchemes:d.array(d.string()).optional().describe("Optional color scheme tags to use"),theme:d.enum(["above-and-below","above","below","centered-on","extremes","high-to-low"]).optional().describe("Optional theme for the color and size ramps")}),Wa=g(Rt,{name:"color-size-univariate",description:`Label: Color and Size (univariate)
26
+ Description: Vary symbol size and color based on the values of two numeric attributes.
27
+ Keywords: continuous color, hue, color, size, gradation, saturation, lightness, percent, rate, ratio, index, how much, increase, decrease, amount
28
+ Example: Color each feature based on the percentage of the population that owns a home and vary the size of each point based on total population.
29
+ Fields: This style requires at least two fields: one determining the color of each feature, the other determining the size of each feature. Each field may be normalized by an additional normalization field.`,schema:It});function Ct(e){let{fields:t,layer:r,view:o,colorSchemeTags:a}=e,i;return a&&(i=Ue({includedTags:a,numColors:Math.min(t.length,8)})[0]),{layer:r,view:o,legendOptions:{unit:"units"},attributes:t.map(s=>({field:s,label:r.fields.find(n=>n.name===s)?.alias??""})).slice(0,8),outlineOptimizationEnabled:!0,dotDensityScheme:i}}async function qt(e){return await Ke(e)}async function zt({arcgisMap:e,arcgisMapView:t,layerId:r,fields:o,colorSchemes:a}){let i=t,s=e?.allLayers.find(c=>c.id===r);if(!s)return`Could not find layer for id: ${r}`;let n={styleName:"dot-density",fields:o,layer:s,view:i,colorSchemeTags:a};try{let c=Ct(n),l=await qt(c);return s.renderer=l.renderer,s.visible=!0,`Dot Density renderer applied to layer: ${s.title??s.id} using fields ${o.join(", ")}`}catch(c){return`Error applying dot density renderer: ${c instanceof Error?c.message:String(c)}`}}async function Dt({layerId:e,fields:t,colorSchemes:r},o){let{mapView:a}=v(o);return await T({type:"show-legend",data:{layerIds:[e]}},o),await zt({arcgisMap:a.map,arcgisMapView:a,layerId:e,fields:t,colorSchemes:r})}var Pt=d.object({layerId:d.string().describe("The id of the layer to apply the dot density renderer to"),fields:d.array(d.string()).describe("The field(s) to use for the dot density renderer (population or count data)"),colorSchemes:d.array(d.string()).optional().describe("Optional color scheme tags to use")}),Ja=g(Dt,{name:"dot-density",description:`Dot Density
30
+ Use dot density to visualize the distribution of one attribute or compare the density of multiple attributes. This is only valid for polygon layers.
31
+ **Use cases:**
32
+ - Population distribution visualization
33
+ - Comparing multiple categories within areas
34
+ - Showing spatial distribution patterns
35
+ **Examples:**
36
+ - Show the density of the population based on various race/ethnic groups
37
+ - Visualize distribution of different crops across regions
38
+ - Display demographic patterns within census tracts
39
+ **Fields:** Requires 2-8 number fields.
40
+ **Keywords:** density, how much, how many, total, number, amount`,schema:Pt});function Ot(e){let{fields:t,layer:r,view:o,colorSchemeTags:a}=e,i,s=t[0];return a&&(i=We({includedTags:a,basemap:o.map?.basemap||"topo"})[0]),{layer:r,view:o,field:s,heatmapScheme:i}}async function jt(e){return await He(e)}async function Ft({arcgisMap:e,arcgisMapView:t,layerId:r,fields:o,colorSchemes:a}){let i=t,s=e?.allLayers.find(c=>c.id===r);if(!s)return`Could not find layer for id: ${r}`;let n={styleName:"heatmap",fields:o,layer:s,view:i,colorSchemeTags:a};try{let c=Ot(n),l=await jt(c);return s.renderer=l.renderer,s.visible=!0,`Heatmap renderer applied to layer: ${s.title??s.id} using fields ${o.join(", ")}`}catch(c){return`Error applying heatmap renderer: ${c instanceof Error?c.message:String(c)}`}}async function Lt({layerId:e,fields:t,colorSchemes:r},o){let{mapView:a}=v(o);return await T({type:"show-legend",data:{layerIds:[e]}},o),await Ft({arcgisMap:a.map,arcgisMapView:a,layerId:e,fields:t,colorSchemes:r})}var Qt=d.object({layerId:d.string().describe("The id of the layer to apply the heatmap renderer to"),fields:d.array(d.string()).describe("The field(s) to use for the heatmap renderer (typically point density)"),colorSchemes:d.array(d.string()).optional().describe("Optional color scheme tags to use")}),Za=g(Lt,{name:"heatmap",description:`Label: Heat Map
41
+ Description: Show areas of high density with colors that appear to glow hotter. This is only valid for point layers.
42
+ Keywords: density, heatmap, hot spots, pattern, cluster
43
+ Example: Create a heatmap
44
+ Fields: This typically requires zero or one field of type number.`,schema:Qt});function Gt(e){let{fields:t,layer:r,view:o,styleName:a,colorSchemeTags:i}=e,s;return i&&(s=Ze({geometryType:r.geometryType,includedTags:i,numColors:Math.min(t.length,10)})[0]),{layer:r,view:o,fields:t.map(n=>({name:n})).slice(0,9),outlineOptimizationEnabled:!0,sizeOptimizationEnabled:!0,includeSizeVariable:a.includes("Size"),predominanceScheme:s}}async function Vt(e){return await Je(e)}async function Bt({arcgisMap:e,arcgisMapView:t,layerId:r,fields:o,colorSchemes:a,includeSize:i}){let s=t,n=e?.allLayers.find(l=>l.id===r);if(!n)return`Could not find layer for id: ${r}`;let c={styleName:i?"predominance-size":"predominance",fields:o,layer:n,view:s,colorSchemeTags:a};try{let l=Gt(c),u=await Vt(l);return n.renderer=u.renderer,n.visible=!0,`Predominance renderer applied to layer: ${n.title??n.id} using fields ${o.join(", ")}`}catch(l){return`Error applying predominance renderer: ${l instanceof Error?l.message:String(l)}`}}async function Kt({layerId:e,fields:t,colorSchemes:r,includeSize:o},a){let{mapView:i}=v(a);return await T({type:"show-legend",data:{layerIds:[e]}},a),await Bt({arcgisMap:i.map,arcgisMapView:i,layerId:e,fields:t,colorSchemes:r,includeSize:o})}var Ut=d.object({layerId:d.string().describe("The id of the layer to apply the predominance renderer to"),fields:d.array(d.string()).describe("The fields to use for the predominance renderer (competing categories)"),colorSchemes:d.array(d.string()).optional().describe("Optional color scheme tags to use"),includeSize:d.boolean().optional().describe("Whether to include size visualization (predominance-size)")}),Ya=g(Kt,{name:"predominance",description:`Label: Predominant category
45
+ Description: Compare attributes that share a common subject and unit of measurement to see which has the highest value.
46
+ Keywords: predominant, winner, won, competing, most, most common, most frequent, dominant, prevalent, top
47
+ Example: Using fields for Corn Acres, Wheat Acres, and Cotton Acres, show the predominant crop harvested in each area.
48
+ Fields: This style relies on 2-10 number fields.
49
+
50
+ Label: Predominant category and Size
51
+ Description: Compare attributes that share a common subject and unit of measurement to see which has the highest value. Also varies the size of each symbol based on the total of all categories.
52
+ Keywords: predominant, winner, won, competing, most, most common, most frequent, dominant, prevalent, top, amount, total, how much, proportional size, graduated size, sum
53
+ Example: Show the predominant crop in each area and vary the size of each symbol based on the total of all categories.
54
+ Fields: This style relies on 2-10 number fields.`,schema:Ut});function Ht(e){let{fields:t,layer:r,view:o,colorSchemeTags:a}=e,i,s={field:t[0]},n={field:t[1]};return a&&(i=Xe({geometryType:r.geometryType,includedTags:a})[0]),{layer:r,view:o,field1:s,field2:n,outlineOptimizationEnabled:!0,sizeOptimizationEnabled:!0,relationshipScheme:i}}async function Wt(e){return await Ye(e)}async function Jt({arcgisMap:e,arcgisMapView:t,layerId:r,fields:o,colorSchemes:a}){let i=t,s=e?.allLayers.find(c=>c.id===r);if(!s)return`Could not find layer for id: ${r}`;let n={styleName:"relationship",fields:o,layer:s,view:i,colorSchemeTags:a};try{let c=Ht(n),l=await Wt(c);return s.renderer=l.renderer,s.visible=!0,`Relationship renderer applied to layer: ${s.title??s.id} using fields ${o.join(", ")}`}catch(c){return`Error applying relationship renderer: ${c instanceof Error?c.message:String(c)}`}}async function Zt({layerId:e,fields:t,colorSchemes:r},o){let{mapView:a}=v(o);return await T({type:"show-legend",data:{layerIds:[e]}},o),await Jt({arcgisMap:a.map,arcgisMapView:a,layerId:e,fields:t,colorSchemes:r})}var Yt=d.object({layerId:d.string().describe("The id of the layer to apply the relationship renderer to"),fields:d.array(d.string()).describe("The two fields to use for the relationship renderer (bivariate visualization)"),colorSchemes:d.array(d.string()).optional().describe("Optional color scheme tags to use")}),Xa=g(Zt,{name:"relationship",description:`Label: Relationship
55
+ Description: Overlays two color ramps to represent the relationship between two numeric attributes.
56
+ Keywords: relationship, correlation, compare, related, bivariate choropleth, bivariate color
57
+ Example: Show the relationship between tree height and carbon storage
58
+ Fields: This style requires two number fields.`,schema:Yt});function Xt(e){let{fields:t,layer:r,view:o,theme:a}=e,i=t[0];return{layer:r,view:o,startTime:i,endTime:new Date,theme:a,sizeOptimizationEnabled:!0,outlineOptimizationEnabled:!0}}async function er(e){return await et(e)}async function tr({arcgisMap:e,arcgisMapView:t,layerId:r,fields:o,colorSchemes:a,theme:i}){let s=t,n=e?.allLayers.find(l=>l.id===r);if(!n)return`Could not find layer for id: ${r}`;let c={styleName:"size-age",fields:o,layer:n,view:s,colorSchemeTags:a,theme:i};try{let l=Xt(c),u=await er(l);return n.renderer=u.renderer,n.visible=!0,`Size-age renderer applied to layer: ${n.title??n.id} using fields ${o.join(", ")}`}catch(l){return`Error applying size-age renderer: ${l instanceof Error?l.message:String(l)}`}}async function rr({layerId:e,fields:t,colorSchemes:r,theme:o},a){let{mapView:i}=v(a);return await T({type:"show-legend",data:{layerIds:[e]}},a),await tr({arcgisMap:i.map,arcgisMapView:i,layerId:e,fields:t,colorSchemes:r,theme:o})}var or=d.object({layerId:d.string().describe("The id of the layer to apply the size-age renderer to"),fields:d.array(d.string()).describe("The field(s) to use for the size-age renderer (temporal data with size)"),colorSchemes:d.array(d.string()).optional().describe("Optional color scheme tags to use"),theme:d.enum(["above-and-below","above","below","centered-on","extremes","high-to-low"]).optional().describe("Optional theme for the size ramp")}),en=g(rr,{name:"size-age",description:`Label: Age (size)
59
+ Description: Vary symbol sizes along a continuous ramp to represent the age of features. Age reflects the length of time from a start date to an end date.
60
+ Keywords: since, age, how old, how long
61
+ Example: Change the size of features so older features are larger than new features.
62
+ Fields: This style requires at least one field with a date type.`,schema:or});function ar(e){let{fields:t,layer:r,view:o}=e,{theme:a}=e,i=t[1],s=t[0];return{layer:r,view:o,field:s,normalizationField:i,theme:a,sizeOptimizationEnabled:!0,outlineOptimizationEnabled:!0}}async function nr(e){return await tt(e)}async function ir({arcgisMap:e,arcgisMapView:t,layerId:r,fields:o,colorSchemes:a,theme:i}){let s=t,n=e?.allLayers.find(l=>l.id===r);if(!n)return`Could not find layer for id: ${r}`;let c={styleName:"size",fields:o,layer:n,view:s,colorSchemeTags:a,theme:i};try{let l=ar(c),u=await nr(l);return n.renderer=u.renderer,n.visible=!0,`Size renderer applied to layer: ${n.title??n.id} using fields ${o.join(", ")}`}catch(l){return`Error applying size renderer: ${l instanceof Error?l.message:String(l)}`}}async function sr({layerId:e,fields:t,colorSchemes:r,theme:o},a){let{mapView:i}=v(a);return await T({type:"show-legend",data:{layerIds:[e]}},a),await ir({arcgisMap:i.map,arcgisMapView:i,layerId:e,fields:t,colorSchemes:r,theme:o})}var lr=d.object({layerId:d.string().describe("The id of the layer to apply the size renderer to"),fields:d.array(d.string()).describe("The field(s) to use for the size renderer (numeric data)"),colorSchemes:d.array(d.string()).optional().describe("Optional color scheme tags to use"),theme:d.enum(["above-and-below","above","below","centered-on","extremes","high-to-low"]).optional().describe("Optional theme for the size ramp")}),tn=g(sr,{name:"size",description:`Label: Counts and Amounts (size)
63
+ Description: Vary symbol sizes along a continuous ramp to represent numeric or ranked data.
64
+ Keywords: graduated size, proportional size, how much, total, number, amount, size
65
+ Example: Vary the size of each point based on the total population.
66
+ Fields: This style requires a single field with a number type. A second number field may be specified for normalizing the value of the first field.
67
+
68
+ Label: Continuous Timeline (size)
69
+ Description: Vary symbol sizes along a continuous ramp to represent dates.
70
+ Keywords: graduated size, proportional size, classed size, how much, total, number, when
71
+ Example: Vary the size of each feature based on the date a ticket was completed.
72
+ Fields: This style requires a single field with a date type.`,schema:lr});function cr(e){let{fields:t,layer:r,view:o,colorSchemeTags:a}=e,i=t[0],s=t[1],n=t[2],c;return a&&(c=ot({geometryType:r.geometryType,includedTags:a})[0]),{layer:r,view:o,field:i,field2:s,field3:n,outlineOptimizationEnabled:!0,sizeOptimizationEnabled:!0,typeScheme:c}}async function dr(e){return await rt(e)}async function ur({arcgisMap:e,arcgisMapView:t,layerId:r,fields:o,colorSchemes:a,theme:i}){let s=t,n=e?.allLayers.find(l=>l.id===r);if(!n)return`Could not find layer for id: ${r}`;let c={styleName:"type",fields:o,layer:n,view:s,colorSchemeTags:a,theme:i};try{let l=cr(c),u=await dr(l);return n.renderer=u.renderer,n.visible=!0,`Type renderer applied to layer: ${n.title??n.id} using fields ${o.join(", ")}`}catch(l){return`Error applying type renderer: ${l instanceof Error?l.message:String(l)}`}}async function pr({layerId:e,fields:t,colorSchemes:r,theme:o},a){let{mapView:i}=v(a);return await T({type:"show-legend",data:{layerIds:[e]}},a),await ur({arcgisMap:i.map,arcgisMapView:i,layerId:e,fields:t,colorSchemes:r,theme:o})}var mr=d.object({layerId:d.string().describe("The id of the layer to apply the type renderer to"),fields:d.array(d.string()).describe("The field(s) to use for the type renderer (categorical data)"),colorSchemes:d.array(d.string()).optional().describe("Optional color scheme tags to use"),theme:d.enum(["above-and-below","above","below","centered-on","extremes","high-to-low"]).optional().describe("Optional theme for the color scheme")}),rn=g(pr,{name:"type",description:`Label: Types (unique symbols)
73
+ Description: Represent features as categories with different symbol colors or shapes. Examples include type of tree, road class, or province name.
74
+ Keywords: categorical, category, type, unique, discrete, point of interest, region, group
75
+ Example: Color each feature based on the region it belongs to
76
+ Fields: This style requires a single field which may be a string, number, or date type. It is usually a string.`,schema:mr}),on=y.Root({...R(),vectorSearchLayerIds:y(),vectorSearchFieldResults:y(),layerFieldInfo:y(),selectedLayerId:y()}),an=y.Root({...R(),helpInternalState:y({reducer:I,default:()=>({toolCallMessage:void 0})})}),nn=y.Root({...R(),intent:y({reducer:(e,t)=>t}),arcgisKnowledgeMessages:y({reducer:A,default:()=>[]}),arcgisKnowledgeToolResult:y({reducer:(e,t)=>t,default:()=>null})});function oe(e){let t=e.map?.allLayers.filter(r=>r.type==="knowledge-graph");if(!t||t?.length!==1)throw new Error("The Knowledge Agent currently only supports maps with exactly one Knowledge Graph Layer.")}function x(e){return!!e?.map&&"activeLinkChartLayer"in e.map}async function Q(e){!x(e)||!e.map.diagramNodesExtent||await e.goTo(e.map.diagramNodesExtent)}function q(e){let t=e?.configurable?.context;if(!t||typeof t!="object")throw new Error("ArcgisKnowledgeAgent context missing");if(!("view"in t))throw new Error("View context missing");let r=t.view;return r.map&&!("activeLinkChartLayer"in r.map)&&oe(r),{view:r}}function sn(e){let t=e?.configurable?.context;if($e(e)==="knowledgeGraph")return"knowledgeGraph";let r=t.view;return x(r)?"linkChart":(oe(r),"map")}async function z(e){let t=e?.configurable?.context;if($e(e)==="knowledgeGraph")return t;{let r=t.view.map;if(r&&"activeLinkChartLayer"in r){let o=r.knowledgeGraph?.url;if(!o)throw new Error("Knowledge graph url missing from link chart.");return{knowledgeGraph:await Ee(o)}}else{oe(t.view);let o=(t.view.map?.allLayers.find(a=>a.type==="knowledge-graph")).url;if(!o)throw new Error("Knowledge graph url missing from map.");return{knowledgeGraph:await Ee(o)}}}}function $e(e){let t=e?.configurable?.context;if(!t||typeof t!="object")throw new Error("ArcgisKnowledgeAgent context missing");if("knowledgeGraph"in t&&"view"in t)throw new Error("Knowledge Graph context should only have a view or knowledgeGraph, but never both.");if("knowledgeGraph"in t)return"knowledgeGraph";if("view"in t)return"view";throw new Error("ArcgisKnowledgeAgent context must have either a view or knowledgeGraph property.")}var H=class{constructor(t){this.dataModel=t,this.kind="GraphQueryGenerationRequest",this.explainQuery=!0,this.schemaInformation=W.fromDataModel(t)}},W=class e{constructor(){this.schemaType="ArcgisGraphSchema",this.entityTypes=[],this.relationshipTypes=[],this.identifierInfo={mappingInfo:{identifierMapsTo:"UniformPropertyIdentifier",identifierPropertyName:"globalid"}}}static fromDataModel(t){let r=new e;for(let o of t.entityTypes)r.entityTypes.push(C.fromEntityType(o));for(let o of t.relationshipTypes)r.relationshipTypes.push(J.fromRelationshipType(o));return r.identifierInfo={mappingInfo:{identifierMapsTo:hr(t.identifierInfo.identifierMappingInfo.identifierInfoType),identifierPropertyName:t.identifierInfo.identifierMappingInfo.uniformPropertyIdentifier.identifierPropertyName}},r.spatialReference=JSON.parse(JSON.stringify(t.spatialReference)),r}static getDataModelTypesSummary(t){let r=t.entityTypes.map(a=>a.name).join(", "),o=t.relationshipTypes.map(a=>a.name).join(", ");return`Entity Types: ${r}.
77
+ Relationship Types: ${o}.`}},C=class e{constructor(){this.name="",this.properties=[]}static fromEntityType(t){let r=new e;r.name=t.name,r.alias=t.alias?t.alias:void 0,r.role=yr(t.role);for(let o of t.properties){let a={name:o.name,alias:o.alias?o.alias:void 0,fieldType:o.fieldType,role:fr(o.role),geometryDef:o.fieldType==="esriFieldTypeGeometry"?{geometryType:o.geometryType??"esriGeometryAny",hasM:o.hasM?o.hasM:void 0,hasZ:o.hasZ?o.hasZ:void 0}:void 0};r.properties.push(a)}return r}},J=class extends C{constructor(){super(...arguments),this.observedEndPoints=[]}static fromRelationshipType(t){let r=C.fromEntityType(t);r.observedEndPoints=[];for(let o of t.endPoints)r.observedEndPoints.push({originEntityType:o.originEntityType,destinationEntityType:o.destinationEntityType});return r}},hr=e=>{switch(e){case"esriIdentifierInfoTypeUNSPECIFIED":return"UNSPECIFIED";case"esriIdentifierInfoTypeDatabaseNative":return"DatabaseNative";case"esriIdentifierInfoTypeUniformProperty":return"UniformPropertyIdentifier";default:return e}},yr=e=>{switch(e){case"Regular":return"esriGraphNamedObjectRegular";case"Provenance":return"esriGraphNamedObjectProvenance";case"Document":return"esriGraphNamedObjectDocument";default:return e}};function fr(e){switch(e){case"esriGraphPropertyRegular":return"Regular";case"esriGraphPropertyDocumentName":return"Document_Name";case"esriGraphPropertyDocumentTitle":return"Document_Title";case"esriGraphPropertyDocumentUrl":return"Document_Url";case"esriGraphPropertyDocumentText":return"Document_Text";case"esriGraphPropertyDocumentKeywords":return"Document_Keywords";case"esriGraphPropertyDocumentContentType":return"Document_ContentType";case"esriGraphPropertyDocumentMetadata":return"Document_Metadata";case"esriGraphPropertyDocumentFileExtension":return"Document_FileExtension";case"esriGraphPropertyProvenanceInstanceId":return"Provenance_InstanceId";case"esriGraphPropertyProvenanceSourceType":return"Provenance_SourceType";case"esriGraphPropertyProvenanceSourceName":return"Provenance_SourceName";case"esriGraphPropertyProvenanceSource":return"Provenance_Source";case"esriGraphPropertyProvenanceComment":return"Provenance_Comment";case"esriGraphPropertyProvenanceTypeName":return"Provenance_TypeName";case"esriGraphPropertyProvenancePropertyName":return"Provenance_PropertyName";default:return"Regular"}}function G(e){return e?.signal}async function gr(e,t){let r=await L("arcgis_knowledge_cypher_query_prompt");return t?`${e} ${r}
78
+
79
+ Your previous attempt to generate a cypher query failed. See the details below and generate a new cypher query that avoids this error.
80
+
81
+ Attempt Number: ${t.attemptCount}
82
+ Execution Error: ${t.executionError}
83
+ Failed Query:
84
+ ${t.failedGraphQuery}`:`${e} ${r}`}async function wr(e,t,r,o){let{graphQuery:a,explanation:i}=await ae(e,t,r,o);return{graphQuery:a,explanation:i}}async function ae(e,t,r,o,a){let i={message:await gr(e,a),context:new H(t)},s=G(o);await b({text:"Attempting to generate a cypher query from your prompt..."},o);let n=await Se(`${r}/chat`,{method:"post",body:JSON.stringify(i),headers:{"Content-Type":"application/json",token:ve.findCredential(_.getDefault().url)?.token??""},signal:s});if(n.httpStatus!==200)throw new Error(`Graph query service returned an error: ${n.httpStatus}`,{cause:n.data});let c=!1,l=Date.now(),u=n.data.sequenceNumber,p="",m="",w=1;for(;!c;){await new Promise(f=>setTimeout(f,1e3)),await b({text:`Periodically requesting status of job from ArcGIS AI Services${"...".substring(0,w)}`},o),w=w%3+1;let h=await Se(`${r}/chat`,{method:"post",body:JSON.stringify({conversationId:n.data.conversationId,inquiryId:n.data.inquiryId,ackSequenceNumber:u}),headers:{"Content-Type":"application/json",token:ve.findCredential(_.getDefault().url)?.token??""},signal:s});if(h.httpStatus!==200)throw new Error(`Graph query service polling returned an error: ${h.httpStatus}`,{cause:h.data});if(h.data.context?.kind){if(h.data.context.kind!=="GraphQueryGenerationResponse")throw new Error(`Unexpected response from graph query service polling. Message: ${h.data.message}`,{cause:h.data});p=h.data.context.graphQuery,m=h.data.message||"",c=!0}else if(!h.data.hasMore)c=!0;else if(Date.now()-l>6e4)throw new Error("Graph query service polling timed out after 1 minute.");u=h.data.sequenceNumber}return{graphQuery:p,explanation:m}}function br(e,t){E(e,r=>{t.set(`${r.typeName}__${r.id}`,{id:r.id,typeName:r.typeName})})}function E(e,t){if(!(!e||typeof e!="object")){if(vr(e))for(let r of e.path)E(r,t);else if(Tr(e))t(e);else if(Array.isArray(e))for(let r of e)E(r,t);else if(Sr(e))for(let r of Object.values(e.properties??{}))E(r,t)}}function Tr(e){return!e||typeof e!="object"||Array.isArray(e)?!1:"id"in e&&"typeName"in e}function vr(e){return!e||typeof e!="object"||Array.isArray(e)?!1:e&&"path"in e&&Array.isArray(e.path)}function Sr(e){return!e||typeof e!="object"||Array.isArray(e)||"id"in e?!1:"properties"in e&&typeof e.properties=="object"}function xr(e,t){let r=[],o=[],a=[[t.dataModel.entityTypes,r],[t.dataModel.relationshipTypes,o]];for(let[i,s]of a)for(let n of i){let c=e.getMemberIdsByType(n.name);s.push(...c)}return{entityIds:r,relationshipIds:o}}function Er(e,t){let r={entityIds:new Array,relationshipIds:new Array},o=[],a=e?.allLayers.find(n=>n.type==="knowledge-graph")?.inclusionModeDefinition;if(!a)return{allNamedTypesFullyDynamic:!0,bindParameters:r,nonDynamicTypes:o};let i=[[t.dataModel.entityTypes,r.entityIds],[t.dataModel.relationshipTypes,r.relationshipIds]],s=!0;for(let[n,c]of i)for(let l of n){let u=a.namedTypeDefinitions.get(l.name);if(!u){s=!1,o.push(l.name);continue}if(!u.useAllData){s=!1,o.push(l.name);for(let[p]of u.members||[])c.push(p)}}return{allNamedTypesFullyDynamic:s,bindParameters:r,nonDynamicTypes:o}}var M=3;function Ne(e,t=100){let r={};for(let o of Object.entries(e.properties??{})){let[a,i]=o;typeof i=="string"&&i.length>t?r[a]=`${i.slice(0,t)}... (truncated, original length: ${i.length})`:r[a]=i}return e.properties=r,e}function k(e){return typeof e!="object"||e===null?String(e):"details"in e&&typeof e.details=="object"&&e.details!==null&&"errorMessage"in e.details&&typeof e.details.errorMessage=="string"?e.details.errorMessage:"message"in e&&typeof e.message=="string"?e.message:String(e)}var Mr=async({kg:e,queryParams:t,targetStructure:r,targetStructureReducer:o,requestOptions:a,queryRowLimit:i,queryTimeoutMs:s})=>{let n=null,c=r,l=new AbortController,u=a?.signal,p=()=>{l.abort(u?.reason)};u&&(u.aborted?l.abort(u.reason):u.addEventListener("abort",p,{once:!0}));try{let m=await nt(e,t,a);n=m.resultHeader;let w=m.resultRowsStream.getReader(),h=0,f=Date.now(),S=!1;for(;;){let{done:V,value:Ce}=await w.read();if(V)break;if(!S&&s&&Date.now()-f>s)return l.abort(),{type:"timeout"};for(let qe of Ce){if(h++,i&&h>i)return l.abort(),{type:"success",rowLimitReached:!0,resultHeader:n,processedResult:c};c=o(c,qe)}}}catch(m){return l.signal.aborted?{type:"aborted"}:{type:"error",errorMessage:k(m),error:m}}finally{u?.removeEventListener("abort",p)}return{type:"success",rowLimitReached:!1,resultHeader:n,processedResult:c}};async function Ae({prompt:e,bindParameters:t,kg:r,graphQueryServiceUrl:o,targetStructure:a,targetStructureReducer:i,requestOptions:s,queryRowLimit:n,queryTimeoutMs:c,config:l}){let u;for(let p=1;p<=M;p++){let m;try{m=await ae(e,r.dataModel,o,l,u)}catch(S){return{type:"generation-error",errorMessage:k(S),error:S}}await b({text:`Attempting to execute query: ${m.graphQuery.substring(0,500)}${m.graphQuery.length>500?"...":""}`},l);let w=await _r(m.graphQuery,t),h=await Mr({kg:r,queryParams:new ke({openCypherQuery:m.graphQuery,bindParameters:w}),targetStructure:a,targetStructureReducer:i,requestOptions:s,queryRowLimit:n,queryTimeoutMs:c}),f=h.type==="aborted"?"Query execution was aborted.":h.type==="timeout"?"Query execution timed out.":h.type==="error"?`Query failed with error: ${h.errorMessage}`:"";if(h.type==="success")return{type:"success",graphQuery:m.graphQuery,explanation:m.explanation,rowLimitReached:h.rowLimitReached,resultHeader:h.resultHeader,processedResult:h.processedResult};if(h.type==="aborted")return{type:"aborted",errorMessage:f,graphQuery:m.graphQuery,explanation:m.explanation};if(p>=M)return h.type==="timeout"?{type:"timeout",errorMessage:f,graphQuery:m.graphQuery,explanation:m.explanation}:{type:"execution-error",errorMessage:f,error:h.error,graphQuery:m.graphQuery,explanation:m.explanation};u={failedGraphQuery:m.graphQuery,executionError:f,attemptCount:p},await b({text:`Attempt ${p} failed with error: ${f}. Retrying...`},l)}throw new Error(`Failed to execute generated cypher due to an unexpected error after ${M} attempts.`)}var _r=async(e,t)=>{if(!t)return{};let{bindParameters:r,parseErrors:o}=await lt(e);if(o)return t;let a={};for(let i of r)i in t&&(a[i]=t[i]);return a},kr=async({kg:e,searchQuery:t,typeCategoryFilter:r,namedTypesFilter:o,searchResultLimit:a,requestOptions:i})=>{let s=[],n=[r];r==="both"&&!e.serviceDefinition.serviceCapabilities.searchCapabilities.searchTypeFilterCapabilities.includes("esriTypeBoth")&&(n=["entity","relationship"]);let c=a??1/0;try{for(let l of n){let u=c-s.length;if(u<=0)break;let p=(await it(e,new st({searchQuery:t,typeCategoryFilter:l,namedTypesFilter:o??void 0,num:u}),i)).resultRowsStream.getReader(),m=!1;for(;!m;){let{done:w,value:h}=await p.read();if(w){m=!0;break}for(let f of h)for(let S of f)s.push(S)}}}catch(l){let u=k(l);return i?.signal?.aborted?{type:"aborted",errorMessage:u,error:l}:{type:"error",errorMessage:u,error:l}}return{type:"success",results:s}},Re="IMPORTANT: The generated cypher query must return entire entities and relationships ONLY.";async function Ie({prompt:e,view:t,knowledgeGraph:r,includeReturnEntityAndRelationshipContext:o=!1}){let a=[e];if(o&&a.push(Re),x(t)){let u=await L("arcgis_knowledge_current_lc_context"),p=xr(t.map,r);return a.push(u),{enhancedPrompt:a.join(`
85
+
86
+ `),bindParameters:p,allNamedTypesFullyDynamic:!1}}let i=t.map,{allNamedTypesFullyDynamic:s,bindParameters:n,nonDynamicTypes:c}=Er(i,r);if(s)return{enhancedPrompt:a.join(`
87
+
88
+ `),bindParameters:n,allNamedTypesFullyDynamic:!0};let l=(await L("arcgis_knowledge_current_map_context")).replaceAll("{nonDynamicTypes}",JSON.stringify(c));return a.push(l),{enhancedPrompt:a.join(`
89
+
90
+ `),bindParameters:n,allNamedTypesFullyDynamic:s}}async function $r(e,t,r,o,a,i){let{view:s}=a,n=await Ae({prompt:e,bindParameters:t,kg:r,graphQueryServiceUrl:o,targetStructure:new Map,targetStructureReducer:(m,w)=>{for(let h of w)br(h,m);return m},requestOptions:{signal:G(i),timeout:i?.timeout},config:i});if(n.type!=="success"){let m=n.type==="generation-error"?n.errorMessage:`${n.errorMessage} Cypher query: ${n.graphQuery}`;throw new Error(`Failed to add records to the link chart. ${m}`)}let{graphQuery:c,explanation:l,processedResult:u}=n,p=Array.from(u.values());return await b({text:`Query Results parsed into ${p.length} unique relationships and entities. Atempting to add to link chart...`},i),x(s)?(await s.map.addRecords(p),await Q(s),{generatedQuery:c,explanation:l,addedIdTypePairs:p}):(await s?.map?.allLayers.find(m=>m.type==="knowledge-graph")?.addRecords(p),{generatedQuery:c,explanation:l,addedIdTypePairs:p})}var j="addRecords",Nr=d.object({prompt:d.string().describe("The user's inquiry and context required in order to generate a cypher query that will be used to add records to the link chart.")}),Ar=async({prompt:e},t)=>{let{knowledgeGraph:r}=await z(t),o=q(t),{view:a}=o,i=_.getDefault().helperServices,{enhancedPrompt:s,bindParameters:n,allNamedTypesFullyDynamic:c}=await Ie({prompt:e,view:a,knowledgeGraph:r,includeReturnEntityAndRelationshipContext:!0});if(c)return{toolName:j,status:"success",summary:"No records have been added to the map because all data in the knowledge graph is contained in the map.",details:{generatedQuery:"N/A",explanation:"All named types in the knowledge graph are fully dynamic and therefore all data is already contained in the map. No records have been added.",addedIdTypePairs:[]}};try{let{generatedQuery:l,explanation:u,addedIdTypePairs:p}=await $r(s,n,r,`${i.aiAssistantServices.url}${i.aiAssistantServices.graphQueryAssistant}`,o,t);return{toolName:j,status:"success",summary:`Records added successfully. Cypher Query used: ${l}
91
+
92
+ Number of records added: ${p.length}`,details:{generatedQuery:l,explanation:u,addedIdTypePairs:p}}}catch(l){let u=k(l);return{toolName:j,status:"error",errorMessage:`Failed to add records to the link chart. ${u}`,error:l}}},ln=g(Ar,{name:j,description:`Adds records (entities or relationships) to the current link chart visualization from an inquiry into the knowledge graph data. The inquiry will retrieve data from the graph database that will serve as the basis for the records to be added to the link chart. The user should have explicitly requested to add records to the current link chart from their prompt. "add to new link chart" is not a valid prompt for this tool.
93
+
94
+ example prompts:
95
+ - "add all suppliers and the parts they produce to the link chart"
96
+ - "show me the competitors of company x and add them to the link chart"
97
+ - "add the relationships between company x and company y to the link chart"
98
+ - "expand all the companies"
99
+ - "expand company x through all the buildings it owns"
100
+ - "connect company x and company y"
101
+ - "connect all buildings on the link chart"
102
+ `,schema:Nr});async function Rr(e,t){return await t.map?.applyLayout(e),await Q(t),{appliedLayout:e}}var Z="applyLayout",Ir=d.object({layout:d.enum(["organic-standard","organic-community","basic-grid","hierarchical-bottom-to-top","radial-root-centric","tree-left-to-right","geographic-organic-standard","chronological-mono-timeline","chronological-multi-timeline"]).describe("The layout mode to apply to the link chart. The value must be one of the following: organic-standard, organic-community, basic-grid, hierarchical-bottom-to-top, radial-root-centric, tree-left-to-right, geographic-organic-standard, chronological-mono-timeline, chronological-multi-timeline")}),Cr=async({layout:e},t)=>{let{view:r}=q(t);if(x(r)){let{appliedLayout:o}=await Rr(e,r);return{toolName:Z,status:"success",summary:`Successfully applied layout: ${o}.`,details:{appliedLayout:o}}}else return{toolName:Z,status:"error",errorMessage:"The applyLayout tool can only be used with a LinkChartView.",error:new Error}},cn=g(Cr,{name:Z,description:"Apply a diagram layout to the link chart",schema:Ir});async function qr(e,t){return t.map?.changeNonspatialDataDisplay(e),await Q(t),{appliedNonspatialDataDisplayMode:e}}var Y="changeNonspatialVisibility",zr=d.object({setting:d.enum(["hidden","visible"]).describe("The setting of nonspatial visibility")}),Dr=async({setting:e},t)=>{let{view:r}=q(t);if(x(r)){let{appliedNonspatialDataDisplayMode:o}=await qr(e,r);return{toolName:Y,status:"success",summary:`Successfully applied nonspatial visibility setting: ${o}.`,details:{appliedNonspatialDataDisplayMode:o}}}else return{toolName:Y,status:"error",errorMessage:"The changeNonspatialVisibility tool can only be used with a LinkChartView.",error:new Error}},dn=g(Dr,{name:Y,description:"Change whether or not nonspatial data is visible in the link chart. The value must be either 'hidden' or 'visible'.",schema:zr});async function Pr(e,t,r,o,a){let i,s="";for(let n=1;n<=M;n++){let{graphQuery:c,explanation:l}=await ae(e,t.dataModel,r,a,i);try{await b({text:`Attempting to create link chart from derived query: ${c}`},a);let u=await at.fromCypherQuery(t,new ke({openCypherQuery:c}));await b({text:"Link chart created successfully, loading..."},a),await u.load();let p=o.map;return o.map=u,await o.when(),await _e.whenOnce(()=>!o.updating),u.entityCount===0&&u.relationshipCount===0?(o.map===u&&(o.map=p),u.destroy(),{type:"error",errorMessage:`Query returned no results. Cypher Query used to create the link chart:
103
+ ${c}
104
+
105
+ Explanation: ${l}`}):(await Q(o),{type:"success",graphQuery:c,explanation:l})}catch(u){let p=k(u);if(n>=M){s=p;break}i={failedGraphQuery:c,executionError:p,attemptCount:n},await b({text:`Attempt ${n} to create link chart failed with error: ${p}. Retrying ...`},a)}}return{type:"error",errorMessage:`Failed to create link chart after ${M} attempts. Last error: ${s}`}}var F="createLinkChart",Or=d.object({prompt:d.string().describe("The user's inquiry and context required in order to generate a cypher query that will be used to create a link chart visualization. Only include information relevant to generating a cypher query. Do not suggest entity types, relationship types or properties. Do not include limits or formatting instructions for the query results unless specifically requested by the user. The prompt should be focused on the data the user wants to see in the link chart, not how to generate it.")}),jr=async({prompt:e},t)=>{let{knowledgeGraph:r}=await z(t),{view:o}=q(t);if(x(o)){let a=_.getDefault().helperServices,i=await Pr(`${e}
106
+
107
+ ${Re}`,r,`${a.aiAssistantServices.url}${a.aiAssistantServices.graphQueryAssistant}`,o,t);if(i.type==="error")return{toolName:F,status:"error",errorMessage:i.errorMessage,error:new Error};let{graphQuery:s,explanation:n}=i;return{toolName:F,status:"success",summary:`Link chart created successfully. Cypher Query used to create the link chart:
108
+ ${s}
109
+
110
+ Explanation: ${n}`,details:{generatedQuery:s,explanation:n}}}else return{toolName:F,status:"error",errorMessage:"The createLinkChart tool can only be used with a LinkChartView.",error:new Error}},un=g(jr,{name:F,description:"Creates a new link chart visualization from an inquiry into the knowledge graph data. The inquiry will retrieve data from the graph database that will serve as the basis for the new link chart. The user should have explicitly requested the creation of a new link chart from their prompt using language like 'create new link chart' or 'add to new link chart'.",schema:Or}),X="queryGraphData",Fr=d.object({prompt:d.string().describe("The user's inquiry into the knowledge graph, from which a cypher query will be generated and executed to answer the inquiry. Only include entity types, relationship types or properties if they are provided in the user prompt or prior steps. Do not suggest entity types, relationship types or properties. Do not include limits, information on what to return, instructions on how to write the query, or formatting instructions for the query results unless specifically requested by the user.")}),Lr=async({prompt:e},t)=>{let{knowledgeGraph:r}=await z(t),o=_.getDefault().helperServices,a=e,i=null,s=null;try{({view:s}=q(t))}catch{}s&&({enhancedPrompt:a,bindParameters:i}=await Ie({prompt:e,view:s,knowledgeGraph:r,includeReturnEntityAndRelationshipContext:!1}));let n=await Ae({prompt:a,bindParameters:i,kg:r,graphQueryServiceUrl:`${o.aiAssistantServices.url}${o.aiAssistantServices.graphQueryAssistant}`,targetStructure:new Array,targetStructureReducer:(f,S)=>(f.push(S),f),requestOptions:{signal:G(t),timeout:t?.timeout},config:t});if(n.type!=="success"){let f=n.type==="generation-error"?n.errorMessage:`${n.errorMessage} Cypher query: ${n.graphQuery}`;return{toolName:X,status:"error",errorMessage:`Failed to query the knowledge graph. ${f}`,error:"error"in n?n.error:null}}let{graphQuery:c,explanation:l,processedResult:u,resultHeader:p}=n,m=p.headerKeys;for(let f of u)for(let S of f)E(S,V=>Ne(V));let w=50,h=u.slice(0,w).map(f=>JSON.stringify(f));return{toolName:X,status:"success",summary:`To answer the inquiry, the following cypher query was executed against the knowledge graph:
111
+
112
+ \`\`\`cypher
113
+ ${c}
114
+ \`\`\`
115
+
116
+ Query Results:
117
+ ${h.length} result(s) found.
118
+
119
+ Column Headers: ${m.join(", ")}
120
+
121
+ ${h.length>w?`Showing top ${w} results:
122
+
123
+ `:`Results:
124
+
125
+ `}${h.join(`
126
+ `)}
127
+ `,details:{generatedQuery:c,explanation:l,resultHeader:p,queryResults:u}}},pn=g(Lr,{name:X,description:"Allows users to explore the data in their knowledge graph via cypher query. Generates and executes a cypher query based on the user's inquiry into the knowledge graph, and displays the results in the chat pane without modifying the user's link chart if any. Use this tool when the user is asking an exploratory question about their data as a whole that can be answered via cypher query, for example 'What are the top 5 suppliers by total parts cost?' or 'How many employees do we have in each department?'.",schema:Fr}),ee="generateCypher",Qr=d.object({prompt:d.string().describe("The user's inquiry into the knowledge graph that needs to be translated into a cypher query.")}),Gr=async({prompt:e},t)=>{let{knowledgeGraph:r}=await z(t),o=_.getDefault().helperServices;try{let{graphQuery:a,explanation:i}=await wr(e,r.dataModel,`${o.aiAssistantServices.url}${o.aiAssistantServices.graphQueryAssistant}`,t);return{toolName:ee,status:"success",summary:`Generated Graph Query:
128
+ ${a}
129
+
130
+ Explanation: ${i}`,details:{generatedQuery:a,explanation:i}}}catch(a){let i=k(a);return{toolName:ee,status:"error",errorMessage:`Failed to generate Cypher query. ${i}`,error:a}}},mn=g(Gr,{name:ee,description:"Generates an Open Cypher query based on the user's prompt which represents an inquiry into the data of the knowledge service and its graph database, attempting to filter based on certain conditions and traverse specified relationships. The generated query should be syntactically correct and optimized for performance.",schema:Qr}),Vr=e=>{let t=e.dataModel,r=new Map;for(let n of t.searchIndexes)if(n.supportedCategory!=="esriTypeMetaEntityProvenance")for(let[c,l]of n.searchProperties.entries()){let u=r.get(c)??new Set;l.propertyNames.forEach(p=>u.add(p)),r.set(c,u)}let o=t.entityTypes.filter(n=>r.has(n.name)),a=t.relationshipTypes.filter(n=>r.has(n.name)),i=`Entity Types:
131
+ ${o.map(({name:n})=>`${n}: [${Array.from(r.get(n)??[]).join(", ")}]`).join(`
132
+ `)}`,s=`Relationship Types:
133
+ ${a.map(({name:n})=>`${n}: [${Array.from(r.get(n)??[]).join(", ")}]`).join(`
134
+ `)}`;return`${i}
135
+
136
+ ${s}`};async function Br(e,t,r){let o=await L("arcgis_knowledge_lucene_generation_prompt"),a={inquiry:e,dataModelForSearch:Vr(t)},i=d.enum(["entity","relationship","both"]).describe("The graph element category to search against - entity, relationship, or both"),s=d.number().int().positive().nullable().describe("The maximum number of search results to return. Default to 10 if not specified by the user, or set to null if the user specifically requests no limits or all results."),n=d.array(d.enum(t.dataModel.entityTypes.map(l=>l.name).concat(t.dataModel.relationshipTypes.map(l=>l.name)))).min(1),c=d.object({query:d.string().describe("A lucene syntax query string to be executed against the knowledge graph search API"),typeFilters:n.nullable().describe("Nullable list of entity or relationship types from the graph to limit the search to. If set to null, search will execute against all named types with indexed properties in the graph"),typeCategoryFilter:i,resultLimit:s});return await ce({promptText:o,inputVariables:a,schema:c,config:r})}var te="searchGraphData",Kr=d.object({prompt:d.string().describe("The user's inquiry into the knowledge graph, from which a lucene search query will be generated and executed against the graph to return relevant results.")}),Ur=async({prompt:e},t)=>{let{knowledgeGraph:r}=await z(t);await b({text:"Generating search query for the user inquiry"},t);let o=await Br(e,r,t);await b({text:"Executing graph search with generated search query"},t);let a=await kr({kg:r,searchQuery:o.query,typeCategoryFilter:o.typeCategoryFilter,namedTypesFilter:o.typeFilters,searchResultLimit:o.resultLimit,requestOptions:{signal:G(t),timeout:t?.timeout}});if(a.type!=="success")return{toolName:te,status:"error",errorMessage:a.errorMessage,error:"error"in a?a.error:null};for(let n of a.results)E(n,c=>Ne(c));let i=10,s=a.results.slice(0,i);return{toolName:te,status:"success",summary:`To answer the query, the following lucene query was generated and executed:
137
+ Query: ${o.query}
138
+ Type Category Filter: ${o.typeCategoryFilter}
139
+ Named Type Filters: ${o.typeFilters?o.typeFilters.join(", "):"None"}
140
+ Result Limit: ${o.resultLimit??"No limit"}
141
+
142
+ Search Results: ${a.results.length} result(s) found.
143
+
144
+ ${a.results.length>i?`Showing top ${i} results:
145
+
146
+ `:""}${s.map(n=>JSON.stringify(n)).join(`
147
+ `)}`,details:{generatedSearchQuery:o,searchResults:a.results}}},hn=g(Ur,{name:te,description:`
148
+ Search the knowledge graph using one or more search texts, using lucene search syntax, against indexed string properties defined on their entities and relationships. Use this tool when the user asks a question about their knowledge graph data as a whole, that could be answered via lucene text search of properties stored on graph elements, e.g requiring fuzzy matching. Otherwise if the inquiry is looking for connected records (e.g. paths), data aggregations, etc explore the data via the queryGraphData tool.
149
+ Example prompts:
150
+ - "Find 'Bradley'"
151
+ - "find the person john smith"
152
+ - "find all people named smith"
153
+ - "Find all references to 'delayed parts shipment'"
154
+ - "Find all reports authored by someone with the title of 'Researcher'"
155
+ - "Find the first 5 reports where summary mentions flood zoning near Sacramento, and the organization name is the City of Sacramento Utilities, and tags containing stormwater".
156
+ - "Search for all john smiths and show their global ids`,schema:Kr});return{a:O,b:La,c:L,d:ct,e:Qa,f:Ga,g:dt,h:Va,i:Ba,j:Ka,k:Ua,l:Ha,m:Wa,n:Ja,o:Za,p:Ya,q:Xa,r:en,s:tn,t:rn,u:on,v:an,w:nn,x:sn,y:z,z:W,A:ln,B:cn,C:dn,D:un,E:pn,F:mn,G:hn}},"identity/IdentityManager","portal/Portal","request","config","core/reactiveUtils","layers/FeatureLayer","smartMapping/renderers/pieChart","smartMapping/symbology/pieChart","views/support/colorUtils","smartMapping/renderers/color","smartMapping/symbology/color","smartMapping/renderers/univariateColorSize","smartMapping/renderers/dotDensity","smartMapping/symbology/dotDensity","smartMapping/renderers/heatmap","smartMapping/symbology/heatmap","smartMapping/renderers/predominance","smartMapping/symbology/predominance","smartMapping/renderers/relationship","smartMapping/symbology/relationship","smartMapping/renderers/size","smartMapping/renderers/type","smartMapping/symbology/type","WebLinkChart","rest/knowledgeGraph/GraphQueryStreaming","views/LinkChartView","rest/knowledgeGraphService","rest/knowledgeGraph/GraphSearchStreaming","applications/KnowledgeStudio/generalSharedKgUtils",a,c,e,f,h,i)
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"./YIMNOUTF.js";var e=`# Navigation Tool Instructions
2
+ import"./UZLQALHY.js";var e=`# Navigation Tool Instructions
3
3
 
4
4
  CRITICAL: You are FORBIDDEN from making multiple tool calls. You MUST make exactly ONE tool call.
5
5
 
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import b from"./JKIESH74.js";import a from"./QNNGPA3Q.js";import"./ONQ6JSBJ.js";import"./AI6DYOKR.js";import"./VXFQANGJ.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([,a])=>{return a},a,b)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ var g=Object.create;var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(b,a)=>()=>{try{return a||b((a={exports:{}}).exports,a),a.exports}catch(c){throw a=0,c}},n=(b,a)=>{for(var c in a)e(b,c,{get:a[c],enumerable:!0})},l=(b,a,c,f)=>{if(a&&typeof a=="object"||typeof a=="function")for(let d of i(a))!k.call(b,d)&&d!==c&&e(b,d,{get:()=>a[d],enumerable:!(f=h(a,d))||f.enumerable});return b};var o=(b,a,c)=>(c=b!=null?g(j(b)):{},l(a||!b||!b.__esModule?e(c,"default",{value:b,enumerable:!0}):c,b));export{m as a,n as b,o as c};
@@ -0,0 +1,11 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import b from"./CCC6LBMY.js";import{a as N,b as O}from"./34O57OGV.js";import a from"./QNNGPA3Q.js";import{a as S}from"./ONQ6JSBJ.js";import{Dc as L}from"./AI6DYOKR.js";import{a as e}from"./VXFQANGJ.js";export default $arcgis.t(([{a:p,b:g,c:v,d:b},{d:j}])=>{var w=25,C=i=>i.flatMap(r=>r.split(",")).map(r=>r.trim()).map(r=>r.split(/\s+/u)[0]?.replace(/^"|"$/gu,"")).filter(r=>!!r),R=async(i,r,t,f)=>{let s=r.map?.allLayers.find(u=>u.id===i.layerId),l=await r.whenLayerView(s),h=s.title??i.layerId,c;if(t){let u=await v(t,r);if("error"in u){let o={error:u.error};if(g(t)){let d=r.map?.allLayers.find(m=>m.id===t.layerId);o.geometryLayerName=d?.title??d?.id,o.geometryLayerId=t.layerId,o.geometryWhere=t.where}else p(t)&&(o.point=t.point);return{tool:"queryFeatures",layerName:h,summary:"Geometry lookup failed",details:o}}if(!u.geometry){let o={};if(g(t)){let d=r.map?.allLayers.find(m=>m.id===t.layerId);o.error=`No features found matching: ${t.where}`,o.geometryLayerName=d?.title??d?.id,o.geometryLayerId=t.layerId,o.geometryWhere=t.where}else p(t)&&(o.error="Failed to create point geometry",o.point=t.point);return{tool:"queryFeatures",layerName:h,summary:"No features found for geometry filter",details:o}}c=u.geometry}else f&&(c=r.extent.clone());let x=[...new Set([...i.outFields,...C(i.orderByFields)])],F=N(l,x,f??!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,c&&(a.geometry=c,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 l.queryFeatureCount(a):await s.queryFeatureCount(a),n>0&&n<=w&&(y=F?await l.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:T}=y?j(s,y,r.timeZone):{objectIds:void 0,attributes:void 0};return{tool:"queryFeatures",layerName:h,summary:`${n} features found`,details:{totalCount:n,where:i.where,orderByFields:i.orderByFields,outFields:i.outFields,...q&&{objectIds:q,objectIdField:I},...T&&{attributes:T},...n>w&&{note:`${n} features found.`}}}};async function k({targetLayer:i,geometryFilter:r,useCurrentExtent:t},f){let{mapView:s}=S(f,["mapView"]),l=await R(i,s,r,t);return JSON.stringify(l,null,2)}var W=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:b.optional().describe("The units for the distance buffer.")}),B=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:b.optional().describe("The units for the distance buffer.")}),E=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 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([W,B]).optional().describe("Geometry filter for spatial queries. Use 'point' option with x/y coordinates from navigation results to find features at that location (point-in-polygon). Use 'layerId/where' option to filter by features from another layer."),useCurrentExtent: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).")}),P=L(k,{name:"queryFeatures",description:`Queries features from a layer. Returns the total count of matching features, plus individual feature attributes if \u226425 features match.
3
+
4
+ USE THIS TOOL FOR:
5
+ - "Show / display / list features where..." \u2014 finding and listing features
6
+ - "How many X are Y?" \u2014 counting features that match a condition
7
+ - "Which features..." / "Find features..." \u2014 identifying specific features
8
+ - Spatial queries \u2014 finding features near/within/intersecting other features
9
+ - Any question where the user wants to SEE or COUNT matching features
10
+
11
+ This is the DEFAULT tool for most queries. When in doubt, use this tool.`,schema:E});return P},a,b)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as s,b as i}from"./3UEKINYC.js";import{c as r}from"./RLEHNAIA.js";function c(e,n){let t=s(e.el,e.referenceElement);if(t)return t;let o=r(e.el,"arcgis-assistant"),a=s(e.el,o?.referenceElement);if(a)return a;throw new Error(`${n}: Reference element not found`)}function g(e,n){let t=c(e,n).view;if(!t)throw new Error(`${n}: Reference element does not have a view`);return t}function m(e){return typeof e=="function"}function w(e){let n=r(e.el,"arcgis-assistant");if(n===void 0)throw new Error("arcgis-assistant-agent must be used within an arcgis-assistant element");return n.register({agent:e.agent,getContext:async()=>await e.getContext?.()??e.context??{}}),n}function f(e){let n=i(e.el,e.referenceElement);if(n)return n;let t=r(e.el,"arcgis-assistant");return s(e.el,t?.referenceElement)||null}function E(e){let n=f(e);return n?n.view:null}export{g as a,m as b,w as c,E as d};
@@ -0,0 +1,134 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import"./UZLQALHY.js";var e=`# ArcGIS Knowledge Agent \u2014 Action Summary
3
+
4
+ You are a Knowledge Graph assistant that has executed tool calls to answer a user request.
5
+
6
+ ## Context
7
+
8
+ **Data model**
9
+ {dataModelSummary}
10
+
11
+ **Assigned task**
12
+ {assignedTask}
13
+
14
+ **User request**
15
+ {userRequest}
16
+
17
+ **Tool result**
18
+ {toolResult}
19
+
20
+ ---
21
+
22
+ ## Goal
23
+
24
+ Generate a concise, complete Markdown response using the tool results.
25
+
26
+ ---
27
+
28
+ ## Priority Rules (Strict Order)
29
+
30
+ ### 1. User Formatting Override (Highest Priority)
31
+
32
+ - If the user specifies a format (table, list, bullets, etc.):
33
+ - Use that format exactly
34
+ - Ignore ALL default formatting rules below
35
+ - Do NOT add summaries or extra sections unless requested
36
+
37
+ ---
38
+
39
+ ### 2. Default Output (When no override)
40
+
41
+ Produce:
42
+
43
+ - **Summary**: 1\u20132 sentences (no header, no bullets)
44
+ - **Results**: Minimal, well-formatted data
45
+ - **Note (optional)**:
46
+ - 1\u20132 italicized sentences describing tool limitations
47
+
48
+ #### Limits
49
+
50
+ - maxPreviewItems: 5
51
+
52
+ ---
53
+
54
+ ### 3. Output Constraints (Non-Negotiable)
55
+
56
+ - Output **valid Markdown only** (no JSON)
57
+ - Do NOT hallucinate data (entities, fields, counts, relationships)
58
+ - Do NOT include:
59
+ - reasoning
60
+ - classification labels
61
+ - follow-up questions
62
+ - next steps
63
+ - intro phrases (\u201CHere are\u2026\u201D)
64
+ - restating the question
65
+ - End immediately after the response
66
+
67
+ ---
68
+
69
+ ### 4. Data Handling Rules
70
+
71
+ - If results are empty \u2192 clearly state no results returned
72
+ - If insufficient data \u2192 state limitation, do NOT speculate
73
+ - Do NOT output:
74
+ - raw nested objects
75
+ - large arrays
76
+ - geometry
77
+ - Summarize complex structures
78
+ - Truncate long values with \`\u2026\`
79
+ - Show entities/relationships only once
80
+ - Use:
81
+ - \u201Centity\u201D (not node)
82
+ - \u201Crelationship\u201D (not edge)
83
+ - Hide \`globalid\` and \`objectid\` unless explicitly requested
84
+
85
+ ---
86
+
87
+ ### 5. Formatting Rules (Default Mode Only)
88
+
89
+ - No headers; use _italic labels_ if needed
90
+ - Use:
91
+ - bullets \u2192 single item summaries
92
+ - tables \u2192 multiple results (limit to 5 rows)
93
+ - Reduce columns to key fields only
94
+ - Format:
95
+ - dates \u2192 \u201Cday month year\u201D
96
+ - time separate from date
97
+
98
+ ---
99
+
100
+ ### 6. Result-Type Formatting
101
+
102
+ **SEARCH_HITS**
103
+
104
+ - Highlight top match (bullets)
105
+ - Table for remaining results
106
+
107
+ **ENTITIES**
108
+
109
+ - Group by type (if multiple)
110
+ - Show key properties only
111
+
112
+ **RELATIONSHIPS**
113
+
114
+ - Format: \`(entity) \u2014[relationship]\u2192 (entity)\`
115
+
116
+ **PATHS**
117
+
118
+ - Summary + 1-3 examples
119
+
120
+ ---
121
+
122
+ ## Internal Processing (Do NOT output)
123
+
124
+ Classify results into:
125
+
126
+ - SEARCH_HITS, ENTITIES, RELATIONSHIPS, PATHS
127
+
128
+ ## Failure Handling
129
+
130
+ - If data is insufficient \u2192 clearly state limitation
131
+ - Never infer or fabricate missing information
132
+
133
+ ---
134
+ `;export{e as default};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as u}from"./ONQ6JSBJ.js";import{Dc as d}from"./AI6DYOKR.js";import{Dd as s}from"./MWYBF3F3.js";async function f(o,a,n){let e=n.map?.allLayers.find(r=>r.id===o);if(!e)return{text:`Error: Layer with id ${o} not found`};let t=a?.trim()?a:"1=1",l=e.createQuery();l.where=t;try{let{extent:r,count:i}=await e.queryExtent(l);if(i===0)return{text:`No features found in ${e.title} matching: ${t}`,where:t};if(r)await n.goTo(r);else return{text:`Error: Unable to determine extent for ${e.title}`,where:t};let c={layerId:o,layerTitle:e.title??o,where:t,count:i};return{text:`Successfully zoomed to ${i} feature(s) in ${e.title} matching: ${t}`,where:t,sharedStatePatch:{lastNavigatedFeatures:{value:c}}}}catch(r){return console.error("Error in goToFeatures:",r),{text:`Error: ${r instanceof Error?r.message:"Unknown error"}`,where:t}}}async function h({layerId:o,where:a},n){let{mapView:e}=u(n,["mapView"]);return await f(o,a,e)}var m=s.object({layerId:s.string().describe("The layerId of the layer to zoom to."),where:s.string().describe("ArcGIS SQL-92 WHERE expression used for `query.where` on the selected layer. Start with a fresh filter for the current request unless the task explicitly refers to prior results. Use only field name values from the selected layer, not aliases. Use field metadata only to interpret intent: prefer LIKE '%value%' for string fields, and use =, <, >, BETWEEN, IN, IS NULL, AND/OR/NOT as appropriate for number/date fields. For coded-value domain fields, use the domain code already provided in layerInfo.domain.codedValues, never the display label. Respect range-domain bounds when they are provided. Do NOT include subqueries, nested SELECT, JOIN, GROUP BY, HAVING, ORDER BY, or semicolons.")}),E=d(h,{name:"goToFeatures",description:"Go to the features that match the given filter for the given layerId. Use coded-value domain codes from layer field metadata when building the WHERE clause.",schema:m});export{E as a};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{c as i,e as c}from"./ZLWWWTH4.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")