@double_geste/agent-standup 1.43.1 → 1.45.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 +3 -0
- package/package.json +2 -1
- package/public/index.html +158 -52
- package/public/locales/da.json +23 -2
- package/public/locales/de.json +23 -2
- package/public/locales/en.json +23 -2
- package/public/locales/es.json +23 -2
- package/public/locales/ja.json +23 -2
- package/public/locales/ko.json +23 -2
- package/public/locales/pt-BR.json +23 -2
- package/public/locales/zh-CN.json +23 -2
- package/public/locales/zh-TW.json +23 -2
- package/reply.js +51 -0
- package/server.js +13 -3
package/public/index.html
CHANGED
|
@@ -218,6 +218,12 @@
|
|
|
218
218
|
.row .txt { color:#c3c6d4; word-break:break-word } .row.order .who { color:var(--gold) } .row.report .who { color:var(--ok) }
|
|
219
219
|
footer { display:none; height:44px; flex:none; align-items:center; gap:12px; padding:0 14px; border-top:1px solid var(--line) }
|
|
220
220
|
body.replay footer { display:flex }
|
|
221
|
+
#say { display:none; flex:1; min-width:0; align-items:flex-end; gap:8px } body.can-say:not(.replay) footer { display:flex; height:auto; min-height:44px; padding:6px 14px } body.can-say:not(.replay) footer > :not(#say) { display:none } body.can-say:not(.replay) #say { display:flex } /* live: the footer row is the human's line; replay: the seek bar */
|
|
222
|
+
#say label { flex:none; align-self:center; color:var(--dim); font-size:12px; white-space:nowrap; max-width:30vw; overflow:hidden; text-overflow:ellipsis }
|
|
223
|
+
#sayT { flex:1; min-width:0; min-height:44px; max-height:96px; resize:none; background:var(--panel2); color:var(--text); border:1px solid var(--line); border-radius:8px; padding:8px 10px; font:inherit; font-size:14px; line-height:1.4 } #sayT:focus { border-color:var(--accent) } #sayT:disabled { opacity:.5; cursor:not-allowed }
|
|
224
|
+
#sayB { flex:none; min-width:44px; min-height:44px; background:var(--accent); color:#0b1020; font-weight:700; border:0; border-radius:8px; padding:0 14px; cursor:pointer } #sayB:disabled { opacity:.5; cursor:not-allowed } #sayB.busy { cursor:progress; position:relative; color:transparent } #sayB.busy::after { content:''; position:absolute; left:50%; top:50%; width:16px; height:16px; margin:-8px 0 0 -8px; border:2px solid #0b1020; border-right-color:transparent; border-radius:50%; animation:saySpin .7s linear infinite } @keyframes saySpin { to { transform:rotate(360deg) } } @media (prefers-reduced-motion:reduce) { #sayB.busy::after { animation:none } }
|
|
225
|
+
#sayS { flex-basis:100%; font-size:12px; color:var(--dim) } #sayS.err { color:var(--red) } #sayS:empty { height:0; margin-top:-8px } #say { flex-wrap:wrap }
|
|
226
|
+
@media (max-width:520px) { #say label { flex-basis:100%; max-width:none; align-self:flex-start; font-size:11.5px } } /* phone: the recipient sits on its own line above the field */
|
|
221
227
|
input[type=range] { accent-color:var(--accent) } #seek { flex:1; min-width:40px } #pos, footer label.dim { white-space:nowrap; flex:none } @media (max-width:520px) { footer { gap:8px; padding:0 8px } footer label.dim { display:none } } /* narrow: the 1× 2× 4× 8× buttons are the speed control */
|
|
222
228
|
@media (max-width:760px) { aside { position:absolute; right:0; top:0; bottom:0; z-index:6; box-shadow:-10px 0 30px rgba(0,0,0,.5) } .brand small { display:none } }
|
|
223
229
|
@media (max-width:720px) { .brand b { display:none } }
|
|
@@ -260,8 +266,8 @@
|
|
|
260
266
|
.ticker { display:none; position:absolute; left:6px; right:6px; bottom:30px; font:10.5px/1.3 ui-monospace,Menlo,monospace; color:#fff; background:rgba(15,20,35,.8); border-radius:5px; padding:2px 7px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
|
|
261
267
|
.ticker.on { display:block } .ticker i { font-style:normal; color:#ffd24a } .ticker.flash { animation:flash .25s } @keyframes flash { from { background:#3b5bdb } }
|
|
262
268
|
/* character animation: all state-driven from the tile's classes */
|
|
263
|
-
.fig { transform-origin:50px 76px; animation:bob 4.4s ease-in-out infinite; animation-delay:var(--d,0s) } /* the endless motions are moved by one clock in the script (IDLE_ANIMS), not 60 times a second by the browser */ @keyframes bob { 50% { transform:translateY(-.9px) } }
|
|
264
|
-
.tile.speaking .fig { animation:talk .46s ease-in-out infinite } .tile.speaking .fig.still { animation:bob 4.4s ease-in-out infinite; animation-delay:var(--d,0s) } /* a character with a head of its own: the body does not squash, the head nods */
|
|
269
|
+
.fig { transform-origin:50px 76px; animation:bob var(--bd,4.4s) ease-in-out infinite; animation-delay:var(--d,0s) } /* the endless motions are moved by one clock in the script (IDLE_ANIMS), not 60 times a second by the browser */ @keyframes bob { 50% { transform:translateY(-.9px) } }
|
|
270
|
+
.tile.speaking .fig { animation:talk .46s ease-in-out infinite } .tile.speaking .fig.still { animation:bob var(--bd,4.4s) ease-in-out infinite; animation-delay:var(--d,0s) } /* a character with a head of its own: the body does not squash, the head nods */
|
|
265
271
|
.chead { transform-origin:50px 44px } .tile.speaking .chead, #pcam.speaking .chead { animation:nod .6s ease-in-out infinite } @keyframes nod { 35% { transform:rotate(-.25deg) translateY(-.18px) } 75% { transform:rotate(.15deg) } } /* very light: the mouth does the talking */ @keyframes talk { 50% { transform:scale(1.025,.985) translateY(-.5px) } }
|
|
266
272
|
.tile.vanishing { pointer-events:none; z-index:3; animation:vanish 1.2s cubic-bezier(.45,0,.75,.35) forwards }
|
|
267
273
|
@keyframes vanish { 0% { filter:none; transform:none; opacity:1 } 16% { filter:brightness(1.7) saturate(1.5); transform:scale(1.05) } 55% { filter:brightness(2.3) blur(1.5px); transform:scale(.88) rotate(-3deg); opacity:.85 } 100% { filter:brightness(3.4) blur(11px); transform:scale(.12) rotate(11deg); opacity:0 } }
|
|
@@ -272,12 +278,13 @@
|
|
|
272
278
|
.toast.offer { pointer-events:auto; animation:none; display:flex; align-items:center; gap:8px; padding:4px 6px 4px 12px; order:9 } .toast.offer .btn { padding:3px 10px; font-size:12px; white-space:nowrap } .toast.offer .ic { font-size:11px; padding:2px 6px }
|
|
273
279
|
#packNoteI { width:48px; height:36px; border-radius:4px; object-fit:cover; flex:none; cursor:pointer; margin-left:-6px } /* the offer of the real voices: stays until answered, under the passing toasts */
|
|
274
280
|
.toast { background:rgba(27,29,39,.92); border:1px solid var(--line); border-radius:99px; padding:5px 12px; font-size:12px; animation:toast 3s ease forwards } @keyframes toast { 0% { opacity:0; transform:translateY(6px) } 10%, 80% { opacity:1; transform:none } 100% { opacity:0 } }
|
|
275
|
-
.eye { transform-box:fill-box; transform-origin:center; animation:blink 4.6s infinite; animation-delay:var(--d,0s) } @keyframes blink { 0%,94%,100% { transform:scaleY(1) } 97% { transform:scaleY(.08) } }
|
|
281
|
+
.eye { transform-box:fill-box; transform-origin:center; animation:blink var(--kd,4.6s) infinite; animation-delay:var(--d,0s) } @keyframes blink { 0%,94%,100% { transform:scaleY(1) } 97% { transform:scaleY(.08) } }
|
|
276
282
|
.brow { transform-box:fill-box; transform-origin:center; transition:transform .25s } .tile.speaking .brow { animation:brow .7s ease-in-out infinite } @keyframes brow { 50% { transform:translateY(-1.1px) } }
|
|
277
283
|
.tile.working .brow.l { transform:rotate(13deg) translateY(.5px) } .tile.working .brow.r { transform:rotate(-13deg) translateY(.5px) } .tile.working .pupil { transform:translateY(1.2px) }
|
|
278
|
-
.arm.l { transform-origin:27px 48px } .arm.r { transform-origin:73px 48px } .tile.speaking .arm.r { animation:wave .7s ease-in-out infinite } @keyframes wave { 50% { transform:rotate(-34deg) } }
|
|
279
|
-
.tile.working .arm {
|
|
284
|
+
.arm { transition:transform .35s ease } .arm.l { transform-origin:27px 48px } .arm.r { transform-origin:73px 48px } .tile.speaking .arm.r { animation:wave .7s ease-in-out infinite } @keyframes wave { 50% { transform:rotate(-34deg) } }
|
|
285
|
+
.tile.working .arm.l { transform:rotate(-24deg) } .tile.working .arm.r { transform:rotate(24deg); animation:none } /* at work the arms reach in, behind the laptop */ .tile .laptop, .tile .hands, .tile .sparks, .tile .grin, .tile .eyes-happy, .tile .mouth { display:none }
|
|
280
286
|
.tile.working .laptop, .tile.working .hands, .tile.done .sparks, .tile.done .eyes-happy { display:inline } .tile.done .eyes-open { display:none }
|
|
287
|
+
.tile .eyes-open { transition:transform .45s ease; transform:translate(calc(var(--lx,0) * 1.4px), calc(var(--ly,0) * .9px)) } .tile.working .eyes-open { transform:translate(0,0) } /* the others glance at whoever speaks (gaze()); one move per line, not an endless animation; at work, eyes on the laptop */
|
|
281
288
|
.tile.speaking .mouth { display:inline } .tile.speaking .smile, .tile.speaking .grin { display:none } .tile.done:not(.speaking) .smile { display:none } .tile.done:not(.speaking) .grin { display:inline }
|
|
282
289
|
.hand { animation:type .34s ease-in-out infinite } .hand.r { animation-delay:-.17s } .tile.working .chand { animation:type .34s ease-in-out infinite } .tile.working .chand.r { animation-delay:-.17s }
|
|
283
290
|
.claptop { display:none } .claptop.on, .tile.lap .claptop { display:inline } .tile.lap .claptop { animation:lapin .5s cubic-bezier(.2,.8,.3,1) } .tile.lapout .claptop { animation:lapout .45s ease-in forwards } /* a laptop pulled out from under the desk, and put away */
|
|
@@ -286,6 +293,14 @@
|
|
|
286
293
|
.drift { animation:drift 24s ease-in-out infinite alternate } @keyframes drift { to { transform:translateX(9px) } }
|
|
287
294
|
.steam { animation:steam 2.6s ease-in-out infinite } @keyframes steam { 50% { transform:translateY(-1.4px); opacity:.25 } }
|
|
288
295
|
.tile.done .sparks path { animation:tw 1.6s ease-in-out infinite }
|
|
296
|
+
/* one-shot moves (oneShot()), never endless: the lid opens and closes, the hands come to the keyboard once it is open, arms up when the work is done, a nod, raised eyebrows, a breath before the first word, the mouth settling into a smile, a stretch */
|
|
297
|
+
.lid { transform-origin:50px 64px } .tile.working .lid { animation:lidup .45s cubic-bezier(.2,.8,.3,1) } .tile.lidshut .laptop { display:inline } .tile.lidshut .lid { animation:lidshut .38s ease-in forwards } .tile.working .hands { animation:handsin .3s ease-out .25s both }
|
|
298
|
+
@keyframes lidup { from { transform:scaleY(.06) } } @keyframes lidshut { to { transform:scaleY(.06) } } @keyframes handsin { from { opacity:0; transform:translateY(2px) } }
|
|
299
|
+
.tile.yay .arm.l { animation:yayl .9s ease-in-out } .tile.yay .arm.r { animation:yayr .9s ease-in-out } .tile.yay:not(.speaking) .fig { animation:hop .7s ease-out } @keyframes yayl { 35%, 65% { transform:rotate(58deg) } } @keyframes yayr { 35%, 65% { transform:rotate(-58deg) } } @keyframes hop { 30% { transform:translateY(-2.4px) } 55% { transform:none } 75% { transform:translateY(-.8px) } }
|
|
300
|
+
.tile.nod1:not(.speaking) .fig { animation:nod1 .75s ease-in-out } @keyframes nod1 { 30% { transform:translateY(1px) rotate(.5deg) } 60% { transform:translateY(-.4px) } }
|
|
301
|
+
.tile.stretch:not(.speaking) .fig { animation:stretch 1.2s ease-in-out } @keyframes stretch { 40% { transform:scale(1.03,.97) translateY(.6px) } 65% { transform:scale(.98,1.035) translateY(-1.2px) } }
|
|
302
|
+
.tile.inhale .brow { animation:browup .34s ease-out } .tile.wow .brow { animation:wow 1.1s ease-out } @keyframes browup { 50% { transform:translateY(-1.8px) } } @keyframes wow { 20%, 70% { transform:translateY(-1.9px) } }
|
|
303
|
+
.tile.settle .smile, .tile.settle .grin { transform-box:fill-box; transform-origin:center; animation:settle .35s ease-out } @keyframes settle { from { transform:scale(.55,1.8) } }
|
|
289
304
|
@media (prefers-reduced-motion:reduce) { *, *::before, *::after { animation:none !important; transition:none !important } .confetti, .fly { display:none !important } }
|
|
290
305
|
.tile:focus-visible, .rr:focus-visible, .bcard:focus-visible { outline:2px solid var(--accent); outline-offset:2px }
|
|
291
306
|
.fly { position:fixed; left:0; top:0; font-size:28px; z-index:8; pointer-events:none; filter:drop-shadow(0 3px 4px rgba(0,0,0,.5)) }
|
|
@@ -395,6 +410,7 @@
|
|
|
395
410
|
<div class="hint" id="trHint" style="display:none"></div>
|
|
396
411
|
<h4 data-fr="Son" data-en="Sound">Son</h4>
|
|
397
412
|
<button class="mi" data-t="voice"><span data-fr="Voix des agents" data-en="Agent voices">Voix des agents</span><i class="sw"></i></button>
|
|
413
|
+
<button class="mi" data-t="zen"><span data-fr="Mode zen : les alertes, sans les voix" data-en="Zen mode: alerts, no voices">Mode zen : les alertes, sans les voix</span><i class="sw"></i></button>
|
|
398
414
|
<div class="box" id="voiceVolBox" style="display:none"><input id="voiceVol" type="range" min="0.05" max="1" step="0.05" style="width:100%" aria-label="Voice volume"></div>
|
|
399
415
|
<div class="box" id="vstyleBox"><label class="lbl" for="vstyle" data-fr="Style des voix" data-en="Voice style">Style des voix</label><select id="vstyle"></select><div class="hint" id="vstyleTip" style="padding:6px 0 0;display:none" data-fr="Pour la meilleure expérience, choisissez les voix naturelles." data-en="For the best experience, pick the natural voices.">Pour la meilleure expérience, choisissez les voix naturelles.</div></div>
|
|
400
416
|
<div class="box" id="kokoroBox" style="display:none"><button class="btn" id="kokoroInstall" style="width:100%"></button><div class="hint" id="kokoroHint" style="padding:2px 0 6px"></div></div>
|
|
@@ -479,6 +495,7 @@
|
|
|
479
495
|
<input id="seek" type="range" min="0" max="0" value="0"><span class="dim" id="pos">0 / 0</span>
|
|
480
496
|
<label class="dim"><span data-fr="Vitesse" data-en="Speed">Vitesse</span> <input id="speed" type="range" min="0.5" max="8" step="0.25" value="1.25" style="width:80px;vertical-align:middle"></label>
|
|
481
497
|
<span id="sps" class="dim" role="group" aria-label="Speed presets"><button data-s="1">1×</button><button data-s="2">2×</button><button data-s="4">4×</button><button data-s="8">8×</button></span>
|
|
498
|
+
<form id="say" autocomplete="off"><label for="sayT" id="sayL"></label><textarea id="sayT" rows="1" enterkeyhint="send" maxlength="4000"></textarea><button id="sayB" type="submit"></button><div id="sayS" role="status" aria-atomic="true"></div></form>
|
|
482
499
|
</footer>
|
|
483
500
|
<div id="card"></div><div id="recap"><div class="box"></div></div>
|
|
484
501
|
|
|
@@ -599,7 +616,7 @@ const CHAR_CHOICES = ['none', 'folder', 'cats', 'halloween']; // what ⚙ →
|
|
|
599
616
|
let SHOP = {}; // the packs of the shop, by name, as the server knows them: how many characters are here (none until it is bought), its price, the code of the purchase
|
|
600
617
|
const toData = (url) => fetch(url).then((r) => r.blob()).then((b) => new Promise((res) => { const f = new FileReader(); f.onload = () => res(f.result); f.readAsDataURL(b); }));
|
|
601
618
|
const imgSize = (src) => new Promise((res) => { const i = new Image(); i.onload = () => res([i.naturalWidth, i.naturalHeight]); i.onerror = () => res([0, 0]); i.src = src; }), isDrawing = (wh) => Math.max(wh[0], wh[1]) > 128; // a large image is a drawing, shown smooth; pixel art (32 or 64 px) keeps its hard pixels
|
|
602
|
-
const youMode = () => prefs.charYou || (prefs.charPack === 'none' ? 'vampire' : 'cast'); // who you are: the cast's own human, or the vampire of the Halloween pack, everyone's and free (the default with the drawn characters, so that everyone meets the pack)
|
|
619
|
+
const youMode = () => prefs.charYou || (prefs.charPack === 'none' && new Date().getMonth() === 9 ? 'vampire' : 'cast'); // who you are: the cast's own human, or the vampire of the Halloween pack, everyone's and free (the default with the drawn characters in October only, so that everyone meets the pack; the rest of the year a choice in ⚙ → Characters, kept once picked)
|
|
603
620
|
let VAMP = null; // the free vampire (examples/vampire), loaded once
|
|
604
621
|
async function charEntry(base, c) { // one character of a folder or a pack, ready to draw: its pictures as data, their sizes, what it may wear
|
|
605
622
|
const e = { name: c.stem, idle: await toData(base + encodeURIComponent(c.file)), talk: c.talk ? await toData(base + encodeURIComponent(c.talk)) : null, bg: c.bg ? await toData(base + encodeURIComponent(c.bg)) : null, desks: await Promise.all((c.desks || []).map((f) => toData(base + encodeURIComponent(f)))), hands: c.hands ? await toData(base + encodeURIComponent(c.hands)) : null, head: c.head ? await toData(base + encodeURIComponent(c.head)) : null };
|
|
@@ -622,11 +639,18 @@ async function loadChars() {
|
|
|
622
639
|
if (youMode() === 'vampire') { try { VAMP = VAMP || (await vampEntry()); if (VAMP) { next.you = VAMP; next.youFrom = 'vampire'; } } catch {} }
|
|
623
640
|
CHARS = next;
|
|
624
641
|
}
|
|
625
|
-
const
|
|
642
|
+
const charKey = (s) => String(s || '').split(':').pop().toLowerCase().replace(/[\s_\-]+/g, '-').replace(/^-+|-+$/g, ''); // "QA Agent", qa_agent, plugin:qa-agent → qa-agent
|
|
643
|
+
const STOCK_TYPE = /^(main|general-purpose|explore|plan|claude|agent|task|fork|default|worker|explorer|subagent|workflow-subagent|statusline-setup|output-style-setup|claude-code-guide|verification|magic-docs)$/i; // the types the tools ship (as STOCK_AGENT in server.js, with the lead's main and Codex's roles): not names, so agent.png or explore.png stays a picture for anyone
|
|
644
|
+
const agentKeys = (a) => (a ? [!STOCK_TYPE.test(String(a.type || '').split(':').pop()) && a.type, a.own && a.own.replace(/ \d+$/, '')] : []).map(charKey).filter(Boolean); // its type (.claude/agents/qa.md) and the name it was launched with; "Qa 2", the second of its name, is still qa
|
|
645
|
+
const wears = (c, keys) => { const s = c.key || (c.key = charKey(c.name)), m = s.match(/^(.+)-(\d+|[a-z])$/); return keys.has(s) || !!(m && keys.has(m[1])); }; // qa.png, and qa-2.png or qa-f.png for other looks of the same agent; qa-lead.png is a character of its own
|
|
646
|
+
const customFor = (id, a = S.agents[id]) => { // sub-agents: an image named after the agent; otherwise the best-hashed image no other agent holds; the whole pool again only once every image is taken
|
|
626
647
|
if (id === 'main') return CHARS.lead; if (id === 'user') return CHARS.you; if (!CHARS.pool.length) return null;
|
|
627
|
-
const
|
|
628
|
-
const
|
|
629
|
-
|
|
648
|
+
const others = Object.keys(S.agents).filter((k) => k !== id), used = new Set(others.filter((k) => S.agents[k].custom).map((k) => S.agents[k].custom.name)), pick = (l) => l.reduce((b, c) => (hash(id + '|' + c.name) > hash(id + '|' + b.name) ? c : b)); // by the character's name, not its picture: a pack drawn again gives each agent the same character
|
|
649
|
+
const keys = new Set(agentKeys(a)), mine = keys.size ? CHARS.pool.filter((c) => wears(c, keys)) : [];
|
|
650
|
+
if (mine.length) { const f = mine.filter((c) => !used.has(c.name)); return pick(f.length ? f : mine); } // its own picture even when another agent of the same name wears it: two QAs both look like the QA
|
|
651
|
+
const theirs = new Set([...others.map((k) => S.agents[k]), ...(S.soon || []).filter((x) => x.id !== id)].flatMap(agentKeys)), left = CHARS.pool.filter((c) => !wears(c, theirs)), pool = left.length ? left : CHARS.pool; // nor does an agent without one take the picture of another agent in the call, or of one arriving with it (S.soon: a call opened late knows its QA before the agents born earlier get their pictures)
|
|
652
|
+
const free = pool.filter((c) => !used.has(c.name)), varied = pool.filter((c) => c.extras && Object.keys(c.extras).some((k) => !/^sticker/.test(k))), from = free.length ? free : varied.length ? varied : pool; // varied: what the character itself wears (a hat, glasses), not the stickers of its laptop // every image taken: one that has extras (a hat, glasses…) is given again, since it does not look the same twice
|
|
653
|
+
return pick(from);
|
|
630
654
|
};
|
|
631
655
|
// ---- the shop: a pack that is sold. The page never sees a card: the button asks the app's server for a payment page (Stripe's, through the website), opens it, and then asks for the pack until it is paid
|
|
632
656
|
const shopSay = (t) => { const m = $('#shopMsg'); if (m) m.textContent = t; };
|
|
@@ -698,10 +722,14 @@ async function openChars() { // ⚙ → Characters: the whole cast (drawn, a p
|
|
|
698
722
|
}
|
|
699
723
|
function renderFolder(el, mine) { // one's own pictures: where they are, a button per role to add one, and the ones there, each with a way to take it out (moved aside, never deleted)
|
|
700
724
|
const role = (c) => (c.role === 'lead' ? L('Chef', 'Lead') : c.role === 'you' ? L('Vous', 'You') : L('Sous-agent', 'Sub-agent'));
|
|
725
|
+
const subs = Object.values(S.agents).filter((p) => p.id !== 'main' && p.id !== 'user' && !p.twin), on = (c) => (CHARS.pack === 'folder' && c.role === 'agent' ? subs.filter((p) => p.custom && p.custom.name === c.stem).map((p) => p.name) : []); // who wears each picture now, while the folder is the cast
|
|
726
|
+
const pics = mine.chars.filter((c) => c.role === 'agent').map((c) => ({ name: c.stem })), want = [...new Set(subs.map((p) => !STOCK_TYPE.test(String(p.type || '').split(':').pop()) && charKey(p.type)).filter(Boolean))].filter((k) => !pics.some((c) => wears(c, new Set([k])))); // the agent types of the call (.claude/agents/qa.md) with no picture of their own yet: the file name to draw. Not the names agents were launched with, which change from one session to the next
|
|
727
|
+
const worn = (c) => { const w = on(c); return w.length ? ' → ' + esc(w.slice(0, 3).join(', ') + (w.length > 3 ? ' +' + (w.length - 3) : '')) : ''; };
|
|
701
728
|
el.innerHTML = `${esc(L('Vos images sont dans ce dossier :', 'Your pictures are in this folder:'))} <code style="word-break:break-all">${esc(mine.dir || CHARS.dir || '')}</code>
|
|
702
729
|
<div class="slots">${[['you', L('Vous', 'You')], ['lead', L('Chef', 'Lead')], ['agent', L('Sous-agents', 'Sub-agents')]].map(([r, t]) => `<div class="slot"><b>${esc(t)}</b><button class="btn" data-add="${r}">${esc(r === 'agent' ? L('Ajouter des images', 'Add pictures') : L('Choisir une image', 'Choose a picture'))}</button>${r !== 'agent' ? `<button class="btn" data-add="${r}-talk">${esc(L('Bouche ouverte (facultatif)', 'Open mouth (optional)'))}</button>` : ''}</div>`).join('')}</div>
|
|
703
|
-
<div class="mine">${mine.chars.length ? mine.chars.map((c) => `<span class="chip"><img src="/characters/${encodeURIComponent(c.file)}" alt="">${esc(c.stem)} · ${esc(role(c))}<button class="ic" data-rm="${esc(c.file)}" aria-label="${esc(L('Retirer', 'Remove'))}" title="${esc(L('Retirer', 'Remove'))}">✕</button></span>`).join('') : esc(L('Aucune image pour l’instant.', 'No picture yet.'))}</div>
|
|
704
|
-
<p class="dim" style="margin:8px 0 0;font-size:11.5px">${esc(L('lead.png = le chef · you.png = vous · les autres = les sous-agents · nom-talk.png = bouche ouverte', 'lead.png = the lead · you.png = you · others = the sub-agents · name-talk.png = open mouth'))}</p>
|
|
730
|
+
<div class="mine">${mine.chars.length ? mine.chars.map((c) => `<span class="chip"><img src="/characters/${encodeURIComponent(c.file)}" alt="">${esc(c.stem)} · ${esc(role(c))}${worn(c)}<button class="ic" data-rm="${esc(c.file)}" aria-label="${esc(L('Retirer', 'Remove'))}" title="${esc(L('Retirer', 'Remove'))}">✕</button></span>`).join('') : esc(L('Aucune image pour l’instant.', 'No picture yet.'))}</div>
|
|
731
|
+
<p class="dim" style="margin:8px 0 0;font-size:11.5px">${esc(L('lead.png = le chef · you.png = vous · les autres = les sous-agents · nom-talk.png = bouche ouverte', 'lead.png = the lead · you.png = you · others = the sub-agents · name-talk.png = open mouth'))}<br>${esc(L('qa.png = le sous-agent nommé qa (.claude/agents/qa.md) · qa-2.png = un autre de ses visages', 'qa.png = the sub-agent named qa (.claude/agents/qa.md) · qa-2.png = another look of it'))}</p>
|
|
732
|
+
${want.length ? `<p class="dim" style="margin:6px 0 0;font-size:11.5px">${esc(L('Dans cet appel, sans image à leur nom : ', 'In this call, without a picture of their own: '))}${want.map((k) => `<code>${esc(k)}.png</code>`).join(', ')}</p>` : ''}
|
|
705
733
|
<div style="display:flex;gap:6px;margin-top:8px"><button class="btn" id="charReload">${esc(L('Recharger', 'Reload'))}</button>${EMBED ? `<button class="btn" id="charOpen">${esc(L('Ouvrir le dossier', 'Open folder'))}</button>` : ''}</div>
|
|
706
734
|
<div id="shopMsg" role="status" style="margin-top:6px"></div><input type="file" id="charFile" accept="image/png,image/gif,image/webp,image/jpeg" hidden>`;
|
|
707
735
|
const inp = $('#charFile'), post = (p, b) => fetch(p, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(b) }).then((r) => r.json()).catch(() => ({ error: 'write' }));
|
|
@@ -724,7 +752,7 @@ function packNote() { // the Halloween pack, to someone without it, twice a se
|
|
|
724
752
|
: 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.');
|
|
725
753
|
$('#packNoteB').textContent = L('Voir le pack', 'See the pack') + ' · ' + price;
|
|
726
754
|
}
|
|
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
|
|
755
|
+
function persona(a) { const p = persona0(a); p.custom = customFor(p.twin ? 'main' : a.id, p); return p; } // a fork wears the lead's own picture too
|
|
728
756
|
// 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
757
|
// 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
758
|
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);
|
|
@@ -810,7 +838,7 @@ function avatarSVG(p, o, uid = '') { // uid keeps SVG ids unique per instance:
|
|
|
810
838
|
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);
|
|
811
839
|
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];
|
|
812
840
|
const V = (cls, show, html) => (st ? (show ? html : '') : `<g class="${cls}">${html}</g>`);
|
|
813
|
-
const d0 = -((hash(p.id) % 45) / 10);
|
|
841
|
+
const d0 = -((hash(p.id) % 45) / 10), bd = 4 + ((hash(p.id) >>> 4) % 15) / 10, kd = 4 + ((hash(p.id) >>> 9) % 21) / 10; // its own breathing (4 to 5.4 s) and blinking (4 to 6 s): a full call does not move in step
|
|
814
842
|
const eye = (x) => `<g class="eye"><ellipse cx="${x}" cy="${fy}" rx="${eg.rx}" ry="${eg.ry}" fill="${ink}"/><g class="pupil"><circle cx="${x + 1}" cy="${fy - 1.5}" r="1.1" fill="#fff"/><circle cx="${x - 1}" cy="${fy + 1.4}" r=".55" fill="#fff" opacity=".7"/></g></g>`;
|
|
815
843
|
const happy = (x) => `<path d="M${x - 3.6} ${fy + 1.4}Q${x} ${fy - 4.2} ${x + 3.6} ${fy + 1.4}" fill="none" stroke="${ink}" stroke-width="1.7" stroke-linecap="round"/>`;
|
|
816
844
|
const brow = (x, s) => `<path class="brow ${s}" d="M${x - 3.6} ${fy - eg.ry - 3}q3.6-2 7.2 0" fill="none" stroke="${ink}" stroke-width="1.4" stroke-linecap="round"/>`;
|
|
@@ -822,13 +850,13 @@ function avatarSVG(p, o, uid = '') { // uid keeps SVG ids unique per instance:
|
|
|
822
850
|
${V('mouth', speaking, `<ellipse class="mouthE" cx="50" cy="${my + 1}" rx="${mopen ? 4 : 4.6}" ry="${mopen ? 4.4 : .9}" fill="${bot ? '#8ff0ff' : '#4b1c2c'}"/>`)}
|
|
823
851
|
${p.glasses ? `<g fill="rgba(255,255,255,.16)" stroke="#2c2f40" stroke-width="1.1"><circle cx="${ex[0]}" cy="${fy}" r="6.2"/><circle cx="${ex[1]}" cy="${fy}" r="6.2"/><path d="M${ex[0] + 6.2} ${fy}h${ex[1] - ex[0] - 12.4}" fill="none"/></g>` : ''}`;
|
|
824
852
|
const acc = ACC[p.acc](top, p.acc2, fy, sh.hw) + (p.lead ? `<path d="M${50 - sh.hw} ${fy + 5}q-2 11 13 12" fill="none" stroke="#2c2f40" stroke-width="1.2" stroke-linecap="round"/><circle cx="${50 - sh.hw + 13}" cy="${fy + 17}" r="1.9" fill="#2c2f40"/>` : '');
|
|
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>`;
|
|
853
|
+
const arm = (side) => `<g class="arm ${side}"${working ? ` transform="rotate(${side === 'l' ? -24 : 24} ${side === 'l' ? 27 : 73} 48)"` : ''}><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>`;
|
|
826
854
|
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"/>`,
|
|
827
855
|
`<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>`,
|
|
828
856
|
`<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 */
|
|
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}"
|
|
857
|
+
const lap = `<g class="lid"><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}"/></g><rect x="29.5" y="63.4" width="41" height="3" rx="1.5" fill="#aab1c2"/>`;
|
|
830
858
|
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
|
|
831
|
-
const hands = `<circle class="hand l" cx="
|
|
859
|
+
const hands = `<circle class="hand l" cx="32.7" cy="59.8" r="3.1" fill="${c2}"/><circle class="hand r" cx="67.3" cy="59.8" r="3.1" fill="${c2}"/>`; // on the keyboard, behind the lid we see from the back: only their outer sides show
|
|
832
860
|
const sparks = star(22, 28, 3) + star(78, 22, 2.6, '#ff9bb8') + star(70, 40, 1.9, '#9be7ff') + star(30, 46, 1.6, '#ffe58a');
|
|
833
861
|
const custFig = (c, talking, who) => { const base = c.full ? 'width="100" height="75" preserveAspectRatio="xMidYMid slice"' : 'x="20" y="6" width="60" height="58" preserveAspectRatio="xMidYMax meet"', px = c.smooth ? '' : 'image-rendering:pixelated;';
|
|
834
862
|
const worn = c.extras ? Object.keys(c.extras).filter((k) => !/^sticker/.test(k)).map((k) => { const n = c.extras[k].length, i = hash(who + '+' + k) % (2 * n); return i < n ? `<image href="${c.extras[k][i]}" ${base} style="${px}"/>` : ''; }).join('') : ''; // one of each kind, or none, half of the time: always the same for a given agent
|
|
@@ -848,12 +876,12 @@ function avatarSVG(p, o, uid = '') { // uid keeps SVG ids unique per instance:
|
|
|
848
876
|
<linearGradient id="${uid}dk${p.scene}" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="${sc.desk[0]}"/><stop offset="1" stop-color="${sc.desk[1]}"/></linearGradient>
|
|
849
877
|
<linearGradient id="${uid}lg" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#fff"/><stop offset="1" stop-color="#fff" stop-opacity="0"/></linearGradient></defs>
|
|
850
878
|
${room ? `<clipPath id="${room}c"><rect y="62" width="100" height="13"/></clipPath><image id="${room}" href="${p.custom.bg}" width="100" height="75" preserveAspectRatio="xMidYMid slice"${p.custom.bgSmooth ? '' : ' style="image-rendering:pixelated"'}/>` : sc.svg().replace(/id="(g[a-z]\d)"/g, `id="${uid}$1"`).replace(/url\(#(g[a-z]\d)\)/g, `url(#${uid}$1)`)}
|
|
851
|
-
<g class="fig${p.custom && p.custom.head ? ' still' : ''}" style="--d:${d0}s">
|
|
879
|
+
<g class="fig${p.custom && p.custom.head ? ' still' : ''}" style="--d:${d0}s;--bd:${bd}s;--kd:${kd}s">
|
|
852
880
|
${fig}
|
|
853
881
|
</g>
|
|
854
882
|
${p.custom ? custFront(p.custom, uid + 'hd' + p.gid, p.id || p.gid) : ''}
|
|
855
883
|
${room ? `<use href="#${room}" clip-path="url(#${room}c)"/>` : `<rect y="62" width="100" height="13" fill="url(#${uid}dk${p.scene})"/><rect y="62" width="100" height="1.3" fill="#fff" opacity=".38"/><rect y="63.3" width="100" height="2.6" fill="#000" opacity=".1"/>`}
|
|
856
|
-
${room ? '' : prop}${p.custom ? (prefs.customLaptop && !(p.custom.desks && p.custom.desks.length) ? V('laptop', working, lapDark) : '') : V('
|
|
884
|
+
${room ? '' : prop}${p.custom ? (prefs.customLaptop && !(p.custom.desks && p.custom.desks.length) ? V('laptop', working, lapDark) : '') : V('hands', working, hands) + V('laptop', working, lap)}${V('sparks', done, `<g class="sparks">${sparks}</g>`)}
|
|
857
885
|
</svg>`;
|
|
858
886
|
}
|
|
859
887
|
|
|
@@ -977,6 +1005,7 @@ function updateHint() {
|
|
|
977
1005
|
const AUD = {
|
|
978
1006
|
ctx: null, muted: false, live: new Set(), lastClick: 0,
|
|
979
1007
|
off() { return this.muted || !!S.hush || !!(S.owner && S.owner !== CID); }, // muted here, not turned on yet (S.hush: no click since the page opened), or another window holds the sound
|
|
1008
|
+
calm() { return this.off() || !!prefs.zen; }, // zen mode: the alerts (done, needs you, a knock) still chime; voices, ambience, music and reaction pops are silent
|
|
980
1009
|
init() {
|
|
981
1010
|
if (this.ctx) { this.ctx.resume(); return; }
|
|
982
1011
|
let c; try { c = this.ctx = new (window.AudioContext || window.webkitAudioContext)(); } catch { return; }
|
|
@@ -988,10 +1017,10 @@ const AUD = {
|
|
|
988
1017
|
const src = c.createBufferSource(); src.buffer = buf; src.loop = true; const lp = c.createBiquadFilter(); lp.type = 'lowpass'; lp.frequency.value = 500;
|
|
989
1018
|
const g = c.createGain(); g.gain.value = 0.3; src.connect(lp).connect(g).connect(this.sfx); src.start(); this.apply(); OFFICE.start();
|
|
990
1019
|
},
|
|
991
|
-
apply() { if (!this.ctx) return; this.sfx.gain.value = prefs.office && !this.
|
|
1020
|
+
apply() { if (!this.ctx) return; this.sfx.gain.value = prefs.office && !this.calm() ? 1 : 0; this.voice.gain.value = prefs.voice && !this.calm() ? (prefs.voiceVol ?? 1) : 0; this.applyMusic(); RADIO.sync(); },
|
|
992
1021
|
// Music fades down quickly when an agent starts talking and comes back slowly once the room is quiet.
|
|
993
|
-
applyMusic() { if (!this.ctx) return; this.amb.gain.setTargetAtTime((this.ducked ? 0.35 : 1) * (prefs.officeVol ?? 0.8), this.ctx.currentTime, 0.25); const v = prefs.music && !this.
|
|
994
|
-
blip(f) { if (!this.ctx || this.
|
|
1022
|
+
applyMusic() { if (!this.ctx) return; this.amb.gain.setTargetAtTime((this.ducked ? 0.35 : 1) * (prefs.officeVol ?? 0.8), this.ctx.currentTime, 0.25); const v = prefs.music && !this.calm() ? (prefs.musicVol ?? 0.35) * (this.ducked ? 0.16 : 1) : 0; this.music.gain.setTargetAtTime(v, this.ctx.currentTime, this.ducked ? 0.12 : 0.7); },
|
|
1023
|
+
blip(f) { if (!this.ctx || this.calm()) return; const c = this.ctx, t = c.currentTime, o = c.createOscillator(), g = c.createGain(); o.type = 'sine'; o.frequency.setValueAtTime(f, t); o.frequency.exponentialRampToValueAtTime(f * 1.5, t + 0.1); g.gain.setValueAtTime(0.0001, t); g.gain.exponentialRampToValueAtTime(0.12, t + 0.015); g.gain.exponentialRampToValueAtTime(0.0001, t + 0.22); o.connect(g).connect(c.destination); o.start(t); o.stop(t + 0.25); },
|
|
995
1024
|
alert() { // a soft two-note chime for "your agents are done"; separate from the office sounds so it works with ambience off
|
|
996
1025
|
if (!this.ctx || this.off()) return; const c = this.ctx;
|
|
997
1026
|
[[784, 0], [1047, 0.16], [1319, 0.32]].forEach(([f, w]) => { const t = c.currentTime + w, o = c.createOscillator(), g = c.createGain(); o.type = 'sine'; o.frequency.value = f; g.gain.setValueAtTime(0.0001, t); g.gain.exponentialRampToValueAtTime(0.16, t + 0.02); g.gain.exponentialRampToValueAtTime(0.0001, t + 0.9); o.connect(g).connect(c.destination); o.start(t); o.stop(t + 0.95); });
|
|
@@ -1006,6 +1035,10 @@ const AUD = {
|
|
|
1006
1035
|
const c = this.ctx, n = c.sampleRate * 0.03, b = c.createBuffer(1, n, c.sampleRate), d = b.getChannelData(0); for (let i = 0; i < n; i++) d[i] = (Math.random() * 2 - 1) * (1 - i / n);
|
|
1007
1036
|
const s = c.createBufferSource(); s.buffer = b; const hp = c.createBiquadFilter(); hp.type = 'highpass'; hp.frequency.value = 1800 + Math.random() * 1500; const g = c.createGain(); g.gain.value = 0.18; s.connect(hp).connect(g).connect(this.sfx); s.start();
|
|
1008
1037
|
},
|
|
1038
|
+
need() { // an agent needs you (a question, a permission, a plan): two quick bright double notes, sharper than the soft chime of "done", so the ear tells them apart without looking
|
|
1039
|
+
if (!this.ctx || this.off()) return; const c = this.ctx;
|
|
1040
|
+
[[1175, 0], [1568, 0.11], [1175, 0.34], [1568, 0.45]].forEach(([f, w]) => { const t = c.currentTime + w, o = c.createOscillator(), g = c.createGain(); o.type = 'triangle'; o.frequency.value = f; g.gain.setValueAtTime(0.0001, t); g.gain.exponentialRampToValueAtTime(0.2, t + 0.01); g.gain.exponentialRampToValueAtTime(0.0001, t + 0.22); o.connect(g).connect(c.destination); o.start(t); o.stop(t + 0.25); });
|
|
1041
|
+
},
|
|
1009
1042
|
join() { this.tone(523, .14, 'triangle', .1); this.tone(784, .2, 'triangle', .1, .12); },
|
|
1010
1043
|
knock() { // someone at the door: a visitor from another session. Like the chime above, it is heard with the ambience off
|
|
1011
1044
|
if (!this.ctx || this.off()) return; const c = this.ctx;
|
|
@@ -1025,7 +1058,7 @@ const AUD = {
|
|
|
1025
1058
|
// Office ambience, all synthesised (no audio files): keyboards that follow real activity, a coffee machine, and small room noises.
|
|
1026
1059
|
const OFFICE = {
|
|
1027
1060
|
nb: null, ty: [0, 1, 2].map(() => ({ n: 0, at: 0, pan: 0 })), pt: 0, prev: 0, nextCoffee: 22000, nextMisc: 9000, timer: null,
|
|
1028
|
-
ok() { return AUD.ctx && prefs.office && !AUD.
|
|
1061
|
+
ok() { return AUD.ctx && prefs.office && !AUD.calm() && S.playing; },
|
|
1029
1062
|
noise() { const c = AUD.ctx; if (!this.nb) { this.nb = c.createBuffer(1, c.sampleRate * 2, c.sampleRate); const d = this.nb.getChannelData(0); for (let i = 0; i < d.length; i++) d[i] = Math.random() * 2 - 1; } return this.nb; },
|
|
1030
1063
|
out(pan) { const c = AUD.ctx; if (!c.createStereoPanner) return AUD.amb; const p = c.createStereoPanner(); p.pan.value = pan; p.connect(AUD.amb); return p; },
|
|
1031
1064
|
hit(t, out, o) { // one short filtered noise burst (+ optional low thump): the building block of keys, clicks, doors, paper
|
|
@@ -1093,7 +1126,7 @@ const RADIO = { // live web radio through WebAudio (so it can be faded when ag
|
|
|
1093
1126
|
a.addEventListener('error', () => { this.err = !!this.cur; updateHint(); }); a.addEventListener('playing', () => { this.err = false; updateHint(); });
|
|
1094
1127
|
AUD.ctx.createMediaElementSource(a).connect(AUD.music);
|
|
1095
1128
|
}
|
|
1096
|
-
const want = prefs.music && !AUD.
|
|
1129
|
+
const want = prefs.music && !AUD.calm(), url = (STATIONS.find((s) => s.id === prefs.station) || STATIONS[0]).url;
|
|
1097
1130
|
if (want) { if (this.cur !== url) { this.cur = url; this.err = false; this.el.src = url; } if (this.el.paused) this.el.play().catch(() => {}); }
|
|
1098
1131
|
else if (this.cur) { this.cur = null; this.el.pause(); this.el.removeAttribute('src'); this.el.load(); } // stop downloading; it reconnects live next time
|
|
1099
1132
|
},
|
|
@@ -1159,7 +1192,7 @@ function paceAt(k) {
|
|
|
1159
1192
|
return { hurry, pace: Math.min(q > 7 ? 70 : q > 3 ? 130 : 260, lg > 30 ? 70 : lg > 15 ? 130 : lg > 6 ? 200 : 260), boost: hurry || S.events.length - k > 60 ? 3 : 1 };
|
|
1160
1193
|
}
|
|
1161
1194
|
function warmTTS(i) { // called by run() before each line (i is that line) and when new events arrive (i is the first of them)
|
|
1162
|
-
if (!TTS.server || !AUD.ctx || AUD.
|
|
1195
|
+
if (!TTS.server || !AUD.ctx || AUD.calm() || !prefs.voice || babbles()) return;
|
|
1163
1196
|
const fresh = i <= S.idx, from = fresh ? i : S.idx + 1, len = S.events.length, jobs = []; let n = 0; if (!fresh && !S.playing) return; // new events while a line is being read: the lines after it are planned again, they may now be read shorter and faster
|
|
1164
1197
|
for (let k = from; k < Math.min(len, from + 400) && n < 4;) {
|
|
1165
1198
|
const e = S.events[k]; if (quiet(e)) { k++; continue; }
|
|
@@ -1322,7 +1355,7 @@ function sessVoice(text, ev) { // for the lines that come from the session (ev
|
|
|
1322
1355
|
}
|
|
1323
1356
|
async function speakLine(text, p, primary, token, lo = voiceLang(text), always = false) { // always: your own lines are voiced even when the call is behind
|
|
1324
1357
|
captionRun(p.id, text, estMs(text));
|
|
1325
|
-
if (AUD.
|
|
1358
|
+
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)); }
|
|
1326
1359
|
if (S.hurry && !always) return sleep(estMs(text));
|
|
1327
1360
|
const bab = babbles(); if (bab && AUD.ctx) { try { await speakBabble(text, p, primary ? 1 : 0.5, token); return; } catch {} }
|
|
1328
1361
|
if (!bab && TTS.server && AUD.ctx) { try { await speakServer(text, p, primary ? 1 : 0.5, token, lo); return; } catch {} }
|
|
@@ -1421,6 +1454,7 @@ function syncUI() {
|
|
|
1421
1454
|
$('#bPlay').textContent = S.playing ? '⏸' : '▶';
|
|
1422
1455
|
paintPill(); paintTabs();
|
|
1423
1456
|
document.body.classList.toggle('replay', !S.live);
|
|
1457
|
+
sayCheck();
|
|
1424
1458
|
}
|
|
1425
1459
|
|
|
1426
1460
|
// ---------- tool ticker, shared screen, flying messages ----------
|
|
@@ -1598,8 +1632,9 @@ function paintStates() {
|
|
|
1598
1632
|
STATE_CLASSES.forEach((c) => t.classList.toggle(c, st.k === c && !(c === 'done' && st.stop))); /* stopped by the usage limit or a logout: resting, not the happy face and sparkles of done */
|
|
1599
1633
|
const el = t.querySelector('.status'); if (el.textContent !== st.txt) { el.textContent = st.txt; const tb = t.querySelector('.tbadge'); if (tb) tb.style.top = el.offsetHeight > 26 ? el.offsetTop + el.offsetHeight + 4 + 'px' : ''; } /* a status on two lines: the badges under it move down */ const go = st.k === 'blocked' && st.sure ? L('Cliquez pour aller répondre', 'Click to go and answer') : ''; if (el.title !== go) el.title = go; const sc = 'status ' + st.k + (isTurn(p.id, st) ? ' turn' : '') + (st.gave || st.stop ? ' gave' : ''); if (el.className !== sc) el.className = sc;
|
|
1600
1634
|
const pr = t.querySelector('.prop'), want = { blocked: '✋', stalled: '😰', waiting: '⌛' }[st.k] || '', was = S.prevState[p.id]; // a raised hand, a sweat drop, an hourglass: the call metaphor for "needs you / stuck / waiting"
|
|
1635
|
+
if (was === 'working' && st.k !== 'working' && shown && !p.custom && !S.hold) oneShot(t, 'lidshut', 420); else if (st.k === 'working') t.classList.remove('lidshut'); /* the drawn cast closes its laptop rather than see it vanish */
|
|
1601
1636
|
const spot = S.spotted || (S.spotted = new Set()); if (st.k !== 'blocked' || !st.sure) spot.delete(p.id); else if (!spot.has(p.id) && shown && !S.gone.has(p.id) && !S.speakers.size && !(S.focusLock > Date.now())) { spot.add(p.id); setFocus(p.id); } // one that waits on you takes the spotlight once per wait, as soon as nobody talks (the speaker has it until then)
|
|
1602
|
-
if (st.k === 'done' && was && was !== 'done' && was !== 'idle') { pr.textContent = '🎉'; pr.className = 'prop cheer'; setTimeout(() => { if (pr.classList.contains('cheer')) { pr.textContent = ''; pr.className = 'prop'; } }, 1200); }
|
|
1637
|
+
if (st.k === 'done' && was && was !== 'done' && was !== 'idle') { pr.textContent = '🎉'; pr.className = 'prop cheer'; if (shown) oneShot(t, 'yay', 950); setTimeout(() => { if (pr.classList.contains('cheer')) { pr.textContent = ''; pr.className = 'prop'; } }, 1200); }
|
|
1603
1638
|
else if (!pr.classList.contains('cheer')) { if (pr.textContent !== want) pr.textContent = want; const pc = 'prop ' + (want ? st.k : ''); if (pr.className !== pc) pr.className = pc; }
|
|
1604
1639
|
if (shown && !S.gone.has(p.id)) ros.push({ p, st });
|
|
1605
1640
|
if (p.id === 'main' && st.k === 'done' && was && was !== 'done' && was !== 'idle' && S.live && S.playing) { S.wrap = was; if (Date.now() - (S.mainBusyAt || 0) > 45000) confetti(); if (S.mainBusyAt) coffeeAsk(S.mainBusyAt); } // the lead is done, its face says so: it always has a word for it (see wrapUp, which needs to know what it was doing just before), and confetti after a long turn
|
|
@@ -1619,6 +1654,35 @@ function fitBoard(force) { // the chips lose their words when they do not all
|
|
|
1619
1654
|
addEventListener('resize', () => fitBoard(true)); new ResizeObserver(() => requestAnimationFrame(() => fitBoard(true))).observe($('#board')); /* the room the chips have also changes when the texts beside them do (a title, a longer status) */
|
|
1620
1655
|
const RORDER = { blocked: 0, stalled: 1, working: 2, waiting: 3, idle: 4, done: 5 };
|
|
1621
1656
|
const TOOL = { _codex: 'Codex', _vibe: 'Vibe', _cowork: 'Cowork' }, leadTool = (p) => (p.id === 'main' && S.cur && TOOL[S.cur.proj] ? ' · ' + TOOL[S.cur.proj] : ''); // a session that is not a Claude Code one says which tool runs it: on its tab, and next to its lead, who has the same name in every call
|
|
1657
|
+
// ---------- the human's line: typed into the session's terminal through tmux (server: reply.js, off unless AGENT_STANDUP_REPLY=on) ----------
|
|
1658
|
+
const SAY = { name: '', why: '', draft: '' }; // draft: the id of the session the text in the field was started for
|
|
1659
|
+
let sayReq = 0; // the latest sayCheck request: an older answer arriving late is ignored
|
|
1660
|
+
const sayWhy = (w) => ({ none: L('Session fermée : rien ne peut recevoir le message', 'Session closed: nothing can receive the message'), notmux: L('Session lancée hors tmux : lancez-la dans tmux pour lui parler', 'Session started outside tmux: start it in tmux to talk to it'), tmux: L('tmux injoignable', 'tmux unreachable'), text: L('Message vide ou trop long (4000 caractères au plus)', 'Empty or too long message (4000 characters at most)'), token: L('Page périmée : rechargez-la', 'Stale page: reload it'), waiting: L('Claude attend votre réponse dans le terminal (un menu est ouvert) : répondez-y là-bas', 'Claude is waiting for your answer in the terminal (a menu is open): answer it there'), busy: L('Claude travaille : vous pourrez écrire quand il aura fini', 'Claude is working: you can write when it is done'), changed: L('La session a changé pendant l\'envoi : le texte est resté dans le terminal, sans Entrée', 'The session changed while sending: the text stayed in the terminal, without Enter'), peer: L('Refusé : seul l\'utilisateur qui a lancé Agent Standup peut écrire', 'Refused: only the user who started Agent Standup can write'), platform: L('Pour l\'instant, l\'envoi ne marche que sous Linux', 'Sending works only on Linux for now') }[w] || L('Envoi impossible', 'Could not send'));
|
|
1661
|
+
let sayTick = 0;
|
|
1662
|
+
const sayStatus = (msg, err) => { const s = $('#sayS'), n = ++sayTick; s.textContent = ''; s.classList.toggle('err', !!err); if (msg) requestAnimationFrame(() => { if (n === sayTick) s.textContent = msg; }); }; // clear then set on the next frame: a repeated identical message is announced again
|
|
1663
|
+
const sayGrow = () => { const f = $('#sayT'); f.style.height = 'auto'; f.style.height = Math.min(f.scrollHeight + 2, 96) + 'px'; };
|
|
1664
|
+
async function sayCheck() { // can the followed session hear us: asked when the session changes and every 5 s while live
|
|
1665
|
+
const on = !!window.REPLY_TOKEN && S.live && !S.demo && !!S.cur && !TOOL[S.cur.proj]; document.body.classList.toggle('can-say', on); if (!on) return;
|
|
1666
|
+
const id = S.cur.id, n = ++sayReq; if (SAY.id !== id) { SAY.id = id; SAY.name = ''; SAY.why = ''; $('#sayL').textContent = ''; $('#sayT').disabled = true; $('#sayB').disabled = true; sayStatus('', false); } // another session: never show the old recipient
|
|
1667
|
+
let r = { ok: false, why: 'tmux' }; try { r = await (await fetch('/api/reply?id=' + encodeURIComponent(id))).json(); } catch {}
|
|
1668
|
+
if (n !== sayReq || !S.cur || S.cur.id !== id) return;
|
|
1669
|
+
SAY.name = r.name || L('la session', 'the session'); $('#sayL').textContent = L('À ', 'To ') + SAY.name; $('#sayB').textContent = L('Envoyer', 'Send');
|
|
1670
|
+
const why = !r.ok ? r.why || r.error : r.status === 'idle' ? '' : r.status === 'waiting' ? 'waiting' : 'busy', can = !why; $('#sayT').disabled = !can; if (!$('#sayB').classList.contains('busy')) $('#sayB').disabled = !can; // only at the prompt: a permission menu (waiting) or one opening during a turn (busy) would take the line as its answer
|
|
1671
|
+
if (why) { if (SAY.why !== why) sayStatus(sayWhy(why), false); } else if (SAY.why) sayStatus('', false); SAY.why = why;
|
|
1672
|
+
}
|
|
1673
|
+
setInterval(sayCheck, 5000);
|
|
1674
|
+
$('#say').onsubmit = async (ev) => {
|
|
1675
|
+
ev.preventDefault(); const f = $('#sayT'), b = $('#sayB'), text = f.value.trim(); if (!text || b.disabled || !S.cur) return;
|
|
1676
|
+
if (SAY.draft && SAY.draft !== S.cur.id) { SAY.draft = S.cur.id; sayStatus(L('Destinataire changé : ', 'Recipient changed: ') + (SAY.name || L('la session', 'the session')) + L('. Appuyez encore sur Entrée pour le lui envoyer.', '. Press Enter again to send it there.'), true); return; } // the draft was started for another session: asked once before it goes to this one
|
|
1677
|
+
const id = S.cur.id, name = SAY.name; b.disabled = true; b.classList.add('busy'); let r;
|
|
1678
|
+
try { r = await (await fetch('/api/reply', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ id, text, token: window.REPLY_TOKEN }) })).json(); } catch { r = { error: 'net' }; }
|
|
1679
|
+
b.classList.remove('busy'); if (!S.cur || S.cur.id !== id) { if (r && (r.ok || r.error === 'changed') && f.value.trim() === text) { f.value = ''; SAY.draft = ''; sayGrow(); } sayCheck(); return; } // the call moved to another session meanwhile: sayCheck owns its state (button, status), the draft stays
|
|
1680
|
+
b.disabled = false;
|
|
1681
|
+
if (r && r.ok) { if (f.value.trim() === text) { f.value = ''; SAY.draft = ''; sayGrow(); } sayStatus(L('Envoyé à ', 'Sent to ') + name, false); } else { if (r && r.error === 'changed' && f.value.trim() === text) { f.value = ''; SAY.draft = ''; sayGrow(); } sayStatus(sayWhy(r && r.error), true); } // the typed text stays when it failed, except after changed: it is in the terminal prompt now, a second Send would type it again
|
|
1682
|
+
f.focus(); sayCheck();
|
|
1683
|
+
};
|
|
1684
|
+
$('#sayT').onkeydown = (e) => { if (e.key === 'Enter' && !e.shiftKey && !e.isComposing) { e.preventDefault(); $('#say').requestSubmit(); } }; // Shift+Enter: a new line, flattened by the server
|
|
1685
|
+
$('#sayT').oninput = () => { sayGrow(); SAY.draft = $('#sayT').value ? SAY.draft || (S.cur && S.cur.id) || '' : ''; };
|
|
1622
1686
|
const modelShort = (m) => { const v = String(m || ''); if (!v || v[0] === '<') return ''; const c = /(opus|sonnet|haiku|fable)[-_ ]?(\d{1,2})(?:[-.](\d{1,2})(?!\d))?(?!\d)/i.exec(v); const o = /claude-(\d)(?:-(\d))?-(opus|sonnet|haiku)/i.exec(v), cap = (w) => w[0].toUpperCase() + w.slice(1).toLowerCase(); if (o) return cap(o[3]) + ' ' + o[1] + (o[2] ? '.' + o[2] : ''); const g = /^gpt-(\d+(?:\.\d+)?[a-z]?)(?:-(.+))?$/i.exec(v.replace(/^.*\//, '').replace(/-\d{4}-?\d{2}-?\d{2}$/, '')); if (g) return ('GPT-' + g[1].toLowerCase() + (g[2] ? ' ' + g[2].split('-').map((w) => (/^(mini|nano)$/i.test(w) ? w.toLowerCase() : cap(w))).join(' ') : '')).slice(0, 24); /* Codex: gpt-6-pro → GPT-6 Pro, gpt-5.1-codex-max → GPT-5.1 Codex Max, gpt-5-mini → GPT-5 mini */ return c ? cap(c[1]) + ' ' + c[2] + (c[3] ? '.' + c[3] : '') : v.replace(/^.*\//, '').replace(/-\d{8}$/, '').slice(0, 24); }; /* older ids put the version first: claude-3-5-sonnet → Sonnet 3.5 */ // claude-haiku-4-5-20251001 → Haiku 4.5
|
|
1623
1687
|
const mixedModels = () => new Set(Object.keys(S.usage).filter((id) => S.agents[id] && S.model[id] && tokTotal(S.usage[id])).map((id) => modelShort(S.model[id])).filter(Boolean)).size > 1; // only then is the model worth a place next to the count
|
|
1624
1688
|
const effortWord = (e) => ({ low: L('faible', 'low'), medium: L('moyen', 'medium'), high: L('élevé', 'high'), xhigh: L('très élevé', 'extra high'), max: L('maximal', 'max') }[e] || e); // the effort Claude Code says it worked at (written since 2.1.275; nothing from older versions)
|
|
@@ -1674,7 +1738,7 @@ function setFav(color) {
|
|
|
1674
1738
|
const c = document.createElement('canvas'); c.width = c.height = 32; const g = c.getContext('2d'); try { g.drawImage(FAVI, 0, 0, 32, 32); } catch {} g.fillStyle = color; g.beginPath(); g.arc(24, 8, 8, 0, 7); g.fill(); g.strokeStyle = '#12131a'; g.lineWidth = 2; g.stroke(); l.href = c.toDataURL();
|
|
1675
1739
|
}
|
|
1676
1740
|
function updateTitle() {
|
|
1677
|
-
paintStates(); if (S.live && S.nBlocked && !S.wasBlocked && prefs.notify) { AUD.
|
|
1741
|
+
paintStates(); if (S.live && S.nBlocked && !S.wasBlocked && prefs.notify) { AUD.need(); const msg = L('Un agent attend peut-être votre feu vert ✋', 'An agent may be waiting for you ✋'); if (EMBED) window.parent.postMessage({ agentStandup: 'notify', text: msg }, '*'); else { try { if (document.hidden && 'Notification' in window && Notification.permission === 'granted') new Notification('Agent Standup', { body: msg }); } catch {} } } S.wasBlocked = S.nBlocked > 0;
|
|
1678
1742
|
let n = 0; for (const id in S.status) if (S.status[id] === 'working' && !S.gone.has(id)) n++;
|
|
1679
1743
|
if (S.live && S.agents.main && /^(working|waiting)$/.test(agentState('main', Date.now()).k)) n++; // the lead counts too: a session without sub-agents also ends
|
|
1680
1744
|
const need = S.live ? Math.max(S.nBlocked || 0, attnItems(Date.now()).filter((x) => x.sure).length) : 0; // the tab counts every session that needs you, not only this one's agents (a menu really open, as the red icon always did)
|
|
@@ -1747,7 +1811,7 @@ function setTicker(id, e) { // the strip on the tile: spinner while running, t
|
|
|
1747
1811
|
tk.classList.add('on'); if (running) { tk.classList.remove('flash'); void tk.offsetWidth; tk.classList.add('flash'); }
|
|
1748
1812
|
}
|
|
1749
1813
|
function tickTools(ev) {
|
|
1750
|
-
ev._n = ev.tools.length; const t = $('#t-' + ev.agent); if (!t) return; t.style.display = '';
|
|
1814
|
+
ev._n = ev.tools.length; const t = $('#t-' + ev.agent); if (!t) return; if (t.style.display === 'none') flip(() => (t.style.display = ''));
|
|
1751
1815
|
ev.tools.forEach((tool) => pushTerm(ev.agent, tool));
|
|
1752
1816
|
const buf = S.term[ev.agent], k = ev.tools[ev.tools.length - 1];
|
|
1753
1817
|
S.tc[ev.agent] = (S.tc[ev.agent] || 0) + ev.tools.length; S.lastTool[ev.agent] = k.name + ' ' + (k.arg || '').slice(-38);
|
|
@@ -2095,8 +2159,21 @@ addEventListener('click', (e) => { if ($('#fpop') && !e.target.closest('#fpop, #
|
|
|
2095
2159
|
addEventListener('keydown', (e) => { if (e.key === 'Escape' && $('#fpop')) { filesPop(false); const b = $('#fAll'); if (b) b.focus(); } });
|
|
2096
2160
|
// the speaker always gets the spotlight (and keeps it until someone else talks)
|
|
2097
2161
|
function setFocus(id) {
|
|
2098
|
-
if (S.focus === id) return; const o = $('#t-' + S.focus); if (o) o.classList.remove('focus'); S.focus = id; const t = $('#t-' + id);
|
|
2099
|
-
if (t
|
|
2162
|
+
if (S.focus === id) return; flip(() => { const o = $('#t-' + S.focus); if (o) o.classList.remove('focus'); S.focus = id; const t = $('#t-' + id); if (t) t.classList.add('focus'); });
|
|
2163
|
+
if ($('#t-' + id)) $('#stage').scrollTo({ top: 0, behavior: 'smooth' });
|
|
2164
|
+
}
|
|
2165
|
+
// the tiles slide to their new places instead of jumping there: a spotlight that moves, a tile that comes or goes. Not in a frozen moment (screenshots), while a replay is recomputed, in the compact rows, nor with reduced motion
|
|
2166
|
+
function flip(fn) {
|
|
2167
|
+
const b = document.body; if (S.hold || S.recomputing || document.hidden || reduced() || !Element.prototype.animate || b.classList.contains('compact') || b.classList.contains('tree') || b.classList.contains('board')) return fn();
|
|
2168
|
+
const was = new Map(); for (const t of $('#stage').children) if (t.classList.contains('tile') && t.style.display !== 'none') was.set(t, t.getBoundingClientRect()); /* where they are seen now, halfway through a slide included */
|
|
2169
|
+
for (const t of was.keys()) if (t._flip) { t._flip.cancel(); t._flip = null; }
|
|
2170
|
+
fn();
|
|
2171
|
+
for (const [t, a] of was) {
|
|
2172
|
+
if (t.style.display === 'none' || !a.width) continue; const r = t.getBoundingClientRect(); if (!r.width) continue;
|
|
2173
|
+
const dx = a.left + a.width / 2 - (r.left + r.width / 2), dy = a.top + a.height / 2 - (r.top + r.height / 2), sx = a.width / r.width, sy = a.height / r.height;
|
|
2174
|
+
if (Math.abs(dx) < 1 && Math.abs(dy) < 1 && Math.abs(sx - 1) < .02 && Math.abs(sy - 1) < .02) continue;
|
|
2175
|
+
try { const an = t.animate([{ transform: `translate(${dx}px,${dy}px) scale(${sx},${sy})` }, { transform: 'none' }], { duration: 340, easing: 'cubic-bezier(.25,.8,.3,1)', composite: 'add' }); t._flip = an; an.onfinish = () => { if (t._flip === an) t._flip = null; }; } catch {} /* add: on top of a pop or a join the tile may be doing */
|
|
2176
|
+
}
|
|
2100
2177
|
}
|
|
2101
2178
|
function fly(fromId, toId, emoji) {
|
|
2102
2179
|
const a = $('#t-' + fromId), b = $('#t-' + toId); if (!a || !b || document.body.classList.contains('tree')) return;
|
|
@@ -2131,7 +2208,7 @@ function vanish(id) {
|
|
|
2131
2208
|
toast(`${p.name} ${L('a quitté l’appel', 'left the call')} 👋`);
|
|
2132
2209
|
if (t.style.display === 'none' || document.body.classList.contains('tree')) return;
|
|
2133
2210
|
S.leaving.add(id); const say = prefs.banter && !S.hurry && !S.speakers.has(id), go = () => { t.classList.remove('bye'); if (!S.leaving.has(id)) return; t.classList.add('vanishing'); poof(t, p.shirt); AUD.tone(660, .35, 'sine', .07); AUD.tone(330, .5, 'sine', .06, .12);
|
|
2134
|
-
setTimeout(() => { S.leaving.delete(id); t.classList.remove('vanishing'); if (S.gone.has(id)) t.style.display = 'none'; }, 1250); };
|
|
2211
|
+
setTimeout(() => { S.leaving.delete(id); t.classList.remove('vanishing'); if (S.gone.has(id)) flip(() => (t.style.display = 'none')); }, 1250); };
|
|
2135
2212
|
if (say) { const b = t.querySelector('.bubble'), line = byeLine(id); b.innerHTML = `<small>👋</small>${esc(line)}`; t.classList.add('bye'); t._byeT = setTimeout(go, 1500); } else go(); // a short goodbye before the poof
|
|
2136
2213
|
}
|
|
2137
2214
|
setInterval(() => {
|
|
@@ -2146,16 +2223,20 @@ function startTalk(id, text, label) {
|
|
|
2146
2223
|
const t = $('#t-' + id); if (!t) return; endThought(id); stopMumble(); TH.next[id] = Math.max(TH.next[id] || 0, Date.now() + 8000); // a spoken line takes the bubble and the floor
|
|
2147
2224
|
if (S.present && S.present !== id) hidePresent();
|
|
2148
2225
|
S.spokeAt = performance.now(); S.fill = 0; S.mused = false;
|
|
2149
|
-
if (!S.speakers.size && !(S.focusLock > Date.now())) setFocus(id); S.gone.delete(id); if (S.doneAt[id] != null) S.doneAt[id] = S.clock; t.style.display = ''; t.classList.add('speaking'); S.speakers.add(id); S.say[id] = { text, label }; AUD.duck(true);
|
|
2226
|
+
if (!S.speakers.size && !(S.focusLock > Date.now())) setFocus(id); S.gone.delete(id); if (S.doneAt[id] != null) S.doneAt[id] = S.clock; if (t.style.display === 'none') flip(() => (t.style.display = '')); const fresh = !t.classList.contains('speaking'); t.classList.add('speaking'); if (fresh && !S.hold) { oneShot(t, 'inhale', 360); listen(id, text); } S.speakers.add(id); S.say[id] = { text, label }; AUD.duck(true);
|
|
2150
2227
|
const shown0 = pieces(text), first = shown0.length > 1 ? shown0[0] : text; const b = t.querySelector('.bubble'); b.innerHTML = (label ? `<small>${esc(label)}</small>` : '') + esc(first);
|
|
2151
2228
|
if (S.present === id) { $('#pcap').textContent = first; $('#pcam').classList.add('speaking'); }
|
|
2152
|
-
const m = t.querySelector('.mouthE'); let open = false; clearInterval(mouths.get(id));
|
|
2153
|
-
mouths.set(id, setInterval(() => {
|
|
2154
|
-
if (!m) { const ct = t.querySelector('.cimg-talk'); if (ct) { const lv0 = S.level[id], op = lv0 ? lv0() > 0.05 : (open = !open); ct.style.display = op ? '' : 'none'; t.querySelector('.cimg').style.display = op ? 'none' : ''; if (S.present === id) { const pc = $('#pcam .cimg-talk'), pi = $('#pcam .cimg'); if (pc && pi) { pc.style.display = op ? '' : 'none'; pi.style.display = op ? 'none' : ''; } } } return; } // custom character: swap between its two frames
|
|
2155
|
-
const pm = S.present === id ? $('#pcam .mouthE') : null, lv = S.level[id];
|
|
2156
|
-
|
|
2157
|
-
|
|
2229
|
+
const m = t.querySelector('.mouthE'); let open = false, lvS = 0, oS = 0, syl = 0, sylN = 0, sylA = 1, n = 0; clearInterval(mouths.get(id));
|
|
2230
|
+
mouths.set(id, setInterval(() => { // 25 times a second, the clock of the other moves (IDLE_ANIMS)
|
|
2231
|
+
n++; if (!m) { const ct = t.querySelector('.cimg-talk'); if (ct) { const lv0 = S.level[id], op = lv0 ? lv0() > 0.05 : n % 2 ? open : (open = !open); ct.style.display = op ? '' : 'none'; t.querySelector('.cimg').style.display = op ? 'none' : ''; if (S.present === id) { const pc = $('#pcam .cimg-talk'), pi = $('#pcam .cimg'); if (pc && pi) { pc.style.display = op ? '' : 'none'; pi.style.display = op ? 'none' : ''; } } } return; } // custom character: swap between its two frames
|
|
2232
|
+
const pm = S.present === id ? $('#pcam .mouthE') : null, lv = S.level[id]; let o;
|
|
2233
|
+
if (lv) { const v = lv(); lvS += (v - lvS) * (v > lvS ? .6 : .28); o = Math.min(1, lvS * 28 / 4.2); } /* opens fast, closes a little slower: a mouth, not a level meter */
|
|
2234
|
+
else { if (syl >= sylN) { syl = 0; sylN = 4 + Math.floor(Math.random() * 4); sylA = Math.random() < .12 ? 0 : .5 + Math.random() * .3; } o = sylA * Math.sin(Math.PI * syl++ / sylN); } /* no sound to follow: syllables of 160 to 280 ms, now and then a short pause */
|
|
2235
|
+
oS += (o - oS) * .55; o = oS; /* eased toward where it goes: no jump from one frame to the next */
|
|
2236
|
+
const ry = (.9 + 4.2 * o).toFixed(2), rx = (4.8 - .9 * o).toFixed(2); m.setAttribute('ry', ry); m.setAttribute('rx', rx); if (pm) { pm.setAttribute('ry', ry); pm.setAttribute('rx', rx); }
|
|
2237
|
+
}, 40));
|
|
2158
2238
|
if (document.body.classList.contains('tree')) renderTree();
|
|
2239
|
+
gaze();
|
|
2159
2240
|
}
|
|
2160
2241
|
|
|
2161
2242
|
function thought(id, em) { const t = $('#t-' + id); if (!t || t.style.display === 'none') return; const el = t.querySelector('.thought'); el.textContent = em; el.classList.remove('go'); void el.offsetWidth; el.classList.add('go'); }
|
|
@@ -2173,11 +2254,35 @@ function stopTalk(id) {
|
|
|
2173
2254
|
clearInterval(mouths.get(id)); mouths.delete(id); S.speakers.delete(id); if (!S.speakers.size) AUD.duck(false); if (S.focus === id && S.speakers.size) setFocus([...S.speakers][0]);
|
|
2174
2255
|
if (S.present === id) { $('#pcap').textContent = ''; $('#pcam').classList.remove('speaking'); const pm = $('#pcam .mouthE'); if (pm) { pm.setAttribute('ry', .9); pm.setAttribute('rx', 4.6); } }
|
|
2175
2256
|
const t = $('#t-' + id); if (!t) return;
|
|
2176
|
-
t.classList.remove('speaking'); const m = t.querySelector('.mouthE'); if (m) { m.setAttribute('ry', .9); m.setAttribute('rx', 4.6); }
|
|
2257
|
+
gaze(); t.classList.remove('speaking'); if (!S.recomputing && !S.hold) oneShot(t, 'settle', 400); const m = t.querySelector('.mouthE'); if (m) { m.setAttribute('ry', .9); m.setAttribute('rx', 4.6); }
|
|
2177
2258
|
const ct = t.querySelector('.cimg-talk'); if (ct) { ct.style.display = 'none'; t.querySelector('.cimg').style.display = ''; }
|
|
2178
2259
|
const pc = $('#pcam .cimg-talk'), pi = $('#pcam .cimg'); if (pc && pi && S.present === id) { pc.style.display = 'none'; pi.style.display = ''; }
|
|
2179
2260
|
}
|
|
2180
2261
|
const clearSpeaking = () => [...S.speakers].forEach(stopTalk);
|
|
2262
|
+
function gaze() { // the others turn their eyes to the one speaking, and back to the camera when the floor is free; measured where the tiles go (their layout, not where a slide shows them), so the eyes turn while the tiles move
|
|
2263
|
+
clearTimeout(gaze.t); gaze.t = setTimeout(() => {
|
|
2264
|
+
const box = (t) => ({ left: t.offsetLeft, top: t.offsetTop, width: t.offsetWidth, height: t.offsetHeight }), sp = [...S.speakers][0], st = sp && $('#t-' + sp), r = st && box(st);
|
|
2265
|
+
for (const t of document.querySelectorAll('#stage .tile')) { let x = 0, y = 0; if (r && r.width && t !== st) { const q = box(t), dx = r.left + r.width / 2 - (q.left + q.width / 2), dy = r.top + r.height / 2 - (q.top + q.height / 2), d = Math.hypot(dx, dy) || 1; x = dx / d; y = dy / d; } const lx = x.toFixed(2), ly = y.toFixed(2); if (t.style.getPropertyValue('--lx') !== lx) t.style.setProperty('--lx', lx); if (t.style.getPropertyValue('--ly') !== ly) t.style.setProperty('--ly', ly); }
|
|
2266
|
+
}, 60);
|
|
2267
|
+
}
|
|
2268
|
+
function oneShot(t, c, ms) { t.classList.remove(c); void t.offsetWidth; t.classList.add(c); clearTimeout(t['_' + c]); t['_' + c] = setTimeout(() => t.classList.remove(c), ms); } // a move of a character that plays once: its class, restarted, then taken off
|
|
2269
|
+
const LISTEN = { good: /(^|[^\p{L}\p{N}])(done|fixed|passe[sd]|passing|works|merged|shipped|terminée?s?|corrigée?s?|réglée?s?|réussie?s?|finie?s?)(?![\p{L}\p{N}])|✅|🎉/iu, bad: /(^|[^\p{L}\p{N}])(fail|fails|failed|failing|failure|errors?|broken|broke|crash|crashed|crashes|bugs?|échoue|échoué|échec|erreurs?|plante|cassée?)(?![\p{L}\p{N}])|❌/iu, at: {} };
|
|
2270
|
+
function listen(id, text) { // the others react once to a line: the one it names nods, a failure raises their eyebrows, good news gets a nod; each kind at most every 8 s, so a debugging session does not keep everyone's eyebrows up
|
|
2271
|
+
if (S.hold || S.recomputing || reduced() || !text) return; const s = String(text), now = Date.now(), cool = (k) => now - (LISTEN.at[k] || 0) > 8000;
|
|
2272
|
+
const bad = cool('bad') && LISTEN.bad.test(s), good = !bad && cool('good') && LISTEN.good.test(s); if (bad) LISTEN.at.bad = now; if (good) LISTEN.at.good = now;
|
|
2273
|
+
for (const p of Object.values(S.agents)) {
|
|
2274
|
+
if (p.id === id) continue; const t = $('#t-' + p.id); if (!t || t.style.display === 'none' || t.classList.contains('vanishing')) continue;
|
|
2275
|
+
const nm = p.id !== 'user' && p.name && p.name.length > 2 && new RegExp('(^|[^\\p{L}\\p{N}])' + p.name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + '(?![\\p{L}\\p{N}])', 'iu').test(s), c = nm || good ? 'nod1' : bad ? 'wow' : '';
|
|
2276
|
+
if (c) setTimeout(() => { if (!t.classList.contains('speaking')) oneShot(t, c, c === 'wow' ? 1150 : 800); }, 250 + Math.random() * 450);
|
|
2277
|
+
}
|
|
2278
|
+
}
|
|
2279
|
+
setInterval(() => { // now and then someone who only listens moves a little: a look away, a stretch. One at a time, never while it works or speaks
|
|
2280
|
+
if (!S.playing || document.hidden || S.hold || reduced() || Math.random() < .5) return;
|
|
2281
|
+
const idle = [...document.querySelectorAll('#stage .tile')].filter((t) => t.style.display !== 'none' && !t.matches('.speaking, .working, .vanishing, .bye, .yay, .nod1, .wow, .stretch')); if (!idle.length) return;
|
|
2282
|
+
const t = idle[Math.floor(Math.random() * idle.length)];
|
|
2283
|
+
if (!S.speakers.size && !t.classList.contains('done') && Math.random() < .6) { const a = Math.random() * Math.PI * 2; t.style.setProperty('--lx', Math.cos(a).toFixed(2)); t.style.setProperty('--ly', (Math.sin(a) * .6).toFixed(2)); clearTimeout(t._glance); t._glance = setTimeout(gaze, 1500); } /* gaze() brings the eyes back */
|
|
2284
|
+
else oneShot(t, 'stretch', 1300);
|
|
2285
|
+
}, 9000);
|
|
2181
2286
|
// =====================================================================
|
|
2182
2287
|
// inner thoughts: an agent that has been at work for a while thinks to itself, in a bubble it does not say. What it thinks is real: its own reasoning when the session kept it
|
|
2183
2288
|
// (rarely: Claude Code mostly stores a signature), otherwise what it is on right now (the command it waits for, the files it goes between, its to-do item, a failure, its task).
|
|
@@ -2234,7 +2339,7 @@ function endThought(id) {
|
|
|
2234
2339
|
const clearThoughts = () => { document.querySelectorAll('.tile.musing').forEach((t) => endThought(t.id.slice(2))); stopMumble(); };
|
|
2235
2340
|
function stopMumble() { const v = TH.voice; if (v) { TH.voice = null; try { v.src.stop(); } catch {} } }
|
|
2236
2341
|
async function mumble(id, text) { // lips closed: the mouth does not move, the music does not make room, and anyone who starts to speak cuts it
|
|
2237
|
-
const p = S.agents[id], t = $('#t-' + id); if (!p || !t || !prefs.voice || AUD.
|
|
2342
|
+
const p = S.agents[id], t = $('#t-' + id); if (!p || !t || !prefs.voice || AUD.calm() || !AUD.ctx || S.speakers.size || TH.voice) return;
|
|
2238
2343
|
if (!TTS.server || babbles()) { const o = AUD.murmur(0.5 + (p.vi % 5) / 10, Math.min(2.2, estMs(text) / 1000), 0.4); if (o) { TH.voice = { id, src: o }; o.addEventListener('ended', () => { if (TH.voice && TH.voice.src === o) TH.voice = null; }); } return; }
|
|
2239
2344
|
const voice = TTS.voiceFor(p, voiceLang(text)), token = S.token; if (!voice) return; let buf; try { buf = await TTS.buf(speakable(text), voice, TTS.rate(), true); } catch { return; } // made like a line prepared ahead: it never delays a real one
|
|
2240
2345
|
if (token !== S.token || S.speakers.size || TH.voice || !t.classList.contains('musing')) return; // someone spoke meanwhile, or the thought is gone
|
|
@@ -2903,7 +3008,7 @@ async function loadSession(proj, id) {
|
|
|
2903
3008
|
const data = await (await fetch(`/api/session?proj=${encodeURIComponent(proj)}&id=${id}`)).json();
|
|
2904
3009
|
if (mine !== S.loadN || data.error) return false;
|
|
2905
3010
|
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
|
|
3011
|
+
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]; S.soon = all; for (const a of byBorn(all)) S.agents[a.id] = persona(twinOf(a)); S.soon = null; 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
|
|
2907
3012
|
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();
|
|
2908
3013
|
const opt = $('#sessions').selectedOptions[0]; S.title = (S.live ? niceProj(proj) : opt && opt.dataset.title) || '';
|
|
2909
3014
|
if (proj === '_demo') S.events.forEach((e) => { if (e.fr) trMem.set(baseText(e), e.fr, 'fr'); }); // the demo ships its own French
|
|
@@ -2925,7 +3030,7 @@ async function followCurrent() {
|
|
|
2925
3030
|
if (S.cur && S.cur.id === cur.id && S.cur.proj === cur.proj) return false;
|
|
2926
3031
|
const key = cur.proj + '/' + cur.id, was = S.lastKey, moved = !!was && was !== key && !S.locked; if (moved) S.left[was] = Date.now(); // what was said of the session the call leaves is not said again when it comes back to it
|
|
2927
3032
|
if (!(await loadSession(cur.proj, cur.id))) return false;
|
|
2928
|
-
S.lastKey = key; if (moved) { const r = rowOf(cur); toast('↪ ' + (r ? tabName(r) : niceProj(cur.proj))); } paintTabs(); sessPoll();
|
|
3033
|
+
S.lastKey = key; if (moved) { const r = rowOf(cur); toast('↪ ' + (r ? tabName(r) : niceProj(cur.proj))); } paintTabs(); sessPoll(); sayCheck();
|
|
2929
3034
|
const start = liveStart(); if (!S.locked && !S.userPaused) run(start); return true;
|
|
2930
3035
|
}
|
|
2931
3036
|
// Live: a call starts when you join it. Only what happened since then, and was not said yet, is said (the last 16 events at most, when a session is picked up on the way);
|
|
@@ -2951,7 +3056,7 @@ function amend(e, was) { // the server corrected an event the call already has
|
|
|
2951
3056
|
let polling = false, polledAt = 0;
|
|
2952
3057
|
setInterval(async () => {
|
|
2953
3058
|
if (!S.live || polling) return;
|
|
2954
|
-
if (document.hidden && AUD.
|
|
3059
|
+
if (document.hidden && AUD.calm() && Date.now() - polledAt < 2500) return; // hidden and not heard (muted, zen, or another window has the sound): every 2.5 s is enough for the alerts; a call you listen to keeps its pace
|
|
2955
3060
|
polling = true; polledAt = Date.now();
|
|
2956
3061
|
try {
|
|
2957
3062
|
const switched = await followCurrent(); if (S.offline) { S.offline = false; syncUI(); }
|
|
@@ -2961,7 +3066,7 @@ setInterval(async () => {
|
|
|
2961
3066
|
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
|
|
2962
3067
|
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;
|
|
2963
3068
|
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
|
-
|
|
3069
|
+
S.soon = d.agents.filter((x) => !S.agents[x.id]); for (const a of byBorn(S.soon)) { S.agents[a.id] = persona(twinOf(a)); addTile(S.agents[a.id]); } S.soon = null; // several new at once: named in the order they started, as a reload names them
|
|
2965
3070
|
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
|
|
2966
3071
|
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 */
|
|
2967
3072
|
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); } }
|
|
@@ -3147,7 +3252,7 @@ function showVisit(v) { // the same face and name each time for a given sessio
|
|
|
3147
3252
|
}
|
|
3148
3253
|
function hideVisit() { clearTimeout(showVisit.t); S.visit = S.knock = null; const el = $('#visit'); if (el.className) { el.className = ''; el.innerHTML = ''; } }
|
|
3149
3254
|
async function visitSay(v, token) {
|
|
3150
|
-
if (S.visit !== v || AUD.
|
|
3255
|
+
if (S.visit !== v || AUD.calm() || !prefs.voice) return; const el = $('#visit'); el.classList.add('speaking'); AUD.duck(true);
|
|
3151
3256
|
await speakLine(v.line, v.p, true, token); el.classList.remove('speaking'); if (!S.speakers.size) AUD.duck(false);
|
|
3152
3257
|
}
|
|
3153
3258
|
$('#visit').onclick = (e) => { const v = S.visit; if (!v) return; if (e.target.closest('.vx')) hideVisit(); else { goSession(v.r.proj, v.r.id); answerAt(v.r); } };
|
|
@@ -3281,9 +3386,9 @@ function applyLang() {
|
|
|
3281
3386
|
}
|
|
3282
3387
|
const elsewhere = () => !!(S.owner && S.owner !== CID);
|
|
3283
3388
|
function applyMute() {
|
|
3284
|
-
const b = $('#bMute'); b.textContent = AUD.muted || S.hush ? '🔇' : elsewhere() ? '🔈' : '🔊';
|
|
3285
|
-
b.title = S.hush ? L('Le son s’active à votre premier clic dans l’appel', 'Sound turns on with your first click in the call') : elsewhere() ? L('Le son est joué dans une autre fenêtre — cliquer pour le reprendre ici', 'Sound is playing in another window — click to take it over here') : L('Son (touche M)', 'Sound (M key)');
|
|
3286
|
-
AUD.apply(); if (AUD.
|
|
3389
|
+
const b = $('#bMute'); b.textContent = AUD.muted || S.hush ? '🔇' : elsewhere() ? '🔈' : prefs.zen ? '🔔' : '🔊';
|
|
3390
|
+
b.title = S.hush ? L('Le son s’active à votre premier clic dans l’appel', 'Sound turns on with your first click in the call') : elsewhere() ? L('Le son est joué dans une autre fenêtre — cliquer pour le reprendre ici', 'Sound is playing in another window — click to take it over here') : prefs.zen ? L('Zen : seulement les alertes, sans les voix (touche M)', 'Zen: alerts only, no voices (M key)') : L('Son (touche M)', 'Sound (M key)');
|
|
3391
|
+
AUD.apply(); if (AUD.calm()) { synth && synth.cancel(); AUD.stopAll(); }
|
|
3287
3392
|
}
|
|
3288
3393
|
async function audioSync(claim) { // heartbeat + ownership: avoids two Agent Standup windows talking at the same time
|
|
3289
3394
|
try {
|
|
@@ -3293,7 +3398,7 @@ async function audioSync(claim) { // heartbeat + ownership: avoids two Agent S
|
|
|
3293
3398
|
}
|
|
3294
3399
|
const claimAudio = () => { S.owner = CID; applyMute(); audioSync(true); };
|
|
3295
3400
|
setInterval(() => audioSync(false), 1500);
|
|
3296
|
-
function toggleMute() { if (S.hush) return joinSound(); if (elsewhere()) { AUD.muted = false; claimAudio(); return; } AUD.muted =
|
|
3401
|
+
function toggleMute() { if (S.hush) return joinSound(); if (elsewhere()) { AUD.muted = false; claimAudio(); return; } if (AUD.muted) { AUD.muted = false; prefs.zen = false; } else if (prefs.zen) AUD.muted = true; else prefs.zen = true; savePrefs(); document.querySelectorAll('.mi[data-t="zen"] .sw').forEach((w) => w.classList.toggle('on', !!prefs.zen)); syncSwitches(); applyMute(); } // 🔊 everything → 🔔 zen (only the alerts) → 🔇 nothing
|
|
3297
3402
|
function setView(v) { prefs.view = v; savePrefs(); document.body.classList.toggle('tree', v === 'tree'); document.body.classList.toggle('board', v === 'board'); if (v === 'board') renderBoardView(); document.querySelectorAll('#viewSeg button').forEach((b) => b.classList.toggle('on', b.dataset.v === v)); renderTree(); }
|
|
3298
3403
|
|
|
3299
3404
|
$('#viewSeg').onclick = (e) => { const b = e.target.closest('button'); if (b) setView(b.dataset.v); };
|
|
@@ -3305,7 +3410,7 @@ setInterval(() => {
|
|
|
3305
3410
|
const busy = ids.filter((id) => agentState(id, Date.now()).k === 'working'), from = busy.length ? busy : ids, id = from[Math.floor(Math.random() * from.length)], t = $('#t-' + id);
|
|
3306
3411
|
LAP.id = id; t.classList.add('lap'); setTimeout(() => { t.classList.add('lapout'); setTimeout(() => { t.classList.remove('lap', 'lapout'); LAP.id = ''; }, 450); }, 7000 + Math.random() * 7000);
|
|
3307
3412
|
}, 5000);
|
|
3308
|
-
async function reloadChars() { await loadChars(); for (const k in imgCache) delete imgCache[k]; for (const id in S.agents) S.agents[id].custom = null; for (const id in S.agents) S.agents[id].custom = customFor(id); buildStage(); paintStatus(); packNote(); await renderCharInfo(); }
|
|
3413
|
+
async function reloadChars() { await loadChars(); for (const k in imgCache) delete imgCache[k]; for (const id in S.agents) S.agents[id].custom = null; for (const id in S.agents) S.agents[id].custom = customFor(S.agents[id].twin ? 'main' : id); buildStage(); paintStatus(); packNote(); await renderCharInfo(); }
|
|
3309
3414
|
$('#charPick').onclick = () => { $('#menu').classList.remove('on'); CHPICK.more = ''; openChars(); };
|
|
3310
3415
|
const packShut = () => { prefs.packOpen = false; savePrefs(); packNote(); voiceOffer(); };
|
|
3311
3416
|
$('#packNoteB').onclick = $('#packNoteI').onclick = () => { packShut(); CHPICK.more = 'halloween'; openChars(); };
|
|
@@ -3331,6 +3436,7 @@ function menuInit() {
|
|
|
3331
3436
|
}
|
|
3332
3437
|
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(); }
|
|
3333
3438
|
if (b.dataset.t === 'askCard') paintAsk(Date.now());
|
|
3439
|
+
if (b.dataset.t === 'zen') applyMute();
|
|
3334
3440
|
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) */
|
|
3335
3441
|
if (b.dataset.t === 'music') { $('#musicBox').style.display = prefs.music ? '' : 'none'; if (prefs.music) { AUD.init(); AUD.apply(); } } };
|
|
3336
3442
|
$('#menu').onclick = onSwitch; $('#prefs').onclick = (e) => { if (e.target === $('#prefs')) return closePrefs(); onSwitch(e); setTimeout(syncSwitches); };
|
|
@@ -3592,7 +3698,7 @@ setInterval(() => {
|
|
|
3592
3698
|
if (pos[k] !== S.idx) { delete pos[k]; pos[k] = S.idx; const ks = Object.keys(pos); while (ks.length > 40) delete pos[ks.shift()]; savePrefs(); }
|
|
3593
3699
|
}, 3000);
|
|
3594
3700
|
function openKeys() {
|
|
3595
|
-
const rows = [['Space', L('Pause / lecture', 'Pause / play')], ['← / →', L('Replay : événement précédent / suivant', 'Replay: previous / next event')], ['N / Shift+N', L('Replay : moment clé suivant / précédent', 'Replay: next / previous highlight')], ['M', L('Son
|
|
3701
|
+
const rows = [['Space', L('Pause / lecture', 'Pause / play')], ['← / →', L('Replay : événement précédent / suivant', 'Replay: previous / next event')], ['N / Shift+N', L('Replay : moment clé suivant / précédent', 'Replay: next / previous highlight')], ['M', L('Son : tout, zen (les alertes seules), coupé', 'Sound: all, zen (alerts only), off')], ['T', L('Vue arbre ↔ appel', 'Tree view ↔ call')], ['R', L('Récapitulatif', 'Recap')], ['L', L('Transcription', 'Transcript')], ['G', L('Aller à ce qui a besoin de vous (ici ou dans une autre session)', 'Go to what needs you (here or in another session)')], ['J / K', L('Agent suivant / précédent qui a besoin de vous', 'Next / previous agent that needs you')], ['Cmd / Ctrl + K', L('Aller à une session', 'Go to a session')], ['?', L('Cette aide', 'This help')], ['Esc', L('Fermer', 'Close')]];
|
|
3596
3702
|
$('#recap .box').innerHTML = `<h1>${L('Raccourcis clavier', 'Keyboard shortcuts')}</h1><table>${rows.map(([k, d]) => `<tr><td class="f"><b>${esc(k)}</b></td><td>${esc(d)}</td></tr>`).join('')}</table><h3>${L('Les états', 'What the states mean')}</h3><table>${[['⚙', L('au travail', 'working')], ['🔗', L('attend un autre agent', 'waiting on another agent')], ['✋', L('attend votre réponse ou votre feu vert (avec « ? » : sans doute, d’après le temps écoulé)', 'waits for your answer or approval (with “?”: probably, from how long it has waited)')], ['⚠', L('bloqué : un sous-agent est silencieux depuis longtemps', 'stalled: a sub-agent has been silent for a long time')], ['✓', L('terminé', 'done')]].map(([k, d]) => `<tr><td class="f">${k}</td><td>${esc(d)}</td></tr>`).join('')}</table><p class="dim" style="margin:14px 0 0;font-size:12px">${L('Les vues Appel, Arbre et Sessions se changent aussi en haut de la fenêtre.', 'You can also switch between Call, Tree and Sessions at the top of the window.')}</p><div style="margin-top:14px"><button class="btn" id="recapx">${L('Fermer', 'Close')}</button></div>`;
|
|
3597
3703
|
$('#recapx').onclick = () => $('#recap').classList.remove('on'); $('#recap').classList.add('on');
|
|
3598
3704
|
}
|