@arcgis/ai-components 5.1.0-next.98 → 5.1.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.
- package/README.md +2 -2
- package/dist/agent-utils/BaseAgent.d.ts +90 -0
- package/dist/agent-utils/BaseAgent.js +87 -0
- package/dist/agent-utils/FunctionAgent.d.ts +64 -0
- package/dist/agent-utils/FunctionAgent.js +98 -0
- package/dist/agent-utils/LLMAgent.d.ts +65 -0
- package/dist/agent-utils/LLMAgent.js +140 -0
- package/dist/agent-utils/WorkflowAgent.d.ts +44 -0
- package/dist/agent-utils/WorkflowAgent.js +70 -0
- package/dist/agent-utils/index.d.ts +177 -0
- package/dist/agent-utils/index.js +167 -0
- package/dist/agent-utils/middlewares/humanInTheLoop.d.ts +152 -0
- package/dist/agent-utils/middlewares/humanInTheLoop.js +94 -0
- package/dist/agent-utils/middlewares/middleware.d.ts +25 -0
- package/dist/agent-utils/middlewares/middleware.js +44 -0
- package/dist/agent-utils/middlewares/trace.d.ts +27 -0
- package/dist/agent-utils/middlewares/trace.js +42 -0
- package/dist/agent-utils/middlewares/types.d.ts +123 -0
- package/dist/agent-utils/middlewares/types.js +2 -0
- package/dist/agent-utils/tools/FunctionTool.d.ts +127 -0
- package/dist/agent-utils/tools/FunctionTool.js +80 -0
- package/dist/agent-utils/types.d.ts +181 -0
- package/dist/agent-utils/workflows/BaseWorkflow.d.ts +87 -0
- package/dist/agent-utils/workflows/ConditionalWorkflow.d.ts +72 -0
- package/dist/agent-utils/workflows/ConditionalWorkflow.js +61 -0
- package/dist/agent-utils/workflows/LoopWorkflow.d.ts +58 -0
- package/dist/agent-utils/workflows/LoopWorkflow.js +56 -0
- package/dist/agent-utils/workflows/ParallelWorkflow.d.ts +68 -0
- package/dist/agent-utils/workflows/ParallelWorkflow.js +129 -0
- package/dist/agent-utils/workflows/RouterWorkflow.d.ts +63 -0
- package/dist/agent-utils/workflows/RouterWorkflow.js +75 -0
- package/dist/agent-utils/workflows/SequentialWorkflow.d.ts +56 -0
- package/dist/agent-utils/workflows/SequentialWorkflow.js +69 -0
- package/dist/agent-utils/workflows/SwitchWorkflow.d.ts +74 -0
- package/dist/agent-utils/workflows/SwitchWorkflow.js +84 -0
- package/dist/assets/embeddings.worker-k9_Ou679.js +1 -0
- package/dist/cdn/23JKEYWV.js +2 -0
- package/dist/cdn/2XP5E435.js +2 -0
- package/dist/cdn/3H7F4V6U.js +2 -0
- package/dist/cdn/3J5RM5OR.js +36 -0
- package/dist/cdn/46U2PGRW.js +65 -0
- package/dist/cdn/4ASZF5I2.js +181 -0
- package/dist/cdn/4BA4OUWC.js +134 -0
- package/dist/cdn/4EALV6QJ.js +2 -0
- package/dist/cdn/4Z4AESFZ.js +2 -0
- package/dist/cdn/{5PT7ZFXF.js → 5RQUSM3T.js} +23 -5
- package/dist/cdn/6FEB6XYK.js +2 -0
- package/dist/cdn/7CCULIWM.js +2 -0
- package/dist/cdn/7Q2WROGA.js +2 -0
- package/dist/cdn/7WSTR3WA.js +2 -0
- package/dist/cdn/7ZN4HYX2.js +2 -0
- package/dist/cdn/A6C7XUI4.js +2 -0
- package/dist/cdn/{SFREIREB.js → AJKWCXDA.js} +8 -2
- package/dist/cdn/AXOPGQGZ.js +2 -0
- package/dist/cdn/BAGQCT2N.js +2 -0
- package/dist/cdn/BBB2NVY5.js +3 -0
- package/dist/cdn/BGZV7RUS.js +2 -0
- package/dist/cdn/BUTKUPXN.js +34 -0
- package/dist/cdn/CU2TRUZQ.js +99 -0
- package/dist/cdn/D5PZVUO7.js +2 -0
- package/dist/cdn/DB2C7FK7.js +2 -0
- package/dist/cdn/DHGNGMNJ.js +2 -0
- package/dist/cdn/DKNDDDWM.js +2 -0
- package/dist/cdn/DTRZOJOT.js +2 -0
- package/dist/cdn/ESRKMM6P.js +2 -0
- package/dist/cdn/FDBWYCAB.js +22 -0
- package/dist/cdn/FYNHAVHL.js +2 -0
- package/dist/cdn/H3EEFM4A.js +179 -0
- package/dist/cdn/HIGLOYFN.js +9 -0
- package/dist/cdn/JNDONBTW.js +2 -0
- package/dist/cdn/JOLKZ6S5.js +2 -0
- package/dist/cdn/JQ5VH32K.js +2 -0
- package/dist/cdn/K6BGVUQ7.js +2 -0
- package/dist/cdn/KGYSBUFO.js +9 -0
- package/dist/cdn/L6GVMINQ.js +2 -0
- package/dist/cdn/LTPDBXQ7.js +6 -0
- package/dist/cdn/LUY7QCZ3.js +2 -0
- package/dist/cdn/LXJWWOGK.js +66 -0
- package/dist/cdn/M7C6Y752.js +2 -0
- package/dist/cdn/{3QC3BRZP.js → MEQ67UQH.js} +1 -1
- package/dist/cdn/MJM2MHJW.js +44 -0
- package/dist/cdn/MNCG7Q7C.js +3 -0
- package/dist/cdn/MNHNUIMV.js +2 -0
- package/dist/cdn/N2SKXRLK.js +71 -0
- package/dist/cdn/OBDCCGVH.js +2 -0
- package/dist/cdn/OFH2TDZM.js +2 -0
- package/dist/cdn/OP6ENMCN.js +180 -0
- package/dist/cdn/P5M2HNJ7.js +2 -0
- package/dist/cdn/PFW7KXCP.js +48 -0
- package/dist/cdn/PIUDMACH.js +56 -0
- package/dist/cdn/PKH5BECA.js +2 -0
- package/dist/cdn/PTKZXFXB.js +31 -0
- package/dist/cdn/{O62HTIOD.js → Q33HJXYV.js} +1 -1
- package/dist/cdn/QH6TSBNI.js +2 -0
- package/dist/cdn/QZXQIJSW.js +2 -0
- package/dist/cdn/SHCVYGIH.js +4 -0
- package/dist/cdn/SUFXLHTD.js +2 -0
- package/dist/cdn/{VHOF6SUZ.js → TIXCHLEN.js} +17 -1
- package/dist/cdn/TOYQ22PR.js +2 -0
- package/dist/cdn/UDXMJNRF.js +3 -0
- package/dist/cdn/UE3CP46P.js +2 -0
- package/dist/cdn/VDAF255D.js +22 -0
- package/dist/cdn/VPZHLYPA.js +2 -0
- package/dist/cdn/{7EXACS27.js → VWMJ7HIK.js} +10 -7
- package/dist/cdn/W2CWLWUT.js +14 -0
- package/dist/cdn/W6HO4D6J.js +18 -0
- package/dist/cdn/WNJM5TET.js +2 -0
- package/dist/cdn/XKIAXVPE.js +2 -0
- package/dist/cdn/XMJF5F4M.js +2 -0
- package/dist/cdn/Y5GGIKKC.js +2 -0
- package/dist/cdn/YURWID37.js +2 -0
- package/dist/cdn/agent-utils/index.js +2 -0
- package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +3 -0
- package/dist/cdn/agent-utils/middlewares/middleware.js +2 -0
- package/dist/cdn/agent-utils/middlewares/trace.js +2 -0
- package/dist/cdn/assets/assistant/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/BaseWorkflow.js +107 -0
- package/dist/chunks/adapter.js +3130 -0
- package/dist/chunks/arcgisKnowledgeGraph.js +229 -0
- package/dist/chunks/arcgis_knowledge_current_lc_context.js +25 -0
- package/dist/chunks/arcgis_knowledge_current_map_context.js +37 -0
- package/dist/chunks/arcgis_knowledge_cypher_query_prompt.js +102 -0
- package/dist/chunks/arcgis_knowledge_lucene_generation_prompt.js +101 -0
- package/dist/chunks/arcgis_knowledge_summarize_result_prompt.js +137 -0
- package/dist/chunks/arcgis_knowledge_tool_prompt.js +34 -0
- package/dist/chunks/converterUtils.js +39 -32
- package/dist/chunks/dataExplorationGraph.js +324 -0
- package/dist/chunks/data_explore_filter_prompt.js +125 -0
- package/dist/chunks/data_explore_query_prompt.js +149 -0
- package/dist/chunks/embeddings.worker.js +25 -0
- package/dist/chunks/field_descriptions_prompt.js +112 -0
- package/dist/chunks/generateLayerDescriptions.js +453 -0
- package/dist/chunks/graph.js +86 -0
- package/dist/chunks/helpGraph.js +127 -0
- package/dist/chunks/help_prompt.js +74 -0
- package/dist/chunks/index.js +11 -0
- package/dist/chunks/intent_prompt.js +139 -0
- package/dist/chunks/layerStylingGraph.js +193 -0
- package/dist/chunks/layer_descriptions_prompt.js +59 -0
- package/dist/chunks/layer_styling_prompt.js +72 -0
- package/dist/chunks/navigationGraph.js +271 -0
- package/dist/chunks/navigation_intent_prompt.js +52 -0
- package/dist/chunks/navigation_tool_prompt.js +39 -0
- package/dist/chunks/orchestrator.js +569 -0
- package/dist/chunks/runtime.js +1 -1
- package/dist/chunks/slottableRequestUtils.js +3 -7
- package/dist/chunks/state.js +71 -0
- package/dist/chunks/summarize_query_response_prompt.js +80 -0
- package/dist/chunks/toolCallResponse.js +32 -0
- package/dist/chunks/utils.js +46 -28
- package/dist/chunks/utils2.js +41 -6
- package/dist/chunks/utils3.js +16 -0
- package/dist/components/arcgis-assistant/customElement.d.ts +82 -8
- package/dist/components/arcgis-assistant/customElement.js +393 -152
- package/dist/components/arcgis-assistant/index.js +2 -3
- package/dist/components/arcgis-assistant/types.d.ts +15 -2
- package/dist/components/arcgis-assistant-agent/customElement.d.ts +1 -1
- package/dist/components/arcgis-assistant-agent/customElement.js +6 -2
- package/dist/components/arcgis-assistant-chat/customElement.d.ts +8 -2
- package/dist/components/arcgis-assistant-chat/customElement.js +23 -18
- package/dist/components/arcgis-assistant-chat-entry/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-chat-entry/customElement.js +25 -18
- package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +30 -8
- package/dist/components/arcgis-assistant-help-agent/customElement.js +33 -8
- package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-interrupt/customElement.js +5 -5
- package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +20 -0
- package/dist/components/arcgis-assistant-interrupt-preview/index.js +2 -0
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.d.ts +158 -0
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +74 -0
- package/dist/components/arcgis-assistant-knowledge-agent/index.d.ts +1 -0
- package/dist/components/arcgis-assistant-knowledge-agent/index.js +1 -0
- package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +31 -6
- package/dist/components/arcgis-assistant-message/customElement.d.ts +23 -0
- package/dist/components/arcgis-assistant-message/customElement.js +28 -26
- package/dist/components/arcgis-assistant-message/index.d.ts +1 -0
- package/dist/components/arcgis-assistant-message/index.js +2 -0
- package/dist/components/arcgis-assistant-message-block/customElement.d.ts +2 -2
- package/dist/components/arcgis-assistant-message-block/customElement.js +18 -11
- package/dist/components/arcgis-assistant-message-block/index.js +1 -0
- package/dist/components/arcgis-assistant-message-feedback/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-message-footer/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +8 -1
- package/dist/components/arcgis-assistant-message-loading/customElement.js +8 -8
- package/dist/components/arcgis-assistant-message-loading/index.js +1 -0
- package/dist/components/arcgis-assistant-message-log/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-message-read-aloud/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-message-read-aloud/customElement.js +23 -27
- package/dist/components/arcgis-assistant-message-text/customElement.d.ts +5 -1
- package/dist/components/arcgis-assistant-message-text/customElement.js +12 -12
- package/dist/components/arcgis-assistant-navigation-agent/customElement.js +31 -7
- package/dist/components/arcgis-assistant-speech-input/customElement.d.ts +6 -1
- package/dist/components/arcgis-assistant-suggested-prompts/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-suggested-prompts/customElement.js +8 -8
- package/dist/components/arcgis-assistant-user-message/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-user-message/customElement.js +10 -8
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/loader.js +8 -6
- package/dist/types/lumina.d.ts +16 -5
- package/dist/types/preact.d.ts +18 -5
- package/dist/types/react.d.ts +20 -5
- package/dist/types/stencil.d.ts +16 -5
- package/dist/utils/index.d.ts +246 -9
- package/dist/utils/index.js +113 -10
- package/package.json +28 -12
- package/dist/cdn/2YEKZADB.js +0 -2
- package/dist/cdn/457RLS3H.js +0 -2
- package/dist/cdn/4CPZZBYD.js +0 -2
- package/dist/cdn/54ATSQPS.js +0 -72
- package/dist/cdn/5JBT3YNY.js +0 -2
- package/dist/cdn/5JS65BCP.js +0 -29
- package/dist/cdn/7EHQLXMU.js +0 -2
- package/dist/cdn/AKOWC7YT.js +0 -18
- package/dist/cdn/ARCP5UZY.js +0 -2
- package/dist/cdn/B4DEC7PH.js +0 -2
- package/dist/cdn/D7WNBUVK.js +0 -106
- package/dist/cdn/DSEMD4M2.js +0 -4
- package/dist/cdn/ESTSYVJP.js +0 -54
- package/dist/cdn/EUNEQNYC.js +0 -2
- package/dist/cdn/G4SVCCJH.js +0 -2
- package/dist/cdn/I2KPFZDL.js +0 -2
- package/dist/cdn/KVH3PDVW.js +0 -2
- package/dist/cdn/LSGRWCAO.js +0 -5
- package/dist/cdn/LXFCO34K.js +0 -2
- package/dist/cdn/M73KKJSM.js +0 -2
- package/dist/cdn/PTGKT5P6.js +0 -3
- package/dist/cdn/Q5D5LJS5.js +0 -2
- package/dist/cdn/R5FWFRWW.js +0 -2
- package/dist/cdn/TRDKA5Y6.js +0 -2
- package/dist/cdn/UK6CP7BR.js +0 -2
- package/dist/cdn/WBRZZ4FB.js +0 -2
- package/dist/cdn/Y3AUHNRX.js +0 -2
- package/dist/cdn/YGW7TUNX.js +0 -2
- package/dist/cdn/YNJYG2RG.js +0 -2
- package/dist/cdn/YW52XJMM.js +0 -396
- package/dist/cdn/Z3DVGFEE.js +0 -2
- package/dist/cdn/Z4N6N4OZ.js +0 -271
- package/dist/cdn/ZLO73NU6.js +0 -2
- package/dist/cdn/ZPNJGIAF.js +0 -2
- /package/dist/cdn/{YVTKUITE.js → 53Z3R4OY.js} +0 -0
- /package/dist/cdn/{CFT5BBC6.js → 77GAVZIK.js} +0 -0
- /package/dist/cdn/{W5CHGOOR.js → G7XK3XOR.js} +0 -0
- /package/dist/cdn/{DMLSCJAM.js → HJGF7W5O.js} +0 -0
- /package/dist/cdn/{JDL3HFFX.js → MQ7QXIOW.js} +0 -0
- /package/dist/cdn/{MZJGADGH.js → NMWLJECU.js} +0 -0
- /package/dist/cdn/{24MYCR6F.js → URYKQKFE.js} +0 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { AgentData, AgentExecutionConfig, AgentGraphState, BaseAgentLike, GraphEdge, GraphNodes } from "../types.js";
|
|
2
|
+
import type { BaseWorkflow } from "./BaseWorkflow.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Condition function that routes execution to either the true branch or false branch.
|
|
6
|
+
*
|
|
7
|
+
* @param state - Current workflow graph state.
|
|
8
|
+
* @param config - Optional execution configuration.
|
|
9
|
+
* @since 5.1
|
|
10
|
+
*/
|
|
11
|
+
export type ConditionDecider<TState extends AgentData = AgentData> = (state: AgentGraphState<TState>, config?: AgentExecutionConfig) => Promise<boolean> | boolean;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* ConditionalWorkflow chooses between two branch agents based on a boolean condition and
|
|
15
|
+
* routes execution through a simple true/false branch.
|
|
16
|
+
*
|
|
17
|
+
* Use when:
|
|
18
|
+
* - you want an if/else style decision or
|
|
19
|
+
* - only two branches are needed.
|
|
20
|
+
*
|
|
21
|
+
* How it works:
|
|
22
|
+
* - evaluate `condition(state, config)`,
|
|
23
|
+
* - if true, run the first branch agent,
|
|
24
|
+
* - if false, run the second branch agent.
|
|
25
|
+
*
|
|
26
|
+
* @since 5.1
|
|
27
|
+
*/
|
|
28
|
+
export class ConditionalWorkflow<TState extends AgentData = AgentData> extends BaseWorkflow<TState> {
|
|
29
|
+
constructor(properties: ConditionalWorkflowConstructProperties<TState>);
|
|
30
|
+
/**
|
|
31
|
+
* Must contain exactly two agents: `[trueAgent, falseAgent]`. The first agent is executed when
|
|
32
|
+
* the condition is true, the second when the condition is false.
|
|
33
|
+
*
|
|
34
|
+
* @required
|
|
35
|
+
*/
|
|
36
|
+
accessor agents: BaseAgentLike<TState>[];
|
|
37
|
+
/**
|
|
38
|
+
* Predicate that chooses the next branch.
|
|
39
|
+
*
|
|
40
|
+
* @required
|
|
41
|
+
*/
|
|
42
|
+
accessor condition: ConditionDecider<TState>;
|
|
43
|
+
/**
|
|
44
|
+
* Builds the workflow-specific edges.
|
|
45
|
+
*
|
|
46
|
+
* @param agents
|
|
47
|
+
*/
|
|
48
|
+
protected buildEdges(agents: BaseAgentLike<TState>[]): GraphEdge<AgentGraphState<TState>>[];
|
|
49
|
+
/**
|
|
50
|
+
* Builds the workflow's graph nodes.
|
|
51
|
+
*
|
|
52
|
+
* Node ids use the agent id plus its position (`agent.id_index`) instead of only the raw
|
|
53
|
+
* agent id. That prevents collisions when the same agent instance is used multiple times.
|
|
54
|
+
*
|
|
55
|
+
* @param agents
|
|
56
|
+
*/
|
|
57
|
+
protected buildNodes(agents: BaseAgentLike<TState>[]): GraphNodes<AgentGraphState<TState>>;
|
|
58
|
+
/** A list of agents that are part of this workflow. */
|
|
59
|
+
getAgents(): BaseAgentLike<TState>[];
|
|
60
|
+
/** Returns the id of the first node in the workflow graph. */
|
|
61
|
+
protected getEntryNode(): string;
|
|
62
|
+
/** Returns whether the agent at this position should expose terminal runtime fields. */
|
|
63
|
+
protected isTerminalAgent(): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Validates the workflow configuration and throws if invalid.
|
|
66
|
+
*
|
|
67
|
+
* @param agents
|
|
68
|
+
*/
|
|
69
|
+
protected validateAgents(agents: BaseAgentLike<TState>[]): void;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export type ConditionalWorkflowConstructProperties<TState extends AgentData> = Pick<ConditionalWorkflow<TState>, "agents" | "condition">;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import { property as u, subclass as f } from "@arcgis/core/core/accessorSupport/decorators.js";
|
|
3
|
+
import { B as p, g as c } from "../../chunks/BaseWorkflow.js";
|
|
4
|
+
var g = Object.defineProperty, w = Object.getOwnPropertyDescriptor, a = (e, r, n, t) => {
|
|
5
|
+
for (var o = t > 1 ? void 0 : t ? w(r, n) : r, i = e.length - 1, s; i >= 0; i--)
|
|
6
|
+
(s = e[i]) && (o = (t ? s(r, n, o) : s(o)) || o);
|
|
7
|
+
return t && o && g(r, n, o), o;
|
|
8
|
+
};
|
|
9
|
+
let l = class extends p {
|
|
10
|
+
//#region Lifecycle
|
|
11
|
+
constructor(e) {
|
|
12
|
+
super(e);
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region Public Methods
|
|
16
|
+
getAgents() {
|
|
17
|
+
return this.agents;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region Protected Methods
|
|
21
|
+
buildNodes(e) {
|
|
22
|
+
const r = super.buildNodes(e);
|
|
23
|
+
return r[d] = () => ({}), r;
|
|
24
|
+
}
|
|
25
|
+
buildEdges(e) {
|
|
26
|
+
const r = this.condition;
|
|
27
|
+
if (!r)
|
|
28
|
+
throw new Error("ConditionalWorkflow requires a condition.");
|
|
29
|
+
const n = c(e[0], 0), t = c(e[1], 1);
|
|
30
|
+
return [
|
|
31
|
+
{
|
|
32
|
+
from: d,
|
|
33
|
+
decide: async (o, i) => await Promise.resolve(r(o, i)) ? n : t
|
|
34
|
+
}
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
getEntryNode() {
|
|
38
|
+
return d;
|
|
39
|
+
}
|
|
40
|
+
isTerminalAgent() {
|
|
41
|
+
return !0;
|
|
42
|
+
}
|
|
43
|
+
validateAgents(e) {
|
|
44
|
+
if (super.validateAgents(e), e.length !== 2)
|
|
45
|
+
throw new Error(`ConditionalWorkflow requires exactly 2 agents; received ${e.length}.`);
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
};
|
|
49
|
+
a([
|
|
50
|
+
u()
|
|
51
|
+
], l.prototype, "condition", 2);
|
|
52
|
+
a([
|
|
53
|
+
u()
|
|
54
|
+
], l.prototype, "agents", 2);
|
|
55
|
+
l = a([
|
|
56
|
+
f("ConditionalWorkflow")
|
|
57
|
+
], l);
|
|
58
|
+
const d = "__conditional_decide";
|
|
59
|
+
export {
|
|
60
|
+
l as ConditionalWorkflow
|
|
61
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { AgentData, AgentExecutionConfig, AgentGraphState, BaseAgentLike, GraphEdge } from "../types.js";
|
|
2
|
+
import type { BaseWorkflow, WorkflowGenerateResult } from "./BaseWorkflow.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Loop continuation predicate. Return true to run another iteration.
|
|
6
|
+
*
|
|
7
|
+
* @param state - Current workflow graph state.
|
|
8
|
+
* @param config - Optional execution configuration.
|
|
9
|
+
* @since 5.1
|
|
10
|
+
*/
|
|
11
|
+
export type LoopDecider<TState extends AgentData = AgentData> = (state: AgentGraphState<TState>, config?: AgentExecutionConfig) => Promise<boolean> | boolean;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* LoopWorkflow repeatedly executes an inner workflow until a stop condition is met.
|
|
15
|
+
*
|
|
16
|
+
* Use in the following scenarios:
|
|
17
|
+
*
|
|
18
|
+
* - You need retry/refine loops,
|
|
19
|
+
* - You want iterative planning and execution.
|
|
20
|
+
*
|
|
21
|
+
* How it works:
|
|
22
|
+
* - Runs the inner `workflow`,
|
|
23
|
+
* - Evaluates `decideContinue(state, config)`,
|
|
24
|
+
* - If true, runs again; if false (or unset), stops.
|
|
25
|
+
*
|
|
26
|
+
* @since 5.1
|
|
27
|
+
*/
|
|
28
|
+
export class LoopWorkflow<TState extends AgentData = AgentData> extends BaseWorkflow<TState> {
|
|
29
|
+
constructor(properties: LoopWorkflowConstructProperties<TState>);
|
|
30
|
+
/**
|
|
31
|
+
* Function that decides whether the loop should continue.
|
|
32
|
+
*
|
|
33
|
+
* @required
|
|
34
|
+
*/
|
|
35
|
+
accessor decideContinue: LoopDecider<TState>;
|
|
36
|
+
/**
|
|
37
|
+
* Inner workflow to execute on each loop iteration.
|
|
38
|
+
*
|
|
39
|
+
* @required
|
|
40
|
+
*/
|
|
41
|
+
accessor workflow: BaseWorkflow<TState>;
|
|
42
|
+
/** Builds the workflow-specific edges. */
|
|
43
|
+
protected buildEdges(): GraphEdge<AgentGraphState<TState>>[];
|
|
44
|
+
/**
|
|
45
|
+
* Generates the workflow's graph and shared workspace based on the defined agents and their schemas. This method is
|
|
46
|
+
* called by the WorkflowAgent when it generates its graph, and it orchestrates the creation of the workflow's structure,
|
|
47
|
+
* including validating the agents, deriving shared state from their schemas, and building the nodes and edges of the graph.
|
|
48
|
+
*/
|
|
49
|
+
generate(): WorkflowGenerateResult<TState>;
|
|
50
|
+
/** A list of agents that are part of this workflow. */
|
|
51
|
+
getAgents(): BaseAgentLike<TState>[];
|
|
52
|
+
/** Returns the id of the first node in the workflow graph. */
|
|
53
|
+
protected getEntryNode(): string;
|
|
54
|
+
/** Returns whether the agent at this position should expose terminal runtime fields. */
|
|
55
|
+
protected isTerminalAgent(): boolean;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export type LoopWorkflowConstructProperties<TState extends AgentData> = Pick<LoopWorkflow<TState>, "decideContinue" | "workflow">;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import { property as u, subclass as w } from "@arcgis/core/core/accessorSupport/decorators.js";
|
|
3
|
+
import { c as f } from "../../chunks/graph.js";
|
|
4
|
+
import { B as h } from "../../chunks/BaseWorkflow.js";
|
|
5
|
+
var g = Object.defineProperty, m = Object.getOwnPropertyDescriptor, d = (o, r, n, t) => {
|
|
6
|
+
for (var e = t > 1 ? void 0 : t ? m(r, n) : r, s = o.length - 1, c; s >= 0; s--)
|
|
7
|
+
(c = o[s]) && (e = (t ? c(r, n, e) : c(e)) || e);
|
|
8
|
+
return t && e && g(r, n, e), e;
|
|
9
|
+
};
|
|
10
|
+
let p = class extends h {
|
|
11
|
+
//#region Lifecycle
|
|
12
|
+
constructor(o) {
|
|
13
|
+
super(o);
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region Public Methods
|
|
17
|
+
getAgents() {
|
|
18
|
+
return this.workflow.getAgents();
|
|
19
|
+
}
|
|
20
|
+
generate() {
|
|
21
|
+
const o = this.workflow.generate(), r = o.workspace, n = o.createGraph().compile(), { decideContinue: t } = this, e = {
|
|
22
|
+
[a]: async (i, l) => await n.invoke(i, l)
|
|
23
|
+
}, s = [
|
|
24
|
+
{
|
|
25
|
+
from: a,
|
|
26
|
+
decide: async (i, l) => await Promise.resolve(t(i, l)) ? a : void 0
|
|
27
|
+
}
|
|
28
|
+
];
|
|
29
|
+
return { workspace: r, createGraph: () => f(e, s, r, { entryNode: a }) };
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region Protected Methods
|
|
33
|
+
buildEdges() {
|
|
34
|
+
throw new Error("LoopWorkflow overrides generate(); buildEdges should not be called.");
|
|
35
|
+
}
|
|
36
|
+
getEntryNode() {
|
|
37
|
+
return a;
|
|
38
|
+
}
|
|
39
|
+
isTerminalAgent() {
|
|
40
|
+
return !0;
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
};
|
|
44
|
+
d([
|
|
45
|
+
u()
|
|
46
|
+
], p.prototype, "workflow", 2);
|
|
47
|
+
d([
|
|
48
|
+
u()
|
|
49
|
+
], p.prototype, "decideContinue", 2);
|
|
50
|
+
p = d([
|
|
51
|
+
w("LoopWorkflow")
|
|
52
|
+
], p);
|
|
53
|
+
const a = "__loop_body";
|
|
54
|
+
export {
|
|
55
|
+
p as LoopWorkflow
|
|
56
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { AgentData, AgentGraphState, BaseAgentLike, GraphEdge, GraphNodes } from "../types.js";
|
|
2
|
+
import type { BaseWorkflow, WorkflowGenerateResult } from "./BaseWorkflow.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* ParallelWorkflow fans out execution to multiple agents and merges branch outputs.
|
|
6
|
+
*
|
|
7
|
+
* Use in the following scenarios:
|
|
8
|
+
* - Branches can run independently from the same input,
|
|
9
|
+
* - You want fan-out/fan-in behavior.
|
|
10
|
+
*
|
|
11
|
+
* How it works:
|
|
12
|
+
* - Fan out - every agent receives the same input snapshot,
|
|
13
|
+
* - Each branch collects its result in a hidden state key,
|
|
14
|
+
* - Fan in - merge outputs in declared agent order.
|
|
15
|
+
*
|
|
16
|
+
* Merge rule:
|
|
17
|
+
* - If two branches set the same shared key to different values, an error is thrown,
|
|
18
|
+
* as this indicates a conflict the workflow cannot resolve on its own.
|
|
19
|
+
*
|
|
20
|
+
* @since 5.1
|
|
21
|
+
*/
|
|
22
|
+
export class ParallelWorkflow<TState extends AgentData = AgentData> extends BaseWorkflow<TState> {
|
|
23
|
+
constructor(properties: ParallelWorkflowConstructProperties<TState>);
|
|
24
|
+
/**
|
|
25
|
+
* Agents to run in parallel from the same input snapshot.
|
|
26
|
+
*
|
|
27
|
+
* @required
|
|
28
|
+
*/
|
|
29
|
+
accessor agents: BaseAgentLike<TState>[];
|
|
30
|
+
/**
|
|
31
|
+
* Builds the workflow-specific edges.
|
|
32
|
+
*
|
|
33
|
+
* @param agents
|
|
34
|
+
*/
|
|
35
|
+
protected buildEdges(agents: BaseAgentLike<TState>[]): GraphEdge<AgentGraphState<TState>>[];
|
|
36
|
+
/**
|
|
37
|
+
* Builds the workflow's graph nodes.
|
|
38
|
+
*
|
|
39
|
+
* Node ids use the agent id plus its position (`agent.id_index`) instead of only the raw
|
|
40
|
+
* agent id. That prevents collisions when the same agent instance is used multiple times.
|
|
41
|
+
*
|
|
42
|
+
* @param agents
|
|
43
|
+
*/
|
|
44
|
+
protected buildNodes(agents: BaseAgentLike<TState>[]): GraphNodes<AgentGraphState<TState>>;
|
|
45
|
+
/**
|
|
46
|
+
* Generates the workflow's graph and shared workspace based on the defined agents and their schemas. This method is
|
|
47
|
+
* called by the WorkflowAgent when it generates its graph, and it orchestrates the creation of the workflow's structure,
|
|
48
|
+
* including validating the agents, deriving shared state from their schemas, and building the nodes and edges of the graph.
|
|
49
|
+
*/
|
|
50
|
+
generate(): WorkflowGenerateResult<TState>;
|
|
51
|
+
/** A list of agents that are part of this workflow. */
|
|
52
|
+
getAgents(): BaseAgentLike<TState>[];
|
|
53
|
+
/**
|
|
54
|
+
* Returns the id of the first node in the workflow graph.
|
|
55
|
+
*
|
|
56
|
+
* @param _agents
|
|
57
|
+
*/
|
|
58
|
+
protected getEntryNode(_agents: BaseAgentLike<TState>[]): string;
|
|
59
|
+
/**
|
|
60
|
+
* Returns whether the agent at this position should expose terminal runtime fields.
|
|
61
|
+
*
|
|
62
|
+
* @param _agents
|
|
63
|
+
* @param _index
|
|
64
|
+
*/
|
|
65
|
+
protected isTerminalAgent(_agents: BaseAgentLike<TState>[], _index: number): boolean;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export type ParallelWorkflowConstructProperties<TState extends AgentData> = Pick<ParallelWorkflow<TState>, "agents">;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import { property as A, subclass as I } from "@arcgis/core/core/accessorSupport/decorators.js";
|
|
3
|
+
import { c as U } from "../../chunks/graph.js";
|
|
4
|
+
import { a as W } from "../../chunks/state.js";
|
|
5
|
+
import { B as G, c as J, g as m, a as j } from "../../chunks/BaseWorkflow.js";
|
|
6
|
+
var k = Object.defineProperty, B = Object.getOwnPropertyDescriptor, C = (e, t, s, n) => {
|
|
7
|
+
for (var a = n > 1 ? void 0 : n ? B(t, s) : t, o = e.length - 1, r; o >= 0; o--)
|
|
8
|
+
(r = e[o]) && (a = (n ? r(t, s, a) : r(a)) || a);
|
|
9
|
+
return n && a && k(t, s, a), a;
|
|
10
|
+
};
|
|
11
|
+
let y = class extends G {
|
|
12
|
+
//#region Lifecycle
|
|
13
|
+
constructor(e) {
|
|
14
|
+
super(e);
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region Public Methods
|
|
18
|
+
getAgents() {
|
|
19
|
+
return this.agents;
|
|
20
|
+
}
|
|
21
|
+
generate() {
|
|
22
|
+
const e = this.getAgents();
|
|
23
|
+
this.validateAgents(e);
|
|
24
|
+
for (const r of e)
|
|
25
|
+
r.generate();
|
|
26
|
+
const t = J(e.flatMap((r) => r.getSchemas()));
|
|
27
|
+
for (const [r] of e.entries())
|
|
28
|
+
t[_(r)] = void 0;
|
|
29
|
+
const s = W(t), n = this.buildNodes(e), a = this.buildEdges(e);
|
|
30
|
+
return { workspace: s, createGraph: () => U(n, a, s, { entryNode: this.getEntryNode(e) }) };
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region Protected Methods
|
|
34
|
+
getEntryNode(e) {
|
|
35
|
+
return h;
|
|
36
|
+
}
|
|
37
|
+
isTerminalAgent(e, t) {
|
|
38
|
+
return !1;
|
|
39
|
+
}
|
|
40
|
+
buildNodes(e) {
|
|
41
|
+
const t = {};
|
|
42
|
+
for (const [s, n] of e.entries()) {
|
|
43
|
+
const a = _(s), o = m(n, s);
|
|
44
|
+
t[o] = async (r, i) => {
|
|
45
|
+
const d = await n.run(K(r, n), i), u = {}, f = u;
|
|
46
|
+
return f[a] = d, u;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
return t[h] = () => ({}), t[w] = (s) => $(s, e), t;
|
|
50
|
+
}
|
|
51
|
+
buildEdges(e) {
|
|
52
|
+
return [
|
|
53
|
+
...e.map((t, s) => ({ from: h, to: m(t, s) })),
|
|
54
|
+
...e.map((t, s) => ({ from: m(t, s), to: w }))
|
|
55
|
+
];
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
};
|
|
59
|
+
C([
|
|
60
|
+
A()
|
|
61
|
+
], y.prototype, "agents", 2);
|
|
62
|
+
y = C([
|
|
63
|
+
I("ParallelWorkflow")
|
|
64
|
+
], y);
|
|
65
|
+
const h = "__parallel_fanOut", w = "__parallel_join";
|
|
66
|
+
function _(e) {
|
|
67
|
+
return `__parallel_update_${e}`;
|
|
68
|
+
}
|
|
69
|
+
function F(e, t) {
|
|
70
|
+
return Object.fromEntries(
|
|
71
|
+
t.filter((s) => Object.hasOwn(e, s)).map((s) => [s, e[s]])
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
function K(e, t) {
|
|
75
|
+
const s = t.inputSchema;
|
|
76
|
+
return s ? {
|
|
77
|
+
...F(e, j(s)),
|
|
78
|
+
agentExecutionContext: e.agentExecutionContext,
|
|
79
|
+
outputMessage: e.outputMessage,
|
|
80
|
+
status: void 0,
|
|
81
|
+
summary: ""
|
|
82
|
+
} : { ...e, status: void 0, summary: "" };
|
|
83
|
+
}
|
|
84
|
+
function D(e, t) {
|
|
85
|
+
return e.outputSchema ? F(t, j(e.outputSchema)) : {};
|
|
86
|
+
}
|
|
87
|
+
function R(e, t) {
|
|
88
|
+
const s = e.agentExecutionContext?.messages ?? [], n = t.agentExecutionContext?.messages ?? [];
|
|
89
|
+
return n.length > s.length ? n.slice(s.length) : void 0;
|
|
90
|
+
}
|
|
91
|
+
function $(e, t) {
|
|
92
|
+
const s = [], n = [], a = [], o = {}, r = {}, i = /* @__PURE__ */ new Set();
|
|
93
|
+
for (const [f, P] of t.entries()) {
|
|
94
|
+
const x = _(f), g = e[x];
|
|
95
|
+
if (r[x] = void 0, !g || typeof g != "object")
|
|
96
|
+
continue;
|
|
97
|
+
const c = g, S = c.outputMessage, b = R(e, c), v = c.summary, M = D(P, c), O = S.trim();
|
|
98
|
+
typeof S == "string" && O && s.push(O);
|
|
99
|
+
const E = v.trim();
|
|
100
|
+
typeof v == "string" && E && n.push(E), Array.isArray(b) && a.push(...b), c.status && i.add(c.status);
|
|
101
|
+
for (const [l, p] of Object.entries(M))
|
|
102
|
+
if (!(p === void 0 || l.startsWith("__parallel_update_")) && !N(e[l], p)) {
|
|
103
|
+
if (!Object.hasOwn(o, l)) {
|
|
104
|
+
o[l] = p;
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
if (!N(o[l], p))
|
|
108
|
+
throw new Error(`ParallelWorkflow detected conflicting updates for state key "${l}".`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
const d = {
|
|
112
|
+
...r,
|
|
113
|
+
...o
|
|
114
|
+
}, u = d;
|
|
115
|
+
return a.length > 0 && (u.agentExecutionContext = {
|
|
116
|
+
...e.agentExecutionContext,
|
|
117
|
+
messages: [...e.agentExecutionContext.messages, ...a]
|
|
118
|
+
}), s.length && (u.outputMessage = s.join(`
|
|
119
|
+
|
|
120
|
+
`)), n.length && (u.summary = n.join(`
|
|
121
|
+
|
|
122
|
+
`)), i.size && (u.status = i.has("failed") ? "failed" : i.has("success") ? "success" : void 0), d;
|
|
123
|
+
}
|
|
124
|
+
function N(e, t) {
|
|
125
|
+
return e === t ? !0 : e && t ? JSON.stringify(e) === JSON.stringify(t) : !1;
|
|
126
|
+
}
|
|
127
|
+
export {
|
|
128
|
+
y as ParallelWorkflow
|
|
129
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { AgentData, AgentGraphState, BaseAgentLike, GraphEdge } from "../types.js";
|
|
2
|
+
import type { BaseWorkflow } from "./BaseWorkflow.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* RouterWorkflow runs a router agent, then dispatches to exactly one downstream agent.
|
|
6
|
+
*
|
|
7
|
+
* Use in the following scenarios:
|
|
8
|
+
* - A model (or routing step) should choose the destination,
|
|
9
|
+
* - Only one branch should run per request
|
|
10
|
+
*
|
|
11
|
+
* How it works:
|
|
12
|
+
* - `routerAgent` always runs first,
|
|
13
|
+
* - `routerAgent` reads the selected route key from `routerOutputKey`,
|
|
14
|
+
* - The agent corresponding to the selected route key is dispatched from `agentsMap`.
|
|
15
|
+
*
|
|
16
|
+
* @since 5.1
|
|
17
|
+
*/
|
|
18
|
+
export class RouterWorkflow<TState extends AgentData = AgentData> extends BaseWorkflow<TState> {
|
|
19
|
+
constructor(properties: RouterWorkflowConstructProperties<TState>);
|
|
20
|
+
/**
|
|
21
|
+
* Mapping of route keys to destination agents.
|
|
22
|
+
*
|
|
23
|
+
* @required
|
|
24
|
+
*/
|
|
25
|
+
accessor agentsMap: Record<string, BaseAgentLike<TState>>;
|
|
26
|
+
/**
|
|
27
|
+
* The agent that decides which route key to select.
|
|
28
|
+
*
|
|
29
|
+
* @required
|
|
30
|
+
*/
|
|
31
|
+
accessor routerAgent: BaseAgentLike<TState>;
|
|
32
|
+
/**
|
|
33
|
+
* State key containing the selected route returned by the router agent.
|
|
34
|
+
*
|
|
35
|
+
* @required
|
|
36
|
+
*/
|
|
37
|
+
accessor routerOutputKey: keyof AgentGraphState<TState>;
|
|
38
|
+
/**
|
|
39
|
+
* Builds the workflow-specific edges.
|
|
40
|
+
*
|
|
41
|
+
* @param agents
|
|
42
|
+
*/
|
|
43
|
+
protected buildEdges(agents: BaseAgentLike<TState>[]): GraphEdge<AgentGraphState<TState>>[];
|
|
44
|
+
/** A list of agents that are part of this workflow. */
|
|
45
|
+
getAgents(): BaseAgentLike<TState>[];
|
|
46
|
+
/** Returns the id of the first node in the workflow graph. */
|
|
47
|
+
protected getEntryNode(): string;
|
|
48
|
+
/**
|
|
49
|
+
* Returns whether the agent at this position should expose terminal runtime fields.
|
|
50
|
+
*
|
|
51
|
+
* @param _agents
|
|
52
|
+
* @param index
|
|
53
|
+
*/
|
|
54
|
+
protected isTerminalAgent(_agents: BaseAgentLike<TState>[], index: number): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Validates the workflow configuration and throws if invalid.
|
|
57
|
+
*
|
|
58
|
+
* @param agents
|
|
59
|
+
*/
|
|
60
|
+
protected validateAgents(agents: BaseAgentLike<TState>[]): void;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export type RouterWorkflowConstructProperties<TState extends AgentData> = Pick<RouterWorkflow<TState>, "agentsMap" | "routerAgent" | "routerOutputKey">;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import { property as h, subclass as g } from "@arcgis/core/core/accessorSupport/decorators.js";
|
|
3
|
+
import { B as v, g as l } from "../../chunks/BaseWorkflow.js";
|
|
4
|
+
var w = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, f = (e) => {
|
|
5
|
+
throw TypeError(e);
|
|
6
|
+
}, c = (e, t, o, s) => {
|
|
7
|
+
for (var r = s > 1 ? void 0 : s ? _(t, o) : t, n = e.length - 1, d; n >= 0; n--)
|
|
8
|
+
(d = e[n]) && (r = (s ? d(t, o, r) : d(r)) || r);
|
|
9
|
+
return s && r && w(t, o, r), r;
|
|
10
|
+
}, y = (e, t, o) => t.has(e) || f("Cannot " + o), A = (e, t, o) => t.has(e) ? f("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, o), p = (e, t, o) => (y(e, t, "access private method"), o), a, i;
|
|
11
|
+
let u = class extends v {
|
|
12
|
+
//#region Lifecycle
|
|
13
|
+
constructor(e) {
|
|
14
|
+
super(e), A(this, a);
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region Public Methods
|
|
18
|
+
getAgents() {
|
|
19
|
+
return p(this, a, i).call(this), [this.routerAgent, ...Object.values(this.agentsMap)];
|
|
20
|
+
}
|
|
21
|
+
buildEdges(e) {
|
|
22
|
+
p(this, a, i).call(this);
|
|
23
|
+
const t = l(this.routerAgent, 0), o = /* @__PURE__ */ new Map();
|
|
24
|
+
for (const [s, [r]] of Object.entries(this.agentsMap).entries())
|
|
25
|
+
o.set(r, l(e[s + 1], s + 1));
|
|
26
|
+
return [
|
|
27
|
+
{
|
|
28
|
+
from: t,
|
|
29
|
+
decide: (s) => {
|
|
30
|
+
const r = s[this.routerOutputKey];
|
|
31
|
+
if (typeof r != "string" || !r)
|
|
32
|
+
throw new Error("RouterWorkflow decideRoute could not determine next agent from state.");
|
|
33
|
+
const n = o.get(r);
|
|
34
|
+
if (!n)
|
|
35
|
+
throw new Error(
|
|
36
|
+
`RouterWorkflow decideRoute returned unknown agent: ${r}. Expected one of: ${Object.keys(this.agentsMap).join(", ") || "(none)"}.`
|
|
37
|
+
);
|
|
38
|
+
return n;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
];
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region Protected Methods
|
|
45
|
+
getEntryNode() {
|
|
46
|
+
return p(this, a, i).call(this), l(this.routerAgent, 0);
|
|
47
|
+
}
|
|
48
|
+
isTerminalAgent(e, t) {
|
|
49
|
+
return t > 0;
|
|
50
|
+
}
|
|
51
|
+
validateAgents(e) {
|
|
52
|
+
p(this, a, i).call(this), super.validateAgents(e);
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
};
|
|
56
|
+
a = /* @__PURE__ */ new WeakSet();
|
|
57
|
+
i = function() {
|
|
58
|
+
if (!Object.keys(this.agentsMap).length)
|
|
59
|
+
throw new Error("RouterWorkflow requires a non-empty agentsMap.");
|
|
60
|
+
};
|
|
61
|
+
c([
|
|
62
|
+
h()
|
|
63
|
+
], u.prototype, "agentsMap", 2);
|
|
64
|
+
c([
|
|
65
|
+
h()
|
|
66
|
+
], u.prototype, "routerAgent", 2);
|
|
67
|
+
c([
|
|
68
|
+
h()
|
|
69
|
+
], u.prototype, "routerOutputKey", 2);
|
|
70
|
+
u = c([
|
|
71
|
+
g("RouterWorkflow")
|
|
72
|
+
], u);
|
|
73
|
+
export {
|
|
74
|
+
u as RouterWorkflow
|
|
75
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { BaseWorkflow } from "./BaseWorkflow.js";
|
|
2
|
+
import type { AgentData, AgentGraphState, BaseAgentLike, GraphEdge } from "../types.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* SequentialWorkflow executes agents in strict linear order.
|
|
6
|
+
*
|
|
7
|
+
* Use in the following scenarios:
|
|
8
|
+
* - Later steps depend on values produced by earlier steps,
|
|
9
|
+
* - You want a simple linear pipeline.
|
|
10
|
+
*
|
|
11
|
+
* How it works:
|
|
12
|
+
* - First agent runs and passes shared state forward,
|
|
13
|
+
* - Each subsequent agent receives the updated shared state from the previous agent,
|
|
14
|
+
* - Run agent 2, then agent 3, and so on,
|
|
15
|
+
* - Stop after the final agent in the sequence runs.
|
|
16
|
+
*
|
|
17
|
+
* @since 5.1
|
|
18
|
+
*/
|
|
19
|
+
export class SequentialWorkflow<TState extends AgentData = AgentData> extends BaseWorkflow<TState> {
|
|
20
|
+
constructor(properties: SequentialWorkflowConstructProperties<TState>);
|
|
21
|
+
/**
|
|
22
|
+
* A list of agents to execute in the specified order.
|
|
23
|
+
*
|
|
24
|
+
* @required
|
|
25
|
+
*/
|
|
26
|
+
accessor agents: BaseAgentLike<TState>[];
|
|
27
|
+
/**
|
|
28
|
+
* Builds the workflow-specific edges.
|
|
29
|
+
*
|
|
30
|
+
* @param agents
|
|
31
|
+
*/
|
|
32
|
+
protected buildEdges(agents: BaseAgentLike<TState>[]): GraphEdge<AgentGraphState<TState>>[];
|
|
33
|
+
/** A list of agents that are part of this workflow. */
|
|
34
|
+
getAgents(): BaseAgentLike<TState>[];
|
|
35
|
+
/**
|
|
36
|
+
* Returns the id of the first node in the workflow graph.
|
|
37
|
+
*
|
|
38
|
+
* @param agents
|
|
39
|
+
*/
|
|
40
|
+
protected getEntryNode(agents: BaseAgentLike<TState>[]): string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Returns whether the agent at this position should expose terminal runtime fields.
|
|
43
|
+
*
|
|
44
|
+
* @param agents
|
|
45
|
+
* @param index
|
|
46
|
+
*/
|
|
47
|
+
protected isTerminalAgent(agents: BaseAgentLike<TState>[], index: number): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Validates the workflow configuration and throws if invalid.
|
|
50
|
+
*
|
|
51
|
+
* @param agents
|
|
52
|
+
*/
|
|
53
|
+
protected validateAgents(agents: BaseAgentLike<TState>[]): void;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export type SequentialWorkflowConstructProperties<TState extends AgentData> = Pick<SequentialWorkflow<TState>, "agents">;
|