@geoscene/ai-components 0.0.0-stage → 5.1.14
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/LICENSE.md +18 -0
- package/README.md +2 -3
- 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 +1 -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/22TUPT3D.js +2 -0
- package/dist/cdn/27BBMHFA.js +3 -0
- package/dist/cdn/2FYXUV7O.js +30 -0
- package/dist/cdn/3Y723IJS.js +2 -0
- package/dist/cdn/45POUVZK.js +2 -0
- package/dist/cdn/46U2PGRW.js +65 -0
- package/dist/cdn/4ASZF5I2.js +181 -0
- package/dist/cdn/4BA4OUWC.js +101 -0
- package/dist/cdn/4EALV6QJ.js +2 -0
- package/dist/cdn/53Z3R4OY.js +95 -0
- package/dist/cdn/5RQUSM3T.js +132 -0
- package/dist/cdn/6FEB6XYK.js +2 -0
- package/dist/cdn/6TB6FVGF.js +9 -0
- package/dist/cdn/72TH3ONI.js +2 -0
- package/dist/cdn/77GAVZIK.js +62 -0
- package/dist/cdn/7CCULIWM.js +2 -0
- package/dist/cdn/7WSTR3WA.js +2 -0
- package/dist/cdn/AJKWCXDA.js +46 -0
- package/dist/cdn/AXOPGQGZ.js +2 -0
- package/dist/cdn/B35MHQJD.js +2 -0
- package/dist/cdn/BUTKUPXN.js +33 -0
- package/dist/cdn/CFDTXKJ6.js +2 -0
- package/dist/cdn/CU2TRUZQ.js +93 -0
- package/dist/cdn/D3KUKNJ7.js +11 -0
- package/dist/cdn/DHGNGMNJ.js +2 -0
- package/dist/cdn/DKNDDDWM.js +2 -0
- package/dist/cdn/ESRKMM6P.js +2 -0
- package/dist/cdn/FFXK76K7.js +2 -0
- package/dist/cdn/FYNHAVHL.js +2 -0
- package/dist/cdn/G7XK3XOR.js +77 -0
- package/dist/cdn/GHNP3LDR.js +2 -0
- package/dist/cdn/GI2NZ45U.js +4 -0
- package/dist/cdn/GTXGIROA.js +2 -0
- package/dist/cdn/H3EEFM4A.js +179 -0
- package/dist/cdn/HCD4CDWZ.js +2 -0
- package/dist/cdn/HJGF7W5O.js +35 -0
- package/dist/cdn/HK4HSYKG.js +2 -0
- package/dist/cdn/I55TMNNP.js +2 -0
- package/dist/cdn/ILGFFHXZ.js +2 -0
- package/dist/cdn/INJ2KWHS.js +2 -0
- package/dist/cdn/KBFL7LCS.js +2 -0
- package/dist/cdn/KGYSBUFO.js +9 -0
- package/dist/cdn/KLSCVMLN.js +13 -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/MFZCTEAG.js +2 -0
- package/dist/cdn/MQ7QXIOW.js +52 -0
- package/dist/cdn/N2SKXRLK.js +65 -0
- package/dist/cdn/N5XXTTDR.js +2 -0
- package/dist/cdn/NHDPNQXA.js +36 -0
- package/dist/cdn/NMWLJECU.js +109 -0
- package/dist/cdn/OBDCCGVH.js +2 -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 +27 -0
- package/dist/cdn/Q7FTL7JO.js +2 -0
- package/dist/cdn/QH6TSBNI.js +2 -0
- package/dist/cdn/QZXQIJSW.js +2 -0
- package/dist/cdn/TFPBGM6P.js +2 -0
- package/dist/cdn/THLZTO23.js +12 -0
- package/dist/cdn/TIXCHLEN.js +121 -0
- package/dist/cdn/TOYQ22PR.js +2 -0
- package/dist/cdn/U72SSJEL.js +2 -0
- package/dist/cdn/UDXMJNRF.js +3 -0
- package/dist/cdn/UE3CP46P.js +2 -0
- package/dist/cdn/URYKQKFE.js +3 -0
- package/dist/cdn/VBS2ZXKT.js +3 -0
- package/dist/cdn/VDAF255D.js +22 -0
- package/dist/cdn/VG7HRDJX.js +2 -0
- package/dist/cdn/VPZHLYPA.js +2 -0
- package/dist/cdn/VWMJ7HIK.js +66 -0
- package/dist/cdn/WNJM5TET.js +2 -0
- package/dist/cdn/XTEMZD4A.js +2 -0
- package/dist/cdn/Y5GGIKKC.js +2 -0
- package/dist/cdn/YULWPVJ3.js +2 -0
- package/dist/cdn/YURWID37.js +2 -0
- package/dist/cdn/ZDJM4RRH.js +2 -0
- package/dist/cdn/ZGUVZMYR.js +157 -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 -0
- package/dist/cdn/assets/assistant/t9n/messages.bg.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.bs.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.ca.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.cs.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.da.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.de.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.el.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.es.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.et.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.fi.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.fr.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.he.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.hr.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.hu.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.id.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.it.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.ja.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.ko.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.lt.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.lv.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.nl.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.no.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.pl.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.pt-BR.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.pt-PT.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.ro.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.ru.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.sk.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.sl.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.sr.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.sv.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.th.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.tr.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.uk.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.vi.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.zh-CN.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.zh-HK.json +1 -0
- package/dist/cdn/assets/assistant/t9n/messages.zh-TW.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.ar.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.bg.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.bs.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.ca.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.cs.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.da.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.de.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.el.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.es.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.et.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.fi.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.fr.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.he.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.hr.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.hu.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.id.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.it.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.ja.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.ko.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.lt.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.lv.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.nl.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.no.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.pl.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.pt-BR.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.pt-PT.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.ro.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.ru.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.sk.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.sl.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.sr.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.sv.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.th.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.tr.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.uk.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.vi.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.zh-CN.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.zh-HK.json +1 -0
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.zh-TW.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.ar.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.bg.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.bs.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.ca.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.cs.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.da.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.de.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.el.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.es.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.et.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.fi.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.fr.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.he.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.hr.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.hu.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.id.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.it.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.ja.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.ko.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.lt.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.lv.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.nl.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.no.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.pl.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.pt-BR.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.pt-PT.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.ro.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.ru.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.sk.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.sl.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.sr.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.sv.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.th.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.tr.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.uk.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.vi.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.zh-CN.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.zh-HK.json +1 -0
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.zh-TW.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.ar.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.bg.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.bs.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.ca.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.cs.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.da.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.de.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.el.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.es.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.et.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.fi.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.fr.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.he.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.hr.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.hu.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.id.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.it.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.ja.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.ko.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.lt.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.lv.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.nl.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.no.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.pl.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.pt-BR.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.pt-PT.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.ro.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.ru.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.sk.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.sl.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.sr.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.sv.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.th.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.tr.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.uk.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.vi.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.zh-CN.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.zh-HK.json +1 -0
- package/dist/cdn/assets/assistant-message-feedback/t9n/messages.zh-TW.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.ar.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.bg.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.bs.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.ca.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.cs.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.da.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.de.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.el.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.es.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.et.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.fi.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.fr.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.he.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.hr.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.hu.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.id.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.it.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.ja.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.ko.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.lt.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.lv.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.nl.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.no.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.pl.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.pt-BR.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.pt-PT.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.ro.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.ru.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.sk.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.sl.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.sr.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.sv.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.th.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.tr.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.uk.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.vi.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.zh-CN.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.zh-HK.json +1 -0
- package/dist/cdn/assets/assistant-message-footer/t9n/messages.zh-TW.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.ar.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.bg.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.bs.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.ca.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.cs.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.da.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.de.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.el.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.es.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.et.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.fi.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.fr.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.he.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.hr.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.hu.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.id.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.it.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.ja.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.ko.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.lt.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.lv.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.nl.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.no.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.pl.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.pt-BR.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.pt-PT.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.ro.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.ru.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.sk.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.sl.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.sr.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.sv.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.th.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.tr.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.uk.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.vi.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.zh-CN.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.zh-HK.json +1 -0
- package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.zh-TW.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.ar.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.bg.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.bs.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.ca.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.cs.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.da.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.de.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.el.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.es.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.et.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.fi.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.fr.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.he.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.hr.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.hu.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.id.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.it.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.ja.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.ko.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.lt.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.lv.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.nl.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.no.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.pl.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.pt-BR.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.pt-PT.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.ro.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.ru.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.sk.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.sl.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.sr.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.sv.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.th.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.tr.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.uk.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.vi.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.zh-CN.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.zh-HK.json +1 -0
- package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.zh-TW.json +1 -0
- package/dist/cdn/index.js +2 -0
- package/dist/cdn/main.css +1 -0
- package/dist/chunks/BaseWorkflow.js +107 -0
- package/dist/chunks/adapter.js +3148 -0
- package/dist/chunks/converterUtils.js +124 -0
- package/dist/chunks/dataExplorationGraph.js +319 -0
- package/dist/chunks/data_explore_filter_prompt.js +112 -0
- package/dist/chunks/data_explore_query_prompt.js +135 -0
- package/dist/chunks/embeddings.worker.js +25 -0
- package/dist/chunks/field_descriptions_prompt.js +80 -0
- package/dist/chunks/generateLayerDescriptions.js +477 -0
- package/dist/chunks/geosceneKnowledgeGraph.js +221 -0
- package/dist/chunks/geoscene_knowledge_current_lc_context.js +25 -0
- package/dist/chunks/geoscene_knowledge_current_map_context.js +36 -0
- package/dist/chunks/geoscene_knowledge_cypher_query_prompt.js +96 -0
- package/dist/chunks/geoscene_knowledge_lucene_generation_prompt.js +98 -0
- package/dist/chunks/geoscene_knowledge_summarize_result_prompt.js +104 -0
- package/dist/chunks/geoscene_knowledge_tool_prompt.js +30 -0
- package/dist/chunks/graph.js +86 -0
- package/dist/chunks/helpGraph.js +117 -0
- package/dist/chunks/help_prompt.js +68 -0
- package/dist/chunks/index.js +11 -0
- package/dist/chunks/intent_prompt.js +124 -0
- package/dist/chunks/layerStylingGraph.js +190 -0
- package/dist/chunks/layer_descriptions_prompt.js +55 -0
- package/dist/chunks/layer_styling_prompt.js +65 -0
- package/dist/chunks/navigationGraph.js +265 -0
- package/dist/chunks/navigation_intent_prompt.js +49 -0
- package/dist/chunks/navigation_tool_prompt.js +38 -0
- package/dist/chunks/orchestrator.js +569 -0
- package/dist/chunks/runtime.js +15 -0
- package/dist/chunks/slottableRequestUtils.js +7 -0
- package/dist/chunks/state.js +71 -0
- package/dist/chunks/summarize_query_response_prompt.js +69 -0
- package/dist/chunks/toolCallResponse.js +32 -0
- package/dist/chunks/useT9n.js +7 -0
- package/dist/chunks/utils.js +53 -0
- package/dist/chunks/utils2.js +47 -0
- package/dist/chunks/utils3.js +16 -0
- package/dist/components/geoscene-assistant/customElement.d.ts +541 -0
- package/dist/components/geoscene-assistant/customElement.js +562 -0
- package/dist/components/geoscene-assistant/index.d.ts +1 -0
- package/dist/components/geoscene-assistant/index.js +13 -0
- package/dist/components/geoscene-assistant/types.d.ts +147 -0
- package/dist/components/geoscene-assistant-agent/customElement.d.ts +141 -0
- package/dist/components/geoscene-assistant-agent/customElement.js +23 -0
- package/dist/components/geoscene-assistant-agent/index.d.ts +1 -0
- package/dist/components/geoscene-assistant-agent/index.js +1 -0
- package/dist/components/geoscene-assistant-chat/customElement.d.ts +17 -0
- package/dist/components/geoscene-assistant-chat/customElement.js +50 -0
- package/dist/components/geoscene-assistant-chat/index.d.ts +1 -0
- package/dist/components/geoscene-assistant-chat/index.js +1 -0
- package/dist/components/geoscene-assistant-chat-entry/customElement.d.ts +37 -0
- package/dist/components/geoscene-assistant-chat-entry/customElement.js +85 -0
- package/dist/components/geoscene-assistant-chat-entry/index.d.ts +1 -0
- package/dist/components/geoscene-assistant-chat-entry/index.js +3 -0
- package/dist/components/geoscene-assistant-data-exploration-agent/customElement.d.ts +101 -0
- package/dist/components/geoscene-assistant-data-exploration-agent/customElement.js +48 -0
- package/dist/components/geoscene-assistant-data-exploration-agent/index.d.ts +1 -0
- package/dist/components/geoscene-assistant-data-exploration-agent/index.js +1 -0
- package/dist/components/geoscene-assistant-help-agent/customElement.d.ts +73 -0
- package/dist/components/geoscene-assistant-help-agent/customElement.js +51 -0
- package/dist/components/geoscene-assistant-help-agent/index.d.ts +1 -0
- package/dist/components/geoscene-assistant-help-agent/index.js +1 -0
- package/dist/components/geoscene-assistant-interrupt/customElement.d.ts +31 -0
- package/dist/components/geoscene-assistant-interrupt/customElement.js +37 -0
- package/dist/components/geoscene-assistant-interrupt/index.d.ts +1 -0
- package/dist/components/geoscene-assistant-interrupt/index.js +6 -0
- package/dist/components/geoscene-assistant-interrupt-preview/customElement.js +20 -0
- package/dist/components/geoscene-assistant-interrupt-preview/index.js +2 -0
- package/dist/components/geoscene-assistant-knowledge-agent/customElement.d.ts +158 -0
- package/dist/components/geoscene-assistant-knowledge-agent/customElement.js +74 -0
- package/dist/components/geoscene-assistant-knowledge-agent/index.d.ts +1 -0
- package/dist/components/geoscene-assistant-knowledge-agent/index.js +1 -0
- package/dist/components/geoscene-assistant-layer-styling-agent/customElement.d.ts +8 -0
- package/dist/components/geoscene-assistant-layer-styling-agent/customElement.js +51 -0
- package/dist/components/geoscene-assistant-layer-styling-agent/index.d.ts +1 -0
- package/dist/components/geoscene-assistant-layer-styling-agent/index.js +1 -0
- package/dist/components/geoscene-assistant-message/customElement.d.ts +23 -0
- package/dist/components/geoscene-assistant-message/customElement.js +45 -0
- package/dist/components/geoscene-assistant-message/index.d.ts +1 -0
- package/dist/components/geoscene-assistant-message/index.js +5 -0
- package/dist/components/geoscene-assistant-message-block/customElement.d.ts +8 -0
- package/dist/components/geoscene-assistant-message-block/customElement.js +36 -0
- package/dist/components/geoscene-assistant-message-block/index.d.ts +1 -0
- package/dist/components/geoscene-assistant-message-block/index.js +3 -0
- package/dist/components/geoscene-assistant-message-feedback/customElement.d.ts +26 -0
- package/dist/components/geoscene-assistant-message-feedback/customElement.js +36 -0
- package/dist/components/geoscene-assistant-message-feedback/index.d.ts +1 -0
- package/dist/components/geoscene-assistant-message-feedback/index.js +3 -0
- package/dist/components/geoscene-assistant-message-footer/customElement.d.ts +28 -0
- package/dist/components/geoscene-assistant-message-footer/customElement.js +62 -0
- package/dist/components/geoscene-assistant-message-footer/index.d.ts +1 -0
- package/dist/components/geoscene-assistant-message-footer/index.js +6 -0
- package/dist/components/geoscene-assistant-message-loading/customElement.d.ts +17 -0
- package/dist/components/geoscene-assistant-message-loading/customElement.js +23 -0
- package/dist/components/geoscene-assistant-message-loading/index.d.ts +1 -0
- package/dist/components/geoscene-assistant-message-loading/index.js +5 -0
- package/dist/components/geoscene-assistant-message-log/customElement.d.ts +14 -0
- package/dist/components/geoscene-assistant-message-log/customElement.js +29 -0
- package/dist/components/geoscene-assistant-message-log/index.d.ts +1 -0
- package/dist/components/geoscene-assistant-message-log/index.js +3 -0
- package/dist/components/geoscene-assistant-message-read-aloud/customElement.d.ts +22 -0
- package/dist/components/geoscene-assistant-message-read-aloud/customElement.js +100 -0
- package/dist/components/geoscene-assistant-message-read-aloud/index.d.ts +1 -0
- package/dist/components/geoscene-assistant-message-read-aloud/index.js +3 -0
- package/dist/components/geoscene-assistant-message-text/customElement.d.ts +11 -0
- package/dist/components/geoscene-assistant-message-text/customElement.js +22 -0
- package/dist/components/geoscene-assistant-message-text/index.d.ts +1 -0
- package/dist/components/geoscene-assistant-message-text/index.js +1 -0
- package/dist/components/geoscene-assistant-navigation-agent/customElement.d.ts +81 -0
- package/dist/components/geoscene-assistant-navigation-agent/customElement.js +50 -0
- package/dist/components/geoscene-assistant-navigation-agent/index.d.ts +1 -0
- package/dist/components/geoscene-assistant-navigation-agent/index.js +1 -0
- package/dist/components/geoscene-assistant-speech-input/customElement.d.ts +36 -0
- package/dist/components/geoscene-assistant-speech-input/customElement.js +488 -0
- package/dist/components/geoscene-assistant-speech-input/index.d.ts +1 -0
- package/dist/components/geoscene-assistant-speech-input/index.js +2 -0
- package/dist/components/geoscene-assistant-speech-input/support/types.d.ts +20 -0
- package/dist/components/geoscene-assistant-suggested-prompts/customElement.d.ts +19 -0
- package/dist/components/geoscene-assistant-suggested-prompts/customElement.js +27 -0
- package/dist/components/geoscene-assistant-suggested-prompts/index.d.ts +1 -0
- package/dist/components/geoscene-assistant-suggested-prompts/index.js +3 -0
- package/dist/components/geoscene-assistant-user-message/customElement.d.ts +13 -0
- package/dist/components/geoscene-assistant-user-message/customElement.js +25 -0
- package/dist/components/geoscene-assistant-user-message/index.d.ts +1 -0
- package/dist/components/geoscene-assistant-user-message/index.js +2 -0
- package/dist/docs/api.json +1 -0
- package/dist/docs/docs.json +1 -0
- package/dist/docs/vscode.css-custom-data.json +1 -0
- package/dist/docs/vscode.html-custom-data.json +1 -0
- package/dist/docs/web-types.json +1 -0
- package/dist/index.d.ts +158 -0
- package/dist/index.js +6 -0
- package/dist/loader.d.ts +2 -0
- package/dist/loader.js +30 -0
- package/dist/oauth-callback.html +31 -0
- package/dist/types/components.d.ts +2 -0
- package/dist/types/lumina.d.ts +138 -0
- package/dist/types/preact.d.ts +164 -0
- package/dist/types/react.d.ts +193 -0
- package/dist/types/stencil.d.ts +145 -0
- package/dist/utils/index.d.ts +542 -0
- package/dist/utils/index.js +116 -0
- package/package.json +64 -3
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import type { UXSuggestion } from "../../utils/index.js";
|
|
2
|
+
|
|
3
|
+
/** An interrupt is a UI mechanism used by an agent to prompt the user for additional input or clarification. */
|
|
4
|
+
export interface Interrupt {
|
|
5
|
+
/**
|
|
6
|
+
* The unique identifier of the message associated with the interrupt. This is used to associate the interrupt
|
|
7
|
+
* with specific messages.
|
|
8
|
+
*/
|
|
9
|
+
id?: string;
|
|
10
|
+
/**
|
|
11
|
+
* The type of interrupt, which determines how the assistant will prompt the user for input. The available types are:
|
|
12
|
+
*
|
|
13
|
+
* - `boolean-choice`: Presents the user with a yes/no question.
|
|
14
|
+
* - `multi-select`: Allows the user to select multiple options from a list using a checkbox interface.
|
|
15
|
+
* - `single-select`: Allows the user to select a single option from a list using a radio button interface.
|
|
16
|
+
* - `text-input`: Prompts the user to enter free-form text input.
|
|
17
|
+
*
|
|
18
|
+
* The assistant will use the specified type to determine how to display the prompt and collect the user's response.
|
|
19
|
+
* For example, a `boolean-choice` interrupt might be used to confirm an action, while a `text-input`
|
|
20
|
+
* interrupt could be used to ask for more details about a request.
|
|
21
|
+
*/
|
|
22
|
+
type: "boolean-choice" | "multi-select" | "single-select" | "text-input";
|
|
23
|
+
/**
|
|
24
|
+
* The message to display to the user when prompting for input. This should provide clear instructions or questions
|
|
25
|
+
* related to the interrupt, guiding the user on what information is needed or what action they should take in response
|
|
26
|
+
* to the prompt.
|
|
27
|
+
*
|
|
28
|
+
* For example, if the interrupt type is `boolean-choice`, the message might be "Do you want to proceed with this
|
|
29
|
+
* action?" If the type is `text-input`, the message could be "Please provide more details about your request."
|
|
30
|
+
*/
|
|
31
|
+
message?: string;
|
|
32
|
+
/**
|
|
33
|
+
* The options to present to the user for selection when the interrupt type is `multi-select` or `single-select`.
|
|
34
|
+
* This should be an array of strings representing the available choices. For `boolean-choice`,
|
|
35
|
+
* the options are implicitly "Yes" and "No" and do not need to be provided.
|
|
36
|
+
* For `text-input`, options are not applicable and should be omitted.
|
|
37
|
+
*
|
|
38
|
+
* For example, if the interrupt type is `multi-select`, the options might be ["Option 1", "Option 2", "Option 3"].
|
|
39
|
+
* If the type is `single-select`, the options could be ["Choice A", "Choice B", "Choice C"].
|
|
40
|
+
*/
|
|
41
|
+
options?: string[];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** A chat message sent by the assistant. */
|
|
45
|
+
export interface AssistantMessage extends ChatMessageBase {
|
|
46
|
+
role: "assistant";
|
|
47
|
+
/** The content of the assistant's message. This can include text generated by the assistant in response to the user's message. The content is displayed in the chat interface for the user to read and interact with. */
|
|
48
|
+
content?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Structured response UI blocks associated with the assistant message. These blocks are rendered as interactive
|
|
51
|
+
* UI elements separate from the plain text transcript and can be used to display actions, follow-up prompts,
|
|
52
|
+
* or app-registered custom content.
|
|
53
|
+
*/
|
|
54
|
+
blocks?: (UXSuggestion & { isPending?: boolean; })[];
|
|
55
|
+
/**
|
|
56
|
+
* Log messages related to the assistant's processing of the user's request. This can include information about
|
|
57
|
+
* the agents or tools it invoked, the parameters generated by the LLM, and any relevant details about how it
|
|
58
|
+
* arrived at its response. Log messages are primarily intended for debugging and transparency purposes, allowing
|
|
59
|
+
* developers and users to understand the assistant's behavior and decision-making process.
|
|
60
|
+
*/
|
|
61
|
+
log?: string[];
|
|
62
|
+
/**
|
|
63
|
+
* An error message indicating any issues that occurred while the assistant was processing the user's request.
|
|
64
|
+
* The error message may be displayed in the chat interface to inform the user of the issue and can also be used for
|
|
65
|
+
* debugging and improving the assistant's performance.
|
|
66
|
+
*/
|
|
67
|
+
error?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Feedback provided by the user for this specific assistant message. This allows users to indicate whether the
|
|
70
|
+
* assistant's response was helpful or not, which the app developer can capture and use to improve the assistant's
|
|
71
|
+
* performance over time.
|
|
72
|
+
*/
|
|
73
|
+
feedback?: Feedback;
|
|
74
|
+
/**
|
|
75
|
+
* Indicates whether the message content is still being streamed from the assistant. This can be used to show loading
|
|
76
|
+
* indicators or placeholders in the UI until the full content is received.
|
|
77
|
+
*/
|
|
78
|
+
isStreaming?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* An array of interrupts emitted by the assistant during the processing of the user's request. Each interrupt includes
|
|
81
|
+
* details about the type of interrupt, the message to display to the user, and any options for user input.
|
|
82
|
+
*/
|
|
83
|
+
interrupts?: {
|
|
84
|
+
interrupt: Interrupt;
|
|
85
|
+
response?: string[] | boolean | string;
|
|
86
|
+
}[];
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* A chat message from the user or the assistant. Messages include all relevant information such as content,
|
|
91
|
+
* logs, errors, and feedback.
|
|
92
|
+
*/
|
|
93
|
+
export type ChatMessage = AssistantMessage | UserMessage;
|
|
94
|
+
|
|
95
|
+
/** Detail payload emitted when a suggested prompt is selected. */
|
|
96
|
+
export type AssistantPromptSelectDetail = {
|
|
97
|
+
/** The selected suggested prompt value. */
|
|
98
|
+
prompt: string;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/** Detail payload emitted by the assistant slottable request event. */
|
|
102
|
+
export type AssistantSlottableRequestDetail = {
|
|
103
|
+
/** The request name describing the slot being requested. */
|
|
104
|
+
name: AssistantSlottableRequestName;
|
|
105
|
+
/** The slot name consumers should target when appending light DOM content. */
|
|
106
|
+
slotName: string;
|
|
107
|
+
/** Data describing the current slot request. */
|
|
108
|
+
data?: AssistantSlottableRequestData;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
/** The base interface for chat messages exchanged between the user and the assistant. */
|
|
112
|
+
export interface ChatMessageBase {
|
|
113
|
+
/**
|
|
114
|
+
* The unique identifier for the message. This is used to associate messages with interrupts and feedback.
|
|
115
|
+
* If not provided, a unique ID will be generated automatically.
|
|
116
|
+
*/
|
|
117
|
+
id: string;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** A chat message sent by the user. */
|
|
121
|
+
export interface UserMessage extends ChatMessageBase {
|
|
122
|
+
role: "user";
|
|
123
|
+
/**
|
|
124
|
+
* The content of the user's message. This is the text input provided by the user in the chat interface.
|
|
125
|
+
* This content is sent to the assistant and its agents for processing and generating responses.
|
|
126
|
+
*/
|
|
127
|
+
content: string;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/** Feedback provided by the user for a specific message. */
|
|
131
|
+
export interface Feedback {
|
|
132
|
+
/** Indicates whether the feedback is positive or negative. */
|
|
133
|
+
positive: boolean;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** Data emitted with an assistant slottable request. */
|
|
137
|
+
export type AssistantSlottableRequestData = {
|
|
138
|
+
/** The assistant message associated with the slot request. */
|
|
139
|
+
message: AssistantMessage;
|
|
140
|
+
/** The block associated with the slot request, when requesting block content. */
|
|
141
|
+
block?: UXSuggestion;
|
|
142
|
+
/** Zero-based index of the block associated with the slot request. */
|
|
143
|
+
index?: number;
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
/** Supported assistant slottable request names. */
|
|
147
|
+
export type AssistantSlottableRequestName = "block" | "message";
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/// <reference path="../../index.d.ts" />
|
|
2
|
+
import type { PublicLitElement as LitElement } from "@geoscene/lumina";
|
|
3
|
+
import type { AgentRegistration } from "../../utils/index.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The Assistant Agent component is a generic wrapper for registering custom agents to the [geoscene-assistant](https://doc.geoscene.cn/javascript/5.1/references/ai-components/components/geoscene-assistant/) component. To define
|
|
7
|
+
* a custom agent, you must be familiar with [LangGraph](https://docs.langchain.com/oss/javascript/langgraph/overview). Custom agents must
|
|
8
|
+
* include a StateGraph that defines the agent's graph and subgraphs.
|
|
9
|
+
*
|
|
10
|
+
* Building custom agents can only be done using modern JavaScript/TypeScript tooling and cannot be done directly in HTML using
|
|
11
|
+
* CDN imports. Therefore, you must use a package manager like npm or yarn to install the required dependencies. Please refer to the
|
|
12
|
+
* [Custom Agents guide](https://doc.geoscene.cn/javascript/5.1/agentic-apps/ai-custom-agents/) for more instructions on how to create a custom agent.
|
|
13
|
+
*
|
|
14
|
+
* Use the [utils](https://doc.geoscene.cn/javascript/5.1/references/ai-components/utils/index/) module for helper functions and types related to building custom agents, including the `AgentRegistration`
|
|
15
|
+
* type and functions for making LLM calls, managing agent state, and setting up human-in-the-loop workflows.
|
|
16
|
+
*
|
|
17
|
+
* > We recommend that developers building custom agents have experience working with LLMs and generative AI, and have a good
|
|
18
|
+
* understanding of the limitations of these technologies when building applications for end users.
|
|
19
|
+
*
|
|
20
|
+
* This is an unrendered component that must be added as a child of the `geoscene-assistant` component in either HTML or JavaScript.
|
|
21
|
+
*
|
|
22
|
+
* ```html
|
|
23
|
+
* <geoscene-assistant></geoscene-assistant>
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* ```js
|
|
27
|
+
* const myCustomAgent = {
|
|
28
|
+
* id: "my-custom-agent",
|
|
29
|
+
* name: "My Custom Agent",
|
|
30
|
+
* description: "An agent that does custom things. Use this agent when users want to do custom things.",
|
|
31
|
+
* createGraph: {
|
|
32
|
+
* // StateGraph definition using LangGraph
|
|
33
|
+
* },
|
|
34
|
+
* workspace: {
|
|
35
|
+
* // AnnotationRoot definition using LangGraph
|
|
36
|
+
* // relevant variables and context required by the agent
|
|
37
|
+
* },
|
|
38
|
+
* };
|
|
39
|
+
*
|
|
40
|
+
* const assistant = document.querySelector("geoscene-assistant");
|
|
41
|
+
* const assistantAgent = document.createElement("geoscene-assistant-agent");
|
|
42
|
+
*
|
|
43
|
+
* assistantAgent.agent = myCustomAgent;
|
|
44
|
+
* assistant.appendChild(assistantAgent);
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @since 5.0
|
|
48
|
+
* @beta
|
|
49
|
+
* @see [geoscene-assistant](https://doc.geoscene.cn/javascript/5.1/references/ai-components/components/geoscene-assistant/)
|
|
50
|
+
* @see [LangGraph documentation](https://docs.langchain.com/oss/javascript/langgraph/overview)
|
|
51
|
+
* @see [Custom agents guide](https://doc.geoscene.cn/javascript/5.1/agentic-apps/ai-custom-agents/)
|
|
52
|
+
* @see [AI Assistant component sample](https://doc.geoscene.cn/javascript/5.1/sample-code/ai-assistant/)
|
|
53
|
+
* @see [AgentRegistration](https://doc.geoscene.cn/javascript/5.1/references/ai-components/utils/index/#AgentRegistration)
|
|
54
|
+
* @see [invokeStructuredPrompt](https://doc.geoscene.cn/javascript/5.1/references/ai-components/utils/index/#invokeStructuredPrompt)
|
|
55
|
+
* @see [invokeToolPrompt](https://doc.geoscene.cn/javascript/5.1/references/ai-components/utils/index/#invokeToolPrompt)
|
|
56
|
+
* @see [invokeTextPrompt](https://doc.geoscene.cn/javascript/5.1/references/ai-components/utils/index/#invokeTextPrompt)
|
|
57
|
+
*/
|
|
58
|
+
export abstract class GeosceneAssistantAgent<TContext = Record<string, unknown>> extends LitElement {
|
|
59
|
+
/**
|
|
60
|
+
* The agent registration object that defines the AI agent's behavior and capabilities.
|
|
61
|
+
* This must include a StateGraph definition (defined using
|
|
62
|
+
* [LangGraph](https://docs.langchain.com/oss/javascript/langgraph/overview)).
|
|
63
|
+
*
|
|
64
|
+
* This is an agent defined in the client and can be invoked by the assistant from the browser to perform specific tasks
|
|
65
|
+
* using functions defined in the client.
|
|
66
|
+
*
|
|
67
|
+
* See the [Custom Agents guide](https://doc.geoscene.cn/javascript/5.1/agentic-apps/ai-custom-agents/) for more instructions
|
|
68
|
+
* and links to samples demonstrating how to create custom agents.
|
|
69
|
+
*
|
|
70
|
+
* @required
|
|
71
|
+
* @see [LangGraph documentation](https://docs.langchain.com/oss/javascript/langgraph/overview)
|
|
72
|
+
* @see [Custom agents guide](https://doc.geoscene.cn/javascript/5.1/agentic-apps/ai-custom-agents/)
|
|
73
|
+
* @example
|
|
74
|
+
* ```js
|
|
75
|
+
* // An example graph that updates a component property and replies with a confirmation message
|
|
76
|
+
* const myCustomGraph = () => {
|
|
77
|
+
* const graph = new StateGraph(myCustomState)
|
|
78
|
+
* .addNode("updateComponentProperty", updateComponentProperty)
|
|
79
|
+
* .addNode("replyComponentPropertyUpdate", replyComponentPropertyUpdate)
|
|
80
|
+
* .addEdge(START, "updateComponentProperty")
|
|
81
|
+
* .addEdge("updateComponentProperty", "replyComponentPropertyUpdate")
|
|
82
|
+
* .addEdge("replyComponentPropertyUpdate", END);
|
|
83
|
+
*
|
|
84
|
+
* return graph;
|
|
85
|
+
* };
|
|
86
|
+
*
|
|
87
|
+
* const myCustomAgentState = Annotation.Root({
|
|
88
|
+
* // This is required to keep track of chat messages between the user and the agent
|
|
89
|
+
* messages: Annotation<ChatHistory>({
|
|
90
|
+
* reducer: messagesStateReducer,
|
|
91
|
+
* default: () => [],
|
|
92
|
+
* }),
|
|
93
|
+
* // Accumulates user-visible output across graph nodes
|
|
94
|
+
* outputMessage: Annotation<string>({
|
|
95
|
+
* reducer: (current = "", update) =>
|
|
96
|
+
* typeof update === "string" && update.trim()
|
|
97
|
+
* ? current
|
|
98
|
+
* ? `${current}\n\n${update}`
|
|
99
|
+
* : update
|
|
100
|
+
* : current,
|
|
101
|
+
* default: () => "",
|
|
102
|
+
* }),
|
|
103
|
+
* // Result of the UI action performed by the agent
|
|
104
|
+
* // This is a custom type defined by the application
|
|
105
|
+
* result: Annotation<UIActionResult | null>({
|
|
106
|
+
* reducer: (_current, update) => update ?? null,
|
|
107
|
+
* default: () => null,
|
|
108
|
+
* }),
|
|
109
|
+
* });
|
|
110
|
+
*
|
|
111
|
+
* const myCustomAgent = {
|
|
112
|
+
* id: "my-custom-agent",
|
|
113
|
+
* name: "My Custom Agent",
|
|
114
|
+
* description: "An agent that does custom things. Use this agent when users want to do custom things.",
|
|
115
|
+
* createGraph: myCustomGraph,
|
|
116
|
+
* workspace: myCustomAgentState,
|
|
117
|
+
* };
|
|
118
|
+
*
|
|
119
|
+
* const assistant = document.querySelector("geoscene-assistant");
|
|
120
|
+
* const assistantAgent = document.createElement("geoscene-assistant-agent");
|
|
121
|
+
*
|
|
122
|
+
* assistantAgent.agent = myCustomAgent;
|
|
123
|
+
* assistant.appendChild(assistantAgent);
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
accessor agent: AgentRegistration;
|
|
127
|
+
/**
|
|
128
|
+
* If the agent requires context provided by the application or user, it can be provided via this property and accessed in the
|
|
129
|
+
* agent's graph nodes.
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```js
|
|
133
|
+
* assistantAgent.context = {
|
|
134
|
+
* myData: {
|
|
135
|
+
* // data required for the custom agent
|
|
136
|
+
* },
|
|
137
|
+
* };
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
accessor context: TContext | (() => Promise<TContext | undefined> | TContext | undefined) | undefined;
|
|
141
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* COPYRIGHT GeoScene - https://js.geoscene.cn/5.1/LICENSE.txt */
|
|
2
|
+
import { c as t } from "../../chunks/runtime.js";
|
|
3
|
+
import { LitElement as s } from "@geoscene/lumina";
|
|
4
|
+
import { i as e, a as i } from "../../chunks/utils2.js";
|
|
5
|
+
class n extends s {
|
|
6
|
+
static {
|
|
7
|
+
this.properties = { agent: 0, context: 0 };
|
|
8
|
+
}
|
|
9
|
+
#t;
|
|
10
|
+
async getContext() {
|
|
11
|
+
return e(this.context) ? await this.context() : this.context;
|
|
12
|
+
}
|
|
13
|
+
load() {
|
|
14
|
+
this.#t = i(this);
|
|
15
|
+
}
|
|
16
|
+
disconnectedCallback() {
|
|
17
|
+
this.#t?.unregister(this.agent.id), super.disconnectedCallback();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
t("geoscene-assistant-agent", n);
|
|
21
|
+
export {
|
|
22
|
+
n as GeosceneAssistantAgent
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./customElement.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./customElement.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference path="../../index.d.ts" />
|
|
2
|
+
import type Collection from "@geoscene/core/core/Collection.js";
|
|
3
|
+
import type { PublicLitElement as LitElement } from "@geoscene/lumina";
|
|
4
|
+
import type { ChatMessage, Interrupt } from "../geoscene-assistant/types.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Wraps and renders the conversation area. Use it as the container for message list content.
|
|
8
|
+
* Offers chat-level layout structure for message starter, message list, and loading regions.
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export abstract class GeosceneAssistantChat extends LitElement {
|
|
13
|
+
accessor interrupt: Interrupt | null;
|
|
14
|
+
/** @default false */
|
|
15
|
+
accessor loading: boolean;
|
|
16
|
+
accessor messages: Collection<ChatMessage>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* COPYRIGHT GeoScene - https://js.geoscene.cn/5.1/LICENSE.txt */
|
|
2
|
+
import { c as s } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as e, html as t } from "lit";
|
|
4
|
+
import { LitElement as i } from "@geoscene/lumina";
|
|
5
|
+
import { createRef as a, ref as l } from "lit/directives/ref.js";
|
|
6
|
+
import n from "@geoscene/core/core/Collection.js";
|
|
7
|
+
import { when as r, watch as o } from "@geoscene/core/core/reactiveUtils.js";
|
|
8
|
+
const c = e`.messages-container{display:flex;flex:1;flex-direction:column;line-height:var(--calcite-font-line-height-relative-snug)}.messages-list{padding:var(--calcite-spacing-lg);display:flex;flex-direction:column;gap:var(--calcite-spacing-xxl);flex:1 1 auto;min-height:0;justify-content:flex-end;overflow:auto}.end-ref{margin-top:var(--calcite-spacing-lg)}`;
|
|
9
|
+
class m extends i {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments), this.#e = a(), this.#s = !1, this.loading = !1, this.messages = new n([]), this.interrupt = null;
|
|
12
|
+
}
|
|
13
|
+
static {
|
|
14
|
+
this.properties = { loading: 5, messages: 0, interrupt: 0 };
|
|
15
|
+
}
|
|
16
|
+
static {
|
|
17
|
+
this.styles = c;
|
|
18
|
+
}
|
|
19
|
+
#e;
|
|
20
|
+
#s;
|
|
21
|
+
firstUpdated() {
|
|
22
|
+
this.#t();
|
|
23
|
+
}
|
|
24
|
+
loaded() {
|
|
25
|
+
this.manager.onLifecycle(() => [
|
|
26
|
+
this.messages.on("change", () => {
|
|
27
|
+
this.#t();
|
|
28
|
+
}),
|
|
29
|
+
r(() => !this.loading, () => {
|
|
30
|
+
this.#s = !1;
|
|
31
|
+
}),
|
|
32
|
+
o(() => [this.loading, this.interrupt], () => this.#t())
|
|
33
|
+
]);
|
|
34
|
+
}
|
|
35
|
+
#t() {
|
|
36
|
+
requestAnimationFrame(() => {
|
|
37
|
+
this.#s || this.#e.value?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
#i() {
|
|
41
|
+
this.#s = !0;
|
|
42
|
+
}
|
|
43
|
+
render() {
|
|
44
|
+
return t`<div class="messages-container" @wheel=${this.#i}><div class="messages-list"><slot name=message-starter></slot><slot name=messages></slot><slot name=message-loading></slot></div><div class="end-ref" ${l(this.#e)}></div></div>`;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
s("geoscene-assistant-chat", m);
|
|
48
|
+
export {
|
|
49
|
+
m as GeosceneAssistantChat
|
|
50
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./customElement.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./customElement.js";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/// <reference path="../../index.d.ts" />
|
|
2
|
+
import type Collection from "@geoscene/core/core/Collection.js";
|
|
3
|
+
import type { PublicLitElement as LitElement } from "@geoscene/lumina";
|
|
4
|
+
import type { ChatMessage } from "../geoscene-assistant/types.js";
|
|
5
|
+
import type { T9nMeta } from "@geoscene/lumina/controllers";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Provides the input bar and submit or cancel behavior. Use it to collect prompts and emit submit events.
|
|
9
|
+
* Offers keyboard submit/history behavior, entry action slots, and optional voice-input integration.
|
|
10
|
+
*
|
|
11
|
+
* @slot [entry-actions-start] - Slot for adding actions to the start of the entry area.
|
|
12
|
+
* @slot [entry-actions-end] - Slot for adding actions to the end of the entry area.
|
|
13
|
+
*/
|
|
14
|
+
export abstract class GeosceneAssistantChatEntry extends LitElement {
|
|
15
|
+
/** @internal */
|
|
16
|
+
protected _messages: { entryPlaceholder: string; } & T9nMeta<{ entryPlaceholder: string; }>;
|
|
17
|
+
/** @default false */
|
|
18
|
+
accessor awaitingResponse: boolean;
|
|
19
|
+
/** @default false */
|
|
20
|
+
accessor disabled: boolean;
|
|
21
|
+
accessor entryPlaceholder: string | undefined;
|
|
22
|
+
/** @default "" */
|
|
23
|
+
accessor inputValue: string;
|
|
24
|
+
/** @default false */
|
|
25
|
+
accessor keyboardShortcutsDisabled: boolean;
|
|
26
|
+
accessor messages: Collection<ChatMessage>;
|
|
27
|
+
accessor status: "error" | "ready" | "working" | undefined;
|
|
28
|
+
/** @default false */
|
|
29
|
+
accessor voiceInputEnabled: boolean;
|
|
30
|
+
submitMessage(): Promise<void>;
|
|
31
|
+
readonly geosceneCancel: import("@geoscene/lumina").TargetedEvent<this, void>;
|
|
32
|
+
readonly geosceneSubmit: import("@geoscene/lumina").TargetedEvent<this, string>;
|
|
33
|
+
readonly "@eventTypes": {
|
|
34
|
+
geosceneCancel: GeosceneAssistantChatEntry["geosceneCancel"]["detail"];
|
|
35
|
+
geosceneSubmit: GeosceneAssistantChatEntry["geosceneSubmit"]["detail"];
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/* COPYRIGHT GeoScene - https://js.geoscene.cn/5.1/LICENSE.txt */
|
|
2
|
+
import { c as d } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as p, html as c } from "lit";
|
|
4
|
+
import { LitElement as f, createEvent as l, safeClassMap as g } from "@geoscene/lumina";
|
|
5
|
+
import { createRef as u, ref as h } from "lit/directives/ref.js";
|
|
6
|
+
import { u as m } from "../../chunks/useT9n.js";
|
|
7
|
+
import y from "@geoscene/core/core/Collection.js";
|
|
8
|
+
import { classes as v } from "@geoscene/toolkit/dom";
|
|
9
|
+
const b = p`:host{--calcite-text-area-border-color: var(--calcite-color-border-1);--calcite-text-area-divider-color: var(--calcite-color-border-1);--calcite-text-area-corner-radius: var(--calcite-border-radius)}.input-container{display:flex;flex-direction:column}.footer-start{display:flex;gap:var(--calcite-spacing-md);flex-wrap:wrap;align-items:center}.footer-end{display:flex;gap:var(--calcite-spacing-md);align-items:center}.status-indicator{width:9px;height:9px;border-radius:100%;background-color:var(--calcite-color-status-success)}.status-indicator[data-status=working]{background-color:var(--calcite-color-status-warning)}.status-indicator[data-status=error]{background-color:var(--calcite-color-status-danger)}.status-text{text-transform:capitalize}.focused{--calcite-text-area-shadow: var(--calcite-shadow-sm)}`;
|
|
10
|
+
class w extends f {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments), this.#s = u(), this.#i = u(), this.#t = -1, this.#e = "", this.#a = (t) => {
|
|
13
|
+
t.stopPropagation();
|
|
14
|
+
const s = t.detail;
|
|
15
|
+
this._setDraftValue(s.value), s.focusInput && this.#s.value && this.#s.value.setFocus();
|
|
16
|
+
}, this.#r = (t) => {
|
|
17
|
+
const s = t.target.value ?? "";
|
|
18
|
+
this.inputValue = s, this.#e = s;
|
|
19
|
+
}, this._messages = m({ blocking: !0 }), this._inFocus = !1, this.keyboardShortcutsDisabled = !1, this.awaitingResponse = !1, this.inputValue = "", this.voiceInputEnabled = !1, this.messages = new y([]), this.disabled = !1, this.geosceneCancel = l(), this.geosceneSubmit = l();
|
|
20
|
+
}
|
|
21
|
+
static {
|
|
22
|
+
this.properties = { _inFocus: 16, _userMessages: 16, keyboardShortcutsDisabled: 5, entryPlaceholder: 1, awaitingResponse: 5, inputValue: 1, status: 1, voiceInputEnabled: 5, messages: 0, disabled: 5 };
|
|
23
|
+
}
|
|
24
|
+
static {
|
|
25
|
+
this.styles = b;
|
|
26
|
+
}
|
|
27
|
+
#s;
|
|
28
|
+
#i;
|
|
29
|
+
#t;
|
|
30
|
+
#e;
|
|
31
|
+
#a;
|
|
32
|
+
#r;
|
|
33
|
+
get _userMessages() {
|
|
34
|
+
return this.messages.toArray().filter((t) => t.role === "user").map(({ content: t }) => t);
|
|
35
|
+
}
|
|
36
|
+
async submitMessage() {
|
|
37
|
+
if (this.awaitingResponse) {
|
|
38
|
+
this.geosceneCancel.emit();
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const t = this.inputValue.trim();
|
|
42
|
+
t && (this.geosceneSubmit.emit(t), this.inputValue = "", this.#t = -1, this.#e = "", this.#i.value?.clearDraftSession(), this.#s.value && await this.#s.value.setFocus());
|
|
43
|
+
}
|
|
44
|
+
loaded() {
|
|
45
|
+
this.manager.onLifecycle(() => (this.el.addEventListener("geosceneVoiceInputDraftChange", this.#a), {
|
|
46
|
+
remove: () => {
|
|
47
|
+
this.el.removeEventListener("geosceneVoiceInputDraftChange", this.#a);
|
|
48
|
+
}
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
async _navigateHistory(t, s) {
|
|
52
|
+
const a = this.#s.value;
|
|
53
|
+
if (!a)
|
|
54
|
+
return;
|
|
55
|
+
const e = this._userMessages;
|
|
56
|
+
if (e.length === 0)
|
|
57
|
+
return;
|
|
58
|
+
const r = a.value ?? "", o = a.shadowRoot?.querySelector("textarea"), i = o?.selectionStart, n = o?.selectionEnd;
|
|
59
|
+
if (!(i == null || n == null) && !(i !== n || t === "up" && i !== 0 || t === "down" && i !== r.length)) {
|
|
60
|
+
if (t === "up") {
|
|
61
|
+
this.#t === -1 ? (this.#e = r, this.#t = e.length - 1) : this.#t = Math.max(0, this.#t - 1), this.inputValue = e[this.#t] ?? "", s.preventDefault();
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
this.#t !== -1 && (this.#t < e.length - 1 ? (this.#t += 1, this.inputValue = e[this.#t] ?? "") : (this.#t = -1, this.inputValue = this.#e), s.preventDefault());
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
_setDraftValue(t) {
|
|
68
|
+
this.inputValue = t, this.#t = -1, this.#e = t;
|
|
69
|
+
}
|
|
70
|
+
_onFocusIn() {
|
|
71
|
+
this._inFocus = !0;
|
|
72
|
+
}
|
|
73
|
+
_onFocusOut() {
|
|
74
|
+
this._inFocus = !1;
|
|
75
|
+
}
|
|
76
|
+
render() {
|
|
77
|
+
return c`<div class="input-container"><calcite-text-area class=${g(v({ focused: this._inFocus }))} .value=${this.inputValue} .placeholder=${this.entryPlaceholder ?? this._messages.entryPlaceholder} resize=vertical @calciteTextAreaInput=${this.#r} .disabled=${this.disabled} @keydown=${async (t) => {
|
|
78
|
+
t.altKey || t.ctrlKey || t.metaKey || t.shiftKey || this.keyboardShortcutsDisabled || (t.key === "Enter" ? (t.preventDefault(), await this.submitMessage()) : t.key === "ArrowUp" ? await this._navigateHistory("up", t) : t.key === "ArrowDown" && await this._navigateHistory("down", t));
|
|
79
|
+
}} @focusin=${this._onFocusIn} @focusout=${this._onFocusOut} ${h(this.#s)}><div slot=footer-start class="footer-start"><slot name=entry-actions-start></slot></div><div slot=footer-end class="footer-end">${this.voiceInputEnabled ? c`<geoscene-assistant-speech-input .awaitingResponse=${this.awaitingResponse} .inputValue=${this.inputValue} ${h(this.#i)}></geoscene-assistant-speech-input>` : null}<slot name=entry-actions-end></slot></div></calcite-text-area></div>`;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
d("geoscene-assistant-chat-entry", w);
|
|
83
|
+
export {
|
|
84
|
+
w as GeosceneAssistantChatEntry
|
|
85
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./customElement.js";
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/// <reference path="../../index.d.ts" />
|
|
2
|
+
import type { PublicLitElement as LitElement } from "@geoscene/lumina";
|
|
3
|
+
import type { GeosceneMap as GeosceneMap } from "@geoscene/map-components/components/geoscene-map";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The Data Exploration Agent enables the end user to query features, statistics, and spatial proximity
|
|
7
|
+
* to features in a layer within a web map. Currently, this is only scoped to querying feature layers within
|
|
8
|
+
* a 2D web map. See the list of capabilities below for more details.
|
|
9
|
+
*
|
|
10
|
+
* The data exploration agent is designed to answer questions about the data in the map, and does not have
|
|
11
|
+
* access to external data sources or the user's location. It also cannot create visualizations in the form of charts,
|
|
12
|
+
* layer renderers, new maps, or other visual outputs. It can currently only provide answers in text form based on the
|
|
13
|
+
* data in the map.
|
|
14
|
+
*
|
|
15
|
+
* This agent can change the state of the map by filtering features in a layer, but it cannot change the symbology of
|
|
16
|
+
* features or create new layers or export results of a query to a file or external source.
|
|
17
|
+
*
|
|
18
|
+
* This is an unrendered component that must be added as a child of the `geoscene-assistant` component in either HTML or JavaScript.
|
|
19
|
+
*
|
|
20
|
+
* ```html
|
|
21
|
+
* <geoscene-map id="my-map"></geoscene-map>
|
|
22
|
+
* <geoscene-assistant reference-element="my-map">
|
|
23
|
+
* <geoscene-assistant-data-exploration-agent></geoscene-assistant-data-exploration-agent>
|
|
24
|
+
* </geoscene-assistant>
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* ```js
|
|
28
|
+
* const assistant = document.querySelector("geoscene-assistant");
|
|
29
|
+
* const dataExplorationAgent = document.createElement("geoscene-assistant-data-exploration-agent");
|
|
30
|
+
* assistant.appendChild(dataExplorationAgent);
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* Once added to the assistant, the agent is loaded and ready to receive user messages related to data exploration.
|
|
34
|
+
*
|
|
35
|
+
* ### Capabilities
|
|
36
|
+
*
|
|
37
|
+
* The data exploration agent provides the following capabilities related to exploring data in the map:
|
|
38
|
+
*
|
|
39
|
+
* - **Query features** - Ask about the attributes of features in a layer, including a single feature or a set
|
|
40
|
+
* of features.
|
|
41
|
+
* - **Query statistics** - Ask about statistics related to features in a layer. Statistics that can be queried
|
|
42
|
+
* include count, average, minimum, maximum, and sum. This includes asking about the top number of features based on a
|
|
43
|
+
* particular attribute.
|
|
44
|
+
* - **Query spatial proximity** - Ask about the spatial proximity of features in a layer, such as
|
|
45
|
+
* the number of features that intersect a polygon, or information about features within a distance of a specified location or feature.
|
|
46
|
+
* This currently does not include questions about the closest feature, but this is planned to be included in a future release.
|
|
47
|
+
* - **Filter features** - Users can ask the agent to show a subset of features that filter by attributes, or spatial
|
|
48
|
+
* proximity to other features. This includes asking the agent to show features that intersect a particular area,
|
|
49
|
+
* or are within a certain distance of a location or feature.
|
|
50
|
+
*
|
|
51
|
+
* ### Example questions
|
|
52
|
+
*
|
|
53
|
+
* The following are example questions a user can ask within the bounds of the data exploration agent.
|
|
54
|
+
* These questions assume a map with layers that include cities, states, and rivers.
|
|
55
|
+
*
|
|
56
|
+
* - "What is the city with the largest population?"
|
|
57
|
+
* - "How does that population compare to the average population of the cities in this map?"
|
|
58
|
+
* - "How many cities are within 30 miles of the Colorado River?"
|
|
59
|
+
* - "Show all cities in the state of California."
|
|
60
|
+
* - "List the top 5 rivers by length."
|
|
61
|
+
* - "Emphasize the largest river on the map."
|
|
62
|
+
*
|
|
63
|
+
* The following are examples of the types of questions that fall outside the bounds of the
|
|
64
|
+
* data exploration agent and should therefore be avoided:
|
|
65
|
+
*
|
|
66
|
+
* - "What is the closest restaurant to me?" (the data exploration agent does not have access to the user's location,
|
|
67
|
+
* nor can it find the nearest feature from a location)
|
|
68
|
+
* - "What is the projected growth of Phoenix in the next 10 years?" (the data exploration agent can
|
|
69
|
+
* only answer questions about the data in the map, not external data or projections)
|
|
70
|
+
* - "Show me the population of cities in this map on a graph." (the data exploration agent can only
|
|
71
|
+
* provide answers in text form, not visualizations)
|
|
72
|
+
*
|
|
73
|
+
* > Due to the non-deterministic nature of generative AI, there may be inaccuracies or unexpected behavior when using the
|
|
74
|
+
* out-of-the-box agents.
|
|
75
|
+
*
|
|
76
|
+
* @since 5.0
|
|
77
|
+
* @beta
|
|
78
|
+
* @see [geoscene-assistant](https://doc.geoscene.cn/javascript/5.1/references/ai-components/components/geoscene-assistant/)
|
|
79
|
+
* @see [Intro to building agentic mapping applications](https://doc.geoscene.cn/javascript/5.1/agentic-apps/ai-introduction/)
|
|
80
|
+
* @see [AI Assistant component sample](https://doc.geoscene.cn/javascript/5.1/sample-code/ai-assistant/)
|
|
81
|
+
*/
|
|
82
|
+
export abstract class GeosceneAssistantDataExplorationAgent extends LitElement {
|
|
83
|
+
/**
|
|
84
|
+
* The reference element to the map that provides context for the data exploration agent. Currently,
|
|
85
|
+
* this is only scoped to `geoscene-map` elements. This provides the data exploration agent with the layers
|
|
86
|
+
* needed for answering user questions about the data in the map.
|
|
87
|
+
*
|
|
88
|
+
* Setting this property is not necessary if you set the reference element on the parent
|
|
89
|
+
* `geoscene-assistant` component.
|
|
90
|
+
*
|
|
91
|
+
* @see [geoscene-assistant.referenceElement](https://doc.geoscene.cn/javascript/5.1/references/ai-components/components/geoscene-assistant/#referenceElement)
|
|
92
|
+
* @example
|
|
93
|
+
* ```html
|
|
94
|
+
* <geoscene-map id="my-map"></geoscene-map>
|
|
95
|
+
* <geoscene-assistant>
|
|
96
|
+
* <geoscene-assistant-data-exploration-agent reference-element="my-map"></geoscene-assistant-data-exploration-agent>
|
|
97
|
+
* </geoscene-assistant>
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
accessor referenceElement: GeosceneMap | string | undefined;
|
|
101
|
+
}
|