Skip to content

Add snapshot/restore tools for undo workflow #13

Description

@willibrandon

Feature Request

Add snapshot and restore tools to enable try-apply-revert workflows.

Motivation

Users need the ability to experiment with operations and revert if results are unsatisfactory. Currently, there's no way to undo operations without manually backing up files.

Proposed Solution

Add three new tools for snapshot management:

1. create_snapshot

Creates a temporary backup of sprite state.

Input:

{
  "sprite_path": "sprite.aseprite"
}

Output:

{
  "success": true,
  "snapshot_id": "snap_1234567890",
  "snapshot_path": "/tmp/pixel-mcp/snapshots/snap_1234567890.aseprite",
  "created_at": "2025-10-18T23:45:00Z"
}

2. restore_snapshot

Reverts sprite to a previous snapshot.

Input:

{
  "sprite_path": "sprite.aseprite",
  "snapshot_id": "snap_1234567890"
}

Output:

{
  "success": true,
  "restored_from": "snap_1234567890"
}

3. delete_snapshot

Cleans up snapshot files.

Input:

{
  "snapshot_id": "snap_1234567890"
}

Output:

{
  "success": true,
  "deleted": "snap_1234567890"
}

Usage Pattern

1. create_snapshot → snap_123
2. apply_auto_shading → success
3. User reviews result
4. If bad: restore_snapshot(snap_123)
5. If good: delete_snapshot(snap_123)

Implementation Notes

  • Store snapshots in temp directory (configurable)
  • Use timestamp-based IDs for uniqueness
  • Implement automatic cleanup (delete snapshots older than 24 hours)
  • Consider memory limits (max 10 snapshots per sprite)
  • Snapshots should be sprite copies, not full state dumps

Future Enhancements

  • List all snapshots for a sprite
  • Named snapshots (not just IDs)
  • Snapshot metadata (operation that triggered it)
  • Automatic snapshot before destructive operations

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions