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

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 +183 -0
  24. package/dist/agentic-workflow/nodes/AgentNode.d.ts +27 -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/4NJ2FF7H.js +2 -0
  76. package/dist/cdn/4OGR5QKS.js +2 -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/6U4GTCLJ.js +66 -0
  84. package/dist/cdn/6VJXUIXY.js +3 -0
  85. package/dist/cdn/7BCQMK6D.js +2 -0
  86. package/dist/cdn/7DFXYMEA.js +2 -0
  87. package/dist/cdn/7M6VKBTK.js +6 -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/7ZFAFKJT.js +2 -0
  92. package/dist/cdn/ACJTJLZN.js +2 -0
  93. package/dist/cdn/AI6DYOKR.js +181 -0
  94. package/dist/cdn/{ZS2TZ6BF.js → AOVJ34QE.js} +1 -1
  95. package/dist/cdn/APFZY4PI.js +2 -0
  96. package/dist/cdn/AT4XVTJR.js +44 -0
  97. package/dist/cdn/{FL4W4VYN.js → BL273EGZ.js} +17 -1
  98. package/dist/cdn/C5ZL5Z52.js +18 -0
  99. package/dist/cdn/CCC6LBMY.js +2 -0
  100. package/dist/cdn/{5ZZGKP7N.js → CEKOEHB3.js} +1 -1
  101. package/dist/cdn/CJMUJXPL.js +2 -0
  102. package/dist/cdn/COL6QYGQ.js +2 -0
  103. package/dist/cdn/CP5BVGJU.js +2 -0
  104. package/dist/cdn/CZM4URK7.js +2 -0
  105. package/dist/cdn/DP6O6PMH.js +2 -0
  106. package/dist/cdn/{V2P4AIGG.js → EKB7CAMM.js} +1 -1
  107. package/dist/cdn/EWLXNGKH.js +208 -0
  108. package/dist/cdn/EYNEYD34.js +2 -0
  109. package/dist/cdn/FDDQ67BG.js +2 -0
  110. package/dist/cdn/FDOMMK2M.js +2 -0
  111. package/dist/cdn/FQH3HOFH.js +2 -0
  112. package/dist/cdn/FULSCC5I.js +3 -0
  113. package/dist/cdn/{GGSZM7KV.js → FUZ77UGP.js} +6 -4
  114. package/dist/cdn/{ZLXN7NMF.js → FYZATVB3.js} +10 -8
  115. package/dist/cdn/GFEOVHJK.js +2 -0
  116. package/dist/cdn/HGDC6DEJ.js +9 -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/JQX7LNCN.js +2 -0
  131. package/dist/cdn/K2R6XVK3.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/{LQ6R5YRN.js → PQ2DPOFM.js} +1 -1
  148. package/dist/cdn/PSYRZMX2.js +2 -0
  149. package/dist/cdn/PUHRBGKB.js +2 -0
  150. package/dist/cdn/Q57QWN5W.js +2 -0
  151. package/dist/cdn/QNNGPA3Q.js +2 -0
  152. package/dist/cdn/R74ZHFA6.js +2 -0
  153. package/dist/cdn/RBE55SWR.js +2 -0
  154. package/dist/cdn/RHYNE5OE.js +2 -0
  155. package/dist/cdn/RLEHNAIA.js +2 -0
  156. package/dist/cdn/RSNGZQCQ.js +2 -0
  157. package/dist/cdn/{X2ZDYHCG.js → SDWWUWAF.js} +10 -5
  158. package/dist/cdn/SHD6YFSR.js +2 -0
  159. package/dist/cdn/SUYWKYWI.js +22 -0
  160. package/dist/cdn/SZ2QSSB3.js +2 -0
  161. package/dist/cdn/T4RIGOXB.js +2 -0
  162. package/dist/cdn/{3PKJWIC3.js → TMZ6DF22.js} +1 -1
  163. package/dist/cdn/TPULIO6I.js +34 -0
  164. package/dist/cdn/U2D53TAX.js +14 -0
  165. package/dist/cdn/{6YMR4QSD.js → UHEYPSOR.js} +1 -1
  166. package/dist/cdn/UHZG7SKO.js +2 -0
  167. package/dist/cdn/UZLQALHY.js +2 -0
  168. package/dist/cdn/V52XWEGV.js +11 -0
  169. package/dist/cdn/V6F3HEK7.js +2 -0
  170. package/dist/cdn/V6HOUZPZ.js +2 -0
  171. package/dist/cdn/VAXH6RUQ.js +134 -0
  172. package/dist/cdn/VLLZ2FFU.js +2 -0
  173. package/dist/cdn/VNJMTA6O.js +2 -0
  174. package/dist/cdn/VOKXKU7M.js +56 -0
  175. package/dist/cdn/VXFQANGJ.js +2 -0
  176. package/dist/cdn/W5JPJWMM.js +2 -0
  177. package/dist/cdn/WKTQVBFJ.js +2 -0
  178. package/dist/cdn/WNNMKCKS.js +2 -0
  179. package/dist/cdn/WP7ORLSB.js +6 -0
  180. package/dist/cdn/X3COUAXY.js +4 -0
  181. package/dist/cdn/XCW5WVZZ.js +2 -0
  182. package/dist/cdn/Y4T4FQJC.js +2 -0
  183. package/dist/cdn/Y7XD7ZRD.js +2 -0
  184. package/dist/cdn/YB7AS6XQ.js +3 -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 +412 -168
  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 +609 -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,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,618 @@
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/core/callbacks/base";
25
+ import "@langchain/openai";
26
+ import "@arcgis/core/config.js";
27
+ import "@arcgis/core/core/reactiveUtils.js";
28
+ import "@arcgis/core/layers/FeatureLayer.js";
29
+ import { a as V } from "../../chunks/baseAgentState.js";
30
+ var K = Object.defineProperty, Q = Object.getOwnPropertyDescriptor, f = (t, e, r, s) => {
31
+ for (var o = s > 1 ? void 0 : s ? Q(e, r) : e, a = t.length - 1, i; a >= 0; a--)
32
+ (i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
33
+ return s && o && K(e, r, o), o;
34
+ };
35
+ let p = class extends T {
36
+ //#region Lifecycle
37
+ constructor(t) {
38
+ super(t);
39
+ }
40
+ //#endregion
41
+ //#region Public Methods
42
+ static fromJSON(t) {
43
+ return new p({
44
+ id: t.id,
45
+ sourceAnchorId: t.source_anchor_id,
46
+ sourceNodeId: t.source_node_id,
47
+ targetAnchorId: t.target_anchor_id,
48
+ targetNodeId: t.target_node_id
49
+ });
50
+ }
51
+ //#endregion
52
+ };
53
+ f([
54
+ n()
55
+ ], p.prototype, "id", 2);
56
+ f([
57
+ n()
58
+ ], p.prototype, "sourceAnchorId", 2);
59
+ f([
60
+ n()
61
+ ], p.prototype, "sourceNodeId", 2);
62
+ f([
63
+ n()
64
+ ], p.prototype, "targetAnchorId", 2);
65
+ f([
66
+ n()
67
+ ], p.prototype, "targetNodeId", 2);
68
+ p = f([
69
+ l("Edge")
70
+ ], p);
71
+ var X = Object.defineProperty, Y = Object.getOwnPropertyDescriptor, v = (t, e, r, s) => {
72
+ for (var o = s > 1 ? void 0 : s ? Y(e, r) : e, a = t.length - 1, i; a >= 0; a--)
73
+ (i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
74
+ return s && o && X(e, r, o), o;
75
+ };
76
+ let m = class extends T {
77
+ //#region Lifecycle
78
+ constructor(t) {
79
+ super(t);
80
+ }
81
+ //#endregion
82
+ //#region Public Methods
83
+ async load() {
84
+ return await Promise.resolve(this);
85
+ }
86
+ compile(t) {
87
+ return {
88
+ runtimeNode: this.createRuntimeNode(),
89
+ edges: t.outgoingEdges.map((e) => ({
90
+ from: this.id,
91
+ to: e.targetNodeId
92
+ }))
93
+ };
94
+ }
95
+ static fromJSON(t) {
96
+ throw new Error("BaseNode is abstract and cannot be instantiated directly.");
97
+ }
98
+ //#endregion
99
+ //#region Private Methods
100
+ //#endregion
101
+ };
102
+ v([
103
+ n()
104
+ ], m.prototype, "id", 2);
105
+ v([
106
+ n()
107
+ ], m.prototype, "label", 2);
108
+ v([
109
+ n()
110
+ ], m.prototype, "type", 2);
111
+ m = v([
112
+ l("BaseNode")
113
+ ], m);
114
+ function I(t) {
115
+ const e = new Set(t.required), r = Object.fromEntries(
116
+ Object.entries(t.properties).map(([s, o]) => {
117
+ const a = $(o);
118
+ return [s, e.has(s) ? a : a.optional()];
119
+ })
120
+ );
121
+ return c.object(r);
122
+ }
123
+ function $(t) {
124
+ let e;
125
+ switch (t.type) {
126
+ case "array":
127
+ e = c.array(t.items ? $(t.items) : c.unknown());
128
+ break;
129
+ case "boolean":
130
+ e = c.boolean();
131
+ break;
132
+ case "number":
133
+ e = c.number();
134
+ break;
135
+ case "object":
136
+ e = I({
137
+ properties: t.properties ?? {},
138
+ required: t.required
139
+ });
140
+ break;
141
+ case "string":
142
+ e = t.enum?.length ? c.enum(t.enum) : c.string();
143
+ break;
144
+ }
145
+ return t.description ? e.describe(t.description) : e;
146
+ }
147
+ const k = /* @__PURE__ */ new Map([
148
+ [
149
+ "clear_filters",
150
+ async () => (await import("../../agents/tools/filter/clearFilters/adapter.js")).clearFiltersTool
151
+ ],
152
+ [
153
+ "reset_map",
154
+ async () => (await import("../../agents/tools/filter/resetMap/adapter.js")).resetMapTool
155
+ ],
156
+ [
157
+ "set_feature_effect",
158
+ async () => (await import("../../agents/tools/filter/setFeatureEffect/adapter.js")).setFeatureEffectTool
159
+ ],
160
+ [
161
+ "list_layer_fields",
162
+ async () => (await import("../../agents/tools/help/listFields/adapter.js")).listLayerFieldsTool
163
+ ],
164
+ [
165
+ "go_to_address",
166
+ async () => (await import("../../agents/tools/navigation/goToAddress/adapter.js")).goToAddressTool
167
+ ],
168
+ [
169
+ "go_to_bookmark",
170
+ async () => (await import("../../agents/tools/navigation/goToBookmark/adapter.js")).goToBookmarkTool
171
+ ],
172
+ [
173
+ "go_to_features",
174
+ async () => (await import("../../agents/tools/navigation/goToFeatures/adapter.js")).goToFeaturesTool
175
+ ],
176
+ [
177
+ "go_to_full_extent",
178
+ async () => (await import("../../agents/tools/navigation/goToFullExtent/adapter.js")).goToFullExtentTool
179
+ ],
180
+ [
181
+ "go_to_home_extent",
182
+ async () => (await import("../../agents/tools/navigation/goToHomeExtent/adapter.js")).goToHomeExtentTool
183
+ ],
184
+ [
185
+ "go_to_layer",
186
+ async () => (await import("../../agents/tools/navigation/goToLayer/adapter.js")).goToLayerTool
187
+ ],
188
+ [
189
+ "go_to_scale",
190
+ async () => (await import("../../agents/tools/navigation/goToScale/adapter.js")).goToScaleTool
191
+ ],
192
+ [
193
+ "go_to_viewpoint",
194
+ async () => (await import("../../agents/tools/navigation/goToViewpoint/adapter.js")).goToViewpointTool
195
+ ],
196
+ [
197
+ "go_to_zoom",
198
+ async () => (await import("../../agents/tools/navigation/goToZoom/adapter.js")).goToZoomTool
199
+ ],
200
+ [
201
+ "find_relevant_fields",
202
+ async () => (await import("../../agents/tools/search/findRelevantFields/adapter.js")).findRelevantFieldsTool
203
+ ],
204
+ [
205
+ "find_relevant_layers",
206
+ async () => (await import("../../agents/tools/search/findRelevantLayers/adapter.js")).findRelevantLayersTool
207
+ ],
208
+ [
209
+ "get_attribute",
210
+ async () => (await import("../../agents/tools/query/getAttribute/adapter.js")).getAttributeTool
211
+ ],
212
+ [
213
+ "get_statistics",
214
+ async () => (await import("../../agents/tools/query/getStatistics/adapter.js")).getStatisticsTool
215
+ ],
216
+ [
217
+ "get_top_features",
218
+ async () => (await import("../../agents/tools/query/getTopFeatures/adapter.js")).getTopFeaturesTool
219
+ ],
220
+ [
221
+ "query_features",
222
+ async () => (await import("../../agents/tools/query/queryFeatures/adapter.js")).queryFeaturesTool
223
+ ]
224
+ ]);
225
+ async function tt(t) {
226
+ const e = k.get(t);
227
+ if (!e)
228
+ throw new Error(`ArcGIS tool is not supported in the browser runtime: ${t}`);
229
+ return await e();
230
+ }
231
+ var et = Object.defineProperty, ot = Object.getOwnPropertyDescriptor, N = (t, e, r, s) => {
232
+ for (var o = s > 1 ? void 0 : s ? ot(e, r) : e, a = t.length - 1, i; a >= 0; a--)
233
+ (i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
234
+ return s && o && et(e, r, o), o;
235
+ };
236
+ let d = class extends T {
237
+ //#region Lifecycle
238
+ constructor(t) {
239
+ super(t), this.type = "arcgis-tool";
240
+ }
241
+ //#endregion
242
+ //#region Public Methods
243
+ async createRuntimeTools() {
244
+ if (!this.name)
245
+ throw new Error("ArcgisTool name is required");
246
+ return [await tt(this.name)];
247
+ }
248
+ static fromJSON(t) {
249
+ return new d({
250
+ name: t.name,
251
+ requireApproval: t.require_approval
252
+ });
253
+ }
254
+ //#endregion
255
+ };
256
+ N([
257
+ n()
258
+ ], d.prototype, "name", 2);
259
+ N([
260
+ n()
261
+ ], d.prototype, "requireApproval", 2);
262
+ N([
263
+ n()
264
+ ], d.prototype, "type", 2);
265
+ d = N([
266
+ l("ArcgisTool")
267
+ ], d);
268
+ var rt = Object.defineProperty, st = Object.getOwnPropertyDescriptor, J = (t) => {
269
+ throw TypeError(t);
270
+ }, w = (t, e, r, s) => {
271
+ for (var o = s > 1 ? void 0 : s ? st(e, r) : e, a = t.length - 1, i; a >= 0; a--)
272
+ (i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
273
+ return s && o && rt(e, r, o), o;
274
+ }, 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;
275
+ let u = class extends m {
276
+ //#region Lifecycle
277
+ constructor(t) {
278
+ super(t), it(this, S), this.type = "agent-node";
279
+ }
280
+ //#endregion
281
+ //#region Public Methods
282
+ createRuntimeNode() {
283
+ let t;
284
+ return async (e, r) => {
285
+ t ??= nt(this, S, R).call(this);
286
+ const o = await (await t).run(e, r), a = this.outputSchema?.safeParse(o);
287
+ if (a && !a.success)
288
+ throw a.error;
289
+ const i = a?.data, O = i ?? o.outputMessage;
290
+ return {
291
+ agentExecutionContext: o.agentExecutionContext,
292
+ ...i ? {} : { outputMessage: o.outputMessage },
293
+ status: o.status,
294
+ summary: o.summary,
295
+ nodes: {
296
+ [this.id]: { output: O }
297
+ }
298
+ };
299
+ };
300
+ }
301
+ compile(t) {
302
+ const e = t.outgoingEdges[0]?.targetNodeId;
303
+ return {
304
+ runtimeNode: this.createRuntimeNode(),
305
+ edges: [
306
+ {
307
+ from: this.id,
308
+ decide: (r) => r.status === "failed" ? void 0 : e
309
+ }
310
+ ],
311
+ schemas: [
312
+ c.object({
313
+ output: this.outputSchema ?? c.string()
314
+ })
315
+ ]
316
+ };
317
+ }
318
+ static fromJSON(t) {
319
+ const e = new u({
320
+ id: t.id,
321
+ label: t.label,
322
+ prompt: t.prompt?.content,
323
+ type: "agent-node"
324
+ });
325
+ 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;
326
+ }
327
+ //#endregion
328
+ };
329
+ S = /* @__PURE__ */ new WeakSet();
330
+ R = async function() {
331
+ const t = this.prompt;
332
+ if (!t?.trim())
333
+ throw new Error(`WebAgent agent node "${this.id}" requires a prompt.`);
334
+ const e = [];
335
+ if (this.tools)
336
+ for (const r of this.tools) {
337
+ const s = await r.createRuntimeTools();
338
+ e.push(...s);
339
+ }
340
+ return new z({
341
+ name: this.id,
342
+ // TODO: change to label
343
+ outputSchema: this.outputSchema,
344
+ prompt: t,
345
+ tools: e
346
+ });
347
+ };
348
+ w([
349
+ n()
350
+ ], u.prototype, "type", 2);
351
+ w([
352
+ n()
353
+ ], u.prototype, "prompt", 2);
354
+ w([
355
+ n()
356
+ ], u.prototype, "outputSchema", 2);
357
+ w([
358
+ n()
359
+ ], u.prototype, "tools", 2);
360
+ u = w([
361
+ l("AgentNode")
362
+ ], u);
363
+ var ct = Object.defineProperty, pt = Object.getOwnPropertyDescriptor, A = (t, e, r, s) => {
364
+ for (var o = s > 1 ? void 0 : s ? pt(e, r) : e, a = t.length - 1, i; a >= 0; a--)
365
+ (i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
366
+ return s && o && ct(e, r, o), o;
367
+ };
368
+ let h = class extends m {
369
+ //#region Lifecycle
370
+ constructor(t) {
371
+ super(t), this.type = "end-message-node";
372
+ }
373
+ //#endregion
374
+ //#region Public Methods
375
+ createRuntimeNode() {
376
+ return async (t) => {
377
+ const e = await Z.fromTemplate(this.message, { templateFormat: "mustache" }).format(t);
378
+ return {
379
+ outputMessage: e,
380
+ status: "success",
381
+ summary: e
382
+ };
383
+ };
384
+ }
385
+ compile(t) {
386
+ return {
387
+ runtimeNode: this.createRuntimeNode(),
388
+ edges: []
389
+ };
390
+ }
391
+ static fromJSON(t) {
392
+ const e = new h({
393
+ id: t.id,
394
+ label: t.label,
395
+ type: "end-message-node"
396
+ });
397
+ return e.message = t.message, e;
398
+ }
399
+ //#endregion
400
+ //#region Private Methods
401
+ //#endregion
402
+ };
403
+ A([
404
+ n()
405
+ ], h.prototype, "type", 2);
406
+ A([
407
+ n()
408
+ ], h.prototype, "message", 2);
409
+ h = A([
410
+ l("EndMessageNode")
411
+ ], h);
412
+ var mt = Object.defineProperty, ut = Object.getOwnPropertyDescriptor, D = (t, e, r, s) => {
413
+ for (var o = s > 1 ? void 0 : s ? ut(e, r) : e, a = t.length - 1, i; a >= 0; a--)
414
+ (i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
415
+ return s && o && mt(e, r, o), o;
416
+ };
417
+ let _ = class extends m {
418
+ //#region Lifecycle
419
+ constructor(t) {
420
+ super(t), this.type = "start-node";
421
+ }
422
+ //#endregion
423
+ //#region Public Methods
424
+ createRuntimeNode() {
425
+ return (t) => ({ question: t.agentExecutionContext.userRequest });
426
+ }
427
+ static fromJSON(t) {
428
+ return new _({
429
+ id: t.id,
430
+ label: t.label,
431
+ type: "start-node"
432
+ });
433
+ }
434
+ //#endregion
435
+ //#region Private Methods
436
+ //#endregion
437
+ };
438
+ D([
439
+ n()
440
+ ], _.prototype, "type", 2);
441
+ _ = D([
442
+ l("StartNode")
443
+ ], _);
444
+ function dt(t) {
445
+ switch (t.type) {
446
+ case "agent_node":
447
+ return u.fromJSON(t);
448
+ case "end_message_node":
449
+ return h.fromJSON(t);
450
+ case "start_node":
451
+ return _.fromJSON(t);
452
+ default:
453
+ throw new Error(`WebAgent node "${t.id}" uses unsupported type "${t.type}".`);
454
+ }
455
+ }
456
+ function lt(t = {}) {
457
+ const e = Object.keys(t);
458
+ if (H(e), e.includes("nodes"))
459
+ throw new Error("node state cannot define reserved field: nodes.");
460
+ const r = U(t);
461
+ return x.Root({
462
+ ...r,
463
+ nodes: x({
464
+ reducer: (s, o) => ({ ...s, ...o }),
465
+ default: () => ({})
466
+ }),
467
+ ...V()
468
+ });
469
+ }
470
+ function F(t) {
471
+ const e = /* @__PURE__ */ new Set();
472
+ for (const s of t)
473
+ for (const o of Object.keys(s.shape ?? {}))
474
+ o !== "nodes" && e.add(o);
475
+ const r = Object.fromEntries([...e].map((s) => [s, void 0]));
476
+ return lt(r);
477
+ }
478
+ class P {
479
+ //#endregion Private Properties
480
+ //#region Lifecycle
481
+ constructor(e, r, s) {
482
+ this.sourceJSON = e, this.edges = r, this.nodes = s, this._loaded = !1;
483
+ }
484
+ //#endregion Lifecycle
485
+ //#region Public Methods
486
+ static fromJSON(e) {
487
+ return new P(
488
+ e,
489
+ e.graph.edges.map((r) => p.fromJSON(r)),
490
+ e.graph.nodes.map((r) => dt(r))
491
+ );
492
+ }
493
+ async load() {
494
+ return this._loadPromise ??= Promise.all(this.nodes.map(async (e) => await e.load())).then(() => {
495
+ this._loaded = !0;
496
+ }), await this._loadPromise, this;
497
+ }
498
+ getSchemas() {
499
+ const e = Object.fromEntries(
500
+ this._getNodeCompilations().flatMap((s, o) => {
501
+ const a = this.nodes[o];
502
+ return s.schemas?.map((i) => [a.id, i]) ?? [];
503
+ })
504
+ );
505
+ return [c.object({
506
+ loopCounts: c.record(c.string(), c.number()).optional(),
507
+ nodes: c.object(e).partial().optional(),
508
+ question: c.string().optional()
509
+ })];
510
+ }
511
+ generate() {
512
+ this._assertLoaded(), this._nodeCompilations = void 0;
513
+ const e = this._getNodeCompilations(), r = F(this.getSchemas()), s = this.nodes.find((i) => i.type === "start-node")?.id, o = {}, a = [];
514
+ for (const [i, O] of this.nodes.entries()) {
515
+ const y = e[i];
516
+ y && (y.runtimeNode && (o[O.id] = y.runtimeNode), a.push(...y.edges));
517
+ }
518
+ return {
519
+ createGraph: () => B(o, a, r, { entryNode: s }),
520
+ workspace: r
521
+ };
522
+ }
523
+ //#endregion Public Methods
524
+ //#region Private Methods
525
+ _assertLoaded() {
526
+ if (!this._loaded)
527
+ throw new Error("AgenticWorkflowRuntime must be loaded before it can generate a graph.");
528
+ }
529
+ _getNodeCompilations() {
530
+ return this._assertLoaded(), this._nodeCompilations ??= this.nodes.map(
531
+ (e) => e.compile({
532
+ outgoingEdges: this.edges.filter((r) => r.sourceNodeId === e.id)
533
+ })
534
+ );
535
+ }
536
+ //#endregion Private Methods
537
+ }
538
+ var ht = Object.defineProperty, gt = Object.getOwnPropertyDescriptor, E = (t, e, r, s) => {
539
+ for (var o = s > 1 ? void 0 : s ? gt(e, r) : e, a = t.length - 1, i; a >= 0; a--)
540
+ (i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
541
+ return s && o && ht(e, r, o), o;
542
+ };
543
+ const ft = () => {
544
+ throw new Error("WebAgent must be loaded before it can run.");
545
+ };
546
+ let g = class extends G {
547
+ //#region Lifecycle
548
+ constructor(t) {
549
+ super(t);
550
+ }
551
+ //#endregion
552
+ //#region Public Methods
553
+ async load() {
554
+ if (this.portalItem) {
555
+ try {
556
+ await this.portalItem.load();
557
+ } catch (r) {
558
+ throw new b("web-agent:load-portal-item", "Failed to load portal item", { error: r });
559
+ }
560
+ const e = await this.portalItem.fetchData();
561
+ if (this.sourceJSON = e, !this.portalItem.title)
562
+ throw new b("web-agent:missing-title", "The portal item is missing a title");
563
+ }
564
+ if (!this.sourceJSON)
565
+ throw new b("web-agent:missing-source-json", "The source JSON is missing");
566
+ if (!this.sourceJSON.description)
567
+ throw new b("web-agent:missing-description", "The source JSON is missing a description");
568
+ const t = P.fromJSON(this.sourceJSON);
569
+ return await t.load(), this._runtime = t, this.description = this.sourceJSON.description, this.name = this.portalItem?.title ?? `web-agent-${Date.now()}`, this.generate(), this;
570
+ }
571
+ getSchemas() {
572
+ return this._runtime?.getSchemas() ?? [];
573
+ }
574
+ generate() {
575
+ if (!this._runtime) {
576
+ this._set("workspace", F([])), this._set("createGraph", ft);
577
+ return;
578
+ }
579
+ const { createGraph: t, workspace: e } = this._runtime.generate();
580
+ this._set("workspace", e), this._set("createGraph", t);
581
+ }
582
+ //#endregion
583
+ };
584
+ E([
585
+ n({ type: C })
586
+ ], g.prototype, "portalItem", 2);
587
+ E([
588
+ n()
589
+ ], g.prototype, "sourceJSON", 2);
590
+ g = E([
591
+ l("WebAgent")
592
+ ], g);
593
+ class _t extends M {
6
594
  static {
7
- this.properties = { agent: 0, context: 0 };
595
+ this.properties = { agent: 0, context: 0, itemId: 1, workflow: 0 };
8
596
  }
597
+ #t;
9
598
  async getContext() {
10
- return e(this.context) ? await this.context() : this.context;
599
+ return W(this.context) ? await this.context() : this.context;
600
+ }
601
+ async load() {
602
+ let e;
603
+ if (this.itemId) {
604
+ const r = j.getDefault();
605
+ e = new g({ portalItem: new C({ id: this.itemId, portal: r }) });
606
+ } else this.workflow && (e = new g({ sourceJSON: this.workflow }));
607
+ if (e && (await e.load(), this.agent = e.registration), !this.agent)
608
+ throw new Error("Failed to initialize the assistant agent because the agent registration is missing.");
609
+ this.#t = L(this);
11
610
  }
12
- load() {
13
- i(this);
611
+ disconnectedCallback() {
612
+ this.#t?.unregister(this.agent.id), super.disconnectedCallback();
14
613
  }
15
614
  }
16
- t("arcgis-assistant-agent", n);
615
+ q("arcgis-assistant-agent", _t);
17
616
  export {
18
- n as ArcgisAssistantAgent
617
+ _t as ArcgisAssistantAgent
19
618
  };