feat: add Windows headless daemon support via Task Scheduler

Adds Windows branches to all 5 service commands (install/start/stop/
status/uninstall) using schtasks to register a "ZeroClaw Daemon"
scheduled task that runs at logon with highest privileges. A wrapper
.cmd script handles stdout/stderr redirection to the logs directory.

Also fixes symlink_tests.rs to compile on Windows by using the
correct std::os::windows::fs::symlink_dir API.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jbradf0rd 2026-02-15 00:05:17 -06:00
parent 9d0e29972c
commit 13748b590c
2 changed files with 149 additions and 7 deletions

View file

@ -50,19 +50,22 @@ mod tests {
}
// Test case 3: Non-Unix platforms should handle symlink errors gracefully
#[cfg(not(unix))]
#[cfg(windows)]
{
let source_dir = tmp.path().join("source_skill");
std::fs::create_dir_all(&source_dir).unwrap();
let dest_link = skills_path.join("linked_skill");
// Symlink should fail on non-Unix
let result = std::os::unix::fs::symlink(&source_dir, &dest_link);
assert!(result.is_err());
// Directory should not exist
assert!(!dest_link.exists());
// On Windows, creating directory symlinks may require elevated privileges
let result = std::os::windows::fs::symlink_dir(&source_dir, &dest_link);
// If symlink creation fails (no privileges), the directory should not exist
if result.is_err() {
assert!(!dest_link.exists());
} else {
// Clean up if it succeeded
let _ = std::fs::remove_dir(&dest_link);
}
}
// Test case 4: skills_dir function edge cases