@arcgis/ai-components 5.2.0-next.17 → 5.2.0-next.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-utils/index.d.ts +78 -0
- package/dist/agent-utils/index.js +116 -97
- package/dist/agent-utils/middlewares/trace.d.ts +2 -0
- package/dist/agent-utils/types.d.ts +12 -12
- package/dist/cdn/27NEUQN3.js +2 -0
- package/dist/cdn/{VKR2CBLM.js → 2NMR43NW.js} +1 -1
- package/dist/cdn/3YMSOD5D.js +2 -0
- package/dist/cdn/4I4MCV7V.js +71 -0
- package/dist/cdn/5SBLS4NW.js +2 -0
- package/dist/cdn/ASSH4WSC.js +36 -0
- package/dist/cdn/BFPMQT3A.js +2 -0
- package/dist/cdn/{LBSOW7OW.js → C7E7MJSR.js} +1 -1
- package/dist/cdn/{DECSD3LN.js → CIW3QMKV.js} +1 -1
- package/dist/cdn/CVHJMR5X.js +2 -0
- package/dist/cdn/E7TMP4YV.js +3 -0
- package/dist/cdn/{NRMBMWI5.js → EBRNMPPO.js} +19 -18
- package/dist/cdn/GJUD7EA3.js +3 -0
- package/dist/cdn/HCR23HJB.js +2 -0
- package/dist/cdn/I64KIZG3.js +2 -0
- package/dist/cdn/IB4WTK74.js +2 -0
- package/dist/cdn/{LQSZTK26.js → IC5P5NYY.js} +1 -1
- package/dist/cdn/{QZVAGRWA.js → ICA7JOSU.js} +2 -2
- package/dist/cdn/{C4KITTT5.js → IXAKT6L3.js} +1 -1
- package/dist/cdn/{NE7E52YR.js → KTK4HNL2.js} +8 -2
- package/dist/cdn/{6EVF6NFG.js → KTOL6IN7.js} +5 -5
- package/dist/cdn/{VV57ZUOI.js → L77BTGXY.js} +1 -1
- package/dist/cdn/NOJYPREL.js +3 -0
- package/dist/cdn/{FZIT3DLD.js → O3F47IO5.js} +1 -1
- package/dist/cdn/{OLJC5BM3.js → O7TGCM5P.js} +1 -1
- package/dist/cdn/PBTINZTK.js +65 -0
- package/dist/cdn/PDEBKVBO.js +22 -0
- package/dist/cdn/PDT6I6TZ.js +2 -0
- package/dist/cdn/PSWI3MFB.js +2 -0
- package/dist/cdn/ROLXMEVE.js +18 -0
- package/dist/cdn/RX45PCYB.js +9 -0
- package/dist/cdn/{W5DLXSAP.js → SMADRJ67.js} +1 -1
- package/dist/cdn/U53OEX6L.js +2 -0
- package/dist/cdn/VDXSALQI.js +2 -0
- package/dist/cdn/{RUURNLTP.js → W2JAKE2M.js} +1 -1
- package/dist/cdn/{RHF452M7.js → WAVKMZA6.js} +1 -1
- package/dist/cdn/{6ZW7Z36F.js → X7GE26KU.js} +2 -2
- package/dist/cdn/XGS5EIA5.js +14 -0
- package/dist/cdn/YJ3QQXF6.js +2 -0
- package/dist/cdn/{X4UZCTIG.js → YYY7HKYX.js} +1 -1
- package/dist/cdn/agent-utils/index.js +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/converterUtils.js +39 -32
- package/dist/chunks/dataExplorationGraph.js +12 -10
- package/dist/chunks/helpGraph.js +8 -8
- package/dist/chunks/help_prompt.js +34 -17
- package/dist/chunks/intent_prompt.js +2 -2
- package/dist/chunks/navigationGraph.js +4 -4
- package/dist/chunks/navigation_intent_prompt.js +8 -2
- package/dist/chunks/state.js +1 -1
- package/dist/chunks/utils2.js +8 -8
- package/dist/components/arcgis-assistant/customElement.d.ts +7 -0
- package/dist/components/arcgis-assistant/customElement.js +301 -181
- package/dist/components/arcgis-assistant-agent/customElement.js +5 -1
- package/dist/components/arcgis-assistant-chat/customElement.js +22 -17
- package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +9 -5
- package/dist/components/arcgis-assistant-help-agent/customElement.js +6 -2
- package/dist/components/arcgis-assistant-interrupt/customElement.js +4 -4
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +16 -12
- package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +8 -4
- package/dist/components/arcgis-assistant-message-block/customElement.js +1 -1
- package/dist/components/arcgis-assistant-message-text/customElement.d.ts +1 -0
- package/dist/components/arcgis-assistant-message-text/customElement.js +12 -12
- package/dist/components/arcgis-assistant-navigation-agent/customElement.js +9 -5
- package/dist/components/arcgis-assistant-user-message/customElement.js +10 -8
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +2 -2
- package/dist/types/lumina.d.ts +2 -2
- package/dist/types/preact.d.ts +2 -2
- package/dist/types/react.d.ts +2 -2
- package/dist/types/stencil.d.ts +2 -2
- package/dist/utils/index.d.ts +1 -2
- package/package.json +4 -4
- package/dist/cdn/3S7PBYVD.js +0 -2
- package/dist/cdn/5VXRVWAX.js +0 -16
- package/dist/cdn/CE6VDP2D.js +0 -72
- package/dist/cdn/CI3QSFPS.js +0 -2
- package/dist/cdn/F2AHA4GB.js +0 -54
- package/dist/cdn/GPYYAQVI.js +0 -2
- package/dist/cdn/K475UT3E.js +0 -2
- package/dist/cdn/KIQUEMI4.js +0 -14
- package/dist/cdn/NTGC53UD.js +0 -36
- package/dist/cdn/PB2ODJC7.js +0 -2
- package/dist/cdn/SBHLUL3Q.js +0 -2
- package/dist/cdn/TR3OKQPQ.js +0 -22
- package/dist/cdn/WIJRNMBG.js +0 -3
- package/dist/cdn/XBW4MWQR.js +0 -2
- package/dist/cdn/Z7UWJ4AI.js +0 -3
- package/dist/orchestrator/registry/agentRegistry.d.ts +0 -33
|
@@ -99,7 +99,7 @@ Do not reinterpret the request into a different form.
|
|
|
99
99
|
|
|
100
100
|
## Follow-up Reference Resolution
|
|
101
101
|
|
|
102
|
-
If the latest user request refers to prior results or prior context using a referential phrase such as "these", "those", "them", "that set",
|
|
102
|
+
If the latest user request refers to prior results or prior context using a referential phrase such as "these", "those", "them", "that set", "the previous results", "this", "it", "that one", "this parcel", "this location", or "that feature", then the request depends on earlier context.
|
|
103
103
|
|
|
104
104
|
This also applies to equivalent referential wording in other languages.
|
|
105
105
|
|
|
@@ -107,7 +107,7 @@ Resolve the reference using the most recent relevant chat history or successful
|
|
|
107
107
|
|
|
108
108
|
In this case, the \`assignedTask\` should be standalone and should preserve the referenced prior constraints while adding only the new constraint or question from the latest user request.
|
|
109
109
|
|
|
110
|
-
Do not leave ambiguous references like "these", "those", or "
|
|
110
|
+
Do not leave ambiguous references like "these", "those", "them", "this", or "it" in \`assignedTask\` when they can be resolved from context.
|
|
111
111
|
|
|
112
112
|
---
|
|
113
113
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { StateGraph as
|
|
2
|
+
import { StateGraph as E, START as $, END as C } from "@langchain/langgraph/web";
|
|
3
3
|
import { k as F, m as R, n as L, o as M, p as A, u as _, v as I, w as q, x as Z, g as T, y as k, t as j, f as u, r as P, N as w } from "./adapter.js";
|
|
4
4
|
import "@arcgis/core/identity/IdentityManager.js";
|
|
5
5
|
import "@arcgis/core/portal/Portal.js";
|
|
@@ -29,7 +29,7 @@ const S = [
|
|
|
29
29
|
];
|
|
30
30
|
async function O(e, t) {
|
|
31
31
|
const o = await T("navigation_tool_prompt"), { mapView: s } = k(t), i = s.map.bookmarks?.map((p) => p.name).filter(Boolean) ?? [], l = e.vectorSearchLayerResults?.length > 0 ? e.vectorSearchLayerResults.map(
|
|
32
|
-
(p,
|
|
32
|
+
(p, b) => `${b + 1}. layerId=${p.id} | title=${p.title ?? ""} | name=${p.name ?? ""} | score=${p.score.toFixed(2)}`
|
|
33
33
|
).join(`
|
|
34
34
|
`) : "", c = e.vectorSearchFieldResults?.length > 0 ? JSON.stringify(e.vectorSearchFieldResults, null, 2) : "", a = e.intent === "goToBookmark" && i.length ? `Available bookmarks:
|
|
35
35
|
${i.map((p) => `- ${p}`).join(`
|
|
@@ -126,7 +126,7 @@ async function J(e, t) {
|
|
|
126
126
|
schema: n.schema
|
|
127
127
|
})), l = s.map.bookmarks?.map((n) => n.name).filter(Boolean) ?? [], c = l.length ? `Available bookmarks:
|
|
128
128
|
${l.map((n) => `- ${n}`).join(`
|
|
129
|
-
`)}` : "", a = {
|
|
129
|
+
`)}` : "No bookmarks are available in this map.", a = {
|
|
130
130
|
tools: g.map(({ name: n, description: m, schema: v }) => `${n}: ${m}, ${JSON.stringify(v)}`).join(`
|
|
131
131
|
`),
|
|
132
132
|
bookmarks: c,
|
|
@@ -226,7 +226,7 @@ ${r.results.map((d) => ` - ${d.name} (${d.score.toFixed(2)})`).join(`
|
|
|
226
226
|
t
|
|
227
227
|
), o;
|
|
228
228
|
}
|
|
229
|
-
}, Q = (e, t) => P(["layerSearch", "layersAndFieldsRegistry"], "Navigation Agent")(e, t), X = () => new
|
|
229
|
+
}, Q = (e, t) => P(["layerSearch", "layersAndFieldsRegistry"], "Navigation Agent")(e, t), X = () => new E(w).addNode("requireNavigationServices", Q).addNode("intentLLM", J).addNode("vectorSearchLayers", U).addNode("vectorSearchFields", K).addNode("agent", O).addNode("tools", D).addEdge($, "requireNavigationServices").addEdge("requireNavigationServices", "intentLLM").addConditionalEdges(
|
|
230
230
|
"intentLLM",
|
|
231
231
|
(t) => t.intent === "goToLayer" || t.intent === "goToFeatures" ? "vectorSearchLayers" : "agent",
|
|
232
232
|
{
|
|
@@ -36,8 +36,14 @@ This is the order of preference in case of overlap:
|
|
|
36
36
|
|
|
37
37
|
For example, "Where is Yosemite National Park". This is an address, but:
|
|
38
38
|
A map that contains a bookmark with Yosemite National Park should prefer the bookmark.
|
|
39
|
-
|
|
40
|
-
If these do not exist, geocode and go to that address.
|
|
39
|
+
If bookmark does not exist, a map that has the National Parks layer, for example, should prefer the feature.
|
|
40
|
+
If both of these do not exist, geocode and go to that address.
|
|
41
|
+
|
|
42
|
+
Additional mapping guidance:
|
|
43
|
+
|
|
44
|
+
- "zoom/go to [layer]" with no filter → prefer \`goToLayer\`.
|
|
45
|
+
- "zoom/go to [features] where/with ..." (has a condition/filter) → prefer \`goToFeatures\`.
|
|
46
|
+
- Explicit numeric zoom/scale/viewpoint requests → prefer the matching zoom/scale/viewpoint tool.
|
|
41
47
|
|
|
42
48
|
Return the name of the tool as a string.
|
|
43
49
|
`;
|
package/dist/chunks/state.js
CHANGED
|
@@ -13,7 +13,7 @@ function u() {
|
|
|
13
13
|
function i(r) {
|
|
14
14
|
const n = [...new Set([...r].filter((t) => c.has(t)))];
|
|
15
15
|
if (n.length !== 0)
|
|
16
|
-
throw new Error(`
|
|
16
|
+
throw new Error(`custom state cannot define reserved runtime fields: ${n.join(", ")}.`);
|
|
17
17
|
}
|
|
18
18
|
function f(r) {
|
|
19
19
|
const n = Object.entries(r);
|
package/dist/chunks/utils2.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
import { getClosestElement as i } from "@arcgis/toolkit/dom";
|
|
3
|
-
import { g as
|
|
3
|
+
import { g as s, a as o } from "./utils3.js";
|
|
4
4
|
function c(e, t) {
|
|
5
|
-
const
|
|
6
|
-
if (
|
|
7
|
-
return
|
|
8
|
-
const n = i(e.el, "arcgis-assistant"), a =
|
|
5
|
+
const r = s(e.el, e.referenceElement);
|
|
6
|
+
if (r)
|
|
7
|
+
return r;
|
|
8
|
+
const n = i(e.el, "arcgis-assistant"), a = s(e.el, n?.referenceElement);
|
|
9
9
|
if (a)
|
|
10
10
|
return a;
|
|
11
11
|
throw new Error(`${t}: Reference element not found`);
|
|
@@ -23,16 +23,16 @@ function g(e) {
|
|
|
23
23
|
const t = i(e.el, "arcgis-assistant");
|
|
24
24
|
if (t === void 0)
|
|
25
25
|
throw new Error("arcgis-assistant-agent must be used within an arcgis-assistant element");
|
|
26
|
-
t.register({
|
|
26
|
+
return t.register({
|
|
27
27
|
agent: e.agent,
|
|
28
28
|
getContext: async () => await e.getContext?.() ?? e.context ?? {}
|
|
29
|
-
});
|
|
29
|
+
}), t;
|
|
30
30
|
}
|
|
31
31
|
function l(e) {
|
|
32
32
|
const t = o(e.el, e.referenceElement);
|
|
33
33
|
if (t)
|
|
34
34
|
return t;
|
|
35
|
-
const
|
|
35
|
+
const r = i(e.el, "arcgis-assistant"), n = s(e.el, r?.referenceElement);
|
|
36
36
|
return n || null;
|
|
37
37
|
}
|
|
38
38
|
function v(e) {
|
|
@@ -277,6 +277,13 @@ export abstract class ArcgisAssistant extends LitElement {
|
|
|
277
277
|
* ```
|
|
278
278
|
*/
|
|
279
279
|
accessor referenceElement: ArcgisMap | string | null;
|
|
280
|
+
/**
|
|
281
|
+
* When `true`, assistant text responses render after completion instead of streaming progressively.
|
|
282
|
+
*
|
|
283
|
+
* @default false
|
|
284
|
+
* @since 5.1
|
|
285
|
+
*/
|
|
286
|
+
accessor streamingDisabled: boolean;
|
|
280
287
|
/**
|
|
281
288
|
* Prompts to suggest to the end user on load. These are intended to help users understand which questions they can ask.
|
|
282
289
|
* This property should be set to establish boundaries for the end user. As all agents have limitations and LLMs can
|