yera.runtime.models.block_data

Block data models for events blocks.

Symbols

class BarChartData — Bar chart block data.
class BlockEndData — Control event marking the structural end of a block.
class ButtonsData — Button group block data with options and optional label.
class DatePickerData — Date picker block data with value and label.
class ErrorResultData — Serialized data for an error result block.
class ErrorResultDetails — Normalized details captured from an exception.
class FailureExitEventData — Exit event data for failed app execution (exit_code != 0).
class FormData — A form request presenting a struct's fields for one typed submission.
class FormEchoData — The outcome of one form submission, recorded in the transcript.
class ImageData — Describe encoded image content carried by an output event.
class InputEchoData — An accepted input response that terminally commits its request.
class InputRequestBlockData — Data shared by blocks that request a single input value.
class InputRequestData — Input request block data for awaiting user text input.
class LineChartData — Line chart block data.
class LoggingAttributes — Privacy-safe metadata attached to a logging record.
class LoggingData — Describe one phase of a correlated runtime operation.
class MarkdownData — Markdown content block data.
class SectionData — Structural and visual state for a collapsible section.
class SessionMetaData — A partial session metadata update emitted by a runtime or host.
class SliderData — Slider block data with range, initial value, and label.
class SpinnerData — Spinner block data with status and optional message.
class StructData — Struct data for structured generation responses.
class SuccessExitEventData — Exit event data for successful app completion (exit_code 0).
class SuccessResultData — Serialized data for a successful result block.
class SystemPromptData — System prompt block data.
class TableData — Table block data with columns, rows, and border style.
class ThinkingData — Thinking content block data.
class TreeSelectorData — Tree selector request containing nested selectable leaves.

BarChartData

Inherits: BaseModel

Bar chart block data.

Fields

data_type
type: Literal['bar_chart'] = 'bar_chart'
x_label
type: str | None (required)
x_categories
type: list[str] (required)
y_label
type: str | None (required)
y_values
type: list[list[int | float | None]] (required)
colour_label
type: str | None (required)
colour_categories
type: list[str] (required)
colour_values
type: list[str] (required)
horizontal
type: bool (required)
stack
type: bool (required)

BlockEndData

Inherits: BaseModel

Control event marking the structural end of a block.

Distinct from semantic completion (e.g. SpinnerData.status="complete", which means render a tick). This means no further events will arrive for this block_id. It is consumed by the router to close the block's handler context and is never dispatched to a handler's push.

Fields

data_type
type: Literal['block_end'] = 'block_end'

ButtonsData

Button group block data with options and optional label.

Fields

response
type: yera.runtime.models.input_spec.InputValueSpec = <factory>
data_type
type: Literal['buttons'] = 'buttons'
options
type: list[str] (required)
label
type: str | None = None

DatePickerData

Date picker block data with value and label.

Fields

response
type: yera.runtime.models.input_spec.InputValueSpec = <factory>
data_type
type: Literal['date_picker'] = 'date_picker'
value
type: datetime.date (required)
label
type: str (required)

ErrorResultData

Inherits: BaseModel

Serialized data for an error result block.

Fields

data_type
type: Literal['error_result'] = 'error_result'
error
type: yera.runtime.models.block_data.ErrorResultDetails (required)
label
type: str = 'Error'
glyph
type: str = 'error'
colour
type: Literal['orange', 'terracotta', 'amber', 'green', 'red', 'blue', 'teal', 'violet'] = 'red'
expanded
type: bool = True

ErrorResultDetails

Inherits: BaseModel

Normalized details captured from an exception.

Fields

error_type
type: str (required)
message
type: str (required)
traceback
type: str | None (required)

FailureExitEventData

Inherits: BaseModel

Exit event data for failed app execution (exit_code != 0).

Fields

data_type
type: Literal['failure_exit'] = 'failure_exit'
exit_code
type: int (required)
reason
type: str (required)
return_type
type: str (required)
return_value
type: str | None (required)
error_cause
type: yera.apps.exceptions.ErrorCause (required)

FormData

A form request presenting a struct's fields for one typed submission.

Fields

response
type: yera.runtime.models.input_spec.InputValueSpec = <factory>

Transport contract accepting one JSON object; the struct, not the form schema, validates its contents.

data_type
type: Literal['form'] = 'form'
form_schema
type: dict[str, JsonValue] (required)

Inlined form schema used to render the form and to redact secrets from stored submissions.

label
type: str | None = None

Optional question shown above the form.

cancel_label
type: str | None = None

Optional label for an action that cancels the form.

values
type: dict[str, JsonValue] = <factory>

Current JSON values keyed by field name, pre-filling the form.

errors
type: dict[str, list[str]] = <factory>

Validation messages keyed by dotted field path, from a previously rejected submission.

FormEchoData

Inherits: BaseModel

The outcome of one form submission, recorded in the transcript.

Fields

data_type
type: Literal['form_echo'] = 'form_echo'
request_id
type: str (required)

Block ID of the form request the submission answered.

status
type: Literal['accepted', 'rejected'] (required)

Whether validation accepted or rejected the submission.

label
type: str | None = None

The request's question, repeated alongside the answers.

form_schema
type: dict[str, JsonValue] (required)

Form schema describing the submitted fields.

values
type: dict[str, JsonValue] (required)

Submitted JSON values with secrets masked.

errors
type: dict[str, list[str]] = <factory>

Validation messages keyed by dotted field path when rejected.

ImageData

Inherits: BaseModel

Describe encoded image content carried by an output event.

Fields

data_type
type: Literal['image'] = 'image'

Discriminator identifying image block data.

content
type: str (required)

Base64-encoded image-file content.

media_type
type: Literal['image/png', 'image/jpeg', 'image/webp', 'image/gif', 'image/svg+xml'] (required)

MIME type identifying the encoded image format.

alt
type: str | None = None

Optional accessible description of the image.

InputEchoData

Inherits: BaseModel

An accepted input response that terminally commits its request.

Fields

data_type
type: Literal['input_echo'] = 'input_echo'
request_id
type: str (required)
input
type: yera.runtime.models.input_data.TextInputData | yera.runtime.models.input_data.ButtonsInputData | yera.runtime.models.input_data.DatePickerInputData | yera.runtime.models.input_data.SliderInputData | yera.runtime.models.input_data.TreeSelectorInputData | yera.runtime.models.input_data.FormInputData (required)

InputRequestBlockData

Inherits: BaseModel

Data shared by blocks that request a single input value.

Fields

response
type: yera.runtime.models.input_spec.InputValueSpec (required)

InputRequestData

Input request block data for awaiting user text input.

Fields

response
type: yera.runtime.models.input_spec.InputValueSpec = <factory>
data_type
type: Literal['input_request'] = 'input_request'
type
type: Literal['text'] (required)
message
type: str | None = None

LineChartData

Inherits: BaseModel

Line chart block data.

Fields

data_type
type: Literal['line_chart'] = 'line_chart'
x_label
type: str | None = None
x_ticks
type: list[str] | None = None
y_label
type: str | None = None
y_values
type: list[list[float | None]] (required)
colour_label
type: str | None = None
colour_series
type: list[str] (required)
colour_values
type: list[str] (required)

LoggingAttributes

Inherits: BaseModel

Privacy-safe metadata attached to a logging record.

Fields

session_id
type: str | None = None

Session associated with the activity, when known.

app_name
type: str | None = None

User-facing name of the app being invoked.

input_type
type: str | None = None

Kind of user input requested or accepted.

error_type
type: str | None = None

Exception class name for failed activity.

model_provider
type: str | None = None

Configured provider responsible for a model request.

model_id
type: str | None = None

Configured identifier of the requested model.

model_request_kind
type: Optional[Literal['generation', 'structured_generation', 'tool_request']] = None

Kind of model generation being attempted.

attempt
type: int | None = None

One-based physical attempt number for a retried operation.

tool_kind
type: Optional[Literal['python', 'mcp']] = None

Kind of tool implementation being executed.

tool_name
type: str | None = None

Stable configured or Python name of the tool.

LoggingData

Inherits: BaseModel

Describe one phase of a correlated runtime operation.

Logging data contains metadata only. Prompts, responses, user-entered values, tool arguments, tool results, credentials, exception messages, and tracebacks do not belong in this model.

Fields

data_type
type: Literal['logging'] = 'logging'

Discriminator identifying a runtime logging record.

schema_version
type: Literal[1] = 1

Version of the logging wire contract.

operation_id
type: uuid.UUID (required)

Stable identity shared by every phase of one operation.

parent_operation_id
type: uuid.UUID | None = None

Enclosing operation, or None at the root.

actor
type: Literal['runtime', 'app', 'user', 'model', 'tool'] (required)

Kind of component performing the operation.

activity
type: Literal['session', 'runtime', 'app', 'input', 'model', 'tool'] (required)

Kind of operation being performed.

phase
type: Literal['started', 'completed', 'failed', 'cancelled'] (required)

Current lifecycle phase of the operation.

elapsed_seconds
type: float | None = None

Monotonic duration for a terminal phase.

attributes
type: yera.runtime.models.block_data.LoggingAttributes = <factory>

Explicitly reviewed privacy-safe metadata.

MarkdownData

Inherits: BaseModel

Markdown content block data.

Fields

data_type
type: Literal['markdown'] = 'markdown'
content
type: str (required)

SectionData

Inherits: BaseModel

Structural and visual state for a collapsible section.

Section data is emitted as a complete snapshot whenever the section heading changes. Consumers can therefore render each event independently without reconstructing previous updates.

Fields

data_type
type: Literal['section'] = 'section'
title
type: str (required)

Heading shown for the section.

summary
type: str | None = None

Optional preview shown when the completed section is collapsed.

auto_collapse
type: bool = True

Whether the section collapses automatically on completion.

glyph
type: str = 'thread'

Registered glyph shown beside the title.

colour
type: Optional[Literal['orange', 'terracotta', 'amber', 'green', 'red', 'blue', 'teal', 'violet']] = None

Optional named colour applied to the section heading.

SessionMetaData

Inherits: BaseModel

A partial session metadata update emitted by a runtime or host.

Fields

data_type
type: Literal['session_meta'] = 'session_meta'
session_id
type: str | None = None
start_time
type: datetime.datetime | None = None
top_level_app_name
type: str | None = None
session_title
type: str | None = None

SliderData

Slider block data with range, initial value, and label.

Fields

response
type: yera.runtime.models.input_spec.InputValueSpec = <factory>
data_type
type: Literal['slider'] = 'slider'
min_value
type: float (required)
max_value
type: float (required)
initial_value
type: float (required)
label
type: str (required)

SpinnerData

Inherits: BaseModel

Spinner block data with status and optional message.

Fields

data_type
type: Literal['spinner'] = 'spinner'
status
type: Literal['active', 'complete', 'failed'] (required)
message
type: str | None = None
glyph
type: str = 'run'
colour
type: Literal['orange', 'terracotta', 'amber', 'green', 'red', 'blue', 'teal', 'violet'] = 'orange'
elapsed
type: float | None = None

StructData

Inherits: BaseModel

Struct data for structured generation responses.

Fields

data_type
type: Literal['struct'] = 'struct'
kind
type: Literal['schema', 'token'] (required)
content
type: str (required)

SuccessExitEventData

Inherits: BaseModel

Exit event data for successful app completion (exit_code 0).

Fields

data_type
type: Literal['success_exit'] = 'success_exit'
exit_code
type: Literal[0] (required)
reason
type: str | None (required)
return_type
type: str (required)
return_value
type: str | bytes | None (required)

SuccessResultData

Inherits: BaseModel

Serialized data for a successful result block.

Fields

data_type
type: Literal['success_result'] = 'success_result'
value_kind
type: Literal['typed', 'empty_list', 'empty_dict', 'empty_set', 'empty_frozenset', 'empty_tuple', 'display_collection'] = 'typed'
type_name
type: str (required)
payload
type: str (required)
value_schema
type: dict[str, object] (required)
label
type: str = 'Result'
glyph
type: str = 'return'
colour
type: Literal['orange', 'terracotta', 'amber', 'green', 'red', 'blue', 'teal', 'violet'] = 'green'
expanded
type: bool = True

SystemPromptData

Inherits: BaseModel

System prompt block data.

Fields

data_type
type: Literal['system_prompt'] = 'system_prompt'
content
type: str (required)

TableData

Inherits: BaseModel

Table block data with columns, rows, and border style.

Fields

data_type
type: Literal['table'] = 'table'
columns
type: list[str] (required)
rows
type: list[list[datetime.date | datetime.datetime | datetime.time | datetime.timedelta | float | int | bool | str]] (required)
border
type: Literal['all', 'none', 'horizontal'] = 'all'

ThinkingData

Inherits: BaseModel

Thinking content block data.

Fields

data_type
type: Literal['thinking'] = 'thinking'
content
type: str (required)

TreeSelectorData

Tree selector request containing nested selectable leaves.

Fields

response
type: yera.runtime.models.input_spec.InputValueSpec = <factory>
data_type
type: Literal['tree_selector'] = 'tree_selector'
nodes
type: list[typing.Annotated[yera.runtime.models.block_data._TreeSelectorLeaf | yera.runtime.models.block_data._TreeSelectorBranch, FieldInfo(annotation=NoneType, required=True, discriminator='node_type')]] (required)
label
type: str | None = None
cancel_label
type: str | None = None
min_selections
type: int = 1
max_selections
type: int | None = None