@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,177 @@
|
|
|
1
|
+
import type { FunctionAgent, FunctionAgentConstructProperties } from "./FunctionAgent.js";
|
|
2
|
+
import type { LLMAgent, LLMAgentConstructProperties } from "./LLMAgent.js";
|
|
3
|
+
import type { WorkflowAgent, WorkflowAgentConstructProperties } from "./WorkflowAgent.js";
|
|
4
|
+
import type { AgentData, SchemaDefinition, SchemaDefinitionData, ZodObjectSchema } from "./types.js";
|
|
5
|
+
import type { FunctionTool, FunctionToolConstructProperties } from "./tools/FunctionTool.js";
|
|
6
|
+
import type { ConditionalWorkflow, ConditionalWorkflowConstructProperties } from "./workflows/ConditionalWorkflow.js";
|
|
7
|
+
import type { LoopWorkflow, LoopWorkflowConstructProperties } from "./workflows/LoopWorkflow.js";
|
|
8
|
+
import type { ParallelWorkflow, ParallelWorkflowConstructProperties } from "./workflows/ParallelWorkflow.js";
|
|
9
|
+
import type { RouterWorkflow, RouterWorkflowConstructProperties } from "./workflows/RouterWorkflow.js";
|
|
10
|
+
import type { SequentialWorkflow, SequentialWorkflowConstructProperties } from "./workflows/SequentialWorkflow.js";
|
|
11
|
+
import type { SwitchWorkflow, SwitchWorkflowConstructProperties } from "./workflows/SwitchWorkflow.js";
|
|
12
|
+
import type { RunnableConfig } from "@langchain/core/runnables";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Creates a Zod schema from a plain object schema definition.
|
|
16
|
+
*
|
|
17
|
+
* Supports all schema field variants:
|
|
18
|
+
* - `string` (with optional `enum`)
|
|
19
|
+
* - `number`
|
|
20
|
+
* - `boolean`
|
|
21
|
+
* - `array` with primitive or nested item definitions
|
|
22
|
+
* - `object` with nested `fields`
|
|
23
|
+
*
|
|
24
|
+
* @param definition
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const primitiveSchema = await createSchema({
|
|
28
|
+
* name: { type: "string", description: "Search location name", required: true },
|
|
29
|
+
* radius: { type: "number", description: "Search radius in miles" },
|
|
30
|
+
* active: { type: "boolean", description: "Whether the search is enabled" },
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const nestedObjectSchema = await createSchema({
|
|
36
|
+
* query: { type: "string", description: "User search text", required: true },
|
|
37
|
+
* options: {
|
|
38
|
+
* type: "object",
|
|
39
|
+
* description: "Search options",
|
|
40
|
+
* required: true,
|
|
41
|
+
* fields: {
|
|
42
|
+
* center: {
|
|
43
|
+
* type: "object",
|
|
44
|
+
* description: "Map center point",
|
|
45
|
+
* fields: {
|
|
46
|
+
* latitude: { type: "number", description: "Center latitude", required: true },
|
|
47
|
+
* longitude: { type: "number", description: "Center longitude", required: true },
|
|
48
|
+
* },
|
|
49
|
+
* },
|
|
50
|
+
* categories: { type: "array", description: "Selected categories", itemType: "string" },
|
|
51
|
+
* },
|
|
52
|
+
* },
|
|
53
|
+
* });
|
|
54
|
+
* ```
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* const arrayOfObjectsSchema = await createSchema({
|
|
58
|
+
* constraints: {
|
|
59
|
+
* type: "array",
|
|
60
|
+
* description: "Constraint rules",
|
|
61
|
+
* itemType: {
|
|
62
|
+
* type: "object",
|
|
63
|
+
* description: "Single constraint rule",
|
|
64
|
+
* fields: {
|
|
65
|
+
* key: { type: "string", description: "Constraint key", required: true },
|
|
66
|
+
* enabled: { type: "boolean", description: "Whether this rule is active" },
|
|
67
|
+
* values: { type: "array", description: "Rule values", itemType: "string" },
|
|
68
|
+
* },
|
|
69
|
+
* },
|
|
70
|
+
* },
|
|
71
|
+
* });
|
|
72
|
+
* ```
|
|
73
|
+
* @since 5.1
|
|
74
|
+
*/
|
|
75
|
+
export function createSchema<const TDefinition extends SchemaDefinition>(definition: TDefinition): Promise<ZodObjectSchema<SchemaDefinitionData<TDefinition>>>;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* The suggestions emitted by the agent to the user interface.
|
|
79
|
+
*
|
|
80
|
+
* @since 5.1
|
|
81
|
+
*/
|
|
82
|
+
export type UXSuggestion = {
|
|
83
|
+
/** The type of suggestion being made. */
|
|
84
|
+
type: string;
|
|
85
|
+
/** Optional additional data associated with the suggestion. */
|
|
86
|
+
data?: Record<string, unknown>;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Sends an optional UX suggestion from an agent run to the host application.
|
|
91
|
+
* Use this for non-blocking hints (for example, recommended next actions or UI prompts) that the app may choose to display.
|
|
92
|
+
*
|
|
93
|
+
* @param suggestion
|
|
94
|
+
* @param config
|
|
95
|
+
* @since 5.1
|
|
96
|
+
*/
|
|
97
|
+
export function sendUXSuggestion(suggestion: UXSuggestion, config?: RunnableConfig): Promise<void>;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Creates a FunctionAgent instance from the existing agent implementation.
|
|
101
|
+
*
|
|
102
|
+
* @param properties
|
|
103
|
+
* @since 5.1
|
|
104
|
+
*/
|
|
105
|
+
export function createFunctionAgent<TInput extends AgentData = AgentData, TOutput extends AgentData = AgentData>(properties: FunctionAgentConstructProperties<TInput, TOutput>): Promise<FunctionAgent<TInput, TOutput>>;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Creates a FunctionTool instance from the existing tool implementation.
|
|
109
|
+
*
|
|
110
|
+
* @param properties
|
|
111
|
+
* @since 5.1
|
|
112
|
+
*/
|
|
113
|
+
export function createFunctionTool<TInput extends AgentData, TOutput = unknown>(properties: FunctionToolConstructProperties<TInput, TOutput>): Promise<FunctionTool<TInput, TOutput>>;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Creates an LLMAgent instance from the existing agent implementation.
|
|
117
|
+
*
|
|
118
|
+
* @param properties
|
|
119
|
+
* @since 5.1
|
|
120
|
+
*/
|
|
121
|
+
export function createLLMAgent<TInput extends AgentData = AgentData, TOutput extends AgentData = AgentData>(properties: LLMAgentConstructProperties<TInput, TOutput>): Promise<LLMAgent<TInput, TOutput>>;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Creates a WorkflowAgent instance from the existing workflow agent implementation.
|
|
125
|
+
*
|
|
126
|
+
* @param properties
|
|
127
|
+
* @since 5.1
|
|
128
|
+
*/
|
|
129
|
+
export function createWorkflowAgent<TState extends AgentData = AgentData>(properties: WorkflowAgentConstructProperties<TState>): Promise<WorkflowAgent<TState>>;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Creates a ConditionalWorkflow instance from the existing workflow implementation.
|
|
133
|
+
*
|
|
134
|
+
* @param properties
|
|
135
|
+
* @since 5.1
|
|
136
|
+
*/
|
|
137
|
+
export function createConditionalWorkflow<TState extends AgentData = AgentData>(properties: ConditionalWorkflowConstructProperties<TState>): Promise<ConditionalWorkflow<TState>>;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Creates a LoopWorkflow instance from the existing workflow implementation.
|
|
141
|
+
*
|
|
142
|
+
* @param properties
|
|
143
|
+
* @since 5.1
|
|
144
|
+
*/
|
|
145
|
+
export function createLoopWorkflow<TState extends AgentData = AgentData>(properties: LoopWorkflowConstructProperties<TState>): Promise<LoopWorkflow<TState>>;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Creates a ParallelWorkflow instance from the existing workflow implementation.
|
|
149
|
+
*
|
|
150
|
+
* @param properties
|
|
151
|
+
* @since 5.1
|
|
152
|
+
*/
|
|
153
|
+
export function createParallelWorkflow<TState extends AgentData = AgentData>(properties: ParallelWorkflowConstructProperties<TState>): Promise<ParallelWorkflow<TState>>;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Creates a RouterWorkflow instance from the existing workflow implementation.
|
|
157
|
+
*
|
|
158
|
+
* @param properties
|
|
159
|
+
* @since 5.1
|
|
160
|
+
*/
|
|
161
|
+
export function createRouterWorkflow<TState extends AgentData = AgentData>(properties: RouterWorkflowConstructProperties<TState>): Promise<RouterWorkflow<TState>>;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Creates a SequentialWorkflow instance from the existing workflow implementation.
|
|
165
|
+
*
|
|
166
|
+
* @param properties
|
|
167
|
+
* @since 5.1
|
|
168
|
+
*/
|
|
169
|
+
export function createSequentialWorkflow<TState extends AgentData = AgentData>(properties: SequentialWorkflowConstructProperties<TState>): Promise<SequentialWorkflow<TState>>;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Creates a SwitchWorkflow instance from the existing workflow implementation.
|
|
173
|
+
*
|
|
174
|
+
* @param properties
|
|
175
|
+
* @since 5.1
|
|
176
|
+
*/
|
|
177
|
+
export function createSwitchWorkflow<TState extends AgentData = AgentData>(properties: SwitchWorkflowConstructProperties<TState>): Promise<SwitchWorkflow<TState>>;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
let i, a, c, u, l, s, w, m, f, p, d, g;
|
|
3
|
+
async function n(e, t) {
|
|
4
|
+
if (t in e)
|
|
5
|
+
return e[t];
|
|
6
|
+
if ("default" in e) {
|
|
7
|
+
const o = await e.default;
|
|
8
|
+
return typeof o == "object" && o !== null && t in o ? o[t] : o;
|
|
9
|
+
}
|
|
10
|
+
throw new Error(`Unable to resolve ${String(t)} from module.`);
|
|
11
|
+
}
|
|
12
|
+
function y(e, t) {
|
|
13
|
+
const o = {};
|
|
14
|
+
for (const [r, k] of Object.entries(t))
|
|
15
|
+
o[r] = S(e, k);
|
|
16
|
+
return o;
|
|
17
|
+
}
|
|
18
|
+
function W(e, t) {
|
|
19
|
+
return e.object(y(e, t));
|
|
20
|
+
}
|
|
21
|
+
function S(e, t) {
|
|
22
|
+
const o = h(e, t);
|
|
23
|
+
return t.required === !0 ? o : o.optional();
|
|
24
|
+
}
|
|
25
|
+
function h(e, t) {
|
|
26
|
+
let o = P(e, t);
|
|
27
|
+
return t.description !== void 0 && (o = o.describe(t.description)), o;
|
|
28
|
+
}
|
|
29
|
+
function b(e, t) {
|
|
30
|
+
switch (t) {
|
|
31
|
+
case "string":
|
|
32
|
+
return e.string();
|
|
33
|
+
case "number":
|
|
34
|
+
return e.number();
|
|
35
|
+
case "boolean":
|
|
36
|
+
return e.boolean();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function M(e) {
|
|
40
|
+
return e === "string" || e === "number" || e === "boolean";
|
|
41
|
+
}
|
|
42
|
+
function P(e, t) {
|
|
43
|
+
switch (t.type) {
|
|
44
|
+
case "string": {
|
|
45
|
+
if (t.enum != null) {
|
|
46
|
+
if (t.enum.length === 0)
|
|
47
|
+
throw new Error("String schema field enum must include at least one value.");
|
|
48
|
+
return e.enum(t.enum);
|
|
49
|
+
}
|
|
50
|
+
return e.string();
|
|
51
|
+
}
|
|
52
|
+
case "number":
|
|
53
|
+
return e.number();
|
|
54
|
+
case "boolean":
|
|
55
|
+
return e.boolean();
|
|
56
|
+
case "array": {
|
|
57
|
+
if (t.itemType == null)
|
|
58
|
+
throw new Error("Array schema field requires an itemType definition.");
|
|
59
|
+
return e.array(
|
|
60
|
+
M(t.itemType) ? b(e, t.itemType) : h(e, t.itemType)
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
case "object": {
|
|
64
|
+
if (t.fields == null)
|
|
65
|
+
throw new Error("Object schema field requires a fields definition.");
|
|
66
|
+
return W(e, t.fields);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
async function A(e) {
|
|
71
|
+
d ??= import("zod");
|
|
72
|
+
const t = await d;
|
|
73
|
+
return W(t.z, e);
|
|
74
|
+
}
|
|
75
|
+
async function T(e, t) {
|
|
76
|
+
g ??= import("../utils/index.js");
|
|
77
|
+
const o = await g;
|
|
78
|
+
return await (await n(
|
|
79
|
+
o,
|
|
80
|
+
"sendUXSuggestion"
|
|
81
|
+
))(e, t);
|
|
82
|
+
}
|
|
83
|
+
async function L(e) {
|
|
84
|
+
i ??= import("./FunctionAgent.js");
|
|
85
|
+
const t = await i, o = await n(
|
|
86
|
+
t,
|
|
87
|
+
"FunctionAgent"
|
|
88
|
+
);
|
|
89
|
+
return new o(e);
|
|
90
|
+
}
|
|
91
|
+
async function q(e) {
|
|
92
|
+
a ??= import("./tools/FunctionTool.js");
|
|
93
|
+
const t = await a, o = await n(
|
|
94
|
+
t,
|
|
95
|
+
"FunctionTool"
|
|
96
|
+
);
|
|
97
|
+
return new o(e);
|
|
98
|
+
}
|
|
99
|
+
async function F(e) {
|
|
100
|
+
c ??= import("./LLMAgent.js");
|
|
101
|
+
const t = await c, o = await n(t, "LLMAgent");
|
|
102
|
+
return new o(e);
|
|
103
|
+
}
|
|
104
|
+
async function j(e) {
|
|
105
|
+
u ??= import("./WorkflowAgent.js");
|
|
106
|
+
const t = await u, o = await n(
|
|
107
|
+
t,
|
|
108
|
+
"WorkflowAgent"
|
|
109
|
+
);
|
|
110
|
+
return new o(e);
|
|
111
|
+
}
|
|
112
|
+
async function E(e) {
|
|
113
|
+
l ??= import("./workflows/ConditionalWorkflow.js");
|
|
114
|
+
const t = await l, o = await n(t, "ConditionalWorkflow");
|
|
115
|
+
return new o(e);
|
|
116
|
+
}
|
|
117
|
+
async function v(e) {
|
|
118
|
+
s ??= import("./workflows/LoopWorkflow.js");
|
|
119
|
+
const t = await s, o = await n(
|
|
120
|
+
t,
|
|
121
|
+
"LoopWorkflow"
|
|
122
|
+
);
|
|
123
|
+
return new o(e);
|
|
124
|
+
}
|
|
125
|
+
async function U(e) {
|
|
126
|
+
w ??= import("./workflows/ParallelWorkflow.js");
|
|
127
|
+
const t = await w, o = await n(
|
|
128
|
+
t,
|
|
129
|
+
"ParallelWorkflow"
|
|
130
|
+
);
|
|
131
|
+
return new o(e);
|
|
132
|
+
}
|
|
133
|
+
async function R(e) {
|
|
134
|
+
m ??= import("./workflows/RouterWorkflow.js");
|
|
135
|
+
const t = await m, o = await n(
|
|
136
|
+
t,
|
|
137
|
+
"RouterWorkflow"
|
|
138
|
+
);
|
|
139
|
+
return new o(e);
|
|
140
|
+
}
|
|
141
|
+
async function X(e) {
|
|
142
|
+
f ??= import("./workflows/SequentialWorkflow.js");
|
|
143
|
+
const t = await f, o = await n(t, "SequentialWorkflow");
|
|
144
|
+
return new o(e);
|
|
145
|
+
}
|
|
146
|
+
async function x(e) {
|
|
147
|
+
p ??= import("./workflows/SwitchWorkflow.js");
|
|
148
|
+
const t = await p, o = await n(
|
|
149
|
+
t,
|
|
150
|
+
"SwitchWorkflow"
|
|
151
|
+
);
|
|
152
|
+
return new o(e);
|
|
153
|
+
}
|
|
154
|
+
export {
|
|
155
|
+
E as createConditionalWorkflow,
|
|
156
|
+
L as createFunctionAgent,
|
|
157
|
+
q as createFunctionTool,
|
|
158
|
+
F as createLLMAgent,
|
|
159
|
+
v as createLoopWorkflow,
|
|
160
|
+
U as createParallelWorkflow,
|
|
161
|
+
R as createRouterWorkflow,
|
|
162
|
+
A as createSchema,
|
|
163
|
+
X as createSequentialWorkflow,
|
|
164
|
+
x as createSwitchWorkflow,
|
|
165
|
+
j as createWorkflowAgent,
|
|
166
|
+
T as sendUXSuggestion
|
|
167
|
+
};
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import type { FunctionToolMiddleware, FunctionToolMiddlewareRequest } from "../tools/FunctionTool.js";
|
|
2
|
+
import type { AgentData, AgentExecutionConfig, AgentGraphState } from "../types.js";
|
|
3
|
+
import type { AgentMiddleware, AgentRunRequest } from "./types.js";
|
|
4
|
+
import type { UiInterrupt } from "../../utils/index.js";
|
|
5
|
+
|
|
6
|
+
/** @since 5.1 */
|
|
7
|
+
export interface HumanInTheLoopInterruptRequest<TCustomState extends AgentData = AgentData> extends AgentRunRequest<TCustomState> {
|
|
8
|
+
/**
|
|
9
|
+
* The ID of the agent requesting human intervention. This can be used to correlate the
|
|
10
|
+
* interrupt with a specific agent, especially in cases where
|
|
11
|
+
* multiple agents may be running concurrently and using the same middleware.
|
|
12
|
+
*
|
|
13
|
+
* @since 5.1
|
|
14
|
+
*/
|
|
15
|
+
agentId: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** @since 5.1 */
|
|
19
|
+
export type HumanInTheLoopInterrupt = Partial<UiInterrupt>;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Options for configuring the HumanInTheLoopMiddleware.
|
|
23
|
+
*
|
|
24
|
+
* @since 5.1
|
|
25
|
+
*/
|
|
26
|
+
export interface HumanInTheLoopMiddlewareOptions<TCustomState extends AgentData = AgentData> {
|
|
27
|
+
/**
|
|
28
|
+
* An optional function that generates a custom interrupt object based on the agent run request. This allows for dynamic messages and
|
|
29
|
+
* metadata to be included in the interrupt, providing context to the user when prompting for input or approval.
|
|
30
|
+
*
|
|
31
|
+
* If not provided, a default interrupt with a generic approval message will be used.
|
|
32
|
+
*
|
|
33
|
+
* @param request - The agent run request that triggered the interrupt, containing details about the agent, node, and execution context.
|
|
34
|
+
* @returns An object containing the interrupt details, which will be thrown as a NodeInterrupt to pause the agent's execution.
|
|
35
|
+
* @since 5.1
|
|
36
|
+
*/
|
|
37
|
+
interrupt?(request: HumanInTheLoopInterruptRequest<TCustomState>): HumanInTheLoopInterrupt | Promise<HumanInTheLoopInterrupt>;
|
|
38
|
+
/**
|
|
39
|
+
* An optional key in the agent state where the human response should be stored.
|
|
40
|
+
*
|
|
41
|
+
* @since 5.1
|
|
42
|
+
*/
|
|
43
|
+
outputKey?: keyof AgentGraphState<TCustomState>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** @since 5.1 */
|
|
47
|
+
export interface HumanInTheLoopToolMessageRequest<TInput extends AgentData = AgentData> extends FunctionToolMiddlewareRequest<TInput> {
|
|
48
|
+
/**
|
|
49
|
+
* The arguments passed to the tool that is requesting human intervention.
|
|
50
|
+
*
|
|
51
|
+
* @since 5.1
|
|
52
|
+
*/
|
|
53
|
+
args: object;
|
|
54
|
+
/**
|
|
55
|
+
* The id of the tool call that is requesting human intervention.
|
|
56
|
+
*
|
|
57
|
+
* @since 5.1
|
|
58
|
+
*/
|
|
59
|
+
toolCallId?: string;
|
|
60
|
+
/**
|
|
61
|
+
* The name of the tool that is requesting human intervention.
|
|
62
|
+
*
|
|
63
|
+
* @since 5.1
|
|
64
|
+
*/
|
|
65
|
+
toolName: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* This middleware is designed to allow for human intervention during agent execution by throwing an interrupt that can be handled by the orchestrator to pause the agent and
|
|
70
|
+
* prompt the user for input or approval.
|
|
71
|
+
*
|
|
72
|
+
* @since 5.1
|
|
73
|
+
*/
|
|
74
|
+
export interface HumanInTheLoopToolMiddlewareOptions<TInput extends AgentData = AgentData> {
|
|
75
|
+
/**
|
|
76
|
+
* An optional function that generates a custom interrupt object based on the tool middleware request. This allows for dynamic messages and
|
|
77
|
+
* metadata to be included in the interrupt, providing context to the user when prompting for input or approval at the tool execution level.
|
|
78
|
+
*
|
|
79
|
+
* @param request - The tool middleware request that triggered the interrupt, containing details about the tool, input arguments, and execution context.
|
|
80
|
+
* @since 5.1
|
|
81
|
+
* @return An object containing the interrupt details, which will be thrown as a NodeInterrupt to pause the tool's execution.
|
|
82
|
+
*/
|
|
83
|
+
interrupt?(request: HumanInTheLoopToolMessageRequest<TInput>): HumanInTheLoopInterrupt | Promise<HumanInTheLoopInterrupt>;
|
|
84
|
+
/**
|
|
85
|
+
* An optional key in the tool input where the human response should be stored.
|
|
86
|
+
*
|
|
87
|
+
* @since 5.1
|
|
88
|
+
*/
|
|
89
|
+
outputKey?: keyof TInput;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* This middleware allows for human intervention during agent execution by throwing an interrupt
|
|
94
|
+
* to pause the agent and prompt the user for input or approval prior to proceeding. It can be used
|
|
95
|
+
* to implement a human-in-the-loop workflow, where certain decisions or actions require human approval before proceeding.
|
|
96
|
+
*
|
|
97
|
+
* The interrupt includes customizable messages and metadata to provide context to the user.
|
|
98
|
+
*
|
|
99
|
+
* @param options - Configuration options for the middleware, including the interrupt handler and optional output key for storing the human response in
|
|
100
|
+
* the agent state.
|
|
101
|
+
* @returns An agent middleware that can be added to an agent's middleware stack.
|
|
102
|
+
* @since 5.1
|
|
103
|
+
* @example
|
|
104
|
+
* ```ts
|
|
105
|
+
* const agent = new WorkflowAgent({
|
|
106
|
+
* workflow: myWorkflow,
|
|
107
|
+
* middlewares: [
|
|
108
|
+
* createHumanInTheLoopMiddleware({
|
|
109
|
+
* interrupt: async ({ agentId }) => ({
|
|
110
|
+
* message: `Agent ${agentId} is requesting approval to continue. Do you approve?`,
|
|
111
|
+
* }),
|
|
112
|
+
* }),
|
|
113
|
+
* ],
|
|
114
|
+
* });
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
export function createHumanInTheLoopMiddleware<TCustomState extends AgentData = AgentData>(options?: HumanInTheLoopMiddlewareOptions<TCustomState>): AgentMiddleware<TCustomState>;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* This middleware is designed to wrap tool calls within an agent, allowing for human intervention at the tool execution level. When a tool wrapped with this middleware is invoked,
|
|
121
|
+
* it will throw an interrupt similar to the agent-level middleware, prompting the user for input or approval before the tool executes.
|
|
122
|
+
*
|
|
123
|
+
* @param options - Configuration options for the middleware, including the interrupt handler and optional output key for storing the human response in the tool input.
|
|
124
|
+
* @returns A function tool middleware that can be added to a tool's middleware stack.
|
|
125
|
+
* @since 5.1
|
|
126
|
+
* @example
|
|
127
|
+
* ```ts
|
|
128
|
+
* const myTool = new FunctionTool({
|
|
129
|
+
* name: "sensitiveOperation",
|
|
130
|
+
* execute: async (input) => {
|
|
131
|
+
* // perform sensitive operation
|
|
132
|
+
* },
|
|
133
|
+
* middlewares: [
|
|
134
|
+
* createHumanInTheLoopToolMiddleware({
|
|
135
|
+
* interrupt: async ({ toolName, args }) => ({
|
|
136
|
+
* message: `Tool ${toolName} is requesting approval to execute with arguments: ${JSON.stringify(args)}. Do you approve?`,
|
|
137
|
+
* }),
|
|
138
|
+
* }),
|
|
139
|
+
* ],
|
|
140
|
+
* });
|
|
141
|
+
* ```
|
|
142
|
+
*/
|
|
143
|
+
export function createHumanInTheLoopToolMiddleware<TInput extends AgentData = AgentData, TOutput = unknown>(options?: HumanInTheLoopToolMiddlewareOptions<TInput>): FunctionToolMiddleware<TInput, TOutput>;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* This function retrieves the human-in-the-loop (HITL) response payload from the agent execution configuration.
|
|
147
|
+
*
|
|
148
|
+
* @param config - The agent execution configuration that may contain a HITL response.
|
|
149
|
+
* @returns The payload from the HITL response if available; otherwise, undefined.
|
|
150
|
+
* @since 5.1
|
|
151
|
+
*/
|
|
152
|
+
export function getHumanInTheLoopPayload<TPayload = unknown>(config: AgentExecutionConfig | undefined): TPayload | undefined;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import { NodeInterrupt as s } from "@langchain/langgraph/web";
|
|
3
|
+
import { createAgentMiddleware as f, createToolMiddleware as I } from "./middleware.js";
|
|
4
|
+
const m = "human-in-the-loop", w = "Agent execution requires approval", p = "Agent execution rejected by the user.", h = "human-in-the-loop-tool", y = "Tool execution requires approval";
|
|
5
|
+
function k(t = {}) {
|
|
6
|
+
const { outputKey: n } = t;
|
|
7
|
+
return f(
|
|
8
|
+
m,
|
|
9
|
+
{
|
|
10
|
+
wrapAgent: async (e, r) => {
|
|
11
|
+
const a = T(e), o = M(a, e), i = u(e.config?.configurable);
|
|
12
|
+
if (i?.agentId !== a)
|
|
13
|
+
throw new s(await g({ agentId: a, interruptId: o, options: t, request: e }));
|
|
14
|
+
if (i.id !== o) {
|
|
15
|
+
if (b(a, i.id))
|
|
16
|
+
return await r(e);
|
|
17
|
+
throw new s(await g({ agentId: a, interruptId: o, options: t, request: e }));
|
|
18
|
+
}
|
|
19
|
+
if (i.payload === !1)
|
|
20
|
+
return { outputMessage: p, status: "failed", summary: p };
|
|
21
|
+
const l = n ? { ...e.state, [n]: i.payload } : e.state, d = { ...e, state: l };
|
|
22
|
+
return await r(d);
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{ outputKey: n }
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
function v(t = {}) {
|
|
29
|
+
const { outputKey: n } = t;
|
|
30
|
+
return I(h, {
|
|
31
|
+
wrapToolCall: async (e, r) => {
|
|
32
|
+
const a = e.tool.name, o = A(e.config?.configurable), i = R(o, e.toolCallId ?? a), l = u(e.config?.configurable);
|
|
33
|
+
if (l?.agentId !== o || l.id !== i)
|
|
34
|
+
throw new s(await $({ agentId: o, interruptId: i, options: t, request: e }));
|
|
35
|
+
if (l.payload === !1)
|
|
36
|
+
return `Tool call "${a}" was rejected by the user.`;
|
|
37
|
+
const d = n ? { ...e.input, [n]: l.payload } : e.input, c = { ...e, input: d };
|
|
38
|
+
return await r(c);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
async function g(t) {
|
|
43
|
+
const { agentId: n, interruptId: e, options: r, request: a } = t, o = await r.interrupt?.({ ...a, agentId: n });
|
|
44
|
+
return {
|
|
45
|
+
agentId: n,
|
|
46
|
+
id: e,
|
|
47
|
+
kind: o?.kind ?? "booleanChoice",
|
|
48
|
+
message: o?.message ?? w,
|
|
49
|
+
metadata: o?.metadata
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function T(t) {
|
|
53
|
+
return typeof t.config?.configurable?.agentId == "string" ? t.config.configurable.agentId : t.agent.id;
|
|
54
|
+
}
|
|
55
|
+
function M(t, n) {
|
|
56
|
+
const e = n.config?.configurable?.thread_id, r = typeof e == "string" && e ? `${e}:` : "";
|
|
57
|
+
return `${t}:${r}${n.nodeName}`;
|
|
58
|
+
}
|
|
59
|
+
function b(t, n) {
|
|
60
|
+
return n.startsWith(`${t}:tool:`);
|
|
61
|
+
}
|
|
62
|
+
function A(t) {
|
|
63
|
+
return typeof t?.agentId == "string" ? t.agentId : "llm-agent";
|
|
64
|
+
}
|
|
65
|
+
function R(t, n) {
|
|
66
|
+
return `${t}:tool:${n}`;
|
|
67
|
+
}
|
|
68
|
+
async function $(t) {
|
|
69
|
+
const { agentId: n, interruptId: e, options: r, request: a } = t, { input: o, tool: i, toolCallId: l } = a, d = i.name, c = await r.interrupt?.({ ...a, args: o, toolName: d, toolCallId: l });
|
|
70
|
+
return {
|
|
71
|
+
agentId: n,
|
|
72
|
+
id: e,
|
|
73
|
+
kind: c?.kind ?? "booleanChoice",
|
|
74
|
+
message: c?.message ?? `${y}
|
|
75
|
+
Tool: ${d}`,
|
|
76
|
+
metadata: c?.metadata ?? {
|
|
77
|
+
args: o,
|
|
78
|
+
toolCallId: l,
|
|
79
|
+
toolName: d
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function H(t) {
|
|
84
|
+
return u(t?.configurable)?.payload;
|
|
85
|
+
}
|
|
86
|
+
function u(t) {
|
|
87
|
+
const n = t?.hitlResponse;
|
|
88
|
+
return n && typeof n == "object" && "id" in n && "agentId" in n ? n : null;
|
|
89
|
+
}
|
|
90
|
+
export {
|
|
91
|
+
k as createHumanInTheLoopMiddleware,
|
|
92
|
+
v as createHumanInTheLoopToolMiddleware,
|
|
93
|
+
H as getHumanInTheLoopPayload
|
|
94
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { FunctionToolMiddleware } from "../tools/FunctionTool.js";
|
|
2
|
+
import type { AgentData, AgentGraphState, EmptyAgentData } from "../types.js";
|
|
3
|
+
import type { AgentMiddleware, AgentMiddlewareHooks, ToolMiddlewareHooks } from "./types.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Creates an agent middleware with the specified hooks and options.
|
|
7
|
+
*
|
|
8
|
+
* @param name - The name of the middleware.
|
|
9
|
+
* @param hooks - The hooks to be used in the middleware.
|
|
10
|
+
* @param options - Optional configuration for the middleware, such as the output key.
|
|
11
|
+
* @returns The created agent middleware.
|
|
12
|
+
* @since 5.1
|
|
13
|
+
*/
|
|
14
|
+
export function createAgentMiddleware<TCustomState extends AgentData = EmptyAgentData>(name: string, hooks: AgentMiddlewareHooks<TCustomState>, options?: { outputKey?: keyof AgentGraphState<TCustomState>; }): AgentMiddleware<TCustomState>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Creates a tool middleware with the specified hooks and options.
|
|
18
|
+
*
|
|
19
|
+
* @param name - The name of the middleware.
|
|
20
|
+
* @param hooks - The hooks to be used in the middleware.
|
|
21
|
+
* @param options - Optional configuration for the middleware, such as the output key.
|
|
22
|
+
* @returns The created function tool middleware.
|
|
23
|
+
* @since 5.1
|
|
24
|
+
*/
|
|
25
|
+
export function createToolMiddleware<TInput extends AgentData = AgentData, TOutput = unknown>(name: string, hooks: ToolMiddlewareHooks<TInput, TOutput>, options?: { outputKey?: string; }): FunctionToolMiddleware<TInput, TOutput>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import { createMiddleware as p } from "langchain";
|
|
3
|
+
function g(e, t, r) {
|
|
4
|
+
return {
|
|
5
|
+
name: e,
|
|
6
|
+
handler: async (a, n) => {
|
|
7
|
+
const c = async (l) => {
|
|
8
|
+
const d = await t.beforeAgent?.(l), u = d ? {
|
|
9
|
+
...l,
|
|
10
|
+
state: {
|
|
11
|
+
...l.state,
|
|
12
|
+
...d
|
|
13
|
+
}
|
|
14
|
+
} : l, i = await n(u), w = await t.afterAgent?.({ ...u, result: i });
|
|
15
|
+
return w ? { ...i, ...w } : i;
|
|
16
|
+
};
|
|
17
|
+
return t.wrapAgent ? await t.wrapAgent(a, c) : await c(a);
|
|
18
|
+
},
|
|
19
|
+
hooks: t,
|
|
20
|
+
outputKey: r?.outputKey
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function y(e, t, r) {
|
|
24
|
+
return { name: e, handler: async (a, n) => t.wrapToolCall ? await t.wrapToolCall(a, n) : await n(a), outputKey: r?.outputKey };
|
|
25
|
+
}
|
|
26
|
+
function C(e) {
|
|
27
|
+
return e.map((t) => f(t.name, t.hooks ?? {})).filter((t) => !!t);
|
|
28
|
+
}
|
|
29
|
+
function f(e, t) {
|
|
30
|
+
const { afterModel: r, beforeModel: o, wrapModelCall: a, wrapToolCall: n } = t;
|
|
31
|
+
if (!(!r && !o && !a && !n))
|
|
32
|
+
return p({
|
|
33
|
+
afterModel: r,
|
|
34
|
+
beforeModel: o,
|
|
35
|
+
name: e,
|
|
36
|
+
wrapModelCall: a,
|
|
37
|
+
wrapToolCall: n
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
C as convertToLangChainMiddlewares,
|
|
42
|
+
g as createAgentMiddleware,
|
|
43
|
+
y as createToolMiddleware
|
|
44
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { FunctionToolMiddleware } from "../tools/FunctionTool.js";
|
|
2
|
+
import type { AgentMiddleware } from "./types.js";
|
|
3
|
+
import type { AgentData } from "../types.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* This middleware is responsible for sending trace messages whenever the agent makes a call to the language model or executes a tool.
|
|
7
|
+
*
|
|
8
|
+
* It uses the `sendTraceMessage` function from the orchestrator to send messages that include
|
|
9
|
+
* details about the model calls and tool
|
|
10
|
+
* executions, which can be useful for debugging and monitoring the agent's behavior.
|
|
11
|
+
*
|
|
12
|
+
* @returns An agent middleware that wraps model calls and sends trace messages.
|
|
13
|
+
* @internal
|
|
14
|
+
* @since 5.1
|
|
15
|
+
*/
|
|
16
|
+
export function createAgentTraceMiddleware(): AgentMiddleware;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* This middleware is responsible for sending trace messages whenever a tool is executed by the agent. It wraps tool calls and uses the `sendTraceMessage`
|
|
20
|
+
* function from the orchestrator to send messages that include details about the tool execution, such as the tool name and its result. This can be useful for
|
|
21
|
+
* debugging and monitoring the behavior of tools within the agent's execution.
|
|
22
|
+
*
|
|
23
|
+
* @returns A function tool middleware that wraps tool calls and sends trace messages.
|
|
24
|
+
* @internal
|
|
25
|
+
* @since 5.1
|
|
26
|
+
*/
|
|
27
|
+
export function createToolTraceMiddleware<TInput extends AgentData = AgentData, TOutput = unknown>(): FunctionToolMiddleware<TInput, TOutput>;
|