pub struct WorkspaceContext {
pub root: PathBuf,
pub project_type: String,
pub project_name: String,
pub structure: Vec<String>,
pub is_git_repo: bool,
pub build_command: String,
pub test_command: String,
pub project_md: Option<(String, String)>,
pub additional_project_mds: Vec<(String, String)>,
}Expand description
Collected metadata about the workspace/repository the agent is operating in.
Fields§
§root: PathBufAbsolute path to the workspace root (current working directory).
project_type: StringDetected project type (e.g. “Rust”, “Node.js”, “Python”, “Unknown”).
project_name: StringProject name extracted from Cargo.toml / package.json / setup.py etc.
structure: Vec<String>Top-level directory listing (files and dirs, one level deep).
is_git_repo: boolWhether a .git directory exists.
build_command: StringDetected build command (e.g. “cargo build”, “npm run build”).
test_command: StringDetected test command.
project_md: Option<(String, String)>Contents of the discovered project instruction file (TINYHARNESS.md, AGENTS.md, etc.).
None if no file was found.
additional_project_mds: Vec<(String, String)>Additional project MD files loaded from .tinyharness/config.json’s
project_md_files field (e.g. RULES.md, .cursorrules).
Each entry is (filename, content). Empty if none configured.
Implementations§
Source§impl WorkspaceContext
impl WorkspaceContext
Sourcepub fn collect() -> Self
pub fn collect() -> Self
Collect workspace context from the current working directory.
Resolved from the ambient environment — use WorkspaceContext::collect_in
when the caller has a Paths.
Sourcepub fn collect_in(paths: &Paths) -> Self
pub fn collect_in(paths: &Paths) -> Self
Collect workspace context for an injected set of paths.
The workspace root is paths.project_dir(); global settings are read
from paths.settings_file() and project settings are discovered by
walking up from the root.