@arcgis/ai-components 5.2.0-next.9 → 5.2.0-next.91

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 (315) 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 +4 -2
  6. package/dist/agent-utils/WorkflowAgent.d.ts +2 -2
  7. package/dist/agent-utils/WorkflowAgent.js +14 -15
  8. package/dist/agent-utils/index.d.ts +177 -0
  9. package/dist/agent-utils/index.js +167 -0
  10. package/dist/agent-utils/middlewares/trace.d.ts +2 -0
  11. package/dist/agent-utils/middlewares/trace.js +25 -33
  12. package/dist/agent-utils/tools/FunctionTool.d.ts +2 -2
  13. package/dist/agent-utils/types.d.ts +37 -8
  14. package/dist/agent-utils/workflows/ConditionalWorkflow.d.ts +2 -2
  15. package/dist/agent-utils/workflows/LoopWorkflow.d.ts +2 -2
  16. package/dist/agent-utils/workflows/ParallelWorkflow.d.ts +2 -2
  17. package/dist/agent-utils/workflows/RouterWorkflow.d.ts +2 -2
  18. package/dist/agent-utils/workflows/SequentialWorkflow.d.ts +2 -2
  19. package/dist/agent-utils/workflows/SwitchWorkflow.d.ts +2 -2
  20. package/dist/agentic-workflow/AgenticWorkflowRuntime.d.ts +24 -0
  21. package/dist/agentic-workflow/Edge.d.ts +16 -0
  22. package/dist/agentic-workflow/WebAgent.d.ts +39 -0
  23. package/dist/agentic-workflow/jsonTypes.d.ts +189 -0
  24. package/dist/agentic-workflow/nodes/AgentNode.d.ts +28 -0
  25. package/dist/agentic-workflow/nodes/BaseNode.d.ts +35 -0
  26. package/dist/agentic-workflow/nodes/EndMessageNode.d.ts +25 -0
  27. package/dist/agentic-workflow/nodes/StartNode.d.ts +21 -0
  28. package/dist/agentic-workflow/nodes/tools/ArcgisTool.d.ts +21 -0
  29. package/dist/agentic-workflow/types.d.ts +29 -0
  30. package/dist/agents/tools/filter/clearFilters/adapter.d.ts +8 -0
  31. package/dist/agents/tools/filter/clearFilters/adapter.js +22 -0
  32. package/dist/agents/tools/filter/resetMap/adapter.d.ts +8 -0
  33. package/dist/agents/tools/filter/resetMap/adapter.js +22 -0
  34. package/dist/agents/tools/filter/setFeatureEffect/adapter.d.ts +8 -0
  35. package/dist/agents/tools/filter/setFeatureEffect/adapter.js +109 -0
  36. package/dist/agents/tools/help/listFields/adapter.d.ts +11 -0
  37. package/dist/agents/tools/help/listFields/adapter.js +30 -0
  38. package/dist/agents/tools/navigation/goToAddress/adapter.d.ts +10 -0
  39. package/dist/agents/tools/navigation/goToAddress/adapter.js +52 -0
  40. package/dist/agents/tools/navigation/goToBookmark/adapter.d.ts +8 -0
  41. package/dist/agents/tools/navigation/goToBookmark/adapter.js +30 -0
  42. package/dist/agents/tools/navigation/goToFeatures/adapter.d.ts +8 -0
  43. package/dist/agents/tools/navigation/goToFeatures/adapter.js +50 -0
  44. package/dist/agents/tools/navigation/goToFullExtent/adapter.d.ts +8 -0
  45. package/dist/agents/tools/navigation/goToFullExtent/adapter.js +27 -0
  46. package/dist/agents/tools/navigation/goToHomeExtent/adapter.d.ts +8 -0
  47. package/dist/agents/tools/navigation/goToHomeExtent/adapter.js +24 -0
  48. package/dist/agents/tools/navigation/goToLayer/adapter.d.ts +8 -0
  49. package/dist/agents/tools/navigation/goToLayer/adapter.js +26 -0
  50. package/dist/agents/tools/navigation/goToScale/adapter.d.ts +8 -0
  51. package/dist/agents/tools/navigation/goToScale/adapter.js +21 -0
  52. package/dist/agents/tools/navigation/goToViewpoint/adapter.d.ts +8 -0
  53. package/dist/agents/tools/navigation/goToViewpoint/adapter.js +42 -0
  54. package/dist/agents/tools/navigation/goToZoom/adapter.d.ts +8 -0
  55. package/dist/agents/tools/navigation/goToZoom/adapter.js +21 -0
  56. package/dist/agents/tools/query/getAttribute/adapter.d.ts +8 -0
  57. package/dist/agents/tools/query/getAttribute/adapter.js +40 -0
  58. package/dist/agents/tools/query/getStatistics/adapter.d.ts +8 -0
  59. package/dist/agents/tools/query/getStatistics/adapter.js +154 -0
  60. package/dist/agents/tools/query/getTopFeatures/adapter.d.ts +8 -0
  61. package/dist/agents/tools/query/getTopFeatures/adapter.js +141 -0
  62. package/dist/agents/tools/query/queryFeatures/adapter.d.ts +8 -0
  63. package/dist/agents/tools/query/queryFeatures/adapter.js +127 -0
  64. package/dist/agents/tools/search/findRelevantFields/adapter.d.ts +8 -0
  65. package/dist/agents/tools/search/findRelevantFields/adapter.js +57 -0
  66. package/dist/agents/tools/search/findRelevantLayers/adapter.d.ts +8 -0
  67. package/dist/agents/tools/search/findRelevantLayers/adapter.js +38 -0
  68. package/dist/cdn/2EY3BQQX.js +2 -0
  69. package/dist/cdn/2PTPBAIN.js +2 -0
  70. package/dist/cdn/34O57OGV.js +2 -0
  71. package/dist/cdn/{AMP6IALT.js → 3UEKINYC.js} +1 -1
  72. package/dist/cdn/434TAA3J.js +2 -0
  73. package/dist/cdn/4EBLRHYE.js +2 -0
  74. package/dist/cdn/4HDDRBIY.js +2 -0
  75. package/dist/cdn/4KOV2NEI.js +9 -0
  76. package/dist/cdn/4NJ2FF7H.js +2 -0
  77. package/dist/cdn/4OGR5QKS.js +2 -0
  78. package/dist/cdn/4WIDLQUH.js +2 -0
  79. package/dist/cdn/5FL5BTTX.js +66 -0
  80. package/dist/cdn/5WYRJMBW.js +2 -0
  81. package/dist/cdn/5X7EG7D2.js +2 -0
  82. package/dist/cdn/5ZFUGNRN.js +2 -0
  83. package/dist/cdn/6HF36IKA.js +2 -0
  84. package/dist/cdn/6KFMRBAA.js +2 -0
  85. package/dist/cdn/6VJXUIXY.js +3 -0
  86. package/dist/cdn/7BCQMK6D.js +2 -0
  87. package/dist/cdn/7DFXYMEA.js +2 -0
  88. package/dist/cdn/7M6VKBTK.js +6 -0
  89. package/dist/cdn/7SRLZQVC.js +5 -0
  90. package/dist/cdn/7V6OSTFC.js +2 -0
  91. package/dist/cdn/7VAQUCBU.js +9 -0
  92. package/dist/cdn/7ZFAFKJT.js +2 -0
  93. package/dist/cdn/ACJTJLZN.js +2 -0
  94. package/dist/cdn/AI6DYOKR.js +181 -0
  95. package/dist/cdn/{ZS2TZ6BF.js → AOVJ34QE.js} +1 -1
  96. package/dist/cdn/APFZY4PI.js +2 -0
  97. package/dist/cdn/AT4XVTJR.js +44 -0
  98. package/dist/cdn/AZCIDPML.js +2 -0
  99. package/dist/cdn/{FL4W4VYN.js → BL273EGZ.js} +17 -1
  100. package/dist/cdn/C5ZL5Z52.js +18 -0
  101. package/dist/cdn/CCC6LBMY.js +2 -0
  102. package/dist/cdn/{5ZZGKP7N.js → CEKOEHB3.js} +1 -1
  103. package/dist/cdn/CJMUJXPL.js +2 -0
  104. package/dist/cdn/COL6QYGQ.js +2 -0
  105. package/dist/cdn/CP5BVGJU.js +2 -0
  106. package/dist/cdn/CZM4URK7.js +2 -0
  107. package/dist/cdn/DP6O6PMH.js +2 -0
  108. package/dist/cdn/{V2P4AIGG.js → EKB7CAMM.js} +1 -1
  109. package/dist/cdn/EWLXNGKH.js +208 -0
  110. package/dist/cdn/EYNEYD34.js +2 -0
  111. package/dist/cdn/FDDQ67BG.js +2 -0
  112. package/dist/cdn/FDOMMK2M.js +2 -0
  113. package/dist/cdn/FQH3HOFH.js +2 -0
  114. package/dist/cdn/{GGSZM7KV.js → FUZ77UGP.js} +6 -4
  115. package/dist/cdn/{ZLXN7NMF.js → FYZATVB3.js} +10 -8
  116. package/dist/cdn/GFEOVHJK.js +2 -0
  117. package/dist/cdn/HHFNQR6Z.js +2 -0
  118. package/dist/cdn/HIPQ3VRW.js +2 -0
  119. package/dist/cdn/HKSFWTWK.js +14 -0
  120. package/dist/cdn/HMUWQCXU.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/IHP25JWI.js +99 -0
  124. package/dist/cdn/J6A4AS7E.js +22 -0
  125. package/dist/cdn/J6SZIQJA.js +2 -0
  126. package/dist/cdn/{NE7E52YR.js → JEBRN3EU.js} +9 -3
  127. package/dist/cdn/JJJZ7FOM.js +2 -0
  128. package/dist/cdn/JKIESH74.js +2 -0
  129. package/dist/cdn/JO5ETMPS.js +2 -0
  130. package/dist/cdn/K2R6XVK3.js +2 -0
  131. package/dist/cdn/KCU4FWF7.js +2 -0
  132. package/dist/cdn/KITIP6J2.js +2 -0
  133. package/dist/cdn/KWD2ECTM.js +2 -0
  134. package/dist/cdn/{7RCQFLPP.js → LK7ZIQW6.js} +1 -1
  135. package/dist/cdn/LLUGJKAQ.js +2 -0
  136. package/dist/cdn/LPR72QZF.js +36 -0
  137. package/dist/cdn/{DHOVCT6R.js → MKOQJXQQ.js} +1 -1
  138. package/dist/cdn/MWYBF3F3.js +66 -0
  139. package/dist/cdn/NEV6OZN3.js +71 -0
  140. package/dist/cdn/OAKRPM7D.js +2 -0
  141. package/dist/cdn/{23EQTPO3.js → OKVLGJAG.js} +1 -1
  142. package/dist/cdn/OL5656NI.js +2 -0
  143. package/dist/cdn/ONQ6JSBJ.js +2 -0
  144. package/dist/cdn/OWTGH34K.js +2 -0
  145. package/dist/cdn/OYSPNIJI.js +156 -0
  146. package/dist/cdn/PEYYWXFE.js +2 -0
  147. package/dist/cdn/PKUDO2RC.js +3 -0
  148. package/dist/cdn/{LQ6R5YRN.js → PQ2DPOFM.js} +1 -1
  149. package/dist/cdn/PSYRZMX2.js +2 -0
  150. package/dist/cdn/PUHRBGKB.js +2 -0
  151. package/dist/cdn/Q57QWN5W.js +2 -0
  152. package/dist/cdn/QCFICJ7U.js +3 -0
  153. package/dist/cdn/QNNGPA3Q.js +2 -0
  154. package/dist/cdn/R74ZHFA6.js +2 -0
  155. package/dist/cdn/RBE55SWR.js +2 -0
  156. package/dist/cdn/RHYNE5OE.js +2 -0
  157. package/dist/cdn/RLEHNAIA.js +2 -0
  158. package/dist/cdn/RSNGZQCQ.js +2 -0
  159. package/dist/cdn/{X2ZDYHCG.js → SDWWUWAF.js} +10 -5
  160. package/dist/cdn/SHD6YFSR.js +2 -0
  161. package/dist/cdn/SUYWKYWI.js +22 -0
  162. package/dist/cdn/SZ2QSSB3.js +2 -0
  163. package/dist/cdn/T4RIGOXB.js +2 -0
  164. package/dist/cdn/{3PKJWIC3.js → TMZ6DF22.js} +1 -1
  165. package/dist/cdn/TPULIO6I.js +34 -0
  166. package/dist/cdn/U2D53TAX.js +14 -0
  167. package/dist/cdn/{6YMR4QSD.js → UHEYPSOR.js} +1 -1
  168. package/dist/cdn/UHZG7SKO.js +2 -0
  169. package/dist/cdn/UZLQALHY.js +2 -0
  170. package/dist/cdn/V52XWEGV.js +11 -0
  171. package/dist/cdn/V6F3HEK7.js +2 -0
  172. package/dist/cdn/V6HOUZPZ.js +2 -0
  173. package/dist/cdn/VAXH6RUQ.js +134 -0
  174. package/dist/cdn/VLLZ2FFU.js +2 -0
  175. package/dist/cdn/VNJMTA6O.js +2 -0
  176. package/dist/cdn/VOKXKU7M.js +56 -0
  177. package/dist/cdn/VXFQANGJ.js +2 -0
  178. package/dist/cdn/W5JPJWMM.js +2 -0
  179. package/dist/cdn/WKTQVBFJ.js +2 -0
  180. package/dist/cdn/WNNMKCKS.js +2 -0
  181. package/dist/cdn/WP7ORLSB.js +6 -0
  182. package/dist/cdn/WR2SQX3J.js +2 -0
  183. package/dist/cdn/X3COUAXY.js +4 -0
  184. package/dist/cdn/Y7XD7ZRD.js +2 -0
  185. package/dist/cdn/YEZ3AMNX.js +2 -0
  186. package/dist/cdn/YLVJA4ZE.js +2 -0
  187. package/dist/cdn/YQSU6IUO.js +2 -0
  188. package/dist/cdn/Z5W4V7RC.js +2 -0
  189. package/dist/cdn/ZLWWWTH4.js +2 -0
  190. package/dist/cdn/ZOEMBHRF.js +2 -0
  191. package/dist/cdn/ZQMBJ6MI.js +2 -0
  192. package/dist/cdn/{ZTBA5PM7.js → ZU2FHVNK.js} +1 -1
  193. package/dist/cdn/ZVGUAOXE.js +2 -0
  194. package/dist/cdn/agent-utils/index.js +2 -0
  195. package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +3 -0
  196. package/dist/cdn/agent-utils/middlewares/middleware.js +2 -0
  197. package/dist/cdn/agent-utils/middlewares/trace.js +2 -0
  198. package/dist/cdn/assets/assistant/t9n/messages.en.json +1 -1
  199. package/dist/cdn/assets/assistant-interrupt/t9n/messages.en.json +1 -1
  200. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.en.json +1 -0
  201. package/dist/cdn/assets/assistant-message/t9n/messages.en.json +1 -0
  202. package/dist/cdn/assets/assistant-message-loading/t9n/messages.en.json +1 -0
  203. package/dist/cdn/index.js +1 -1
  204. package/dist/chunks/adapter.js +1299 -2113
  205. package/dist/chunks/arcgisKnowledgeGraph.js +128 -72
  206. package/dist/chunks/arcgis_knowledge_current_lc_context.js +19 -2
  207. package/dist/chunks/arcgis_knowledge_current_map_context.js +31 -2
  208. package/dist/chunks/arcgis_knowledge_cypher_query_prompt.js +102 -0
  209. package/dist/chunks/arcgis_knowledge_summarize_result_prompt.js +116 -27
  210. package/dist/chunks/baseAgentState.js +56 -0
  211. package/dist/chunks/converterUtils.js +66 -41
  212. package/dist/chunks/dataExplorationGraph.js +133 -177
  213. package/dist/chunks/data_explore_query_prompt.js +9 -4
  214. package/dist/chunks/fetchAgentContext.js +13 -0
  215. package/dist/chunks/fetchService.js +10 -0
  216. package/dist/chunks/fieldStatistics.js +79 -0
  217. package/dist/chunks/formatFeatureAttributes.js +132 -0
  218. package/dist/chunks/generateLayerDescriptions.js +259 -282
  219. package/dist/chunks/helpGraph.js +35 -25
  220. package/dist/chunks/help_prompt.js +34 -17
  221. package/dist/chunks/index.js +11 -0
  222. package/dist/chunks/intent_prompt.js +16 -0
  223. package/dist/chunks/layerStylingGraph.js +37 -31
  224. package/dist/chunks/mergeWhereClauses.js +15 -0
  225. package/dist/chunks/navigationGraph.js +124 -103
  226. package/dist/chunks/navigation_intent_prompt.js +8 -2
  227. package/dist/chunks/orchestrator.js +298 -139
  228. package/dist/chunks/slottableRequestUtils.js +3 -7
  229. package/dist/chunks/state.js +21 -27
  230. package/dist/chunks/summarize_query_response_prompt.js +9 -7
  231. package/dist/chunks/toolCallResponse.js +14 -10
  232. package/dist/chunks/types.js +59 -0
  233. package/dist/chunks/utils2.js +11 -11
  234. package/dist/components/arcgis-assistant/customElement.d.ts +72 -0
  235. package/dist/components/arcgis-assistant/customElement.js +416 -172
  236. package/dist/components/arcgis-assistant/index.js +2 -3
  237. package/dist/components/arcgis-assistant/types.d.ts +14 -1
  238. package/dist/components/arcgis-assistant-agent/customElement.d.ts +13 -1
  239. package/dist/components/arcgis-assistant-agent/customElement.js +614 -10
  240. package/dist/components/arcgis-assistant-chat/customElement.d.ts +2 -1
  241. package/dist/components/arcgis-assistant-chat/customElement.js +23 -18
  242. package/dist/components/arcgis-assistant-chat-entry/customElement.d.ts +2 -0
  243. package/dist/components/arcgis-assistant-chat-entry/customElement.js +25 -18
  244. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +20 -4
  245. package/dist/components/arcgis-assistant-help-agent/customElement.js +29 -7
  246. package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -0
  247. package/dist/components/arcgis-assistant-interrupt/customElement.js +17 -14
  248. package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +24 -0
  249. package/dist/components/arcgis-assistant-interrupt-preview/index.js +2 -0
  250. package/dist/components/arcgis-assistant-knowledge-agent/customElement.d.ts +7 -7
  251. package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +40 -16
  252. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +30 -7
  253. package/dist/components/arcgis-assistant-message/customElement.d.ts +5 -0
  254. package/dist/components/arcgis-assistant-message/customElement.js +29 -26
  255. package/dist/components/arcgis-assistant-message/index.js +2 -0
  256. package/dist/components/arcgis-assistant-message-block/customElement.js +18 -11
  257. package/dist/components/arcgis-assistant-message-block/index.js +1 -0
  258. package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +7 -0
  259. package/dist/components/arcgis-assistant-message-loading/customElement.js +8 -7
  260. package/dist/components/arcgis-assistant-message-loading/index.js +1 -0
  261. package/dist/components/arcgis-assistant-message-text/customElement.d.ts +1 -0
  262. package/dist/components/arcgis-assistant-message-text/customElement.js +12 -12
  263. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +18 -4
  264. package/dist/components/arcgis-assistant-speech-input/customElement.js +34 -52
  265. package/dist/components/arcgis-assistant-suggested-prompts/customElement.js +8 -8
  266. package/dist/components/arcgis-assistant-user-message/customElement.d.ts +2 -0
  267. package/dist/components/arcgis-assistant-user-message/customElement.js +15 -10
  268. package/dist/docs/api.json +1 -1
  269. package/dist/docs/docs.json +1 -1
  270. package/dist/docs/vscode.html-custom-data.json +1 -1
  271. package/dist/docs/web-types.json +1 -1
  272. package/dist/loader.js +9 -8
  273. package/dist/oauth-callback.html +1 -1
  274. package/dist/orchestrator/orchestrator/orchestratorEvents.d.ts +78 -0
  275. package/dist/types/lumina.d.ts +10 -8
  276. package/dist/types/preact.d.ts +10 -8
  277. package/dist/types/react.d.ts +10 -8
  278. package/dist/types/stencil.d.ts +12 -10
  279. package/dist/utils/index.d.ts +8 -8
  280. package/dist/utils/index.js +56 -55
  281. package/package.json +32 -12
  282. package/dist/cdn/2AXF774U.js +0 -2
  283. package/dist/cdn/462JBSEV.js +0 -422
  284. package/dist/cdn/53ZCUPKK.js +0 -22
  285. package/dist/cdn/5QAHYX7Y.js +0 -5
  286. package/dist/cdn/5XRDJL7R.js +0 -14
  287. package/dist/cdn/7BCR6TUO.js +0 -2
  288. package/dist/cdn/7GH7VSB2.js +0 -2
  289. package/dist/cdn/7PLV4QH6.js +0 -2
  290. package/dist/cdn/AXDZBBNL.js +0 -45
  291. package/dist/cdn/DDLZOMUY.js +0 -2
  292. package/dist/cdn/EECZLT6C.js +0 -166
  293. package/dist/cdn/ETRWZ3MS.js +0 -108
  294. package/dist/cdn/F2AHA4GB.js +0 -54
  295. package/dist/cdn/FX5JFRDL.js +0 -2
  296. package/dist/cdn/H7422XUG.js +0 -2
  297. package/dist/cdn/HB5A5R2E.js +0 -2
  298. package/dist/cdn/I6HNBTWY.js +0 -2
  299. package/dist/cdn/I7SRZPVS.js +0 -72
  300. package/dist/cdn/IG6YKZH3.js +0 -3
  301. package/dist/cdn/JVIKKZND.js +0 -3
  302. package/dist/cdn/KMQ3SP4I.js +0 -5
  303. package/dist/cdn/MH5RPXHM.js +0 -2
  304. package/dist/cdn/NVI3I46B.js +0 -2
  305. package/dist/cdn/OAVEHGB6.js +0 -2
  306. package/dist/cdn/OH64RMOR.js +0 -4
  307. package/dist/cdn/P26NON3Z.js +0 -16
  308. package/dist/cdn/QR54T33D.js +0 -2
  309. package/dist/cdn/RVOAPUBN.js +0 -2
  310. package/dist/cdn/S3VPZFWQ.js +0 -36
  311. package/dist/cdn/SXDLXCIM.js +0 -2
  312. package/dist/cdn/TR7RL3IK.js +0 -2
  313. package/dist/cdn/USMDJUFS.js +0 -2
  314. package/dist/cdn/Y333DGV6.js +0 -2
  315. package/dist/cdn/YIMNOUTF.js +0 -2
@@ -1,18 +1,25 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
2
  import { StateGraph as d, START as g, END as i } from "@langchain/langgraph/web";
3
- import { l as h, g as x, f as p, r as f, t as y, H as u } from "./adapter.js";
3
+ import { g as h, r as f, t as x, H as u } from "./adapter.js";
4
4
  import "@arcgis/core/identity/IdentityManager.js";
5
5
  import "@arcgis/core/portal/Portal.js";
6
- import { j as S, s as c } from "./generateLayerDescriptions.js";
6
+ import "@arcgis/core/request.js";
7
+ import "@arcgis/toolkit/string";
8
+ import { h as y } from "./generateLayerDescriptions.js";
7
9
  import "@langchain/core/messages";
8
10
  import "@langchain/core/callbacks/dispatch/web";
11
+ import "@langchain/core/callbacks/base";
9
12
  import "@langchain/openai";
13
+ import "@arcgis/core/config.js";
10
14
  import "@arcgis/core/core/reactiveUtils.js";
11
15
  import "@arcgis/core/layers/FeatureLayer.js";
12
- import "@arcgis/core/request.js";
13
- import { ToolNode as E } from "@langchain/langgraph/prebuilt";
16
+ import { f as p } from "./fetchService.js";
17
+ import { listLayerFieldsTool as S } from "../agents/tools/help/listFields/adapter.js";
18
+ import { h as E } from "./toolCallResponse.js";
19
+ import { ToolNode as T } from "@langchain/langgraph/prebuilt";
20
+ import { s as m } from "./index.js";
14
21
  import "@langchain/core/prompts";
15
- const m = [h], v = (e) => {
22
+ const c = [S], v = (e) => {
16
23
  if (!e || e.size === 0)
17
24
  return "No layers available in this map.";
18
25
  const t = Array.from(e.values()).map(({ layerItem: r, fieldRegistry: s }, l) => {
@@ -25,26 +32,29 @@ const m = [h], v = (e) => {
25
32
  return `This map contains ${e.size} layer(s):
26
33
 
27
34
  ${t}`;
28
- }, T = (e) => {
35
+ }, C = (e) => {
29
36
  const t = e?.list() ?? [];
30
37
  return t.length ? t.map((r) => `- ${r.agent.name}: ${r.agent.description}`).join(`
31
38
  `) : "No agents currently available.";
32
39
  };
33
40
  async function _(e, t) {
34
- const r = await x("help_prompt"), s = p(t, "layersAndFieldsRegistry"), l = p(t, "agentRegistry");
41
+ const r = await h("help_prompt"), s = p(t, "layersAndFieldsRegistry"), l = p(t, "agentRegistry");
35
42
  try {
36
- const a = await S({
43
+ const a = await y({
37
44
  promptText: r,
38
- modelTier: "fast",
39
- tools: m,
45
+ modelTier: "default",
46
+ config: t,
47
+ tools: c,
40
48
  inputVariables: {
41
49
  layerSummary: v(s),
42
- agents: T(l),
50
+ agents: C(l),
43
51
  assignedTask: e.agentExecutionContext.assignedTask,
44
52
  userRequest: e.agentExecutionContext.userRequest,
45
53
  priorSteps: e.agentExecutionContext.priorSteps
46
54
  }
47
- }), o = (a.tool_calls?.length ?? 0) > 0, n = typeof a.text == "string" ? a.text.trim() : "";
55
+ });
56
+ await E(a, t);
57
+ const o = (a.tool_calls?.length ?? 0) > 0, n = typeof a.text == "string" ? a.text.trim() : "";
48
58
  return {
49
59
  ...e,
50
60
  helpInternalState: {
@@ -65,20 +75,20 @@ async function _(e, t) {
65
75
  };
66
76
  }
67
77
  }
68
- const C = (e, t) => f(["agentRegistry"], "Help Agent")(e, t);
69
- async function H(e, t) {
70
- const r = new E(m);
78
+ const H = (e, t) => f(["agentRegistry"], "Help Agent")(e, t);
79
+ async function b(e, t) {
80
+ const r = new T(c, { handleToolErrors: !1 });
71
81
  try {
72
82
  const s = e.helpInternalState.toolCallMessage;
73
83
  if (!s)
74
84
  throw new Error("helpToolCalling: missing helpInternalState.toolCallMessage");
75
85
  const a = (await r.invoke({ messages: [s] }, t)).messages.map((o) => o.text).join(`
76
86
  `);
77
- return await c({ text: `Finished executing help tool: ${a}` }, t), {
87
+ return await m({ text: `Finished executing help tool: ${a}` }, t), {
78
88
  ...e,
79
89
  outputMessage: a,
80
90
  status: "success",
81
- summary: a ? y(a) : "Help executed.",
91
+ summary: a ? x(a) : "Help executed.",
82
92
  helpInternalState: {
83
93
  ...e.helpInternalState,
84
94
  toolCallMessage: void 0
@@ -86,7 +96,7 @@ async function H(e, t) {
86
96
  };
87
97
  } catch (s) {
88
98
  const l = s instanceof Error ? s.message : String(s);
89
- return await c({ text: `Help tool execution failed: ${l}` }, t), {
99
+ return await m({ text: `Help tool execution failed: ${l}` }, t), {
90
100
  ...e,
91
101
  outputMessage: `Help tool execution failed: ${l}`,
92
102
  status: "failed",
@@ -98,7 +108,7 @@ async function H(e, t) {
98
108
  };
99
109
  }
100
110
  }
101
- const b = () => new d(u).addNode("requireHelpServices", C).addNode("agent", _).addNode("tools", H).addEdge(g, "requireHelpServices").addEdge("requireHelpServices", "agent").addConditionalEdges("agent", (t) => t.helpInternalState.toolCallMessage ? "tools" : i).addEdge("tools", i), M = String.raw`- **help** — Enables users to ask questions about the map, layers, fields, and it's capabilities.
111
+ const M = () => new d(u).addNode("requireHelpServices", H).addNode("agent", _).addNode("tools", b).addEdge(g, "requireHelpServices").addEdge("requireHelpServices", "agent").addConditionalEdges("agent", (t) => t.helpInternalState.toolCallMessage ? "tools" : i).addEdge("tools", i), k = String.raw`- **help** — Enables users to ask questions about the map, layers, fields, and it's capabilities.
102
112
 
103
113
  _Example: “Tell me about this map”_
104
114
  _Example: “List all layers in this map”_
@@ -107,17 +117,17 @@ const b = () => new d(u).addNode("requireHelpServices", C).addNode("agent", _).a
107
117
  _Example: “What can you do?”_
108
118
  _Example: “What can I ask”_
109
119
 
110
- Even if the user asks unrelated queries like "What are the vowels in English alphabet" or "How to cook", call this agent.
120
+ If the user asks unrelated queries like "What are the vowels in English alphabet" or "How to cook", call this agent so it can politely refuse and redirect to map-related questions.
111
121
 
112
- IF the user asks map related queries, but those that are not performed by any of the agents, call this agent so we can respond accordingly.
122
+ IF the user asks map related queries, but those that are not performed by any of the agents, call this agent so we can respond that the requested action is not supported.
113
123
  _Example: "Create a chart"_
114
- _Example: "Create a table"_`, D = {
124
+ _Example: "Create a table"_`, Q = {
115
125
  id: "help",
116
126
  name: "Help Agent",
117
- description: M,
118
- createGraph: b,
127
+ description: k,
128
+ createGraph: M,
119
129
  workspace: u
120
130
  };
121
131
  export {
122
- D as H
132
+ Q as H
123
133
  };
@@ -1,7 +1,28 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- const e = `## Map Query Gate
2
+ const n = `## Who you are
3
3
 
4
- ### Input
4
+ You are a map assistant embedded inside a GIS application. You have no knowledge of history, science, people, events, cooking, or anything outside of this map and its data. You only know what is described in the Map Context below.
5
+
6
+ If asked anything outside of that context, you simply don't have that information — respond naturally and redirect to something you _can_ help with, using specific layer and field names from the map context.
7
+
8
+ Example of how to handle unknown topics:
9
+ "I don't have information on that — I only know about this map. You could ask me to list all layers in the map, or capabilities of this assistant."
10
+
11
+ ---
12
+
13
+ ## Your capabilities
14
+
15
+ You can help users with:
16
+
17
+ - Listing the layers in this map
18
+ - Listing the fields in a specific layer (use the tool)
19
+ - Suggesting specific queries using actual layer and field names
20
+ - Summarizing what this map contains and what users can do with it
21
+ - Letting users know when a map-related action isn't supported (e.g. charts, tables), and that it may be added in the future
22
+
23
+ ---
24
+
25
+ ## Input
5
26
 
6
27
  Assigned task:
7
28
  {assignedTask}
@@ -12,11 +33,13 @@ Latest user request:
12
33
  Prior steps:
13
34
  {priorSteps}
14
35
 
15
- Use the assigned task as the primary instruction for the current query. The question will **not** be restated again here.
16
- Use the latest user request as supporting context when needed.
17
- Use prior steps only when needed to explain a previous result, failure, or likely next action.
36
+ Use the assigned task as the primary instruction. The question will **not** be restated again here.
37
+ Use the latest user request as supporting context.
38
+ Use prior steps only to explain a previous result, failure, or likely next action.
39
+
40
+ ---
18
41
 
19
- ### Map Context
42
+ ## Map Context
20
43
 
21
44
  {layerSummary}
22
45
 
@@ -24,15 +47,6 @@ Use prior steps only when needed to explain a previous result, failure, or likel
24
47
 
25
48
  {agents}
26
49
 
27
- ### Rules
28
-
29
- - "What layers are in this map?" → List the layer names
30
- - "What fields are in this layer?" → Call the tool to list the field names for that layer
31
- - "What can you do?" / "What can I ask?" → Suggest specific queries using EXACT layer and field names from the context above
32
- - "Tell me about this map" → Summarize layers and capabilities
33
- - "Create a chart of all wells ans their depth" → If a question is map related but not supported by available capabilities, say so. Add that support for this might be added in the future.
34
- - Questions completely unrelated to maps/GIS → Politely explain you only help with the map |
35
-
36
50
  ### Response Guidelines
37
51
 
38
52
  When suggesting what users can ask, be SPECIFIC using actual layer names:
@@ -46,12 +60,15 @@ For "what can I ask" responses, provide 3-5 specific example queries using field
46
60
  For off-topic questions:
47
61
  "I can only help with this map. Try asking me to filter [LayerName] by [FieldName], or zoom to a location."
48
62
 
49
- Rules:
63
+ ---
64
+
65
+ ## Format
50
66
 
51
67
  - Keep responses concise
52
68
  - Use bullet points for lists
53
69
  - Use new lines (\\n) and appropriate formatting in your response
70
+ - Use actual layer and field names from the map context in any suggestions
54
71
  `;
55
72
  export {
56
- e as default
73
+ n as default
57
74
  };
@@ -0,0 +1,11 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import { dispatchCustomEvent as e } from "@langchain/core/callbacks/dispatch/web";
3
+ const n = async (s, a) => {
4
+ await e("trace_message", s, a);
5
+ }, o = async (s, a) => {
6
+ await e("graph_ux_suggestion", s, a);
7
+ };
8
+ export {
9
+ o as a,
10
+ n as s
11
+ };
@@ -97,6 +97,20 @@ Do not reinterpret the request into a different form.
97
97
 
98
98
  ---
99
99
 
100
+ ## Follow-up Reference Resolution
101
+
102
+ If the latest user request refers to prior results or prior context using a referential phrase such as "these", "those", "them", "that set", "the previous results", "this", "it", "that one", "this parcel", "this location", or "that feature", then the request depends on earlier context.
103
+
104
+ This also applies to equivalent referential wording in other languages.
105
+
106
+ Resolve the reference using the most recent relevant chat history or successful prior step.
107
+
108
+ In this case, the \`assignedTask\` should be standalone and should preserve the referenced prior constraints while adding only the new constraint or question from the latest user request.
109
+
110
+ Do not leave ambiguous references like "these", "those", "them", "this", or "it" in \`assignedTask\` when they can be resolved from context.
111
+
112
+ ---
113
+
100
114
  ## Assigned Task Guidelines (IMPORTANT)
101
115
 
102
116
  - The \`assignedTask\` must match the user’s request exactly in meaning
@@ -106,6 +120,8 @@ Do not reinterpret the request into a different form.
106
120
 
107
121
  - Keep the task short, specific, and directly executable
108
122
  - Keep wording close to the user’s request with minimal transformation
123
+ - When resolving follow-up references, only replace the ambiguous reference with the resolved prior context; keep the rest of the user’s wording as close as possible.
124
+
109
125
  - Use only information explicitly present in the user request or provided context
110
126
 
111
127
  - The \`assignedTask\` may represent only part of the user’s request when multiple steps are necessary
@@ -1,28 +1,33 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import { NodeInterrupt as L, StateGraph as w, START as E, END as m } from "@langchain/langgraph/web";
2
+ import { NodeInterrupt as w, StateGraph as L, START as E, END as m } from "@langchain/langgraph/web";
3
3
  import "@arcgis/core/identity/IdentityManager.js";
4
4
  import "@arcgis/core/portal/Portal.js";
5
- import { s as i, j as I } from "./generateLayerDescriptions.js";
5
+ import "@arcgis/core/request.js";
6
+ import "@arcgis/toolkit/string";
7
+ import { h as v } from "./generateLayerDescriptions.js";
6
8
  import "@langchain/core/messages";
9
+ import { s as i } from "./index.js";
10
+ import "@langchain/core/callbacks/base";
7
11
  import "@langchain/openai";
12
+ import "@arcgis/core/config.js";
8
13
  import "@arcgis/core/core/reactiveUtils.js";
9
14
  import "@arcgis/core/layers/FeatureLayer.js";
10
- import "@arcgis/core/request.js";
11
15
  import "@langchain/core/prompts";
12
- import { f as p, z as v, A as R, B as T, C as F, D as C, E as A, F as $, I as N, J as b, K as q, L as M, g as _, r as j, M as S } from "./adapter.js";
13
- import { h as k } from "./toolCallResponse.js";
14
- import { ToolNode as V } from "@langchain/langgraph/prebuilt";
15
- const h = 0.7, z = 10, D = async (t, e) => {
16
+ import { f as g } from "./fetchService.js";
17
+ import { m as I, n as T, o as R, p as F, u as C, v as A, w as $, x as N, y as b, z as q, A as _, g as M, r as k, L as S } from "./adapter.js";
18
+ import { h as V } from "./toolCallResponse.js";
19
+ import { ToolNode as j } from "@langchain/langgraph/prebuilt";
20
+ const h = 0.7, z = 10, P = async (t, e) => {
16
21
  try {
17
22
  await i({ text: "Similarity search to find fields" }, e);
18
- const r = p(e, "fieldSearch"), a = p(e, "layersAndFieldsRegistry"), o = p(e, "embeddingCache"), n = await r.searchFields({
23
+ const r = g(e, "fieldSearch"), a = g(e, "layersAndFieldsRegistry"), o = g(e, "embeddingCache"), n = await r.searchFields({
19
24
  text: t.agentExecutionContext.assignedTask,
20
25
  layerIds: t.vectorSearchLayerIds,
21
26
  minScore: h,
22
27
  topResults: z,
23
28
  embeddingCache: o
24
- }), c = n.map(({ layerId: d, results: g }) => {
25
- const y = g.map((s) => ` - ${s.name} (${s.score.toFixed(2)})`).join(`
29
+ }), c = n.map(({ layerId: d, results: p }) => {
30
+ const y = p.map((s) => ` - ${s.name} (${s.score.toFixed(2)})`).join(`
26
31
  `);
27
32
  return `${a.get(d)?.layerItem.name ?? d}:
28
33
  ${y}`;
@@ -40,16 +45,16 @@ ${c}` : l = `No vector search results found for score over ${h}.`, await i({ tex
40
45
  e
41
46
  ), new Error(`Vector search failed: ${r instanceof Error ? r.message : String(r)}`);
42
47
  }
43
- }, P = 0.7, H = async (t, e) => {
48
+ }, D = 0.7, H = async (t, e) => {
44
49
  try {
45
50
  await i(
46
51
  { text: `Similarity search to find layers: ${t.agentExecutionContext.assignedTask}` },
47
52
  e
48
53
  );
49
- const r = p(e, "layerSearch"), a = p(e, "layersAndFieldsRegistry"), o = await r.searchLayers({
54
+ const r = g(e, "layerSearch"), a = g(e, "layersAndFieldsRegistry"), o = await r.searchLayers({
50
55
  text: t.agentExecutionContext.assignedTask,
51
- minScore: P
52
- }), n = o.map((d) => d.id), c = o.map(({ id: d, score: g }) => `${a.get(d)?.layerItem.name ?? d} (${g.toFixed(2)})`).join(`
56
+ minScore: D
57
+ }), n = o.map((d) => d.id), c = o.map(({ id: d, score: p }) => `${a.get(d)?.layerItem.name ?? d} (${p.toFixed(2)})`).join(`
53
58
  `);
54
59
  let l;
55
60
  return n.length > 0 ? l = `Vector search completed. Matching layers with scores:
@@ -64,9 +69,9 @@ ${c}` : l = "Vector search completed. No matching layers found.", await i({ text
64
69
  ), new Error(`Vector search failed: ${r instanceof Error ? r.message : String(r)}`);
65
70
  }
66
71
  }, f = [
67
- v,
68
- R,
72
+ I,
69
73
  T,
74
+ R,
70
75
  F,
71
76
  C,
72
77
  A,
@@ -74,7 +79,7 @@ ${c}` : l = "Vector search completed. No matching layers found.", await i({ text
74
79
  N,
75
80
  b,
76
81
  q,
77
- M
82
+ _
78
83
  ], x = (t, e = 3) => {
79
84
  const r = t.map((o, n) => o.type === "human" ? n : -1).filter((o) => o !== -1);
80
85
  if (r.length === 0)
@@ -83,19 +88,20 @@ ${c}` : l = "Vector search completed. No matching layers found.", await i({ text
83
88
  return t.slice(a);
84
89
  }, G = async (t, e) => {
85
90
  await i({ text: "Requesting LLM for layer query results" }, e);
86
- const r = await _("navigation_intent_prompt");
91
+ const r = await M("navigation_intent_prompt");
87
92
  if (!e?.configurable)
88
93
  throw new Error("config.configurable is required for layer query tools");
89
94
  const a = {
90
95
  layerFieldInfo: t.layerFieldInfo
91
- }, o = await I({
96
+ }, o = await v({
92
97
  promptText: r,
93
98
  modelTier: "advanced",
99
+ config: e,
94
100
  messages: x(t.agentExecutionContext.messages),
95
101
  inputVariables: a,
96
102
  tools: f
97
103
  });
98
- return await k(o, e), {
104
+ return await V(o, e), {
99
105
  ...t,
100
106
  agentExecutionContext: {
101
107
  ...t.agentExecutionContext,
@@ -103,8 +109,8 @@ ${c}` : l = "Vector search completed. No matching layers found.", await i({ text
103
109
  }
104
110
  };
105
111
  };
106
- async function B(t, e) {
107
- const a = await new V(f).invoke(
112
+ async function U(t, e) {
113
+ const a = await new j(f, { handleToolErrors: !1 }).invoke(
108
114
  {
109
115
  messages: x(t.agentExecutionContext.messages)
110
116
  },
@@ -116,7 +122,7 @@ async function B(t, e) {
116
122
  `);
117
123
  return { ...t, outputMessage: n };
118
124
  }
119
- const U = async (t, e) => (await i({ text: "Exiting Layer Styling agent" }, e), t), J = async (t, e) => {
125
+ const B = async (t, e) => (await i({ text: "Exiting Layer Styling agent" }, e), t), O = async (t, e) => {
120
126
  try {
121
127
  await i({ text: "Populating layer and field info" }, e);
122
128
  const r = [];
@@ -129,25 +135,25 @@ const U = async (t, e) => (await i({ text: "Exiting Layer Styling agent" }, e),
129
135
  s.description && `Description: ${s.description}`
130
136
  ].filter(Boolean).join(" | ") : y;
131
137
  };
132
- const { layerId: n, results: c } = a, l = p(e, "layersAndFieldsRegistry"), d = l.get(n)?.fieldRegistry;
138
+ const { layerId: n, results: c } = a, l = g(e, "layersAndFieldsRegistry"), d = l.get(n)?.fieldRegistry;
133
139
  if (!d)
134
140
  continue;
135
- let g = r.find((y) => y.layerId === n);
136
- g || (g = {
141
+ let p = r.find((y) => y.layerId === n);
142
+ p || (p = {
137
143
  layerId: n,
138
144
  layerSummary: o(n),
139
145
  fieldInfos: []
140
- }, r.push(g));
146
+ }, r.push(p));
141
147
  for (const y of c) {
142
148
  const s = d.get(y.name);
143
- s && g.fieldInfos.push(s);
149
+ s && p.fieldInfos.push(s);
144
150
  }
145
151
  }
146
152
  return await i({ text: "Populated layerFieldInfo" }, e), { ...t, layerFieldInfo: r };
147
153
  } catch (r) {
148
154
  throw await i({ text: "Error populating layerFieldInfo" }, e), new Error(`Error populating layerFieldInfo: ${r instanceof Error ? r.message : String(r)}`);
149
155
  }
150
- }, K = (t, e) => {
156
+ }, J = (t, e) => {
151
157
  const r = t.vectorSearchLayerIds ?? [];
152
158
  if (r.length <= 1)
153
159
  return { ...t, selectedLayerId: t.vectorSearchLayerIds[0] };
@@ -160,14 +166,14 @@ const U = async (t, e) => (await i({ text: "Exiting Layer Styling agent" }, e),
160
166
  message: "Choose a layer to apply the styles.",
161
167
  metadata: [...r]
162
168
  };
163
- throw new L(n);
169
+ throw new w(n);
164
170
  }
165
171
  let o = null;
166
172
  return Array.isArray(a.payload) && a.payload.length > 0 && (o = a.payload[0]), {
167
173
  ...t,
168
174
  selectedLayerId: o ?? t.vectorSearchLayerIds[0]
169
175
  };
170
- }, O = (t, e) => j(["layerSearch", "fieldSearch", "layersAndFieldsRegistry"], "Layer Styling Agent")(t, e), Q = () => new w(S).addNode("requireLayerStylingServices", O).addNode("vectorSearchLayers", H).addNode("layerSelectionHITL", K).addNode("vectorSearchFields", D).addNode("populateLayerFieldInfo", J).addNode("agent", G).addNode("tools", B).addNode("earlyExit", U).addEdge(E, "requireLayerStylingServices").addEdge("requireLayerStylingServices", "vectorSearchLayers").addConditionalEdges(
176
+ }, K = (t, e) => k(["layerSearch", "fieldSearch", "layersAndFieldsRegistry"], "Layer Styling Agent")(t, e), Q = () => new L(S).addNode("requireLayerStylingServices", K).addNode("vectorSearchLayers", H).addNode("layerSelectionHITL", J).addNode("vectorSearchFields", P).addNode("populateLayerFieldInfo", O).addNode("agent", G).addNode("tools", U).addNode("earlyExit", B).addEdge(E, "requireLayerStylingServices").addEdge("requireLayerStylingServices", "vectorSearchLayers").addConditionalEdges(
171
177
  "layerSelectionHITL",
172
178
  (e) => e.vectorSearchLayerIds.length ? "vectorSearchFields" : "earlyExit"
173
179
  ).addConditionalEdges(
@@ -0,0 +1,15 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ const r = (e, s, a) => {
3
+ if (!(a ? e.hasAllFeaturesInView : e.hasAllFeatures))
4
+ return !1;
5
+ const n = new Set((e.availableFields ?? []).map((t) => t.toLowerCase()));
6
+ return n.has("*") ? !0 : s.every((t) => n.has(t.toLowerCase()));
7
+ };
8
+ function u(e, s) {
9
+ let a = e ?? "";
10
+ return s != null && s && (a = a ? `(${a}) AND (${s})` : s), a || null;
11
+ }
12
+ export {
13
+ r as c,
14
+ u as m
15
+ };