Jidoka.Turn.Cursor (Jidoka v0.9.0)

Copy Markdown View Source

Pointer to the next safe phase boundary.

Summary

Functions

Builds a cursor for the boundary after prompt assembly.

Builds a cursor for the boundary before one effect is interpreted.

Builds a turn cursor from keyword or map attributes.

Builds a turn cursor and raises if the attributes are invalid.

Builds a cursor for a pending human-review boundary.

Returns the Zoi schema for a turn cursor.

Types

t()

@type t() :: %Jidoka.Turn.Cursor{
  loop_index: integer(),
  metadata: map(),
  phase: (((:start | :after_prompt) | :before_effect) | :review) | :wait
}

Functions

after_prompt()

@spec after_prompt() :: t()

Builds a cursor for the boundary after prompt assembly.

before_effect(effect)

@spec before_effect(Jidoka.Effect.Intent.t() | nil) :: t()

Builds a cursor for the boundary before one effect is interpreted.

new(attrs \\ [])

@spec new(keyword() | map()) :: {:ok, t()} | {:error, term()}

Builds a turn cursor from keyword or map attributes.

new!(attrs \\ [])

@spec new!(keyword() | map()) :: t()

Builds a turn cursor and raises if the attributes are invalid.

review(interrupt)

@spec review(Jidoka.Review.Interrupt.t()) :: t()

Builds a cursor for a pending human-review boundary.

schema()

@spec schema() :: Zoi.schema()

Returns the Zoi schema for a turn cursor.