feat(app): log screen saves (shown lines, conversation, voice recordings), stop-or-finish on a new request, video pages that play
- 로그 screen: "보이는 글 txt로 저장" (logs_save_text), a 대화 view that saves the days' conversation with every trace in full (history_export), and a 목소리 view with the voice.record switch and the days' recordings as a zip with an index (voice_export). - Voice worker: with JARVIS_RECORDINGS_DIR (voice.record, off by default) each final and each spoken answer is kept as a WAV with an index line; day folders older than 7 days removed. - response.interrupt (default on): off, latest/important finish the running answer first. - Bot browser: Chrome lets pages start video and sound; botBrowser reports each page's media state, waits for a player to start after open/click, and presses play on a video page a click led to when its player stayed paused (live: a clicked YouTube video stayed paused). - webSearch reads `query` when `search_query` is missing (live: both searches of an answer failed). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -55,6 +55,8 @@ pub struct VoiceSettings {
|
||||
pub max_speakers: usize,
|
||||
/// Transcribe other bots too (music bots are ignored by default).
|
||||
pub listen_to_bots: bool,
|
||||
/// Keep each utterance and spoken answer as a sound file (voice_worker.spec.md, "Recordings").
|
||||
pub record: bool,
|
||||
/// Posted in the voice channel's chat on every join (privacy.md).
|
||||
pub join_notice: String,
|
||||
/// Wake words: the STT hint and the voice wake words of call detection (`conversation.spec.md`).
|
||||
@@ -251,6 +253,7 @@ impl Default for Settings {
|
||||
voice: VoiceSettings {
|
||||
max_speakers: 10,
|
||||
listen_to_bots: false,
|
||||
record: false,
|
||||
join_notice: DEFAULT_JOIN_NOTICE.into(),
|
||||
wake_words: vec!["자비스".into()],
|
||||
stt: Map::new(),
|
||||
@@ -471,6 +474,7 @@ fn parse_response(raw: &Map<String, Value>, d: &PolicySettings) -> Result<Policy
|
||||
settle: get_ms(r, "settleMs", "response", d.settle, 3000)?,
|
||||
priorities,
|
||||
rank_timeout: d.rank_timeout,
|
||||
interrupt: get_bool(r, "interrupt", "response", d.interrupt)?,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -579,6 +583,7 @@ pub fn parse_settings(raw: &Value) -> Result<Settings, SettingsError> {
|
||||
voice: VoiceSettings {
|
||||
max_speakers,
|
||||
listen_to_bots: get_bool(voice, "listenToBots", "voice", d.voice.listen_to_bots)?,
|
||||
record: get_bool(voice, "record", "voice", d.voice.record)?,
|
||||
join_notice,
|
||||
wake_words,
|
||||
stt,
|
||||
@@ -902,7 +907,7 @@ mod tests {
|
||||
let path = dir.join("settings.json");
|
||||
let doc = json!({
|
||||
"discord": {"guildId": ID, "voiceChannelId": ID, "commandName": "jarvis", "ephemeralReplies": false},
|
||||
"voice": {"maxSpeakers": 3, "listenToBots": true, "joinNotice": "알림", "wakeWords": [" 자비스 ", "", "javis"],
|
||||
"voice": {"maxSpeakers": 3, "listenToBots": true, "record": true, "joinNotice": "알림", "wakeWords": [" 자비스 ", "", "javis"],
|
||||
"stt": {"end_silence_ms": 250}},
|
||||
"chatChannels": [{"id": ID, "name": "일정", "description": "일정 올리는 곳", "send": false}],
|
||||
"voiceWorker": {"python": "/venv/bin/python", "cwd": "/repo/src", "args": ["--melo-python", "/m/python"]},
|
||||
@@ -915,6 +920,8 @@ mod tests {
|
||||
command_name: "jarvis".into(), ephemeral_replies: false });
|
||||
assert_eq!(s.voice.max_speakers, 3);
|
||||
assert!(s.voice.listen_to_bots);
|
||||
assert!(s.voice.record);
|
||||
assert!(!parse_settings(&json!({})).unwrap().voice.record, "off by default");
|
||||
assert_eq!(s.voice.join_notice, "알림");
|
||||
assert_eq!(s.voice.wake_words, vec!["자비스", "javis"]);
|
||||
assert_eq!(s.voice.stt.get("end_silence_ms"), Some(&json!(250)));
|
||||
@@ -955,7 +962,7 @@ mod tests {
|
||||
"call": {"similarity": 0.3, "mode": "addressed", "designated": [ID], "designatedOnly": true,
|
||||
"designatedNoWakeWord": true, "stopWords": ["멈춰", " "], "chatWakeWords": ["봇"],
|
||||
"followUpMs": 2500, "earcon": false},
|
||||
"response": {"policy": "important", "queueMax": 3, "collectMs": 500, "settleMs": 0,
|
||||
"response": {"policy": "important", "queueMax": 3, "collectMs": 500, "settleMs": 0, "interrupt": false,
|
||||
"priorities": {ID: 2}}
|
||||
})).unwrap();
|
||||
assert_eq!(s.call.wake_words, vec!["자비스", "javis"]);
|
||||
@@ -972,6 +979,8 @@ mod tests {
|
||||
assert_eq!(s.response.queue_max, 3);
|
||||
assert_eq!(s.response.collect, Duration::from_millis(500));
|
||||
assert_eq!(s.response.settle, Duration::ZERO);
|
||||
assert!(!s.response.interrupt);
|
||||
assert!(parse_settings(&json!({})).unwrap().response.interrupt, "on by default");
|
||||
assert_eq!(s.response.priorities.get(&IDN), Some(&2));
|
||||
let s = parse_settings(&json!({"chatChannels": [{"id": ID, "answer": "everything"}]})).unwrap();
|
||||
assert!(s.chat_channels[0].answer_all);
|
||||
@@ -984,6 +993,7 @@ mod tests {
|
||||
(json!({"call": {"earcon": "yes"}}), "call.earcon"),
|
||||
(json!({"response": {"policy": "random"}}), "response.policy"),
|
||||
(json!({"response": {"queueMax": 0}}), "response.queueMax"),
|
||||
(json!({"response": {"interrupt": "yes"}}), "response.interrupt"),
|
||||
(json!({"response": {"collectMs": 5000}}), "response.collectMs"),
|
||||
(json!({"response": {"priorities": {"x": 1}}}), "response.priorities"),
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user