Skip to content

feat(capture): reload the extension from the CLI - #47

Merged
wolfgang-aura merged 1 commit into
mainfrom
feat/cli-reload
Oct 5, 2026
Merged

wolfgang-aura merged 1 commit into
mainfrom
feat/cli-reload

Conversation

@wolfgang-aura

Copy link
Copy Markdown
Owner

Adds node scripts/sourcecapsule-capture.mjs --reload, which loads a rebuilt dist/ without a browser restart.

  • The worker handles a reload action. It replies first, then calls chrome.runtime.reload(). The new worker reconnects to a new host when it starts, and the 30s alarm is the backstop.
  • The CLI polls ping for up to 45s and prints the pong with reloaded: true.
  • An extension built before this change answers unknown_action. The CLI then exits 1 and says that build needs one reload from brave://extensions.
  • AGENTS.md documents it.

Tests: test/native-host.test.mjs covers both the reload path and the old-build path against a fake pipe server. npm test, lint and format check pass.

🤖 Generated with Claude Code

`--reload` asks the service worker to call chrome.runtime.reload() and
waits until the fresh worker's native host answers a ping, so a rebuilt
dist/ loads without restarting the browser. An older build answers
unknown_action and the CLI says it needs one manual reload.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wolfgang-aura
wolfgang-aura merged commit 664341c into main Oct 5, 2026
1 check 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