Skip to content

refactor: replace hardcoded skipPreNav with declarative navigateBefore field#208

Merged
jackwener merged 1 commit intomainfrom
refactor/navigate-before
Mar 21, 2026
Merged

refactor: replace hardcoded skipPreNav with declarative navigateBefore field#208
jackwener merged 1 commit intomainfrom
refactor/navigate-before

Conversation

@jackwener
Copy link
Copy Markdown
Owner

Replace hardcoded cmd.site===boss check in execution.ts with a declarative navigateBefore field on CliCommand. Each adapter self-declares whether it needs pre-navigation for cookie context. All 14 boss adapters set navigateBefore:false. Fully backward compatible.

…e field

Browser adapters using COOKIE/HEADER strategy need the page on the target
domain so credentialed fetch() carries cookies. Previously, execution.ts
hardcoded `cmd.site === 'boss'` to skip this pre-navigation for adapters
that handle their own goto().

Now each adapter self-declares via `navigateBefore: false` on CliCommand.
This is more extensible — new sites that manage their own navigation just
add the field instead of editing execution.ts.

Changes:
- Add `navigateBefore?: boolean | string` to CliCommand interface
- Add `resolvePreNav()` helper in execution.ts (replaces hardcoded check)
- All 14 boss adapters declare `navigateBefore: false`
- Wire through discovery.ts (YAML + manifest) and build-manifest.ts
@jackwener jackwener merged commit a228758 into main Mar 21, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant