pub struct TracevaultConfig {
pub agent: String,
pub server_url: Option<String>,
pub api_key: Option<String>,
pub org_slug: Option<String>,
pub repo_id: Option<String>,
pub user_context: Option<UserContext>,
pub remote_id: Option<String>,
pub codebase_name: Option<String>,
pub default_project: Option<String>,
}Fields§
§agent: String§server_url: Option<String>§api_key: Option<String>§org_slug: Option<String>§repo_id: Option<String>§user_context: Option<UserContext>§remote_id: Option<String>The remote (codebase)’s server-side id, resolved by init (best-effort)
via resolve_remote. Display-only today — repo_id stays authoritative
for ingest — but recorded so a future caller doesn’t have to re-resolve.
codebase_name: Option<String>The codebase’s registered name, resolved by init alongside remote_id.
Display-only — lets bound-mode status print the codebase without an
extra network round-trip.
default_project: Option<String>Client-side default project name for this repo (no server counterpart). Resolution precedence rung 3; resolved to an id at use time.
Implementations§
Source§impl TracevaultConfig
impl TracevaultConfig
pub fn config_dir(project_root: &Path) -> PathBuf
pub fn config_path(project_root: &Path) -> PathBuf
Sourcepub fn ensure_gitignore(config_dir: &Path) -> Result<()>
pub fn ensure_gitignore(config_dir: &Path) -> Result<()>
Ensure a .gitignore exists inside config_dir (a .tracevault/ dir)
so runtime artifacts are ignored no matter where the directory was
created — including the per-subproject .tracevault/ dirs the stream
hook may create from a nested working directory. Idempotent: an existing
.gitignore is never overwritten. Best-effort; callers may ignore the
result (a failure must never break the hook).
pub fn to_toml(&self) -> String
Sourcepub fn try_load(project_root: &Path) -> Result<Option<Self>, String>
pub fn try_load(project_root: &Path) -> Result<Option<Self>, String>
Load config.toml, distinguishing a missing file (Ok(None)) from a
present-but-malformed one (Err(message)). Callers that need to react
differently to those two cases (e.g. to avoid silently writing to a
default path when a configured one failed to parse) should use this.
Only a genuine “not found” counts as missing; any other IO error (e.g.
permission denied) is surfaced as Err with the path, rather than being
masked as an absent config.