Remove stepCount/stepSize; patterns own their geometry
The stepCount and stepSize knobs were two controls for one quantity users actually care about (reach), and the number of steps is an implementation detail nobody meaningfully tunes. Each pattern has a natural size and resolution — a jitter is inherently small, an arc a broad curve — so those now live as constants in each strategy rather than as global config. - strategies.ts: each pattern defines its own step count and size; MoveContext drops `config` down to pure geometry (start/width/height/rng), and the module no longer imports Config at all (dissolving the type-only-import cycle workaround). line stays byte-for-byte: 250 one-pixel steps. - executor.ts: executePath takes `config` for pacing (stepDelay); the path itself needs nothing from it. - config.ts / cli.ts / move.ts / config.default.json: drop stepCount and stepSize from the type, seed, validation, resolver, CLI flags (-n, -s), and help. stepDelay stays as the one pacing lever. - configFile.ts: tolerate the removed keys instead of rejecting them — every pre-1.3.0 install seeded stepCount, so a hard "unknown key" failure on upgrade is avoided. They're ignored with a one-line stderr notice; genuine unknown keys still error. The -n/--step-count CLI flag (shipped since 1.0.0) is now an unknown option; config files degrade gracefully, command lines don't. Stays in the unpushed 1.3.0 release. 64 tests pass.
This commit is contained in:
+10
-5
@@ -11,8 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Pluggable movement strategies. New `-p, --pattern <name>` flag and
|
||||
`pattern` config key select how the cursor moves: `line` (default,
|
||||
unchanged behavior), `diagonal`, `jitter`, `walk`, `arc`, `figureEight`.
|
||||
- `-s, --step-size <pixels>` decouples pixels-per-step from `stepCount`
|
||||
(which is now a step *count*, not a pixel distance). Default `1`.
|
||||
Each pattern owns its own size and step count as constants; there is no
|
||||
user knob for sweep magnitude.
|
||||
- Pattern names are matched leniently: case and separators are ignored, so
|
||||
`figureEight`, `figure-eight`, `figure_eight`, and `FIGUREEIGHT` are all
|
||||
accepted (on the CLI and in the config file) and resolve to the canonical
|
||||
@@ -36,9 +36,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- `mouse.config.autoDelayMs = 0` moved from `runKeeper` into
|
||||
`createNutDevice` — the single place nut.js is wired up.
|
||||
- `runKeeper(config, device?)` accepts an injected device for testing.
|
||||
- `jitter`'s radius now scales with the sweep length (like the other
|
||||
patterns) instead of `stepSize` alone, so it produces real cursor motion
|
||||
at the default `stepSize` of 1 rather than hovering within a 2px radius.
|
||||
- Interrupt detection tolerates a small (2px) gap between the commanded and
|
||||
read-back cursor position, and the `clamp`/`reflect` patterns stay a few
|
||||
pixels off the screen edge. Together these avoid false "user activity"
|
||||
@@ -46,6 +43,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
which the new edge-seeking patterns would otherwise hit. `line` (policy
|
||||
`abort`) is unaffected.
|
||||
|
||||
### Removed
|
||||
- `-n, --step-count` flag and the `stepCount` / `stepSize` config keys. Sweep
|
||||
size and step count are now intrinsic to each movement pattern, not user
|
||||
knobs. Config files that still contain these keys keep working: the loader
|
||||
ignores them with a one-line notice instead of rejecting them, so existing
|
||||
installs (all seeded with `stepCount`) don't break on upgrade. The removed
|
||||
CLI flag, however, is a hard error like any other unknown option.
|
||||
|
||||
## [1.2.0] - 2026-06-17
|
||||
|
||||
### Added
|
||||
|
||||
Reference in New Issue
Block a user