cadrumo.entrypoints.tui.account module

Production composition for the account utilities.

The workbench treats Profile as an account destination and exposes the other account utilities from its identity control. Their visual and application owners already exist: this module only binds those owners to caller-supplied doors. In particular, it neither reads profile storage nor creates an alternative credential, language, appearance, or sign-out screen.

exception AccountSessionExpiredError(message=None, *, context=None, translated_message=None)[source]

Bases: CadrumoError

Signal that the current non-secret account session must be recomposed.

Parameters:
  • message (str | None)

  • context (Mapping[str, object] | None)

  • translated_message (str | None)

Return type:

None

code
class AccountRecomposeReasonV1(*values)[source]

Bases: StrEnum

Why the current profile-bound workbench must be discarded.

CHANGE_USER
PASSWORD_CHANGED
SIGNED_OUT
EXPIRED
class AccountRecomposeRequiredV1(reason, profile_id=None, profile_label=None)[source]

Bases: object

Non-secret handoff asking the outer bootstrap owner for a fresh root.

Parameters:
reason: AccountRecomposeReasonV1
profile_id: str | None
profile_label: str | None
class AccountFactoriesV1(profile, change_user, password, appearance, language, sign_out)[source]

Bases: object

The production account utilities, each delegated to its existing owner.

Parameters:
  • profile (AccountProfileFactoryV1)

  • change_user (AccountChangeUserFactoryV1)

  • password (AccountPasswordFactoryV1)

  • appearance (AccountAppearanceFactoryV1)

  • language (AccountLanguageFactoryV1)

  • sign_out (AccountSignOutFactoryV1)

profile: TypeAliasType
change_user: TypeAliasType
password: TypeAliasType
appearance: TypeAliasType
language: TypeAliasType
sign_out: TypeAliasType
compose_account_factories(*, profile_overview, persist_profile_field, login_choices, authenticate, assess_password, rotate_password, sign_out, preselected_profile_id=None, validate_profile_field=None, launch_profile_source=None, credential_postures=None, appearance=<function toggle_appearance>, complete_setup=None, open_document_reader=None)[source]

Bind already-composed account doors to their canonical TUI owners.

Every value and effect door is supplied by the installed host. This makes composition explicit: constructing a factory does not read storage, unlock a profile, mutate settings, or submit the strong-close operation.

Return type:

AccountFactoriesV1

Parameters:
compose_profile_sign_out_factory(services, *, profile_id, actor_ref='operator:tui-account')[source]

Bind the canonical strong-close operation to the current profile.

The returned door submits and starts the close only when invoked, exactly as config logout does; composition performs no operation, persistence, or credential work. Observation stays with the operation modal, which watches and never starts: a close that was submitted but not started sat in its created state indefinitely while the modal reported it in progress.

Return type:

TypeAliasType

Parameters:
class WorkbenchAccountProviderV1(screen, match_style=None)[source]

Bases: Provider

Offer the account controls in the command palette.

The controls sit on the root shell, which every destination screen covers, so without this the palette was the one cross-screen surface that could not reach them. Entries exist only while the session has account doors; offering a control that can only refuse would be a false promise. Appearance is left to the root’s system commands, which offer it with or without a profile, so it is not listed twice.

Parameters:
  • screen (Screen[Any])

  • match_style (Style | None)

async search(query)[source]

Fuzzy-match the account controls by their on-screen names.

Return type:

AsyncIterator[DiscoveryHit | Hit]

Parameters:

query (str)

async discover()[source]

List the account controls before anything is typed.

Return type:

AsyncIterator[DiscoveryHit | Hit]