Commit 67f7330
refactor: extract clawdstrike-hushd-config crate, dedupe agent/hushd config types (#339)
Phase 1 P1-D of the desktop-agent refactor swarm. The desktop agent writes a
runtime YAML config that hushd must read. Both sides previously defined their
own private DTOs with the same field names. Drift between writer and reader
would silently break daemon startup at runtime, so this PR centralises the
on-disk format in a new shared crate, `clawdstrike-hushd-config`.
Crate layout:
- `runtime::RuntimeConfig` - top-level on-disk shape
- `siem::SiemConfig + ExportersConfig + per-provider configs`
- `spine::SpineConfig` - replaces hushd's local SpineConfig
- `webhook::GenericWebhookConfig + WebhookAuthConfig`
Writer (`apps/agent/src-tauri/src/daemon.rs`): dropped 14 local DTOs
(lines 81-202 pre-extraction) and replaced them with re-exports from the new
crate. The construction sites in `build_runtime_siem_config`,
`build_runtime_spine_config`, and `build_generic_webhook_exporter` now build
the shared types directly.
Reader (`crates/services/hushd/src/config.rs`): re-exports
`clawdstrike_hushd_config::SpineConfig` and drops the local copy. Added a
contract test that round-trips the writer's full sample YAML into hushd's
`Config` so future drift is caught at compile or test time. Added a legacy-YAML
test that proves existing on-disk configs with `keypair_path: String` still
deserialize into the shared `Option<PathBuf>` field.
Co-authored-by: bb-connor <bb-connor@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 6278bea commit 67f7330
13 files changed
Lines changed: 657 additions & 207 deletions
File tree
- apps/agent/src-tauri
- src
- crates
- libs/clawdstrike-hushd-config
- src
- services/hushd
- src
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
180 | 181 | | |
181 | 182 | | |
182 | 183 | | |
| 184 | + | |
183 | 185 | | |
184 | 186 | | |
185 | 187 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
0 commit comments