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

Function build_cursor_session_context

src/hooks/steering.rs:48–66  ·  view source on GitHub ↗

Builds the Cursor `sessionStart` `additional_context` text.

(
    initialized: bool,
    staleness_hint: Option<&str>,
    tokens_saved: Option<u64>,
)

Source from the content-addressed store, hash-verified

46
47/// Builds the Cursor `sessionStart` `additional_context` text.
48pub fn build_cursor_session_context(
49 initialized: bool,
50 staleness_hint: Option<&str>,
51 tokens_saved: Option<u64>,
52) -> String {
53 let mut s = index_status_line(initialized, staleness_hint);
54 if initialized {
55 append_tracedecay_bootstrap_context(&mut s);
56 s.push_str("Workflow skills: tracedecay:");
57 s.push_str(&CURSOR_PLUGIN_SKILLS.join(", "));
58 s.push_str(" — each maps a common workflow stage to the right tracedecay tools.\n");
59 if let Some(saved) = tokens_saved.filter(|saved| *saved > 0) {
60 s.push_str("Tokens saved by tracedecay this session: ");
61 s.push_str(&saved.to_string());
62 s.push_str(".\n");
63 }
64 }
65 s
66}
67
68/// One-line index freshness signal.
69pub(super) fn index_status_line(initialized: bool, staleness_hint: Option<&str>) -> String {

Calls 2

index_status_lineFunction · 0.85