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 gateway;
13pub mod tracing;
14
15/// Whether the tracing library found a credential for this project.
16#[derive(Clone, Debug, PartialEq, Eq)]
17pub enum CredentialState {
18 Present,
19 Missing,
20 /// There is one, but it cannot be used as configured (the reason).
21 Unusable(String),
22 /// The credential file exists but could not be read (its path).
23 Unreadable(String),
24}
25
26/// Everything the checks look at, gathered once.
27#[derive(Clone, Debug)]
28pub struct CheckContext {
29 /// Where `visdom` runs. `.tracevault/` and the git hooks belong to the
30 /// primary checkout.
31 pub workdir: Workdir,
32 pub home: PathBuf,
33 /// `$CODEX_HOME`, or `~/.codex`.
34 pub codex_home: PathBuf,
35 pub agent: Agent,
36 pub mode: TracingMode,
37 /// The tracing server this project (or the login) points at.
38 pub server_url: Option<String>,
39 pub credential: CredentialState,
40}