Skip to main content

tracevault_cli/hooks/
gsd.rs

1use std::path::Path;
2use tracevault_protocol::streaming::StreamEventRequest;
3
4use super::HookAdapter;
5
6/// Placeholder GSD (pi) adapter for the (currently dormant) `HookAdapter` trait.
7///
8/// GSD capture does NOT go through this trait — the live path is the
9/// embedded pi/GSD extension (installed by `commands::init::install_gsd_extension`
10/// under the user-global `~/.gsd/extensions/tracevault/`), which shells out to
11/// `tracevault stream --agent gsd` itself. This type exists so
12/// `DetectedTool::Gsd::adapter()` reports the correct `tool_name` ("gsd")
13/// rather than borrowing another adapter's label, mirroring the `CodexAdapter`
14/// and `CursorAdapter` stubs. The parse methods are intentionally
15/// unimplemented here.
16pub struct GsdAdapter;
17
18impl HookAdapter for GsdAdapter {
19    fn tool_name(&self) -> &str {
20        "gsd"
21    }
22
23    fn parse_event(&self, _raw: &str) -> Result<StreamEventRequest, String> {
24        Err("GSD hook adapter not implemented (capture uses the pi/GSD extension)".to_string())
25    }
26
27    fn parse_transcript(&self, _path: &Path) -> Result<Vec<serde_json::Value>, String> {
28        Err(
29            "GSD transcript parsing not implemented (capture uses the pi/GSD extension)"
30                .to_string(),
31        )
32    }
33}