Add wakeword command routing and the reply-only agent client

This commit is contained in:
Fisto
2026-09-22 09:23:11 +02:00
parent a4d61781e9
commit d99d614c60
14 changed files with 399 additions and 34 deletions
+8
View File
@@ -8,6 +8,8 @@
*/
import express, { type Request, type Response } from "express";
import { normalizeWakeword } from "./communication.js";
import { existsSync, readFileSync } from "node:fs";
import { Readable } from "node:stream";
import http from "node:http";
@@ -486,6 +488,7 @@ export function startWebUi(deps: WebUiDeps): WebUiHandle {
wrap(async (req, res) => {
const {
visibleGuilds,
commands: commandPrefs,
tts,
audio,
voice: voicePrefs,
@@ -556,6 +559,10 @@ export function startWebUi(deps: WebUiDeps): WebUiHandle {
deps.audio.setDuckEnabled(patch.audio.duck);
}
if (commandPrefs !== undefined) {
patch.commands = { wakeword: normalizeWakeword(commandPrefs?.wakeword) };
}
if (voicePrefs !== undefined) {
patch.voice = {
noiseSuppression: voicePrefs?.noiseSuppression === true,
@@ -568,6 +575,7 @@ export function startWebUi(deps: WebUiDeps): WebUiHandle {
const updated = deps.preferences.update(patch);
if (mediaPrefs !== undefined) deps.media.applyTunables();
if (commandPrefs !== undefined) deps.getPuppet()?.updateConfig({ wakeword: updated.commands.wakeword });
if (voicePrefs !== undefined) {
const core = deps.getCore();
if (core && deps.isCoreConnected()) {