vibe.assistant.services.session_accessor

Session accessor interface for StreamTranslator.

This provides a clean interface for the StreamTranslator to access session state without being coupled to the specific implementation details of AssistantService.

SessionAccessor

Abstract interface for session state access.

read_state

read_state() -> dict[str, Any]

Read the current session state.

write_state

write_state(state: dict[str, Any]) -> None

Write the session state.

finalize_assistant

finalize_assistant(assistant_name: str) -> None

Finalize the assistant draft and store it in the Flask session.

This makes the finalized content available to {% assistant %} template tags and sets the session status to 'complete' for download functionality.

Parameters:
  • assistant_name (str) –

    The name of the assistant to finalize

AssistantSessionAccessor

Concrete implementation that delegates to AssistantService methods.

__init__

__init__(assistant_service: AssistantService) -> None

Initialize with reference to AssistantService.

Parameters:

read_state

read_state() -> dict[str, Any]

Delegate to AssistantService._read_state().

write_state

write_state(state: dict[str, Any]) -> None

Delegate to AssistantService._write_state().

finalize_assistant

finalize_assistant(assistant_name: str) -> None

Finalize the assistant draft and store it in the Flask session.

This makes the finalized content available to {% assistant %} template tags and sets the session status to 'complete' for download functionality.