Opening menu and hands-free mode: call an agent by name (0.3.0)

The app now opens on a menu, which is the root page: "Hands free" first,
"Agents" second. Agents is the 0.2.0 app unchanged. Hands free is the same
agents, conversations and question path with one flag set: the microphone
listens while the app is at rest and the app does not leave by itself.
The mode is never remembered; every launch starts at the menu with the
microphone closed, and double tap at Ready returns to the menu and closes
it.

Client: a loudness-only speech segmenter (core/vad.ts) cuts the stream
into utterances; each goes to the bridge for a wake check. "Wendy, <q>"
becomes a text turn to Wendy, with what was heard shown while she works.
A name alone starts a recording that sends itself when the speaker stops.
The status line starts with a dot for exactly as long as the microphone is
open at rest. In wake mode every microphone open and close goes through
one serialised reconciler; without the option the old path is untouched.

Bridge: POST /v1/wake transcribes one utterance in memory and reports
whether it BEGAN with an agent's name (first word of the display name, or
an alias from HERMEVEN_AGENT_<ID>_WAKE). Exact match only; a near miss is
reported as one word and never acted on. Creates no turn, stores nothing,
returns and logs nothing that was not addressed to an agent. One check at
a time per device, HERMEVEN_WAKE_CHECKS_PER_MINUTE (30).

Docs: decision 0004, bridge API, security gaps 3c/3d, device plan D.
The manifest's microphone description changed.

Not reviewed, not deployed, not uploaded, not device-tested.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Dan
2026-11-28 10:52:06 -08:00
co-authored by Claude Fable 5.2
parent 75b7ea1eff
commit e1d183b54d
26 changed files with 1847 additions and 48 deletions
+36
View File
@@ -200,6 +200,42 @@ export const AudioTurnQuery = Type.Object(
);
export type AudioTurnQuery = Static<typeof AudioTurnQuery>;
// ------------------------------------------------------------------- wake
/**
* Query string of POST /v1/wake. The body is raw audio, as for an audio turn: one stretch of
* speech heard while the app was open. The bridge transcribes it and says whether it began
* with an agent's name. Nothing is stored and no turn is created.
*/
export const WakeQuery = Type.Object(
{
schema_version: Type.Literal(String(SCHEMA_VERSION)),
locale: Locale,
encoding: Type.Literal(AUDIO_FORMAT.encoding),
sample_rate: Type.Literal(String(AUDIO_FORMAT.sampleRate)),
channels: Type.Literal(String(AUDIO_FORMAT.channels)),
},
{ additionalProperties: false },
);
export type WakeQuery = Static<typeof WakeQuery>;
export const WakeResponse = Type.Object(
{
schema_version: SchemaVersion,
/** The speech began with an agent's name. */
matched: Type.Boolean(),
agent_id: Type.Union([AgentId, Type.Null()]),
/**
* What was said after the name, when matched (empty when only the name was said). Always
* empty when not matched: speech that was not for an agent is not returned.
*/
text: Type.String({ maxLength: DEFAULT_LIMITS.textMaxChars }),
/** Not matched, but the first word was close to an agent's name: that one word, for tuning aliases. */
near_miss: Type.Union([Type.String({ maxLength: 24 }), Type.Null()]),
},
{ additionalProperties: false },
);
export type WakeResponse = Static<typeof WakeResponse>;
export const TURN_STATES = [
'accepted',
'transcribing',