Jidoka.Turn.State (Jidoka v0.8.0-beta.1)

Copy Markdown View Source

Ephemeral data value passed through the Jidoka turn workflow.

Summary

Types

t()

@type t() :: %Jidoka.Turn.State{
  agent_state: term(),
  diagnostics: [any()],
  events: [term()],
  journal: term(),
  llm_result: nil | nil | term(),
  loop_index: integer(),
  memory: nil | nil | term(),
  operation_plan: nil | nil | term(),
  pending_effects: [term()],
  pending_interrupt: nil | nil | term(),
  plan: term(),
  prompt: nil | nil | any(),
  request: term(),
  result: nil | nil | binary(),
  result_repair_count: integer(),
  result_value: nil | nil | any(),
  spec: term(),
  started_at_ms: nil | nil | integer(),
  status: (:running | :waiting | :finished) | binary()
}

Functions

apply_effect_result(state, result)

@spec apply_effect_result(t(), Jidoka.Effect.Result.t()) ::
  {:ok, t()} | {:error, term()}

clear_pending_interrupt(state)

@spec clear_pending_interrupt(t()) :: t()

current_pending_effect(state)

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

from_snapshot(map)

@spec from_snapshot(Jidoka.Runtime.AgentSnapshot.t()) :: {:ok, t()} | {:error, term()}

new(attrs)

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

new!(attrs)

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

pending_effect?(state)

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

pop_pending_effect(state)

@spec pop_pending_effect(t()) :: t()

put_pending_interrupt(state, interrupt)

@spec put_pending_interrupt(t(), Jidoka.Review.Interrupt.t()) :: t()

schema()

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

set_pending_effects(state, effects)

@spec set_pending_effects(t(), [Jidoka.Effect.Intent.t()]) :: t()