Runtime Types

Runtime Types

This document describes the types that are available at runtime.

AgentState

The AgentState type contains the execution state of an agent.

Properties

  • id (string): Unique id of this agent execution
  • root (StackFrame): StackFrame object that represents the current execution state
  • status (string): Indicates the status of the agent execution, can be running, finished, error or awaiting
  • output (any, optional): The result of the agent execution if any

StackFrame

The StackFrame represents a single step within the execution stack.

Properties

  • trace (string): Unique identifier for the frame in the execution state
  • status (string): Status of the frame, can be running, finished, error or awaiting
  • startedAt (Date): Timestamp at which the current step began
  • updatedAt (Date): Timestamp at which the step was updated
  • variables (object, optional): All the local variables available in scope
  • parent (StackFrame, optional): Pointer to the parent StackFrame if nested
  • error (string, optional): Error during execution if any
  • value (any, optional): Value of the variable or function call in scope
  • state (any, optional): Tool state, if any
  • events (ToolEvent[], optional): Events for the tool, if any
  • children (StackFrame[], optional): Array of children frames, representing the nested execution

RuntimeError

The RuntimeError represents an exception that occurs during the execution of an AgentScript. It's usually related to invalid runtime calls or variable access.