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

Function notify_cursor_after_file_edit

src/hooks/cursor.rs:592–609  ·  view source on GitHub ↗

Best-effort daemon notification for Cursor `afterFileEdit`. Resolves the edited repo-relative paths locally, then lets the daemon own scheduling and sync execution. No-ops when no in-project paths were edited.

(event_json: &str)

Source from the content-addressed store, hash-verified

590/// Resolves the edited repo-relative paths locally, then lets the daemon own
591/// scheduling and sync execution. No-ops when no in-project paths were edited.
592async fn notify_cursor_after_file_edit(event_json: &str) {
593 let Some(root) = cursor_project_root_from_event(event_json) else {
594 return;
595 };
596 if !crate::tracedecay::TraceDecay::has_initialized_store(&root).await {
597 return;
598 }
599 let rels = cursor_after_file_edit_rel_paths(event_json, &root);
600 if rels.is_empty() {
601 return;
602 }
603 crate::daemon::notify_hook_event(
604 &root,
605 crate::daemon::DaemonHookEvent::cursor_after_file_edit(rels)
606 .with_route(hook_route_metadata_from_event(event_json, &root)),
607 )
608 .await;
609}
610
611/// Best-effort daemon notification for Cursor `afterShellExecution`.
612async fn notify_cursor_after_shell_event(event_json: &str) {

Callers 1

Calls 6

notify_hook_eventFunction · 0.85
with_routeMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected