@arcgis/ai-components 5.2.0-next.9 → 5.2.0-next.91
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 +4 -2
- 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 +109 -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 +52 -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 +154 -0
- package/dist/agents/tools/query/getTopFeatures/adapter.d.ts +8 -0
- package/dist/agents/tools/query/getTopFeatures/adapter.js +141 -0
- package/dist/agents/tools/query/queryFeatures/adapter.d.ts +8 -0
- package/dist/agents/tools/query/queryFeatures/adapter.js +127 -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/2EY3BQQX.js +2 -0
- package/dist/cdn/2PTPBAIN.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/4EBLRHYE.js +2 -0
- package/dist/cdn/4HDDRBIY.js +2 -0
- package/dist/cdn/4KOV2NEI.js +9 -0
- package/dist/cdn/4NJ2FF7H.js +2 -0
- package/dist/cdn/4OGR5QKS.js +2 -0
- package/dist/cdn/4WIDLQUH.js +2 -0
- package/dist/cdn/5FL5BTTX.js +66 -0
- package/dist/cdn/5WYRJMBW.js +2 -0
- package/dist/cdn/5X7EG7D2.js +2 -0
- package/dist/cdn/5ZFUGNRN.js +2 -0
- package/dist/cdn/6HF36IKA.js +2 -0
- package/dist/cdn/6KFMRBAA.js +2 -0
- package/dist/cdn/6VJXUIXY.js +3 -0
- package/dist/cdn/7BCQMK6D.js +2 -0
- package/dist/cdn/7DFXYMEA.js +2 -0
- package/dist/cdn/7M6VKBTK.js +6 -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/7ZFAFKJT.js +2 -0
- package/dist/cdn/ACJTJLZN.js +2 -0
- package/dist/cdn/AI6DYOKR.js +181 -0
- package/dist/cdn/{ZS2TZ6BF.js → AOVJ34QE.js} +1 -1
- package/dist/cdn/APFZY4PI.js +2 -0
- package/dist/cdn/AT4XVTJR.js +44 -0
- package/dist/cdn/AZCIDPML.js +2 -0
- package/dist/cdn/{FL4W4VYN.js → BL273EGZ.js} +17 -1
- package/dist/cdn/C5ZL5Z52.js +18 -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/COL6QYGQ.js +2 -0
- package/dist/cdn/CP5BVGJU.js +2 -0
- package/dist/cdn/CZM4URK7.js +2 -0
- package/dist/cdn/DP6O6PMH.js +2 -0
- package/dist/cdn/{V2P4AIGG.js → EKB7CAMM.js} +1 -1
- package/dist/cdn/EWLXNGKH.js +208 -0
- package/dist/cdn/EYNEYD34.js +2 -0
- package/dist/cdn/FDDQ67BG.js +2 -0
- package/dist/cdn/FDOMMK2M.js +2 -0
- package/dist/cdn/FQH3HOFH.js +2 -0
- package/dist/cdn/{GGSZM7KV.js → FUZ77UGP.js} +6 -4
- package/dist/cdn/{ZLXN7NMF.js → FYZATVB3.js} +10 -8
- package/dist/cdn/GFEOVHJK.js +2 -0
- package/dist/cdn/HHFNQR6Z.js +2 -0
- package/dist/cdn/HIPQ3VRW.js +2 -0
- package/dist/cdn/HKSFWTWK.js +14 -0
- package/dist/cdn/HMUWQCXU.js +2 -0
- package/dist/cdn/IBZ2NEAO.js +2 -0
- package/dist/cdn/{FX7UOGHP.js → ICBIUFK7.js} +1 -1
- package/dist/cdn/IHP25JWI.js +99 -0
- package/dist/cdn/J6A4AS7E.js +22 -0
- package/dist/cdn/J6SZIQJA.js +2 -0
- package/dist/cdn/{NE7E52YR.js → JEBRN3EU.js} +9 -3
- package/dist/cdn/JJJZ7FOM.js +2 -0
- package/dist/cdn/JKIESH74.js +2 -0
- package/dist/cdn/JO5ETMPS.js +2 -0
- package/dist/cdn/K2R6XVK3.js +2 -0
- package/dist/cdn/KCU4FWF7.js +2 -0
- package/dist/cdn/KITIP6J2.js +2 -0
- package/dist/cdn/KWD2ECTM.js +2 -0
- package/dist/cdn/{7RCQFLPP.js → LK7ZIQW6.js} +1 -1
- package/dist/cdn/LLUGJKAQ.js +2 -0
- package/dist/cdn/LPR72QZF.js +36 -0
- package/dist/cdn/{DHOVCT6R.js → MKOQJXQQ.js} +1 -1
- package/dist/cdn/MWYBF3F3.js +66 -0
- package/dist/cdn/NEV6OZN3.js +71 -0
- package/dist/cdn/OAKRPM7D.js +2 -0
- package/dist/cdn/{23EQTPO3.js → OKVLGJAG.js} +1 -1
- package/dist/cdn/OL5656NI.js +2 -0
- package/dist/cdn/ONQ6JSBJ.js +2 -0
- package/dist/cdn/OWTGH34K.js +2 -0
- package/dist/cdn/OYSPNIJI.js +156 -0
- package/dist/cdn/PEYYWXFE.js +2 -0
- package/dist/cdn/PKUDO2RC.js +3 -0
- package/dist/cdn/{LQ6R5YRN.js → PQ2DPOFM.js} +1 -1
- package/dist/cdn/PSYRZMX2.js +2 -0
- package/dist/cdn/PUHRBGKB.js +2 -0
- package/dist/cdn/Q57QWN5W.js +2 -0
- package/dist/cdn/QCFICJ7U.js +3 -0
- package/dist/cdn/QNNGPA3Q.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/RSNGZQCQ.js +2 -0
- package/dist/cdn/{X2ZDYHCG.js → SDWWUWAF.js} +10 -5
- package/dist/cdn/SHD6YFSR.js +2 -0
- package/dist/cdn/SUYWKYWI.js +22 -0
- package/dist/cdn/SZ2QSSB3.js +2 -0
- package/dist/cdn/T4RIGOXB.js +2 -0
- package/dist/cdn/{3PKJWIC3.js → TMZ6DF22.js} +1 -1
- package/dist/cdn/TPULIO6I.js +34 -0
- package/dist/cdn/U2D53TAX.js +14 -0
- package/dist/cdn/{6YMR4QSD.js → UHEYPSOR.js} +1 -1
- package/dist/cdn/UHZG7SKO.js +2 -0
- package/dist/cdn/UZLQALHY.js +2 -0
- package/dist/cdn/V52XWEGV.js +11 -0
- package/dist/cdn/V6F3HEK7.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/VNJMTA6O.js +2 -0
- package/dist/cdn/VOKXKU7M.js +56 -0
- package/dist/cdn/VXFQANGJ.js +2 -0
- package/dist/cdn/W5JPJWMM.js +2 -0
- package/dist/cdn/WKTQVBFJ.js +2 -0
- package/dist/cdn/WNNMKCKS.js +2 -0
- package/dist/cdn/WP7ORLSB.js +6 -0
- package/dist/cdn/WR2SQX3J.js +2 -0
- package/dist/cdn/X3COUAXY.js +4 -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/YQSU6IUO.js +2 -0
- package/dist/cdn/Z5W4V7RC.js +2 -0
- package/dist/cdn/ZLWWWTH4.js +2 -0
- package/dist/cdn/ZOEMBHRF.js +2 -0
- package/dist/cdn/ZQMBJ6MI.js +2 -0
- package/dist/cdn/{ZTBA5PM7.js → ZU2FHVNK.js} +1 -1
- package/dist/cdn/ZVGUAOXE.js +2 -0
- package/dist/cdn/agent-utils/index.js +2 -0
- package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +3 -0
- package/dist/cdn/agent-utils/middlewares/middleware.js +2 -0
- package/dist/cdn/agent-utils/middlewares/trace.js +2 -0
- package/dist/cdn/assets/assistant/t9n/messages.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/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 +56 -0
- package/dist/chunks/converterUtils.js +66 -41
- package/dist/chunks/dataExplorationGraph.js +133 -177
- 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 +259 -282
- 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 +124 -103
- package/dist/chunks/navigation_intent_prompt.js +8 -2
- package/dist/chunks/orchestrator.js +298 -139
- 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/types.js +59 -0
- package/dist/chunks/utils2.js +11 -11
- package/dist/components/arcgis-assistant/customElement.d.ts +72 -0
- package/dist/components/arcgis-assistant/customElement.js +416 -172
- 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 +2 -1
- package/dist/components/arcgis-assistant-chat/customElement.js +23 -18
- package/dist/components/arcgis-assistant-chat-entry/customElement.d.ts +2 -0
- 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 +4 -0
- 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 +5 -0
- package/dist/components/arcgis-assistant-message/customElement.js +29 -26
- package/dist/components/arcgis-assistant-message/index.js +2 -0
- 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-loading/customElement.d.ts +7 -0
- 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-text/customElement.d.ts +1 -0
- 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.js +34 -52
- package/dist/components/arcgis-assistant-suggested-prompts/customElement.js +8 -8
- package/dist/components/arcgis-assistant-user-message/customElement.d.ts +2 -0
- 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/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 +10 -8
- package/dist/types/preact.d.ts +10 -8
- package/dist/types/react.d.ts +10 -8
- package/dist/types/stencil.d.ts +12 -10
- package/dist/utils/index.d.ts +8 -8
- package/dist/utils/index.js +56 -55
- package/package.json +32 -12
- package/dist/cdn/2AXF774U.js +0 -2
- package/dist/cdn/462JBSEV.js +0 -422
- package/dist/cdn/53ZCUPKK.js +0 -22
- package/dist/cdn/5QAHYX7Y.js +0 -5
- package/dist/cdn/5XRDJL7R.js +0 -14
- package/dist/cdn/7BCR6TUO.js +0 -2
- package/dist/cdn/7GH7VSB2.js +0 -2
- package/dist/cdn/7PLV4QH6.js +0 -2
- package/dist/cdn/AXDZBBNL.js +0 -45
- package/dist/cdn/DDLZOMUY.js +0 -2
- package/dist/cdn/EECZLT6C.js +0 -166
- package/dist/cdn/ETRWZ3MS.js +0 -108
- package/dist/cdn/F2AHA4GB.js +0 -54
- package/dist/cdn/FX5JFRDL.js +0 -2
- package/dist/cdn/H7422XUG.js +0 -2
- package/dist/cdn/HB5A5R2E.js +0 -2
- package/dist/cdn/I6HNBTWY.js +0 -2
- package/dist/cdn/I7SRZPVS.js +0 -72
- package/dist/cdn/IG6YKZH3.js +0 -3
- package/dist/cdn/JVIKKZND.js +0 -3
- package/dist/cdn/KMQ3SP4I.js +0 -5
- package/dist/cdn/MH5RPXHM.js +0 -2
- package/dist/cdn/NVI3I46B.js +0 -2
- package/dist/cdn/OAVEHGB6.js +0 -2
- package/dist/cdn/OH64RMOR.js +0 -4
- package/dist/cdn/P26NON3Z.js +0 -16
- package/dist/cdn/QR54T33D.js +0 -2
- package/dist/cdn/RVOAPUBN.js +0 -2
- package/dist/cdn/S3VPZFWQ.js +0 -36
- package/dist/cdn/SXDLXCIM.js +0 -2
- package/dist/cdn/TR7RL3IK.js +0 -2
- package/dist/cdn/USMDJUFS.js +0 -2
- package/dist/cdn/Y333DGV6.js +0 -2
- package/dist/cdn/YIMNOUTF.js +0 -2
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
function
|
|
3
|
-
return `
|
|
4
|
-
}
|
|
5
|
-
function o(e, t) {
|
|
6
|
-
return `block-${e}-${t}`;
|
|
2
|
+
function e(o, t) {
|
|
3
|
+
return `block-${o}-${t}`;
|
|
7
4
|
}
|
|
8
5
|
export {
|
|
9
|
-
|
|
10
|
-
a as g
|
|
6
|
+
e as g
|
|
11
7
|
};
|
package/dist/chunks/state.js
CHANGED
|
@@ -1,55 +1,47 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { Annotation as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
messages: [],
|
|
8
|
-
priorSteps: [],
|
|
9
|
-
sharedState: {},
|
|
10
|
-
userRequest: ""
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
function i(r) {
|
|
14
|
-
const n = [...new Set([...r].filter((t) => c.has(t)))];
|
|
2
|
+
import { Annotation as o } from "@langchain/langgraph/web";
|
|
3
|
+
import { c } from "./baseAgentState.js";
|
|
4
|
+
const i = /* @__PURE__ */ new Set(["agentExecutionContext", "outputMessage", "summary", "status"]);
|
|
5
|
+
function u(r) {
|
|
6
|
+
const n = [...new Set([...r].filter((t) => i.has(t)))];
|
|
15
7
|
if (n.length !== 0)
|
|
16
|
-
throw new Error(`
|
|
8
|
+
throw new Error(`custom state cannot define reserved runtime fields: ${n.join(", ")}.`);
|
|
17
9
|
}
|
|
18
10
|
function f(r) {
|
|
19
11
|
const n = Object.entries(r);
|
|
20
12
|
return Object.fromEntries(
|
|
21
13
|
n.map(([t, e]) => [
|
|
22
14
|
t,
|
|
23
|
-
|
|
24
|
-
reducer: (
|
|
15
|
+
o({
|
|
16
|
+
reducer: (s, a) => a,
|
|
25
17
|
default: () => e
|
|
26
18
|
})
|
|
27
19
|
])
|
|
28
20
|
);
|
|
29
21
|
}
|
|
30
22
|
function m(r = {}) {
|
|
31
|
-
|
|
23
|
+
u(Object.keys(r));
|
|
32
24
|
const n = f(r);
|
|
33
|
-
return
|
|
25
|
+
return o.Root({
|
|
34
26
|
...n,
|
|
35
|
-
agentExecutionContext:
|
|
27
|
+
agentExecutionContext: o({
|
|
36
28
|
reducer: (t, e) => ({
|
|
37
29
|
...t,
|
|
38
30
|
...e
|
|
39
31
|
}),
|
|
40
|
-
default:
|
|
32
|
+
default: c
|
|
41
33
|
}),
|
|
42
|
-
outputMessage:
|
|
34
|
+
outputMessage: o({
|
|
43
35
|
// Preserve the last meaningful user-facing message produced by the graph.
|
|
44
36
|
reducer: (t = "", e) => typeof e == "string" && e.trim() ? e : t,
|
|
45
37
|
default: () => ""
|
|
46
38
|
}),
|
|
47
|
-
summary:
|
|
39
|
+
summary: o({
|
|
48
40
|
// Summary is a compact orchestrator-facing outcome, so replacement semantics are enough.
|
|
49
41
|
reducer: (t = "", e) => typeof e == "string" ? e : t,
|
|
50
42
|
default: () => ""
|
|
51
43
|
}),
|
|
52
|
-
status:
|
|
44
|
+
status: o({
|
|
53
45
|
// Keep the first meaningful status until a later node explicitly replaces it.
|
|
54
46
|
reducer: (t, e) => e ?? t,
|
|
55
47
|
default: () => {
|
|
@@ -57,15 +49,17 @@ function m(r = {}) {
|
|
|
57
49
|
})
|
|
58
50
|
});
|
|
59
51
|
}
|
|
60
|
-
function
|
|
52
|
+
function g(r) {
|
|
61
53
|
const n = /* @__PURE__ */ new Set();
|
|
62
54
|
for (const e of r)
|
|
63
|
-
for (const
|
|
64
|
-
n.add(
|
|
55
|
+
for (const s of Object.keys(e.shape ?? {}))
|
|
56
|
+
n.add(s);
|
|
65
57
|
const t = Object.fromEntries([...n].map((e) => [e, void 0]));
|
|
66
58
|
return m(t);
|
|
67
59
|
}
|
|
68
60
|
export {
|
|
69
61
|
m as a,
|
|
70
|
-
|
|
62
|
+
u as b,
|
|
63
|
+
g as c,
|
|
64
|
+
f as d
|
|
71
65
|
};
|
|
@@ -22,13 +22,15 @@ Use chat history only when necessary to understand conversational references, an
|
|
|
22
22
|
|
|
23
23
|
### Your goal:
|
|
24
24
|
|
|
25
|
-
1. If the assigned task is about a **specific calculation** (e.g., average, total, count, min, max), return
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
1. If the assigned task is about a **specific calculation** (e.g., average, total, count, min, max), return a **single concise sentence** that includes the numeric result.
|
|
26
|
+
|
|
27
|
+
- Example: “The average price is $4.00.”
|
|
28
|
+
- Never return a bare number by itself (for example: \`4\`).
|
|
29
|
+
- When a value is already present in \`queryResponse\` (for example in \`details.value\` or \`summary\`), copy that value **verbatim**.
|
|
30
|
+
- Do NOT reformat values (including numbers, dates, and times):
|
|
31
|
+
- Do not add/remove grouping commas.
|
|
32
|
+
- Do not change decimals, round values, or change numeric type/text.
|
|
33
|
+
- Do not change date/time format, timezone notation, separators, or precision.
|
|
32
34
|
|
|
33
35
|
2. If the question is more general or there are **multiple features with varying attributes**, write a **brief summary** (2–3 sentences max) that highlights key patterns or insights.
|
|
34
36
|
|
|
@@ -1,29 +1,33 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
import "@arcgis/core/identity/IdentityManager.js";
|
|
3
3
|
import "@arcgis/core/portal/Portal.js";
|
|
4
|
+
import "@arcgis/core/request.js";
|
|
4
5
|
import "@langchain/langgraph/web";
|
|
5
|
-
import
|
|
6
|
+
import "@arcgis/toolkit/string";
|
|
7
|
+
import "./generateLayerDescriptions.js";
|
|
6
8
|
import "@langchain/core/messages";
|
|
9
|
+
import { s as a } from "./index.js";
|
|
10
|
+
import "@langchain/core/callbacks/base";
|
|
7
11
|
import "@langchain/openai";
|
|
12
|
+
import "@arcgis/core/config.js";
|
|
8
13
|
import "@arcgis/core/core/reactiveUtils.js";
|
|
9
14
|
import "@arcgis/core/layers/FeatureLayer.js";
|
|
10
|
-
import "@arcgis/core/request.js";
|
|
11
15
|
import "@langchain/core/prompts";
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
15
|
-
await
|
|
16
|
+
const x = async (t, o) => {
|
|
17
|
+
const i = t.tool_calls ?? [];
|
|
18
|
+
if (i.length === 0) {
|
|
19
|
+
await a({ text: `LLM did not request any tool calls: ${String(t?.content)}` }, o);
|
|
16
20
|
return;
|
|
17
21
|
}
|
|
18
22
|
await Promise.all(
|
|
19
|
-
|
|
20
|
-
async (
|
|
21
|
-
{ text: `LLM invoked ${
|
|
23
|
+
i.map(
|
|
24
|
+
async (r) => await a(
|
|
25
|
+
{ text: `LLM invoked ${r.name} tool with arguments: ${JSON.stringify(r.args, null, 2)}` },
|
|
22
26
|
o
|
|
23
27
|
)
|
|
24
28
|
)
|
|
25
29
|
);
|
|
26
30
|
};
|
|
27
31
|
export {
|
|
28
|
-
|
|
32
|
+
x as h
|
|
29
33
|
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import m from "@arcgis/core/geometry/Point.js";
|
|
3
|
+
import * as y from "@arcgis/core/geometry/operators/unionOperator.js";
|
|
4
|
+
import f from "zod";
|
|
5
|
+
const u = 750;
|
|
6
|
+
function c(e) {
|
|
7
|
+
return "point" in e && e.point !== void 0;
|
|
8
|
+
}
|
|
9
|
+
function d(e) {
|
|
10
|
+
return "layerId" in e && e.layerId !== void 0;
|
|
11
|
+
}
|
|
12
|
+
const R = async (e, o) => {
|
|
13
|
+
if (c(e)) {
|
|
14
|
+
const { point: r } = e;
|
|
15
|
+
return { geometry: new m({
|
|
16
|
+
x: r.x,
|
|
17
|
+
y: r.y,
|
|
18
|
+
spatialReference: r.spatialReference ? { wkid: r.spatialReference.wkid } : o.spatialReference
|
|
19
|
+
}) };
|
|
20
|
+
}
|
|
21
|
+
if (d(e)) {
|
|
22
|
+
const r = o.map?.allLayers.find(
|
|
23
|
+
(t) => t.id === e.layerId
|
|
24
|
+
);
|
|
25
|
+
if (!r)
|
|
26
|
+
return { error: `Could not find geometry layer with ID: ${e.layerId}` };
|
|
27
|
+
const i = r.title ?? r.id, l = e.where?.trim() || "1=1";
|
|
28
|
+
try {
|
|
29
|
+
const t = await r.queryFeatures({
|
|
30
|
+
where: l,
|
|
31
|
+
returnGeometry: !0,
|
|
32
|
+
outSpatialReference: o.spatialReference,
|
|
33
|
+
num: u + 1
|
|
34
|
+
});
|
|
35
|
+
if (!t.features.length)
|
|
36
|
+
return {
|
|
37
|
+
error: `No features found in geometry layer "${i}" with the specified where clause: ${l}`
|
|
38
|
+
};
|
|
39
|
+
if (t.features.length > u)
|
|
40
|
+
return {
|
|
41
|
+
error: `Geometry filter for layer "${i}" matched too many features (${t.features.length}+). Please narrow the geometry layer filter.`
|
|
42
|
+
};
|
|
43
|
+
const a = t.features.map((s) => s.geometry).filter((s) => !!s);
|
|
44
|
+
if (!a.length)
|
|
45
|
+
return { error: "No valid geometries found for the matched geometry layer features." };
|
|
46
|
+
const n = a.length === 1 ? a[0] : y.executeMany(a);
|
|
47
|
+
return n ? (n.spatialReference || (n.spatialReference = o.spatialReference), { geometry: n }) : { error: "Failed to combine geometries from geometry layer." };
|
|
48
|
+
} catch (t) {
|
|
49
|
+
return { error: `Failed to query geometry: ${String(t)}` };
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return { error: "Invalid geometry configuration provided" };
|
|
53
|
+
}, h = ["feet", "kilometers", "meters", "miles", "nautical-miles", "us-nautical-miles"], w = f.enum(h);
|
|
54
|
+
export {
|
|
55
|
+
c as a,
|
|
56
|
+
w as d,
|
|
57
|
+
R as g,
|
|
58
|
+
d as i
|
|
59
|
+
};
|
package/dist/chunks/utils2.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
import { getClosestElement as i } from "@arcgis/toolkit/dom";
|
|
3
|
-
import { g as
|
|
3
|
+
import { g as s, a as o } from "./utils3.js";
|
|
4
4
|
function c(e, t) {
|
|
5
|
-
const
|
|
6
|
-
if (
|
|
7
|
-
return
|
|
8
|
-
const n = i(e.el, "arcgis-assistant"), a =
|
|
5
|
+
const r = s(e.el, e.referenceElement);
|
|
6
|
+
if (r)
|
|
7
|
+
return r;
|
|
8
|
+
const n = i(e.el, "arcgis-assistant"), a = s(e.el, n?.referenceElement);
|
|
9
9
|
if (a)
|
|
10
10
|
return a;
|
|
11
11
|
throw new Error(`${t}: Reference element not found`);
|
|
@@ -23,16 +23,16 @@ function g(e) {
|
|
|
23
23
|
const t = i(e.el, "arcgis-assistant");
|
|
24
24
|
if (t === void 0)
|
|
25
25
|
throw new Error("arcgis-assistant-agent must be used within an arcgis-assistant element");
|
|
26
|
-
t.register({
|
|
26
|
+
return t.register({
|
|
27
27
|
agent: e.agent,
|
|
28
28
|
getContext: async () => await e.getContext?.() ?? e.context ?? {}
|
|
29
|
-
});
|
|
29
|
+
}), t;
|
|
30
30
|
}
|
|
31
31
|
function l(e) {
|
|
32
32
|
const t = o(e.el, e.referenceElement);
|
|
33
33
|
if (t)
|
|
34
34
|
return t;
|
|
35
|
-
const
|
|
35
|
+
const r = i(e.el, "arcgis-assistant"), n = s(e.el, r?.referenceElement);
|
|
36
36
|
return n || null;
|
|
37
37
|
}
|
|
38
38
|
function v(e) {
|
|
@@ -40,8 +40,8 @@ function v(e) {
|
|
|
40
40
|
return t ? t.view : null;
|
|
41
41
|
}
|
|
42
42
|
export {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
v as a,
|
|
44
|
+
w as b,
|
|
45
|
+
g as i,
|
|
46
46
|
m as r
|
|
47
47
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference path="../../index.d.ts" />
|
|
2
2
|
import type Collection from "@arcgis/core/core/Collection.js";
|
|
3
|
+
import type { RuntimeSpanEvent } from "../../orchestrator/orchestrator/orchestratorEvents.js";
|
|
3
4
|
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
4
5
|
import type { AssistantMessage, AssistantPromptSelectDetail, AssistantSlottableRequestDetail, ChatMessage, Interrupt } from "./types.js";
|
|
5
6
|
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
@@ -41,6 +42,11 @@ import type { ArcgisMap as ArcgisMap } from "@arcgis/map-components/components/a
|
|
|
41
42
|
* for the included ArcGIS agents to function properly, as they rely on the map context to perform their tasks. This is not
|
|
42
43
|
* a requirement for [custom agents](https://developers.arcgis.com/javascript/latest/agentic-apps/ai-custom-agents/).
|
|
43
44
|
*
|
|
45
|
+
* ## Application Identification
|
|
46
|
+
* For applications that use the arcgis-assistant component, setting the [`applicationName`](https://developers.arcgis.com/javascript/latest/references/core/config/#Config-applicationName) property on the ArcGIS config object [`esriConfig`](https://developers.arcgis.com/javascript/latest/references/core/config/) is recommended.
|
|
47
|
+
* When provided, this value can help associate assistant activity and feedback with a specific application, where supported.
|
|
48
|
+
* This can make it easier to understand usage patterns and troubleshoot feedback.
|
|
49
|
+
*
|
|
44
50
|
* ## Context
|
|
45
51
|
*
|
|
46
52
|
* Use the [referenceElement](https://developers.arcgis.com/javascript/latest/references/ai-components/components/arcgis-assistant/#referenceElement) property to provide a web map as context to the assistant and its agents.
|
|
@@ -84,11 +90,40 @@ export abstract class ArcgisAssistant extends LitElement {
|
|
|
84
90
|
assistantLabel: string;
|
|
85
91
|
stopButtonLabel: string;
|
|
86
92
|
askButtonLabel: string;
|
|
93
|
+
stoppedByUserLabel: string;
|
|
94
|
+
noAgentsFoundMessage: string;
|
|
95
|
+
orchestratorInitializationErrorMessage: string;
|
|
96
|
+
signInErrorMessage: string;
|
|
97
|
+
signInRequiredMessage: string;
|
|
98
|
+
signInLabel: string;
|
|
99
|
+
signInToArcGISOnlineLabel: string;
|
|
100
|
+
noPortalInformationMessage: string;
|
|
101
|
+
readMoreLabel: string;
|
|
102
|
+
learnAboutWebMapEmbeddingsLabel: string;
|
|
103
|
+
waitingForUserInputMessage: string;
|
|
87
104
|
} & T9nMeta<{
|
|
88
105
|
assistantLabel: string;
|
|
89
106
|
stopButtonLabel: string;
|
|
90
107
|
askButtonLabel: string;
|
|
108
|
+
stoppedByUserLabel: string;
|
|
109
|
+
noAgentsFoundMessage: string;
|
|
110
|
+
orchestratorInitializationErrorMessage: string;
|
|
111
|
+
signInErrorMessage: string;
|
|
112
|
+
signInRequiredMessage: string;
|
|
113
|
+
signInLabel: string;
|
|
114
|
+
signInToArcGISOnlineLabel: string;
|
|
115
|
+
noPortalInformationMessage: string;
|
|
116
|
+
readMoreLabel: string;
|
|
117
|
+
learnAboutWebMapEmbeddingsLabel: string;
|
|
118
|
+
waitingForUserInputMessage: string;
|
|
91
119
|
}>;
|
|
120
|
+
/**
|
|
121
|
+
* When `true`, displays the assistant avatar in the chat interface.
|
|
122
|
+
*
|
|
123
|
+
* @default false
|
|
124
|
+
* @since 5.1
|
|
125
|
+
*/
|
|
126
|
+
accessor assistantAvatarEnabled: boolean;
|
|
92
127
|
/**
|
|
93
128
|
* Indicates whether the assistant is currently processing a user message.
|
|
94
129
|
* This value is `true` while the assistant is generating a response and `false` when idle.
|
|
@@ -270,6 +305,21 @@ export abstract class ArcgisAssistant extends LitElement {
|
|
|
270
305
|
* ```
|
|
271
306
|
*/
|
|
272
307
|
accessor referenceElement: ArcgisMap | string | null;
|
|
308
|
+
/**
|
|
309
|
+
* When `true`, emits normalized runtime span events while processing requests.
|
|
310
|
+
*
|
|
311
|
+
* @default false
|
|
312
|
+
* @internal
|
|
313
|
+
* @since 5.2
|
|
314
|
+
*/
|
|
315
|
+
accessor runtimeEventsEnabled: boolean;
|
|
316
|
+
/**
|
|
317
|
+
* When `true`, assistant text responses render after completion instead of streaming progressively.
|
|
318
|
+
*
|
|
319
|
+
* @default false
|
|
320
|
+
* @since 5.1
|
|
321
|
+
*/
|
|
322
|
+
accessor streamingDisabled: boolean;
|
|
273
323
|
/**
|
|
274
324
|
* Prompts to suggest to the end user on load. These are intended to help users understand which questions they can ask.
|
|
275
325
|
* This property should be set to establish boundaries for the end user. As all agents have limitations and LLMs can
|
|
@@ -291,6 +341,13 @@ export abstract class ArcgisAssistant extends LitElement {
|
|
|
291
341
|
* ```
|
|
292
342
|
*/
|
|
293
343
|
accessor suggestedPrompts: string[];
|
|
344
|
+
/**
|
|
345
|
+
* When `true`, displays the user avatar in the chat interface.
|
|
346
|
+
*
|
|
347
|
+
* @default false
|
|
348
|
+
* @since 5.2
|
|
349
|
+
*/
|
|
350
|
+
accessor userAvatarEnabled: boolean;
|
|
294
351
|
/**
|
|
295
352
|
* Cancels the active interrupt, if one is pending.
|
|
296
353
|
*
|
|
@@ -454,6 +511,19 @@ export abstract class ArcgisAssistant extends LitElement {
|
|
|
454
511
|
* ```
|
|
455
512
|
*/
|
|
456
513
|
readonly arcgisReady: import("@arcgis/lumina").TargetedEvent<this, void>;
|
|
514
|
+
/**
|
|
515
|
+
* Emitted when the assistant generates a response to a user message. The event detail includes an AssistantMessage object that contains the assistant's response,
|
|
516
|
+
* along with any relevant logs or errors. This allows app developers to capture the assistant's responses.
|
|
517
|
+
*
|
|
518
|
+
* @since 5.1
|
|
519
|
+
*/
|
|
520
|
+
readonly arcgisResponse: import("@arcgis/lumina").TargetedEvent<this, AssistantMessage>;
|
|
521
|
+
/**
|
|
522
|
+
* Emitted for each normalized runtime span lifecycle event produced while processing a request.
|
|
523
|
+
*
|
|
524
|
+
* @internal
|
|
525
|
+
*/
|
|
526
|
+
readonly arcgisRuntime: import("@arcgis/lumina").TargetedEvent<this, RuntimeSpanEvent>;
|
|
457
527
|
/**
|
|
458
528
|
* Emitted when the assistant requests custom slotted content for an assistant message.
|
|
459
529
|
*
|
|
@@ -508,6 +578,8 @@ export abstract class ArcgisAssistant extends LitElement {
|
|
|
508
578
|
arcgisInterruptSubmit: ArcgisAssistant["arcgisInterruptSubmit"]["detail"];
|
|
509
579
|
arcgisPromptSelect: ArcgisAssistant["arcgisPromptSelect"]["detail"];
|
|
510
580
|
arcgisReady: ArcgisAssistant["arcgisReady"]["detail"];
|
|
581
|
+
arcgisResponse: ArcgisAssistant["arcgisResponse"]["detail"];
|
|
582
|
+
arcgisRuntime: ArcgisAssistant["arcgisRuntime"]["detail"];
|
|
511
583
|
arcgisSlottableRequest: ArcgisAssistant["arcgisSlottableRequest"]["detail"];
|
|
512
584
|
arcgisSubmit: ArcgisAssistant["arcgisSubmit"]["detail"];
|
|
513
585
|
};
|