@arcgis/ai-components 5.2.0-next.105 → 5.2.0-next.107
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.js +42 -41
- 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/agents/runtime/skill/createSkillAgent.d.ts +31 -0
- package/dist/agents/runtime/skill/createSkillAgent.js +260 -0
- package/dist/agents/runtime/skill/loadAgentSkills.d.ts +16 -0
- package/dist/agents/runtime/skill/types.d.ts +28 -0
- package/dist/agents/runtime/skill/types.js +2 -0
- 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 +21 -20
- 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 +5 -4
- package/dist/agents/tools/query/getTopFeatures/adapter.js +5 -4
- package/dist/agents/tools/query/queryFeatures/adapter.js +5 -4
- 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.d.ts +22 -0
- package/dist/agents/tools/shared/resolveToolArtifact.js +20 -0
- package/dist/agents/tools/shared/types.d.ts +22 -0
- package/dist/agents/tools/shared/types.js +6 -0
- package/dist/cdn/25MBI4PD.js +2 -0
- package/dist/cdn/{LLUGJKAQ.js → 275FFTBE.js} +2 -2
- package/dist/cdn/2F4TPWZQ.js +2 -0
- package/dist/cdn/{HKOGIZDQ.js → 2LVYAXHG.js} +19 -19
- package/dist/cdn/{5MK44FNO.js → 2NRCE53B.js} +2 -2
- package/dist/cdn/{R2PQVY4O.js → 2WXXSZP5.js} +2 -2
- package/dist/cdn/{APFZY4PI.js → 3KNLFIM3.js} +2 -2
- package/dist/cdn/{NNXISHCA.js → 3PPXAIRE.js} +3 -3
- package/dist/cdn/{FUF3NAU7.js → 45BDE3MG.js} +2 -2
- package/dist/cdn/{VOKXKU7M.js → 477I66FH.js} +10 -10
- package/dist/cdn/4CFCV47G.js +2 -0
- package/dist/cdn/{TPULIO6I.js → 4IWDBEMN.js} +2 -2
- package/dist/cdn/{G2EGT3CF.js → 4OI4QEV7.js} +2 -2
- package/dist/cdn/{2W7LK4HA.js → 4UAREC76.js} +2 -2
- package/dist/cdn/{HHFNQR6Z.js → 4VBOTWC3.js} +2 -2
- package/dist/cdn/{RLEHNAIA.js → 4YOG5F3W.js} +1 -1
- package/dist/cdn/5X23DDDZ.js +2 -0
- package/dist/cdn/65ZACLYB.js +2 -0
- package/dist/cdn/{HDACNIZF.js → 6KWGSXIN.js} +2 -2
- package/dist/cdn/{O4NVW75A.js → 6MRTZ4OM.js} +2 -2
- package/dist/cdn/{DKZYPPJV.js → 77NAJM5H.js} +2 -2
- package/dist/cdn/{NEV6OZN3.js → 7DOYUO7L.js} +2 -2
- package/dist/cdn/{EYOWRGDP.js → 7JJX6VGI.js} +2 -2
- package/dist/cdn/{ONQ6JSBJ.js → A6LBMS7A.js} +1 -1
- package/dist/cdn/{ZDV4K4WG.js → AP3KPOHN.js} +2 -2
- package/dist/cdn/AUCKEB52.js +2 -0
- package/dist/cdn/B3HXSEBN.js +2 -0
- package/dist/cdn/{6ECRQVHY.js → BAKJLCYO.js} +2 -2
- package/dist/cdn/BJMGT6GV.js +19 -0
- package/dist/cdn/{HAEFC2SJ.js → BTOBEN7Q.js} +2 -2
- package/dist/cdn/BTTCBEPW.js +2 -0
- package/dist/cdn/{UZLQALHY.js → BVUCNXC5.js} +1 -1
- package/dist/cdn/{RFVZ7KCG.js → CAOMMQSY.js} +1 -1
- package/dist/cdn/{P4GFYBBO.js → CBYBFBD3.js} +2 -2
- package/dist/cdn/{VLLZ2FFU.js → CKUUYQLO.js} +2 -2
- package/dist/cdn/{MWYBF3F3.js → CSE6BHOJ.js} +2 -2
- package/dist/cdn/{7BCQMK6D.js → CX2HJ67C.js} +2 -2
- package/dist/cdn/EELMDCPV.js +2 -0
- package/dist/cdn/{7VUSIGEM.js → EGRRZTF6.js} +2 -2
- package/dist/cdn/EHYDAEGL.js +2 -0
- package/dist/cdn/{C4JT4S5E.js → EK3PM4L5.js} +2 -2
- package/dist/cdn/{PYGX4HN7.js → ENAEE4UU.js} +2 -2
- package/dist/cdn/EXMEB4X2.js +2 -0
- package/dist/cdn/{FG647IP6.js → EYGZJKVD.js} +2 -2
- package/dist/cdn/{4RDNI22D.js → FK2CVSXW.js} +5 -5
- package/dist/cdn/FLUI6GCU.js +2 -0
- package/dist/cdn/{ZU2FHVNK.js → FPH52WOH.js} +2 -2
- package/dist/cdn/FRYS2PZJ.js +2 -0
- package/dist/cdn/FSLQCZRN.js +2 -0
- package/dist/cdn/{PQ2DPOFM.js → FTTLFIBV.js} +2 -2
- package/dist/cdn/{NZSOJ726.js → FV6FHLYW.js} +2 -2
- package/dist/cdn/{WGO5SER7.js → G24MNC7D.js} +2 -2
- package/dist/cdn/{6OOZSZRJ.js → GN56DOYL.js} +2 -2
- package/dist/cdn/{ROQGPAR5.js → HIJGY4GU.js} +2 -2
- package/dist/cdn/{BL273EGZ.js → HMMYCSOK.js} +2 -2
- package/dist/cdn/{OE3GW5LE.js → HNTSDY3J.js} +2 -2
- package/dist/cdn/HQOK6DDH.js +2 -0
- package/dist/cdn/{K2R6XVK3.js → HV7MVIQV.js} +2 -2
- package/dist/cdn/I3SUE2TR.js +2 -0
- package/dist/cdn/{VAXH6RUQ.js → I72ST4JR.js} +2 -2
- package/dist/cdn/{FYZATVB3.js → IHUWQOMK.js} +2 -2
- package/dist/cdn/{J6A4AS7E.js → JMXXRRKQ.js} +2 -2
- package/dist/cdn/{5HBAJ57P.js → JPXEMNPR.js} +2 -2
- package/dist/cdn/{UHEYPSOR.js → JYNHWJUZ.js} +2 -2
- package/dist/cdn/KAX4A7SF.js +2 -0
- package/dist/cdn/{5ZFUGNRN.js → KBSXHSBX.js} +2 -2
- package/dist/cdn/{CCC6LBMY.js → KKCLHXHG.js} +1 -1
- package/dist/cdn/L2HLFWCV.js +72 -0
- package/dist/cdn/{LK7ZIQW6.js → L3BTURBA.js} +2 -2
- package/dist/cdn/{IBZ2NEAO.js → LBTGOMCT.js} +2 -2
- package/dist/cdn/{34O57OGV.js → LLY5A2E2.js} +1 -1
- package/dist/cdn/{Z5W4V7RC.js → LXIKAXUT.js} +2 -2
- package/dist/cdn/{AI6DYOKR.js → M2U456J5.js} +3 -3
- package/dist/cdn/{KWD2ECTM.js → M3KKORBG.js} +2 -2
- package/dist/cdn/M5B6X46F.js +2 -0
- package/dist/cdn/{SDWWUWAF.js → MZUDIQQH.js} +2 -2
- package/dist/cdn/{CEKOEHB3.js → NNPA3NLK.js} +2 -2
- package/dist/cdn/{MXTXJKFE.js → NPWLYHMU.js} +2 -2
- package/dist/cdn/NV7CL4S3.js +2 -0
- package/dist/cdn/{3UEKINYC.js → OALQBAZR.js} +2 -2
- package/dist/cdn/{RHYNE5OE.js → OF3TAARW.js} +1 -1
- package/dist/cdn/{F5NIRETW.js → P53TDER7.js} +2 -2
- package/dist/cdn/{SXM4NUT5.js → PJLGCS33.js} +2 -2
- package/dist/cdn/{BXQ4I5HB.js → PJPP6LOS.js} +3 -3
- package/dist/cdn/PUZ6RAFQ.js +2 -0
- package/dist/cdn/{IHP25JWI.js → QAX6UF4L.js} +2 -2
- package/dist/cdn/{JEBRN3EU.js → QTEPFTAU.js} +2 -2
- package/dist/cdn/ROS22KOA.js +2 -0
- package/dist/cdn/RPOFBIE7.js +2 -0
- package/dist/cdn/{COH3QXWG.js → S5GFNIHC.js} +3 -3
- package/dist/cdn/SBNNJ5WA.js +2 -0
- package/dist/cdn/SI22EJLC.js +2 -0
- package/dist/cdn/{5WYRJMBW.js → SJMAKF4P.js} +2 -2
- package/dist/cdn/{6P44KOKX.js → SKCUGZ7G.js} +2 -2
- package/dist/cdn/{V6HOUZPZ.js → SNG3WODY.js} +2 -2
- package/dist/cdn/{22KHSDJI.js → STOGCXJH.js} +2 -2
- package/dist/cdn/SUC2MIGE.js +2 -0
- package/dist/cdn/SXYKNDOF.js +2 -0
- package/dist/cdn/SZ2L5556.js +2 -0
- package/dist/cdn/{Y7XD7ZRD.js → T6W6F4TF.js} +2 -2
- package/dist/cdn/{WKTQVBFJ.js → TFAJNKBC.js} +2 -2
- package/dist/cdn/{R74ZHFA6.js → TLPZELG3.js} +1 -1
- package/dist/cdn/{2O4DON37.js → TNLFUXIB.js} +2 -2
- package/dist/cdn/{YEZ3AMNX.js → TXZQZR3I.js} +2 -2
- package/dist/cdn/UGIHS7OA.js +2 -0
- package/dist/cdn/{UDRKUVZP.js → UX457AQR.js} +2 -2
- package/dist/cdn/{ICBIUFK7.js → V266DJ5V.js} +2 -2
- package/dist/cdn/{FDOMMK2M.js → V4PJMCJZ.js} +1 -1
- package/dist/cdn/{7VAQUCBU.js → V52GSTOC.js} +2 -2
- package/dist/cdn/VGLBH473.js +2 -0
- package/dist/cdn/{WSWB3B7B.js → VHNTHPH7.js} +2 -2
- package/dist/cdn/{KITIP6J2.js → VK6CCPTG.js} +2 -2
- package/dist/cdn/{AOVJ34QE.js → VLPELJUS.js} +2 -2
- package/dist/cdn/VT5EWFH7.js +2 -0
- package/dist/cdn/{J6SZIQJA.js → VXLKTQ36.js} +2 -2
- package/dist/cdn/W54XYT2A.js +2 -0
- package/dist/cdn/{7SRLZQVC.js → X42ACC66.js} +2 -2
- package/dist/cdn/{CP5BVGJU.js → XNUWVZN7.js} +2 -2
- package/dist/cdn/XOTPSCNF.js +2 -0
- package/dist/cdn/XRVGYRXL.js +14 -0
- package/dist/cdn/{ANRQWYU2.js → XV7RMYLR.js} +2 -2
- package/dist/cdn/{5K5ZY267.js → XVJFPZTW.js} +2 -2
- package/dist/cdn/XZF7Y6B2.js +2 -0
- package/dist/cdn/Y4ZOB6UH.js +2 -0
- package/dist/cdn/Y6CV2NZR.js +2 -0
- package/dist/cdn/YMJKT5OK.js +2 -0
- package/dist/cdn/{655YIKL3.js → YOW3YKWR.js} +3 -3
- package/dist/cdn/{OKVLGJAG.js → ZA7ZU2F7.js} +2 -2
- package/dist/cdn/{EWLXNGKH.js → ZJWR4W2S.js} +16 -16
- package/dist/cdn/ZWIKFBOU.js +2 -0
- package/dist/cdn/ZY3JQCZQ.js +179 -0
- package/dist/cdn/agent-utils/index.js +2 -2
- package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +2 -2
- 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 +5 -0
- package/dist/chunks/SKILL2.js +5 -0
- package/dist/chunks/SKILL3.js +22 -0
- package/dist/chunks/SKILL4.js +5 -0
- package/dist/chunks/adapter.js +138 -141
- package/dist/chunks/aiFactory.js +94 -0
- package/dist/chunks/arcgisKnowledgeGraph.js +15 -14
- package/dist/chunks/arcgisToolRegistry.js +88 -0
- 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 +3 -3
- package/dist/chunks/converterUtils.js +1 -1
- package/dist/chunks/dataExplorationAgent.js +19 -0
- 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 +182 -269
- package/dist/chunks/graph.js +1 -1
- package/dist/chunks/helpAgent.js +34 -0
- 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 +92 -77
- 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 +27 -0
- package/dist/chunks/navigation_intent_prompt.js +1 -1
- package/dist/chunks/navigation_tool_prompt.js +1 -1
- package/dist/chunks/orchestrator.js +14 -13
- package/dist/chunks/requireAgentServices.js +11 -0
- package/dist/chunks/resolvePointGeometryFilter.js +12 -12
- package/dist/chunks/runtime.js +2 -2
- package/dist/chunks/slottableRequestUtils.js +1 -1
- package/dist/chunks/state.js +1 -1
- 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 +130 -212
- 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 +18 -7
- package/dist/components/arcgis-assistant-help-agent/customElement.js +4 -2
- 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 +2 -1
- package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +2 -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 +19 -8
- 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/orchestrator/models/types.d.ts +1 -0
- package/dist/orchestrator/providers/arcgis/aiFactory.d.ts +15 -0
- package/dist/orchestrator/registry/agentRegistry.d.ts +33 -0
- package/dist/orchestrator/types/types.d.ts +17 -0
- package/dist/utils/index.d.ts +13 -3
- package/dist/utils/index.js +707 -83
- package/package.json +9 -5
- package/dist/cdn/2EY3BQQX.js +0 -2
- package/dist/cdn/2NDBI2VA.js +0 -156
- package/dist/cdn/434TAA3J.js +0 -2
- package/dist/cdn/4OGR5QKS.js +0 -2
- package/dist/cdn/5X7EG7D2.js +0 -2
- package/dist/cdn/6FCU2KJP.js +0 -2
- package/dist/cdn/7BJ4JKLG.js +0 -2
- package/dist/cdn/7HS5KX3J.js +0 -2
- package/dist/cdn/7UUYJTKT.js +0 -2
- package/dist/cdn/7V6OSTFC.js +0 -2
- package/dist/cdn/7VYYQ7BT.js +0 -2
- package/dist/cdn/ACJTJLZN.js +0 -2
- package/dist/cdn/AKD5UOVX.js +0 -2
- package/dist/cdn/C7LGDNB3.js +0 -14
- package/dist/cdn/CGJINV7H.js +0 -2
- package/dist/cdn/CJMUJXPL.js +0 -2
- package/dist/cdn/D2SS763Z.js +0 -2
- package/dist/cdn/FJO4KNOZ.js +0 -2
- package/dist/cdn/G3SF6U2U.js +0 -2
- package/dist/cdn/G6CR7JVM.js +0 -22
- package/dist/cdn/GL7BPKBN.js +0 -2
- package/dist/cdn/JO5ETMPS.js +0 -2
- package/dist/cdn/NYJYRCGA.js +0 -2
- package/dist/cdn/PUHRBGKB.js +0 -2
- package/dist/cdn/Q57QWN5W.js +0 -2
- package/dist/cdn/QUKNPVAF.js +0 -2
- package/dist/cdn/RBE55SWR.js +0 -2
- package/dist/cdn/SWH6ZHD4.js +0 -18
- package/dist/cdn/SZ2QSSB3.js +0 -2
- package/dist/cdn/T4RIGOXB.js +0 -2
- package/dist/cdn/VXFQANGJ.js +0 -2
- package/dist/cdn/W4JQDITQ.js +0 -36
- package/dist/cdn/XX6GHMNR.js +0 -2
- package/dist/cdn/YLVJA4ZE.js +0 -2
- package/dist/cdn/ZOEMBHRF.js +0 -2
- package/dist/cdn/ZRVZMPFN.js +0 -2
- package/dist/chunks/dataExplorationGraph.js +0 -254
- package/dist/chunks/helpGraph.js +0 -133
- package/dist/chunks/navigationGraph.js +0 -290
- package/dist/chunks/toolCallResponse.js +0 -33
|
@@ -1,202 +1,115 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import { Annotation as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { ChatPromptTemplate as
|
|
6
|
-
import { s as
|
|
7
|
-
import { AIMessage as
|
|
8
|
-
import { createAgent as
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import ne from "@arcgis/core/config.js";
|
|
15
|
-
const P = {
|
|
16
|
-
advanced: "gpt-5.6-sol",
|
|
17
|
-
default: "gpt-5.6-terra",
|
|
18
|
-
fast: "gpt-5.6-luna"
|
|
19
|
-
}, k = {
|
|
20
|
-
default: "text-embedding-ada-002"
|
|
21
|
-
}, S = /* @__PURE__ */ new Map();
|
|
22
|
-
let M = null;
|
|
23
|
-
const se = () => {
|
|
24
|
-
const t = F.getDefault().helperServices;
|
|
25
|
-
if (!t?.aiModels?.url)
|
|
26
|
-
throw new Error("AI Models Service URL is not defined in the portal's helper services.");
|
|
27
|
-
return t.aiModels.url;
|
|
28
|
-
}, j = async (e) => {
|
|
29
|
-
const t = se();
|
|
30
|
-
S.size === 0 && (M || (M = (async () => {
|
|
31
|
-
try {
|
|
32
|
-
(await U(`${t}/models`)).data.models.forEach((s) => S.set(s.name, s));
|
|
33
|
-
} catch (n) {
|
|
34
|
-
throw M = null, n;
|
|
35
|
-
}
|
|
36
|
-
})()), await M);
|
|
37
|
-
const o = S.get(e);
|
|
38
|
-
if (!o)
|
|
39
|
-
throw new Error(`Model '${e}' is not available in the discovery service.`);
|
|
40
|
-
return o.endpoint;
|
|
41
|
-
}, oe = async (e = "default") => await j(P[e]), ie = async (e = "default") => await j(k[e]), Le = g.Root({
|
|
42
|
-
agentExecutionContext: g({
|
|
43
|
-
default: K,
|
|
44
|
-
reducer: V
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import { Annotation as m } from "@langchain/langgraph/web";
|
|
3
|
+
import { b as j, r as T, m as P, c as q } from "./baseAgentState.js";
|
|
4
|
+
import p, { z as s } from "zod";
|
|
5
|
+
import { ChatPromptTemplate as E, SystemMessagePromptTemplate as N } from "@langchain/core/prompts";
|
|
6
|
+
import { s as g } from "./index.js";
|
|
7
|
+
import { AIMessage as O, isAIMessage as $, isToolMessage as U } from "@langchain/core/messages";
|
|
8
|
+
import { createAgent as V, summarizationMiddleware as L, modelCallLimitMiddleware as z } from "langchain";
|
|
9
|
+
import { c as h, E as J } from "./aiFactory.js";
|
|
10
|
+
const ye = m.Root({
|
|
11
|
+
agentExecutionContext: m({
|
|
12
|
+
default: q,
|
|
13
|
+
reducer: P
|
|
45
14
|
}),
|
|
46
|
-
currentIntent:
|
|
15
|
+
currentIntent: m({
|
|
47
16
|
default: () => "none",
|
|
48
17
|
reducer: T
|
|
49
18
|
}),
|
|
50
|
-
routing:
|
|
19
|
+
routing: m({
|
|
51
20
|
default: () => ({ mode: "auto" }),
|
|
52
21
|
reducer: T
|
|
53
22
|
}),
|
|
54
|
-
lastExecutedAgent:
|
|
23
|
+
lastExecutedAgent: m({
|
|
55
24
|
default: () => "",
|
|
56
25
|
reducer: T
|
|
57
26
|
}),
|
|
58
|
-
requiresFollowUp:
|
|
27
|
+
requiresFollowUp: m({
|
|
59
28
|
default: () => !0,
|
|
60
29
|
reducer: T
|
|
61
30
|
}),
|
|
62
|
-
stepCount:
|
|
31
|
+
stepCount: m({
|
|
63
32
|
default: () => 0,
|
|
64
33
|
reducer: (e, t) => t ?? e + 1
|
|
65
34
|
}),
|
|
66
|
-
finalOutputMessage:
|
|
35
|
+
finalOutputMessage: m({
|
|
67
36
|
default: () => "",
|
|
68
|
-
reducer:
|
|
37
|
+
reducer: j
|
|
69
38
|
})
|
|
70
|
-
}),
|
|
39
|
+
}), W = (e) => {
|
|
71
40
|
if (!e || typeof e != "object" || !("services" in e))
|
|
72
41
|
return !1;
|
|
73
42
|
const t = e.services;
|
|
74
43
|
return !!t && typeof t == "object" && "agentRegistry" in t;
|
|
75
|
-
},
|
|
44
|
+
}, B = (e) => {
|
|
76
45
|
const t = e?.configurable;
|
|
77
|
-
return
|
|
78
|
-
},
|
|
46
|
+
return W(t) ? t : void 0;
|
|
47
|
+
}, G = (e, t, i) => {
|
|
79
48
|
const n = e[t];
|
|
80
|
-
return n ? typeof n == "function" ? n() : Promise.resolve(n) : new Promise((
|
|
81
|
-
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
|
|
49
|
+
return n ? typeof n == "function" ? n() : Promise.resolve(n) : new Promise((r, o) => {
|
|
50
|
+
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(o.bind(null, /* @__PURE__ */ new Error("Unknown variable dynamic import: " + t + (t.split("/").length !== i ? ". Note that variables only represent file names one level deep." : ""))));
|
|
82
51
|
});
|
|
83
|
-
},
|
|
84
|
-
const { agent: t, messages:
|
|
52
|
+
}, v = async (e) => (await G(/* @__PURE__ */ Object.assign({ "./field_descriptions_prompt.md": () => import("./field_descriptions_prompt.js"), "./intent_prompt.md": () => import("./intent_prompt.js"), "./layer_descriptions_prompt.md": () => import("./layer_descriptions_prompt.js") }), `./${e}.md`, 2)).default, H = async (e) => {
|
|
53
|
+
const { agent: t, messages: i, config: n } = e;
|
|
85
54
|
return { structuredResponse: (await t.invoke(
|
|
86
55
|
{
|
|
87
|
-
messages:
|
|
56
|
+
messages: i
|
|
88
57
|
},
|
|
89
58
|
n
|
|
90
59
|
)).structuredResponse };
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
abortSignal: e?.signal,
|
|
96
|
-
requestId: pe(),
|
|
97
|
-
requestSource: me(ne.applicationName)
|
|
98
|
-
};
|
|
99
|
-
}, ge = (e) => {
|
|
100
|
-
if (e == null || typeof e == "string" || e instanceof FormData || e instanceof HTMLFormElement)
|
|
101
|
-
return e;
|
|
102
|
-
if (e instanceof URLSearchParams)
|
|
103
|
-
return e.toString();
|
|
104
|
-
throw new TypeError(`Unsupported request body type: ${Object.prototype.toString.call(e)}`);
|
|
105
|
-
}, _ = async ({ config: e }) => {
|
|
106
|
-
const t = F.getDefault(), n = (await ee.getCredential(`${t.url}/sharing`))?.token;
|
|
107
|
-
return async (i, s) => {
|
|
108
|
-
const { conversationId: a, abortSignal: c, requestId: l, requestSource: p } = ue(e), d = new Headers(s?.headers);
|
|
109
|
-
for (const v of [...d.keys()]) {
|
|
110
|
-
const u = v.toLowerCase();
|
|
111
|
-
(u === "authorization" || u === "api-key" || u.startsWith("x-stainless-")) && d.delete(v);
|
|
112
|
-
}
|
|
113
|
-
n && n.length > 0 && d.set("X-Esri-Authorization", `Bearer ${n}`), t.isPortal || (p && p.length > 0 && d.set("X-Esri-Request-Source", p), a && a.length > 0 && d.set("X-Esri-Conversation-Id", a), l.length > 0 && d.set("X-Esri-Request-Id", l));
|
|
114
|
-
const b = c && s?.signal ? AbortSignal.any([c, s.signal]) : s?.signal ?? c;
|
|
115
|
-
return (await U(i instanceof Request ? i.url : i.toString(), {
|
|
116
|
-
body: ge(s?.body),
|
|
117
|
-
headers: Object.fromEntries(d),
|
|
118
|
-
responseType: "native",
|
|
119
|
-
signal: b
|
|
120
|
-
})).data;
|
|
121
|
-
};
|
|
122
|
-
}, w = async (e = {}) => {
|
|
123
|
-
const { modelTier: t = "default", config: o } = e, n = P[t], i = await oe(t);
|
|
124
|
-
return new Y({
|
|
125
|
-
modelName: n,
|
|
126
|
-
apiKey: "dummy-key",
|
|
127
|
-
useResponsesApi: !0,
|
|
128
|
-
// Prevent follow-up Responses API calls from replaying encrypted reasoning items the ArcGIS proxy cannot verify.
|
|
129
|
-
zdrEnabled: !0,
|
|
130
|
-
configuration: {
|
|
131
|
-
baseURL: i,
|
|
132
|
-
fetch: await _({ config: o })
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
}, ze = async (e = {}) => {
|
|
136
|
-
const { tier: t = "default", config: o } = e, n = k[t], i = await ie(t);
|
|
137
|
-
return new Z({
|
|
138
|
-
modelName: n,
|
|
139
|
-
apiKey: "dummy-key",
|
|
140
|
-
configuration: {
|
|
141
|
-
baseURL: i,
|
|
142
|
-
fetch: await _({ config: o })
|
|
143
|
-
},
|
|
144
|
-
batchSize: 2048,
|
|
145
|
-
maxConcurrency: 10
|
|
146
|
-
});
|
|
147
|
-
}, fe = r.object({
|
|
148
|
-
id: r.string().min(1),
|
|
149
|
-
name: r.string().min(1),
|
|
150
|
-
description: r.string().min(1)
|
|
60
|
+
}, K = s.object({
|
|
61
|
+
id: s.string().min(1),
|
|
62
|
+
name: s.string().min(1),
|
|
63
|
+
description: s.string().min(1)
|
|
151
64
|
});
|
|
152
|
-
|
|
153
|
-
const
|
|
154
|
-
const t = e.map((n) => n.id),
|
|
155
|
-
return
|
|
156
|
-
intent:
|
|
157
|
-
assignedTask:
|
|
158
|
-
requiresFollowUp:
|
|
65
|
+
s.array(K);
|
|
66
|
+
const I = (e) => JSON.stringify(e, null, 2), Q = (e) => {
|
|
67
|
+
const t = e.map((n) => n.id), i = s.enum(t);
|
|
68
|
+
return s.object({
|
|
69
|
+
intent: i.nullable(),
|
|
70
|
+
assignedTask: s.string().nullable(),
|
|
71
|
+
requiresFollowUp: s.boolean()
|
|
159
72
|
});
|
|
160
|
-
},
|
|
161
|
-
const
|
|
73
|
+
}, he = async (e, t) => {
|
|
74
|
+
const i = B(t);
|
|
162
75
|
if (t?.signal?.aborted)
|
|
163
|
-
return await
|
|
76
|
+
return await g({ text: "Run cancelled; skipping intent routing" }, t), {
|
|
164
77
|
...e,
|
|
165
78
|
currentIntent: "none",
|
|
166
79
|
finalOutputMessage: "Operation cancelled.",
|
|
167
80
|
requiresFollowUp: !1
|
|
168
81
|
};
|
|
169
82
|
try {
|
|
170
|
-
await
|
|
171
|
-
const
|
|
172
|
-
id:
|
|
173
|
-
name:
|
|
174
|
-
description:
|
|
83
|
+
await g({ text: "Asking LLM to route to an agent" }, t);
|
|
84
|
+
const r = i.services.agentRegistry?.list() ?? [], o = r.map(({ agent: u }) => ({
|
|
85
|
+
id: u.id,
|
|
86
|
+
name: u.name,
|
|
87
|
+
description: u.description
|
|
175
88
|
}));
|
|
176
|
-
if (!
|
|
177
|
-
return await
|
|
89
|
+
if (!o.length)
|
|
90
|
+
return await g({ text: "No agents registered; skipping intent detection" }, t), {
|
|
178
91
|
...e,
|
|
179
92
|
currentIntent: "none",
|
|
180
93
|
finalOutputMessage: "No agents registered; skipping intent detection."
|
|
181
94
|
};
|
|
182
|
-
const a = await
|
|
95
|
+
const a = await v("intent_prompt"), c = I(o), l = Q(o), d = {
|
|
183
96
|
registeredAgents: c,
|
|
184
|
-
priorSteps:
|
|
97
|
+
priorSteps: I(e.agentExecutionContext.priorSteps),
|
|
185
98
|
userRequest: e.agentExecutionContext.userRequest
|
|
186
|
-
},
|
|
187
|
-
model: await
|
|
99
|
+
}, k = await E.fromTemplate(a).format(d), D = V({
|
|
100
|
+
model: await h({
|
|
188
101
|
modelTier: "fast",
|
|
189
102
|
config: t
|
|
190
103
|
}),
|
|
191
104
|
tools: [],
|
|
192
|
-
systemPrompt:
|
|
105
|
+
systemPrompt: k,
|
|
193
106
|
responseFormat: l,
|
|
194
107
|
middleware: [
|
|
195
108
|
// Preserve recent conversation context while summarizing older messages
|
|
196
109
|
// to control token usage without losing important intent signals.
|
|
197
110
|
// The trigger and keep parameters can be tuned based on token limits and behavior.
|
|
198
|
-
|
|
199
|
-
model: await
|
|
111
|
+
L({
|
|
112
|
+
model: await h({
|
|
200
113
|
modelTier: "fast",
|
|
201
114
|
config: t
|
|
202
115
|
}),
|
|
@@ -205,36 +118,36 @@ const C = (e) => JSON.stringify(e, null, 2), he = (e) => {
|
|
|
205
118
|
}),
|
|
206
119
|
// Enforce no loop/retry.
|
|
207
120
|
// 1 usual LLM call and 1 optional summarization call.
|
|
208
|
-
|
|
121
|
+
z({ runLimit: 2 })
|
|
209
122
|
]
|
|
210
|
-
}), { structuredResponse:
|
|
211
|
-
agent:
|
|
123
|
+
}), { structuredResponse: R } = await H({
|
|
124
|
+
agent: D,
|
|
212
125
|
messages: e.agentExecutionContext.messages,
|
|
213
126
|
config: t
|
|
214
|
-
}),
|
|
215
|
-
|
|
216
|
-
), x =
|
|
127
|
+
}), f = l.parse(
|
|
128
|
+
R ?? { intent: null, assignedTask: null, requiresFollowUp: !1 }
|
|
129
|
+
), x = f.intent ?? "none", F = {
|
|
217
130
|
...e,
|
|
218
131
|
currentIntent: x,
|
|
219
|
-
requiresFollowUp:
|
|
132
|
+
requiresFollowUp: f.requiresFollowUp,
|
|
220
133
|
agentExecutionContext: {
|
|
221
134
|
...e.agentExecutionContext,
|
|
222
|
-
assignedTask:
|
|
135
|
+
assignedTask: f.assignedTask ?? ""
|
|
223
136
|
}
|
|
224
137
|
};
|
|
225
138
|
if (x === "none") {
|
|
226
|
-
const
|
|
139
|
+
const u = `I could not find an agent that can handle that request. I have access to the following agents: ${r.map(({ agent: _ }) => _.name).join(", ")}.
|
|
227
140
|
|
|
228
141
|
Please ask a question that can be answered by one of these agents.`;
|
|
229
|
-
return await
|
|
142
|
+
return await g({ text: "LLM did not identify a clear intent." }, t), {
|
|
230
143
|
...e,
|
|
231
144
|
currentIntent: x,
|
|
232
145
|
requiresFollowUp: !1,
|
|
233
|
-
finalOutputMessage:
|
|
146
|
+
finalOutputMessage: u,
|
|
234
147
|
agentExecutionContext: {
|
|
235
148
|
...e.agentExecutionContext,
|
|
236
149
|
assignedTask: "",
|
|
237
|
-
messages: [...e.agentExecutionContext.messages, new
|
|
150
|
+
messages: [...e.agentExecutionContext.messages, new O(u)],
|
|
238
151
|
priorSteps: [
|
|
239
152
|
...e.agentExecutionContext.priorSteps ?? [],
|
|
240
153
|
{
|
|
@@ -247,171 +160,171 @@ Please ask a question that can be answered by one of these agents.`;
|
|
|
247
160
|
}
|
|
248
161
|
};
|
|
249
162
|
}
|
|
250
|
-
return await
|
|
163
|
+
return await g(
|
|
251
164
|
{
|
|
252
165
|
text: `Agent picked: ${x}
|
|
253
|
-
Task Assigned: ${
|
|
254
|
-
Requires Follow-Up: ${
|
|
166
|
+
Task Assigned: ${f.assignedTask ?? ""}
|
|
167
|
+
Requires Follow-Up: ${f.requiresFollowUp}`
|
|
255
168
|
},
|
|
256
169
|
t
|
|
257
|
-
),
|
|
170
|
+
), F;
|
|
258
171
|
} catch (n) {
|
|
259
|
-
throw await
|
|
172
|
+
throw await g({ text: "Error during intent detection" }, t), new Error(`Error during intent detection: ${n instanceof Error ? n.message : String(n)}`);
|
|
260
173
|
}
|
|
261
|
-
},
|
|
174
|
+
}, X = "0.1", y = 1536, Y = "openai", Z = J.default, ee = `Name: {name}
|
|
262
175
|
Title: {title}
|
|
263
|
-
Description: {description}`,
|
|
176
|
+
Description: {description}`, te = `Name: {name}
|
|
264
177
|
Alias: {alias}
|
|
265
|
-
Description: {description}`,
|
|
266
|
-
schemaVersion:
|
|
267
|
-
modified:
|
|
268
|
-
embeddings:
|
|
269
|
-
modelProvider:
|
|
270
|
-
model:
|
|
271
|
-
dimensions:
|
|
272
|
-
templates:
|
|
273
|
-
layer:
|
|
274
|
-
field:
|
|
178
|
+
Description: {description}`, we = s.object({
|
|
179
|
+
schemaVersion: s.literal(X),
|
|
180
|
+
modified: s.number().int().nonnegative(),
|
|
181
|
+
embeddings: s.object({
|
|
182
|
+
modelProvider: s.literal(Y),
|
|
183
|
+
model: s.literal(Z),
|
|
184
|
+
dimensions: s.literal(y),
|
|
185
|
+
templates: s.object({
|
|
186
|
+
layer: s.string().default(ee),
|
|
187
|
+
field: s.string().default(te)
|
|
275
188
|
})
|
|
276
189
|
}),
|
|
277
|
-
layers:
|
|
278
|
-
|
|
279
|
-
id:
|
|
280
|
-
name:
|
|
281
|
-
title:
|
|
282
|
-
description:
|
|
283
|
-
vector:
|
|
190
|
+
layers: s.array(
|
|
191
|
+
s.object({
|
|
192
|
+
id: s.string().min(1),
|
|
193
|
+
name: s.string().min(1),
|
|
194
|
+
title: s.string().catch(""),
|
|
195
|
+
description: s.string().catch(""),
|
|
196
|
+
vector: s.array(s.number()).length(y, {
|
|
284
197
|
message: `Layer vector must be exactly ${y} dimensions`
|
|
285
198
|
}),
|
|
286
|
-
fields:
|
|
287
|
-
|
|
288
|
-
name:
|
|
289
|
-
alias:
|
|
290
|
-
description:
|
|
291
|
-
vector:
|
|
199
|
+
fields: s.array(
|
|
200
|
+
s.object({
|
|
201
|
+
name: s.string().min(1),
|
|
202
|
+
alias: s.string().catch(""),
|
|
203
|
+
description: s.string().catch(""),
|
|
204
|
+
vector: s.array(s.number()).length(y, {
|
|
292
205
|
message: `Field vector must be exactly ${y} dimensions`
|
|
293
206
|
})
|
|
294
207
|
})
|
|
295
208
|
)
|
|
296
209
|
})
|
|
297
210
|
).default([])
|
|
298
|
-
}),
|
|
211
|
+
}), ne = (e) => {
|
|
299
212
|
const t = /* @__PURE__ */ new Set();
|
|
300
213
|
for (const n of e)
|
|
301
|
-
if (
|
|
302
|
-
const
|
|
303
|
-
|
|
304
|
-
|
|
214
|
+
if ($(n)) {
|
|
215
|
+
const r = n;
|
|
216
|
+
r.tool_calls && r.tool_calls.length > 0 && r.tool_calls.forEach((o) => {
|
|
217
|
+
o.id && t.add(o.id);
|
|
305
218
|
});
|
|
306
219
|
}
|
|
307
220
|
return e.filter((n) => {
|
|
308
|
-
if (
|
|
309
|
-
const
|
|
310
|
-
return t.has(
|
|
221
|
+
if (U(n)) {
|
|
222
|
+
const r = n;
|
|
223
|
+
return t.has(r.tool_call_id);
|
|
311
224
|
}
|
|
312
225
|
return !0;
|
|
313
226
|
});
|
|
314
|
-
},
|
|
315
|
-
const
|
|
316
|
-
return
|
|
317
|
-
},
|
|
318
|
-
const { promptText: t, modelTier:
|
|
319
|
-
return
|
|
320
|
-
},
|
|
321
|
-
const { promptText: t, modelTier:
|
|
227
|
+
}, M = (e, t) => {
|
|
228
|
+
const i = N.fromTemplate(e);
|
|
229
|
+
return E.fromMessages([i, ...t]);
|
|
230
|
+
}, se = async (e) => {
|
|
231
|
+
const { promptText: t, modelTier: i, messages: n, config: r } = e, o = M(t, n ?? []), a = await h({ modelTier: i, config: r });
|
|
232
|
+
return o.pipe(a);
|
|
233
|
+
}, xe = async (e) => {
|
|
234
|
+
const { promptText: t, modelTier: i = "default", messages: n, inputVariables: r, config: o } = e, c = await (await se({
|
|
322
235
|
promptText: t,
|
|
323
|
-
modelTier:
|
|
236
|
+
modelTier: i,
|
|
324
237
|
messages: n,
|
|
325
|
-
config:
|
|
326
|
-
})).invoke(
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
const
|
|
330
|
-
return
|
|
331
|
-
},
|
|
332
|
-
const { promptText: t, modelTier:
|
|
333
|
-
return await
|
|
334
|
-
},
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
238
|
+
config: o
|
|
239
|
+
})).invoke(r ?? {}, o);
|
|
240
|
+
if (typeof c == "string")
|
|
241
|
+
return c;
|
|
242
|
+
const l = c.content;
|
|
243
|
+
return typeof l == "string" ? l : JSON.stringify(l);
|
|
244
|
+
}, A = async (e) => {
|
|
245
|
+
const { promptText: t, modelTier: i = "default", messages: n, inputVariables: r, schema: o, config: a } = e, c = M(t, n ?? []), d = (await h({ modelTier: i, config: a })).withStructuredOutput(o);
|
|
246
|
+
return await c.pipe(d).invoke(r ?? {}, a);
|
|
247
|
+
}, Te = async (e) => {
|
|
248
|
+
const { promptText: t, modelTier: i = "default", messages: n, inputVariables: r, tools: o, config: a } = e, c = o.length > 0 ? ne(n ?? []) : n ?? [], l = M(t, c), d = await h({ modelTier: i, config: a });
|
|
249
|
+
return await l.pipe(d.bindTools(o)).invoke(r ?? {}, a);
|
|
250
|
+
}, ie = p.object({
|
|
251
|
+
name: p.string(),
|
|
252
|
+
description: p.string(),
|
|
253
|
+
valueType: p.string(),
|
|
254
|
+
alias: p.string()
|
|
255
|
+
}), oe = p.object({
|
|
256
|
+
fields: p.array(ie)
|
|
257
|
+
}), C = (e, t) => e.getFieldAlias(t) ?? void 0, b = (e, t) => C(e, t.name) ?? t.alias ?? "", re = (e, t) => {
|
|
258
|
+
const i = C(e, t.name);
|
|
259
|
+
return !!(i && i !== (t.alias ?? ""));
|
|
344
260
|
};
|
|
345
|
-
function
|
|
346
|
-
const
|
|
261
|
+
function S(e, t) {
|
|
262
|
+
const i = /* @__PURE__ */ new Map();
|
|
347
263
|
for (const n of e.fields) {
|
|
348
|
-
const
|
|
264
|
+
const r = t.fields.find((l) => l.name === n.name), o = b(e, n), a = re(e, n), c = {
|
|
349
265
|
name: n.name,
|
|
350
266
|
type: n.type,
|
|
351
|
-
alias: a ?
|
|
352
|
-
description:
|
|
353
|
-
valueType:
|
|
267
|
+
alias: a ? o : r?.alias ?? o,
|
|
268
|
+
description: r?.description ?? n.description ?? "",
|
|
269
|
+
valueType: r?.valueType ?? n.valueType ?? "",
|
|
354
270
|
domain: e.getFieldDomain(n.name) ?? void 0
|
|
355
271
|
};
|
|
356
|
-
|
|
272
|
+
i.set(n.name, c);
|
|
357
273
|
}
|
|
358
|
-
return
|
|
274
|
+
return i;
|
|
359
275
|
}
|
|
360
|
-
const
|
|
361
|
-
const
|
|
362
|
-
const { name: c, type: l, description:
|
|
363
|
-
return [`Name: ${c}`, `Type: ${l}`, `Alias: ${
|
|
276
|
+
const be = async (e) => {
|
|
277
|
+
const i = await v("field_descriptions_prompt"), n = e.fields.filter((a) => !(b(e, a) && a.description)).map((a) => {
|
|
278
|
+
const { name: c, type: l, description: d } = a, w = b(e, a);
|
|
279
|
+
return [`Name: ${c}`, `Type: ${l}`, `Alias: ${w}`, `Description: ${d ?? "N/A"}`].join(", ");
|
|
364
280
|
}).join(`
|
|
365
281
|
`);
|
|
366
282
|
if (n.length === 0)
|
|
367
|
-
return
|
|
368
|
-
const
|
|
283
|
+
return S(e, { fields: [] });
|
|
284
|
+
const r = {
|
|
369
285
|
existingItemTitle: e.portalItem?.title,
|
|
370
286
|
existingItemDescription: e.portalItem?.description,
|
|
371
287
|
existingLayerTitle: e.title,
|
|
372
288
|
existingLayerDescription: e.portalItem?.description,
|
|
373
289
|
fieldInformation: n
|
|
374
|
-
},
|
|
375
|
-
promptText:
|
|
376
|
-
schema:
|
|
377
|
-
inputVariables:
|
|
290
|
+
}, o = await A({
|
|
291
|
+
promptText: i,
|
|
292
|
+
schema: oe,
|
|
293
|
+
inputVariables: r
|
|
378
294
|
});
|
|
379
|
-
return
|
|
380
|
-
},
|
|
381
|
-
title:
|
|
382
|
-
description:
|
|
383
|
-
name:
|
|
384
|
-
}),
|
|
385
|
-
const n = await
|
|
386
|
-
fieldInformation: JSON.stringify(
|
|
295
|
+
return S(e, o);
|
|
296
|
+
}, ae = p.object({
|
|
297
|
+
title: p.string(),
|
|
298
|
+
description: p.string(),
|
|
299
|
+
name: p.string().nullable()
|
|
300
|
+
}), ve = async (e, t) => {
|
|
301
|
+
const n = await v("layer_descriptions_prompt"), r = Array.from(t.values()), o = {
|
|
302
|
+
fieldInformation: JSON.stringify(r, null, 2),
|
|
387
303
|
existingLayerTitle: e.title,
|
|
388
304
|
existingLayerDescription: e.portalItem?.description,
|
|
389
305
|
existingLayerSnippet: e.portalItem?.snippet,
|
|
390
306
|
layerGeometryType: e.geometryType
|
|
391
307
|
};
|
|
392
|
-
return { ...await
|
|
308
|
+
return { ...await A({
|
|
393
309
|
promptText: n,
|
|
394
|
-
schema:
|
|
395
|
-
inputVariables:
|
|
310
|
+
schema: ae,
|
|
311
|
+
inputVariables: o
|
|
396
312
|
}), name: e.title ?? null };
|
|
397
313
|
};
|
|
398
314
|
export {
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
Ve as n,
|
|
415
|
-
ze as o,
|
|
416
|
-
ye as s
|
|
315
|
+
ye as D,
|
|
316
|
+
we as W,
|
|
317
|
+
xe as a,
|
|
318
|
+
he as b,
|
|
319
|
+
be as c,
|
|
320
|
+
ve as d,
|
|
321
|
+
y as e,
|
|
322
|
+
te as f,
|
|
323
|
+
B as g,
|
|
324
|
+
Y as h,
|
|
325
|
+
Te as i,
|
|
326
|
+
A as j,
|
|
327
|
+
ee as l,
|
|
328
|
+
Z as m,
|
|
329
|
+
X as s
|
|
417
330
|
};
|
package/dist/chunks/graph.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
2
|
import { StateGraph as G, END as p, START as k } from "@langchain/langgraph/web";
|
|
3
3
|
function b(t, c, o, s = {}) {
|
|
4
4
|
const { agent: h, entryNode: u, middlewares: l = [] } = s;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import { createSkillAgent as o } from "../agents/runtime/skill/createSkillAgent.js";
|
|
3
|
+
const d = (a, e) => {
|
|
4
|
+
const l = Array.from(a?.values() ?? []).map(({ fieldRegistry: r, layerItem: t }) => {
|
|
5
|
+
const s = Array.from(r.values(), ({ name: i }) => i);
|
|
6
|
+
return {
|
|
7
|
+
title: t.title,
|
|
8
|
+
description: t.description,
|
|
9
|
+
fields: s.slice(0, 10),
|
|
10
|
+
additionalFieldCount: Math.max(s.length - 10, 0)
|
|
11
|
+
};
|
|
12
|
+
}), n = (e?.list() ?? []).map(({ agent: { description: r, id: t, name: s } }) => ({
|
|
13
|
+
id: t,
|
|
14
|
+
name: s,
|
|
15
|
+
description: r
|
|
16
|
+
}));
|
|
17
|
+
return JSON.stringify({ layers: l, agents: n }, null, 2);
|
|
18
|
+
}, p = ({ config: a }) => {
|
|
19
|
+
const e = a?.configurable?.services;
|
|
20
|
+
return d(e?.layersAndFieldsRegistry, e?.agentRegistry);
|
|
21
|
+
}, c = [async () => (await import("./SKILL3.js")).default], m = o({
|
|
22
|
+
id: "help",
|
|
23
|
+
name: "Help Agent",
|
|
24
|
+
description: "Answers questions about the current map, its layers and fields, and available assistant capabilities. Use for general help, unsupported map actions, and unrelated requests that should be redirected to map-related questions.",
|
|
25
|
+
skillLoaders: c,
|
|
26
|
+
modelTier: "default",
|
|
27
|
+
systemPrompt: "You are an ArcGIS map help agent.",
|
|
28
|
+
runtimeContextLoader: p,
|
|
29
|
+
fallbackMessage: "Help request completed.",
|
|
30
|
+
failureMessage: "I couldn't complete the help request."
|
|
31
|
+
});
|
|
32
|
+
export {
|
|
33
|
+
m as H
|
|
34
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
2
|
const n = `## Who you are
|
|
3
3
|
|
|
4
4
|
You are a map assistant embedded inside a GIS application. You have no knowledge of history, science, people, events, cooking, or anything outside of this map and its data. You only know what is described in the Map Context below.
|
package/dist/chunks/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
2
|
import { dispatchCustomEvent as e } from "@langchain/core/callbacks/dispatch/web";
|
|
3
3
|
const n = async (s, a) => {
|
|
4
4
|
await e("trace_message", s, a);
|