Single-commit clean baseline after security scrub of niche-tells, project codenames, internal jargon, and contributor-email leaks. Contents: - 100 Rust crates (_primitives/_rust/) - 37 agent manifests (_manifests/) + generated specs (_generated/) - 67 user-invocable skills (skills/) - 33 hooks (hooks/) - Composition blocks (_blocks/) - Documentation (docs/, README.md) - TS adapter packages (_ts_packages/) - Assembler (_assembler/) - Roles (_roles/) - Templates (_templates/) - Forgejo CI (.forgejo/) Author: Denis Parfionovich <info@greendragon.info> License: see LICENSE.
38 lines
1.4 KiB
Rust
38 lines
1.4 KiB
Rust
//! Path resolution for CLI flags.
|
|
//!
|
|
//! Constructor Pattern: this cube owns CLI default-path policy. Two
|
|
//! callers (handlers + scan_orchestrator) share these helpers so the
|
|
//! "where does the registry SQLite live by default" decision exists in
|
|
//! one place.
|
|
|
|
use std::path::PathBuf;
|
|
|
|
/// Resolve `--db <path>` or default to `~/.claude/registry.sqlite`.
|
|
/// Falls back to `/tmp/registry.sqlite` if `$HOME` is unset.
|
|
pub fn resolve_db(db: Option<PathBuf>) -> PathBuf {
|
|
db.unwrap_or_else(|| {
|
|
let home = std::env::var("HOME").unwrap_or_else(|_| "/tmp".to_string());
|
|
PathBuf::from(home).join(".claude").join("registry.sqlite")
|
|
})
|
|
}
|
|
|
|
/// Resolve `--kit-root` or default to current directory.
|
|
pub fn resolve_kit_root(root: Option<PathBuf>) -> PathBuf {
|
|
root.unwrap_or_else(|| std::env::current_dir().unwrap_or_else(|_| PathBuf::from(".")))
|
|
}
|
|
|
|
/// Resolve `--rules-root` or default to `~/.claude/rules`.
|
|
pub fn resolve_rules_root(root: Option<PathBuf>) -> PathBuf {
|
|
root.unwrap_or_else(|| {
|
|
let home = std::env::var("HOME").unwrap_or_else(|_| "/tmp".to_string());
|
|
PathBuf::from(home).join(".claude").join("rules")
|
|
})
|
|
}
|
|
|
|
/// Resolve `--hooks-root` or default to `~/.claude/hooks`.
|
|
pub fn resolve_hooks_root(root: Option<PathBuf>) -> PathBuf {
|
|
root.unwrap_or_else(|| {
|
|
let home = std::env::var("HOME").unwrap_or_else(|_| "/tmp".to_string());
|
|
PathBuf::from(home).join(".claude").join("hooks")
|
|
})
|
|
}
|