cadrumo.entrypoints.tui.profile.local_reader module¶
Document reader: what the local reader reports, and the supervised setup and per-step actions.
The page renders LocalReaderStatus as measured and nothing more. An
answer the reader could not measure stays “not measured”; it never becomes
“not installed”. Installing the runtime runs a package manager, so both the
install button and a setup that would install ask for explicit confirmation
first, the same consent --confirm gives at the command line.
- local_reader_role_cells(row)[source]¶
One role’s table cells: role, model, installed, loaded, model check, ready.
- local_reader_fitness_lines(status)[source]¶
Explain every role whose model check did not pass; “not verified” never reads as “unfit”.
- Return type:
- Parameters:
status (LocalReaderStatus)
- local_reader_summary_lines(status)[source]¶
The host, the last fetch and the one readiness claim, in the operator’s language.
- Return type:
- Parameters:
status (LocalReaderStatus)
- class LocalReaderChecklistItem(*values)[source]¶
Bases:
StrEnumThe rows of the setup checklist, in the order setup satisfies them.
- SERVICE_INSTALLED¶
- SERVICE_RUNNING¶
- TEXT_MODEL_PULLED¶
- VISION_MODEL_PULLED¶
- MODELS_LOADED¶
- VERIFIED¶
- local_reader_checklist(status)[source]¶
Derive each checklist row’s measured state;
Nonemeans not measured, never missing.- Return type:
- Parameters:
status (LocalReaderStatus)
- local_reader_checklist_cells(item, state)[source]¶
One checklist row’s cells: the step and its done / missing / not measured state.
- Return type:
- Parameters:
item (LocalReaderChecklistItem)
state (bool | None)
- local_reader_setup_notice(result)[source]¶
Say whether setup finished, or which step stopped it and on which condition.
- Return type:
- Parameters:
result (LocalReaderProvisionPublicResultV1)
- class LocalReaderDoorV1(*args, **kwargs)[source]¶
Bases:
ProtocolReads the reader’s status and submits its supervised provisioning actions.
- read_status()[source]¶
Measure the runtime and every role without starting or loading anything.
- Return type:
- async setup(*, consent)[source]¶
Submit and start the one-shot setup;
consentpermits an install.- Return type:
- Parameters:
consent (bool)
- async install(*, consent)[source]¶
Submit and start the runtime install.
- Return type:
- Parameters:
consent (bool)
- async pull(role)[source]¶
Submit and start the fetch of
role’s model.- Return type:
- Parameters:
role (ModelRole)
- async load(role)[source]¶
Submit and start the load of
role’s model into memory.- Return type:
- Parameters:
role (ModelRole)
- async verify(role)[source]¶
Submit and start the readiness check of
role’s model.- Return type:
- Parameters:
role (ModelRole)
- async remove(role)[source]¶
Submit and start the removal of
role’s model from the runtime’s store.- Return type:
- Parameters:
role (ModelRole)
- async settled_result(controller)[source]¶
Return the settled public result of a finished operation, or
Nonewhen it has none.- Return type:
- Parameters:
controller (OperationController)
- class OperationLocalReaderDoor(services)[source]¶
Bases:
objectThe reader door over the session’s own operation platform.
- Parameters:
services (OperationComposedServices)
-
services:
OperationComposedServices¶
- async setup(*, consent)[source]¶
Submit and start the one-shot setup.
- Return type:
- Parameters:
consent (bool)
- async install(*, consent)[source]¶
Submit and start the runtime install.
- Return type:
- Parameters:
consent (bool)
- async pull(role)[source]¶
Submit and start the fetch of
role’s model.- Return type:
- Parameters:
role (ModelRole)
- async load(role)[source]¶
Submit and start the load of
role’s model.- Return type:
- Parameters:
role (ModelRole)
- async verify(role)[source]¶
Submit and start the readiness check of
role’s model.- Return type:
- Parameters:
role (ModelRole)
- async remove(role)[source]¶
Submit and start the removal of
role’s model.- Return type:
- Parameters:
role (ModelRole)
- async settled_result(controller)[source]¶
Resolve the settled public result through the composed result door.
- Return type:
- Parameters:
controller (OperationController)
- class LocalReaderScreen(door)[source]¶
-
The document reader’s setup checklist, its measured roles and its supervised actions.
- Parameters:
door (LocalReaderDoorV1)
- DEFAULT_CSS: ClassVar[str]¶
Default TCSS.
- BINDINGS: ClassVar¶
A list of key bindings.
- compose()[source]¶
Called by Textual to create child widgets.
This method is called when a widget is mounted or by setting recompose=True when calling [refresh()][textual.widget.Widget.refresh].
Note that you don’t typically need to explicitly call this method.
Example
def compose(self) -> ComposeResult: yield Header() yield Label("Press the button below:") yield Button() yield Footer()
- action_refresh_status()[source]¶
Measure again off the event loop; an unreachable runtime can take seconds to answer.
- Return type:
- action_setup()[source]¶
Run the one-shot setup, asking before it would install the runtime.
- Return type:
- on_data_table_row_selected(event)[source]¶
Choose the role a pull, load, verify or remove acts on.
- Return type:
- Parameters:
event (RowSelected)
- can_focus: bool¶
Widget may receive focus.
- can_focus_children: bool¶
Widget’s children may receive focus.