Skip to content

Add camera hub TTS and pan-tilt MOD - #645

Draft
meganetaaan wants to merge 3 commits into
stack-chan:developfrom
meganetaaan:agent/camera-hub-commands
Draft

Add camera hub TTS and pan-tilt MOD#645
meganetaaan wants to merge 3 commits into
stack-chan:developfrom
meganetaaan:agent/camera-hub-commands

Conversation

@meganetaaan

@meganetaaan meganetaaan commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

What

  • add a Camera Hub Commands sample MOD for protocol 1 tts.speak and panTilt.move
  • execute speech through the active context.audio.say() provider
  • convert dashboard pan/tilt degrees into context.motion.setPose() body poses
  • validate command envelopes and payload bounds, preserve body position and roll, and return protocol-compatible acknowledgements
  • keep all Camera Hub protocol handling out of the host runtime and public host capabilities
  • add focused Moddable tests and Japanese integration documentation

Architecture

Camera Hub command interpretation is application-specific and now lives entirely under firmware/mods/examples/camera_hub_commands.

A future generic moddable-tailscale wrapper may live under the host context.connectivity namespace and own Tailnet startup, MagicDNS, WebSocket transport, reconnect, and lifecycle. The MOD will consume that transport and remain responsible for JSON command semantics and mapping commands to Stack-chan audio/motion capabilities.

This PR does not add the Tailnet transport yet. The current MOD exposes executeCameraHubCommand() as the protocol boundary and does not connect to the hub by itself.

Impact

Release impact: minor for the new sample MOD. Existing host capabilities and runtime composition are unchanged.

Changeset: .changeset/private-camera-hub-commands.md.

Checks

  • npm run format -- --write mods/examples/camera_hub_commands: passes
  • npm run lint -- mods/examples/camera_hub_commands: passes with one pre-existing informational finding outside this MOD
  • npm run check:architecture: 74 passed
  • Node behavior smoke for speech, movement, malformed input, and unsupported commands: passed
  • npm run mod:build -- m5stackchan_cores3 ./mods/examples/camera_hub_commands/manifest.json: passed
  • GitHub Actions: both Moddable test shards, Linux host and mini-app smoke tests, fast tests, web visual tests, bundle, and every release target passed

The first Linux smoke attempt did not reach the host-ready marker and had no exception log. Re-running the same job without code changes passed both smoke targets, confirming a transient mcsim startup failure.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a camera hub command capability for validated TTS speech and Stack-chan pan/tilt movement. The capability delegates to audio and motion targets, returns structured acknowledgements, and is exposed through the runtime context with WASM and test-module wiring.

Changes

Camera Hub Commands

Layer / File(s) Summary
Command adapter implementation
firmware/host/modules/connectivity/camera-hub-command-adapter.ts
Defines command contracts, validates payloads, converts pan/tilt degrees to pose rotations, delegates to audio and motion targets, and returns success or error acknowledgements.
Runtime capability exposure
firmware/host/app/capabilities.ts, firmware/host/app/runtime-context.ts, firmware/host/modules/connectivity/manifest_wasm.json, firmware/host/modules/ui/views/main/__tests__/face-view-state/manifest.test.json, firmware/tsconfig.test.json, .changeset/private-camera-hub-commands.md
Exports and constructs cameraHubCommands, exposes it from StackchanRuntimeContext, registers module paths, and documents the release change.
Adapter behavior validation
firmware/host/modules/connectivity/__tests__/camera-hub-command-adapter.test.ts
Tests TTS delegation and failures, pan/tilt conversion, invalid payload rejection, and unsupported commands.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CameraHub as Camera hub
  participant Adapter as CameraHubCommandAdapter
  participant Audio as Audio capability
  participant Motion as Motion capability
  CameraHub->>Adapter: Submit tts.speak or panTilt.move
  Adapter->>Audio: Delegate speech command
  Audio-->>Adapter: Return speech result
  Adapter->>Motion: Delegate converted pose and duration
  Motion-->>Adapter: Return movement result
  Adapter-->>CameraHub: Return command acknowledgement
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: camera hub TTS and pan-tilt command support.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

Cloudflare PR preview

Open the latest preview for commit b77d1c1e5712.

Immutable deployment: https://add3dfce.stack-chan-pr-preview.pages.dev

Warning

Pull request previews contain untrusted web and firmware code. Review the changes before granting WebSerial/Bluetooth permissions or flashing a device.

@meganetaaan

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@meganetaaan meganetaaan changed the title Add private camera hub TTS and pan-tilt commands Add camera hub TTS and pan-tilt MOD Aug 9, 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