From a72369f6560bbc923da8d4bdb644fee3fc55d192 Mon Sep 17 00:00:00 2001 From: Butterfly Dev Date: Tue, 7 Apr 2026 05:58:28 +0000 Subject: [PATCH] =?UTF-8?q?docs:=20progress.md=20v3.6=20=E2=80=94=20system?= =?UTF-8?q?=20service=20installation=20(Linux=20systemd=20+=20Windows=20Se?= =?UTF-8?q?rvice)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- progress.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/progress.md b/progress.md index bdef2e4..2a54179 100644 --- a/progress.md +++ b/progress.md @@ -32,6 +32,33 @@ Wire protocol: ### Phase 3: VM Agent Executable ✅ - [x] Screen capture (scrap), input injection (enigo), auto-reconnect +### Phase 3.6: System Service Installation ✅ + +#### CLI Subcommands +- [x] `agent/src/cli.rs` — Subcommand-based CLI (`run`, `service install/uninstall/start/stop/status/restart`) +- [x] `agent/src/config.rs` — Renamed `AgentConfig` → `RunOptions`, added `Clone`, `to_service_args()`, hidden `--windows-service` flag + +#### Service Management (Linux systemd) +- [x] `agent/src/service.rs` — systemd unit file generation with proper `ExecStart`, restart policy, env capture +- [x] Auto-detects display environment variables (DISPLAY, WAYLAND_DISPLAY, XDG_RUNTIME_DIR, DBUS_SESSION_BUS_ADDRESS) +- [x] `systemctl enable --now` on install, `daemon-reload` after changes +- [x] Configurable user (`--user`), working directory (`--working-directory`), log file (`--log-file`) + +#### Service Management (Windows) +- [x] `agent/src/service.rs` — Windows Service registration via `sc.exe` (create, start, stop, delete, query) +- [x] Auto-start on boot, failure recovery (restart after 5s, reset after 1 day) +- [x] `agent/src/main.rs` — Full Windows Service runtime via `windows-service` crate (SCM dispatcher, service control handler, SERVICE_RUNNING/STOPPED state reporting) + +#### Graceful Shutdown +- [x] `tokio::signal::ctrl_c()` handler in foreground mode +- [x] `tokio::sync::watch` shutdown channel propagated through reconnect loop +- [x] WebSocket close frame sent on shutdown +- [x] Windows SCM STOP/SHUTDOWN events trigger clean shutdown +- [x] Reconnect loop checks shutdown before attempting reconnection + +#### Dependencies +- [x] `agent/Cargo.toml` — `windows-service 0.7` (cfg windows), `clap` env feature, `base64 0.22` + ### Phase 3.5: Low-Latency Video Pipeline ✅ #### Agent (H.264 + binary frames) @@ -64,6 +91,13 @@ Wire protocol: | **Total** | **25-45ms** | **~5-15ms** | ## Recent Commits +- `16f3f7a` fix: CLI dispatch, clap env feature, base64 dep, stray attribute cleanup +- `fdd1dcb` fix: resolve compilation errors from crate version mismatches (openh264, enigo, image APIs) +- `84f559c` agent: main.rs — subcommand CLI dispatch, shutdown signal (Ctrl+C + Windows SCM) +- `d0e8bf5` agent: service.rs — Linux systemd + Windows service management +- `920ea0e` agent: cli.rs — subcommand CLI (run, service install/uninstall/start/stop/status/restart) +- `7a44809` agent: config.rs — rename AgentConfig to RunOptions, add Clone, windows_service field +- `eae74e9` agent: Cargo.toml — add windows-service 0.7 dependency - `60b23bc` fix: Uint8Array to Blob cast for TS compatibility - `63e4513` frontend: WebCodes H.264 decoder, binary WS frames, AVCC description builder - `05cfe9e` server: binary frame relay (zero-copy), text JSON for control