@arcgis/ai-components 5.2.0-next.1 → 5.2.0-next.100
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 +4 -2
- package/README.md +2 -2
- package/dist/agent-utils/FunctionAgent.d.ts +2 -2
- package/dist/agent-utils/LLMAgent.d.ts +7 -4
- package/dist/agent-utils/LLMAgent.js +26 -24
- package/dist/agent-utils/WorkflowAgent.d.ts +2 -2
- package/dist/agent-utils/WorkflowAgent.js +14 -15
- package/dist/agent-utils/index.d.ts +177 -0
- package/dist/agent-utils/index.js +167 -0
- package/dist/agent-utils/middlewares/trace.d.ts +2 -0
- package/dist/agent-utils/middlewares/trace.js +25 -33
- package/dist/agent-utils/tools/FunctionTool.d.ts +2 -2
- package/dist/agent-utils/types.d.ts +37 -8
- package/dist/agent-utils/workflows/ConditionalWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/LoopWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/ParallelWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/RouterWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/SequentialWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/SwitchWorkflow.d.ts +2 -2
- package/dist/agentic-workflow/AgenticWorkflowRuntime.d.ts +24 -0
- package/dist/agentic-workflow/Edge.d.ts +16 -0
- package/dist/agentic-workflow/WebAgent.d.ts +39 -0
- package/dist/agentic-workflow/jsonTypes.d.ts +189 -0
- package/dist/agentic-workflow/nodes/AgentNode.d.ts +28 -0
- package/dist/agentic-workflow/nodes/BaseNode.d.ts +35 -0
- package/dist/agentic-workflow/nodes/EndMessageNode.d.ts +25 -0
- package/dist/agentic-workflow/nodes/StartNode.d.ts +21 -0
- package/dist/agentic-workflow/nodes/tools/ArcgisTool.d.ts +21 -0
- package/dist/agentic-workflow/types.d.ts +29 -0
- package/dist/agents/tools/filter/clearFilters/adapter.d.ts +8 -0
- package/dist/agents/tools/filter/clearFilters/adapter.js +22 -0
- package/dist/agents/tools/filter/resetMap/adapter.d.ts +8 -0
- package/dist/agents/tools/filter/resetMap/adapter.js +22 -0
- package/dist/agents/tools/filter/setFeatureEffect/adapter.d.ts +8 -0
- package/dist/agents/tools/filter/setFeatureEffect/adapter.js +121 -0
- package/dist/agents/tools/help/listFields/adapter.d.ts +11 -0
- package/dist/agents/tools/help/listFields/adapter.js +30 -0
- package/dist/agents/tools/navigation/goToAddress/adapter.d.ts +10 -0
- package/dist/agents/tools/navigation/goToAddress/adapter.js +60 -0
- package/dist/agents/tools/navigation/goToBookmark/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToBookmark/adapter.js +30 -0
- package/dist/agents/tools/navigation/goToFeatures/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToFeatures/adapter.js +50 -0
- package/dist/agents/tools/navigation/goToFullExtent/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToFullExtent/adapter.js +27 -0
- package/dist/agents/tools/navigation/goToHomeExtent/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToHomeExtent/adapter.js +24 -0
- package/dist/agents/tools/navigation/goToLayer/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToLayer/adapter.js +26 -0
- package/dist/agents/tools/navigation/goToScale/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToScale/adapter.js +21 -0
- package/dist/agents/tools/navigation/goToViewpoint/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToViewpoint/adapter.js +42 -0
- package/dist/agents/tools/navigation/goToZoom/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToZoom/adapter.js +21 -0
- package/dist/agents/tools/query/getAttribute/adapter.d.ts +8 -0
- package/dist/agents/tools/query/getAttribute/adapter.js +40 -0
- package/dist/agents/tools/query/getStatistics/adapter.d.ts +8 -0
- package/dist/agents/tools/query/getStatistics/adapter.js +157 -0
- package/dist/agents/tools/query/getTopFeatures/adapter.d.ts +8 -0
- package/dist/agents/tools/query/getTopFeatures/adapter.js +144 -0
- package/dist/agents/tools/query/queryFeatures/adapter.d.ts +8 -0
- package/dist/agents/tools/query/queryFeatures/adapter.js +130 -0
- package/dist/agents/tools/search/findRelevantFields/adapter.d.ts +8 -0
- package/dist/agents/tools/search/findRelevantFields/adapter.js +57 -0
- package/dist/agents/tools/search/findRelevantLayers/adapter.d.ts +8 -0
- package/dist/agents/tools/search/findRelevantLayers/adapter.js +38 -0
- package/dist/cdn/22KHSDJI.js +2 -0
- package/dist/cdn/2EY3BQQX.js +2 -0
- package/dist/cdn/2O4DON37.js +2 -0
- package/dist/cdn/34O57OGV.js +2 -0
- package/dist/cdn/{AMP6IALT.js → 3UEKINYC.js} +1 -1
- package/dist/cdn/434TAA3J.js +2 -0
- package/dist/cdn/4OGR5QKS.js +2 -0
- package/dist/cdn/5FL5BTTX.js +66 -0
- package/dist/cdn/5HBAJ57P.js +2 -0
- package/dist/cdn/5K5ZY267.js +2 -0
- package/dist/cdn/5MK44FNO.js +2 -0
- package/dist/cdn/5WYRJMBW.js +2 -0
- package/dist/cdn/5X7EG7D2.js +2 -0
- package/dist/cdn/5XZLS7UO.js +2 -0
- package/dist/cdn/5ZFUGNRN.js +2 -0
- package/dist/cdn/655YIKL3.js +11 -0
- package/dist/cdn/6ECRQVHY.js +2 -0
- package/dist/cdn/6OOZSZRJ.js +2 -0
- package/dist/cdn/{3PKJWIC3.js → 6P44KOKX.js} +1 -1
- package/dist/cdn/6YYPVU7H.js +3 -0
- package/dist/cdn/7BCQMK6D.js +2 -0
- package/dist/cdn/7SRLZQVC.js +5 -0
- package/dist/cdn/7V6OSTFC.js +2 -0
- package/dist/cdn/7VAQUCBU.js +9 -0
- package/dist/cdn/7VUSIGEM.js +2 -0
- package/dist/cdn/ACJTJLZN.js +2 -0
- package/dist/cdn/AI6DYOKR.js +181 -0
- package/dist/cdn/AKD5UOVX.js +2 -0
- package/dist/cdn/ANRQWYU2.js +2 -0
- package/dist/cdn/{ZS2TZ6BF.js → AOVJ34QE.js} +1 -1
- package/dist/cdn/APFZY4PI.js +2 -0
- package/dist/cdn/B2JDVLA6.js +2 -0
- package/dist/cdn/BE7BRJZD.js +2 -0
- package/dist/cdn/{FL4W4VYN.js → BL273EGZ.js} +17 -1
- package/dist/cdn/C4FEETBZ.js +2 -0
- package/dist/cdn/C4JT4S5E.js +2 -0
- package/dist/cdn/CCC6LBMY.js +2 -0
- package/dist/cdn/{5ZZGKP7N.js → CEKOEHB3.js} +1 -1
- package/dist/cdn/CJMUJXPL.js +2 -0
- package/dist/cdn/COH3QXWG.js +4 -0
- package/dist/cdn/CP5BVGJU.js +2 -0
- package/dist/cdn/D5UFYQHN.js +44 -0
- package/dist/cdn/EWLXNGKH.js +208 -0
- package/dist/cdn/EYOWRGDP.js +2 -0
- package/dist/cdn/F5NIRETW.js +2 -0
- package/dist/cdn/FDOMMK2M.js +2 -0
- package/dist/cdn/FG647IP6.js +2 -0
- package/dist/cdn/FJO4KNOZ.js +2 -0
- package/dist/cdn/FUF3NAU7.js +2 -0
- package/dist/cdn/FXP5UIQU.js +156 -0
- package/dist/cdn/{ZLXN7NMF.js → FYZATVB3.js} +10 -8
- package/dist/cdn/G2EGT3CF.js +6 -0
- package/dist/cdn/G3SF6U2U.js +2 -0
- package/dist/cdn/G7OMHU2B.js +2 -0
- package/dist/cdn/HAEFC2SJ.js +2 -0
- package/dist/cdn/HDACNIZF.js +2 -0
- package/dist/cdn/HHFNQR6Z.js +2 -0
- package/dist/cdn/HHUQXL3R.js +2 -0
- package/dist/cdn/IBZ2NEAO.js +2 -0
- package/dist/cdn/{FX7UOGHP.js → ICBIUFK7.js} +1 -1
- package/dist/cdn/ICQCK5D3.js +2 -0
- package/dist/cdn/IHP25JWI.js +99 -0
- package/dist/cdn/IJVMUS2L.js +14 -0
- package/dist/cdn/J6A4AS7E.js +22 -0
- package/dist/cdn/J6SZIQJA.js +2 -0
- package/dist/cdn/JCOA24UH.js +3 -0
- package/dist/cdn/{NE7E52YR.js → JEBRN3EU.js} +9 -3
- package/dist/cdn/JO5ETMPS.js +2 -0
- package/dist/cdn/K2R6XVK3.js +2 -0
- package/dist/cdn/KITIP6J2.js +2 -0
- package/dist/cdn/KWD2ECTM.js +2 -0
- package/dist/cdn/{4HU7735A.js → LAYVGCPL.js} +6 -4
- package/dist/cdn/{7RCQFLPP.js → LK7ZIQW6.js} +1 -1
- package/dist/cdn/LLUGJKAQ.js +2 -0
- package/dist/cdn/MWYBF3F3.js +66 -0
- package/dist/cdn/{V2P4AIGG.js → MXTXJKFE.js} +1 -1
- package/dist/cdn/MY47B3CE.js +3 -0
- package/dist/cdn/NEV6OZN3.js +71 -0
- package/dist/cdn/NNXISHCA.js +14 -0
- package/dist/cdn/NZSOJ726.js +2 -0
- package/dist/cdn/O4NVW75A.js +2 -0
- package/dist/cdn/OE3GW5LE.js +2 -0
- package/dist/cdn/{23EQTPO3.js → OKVLGJAG.js} +1 -1
- package/dist/cdn/ONQ6JSBJ.js +2 -0
- package/dist/cdn/OX64WOEL.js +22 -0
- package/dist/cdn/{LQ6R5YRN.js → PQ2DPOFM.js} +1 -1
- package/dist/cdn/PUHRBGKB.js +2 -0
- package/dist/cdn/Q57QWN5W.js +2 -0
- package/dist/cdn/QUKNPVAF.js +2 -0
- package/dist/cdn/R2PQVY4O.js +2 -0
- package/dist/cdn/R74ZHFA6.js +2 -0
- package/dist/cdn/RBE55SWR.js +2 -0
- package/dist/cdn/RHYNE5OE.js +2 -0
- package/dist/cdn/RLEHNAIA.js +2 -0
- package/dist/cdn/RVSTAUQS.js +2 -0
- package/dist/cdn/{X2ZDYHCG.js → SDWWUWAF.js} +10 -5
- package/dist/cdn/SXM4NUT5.js +2 -0
- package/dist/cdn/SZ2QSSB3.js +2 -0
- package/dist/cdn/T4RIGOXB.js +2 -0
- package/dist/cdn/TCH5I5LS.js +2 -0
- package/dist/cdn/TEPP7YPR.js +2 -0
- package/dist/cdn/TMVF2W5N.js +36 -0
- package/dist/cdn/TPULIO6I.js +34 -0
- package/dist/cdn/UDRKUVZP.js +2 -0
- package/dist/cdn/{6YMR4QSD.js → UHEYPSOR.js} +1 -1
- package/dist/cdn/UHNVDALX.js +18 -0
- package/dist/cdn/UZLQALHY.js +2 -0
- package/dist/cdn/V6HOUZPZ.js +2 -0
- package/dist/cdn/VAXH6RUQ.js +134 -0
- package/dist/cdn/VLLZ2FFU.js +2 -0
- package/dist/cdn/VOKXKU7M.js +56 -0
- package/dist/cdn/VXFQANGJ.js +2 -0
- package/dist/cdn/WGO5SER7.js +6 -0
- package/dist/cdn/WJXXOKGA.js +9 -0
- package/dist/cdn/WKTQVBFJ.js +2 -0
- package/dist/cdn/{DHOVCT6R.js → WSWB3B7B.js} +1 -1
- package/dist/cdn/XX6GHMNR.js +2 -0
- package/dist/cdn/Y7XD7ZRD.js +2 -0
- package/dist/cdn/YEZ3AMNX.js +2 -0
- package/dist/cdn/YLVJA4ZE.js +2 -0
- package/dist/cdn/Z5HWPSZN.js +2 -0
- package/dist/cdn/Z5W4V7RC.js +2 -0
- package/dist/cdn/ZDV4K4WG.js +2 -0
- package/dist/cdn/ZOEMBHRF.js +2 -0
- package/dist/cdn/ZRVZMPFN.js +2 -0
- package/dist/cdn/{ZTBA5PM7.js → ZU2FHVNK.js} +1 -1
- 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.en.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/assistant-message/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/assistant-message-loading/t9n/messages.en.json +1 -0
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/adapter.js +1299 -2113
- package/dist/chunks/arcgisKnowledgeGraph.js +128 -72
- package/dist/chunks/arcgis_knowledge_current_lc_context.js +19 -2
- package/dist/chunks/arcgis_knowledge_current_map_context.js +31 -2
- package/dist/chunks/arcgis_knowledge_cypher_query_prompt.js +102 -0
- package/dist/chunks/arcgis_knowledge_summarize_result_prompt.js +116 -27
- package/dist/chunks/baseAgentState.js +58 -0
- package/dist/chunks/converterUtils.js +66 -41
- package/dist/chunks/dataExplorationGraph.js +135 -179
- package/dist/chunks/data_explore_query_prompt.js +9 -4
- package/dist/chunks/fetchAgentContext.js +13 -0
- package/dist/chunks/fetchService.js +10 -0
- package/dist/chunks/fieldStatistics.js +79 -0
- package/dist/chunks/formatFeatureAttributes.js +132 -0
- package/dist/chunks/generateLayerDescriptions.js +250 -246
- package/dist/chunks/helpGraph.js +35 -25
- package/dist/chunks/help_prompt.js +34 -17
- package/dist/chunks/index.js +11 -0
- package/dist/chunks/intent_prompt.js +16 -0
- package/dist/chunks/layerStylingGraph.js +37 -31
- package/dist/chunks/mergeWhereClauses.js +15 -0
- package/dist/chunks/navigationGraph.js +135 -111
- package/dist/chunks/navigation_intent_prompt.js +8 -2
- package/dist/chunks/orchestrator.js +530 -280
- package/dist/chunks/resolvePointGeometryFilter.js +92 -0
- package/dist/chunks/slottableRequestUtils.js +3 -7
- package/dist/chunks/state.js +21 -27
- package/dist/chunks/summarize_query_response_prompt.js +9 -7
- package/dist/chunks/toolCallResponse.js +14 -10
- package/dist/chunks/utils2.js +11 -11
- package/dist/components/arcgis-assistant/customElement.d.ts +96 -0
- package/dist/components/arcgis-assistant/customElement.js +398 -149
- package/dist/components/arcgis-assistant/index.js +2 -3
- package/dist/components/arcgis-assistant/types.d.ts +14 -1
- package/dist/components/arcgis-assistant-agent/customElement.d.ts +13 -1
- package/dist/components/arcgis-assistant-agent/customElement.js +614 -10
- package/dist/components/arcgis-assistant-chat/customElement.d.ts +8 -2
- package/dist/components/arcgis-assistant-chat/customElement.js +23 -18
- package/dist/components/arcgis-assistant-chat-entry/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-chat-entry/customElement.js +25 -18
- package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +20 -4
- package/dist/components/arcgis-assistant-help-agent/customElement.js +29 -7
- package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +8 -1
- package/dist/components/arcgis-assistant-interrupt/customElement.js +17 -14
- package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +24 -0
- package/dist/components/arcgis-assistant-interrupt-preview/index.js +2 -0
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.d.ts +7 -7
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +40 -16
- package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +30 -7
- package/dist/components/arcgis-assistant-message/customElement.d.ts +26 -0
- package/dist/components/arcgis-assistant-message/customElement.js +29 -26
- package/dist/components/arcgis-assistant-message/index.d.ts +1 -0
- package/dist/components/arcgis-assistant-message/index.js +2 -0
- package/dist/components/arcgis-assistant-message-block/customElement.d.ts +1 -1
- package/dist/components/arcgis-assistant-message-block/customElement.js +18 -11
- package/dist/components/arcgis-assistant-message-block/index.js +1 -0
- package/dist/components/arcgis-assistant-message-feedback/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-message-footer/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +11 -1
- package/dist/components/arcgis-assistant-message-loading/customElement.js +8 -7
- package/dist/components/arcgis-assistant-message-loading/index.js +1 -0
- package/dist/components/arcgis-assistant-message-log/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-message-read-aloud/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-message-text/customElement.d.ts +5 -1
- package/dist/components/arcgis-assistant-message-text/customElement.js +12 -12
- package/dist/components/arcgis-assistant-navigation-agent/customElement.js +18 -4
- package/dist/components/arcgis-assistant-speech-input/customElement.d.ts +6 -1
- package/dist/components/arcgis-assistant-speech-input/customElement.js +34 -52
- package/dist/components/arcgis-assistant-suggested-prompts/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-suggested-prompts/customElement.js +8 -8
- package/dist/components/arcgis-assistant-user-message/customElement.d.ts +6 -1
- package/dist/components/arcgis-assistant-user-message/customElement.js +15 -10
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/loader.js +9 -8
- package/dist/oauth-callback.html +1 -1
- package/dist/orchestrator/orchestrator/orchestratorEvents.d.ts +78 -0
- package/dist/types/lumina.d.ts +14 -7
- package/dist/types/preact.d.ts +15 -7
- package/dist/types/react.d.ts +16 -7
- package/dist/types/stencil.d.ts +16 -9
- package/dist/utils/index.d.ts +135 -65
- package/dist/utils/index.js +55 -50
- package/package.json +32 -12
- package/dist/cdn/2AXF774U.js +0 -2
- package/dist/cdn/462JBSEV.js +0 -422
- package/dist/cdn/5QAHYX7Y.js +0 -5
- package/dist/cdn/7BCR6TUO.js +0 -2
- package/dist/cdn/7GH7VSB2.js +0 -2
- package/dist/cdn/7PLV4QH6.js +0 -2
- package/dist/cdn/AO7BQHKC.js +0 -2
- package/dist/cdn/AXDZBBNL.js +0 -45
- package/dist/cdn/DDLZOMUY.js +0 -2
- package/dist/cdn/F2AHA4GB.js +0 -54
- package/dist/cdn/FHVXO2WG.js +0 -166
- package/dist/cdn/FX5JFRDL.js +0 -2
- package/dist/cdn/GSEPHN3A.js +0 -106
- package/dist/cdn/H7422XUG.js +0 -2
- package/dist/cdn/HB5A5R2E.js +0 -2
- package/dist/cdn/JY6LLOUJ.js +0 -22
- package/dist/cdn/KMQ3SP4I.js +0 -5
- package/dist/cdn/MDVYQQUG.js +0 -14
- package/dist/cdn/MH5RPXHM.js +0 -2
- package/dist/cdn/NAUXSHIE.js +0 -72
- package/dist/cdn/NVI3I46B.js +0 -2
- package/dist/cdn/OAVEHGB6.js +0 -2
- package/dist/cdn/OH64RMOR.js +0 -4
- package/dist/cdn/ON2V5XI2.js +0 -3
- package/dist/cdn/P6OPJQMC.js +0 -3
- package/dist/cdn/QR54T33D.js +0 -2
- package/dist/cdn/RVOAPUBN.js +0 -2
- package/dist/cdn/S6W6HV4T.js +0 -36
- package/dist/cdn/SXDLXCIM.js +0 -2
- package/dist/cdn/USMDJUFS.js +0 -2
- package/dist/cdn/V5YEZSRY.js +0 -16
- package/dist/cdn/Y333DGV6.js +0 -2
- package/dist/cdn/YIMNOUTF.js +0 -2
- package/dist/cdn/YY2SBO3V.js +0 -2
|
@@ -1,230 +1,237 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { Annotation as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
import { Annotation as g } from "@langchain/langgraph/web";
|
|
3
|
+
import { d as z, r as T, m as V, c as K } from "./baseAgentState.js";
|
|
4
|
+
import m, { z as r } from "zod";
|
|
5
|
+
import { ChatPromptTemplate as q, SystemMessagePromptTemplate as B } from "@langchain/core/prompts";
|
|
6
|
+
import { s as h } from "./index.js";
|
|
7
|
+
import { AIMessage as H, isAIMessage as W, isToolMessage as X } from "@langchain/core/messages";
|
|
8
|
+
import { createAgent as G, summarizationMiddleware as J, modelCallLimitMiddleware as Q } from "langchain";
|
|
9
|
+
import { ChatOpenAI as Y, OpenAIEmbeddings as Z } from "@langchain/openai";
|
|
10
|
+
import F from "@arcgis/core/portal/Portal.js";
|
|
11
|
+
import U from "@arcgis/core/request.js";
|
|
12
|
+
import ee from "@arcgis/core/identity/IdentityManager.js";
|
|
13
|
+
import { generateGuid as te } from "@arcgis/toolkit/string";
|
|
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"
|
|
15
19
|
}, k = {
|
|
16
20
|
default: "text-embedding-ada-002"
|
|
17
|
-
},
|
|
18
|
-
let
|
|
19
|
-
const
|
|
20
|
-
const t =
|
|
21
|
+
}, S = /* @__PURE__ */ new Map();
|
|
22
|
+
let M = null;
|
|
23
|
+
const se = () => {
|
|
24
|
+
const t = F.getDefault().helperServices;
|
|
21
25
|
if (!t?.aiModels?.url)
|
|
22
26
|
throw new Error("AI Models Service URL is not defined in the portal's helper services.");
|
|
23
27
|
return t.aiModels.url;
|
|
24
|
-
},
|
|
25
|
-
const t =
|
|
26
|
-
|
|
28
|
+
}, j = async (e) => {
|
|
29
|
+
const t = se();
|
|
30
|
+
S.size === 0 && (M || (M = (async () => {
|
|
27
31
|
try {
|
|
28
|
-
|
|
29
|
-
if (!n.ok)
|
|
30
|
-
throw new Error("Failed to fetch AI service discovery data.");
|
|
31
|
-
(await n.json()).models.forEach((o) => M.set(o.name, o));
|
|
32
|
+
(await U(`${t}/models`)).data.models.forEach((s) => S.set(s.name, s));
|
|
32
33
|
} catch (n) {
|
|
33
|
-
throw
|
|
34
|
+
throw M = null, n;
|
|
34
35
|
}
|
|
35
|
-
})()), await
|
|
36
|
-
const
|
|
37
|
-
if (!
|
|
36
|
+
})()), await M);
|
|
37
|
+
const o = S.get(e);
|
|
38
|
+
if (!o)
|
|
38
39
|
throw new Error(`Model '${e}' is not available in the discovery service.`);
|
|
39
|
-
return
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const s = typeof t == "string" ? t.trim() : "";
|
|
45
|
-
if (!s)
|
|
46
|
-
return e;
|
|
47
|
-
const n = e.trim();
|
|
48
|
-
if (!n)
|
|
49
|
-
return s;
|
|
50
|
-
if (n === s)
|
|
51
|
-
return e;
|
|
52
|
-
const i = n.split(`
|
|
53
|
-
|
|
54
|
-
`);
|
|
55
|
-
return i[i.length - 1]?.trim() === s ? e : `${e}
|
|
56
|
-
|
|
57
|
-
${s}`;
|
|
58
|
-
}, j = () => ({
|
|
59
|
-
userRequest: "",
|
|
60
|
-
assignedTask: "",
|
|
61
|
-
messages: [],
|
|
62
|
-
priorSteps: [],
|
|
63
|
-
sharedState: {}
|
|
64
|
-
}), ne = () => ({
|
|
65
|
-
agentExecutionContext: d({
|
|
66
|
-
reducer: q,
|
|
67
|
-
default: j
|
|
68
|
-
}),
|
|
69
|
-
outputMessage: d({
|
|
70
|
-
reducer: $,
|
|
71
|
-
default: () => ""
|
|
72
|
-
}),
|
|
73
|
-
summary: d({
|
|
74
|
-
reducer: u,
|
|
75
|
-
default: () => ""
|
|
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
|
|
76
45
|
}),
|
|
77
|
-
|
|
78
|
-
reducer: u
|
|
79
|
-
})
|
|
80
|
-
}), Ee = () => ({
|
|
81
|
-
...ne(),
|
|
82
|
-
sharedStatePatch: d({
|
|
83
|
-
reducer: u
|
|
84
|
-
})
|
|
85
|
-
}), Ie = d.Root({
|
|
86
|
-
agentExecutionContext: d({
|
|
87
|
-
default: j,
|
|
88
|
-
reducer: q
|
|
89
|
-
}),
|
|
90
|
-
currentIntent: d({
|
|
46
|
+
currentIntent: g({
|
|
91
47
|
default: () => "none",
|
|
92
|
-
reducer:
|
|
48
|
+
reducer: T
|
|
93
49
|
}),
|
|
94
|
-
|
|
50
|
+
routing: g({
|
|
51
|
+
default: () => ({ mode: "auto" }),
|
|
52
|
+
reducer: T
|
|
53
|
+
}),
|
|
54
|
+
lastExecutedAgent: g({
|
|
95
55
|
default: () => "",
|
|
96
|
-
reducer:
|
|
56
|
+
reducer: T
|
|
97
57
|
}),
|
|
98
|
-
requiresFollowUp:
|
|
58
|
+
requiresFollowUp: g({
|
|
99
59
|
default: () => !0,
|
|
100
|
-
reducer:
|
|
60
|
+
reducer: T
|
|
101
61
|
}),
|
|
102
|
-
stepCount:
|
|
62
|
+
stepCount: g({
|
|
103
63
|
default: () => 0,
|
|
104
64
|
reducer: (e, t) => t ?? e + 1
|
|
105
65
|
}),
|
|
106
|
-
finalOutputMessage:
|
|
66
|
+
finalOutputMessage: g({
|
|
107
67
|
default: () => "",
|
|
108
|
-
reducer:
|
|
68
|
+
reducer: z
|
|
109
69
|
})
|
|
110
|
-
}),
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
70
|
+
}), re = (e) => {
|
|
71
|
+
if (!e || typeof e != "object" || !("services" in e))
|
|
72
|
+
return !1;
|
|
73
|
+
const t = e.services;
|
|
74
|
+
return !!t && typeof t == "object" && "agentRegistry" in t;
|
|
75
|
+
}, ae = (e) => {
|
|
76
|
+
const t = e?.configurable;
|
|
77
|
+
return re(t) ? t : void 0;
|
|
78
|
+
}, ce = (e, t, o) => {
|
|
115
79
|
const n = e[t];
|
|
116
|
-
return n ? typeof n == "function" ? n() : Promise.resolve(n) : new Promise((i,
|
|
117
|
-
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
|
|
80
|
+
return n ? typeof n == "function" ? n() : Promise.resolve(n) : new Promise((i, s) => {
|
|
81
|
+
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(s.bind(null, /* @__PURE__ */ new Error("Unknown variable dynamic import: " + t + (t.split("/").length !== o ? ". Note that variables only represent file names one level deep." : ""))));
|
|
118
82
|
});
|
|
119
|
-
},
|
|
120
|
-
const { agent: t, messages:
|
|
83
|
+
}, E = async (e) => (await ce(/* @__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, le = async (e) => {
|
|
84
|
+
const { agent: t, messages: o, config: n } = e;
|
|
121
85
|
return { structuredResponse: (await t.invoke(
|
|
122
86
|
{
|
|
123
|
-
messages:
|
|
87
|
+
messages: o
|
|
124
88
|
},
|
|
125
89
|
n
|
|
126
90
|
)).structuredResponse };
|
|
127
|
-
},
|
|
128
|
-
const
|
|
129
|
-
return
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
91
|
+
}, de = (e) => typeof e == "string" && e.length > 0 ? e : void 0, pe = () => te(), me = (e) => typeof e != "string" || e.trim().length === 0 ? "MapsSDK" : `MapsSDK - ${e.trim()}`, ue = (e) => {
|
|
92
|
+
const t = e?.configurable;
|
|
93
|
+
return {
|
|
94
|
+
conversationId: de(t?.thread_id),
|
|
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,
|
|
137
126
|
apiKey: "dummy-key",
|
|
138
|
-
// 5-mini does not support temperature parameter
|
|
139
|
-
...e !== "default" && { temperature: t },
|
|
140
127
|
configuration: {
|
|
141
|
-
baseURL:
|
|
142
|
-
fetch:
|
|
128
|
+
baseURL: i,
|
|
129
|
+
fetch: await _({ config: o })
|
|
143
130
|
}
|
|
144
131
|
});
|
|
145
|
-
},
|
|
146
|
-
const t =
|
|
147
|
-
return new
|
|
132
|
+
}, ze = async (e = {}) => {
|
|
133
|
+
const { tier: t = "default", config: o } = e, n = k[t], i = await ie(t);
|
|
134
|
+
return new Z({
|
|
148
135
|
modelName: n,
|
|
149
136
|
apiKey: "dummy-key",
|
|
150
137
|
configuration: {
|
|
151
138
|
baseURL: i,
|
|
152
|
-
fetch:
|
|
139
|
+
fetch: await _({ config: o })
|
|
153
140
|
},
|
|
154
141
|
batchSize: 2048,
|
|
155
142
|
maxConcurrency: 10
|
|
156
143
|
});
|
|
157
|
-
},
|
|
144
|
+
}, fe = r.object({
|
|
158
145
|
id: r.string().min(1),
|
|
159
146
|
name: r.string().min(1),
|
|
160
147
|
description: r.string().min(1)
|
|
161
148
|
});
|
|
162
|
-
r.array(
|
|
163
|
-
const
|
|
164
|
-
const t = e.map((n) => n.id),
|
|
149
|
+
r.array(fe);
|
|
150
|
+
const A = (e) => JSON.stringify(e, null, 2), he = (e) => {
|
|
151
|
+
const t = e.map((n) => n.id), o = r.enum(t);
|
|
165
152
|
return r.object({
|
|
166
|
-
intent:
|
|
153
|
+
intent: o.nullable(),
|
|
167
154
|
assignedTask: r.string().nullable(),
|
|
168
155
|
requiresFollowUp: r.boolean()
|
|
169
156
|
});
|
|
170
|
-
},
|
|
157
|
+
}, Ve = async (e, t) => {
|
|
158
|
+
const o = ae(t);
|
|
159
|
+
if (t?.signal?.aborted)
|
|
160
|
+
return await h({ text: "Run cancelled; skipping intent routing" }, t), {
|
|
161
|
+
...e,
|
|
162
|
+
currentIntent: "none",
|
|
163
|
+
finalOutputMessage: "Operation cancelled.",
|
|
164
|
+
requiresFollowUp: !1
|
|
165
|
+
};
|
|
171
166
|
try {
|
|
172
|
-
await
|
|
173
|
-
const i =
|
|
174
|
-
id:
|
|
175
|
-
name:
|
|
176
|
-
description:
|
|
167
|
+
await h({ text: "Asking LLM to route to an agent" }, t);
|
|
168
|
+
const i = o.services.agentRegistry?.list() ?? [], s = i.map(({ agent: f }) => ({
|
|
169
|
+
id: f.id,
|
|
170
|
+
name: f.name,
|
|
171
|
+
description: f.description
|
|
177
172
|
}));
|
|
178
|
-
if (!
|
|
179
|
-
return await
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
173
|
+
if (!s.length)
|
|
174
|
+
return await h({ text: "No agents registered; skipping intent detection" }, t), {
|
|
175
|
+
...e,
|
|
176
|
+
currentIntent: "none",
|
|
177
|
+
finalOutputMessage: "No agents registered; skipping intent detection."
|
|
178
|
+
};
|
|
179
|
+
const a = await E("intent_prompt"), c = A(s), l = he(s), p = {
|
|
180
|
+
registeredAgents: c,
|
|
181
|
+
priorSteps: A(e.agentExecutionContext.priorSteps),
|
|
183
182
|
userRequest: e.agentExecutionContext.userRequest
|
|
184
|
-
},
|
|
185
|
-
model: await
|
|
183
|
+
}, b = await q.fromTemplate(a).format(p), C = G({
|
|
184
|
+
model: await w({
|
|
185
|
+
modelTier: "fast",
|
|
186
|
+
config: t
|
|
187
|
+
}),
|
|
186
188
|
tools: [],
|
|
187
|
-
systemPrompt:
|
|
188
|
-
|
|
189
|
-
responseFormat: c,
|
|
189
|
+
systemPrompt: b,
|
|
190
|
+
responseFormat: l,
|
|
190
191
|
middleware: [
|
|
191
192
|
// Preserve recent conversation context while summarizing older messages
|
|
192
193
|
// to control token usage without losing important intent signals.
|
|
193
194
|
// The trigger and keep parameters can be tuned based on token limits and behavior.
|
|
194
|
-
|
|
195
|
-
model: await
|
|
195
|
+
J({
|
|
196
|
+
model: await w({
|
|
197
|
+
modelTier: "fast",
|
|
198
|
+
config: t
|
|
199
|
+
}),
|
|
196
200
|
trigger: { tokens: 4e3 },
|
|
197
201
|
keep: { messages: 6 }
|
|
198
202
|
}),
|
|
199
203
|
// Enforce no loop/retry.
|
|
200
204
|
// 1 usual LLM call and 1 optional summarization call.
|
|
201
|
-
|
|
205
|
+
Q({ runLimit: 2 })
|
|
202
206
|
]
|
|
203
|
-
}), { structuredResponse:
|
|
204
|
-
agent:
|
|
207
|
+
}), { structuredResponse: v } = await le({
|
|
208
|
+
agent: C,
|
|
205
209
|
messages: e.agentExecutionContext.messages,
|
|
206
210
|
config: t
|
|
207
|
-
}),
|
|
208
|
-
|
|
209
|
-
),
|
|
211
|
+
}), u = l.parse(
|
|
212
|
+
v ?? { intent: null, assignedTask: null, requiresFollowUp: !1 }
|
|
213
|
+
), x = u.intent ?? "none", N = {
|
|
210
214
|
...e,
|
|
211
|
-
currentIntent:
|
|
212
|
-
requiresFollowUp:
|
|
215
|
+
currentIntent: x,
|
|
216
|
+
requiresFollowUp: u.requiresFollowUp,
|
|
213
217
|
agentExecutionContext: {
|
|
214
218
|
...e.agentExecutionContext,
|
|
215
|
-
assignedTask:
|
|
219
|
+
assignedTask: u.assignedTask ?? ""
|
|
216
220
|
}
|
|
217
221
|
};
|
|
218
|
-
if (
|
|
219
|
-
const
|
|
220
|
-
|
|
222
|
+
if (x === "none") {
|
|
223
|
+
const f = `I could not find an agent that can handle that request. I have access to the following agents: ${i.map(({ agent: L }) => L.name).join(", ")}.
|
|
224
|
+
|
|
225
|
+
Please ask a question that can be answered by one of these agents.`;
|
|
226
|
+
return await h({ text: "LLM did not identify a clear intent." }, t), {
|
|
221
227
|
...e,
|
|
222
|
-
currentIntent:
|
|
228
|
+
currentIntent: x,
|
|
223
229
|
requiresFollowUp: !1,
|
|
230
|
+
finalOutputMessage: f,
|
|
224
231
|
agentExecutionContext: {
|
|
225
232
|
...e.agentExecutionContext,
|
|
226
233
|
assignedTask: "",
|
|
227
|
-
messages: [...e.agentExecutionContext.messages, new
|
|
234
|
+
messages: [...e.agentExecutionContext.messages, new H(f)],
|
|
228
235
|
priorSteps: [
|
|
229
236
|
...e.agentExecutionContext.priorSteps ?? [],
|
|
230
237
|
{
|
|
@@ -237,31 +244,31 @@ const D = (e) => JSON.stringify(e, null, 2), oe = (e) => {
|
|
|
237
244
|
}
|
|
238
245
|
};
|
|
239
246
|
}
|
|
240
|
-
return await
|
|
247
|
+
return await h(
|
|
241
248
|
{
|
|
242
|
-
text: `Agent picked: ${
|
|
243
|
-
Task Assigned: ${
|
|
244
|
-
Requires Follow-Up: ${
|
|
249
|
+
text: `Agent picked: ${x}
|
|
250
|
+
Task Assigned: ${u.assignedTask ?? ""}
|
|
251
|
+
Requires Follow-Up: ${u.requiresFollowUp}`
|
|
245
252
|
},
|
|
246
253
|
t
|
|
247
|
-
),
|
|
248
|
-
} catch (
|
|
249
|
-
throw await
|
|
254
|
+
), N;
|
|
255
|
+
} catch (n) {
|
|
256
|
+
throw await h({ text: "Error during intent detection" }, t), new Error(`Error during intent detection: ${n instanceof Error ? n.message : String(n)}`);
|
|
250
257
|
}
|
|
251
|
-
},
|
|
258
|
+
}, ye = "0.1", y = 1536, we = "openai", be = k.default, ve = `Name: {name}
|
|
252
259
|
Title: {title}
|
|
253
|
-
Description: {description}`,
|
|
260
|
+
Description: {description}`, xe = `Name: {name}
|
|
254
261
|
Alias: {alias}
|
|
255
|
-
Description: {description}`,
|
|
256
|
-
schemaVersion: r.literal(
|
|
262
|
+
Description: {description}`, Ke = r.object({
|
|
263
|
+
schemaVersion: r.literal(ye),
|
|
257
264
|
modified: r.number().int().nonnegative(),
|
|
258
265
|
embeddings: r.object({
|
|
259
|
-
modelProvider: r.literal(
|
|
260
|
-
model: r.literal(
|
|
261
|
-
dimensions: r.literal(
|
|
266
|
+
modelProvider: r.literal(we),
|
|
267
|
+
model: r.literal(be),
|
|
268
|
+
dimensions: r.literal(y),
|
|
262
269
|
templates: r.object({
|
|
263
|
-
layer: r.string().default(
|
|
264
|
-
field: r.string().default(
|
|
270
|
+
layer: r.string().default(ve),
|
|
271
|
+
field: r.string().default(xe)
|
|
265
272
|
})
|
|
266
273
|
}),
|
|
267
274
|
layers: r.array(
|
|
@@ -270,112 +277,112 @@ Description: {description}`, Fe = r.object({
|
|
|
270
277
|
name: r.string().min(1),
|
|
271
278
|
title: r.string().catch(""),
|
|
272
279
|
description: r.string().catch(""),
|
|
273
|
-
vector: r.array(r.number()).length(
|
|
274
|
-
message: `Layer vector must be exactly ${
|
|
280
|
+
vector: r.array(r.number()).length(y, {
|
|
281
|
+
message: `Layer vector must be exactly ${y} dimensions`
|
|
275
282
|
}),
|
|
276
283
|
fields: r.array(
|
|
277
284
|
r.object({
|
|
278
285
|
name: r.string().min(1),
|
|
279
286
|
alias: r.string().catch(""),
|
|
280
287
|
description: r.string().catch(""),
|
|
281
|
-
vector: r.array(r.number()).length(
|
|
282
|
-
message: `Field vector must be exactly ${
|
|
288
|
+
vector: r.array(r.number()).length(y, {
|
|
289
|
+
message: `Field vector must be exactly ${y} dimensions`
|
|
283
290
|
})
|
|
284
291
|
})
|
|
285
292
|
)
|
|
286
293
|
})
|
|
287
294
|
).default([])
|
|
288
|
-
}),
|
|
295
|
+
}), Te = (e) => {
|
|
289
296
|
const t = /* @__PURE__ */ new Set();
|
|
290
297
|
for (const n of e)
|
|
291
298
|
if (W(n)) {
|
|
292
299
|
const i = n;
|
|
293
|
-
i.tool_calls && i.tool_calls.length > 0 && i.tool_calls.forEach((
|
|
294
|
-
|
|
300
|
+
i.tool_calls && i.tool_calls.length > 0 && i.tool_calls.forEach((s) => {
|
|
301
|
+
s.id && t.add(s.id);
|
|
295
302
|
});
|
|
296
303
|
}
|
|
297
304
|
return e.filter((n) => {
|
|
298
|
-
if (
|
|
305
|
+
if (X(n)) {
|
|
299
306
|
const i = n;
|
|
300
307
|
return t.has(i.tool_call_id);
|
|
301
308
|
}
|
|
302
309
|
return !0;
|
|
303
310
|
});
|
|
304
|
-
},
|
|
305
|
-
const
|
|
306
|
-
return
|
|
307
|
-
},
|
|
308
|
-
const { promptText: t, modelTier:
|
|
309
|
-
return
|
|
310
|
-
},
|
|
311
|
-
const { promptText: t, modelTier:
|
|
311
|
+
}, R = (e, t) => {
|
|
312
|
+
const o = B.fromTemplate(e);
|
|
313
|
+
return q.fromMessages([o, ...t]);
|
|
314
|
+
}, Me = async (e) => {
|
|
315
|
+
const { promptText: t, modelTier: o, messages: n, config: i } = e, s = R(t, n ?? []), a = await w({ modelTier: o, config: i });
|
|
316
|
+
return s.pipe(a);
|
|
317
|
+
}, Be = async (e) => {
|
|
318
|
+
const { promptText: t, modelTier: o = "default", messages: n, inputVariables: i, config: s } = e, c = await (await Me({
|
|
312
319
|
promptText: t,
|
|
313
|
-
modelTier:
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
})).invoke(
|
|
320
|
+
modelTier: o,
|
|
321
|
+
messages: n,
|
|
322
|
+
config: s
|
|
323
|
+
})).invoke(i ?? {}, s);
|
|
317
324
|
if (typeof c == "string")
|
|
318
325
|
return c;
|
|
319
326
|
const l = c.content;
|
|
320
327
|
return typeof l == "string" ? l : JSON.stringify(l);
|
|
321
328
|
}, O = async (e) => {
|
|
322
|
-
const { promptText: t, modelTier:
|
|
323
|
-
return await c.pipe(
|
|
324
|
-
},
|
|
325
|
-
const { promptText: t, modelTier:
|
|
326
|
-
return await l.pipe(
|
|
327
|
-
},
|
|
328
|
-
name:
|
|
329
|
-
description:
|
|
330
|
-
valueType:
|
|
331
|
-
alias:
|
|
332
|
-
}),
|
|
333
|
-
fields:
|
|
334
|
-
}),
|
|
335
|
-
const
|
|
336
|
-
return !!(
|
|
329
|
+
const { promptText: t, modelTier: o = "default", messages: n, inputVariables: i, schema: s, config: a } = e, c = R(t, n ?? []), p = (await w({ modelTier: o, config: a })).withStructuredOutput(s);
|
|
330
|
+
return await c.pipe(p).invoke(i ?? {}, a);
|
|
331
|
+
}, He = async (e) => {
|
|
332
|
+
const { promptText: t, modelTier: o = "default", messages: n, inputVariables: i, tools: s, config: a } = e, c = s.length > 0 ? Te(n ?? []) : n ?? [], l = R(t, c), p = await w({ modelTier: o, config: a });
|
|
333
|
+
return await l.pipe(p.bindTools(s)).invoke(i ?? {}, a);
|
|
334
|
+
}, Se = m.object({
|
|
335
|
+
name: m.string(),
|
|
336
|
+
description: m.string(),
|
|
337
|
+
valueType: m.string(),
|
|
338
|
+
alias: m.string()
|
|
339
|
+
}), Ie = m.object({
|
|
340
|
+
fields: m.array(Se)
|
|
341
|
+
}), $ = (e, t) => e.getFieldAlias(t) ?? void 0, I = (e, t) => $(e, t.name) ?? t.alias ?? "", ke = (e, t) => {
|
|
342
|
+
const o = $(e, t.name);
|
|
343
|
+
return !!(o && o !== (t.alias ?? ""));
|
|
337
344
|
};
|
|
338
|
-
function
|
|
339
|
-
const
|
|
345
|
+
function D(e, t) {
|
|
346
|
+
const o = /* @__PURE__ */ new Map();
|
|
340
347
|
for (const n of e.fields) {
|
|
341
|
-
const i = t.fields.find((l) => l.name === n.name),
|
|
348
|
+
const i = t.fields.find((l) => l.name === n.name), s = I(e, n), a = ke(e, n), c = {
|
|
342
349
|
name: n.name,
|
|
343
350
|
type: n.type,
|
|
344
|
-
alias: a ?
|
|
351
|
+
alias: a ? s : i?.alias ?? s,
|
|
345
352
|
description: i?.description ?? n.description ?? "",
|
|
346
353
|
valueType: i?.valueType ?? n.valueType ?? "",
|
|
347
354
|
domain: e.getFieldDomain(n.name) ?? void 0
|
|
348
355
|
};
|
|
349
|
-
|
|
356
|
+
o.set(n.name, c);
|
|
350
357
|
}
|
|
351
|
-
return
|
|
358
|
+
return o;
|
|
352
359
|
}
|
|
353
|
-
const
|
|
354
|
-
const
|
|
355
|
-
const { name: c, type: l, description:
|
|
356
|
-
return [`Name: ${c}`, `Type: ${l}`, `Alias: ${
|
|
360
|
+
const We = async (e) => {
|
|
361
|
+
const o = await E("field_descriptions_prompt"), n = e.fields.filter((a) => !(I(e, a) && a.description)).map((a) => {
|
|
362
|
+
const { name: c, type: l, description: p } = a, d = I(e, a);
|
|
363
|
+
return [`Name: ${c}`, `Type: ${l}`, `Alias: ${d}`, `Description: ${p ?? "N/A"}`].join(", ");
|
|
357
364
|
}).join(`
|
|
358
365
|
`);
|
|
359
366
|
if (n.length === 0)
|
|
360
|
-
return
|
|
367
|
+
return D(e, { fields: [] });
|
|
361
368
|
const i = {
|
|
362
369
|
existingItemTitle: e.portalItem?.title,
|
|
363
370
|
existingItemDescription: e.portalItem?.description,
|
|
364
371
|
existingLayerTitle: e.title,
|
|
365
372
|
existingLayerDescription: e.portalItem?.description,
|
|
366
373
|
fieldInformation: n
|
|
367
|
-
},
|
|
368
|
-
promptText:
|
|
369
|
-
schema:
|
|
374
|
+
}, s = await O({
|
|
375
|
+
promptText: o,
|
|
376
|
+
schema: Ie,
|
|
370
377
|
inputVariables: i
|
|
371
378
|
});
|
|
372
|
-
return
|
|
373
|
-
},
|
|
374
|
-
title:
|
|
375
|
-
description:
|
|
376
|
-
name:
|
|
377
|
-
}),
|
|
378
|
-
const n = await
|
|
379
|
+
return D(e, s);
|
|
380
|
+
}, Ee = m.object({
|
|
381
|
+
title: m.string(),
|
|
382
|
+
description: m.string(),
|
|
383
|
+
name: m.string().nullable()
|
|
384
|
+
}), Xe = async (e, t) => {
|
|
385
|
+
const n = await E("layer_descriptions_prompt"), i = Array.from(t.values()), s = {
|
|
379
386
|
fieldInformation: JSON.stringify(i, null, 2),
|
|
380
387
|
existingLayerTitle: e.title,
|
|
381
388
|
existingLayerDescription: e.portalItem?.description,
|
|
@@ -384,30 +391,27 @@ const Pe = async (e) => {
|
|
|
384
391
|
};
|
|
385
392
|
return { ...await O({
|
|
386
393
|
promptText: n,
|
|
387
|
-
schema:
|
|
388
|
-
inputVariables:
|
|
394
|
+
schema: Ee,
|
|
395
|
+
inputVariables: s
|
|
389
396
|
}), name: e.title ?? null };
|
|
390
397
|
};
|
|
391
398
|
export {
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
399
|
+
Le as D,
|
|
400
|
+
Ke as W,
|
|
401
|
+
Xe as a,
|
|
402
|
+
we as b,
|
|
403
|
+
w as c,
|
|
404
|
+
y as d,
|
|
405
|
+
Be as e,
|
|
406
|
+
xe as f,
|
|
407
|
+
We as g,
|
|
408
|
+
He as h,
|
|
402
409
|
O as i,
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
Ce as q,
|
|
411
|
-
Re as r,
|
|
412
|
-
y as s
|
|
410
|
+
ie as j,
|
|
411
|
+
ae as k,
|
|
412
|
+
ve as l,
|
|
413
|
+
be as m,
|
|
414
|
+
Ve as n,
|
|
415
|
+
ze as o,
|
|
416
|
+
ye as s
|
|
413
417
|
};
|