manage_backups
List, restore, or purge automatic Word backups. Restore replaces a file with a previous or anchor version, preserving the current version as a new backup for undo. Purge can dry-run first.
Instructions
Manage the automatic backups under the hidden .ks4w-backups/ folder next to each mutated document: two stable slots per document, prev (state before the most recent mutation) and anchor (session start). Snapshots from create_snapshot are permanent keepers this tool never touches.
action='list': slot files with sizes and mtimes, legacy .bak- files from the pre-v1.6 scheme, and orphaned slot folders whose source document is gone; give file_path for one document or directory for a folder.
action='restore': overwrite file_path with a backup; source is 'prev', 'anchor', or a legacy .bak- path. The current content rotates into prev FIRST, so a restore is itself undoable. Refuses documents open in Word; the payload is validated before the atomic replace.
action='purge': delete backups; scope: 'legacy', 'orphans', or 'slots'. dry_run defaults to TRUE (report only); dry_run=False deletes. Exact paths and sizes are reported either way.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scope | No | ||
| action | Yes | ||
| source | No | ||
| dry_run | No | ||
| directory | No | ||
| file_path | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||