Initial Agentsd project commit

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-09 15:09:56 +08:00
commit 1bf1f08f9a
41 changed files with 8106 additions and 0 deletions

12
core/agentsd/src/paths.rs Normal file
View File

@@ -0,0 +1,12 @@
use std::path::PathBuf;
/// Returns the `data/` directory next to the running executable.
/// Creates it if it does not exist.
pub fn data_dir() -> PathBuf {
let exe = std::env::current_exe().unwrap_or_else(|_| PathBuf::from("."));
let dir = exe.parent().unwrap_or_else(|| std::path::Path::new(".")).join("data");
if !dir.exists() {
std::fs::create_dir_all(&dir).ok();
}
dir
}