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