Add wakeword command routing and the reply-only agent client
This commit is contained in:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user