signalk-openwakeword 0.0.1 → 0.1.0
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/README.md +123 -9
- package/dist/config.d.ts +162 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +255 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +121 -0
- package/dist/index.js.map +1 -0
- package/dist/service.d.ts +137 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +465 -0
- package/dist/service.js.map +1 -0
- package/dist/wyoming.d.ts +30 -0
- package/dist/wyoming.d.ts.map +1 -0
- package/dist/wyoming.js +152 -0
- package/dist/wyoming.js.map +1 -0
- package/package.json +54 -5
- package/index.js +0 -23
package/README.md
CHANGED
|
@@ -1,16 +1,130 @@
|
|
|
1
1
|
# signalk-openwakeword
|
|
2
2
|
|
|
3
|
-
> **Status:
|
|
3
|
+
> **Status: ALPHA** This SignalK Wyoming system is 100% vibecoded slop. I don't have the right hardware yet to test it, so I'm putting it out there for people to test in the meantime. It _should_ work. File issues for anything that doestn.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Wake word detection for Signal K boats. This plugin runs
|
|
6
|
+
[rhasspy/wyoming-openwakeword](https://github.com/rhasspy/wyoming-openwakeword)
|
|
7
|
+
as a managed container and exposes it as a [Wyoming
|
|
8
|
+
protocol](https://github.com/rhasspy/wyoming) service on your network, so
|
|
9
|
+
voice satellites (cockpit Pis, the `signalk-wyoming` local satellite, or any
|
|
10
|
+
Wyoming client such as Home Assistant) can stream microphone audio to it and
|
|
11
|
+
get "wake word heard" events back. It is one of the
|
|
12
|
+
[signalk-wyoming](https://github.com/hoeken/signalk-wyoming) voice family:
|
|
13
|
+
`signalk-wyoming` (orchestrator + webapp), `signalk-whisper` (speech to
|
|
14
|
+
text), `signalk-piper` (text to speech), and this plugin (wake words).
|
|
6
15
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
16
|
+
**Fully offline:** all wake word models ship inside the container image.
|
|
17
|
+
First start pulls the ~90 MB image and nothing else — no model downloads, no
|
|
18
|
+
surprises at sea.
|
|
19
|
+
|
|
20
|
+
## Requirements
|
|
21
|
+
|
|
22
|
+
- Signal K server ≥ 2.x on Node.js ≥ 24
|
|
23
|
+
- The [signalk-container](https://www.npmjs.com/package/signalk-container)
|
|
24
|
+
plugin with a working podman or docker runtime
|
|
25
|
+
- ~384 MB RAM headroom for the container (the default memory cap)
|
|
26
|
+
- amd64 or arm64 (no armv7 — upstream stopped publishing it)
|
|
27
|
+
|
|
28
|
+
## Install
|
|
29
|
+
|
|
30
|
+
Install **signalk-openwakeword** from the Signal K App Store (plus
|
|
31
|
+
signalk-container if you don't have it), enable it in Plugin Config, and the
|
|
32
|
+
plugin pulls and starts `rhasspy/wyoming-openwakeword` pinned to a tested
|
|
33
|
+
release. The plugin reports `ready` only once the service answers a Wyoming
|
|
34
|
+
`describe` request — proof the detector is actually up, not just the
|
|
35
|
+
container.
|
|
36
|
+
|
|
37
|
+
## Configuration
|
|
38
|
+
|
|
39
|
+
| Setting | Default | Notes |
|
|
40
|
+
| ---------------------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
41
|
+
| `wakeWords` | `["okay_nabu"]` | Wake words your satellites use. Built-ins: `okay_nabu`, `hey_jarvis`, `hey_mycroft`, `alexa`, `hey_rhasspy`. **Not** passed to the container — Wyoming clients select models per connection (`Detect` event); this list is validated against the running service and shared with the orchestrator. ⚠️ upstream 2.0.0 renamed `ok_nabu` → `okay_nabu`; the old name silently matches nothing. |
|
|
42
|
+
| `threshold` | `0.5` | Wake probability threshold (0–1). Lower = more sensitive, more false wakes. |
|
|
43
|
+
| `triggerLevel` | `1` | Activations above the threshold before a detection fires. Raise it in noisy cabins. |
|
|
44
|
+
| `port` | `10400` | Host TCP port the Wyoming service is published on. |
|
|
45
|
+
| `bind` | `0.0.0.0` | Host interface for the published port. See [Security](#security). |
|
|
46
|
+
| `imageTag` | `auto` | `auto` pins the tested upstream release (currently `2.1.0`); set an explicit Docker tag to override. |
|
|
47
|
+
| `memoryLimit` | `384m` | Container memory cap (swap disabled). |
|
|
48
|
+
| `restartPolicy` | `unless-stopped` | Container restart policy. |
|
|
49
|
+
| `advanced.refractorySeconds` | _(unset)_ | `--refractory-seconds` — minimum seconds between re-detections (upstream default 2.0). |
|
|
50
|
+
| `advanced.customModels` | `false` | Mounts the shared signalk-container data directory at `/data` and passes `--custom-model-dir /data/custom`. See [Custom wake words](#custom-wake-words). |
|
|
51
|
+
| `advanced.advertiseHost` | _(unset)_ | Overrides the host part of the advertised `tcp://` URI (containerized Signal K, multi-NIC hosts). |
|
|
52
|
+
|
|
53
|
+
## Using it from other software
|
|
54
|
+
|
|
55
|
+
The service speaks plain Wyoming over TCP at `tcp://<boat-server>:10400`.
|
|
56
|
+
The `signalk-wyoming` orchestrator discovers it automatically via the
|
|
57
|
+
`wyoming-service` PropertyValues convention:
|
|
58
|
+
|
|
59
|
+
```js
|
|
60
|
+
{ plugin: 'signalk-openwakeword', type: 'wake', uri: 'tcp://127.0.0.1:10400', status: 'ready' }
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Standalone use works too: point Home Assistant's Wyoming integration, a
|
|
64
|
+
`wyoming-satellite` (`--wake-uri tcp://<boat-server>:10400
|
|
65
|
+
--wake-word-name okay_nabu`), or any other Wyoming client at the URI — no
|
|
66
|
+
Signal K required on the client side.
|
|
67
|
+
|
|
68
|
+
## Health & notifications
|
|
69
|
+
|
|
70
|
+
- Readiness and liveness are protocol-native: a periodic Wyoming `describe`
|
|
71
|
+
ping must return a valid `info` response. Three consecutive failures set a
|
|
72
|
+
plugin error, emit `wyoming-service` status `error`, and raise the
|
|
73
|
+
`notifications.voice.openwakeword` notification with `state: 'alarm'`
|
|
74
|
+
(method `['visual']` — deliberately not `'sound'`, so notification-to-speech
|
|
75
|
+
bridges don't narrate voice-stack outages). Recovery clears it back to
|
|
76
|
+
`normal`.
|
|
77
|
+
- Plugin status shows what's happening at each stage (image pull, waiting
|
|
78
|
+
for the service, running).
|
|
79
|
+
- `GET /plugins/signalk-openwakeword/api/status` returns
|
|
80
|
+
`{ status, uri, tag, containerState, lastHealth, info }` (readonly access).
|
|
81
|
+
`GET /api/update/check` / `POST /api/update/apply` (admin) manage container
|
|
82
|
+
image updates.
|
|
83
|
+
|
|
84
|
+
## Security
|
|
85
|
+
|
|
86
|
+
**Wyoming has no authentication.** Unlike whisper/piper (loopback-only by
|
|
87
|
+
default), the wake word service must be reachable from your LAN so remote
|
|
88
|
+
satellites can stream audio to it — that is why `bind` defaults to
|
|
89
|
+
`0.0.0.0`. The exposure is modest (openWakeWord only ever sees audio a
|
|
90
|
+
client chooses to send it, and only ever answers with detections), but the
|
|
91
|
+
_satellites_ on the same network are open live microphones — treat every
|
|
92
|
+
satellite port like a baby monitor. On marina wifi, put the boat network
|
|
93
|
+
behind a firewall or VLAN, or use WireGuard between boat segments. If every
|
|
94
|
+
satellite runs on the server itself, set `bind` to `127.0.0.1`.
|
|
95
|
+
|
|
96
|
+
## Custom wake words
|
|
97
|
+
|
|
98
|
+
Enable `advanced.customModels`, then drop openWakeWord `.tflite` model files
|
|
99
|
+
into the `custom/` folder inside the **signalk-container** plugin's data
|
|
100
|
+
directory (`<signalk>/plugin-config-data/signalk-container/custom/` — create
|
|
101
|
+
`custom/` if it doesn't exist) and restart the plugin. The mount is provided
|
|
102
|
+
by signalk-container's `signalkDataMount`, which always maps `/data` to
|
|
103
|
+
signalk-container's _own_ data directory (shared by every plugin that uses
|
|
104
|
+
it), **not** to this plugin's `plugin-config-data/signalk-openwakeword/`
|
|
105
|
+
directory. If Signal K itself runs in a container with a volume-backed data
|
|
106
|
+
directory, put the files in the corresponding location inside that volume.
|
|
107
|
+
The container loads them via `--custom-model-dir /data/custom`; a `_v1.0`
|
|
108
|
+
style filename suffix is stripped for the model id. A webapp upload UI is
|
|
109
|
+
planned for v1.x; the manual drop works today.
|
|
110
|
+
|
|
111
|
+
## Development
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
npm install
|
|
115
|
+
npm run build # tsc → dist/
|
|
116
|
+
npm test # typecheck + vitest (mock Wyoming server, fake container manager)
|
|
117
|
+
npm run ci-lint # eslint + prettier --check
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Tests never touch docker: the container manager is faked and the Wyoming
|
|
121
|
+
endpoint is the scriptable `signalk-wyoming/mock` server (a devDependency
|
|
122
|
+
on the [signalk-wyoming](https://github.com/hoeken/signalk-wyoming)
|
|
123
|
+
package). Production code has no runtime dependency on it — the plugin
|
|
124
|
+
embeds its own ~150-line `describe` client.
|
|
13
125
|
|
|
14
126
|
## License
|
|
15
127
|
|
|
16
|
-
Apache-2.0
|
|
128
|
+
Apache-2.0 © hoeken. The container image it runs is
|
|
129
|
+
[rhasspy/wyoming-openwakeword](https://github.com/rhasspy/wyoming-openwakeword)
|
|
130
|
+
(MIT).
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration: settings type, defaults, JSON schema for the Signal K
|
|
3
|
+
* Plugin Config UI, and the pure settings → container-config mapping.
|
|
4
|
+
*/
|
|
5
|
+
import type { ContainerConfig } from "signalk-container-helper";
|
|
6
|
+
export declare const PLUGIN_ID = "signalk-openwakeword";
|
|
7
|
+
export declare const PLUGIN_NAME = "openWakeWord (Wyoming)";
|
|
8
|
+
export declare const IMAGE = "rhasspy/wyoming-openwakeword";
|
|
9
|
+
/** Tag that `imageTag: "auto"` resolves to. */
|
|
10
|
+
export declare const PINNED_TAG = "2.1.0";
|
|
11
|
+
/** Wyoming port inside the container (baked into the image's ENTRYPOINT). */
|
|
12
|
+
export declare const WYOMING_PORT = 10400;
|
|
13
|
+
/** Container name (unprefixed; runtime name is `<namespace>-openwakeword`). */
|
|
14
|
+
export declare const CONTAINER_NAME = "openwakeword";
|
|
15
|
+
/** Short service name used in `notifications.voice.<service>`. */
|
|
16
|
+
export declare const SERVICE_NAME = "openwakeword";
|
|
17
|
+
/**
|
|
18
|
+
* Wake word models bundled with wyoming-openwakeword 2.x. Note the 2.0.0
|
|
19
|
+
* breaking rename: `ok_nabu` → `okay_nabu`.
|
|
20
|
+
*/
|
|
21
|
+
export declare const BUILTIN_WAKE_WORDS: string[];
|
|
22
|
+
export interface AdvancedSettings {
|
|
23
|
+
/** → --refractory-seconds (upstream default 2.0 when omitted). */
|
|
24
|
+
refractorySeconds?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Mount the shared signalk-container data dir at /data and pass
|
|
27
|
+
* --custom-model-dir /data/custom.
|
|
28
|
+
*/
|
|
29
|
+
customModels: boolean;
|
|
30
|
+
/** Replaces the host part of the advertised wyoming-service uri. */
|
|
31
|
+
advertiseHost?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface OpenWakeWordSettings {
|
|
34
|
+
imageTag: string;
|
|
35
|
+
/** Host TCP port the container's Wyoming port is published on. */
|
|
36
|
+
port: number;
|
|
37
|
+
/** Host interface the port binds to. LAN-reachable by default (see §8). */
|
|
38
|
+
bind: "0.0.0.0" | "127.0.0.1";
|
|
39
|
+
/**
|
|
40
|
+
* Wake words satellites may use. NOT passed to the container (2.x selects
|
|
41
|
+
* models per client via the Wyoming `Detect` event) — validated against
|
|
42
|
+
* the service's `info` response and surfaced for orchestrator/docs use.
|
|
43
|
+
*/
|
|
44
|
+
wakeWords: string[];
|
|
45
|
+
/** → --threshold (0–1). */
|
|
46
|
+
threshold: number;
|
|
47
|
+
/** → --trigger-level (activations above threshold before a detection). */
|
|
48
|
+
triggerLevel: number;
|
|
49
|
+
memoryLimit: string;
|
|
50
|
+
restartPolicy: "no" | "unless-stopped" | "always";
|
|
51
|
+
advanced: AdvancedSettings;
|
|
52
|
+
}
|
|
53
|
+
export declare const DEFAULT_SETTINGS: OpenWakeWordSettings;
|
|
54
|
+
/**
|
|
55
|
+
* Merge raw plugin config over the defaults. Signal K does NOT seed schema
|
|
56
|
+
* defaults into a plugin's saved configuration, so every field must be
|
|
57
|
+
* defaulted here. Tolerates missing/malformed input.
|
|
58
|
+
*/
|
|
59
|
+
export declare function withDefaults(raw: unknown): OpenWakeWordSettings;
|
|
60
|
+
/** Map `auto` to the pinned upstream release; explicit tags pass through. */
|
|
61
|
+
export declare function resolveTag(requested: string): string;
|
|
62
|
+
/** True for plain numeric semver tags like "2.1.0" (update-check filter). */
|
|
63
|
+
export declare function isSemverTag(tag: string): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Container CLI args, appended after the image's baked-in
|
|
66
|
+
* `--uri tcp://0.0.0.0:10400`. Always present and deterministic so
|
|
67
|
+
* signalk-container's drift detection never sees a phantom change.
|
|
68
|
+
*/
|
|
69
|
+
export declare function buildCommand(settings: OpenWakeWordSettings): string[];
|
|
70
|
+
/**
|
|
71
|
+
* Pure settings → ContainerConfig mapping (helper `buildConfig`).
|
|
72
|
+
*
|
|
73
|
+
* openWakeWord must be LAN-reachable for remote satellites (SPEC §8), so the
|
|
74
|
+
* port is published explicitly via `ports` with a default bind of 0.0.0.0 —
|
|
75
|
+
* NOT via `signalkAccessiblePorts` (the two must never share a container
|
|
76
|
+
* port: the loopback mapping would overwrite the explicit binding).
|
|
77
|
+
*/
|
|
78
|
+
export declare function buildContainerConfig(settings: OpenWakeWordSettings, tag: string): ContainerConfig;
|
|
79
|
+
export declare const CONFIG_SCHEMA: {
|
|
80
|
+
type: string;
|
|
81
|
+
properties: {
|
|
82
|
+
wakeWords: {
|
|
83
|
+
type: string;
|
|
84
|
+
title: string;
|
|
85
|
+
items: {
|
|
86
|
+
type: string;
|
|
87
|
+
};
|
|
88
|
+
default: string[];
|
|
89
|
+
description: string;
|
|
90
|
+
};
|
|
91
|
+
threshold: {
|
|
92
|
+
type: string;
|
|
93
|
+
title: string;
|
|
94
|
+
minimum: number;
|
|
95
|
+
maximum: number;
|
|
96
|
+
default: number;
|
|
97
|
+
description: string;
|
|
98
|
+
};
|
|
99
|
+
triggerLevel: {
|
|
100
|
+
type: string;
|
|
101
|
+
title: string;
|
|
102
|
+
minimum: number;
|
|
103
|
+
default: number;
|
|
104
|
+
description: string;
|
|
105
|
+
};
|
|
106
|
+
port: {
|
|
107
|
+
type: string;
|
|
108
|
+
title: string;
|
|
109
|
+
default: number;
|
|
110
|
+
description: string;
|
|
111
|
+
};
|
|
112
|
+
bind: {
|
|
113
|
+
type: string;
|
|
114
|
+
title: string;
|
|
115
|
+
enum: string[];
|
|
116
|
+
default: "0.0.0.0" | "127.0.0.1";
|
|
117
|
+
description: string;
|
|
118
|
+
};
|
|
119
|
+
imageTag: {
|
|
120
|
+
type: string;
|
|
121
|
+
title: string;
|
|
122
|
+
default: string;
|
|
123
|
+
description: string;
|
|
124
|
+
};
|
|
125
|
+
memoryLimit: {
|
|
126
|
+
type: string;
|
|
127
|
+
title: string;
|
|
128
|
+
default: string;
|
|
129
|
+
description: string;
|
|
130
|
+
};
|
|
131
|
+
restartPolicy: {
|
|
132
|
+
type: string;
|
|
133
|
+
title: string;
|
|
134
|
+
enum: string[];
|
|
135
|
+
default: "no" | "unless-stopped" | "always";
|
|
136
|
+
description: string;
|
|
137
|
+
};
|
|
138
|
+
advanced: {
|
|
139
|
+
type: string;
|
|
140
|
+
title: string;
|
|
141
|
+
properties: {
|
|
142
|
+
refractorySeconds: {
|
|
143
|
+
type: string;
|
|
144
|
+
title: string;
|
|
145
|
+
description: string;
|
|
146
|
+
};
|
|
147
|
+
customModels: {
|
|
148
|
+
type: string;
|
|
149
|
+
title: string;
|
|
150
|
+
default: boolean;
|
|
151
|
+
description: string;
|
|
152
|
+
};
|
|
153
|
+
advertiseHost: {
|
|
154
|
+
type: string;
|
|
155
|
+
title: string;
|
|
156
|
+
description: string;
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
};
|
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AO,MAAM,gBAAgB,EAAE,oBAY9B,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,oBAAoB,CA4B/D;AAED,6EAA6E;AAC7E,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,6EAA6E;AAC7E,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,oBAAoB,GAAG,MAAM,EAAE,CAiBrE;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,oBAAoB,EAC9B,GAAG,EAAE,MAAM,GACV,eAAe,CAsBjB;AAuBD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkHzB,CAAC"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration: settings type, defaults, JSON schema for the Signal K
|
|
3
|
+
* Plugin Config UI, and the pure settings → container-config mapping.
|
|
4
|
+
*/
|
|
5
|
+
export const PLUGIN_ID = "signalk-openwakeword";
|
|
6
|
+
export const PLUGIN_NAME = "openWakeWord (Wyoming)";
|
|
7
|
+
export const IMAGE = "rhasspy/wyoming-openwakeword";
|
|
8
|
+
/** Tag that `imageTag: "auto"` resolves to. */
|
|
9
|
+
export const PINNED_TAG = "2.1.0";
|
|
10
|
+
/** Wyoming port inside the container (baked into the image's ENTRYPOINT). */
|
|
11
|
+
export const WYOMING_PORT = 10400;
|
|
12
|
+
/** Container name (unprefixed; runtime name is `<namespace>-openwakeword`). */
|
|
13
|
+
export const CONTAINER_NAME = "openwakeword";
|
|
14
|
+
/** Short service name used in `notifications.voice.<service>`. */
|
|
15
|
+
export const SERVICE_NAME = "openwakeword";
|
|
16
|
+
/**
|
|
17
|
+
* Wake word models bundled with wyoming-openwakeword 2.x. Note the 2.0.0
|
|
18
|
+
* breaking rename: `ok_nabu` → `okay_nabu`.
|
|
19
|
+
*/
|
|
20
|
+
export const BUILTIN_WAKE_WORDS = [
|
|
21
|
+
"okay_nabu",
|
|
22
|
+
"hey_jarvis",
|
|
23
|
+
"hey_mycroft",
|
|
24
|
+
"alexa",
|
|
25
|
+
"hey_rhasspy",
|
|
26
|
+
];
|
|
27
|
+
export const DEFAULT_SETTINGS = {
|
|
28
|
+
imageTag: "auto",
|
|
29
|
+
port: WYOMING_PORT,
|
|
30
|
+
bind: "0.0.0.0",
|
|
31
|
+
wakeWords: ["okay_nabu"],
|
|
32
|
+
threshold: 0.5,
|
|
33
|
+
triggerLevel: 1,
|
|
34
|
+
memoryLimit: "384m",
|
|
35
|
+
restartPolicy: "unless-stopped",
|
|
36
|
+
advanced: {
|
|
37
|
+
customModels: false,
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Merge raw plugin config over the defaults. Signal K does NOT seed schema
|
|
42
|
+
* defaults into a plugin's saved configuration, so every field must be
|
|
43
|
+
* defaulted here. Tolerates missing/malformed input.
|
|
44
|
+
*/
|
|
45
|
+
export function withDefaults(raw) {
|
|
46
|
+
const cfg = isObject(raw) ? raw : {};
|
|
47
|
+
const adv = isObject(cfg.advanced) ? cfg.advanced : {};
|
|
48
|
+
const settings = {
|
|
49
|
+
imageTag: str(cfg.imageTag) ?? DEFAULT_SETTINGS.imageTag,
|
|
50
|
+
port: num(cfg.port) ?? DEFAULT_SETTINGS.port,
|
|
51
|
+
bind: cfg.bind === "127.0.0.1" ? "127.0.0.1" : DEFAULT_SETTINGS.bind,
|
|
52
|
+
wakeWords: strArray(cfg.wakeWords) ?? [...DEFAULT_SETTINGS.wakeWords],
|
|
53
|
+
threshold: num(cfg.threshold) ?? DEFAULT_SETTINGS.threshold,
|
|
54
|
+
triggerLevel: num(cfg.triggerLevel) ?? DEFAULT_SETTINGS.triggerLevel,
|
|
55
|
+
memoryLimit: str(cfg.memoryLimit) ?? DEFAULT_SETTINGS.memoryLimit,
|
|
56
|
+
restartPolicy: cfg.restartPolicy === "no" || cfg.restartPolicy === "always"
|
|
57
|
+
? cfg.restartPolicy
|
|
58
|
+
: DEFAULT_SETTINGS.restartPolicy,
|
|
59
|
+
advanced: {
|
|
60
|
+
customModels: adv.customModels === true,
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
const refractory = num(adv.refractorySeconds);
|
|
64
|
+
if (refractory !== undefined) {
|
|
65
|
+
settings.advanced.refractorySeconds = refractory;
|
|
66
|
+
}
|
|
67
|
+
const advertiseHost = str(adv.advertiseHost);
|
|
68
|
+
if (advertiseHost !== undefined && advertiseHost.trim() !== "") {
|
|
69
|
+
settings.advanced.advertiseHost = advertiseHost.trim();
|
|
70
|
+
}
|
|
71
|
+
return settings;
|
|
72
|
+
}
|
|
73
|
+
/** Map `auto` to the pinned upstream release; explicit tags pass through. */
|
|
74
|
+
export function resolveTag(requested) {
|
|
75
|
+
return requested === "auto" ? PINNED_TAG : requested;
|
|
76
|
+
}
|
|
77
|
+
/** True for plain numeric semver tags like "2.1.0" (update-check filter). */
|
|
78
|
+
export function isSemverTag(tag) {
|
|
79
|
+
return /^\d+\.\d+\.\d+$/.test(tag);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Container CLI args, appended after the image's baked-in
|
|
83
|
+
* `--uri tcp://0.0.0.0:10400`. Always present and deterministic so
|
|
84
|
+
* signalk-container's drift detection never sees a phantom change.
|
|
85
|
+
*/
|
|
86
|
+
export function buildCommand(settings) {
|
|
87
|
+
const command = [
|
|
88
|
+
"--threshold",
|
|
89
|
+
String(settings.threshold),
|
|
90
|
+
"--trigger-level",
|
|
91
|
+
String(settings.triggerLevel),
|
|
92
|
+
];
|
|
93
|
+
if (settings.advanced.refractorySeconds !== undefined) {
|
|
94
|
+
command.push("--refractory-seconds", String(settings.advanced.refractorySeconds));
|
|
95
|
+
}
|
|
96
|
+
if (settings.advanced.customModels) {
|
|
97
|
+
command.push("--custom-model-dir", "/data/custom");
|
|
98
|
+
}
|
|
99
|
+
return command;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Pure settings → ContainerConfig mapping (helper `buildConfig`).
|
|
103
|
+
*
|
|
104
|
+
* openWakeWord must be LAN-reachable for remote satellites (SPEC §8), so the
|
|
105
|
+
* port is published explicitly via `ports` with a default bind of 0.0.0.0 —
|
|
106
|
+
* NOT via `signalkAccessiblePorts` (the two must never share a container
|
|
107
|
+
* port: the loopback mapping would overwrite the explicit binding).
|
|
108
|
+
*/
|
|
109
|
+
export function buildContainerConfig(settings, tag) {
|
|
110
|
+
const config = {
|
|
111
|
+
image: IMAGE,
|
|
112
|
+
tag,
|
|
113
|
+
command: buildCommand(settings),
|
|
114
|
+
ports: {
|
|
115
|
+
[String(WYOMING_PORT)]: `${settings.bind}:${settings.port}`,
|
|
116
|
+
},
|
|
117
|
+
restart: settings.restartPolicy,
|
|
118
|
+
resources: {
|
|
119
|
+
memory: settings.memoryLimit,
|
|
120
|
+
memorySwap: settings.memoryLimit,
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
if (settings.advanced.customModels) {
|
|
124
|
+
// signalkDataMount resolves to the signalk-container plugin's OWN data
|
|
125
|
+
// directory (one globally-cached app.getDataDirPath() of that plugin,
|
|
126
|
+
// shared by every consumer) — NOT this plugin's. Users drop .tflite
|
|
127
|
+
// files in <signalk>/plugin-config-data/signalk-container/custom/.
|
|
128
|
+
config.signalkDataMount = "/data";
|
|
129
|
+
}
|
|
130
|
+
return config;
|
|
131
|
+
}
|
|
132
|
+
function isObject(v) {
|
|
133
|
+
return v !== null && typeof v === "object" && !Array.isArray(v);
|
|
134
|
+
}
|
|
135
|
+
function str(v) {
|
|
136
|
+
return typeof v === "string" && v !== "" ? v : undefined;
|
|
137
|
+
}
|
|
138
|
+
function num(v) {
|
|
139
|
+
return typeof v === "number" && Number.isFinite(v) ? v : undefined;
|
|
140
|
+
}
|
|
141
|
+
function strArray(v) {
|
|
142
|
+
if (!Array.isArray(v))
|
|
143
|
+
return undefined;
|
|
144
|
+
const out = v
|
|
145
|
+
.filter((x) => typeof x === "string")
|
|
146
|
+
.map((x) => x.trim())
|
|
147
|
+
.filter((x) => x !== "");
|
|
148
|
+
return out.length > 0 ? out : undefined;
|
|
149
|
+
}
|
|
150
|
+
export const CONFIG_SCHEMA = {
|
|
151
|
+
type: "object",
|
|
152
|
+
properties: {
|
|
153
|
+
wakeWords: {
|
|
154
|
+
type: "array",
|
|
155
|
+
title: "Wake words",
|
|
156
|
+
items: { type: "string" },
|
|
157
|
+
default: [...DEFAULT_SETTINGS.wakeWords],
|
|
158
|
+
description: "Wake word models your satellites will use. Built-ins: " +
|
|
159
|
+
`${BUILTIN_WAKE_WORDS.join(", ")}. NOTE: version 2.0.0 renamed ` +
|
|
160
|
+
"ok_nabu to okay_nabu — old configs using ok_nabu silently match " +
|
|
161
|
+
"nothing. This list is not passed to the container (clients select " +
|
|
162
|
+
"models per connection); it is checked against the running service " +
|
|
163
|
+
"and used by the signalk-wyoming orchestrator.",
|
|
164
|
+
},
|
|
165
|
+
threshold: {
|
|
166
|
+
type: "number",
|
|
167
|
+
title: "Detection threshold",
|
|
168
|
+
minimum: 0,
|
|
169
|
+
maximum: 1,
|
|
170
|
+
default: DEFAULT_SETTINGS.threshold,
|
|
171
|
+
description: "Wake probability required to activate (0–1). Lower = more " +
|
|
172
|
+
"sensitive but more false wakes.",
|
|
173
|
+
},
|
|
174
|
+
triggerLevel: {
|
|
175
|
+
type: "integer",
|
|
176
|
+
title: "Trigger level",
|
|
177
|
+
minimum: 1,
|
|
178
|
+
default: DEFAULT_SETTINGS.triggerLevel,
|
|
179
|
+
description: "Number of activations above the threshold before a detection " +
|
|
180
|
+
"fires. Raise to reduce false wakes in noisy cabins.",
|
|
181
|
+
},
|
|
182
|
+
port: {
|
|
183
|
+
type: "number",
|
|
184
|
+
title: "Host port",
|
|
185
|
+
default: DEFAULT_SETTINGS.port,
|
|
186
|
+
description: "Host TCP port the Wyoming service is published on " +
|
|
187
|
+
"(remote satellites connect to tcp://<boat-server>:<this port>).",
|
|
188
|
+
},
|
|
189
|
+
bind: {
|
|
190
|
+
type: "string",
|
|
191
|
+
title: "Bind address",
|
|
192
|
+
enum: ["0.0.0.0", "127.0.0.1"],
|
|
193
|
+
default: DEFAULT_SETTINGS.bind,
|
|
194
|
+
description: "SECURITY: the default 0.0.0.0 makes the wake word service " +
|
|
195
|
+
"reachable from your whole network — required for remote " +
|
|
196
|
+
"satellites, and safe-ish (it only ever sees audio that clients " +
|
|
197
|
+
"send it), but Wyoming has no authentication, so firewall or VLAN " +
|
|
198
|
+
"the boat network on marina wifi. Set 127.0.0.1 if every satellite " +
|
|
199
|
+
"runs on this machine.",
|
|
200
|
+
},
|
|
201
|
+
imageTag: {
|
|
202
|
+
type: "string",
|
|
203
|
+
title: "Image tag",
|
|
204
|
+
default: DEFAULT_SETTINGS.imageTag,
|
|
205
|
+
description: `Docker tag of ${IMAGE} to run. "auto" pins the tested release ` +
|
|
206
|
+
`(${PINNED_TAG}) and follows plugin updates; set an explicit tag ` +
|
|
207
|
+
"to stay on a specific upstream version.",
|
|
208
|
+
},
|
|
209
|
+
memoryLimit: {
|
|
210
|
+
type: "string",
|
|
211
|
+
title: "Memory limit",
|
|
212
|
+
default: DEFAULT_SETTINGS.memoryLimit,
|
|
213
|
+
description: 'Container memory cap (e.g. "384m", "1g"). Swap is disabled by ' +
|
|
214
|
+
"setting the swap limit to the same value.",
|
|
215
|
+
},
|
|
216
|
+
restartPolicy: {
|
|
217
|
+
type: "string",
|
|
218
|
+
title: "Restart policy",
|
|
219
|
+
enum: ["no", "unless-stopped", "always"],
|
|
220
|
+
default: DEFAULT_SETTINGS.restartPolicy,
|
|
221
|
+
description: "Container restart policy passed to docker/podman.",
|
|
222
|
+
},
|
|
223
|
+
advanced: {
|
|
224
|
+
type: "object",
|
|
225
|
+
title: "Advanced",
|
|
226
|
+
properties: {
|
|
227
|
+
refractorySeconds: {
|
|
228
|
+
type: "number",
|
|
229
|
+
title: "Refractory seconds",
|
|
230
|
+
description: "Minimum seconds between repeated detections of the same wake " +
|
|
231
|
+
"word (--refractory-seconds). Upstream default: 2.0.",
|
|
232
|
+
},
|
|
233
|
+
customModels: {
|
|
234
|
+
type: "boolean",
|
|
235
|
+
title: "Enable custom wake word models",
|
|
236
|
+
default: DEFAULT_SETTINGS.advanced.customModels,
|
|
237
|
+
description: "Mount the shared signalk-container plugin data directory into " +
|
|
238
|
+
"the container and load custom .tflite models from its custom/ " +
|
|
239
|
+
"subdirectory (--custom-model-dir /data/custom). Drop model " +
|
|
240
|
+
"files into plugin-config-data/signalk-container/custom/ (NOT " +
|
|
241
|
+
"this plugin's own data directory) and restart the plugin.",
|
|
242
|
+
},
|
|
243
|
+
advertiseHost: {
|
|
244
|
+
type: "string",
|
|
245
|
+
title: "Advertise host",
|
|
246
|
+
description: "Overrides the host part of the tcp:// URI advertised to the " +
|
|
247
|
+
"signalk-wyoming orchestrator (for containerized Signal K or " +
|
|
248
|
+
"multi-NIC hosts where 127.0.0.1 is not what consumers should " +
|
|
249
|
+
"dial). Leave empty for automatic.",
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
};
|
|
255
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,CAAC,MAAM,SAAS,GAAG,sBAAsB,CAAC;AAChD,MAAM,CAAC,MAAM,WAAW,GAAG,wBAAwB,CAAC;AACpD,MAAM,CAAC,MAAM,KAAK,GAAG,8BAA8B,CAAC;AACpD,+CAA+C;AAC/C,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC;AAClC,6EAA6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,gBAAgB,CAAC,WAAW;YACrC,WAAW,EACT,gEAAgE;gBAChE,2CAA2C;SAC9C;QACD,aAAa,EAAE;YACb,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,gBAAgB;YACvB,IAAI,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,QAAQ,CAAC;YACxC,OAAO,EAAE,gBAAgB,CAAC,aAAa;YACvC,WAAW,EAAE,mDAAmD;SACjE;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,UAAU;YACjB,UAAU,EAAE;gBACV,iBAAiB,EAAE;oBACjB,IAAI,EAAE,QAAQ;oBACd,KAAK,EAAE,oBAAoB;oBAC3B,WAAW,EACT,+DAA+D;wBAC/D,qDAAqD;iBACxD;gBACD,YAAY,EAAE;oBACZ,IAAI,EAAE,SAAS;oBACf,KAAK,EAAE,gCAAgC;oBACvC,OAAO,EAAE,gBAAgB,CAAC,QAAQ,CAAC,YAAY;oBAC/C,WAAW,EACT,gEAAgE;wBAChE,gEAAgE;wBAChE,6DAA6D;wBAC7D,+DAA+D;wBAC/D,2DAA2D;iBAC9D;gBACD,aAAa,EAAE;oBACb,IAAI,EAAE,QAAQ;oBACd,KAAK,EAAE,gBAAgB;oBACvB,WAAW,EACT,8DAA8D;wBAC9D,8DAA8D;wBAC9D,+DAA+D;wBAC/D,mCAAmC;iBACtC;aACF;SACF;KACF;CACF,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* signalk-openwakeword — Signal K plugin entry point.
|
|
3
|
+
*
|
|
4
|
+
* Runs rhasspy/wyoming-openwakeword (pinned 2.1.0) as a managed container via
|
|
5
|
+
* signalk-container-helper, gates readiness on a Wyoming `describe` exchange,
|
|
6
|
+
* advertises the service on the shared `wyoming-service` PropertyValues
|
|
7
|
+
* convention, and keeps a protocol-native health loop running.
|
|
8
|
+
*/
|
|
9
|
+
import { type RouterLike } from "signalk-container-helper";
|
|
10
|
+
import { type RunnerTiming, type ServiceApp } from "./service.js";
|
|
11
|
+
export interface PluginApp extends ServiceApp {
|
|
12
|
+
savePluginOptions(configuration: object, callback: (err: unknown) => void): void;
|
|
13
|
+
readPluginOptions?(): {
|
|
14
|
+
configuration?: Record<string, unknown>;
|
|
15
|
+
} | undefined;
|
|
16
|
+
}
|
|
17
|
+
export interface PluginRouter extends RouterLike {
|
|
18
|
+
/** Signal K ≥2.x permission registrar; feature-detected. */
|
|
19
|
+
access?(level: "readonly" | "readwrite"): RouterLike;
|
|
20
|
+
}
|
|
21
|
+
export interface OpenWakeWordPlugin {
|
|
22
|
+
id: string;
|
|
23
|
+
name: string;
|
|
24
|
+
description: string;
|
|
25
|
+
schema: () => object;
|
|
26
|
+
start: (config: object) => void;
|
|
27
|
+
stop: () => Promise<void>;
|
|
28
|
+
registerWithRouter: (router: PluginRouter) => void;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Plugin factory. The optional `timing` parameter is a test seam — the
|
|
32
|
+
* Signal K loader only ever passes `app`.
|
|
33
|
+
*/
|
|
34
|
+
export default function createPlugin(app: PluginApp, timing?: Partial<RunnerTiming>): OpenWakeWordPlugin;
|
|
35
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAKL,KAAK,UAAU,EAChB,MAAM,0BAA0B,CAAC;AAalC,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,UAAU,EAChB,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,SAAU,SAAQ,UAAU;IAC3C,iBAAiB,CACf,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,GAC/B,IAAI,CAAC;IACR,iBAAiB,CAAC,IAAI;QAAE,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,GAAG,SAAS,CAAC;CAC/E;AAID,MAAM,WAAW,YAAa,SAAQ,UAAU;IAC9C,4DAA4D;IAC5D,MAAM,CAAC,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW,GAAG,UAAU,CAAC;CACtD;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,MAAM,CAAC;IACrB,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,kBAAkB,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;CACpD;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,GAAG,EAAE,SAAS,EACd,MAAM,GAAE,OAAO,CAAC,YAAY,CAAM,GACjC,kBAAkB,CAoHpB"}
|