@arcgis/ai-components 5.2.0-next.7 → 5.2.0-next.9
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/cdn/{BFZJNJL6.js → 53ZCUPKK.js} +1 -1
- package/dist/cdn/{GCQLVNNC.js → 5XRDJL7R.js} +1 -1
- package/dist/cdn/{AEJHYRGT.js → EECZLT6C.js} +1 -1
- package/dist/cdn/{JV4SI65E.js → ETRWZ3MS.js} +1 -1
- package/dist/cdn/{VOQX4AVB.js → GGSZM7KV.js} +1 -1
- package/dist/cdn/{3NI46YCE.js → I6HNBTWY.js} +1 -1
- package/dist/cdn/{NAUXSHIE.js → I7SRZPVS.js} +1 -1
- package/dist/cdn/{R6HV42YW.js → IG6YKZH3.js} +1 -1
- package/dist/cdn/{P6OPJQMC.js → JVIKKZND.js} +1 -1
- package/dist/cdn/{47FWPQ2A.js → P26NON3Z.js} +1 -1
- package/dist/cdn/{V7OJRG26.js → S3VPZFWQ.js} +1 -1
- package/dist/cdn/{AO7BQHKC.js → TR7RL3IK.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/generateLayerDescriptions.js +0 -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/utils/index.d.ts +92 -45
- package/dist/utils/index.js +78 -64
- package/package.json +5 -5
package/dist/utils/index.js
CHANGED
|
@@ -1,101 +1,115 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
import { g as p } from "../chunks/orchestrator.js";
|
|
3
|
-
import { O as
|
|
4
|
-
import { g as
|
|
5
|
-
import
|
|
6
|
-
import * as
|
|
7
|
-
import { N as
|
|
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
8
|
import { L as C } from "../chunks/layerStylingGraph.js";
|
|
9
9
|
import { D as N } from "../chunks/dataExplorationGraph.js";
|
|
10
10
|
import { H as z } from "../chunks/helpGraph.js";
|
|
11
11
|
import { A as H } from "../chunks/arcgisKnowledgeGraph.js";
|
|
12
|
-
const I = async (
|
|
13
|
-
const
|
|
14
|
-
for (const a of
|
|
15
|
-
if (a instanceof
|
|
12
|
+
const I = async (e) => {
|
|
13
|
+
const t = e.allLayers.toArray(), s = [], n = /* @__PURE__ */ new Map();
|
|
14
|
+
for (const a of t)
|
|
15
|
+
if (a instanceof D) {
|
|
16
16
|
const m = (async () => {
|
|
17
|
-
const
|
|
18
|
-
|
|
17
|
+
const o = await h(a), r = await A(a, o);
|
|
18
|
+
n.set(a.id, { layerItem: r, fieldRegistry: o });
|
|
19
19
|
})();
|
|
20
20
|
s.push(m);
|
|
21
21
|
}
|
|
22
|
-
return await Promise.all(s),
|
|
23
|
-
}, O = async (
|
|
24
|
-
await
|
|
25
|
-
const
|
|
22
|
+
return await Promise.all(s), n;
|
|
23
|
+
}, O = async (e) => {
|
|
24
|
+
await W.whenOnce(() => e.ready);
|
|
25
|
+
const t = await I(e.map), { layers: s } = await U(t), n = {
|
|
26
26
|
schemaVersion: b,
|
|
27
27
|
modified: Date.now(),
|
|
28
28
|
embeddings: {
|
|
29
29
|
modelProvider: $,
|
|
30
30
|
model: w,
|
|
31
|
-
dimensions:
|
|
31
|
+
dimensions: v,
|
|
32
32
|
templates: {
|
|
33
|
-
layer:
|
|
34
|
-
field:
|
|
33
|
+
layer: y,
|
|
34
|
+
field: f
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
layers: s
|
|
38
|
-
}, a =
|
|
38
|
+
}, a = S.safeParse(n);
|
|
39
39
|
if (!a.success)
|
|
40
40
|
throw console.error("Schema Mismatch:", a.error.format()), new Error("Webmap embedding generation failed validation.");
|
|
41
41
|
return a.data;
|
|
42
|
-
}, U = async (
|
|
43
|
-
const
|
|
44
|
-
for (const [
|
|
45
|
-
const
|
|
46
|
-
name:
|
|
47
|
-
title:
|
|
48
|
-
description:
|
|
42
|
+
}, U = async (e) => {
|
|
43
|
+
const t = [], s = [];
|
|
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
49
|
});
|
|
50
|
-
|
|
50
|
+
t.push(l);
|
|
51
51
|
const d = {
|
|
52
|
-
id:
|
|
53
|
-
name:
|
|
54
|
-
title:
|
|
55
|
-
description:
|
|
52
|
+
id: o,
|
|
53
|
+
name: i.name ?? "",
|
|
54
|
+
title: i.title,
|
|
55
|
+
description: i.description,
|
|
56
56
|
vector: [],
|
|
57
57
|
fields: []
|
|
58
58
|
};
|
|
59
|
-
for (const [,
|
|
60
|
-
const u =
|
|
61
|
-
name:
|
|
62
|
-
alias:
|
|
63
|
-
description:
|
|
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
64
|
});
|
|
65
|
-
|
|
66
|
-
name:
|
|
67
|
-
alias:
|
|
68
|
-
description:
|
|
65
|
+
t.push(u), d.fields.push({
|
|
66
|
+
name: c.name,
|
|
67
|
+
alias: c.alias,
|
|
68
|
+
description: c.description,
|
|
69
69
|
vector: []
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
s.push(d);
|
|
73
73
|
}
|
|
74
|
-
const
|
|
74
|
+
const n = await p(t);
|
|
75
75
|
let a = 0;
|
|
76
|
-
return { layers: s.map((
|
|
77
|
-
|
|
78
|
-
}),
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
return { layers: s.map((o) => (o.vector = n[a++], o.fields.forEach((r) => {
|
|
77
|
+
r.vector = n[a++];
|
|
78
|
+
}), o)) };
|
|
79
|
+
}, g = (e, t) => e.replace(/\{(\w+)\}/gu, (s, n) => t[n] ?? ""), V = (e, t) => {
|
|
80
|
+
if (e.length !== t.length)
|
|
81
|
+
throw new Error("Vectors must be the same length");
|
|
82
|
+
let s = 0, n = 0, a = 0;
|
|
83
|
+
for (let r = 0; r < e.length; ++r) {
|
|
84
|
+
const i = e[r], l = t[r];
|
|
85
|
+
s += i * l, n += i * i, a += l * l;
|
|
86
|
+
}
|
|
87
|
+
const m = Math.sqrt(n * a);
|
|
88
|
+
if (m === 0)
|
|
89
|
+
return 0;
|
|
90
|
+
const o = s / 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 ({
|
|
93
|
+
modelTier: e = "default",
|
|
94
|
+
temperature: t = 0,
|
|
82
95
|
abortSignal: s
|
|
83
|
-
} = {}) => await
|
|
96
|
+
} = {}) => await k({ modelTier: e, temperature: t, abortSignal: s });
|
|
84
97
|
export {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
Z as
|
|
100
|
-
|
|
98
|
+
ie as ArcgisKnowledgeAgent,
|
|
99
|
+
oe as DataExplorationAgent,
|
|
100
|
+
re as HelpAgent,
|
|
101
|
+
ne as LayerStylingAgent,
|
|
102
|
+
se as NavigationAgent,
|
|
103
|
+
ye as Orchestrator,
|
|
104
|
+
ae as cosineSimilarity,
|
|
105
|
+
me as createAgentRuntimeState,
|
|
106
|
+
le as createAgentRuntimeStateWithSharedState,
|
|
107
|
+
ge as createChatModel,
|
|
108
|
+
ce as createWebmapEmbeddings,
|
|
109
|
+
te as getEmbeddings,
|
|
110
|
+
Y as invokeStructuredPrompt,
|
|
111
|
+
Q as invokeTextPrompt,
|
|
112
|
+
Z as invokeToolPrompt,
|
|
113
|
+
ee as sendTraceMessage,
|
|
114
|
+
de as sendUXSuggestion
|
|
101
115
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/ai-components",
|
|
3
|
-
"version": "5.2.0-next.
|
|
3
|
+
"version": "5.2.0-next.9",
|
|
4
4
|
"description": "ArcGIS AI Components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -44,16 +44,16 @@
|
|
|
44
44
|
"@langchain/openai": "^1.4.3",
|
|
45
45
|
"langchain": "^1.3.1",
|
|
46
46
|
"lit": "^3.3.0",
|
|
47
|
-
"marked": "~18.0.
|
|
47
|
+
"marked": "~18.0.5",
|
|
48
48
|
"tslib": "^2.8.1",
|
|
49
49
|
"zod": "^4.3.6",
|
|
50
|
-
"@arcgis/lumina": "5.2.0-next.
|
|
51
|
-
"@arcgis/toolkit": "5.2.0-next.
|
|
50
|
+
"@arcgis/lumina": "5.2.0-next.9",
|
|
51
|
+
"@arcgis/toolkit": "5.2.0-next.9"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@arcgis/core": "^5.2.0-next",
|
|
55
55
|
"@esri/calcite-components": "^5.1.1-next.3",
|
|
56
|
-
"@arcgis/map-components": "~5.2.0-next.
|
|
56
|
+
"@arcgis/map-components": "~5.2.0-next.9"
|
|
57
57
|
},
|
|
58
58
|
"css.customData": [
|
|
59
59
|
"dist/docs/vscode.css-custom-data.json"
|