cadrumo.entrypoints.tui.operations.interactions module

Safe REVIEW rendering and separately authorized APPLY/REJECT controls.

Only the registered safe REVIEW projection and the response-control authorization are ever rendered. Public INPUT and CHOICE interaction kinds are treated as unsupported: no later contract has enrolled a TUI renderer for them yet, so this module never attempts to draw one.

These are runtime render states rather than wire contracts (a bound response control cannot cross a process boundary), so they are plain immutable dataclasses rather than pydantic models; the wire-safe fields they carry (interaction, projection) are already-validated public contract models.

class OperationModalNoInteractionV1(disposition='none')[source]

Bases: object

The modal has no interaction to render.

Parameters:

disposition (Literal['none'])

disposition: Literal['none']
class OperationModalReviewInteractionV1(interaction, projection, control, apply_enabled, reject_enabled)[source]

Bases: Generic

A registered safe REVIEW projection with its already-bound controls.

control is bound exactly once per pending REVIEW (the underlying response capability is single-use), so this same instance answers both the availability check and the eventual APPLY or REJECT.

Parameters:
interaction: OperationReviewAvailableInteractionV1
projection: TypeVar(ReviewProjectionT, bound= BaseModel)
control: OperationBoundResponseControl
apply_enabled: bool
reject_enabled: bool
disposition: Literal['review_available']
class OperationModalReviewUnavailableV1(interaction)[source]

Bases: object

A pending REVIEW whose safe projection could not currently be resolved.

Parameters:

interaction (OperationReviewAvailableInteractionV1)

interaction: OperationReviewAvailableInteractionV1
disposition: Literal['review_unavailable']
class OperationModalUnsupportedInteractionV1(interaction)[source]

Bases: object

A pending interaction this modal cannot yet render (INPUT or CHOICE).

Parameters:

interaction (OperationUnsupportedInteractionV1)

interaction: OperationUnsupportedInteractionV1
disposition: Literal['unsupported']
async resolve_modal_interaction_state(controller, projection, *, current=None)[source]

Resolve the exact modal interaction state for the current projection.

current is the state a repeating caller already holds. When the same REVIEW is still pending at the same revision it is returned unchanged, because the response capability behind it is single-use: binding a second control for an interaction already bound consumes the authority and every later availability check refuses, which switches the operator’s APPLY and REJECT controls off while the operation is still waiting for exactly that answer. A caller that polls therefore MUST pass what it holds.

Return type:

GenericAlias[TypeVar(ReviewProjectionT, bound= BaseModel)]

Parameters: