Skip to content

T3Backend

Base classes

Name Children Inherits
Protocol
typing
Base class for protocol classes.

â‹” Inheritance diagram

graph TD
  2955408455["state.T3Backend"]
  1073422405["typing.Protocol"]
  3481597255["typing.Generic"]
  2751680898["builtins.object"]
  1073422405 --> 2955408455
  3481597255 --> 1073422405
  2751680898 --> 3481597255

🛈 DocStrings

Bases: Protocol

Transport seam for the T3 TUI (implemented by live native RPC and demo mode).

Source code in src/acptui/t3/state.py
class T3Backend(Protocol):
    """Transport seam for the T3 TUI (implemented by live native RPC and demo mode)."""

    def subscribe_shell(
        self, *, after_sequence: int | None = None
    ) -> AsyncIterator[ShellStreamItem]:
        """Stream workspace projects and threads."""
        ...

    def subscribe_thread(
        self, thread_id: str, *, after_sequence: int | None = None
    ) -> AsyncIterator[ThreadStreamItem]:
        """Stream a single thread's snapshot and live events."""
        ...

    async def send_message(
        self,
        thread_id: str,
        text: str,
        *,
        model_selection: Mapping[str, JsonValue] | None = None,
    ) -> int:
        """Send a user message to `thread_id`."""
        ...

    async def stop_thread(self, thread_id: str) -> int:
        """Stop the active run on `thread_id`."""
        ...

    async def visit_thread(self, thread_id: str) -> int:
        """Mark `thread_id` as visited."""
        ...

    async def respond_to_request(
        self,
        thread_id: str,
        request_id: str,
        *,
        decision: ApprovalDecision | None = None,
        answers: Mapping[str, JsonValue] | None = None,
    ) -> int:
        """Respond to a pending approval or user-input request."""
        ...

    async def create_thread(
        self,
        project_id: str,
        title: str,
        *,
        model_selection: Mapping[str, JsonValue],
    ) -> tuple[str, int]:
        """Create a new thread in `project_id`."""
        ...

create_thread async

create_thread(
    project_id: str, title: str, *, model_selection: Mapping[str, JsonValue]
) -> tuple[str, int]

Create a new thread in project_id.

Source code in src/acptui/t3/state.py
async def create_thread(
    self,
    project_id: str,
    title: str,
    *,
    model_selection: Mapping[str, JsonValue],
) -> tuple[str, int]:
    """Create a new thread in `project_id`."""
    ...

respond_to_request async

respond_to_request(
    thread_id: str,
    request_id: str,
    *,
    decision: ApprovalDecision | None = None,
    answers: Mapping[str, JsonValue] | None = None,
) -> int

Respond to a pending approval or user-input request.

Source code in src/acptui/t3/state.py
async def respond_to_request(
    self,
    thread_id: str,
    request_id: str,
    *,
    decision: ApprovalDecision | None = None,
    answers: Mapping[str, JsonValue] | None = None,
) -> int:
    """Respond to a pending approval or user-input request."""
    ...

send_message async

send_message(
    thread_id: str, text: str, *, model_selection: Mapping[str, JsonValue] | None = None
) -> int

Send a user message to thread_id.

Source code in src/acptui/t3/state.py
async def send_message(
    self,
    thread_id: str,
    text: str,
    *,
    model_selection: Mapping[str, JsonValue] | None = None,
) -> int:
    """Send a user message to `thread_id`."""
    ...

stop_thread async

stop_thread(thread_id: str) -> int

Stop the active run on thread_id.

Source code in src/acptui/t3/state.py
async def stop_thread(self, thread_id: str) -> int:
    """Stop the active run on `thread_id`."""
    ...

subscribe_shell

subscribe_shell(*, after_sequence: int | None = None) -> AsyncIterator[ShellStreamItem]

Stream workspace projects and threads.

Source code in src/acptui/t3/state.py
def subscribe_shell(
    self, *, after_sequence: int | None = None
) -> AsyncIterator[ShellStreamItem]:
    """Stream workspace projects and threads."""
    ...

subscribe_thread

subscribe_thread(
    thread_id: str, *, after_sequence: int | None = None
) -> AsyncIterator[ThreadStreamItem]

Stream a single thread's snapshot and live events.

Source code in src/acptui/t3/state.py
def subscribe_thread(
    self, thread_id: str, *, after_sequence: int | None = None
) -> AsyncIterator[ThreadStreamItem]:
    """Stream a single thread's snapshot and live events."""
    ...

visit_thread async

visit_thread(thread_id: str) -> int

Mark thread_id as visited.

Source code in src/acptui/t3/state.py
async def visit_thread(self, thread_id: str) -> int:
    """Mark `thread_id` as visited."""
    ...

:fa-brands-github: Show source on GitHub