feat(webchat): add personal assistant mode controls in settings
This commit is contained in:
@@ -163,6 +163,52 @@ const PATCHABLE_KEYS: Record<string, (config: Config, value: unknown) => boolean
|
||||
config.server.nodes.push.enabled = value;
|
||||
return true;
|
||||
},
|
||||
'automation.delivery_mode': (config, value) => {
|
||||
if (value !== 'shared_session' && value !== 'isolated_job' && value !== 'announce') {return false;}
|
||||
config.automation ??= {} as Config['automation'];
|
||||
config.automation.delivery_mode = value;
|
||||
return true;
|
||||
},
|
||||
'automation.daily_briefing.enabled': (config, value) => {
|
||||
if (typeof value !== 'boolean') {return false;}
|
||||
config.automation ??= {} as Config['automation'];
|
||||
config.automation.daily_briefing ??= {} as Config['automation']['daily_briefing'];
|
||||
config.automation.daily_briefing.enabled = value;
|
||||
return true;
|
||||
},
|
||||
'memory.daily_log.enabled': (config, value) => {
|
||||
if (typeof value !== 'boolean') {return false;}
|
||||
config.memory ??= {} as Config['memory'];
|
||||
config.memory.daily_log ??= {} as Config['memory']['daily_log'];
|
||||
config.memory.daily_log.enabled = value;
|
||||
return true;
|
||||
},
|
||||
'memory.proactive_extract.enabled': (config, value) => {
|
||||
if (typeof value !== 'boolean') {return false;}
|
||||
config.memory ??= {} as Config['memory'];
|
||||
config.memory.proactive_extract ??= {} as Config['memory']['proactive_extract'];
|
||||
config.memory.proactive_extract.enabled = value;
|
||||
return true;
|
||||
},
|
||||
'memory.proactive_extract.min_tool_calls': (config, value) => {
|
||||
if (typeof value !== 'number' || !Number.isFinite(value) || value < 0 || value > 50) {return false;}
|
||||
config.memory ??= {} as Config['memory'];
|
||||
config.memory.proactive_extract ??= {} as Config['memory']['proactive_extract'];
|
||||
config.memory.proactive_extract.min_tool_calls = Math.floor(value);
|
||||
return true;
|
||||
},
|
||||
'tts.enabled': (config, value) => {
|
||||
if (typeof value !== 'boolean') {return false;}
|
||||
config.tts ??= {} as Config['tts'];
|
||||
config.tts.enabled = value;
|
||||
return true;
|
||||
},
|
||||
'tts.enabled_channels': (config, value) => {
|
||||
if (!Array.isArray(value) || !value.every((v) => typeof v === 'string' && v.trim().length > 0)) {return false;}
|
||||
config.tts ??= {} as Config['tts'];
|
||||
config.tts.enabled_channels = value as string[];
|
||||
return true;
|
||||
},
|
||||
};
|
||||
|
||||
export function createConfigHandlers(deps: ConfigHandlerDeps) {
|
||||
|
||||
Reference in New Issue
Block a user