@makefully/engagefully 0.2.1 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/README.md +35 -1
- package/lib/engagefully.js +1 -1
- package/package.json +5 -2
- package/src/devices/PixiDevice.js +1 -1
- package/src/devices/SpeechDevice.js +606 -0
- package/src/devices/index.js +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,23 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.3.1] - 2026-12-01
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Vitest unit tests for core controls, `Controller`, `ActionMap`, utils, devices, and `SpeechDevice`; `npm test` / CI workflow
|
|
12
|
+
- Device contract tests for `KeyboardDevice`, `GamepadDevice`, `PointerDevice`; smoke tests for experimental `PageDevice`, `FabricDevice`, `PixiDevice`, `BLEDevice`
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- `PixiDevice` pointer-up listener referenced undefined `options` (always bind `pointerup`)
|
|
17
|
+
|
|
18
|
+
## [0.3.0] - 2026-12-01
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- `SpeechDevice` (experimental) — Web Speech API device: `SpeechTranscript` as `Data`, typed phrase `mappings` (`Button` / `Amount` / `Joystick` / `Dial`), hardened start/stop lifecycle (`setActive`, `start`/`stop`, `destroy`)
|
|
23
|
+
|
|
7
24
|
## [0.2.1] - 2026-11-20
|
|
8
25
|
|
|
9
26
|
### Fixed
|
package/README.md
CHANGED
|
@@ -60,9 +60,35 @@ controller.on('LeftStick', (event) => {
|
|
|
60
60
|
| Keyboard | `KeyW`, `Space`, `ArrowUp` (`event.code`) |
|
|
61
61
|
| Gamepad | `AButton`, `BButton`, `XButton`, `YButton`, `LeftStick`, `UpDPad`, … |
|
|
62
62
|
| Pointer | `Pointer` |
|
|
63
|
+
| Speech (experimental) | `SpeechTranscript` (`Data`); mapped ids e.g. `SayTake` (`Button`), `SayThrottle` (`Amount`), `SayMoveStick` (`Joystick`) |
|
|
63
64
|
|
|
64
65
|
You can still listen to physical ids on `Controller` directly (`KeyW:pressed`, `poll('Space')`).
|
|
65
66
|
|
|
67
|
+
### SpeechDevice (experimental)
|
|
68
|
+
|
|
69
|
+
Wraps the Web Speech API. Does **not** auto-start — call `setActive(true)` / `start()` after a user gesture (mic UI stays app-owned). Chromium has the best support; recognition may use a cloud service (privacy). Requires a secure context (HTTPS / localhost).
|
|
70
|
+
|
|
71
|
+
- Final transcripts emit as `Data` on `SpeechTranscript` (`value.text`, `value.isFinal`, `value.matchedControls`).
|
|
72
|
+
- Phrase `mappings` emit typed controls: `Button` (momentary press/release for ActionMap), or latched `Amount` / `Joystick` / `Dial` (clear with another mapping or `releaseMs`).
|
|
73
|
+
- Exact utterance match only (normalized). Use `matchedControls` to skip chat when a command consumed the line.
|
|
74
|
+
|
|
75
|
+
```js
|
|
76
|
+
const speech = new devices.SpeechDevice({
|
|
77
|
+
mappings: [
|
|
78
|
+
{ control: 'SayTake', type: 'Button', phrases: ['take', 'grab'] },
|
|
79
|
+
{ control: 'SayThrottle', type: 'Amount', phrases: ['slow down'], value: 0.25 },
|
|
80
|
+
{ control: 'SayMoveStick', type: 'Joystick', phrases: ['go north'], x: 0, y: -1 },
|
|
81
|
+
],
|
|
82
|
+
});
|
|
83
|
+
const controller = new Controller([speech /*, keyboard, gamepad */]);
|
|
84
|
+
speech.setActive(true);
|
|
85
|
+
|
|
86
|
+
controller.on('SpeechTranscript', (e) => {
|
|
87
|
+
if (!e.value?.isFinal || e.value.matchedControls?.length) return;
|
|
88
|
+
// side-channel chat / logging
|
|
89
|
+
});
|
|
90
|
+
```
|
|
91
|
+
|
|
66
92
|
### ActionMap
|
|
67
93
|
|
|
68
94
|
- Many physical controls → one logical action; `:pressed` / `:released` aggregate across bindings.
|
|
@@ -80,7 +106,15 @@ You can still listen to physical ids on `Controller` directly (`KeyW:pressed`, `
|
|
|
80
106
|
|
|
81
107
|
**First-class:** `KeyboardDevice`, `GamepadDevice`, `PointerDevice`
|
|
82
108
|
|
|
83
|
-
**Also included (experimental):** `BLEDevice`, `FabricDevice`, `PixiDevice`, `PageDevice`
|
|
109
|
+
**Also included (experimental):** `BLEDevice`, `FabricDevice`, `PixiDevice`, `PageDevice`, `SpeechDevice`
|
|
110
|
+
|
|
111
|
+
## Tests
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
npm test
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Vitest + happy-dom. Watch mode: `npm run test:watch`.
|
|
84
118
|
|
|
85
119
|
## Publishing
|
|
86
120
|
|