smix-input
Tiny SwipeDirection + KeyName enums shared across every layer that
talks about input — driver, runner-wire, recorder-ir, MCP tool surface.
Standalone stone so cement crates (CLI / MCP / SDK / recorder) can take
the wire enums without dragging in the full driver dep graph.
Both enums serialize as camelCase strings, matching the SmixRunnerCore wire and the TS v1.x / v2.x recorder JSON 1:1.
Quickstart
use ;
assert_eq!;
assert_eq!;
let body = to_string.unwrap;
assert_eq!;
let parsed: SwipeDirection = from_str.unwrap;
assert_eq!;
Variants
| Enum | Variants |
|---|---|
SwipeDirection |
Up / Down / Left / Right |
KeyName |
Return / Delete / Tab / Space / Escape / ArrowUp / ArrowDown / ArrowLeft / ArrowRight |
KeyName is a deliberate subset — only the keys SDK users
reliably exercise on iOS sim. Expanding the set is a checkpoint-level
discussion, not a casual add. Arrow keys are in because focus-traversal
flows (v1.5 c5g'' regression test) need them.
When to reach for this
| Use case | Pick |
|---|---|
| Building anything that talks to SmixRunnerCore wire | smix-input |
| Need richer key set (function keys, modifiers) | open an issue — extension is a deliberate checkpoint decision |
| Want raw HID key codes | out of scope (use a HID crate directly) |
Scope
- ✅ Two enums +
as_str()+Display - ✅ camelCase serde wire compatibility
- ✅ Zero deps beyond serde
- ❌ No driver/runner I/O (use
smix-driverorsmix-runner-client)
License
Dual-licensed under either:
at your option.