@arcgis/ai-components 5.1.2 → 5.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/{DNBSIYGH.js → 25JF4EF7.js} +1 -1
- package/dist/cdn/{EAZMMIHA.js → 25NDUWCT.js} +1 -1
- package/dist/cdn/{IAPYT7SR.js → 25UVW7KO.js} +1 -1
- package/dist/cdn/{LDCC2R2F.js → 2YMTG42S.js} +1 -1
- package/dist/cdn/{JAKT3WYF.js → 3LH4AERX.js} +1 -1
- package/dist/cdn/{OP6ENMCN.js → 3OIOU4X5.js} +33 -33
- package/dist/cdn/{ORZO77HT.js → 4KCUDVMN.js} +1 -1
- package/dist/cdn/{5FM4VVHX.js → 4TZQE6U3.js} +1 -1
- package/dist/cdn/{FDBWYCAB.js → 55SUMECY.js} +1 -1
- package/dist/cdn/{NP7T2ORP.js → 64QIUXSL.js} +1 -1
- package/dist/cdn/{FGHZ3THZ.js → 6G3SQJUQ.js} +1 -1
- package/dist/cdn/{D44KMXIX.js → 7TNY3GDR.js} +1 -1
- package/dist/cdn/{M4AUVPY2.js → AXOJKKYD.js} +1 -1
- package/dist/cdn/{ISVBWKSB.js → CIVPQNXP.js} +1 -1
- package/dist/cdn/{7EPO6BQA.js → CKZL3ALU.js} +1 -1
- package/dist/cdn/{3FKJHYEX.js → CWRWQG74.js} +1 -1
- package/dist/cdn/{PAMYPORW.js → DBHF2ERT.js} +1 -1
- package/dist/cdn/{3J5RM5OR.js → DSVUDXFW.js} +1 -1
- package/dist/cdn/{W2CWLWUT.js → ECWQWIKT.js} +1 -1
- package/dist/cdn/{B5KIGBLD.js → ENHLRGME.js} +1 -1
- package/dist/cdn/{Z7PXJRBS.js → EZT7KL6Q.js} +1 -1
- package/dist/cdn/{676XT2OP.js → FV5DXRRM.js} +1 -1
- package/dist/cdn/{MVJO65W2.js → INNMKG7I.js} +1 -1
- package/dist/cdn/{W6HO4D6J.js → KYL4PDIC.js} +1 -1
- package/dist/cdn/{7OS3TQPL.js → ME55BEU6.js} +1 -1
- package/dist/cdn/{EDNV2EE5.js → MIDDULKK.js} +1 -1
- package/dist/cdn/{DLP5KUGG.js → MM2LQ3R6.js} +1 -1
- package/dist/cdn/{MJM2MHJW.js → PECIFJOX.js} +1 -1
- package/dist/cdn/{P6HPQKVB.js → PYTJFDQ4.js} +1 -1
- package/dist/cdn/{5LNXARCS.js → Q2CCIQO7.js} +1 -1
- package/dist/cdn/{DB2C7FK7.js → TWQJEJOJ.js} +1 -1
- package/dist/cdn/{FH4Q4VML.js → UJKZ4LCR.js} +1 -1
- package/dist/cdn/{AKFW3JY6.js → ZVO4KLTK.js} +1 -1
- package/dist/cdn/agent-utils/index.js +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/adapter.js +904 -895
- package/dist/chunks/runtime.js +1 -1
- 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/chunks/adapter.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
2
|
import pe from "@arcgis/core/identity/IdentityManager.js";
|
|
3
3
|
import k from "@arcgis/core/portal/Portal.js";
|
|
4
|
-
import { Annotation as
|
|
4
|
+
import { Annotation as T, messagesStateReducer as be } from "@langchain/langgraph/web";
|
|
5
5
|
import "@arcgis/toolkit/string";
|
|
6
6
|
import { k as De, j as H, i as Pe } from "./generateLayerDescriptions.js";
|
|
7
7
|
import "@langchain/core/messages";
|
|
@@ -10,23 +10,23 @@ import "@langchain/openai";
|
|
|
10
10
|
import X from "@arcgis/core/config.js";
|
|
11
11
|
import * as Ae from "@arcgis/core/core/reactiveUtils.js";
|
|
12
12
|
import "@arcgis/core/layers/FeatureLayer.js";
|
|
13
|
-
import
|
|
13
|
+
import me from "@arcgis/core/request.js";
|
|
14
14
|
import "@langchain/core/prompts";
|
|
15
|
-
import { tool as
|
|
16
|
-
import
|
|
17
|
-
import { addressToLocations as
|
|
15
|
+
import { tool as g } from "@langchain/core/tools";
|
|
16
|
+
import Le from "@arcgis/core/Graphic.js";
|
|
17
|
+
import { addressToLocations as je } from "@arcgis/core/rest/locator.js";
|
|
18
18
|
import Ge from "@arcgis/core/symbols/PictureMarkerSymbol.js";
|
|
19
19
|
import s, { z as E } from "zod";
|
|
20
20
|
import Oe from "@arcgis/core/geometry/Extent.js";
|
|
21
21
|
import Te from "@arcgis/core/geometry/Point.js";
|
|
22
22
|
import { createRenderer as Me } from "@arcgis/core/smartMapping/renderers/pieChart.js";
|
|
23
23
|
import { getSchemesByTag as Qe, getSchemes as _e } from "@arcgis/core/smartMapping/symbology/pieChart.js";
|
|
24
|
-
import { getBackgroundColorTheme as
|
|
25
|
-
import { a as
|
|
24
|
+
import { getBackgroundColorTheme as he } from "@arcgis/core/views/support/colorUtils.js";
|
|
25
|
+
import { a as R, s as x } from "./index.js";
|
|
26
26
|
import { createAgeRenderer as We, createContinuousRenderer as Ve } from "@arcgis/core/smartMapping/renderers/color.js";
|
|
27
27
|
import { getSchemesByTag as se } from "@arcgis/core/smartMapping/symbology/color.js";
|
|
28
|
-
import { createContinuousRenderer as
|
|
29
|
-
import { createRenderer as
|
|
28
|
+
import { createContinuousRenderer as Be } from "@arcgis/core/smartMapping/renderers/univariateColorSize.js";
|
|
29
|
+
import { createRenderer as Ue } from "@arcgis/core/smartMapping/renderers/dotDensity.js";
|
|
30
30
|
import { getSchemesByTag as Ke } from "@arcgis/core/smartMapping/symbology/dotDensity.js";
|
|
31
31
|
import { createRenderer as He } from "@arcgis/core/smartMapping/renderers/heatmap.js";
|
|
32
32
|
import { getSchemesByTag as Je } from "@arcgis/core/smartMapping/symbology/heatmap.js";
|
|
@@ -45,37 +45,37 @@ import { formatDateOnly as lt, convertDateFormatToIntlOptions as _, formatTimeOn
|
|
|
45
45
|
import ut from "@arcgis/core/smartMapping/statistics/summaryStatistics.js";
|
|
46
46
|
import dt from "@arcgis/core/smartMapping/statistics/uniqueValues.js";
|
|
47
47
|
import pt from "@arcgis/core/rest/support/TopFeaturesQuery.js";
|
|
48
|
-
import
|
|
49
|
-
import
|
|
48
|
+
import mt from "@arcgis/core/rest/support/TopFilter.js";
|
|
49
|
+
import ht from "@arcgis/core/WebLinkChart.js";
|
|
50
50
|
import Se from "@arcgis/core/rest/knowledgeGraph/GraphQueryStreaming.js";
|
|
51
51
|
import "@arcgis/core/views/LinkChartView.js";
|
|
52
52
|
import { fetchKnowledgeGraph as fe, executeQueryStreaming as yt, executeSearchStreaming as ft } from "@arcgis/core/rest/knowledgeGraphService.js";
|
|
53
53
|
import gt from "@arcgis/core/rest/knowledgeGraph/GraphSearchStreaming.js";
|
|
54
|
-
const
|
|
54
|
+
const L = (e, t) => t ?? e, En = T.Root({
|
|
55
55
|
...De(),
|
|
56
56
|
// internal to the navigation agent
|
|
57
|
-
intent:
|
|
58
|
-
reducer:
|
|
57
|
+
intent: T({
|
|
58
|
+
reducer: L
|
|
59
59
|
}),
|
|
60
|
-
vectorSearchLayerResults:
|
|
61
|
-
reducer:
|
|
60
|
+
vectorSearchLayerResults: T({
|
|
61
|
+
reducer: L,
|
|
62
62
|
default: () => []
|
|
63
63
|
}),
|
|
64
|
-
vectorSearchFieldResults:
|
|
65
|
-
reducer:
|
|
64
|
+
vectorSearchFieldResults: T({
|
|
65
|
+
reducer: L
|
|
66
66
|
}),
|
|
67
|
-
navigationInternalState:
|
|
68
|
-
reducer:
|
|
67
|
+
navigationInternalState: T({
|
|
68
|
+
reducer: L,
|
|
69
69
|
default: () => ({
|
|
70
70
|
toolCallMessage: void 0
|
|
71
71
|
})
|
|
72
72
|
})
|
|
73
73
|
});
|
|
74
|
-
async function wt(e,
|
|
75
|
-
const a = k.getDefault().helperServices, o = a.geocode.find((
|
|
74
|
+
async function wt(e, t) {
|
|
75
|
+
const a = k.getDefault().helperServices, o = a.geocode.find((m) => m.name === "ArcGIS World Geocoding Service") ?? a.geocode[0];
|
|
76
76
|
if (!o)
|
|
77
77
|
throw new Error("No geocoding service found in helperServices.");
|
|
78
|
-
const n = o.url, l = `${X.assetsPath?.endsWith("/") ? X.assetsPath : `${X.assetsPath}/`}esri/images/search/search-symbol-32.png`, c = (await
|
|
78
|
+
const n = o.url, l = `${X.assetsPath?.endsWith("/") ? X.assetsPath : `${X.assetsPath}/`}esri/images/search/search-symbol-32.png`, c = (await je(n, {
|
|
79
79
|
address: { SingleLine: e },
|
|
80
80
|
outFields: ["Match_addr"]
|
|
81
81
|
}))?.[0];
|
|
@@ -85,11 +85,11 @@ async function wt(e, r) {
|
|
|
85
85
|
url: l,
|
|
86
86
|
width: 24,
|
|
87
87
|
height: 24
|
|
88
|
-
}), d = new
|
|
88
|
+
}), d = new Le({
|
|
89
89
|
geometry: c.location,
|
|
90
90
|
symbol: u
|
|
91
91
|
});
|
|
92
|
-
|
|
92
|
+
t.graphics.removeAll(), t.graphics.add(d), await t.goTo(c.extent);
|
|
93
93
|
const p = {
|
|
94
94
|
address: c.address ?? "",
|
|
95
95
|
location: c.location ? c.location.toJSON() : null,
|
|
@@ -102,27 +102,27 @@ async function wt(e, r) {
|
|
|
102
102
|
}
|
|
103
103
|
const bt = ["mapView"];
|
|
104
104
|
function C(e) {
|
|
105
|
-
const
|
|
106
|
-
if (!
|
|
105
|
+
const r = e?.configurable?.context;
|
|
106
|
+
if (!r || typeof r != "object")
|
|
107
107
|
throw new Error("NavigationAgent context missing");
|
|
108
|
-
const a = bt.filter((o) => !(o in
|
|
108
|
+
const a = bt.filter((o) => !(o in r));
|
|
109
109
|
if (a.length)
|
|
110
110
|
throw new Error(`NavigationAgent context missing: ${a.join(", ")}`);
|
|
111
|
-
return
|
|
111
|
+
return r;
|
|
112
112
|
}
|
|
113
|
-
async function Tt({ address: e },
|
|
114
|
-
const { mapView:
|
|
115
|
-
return await wt(e,
|
|
113
|
+
async function Tt({ address: e }, t) {
|
|
114
|
+
const { mapView: r } = C(t);
|
|
115
|
+
return await wt(e, r);
|
|
116
116
|
}
|
|
117
117
|
const vt = s.object({
|
|
118
118
|
address: s.string().describe("The full address or place name to locate.")
|
|
119
|
-
}),
|
|
119
|
+
}), Fn = g(Tt, {
|
|
120
120
|
name: "goToAddress",
|
|
121
121
|
description: "Geocodes an address using Esri's World Geocoding Service and zooms the map to that location.",
|
|
122
122
|
schema: vt
|
|
123
123
|
});
|
|
124
|
-
async function St(e,
|
|
125
|
-
const a =
|
|
124
|
+
async function St(e, t) {
|
|
125
|
+
const a = t.map.bookmarks;
|
|
126
126
|
if (!a || a.length === 0)
|
|
127
127
|
throw new Error("No bookmarks found in the map.");
|
|
128
128
|
const o = a.find((l) => l.name === e);
|
|
@@ -131,31 +131,31 @@ async function St(e, r) {
|
|
|
131
131
|
const n = o.viewpoint;
|
|
132
132
|
if (!n)
|
|
133
133
|
throw new Error(`Bookmark with name "${e}" does not have a valid viewpoint.`);
|
|
134
|
-
return await
|
|
134
|
+
return await t.goTo(n), { text: `Navigated to bookmark: ${e}` };
|
|
135
135
|
}
|
|
136
|
-
async function xt({ bookmarkName: e },
|
|
137
|
-
const { mapView:
|
|
138
|
-
return await Promise.resolve(St(e,
|
|
136
|
+
async function xt({ bookmarkName: e }, t) {
|
|
137
|
+
const { mapView: r } = C(t);
|
|
138
|
+
return await Promise.resolve(St(e, r));
|
|
139
139
|
}
|
|
140
140
|
const Rt = E.object({
|
|
141
141
|
bookmarkName: E.string().describe("The name of the bookmark to navigate to.")
|
|
142
|
-
}),
|
|
142
|
+
}), kn = g(xt, {
|
|
143
143
|
name: "goToBookmark",
|
|
144
144
|
description: "Go to the extent of the bookmark with the given name.",
|
|
145
145
|
schema: Rt
|
|
146
146
|
});
|
|
147
|
-
async function $t(e,
|
|
148
|
-
const a =
|
|
147
|
+
async function $t(e, t, r) {
|
|
148
|
+
const a = r.map?.allLayers.find((l) => l.id === e);
|
|
149
149
|
if (!a)
|
|
150
150
|
return { text: `Error: Layer with id ${e} not found` };
|
|
151
|
-
const o =
|
|
151
|
+
const o = t?.trim() ? t : "1=1", n = a.createQuery();
|
|
152
152
|
n.where = o;
|
|
153
153
|
try {
|
|
154
154
|
const { extent: l, count: i } = await a.queryExtent(n);
|
|
155
155
|
if (i === 0)
|
|
156
156
|
return { text: `No features found in ${a.title} matching: ${o}`, where: o };
|
|
157
157
|
if (l)
|
|
158
|
-
await
|
|
158
|
+
await r.goTo(l);
|
|
159
159
|
else
|
|
160
160
|
return { text: `Error: Unable to determine extent for ${a.title}`, where: o };
|
|
161
161
|
const c = {
|
|
@@ -173,88 +173,88 @@ async function $t(e, r, t) {
|
|
|
173
173
|
return console.error("Error in goToFeatures:", l), { text: `Error: ${l instanceof Error ? l.message : "Unknown error"}`, where: o };
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
async function Ct({ layerId: e, where:
|
|
177
|
-
const { mapView: a } = C(
|
|
178
|
-
return await $t(e,
|
|
176
|
+
async function Ct({ layerId: e, where: t }, r) {
|
|
177
|
+
const { mapView: a } = C(r);
|
|
178
|
+
return await $t(e, t, a);
|
|
179
179
|
}
|
|
180
180
|
const Et = E.object({
|
|
181
181
|
layerId: E.string().describe("The layerId of the layer to zoom to."),
|
|
182
182
|
where: E.string().describe("The sql-92 where clause used to query features to zoom to")
|
|
183
|
-
}),
|
|
183
|
+
}), Nn = g(Ct, {
|
|
184
184
|
name: "goToFeatures",
|
|
185
185
|
description: "Go to the features that match the given filter related to the given layerId.",
|
|
186
186
|
schema: Et
|
|
187
187
|
});
|
|
188
188
|
async function Ft(e) {
|
|
189
|
-
const
|
|
189
|
+
const r = new Oe({
|
|
190
190
|
xmin: -180,
|
|
191
191
|
ymin: -90,
|
|
192
192
|
xmax: 180,
|
|
193
193
|
ymax: 90,
|
|
194
194
|
spatialReference: { wkid: 4326 }
|
|
195
195
|
}).expand(0.7);
|
|
196
|
-
return await e.goTo(
|
|
196
|
+
return await e.goTo(r), { text: "Successfully zoomed to world extent" };
|
|
197
197
|
}
|
|
198
|
-
async function kt(e,
|
|
199
|
-
const { mapView:
|
|
200
|
-
return await Ft(
|
|
198
|
+
async function kt(e, t) {
|
|
199
|
+
const { mapView: r } = C(t);
|
|
200
|
+
return await Ft(r);
|
|
201
201
|
}
|
|
202
|
-
const Nt = E.object({}),
|
|
202
|
+
const Nt = E.object({}), qn = g(kt, {
|
|
203
203
|
name: "goToFullExtent",
|
|
204
204
|
description: "Zooms the map to the full world extent using Esri's Geocoding Service.",
|
|
205
205
|
schema: Nt
|
|
206
206
|
});
|
|
207
207
|
async function qt(e) {
|
|
208
|
-
const
|
|
209
|
-
if (
|
|
210
|
-
await e.goTo(
|
|
208
|
+
const r = e.map.initialViewProperties?.viewpoint?.targetGeometry;
|
|
209
|
+
if (r)
|
|
210
|
+
await e.goTo(r);
|
|
211
211
|
else
|
|
212
212
|
throw new Error("Initial extent is undefined");
|
|
213
213
|
return { text: "Successfully zoomed to home extent" };
|
|
214
214
|
}
|
|
215
|
-
async function It(e,
|
|
216
|
-
const { mapView:
|
|
217
|
-
return await qt(
|
|
215
|
+
async function It(e, t) {
|
|
216
|
+
const { mapView: r } = C(t);
|
|
217
|
+
return await qt(r);
|
|
218
218
|
}
|
|
219
|
-
const zt = s.object({}),
|
|
219
|
+
const zt = s.object({}), In = g(It, {
|
|
220
220
|
name: "goToHomeExtent",
|
|
221
221
|
description: "Go to the initial web map view extent",
|
|
222
222
|
schema: zt
|
|
223
223
|
});
|
|
224
|
-
async function Dt(e,
|
|
225
|
-
await
|
|
226
|
-
const
|
|
227
|
-
if (!
|
|
224
|
+
async function Dt(e, t) {
|
|
225
|
+
await t.when();
|
|
226
|
+
const r = t.map?.allLayers.find((o) => o.id === e);
|
|
227
|
+
if (!r)
|
|
228
228
|
return console.warn(`[goToLayer] No matching FeatureLayer found for: ${e}`), { text: `Could not find layer for: ${e}` };
|
|
229
229
|
let a;
|
|
230
|
-
return (
|
|
230
|
+
return (r.type === "link-chart" || r.type === "knowledge-graph-sublayer") && t.map?.activeLinkChartLayer ? a = t.map.diagramNodesExtent : a = r.fullExtent, a ? (await t.goTo(a), r.visible = !0, { text: `Successfully zoomed to: ${r.title ?? ""}` }) : { text: "Layer has no defined extent. Cannot zoom to layer." };
|
|
231
231
|
}
|
|
232
|
-
async function Pt({ layerId: e },
|
|
233
|
-
const { mapView:
|
|
234
|
-
return await Dt(e,
|
|
232
|
+
async function Pt({ layerId: e }, t) {
|
|
233
|
+
const { mapView: r } = C(t);
|
|
234
|
+
return await Dt(e, r);
|
|
235
235
|
}
|
|
236
236
|
const At = E.object({
|
|
237
237
|
layerId: E.string().describe("The id of the layer to navigate to")
|
|
238
|
-
}),
|
|
238
|
+
}), zn = g(Pt, {
|
|
239
239
|
name: "goToLayer",
|
|
240
240
|
description: "Zooms the map view to the full extent of the top matching layer.",
|
|
241
241
|
schema: At
|
|
242
242
|
});
|
|
243
|
-
async function
|
|
244
|
-
return await
|
|
243
|
+
async function Lt(e, t) {
|
|
244
|
+
return await t.goTo({ scale: e }), { text: `Successfully zoomed to: ${e}` };
|
|
245
245
|
}
|
|
246
|
-
async function
|
|
247
|
-
const { mapView:
|
|
248
|
-
return await
|
|
246
|
+
async function jt({ scale: e }, t) {
|
|
247
|
+
const { mapView: r } = C(t);
|
|
248
|
+
return await Lt(e, r);
|
|
249
249
|
}
|
|
250
250
|
const Gt = s.object({
|
|
251
251
|
scale: s.number().describe("The map scale of the view to go to.")
|
|
252
|
-
}),
|
|
252
|
+
}), Dn = g(jt, {
|
|
253
253
|
name: "goToScale",
|
|
254
254
|
description: "Go to the specified view scale.",
|
|
255
255
|
schema: Gt
|
|
256
256
|
});
|
|
257
|
-
async function Ot(e,
|
|
257
|
+
async function Ot(e, t, r) {
|
|
258
258
|
const o = {
|
|
259
259
|
target: new Te({
|
|
260
260
|
longitude: e.longitude,
|
|
@@ -262,19 +262,19 @@ async function Ot(e, r, t) {
|
|
|
262
262
|
spatialReference: { wkid: 4326 }
|
|
263
263
|
})
|
|
264
264
|
};
|
|
265
|
-
return
|
|
265
|
+
return r?.zoom !== void 0 && (o.zoom = r.zoom), r?.scale !== void 0 && (o.scale = r.scale), await t.goTo(o), { text: `Successfully navigated to: ${[
|
|
266
266
|
`(${e.latitude}°, ${e.longitude}°)`,
|
|
267
|
-
|
|
268
|
-
|
|
267
|
+
r?.zoom !== void 0 ? `zoom ${r.zoom}` : "",
|
|
268
|
+
r?.scale !== void 0 ? `scale 1:${r.scale}` : ""
|
|
269
269
|
].filter(Boolean).join(", ")}` };
|
|
270
270
|
}
|
|
271
271
|
async function Mt({
|
|
272
272
|
center: e,
|
|
273
|
-
zoom:
|
|
274
|
-
scale:
|
|
273
|
+
zoom: t,
|
|
274
|
+
scale: r
|
|
275
275
|
}, a) {
|
|
276
276
|
const { mapView: o } = C(a);
|
|
277
|
-
return await Ot(e, o, { zoom:
|
|
277
|
+
return await Ot(e, o, { zoom: t, scale: r });
|
|
278
278
|
}
|
|
279
279
|
const Qt = s.object({
|
|
280
280
|
center: s.object({
|
|
@@ -283,21 +283,21 @@ const Qt = s.object({
|
|
|
283
283
|
}),
|
|
284
284
|
zoom: s.number().optional().describe("The zoom level. Higher values = more zoomed in."),
|
|
285
285
|
scale: s.number().optional().describe("The map scale. Alternative to zoom. Smaller numbers = more zoomed in.")
|
|
286
|
-
}),
|
|
286
|
+
}), Pn = g(Mt, {
|
|
287
287
|
name: "goToViewpoint",
|
|
288
288
|
description: "Go to the specified viewpoint. This can contain a combination of scale, center, zoom, etc.",
|
|
289
289
|
schema: Qt
|
|
290
290
|
});
|
|
291
|
-
async function _t(e,
|
|
292
|
-
return await
|
|
291
|
+
async function _t(e, t) {
|
|
292
|
+
return await t.goTo({ zoom: e }), { text: `Successfully zoomed to: ${e}` };
|
|
293
293
|
}
|
|
294
|
-
async function Wt({ zoom: e },
|
|
295
|
-
const { mapView:
|
|
296
|
-
return await _t(e,
|
|
294
|
+
async function Wt({ zoom: e }, t) {
|
|
295
|
+
const { mapView: r } = C(t);
|
|
296
|
+
return await _t(e, r);
|
|
297
297
|
}
|
|
298
298
|
const Vt = s.object({
|
|
299
299
|
zoom: s.number().min(1).max(20).describe("The zoom level of the view to go to.")
|
|
300
|
-
}),
|
|
300
|
+
}), An = g(Wt, {
|
|
301
301
|
name: "goToZoom",
|
|
302
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.).',
|
|
303
303
|
schema: Vt
|
|
@@ -316,48 +316,48 @@ const Vt = s.object({
|
|
|
316
316
|
"../agents/navigation/prompts/navigation_intent_prompt.md": () => import("./navigation_intent_prompt.js").then((e) => e.default),
|
|
317
317
|
"../agents/navigation/prompts/navigation_tool_prompt.md": () => import("./navigation_tool_prompt.js").then((e) => e.default)
|
|
318
318
|
});
|
|
319
|
-
async function
|
|
320
|
-
const
|
|
321
|
-
if (!
|
|
319
|
+
async function B(e) {
|
|
320
|
+
const t = Object.entries(ge).find(([r]) => r.endsWith(`/${e}.md`));
|
|
321
|
+
if (!t)
|
|
322
322
|
throw new Error(`Prompt not found: ${e}
|
|
323
323
|
Available prompts:
|
|
324
324
|
${Object.keys(ge).join(`
|
|
325
325
|
`)}`);
|
|
326
|
-
return await
|
|
326
|
+
return await t[1]();
|
|
327
327
|
}
|
|
328
|
-
const
|
|
329
|
-
const
|
|
330
|
-
return
|
|
331
|
-
}, xe = (e,
|
|
332
|
-
const a = e?.configurable?.services?.[
|
|
328
|
+
const Bt = (e, t = 300) => {
|
|
329
|
+
const r = e.replace(/\s+/gu, " ").replace(/[*_`#>\-]/gu, "").trim();
|
|
330
|
+
return r.length > t ? `${r.slice(0, t)}...` : r;
|
|
331
|
+
}, xe = (e, t) => {
|
|
332
|
+
const a = e?.configurable?.services?.[t];
|
|
333
333
|
if (a == null)
|
|
334
|
-
throw new Error(`${
|
|
334
|
+
throw new Error(`${t} missing in config.configurable.services`);
|
|
335
335
|
return a;
|
|
336
|
-
},
|
|
336
|
+
}, Ln = (e, t) => (r, a) => {
|
|
337
337
|
const o = a?.configurable?.services;
|
|
338
338
|
for (const n of e)
|
|
339
339
|
if (!o?.[n])
|
|
340
|
-
throw new Error(`${
|
|
341
|
-
return
|
|
340
|
+
throw new Error(`${t} requires services.${n} to be available.`);
|
|
341
|
+
return r;
|
|
342
342
|
};
|
|
343
|
-
async function
|
|
344
|
-
const { fields:
|
|
343
|
+
async function Ut(e) {
|
|
344
|
+
const { fields: t, layer: r, view: a, styleName: o, colorSchemeTags: n } = e;
|
|
345
345
|
let l;
|
|
346
346
|
return n ? l = Qe({
|
|
347
|
-
basemapTheme: await
|
|
348
|
-
geometryType:
|
|
347
|
+
basemapTheme: await he(a),
|
|
348
|
+
geometryType: r.geometryType,
|
|
349
349
|
includedTags: n,
|
|
350
|
-
numColors: Math.min(
|
|
350
|
+
numColors: Math.min(t.length, 8)
|
|
351
351
|
})[0] : l = _e({
|
|
352
|
-
basemapTheme: await
|
|
353
|
-
geometryType:
|
|
354
|
-
numColors: Math.min(
|
|
352
|
+
basemapTheme: await he(a),
|
|
353
|
+
geometryType: r.geometryType,
|
|
354
|
+
numColors: Math.min(t.length, 8)
|
|
355
355
|
}).primaryScheme, {
|
|
356
|
-
layer:
|
|
356
|
+
layer: r,
|
|
357
357
|
view: a,
|
|
358
|
-
attributes:
|
|
358
|
+
attributes: t.map((i) => ({
|
|
359
359
|
field: i,
|
|
360
|
-
label:
|
|
360
|
+
label: r.fields.find((c) => c.name === i)?.alias ?? ""
|
|
361
361
|
})).slice(0, 8),
|
|
362
362
|
outlineOptimizationEnabled: !0,
|
|
363
363
|
sizeOptimizationEnabled: !0,
|
|
@@ -370,15 +370,15 @@ async function Kt(e) {
|
|
|
370
370
|
}
|
|
371
371
|
async function Ht({
|
|
372
372
|
arcgisMap: e,
|
|
373
|
-
arcgisMapView:
|
|
374
|
-
layerId:
|
|
373
|
+
arcgisMapView: t,
|
|
374
|
+
layerId: r,
|
|
375
375
|
fields: a,
|
|
376
376
|
colorSchemes: o,
|
|
377
377
|
includeSize: n
|
|
378
378
|
}) {
|
|
379
|
-
const l =
|
|
379
|
+
const l = t, i = e?.allLayers.find((d) => d.id === r);
|
|
380
380
|
if (!i)
|
|
381
|
-
return `Could not find layer for id: ${
|
|
381
|
+
return `Could not find layer for id: ${r}`;
|
|
382
382
|
const u = {
|
|
383
383
|
styleName: n ? "chart-size" : "chart",
|
|
384
384
|
fields: a,
|
|
@@ -387,35 +387,35 @@ async function Ht({
|
|
|
387
387
|
colorSchemeTags: o
|
|
388
388
|
};
|
|
389
389
|
try {
|
|
390
|
-
const d = await
|
|
390
|
+
const d = await Ut(u), p = await Kt(d);
|
|
391
391
|
return i.renderer = p.renderer, i.visible = !0, `Chart renderer applied to layer: ${i.title ?? i.id} using fields ${a.join(", ")}`;
|
|
392
392
|
} catch (d) {
|
|
393
393
|
return `Error applying chart renderer: ${d instanceof Error ? d.message : String(d)}`;
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
396
|
const Jt = ["mapView"];
|
|
397
|
-
function
|
|
398
|
-
const
|
|
399
|
-
if (!
|
|
397
|
+
function $(e) {
|
|
398
|
+
const r = e?.configurable?.context;
|
|
399
|
+
if (!r || typeof r != "object")
|
|
400
400
|
throw new Error("LayerStylingAgent context missing");
|
|
401
|
-
const a = Jt.filter((o) => !(o in
|
|
401
|
+
const a = Jt.filter((o) => !(o in r));
|
|
402
402
|
if (a.length)
|
|
403
403
|
throw new Error(`LayerStylingAgent context missing: ${a.join(", ")}`);
|
|
404
|
-
return
|
|
404
|
+
return r;
|
|
405
405
|
}
|
|
406
406
|
async function Zt({
|
|
407
407
|
layerId: e,
|
|
408
|
-
fields:
|
|
409
|
-
colorSchemes:
|
|
408
|
+
fields: t,
|
|
409
|
+
colorSchemes: r,
|
|
410
410
|
includeSize: a
|
|
411
411
|
}, o) {
|
|
412
|
-
const { mapView: n } =
|
|
413
|
-
return await
|
|
412
|
+
const { mapView: n } = $(o);
|
|
413
|
+
return await R({ type: "show-legend", data: { layerIds: [e] } }, o), await Ht({
|
|
414
414
|
arcgisMap: n.map,
|
|
415
415
|
arcgisMapView: n,
|
|
416
416
|
layerId: e,
|
|
417
|
-
fields:
|
|
418
|
-
colorSchemes:
|
|
417
|
+
fields: t,
|
|
418
|
+
colorSchemes: r,
|
|
419
419
|
includeSize: a
|
|
420
420
|
});
|
|
421
421
|
}
|
|
@@ -424,7 +424,7 @@ const Yt = s.object({
|
|
|
424
424
|
fields: s.array(s.string()).describe("The fields to use for the chart renderer (multiple numeric fields)"),
|
|
425
425
|
colorSchemes: s.array(s.string()).optional().describe("Optional color scheme tags to use"),
|
|
426
426
|
includeSize: s.boolean().optional().describe("Whether to vary the chart size (chart-size)")
|
|
427
|
-
}),
|
|
427
|
+
}), jn = g(Zt, {
|
|
428
428
|
name: "chart",
|
|
429
429
|
description: `Label: Charts
|
|
430
430
|
Description: Show the values of two or more categories as a proportion of the total using a pie chart.
|
|
@@ -440,14 +440,14 @@ const Yt = s.object({
|
|
|
440
440
|
schema: Yt
|
|
441
441
|
});
|
|
442
442
|
function Xt(e) {
|
|
443
|
-
const { fields:
|
|
443
|
+
const { fields: t, layer: r, view: a, theme: o, colorSchemeTags: n } = e, l = t[0];
|
|
444
444
|
let i;
|
|
445
445
|
return n && (i = se({
|
|
446
|
-
geometryType:
|
|
446
|
+
geometryType: r.geometryType,
|
|
447
447
|
includedTags: n,
|
|
448
448
|
theme: o || "high-to-low"
|
|
449
449
|
})[0]), {
|
|
450
|
-
layer:
|
|
450
|
+
layer: r,
|
|
451
451
|
view: a,
|
|
452
452
|
startTime: l,
|
|
453
453
|
endTime: /* @__PURE__ */ new Date(),
|
|
@@ -462,15 +462,15 @@ async function er(e) {
|
|
|
462
462
|
}
|
|
463
463
|
async function tr({
|
|
464
464
|
arcgisMap: e,
|
|
465
|
-
arcgisMapView:
|
|
466
|
-
layerId:
|
|
465
|
+
arcgisMapView: t,
|
|
466
|
+
layerId: r,
|
|
467
467
|
fields: a,
|
|
468
468
|
colorSchemes: o,
|
|
469
469
|
theme: n
|
|
470
470
|
}) {
|
|
471
|
-
const l =
|
|
471
|
+
const l = t, i = e?.allLayers.find((u) => u.id === r);
|
|
472
472
|
if (!i)
|
|
473
|
-
return `Could not find layer for id: ${
|
|
473
|
+
return `Could not find layer for id: ${r}`;
|
|
474
474
|
const c = {
|
|
475
475
|
styleName: "color-age",
|
|
476
476
|
fields: a,
|
|
@@ -488,17 +488,17 @@ async function tr({
|
|
|
488
488
|
}
|
|
489
489
|
async function rr({
|
|
490
490
|
layerId: e,
|
|
491
|
-
fields:
|
|
492
|
-
colorSchemes:
|
|
491
|
+
fields: t,
|
|
492
|
+
colorSchemes: r,
|
|
493
493
|
theme: a
|
|
494
494
|
}, o) {
|
|
495
|
-
const { mapView: n } =
|
|
496
|
-
return await
|
|
495
|
+
const { mapView: n } = $(o);
|
|
496
|
+
return await R({ type: "show-legend", data: { layerIds: [e] } }, o), await tr({
|
|
497
497
|
arcgisMap: n.map,
|
|
498
498
|
arcgisMapView: n,
|
|
499
499
|
layerId: e,
|
|
500
|
-
fields:
|
|
501
|
-
colorSchemes:
|
|
500
|
+
fields: t,
|
|
501
|
+
colorSchemes: r,
|
|
502
502
|
theme: a
|
|
503
503
|
});
|
|
504
504
|
}
|
|
@@ -507,7 +507,7 @@ const ar = s.object({
|
|
|
507
507
|
fields: s.array(s.string()).describe("The field(s) to use for the color-age renderer (temporal/date data)"),
|
|
508
508
|
colorSchemes: s.array(s.string()).optional().describe("Optional color scheme tags to use"),
|
|
509
509
|
theme: s.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the color ramp")
|
|
510
|
-
}),
|
|
510
|
+
}), Gn = g(rr, {
|
|
511
511
|
name: "color-age",
|
|
512
512
|
description: `Label: Age (color)
|
|
513
513
|
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.
|
|
@@ -517,16 +517,16 @@ const ar = s.object({
|
|
|
517
517
|
schema: ar
|
|
518
518
|
});
|
|
519
519
|
function or(e) {
|
|
520
|
-
const { fields:
|
|
521
|
-
let { theme: n } = e, l =
|
|
522
|
-
const i =
|
|
520
|
+
const { fields: t, layer: r, view: a, colorSchemeTags: o } = e;
|
|
521
|
+
let { theme: n } = e, l = t[1];
|
|
522
|
+
const i = t[0];
|
|
523
523
|
let c;
|
|
524
524
|
return o && (c = se({
|
|
525
|
-
geometryType:
|
|
525
|
+
geometryType: r.geometryType,
|
|
526
526
|
includedTags: o,
|
|
527
527
|
theme: n || "high-to-low"
|
|
528
528
|
})[0]), {
|
|
529
|
-
layer:
|
|
529
|
+
layer: r,
|
|
530
530
|
view: a,
|
|
531
531
|
field: i,
|
|
532
532
|
normalizationField: l,
|
|
@@ -541,15 +541,15 @@ async function nr(e) {
|
|
|
541
541
|
}
|
|
542
542
|
async function ir({
|
|
543
543
|
arcgisMap: e,
|
|
544
|
-
arcgisMapView:
|
|
545
|
-
layerId:
|
|
544
|
+
arcgisMapView: t,
|
|
545
|
+
layerId: r,
|
|
546
546
|
fields: a,
|
|
547
547
|
colorSchemes: o,
|
|
548
548
|
theme: n
|
|
549
549
|
}) {
|
|
550
|
-
const l =
|
|
550
|
+
const l = t, i = e?.allLayers.find((u) => u.id === r);
|
|
551
551
|
if (!i)
|
|
552
|
-
return `Could not find layer for id: ${
|
|
552
|
+
return `Could not find layer for id: ${r}`;
|
|
553
553
|
const c = {
|
|
554
554
|
styleName: "color",
|
|
555
555
|
fields: a,
|
|
@@ -567,17 +567,17 @@ async function ir({
|
|
|
567
567
|
}
|
|
568
568
|
async function sr({
|
|
569
569
|
layerId: e,
|
|
570
|
-
fields:
|
|
571
|
-
colorSchemes:
|
|
570
|
+
fields: t,
|
|
571
|
+
colorSchemes: r,
|
|
572
572
|
theme: a
|
|
573
573
|
}, o) {
|
|
574
|
-
const { mapView: n } =
|
|
575
|
-
return await
|
|
574
|
+
const { mapView: n } = $(o);
|
|
575
|
+
return await R({ type: "show-legend", data: { layerIds: [e] } }, o), await ir({
|
|
576
576
|
arcgisMap: n.map,
|
|
577
577
|
arcgisMapView: n,
|
|
578
578
|
layerId: e,
|
|
579
|
-
fields:
|
|
580
|
-
colorSchemes:
|
|
579
|
+
fields: t,
|
|
580
|
+
colorSchemes: r,
|
|
581
581
|
theme: a
|
|
582
582
|
});
|
|
583
583
|
}
|
|
@@ -586,7 +586,7 @@ const lr = s.object({
|
|
|
586
586
|
fields: s.array(s.string()).describe("The field(s) to use for the color renderer"),
|
|
587
587
|
colorSchemes: s.array(s.string()).optional().describe("Optional color scheme tags to use"),
|
|
588
588
|
theme: s.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the color ramp")
|
|
589
|
-
}),
|
|
589
|
+
}), On = g(sr, {
|
|
590
590
|
name: "color",
|
|
591
591
|
description: `Label: Counts and Amounts (color)
|
|
592
592
|
Description: Vary color along a continuous color ramp to represent numeric or ranked data.
|
|
@@ -596,15 +596,15 @@ const lr = s.object({
|
|
|
596
596
|
schema: lr
|
|
597
597
|
});
|
|
598
598
|
function cr(e) {
|
|
599
|
-
const { fields:
|
|
599
|
+
const { fields: t, layer: r, view: a, colorSchemeTags: o, theme: n } = e;
|
|
600
600
|
let l, i;
|
|
601
|
-
const c =
|
|
601
|
+
const c = t[0];
|
|
602
602
|
return o && (i = se({
|
|
603
|
-
geometryType:
|
|
603
|
+
geometryType: r.geometryType,
|
|
604
604
|
includedTags: o,
|
|
605
605
|
theme: n || "high-to-low"
|
|
606
606
|
})[0]), {
|
|
607
|
-
layer:
|
|
607
|
+
layer: r,
|
|
608
608
|
view: a,
|
|
609
609
|
field: c,
|
|
610
610
|
normalizationField: l,
|
|
@@ -615,19 +615,19 @@ function cr(e) {
|
|
|
615
615
|
};
|
|
616
616
|
}
|
|
617
617
|
async function ur(e) {
|
|
618
|
-
return await
|
|
618
|
+
return await Be(e);
|
|
619
619
|
}
|
|
620
620
|
async function dr({
|
|
621
621
|
arcgisMap: e,
|
|
622
|
-
arcgisMapView:
|
|
623
|
-
layerId:
|
|
622
|
+
arcgisMapView: t,
|
|
623
|
+
layerId: r,
|
|
624
624
|
fields: a,
|
|
625
625
|
colorSchemes: o,
|
|
626
626
|
theme: n
|
|
627
627
|
}) {
|
|
628
|
-
const l =
|
|
628
|
+
const l = t, i = e?.allLayers.find((u) => u.id === r);
|
|
629
629
|
if (!i)
|
|
630
|
-
return `Could not find layer for id: ${
|
|
630
|
+
return `Could not find layer for id: ${r}`;
|
|
631
631
|
const c = {
|
|
632
632
|
styleName: "color-size-univariate",
|
|
633
633
|
fields: a,
|
|
@@ -645,67 +645,67 @@ async function dr({
|
|
|
645
645
|
}
|
|
646
646
|
async function pr({
|
|
647
647
|
layerId: e,
|
|
648
|
-
fields:
|
|
649
|
-
colorSchemes:
|
|
648
|
+
fields: t,
|
|
649
|
+
colorSchemes: r,
|
|
650
650
|
theme: a
|
|
651
651
|
}, o) {
|
|
652
|
-
const { mapView: n } =
|
|
653
|
-
return await
|
|
652
|
+
const { mapView: n } = $(o);
|
|
653
|
+
return await R({ type: "show-legend", data: { layerIds: [e] } }, o), await dr({
|
|
654
654
|
arcgisMap: n.map,
|
|
655
655
|
arcgisMapView: n,
|
|
656
656
|
layerId: e,
|
|
657
|
-
fields:
|
|
658
|
-
colorSchemes:
|
|
657
|
+
fields: t,
|
|
658
|
+
colorSchemes: r,
|
|
659
659
|
theme: a
|
|
660
660
|
});
|
|
661
661
|
}
|
|
662
|
-
const
|
|
662
|
+
const mr = s.object({
|
|
663
663
|
layerId: s.string().describe("The id of the layer to apply the color-size univariate renderer to"),
|
|
664
664
|
fields: s.array(s.string()).describe("The fields to use for the color-size univariate renderer"),
|
|
665
665
|
colorSchemes: s.array(s.string()).optional().describe("Optional color scheme tags to use"),
|
|
666
666
|
theme: s.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the color and size ramps")
|
|
667
|
-
}),
|
|
667
|
+
}), Mn = g(pr, {
|
|
668
668
|
name: "color-size-univariate",
|
|
669
669
|
description: `Label: Color and Size (univariate)
|
|
670
670
|
Description: Vary symbol size and color based on the values of two numeric attributes.
|
|
671
671
|
Keywords: continuous color, hue, color, size, gradation, saturation, lightness, percent, rate, ratio, index, how much, increase, decrease, amount
|
|
672
672
|
Example: Color each feature based on the percentage of the population that owns a home and vary the size of each point based on total population.
|
|
673
673
|
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.`,
|
|
674
|
-
schema:
|
|
674
|
+
schema: mr
|
|
675
675
|
});
|
|
676
|
-
function
|
|
677
|
-
const { fields:
|
|
676
|
+
function hr(e) {
|
|
677
|
+
const { fields: t, layer: r, view: a, colorSchemeTags: o } = e;
|
|
678
678
|
let n;
|
|
679
679
|
return o && (n = Ke({
|
|
680
680
|
includedTags: o,
|
|
681
|
-
numColors: Math.min(
|
|
681
|
+
numColors: Math.min(t.length, 8)
|
|
682
682
|
})[0]), {
|
|
683
|
-
layer:
|
|
683
|
+
layer: r,
|
|
684
684
|
view: a,
|
|
685
685
|
legendOptions: {
|
|
686
686
|
unit: "units"
|
|
687
687
|
},
|
|
688
|
-
attributes:
|
|
688
|
+
attributes: t.map((l) => ({
|
|
689
689
|
field: l,
|
|
690
|
-
label:
|
|
690
|
+
label: r.fields.find((i) => i.name === l)?.alias ?? ""
|
|
691
691
|
})).slice(0, 8),
|
|
692
692
|
outlineOptimizationEnabled: !0,
|
|
693
693
|
dotDensityScheme: n
|
|
694
694
|
};
|
|
695
695
|
}
|
|
696
696
|
async function yr(e) {
|
|
697
|
-
return await
|
|
697
|
+
return await Ue(e);
|
|
698
698
|
}
|
|
699
699
|
async function fr({
|
|
700
700
|
arcgisMap: e,
|
|
701
|
-
arcgisMapView:
|
|
702
|
-
layerId:
|
|
701
|
+
arcgisMapView: t,
|
|
702
|
+
layerId: r,
|
|
703
703
|
fields: a,
|
|
704
704
|
colorSchemes: o
|
|
705
705
|
}) {
|
|
706
|
-
const n =
|
|
706
|
+
const n = t, l = e?.allLayers.find((c) => c.id === r);
|
|
707
707
|
if (!l)
|
|
708
|
-
return `Could not find layer for id: ${
|
|
708
|
+
return `Could not find layer for id: ${r}`;
|
|
709
709
|
const i = {
|
|
710
710
|
styleName: "dot-density",
|
|
711
711
|
fields: a,
|
|
@@ -714,7 +714,7 @@ async function fr({
|
|
|
714
714
|
colorSchemeTags: o
|
|
715
715
|
};
|
|
716
716
|
try {
|
|
717
|
-
const c =
|
|
717
|
+
const c = hr(i), u = await yr(c);
|
|
718
718
|
return l.renderer = u.renderer, l.visible = !0, `Dot Density renderer applied to layer: ${l.title ?? l.id} using fields ${a.join(", ")}`;
|
|
719
719
|
} catch (c) {
|
|
720
720
|
return `Error applying dot density renderer: ${c instanceof Error ? c.message : String(c)}`;
|
|
@@ -722,23 +722,23 @@ async function fr({
|
|
|
722
722
|
}
|
|
723
723
|
async function gr({
|
|
724
724
|
layerId: e,
|
|
725
|
-
fields:
|
|
726
|
-
colorSchemes:
|
|
725
|
+
fields: t,
|
|
726
|
+
colorSchemes: r
|
|
727
727
|
}, a) {
|
|
728
|
-
const { mapView: o } =
|
|
729
|
-
return await
|
|
728
|
+
const { mapView: o } = $(a);
|
|
729
|
+
return await R({ type: "show-legend", data: { layerIds: [e] } }, a), await fr({
|
|
730
730
|
arcgisMap: o.map,
|
|
731
731
|
arcgisMapView: o,
|
|
732
732
|
layerId: e,
|
|
733
|
-
fields:
|
|
734
|
-
colorSchemes:
|
|
733
|
+
fields: t,
|
|
734
|
+
colorSchemes: r
|
|
735
735
|
});
|
|
736
736
|
}
|
|
737
737
|
const wr = s.object({
|
|
738
738
|
layerId: s.string().describe("The id of the layer to apply the dot density renderer to"),
|
|
739
739
|
fields: s.array(s.string()).describe("The field(s) to use for the dot density renderer (population or count data)"),
|
|
740
740
|
colorSchemes: s.array(s.string()).optional().describe("Optional color scheme tags to use")
|
|
741
|
-
}),
|
|
741
|
+
}), Qn = g(gr, {
|
|
742
742
|
name: "dot-density",
|
|
743
743
|
description: `Dot Density
|
|
744
744
|
Use dot density to visualize the distribution of one attribute or compare the density of multiple attributes. This is only valid for polygon layers.
|
|
@@ -755,14 +755,14 @@ const wr = s.object({
|
|
|
755
755
|
schema: wr
|
|
756
756
|
});
|
|
757
757
|
function br(e) {
|
|
758
|
-
const { fields:
|
|
758
|
+
const { fields: t, layer: r, view: a, colorSchemeTags: o } = e;
|
|
759
759
|
let n;
|
|
760
|
-
const l =
|
|
760
|
+
const l = t[0];
|
|
761
761
|
return o && (n = Je({
|
|
762
762
|
includedTags: o,
|
|
763
763
|
basemap: a.map?.basemap || "topo"
|
|
764
764
|
})[0]), {
|
|
765
|
-
layer:
|
|
765
|
+
layer: r,
|
|
766
766
|
view: a,
|
|
767
767
|
field: l,
|
|
768
768
|
heatmapScheme: n
|
|
@@ -773,14 +773,14 @@ async function Tr(e) {
|
|
|
773
773
|
}
|
|
774
774
|
async function vr({
|
|
775
775
|
arcgisMap: e,
|
|
776
|
-
arcgisMapView:
|
|
777
|
-
layerId:
|
|
776
|
+
arcgisMapView: t,
|
|
777
|
+
layerId: r,
|
|
778
778
|
fields: a,
|
|
779
779
|
colorSchemes: o
|
|
780
780
|
}) {
|
|
781
|
-
const n =
|
|
781
|
+
const n = t, l = e?.allLayers.find((c) => c.id === r);
|
|
782
782
|
if (!l)
|
|
783
|
-
return `Could not find layer for id: ${
|
|
783
|
+
return `Could not find layer for id: ${r}`;
|
|
784
784
|
const i = {
|
|
785
785
|
styleName: "heatmap",
|
|
786
786
|
fields: a,
|
|
@@ -797,23 +797,23 @@ async function vr({
|
|
|
797
797
|
}
|
|
798
798
|
async function Sr({
|
|
799
799
|
layerId: e,
|
|
800
|
-
fields:
|
|
801
|
-
colorSchemes:
|
|
800
|
+
fields: t,
|
|
801
|
+
colorSchemes: r
|
|
802
802
|
}, a) {
|
|
803
|
-
const { mapView: o } =
|
|
804
|
-
return await
|
|
803
|
+
const { mapView: o } = $(a);
|
|
804
|
+
return await R({ type: "show-legend", data: { layerIds: [e] } }, a), await vr({
|
|
805
805
|
arcgisMap: o.map,
|
|
806
806
|
arcgisMapView: o,
|
|
807
807
|
layerId: e,
|
|
808
|
-
fields:
|
|
809
|
-
colorSchemes:
|
|
808
|
+
fields: t,
|
|
809
|
+
colorSchemes: r
|
|
810
810
|
});
|
|
811
811
|
}
|
|
812
812
|
const xr = s.object({
|
|
813
813
|
layerId: s.string().describe("The id of the layer to apply the heatmap renderer to"),
|
|
814
814
|
fields: s.array(s.string()).describe("The field(s) to use for the heatmap renderer (typically point density)"),
|
|
815
815
|
colorSchemes: s.array(s.string()).optional().describe("Optional color scheme tags to use")
|
|
816
|
-
}),
|
|
816
|
+
}), _n = g(Sr, {
|
|
817
817
|
name: "heatmap",
|
|
818
818
|
description: `Label: Heat Map
|
|
819
819
|
Description: Show areas of high density with colors that appear to glow hotter. This is only valid for point layers.
|
|
@@ -823,16 +823,16 @@ Fields: This typically requires zero or one field of type number.`,
|
|
|
823
823
|
schema: xr
|
|
824
824
|
});
|
|
825
825
|
function Rr(e) {
|
|
826
|
-
const { fields:
|
|
826
|
+
const { fields: t, layer: r, view: a, styleName: o, colorSchemeTags: n } = e;
|
|
827
827
|
let l;
|
|
828
828
|
return n && (l = Ye({
|
|
829
|
-
geometryType:
|
|
829
|
+
geometryType: r.geometryType,
|
|
830
830
|
includedTags: n,
|
|
831
|
-
numColors: Math.min(
|
|
831
|
+
numColors: Math.min(t.length, 10)
|
|
832
832
|
})[0]), {
|
|
833
|
-
layer:
|
|
833
|
+
layer: r,
|
|
834
834
|
view: a,
|
|
835
|
-
fields:
|
|
835
|
+
fields: t.map((i) => ({ name: i })).slice(0, 9),
|
|
836
836
|
outlineOptimizationEnabled: !0,
|
|
837
837
|
sizeOptimizationEnabled: !0,
|
|
838
838
|
includeSizeVariable: o.includes("Size"),
|
|
@@ -844,15 +844,15 @@ async function $r(e) {
|
|
|
844
844
|
}
|
|
845
845
|
async function Cr({
|
|
846
846
|
arcgisMap: e,
|
|
847
|
-
arcgisMapView:
|
|
848
|
-
layerId:
|
|
847
|
+
arcgisMapView: t,
|
|
848
|
+
layerId: r,
|
|
849
849
|
fields: a,
|
|
850
850
|
colorSchemes: o,
|
|
851
851
|
includeSize: n
|
|
852
852
|
}) {
|
|
853
|
-
const l =
|
|
853
|
+
const l = t, i = e?.allLayers.find((d) => d.id === r);
|
|
854
854
|
if (!i)
|
|
855
|
-
return `Could not find layer for id: ${
|
|
855
|
+
return `Could not find layer for id: ${r}`;
|
|
856
856
|
const u = {
|
|
857
857
|
styleName: n ? "predominance-size" : "predominance",
|
|
858
858
|
fields: a,
|
|
@@ -869,17 +869,17 @@ async function Cr({
|
|
|
869
869
|
}
|
|
870
870
|
async function Er({
|
|
871
871
|
layerId: e,
|
|
872
|
-
fields:
|
|
873
|
-
colorSchemes:
|
|
872
|
+
fields: t,
|
|
873
|
+
colorSchemes: r,
|
|
874
874
|
includeSize: a
|
|
875
875
|
}, o) {
|
|
876
|
-
const { mapView: n } =
|
|
877
|
-
return await
|
|
876
|
+
const { mapView: n } = $(o);
|
|
877
|
+
return await R({ type: "show-legend", data: { layerIds: [e] } }, o), await Cr({
|
|
878
878
|
arcgisMap: n.map,
|
|
879
879
|
arcgisMapView: n,
|
|
880
880
|
layerId: e,
|
|
881
|
-
fields:
|
|
882
|
-
colorSchemes:
|
|
881
|
+
fields: t,
|
|
882
|
+
colorSchemes: r,
|
|
883
883
|
includeSize: a
|
|
884
884
|
});
|
|
885
885
|
}
|
|
@@ -888,7 +888,7 @@ const Fr = s.object({
|
|
|
888
888
|
fields: s.array(s.string()).describe("The fields to use for the predominance renderer (competing categories)"),
|
|
889
889
|
colorSchemes: s.array(s.string()).optional().describe("Optional color scheme tags to use"),
|
|
890
890
|
includeSize: s.boolean().optional().describe("Whether to include size visualization (predominance-size)")
|
|
891
|
-
}),
|
|
891
|
+
}), Wn = g(Er, {
|
|
892
892
|
name: "predominance",
|
|
893
893
|
description: `Label: Predominant category
|
|
894
894
|
Description: Compare attributes that share a common subject and unit of measurement to see which has the highest value.
|
|
@@ -904,18 +904,18 @@ const Fr = s.object({
|
|
|
904
904
|
schema: Fr
|
|
905
905
|
});
|
|
906
906
|
function kr(e) {
|
|
907
|
-
const { fields:
|
|
907
|
+
const { fields: t, layer: r, view: a, colorSchemeTags: o } = e;
|
|
908
908
|
let n;
|
|
909
909
|
const l = {
|
|
910
|
-
field:
|
|
910
|
+
field: t[0]
|
|
911
911
|
}, i = {
|
|
912
|
-
field:
|
|
912
|
+
field: t[1]
|
|
913
913
|
};
|
|
914
914
|
return o && (n = et({
|
|
915
|
-
geometryType:
|
|
915
|
+
geometryType: r.geometryType,
|
|
916
916
|
includedTags: o
|
|
917
917
|
})[0]), {
|
|
918
|
-
layer:
|
|
918
|
+
layer: r,
|
|
919
919
|
view: a,
|
|
920
920
|
field1: l,
|
|
921
921
|
field2: i,
|
|
@@ -929,14 +929,14 @@ async function Nr(e) {
|
|
|
929
929
|
}
|
|
930
930
|
async function qr({
|
|
931
931
|
arcgisMap: e,
|
|
932
|
-
arcgisMapView:
|
|
933
|
-
layerId:
|
|
932
|
+
arcgisMapView: t,
|
|
933
|
+
layerId: r,
|
|
934
934
|
fields: a,
|
|
935
935
|
colorSchemes: o
|
|
936
936
|
}) {
|
|
937
|
-
const n =
|
|
937
|
+
const n = t, l = e?.allLayers.find((c) => c.id === r);
|
|
938
938
|
if (!l)
|
|
939
|
-
return `Could not find layer for id: ${
|
|
939
|
+
return `Could not find layer for id: ${r}`;
|
|
940
940
|
const i = {
|
|
941
941
|
styleName: "relationship",
|
|
942
942
|
fields: a,
|
|
@@ -953,23 +953,23 @@ async function qr({
|
|
|
953
953
|
}
|
|
954
954
|
async function Ir({
|
|
955
955
|
layerId: e,
|
|
956
|
-
fields:
|
|
957
|
-
colorSchemes:
|
|
956
|
+
fields: t,
|
|
957
|
+
colorSchemes: r
|
|
958
958
|
}, a) {
|
|
959
|
-
const { mapView: o } =
|
|
960
|
-
return await
|
|
959
|
+
const { mapView: o } = $(a);
|
|
960
|
+
return await R({ type: "show-legend", data: { layerIds: [e] } }, a), await qr({
|
|
961
961
|
arcgisMap: o.map,
|
|
962
962
|
arcgisMapView: o,
|
|
963
963
|
layerId: e,
|
|
964
|
-
fields:
|
|
965
|
-
colorSchemes:
|
|
964
|
+
fields: t,
|
|
965
|
+
colorSchemes: r
|
|
966
966
|
});
|
|
967
967
|
}
|
|
968
968
|
const zr = s.object({
|
|
969
969
|
layerId: s.string().describe("The id of the layer to apply the relationship renderer to"),
|
|
970
970
|
fields: s.array(s.string()).describe("The two fields to use for the relationship renderer (bivariate visualization)"),
|
|
971
971
|
colorSchemes: s.array(s.string()).optional().describe("Optional color scheme tags to use")
|
|
972
|
-
}),
|
|
972
|
+
}), Vn = g(Ir, {
|
|
973
973
|
name: "relationship",
|
|
974
974
|
description: `Label: Relationship
|
|
975
975
|
Description: Overlays two color ramps to represent the relationship between two numeric attributes.
|
|
@@ -979,9 +979,9 @@ const zr = s.object({
|
|
|
979
979
|
schema: zr
|
|
980
980
|
});
|
|
981
981
|
function Dr(e) {
|
|
982
|
-
const { fields:
|
|
982
|
+
const { fields: t, layer: r, view: a, theme: o } = e, n = t[0];
|
|
983
983
|
return {
|
|
984
|
-
layer:
|
|
984
|
+
layer: r,
|
|
985
985
|
view: a,
|
|
986
986
|
startTime: n,
|
|
987
987
|
endTime: /* @__PURE__ */ new Date(),
|
|
@@ -995,15 +995,15 @@ async function Pr(e) {
|
|
|
995
995
|
}
|
|
996
996
|
async function Ar({
|
|
997
997
|
arcgisMap: e,
|
|
998
|
-
arcgisMapView:
|
|
999
|
-
layerId:
|
|
998
|
+
arcgisMapView: t,
|
|
999
|
+
layerId: r,
|
|
1000
1000
|
fields: a,
|
|
1001
1001
|
colorSchemes: o,
|
|
1002
1002
|
theme: n
|
|
1003
1003
|
}) {
|
|
1004
|
-
const l =
|
|
1004
|
+
const l = t, i = e?.allLayers.find((u) => u.id === r);
|
|
1005
1005
|
if (!i)
|
|
1006
|
-
return `Could not find layer for id: ${
|
|
1006
|
+
return `Could not find layer for id: ${r}`;
|
|
1007
1007
|
const c = {
|
|
1008
1008
|
styleName: "size-age",
|
|
1009
1009
|
fields: a,
|
|
@@ -1019,42 +1019,42 @@ async function Ar({
|
|
|
1019
1019
|
return `Error applying size-age renderer: ${u instanceof Error ? u.message : String(u)}`;
|
|
1020
1020
|
}
|
|
1021
1021
|
}
|
|
1022
|
-
async function
|
|
1022
|
+
async function Lr({
|
|
1023
1023
|
layerId: e,
|
|
1024
|
-
fields:
|
|
1025
|
-
colorSchemes:
|
|
1024
|
+
fields: t,
|
|
1025
|
+
colorSchemes: r,
|
|
1026
1026
|
theme: a
|
|
1027
1027
|
}, o) {
|
|
1028
|
-
const { mapView: n } =
|
|
1029
|
-
return await
|
|
1028
|
+
const { mapView: n } = $(o);
|
|
1029
|
+
return await R({ type: "show-legend", data: { layerIds: [e] } }, o), await Ar({
|
|
1030
1030
|
arcgisMap: n.map,
|
|
1031
1031
|
arcgisMapView: n,
|
|
1032
1032
|
layerId: e,
|
|
1033
|
-
fields:
|
|
1034
|
-
colorSchemes:
|
|
1033
|
+
fields: t,
|
|
1034
|
+
colorSchemes: r,
|
|
1035
1035
|
theme: a
|
|
1036
1036
|
});
|
|
1037
1037
|
}
|
|
1038
|
-
const
|
|
1038
|
+
const jr = s.object({
|
|
1039
1039
|
layerId: s.string().describe("The id of the layer to apply the size-age renderer to"),
|
|
1040
1040
|
fields: s.array(s.string()).describe("The field(s) to use for the size-age renderer (temporal data with size)"),
|
|
1041
1041
|
colorSchemes: s.array(s.string()).optional().describe("Optional color scheme tags to use"),
|
|
1042
1042
|
theme: s.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the size ramp")
|
|
1043
|
-
}),
|
|
1043
|
+
}), Bn = g(Lr, {
|
|
1044
1044
|
name: "size-age",
|
|
1045
1045
|
description: `Label: Age (size)
|
|
1046
1046
|
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.
|
|
1047
1047
|
Keywords: since, age, how old, how long
|
|
1048
1048
|
Example: Change the size of features so older features are larger than new features.
|
|
1049
1049
|
Fields: This style requires at least one field with a date type.`,
|
|
1050
|
-
schema:
|
|
1050
|
+
schema: jr
|
|
1051
1051
|
});
|
|
1052
1052
|
function Gr(e) {
|
|
1053
|
-
const { fields:
|
|
1054
|
-
let { theme: o } = e, n =
|
|
1055
|
-
const l =
|
|
1053
|
+
const { fields: t, layer: r, view: a } = e;
|
|
1054
|
+
let { theme: o } = e, n = t[1];
|
|
1055
|
+
const l = t[0];
|
|
1056
1056
|
return {
|
|
1057
|
-
layer:
|
|
1057
|
+
layer: r,
|
|
1058
1058
|
view: a,
|
|
1059
1059
|
field: l,
|
|
1060
1060
|
normalizationField: n,
|
|
@@ -1068,15 +1068,15 @@ async function Or(e) {
|
|
|
1068
1068
|
}
|
|
1069
1069
|
async function Mr({
|
|
1070
1070
|
arcgisMap: e,
|
|
1071
|
-
arcgisMapView:
|
|
1072
|
-
layerId:
|
|
1071
|
+
arcgisMapView: t,
|
|
1072
|
+
layerId: r,
|
|
1073
1073
|
fields: a,
|
|
1074
1074
|
colorSchemes: o,
|
|
1075
1075
|
theme: n
|
|
1076
1076
|
}) {
|
|
1077
|
-
const l =
|
|
1077
|
+
const l = t, i = e?.allLayers.find((u) => u.id === r);
|
|
1078
1078
|
if (!i)
|
|
1079
|
-
return `Could not find layer for id: ${
|
|
1079
|
+
return `Could not find layer for id: ${r}`;
|
|
1080
1080
|
const c = {
|
|
1081
1081
|
styleName: "size",
|
|
1082
1082
|
fields: a,
|
|
@@ -1094,17 +1094,17 @@ async function Mr({
|
|
|
1094
1094
|
}
|
|
1095
1095
|
async function Qr({
|
|
1096
1096
|
layerId: e,
|
|
1097
|
-
fields:
|
|
1098
|
-
colorSchemes:
|
|
1097
|
+
fields: t,
|
|
1098
|
+
colorSchemes: r,
|
|
1099
1099
|
theme: a
|
|
1100
1100
|
}, o) {
|
|
1101
|
-
const { mapView: n } =
|
|
1102
|
-
return await
|
|
1101
|
+
const { mapView: n } = $(o);
|
|
1102
|
+
return await R({ type: "show-legend", data: { layerIds: [e] } }, o), await Mr({
|
|
1103
1103
|
arcgisMap: n.map,
|
|
1104
1104
|
arcgisMapView: n,
|
|
1105
1105
|
layerId: e,
|
|
1106
|
-
fields:
|
|
1107
|
-
colorSchemes:
|
|
1106
|
+
fields: t,
|
|
1107
|
+
colorSchemes: r,
|
|
1108
1108
|
theme: a
|
|
1109
1109
|
});
|
|
1110
1110
|
}
|
|
@@ -1113,7 +1113,7 @@ const _r = s.object({
|
|
|
1113
1113
|
fields: s.array(s.string()).describe("The field(s) to use for the size renderer (numeric data)"),
|
|
1114
1114
|
colorSchemes: s.array(s.string()).optional().describe("Optional color scheme tags to use"),
|
|
1115
1115
|
theme: s.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the size ramp")
|
|
1116
|
-
}),
|
|
1116
|
+
}), Un = g(Qr, {
|
|
1117
1117
|
name: "size",
|
|
1118
1118
|
description: `Label: Counts and Amounts (size)
|
|
1119
1119
|
Description: Vary symbol sizes along a continuous ramp to represent numeric or ranked data.
|
|
@@ -1129,13 +1129,13 @@ const _r = s.object({
|
|
|
1129
1129
|
schema: _r
|
|
1130
1130
|
});
|
|
1131
1131
|
function Wr(e) {
|
|
1132
|
-
const { fields:
|
|
1132
|
+
const { fields: t, layer: r, view: a, colorSchemeTags: o } = e, n = t[0], l = t[1], i = t[2];
|
|
1133
1133
|
let c;
|
|
1134
1134
|
return o && (c = ot({
|
|
1135
|
-
geometryType:
|
|
1135
|
+
geometryType: r.geometryType,
|
|
1136
1136
|
includedTags: o
|
|
1137
1137
|
})[0]), {
|
|
1138
|
-
layer:
|
|
1138
|
+
layer: r,
|
|
1139
1139
|
view: a,
|
|
1140
1140
|
field: n,
|
|
1141
1141
|
field2: l,
|
|
@@ -1148,17 +1148,17 @@ function Wr(e) {
|
|
|
1148
1148
|
async function Vr(e) {
|
|
1149
1149
|
return await at(e);
|
|
1150
1150
|
}
|
|
1151
|
-
async function
|
|
1151
|
+
async function Br({
|
|
1152
1152
|
arcgisMap: e,
|
|
1153
|
-
arcgisMapView:
|
|
1154
|
-
layerId:
|
|
1153
|
+
arcgisMapView: t,
|
|
1154
|
+
layerId: r,
|
|
1155
1155
|
fields: a,
|
|
1156
1156
|
colorSchemes: o,
|
|
1157
1157
|
theme: n
|
|
1158
1158
|
}) {
|
|
1159
|
-
const l =
|
|
1159
|
+
const l = t, i = e?.allLayers.find((u) => u.id === r);
|
|
1160
1160
|
if (!i)
|
|
1161
|
-
return `Could not find layer for id: ${
|
|
1161
|
+
return `Could not find layer for id: ${r}`;
|
|
1162
1162
|
const c = {
|
|
1163
1163
|
styleName: "type",
|
|
1164
1164
|
fields: a,
|
|
@@ -1174,19 +1174,19 @@ async function Ur({
|
|
|
1174
1174
|
return `Error applying type renderer: ${u instanceof Error ? u.message : String(u)}`;
|
|
1175
1175
|
}
|
|
1176
1176
|
}
|
|
1177
|
-
async function
|
|
1177
|
+
async function Ur({
|
|
1178
1178
|
layerId: e,
|
|
1179
|
-
fields:
|
|
1180
|
-
colorSchemes:
|
|
1179
|
+
fields: t,
|
|
1180
|
+
colorSchemes: r,
|
|
1181
1181
|
theme: a
|
|
1182
1182
|
}, o) {
|
|
1183
|
-
const { mapView: n } =
|
|
1184
|
-
return await
|
|
1183
|
+
const { mapView: n } = $(o);
|
|
1184
|
+
return await R({ type: "show-legend", data: { layerIds: [e] } }, o), await Br({
|
|
1185
1185
|
arcgisMap: n.map,
|
|
1186
1186
|
arcgisMapView: n,
|
|
1187
1187
|
layerId: e,
|
|
1188
|
-
fields:
|
|
1189
|
-
colorSchemes:
|
|
1188
|
+
fields: t,
|
|
1189
|
+
colorSchemes: r,
|
|
1190
1190
|
theme: a
|
|
1191
1191
|
});
|
|
1192
1192
|
}
|
|
@@ -1195,7 +1195,7 @@ const Kr = s.object({
|
|
|
1195
1195
|
fields: s.array(s.string()).describe("The field(s) to use for the type renderer (categorical data)"),
|
|
1196
1196
|
colorSchemes: s.array(s.string()).optional().describe("Optional color scheme tags to use"),
|
|
1197
1197
|
theme: s.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the color scheme")
|
|
1198
|
-
}),
|
|
1198
|
+
}), Kn = g(Ur, {
|
|
1199
1199
|
name: "type",
|
|
1200
1200
|
description: `Label: Types (unique symbols)
|
|
1201
1201
|
Description: Represent features as categories with different symbol colors or shapes. Examples include type of tree, road class, or province name.
|
|
@@ -1203,43 +1203,43 @@ Keywords: categorical, category, type, unique, discrete, point of interest, regi
|
|
|
1203
1203
|
Example: Color each feature based on the region it belongs to
|
|
1204
1204
|
Fields: This style requires a single field which may be a string, number, or date type. It is usually a string.`,
|
|
1205
1205
|
schema: Kr
|
|
1206
|
-
}),
|
|
1206
|
+
}), Hn = T.Root({
|
|
1207
1207
|
...H(),
|
|
1208
|
-
vectorSearchLayerIds:
|
|
1209
|
-
vectorSearchFieldResults:
|
|
1210
|
-
layerFieldInfo:
|
|
1211
|
-
selectedLayerId:
|
|
1212
|
-
}),
|
|
1208
|
+
vectorSearchLayerIds: T(),
|
|
1209
|
+
vectorSearchFieldResults: T(),
|
|
1210
|
+
layerFieldInfo: T(),
|
|
1211
|
+
selectedLayerId: T()
|
|
1212
|
+
}), Jn = T.Root({
|
|
1213
1213
|
...H(),
|
|
1214
|
-
vectorSearchLayerIds:
|
|
1215
|
-
vectorSearchFieldResults:
|
|
1216
|
-
layerFieldInfo:
|
|
1217
|
-
queryResponse:
|
|
1218
|
-
dataExplorationMessages:
|
|
1214
|
+
vectorSearchLayerIds: T(),
|
|
1215
|
+
vectorSearchFieldResults: T(),
|
|
1216
|
+
layerFieldInfo: T(),
|
|
1217
|
+
queryResponse: T(),
|
|
1218
|
+
dataExplorationMessages: T({
|
|
1219
1219
|
reducer: be,
|
|
1220
1220
|
default: () => []
|
|
1221
1221
|
})
|
|
1222
1222
|
}), Hr = ["mapView"];
|
|
1223
1223
|
function N(e) {
|
|
1224
|
-
const
|
|
1225
|
-
if (!
|
|
1224
|
+
const r = e?.configurable?.context;
|
|
1225
|
+
if (!r || typeof r != "object")
|
|
1226
1226
|
throw new Error("DataExplorationAgent context missing");
|
|
1227
|
-
const a = Hr.filter((o) => !(o in
|
|
1227
|
+
const a = Hr.filter((o) => !(o in r));
|
|
1228
1228
|
if (a.length)
|
|
1229
1229
|
throw new Error(`DataExplorationAgent context missing: ${a.join(", ")}`);
|
|
1230
|
-
return
|
|
1230
|
+
return r;
|
|
1231
1231
|
}
|
|
1232
1232
|
const Jr = (e) => {
|
|
1233
|
-
const
|
|
1234
|
-
let
|
|
1235
|
-
return
|
|
1233
|
+
const t = e.map?.allLayers.filter((a) => a.type === "feature");
|
|
1234
|
+
let r = 0;
|
|
1235
|
+
return t?.forEach((a) => {
|
|
1236
1236
|
const o = a;
|
|
1237
|
-
o.featureEffect && (o.featureEffect = null,
|
|
1238
|
-
}),
|
|
1239
|
-
}, Zr = async (e,
|
|
1240
|
-
const { mapView:
|
|
1241
|
-
return Jr(
|
|
1242
|
-
}, Yr =
|
|
1237
|
+
o.featureEffect && (o.featureEffect = null, r++);
|
|
1238
|
+
}), r > 0 ? `Cleared filters from ${r} layer(s). View unchanged.` : "No active filters to clear. View unchanged.";
|
|
1239
|
+
}, Zr = async (e, t) => {
|
|
1240
|
+
const { mapView: r } = N(t);
|
|
1241
|
+
return Jr(r);
|
|
1242
|
+
}, Yr = g(Zr, {
|
|
1243
1243
|
name: "clearFilters",
|
|
1244
1244
|
description: "Clears all feature effects/filters from the map but does NOT change the current view. Use when user says 'clear filters', 'reset filters', 'remove filters', 'show all features', or wants to remove emphasis without navigating anywhere.",
|
|
1245
1245
|
schema: s.object({})
|
|
@@ -1250,41 +1250,41 @@ const Jr = (e) => {
|
|
|
1250
1250
|
});
|
|
1251
1251
|
const a = e.map.initialViewProperties?.viewpoint?.targetGeometry;
|
|
1252
1252
|
return a ? (await e.goTo(a), "Cleared all filters and returned to home extent.") : "Cleared all filters. Could not determine home extent.";
|
|
1253
|
-
}, ea = async (e,
|
|
1254
|
-
const { mapView:
|
|
1255
|
-
return await Xr(
|
|
1256
|
-
}, ta =
|
|
1253
|
+
}, ea = async (e, t) => {
|
|
1254
|
+
const { mapView: r } = N(t);
|
|
1255
|
+
return await Xr(r);
|
|
1256
|
+
}, ta = g(ea, {
|
|
1257
1257
|
name: "resetMap",
|
|
1258
1258
|
description: "Clears all feature effects/filters from the map AND zooms to the home extent (initial map view). Use when user says 'reset map', 'reset the map', 'start over', or wants to both clear filters and return to the initial view.",
|
|
1259
1259
|
schema: s.object({})
|
|
1260
1260
|
}), we = 750;
|
|
1261
|
-
function
|
|
1261
|
+
function U(e) {
|
|
1262
1262
|
return "point" in e && e.point !== void 0;
|
|
1263
1263
|
}
|
|
1264
|
-
function
|
|
1264
|
+
function j(e) {
|
|
1265
1265
|
return "layerId" in e && e.layerId !== void 0;
|
|
1266
1266
|
}
|
|
1267
|
-
const J = async (e,
|
|
1268
|
-
if (
|
|
1269
|
-
const { point:
|
|
1267
|
+
const J = async (e, t) => {
|
|
1268
|
+
if (U(e)) {
|
|
1269
|
+
const { point: r } = e;
|
|
1270
1270
|
return { geometry: new Te({
|
|
1271
|
-
x:
|
|
1272
|
-
y:
|
|
1273
|
-
spatialReference:
|
|
1271
|
+
x: r.x,
|
|
1272
|
+
y: r.y,
|
|
1273
|
+
spatialReference: r.spatialReference ? { wkid: r.spatialReference.wkid } : t.spatialReference
|
|
1274
1274
|
}) };
|
|
1275
1275
|
}
|
|
1276
|
-
if (
|
|
1277
|
-
const
|
|
1276
|
+
if (j(e)) {
|
|
1277
|
+
const r = t.map?.allLayers.find(
|
|
1278
1278
|
(n) => n.id === e.layerId
|
|
1279
1279
|
);
|
|
1280
|
-
if (!
|
|
1280
|
+
if (!r)
|
|
1281
1281
|
return { error: `Could not find geometry layer with ID: ${e.layerId}` };
|
|
1282
|
-
const a =
|
|
1282
|
+
const a = r.title ?? r.id, o = e.where?.trim() || "1=1";
|
|
1283
1283
|
try {
|
|
1284
|
-
const n = await
|
|
1284
|
+
const n = await r.queryFeatures({
|
|
1285
1285
|
where: o,
|
|
1286
1286
|
returnGeometry: !0,
|
|
1287
|
-
outSpatialReference:
|
|
1287
|
+
outSpatialReference: t.spatialReference,
|
|
1288
1288
|
num: we + 1
|
|
1289
1289
|
});
|
|
1290
1290
|
if (!n.features.length)
|
|
@@ -1299,18 +1299,18 @@ const J = async (e, r) => {
|
|
|
1299
1299
|
if (!l.length)
|
|
1300
1300
|
return { error: "No valid geometries found for the matched geometry layer features." };
|
|
1301
1301
|
const i = l.length === 1 ? l[0] : st.executeMany(l);
|
|
1302
|
-
return i ? (i.spatialReference || (i.spatialReference =
|
|
1302
|
+
return i ? (i.spatialReference || (i.spatialReference = t.spatialReference), { geometry: i }) : { error: "Failed to combine geometries from geometry layer." };
|
|
1303
1303
|
} catch (n) {
|
|
1304
1304
|
return { error: `Failed to query geometry: ${String(n)}` };
|
|
1305
1305
|
}
|
|
1306
1306
|
}
|
|
1307
1307
|
return { error: "Invalid geometry configuration provided" };
|
|
1308
|
-
}, ra = async (e,
|
|
1309
|
-
const l = e.map?.allLayers.find((c) => c.id ===
|
|
1308
|
+
}, ra = async (e, t, r, a, o, n) => {
|
|
1309
|
+
const l = e.map?.allLayers.find((c) => c.id === t);
|
|
1310
1310
|
if (!l)
|
|
1311
|
-
return { success: !1, error: `Layer '${
|
|
1311
|
+
return { success: !1, error: `Layer '${t}' not found.` };
|
|
1312
1312
|
const i = l.createQuery();
|
|
1313
|
-
i.where =
|
|
1313
|
+
i.where = r ?? "1=1", a && (i.geometry = a, i.spatialRelationship = "intersects", o && (i.distance = o), n && (i.units = n));
|
|
1314
1314
|
try {
|
|
1315
1315
|
const { extent: c, count: u } = await l.queryExtent(i);
|
|
1316
1316
|
return !c || u === 0 ? {
|
|
@@ -1323,15 +1323,15 @@ const J = async (e, r) => {
|
|
|
1323
1323
|
error: c instanceof Error ? c.message : String(c)
|
|
1324
1324
|
};
|
|
1325
1325
|
}
|
|
1326
|
-
}, aa = async (e,
|
|
1327
|
-
const l =
|
|
1326
|
+
}, aa = async (e, t, r, a, o, n) => {
|
|
1327
|
+
const l = t.map?.allLayers.find(
|
|
1328
1328
|
(p) => p.id === e.layerId
|
|
1329
1329
|
);
|
|
1330
1330
|
if (!l)
|
|
1331
1331
|
return `Could not find target layer with ID: ${e.layerId}`;
|
|
1332
1332
|
let i;
|
|
1333
1333
|
if (o) {
|
|
1334
|
-
const p = await J(o,
|
|
1334
|
+
const p = await J(o, t);
|
|
1335
1335
|
if ("error" in p)
|
|
1336
1336
|
return p.error;
|
|
1337
1337
|
i = p.geometry;
|
|
@@ -1344,12 +1344,12 @@ const J = async (e, r) => {
|
|
|
1344
1344
|
distance: o?.distance,
|
|
1345
1345
|
units: o?.units
|
|
1346
1346
|
}),
|
|
1347
|
-
includedEffect:
|
|
1347
|
+
includedEffect: r,
|
|
1348
1348
|
excludedEffect: a
|
|
1349
1349
|
}), l.visible = !0, n)
|
|
1350
1350
|
return `Applied feature effects to "${l.title ?? e.layerId}" within current map extent.`;
|
|
1351
1351
|
const c = e.objectIds?.length ? `${l.objectIdField} IN (${e.objectIds.join(",")})` : e.where, u = await ra(
|
|
1352
|
-
|
|
1352
|
+
t,
|
|
1353
1353
|
e.layerId,
|
|
1354
1354
|
c,
|
|
1355
1355
|
i,
|
|
@@ -1359,13 +1359,13 @@ const J = async (e, r) => {
|
|
|
1359
1359
|
return u.success ? `Applied feature effects to target layer "${l.title ?? e.layerId}"${o && "layerId" in o ? ` using geometry from layer "${o.layerId}"` : ""}.` : `Applied filter to "${d}" but no features matched. ${u.error}`;
|
|
1360
1360
|
}, oa = ["feet", "kilometers", "meters", "miles", "nautical-miles", "us-nautical-miles"], F = s.enum(oa), na = async ({
|
|
1361
1361
|
targetLayer: e,
|
|
1362
|
-
geometryFilter:
|
|
1363
|
-
useCurrentExtent:
|
|
1362
|
+
geometryFilter: t,
|
|
1363
|
+
useCurrentExtent: r,
|
|
1364
1364
|
includedEffect: a = "drop-shadow(2px, 2px, 2px, gray)",
|
|
1365
1365
|
excludedEffect: o = "grayscale(100%) opacity(60%) blur(2px)"
|
|
1366
1366
|
}, n) => {
|
|
1367
1367
|
const { mapView: l } = N(n);
|
|
1368
|
-
return await aa(e, l, a, o,
|
|
1368
|
+
return await aa(e, l, a, o, t, r);
|
|
1369
1369
|
}, ia = s.object({
|
|
1370
1370
|
layerId: s.string().describe("The layerId of the layer containing the geometry by which to filter."),
|
|
1371
1371
|
where: s.string().describe("The SQL-92 where clause representing the features from which to filter."),
|
|
@@ -1399,7 +1399,7 @@ const J = async (e, r) => {
|
|
|
1399
1399
|
excludedEffect: s.string().default("grayscale(100%) opacity(60%) blur(2px)").describe(
|
|
1400
1400
|
"The effect applied to features that do not meet the filter requirements. Valid effects include: bloom, blur, brightness, contrast, drop-shadow, grayscale, hue-rotate, invert, opacity, saturate, and sepia. Prefer default unless specified."
|
|
1401
1401
|
)
|
|
1402
|
-
}), ca =
|
|
1402
|
+
}), ca = g(na, {
|
|
1403
1403
|
name: "setFeatureEffect",
|
|
1404
1404
|
description: "Sets a feature effect on a given layer with given filter parameters and feature effects to emphasize certain features that meet a filter requirement. If no feature effect information is provided, then use the default effect provided.",
|
|
1405
1405
|
schema: la
|
|
@@ -1407,20 +1407,20 @@ const J = async (e, r) => {
|
|
|
1407
1407
|
if (e instanceof Date)
|
|
1408
1408
|
return Number.isNaN(e.getTime()) ? null : e;
|
|
1409
1409
|
if (typeof e == "number" && Number.isFinite(e)) {
|
|
1410
|
-
const
|
|
1411
|
-
return Number.isNaN(
|
|
1410
|
+
const t = new Date(e);
|
|
1411
|
+
return Number.isNaN(t.getTime()) ? null : t;
|
|
1412
1412
|
}
|
|
1413
1413
|
return null;
|
|
1414
1414
|
}, ua = (e) => !e || e === "system" ? Intl.DateTimeFormat().resolvedOptions().timeZone : e === "unknown" ? "UTC" : e, da = (e) => {
|
|
1415
1415
|
if (typeof e == "string" && e)
|
|
1416
1416
|
return e;
|
|
1417
|
-
const
|
|
1418
|
-
return
|
|
1419
|
-
},
|
|
1420
|
-
const e = (/* @__PURE__ */ new Date()).getTimezoneOffset(),
|
|
1417
|
+
const t = te(e);
|
|
1418
|
+
return t ? t.toISOString().slice(0, 10) : null;
|
|
1419
|
+
}, Zn = () => {
|
|
1420
|
+
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}`;
|
|
1421
1421
|
return { userTimezone: Intl.DateTimeFormat().resolvedOptions().timeZone, userTimezoneOffset: o };
|
|
1422
|
-
}, pa = (e,
|
|
1423
|
-
const a =
|
|
1422
|
+
}, pa = (e, t, r) => {
|
|
1423
|
+
const a = t?.toLowerCase();
|
|
1424
1424
|
if (a === "date-only") {
|
|
1425
1425
|
const n = da(e);
|
|
1426
1426
|
return n ? lt(n, _("short-date")) : e;
|
|
@@ -1437,62 +1437,62 @@ const J = async (e, r) => {
|
|
|
1437
1437
|
const o = te(e);
|
|
1438
1438
|
return o ? ye(o, {
|
|
1439
1439
|
..._("short-date-short-time"),
|
|
1440
|
-
timeZone: ua(
|
|
1440
|
+
timeZone: ua(r)
|
|
1441
1441
|
}) : e;
|
|
1442
|
-
}, Re = (e,
|
|
1442
|
+
}, Re = (e, t, r) => {
|
|
1443
1443
|
if (e && typeof e != "function") {
|
|
1444
|
-
const a = "getField" in
|
|
1444
|
+
const a = "getField" in r && r.getField?.(e), o = a && "getFieldDomain" in r && r.getFieldDomain ? r.getFieldDomain(a.name) : null;
|
|
1445
1445
|
if (o?.type === "coded-value") {
|
|
1446
|
-
const l = o.codedValues.find((i) => i.code ===
|
|
1446
|
+
const l = o.codedValues.find((i) => i.code === t);
|
|
1447
1447
|
return l ? l.name : null;
|
|
1448
1448
|
}
|
|
1449
1449
|
}
|
|
1450
1450
|
return null;
|
|
1451
|
-
},
|
|
1451
|
+
}, ma = (e) => !e || e === "system" ? Intl.DateTimeFormat().resolvedOptions().timeZone : e === "unknown" ? "UTC" : e, ha = (e) => {
|
|
1452
1452
|
if (e instanceof Date)
|
|
1453
1453
|
return Number.isNaN(e.getTime()) ? null : e;
|
|
1454
1454
|
if (typeof e == "number" && Number.isFinite(e)) {
|
|
1455
|
-
const
|
|
1456
|
-
return Number.isNaN(
|
|
1455
|
+
const t = new Date(e);
|
|
1456
|
+
return Number.isNaN(t.getTime()) ? null : t;
|
|
1457
1457
|
}
|
|
1458
1458
|
if (typeof e == "string" && e) {
|
|
1459
|
-
const
|
|
1460
|
-
return Number.isNaN(
|
|
1459
|
+
const t = new Date(e);
|
|
1460
|
+
return Number.isNaN(t.getTime()) ? null : t;
|
|
1461
1461
|
}
|
|
1462
1462
|
return null;
|
|
1463
|
-
}, ya = (e,
|
|
1463
|
+
}, ya = (e, t) => {
|
|
1464
1464
|
if (typeof e != "number")
|
|
1465
1465
|
return e;
|
|
1466
|
-
const
|
|
1467
|
-
|
|
1466
|
+
const r = {};
|
|
1467
|
+
t.minimumFractionDigits !== void 0 && (r.minimumFractionDigits = t.minimumFractionDigits), t.maximumFractionDigits !== void 0 && (r.maximumFractionDigits = t.maximumFractionDigits), t.useGrouping === "always" ? r.useGrouping = !0 : t.useGrouping === "never" && (r.useGrouping = !1);
|
|
1468
1468
|
try {
|
|
1469
|
-
return new Intl.NumberFormat(void 0,
|
|
1469
|
+
return new Intl.NumberFormat(void 0, r).format(e);
|
|
1470
1470
|
} catch {
|
|
1471
1471
|
return e;
|
|
1472
1472
|
}
|
|
1473
|
-
}, fa = (e,
|
|
1474
|
-
const a =
|
|
1473
|
+
}, fa = (e, t, r) => {
|
|
1474
|
+
const a = ha(e);
|
|
1475
1475
|
if (!a)
|
|
1476
1476
|
return e;
|
|
1477
1477
|
const o = {};
|
|
1478
|
-
|
|
1478
|
+
t.dateStyle ? o.dateStyle = t.dateStyle : (t.year && (o.year = t.year), t.month && (o.month = t.month)), t.timeStyle && (o.timeStyle = t.timeStyle), t.timeStyle && t.hour12 === "always" ? o.hour12 = !0 : t.timeStyle && t.hour12 === "never" && (o.hour12 = !1), o.timeZone = ma(r);
|
|
1479
1479
|
try {
|
|
1480
1480
|
return new Intl.DateTimeFormat(void 0, o).format(a);
|
|
1481
1481
|
} catch {
|
|
1482
1482
|
return e;
|
|
1483
1483
|
}
|
|
1484
|
-
}, $e = (e,
|
|
1485
|
-
if (
|
|
1486
|
-
return
|
|
1487
|
-
const l = e.getFieldConfiguration?.(
|
|
1488
|
-
return l?.type === "number" ? ya(
|
|
1489
|
-
}, ga = (e,
|
|
1490
|
-
const o = e.fieldsIndex?.get(
|
|
1491
|
-
return Ce(e,
|
|
1492
|
-
}, wa = (e,
|
|
1493
|
-
const a = e.objectIdField, o =
|
|
1484
|
+
}, $e = (e, t) => e.getFieldAlias?.(t) ?? e.fieldsIndex?.get(t)?.alias ?? e.fieldsIndex?.get(t)?.name ?? t, Ce = (e, t, r, a, o) => {
|
|
1485
|
+
if (r == null)
|
|
1486
|
+
return r;
|
|
1487
|
+
const l = e.getFieldConfiguration?.(t)?.fieldFormat;
|
|
1488
|
+
return l?.type === "number" ? ya(r, l) : l?.type === "date-time" ? fa(r, l, o) : pa(r, a, o);
|
|
1489
|
+
}, ga = (e, t, r, a) => {
|
|
1490
|
+
const o = e.fieldsIndex?.get(t), n = Re(t, r, e) ?? r;
|
|
1491
|
+
return Ce(e, t, n, o?.type, a);
|
|
1492
|
+
}, wa = (e, t) => $e(e, t), Ee = (e, t, r) => {
|
|
1493
|
+
const a = e.objectIdField, o = t.features.map(
|
|
1494
1494
|
(l) => l.attributes[a]
|
|
1495
|
-
), n =
|
|
1495
|
+
), n = t.features.map((l) => {
|
|
1496
1496
|
const i = l.attributes, c = {};
|
|
1497
1497
|
return e.fields.forEach((u) => {
|
|
1498
1498
|
if (!Object.hasOwn(i, u.name))
|
|
@@ -1502,30 +1502,30 @@ const J = async (e, r) => {
|
|
|
1502
1502
|
c[u.name] = d;
|
|
1503
1503
|
return;
|
|
1504
1504
|
}
|
|
1505
|
-
const p = Re(u.name, d, e) ?? d,
|
|
1506
|
-
c[
|
|
1505
|
+
const p = Re(u.name, d, e) ?? d, m = $e(e, u.name);
|
|
1506
|
+
c[m] = Ce(e, u.name, p, u.type, r);
|
|
1507
1507
|
}), c;
|
|
1508
1508
|
});
|
|
1509
1509
|
return { objectIds: o, attributes: n };
|
|
1510
|
-
}, ba = (e,
|
|
1510
|
+
}, ba = (e, t, r) => {
|
|
1511
1511
|
const a = e.createQuery();
|
|
1512
|
-
return a.outFields = [
|
|
1513
|
-
}, Ta = async (e,
|
|
1514
|
-
const o = a.map?.allLayers.find((
|
|
1512
|
+
return a.outFields = [t], a.where = r || "1=1", a.num = 1, a;
|
|
1513
|
+
}, Ta = async (e, t, r, a) => {
|
|
1514
|
+
const o = a.map?.allLayers.find((m) => m.id === e), n = ba(o, t, r.where), i = (await o.queryFeatures(n)).features[0], c = i ? i.attributes[t] : null, u = ga(o, t, c, a.timeZone), d = wa(o, t);
|
|
1515
1515
|
return {
|
|
1516
1516
|
tool: "getAttribute",
|
|
1517
1517
|
layerName: o.title ?? e,
|
|
1518
1518
|
summary: `${d} = ${u}`,
|
|
1519
1519
|
details: {
|
|
1520
|
-
fieldName:
|
|
1521
|
-
fieldAlias: d !==
|
|
1520
|
+
fieldName: t,
|
|
1521
|
+
fieldAlias: d !== t ? d : void 0,
|
|
1522
1522
|
value: u,
|
|
1523
|
-
where:
|
|
1523
|
+
where: r.where
|
|
1524
1524
|
}
|
|
1525
1525
|
};
|
|
1526
1526
|
};
|
|
1527
|
-
async function va({ layerId: e, fieldName:
|
|
1528
|
-
const { mapView: o } = N(a), n = await Ta(e,
|
|
1527
|
+
async function va({ layerId: e, fieldName: t, query: r }, a) {
|
|
1528
|
+
const { mapView: o } = N(a), n = await Ta(e, t, r, o);
|
|
1529
1529
|
return JSON.stringify(n, null, 2);
|
|
1530
1530
|
}
|
|
1531
1531
|
const Sa = s.object({
|
|
@@ -1534,32 +1534,37 @@ const Sa = s.object({
|
|
|
1534
1534
|
query: s.object({
|
|
1535
1535
|
where: s.string().describe("The SQL-92 where clause representing the feature from which to get an attribute value.")
|
|
1536
1536
|
})
|
|
1537
|
-
}), xa =
|
|
1537
|
+
}), xa = g(va, {
|
|
1538
1538
|
name: "getAttribute",
|
|
1539
1539
|
description: "Returns an attribute value for a given feature.",
|
|
1540
1540
|
schema: Sa
|
|
1541
|
-
}), le = (e,
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1541
|
+
}), le = (e, t, r) => {
|
|
1542
|
+
if (!(r ? e.hasAllFeaturesInView : e.hasAllFeatures))
|
|
1543
|
+
return !1;
|
|
1544
|
+
const o = new Set((e.availableFields ?? []).map((n) => n.toLowerCase()));
|
|
1545
|
+
return o.has("*") ? !0 : t.every((n) => o.has(n.toLowerCase()));
|
|
1546
|
+
};
|
|
1547
|
+
function K(e, t) {
|
|
1548
|
+
let r = e ?? "";
|
|
1549
|
+
return t != null && t && (r = r ? `(${r}) AND (${t})` : t), r || null;
|
|
1545
1550
|
}
|
|
1546
1551
|
const Ra = async (e) => {
|
|
1547
|
-
const { targetLayer:
|
|
1552
|
+
const { targetLayer: t, fieldName: r, statisticType: a, mapView: o, layersAndFieldsRegistry: n, geometryFilter: l } = e, i = o.map?.allLayers.find((v) => v.id === t.layerId);
|
|
1548
1553
|
if (!i)
|
|
1549
|
-
throw new Error(`Layer '${
|
|
1550
|
-
const c = await o.whenLayerView(i), d = n.get(
|
|
1554
|
+
throw new Error(`Layer '${t.layerId}' not found.`);
|
|
1555
|
+
const c = await o.whenLayerView(i), d = n.get(t.layerId)?.fieldRegistry.get(r), p = d?.alias;
|
|
1551
1556
|
if (!d)
|
|
1552
|
-
throw new Error(`Field '${
|
|
1553
|
-
let
|
|
1557
|
+
throw new Error(`Field '${r}' not found.`);
|
|
1558
|
+
let m, y;
|
|
1554
1559
|
if (l) {
|
|
1555
1560
|
const v = await J(l, o);
|
|
1556
1561
|
if ("error" in v)
|
|
1557
1562
|
throw new Error(v.error);
|
|
1558
1563
|
if (!v.geometry)
|
|
1559
|
-
throw
|
|
1560
|
-
if (
|
|
1564
|
+
throw j(l) ? new Error(`No features found matching: ${l.where}`) : new Error("Failed to create geometry");
|
|
1565
|
+
if (j(l)) {
|
|
1561
1566
|
const Q = o.map?.allLayers.find((A) => A.id === l.layerId);
|
|
1562
|
-
|
|
1567
|
+
m = {
|
|
1563
1568
|
geometryLayerName: Q?.title ?? Q?.id,
|
|
1564
1569
|
geometryLayerId: l.layerId,
|
|
1565
1570
|
geometryWhere: l.where,
|
|
@@ -1567,43 +1572,43 @@ const Ra = async (e) => {
|
|
|
1567
1572
|
units: l.units,
|
|
1568
1573
|
applied: !0
|
|
1569
1574
|
};
|
|
1570
|
-
} else
|
|
1575
|
+
} else U(l) && (m = {
|
|
1571
1576
|
point: l.point,
|
|
1572
1577
|
distance: l.distance,
|
|
1573
1578
|
units: l.units,
|
|
1574
1579
|
applied: !0
|
|
1575
1580
|
});
|
|
1576
|
-
|
|
1581
|
+
y = new ve({
|
|
1577
1582
|
geometry: v.geometry,
|
|
1578
1583
|
distance: l.distance,
|
|
1579
1584
|
units: l.units,
|
|
1580
1585
|
spatialRelationship: "intersects"
|
|
1581
1586
|
});
|
|
1582
1587
|
}
|
|
1583
|
-
const
|
|
1584
|
-
let
|
|
1585
|
-
const
|
|
1588
|
+
const f = le(c, [r], !1);
|
|
1589
|
+
let h = null, w = null;
|
|
1590
|
+
const b = 10;
|
|
1586
1591
|
if (d.type !== "geometry" && d.type !== "oid" && d.type !== "global-id")
|
|
1587
1592
|
try {
|
|
1588
1593
|
const v = {
|
|
1589
1594
|
layer: i,
|
|
1590
|
-
useFeaturesInView:
|
|
1591
|
-
view:
|
|
1592
|
-
field:
|
|
1593
|
-
sqlWhere: K(i.definitionExpression,
|
|
1594
|
-
...
|
|
1595
|
+
useFeaturesInView: f,
|
|
1596
|
+
view: f ? o : void 0,
|
|
1597
|
+
field: r,
|
|
1598
|
+
sqlWhere: K(i.definitionExpression, t.where),
|
|
1599
|
+
...y && { filter: y },
|
|
1595
1600
|
outStatisticTypes: { include: [a] }
|
|
1596
1601
|
};
|
|
1597
|
-
|
|
1602
|
+
h = await ut(v);
|
|
1598
1603
|
const Q = ["string", "small-integer", "integer"], A = d.domain?.type === "coded-value" ? d.domain : null;
|
|
1599
|
-
(Q.includes(d.type) || A) && (
|
|
1604
|
+
(Q.includes(d.type) || A) && (w = (await dt({
|
|
1600
1605
|
layer: i,
|
|
1601
|
-
useFeaturesInView:
|
|
1602
|
-
view:
|
|
1603
|
-
field:
|
|
1604
|
-
sqlWhere: K(i.definitionExpression,
|
|
1605
|
-
...
|
|
1606
|
-
})).uniqueValueInfos.sort((I, ze) => ze.count - I.count).slice(0,
|
|
1606
|
+
useFeaturesInView: f,
|
|
1607
|
+
view: f ? o : void 0,
|
|
1608
|
+
field: r,
|
|
1609
|
+
sqlWhere: K(i.definitionExpression, t.where),
|
|
1610
|
+
...y && { filter: y }
|
|
1611
|
+
})).uniqueValueInfos.sort((I, ze) => ze.count - I.count).slice(0, b)), w && d.domain?.type === "coded-value" && (w = w.map((I) => ({
|
|
1607
1612
|
...I,
|
|
1608
1613
|
value: A ? A.getName(I.value) ?? I.value : I.value
|
|
1609
1614
|
})));
|
|
@@ -1612,30 +1617,30 @@ const Ra = async (e) => {
|
|
|
1612
1617
|
}
|
|
1613
1618
|
return {
|
|
1614
1619
|
tool: "getStatistics",
|
|
1615
|
-
layerName: i.title ??
|
|
1616
|
-
summary: `${a} = ${typeof
|
|
1620
|
+
layerName: i.title ?? t.layerId,
|
|
1621
|
+
summary: `${a} = ${typeof h?.[a] == "number" ? h[a] : "N/A"}`,
|
|
1617
1622
|
details: {
|
|
1618
|
-
fieldName:
|
|
1623
|
+
fieldName: r,
|
|
1619
1624
|
fieldAlias: p,
|
|
1620
1625
|
statisticType: a,
|
|
1621
|
-
statistic:
|
|
1622
|
-
summaryStatistics:
|
|
1623
|
-
uniqueValues:
|
|
1624
|
-
where:
|
|
1625
|
-
spatialFilterInfo:
|
|
1626
|
+
statistic: h?.[a] ?? null,
|
|
1627
|
+
summaryStatistics: h,
|
|
1628
|
+
uniqueValues: w,
|
|
1629
|
+
where: t.where,
|
|
1630
|
+
spatialFilterInfo: m
|
|
1626
1631
|
}
|
|
1627
1632
|
};
|
|
1628
1633
|
};
|
|
1629
1634
|
async function $a({
|
|
1630
1635
|
targetLayer: e,
|
|
1631
|
-
fieldName:
|
|
1632
|
-
statisticType:
|
|
1636
|
+
fieldName: t,
|
|
1637
|
+
statisticType: r,
|
|
1633
1638
|
geometryFilter: a
|
|
1634
1639
|
}, o) {
|
|
1635
1640
|
const n = xe(o, "layersAndFieldsRegistry"), { mapView: l } = N(o), i = await Ra({
|
|
1636
1641
|
targetLayer: e,
|
|
1637
|
-
fieldName:
|
|
1638
|
-
statisticType:
|
|
1642
|
+
fieldName: t,
|
|
1643
|
+
statisticType: r,
|
|
1639
1644
|
mapView: l,
|
|
1640
1645
|
layersAndFieldsRegistry: n,
|
|
1641
1646
|
geometryFilter: a
|
|
@@ -1667,7 +1672,7 @@ const Ca = s.object({
|
|
|
1667
1672
|
),
|
|
1668
1673
|
fieldName: s.string().describe("The name of the field for which to get statistics. STRICTLY DO NOT use OBJECTID. Use any other field"),
|
|
1669
1674
|
statisticType: s.enum(["avg", "max", "median", "min", "stddev", "sum", "variance", "nullcount", "count"]).describe("The statistic type to calculate.")
|
|
1670
|
-
}), ka =
|
|
1675
|
+
}), ka = g($a, {
|
|
1671
1676
|
name: "getStatistics",
|
|
1672
1677
|
description: `Computes a single aggregate statistic (max, min, avg, sum, median, stddev, variance) for a numeric field across matching features. Also returns frequency analysis for categorical fields.
|
|
1673
1678
|
|
|
@@ -1683,19 +1688,19 @@ DO NOT USE FOR:
|
|
|
1683
1688
|
|
|
1684
1689
|
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.`,
|
|
1685
1690
|
schema: Fa
|
|
1686
|
-
}), Na = async (e,
|
|
1687
|
-
const n =
|
|
1691
|
+
}), Na = (e) => e.flatMap((t) => t.split(",")).map((t) => t.trim()).map((t) => t.split(/\s+/u)[0]?.replace(/^"|"$/gu, "")).filter((t) => !!t), qa = async (e, t, r, a, o) => {
|
|
1692
|
+
const n = r.map?.allLayers.find((m) => m.id === e.layerId), l = await r.whenLayerView(n), i = n.title ?? e.layerId;
|
|
1688
1693
|
let c;
|
|
1689
1694
|
if (a) {
|
|
1690
|
-
const
|
|
1691
|
-
if ("error" in
|
|
1695
|
+
const m = await J(a, r);
|
|
1696
|
+
if ("error" in m)
|
|
1692
1697
|
return {
|
|
1693
1698
|
tool: "getTopFeatures",
|
|
1694
1699
|
layerName: i,
|
|
1695
1700
|
summary: "Geometry lookup failed",
|
|
1696
|
-
details: { error:
|
|
1701
|
+
details: { error: m.error }
|
|
1697
1702
|
};
|
|
1698
|
-
if (!
|
|
1703
|
+
if (!m.geometry)
|
|
1699
1704
|
return {
|
|
1700
1705
|
tool: "getTopFeatures",
|
|
1701
1706
|
layerName: i,
|
|
@@ -1704,13 +1709,13 @@ Only call this tool when the answer requires computing an aggregate (avg, max, m
|
|
|
1704
1709
|
error: `No features found matching: ${"where" in a ? a.where : "unknown criteria"}`
|
|
1705
1710
|
}
|
|
1706
1711
|
};
|
|
1707
|
-
c =
|
|
1708
|
-
} else o && (c =
|
|
1709
|
-
const u =
|
|
1712
|
+
c = m.geometry;
|
|
1713
|
+
} else o && (c = r.extent.clone());
|
|
1714
|
+
const u = t.groupByFields && t.groupByFields.length > 0, d = n.objectIdField, p = e.outFields.includes("*") ? ["*"] : [.../* @__PURE__ */ new Set([...e.outFields, d])];
|
|
1710
1715
|
try {
|
|
1711
|
-
let
|
|
1716
|
+
let m;
|
|
1712
1717
|
if (u) {
|
|
1713
|
-
const
|
|
1718
|
+
const h = new pt({
|
|
1714
1719
|
where: e.where || "1=1",
|
|
1715
1720
|
outFields: p,
|
|
1716
1721
|
orderByFields: e.orderByFields,
|
|
@@ -1718,60 +1723,62 @@ Only call this tool when the answer requires computing an aggregate (avg, max, m
|
|
|
1718
1723
|
spatialRelationship: c ? "intersects" : void 0,
|
|
1719
1724
|
distance: a?.distance,
|
|
1720
1725
|
units: a?.units,
|
|
1721
|
-
topFilter: new
|
|
1722
|
-
topCount:
|
|
1723
|
-
groupByFields:
|
|
1724
|
-
orderByFields:
|
|
1726
|
+
topFilter: new mt({
|
|
1727
|
+
topCount: t.topCount,
|
|
1728
|
+
groupByFields: t.groupByFields,
|
|
1729
|
+
orderByFields: t.orderByFields
|
|
1725
1730
|
})
|
|
1726
1731
|
});
|
|
1727
|
-
|
|
1732
|
+
m = await n.queryTopFeatures(h);
|
|
1728
1733
|
} else {
|
|
1729
|
-
const
|
|
1730
|
-
|
|
1731
|
-
const
|
|
1734
|
+
const h = n.createQuery();
|
|
1735
|
+
h.where = K(n.definitionExpression, e.where || "1=1"), h.outFields = p.length ? p : ["*"], h.orderByFields = t.orderByFields, h.returnGeometry = !1, 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;
|
|
1736
|
+
const w = [
|
|
1737
|
+
.../* @__PURE__ */ new Set([...e.outFields, ...Na(t.orderByFields)])
|
|
1738
|
+
], b = le(l, w, o ?? !1);
|
|
1732
1739
|
try {
|
|
1733
|
-
|
|
1734
|
-
} catch (
|
|
1735
|
-
console.warn("Client-side query failed, falling back to server:",
|
|
1740
|
+
m = b ? await l.queryFeatures(h) : await n.queryFeatures(h);
|
|
1741
|
+
} catch (S) {
|
|
1742
|
+
console.warn("Client-side query failed, falling back to server:", S), m = await n.queryFeatures(h);
|
|
1736
1743
|
}
|
|
1737
1744
|
}
|
|
1738
|
-
const
|
|
1745
|
+
const y = m.features.map((h) => h.attributes[d]), { attributes: f } = Ee(n, m, r.timeZone);
|
|
1739
1746
|
return {
|
|
1740
1747
|
tool: "getTopFeatures",
|
|
1741
1748
|
layerName: i,
|
|
1742
|
-
summary: `Top ${
|
|
1749
|
+
summary: `Top ${t.topCount} features extracted`,
|
|
1743
1750
|
details: {
|
|
1744
|
-
topCount:
|
|
1745
|
-
attributes:
|
|
1746
|
-
objectIds:
|
|
1751
|
+
topCount: t.topCount,
|
|
1752
|
+
attributes: f,
|
|
1753
|
+
objectIds: y,
|
|
1747
1754
|
objectIdField: d,
|
|
1748
1755
|
where: e.where,
|
|
1749
|
-
orderByFields:
|
|
1750
|
-
...u && { groupByFields:
|
|
1756
|
+
orderByFields: t.orderByFields,
|
|
1757
|
+
...u && { groupByFields: t.groupByFields }
|
|
1751
1758
|
}
|
|
1752
1759
|
};
|
|
1753
|
-
} catch (
|
|
1760
|
+
} catch (m) {
|
|
1754
1761
|
return {
|
|
1755
1762
|
tool: "getTopFeatures",
|
|
1756
1763
|
layerName: i,
|
|
1757
1764
|
summary: "Query failed",
|
|
1758
|
-
details: { error:
|
|
1765
|
+
details: { error: m instanceof Error ? m.message : String(m) }
|
|
1759
1766
|
};
|
|
1760
1767
|
}
|
|
1761
|
-
},
|
|
1768
|
+
}, Ia = async ({
|
|
1762
1769
|
targetLayer: e,
|
|
1763
|
-
topFilter:
|
|
1764
|
-
geometryFilter:
|
|
1770
|
+
topFilter: t,
|
|
1771
|
+
geometryFilter: r,
|
|
1765
1772
|
useCurrentExtent: a
|
|
1766
1773
|
}, o) => {
|
|
1767
|
-
const { mapView: n } = N(o), l = await
|
|
1774
|
+
const { mapView: n } = N(o), l = await qa(e, t, n, r, a);
|
|
1768
1775
|
return JSON.stringify(l, null, 2);
|
|
1769
|
-
},
|
|
1776
|
+
}, za = s.object({
|
|
1770
1777
|
layerId: s.string().describe("The layerId of the layer containing the geometry by which to filter."),
|
|
1771
1778
|
where: s.string().describe("The SQL-92 where clause representing the features from which to filter."),
|
|
1772
1779
|
distance: s.number().optional().describe("The buffer distance around the geometry."),
|
|
1773
1780
|
units: F.optional().describe("The units for the distance buffer.")
|
|
1774
|
-
}),
|
|
1781
|
+
}), Da = s.object({
|
|
1775
1782
|
point: s.object({
|
|
1776
1783
|
x: s.number().describe("X coordinate (longitude) from navigation result"),
|
|
1777
1784
|
y: s.number().describe("Y coordinate (latitude) from navigation result"),
|
|
@@ -1781,7 +1788,7 @@ Only call this tool when the answer requires computing an aggregate (avg, max, m
|
|
|
1781
1788
|
}).describe("Point coordinates from a previous navigation/geocoding result"),
|
|
1782
1789
|
distance: s.number().optional().describe("Optional buffer distance around the point."),
|
|
1783
1790
|
units: F.optional().describe("The units for the distance buffer.")
|
|
1784
|
-
}),
|
|
1791
|
+
}), Pa = s.object({
|
|
1785
1792
|
targetLayer: s.object({
|
|
1786
1793
|
layerId: s.string().describe("The layerId of the layer containing the field from which to get a value."),
|
|
1787
1794
|
where: s.string().describe("The SQL-92 where clause representing the feature from which to get an attribute value."),
|
|
@@ -1792,7 +1799,7 @@ Only call this tool when the answer requires computing an aggregate (avg, max, m
|
|
|
1792
1799
|
).default("*")
|
|
1793
1800
|
)
|
|
1794
1801
|
}),
|
|
1795
|
-
geometryFilter: s.union([
|
|
1802
|
+
geometryFilter: s.union([za, Da]).optional().describe(
|
|
1796
1803
|
"Geometry filter for spatial queries. Use 'point' option with x/y coordinates from navigation results to find features at that location (point-in-polygon). Use 'layerId/where' option to filter by features from another layer."
|
|
1797
1804
|
),
|
|
1798
1805
|
topFilter: s.object({
|
|
@@ -1805,83 +1812,85 @@ Only call this tool when the answer requires computing an aggregate (avg, max, m
|
|
|
1805
1812
|
useCurrentExtent: s.boolean().optional().describe(
|
|
1806
1813
|
"Set to true ONLY when user explicitly asks about features 'in my view', 'on my map', 'I am looking at'. Default is false (queries entire layer)."
|
|
1807
1814
|
)
|
|
1808
|
-
}),
|
|
1815
|
+
}), Aa = g(Ia, {
|
|
1809
1816
|
name: "getTopFeatures",
|
|
1810
1817
|
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.',
|
|
1811
|
-
schema:
|
|
1812
|
-
}), ee = 25,
|
|
1813
|
-
const o =
|
|
1818
|
+
schema: Pa
|
|
1819
|
+
}), ee = 25, La = (e) => e.flatMap((t) => t.split(",")).map((t) => t.trim()).map((t) => t.split(/\s+/u)[0]?.replace(/^"|"$/gu, "")).filter((t) => !!t), ja = async (e, t, r, a) => {
|
|
1820
|
+
const o = t.map?.allLayers.find((w) => w.id === e.layerId), n = await t.whenLayerView(o), l = o.title ?? e.layerId;
|
|
1814
1821
|
let i;
|
|
1815
|
-
if (
|
|
1816
|
-
const
|
|
1817
|
-
if ("error" in
|
|
1818
|
-
const
|
|
1819
|
-
if (
|
|
1820
|
-
const
|
|
1821
|
-
|
|
1822
|
-
} else
|
|
1822
|
+
if (r) {
|
|
1823
|
+
const w = await J(r, t);
|
|
1824
|
+
if ("error" in w) {
|
|
1825
|
+
const b = { error: w.error };
|
|
1826
|
+
if (j(r)) {
|
|
1827
|
+
const S = t.map?.allLayers.find((v) => v.id === r.layerId);
|
|
1828
|
+
b.geometryLayerName = S?.title ?? S?.id, b.geometryLayerId = r.layerId, b.geometryWhere = r.where;
|
|
1829
|
+
} else U(r) && (b.point = r.point);
|
|
1823
1830
|
return {
|
|
1824
1831
|
tool: "queryFeatures",
|
|
1825
1832
|
layerName: l,
|
|
1826
1833
|
summary: "Geometry lookup failed",
|
|
1827
|
-
details:
|
|
1834
|
+
details: b
|
|
1828
1835
|
};
|
|
1829
1836
|
}
|
|
1830
|
-
if (!
|
|
1831
|
-
const
|
|
1832
|
-
if (
|
|
1833
|
-
const
|
|
1834
|
-
|
|
1835
|
-
} else
|
|
1837
|
+
if (!w.geometry) {
|
|
1838
|
+
const b = {};
|
|
1839
|
+
if (j(r)) {
|
|
1840
|
+
const S = t.map?.allLayers.find((v) => v.id === r.layerId);
|
|
1841
|
+
b.error = `No features found matching: ${r.where}`, b.geometryLayerName = S?.title ?? S?.id, b.geometryLayerId = r.layerId, b.geometryWhere = r.where;
|
|
1842
|
+
} else U(r) && (b.error = "Failed to create point geometry", b.point = r.point);
|
|
1836
1843
|
return {
|
|
1837
1844
|
tool: "queryFeatures",
|
|
1838
1845
|
layerName: l,
|
|
1839
1846
|
summary: "No features found for geometry filter",
|
|
1840
|
-
details:
|
|
1847
|
+
details: b
|
|
1841
1848
|
};
|
|
1842
1849
|
}
|
|
1843
|
-
i =
|
|
1844
|
-
} else a && (i =
|
|
1845
|
-
const c =
|
|
1846
|
-
|
|
1847
|
-
|
|
1850
|
+
i = w.geometry;
|
|
1851
|
+
} else a && (i = t.extent.clone());
|
|
1852
|
+
const c = [
|
|
1853
|
+
.../* @__PURE__ */ new Set([...e.outFields, ...La(e.orderByFields)])
|
|
1854
|
+
], u = le(n, c, a ?? !1), d = o.objectIdField, p = o.createQuery();
|
|
1855
|
+
p.where = K(o.definitionExpression, e.where || "1=1"), p.outFields = e.outFields.includes("*") ? ["*"] : [.../* @__PURE__ */ new Set([...e.outFields, d])], p.orderByFields = e.orderByFields, i && (p.geometry = i, p.spatialRelationship = "intersects"), r?.distance && (p.distance = r.distance), r?.units && (p.units = r.units), p.outSpatialReference = t.spatialReference;
|
|
1856
|
+
let m, y;
|
|
1848
1857
|
try {
|
|
1849
|
-
|
|
1850
|
-
} catch (
|
|
1851
|
-
console.warn("Client-side query failed, falling back to server:",
|
|
1858
|
+
m = u ? await n.queryFeatureCount(p) : await o.queryFeatureCount(p), m > 0 && m <= ee && (y = u ? await n.queryFeatures(p) : await o.queryFeatures(p));
|
|
1859
|
+
} catch (w) {
|
|
1860
|
+
console.warn("Client-side query failed, falling back to server:", w), m = await o.queryFeatureCount(p), m > 0 && m <= ee && (y = await o.queryFeatures(p));
|
|
1852
1861
|
}
|
|
1853
|
-
const { objectIds: f, attributes:
|
|
1862
|
+
const { objectIds: f, attributes: h } = y ? Ee(o, y, t.timeZone) : { objectIds: void 0, attributes: void 0 };
|
|
1854
1863
|
return {
|
|
1855
1864
|
tool: "queryFeatures",
|
|
1856
1865
|
layerName: l,
|
|
1857
|
-
summary: `${
|
|
1866
|
+
summary: `${m} features found`,
|
|
1858
1867
|
details: {
|
|
1859
|
-
totalCount:
|
|
1868
|
+
totalCount: m,
|
|
1860
1869
|
where: e.where,
|
|
1861
1870
|
orderByFields: e.orderByFields,
|
|
1862
1871
|
outFields: e.outFields,
|
|
1863
|
-
...f && { objectIds: f, objectIdField:
|
|
1864
|
-
...
|
|
1865
|
-
...
|
|
1866
|
-
note: `${
|
|
1872
|
+
...f && { objectIds: f, objectIdField: d },
|
|
1873
|
+
...h && { attributes: h },
|
|
1874
|
+
...m > ee && {
|
|
1875
|
+
note: `${m} features found.`
|
|
1867
1876
|
}
|
|
1868
1877
|
}
|
|
1869
1878
|
};
|
|
1870
1879
|
};
|
|
1871
|
-
async function
|
|
1880
|
+
async function Ga({
|
|
1872
1881
|
targetLayer: e,
|
|
1873
|
-
geometryFilter:
|
|
1874
|
-
useCurrentExtent:
|
|
1882
|
+
geometryFilter: t,
|
|
1883
|
+
useCurrentExtent: r
|
|
1875
1884
|
}, a) {
|
|
1876
|
-
const { mapView: o } = N(a), n = await
|
|
1885
|
+
const { mapView: o } = N(a), n = await ja(e, o, t, r);
|
|
1877
1886
|
return JSON.stringify(n, null, 2);
|
|
1878
1887
|
}
|
|
1879
|
-
const
|
|
1888
|
+
const Oa = s.object({
|
|
1880
1889
|
layerId: s.string().describe("The layerId of the layer containing the geometry by which to filter."),
|
|
1881
1890
|
where: s.string().describe("The SQL-92 where clause representing the features from which to filter."),
|
|
1882
1891
|
distance: s.number().optional().describe("The buffer distance around the geometry."),
|
|
1883
1892
|
units: F.optional().describe("The units for the distance buffer.")
|
|
1884
|
-
}),
|
|
1893
|
+
}), Ma = s.object({
|
|
1885
1894
|
point: s.object({
|
|
1886
1895
|
x: s.number().describe("X coordinate (longitude) from navigation result"),
|
|
1887
1896
|
y: s.number().describe("Y coordinate (latitude) from navigation result"),
|
|
@@ -1891,7 +1900,7 @@ const La = s.object({
|
|
|
1891
1900
|
}).describe("Point coordinates from a previous navigation/geocoding result"),
|
|
1892
1901
|
distance: s.number().optional().describe("Optional buffer distance around the point."),
|
|
1893
1902
|
units: F.optional().describe("The units for the distance buffer.")
|
|
1894
|
-
}),
|
|
1903
|
+
}), Qa = s.object({
|
|
1895
1904
|
targetLayer: s.object({
|
|
1896
1905
|
layerId: s.string().describe("The layerId of the layer containing the field from which to get a value."),
|
|
1897
1906
|
where: s.string().describe(
|
|
@@ -1904,13 +1913,13 @@ const La = s.object({
|
|
|
1904
1913
|
).default("*")
|
|
1905
1914
|
)
|
|
1906
1915
|
}),
|
|
1907
|
-
geometryFilter: s.union([
|
|
1916
|
+
geometryFilter: s.union([Oa, Ma]).optional().describe(
|
|
1908
1917
|
"Geometry filter for spatial queries. Use 'point' option with x/y coordinates from navigation results to find features at that location (point-in-polygon). Use 'layerId/where' option to filter by features from another layer."
|
|
1909
1918
|
),
|
|
1910
1919
|
useCurrentExtent: s.boolean().optional().describe(
|
|
1911
1920
|
"Set to true ONLY when user explicitly asks about features 'in my view', 'on my map', 'I am looking at', OR when the user refers back to features previously identified using the current extent (e.g. 'these', 'those', 'them', 'the same ones'). Default is false (queries entire layer)."
|
|
1912
1921
|
)
|
|
1913
|
-
}),
|
|
1922
|
+
}), _a = g(Ga, {
|
|
1914
1923
|
name: "queryFeatures",
|
|
1915
1924
|
description: `Queries features from a layer. Returns the total count of matching features, plus individual feature attributes if ≤25 features match.
|
|
1916
1925
|
|
|
@@ -1922,11 +1931,11 @@ USE THIS TOOL FOR:
|
|
|
1922
1931
|
- Any question where the user wants to SEE or COUNT matching features
|
|
1923
1932
|
|
|
1924
1933
|
This is the DEFAULT tool for most queries. When in doubt, use this tool.`,
|
|
1925
|
-
schema:
|
|
1926
|
-
}),
|
|
1927
|
-
async function
|
|
1928
|
-
const { messages:
|
|
1929
|
-
for (const n of
|
|
1934
|
+
schema: Qa
|
|
1935
|
+
}), Wa = [xa, ka, Aa, _a], Yn = [ca, ta, Yr], Va = new nt(Wa, { handleToolErrors: !1 });
|
|
1936
|
+
async function Xn(e, t) {
|
|
1937
|
+
const { messages: r } = await Va.invoke({ messages: e.dataExplorationMessages }, t), a = [], o = [];
|
|
1938
|
+
for (const n of r) {
|
|
1930
1939
|
const l = n.content;
|
|
1931
1940
|
let i;
|
|
1932
1941
|
typeof l != "string" && (i = {
|
|
@@ -1952,63 +1961,63 @@ async function Zn(e, r) {
|
|
|
1952
1961
|
}
|
|
1953
1962
|
a.push(i), i.details && typeof i.details == "object" && "error" in i.details ? o.push(`- ${i.tool}: Error - ${String(i.details.error)}`) : o.push(`- ${i.layerName}: ${i.summary}`);
|
|
1954
1963
|
}
|
|
1955
|
-
return await
|
|
1964
|
+
return await x({ text: `Finished executing layer query tool: ${o.join(", ")}` }, t), {
|
|
1956
1965
|
...e,
|
|
1957
|
-
dataExplorationMessages: [...e.dataExplorationMessages, ...
|
|
1966
|
+
dataExplorationMessages: [...e.dataExplorationMessages, ...r],
|
|
1958
1967
|
queryResponse: a,
|
|
1959
1968
|
status: "success",
|
|
1960
|
-
summary: o.length > 0 ?
|
|
1969
|
+
summary: o.length > 0 ? Bt(o.join(`
|
|
1961
1970
|
`)) : "Query executed."
|
|
1962
1971
|
};
|
|
1963
1972
|
}
|
|
1964
|
-
const
|
|
1973
|
+
const ei = T.Root({
|
|
1965
1974
|
...H(),
|
|
1966
1975
|
// internal to the help agent
|
|
1967
|
-
helpInternalState:
|
|
1968
|
-
reducer:
|
|
1976
|
+
helpInternalState: T({
|
|
1977
|
+
reducer: L,
|
|
1969
1978
|
default: () => ({
|
|
1970
1979
|
toolCallMessage: void 0
|
|
1971
1980
|
})
|
|
1972
1981
|
})
|
|
1973
|
-
}),
|
|
1974
|
-
const
|
|
1975
|
-
({ layerItem: n }) => n.title?.toLowerCase().includes(
|
|
1982
|
+
}), Ba = (e, t) => {
|
|
1983
|
+
const r = Array.from(e.values()).find(
|
|
1984
|
+
({ layerItem: n }) => n.title?.toLowerCase().includes(t.toLowerCase())
|
|
1976
1985
|
);
|
|
1977
|
-
if (!
|
|
1986
|
+
if (!r) {
|
|
1978
1987
|
const n = Array.from(e.values()).map((l) => l.layerItem.title).join(", ");
|
|
1979
|
-
return `Could not find a layer matching "${
|
|
1988
|
+
return `Could not find a layer matching "${t}". Available layers: ${n}`;
|
|
1980
1989
|
}
|
|
1981
|
-
const a = Array.from(
|
|
1990
|
+
const a = Array.from(r.fieldRegistry.values()), o = a.map((n) => `- **${n.alias || n.name}** (\`${n.name}\`, ${n.type})${n.description ? `: ${n.description}` : ""}`).join(`
|
|
1982
1991
|
`);
|
|
1983
|
-
return `**${
|
|
1992
|
+
return `**${r.layerItem.title}** has ${a.length} field(s):
|
|
1984
1993
|
|
|
1985
1994
|
${o}`;
|
|
1986
|
-
},
|
|
1987
|
-
const
|
|
1988
|
-
return
|
|
1989
|
-
},
|
|
1995
|
+
}, Ua = async ({ layerTitle: e }, t) => {
|
|
1996
|
+
const r = xe(t, "layersAndFieldsRegistry");
|
|
1997
|
+
return Ba(r, e);
|
|
1998
|
+
}, ti = g(Ua, {
|
|
1990
1999
|
name: "listLayerFields",
|
|
1991
2000
|
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.",
|
|
1992
2001
|
schema: s.object({
|
|
1993
2002
|
layerTitle: s.string().describe("The title or partial title of the layer to list fields for.")
|
|
1994
2003
|
})
|
|
1995
|
-
}),
|
|
2004
|
+
}), ri = T.Root({
|
|
1996
2005
|
...H(),
|
|
1997
|
-
intent:
|
|
1998
|
-
reducer: (e,
|
|
2006
|
+
intent: T({
|
|
2007
|
+
reducer: (e, t) => t
|
|
1999
2008
|
}),
|
|
2000
|
-
arcgisKnowledgeMessages:
|
|
2009
|
+
arcgisKnowledgeMessages: T({
|
|
2001
2010
|
reducer: be,
|
|
2002
2011
|
default: () => []
|
|
2003
2012
|
}),
|
|
2004
|
-
arcgisKnowledgeToolResult:
|
|
2005
|
-
reducer: (e,
|
|
2013
|
+
arcgisKnowledgeToolResult: T({
|
|
2014
|
+
reducer: (e, t) => t,
|
|
2006
2015
|
default: () => null
|
|
2007
2016
|
})
|
|
2008
2017
|
});
|
|
2009
2018
|
function ce(e) {
|
|
2010
|
-
const
|
|
2011
|
-
if (!
|
|
2019
|
+
const t = e.map?.allLayers.filter((r) => r.type === "knowledge-graph");
|
|
2020
|
+
if (!t || t?.length !== 1)
|
|
2012
2021
|
throw new Error("The Knowledge Agent currently only supports maps with exactly one Knowledge Graph Layer.");
|
|
2013
2022
|
}
|
|
2014
2023
|
function q(e) {
|
|
@@ -2018,29 +2027,29 @@ async function Z(e) {
|
|
|
2018
2027
|
!e || q(e) || !e.map?.diagramNodesExtent || await e.goTo(e.map.diagramNodesExtent);
|
|
2019
2028
|
}
|
|
2020
2029
|
function O(e) {
|
|
2021
|
-
const
|
|
2022
|
-
if (!
|
|
2030
|
+
const r = e?.configurable?.context;
|
|
2031
|
+
if (!r || typeof r != "object")
|
|
2023
2032
|
throw new Error("ArcgisKnowledgeAgent context missing");
|
|
2024
|
-
if (!("view" in
|
|
2033
|
+
if (!("view" in r))
|
|
2025
2034
|
throw new Error("View context missing");
|
|
2026
|
-
const a =
|
|
2035
|
+
const a = r.view;
|
|
2027
2036
|
return a.map && !("activeLinkChartLayer" in a.map) && ce(a), {
|
|
2028
2037
|
view: a
|
|
2029
2038
|
};
|
|
2030
2039
|
}
|
|
2031
|
-
function
|
|
2032
|
-
const
|
|
2040
|
+
function ai(e) {
|
|
2041
|
+
const r = e?.configurable?.context;
|
|
2033
2042
|
if (Fe(e) === "knowledgeGraph")
|
|
2034
2043
|
return "knowledgeGraph";
|
|
2035
|
-
const o =
|
|
2044
|
+
const o = r.view;
|
|
2036
2045
|
return q(o) ? (ce(o), "map") : "linkChart";
|
|
2037
2046
|
}
|
|
2038
2047
|
async function M(e) {
|
|
2039
|
-
const
|
|
2048
|
+
const r = e?.configurable?.context;
|
|
2040
2049
|
if (Fe(e) === "knowledgeGraph")
|
|
2041
|
-
return
|
|
2050
|
+
return r;
|
|
2042
2051
|
{
|
|
2043
|
-
const o =
|
|
2052
|
+
const o = r.view.map;
|
|
2044
2053
|
if (o && "activeLinkChartLayer" in o) {
|
|
2045
2054
|
const n = o.knowledgeGraph?.url;
|
|
2046
2055
|
if (!n)
|
|
@@ -2049,8 +2058,8 @@ async function M(e) {
|
|
|
2049
2058
|
knowledgeGraph: await fe(n)
|
|
2050
2059
|
};
|
|
2051
2060
|
} else {
|
|
2052
|
-
ce(
|
|
2053
|
-
const l = (
|
|
2061
|
+
ce(r.view);
|
|
2062
|
+
const l = (r.view.map?.allLayers.find(
|
|
2054
2063
|
(c) => c.type === "knowledge-graph"
|
|
2055
2064
|
)).url;
|
|
2056
2065
|
if (!l)
|
|
@@ -2062,20 +2071,20 @@ async function M(e) {
|
|
|
2062
2071
|
}
|
|
2063
2072
|
}
|
|
2064
2073
|
function Fe(e) {
|
|
2065
|
-
const
|
|
2066
|
-
if (!
|
|
2074
|
+
const r = e?.configurable?.context;
|
|
2075
|
+
if (!r || typeof r != "object")
|
|
2067
2076
|
throw new Error("ArcgisKnowledgeAgent context missing");
|
|
2068
|
-
if ("knowledgeGraph" in
|
|
2077
|
+
if ("knowledgeGraph" in r && "view" in r)
|
|
2069
2078
|
throw new Error("Knowledge Graph context should only have a view or knowledgeGraph, but never both.");
|
|
2070
|
-
if ("knowledgeGraph" in
|
|
2079
|
+
if ("knowledgeGraph" in r)
|
|
2071
2080
|
return "knowledgeGraph";
|
|
2072
|
-
if ("view" in
|
|
2081
|
+
if ("view" in r)
|
|
2073
2082
|
return "view";
|
|
2074
2083
|
throw new Error("ArcgisKnowledgeAgent context must have either a view or knowledgeGraph property.");
|
|
2075
2084
|
}
|
|
2076
|
-
class
|
|
2077
|
-
constructor(
|
|
2078
|
-
this.dataModel =
|
|
2085
|
+
class Ka {
|
|
2086
|
+
constructor(t) {
|
|
2087
|
+
this.dataModel = t, this.kind = "GraphQueryGenerationRequest", this.explainQuery = !0, this.schemaInformation = ue.fromDataModel(t);
|
|
2079
2088
|
}
|
|
2080
2089
|
}
|
|
2081
2090
|
class ue {
|
|
@@ -2087,25 +2096,25 @@ class ue {
|
|
|
2087
2096
|
}
|
|
2088
2097
|
};
|
|
2089
2098
|
}
|
|
2090
|
-
static fromDataModel(
|
|
2091
|
-
const
|
|
2092
|
-
for (const a of
|
|
2093
|
-
|
|
2094
|
-
for (const a of
|
|
2095
|
-
|
|
2096
|
-
return
|
|
2099
|
+
static fromDataModel(t) {
|
|
2100
|
+
const r = new ue();
|
|
2101
|
+
for (const a of t.entityTypes)
|
|
2102
|
+
r.entityTypes.push(G.fromEntityType(a));
|
|
2103
|
+
for (const a of t.relationshipTypes)
|
|
2104
|
+
r.relationshipTypes.push(Ha.fromRelationshipType(a));
|
|
2105
|
+
return r.identifierInfo = {
|
|
2097
2106
|
mappingInfo: {
|
|
2098
|
-
identifierMapsTo:
|
|
2099
|
-
|
|
2107
|
+
identifierMapsTo: Ja(
|
|
2108
|
+
t.identifierInfo.identifierMappingInfo.identifierInfoType
|
|
2100
2109
|
),
|
|
2101
|
-
identifierPropertyName:
|
|
2110
|
+
identifierPropertyName: t.identifierInfo.identifierMappingInfo.uniformPropertyIdentifier.identifierPropertyName
|
|
2102
2111
|
}
|
|
2103
|
-
},
|
|
2112
|
+
}, r.spatialReference = JSON.parse(JSON.stringify(t.spatialReference)), r;
|
|
2104
2113
|
}
|
|
2105
2114
|
// Generates a short summary of the types in the data model for LLM consumption.
|
|
2106
|
-
static getDataModelTypesSummary(
|
|
2107
|
-
const
|
|
2108
|
-
return `Entity Types: ${
|
|
2115
|
+
static getDataModelTypesSummary(t) {
|
|
2116
|
+
const r = t.entityTypes.map((o) => o.name).join(", "), a = t.relationshipTypes.map((o) => o.name).join(", ");
|
|
2117
|
+
return `Entity Types: ${r}.
|
|
2109
2118
|
Relationship Types: ${a}.`;
|
|
2110
2119
|
}
|
|
2111
2120
|
}
|
|
@@ -2113,42 +2122,42 @@ class G {
|
|
|
2113
2122
|
constructor() {
|
|
2114
2123
|
this.name = "", this.properties = [];
|
|
2115
2124
|
}
|
|
2116
|
-
static fromEntityType(
|
|
2117
|
-
const
|
|
2118
|
-
|
|
2119
|
-
for (const a of
|
|
2125
|
+
static fromEntityType(t) {
|
|
2126
|
+
const r = new G();
|
|
2127
|
+
r.name = t.name, r.alias = t.alias ? t.alias : void 0, r.role = Za(t.role);
|
|
2128
|
+
for (const a of t.properties) {
|
|
2120
2129
|
const o = {
|
|
2121
2130
|
name: a.name,
|
|
2122
2131
|
alias: a.alias ? a.alias : void 0,
|
|
2123
2132
|
fieldType: a.fieldType,
|
|
2124
|
-
role:
|
|
2133
|
+
role: Ya(a.role),
|
|
2125
2134
|
geometryDef: a.fieldType === "esriFieldTypeGeometry" ? {
|
|
2126
2135
|
geometryType: a.geometryType ?? "esriGeometryAny",
|
|
2127
2136
|
hasM: a.hasM ? a.hasM : void 0,
|
|
2128
2137
|
hasZ: a.hasZ ? a.hasZ : void 0
|
|
2129
2138
|
} : void 0
|
|
2130
2139
|
};
|
|
2131
|
-
|
|
2140
|
+
r.properties.push(o);
|
|
2132
2141
|
}
|
|
2133
|
-
return
|
|
2142
|
+
return r;
|
|
2134
2143
|
}
|
|
2135
2144
|
}
|
|
2136
|
-
class
|
|
2145
|
+
class Ha extends G {
|
|
2137
2146
|
constructor() {
|
|
2138
2147
|
super(...arguments), this.observedEndPoints = [];
|
|
2139
2148
|
}
|
|
2140
|
-
static fromRelationshipType(
|
|
2141
|
-
const
|
|
2142
|
-
|
|
2143
|
-
for (const a of
|
|
2144
|
-
|
|
2149
|
+
static fromRelationshipType(t) {
|
|
2150
|
+
const r = G.fromEntityType(t);
|
|
2151
|
+
r.observedEndPoints = [];
|
|
2152
|
+
for (const a of t.endPoints)
|
|
2153
|
+
r.observedEndPoints.push({
|
|
2145
2154
|
originEntityType: a.originEntityType,
|
|
2146
2155
|
destinationEntityType: a.destinationEntityType
|
|
2147
2156
|
});
|
|
2148
|
-
return
|
|
2157
|
+
return r;
|
|
2149
2158
|
}
|
|
2150
2159
|
}
|
|
2151
|
-
const
|
|
2160
|
+
const Ja = (e) => {
|
|
2152
2161
|
switch (e) {
|
|
2153
2162
|
case "esriIdentifierInfoTypeUNSPECIFIED":
|
|
2154
2163
|
return "UNSPECIFIED";
|
|
@@ -2159,7 +2168,7 @@ const Ka = (e) => {
|
|
|
2159
2168
|
default:
|
|
2160
2169
|
return e;
|
|
2161
2170
|
}
|
|
2162
|
-
},
|
|
2171
|
+
}, Za = (e) => {
|
|
2163
2172
|
switch (e) {
|
|
2164
2173
|
case "Regular":
|
|
2165
2174
|
return "esriGraphNamedObjectRegular";
|
|
@@ -2171,7 +2180,7 @@ const Ka = (e) => {
|
|
|
2171
2180
|
return e;
|
|
2172
2181
|
}
|
|
2173
2182
|
};
|
|
2174
|
-
function
|
|
2183
|
+
function Ya(e) {
|
|
2175
2184
|
switch (e) {
|
|
2176
2185
|
case "esriGraphPropertyRegular":
|
|
2177
2186
|
return "Regular";
|
|
@@ -2212,28 +2221,28 @@ function Ja(e) {
|
|
|
2212
2221
|
function Y(e) {
|
|
2213
2222
|
return e?.signal;
|
|
2214
2223
|
}
|
|
2215
|
-
async function
|
|
2216
|
-
const
|
|
2217
|
-
return
|
|
2224
|
+
async function Xa(e, t) {
|
|
2225
|
+
const r = await B("arcgis_knowledge_cypher_query_prompt");
|
|
2226
|
+
return t ? `${e} ${r}
|
|
2218
2227
|
|
|
2219
2228
|
Your previous attempt to generate a cypher query failed. See the details below and generate a new cypher query that avoids this error.
|
|
2220
2229
|
|
|
2221
|
-
Attempt Number: ${
|
|
2222
|
-
Execution Error: ${
|
|
2230
|
+
Attempt Number: ${t.attemptCount}
|
|
2231
|
+
Execution Error: ${t.executionError}
|
|
2223
2232
|
Failed Query:
|
|
2224
|
-
${
|
|
2233
|
+
${t.failedGraphQuery}` : `${e} ${r}`;
|
|
2225
2234
|
}
|
|
2226
|
-
async function
|
|
2227
|
-
const { graphQuery: o, explanation: n } = await de(e,
|
|
2235
|
+
async function eo(e, t, r, a) {
|
|
2236
|
+
const { graphQuery: o, explanation: n } = await de(e, t, r, a);
|
|
2228
2237
|
return { graphQuery: o, explanation: n };
|
|
2229
2238
|
}
|
|
2230
|
-
async function de(e,
|
|
2239
|
+
async function de(e, t, r, a, o) {
|
|
2231
2240
|
const n = {
|
|
2232
|
-
message: await
|
|
2233
|
-
context: new
|
|
2241
|
+
message: await Xa(e, o),
|
|
2242
|
+
context: new Ka(t)
|
|
2234
2243
|
}, l = Y(a);
|
|
2235
|
-
await
|
|
2236
|
-
const i = await
|
|
2244
|
+
await x({ text: "Attempting to generate a cypher query from your prompt..." }, a);
|
|
2245
|
+
const i = await me(`${r}/chat`, {
|
|
2237
2246
|
method: "post",
|
|
2238
2247
|
body: JSON.stringify(n),
|
|
2239
2248
|
headers: {
|
|
@@ -2248,13 +2257,13 @@ async function de(e, r, t, a, o) {
|
|
|
2248
2257
|
});
|
|
2249
2258
|
let c = !1;
|
|
2250
2259
|
const u = Date.now();
|
|
2251
|
-
let d = i.data.sequenceNumber, p = "",
|
|
2260
|
+
let d = i.data.sequenceNumber, p = "", m = "", y = 1;
|
|
2252
2261
|
for (; !c; ) {
|
|
2253
|
-
await new Promise((
|
|
2254
|
-
{ text: `Periodically requesting status of job from ArcGIS AI Services${"...".substring(0,
|
|
2262
|
+
await new Promise((h) => setTimeout(h, 1e3)), await x(
|
|
2263
|
+
{ text: `Periodically requesting status of job from ArcGIS AI Services${"...".substring(0, y)}` },
|
|
2255
2264
|
a
|
|
2256
|
-
),
|
|
2257
|
-
const
|
|
2265
|
+
), y = y % 3 + 1;
|
|
2266
|
+
const f = await me(`${r}/chat`, {
|
|
2258
2267
|
method: "post",
|
|
2259
2268
|
body: JSON.stringify({
|
|
2260
2269
|
conversationId: i.data.conversationId,
|
|
@@ -2267,75 +2276,75 @@ async function de(e, r, t, a, o) {
|
|
|
2267
2276
|
},
|
|
2268
2277
|
signal: l
|
|
2269
2278
|
});
|
|
2270
|
-
if (
|
|
2271
|
-
throw new Error(`Graph query service polling returned an error: ${
|
|
2272
|
-
cause:
|
|
2279
|
+
if (f.httpStatus !== 200)
|
|
2280
|
+
throw new Error(`Graph query service polling returned an error: ${f.httpStatus}`, {
|
|
2281
|
+
cause: f.data
|
|
2273
2282
|
});
|
|
2274
|
-
if (
|
|
2275
|
-
if (
|
|
2276
|
-
throw new Error(`Unexpected response from graph query service polling. Message: ${
|
|
2277
|
-
cause:
|
|
2283
|
+
if (f.data.context?.kind) {
|
|
2284
|
+
if (f.data.context.kind !== "GraphQueryGenerationResponse")
|
|
2285
|
+
throw new Error(`Unexpected response from graph query service polling. Message: ${f.data.message}`, {
|
|
2286
|
+
cause: f.data
|
|
2278
2287
|
});
|
|
2279
|
-
p =
|
|
2280
|
-
} else if (!
|
|
2288
|
+
p = f.data.context.graphQuery, m = f.data.message || "", c = !0;
|
|
2289
|
+
} else if (!f.data.hasMore)
|
|
2281
2290
|
c = !0;
|
|
2282
2291
|
else if (Date.now() - u > 6e4)
|
|
2283
2292
|
throw new Error("Graph query service polling timed out after 1 minute.");
|
|
2284
|
-
d =
|
|
2293
|
+
d = f.data.sequenceNumber;
|
|
2285
2294
|
}
|
|
2286
|
-
return { graphQuery: p, explanation:
|
|
2295
|
+
return { graphQuery: p, explanation: m };
|
|
2287
2296
|
}
|
|
2288
|
-
function
|
|
2289
|
-
z(e, (
|
|
2290
|
-
|
|
2291
|
-
id:
|
|
2292
|
-
typeName:
|
|
2297
|
+
function to(e, t) {
|
|
2298
|
+
z(e, (r) => {
|
|
2299
|
+
t.set(`${r.typeName}__${r.id}`, {
|
|
2300
|
+
id: r.id,
|
|
2301
|
+
typeName: r.typeName
|
|
2293
2302
|
});
|
|
2294
2303
|
});
|
|
2295
2304
|
}
|
|
2296
|
-
function z(e,
|
|
2305
|
+
function z(e, t) {
|
|
2297
2306
|
if (!(!e || typeof e != "object")) {
|
|
2298
|
-
if (
|
|
2299
|
-
for (const
|
|
2300
|
-
z(
|
|
2301
|
-
else if (eo(e))
|
|
2302
|
-
r(e);
|
|
2303
|
-
else if (Array.isArray(e))
|
|
2304
|
-
for (const t of e)
|
|
2305
|
-
z(t, r);
|
|
2307
|
+
if (ao(e))
|
|
2308
|
+
for (const r of e.path)
|
|
2309
|
+
z(r, t);
|
|
2306
2310
|
else if (ro(e))
|
|
2307
|
-
|
|
2308
|
-
|
|
2311
|
+
t(e);
|
|
2312
|
+
else if (Array.isArray(e))
|
|
2313
|
+
for (const r of e)
|
|
2314
|
+
z(r, t);
|
|
2315
|
+
else if (oo(e))
|
|
2316
|
+
for (const r of Object.values(e.properties ?? {}))
|
|
2317
|
+
z(r, t);
|
|
2309
2318
|
}
|
|
2310
2319
|
}
|
|
2311
|
-
function
|
|
2320
|
+
function ro(e) {
|
|
2312
2321
|
return !e || typeof e != "object" || Array.isArray(e) ? !1 : "id" in e && "typeName" in e;
|
|
2313
2322
|
}
|
|
2314
|
-
function
|
|
2323
|
+
function ao(e) {
|
|
2315
2324
|
return !e || typeof e != "object" || Array.isArray(e) ? !1 : e && "path" in e && Array.isArray(e.path);
|
|
2316
2325
|
}
|
|
2317
|
-
function
|
|
2326
|
+
function oo(e) {
|
|
2318
2327
|
return !e || typeof e != "object" || Array.isArray(e) || "id" in e ? !1 : "properties" in e && typeof e.properties == "object";
|
|
2319
2328
|
}
|
|
2320
|
-
function
|
|
2321
|
-
const
|
|
2322
|
-
[
|
|
2323
|
-
[
|
|
2329
|
+
function no(e, t) {
|
|
2330
|
+
const r = [], a = [], o = [
|
|
2331
|
+
[t.dataModel.entityTypes, r],
|
|
2332
|
+
[t.dataModel.relationshipTypes, a]
|
|
2324
2333
|
];
|
|
2325
2334
|
for (const [n, l] of o)
|
|
2326
2335
|
for (const i of n) {
|
|
2327
2336
|
const c = e.getMemberIdsByType(i.name);
|
|
2328
2337
|
l.push(...c);
|
|
2329
2338
|
}
|
|
2330
|
-
return { entityIds:
|
|
2339
|
+
return { entityIds: r, relationshipIds: a };
|
|
2331
2340
|
}
|
|
2332
|
-
function
|
|
2333
|
-
const
|
|
2341
|
+
function io(e, t) {
|
|
2342
|
+
const r = { entityIds: new Array(), relationshipIds: new Array() }, a = [], n = e?.allLayers.find((c) => c.type === "knowledge-graph")?.inclusionModeDefinition;
|
|
2334
2343
|
if (!n)
|
|
2335
|
-
return { allNamedTypesFullyDynamic: !0, bindParameters:
|
|
2344
|
+
return { allNamedTypesFullyDynamic: !0, bindParameters: r, nonDynamicTypes: a };
|
|
2336
2345
|
const l = [
|
|
2337
|
-
[
|
|
2338
|
-
[
|
|
2346
|
+
[t.dataModel.entityTypes, r.entityIds],
|
|
2347
|
+
[t.dataModel.relationshipTypes, r.relationshipIds]
|
|
2339
2348
|
];
|
|
2340
2349
|
let i = !0;
|
|
2341
2350
|
for (const [c, u] of l)
|
|
@@ -2347,58 +2356,58 @@ function oo(e, r) {
|
|
|
2347
2356
|
}
|
|
2348
2357
|
if (!p.useAllData) {
|
|
2349
2358
|
i = !1, a.push(d.name);
|
|
2350
|
-
for (const [
|
|
2351
|
-
u.push(
|
|
2359
|
+
for (const [m] of p.members || [])
|
|
2360
|
+
u.push(m);
|
|
2352
2361
|
}
|
|
2353
2362
|
}
|
|
2354
|
-
return { allNamedTypesFullyDynamic: i, bindParameters:
|
|
2363
|
+
return { allNamedTypesFullyDynamic: i, bindParameters: r, nonDynamicTypes: a };
|
|
2355
2364
|
}
|
|
2356
2365
|
const D = 3;
|
|
2357
|
-
function ke(e,
|
|
2358
|
-
const
|
|
2366
|
+
function ke(e, t = 100) {
|
|
2367
|
+
const r = {};
|
|
2359
2368
|
for (const a of Object.entries(e.properties ?? {})) {
|
|
2360
2369
|
const [o, n] = a;
|
|
2361
|
-
typeof n == "string" && n.length >
|
|
2370
|
+
typeof n == "string" && n.length > t ? r[o] = `${n.slice(0, t)}... (truncated, original length: ${n.length})` : r[o] = n;
|
|
2362
2371
|
}
|
|
2363
|
-
return e.properties =
|
|
2372
|
+
return e.properties = r, e;
|
|
2364
2373
|
}
|
|
2365
2374
|
function P(e) {
|
|
2366
2375
|
return typeof e != "object" || e === null ? String(e) : "details" in e && typeof e.details == "object" && e.details !== null && "errorMessage" in e.details && typeof e.details.errorMessage == "string" ? e.details.errorMessage : "message" in e && typeof e.message == "string" ? e.message : String(e);
|
|
2367
2376
|
}
|
|
2368
|
-
const
|
|
2377
|
+
const so = async ({
|
|
2369
2378
|
kg: e,
|
|
2370
|
-
queryParams:
|
|
2371
|
-
targetStructure:
|
|
2379
|
+
queryParams: t,
|
|
2380
|
+
targetStructure: r,
|
|
2372
2381
|
targetStructureReducer: a,
|
|
2373
2382
|
requestOptions: o,
|
|
2374
2383
|
queryRowLimit: n,
|
|
2375
2384
|
queryTimeoutMs: l
|
|
2376
2385
|
}) => {
|
|
2377
|
-
let i = null, c =
|
|
2386
|
+
let i = null, c = r;
|
|
2378
2387
|
const u = new AbortController(), d = o?.signal, p = () => {
|
|
2379
2388
|
u.abort(d?.reason);
|
|
2380
2389
|
};
|
|
2381
2390
|
d && (d.aborted ? u.abort(d.reason) : d.addEventListener("abort", p, { once: !0 }));
|
|
2382
2391
|
try {
|
|
2383
|
-
const
|
|
2384
|
-
i =
|
|
2385
|
-
const
|
|
2386
|
-
let
|
|
2387
|
-
const
|
|
2392
|
+
const m = await yt(e, t, o);
|
|
2393
|
+
i = m.resultHeader;
|
|
2394
|
+
const y = m.resultRowsStream.getReader();
|
|
2395
|
+
let f = 0;
|
|
2396
|
+
const h = Date.now(), w = !1;
|
|
2388
2397
|
for (; ; ) {
|
|
2389
|
-
const { done:
|
|
2390
|
-
if (
|
|
2398
|
+
const { done: b, value: S } = await y.read();
|
|
2399
|
+
if (b)
|
|
2391
2400
|
break;
|
|
2392
|
-
if (!
|
|
2401
|
+
if (!w && l && Date.now() - h > l)
|
|
2393
2402
|
return u.abort(), { type: "timeout" };
|
|
2394
|
-
for (const v of
|
|
2395
|
-
if (
|
|
2403
|
+
for (const v of S) {
|
|
2404
|
+
if (f++, n && f > n)
|
|
2396
2405
|
return u.abort(), { type: "success", rowLimitReached: !0, resultHeader: i, processedResult: c };
|
|
2397
2406
|
c = a(c, v);
|
|
2398
2407
|
}
|
|
2399
2408
|
}
|
|
2400
|
-
} catch (
|
|
2401
|
-
return u.signal.aborted ? { type: "aborted" } : { type: "error", errorMessage: P(
|
|
2409
|
+
} catch (m) {
|
|
2410
|
+
return u.signal.aborted ? { type: "aborted" } : { type: "error", errorMessage: P(m), error: m };
|
|
2402
2411
|
} finally {
|
|
2403
2412
|
d?.removeEventListener("abort", p);
|
|
2404
2413
|
}
|
|
@@ -2406,8 +2415,8 @@ const no = async ({
|
|
|
2406
2415
|
};
|
|
2407
2416
|
async function Ne({
|
|
2408
2417
|
prompt: e,
|
|
2409
|
-
bindParameters:
|
|
2410
|
-
kg:
|
|
2418
|
+
bindParameters: t,
|
|
2419
|
+
kg: r,
|
|
2411
2420
|
graphQueryServiceUrl: a,
|
|
2412
2421
|
targetStructure: o,
|
|
2413
2422
|
targetStructureReducer: n,
|
|
@@ -2418,69 +2427,69 @@ async function Ne({
|
|
|
2418
2427
|
}) {
|
|
2419
2428
|
let d;
|
|
2420
2429
|
for (let p = 1; p <= D; p++) {
|
|
2421
|
-
let
|
|
2430
|
+
let m;
|
|
2422
2431
|
try {
|
|
2423
|
-
|
|
2424
|
-
} catch (
|
|
2432
|
+
m = await de(e, r.dataModel, a, u, d);
|
|
2433
|
+
} catch (h) {
|
|
2425
2434
|
return {
|
|
2426
2435
|
type: "generation-error",
|
|
2427
|
-
errorMessage: P(
|
|
2428
|
-
error:
|
|
2436
|
+
errorMessage: P(h),
|
|
2437
|
+
error: h
|
|
2429
2438
|
};
|
|
2430
2439
|
}
|
|
2431
|
-
await
|
|
2440
|
+
await x(
|
|
2432
2441
|
{
|
|
2433
|
-
text: `Attempting to execute query: ${
|
|
2442
|
+
text: `Attempting to execute query: ${m.graphQuery.substring(0, 500)}${m.graphQuery.length > 500 ? "..." : ""}`
|
|
2434
2443
|
},
|
|
2435
2444
|
u
|
|
2436
2445
|
);
|
|
2437
|
-
const
|
|
2438
|
-
kg:
|
|
2446
|
+
const y = await so({
|
|
2447
|
+
kg: r,
|
|
2439
2448
|
queryParams: new Se({
|
|
2440
|
-
openCypherQuery:
|
|
2441
|
-
bindParameters:
|
|
2449
|
+
openCypherQuery: m.graphQuery,
|
|
2450
|
+
bindParameters: t
|
|
2442
2451
|
}),
|
|
2443
2452
|
targetStructure: o,
|
|
2444
2453
|
targetStructureReducer: n,
|
|
2445
2454
|
requestOptions: l,
|
|
2446
2455
|
queryRowLimit: i,
|
|
2447
2456
|
queryTimeoutMs: c
|
|
2448
|
-
}),
|
|
2449
|
-
if (
|
|
2457
|
+
}), f = y.type === "aborted" ? "Query execution was aborted." : y.type === "timeout" ? "Query execution timed out." : y.type === "error" ? `Query failed with error: ${y.errorMessage}` : "";
|
|
2458
|
+
if (y.type === "success")
|
|
2450
2459
|
return {
|
|
2451
2460
|
type: "success",
|
|
2452
|
-
graphQuery:
|
|
2453
|
-
explanation:
|
|
2454
|
-
rowLimitReached:
|
|
2455
|
-
resultHeader:
|
|
2456
|
-
processedResult:
|
|
2461
|
+
graphQuery: m.graphQuery,
|
|
2462
|
+
explanation: m.explanation,
|
|
2463
|
+
rowLimitReached: y.rowLimitReached,
|
|
2464
|
+
resultHeader: y.resultHeader,
|
|
2465
|
+
processedResult: y.processedResult
|
|
2457
2466
|
};
|
|
2458
|
-
if (
|
|
2467
|
+
if (y.type === "aborted")
|
|
2459
2468
|
return {
|
|
2460
2469
|
type: "aborted",
|
|
2461
|
-
errorMessage:
|
|
2462
|
-
graphQuery:
|
|
2463
|
-
explanation:
|
|
2470
|
+
errorMessage: f,
|
|
2471
|
+
graphQuery: m.graphQuery,
|
|
2472
|
+
explanation: m.explanation
|
|
2464
2473
|
};
|
|
2465
2474
|
if (p >= D)
|
|
2466
|
-
return
|
|
2475
|
+
return y.type === "timeout" ? {
|
|
2467
2476
|
type: "timeout",
|
|
2468
|
-
errorMessage:
|
|
2469
|
-
graphQuery:
|
|
2470
|
-
explanation:
|
|
2477
|
+
errorMessage: f,
|
|
2478
|
+
graphQuery: m.graphQuery,
|
|
2479
|
+
explanation: m.explanation
|
|
2471
2480
|
} : {
|
|
2472
2481
|
type: "execution-error",
|
|
2473
|
-
errorMessage:
|
|
2474
|
-
error:
|
|
2475
|
-
graphQuery:
|
|
2476
|
-
explanation:
|
|
2482
|
+
errorMessage: f,
|
|
2483
|
+
error: y.error,
|
|
2484
|
+
graphQuery: m.graphQuery,
|
|
2485
|
+
explanation: m.explanation
|
|
2477
2486
|
};
|
|
2478
2487
|
d = {
|
|
2479
|
-
failedGraphQuery:
|
|
2480
|
-
executionError:
|
|
2488
|
+
failedGraphQuery: m.graphQuery,
|
|
2489
|
+
executionError: f,
|
|
2481
2490
|
attemptCount: p
|
|
2482
|
-
}, await
|
|
2483
|
-
{ text: `Attempt ${p} failed with error: ${
|
|
2491
|
+
}, await x(
|
|
2492
|
+
{ text: `Attempt ${p} failed with error: ${f}. Retrying...` },
|
|
2484
2493
|
u
|
|
2485
2494
|
);
|
|
2486
2495
|
}
|
|
@@ -2488,43 +2497,43 @@ async function Ne({
|
|
|
2488
2497
|
`Failed to execute generated cypher due to an unexpected error after ${D} attempts.`
|
|
2489
2498
|
);
|
|
2490
2499
|
}
|
|
2491
|
-
const
|
|
2500
|
+
const lo = async ({
|
|
2492
2501
|
kg: e,
|
|
2493
|
-
searchQuery:
|
|
2494
|
-
typeCategoryFilter:
|
|
2502
|
+
searchQuery: t,
|
|
2503
|
+
typeCategoryFilter: r,
|
|
2495
2504
|
namedTypesFilter: a,
|
|
2496
2505
|
searchResultLimit: o,
|
|
2497
2506
|
requestOptions: n
|
|
2498
2507
|
}) => {
|
|
2499
2508
|
const l = [];
|
|
2500
|
-
let i = [
|
|
2501
|
-
|
|
2509
|
+
let i = [r];
|
|
2510
|
+
r === "both" && !e.serviceDefinition.serviceCapabilities.searchCapabilities.searchTypeFilterCapabilities.includes("esriTypeBoth") && (i = ["entity", "relationship"]);
|
|
2502
2511
|
const c = o ?? 1 / 0;
|
|
2503
2512
|
try {
|
|
2504
2513
|
for (const u of i) {
|
|
2505
2514
|
const d = c - l.length;
|
|
2506
2515
|
if (d <= 0)
|
|
2507
2516
|
break;
|
|
2508
|
-
const
|
|
2517
|
+
const y = (await ft(
|
|
2509
2518
|
e,
|
|
2510
2519
|
new gt({
|
|
2511
|
-
searchQuery:
|
|
2520
|
+
searchQuery: t,
|
|
2512
2521
|
typeCategoryFilter: u,
|
|
2513
2522
|
namedTypesFilter: a ?? void 0,
|
|
2514
2523
|
num: d
|
|
2515
2524
|
}),
|
|
2516
2525
|
n
|
|
2517
2526
|
)).resultRowsStream.getReader();
|
|
2518
|
-
let
|
|
2519
|
-
for (; !
|
|
2520
|
-
const { done:
|
|
2521
|
-
if (
|
|
2522
|
-
|
|
2527
|
+
let f = !1;
|
|
2528
|
+
for (; !f; ) {
|
|
2529
|
+
const { done: h, value: w } = await y.read();
|
|
2530
|
+
if (h) {
|
|
2531
|
+
f = !0;
|
|
2523
2532
|
break;
|
|
2524
2533
|
}
|
|
2525
|
-
for (const
|
|
2526
|
-
for (const
|
|
2527
|
-
l.push(
|
|
2534
|
+
for (const b of w)
|
|
2535
|
+
for (const S of b)
|
|
2536
|
+
l.push(S);
|
|
2528
2537
|
}
|
|
2529
2538
|
}
|
|
2530
2539
|
} catch (u) {
|
|
@@ -2542,13 +2551,13 @@ const io = async ({
|
|
|
2542
2551
|
}, qe = "IMPORTANT: The generated cypher query must return entire entities and relationships ONLY.";
|
|
2543
2552
|
async function Ie({
|
|
2544
2553
|
prompt: e,
|
|
2545
|
-
view:
|
|
2546
|
-
knowledgeGraph:
|
|
2554
|
+
view: t,
|
|
2555
|
+
knowledgeGraph: r,
|
|
2547
2556
|
includeReturnEntityAndRelationshipContext: a = !1
|
|
2548
2557
|
}) {
|
|
2549
2558
|
const o = [e];
|
|
2550
|
-
if (a && o.push(qe), !q(
|
|
2551
|
-
const d = await
|
|
2559
|
+
if (a && o.push(qe), !q(t)) {
|
|
2560
|
+
const d = await B("arcgis_knowledge_current_lc_context"), p = no(t.map, r);
|
|
2552
2561
|
return o.push(d), {
|
|
2553
2562
|
enhancedPrompt: o.join(`
|
|
2554
2563
|
|
|
@@ -2557,9 +2566,9 @@ async function Ie({
|
|
|
2557
2566
|
allNamedTypesFullyDynamic: !1
|
|
2558
2567
|
};
|
|
2559
2568
|
}
|
|
2560
|
-
const n =
|
|
2569
|
+
const n = t.map, { allNamedTypesFullyDynamic: l, bindParameters: i, nonDynamicTypes: c } = io(
|
|
2561
2570
|
n,
|
|
2562
|
-
|
|
2571
|
+
r
|
|
2563
2572
|
);
|
|
2564
2573
|
if (l)
|
|
2565
2574
|
return {
|
|
@@ -2569,7 +2578,7 @@ async function Ie({
|
|
|
2569
2578
|
bindParameters: i,
|
|
2570
2579
|
allNamedTypesFullyDynamic: !0
|
|
2571
2580
|
};
|
|
2572
|
-
const u = (await
|
|
2581
|
+
const u = (await B("arcgis_knowledge_current_map_context")).replaceAll(
|
|
2573
2582
|
"{nonDynamicTypes}",
|
|
2574
2583
|
JSON.stringify(c)
|
|
2575
2584
|
);
|
|
@@ -2581,17 +2590,17 @@ async function Ie({
|
|
|
2581
2590
|
allNamedTypesFullyDynamic: l
|
|
2582
2591
|
};
|
|
2583
2592
|
}
|
|
2584
|
-
async function
|
|
2593
|
+
async function co(e, t, r, a, o, n) {
|
|
2585
2594
|
const { view: l } = o, i = await Ne({
|
|
2586
2595
|
prompt: e,
|
|
2587
|
-
bindParameters:
|
|
2588
|
-
kg:
|
|
2596
|
+
bindParameters: t,
|
|
2597
|
+
kg: r,
|
|
2589
2598
|
graphQueryServiceUrl: a,
|
|
2590
2599
|
targetStructure: /* @__PURE__ */ new Map(),
|
|
2591
|
-
targetStructureReducer: (
|
|
2592
|
-
for (const
|
|
2593
|
-
|
|
2594
|
-
return
|
|
2600
|
+
targetStructureReducer: (m, y) => {
|
|
2601
|
+
for (const f of y)
|
|
2602
|
+
to(f, m);
|
|
2603
|
+
return m;
|
|
2595
2604
|
},
|
|
2596
2605
|
requestOptions: {
|
|
2597
2606
|
signal: Y(n),
|
|
@@ -2600,32 +2609,32 @@ async function so(e, r, t, a, o, n) {
|
|
|
2600
2609
|
config: n
|
|
2601
2610
|
});
|
|
2602
2611
|
if (i.type !== "success") {
|
|
2603
|
-
const
|
|
2604
|
-
throw new Error(`Failed to add records to the link chart. ${
|
|
2612
|
+
const m = i.type === "generation-error" ? i.errorMessage : `${i.errorMessage} Cypher query: ${i.graphQuery}`;
|
|
2613
|
+
throw new Error(`Failed to add records to the link chart. ${m}`);
|
|
2605
2614
|
}
|
|
2606
2615
|
const { graphQuery: c, explanation: u, processedResult: d } = i, p = Array.from(d.values());
|
|
2607
|
-
return await
|
|
2616
|
+
return await x(
|
|
2608
2617
|
{
|
|
2609
2618
|
text: `Query Results parsed into ${p.length} unique relationships and entities. Atempting to add to link chart...`
|
|
2610
2619
|
},
|
|
2611
2620
|
n
|
|
2612
2621
|
), !q(l) && l?.map ? (await l.map.addRecords(p), await Z(l), { generatedQuery: c, explanation: u, addedIdTypePairs: p }) : (await l?.map?.allLayers.find(
|
|
2613
|
-
(
|
|
2622
|
+
(y) => y.type === "knowledge-graph"
|
|
2614
2623
|
)?.addRecords(p), { generatedQuery: c, explanation: u, addedIdTypePairs: p });
|
|
2615
2624
|
}
|
|
2616
|
-
const W = "addRecords",
|
|
2625
|
+
const W = "addRecords", uo = s.object({
|
|
2617
2626
|
prompt: s.string().describe(
|
|
2618
2627
|
"The user's inquiry and context required in order to generate a cypher query that will be used to add records to the link chart."
|
|
2619
2628
|
)
|
|
2620
|
-
}),
|
|
2621
|
-
const { knowledgeGraph:
|
|
2629
|
+
}), po = async ({ prompt: e }, t) => {
|
|
2630
|
+
const { knowledgeGraph: r } = await M(t), a = O(t), { view: o } = a, l = k.getDefault().helperServices, {
|
|
2622
2631
|
enhancedPrompt: i,
|
|
2623
2632
|
bindParameters: c,
|
|
2624
2633
|
allNamedTypesFullyDynamic: u
|
|
2625
2634
|
} = await Ie({
|
|
2626
2635
|
prompt: e,
|
|
2627
2636
|
view: o,
|
|
2628
|
-
knowledgeGraph:
|
|
2637
|
+
knowledgeGraph: r,
|
|
2629
2638
|
includeReturnEntityAndRelationshipContext: !0
|
|
2630
2639
|
});
|
|
2631
2640
|
if (u)
|
|
@@ -2640,24 +2649,24 @@ const W = "addRecords", lo = s.object({
|
|
|
2640
2649
|
}
|
|
2641
2650
|
};
|
|
2642
2651
|
try {
|
|
2643
|
-
const { generatedQuery: d, explanation: p, addedIdTypePairs:
|
|
2652
|
+
const { generatedQuery: d, explanation: p, addedIdTypePairs: m } = await co(
|
|
2644
2653
|
i,
|
|
2645
2654
|
c,
|
|
2646
|
-
|
|
2655
|
+
r,
|
|
2647
2656
|
`${l.aiAssistantServices.url}${l.aiAssistantServices.graphQueryAssistant}`,
|
|
2648
2657
|
a,
|
|
2649
|
-
|
|
2658
|
+
t
|
|
2650
2659
|
);
|
|
2651
2660
|
return {
|
|
2652
2661
|
toolName: W,
|
|
2653
2662
|
status: "success",
|
|
2654
2663
|
summary: `Records added successfully. Cypher Query used: ${d}
|
|
2655
2664
|
|
|
2656
|
-
Number of records added: ${
|
|
2665
|
+
Number of records added: ${m.length}`,
|
|
2657
2666
|
details: {
|
|
2658
2667
|
generatedQuery: d,
|
|
2659
2668
|
explanation: p,
|
|
2660
|
-
addedIdTypePairs:
|
|
2669
|
+
addedIdTypePairs: m
|
|
2661
2670
|
}
|
|
2662
2671
|
};
|
|
2663
2672
|
} catch (d) {
|
|
@@ -2669,7 +2678,7 @@ Number of records added: ${h.length}`,
|
|
|
2669
2678
|
error: d
|
|
2670
2679
|
};
|
|
2671
2680
|
}
|
|
2672
|
-
},
|
|
2681
|
+
}, oi = g(po, {
|
|
2673
2682
|
name: W,
|
|
2674
2683
|
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.
|
|
2675
2684
|
|
|
@@ -2682,12 +2691,12 @@ Number of records added: ${h.length}`,
|
|
|
2682
2691
|
- "connect company x and company y"
|
|
2683
2692
|
- "connect all buildings on the link chart"
|
|
2684
2693
|
`,
|
|
2685
|
-
schema:
|
|
2694
|
+
schema: uo
|
|
2686
2695
|
});
|
|
2687
|
-
async function
|
|
2688
|
-
return await
|
|
2696
|
+
async function mo(e, t) {
|
|
2697
|
+
return await t.map?.applyLayout(e), await Z(t), { appliedLayout: e };
|
|
2689
2698
|
}
|
|
2690
|
-
const re = "applyLayout",
|
|
2699
|
+
const re = "applyLayout", ho = s.object({
|
|
2691
2700
|
layout: s.enum([
|
|
2692
2701
|
"organic-standard",
|
|
2693
2702
|
"organic-community",
|
|
@@ -2701,9 +2710,9 @@ const re = "applyLayout", po = s.object({
|
|
|
2701
2710
|
]).describe(
|
|
2702
2711
|
"The layout mode to apply to the link chart. The value must be one of the following: organic-standard, organic-community, basic-grid, hierarchical-bottom-to-top, radial-root-centric, tree-left-to-right, geographic-organic-standard, chronological-mono-timeline, chronological-multi-timeline"
|
|
2703
2712
|
)
|
|
2704
|
-
}),
|
|
2705
|
-
const { view:
|
|
2706
|
-
if (q(
|
|
2713
|
+
}), yo = async ({ layout: e }, t) => {
|
|
2714
|
+
const { view: r } = O(t);
|
|
2715
|
+
if (q(r))
|
|
2707
2716
|
return {
|
|
2708
2717
|
toolName: re,
|
|
2709
2718
|
status: "error",
|
|
@@ -2711,7 +2720,7 @@ const re = "applyLayout", po = s.object({
|
|
|
2711
2720
|
error: new Error()
|
|
2712
2721
|
};
|
|
2713
2722
|
{
|
|
2714
|
-
const { appliedLayout: a } = await
|
|
2723
|
+
const { appliedLayout: a } = await mo(e, r);
|
|
2715
2724
|
return {
|
|
2716
2725
|
toolName: re,
|
|
2717
2726
|
status: "success",
|
|
@@ -2721,19 +2730,19 @@ const re = "applyLayout", po = s.object({
|
|
|
2721
2730
|
}
|
|
2722
2731
|
};
|
|
2723
2732
|
}
|
|
2724
|
-
},
|
|
2733
|
+
}, ni = g(yo, {
|
|
2725
2734
|
name: re,
|
|
2726
2735
|
description: "Apply a diagram layout to the link chart",
|
|
2727
|
-
schema:
|
|
2736
|
+
schema: ho
|
|
2728
2737
|
});
|
|
2729
|
-
async function
|
|
2730
|
-
return
|
|
2738
|
+
async function fo(e, t) {
|
|
2739
|
+
return t.map?.changeNonspatialDataDisplay(e), await Z(t), { appliedNonspatialDataDisplayMode: e };
|
|
2731
2740
|
}
|
|
2732
|
-
const ae = "changeNonspatialVisibility",
|
|
2741
|
+
const ae = "changeNonspatialVisibility", go = s.object({
|
|
2733
2742
|
setting: s.enum(["hidden", "visible"]).describe("The setting of nonspatial visibility")
|
|
2734
|
-
}),
|
|
2735
|
-
const { view:
|
|
2736
|
-
if (q(
|
|
2743
|
+
}), wo = async ({ setting: e }, t) => {
|
|
2744
|
+
const { view: r } = O(t);
|
|
2745
|
+
if (q(r))
|
|
2737
2746
|
return {
|
|
2738
2747
|
toolName: ae,
|
|
2739
2748
|
status: "error",
|
|
@@ -2741,7 +2750,7 @@ const ae = "changeNonspatialVisibility", yo = s.object({
|
|
|
2741
2750
|
error: new Error()
|
|
2742
2751
|
};
|
|
2743
2752
|
{
|
|
2744
|
-
const { appliedNonspatialDataDisplayMode: a } = await
|
|
2753
|
+
const { appliedNonspatialDataDisplayMode: a } = await fo(e, r);
|
|
2745
2754
|
return {
|
|
2746
2755
|
toolName: ae,
|
|
2747
2756
|
status: "success",
|
|
@@ -2751,30 +2760,30 @@ const ae = "changeNonspatialVisibility", yo = s.object({
|
|
|
2751
2760
|
}
|
|
2752
2761
|
};
|
|
2753
2762
|
}
|
|
2754
|
-
},
|
|
2763
|
+
}, ii = g(wo, {
|
|
2755
2764
|
name: ae,
|
|
2756
2765
|
description: "Change whether or not nonspatial data is visible in the link chart. The value must be either 'hidden' or 'visible'.",
|
|
2757
|
-
schema:
|
|
2766
|
+
schema: go
|
|
2758
2767
|
});
|
|
2759
|
-
async function
|
|
2768
|
+
async function bo(e, t, r, a, o) {
|
|
2760
2769
|
let n, l = "";
|
|
2761
2770
|
for (let i = 1; i <= D; i++) {
|
|
2762
2771
|
const { graphQuery: c, explanation: u } = await de(
|
|
2763
2772
|
e,
|
|
2764
|
-
|
|
2765
|
-
|
|
2773
|
+
t.dataModel,
|
|
2774
|
+
r,
|
|
2766
2775
|
o,
|
|
2767
2776
|
n
|
|
2768
2777
|
);
|
|
2769
2778
|
try {
|
|
2770
|
-
await
|
|
2771
|
-
const d = await
|
|
2772
|
-
|
|
2779
|
+
await x({ text: `Attempting to create link chart from derived query: ${c}` }, o);
|
|
2780
|
+
const d = await ht.fromCypherQuery(
|
|
2781
|
+
t,
|
|
2773
2782
|
new Se({
|
|
2774
2783
|
openCypherQuery: c
|
|
2775
2784
|
})
|
|
2776
2785
|
);
|
|
2777
|
-
await
|
|
2786
|
+
await x({ text: "Link chart created successfully, loading..." }, o), await d.load();
|
|
2778
2787
|
const p = a.map;
|
|
2779
2788
|
return a.map = d, await a.when(), await Ae.whenOnce(() => !a.updating), d.entityCount === 0 && d.relationshipCount === 0 ? (a.map === d && (a.map = p), d.destroy(), {
|
|
2780
2789
|
type: "error",
|
|
@@ -2797,7 +2806,7 @@ Explanation: ${u}`
|
|
|
2797
2806
|
failedGraphQuery: c,
|
|
2798
2807
|
executionError: p,
|
|
2799
2808
|
attemptCount: i
|
|
2800
|
-
}, await
|
|
2809
|
+
}, await x(
|
|
2801
2810
|
{ text: `Attempt ${i} to create link chart failed with error: ${p}. Retrying ...` },
|
|
2802
2811
|
o
|
|
2803
2812
|
);
|
|
@@ -2808,12 +2817,12 @@ Explanation: ${u}`
|
|
|
2808
2817
|
errorMessage: `Failed to create link chart after ${D} attempts. Last error: ${l}`
|
|
2809
2818
|
};
|
|
2810
2819
|
}
|
|
2811
|
-
const V = "createLinkChart",
|
|
2820
|
+
const V = "createLinkChart", To = s.object({
|
|
2812
2821
|
prompt: s.string().describe(
|
|
2813
2822
|
"The user's inquiry and context required in order to generate a cypher query that will be used to create a link chart visualization. Only include information relevant to generating a cypher query. Do not suggest entity types, relationship types or properties. Do not include limits or formatting instructions for the query results unless specifically requested by the user. The prompt should be focused on the data the user wants to see in the link chart, not how to generate it."
|
|
2814
2823
|
)
|
|
2815
|
-
}),
|
|
2816
|
-
const { knowledgeGraph:
|
|
2824
|
+
}), vo = async ({ prompt: e }, t) => {
|
|
2825
|
+
const { knowledgeGraph: r } = await M(t), { view: a } = O(t);
|
|
2817
2826
|
if (q(a))
|
|
2818
2827
|
return {
|
|
2819
2828
|
toolName: V,
|
|
@@ -2822,14 +2831,14 @@ const V = "createLinkChart", wo = s.object({
|
|
|
2822
2831
|
error: new Error()
|
|
2823
2832
|
};
|
|
2824
2833
|
{
|
|
2825
|
-
const n = k.getDefault().helperServices, l = await
|
|
2834
|
+
const n = k.getDefault().helperServices, l = await bo(
|
|
2826
2835
|
`${e}
|
|
2827
2836
|
|
|
2828
2837
|
${qe}`,
|
|
2829
|
-
|
|
2838
|
+
r,
|
|
2830
2839
|
`${n.aiAssistantServices.url}${n.aiAssistantServices.graphQueryAssistant}`,
|
|
2831
2840
|
a,
|
|
2832
|
-
|
|
2841
|
+
t
|
|
2833
2842
|
);
|
|
2834
2843
|
if (l.type === "error")
|
|
2835
2844
|
return {
|
|
@@ -2852,57 +2861,57 @@ Explanation: ${c}`,
|
|
|
2852
2861
|
}
|
|
2853
2862
|
};
|
|
2854
2863
|
}
|
|
2855
|
-
},
|
|
2864
|
+
}, si = g(vo, {
|
|
2856
2865
|
name: V,
|
|
2857
2866
|
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'.",
|
|
2858
|
-
schema:
|
|
2859
|
-
}), oe = "queryGraphData",
|
|
2867
|
+
schema: To
|
|
2868
|
+
}), oe = "queryGraphData", So = s.object({
|
|
2860
2869
|
prompt: s.string().describe(
|
|
2861
2870
|
"The user's inquiry into the knowledge graph, from which a cypher query will be generated and executed to answer the inquiry. Only include entity types, relationship types or properties if they are provided in the user prompt or prior steps. Do not suggest entity types, relationship types or properties. Do not include limits, information on what to return, instructions on how to write the query, or formatting instructions for the query results unless specifically requested by the user."
|
|
2862
2871
|
)
|
|
2863
|
-
}),
|
|
2864
|
-
const { knowledgeGraph:
|
|
2872
|
+
}), xo = async ({ prompt: e }, t) => {
|
|
2873
|
+
const { knowledgeGraph: r } = await M(t), o = k.getDefault().helperServices;
|
|
2865
2874
|
let n = e, l = null, i = null;
|
|
2866
2875
|
try {
|
|
2867
|
-
({ view: i } = O(
|
|
2876
|
+
({ view: i } = O(t));
|
|
2868
2877
|
} catch {
|
|
2869
2878
|
}
|
|
2870
2879
|
i && ({ enhancedPrompt: n, bindParameters: l } = await Ie({
|
|
2871
2880
|
prompt: e,
|
|
2872
2881
|
view: i,
|
|
2873
|
-
knowledgeGraph:
|
|
2882
|
+
knowledgeGraph: r,
|
|
2874
2883
|
includeReturnEntityAndRelationshipContext: !1
|
|
2875
2884
|
}));
|
|
2876
2885
|
const c = await Ne({
|
|
2877
2886
|
prompt: n,
|
|
2878
2887
|
bindParameters: l,
|
|
2879
|
-
kg:
|
|
2888
|
+
kg: r,
|
|
2880
2889
|
graphQueryServiceUrl: `${o.aiAssistantServices.url}${o.aiAssistantServices.graphQueryAssistant}`,
|
|
2881
2890
|
targetStructure: new Array(),
|
|
2882
|
-
targetStructureReducer: (
|
|
2891
|
+
targetStructureReducer: (w, b) => (w.push(b), w),
|
|
2883
2892
|
requestOptions: {
|
|
2884
|
-
signal: Y(
|
|
2885
|
-
timeout:
|
|
2893
|
+
signal: Y(t),
|
|
2894
|
+
timeout: t?.timeout
|
|
2886
2895
|
},
|
|
2887
|
-
config:
|
|
2896
|
+
config: t
|
|
2888
2897
|
});
|
|
2889
2898
|
if (c.type !== "success") {
|
|
2890
|
-
const
|
|
2899
|
+
const w = c.type === "generation-error" ? c.errorMessage : `${c.errorMessage} Cypher query: ${c.graphQuery}`;
|
|
2891
2900
|
return {
|
|
2892
2901
|
toolName: oe,
|
|
2893
2902
|
status: "error",
|
|
2894
|
-
errorMessage: `Failed to query the knowledge graph. ${
|
|
2903
|
+
errorMessage: `Failed to query the knowledge graph. ${w}`,
|
|
2895
2904
|
error: "error" in c ? c.error : null
|
|
2896
2905
|
};
|
|
2897
2906
|
}
|
|
2898
|
-
const { graphQuery: u, explanation: d, processedResult: p, resultHeader:
|
|
2899
|
-
for (const
|
|
2900
|
-
for (const
|
|
2907
|
+
const { graphQuery: u, explanation: d, processedResult: p, resultHeader: m } = c, y = m.headerKeys;
|
|
2908
|
+
for (const w of p)
|
|
2909
|
+
for (const b of w)
|
|
2901
2910
|
z(
|
|
2902
|
-
|
|
2903
|
-
(
|
|
2911
|
+
b,
|
|
2912
|
+
(S) => ke(S)
|
|
2904
2913
|
);
|
|
2905
|
-
const
|
|
2914
|
+
const f = 50, h = p.slice(0, f).map((w) => JSON.stringify(w));
|
|
2906
2915
|
return {
|
|
2907
2916
|
toolName: oe,
|
|
2908
2917
|
status: "success",
|
|
@@ -2913,38 +2922,38 @@ ${u}
|
|
|
2913
2922
|
\`\`\`
|
|
2914
2923
|
|
|
2915
2924
|
Query Results:
|
|
2916
|
-
${
|
|
2925
|
+
${h.length} result(s) found.
|
|
2917
2926
|
|
|
2918
|
-
Column Headers: ${
|
|
2927
|
+
Column Headers: ${y.join(", ")}
|
|
2919
2928
|
|
|
2920
|
-
${
|
|
2929
|
+
${h.length > f ? `Showing top ${f} results:
|
|
2921
2930
|
|
|
2922
2931
|
` : `Results:
|
|
2923
2932
|
|
|
2924
|
-
`}${
|
|
2933
|
+
`}${h.join(`
|
|
2925
2934
|
`)}
|
|
2926
2935
|
`,
|
|
2927
2936
|
details: {
|
|
2928
2937
|
generatedQuery: u,
|
|
2929
2938
|
explanation: d,
|
|
2930
|
-
resultHeader:
|
|
2939
|
+
resultHeader: m,
|
|
2931
2940
|
queryResults: p
|
|
2932
2941
|
}
|
|
2933
2942
|
};
|
|
2934
|
-
},
|
|
2943
|
+
}, li = g(xo, {
|
|
2935
2944
|
name: oe,
|
|
2936
2945
|
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?'.",
|
|
2937
|
-
schema:
|
|
2938
|
-
}), ne = "generateCypher",
|
|
2946
|
+
schema: So
|
|
2947
|
+
}), ne = "generateCypher", Ro = s.object({
|
|
2939
2948
|
prompt: s.string().describe("The user's inquiry into the knowledge graph that needs to be translated into a cypher query.")
|
|
2940
|
-
}),
|
|
2941
|
-
const { knowledgeGraph:
|
|
2949
|
+
}), $o = async ({ prompt: e }, t) => {
|
|
2950
|
+
const { knowledgeGraph: r } = await M(t), o = k.getDefault().helperServices;
|
|
2942
2951
|
try {
|
|
2943
|
-
const { graphQuery: n, explanation: l } = await
|
|
2952
|
+
const { graphQuery: n, explanation: l } = await eo(
|
|
2944
2953
|
e,
|
|
2945
|
-
|
|
2954
|
+
r.dataModel,
|
|
2946
2955
|
`${o.aiAssistantServices.url}${o.aiAssistantServices.graphQueryAssistant}`,
|
|
2947
|
-
|
|
2956
|
+
t
|
|
2948
2957
|
);
|
|
2949
2958
|
return {
|
|
2950
2959
|
toolName: ne,
|
|
@@ -2967,36 +2976,36 @@ Explanation: ${l}`,
|
|
|
2967
2976
|
error: n
|
|
2968
2977
|
};
|
|
2969
2978
|
}
|
|
2970
|
-
},
|
|
2979
|
+
}, ci = g($o, {
|
|
2971
2980
|
name: ne,
|
|
2972
2981
|
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.",
|
|
2973
|
-
schema:
|
|
2974
|
-
}),
|
|
2975
|
-
const
|
|
2976
|
-
for (const i of
|
|
2982
|
+
schema: Ro
|
|
2983
|
+
}), Co = (e) => {
|
|
2984
|
+
const t = e.dataModel, r = /* @__PURE__ */ new Map();
|
|
2985
|
+
for (const i of t.searchIndexes)
|
|
2977
2986
|
if (i.supportedCategory !== "esriTypeMetaEntityProvenance")
|
|
2978
2987
|
for (const [c, u] of i.searchProperties.entries()) {
|
|
2979
|
-
const d =
|
|
2980
|
-
u.propertyNames.forEach((p) => d.add(p)),
|
|
2988
|
+
const d = r.get(c) ?? /* @__PURE__ */ new Set();
|
|
2989
|
+
u.propertyNames.forEach((p) => d.add(p)), r.set(c, d);
|
|
2981
2990
|
}
|
|
2982
|
-
const a =
|
|
2983
|
-
${a.map(({ name: i }) => `${i}: [${Array.from(
|
|
2991
|
+
const a = t.entityTypes.filter((i) => r.has(i.name)), o = t.relationshipTypes.filter((i) => r.has(i.name)), n = `Entity Types:
|
|
2992
|
+
${a.map(({ name: i }) => `${i}: [${Array.from(r.get(i) ?? []).join(", ")}]`).join(`
|
|
2984
2993
|
`)}`, l = `Relationship Types:
|
|
2985
|
-
${o.map(({ name: i }) => `${i}: [${Array.from(
|
|
2994
|
+
${o.map(({ name: i }) => `${i}: [${Array.from(r.get(i) ?? []).join(", ")}]`).join(`
|
|
2986
2995
|
`)}`;
|
|
2987
2996
|
return `${n}
|
|
2988
2997
|
|
|
2989
2998
|
${l}`;
|
|
2990
2999
|
};
|
|
2991
|
-
async function
|
|
2992
|
-
const a = await
|
|
3000
|
+
async function Eo(e, t, r) {
|
|
3001
|
+
const a = await B("arcgis_knowledge_lucene_generation_prompt"), o = {
|
|
2993
3002
|
inquiry: e,
|
|
2994
|
-
dataModelForSearch:
|
|
3003
|
+
dataModelForSearch: Co(t)
|
|
2995
3004
|
}, n = s.enum(["entity", "relationship", "both"]).describe("The graph element category to search against - entity, relationship, or both"), l = s.number().int().positive().nullable().describe(
|
|
2996
3005
|
"The maximum number of search results to return. Default to 10 if not specified by the user, or set to null if the user specifically requests no limits or all results."
|
|
2997
3006
|
), i = s.array(
|
|
2998
3007
|
s.enum(
|
|
2999
|
-
|
|
3008
|
+
t.dataModel.entityTypes.map((d) => d.name).concat(t.dataModel.relationshipTypes.map((d) => d.name))
|
|
3000
3009
|
)
|
|
3001
3010
|
).min(1), c = s.object({
|
|
3002
3011
|
query: s.string().describe("A lucene syntax query string to be executed against the knowledge graph search API"),
|
|
@@ -3010,27 +3019,27 @@ async function $o(e, r, t) {
|
|
|
3010
3019
|
promptText: a,
|
|
3011
3020
|
inputVariables: o,
|
|
3012
3021
|
schema: c,
|
|
3013
|
-
config:
|
|
3022
|
+
config: r
|
|
3014
3023
|
});
|
|
3015
3024
|
}
|
|
3016
|
-
const ie = "searchGraphData",
|
|
3025
|
+
const ie = "searchGraphData", Fo = s.object({
|
|
3017
3026
|
prompt: s.string().describe(
|
|
3018
3027
|
"The user's inquiry into the knowledge graph, from which a lucene search query will be generated and executed against the graph to return relevant results."
|
|
3019
3028
|
)
|
|
3020
|
-
}),
|
|
3021
|
-
const { knowledgeGraph:
|
|
3022
|
-
await
|
|
3023
|
-
const a = await
|
|
3024
|
-
await
|
|
3025
|
-
const o = await
|
|
3026
|
-
kg:
|
|
3029
|
+
}), ko = async ({ prompt: e }, t) => {
|
|
3030
|
+
const { knowledgeGraph: r } = await M(t);
|
|
3031
|
+
await x({ text: "Generating search query for the user inquiry" }, t);
|
|
3032
|
+
const a = await Eo(e, r, t);
|
|
3033
|
+
await x({ text: "Executing graph search with generated search query" }, t);
|
|
3034
|
+
const o = await lo({
|
|
3035
|
+
kg: r,
|
|
3027
3036
|
searchQuery: a.query,
|
|
3028
3037
|
typeCategoryFilter: a.typeCategoryFilter,
|
|
3029
3038
|
namedTypesFilter: a.typeFilters,
|
|
3030
3039
|
searchResultLimit: a.resultLimit,
|
|
3031
3040
|
requestOptions: {
|
|
3032
|
-
signal: Y(
|
|
3033
|
-
timeout:
|
|
3041
|
+
signal: Y(t),
|
|
3042
|
+
timeout: t?.timeout
|
|
3034
3043
|
}
|
|
3035
3044
|
});
|
|
3036
3045
|
if (o.type !== "success")
|
|
@@ -3066,7 +3075,7 @@ const ie = "searchGraphData", Co = s.object({
|
|
|
3066
3075
|
searchResults: o.results
|
|
3067
3076
|
}
|
|
3068
3077
|
};
|
|
3069
|
-
},
|
|
3078
|
+
}, ui = g(ko, {
|
|
3070
3079
|
name: ie,
|
|
3071
3080
|
description: `
|
|
3072
3081
|
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.
|
|
@@ -3078,53 +3087,53 @@ const ie = "searchGraphData", Co = s.object({
|
|
|
3078
3087
|
- "Find all reports authored by someone with the title of 'Researcher'"
|
|
3079
3088
|
- "Find the first 5 reports where summary mentions flood zoning near Sacramento, and the organization name is the City of Sacramento Utilities, and tags containing stormwater".
|
|
3080
3089
|
- "Search for all john smiths and show their global ids`,
|
|
3081
|
-
schema:
|
|
3090
|
+
schema: Fo
|
|
3082
3091
|
});
|
|
3083
3092
|
export {
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3093
|
+
Gn as A,
|
|
3094
|
+
On as B,
|
|
3095
|
+
Mn as C,
|
|
3096
|
+
Qn as D,
|
|
3097
|
+
_n as E,
|
|
3098
|
+
Wn as F,
|
|
3090
3099
|
ue as G,
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3100
|
+
ei as H,
|
|
3101
|
+
Vn as I,
|
|
3102
|
+
Bn as J,
|
|
3103
|
+
Un as K,
|
|
3104
|
+
Kn as L,
|
|
3105
|
+
Hn as M,
|
|
3106
|
+
En as N,
|
|
3107
|
+
Zn as O,
|
|
3108
|
+
Yn as P,
|
|
3109
|
+
Wa as Q,
|
|
3101
3110
|
N as R,
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3111
|
+
Jn as S,
|
|
3112
|
+
Xn as T,
|
|
3113
|
+
ni as a,
|
|
3114
|
+
ci as b,
|
|
3115
|
+
ii as c,
|
|
3116
|
+
si as d,
|
|
3117
|
+
oi as e,
|
|
3109
3118
|
xe as f,
|
|
3110
|
-
|
|
3111
|
-
|
|
3119
|
+
B as g,
|
|
3120
|
+
ai as h,
|
|
3112
3121
|
M as i,
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3122
|
+
ri as j,
|
|
3123
|
+
Fn as k,
|
|
3124
|
+
ti as l,
|
|
3125
|
+
kn as m,
|
|
3126
|
+
Nn as n,
|
|
3127
|
+
qn as o,
|
|
3128
|
+
In as p,
|
|
3129
|
+
li as q,
|
|
3130
|
+
Ln as r,
|
|
3131
|
+
ui as s,
|
|
3132
|
+
Bt as t,
|
|
3133
|
+
zn as u,
|
|
3134
|
+
Dn as v,
|
|
3135
|
+
Pn as w,
|
|
3136
|
+
An as x,
|
|
3128
3137
|
C as y,
|
|
3129
|
-
|
|
3138
|
+
jn as z
|
|
3130
3139
|
};
|