feat(orchestrator): speak into every text field of the hub (requirement 013)
Requirement 013 and its implementation: page-mic.js puts a microphone on every textarea and text input, records with MediaRecorder and inserts the transcript at the cursor; Escape cancels. /api/stt transcribes with the local whisper.cpp model ggml-small-q8_0 (pinned to commit 5359861c and its sha256) in a per-request temp dir, capped at 60 s and 5 MiB, and returns German or English only, retranscribing a clip detected as another language in both and keeping the surer one. Without a model the button is disabled and names the install row. Tests run once on unify/skills-20261114 after the merge (operator order 2026-11-14). 🎯 Fix: 72 % 💥 Break: 12 % 💸 Tokens: – ⏱️ Velocity: – 🛡️ Security: 100 % 🏆 Score: 63 🚦 Gate: ⛔ fix 72 % < 90, break 12 % > 5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a2a03995cb
commit
a438a2f54e
27 files changed
+861
-149
No files matched your search
@@ -3,6 +3,7 @@ const Voice = (() => {
|
||||
const RANKS = {mayday: 0, "pan-pan": 1, security: 2};
|
||||
const ALARMS = new Set(["mayday", "pan-pan"]);
|
||||
const ROUTINE = 3;
|
||||
const FIELDS = 'textarea, input:not([type]), input[type="text"], input[type="search"]';
|
||||
|
||||
function toneOf(row, human) {
|
||||
if (ALARMS.has(row.class)) {
|
||||
@@ -59,7 +60,26 @@ const Voice = (() => {
|
||||
return buffer;
|
||||
}
|
||||
|
||||
return {toneOf, loudness, beep, enqueue, frames, wav};
|
||||
/**
|
||||
* @param {string} value the text of the field.
|
||||
* @param {number} start the start of its selection.
|
||||
* @param {number} end the end of its selection.
|
||||
* @param {string} text the transcript.
|
||||
* @returns {{value: string, caret: number}} value with the trimmed transcript in place of the selection, one space on each side where a neighbour is no whitespace, and the caret right after the transcript.
|
||||
*/
|
||||
function spliced(value, start, end, text) {
|
||||
const words = String(text).trim();
|
||||
if (!words) {
|
||||
return {value, caret: end};
|
||||
}
|
||||
const before = value.slice(0, start);
|
||||
const after = value.slice(end);
|
||||
const lead = before && !/\s$/.test(before) ? " " : "";
|
||||
const tail = after && !/^\s/.test(after) ? " " : "";
|
||||
return {value: `${before}${lead}${words}${tail}${after}`, caret: before.length + lead.length + words.length};
|
||||
}
|
||||
|
||||
return {FIELDS, toneOf, loudness, beep, enqueue, frames, wav, spliced};
|
||||
})();
|
||||
if (typeof module === "object" && module.exports) {
|
||||
module.exports = Voice;
|
||||
|
||||
Reference in new issue
Block a user