Reusable MoonBit SDK for the FoloToy AI Passport wearable: 120x160 RGB565 graphics, semantic input, four-voice music engine, battery, and backend driver contracts.
| Package | Contents |
|---|---|
| core | Point, Size, Rect, Color (RGB565 conversion), LOGICAL_WIDTH = 120, LOGICAL_HEIGHT = 160 |
| graphics | Canvas drawing (clear, pixel, line, rect, fill_rect, sprite, bitmap text), SpriteSheet, text metrics, read-only FrameView |
| input | Semantic Button (Up / Down / Ok), ButtonEvent (Press / Click / DoubleClick / LongPress), edge-detecting InputState |
| music | Meter (6/8), Tempo (dotted-quarter BPM), Pitch / Note / Track / Song (max four tracks), Sequencer, TickClock |
| audio | 16 kHz PCM16 mono Synth with four monophonic voices, five waveforms (Pulse12, Pulse25, Pulse50, Triangle, Noise), and a sample-accurate Player that owns the music transport (loop, pause/resume, beat sync) |
| battery | BatterySource trait and caching Battery; readings are Int? so unavailable values are explicit |
| driver | Backend-facing Clock and DisplaySink contracts, plus test fixtures (ZeroClock, SinkProbe) |
| hostabi | Internal, experimental wasm host-boundary package: ABI v0 constants, the closure-injected HostBridge (DisplaySink / PcmSink / BatterySource / Clock adapters), wasm-gated passport.* externs, and inline-WAT u16 store/load helpers |
moon build --target wasm --release # fixture app.wasm, release profile
moon build --target wasm # fixture app.wasm, debug profile (the suite pins both)
node hosts/web/tools/gen-test-pcm.mjs # once; creates the committed PCM asset
node hosts/web/tools/make-bundle.mjs # assembles _build/passport-bundle
node hosts/web/test/run-tests.mjs # nine suites; exits 2 if the fixture artifacts are missingInstall
Download zipReusable MoonBit SDK for the FoloToy AI Passport wearable: 120x160 RGB565 graphics, semantic input, four-voice music engine, battery, and backend driver contracts.