Best-effort daemon notification for Cursor `afterShellExecution`.
(event_json: &str)
| 610 | |
| 611 | /// Best-effort daemon notification for Cursor `afterShellExecution`. |
| 612 | async 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`. |
| 636 | async fn notify_cursor_workspace_open(event_json: &str) { |
no test coverage detected