Skip to main content

tracevault_cli/hooks/
codex.rs

1use std::path::Path;
2use tracevault_protocol::streaming::StreamEventRequest;
3
4use super::HookAdapter;
5
6/// Placeholder Codex adapter for the (currently dormant) `HookAdapter` trait.
7///
8/// Codex capture does NOT go through this trait — the live path stamps the
9/// agent via `commands::stream::stamp_agent` (tool="codex", protocol v2) and
10/// reads the rollout with the shared `read_new_transcript_lines`. This type
11/// exists so `DetectedTool::Codex::adapter()` reports the correct `tool_name`
12/// ("codex") rather than borrowing the Claude adapter's "claude-code" label,
13/// mirroring the `CursorAdapter` stub. The parse methods are intentionally
14/// unimplemented here.
15pub struct CodexAdapter;
16
17impl HookAdapter for CodexAdapter {
18    fn tool_name(&self) -> &str {
19        "codex"
20    }
21
22    fn parse_event(&self, _raw: &str) -> Result<StreamEventRequest, String> {
23        Err("Codex hook adapter not implemented (capture uses stamp_agent)".to_string())
24    }
25
26    fn parse_transcript(&self, _path: &Path) -> Result<Vec<serde_json::Value>, String> {
27        Err("Codex transcript parsing not implemented (capture uses stamp_agent)".to_string())
28    }
29}