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

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/7FY7WAA5.js +2 -0
  87. package/dist/cdn/7GMCLVSZ.js +2 -0
  88. package/dist/cdn/7M6VKBTK.js +6 -0
  89. package/dist/cdn/{GGSZM7KV.js → 7Q5EESAR.js} +6 -4
  90. package/dist/cdn/7SRLZQVC.js +5 -0
  91. package/dist/cdn/7TXR75RG.js +2 -0
  92. package/dist/cdn/7V6OSTFC.js +2 -0
  93. package/dist/cdn/7VAQUCBU.js +9 -0
  94. package/dist/cdn/7ZFAFKJT.js +2 -0
  95. package/dist/cdn/ACJTJLZN.js +2 -0
  96. package/dist/cdn/AI6DYOKR.js +181 -0
  97. package/dist/cdn/{ZS2TZ6BF.js → AOVJ34QE.js} +1 -1
  98. package/dist/cdn/APFZY4PI.js +2 -0
  99. package/dist/cdn/AT4XVTJR.js +44 -0
  100. package/dist/cdn/AZ5G7YZH.js +3 -0
  101. package/dist/cdn/{FL4W4VYN.js → BL273EGZ.js} +17 -1
  102. package/dist/cdn/BM3WFHJG.js +2 -0
  103. package/dist/cdn/{DHOVCT6R.js → BPCBE7J6.js} +1 -1
  104. package/dist/cdn/CCC6LBMY.js +2 -0
  105. package/dist/cdn/{5ZZGKP7N.js → CEKOEHB3.js} +1 -1
  106. package/dist/cdn/CJMUJXPL.js +2 -0
  107. package/dist/cdn/CP5BVGJU.js +2 -0
  108. package/dist/cdn/CZM4URK7.js +2 -0
  109. package/dist/cdn/DPALM2OW.js +2 -0
  110. package/dist/cdn/E7JZ7GUW.js +18 -0
  111. package/dist/cdn/EMLOVMD4.js +2 -0
  112. package/dist/cdn/EWLXNGKH.js +208 -0
  113. package/dist/cdn/F2J6BMMX.js +36 -0
  114. package/dist/cdn/FAR3DFFK.js +2 -0
  115. package/dist/cdn/FDOMMK2M.js +2 -0
  116. package/dist/cdn/{ZLXN7NMF.js → FYZATVB3.js} +10 -8
  117. package/dist/cdn/GFEOVHJK.js +2 -0
  118. package/dist/cdn/HDM2D2GD.js +2 -0
  119. package/dist/cdn/HHFNQR6Z.js +2 -0
  120. package/dist/cdn/HMUWQCXU.js +2 -0
  121. package/dist/cdn/I3ONG4AX.js +2 -0
  122. package/dist/cdn/IBZ2NEAO.js +2 -0
  123. package/dist/cdn/{FX7UOGHP.js → ICBIUFK7.js} +1 -1
  124. package/dist/cdn/IFJM5XEQ.js +2 -0
  125. package/dist/cdn/IHP25JWI.js +99 -0
  126. package/dist/cdn/J6A4AS7E.js +22 -0
  127. package/dist/cdn/J6SZIQJA.js +2 -0
  128. package/dist/cdn/{NE7E52YR.js → JEBRN3EU.js} +9 -3
  129. package/dist/cdn/JKIESH74.js +2 -0
  130. package/dist/cdn/JO5ETMPS.js +2 -0
  131. package/dist/cdn/JWIE3YK3.js +2 -0
  132. package/dist/cdn/K2R6XVK3.js +2 -0
  133. package/dist/cdn/KITIP6J2.js +2 -0
  134. package/dist/cdn/KPO4XX6J.js +2 -0
  135. package/dist/cdn/KWD2ECTM.js +2 -0
  136. package/dist/cdn/L7XTRDFM.js +3 -0
  137. package/dist/cdn/{7RCQFLPP.js → LK7ZIQW6.js} +1 -1
  138. package/dist/cdn/LLUGJKAQ.js +2 -0
  139. package/dist/cdn/LMPNXXTQ.js +2 -0
  140. package/dist/cdn/LYKCYBGB.js +2 -0
  141. package/dist/cdn/{3PKJWIC3.js → M2L5R4LA.js} +1 -1
  142. package/dist/cdn/{V2P4AIGG.js → M4URMXDS.js} +1 -1
  143. package/dist/cdn/MDAKBX7N.js +2 -0
  144. package/dist/cdn/MWYBF3F3.js +66 -0
  145. package/dist/cdn/NEV6OZN3.js +71 -0
  146. package/dist/cdn/NQDOAPE3.js +2 -0
  147. package/dist/cdn/OAKRPM7D.js +2 -0
  148. package/dist/cdn/{23EQTPO3.js → OKVLGJAG.js} +1 -1
  149. package/dist/cdn/ONMNQBPO.js +2 -0
  150. package/dist/cdn/ONQ6JSBJ.js +2 -0
  151. package/dist/cdn/OWTGH34K.js +2 -0
  152. package/dist/cdn/{LQ6R5YRN.js → PQ2DPOFM.js} +1 -1
  153. package/dist/cdn/PSYRZMX2.js +2 -0
  154. package/dist/cdn/PUHRBGKB.js +2 -0
  155. package/dist/cdn/Q57QWN5W.js +2 -0
  156. package/dist/cdn/QNNGPA3Q.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/RV55GABG.js +2 -0
  162. package/dist/cdn/RWWOOC7S.js +2 -0
  163. package/dist/cdn/{X2ZDYHCG.js → SDWWUWAF.js} +10 -5
  164. package/dist/cdn/T4RIGOXB.js +2 -0
  165. package/dist/cdn/TACBKKBI.js +2 -0
  166. package/dist/cdn/TMJMDCSA.js +4 -0
  167. package/dist/cdn/TPULIO6I.js +34 -0
  168. package/dist/cdn/U2D53TAX.js +14 -0
  169. package/dist/cdn/UEEH5ZQK.js +156 -0
  170. package/dist/cdn/{6YMR4QSD.js → UHEYPSOR.js} +1 -1
  171. package/dist/cdn/UHZG7SKO.js +2 -0
  172. package/dist/cdn/UZLQALHY.js +2 -0
  173. package/dist/cdn/V52XWEGV.js +11 -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/VNJMTA6O.js +2 -0
  178. package/dist/cdn/VOKXKU7M.js +56 -0
  179. package/dist/cdn/VXFQANGJ.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
@@ -1,14 +1,13 @@
1
- import "../arcgis-assistant-interrupt/index.js";
2
1
  import "@esri/calcite-components/components/calcite-notice";
3
2
  import "@esri/calcite-components/components/calcite-link";
4
- import "../arcgis-assistant-suggested-prompts/index.js";
5
3
  import "@esri/calcite-components/components/calcite-panel";
6
4
  import "../arcgis-assistant-chat/index.js";
7
5
  import "../arcgis-assistant-message/index.js";
8
- import "../arcgis-assistant-message-text/index.js";
9
6
  import "../arcgis-assistant-message-block/index.js";
10
7
  import "../arcgis-assistant-user-message/index.js";
11
8
  import "../arcgis-assistant-message-loading/index.js";
9
+ import "../arcgis-assistant-interrupt/index.js";
10
+ import "../arcgis-assistant-suggested-prompts/index.js";
12
11
  import "../arcgis-assistant-chat-entry/index.js";
13
12
  import "@esri/calcite-components/components/calcite-button";
14
13
  export * from "./customElement.js";
@@ -51,7 +51,7 @@ export interface AssistantMessage extends ChatMessageBase {
51
51
  * UI elements separate from the plain text transcript and can be used to display actions, follow-up prompts,
52
52
  * or app-registered custom content.
53
53
  */
54
- blocks?: UXSuggestion[];
54
+ blocks?: (UXSuggestion & { isPending?: boolean; })[];
55
55
  /**
56
56
  * Log messages related to the assistant's processing of the user's request. This can include information about
57
57
  * the agents or tools it invoked, the parameters generated by the LLM, and any relevant details about how it
@@ -71,6 +71,19 @@ export interface AssistantMessage extends ChatMessageBase {
71
71
  * performance over time.
72
72
  */
73
73
  feedback?: Feedback;
74
+ /**
75
+ * Indicates whether the message content is still being streamed from the assistant. This can be used to show loading
76
+ * indicators or placeholders in the UI until the full content is received.
77
+ */
78
+ isStreaming?: boolean;
79
+ /**
80
+ * An array of interrupts emitted by the assistant during the processing of the user's request. Each interrupt includes
81
+ * details about the type of interrupt, the message to display to the user, and any options for user input.
82
+ */
83
+ interrupts?: {
84
+ interrupt: Interrupt;
85
+ response?: string[] | boolean | string;
86
+ }[];
74
87
  }
75
88
 
76
89
  /**
@@ -1,6 +1,7 @@
1
1
  /// <reference path="../../index.d.ts" />
2
2
  import type { PublicLitElement as LitElement } from "@arcgis/lumina";
3
3
  import type { AgentRegistration } from "../../utils/index.js";
4
+ import type { AgenticWorkflowJson } from "../../agentic-workflow/jsonTypes.js";
4
5
 
5
6
  /**
6
7
  * The Assistant Agent component is a generic wrapper for registering custom agents to the [arcgis-assistant](https://developers.arcgis.com/javascript/latest/references/ai-components/components/arcgis-assistant/) component. To define
@@ -67,7 +68,6 @@ export abstract class ArcgisAssistantAgent<TContext = Record<string, unknown>> e
67
68
  * See the [Custom Agents guide](https://developers.arcgis.com/javascript/latest/agentic-apps/ai-custom-agents/) for more instructions
68
69
  * and links to samples demonstrating how to create custom agents.
69
70
  *
70
- * @required
71
71
  * @see [LangGraph documentation](https://docs.langchain.com/oss/javascript/langgraph/overview)
72
72
  * @see [Custom agents guide](https://developers.arcgis.com/javascript/latest/agentic-apps/ai-custom-agents/)
73
73
  * @example
@@ -138,4 +138,16 @@ export abstract class ArcgisAssistantAgent<TContext = Record<string, unknown>> e
138
138
  * ```
139
139
  */
140
140
  accessor context: TContext | (() => Promise<TContext | undefined> | TContext | undefined) | undefined;
141
+ /**
142
+ * The portal item ID associated with this assistant agent.
143
+ *
144
+ * @internal
145
+ */
146
+ accessor itemId: string | undefined;
147
+ /**
148
+ * The workflow JSON associated with this assistant agent.
149
+ *
150
+ * @internal
151
+ */
152
+ accessor workflow: AgenticWorkflowJson | undefined;
141
153
  }
@@ -1,19 +1,617 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import { c as t } from "../../chunks/runtime.js";
3
- import { LitElement as s } from "@arcgis/lumina";
4
- import { i as e, a as i } from "../../chunks/utils2.js";
5
- class n extends s {
2
+ import { c as q } from "../../chunks/runtime.js";
3
+ import { LitElement as M } from "@arcgis/lumina";
4
+ import { b as W, i as L } from "../../chunks/utils2.js";
5
+ import C from "@arcgis/core/portal/PortalItem.js";
6
+ import j from "@arcgis/core/portal/Portal.js";
7
+ import { property as n, subclass as l } from "@arcgis/core/core/accessorSupport/decorators.js";
8
+ import { BaseAgent as G } from "../../agent-utils/BaseAgent.js";
9
+ import b from "@arcgis/core/core/Error.js";
10
+ import { z as c } from "zod";
11
+ import { c as B } from "../../chunks/graph.js";
12
+ import T from "@arcgis/core/core/Accessor.js";
13
+ import { LLMAgent as z } from "../../agent-utils/LLMAgent.js";
14
+ import { PromptTemplate as Z } from "@langchain/core/prompts";
15
+ import { Annotation as x } from "@langchain/langgraph";
16
+ import { b as H, d as U } from "../../chunks/state.js";
17
+ import "@arcgis/core/identity/IdentityManager.js";
18
+ import "@arcgis/core/request.js";
19
+ import "@langchain/langgraph/web";
20
+ import "@arcgis/toolkit/string";
21
+ import "../../chunks/generateLayerDescriptions.js";
22
+ import "@langchain/core/messages";
23
+ import "@langchain/core/callbacks/dispatch/web";
24
+ import "@langchain/openai";
25
+ import "@arcgis/core/config.js";
26
+ import "@arcgis/core/core/reactiveUtils.js";
27
+ import "@arcgis/core/layers/FeatureLayer.js";
28
+ import { a as V } from "../../chunks/baseAgentState.js";
29
+ var K = Object.defineProperty, Q = Object.getOwnPropertyDescriptor, f = (t, e, r, s) => {
30
+ for (var o = s > 1 ? void 0 : s ? Q(e, r) : e, a = t.length - 1, i; a >= 0; a--)
31
+ (i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
32
+ return s && o && K(e, r, o), o;
33
+ };
34
+ let p = class extends T {
35
+ //#region Lifecycle
36
+ constructor(t) {
37
+ super(t);
38
+ }
39
+ //#endregion
40
+ //#region Public Methods
41
+ static fromJSON(t) {
42
+ return new p({
43
+ id: t.id,
44
+ sourceAnchorId: t.source_anchor_id,
45
+ sourceNodeId: t.source_node_id,
46
+ targetAnchorId: t.target_anchor_id,
47
+ targetNodeId: t.target_node_id
48
+ });
49
+ }
50
+ //#endregion
51
+ };
52
+ f([
53
+ n()
54
+ ], p.prototype, "id", 2);
55
+ f([
56
+ n()
57
+ ], p.prototype, "sourceAnchorId", 2);
58
+ f([
59
+ n()
60
+ ], p.prototype, "sourceNodeId", 2);
61
+ f([
62
+ n()
63
+ ], p.prototype, "targetAnchorId", 2);
64
+ f([
65
+ n()
66
+ ], p.prototype, "targetNodeId", 2);
67
+ p = f([
68
+ l("Edge")
69
+ ], p);
70
+ var X = Object.defineProperty, Y = Object.getOwnPropertyDescriptor, v = (t, e, r, s) => {
71
+ for (var o = s > 1 ? void 0 : s ? Y(e, r) : e, a = t.length - 1, i; a >= 0; a--)
72
+ (i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
73
+ return s && o && X(e, r, o), o;
74
+ };
75
+ let m = class extends T {
76
+ //#region Lifecycle
77
+ constructor(t) {
78
+ super(t);
79
+ }
80
+ //#endregion
81
+ //#region Public Methods
82
+ async load() {
83
+ return await Promise.resolve(this);
84
+ }
85
+ compile(t) {
86
+ return {
87
+ runtimeNode: this.createRuntimeNode(),
88
+ edges: t.outgoingEdges.map((e) => ({
89
+ from: this.id,
90
+ to: e.targetNodeId
91
+ }))
92
+ };
93
+ }
94
+ static fromJSON(t) {
95
+ throw new Error("BaseNode is abstract and cannot be instantiated directly.");
96
+ }
97
+ //#endregion
98
+ //#region Private Methods
99
+ //#endregion
100
+ };
101
+ v([
102
+ n()
103
+ ], m.prototype, "id", 2);
104
+ v([
105
+ n()
106
+ ], m.prototype, "label", 2);
107
+ v([
108
+ n()
109
+ ], m.prototype, "type", 2);
110
+ m = v([
111
+ l("BaseNode")
112
+ ], m);
113
+ function I(t) {
114
+ const e = new Set(t.required), r = Object.fromEntries(
115
+ Object.entries(t.properties).map(([s, o]) => {
116
+ const a = $(o);
117
+ return [s, e.has(s) ? a : a.optional()];
118
+ })
119
+ );
120
+ return c.object(r);
121
+ }
122
+ function $(t) {
123
+ let e;
124
+ switch (t.type) {
125
+ case "array":
126
+ e = c.array(t.items ? $(t.items) : c.unknown());
127
+ break;
128
+ case "boolean":
129
+ e = c.boolean();
130
+ break;
131
+ case "number":
132
+ e = c.number();
133
+ break;
134
+ case "object":
135
+ e = I({
136
+ properties: t.properties ?? {},
137
+ required: t.required
138
+ });
139
+ break;
140
+ case "string":
141
+ e = t.enum?.length ? c.enum(t.enum) : c.string();
142
+ break;
143
+ }
144
+ return t.description ? e.describe(t.description) : e;
145
+ }
146
+ const k = /* @__PURE__ */ new Map([
147
+ [
148
+ "clear_filters",
149
+ async () => (await import("../../agents/tools/filter/clearFilters/adapter.js")).clearFiltersTool
150
+ ],
151
+ [
152
+ "reset_map",
153
+ async () => (await import("../../agents/tools/filter/resetMap/adapter.js")).resetMapTool
154
+ ],
155
+ [
156
+ "set_feature_effect",
157
+ async () => (await import("../../agents/tools/filter/setFeatureEffect/adapter.js")).setFeatureEffectTool
158
+ ],
159
+ [
160
+ "list_layer_fields",
161
+ async () => (await import("../../agents/tools/help/listFields/adapter.js")).listLayerFieldsTool
162
+ ],
163
+ [
164
+ "go_to_address",
165
+ async () => (await import("../../agents/tools/navigation/goToAddress/adapter.js")).goToAddressTool
166
+ ],
167
+ [
168
+ "go_to_bookmark",
169
+ async () => (await import("../../agents/tools/navigation/goToBookmark/adapter.js")).goToBookmarkTool
170
+ ],
171
+ [
172
+ "go_to_features",
173
+ async () => (await import("../../agents/tools/navigation/goToFeatures/adapter.js")).goToFeaturesTool
174
+ ],
175
+ [
176
+ "go_to_full_extent",
177
+ async () => (await import("../../agents/tools/navigation/goToFullExtent/adapter.js")).goToFullExtentTool
178
+ ],
179
+ [
180
+ "go_to_home_extent",
181
+ async () => (await import("../../agents/tools/navigation/goToHomeExtent/adapter.js")).goToHomeExtentTool
182
+ ],
183
+ [
184
+ "go_to_layer",
185
+ async () => (await import("../../agents/tools/navigation/goToLayer/adapter.js")).goToLayerTool
186
+ ],
187
+ [
188
+ "go_to_scale",
189
+ async () => (await import("../../agents/tools/navigation/goToScale/adapter.js")).goToScaleTool
190
+ ],
191
+ [
192
+ "go_to_viewpoint",
193
+ async () => (await import("../../agents/tools/navigation/goToViewpoint/adapter.js")).goToViewpointTool
194
+ ],
195
+ [
196
+ "go_to_zoom",
197
+ async () => (await import("../../agents/tools/navigation/goToZoom/adapter.js")).goToZoomTool
198
+ ],
199
+ [
200
+ "find_relevant_fields",
201
+ async () => (await import("../../agents/tools/search/findRelevantFields/adapter.js")).findRelevantFieldsTool
202
+ ],
203
+ [
204
+ "find_relevant_layers",
205
+ async () => (await import("../../agents/tools/search/findRelevantLayers/adapter.js")).findRelevantLayersTool
206
+ ],
207
+ [
208
+ "get_attribute",
209
+ async () => (await import("../../agents/tools/query/getAttribute/adapter.js")).getAttributeTool
210
+ ],
211
+ [
212
+ "get_statistics",
213
+ async () => (await import("../../agents/tools/query/getStatistics/adapter.js")).getStatisticsTool
214
+ ],
215
+ [
216
+ "get_top_features",
217
+ async () => (await import("../../agents/tools/query/getTopFeatures/adapter.js")).getTopFeaturesTool
218
+ ],
219
+ [
220
+ "query_features",
221
+ async () => (await import("../../agents/tools/query/queryFeatures/adapter.js")).queryFeaturesTool
222
+ ]
223
+ ]);
224
+ async function tt(t) {
225
+ const e = k.get(t);
226
+ if (!e)
227
+ throw new Error(`ArcGIS tool is not supported in the browser runtime: ${t}`);
228
+ return await e();
229
+ }
230
+ var et = Object.defineProperty, ot = Object.getOwnPropertyDescriptor, N = (t, e, r, s) => {
231
+ for (var o = s > 1 ? void 0 : s ? ot(e, r) : e, a = t.length - 1, i; a >= 0; a--)
232
+ (i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
233
+ return s && o && et(e, r, o), o;
234
+ };
235
+ let d = class extends T {
236
+ //#region Lifecycle
237
+ constructor(t) {
238
+ super(t), this.type = "arcgis-tool";
239
+ }
240
+ //#endregion
241
+ //#region Public Methods
242
+ async createRuntimeTools() {
243
+ if (!this.name)
244
+ throw new Error("ArcgisTool name is required");
245
+ return [await tt(this.name)];
246
+ }
247
+ static fromJSON(t) {
248
+ return new d({
249
+ name: t.name,
250
+ requireApproval: t.require_approval
251
+ });
252
+ }
253
+ //#endregion
254
+ };
255
+ N([
256
+ n()
257
+ ], d.prototype, "name", 2);
258
+ N([
259
+ n()
260
+ ], d.prototype, "requireApproval", 2);
261
+ N([
262
+ n()
263
+ ], d.prototype, "type", 2);
264
+ d = N([
265
+ l("ArcgisTool")
266
+ ], d);
267
+ var rt = Object.defineProperty, st = Object.getOwnPropertyDescriptor, J = (t) => {
268
+ throw TypeError(t);
269
+ }, w = (t, e, r, s) => {
270
+ for (var o = s > 1 ? void 0 : s ? st(e, r) : e, a = t.length - 1, i; a >= 0; a--)
271
+ (i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
272
+ return s && o && rt(e, r, o), o;
273
+ }, at = (t, e, r) => e.has(t) || J("Cannot " + r), it = (t, e, r) => e.has(t) ? J("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), nt = (t, e, r) => (at(t, e, "access private method"), r), S, R;
274
+ let u = class extends m {
275
+ //#region Lifecycle
276
+ constructor(t) {
277
+ super(t), it(this, S), this.type = "agent-node";
278
+ }
279
+ //#endregion
280
+ //#region Public Methods
281
+ createRuntimeNode() {
282
+ let t;
283
+ return async (e, r) => {
284
+ t ??= nt(this, S, R).call(this);
285
+ const o = await (await t).run(e, r), a = this.outputSchema?.safeParse(o);
286
+ if (a && !a.success)
287
+ throw a.error;
288
+ const i = a?.data, O = i ?? o.outputMessage;
289
+ return {
290
+ agentExecutionContext: o.agentExecutionContext,
291
+ ...i ? {} : { outputMessage: o.outputMessage },
292
+ status: o.status,
293
+ summary: o.summary,
294
+ nodes: {
295
+ [this.id]: { output: O }
296
+ }
297
+ };
298
+ };
299
+ }
300
+ compile(t) {
301
+ const e = t.outgoingEdges[0]?.targetNodeId;
302
+ return {
303
+ runtimeNode: this.createRuntimeNode(),
304
+ edges: [
305
+ {
306
+ from: this.id,
307
+ decide: (r) => r.status === "failed" ? void 0 : e
308
+ }
309
+ ],
310
+ schemas: [
311
+ c.object({
312
+ output: this.outputSchema ?? c.string()
313
+ })
314
+ ]
315
+ };
316
+ }
317
+ static fromJSON(t) {
318
+ const e = new u({
319
+ id: t.id,
320
+ label: t.label,
321
+ prompt: t.prompt?.content,
322
+ type: "agent-node"
323
+ });
324
+ return t.structured_output && (e.outputSchema = I(t.structured_output)), e.tools = t.tools?.filter((r) => r.type === "arcgis_tool").map((r) => d.fromJSON(r)), e;
325
+ }
326
+ //#endregion
327
+ };
328
+ S = /* @__PURE__ */ new WeakSet();
329
+ R = async function() {
330
+ const t = this.prompt;
331
+ if (!t?.trim())
332
+ throw new Error(`WebAgent agent node "${this.id}" requires a prompt.`);
333
+ const e = [];
334
+ if (this.tools)
335
+ for (const r of this.tools) {
336
+ const s = await r.createRuntimeTools();
337
+ e.push(...s);
338
+ }
339
+ return new z({
340
+ name: this.id,
341
+ // TODO: change to label
342
+ outputSchema: this.outputSchema,
343
+ prompt: t,
344
+ tools: e
345
+ });
346
+ };
347
+ w([
348
+ n()
349
+ ], u.prototype, "type", 2);
350
+ w([
351
+ n()
352
+ ], u.prototype, "prompt", 2);
353
+ w([
354
+ n()
355
+ ], u.prototype, "outputSchema", 2);
356
+ w([
357
+ n()
358
+ ], u.prototype, "tools", 2);
359
+ u = w([
360
+ l("AgentNode")
361
+ ], u);
362
+ var ct = Object.defineProperty, pt = Object.getOwnPropertyDescriptor, A = (t, e, r, s) => {
363
+ for (var o = s > 1 ? void 0 : s ? pt(e, r) : e, a = t.length - 1, i; a >= 0; a--)
364
+ (i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
365
+ return s && o && ct(e, r, o), o;
366
+ };
367
+ let h = class extends m {
368
+ //#region Lifecycle
369
+ constructor(t) {
370
+ super(t), this.type = "end-message-node";
371
+ }
372
+ //#endregion
373
+ //#region Public Methods
374
+ createRuntimeNode() {
375
+ return async (t) => {
376
+ const e = await Z.fromTemplate(this.message, { templateFormat: "mustache" }).format(t);
377
+ return {
378
+ outputMessage: e,
379
+ status: "success",
380
+ summary: e
381
+ };
382
+ };
383
+ }
384
+ compile(t) {
385
+ return {
386
+ runtimeNode: this.createRuntimeNode(),
387
+ edges: []
388
+ };
389
+ }
390
+ static fromJSON(t) {
391
+ const e = new h({
392
+ id: t.id,
393
+ label: t.label,
394
+ type: "end-message-node"
395
+ });
396
+ return e.message = t.message, e;
397
+ }
398
+ //#endregion
399
+ //#region Private Methods
400
+ //#endregion
401
+ };
402
+ A([
403
+ n()
404
+ ], h.prototype, "type", 2);
405
+ A([
406
+ n()
407
+ ], h.prototype, "message", 2);
408
+ h = A([
409
+ l("EndMessageNode")
410
+ ], h);
411
+ var mt = Object.defineProperty, ut = Object.getOwnPropertyDescriptor, D = (t, e, r, s) => {
412
+ for (var o = s > 1 ? void 0 : s ? ut(e, r) : e, a = t.length - 1, i; a >= 0; a--)
413
+ (i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
414
+ return s && o && mt(e, r, o), o;
415
+ };
416
+ let _ = class extends m {
417
+ //#region Lifecycle
418
+ constructor(t) {
419
+ super(t), this.type = "start-node";
420
+ }
421
+ //#endregion
422
+ //#region Public Methods
423
+ createRuntimeNode() {
424
+ return (t) => ({ question: t.agentExecutionContext.userRequest });
425
+ }
426
+ static fromJSON(t) {
427
+ return new _({
428
+ id: t.id,
429
+ label: t.label,
430
+ type: "start-node"
431
+ });
432
+ }
433
+ //#endregion
434
+ //#region Private Methods
435
+ //#endregion
436
+ };
437
+ D([
438
+ n()
439
+ ], _.prototype, "type", 2);
440
+ _ = D([
441
+ l("StartNode")
442
+ ], _);
443
+ function dt(t) {
444
+ switch (t.type) {
445
+ case "agent_node":
446
+ return u.fromJSON(t);
447
+ case "end_message_node":
448
+ return h.fromJSON(t);
449
+ case "start_node":
450
+ return _.fromJSON(t);
451
+ default:
452
+ throw new Error(`WebAgent node "${t.id}" uses unsupported type "${t.type}".`);
453
+ }
454
+ }
455
+ function lt(t = {}) {
456
+ const e = Object.keys(t);
457
+ if (H(e), e.includes("nodes"))
458
+ throw new Error("node state cannot define reserved field: nodes.");
459
+ const r = U(t);
460
+ return x.Root({
461
+ ...r,
462
+ nodes: x({
463
+ reducer: (s, o) => ({ ...s, ...o }),
464
+ default: () => ({})
465
+ }),
466
+ ...V()
467
+ });
468
+ }
469
+ function F(t) {
470
+ const e = /* @__PURE__ */ new Set();
471
+ for (const s of t)
472
+ for (const o of Object.keys(s.shape ?? {}))
473
+ o !== "nodes" && e.add(o);
474
+ const r = Object.fromEntries([...e].map((s) => [s, void 0]));
475
+ return lt(r);
476
+ }
477
+ class P {
478
+ //#endregion Private Properties
479
+ //#region Lifecycle
480
+ constructor(e, r, s) {
481
+ this.sourceJSON = e, this.edges = r, this.nodes = s, this._loaded = !1;
482
+ }
483
+ //#endregion Lifecycle
484
+ //#region Public Methods
485
+ static fromJSON(e) {
486
+ return new P(
487
+ e,
488
+ e.graph.edges.map((r) => p.fromJSON(r)),
489
+ e.graph.nodes.map((r) => dt(r))
490
+ );
491
+ }
492
+ async load() {
493
+ return this._loadPromise ??= Promise.all(this.nodes.map(async (e) => await e.load())).then(() => {
494
+ this._loaded = !0;
495
+ }), await this._loadPromise, this;
496
+ }
497
+ getSchemas() {
498
+ const e = Object.fromEntries(
499
+ this._getNodeCompilations().flatMap((s, o) => {
500
+ const a = this.nodes[o];
501
+ return s.schemas?.map((i) => [a.id, i]) ?? [];
502
+ })
503
+ );
504
+ return [c.object({
505
+ loopCounts: c.record(c.string(), c.number()).optional(),
506
+ nodes: c.object(e).partial().optional(),
507
+ question: c.string().optional()
508
+ })];
509
+ }
510
+ generate() {
511
+ this._assertLoaded(), this._nodeCompilations = void 0;
512
+ const e = this._getNodeCompilations(), r = F(this.getSchemas()), s = this.nodes.find((i) => i.type === "start-node")?.id, o = {}, a = [];
513
+ for (const [i, O] of this.nodes.entries()) {
514
+ const y = e[i];
515
+ y && (y.runtimeNode && (o[O.id] = y.runtimeNode), a.push(...y.edges));
516
+ }
517
+ return {
518
+ createGraph: () => B(o, a, r, { entryNode: s }),
519
+ workspace: r
520
+ };
521
+ }
522
+ //#endregion Public Methods
523
+ //#region Private Methods
524
+ _assertLoaded() {
525
+ if (!this._loaded)
526
+ throw new Error("AgenticWorkflowRuntime must be loaded before it can generate a graph.");
527
+ }
528
+ _getNodeCompilations() {
529
+ return this._assertLoaded(), this._nodeCompilations ??= this.nodes.map(
530
+ (e) => e.compile({
531
+ outgoingEdges: this.edges.filter((r) => r.sourceNodeId === e.id)
532
+ })
533
+ );
534
+ }
535
+ //#endregion Private Methods
536
+ }
537
+ var ht = Object.defineProperty, gt = Object.getOwnPropertyDescriptor, E = (t, e, r, s) => {
538
+ for (var o = s > 1 ? void 0 : s ? gt(e, r) : e, a = t.length - 1, i; a >= 0; a--)
539
+ (i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
540
+ return s && o && ht(e, r, o), o;
541
+ };
542
+ const ft = () => {
543
+ throw new Error("WebAgent must be loaded before it can run.");
544
+ };
545
+ let g = class extends G {
546
+ //#region Lifecycle
547
+ constructor(t) {
548
+ super(t);
549
+ }
550
+ //#endregion
551
+ //#region Public Methods
552
+ async load() {
553
+ if (this.portalItem) {
554
+ try {
555
+ await this.portalItem.load();
556
+ } catch (r) {
557
+ throw new b("web-agent:load-portal-item", "Failed to load portal item", { error: r });
558
+ }
559
+ const e = await this.portalItem.fetchData();
560
+ if (this.sourceJSON = e, !this.portalItem.title)
561
+ throw new b("web-agent:missing-title", "The portal item is missing a title");
562
+ }
563
+ if (!this.sourceJSON)
564
+ throw new b("web-agent:missing-source-json", "The source JSON is missing");
565
+ if (!this.sourceJSON.description)
566
+ throw new b("web-agent:missing-description", "The source JSON is missing a description");
567
+ const t = P.fromJSON(this.sourceJSON);
568
+ return await t.load(), this._runtime = t, this.description = this.sourceJSON.description, this.name = this.portalItem?.title ?? `web-agent-${Date.now()}`, this.generate(), this;
569
+ }
570
+ getSchemas() {
571
+ return this._runtime?.getSchemas() ?? [];
572
+ }
573
+ generate() {
574
+ if (!this._runtime) {
575
+ this._set("workspace", F([])), this._set("createGraph", ft);
576
+ return;
577
+ }
578
+ const { createGraph: t, workspace: e } = this._runtime.generate();
579
+ this._set("workspace", e), this._set("createGraph", t);
580
+ }
581
+ //#endregion
582
+ };
583
+ E([
584
+ n({ type: C })
585
+ ], g.prototype, "portalItem", 2);
586
+ E([
587
+ n()
588
+ ], g.prototype, "sourceJSON", 2);
589
+ g = E([
590
+ l("WebAgent")
591
+ ], g);
592
+ class _t extends M {
6
593
  static {
7
- this.properties = { agent: 0, context: 0 };
594
+ this.properties = { agent: 0, context: 0, itemId: 1, workflow: 0 };
8
595
  }
596
+ #t;
9
597
  async getContext() {
10
- return e(this.context) ? await this.context() : this.context;
598
+ return W(this.context) ? await this.context() : this.context;
599
+ }
600
+ async load() {
601
+ let e;
602
+ if (this.itemId) {
603
+ const r = j.getDefault();
604
+ e = new g({ portalItem: new C({ id: this.itemId, portal: r }) });
605
+ } else this.workflow && (e = new g({ sourceJSON: this.workflow }));
606
+ if (e && (await e.load(), this.agent = e.registration), !this.agent)
607
+ throw new Error("Failed to initialize the assistant agent because the agent registration is missing.");
608
+ this.#t = L(this);
11
609
  }
12
- load() {
13
- i(this);
610
+ disconnectedCallback() {
611
+ this.#t?.unregister(this.agent.id), super.disconnectedCallback();
14
612
  }
15
613
  }
16
- t("arcgis-assistant-agent", n);
614
+ q("arcgis-assistant-agent", _t);
17
615
  export {
18
- n as ArcgisAssistantAgent
616
+ _t as ArcgisAssistantAgent
19
617
  };