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

Function cursor_session_context_for_root

src/hooks/cursor.rs:294–303  ·  view source on GitHub ↗

Builds the lean Cursor `sessionStart` context for a resolved project root. Adds index freshness, the skill index, and tokens-saved counter that the always-on plugin rule cannot know.

(root: Option<&Path>)

Source from the content-addressed store, hash-verified

292/// Adds index freshness, the skill index, and tokens-saved counter that the
293/// always-on plugin rule cannot know.
294async fn cursor_session_context_for_root(root: Option<&Path>) -> String {
295 let (initialized, staleness, tokens_saved) = match root {
296 Some(r) if crate::tracedecay::TraceDecay::has_initialized_store(r).await => {
297 let (staleness, tokens_saved) = cursor_index_signals_for_root(r).await;
298 (true, staleness, tokens_saved)
299 }
300 _ => (false, None, None),
301 };
302 build_cursor_session_context(initialized, staleness.as_deref(), tokens_saved)
303}
304
305/// Cursor `afterShellExecution` hook handler.
306///

Callers 1

Calls 2

Tested by

no test coverage detected