feat(speech): the speech capability over Cap'n Web, behind a gate
The agent's ears and voice: a server on the home server transcribes a clip (sox, whisper.cpp) and speaks text (piper), one job at a time. A gate hands the capability to whoever presents its key; the key comes from systemd's credentials, not argv. make test runs the unit tests in Nix's sandbox; make smoke starts a real server on localhost, speaks a phrase, and hears it back. Generated-by: Claude Opus 5.5
This commit is contained in:
1 parent
147bfdc55e
commit
65e38c23cf
20 files changed
+468
No files matched your search
@@ -0,0 +1,13 @@
|
||||
// Tests for the gate, in process: no network.
|
||||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { makeGate } from './gate.js';
|
||||
|
||||
test('the right key opens the gate; a wrong one is refused', () => {
|
||||
const cap = { it: 'the capability' };
|
||||
const gate = makeGate('k3y', cap);
|
||||
assert.equal(gate.open('k3y'), cap);
|
||||
assert.throws(() => gate.open('guess'), /no such key/);
|
||||
assert.throws(() => gate.open(''), /no such key/);
|
||||
assert.throws(() => gate.open(undefined), /no such key/);
|
||||
});
|
||||
Reference in new issue
Block a user