@arcgis/ai-agents 5.1.0-next.66 → 5.1.0-next.68

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.
@@ -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;
@@ -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 user's request.
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. **User explicitly asks for a DIFFERENT set of features** than what the query returned (e.g., query found declined apps but user says "now highlight the approved ones"), OR the user asks to clear/reset filters → generate a new WHERE clause using the rules in "Generating new WHERE clauses" below.
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 user asked to "show", "find", "locate", or "where is" something
48
- - The user asked a question that identifies specific features (e.g., "which has the highest...?", "find all X that are Y")
49
- - The user wants to clear or reset filters of the map
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 user asked a pure aggregate/statistical question (e.g., "what is the average?", "how many total?")
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 user's question was fully answered by the query step with no need for map interaction
59
- - Even if objectIds are available in the query response, do not highlight features unless the user explicitly asked to see, show, highlight or emphasize them
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 user explicitly asked for a different feature set.
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:
@@ -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 user's request and construct appropriate query parameters for each relevant layer. Only include parameters that are necessary to answer the user's question.
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 user asks for a filter that requires a field not present in the list above, do not invent the field and do not include it.
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
- Use the most recent relevant user question from the chat history.
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 user explicitly references previous results (see "Referencing Previously Identified Features" below).
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 user uses words like "these", "those", "them", "the same ones" referring to features from a previous turn:
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 user request 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.
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 most recent user question from the chat history and the provided layer and field information.
114
- 2. Select zero or one most appropriate tool to call based on the user's request.
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
- Look at the **latest** user message from the chat history.
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