@arcgis/ai-components 5.2.0-next.7 → 5.2.0-next.8

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.
@@ -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 ge } from "../chunks/orchestrator.js";
4
- import { g as A, a as h, W as v, f as g, l as f, d as S, m as w, b as $, e as b, i as L, h as P, j as E, s as T, k as R, n as k, c as D, o as W } from "../chunks/generateLayerDescriptions.js";
5
- import x from "@arcgis/core/layers/FeatureLayer.js";
6
- import * as F from "@arcgis/core/core/reactiveUtils.js";
7
- import { N as M } from "../chunks/navigationGraph.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
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 (t) => {
13
- const e = t.allLayers.toArray(), s = [], o = /* @__PURE__ */ new Map();
14
- for (const a of e)
15
- if (a instanceof x) {
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 r = await A(a), c = await h(a, r);
18
- o.set(a.id, { layerItem: c, fieldRegistry: r });
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), o;
23
- }, O = async (t) => {
24
- await F.whenOnce(() => t.ready);
25
- const e = await I(t.map), { layers: s } = await U(e), o = {
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: S,
31
+ dimensions: v,
32
32
  templates: {
33
- layer: f,
34
- field: g
33
+ layer: y,
34
+ field: f
35
35
  }
36
36
  },
37
37
  layers: s
38
- }, a = v.safeParse(o);
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 (t) => {
43
- const e = [], s = [];
44
- for (const [r, { fieldRegistry: c, layerItem: n }] of t.entries()) {
45
- const y = l(f, {
46
- name: n.name,
47
- title: n.title,
48
- description: n.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
- e.push(y);
50
+ t.push(l);
51
51
  const d = {
52
- id: r,
53
- name: n.name ?? "",
54
- title: n.title,
55
- description: n.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 [, i] of c.entries()) {
60
- const u = l(g, {
61
- name: i.name,
62
- alias: i.alias,
63
- description: i.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
- e.push(u), d.fields.push({
66
- name: i.name,
67
- alias: i.alias,
68
- description: i.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 o = await p(e);
74
+ const n = await p(t);
75
75
  let a = 0;
76
- return { layers: s.map((r) => (r.vector = o[a++], r.fields.forEach((c) => {
77
- c.vector = o[a++];
78
- }), r)) };
79
- }, l = (t, e) => t.replace(/\{(\w+)\}/gu, (s, o) => e[o] ?? ""), J = P, Q = L, Y = E, Z = T, ee = p, te = M, ae = C, se = N, oe = z, re = H, ne = O, ie = () => R(), ce = () => k(), me = async (t, e) => await W(t, e), de = async ({
80
- modelTier: t = "default",
81
- temperature: e = 0,
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 D({ modelTier: t, temperature: e, abortSignal: s });
96
+ } = {}) => await k({ modelTier: e, temperature: t, abortSignal: s });
84
97
  export {
85
- re as ArcgisKnowledgeAgent,
86
- se as DataExplorationAgent,
87
- oe as HelpAgent,
88
- ae as LayerStylingAgent,
89
- te as NavigationAgent,
90
- ge as Orchestrator,
91
- ie as createAgentRuntimeState,
92
- ce as createAgentRuntimeStateWithSharedState,
93
- de as createChatModel,
94
- ne as createWebmapEmbeddings,
95
- ee as getEmbeddings,
96
- Q as invokeStructuredPrompt,
97
- J as invokeTextPrompt,
98
- Y as invokeToolPrompt,
99
- Z as sendTraceMessage,
100
- me as sendUXSuggestion
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.7",
3
+ "version": "5.2.0-next.8",
4
4
  "description": "ArcGIS AI Components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -47,13 +47,13 @@
47
47
  "marked": "~18.0.4",
48
48
  "tslib": "^2.8.1",
49
49
  "zod": "^4.3.6",
50
- "@arcgis/lumina": "5.2.0-next.7",
51
- "@arcgis/toolkit": "5.2.0-next.7"
50
+ "@arcgis/toolkit": "5.2.0-next.8",
51
+ "@arcgis/lumina": "5.2.0-next.8"
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.7"
56
+ "@arcgis/map-components": "~5.2.0-next.8"
57
57
  },
58
58
  "css.customData": [
59
59
  "dist/docs/vscode.css-custom-data.json"