consolidate hardcoded paths into config, refactor apply_agent

Move prompts_dir into Config (was hardcoded ~/poc/memory/prompts).
Replace hardcoded ~/.claude/memory paths in spectral.rs, graph.rs,
and main.rs with store::memory_dir() or config::get(). Replace
hardcoded ~/.claude/projects in knowledge.rs and main.rs with
config::get().projects_dir.

Extract apply_agent_file() from cmd_apply_agent() — separates
file scanning from per-file JSON parsing and link application.
This commit is contained in:
ProofOfConcept 2026-03-08 21:16:52 -04:00
parent 52523403c5
commit 2f2c84e1c0
6 changed files with 96 additions and 96 deletions

View file

@ -51,6 +51,8 @@ pub struct Config {
pub context_groups: Vec<ContextGroup>,
/// Max concurrent LLM calls in the daemon.
pub llm_concurrency: usize,
/// Directory containing prompt templates for agents.
pub prompts_dir: PathBuf,
/// Separate Claude config dir for background agent work (daemon jobs).
/// If set, passed as CLAUDE_CONFIG_DIR so the daemon authenticates
/// with different OAuth credentials than the interactive session.
@ -81,6 +83,7 @@ impl Default for Config {
},
],
llm_concurrency: 1,
prompts_dir: home.join("poc/memory/prompts"),
agent_config_dir: None,
}
}
@ -138,6 +141,9 @@ impl Config {
if let Some(n) = cfg.get("llm_concurrency").and_then(|v| v.as_u64()) {
config.llm_concurrency = n.max(1) as usize;
}
if let Some(s) = cfg.get("prompts_dir").and_then(|v| v.as_str()) {
config.prompts_dir = expand_home(s);
}
if let Some(s) = cfg.get("agent_config_dir").and_then(|v| v.as_str()) {
config.agent_config_dir = Some(expand_home(s));
}