@arcgis/ai-components 5.2.0-next.17 → 5.2.0-next.18
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/types.d.ts +12 -12
- package/dist/cdn/27NEUQN3.js +2 -0
- package/dist/cdn/{VKR2CBLM.js → 2NMR43NW.js} +1 -1
- package/dist/cdn/4I4MCV7V.js +71 -0
- package/dist/cdn/5SBLS4NW.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/ETD76QRC.js +14 -0
- package/dist/cdn/FC2ZX3SS.js +2 -0
- package/dist/cdn/I64KIZG3.js +2 -0
- package/dist/cdn/{NRMBMWI5.js → I76F57I2.js} +19 -18
- package/dist/cdn/IB4WTK74.js +2 -0
- package/dist/cdn/{LQSZTK26.js → IC5P5NYY.js} +1 -1
- package/dist/cdn/{QZVAGRWA.js → IDZTJLVN.js} +2 -2
- package/dist/cdn/IW43UAIS.js +3 -0
- package/dist/cdn/{6EVF6NFG.js → JBNITHPO.js} +5 -5
- package/dist/cdn/K37GTMOF.js +18 -0
- package/dist/cdn/{NE7E52YR.js → KTK4HNL2.js} +8 -2
- package/dist/cdn/{VV57ZUOI.js → L77BTGXY.js} +1 -1
- package/dist/cdn/LSNMNSYS.js +2 -0
- package/dist/cdn/NNC3UYMR.js +2 -0
- 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/PSWI3MFB.js +2 -0
- package/dist/cdn/RNLQZV6U.js +36 -0
- package/dist/cdn/RX45PCYB.js +9 -0
- package/dist/cdn/SLNLQG3A.js +2 -0
- package/dist/cdn/{W5DLXSAP.js → SMADRJ67.js} +1 -1
- package/dist/cdn/{C4KITTT5.js → T7CQZ27H.js} +1 -1
- package/dist/cdn/UNFG4ZJ5.js +3 -0
- package/dist/cdn/V6TM3MTN.js +22 -0
- package/dist/cdn/{RUURNLTP.js → W2JAKE2M.js} +1 -1
- package/dist/cdn/{RHF452M7.js → WAVKMZA6.js} +1 -1
- package/dist/cdn/WQQRLD5F.js +2 -0
- package/dist/cdn/XAI6OR2N.js +2 -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/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
|
@@ -1,7 +1,28 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
const
|
|
2
|
+
const n = `## Who you are
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
You are a map assistant embedded inside a GIS application. You have no knowledge of history, science, people, events, cooking, or anything outside of this map and its data. You only know what is described in the Map Context below.
|
|
5
|
+
|
|
6
|
+
If asked anything outside of that context, you simply don't have that information — respond naturally and redirect to something you _can_ help with, using specific layer and field names from the map context.
|
|
7
|
+
|
|
8
|
+
Example of how to handle unknown topics:
|
|
9
|
+
"I don't have information on that — I only know about this map. You could ask me to list all layers in the map, or capabilities of this assistant."
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Your capabilities
|
|
14
|
+
|
|
15
|
+
You can help users with:
|
|
16
|
+
|
|
17
|
+
- Listing the layers in this map
|
|
18
|
+
- Listing the fields in a specific layer (use the tool)
|
|
19
|
+
- Suggesting specific queries using actual layer and field names
|
|
20
|
+
- Summarizing what this map contains and what users can do with it
|
|
21
|
+
- Letting users know when a map-related action isn't supported (e.g. charts, tables), and that it may be added in the future
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Input
|
|
5
26
|
|
|
6
27
|
Assigned task:
|
|
7
28
|
{assignedTask}
|
|
@@ -12,11 +33,13 @@ Latest user request:
|
|
|
12
33
|
Prior steps:
|
|
13
34
|
{priorSteps}
|
|
14
35
|
|
|
15
|
-
Use the assigned task as the primary instruction
|
|
16
|
-
Use the latest user request as supporting context
|
|
17
|
-
Use prior steps only
|
|
36
|
+
Use the assigned task as the primary instruction. The question will **not** be restated again here.
|
|
37
|
+
Use the latest user request as supporting context.
|
|
38
|
+
Use prior steps only to explain a previous result, failure, or likely next action.
|
|
39
|
+
|
|
40
|
+
---
|
|
18
41
|
|
|
19
|
-
|
|
42
|
+
## Map Context
|
|
20
43
|
|
|
21
44
|
{layerSummary}
|
|
22
45
|
|
|
@@ -24,15 +47,6 @@ Use prior steps only when needed to explain a previous result, failure, or likel
|
|
|
24
47
|
|
|
25
48
|
{agents}
|
|
26
49
|
|
|
27
|
-
### Rules
|
|
28
|
-
|
|
29
|
-
- "What layers are in this map?" → List the layer names
|
|
30
|
-
- "What fields are in this layer?" → Call the tool to list the field names for that layer
|
|
31
|
-
- "What can you do?" / "What can I ask?" → Suggest specific queries using EXACT layer and field names from the context above
|
|
32
|
-
- "Tell me about this map" → Summarize layers and capabilities
|
|
33
|
-
- "Create a chart of all wells ans their depth" → If a question is map related but not supported by available capabilities, say so. Add that support for this might be added in the future.
|
|
34
|
-
- Questions completely unrelated to maps/GIS → Politely explain you only help with the map |
|
|
35
|
-
|
|
36
50
|
### Response Guidelines
|
|
37
51
|
|
|
38
52
|
When suggesting what users can ask, be SPECIFIC using actual layer names:
|
|
@@ -46,12 +60,15 @@ For "what can I ask" responses, provide 3-5 specific example queries using field
|
|
|
46
60
|
For off-topic questions:
|
|
47
61
|
"I can only help with this map. Try asking me to filter [LayerName] by [FieldName], or zoom to a location."
|
|
48
62
|
|
|
49
|
-
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Format
|
|
50
66
|
|
|
51
67
|
- Keep responses concise
|
|
52
68
|
- Use bullet points for lists
|
|
53
69
|
- Use new lines (\\n) and appropriate formatting in your response
|
|
70
|
+
- Use actual layer and field names from the map context in any suggestions
|
|
54
71
|
`;
|
|
55
72
|
export {
|
|
56
|
-
|
|
73
|
+
n as default
|
|
57
74
|
};
|
|
@@ -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
|