Files
Move/CHANGELOG.md
T
nokeo08 ec33648e74 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.
2026-08-14 12:56:22 -05:00

122 lines
5.3 KiB
Markdown

# Changelog
All notable changes to `move` are documented here.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.3.0] - 2026-08-06
### Added
- 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`.
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
name.
- `src/device.ts`: injectable `Device` seam over nut.js, enabling unit
tests for movement without the native binary or a real screen.
- `src/strategies.ts`: pure, per-pattern path generators plus the registry
and name validation.
- `src/executor.ts`: single `executePath` driver owning bounds policy
(`abort`/`clamp`/`reflect`), pacing, interrupt detection, and restore.
- Test suites for strategies, the executor (all bounds policies, rounding,
interrupt), and the keeper loop.
### Changed
- `simulateActivity` no longer hardcodes a straight-line sweep; it selects a
strategy from the registry and delegates execution to `executePath`. The
default `line` pattern is byte-for-byte the previous behavior.
- Interrupt detection now compares against the last *commanded* (rounded)
point rather than an ideal target, so fractional/curved paths don't
self-trip.
- `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.
- 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"
aborts from sub-pixel cursor placement on scaled or multi-monitor setups,
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
- `-e, --edit` flag opens the resolved config file in `$EDITOR`.
### Changed
- `keeper.ts` (and `@nut-tree-fork/nut-js`) is lazy-imported, so `--help`
and `--version` skip the nut.js load and start ~10x faster.
## [1.1.1] - 2026-06-17
### Changed
- Tests moved from `src/` to a top-level `tests/` directory.
- `tsconfig.json` sets `"types": ["bun"]` so VS Code resolves `bun:test`.
### Fixed
- `package.json` version now matches the published tag.
## [1.1.0] - 2026-06-17
### Added
- JSON config file support at `${XDG_CONFIG_HOME:-~/.config}/move/config.json`.
Precedence: CLI flags > config file > defaults. Strict validation.
- `-C, --config <path>` to override the default config path.
- Installer seeds `config.json` with project defaults on fresh install only.
- Bun test suite for `resolveConfig` and `loadConfigFile`.
### Changed
- Installer scripts now live in `scripts/`.
- `verbose` is now a first-class `Config` field; `resolveVerbose` removed.
- `CliError` extracted into `src/errors.ts`.
- `defaultConfigPath()` throws when both `$XDG_CONFIG_HOME` and `$HOME` are unset.
- `mouse.config.autoDelayMs = 0` moved into `runKeeper` (no module-load side effect).
- Runtime errors go through a `failRuntime` helper that mirrors `failUser`.
- `keeper.ts` declares a named `Logger` interface.
- `dev-setup.sh` is now POSIX `sh`.
- `tsconfig.json`: enabled `noUncheckedIndexedAccess` and `resolveJsonModule`.
## [1.0.1] - 2026-06-17
### Added
- End-user `install.sh` runnable via `curl ... | sh`. XDG-respecting, idempotent.
- `uninstall.sh` removes the wrapper and install tree; leaves Bun and user
config alone.
- `dev-setup.sh` for contributors.
### Removed
- `DISTRIBUTION-PLAN.md` (design notes, superseded by the implementation).
## [1.0.0] - 2026-06-15
Initial release.
### Added
- `move` CLI for keeping presence-tracking apps marked Available by nudging
the cursor after a configurable idle period.
- Flags: `-h/--help`, `-v/--version`, `-m/--move-interval`,
`-c/--check-interval`, `-d/--step-delay`, `-n/--step-count`, `-V/--verbose`.
- Quiet-by-default logging.
- Source split into `src/{move,cli,config,keeper}.ts`.
- `bin` entry + shebang so `bun link` registers `move` globally.
[1.3.0]: https://gitea.cahlen.com/nokeo08/Move/compare/v1.2.0...v1.3.0
[1.2.0]: https://gitea.cahlen.com/nokeo08/Move/compare/v1.1.1...v1.2.0
[1.1.1]: https://gitea.cahlen.com/nokeo08/Move/compare/v1.1.0...v1.1.1
[1.1.0]: https://gitea.cahlen.com/nokeo08/Move/compare/v1.0.1...v1.1.0
[1.0.1]: https://gitea.cahlen.com/nokeo08/Move/compare/v1.0.0...v1.0.1
[1.0.0]: https://gitea.cahlen.com/nokeo08/Move/releases/tag/v1.0.0