@arcgis/ai-agents 5.1.0-next.93 → 5.1.0-next.95

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,11 +1,11 @@
1
- import { AgentExecutionContext, AgentStatus, ChatHistory } from '@arcgis/ai-orchestrator';
1
+ import { ChatHistory } from '@arcgis/ai-orchestrator';
2
2
  export declare const arcgisKnowledgeState: import('@langchain/langgraph/web').AnnotationRoot<{
3
- agentExecutionContext: import('@langchain/langgraph/web').BaseChannel<AgentExecutionContext, AgentExecutionContext | import('@langchain/langgraph/web').OverwriteValue<AgentExecutionContext>, unknown>;
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>;
7
3
  intent: import('@langchain/langgraph/web').BaseChannel<string, string | import('@langchain/langgraph/web').OverwriteValue<string>, unknown>;
8
4
  arcgisKnowledgeMessages: import('@langchain/langgraph/web').BaseChannel<ChatHistory, ChatHistory | import('@langchain/langgraph/web').OverwriteValue<ChatHistory>, unknown>;
5
+ agentExecutionContext: import('@langchain/langgraph/web').BaseChannel<import('@arcgis/ai-orchestrator').AgentExecutionContext, unknown, unknown>;
6
+ outputMessage: import('@langchain/langgraph/web').BaseChannel<string, unknown, unknown>;
7
+ summary: import('@langchain/langgraph/web').BaseChannel<string, unknown, unknown>;
8
+ status: import('@langchain/langgraph/web').BaseChannel<import('@arcgis/ai-orchestrator').AgentStatus | undefined, unknown, unknown>;
9
9
  }>;
10
10
  export type ArcgisKnowledgeGraphStateType = typeof arcgisKnowledgeState.State;
11
11
  export declare const arcgisKnowledgeServerSkillState: {
@@ -47,7 +47,13 @@ export declare const arcgisKnowledgeTools: (import('@langchain/core/tools').Dyna
47
47
  prompt: string;
48
48
  }, {
49
49
  prompt: string;
50
- }, string, unknown, "generateCypher">)[];
50
+ }, string, unknown, "generateCypher"> | import('@langchain/core/tools').DynamicStructuredTool<import('zod').ZodObject<{
51
+ prompt: import('zod').ZodString;
52
+ }, import('zod/v4/core').$strip>, {
53
+ prompt: string;
54
+ }, {
55
+ prompt: string;
56
+ }, string, unknown, "searchGraphData">)[];
51
57
  export declare const arcgisKnowledgeServerSkills: (import('@langchain/core/tools').DynamicStructuredTool<import('zod').ZodObject<{
52
58
  prompt: import('zod').ZodString;
53
59
  }, import('zod/v4/core').$strip>, {
@@ -0,0 +1,8 @@
1
+ import { default as z } from 'zod';
2
+ export declare const searchGraphData: import('@langchain/core/tools').DynamicStructuredTool<z.ZodObject<{
3
+ prompt: z.ZodString;
4
+ }, z.core.$strip>, {
5
+ prompt: string;
6
+ }, {
7
+ prompt: string;
8
+ }, string, unknown, "searchGraphData">;
@@ -0,0 +1 @@
1
+ export * from './adapter.js';
@@ -1,8 +1,9 @@
1
1
  import { GraphAnyValue } from '@arcgis/core/rest/knowledgeGraph/GraphAnyValue.js';
2
- import { default as GraphQueryStreaming } from '@arcgis/core/rest/knowledgeGraph/GraphQueryStreaming.js';
3
2
  import { default as KnowledgeGraph } from '@arcgis/core/rest/knowledgeGraph/KnowledgeGraph.js';
4
- import { default as GraphQueryResultHeader } from '@arcgis/core/rest/knowledgeGraph/GraphQueryResultHeader.js';
5
3
  import { RequestOptions } from '@arcgis/core/request/types.js';
4
+ import { default as GraphNamedObject } from '@arcgis/core/rest/knowledgeGraph/GraphNamedObject.js';
5
+ import { default as GraphQueryStreaming } from '@arcgis/core/rest/knowledgeGraph/GraphQueryStreaming.js';
6
+ import { default as GraphQueryResultHeader } from '@arcgis/core/rest/knowledgeGraph/GraphQueryResultHeader.js';
6
7
  type RunCypherQueryResult<T> = {
7
8
  type: "aborted";
8
9
  } | {
@@ -26,4 +27,23 @@ export declare const runCypherQueryAndReduce: <T>({ kg, queryParams, targetStruc
26
27
  queryRowLimit?: number;
27
28
  queryTimeoutMs?: number;
28
29
  }) => Promise<RunCypherQueryResult<T>>;
30
+ export declare const getLabelForGraphNamedObject: (kg: KnowledgeGraph, obj: GraphNamedObject) => string;
31
+ type RunGraphSearchResult = {
32
+ type: "error";
33
+ errorMessage: string;
34
+ error: unknown;
35
+ } | {
36
+ type: "success";
37
+ results: GraphNamedObject[];
38
+ } | {
39
+ type: "aborted";
40
+ };
41
+ export declare const runGraphSearch: ({ kg, searchQuery, typeCategoryFilter, namedTypesFilter, searchResultLimit, requestOptions, }: {
42
+ kg: KnowledgeGraph;
43
+ searchQuery: string;
44
+ typeCategoryFilter: "both" | "entity" | "relationship";
45
+ namedTypesFilter: string[] | null;
46
+ searchResultLimit: number | null;
47
+ requestOptions?: RequestOptions;
48
+ }) => Promise<RunGraphSearchResult>;
29
49
  export {};
@@ -1,15 +1,15 @@
1
- import { AgentExecutionContext, AgentStatus, ChatHistory, VectorSearchFieldResults } from '@arcgis/ai-orchestrator';
1
+ import { ChatHistory, 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
- agentExecutionContext: import('@langchain/langgraph/web').BaseChannel<AgentExecutionContext, AgentExecutionContext | import('@langchain/langgraph/web').OverwriteValue<AgentExecutionContext>, unknown>;
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>;
9
5
  vectorSearchLayerIds: import('@langchain/langgraph/web').LastValue<string[]>;
10
6
  vectorSearchFieldResults: import('@langchain/langgraph/web').LastValue<VectorSearchFieldResults>;
11
7
  layerFieldInfo: import('@langchain/langgraph/web').LastValue<LayerFieldInfo>;
12
8
  queryResponse: import('@langchain/langgraph/web').LastValue<QueryResponse[]>;
13
9
  dataExplorationMessages: import('@langchain/langgraph/web').BaseChannel<ChatHistory, ChatHistory | import('@langchain/langgraph/web').OverwriteValue<ChatHistory>, unknown>;
10
+ agentExecutionContext: import('@langchain/langgraph/web').BaseChannel<import('@arcgis/ai-orchestrator').AgentExecutionContext, unknown, unknown>;
11
+ outputMessage: import('@langchain/langgraph/web').BaseChannel<string, unknown, unknown>;
12
+ summary: import('@langchain/langgraph/web').BaseChannel<string, unknown, unknown>;
13
+ status: import('@langchain/langgraph/web').BaseChannel<import('@arcgis/ai-orchestrator').AgentStatus | undefined, unknown, unknown>;
14
14
  }>;
15
15
  export type DataExplorationGraphStateType = typeof DataExplorationState.State;
@@ -1,10 +1,9 @@
1
- import { AgentExecutionContext, AgentStatus } from '@arcgis/ai-orchestrator';
2
1
  import { HelpInternalState } from '../types/types';
3
2
  export declare const HelpState: import('@langchain/langgraph/web').AnnotationRoot<{
4
- agentExecutionContext: import('@langchain/langgraph/web').BaseChannel<AgentExecutionContext, AgentExecutionContext | import('@langchain/langgraph/web').OverwriteValue<AgentExecutionContext>, unknown>;
5
- outputMessage: import('@langchain/langgraph/web').BaseChannel<string, string | import('@langchain/langgraph/web').OverwriteValue<string>, unknown>;
6
- summary: import('@langchain/langgraph/web').BaseChannel<string, string | import('@langchain/langgraph/web').OverwriteValue<string>, unknown>;
7
- status: import('@langchain/langgraph/web').BaseChannel<AgentStatus, AgentStatus | import('@langchain/langgraph/web').OverwriteValue<AgentStatus>, unknown>;
8
3
  helpInternalState: import('@langchain/langgraph/web').BaseChannel<HelpInternalState, HelpInternalState | import('@langchain/langgraph/web').OverwriteValue<HelpInternalState>, unknown>;
4
+ agentExecutionContext: import('@langchain/langgraph/web').BaseChannel<import('@arcgis/ai-orchestrator').AgentExecutionContext, unknown, unknown>;
5
+ outputMessage: import('@langchain/langgraph/web').BaseChannel<string, unknown, unknown>;
6
+ summary: import('@langchain/langgraph/web').BaseChannel<string, unknown, unknown>;
7
+ status: import('@langchain/langgraph/web').BaseChannel<import('@arcgis/ai-orchestrator').AgentStatus | undefined, unknown, unknown>;
9
8
  }>;
10
9
  export type HelpGraphStateType = typeof HelpState.State;
@@ -1,11 +1,13 @@
1
- import { AgentExecutionContext, VectorSearchFieldResults } from '@arcgis/ai-orchestrator';
1
+ import { VectorSearchFieldResults } from '@arcgis/ai-orchestrator';
2
2
  import { LayerFieldInfo } from '../../../types/types';
3
3
  export declare const LayerStylingState: import('@langchain/langgraph/web').AnnotationRoot<{
4
- agentExecutionContext: import('@langchain/langgraph/web').BaseChannel<AgentExecutionContext, AgentExecutionContext | import('@langchain/langgraph/web').OverwriteValue<AgentExecutionContext>, unknown>;
5
- outputMessage: import('@langchain/langgraph/web').BaseChannel<string, string | import('@langchain/langgraph/web').OverwriteValue<string>, unknown>;
6
4
  vectorSearchLayerIds: import('@langchain/langgraph/web').LastValue<string[]>;
7
5
  vectorSearchFieldResults: import('@langchain/langgraph/web').LastValue<VectorSearchFieldResults>;
8
6
  layerFieldInfo: import('@langchain/langgraph/web').LastValue<LayerFieldInfo>;
9
7
  selectedLayerId: import('@langchain/langgraph/web').LastValue<string>;
8
+ agentExecutionContext: import('@langchain/langgraph/web').BaseChannel<import('@arcgis/ai-orchestrator').AgentExecutionContext, unknown, unknown>;
9
+ outputMessage: import('@langchain/langgraph/web').BaseChannel<string, unknown, unknown>;
10
+ summary: import('@langchain/langgraph/web').BaseChannel<string, unknown, unknown>;
11
+ status: import('@langchain/langgraph/web').BaseChannel<import('@arcgis/ai-orchestrator').AgentStatus | undefined, unknown, unknown>;
10
12
  }>;
11
13
  export type LayerStylingGraphStateType = typeof LayerStylingState.State;
@@ -1,11 +1,6 @@
1
- import { VectorSearchFieldResults, AgentExecutionContext, AgentStatus, SharedStatePatch } from '@arcgis/ai-orchestrator';
1
+ import { VectorSearchFieldResults } from '@arcgis/ai-orchestrator';
2
2
  import { NavigationInternalState } from '../types/types';
3
3
  export declare const NavigationState: import('@langchain/langgraph/web').AnnotationRoot<{
4
- agentExecutionContext: import('@langchain/langgraph/web').BaseChannel<AgentExecutionContext, AgentExecutionContext | import('@langchain/langgraph/web').OverwriteValue<AgentExecutionContext>, unknown>;
5
- outputMessage: import('@langchain/langgraph/web').BaseChannel<string, string | import('@langchain/langgraph/web').OverwriteValue<string>, unknown>;
6
- summary: import('@langchain/langgraph/web').BaseChannel<string, string | import('@langchain/langgraph/web').OverwriteValue<string>, unknown>;
7
- status: import('@langchain/langgraph/web').BaseChannel<AgentStatus, AgentStatus | import('@langchain/langgraph/web').OverwriteValue<AgentStatus>, unknown>;
8
- sharedStatePatch: import('@langchain/langgraph/web').BaseChannel<SharedStatePatch | undefined, SharedStatePatch | import('@langchain/langgraph/web').OverwriteValue<SharedStatePatch | undefined> | undefined, unknown>;
9
4
  intent: import('@langchain/langgraph/web').BaseChannel<string, string | import('@langchain/langgraph/web').OverwriteValue<string>, unknown>;
10
5
  vectorSearchLayerResults: import('@langchain/langgraph/web').BaseChannel<{
11
6
  id: string;
@@ -25,5 +20,12 @@ export declare const NavigationState: import('@langchain/langgraph/web').Annotat
25
20
  }[]>, unknown>;
26
21
  vectorSearchFieldResults: import('@langchain/langgraph/web').BaseChannel<VectorSearchFieldResults, VectorSearchFieldResults | import('@langchain/langgraph/web').OverwriteValue<VectorSearchFieldResults>, unknown>;
27
22
  navigationInternalState: import('@langchain/langgraph/web').BaseChannel<NavigationInternalState, NavigationInternalState | import('@langchain/langgraph/web').OverwriteValue<NavigationInternalState>, unknown>;
23
+ agentExecutionContext: import('@langchain/langgraph/web').BaseChannel<import('@arcgis/ai-orchestrator').AgentExecutionContext, unknown, unknown>;
24
+ outputMessage: import('@langchain/langgraph/web').BaseChannel<string, unknown, unknown>;
25
+ summary: import('@langchain/langgraph/web').BaseChannel<string, unknown, unknown>;
26
+ status: import('@langchain/langgraph/web').BaseChannel<import('@arcgis/ai-orchestrator').AgentStatus | undefined, unknown, unknown>;
27
+ sharedStatePatch: import('@langchain/langgraph/web').BaseChannel<import('@arcgis/ai-orchestrator').SharedStatePatch<{
28
+ lastResolvedLocation?: import('../types/types').LastResolvedLocation;
29
+ }> | undefined, unknown, unknown>;
28
30
  }>;
29
31
  export type NavigationGraphStateType = typeof NavigationState.State;
@@ -1,4 +1,13 @@
1
+ import { SharedStatePatch } from '@arcgis/ai-orchestrator';
1
2
  import { AIMessage } from '@langchain/core/messages';
2
3
  export type NavigationInternalState = {
3
4
  toolCallMessage?: AIMessage;
4
5
  };
6
+ export type LastResolvedLocation = {
7
+ address: string;
8
+ location: unknown;
9
+ extent: unknown;
10
+ };
11
+ export type NavigationSharedStatePatch = SharedStatePatch<{
12
+ lastResolvedLocation?: LastResolvedLocation;
13
+ }>;
@@ -0,0 +1,31 @@
1
+ const n = `## ArcgisKnowledge Agent - Tool Intent Classifier
2
+
3
+ You are an assistant that classifies user intent for arcgisKnowledge agent.
4
+
5
+ You are given the following tool options:
6
+ {tools}
7
+
8
+ Return exactly one intent (tool name) based on the task details below. Use the provided user request or prior steps only if needed for context based on the assigned task.
9
+ If no tool apply, return an **empty string**.
10
+
11
+ **Task Details**
12
+
13
+ Assigned Task:
14
+ {assignedTask}
15
+
16
+ User Request:
17
+ {userRequest}
18
+
19
+ Prior steps:
20
+ {priorSteps}
21
+
22
+ **End Task Details**
23
+
24
+ Reminder:
25
+ Choose only from provided tools.
26
+
27
+ Return the name of the tool as a string.
28
+ `;
29
+ export {
30
+ n as default
31
+ };
@@ -0,0 +1,100 @@
1
+ const e = `## ArcgisKnowledge Agent - Lucene Generation for Graph Search
2
+
3
+ You are an assistant that generates a lucene query for graph query searching.
4
+
5
+ The knowledge graph you will be searching has the following named types, and next to each named type is a list of its searchable text fields corresponding to graph properties.
6
+
7
+ The search model data below is structured as follows:
8
+ <TYPE_NAME> - [array, of, searchable, field, names]
9
+
10
+ {dataModelForSearch}
11
+
12
+ The user is trying to answer the following inquiry via text search:
13
+ {inquiry}
14
+
15
+ Return a lucene search query that will answer the user's inquiry. The generated response should be an object with the following properties:
16
+
17
+ - \`query\` - string - the generated lucene query expression that answers the user's inquiry.
18
+ - \`typeFilters\` - array of strings - restricts the search to only use the named types specified. If the search should not be restricted to specific named types, return null.
19
+ - \`typeCategoryFilter\` - either 'entity', 'relationship' or 'both' - determines whether search should be limited to only entity or relationship types, or to search both. Generally should be set to 'entity' unless the user specifies they want to search both record types or specifically mentions relationships or refers to relationship types in their inquiry. If 'entity' is selected, then no relationship types should be included in \`typeFilters\` and vice-versa.
20
+ - \`resultLimit\` - number (min 1) or null - the max number of search results to return. Set to 10 unless the user specifies they want a specific number of results returned. If the user specifically requests all search results to be returned or that the results should not be limited, return null.
21
+
22
+ Additional rules for the generated arguments:
23
+
24
+ - Only include specific search fields in the lucene query expression if the user inquiry specifies specific fields or properties, and the fields are present in the searchable field list of the corresponding named type shown above, otherwise search across all fields.
25
+ - If the user's inquiry is specific to certain entity or relationship types in the graph, then return those types as the \`typeFilters\` property. Do not attempt to use search fields for this purpose. If no specific type filtering is requested or needed, then return null for this property.
26
+ - Regular expressions are not supported in the lucene search syntax, so do not include such queries in the \`query\` property.
27
+
28
+ **START EXAMPLE**
29
+
30
+ ### Example searchable property data:
31
+
32
+ Entity Types:
33
+ Author - [name, title]
34
+ Report - [organization, summary, full_text, tags]
35
+
36
+ Relationship Types:
37
+ authored - [contribution_type]
38
+
39
+ Searchable fields per type:
40
+
41
+ Author:
42
+ name
43
+ title
44
+
45
+ Report:
46
+ organization
47
+ summary
48
+ full_text
49
+ tags
50
+
51
+ authored:
52
+ contributionType
53
+
54
+ ### User Inquiry 1:
55
+
56
+ Find the first 5 reports where summary mentions flood zoning near Sacramento, and the organization name is close to City of Sacramento Utilities, and tags containing stormwater.
57
+
58
+ ### Example generated query arguments 1:
59
+
60
+ query: 'summary:"flood zoning" AND summary:Sacramento AND organization:"City of Sacramento Utilities"~2 AND tags:stormwater'
61
+
62
+ typeFilters: ['Report']
63
+
64
+ typeCategoryFilter: "entity"
65
+
66
+ resultLimit: 5
67
+
68
+ ### User Inquiry 2:
69
+
70
+ Find entities containing text like 'City of Sacramento Utilities'
71
+
72
+ ### Example generated query arguments 2:
73
+
74
+ query: '"City of Sacramento Utilities"~2'
75
+
76
+ typeFilters: null
77
+
78
+ typeCategoryFilter: "entity"
79
+
80
+ resultLimit: 10
81
+
82
+ ### User Inquiry 3:
83
+
84
+ Find all reports authored by someone with the title of 'Researcher'
85
+
86
+ ### Example generated query arguments 3:
87
+
88
+ query: 'title:"Researcher"'
89
+
90
+ typeFilters: ['Author']
91
+
92
+ typeCategoryFilter: "entity"
93
+
94
+ resultLimit: null
95
+
96
+ **END EXAMPLE**
97
+ `;
98
+ export {
99
+ e as default
100
+ };
@@ -0,0 +1,20 @@
1
+ const e = `# ArcgisKnowledge Tool Instructions
2
+
3
+ CRITICAL: You are FORBIDDEN from making multiple tool calls. You MUST make exactly ONE tool call.
4
+
5
+ Detected intent:
6
+ {intent}
7
+
8
+ Assigned task:
9
+ {assignedTask}
10
+
11
+ Latest user request:
12
+ {userRequest}
13
+
14
+ Rules:
15
+
16
+ - Call exactly one arcgisKnowledge tool, with the appropriate arguments given the detected intent and assigned task. Use the latest user request for context where necessary.
17
+ `;
18
+ export {
19
+ e as default
20
+ };