@arcgis/ai-components 5.1.0-next.99 → 5.2.0-next.0

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 (374) hide show
  1. package/README.md +2 -2
  2. package/dist/agent-utils/BaseAgent.d.ts +90 -0
  3. package/dist/agent-utils/BaseAgent.js +87 -0
  4. package/dist/agent-utils/FunctionAgent.d.ts +64 -0
  5. package/dist/agent-utils/FunctionAgent.js +98 -0
  6. package/dist/agent-utils/LLMAgent.d.ts +65 -0
  7. package/dist/agent-utils/LLMAgent.js +139 -0
  8. package/dist/agent-utils/WorkflowAgent.d.ts +44 -0
  9. package/dist/agent-utils/WorkflowAgent.js +70 -0
  10. package/dist/agent-utils/middlewares/humanInTheLoop.d.ts +152 -0
  11. package/dist/agent-utils/middlewares/humanInTheLoop.js +94 -0
  12. package/dist/agent-utils/middlewares/middleware.d.ts +25 -0
  13. package/dist/agent-utils/middlewares/middleware.js +44 -0
  14. package/dist/agent-utils/middlewares/trace.d.ts +25 -0
  15. package/dist/agent-utils/middlewares/trace.js +50 -0
  16. package/dist/agent-utils/middlewares/types.d.ts +123 -0
  17. package/dist/agent-utils/middlewares/types.js +2 -0
  18. package/dist/agent-utils/tools/FunctionTool.d.ts +127 -0
  19. package/dist/agent-utils/tools/FunctionTool.js +80 -0
  20. package/dist/agent-utils/types.d.ts +152 -0
  21. package/dist/agent-utils/workflows/BaseWorkflow.d.ts +87 -0
  22. package/dist/agent-utils/workflows/ConditionalWorkflow.d.ts +72 -0
  23. package/dist/agent-utils/workflows/ConditionalWorkflow.js +61 -0
  24. package/dist/agent-utils/workflows/LoopWorkflow.d.ts +58 -0
  25. package/dist/agent-utils/workflows/LoopWorkflow.js +56 -0
  26. package/dist/agent-utils/workflows/ParallelWorkflow.d.ts +68 -0
  27. package/dist/agent-utils/workflows/ParallelWorkflow.js +129 -0
  28. package/dist/agent-utils/workflows/RouterWorkflow.d.ts +63 -0
  29. package/dist/agent-utils/workflows/RouterWorkflow.js +75 -0
  30. package/dist/agent-utils/workflows/SequentialWorkflow.d.ts +56 -0
  31. package/dist/agent-utils/workflows/SequentialWorkflow.js +69 -0
  32. package/dist/agent-utils/workflows/SwitchWorkflow.d.ts +74 -0
  33. package/dist/agent-utils/workflows/SwitchWorkflow.js +84 -0
  34. package/dist/assets/embeddings.worker-k9_Ou679.js +1 -0
  35. package/dist/cdn/{24MYCR6F.js → 23EQTPO3.js} +2 -2
  36. package/dist/cdn/{Z3DVGFEE.js → 2AXF774U.js} +2 -2
  37. package/dist/cdn/{UK6CP7BR.js → 3PKJWIC3.js} +2 -2
  38. package/dist/cdn/462JBSEV.js +422 -0
  39. package/dist/cdn/5QAHYX7Y.js +5 -0
  40. package/dist/cdn/{YVTKUITE.js → 5ZZGKP7N.js} +2 -2
  41. package/dist/cdn/{VHOF6SUZ.js → 6MAINSY5.js} +4 -3
  42. package/dist/cdn/6R6AY3D3.js +42 -0
  43. package/dist/cdn/{DMLSCJAM.js → 6YMR4QSD.js} +2 -2
  44. package/dist/cdn/{LXFCO34K.js → 7BCR6TUO.js} +2 -2
  45. package/dist/cdn/{EUNEQNYC.js → 7GH7VSB2.js} +1 -1
  46. package/dist/cdn/{YNJYG2RG.js → 7PLV4QH6.js} +2 -2
  47. package/dist/cdn/{JDL3HFFX.js → 7RCQFLPP.js} +2 -2
  48. package/dist/cdn/AMP6IALT.js +2 -0
  49. package/dist/cdn/{Y3AUHNRX.js → AO7BQHKC.js} +2 -2
  50. package/dist/cdn/{K6LVZHWM.js → AXDZBBNL.js} +2 -2
  51. package/dist/cdn/{WBRZZ4FB.js → DDLZOMUY.js} +2 -2
  52. package/dist/cdn/DHOVCT6R.js +2 -0
  53. package/dist/cdn/EF453FJ2.js +3 -0
  54. package/dist/cdn/{ESTSYVJP.js → F2AHA4GB.js} +2 -2
  55. package/dist/cdn/FB5DRKEB.js +14 -0
  56. package/dist/cdn/FX5JFRDL.js +2 -0
  57. package/dist/cdn/{CFT5BBC6.js → FX7UOGHP.js} +2 -2
  58. package/dist/cdn/{5PT7ZFXF.js → GM3QP65I.js} +2 -2
  59. package/dist/cdn/H7422XUG.js +2 -0
  60. package/dist/cdn/HB5A5R2E.js +2 -0
  61. package/dist/cdn/{LSGRWCAO.js → KMQ3SP4I.js} +2 -2
  62. package/dist/cdn/{7EXACS27.js → LBVX2JYG.js} +2 -2
  63. package/dist/cdn/{MZJGADGH.js → LQ6R5YRN.js} +2 -2
  64. package/dist/cdn/METXWS7V.js +166 -0
  65. package/dist/cdn/{3QC3BRZP.js → MH5RPXHM.js} +2 -2
  66. package/dist/cdn/N2VQD46V.js +106 -0
  67. package/dist/cdn/{54ATSQPS.js → NAUXSHIE.js} +18 -18
  68. package/dist/cdn/{SFREIREB.js → NE7E52YR.js} +2 -2
  69. package/dist/cdn/{2YEKZADB.js → NVI3I46B.js} +2 -2
  70. package/dist/cdn/{YGW7TUNX.js → OAVEHGB6.js} +1 -1
  71. package/dist/cdn/{DSEMD4M2.js → OH64RMOR.js} +3 -3
  72. package/dist/cdn/{PTGKT5P6.js → P6OPJQMC.js} +2 -2
  73. package/dist/cdn/QDO2AO53.js +36 -0
  74. package/dist/cdn/{TRDKA5Y6.js → QR54T33D.js} +2 -2
  75. package/dist/cdn/{457RLS3H.js → RVOAPUBN.js} +2 -2
  76. package/dist/cdn/{5JBT3YNY.js → SXDLXCIM.js} +2 -2
  77. package/dist/cdn/SZOVY2QU.js +2 -0
  78. package/dist/cdn/U3QQW6VA.js +16 -0
  79. package/dist/cdn/{G4SVCCJH.js → USMDJUFS.js} +2 -2
  80. package/dist/cdn/{Q5D5LJS5.js → V2P4AIGG.js} +2 -2
  81. package/dist/cdn/Y333DGV6.js +2 -0
  82. package/dist/cdn/Y67XAMT4.js +22 -0
  83. package/dist/cdn/{CFDTXKJ6.js → YIMNOUTF.js} +1 -1
  84. package/dist/cdn/ZS2TZ6BF.js +31 -0
  85. package/dist/cdn/{W5CHGOOR.js → ZTBA5PM7.js} +2 -2
  86. package/dist/cdn/assets/assistant/t9n/messages.ar.json +1 -1
  87. package/dist/cdn/assets/assistant/t9n/messages.bg.json +1 -1
  88. package/dist/cdn/assets/assistant/t9n/messages.bs.json +1 -1
  89. package/dist/cdn/assets/assistant/t9n/messages.ca.json +1 -1
  90. package/dist/cdn/assets/assistant/t9n/messages.cs.json +1 -1
  91. package/dist/cdn/assets/assistant/t9n/messages.da.json +1 -1
  92. package/dist/cdn/assets/assistant/t9n/messages.de.json +1 -1
  93. package/dist/cdn/assets/assistant/t9n/messages.el.json +1 -1
  94. package/dist/cdn/assets/assistant/t9n/messages.es.json +1 -1
  95. package/dist/cdn/assets/assistant/t9n/messages.et.json +1 -1
  96. package/dist/cdn/assets/assistant/t9n/messages.fi.json +1 -1
  97. package/dist/cdn/assets/assistant/t9n/messages.fr.json +1 -1
  98. package/dist/cdn/assets/assistant/t9n/messages.he.json +1 -1
  99. package/dist/cdn/assets/assistant/t9n/messages.hr.json +1 -1
  100. package/dist/cdn/assets/assistant/t9n/messages.hu.json +1 -1
  101. package/dist/cdn/assets/assistant/t9n/messages.id.json +1 -1
  102. package/dist/cdn/assets/assistant/t9n/messages.it.json +1 -1
  103. package/dist/cdn/assets/assistant/t9n/messages.ja.json +1 -1
  104. package/dist/cdn/assets/assistant/t9n/messages.ko.json +1 -1
  105. package/dist/cdn/assets/assistant/t9n/messages.lt.json +1 -1
  106. package/dist/cdn/assets/assistant/t9n/messages.lv.json +1 -1
  107. package/dist/cdn/assets/assistant/t9n/messages.nl.json +1 -1
  108. package/dist/cdn/assets/assistant/t9n/messages.no.json +1 -1
  109. package/dist/cdn/assets/assistant/t9n/messages.pl.json +1 -1
  110. package/dist/cdn/assets/assistant/t9n/messages.pt-BR.json +1 -1
  111. package/dist/cdn/assets/assistant/t9n/messages.pt-PT.json +1 -1
  112. package/dist/cdn/assets/assistant/t9n/messages.ro.json +1 -1
  113. package/dist/cdn/assets/assistant/t9n/messages.ru.json +1 -1
  114. package/dist/cdn/assets/assistant/t9n/messages.sk.json +1 -1
  115. package/dist/cdn/assets/assistant/t9n/messages.sl.json +1 -1
  116. package/dist/cdn/assets/assistant/t9n/messages.sr.json +1 -1
  117. package/dist/cdn/assets/assistant/t9n/messages.sv.json +1 -1
  118. package/dist/cdn/assets/assistant/t9n/messages.th.json +1 -1
  119. package/dist/cdn/assets/assistant/t9n/messages.tr.json +1 -1
  120. package/dist/cdn/assets/assistant/t9n/messages.uk.json +1 -1
  121. package/dist/cdn/assets/assistant/t9n/messages.vi.json +1 -1
  122. package/dist/cdn/assets/assistant/t9n/messages.zh-CN.json +1 -1
  123. package/dist/cdn/assets/assistant/t9n/messages.zh-HK.json +1 -1
  124. package/dist/cdn/assets/assistant/t9n/messages.zh-TW.json +1 -1
  125. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.ar.json +1 -1
  126. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.bg.json +1 -1
  127. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.bs.json +1 -1
  128. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.ca.json +1 -1
  129. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.cs.json +1 -1
  130. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.da.json +1 -1
  131. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.de.json +1 -1
  132. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.el.json +1 -1
  133. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.es.json +1 -1
  134. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.et.json +1 -1
  135. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.fi.json +1 -1
  136. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.fr.json +1 -1
  137. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.he.json +1 -1
  138. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.hr.json +1 -1
  139. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.hu.json +1 -1
  140. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.id.json +1 -1
  141. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.it.json +1 -1
  142. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.ja.json +1 -1
  143. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.ko.json +1 -1
  144. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.lt.json +1 -1
  145. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.lv.json +1 -1
  146. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.nl.json +1 -1
  147. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.no.json +1 -1
  148. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.pl.json +1 -1
  149. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.pt-BR.json +1 -1
  150. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.pt-PT.json +1 -1
  151. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.ro.json +1 -1
  152. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.ru.json +1 -1
  153. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.sk.json +1 -1
  154. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.sl.json +1 -1
  155. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.sr.json +1 -1
  156. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.sv.json +1 -1
  157. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.th.json +1 -1
  158. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.tr.json +1 -1
  159. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.uk.json +1 -1
  160. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.vi.json +1 -1
  161. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.zh-CN.json +1 -1
  162. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.zh-HK.json +1 -1
  163. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.zh-TW.json +1 -1
  164. package/dist/cdn/assets/assistant-message-footer/t9n/messages.ar.json +1 -1
  165. package/dist/cdn/assets/assistant-message-footer/t9n/messages.bg.json +1 -1
  166. package/dist/cdn/assets/assistant-message-footer/t9n/messages.bs.json +1 -1
  167. package/dist/cdn/assets/assistant-message-footer/t9n/messages.ca.json +1 -1
  168. package/dist/cdn/assets/assistant-message-footer/t9n/messages.cs.json +1 -1
  169. package/dist/cdn/assets/assistant-message-footer/t9n/messages.da.json +1 -1
  170. package/dist/cdn/assets/assistant-message-footer/t9n/messages.de.json +1 -1
  171. package/dist/cdn/assets/assistant-message-footer/t9n/messages.el.json +1 -1
  172. package/dist/cdn/assets/assistant-message-footer/t9n/messages.es.json +1 -1
  173. package/dist/cdn/assets/assistant-message-footer/t9n/messages.et.json +1 -1
  174. package/dist/cdn/assets/assistant-message-footer/t9n/messages.fi.json +1 -1
  175. package/dist/cdn/assets/assistant-message-footer/t9n/messages.fr.json +1 -1
  176. package/dist/cdn/assets/assistant-message-footer/t9n/messages.he.json +1 -1
  177. package/dist/cdn/assets/assistant-message-footer/t9n/messages.hr.json +1 -1
  178. package/dist/cdn/assets/assistant-message-footer/t9n/messages.hu.json +1 -1
  179. package/dist/cdn/assets/assistant-message-footer/t9n/messages.id.json +1 -1
  180. package/dist/cdn/assets/assistant-message-footer/t9n/messages.it.json +1 -1
  181. package/dist/cdn/assets/assistant-message-footer/t9n/messages.ja.json +1 -1
  182. package/dist/cdn/assets/assistant-message-footer/t9n/messages.ko.json +1 -1
  183. package/dist/cdn/assets/assistant-message-footer/t9n/messages.lt.json +1 -1
  184. package/dist/cdn/assets/assistant-message-footer/t9n/messages.lv.json +1 -1
  185. package/dist/cdn/assets/assistant-message-footer/t9n/messages.nl.json +1 -1
  186. package/dist/cdn/assets/assistant-message-footer/t9n/messages.no.json +1 -1
  187. package/dist/cdn/assets/assistant-message-footer/t9n/messages.pl.json +1 -1
  188. package/dist/cdn/assets/assistant-message-footer/t9n/messages.pt-BR.json +1 -1
  189. package/dist/cdn/assets/assistant-message-footer/t9n/messages.pt-PT.json +1 -1
  190. package/dist/cdn/assets/assistant-message-footer/t9n/messages.ro.json +1 -1
  191. package/dist/cdn/assets/assistant-message-footer/t9n/messages.ru.json +1 -1
  192. package/dist/cdn/assets/assistant-message-footer/t9n/messages.sk.json +1 -1
  193. package/dist/cdn/assets/assistant-message-footer/t9n/messages.sl.json +1 -1
  194. package/dist/cdn/assets/assistant-message-footer/t9n/messages.sr.json +1 -1
  195. package/dist/cdn/assets/assistant-message-footer/t9n/messages.sv.json +1 -1
  196. package/dist/cdn/assets/assistant-message-footer/t9n/messages.th.json +1 -1
  197. package/dist/cdn/assets/assistant-message-footer/t9n/messages.tr.json +1 -1
  198. package/dist/cdn/assets/assistant-message-footer/t9n/messages.uk.json +1 -1
  199. package/dist/cdn/assets/assistant-message-footer/t9n/messages.vi.json +1 -1
  200. package/dist/cdn/assets/assistant-message-footer/t9n/messages.zh-CN.json +1 -1
  201. package/dist/cdn/assets/assistant-message-footer/t9n/messages.zh-HK.json +1 -1
  202. package/dist/cdn/assets/assistant-message-footer/t9n/messages.zh-TW.json +1 -1
  203. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.ar.json +1 -1
  204. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.bg.json +1 -1
  205. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.bs.json +1 -1
  206. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.ca.json +1 -1
  207. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.cs.json +1 -1
  208. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.da.json +1 -1
  209. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.de.json +1 -1
  210. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.el.json +1 -1
  211. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.es.json +1 -1
  212. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.et.json +1 -1
  213. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.fi.json +1 -1
  214. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.fr.json +1 -1
  215. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.he.json +1 -1
  216. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.hr.json +1 -1
  217. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.hu.json +1 -1
  218. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.id.json +1 -1
  219. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.it.json +1 -1
  220. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.ja.json +1 -1
  221. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.ko.json +1 -1
  222. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.lt.json +1 -1
  223. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.lv.json +1 -1
  224. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.nl.json +1 -1
  225. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.no.json +1 -1
  226. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.pl.json +1 -1
  227. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.pt-BR.json +1 -1
  228. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.pt-PT.json +1 -1
  229. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.ro.json +1 -1
  230. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.ru.json +1 -1
  231. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.sk.json +1 -1
  232. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.sl.json +1 -1
  233. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.sr.json +1 -1
  234. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.sv.json +1 -1
  235. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.th.json +1 -1
  236. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.tr.json +1 -1
  237. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.uk.json +1 -1
  238. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.vi.json +1 -1
  239. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.zh-CN.json +1 -1
  240. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.zh-HK.json +1 -1
  241. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.zh-TW.json +1 -1
  242. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.ar.json +1 -1
  243. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.bg.json +1 -1
  244. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.bs.json +1 -1
  245. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.ca.json +1 -1
  246. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.cs.json +1 -1
  247. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.da.json +1 -1
  248. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.de.json +1 -1
  249. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.el.json +1 -1
  250. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.es.json +1 -1
  251. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.et.json +1 -1
  252. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.fi.json +1 -1
  253. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.fr.json +1 -1
  254. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.he.json +1 -1
  255. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.hr.json +1 -1
  256. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.hu.json +1 -1
  257. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.id.json +1 -1
  258. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.it.json +1 -1
  259. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.ja.json +1 -1
  260. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.ko.json +1 -1
  261. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.lt.json +1 -1
  262. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.lv.json +1 -1
  263. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.nl.json +1 -1
  264. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.no.json +1 -1
  265. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.pl.json +1 -1
  266. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.pt-BR.json +1 -1
  267. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.pt-PT.json +1 -1
  268. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.ro.json +1 -1
  269. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.ru.json +1 -1
  270. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.sk.json +1 -1
  271. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.sl.json +1 -1
  272. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.sr.json +1 -1
  273. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.sv.json +1 -1
  274. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.th.json +1 -1
  275. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.tr.json +1 -1
  276. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.uk.json +1 -1
  277. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.vi.json +1 -1
  278. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.zh-CN.json +1 -1
  279. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.zh-HK.json +1 -1
  280. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.zh-TW.json +1 -1
  281. package/dist/cdn/index.js +2 -2
  282. package/dist/cdn/main.css +1 -1
  283. package/dist/chunks/BaseWorkflow.js +107 -0
  284. package/dist/chunks/adapter.js +2964 -0
  285. package/dist/chunks/arcgisKnowledgeGraph.js +174 -0
  286. package/dist/chunks/arcgis_knowledge_current_lc_context.js +8 -0
  287. package/dist/chunks/arcgis_knowledge_current_map_context.js +8 -0
  288. package/dist/chunks/arcgis_knowledge_lucene_generation_prompt.js +101 -0
  289. package/dist/chunks/arcgis_knowledge_summarize_result_prompt.js +48 -0
  290. package/dist/chunks/arcgis_knowledge_tool_prompt.js +34 -0
  291. package/dist/chunks/converterUtils.js +1 -1
  292. package/dist/chunks/dataExplorationGraph.js +289 -0
  293. package/dist/chunks/data_explore_filter_prompt.js +125 -0
  294. package/dist/chunks/data_explore_query_prompt.js +131 -0
  295. package/dist/chunks/embeddings.worker.js +25 -0
  296. package/dist/chunks/field_descriptions_prompt.js +112 -0
  297. package/dist/chunks/generateLayerDescriptions.js +413 -0
  298. package/dist/chunks/graph.js +86 -0
  299. package/dist/chunks/helpGraph.js +123 -0
  300. package/dist/chunks/help_prompt.js +57 -0
  301. package/dist/chunks/intent_prompt.js +124 -0
  302. package/dist/chunks/layerStylingGraph.js +189 -0
  303. package/dist/chunks/layer_descriptions_prompt.js +59 -0
  304. package/dist/chunks/layer_styling_prompt.js +72 -0
  305. package/dist/chunks/navigationGraph.js +266 -0
  306. package/dist/chunks/navigation_intent_prompt.js +46 -0
  307. package/dist/chunks/navigation_tool_prompt.js +39 -0
  308. package/dist/chunks/orchestrator.js +528 -0
  309. package/dist/chunks/runtime.js +2 -2
  310. package/dist/chunks/slottableRequestUtils.js +1 -1
  311. package/dist/chunks/state.js +71 -0
  312. package/dist/chunks/summarize_query_response_prompt.js +77 -0
  313. package/dist/chunks/toolCallResponse.js +29 -0
  314. package/dist/chunks/useT9n.js +1 -1
  315. package/dist/chunks/utils.js +47 -29
  316. package/dist/chunks/utils2.js +42 -7
  317. package/dist/chunks/utils3.js +16 -0
  318. package/dist/components/arcgis-assistant/customElement.d.ts +60 -8
  319. package/dist/components/arcgis-assistant/customElement.js +32 -24
  320. package/dist/components/arcgis-assistant/types.d.ts +1 -1
  321. package/dist/components/arcgis-assistant-agent/customElement.d.ts +1 -1
  322. package/dist/components/arcgis-assistant-agent/customElement.js +2 -2
  323. package/dist/components/arcgis-assistant-chat/customElement.js +1 -1
  324. package/dist/components/arcgis-assistant-chat-entry/customElement.js +1 -1
  325. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +25 -9
  326. package/dist/components/arcgis-assistant-help-agent/customElement.js +28 -9
  327. package/dist/components/arcgis-assistant-interrupt/customElement.js +8 -12
  328. package/dist/components/arcgis-assistant-knowledge-agent/customElement.d.ts +158 -0
  329. package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +68 -0
  330. package/dist/components/arcgis-assistant-knowledge-agent/index.d.ts +1 -0
  331. package/dist/components/arcgis-assistant-knowledge-agent/index.js +1 -0
  332. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +28 -9
  333. package/dist/components/arcgis-assistant-message/customElement.js +1 -1
  334. package/dist/components/arcgis-assistant-message-block/customElement.d.ts +1 -1
  335. package/dist/components/arcgis-assistant-message-block/customElement.js +1 -1
  336. package/dist/components/arcgis-assistant-message-feedback/customElement.js +1 -1
  337. package/dist/components/arcgis-assistant-message-footer/customElement.js +1 -1
  338. package/dist/components/arcgis-assistant-message-loading/customElement.js +1 -1
  339. package/dist/components/arcgis-assistant-message-log/customElement.js +1 -1
  340. package/dist/components/arcgis-assistant-message-read-aloud/customElement.js +24 -28
  341. package/dist/components/arcgis-assistant-message-text/customElement.js +1 -1
  342. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +26 -8
  343. package/dist/components/arcgis-assistant-speech-input/customElement.js +1 -1
  344. package/dist/components/arcgis-assistant-suggested-prompts/customElement.js +1 -1
  345. package/dist/components/arcgis-assistant-user-message/customElement.js +1 -1
  346. package/dist/docs/api.json +1 -1
  347. package/dist/docs/docs.json +1 -1
  348. package/dist/docs/vscode.html-custom-data.json +1 -1
  349. package/dist/docs/web-types.json +1 -1
  350. package/dist/index.d.ts +4 -0
  351. package/dist/index.js +1 -1
  352. package/dist/loader.js +2 -1
  353. package/dist/types/lumina.d.ts +6 -1
  354. package/dist/types/preact.d.ts +7 -1
  355. package/dist/types/react.d.ts +8 -1
  356. package/dist/types/stencil.d.ts +6 -1
  357. package/dist/utils/index.d.ts +203 -9
  358. package/dist/utils/index.js +109 -11
  359. package/package.json +26 -11
  360. package/dist/cdn/4QVKWA2Z.js +0 -24
  361. package/dist/cdn/5L7OZ37N.js +0 -2
  362. package/dist/cdn/6ALN3KMA.js +0 -269
  363. package/dist/cdn/ARCP5UZY.js +0 -2
  364. package/dist/cdn/B4DEC7PH.js +0 -2
  365. package/dist/cdn/D7WNBUVK.js +0 -106
  366. package/dist/cdn/GER6EQYH.js +0 -2
  367. package/dist/cdn/KVH3PDVW.js +0 -2
  368. package/dist/cdn/O62HTIOD.js +0 -2
  369. package/dist/cdn/R5FWFRWW.js +0 -2
  370. package/dist/cdn/SZBOIYZZ.js +0 -2
  371. package/dist/cdn/WNDUCHXU.js +0 -2
  372. package/dist/cdn/YW52XJMM.js +0 -396
  373. package/dist/cdn/ZLO73NU6.js +0 -2
  374. package/dist/cdn/ZPNJGIAF.js +0 -2
package/README.md CHANGED
@@ -6,5 +6,5 @@ The ArcGIS Maps SDK for JavaScript provides a suite of ready-to-use UI component
6
6
 
7
7
  ## License
8
8
 
9
- This package is licensed under the terms described in the `LICENSE.md` file, located in the root of the package, and at https://js.arcgis.com/5.0/LICENSE.txt.
10
- For third party notices, see https://js.arcgis.com/5.0/third-party-notices.txt.
9
+ This package is licensed under the terms described in the `LICENSE.md` file, located in the root of the package, and at https://js.arcgis.com/5.1/LICENSE.txt.
10
+ For third party notices, see https://js.arcgis.com/5.1/third-party-notices.txt.
@@ -0,0 +1,90 @@
1
+ import type Accessor from "@arcgis/core/core/Accessor.js";
2
+ import type { AgentMiddleware } from "./middlewares/types.js";
3
+ import type { AgentCreateGraph, AgentData, AgentExecutionConfig, AgentGraphState, AgentStateAnnotation, EmptyAgentData, ZodObjectSchema } from "./types.js";
4
+ import type { AgentRegistration } from "../utils/index.js";
5
+
6
+ /**
7
+ * BaseAgent serves as the foundational class for all agent implementations. It
8
+ * provides common properties and methods that are shared across different types of agents.
9
+ * This class is not intended to be used directly, use any of the subclasses that extend BaseAgent
10
+ * instead.
11
+ *
12
+ * @since 5.1
13
+ */
14
+ export abstract class BaseAgent<TCustomState extends AgentData = EmptyAgentData> extends Accessor {
15
+ /**
16
+ * The createGraph function defines the internal graph structure of the agent,
17
+ * including its nodes, edges, and associated state.
18
+ *
19
+ * @internal
20
+ */
21
+ get createGraph(): AgentCreateGraph<TCustomState>;
22
+ /**
23
+ * Description of the agent's purpose and functionality. This can be used in registration metadata to provide context about the agent's functionality. A good description is clear and concise. Use bullet points to describe tasks the agent can accomplish. Provide examples of user questions or prompts that could be answered by the agent.
24
+ *
25
+ * @default ""
26
+ */
27
+ accessor description: string;
28
+ /** The unique identifier for the agent, derived from the name property. This ID is used for registration and invocation purposes. */
29
+ get id(): string;
30
+ /**
31
+ * An optional array of middleware functions that can be used to extend or modify the agent's
32
+ * behavior during execution.
33
+ * This allows for flexible customization of the agent's execution logic. For example, middlewares
34
+ * can be used to implement trace messages (i.e. logging), human-in-the-loop interrupts, or other custom actions.
35
+ */
36
+ accessor middlewares: AgentMiddleware<TCustomState>[];
37
+ /**
38
+ * A name for the agent, which is used in the registration metadata and can be displayed in tooling.
39
+ * It should be unique across agents to avoid registration conflicts. A good agent name clearly
40
+ * indicates the scope and purpose of the agent. For example, "WeatherAgent" or "CustomerSupportAgent"
41
+ * are descriptive names that convey the agent's functionality as opposed to generic names like
42
+ * "Agent1" or "MyAgent".
43
+ *
44
+ * The name is also used to generate the agent's [id](https://developers.arcgis.com/javascript/latest/references/ai-components/agent-utils/BaseAgent/#id).
45
+ *
46
+ * @required
47
+ */
48
+ accessor name: string;
49
+ /**
50
+ * The registration property assembles the necessary metadata and graph definition for this agent,
51
+ * which is consumed by the orchestrator during registration.
52
+ */
53
+ get registration(): AgentRegistration;
54
+ /**
55
+ * The workspace property serves as the agent's internal state storage, which is used to maintain
56
+ * context across graph node executions.
57
+ * This is where the agent's state is read from and written to during graph execution, allowing for
58
+ * dynamic behavior based on previous steps in the graph.
59
+ *
60
+ * @internal
61
+ */
62
+ get workspace(): AgentStateAnnotation<TCustomState>;
63
+ /**
64
+ * Rebuilds internal workspace and createGraph wiring. This is automatically called during initialization and whenever
65
+ * the name or description properties change, but can also be called manually if needed to refresh the agent's graph definition.
66
+ *
67
+ * The agent implementation is responsible for defining the createGraph function and workspace structure in this method, which are then used during execution.
68
+ *
69
+ * @internal
70
+ */
71
+ abstract generate(): void;
72
+ /**
73
+ * Returns all schemas required by this agent implementation.
74
+ *
75
+ * @returns An array of Zod object schemas that define the structure of the agent's expected input and output data.
76
+ * These schemas are used for validation and type inference during graph execution.
77
+ * @internal
78
+ */
79
+ abstract getSchemas(): ZodObjectSchema<object>[];
80
+ initialize(): void;
81
+ /**
82
+ * Executes the agent's graph with the provided state and configuration. This method is responsible
83
+ * for invoking the compiled graph and returning the resulting state after execution.
84
+ *
85
+ * @param state - An optional partial state object to initialize the graph execution. This can include any custom fields defined by the agent.
86
+ * @param config - An optional execution configuration that can influence the agent's behavior during invocation.
87
+ * @returns A promise that resolves to the updated agent graph state after execution.
88
+ */
89
+ run(state?: Partial<AgentGraphState<TCustomState>>, config?: AgentExecutionConfig): Promise<AgentGraphState<TCustomState>>;
90
+ }
@@ -0,0 +1,87 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import m from "@arcgis/core/core/Accessor.js";
3
+ import { property as i, subclass as l } from "@arcgis/core/core/accessorSupport/decorators.js";
4
+ import { a as u } from "../chunks/state.js";
5
+ import { watch as h } from "@arcgis/core/core/reactiveUtils.js";
6
+ var y = Object.defineProperty, w = Object.getOwnPropertyDescriptor, t = (s, a, o, p) => {
7
+ for (var r = p > 1 ? void 0 : p ? w(a, o) : a, n = s.length - 1, c; n >= 0; n--)
8
+ (c = s[n]) && (r = (p ? c(a, o, r) : c(r)) || r);
9
+ return p && r && y(a, o, r), r;
10
+ };
11
+ const d = () => {
12
+ throw new Error("createGraph method not implemented.");
13
+ };
14
+ let e = class extends m {
15
+ constructor() {
16
+ super(...arguments), this.description = "", this.middlewares = [], this.createGraph = d, this.workspace = u();
17
+ }
18
+ //#region Lifecycle
19
+ initialize() {
20
+ this.addHandles([
21
+ h(
22
+ () => [this.name, this.description],
23
+ () => this.generate(),
24
+ { initial: !0, sync: !0 }
25
+ ),
26
+ h(
27
+ () => this.createGraph,
28
+ () => this._compiledGraph = void 0
29
+ )
30
+ ]);
31
+ }
32
+ get id() {
33
+ return this.name.replace(/\s+/gu, "-").toLowerCase();
34
+ }
35
+ get registration() {
36
+ return {
37
+ id: this.id,
38
+ name: this.name,
39
+ description: this.description,
40
+ createGraph: this.createGraph,
41
+ workspace: this.workspace
42
+ };
43
+ }
44
+ //#endregion
45
+ //#region Public Methods
46
+ /**
47
+ * Executes the agent's graph with the provided state and configuration. This method is responsible
48
+ * for invoking the compiled graph and returning the resulting state after execution.
49
+ *
50
+ * @param state - An optional partial state object to initialize the graph execution. This can include any custom fields defined by the agent.
51
+ * @param config - An optional execution configuration that can influence the agent's behavior during invocation.
52
+ * @returns A promise that resolves to the updated agent graph state after execution.
53
+ *
54
+ * @public
55
+ */
56
+ async run(s = {}, a) {
57
+ return this.createGraph === d && this.generate(), this._compiledGraph = this._compiledGraph ?? this.createGraph().compile(), await this._compiledGraph.invoke(s, a);
58
+ }
59
+ //#endregion
60
+ };
61
+ t([
62
+ i({ readOnly: !0 })
63
+ ], e.prototype, "id", 1);
64
+ t([
65
+ i()
66
+ ], e.prototype, "name", 2);
67
+ t([
68
+ i()
69
+ ], e.prototype, "description", 2);
70
+ t([
71
+ i()
72
+ ], e.prototype, "middlewares", 2);
73
+ t([
74
+ i({ readOnly: !0 })
75
+ ], e.prototype, "createGraph", 2);
76
+ t([
77
+ i({ readOnly: !0 })
78
+ ], e.prototype, "workspace", 2);
79
+ t([
80
+ i({ readOnly: !0 })
81
+ ], e.prototype, "registration", 1);
82
+ e = t([
83
+ l("BaseAgent")
84
+ ], e);
85
+ export {
86
+ e as BaseAgent
87
+ };
@@ -0,0 +1,64 @@
1
+ import type { BaseAgent } from "./BaseAgent.js";
2
+ import type { AgentCustomState, AgentData, AgentExecutionConfig, AgentNodeState, ZodObjectSchema } from "./types.js";
3
+
4
+ /**
5
+ * FunctionAgentExecute defines the signature for the execute function used by FunctionAgent.
6
+ *
7
+ * @param state - Agent state at invocation time.
8
+ * @param config - Optional execution configuration.
9
+ * @returns Structured output object or final message string.
10
+ * @since 5.1
11
+ */
12
+ export type FunctionAgentExecute<TInput extends AgentData, TOutput extends AgentData> = (state: AgentNodeState<TInput, TOutput>, config?: AgentExecutionConfig) => Promise<TOutput | string> | TOutput | string;
13
+
14
+ /**
15
+ * FunctionAgent executes a user-provided function as its core logic.
16
+ * It supports optional input and output schemas for validation and structured data handling.
17
+ *
18
+ * @since 5.1
19
+ */
20
+ export class FunctionAgent<TInput extends AgentData = AgentData, TOutput extends AgentData = AgentData> extends BaseAgent<AgentCustomState<TInput, TOutput>> {
21
+ constructor(properties?: ConstructProperties<TInput, TOutput>);
22
+ /**
23
+ * The execute function contains the core logic of the FunctionAgent.
24
+ * It receives the current agent state and an optional execution configuration,
25
+ * and returns one of the following:
26
+ *
27
+ * - a structured output object - used in a follow-up node for further processing in the graph, or
28
+ * - a string representing a the final message to display in the chat UI.
29
+ *
30
+ * @required
31
+ */
32
+ accessor execute: FunctionAgentExecute<TInput, TOutput>;
33
+ /**
34
+ * The input schema defines the expected structure of the agent state when the execute function is invoked.
35
+ * If provided, the agent will validate incoming state against this schema and throw an error if validation fails.
36
+ */
37
+ accessor inputSchema: ZodObjectSchema<TInput> | undefined;
38
+ /**
39
+ * The output schema defines the expected structure of the result returned by the execute function.
40
+ * If provided, the agent will validate the output against this schema and handle it accordingly.
41
+ */
42
+ accessor outputSchema: ZodObjectSchema<TOutput> | undefined;
43
+ /**
44
+ * Rebuilds internal workspace and createGraph wiring. This is automatically called during initialization and whenever
45
+ * the name or description properties change, but can also be called manually if needed to refresh the agent's graph definition.
46
+ *
47
+ * The agent implementation is responsible for defining the createGraph function and workspace structure in this method, which are then used during execution.
48
+ *
49
+ * @internal
50
+ */
51
+ generate(): void;
52
+ /**
53
+ * Returns all schemas required by this agent implementation.
54
+ *
55
+ * @returns An array of Zod object schemas that define the structure of the agent's expected input and output data.
56
+ * These schemas are used for validation and type inference during graph execution.
57
+ * @internal
58
+ */
59
+ getSchemas(): ZodObjectSchema<object>[];
60
+ initialize(): void;
61
+ }
62
+
63
+ export type ConstructProperties<TInput extends AgentData, TOutput extends AgentData> = Partial<Pick<FunctionAgent<TInput, TOutput>, "description" | "inputSchema" | "middlewares" | "outputSchema">>
64
+ & Pick<FunctionAgent<TInput, TOutput>, "execute" | "name">;
@@ -0,0 +1,98 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import { property as u, subclass as p } from "@arcgis/core/core/accessorSupport/decorators.js";
3
+ import { isGraphInterrupt as m } from "@langchain/langgraph/web";
4
+ import { BaseAgent as d } from "./BaseAgent.js";
5
+ import { c as l } from "../chunks/graph.js";
6
+ import { c as f } from "../chunks/state.js";
7
+ import { watch as S } from "@arcgis/core/core/reactiveUtils.js";
8
+ import { c as h, h as g, g as v } from "../chunks/utils.js";
9
+ var w = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, o = (t, e, s, r) => {
10
+ for (var i = r > 1 ? void 0 : r ? _(e, s) : e, a = t.length - 1, c; a >= 0; a--)
11
+ (c = t[a]) && (i = (r ? c(e, s, i) : c(i)) || i);
12
+ return r && i && w(e, s, i), i;
13
+ };
14
+ let n = class extends d {
15
+ //#region Lifecycle
16
+ constructor(t) {
17
+ super(t);
18
+ }
19
+ initialize() {
20
+ this.addHandles(
21
+ S(
22
+ () => [this.name, this.description, this.inputSchema, this.outputSchema, this.execute],
23
+ () => {
24
+ this.generate();
25
+ },
26
+ { initial: !0, sync: !0 }
27
+ )
28
+ );
29
+ }
30
+ //#endregion
31
+ //#region Public Methods
32
+ getSchemas() {
33
+ return [this.inputSchema, this.outputSchema].filter(Boolean);
34
+ }
35
+ generate() {
36
+ const t = f(this.getSchemas());
37
+ this._set("workspace", t);
38
+ const e = `${this.id}-execute`, s = { [e]: this._invokeExecuteNode.bind(this) }, r = [{ from: e, decide: () => {
39
+ } }];
40
+ this._set(
41
+ "createGraph",
42
+ () => l(s, r, t, { agent: this, entryNode: e, middlewares: this.middlewares })
43
+ );
44
+ }
45
+ //#endregion
46
+ //#region Private Methods
47
+ async _invokeExecuteNode(t, e) {
48
+ try {
49
+ return this.outputSchema ? await this._invokeStructured(t, e) : await this._invokeUnstructured(t, e);
50
+ } catch (s) {
51
+ if (m(s))
52
+ throw s;
53
+ const r = s instanceof Error ? s.message : String(s);
54
+ return h({ outputMessage: r }, "failed", r);
55
+ }
56
+ }
57
+ async _invokeStructured(t, e) {
58
+ if (!this.outputSchema)
59
+ throw new Error("Output schema is required for structured invocation.");
60
+ const s = this._validateInputState(t), r = await this.execute(s, e);
61
+ if (typeof r == "string")
62
+ throw new Error(
63
+ "Expected execute function to return an object matching the output schema, but received a string."
64
+ );
65
+ return g(r, this.outputSchema, t.agentExecutionContext.messages);
66
+ }
67
+ async _invokeUnstructured(t, e) {
68
+ const s = this._validateInputState(t), r = await this.execute(s, e), i = typeof r == "string" ? r : JSON.stringify(r), a = i.trim() || "FunctionAgent completed.";
69
+ return h({ outputMessage: i }, "success", a);
70
+ }
71
+ _validateInputState(t) {
72
+ if (!this.inputSchema)
73
+ return t;
74
+ const e = this.inputSchema.safeParse(v(t, this.inputSchema));
75
+ if (!e.success)
76
+ throw new Error(`FunctionAgent input schema validation failed: ${e.error.message}`);
77
+ return {
78
+ ...t,
79
+ ...e.data
80
+ };
81
+ }
82
+ //#endregion
83
+ };
84
+ o([
85
+ u()
86
+ ], n.prototype, "inputSchema", 2);
87
+ o([
88
+ u()
89
+ ], n.prototype, "outputSchema", 2);
90
+ o([
91
+ u()
92
+ ], n.prototype, "execute", 2);
93
+ n = o([
94
+ p("FunctionAgent")
95
+ ], n);
96
+ export {
97
+ n as FunctionAgent
98
+ };
@@ -0,0 +1,65 @@
1
+ import type { BaseAgent } from "./BaseAgent.js";
2
+ import type { FunctionToolLike } from "./tools/FunctionTool.js";
3
+ import type { AgentCustomState, AgentData, ZodObjectSchema } from "./types.js";
4
+
5
+ /**
6
+ * LLMAgent uses a language model to generate its output based on a provided prompt template and optional tools.
7
+ * It supports structured input and output through Zod schemas, allowing for validation and type safety. The agent's logic is defined by the prompt and the tools it has access to, making it a flexible option for a wide range of use cases.
8
+ *
9
+ * @since 5.1
10
+ */
11
+ export class LLMAgent<TInput extends AgentData = AgentData, TOutput extends AgentData = AgentData> extends BaseAgent<AgentCustomState<TInput, TOutput>> {
12
+ constructor(properties?: ConstructProperties<TInput, TOutput>);
13
+ /**
14
+ * The inputSchema property is an optional Zod schema describing the expected structured input for the agent.
15
+ * This can be used for validation of the input state before execution and also to extract variables from the input
16
+ * state for prompt formatting.
17
+ */
18
+ accessor inputSchema: ZodObjectSchema<TInput> | undefined;
19
+ /**
20
+ * The tier of the model to use for the agent. This can affect the capabilities and performance of the agent.
21
+ *
22
+ * @default "default"
23
+ */
24
+ accessor modelTier: "advanced" | "default" | "fast";
25
+ /**
26
+ * The outputSchema property is an optional Zod schema describing the expected structured output from the agent.
27
+ * If provided, the agent will attempt to parse the language model's response according to this schema and return structured data.
28
+ * If not provided, the agent will treat the language model's response as an unstructured string message.
29
+ */
30
+ accessor outputSchema: ZodObjectSchema<TOutput> | undefined;
31
+ /**
32
+ * Defines the prompt template the agent will use to generate its output.
33
+ * This prompt can include variables that are populated from the agent's state at runtime through the input schema,
34
+ * allowing for dynamic and context-aware responses from the language model.
35
+ *
36
+ * In this example below, {location} and {weather} would be variables extracted from the agent's state according to the input schema.
37
+ *
38
+ * @example "Generate a weather report for {location} based on the current {weather} conditions."
39
+ * @required
40
+ */
41
+ accessor prompt: string;
42
+ /** The tools property is an optional array of FunctionTools that the agent can use during execution. */
43
+ accessor tools: FunctionToolLike[] | undefined;
44
+ /**
45
+ * Rebuilds internal workspace and createGraph wiring. This is automatically called during initialization and whenever
46
+ * the name or description properties change, but can also be called manually if needed to refresh the agent's graph definition.
47
+ *
48
+ * The agent implementation is responsible for defining the createGraph function and workspace structure in this method, which are then used during execution.
49
+ *
50
+ * @internal
51
+ */
52
+ generate(): void;
53
+ /**
54
+ * Returns all schemas required by this agent implementation.
55
+ *
56
+ * @returns An array of Zod object schemas that define the structure of the agent's expected input and output data.
57
+ * These schemas are used for validation and type inference during graph execution.
58
+ * @internal
59
+ */
60
+ getSchemas(): ZodObjectSchema<object>[];
61
+ initialize(): void;
62
+ }
63
+
64
+ export type ConstructProperties<TInput extends AgentData, TOutput extends AgentData> = Partial<Pick<LLMAgent<TInput, TOutput>, "description" | "inputSchema" | "middlewares" | "modelTier" | "outputSchema" | "tools">>
65
+ & Pick<LLMAgent<TInput, TOutput>, "name" | "prompt">;
@@ -0,0 +1,139 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import "@arcgis/core/identity/IdentityManager.js";
3
+ import "@arcgis/core/portal/Portal.js";
4
+ import { isGraphInterrupt as f } from "@langchain/langgraph/web";
5
+ import { c as u } from "../chunks/generateLayerDescriptions.js";
6
+ import "@langchain/core/messages";
7
+ import "@langchain/core/callbacks/dispatch/web";
8
+ import { watch as w } from "@arcgis/core/core/reactiveUtils.js";
9
+ import "@arcgis/core/layers/FeatureLayer.js";
10
+ import "@arcgis/core/request.js";
11
+ import { ChatPromptTemplate as S } from "@langchain/core/prompts";
12
+ import { property as m, subclass as _ } from "@arcgis/core/core/accessorSupport/decorators.js";
13
+ import { createAgent as h } from "langchain";
14
+ import { BaseAgent as v } from "./BaseAgent.js";
15
+ import { convertToLangChainMiddlewares as l } from "./middlewares/middleware.js";
16
+ import { c as y } from "../chunks/graph.js";
17
+ import { c as T } from "../chunks/state.js";
18
+ import { c as d, h as M, g as x } from "../chunks/utils.js";
19
+ var P = Object.defineProperty, b = Object.getOwnPropertyDescriptor, n = (t, s, r, e) => {
20
+ for (var o = e > 1 ? void 0 : e ? b(s, r) : s, p = t.length - 1, i; p >= 0; p--)
21
+ (i = t[p]) && (o = (e ? i(s, r, o) : i(o)) || o);
22
+ return e && o && P(s, r, o), o;
23
+ };
24
+ let a = class extends v {
25
+ //#region Lifecycle
26
+ constructor(t) {
27
+ super(t), this.modelTier = "default";
28
+ }
29
+ initialize() {
30
+ this.addHandles(
31
+ w(
32
+ () => [
33
+ this.description,
34
+ this.inputSchema,
35
+ this.modelTier,
36
+ this.name,
37
+ this.outputSchema,
38
+ this.prompt,
39
+ this.tools
40
+ ],
41
+ () => {
42
+ this.generate();
43
+ },
44
+ { initial: !0, sync: !0 }
45
+ )
46
+ );
47
+ }
48
+ //#endregion
49
+ //#region Public Methods
50
+ getSchemas() {
51
+ return [this.inputSchema, this.outputSchema].filter(Boolean);
52
+ }
53
+ generate() {
54
+ const t = T(this.getSchemas());
55
+ this._set("workspace", t);
56
+ const s = this.id, r = { [s]: this._invoke.bind(this) }, e = [{ from: s, decide: () => {
57
+ } }];
58
+ this._set(
59
+ "createGraph",
60
+ () => y(r, e, t, {
61
+ agent: this,
62
+ entryNode: s,
63
+ middlewares: this.middlewares
64
+ })
65
+ );
66
+ }
67
+ //#endregion
68
+ //#region Private Methods
69
+ async _invoke(t, s) {
70
+ try {
71
+ return this.outputSchema ? await this._invokeStructured(t, s) : await this._invokeUnstructured(t, s);
72
+ } catch (r) {
73
+ if (f(r))
74
+ throw r;
75
+ const e = r instanceof Error ? r.message : String(r);
76
+ return d({ outputMessage: e }, "failed", e);
77
+ }
78
+ }
79
+ async _invokeStructured(t, s) {
80
+ if (!this.outputSchema)
81
+ throw new Error("Output schema is required for structured invocation.");
82
+ const e = await h({
83
+ model: await u(this.modelTier),
84
+ systemPrompt: await this._getPromptWithInputVariables(t),
85
+ tools: this._getTools(),
86
+ checkpointer: !0,
87
+ middleware: l(this.middlewares),
88
+ responseFormat: this.outputSchema
89
+ }).invoke({ messages: t.agentExecutionContext.messages }, s);
90
+ if (!("structuredResponse" in e) || e.structuredResponse === void 0)
91
+ throw new Error("LLMAgent did not receive structured output from createAgent.");
92
+ return M(e.structuredResponse, this.outputSchema, e.messages);
93
+ }
94
+ async _invokeUnstructured(t, s) {
95
+ const o = (await h({
96
+ model: await u(this.modelTier),
97
+ systemPrompt: await this._getPromptWithInputVariables(t),
98
+ tools: this._getTools(),
99
+ checkpointer: !0,
100
+ middleware: l(this.middlewares)
101
+ }).invoke({ messages: t.agentExecutionContext.messages }, s)).messages, i = o.at(-1)?.content ?? "", c = typeof i == "string" ? i : JSON.stringify(i), g = c.trim() || "LLMAgent completed.";
102
+ return d(
103
+ { agentExecutionContext: { ...t.agentExecutionContext, messages: o }, outputMessage: c },
104
+ "success",
105
+ g
106
+ );
107
+ }
108
+ async _getPromptWithInputVariables(t) {
109
+ const s = x(t, this.inputSchema);
110
+ for (const { outputKey: e } of this.middlewares)
111
+ e && (s[String(e)] = t[e]);
112
+ return await S.fromTemplate(this.prompt).format(s);
113
+ }
114
+ _getTools() {
115
+ return this.tools?.map((t) => t.getTool()) ?? [];
116
+ }
117
+ //#endregion
118
+ };
119
+ n([
120
+ m()
121
+ ], a.prototype, "prompt", 2);
122
+ n([
123
+ m()
124
+ ], a.prototype, "tools", 2);
125
+ n([
126
+ m()
127
+ ], a.prototype, "inputSchema", 2);
128
+ n([
129
+ m()
130
+ ], a.prototype, "outputSchema", 2);
131
+ n([
132
+ m()
133
+ ], a.prototype, "modelTier", 2);
134
+ a = n([
135
+ _("LLMAgent")
136
+ ], a);
137
+ export {
138
+ a as LLMAgent
139
+ };
@@ -0,0 +1,44 @@
1
+ import type { BaseAgent } from "./BaseAgent.js";
2
+ import type { BaseWorkflow } from "./workflows/BaseWorkflow.js";
3
+ import type { AgentData, ZodObjectSchema } from "./types.js";
4
+
5
+ /**
6
+ * WorkflowAgent wraps agents and workflows so they can be executed and registered as a single agent.
7
+ * The workflow defines the internal graph structure and logic of the agent, while WorkflowAgent provides the interface for integration with the broader agent system.
8
+ *
9
+ * @since 5.1
10
+ */
11
+ export class WorkflowAgent<TState extends AgentData = AgentData> extends BaseAgent<TState> {
12
+ constructor(properties: ConstructProperties<TState>);
13
+ /** Optional structured input schema for the workflow wrapper. */
14
+ accessor inputSchema: ZodObjectSchema<object> | undefined;
15
+ /** Optional structured output schema for the workflow wrapper. */
16
+ accessor outputSchema: ZodObjectSchema<object> | undefined;
17
+ /**
18
+ * The workflow to execute when generating and running this agent's graph.
19
+ *
20
+ * @required
21
+ */
22
+ accessor workflow: BaseWorkflow<TState>;
23
+ /**
24
+ * Rebuilds internal workspace and createGraph wiring. This is automatically called during initialization and whenever
25
+ * the name or description properties change, but can also be called manually if needed to refresh the agent's graph definition.
26
+ *
27
+ * The agent implementation is responsible for defining the createGraph function and workspace structure in this method, which are then used during execution.
28
+ *
29
+ * @internal
30
+ */
31
+ generate(): void;
32
+ /**
33
+ * Returns all schemas required by this agent implementation.
34
+ *
35
+ * @returns An array of Zod object schemas that define the structure of the agent's expected input and output data.
36
+ * These schemas are used for validation and type inference during graph execution.
37
+ * @internal
38
+ */
39
+ getSchemas(): ZodObjectSchema<object>[];
40
+ initialize(): void;
41
+ }
42
+
43
+ export type ConstructProperties<TState extends AgentData = AgentData> = Partial<Pick<WorkflowAgent<TState>, "description" | "inputSchema" | "middlewares" | "outputSchema">>
44
+ & Pick<WorkflowAgent<TState>, "name" | "workflow">;
@@ -0,0 +1,70 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import { property as h, subclass as c } from "@arcgis/core/core/accessorSupport/decorators.js";
3
+ import { watch as l } from "@arcgis/core/core/reactiveUtils.js";
4
+ import { BaseAgent as m } from "./BaseAgent.js";
5
+ import { c as u } from "../chunks/graph.js";
6
+ import "../chunks/BaseWorkflow.js";
7
+ var f = Object.defineProperty, w = Object.getOwnPropertyDescriptor, n = (e, r, s, o) => {
8
+ for (var t = o > 1 ? void 0 : o ? w(r, s) : r, i = e.length - 1, a; i >= 0; i--)
9
+ (a = e[i]) && (t = (o ? a(r, s, t) : a(t)) || t);
10
+ return o && t && f(r, s, t), t;
11
+ };
12
+ let p = class extends m {
13
+ //#region Lifecycle
14
+ constructor(e) {
15
+ super(e);
16
+ }
17
+ initialize() {
18
+ this.addHandles(
19
+ l(
20
+ () => [this.name, this.description, this.inputSchema, this.outputSchema, this.workflow],
21
+ () => this.generate(),
22
+ { initial: !0, sync: !0 }
23
+ )
24
+ );
25
+ }
26
+ //#endregion
27
+ //#region Public Methods
28
+ getSchemas() {
29
+ return [
30
+ this.inputSchema,
31
+ ...this.workflow.getAgents().flatMap((e) => e.getSchemas()),
32
+ this.outputSchema
33
+ ].filter(Boolean);
34
+ }
35
+ generate() {
36
+ const { workspace: e, createGraph: r } = this.workflow.generate();
37
+ if (this._set("workspace", e), !this.middlewares?.length)
38
+ this._set("createGraph", r);
39
+ else {
40
+ const s = this.id, o = {
41
+ [s]: async (i, a) => await r().compile().invoke(i, a)
42
+ }, t = [{ from: s, decide: () => {
43
+ } }];
44
+ this._set(
45
+ "createGraph",
46
+ () => u(o, t, e, {
47
+ agent: this,
48
+ entryNode: s,
49
+ middlewares: this.middlewares
50
+ })
51
+ );
52
+ }
53
+ }
54
+ //#endregion
55
+ };
56
+ n([
57
+ h()
58
+ ], p.prototype, "workflow", 2);
59
+ n([
60
+ h()
61
+ ], p.prototype, "inputSchema", 2);
62
+ n([
63
+ h()
64
+ ], p.prototype, "outputSchema", 2);
65
+ p = n([
66
+ c("WorkflowAgent")
67
+ ], p);
68
+ export {
69
+ p as WorkflowAgent
70
+ };