@double_geste/agent-standup 1.41.2 → 1.43.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/bin/agent-standup.js +6 -4
- package/codex.js +64 -14
- package/package.json +1 -1
- package/public/index.html +103 -37
- package/public/locales/da.json +17 -3
- package/public/locales/de.json +17 -3
- package/public/locales/en.json +16 -2
- package/public/locales/es.json +17 -3
- package/public/locales/ja.json +17 -3
- package/public/locales/ko.json +17 -3
- package/public/locales/pt-BR.json +17 -3
- package/public/locales/zh-CN.json +17 -3
- package/public/locales/zh-TW.json +17 -3
- package/server.js +104 -30
package/public/index.html
CHANGED
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
@media (min-width:900px) { body.rost:not(.tree):not(.board) #roster { display:flex } }
|
|
83
83
|
#roster:focus-visible { outline:2px solid var(--accent); outline-offset:-2px } /* the first stop of the Tab key */
|
|
84
84
|
#roster h3 { margin:2px 6px 4px; font-size:11px; font-weight:600; letter-spacing:.06em; text-transform:uppercase; color:var(--dim) }
|
|
85
|
+
#roster h3 .rnm { float:right; background:none; border:0; padding:0 3px; border-radius:4px; color:var(--dim); font:inherit; font-size:12px; line-height:1.2; cursor:pointer } #roster h3 .rnm:hover, #roster h3 .rnm:focus-visible { color:var(--accent) } #dren { margin-left:auto; margin-right:4px } /* ✎: rename the agents (⚙ → All settings → Sub-agent names) */
|
|
85
86
|
.rr { display:flex; flex-direction:column; gap:2px; padding:6px 9px; border-radius:9px; border-left:3px solid transparent; background:var(--panel2); cursor:pointer; min-width:0 }
|
|
86
87
|
.rr:hover { background:#2a2f45 } .rr.sel { outline:1px solid var(--accent) }
|
|
87
88
|
.rr .n { display:flex; align-items:center; gap:7px; min-width:0 } .rr .dot { width:9px; height:9px; border-radius:50%; flex:none } .rr b { font-size:12.5px } .rr .ro { color:var(--dim); font-size:11px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0 }
|
|
@@ -236,6 +237,7 @@
|
|
|
236
237
|
.tag { position:absolute; left:6px; bottom:6px; right:6px; display:flex; gap:5px; pointer-events:none }
|
|
237
238
|
.tag b, .tag span { background:rgba(14,15,24,.78); backdrop-filter:blur(6px); padding:2px 9px; border-radius:99px; font-size:11.5px; white-space:nowrap }
|
|
238
239
|
.tag span { color:#e3e6f0; font-size:10.5px; overflow:hidden; text-overflow:ellipsis; min-width:0 }
|
|
240
|
+
#t-main .tag b { min-width:0; overflow:hidden; text-overflow:ellipsis } #t-main .tag b + span { flex-shrink:0 } /* a long name for the lead (⚙ → Lead agent name) is cut, not its Lead badge */
|
|
239
241
|
.status { position:absolute; top:6px; right:6px; font-size:11.5px; font-weight:600; padding:2px 9px; border-radius:99px; background:rgba(14,15,24,.8); backdrop-filter:blur(6px) }
|
|
240
242
|
#stage .tile .status { white-space:normal; overflow-wrap:anywhere; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; line-height:1.3; border-radius:10px } #stage .tile .status:empty { display:none } /* what a tile is doing: two lines before it is cut */
|
|
241
243
|
.status.working { color:var(--gold) } .status.done { color:var(--ok) } .status.turn { color:#0b1020; background:var(--accent) }
|
|
@@ -300,7 +302,8 @@
|
|
|
300
302
|
.coffee-btn { color:#ffd24a !important; background:rgba(255,210,74,.12); box-shadow:inset 0 0 0 1px rgba(255,210,74,.35) } .coffee-btn:hover { background:rgba(255,210,74,.22) !important }
|
|
301
303
|
.glink { color:var(--dim); font-size:12.5px; text-decoration:underline; text-underline-offset:3px } .glink:hover { color:#ffd24a }
|
|
302
304
|
#mCoffee { background:rgba(255,210,74,.10); box-shadow:inset 0 0 0 1px rgba(255,210,74,.3); margin-top:4px } #mCoffee:hover { background:rgba(255,210,74,.2) }
|
|
303
|
-
#menuQ, #logQ { background:var(--bg); color:var(--text); border:1px solid var(--line); border-radius:8px; padding:6px 9px; font:inherit; font-size:12.5px; outline:none } #menuQ:focus, #logQ:focus { border-color:var(--accent) }
|
|
305
|
+
#menuQ, #logQ, #leadName, #projectLeadName { background:var(--bg); color:var(--text); border:1px solid var(--line); border-radius:8px; padding:6px 9px; font:inherit; font-size:12.5px; outline:none } #menuQ:focus, #logQ:focus, #leadName:focus, #projectLeadName:focus { border-color:var(--accent) } #leadName, #projectLeadName { width:100%; margin:2px 0 6px } #leadName:disabled, #projectLeadName:disabled { opacity:.6 } #leadHint, #projectLeadHint, #subNamesHint { overflow-wrap:anywhere; font-size:11.5px; margin:-2px 0 6px }
|
|
306
|
+
#subNames { width:100%; min-height:54px; margin:2px 0 6px; resize:vertical; background:var(--bg); color:var(--text); border:1px solid var(--line); border-radius:8px; padding:6px 9px; font:inherit; font-size:12.5px; outline:none } #subNames:focus { border-color:var(--accent) } #subFill { font-size:11.5px; padding:3px 9px; margin:0 0 6px }
|
|
304
307
|
#switcher { position:fixed; inset:0; z-index:20; background:rgba(5,6,12,.7); display:flex; align-items:flex-start; justify-content:center; padding-top:12vh } #switcher .sbox { width:min(560px,92vw); background:var(--panel); border:1px solid var(--line); border-radius:14px; box-shadow:0 20px 60px rgba(0,0,0,.6); overflow:hidden }
|
|
305
308
|
#swq { width:100%; border:0; border-bottom:1px solid var(--line); background:transparent; color:var(--text); font:inherit; font-size:15px; padding:14px 16px; outline:none } #swl { max-height:50vh; overflow:auto } .swr { display:grid; grid-template-columns:auto 1fr; gap:2px 10px; padding:9px 14px; cursor:pointer; align-items:center } .swr.on, .swr:hover { background:var(--panel2) } .swr b { font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap } .swr i { grid-column:2; font-style:normal; font-size:11px; color:var(--dim) }
|
|
306
309
|
#sps { display:none; gap:2px; flex:none } body.replay #sps { display:inline-flex } #sps button { background:var(--panel2); color:var(--dim); border:1px solid var(--line); border-radius:6px; padding:1px 6px; font:inherit; font-size:11px; cursor:pointer } #sps button.on { color:var(--text); border-color:var(--accent) }
|
|
@@ -400,7 +403,7 @@
|
|
|
400
403
|
<div class="box" id="menuShop"></div>
|
|
401
404
|
<h4 data-fr="Source" data-en="Source">Source</h4>
|
|
402
405
|
<div class="box"><div class="seg" style="width:100%" id="modeSeg"><button data-m="live" style="flex:1" data-fr="Live" data-en="Live">Live</button><button data-m="replay" style="flex:1" data-fr="Replay" data-en="Replay">Replay</button><button data-m="demo" style="flex:1" data-fr="Démo" data-en="Demo">Demo</button></div>
|
|
403
|
-
<
|
|
406
|
+
<label id="liveProjBox" style="display:none;margin-top:6px"><span class="dim" style="display:block;font-size:11.5px;margin:0 0 3px 2px" data-fr="Projet à suivre" data-en="Project to follow">Projet à suivre</span><select id="liveProj" style="width:100%" title="Project to follow"></select></label>
|
|
404
407
|
<select id="sessions" style="display:none"></select></div>
|
|
405
408
|
<h4 data-fr="Plus" data-en="More">Plus</h4>
|
|
406
409
|
<button class="mi" id="mPrefs"><span data-fr="⚙ Tous les réglages (affichage, alertes…)" data-en="⚙ All settings (display, alerts…)">⚙ Tous les réglages (affichage, alertes…)</span><span class="dim" aria-hidden="true">›</span></button>
|
|
@@ -434,6 +437,9 @@
|
|
|
434
437
|
<button class="mi" data-t="notify"><span data-fr="Me prévenir quand les agents ont fini" data-en="Notify me when agents finish">Me prévenir quand les agents ont fini</span><i class="sw"></i></button>
|
|
435
438
|
<h4 data-fr="Personnages" data-en="Characters">Personnages</h4>
|
|
436
439
|
<button class="mi" data-t="customLaptop"><span data-fr="Ordinateur devant vos personnages" data-en="Laptop in front of your own characters">Ordinateur devant vos personnages</span><i class="sw"></i></button>
|
|
440
|
+
<div class="box" id="leadBox"><div class="lbl"><span data-fr="Nom de l’agent principal" data-en="Lead agent name">Nom de l’agent principal</span></div><input id="leadName" type="text" maxlength="48" placeholder="Margot" autocomplete="off" spellcheck="false" aria-label="Lead agent name"><div class="dim" id="leadHint" style="display:none"></div></div>
|
|
441
|
+
<div class="box" id="projectLeadBox"><label class="lbl" for="projectLeadName" data-fr="Nom pour ce projet" data-en="Name for this project">Nom pour ce projet</label><input id="projectLeadName" type="text" maxlength="48" autocomplete="off" spellcheck="false" aria-describedby="projectLeadHint"><div class="dim" id="projectLeadHint"></div></div>
|
|
442
|
+
<div class="box" id="subNamesBox"><label class="lbl" for="subNames" data-fr="Noms des sous-agents" data-en="Sub-agent names">Noms des sous-agents</label><textarea id="subNames" rows="2" maxlength="2000" autocomplete="off" spellcheck="false" aria-describedby="subNamesHint"></textarea><button class="btn" id="subFill" type="button" style="display:none" data-fr="Partir des noms de l’appel" data-en="Start from the names in the call">Partir des noms de l’appel</button><div class="dim" id="subNamesHint"></div></div>
|
|
437
443
|
<button class="mi" data-t="ownNames"><span data-fr="Garder les noms de mes agents" data-en="Keep my agents’ own names">Garder les noms de mes agents</span><i class="sw"></i></button>
|
|
438
444
|
</div><div class="pcol">
|
|
439
445
|
<h4 data-fr="Affichage" data-en="Display">Affichage</h4>
|
|
@@ -465,7 +471,7 @@
|
|
|
465
471
|
<div id="toasts" role="status" aria-live="polite"><div class="toast offer" id="vOffer" style="display:none"><span id="vOfferT"></span><button class="btn" id="vOfferB"></button><button class="ic" id="vOfferX" aria-label="Close">✕</button></div><div class="toast offer" id="packNote" style="display:none"><img id="packNoteI" src="pack-halloween.jpg" alt="" width="48" height="36"><span id="packNoteT"></span><button class="btn" id="packNoteB"></button><button class="ic" id="packNoteX" aria-label="Close">✕</button></div><div class="toast offer" id="trNote" style="display:none"><span id="trNoteT"></span><button class="btn" id="trNoteOk"></button><button class="btn" id="trNoteOff"></button></div></div><div id="visit" role="status" aria-live="polite"></div><div id="askc" role="region" aria-live="polite"></div>
|
|
466
472
|
<div id="empty"><h2 id="eT"></h2><p id="eP"></p><div id="eMiss"></div><button class="cta" id="eDemo"></button></div>
|
|
467
473
|
<div id="gate"><button class="cta" id="gB"></button></div>
|
|
468
|
-
<div id="detail"><div class="hd"><b id="dname"></b><button class="ic" id="dclose">✕</button></div><div id="dbody"></div></div>
|
|
474
|
+
<div id="detail"><div class="hd"><b id="dname"></b><button class="ic" id="dren" type="button">✎</button><button class="ic" id="dclose">✕</button></div><div id="dbody"></div></div>
|
|
469
475
|
</section>
|
|
470
476
|
<aside><h2 id="logH" data-fr="Transcription" data-en="Transcript">Transcript</h2><input id="logQ" type="search" placeholder="Search…" aria-label="Search the transcript" style="margin:8px 10px;width:calc(100% - 20px)"><div id="log"></div></aside>
|
|
471
477
|
</main>
|
|
@@ -506,8 +512,10 @@ const APP = window.AS_APP && typeof window.AS_APP === 'object' && typeof window.
|
|
|
506
512
|
|
|
507
513
|
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 };
|
|
508
514
|
const PREF_DEFAULTS = { ...prefs }; // for ⚙ → All settings → Reset to defaults
|
|
515
|
+
let leadProject = null; // the project of the loaded live call or replay, supplied by the server before naming its agents
|
|
516
|
+
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
|
|
509
517
|
{ let loc = {}; try { loc = JSON.parse(localStorage.getItem('cc.prefs') || '{}') || {}; } catch {} // the settings file (shared by every window) and this origin's copy: the more recent one wins
|
|
510
|
-
const sv = window.SAVED_PREFS && typeof window.SAVED_PREFS === 'object' ? window.SAVED_PREFS : {}; const won = (sv._t || 0)
|
|
518
|
+
const sv = window.SAVED_PREFS && typeof window.SAVED_PREFS === 'object' ? window.SAVED_PREFS : {}; prefsBase = JSON.parse(JSON.stringify(sv)); const won = (sv._t || 0) >= (loc._t || 0) && Object.keys(sv).length ? sv : loc; Object.assign(prefs, won); delete prefs._patch; /* a tie: this window saved last, and the file holds that save merged with what the other windows changed */ if (Object.keys(won).length && !('roster' in won)) prefs.roster = true; /* settings saved before the list could be turned off: it stays as they had it, on */
|
|
511
519
|
if ((+sv.shareUsageT || 0) > (+prefs.shareUsageT || 0)) { prefs.shareUsage = sv.shareUsage; prefs.shareUsageT = sv.shareUsageT; prefs.usageAsked = sv.usageAsked; } } // the usage answer: the newest one, as the server keeps it (this origin's copy may hold an older one)
|
|
512
520
|
const HAD_PREFS = !!prefs._t; // someone who used the app before this page: shown once where the settings went
|
|
513
521
|
if (!HAD_PREFS) prefs.menuTipSeen = true; // a first visit: the menu was never anywhere else for this person, so the tip is not shown on the next visits either
|
|
@@ -522,7 +530,9 @@ let prefsTimer = null;
|
|
|
522
530
|
let shareWas = prefs.shareUsage, updWas = prefs.updateNotice; // the usage answer as last saved: when it changes, savePrefs dates it, and the server keeps the newest (another page may write older settings)
|
|
523
531
|
let langKeep = null; // ?lang=xx shows the page in that language for this visit only: the saved language stays the one the person chose
|
|
524
532
|
const prefsOut = () => JSON.stringify(langKeep == null ? prefs : { ...prefs, lang: langKeep });
|
|
525
|
-
const
|
|
533
|
+
const prefsPatch = () => { const now = JSON.parse(prefsOut()), set = {}, del = []; for (const k in now) if (JSON.stringify(now[k]) !== JSON.stringify(prefsBase[k])) set[k] = now[k]; for (const k in prefsBase) if (!(k in now)) del.push(k); prefsBase = now; return JSON.stringify({ ...now, _patch: { set, del } }); }; // what changed (the server merges it into the file), with the whole settings beside it for a server from before 1.42, which writes them as it always did
|
|
534
|
+
const putPrefs = () => { const prev = prefsBase; return fetch('/api/prefs', { method: 'PUT', headers: { 'content-type': 'application/json' }, body: prefsPatch() }).then((r) => { if (!r.ok) throw new Error(r.status); return r; }).catch((e) => { prefsBase = prev; throw e; }); }; // not saved: the next save sends these changes again, and only these
|
|
535
|
+
const savePrefs = () => { prefs._t = Date.now(); if (prefs.shareUsage !== shareWas) { shareWas = prefs.shareUsage; prefs.shareUsageT = Date.now(); } if (prefs.updateNotice !== updWas) { updWas = prefs.updateNotice; prefs.updateNoticeT = Date.now(); } try { localStorage.setItem('cc.prefs', prefsOut()); } catch {} clearTimeout(prefsTimer); prefsTimer = setTimeout(() => { putPrefs().catch(() => {}); }, 400); };
|
|
526
536
|
// Languages: French and English live in the code as pairs L(french, english); every other language is a catalogue public/locales/<code>.json mapping the English text to its translation.
|
|
527
537
|
// A missing string falls back to English, so a half-translated language still works. See public/locales/README.md to add one.
|
|
528
538
|
const LANGS = [['en', 'English', 'en'], ['fr', 'Français', 'fr'], ['zh-TW', '繁體中文', 'zh-Hant-TW'], ['zh-CN', '简体中文', 'zh-Hans-CN'], ['es', 'Español', 'es'], ['de', 'Deutsch', 'de'], ['da', 'Dansk', 'da'], ['pt-BR', 'Português (Brasil)', 'pt-BR'], ['ja', '日本語', 'ja'], ['ko', '한국어', 'ko']];
|
|
@@ -564,10 +574,21 @@ async function setLang(code, save) {
|
|
|
564
574
|
// =====================================================================
|
|
565
575
|
const NAMES = ['Ada','Linus','Grace','Alan','Margaret','Dennis','Barbara','Ken','Radia','Tim','Hedy','Guido','Frances','Bjarne','Katherine','Brian','Sophie','Niklaus','Annie','Donald','Joan','Edsger','Lynn','Vint','Mae','Rob','Zoe','Ivan','Nina','Otto','Lena','Hugo','Ines','Théo','Maya','Jules','Alma','Remy','Cleo','Noah','Iris','Leo','Mira','Axel','Nora','Eli','Lou','Gaby'];
|
|
566
576
|
const nameBook = {}; // agent id → unique first name within the session
|
|
577
|
+
// The lead's name: Margot, the global default, the current project override, or the name in the editor (agentStandup.leadName, which wins: AS_APP.lead, see appKind in server.js). Plain text of 24 characters at most: it is written into the page in many places.
|
|
578
|
+
// typeof: the landing page reuses this section and has neither prefs nor APP
|
|
579
|
+
const LEAD_NAME = 'Margot', cleanLead = (v) => Array.from(String(v == null ? '' : v).replace(/'/g, '’').replace(/[\u0000-\u001f\u007f-\u009f<>&"`\\]/g, '').replace(/\s+/g, ' ').trim()).slice(0, 24).join('').trim();
|
|
580
|
+
// One top-level preference per project: the existing prefsPatch merges independent window edits without replacing a shared map.
|
|
581
|
+
const projectLeadKey = () => typeof leadProject === 'object' && leadProject ? 'leadName:' + leadProject.key : '';
|
|
582
|
+
const leadName = () => (typeof APP === 'object' && APP && cleanLead(APP.lead)) || (typeof prefs === 'object' && prefs && (cleanLead(prefs[projectLeadKey()]) || cleanLead(prefs.leadName))) || LEAD_NAME;
|
|
583
|
+
const isLeadName = (n) => { const l = leadName().toLocaleLowerCase(), s = String(n || '').toLocaleLowerCase(); return !!n && (s === l || (s.startsWith(l + ' ') && /^\d+$/.test(s.slice(l.length + 1)))); }; // whatever the capitals: Ivan and ivan would read as one agent, and Ivan 2 as a fork of the lead
|
|
584
|
+
// Your own names for the sub-agents (⚙ → All settings → Sub-agent names, prefs.subNames: names separated by commas), given in your order instead of the built-in list. Parsed again only when the text changes
|
|
585
|
+
let subListMemo = { text: null, list: [] };
|
|
586
|
+
const subNameList = () => { const t = typeof prefs === 'object' && prefs && typeof prefs.subNames === 'string' ? prefs.subNames : ''; if (t !== subListMemo.text) { const seen = new Set(), list = []; for (const v of t.split(/[,;\n]+/)) { const n = cleanLead(v), k = n.toLocaleLowerCase(); if (n && !seen.has(k) && list.length < 200) { seen.add(k); list.push(n); } } subListMemo = { text: t, list }; } return subListMemo.list; };
|
|
567
587
|
function uniqueName(id, h) {
|
|
568
|
-
if (nameBook[id]) return nameBook[id]; const taken = new Set(Object.values(nameBook));
|
|
569
|
-
|
|
570
|
-
|
|
588
|
+
if (nameBook[id]) return nameBook[id]; const taken = new Set(Object.values(nameBook).map((n) => n.toLocaleLowerCase())); taken.add(leadName().toLocaleLowerCase()); // never the lead's own name: one may be chosen from this list
|
|
589
|
+
const own = subNameList().filter((n) => !isLeadName(n)), pool = own.length ? own : NAMES, at = own.length ? 0 : h; // your list: its names in your order; the built-in one: a name drawn from the agent's id
|
|
590
|
+
for (let k = 0; k < pool.length; k++) { const n = pool[(at + k) % pool.length]; if (!taken.has(n.toLocaleLowerCase())) return (nameBook[id] = n); }
|
|
591
|
+
for (let r = 2; ; r++) for (let k = 0; k < pool.length; k++) { const b = pool[(at + k) % pool.length]; if (isLeadName(b)) continue; const n = b + ' ' + r; if (!taken.has(n.toLocaleLowerCase())) return (nameBook[id] = n); } // every name taken: Ada 2, Linus 2… then Ada 3, never after the lead's name ("Ivan 2" would read as a fork of a lead called Ivan); the pool always holds a name that is not the lead's
|
|
571
592
|
}
|
|
572
593
|
const PAL = ['#ff7a6b','#ffb347','#ffd84a','#4fd1a5','#4cc3ff','#7c8cff','#b583ff','#ff7eb6'];
|
|
573
594
|
const hexRGB = (h) => [1, 3, 5].map((i) => parseInt(h.slice(i, i + 2), 16));
|
|
@@ -693,25 +714,31 @@ function renderFolder(el, mine) { // one's own pictures: where they are, a but
|
|
|
693
714
|
el.querySelectorAll('[data-rm]').forEach((b) => (b.onclick = async () => { await post('/api/characters/remove', { file: b.dataset.rm }); await reloadChars(); }));
|
|
694
715
|
$('#charReload').onclick = () => reloadChars(); if ($('#charOpen')) $('#charOpen').onclick = () => window.parent.postMessage({ agentStandup: 'openCharacters' }, '*');
|
|
695
716
|
}
|
|
696
|
-
function packNote() { // the Halloween pack, to someone without it, twice a season at most: one line in October (the vampire's before the 19th, to the vampire only; from the 19th, to everyone), one on the 30th or 31st if the first was
|
|
717
|
+
function packNote() { // the Halloween pack, to someone without it, twice a season at most: one line in October (the vampire's before the 19th, to the vampire only; from the 19th, to everyone), one on the 30th or 31st if the first was 3 days before or more. Never on a first day, nor the first day the usage question shows (usagePending); shown, it stays until ✕ or the button, also after a reload that day
|
|
697
718
|
const d = new Date(), m = d.getMonth(), dd = d.getDate(), phase = dd >= 30 ? 2 : 1, seen = +prefs.packSeen || (prefs.vampSeen ? 1 : 0), el = $('#packNote'); if (!el) return; // vampSeen: the vampire's line, closed in 1.33 to 1.38, counts as the first
|
|
698
|
-
const early = dd < 19 && CHARS.youFrom !== 'vampire', open = prefs.packOpen && prefs.packDay === utcDay(), due = !early && seen < phase && !askedToday('pack') && !firstDay() && !(usagePending() && (!prefs.usageDay || prefs.usageDay >= utcDay())) && $('#usageTip').style.display === 'none' && (!prefs.packDay || Date.parse(utcDay()) - Date.parse(prefs.packDay) >=
|
|
719
|
+
const early = dd < 19 && CHARS.youFrom !== 'vampire', open = prefs.packOpen && prefs.packDay === utcDay(), due = !early && seen < phase && !askedToday('pack') && !firstDay() && !(usagePending() && (!prefs.usageDay || prefs.usageDay >= utcDay())) && $('#usageTip').style.display === 'none' && (!prefs.packDay || Date.parse(utcDay()) - Date.parse(prefs.packDay) >= 3 * 864e5);
|
|
699
720
|
const on = m === 9 && (open || due) && !Q.get('demo') && !(SHOP.halloween && SHOP.halloween.n) && !voiceOffer.busy; el.style.display = on ? '' : 'none'; if (!on) return; // busy: the voices are downloading, and their line says so
|
|
700
721
|
if (due && !open) { prefs.packSeen = phase; prefs.packDay = utcDay(); prefs.packOpen = true; savePrefs(); } noteAsk('pack'); $('#vOffer').style.display = 'none'; // one offer at a time: the voices' line comes back when this one is closed
|
|
701
722
|
const price = (SHOP.halloween && SHOP.halloween.price) || '2 €';
|
|
702
|
-
$('#packNoteT').textContent = dd === 31 ? L('Joyeux Halloween ! Vos agents
|
|
723
|
+
$('#packNoteT').textContent = dd === 31 ? L('Joyeux Halloween ! Vos agents ont sorti les citrouilles. Les costumes complets sont dans le pack, dessinés à la main.', 'Happy Halloween! Your agents brought pumpkins. The full costumes are in the pack, drawn by hand.') : dd === 30 ? L('Halloween, c’est demain : vos agents ont sorti les citrouilles. Les costumes complets sont dans le pack, dessinés à la main.', 'Halloween is tomorrow: your agents brought pumpkins. The full costumes are in the pack, drawn by hand.')
|
|
703
724
|
: dd >= 19 ? L('Halloween approche : déguisez vos agents en citrouille, fantôme, sorcière ou squelette, dessinés à la main par Fabien Coupas.', 'Halloween is coming: dress your agents up as a pumpkin, a ghost, a witch or a skeleton, drawn by hand by Fabien Coupas.') : L('Pour Halloween, vous êtes le vampire. Le reste de l’équipe est dans le pack Halloween.', 'This Halloween, you are the vampire. The rest of the cast is in the Halloween pack.');
|
|
704
725
|
$('#packNoteB').textContent = L('Voir le pack', 'See the pack') + ' · ' + price;
|
|
705
726
|
}
|
|
706
727
|
function persona(a) { const p = persona0(a); p.custom = customFor(p.twin ? 'main' : a.id); return p; } // a fork wears the lead's own picture too
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
728
|
+
// The order agents are named in: the order they started (born, from the server), not the order their files are listed in (by their ids: effectively random). A reload, a replay and the live call then give each agent
|
|
729
|
+
// the same name, a first name of your list the same agent, and a fork the same number. Without born (the demo, a session just started), the order they came in
|
|
730
|
+
const byBorn = (list) => list.map((a, j) => ({ a, j })).sort((x, y) => (x.a.born || Infinity) - (y.a.born || Infinity) || x.j - y.j).map((x) => x.a);
|
|
731
|
+
const ownFree = (a) => { const taken = new Set(Object.keys(nameBook).filter((k) => k !== a.id).map((k) => nameBook[k].toLocaleLowerCase())); let n = a.own; for (let r = 2; taken.has(n.toLocaleLowerCase()); r++) n = a.own + ' ' + r; return n; }; // a name of its own that another agent has already (a first name of your list, or the same name from another tool): a number after it
|
|
732
|
+
const subName = (a, h) => (/^visit:/.test(a.id || '') ? (isLeadName(a.given) ? NAMES[(h + 1) % NAMES.length] : a.given) : a.own && prefs.ownNames && !isLeadName(a.own) ? (nameBook[a.id] = ownFree(a)) : ((a.twinN || (!isLeadName(a.given) && !subNameList().length)) && a.given) || uniqueName(a.id, h)); /* a visitor from another session keeps its built-in name and takes none of the call's names; a fork is the one agent named after the lead; with your own list, the names a tool gave (Codex's nicknames, the demo's) give way to it */ // own: the name the person gave this agent (see ownName in server.js); otherwise a first name from the list. a.own is tested first: the landing page reuses this section and has no settings
|
|
733
|
+
function renameAll(lead) { // ⚙ → own names on or off, or a new name for the lead: every sub-agent is named again, in the order it arrived, as a reload would name them
|
|
734
|
+
const names = () => Object.values(S.agents).map((p) => p.name).join('\n'), was = names();
|
|
735
|
+
if (lead) for (const p of Object.values(S.agents)) if (p.id === 'main' || p.twinN) { const q = persona(p); p.name = q.name; p.given = q.given; } // the lead and its forks first: the others then keep clear of the lead's name
|
|
736
|
+
for (const k in nameBook) delete nameBook[k]; for (const p of byBorn(Object.values(S.agents))) if (p.id !== 'main' && p.id !== 'user') p.name = p.twinN && !(p.own && prefs.ownNames && !isLeadName(p.own)) ? p.given : subName(p, hash(p.id)); // a fork is the lead's twin unless it has a name of its own to keep
|
|
737
|
+
if (!lead || names() !== was) { buildStage(); renderTokens(); renderCtx(); paintStatus(); renderLog(true); syncUI(); } // the new tiles get their tokens and context at once, not at the next usage
|
|
711
738
|
}
|
|
712
739
|
function persona0(a) {
|
|
713
|
-
const h = hash(a.id), base = { ...a, given: 'given' in a ? a.given : a.name };
|
|
714
|
-
if (a.id === 'main') return { ...base, name:
|
|
740
|
+
const h = hash(a.id), base = { ...a, given: a.twinN ? leadName() + ' ' + a.twinN : 'given' in a ? a.given : a.name }; // twinN: a fork, named after the lead whatever the lead is called now
|
|
741
|
+
if (a.id === 'main') return { ...base, name: leadName(), role: L('Chef', 'Lead'), shirt: '#e8845f', shape: 0, acc: 1, eye: 0, glasses: false, scene: 6, prop: 1, acc2: '#f5c04a', lead: true, vi: 0, gid: 'main' };
|
|
715
742
|
if (a.id === 'user') return { ...base, name: L('Vous', 'You'), role: L('Humain', 'Human'), shirt: '#8a94c9', shape: 1, acc: 2, eye: 1, glasses: false, scene: 7, prop: 1, acc2: '#ff7a6b', vi: 3, gid: 'user' };
|
|
716
743
|
if (/^fork$/i.test(a.type || '')) return { ...base, name: subName(base, h), roleEn: a.roleEn || a.role, role: (FR() && a.roleFr) || a.roleEn || a.role, shirt: '#e8845f', shape: 0, acc: 1, eye: 0, glasses: true, scene: (h >>> 18) % 6, prop: 1, acc2: '#f5c04a', vi: 0, twin: true, gid: h.toString(36) }; // a fork (Claude Code's subagent_type "fork", on by default since 2.1.302) starts as a copy of the lead: the lead's face, shirt and voice, glasses and a room of its own to tell them apart
|
|
717
744
|
return { ...base, name: subName(base, h), roleEn: a.roleEn || a.role, role: (FR() && a.roleFr) || a.roleEn || a.role, shirt: PAL[(h >>> 6) % 8], shape: (h >>> 3) % 5, acc: (h >>> 9) % 6, eye: (h >>> 12) % 3, glasses: ((h >>> 15) % 4) === 0,
|
|
@@ -777,6 +804,8 @@ const ACC = [
|
|
|
777
804
|
(t, c) => `<g transform="translate(60 ${t + 3}) rotate(14)"><path d="M0 0L-9-5V5z" fill="${c}"/><path d="M0 0L9-5V5z" fill="${c}"/><circle r="2.6" fill="${mix(c, '#000000', .18)}"/></g>`,
|
|
778
805
|
(t, c) => `<path d="M44 ${t + 2}L40 ${t - 8}M56 ${t + 2}L60 ${t - 8}" stroke="#2c2f40" stroke-width="1.2" stroke-linecap="round"/><circle cx="40" cy="${t - 9}" r="2.4" fill="${c}"/><circle cx="60" cy="${t - 9}" r="2.4" fill="${c}"/>`,
|
|
779
806
|
];
|
|
807
|
+
const pumpkinDay = () => { const d = new Date(); return d.getMonth() === 9 && d.getDate() >= 30; }; // Halloween and its eve: the drawn characters bring a pumpkin (mine, not the pack's art)
|
|
808
|
+
const pumpkin = (x) => `<g class="pumpkin"><ellipse cx="${x}" cy="58.3" rx="6.2" ry="4.4" fill="#f28c28"/><path d="M${x - 2.3} 54.2q-1.7 4.1 0 8.3M${x + 2.3} 54.2q1.7 4.1 0 8.3" fill="none" stroke="#c8650f" stroke-width=".7"/><path d="M${x} 54.3q.2-2 1.7-2.7" fill="none" stroke="#4f8a3a" stroke-width="1.3" stroke-linecap="round"/><path d="M${x - 3.5} 57.7l1.3-2 1.3 2zM${x + .9} 57.7l1.3-2 1.3 2z" fill="#ffd84a"/><path d="M${x - 3.3} 59.5q3.3 2.5 6.6 0l-1 1.5-1.1-.8-1.1.9-1.1-.9-1.1.8z" fill="#ffd84a"/></g>`;
|
|
780
809
|
function avatarSVG(p, o, uid = '') { // uid keeps SVG ids unique per instance: duplicate ids made gradients vanish when the first copy was in a hidden element
|
|
781
810
|
const st = !!o, sh = SHAPES[p.shape], fy = sh.fy, top = sh.top, bot = p.shape === 4, c = p.shirt, c1 = mix(c, '#ffffff', .3), c2 = mix(c, '#000000', .2);
|
|
782
811
|
const ink = bot ? '#8ff0ff' : '#2a2233', gid = uid + 'b' + p.gid, sc = SCENES[p.scene], eg = EYES[p.eye], ex = p.shape === 1 ? [43, 57] : [41.5, 58.5];
|
|
@@ -796,7 +825,7 @@ function avatarSVG(p, o, uid = '') { // uid keeps SVG ids unique per instance:
|
|
|
796
825
|
const arm = (side) => `<g class="arm ${side}"><ellipse cx="${side === 'l' ? 25 : 75}" cy="56" rx="4.6" ry="9" fill="${c2}" transform="rotate(${side === 'l' ? 12 : -12} ${side === 'l' ? 25 : 75} 56)"/></g>`;
|
|
797
826
|
const prop = [`<path d="M11 62.4l1.6-7.4h7.2l1.6 7.4z" fill="#e07a5f"/><path d="M16 55q-6-8-2-12q5 4 2 12z" fill="#3fbf7f"/><path d="M16 55q6-7 10-5q-1 6-10 5z" fill="#53c98a"/>`,
|
|
798
827
|
`<rect x="79" y="55.6" width="7.4" height="6.8" rx="1.6" fill="#f6f2ea"/><path d="M86.2 57q3.2 0 3.2 2.2t-3.2 2.2" fill="none" stroke="#f6f2ea" stroke-width="1.3"/><g class="steam" fill="none" stroke="#fff" stroke-width=".8" stroke-linecap="round" opacity=".7"><path d="M81.5 53q-1.4-1.8 0-3.4M84.3 53q-1.4-1.8 0-3.4"/></g>`,
|
|
799
|
-
`<rect x="76" y="58.2" width="14" height="4.2" rx="1" fill="#ff7a6b"/><rect x="77.5" y="54.4" width="12" height="3.8" rx="1" fill="#4cc3ff"/><rect x="76.5" y="50.8" width="11" height="3.6" rx="1" fill="#ffd84a"/>`][p.prop];
|
|
828
|
+
`<rect x="76" y="58.2" width="14" height="4.2" rx="1" fill="#ff7a6b"/><rect x="77.5" y="54.4" width="12" height="3.8" rx="1" fill="#4cc3ff"/><rect x="76.5" y="50.8" width="11" height="3.6" rx="1" fill="#ffd84a"/>`][p.prop] + (pumpkinDay() ? pumpkin(p.prop === 0 ? 83 : 17) : ''); /* on the 30th and 31st of October, a carved pumpkin on the other side of the desk */
|
|
800
829
|
const lap = `<rect x="33" y="46" width="34" height="18" rx="2.8" fill="#d3d8e6"/><rect x="33" y="46" width="34" height="18" rx="2.8" fill="url(#${uid}lg)" opacity=".5"/><circle cx="50" cy="55" r="2.3" fill="${c1}"/><rect x="29.5" y="63.4" width="41" height="3" rx="1.5" fill="#aab1c2"/>`;
|
|
801
830
|
const lapDark = `<rect x="33" y="46" width="34" height="18" rx="2.8" fill="#3b4152"/><rect x="33" y="46" width="34" height="18" rx="2.8" fill="url(#${uid}lg)" opacity=".18"/><circle cx="50" cy="55" r="2.3" fill="${c1}"/><rect x="29.5" y="63.4" width="41" height="3" rx="1.5" fill="#262a36"/>`; // for custom characters: darker, so it still shows under a white or cream sprite
|
|
802
831
|
const hands = `<circle class="hand l" cx="38" cy="65.6" r="3.1" fill="${c2}"/><circle class="hand r" cx="62" cy="65.6" r="3.1" fill="${c2}"/>`;
|
|
@@ -847,7 +876,7 @@ const caughtUp = () => !S.live || lagMs() < 6000;
|
|
|
847
876
|
const nearLive = () => !S.live || lagMs() < 30000; // an answer to what was just said (a word after an order, a thank-you after a report) still fits here: reading the line took longer than 6 s and the session went on meanwhile
|
|
848
877
|
const spd = () => (S.live ? 1.12 * lagFactor() : +$('#speed').value) * (S.boost || 1);
|
|
849
878
|
const nameOf = (id) => (S.agents[id] || {}).name || id;
|
|
850
|
-
const twinOf = (a) => (/^fork$/i.test(a.type || '') && !('given' in a) && !(a.own && prefs.ownNames) ? { ...a,
|
|
879
|
+
const twinOf = (a) => (/^fork$/i.test(a.type || '') && !('given' in a) && !(a.own && prefs.ownNames) ? { ...a, twinN: 2 + Object.values(S.agents).filter((p) => p.twin).length } : a); // a fork is named after the lead: Margot 2, Margot 3… (persona0 writes the name from twinN)
|
|
851
880
|
|
|
852
881
|
// ---------- text prep ----------
|
|
853
882
|
const plain = (t) => String(t).replace(/```[\s\S]*?```/g, ' ').replace(/`([^`]*)`/g, '$1').replace(/https?:\/\/\S+/g, 'link').replace(/[#*_>|~\[\]]/g, ' ').replace(/\s+/g, ' ').trim();
|
|
@@ -1307,7 +1336,7 @@ async function speakLine(text, p, primary, token, lo = voiceLang(text), always =
|
|
|
1307
1336
|
// rendering
|
|
1308
1337
|
// =====================================================================
|
|
1309
1338
|
function addTile(p) {
|
|
1310
|
-
const d = document.createElement('div'); d.className = 'tile' + (p.lead ? ' lead' : ''); d.id = 't-' + p.id; d.tabIndex = 0; d.setAttribute('role', 'button'); d.setAttribute('aria-label', p.name + ' — ' + p.role); d.onkeydown = (e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); openDetail(p.id); } }; d.style.display = 'none'; d.onclick = () => openDetail(p.id);
|
|
1339
|
+
const d = document.createElement('div'); d.className = 'tile' + (p.lead ? ' lead' : ''); d.id = 't-' + p.id; d.tabIndex = 0; d.setAttribute('role', 'button'); d.setAttribute('aria-label', p.name + ' — ' + p.role); d.onkeydown = (e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); openDetail(p.id); } }; d.style.display = 'none'; d.onclick = (e) => { const st = e.target.closest('.bubble') && !String(getSelection() || '') && agentState(p.id, Date.now()); if (st && st.k === 'blocked' && st.sure) answerAt(S.cur); else openDetail(p.id); }; /* its bubble while it asks you: the tab or terminal where the question or permission waits (answerAt), as the card does */
|
|
1311
1340
|
d.innerHTML = `${avatarSVG(p, undefined, 't' + p.gid + '_')}<div class="bubble"></div><div class="status"></div><div class="prop"></div><div class="thought"></div><div class="ticker"></div><div class="tbadge"></div><div class="tag"><b>${esc(p.name)}</b><span>${esc(p.role)}</span><span class="tk"></span><span class="cx"></span></div>`;
|
|
1312
1341
|
$('#stage').appendChild(d);
|
|
1313
1342
|
}
|
|
@@ -1605,10 +1634,10 @@ function paintRoster(ros) { // a fixed list beside the call: who is doing what
|
|
|
1605
1634
|
const rows = ros.slice(0, 60).map(({ p, st }) => `<div class="rr k-${st.k}${isTurn(p.id, st) ? ' turn' : ''}${st.gave || st.stop ? ' gave' : ''}${S.focus === p.id ? ' sel' : ''}${S.speakers.has(p.id) ? ' speaking' : ''}" data-id="${esc(p.id)}" tabindex="0" role="button" aria-label="${esc(p.name)}, ${esc(st.txt || '')}" title="${esc(p.name + ' — ' + p.role + leadTool(p) + (st.txt ? '\n' + st.txt : '') + (S.lastTool[p.id] ? '\n' + S.lastTool[p.id] : ''))}"><div class="n"><span class="dot" style="background:${p.shirt}"></span><b>${esc(p.name)}</b><span class="ro">${esc(p.role + leadTool(p))}</span>${rosTok(p.id)}</div><div class="st">${esc(st.txt || L('en veille', 'standing by'))}${S.loops[p.id] ? ' 🔁' : ''}${S.wst.items && S.wst.items[p.id] && S.wst.items[p.id].length ? ' ♻' + S.wst.items[p.id].length : ''}</div></div>`).join('');
|
|
1606
1635
|
const left = Object.values(S.agents).filter((p) => S.gone.has(p.id) && p.id !== 'main' && p.id !== 'user').sort((a, b) => (S.lastAct[b.id] || 0) - (S.lastAct[a.id] || 0)); // a finished agent's tile leaves the stage: its line stays here, with what it used
|
|
1607
1636
|
const gone = left.slice(0, 40).map((p) => `<div class="rr left" data-id="${esc(p.id)}" tabindex="0" role="button" aria-label="${esc(p.name)}"><div class="n"><span class="dot" style="background:${p.shirt}"></span><b>${esc(p.name)}</b><span class="ro">${esc(p.role)}</span>${rosTok(p.id)}</div></div>`).join('');
|
|
1608
|
-
const html = `<h3>${L('Agents', 'Agents')} · ${ros.length}
|
|
1637
|
+
const html = `<h3>${L('Agents', 'Agents')} · ${ros.length}<button class="rnm" type="button" title="${esc(L('Renommer les agents', 'Rename the agents'))}" aria-label="${esc(L('Renommer les agents', 'Rename the agents'))}">✎</button></h3>${rows}${ros.length > 60 ? `<div class="ro" style="padding:4px 8px">+${ros.length - 60}</div>` : ''}${left.length ? `<h3 style="margin-top:8px">${L('terminés', 'done')} · ${left.length}</h3>${gone}` : ''}`;
|
|
1609
1638
|
if (box.dataset.h !== html) { box.dataset.h = html; box.innerHTML = html; }
|
|
1610
1639
|
}
|
|
1611
|
-
$('#roster').onclick = (e) => { const r = e.target.closest('.rr'); if (!r) return; if (r.classList.contains('left')) { openDetail(r.dataset.id); return; } S.focusLock = Date.now() + 25000; setFocus(r.dataset.id); paintStates(); };
|
|
1640
|
+
$('#roster').onclick = (e) => { if (e.target.closest('.rnm')) return openPrefs($('#subNamesBox')); const r = e.target.closest('.rr'); if (!r) return; if (r.classList.contains('left')) { openDetail(r.dataset.id); return; } S.focusLock = Date.now() + 25000; setFocus(r.dataset.id); paintStates(); };
|
|
1612
1641
|
$('#roster').onkeydown = (e) => { const r = e.target.closest('.rr'); if (r && r.classList.contains('left') && (e.key === 'Enter' || e.key === ' ')) { e.preventDefault(); openDetail(r.dataset.id); } else if (r && (e.key === 'Enter' || e.key === ' ')) { e.preventDefault(); S.focusLock = Date.now() + 25000; setFocus(r.dataset.id); paintStates(); } else if (r && e.key === 'i') openDetail(r.dataset.id); };
|
|
1613
1642
|
$('#roster').ondblclick = (e) => { const r = e.target.closest('.rr'); if (r) openDetail(r.dataset.id); };
|
|
1614
1643
|
function renderBadges() { // per tile: failed tool calls, a command that has been running a long time, an agent that went quiet
|
|
@@ -2253,7 +2282,8 @@ $('#tree').onclick = (e) => {
|
|
|
2253
2282
|
|
|
2254
2283
|
// ---------- agent detail ----------
|
|
2255
2284
|
function openDetail(id) { const p = S.agents[id]; if (!p) return; S.detail = id; S.detailOpen = (S.detailOpen || 0) + 1; // detailOpen: the human's made-up day is drawn again at each opening, and stays put while the panel refreshes
|
|
2256
|
-
$('#dname').textContent = `${p.name} · ${p.role}`; renderDetail(); $('#detail').classList.add('on'); }
|
|
2285
|
+
$('#dname').textContent = `${p.name} · ${p.role}`; $('#dren').style.display = id === 'user' ? 'none' : ''; renderDetail(); $('#detail').classList.add('on'); }
|
|
2286
|
+
$('#dren').onclick = () => { const p = S.agents[S.detail]; if (!p || p.id === 'user') return; openPrefs(p.id !== 'main' && !p.twinN ? $('#subNamesBox') : projectLeadKey() && !cleanLead(APP.lead) ? $('#projectLeadBox') : $('#leadBox')); }; // ✎ beside an agent's name: where its name is chosen (the lead and its forks: the lead's name, for this project when there is one)
|
|
2257
2287
|
// ---------- the human's panel: nothing to do any more, and proud of it. Drawn at random each time it opens; English and French, the other languages get the English ----------
|
|
2258
2288
|
const IDLE = {
|
|
2259
2289
|
en: { tools: ['Coffee', 'Approve without reading', 'Refresh the pull request', '“Looks good to me”', 'Stretch', 'Check Slack', 'Rename one variable', 'Explain the plan to the cat', 'Open X “for research”', 'Sigh', 'Snack', 'Water the plant', 'Pretend to review', 'Update LinkedIn', 'Ctrl+C', 'Ctrl+V', 'Close 37 tabs'],
|
|
@@ -2272,6 +2302,7 @@ const IDLE = {
|
|
|
2272
2302
|
['✓', 'Écrit « s’il te plaît » dans un prompt', '1 s', 'au cas où', 'Rester poli avec nos futurs maîtres'], ['✗', 'Cherché quelque chose à faire', '9 min', 'le backlog', 'Le backlog est vide. Les agents l’ont vidé.']] },
|
|
2273
2303
|
};
|
|
2274
2304
|
const shuffle = (a) => { const b = [...a]; for (let i = b.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); [b[i], b[j]] = [b[j], b[i]]; } return b; };
|
|
2305
|
+
const costumeHtml = () => (CHARS.youFrom === 'vampire' && SHOP.halloween && !SHOP.halloween.n ? `<h3>${esc(L('Costume', 'Costume'))}</h3><div>${esc(L('Votre vampire vient du pack Halloween, dessiné à la main par Fabien Coupas. Le reste de l’équipe y est aussi.', 'Your vampire comes from the Halloween pack, drawn by hand by Fabien Coupas. The rest of the cast is in it too.'))}</div><button class="btn" data-hwpack style="margin:6px 0 2px">🎃 ${esc(L('Voir le pack', 'See the pack'))} · ${esc(SHOP.halloween.price || '2 €')}</button>` : ''); // in the panel you open on yourself: information, not an ask
|
|
2275
2306
|
function idleHtml() { // the human's Tools and Recent activity, made up: 5 to 7 tools, 6 to 8 moments
|
|
2276
2307
|
const I = FR() ? IDLE.fr : IDLE.en, tools = shuffle(I.tools).slice(0, 5 + Math.floor(Math.random() * 3)).map((n) => [n, 1 + Math.floor(Math.random() * (/Ctrl|Coffee|Café|Slack|Sigh|Soupirer/.test(n) ? 40 : 9))]);
|
|
2277
2308
|
return `<h3>${L('Outils', 'Tools')} (${tools.reduce((a, t) => a + t[1], 0)})</h3><div>${tools.map(([n, c]) => `${esc(n)} ×${c}`).join(' · ')}</div>` +
|
|
@@ -2283,9 +2314,10 @@ function renderDetail() {
|
|
|
2283
2314
|
const counts = {}; tools.forEach((t) => (counts[t.name] = (counts[t.name] || 0) + 1));
|
|
2284
2315
|
const u = S.usage[id], tokHtml = u && tokTotal(u) ? `<h3>${L('Jetons', 'Tokens')} · ⚡ ${fmtTok(tokTotal(u))}</h3><div class="dim">${L('entrée', 'input')} ${fmtTok(u.i)} · ${L('sortie', 'output')} ${fmtTok(u.o)} · ${L('écriture cache', 'cache write')} ${fmtTok(u.w)} · ${L('lecture cache', 'cache read')} ${fmtTok(u.r)}${modelShort(S.model[id]) ? ` · ${L('Modèle', 'Model')} ${esc(S.model[id])}${esc(effortOf(id))}${advisorOf(id) ? ' · ' + esc(advisorOf(id)) : ''}` : ''}</div>` : '';
|
|
2285
2316
|
$('#dbody').innerHTML = tokHtml + (order ? `<h3>${L('Consigne de', 'Prompt from')} ${esc(nameOf(order.agent))}</h3><pre>${esc(order.text)}</pre>` : '') +
|
|
2286
|
-
(id === 'user' ? (S.idleHtml = (S.idleFor === S.detailOpen && S.idleHtml) || idleHtml(), S.idleFor = S.detailOpen, S.idleHtml) : `<h3>${L('Outils', 'Tools')} (${tools.length})</h3><div>${Object.entries(counts).map(([n, c]) => `${esc(n)} ×${c}`).join(' · ') || '—'}</div>` +
|
|
2317
|
+
(id === 'user' ? costumeHtml() + (S.idleHtml = (S.idleFor === S.detailOpen && S.idleHtml) || idleHtml(), S.idleFor = S.detailOpen, S.idleHtml) : `<h3>${L('Outils', 'Tools')} (${tools.length})</h3><div>${Object.entries(counts).map(([n, c]) => `${esc(n)} ×${c}`).join(' · ') || '—'}</div>` +
|
|
2287
2318
|
`<h3>${L('Activité récente', 'Recent activity')}</h3>` + (S.term[id] || []).slice(-30).reverse().map((e) => `<details><summary>${e.end == null ? '⠋' : e.err ? '✗' : '✓'} ${esc(e.tool.name)} <span class="dim">${e.end != null ? fmtDur(e.end - e.ts) : L('en cours', 'running')}</span> — ${esc((e.tool.arg || '').slice(-60))}</summary><pre>${esc((e.tool.d && e.tool.d.kind === 'cmd' ? '$ ' + e.tool.d.text + '\n' : '') + (e.out || ''))}</pre>${e.img && S.cur ? `<img class="dimg" src="${esc(mediaUrl(id, e.id, 0))}" alt="" loading="lazy">` : ''}</details>`).join('')) +
|
|
2288
2319
|
evs.filter((e) => e.agent === id && (e.kind === 'say' || e.kind === 'report')).map((e) => `<h3>${e.kind === 'report' ? L('Rapport final', 'Final report') : L('A dit', 'Said')}</h3><pre>${esc(e.text)}</pre>`).join('');
|
|
2320
|
+
const hw = $('#dbody [data-hwpack]'); if (hw) hw.onclick = () => { CHPICK.more = 'halloween'; openChars(); };
|
|
2289
2321
|
}
|
|
2290
2322
|
$('#dclose').onclick = () => { S.detail = null; $('#detail').classList.remove('on'); };
|
|
2291
2323
|
|
|
@@ -2377,7 +2409,7 @@ document.addEventListener('visibilitychange', coffeeDay); setInterval(coffeeDay,
|
|
|
2377
2409
|
// it? "Count me in" turns prefs.shareUsage on; then, each time the call is opened, the server sends at most one empty request a week (server.js, usageWeek). Any other answer leaves it
|
|
2378
2410
|
// off and it is not asked again; ⚙ › All settings turns it on or off. Never asked, and nothing sent, with DO_NOT_TRACK set (APP.track), in a demo or embedded.
|
|
2379
2411
|
const USAGE_ASKS = ['desktop', 'cli', 'plugin'].includes(APP.kind) && APP.track !== false && !EMBED && !Q.get('demo');
|
|
2380
|
-
function usageOpened(fresh) { if (USAGE_ASKS && prefs.shareUsage === true && !document.hidden) (fresh ?
|
|
2412
|
+
function usageOpened(fresh) { if (USAGE_ASKS && prefs.shareUsage === true && !document.hidden) (fresh ? putPrefs() : Promise.resolve()).then(() => fetch('/api/usage', { method: 'POST' })).catch(() => {}); } /* the server sends it once a week at most, and only once the settings file says yes: fresh, just answered, writes it there first (savePrefs waits 400 ms) */
|
|
2381
2413
|
function usagePending() { return USAGE_ASKS && !prefs.usageAsked && prefs.shareUsage !== true; } // the usage question, not answered yet: it has its first day to itself, then takes turns with the Halloween pack's line
|
|
2382
2414
|
function usageStart() {
|
|
2383
2415
|
if (!USAGE_ASKS) return; $('#mShare').style.display = ''; usageOpened();
|
|
@@ -2870,7 +2902,8 @@ async function loadSession(proj, id) {
|
|
|
2870
2902
|
pause(); const mine = (S.loadN = (S.loadN || 0) + 1);
|
|
2871
2903
|
const data = await (await fetch(`/api/session?proj=${encodeURIComponent(proj)}&id=${id}`)).json();
|
|
2872
2904
|
if (mine !== S.loadN || data.error) return false;
|
|
2873
|
-
|
|
2905
|
+
leadProject = data.project || null; clearTimeout(leadTimer); leadField(true);
|
|
2906
|
+
S.term = {}; S.camFor = null; S.focus = null; S.agents = {}; S.cost = data.cost || null; for (const k in nameBook) delete nameBook[k]; const all = [{ id: 'user' }, ...data.agents]; for (const a of byBorn(all)) S.agents[a.id] = persona(twinOf(a)); S.agents = Object.fromEntries(all.map((a) => [a.id, S.agents[a.id]])); // named in the order they started, kept in the server's order
|
|
2874
2907
|
clearThoughts(); Object.assign(TH, { since: {}, next: {}, said: {}, last: 0 }); S.events = data.events; stampT(0); S.byK = new Map(data.events.map((e) => [e.k, e])); S.seq = data.seq || 0; S.ep = data.ep || ''; S.sawEnd = !!data.marks || data.events.some((e) => e.end); S.late = []; S.pos = 0; S.joinAt = Date.now(); S.idx = 0; S.status = {}; S.tc = {}; S.cur = { proj, id }; S.logTo = 0; S.detail = null; $('#detail').classList.remove('on'); S.fgone = new Set(); S.fmade = new Map(); S.artOk = new Map(); S.artPin = null; S.artWhole = null; S.wholeSeen = new Set();
|
|
2875
2908
|
const opt = $('#sessions').selectedOptions[0]; S.title = (S.live ? niceProj(proj) : opt && opt.dataset.title) || '';
|
|
2876
2909
|
if (proj === '_demo') S.events.forEach((e) => { if (e.fr) trMem.set(baseText(e), e.fr, 'fr'); }); // the demo ships its own French
|
|
@@ -2880,7 +2913,7 @@ const niceProj = (p) => (p === '_demo' ? '' : p === '_codex' ? 'Codex' : p === '
|
|
|
2880
2913
|
async function fillProjects() { // live view: follow the latest activity anywhere, or pin one project
|
|
2881
2914
|
const sel = $('#liveProj'); let rows = []; try { rows = await (await fetch('/api/projects')).json(); } catch {}
|
|
2882
2915
|
sel.innerHTML = `<option value="">${L('Tous les projets (le plus récent)', 'All projects (most recent)')}</option>` + rows.map((r) => `<option value="${esc(r.proj)}">${esc(niceProj(r.proj))}</option>`).join('');
|
|
2883
|
-
sel.value = prefs.proj && rows.some((r) => r.proj === prefs.proj) ? prefs.proj : '';
|
|
2916
|
+
sel.value = prefs.proj && rows.some((r) => r.proj === prefs.proj) ? prefs.proj : ''; $('#liveProjBox').style.display = rows.length > 1 ? 'block' : 'none'; // with its label: a list alone did not say what it chooses
|
|
2884
2917
|
}
|
|
2885
2918
|
$('#liveProj').onchange = () => { Q.delete('proj'); prefs.proj = $('#liveProj').value; S.pick = null; savePrefs(); S.cur = null; followCurrent(); };
|
|
2886
2919
|
async function followCurrent() {
|
|
@@ -2925,8 +2958,10 @@ setInterval(async () => {
|
|
|
2925
2958
|
if (switched || !S.cur) return;
|
|
2926
2959
|
const cur = S.cur, d = await (await fetch(`/api/session?proj=${encodeURIComponent(cur.proj)}&id=${cur.id}&after=${S.seq}&ep=${encodeURIComponent(S.ep)}`)).json();
|
|
2927
2960
|
if (d.error || cur !== S.cur) return; if (d.resync) { S.cur = null; return; } // the server no longer has our place (restarted, transcript rewritten): reload next tick
|
|
2961
|
+
if ('project' in d && (d.project || {}).key !== (leadProject || {}).key) { leadProject = d.project || null; clearTimeout(leadTimer); leadField(true); renameLead(); } // the first cwd can arrive after the call opens, even without a new event
|
|
2928
2962
|
S.seq = d.seq; if (d.marks) S.sawEnd = true; if (d.cost && (!S.cost || d.cost.usd !== S.cost.usd || d.cost.final !== S.cost.final)) { S.cost = d.cost; later('tok', renderTokens, 300); } if (!d.events || !d.events.length) return;
|
|
2929
|
-
for (const a of d.agents) if (
|
|
2963
|
+
for (const a of d.agents) if (a.born && S.agents[a.id] && !S.agents[a.id].born) S.agents[a.id].born = a.born; /* seen before its first line was read: its start time now, for the next renaming */
|
|
2964
|
+
for (const a of byBorn(d.agents.filter((x) => !S.agents[x.id]))) { S.agents[a.id] = persona(twinOf(a)); addTile(S.agents[a.id]); } // several new at once: named in the order they started, as a reload names them
|
|
2930
2965
|
const from = S.events.length, fresh = [], changed = []; // the session is not written in order: what is new goes at the end (the order the call got it in), what the server corrected is corrected in place
|
|
2931
2966
|
for (const e of d.events) { const old = S.byK.get(e.k); if (old && old.tools && e.tools) e.tools = e.tools.map((t, j) => (old.tools[j] && old.tools[j].id === t.id ? Object.assign(old.tools[j], t) : t)); /* a call sent again (its plan named by the answer): the same object, which the shared screen holds */
|
|
2932
2967
|
if (old) { changed.push([old, { kind: old.kind, n: old.tools ? old.tools.length : 0, end: old.end }]); Object.assign(old, e); } else { S.byK.set(e.k, e); fresh.push(e); } }
|
|
@@ -2940,7 +2975,8 @@ setInterval(async () => {
|
|
|
2940
2975
|
|
|
2941
2976
|
|
|
2942
2977
|
window.addEventListener('message', (e) => { // VS Code asks for a given session: the one the status bar was clicked for, or the one of the Claude Code tab you went to (the message is named 'pin' on both sides, from when the call was pinned there)
|
|
2943
|
-
const d = e.data; if (EMBED && e.source === window.parent && d && d.agentStandup === '
|
|
2978
|
+
const d = e.data; if (EMBED && e.source === window.parent && d && d.agentStandup === 'lead' && typeof d.name === 'string') { APP.lead = d.name.slice(0, 100); leadField(); renameLead(); return; } // agentStandup.leadName changed in the editor
|
|
2979
|
+
if (EMBED && e.source === window.parent && d && d.agentStandup === 'answered' && d.how === 'app' && typeof d.app === 'string') { toast('✋ ' + L('Elle vous attend dans ', 'Waiting for you in ') + d.app.slice(0, 40)); return; } // the extension opened the terminal or app the session runs in (answerAt)
|
|
2944
2980
|
if (!EMBED || e.source !== window.parent || !d || d.agentStandup !== 'pin' || typeof d.id !== 'string') return;
|
|
2945
2981
|
if (d.tab) { if (prefs.followTab !== false && S.live && !S.demo && typeof d.proj === 'string' && !(S.pick && S.pick.pin)) goSession(d.proj, d.id); return; } // the Claude Code tab you went to: the call goes with you (followTab in extension.js; off in ⚙), unless you pinned a call (📌): that one stays while you go through your tabs
|
|
2946
2982
|
const dp = typeof d.proj === 'string' ? d.proj : ''; if (!TOOL[dp]) prefs.proj = dp; S.pick = { proj: dp, id: d.id }; S.cur = null; setView('call'); if (S.live) { fillProjects(); followCurrent(); } else setMode('live');
|
|
@@ -3132,7 +3168,7 @@ async function setMode(m) {
|
|
|
3132
3168
|
document.querySelectorAll('#modeSeg button').forEach((b) => b.classList.toggle('on', b.dataset.m === m)); $('#sessions').style.display = live ? 'none' : '';
|
|
3133
3169
|
S.cur = null; syncUI();
|
|
3134
3170
|
if (live) { S.since = 0; fillProjects(); await followCurrent(); return; }
|
|
3135
|
-
$('#
|
|
3171
|
+
$('#liveProjBox').style.display = 'none';
|
|
3136
3172
|
const rows = await (await fetch('/api/sessions')).json();
|
|
3137
3173
|
$('#sessions').innerHTML = rows.map((r) => { const d = new Date(r.mtime).toLocaleString([], { month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' });
|
|
3138
3174
|
return `<option value="${esc(r.proj)}|${esc(r.id)}" data-title="${esc(r.title)}">${r.agents ? '👥' + r.agents + ' · ' : ''}${esc(r.title.slice(0, 40))} (${d})</option>`; }).join('');
|
|
@@ -3236,7 +3272,8 @@ function applyLang() {
|
|
|
3236
3272
|
document.querySelectorAll('#viewSeg button').forEach((b) => { b.title = b.textContent; }); // in a narrow window they are icons: the name stays as a tooltip
|
|
3237
3273
|
$('#callTrMi').style.display = CALL_LANG[prefs.lang] && !FR() ? '' : 'none';
|
|
3238
3274
|
const sel = $('#langSel'); if (!sel.options.length) sel.innerHTML = LANGS.map(([c, n]) => `<option value="${c}">${n}</option>`).join(''); sel.value = prefs.lang;
|
|
3239
|
-
[['#bPlay', L('Pause / Lecture (espace)', 'Pause / Play (space)')], ['#bLog', L('Transcription', 'Transcript')], ['#bMute', L('Son (touche M)', 'Sound (M key)')], ['#bMenu', L('Réglages', 'Settings')], ['#dclose', L('Fermer', 'Close')], ['#officeVol', L('Volume de l’ambiance', 'Ambience volume')], ['#voiceVol', L('Volume des voix', 'Voice volume')], ['#musicVol', L('Volume de la musique', 'Music volume')], ['#liveProj', L('Projet à suivre', 'Project to follow')], ['#reactBar', L('Réactions', 'Reactions')], ['#logQ', L('Rechercher dans la transcription', 'Search the transcript')], ['#roster', L('Agents', 'Agents')]].forEach(([q, t]) => { const el = $(q); if (!el) return; el.title = t; el.setAttribute('aria-label', t); }); $('#logQ').placeholder = L('Rechercher…', 'Search…'); $('#menuQ').placeholder = L('Chercher un réglage…', 'Search settings…'); $('#menuQ').setAttribute('aria-label', $('#menuQ').placeholder); $('#sps').setAttribute('aria-label', L('Vitesses prédéfinies', 'Speed presets')); document.querySelectorAll('#reactBar button').forEach((b) => b.setAttribute('aria-label', b.dataset.e));
|
|
3275
|
+
[['#bPlay', L('Pause / Lecture (espace)', 'Pause / Play (space)')], ['#bLog', L('Transcription', 'Transcript')], ['#bMute', L('Son (touche M)', 'Sound (M key)')], ['#bMenu', L('Réglages', 'Settings')], ['#dclose', L('Fermer', 'Close')], ['#officeVol', L('Volume de l’ambiance', 'Ambience volume')], ['#voiceVol', L('Volume des voix', 'Voice volume')], ['#musicVol', L('Volume de la musique', 'Music volume')], ['#liveProj', L('Projet à suivre', 'Project to follow')], ['#reactBar', L('Réactions', 'Reactions')], ['#logQ', L('Rechercher dans la transcription', 'Search the transcript')], ['#roster', L('Agents', 'Agents')], ['#leadName', L('Nom de l’agent principal', 'Lead agent name')], ['#dren', L('Renommer', 'Rename')]].forEach(([q, t]) => { const el = $(q); if (!el) return; el.title = t; el.setAttribute('aria-label', t); }); $('#logQ').placeholder = L('Rechercher…', 'Search…'); $('#menuQ').placeholder = L('Chercher un réglage…', 'Search settings…'); $('#menuQ').setAttribute('aria-label', $('#menuQ').placeholder); $('#sps').setAttribute('aria-label', L('Vitesses prédéfinies', 'Speed presets')); document.querySelectorAll('#reactBar button').forEach((b) => b.setAttribute('aria-label', b.dataset.e));
|
|
3276
|
+
leadField(); subField();
|
|
3240
3277
|
$('#gB').textContent = L('🔊 Activer le son', '🔊 Turn on sound'); $('#gB').title = L('Ou cliquez n’importe où dans l’appel', 'Or click anywhere in the call');
|
|
3241
3278
|
$('#eDemo').textContent = L('▶ Voir la démo', '▶ Watch the demo'); $('#eT').textContent = L('En attente d’une session', 'Waiting for a session'); $('#eP').innerHTML = watched() ? esc(L('Aucune session pour l’instant. Lancez Claude Code, Codex ou Mistral Vibe dans {0} : l’appel démarrera tout seul.', 'No session yet. Start Claude Code, Codex or Mistral Vibe in {0}: the call will start by itself.')).replace('{0}', () => `<b>${esc(watched())}</b>`) : esc(L('Aucune session sur cet ordinateur pour l’instant. Lancez Claude Code, Codex ou Mistral Vibe (ou une tâche Cowork) : l’appel démarrera tout seul.', 'No session on this computer yet. Start Claude Code, Codex or Mistral Vibe (or a Cowork task): the call will start by itself.'));
|
|
3242
3279
|
for (const id in S.agents) { const p = persona(S.agents[id]); Object.assign(S.agents[id], { name: p.name, role: p.role }); const t = $('#t-' + id); if (t) { t.querySelector('.tag span').textContent = p.role; t.querySelector('.tag b').textContent = p.name; if (id === 'main' || id === 'user') t.querySelector('.tag span').textContent = p.role; } }
|
|
@@ -3292,20 +3329,21 @@ function menuInit() {
|
|
|
3292
3329
|
$('#menuNone').style.display = q && !far.length && !secs.some((sc) => sc.items.some((e) => !e.classList.contains('mhide'))) ? '' : 'none';
|
|
3293
3330
|
};
|
|
3294
3331
|
}
|
|
3295
|
-
const onSwitch = (e) => { const b = e.target.closest('.mi[data-t]'); if (!b) return; prefs[b.dataset.t] = !prefs[b.dataset.t]; savePrefs(); if (prefs[b.dataset.t] && ['voice', 'office', 'music', 'notify'].includes(b.dataset.t)) claimAudio(); b.querySelector('.sw').classList.toggle('on', prefs[b.dataset.t]); AUD.apply(); if (b.dataset.t === 'shareUsage') { prefs.usageAsked = true; savePrefs(); usageOpened(true); } if (b.dataset.t === 'office') $('#officeBox').style.display = prefs.office ? '' : 'none'; if (b.dataset.t === 'callTr') { prefs.callTrSeen = true; savePrefs(); setLang(prefs.lang); } if (b.dataset.t === 'voice') { voiceOffer(); $('#voiceVolBox').style.display = prefs.voice ? '' : 'none'; } if (b.dataset.t === 'customLaptop') { for (const k in imgCache) delete imgCache[k]; buildStage(); paintStatus(); } if (b.dataset.t === 'files') paintFiles(); if (b.dataset.t === 'artNet' && S.present) renderPresent(); if (b.dataset.t === 'ownNames') renameAll(); if (b.dataset.t === 'reactions') document.body.classList.toggle('react', prefs.reactions); if (b.dataset.t === 'focusLayout') { document.body.classList.toggle('focusl', !!prefs.focusLayout); layout(); } if (b.dataset.t === 'roster') { document.body.classList.toggle('rost', prefs.roster); paintStates(); } if (b.dataset.t === 'notify') { prefs.notifyChosen = true; savePrefs(); } if (b.dataset.t === 'notify' && prefs.notify) askNotify(); if (b.dataset.t === 'vanish' && !prefs.vanish) { S.gone.clear(); paintStatus(); }
|
|
3332
|
+
const onSwitch = (e) => { const b = e.target.closest('.mi[data-t]'); if (!b) return; prefs[b.dataset.t] = !prefs[b.dataset.t]; savePrefs(); if (prefs[b.dataset.t] && ['voice', 'office', 'music', 'notify'].includes(b.dataset.t)) claimAudio(); b.querySelector('.sw').classList.toggle('on', prefs[b.dataset.t]); AUD.apply(); if (b.dataset.t === 'shareUsage') { prefs.usageAsked = true; savePrefs(); usageOpened(true); } if (b.dataset.t === 'office') $('#officeBox').style.display = prefs.office ? '' : 'none'; if (b.dataset.t === 'callTr') { prefs.callTrSeen = true; savePrefs(); setLang(prefs.lang); } if (b.dataset.t === 'voice') { voiceOffer(); $('#voiceVolBox').style.display = prefs.voice ? '' : 'none'; } if (b.dataset.t === 'customLaptop') { for (const k in imgCache) delete imgCache[k]; buildStage(); paintStatus(); } if (b.dataset.t === 'files') paintFiles(); if (b.dataset.t === 'artNet' && S.present) renderPresent(); if (b.dataset.t === 'ownNames') { renameAll(); subField(); } if (b.dataset.t === 'reactions') document.body.classList.toggle('react', prefs.reactions); if (b.dataset.t === 'focusLayout') { document.body.classList.toggle('focusl', !!prefs.focusLayout); layout(); } if (b.dataset.t === 'roster') { document.body.classList.toggle('rost', prefs.roster); paintStates(); } if (b.dataset.t === 'notify') { prefs.notifyChosen = true; savePrefs(); } if (b.dataset.t === 'notify' && prefs.notify) askNotify(); if (b.dataset.t === 'vanish' && !prefs.vanish) { S.gone.clear(); paintStatus(); }
|
|
3296
3333
|
if (b.dataset.t === 'askCard') paintAsk(Date.now());
|
|
3297
3334
|
if (b.dataset.t === 'updateNotice') { prefs.updateAsked = true; savePrefs(); $('#updTip').style.display = 'none'; if (prefs.updateNotice) { updStart.at = 0; setTimeout(updStart, 600); } } /* an answer too; on: asked once the settings file says so (savePrefs waits 400 ms) */
|
|
3298
3335
|
if (b.dataset.t === 'music') { $('#musicBox').style.display = prefs.music ? '' : 'none'; if (prefs.music) { AUD.init(); AUD.apply(); } } };
|
|
3299
3336
|
$('#menu').onclick = onSwitch; $('#prefs').onclick = (e) => { if (e.target === $('#prefs')) return closePrefs(); onSwitch(e); setTimeout(syncSwitches); };
|
|
3300
3337
|
function openPrefs(target) { // ⚙ → All settings; target: one of its settings, found by the search of the menu, shown and lit up
|
|
3301
|
-
$('#menu').classList.remove('on'); $('#prefs').classList.add('on'); syncSwitches(); document.querySelectorAll('#prefs .mi[data-t]').forEach((b) => b.querySelector('.sw').classList.toggle('on', !!prefs[b.dataset.t]));
|
|
3302
|
-
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, button') || target).focus(); } else $('#prefsX').focus();
|
|
3338
|
+
$('#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]));
|
|
3339
|
+
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();
|
|
3303
3340
|
}
|
|
3304
|
-
const PANEL_KEYS = ['office', 'officeVol', 'music', 'station', 'musicVol', 'voiceVol', 'notify', 'customLaptop', 'ownNames', 'roster', 'reactions', 'banter', 'chat', 'vanish', 'epi', 'files', 'artNet', 'visits', 'askCard', 'followTab']; // what the panel holds, and so what Reset puts back
|
|
3341
|
+
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
|
|
3305
3342
|
$('#prefsReset').onclick = async () => {
|
|
3306
3343
|
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
|
|
3307
|
-
|
|
3308
|
-
|
|
3344
|
+
const keys = [...PANEL_KEYS, ...(projectLeadKey() ? [projectLeadKey()] : [])]; // reset the displayed project override, leaving other projects alone
|
|
3345
|
+
for (const k of keys) { if (k in PREF_DEFAULTS) prefs[k] = PREF_DEFAULTS[k]; else delete prefs[k]; } delete prefs.notifyChosen; // notifyChosen too: the default of notifications is decided at start-up from it
|
|
3346
|
+
prefs._t = Date.now(); try { localStorage.setItem('cc.prefs', prefsOut()); } catch {} for (const k of [...keys, 'notifyChosen']) prefsBase[k] = { reset: true }; try { await putPrefs(); } catch {} /* marked as changed: reset too what another window changed after this one loaded */
|
|
3309
3347
|
location.reload(); // every part of the page starts again from them
|
|
3310
3348
|
};
|
|
3311
3349
|
function menuTip() { // once, to someone who used the app before: where the settings went. Gone with its button, or as soon as the menu is opened
|
|
@@ -3326,6 +3364,34 @@ $('#station').innerHTML = STATIONS.map((s) => `<option value="${s.id}">📻 ${s.
|
|
|
3326
3364
|
$('#station').value = prefs.station; $('#musicVol').value = prefs.musicVol; $('#musicBox').style.display = prefs.music ? '' : 'none';
|
|
3327
3365
|
$('#station').onchange = (e) => { prefs.station = e.target.value; savePrefs(); AUD.init(); RADIO.sync(); };
|
|
3328
3366
|
$('#chatSel').value = ['quiet', 'normal', 'lively'].includes(prefs.chat) ? prefs.chat : 'normal'; $('#chatSel').onchange = () => { prefs.chat = $('#chatSel').value; savePrefs(); };
|
|
3367
|
+
// ⚙ → All settings → Lead agent name (empty: Margot). The editor's agentStandup.leadName wins over it: the field then shows that name, greyed, and says where it is set
|
|
3368
|
+
function leadField(projectChanged = false) {
|
|
3369
|
+
const f = $('#leadName'), ed = cleanLead(APP.lead); f.disabled = !!ed; if (document.activeElement !== f || ed) f.value = ed || cleanLead(prefs.leadName);
|
|
3370
|
+
const p = $('#projectLeadName'), key = projectLeadKey(); p.disabled = !!ed || !key; p.placeholder = cleanLead(prefs.leadName) || LEAD_NAME;
|
|
3371
|
+
if (projectChanged || document.activeElement !== p || ed) p.value = ed || (key ? cleanLead(prefs[key]) : '');
|
|
3372
|
+
const ph = $('#projectLeadHint'); ph.textContent = key ? leadProject.label + ' · ' + L('Vide : utiliser le nom par défaut.', 'Empty: use the default name.') : L('Ouvrez un projet pour choisir son nom.', 'Open a project to choose its name.');
|
|
3373
|
+
const h = $('#leadHint'); h.style.display = ed ? '' : 'none'; h.textContent = ed ? L('Choisi dans les réglages de l’éditeur (agentStandup.leadName)', 'Set in the editor’s settings (agentStandup.leadName)') : '';
|
|
3374
|
+
}
|
|
3375
|
+
function renameLead() { renameAll(true); } // the lead and its forks take the new name at once, in the call, the list and the transcript, and a sub-agent that had that name gets another
|
|
3376
|
+
let leadTimer = null;
|
|
3377
|
+
$('#leadName').oninput = () => { prefs.leadName = cleanLead($('#leadName').value); if (!prefs.leadName) delete prefs.leadName; savePrefs(); clearTimeout(leadTimer); leadTimer = setTimeout(renameLead, 250); };
|
|
3378
|
+
$('#leadName').onchange = () => { clearTimeout(leadTimer); renameLead(); leadField(); };
|
|
3379
|
+
$('#projectLeadName').oninput = () => { const key = projectLeadKey(); if (!key || cleanLead(APP.lead)) return; const name = cleanLead($('#projectLeadName').value); if (name) prefs[key] = name; else delete prefs[key]; savePrefs(); clearTimeout(leadTimer); leadTimer = setTimeout(renameLead, 250); };
|
|
3380
|
+
$('#projectLeadName').onchange = () => { clearTimeout(leadTimer); renameLead(); leadField(); };
|
|
3381
|
+
leadField();
|
|
3382
|
+
// ⚙ → All settings → Sub-agent names: your own list, given in its order (empty: the built-in names). "Start from the names in the call" writes in the names the call gave, in the order the agents came:
|
|
3383
|
+
// changing one there renames that agent, since the list is given again in the same order. Agents you named yourself (Keep my agents' own names) and the lead's forks are not in it
|
|
3384
|
+
function listNamed() { return byBorn(Object.values(S.agents)).filter((p) => p.id !== 'main' && p.id !== 'user' && !p.twinN && !(p.own && prefs.ownNames && !isLeadName(p.own))).map((p) => p.name); }
|
|
3385
|
+
function subField() {
|
|
3386
|
+
const f = $('#subNames'); if (document.activeElement !== f) f.value = typeof prefs.subNames === 'string' ? prefs.subNames : ''; f.placeholder = NAMES.slice(0, 5).join(', ') + ', …';
|
|
3387
|
+
$('#subNamesHint').textContent = L('Renommez tous les sous-agents : des prénoms séparés par des virgules, donnés dans l’ordre où les agents arrivent. Vide : les prénoms intégrés.', 'Rename every sub-agent: names separated by commas, given in the order the agents start. Empty: the built-in names.') + ' ' + (prefs.ownNames ? L('Les agents que vous avez nommés vous-même gardent leur nom (réglage ci-dessous).', 'Agents you named yourself keep their names (switch below).') : L('Les agents que vous avez nommés vous-même prennent aussi ces prénoms (réglage ci-dessous).', 'Agents you named yourself take these names too (switch below).'));
|
|
3388
|
+
$('#subFill').style.display = !subNameList().length && listNamed().length ? '' : 'none';
|
|
3389
|
+
}
|
|
3390
|
+
let subTimer = null; const renameSubs = () => renameAll(false);
|
|
3391
|
+
$('#subNames').oninput = () => { const v = $('#subNames').value.slice(0, 2000); if (/[^\s,;]/.test(v)) prefs.subNames = v; else delete prefs.subNames; savePrefs(); clearTimeout(subTimer); subTimer = setTimeout(renameSubs, 400); };
|
|
3392
|
+
$('#subNames').onchange = () => { clearTimeout(subTimer); renameSubs(); subField(); };
|
|
3393
|
+
$('#subFill').onclick = () => { const f = $('#subNames'); f.value = listNamed().join(', '); f.focus(); f.dispatchEvent(new Event('input')); f.setSelectionRange(f.value.length, f.value.length); $('#subFill').style.display = 'none'; };
|
|
3394
|
+
subField();
|
|
3329
3395
|
$('#vstyle').innerHTML = [['animal', 'Animal Crossing (babillage)', 'Animal Crossing (babble)'], ['kokoro', 'Voix naturelles (à installer)', 'Natural voices (installs on demand)']].map(([v, fr, en]) => `<option value="${v}" data-fr="${fr}" data-en="${en}">${L(fr, en)}</option>`).join(''); $('#vstyle').value = prefs.vstyle; $('#vstyle').onchange = () => { prefs.vstyle = $('#vstyle').value; prefs.vstyleChosen = true; savePrefs(); TTS.init().then(kokoroUI); kokoroUI(); };
|
|
3330
3396
|
// ---- ⚙ → very natural voices (Kokoro): install box and status, polled while installing
|
|
3331
3397
|
let kokoroTimer = null;
|
package/public/locales/da.json
CHANGED
|
@@ -387,8 +387,8 @@
|
|
|
387
387
|
"Privacy policy": "Privatlivspolitik",
|
|
388
388
|
"Help count users (1 request a week)": "Hjælp med at tælle brugere (1 forespørgsel om ugen)",
|
|
389
389
|
"Halloween is coming: dress your agents up as a pumpkin, a ghost, a witch or a skeleton, drawn by hand by Fabien Coupas.": "Halloween nærmer sig: klæd dine agenter ud som græskar, spøgelse, heks eller skelet, tegnet i hånden af Fabien Coupas.",
|
|
390
|
-
"Happy Halloween! Your agents
|
|
391
|
-
"Halloween is tomorrow: your agents
|
|
390
|
+
"Happy Halloween! Your agents brought pumpkins. The full costumes are in the pack, drawn by hand.": "Glædelig halloween! Dine agenter har taget græskar med. De hele kostumer er i pakken, tegnet i hånden.",
|
|
391
|
+
"Halloween is tomorrow: your agents brought pumpkins. The full costumes are in the pack, drawn by hand.": "Det er halloween i morgen: dine agenter har taget græskar med. De hele kostumer er i pakken, tegnet i hånden.",
|
|
392
392
|
"advised by": "rådgivet af",
|
|
393
393
|
"At least: work went on after it last counted.": "Mindst: arbejdet fortsatte efter den sidste optælling.",
|
|
394
394
|
"cost": "omkostning",
|
|
@@ -425,5 +425,19 @@
|
|
|
425
425
|
"Claude usage limit: {0} sessions stopped": "Claudes forbrugsgrænse: {0} sessioner stoppet",
|
|
426
426
|
"Claude Code is open in {0} but saves no history (CLAUDE_CODE_SKIP_PROMPT_HISTORY is set), so Agent Standup cannot follow it.": "Claude Code er åben i {0}, men gemmer ingen historik (CLAUDE_CODE_SKIP_PROMPT_HISTORY er sat), så Agent Standup kan ikke følge den.",
|
|
427
427
|
"Why?": "Hvorfor?",
|
|
428
|
-
"Remove CLAUDE_CODE_SKIP_PROMPT_HISTORY from your shell profile, then start Claude Code again.": "Fjern CLAUDE_CODE_SKIP_PROMPT_HISTORY fra din shell-profil, og start derefter Claude Code igen."
|
|
428
|
+
"Remove CLAUDE_CODE_SKIP_PROMPT_HISTORY from your shell profile, then start Claude Code again.": "Fjern CLAUDE_CODE_SKIP_PROMPT_HISTORY fra din shell-profil, og start derefter Claude Code igen.",
|
|
429
|
+
"Lead agent name": "Lederagentens navn",
|
|
430
|
+
"Set in the editor’s settings (agentStandup.leadName)": "Valgt i editorens indstillinger (agentStandup.leadName)",
|
|
431
|
+
"Costume": "Kostume",
|
|
432
|
+
"Your vampire comes from the Halloween pack, drawn by hand by Fabien Coupas. The rest of the cast is in it too.": "Din vampyr kommer fra halloween-pakken, tegnet i hånden af Fabien Coupas. Resten af holdet er også med.",
|
|
433
|
+
"Name for this project": "Navn til dette projekt",
|
|
434
|
+
"Empty: use the default name.": "Tomt: brug standardnavnet.",
|
|
435
|
+
"Open a project to choose its name.": "Åbn et projekt for at vælge dets navn.",
|
|
436
|
+
"Rename": "Omdøb",
|
|
437
|
+
"Rename the agents": "Omdøb agenterne",
|
|
438
|
+
"Start from the names in the call": "Start med navnene i opkaldet",
|
|
439
|
+
"Sub-agent names": "Navne på underagenter",
|
|
440
|
+
"Rename every sub-agent: names separated by commas, given in the order the agents start. Empty: the built-in names.": "Omdøb alle underagenter: navne adskilt af kommaer, givet i den rækkefølge agenterne starter. Tom: de indbyggede navne.",
|
|
441
|
+
"Agents you named yourself keep their names (switch below).": "Agenter, du selv har navngivet, beholder deres navne (kontakten nedenfor).",
|
|
442
|
+
"Agents you named yourself take these names too (switch below).": "Agenter, du selv har navngivet, får også disse navne (kontakten nedenfor)."
|
|
429
443
|
}
|
package/public/locales/de.json
CHANGED
|
@@ -388,8 +388,8 @@
|
|
|
388
388
|
"Privacy policy": "Datenschutzerklärung",
|
|
389
389
|
"Help count users (1 request a week)": "Beim Zählen der Nutzer helfen (1 Anfrage pro Woche)",
|
|
390
390
|
"Halloween is coming: dress your agents up as a pumpkin, a ghost, a witch or a skeleton, drawn by hand by Fabien Coupas.": "Halloween steht vor der Tür: Verkleide deine Agenten als Kürbis, Geist, Hexe oder Skelett, von Hand gezeichnet von Fabien Coupas.",
|
|
391
|
-
"Happy Halloween! Your agents
|
|
392
|
-
"Halloween is tomorrow: your agents
|
|
391
|
+
"Happy Halloween! Your agents brought pumpkins. The full costumes are in the pack, drawn by hand.": "Fröhliches Halloween! Deine Agenten haben Kürbisse mitgebracht. Die ganzen Kostüme sind im Paket, von Hand gezeichnet.",
|
|
392
|
+
"Halloween is tomorrow: your agents brought pumpkins. The full costumes are in the pack, drawn by hand.": "Morgen ist Halloween: Deine Agenten haben Kürbisse mitgebracht. Die ganzen Kostüme sind im Paket, von Hand gezeichnet.",
|
|
393
393
|
"advised by": "beraten von",
|
|
394
394
|
"At least: work went on after it last counted.": "Mindestens: Nach der letzten Zählung ging die Arbeit weiter.",
|
|
395
395
|
"cost": "Kosten",
|
|
@@ -426,5 +426,19 @@
|
|
|
426
426
|
"Claude usage limit: {0} sessions stopped": "Claude-Nutzungslimit: {0} Sitzungen gestoppt",
|
|
427
427
|
"Claude Code is open in {0} but saves no history (CLAUDE_CODE_SKIP_PROMPT_HISTORY is set), so Agent Standup cannot follow it.": "Claude Code ist in {0} geöffnet, speichert aber keinen Verlauf (CLAUDE_CODE_SKIP_PROMPT_HISTORY ist gesetzt), daher kann Agent Standup es nicht verfolgen.",
|
|
428
428
|
"Why?": "Warum?",
|
|
429
|
-
"Remove CLAUDE_CODE_SKIP_PROMPT_HISTORY from your shell profile, then start Claude Code again.": "Entferne CLAUDE_CODE_SKIP_PROMPT_HISTORY aus deinem Shell-Profil und starte Claude Code dann neu."
|
|
429
|
+
"Remove CLAUDE_CODE_SKIP_PROMPT_HISTORY from your shell profile, then start Claude Code again.": "Entferne CLAUDE_CODE_SKIP_PROMPT_HISTORY aus deinem Shell-Profil und starte Claude Code dann neu.",
|
|
430
|
+
"Lead agent name": "Name des Hauptagenten",
|
|
431
|
+
"Set in the editor’s settings (agentStandup.leadName)": "In den Einstellungen des Editors festgelegt (agentStandup.leadName)",
|
|
432
|
+
"Costume": "Kostüm",
|
|
433
|
+
"Your vampire comes from the Halloween pack, drawn by hand by Fabien Coupas. The rest of the cast is in it too.": "Dein Vampir stammt aus dem Halloween-Paket, von Hand gezeichnet von Fabien Coupas. Der Rest der Besetzung ist auch darin.",
|
|
434
|
+
"Name for this project": "Name für dieses Projekt",
|
|
435
|
+
"Empty: use the default name.": "Leer: Standardnamen verwenden.",
|
|
436
|
+
"Open a project to choose its name.": "Öffne ein Projekt, um seinen Namen zu wählen.",
|
|
437
|
+
"Rename": "Umbenennen",
|
|
438
|
+
"Rename the agents": "Agenten umbenennen",
|
|
439
|
+
"Start from the names in the call": "Mit den Namen im Call beginnen",
|
|
440
|
+
"Sub-agent names": "Namen der Subagenten",
|
|
441
|
+
"Rename every sub-agent: names separated by commas, given in the order the agents start. Empty: the built-in names.": "Alle Subagenten umbenennen: Namen durch Kommas getrennt, in der Reihenfolge vergeben, in der die Agenten starten. Leer: die eingebauten Namen.",
|
|
442
|
+
"Agents you named yourself keep their names (switch below).": "Agenten, die du selbst benannt hast, behalten ihre Namen (Schalter unten).",
|
|
443
|
+
"Agents you named yourself take these names too (switch below).": "Agenten, die du selbst benannt hast, bekommen ebenfalls diese Namen (Schalter unten)."
|
|
430
444
|
}
|