@arcgis/ai-components 5.2.0-next.110 → 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 (290) hide show
  1. package/dist/agent-utils/BaseAgent.js +1 -1
  2. package/dist/agent-utils/FunctionAgent.js +1 -1
  3. package/dist/agent-utils/LLMAgent.d.ts +4 -5
  4. package/dist/agent-utils/LLMAgent.js +59 -59
  5. package/dist/agent-utils/WorkflowAgent.js +1 -1
  6. package/dist/agent-utils/index.js +1 -1
  7. package/dist/agent-utils/middlewares/humanInTheLoop.js +1 -1
  8. package/dist/agent-utils/middlewares/middleware.js +1 -1
  9. package/dist/agent-utils/middlewares/trace.js +6 -6
  10. package/dist/agent-utils/middlewares/types.js +1 -1
  11. package/dist/agent-utils/tools/FunctionTool.js +1 -1
  12. package/dist/agent-utils/workflows/ConditionalWorkflow.js +1 -1
  13. package/dist/agent-utils/workflows/LoopWorkflow.js +1 -1
  14. package/dist/agent-utils/workflows/ParallelWorkflow.js +1 -1
  15. package/dist/agent-utils/workflows/RouterWorkflow.js +1 -1
  16. package/dist/agent-utils/workflows/SequentialWorkflow.js +1 -1
  17. package/dist/agent-utils/workflows/SwitchWorkflow.js +1 -1
  18. package/dist/agentic-workflow/jsonTypes.d.ts +48 -8
  19. package/dist/agentic-workflow/nodes/HumanInTheLoopNode.d.ts +37 -0
  20. package/dist/agentic-workflow/types.d.ts +1 -1
  21. package/dist/agents/runtime/skill/createSkillAgent.d.ts +0 -1
  22. package/dist/agents/runtime/skill/createSkillAgent.js +50 -50
  23. package/dist/agents/runtime/skill/types.d.ts +2 -10
  24. package/dist/agents/runtime/skill/types.js +1 -1
  25. package/dist/agents/tools/filter/clearFilters/adapter.js +1 -1
  26. package/dist/agents/tools/filter/resetMap/adapter.js +1 -1
  27. package/dist/agents/tools/filter/setFeatureEffect/adapter.js +1 -1
  28. package/dist/agents/tools/help/listFields/adapter.js +1 -1
  29. package/dist/agents/tools/navigation/goToAddress/adapter.js +1 -1
  30. package/dist/agents/tools/navigation/goToBookmark/adapter.js +1 -1
  31. package/dist/agents/tools/navigation/goToFeatures/adapter.js +1 -1
  32. package/dist/agents/tools/navigation/goToFullExtent/adapter.js +1 -1
  33. package/dist/agents/tools/navigation/goToHomeExtent/adapter.js +1 -1
  34. package/dist/agents/tools/navigation/goToLayer/adapter.js +1 -1
  35. package/dist/agents/tools/navigation/goToScale/adapter.js +1 -1
  36. package/dist/agents/tools/navigation/goToViewpoint/adapter.js +1 -1
  37. package/dist/agents/tools/navigation/goToZoom/adapter.js +1 -1
  38. package/dist/agents/tools/query/getAttribute/adapter.js +1 -1
  39. package/dist/agents/tools/query/getStatistics/adapter.js +1 -1
  40. package/dist/agents/tools/query/getTopFeatures/adapter.js +1 -1
  41. package/dist/agents/tools/query/queryFeatures/adapter.js +1 -1
  42. package/dist/agents/tools/search/findRelevantFields/adapter.js +1 -1
  43. package/dist/agents/tools/search/findRelevantLayers/adapter.js +1 -1
  44. package/dist/agents/tools/shared/resolveToolArtifact.js +1 -1
  45. package/dist/agents/tools/shared/types.js +1 -1
  46. package/dist/cdn/2BNQ6A6J.js +2 -0
  47. package/dist/cdn/{FV6FHLYW.js → 2MWUBKWI.js} +2 -2
  48. package/dist/cdn/{GW3IVAAZ.js → 2O4DON37.js} +2 -2
  49. package/dist/cdn/{LL324IL6.js → 2W7LK4HA.js} +2 -2
  50. package/dist/cdn/33PB7ALY.js +2 -0
  51. package/dist/cdn/{FK2CVSXW.js → 33SFAZQG.js} +4 -4
  52. package/dist/cdn/{LLY5A2E2.js → 34O57OGV.js} +1 -1
  53. package/dist/cdn/{OALQBAZR.js → 3UEKINYC.js} +2 -2
  54. package/dist/cdn/434TAA3J.js +2 -0
  55. package/dist/cdn/{ZWIKFBOU.js → 4IU63OWQ.js} +2 -2
  56. package/dist/cdn/{XRVGYRXL.js → 5A355PGH.js} +2 -2
  57. package/dist/cdn/{TB2GJALS.js → 5HBAJ57P.js} +2 -2
  58. package/dist/cdn/{7Y43R7QJ.js → 5MK44FNO.js} +2 -2
  59. package/dist/cdn/{LXIKAXUT.js → 5Q2XRQS6.js} +2 -2
  60. package/dist/cdn/{UAZPINUQ.js → 6ECRQVHY.js} +2 -2
  61. package/dist/cdn/{BBEGLIZC.js → 6OOZSZRJ.js} +2 -2
  62. package/dist/cdn/6OUIUXAJ.js +2 -0
  63. package/dist/cdn/{Y4TYL2AL.js → 6P44KOKX.js} +2 -2
  64. package/dist/cdn/{LBTGOMCT.js → 73TMZQI5.js} +2 -2
  65. package/dist/cdn/{BJMGT6GV.js → 74CVYM72.js} +2 -2
  66. package/dist/cdn/{PJPP6LOS.js → 7EHOFQ2P.js} +2 -2
  67. package/dist/cdn/{24EIZVUM.js → 7KSFIRXB.js} +2 -2
  68. package/dist/cdn/{STOGCXJH.js → AHCXG7XF.js} +2 -2
  69. package/dist/cdn/{VLPELJUS.js → AOVJ34QE.js} +2 -2
  70. package/dist/cdn/{3KNLFIM3.js → APFZY4PI.js} +2 -2
  71. package/dist/cdn/{KBSXHSBX.js → AVRS6UCQ.js} +2 -2
  72. package/dist/cdn/{YOW3YKWR.js → AVZ5Y6BK.js} +2 -2
  73. package/dist/cdn/{477I66FH.js → AXTQU5YL.js} +11 -11
  74. package/dist/cdn/BBPD2AS7.js +2 -0
  75. package/dist/cdn/{HV7MVIQV.js → BFZ5S7NF.js} +2 -2
  76. package/dist/cdn/{HMMYCSOK.js → BL273EGZ.js} +2 -2
  77. package/dist/cdn/C7JPWFZE.js +2 -0
  78. package/dist/cdn/{KKCLHXHG.js → CCC6LBMY.js} +1 -1
  79. package/dist/cdn/{NNPA3NLK.js → CEKOEHB3.js} +2 -2
  80. package/dist/cdn/{W54XYT2A.js → CFAC4FN3.js} +2 -2
  81. package/dist/cdn/{53KIFJFA.js → COH3QXWG.js} +2 -2
  82. package/dist/cdn/{CX2HJ67C.js → DB2TFPIO.js} +2 -2
  83. package/dist/cdn/{EYGZJKVD.js → DE26DAW5.js} +2 -2
  84. package/dist/cdn/DG27JEYG.js +50 -0
  85. package/dist/cdn/DKA6PSYN.js +2 -0
  86. package/dist/cdn/{65LCK3GG.js → DQ2Z65UO.js} +2 -2
  87. package/dist/cdn/DWH23NJN.js +2 -0
  88. package/dist/cdn/EDXTPEEU.js +2 -0
  89. package/dist/cdn/{6KWGSXIN.js → ENM3L4AC.js} +2 -2
  90. package/dist/cdn/{XV7RMYLR.js → EVMIYZWD.js} +2 -2
  91. package/dist/cdn/{FHBRXZLV.js → EYOWRGDP.js} +2 -2
  92. package/dist/cdn/{45BDE3MG.js → EYY367WR.js} +2 -2
  93. package/dist/cdn/{27CK3JHY.js → F5NIRETW.js} +2 -2
  94. package/dist/cdn/{TFAJNKBC.js → FCI6M62J.js} +2 -2
  95. package/dist/cdn/{V4PJMCJZ.js → FDOMMK2M.js} +1 -1
  96. package/dist/cdn/{4OI4QEV7.js → FS7GXTTQ.js} +2 -2
  97. package/dist/cdn/{IHUWQOMK.js → FYZATVB3.js} +2 -2
  98. package/dist/cdn/{3PPXAIRE.js → H6P3WP5D.js} +2 -2
  99. package/dist/cdn/HHP5YLUI.js +2 -0
  100. package/dist/cdn/HIAQARIQ.js +2 -0
  101. package/dist/cdn/HMIDFTEI.js +2 -0
  102. package/dist/cdn/{4CFCV47G.js → HMNBUGH2.js} +2 -2
  103. package/dist/cdn/HR6GWPKX.js +2 -0
  104. package/dist/cdn/{V266DJ5V.js → ICBIUFK7.js} +2 -2
  105. package/dist/cdn/{BTOBEN7Q.js → IH26MIYY.js} +2 -2
  106. package/dist/cdn/{QAX6UF4L.js → IHP25JWI.js} +2 -2
  107. package/dist/cdn/{M2U456J5.js → IYLFJCJ2.js} +4 -4
  108. package/dist/cdn/{JMXXRRKQ.js → J6A4AS7E.js} +2 -2
  109. package/dist/cdn/{QTEPFTAU.js → JEBRN3EU.js} +2 -2
  110. package/dist/cdn/{G24MNC7D.js → JICNSK6Y.js} +2 -2
  111. package/dist/cdn/JQYLMTDP.js +2 -0
  112. package/dist/cdn/{275FFTBE.js → K5JVB6FU.js} +2 -2
  113. package/dist/cdn/K7XWGSLN.js +2 -0
  114. package/dist/cdn/{M3KKORBG.js → K7YQIJFT.js} +2 -2
  115. package/dist/cdn/KH4V4I3W.js +2 -0
  116. package/dist/cdn/KMLJS2VW.js +2 -0
  117. package/dist/cdn/{HNTSDY3J.js → LAVFUDUG.js} +2 -2
  118. package/dist/cdn/{L3BTURBA.js → LK7ZIQW6.js} +2 -2
  119. package/dist/cdn/{ZJWR4W2S.js → LOQ2PKV5.js} +58 -58
  120. package/dist/cdn/{X42ACC66.js → LXPGQNXQ.js} +2 -2
  121. package/dist/cdn/{TXZQZR3I.js → MJSIYEWN.js} +2 -2
  122. package/dist/cdn/{CSE6BHOJ.js → MWYBF3F3.js} +2 -2
  123. package/dist/cdn/{FDRAKF5D.js → MXTXJKFE.js} +2 -2
  124. package/dist/cdn/{7DOYUO7L.js → NEV6OZN3.js} +2 -2
  125. package/dist/cdn/{NBDOPGSN.js → O4NVW75A.js} +2 -2
  126. package/dist/cdn/{ZA7ZU2F7.js → OKVLGJAG.js} +2 -2
  127. package/dist/cdn/{SUC2MIGE.js → OMF6ITSG.js} +2 -2
  128. package/dist/cdn/{A6LBMS7A.js → ONQ6JSBJ.js} +1 -1
  129. package/dist/cdn/{CKUUYQLO.js → OZAZ277H.js} +2 -2
  130. package/dist/cdn/{2UJPYWWZ.js → P4GFYBBO.js} +2 -2
  131. package/dist/cdn/{XNUWVZN7.js → P4XZMBU5.js} +2 -2
  132. package/dist/cdn/{L2HLFWCV.js → POL6HKCG.js} +3 -3
  133. package/dist/cdn/{AP3KPOHN.js → POZYDAU2.js} +2 -2
  134. package/dist/cdn/{FTTLFIBV.js → PQ2DPOFM.js} +2 -2
  135. package/dist/cdn/{JUNMTIB3.js → PYGX4HN7.js} +2 -2
  136. package/dist/cdn/{ZY3JQCZQ.js → QNXI3WOF.js} +36 -36
  137. package/dist/cdn/{4VBOTWC3.js → QRMRID2M.js} +2 -2
  138. package/dist/cdn/{TLPZELG3.js → R74ZHFA6.js} +1 -1
  139. package/dist/cdn/{CAOMMQSY.js → RFVZ7KCG.js} +1 -1
  140. package/dist/cdn/{OF3TAARW.js → RHYNE5OE.js} +1 -1
  141. package/dist/cdn/{4YOG5F3W.js → RLEHNAIA.js} +1 -1
  142. package/dist/cdn/{RSM7MEVT.js → ROQGPAR5.js} +2 -2
  143. package/dist/cdn/RXF2NUOL.js +2 -0
  144. package/dist/cdn/{MZUDIQQH.js → SDWWUWAF.js} +2 -2
  145. package/dist/cdn/SHI76XUV.js +2 -0
  146. package/dist/cdn/SITY6L4S.js +2 -0
  147. package/dist/cdn/STHBRTTD.js +2 -0
  148. package/dist/cdn/{7UBTNDV6.js → SXM4NUT5.js} +2 -2
  149. package/dist/cdn/{XVJFPZTW.js → SZRJTQ54.js} +2 -2
  150. package/dist/cdn/TO2NY7EA.js +2 -0
  151. package/dist/cdn/{4IWDBEMN.js → TPULIO6I.js} +2 -2
  152. package/dist/cdn/TVEEQSMF.js +2 -0
  153. package/dist/cdn/TWU3QXAS.js +2 -0
  154. package/dist/cdn/{EGRRZTF6.js → TYATJUNF.js} +2 -2
  155. package/dist/cdn/UCTC4JN4.js +3 -0
  156. package/dist/cdn/{HI3XKFHD.js → UDRKUVZP.js} +2 -2
  157. package/dist/cdn/{JYNHWJUZ.js → UHEYPSOR.js} +2 -2
  158. package/dist/cdn/{VGLBH473.js → UHICISBZ.js} +2 -2
  159. package/dist/cdn/UO5PBOQR.js +2 -0
  160. package/dist/cdn/{BVUCNXC5.js → UZLQALHY.js} +1 -1
  161. package/dist/cdn/{SNG3WODY.js → V6HOUZPZ.js} +2 -2
  162. package/dist/cdn/{V52GSTOC.js → V7Y22FRP.js} +2 -2
  163. package/dist/cdn/{I72ST4JR.js → VAXH6RUQ.js} +2 -2
  164. package/dist/cdn/{NV7CL4S3.js → VNLSYVPE.js} +2 -2
  165. package/dist/cdn/VR3CF3ZY.js +2 -0
  166. package/dist/cdn/{VK6CCPTG.js → VWP2B4LB.js} +2 -2
  167. package/dist/cdn/VXFQANGJ.js +2 -0
  168. package/dist/cdn/WKZHFSH3.js +2 -0
  169. package/dist/cdn/{OXC2WP7W.js → WSWB3B7B.js} +2 -2
  170. package/dist/cdn/{EK3PM4L5.js → WVP73XWD.js} +2 -2
  171. package/dist/cdn/{SJMAKF4P.js → WXQ26G5Q.js} +2 -2
  172. package/dist/cdn/{2F4TPWZQ.js → XQ3NBBQ3.js} +1 -1
  173. package/dist/cdn/{VXLKTQ36.js → YHWYTHID.js} +2 -2
  174. package/dist/cdn/{XOTPSCNF.js → YIZ7PR2G.js} +2 -2
  175. package/dist/cdn/{T6W6F4TF.js → Z5XQLSYH.js} +2 -2
  176. package/dist/cdn/{Y6CV2NZR.js → ZFOG3KXV.js} +2 -2
  177. package/dist/cdn/{FPH52WOH.js → ZU2FHVNK.js} +2 -2
  178. package/dist/cdn/agent-utils/index.js +2 -2
  179. package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +2 -3
  180. package/dist/cdn/agent-utils/middlewares/middleware.js +2 -2
  181. package/dist/cdn/agent-utils/middlewares/trace.js +2 -2
  182. package/dist/cdn/index.js +2 -2
  183. package/dist/chunks/BaseWorkflow.js +1 -1
  184. package/dist/chunks/SKILL.js +1 -1
  185. package/dist/chunks/SKILL2.js +1 -1
  186. package/dist/chunks/SKILL3.js +1 -1
  187. package/dist/chunks/SKILL4.js +1 -1
  188. package/dist/chunks/adapter.js +1 -1
  189. package/dist/chunks/aiFactory.js +56 -50
  190. package/dist/chunks/arcgisKnowledgeGraph.js +2 -2
  191. package/dist/chunks/arcgisToolRegistry.js +1 -1
  192. package/dist/chunks/arcgis_knowledge_current_lc_context.js +1 -1
  193. package/dist/chunks/arcgis_knowledge_current_map_context.js +1 -1
  194. package/dist/chunks/arcgis_knowledge_cypher_query_prompt.js +1 -1
  195. package/dist/chunks/arcgis_knowledge_lucene_generation_prompt.js +1 -1
  196. package/dist/chunks/arcgis_knowledge_summarize_result_prompt.js +1 -1
  197. package/dist/chunks/arcgis_knowledge_tool_prompt.js +1 -1
  198. package/dist/chunks/baseAgentState.js +1 -1
  199. package/dist/chunks/converterUtils.js +1 -1
  200. package/dist/chunks/dataExplorationAgent.js +1 -1
  201. package/dist/chunks/data_explore_filter_prompt.js +1 -1
  202. package/dist/chunks/data_explore_query_prompt.js +1 -1
  203. package/dist/chunks/embeddings.worker.js +1 -1
  204. package/dist/chunks/fetchAgentContext.js +1 -1
  205. package/dist/chunks/fetchService.js +1 -1
  206. package/dist/chunks/fieldStatistics.js +1 -1
  207. package/dist/chunks/field_descriptions_prompt.js +1 -1
  208. package/dist/chunks/formatFeatureAttributes.js +1 -1
  209. package/dist/chunks/generateLayerDescriptions.js +60 -63
  210. package/dist/chunks/graph.js +1 -1
  211. package/dist/chunks/helpAgent.js +1 -1
  212. package/dist/chunks/help_prompt.js +1 -1
  213. package/dist/chunks/index.js +1 -1
  214. package/dist/chunks/intent_prompt.js +1 -1
  215. package/dist/chunks/layerStylingGraph.js +1 -1
  216. package/dist/chunks/layer_descriptions_prompt.js +1 -1
  217. package/dist/chunks/layer_styling_prompt.js +1 -1
  218. package/dist/chunks/mergeWhereClauses.js +1 -1
  219. package/dist/chunks/navigationAgent.js +1 -1
  220. package/dist/chunks/navigation_intent_prompt.js +1 -1
  221. package/dist/chunks/navigation_tool_prompt.js +1 -1
  222. package/dist/chunks/orchestrator.js +1 -1
  223. package/dist/chunks/requireAgentServices.js +1 -1
  224. package/dist/chunks/resolvePointGeometryFilter.js +1 -1
  225. package/dist/chunks/runtime.js +1 -1
  226. package/dist/chunks/slottableRequestUtils.js +1 -1
  227. package/dist/chunks/state.js +26 -26
  228. package/dist/chunks/summarize_query_response_prompt.js +1 -1
  229. package/dist/chunks/useT9n.js +1 -1
  230. package/dist/chunks/utils.js +1 -1
  231. package/dist/chunks/utils2.js +1 -1
  232. package/dist/chunks/utils3.js +1 -1
  233. package/dist/components/arcgis-assistant/customElement.js +1 -1
  234. package/dist/components/arcgis-assistant-agent/customElement.js +362 -220
  235. package/dist/components/arcgis-assistant-chat/customElement.js +1 -1
  236. package/dist/components/arcgis-assistant-chat-entry/customElement.js +1 -1
  237. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +1 -1
  238. package/dist/components/arcgis-assistant-help-agent/customElement.js +1 -1
  239. package/dist/components/arcgis-assistant-interrupt/customElement.js +1 -1
  240. package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +1 -1
  241. package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +1 -1
  242. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +1 -1
  243. package/dist/components/arcgis-assistant-message/customElement.js +1 -1
  244. package/dist/components/arcgis-assistant-message-block/customElement.js +1 -1
  245. package/dist/components/arcgis-assistant-message-feedback/customElement.js +1 -1
  246. package/dist/components/arcgis-assistant-message-footer/customElement.js +1 -1
  247. package/dist/components/arcgis-assistant-message-loading/customElement.js +1 -1
  248. package/dist/components/arcgis-assistant-message-log/customElement.js +1 -1
  249. package/dist/components/arcgis-assistant-message-read-aloud/customElement.js +1 -1
  250. package/dist/components/arcgis-assistant-message-text/customElement.js +1 -1
  251. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +1 -1
  252. package/dist/components/arcgis-assistant-speech-input/customElement.js +1 -1
  253. package/dist/components/arcgis-assistant-suggested-prompts/customElement.js +1 -1
  254. package/dist/components/arcgis-assistant-user-message/customElement.js +1 -1
  255. package/dist/docs/api.json +1 -1
  256. package/dist/docs/docs.json +1 -1
  257. package/dist/docs/web-types.json +1 -1
  258. package/dist/index.js +1 -1
  259. package/dist/loader.js +1 -1
  260. package/dist/utils/index.js +3 -3
  261. package/package.json +9 -9
  262. package/dist/cdn/25MBI4PD.js +0 -2
  263. package/dist/cdn/2LVYAXHG.js +0 -44
  264. package/dist/cdn/2WXXSZP5.js +0 -2
  265. package/dist/cdn/5X23DDDZ.js +0 -2
  266. package/dist/cdn/AUCKEB52.js +0 -2
  267. package/dist/cdn/B3HXSEBN.js +0 -2
  268. package/dist/cdn/BTTCBEPW.js +0 -2
  269. package/dist/cdn/EXMEB4X2.js +0 -2
  270. package/dist/cdn/FLUI6GCU.js +0 -2
  271. package/dist/cdn/FRYS2PZJ.js +0 -2
  272. package/dist/cdn/FSLQCZRN.js +0 -2
  273. package/dist/cdn/HKIA5PWU.js +0 -2
  274. package/dist/cdn/I3SUE2TR.js +0 -2
  275. package/dist/cdn/KAX4A7SF.js +0 -2
  276. package/dist/cdn/LIRT72WY.js +0 -2
  277. package/dist/cdn/M5B6X46F.js +0 -2
  278. package/dist/cdn/NGR5NVZE.js +0 -2
  279. package/dist/cdn/PUZ6RAFQ.js +0 -2
  280. package/dist/cdn/ROS22KOA.js +0 -2
  281. package/dist/cdn/SBNNJ5WA.js +0 -2
  282. package/dist/cdn/SDX46GZY.js +0 -2
  283. package/dist/cdn/SI22EJLC.js +0 -2
  284. package/dist/cdn/SXYKNDOF.js +0 -2
  285. package/dist/cdn/SZ2L5556.js +0 -2
  286. package/dist/cdn/UGIHS7OA.js +0 -2
  287. package/dist/cdn/VT5EWFH7.js +0 -2
  288. package/dist/cdn/XZF7Y6B2.js +0 -2
  289. package/dist/cdn/Y4ZOB6UH.js +0 -2
  290. package/dist/cdn/YIXASZUW.js +0 -2
@@ -1,23 +1,24 @@
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";
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
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
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";
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";
18
20
  import "@arcgis/core/identity/IdentityManager.js";
19
21
  import "@arcgis/core/request.js";
20
- import "@langchain/langgraph/web";
21
22
  import "@arcgis/toolkit/string";
22
23
  import "../../chunks/generateLayerDescriptions.js";
23
24
  import "@langchain/core/messages";
@@ -27,13 +28,13 @@ import "@langchain/openai";
27
28
  import "@arcgis/core/config.js";
28
29
  import "@arcgis/core/core/reactiveUtils.js";
29
30
  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;
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;
35
36
  };
36
- let p = class extends A {
37
+ let p = class extends $ {
37
38
  //#region Lifecycle
38
39
  constructor(e) {
39
40
  super(e);
@@ -51,30 +52,30 @@ let p = class extends A {
51
52
  }
52
53
  //#endregion
53
54
  };
54
- f([
55
- n()
55
+ w([
56
+ a()
56
57
  ], p.prototype, "id", 2);
57
- f([
58
- n()
58
+ w([
59
+ a()
59
60
  ], p.prototype, "sourceAnchorId", 2);
60
- f([
61
- n()
61
+ w([
62
+ a()
62
63
  ], p.prototype, "sourceNodeId", 2);
63
- f([
64
- n()
64
+ w([
65
+ a()
65
66
  ], p.prototype, "targetAnchorId", 2);
66
- f([
67
- n()
67
+ w([
68
+ a()
68
69
  ], p.prototype, "targetNodeId", 2);
69
- p = f([
70
- l("Edge")
70
+ p = w([
71
+ h("Edge")
71
72
  ], 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;
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;
76
77
  };
77
- let d = class extends A {
78
+ let u = class extends $ {
78
79
  //#region Lifecycle
79
80
  constructor(e) {
80
81
  super(e);
@@ -100,32 +101,32 @@ let d = class extends A {
100
101
  //#region Private Methods
101
102
  //#endregion
102
103
  };
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()];
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()];
120
121
  })
121
122
  );
122
- return c.object(o);
123
+ return c.object(r);
123
124
  }
124
- function $(e) {
125
+ function W(e) {
125
126
  let t;
126
127
  switch (e.type) {
127
128
  case "array":
128
- t = c.array(e.items ? $(e.items) : c.unknown());
129
+ t = c.array(e.items ? W(e.items) : c.unknown());
129
130
  break;
130
131
  case "boolean":
131
132
  t = c.boolean();
@@ -134,7 +135,7 @@ function $(e) {
134
135
  t = c.number();
135
136
  break;
136
137
  case "object":
137
- t = J({
138
+ t = M({
138
139
  properties: e.properties ?? {},
139
140
  required: e.required
140
141
  });
@@ -145,13 +146,13 @@ function $(e) {
145
146
  }
146
147
  return e.description ? t.describe(e.description) : t;
147
148
  }
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;
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;
152
153
  };
153
- const re = (e) => e.replace(/_([a-z])/gu, (t, o) => o.toUpperCase());
154
- let u = class extends A {
154
+ const me = (e) => e.replace(/_([a-z])/gu, (t, r) => r.toUpperCase());
155
+ let f = class extends $ {
155
156
  //#region Lifecycle
156
157
  constructor(e) {
157
158
  super(e), this.type = "arcgis-tool";
@@ -161,57 +162,57 @@ let u = class extends A {
161
162
  async createRuntimeTools() {
162
163
  if (!this.name)
163
164
  throw new Error("ArcgisTool name is required");
164
- return [await U(re(this.name))];
165
+ return [await ee(me(this.name))];
165
166
  }
166
167
  static fromJSON(e) {
167
- return new u({
168
+ return new f({
168
169
  name: e.name,
169
170
  requireApproval: e.require_approval
170
171
  });
171
172
  }
172
173
  //#endregion
173
174
  };
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) => {
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) => {
187
188
  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 {
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 {
194
195
  //#region Lifecycle
195
196
  constructor(e) {
196
- super(e), ie(this, S), this.type = "agent-node";
197
+ super(e), ge(this, E), this.type = "agent-node";
197
198
  }
198
199
  //#endregion
199
200
  //#region Public Methods
200
201
  createRuntimeNode() {
201
202
  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;
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;
208
209
  return {
209
- agentExecutionContext: r.agentExecutionContext,
210
- ...i ? {} : { outputMessage: r.outputMessage },
211
- status: r.status,
212
- summary: r.summary,
210
+ agentExecutionContext: o.agentExecutionContext,
211
+ ...i ? {} : { outputMessage: o.outputMessage },
212
+ status: o.status,
213
+ summary: o.summary,
213
214
  nodes: {
214
- [this.id]: { output: O }
215
+ [this.id]: { output: l }
215
216
  }
216
217
  };
217
218
  };
@@ -223,7 +224,7 @@ let m = class extends d {
223
224
  edges: [
224
225
  {
225
226
  from: this.id,
226
- decide: (o) => o.status === "failed" ? void 0 : t
227
+ decide: (r) => r.status === "failed" ? void 0 : t
227
228
  }
228
229
  ],
229
230
  schemas: [
@@ -234,29 +235,29 @@ let m = class extends d {
234
235
  };
235
236
  }
236
237
  static fromJSON(e) {
237
- const t = new m({
238
+ const t = new d({
238
239
  id: e.id,
239
240
  label: e.label,
240
241
  prompt: e.prompt?.content,
241
242
  type: "agent-node",
242
243
  modelTier: e.llm_model?.model_tier
243
244
  });
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
+ 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;
245
246
  }
246
247
  //#endregion
247
248
  };
248
- S = /* @__PURE__ */ new WeakSet();
249
- D = async function() {
249
+ E = /* @__PURE__ */ new WeakSet();
250
+ L = async function() {
250
251
  const e = this.prompt;
251
252
  if (!e?.trim())
252
253
  throw new Error(`WebAgent agent node "${this.id}" requires a prompt.`);
253
254
  const t = [];
254
255
  if (this.tools)
255
- for (const o of this.tools) {
256
- const s = await o.createRuntimeTools();
256
+ for (const r of this.tools) {
257
+ const s = await r.createRuntimeTools();
257
258
  t.push(...s);
258
259
  }
259
- return new B({
260
+ return new k({
260
261
  name: this.id,
261
262
  // TODO: change to label
262
263
  outputSchema: this.outputSchema,
@@ -265,30 +266,30 @@ D = async function() {
265
266
  tools: t
266
267
  });
267
268
  };
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;
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;
290
291
  };
291
- let h = class extends d {
292
+ let g = class extends u {
292
293
  //#region Lifecycle
293
294
  constructor(e) {
294
295
  super(e), this.type = "end-message-node";
@@ -297,7 +298,7 @@ let h = class extends d {
297
298
  //#region Public Methods
298
299
  createRuntimeNode() {
299
300
  return async (e) => {
300
- const t = await Z.fromTemplate(this.message, { templateFormat: "mustache" }).format(e);
301
+ const t = await q.fromTemplate(this.message, { templateFormat: "mustache" }).format(e);
301
302
  return {
302
303
  outputMessage: t,
303
304
  status: "success",
@@ -312,7 +313,7 @@ let h = class extends d {
312
313
  };
313
314
  }
314
315
  static fromJSON(e) {
315
- const t = new h({
316
+ const t = new g({
316
317
  id: e.id,
317
318
  label: e.label,
318
319
  type: "end-message-node"
@@ -323,21 +324,152 @@ let h = class extends d {
323
324
  //#region Private Methods
324
325
  //#endregion
325
326
  };
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;
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
339
393
  };
340
- let w = class extends d {
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 {
341
473
  //#region Lifecycle
342
474
  constructor(e) {
343
475
  super(e), this.type = "start-node";
@@ -348,7 +480,7 @@ let w = class extends d {
348
480
  return (e) => ({ question: e.agentExecutionContext.userRequest });
349
481
  }
350
482
  static fromJSON(e) {
351
- return new w({
483
+ return new y({
352
484
  id: e.id,
353
485
  label: e.label,
354
486
  type: "start-node"
@@ -358,59 +490,63 @@ let w = class extends d {
358
490
  //#region Private Methods
359
491
  //#endregion
360
492
  };
361
- R([
362
- n()
363
- ], w.prototype, "type", 2);
364
- w = R([
365
- l("StartNode")
366
- ], w);
367
- function ue(e) {
493
+ z([
494
+ a()
495
+ ], y.prototype, "type", 2);
496
+ y = z([
497
+ h("StartNode")
498
+ ], y);
499
+ function xe(e) {
368
500
  switch (e.type) {
369
501
  case "agent_node":
370
- return m.fromJSON(e);
502
+ return d.fromJSON(e);
371
503
  case "end_message_node":
372
- return h.fromJSON(e);
504
+ return g.fromJSON(e);
505
+ case "human_in_the_loop_node":
506
+ return m.fromJSON(e);
373
507
  case "start_node":
374
- return w.fromJSON(e);
508
+ return y.fromJSON(e);
375
509
  default:
376
510
  throw new Error(`WebAgent node "${e.id}" uses unsupported type "${e.type}".`);
377
511
  }
378
512
  }
379
- function le(e = {}) {
513
+ function Je(e = {}) {
380
514
  const t = Object.keys(e);
381
- if (H(t), t.includes("nodes"))
515
+ if (oe(t), t.includes("nodes"))
382
516
  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 }),
517
+ const r = se(e);
518
+ return T.Root({
519
+ ...r,
520
+ nodes: T({
521
+ reducer: (s, o) => ({ ...s, ...o }),
388
522
  default: () => ({})
389
523
  }),
390
- ...Q()
524
+ ...ne()
391
525
  });
392
526
  }
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);
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);
400
536
  }
401
- class E {
537
+ class x {
402
538
  //#endregion Private Properties
403
539
  //#region Lifecycle
404
- constructor(t, o, s) {
405
- this.sourceJSON = t, this.edges = o, this.nodes = s, this._loaded = !1;
540
+ constructor(t, r, s) {
541
+ this.sourceJSON = t, this.edges = r, this.nodes = s, this._loaded = !1;
406
542
  }
407
543
  //#endregion Lifecycle
408
544
  //#region Public Methods
409
545
  static fromJSON(t) {
410
- return new E(
546
+ return new x(
411
547
  t,
412
- t.graph.edges.map((o) => p.fromJSON(o)),
413
- t.graph.nodes.map((o) => ue(o))
548
+ t.graph.edges.map((r) => p.fromJSON(r)),
549
+ t.graph.nodes.map((r) => xe(r))
414
550
  );
415
551
  }
416
552
  async load() {
@@ -420,27 +556,28 @@ class E {
420
556
  }
421
557
  getSchemas() {
422
558
  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]) ?? [];
559
+ this._getNodeCompilations().flatMap((s, o) => {
560
+ const n = this.nodes[o];
561
+ return s.schemas?.map((i) => [n.id, i]) ?? [];
426
562
  })
427
563
  );
428
564
  return [c.object({
429
565
  loopCounts: c.record(c.string(), c.number()).optional(),
430
566
  nodes: c.object(t).partial().optional(),
431
- question: c.string().optional()
567
+ question: c.string().optional(),
568
+ variables: this._getVariablesSchema()
432
569
  })];
433
570
  }
434
571
  generate() {
435
572
  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));
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));
440
577
  }
441
578
  return {
442
- createGraph: () => z(r, a, o, { entryNode: s }),
443
- workspace: o
579
+ createGraph: () => Y(n, i, s, { entryNode: o }),
580
+ workspace: s
444
581
  };
445
582
  }
446
583
  //#endregion Public Methods
@@ -452,21 +589,26 @@ class E {
452
589
  _getNodeCompilations() {
453
590
  return this._assertLoaded(), this._nodeCompilations ??= this.nodes.map(
454
591
  (t) => t.compile({
455
- outgoingEdges: this.edges.filter((o) => o.sourceNodeId === t.id)
592
+ outgoingEdges: this.edges.filter((r) => r.sourceNodeId === t.id)
456
593
  })
457
594
  );
458
595
  }
596
+ _getVariablesSchema() {
597
+ return c.object(
598
+ Object.fromEntries(this.sourceJSON.variables.map(({ key: t }) => [t, c.unknown()]))
599
+ );
600
+ }
459
601
  //#endregion Private Methods
460
602
  }
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;
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;
465
607
  };
466
- const fe = () => {
608
+ const De = () => {
467
609
  throw new Error("WebAgent must be loaded before it can run.");
468
610
  };
469
- let g = class extends L {
611
+ let _ = class extends X {
470
612
  //#region Lifecycle
471
613
  constructor(e) {
472
614
  super(e);
@@ -477,18 +619,18 @@ let g = class extends L {
477
619
  if (this.portalItem) {
478
620
  try {
479
621
  await this.portalItem.load();
480
- } catch (o) {
481
- throw new y("web-agent:load-portal-item", "Failed to load portal item", { error: o });
622
+ } catch (r) {
623
+ throw new O("web-agent:load-portal-item", "Failed to load portal item", { error: r });
482
624
  }
483
625
  const t = await this.portalItem.fetchData();
484
626
  if (this.sourceJSON = t, !this.portalItem.title)
485
- throw new y("web-agent:missing-title", "The portal item is missing a title");
627
+ throw new O("web-agent:missing-title", "The portal item is missing a title");
486
628
  }
487
629
  if (!this.sourceJSON)
488
- throw new y("web-agent:missing-source-json", "The source JSON is missing");
630
+ throw new O("web-agent:missing-source-json", "The source JSON is missing");
489
631
  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);
632
+ throw new O("web-agent:missing-description", "The source JSON is missing a description");
633
+ const e = x.fromJSON(this.sourceJSON);
492
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;
493
635
  }
494
636
  getSchemas() {
@@ -496,7 +638,7 @@ let g = class extends L {
496
638
  }
497
639
  generate() {
498
640
  if (!this._runtime) {
499
- this._set("workspace", q([])), this._set("createGraph", fe);
641
+ this._set("workspace", B([])), this._set("createGraph", De);
500
642
  return;
501
643
  }
502
644
  const { createGraph: e, workspace: t } = this._runtime.generate();
@@ -504,38 +646,38 @@ let g = class extends L {
504
646
  }
505
647
  //#endregion
506
648
  };
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 {
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 {
517
659
  static {
518
660
  this.properties = { agent: 0, context: 0, itemId: 1, workflow: 0 };
519
661
  }
520
662
  #e;
521
663
  async getContext() {
522
- return M(this.context) ? await this.context() : this.context;
664
+ return Z(this.context) ? await this.context() : this.context;
523
665
  }
524
666
  async load() {
525
667
  let t;
526
668
  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 }));
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 }));
530
672
  if (t && (await t.load(), this.agent = t.registration), !this.agent)
531
673
  throw new Error("Failed to initialize the assistant agent because the agent registration is missing.");
532
- this.#e = j(this);
674
+ this.#e = K(this);
533
675
  }
534
676
  disconnectedCallback() {
535
677
  this.#e?.unregister(this.agent.id), super.disconnectedCallback();
536
678
  }
537
679
  }
538
- W("arcgis-assistant-agent", _e);
680
+ V("arcgis-assistant-agent", qe);
539
681
  export {
540
- _e as ArcgisAssistantAgent
682
+ qe as ArcgisAssistantAgent
541
683
  };