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

Function notify_cursor_after_shell_event

src/hooks/cursor.rs:612–633  ·  view source on GitHub ↗

Best-effort daemon notification for Cursor `afterShellExecution`.

(event_json: &str)

Source from the content-addressed store, hash-verified

610
611/// Best-effort daemon notification for Cursor `afterShellExecution`.
612async fn notify_cursor_after_shell_event(event_json: &str) {
613 let Ok(parsed) = serde_json::from_str::<Value>(event_json) else {
614 return;
615 };
616 let command = parsed
617 .get("command")
618 .and_then(Value::as_str)
619 .unwrap_or_default();
620 let Some(root) = cursor_project_root_from_event(event_json) else {
621 return;
622 };
623 if !crate::tracedecay::TraceDecay::has_initialized_store(&root).await {
624 return;
625 }
626 let cwd = cursor_event_cwd(&parsed).unwrap_or_else(|| root.clone());
627 crate::daemon::notify_hook_event(
628 &root,
629 crate::daemon::DaemonHookEvent::cursor_after_shell_execution(command.to_string(), cwd)
630 .with_route(hook_route_metadata_from_event(event_json, &root)),
631 )
632 .await;
633}
634
635/// Best-effort daemon notification for Cursor `workspaceOpen`.
636async fn notify_cursor_workspace_open(event_json: &str) {

Callers 1

hook_cursor_after_shellFunction · 0.85

Calls 5

cursor_event_cwdFunction · 0.85
notify_hook_eventFunction · 0.85
with_routeMethod · 0.80

Tested by

no test coverage detected