mirror of
https://github.com/lahfir/agent-desktop.git
synced 2026-08-06 06:00:39 +00:00
Splits every file over the 400 LOC cap that this branch's changes pushed
past it, and flattens the god-object arg/param structs the ledger flagged,
all behavior-preserving.
LOC splits:
- crates/macos/src/adapter.rs (437) -> adapter.rs (struct + shared helper)
plus adapter_observation.rs/adapter_actions.rs/adapter_input.rs/
adapter_system.rs, one per PlatformAdapter capability trait impl
- crates/macos/src/actions/chain.rs (458) -> chain.rs (orchestration) plus
chain_step_exec.rs (per-step dispatch) and chain_value_write.rs (verified
value writes); also moves its inline mod tests {} to sibling chain_tests.rs
and chain_value_write_tests.rs per the no-inline-tests contract
- src/dispatch/mod.rs (453) -> mod.rs (routing only) plus observation.rs,
interaction.rs, keyboard_mouse.rs, app_window.rs, clipboard.rs, system.rs,
mirroring its own notifications/parse/session/trace submodule split
- crates/core/src/commands/wait_tests.rs (422) -> notification-scenario
tests stay, text/menu-scenario tests move to wait_scenario_tests.rs; the
shared wait_args() baseline moves to the established wait_test_support.rs
- crates/core/src/commands/helpers_ref_action_tests.rs (489) -> split by
scenario into helpers_ref_action_dispatch_tests.rs and
helpers_ref_action_wait_tests.rs
God-object fixes (CLAUDE.md: no struct >7 fields, no fn >5 params):
- src/cli_args/system.rs WaitModeArgs (9 fields) -> WaitEventArgs{event,
window_id} flattens onto WaitArgs as a sibling of mode/predicate (not
nested inside WaitModeArgs): serde's #[serde(flatten)] cannot coexist
with #[serde(deny_unknown_fields)] on a struct that is both a flatten
target and a flatten owner, verified with an isolated repro. WaitModeArgs
now sits at exactly 7 fields
- src/cli_args/mod.rs and crates/core/src/commands/find.rs FindArgs (14
fields, both the CLI struct and its core twin) -> FindFilterArgs (7:
role/name/value/text/description/native_id/exact) + FindSelectionArgs (5:
count/first/last/nth/limit), both flattened back onto a 4-field FindArgs
- crates/core/src/locator.rs LocatorQuery (10 fields) -> IdentityPredicate
(role/name/description/native_id/value) + ContainmentPredicate
(has/has_not), flattened back on; call sites in commands/query.rs and
macos/tree/query.rs updated
- crates/core/src/ref_action_wait.rs execute_with_auto_wait/
execute_single_shot/execute_poll_loop (6-7 params) -> RefActionWaitCtx
{adapter, entry, ref_id, context}, mirroring ref_action::ResolvedRefAction
All #[command(flatten)]/#[serde(flatten)] regroupings preserve the exact
CLI flag surface and flat batch-JSON wire shape; verified via clap
try_parse_from and serde_json::from_value round-trip tests, plus a manual
end-to-end run of the built binary through find/wait --event --window-id.
|
||
|---|---|---|
| .. | ||
| core | ||
| ffi | ||
| linux | ||
| macos | ||
| windows | ||