@arcgis/ai-agents 5.1.0-next.67 → 5.1.0-next.69
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/agents/dataExploration/state/dataExplorationState.d.ts +3 -1
- package/dist/agents/help/state/helpState.d.ts +3 -1
- package/dist/agents/navigation/state/navigationState.d.ts +3 -1
- package/dist/{data_explore_filter_prompt-DoHzvzv1.js → data_explore_filter_prompt-g9GTTJyj.js} +22 -9
- package/dist/{data_explore_query_prompt-q72F4eFI.js → data_explore_query_prompt-DqJVadVm.js} +20 -8
- package/dist/{help_prompt-9_7NHCT0.js → help_prompt-CZjpixev.js} +14 -1
- package/dist/index.js +808 -742
- package/dist/{navigation_intent_prompt-zcuSWrlv.js → navigation_intent_prompt-CN4nx_RC.js} +15 -3
- package/dist/navigation_tool_prompt-B-SYvVbG.js +39 -0
- package/dist/{summarize_query_response_prompt-B9bQLnuT.js → summarize_query_response_prompt-DHuLLiUo.js} +17 -3
- package/dist/utils/contextSelectors.d.ts +0 -9
- package/dist/utils/reducers.d.ts +1 -0
- package/package.json +2 -2
- package/dist/navigation_tool_prompt-C2jIBkeu.js +0 -27
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { AgentExecutionContext, VectorSearchFieldResults } from '@arcgis/ai-orchestrator';
|
|
1
|
+
import { AgentExecutionContext, AgentStatus, VectorSearchFieldResults } from '@arcgis/ai-orchestrator';
|
|
2
2
|
import { QueryResponse } from '../types/types';
|
|
3
3
|
import { LayerFieldInfo } from '../../../types/types';
|
|
4
4
|
export declare const DataExplorationState: import('@langchain/langgraph/web').AnnotationRoot<{
|
|
5
5
|
agentExecutionContext: import('@langchain/langgraph/web').BaseChannel<AgentExecutionContext, AgentExecutionContext | import('@langchain/langgraph/web').OverwriteValue<AgentExecutionContext>, unknown>;
|
|
6
6
|
outputMessage: import('@langchain/langgraph/web').BaseChannel<string, string | import('@langchain/langgraph/web').OverwriteValue<string>, unknown>;
|
|
7
|
+
summary: import('@langchain/langgraph/web').BaseChannel<string, string | import('@langchain/langgraph/web').OverwriteValue<string>, unknown>;
|
|
8
|
+
status: import('@langchain/langgraph/web').BaseChannel<AgentStatus, AgentStatus | import('@langchain/langgraph/web').OverwriteValue<AgentStatus>, unknown>;
|
|
7
9
|
vectorSearchLayerIds: import('@langchain/langgraph/web').LastValue<string[]>;
|
|
8
10
|
vectorSearchFieldResults: import('@langchain/langgraph/web').LastValue<VectorSearchFieldResults>;
|
|
9
11
|
layerFieldInfo: import('@langchain/langgraph/web').LastValue<LayerFieldInfo>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { AgentExecutionContext } from '@arcgis/ai-orchestrator';
|
|
1
|
+
import { AgentExecutionContext, AgentStatus } from '@arcgis/ai-orchestrator';
|
|
2
2
|
export declare const HelpState: import('@langchain/langgraph/web').AnnotationRoot<{
|
|
3
3
|
agentExecutionContext: import('@langchain/langgraph/web').BaseChannel<AgentExecutionContext, AgentExecutionContext | import('@langchain/langgraph/web').OverwriteValue<AgentExecutionContext>, unknown>;
|
|
4
4
|
outputMessage: import('@langchain/langgraph/web').BaseChannel<string, string | import('@langchain/langgraph/web').OverwriteValue<string>, unknown>;
|
|
5
|
+
summary: import('@langchain/langgraph/web').BaseChannel<string, string | import('@langchain/langgraph/web').OverwriteValue<string>, unknown>;
|
|
6
|
+
status: import('@langchain/langgraph/web').BaseChannel<AgentStatus, AgentStatus | import('@langchain/langgraph/web').OverwriteValue<AgentStatus>, unknown>;
|
|
5
7
|
}>;
|
|
6
8
|
export type HelpGraphStateType = typeof HelpState.State;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { VectorSearchFieldResults, AgentExecutionContext } from '@arcgis/ai-orchestrator';
|
|
1
|
+
import { VectorSearchFieldResults, AgentExecutionContext, AgentStatus } from '@arcgis/ai-orchestrator';
|
|
2
2
|
export declare const NavigationState: import('@langchain/langgraph/web').AnnotationRoot<{
|
|
3
3
|
agentExecutionContext: import('@langchain/langgraph/web').BaseChannel<AgentExecutionContext, AgentExecutionContext | import('@langchain/langgraph/web').OverwriteValue<AgentExecutionContext>, unknown>;
|
|
4
4
|
outputMessage: import('@langchain/langgraph/web').BaseChannel<string, string | import('@langchain/langgraph/web').OverwriteValue<string>, unknown>;
|
|
5
|
+
summary: import('@langchain/langgraph/web').BaseChannel<string, string | import('@langchain/langgraph/web').OverwriteValue<string>, unknown>;
|
|
6
|
+
status: import('@langchain/langgraph/web').BaseChannel<AgentStatus, AgentStatus | import('@langchain/langgraph/web').OverwriteValue<AgentStatus>, unknown>;
|
|
5
7
|
intent: import('@langchain/langgraph/web').BaseChannel<string, string | import('@langchain/langgraph/web').OverwriteValue<string>, unknown>;
|
|
6
8
|
vectorSearchLayerResults: import('@langchain/langgraph/web').BaseChannel<{
|
|
7
9
|
id: string;
|
package/dist/{data_explore_filter_prompt-DoHzvzv1.js → data_explore_filter_prompt-g9GTTJyj.js}
RENAMED
|
@@ -2,10 +2,23 @@ const e = `# ArcGIS Online Map Viewer — Layer Filter Tool Calling Assistant
|
|
|
2
2
|
|
|
3
3
|
You are an assistant that helps manage layer filters and visual effects for **ArcGIS Online Map Viewer** by selecting and calling the appropriate tool.
|
|
4
4
|
|
|
5
|
-
You may make **zero or one** tool call based on the
|
|
5
|
+
You may make **zero or one** tool call based on the assigned task.
|
|
6
6
|
|
|
7
7
|
## You are given:
|
|
8
8
|
|
|
9
|
+
Assigned task:
|
|
10
|
+
{assignedTask}
|
|
11
|
+
|
|
12
|
+
Latest user request:
|
|
13
|
+
{userRequest}
|
|
14
|
+
|
|
15
|
+
Prior steps:
|
|
16
|
+
{priorSteps}
|
|
17
|
+
|
|
18
|
+
Use the assigned task as the primary instruction for the current query.
|
|
19
|
+
Use the latest user request as supporting context when needed.
|
|
20
|
+
Use prior steps only when the assigned task clearly depends on earlier results.
|
|
21
|
+
|
|
9
22
|
A list of layers, with layerId, layerSummary and each with associated field information
|
|
10
23
|
{layerFieldInfo}
|
|
11
24
|
|
|
@@ -34,7 +47,7 @@ Use the FIRST rule that matches:
|
|
|
34
47
|
|
|
35
48
|
2. **queryResponse includes a \`where\` clause** → copy that exact \`where\` string and the \`layerId\` into \`targetLayer\`. Do NOT regenerate, rephrase, or simplify it.
|
|
36
49
|
|
|
37
|
-
3. **
|
|
50
|
+
3. **Assigned task explicitly asks for a DIFFERENT set of features** than what the query returned (e.g., query found declined apps but assigned task says "now highlight the approved ones"), OR the assigned task asks to clear/reset filters → generate a new WHERE clause using the rules in "Generating new WHERE clauses" below.
|
|
38
51
|
|
|
39
52
|
### Also forward geometryFilter and useCurrentExtent
|
|
40
53
|
|
|
@@ -44,23 +57,23 @@ If the query tool call in the message history used a \`geometryFilter\` (spatial
|
|
|
44
57
|
|
|
45
58
|
ALWAYS call a tool when:
|
|
46
59
|
|
|
47
|
-
- The
|
|
48
|
-
- The
|
|
49
|
-
- The
|
|
60
|
+
- The assigned task asked to "show", "find", "locate", or "where is" something
|
|
61
|
+
- The assigned task asked a question that identifies specific features (e.g., "which has the highest...?", "find all X that are Y")
|
|
62
|
+
- The assigned task wants to clear or reset filters of the map
|
|
50
63
|
|
|
51
64
|
### No tool call
|
|
52
65
|
|
|
53
66
|
Make no tool call when:
|
|
54
67
|
|
|
55
68
|
- The query returned zero features
|
|
56
|
-
- The
|
|
69
|
+
- The assigned task asked a pure aggregate/statistical question (e.g., "what is the average?", "how many total?")
|
|
57
70
|
- No meaningful filter can be generated
|
|
58
|
-
- The
|
|
59
|
-
- Even if objectIds are available in the query response, do not highlight features unless the
|
|
71
|
+
- The assigned task was fully answered by the query step with no need for map interaction
|
|
72
|
+
- Even if objectIds are available in the query response, do not highlight features unless the assigned task explicitly asked to see, show, highlight or emphasize them
|
|
60
73
|
|
|
61
74
|
## Generating new WHERE clauses (exception case only)
|
|
62
75
|
|
|
63
|
-
Only use these rules when rule 3 above applies — i.e., the
|
|
76
|
+
Only use these rules when rule 3 above applies — i.e., the assigned task explicitly asked for a different feature set.
|
|
64
77
|
|
|
65
78
|
- Use only the field's **\`name\`** in the expression — not the alias.
|
|
66
79
|
- Use field \`type\` to choose operators:
|
package/dist/{data_explore_query_prompt-q72F4eFI.js → data_explore_query_prompt-DqJVadVm.js}
RENAMED
|
@@ -2,7 +2,7 @@ const e = `# ArcGIS JavaScript SDK FeatureLayerView Query Assistant
|
|
|
2
2
|
|
|
3
3
|
You are a GIS assistant that generates query parameters for the ArcGIS JavaScript SDK FeatureLayerView \`queryFeatures()\` method.
|
|
4
4
|
|
|
5
|
-
Analyze the
|
|
5
|
+
Analyze the assigned task and construct appropriate query parameters for each relevant layer. Only include parameters that are necessary to answer the assigned task.
|
|
6
6
|
|
|
7
7
|
## Layer and Field Information
|
|
8
8
|
|
|
@@ -15,7 +15,7 @@ You are only allowed to use the field names listed under each layer. Do not inve
|
|
|
15
15
|
|
|
16
16
|
## Critical Guard — Do NOT Hallucinate Fields
|
|
17
17
|
|
|
18
|
-
If the
|
|
18
|
+
If the assigned task asks for a filter that requires a field not present in the list above, do not invent the field and do not include it.
|
|
19
19
|
|
|
20
20
|
Instead:
|
|
21
21
|
If you can still answer something with the allowed fields, do so (for example: return an unfiltered count).
|
|
@@ -26,11 +26,23 @@ Validator: Before producing output, verify every field used exists in the listed
|
|
|
26
26
|
|
|
27
27
|
## Input
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
Assigned task:
|
|
30
|
+
{assignedTask}
|
|
31
|
+
|
|
32
|
+
Latest user request:
|
|
33
|
+
{userRequest}
|
|
34
|
+
|
|
35
|
+
Prior steps:
|
|
36
|
+
{priorSteps}
|
|
37
|
+
|
|
38
|
+
Use the assigned task as the primary instruction for the current query.
|
|
39
|
+
Use the latest user request as supporting context when needed.
|
|
40
|
+
Use prior steps only when the assigned task or user request clearly depends on earlier results.
|
|
41
|
+
Use chat history only when necessary to understand conversational references, and do not override the assigned task.
|
|
30
42
|
|
|
31
43
|
### Fresh WHERE clause rule
|
|
32
44
|
|
|
33
|
-
Start with a fresh WHERE clause for each new question. Do not inherit filters from previous questions UNLESS the
|
|
45
|
+
Start with a fresh WHERE clause for each new question. Do not inherit filters from previous questions UNLESS the assigned task explicitly references previous results (see "Referencing Previously Identified Features" below).
|
|
34
46
|
|
|
35
47
|
### Rules for generating WHERE clause SQL expressions:
|
|
36
48
|
|
|
@@ -50,7 +62,7 @@ Start with a fresh WHERE clause for each new question. Do not inherit filters fr
|
|
|
50
62
|
|
|
51
63
|
This is an exception to the "fresh WHERE clause" rule above.
|
|
52
64
|
|
|
53
|
-
When the
|
|
65
|
+
When the assigned task uses words like "these", "those", "them", "the same ones" referring to features from a previous turn:
|
|
54
66
|
|
|
55
67
|
- If the previous query used useCurrentExtent: true → use useCurrentExtent: true with where: "1=1"
|
|
56
68
|
- If the previous assistant response mentions specific objectIds or feature IDs → use {{objectIdField}} IN (id1, id2, ...) to scope to those features
|
|
@@ -94,7 +106,7 @@ not a large collection that requires union operations.
|
|
|
94
106
|
|
|
95
107
|
### NOTE:
|
|
96
108
|
|
|
97
|
-
If the
|
|
109
|
+
If the assigned task includes no filter (where: 1=1) and the answer can be derived from precomputed fieldStatistics, do NOT call a tool. Instead, respond directly using the provided statistics.
|
|
98
110
|
|
|
99
111
|
If you cannot answer directly, you MUST call a tool.
|
|
100
112
|
|
|
@@ -110,8 +122,8 @@ Format: \`TIMESTAMP 'YYYY-MM-DD HH:MM:SS'\`
|
|
|
110
122
|
|
|
111
123
|
## Your Task
|
|
112
124
|
|
|
113
|
-
1. Analyze the
|
|
114
|
-
2. Select zero or one most appropriate tool to call based on the
|
|
125
|
+
1. Analyze the assigned task and the provided layer and field information.
|
|
126
|
+
2. Select zero or one most appropriate tool to call based on the assigned task.
|
|
115
127
|
`;
|
|
116
128
|
export {
|
|
117
129
|
e as default
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
const e = `## Map Query Gate
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
### Input
|
|
4
|
+
|
|
5
|
+
Assigned task:
|
|
6
|
+
{assignedTask}
|
|
7
|
+
|
|
8
|
+
Latest user request:
|
|
9
|
+
{userRequest}
|
|
10
|
+
|
|
11
|
+
Prior steps:
|
|
12
|
+
{priorSteps}
|
|
13
|
+
|
|
14
|
+
Use the assigned task as the primary instruction for the current query. The question will **not** be restated again here.
|
|
15
|
+
Use the latest user request as supporting context when needed.
|
|
16
|
+
Use prior steps only when needed to explain a previous result, failure, or likely next action.
|
|
4
17
|
|
|
5
18
|
### Map Context
|
|
6
19
|
|