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:
objectThe modal has no interaction to render.
- Parameters:
disposition (Literal['none'])
- class OperationModalReviewInteractionV1(interaction, projection, control, apply_enabled, reject_enabled)[source]¶
Bases:
GenericA registered safe REVIEW projection with its already-bound controls.
controlis 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 (ReviewProjectionT)
control (OperationBoundResponseControl)
apply_enabled (bool)
reject_enabled (bool)
-
interaction:
OperationReviewAvailableInteractionV1¶
-
control:
OperationBoundResponseControl¶
Bases:
objectA pending REVIEW whose safe projection could not currently be resolved.
- Parameters:
interaction (OperationReviewAvailableInteractionV1)
- class OperationModalUnsupportedInteractionV1(interaction)[source]¶
Bases:
objectA pending interaction this modal cannot yet render (INPUT or CHOICE).
- Parameters:
interaction (OperationUnsupportedInteractionV1)
-
interaction:
OperationUnsupportedInteractionV1¶
- async resolve_modal_interaction_state(controller, projection, *, current=None)[source]¶
Resolve the exact modal interaction state for the current projection.
currentis 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:
controller (OperationController)
projection (OperationPublicProjectionV1)
current (OperationModalInteractionStateV1 | None)