Skip to content

feat: add Virtual Marty Command API [STORY-004]#8

Closed
tzone85 wants to merge 1 commit into
mainfrom
feature/STORY-004-virtual-marty-command-api
Closed

feat: add Virtual Marty Command API [STORY-004]#8
tzone85 wants to merge 1 commit into
mainfrom
feature/STORY-004-virtual-marty-command-api

Conversation

@tzone85

@tzone85 tzone85 commented Mar 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Implements the Virtual Marty Command API (STORY-004) - the core abstraction layer for the virtual Bluetooth bridge
  • VirtualMarty class with all martypy API methods: 10 movement, 3 joint control, 5 status, 3 sensor, 1 sound
  • CommandQueue with FIFO execution supporting blocking and non-blocking modes
  • MartyEventEmitter for command lifecycle events (commandStart, commandComplete, commandError, statusChange)
  • Full TypeScript interfaces exported for all command and event types

Changes

File Description
src/features/marty/types.ts TypeScript interfaces for commands, events, sensors
src/features/marty/event-emitter.ts Typed EventEmitter with on/off/emit/removeAllListeners
src/features/marty/command-queue.ts FIFO queue with blocking/non-blocking execution
src/features/marty/virtual-marty.ts Main VirtualMarty class with all martypy methods
src/features/marty/index.ts Barrel exports for public API
+ 4 test files 65 comprehensive tests

Test plan

  • All 65 tests pass
  • Branch coverage at 89.28% (above 80% threshold)
  • ESLint, TypeScript, Prettier checks pass
  • Next.js build succeeds
  • Movement commands tested (walk, dance, kick, slide, lean, wiggle, circle_dance, celebrate, get_ready, stand_straight)
  • Joint control tested (eyes, arms, move_joint)
  • Status tested (is_moving, stop, resume, is_paused, hold_position)
  • Sensors tested (foot_on_ground, get_distance_sensor, get_accelerometer)
  • Command queue FIFO ordering verified
  • Event emitter lifecycle events verified
  • Blocking and non-blocking execution modes tested

🤖 Generated with Claude Code


Important

Introduces VirtualMarty API with command queue and event emitter for controlling a virtual robot, including comprehensive tests and TypeScript interfaces.

  • VirtualMarty API:
    • Adds VirtualMarty class in virtual-marty.ts with methods for movement (e.g., walk, dance), joint control (e.g., eyes, arms), status (e.g., is_moving, stop), sensors (e.g., foot_on_ground), and sound (play_sound).
    • Supports blocking and non-blocking execution modes.
    • Integrates MartyEventEmitter for lifecycle events (commandStart, commandComplete, statusChange).
  • CommandQueue:
    • Implements CommandQueue in command-queue.ts for FIFO command processing.
    • Supports blocking and non-blocking modes, with onProcess and onComplete callbacks.
  • EventEmitter:
    • Implements MartyEventEmitter in event-emitter.ts for managing event listeners.
    • Supports adding/removing listeners and emitting events.
  • Types:
    • Defines TypeScript interfaces in types.ts for commands, events, and statuses.
  • Testing:
    • Adds comprehensive tests for VirtualMarty, CommandQueue, and MartyEventEmitter in respective test files.
    • Tests cover command execution, event emission, and type validation.

This description was created by Ellipsis for 0d6aa48. You can customize this summary. It will automatically update as commits are pushed.

…em [STORY-004]

Implement the core abstraction layer for the virtual Bluetooth bridge:
- VirtualMarty class with all martypy API methods (movement, joint, status, sensor, sound)
- CommandQueue with FIFO execution, blocking and non-blocking modes
- MartyEventEmitter for command lifecycle events (start, complete, error, statusChange)
- Full TypeScript interfaces exported for all command types
- 65 tests passing with 89%+ branch coverage

@ellipsis-dev ellipsis-dev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed everything up to 0d6aa48 in 15 seconds. Click for details.
  • Reviewed 1048 lines of code in 9 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.

Workflow ID: wflow_WCBtUZtnAzdfKsY4

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@tzone85 tzone85 closed this Mar 2, 2026
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