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

Function cursor_prompt_hint

src/hooks/cursor.rs:142–165  ·  view source on GitHub ↗

Deduped prompt-hint decision for a Cursor `beforeSubmitPrompt` event, mirroring [`super::codex::codex_prompt_hint`]. Runs the same prompt-path `decide_hint` (session recall, project context, call graph, impact categories) and suppresses hints already emitted for the session / in uninitialized workspaces.

(event_json: &str)

Source from the content-addressed store, hash-verified

140/// (session recall, project context, call graph, impact categories) and suppresses
141/// hints already emitted for the session / in uninitialized workspaces.
142fn cursor_prompt_hint(event_json: &str) -> Option<ToolHint> {
143 let parsed = serde_json::from_str::<Value>(event_json).ok()?;
144 let hint = decide_hint(&ToolHintInput {
145 agent: HintAgent::Cursor,
146 session_id: event_session_id(&parsed),
147 tool_name: None,
148 command: None,
149 prompt: prompt_like_text(&parsed),
150 subagent_type: None,
151 file_path: None,
152 hints_enabled: true,
153 })?;
154 let root = cursor_project_root_candidate_from_parsed_event(&parsed);
155 let hint_id = mint_hint_id();
156 record_hint_analytics(
157 root.as_deref(),
158 "hint_candidate",
159 HintAgent::Cursor,
160 event_session_id(&parsed).as_deref(),
161 &hint_id,
162 &hint,
163 );
164 deduped_cursor_hint(event_json, &hint_id, hint)
165}
166
167async fn cursor_prompt_memory_recall(event_json: &str) -> Option<String> {
168 let parsed = serde_json::from_str::<Value>(event_json).ok()?;

Calls 7

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