import type { AgentData, EmptyAgentData, SchemaPrimitiveFieldType, SchemaArrayItemDefinition, SchemaFieldDefinition } from "@arcgis/ai-components/agent-utils/types.js";Type definitions
SchemaFieldDefinition
- Type
- ({ type: "array"; itemType: SchemaArrayItemDefinition; } | { type: "boolean" | "number"; } | { type: "object"; fields: SchemaDefinition; } | { type: "string"; enum?: readonly string[]; })
SchemaDefinitionData
- Type parameters
- <TDefinition extends SchemaDefinition>
- Type
- { [K in keyof TDefinition as TDefinition[K] extends { required: true; } ? K : never]: SchemaFieldData<TDefinition[K]>; } & { [K in keyof TDefinition as TDefinition[K] extends { required: true; } ? never : K]?: SchemaFieldData<TDefinition[K]>; }
AgentRuntimeState
outputMessage
- Type
- string
The outputMessage is a string representing the output of an agent execution.
summary
- Type
- string
The summary is a string providing a brief overview of the agent execution.
status
- Type
- AgentStatus | undefined
The status field represents the current status of the agent execution, which can be used to indicate success, failure, or other relevant states.
AgentGraphState
- Type parameters
- <TState extends AgentData = EmptyAgentData>
- Supertypes
- AgentRuntimeState ‚ Omit<TState‚ keyof AgentRuntimeState>
BaseAgentLike
- Type parameters
- <TCustomState extends AgentData = EmptyAgentData>
id
- Type
- string
- Since
- ArcGIS Maps SDK for JavaScript 5.1
Stable ID derived from the agent name and used for graph node and registration identity.
inputSchema
- Type
- ZodObjectSchema<object> | undefined
- Since
- ArcGIS Maps SDK for JavaScript 5.1
Optional schema used to validate and shape agent input state.
name
- Type
- string
- Since
- ArcGIS Maps SDK for JavaScript 5.1
Human-readable name shown in registration metadata and tooling.
outputSchema
- Type
- ZodObjectSchema<object> | undefined
- Since
- ArcGIS Maps SDK for JavaScript 5.1
Optional schema used to validate structured agent output.
registration
- Type
- AgentRegistration
- Since
- ArcGIS Maps SDK for JavaScript 5.1
Registration payload consumed by the orchestrator.
getSchemas
- Type
- () => ZodObjectSchema<object>[]
Returns all schemas the agent contributes to state/input/output validation.
run
- Signature
-
run (state?: Partial<AgentGraphState<TCustomState>>, config?: AgentExecutionConfig): Promise<AgentGraphState<TCustomState>>
- Since
- ArcGIS Maps SDK for JavaScript 5.1
Executes the compiled graph for this agent.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| state | Optional partial state used as graph input. | | |
| config | Optional runtime execution configuration. | |
- Returns
- Promise<AgentGraphState
>
AgentExecutionConfig
AgentExecutionConfig defines the shape of the configuration object that can be passed to agent execution methods to influence their behavior at runtime.
configurable
- Since
- ArcGIS Maps SDK for JavaScript 5.1
The configurable field allows passing arbitrary key-value pairs that can be used by agents during execution to modify their behavior or provide additional context. This can include flags, parameters, or any other relevant information that an agent might need to access at runtime.
signal
- Type
- AbortSignal | undefined
- Since
- ArcGIS Maps SDK for JavaScript 5.1
The signal property is an optional AbortSignal that can be used to cancel the execution of an agent. Agents should listen for the abort signal and gracefully handle cancellation when it is triggered.
AgentCustomState
- Supertypes
- Omit<TInput‚ keyof AgentRuntimeState> ‚ Partial<Omit<TOutput, keyof AgentRuntimeState>>
AgentStateAnnotation
- Type parameters
- <TState extends AgentData>
- Since
- ArcGIS Maps SDK for JavaScript 5.1
AgentStateAnnotation defines the shape of the agent state used in LangGraph nodes, including both the built-in runtime channels and any custom fields defined by the agent.
- Supertypes
- AnnotationRoot<{ [K in keyof TState]: BinaryOperatorAggregate<TState[K] | undefined, TState[K] | undefined>; } & { agentExecutionContext: BaseChannel<AgentExecutionContext, unknown, unknown>; outputMessage: BaseChannel<string, unknown, unknown>; summary: BaseChannel<string, unknown, unknown>; status: BaseChannel<AgentStatus | undefined, unknown, unknown>; }>
RunnableUpdate
- Type parameters
- <TState extends AgentData>
- Since
- ArcGIS Maps SDK for JavaScript 5.1
State update shape produced by graph nodes.
TypedStateGraph
- Type parameters
- <TState extends AgentData>
- Since
- ArcGIS Maps SDK for JavaScript 5.1
Internal type representing the compiled graph used for agent execution.
- Supertypes
- StateGraph<StateDefinitionInit‚ AgentGraphState
‚ RunnableUpdate<AgentGraphState >‚ string>
AgentCreateGraph
- Type parameters
- <TState extends AgentData>
- Since
- ArcGIS Maps SDK for JavaScript 5.1
The shape of the createGraph function used by agents to generate their internal graph representation.
This function is responsible for defining the nodes and edges of the graph, as well as any associated state and middleware.
- Returns
- TypedStateGraph
ZodObjectSchema
ZodObjectSchema is a simplified type representing Zod object schemas used for input and output validation in agents.
- Supertypes
- Pick<z.ZodType
‚ "safeParse"> ‚ default
GraphEdge
- Type parameters
- <S extends AgentData>
SchemaFieldData
- Type parameters
- <TField extends SchemaFieldDefinition>
- Type
- TField extends { type: "string"; } ? TField["enum"] extends readonly (infer TValue extends string)[] ? TValue : string : TField extends { type: "array"; } ? (TField["itemType"] extends "string" ? string : TField["itemType"] extends "number" ? number : TField["itemType"] extends "boolean" ? boolean : TField["itemType"] extends SchemaFieldDefinition ? SchemaFieldData<TField["itemType"]> : never)[] : TField extends { type: "object"; } ? SchemaDefinitionData<TField["fields"]> : TField extends { type: "number"; } ? number : boolean