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

Function cursor_post_tool_use_decision

src/hooks/cursor.rs:371–391  ·  view source on GitHub ↗

Impure `postToolUse` path: [`evaluate_cursor_post_tool_use`] plus per-session hint dedupe persisted under the project's `.tracedecay/` dir.

(event_json: &str)

Source from the content-addressed store, hash-verified

369/// Impure `postToolUse` path: [`evaluate_cursor_post_tool_use`] plus
370/// per-session hint dedupe persisted under the project's `.tracedecay/` dir.
371pub fn cursor_post_tool_use_decision(event_json: &str) -> Option<String> {
372 let parsed: Value = serde_json::from_str(event_json).ok()?;
373 let hint = decide_hint(&cursor_tool_hint_input(&parsed))?;
374 let root = cursor_project_root_candidate_from_parsed_event(&parsed);
375 let hint_id = mint_hint_id();
376 record_hint_analytics(
377 root.as_deref(),
378 "hint_candidate",
379 HintAgent::Cursor,
380 event_session_id(&parsed).as_deref(),
381 &hint_id,
382 &hint,
383 );
384 let hint = deduped_cursor_hint(event_json, &hint_id, hint)?;
385 Some(
386 serde_json::json!({
387 "additional_context": format_tool_hint(&hint),
388 })
389 .to_string(),
390 )
391}
392
393/// Suppresses hints that were already emitted for this session.
394///

Calls 7

decide_hintFunction · 0.85
cursor_tool_hint_inputFunction · 0.85
mint_hint_idFunction · 0.85
record_hint_analyticsFunction · 0.85
deduped_cursor_hintFunction · 0.85
event_session_idFunction · 0.70