Skip to content

attention

Class info

Classes

Name Children Inherits
Alert
acptui.ui.attention
An alert the app raised (kept for the record and for tests).
    Attention
    acptui.ui.attention
    A session wants the user's attention.
      TitleChanged
      acptui.ui.attention
      Something the terminal title shows changed (session title, waiting state).

        🛈 DocStrings

        Messages from sessions that want the user's attention, and how the app answers them.

        A session screen posts :class:Attention (the agent asks for permission or input, a turn ended, the agent failed); the app rings the bell, plays a sound and shows a desktop or terminal notification, as the [notifications] settings say. The terminal title names the session and is marked while an agent waits for the user.

        AttentionKind module-attribute

        AttentionKind = Literal['question', 'turn_end', 'error']
        

        Why: the agent waits for an answer, a turn ended, something failed.

        WAITING_MARK module-attribute

        WAITING_MARK = '● '
        

        Prefix of the terminal title while an agent waits for the user.

        Alert dataclass

        An alert the app raised (kept for the record and for tests).

        Source code in src/acptui/ui/attention.py
        @dataclass(frozen=True)
        class Alert:
            """An alert the app raised (kept for the record and for tests)."""
        
            kind: AttentionKind
            title: str
            message: str
            outside: bool
            """Whether it was sent outside the app (notification, sound)."""
        

        outside instance-attribute

        outside: bool
        

        Whether it was sent outside the app (notification, sound).

        Attention

        Bases: Message

        A session wants the user's attention.

        Source code in src/acptui/ui/attention.py
        class Attention(Message):
            """A session wants the user's attention."""
        
            def __init__(self, kind: AttentionKind, title: str, message: str, source: Screen) -> None:
                super().__init__()
                self.kind: AttentionKind = kind
                self.title = title
                self.message = message
                self.source = source
        

        TitleChanged

        Bases: Message

        Something the terminal title shows changed (session title, waiting state).

        Source code in src/acptui/ui/attention.py
        class TitleChanged(Message):
            """Something the terminal title shows changed (session title, waiting state)."""