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

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 (334) hide show
  1. package/LICENSE.md +4 -2
  2. package/README.md +2 -2
  3. package/dist/agent-utils/LLMAgent.d.ts +9 -7
  4. package/dist/agent-utils/LLMAgent.js +63 -60
  5. package/dist/agent-utils/WorkflowAgent.js +14 -15
  6. package/dist/agent-utils/index.d.ts +78 -0
  7. package/dist/agent-utils/index.js +116 -97
  8. package/dist/agent-utils/middlewares/trace.d.ts +2 -0
  9. package/dist/agent-utils/middlewares/trace.js +5 -5
  10. package/dist/agent-utils/types.d.ts +13 -13
  11. package/dist/agentic-workflow/AgenticWorkflowRuntime.d.ts +24 -0
  12. package/dist/agentic-workflow/Edge.d.ts +16 -0
  13. package/dist/agentic-workflow/WebAgent.d.ts +39 -0
  14. package/dist/agentic-workflow/jsonTypes.d.ts +229 -0
  15. package/dist/agentic-workflow/nodes/AgentNode.d.ts +28 -0
  16. package/dist/agentic-workflow/nodes/BaseNode.d.ts +35 -0
  17. package/dist/agentic-workflow/nodes/EndMessageNode.d.ts +25 -0
  18. package/dist/agentic-workflow/nodes/HumanInTheLoopNode.d.ts +37 -0
  19. package/dist/agentic-workflow/nodes/StartNode.d.ts +21 -0
  20. package/dist/agentic-workflow/nodes/tools/ArcgisTool.d.ts +21 -0
  21. package/dist/agentic-workflow/types.d.ts +29 -0
  22. package/dist/agents/runtime/skill/createSkillAgent.d.ts +30 -0
  23. package/dist/agents/runtime/skill/createSkillAgent.js +260 -0
  24. package/dist/agents/runtime/skill/loadAgentSkills.d.ts +16 -0
  25. package/dist/agents/runtime/skill/types.d.ts +20 -0
  26. package/dist/{cdn/WNS5ZUF5.js → agents/runtime/skill/types.js} +1 -1
  27. package/dist/agents/tools/filter/clearFilters/adapter.d.ts +8 -0
  28. package/dist/agents/tools/filter/clearFilters/adapter.js +22 -0
  29. package/dist/agents/tools/filter/resetMap/adapter.d.ts +8 -0
  30. package/dist/agents/tools/filter/resetMap/adapter.js +22 -0
  31. package/dist/agents/tools/filter/setFeatureEffect/adapter.d.ts +8 -0
  32. package/dist/agents/tools/filter/setFeatureEffect/adapter.js +122 -0
  33. package/dist/agents/tools/help/listFields/adapter.d.ts +11 -0
  34. package/dist/agents/tools/help/listFields/adapter.js +30 -0
  35. package/dist/agents/tools/navigation/goToAddress/adapter.d.ts +10 -0
  36. package/dist/agents/tools/navigation/goToAddress/adapter.js +60 -0
  37. package/dist/agents/tools/navigation/goToBookmark/adapter.d.ts +8 -0
  38. package/dist/agents/tools/navigation/goToBookmark/adapter.js +30 -0
  39. package/dist/agents/tools/navigation/goToFeatures/adapter.d.ts +8 -0
  40. package/dist/agents/tools/navigation/goToFeatures/adapter.js +50 -0
  41. package/dist/agents/tools/navigation/goToFullExtent/adapter.d.ts +8 -0
  42. package/dist/agents/tools/navigation/goToFullExtent/adapter.js +27 -0
  43. package/dist/agents/tools/navigation/goToHomeExtent/adapter.d.ts +8 -0
  44. package/dist/agents/tools/navigation/goToHomeExtent/adapter.js +24 -0
  45. package/dist/agents/tools/navigation/goToLayer/adapter.d.ts +8 -0
  46. package/dist/agents/tools/navigation/goToLayer/adapter.js +26 -0
  47. package/dist/agents/tools/navigation/goToScale/adapter.d.ts +8 -0
  48. package/dist/agents/tools/navigation/goToScale/adapter.js +21 -0
  49. package/dist/agents/tools/navigation/goToViewpoint/adapter.d.ts +8 -0
  50. package/dist/agents/tools/navigation/goToViewpoint/adapter.js +42 -0
  51. package/dist/agents/tools/navigation/goToZoom/adapter.d.ts +8 -0
  52. package/dist/agents/tools/navigation/goToZoom/adapter.js +21 -0
  53. package/dist/agents/tools/query/getAttribute/adapter.d.ts +8 -0
  54. package/dist/agents/tools/query/getAttribute/adapter.js +40 -0
  55. package/dist/agents/tools/query/getStatistics/adapter.d.ts +8 -0
  56. package/dist/agents/tools/query/getStatistics/adapter.js +158 -0
  57. package/dist/agents/tools/query/getTopFeatures/adapter.d.ts +8 -0
  58. package/dist/agents/tools/query/getTopFeatures/adapter.js +145 -0
  59. package/dist/agents/tools/query/queryFeatures/adapter.d.ts +8 -0
  60. package/dist/agents/tools/query/queryFeatures/adapter.js +131 -0
  61. package/dist/agents/tools/search/findRelevantFields/adapter.d.ts +8 -0
  62. package/dist/agents/tools/search/findRelevantFields/adapter.js +57 -0
  63. package/dist/agents/tools/search/findRelevantLayers/adapter.d.ts +8 -0
  64. package/dist/agents/tools/search/findRelevantLayers/adapter.js +38 -0
  65. package/dist/agents/tools/shared/resolveToolArtifact.d.ts +22 -0
  66. package/dist/agents/tools/shared/resolveToolArtifact.js +20 -0
  67. package/dist/agents/tools/shared/types.d.ts +22 -0
  68. package/dist/agents/tools/shared/types.js +6 -0
  69. package/dist/cdn/2BNQ6A6J.js +2 -0
  70. package/dist/cdn/2MWUBKWI.js +2 -0
  71. package/dist/cdn/{F6QHMKF5.js → 2O4DON37.js} +1 -1
  72. package/dist/cdn/2W7LK4HA.js +2 -0
  73. package/dist/cdn/33PB7ALY.js +2 -0
  74. package/dist/cdn/{5CV7R5IS.js → 33SFAZQG.js} +5 -5
  75. package/dist/cdn/34O57OGV.js +2 -0
  76. package/dist/cdn/{5W7S2RS4.js → 3UEKINYC.js} +1 -1
  77. package/dist/cdn/4IU63OWQ.js +2 -0
  78. package/dist/cdn/5A355PGH.js +14 -0
  79. package/dist/cdn/5HBAJ57P.js +2 -0
  80. package/dist/cdn/5MK44FNO.js +2 -0
  81. package/dist/cdn/5Q2XRQS6.js +2 -0
  82. package/dist/cdn/6ECRQVHY.js +2 -0
  83. package/dist/cdn/6OOZSZRJ.js +2 -0
  84. package/dist/cdn/6OUIUXAJ.js +2 -0
  85. package/dist/cdn/{UPEEHMSY.js → 6P44KOKX.js} +1 -1
  86. package/dist/cdn/73TMZQI5.js +2 -0
  87. package/dist/cdn/74CVYM72.js +19 -0
  88. package/dist/cdn/7EHOFQ2P.js +3 -0
  89. package/dist/cdn/7KSFIRXB.js +2 -0
  90. package/dist/cdn/AHCXG7XF.js +2 -0
  91. package/dist/cdn/{ZS2TZ6BF.js → AOVJ34QE.js} +1 -1
  92. package/dist/cdn/{Q7TL5Q5N.js → APFZY4PI.js} +1 -1
  93. package/dist/cdn/AVRS6UCQ.js +2 -0
  94. package/dist/cdn/AVZ5Y6BK.js +11 -0
  95. package/dist/cdn/AXTQU5YL.js +56 -0
  96. package/dist/cdn/BBPD2AS7.js +2 -0
  97. package/dist/cdn/BFZ5S7NF.js +2 -0
  98. package/dist/cdn/{6ZW7Z36F.js → BL273EGZ.js} +3 -3
  99. package/dist/cdn/C7JPWFZE.js +2 -0
  100. package/dist/cdn/CCC6LBMY.js +2 -0
  101. package/dist/cdn/{5ZZGKP7N.js → CEKOEHB3.js} +1 -1
  102. package/dist/cdn/CFAC4FN3.js +2 -0
  103. package/dist/cdn/COH3QXWG.js +4 -0
  104. package/dist/cdn/DB2TFPIO.js +2 -0
  105. package/dist/cdn/DE26DAW5.js +2 -0
  106. package/dist/cdn/DG27JEYG.js +50 -0
  107. package/dist/cdn/DKA6PSYN.js +2 -0
  108. package/dist/cdn/DQ2Z65UO.js +3 -0
  109. package/dist/cdn/DWH23NJN.js +2 -0
  110. package/dist/cdn/EDXTPEEU.js +2 -0
  111. package/dist/cdn/ENM3L4AC.js +2 -0
  112. package/dist/cdn/EVMIYZWD.js +2 -0
  113. package/dist/cdn/EYOWRGDP.js +2 -0
  114. package/dist/cdn/EYY367WR.js +2 -0
  115. package/dist/cdn/F5NIRETW.js +2 -0
  116. package/dist/cdn/FCI6M62J.js +2 -0
  117. package/dist/cdn/FDOMMK2M.js +2 -0
  118. package/dist/cdn/FS7GXTTQ.js +6 -0
  119. package/dist/cdn/{T537PKP4.js → FYZATVB3.js} +1 -1
  120. package/dist/cdn/H6P3WP5D.js +14 -0
  121. package/dist/cdn/HHP5YLUI.js +2 -0
  122. package/dist/cdn/HIAQARIQ.js +2 -0
  123. package/dist/cdn/HMIDFTEI.js +2 -0
  124. package/dist/cdn/HMNBUGH2.js +2 -0
  125. package/dist/cdn/HR6GWPKX.js +2 -0
  126. package/dist/cdn/{FX7UOGHP.js → ICBIUFK7.js} +1 -1
  127. package/dist/cdn/IH26MIYY.js +2 -0
  128. package/dist/cdn/IHP25JWI.js +99 -0
  129. package/dist/cdn/IYLFJCJ2.js +181 -0
  130. package/dist/cdn/J6A4AS7E.js +22 -0
  131. package/dist/cdn/{NE7E52YR.js → JEBRN3EU.js} +9 -3
  132. package/dist/cdn/JICNSK6Y.js +6 -0
  133. package/dist/cdn/JQYLMTDP.js +2 -0
  134. package/dist/cdn/K5JVB6FU.js +2 -0
  135. package/dist/cdn/K7XWGSLN.js +2 -0
  136. package/dist/cdn/K7YQIJFT.js +2 -0
  137. package/dist/cdn/KH4V4I3W.js +2 -0
  138. package/dist/cdn/KMLJS2VW.js +2 -0
  139. package/dist/cdn/LAVFUDUG.js +2 -0
  140. package/dist/cdn/{7RCQFLPP.js → LK7ZIQW6.js} +1 -1
  141. package/dist/cdn/LOQ2PKV5.js +208 -0
  142. package/dist/cdn/LXPGQNXQ.js +5 -0
  143. package/dist/cdn/MJSIYEWN.js +2 -0
  144. package/dist/cdn/{ZEYIBYSF.js → MWYBF3F3.js} +1 -1
  145. package/dist/cdn/{24QNMEFG.js → MXTXJKFE.js} +1 -1
  146. package/dist/cdn/NEV6OZN3.js +71 -0
  147. package/dist/cdn/O4NVW75A.js +2 -0
  148. package/dist/cdn/{23EQTPO3.js → OKVLGJAG.js} +1 -1
  149. package/dist/cdn/OMF6ITSG.js +2 -0
  150. package/dist/cdn/ONQ6JSBJ.js +2 -0
  151. package/dist/cdn/OZAZ277H.js +2 -0
  152. package/dist/cdn/P4GFYBBO.js +3 -0
  153. package/dist/cdn/P4XZMBU5.js +2 -0
  154. package/dist/cdn/POL6HKCG.js +72 -0
  155. package/dist/cdn/POZYDAU2.js +2 -0
  156. package/dist/cdn/{LQ6R5YRN.js → PQ2DPOFM.js} +1 -1
  157. package/dist/cdn/PYGX4HN7.js +2 -0
  158. package/dist/cdn/QNXI3WOF.js +179 -0
  159. package/dist/cdn/{DXVU45KM.js → QRMRID2M.js} +1 -1
  160. package/dist/cdn/R74ZHFA6.js +2 -0
  161. package/dist/cdn/RFVZ7KCG.js +66 -0
  162. package/dist/cdn/RHYNE5OE.js +2 -0
  163. package/dist/cdn/RLEHNAIA.js +2 -0
  164. package/dist/cdn/ROQGPAR5.js +9 -0
  165. package/dist/cdn/RXF2NUOL.js +2 -0
  166. package/dist/cdn/{X2ZDYHCG.js → SDWWUWAF.js} +10 -5
  167. package/dist/cdn/SHI76XUV.js +2 -0
  168. package/dist/cdn/SITY6L4S.js +2 -0
  169. package/dist/cdn/STHBRTTD.js +2 -0
  170. package/dist/cdn/{WAIFKDR3.js → SXM4NUT5.js} +1 -1
  171. package/dist/cdn/SZRJTQ54.js +2 -0
  172. package/dist/cdn/TO2NY7EA.js +2 -0
  173. package/dist/cdn/TPULIO6I.js +34 -0
  174. package/dist/cdn/TVEEQSMF.js +2 -0
  175. package/dist/cdn/TWU3QXAS.js +2 -0
  176. package/dist/cdn/TYATJUNF.js +2 -0
  177. package/dist/cdn/UCTC4JN4.js +3 -0
  178. package/dist/cdn/UDRKUVZP.js +2 -0
  179. package/dist/cdn/{6YMR4QSD.js → UHEYPSOR.js} +1 -1
  180. package/dist/cdn/UHICISBZ.js +2 -0
  181. package/dist/cdn/UO5PBOQR.js +2 -0
  182. package/dist/cdn/UZLQALHY.js +2 -0
  183. package/dist/cdn/V6HOUZPZ.js +2 -0
  184. package/dist/cdn/{P7DG5T3Z.js → V7Y22FRP.js} +1 -1
  185. package/dist/cdn/VAXH6RUQ.js +134 -0
  186. package/dist/cdn/VNLSYVPE.js +2 -0
  187. package/dist/cdn/VR3CF3ZY.js +2 -0
  188. package/dist/cdn/VWP2B4LB.js +2 -0
  189. package/dist/cdn/VXFQANGJ.js +2 -0
  190. package/dist/cdn/WKZHFSH3.js +2 -0
  191. package/dist/cdn/{AZGGTNA3.js → WSWB3B7B.js} +1 -1
  192. package/dist/cdn/WVP73XWD.js +2 -0
  193. package/dist/cdn/WXQ26G5Q.js +2 -0
  194. package/dist/cdn/XQ3NBBQ3.js +2 -0
  195. package/dist/cdn/{7CYGX4F4.js → YHWYTHID.js} +1 -1
  196. package/dist/cdn/YIZ7PR2G.js +2 -0
  197. package/dist/cdn/Z5XQLSYH.js +2 -0
  198. package/dist/cdn/ZFOG3KXV.js +2 -0
  199. package/dist/cdn/{ZTBA5PM7.js → ZU2FHVNK.js} +1 -1
  200. package/dist/cdn/agent-utils/index.js +1 -1
  201. package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +1 -2
  202. package/dist/cdn/agent-utils/middlewares/middleware.js +1 -1
  203. package/dist/cdn/agent-utils/middlewares/trace.js +1 -1
  204. package/dist/cdn/assets/assistant/t9n/messages.en.json +1 -1
  205. package/dist/cdn/assets/assistant-interrupt/t9n/messages.en.json +1 -1
  206. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.en.json +1 -0
  207. package/dist/cdn/assets/assistant-message/t9n/messages.en.json +1 -0
  208. package/dist/cdn/assets/assistant-message-loading/t9n/messages.en.json +1 -0
  209. package/dist/cdn/index.js +1 -1
  210. package/dist/chunks/SKILL.js +5 -0
  211. package/dist/chunks/SKILL2.js +5 -0
  212. package/dist/chunks/SKILL3.js +22 -0
  213. package/dist/chunks/SKILL4.js +5 -0
  214. package/dist/chunks/adapter.js +1126 -2010
  215. package/dist/chunks/aiFactory.js +100 -0
  216. package/dist/chunks/arcgisKnowledgeGraph.js +96 -76
  217. package/dist/chunks/arcgisToolRegistry.js +88 -0
  218. package/dist/chunks/arcgis_knowledge_current_lc_context.js +19 -2
  219. package/dist/chunks/arcgis_knowledge_current_map_context.js +31 -2
  220. package/dist/chunks/arcgis_knowledge_cypher_query_prompt.js +102 -0
  221. package/dist/chunks/arcgis_knowledge_summarize_result_prompt.js +116 -27
  222. package/dist/chunks/baseAgentState.js +58 -0
  223. package/dist/chunks/converterUtils.js +66 -41
  224. package/dist/chunks/dataExplorationAgent.js +19 -0
  225. package/dist/chunks/data_explore_query_prompt.js +9 -4
  226. package/dist/chunks/fetchAgentContext.js +13 -0
  227. package/dist/chunks/fetchService.js +10 -0
  228. package/dist/chunks/fieldStatistics.js +79 -0
  229. package/dist/chunks/formatFeatureAttributes.js +132 -0
  230. package/dist/chunks/generateLayerDescriptions.js +183 -307
  231. package/dist/chunks/helpAgent.js +34 -0
  232. package/dist/chunks/help_prompt.js +34 -17
  233. package/dist/chunks/intent_prompt.js +2 -2
  234. package/dist/chunks/layerStylingGraph.js +101 -83
  235. package/dist/chunks/mergeWhereClauses.js +15 -0
  236. package/dist/chunks/navigationAgent.js +27 -0
  237. package/dist/chunks/navigation_intent_prompt.js +8 -2
  238. package/dist/chunks/orchestrator.js +445 -234
  239. package/dist/chunks/requireAgentServices.js +11 -0
  240. package/dist/chunks/resolvePointGeometryFilter.js +92 -0
  241. package/dist/chunks/state.js +39 -45
  242. package/dist/chunks/utils2.js +11 -11
  243. package/dist/components/arcgis-assistant/customElement.d.ts +102 -1
  244. package/dist/components/arcgis-assistant/customElement.js +331 -183
  245. package/dist/components/arcgis-assistant-agent/customElement.d.ts +13 -1
  246. package/dist/components/arcgis-assistant-agent/customElement.js +674 -10
  247. package/dist/components/arcgis-assistant-chat/customElement.js +22 -17
  248. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +34 -8
  249. package/dist/components/arcgis-assistant-help-agent/customElement.js +31 -8
  250. package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -0
  251. package/dist/components/arcgis-assistant-interrupt/customElement.js +11 -12
  252. package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +12 -8
  253. package/dist/components/arcgis-assistant-knowledge-agent/customElement.d.ts +1 -1
  254. package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +40 -16
  255. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +30 -7
  256. package/dist/components/arcgis-assistant-message/customElement.d.ts +3 -0
  257. package/dist/components/arcgis-assistant-message/customElement.js +9 -8
  258. package/dist/components/arcgis-assistant-message-block/customElement.js +1 -1
  259. package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +3 -0
  260. package/dist/components/arcgis-assistant-message-loading/customElement.js +11 -10
  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 +33 -9
  264. package/dist/components/arcgis-assistant-speech-input/customElement.js +34 -52
  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 +6 -6
  272. package/dist/oauth-callback.html +1 -1
  273. package/dist/orchestrator/models/types.d.ts +1 -0
  274. package/dist/orchestrator/orchestrator/orchestratorEvents.d.ts +78 -0
  275. package/dist/orchestrator/providers/arcgis/aiFactory.d.ts +15 -0
  276. package/dist/orchestrator/types/types.d.ts +17 -0
  277. package/dist/types/lumina.d.ts +5 -4
  278. package/dist/types/preact.d.ts +5 -4
  279. package/dist/types/react.d.ts +5 -4
  280. package/dist/types/stencil.d.ts +7 -6
  281. package/dist/utils/index.d.ts +75 -39
  282. package/dist/utils/index.js +707 -83
  283. package/package.json +35 -12
  284. package/dist/cdn/34SG44C3.js +0 -72
  285. package/dist/cdn/3JGWGKT6.js +0 -2
  286. package/dist/cdn/3NBDVZ2I.js +0 -2
  287. package/dist/cdn/3VOQD2MR.js +0 -2
  288. package/dist/cdn/53NTYC4I.js +0 -2
  289. package/dist/cdn/5QAHYX7Y.js +0 -5
  290. package/dist/cdn/AXDZBBNL.js +0 -45
  291. package/dist/cdn/B7WJFBOZ.js +0 -2
  292. package/dist/cdn/BX7FSMUU.js +0 -56
  293. package/dist/cdn/CHPQM77M.js +0 -181
  294. package/dist/cdn/DHKUXLU3.js +0 -179
  295. package/dist/cdn/DQSEBKOX.js +0 -2
  296. package/dist/cdn/DZ2QWNUA.js +0 -3
  297. package/dist/cdn/EBISDZ5H.js +0 -2
  298. package/dist/cdn/ERL2CB2Y.js +0 -14
  299. package/dist/cdn/F2AHA4GB.js +0 -54
  300. package/dist/cdn/FUIGPHBH.js +0 -2
  301. package/dist/cdn/H2CHHGGH.js +0 -2
  302. package/dist/cdn/HWKDNS4K.js +0 -4
  303. package/dist/cdn/IMQ4TVHF.js +0 -16
  304. package/dist/cdn/IOD3GDA7.js +0 -2
  305. package/dist/cdn/IR7PTESF.js +0 -2
  306. package/dist/cdn/IRZDTYO2.js +0 -2
  307. package/dist/cdn/JIWK6QK6.js +0 -2
  308. package/dist/cdn/JLKGS6Y5.js +0 -36
  309. package/dist/cdn/K3JCH4XW.js +0 -2
  310. package/dist/cdn/KHXUWZHB.js +0 -2
  311. package/dist/cdn/KMQ3SP4I.js +0 -5
  312. package/dist/cdn/LIFK3QSD.js +0 -2
  313. package/dist/cdn/NXKKG5TK.js +0 -2
  314. package/dist/cdn/O3EN27N5.js +0 -2
  315. package/dist/cdn/O3RFFPU3.js +0 -6
  316. package/dist/cdn/PBO6FZN6.js +0 -2
  317. package/dist/cdn/Q3ZW4FYA.js +0 -3
  318. package/dist/cdn/Q6LRANX6.js +0 -2
  319. package/dist/cdn/QCSN44H4.js +0 -2
  320. package/dist/cdn/R56X6ZKR.js +0 -161
  321. package/dist/cdn/RUURNLTP.js +0 -2
  322. package/dist/cdn/T43LEBBE.js +0 -47
  323. package/dist/cdn/TR4GFL7X.js +0 -2
  324. package/dist/cdn/X4XY5HIE.js +0 -2
  325. package/dist/cdn/XOH56EQ2.js +0 -2
  326. package/dist/cdn/XON27U6U.js +0 -2
  327. package/dist/cdn/YIMNOUTF.js +0 -2
  328. package/dist/cdn/YLN2BZ5J.js +0 -2
  329. package/dist/cdn/YUKR4AZW.js +0 -2
  330. package/dist/cdn/Z2G7MP5L.js +0 -22
  331. package/dist/chunks/dataExplorationGraph.js +0 -310
  332. package/dist/chunks/helpGraph.js +0 -126
  333. package/dist/chunks/navigationGraph.js +0 -270
  334. package/dist/chunks/toolCallResponse.js +0 -31
@@ -1,19 +1,683 @@
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 V } from "../../chunks/runtime.js";
3
+ import { LitElement as U } from "@arcgis/lumina";
4
+ import { b as Z, i as K } from "../../chunks/utils2.js";
5
+ import D from "@arcgis/core/portal/PortalItem.js";
6
+ import Q from "@arcgis/core/portal/Portal.js";
7
+ import { property as a, subclass as h } from "@arcgis/core/core/accessorSupport/decorators.js";
8
+ import { BaseAgent as X } from "../../agent-utils/BaseAgent.js";
9
+ import O from "@arcgis/core/core/Error.js";
10
+ import { z as c } from "zod";
11
+ import { c as Y } from "../../chunks/graph.js";
12
+ import $ from "@arcgis/core/core/Accessor.js";
13
+ import { LLMAgent as k } from "../../agent-utils/LLMAgent.js";
14
+ import { r as ee } from "../../chunks/arcgisToolRegistry.js";
15
+ import { PromptTemplate as q } from "@langchain/core/prompts";
16
+ import { NodeInterrupt as te } from "@langchain/langgraph/web";
17
+ import { getHumanInTheLoopPayload as re } from "../../agent-utils/middlewares/humanInTheLoop.js";
18
+ import { Annotation as T } from "@langchain/langgraph";
19
+ import { b as oe, d as se } from "../../chunks/state.js";
20
+ import "@arcgis/core/identity/IdentityManager.js";
21
+ import "@arcgis/core/request.js";
22
+ import "@arcgis/toolkit/string";
23
+ import "../../chunks/generateLayerDescriptions.js";
24
+ import "@langchain/core/messages";
25
+ import "@langchain/core/callbacks/dispatch/web";
26
+ import "@langchain/core/callbacks/base";
27
+ import "@langchain/openai";
28
+ import "@arcgis/core/config.js";
29
+ import "@arcgis/core/core/reactiveUtils.js";
30
+ import "@arcgis/core/layers/FeatureLayer.js";
31
+ import { a as ne } from "../../chunks/baseAgentState.js";
32
+ var ie = Object.defineProperty, ae = Object.getOwnPropertyDescriptor, w = (e, t, r, s) => {
33
+ for (var o = s > 1 ? void 0 : s ? ae(t, r) : t, n = e.length - 1, i; n >= 0; n--)
34
+ (i = e[n]) && (o = (s ? i(t, r, o) : i(o)) || o);
35
+ return s && o && ie(t, r, o), o;
36
+ };
37
+ let p = class extends $ {
38
+ //#region Lifecycle
39
+ constructor(e) {
40
+ super(e);
41
+ }
42
+ //#endregion
43
+ //#region Public Methods
44
+ static fromJSON(e) {
45
+ return new p({
46
+ id: e.id,
47
+ sourceAnchorId: e.source_anchor_id,
48
+ sourceNodeId: e.source_node_id,
49
+ targetAnchorId: e.target_anchor_id,
50
+ targetNodeId: e.target_node_id
51
+ });
52
+ }
53
+ //#endregion
54
+ };
55
+ w([
56
+ a()
57
+ ], p.prototype, "id", 2);
58
+ w([
59
+ a()
60
+ ], p.prototype, "sourceAnchorId", 2);
61
+ w([
62
+ a()
63
+ ], p.prototype, "sourceNodeId", 2);
64
+ w([
65
+ a()
66
+ ], p.prototype, "targetAnchorId", 2);
67
+ w([
68
+ a()
69
+ ], p.prototype, "targetNodeId", 2);
70
+ p = w([
71
+ h("Edge")
72
+ ], p);
73
+ var ce = Object.defineProperty, pe = Object.getOwnPropertyDescriptor, A = (e, t, r, s) => {
74
+ for (var o = s > 1 ? void 0 : s ? pe(t, r) : t, n = e.length - 1, i; n >= 0; n--)
75
+ (i = e[n]) && (o = (s ? i(t, r, o) : i(o)) || o);
76
+ return s && o && ce(t, r, o), o;
77
+ };
78
+ let u = class extends $ {
79
+ //#region Lifecycle
80
+ constructor(e) {
81
+ super(e);
82
+ }
83
+ //#endregion
84
+ //#region Public Methods
85
+ async load() {
86
+ return await Promise.resolve(this);
87
+ }
88
+ compile(e) {
89
+ return {
90
+ runtimeNode: this.createRuntimeNode(),
91
+ edges: e.outgoingEdges.map((t) => ({
92
+ from: this.id,
93
+ to: t.targetNodeId
94
+ }))
95
+ };
96
+ }
97
+ static fromJSON(e) {
98
+ throw new Error("BaseNode is abstract and cannot be instantiated directly.");
99
+ }
100
+ //#endregion
101
+ //#region Private Methods
102
+ //#endregion
103
+ };
104
+ A([
105
+ a()
106
+ ], u.prototype, "id", 2);
107
+ A([
108
+ a()
109
+ ], u.prototype, "label", 2);
110
+ A([
111
+ a()
112
+ ], u.prototype, "type", 2);
113
+ u = A([
114
+ h("BaseNode")
115
+ ], u);
116
+ function M(e) {
117
+ const t = new Set(e.required), r = Object.fromEntries(
118
+ Object.entries(e.properties).map(([s, o]) => {
119
+ const n = W(o);
120
+ return [s, t.has(s) ? n : n.optional()];
121
+ })
122
+ );
123
+ return c.object(r);
124
+ }
125
+ function W(e) {
126
+ let t;
127
+ switch (e.type) {
128
+ case "array":
129
+ t = c.array(e.items ? W(e.items) : c.unknown());
130
+ break;
131
+ case "boolean":
132
+ t = c.boolean();
133
+ break;
134
+ case "number":
135
+ t = c.number();
136
+ break;
137
+ case "object":
138
+ t = M({
139
+ properties: e.properties ?? {},
140
+ required: e.required
141
+ });
142
+ break;
143
+ case "string":
144
+ t = e.enum?.length ? c.enum(e.enum) : c.string();
145
+ break;
146
+ }
147
+ return e.description ? t.describe(e.description) : t;
148
+ }
149
+ var ue = Object.defineProperty, de = Object.getOwnPropertyDescriptor, I = (e, t, r, s) => {
150
+ for (var o = s > 1 ? void 0 : s ? de(t, r) : t, n = e.length - 1, i; n >= 0; n--)
151
+ (i = e[n]) && (o = (s ? i(t, r, o) : i(o)) || o);
152
+ return s && o && ue(t, r, o), o;
153
+ };
154
+ const me = (e) => e.replace(/_([a-z])/gu, (t, r) => r.toUpperCase());
155
+ let f = class extends $ {
156
+ //#region Lifecycle
157
+ constructor(e) {
158
+ super(e), this.type = "arcgis-tool";
159
+ }
160
+ //#endregion
161
+ //#region Public Methods
162
+ async createRuntimeTools() {
163
+ if (!this.name)
164
+ throw new Error("ArcgisTool name is required");
165
+ return [await ee(me(this.name))];
166
+ }
167
+ static fromJSON(e) {
168
+ return new f({
169
+ name: e.name,
170
+ requireApproval: e.require_approval
171
+ });
172
+ }
173
+ //#endregion
174
+ };
175
+ I([
176
+ a()
177
+ ], f.prototype, "name", 2);
178
+ I([
179
+ a()
180
+ ], f.prototype, "requireApproval", 2);
181
+ I([
182
+ a()
183
+ ], f.prototype, "type", 2);
184
+ f = I([
185
+ h("ArcgisTool")
186
+ ], f);
187
+ var he = Object.defineProperty, le = Object.getOwnPropertyDescriptor, F = (e) => {
188
+ throw TypeError(e);
189
+ }, v = (e, t, r, s) => {
190
+ for (var o = s > 1 ? void 0 : s ? le(t, r) : t, n = e.length - 1, i; n >= 0; n--)
191
+ (i = e[n]) && (o = (s ? i(t, r, o) : i(o)) || o);
192
+ return s && o && he(t, r, o), o;
193
+ }, fe = (e, t, r) => t.has(e) || F("Cannot " + r), ge = (e, t, r) => t.has(e) ? F("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), _e = (e, t, r) => (fe(e, t, "access private method"), r), E, L;
194
+ let d = class extends u {
195
+ //#region Lifecycle
196
+ constructor(e) {
197
+ super(e), ge(this, E), this.type = "agent-node";
198
+ }
199
+ //#endregion
200
+ //#region Public Methods
201
+ createRuntimeNode() {
202
+ let e;
203
+ return async (t, r) => {
204
+ e ??= _e(this, E, L).call(this);
205
+ const o = await (await e).run(t, r), n = this.outputSchema?.safeParse(o);
206
+ if (n && !n.success)
207
+ throw n.error;
208
+ const i = n?.data, l = i ?? o.outputMessage;
209
+ return {
210
+ agentExecutionContext: o.agentExecutionContext,
211
+ ...i ? {} : { outputMessage: o.outputMessage },
212
+ status: o.status,
213
+ summary: o.summary,
214
+ nodes: {
215
+ [this.id]: { output: l }
216
+ }
217
+ };
218
+ };
219
+ }
220
+ compile(e) {
221
+ const t = e.outgoingEdges[0]?.targetNodeId;
222
+ return {
223
+ runtimeNode: this.createRuntimeNode(),
224
+ edges: [
225
+ {
226
+ from: this.id,
227
+ decide: (r) => r.status === "failed" ? void 0 : t
228
+ }
229
+ ],
230
+ schemas: [
231
+ c.object({
232
+ output: this.outputSchema ?? c.string()
233
+ })
234
+ ]
235
+ };
236
+ }
237
+ static fromJSON(e) {
238
+ const t = new d({
239
+ id: e.id,
240
+ label: e.label,
241
+ prompt: e.prompt?.content,
242
+ type: "agent-node",
243
+ modelTier: e.llm_model?.model_tier
244
+ });
245
+ return e.structured_output && (t.outputSchema = M(e.structured_output)), t.tools = e.tools?.filter((r) => r.type === "arcgis_tool").map((r) => f.fromJSON(r)), t;
246
+ }
247
+ //#endregion
248
+ };
249
+ E = /* @__PURE__ */ new WeakSet();
250
+ L = async function() {
251
+ const e = this.prompt;
252
+ if (!e?.trim())
253
+ throw new Error(`WebAgent agent node "${this.id}" requires a prompt.`);
254
+ const t = [];
255
+ if (this.tools)
256
+ for (const r of this.tools) {
257
+ const s = await r.createRuntimeTools();
258
+ t.push(...s);
259
+ }
260
+ return new k({
261
+ name: this.id,
262
+ // TODO: change to label
263
+ outputSchema: this.outputSchema,
264
+ modelTier: this.modelTier,
265
+ prompt: e,
266
+ tools: t
267
+ });
268
+ };
269
+ v([
270
+ a()
271
+ ], d.prototype, "type", 2);
272
+ v([
273
+ a()
274
+ ], d.prototype, "prompt", 2);
275
+ v([
276
+ a()
277
+ ], d.prototype, "outputSchema", 2);
278
+ v([
279
+ a()
280
+ ], d.prototype, "tools", 2);
281
+ v([
282
+ a()
283
+ ], d.prototype, "modelTier", 2);
284
+ d = v([
285
+ h("AgentNode")
286
+ ], d);
287
+ var we = Object.defineProperty, ve = Object.getOwnPropertyDescriptor, C = (e, t, r, s) => {
288
+ for (var o = s > 1 ? void 0 : s ? ve(t, r) : t, n = e.length - 1, i; n >= 0; n--)
289
+ (i = e[n]) && (o = (s ? i(t, r, o) : i(o)) || o);
290
+ return s && o && we(t, r, o), o;
291
+ };
292
+ let g = class extends u {
293
+ //#region Lifecycle
294
+ constructor(e) {
295
+ super(e), this.type = "end-message-node";
296
+ }
297
+ //#endregion
298
+ //#region Public Methods
299
+ createRuntimeNode() {
300
+ return async (e) => {
301
+ const t = await q.fromTemplate(this.message, { templateFormat: "mustache" }).format(e);
302
+ return {
303
+ outputMessage: t,
304
+ status: "success",
305
+ summary: t
306
+ };
307
+ };
308
+ }
309
+ compile(e) {
310
+ return {
311
+ runtimeNode: this.createRuntimeNode(),
312
+ edges: []
313
+ };
314
+ }
315
+ static fromJSON(e) {
316
+ const t = new g({
317
+ id: e.id,
318
+ label: e.label,
319
+ type: "end-message-node"
320
+ });
321
+ return t.message = e.message, t;
322
+ }
323
+ //#endregion
324
+ //#region Private Methods
325
+ //#endregion
326
+ };
327
+ C([
328
+ a()
329
+ ], g.prototype, "type", 2);
330
+ C([
331
+ a()
332
+ ], g.prototype, "message", 2);
333
+ g = C([
334
+ h("EndMessageNode")
335
+ ], g);
336
+ var ye = Object.defineProperty, be = Object.getOwnPropertyDescriptor, j = (e) => {
337
+ throw TypeError(e);
338
+ }, b = (e, t, r, s) => {
339
+ for (var o = s > 1 ? void 0 : s ? be(t, r) : t, n = e.length - 1, i; n >= 0; n--)
340
+ (i = e[n]) && (o = (s ? i(t, r, o) : i(o)) || o);
341
+ return s && o && ye(t, r, o), o;
342
+ }, Ne = (e, t, r) => t.has(e) || j("Cannot " + r), Oe = (e, t, r) => t.has(e) ? j("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), R = (e, t, r) => (Ne(e, t, "access private method"), r), S, G, H;
343
+ let m = class extends u {
344
+ //#region Lifecycle
345
+ constructor(e) {
346
+ super(e), Oe(this, S), this.type = "human-in-the-loop-node", this.conditions = [];
347
+ }
348
+ //#endregion
349
+ //#region Public Methods
350
+ createRuntimeNode() {
351
+ return async (e, t) => {
352
+ const r = Se(t, this.id), s = `${r}:${this.id}`, o = re(t);
353
+ if (o === void 0 || !Ie(o, this.response?.type))
354
+ throw new te({
355
+ agentId: r,
356
+ id: s,
357
+ kind: Ae(this.response?.type),
358
+ message: await R(this, S, G).call(this, e),
359
+ metadata: R(this, S, H).call(this, e)
360
+ });
361
+ return { nodes: { [this.id]: { output: o } } };
362
+ };
363
+ }
364
+ compile(e) {
365
+ return {
366
+ runtimeNode: this.createRuntimeNode(),
367
+ edges: [
368
+ {
369
+ from: this.id,
370
+ decide: (t) => {
371
+ if (!this.conditions.length)
372
+ return e.outgoingEdges[0]?.targetNodeId;
373
+ const r = t.nodes?.[this.id]?.output, s = this.conditions.find((o) => Pe(o.optionValue, r));
374
+ if (s)
375
+ return e.outgoingEdges.find((o) => o.sourceAnchorId === s.sourceAnchorId)?.targetNodeId;
376
+ }
377
+ }
378
+ ]
379
+ };
380
+ }
381
+ static fromJSON(e) {
382
+ const t = new m({
383
+ id: e.id,
384
+ label: e.label,
385
+ type: "human-in-the-loop-node"
386
+ });
387
+ return t.message = e.message, t.response = e.response, t.conditions = (e.conditions ?? []).map(({ optionValue: r, source_anchor_id: s }) => ({
388
+ optionValue: r,
389
+ sourceAnchorId: s
390
+ })), t;
391
+ }
392
+ //#endregion
393
+ };
394
+ S = /* @__PURE__ */ new WeakSet();
395
+ G = async function(e) {
396
+ if (this.message?.source === "generated")
397
+ throw new Error(`Human-in-the-loop node "${this.id}" does not support generated messages yet.`);
398
+ const t = this.message?.content;
399
+ if (!t)
400
+ throw new Error(`Human-in-the-loop node "${this.id}" requires a message content.`);
401
+ return await q.fromTemplate(t, { templateFormat: "mustache" }).format(e);
402
+ };
403
+ H = function(e) {
404
+ const t = this.response;
405
+ if (!t || t.type === "confirmation" || t.type === "textInput")
406
+ return;
407
+ const r = t.choices;
408
+ return r?.source === "fixed" ? r.items?.map((o) => o.value ?? o.label ?? "") : r?.source === "reference" ? Ee(e, r.reference)?.map(String) : void 0;
409
+ };
410
+ b([
411
+ a()
412
+ ], m.prototype, "type", 2);
413
+ b([
414
+ a()
415
+ ], m.prototype, "message", 2);
416
+ b([
417
+ a()
418
+ ], m.prototype, "response", 2);
419
+ b([
420
+ a()
421
+ ], m.prototype, "conditions", 2);
422
+ m = b([
423
+ h("HumanInTheLoopNode")
424
+ ], m);
425
+ function Se(e, t) {
426
+ const s = e?.configurable?.agentId;
427
+ return typeof s == "string" && s ? s : t;
428
+ }
429
+ function Ae(e) {
430
+ switch (e) {
431
+ case "singleSelect":
432
+ return "singleSelection";
433
+ case "multipleSelect":
434
+ return "multipleSelection";
435
+ case "textInput":
436
+ return "textInput";
437
+ default:
438
+ return "booleanChoice";
439
+ }
440
+ }
441
+ function Ie(e, t) {
442
+ switch (t) {
443
+ case "confirmation":
444
+ return typeof e == "boolean";
445
+ case "singleSelect":
446
+ return typeof e == "string" || Array.isArray(e) && e.length === 1 && typeof e[0] == "string";
447
+ case "multipleSelect":
448
+ return Array.isArray(e) && e.every((r) => typeof r == "string");
449
+ case "textInput":
450
+ return typeof e == "string";
451
+ default:
452
+ return !0;
453
+ }
454
+ }
455
+ function Pe(e, t) {
456
+ return Array.isArray(t) ? t.some((r) => r === e) : t === e;
457
+ }
458
+ function Ee(e, t) {
459
+ if (!t)
460
+ return;
461
+ const r = t.split(".").reduce((s, o) => {
462
+ if (s && typeof s == "object" && o in s)
463
+ return s[o];
464
+ }, e);
465
+ return Array.isArray(r) ? r : typeof r == "string" ? [r] : void 0;
466
+ }
467
+ var $e = Object.defineProperty, Ce = Object.getOwnPropertyDescriptor, z = (e, t, r, s) => {
468
+ for (var o = s > 1 ? void 0 : s ? Ce(t, r) : t, n = e.length - 1, i; n >= 0; n--)
469
+ (i = e[n]) && (o = (s ? i(t, r, o) : i(o)) || o);
470
+ return s && o && $e(t, r, o), o;
471
+ };
472
+ let y = class extends u {
473
+ //#region Lifecycle
474
+ constructor(e) {
475
+ super(e), this.type = "start-node";
476
+ }
477
+ //#endregion
478
+ //#region Public Methods
479
+ createRuntimeNode() {
480
+ return (e) => ({ question: e.agentExecutionContext.userRequest });
481
+ }
482
+ static fromJSON(e) {
483
+ return new y({
484
+ id: e.id,
485
+ label: e.label,
486
+ type: "start-node"
487
+ });
488
+ }
489
+ //#endregion
490
+ //#region Private Methods
491
+ //#endregion
492
+ };
493
+ z([
494
+ a()
495
+ ], y.prototype, "type", 2);
496
+ y = z([
497
+ h("StartNode")
498
+ ], y);
499
+ function xe(e) {
500
+ switch (e.type) {
501
+ case "agent_node":
502
+ return d.fromJSON(e);
503
+ case "end_message_node":
504
+ return g.fromJSON(e);
505
+ case "human_in_the_loop_node":
506
+ return m.fromJSON(e);
507
+ case "start_node":
508
+ return y.fromJSON(e);
509
+ default:
510
+ throw new Error(`WebAgent node "${e.id}" uses unsupported type "${e.type}".`);
511
+ }
512
+ }
513
+ function Je(e = {}) {
514
+ const t = Object.keys(e);
515
+ if (oe(t), t.includes("nodes"))
516
+ throw new Error("node state cannot define reserved field: nodes.");
517
+ const r = se(e);
518
+ return T.Root({
519
+ ...r,
520
+ nodes: T({
521
+ reducer: (s, o) => ({ ...s, ...o }),
522
+ default: () => ({})
523
+ }),
524
+ ...ne()
525
+ });
526
+ }
527
+ function B(e, t = {}) {
528
+ const r = /* @__PURE__ */ new Set();
529
+ for (const o of e)
530
+ for (const n of Object.keys(o.shape ?? {}))
531
+ n !== "nodes" && r.add(n);
532
+ const s = Object.fromEntries([...r].map((o) => [o, t[o]]));
533
+ for (const [o, n] of Object.entries(t))
534
+ s[o] = n;
535
+ return Je(s);
536
+ }
537
+ class x {
538
+ //#endregion Private Properties
539
+ //#region Lifecycle
540
+ constructor(t, r, s) {
541
+ this.sourceJSON = t, this.edges = r, this.nodes = s, this._loaded = !1;
542
+ }
543
+ //#endregion Lifecycle
544
+ //#region Public Methods
545
+ static fromJSON(t) {
546
+ return new x(
547
+ t,
548
+ t.graph.edges.map((r) => p.fromJSON(r)),
549
+ t.graph.nodes.map((r) => xe(r))
550
+ );
551
+ }
552
+ async load() {
553
+ return this._loadPromise ??= Promise.all(this.nodes.map(async (t) => await t.load())).then(() => {
554
+ this._loaded = !0;
555
+ }), await this._loadPromise, this;
556
+ }
557
+ getSchemas() {
558
+ const t = Object.fromEntries(
559
+ this._getNodeCompilations().flatMap((s, o) => {
560
+ const n = this.nodes[o];
561
+ return s.schemas?.map((i) => [n.id, i]) ?? [];
562
+ })
563
+ );
564
+ return [c.object({
565
+ loopCounts: c.record(c.string(), c.number()).optional(),
566
+ nodes: c.object(t).partial().optional(),
567
+ question: c.string().optional(),
568
+ variables: this._getVariablesSchema()
569
+ })];
570
+ }
571
+ generate() {
572
+ this._assertLoaded(), this._nodeCompilations = void 0;
573
+ const t = this._getNodeCompilations(), r = Object.fromEntries(this.sourceJSON.variables.map(({ key: l, value: P }) => [l, P])), s = B(this.getSchemas(), { variables: r }), o = this.nodes.find((l) => l.type === "start-node")?.id, n = {}, i = [];
574
+ for (const [l, P] of this.nodes.entries()) {
575
+ const N = t[l];
576
+ N && (N.runtimeNode && (n[P.id] = N.runtimeNode), i.push(...N.edges));
577
+ }
578
+ return {
579
+ createGraph: () => Y(n, i, s, { entryNode: o }),
580
+ workspace: s
581
+ };
582
+ }
583
+ //#endregion Public Methods
584
+ //#region Private Methods
585
+ _assertLoaded() {
586
+ if (!this._loaded)
587
+ throw new Error("AgenticWorkflowRuntime must be loaded before it can generate a graph.");
588
+ }
589
+ _getNodeCompilations() {
590
+ return this._assertLoaded(), this._nodeCompilations ??= this.nodes.map(
591
+ (t) => t.compile({
592
+ outgoingEdges: this.edges.filter((r) => r.sourceNodeId === t.id)
593
+ })
594
+ );
595
+ }
596
+ _getVariablesSchema() {
597
+ return c.object(
598
+ Object.fromEntries(this.sourceJSON.variables.map(({ key: t }) => [t, c.unknown()]))
599
+ );
600
+ }
601
+ //#endregion Private Methods
602
+ }
603
+ var Te = Object.defineProperty, Re = Object.getOwnPropertyDescriptor, J = (e, t, r, s) => {
604
+ for (var o = s > 1 ? void 0 : s ? Re(t, r) : t, n = e.length - 1, i; n >= 0; n--)
605
+ (i = e[n]) && (o = (s ? i(t, r, o) : i(o)) || o);
606
+ return s && o && Te(t, r, o), o;
607
+ };
608
+ const De = () => {
609
+ throw new Error("WebAgent must be loaded before it can run.");
610
+ };
611
+ let _ = class extends X {
612
+ //#region Lifecycle
613
+ constructor(e) {
614
+ super(e);
615
+ }
616
+ //#endregion
617
+ //#region Public Methods
618
+ async load() {
619
+ if (this.portalItem) {
620
+ try {
621
+ await this.portalItem.load();
622
+ } catch (r) {
623
+ throw new O("web-agent:load-portal-item", "Failed to load portal item", { error: r });
624
+ }
625
+ const t = await this.portalItem.fetchData();
626
+ if (this.sourceJSON = t, !this.portalItem.title)
627
+ throw new O("web-agent:missing-title", "The portal item is missing a title");
628
+ }
629
+ if (!this.sourceJSON)
630
+ throw new O("web-agent:missing-source-json", "The source JSON is missing");
631
+ if (!this.sourceJSON.description)
632
+ throw new O("web-agent:missing-description", "The source JSON is missing a description");
633
+ const e = x.fromJSON(this.sourceJSON);
634
+ return await e.load(), this._runtime = e, this.description = this.sourceJSON.description, this.name = this.portalItem?.title ?? `web-agent-${Date.now()}`, this.generate(), this;
635
+ }
636
+ getSchemas() {
637
+ return this._runtime?.getSchemas() ?? [];
638
+ }
639
+ generate() {
640
+ if (!this._runtime) {
641
+ this._set("workspace", B([])), this._set("createGraph", De);
642
+ return;
643
+ }
644
+ const { createGraph: e, workspace: t } = this._runtime.generate();
645
+ this._set("workspace", t), this._set("createGraph", e);
646
+ }
647
+ //#endregion
648
+ };
649
+ J([
650
+ a({ type: D })
651
+ ], _.prototype, "portalItem", 2);
652
+ J([
653
+ a()
654
+ ], _.prototype, "sourceJSON", 2);
655
+ _ = J([
656
+ h("WebAgent")
657
+ ], _);
658
+ class qe extends U {
6
659
  static {
7
- this.properties = { agent: 0, context: 0 };
660
+ this.properties = { agent: 0, context: 0, itemId: 1, workflow: 0 };
8
661
  }
662
+ #e;
9
663
  async getContext() {
10
- return e(this.context) ? await this.context() : this.context;
664
+ return Z(this.context) ? await this.context() : this.context;
665
+ }
666
+ async load() {
667
+ let t;
668
+ if (this.itemId) {
669
+ const r = Q.getDefault();
670
+ t = new _({ portalItem: new D({ id: this.itemId, portal: r }) });
671
+ } else this.workflow && (t = new _({ sourceJSON: this.workflow }));
672
+ if (t && (await t.load(), this.agent = t.registration), !this.agent)
673
+ throw new Error("Failed to initialize the assistant agent because the agent registration is missing.");
674
+ this.#e = K(this);
11
675
  }
12
- load() {
13
- i(this);
676
+ disconnectedCallback() {
677
+ this.#e?.unregister(this.agent.id), super.disconnectedCallback();
14
678
  }
15
679
  }
16
- t("arcgis-assistant-agent", n);
680
+ V("arcgis-assistant-agent", qe);
17
681
  export {
18
- n as ArcgisAssistantAgent
682
+ qe as ArcgisAssistantAgent
19
683
  };