@double_geste/agent-standup 1.48.0 → 1.49.0
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/kokoro-worker.js +4 -2
- package/package.json +1 -1
- package/public/index.html +6 -3
- package/public/locales/da.json +1 -0
- package/public/locales/de.json +1 -0
- package/public/locales/en.json +1 -0
- package/public/locales/es.json +1 -0
- package/public/locales/ja.json +1 -0
- package/public/locales/ko.json +1 -0
- package/public/locales/pt-BR.json +1 -0
- package/public/locales/zh-CN.json +1 -0
- package/public/locales/zh-TW.json +1 -0
package/kokoro-worker.js
CHANGED
|
@@ -6,6 +6,8 @@ const MODEL = 'onnx-community/Kokoro-82M-v1.0-ONNX';
|
|
|
6
6
|
// Chinese is another model of the same family, Kokoro-82M-v1.1-zh, in full precision: on an M1 Pro the 8-bit file was twice as slow, and the half-precision one returned silence (NaN) for most voices.
|
|
7
7
|
// kokoro.js puts its files, checked, where transformers.js keeps what it downloads, so loading it here reads them from disk. Its phonemes come from zh-g2p.js, its voices from <dir>/zh-voices.
|
|
8
8
|
const ZH_MODEL = 'onnx-community/Kokoro-82M-v1.1-zh-ONNX', ZH_DTYPE = 'fp32';
|
|
9
|
+
const ORT_OPTS = { session_options: { enableCpuMemArena: false } }; // Chromium traps when ONNX's arena doubles to 2 GiB in Electron; plain tensor allocations stay below it
|
|
10
|
+
// kokoro-js' own from_pretrained passes only dtype, device and progress_callback on to transformers.js, so the session options would be dropped: build its KokoroTTS from the model and tokenizer loaded here
|
|
9
11
|
const send = (o) => fs.writeSync(1, JSON.stringify(o) + '\n');
|
|
10
12
|
const finite = (samples) => { for (let i = 0; i < samples.length; i++) if (samples[i] !== samples[i]) return false; return true; }; // a quantised model can return NaN for a whole line, which would be written as silence
|
|
11
13
|
function wav(samples, rate) { // Float32 in [-1, 1] → 16-bit mono WAV
|
|
@@ -54,7 +56,7 @@ async function main() {
|
|
|
54
56
|
const dir = process.env.AGENT_STANDUP_KOKORO_DIR, dtype = process.env.AGENT_STANDUP_KOKORO_DTYPE || 'q4';
|
|
55
57
|
const req = createRequire(path.join(dir, 'node_modules', 'x.js')); // resolve from the install folder, not from the extension
|
|
56
58
|
const tf = req('@huggingface/transformers'); tf.env.cacheDir = path.join(dir, 'models');
|
|
57
|
-
const { KokoroTTS } = req('kokoro-js'),
|
|
59
|
+
const { KokoroTTS } = req('kokoro-js'), pretrained = async (m, d) => new KokoroTTS(...await Promise.all([tf.StyleTextToSpeech2Model.from_pretrained(m, { ...ORT_OPTS, dtype: d, device: 'cpu' }), tf.AutoTokenizer.from_pretrained(m)])), load = () => pretrained(MODEL, dtype);
|
|
58
60
|
let tts; try { tts = await load(); } catch (e) {
|
|
59
61
|
// transformers.js writes the model straight to its final name and never checks it again: a download cut short (the worker killed while the model
|
|
60
62
|
// was being fetched, e.g. by a reload of the window) leaves a file that fails to load every time after. Drop this model's files and fetch them once more.
|
|
@@ -66,7 +68,7 @@ async function main() {
|
|
|
66
68
|
strict(tts); // kokoro-js calls the tokenizer with truncation on, which drops every phoneme past the model's limit and says nothing: count them all here and refuse instead
|
|
67
69
|
const packs = new Map(), pack = (n) => { if (!packs.has(n)) { const b = fs.readFileSync(/^z[fm]_/.test(n) ? path.join(dir, 'zh-voices', n + '.bin') : path.join(dir, 'node_modules', 'kokoro-js', 'voices', n + '.bin')); packs.set(n, new Float32Array(b.buffer.slice(b.byteOffset, b.byteOffset + b.length))); } return packs.get(n); }; // a voice: 510 styles of 256 numbers, one per length of line. All 54 of v1.0 come with kokoro-js; the Chinese ones are fetched by kokoro.js
|
|
68
70
|
let zh = null; // the Chinese model and its phonemizer, loaded on the first Chinese line: whoever never hears one never loads them
|
|
69
|
-
const zhLoad = async () => zh || (zh = { tts: strict(await
|
|
71
|
+
const zhLoad = async () => zh || (zh = { tts: strict(await pretrained(ZH_MODEL, ZH_DTYPE)), g2p: require(path.join(__dirname, 'zh-g2p.js')).make(req('pinyin-pro'), req('jieba-wasm'), req('opencc-js').Converter({ from: 'tw', to: 'cn' })) });
|
|
70
72
|
const foreign = async (text, o) => { // what kokoro-js' generate_from_ids does, with a style that can be a mix of several voices (o.mix: [[voice, share], …])
|
|
71
73
|
const z = o.lang === 'zh' ? await zhLoad() : null, m = z ? z.tts : tts; // Chinese: its own model; an English word inside the line is said from its English phonemes
|
|
72
74
|
const ph = z ? await z.g2p(text, (w) => phonemes(dir, w, 'en-us')) : await phonemes(dir, text, o.lang);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@double_geste/agent-standup",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.49.0",
|
|
4
4
|
"description": "Your Claude Code, Codex and Mistral Vibe agents as a live video call, from the terminal: a local page in your browser, plus one-line status for status bars. Free, open source, zero token cost.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"agent-standup": "bin/agent-standup.js"
|
package/public/index.html
CHANGED
|
@@ -450,6 +450,7 @@
|
|
|
450
450
|
<div class="phead"><h2 id="prefsT" data-fr="Réglages" data-en="Settings">Réglages</h2><button class="btn" id="prefsX" data-fr="Fermer" data-en="Close">Fermer</button></div>
|
|
451
451
|
<div class="pcols"><div class="pcol">
|
|
452
452
|
<h4 data-fr="Son et alertes" data-en="Sound and alerts">Son et alertes</h4>
|
|
453
|
+
<button class="mi" data-t="voiceYou"><span data-fr="Lire vos messages à voix haute" data-en="Read your messages aloud">Lire vos messages à voix haute</span><i class="sw"></i></button>
|
|
453
454
|
<button class="mi" data-t="office"><span data-fr="Ambiance de bureau (clavier, café…)" data-en="Office ambience (keys, coffee…)">Ambiance de bureau (clavier, café…)</span><i class="sw"></i></button>
|
|
454
455
|
<div class="box" id="officeBox" style="display:none"><input id="officeVol" type="range" min="0.1" max="1" step="0.05" style="width:100%" aria-label="Ambience volume"></div>
|
|
455
456
|
<button class="mi" data-t="music"><span data-fr="Musique d’ambiance (radio FIP)" data-en="Office music (FIP radio)">Musique d’ambiance (radio FIP)</span><i class="sw"></i></button>
|
|
@@ -534,7 +535,7 @@ const Q = new URLSearchParams(location.search);
|
|
|
534
535
|
const EMBED = Q.get('embed') === '1' || window.parent !== window;
|
|
535
536
|
const APP = window.AS_APP && typeof window.AS_APP === 'object' && typeof window.AS_APP.rate === 'string' ? window.AS_APP : { kind: '', rate: 'https://github.com/Atoll92/agent-standup' }; // where this page runs (appKind in server.js)
|
|
536
537
|
|
|
537
|
-
let prefs = { lang: 'en', voice: true, roster: false, banter: true, reactions: false, office: false, officeVol: 0.8, vstyle: 'kokoro', notify: false, epi: false, vanish: true, music: false, station: 'fip', musicVol: 0.35, view: 'call', hideCode: false, ownNames: true, visits: true, askCard: false, followTab: true, files: true, callTr: true, voiceVol: 1 };
|
|
538
|
+
let prefs = { lang: 'en', voice: true, voiceYou: false, roster: false, banter: true, reactions: false, office: false, officeVol: 0.8, vstyle: 'kokoro', notify: false, epi: false, vanish: true, music: false, station: 'fip', musicVol: 0.35, view: 'call', hideCode: false, ownNames: true, visits: true, askCard: false, followTab: true, files: true, callTr: true, voiceVol: 1 };
|
|
538
539
|
const PREF_DEFAULTS = { ...prefs }; // for ⚙ → All settings → Reset to defaults
|
|
539
540
|
let leadProject = null; // the project of the loaded live call or replay, supplied by the server before naming its agents
|
|
540
541
|
let prefsBase = {}; // the settings file as this page last knew it: a save sends only what changed since (prefsPatch), so another window's newer choices are not written over
|
|
@@ -1219,6 +1220,7 @@ function warmTTS(i) { // called by run() before each line (i is that line) and
|
|
|
1219
1220
|
else if (isSub(e.agent)) { while (j < Math.min(len, k + 28) && group.length < 3) { const e2 = S.events[j]; if (quiet(e2)) j++; else if (e2.kind !== 'order' && isSub(e2.agent) && !group.some((g) => g.agent === e2.agent)) { group.push(e2); j++; } else break; } }
|
|
1220
1221
|
const pl = paceAt(k), many = e.kind === 'order' && group.length > 1, rate = TTS.rateAt(many || !S.live ? k : j - 1, pl.boost);
|
|
1221
1222
|
for (const g of many ? [e] : group) { // orders in a row: only the first is read out
|
|
1223
|
+
if (g.agent === 'user' && S.live && !prefs.voiceYou) continue; // your own lines: silent in the live call unless their switch is on (you just typed them); a replay or the demo reads them, as its listener did not
|
|
1222
1224
|
n++; const p = S.agents[g.agent], bt = baseText(g); if ((pl.hurry && g.kind !== 'user') || !p || (TRL() && !trMem.has(bt) && langOf(bt) !== CALL())) continue; // not translated yet: what will be said is not known
|
|
1223
1225
|
const said = clipSpeech(talkLine(g), pl.pace), text = speakable(said), voice = TTS.voiceFor(p, sessVoice(said, g)); if (text && voice) jobs.push({ k, text, voice, rate });
|
|
1224
1226
|
}
|
|
@@ -1370,8 +1372,9 @@ function sessVoice(text, ev) { // for the lines that come from the session (ev
|
|
|
1370
1372
|
}
|
|
1371
1373
|
return inCall(lo ?? sessLang());
|
|
1372
1374
|
}
|
|
1373
|
-
async function speakLine(text, p, primary, token, lo = voiceLang(text), always = false) { // always: your own lines are voiced even when the call is behind
|
|
1375
|
+
async function speakLine(text, p, primary, token, lo = voiceLang(text), always = false) { // always: your own lines are voiced even when the call is behind, if their voice is on (always in a replay or the demo)
|
|
1374
1376
|
captionRun(p.id, text, estMs(text));
|
|
1377
|
+
if (p.id === 'user' && S.live && !prefs.voiceYou) return sleep(estMs(text));
|
|
1375
1378
|
if (AUD.calm() || !prefs.voice) { if (!AUD.calm() && prefs.office) AUD.murmur(0.5 + (p.vi % 5) / 10, estMs(text) / 1000); return sleep(estMs(text)); }
|
|
1376
1379
|
if (S.hurry && !always) return sleep(estMs(text));
|
|
1377
1380
|
const bab = babbles() || noNatural(lo); if (bab && AUD.ctx) { try { await speakBabble(text, p, primary ? 1 : 0.5, token); return; } catch {} }
|
|
@@ -3649,7 +3652,7 @@ function openPrefs(target) { // ⚙ → All settings; target: one of its setti
|
|
|
3649
3652
|
$('#menu').classList.remove('on'); $('#prefs').classList.add('on'); syncSwitches(); subField(); document.querySelectorAll('#prefs .mi[data-t]').forEach((b) => b.querySelector('.sw').classList.toggle('on', !!prefs[b.dataset.t]));
|
|
3650
3653
|
if (target) { target.scrollIntoView({ block: 'center' }); target.classList.remove('flash'); void target.offsetWidth; target.classList.add('flash'); (target.matches('.mi') ? target : target.querySelector('select, input, textarea, button') || target).focus(); } else $('#prefsX').focus();
|
|
3651
3654
|
}
|
|
3652
|
-
const PANEL_KEYS = ['office', 'officeVol', 'music', 'station', 'musicVol', 'voiceVol', 'notify', 'customLaptop', 'ownNames', 'roster', 'reactions', 'banter', 'chat', 'vanish', 'epi', 'files', 'artNet', 'visits', 'askCard', 'followTab', 'leadName', 'subNames']; // what the panel holds, and so what Reset puts back
|
|
3655
|
+
const PANEL_KEYS = ['voiceYou', 'office', 'officeVol', 'music', 'station', 'musicVol', 'voiceVol', 'notify', 'customLaptop', 'ownNames', 'roster', 'reactions', 'banter', 'chat', 'vanish', 'epi', 'files', 'artNet', 'visits', 'askCard', 'followTab', 'leadName', 'subNames']; // what the panel holds, and so what Reset puts back
|
|
3653
3656
|
$('#prefsReset').onclick = async () => {
|
|
3654
3657
|
const b = $('#prefsReset'); if (!b.classList.contains('sure')) { b.classList.add('sure'); b.textContent = L('Cliquez encore pour tout remettre', 'Click again to reset them all'); setTimeout(() => { b.classList.remove('sure'); b.textContent = L('Réglages par défaut', 'Reset to defaults'); }, 4000); return; } // two clicks: nothing is lost by a stray one
|
|
3655
3658
|
const keys = [...PANEL_KEYS, ...(projectLeadKey() ? [projectLeadKey()] : [])]; // reset the displayed project override, leaving other projects alone
|
package/public/locales/da.json
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"🎬 Clip to share (25 s)": "🎬 Klip til deling (25 s)",
|
|
14
14
|
"📋 Recap": "📋 Resumé",
|
|
15
15
|
"Agent voices": "Agentstemmer",
|
|
16
|
+
"Read your messages aloud": "Læs dine beskeder højt",
|
|
16
17
|
"Agents": "Agenter",
|
|
17
18
|
"Agents list (left)": "Agentliste (til venstre)",
|
|
18
19
|
"All projects (most recent)": "Alle projekter (nyeste)",
|
package/public/locales/de.json
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"🎬 Clip to share (25 s)": "🎬 Clip zum Teilen (25 s)",
|
|
14
14
|
"📋 Recap": "📋 Zusammenfassung",
|
|
15
15
|
"Agent voices": "Agenten-Stimmen",
|
|
16
|
+
"Read your messages aloud": "Deine Nachrichten vorlesen",
|
|
16
17
|
"Agents": "Agenten",
|
|
17
18
|
"Agents list (left)": "Agentenliste (links)",
|
|
18
19
|
"All projects (most recent)": "Alle Projekte (neueste zuerst)",
|
package/public/locales/en.json
CHANGED
package/public/locales/es.json
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"🎬 Clip to share (25 s)": "🎬 Clip para compartir (25 s)",
|
|
14
14
|
"📋 Recap": "📋 Resumen",
|
|
15
15
|
"Agent voices": "Voces de los agentes",
|
|
16
|
+
"Read your messages aloud": "Leer tus mensajes en voz alta",
|
|
16
17
|
"Agents": "Agentes",
|
|
17
18
|
"Agents list (left)": "Lista de agentes (izquierda)",
|
|
18
19
|
"All projects (most recent)": "Todos los proyectos (más recientes)",
|
package/public/locales/ja.json
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"🎬 Clip to share (25 s)": "🎬 シェア用クリップ(25秒)",
|
|
14
14
|
"📋 Recap": "📋 まとめ",
|
|
15
15
|
"Agent voices": "エージェントの声",
|
|
16
|
+
"Read your messages aloud": "あなたのメッセージを読み上げる",
|
|
16
17
|
"Agents": "エージェント",
|
|
17
18
|
"Agents list (left)": "エージェント一覧(左)",
|
|
18
19
|
"All projects (most recent)": "すべてのプロジェクト(最新順)",
|
package/public/locales/ko.json
CHANGED