delete claude code integration
This commit is contained in:
parent
24560042ea
commit
929415af3b
31 changed files with 120 additions and 2898 deletions
|
|
@ -1142,115 +1142,6 @@ pub fn show_status() -> Result<(), String> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
pub fn install_service() -> Result<(), String> {
|
||||
let exe = std::env::current_exe()
|
||||
.map_err(|e| format!("current_exe: {}", e))?;
|
||||
let home = std::env::var("HOME").map_err(|e| format!("HOME: {}", e))?;
|
||||
|
||||
let unit_dir = PathBuf::from(&home).join(".config/systemd/user");
|
||||
fs::create_dir_all(&unit_dir)
|
||||
.map_err(|e| format!("create {}: {}", unit_dir.display(), e))?;
|
||||
|
||||
let unit = format!(
|
||||
r#"[Unit]
|
||||
Description=poc-memory daemon — background memory maintenance
|
||||
After=default.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart={exe} agent daemon
|
||||
Restart=on-failure
|
||||
RestartSec=30
|
||||
Environment=HOME={home}
|
||||
Environment=PATH={home}/.cargo/bin:{home}/.local/bin:{home}/bin:/usr/local/bin:/usr/bin:/bin
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
"#, exe = exe.display(), home = home);
|
||||
|
||||
let unit_path = unit_dir.join("poc-memory.service");
|
||||
fs::write(&unit_path, &unit)
|
||||
.map_err(|e| format!("write {}: {}", unit_path.display(), e))?;
|
||||
eprintln!("Wrote {}", unit_path.display());
|
||||
|
||||
let status = std::process::Command::new("systemctl")
|
||||
.args(["--user", "daemon-reload"])
|
||||
.status()
|
||||
.map_err(|e| format!("systemctl daemon-reload: {}", e))?;
|
||||
if !status.success() {
|
||||
return Err("systemctl daemon-reload failed".into());
|
||||
}
|
||||
|
||||
let status = std::process::Command::new("systemctl")
|
||||
.args(["--user", "enable", "--now", "poc-memory"])
|
||||
.status()
|
||||
.map_err(|e| format!("systemctl enable: {}", e))?;
|
||||
if !status.success() {
|
||||
return Err("systemctl enable --now failed".into());
|
||||
}
|
||||
|
||||
eprintln!("Service enabled and started");
|
||||
|
||||
// Install poc-daemon service
|
||||
install_notify_daemon(&unit_dir, &home)?;
|
||||
|
||||
// Install memory-search + poc-hook into Claude settings
|
||||
crate::claude::hook::install_hook()?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Install the poc-daemon (notification/idle) systemd user service.
|
||||
fn install_notify_daemon(unit_dir: &Path, home: &str) -> Result<(), String> {
|
||||
let poc_daemon = PathBuf::from(home).join(".cargo/bin/poc-daemon");
|
||||
if !poc_daemon.exists() {
|
||||
eprintln!("Warning: poc-daemon not found at {} — skipping service install", poc_daemon.display());
|
||||
eprintln!(" Build with: cargo install --path .");
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let unit = format!(
|
||||
r#"[Unit]
|
||||
Description=poc-daemon — notification routing and idle management
|
||||
After=default.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart={exe} agent daemon
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
Environment=HOME={home}
|
||||
Environment=PATH={home}/.cargo/bin:{home}/.local/bin:{home}/bin:/usr/local/bin:/usr/bin:/bin
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
"#, exe = poc_daemon.display(), home = home);
|
||||
|
||||
let unit_path = unit_dir.join("poc-daemon.service");
|
||||
fs::write(&unit_path, &unit)
|
||||
.map_err(|e| format!("write {}: {}", unit_path.display(), e))?;
|
||||
eprintln!("Wrote {}", unit_path.display());
|
||||
|
||||
let status = std::process::Command::new("systemctl")
|
||||
.args(["--user", "daemon-reload"])
|
||||
.status()
|
||||
.map_err(|e| format!("systemctl daemon-reload: {}", e))?;
|
||||
if !status.success() {
|
||||
return Err("systemctl daemon-reload failed".into());
|
||||
}
|
||||
|
||||
let status = std::process::Command::new("systemctl")
|
||||
.args(["--user", "enable", "--now", "poc-daemon"])
|
||||
.status()
|
||||
.map_err(|e| format!("systemctl enable: {}", e))?;
|
||||
if !status.success() {
|
||||
return Err("systemctl enable --now poc-daemon failed".into());
|
||||
}
|
||||
|
||||
eprintln!("poc-daemon service enabled and started");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Drill down into a task's log file. Finds the log path from:
|
||||
/// 1. Running task status (daemon-status.json)
|
||||
/// 2. daemon.log started events (for completed/failed tasks)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue