pub struct CursorIO { /* private fields */ }Expand description
The facade most consumers want. Wraps a PathResolver and lazily
opens the SQLite database on demand.
Implementations§
Source§impl CursorIO
impl CursorIO
pub fn new() -> Self
pub fn with_resolver(resolver: PathResolver) -> Self
pub fn resolver(&self) -> &PathResolver
pub fn exists(&self) -> bool
pub fn db_path(&self) -> Result<PathBuf>
Sourcepub fn read_composer_headers(&self) -> Result<ComposerHeaders>
pub fn read_composer_headers(&self) -> Result<ComposerHeaders>
Read composer.composerHeaders verbatim.
Sourcepub fn list_composer_ids(&self) -> Result<Vec<String>>
pub fn list_composer_ids(&self) -> Result<Vec<String>>
All composer ids known to the database, including drafts. Use
Self::list_composers when you only want sessions that have at
least one bubble on disk.
Sourcepub fn list_composers(&self) -> Result<Vec<ComposerListing>>
pub fn list_composers(&self) -> Result<Vec<ComposerListing>>
Composer headers paired to whether they have any rendered
bubbles. Empty drafts (has_bubbles == false) are commonly
dropped by callers that want a session list.
Sourcepub fn list_session_metadata(&self) -> Result<Vec<CursorSessionMetadata>>
pub fn list_session_metadata(&self) -> Result<Vec<CursorSessionMetadata>>
Lightweight per-composer metadata for every composer that has at least one bubble on disk.
Sourcepub fn read_session_metadata(
&self,
composer_id: &str,
) -> Result<CursorSessionMetadata>
pub fn read_session_metadata( &self, composer_id: &str, ) -> Result<CursorSessionMetadata>
Lightweight metadata for one composer.
Sourcepub fn composer_exists(&self, composer_id: &str) -> Result<bool>
pub fn composer_exists(&self, composer_id: &str) -> Result<bool>
Whether the composer exists in the database (either as a header or as bubble rows).
Sourcepub fn read_session(&self, composer_id: &str) -> Result<CursorSession>
pub fn read_session(&self, composer_id: &str) -> Result<CursorSession>
Load one session fully (composer data + bubbles + referenced
content blobs) and attach the JSONL transcript path when the
composer’s workspace folder maps cleanly into
~/.cursor/projects/<slug>/agent-transcripts/<id>/<id>.jsonl.
Sourcepub fn locate_transcript(&self, session: &CursorSession) -> Option<PathBuf>
pub fn locate_transcript(&self, session: &CursorSession) -> Option<PathBuf>
Resolve the JSONL transcript path for a session, if the file exists on disk. Cursor only emits a transcript for agent-mode runs against a real on-disk workspace.