MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / ingest_cursor_transcript_event

Function ingest_cursor_transcript_event

src/sessions/cursor.rs:384–389  ·  view source on GitHub ↗

Ingest the Cursor transcript referenced by a hook payload into the provider-neutral session/message tables for the provided database. Project hooks should pass the resolved project DB from [`open_project_session_db`]. Ingestion is **incremental**: it resumes from the byte offset recorded in the DB's `parse_offsets` table (via the shared [`crate::sessions::source`] driver), so each call only parse

(
    event_json: &str,
    db: &GlobalDb,
)

Source from the content-addressed store, hash-verified

382/// the last run rather than re-reading the whole file. Repeated calls on an
383/// unchanged file are a no-op.
384pub async fn ingest_cursor_transcript_event(
385 event_json: &str,
386 db: &GlobalDb,
387) -> CursorTranscriptIngestStats {
388 ingest_cursor_transcript_event_capped(event_json, db, None).await
389}
390
391/// Like [`ingest_cursor_transcript_event`], but bounds how many newly-appended
392/// bytes a single call will read. Cursor hooks pass byte caps to stay within hook

Tested by

no test coverage detected