fix(cli): declare projectConfig on the scroll --until flag
What broke
Main is red at 6d08de4609 (CI run https://github.com/callstack/agent-device/actions/runs/34494219071; failing jobs: Typecheck & Package, Repo Guards "Check numeric ranges", Integration Tests):
src/commands/cli-grammar/flag-definitions-action.ts(144,3): error TS2322: Type '{ key: "until"; names: [string]; type: "string"; usageLabel: string; usageDescription: string; }' is not assignable to type 'FlagDefinition'.
Type '{ key: "until"; ... }' is not assignable to type 'FlagDefinitionBody & { key: RecordableFlagKey; recorded: boolean; }'.
Property 'projectConfig' is missing in type '{ key: "until"; ... }' but required in type 'FlagDefinitionBody'.
Cause
Two PRs, each green on its own base, landed in an order that broke main:
- #2436 (
feat(scroll): find off-screen targets in one command with --until) added theuntilflag declaration without aprojectConfig/recordedpair, which was valid at the time it branched. - #2453 (
refactor(commands): declare project-config admission and recorder sanitization on the flag declaration) madeprojectConfig(andrecorded) required fields on everyFlagDefinition, and merged first.
#2436 was never rebased onto #2453's stricter type, so its until declaration is missing both required fields.
Fix
Add projectConfig: true, recorded: false to the until declaration in src/commands/cli-grammar/flag-definitions-action.ts, matching its immediate siblings in the same file — the other Scroll: gesture flags durationMs (--duration-ms) and pixels (--pixels), which both carry projectConfig: true, recorded: false.
projectConfig: truematches the file's default posture for ordinary action parameters (perflag-registry.ts'sprojectConfigFlagKeys()/src/cli-schema/cli-config.ts, this only controls whetheragent-device.jsonmay set the flag;falseis reserved for one-shot/session-lifecycle flags like--help,--version,--foreground,--save-script, none of which apply to--until).recorded: falsematchesdurationMs/pixelsexactly: it keeps--untilout ofSessionAction.flagson the.adrecorder, consistent with how the other scroll-gesture parameters are treated.
No other change. This is the smallest possible fix for the compile error.
Verification (in a fresh worktree off origin/main)
pnpm typecheck— passespnpm lint— passespnpm vitest run src/commands/cli-grammar/— 3 files / 10 tests passpnpm check:layering— OK (221/221)pnpm gate freerange(the "Check numeric ranges" CI step) — 0 findingspnpm formatthengit status --short— touches only the one changed file