omnius 1.0.427 → 1.0.428
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +59 -34
- package/dist/scripts/live-whisper.py +5 -3
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -603384,6 +603384,15 @@ async function findLiveWhisperScript() {
|
|
|
603384
603384
|
}
|
|
603385
603385
|
return null;
|
|
603386
603386
|
}
|
|
603387
|
+
function defaultConsensusModel(primaryModel) {
|
|
603388
|
+
const model = primaryModel.trim().toLowerCase();
|
|
603389
|
+
if (model === "tiny") return "base";
|
|
603390
|
+
if (model === "base") return "small";
|
|
603391
|
+
if (model === "small") return "base";
|
|
603392
|
+
if (model === "medium") return "base";
|
|
603393
|
+
if (model === "large-v3" || model === "large") return "small";
|
|
603394
|
+
return "base";
|
|
603395
|
+
}
|
|
603387
603396
|
async function ensureVenvForTranscribeCli() {
|
|
603388
603397
|
const bin = process.platform === "win32" ? "Scripts" : "bin";
|
|
603389
603398
|
const exe = process.platform === "win32" ? "python.exe" : "python3";
|
|
@@ -603573,7 +603582,9 @@ var init_listen = __esm({
|
|
|
603573
603582
|
lastStatus: `loading whisper ${this.model} model...`
|
|
603574
603583
|
});
|
|
603575
603584
|
const consensusEnv = String(process.env["OMNIUS_ASR_CONSENSUS"] ?? "").trim().toLowerCase();
|
|
603576
|
-
const consensusModel = consensusEnv === "0" || consensusEnv === "off" || consensusEnv === "false" ? "off" : consensusEnv || (this.model
|
|
603585
|
+
const consensusModel = consensusEnv === "0" || consensusEnv === "off" || consensusEnv === "false" ? "off" : consensusEnv || defaultConsensusModel(this.model);
|
|
603586
|
+
const consensusThreshold = String(process.env["OMNIUS_ASR_CONSENSUS_THRESHOLD"] ?? "0.45");
|
|
603587
|
+
const silenceMs = String(process.env["OMNIUS_ASR_SILENCE_MS"] ?? "800");
|
|
603577
603588
|
this.process = spawn29(
|
|
603578
603589
|
pyPath,
|
|
603579
603590
|
[
|
|
@@ -603585,7 +603596,11 @@ var init_listen = __esm({
|
|
|
603585
603596
|
"--window-seconds",
|
|
603586
603597
|
"10",
|
|
603587
603598
|
"--consensus-model",
|
|
603588
|
-
consensusModel
|
|
603599
|
+
consensusModel,
|
|
603600
|
+
"--consensus-threshold",
|
|
603601
|
+
consensusThreshold,
|
|
603602
|
+
"--silence-ms",
|
|
603603
|
+
silenceMs
|
|
603589
603604
|
],
|
|
603590
603605
|
{
|
|
603591
603606
|
stdio: ["pipe", "pipe", "pipe"],
|
|
@@ -603625,9 +603640,13 @@ var init_listen = __esm({
|
|
|
603625
603640
|
});
|
|
603626
603641
|
break;
|
|
603627
603642
|
case "consensus_rejected":
|
|
603628
|
-
|
|
603629
|
-
|
|
603630
|
-
|
|
603643
|
+
{
|
|
603644
|
+
const message2 = `consensus rejected (${evt.reason ?? "mismatch"}): ${String(evt.primary ?? "").slice(0, 80)}`;
|
|
603645
|
+
updateListenLiveState({
|
|
603646
|
+
lastStatus: message2
|
|
603647
|
+
});
|
|
603648
|
+
this.emit("status", message2);
|
|
603649
|
+
}
|
|
603631
603650
|
break;
|
|
603632
603651
|
case "vad": {
|
|
603633
603652
|
lastHardwareVadAt = Date.now();
|
|
@@ -604033,8 +604052,9 @@ transcribe-cli error: ${transcribeCliError}` : "";
|
|
|
604033
604052
|
return `Failed to start live transcription: ${msg}${tcHint}`;
|
|
604034
604053
|
}
|
|
604035
604054
|
}
|
|
604036
|
-
this.spawnMicProcess(micCmd);
|
|
604037
604055
|
this.active = true;
|
|
604056
|
+
this.paused = false;
|
|
604057
|
+
this.spawnMicProcess(micCmd);
|
|
604038
604058
|
this.blinkState = true;
|
|
604039
604059
|
this.blinkTimer = setInterval(() => {
|
|
604040
604060
|
this.blinkState = !this.blinkState;
|
|
@@ -697778,7 +697798,7 @@ Rules:
|
|
|
697778
697798
|
this.emit("snr", { score: this.lastSignalScore });
|
|
697779
697799
|
this.onPartialTranscript(text2);
|
|
697780
697800
|
if (this.silenceTimer) clearTimeout(this.silenceTimer);
|
|
697781
|
-
const waitMs = this._vadSilenceMs ?? VAD_SILENCE_MS;
|
|
697801
|
+
const waitMs = isFinal ? 0 : this._vadSilenceMs ?? VAD_SILENCE_MS;
|
|
697782
697802
|
this.silenceTimer = setTimeout(() => {
|
|
697783
697803
|
if (this._state === "CAPTURING") {
|
|
697784
697804
|
this.finalizeSegment();
|
|
@@ -697945,35 +697965,35 @@ ${toolOutput}` });
|
|
|
697945
697965
|
const reply = extractVoiceModelReply(stripToolJsonLines(response.trim()));
|
|
697946
697966
|
const finalSpoken = reply.text;
|
|
697947
697967
|
if (!finalSpoken || reply.action === "silent") {
|
|
697948
|
-
|
|
697949
|
-
|
|
697950
|
-
|
|
697951
|
-
|
|
697952
|
-
|
|
697953
|
-
|
|
697968
|
+
} else {
|
|
697969
|
+
if (typeof this.voice.waitUntilIdle === "function") {
|
|
697970
|
+
try {
|
|
697971
|
+
await this.voice.waitUntilIdle();
|
|
697972
|
+
} catch {
|
|
697973
|
+
}
|
|
697954
697974
|
}
|
|
697955
|
-
|
|
697956
|
-
|
|
697957
|
-
|
|
697958
|
-
|
|
697959
|
-
|
|
697960
|
-
|
|
697961
|
-
|
|
697962
|
-
|
|
697963
|
-
|
|
697964
|
-
|
|
697965
|
-
|
|
697966
|
-
|
|
697967
|
-
|
|
697968
|
-
|
|
697969
|
-
|
|
697975
|
+
this.context.push({ role: "assistant", content: finalSpoken });
|
|
697976
|
+
this.trimContext();
|
|
697977
|
+
this.setState("SPEAKING");
|
|
697978
|
+
this.onAgentSpeech(finalSpoken);
|
|
697979
|
+
this.lastAgentSpeech = { text: finalSpoken, startedAt: Date.now() };
|
|
697980
|
+
this.voice.speak(finalSpoken);
|
|
697981
|
+
this.voiceTranscript.push({ role: "assistant", content: finalSpoken, ts: Date.now() });
|
|
697982
|
+
if (this.runner && this.turnCount % SUMMARY_INJECTION_INTERVAL === 0) {
|
|
697983
|
+
this.injectSummary();
|
|
697984
|
+
}
|
|
697985
|
+
if (typeof this.voice.waitUntilIdle === "function") {
|
|
697986
|
+
try {
|
|
697987
|
+
await this.voice.waitUntilIdle();
|
|
697988
|
+
} catch {
|
|
697989
|
+
}
|
|
697990
|
+
} else {
|
|
697991
|
+
const estimatedMs = Math.max(1500, finalSpoken.length / 5 * (6e4 / 150));
|
|
697992
|
+
await new Promise((r2) => setTimeout(r2, estimatedMs));
|
|
697993
|
+
}
|
|
697994
|
+
if (reply.action === "hangup") {
|
|
697995
|
+
this.active = false;
|
|
697970
697996
|
}
|
|
697971
|
-
} else {
|
|
697972
|
-
const estimatedMs = Math.max(1500, finalSpoken.length / 5 * (6e4 / 150));
|
|
697973
|
-
await new Promise((r2) => setTimeout(r2, estimatedMs));
|
|
697974
|
-
}
|
|
697975
|
-
if (reply.action === "hangup") {
|
|
697976
|
-
this.active = false;
|
|
697977
697997
|
}
|
|
697978
697998
|
}
|
|
697979
697999
|
} catch (err) {
|
|
@@ -737140,6 +737160,11 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
737140
737160
|
listenEng.on("level", (evt) => {
|
|
737141
737161
|
statusBar.setMicActivity(evt.speechActive, evt.levelDb);
|
|
737142
737162
|
});
|
|
737163
|
+
listenEng.on("info", (msg) => {
|
|
737164
|
+
if (/consensus rejected|loading whisper|whisper model loaded/i.test(msg)) {
|
|
737165
|
+
writeContent(() => renderInfo(`[voicechat/asr] ${msg}`));
|
|
737166
|
+
}
|
|
737167
|
+
});
|
|
737143
737168
|
const summaryRunner = {
|
|
737144
737169
|
injectUserMessage(content) {
|
|
737145
737170
|
if (activeTask?.runner) {
|
|
@@ -483,13 +483,15 @@ def main():
|
|
|
483
483
|
if text == last_final_text:
|
|
484
484
|
return
|
|
485
485
|
last_final_text = text
|
|
486
|
-
# consensus=True only when BOTH models ran and converged
|
|
487
|
-
#
|
|
486
|
+
# consensus=True only when BOTH models ran and converged. When the
|
|
487
|
+
# second model is off/unavailable, omit consensus metadata entirely
|
|
488
|
+
# so legacy single-model consumers do not interpret consensus=false
|
|
489
|
+
# as an explicit dual-ASR rejection.
|
|
488
490
|
emit_transcript(
|
|
489
491
|
text,
|
|
490
492
|
is_final=True,
|
|
491
493
|
doa=tuning.doa() if tuning else None,
|
|
492
|
-
consensus=consensus_model is not None,
|
|
494
|
+
consensus=True if consensus_model is not None else None,
|
|
493
495
|
)
|
|
494
496
|
except Exception as e:
|
|
495
497
|
emit_error(f"Transcription error: {e}")
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.428",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "omnius",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.428",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
package/package.json
CHANGED