Surface-neutral UI projection contract for a Jidoka agent.
AgentView is not a Phoenix view and does not render HTML. It is a small
application-facing projection that LiveView, CLI examples, channels, tests, or
jobs can use to keep UI state separate from the durable agent runtime.
The struct is projection-only. It stores no pid, transcript persistence, provider client, process state, or adapter data.
Summary
Functions
Applies a Jidoka runtime result to view data.
Applies a streamed Jidoka runtime event to view data.
Applies optimistic user-message state before an agent turn starts.
Derives a runtime agent id from an agent module and conversation id.
Derives a conversation id from keyword, atom-key map, or string-key map input.
Derives default runtime context from a conversation id.
Builds the initial projection for a view module and input.
Returns lifecycle hook names supported by the AgentView contract.
Builds an AgentView struct from attributes.
Builds an AgentView struct from attributes and raises on invalid input.
Normalizes arbitrary text into a stable lower-snake id.
Generates a request id suitable for UI-initiated turns.
Runs one turn for a view module and maps the runtime result back into view data.
Returns the Zoi schema for AgentView.
Returns visible messages for a view.
Types
@type input() :: term()
@type status() :: :idle | :running | :error | :interrupted | :handoff
@type t() :: %Jidoka.AgentView{ agent_id: binary(), conversation_id: binary(), error: nil | nil | any(), error_text: nil | nil | binary(), events: [map()], metadata: map(), outcome: nil | nil | any(), runtime_context: map(), status: (:idle | :running | :error | :interrupted | :handoff) | binary(), streaming_message: nil | nil | map(), visible_messages: [map()] }
Callbacks
Functions
@spec after_turn(t(), Jidoka.run_result()) :: t()
Applies a Jidoka runtime result to view data.
@spec apply_event(t(), Jidoka.Event.t() | map()) :: t()
Applies a streamed Jidoka runtime event to view data.
Content deltas update streaming_message; non-delta events are appended to
events as compact debug projections.
Applies optimistic user-message state before an agent turn starts.
Derives a runtime agent id from an agent module and conversation id.
Derives a conversation id from keyword, atom-key map, or string-key map input.
Derives default runtime context from a conversation id.
Builds the initial projection for a view module and input.
@spec lifecycle_hooks() :: [atom()]
Returns lifecycle hook names supported by the AgentView contract.
Builds an AgentView struct from attributes.
Builds an AgentView struct from attributes and raises on invalid input.
Normalizes arbitrary text into a stable lower-snake id.
@spec request_id() :: String.t()
Generates a request id suitable for UI-initiated turns.
Runs one turn for a view module and maps the runtime result back into view data.
@spec schema() :: Zoi.schema()
Returns the Zoi schema for AgentView.
Returns visible messages for a view.