chore: add reset:dev script for clean dev-state restart#4
Open
skalkii wants to merge 1 commit into
Open
Conversation
Resets dev-mode TCC entries (Screen Recording + Microphone for the launchers that spawn the dev binary — Electron, iTerm, Terminal, VS Code, Cursor), removes the generic Electron dev dir, and kills any orphaned recorder/meet_detector processes spawned from this app's userData/bin directory. Designed to be safe alongside a packaged install of focusd on the same machine: - com.videodb.focusd (production bundle id) is intentionally excluded from the TCC reset list, so a packaged install keeps its grants. - Dev and prod share the userData dir (app.name = 'VideoDB Focusd' in both modes). The script aborts the userData wipe when it detects a packaged install at /Applications/VideoDB Focusd.app, unless --force is passed. - Process kill is path-scoped to userData/bin so it cannot hit unrelated processes. Fixes video-db#3 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/reset-dev.shand areset:devnpm script.Production safety
Care was taken so this does not clobber a packaged install:
com.github.Electron,com.googlecode.iterm2,com.apple.Terminal,com.microsoft.VSCode, and Cursor. The production bundle idcom.videodb.focusdis intentionally excluded, so a packaged install on the same machine keeps its grants.~/Library/Application Support/VideoDB Focusd/becauseapp.name = 'VideoDB Focusd'in both modes. The script checks for/Applications/VideoDB Focusd.appand aborts the userData wipe (with a clear--forceinstruction) when a packaged install is present. Other reset steps still run.pkill -f "VideoDB Focusd/bin/recorder"(andmeet_detector) — the full path means we cannot hit an unrelated process namedrecorder.safeStorageinside userData; removing userData removes the secret. Nosecurity delete-generic-passwordcalls, no risk of touching unrelated keychain entries.Usage
```bash
npm run reset:dev # standard reset (preserves userData when prod app installed)
npm run reset:dev -- --force # also wipes userData (use only if no packaged install)
```
Test plan
npm run reset:dev→ expect TCC + Electron dev dir + userData all cleared. Nextnpm run devruns the full onboarding flow from scratch./Applications/VideoDB Focusd.app:npm run reset:dev→ expect TCC + Electron dev dir cleared, userData preserved, abort message printed.npm run reset:dev -- --force→ expect everything cleared including userData.bash -n scripts/reset-dev.shpasses (syntax-only lint).reset:dbscript (still works independently).Fixes #3