Directory aspect detection
State: open/verified · Kind: module · Audience: system
Summary
Section titled “Summary”- Classifies a directory by marker subdirectories (
.git/,.obsidian/) into anAspectenum, and resolves an Obsidian vault’s own vault id from Obsidian’s global config. - Published standalone to crates.io as the fleet’s first crate on the snapshot-mirror publishing channel.
Statement
Section titled “Statement”Desktop tooling that opens arbitrary directories (vault pickers, project registries) needs to know
cheaply what kind of folder it has before enabling kind-specific behavior. detect_aspects checks
for .git/ and .obsidian/ and returns a Vec<Aspect> that always includes Generic.
detect_obsidian_vault_id reads Obsidian’s own obsidian.json so a moved vault is recognized by
its existing id rather than re-minted.
What it provides
Section titled “What it provides”detect_aspects(path) -> Vec<Aspect>: marker-directory classification.detect_obsidian_vault_id(path) -> Option<String>: the Obsidian-assigned vault id, forobsidian://open?vault-id=...links.Aspectserializes as lowercase strings; the optionalspectafeature derives Tauri/TypeScript bindings.- No workspace dependencies; tested and publishable on its own.
Underlying implementation
Section titled “Underlying implementation”packages/rust/dir-aspect/src/lib.rs: the whole crate, with unit tests.
Locations
Section titled “Locations”packages/rust/dir-aspect/packages/rust/dir-aspect/src/lib.rs#Aspectpackages/rust/dir-aspect/src/lib.rs#detect_aspectspackages/rust/dir-aspect/src/lib.rs#detect_obsidian_vault_id