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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (300) 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 +121 -0
  36. package/dist/agents/tools/help/listFields/adapter.d.ts +11 -0
  37. package/dist/agents/tools/help/listFields/adapter.js +30 -0
  38. package/dist/agents/tools/navigation/goToAddress/adapter.d.ts +10 -0
  39. package/dist/agents/tools/navigation/goToAddress/adapter.js +60 -0
  40. package/dist/agents/tools/navigation/goToBookmark/adapter.d.ts +8 -0
  41. package/dist/agents/tools/navigation/goToBookmark/adapter.js +30 -0
  42. package/dist/agents/tools/navigation/goToFeatures/adapter.d.ts +8 -0
  43. package/dist/agents/tools/navigation/goToFeatures/adapter.js +50 -0
  44. package/dist/agents/tools/navigation/goToFullExtent/adapter.d.ts +8 -0
  45. package/dist/agents/tools/navigation/goToFullExtent/adapter.js +27 -0
  46. package/dist/agents/tools/navigation/goToHomeExtent/adapter.d.ts +8 -0
  47. package/dist/agents/tools/navigation/goToHomeExtent/adapter.js +24 -0
  48. package/dist/agents/tools/navigation/goToLayer/adapter.d.ts +8 -0
  49. package/dist/agents/tools/navigation/goToLayer/adapter.js +26 -0
  50. package/dist/agents/tools/navigation/goToScale/adapter.d.ts +8 -0
  51. package/dist/agents/tools/navigation/goToScale/adapter.js +21 -0
  52. package/dist/agents/tools/navigation/goToViewpoint/adapter.d.ts +8 -0
  53. package/dist/agents/tools/navigation/goToViewpoint/adapter.js +42 -0
  54. package/dist/agents/tools/navigation/goToZoom/adapter.d.ts +8 -0
  55. package/dist/agents/tools/navigation/goToZoom/adapter.js +21 -0
  56. package/dist/agents/tools/query/getAttribute/adapter.d.ts +8 -0
  57. package/dist/agents/tools/query/getAttribute/adapter.js +40 -0
  58. package/dist/agents/tools/query/getStatistics/adapter.d.ts +8 -0
  59. package/dist/agents/tools/query/getStatistics/adapter.js +157 -0
  60. package/dist/agents/tools/query/getTopFeatures/adapter.d.ts +8 -0
  61. package/dist/agents/tools/query/getTopFeatures/adapter.js +144 -0
  62. package/dist/agents/tools/query/queryFeatures/adapter.d.ts +8 -0
  63. package/dist/agents/tools/query/queryFeatures/adapter.js +130 -0
  64. package/dist/agents/tools/search/findRelevantFields/adapter.d.ts +8 -0
  65. package/dist/agents/tools/search/findRelevantFields/adapter.js +57 -0
  66. package/dist/agents/tools/search/findRelevantLayers/adapter.d.ts +8 -0
  67. package/dist/agents/tools/search/findRelevantLayers/adapter.js +38 -0
  68. package/dist/cdn/22KHSDJI.js +2 -0
  69. package/dist/cdn/2EY3BQQX.js +2 -0
  70. package/dist/cdn/{SWOXSJ62.js → 2O4DON37.js} +1 -1
  71. package/dist/cdn/34O57OGV.js +2 -0
  72. package/dist/cdn/{5W7S2RS4.js → 3UEKINYC.js} +1 -1
  73. package/dist/cdn/4OGR5QKS.js +2 -0
  74. package/dist/cdn/5FL5BTTX.js +66 -0
  75. package/dist/cdn/5HBAJ57P.js +2 -0
  76. package/dist/cdn/5K5ZY267.js +2 -0
  77. package/dist/cdn/5MK44FNO.js +2 -0
  78. package/dist/cdn/5WYRJMBW.js +2 -0
  79. package/dist/cdn/5X7EG7D2.js +2 -0
  80. package/dist/cdn/5XZLS7UO.js +2 -0
  81. package/dist/cdn/5ZFUGNRN.js +2 -0
  82. package/dist/cdn/655YIKL3.js +11 -0
  83. package/dist/cdn/6ECRQVHY.js +2 -0
  84. package/dist/cdn/6OOZSZRJ.js +2 -0
  85. package/dist/cdn/{D3TNNRP4.js → 6P44KOKX.js} +1 -1
  86. package/dist/cdn/6YYPVU7H.js +3 -0
  87. package/dist/cdn/7BCQMK6D.js +2 -0
  88. package/dist/cdn/7SRLZQVC.js +5 -0
  89. package/dist/cdn/7V6OSTFC.js +2 -0
  90. package/dist/cdn/7VAQUCBU.js +9 -0
  91. package/dist/cdn/7VUSIGEM.js +2 -0
  92. package/dist/cdn/ACJTJLZN.js +2 -0
  93. package/dist/cdn/AI6DYOKR.js +181 -0
  94. package/dist/cdn/AKD5UOVX.js +2 -0
  95. package/dist/cdn/ANRQWYU2.js +2 -0
  96. package/dist/cdn/{ZS2TZ6BF.js → AOVJ34QE.js} +1 -1
  97. package/dist/cdn/APFZY4PI.js +2 -0
  98. package/dist/cdn/B2JDVLA6.js +2 -0
  99. package/dist/cdn/BE7BRJZD.js +2 -0
  100. package/dist/cdn/{FL4W4VYN.js → BL273EGZ.js} +17 -1
  101. package/dist/cdn/C4FEETBZ.js +2 -0
  102. package/dist/cdn/C4JT4S5E.js +2 -0
  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/COH3QXWG.js +4 -0
  107. package/dist/cdn/CP5BVGJU.js +2 -0
  108. package/dist/cdn/D5UFYQHN.js +44 -0
  109. package/dist/cdn/EWLXNGKH.js +208 -0
  110. package/dist/cdn/EYOWRGDP.js +2 -0
  111. package/dist/cdn/F5NIRETW.js +2 -0
  112. package/dist/cdn/FDOMMK2M.js +2 -0
  113. package/dist/cdn/FG647IP6.js +2 -0
  114. package/dist/cdn/FJO4KNOZ.js +2 -0
  115. package/dist/cdn/FUF3NAU7.js +2 -0
  116. package/dist/cdn/FXP5UIQU.js +156 -0
  117. package/dist/cdn/{T537PKP4.js → FYZATVB3.js} +1 -1
  118. package/dist/cdn/G2EGT3CF.js +6 -0
  119. package/dist/cdn/G3SF6U2U.js +2 -0
  120. package/dist/cdn/G7OMHU2B.js +2 -0
  121. package/dist/cdn/HAEFC2SJ.js +2 -0
  122. package/dist/cdn/HDACNIZF.js +2 -0
  123. package/dist/cdn/HHFNQR6Z.js +2 -0
  124. package/dist/cdn/HHUQXL3R.js +2 -0
  125. package/dist/cdn/IBZ2NEAO.js +2 -0
  126. package/dist/cdn/{FX7UOGHP.js → ICBIUFK7.js} +1 -1
  127. package/dist/cdn/ICQCK5D3.js +2 -0
  128. package/dist/cdn/IHP25JWI.js +99 -0
  129. package/dist/cdn/IJVMUS2L.js +14 -0
  130. package/dist/cdn/J6A4AS7E.js +22 -0
  131. package/dist/cdn/J6SZIQJA.js +2 -0
  132. package/dist/cdn/JCOA24UH.js +3 -0
  133. package/dist/cdn/{NE7E52YR.js → JEBRN3EU.js} +9 -3
  134. package/dist/cdn/JO5ETMPS.js +2 -0
  135. package/dist/cdn/K2R6XVK3.js +2 -0
  136. package/dist/cdn/KITIP6J2.js +2 -0
  137. package/dist/cdn/KWD2ECTM.js +2 -0
  138. package/dist/cdn/{MODWHY3R.js → LAYVGCPL.js} +6 -4
  139. package/dist/cdn/{7RCQFLPP.js → LK7ZIQW6.js} +1 -1
  140. package/dist/cdn/LLUGJKAQ.js +2 -0
  141. package/dist/cdn/MWYBF3F3.js +66 -0
  142. package/dist/cdn/{VMXLYWUK.js → MXTXJKFE.js} +1 -1
  143. package/dist/cdn/MY47B3CE.js +3 -0
  144. package/dist/cdn/NEV6OZN3.js +71 -0
  145. package/dist/cdn/NNXISHCA.js +14 -0
  146. package/dist/cdn/NZSOJ726.js +2 -0
  147. package/dist/cdn/O4NVW75A.js +2 -0
  148. package/dist/cdn/OE3GW5LE.js +2 -0
  149. package/dist/cdn/{23EQTPO3.js → OKVLGJAG.js} +1 -1
  150. package/dist/cdn/ONQ6JSBJ.js +2 -0
  151. package/dist/cdn/OX64WOEL.js +22 -0
  152. package/dist/cdn/{LQ6R5YRN.js → PQ2DPOFM.js} +1 -1
  153. package/dist/cdn/PUHRBGKB.js +2 -0
  154. package/dist/cdn/Q57QWN5W.js +2 -0
  155. package/dist/cdn/QUKNPVAF.js +2 -0
  156. package/dist/cdn/R2PQVY4O.js +2 -0
  157. package/dist/cdn/R74ZHFA6.js +2 -0
  158. package/dist/cdn/RBE55SWR.js +2 -0
  159. package/dist/cdn/RHYNE5OE.js +2 -0
  160. package/dist/cdn/RLEHNAIA.js +2 -0
  161. package/dist/cdn/RVSTAUQS.js +2 -0
  162. package/dist/cdn/{X2ZDYHCG.js → SDWWUWAF.js} +10 -5
  163. package/dist/cdn/{GTLS44GI.js → SXM4NUT5.js} +1 -1
  164. package/dist/cdn/SZ2QSSB3.js +2 -0
  165. package/dist/cdn/T4RIGOXB.js +2 -0
  166. package/dist/cdn/TCH5I5LS.js +2 -0
  167. package/dist/cdn/TEPP7YPR.js +2 -0
  168. package/dist/cdn/TMVF2W5N.js +36 -0
  169. package/dist/cdn/TPULIO6I.js +34 -0
  170. package/dist/cdn/UDRKUVZP.js +2 -0
  171. package/dist/cdn/{6YMR4QSD.js → UHEYPSOR.js} +1 -1
  172. package/dist/cdn/UHNVDALX.js +18 -0
  173. package/dist/cdn/UZLQALHY.js +2 -0
  174. package/dist/cdn/V6HOUZPZ.js +2 -0
  175. package/dist/cdn/VAXH6RUQ.js +134 -0
  176. package/dist/cdn/VLLZ2FFU.js +2 -0
  177. package/dist/cdn/VOKXKU7M.js +56 -0
  178. package/dist/cdn/VXFQANGJ.js +2 -0
  179. package/dist/cdn/WGO5SER7.js +6 -0
  180. package/dist/cdn/WJXXOKGA.js +9 -0
  181. package/dist/cdn/WKTQVBFJ.js +2 -0
  182. package/dist/cdn/{2SJAOYZT.js → WSWB3B7B.js} +1 -1
  183. package/dist/cdn/XX6GHMNR.js +2 -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/Z5HWPSZN.js +2 -0
  188. package/dist/cdn/Z5W4V7RC.js +2 -0
  189. package/dist/cdn/ZDV4K4WG.js +2 -0
  190. package/dist/cdn/ZOEMBHRF.js +2 -0
  191. package/dist/cdn/ZRVZMPFN.js +2 -0
  192. package/dist/cdn/{ZTBA5PM7.js → ZU2FHVNK.js} +1 -1
  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 +1295 -2104
  204. package/dist/chunks/arcgisKnowledgeGraph.js +128 -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 +58 -0
  210. package/dist/chunks/converterUtils.js +66 -41
  211. package/dist/chunks/dataExplorationGraph.js +131 -182
  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 +35 -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 +39 -33
  223. package/dist/chunks/mergeWhereClauses.js +15 -0
  224. package/dist/chunks/navigationGraph.js +140 -116
  225. package/dist/chunks/navigation_intent_prompt.js +8 -2
  226. package/dist/chunks/orchestrator.js +444 -233
  227. package/dist/chunks/resolvePointGeometryFilter.js +92 -0
  228. package/dist/chunks/state.js +21 -27
  229. package/dist/chunks/toolCallResponse.js +14 -10
  230. package/dist/chunks/utils2.js +11 -11
  231. package/dist/components/arcgis-assistant/customElement.d.ts +82 -1
  232. package/dist/components/arcgis-assistant/customElement.js +332 -183
  233. package/dist/components/arcgis-assistant-agent/customElement.d.ts +13 -1
  234. package/dist/components/arcgis-assistant-agent/customElement.js +614 -10
  235. package/dist/components/arcgis-assistant-chat/customElement.js +22 -17
  236. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +20 -4
  237. package/dist/components/arcgis-assistant-help-agent/customElement.js +29 -7
  238. package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -0
  239. package/dist/components/arcgis-assistant-interrupt/customElement.js +11 -12
  240. package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +12 -8
  241. package/dist/components/arcgis-assistant-knowledge-agent/customElement.d.ts +7 -7
  242. package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +40 -16
  243. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +30 -7
  244. package/dist/components/arcgis-assistant-message/customElement.d.ts +3 -0
  245. package/dist/components/arcgis-assistant-message/customElement.js +9 -8
  246. package/dist/components/arcgis-assistant-message-block/customElement.js +1 -1
  247. package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +3 -0
  248. package/dist/components/arcgis-assistant-message-loading/customElement.js +11 -10
  249. package/dist/components/arcgis-assistant-message-text/customElement.d.ts +1 -0
  250. package/dist/components/arcgis-assistant-message-text/customElement.js +12 -12
  251. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +18 -4
  252. package/dist/components/arcgis-assistant-speech-input/customElement.js +34 -52
  253. package/dist/components/arcgis-assistant-user-message/customElement.d.ts +2 -0
  254. package/dist/components/arcgis-assistant-user-message/customElement.js +15 -10
  255. package/dist/docs/api.json +1 -1
  256. package/dist/docs/docs.json +1 -1
  257. package/dist/docs/vscode.html-custom-data.json +1 -1
  258. package/dist/docs/web-types.json +1 -1
  259. package/dist/loader.js +6 -6
  260. package/dist/oauth-callback.html +1 -1
  261. package/dist/orchestrator/orchestrator/orchestratorEvents.d.ts +78 -0
  262. package/dist/types/lumina.d.ts +5 -4
  263. package/dist/types/preact.d.ts +5 -4
  264. package/dist/types/react.d.ts +5 -4
  265. package/dist/types/stencil.d.ts +7 -6
  266. package/dist/utils/index.d.ts +65 -38
  267. package/dist/utils/index.js +56 -55
  268. package/package.json +32 -12
  269. package/dist/cdn/462JBSEV.js +0 -422
  270. package/dist/cdn/5QAHYX7Y.js +0 -5
  271. package/dist/cdn/64PJB5NU.js +0 -2
  272. package/dist/cdn/6AWNQHCO.js +0 -4
  273. package/dist/cdn/AXDZBBNL.js +0 -45
  274. package/dist/cdn/BIV2IPHH.js +0 -2
  275. package/dist/cdn/CCY4TSBO.js +0 -2
  276. package/dist/cdn/CTSALWEP.js +0 -2
  277. package/dist/cdn/D2N2NSRQ.js +0 -72
  278. package/dist/cdn/DOV5ZJ7M.js +0 -2
  279. package/dist/cdn/EEUCKMU7.js +0 -2
  280. package/dist/cdn/EGHBXLNG.js +0 -2
  281. package/dist/cdn/ETRWZ3MS.js +0 -108
  282. package/dist/cdn/EWI4V3GQ.js +0 -36
  283. package/dist/cdn/F2AHA4GB.js +0 -54
  284. package/dist/cdn/I6HNBTWY.js +0 -2
  285. package/dist/cdn/JBHNHHWO.js +0 -3
  286. package/dist/cdn/JOFUPKIB.js +0 -2
  287. package/dist/cdn/KMQ3SP4I.js +0 -5
  288. package/dist/cdn/KUEOKIQR.js +0 -2
  289. package/dist/cdn/LKRAPK4A.js +0 -165
  290. package/dist/cdn/NXKKG5TK.js +0 -2
  291. package/dist/cdn/OBUZ7HBN.js +0 -2
  292. package/dist/cdn/OIVRK7HT.js +0 -2
  293. package/dist/cdn/RUURNLTP.js +0 -2
  294. package/dist/cdn/RVOAPUBN.js +0 -2
  295. package/dist/cdn/TSZPHE7L.js +0 -22
  296. package/dist/cdn/VAZNJSKA.js +0 -16
  297. package/dist/cdn/VNQN5ZQO.js +0 -14
  298. package/dist/cdn/WIDTPVSU.js +0 -2
  299. package/dist/cdn/XER22VYQ.js +0 -3
  300. package/dist/cdn/YIMNOUTF.js +0 -2
@@ -0,0 +1,92 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import l from "@arcgis/core/geometry/Point.js";
3
+ import * as f from "@arcgis/core/geometry/operators/unionOperator.js";
4
+ import r from "zod";
5
+ const d = 750;
6
+ function m(e) {
7
+ return "point" in e && e.point !== void 0;
8
+ }
9
+ function y(e) {
10
+ return "layerId" in e && e.layerId !== void 0;
11
+ }
12
+ const v = async (e, n) => {
13
+ if (m(e)) {
14
+ const { point: t } = e;
15
+ return { geometry: new l({
16
+ x: t.x,
17
+ y: t.y,
18
+ spatialReference: t.spatialReference ? { wkid: t.spatialReference.wkid } : n.spatialReference
19
+ }) };
20
+ }
21
+ if (y(e)) {
22
+ const t = n.map?.allLayers.find(
23
+ (o) => o.id === e.layerId
24
+ );
25
+ if (!t)
26
+ return { error: `Could not find geometry layer with ID: ${e.layerId}` };
27
+ const a = t.title ?? t.id, s = e.where?.trim() || "1=1";
28
+ try {
29
+ const o = await t.queryFeatures({
30
+ where: s,
31
+ returnGeometry: !0,
32
+ outSpatialReference: n.spatialReference,
33
+ num: d + 1
34
+ });
35
+ if (!o.features.length)
36
+ return {
37
+ error: `No features found in geometry layer "${a}" with the specified where clause: ${s}`
38
+ };
39
+ if (o.features.length > d)
40
+ return {
41
+ error: `Geometry filter for layer "${a}" matched too many features (${o.features.length}+). Please narrow the geometry layer filter.`
42
+ };
43
+ const i = o.features.map((c) => c.geometry).filter((c) => !!c);
44
+ if (!i.length)
45
+ return { error: "No valid geometries found for the matched geometry layer features." };
46
+ const u = i.length === 1 ? i[0] : f.executeMany(i);
47
+ return u ? (u.spatialReference || (u.spatialReference = n.spatialReference), { geometry: u }) : { error: "Failed to combine geometries from geometry layer." };
48
+ } catch (o) {
49
+ return { error: `Failed to query geometry: ${String(o)}` };
50
+ }
51
+ }
52
+ return { error: "Invalid geometry configuration provided" };
53
+ }, h = ["feet", "kilometers", "meters", "miles", "nautical-miles", "us-nautical-miles"], p = r.enum(h), b = r.object({ id: r.string() }), R = r.object({
54
+ id: r.string(),
55
+ kind: r.literal("point"),
56
+ payload: r.object({
57
+ x: r.number(),
58
+ y: r.number(),
59
+ spatialReference: r.object({ wkid: r.number() }).optional()
60
+ })
61
+ }), S = r.object({
62
+ sharedResourceId: r.string().describe("ID of a point returned by listSharedResources for a previously geocoded address or place."),
63
+ distance: r.number().optional().describe("Optional buffer distance around the point."),
64
+ units: p.optional().describe("The units for the distance buffer.")
65
+ }), g = (e, n) => {
66
+ if (!e || !("sharedResourceId" in e))
67
+ return e;
68
+ if (!n)
69
+ throw new Error("Shared resources are unavailable in the tool runtime state.");
70
+ const t = n.find((s) => {
71
+ const o = b.safeParse(s);
72
+ return o.success && o.data.id === e.sharedResourceId;
73
+ });
74
+ if (!t)
75
+ throw new Error(`Shared resource not found: ${e.sharedResourceId}`);
76
+ const a = R.safeParse(t);
77
+ if (!a.success)
78
+ throw new Error(`Shared resource ${e.sharedResourceId} does not contain a valid point.`);
79
+ return {
80
+ point: a.data.payload,
81
+ distance: e.distance,
82
+ units: e.units
83
+ };
84
+ };
85
+ export {
86
+ m as a,
87
+ p as d,
88
+ v as g,
89
+ y as i,
90
+ g as r,
91
+ S as s
92
+ };
@@ -1,55 +1,47 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import { Annotation as s } from "@langchain/langgraph/web";
3
- const c = /* @__PURE__ */ new Set(["agentExecutionContext", "outputMessage", "summary", "status"]);
4
- function u() {
5
- return {
6
- assignedTask: "",
7
- messages: [],
8
- priorSteps: [],
9
- sharedState: {},
10
- userRequest: ""
11
- };
12
- }
13
- function i(r) {
14
- const n = [...new Set([...r].filter((t) => c.has(t)))];
2
+ import { Annotation as o } from "@langchain/langgraph/web";
3
+ import { c } from "./baseAgentState.js";
4
+ const i = /* @__PURE__ */ new Set(["agentExecutionContext", "outputMessage", "summary", "status"]);
5
+ function u(r) {
6
+ const n = [...new Set([...r].filter((t) => i.has(t)))];
15
7
  if (n.length !== 0)
16
- throw new Error(`ADK custom state cannot define reserved runtime fields: ${n.join(", ")}.`);
8
+ throw new Error(`custom state cannot define reserved runtime fields: ${n.join(", ")}.`);
17
9
  }
18
10
  function f(r) {
19
11
  const n = Object.entries(r);
20
12
  return Object.fromEntries(
21
13
  n.map(([t, e]) => [
22
14
  t,
23
- s({
24
- reducer: (o, a) => a,
15
+ o({
16
+ reducer: (s, a) => a,
25
17
  default: () => e
26
18
  })
27
19
  ])
28
20
  );
29
21
  }
30
22
  function m(r = {}) {
31
- i(Object.keys(r));
23
+ u(Object.keys(r));
32
24
  const n = f(r);
33
- return s.Root({
25
+ return o.Root({
34
26
  ...n,
35
- agentExecutionContext: s({
27
+ agentExecutionContext: o({
36
28
  reducer: (t, e) => ({
37
29
  ...t,
38
30
  ...e
39
31
  }),
40
- default: u
32
+ default: c
41
33
  }),
42
- outputMessage: s({
34
+ outputMessage: o({
43
35
  // Preserve the last meaningful user-facing message produced by the graph.
44
36
  reducer: (t = "", e) => typeof e == "string" && e.trim() ? e : t,
45
37
  default: () => ""
46
38
  }),
47
- summary: s({
39
+ summary: o({
48
40
  // Summary is a compact orchestrator-facing outcome, so replacement semantics are enough.
49
41
  reducer: (t = "", e) => typeof e == "string" ? e : t,
50
42
  default: () => ""
51
43
  }),
52
- status: s({
44
+ status: o({
53
45
  // Keep the first meaningful status until a later node explicitly replaces it.
54
46
  reducer: (t, e) => e ?? t,
55
47
  default: () => {
@@ -57,15 +49,17 @@ function m(r = {}) {
57
49
  })
58
50
  });
59
51
  }
60
- function l(r) {
52
+ function g(r) {
61
53
  const n = /* @__PURE__ */ new Set();
62
54
  for (const e of r)
63
- for (const o of Object.keys(e.shape ?? {}))
64
- n.add(o);
55
+ for (const s of Object.keys(e.shape ?? {}))
56
+ n.add(s);
65
57
  const t = Object.fromEntries([...n].map((e) => [e, void 0]));
66
58
  return m(t);
67
59
  }
68
60
  export {
69
61
  m as a,
70
- l as c
62
+ u as b,
63
+ g as c,
64
+ f as d
71
65
  };
@@ -1,29 +1,33 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
2
  import "@arcgis/core/identity/IdentityManager.js";
3
3
  import "@arcgis/core/portal/Portal.js";
4
+ import "@arcgis/core/request.js";
4
5
  import "@langchain/langgraph/web";
5
- import { s as r } from "./generateLayerDescriptions.js";
6
+ import "@arcgis/toolkit/string";
7
+ import "./generateLayerDescriptions.js";
6
8
  import "@langchain/core/messages";
9
+ import { s as a } 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
- const u = async (t, o) => {
13
- const a = t.tool_calls ?? [];
14
- if (a.length === 0) {
15
- await r({ text: `LLM did not request any tool calls: ${String(t?.content)}` }, o);
16
+ const x = async (t, o) => {
17
+ const i = t.tool_calls ?? [];
18
+ if (i.length === 0) {
19
+ await a({ text: `LLM did not request any tool calls: ${String(t?.content)}` }, o);
16
20
  return;
17
21
  }
18
22
  await Promise.all(
19
- a.map(
20
- async (i) => await r(
21
- { text: `LLM invoked ${i.name} tool with arguments: ${JSON.stringify(i.args, null, 2)}` },
23
+ i.map(
24
+ async (r) => await a(
25
+ { text: `LLM invoked ${r.name} tool with arguments: ${JSON.stringify(r.args, null, 2)}` },
22
26
  o
23
27
  )
24
28
  )
25
29
  );
26
30
  };
27
31
  export {
28
- u as h
32
+ x as h
29
33
  };
@@ -1,11 +1,11 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
2
  import { getClosestElement as i } from "@arcgis/toolkit/dom";
3
- import { g as r, a as o } from "./utils3.js";
3
+ import { g as s, a as o } from "./utils3.js";
4
4
  function c(e, t) {
5
- const s = r(e.el, e.referenceElement);
6
- if (s)
7
- return s;
8
- const n = i(e.el, "arcgis-assistant"), a = r(e.el, n?.referenceElement);
5
+ const r = s(e.el, e.referenceElement);
6
+ if (r)
7
+ return r;
8
+ const n = i(e.el, "arcgis-assistant"), a = s(e.el, n?.referenceElement);
9
9
  if (a)
10
10
  return a;
11
11
  throw new Error(`${t}: Reference element not found`);
@@ -23,16 +23,16 @@ function g(e) {
23
23
  const t = i(e.el, "arcgis-assistant");
24
24
  if (t === void 0)
25
25
  throw new Error("arcgis-assistant-agent must be used within an arcgis-assistant element");
26
- t.register({
26
+ return t.register({
27
27
  agent: e.agent,
28
28
  getContext: async () => await e.getContext?.() ?? e.context ?? {}
29
- });
29
+ }), t;
30
30
  }
31
31
  function l(e) {
32
32
  const t = o(e.el, e.referenceElement);
33
33
  if (t)
34
34
  return t;
35
- const s = i(e.el, "arcgis-assistant"), n = r(e.el, s?.referenceElement);
35
+ const r = i(e.el, "arcgis-assistant"), n = s(e.el, r?.referenceElement);
36
36
  return n || null;
37
37
  }
38
38
  function v(e) {
@@ -40,8 +40,8 @@ function v(e) {
40
40
  return t ? t.view : null;
41
41
  }
42
42
  export {
43
- g as a,
44
- v as b,
45
- w as i,
43
+ v as a,
44
+ w as b,
45
+ g as i,
46
46
  m as r
47
47
  };
@@ -1,5 +1,6 @@
1
1
  /// <reference path="../../index.d.ts" />
2
2
  import type Collection from "@arcgis/core/core/Collection.js";
3
+ import type { RuntimeSpanEvent } from "../../orchestrator/orchestrator/orchestratorEvents.js";
3
4
  import type { PublicLitElement as LitElement } from "@arcgis/lumina";
4
5
  import type { AssistantMessage, AssistantPromptSelectDetail, AssistantSlottableRequestDetail, ChatMessage, Interrupt } from "./types.js";
5
6
  import type { T9nMeta } from "@arcgis/lumina/controllers";
@@ -41,6 +42,11 @@ import type { ArcgisMap as ArcgisMap } from "@arcgis/map-components/components/a
41
42
  * for the included ArcGIS agents to function properly, as they rely on the map context to perform their tasks. This is not
42
43
  * a requirement for [custom agents](https://developers.arcgis.com/javascript/latest/agentic-apps/ai-custom-agents/).
43
44
  *
45
+ * ## Application Identification
46
+ * For applications that use the arcgis-assistant component, setting the [`applicationName`](https://developers.arcgis.com/javascript/latest/references/core/config/#Config-applicationName) property on the ArcGIS config object [`esriConfig`](https://developers.arcgis.com/javascript/latest/references/core/config/) is recommended.
47
+ * When provided, this value can help associate assistant activity and feedback with a specific application, where supported.
48
+ * This can make it easier to understand usage patterns and troubleshoot feedback.
49
+ *
44
50
  * ## Context
45
51
  *
46
52
  * Use the [referenceElement](https://developers.arcgis.com/javascript/latest/references/ai-components/components/arcgis-assistant/#referenceElement) property to provide a web map as context to the assistant and its agents.
@@ -84,13 +90,59 @@ export abstract class ArcgisAssistant extends LitElement {
84
90
  assistantLabel: string;
85
91
  stopButtonLabel: string;
86
92
  askButtonLabel: string;
93
+ stoppedByUserLabel: string;
94
+ noAgentsFoundMessage: string;
95
+ orchestratorInitializationErrorMessage: string;
96
+ signInErrorMessage: string;
97
+ signInRequiredMessage: string;
98
+ signInLabel: string;
99
+ signInToArcGISOnlineLabel: string;
100
+ noPortalInformationMessage: string;
101
+ readMoreLabel: string;
102
+ learnAboutWebMapEmbeddingsLabel: string;
103
+ waitingForUserInputMessage: string;
87
104
  } & T9nMeta<{
88
105
  assistantLabel: string;
89
106
  stopButtonLabel: string;
90
107
  askButtonLabel: string;
108
+ stoppedByUserLabel: string;
109
+ noAgentsFoundMessage: string;
110
+ orchestratorInitializationErrorMessage: string;
111
+ signInErrorMessage: string;
112
+ signInRequiredMessage: string;
113
+ signInLabel: string;
114
+ signInToArcGISOnlineLabel: string;
115
+ noPortalInformationMessage: string;
116
+ readMoreLabel: string;
117
+ learnAboutWebMapEmbeddingsLabel: string;
118
+ waitingForUserInputMessage: string;
91
119
  }>;
92
120
  /**
93
- * When `true`, disables the assistant avatar in the chat interface.
121
+ * The IDs of the agents available to automatic intent routing.
122
+ * A single ID still uses automatic routing and does not enable direct routing.
123
+ * This property cannot be used together with [alwaysUseAgentId](https://developers.arcgis.com/javascript/latest/references/ai-components/components/arcgis-assistant/#alwaysUseAgentId).
124
+ *
125
+ * @since 5.2
126
+ * @example
127
+ * ```js
128
+ * const assistant = document.querySelector("arcgis-assistant");
129
+ * assistant.allowedAgentIds = ["navigation", "help"];
130
+ * ```
131
+ */
132
+ accessor allowedAgentIds: readonly string[] | undefined;
133
+ /**
134
+ * The ID of the agent that should process every user message without intent routing.
135
+ * When this property is set, it cannot be used together with [allowedAgentIds](https://developers.arcgis.com/javascript/latest/references/ai-components/components/arcgis-assistant/#allowedAgentIds).
136
+ *
137
+ * @since 5.2
138
+ * @example
139
+ * ```html
140
+ * <arcgis-assistant always-use-agent-id="navigation"></arcgis-assistant>
141
+ * ```
142
+ */
143
+ accessor alwaysUseAgentId: string | undefined;
144
+ /**
145
+ * When `true`, displays the assistant avatar in the chat interface.
94
146
  *
95
147
  * @default false
96
148
  * @since 5.1
@@ -277,6 +329,21 @@ export abstract class ArcgisAssistant extends LitElement {
277
329
  * ```
278
330
  */
279
331
  accessor referenceElement: ArcgisMap | string | null;
332
+ /**
333
+ * When `true`, emits normalized runtime span events while processing requests.
334
+ *
335
+ * @default false
336
+ * @internal
337
+ * @since 5.2
338
+ */
339
+ accessor runtimeEventsEnabled: boolean;
340
+ /**
341
+ * When `true`, assistant text responses render after completion instead of streaming progressively.
342
+ *
343
+ * @default false
344
+ * @since 5.1
345
+ */
346
+ accessor streamingDisabled: boolean;
280
347
  /**
281
348
  * Prompts to suggest to the end user on load. These are intended to help users understand which questions they can ask.
282
349
  * This property should be set to establish boundaries for the end user. As all agents have limitations and LLMs can
@@ -298,6 +365,13 @@ export abstract class ArcgisAssistant extends LitElement {
298
365
  * ```
299
366
  */
300
367
  accessor suggestedPrompts: string[];
368
+ /**
369
+ * When `true`, displays the user avatar in the chat interface.
370
+ *
371
+ * @default false
372
+ * @since 5.2
373
+ */
374
+ accessor userAvatarEnabled: boolean;
301
375
  /**
302
376
  * Cancels the active interrupt, if one is pending.
303
377
  *
@@ -468,6 +542,12 @@ export abstract class ArcgisAssistant extends LitElement {
468
542
  * @since 5.1
469
543
  */
470
544
  readonly arcgisResponse: import("@arcgis/lumina").TargetedEvent<this, AssistantMessage>;
545
+ /**
546
+ * Emitted for each normalized runtime span lifecycle event produced while processing a request.
547
+ *
548
+ * @internal
549
+ */
550
+ readonly arcgisRuntime: import("@arcgis/lumina").TargetedEvent<this, RuntimeSpanEvent>;
471
551
  /**
472
552
  * Emitted when the assistant requests custom slotted content for an assistant message.
473
553
  *
@@ -523,6 +603,7 @@ export abstract class ArcgisAssistant extends LitElement {
523
603
  arcgisPromptSelect: ArcgisAssistant["arcgisPromptSelect"]["detail"];
524
604
  arcgisReady: ArcgisAssistant["arcgisReady"]["detail"];
525
605
  arcgisResponse: ArcgisAssistant["arcgisResponse"]["detail"];
606
+ arcgisRuntime: ArcgisAssistant["arcgisRuntime"]["detail"];
526
607
  arcgisSlottableRequest: ArcgisAssistant["arcgisSlottableRequest"]["detail"];
527
608
  arcgisSubmit: ArcgisAssistant["arcgisSubmit"]["detail"];
528
609
  };