@arcgis/ai-components 5.2.0-next.12 → 5.2.0-next.13
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/LLMAgent.js +1 -0
- package/dist/cdn/{EBISDZ5H.js → 4UDYY3HL.js} +1 -1
- package/dist/cdn/{ERL2CB2Y.js → 55R6J3FL.js} +5 -5
- package/dist/cdn/ADYIXCSG.js +2 -0
- package/dist/cdn/CAECQD75.js +2 -0
- package/dist/cdn/{34SG44C3.js → CE6VDP2D.js} +1 -1
- package/dist/cdn/{T43LEBBE.js → CFVVQXPJ.js} +18 -18
- package/dist/cdn/CI3QSFPS.js +2 -0
- package/dist/cdn/DEAYZ3MK.js +2 -0
- package/dist/cdn/{Z2G7MP5L.js → DSVMXDPZ.js} +1 -1
- package/dist/cdn/{YLN2BZ5J.js → E2HENO3T.js} +1 -1
- package/dist/cdn/{JLKGS6Y5.js → ET453NAD.js} +1 -1
- package/dist/cdn/FWU6DFIB.js +2 -0
- package/dist/cdn/GPYYAQVI.js +2 -0
- package/dist/cdn/JN744CAW.js +2 -0
- package/dist/cdn/K475UT3E.js +2 -0
- package/dist/cdn/KWTJAVWV.js +2 -0
- package/dist/cdn/{5CV7R5IS.js → LREQ3XAW.js} +1 -1
- package/dist/cdn/M3SWPT3M.js +2 -0
- package/dist/cdn/MAV3DW27.js +4 -0
- package/dist/cdn/MRLTR3UO.js +16 -0
- package/dist/cdn/PB2ODJC7.js +2 -0
- package/dist/cdn/{QCSN44H4.js → QSA4T3BU.js} +1 -1
- package/dist/cdn/RMLXVQZ5.js +2 -0
- package/dist/cdn/SBHLUL3Q.js +2 -0
- package/dist/cdn/{R56X6ZKR.js → SRSFESAD.js} +1 -1
- package/dist/cdn/SWBER53G.js +3 -0
- package/dist/cdn/WH6QQK6N.js +2 -0
- package/dist/cdn/XBW4MWQR.js +2 -0
- package/dist/cdn/Z7UWJ4AI.js +3 -0
- package/dist/cdn/ZOSUDIJH.js +2 -0
- package/dist/cdn/ZPLFFLPF.js +2 -0
- package/dist/cdn/agent-utils/index.js +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/adapter.js +169 -168
- package/dist/chunks/arcgisKnowledgeGraph.js +3 -2
- package/dist/chunks/dataExplorationGraph.js +3 -2
- package/dist/chunks/generateLayerDescriptions.js +180 -178
- package/dist/chunks/helpGraph.js +3 -2
- package/dist/chunks/layerStylingGraph.js +1 -0
- package/dist/chunks/navigationGraph.js +3 -2
- package/dist/chunks/orchestrator.js +49 -48
- package/dist/chunks/toolCallResponse.js +10 -9
- package/dist/components/arcgis-assistant/customElement.js +54 -48
- package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +3 -2
- package/dist/components/arcgis-assistant-help-agent/customElement.js +1 -0
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +4 -3
- package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +1 -0
- package/dist/components/arcgis-assistant-navigation-agent/customElement.js +1 -0
- 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 +4 -4
- package/dist/cdn/24QNMEFG.js +0 -2
- package/dist/cdn/3NBDVZ2I.js +0 -2
- package/dist/cdn/53NTYC4I.js +0 -2
- package/dist/cdn/AZGGTNA3.js +0 -2
- package/dist/cdn/B7WJFBOZ.js +0 -2
- package/dist/cdn/DZ2QWNUA.js +0 -3
- package/dist/cdn/F6QHMKF5.js +0 -2
- package/dist/cdn/H2CHHGGH.js +0 -2
- package/dist/cdn/HWKDNS4K.js +0 -4
- package/dist/cdn/IMQ4TVHF.js +0 -16
- package/dist/cdn/IRZDTYO2.js +0 -2
- package/dist/cdn/KHXUWZHB.js +0 -2
- package/dist/cdn/LIFK3QSD.js +0 -2
- package/dist/cdn/O3EN27N5.js +0 -2
- package/dist/cdn/PBO6FZN6.js +0 -2
- package/dist/cdn/Q3ZW4FYA.js +0 -3
- package/dist/cdn/UPEEHMSY.js +0 -2
- package/dist/cdn/WAIFKDR3.js +0 -2
- package/dist/cdn/XON27U6U.js +0 -2
- package/dist/cdn/YUKR4AZW.js +0 -2
package/dist/chunks/adapter.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import
|
|
2
|
+
import me from "@arcgis/core/identity/IdentityManager.js";
|
|
3
3
|
import k from "@arcgis/core/portal/Portal.js";
|
|
4
4
|
import { Annotation as b, messagesStateReducer as Te } from "@langchain/langgraph/web";
|
|
5
|
+
import "@arcgis/toolkit/string";
|
|
5
6
|
import { k as qe, j as B, i as De } from "./generateLayerDescriptions.js";
|
|
6
7
|
import "@langchain/core/messages";
|
|
7
8
|
import "@langchain/core/callbacks/dispatch/web";
|
|
@@ -9,7 +10,7 @@ import "@langchain/openai";
|
|
|
9
10
|
import X from "@arcgis/core/config.js";
|
|
10
11
|
import * as Ae from "@arcgis/core/core/reactiveUtils.js";
|
|
11
12
|
import "@arcgis/core/layers/FeatureLayer.js";
|
|
12
|
-
import
|
|
13
|
+
import he from "@arcgis/core/request.js";
|
|
13
14
|
import "@langchain/core/prompts";
|
|
14
15
|
import { tool as f } from "@langchain/core/tools";
|
|
15
16
|
import Pe from "@arcgis/core/Graphic.js";
|
|
@@ -45,12 +46,12 @@ import ct from "@arcgis/core/smartMapping/statistics/summaryStatistics.js";
|
|
|
45
46
|
import ut from "@arcgis/core/smartMapping/statistics/uniqueValues.js";
|
|
46
47
|
import dt from "@arcgis/core/rest/support/TopFeaturesQuery.js";
|
|
47
48
|
import pt from "@arcgis/core/rest/support/TopFilter.js";
|
|
48
|
-
import
|
|
49
|
+
import mt from "@arcgis/core/WebLinkChart.js";
|
|
49
50
|
import xe from "@arcgis/core/rest/knowledgeGraph/GraphQueryStreaming.js";
|
|
50
51
|
import "@arcgis/core/views/LinkChartView.js";
|
|
51
|
-
import { fetchKnowledgeGraph as ge, executeQueryStreaming as
|
|
52
|
+
import { fetchKnowledgeGraph as ge, executeQueryStreaming as ht, executeSearchStreaming as yt } from "@arcgis/core/rest/knowledgeGraphService.js";
|
|
52
53
|
import ft from "@arcgis/core/rest/knowledgeGraph/GraphSearchStreaming.js";
|
|
53
|
-
const L = (e, t) => t ?? e,
|
|
54
|
+
const L = (e, t) => t ?? e, Rn = b.Root({
|
|
54
55
|
...qe(),
|
|
55
56
|
// internal to the navigation agent
|
|
56
57
|
intent: b({
|
|
@@ -71,7 +72,7 @@ const L = (e, t) => t ?? e, xn = b.Root({
|
|
|
71
72
|
})
|
|
72
73
|
});
|
|
73
74
|
async function gt(e, t) {
|
|
74
|
-
const a = k.getDefault().helperServices, o = a.geocode.find((
|
|
75
|
+
const a = k.getDefault().helperServices, o = a.geocode.find((m) => m.name === "ArcGIS World Geocoding Service") ?? a.geocode[0];
|
|
75
76
|
if (!o)
|
|
76
77
|
throw new Error("No geocoding service found in helperServices.");
|
|
77
78
|
const n = o.url, l = `${X.assetsPath?.endsWith("/") ? X.assetsPath : `${X.assetsPath}/`}esri/images/search/search-symbol-32.png`, c = (await Le(n, {
|
|
@@ -115,7 +116,7 @@ async function bt({ address: e }, t) {
|
|
|
115
116
|
}
|
|
116
117
|
const Tt = i.object({
|
|
117
118
|
address: i.string().describe("The full address or place name to locate.")
|
|
118
|
-
}),
|
|
119
|
+
}), $n = f(bt, {
|
|
119
120
|
name: "goToAddress",
|
|
120
121
|
description: "Geocodes an address using Esri's World Geocoding Service and zooms the map to that location.",
|
|
121
122
|
schema: Tt
|
|
@@ -138,7 +139,7 @@ async function St({ bookmarkName: e }, t) {
|
|
|
138
139
|
}
|
|
139
140
|
const xt = E.object({
|
|
140
141
|
bookmarkName: E.string().describe("The name of the bookmark to navigate to.")
|
|
141
|
-
}),
|
|
142
|
+
}), Cn = f(St, {
|
|
142
143
|
name: "goToBookmark",
|
|
143
144
|
description: "Go to the extent of the bookmark with the given name.",
|
|
144
145
|
schema: xt
|
|
@@ -179,7 +180,7 @@ async function $t({ layerId: e, where: t }, r) {
|
|
|
179
180
|
const Ct = E.object({
|
|
180
181
|
layerId: E.string().describe("The layerId of the layer to zoom to."),
|
|
181
182
|
where: E.string().describe("The sql-92 where clause used to query features to zoom to")
|
|
182
|
-
}),
|
|
183
|
+
}), En = f($t, {
|
|
183
184
|
name: "goToFeatures",
|
|
184
185
|
description: "Go to the features that match the given filter related to the given layerId.",
|
|
185
186
|
schema: Ct
|
|
@@ -198,7 +199,7 @@ async function Nt(e, t) {
|
|
|
198
199
|
const { mapView: r } = $(t);
|
|
199
200
|
return await Et(r);
|
|
200
201
|
}
|
|
201
|
-
const It = E.object({}),
|
|
202
|
+
const It = E.object({}), Nn = f(Nt, {
|
|
202
203
|
name: "goToFullExtent",
|
|
203
204
|
description: "Zooms the map to the full world extent using Esri's Geocoding Service.",
|
|
204
205
|
schema: It
|
|
@@ -215,7 +216,7 @@ async function Ft(e, t) {
|
|
|
215
216
|
const { mapView: r } = $(t);
|
|
216
217
|
return await kt(r);
|
|
217
218
|
}
|
|
218
|
-
const zt = i.object({}),
|
|
219
|
+
const zt = i.object({}), In = f(Ft, {
|
|
219
220
|
name: "goToHomeExtent",
|
|
220
221
|
description: "Go to the initial web map view extent",
|
|
221
222
|
schema: zt
|
|
@@ -234,7 +235,7 @@ async function Dt({ layerId: e }, t) {
|
|
|
234
235
|
}
|
|
235
236
|
const At = E.object({
|
|
236
237
|
layerId: E.string().describe("The id of the layer to navigate to")
|
|
237
|
-
}),
|
|
238
|
+
}), kn = f(Dt, {
|
|
238
239
|
name: "goToLayer",
|
|
239
240
|
description: "Zooms the map view to the full extent of the top matching layer.",
|
|
240
241
|
schema: At
|
|
@@ -248,7 +249,7 @@ async function Lt({ scale: e }, t) {
|
|
|
248
249
|
}
|
|
249
250
|
const jt = i.object({
|
|
250
251
|
scale: i.number().describe("The map scale of the view to go to.")
|
|
251
|
-
}),
|
|
252
|
+
}), Fn = f(Lt, {
|
|
252
253
|
name: "goToScale",
|
|
253
254
|
description: "Go to the specified view scale.",
|
|
254
255
|
schema: jt
|
|
@@ -282,7 +283,7 @@ const Mt = i.object({
|
|
|
282
283
|
}),
|
|
283
284
|
zoom: i.number().optional().describe("The zoom level. Higher values = more zoomed in."),
|
|
284
285
|
scale: i.number().optional().describe("The map scale. Alternative to zoom. Smaller numbers = more zoomed in.")
|
|
285
|
-
}),
|
|
286
|
+
}), zn = f(Ot, {
|
|
286
287
|
name: "goToViewpoint",
|
|
287
288
|
description: "Go to the specified viewpoint. This can contain a combination of scale, center, zoom, etc.",
|
|
288
289
|
schema: Mt
|
|
@@ -296,7 +297,7 @@ async function _t({ zoom: e }, t) {
|
|
|
296
297
|
}
|
|
297
298
|
const Wt = i.object({
|
|
298
299
|
zoom: i.number().min(1).max(20).describe("The zoom level of the view to go to.")
|
|
299
|
-
}),
|
|
300
|
+
}), qn = f(_t, {
|
|
300
301
|
name: "goToZoom",
|
|
301
302
|
description: 'Go to the specified zoom level. If input is generic (e.g. "zoom in", then only zoom to the next appropriate level - increase level for zooming in and decrease for zooming out.).',
|
|
302
303
|
schema: Wt
|
|
@@ -331,7 +332,7 @@ const Vt = (e, t = 300) => {
|
|
|
331
332
|
if (a == null)
|
|
332
333
|
throw new Error(`${t} missing in config.configurable.services`);
|
|
333
334
|
return a;
|
|
334
|
-
},
|
|
335
|
+
}, Dn = (e, t) => (r, a) => {
|
|
335
336
|
const o = a?.configurable?.services;
|
|
336
337
|
for (const n of e)
|
|
337
338
|
if (!o?.[n])
|
|
@@ -422,7 +423,7 @@ const Zt = i.object({
|
|
|
422
423
|
fields: i.array(i.string()).describe("The fields to use for the chart renderer (multiple numeric fields)"),
|
|
423
424
|
colorSchemes: i.array(i.string()).optional().describe("Optional color scheme tags to use"),
|
|
424
425
|
includeSize: i.boolean().optional().describe("Whether to vary the chart size (chart-size)")
|
|
425
|
-
}),
|
|
426
|
+
}), An = f(Jt, {
|
|
426
427
|
name: "chart",
|
|
427
428
|
description: `Label: Charts
|
|
428
429
|
Description: Show the values of two or more categories as a proportion of the total using a pie chart.
|
|
@@ -505,7 +506,7 @@ const rr = i.object({
|
|
|
505
506
|
fields: i.array(i.string()).describe("The field(s) to use for the color-age renderer (temporal/date data)"),
|
|
506
507
|
colorSchemes: i.array(i.string()).optional().describe("Optional color scheme tags to use"),
|
|
507
508
|
theme: i.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the color ramp")
|
|
508
|
-
}),
|
|
509
|
+
}), Pn = f(tr, {
|
|
509
510
|
name: "color-age",
|
|
510
511
|
description: `Label: Age (color)
|
|
511
512
|
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.
|
|
@@ -584,7 +585,7 @@ const sr = i.object({
|
|
|
584
585
|
fields: i.array(i.string()).describe("The field(s) to use for the color renderer"),
|
|
585
586
|
colorSchemes: i.array(i.string()).optional().describe("Optional color scheme tags to use"),
|
|
586
587
|
theme: i.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the color ramp")
|
|
587
|
-
}),
|
|
588
|
+
}), Ln = f(ir, {
|
|
588
589
|
name: "color",
|
|
589
590
|
description: `Label: Counts and Amounts (color)
|
|
590
591
|
Description: Vary color along a continuous color ramp to represent numeric or ranked data.
|
|
@@ -662,7 +663,7 @@ const pr = i.object({
|
|
|
662
663
|
fields: i.array(i.string()).describe("The fields to use for the color-size univariate renderer"),
|
|
663
664
|
colorSchemes: i.array(i.string()).optional().describe("Optional color scheme tags to use"),
|
|
664
665
|
theme: i.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the color and size ramps")
|
|
665
|
-
}),
|
|
666
|
+
}), jn = f(dr, {
|
|
666
667
|
name: "color-size-univariate",
|
|
667
668
|
description: `Label: Color and Size (univariate)
|
|
668
669
|
Description: Vary symbol size and color based on the values of two numeric attributes.
|
|
@@ -671,7 +672,7 @@ const pr = i.object({
|
|
|
671
672
|
Fields: This style requires at least two fields: one determining the color of each feature, the other determining the size of each feature. Each field may be normalized by an additional normalization field.`,
|
|
672
673
|
schema: pr
|
|
673
674
|
});
|
|
674
|
-
function
|
|
675
|
+
function mr(e) {
|
|
675
676
|
const { fields: t, layer: r, view: a, colorSchemeTags: o } = e;
|
|
676
677
|
let n;
|
|
677
678
|
return o && (n = Ke({
|
|
@@ -691,7 +692,7 @@ function hr(e) {
|
|
|
691
692
|
dotDensityScheme: n
|
|
692
693
|
};
|
|
693
694
|
}
|
|
694
|
-
async function
|
|
695
|
+
async function hr(e) {
|
|
695
696
|
return await Ue(e);
|
|
696
697
|
}
|
|
697
698
|
async function yr({
|
|
@@ -712,7 +713,7 @@ async function yr({
|
|
|
712
713
|
colorSchemeTags: o
|
|
713
714
|
};
|
|
714
715
|
try {
|
|
715
|
-
const c =
|
|
716
|
+
const c = mr(s), u = await hr(c);
|
|
716
717
|
return l.renderer = u.renderer, l.visible = !0, `Dot Density renderer applied to layer: ${l.title ?? l.id} using fields ${a.join(", ")}`;
|
|
717
718
|
} catch (c) {
|
|
718
719
|
return `Error applying dot density renderer: ${c instanceof Error ? c.message : String(c)}`;
|
|
@@ -736,7 +737,7 @@ const gr = i.object({
|
|
|
736
737
|
layerId: i.string().describe("The id of the layer to apply the dot density renderer to"),
|
|
737
738
|
fields: i.array(i.string()).describe("The field(s) to use for the dot density renderer (population or count data)"),
|
|
738
739
|
colorSchemes: i.array(i.string()).optional().describe("Optional color scheme tags to use")
|
|
739
|
-
}),
|
|
740
|
+
}), Gn = f(fr, {
|
|
740
741
|
name: "dot-density",
|
|
741
742
|
description: `Dot Density
|
|
742
743
|
Use dot density to visualize the distribution of one attribute or compare the density of multiple attributes. This is only valid for polygon layers.
|
|
@@ -811,7 +812,7 @@ const Sr = i.object({
|
|
|
811
812
|
layerId: i.string().describe("The id of the layer to apply the heatmap renderer to"),
|
|
812
813
|
fields: i.array(i.string()).describe("The field(s) to use for the heatmap renderer (typically point density)"),
|
|
813
814
|
colorSchemes: i.array(i.string()).optional().describe("Optional color scheme tags to use")
|
|
814
|
-
}),
|
|
815
|
+
}), On = f(vr, {
|
|
815
816
|
name: "heatmap",
|
|
816
817
|
description: `Label: Heat Map
|
|
817
818
|
Description: Show areas of high density with colors that appear to glow hotter. This is only valid for point layers.
|
|
@@ -886,7 +887,7 @@ const Er = i.object({
|
|
|
886
887
|
fields: i.array(i.string()).describe("The fields to use for the predominance renderer (competing categories)"),
|
|
887
888
|
colorSchemes: i.array(i.string()).optional().describe("Optional color scheme tags to use"),
|
|
888
889
|
includeSize: i.boolean().optional().describe("Whether to include size visualization (predominance-size)")
|
|
889
|
-
}),
|
|
890
|
+
}), Mn = f(Cr, {
|
|
890
891
|
name: "predominance",
|
|
891
892
|
description: `Label: Predominant category
|
|
892
893
|
Description: Compare attributes that share a common subject and unit of measurement to see which has the highest value.
|
|
@@ -967,7 +968,7 @@ const zr = i.object({
|
|
|
967
968
|
layerId: i.string().describe("The id of the layer to apply the relationship renderer to"),
|
|
968
969
|
fields: i.array(i.string()).describe("The two fields to use for the relationship renderer (bivariate visualization)"),
|
|
969
970
|
colorSchemes: i.array(i.string()).optional().describe("Optional color scheme tags to use")
|
|
970
|
-
}),
|
|
971
|
+
}), Qn = f(Fr, {
|
|
971
972
|
name: "relationship",
|
|
972
973
|
description: `Label: Relationship
|
|
973
974
|
Description: Overlays two color ramps to represent the relationship between two numeric attributes.
|
|
@@ -1038,7 +1039,7 @@ const Lr = i.object({
|
|
|
1038
1039
|
fields: i.array(i.string()).describe("The field(s) to use for the size-age renderer (temporal data with size)"),
|
|
1039
1040
|
colorSchemes: i.array(i.string()).optional().describe("Optional color scheme tags to use"),
|
|
1040
1041
|
theme: i.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the size ramp")
|
|
1041
|
-
}),
|
|
1042
|
+
}), _n = f(Pr, {
|
|
1042
1043
|
name: "size-age",
|
|
1043
1044
|
description: `Label: Age (size)
|
|
1044
1045
|
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.
|
|
@@ -1111,7 +1112,7 @@ const Qr = i.object({
|
|
|
1111
1112
|
fields: i.array(i.string()).describe("The field(s) to use for the size renderer (numeric data)"),
|
|
1112
1113
|
colorSchemes: i.array(i.string()).optional().describe("Optional color scheme tags to use"),
|
|
1113
1114
|
theme: i.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the size ramp")
|
|
1114
|
-
}),
|
|
1115
|
+
}), Wn = f(Mr, {
|
|
1115
1116
|
name: "size",
|
|
1116
1117
|
description: `Label: Counts and Amounts (size)
|
|
1117
1118
|
Description: Vary symbol sizes along a continuous ramp to represent numeric or ranked data.
|
|
@@ -1193,7 +1194,7 @@ const Kr = i.object({
|
|
|
1193
1194
|
fields: i.array(i.string()).describe("The field(s) to use for the type renderer (categorical data)"),
|
|
1194
1195
|
colorSchemes: i.array(i.string()).optional().describe("Optional color scheme tags to use"),
|
|
1195
1196
|
theme: i.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the color scheme")
|
|
1196
|
-
}),
|
|
1197
|
+
}), Vn = f(Ur, {
|
|
1197
1198
|
name: "type",
|
|
1198
1199
|
description: `Label: Types (unique symbols)
|
|
1199
1200
|
Description: Represent features as categories with different symbol colors or shapes. Examples include type of tree, road class, or province name.
|
|
@@ -1201,13 +1202,13 @@ Keywords: categorical, category, type, unique, discrete, point of interest, regi
|
|
|
1201
1202
|
Example: Color each feature based on the region it belongs to
|
|
1202
1203
|
Fields: This style requires a single field which may be a string, number, or date type. It is usually a string.`,
|
|
1203
1204
|
schema: Kr
|
|
1204
|
-
}),
|
|
1205
|
+
}), Un = b.Root({
|
|
1205
1206
|
...B(),
|
|
1206
1207
|
vectorSearchLayerIds: b(),
|
|
1207
1208
|
vectorSearchFieldResults: b(),
|
|
1208
1209
|
layerFieldInfo: b(),
|
|
1209
1210
|
selectedLayerId: b()
|
|
1210
|
-
}),
|
|
1211
|
+
}), Kn = b.Root({
|
|
1211
1212
|
...B(),
|
|
1212
1213
|
vectorSearchLayerIds: b(),
|
|
1213
1214
|
vectorSearchFieldResults: b(),
|
|
@@ -1414,7 +1415,7 @@ const H = async (e, t) => {
|
|
|
1414
1415
|
return e;
|
|
1415
1416
|
const t = re(e);
|
|
1416
1417
|
return t ? t.toISOString().slice(0, 10) : null;
|
|
1417
|
-
},
|
|
1418
|
+
}, Bn = () => {
|
|
1418
1419
|
const e = (/* @__PURE__ */ new Date()).getTimezoneOffset(), t = e <= 0 ? "+" : "-", r = Math.floor(Math.abs(e) / 60).toString().padStart(2, "0"), a = (Math.abs(e) % 60).toString().padStart(2, "0"), o = `${t}${r}:${a}`;
|
|
1419
1420
|
return { userTimezone: Intl.DateTimeFormat().resolvedOptions().timeZone, userTimezoneOffset: o };
|
|
1420
1421
|
}, da = (e, t, r) => {
|
|
@@ -1446,7 +1447,7 @@ const H = async (e, t) => {
|
|
|
1446
1447
|
}
|
|
1447
1448
|
}
|
|
1448
1449
|
return null;
|
|
1449
|
-
}, pa = (e) => !e || e === "system" ? Intl.DateTimeFormat().resolvedOptions().timeZone : e === "unknown" ? "UTC" : e,
|
|
1450
|
+
}, pa = (e) => !e || e === "system" ? Intl.DateTimeFormat().resolvedOptions().timeZone : e === "unknown" ? "UTC" : e, ma = (e) => {
|
|
1450
1451
|
if (e instanceof Date)
|
|
1451
1452
|
return Number.isNaN(e.getTime()) ? null : e;
|
|
1452
1453
|
if (typeof e == "number" && Number.isFinite(e)) {
|
|
@@ -1458,7 +1459,7 @@ const H = async (e, t) => {
|
|
|
1458
1459
|
return Number.isNaN(t.getTime()) ? null : t;
|
|
1459
1460
|
}
|
|
1460
1461
|
return null;
|
|
1461
|
-
},
|
|
1462
|
+
}, ha = (e, t) => {
|
|
1462
1463
|
if (typeof e != "number")
|
|
1463
1464
|
return e;
|
|
1464
1465
|
const r = {};
|
|
@@ -1469,7 +1470,7 @@ const H = async (e, t) => {
|
|
|
1469
1470
|
return e;
|
|
1470
1471
|
}
|
|
1471
1472
|
}, ya = (e, t, r) => {
|
|
1472
|
-
const a =
|
|
1473
|
+
const a = ma(e);
|
|
1473
1474
|
if (!a)
|
|
1474
1475
|
return e;
|
|
1475
1476
|
const o = {};
|
|
@@ -1483,7 +1484,7 @@ const H = async (e, t) => {
|
|
|
1483
1484
|
if (r == null)
|
|
1484
1485
|
return r;
|
|
1485
1486
|
const l = e.getFieldConfiguration?.(t)?.fieldFormat;
|
|
1486
|
-
return l?.type === "number" ?
|
|
1487
|
+
return l?.type === "number" ? ha(r, l) : l?.type === "date-time" ? ya(r, l, o) : da(r, a, o);
|
|
1487
1488
|
}, fa = (e, t, r, a) => {
|
|
1488
1489
|
const o = e.fieldsIndex?.get(t), n = $e(t, r, e) ?? r;
|
|
1489
1490
|
return Ee(e, t, n, o?.type, a);
|
|
@@ -1500,8 +1501,8 @@ const H = async (e, t) => {
|
|
|
1500
1501
|
c[u.name] = d;
|
|
1501
1502
|
return;
|
|
1502
1503
|
}
|
|
1503
|
-
const p = $e(u.name, d, e) ?? d,
|
|
1504
|
-
c[
|
|
1504
|
+
const p = $e(u.name, d, e) ?? d, m = Ce(e, u.name);
|
|
1505
|
+
c[m] = Ee(e, u.name, p, u.type, r);
|
|
1505
1506
|
}), c;
|
|
1506
1507
|
});
|
|
1507
1508
|
return { objectIds: o, attributes: n };
|
|
@@ -1509,7 +1510,7 @@ const H = async (e, t) => {
|
|
|
1509
1510
|
const a = e.createQuery();
|
|
1510
1511
|
return a.outFields = [t], a.where = r || "1=1", a.num = 1, a;
|
|
1511
1512
|
}, ba = async (e, t, r, a) => {
|
|
1512
|
-
const o = a.map?.allLayers.find((
|
|
1513
|
+
const o = a.map?.allLayers.find((m) => m.id === e), n = wa(o, t, r.where), s = (await o.queryFeatures(n)).features[0], c = s ? s.attributes[t] : null, u = fa(o, t, c, a.timeZone), d = ga(o, t);
|
|
1513
1514
|
return {
|
|
1514
1515
|
tool: "getAttribute",
|
|
1515
1516
|
layerName: o.title ?? e,
|
|
@@ -1548,7 +1549,7 @@ const xa = async (e) => {
|
|
|
1548
1549
|
const c = await o.whenLayerView(s), d = n.get(t.layerId)?.fieldRegistry.get(r), p = d?.alias;
|
|
1549
1550
|
if (!d)
|
|
1550
1551
|
throw new Error(`Field '${r}' not found.`);
|
|
1551
|
-
let
|
|
1552
|
+
let m, y;
|
|
1552
1553
|
if (l) {
|
|
1553
1554
|
const v = await H(l, o);
|
|
1554
1555
|
if ("error" in v)
|
|
@@ -1557,7 +1558,7 @@ const xa = async (e) => {
|
|
|
1557
1558
|
throw j(l) ? new Error(`No features found matching: ${l.where}`) : new Error("Failed to create geometry");
|
|
1558
1559
|
if (j(l)) {
|
|
1559
1560
|
const M = o.map?.allLayers.find((P) => P.id === l.layerId);
|
|
1560
|
-
|
|
1561
|
+
m = {
|
|
1561
1562
|
geometryLayerName: M?.title ?? M?.id,
|
|
1562
1563
|
geometryLayerId: l.layerId,
|
|
1563
1564
|
geometryWhere: l.where,
|
|
@@ -1565,7 +1566,7 @@ const xa = async (e) => {
|
|
|
1565
1566
|
units: l.units,
|
|
1566
1567
|
applied: !0
|
|
1567
1568
|
};
|
|
1568
|
-
} else U(l) && (
|
|
1569
|
+
} else U(l) && (m = {
|
|
1569
1570
|
point: l.point,
|
|
1570
1571
|
distance: l.distance,
|
|
1571
1572
|
units: l.units,
|
|
@@ -1579,7 +1580,7 @@ const xa = async (e) => {
|
|
|
1579
1580
|
});
|
|
1580
1581
|
}
|
|
1581
1582
|
const g = ce(c, [r], !1);
|
|
1582
|
-
let
|
|
1583
|
+
let h = null, w = null;
|
|
1583
1584
|
const T = 10;
|
|
1584
1585
|
if (d.type !== "geometry" && d.type !== "oid" && d.type !== "global-id")
|
|
1585
1586
|
try {
|
|
@@ -1592,7 +1593,7 @@ const xa = async (e) => {
|
|
|
1592
1593
|
...y && { filter: y },
|
|
1593
1594
|
outStatisticTypes: { include: [a] }
|
|
1594
1595
|
};
|
|
1595
|
-
|
|
1596
|
+
h = await ct(v);
|
|
1596
1597
|
const M = ["string", "small-integer", "integer"], P = d.domain?.type === "coded-value" ? d.domain : null;
|
|
1597
1598
|
(M.includes(d.type) || P) && (w = (await ut({
|
|
1598
1599
|
layer: s,
|
|
@@ -1611,16 +1612,16 @@ const xa = async (e) => {
|
|
|
1611
1612
|
return {
|
|
1612
1613
|
tool: "getStatistics",
|
|
1613
1614
|
layerName: s.title ?? t.layerId,
|
|
1614
|
-
summary: `${a} = ${typeof
|
|
1615
|
+
summary: `${a} = ${typeof h?.[a] == "number" ? h[a] : "N/A"}`,
|
|
1615
1616
|
details: {
|
|
1616
1617
|
fieldName: r,
|
|
1617
1618
|
fieldAlias: p,
|
|
1618
1619
|
statisticType: a,
|
|
1619
|
-
statistic:
|
|
1620
|
-
summaryStatistics:
|
|
1620
|
+
statistic: h?.[a] ?? null,
|
|
1621
|
+
summaryStatistics: h,
|
|
1621
1622
|
uniqueValues: w,
|
|
1622
1623
|
where: t.where,
|
|
1623
|
-
spatialFilterInfo:
|
|
1624
|
+
spatialFilterInfo: m
|
|
1624
1625
|
}
|
|
1625
1626
|
};
|
|
1626
1627
|
};
|
|
@@ -1682,18 +1683,18 @@ DO NOT USE FOR:
|
|
|
1682
1683
|
Only call this tool when the answer requires computing an aggregate (avg, max, min, sum, median, stddev) over a field's values, not just counting or listing features.`,
|
|
1683
1684
|
schema: Ea
|
|
1684
1685
|
}), Ia = async (e, t, r, a, o) => {
|
|
1685
|
-
const n = r.map?.allLayers.find((
|
|
1686
|
+
const n = r.map?.allLayers.find((m) => m.id === e.layerId), l = await r.whenLayerView(n), s = n.title ?? e.layerId;
|
|
1686
1687
|
let c;
|
|
1687
1688
|
if (a) {
|
|
1688
|
-
const
|
|
1689
|
-
if ("error" in
|
|
1689
|
+
const m = await H(a, r);
|
|
1690
|
+
if ("error" in m)
|
|
1690
1691
|
return {
|
|
1691
1692
|
tool: "getTopFeatures",
|
|
1692
1693
|
layerName: s,
|
|
1693
1694
|
summary: "Geometry lookup failed",
|
|
1694
|
-
details: { error:
|
|
1695
|
+
details: { error: m.error }
|
|
1695
1696
|
};
|
|
1696
|
-
if (!
|
|
1697
|
+
if (!m.geometry)
|
|
1697
1698
|
return {
|
|
1698
1699
|
tool: "getTopFeatures",
|
|
1699
1700
|
layerName: s,
|
|
@@ -1702,13 +1703,13 @@ Only call this tool when the answer requires computing an aggregate (avg, max, m
|
|
|
1702
1703
|
error: `No features found matching: ${"where" in a ? a.where : "unknown criteria"}`
|
|
1703
1704
|
}
|
|
1704
1705
|
};
|
|
1705
|
-
c =
|
|
1706
|
+
c = m.geometry;
|
|
1706
1707
|
} else o && (c = r.extent.clone());
|
|
1707
1708
|
const u = t.groupByFields && t.groupByFields.length > 0, d = n.objectIdField, p = e.outFields.includes("*") ? ["*"] : [.../* @__PURE__ */ new Set([...e.outFields, d])];
|
|
1708
1709
|
try {
|
|
1709
|
-
let
|
|
1710
|
+
let m;
|
|
1710
1711
|
if (u) {
|
|
1711
|
-
const
|
|
1712
|
+
const h = new dt({
|
|
1712
1713
|
where: e.where || "1=1",
|
|
1713
1714
|
outFields: p,
|
|
1714
1715
|
orderByFields: e.orderByFields,
|
|
@@ -1722,18 +1723,18 @@ Only call this tool when the answer requires computing an aggregate (avg, max, m
|
|
|
1722
1723
|
orderByFields: t.orderByFields
|
|
1723
1724
|
})
|
|
1724
1725
|
});
|
|
1725
|
-
|
|
1726
|
+
m = await n.queryTopFeatures(h);
|
|
1726
1727
|
} else {
|
|
1727
|
-
const
|
|
1728
|
-
|
|
1728
|
+
const h = n.createQuery();
|
|
1729
|
+
h.where = K(n.definitionExpression, e.where || "1=1"), h.outFields = p.length ? p : ["*"], h.orderByFields = t.orderByFields, h.num = t.topCount, c && (h.geometry = c, h.spatialRelationship = "intersects"), a?.distance && (h.distance = a.distance), a?.units && (h.units = a.units), h.outSpatialReference = r.spatialReference;
|
|
1729
1730
|
const w = ce(l, e.outFields, o ?? !1);
|
|
1730
1731
|
try {
|
|
1731
|
-
|
|
1732
|
+
m = w ? await l.queryFeatures(h) : await n.queryFeatures(h);
|
|
1732
1733
|
} catch (T) {
|
|
1733
|
-
console.warn("Client-side query failed, falling back to server:", T),
|
|
1734
|
+
console.warn("Client-side query failed, falling back to server:", T), m = await n.queryFeatures(h);
|
|
1734
1735
|
}
|
|
1735
1736
|
}
|
|
1736
|
-
const y =
|
|
1737
|
+
const y = m.features.map((h) => h.attributes[d]), { attributes: g } = Ne(n, m, r.timeZone);
|
|
1737
1738
|
return {
|
|
1738
1739
|
tool: "getTopFeatures",
|
|
1739
1740
|
layerName: s,
|
|
@@ -1748,12 +1749,12 @@ Only call this tool when the answer requires computing an aggregate (avg, max, m
|
|
|
1748
1749
|
...u && { groupByFields: t.groupByFields }
|
|
1749
1750
|
}
|
|
1750
1751
|
};
|
|
1751
|
-
} catch (
|
|
1752
|
+
} catch (m) {
|
|
1752
1753
|
return {
|
|
1753
1754
|
tool: "getTopFeatures",
|
|
1754
1755
|
layerName: s,
|
|
1755
1756
|
summary: "Query failed",
|
|
1756
|
-
details: { error:
|
|
1757
|
+
details: { error: m instanceof Error ? m.message : String(m) }
|
|
1757
1758
|
};
|
|
1758
1759
|
}
|
|
1759
1760
|
}, ka = async ({
|
|
@@ -1808,12 +1809,12 @@ Only call this tool when the answer requires computing an aggregate (avg, max, m
|
|
|
1808
1809
|
description: 'Returns top N features ranked by an existing field value. Use for "highest", "lowest", "top N" questions where ranking is based on a field that already exists in the data (e.g., population, value, date, depth). orderByFields must be actual field names with ASC/DESC. Do NOT use aggregate functions like COUNT(), SUM(), AVG() - those require getStatistics.',
|
|
1809
1810
|
schema: qa
|
|
1810
1811
|
}), ee = 25, Aa = async (e, t, r, a) => {
|
|
1811
|
-
const o = t.map?.allLayers.find((
|
|
1812
|
+
const o = t.map?.allLayers.find((h) => h.id === e.layerId), n = await t.whenLayerView(o), l = o.title ?? e.layerId;
|
|
1812
1813
|
let s;
|
|
1813
1814
|
if (r) {
|
|
1814
|
-
const
|
|
1815
|
-
if ("error" in
|
|
1816
|
-
const w = { error:
|
|
1815
|
+
const h = await H(r, t);
|
|
1816
|
+
if ("error" in h) {
|
|
1817
|
+
const w = { error: h.error };
|
|
1817
1818
|
if (j(r)) {
|
|
1818
1819
|
const T = t.map?.allLayers.find((C) => C.id === r.layerId);
|
|
1819
1820
|
w.geometryLayerName = T?.title ?? T?.id, w.geometryLayerId = r.layerId, w.geometryWhere = r.where;
|
|
@@ -1825,7 +1826,7 @@ Only call this tool when the answer requires computing an aggregate (avg, max, m
|
|
|
1825
1826
|
details: w
|
|
1826
1827
|
};
|
|
1827
1828
|
}
|
|
1828
|
-
if (!
|
|
1829
|
+
if (!h.geometry) {
|
|
1829
1830
|
const w = {};
|
|
1830
1831
|
if (j(r)) {
|
|
1831
1832
|
const T = t.map?.allLayers.find((C) => C.id === r.layerId);
|
|
@@ -1838,17 +1839,17 @@ Only call this tool when the answer requires computing an aggregate (avg, max, m
|
|
|
1838
1839
|
details: w
|
|
1839
1840
|
};
|
|
1840
1841
|
}
|
|
1841
|
-
s =
|
|
1842
|
+
s = h.geometry;
|
|
1842
1843
|
} else a && (s = t.extent.clone());
|
|
1843
1844
|
const c = ce(n, e.outFields, a ?? !1), u = o.objectIdField, d = o.createQuery();
|
|
1844
1845
|
d.where = K(o.definitionExpression, e.where || "1=1"), d.outFields = e.outFields.includes("*") ? ["*"] : [.../* @__PURE__ */ new Set([...e.outFields, u])], d.orderByFields = e.orderByFields, s && (d.geometry = s, d.spatialRelationship = "intersects"), r?.distance && (d.distance = r.distance), r?.units && (d.units = r.units), d.outSpatialReference = t.spatialReference;
|
|
1845
|
-
let p,
|
|
1846
|
+
let p, m;
|
|
1846
1847
|
try {
|
|
1847
|
-
p = c ? await n.queryFeatureCount(d) : await o.queryFeatureCount(d), p > 0 && p <= ee && (
|
|
1848
|
-
} catch (
|
|
1849
|
-
console.warn("Client-side query failed, falling back to server:",
|
|
1848
|
+
p = c ? await n.queryFeatureCount(d) : await o.queryFeatureCount(d), p > 0 && p <= ee && (m = c ? await n.queryFeatures(d) : await o.queryFeatures(d));
|
|
1849
|
+
} catch (h) {
|
|
1850
|
+
console.warn("Client-side query failed, falling back to server:", h), p = await o.queryFeatureCount(d), p > 0 && p <= ee && (m = await o.queryFeatures(d));
|
|
1850
1851
|
}
|
|
1851
|
-
const { objectIds: y, attributes: g } =
|
|
1852
|
+
const { objectIds: y, attributes: g } = m ? Ne(o, m, t.timeZone) : { objectIds: void 0, attributes: void 0 };
|
|
1852
1853
|
return {
|
|
1853
1854
|
tool: "queryFeatures",
|
|
1854
1855
|
layerName: l,
|
|
@@ -1921,8 +1922,8 @@ USE THIS TOOL FOR:
|
|
|
1921
1922
|
|
|
1922
1923
|
This is the DEFAULT tool for most queries. When in doubt, use this tool.`,
|
|
1923
1924
|
schema: Ga
|
|
1924
|
-
}), Ma = [Sa, Na, Da, Oa],
|
|
1925
|
-
async function
|
|
1925
|
+
}), Ma = [Sa, Na, Da, Oa], Hn = [la, ea, Zr], Qa = new ot(Ma, { handleToolErrors: !1 });
|
|
1926
|
+
async function Jn(e, t) {
|
|
1926
1927
|
const { messages: r } = await Qa.invoke({ messages: e.dataExplorationMessages }, t), a = [], o = [];
|
|
1927
1928
|
for (const n of r) {
|
|
1928
1929
|
const l = n.content;
|
|
@@ -1959,7 +1960,7 @@ async function Hn(e, t) {
|
|
|
1959
1960
|
`)) : "Query executed."
|
|
1960
1961
|
};
|
|
1961
1962
|
}
|
|
1962
|
-
const
|
|
1963
|
+
const Zn = b.Root({
|
|
1963
1964
|
...B(),
|
|
1964
1965
|
// internal to the help agent
|
|
1965
1966
|
helpInternalState: b({
|
|
@@ -1984,13 +1985,13 @@ ${o}`;
|
|
|
1984
1985
|
}, Wa = async ({ layerTitle: e }, t) => {
|
|
1985
1986
|
const r = Re(t, "layersAndFieldsRegistry");
|
|
1986
1987
|
return _a(r, e);
|
|
1987
|
-
},
|
|
1988
|
+
}, Yn = f(Wa, {
|
|
1988
1989
|
name: "listLayerFields",
|
|
1989
1990
|
description: "Lists all fields for a given layer by title. Use ONLY when the user explicitly asks to see fields, columns, or attributes of a specific named layer. Do NOT call this tool for general help questions, capability overviews, or layer listing.",
|
|
1990
1991
|
schema: i.object({
|
|
1991
1992
|
layerTitle: i.string().describe("The title or partial title of the layer to list fields for.")
|
|
1992
1993
|
})
|
|
1993
|
-
}),
|
|
1994
|
+
}), Xn = b.Root({
|
|
1994
1995
|
...B(),
|
|
1995
1996
|
intent: b({
|
|
1996
1997
|
reducer: (e, t) => t
|
|
@@ -2028,7 +2029,7 @@ function Z(e) {
|
|
|
2028
2029
|
view: a
|
|
2029
2030
|
};
|
|
2030
2031
|
}
|
|
2031
|
-
function
|
|
2032
|
+
function ei(e) {
|
|
2032
2033
|
const r = e?.configurable?.context;
|
|
2033
2034
|
if (Ie(e) === "knowledgeGraph")
|
|
2034
2035
|
return "knowledgeGraph";
|
|
@@ -2234,12 +2235,12 @@ async function pe(e, t, r, a, o) {
|
|
|
2234
2235
|
_.conversationId && (n.conversationId = _.conversationId);
|
|
2235
2236
|
const l = Y(a);
|
|
2236
2237
|
await S({ text: "Attempting to generate a cypher query from your prompt..." }, a);
|
|
2237
|
-
const s = await
|
|
2238
|
+
const s = await he(`${r}/chat`, {
|
|
2238
2239
|
method: "post",
|
|
2239
2240
|
body: JSON.stringify(n),
|
|
2240
2241
|
headers: {
|
|
2241
2242
|
"Content-Type": "application/json",
|
|
2242
|
-
token:
|
|
2243
|
+
token: me.findCredential(k.getDefault().url)?.token ?? ""
|
|
2243
2244
|
},
|
|
2244
2245
|
signal: l
|
|
2245
2246
|
});
|
|
@@ -2250,13 +2251,13 @@ async function pe(e, t, r, a, o) {
|
|
|
2250
2251
|
_.conversationId || (_.conversationId = s.data.conversationId);
|
|
2251
2252
|
let c = !1;
|
|
2252
2253
|
const u = Date.now();
|
|
2253
|
-
let d = s.data.sequenceNumber, p = "",
|
|
2254
|
+
let d = s.data.sequenceNumber, p = "", m = "", y = 1;
|
|
2254
2255
|
for (; !c; ) {
|
|
2255
|
-
await new Promise((
|
|
2256
|
+
await new Promise((h) => setTimeout(h, 1e3)), await S(
|
|
2256
2257
|
{ text: `Periodically requesting status of job from ArcGIS AI Services${"...".substring(0, y)}` },
|
|
2257
2258
|
a
|
|
2258
2259
|
), y = y % 3 + 1;
|
|
2259
|
-
const g = await
|
|
2260
|
+
const g = await he(`${r}/chat`, {
|
|
2260
2261
|
method: "post",
|
|
2261
2262
|
body: JSON.stringify({
|
|
2262
2263
|
conversationId: s.data.conversationId,
|
|
@@ -2265,7 +2266,7 @@ async function pe(e, t, r, a, o) {
|
|
|
2265
2266
|
}),
|
|
2266
2267
|
headers: {
|
|
2267
2268
|
"Content-Type": "application/json",
|
|
2268
|
-
token:
|
|
2269
|
+
token: me.findCredential(k.getDefault().url)?.token ?? ""
|
|
2269
2270
|
},
|
|
2270
2271
|
signal: l
|
|
2271
2272
|
});
|
|
@@ -2278,14 +2279,14 @@ async function pe(e, t, r, a, o) {
|
|
|
2278
2279
|
throw new Error(`Unexpected response from graph query service polling. Message: ${g.data.message}`, {
|
|
2279
2280
|
cause: g.data
|
|
2280
2281
|
});
|
|
2281
|
-
p = g.data.context.graphQuery,
|
|
2282
|
+
p = g.data.context.graphQuery, m = g.data.message || "", c = !0;
|
|
2282
2283
|
} else if (!g.data.hasMore)
|
|
2283
2284
|
c = !0;
|
|
2284
2285
|
else if (Date.now() - u > 6e4)
|
|
2285
2286
|
throw new Error("Graph query service polling timed out after 1 minute.");
|
|
2286
2287
|
d = g.data.sequenceNumber;
|
|
2287
2288
|
}
|
|
2288
|
-
return { graphQuery: p, explanation:
|
|
2289
|
+
return { graphQuery: p, explanation: m };
|
|
2289
2290
|
}
|
|
2290
2291
|
const q = 3;
|
|
2291
2292
|
function ke(e, t = 100) {
|
|
@@ -2314,16 +2315,16 @@ const Ya = async ({
|
|
|
2314
2315
|
};
|
|
2315
2316
|
d && (d.aborted ? u.abort(d.reason) : d.addEventListener("abort", p, { once: !0 }));
|
|
2316
2317
|
try {
|
|
2317
|
-
const
|
|
2318
|
-
s =
|
|
2319
|
-
const y =
|
|
2318
|
+
const m = await ht(e, t, o);
|
|
2319
|
+
s = m.resultHeader;
|
|
2320
|
+
const y = m.resultRowsStream.getReader();
|
|
2320
2321
|
let g = 0;
|
|
2321
|
-
const
|
|
2322
|
+
const h = Date.now(), w = !1;
|
|
2322
2323
|
for (; ; ) {
|
|
2323
2324
|
const { done: T, value: C } = await y.read();
|
|
2324
2325
|
if (T)
|
|
2325
2326
|
break;
|
|
2326
|
-
if (!w && l && Date.now() -
|
|
2327
|
+
if (!w && l && Date.now() - h > l)
|
|
2327
2328
|
return u.abort(), { type: "timeout" };
|
|
2328
2329
|
for (const v of C) {
|
|
2329
2330
|
if (g++, n && g > n)
|
|
@@ -2331,8 +2332,8 @@ const Ya = async ({
|
|
|
2331
2332
|
c = a(c, v);
|
|
2332
2333
|
}
|
|
2333
2334
|
}
|
|
2334
|
-
} catch (
|
|
2335
|
-
return u.signal.aborted ? { type: "aborted" } : { type: "error", errorMessage: A(
|
|
2335
|
+
} catch (m) {
|
|
2336
|
+
return u.signal.aborted ? { type: "aborted" } : { type: "error", errorMessage: A(m), error: m };
|
|
2336
2337
|
} finally {
|
|
2337
2338
|
d?.removeEventListener("abort", p);
|
|
2338
2339
|
}
|
|
@@ -2367,7 +2368,7 @@ async function Fe({
|
|
|
2367
2368
|
},
|
|
2368
2369
|
c
|
|
2369
2370
|
);
|
|
2370
|
-
const
|
|
2371
|
+
const m = await Ya({
|
|
2371
2372
|
kg: t,
|
|
2372
2373
|
queryParams: new xe({
|
|
2373
2374
|
openCypherQuery: p.graphQuery
|
|
@@ -2377,17 +2378,17 @@ async function Fe({
|
|
|
2377
2378
|
requestOptions: n,
|
|
2378
2379
|
queryRowLimit: l,
|
|
2379
2380
|
queryTimeoutMs: s
|
|
2380
|
-
}), y =
|
|
2381
|
-
if (
|
|
2381
|
+
}), y = m.type === "aborted" ? "Query execution was aborted." : m.type === "timeout" ? "Query execution timed out." : m.type === "error" ? `Query failed with error: ${m.errorMessage}` : "";
|
|
2382
|
+
if (m.type === "success")
|
|
2382
2383
|
return {
|
|
2383
2384
|
type: "success",
|
|
2384
2385
|
graphQuery: p.graphQuery,
|
|
2385
2386
|
explanation: p.explanation,
|
|
2386
|
-
rowLimitReached:
|
|
2387
|
-
resultHeader:
|
|
2388
|
-
processedResult:
|
|
2387
|
+
rowLimitReached: m.rowLimitReached,
|
|
2388
|
+
resultHeader: m.resultHeader,
|
|
2389
|
+
processedResult: m.processedResult
|
|
2389
2390
|
};
|
|
2390
|
-
if (
|
|
2391
|
+
if (m.type === "aborted")
|
|
2391
2392
|
return {
|
|
2392
2393
|
type: "aborted",
|
|
2393
2394
|
errorMessage: y,
|
|
@@ -2395,7 +2396,7 @@ async function Fe({
|
|
|
2395
2396
|
explanation: p.explanation
|
|
2396
2397
|
};
|
|
2397
2398
|
if (d >= q)
|
|
2398
|
-
return
|
|
2399
|
+
return m.type === "timeout" ? {
|
|
2399
2400
|
type: "timeout",
|
|
2400
2401
|
errorMessage: y,
|
|
2401
2402
|
graphQuery: p.graphQuery,
|
|
@@ -2403,7 +2404,7 @@ async function Fe({
|
|
|
2403
2404
|
} : {
|
|
2404
2405
|
type: "execution-error",
|
|
2405
2406
|
errorMessage: y,
|
|
2406
|
-
error:
|
|
2407
|
+
error: m.error,
|
|
2407
2408
|
graphQuery: p.graphQuery,
|
|
2408
2409
|
explanation: p.explanation
|
|
2409
2410
|
};
|
|
@@ -2449,8 +2450,8 @@ const Xa = async ({
|
|
|
2449
2450
|
)).resultRowsStream.getReader();
|
|
2450
2451
|
let g = !1;
|
|
2451
2452
|
for (; !g; ) {
|
|
2452
|
-
const { done:
|
|
2453
|
-
if (
|
|
2453
|
+
const { done: h, value: w } = await y.read();
|
|
2454
|
+
if (h) {
|
|
2454
2455
|
g = !0;
|
|
2455
2456
|
break;
|
|
2456
2457
|
}
|
|
@@ -2531,8 +2532,8 @@ async function io(e, t, r, a, o) {
|
|
|
2531
2532
|
kg: t,
|
|
2532
2533
|
graphQueryServiceUrl: r,
|
|
2533
2534
|
targetStructure: /* @__PURE__ */ new Map(),
|
|
2534
|
-
targetStructureReducer: (p,
|
|
2535
|
-
for (const y of
|
|
2535
|
+
targetStructureReducer: (p, m) => {
|
|
2536
|
+
for (const y of m)
|
|
2536
2537
|
eo(y, p);
|
|
2537
2538
|
return p;
|
|
2538
2539
|
},
|
|
@@ -2553,7 +2554,7 @@ async function io(e, t, r, a, o) {
|
|
|
2553
2554
|
},
|
|
2554
2555
|
o
|
|
2555
2556
|
), !N(n) && n?.map ? (await n.map.addRecords(d), await J(n), { generatedQuery: s, explanation: c, addedIdTypePairs: d }) : (await n?.map?.allLayers.find(
|
|
2556
|
-
(
|
|
2557
|
+
(m) => m.type === "knowledge-graph"
|
|
2557
2558
|
)?.addRecords(d), { generatedQuery: s, explanation: c, addedIdTypePairs: d });
|
|
2558
2559
|
}
|
|
2559
2560
|
const W = "addRecords", so = i.object({
|
|
@@ -2567,10 +2568,10 @@ const W = "addRecords", so = i.object({
|
|
|
2567
2568
|
|
|
2568
2569
|
${u}${JSON.stringify(d)}`;
|
|
2569
2570
|
} else if (N(o) && o.map) {
|
|
2570
|
-
const c = o.map, { allNamedTypesFullyDynamic: u, idTypePairs: d, dynamicTypes: p } = no(c),
|
|
2571
|
+
const c = o.map, { allNamedTypesFullyDynamic: u, idTypePairs: d, dynamicTypes: p } = no(c), m = await te("arcgis_knowledge_current_map_context");
|
|
2571
2572
|
if (s = `${e}
|
|
2572
2573
|
|
|
2573
|
-
${
|
|
2574
|
+
${m}${JSON.stringify(d)} and all entities or relationships with the the following typeNames in the array: ${JSON.stringify(p)}`, u)
|
|
2574
2575
|
return {
|
|
2575
2576
|
toolName: W,
|
|
2576
2577
|
status: "success",
|
|
@@ -2611,7 +2612,7 @@ Number of records added: ${d.length}`,
|
|
|
2611
2612
|
error: c
|
|
2612
2613
|
};
|
|
2613
2614
|
}
|
|
2614
|
-
},
|
|
2615
|
+
}, ti = f(lo, {
|
|
2615
2616
|
name: W,
|
|
2616
2617
|
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.",
|
|
2617
2618
|
schema: so
|
|
@@ -2653,15 +2654,15 @@ const ae = "applyLayout", uo = i.object({
|
|
|
2653
2654
|
}
|
|
2654
2655
|
};
|
|
2655
2656
|
}
|
|
2656
|
-
},
|
|
2657
|
+
}, ri = f(po, {
|
|
2657
2658
|
name: ae,
|
|
2658
2659
|
description: "Apply a diagram layout to the link chart",
|
|
2659
2660
|
schema: uo
|
|
2660
2661
|
});
|
|
2661
|
-
async function
|
|
2662
|
+
async function mo(e, t) {
|
|
2662
2663
|
return t.map?.changeNonspatialDataDisplay(e), await J(t), { appliedNonspatialDataDisplayMode: e };
|
|
2663
2664
|
}
|
|
2664
|
-
const oe = "changeNonspatialVisibility",
|
|
2665
|
+
const oe = "changeNonspatialVisibility", ho = i.object({
|
|
2665
2666
|
setting: i.enum(["hidden", "visible"]).describe("The setting of nonspatial visibility")
|
|
2666
2667
|
}), yo = async ({ setting: e }, t) => {
|
|
2667
2668
|
const { view: r } = Z(t);
|
|
@@ -2673,7 +2674,7 @@ const oe = "changeNonspatialVisibility", mo = i.object({
|
|
|
2673
2674
|
error: new Error()
|
|
2674
2675
|
};
|
|
2675
2676
|
{
|
|
2676
|
-
const { appliedNonspatialDataDisplayMode: a } = await
|
|
2677
|
+
const { appliedNonspatialDataDisplayMode: a } = await mo(e, r);
|
|
2677
2678
|
return {
|
|
2678
2679
|
toolName: oe,
|
|
2679
2680
|
status: "success",
|
|
@@ -2683,10 +2684,10 @@ const oe = "changeNonspatialVisibility", mo = i.object({
|
|
|
2683
2684
|
}
|
|
2684
2685
|
};
|
|
2685
2686
|
}
|
|
2686
|
-
},
|
|
2687
|
+
}, ai = f(yo, {
|
|
2687
2688
|
name: oe,
|
|
2688
2689
|
description: "Change whether or not nonspatial data is visible in the link chart. The value must be either 'hidden' or 'visible'.",
|
|
2689
|
-
schema:
|
|
2690
|
+
schema: ho
|
|
2690
2691
|
});
|
|
2691
2692
|
async function fo(e, t, r, a, o) {
|
|
2692
2693
|
let n, l = "";
|
|
@@ -2700,7 +2701,7 @@ async function fo(e, t, r, a, o) {
|
|
|
2700
2701
|
);
|
|
2701
2702
|
try {
|
|
2702
2703
|
await S({ text: `Attempting to create link chart from derived query: ${c}` }, o);
|
|
2703
|
-
const d = await
|
|
2704
|
+
const d = await mt.fromCypherQuery(
|
|
2704
2705
|
t,
|
|
2705
2706
|
new xe({
|
|
2706
2707
|
openCypherQuery: c
|
|
@@ -2782,7 +2783,7 @@ Explanation: ${c}`,
|
|
|
2782
2783
|
}
|
|
2783
2784
|
};
|
|
2784
2785
|
}
|
|
2785
|
-
},
|
|
2786
|
+
}, oi = f(wo, {
|
|
2786
2787
|
name: V,
|
|
2787
2788
|
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.",
|
|
2788
2789
|
schema: go
|
|
@@ -2821,9 +2822,9 @@ DESCRIPTIVE COLUMN NAMES: If the user's prompt does not explicitly request for s
|
|
|
2821
2822
|
for (const g of y)
|
|
2822
2823
|
D(
|
|
2823
2824
|
g,
|
|
2824
|
-
(
|
|
2825
|
+
(h) => ke(h)
|
|
2825
2826
|
);
|
|
2826
|
-
const p = 50,
|
|
2827
|
+
const p = 50, m = c.slice(0, p).map((y) => JSON.stringify(y));
|
|
2827
2828
|
return {
|
|
2828
2829
|
toolName: ne,
|
|
2829
2830
|
status: "success",
|
|
@@ -2834,15 +2835,15 @@ ${l}
|
|
|
2834
2835
|
\`\`\`
|
|
2835
2836
|
|
|
2836
2837
|
Query Results:
|
|
2837
|
-
${
|
|
2838
|
+
${m.length} result(s) found.
|
|
2838
2839
|
|
|
2839
2840
|
Column Headers: ${d.join(", ")}
|
|
2840
2841
|
|
|
2841
|
-
${
|
|
2842
|
+
${m.length > p ? `Showing top ${p} results:
|
|
2842
2843
|
|
|
2843
2844
|
` : `Results:
|
|
2844
2845
|
|
|
2845
|
-
`}${
|
|
2846
|
+
`}${m.join(`
|
|
2846
2847
|
`)}
|
|
2847
2848
|
`,
|
|
2848
2849
|
details: {
|
|
@@ -2852,7 +2853,7 @@ ${h.length > p ? `Showing top ${p} results:
|
|
|
2852
2853
|
queryResults: c
|
|
2853
2854
|
}
|
|
2854
2855
|
};
|
|
2855
|
-
},
|
|
2856
|
+
}, ni = f(To, {
|
|
2856
2857
|
name: ne,
|
|
2857
2858
|
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?'.",
|
|
2858
2859
|
schema: bo
|
|
@@ -2888,7 +2889,7 @@ Explanation: ${l}`,
|
|
|
2888
2889
|
error: n
|
|
2889
2890
|
};
|
|
2890
2891
|
}
|
|
2891
|
-
},
|
|
2892
|
+
}, ii = f(So, {
|
|
2892
2893
|
name: ie,
|
|
2893
2894
|
description: "Generates an Open Cypher query based on the user's prompt which represents an inquiry into the data of the knowledge service and its graph database, attempting to filter based on certain conditions and traverse specified relationships. The generated query should be syntactically correct and optimized for performance.",
|
|
2894
2895
|
schema: vo
|
|
@@ -2986,56 +2987,56 @@ const se = "searchGraphData", $o = i.object({
|
|
|
2986
2987
|
searchResults: o.results
|
|
2987
2988
|
}
|
|
2988
2989
|
};
|
|
2989
|
-
},
|
|
2990
|
+
}, si = f(Co, {
|
|
2990
2991
|
name: se,
|
|
2991
2992
|
description: "Allows users to search the knowledge graph for text matching their inquiry, 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.",
|
|
2992
2993
|
schema: $o
|
|
2993
2994
|
});
|
|
2994
2995
|
export {
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
2996
|
+
Pn as A,
|
|
2997
|
+
Ln as B,
|
|
2998
|
+
jn as C,
|
|
2999
|
+
Gn as D,
|
|
3000
|
+
On as E,
|
|
3001
|
+
Mn as F,
|
|
3001
3002
|
de as G,
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3003
|
+
Zn as H,
|
|
3004
|
+
Qn as I,
|
|
3005
|
+
_n as J,
|
|
3006
|
+
Wn as K,
|
|
3007
|
+
Vn as L,
|
|
3008
|
+
Un as M,
|
|
3009
|
+
Rn as N,
|
|
3010
|
+
Bn as O,
|
|
3011
|
+
Hn as P,
|
|
3011
3012
|
Ma as Q,
|
|
3012
3013
|
F as R,
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3014
|
+
Kn as S,
|
|
3015
|
+
Jn as T,
|
|
3016
|
+
ri as a,
|
|
3017
|
+
ii as b,
|
|
3018
|
+
ai as c,
|
|
3019
|
+
oi as d,
|
|
3020
|
+
ti as e,
|
|
3020
3021
|
Re as f,
|
|
3021
3022
|
te as g,
|
|
3022
|
-
|
|
3023
|
+
ei as h,
|
|
3023
3024
|
O as i,
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3025
|
+
Xn as j,
|
|
3026
|
+
$n as k,
|
|
3027
|
+
Yn as l,
|
|
3028
|
+
Cn as m,
|
|
3029
|
+
En as n,
|
|
3030
|
+
Nn as o,
|
|
3031
|
+
In as p,
|
|
3032
|
+
ni as q,
|
|
3033
|
+
Dn as r,
|
|
3034
|
+
si as s,
|
|
3034
3035
|
Vt as t,
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3036
|
+
kn as u,
|
|
3037
|
+
Fn as v,
|
|
3038
|
+
zn as w,
|
|
3039
|
+
qn as x,
|
|
3039
3040
|
$ as y,
|
|
3040
|
-
|
|
3041
|
+
An as z
|
|
3041
3042
|
};
|