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.

Return type:

tuple[str, str, str, str, str, str]

Parameters:

row (LocalReaderRoleStatus)

local_reader_fitness_lines(status)[source]

Explain every role whose model check did not pass; “not verified” never reads as “unfit”.

Return type:

tuple[str, ...]

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:

tuple[str, ...]

Parameters:

status (LocalReaderStatus)

class LocalReaderChecklistItem(*values)[source]

Bases: StrEnum

The 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; None means not measured, never missing.

Return type:

tuple[tuple[LocalReaderChecklistItem, bool | None], ...]

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:

tuple[str, str]

Parameters:
local_reader_setup_notice(result)[source]

Say whether setup finished, or which step stopped it and on which condition.

Return type:

str

Parameters:

result (LocalReaderProvisionPublicResultV1)

class LocalReaderDoorV1(*args, **kwargs)[source]

Bases: Protocol

Reads 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:

LocalReaderStatus

async setup(*, consent)[source]

Submit and start the one-shot setup; consent permits an install.

Return type:

OperationController

Parameters:

consent (bool)

async install(*, consent)[source]

Submit and start the runtime install.

Return type:

OperationController

Parameters:

consent (bool)

async start()[source]

Submit and start the runtime-start operation.

Return type:

OperationController

async pull(role)[source]

Submit and start the fetch of role’s model.

Return type:

OperationController

Parameters:

role (ModelRole)

async load(role)[source]

Submit and start the load of role’s model into memory.

Return type:

OperationController

Parameters:

role (ModelRole)

async verify(role)[source]

Submit and start the readiness check of role’s model.

Return type:

OperationController

Parameters:

role (ModelRole)

async remove(role)[source]

Submit and start the removal of role’s model from the runtime’s store.

Return type:

OperationController

Parameters:

role (ModelRole)

async settled_result(controller)[source]

Return the settled public result of a finished operation, or None when it has none.

Return type:

LocalReaderProvisionPublicResultV1 | None

Parameters:

controller (OperationController)

class OperationLocalReaderDoor(services)[source]

Bases: object

The reader door over the session’s own operation platform.

Parameters:

services (OperationComposedServices)

services: OperationComposedServices
read_status()[source]

Measure the reader exactly as config provision status does.

Return type:

LocalReaderStatus

async setup(*, consent)[source]

Submit and start the one-shot setup.

Return type:

OperationController

Parameters:

consent (bool)

async install(*, consent)[source]

Submit and start the runtime install.

Return type:

OperationController

Parameters:

consent (bool)

async start()[source]

Submit and start the runtime-start operation.

Return type:

OperationController

async pull(role)[source]

Submit and start the fetch of role’s model.

Return type:

OperationController

Parameters:

role (ModelRole)

async load(role)[source]

Submit and start the load of role’s model.

Return type:

OperationController

Parameters:

role (ModelRole)

async verify(role)[source]

Submit and start the readiness check of role’s model.

Return type:

OperationController

Parameters:

role (ModelRole)

async remove(role)[source]

Submit and start the removal of role’s model.

Return type:

OperationController

Parameters:

role (ModelRole)

async settled_result(controller)[source]

Resolve the settled public result through the composed result door.

Return type:

LocalReaderProvisionPublicResultV1 | None

Parameters:

controller (OperationController)

class LocalReaderScreen(door)[source]

Bases: Screen[None]

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.

Return type:

Iterable[Widget]

Example

def compose(self) -> ComposeResult:
    yield Header()
    yield Label("Press the button below:")
    yield Button()
    yield Footer()
on_mount()[source]

Lay out both tables and take the first measurement.

Return type:

None

action_close()[source]

Return to the page this was opened from.

Return type:

None

action_refresh_status()[source]

Measure again off the event loop; an unreachable runtime can take seconds to answer.

Return type:

None

action_setup()[source]

Run the one-shot setup, asking before it would install the runtime.

Return type:

None

on_data_table_row_selected(event)[source]

Choose the role a pull, load, verify or remove acts on.

Return type:

None

Parameters:

event (RowSelected)

on_button_pressed(event)[source]

Submit the pressed action through the operation platform.

Return type:

None

Parameters:

event (Pressed)

can_focus: bool

Widget may receive focus.

can_focus_children: bool

Widget’s children may receive focus.