redo
Reverses the last undo action to restore previous changes in Strudel.cc music patterns during live coding sessions.
Instructions
Redo action
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The handler function for the 'redo' tool. Pops the last state from redoStack, pushes current pattern to undoStack, writes the redo pattern to the controller, and returns success or 'Nothing to redo'.case 'redo': if (!this.isInitialized) { return 'Browser not initialized. Run init first.'; } if (this.redoStack.length > 0) { const currentRedo = await this.controller.getCurrentPattern(); this.undoStack.push(currentRedo); // Enforce bounds to prevent memory leaks if (this.undoStack.length > this.MAX_HISTORY) { this.undoStack.shift(); } const next = this.redoStack.pop()!; await this.controller.writePattern(next); return 'Redone'; } return 'Nothing to redo';
- src/server/EnhancedMCPServerFixed.ts:402-406 (registration)Registration of the 'redo' tool in the getTools() method, which is used by the ListToolsRequestSchema handler to expose available tools.{ name: 'redo', description: 'Redo action', inputSchema: { type: 'object', properties: {} } },
- Input schema for the 'redo' tool: no parameters required.inputSchema: { type: 'object', properties: {} }
- Declaration of undoStack and redoStack arrays used by undo/redo functionality.private undoStack: string[] = []; private redoStack: string[] = [];