@arcgis/ai-components 5.2.0-next.86 → 5.2.0-next.87
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/WorkflowAgent.js +14 -15
- package/dist/cdn/{7GMCLVSZ.js → 7XY54M57.js} +1 -1
- package/dist/cdn/{DPALM2OW.js → B3YSZHAE.js} +1 -1
- package/dist/cdn/{3POGAH2X.js → CF6ZLMFG.js} +1 -1
- package/dist/cdn/{6NHYXISD.js → HNL4WZKH.js} +1 -1
- package/dist/cdn/{7Q5EESAR.js → IOKXNJWG.js} +1 -1
- package/dist/cdn/{7TXR75RG.js → JKMZQOJQ.js} +1 -1
- package/dist/cdn/{E7JZ7GUW.js → LF2LOV25.js} +1 -1
- package/dist/cdn/{4QGVOLW6.js → NTBDGSXI.js} +1 -1
- package/dist/cdn/OL5656NI.js +2 -0
- package/dist/cdn/{ZRESBCJL.js → PNFK73E5.js} +1 -1
- package/dist/cdn/{RWWOOC7S.js → R4GPUHUB.js} +1 -1
- package/dist/cdn/{WLH47YFC.js → TAJLCMAG.js} +1 -1
- package/dist/cdn/{F2J6BMMX.js → WPKGJJ57.js} +1 -1
- package/dist/cdn/{UEEH5ZQK.js → Y2776DWQ.js} +28 -28
- package/dist/cdn/agent-utils/index.js +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/adapter.js +90 -91
- package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +0 -1
- package/dist/components/arcgis-assistant-help-agent/customElement.js +0 -1
- package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +5 -6
- package/dist/components/arcgis-assistant-navigation-agent/customElement.js +0 -1
- package/dist/components/arcgis-assistant-speech-input/customElement.js +15 -16
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +7 -7
- package/dist/cdn/KPO4XX6J.js +0 -2
package/dist/chunks/adapter.js
CHANGED
|
@@ -26,7 +26,7 @@ import c from "zod";
|
|
|
26
26
|
import { tool as g } from "@langchain/core/tools";
|
|
27
27
|
import { createRenderer as be } from "@arcgis/core/smartMapping/renderers/pieChart.js";
|
|
28
28
|
import { getSchemesByTag as Te, getSchemes as Se } from "@arcgis/core/smartMapping/symbology/pieChart.js";
|
|
29
|
-
import { getBackgroundColorTheme as
|
|
29
|
+
import { getBackgroundColorTheme as X } from "@arcgis/core/views/support/colorUtils.js";
|
|
30
30
|
import { createAgeRenderer as ve, createContinuousRenderer as Re } from "@arcgis/core/smartMapping/renderers/color.js";
|
|
31
31
|
import { getSchemesByTag as V } from "@arcgis/core/smartMapping/symbology/color.js";
|
|
32
32
|
import { createContinuousRenderer as xe } from "@arcgis/core/smartMapping/renderers/univariateColorSize.js";
|
|
@@ -43,11 +43,10 @@ import { createRenderer as De } from "@arcgis/core/smartMapping/renderers/type.j
|
|
|
43
43
|
import { getSchemesByTag as Le } from "@arcgis/core/smartMapping/symbology/type.js";
|
|
44
44
|
import Ge from "@arcgis/core/WebLinkChart.js";
|
|
45
45
|
import re from "@arcgis/core/rest/knowledgeGraph/GraphQueryStreaming.js";
|
|
46
|
-
import "@arcgis/core/
|
|
47
|
-
import { fetchKnowledgeGraph as Z, executeQueryStreaming as je, executeSearchStreaming as Fe } from "@arcgis/core/rest/knowledgeGraphService.js";
|
|
46
|
+
import { fetchKnowledgeGraph as Y, executeQueryStreaming as je, executeSearchStreaming as Fe } from "@arcgis/core/rest/knowledgeGraphService.js";
|
|
48
47
|
import _e from "@arcgis/core/rest/knowledgeGraph/GraphSearchStreaming.js";
|
|
49
48
|
import { getBindParametersFromCypherQuery as Qe } from "@arcgis/core/applications/KnowledgeStudio/generalSharedKgUtils.js";
|
|
50
|
-
const k = (e, t) => t ?? e,
|
|
49
|
+
const k = (e, t) => t ?? e, Sa = m.Root({
|
|
51
50
|
...pe(),
|
|
52
51
|
// internal to the navigation agent
|
|
53
52
|
intent: m({
|
|
@@ -66,7 +65,7 @@ const k = (e, t) => t ?? e, va = m.Root({
|
|
|
66
65
|
toolCallMessage: void 0
|
|
67
66
|
})
|
|
68
67
|
})
|
|
69
|
-
}),
|
|
68
|
+
}), Z = /* @__PURE__ */ Object.assign({
|
|
70
69
|
"../agents/arcgisKnowledge/prompts/arcgis_knowledge_current_lc_context.md": () => import("./arcgis_knowledge_current_lc_context.js").then((e) => e.default),
|
|
71
70
|
"../agents/arcgisKnowledge/prompts/arcgis_knowledge_current_map_context.md": () => import("./arcgis_knowledge_current_map_context.js").then((e) => e.default),
|
|
72
71
|
"../agents/arcgisKnowledge/prompts/arcgis_knowledge_cypher_query_prompt.md": () => import("./arcgis_knowledge_cypher_query_prompt.js").then((e) => e.default),
|
|
@@ -82,24 +81,24 @@ const k = (e, t) => t ?? e, va = m.Root({
|
|
|
82
81
|
"../agents/navigation/prompts/navigation_tool_prompt.md": () => import("./navigation_tool_prompt.js").then((e) => e.default)
|
|
83
82
|
});
|
|
84
83
|
async function L(e) {
|
|
85
|
-
const t = Object.entries(
|
|
84
|
+
const t = Object.entries(Z).find(([r]) => r.endsWith(`/${e}.md`));
|
|
86
85
|
if (!t)
|
|
87
86
|
throw new Error(`Prompt not found: ${e}
|
|
88
87
|
Available prompts:
|
|
89
|
-
${Object.keys(
|
|
88
|
+
${Object.keys(Z).join(`
|
|
90
89
|
`)}`);
|
|
91
90
|
return await t[1]();
|
|
92
91
|
}
|
|
93
92
|
const Ie = (e, t = 300) => {
|
|
94
93
|
const r = e.replace(/\s+/gu, " ").replace(/[*_`#>\-]/gu, "").trim();
|
|
95
94
|
return r.length > t ? `${r.slice(0, t)}...` : r;
|
|
96
|
-
},
|
|
95
|
+
}, va = (e, t) => (r, a) => {
|
|
97
96
|
const o = a?.configurable?.services;
|
|
98
97
|
for (const i of e)
|
|
99
98
|
if (!o?.[i])
|
|
100
99
|
throw new Error(`${t} requires services.${i} to be available.`);
|
|
101
100
|
return r;
|
|
102
|
-
},
|
|
101
|
+
}, Ra = m.Root({
|
|
103
102
|
...G(),
|
|
104
103
|
vectorSearchLayerIds: m(),
|
|
105
104
|
vectorSearchFieldResults: m(),
|
|
@@ -109,8 +108,8 @@ const Ie = (e, t = 300) => {
|
|
|
109
108
|
reducer: ee,
|
|
110
109
|
default: () => []
|
|
111
110
|
})
|
|
112
|
-
}), Oe = [me, ge, fe, we],
|
|
113
|
-
async function
|
|
111
|
+
}), Oe = [me, ge, fe, we], xa = [ye, he, ue], Ke = new de(Oe, { handleToolErrors: !1 });
|
|
112
|
+
async function Ca(e, t) {
|
|
114
113
|
const { messages: r } = await Ke.invoke({ messages: e.dataExplorationMessages }, t), a = [], o = [];
|
|
115
114
|
for (const i of r) {
|
|
116
115
|
const s = i.content;
|
|
@@ -151,12 +150,12 @@ async function Ve(e) {
|
|
|
151
150
|
const { fields: t, layer: r, view: a, styleName: o, colorSchemeTags: i } = e;
|
|
152
151
|
let s;
|
|
153
152
|
return i ? s = Te({
|
|
154
|
-
basemapTheme: await
|
|
153
|
+
basemapTheme: await X(a),
|
|
155
154
|
geometryType: r.geometryType,
|
|
156
155
|
includedTags: i,
|
|
157
156
|
numColors: Math.min(t.length, 8)
|
|
158
157
|
})[0] : s = Se({
|
|
159
|
-
basemapTheme: await
|
|
158
|
+
basemapTheme: await X(a),
|
|
160
159
|
geometryType: r.geometryType,
|
|
161
160
|
numColors: Math.min(t.length, 8)
|
|
162
161
|
}).primaryScheme, {
|
|
@@ -172,10 +171,10 @@ async function Ve(e) {
|
|
|
172
171
|
pieChartScheme: s
|
|
173
172
|
};
|
|
174
173
|
}
|
|
175
|
-
async function
|
|
174
|
+
async function Be(e) {
|
|
176
175
|
return await be(e);
|
|
177
176
|
}
|
|
178
|
-
async function
|
|
177
|
+
async function We({
|
|
179
178
|
arcgisMap: e,
|
|
180
179
|
arcgisMapView: t,
|
|
181
180
|
layerId: r,
|
|
@@ -194,7 +193,7 @@ async function Be({
|
|
|
194
193
|
colorSchemeTags: o
|
|
195
194
|
};
|
|
196
195
|
try {
|
|
197
|
-
const d = await Ve(p), u = await
|
|
196
|
+
const d = await Ve(p), u = await Be(d);
|
|
198
197
|
return n.renderer = u.renderer, n.visible = !0, `Chart renderer applied to layer: ${n.title ?? n.id} using fields ${a.join(", ")}`;
|
|
199
198
|
} catch (d) {
|
|
200
199
|
return `Error applying chart renderer: ${d instanceof Error ? d.message : String(d)}`;
|
|
@@ -217,7 +216,7 @@ async function He({
|
|
|
217
216
|
includeSize: a
|
|
218
217
|
}, o) {
|
|
219
218
|
const { mapView: i } = v(o);
|
|
220
|
-
return await S({ type: "show-legend", data: { layerIds: [e] } }, o), await
|
|
219
|
+
return await S({ type: "show-legend", data: { layerIds: [e] } }, o), await We({
|
|
221
220
|
arcgisMap: i.map,
|
|
222
221
|
arcgisMapView: i,
|
|
223
222
|
layerId: e,
|
|
@@ -231,7 +230,7 @@ const Je = c.object({
|
|
|
231
230
|
fields: c.array(c.string()).describe("The fields to use for the chart renderer (multiple numeric fields)"),
|
|
232
231
|
colorSchemes: c.array(c.string()).optional().describe("Optional color scheme tags to use"),
|
|
233
232
|
includeSize: c.boolean().optional().describe("Whether to vary the chart size (chart-size)")
|
|
234
|
-
}),
|
|
233
|
+
}), $a = g(He, {
|
|
235
234
|
name: "chart",
|
|
236
235
|
description: `Label: Charts
|
|
237
236
|
Description: Show the values of two or more categories as a proportion of the total using a pie chart.
|
|
@@ -246,7 +245,7 @@ const Je = c.object({
|
|
|
246
245
|
Fields: This style requires 2-8 number fields.`,
|
|
247
246
|
schema: Je
|
|
248
247
|
});
|
|
249
|
-
function
|
|
248
|
+
function Xe(e) {
|
|
250
249
|
const { fields: t, layer: r, view: a, theme: o, colorSchemeTags: i } = e, s = t[0];
|
|
251
250
|
let n;
|
|
252
251
|
return i && (n = V({
|
|
@@ -264,10 +263,10 @@ function Ye(e) {
|
|
|
264
263
|
colorScheme: n
|
|
265
264
|
};
|
|
266
265
|
}
|
|
267
|
-
async function
|
|
266
|
+
async function Ye(e) {
|
|
268
267
|
return await ve(e);
|
|
269
268
|
}
|
|
270
|
-
async function
|
|
269
|
+
async function Ze({
|
|
271
270
|
arcgisMap: e,
|
|
272
271
|
arcgisMapView: t,
|
|
273
272
|
layerId: r,
|
|
@@ -287,7 +286,7 @@ async function Xe({
|
|
|
287
286
|
theme: i
|
|
288
287
|
};
|
|
289
288
|
try {
|
|
290
|
-
const p =
|
|
289
|
+
const p = Xe(l), d = await Ye(p);
|
|
291
290
|
return n.renderer = d.renderer, n.visible = !0, `Color-age renderer applied to layer: ${n.title ?? n.id} using fields ${a.join(", ")}`;
|
|
292
291
|
} catch (p) {
|
|
293
292
|
return `Error applying color-age renderer: ${p instanceof Error ? p.message : String(p)}`;
|
|
@@ -300,7 +299,7 @@ async function er({
|
|
|
300
299
|
theme: a
|
|
301
300
|
}, o) {
|
|
302
301
|
const { mapView: i } = v(o);
|
|
303
|
-
return await S({ type: "show-legend", data: { layerIds: [e] } }, o), await
|
|
302
|
+
return await S({ type: "show-legend", data: { layerIds: [e] } }, o), await Ze({
|
|
304
303
|
arcgisMap: i.map,
|
|
305
304
|
arcgisMapView: i,
|
|
306
305
|
layerId: e,
|
|
@@ -314,7 +313,7 @@ const rr = c.object({
|
|
|
314
313
|
fields: c.array(c.string()).describe("The field(s) to use for the color-age renderer (temporal/date data)"),
|
|
315
314
|
colorSchemes: c.array(c.string()).optional().describe("Optional color scheme tags to use"),
|
|
316
315
|
theme: c.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the color ramp")
|
|
317
|
-
}),
|
|
316
|
+
}), Pa = g(er, {
|
|
318
317
|
name: "color-age",
|
|
319
318
|
description: `Label: Age (color)
|
|
320
319
|
Description: Use colors along a continuous color ramp to represent the age of features. Age reflects the length of time from a start date to an end date.
|
|
@@ -393,7 +392,7 @@ const ir = c.object({
|
|
|
393
392
|
fields: c.array(c.string()).describe("The field(s) to use for the color renderer"),
|
|
394
393
|
colorSchemes: c.array(c.string()).optional().describe("Optional color scheme tags to use"),
|
|
395
394
|
theme: c.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the color ramp")
|
|
396
|
-
}),
|
|
395
|
+
}), Ea = g(nr, {
|
|
397
396
|
name: "color",
|
|
398
397
|
description: `Label: Counts and Amounts (color)
|
|
399
398
|
Description: Vary color along a continuous color ramp to represent numeric or ranked data.
|
|
@@ -471,7 +470,7 @@ const dr = c.object({
|
|
|
471
470
|
fields: c.array(c.string()).describe("The fields to use for the color-size univariate renderer"),
|
|
472
471
|
colorSchemes: c.array(c.string()).optional().describe("Optional color scheme tags to use"),
|
|
473
472
|
theme: c.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the color and size ramps")
|
|
474
|
-
}),
|
|
473
|
+
}), za = g(pr, {
|
|
475
474
|
name: "color-size-univariate",
|
|
476
475
|
description: `Label: Color and Size (univariate)
|
|
477
476
|
Description: Vary symbol size and color based on the values of two numeric attributes.
|
|
@@ -545,7 +544,7 @@ const gr = c.object({
|
|
|
545
544
|
layerId: c.string().describe("The id of the layer to apply the dot density renderer to"),
|
|
546
545
|
fields: c.array(c.string()).describe("The field(s) to use for the dot density renderer (population or count data)"),
|
|
547
546
|
colorSchemes: c.array(c.string()).optional().describe("Optional color scheme tags to use")
|
|
548
|
-
}),
|
|
547
|
+
}), ka = g(mr, {
|
|
549
548
|
name: "dot-density",
|
|
550
549
|
description: `Dot Density
|
|
551
550
|
Use dot density to visualize the distribution of one attribute or compare the density of multiple attributes. This is only valid for polygon layers.
|
|
@@ -620,7 +619,7 @@ const Sr = c.object({
|
|
|
620
619
|
layerId: c.string().describe("The id of the layer to apply the heatmap renderer to"),
|
|
621
620
|
fields: c.array(c.string()).describe("The field(s) to use for the heatmap renderer (typically point density)"),
|
|
622
621
|
colorSchemes: c.array(c.string()).optional().describe("Optional color scheme tags to use")
|
|
623
|
-
}),
|
|
622
|
+
}), Aa = g(Tr, {
|
|
624
623
|
name: "heatmap",
|
|
625
624
|
description: `Label: Heat Map
|
|
626
625
|
Description: Show areas of high density with colors that appear to glow hotter. This is only valid for point layers.
|
|
@@ -695,7 +694,7 @@ const $r = c.object({
|
|
|
695
694
|
fields: c.array(c.string()).describe("The fields to use for the predominance renderer (competing categories)"),
|
|
696
695
|
colorSchemes: c.array(c.string()).optional().describe("Optional color scheme tags to use"),
|
|
697
696
|
includeSize: c.boolean().optional().describe("Whether to include size visualization (predominance-size)")
|
|
698
|
-
}),
|
|
697
|
+
}), qa = g(Cr, {
|
|
699
698
|
name: "predominance",
|
|
700
699
|
description: `Label: Predominant category
|
|
701
700
|
Description: Compare attributes that share a common subject and unit of measurement to see which has the highest value.
|
|
@@ -776,7 +775,7 @@ const Ar = c.object({
|
|
|
776
775
|
layerId: c.string().describe("The id of the layer to apply the relationship renderer to"),
|
|
777
776
|
fields: c.array(c.string()).describe("The two fields to use for the relationship renderer (bivariate visualization)"),
|
|
778
777
|
colorSchemes: c.array(c.string()).optional().describe("Optional color scheme tags to use")
|
|
779
|
-
}),
|
|
778
|
+
}), Na = g(kr, {
|
|
780
779
|
name: "relationship",
|
|
781
780
|
description: `Label: Relationship
|
|
782
781
|
Description: Overlays two color ramps to represent the relationship between two numeric attributes.
|
|
@@ -847,7 +846,7 @@ const Lr = c.object({
|
|
|
847
846
|
fields: c.array(c.string()).describe("The field(s) to use for the size-age renderer (temporal data with size)"),
|
|
848
847
|
colorSchemes: c.array(c.string()).optional().describe("Optional color scheme tags to use"),
|
|
849
848
|
theme: c.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the size ramp")
|
|
850
|
-
}),
|
|
849
|
+
}), Ma = g(Dr, {
|
|
851
850
|
name: "size-age",
|
|
852
851
|
description: `Label: Age (size)
|
|
853
852
|
Description: Vary symbol sizes along a continuous ramp to represent the age of features. Age reflects the length of time from a start date to an end date.
|
|
@@ -920,7 +919,7 @@ const Qr = c.object({
|
|
|
920
919
|
fields: c.array(c.string()).describe("The field(s) to use for the size renderer (numeric data)"),
|
|
921
920
|
colorSchemes: c.array(c.string()).optional().describe("Optional color scheme tags to use"),
|
|
922
921
|
theme: c.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the size ramp")
|
|
923
|
-
}),
|
|
922
|
+
}), Da = g(_r, {
|
|
924
923
|
name: "size",
|
|
925
924
|
description: `Label: Counts and Amounts (size)
|
|
926
925
|
Description: Vary symbol sizes along a continuous ramp to represent numeric or ranked data.
|
|
@@ -997,26 +996,26 @@ async function Vr({
|
|
|
997
996
|
theme: a
|
|
998
997
|
});
|
|
999
998
|
}
|
|
1000
|
-
const
|
|
999
|
+
const Br = c.object({
|
|
1001
1000
|
layerId: c.string().describe("The id of the layer to apply the type renderer to"),
|
|
1002
1001
|
fields: c.array(c.string()).describe("The field(s) to use for the type renderer (categorical data)"),
|
|
1003
1002
|
colorSchemes: c.array(c.string()).optional().describe("Optional color scheme tags to use"),
|
|
1004
1003
|
theme: c.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the color scheme")
|
|
1005
|
-
}),
|
|
1004
|
+
}), La = g(Vr, {
|
|
1006
1005
|
name: "type",
|
|
1007
1006
|
description: `Label: Types (unique symbols)
|
|
1008
1007
|
Description: Represent features as categories with different symbol colors or shapes. Examples include type of tree, road class, or province name.
|
|
1009
1008
|
Keywords: categorical, category, type, unique, discrete, point of interest, region, group
|
|
1010
1009
|
Example: Color each feature based on the region it belongs to
|
|
1011
1010
|
Fields: This style requires a single field which may be a string, number, or date type. It is usually a string.`,
|
|
1012
|
-
schema:
|
|
1013
|
-
}),
|
|
1011
|
+
schema: Br
|
|
1012
|
+
}), Ga = m.Root({
|
|
1014
1013
|
...G(),
|
|
1015
1014
|
vectorSearchLayerIds: m(),
|
|
1016
1015
|
vectorSearchFieldResults: m(),
|
|
1017
1016
|
layerFieldInfo: m(),
|
|
1018
1017
|
selectedLayerId: m()
|
|
1019
|
-
}),
|
|
1018
|
+
}), ja = m.Root({
|
|
1020
1019
|
...G(),
|
|
1021
1020
|
// internal to the help agent
|
|
1022
1021
|
helpInternalState: m({
|
|
@@ -1025,7 +1024,7 @@ Fields: This style requires a single field which may be a string, number, or dat
|
|
|
1025
1024
|
toolCallMessage: void 0
|
|
1026
1025
|
})
|
|
1027
1026
|
})
|
|
1028
|
-
}),
|
|
1027
|
+
}), Fa = m.Root({
|
|
1029
1028
|
...G(),
|
|
1030
1029
|
intent: m({
|
|
1031
1030
|
reducer: (e, t) => t
|
|
@@ -1039,7 +1038,7 @@ Fields: This style requires a single field which may be a string, number, or dat
|
|
|
1039
1038
|
default: () => null
|
|
1040
1039
|
})
|
|
1041
1040
|
});
|
|
1042
|
-
function
|
|
1041
|
+
function B(e) {
|
|
1043
1042
|
const t = e.map?.allLayers.filter((r) => r.type === "knowledge-graph");
|
|
1044
1043
|
if (!t || t?.length !== 1)
|
|
1045
1044
|
throw new Error("The Knowledge Agent currently only supports maps with exactly one Knowledge Graph Layer.");
|
|
@@ -1057,16 +1056,16 @@ function q(e) {
|
|
|
1057
1056
|
if (!("view" in r))
|
|
1058
1057
|
throw new Error("View context missing");
|
|
1059
1058
|
const a = r.view;
|
|
1060
|
-
return a.map && !("activeLinkChartLayer" in a.map) &&
|
|
1059
|
+
return a.map && !("activeLinkChartLayer" in a.map) && B(a), {
|
|
1061
1060
|
view: a
|
|
1062
1061
|
};
|
|
1063
1062
|
}
|
|
1064
|
-
function
|
|
1063
|
+
function _a(e) {
|
|
1065
1064
|
const r = e?.configurable?.context;
|
|
1066
1065
|
if (te(e) === "knowledgeGraph")
|
|
1067
1066
|
return "knowledgeGraph";
|
|
1068
1067
|
const o = r.view;
|
|
1069
|
-
return x(o) ? "linkChart" : (
|
|
1068
|
+
return x(o) ? "linkChart" : (B(o), "map");
|
|
1070
1069
|
}
|
|
1071
1070
|
async function N(e) {
|
|
1072
1071
|
const r = e?.configurable?.context;
|
|
@@ -1079,17 +1078,17 @@ async function N(e) {
|
|
|
1079
1078
|
if (!i)
|
|
1080
1079
|
throw new Error("Knowledge graph url missing from link chart.");
|
|
1081
1080
|
return {
|
|
1082
|
-
knowledgeGraph: await
|
|
1081
|
+
knowledgeGraph: await Y(i)
|
|
1083
1082
|
};
|
|
1084
1083
|
} else {
|
|
1085
|
-
|
|
1084
|
+
B(r.view);
|
|
1086
1085
|
const s = (r.view.map?.allLayers.find(
|
|
1087
1086
|
(l) => l.type === "knowledge-graph"
|
|
1088
1087
|
)).url;
|
|
1089
1088
|
if (!s)
|
|
1090
1089
|
throw new Error("Knowledge graph url missing from map.");
|
|
1091
1090
|
return {
|
|
1092
|
-
knowledgeGraph: await
|
|
1091
|
+
knowledgeGraph: await Y(s)
|
|
1093
1092
|
};
|
|
1094
1093
|
}
|
|
1095
1094
|
}
|
|
@@ -1106,12 +1105,12 @@ function te(e) {
|
|
|
1106
1105
|
return "view";
|
|
1107
1106
|
throw new Error("ArcgisKnowledgeAgent context must have either a view or knowledgeGraph property.");
|
|
1108
1107
|
}
|
|
1109
|
-
class
|
|
1108
|
+
class Wr {
|
|
1110
1109
|
constructor(t) {
|
|
1111
|
-
this.dataModel = t, this.kind = "GraphQueryGenerationRequest", this.explainQuery = !0, this.schemaInformation =
|
|
1110
|
+
this.dataModel = t, this.kind = "GraphQueryGenerationRequest", this.explainQuery = !0, this.schemaInformation = W.fromDataModel(t);
|
|
1112
1111
|
}
|
|
1113
1112
|
}
|
|
1114
|
-
class
|
|
1113
|
+
class W {
|
|
1115
1114
|
constructor() {
|
|
1116
1115
|
this.schemaType = "ArcgisGraphSchema", this.entityTypes = [], this.relationshipTypes = [], this.identifierInfo = {
|
|
1117
1116
|
mappingInfo: {
|
|
@@ -1121,7 +1120,7 @@ class B {
|
|
|
1121
1120
|
};
|
|
1122
1121
|
}
|
|
1123
1122
|
static fromDataModel(t) {
|
|
1124
|
-
const r = new
|
|
1123
|
+
const r = new W();
|
|
1125
1124
|
for (const a of t.entityTypes)
|
|
1126
1125
|
r.entityTypes.push(A.fromEntityType(a));
|
|
1127
1126
|
for (const a of t.relationshipTypes)
|
|
@@ -1154,7 +1153,7 @@ class A {
|
|
|
1154
1153
|
name: a.name,
|
|
1155
1154
|
alias: a.alias ? a.alias : void 0,
|
|
1156
1155
|
fieldType: a.fieldType,
|
|
1157
|
-
role:
|
|
1156
|
+
role: Xr(a.role),
|
|
1158
1157
|
geometryDef: a.fieldType === "esriFieldTypeGeometry" ? {
|
|
1159
1158
|
geometryType: a.geometryType ?? "esriGeometryAny",
|
|
1160
1159
|
hasM: a.hasM ? a.hasM : void 0,
|
|
@@ -1204,7 +1203,7 @@ const Hr = (e) => {
|
|
|
1204
1203
|
return e;
|
|
1205
1204
|
}
|
|
1206
1205
|
};
|
|
1207
|
-
function
|
|
1206
|
+
function Xr(e) {
|
|
1208
1207
|
switch (e) {
|
|
1209
1208
|
case "esriGraphPropertyRegular":
|
|
1210
1209
|
return "Regular";
|
|
@@ -1245,7 +1244,7 @@ function Yr(e) {
|
|
|
1245
1244
|
function F(e) {
|
|
1246
1245
|
return e?.signal;
|
|
1247
1246
|
}
|
|
1248
|
-
async function
|
|
1247
|
+
async function Yr(e, t) {
|
|
1249
1248
|
const r = await L("arcgis_knowledge_cypher_query_prompt");
|
|
1250
1249
|
return t ? `${e} ${r}
|
|
1251
1250
|
|
|
@@ -1256,14 +1255,14 @@ Execution Error: ${t.executionError}
|
|
|
1256
1255
|
Failed Query:
|
|
1257
1256
|
${t.failedGraphQuery}` : `${e} ${r}`;
|
|
1258
1257
|
}
|
|
1259
|
-
async function
|
|
1258
|
+
async function Zr(e, t, r, a) {
|
|
1260
1259
|
const { graphQuery: o, explanation: i } = await U(e, t, r, a);
|
|
1261
1260
|
return { graphQuery: o, explanation: i };
|
|
1262
1261
|
}
|
|
1263
1262
|
async function U(e, t, r, a, o) {
|
|
1264
1263
|
const i = {
|
|
1265
|
-
message: await
|
|
1266
|
-
context: new
|
|
1264
|
+
message: await Yr(e, o),
|
|
1265
|
+
context: new Wr(t)
|
|
1267
1266
|
}, s = F(a);
|
|
1268
1267
|
await T({ text: "Attempting to generate a cypher query from your prompt..." }, a);
|
|
1269
1268
|
const n = await J(`${r}/chat`, {
|
|
@@ -1271,7 +1270,7 @@ async function U(e, t, r, a, o) {
|
|
|
1271
1270
|
body: JSON.stringify(i),
|
|
1272
1271
|
headers: {
|
|
1273
1272
|
"Content-Type": "application/json",
|
|
1274
|
-
|
|
1273
|
+
"X-Esri-Authorization": `Bearer ${H.findCredential(P.getDefault().url)?.token ?? ""}`
|
|
1275
1274
|
},
|
|
1276
1275
|
signal: s
|
|
1277
1276
|
});
|
|
@@ -1296,7 +1295,7 @@ async function U(e, t, r, a, o) {
|
|
|
1296
1295
|
}),
|
|
1297
1296
|
headers: {
|
|
1298
1297
|
"Content-Type": "application/json",
|
|
1299
|
-
|
|
1298
|
+
"X-Esri-Authorization": `Bearer ${H.findCredential(P.getDefault().url)?.token ?? ""}`
|
|
1300
1299
|
},
|
|
1301
1300
|
signal: s
|
|
1302
1301
|
});
|
|
@@ -1712,7 +1711,7 @@ Number of records added: ${h.length}`,
|
|
|
1712
1711
|
error: d
|
|
1713
1712
|
};
|
|
1714
1713
|
}
|
|
1715
|
-
},
|
|
1714
|
+
}, Qa = g(dt, {
|
|
1716
1715
|
name: M,
|
|
1717
1716
|
description: `Adds records (entities or relationships) to the current link chart visualization from an inquiry into the knowledge graph data. The inquiry will retrieve data from the graph database that will serve as the basis for the records to be added to the link chart. The user should have explicitly requested to add records to the current link chart from their prompt. "add to new link chart" is not a valid prompt for this tool.
|
|
1718
1717
|
|
|
@@ -1763,7 +1762,7 @@ const _ = "applyLayout", ht = c.object({
|
|
|
1763
1762
|
errorMessage: "The applyLayout tool can only be used with a LinkChartView.",
|
|
1764
1763
|
error: new Error()
|
|
1765
1764
|
};
|
|
1766
|
-
},
|
|
1765
|
+
}, Ia = g(yt, {
|
|
1767
1766
|
name: _,
|
|
1768
1767
|
description: "Apply a diagram layout to the link chart",
|
|
1769
1768
|
schema: ht
|
|
@@ -1792,7 +1791,7 @@ const Q = "changeNonspatialVisibility", gt = c.object({
|
|
|
1792
1791
|
errorMessage: "The changeNonspatialVisibility tool can only be used with a LinkChartView.",
|
|
1793
1792
|
error: new Error()
|
|
1794
1793
|
};
|
|
1795
|
-
},
|
|
1794
|
+
}, Oa = g(ft, {
|
|
1796
1795
|
name: Q,
|
|
1797
1796
|
description: "Change whether or not nonspatial data is visible in the link chart. The value must be either 'hidden' or 'visible'.",
|
|
1798
1797
|
schema: gt
|
|
@@ -1892,7 +1891,7 @@ Explanation: ${l}`,
|
|
|
1892
1891
|
errorMessage: "The createLinkChart tool can only be used with a LinkChartView.",
|
|
1893
1892
|
error: new Error()
|
|
1894
1893
|
};
|
|
1895
|
-
},
|
|
1894
|
+
}, Ka = g(Tt, {
|
|
1896
1895
|
name: D,
|
|
1897
1896
|
description: "Creates a new link chart visualization from an inquiry into the knowledge graph data. The inquiry will retrieve data from the graph database that will serve as the basis for the new link chart. The user should have explicitly requested the creation of a new link chart from their prompt using language like 'create new link chart' or 'add to new link chart'.",
|
|
1898
1897
|
schema: bt
|
|
@@ -1971,7 +1970,7 @@ ${w.length > y ? `Showing top ${y} results:
|
|
|
1971
1970
|
queryResults: u
|
|
1972
1971
|
}
|
|
1973
1972
|
};
|
|
1974
|
-
},
|
|
1973
|
+
}, Va = g(vt, {
|
|
1975
1974
|
name: I,
|
|
1976
1975
|
description: "Allows users to explore the data in their knowledge graph via cypher query. Generates and executes a cypher query based on the user's inquiry into the knowledge graph, and displays the results in the chat pane without modifying the user's link chart if any. Use this tool when the user is asking an exploratory question about their data as a whole that can be answered via cypher query, for example 'What are the top 5 suppliers by total parts cost?' or 'How many employees do we have in each department?'.",
|
|
1977
1976
|
schema: St
|
|
@@ -1980,7 +1979,7 @@ ${w.length > y ? `Showing top ${y} results:
|
|
|
1980
1979
|
}), xt = async ({ prompt: e }, t) => {
|
|
1981
1980
|
const { knowledgeGraph: r } = await N(t), o = P.getDefault().helperServices;
|
|
1982
1981
|
try {
|
|
1983
|
-
const { graphQuery: i, explanation: s } = await
|
|
1982
|
+
const { graphQuery: i, explanation: s } = await Zr(
|
|
1984
1983
|
e,
|
|
1985
1984
|
r.dataModel,
|
|
1986
1985
|
`${o.aiAssistantServices.url}${o.aiAssistantServices.graphQueryAssistant}`,
|
|
@@ -2106,7 +2105,7 @@ const K = "searchGraphData", Pt = c.object({
|
|
|
2106
2105
|
searchResults: o.results
|
|
2107
2106
|
}
|
|
2108
2107
|
};
|
|
2109
|
-
},
|
|
2108
|
+
}, Wa = g(Et, {
|
|
2110
2109
|
name: K,
|
|
2111
2110
|
description: `
|
|
2112
2111
|
Search the knowledge graph using one or more search texts, using lucene search syntax, against indexed string properties defined on their entities and relationships. Use this tool when the user asks a question about their knowledge graph data as a whole, that could be answered via lucene text search of properties stored on graph elements, e.g requiring fuzzy matching. Otherwise if the inquiry is looking for connected records (e.g. paths), data aggregations, etc explore the data via the queryGraphData tool.
|
|
@@ -2121,36 +2120,36 @@ const K = "searchGraphData", Pt = c.object({
|
|
|
2121
2120
|
schema: Pt
|
|
2122
2121
|
});
|
|
2123
2122
|
export {
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2123
|
+
La as A,
|
|
2124
|
+
Ra as D,
|
|
2125
|
+
W as G,
|
|
2126
|
+
ja as H,
|
|
2127
|
+
Ga as L,
|
|
2128
|
+
Sa as N,
|
|
2129
|
+
Ia as a,
|
|
2131
2130
|
Ba as b,
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2131
|
+
Oa as c,
|
|
2132
|
+
Ka as d,
|
|
2133
|
+
Qa as e,
|
|
2134
|
+
_a as f,
|
|
2136
2135
|
L as g,
|
|
2137
2136
|
N as h,
|
|
2138
|
-
|
|
2139
|
-
|
|
2137
|
+
Fa as i,
|
|
2138
|
+
xa as j,
|
|
2140
2139
|
Oe as k,
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2140
|
+
Ca as l,
|
|
2141
|
+
$a as m,
|
|
2142
|
+
Pa as n,
|
|
2143
|
+
Ea as o,
|
|
2144
|
+
za as p,
|
|
2145
|
+
Va as q,
|
|
2146
|
+
va as r,
|
|
2147
|
+
Wa as s,
|
|
2149
2148
|
Ie as t,
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2149
|
+
ka as u,
|
|
2150
|
+
Aa as v,
|
|
2151
|
+
qa as w,
|
|
2152
|
+
Na as x,
|
|
2153
|
+
Ma as y,
|
|
2154
|
+
Da as z
|
|
2156
2155
|
};
|
|
@@ -28,7 +28,6 @@ import "@langchain/langgraph/prebuilt";
|
|
|
28
28
|
import "zod";
|
|
29
29
|
import { D as r } from "../../chunks/dataExplorationGraph.js";
|
|
30
30
|
import "../../agents/tools/help/listFields/adapter.js";
|
|
31
|
-
import "@arcgis/core/views/LinkChartView.js";
|
|
32
31
|
import "@arcgis/core/rest/knowledgeGraphService.js";
|
|
33
32
|
import { r as o, i as a } from "../../chunks/utils2.js";
|
|
34
33
|
class s extends i {
|
|
@@ -37,7 +37,6 @@ import "@arcgis/core/intl.js";
|
|
|
37
37
|
import "@arcgis/core/smartMapping/statistics/summaryStatistics.js";
|
|
38
38
|
import "@arcgis/core/smartMapping/statistics/uniqueValues.js";
|
|
39
39
|
import { H as r } from "../../chunks/helpGraph.js";
|
|
40
|
-
import "@arcgis/core/views/LinkChartView.js";
|
|
41
40
|
import "@arcgis/core/rest/knowledgeGraphService.js";
|
|
42
41
|
import { r as o, i as p } from "../../chunks/utils2.js";
|
|
43
42
|
class m extends i {
|
|
@@ -38,10 +38,9 @@ import "@arcgis/core/smartMapping/statistics/summaryStatistics.js";
|
|
|
38
38
|
import "@arcgis/core/smartMapping/statistics/uniqueValues.js";
|
|
39
39
|
import { L as r } from "../../chunks/layerStylingGraph.js";
|
|
40
40
|
import "../../agents/tools/help/listFields/adapter.js";
|
|
41
|
-
import "@arcgis/core/views/LinkChartView.js";
|
|
42
41
|
import "@arcgis/core/rest/knowledgeGraphService.js";
|
|
43
|
-
import { r as o, i as
|
|
44
|
-
class
|
|
42
|
+
import { r as o, i as s } from "../../chunks/utils2.js";
|
|
43
|
+
class m extends i {
|
|
45
44
|
constructor() {
|
|
46
45
|
super(...arguments), this.agent = r;
|
|
47
46
|
}
|
|
@@ -56,13 +55,13 @@ class s extends i {
|
|
|
56
55
|
return { mapView: this.#t };
|
|
57
56
|
}
|
|
58
57
|
load() {
|
|
59
|
-
this.#t = o(this, "arcgis-assistant-layer-styling-agent"), this.#i =
|
|
58
|
+
this.#t = o(this, "arcgis-assistant-layer-styling-agent"), this.#i = s(this);
|
|
60
59
|
}
|
|
61
60
|
disconnectedCallback() {
|
|
62
61
|
this.#i?.unregister(this.agent.id), super.disconnectedCallback();
|
|
63
62
|
}
|
|
64
63
|
}
|
|
65
|
-
t("arcgis-assistant-layer-styling-agent",
|
|
64
|
+
t("arcgis-assistant-layer-styling-agent", m);
|
|
66
65
|
export {
|
|
67
|
-
|
|
66
|
+
m as ArcgisAssistantLayerStylingAgent
|
|
68
67
|
};
|
|
@@ -28,7 +28,6 @@ import "@langchain/langgraph/prebuilt";
|
|
|
28
28
|
import "@arcgis/core/smartMapping/statistics/summaryStatistics.js";
|
|
29
29
|
import "@arcgis/core/smartMapping/statistics/uniqueValues.js";
|
|
30
30
|
import "../../agents/tools/help/listFields/adapter.js";
|
|
31
|
-
import "@arcgis/core/views/LinkChartView.js";
|
|
32
31
|
import "@arcgis/core/rest/knowledgeGraphService.js";
|
|
33
32
|
import { r as o, i as s } from "../../chunks/utils2.js";
|
|
34
33
|
class a extends i {
|
|
@@ -3,13 +3,22 @@ import { c as C } from "../../chunks/runtime.js";
|
|
|
3
3
|
import { css as S, html as R } from "lit";
|
|
4
4
|
import { watch as p } from "@arcgis/core/core/reactiveUtils.js";
|
|
5
5
|
import { LitElement as y, createEvent as d, nothing as v } from "@arcgis/lumina";
|
|
6
|
-
import w from "@arcgis/core/core/Accessor.js";
|
|
7
6
|
import { property as l, subclass as f } from "@arcgis/core/core/accessorSupport/decorators.js";
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
7
|
+
import w from "@arcgis/core/core/Accessor.js";
|
|
8
|
+
const I = S`.button{--calcite-button-background-color: var(--calcite-color-transparent);--calcite-button-border-color: transparent;--calcite-button-icon-color: var(--calcite-color-text-3);--calcite-button-text-color: var(--calcite-color-text-3);flex:0 0 auto;position:relative}.button[data-state=disabled]{--calcite-button-icon-color: var(--calcite-color-text-3);opacity:var(--calcite-opacity-disabled)}.button[data-state=listening]{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand) 14%, var(--calcite-color-foreground-1) );--calcite-button-border-color: color-mix(in srgb, var(--calcite-color-brand) 24%, transparent);--calcite-button-icon-color: var(--calcite-color-brand);--calcite-button-text-color: var(--calcite-color-brand);box-shadow:var(--calcite-shadow-sm)}.button[data-state=listening]:hover{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand-hover, var(--calcite-color-brand)) 18%, var(--calcite-color-foreground-1) )}.button[data-state=listening]:active{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand) 24%, var(--calcite-color-foreground-1) )}.button[data-state=processing]{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand) 10%, var(--calcite-color-foreground-1) );--calcite-button-border-color: color-mix(in srgb, var(--calcite-color-brand) 20%, transparent);--calcite-button-icon-color: var(--calcite-color-brand);--calcite-button-text-color: var(--calcite-color-brand)}.button[data-state=error]{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-status-danger) 12%, var(--calcite-color-foreground-1) );--calcite-button-border-color: color-mix(in srgb, var(--calcite-color-status-danger) 24%, transparent);--calcite-button-icon-color: var(--calcite-color-status-danger);--calcite-button-text-color: var(--calcite-color-status-danger)}.button[data-state=listening]:after{content:"";position:absolute;inset:-4px;border:1px solid color-mix(in srgb,var(--calcite-color-brand) 40%,transparent);border-radius:inherit;opacity:0;pointer-events:none;transform:scale(.92);animation:assistant-speech-input-recording-pulse 1.8s ease-out infinite}@keyframes assistant-speech-input-recording-pulse{0%{opacity:.65;transform:scale(.92)}70%{opacity:0;transform:scale(1.16)}to{opacity:0;transform:scale(1.16)}}@media(prefers-reduced-motion){.button[data-state=listening]:after{animation:none}}`, T = [
|
|
9
|
+
"audio/webm;codecs=opus",
|
|
10
|
+
"audio/webm",
|
|
11
|
+
"audio/mp4",
|
|
12
|
+
"audio/ogg;codecs=opus",
|
|
13
|
+
"audio/ogg"
|
|
14
|
+
];
|
|
15
|
+
function h(t) {
|
|
16
|
+
return t.replace(/\s+/gu, " ").trim();
|
|
17
|
+
}
|
|
18
|
+
var k = Object.defineProperty, x = Object.getOwnPropertyDescriptor, u = (t, e, s, i) => {
|
|
19
|
+
for (var r = i > 1 ? void 0 : i ? x(e, s) : e, n = t.length - 1, o; n >= 0; n--)
|
|
11
20
|
(o = t[n]) && (r = (i ? o(e, s, r) : o(r)) || r);
|
|
12
|
-
return i && r &&
|
|
21
|
+
return i && r && k(e, s, r), r;
|
|
13
22
|
};
|
|
14
23
|
let a = class extends w {
|
|
15
24
|
constructor(t) {
|
|
@@ -37,16 +46,6 @@ u([
|
|
|
37
46
|
a = u([
|
|
38
47
|
f("SpeechController")
|
|
39
48
|
], a);
|
|
40
|
-
const x = [
|
|
41
|
-
"audio/webm;codecs=opus",
|
|
42
|
-
"audio/webm",
|
|
43
|
-
"audio/mp4",
|
|
44
|
-
"audio/ogg;codecs=opus",
|
|
45
|
-
"audio/ogg"
|
|
46
|
-
];
|
|
47
|
-
function h(t) {
|
|
48
|
-
return t.replace(/\s+/gu, " ").trim();
|
|
49
|
-
}
|
|
50
49
|
var V = Object.defineProperty, O = Object.getOwnPropertyDescriptor, g = (t, e, s, i) => {
|
|
51
50
|
for (var r = i > 1 ? void 0 : i ? O(e, s) : e, n = t.length - 1, o; n >= 0; n--)
|
|
52
51
|
(o = t[n]) && (r = (i ? o(e, s, r) : o(r)) || r);
|
|
@@ -57,7 +56,7 @@ let c = class extends a {
|
|
|
57
56
|
super(t), this._activeSessionId = null, this._mediaRecorder = null, this._mediaRecorderChunkIndex = 0, this._mediaRecorderStopReason = null, this._mediaStream = null, this._pendingChunkOperations = /* @__PURE__ */ new Set(), this._recordedChunks = [], this.handleRecording = null, this.chunkTimeSlice = 3e3;
|
|
58
57
|
}
|
|
59
58
|
get _mimeType() {
|
|
60
|
-
return typeof window > "u" || typeof window.MediaRecorder?.isTypeSupported != "function" ? "" :
|
|
59
|
+
return typeof window > "u" || typeof window.MediaRecorder?.isTypeSupported != "function" ? "" : T.find((t) => window.MediaRecorder.isTypeSupported(t)) ?? "";
|
|
61
60
|
}
|
|
62
61
|
destroy() {
|
|
63
62
|
this._mediaRecorder && (this._mediaRecorder.onstart = null, this._mediaRecorder.ondataavailable = null, this._mediaRecorder.onerror = null, this._mediaRecorder.onstop = null), this.cancel(), this._mediaRecorder = null;
|