🧐 What & Why
screenshot and record_video overwrite existing files without warning, risking data loss.
An explicit opt-in to overwrite makes destructive actions deliberate.
🛠️ Proposal
- Before writing, execute
fs.existsSync(absolutePath).
- If the file exists and
force/overwrite flag is not supplied, throw:
File already exists. Re-run with --overwrite to replace it.
- Add a
force?: boolean parameter (default false) to screenshot, mirroring the flag already available on record_video.
- Thread this flag into command-line args (
--force) where needed.
✅ Acceptance Criteria
⚠️ Backward Compatibility
Scripts relying on implicit overwrites must now pass --overwrite explicitly.