Quick Start
1
Default β private, 1:1 (nothing to configure)
Todayβs behaviour is unchanged. A session is
PRIVATE and stays bound to its single owner.2
Share a session read-only
Set
READ_ONLY so an extra client may attach as a VIEWER to watch the transcript, but not send.3
Share a session for co-driving
Set
SHARED so an extra client may attach as a MEMBER and co-drive β sending turns alongside the owner.Sharing is additive. A
PRIVATE session keeps a single OWNER observer β everything that worked before still works.How It Works
Two clients attach to one session, a turn fires, and both receive the stream β but a viewerβs send is rejected.- The owner starts a session β it is
PRIVATEby default. - Raising visibility to
SHAREDorREAD_ONLYlets a second authorised client attach. - Each attached client holds a role:
OWNER,MEMBER, orVIEWER. - The turn stream fans out to every observer, filtered by their
OperatorScope.
Visibility
Visibility decides whether a second authorised client may attach on top of scope authorisation.Roles
A role decides what an attached client may do inside a shared session.Which visibility should I pick?
Configuration
Every value maps to a wire string used on the protocol.SessionVisibility
SessionSharingRole
All imports use the friendly top-level path:
User Interaction Flow
Alice starts a research session on her laptop, opens it read-only on her phone to watch tokens stream, then Bob joins as aMEMBER to help steer the next turn.
Observer Protocol
SessionObserverProtocol is the @runtime_checkable contract every client agrees on for attaching, detaching, and enumerating observers.
attach adds an observer rather than re-pointing ownership β a PRIVATE session still keeps its single OWNER.
Interaction with Operator Scopes
Visibility and role layer on top ofOperatorScope β they are not authorisation.
An observer without the READ scope receives nothing regardless of role, and a MEMBER still needs WRITE to send. Visibility gates whether a client may attach; scopes gate what they may do once attached.
Gateway Operator Scopes
Role-based access control that visibility and roles build on top of
Best Practices
Default to PRIVATE
Default to PRIVATE
Keep sessions
PRIVATE unless a real collaboration case exists. Sharing is opt-in and additive.Detach viewers on disconnect
Detach viewers on disconnect
Call
detach when a client drops so the observer set stays clean and fan-out stays cheap.Combine with OperatorScope
Combine with OperatorScope
Visibility is not authorisation. Pair sharing with scopes so an observer without
READ receives nothing.Related
Operator Scopes
Least-privilege RBAC that sharing layers on top of
Session Continuity
One owner reconnecting to one session
Session Persistence
Durable session state across restarts
Handshake Protocol
Version negotiation and connection setup

