Repository navigation
Let AI agents restructure guides with snapshots before deletions, step moves and screenshot changes - #185
Merged
Conversation
…shotting the guide before each change
5 tasks
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.
Issue
Closes #184
Summary
AI agents connected over MCP could only rewrite text and add things. Now they can also create and delete guides and steps, reorder steps, replace or remove screenshots, and delete blocks and annotations. Before deletions, step creation or moves, and screenshot changes, StepForge snapshots the existing guide so the user can undo them from More → Backups & snapshots. Creating a guide, text rewrites, nesting changes through
update_step, added placeholders and added annotations do not create agent snapshots. Agents still can't change or delete placeholders, delete brand profiles, or delete blurs.Changes
core/agent-tools.js:create_guide,delete_guide(moves the guide to the Trash),create_step,move_step,delete_step,delete_blocks,set_screenshot,remove_screenshotanddelete_annotations. Screenshots come from a PNG file the agent names by its full path.createAgentSnapshotfirst. These snapshots are labeled with what the agent was about to do ("before agent deletes step 3"). Automatic backups don't prune them; StepForge keeps the newest 50 per guide.delete_annotationsrefuses blurs: deleting one would show the agent what the blur hides the next time it looks at the step.GuideStore.deleteStepmoves a deleted step's substeps up to its parent, not to the top level, so a nested delete no longer breaks numbering. Undo in the editor is unaffected.guide:saveandstep:saverefuse a guide that is in the Trash, so a late save can't recreate it and block restoring it.AI_AGENTS.md(the can/can't table and an undo section),PRIVACY.mdandARCHITECTURE.md.Area
Testing
bash tests/run_test.shpasses (not run: it launches the app)npm testpasses: 1038 pass, 0 fail, 20 skipped. Workflow and regression tests cover each tool, refused calls taking no snapshot, restoring snapshots, pruning, nested deletion, blurred-image import refusal, preserving privacy blurs, stale editor reconciliation, undo, and delayed writes after Trash. The repository structure check andgit diff --checkalso pass. I haven't tried it with a real agent or in the running app yet.Screenshots or recordings
N/A
Rollout notes
None. A guide an agent deletes goes to the local Trash only; like other local Trash, cloud sync doesn't delete it from Drive.
Checklist