A2aEngine.LifecycleState (a2a_engine v0.1.0)

Copy Markdown View Source

A2A Task lifecycle states.

Wire values are lowercase, hyphen-separated strings — exactly as the spec defines them. We keep them as strings (not atoms) to round-trip the wire format faithfully.

States

  • "submitted" — task received, not yet being worked on
  • "working" — in progress
  • "input-required" — worker needs caller input before continuing
  • "completed" — terminal success
  • "canceled" — terminal, user-requested
  • "failed" — terminal, error
  • "rejected" — terminal, worker refused
  • "auth-required" — caller needs to re-authenticate
  • "unknown" — fallback / indeterminate

Summary

Functions

All valid state strings.

Terminal states — no further transitions possible.

Whether value is a recognised A2A lifecycle state.

Types

t()

@type t() :: String.t()

Functions

all()

@spec all() :: [t()]

All valid state strings.

terminal?(state)

@spec terminal?(t()) :: boolean()

Terminal states — no further transitions possible.

iex> A2aEngine.LifecycleState.terminal?("completed")
true
iex> A2aEngine.LifecycleState.terminal?("working")
false

valid?(value)

@spec valid?(any()) :: boolean()

Whether value is a recognised A2A lifecycle state.