@arcgis/ai-components 5.2.0-next.11 → 5.2.0-next.110

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 (371) hide show
  1. package/LICENSE.md +4 -2
  2. package/README.md +2 -2
  3. package/dist/agent-utils/BaseAgent.js +1 -1
  4. package/dist/agent-utils/FunctionAgent.js +1 -1
  5. package/dist/agent-utils/LLMAgent.d.ts +5 -2
  6. package/dist/agent-utils/LLMAgent.js +7 -4
  7. package/dist/agent-utils/WorkflowAgent.js +15 -16
  8. package/dist/agent-utils/index.d.ts +78 -0
  9. package/dist/agent-utils/index.js +117 -98
  10. package/dist/agent-utils/middlewares/humanInTheLoop.js +1 -1
  11. package/dist/agent-utils/middlewares/middleware.js +1 -1
  12. package/dist/agent-utils/middlewares/trace.d.ts +2 -0
  13. package/dist/agent-utils/middlewares/trace.js +1 -1
  14. package/dist/agent-utils/middlewares/types.js +1 -1
  15. package/dist/agent-utils/tools/FunctionTool.js +1 -1
  16. package/dist/agent-utils/types.d.ts +13 -13
  17. package/dist/agent-utils/workflows/ConditionalWorkflow.js +1 -1
  18. package/dist/agent-utils/workflows/LoopWorkflow.js +1 -1
  19. package/dist/agent-utils/workflows/ParallelWorkflow.js +1 -1
  20. package/dist/agent-utils/workflows/RouterWorkflow.js +1 -1
  21. package/dist/agent-utils/workflows/SequentialWorkflow.js +1 -1
  22. package/dist/agent-utils/workflows/SwitchWorkflow.js +1 -1
  23. package/dist/agentic-workflow/AgenticWorkflowRuntime.d.ts +24 -0
  24. package/dist/agentic-workflow/Edge.d.ts +16 -0
  25. package/dist/agentic-workflow/WebAgent.d.ts +39 -0
  26. package/dist/agentic-workflow/jsonTypes.d.ts +189 -0
  27. package/dist/agentic-workflow/nodes/AgentNode.d.ts +28 -0
  28. package/dist/agentic-workflow/nodes/BaseNode.d.ts +35 -0
  29. package/dist/agentic-workflow/nodes/EndMessageNode.d.ts +25 -0
  30. package/dist/agentic-workflow/nodes/StartNode.d.ts +21 -0
  31. package/dist/agentic-workflow/nodes/tools/ArcgisTool.d.ts +21 -0
  32. package/dist/agentic-workflow/types.d.ts +29 -0
  33. package/dist/agents/runtime/skill/createSkillAgent.d.ts +31 -0
  34. package/dist/agents/runtime/skill/createSkillAgent.js +260 -0
  35. package/dist/agents/runtime/skill/loadAgentSkills.d.ts +16 -0
  36. package/dist/agents/runtime/skill/types.d.ts +28 -0
  37. package/dist/agents/runtime/skill/types.js +2 -0
  38. package/dist/agents/tools/filter/clearFilters/adapter.d.ts +8 -0
  39. package/dist/agents/tools/filter/clearFilters/adapter.js +22 -0
  40. package/dist/agents/tools/filter/resetMap/adapter.d.ts +8 -0
  41. package/dist/agents/tools/filter/resetMap/adapter.js +22 -0
  42. package/dist/agents/tools/filter/setFeatureEffect/adapter.d.ts +8 -0
  43. package/dist/agents/tools/filter/setFeatureEffect/adapter.js +122 -0
  44. package/dist/agents/tools/help/listFields/adapter.d.ts +11 -0
  45. package/dist/agents/tools/help/listFields/adapter.js +30 -0
  46. package/dist/agents/tools/navigation/goToAddress/adapter.d.ts +10 -0
  47. package/dist/agents/tools/navigation/goToAddress/adapter.js +60 -0
  48. package/dist/agents/tools/navigation/goToBookmark/adapter.d.ts +8 -0
  49. package/dist/agents/tools/navigation/goToBookmark/adapter.js +30 -0
  50. package/dist/agents/tools/navigation/goToFeatures/adapter.d.ts +8 -0
  51. package/dist/agents/tools/navigation/goToFeatures/adapter.js +50 -0
  52. package/dist/agents/tools/navigation/goToFullExtent/adapter.d.ts +8 -0
  53. package/dist/agents/tools/navigation/goToFullExtent/adapter.js +27 -0
  54. package/dist/agents/tools/navigation/goToHomeExtent/adapter.d.ts +8 -0
  55. package/dist/agents/tools/navigation/goToHomeExtent/adapter.js +24 -0
  56. package/dist/agents/tools/navigation/goToLayer/adapter.d.ts +8 -0
  57. package/dist/agents/tools/navigation/goToLayer/adapter.js +26 -0
  58. package/dist/agents/tools/navigation/goToScale/adapter.d.ts +8 -0
  59. package/dist/agents/tools/navigation/goToScale/adapter.js +21 -0
  60. package/dist/agents/tools/navigation/goToViewpoint/adapter.d.ts +8 -0
  61. package/dist/agents/tools/navigation/goToViewpoint/adapter.js +42 -0
  62. package/dist/agents/tools/navigation/goToZoom/adapter.d.ts +8 -0
  63. package/dist/agents/tools/navigation/goToZoom/adapter.js +21 -0
  64. package/dist/agents/tools/query/getAttribute/adapter.d.ts +8 -0
  65. package/dist/agents/tools/query/getAttribute/adapter.js +40 -0
  66. package/dist/agents/tools/query/getStatistics/adapter.d.ts +8 -0
  67. package/dist/agents/tools/query/getStatistics/adapter.js +158 -0
  68. package/dist/agents/tools/query/getTopFeatures/adapter.d.ts +8 -0
  69. package/dist/agents/tools/query/getTopFeatures/adapter.js +145 -0
  70. package/dist/agents/tools/query/queryFeatures/adapter.d.ts +8 -0
  71. package/dist/agents/tools/query/queryFeatures/adapter.js +131 -0
  72. package/dist/agents/tools/search/findRelevantFields/adapter.d.ts +8 -0
  73. package/dist/agents/tools/search/findRelevantFields/adapter.js +57 -0
  74. package/dist/agents/tools/search/findRelevantLayers/adapter.d.ts +8 -0
  75. package/dist/agents/tools/search/findRelevantLayers/adapter.js +38 -0
  76. package/dist/agents/tools/shared/resolveToolArtifact.d.ts +22 -0
  77. package/dist/agents/tools/shared/resolveToolArtifact.js +20 -0
  78. package/dist/agents/tools/shared/types.d.ts +22 -0
  79. package/dist/agents/tools/shared/types.js +6 -0
  80. package/dist/cdn/24EIZVUM.js +2 -0
  81. package/dist/cdn/25MBI4PD.js +2 -0
  82. package/dist/cdn/275FFTBE.js +2 -0
  83. package/dist/cdn/27CK3JHY.js +2 -0
  84. package/dist/cdn/2F4TPWZQ.js +2 -0
  85. package/dist/cdn/2LVYAXHG.js +44 -0
  86. package/dist/cdn/2UJPYWWZ.js +3 -0
  87. package/dist/cdn/2WXXSZP5.js +2 -0
  88. package/dist/cdn/{Q7TL5Q5N.js → 3KNLFIM3.js} +2 -2
  89. package/dist/cdn/3PPXAIRE.js +14 -0
  90. package/dist/cdn/45BDE3MG.js +2 -0
  91. package/dist/cdn/477I66FH.js +56 -0
  92. package/dist/cdn/4CFCV47G.js +2 -0
  93. package/dist/cdn/4IWDBEMN.js +34 -0
  94. package/dist/cdn/4OI4QEV7.js +6 -0
  95. package/dist/cdn/{DXVU45KM.js → 4VBOTWC3.js} +2 -2
  96. package/dist/cdn/4YOG5F3W.js +2 -0
  97. package/dist/cdn/53KIFJFA.js +4 -0
  98. package/dist/cdn/5X23DDDZ.js +2 -0
  99. package/dist/cdn/65LCK3GG.js +3 -0
  100. package/dist/cdn/6KWGSXIN.js +2 -0
  101. package/dist/cdn/7DOYUO7L.js +71 -0
  102. package/dist/cdn/{WAIFKDR3.js → 7UBTNDV6.js} +2 -2
  103. package/dist/cdn/7Y43R7QJ.js +2 -0
  104. package/dist/cdn/A6LBMS7A.js +2 -0
  105. package/dist/cdn/AP3KPOHN.js +2 -0
  106. package/dist/cdn/AUCKEB52.js +2 -0
  107. package/dist/cdn/B3HXSEBN.js +2 -0
  108. package/dist/cdn/BBEGLIZC.js +2 -0
  109. package/dist/cdn/BJMGT6GV.js +19 -0
  110. package/dist/cdn/BTOBEN7Q.js +2 -0
  111. package/dist/cdn/BTTCBEPW.js +2 -0
  112. package/dist/cdn/BVUCNXC5.js +2 -0
  113. package/dist/cdn/CAOMMQSY.js +66 -0
  114. package/dist/cdn/CKUUYQLO.js +2 -0
  115. package/dist/cdn/{ZEYIBYSF.js → CSE6BHOJ.js} +2 -2
  116. package/dist/cdn/CX2HJ67C.js +2 -0
  117. package/dist/cdn/EGRRZTF6.js +2 -0
  118. package/dist/cdn/EK3PM4L5.js +2 -0
  119. package/dist/cdn/EXMEB4X2.js +2 -0
  120. package/dist/cdn/EYGZJKVD.js +2 -0
  121. package/dist/cdn/{24QNMEFG.js → FDRAKF5D.js} +2 -2
  122. package/dist/cdn/FHBRXZLV.js +2 -0
  123. package/dist/cdn/{5CV7R5IS.js → FK2CVSXW.js} +6 -6
  124. package/dist/cdn/FLUI6GCU.js +2 -0
  125. package/dist/cdn/{ZTBA5PM7.js → FPH52WOH.js} +2 -2
  126. package/dist/cdn/FRYS2PZJ.js +2 -0
  127. package/dist/cdn/FSLQCZRN.js +2 -0
  128. package/dist/cdn/{LQ6R5YRN.js → FTTLFIBV.js} +2 -2
  129. package/dist/cdn/FV6FHLYW.js +2 -0
  130. package/dist/cdn/G24MNC7D.js +6 -0
  131. package/dist/cdn/{F6QHMKF5.js → GW3IVAAZ.js} +2 -2
  132. package/dist/cdn/HI3XKFHD.js +2 -0
  133. package/dist/cdn/HKIA5PWU.js +2 -0
  134. package/dist/cdn/{6ZW7Z36F.js → HMMYCSOK.js} +4 -4
  135. package/dist/cdn/HNTSDY3J.js +2 -0
  136. package/dist/cdn/HV7MVIQV.js +2 -0
  137. package/dist/cdn/I3SUE2TR.js +2 -0
  138. package/dist/cdn/I72ST4JR.js +134 -0
  139. package/dist/cdn/{T537PKP4.js → IHUWQOMK.js} +2 -2
  140. package/dist/cdn/JMXXRRKQ.js +22 -0
  141. package/dist/cdn/JUNMTIB3.js +2 -0
  142. package/dist/cdn/{6YMR4QSD.js → JYNHWJUZ.js} +2 -2
  143. package/dist/cdn/KAX4A7SF.js +2 -0
  144. package/dist/cdn/KBSXHSBX.js +2 -0
  145. package/dist/cdn/KKCLHXHG.js +2 -0
  146. package/dist/cdn/L2HLFWCV.js +72 -0
  147. package/dist/cdn/{7RCQFLPP.js → L3BTURBA.js} +2 -2
  148. package/dist/cdn/LBTGOMCT.js +2 -0
  149. package/dist/cdn/LIRT72WY.js +2 -0
  150. package/dist/cdn/LL324IL6.js +2 -0
  151. package/dist/cdn/LLY5A2E2.js +2 -0
  152. package/dist/cdn/LXIKAXUT.js +2 -0
  153. package/dist/cdn/M2U456J5.js +181 -0
  154. package/dist/cdn/M3KKORBG.js +2 -0
  155. package/dist/cdn/M5B6X46F.js +2 -0
  156. package/dist/cdn/{X2ZDYHCG.js → MZUDIQQH.js} +11 -6
  157. package/dist/cdn/NBDOPGSN.js +2 -0
  158. package/dist/cdn/NGR5NVZE.js +2 -0
  159. package/dist/cdn/{5ZZGKP7N.js → NNPA3NLK.js} +2 -2
  160. package/dist/cdn/NV7CL4S3.js +2 -0
  161. package/dist/cdn/{5W7S2RS4.js → OALQBAZR.js} +2 -2
  162. package/dist/cdn/OF3TAARW.js +2 -0
  163. package/dist/cdn/{AZGGTNA3.js → OXC2WP7W.js} +2 -2
  164. package/dist/cdn/PJPP6LOS.js +3 -0
  165. package/dist/cdn/PUZ6RAFQ.js +2 -0
  166. package/dist/cdn/QAX6UF4L.js +99 -0
  167. package/dist/cdn/{NE7E52YR.js → QTEPFTAU.js} +10 -4
  168. package/dist/cdn/ROS22KOA.js +2 -0
  169. package/dist/cdn/RSM7MEVT.js +9 -0
  170. package/dist/cdn/SBNNJ5WA.js +2 -0
  171. package/dist/cdn/SDX46GZY.js +2 -0
  172. package/dist/cdn/SI22EJLC.js +2 -0
  173. package/dist/cdn/SJMAKF4P.js +2 -0
  174. package/dist/cdn/SNG3WODY.js +2 -0
  175. package/dist/cdn/STOGCXJH.js +2 -0
  176. package/dist/cdn/SUC2MIGE.js +2 -0
  177. package/dist/cdn/SXYKNDOF.js +2 -0
  178. package/dist/cdn/SZ2L5556.js +2 -0
  179. package/dist/cdn/T6W6F4TF.js +2 -0
  180. package/dist/cdn/TB2GJALS.js +2 -0
  181. package/dist/cdn/TFAJNKBC.js +2 -0
  182. package/dist/cdn/TLPZELG3.js +2 -0
  183. package/dist/cdn/TXZQZR3I.js +2 -0
  184. package/dist/cdn/UAZPINUQ.js +2 -0
  185. package/dist/cdn/UGIHS7OA.js +2 -0
  186. package/dist/cdn/{FX7UOGHP.js → V266DJ5V.js} +2 -2
  187. package/dist/cdn/V4PJMCJZ.js +2 -0
  188. package/dist/cdn/{P7DG5T3Z.js → V52GSTOC.js} +2 -2
  189. package/dist/cdn/VGLBH473.js +2 -0
  190. package/dist/cdn/VK6CCPTG.js +2 -0
  191. package/dist/cdn/{ZS2TZ6BF.js → VLPELJUS.js} +2 -2
  192. package/dist/cdn/VT5EWFH7.js +2 -0
  193. package/dist/cdn/{7CYGX4F4.js → VXLKTQ36.js} +2 -2
  194. package/dist/cdn/W54XYT2A.js +2 -0
  195. package/dist/cdn/X42ACC66.js +5 -0
  196. package/dist/cdn/XNUWVZN7.js +2 -0
  197. package/dist/cdn/XOTPSCNF.js +2 -0
  198. package/dist/cdn/XRVGYRXL.js +14 -0
  199. package/dist/cdn/XV7RMYLR.js +2 -0
  200. package/dist/cdn/XVJFPZTW.js +2 -0
  201. package/dist/cdn/XZF7Y6B2.js +2 -0
  202. package/dist/cdn/{UPEEHMSY.js → Y4TYL2AL.js} +2 -2
  203. package/dist/cdn/Y4ZOB6UH.js +2 -0
  204. package/dist/cdn/Y6CV2NZR.js +2 -0
  205. package/dist/cdn/YIXASZUW.js +2 -0
  206. package/dist/cdn/YOW3YKWR.js +11 -0
  207. package/dist/cdn/{23EQTPO3.js → ZA7ZU2F7.js} +2 -2
  208. package/dist/cdn/ZJWR4W2S.js +208 -0
  209. package/dist/cdn/ZWIKFBOU.js +2 -0
  210. package/dist/cdn/ZY3JQCZQ.js +179 -0
  211. package/dist/cdn/agent-utils/index.js +2 -2
  212. package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +2 -2
  213. package/dist/cdn/agent-utils/middlewares/middleware.js +2 -2
  214. package/dist/cdn/agent-utils/middlewares/trace.js +2 -2
  215. package/dist/cdn/assets/assistant/t9n/messages.en.json +1 -1
  216. package/dist/cdn/assets/assistant-interrupt/t9n/messages.en.json +1 -1
  217. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.en.json +1 -0
  218. package/dist/cdn/assets/assistant-message/t9n/messages.en.json +1 -0
  219. package/dist/cdn/assets/assistant-message-loading/t9n/messages.en.json +1 -0
  220. package/dist/cdn/index.js +2 -2
  221. package/dist/chunks/BaseWorkflow.js +1 -1
  222. package/dist/chunks/SKILL.js +5 -0
  223. package/dist/chunks/SKILL2.js +5 -0
  224. package/dist/chunks/SKILL3.js +22 -0
  225. package/dist/chunks/SKILL4.js +5 -0
  226. package/dist/chunks/adapter.js +1127 -2011
  227. package/dist/chunks/aiFactory.js +94 -0
  228. package/dist/chunks/arcgisKnowledgeGraph.js +97 -77
  229. package/dist/chunks/arcgisToolRegistry.js +88 -0
  230. package/dist/chunks/arcgis_knowledge_current_lc_context.js +20 -3
  231. package/dist/chunks/arcgis_knowledge_current_map_context.js +32 -3
  232. package/dist/chunks/arcgis_knowledge_cypher_query_prompt.js +102 -0
  233. package/dist/chunks/arcgis_knowledge_lucene_generation_prompt.js +1 -1
  234. package/dist/chunks/arcgis_knowledge_summarize_result_prompt.js +117 -28
  235. package/dist/chunks/arcgis_knowledge_tool_prompt.js +1 -1
  236. package/dist/chunks/baseAgentState.js +58 -0
  237. package/dist/chunks/converterUtils.js +67 -42
  238. package/dist/chunks/dataExplorationAgent.js +19 -0
  239. package/dist/chunks/data_explore_filter_prompt.js +1 -1
  240. package/dist/chunks/data_explore_query_prompt.js +10 -5
  241. package/dist/chunks/embeddings.worker.js +1 -1
  242. package/dist/chunks/fetchAgentContext.js +13 -0
  243. package/dist/chunks/fetchService.js +10 -0
  244. package/dist/chunks/fieldStatistics.js +79 -0
  245. package/dist/chunks/field_descriptions_prompt.js +1 -1
  246. package/dist/chunks/formatFeatureAttributes.js +132 -0
  247. package/dist/chunks/generateLayerDescriptions.js +190 -311
  248. package/dist/chunks/graph.js +1 -1
  249. package/dist/chunks/helpAgent.js +34 -0
  250. package/dist/chunks/help_prompt.js +35 -18
  251. package/dist/chunks/index.js +1 -1
  252. package/dist/chunks/intent_prompt.js +3 -3
  253. package/dist/chunks/layerStylingGraph.js +102 -84
  254. package/dist/chunks/layer_descriptions_prompt.js +1 -1
  255. package/dist/chunks/layer_styling_prompt.js +1 -1
  256. package/dist/chunks/mergeWhereClauses.js +15 -0
  257. package/dist/chunks/navigationAgent.js +27 -0
  258. package/dist/chunks/navigation_intent_prompt.js +9 -3
  259. package/dist/chunks/navigation_tool_prompt.js +1 -1
  260. package/dist/chunks/orchestrator.js +446 -235
  261. package/dist/chunks/requireAgentServices.js +11 -0
  262. package/dist/chunks/resolvePointGeometryFilter.js +92 -0
  263. package/dist/chunks/runtime.js +1 -1
  264. package/dist/chunks/slottableRequestUtils.js +1 -1
  265. package/dist/chunks/state.js +22 -28
  266. package/dist/chunks/summarize_query_response_prompt.js +1 -1
  267. package/dist/chunks/useT9n.js +1 -1
  268. package/dist/chunks/utils.js +1 -1
  269. package/dist/chunks/utils2.js +12 -12
  270. package/dist/chunks/utils3.js +1 -1
  271. package/dist/components/arcgis-assistant/customElement.d.ts +102 -1
  272. package/dist/components/arcgis-assistant/customElement.js +332 -184
  273. package/dist/components/arcgis-assistant-agent/customElement.d.ts +13 -1
  274. package/dist/components/arcgis-assistant-agent/customElement.js +533 -11
  275. package/dist/components/arcgis-assistant-chat/customElement.js +23 -18
  276. package/dist/components/arcgis-assistant-chat-entry/customElement.js +1 -1
  277. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +35 -9
  278. package/dist/components/arcgis-assistant-help-agent/customElement.js +32 -9
  279. package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -0
  280. package/dist/components/arcgis-assistant-interrupt/customElement.js +12 -13
  281. package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +13 -9
  282. package/dist/components/arcgis-assistant-knowledge-agent/customElement.d.ts +1 -1
  283. package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +41 -17
  284. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +31 -8
  285. package/dist/components/arcgis-assistant-message/customElement.d.ts +3 -0
  286. package/dist/components/arcgis-assistant-message/customElement.js +10 -9
  287. package/dist/components/arcgis-assistant-message-block/customElement.js +2 -2
  288. package/dist/components/arcgis-assistant-message-feedback/customElement.js +1 -1
  289. package/dist/components/arcgis-assistant-message-footer/customElement.js +1 -1
  290. package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +3 -0
  291. package/dist/components/arcgis-assistant-message-loading/customElement.js +12 -11
  292. package/dist/components/arcgis-assistant-message-log/customElement.js +1 -1
  293. package/dist/components/arcgis-assistant-message-read-aloud/customElement.js +1 -1
  294. package/dist/components/arcgis-assistant-message-text/customElement.d.ts +1 -0
  295. package/dist/components/arcgis-assistant-message-text/customElement.js +13 -13
  296. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +34 -10
  297. package/dist/components/arcgis-assistant-speech-input/customElement.js +35 -53
  298. package/dist/components/arcgis-assistant-suggested-prompts/customElement.js +1 -1
  299. package/dist/components/arcgis-assistant-user-message/customElement.d.ts +2 -0
  300. package/dist/components/arcgis-assistant-user-message/customElement.js +16 -11
  301. package/dist/docs/api.json +1 -1
  302. package/dist/docs/docs.json +1 -1
  303. package/dist/docs/vscode.html-custom-data.json +1 -1
  304. package/dist/docs/web-types.json +1 -1
  305. package/dist/index.js +1 -1
  306. package/dist/loader.js +7 -7
  307. package/dist/oauth-callback.html +1 -1
  308. package/dist/orchestrator/models/types.d.ts +1 -0
  309. package/dist/orchestrator/orchestrator/orchestratorEvents.d.ts +78 -0
  310. package/dist/orchestrator/providers/arcgis/aiFactory.d.ts +15 -0
  311. package/dist/orchestrator/types/types.d.ts +17 -0
  312. package/dist/types/lumina.d.ts +5 -4
  313. package/dist/types/preact.d.ts +5 -4
  314. package/dist/types/react.d.ts +5 -4
  315. package/dist/types/stencil.d.ts +7 -6
  316. package/dist/utils/index.d.ts +75 -39
  317. package/dist/utils/index.js +708 -84
  318. package/package.json +35 -12
  319. package/dist/cdn/34SG44C3.js +0 -72
  320. package/dist/cdn/3JGWGKT6.js +0 -2
  321. package/dist/cdn/3NBDVZ2I.js +0 -2
  322. package/dist/cdn/3VOQD2MR.js +0 -2
  323. package/dist/cdn/434TAA3J.js +0 -2
  324. package/dist/cdn/53NTYC4I.js +0 -2
  325. package/dist/cdn/5QAHYX7Y.js +0 -5
  326. package/dist/cdn/AXDZBBNL.js +0 -45
  327. package/dist/cdn/B7WJFBOZ.js +0 -2
  328. package/dist/cdn/BX7FSMUU.js +0 -56
  329. package/dist/cdn/CHPQM77M.js +0 -181
  330. package/dist/cdn/DHKUXLU3.js +0 -179
  331. package/dist/cdn/DQSEBKOX.js +0 -2
  332. package/dist/cdn/DZ2QWNUA.js +0 -3
  333. package/dist/cdn/EBISDZ5H.js +0 -2
  334. package/dist/cdn/ERL2CB2Y.js +0 -14
  335. package/dist/cdn/F2AHA4GB.js +0 -54
  336. package/dist/cdn/FUIGPHBH.js +0 -2
  337. package/dist/cdn/H2CHHGGH.js +0 -2
  338. package/dist/cdn/HWKDNS4K.js +0 -4
  339. package/dist/cdn/IMQ4TVHF.js +0 -16
  340. package/dist/cdn/IOD3GDA7.js +0 -2
  341. package/dist/cdn/IR7PTESF.js +0 -2
  342. package/dist/cdn/IRZDTYO2.js +0 -2
  343. package/dist/cdn/JIWK6QK6.js +0 -2
  344. package/dist/cdn/JLKGS6Y5.js +0 -36
  345. package/dist/cdn/K3JCH4XW.js +0 -2
  346. package/dist/cdn/KHXUWZHB.js +0 -2
  347. package/dist/cdn/KMQ3SP4I.js +0 -5
  348. package/dist/cdn/LIFK3QSD.js +0 -2
  349. package/dist/cdn/NXKKG5TK.js +0 -2
  350. package/dist/cdn/O3EN27N5.js +0 -2
  351. package/dist/cdn/O3RFFPU3.js +0 -6
  352. package/dist/cdn/PBO6FZN6.js +0 -2
  353. package/dist/cdn/Q3ZW4FYA.js +0 -3
  354. package/dist/cdn/Q6LRANX6.js +0 -2
  355. package/dist/cdn/QCSN44H4.js +0 -2
  356. package/dist/cdn/R56X6ZKR.js +0 -161
  357. package/dist/cdn/RUURNLTP.js +0 -2
  358. package/dist/cdn/T43LEBBE.js +0 -47
  359. package/dist/cdn/TR4GFL7X.js +0 -2
  360. package/dist/cdn/WNS5ZUF5.js +0 -2
  361. package/dist/cdn/X4XY5HIE.js +0 -2
  362. package/dist/cdn/XOH56EQ2.js +0 -2
  363. package/dist/cdn/XON27U6U.js +0 -2
  364. package/dist/cdn/YIMNOUTF.js +0 -2
  365. package/dist/cdn/YLN2BZ5J.js +0 -2
  366. package/dist/cdn/YUKR4AZW.js +0 -2
  367. package/dist/cdn/Z2G7MP5L.js +0 -22
  368. package/dist/chunks/dataExplorationGraph.js +0 -310
  369. package/dist/chunks/helpGraph.js +0 -126
  370. package/dist/chunks/navigationGraph.js +0 -270
  371. package/dist/chunks/toolCallResponse.js +0 -31
@@ -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,541 @@
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 {
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
2
+ import { c as W } from "../../chunks/runtime.js";
3
+ import { LitElement as F } from "@arcgis/lumina";
4
+ import { b as M, i as j } from "../../chunks/utils2.js";
5
+ import I from "@arcgis/core/portal/PortalItem.js";
6
+ import G 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 L } from "../../agent-utils/BaseAgent.js";
9
+ import y from "@arcgis/core/core/Error.js";
10
+ import { z as c } from "zod";
11
+ import { c as z } from "../../chunks/graph.js";
12
+ import A from "@arcgis/core/core/Accessor.js";
13
+ import { LLMAgent as B } from "../../agent-utils/LLMAgent.js";
14
+ import { r as U } from "../../chunks/arcgisToolRegistry.js";
15
+ import { PromptTemplate as Z } from "@langchain/core/prompts";
16
+ import { Annotation as x } from "@langchain/langgraph";
17
+ import { b as H, d as K } from "../../chunks/state.js";
18
+ import "@arcgis/core/identity/IdentityManager.js";
19
+ import "@arcgis/core/request.js";
20
+ import "@langchain/langgraph/web";
21
+ import "@arcgis/toolkit/string";
22
+ import "../../chunks/generateLayerDescriptions.js";
23
+ import "@langchain/core/messages";
24
+ import "@langchain/core/callbacks/dispatch/web";
25
+ import "@langchain/core/callbacks/base";
26
+ import "@langchain/openai";
27
+ import "@arcgis/core/config.js";
28
+ import "@arcgis/core/core/reactiveUtils.js";
29
+ import "@arcgis/core/layers/FeatureLayer.js";
30
+ import { a as Q } from "../../chunks/baseAgentState.js";
31
+ var V = Object.defineProperty, X = Object.getOwnPropertyDescriptor, f = (e, t, o, s) => {
32
+ for (var r = s > 1 ? void 0 : s ? X(t, o) : t, a = e.length - 1, i; a >= 0; a--)
33
+ (i = e[a]) && (r = (s ? i(t, o, r) : i(r)) || r);
34
+ return s && r && V(t, o, r), r;
35
+ };
36
+ let p = class extends A {
37
+ //#region Lifecycle
38
+ constructor(e) {
39
+ super(e);
40
+ }
41
+ //#endregion
42
+ //#region Public Methods
43
+ static fromJSON(e) {
44
+ return new p({
45
+ id: e.id,
46
+ sourceAnchorId: e.source_anchor_id,
47
+ sourceNodeId: e.source_node_id,
48
+ targetAnchorId: e.target_anchor_id,
49
+ targetNodeId: e.target_node_id
50
+ });
51
+ }
52
+ //#endregion
53
+ };
54
+ f([
55
+ n()
56
+ ], p.prototype, "id", 2);
57
+ f([
58
+ n()
59
+ ], p.prototype, "sourceAnchorId", 2);
60
+ f([
61
+ n()
62
+ ], p.prototype, "sourceNodeId", 2);
63
+ f([
64
+ n()
65
+ ], p.prototype, "targetAnchorId", 2);
66
+ f([
67
+ n()
68
+ ], p.prototype, "targetNodeId", 2);
69
+ p = f([
70
+ l("Edge")
71
+ ], p);
72
+ var Y = Object.defineProperty, k = Object.getOwnPropertyDescriptor, v = (e, t, o, s) => {
73
+ for (var r = s > 1 ? void 0 : s ? k(t, o) : t, a = e.length - 1, i; a >= 0; a--)
74
+ (i = e[a]) && (r = (s ? i(t, o, r) : i(r)) || r);
75
+ return s && r && Y(t, o, r), r;
76
+ };
77
+ let d = class extends A {
78
+ //#region Lifecycle
79
+ constructor(e) {
80
+ super(e);
81
+ }
82
+ //#endregion
83
+ //#region Public Methods
84
+ async load() {
85
+ return await Promise.resolve(this);
86
+ }
87
+ compile(e) {
88
+ return {
89
+ runtimeNode: this.createRuntimeNode(),
90
+ edges: e.outgoingEdges.map((t) => ({
91
+ from: this.id,
92
+ to: t.targetNodeId
93
+ }))
94
+ };
95
+ }
96
+ static fromJSON(e) {
97
+ throw new Error("BaseNode is abstract and cannot be instantiated directly.");
98
+ }
99
+ //#endregion
100
+ //#region Private Methods
101
+ //#endregion
102
+ };
103
+ v([
104
+ n()
105
+ ], d.prototype, "id", 2);
106
+ v([
107
+ n()
108
+ ], d.prototype, "label", 2);
109
+ v([
110
+ n()
111
+ ], d.prototype, "type", 2);
112
+ d = v([
113
+ l("BaseNode")
114
+ ], d);
115
+ function J(e) {
116
+ const t = new Set(e.required), o = Object.fromEntries(
117
+ Object.entries(e.properties).map(([s, r]) => {
118
+ const a = $(r);
119
+ return [s, t.has(s) ? a : a.optional()];
120
+ })
121
+ );
122
+ return c.object(o);
123
+ }
124
+ function $(e) {
125
+ let t;
126
+ switch (e.type) {
127
+ case "array":
128
+ t = c.array(e.items ? $(e.items) : c.unknown());
129
+ break;
130
+ case "boolean":
131
+ t = c.boolean();
132
+ break;
133
+ case "number":
134
+ t = c.number();
135
+ break;
136
+ case "object":
137
+ t = J({
138
+ properties: e.properties ?? {},
139
+ required: e.required
140
+ });
141
+ break;
142
+ case "string":
143
+ t = e.enum?.length ? c.enum(e.enum) : c.string();
144
+ break;
145
+ }
146
+ return e.description ? t.describe(e.description) : t;
147
+ }
148
+ var ee = Object.defineProperty, te = Object.getOwnPropertyDescriptor, N = (e, t, o, s) => {
149
+ for (var r = s > 1 ? void 0 : s ? te(t, o) : t, a = e.length - 1, i; a >= 0; a--)
150
+ (i = e[a]) && (r = (s ? i(t, o, r) : i(r)) || r);
151
+ return s && r && ee(t, o, r), r;
152
+ };
153
+ const re = (e) => e.replace(/_([a-z])/gu, (t, o) => o.toUpperCase());
154
+ let u = class extends A {
155
+ //#region Lifecycle
156
+ constructor(e) {
157
+ super(e), this.type = "arcgis-tool";
158
+ }
159
+ //#endregion
160
+ //#region Public Methods
161
+ async createRuntimeTools() {
162
+ if (!this.name)
163
+ throw new Error("ArcgisTool name is required");
164
+ return [await U(re(this.name))];
165
+ }
166
+ static fromJSON(e) {
167
+ return new u({
168
+ name: e.name,
169
+ requireApproval: e.require_approval
170
+ });
171
+ }
172
+ //#endregion
173
+ };
174
+ N([
175
+ n()
176
+ ], u.prototype, "name", 2);
177
+ N([
178
+ n()
179
+ ], u.prototype, "requireApproval", 2);
180
+ N([
181
+ n()
182
+ ], u.prototype, "type", 2);
183
+ u = N([
184
+ l("ArcgisTool")
185
+ ], u);
186
+ var oe = Object.defineProperty, se = Object.getOwnPropertyDescriptor, T = (e) => {
187
+ throw TypeError(e);
188
+ }, _ = (e, t, o, s) => {
189
+ for (var r = s > 1 ? void 0 : s ? se(t, o) : t, a = e.length - 1, i; a >= 0; a--)
190
+ (i = e[a]) && (r = (s ? i(t, o, r) : i(r)) || r);
191
+ return s && r && oe(t, o, r), r;
192
+ }, ae = (e, t, o) => t.has(e) || T("Cannot " + o), ie = (e, t, o) => t.has(e) ? T("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, o), ne = (e, t, o) => (ae(e, t, "access private method"), o), S, D;
193
+ let m = class extends d {
194
+ //#region Lifecycle
195
+ constructor(e) {
196
+ super(e), ie(this, S), this.type = "agent-node";
197
+ }
198
+ //#endregion
199
+ //#region Public Methods
200
+ createRuntimeNode() {
201
+ let e;
202
+ return async (t, o) => {
203
+ e ??= ne(this, S, D).call(this);
204
+ const r = await (await e).run(t, o), a = this.outputSchema?.safeParse(r);
205
+ if (a && !a.success)
206
+ throw a.error;
207
+ const i = a?.data, O = i ?? r.outputMessage;
208
+ return {
209
+ agentExecutionContext: r.agentExecutionContext,
210
+ ...i ? {} : { outputMessage: r.outputMessage },
211
+ status: r.status,
212
+ summary: r.summary,
213
+ nodes: {
214
+ [this.id]: { output: O }
215
+ }
216
+ };
217
+ };
218
+ }
219
+ compile(e) {
220
+ const t = e.outgoingEdges[0]?.targetNodeId;
221
+ return {
222
+ runtimeNode: this.createRuntimeNode(),
223
+ edges: [
224
+ {
225
+ from: this.id,
226
+ decide: (o) => o.status === "failed" ? void 0 : t
227
+ }
228
+ ],
229
+ schemas: [
230
+ c.object({
231
+ output: this.outputSchema ?? c.string()
232
+ })
233
+ ]
234
+ };
235
+ }
236
+ static fromJSON(e) {
237
+ const t = new m({
238
+ id: e.id,
239
+ label: e.label,
240
+ prompt: e.prompt?.content,
241
+ type: "agent-node",
242
+ modelTier: e.llm_model?.model_tier
243
+ });
244
+ return e.structured_output && (t.outputSchema = J(e.structured_output)), t.tools = e.tools?.filter((o) => o.type === "arcgis_tool").map((o) => u.fromJSON(o)), t;
245
+ }
246
+ //#endregion
247
+ };
248
+ S = /* @__PURE__ */ new WeakSet();
249
+ D = async function() {
250
+ const e = this.prompt;
251
+ if (!e?.trim())
252
+ throw new Error(`WebAgent agent node "${this.id}" requires a prompt.`);
253
+ const t = [];
254
+ if (this.tools)
255
+ for (const o of this.tools) {
256
+ const s = await o.createRuntimeTools();
257
+ t.push(...s);
258
+ }
259
+ return new B({
260
+ name: this.id,
261
+ // TODO: change to label
262
+ outputSchema: this.outputSchema,
263
+ modelTier: this.modelTier,
264
+ prompt: e,
265
+ tools: t
266
+ });
267
+ };
268
+ _([
269
+ n()
270
+ ], m.prototype, "type", 2);
271
+ _([
272
+ n()
273
+ ], m.prototype, "prompt", 2);
274
+ _([
275
+ n()
276
+ ], m.prototype, "outputSchema", 2);
277
+ _([
278
+ n()
279
+ ], m.prototype, "tools", 2);
280
+ _([
281
+ n()
282
+ ], m.prototype, "modelTier", 2);
283
+ m = _([
284
+ l("AgentNode")
285
+ ], m);
286
+ var ce = Object.defineProperty, pe = Object.getOwnPropertyDescriptor, P = (e, t, o, s) => {
287
+ for (var r = s > 1 ? void 0 : s ? pe(t, o) : t, a = e.length - 1, i; a >= 0; a--)
288
+ (i = e[a]) && (r = (s ? i(t, o, r) : i(r)) || r);
289
+ return s && r && ce(t, o, r), r;
290
+ };
291
+ let h = class extends d {
292
+ //#region Lifecycle
293
+ constructor(e) {
294
+ super(e), this.type = "end-message-node";
295
+ }
296
+ //#endregion
297
+ //#region Public Methods
298
+ createRuntimeNode() {
299
+ return async (e) => {
300
+ const t = await Z.fromTemplate(this.message, { templateFormat: "mustache" }).format(e);
301
+ return {
302
+ outputMessage: t,
303
+ status: "success",
304
+ summary: t
305
+ };
306
+ };
307
+ }
308
+ compile(e) {
309
+ return {
310
+ runtimeNode: this.createRuntimeNode(),
311
+ edges: []
312
+ };
313
+ }
314
+ static fromJSON(e) {
315
+ const t = new h({
316
+ id: e.id,
317
+ label: e.label,
318
+ type: "end-message-node"
319
+ });
320
+ return t.message = e.message, t;
321
+ }
322
+ //#endregion
323
+ //#region Private Methods
324
+ //#endregion
325
+ };
326
+ P([
327
+ n()
328
+ ], h.prototype, "type", 2);
329
+ P([
330
+ n()
331
+ ], h.prototype, "message", 2);
332
+ h = P([
333
+ l("EndMessageNode")
334
+ ], h);
335
+ var me = Object.defineProperty, de = Object.getOwnPropertyDescriptor, R = (e, t, o, s) => {
336
+ for (var r = s > 1 ? void 0 : s ? de(t, o) : t, a = e.length - 1, i; a >= 0; a--)
337
+ (i = e[a]) && (r = (s ? i(t, o, r) : i(r)) || r);
338
+ return s && r && me(t, o, r), r;
339
+ };
340
+ let w = class extends d {
341
+ //#region Lifecycle
342
+ constructor(e) {
343
+ super(e), this.type = "start-node";
344
+ }
345
+ //#endregion
346
+ //#region Public Methods
347
+ createRuntimeNode() {
348
+ return (e) => ({ question: e.agentExecutionContext.userRequest });
349
+ }
350
+ static fromJSON(e) {
351
+ return new w({
352
+ id: e.id,
353
+ label: e.label,
354
+ type: "start-node"
355
+ });
356
+ }
357
+ //#endregion
358
+ //#region Private Methods
359
+ //#endregion
360
+ };
361
+ R([
362
+ n()
363
+ ], w.prototype, "type", 2);
364
+ w = R([
365
+ l("StartNode")
366
+ ], w);
367
+ function ue(e) {
368
+ switch (e.type) {
369
+ case "agent_node":
370
+ return m.fromJSON(e);
371
+ case "end_message_node":
372
+ return h.fromJSON(e);
373
+ case "start_node":
374
+ return w.fromJSON(e);
375
+ default:
376
+ throw new Error(`WebAgent node "${e.id}" uses unsupported type "${e.type}".`);
377
+ }
378
+ }
379
+ function le(e = {}) {
380
+ const t = Object.keys(e);
381
+ if (H(t), t.includes("nodes"))
382
+ throw new Error("node state cannot define reserved field: nodes.");
383
+ const o = K(e);
384
+ return x.Root({
385
+ ...o,
386
+ nodes: x({
387
+ reducer: (s, r) => ({ ...s, ...r }),
388
+ default: () => ({})
389
+ }),
390
+ ...Q()
391
+ });
392
+ }
393
+ function q(e) {
394
+ const t = /* @__PURE__ */ new Set();
395
+ for (const s of e)
396
+ for (const r of Object.keys(s.shape ?? {}))
397
+ r !== "nodes" && t.add(r);
398
+ const o = Object.fromEntries([...t].map((s) => [s, void 0]));
399
+ return le(o);
400
+ }
401
+ class E {
402
+ //#endregion Private Properties
403
+ //#region Lifecycle
404
+ constructor(t, o, s) {
405
+ this.sourceJSON = t, this.edges = o, this.nodes = s, this._loaded = !1;
406
+ }
407
+ //#endregion Lifecycle
408
+ //#region Public Methods
409
+ static fromJSON(t) {
410
+ return new E(
411
+ t,
412
+ t.graph.edges.map((o) => p.fromJSON(o)),
413
+ t.graph.nodes.map((o) => ue(o))
414
+ );
415
+ }
416
+ async load() {
417
+ return this._loadPromise ??= Promise.all(this.nodes.map(async (t) => await t.load())).then(() => {
418
+ this._loaded = !0;
419
+ }), await this._loadPromise, this;
420
+ }
421
+ getSchemas() {
422
+ const t = Object.fromEntries(
423
+ this._getNodeCompilations().flatMap((s, r) => {
424
+ const a = this.nodes[r];
425
+ return s.schemas?.map((i) => [a.id, i]) ?? [];
426
+ })
427
+ );
428
+ return [c.object({
429
+ loopCounts: c.record(c.string(), c.number()).optional(),
430
+ nodes: c.object(t).partial().optional(),
431
+ question: c.string().optional()
432
+ })];
433
+ }
434
+ generate() {
435
+ this._assertLoaded(), this._nodeCompilations = void 0;
436
+ const t = this._getNodeCompilations(), o = q(this.getSchemas()), s = this.nodes.find((i) => i.type === "start-node")?.id, r = {}, a = [];
437
+ for (const [i, O] of this.nodes.entries()) {
438
+ const b = t[i];
439
+ b && (b.runtimeNode && (r[O.id] = b.runtimeNode), a.push(...b.edges));
440
+ }
441
+ return {
442
+ createGraph: () => z(r, a, o, { entryNode: s }),
443
+ workspace: o
444
+ };
445
+ }
446
+ //#endregion Public Methods
447
+ //#region Private Methods
448
+ _assertLoaded() {
449
+ if (!this._loaded)
450
+ throw new Error("AgenticWorkflowRuntime must be loaded before it can generate a graph.");
451
+ }
452
+ _getNodeCompilations() {
453
+ return this._assertLoaded(), this._nodeCompilations ??= this.nodes.map(
454
+ (t) => t.compile({
455
+ outgoingEdges: this.edges.filter((o) => o.sourceNodeId === t.id)
456
+ })
457
+ );
458
+ }
459
+ //#endregion Private Methods
460
+ }
461
+ var he = Object.defineProperty, ge = Object.getOwnPropertyDescriptor, C = (e, t, o, s) => {
462
+ for (var r = s > 1 ? void 0 : s ? ge(t, o) : t, a = e.length - 1, i; a >= 0; a--)
463
+ (i = e[a]) && (r = (s ? i(t, o, r) : i(r)) || r);
464
+ return s && r && he(t, o, r), r;
465
+ };
466
+ const fe = () => {
467
+ throw new Error("WebAgent must be loaded before it can run.");
468
+ };
469
+ let g = class extends L {
470
+ //#region Lifecycle
471
+ constructor(e) {
472
+ super(e);
473
+ }
474
+ //#endregion
475
+ //#region Public Methods
476
+ async load() {
477
+ if (this.portalItem) {
478
+ try {
479
+ await this.portalItem.load();
480
+ } catch (o) {
481
+ throw new y("web-agent:load-portal-item", "Failed to load portal item", { error: o });
482
+ }
483
+ const t = await this.portalItem.fetchData();
484
+ if (this.sourceJSON = t, !this.portalItem.title)
485
+ throw new y("web-agent:missing-title", "The portal item is missing a title");
486
+ }
487
+ if (!this.sourceJSON)
488
+ throw new y("web-agent:missing-source-json", "The source JSON is missing");
489
+ if (!this.sourceJSON.description)
490
+ throw new y("web-agent:missing-description", "The source JSON is missing a description");
491
+ const e = E.fromJSON(this.sourceJSON);
492
+ return await e.load(), this._runtime = e, this.description = this.sourceJSON.description, this.name = this.portalItem?.title ?? `web-agent-${Date.now()}`, this.generate(), this;
493
+ }
494
+ getSchemas() {
495
+ return this._runtime?.getSchemas() ?? [];
496
+ }
497
+ generate() {
498
+ if (!this._runtime) {
499
+ this._set("workspace", q([])), this._set("createGraph", fe);
500
+ return;
501
+ }
502
+ const { createGraph: e, workspace: t } = this._runtime.generate();
503
+ this._set("workspace", t), this._set("createGraph", e);
504
+ }
505
+ //#endregion
506
+ };
507
+ C([
508
+ n({ type: I })
509
+ ], g.prototype, "portalItem", 2);
510
+ C([
511
+ n()
512
+ ], g.prototype, "sourceJSON", 2);
513
+ g = C([
514
+ l("WebAgent")
515
+ ], g);
516
+ class _e extends F {
6
517
  static {
7
- this.properties = { agent: 0, context: 0 };
518
+ this.properties = { agent: 0, context: 0, itemId: 1, workflow: 0 };
8
519
  }
520
+ #e;
9
521
  async getContext() {
10
- return e(this.context) ? await this.context() : this.context;
522
+ return M(this.context) ? await this.context() : this.context;
523
+ }
524
+ async load() {
525
+ let t;
526
+ if (this.itemId) {
527
+ const o = G.getDefault();
528
+ t = new g({ portalItem: new I({ id: this.itemId, portal: o }) });
529
+ } else this.workflow && (t = new g({ sourceJSON: this.workflow }));
530
+ if (t && (await t.load(), this.agent = t.registration), !this.agent)
531
+ throw new Error("Failed to initialize the assistant agent because the agent registration is missing.");
532
+ this.#e = j(this);
11
533
  }
12
- load() {
13
- i(this);
534
+ disconnectedCallback() {
535
+ this.#e?.unregister(this.agent.id), super.disconnectedCallback();
14
536
  }
15
537
  }
16
- t("arcgis-assistant-agent", n);
538
+ W("arcgis-assistant-agent", _e);
17
539
  export {
18
- n as ArcgisAssistantAgent
540
+ _e as ArcgisAssistantAgent
19
541
  };
@@ -1,45 +1,50 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
2
2
  import { c as s } from "../../chunks/runtime.js";
3
3
  import { css as e, html as t } from "lit";
4
4
  import { LitElement as i } from "@arcgis/lumina";
5
- import { createRef as a, ref as o } from "lit/directives/ref.js";
6
- import l from "@arcgis/core/core/Collection.js";
7
- import { watch as n } from "@arcgis/core/core/reactiveUtils.js";
8
- const r = e`.messages-container{display:flex;flex:1;flex-direction:column;line-height:var(--calcite-font-line-height-relative-snug)}.messages-list{padding:var(--calcite-spacing-lg);display:flex;flex-direction:column;gap:var(--calcite-spacing-xxl);flex:1 1 auto;min-height:0;justify-content:flex-end;overflow:auto}`;
9
- class c extends i {
5
+ import { createRef as a, ref as l } from "lit/directives/ref.js";
6
+ import n from "@arcgis/core/core/Collection.js";
7
+ import { when as r, watch as o } from "@arcgis/core/core/reactiveUtils.js";
8
+ const c = e`.messages-container{display:flex;flex:1;flex-direction:column;line-height:var(--calcite-font-line-height-relative-snug)}.messages-list{padding:var(--calcite-spacing-lg);display:flex;flex-direction:column;gap:var(--calcite-spacing-xxl);flex:1 1 auto;min-height:0;justify-content:flex-end;overflow:auto}.end-ref{margin-top:var(--calcite-spacing-lg)}`;
9
+ class m extends i {
10
10
  constructor() {
11
- super(...arguments), this.#s = a(), this.loading = !1, this.messages = new l([]), this.interrupt = null;
11
+ super(...arguments), this.#e = a(), this.#s = !1, this.loading = !1, this.messages = new n([]), this.interrupt = null;
12
12
  }
13
13
  static {
14
14
  this.properties = { loading: 5, messages: 0, interrupt: 0 };
15
15
  }
16
16
  static {
17
- this.styles = r;
17
+ this.styles = c;
18
18
  }
19
+ #e;
19
20
  #s;
20
21
  firstUpdated() {
21
- this._scrollToEnd();
22
+ this.#t();
22
23
  }
23
24
  loaded() {
24
25
  this.manager.onLifecycle(() => [
25
26
  this.messages.on("change", () => {
26
- this._scrollToEnd();
27
+ this.#t();
27
28
  }),
28
- n(() => [this.loading, this.interrupt], () => {
29
- this._scrollToEnd();
30
- })
29
+ r(() => !this.loading, () => {
30
+ this.#s = !1;
31
+ }),
32
+ o(() => [this.loading, this.interrupt], () => this.#t())
31
33
  ]);
32
34
  }
33
- _scrollToEnd() {
35
+ #t() {
34
36
  requestAnimationFrame(() => {
35
- this.#s.value?.scrollIntoView({ behavior: "smooth" });
37
+ this.#s || this.#e.value?.scrollIntoView({ behavior: "smooth", block: "end" });
36
38
  });
37
39
  }
40
+ #i() {
41
+ this.#s = !0;
42
+ }
38
43
  render() {
39
- return t`<div class="messages-container"><div class="messages-list"><slot name=message-starter></slot><slot name=messages></slot><slot name=message-loading></slot></div><div ${o(this.#s)}></div></div>`;
44
+ return t`<div class="messages-container" @wheel=${this.#i}><div class="messages-list"><slot name=message-starter></slot><slot name=messages></slot><slot name=message-loading></slot></div><div class="end-ref" ${l(this.#e)}></div></div>`;
40
45
  }
41
46
  }
42
- s("arcgis-assistant-chat", c);
47
+ s("arcgis-assistant-chat", m);
43
48
  export {
44
- c as ArcgisAssistantChat
49
+ m as ArcgisAssistantChat
45
50
  };
@@ -1,4 +1,4 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
2
2
  import { c as d } from "../../chunks/runtime.js";
3
3
  import { css as p, html as c } from "lit";
4
4
  import { LitElement as f, createEvent as l, safeClassMap as g } from "@arcgis/lumina";