Skip to content

Acknowledge serialized MCP browser commands - #156

Merged
CameronFoxly merged 3 commits into
mainfrom
cameronfoxly-browser-mcp-acknowledgements
Aug 11, 2026
Merged

Acknowledge serialized MCP browser commands#156
CameronFoxly merged 3 commits into
mainfrom
cameronfoxly-browser-mcp-acknowledgements

Conversation

@CameronFoxly

Copy link
Copy Markdown
Owner

Summary

Adds the Ascii-Motion browser companion for #153 and the shared targeted cell-batch support needed by #152.

  • serializes authoritative browser commands FIFO and emits exactly one correlated success or failure result
  • applies set_cells_batch to an exact active-layer content-frame entry, including inactive entries, while keeping canvasStore synchronized for the installed frame
  • applies FPS changes with timelineStore.setFrameRate(fps, false) and reflows legacy frame-duration sequences
  • exposes awaitable raw-data session import for v1/v2 migration, validation, store restoration, and final active-canvas installation
  • preserves legacy command and JSON-RPC notification inputs

Wire contract

Server to browser:

interface MCPCommandRequest {
  type: 'command_request';
  requestId: string;
  command: MCPCommand;
}

Browser to server:

type MCPCommandResult =
  | {
      type: 'command_result';
      requestId: string;
      success: true;
      applied?: {
        currentFrameIndex?: number;
        cellsChanged?: number;
        frameRate?: number;
        durationMs?: number;
      };
    }
  | {
      type: 'command_result';
      requestId: string;
      success: false;
      error: string;
    };

Acknowledged requests execute and emit results strictly FIFO, including async handlers. Supported command payloads added here are:

{ type: 'set_cells_batch'; cells: Array<{ x: number; y: number; cell: Cell }>; frameIndex?: number }
{ type: 'set_frame_rate'; fps: number }
{ type: 'set_frame_duration'; index: number; duration: number } // duration is milliseconds
{ type: 'load_project'; sessionData: unknown }

Dependency

This is the browser half of the cross-repository #153 fix. It can merge independently, but acknowledged live mutations require the pending CameronFoxly/ascii-motion-mcp #153 companion PR to emit command_request and await command_result using the exact contract above. The targeted set_cells_batch.frameIndex behavior is also the shared browser primitive for the ascii-motion-mcp #152 image-import companion; no import-specific browser command is introduced.

The navigation-specific atomic completion required by #154 is intentionally excluded and will be added in a stacked browser companion using this dispatcher's async executeCommand extension point.

Refs #153
Refs #152

Validation

  • npm test -- --run src/__tests__/mcpClient.test.ts src/__tests__/sessionMigration.test.ts src/__tests__/phase6Integration.test.ts (58 tests)
  • npm run build
  • targeted ESLint on changed files

Add a serialized command dispatcher, correlated command results, targeted frame mutations, and awaitable project loading for issues #153 and #152.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 3d40267a-0b85-4e25-a99e-e61fd1a5c5f7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant