Types
import type { AgentData, EmptyAgentData, SchemaPrimitiveFieldType, SchemaArrayItemDefinition, SchemaFieldDefinition } from "@arcgis/ai-components/agent-utils/types.js";

Type definitions

AgentData

Type definition
Supertypes
Record<string‚ unknown>

EmptyAgentData

Type definition
Supertypes
Record<never‚ never>

SchemaPrimitiveFieldType

Type definition
Type
"boolean" | "number" | "string"

SchemaArrayItemDefinition

Type definition

SchemaFieldDefinition

Type definition
Type
({ type: "array"; itemType: SchemaArrayItemDefinition; } | { type: "boolean" | "number"; } | { type: "object"; fields: SchemaDefinition; } | { type: "string"; enum?: readonly string[]; })

description

Property
Type
string | undefined

required

Property
Type
boolean | undefined

SchemaDefinition

Type definition

SchemaDefinitionData

Type definition
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

Type definition

agentExecutionContext

Property
Type
AgentExecutionContext

outputMessage

Property
Type
string

The outputMessage is a string representing the output of an agent execution.

summary

Property
Type
string

The summary is a string providing a brief overview of the agent execution.

status

Property
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 definition
Type parameters
<TState extends AgentData = EmptyAgentData>
Supertypes
AgentRuntimeState ‚  Omit<TState‚ keyof AgentRuntimeState>

BaseAgentLike

Type definition
Type parameters
<TCustomState extends AgentData = EmptyAgentData>

id

Property
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

Property
Type
ZodObjectSchema<object> | undefined
Since
ArcGIS Maps SDK for JavaScript 5.1

Optional schema used to validate and shape agent input state.

name

Property
Type
string
Since
ArcGIS Maps SDK for JavaScript 5.1

Human-readable name shown in registration metadata and tooling.

outputSchema

Property
Type
ZodObjectSchema<object> | undefined
Since
ArcGIS Maps SDK for JavaScript 5.1

Optional schema used to validate structured agent output.

registration

Property
Type
AgentRegistration
Since
ArcGIS Maps SDK for JavaScript 5.1

Registration payload consumed by the orchestrator.

generate

Property
Type
() => void

Regenerates workspace and graph wiring for this agent.

getSchemas

Property
Type
() => ZodObjectSchema<object>[]

Returns all schemas the agent contributes to state/input/output validation.

run

Method
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

ParameterTypeDescriptionRequired
state

Optional partial state used as graph input.

config

Optional runtime execution configuration.

Returns
Promise<AgentGraphState>

AgentExecutionConfig

Type definition

AgentExecutionConfig defines the shape of the configuration object that can be passed to agent execution methods to influence their behavior at runtime.

configurable

Property
Type
Record<string, unknown> | undefined
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.

metadata

Property
Type
Record<string, unknown> | undefined

recursionLimit

Property
Type
number | undefined

runName

Property
Type
string | undefined

signal

Property
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.

tags

Property
Type
string[] | undefined

AgentCustomState

Type definition
Type parameters
<TInput extends AgentData = AgentData, TOutput extends AgentData = AgentData>
Supertypes
Omit<TInput‚ keyof AgentRuntimeState> ‚  Partial<Omit<TOutput, keyof AgentRuntimeState>>

AgentNodeState

Type definition
Type parameters
<TInput extends AgentData = AgentData, TOutput extends AgentData = AgentData>
Supertypes
AgentGraphState<AgentCustomState<TInput, TOutput>>

AgentNodeUpdate

Type definition
Type parameters
<TInput extends AgentData, TOutput extends AgentData>
Supertypes
Partial<AgentNodeState<TInput, TOutput>>

AgentStateAnnotation

Type definition
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 definition
Type parameters
<TState extends AgentData>
Since
ArcGIS Maps SDK for JavaScript 5.1

State update shape produced by graph nodes.

Type
Partial extends object ? Partial & Record<string, any> : Partial

TypedStateGraph

Type definition
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 definition
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

Type definition
Type parameters
<T extends object = AgentData>

ZodObjectSchema is a simplified type representing Zod object schemas used for input and output validation in agents.

Supertypes
Pick<z.ZodType‚ "safeParse"> ‚  default

GraphNodes

Type definition
Type parameters
<S extends AgentData>
Supertypes
Record<string‚ (state: S, config?: AgentExecutionConfig) => Partial | Promise<Partial | S> | S>

GraphEdge

Type definition
Type parameters
<S extends AgentData>
Type
{ from: string; decide: (state: S, config?: AgentExecutionConfig) => Promise<string | undefined> | string | undefined; } | { from: string; to: string; }

SchemaFieldData

Type definition
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