pub struct SessionFollower { /* private fields */ }Expand description
Poll-based follower for one persisted Claude Code, Codex, Pi, OpenCode, or Grok session.
Polling first compares cheap filesystem stamps. The source is fully parsed only after a relevant file changes. This keeps idle polling cheap while retaining the existing, well-tested format loaders as the source of truth.
Implementations§
Source§impl SessionFollower
impl SessionFollower
Sourcepub fn open_locator(locator: &SessionLocator) -> Result<Self>
pub fn open_locator(locator: &SessionLocator) -> Result<Self>
Open a persisted session using its durable catalog locator.
Sourcepub fn open_locator_with_fidelity(
locator: &SessionLocator,
fidelity: Fidelity,
) -> Result<Self>
pub fn open_locator_with_fidelity( locator: &SessionLocator, fidelity: Fidelity, ) -> Result<Self>
Self::open_locator at a declared fidelity.
A read-only mirror follows at Fidelity::Semantic so a compacted
transcript keeps streaming instead of turning every poll into a
watch_error. See crate::Session::load_with_fidelity.
Sourcepub fn open_locator_with_view(
locator: &SessionLocator,
fidelity: Fidelity,
include_subagents: bool,
message_limit: Option<usize>,
max_message_chars: Option<usize>,
display_history: bool,
) -> Result<Self>
pub fn open_locator_with_view( locator: &SessionLocator, fidelity: Fidelity, include_subagents: bool, message_limit: Option<usize>, max_message_chars: Option<usize>, display_history: bool, ) -> Result<Self>
Open a frontend-oriented follower whose snapshots contain only the
selected parent and at most message_limit trailing messages.
Sourcepub fn open(
path: impl Into<PathBuf>,
opencode_session: Option<&str>,
) -> Result<Self>
pub fn open( path: impl Into<PathBuf>, opencode_session: Option<&str>, ) -> Result<Self>
Open a local session for passive following.
opencode_session is valid only for an OpenCode SQLite store. When it
is omitted, the initially selected session is pinned for all later
polls rather than following whichever database row becomes newest.
Sourcepub fn open_with_fidelity(
path: impl Into<PathBuf>,
opencode_session: Option<&str>,
fidelity: Fidelity,
) -> Result<Self>
pub fn open_with_fidelity( path: impl Into<PathBuf>, opencode_session: Option<&str>, fidelity: Fidelity, ) -> Result<Self>
Self::open at a declared fidelity.
Sourcepub fn poll(&mut self) -> Result<Option<SessionWatchEvent>>
pub fn poll(&mut self) -> Result<Option<SessionWatchEvent>>
Inspect the filesystem once and return the next event, if any.
The first call always returns an initial snapshot. Later calls return
None while the relevant filesystem stamps are unchanged.