visdom_cli/components/mod.rs
1//! The parts of Visdom a project is wired to. Each component turns what it
2//! finds into [`crate::finding::Finding`]s; none of them changes anything.
3
4use std::path::PathBuf;
5
6use tracevault_cli::agent::Agent;
7
8use crate::agents::Workdir;
9use crate::mode::TracingMode;
10
11pub mod bazaar;
12pub mod tracing;
13
14/// Whether the tracing library found a credential for this project.
15#[derive(Clone, Debug, PartialEq, Eq)]
16pub enum CredentialState {
17 Present,
18 Missing,
19 /// There is one, but it cannot be used as configured (the reason).
20 Unusable(String),
21 /// The credential file exists but could not be read (its path).
22 Unreadable(String),
23}
24
25/// Everything the checks look at, gathered once.
26#[derive(Clone, Debug)]
27pub struct CheckContext {
28 /// Where `visdom` runs. `.tracevault/` and the git hooks belong to the
29 /// primary checkout.
30 pub workdir: Workdir,
31 pub home: PathBuf,
32 /// `$CODEX_HOME`, or `~/.codex`.
33 pub codex_home: PathBuf,
34 pub agent: Agent,
35 pub mode: TracingMode,
36 /// The tracing server this project (or the login) points at.
37 pub server_url: Option<String>,
38 pub credential: CredentialState,
39}