feat(app): a call still being said lets the brain get ready

A partial transcript that call detection already reads as a request is sent
to the worker as prepare, so the intent judge runs while the speaker talks.
The live round trip now times the earcon and the answer's own sound apart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-12 12:25:15 +09:00
parent 46e4e75d05
commit b88e20134f
6 changed files with 96 additions and 13 deletions

View File

@@ -343,6 +343,11 @@ impl WorkerClient {
self.send_json(json!({"type": "addressed", "id": id, "user": user.to_string(), "text": text}))
}
/// Tell the brain a call is being said (a partial transcript), so it gets ready to answer it.
pub fn prepare(&self, user: u64, text: &str) -> bool {
self.send_json(json!({"type": "prepare", "user": user.to_string(), "text": text}))
}
/// Ask the brain to rank tied candidates `(id, user, text)` by importance.
pub fn rank(&self, id: &str, candidates: &[(String, u64, String)]) -> bool {
let list: Vec<Value> = candidates.iter()