@arcgis/ai-components 5.1.19 → 5.1.21
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/{KEUFBLWH.js → 3VYHLCEJ.js} +1 -1
- package/dist/cdn/{EQ5A6LEB.js → 3ZUPX7SV.js} +1 -1
- package/dist/cdn/{7EOGC45K.js → 4PPLRQP4.js} +1 -1
- package/dist/cdn/{P3RMRHDI.js → 6HBSAJ4D.js} +1 -1
- package/dist/cdn/{QWYN64BT.js → 6LS7GDRT.js} +1 -1
- package/dist/cdn/{2EUSSNEN.js → 7SP226LK.js} +1 -1
- package/dist/cdn/{4GZGN5BU.js → 7WVTBLKQ.js} +1 -1
- package/dist/cdn/{GJ62KJML.js → AGXMQNUN.js} +1 -1
- package/dist/cdn/{TCJPU776.js → B3CN32NZ.js} +1 -1
- package/dist/cdn/{5YDKBORR.js → BISXL446.js} +1 -1
- package/dist/cdn/{BFGBRFTM.js → DYFWBBHN.js} +15 -15
- package/dist/cdn/{LQZ6WODA.js → EGORD7TV.js} +1 -1
- package/dist/cdn/{BDEULPOS.js → FID3JJQD.js} +1 -1
- package/dist/cdn/{ME7TQSMU.js → GR4QQD4L.js} +1 -1
- package/dist/cdn/{4KL6UPML.js → HBKDECAL.js} +1 -1
- package/dist/cdn/{RRTK45D4.js → HZDQSBST.js} +1 -1
- package/dist/cdn/{WRMAR5MJ.js → I2CSVDMV.js} +1 -1
- package/dist/cdn/{RNHLDTFC.js → IOU6MI6Z.js} +1 -1
- package/dist/cdn/{IWI4ZLJE.js → JUDN5CWR.js} +1 -1
- package/dist/cdn/{WLIOFW52.js → JWHJJKWO.js} +1 -1
- package/dist/cdn/{CUC5TZON.js → NVPMKCPT.js} +1 -1
- package/dist/cdn/{VWN4PA3K.js → NXAYVRR2.js} +1 -1
- package/dist/cdn/{7S3KM7PI.js → PDSXRFLY.js} +1 -1
- package/dist/cdn/{3JUKXIST.js → QG6LJMJI.js} +1 -1
- package/dist/cdn/{UJHZWDU6.js → QOVAWELA.js} +1 -1
- package/dist/cdn/{XTEURL35.js → RMUZYYI2.js} +1 -1
- package/dist/cdn/{UC6WHGWU.js → SGPYWDAB.js} +1 -1
- package/dist/cdn/{PLEKQEFN.js → SXC2KVOX.js} +1 -1
- package/dist/cdn/{KPI54PUM.js → TP3R63OD.js} +1 -1
- package/dist/cdn/{BH3N3CXD.js → US6DQXE5.js} +1 -1
- package/dist/cdn/{64LJOTYC.js → Y5BLJPJT.js} +1 -1
- package/dist/cdn/{AUI6P2N7.js → ZGH4OSMA.js} +1 -1
- package/dist/cdn/{L2A626UO.js → ZTYXGSWX.js} +1 -1
- package/dist/cdn/agent-utils/index.js +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/adapter.js +72 -68
- 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
|
@@ -23,7 +23,7 @@ import { createRenderer as Qe } from "@arcgis/core/smartMapping/renderers/pieCha
|
|
|
23
23
|
import { getSchemesByTag as _e, getSchemes as We } from "@arcgis/core/smartMapping/symbology/pieChart.js";
|
|
24
24
|
import { getBackgroundColorTheme as he } from "@arcgis/core/views/support/colorUtils.js";
|
|
25
25
|
import { a as R, s as x } from "./index.js";
|
|
26
|
-
import { createAgeRenderer as
|
|
26
|
+
import { createAgeRenderer as Be, createContinuousRenderer as Ve } from "@arcgis/core/smartMapping/renderers/color.js";
|
|
27
27
|
import { getSchemesByTag as se } from "@arcgis/core/smartMapping/symbology/color.js";
|
|
28
28
|
import { createContinuousRenderer as Ue } from "@arcgis/core/smartMapping/renderers/univariateColorSize.js";
|
|
29
29
|
import { createRenderer as Ke } from "@arcgis/core/smartMapping/renderers/dotDensity.js";
|
|
@@ -117,7 +117,7 @@ async function vt({ address: e }, t) {
|
|
|
117
117
|
}
|
|
118
118
|
const xt = s.object({
|
|
119
119
|
address: s.string().describe("The full address or place name to locate.")
|
|
120
|
-
}),
|
|
120
|
+
}), zn = f(vt, {
|
|
121
121
|
name: "goToAddress",
|
|
122
122
|
description: "Geocodes an address using Esri's World Geocoding Service and zooms the map to that location.",
|
|
123
123
|
schema: xt
|
|
@@ -140,7 +140,7 @@ async function $t({ bookmarkName: e }, t) {
|
|
|
140
140
|
}
|
|
141
141
|
const Ct = E.object({
|
|
142
142
|
bookmarkName: E.string().describe("The name of the bookmark to navigate to.")
|
|
143
|
-
}),
|
|
143
|
+
}), Dn = f($t, {
|
|
144
144
|
name: "goToBookmark",
|
|
145
145
|
description: "Go to the extent of the bookmark with the given name.",
|
|
146
146
|
schema: Ct
|
|
@@ -207,7 +207,7 @@ const It = E.object({}), An = f(qt, {
|
|
|
207
207
|
description: "Zooms the map to the full world extent using Esri's Geocoding Service.",
|
|
208
208
|
schema: It
|
|
209
209
|
});
|
|
210
|
-
async function
|
|
210
|
+
async function zt(e) {
|
|
211
211
|
const r = e.map.initialViewProperties?.viewpoint?.targetGeometry;
|
|
212
212
|
if (r)
|
|
213
213
|
await e.goTo(r);
|
|
@@ -215,11 +215,11 @@ async function Dt(e) {
|
|
|
215
215
|
throw new Error("Initial extent is undefined");
|
|
216
216
|
return { text: "Successfully zoomed to home extent" };
|
|
217
217
|
}
|
|
218
|
-
async function
|
|
218
|
+
async function Dt(e, t) {
|
|
219
219
|
const { mapView: r } = C(t);
|
|
220
|
-
return await
|
|
220
|
+
return await zt(r);
|
|
221
221
|
}
|
|
222
|
-
const Pt = s.object({}), Ln = f(
|
|
222
|
+
const Pt = s.object({}), Ln = f(Dt, {
|
|
223
223
|
name: "goToHomeExtent",
|
|
224
224
|
description: "Go to the initial web map view extent",
|
|
225
225
|
schema: Pt
|
|
@@ -291,16 +291,16 @@ const Wt = s.object({
|
|
|
291
291
|
description: "Go to the specified viewpoint. This can contain a combination of scale, center, zoom, etc.",
|
|
292
292
|
schema: Wt
|
|
293
293
|
});
|
|
294
|
-
async function
|
|
294
|
+
async function Bt(e, t) {
|
|
295
295
|
return await t.goTo({ zoom: e }), { text: `Successfully zoomed to: ${e}` };
|
|
296
296
|
}
|
|
297
|
-
async function
|
|
297
|
+
async function Vt({ zoom: e }, t) {
|
|
298
298
|
const { mapView: r } = C(t);
|
|
299
|
-
return await
|
|
299
|
+
return await Bt(e, r);
|
|
300
300
|
}
|
|
301
301
|
const Ut = s.object({
|
|
302
302
|
zoom: s.number().min(1).max(20).describe("The zoom level of the view to go to.")
|
|
303
|
-
}), Mn = f(
|
|
303
|
+
}), Mn = f(Vt, {
|
|
304
304
|
name: "goToZoom",
|
|
305
305
|
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.).',
|
|
306
306
|
schema: Ut
|
|
@@ -319,7 +319,7 @@ const Ut = s.object({
|
|
|
319
319
|
"../agents/navigation/prompts/navigation_intent_prompt.md": () => import("./navigation_intent_prompt.js").then((e) => e.default),
|
|
320
320
|
"../agents/navigation/prompts/navigation_tool_prompt.md": () => import("./navigation_tool_prompt.js").then((e) => e.default)
|
|
321
321
|
});
|
|
322
|
-
async function
|
|
322
|
+
async function V(e) {
|
|
323
323
|
const t = Object.entries(ge).find(([r]) => r.endsWith(`/${e}.md`));
|
|
324
324
|
if (!t)
|
|
325
325
|
throw new Error(`Prompt not found: ${e}
|
|
@@ -461,7 +461,7 @@ function tr(e) {
|
|
|
461
461
|
};
|
|
462
462
|
}
|
|
463
463
|
async function rr(e) {
|
|
464
|
-
return await
|
|
464
|
+
return await Be(e);
|
|
465
465
|
}
|
|
466
466
|
async function ar({
|
|
467
467
|
arcgisMap: e,
|
|
@@ -540,7 +540,7 @@ function ir(e) {
|
|
|
540
540
|
};
|
|
541
541
|
}
|
|
542
542
|
async function sr(e) {
|
|
543
|
-
return await
|
|
543
|
+
return await Ve(e);
|
|
544
544
|
}
|
|
545
545
|
async function lr({
|
|
546
546
|
arcgisMap: e,
|
|
@@ -589,7 +589,7 @@ const ur = s.object({
|
|
|
589
589
|
fields: s.array(s.string()).describe("The field(s) to use for the color renderer"),
|
|
590
590
|
colorSchemes: s.array(s.string()).optional().describe("Optional color scheme tags to use"),
|
|
591
591
|
theme: s.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the color ramp")
|
|
592
|
-
}),
|
|
592
|
+
}), Bn = f(cr, {
|
|
593
593
|
name: "color",
|
|
594
594
|
description: `Label: Counts and Amounts (color)
|
|
595
595
|
Description: Vary color along a continuous color ramp to represent numeric or ranked data.
|
|
@@ -667,7 +667,7 @@ const yr = s.object({
|
|
|
667
667
|
fields: s.array(s.string()).describe("The fields to use for the color-size univariate renderer"),
|
|
668
668
|
colorSchemes: s.array(s.string()).optional().describe("Optional color scheme tags to use"),
|
|
669
669
|
theme: s.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the color and size ramps")
|
|
670
|
-
}),
|
|
670
|
+
}), Vn = f(hr, {
|
|
671
671
|
name: "color-size-univariate",
|
|
672
672
|
description: `Label: Color and Size (univariate)
|
|
673
673
|
Description: Vary symbol size and color based on the values of two numeric attributes.
|
|
@@ -930,7 +930,7 @@ function qr(e) {
|
|
|
930
930
|
async function Ir(e) {
|
|
931
931
|
return await et(e);
|
|
932
932
|
}
|
|
933
|
-
async function
|
|
933
|
+
async function zr({
|
|
934
934
|
arcgisMap: e,
|
|
935
935
|
arcgisMapView: t,
|
|
936
936
|
layerId: r,
|
|
@@ -954,13 +954,13 @@ async function Dr({
|
|
|
954
954
|
return `Error applying relationship renderer: ${c instanceof Error ? c.message : String(c)}`;
|
|
955
955
|
}
|
|
956
956
|
}
|
|
957
|
-
async function
|
|
957
|
+
async function Dr({
|
|
958
958
|
layerId: e,
|
|
959
959
|
fields: t,
|
|
960
960
|
colorSchemes: r
|
|
961
961
|
}, a) {
|
|
962
962
|
const { mapView: o } = $(a);
|
|
963
|
-
return await R({ type: "show-legend", data: { layerIds: [e] } }, a), await
|
|
963
|
+
return await R({ type: "show-legend", data: { layerIds: [e] } }, a), await zr({
|
|
964
964
|
arcgisMap: o.map,
|
|
965
965
|
arcgisMapView: o,
|
|
966
966
|
layerId: e,
|
|
@@ -972,7 +972,7 @@ const Pr = s.object({
|
|
|
972
972
|
layerId: s.string().describe("The id of the layer to apply the relationship renderer to"),
|
|
973
973
|
fields: s.array(s.string()).describe("The two fields to use for the relationship renderer (bivariate visualization)"),
|
|
974
974
|
colorSchemes: s.array(s.string()).optional().describe("Optional color scheme tags to use")
|
|
975
|
-
}), Jn = f(
|
|
975
|
+
}), Jn = f(Dr, {
|
|
976
976
|
name: "relationship",
|
|
977
977
|
description: `Label: Relationship
|
|
978
978
|
Description: Overlays two color ramps to represent the relationship between two numeric attributes.
|
|
@@ -1111,7 +1111,7 @@ async function Wr({
|
|
|
1111
1111
|
theme: a
|
|
1112
1112
|
});
|
|
1113
1113
|
}
|
|
1114
|
-
const
|
|
1114
|
+
const Br = s.object({
|
|
1115
1115
|
layerId: s.string().describe("The id of the layer to apply the size renderer to"),
|
|
1116
1116
|
fields: s.array(s.string()).describe("The field(s) to use for the size renderer (numeric data)"),
|
|
1117
1117
|
colorSchemes: s.array(s.string()).optional().describe("Optional color scheme tags to use"),
|
|
@@ -1129,9 +1129,9 @@ const Vr = s.object({
|
|
|
1129
1129
|
Keywords: graduated size, proportional size, classed size, how much, total, number, when
|
|
1130
1130
|
Example: Vary the size of each feature based on the date a ticket was completed.
|
|
1131
1131
|
Fields: This style requires a single field with a date type.`,
|
|
1132
|
-
schema:
|
|
1132
|
+
schema: Br
|
|
1133
1133
|
});
|
|
1134
|
-
function
|
|
1134
|
+
function Vr(e) {
|
|
1135
1135
|
const { fields: t, layer: r, view: a, colorSchemeTags: o } = e, n = t[0], l = t[1], i = t[2];
|
|
1136
1136
|
let c;
|
|
1137
1137
|
return o && (c = nt({
|
|
@@ -1171,7 +1171,7 @@ async function Kr({
|
|
|
1171
1171
|
theme: n
|
|
1172
1172
|
};
|
|
1173
1173
|
try {
|
|
1174
|
-
const u =
|
|
1174
|
+
const u = Vr(c), d = await Ur(u);
|
|
1175
1175
|
return i.renderer = d.renderer, i.visible = !0, `Type renderer applied to layer: ${i.title ?? i.id} using fields ${a.join(", ")}`;
|
|
1176
1176
|
} catch (u) {
|
|
1177
1177
|
return `Error applying type renderer: ${u instanceof Error ? u.message : String(u)}`;
|
|
@@ -1630,7 +1630,7 @@ const Ea = async (e) => {
|
|
|
1630
1630
|
field: r,
|
|
1631
1631
|
sqlWhere: K(i.definitionExpression, t.where),
|
|
1632
1632
|
...w && { filter: w }
|
|
1633
|
-
})).uniqueValueInfos.sort((I,
|
|
1633
|
+
})).uniqueValueInfos.sort((I, De) => De.count - I.count).slice(0, b)), g && d.domain?.type === "coded-value" && (g = g.map((I) => ({
|
|
1634
1634
|
...I,
|
|
1635
1635
|
value: A ? A.getName(I.value) ?? I.value : I.value
|
|
1636
1636
|
})));
|
|
@@ -1710,7 +1710,7 @@ DO NOT USE FOR:
|
|
|
1710
1710
|
|
|
1711
1711
|
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.`,
|
|
1712
1712
|
schema: qa
|
|
1713
|
-
}),
|
|
1713
|
+
}), za = (e) => e.flatMap((t) => t.split(",")).map((t) => t.trim()).map((t) => t.split(/\s+/u)[0]?.replace(/^"|"$/gu, "")).filter((t) => !!t), Da = async (e, t, r, a, o) => {
|
|
1714
1714
|
const n = r.map?.allLayers.find((m) => m.id === e.layerId), l = await r.whenLayerView(n), i = n.title ?? e.layerId;
|
|
1715
1715
|
let c;
|
|
1716
1716
|
if (a) {
|
|
@@ -1756,7 +1756,7 @@ Only call this tool when the answer requires computing an aggregate (avg, max, m
|
|
|
1756
1756
|
const y = n.createQuery();
|
|
1757
1757
|
y.where = K(n.definitionExpression, e.where || "1=1"), y.outFields = p.length ? p : ["*"], y.orderByFields = t.orderByFields, y.returnGeometry = !1, y.num = t.topCount, c && (y.geometry = c, y.spatialRelationship = "intersects"), a?.distance && (y.distance = a.distance), a?.units && (y.units = a.units), y.outSpatialReference = r.spatialReference;
|
|
1758
1758
|
const g = [
|
|
1759
|
-
.../* @__PURE__ */ new Set([...e.outFields, ...
|
|
1759
|
+
.../* @__PURE__ */ new Set([...e.outFields, ...za(t.orderByFields)])
|
|
1760
1760
|
], b = le(l, g, o ?? !1);
|
|
1761
1761
|
try {
|
|
1762
1762
|
m = b ? await l.queryFeatures(y) : await n.queryFeatures(y);
|
|
@@ -1793,7 +1793,7 @@ Only call this tool when the answer requires computing an aggregate (avg, max, m
|
|
|
1793
1793
|
geometryFilter: r,
|
|
1794
1794
|
useCurrentExtent: a
|
|
1795
1795
|
}, o) => {
|
|
1796
|
-
const { mapView: n } = k(o), l = await
|
|
1796
|
+
const { mapView: n } = k(o), l = await Da(e, t, n, r, a);
|
|
1797
1797
|
return JSON.stringify(l, null, 2);
|
|
1798
1798
|
}, Aa = s.object({
|
|
1799
1799
|
layerId: s.string().describe("The layerId of the layer containing the geometry by which to filter."),
|
|
@@ -1922,7 +1922,7 @@ const _a = s.object({
|
|
|
1922
1922
|
}).describe("Point coordinates from a previous navigation/geocoding result"),
|
|
1923
1923
|
distance: s.number().optional().describe("Optional buffer distance around the point."),
|
|
1924
1924
|
units: F.optional().describe("The units for the distance buffer.")
|
|
1925
|
-
}),
|
|
1925
|
+
}), Ba = s.object({
|
|
1926
1926
|
targetLayer: s.object({
|
|
1927
1927
|
layerId: s.string().describe("The layerId of the layer containing the field from which to get a value."),
|
|
1928
1928
|
where: s.string().describe(
|
|
@@ -1941,7 +1941,7 @@ const _a = s.object({
|
|
|
1941
1941
|
useCurrentExtent: s.boolean().optional().describe(
|
|
1942
1942
|
"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)."
|
|
1943
1943
|
)
|
|
1944
|
-
}),
|
|
1944
|
+
}), Va = f(Qa, {
|
|
1945
1945
|
name: "queryFeatures",
|
|
1946
1946
|
description: `Queries features from a layer. Returns the total count of matching features, plus individual feature attributes if ≤25 features match.
|
|
1947
1947
|
|
|
@@ -1953,8 +1953,8 @@ USE THIS TOOL FOR:
|
|
|
1953
1953
|
- Any question where the user wants to SEE or COUNT matching features
|
|
1954
1954
|
|
|
1955
1955
|
This is the DEFAULT tool for most queries. When in doubt, use this tool.`,
|
|
1956
|
-
schema:
|
|
1957
|
-
}), Ua = [Ca, Ia, Ga,
|
|
1956
|
+
schema: Ba
|
|
1957
|
+
}), Ua = [Ca, Ia, Ga, Va], ai = [da, aa, ea], Ka = new it(Ua, { handleToolErrors: !1 });
|
|
1958
1958
|
async function oi(e, t) {
|
|
1959
1959
|
const { messages: r } = await Ka.invoke({ messages: e.dataExplorationMessages }, t), a = [], o = [];
|
|
1960
1960
|
for (const n of r) {
|
|
@@ -2244,7 +2244,7 @@ function Z(e) {
|
|
|
2244
2244
|
return e?.signal;
|
|
2245
2245
|
}
|
|
2246
2246
|
async function ro(e, t) {
|
|
2247
|
-
const r = await
|
|
2247
|
+
const r = await V("arcgis_knowledge_cypher_query_prompt");
|
|
2248
2248
|
return t ? `${e} ${r}
|
|
2249
2249
|
|
|
2250
2250
|
Your previous attempt to generate a cypher query failed. See the details below and generate a new cypher query that avoids this error.
|
|
@@ -2269,7 +2269,7 @@ async function de(e, t, r, a, o) {
|
|
|
2269
2269
|
body: JSON.stringify(n),
|
|
2270
2270
|
headers: {
|
|
2271
2271
|
"Content-Type": "application/json",
|
|
2272
|
-
|
|
2272
|
+
"X-Esri-Authorization": `Bearer ${pe.findCredential(N.getDefault().url)?.token ?? ""}`
|
|
2273
2273
|
},
|
|
2274
2274
|
signal: l
|
|
2275
2275
|
});
|
|
@@ -2294,7 +2294,7 @@ async function de(e, t, r, a, o) {
|
|
|
2294
2294
|
}),
|
|
2295
2295
|
headers: {
|
|
2296
2296
|
"Content-Type": "application/json",
|
|
2297
|
-
|
|
2297
|
+
"X-Esri-Authorization": `Bearer ${pe.findCredential(N.getDefault().url)?.token ?? ""}`
|
|
2298
2298
|
},
|
|
2299
2299
|
signal: l
|
|
2300
2300
|
});
|
|
@@ -2317,26 +2317,26 @@ async function de(e, t, r, a, o) {
|
|
|
2317
2317
|
return { graphQuery: p, explanation: m };
|
|
2318
2318
|
}
|
|
2319
2319
|
function oo(e, t) {
|
|
2320
|
-
|
|
2320
|
+
z(e, (r) => {
|
|
2321
2321
|
t.set(`${r.typeName}__${r.id}`, {
|
|
2322
2322
|
id: r.id,
|
|
2323
2323
|
typeName: r.typeName
|
|
2324
2324
|
});
|
|
2325
2325
|
});
|
|
2326
2326
|
}
|
|
2327
|
-
function
|
|
2327
|
+
function z(e, t) {
|
|
2328
2328
|
if (!(!e || typeof e != "object")) {
|
|
2329
2329
|
if (io(e))
|
|
2330
2330
|
for (const r of e.path)
|
|
2331
|
-
|
|
2331
|
+
z(r, t);
|
|
2332
2332
|
else if (no(e))
|
|
2333
2333
|
t(e);
|
|
2334
2334
|
else if (Array.isArray(e))
|
|
2335
2335
|
for (const r of e)
|
|
2336
|
-
|
|
2336
|
+
z(r, t);
|
|
2337
2337
|
else if (so(e))
|
|
2338
2338
|
for (const r of Object.values(e.properties ?? {}))
|
|
2339
|
-
|
|
2339
|
+
z(r, t);
|
|
2340
2340
|
}
|
|
2341
2341
|
}
|
|
2342
2342
|
function no(e) {
|
|
@@ -2384,7 +2384,7 @@ function co(e, t) {
|
|
|
2384
2384
|
}
|
|
2385
2385
|
return { allNamedTypesFullyDynamic: i, bindParameters: r, nonDynamicTypes: a };
|
|
2386
2386
|
}
|
|
2387
|
-
const
|
|
2387
|
+
const D = 3;
|
|
2388
2388
|
function ke(e, t = 100) {
|
|
2389
2389
|
const r = {};
|
|
2390
2390
|
for (const a of Object.entries(e.properties ?? {})) {
|
|
@@ -2448,7 +2448,7 @@ async function qe({
|
|
|
2448
2448
|
config: u
|
|
2449
2449
|
}) {
|
|
2450
2450
|
let d;
|
|
2451
|
-
for (let p = 1; p <=
|
|
2451
|
+
for (let p = 1; p <= D; p++) {
|
|
2452
2452
|
let m;
|
|
2453
2453
|
try {
|
|
2454
2454
|
m = await de(e, r.dataModel, a, u, d);
|
|
@@ -2493,7 +2493,7 @@ async function qe({
|
|
|
2493
2493
|
graphQuery: m.graphQuery,
|
|
2494
2494
|
explanation: m.explanation
|
|
2495
2495
|
};
|
|
2496
|
-
if (p >=
|
|
2496
|
+
if (p >= D)
|
|
2497
2497
|
return h.type === "timeout" ? {
|
|
2498
2498
|
type: "timeout",
|
|
2499
2499
|
errorMessage: y,
|
|
@@ -2516,7 +2516,7 @@ async function qe({
|
|
|
2516
2516
|
);
|
|
2517
2517
|
}
|
|
2518
2518
|
throw new Error(
|
|
2519
|
-
`Failed to execute generated cypher due to an unexpected error after ${
|
|
2519
|
+
`Failed to execute generated cypher due to an unexpected error after ${D} attempts.`
|
|
2520
2520
|
);
|
|
2521
2521
|
}
|
|
2522
2522
|
const po = async (e, t) => {
|
|
@@ -2581,7 +2581,7 @@ const po = async (e, t) => {
|
|
|
2581
2581
|
results: l
|
|
2582
2582
|
};
|
|
2583
2583
|
}, Ie = "IMPORTANT: The generated cypher query must return entire entities and relationships ONLY.";
|
|
2584
|
-
async function
|
|
2584
|
+
async function ze({
|
|
2585
2585
|
prompt: e,
|
|
2586
2586
|
view: t,
|
|
2587
2587
|
knowledgeGraph: r,
|
|
@@ -2589,7 +2589,7 @@ async function De({
|
|
|
2589
2589
|
}) {
|
|
2590
2590
|
const o = [e];
|
|
2591
2591
|
if (a && o.push(Ie), !q(t)) {
|
|
2592
|
-
const d = await
|
|
2592
|
+
const d = await V("arcgis_knowledge_current_lc_context"), p = lo(t.map, r);
|
|
2593
2593
|
return o.push(d), {
|
|
2594
2594
|
enhancedPrompt: o.join(`
|
|
2595
2595
|
|
|
@@ -2610,7 +2610,7 @@ async function De({
|
|
|
2610
2610
|
bindParameters: i,
|
|
2611
2611
|
allNamedTypesFullyDynamic: !0
|
|
2612
2612
|
};
|
|
2613
|
-
const u = (await
|
|
2613
|
+
const u = (await V("arcgis_knowledge_current_map_context")).replaceAll(
|
|
2614
2614
|
"{nonDynamicTypes}",
|
|
2615
2615
|
JSON.stringify(c)
|
|
2616
2616
|
);
|
|
@@ -2663,7 +2663,7 @@ const W = "addRecords", yo = s.object({
|
|
|
2663
2663
|
enhancedPrompt: i,
|
|
2664
2664
|
bindParameters: c,
|
|
2665
2665
|
allNamedTypesFullyDynamic: u
|
|
2666
|
-
} = await
|
|
2666
|
+
} = await ze({
|
|
2667
2667
|
prompt: e,
|
|
2668
2668
|
view: o,
|
|
2669
2669
|
knowledgeGraph: r,
|
|
@@ -2799,7 +2799,7 @@ const ae = "changeNonspatialVisibility", So = s.object({
|
|
|
2799
2799
|
});
|
|
2800
2800
|
async function xo(e, t, r, a, o) {
|
|
2801
2801
|
let n, l = "";
|
|
2802
|
-
for (let i = 1; i <=
|
|
2802
|
+
for (let i = 1; i <= D; i++) {
|
|
2803
2803
|
const { graphQuery: c, explanation: u } = await de(
|
|
2804
2804
|
e,
|
|
2805
2805
|
t.dataModel,
|
|
@@ -2830,7 +2830,7 @@ Explanation: ${u}`
|
|
|
2830
2830
|
});
|
|
2831
2831
|
} catch (d) {
|
|
2832
2832
|
const p = P(d);
|
|
2833
|
-
if (i >=
|
|
2833
|
+
if (i >= D) {
|
|
2834
2834
|
l = p;
|
|
2835
2835
|
break;
|
|
2836
2836
|
}
|
|
@@ -2846,10 +2846,10 @@ Explanation: ${u}`
|
|
|
2846
2846
|
}
|
|
2847
2847
|
return {
|
|
2848
2848
|
type: "error",
|
|
2849
|
-
errorMessage: `Failed to create link chart after ${
|
|
2849
|
+
errorMessage: `Failed to create link chart after ${D} attempts. Last error: ${l}`
|
|
2850
2850
|
};
|
|
2851
2851
|
}
|
|
2852
|
-
const
|
|
2852
|
+
const B = "createLinkChart", Ro = s.object({
|
|
2853
2853
|
prompt: s.string().describe(
|
|
2854
2854
|
"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."
|
|
2855
2855
|
)
|
|
@@ -2857,7 +2857,7 @@ const V = "createLinkChart", Ro = s.object({
|
|
|
2857
2857
|
const { knowledgeGraph: r } = await M(t), { view: a } = O(t);
|
|
2858
2858
|
if (q(a))
|
|
2859
2859
|
return {
|
|
2860
|
-
toolName:
|
|
2860
|
+
toolName: B,
|
|
2861
2861
|
status: "error",
|
|
2862
2862
|
errorMessage: "The createLinkChart tool can only be used with a LinkChartView.",
|
|
2863
2863
|
error: new Error()
|
|
@@ -2874,14 +2874,14 @@ ${Ie}`,
|
|
|
2874
2874
|
);
|
|
2875
2875
|
if (l.type === "error")
|
|
2876
2876
|
return {
|
|
2877
|
-
toolName:
|
|
2877
|
+
toolName: B,
|
|
2878
2878
|
status: "error",
|
|
2879
2879
|
errorMessage: l.errorMessage,
|
|
2880
2880
|
error: new Error()
|
|
2881
2881
|
};
|
|
2882
2882
|
const { graphQuery: i, explanation: c } = l;
|
|
2883
2883
|
return {
|
|
2884
|
-
toolName:
|
|
2884
|
+
toolName: B,
|
|
2885
2885
|
status: "success",
|
|
2886
2886
|
summary: `Link chart created successfully. Cypher Query used to create the link chart:
|
|
2887
2887
|
${i}
|
|
@@ -2894,7 +2894,7 @@ Explanation: ${c}`,
|
|
|
2894
2894
|
};
|
|
2895
2895
|
}
|
|
2896
2896
|
}, pi = f($o, {
|
|
2897
|
-
name:
|
|
2897
|
+
name: B,
|
|
2898
2898
|
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'.",
|
|
2899
2899
|
schema: Ro
|
|
2900
2900
|
}), oe = "queryGraphData", Co = s.object({
|
|
@@ -2908,7 +2908,7 @@ Explanation: ${c}`,
|
|
|
2908
2908
|
({ view: i } = O(t));
|
|
2909
2909
|
} catch {
|
|
2910
2910
|
}
|
|
2911
|
-
i && ({ enhancedPrompt: n, bindParameters: l } = await
|
|
2911
|
+
i && ({ enhancedPrompt: n, bindParameters: l } = await ze({
|
|
2912
2912
|
prompt: e,
|
|
2913
2913
|
view: i,
|
|
2914
2914
|
knowledgeGraph: r,
|
|
@@ -2939,7 +2939,7 @@ Explanation: ${c}`,
|
|
|
2939
2939
|
const { graphQuery: u, explanation: d, processedResult: p, resultHeader: m } = c, w = m.headerKeys;
|
|
2940
2940
|
for (const g of p)
|
|
2941
2941
|
for (const b of g)
|
|
2942
|
-
|
|
2942
|
+
z(
|
|
2943
2943
|
b,
|
|
2944
2944
|
(v) => ke(v)
|
|
2945
2945
|
);
|
|
@@ -2968,7 +2968,11 @@ ${y.length > h ? `Showing top ${h} results:
|
|
|
2968
2968
|
details: {
|
|
2969
2969
|
generatedQuery: u,
|
|
2970
2970
|
explanation: d,
|
|
2971
|
-
resultHeader:
|
|
2971
|
+
resultHeader: {
|
|
2972
|
+
headerKeys: w,
|
|
2973
|
+
exceededTransferLimit: m.exceededTransferLimit,
|
|
2974
|
+
outSpatialReference: m.outSpatialReference
|
|
2975
|
+
},
|
|
2972
2976
|
queryResults: p
|
|
2973
2977
|
}
|
|
2974
2978
|
};
|
|
@@ -3030,7 +3034,7 @@ ${o.map(({ name: i }) => `${i}: [${Array.from(r.get(i) ?? []).join(", ")}]`).joi
|
|
|
3030
3034
|
${l}`;
|
|
3031
3035
|
};
|
|
3032
3036
|
async function qo(e, t, r) {
|
|
3033
|
-
const a = await
|
|
3037
|
+
const a = await V("arcgis_knowledge_lucene_generation_prompt"), o = {
|
|
3034
3038
|
inquiry: e,
|
|
3035
3039
|
dataModelForSearch: ko(t)
|
|
3036
3040
|
}, 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(
|
|
@@ -3058,7 +3062,7 @@ const ie = "searchGraphData", Io = s.object({
|
|
|
3058
3062
|
prompt: s.string().describe(
|
|
3059
3063
|
"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."
|
|
3060
3064
|
)
|
|
3061
|
-
}),
|
|
3065
|
+
}), zo = async ({ prompt: e }, t) => {
|
|
3062
3066
|
const { knowledgeGraph: r } = await M(t);
|
|
3063
3067
|
await x({ text: "Generating search query for the user inquiry" }, t);
|
|
3064
3068
|
const a = await qo(e, r, t);
|
|
@@ -3082,7 +3086,7 @@ const ie = "searchGraphData", Io = s.object({
|
|
|
3082
3086
|
error: "error" in o ? o.error : null
|
|
3083
3087
|
};
|
|
3084
3088
|
for (const i of o.results)
|
|
3085
|
-
|
|
3089
|
+
z(
|
|
3086
3090
|
i,
|
|
3087
3091
|
(c) => ke(c)
|
|
3088
3092
|
);
|
|
@@ -3107,7 +3111,7 @@ const ie = "searchGraphData", Io = s.object({
|
|
|
3107
3111
|
searchResults: o.results
|
|
3108
3112
|
}
|
|
3109
3113
|
};
|
|
3110
|
-
}, yi = f(
|
|
3114
|
+
}, yi = f(zo, {
|
|
3111
3115
|
name: ie,
|
|
3112
3116
|
description: `
|
|
3113
3117
|
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.
|
|
@@ -3123,8 +3127,8 @@ const ie = "searchGraphData", Io = s.object({
|
|
|
3123
3127
|
});
|
|
3124
3128
|
export {
|
|
3125
3129
|
Wn as A,
|
|
3126
|
-
|
|
3127
|
-
|
|
3130
|
+
Bn as B,
|
|
3131
|
+
Vn as C,
|
|
3128
3132
|
Un as D,
|
|
3129
3133
|
Kn as E,
|
|
3130
3134
|
Hn as F,
|
|
@@ -3148,13 +3152,13 @@ export {
|
|
|
3148
3152
|
pi as d,
|
|
3149
3153
|
ci as e,
|
|
3150
3154
|
xe as f,
|
|
3151
|
-
|
|
3155
|
+
V as g,
|
|
3152
3156
|
li as h,
|
|
3153
3157
|
M as i,
|
|
3154
3158
|
si as j,
|
|
3155
|
-
|
|
3159
|
+
zn as k,
|
|
3156
3160
|
ii as l,
|
|
3157
|
-
|
|
3161
|
+
Dn as m,
|
|
3158
3162
|
Pn as n,
|
|
3159
3163
|
An as o,
|
|
3160
3164
|
Ln as p,
|
package/dist/chunks/runtime.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import "../cdn/main.css";
|
|
3
3
|
import { makeRuntime as e } from "@arcgis/lumina";
|
|
4
4
|
import { trackAccess as s, createObservable as a, createTrackingTarget as r, runTracked as c } from "@arcgis/core/applications/Components/reactiveUtils.js";
|
|
5
|
-
const t = e({ defaultAssetPath: "https://js.arcgis.com/5.1.
|
|
5
|
+
const t = e({ defaultAssetPath: "https://js.arcgis.com/5.1.21/ai-components/", hydratedAttribute: "hydrated" }), { customElement: n, getAssetPath: i, setAssetPath: d } = t;
|
|
6
6
|
t.t = s;
|
|
7
7
|
t.o = a;
|
|
8
8
|
t.c = r;
|