@arcgis/ai-components 5.1.0-next.115 → 5.1.0-next.117
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.d.ts +90 -0
- package/dist/agent-utils/BaseAgent.js +87 -0
- package/dist/agent-utils/FunctionAgent.d.ts +64 -0
- package/dist/agent-utils/FunctionAgent.js +98 -0
- package/dist/agent-utils/LLMAgent.d.ts +65 -0
- package/dist/agent-utils/LLMAgent.js +139 -0
- package/dist/agent-utils/WorkflowAgent.d.ts +44 -0
- package/dist/agent-utils/WorkflowAgent.js +70 -0
- package/dist/agent-utils/middlewares/humanInTheLoop.d.ts +152 -0
- package/dist/agent-utils/middlewares/humanInTheLoop.js +94 -0
- package/dist/agent-utils/middlewares/middleware.d.ts +25 -0
- package/dist/agent-utils/middlewares/middleware.js +44 -0
- package/dist/agent-utils/middlewares/trace.d.ts +25 -0
- package/dist/agent-utils/middlewares/trace.js +50 -0
- package/dist/agent-utils/middlewares/types.d.ts +123 -0
- package/dist/agent-utils/middlewares/types.js +2 -0
- package/dist/agent-utils/tools/FunctionTool.d.ts +127 -0
- package/dist/agent-utils/tools/FunctionTool.js +80 -0
- package/dist/agent-utils/types.d.ts +152 -0
- package/dist/agent-utils/workflows/BaseWorkflow.d.ts +87 -0
- package/dist/agent-utils/workflows/ConditionalWorkflow.d.ts +72 -0
- package/dist/agent-utils/workflows/ConditionalWorkflow.js +61 -0
- package/dist/agent-utils/workflows/LoopWorkflow.d.ts +58 -0
- package/dist/agent-utils/workflows/LoopWorkflow.js +56 -0
- package/dist/agent-utils/workflows/ParallelWorkflow.d.ts +68 -0
- package/dist/agent-utils/workflows/ParallelWorkflow.js +129 -0
- package/dist/agent-utils/workflows/RouterWorkflow.d.ts +63 -0
- package/dist/agent-utils/workflows/RouterWorkflow.js +75 -0
- package/dist/agent-utils/workflows/SequentialWorkflow.d.ts +56 -0
- package/dist/agent-utils/workflows/SequentialWorkflow.js +69 -0
- package/dist/agent-utils/workflows/SwitchWorkflow.d.ts +74 -0
- package/dist/agent-utils/workflows/SwitchWorkflow.js +84 -0
- package/dist/assets/embeddings.worker-k9_Ou679.js +1 -0
- package/dist/cdn/{RACFQ7G7.js → 7J26XD64.js} +1 -1
- package/dist/cdn/{RYEH3CUI.js → B3TOOMRL.js} +48 -49
- package/dist/cdn/DQE7BZ7J.js +42 -0
- package/dist/cdn/FTK7YZJ2.js +36 -0
- package/dist/cdn/IHFTPX4T.js +22 -0
- package/dist/cdn/J5NF6FQP.js +14 -0
- package/dist/cdn/{EJWQC2SL.js → KLIA4JYQ.js} +1 -1
- package/dist/cdn/N5ORE2OA.js +16 -0
- package/dist/cdn/UBPQG2VW.js +3 -0
- package/dist/cdn/WI7N36W3.js +166 -0
- package/dist/cdn/YOFAGUJN.js +2 -0
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/BaseWorkflow.js +107 -0
- package/dist/chunks/adapter.js +2964 -0
- package/dist/chunks/arcgisKnowledgeGraph.js +174 -0
- package/dist/chunks/arcgis_knowledge_current_lc_context.js +8 -0
- package/dist/chunks/arcgis_knowledge_current_map_context.js +8 -0
- package/dist/chunks/arcgis_knowledge_lucene_generation_prompt.js +101 -0
- package/dist/chunks/arcgis_knowledge_summarize_result_prompt.js +48 -0
- package/dist/chunks/arcgis_knowledge_tool_prompt.js +34 -0
- package/dist/chunks/dataExplorationGraph.js +289 -0
- package/dist/chunks/data_explore_filter_prompt.js +125 -0
- package/dist/chunks/data_explore_query_prompt.js +131 -0
- package/dist/chunks/embeddings.worker.js +25 -0
- package/dist/chunks/field_descriptions_prompt.js +112 -0
- package/dist/chunks/generateLayerDescriptions.js +413 -0
- package/dist/chunks/graph.js +86 -0
- package/dist/chunks/helpGraph.js +123 -0
- package/dist/chunks/help_prompt.js +57 -0
- package/dist/chunks/intent_prompt.js +124 -0
- package/dist/chunks/layerStylingGraph.js +189 -0
- package/dist/chunks/layer_descriptions_prompt.js +59 -0
- package/dist/chunks/layer_styling_prompt.js +72 -0
- package/dist/chunks/navigationGraph.js +266 -0
- package/dist/chunks/navigation_intent_prompt.js +46 -0
- package/dist/chunks/navigation_tool_prompt.js +39 -0
- package/dist/chunks/orchestrator.js +528 -0
- package/dist/chunks/state.js +71 -0
- package/dist/chunks/summarize_query_response_prompt.js +77 -0
- package/dist/chunks/toolCallResponse.js +29 -0
- package/dist/chunks/utils.js +46 -40
- package/dist/chunks/utils2.js +41 -10
- package/dist/chunks/utils3.js +16 -0
- package/dist/components/arcgis-assistant/customElement.js +31 -23
- package/dist/components/arcgis-assistant/types.d.ts +1 -1
- package/dist/components/arcgis-assistant-agent/customElement.d.ts +1 -1
- package/dist/components/arcgis-assistant-agent/customElement.js +1 -1
- package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +24 -8
- package/dist/components/arcgis-assistant-help-agent/customElement.js +27 -8
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.d.ts +16 -2
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +36 -19
- package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +27 -8
- package/dist/components/arcgis-assistant-message-block/customElement.d.ts +1 -1
- package/dist/components/arcgis-assistant-navigation-agent/customElement.js +25 -7
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/utils/index.d.ts +203 -9
- package/dist/utils/index.js +108 -10
- package/package.json +22 -7
- package/dist/cdn/F746AXM6.js +0 -2
- package/dist/cdn/HKVQQV3Z.js +0 -2
- package/dist/cdn/NWLDMNBB.js +0 -283
- package/dist/cdn/PGHTDGBE.js +0 -2
- package/dist/cdn/R5PFKR6I.js +0 -2
- package/dist/cdn/RTYJZ47N.js +0 -2
- package/dist/cdn/SHR5YB5Q.js +0 -2
- /package/dist/cdn/{YVTKUITE.js → 53Z3R4OY.js} +0 -0
- /package/dist/cdn/{CFT5BBC6.js → 77GAVZIK.js} +0 -0
- /package/dist/cdn/{Z7GVYVWK.js → BXKPX3C7.js} +0 -0
- /package/dist/cdn/{W5CHGOOR.js → G7XK3XOR.js} +0 -0
- /package/dist/cdn/{LSGRWCAO.js → GH7EROHP.js} +0 -0
- /package/dist/cdn/{DMLSCJAM.js → HJGF7W5O.js} +0 -0
- /package/dist/cdn/{5X5GJH2L.js → KWORBODI.js} +0 -0
- /package/dist/cdn/{K6LVZHWM.js → MFEAOGTZ.js} +0 -0
- /package/dist/cdn/{47QQSSPB.js → MLQKBQSG.js} +0 -0
- /package/dist/cdn/{JDL3HFFX.js → MQ7QXIOW.js} +0 -0
- /package/dist/cdn/{MZJGADGH.js → NMWLJECU.js} +0 -0
- /package/dist/cdn/{ESTSYVJP.js → ORRZDP5H.js} +0 -0
- /package/dist/cdn/{JKAITV5Q.js → PTKZXFXB.js} +0 -0
- /package/dist/cdn/{5PT7ZFXF.js → RNMI3HNM.js} +0 -0
- /package/dist/cdn/{7EXACS27.js → SCT3365V.js} +0 -0
- /package/dist/cdn/{24MYCR6F.js → URYKQKFE.js} +0 -0
- /package/dist/cdn/{SFREIREB.js → WTEDVMFR.js} +0 -0
package/dist/utils/index.js
CHANGED
|
@@ -1,13 +1,111 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import {
|
|
3
|
-
import "
|
|
4
|
-
import "
|
|
5
|
-
|
|
2
|
+
import { g as p } from "../chunks/orchestrator.js";
|
|
3
|
+
import { O as ye } from "../chunks/orchestrator.js";
|
|
4
|
+
import { g as h, a as A, W as S, f, l as y, d as v, m as w, b as $, e as b, i as E, h as L, j as P, s as M, k as T, n as R, c as k, o as x } from "../chunks/generateLayerDescriptions.js";
|
|
5
|
+
import D from "@arcgis/core/layers/FeatureLayer.js";
|
|
6
|
+
import * as W from "@arcgis/core/core/reactiveUtils.js";
|
|
7
|
+
import { N as F } from "../chunks/navigationGraph.js";
|
|
8
|
+
import { L as C } from "../chunks/layerStylingGraph.js";
|
|
9
|
+
import { D as N } from "../chunks/dataExplorationGraph.js";
|
|
10
|
+
import { H as z } from "../chunks/helpGraph.js";
|
|
11
|
+
import { A as H } from "../chunks/arcgisKnowledgeGraph.js";
|
|
12
|
+
const I = async (e) => {
|
|
13
|
+
const t = e.allLayers.toArray(), n = [], s = /* @__PURE__ */ new Map();
|
|
14
|
+
for (const a of t)
|
|
15
|
+
if (a instanceof D) {
|
|
16
|
+
const m = (async () => {
|
|
17
|
+
const o = await h(a), r = await A(a, o);
|
|
18
|
+
s.set(a.id, { layerItem: r, fieldRegistry: o });
|
|
19
|
+
})();
|
|
20
|
+
n.push(m);
|
|
21
|
+
}
|
|
22
|
+
return await Promise.all(n), s;
|
|
23
|
+
}, O = async (e) => {
|
|
24
|
+
await W.whenOnce(() => e.ready);
|
|
25
|
+
const t = await I(e.map), { layers: n } = await U(t), s = {
|
|
26
|
+
schemaVersion: b,
|
|
27
|
+
modified: Date.now(),
|
|
28
|
+
embeddings: {
|
|
29
|
+
modelProvider: $,
|
|
30
|
+
model: w,
|
|
31
|
+
dimensions: v,
|
|
32
|
+
templates: {
|
|
33
|
+
layer: y,
|
|
34
|
+
field: f
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
layers: n
|
|
38
|
+
}, a = S.safeParse(s);
|
|
39
|
+
if (!a.success)
|
|
40
|
+
throw console.error("Schema Mismatch:", a.error.format()), new Error("Webmap embedding generation failed validation.");
|
|
41
|
+
return a.data;
|
|
42
|
+
}, U = async (e) => {
|
|
43
|
+
const t = [], n = [];
|
|
44
|
+
for (const [o, { fieldRegistry: r, layerItem: i }] of e.entries()) {
|
|
45
|
+
const l = g(y, {
|
|
46
|
+
name: i.name,
|
|
47
|
+
title: i.title,
|
|
48
|
+
description: i.description
|
|
49
|
+
});
|
|
50
|
+
t.push(l);
|
|
51
|
+
const d = {
|
|
52
|
+
id: o,
|
|
53
|
+
name: i.name ?? "",
|
|
54
|
+
title: i.title,
|
|
55
|
+
description: i.description,
|
|
56
|
+
vector: [],
|
|
57
|
+
fields: []
|
|
58
|
+
};
|
|
59
|
+
for (const [, c] of r.entries()) {
|
|
60
|
+
const u = g(f, {
|
|
61
|
+
name: c.name,
|
|
62
|
+
alias: c.alias,
|
|
63
|
+
description: c.description
|
|
64
|
+
});
|
|
65
|
+
t.push(u), d.fields.push({
|
|
66
|
+
name: c.name,
|
|
67
|
+
alias: c.alias,
|
|
68
|
+
description: c.description,
|
|
69
|
+
vector: []
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
n.push(d);
|
|
73
|
+
}
|
|
74
|
+
const s = await p(t);
|
|
75
|
+
let a = 0;
|
|
76
|
+
return { layers: n.map((o) => (o.vector = s[a++], o.fields.forEach((r) => {
|
|
77
|
+
r.vector = s[a++];
|
|
78
|
+
}), o)) };
|
|
79
|
+
}, g = (e, t) => e.replace(/\{(\w+)\}/gu, (n, s) => t[s] ?? ""), V = (e, t) => {
|
|
80
|
+
if (e.length !== t.length)
|
|
81
|
+
throw new Error("Vectors must be the same length");
|
|
82
|
+
let n = 0, s = 0, a = 0;
|
|
83
|
+
for (let r = 0; r < e.length; ++r) {
|
|
84
|
+
const i = e[r], l = t[r];
|
|
85
|
+
n += i * l, s += i * i, a += l * l;
|
|
86
|
+
}
|
|
87
|
+
const m = Math.sqrt(s * a);
|
|
88
|
+
if (m === 0)
|
|
89
|
+
return 0;
|
|
90
|
+
const o = n / m;
|
|
91
|
+
return Math.max(-1, Math.min(1, o));
|
|
92
|
+
}, Q = L, Y = E, Z = P, ee = M, te = p, ae = V, se = F, ne = C, oe = N, re = z, ie = H, ce = O, me = () => T(), le = () => R(), de = async (e, t) => await x(e, t), ge = async (e = "default", t = 0) => await k(e, t);
|
|
6
93
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
94
|
+
ie as ArcgisKnowledgeAgent,
|
|
95
|
+
oe as DataExplorationAgent,
|
|
96
|
+
re as HelpAgent,
|
|
97
|
+
ne as LayerStylingAgent,
|
|
98
|
+
se as NavigationAgent,
|
|
99
|
+
ye as Orchestrator,
|
|
100
|
+
ae as cosineSimilarity,
|
|
101
|
+
me as createAgentRuntimeState,
|
|
102
|
+
le as createAgentRuntimeStateWithSharedState,
|
|
103
|
+
ge as createChatModel,
|
|
104
|
+
ce as createWebmapEmbeddings,
|
|
105
|
+
te as getEmbeddings,
|
|
106
|
+
Y as invokeStructuredPrompt,
|
|
107
|
+
Q as invokeTextPrompt,
|
|
108
|
+
Z as invokeToolPrompt,
|
|
109
|
+
ee as sendTraceMessage,
|
|
110
|
+
de as sendUXSuggestion
|
|
13
111
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/ai-components",
|
|
3
|
-
"version": "5.1.0-next.
|
|
3
|
+
"version": "5.1.0-next.117",
|
|
4
4
|
"description": "ArcGIS AI Components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -9,6 +9,21 @@
|
|
|
9
9
|
"exports": {
|
|
10
10
|
".": "./dist/index.js",
|
|
11
11
|
"./loader": "./dist/loader.js",
|
|
12
|
+
"./agent-utils/BaseAgent.js": "./dist/agent-utils/BaseAgent.js",
|
|
13
|
+
"./agent-utils/FunctionAgent.js": "./dist/agent-utils/FunctionAgent.js",
|
|
14
|
+
"./agent-utils/LLMAgent.js": "./dist/agent-utils/LLMAgent.js",
|
|
15
|
+
"./agent-utils/WorkflowAgent.js": "./dist/agent-utils/WorkflowAgent.js",
|
|
16
|
+
"./agent-utils/tools/FunctionTool.js": "./dist/agent-utils/tools/FunctionTool.js",
|
|
17
|
+
"./agent-utils/workflows/ConditionalWorkflow.js": "./dist/agent-utils/workflows/ConditionalWorkflow.js",
|
|
18
|
+
"./agent-utils/workflows/LoopWorkflow.js": "./dist/agent-utils/workflows/LoopWorkflow.js",
|
|
19
|
+
"./agent-utils/workflows/ParallelWorkflow.js": "./dist/agent-utils/workflows/ParallelWorkflow.js",
|
|
20
|
+
"./agent-utils/workflows/RouterWorkflow.js": "./dist/agent-utils/workflows/RouterWorkflow.js",
|
|
21
|
+
"./agent-utils/workflows/SequentialWorkflow.js": "./dist/agent-utils/workflows/SequentialWorkflow.js",
|
|
22
|
+
"./agent-utils/workflows/SwitchWorkflow.js": "./dist/agent-utils/workflows/SwitchWorkflow.js",
|
|
23
|
+
"./agent-utils/middlewares/middleware.js": "./dist/agent-utils/middlewares/middleware.js",
|
|
24
|
+
"./agent-utils/middlewares/humanInTheLoop.js": "./dist/agent-utils/middlewares/humanInTheLoop.js",
|
|
25
|
+
"./agent-utils/middlewares/trace.js": "./dist/agent-utils/middlewares/trace.js",
|
|
26
|
+
"./agent-utils/middlewares/types.js": "./dist/agent-utils/middlewares/types.js",
|
|
12
27
|
"./utils/index.js": "./dist/utils/index.js",
|
|
13
28
|
"./package.json": "./package.json",
|
|
14
29
|
"./components/*/customElement": "./dist/components/*/customElement.js",
|
|
@@ -26,19 +41,19 @@
|
|
|
26
41
|
"@esri/arcgis-html-sanitizer": "~4.1.0",
|
|
27
42
|
"@langchain/core": "^1.1.39",
|
|
28
43
|
"@langchain/langgraph": "^1.2.6",
|
|
44
|
+
"@langchain/openai": "^1.4.3",
|
|
45
|
+
"langchain": "^1.3.1",
|
|
29
46
|
"lit": "^3.3.0",
|
|
30
47
|
"marked": "~18.0.4",
|
|
31
48
|
"tslib": "^2.8.1",
|
|
32
49
|
"zod": "^4.3.6",
|
|
33
|
-
"@arcgis/
|
|
34
|
-
"@arcgis/
|
|
35
|
-
"@arcgis/lumina": "5.1.0-next.115",
|
|
36
|
-
"@arcgis/toolkit": "5.1.0-next.115"
|
|
50
|
+
"@arcgis/lumina": "5.1.0-next.117",
|
|
51
|
+
"@arcgis/toolkit": "5.1.0-next.117"
|
|
37
52
|
},
|
|
38
53
|
"peerDependencies": {
|
|
39
54
|
"@arcgis/core": "^5.1.0-next",
|
|
40
|
-
"@esri/calcite-components": "^5.1.0-next.
|
|
41
|
-
"@arcgis/map-components": "~5.1.0-next.
|
|
55
|
+
"@esri/calcite-components": "^5.1.0-next.60",
|
|
56
|
+
"@arcgis/map-components": "~5.1.0-next.117"
|
|
42
57
|
},
|
|
43
58
|
"css.customData": [
|
|
44
59
|
"dist/docs/vscode.css-custom-data.json"
|
package/dist/cdn/F746AXM6.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import c from"./NWLDMNBB.js";import b from"./RYEH3CUI.js";import"./HFNOF6ZK.js";import{a as e,c as a}from"./EJWQC2SL.js";import"./47QQSSPB.js";import"./YGW7TUNX.js";import{v as s,y as r}from"./J2F4YIQI.js";import"./CFDTXKJ6.js";export default $arcgis.t(([,{c:i}])=>{var t=class extends s{constructor(){super(...arguments),this.agent=i}static{this.properties={referenceElement:1}}#t;getContext(){if(!this.#t)throw new Error("arcgis-assistant-layer-styling-agent requires a mapView");return{mapView:this.#t}}load(){this.#t=e(this,"arcgis-assistant-layer-styling-agent"),a(this)}};r("arcgis-assistant-layer-styling-agent",t);return t},b,c)
|
package/dist/cdn/HKVQQV3Z.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import c from"./NWLDMNBB.js";import b from"./RYEH3CUI.js";import"./HFNOF6ZK.js";import{a as r,c as e}from"./EJWQC2SL.js";import"./47QQSSPB.js";import"./YGW7TUNX.js";import{v as a,y as s}from"./J2F4YIQI.js";import"./CFDTXKJ6.js";export default $arcgis.t(([,{b:i}])=>{var t=class extends a{constructor(){super(...arguments),this.agent=i}static{this.properties={referenceElement:1}}#t;getContext(){if(!this.#t)throw new Error("arcgis-assistant-data-exploration-agent requires a mapView");return{mapView:this.#t}}load(){this.#t=r(this,"arcgis-assistant-data-exploration-agent"),e(this)}};s("arcgis-assistant-data-exploration-agent",t);return t},b,c)
|