@double_geste/agent-standup 1.34.0 → 1.36.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/codex.js CHANGED
@@ -66,7 +66,8 @@ function sessions(limit = 80) {
66
66
  const out = []; for (const r of scan().rows) { const h = head(r.file); if (!h.ok || h.child) continue; out.push({ ...r, cwd: h.cwd, dir: h.dir }); if (out.length >= limit) break; }
67
67
  return out;
68
68
  }
69
- const inProject = (id, key) => { const r = row(id); if (!r || !key) return false; if (key === PROJ) return true; const d = head(r.file).dir; return d === key || d.startsWith(key + '-'); };
69
+ const under = (cwd, key) => { for (let d = String(cwd || ''); d;) { if (dirKey(d) === key) return true; const up = path.dirname(d); if (up === d) return false; d = up; } return false; }; // key is the folder itself or one above it: a dashed name alone cannot tell app/old (inside app) from app-old (beside it)
70
+ const inProject = (id, key) => { const r = row(id); if (!r || !key) return false; if (key === PROJ) return true; const h = head(r.file), d = h.dir; return d === key || (d.startsWith(key + '-') && under(h.cwd, key)); };
70
71
  const cwd = (id) => { const r = row(id); return r ? head(r.file).cwd : ''; }; // the folder the session was started in: where a file it names by a relative path is
71
72
  const projectLabel = (cwd) => { const h = os.homedir(), rel = cwd && cwd.startsWith(h + path.sep) ? cwd.slice(h.length + 1) : cwd; return 'Codex' + (rel ? ' · ' + rel.split(path.sep).join('/') : ''); };
72
73
 
package/kokoro.js CHANGED
@@ -76,8 +76,9 @@ function warm() { if (installed() && !worker && restarts < MAX_RESTARTS) try { s
76
76
  function pump() {
77
77
  if (busy || !queue.length) return;
78
78
  const j = queue.shift(); let w; try { w = startWorker(); } catch (e) { j.reject(e); return pump(); }
79
- const id = ++seq, next = (fn) => (v) => { busy = false; fn(v); pump(); }; busy = true;
80
- w.pending.set(id, { resolve: next(j.resolve), reject: next(j.reject) });
79
+ const id = ++seq, late = setTimeout(() => { if (w.pending.has(id)) { lastError = 'kokoro worker: no answer'; try { w.p.kill(); } catch {} } }, w.ready ? 60e3 : 180e3); // a worker that hangs is stopped (and started again on the next line): every line after it waited for ever
80
+ const next = (fn, ok) => (v) => { clearTimeout(late); busy = false; if (ok) restarts = 0; fn(v); pump(); }; busy = true; // ok: a line spoken, the count of crashes starts again (three over days of an open editor turned the voices off)
81
+ w.pending.set(id, { resolve: next(j.resolve, true), reject: next(j.reject) });
81
82
  const v = find(j.voice);
82
83
  w.p.stdin.write(JSON.stringify({ id, text: j.text, voice: j.voice, speed: j.speed, out: j.out, lang: v.lang, mix: v.mix }) + '\n');
83
84
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@double_geste/agent-standup",
3
- "version": "1.34.0",
3
+ "version": "1.36.0",
4
4
  "description": "Your Claude Code, Codex and Mistral Vibe agents as a live video call, from the terminal: a local page in your browser, plus one-line status for status bars. Free, open source, zero token cost.",
5
5
  "bin": {
6
6
  "agent-standup": "bin/agent-standup.js"
package/public/index.html CHANGED
@@ -45,6 +45,12 @@
45
45
  .stab.on { flex-shrink:0; max-width:min(320px,62vw); background:var(--panel2); color:var(--text); font-weight:600; border-color:var(--accent) } .stab.turn:not(.on) { color:var(--accent) } .stab.blocked:not(.on) { color:#fff; background:#c0392b; border-color:#ff8a80; font-weight:600 } .stab.all { flex:none; min-width:0; padding:2px 8px } /* a narrow panel: the tabs keep a readable width and the row scrolls */
46
46
  #visit { position:absolute; right:12px; bottom:14px; z-index:6; display:none; align-items:flex-end; gap:8px; max-width:min(380px,calc(100% - 24px)); cursor:pointer } #visit.on { display:flex; animation:visit .45s cubic-bezier(.2,1.3,.4,1) } @keyframes visit { from { transform:translateX(120%) } } body.react #visit { bottom:140px }
47
47
  #visit .vsay { position:relative; min-width:0; background:#fff; color:#1b1d27; border-radius:11px 11px 2px 11px; padding:7px 10px; font-size:12.5px; line-height:1.35; box-shadow:0 4px 14px rgba(0,0,0,.4); overflow-wrap:anywhere } #visit .vsay small { display:block; color:#5a6072; font-size:11px; margin-bottom:2px } #visit .vgo { display:inline-block; margin-top:5px; padding:1px 10px; border-radius:99px; background:var(--accent); color:#0b1020; font-weight:600; font-size:11.5px }
48
+ #askc { position:absolute; left:12px; bottom:14px; z-index:6; display:none; align-items:flex-end; gap:8px; max-width:min(460px,calc(100% - 24px)) } #askc.on { display:flex; animation:askc .45s cubic-bezier(.2,1.3,.4,1) } @keyframes askc { from { transform:translateX(-120%) } } @media (prefers-reduced-motion:reduce) { #askc.on { animation:none } } body.react #askc { bottom:140px } #center:has(#visit.on) #askc { bottom:118px } #center:has(#askc.on) #pcap { display:none } /* the menu the session waits on, in the lead's words, until it is answered */
49
+ #askc .awho { flex:none; width:72px; height:54px; border-radius:12px; overflow:hidden; border:2px solid #ff5252; box-shadow:0 4px 14px rgba(0,0,0,.45); background:#222 } #askc .awho svg { width:100%; height:100%; display:block }
50
+ #askc .asay { position:relative; min-width:0; max-height:min(52vh,420px); overflow:auto; background:#fff; color:#1b1d27; border-radius:11px 11px 11px 2px; padding:8px 30px 9px 12px; font-size:13px; line-height:1.4; box-shadow:0 4px 14px rgba(0,0,0,.4); overflow-wrap:anywhere } #askc small { display:block; color:#5a6072; font-size:11px; margin-bottom:3px } #askc .ak-t { color:#c62828; font-weight:600 }
51
+ #askc .aq { font-weight:600; margin:3px 0 3px } #askc .ahow { color:#5a6072; font-weight:400; font-size:11.5px } #askc ol { margin:0 0 4px; padding-left:22px } #askc li { margin:1px 0 } #askc li span { color:#5a6072; font-size:11.5px } #askc .aab { margin:2px 0 }
52
+ #askc pre { margin:4px 0; padding:6px 8px; background:#f1f2f6; border-radius:6px; font:12px/1.4 ui-monospace,Menlo,Consolas,monospace; white-space:pre-wrap; max-height:180px; overflow:auto } #askc .afoot { margin-top:6px; padding-top:5px; border-top:1px solid #e6e7ee; color:#5a6072; font-size:11.5px }
53
+ #askc .ax { position:absolute; top:4px; right:4px; width:24px; height:24px; border:0; border-radius:50%; background:transparent; color:#5a6072; cursor:pointer; font-size:13px; line-height:24px } #askc .ax:hover { background:#eceef4 } #askc .ax:focus-visible { outline:2px solid var(--accent); outline-offset:1px }
48
54
  #visit .vwho { flex:none; width:88px; height:66px; border-radius:12px; overflow:hidden; border:2px solid var(--accent); box-shadow:0 4px 14px rgba(0,0,0,.45); background:#222 } #visit.blocked .vwho { border-color:#ff5252 } #visit.speaking .vwho { box-shadow:0 0 0 3px rgba(124,156,255,.4), 0 4px 14px rgba(0,0,0,.45) } #visit .vwho svg { width:100%; height:100%; display:block }
49
55
  #visit .vx { position:absolute; top:-9px; left:-9px; width:20px; height:20px; border-radius:50%; background:var(--panel2); border:1px solid var(--line); color:var(--dim); font-size:11px; line-height:18px } #visit .vx:hover { color:var(--text) }
50
56
  @keyframes pulse { 50% { opacity:.3 } }
@@ -63,6 +69,7 @@
63
69
  body.tree #stage, body.board #stage, body.board #tree { display:none } body.tree #tree { display:block } body.board #boardv { display:block } body.board #present, body.board #gantt { display:none !important }
64
70
  #roster { display:none; width:232px; flex:none; flex-direction:column; gap:5px; padding:10px 8px; overflow:auto; border-right:1px solid var(--line); background:var(--panel) }
65
71
  @media (min-width:900px) { body.rost:not(.tree):not(.board) #roster { display:flex } }
72
+ #roster:focus-visible { outline:2px solid var(--accent); outline-offset:-2px } /* the first stop of the Tab key */
66
73
  #roster h3 { margin:2px 6px 4px; font-size:11px; font-weight:600; letter-spacing:.06em; text-transform:uppercase; color:var(--dim) }
67
74
  .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 }
68
75
  .rr:hover { background:#2a2f45 } .rr.sel { outline:1px solid var(--accent) }
@@ -98,7 +105,7 @@
98
105
  #fpop { position:absolute; left:10px; z-index:8; width:min(360px,calc(100% - 20px)); max-height:min(46vh,340px); overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; background:var(--panel); border:1px solid var(--line); border-radius:12px; box-shadow:0 14px 40px rgba(0,0,0,.55); padding:6px; animation:fadein .15s }
99
106
  #fpop h4 { margin:6px 10px 4px; font-size:10.5px; letter-spacing:.08em; text-transform:uppercase; color:var(--dim); font-weight:600 }
100
107
  .sfr { display:grid; grid-template-columns:auto 1fr; gap:0 9px; align-items:center; width:100%; text-align:left; padding:6px 10px; border-radius:8px } .sfr:hover { background:var(--panel2) } .sfr i { font-style:normal; grid-row:span 2 } .sfr b, .sfr em { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap } .sfr b { font-size:12.5px; font-weight:600 } .sfr em { font-style:normal; font-size:11px; color:var(--dim) }
101
- body:not(.replay) #center:has(#files.on) #toasts { bottom:46px } body:not(.replay):not(.react) #center:has(#files.on) #visit { bottom:48px } /* live: the line is the bottom of the call, and what pops up there stays above it */
108
+ body:not(.replay) #center:has(#files.on) #toasts { bottom:46px } body:not(.replay):not(.react) #center:has(#files.on) #visit, body:not(.replay):not(.react) #center:has(#files.on) #askc { bottom:48px } /* live: the line is the bottom of the call, and what pops up there stays above it */
102
109
  .tbadge .l { color:#ff9f1c } .tbadge span { font-size:11px } .tbadge .q { color:#b4bcd4 }
103
110
  .ic:active, .btn:active { transform:scale(.96) } .rr, .ic, .bcard { transition:background .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease) }
104
111
  .meet { font-size:11.5px; color:var(--dim); white-space:nowrap; display:flex; gap:8px; align-items:center } .meet i { width:8px; height:8px; border-radius:50%; background:#ff4d4d; animation:pulse 1.6s infinite }
@@ -389,7 +396,7 @@
389
396
  <div id="files"></div>
390
397
  <div id="hl"></div>
391
398
  <canvas id="gantt" height="90"></canvas>
392
- <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"><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>
399
+ <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"><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>
393
400
  <div id="empty"><h2 id="eT"></h2><p id="eP"></p><button class="cta" id="eDemo"></button></div>
394
401
  <div id="gate"><h2 id="gT"></h2><p id="gP"></p><button class="cta" id="gB"></button></div>
395
402
  <div id="detail"><div class="hd"><b id="dname"></b><button class="ic" id="dclose">✕</button></div><div id="dbody"></div></div>
@@ -435,6 +442,7 @@ const PREF_DEFAULTS = { ...prefs }; // for ⚙ → All settings → Reset to d
435
442
  { 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
436
443
  const sv = window.SAVED_PREFS && typeof window.SAVED_PREFS === 'object' ? window.SAVED_PREFS : {}; Object.assign(prefs, (sv._t || 0) > (loc._t || 0) ? sv : loc); }
437
444
  const HAD_PREFS = !!prefs._t; // someone who used the app before this page: shown once where the settings went
445
+ 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
438
446
  if (prefs.vstyle === 'babble') prefs.vstyle = 'animal', prefs.vstyleChosen = true;
439
447
  // Two styles since 1.32.0: the natural voices (the model, the default, which babble until they are installed) and the Animal Crossing babble. The cartoon voices, Simlish and the plain system voices are no longer offered:
440
448
  // whoever had Simlish is on the other babble, everyone else on the natural voices. The cartoon voices read the words with no install, so the call offers the real ones once more to who had closed that line.
@@ -539,7 +547,7 @@ function shopWait(name) { // after the payment page was opened: every few seco
539
547
  shopPoll = setInterval(async () => { if (Date.now() > until) return clearInterval(shopPoll); const r = await shopAsk('claim', { pack: name }); if (r.ok) { clearInterval(shopPoll); shopDone(name); } }, 4000);
540
548
  }
541
549
  function renderShop(el, name, shop) {
542
- el.innerHTML = `<img src="pack-${esc(name)}.jpg" alt="" style="display:block;width:100%;border-radius:8px;margin-bottom:8px">${esc(L('Des personnages d’Halloween dessinés à la main, chacun dans sa pièce.', 'Hand-drawn Halloween characters, each in its own room.'))}<br>${esc(L('Un seul paiement, par carte, sur une page Stripe. Sans compte.', 'One payment, by card, on a Stripe page. No account.'))}<br>${esc(L('2 € minimum : vous pouvez donner plus sur la page de paiement, si vous le souhaitez.', '2 € minimum: you can pay more on the payment page if you like.'))}${shop.artist ? `<br>${esc(L('Dessinés par', 'Drawn by'))} <a href="#" class="artist">${esc(shop.artist)}</a>` : ''}
550
+ el.innerHTML = `<img src="pack-${esc(name)}.jpg" alt="" style="display:block;width:100%;border-radius:8px;margin-bottom:8px">${esc(L('Des personnages d’Halloween dessinés à la main, chacun dans sa pièce.', 'Hand-drawn Halloween characters, each in its own room.'))}<br>${esc(L('Entièrement facultatif : l’app reste gratuite. C’est une façon de soutenir l’artiste et le développeur.', 'Entirely optional: the app stays free. It is a way to support the artist and the developer.'))}<br>${esc(L('Un seul paiement, par carte, sur une page Stripe. Sans compte.', 'One payment, by card, on a Stripe page. No account.'))}<br>${esc(L('2 € minimum : vous pouvez donner plus sur la page de paiement, si vous le souhaitez.', '2 € minimum: you can pay more on the payment page if you like.'))}${shop.artist ? `<br>${esc(L('Dessinés par', 'Drawn by'))} <a href="#" class="artist">${esc(shop.artist)}</a>` : ''}
543
551
  <div style="display:flex;gap:6px;flex-wrap:wrap;margin-top:8px"><button class="btn" id="shopBuy" style="background:var(--accent);border-color:transparent;color:#10131c;font-weight:600">${esc(L('Acheter', 'Buy'))} · ${esc(shop.price)}</button><button class="btn" id="shopHave">${esc(L('Je l’ai déjà acheté', 'I already bought it'))}</button></div>
544
552
  <div id="shopCode" style="display:none;gap:6px;margin-top:8px"><input id="shopKey" aria-label="${esc(L('Code d’achat', 'Purchase code'))}" placeholder="${esc(L('Code d’achat', 'Purchase code'))}" autocomplete="off" spellcheck="false" style="flex:1;min-width:0;font:inherit;color:inherit;background:var(--panel2);border:1px solid var(--line);border-radius:8px;padding:6px 8px"><button class="btn" id="shopGo">${esc(L('Installer', 'Install'))}</button></div>
545
553
  <div id="shopMsg" role="status" style="margin-top:8px"></div>`;
@@ -1304,7 +1312,7 @@ function syncUI() {
1304
1312
  // ---------- tool ticker, shared screen, flying messages ----------
1305
1313
  // ---------- what each agent is doing: tool calls with their real outputs ----------
1306
1314
  S.term = {}; S.todos = {}; S.run = {}; S.act = {}; S.usage = {}; S.errs = {}; S.lastAct = {}; S.waitOn = {}; S.orderTs = {}; S.prevState = {}; S.ctx = {}; S.model = {}; S.cw = {}; S.compacts = {}; S.ctxWarned = {}; S.rep = {}; S.loops = {}; S.present = null; S.camFor = null; let presentTimer = null;
1307
- S.files = new Map(); S.cands = new Map(); S.turnN = 0; S.turnSaid = ''; S.fgone = new Set(); S.fmade = new Map(); S.arts = new Map(); S.artCalls = new Map(); S.artOk = new Map(); S.artPin = null; // files: path → the Write call that created it, in the order they were written · cands: the documents the commands name (see candFile) · turnN: how many orders you gave so far · turnSaid: what you and the lead said in this turn · fgone: the files found missing on a click · fmade: what the server answered about a document a command names
1315
+ S.files = new Map(); S.cands = new Map(); S.turnN = 0; S.turnSaid = ''; S.fgone = new Set(); S.fmade = new Map(); S.arts = new Map(); S.artCalls = new Map(); S.artOk = new Map(); S.artPin = null; S.artWhole = null; S.wholeSeen = new Set(); // files: path → the Write call that created it, in the order they were written · cands: the documents the commands name (see candFile) · turnN: how many orders you gave so far · turnSaid: what you and the lead said in this turn · fgone: the files found missing on a click · fmade: what the server answered about a document a command names
1308
1316
  const later = (k, fn, ms = 160) => { later.p = later.p || {}; if (later.p[k]) return; later.p[k] = setTimeout(() => { later.p[k] = 0; fn(); }, ms); }; // coalesce bursts of repaints
1309
1317
  const fmtTok = (n) => (n < 1000 ? String(n) : n < 1e6 ? (n / 1000).toFixed(n < 1e4 ? 1 : 0) + 'k' : (n / 1e6).toFixed(n < 1e7 ? 2 : 1) + 'M');
1310
1318
  const tokTotal = (u) => (u ? u.i + u.o + u.w : 0); // headline = input + output + cache writes; cache reads are cheap and shown separately
@@ -1355,9 +1363,10 @@ const NEEDS_OK = /^(Edit|Write|MultiEdit|NotebookEdit|AskUserQuestion|ExitPlanMo
1355
1363
  const atTail = () => S.idx >= S.events.length - 3; // only trust wall-clock ages when playback has caught up with the live end
1356
1364
  function agentState(id, now) {
1357
1365
  let s = S.status[id]; const r = S.run[id], w = S.waitOn[id], la = S.lastAct[id];
1366
+ if (id === 'main' && S.live && atTail()) { const row = rowOf(S.cur); if (row && row.state === 'blocked' && row.since && !(la > S.rowsAt)) return { k: 'blocked', txt: '✋ ' + L('attend vous ? ', 'needs you? ') + fmtShort(Math.max(0, now - row.since)), ask: row.ask || '' }; } // what the server knows: a menu open in the session (a Bash approval looks like a running command here), and the question or command it waits on; unless the session moved since that answer. Before "your turn": a menu left open for longer than the lead's quiet time still needs you
1358
1367
  if (id === 'main' && !s) { // the lead is at work until the message that closes its turn, even while it thinks, and from its first turn on (the server says which transcripts carry that mark); one without it falls back on "quiet for 25 s", and a turn cut short on 3 minutes of silence
1359
1368
  const open = S.live && la && (S.sawEnd ? !S.turnOver && now - la < 180000 : now - la < 25000);
1360
- if (r || (w && w.size) || open) s = 'working'; else if (S.live && la) return { k: 'done', txt: '✓ ' + L('à vous', 'your turn') };
1369
+ if (r || (w && w.size) || open) s = 'working'; else if (S.live && la) return { k: 'done', txt: '✓ ' + L('à vous', 'your turn') + ' · ' + fmtShort(Math.max(0, now - la)) };
1361
1370
  }
1362
1371
  if (s === 'done') return { k: 'done', txt: '✓ ' + L('terminé', 'done') };
1363
1372
  if (!s) return { k: 'idle', txt: '' };
@@ -1372,6 +1381,30 @@ function agentState(id, now) {
1372
1381
  return { k: 'working', txt: '⚙ ' + (S.act[id] || L('au travail', 'working')) };
1373
1382
  }
1374
1383
  const STATE_CLASSES = ['working', 'waiting', 'blocked', 'stalled', 'done'];
1384
+ // The menu the followed session waits on, in the lead's words, word for word: the questions and their options numbered as in the menu, the command, the file, the plan.
1385
+ // It stays until the menu is answered (where Claude Code runs: nothing is answered from here); ✕ puts it away until the next one.
1386
+ const ASKC = { off: '' };
1387
+ function askHtml(m, p) {
1388
+ const who = esc(p.name), pre = (x) => (x ? '<pre>' + esc(x) + '</pre>' : ''); let head, body = '';
1389
+ if (m.kind === 'question') { head = '💬 ' + who + ' ' + (m.questions.length > 1 ? L('vous pose plusieurs questions', 'has several questions for you') : L('vous pose une question', 'has a question for you'));
1390
+ body = m.questions.map((q) => '<div class="aq">' + esc(q.q) + ' <span class="ahow">' + (q.multi ? L('(un ou plusieurs choix)', '(one or more)') : L('(un seul choix)', '(pick one)')) + '</span></div>' + (q.options.length ? '<ol>' + q.options.map((o) => '<li>' + esc(o.label) + (o.about ? ' <span>— ' + esc(o.about) + '</span>' : '') + '</li>').join('') + '</ol>' : '')).join(''); }
1391
+ else if (m.kind === 'plan') { head = '📋 ' + who + ' ' + L('vous propose ce plan', 'proposes this plan'); body = pre(m.text); }
1392
+ else if (m.kind === 'command') { head = '🔐 ' + who + ' ' + (m.sure ? L('demande à lancer cette commande', 'asks to run this command') : L('attend peut-être votre feu vert pour cette commande', 'may be waiting for your go-ahead on this command')); body = (m.about ? '<div class="aab">' + esc(m.about) + '</div>' : '') + pre(m.cmd); }
1393
+ else if (m.kind === 'edit') { head = '🔐 ' + who + ' ' + (m.sure ? L('demande à modifier ce fichier', 'asks to edit this file') : L('attend peut-être votre feu vert pour modifier ce fichier', 'may be waiting for your go-ahead to edit this file')); body = pre(m.file); }
1394
+ else if (m.kind === 'menu') { head = '✋ ' + who + ' ' + L('attend votre réponse', 'is waiting for your answer'); body = '<div class="aab">' + L('Un menu est ouvert dans Claude Code.', 'A menu is open in Claude Code.') + '</div>'; }
1395
+ else if (m.kind === 'fetch') { head = '🔐 ' + who + ' ' + L('demande à ouvrir cette page', 'asks to open this page'); body = pre(m.url); }
1396
+ else { head = '🔐 ' + who + ' ' + L('demande la permission d\'utiliser', 'asks permission to use') + ' ' + esc(m.tool || ''); }
1397
+ const foot = L('À répondre dans Claude Code', 'Answer it in Claude Code') + (m.kind === 'question' ? ' · ' + L('les numéros sont ceux du menu', 'the numbers match the menu') : '');
1398
+ return '<div class="awho">' + avatarSVG(p, undefined, 'ak' + p.gid + '_') + '</div><div class="asay"><button class="ax" aria-label="' + esc(L('Masquer jusqu\'à la prochaine question', 'Hide until the next question')) + '">✕</button><small>' + head + ' · <span class="ak-t"></span></small>' + body + '<div class="afoot">' + foot + '</div></div>';
1399
+ }
1400
+ function paintAsk(now) {
1401
+ const el = $('#askc'); if (!el) return; let row = null; try { row = rowOf(S.cur); } catch {}
1402
+ const m = row && row.menu, p = S.agents.main, show = !!(m && p && S.live && !S.demo && ASKC.off !== m.id && agentState('main', now).k === 'blocked');
1403
+ if (!show) { if (el.dataset.k) { el.className = ''; el.innerHTML = ''; el.dataset.k = ''; } return; }
1404
+ if (el.dataset.k !== m.id) { el.dataset.k = m.id; el.className = 'on'; el.setAttribute('aria-label', L('Ce que la session attend de vous', 'What the session is waiting for from you')); el.innerHTML = askHtml(m, p); } // built once per menu, so it is announced once
1405
+ const t = el.querySelector('.ak-t'); if (t) t.textContent = fmtShort(Math.max(0, now - (row.since || now)));
1406
+ }
1407
+ $('#askc').onclick = (e) => { if (e.target.closest('.ax')) { ASKC.off = $('#askc').dataset.k; paintAsk(Date.now()); } };
1375
1408
  function paintStates() {
1376
1409
  const now = Date.now(), n = { working: 0, waiting: 0, blocked: 0, stalled: 0, done: 0 }, ros = [], attn = [];
1377
1410
  for (const p of Object.values(S.agents)) {
@@ -1390,7 +1423,7 @@ function paintStates() {
1390
1423
  paintPill();
1391
1424
  const b = $('#board'), parts = [['working', '⚙', L('au travail', 'working')], ['waiting', '🔗', L('en attente', 'waiting')], ['blocked', '✋', L('vous attendent', 'need you')], ['stalled', '⚠', L('bloqués', 'stalled')], ['done', '✓', L('terminés', 'done')]]
1392
1425
  .filter(([k]) => n[k] && !S.pillSess).map(([k, i, l]) => `<span class="${k}" title="${n[k]} ${l}">${i} ${n[k]}<em> ${l}</em></span>`).join('');
1393
- if (b.innerHTML !== parts) b.innerHTML = parts; fitBoard(); S.nBlocked = n.blocked + n.stalled; S.attn = attn; paintRoster(ros); paintFiles(); return n;
1426
+ if (b.innerHTML !== parts) b.innerHTML = parts; fitBoard(); S.nBlocked = n.blocked + n.stalled; S.attn = attn; paintRoster(ros); paintFiles(); paintAsk(now); return n;
1394
1427
  }
1395
1428
  function fitBoard(force) { // the chips lose their words when they do not all fit (a long language, a narrower window): a chip is never cut mid-word. Tried again with the words only when the window or the texts around have changed
1396
1429
  const b = $('#board'), key = innerWidth + '|' + b.textContent.length + '|' + $('#pill').textContent.length + '|' + $('#subtitle').textContent.length;
@@ -1461,7 +1494,7 @@ function activityLabel(t) { // the short "what is on their screen" tag
1461
1494
  case 'read': return L('Lit ', 'Reading ') + f;
1462
1495
  case 'edit': return L('Modifie ', 'Editing ') + f;
1463
1496
  case 'write': return L('Crée ', 'Writing ') + f;
1464
- case 'cmd': { const n = (d.note || '').trim(); if (n) return n.slice(0, 36); return L('Exécute ', 'Running ') + d.text.trim().split(/\s+/).slice(0, 2).join(' ').slice(0, 26); }
1497
+ case 'cmd': { const n = (d.note || '').trim(), w = d.text.trim().split(/\s+/); if (n) return n.length > 36 ? n.slice(0, 36).replace(/\s+\S*$/, '') + '…' : n; return L('Exécute ', 'Running ') + w.slice(0, 2).join(' ').slice(0, 26) + (w.length > 2 ? '…' : ''); } /* cut at a word, and said to be cut */
1465
1498
  case 'grep': return L('Cherche « ', 'Searching “') + String(d.pattern || '').slice(0, 22) + L(' »', '”');
1466
1499
  case 'glob': return L('Liste ', 'Listing ') + String(d.pattern || '').slice(0, 24);
1467
1500
  case 'todo': return L('Met à jour sa todo', 'Updating todo list');
@@ -1540,7 +1573,7 @@ const lineHtml = (l, view) => view === 'editor'
1540
1573
  // ---------- screen sharing: a real video-call presentation (window + presenter camera) ----------
1541
1574
  function renderPresent() {
1542
1575
  const id = S.present, p = S.agents[id]; if (!p) return; if (S.artPin && !S.arts.has(S.artPin)) { S.artPin = null; armPresent(); }
1543
- const pinned = S.artPin ? S.arts.get(S.artPin) : null, m = pinned ? artModel(pinned, id) : termModel(id), shape = m.view === 'web' && pinned ? 'pin' : m.view === 'web' || m.view === 'image' ? 'pic' : '';
1576
+ const pinned = S.artPin ? S.arts.get(S.artPin) : null, whole = !pinned && S.artWhole ? S.arts.get(S.artWhole) : null, m = pinned ? artModel(pinned, id) : whole ? artModel(whole, id) : termModel(id), shape = m.view === 'web' && pinned ? 'pin' : m.view === 'web' || m.view === 'image' ? 'pic' : '';
1544
1577
  $('#present .pwin').className = 'pwin ' + (m.view === 'term' ? 'term' : m.view); $('#present').classList.toggle('pic', shape === 'pic'); $('#present').classList.toggle('pin', shape === 'pin'); if (shape !== S.picUp) { S.picUp = shape; layout(); } // a picture or a page gets a taller window, a pinned page the tallest
1545
1578
  $('#ptitle').textContent = m.view === 'term' ? `${p.name} — zsh — 96×24` : m.title;
1546
1579
  const pb = $('#pbody'), shown = m.view === 'image' ? m.imgs.join(' ') : m.view === 'web' ? m.key : ''; pb.dataset.art = m.view === 'web' ? m.a.url : '';
@@ -1562,40 +1595,46 @@ function armPresent() { // stays up while a command is still running, then ~4
1562
1595
  clearTimeout(presentTimer); if (S.hold || S.artPin) return;
1563
1596
  presentTimer = setTimeout(() => { if (S.present && S.run[S.present] && S.playing) armPresent(); else hidePresent(); }, ($('#present .pwin').classList.contains('web') ? 20000 : $('#present').classList.contains('pic') ? 9000 : 4200) / Math.max(1, spd() / 1.2));
1564
1597
  }
1565
- function showPresent(id) {
1566
- if (S.artPin || S.boost > 1 || (S.speakers.size && !S.speakers.has(id))) return; // a page you pinned stays up · catching up, or someone else has the floor
1598
+ function showPresent(id, keep) { // keep: the whole document that is being shown (see shareWhole); anything else the agent does takes its place
1599
+ if (!keep) S.artWhole = null; if (S.artPin || S.boost > 1 || (S.speakers.size && !S.speakers.has(id))) return; // a page you pinned stays up · catching up, or someone else has the floor
1567
1600
  const first = S.present !== id; S.present = id; $('#present').classList.add('on'); document.body.classList.add('presenting'); document.querySelectorAll('.tile.presenter').forEach((t) => t.classList.remove('presenter')); const pt = $('#t-' + id); if (pt) pt.classList.add('presenter'); renderPresent(); if (first) { layout(); AUD.tone(880, .12, 'sine', .05); }
1568
1601
  armPresent();
1569
1602
  }
1570
1603
  function hidePresent() {
1571
- clearTimeout(presentTimer); if (!S.present || S.artPin) return; if ($('#pbody').dataset.art) { $('#pbody').innerHTML = ''; $('#pbody').dataset.img = $('#pbody').dataset.art = ''; } /* the page of an artifact does not go on running behind a closed window */
1604
+ clearTimeout(presentTimer); if (!S.present || S.artPin) return; S.artWhole = null; if ($('#pbody').dataset.art) { $('#pbody').innerHTML = ''; $('#pbody').dataset.img = $('#pbody').dataset.art = ''; } /* the page of an artifact does not go on running behind a closed window */
1572
1605
  S.present = null; $('#present').classList.remove('on'); document.body.classList.remove('presenting'); document.querySelectorAll('.tile.presenter').forEach((t) => t.classList.remove('presenter')); $('#pcap').textContent = ''; layout();
1573
1606
  }
1574
1607
  // ---------- artifacts: the pages the session published on claude.ai, shown the way a call shows a browser window someone shares ----------
1575
1608
  // When a publish succeeds its author shares the page for a moment; afterwards it is in the line of files, and a click there pins it: the window takes the room, stays until you close it (✕, Esc),
1576
1609
  // follows the next versions and steps through the other artifacts of the session (‹ ›). The page itself comes from the server, which puts it together from the session file (claude.ai lets nobody frame it):
1577
- // a frame that can reach neither the app nor, unless you ask for the libraries, the network. Where there is no page to show (made from a claude.ai template, or written another way) the window says so and gives the link.
1610
+ // a frame that can reach neither the app nor, unless you ask for the libraries, the network. Where there is no page to show (a claude.ai template that was sent no page, or one written another way) the window says so and gives the link.
1578
1611
  const artSrc = (a) => `/api/artifact?proj=${encodeURIComponent(S.cur.proj)}&id=${encodeURIComponent(S.cur.id)}&agent=${encodeURIComponent(a.agent)}&tool=${encodeURIComponent(a.id)}`;
1579
1612
  function noteArts(ev) { // one entry per artifact, the last publish of it: published again, it is the newest and shows its new version
1580
- if (ev.kind === 'tools') { for (const t of ev.tools) if (t.d && t.d.kind === 'artifact') S.artCalls.set(t.id, { agent: ev.agent, title: t.d.title || '', note: t.d.note || '' }); return; }
1613
+ if (ev.kind === 'tools') { for (const t of ev.tools) if (t.d && t.d.kind === 'artifact') S.artCalls.set(t.id, { agent: ev.agent, title: t.d.title || '', note: t.d.note || '', pub: !t.d.open && !t.d.doc }); return; }
1581
1614
  if (ev.kind !== 'results') return;
1582
1615
  for (const it of ev.items) { const c = it.art && S.artCalls.get(it.id); if (!c) continue; const u = it.art.url, was = S.arts.get(u) || {}; S.arts.delete(u); S.arts.set(u, { url: u, title: it.art.title || c.title || was.title || 'Artifact', note: c.note || was.note || '', agent: c.agent, id: it.id, v: it.art.v || 0, typed: !!it.art.typed, turn: S.turnN }); if (S.artPin === u) later('art', renderPresent); }
1583
1616
  }
1617
+ // A document of several pages made from a claude.ai type (the artboards of a design): each page is shared as it is published, and the whole document once, while the lead says it is done,
1618
+ // since the page on claude.ai cannot be shown here. Pinned from the line of files, it is the whole document too.
1619
+ function shareWhole() {
1620
+ const a = [...S.arts.values()].reverse().find((x) => x.typed && x.turn === S.turnN && (S.artOk.get(x.id) || {}).pages > 1 && !S.wholeSeen.has(x.url + '|' + x.id)), st = a && S.artOk.get(a.id); if (!st || !st.ok || !(st.pages > 1)) return;
1621
+ S.wholeSeen.add(a.url + '|' + a.id); S.artWhole = a.url; showPresent(S.agents[a.agent] ? a.agent : 'main', true); if (S.present !== (S.agents[a.agent] ? a.agent : 'main')) S.artWhole = null;
1622
+ }
1584
1623
  function askArt(a) { // is there a page to show for that publish? Asked once: null while the answer is on its way
1585
- if (S.artOk.has(a.id)) return S.artOk.get(a.id); if (a.typed || S.demo || !S.cur) { S.artOk.set(a.id, { ok: false }); return S.artOk.get(a.id); }
1624
+ if (S.artOk.has(a.id)) return S.artOk.get(a.id); if (S.demo || !S.cur) { S.artOk.set(a.id, { ok: false }); return S.artOk.get(a.id); }
1586
1625
  const cur = S.cur; S.artOk.set(a.id, null);
1587
- fetch(artSrc(a) + '&check=1').then((r) => r.json()).then((j) => { if (S.cur !== cur) return; S.artOk.set(a.id, { ok: !!j.ok, net: !!j.net }); if (S.present) renderPresent(); }).catch(() => { if (S.cur === cur) S.artOk.delete(a.id); });
1626
+ fetch(artSrc(a) + '&check=1').then((r) => r.json()).then((j) => { if (S.cur !== cur) return; S.artOk.set(a.id, { ok: !!j.ok, net: !!j.net, pages: +j.pages || 0, label: j.label || '' }); if (S.present) renderPresent(); }).catch(() => { if (S.cur === cur) S.artOk.delete(a.id); });
1588
1627
  return null;
1589
1628
  }
1590
1629
  function artModel(a, id) {
1591
- const st = askArt(a), all = [...S.arts.keys()], pinned = S.artPin === a.url, buf = S.term[id] || [];
1592
- return { view: 'web', title: a.title, lines: [], a, st, pinned, n: all.length, i: all.indexOf(a.url), stat: a.note || statOf(buf[buf.length - 1], id), key: [a.url, a.id, st ? (st.ok ? 'ok' : 'no') : '?', st && st.net ? 'n' : '', prefs.artNet ? 'N' : '', pinned ? 'p' + all.indexOf(a.url) + '/' + all.length : '', prefs.lang].join('|') };
1630
+ const st = askArt(a), all = [...S.arts.keys()], pinned = S.artPin === a.url, buf = S.term[id] || [], whole = !!(st && st.ok && st.pages > 1 && (pinned || S.artWhole === a.url));
1631
+ return { view: 'web', title: a.title, lines: [], a, st, pinned, whole, n: all.length, i: all.indexOf(a.url), stat: a.note || statOf(buf[buf.length - 1], id), key: [a.url, a.id, st ? (st.ok ? 'ok' : 'no') : '?', st && st.net ? 'n' : '', prefs.artNet ? 'N' : '', pinned ? 'p' + all.indexOf(a.url) + '/' + all.length : '', whole ? 'w' : '', prefs.lang].join('|') };
1593
1632
  }
1594
1633
  function artHtml(m) {
1595
1634
  const a = m.a, ok = m.st && m.st.ok, libs = ok && m.st.net && !prefs.artNet, open = esc(L('Ouvrir sur claude.ai', 'Open on claude.ai'));
1596
1635
  const nav = m.pinned && m.n > 1 ? `<button class="pnb" data-go="-1">‹</button><span class="pnn">${m.i + 1}/${m.n}</span><button class="pnb" data-go="1">›</button>` : '';
1597
- const bar = `<div class="pnav">${nav}<span class="purl">🔒 ${esc(a.url.replace(/^https:\/\//, ''))}</span>${a.v > 1 ? `<span class="pnn">v${a.v}</span>` : ''}${libs ? `<button class="pnb lib" data-lib title="${esc(L('Cette page utilise des bibliothèques hébergées ailleurs : elles ne sont chargées que si vous le demandez', 'This page uses libraries kept on other servers: they are loaded only if you ask'))}">${esc(L('Charger ses bibliothèques', 'Load its libraries'))}</button>` : ''}<button class="pnb" data-open title="${open}" aria-label="${open}">↗</button>${m.pinned ? `<button class="pnb" data-x title="${esc(L('Fermer', 'Close'))}" aria-label="${esc(L('Fermer', 'Close'))}">✕</button>` : ''}</div>`;
1598
- const page = ok ? `<iframe sandbox="allow-scripts" referrerpolicy="no-referrer" title="${esc(a.title)}" src="${esc(artSrc(a) + (prefs.artNet ? '&net=1' : ''))}"></iframe>` + (m.pinned ? '' : `<button class="pzoom" data-pin title="${esc(L('Cliquer pour agrandir', 'Click to enlarge'))}" aria-label="${esc(L('Cliquer pour agrandir', 'Click to enlarge'))}"></button>`)
1636
+ const bar = `<div class="pnav">${nav}<span class="purl">🔒 ${esc(a.url.replace(/^https:\/\//, ''))}</span>${ok && m.st.pages > 1 ? `<span class="pnn">${esc(m.whole ? m.st.pages + ' ' + L('pages', 'pages') : m.st.label)}</span>` : ''}${a.v > 1 ? `<span class="pnn">v${a.v}</span>` : ''}${libs ? `<button class="pnb lib" data-lib title="${esc(L('Cette page utilise des bibliothèques hébergées ailleurs : elles ne sont chargées que si vous le demandez', 'This page uses libraries kept on other servers: they are loaded only if you ask'))}">${esc(L('Charger ses bibliothèques', 'Load its libraries'))}</button>` : ''}<button class="pnb" data-open title="${open}" aria-label="${open}">↗</button>${m.pinned ? `<button class="pnb" data-x title="${esc(L('Fermer', 'Close'))}" aria-label="${esc(L('Fermer', 'Close'))}">✕</button>` : ''}</div>`;
1637
+ const page = ok ? `<iframe sandbox="allow-scripts" referrerpolicy="no-referrer" title="${esc(a.title)}" src="${esc(artSrc(a) + (prefs.artNet ? '&net=1' : '') + (m.whole ? '&whole=1' + (m.pinned ? '&fit=w' : '') : ''))}"></iframe>` + (m.pinned ? '' : `<button class="pzoom" data-pin title="${esc(L('Cliquer pour agrandir', 'Click to enlarge'))}" aria-label="${esc(L('Cliquer pour agrandir', 'Click to enlarge'))}"></button>`)
1599
1638
  : `<div class="pcard"><i>🌐</i><b>${esc(a.title)}</b>${a.note ? `<p>${esc(a.note)}</p>` : ''}${m.st ? `<em>${esc(L('Pas d’aperçu ici : la page est sur claude.ai', 'No preview here: the page is on claude.ai'))}</em><button class="pnb" data-open>${open} ↗</button>` : '<span class="spin"></span>'}</div>`;
1600
1639
  return bar + `<div class="pweb">${page}</div>`;
1601
1640
  }
@@ -1847,7 +1886,7 @@ function renderTree() {
1847
1886
  }
1848
1887
  const node = (id) => {
1849
1888
  const p = S.agents[id], st = S.status[id], k = kids[id] || [], open = !S.collapsed.has(id), lt = last[id]; if (!p) return '';
1850
- return `<li><span class="caret" data-c="${id}">${k.length ? (open ? '▾' : '▸') : ''}</span><span class="node ${st || ''} ${S.speakers.has(id) ? 'speaking' : ''}" data-n="${id}">
1889
+ return `<li><span class="caret" data-c="${esc(id)}">${k.length ? (open ? '▾' : '▸') : ''}</span><span class="node ${st || ''} ${S.speakers.has(id) ? 'speaking' : ''}" data-n="${esc(id)}">
1851
1890
  <span class="dot" style="background:${p.shirt}"></span><b>${esc(p.name)}</b><span class="r">${esc(p.role)}</span>${(() => { const a = agentState(id, Date.now()); return a.k !== 'idle' ? `<span class="stc ${a.k}">${esc(a.txt)}</span>` : ''; })()}
1852
1891
  ${cnt[id] ? `<span class="r">🔧${cnt[id]}</span>` : ''}${k.length ? `<span class="r">👥${k.length}</span>` : ''}${lt && st === 'working' ? `<span class="tl">${esc(lt.name)} ${esc(lt.arg || '')}</span>` : ''}</span>
1853
1892
  ${k.length && open ? `<ul>${k.map(node).join('')}</ul>` : ''}</li>`;
@@ -2286,8 +2325,9 @@ async function run(i) {
2286
2325
  if (ev.kind === 'usage' || ev.kind === 'compact') { if (ev.kind === 'compact' && S.live && prefs.banter) toast(`${nameOf(ev.agent)}: ${L('contexte compacté 🗜', 'context compacted 🗜')}`); i++; continue; }
2287
2326
  if (ev.kind === 'finish') { applyStatus(ev); paintStatus(); i++; continue; }
2288
2327
  const backlog = S.live ? S.events.length - i : 0, quick = S.live ? Math.min(1, 40 / Math.max(1, backlog)) : 1; // live: hundreds of tool events from parallel sub-agents must not take minutes to scroll past
2289
- if (ev.kind === 'results') { applyResults(ev, S.boost > 1); await sleep((S.boost === 1 && S.present === ev.agent && ev.items.some((it) => it.img) ? (S.live ? 900 : 1800) : S.demo ? 900 : S.live ? 30 * quick : 80) / spd()); i++; continue; } // a picture gets a moment on screen
2328
+ if (ev.kind === 'results') { applyResults(ev, S.boost > 1); await sleep((S.boost === 1 && S.present === ev.agent && ev.items.some((it) => it.img) ? (S.live ? 900 : 1800) : S.boost === 1 && S.present === ev.agent && ev.items.some((it) => it.art && (S.artCalls.get(it.id) || {}).pub) ? (S.live ? 2500 : 4000) : S.demo ? 900 : S.live ? 30 * quick : 80) / spd()); i++; continue; } // a picture gets a moment on screen
2290
2329
  if (ev.kind === 'tools') { applyStatus(ev); tickTools(ev); AUD.click(); OFFICE.kick(ev.tools[ev.tools.length - 1].name); paintStatus(); if (S.live && S.owed && ev.agent === 'main') { await leadAck(ev, token); if (token !== S.token) return; } if (quick === 1) await smallTalk(token); await sleep((S.demo ? 1100 : S.live ? 110 * quick : 250) / spd()); i++; continue; }
2330
+ if (ev.kind === 'say' && ev.end && ev.agent === 'main' && S.boost <= 1) shareWhole(); // the lead says it is done: the whole document it made, if it has several pages
2291
2331
  const group = [ev]; let j = i + 1; // sub-agents talking back-to-back were running in parallel: their lines are taken together and said one after the other
2292
2332
  if (ev.kind === 'order') { // several orders in a row (a parallel launch): the new agents all appear now, the first order is read, the others are named in one line
2293
2333
  while (j < Math.min(S.events.length, i + 40) && group.length < 8) { const e2 = S.events[j]; if (e2.kind === 'usage' || e2.kind === 'compact') { tally(e2); j++; continue; } if (e2.kind === 'order' && e2.agent === ev.agent) { group.push(e2); j++; } else break; }
@@ -2362,7 +2402,7 @@ async function loadSession(proj, id) {
2362
2402
  const data = await (await fetch(`/api/session?proj=${encodeURIComponent(proj)}&id=${id}`)).json();
2363
2403
  if (mine !== S.loadN || data.error) return false;
2364
2404
  S.term = {}; S.camFor = null; S.focus = null; S.agents = {}; for (const k in nameBook) delete nameBook[k]; [{ id: 'user' }, ...data.agents].forEach((a) => (S.agents[a.id] = persona(a)));
2365
- 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;
2405
+ 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();
2366
2406
  const opt = $('#sessions').selectedOptions[0]; S.title = (S.live ? niceProj(proj) : opt && opt.dataset.title) || '';
2367
2407
  if (proj === '_demo') S.events.forEach((e) => { if (e.fr) trMem.set(baseText(e), e.fr, 'fr'); }); // the demo ships its own French
2368
2408
  $('#subtitle').textContent = S.title; recomputeStatus(0); buildStage(); renderHighlights(); setFocus('main'); renderLog(true); computeGantt(); layout(); paintStatus(); prefetchTr(0); return true;
@@ -2406,9 +2446,11 @@ function amend(e, was) { // the server corrected an event the call already has
2406
2446
  }
2407
2447
  if (e.end && !was.end && (e._n != null || e._as || past)) { let k = S.events.length - 1; while (k > i && !(S.events[k].kind === 'user' || (S.events[k].agent === 'main' && /^(say|tools|order)$/.test(S.events[k].kind) && !S.events[k].wf))) k--; if (k === i) S.turnOver = true; } // only if nothing came after it
2408
2448
  }
2409
- let polling = false;
2449
+ let polling = false, polledAt = 0;
2410
2450
  setInterval(async () => {
2411
- if (!S.live || polling) return; polling = true;
2451
+ if (!S.live || polling) return;
2452
+ if (document.hidden && AUD.off() && Date.now() - polledAt < 2500) return; // hidden and not heard (muted, or another window has the sound): every 2.5 s is enough for the alerts; a call you listen to keeps its pace
2453
+ polling = true; polledAt = Date.now();
2412
2454
  try {
2413
2455
  const switched = await followCurrent(); if (S.offline) { S.offline = false; syncUI(); }
2414
2456
  if (switched || !S.cur) return;
@@ -2457,10 +2499,12 @@ const BGROUP = ['blocked', 'turn', 'working', 'waiting', 'idle']; // the board
2457
2499
  let boardBusy = false, boardAll = null, boardDoneOpen = false;
2458
2500
  const isDone = (r) => !!r.done; // put away by you, until the session moves again: the server says so, to every window
2459
2501
  function bcard(r, now, done) {
2460
- const [ic, en, fr] = BSTATE[r.state], extra = r.state === 'blocked' ? ` · ${r.ask ? '' : esc(r.tool) + ' '}${agoStr(r.ageMs)}` : r.state === 'working' && r.tool ? ` · ${esc(r.tool)}` : r.state === 'idle' || r.state === 'turn' ? ` · ${agoStr(now - r.mtime)}` : '';
2502
+ const [ic, en, fr] = BSTATE[r.state], waited = r.since ? now - r.since : r.state === 'blocked' ? r.ageMs : now - r.mtime, mine = r.state === 'blocked' || r.state === 'turn'; // how long it has waited on you
2503
+ const head = r.state === 'blocked' ? [r.ask ? '' : esc(r.tool), r.ran ? '' : agoStr(waited)].filter(Boolean).join(' ') : r.state === 'working' && r.tool ? esc(r.tool) : r.state === 'idle' || (r.state === 'turn' && !r.ran) ? agoStr(waited) : '', extra = head ? ' · ' + head : '';
2504
+ const took = mine && r.ran ? `⏱ ${L('a travaillé', 'worked')} ${agoStr(r.ran)} · ${L('vous attend depuis', 'waiting on you for')} ${agoStr(waited)}` : r.state === 'working' && r.asked ? `⏱ ${L('au travail depuis', 'working for')} ${agoStr(Math.max(0, now - r.asked))}` : ''; // the time it worked, apart from the time it has waited on you
2461
2505
  const pr = r.pr ? `<button class="bpr" data-url="${esc(r.pr.url)}" title="${esc(L('Ouvrir la pull request', 'Open the pull request'))}">PR #${+r.pr.n} ↗</button>` : '';
2462
2506
  const put = done ? `<button class="bdo" data-undo="1" title="${esc(L('Rouvrir', 'Reopen'))}" aria-label="${esc(L('Rouvrir', 'Reopen'))}">↩</button>` : r.state === 'turn' || r.state === 'idle' ? `<button class="bdo" title="${esc(L('Marquer comme traitée', 'Mark as done'))}" aria-label="${esc(L('Marquer comme traitée', 'Mark as done'))}">✓</button>` : '';
2463
- return `<div class="bcard ${r.state}" tabindex="0" role="button" data-p="${esc(r.proj)}" data-i="${esc(r.id)}"><div class="bh"><span class="stc ${r.state}">${ic} ${L(fr, en)}${extra}</span>${pr}${put}</div><div class="bt">${esc(/^[0-9a-f]{8}-[0-9a-f-]{27}$/.test(r.title) ? L('Session sans titre', 'Untitled session') : r.title)}</div>${r.ask ? `<div class="bq">${esc(r.ask)}</div>` : ''}<div class="bp">${esc(niceProj(r.proj))}</div>${r.subTotal ? `<div class="bm">👥 ${r.subActive}/${r.subTotal} ${L('sous-agents actifs', 'sub-agents active')}</div>` : ''}</div>`;
2507
+ return `<div class="bcard ${r.state}" tabindex="0" role="button" data-p="${esc(r.proj)}" data-i="${esc(r.id)}"><div class="bh"><span class="stc ${r.state}">${ic} ${L(fr, en)}${extra}</span>${pr}${put}</div><div class="bt">${esc(/^[0-9a-f]{8}-[0-9a-f-]{27}$/.test(r.title) ? L('Session sans titre', 'Untitled session') : r.title)}</div>${r.ask ? `<div class="bq">${esc(r.ask)}</div>` : ''}<div class="bp">${esc(niceProj(r.proj))}</div>${took ? `<div class="bm">${took}</div>` : ''}${r.subTotal ? `<div class="bm">👥 ${r.subActive}/${r.subTotal} ${L('sous-agents actifs', 'sub-agents active')}</div>` : ''}</div>`;
2464
2508
  }
2465
2509
  function paintBoard() {
2466
2510
  if (!boardAll || !document.body.classList.contains('board')) return; const now = Date.now(), recent = (a, b) => b.mtime - a.mtime;
@@ -2573,7 +2617,7 @@ async function visitSay(v, token) {
2573
2617
  $('#visit').onclick = (e) => { const v = S.visit; if (!v) return; if (e.target.closest('.vx')) hideVisit(); else goSession(v.r.proj, v.r.id); };
2574
2618
  async function sessPoll() {
2575
2619
  if (!S.live || S.demo || document.hidden || sessPoll.busy) return; sessPoll.busy = true;
2576
- try { const rows = await (await fetch('/api/board')).json(); if (Array.isArray(rows) && S.live && !S.demo) { S.rows = rows; knocks(); paintTabs(); } } catch {} finally { sessPoll.busy = false; }
2620
+ try { const t0 = Date.now(), rows = await (await fetch('/api/board')).json(); if (Array.isArray(rows) && S.live && !S.demo) { S.rows = rows; S.rowsAt = t0; knocks(); paintTabs(); } } catch {} finally { sessPoll.busy = false; }
2577
2621
  }
2578
2622
  setInterval(sessPoll, 3000);
2579
2623
  async function setMode(m) {
@@ -2591,7 +2635,7 @@ async function setMode(m) {
2591
2635
  $('#liveProj').style.display = 'none';
2592
2636
  const rows = await (await fetch('/api/sessions')).json();
2593
2637
  $('#sessions').innerHTML = rows.map((r) => { const d = new Date(r.mtime).toLocaleString([], { month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' });
2594
- return `<option value="${esc(r.proj)}|${r.id}" data-title="${esc(r.title)}">${r.agents ? '👥' + r.agents + ' · ' : ''}${esc(r.title.slice(0, 40))} (${d})</option>`; }).join('');
2638
+ 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('');
2595
2639
  $('#empty').classList.remove('on'); const pick = rows.find((r) => r.id === Q.get('pin')) || rows.find((r) => r.agents) || rows[0]; if (!pick) { $('#empty').classList.add('on'); return; }
2596
2640
  $('#sessions').value = `${pick.proj}|${pick.id}`; await openSelected();
2597
2641
  }
@@ -2686,12 +2730,13 @@ async function exportVideo(from = 0, to = 0, clip = 0) { // clip: length in ms
2686
2730
  // =====================================================================
2687
2731
  function applyLang() {
2688
2732
  renderCharInfo(); packNote(); menuTip();
2733
+ try { for (const id in S.act) { const b = S.term[id], t = b && b[b.length - 1]; if (t && t.tool) S.act[id] = activityLabel(t.tool); } if (S.live) fillProjects(); } catch {} // what each agent is doing, and the list of projects, were written in the language before
2689
2734
  document.documentElement.lang = (LANGS.find((l) => l[0] === prefs.lang) || LANGS[0])[2];
2690
2735
  document.querySelectorAll('[data-fr]').forEach((el) => (el.textContent = FR() ? el.dataset.fr : tr(el.dataset.en)));
2691
2736
  document.querySelectorAll('#viewSeg button').forEach((b) => { b.title = b.textContent; }); // in a narrow window they are icons: the name stays as a tooltip
2692
2737
  $('#callTrMi').style.display = CALL_LANG[prefs.lang] && !FR() ? '' : 'none';
2693
2738
  const sel = $('#langSel'); if (!sel.options.length) sel.innerHTML = LANGS.map(([c, n]) => `<option value="${c}">${n}</option>`).join(''); sel.value = prefs.lang;
2694
- [['#bPlay', L('Pause / Lecture (espace)', 'Pause / Play (space)')], ['#bLog', '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')], ['#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…'); document.querySelectorAll('#reactBar button').forEach((b) => b.setAttribute('aria-label', b.dataset.e));
2739
+ [['#bPlay', L('Pause / Lecture (espace)', 'Pause / Play (space)')], ['#bLog', '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')], ['#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));
2695
2740
  $('#gT').textContent = L('Rejoindre l’appel', 'Join the call'); $('#gP').textContent = L('Cliquez pour activer le son et suivre votre session Claude Code en direct.', 'Click to enable sound and follow your Claude Code session live.'); $('#gB').textContent = L('▶ Rejoindre', '▶ Join');
2696
2741
  $('#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('Lancez Claude Code dans {0} : l’appel démarrera tout seul.', 'Start Claude Code in {0} — the call will start by itself.')).replace('{0}', `<b>${esc(watched())}</b>`) : esc(L('Lancez Claude Code dans ce dossier : l’appel démarrera tout seul.', 'Start Claude Code in this folder — the call will start by itself.'));
2697
2742
  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; } }
@@ -2872,7 +2917,7 @@ function paintPill() {
2872
2917
  sess = true; const st = {}, by = { working: [], waiting: [], blocked: [], stalled: [], done: [], idle: [] };
2873
2918
  for (const id in S.agents) if (id !== 'user' && !S.gone.has(id) && (id === 'main' || S.status[id])) { st[id] = agentState(id, now); by[st[id].k].push(id); }
2874
2919
  const what = (id) => `${nameOf(id)} — ${st[id].txt.replace(/^\S+\s/, '')}`, more = (a) => (a.length > 1 ? ` +${a.length - 1}` : ''), lead = st.main || { k: 'idle' };
2875
- if (by.blocked.length) { cls = 'blocked'; to = by.blocked[0]; txt = '✋ ' + what(to) + more(by.blocked); }
2920
+ if (by.blocked.length) { cls = 'blocked'; to = by.blocked[0]; const q = st[to].ask || ''; txt = '✋ ' + what(to) + more(by.blocked) + (q ? ' · ' + (q.length > 110 ? q.slice(0, 108).replace(/\s+\S*$/, '') + '…' : q) : ''); if (q) tip = q; } // the question or the command it waits on, next to its timer
2876
2921
  else if (by.stalled.length) { cls = 'stalled'; to = by.stalled[0]; txt = '⚠ ' + what(to) + more(by.stalled); }
2877
2922
  else if (by.working.length || by.waiting.length) { // "2 working · Margot — waiting on Ken, Mira", or what the only one at work is doing
2878
2923
  const w = by.working, wt = lead.k === 'waiting' ? 'main' : w.length ? '' : by.waiting[0]; cls = 'working'; to = wt || (w.length === 1 ? w[0] : 'main');
@@ -263,6 +263,7 @@
263
263
  "The shop is not open yet.": "Butikken er ikke åben endnu.",
264
264
  "The shop cannot be reached. Check your connection and try again.": "Butikken kan ikke nås. Tjek din forbindelse, og prøv igen.",
265
265
  "Hand-drawn Halloween characters, each in its own room.": "Håndtegnede Halloween-figurer, hver i sit eget rum.",
266
+ "Entirely optional: the app stays free. It is a way to support the artist and the developer.": "Helt valgfrit: appen forbliver gratis. Det er en måde at støtte kunstneren og udvikleren på.",
266
267
  "One payment, by card, on a Stripe page. No account.": "Én betaling med kort på en Stripe-side. Ingen konto.",
267
268
  "Buy": "Køb",
268
269
  "I already bought it": "Jeg har allerede købt den",
@@ -304,5 +305,27 @@
304
305
  "Got it": "Forstået",
305
306
  "Reset to defaults": "Nulstil til standard",
306
307
  "Your settings moved: the everyday ones are here, the rest in “All settings”.": "Dine indstillinger er flyttet: de daglige er her, resten under “Alle indstillinger”.",
307
- "2 € minimum: you can pay more on the payment page if you like.": "Mindst 2 €: du kan betale mere på betalingssiden, hvis du vil."
308
+ "2 € minimum: you can pay more on the payment page if you like.": "Mindst 2 €: du kan betale mere på betalingssiden, hvis du vil.",
309
+ "worked": "arbejdede",
310
+ "waiting on you for": "venter på dig i",
311
+ "working for": "arbejder i",
312
+ "(one or more)": "(et eller flere)",
313
+ "(pick one)": "(vælg ét)",
314
+ "Answer it in Claude Code": "Svar i Claude Code",
315
+ "asks permission to use": "beder om lov til at bruge",
316
+ "asks to edit this file": "beder om at redigere denne fil",
317
+ "asks to open this page": "beder om at åbne denne side",
318
+ "asks to run this command": "beder om at køre denne kommando",
319
+ "has a question for you": "har et spørgsmål til dig",
320
+ "has several questions for you": "har flere spørgsmål til dig",
321
+ "Hide until the next question": "Skjul indtil næste spørgsmål",
322
+ "may be waiting for your go-ahead on this command": "venter måske på dit OK til denne kommando",
323
+ "may be waiting for your go-ahead to edit this file": "venter måske på dit OK til at redigere denne fil",
324
+ "proposes this plan": "foreslår denne plan",
325
+ "the numbers match the menu": "numrene svarer til menuen",
326
+ "What the session is waiting for from you": "Hvad sessionen venter på fra dig",
327
+ "is waiting for your answer": "venter på dit svar",
328
+ "A menu is open in Claude Code.": "En menu er åben i Claude Code.",
329
+ "Speed presets": "Hastighedsforvalg",
330
+ "pages": "sider"
308
331
  }
@@ -228,7 +228,7 @@
228
228
  "To tweak them, copy them into your folder and pick “My folder”.": "Zum Anpassen in deinen Ordner kopieren und „Mein Ordner“ wählen.",
229
229
  "My folder": "Mein Ordner",
230
230
  "The characters drawn by the app. Pick “My folder” for your own images, or a pack.": "Die von der App gezeichneten Figuren. Wähle „Mein Ordner“ für eigene Bilder oder ein Pack.",
231
- "A visitor when another session needs you": "Ein Besucher, wenn eine andere Sitzung Sie braucht",
231
+ "A visitor when another session needs you": "Ein Besucher, wenn eine andere Sitzung dich braucht",
232
232
  "Follow the Claude Code tab I am on": "Dem Claude Code-Tab folgen, in dem ich bin",
233
233
  "Go there": "Hingehen",
234
234
  "This file is no longer there": "Diese Datei gibt es nicht mehr",
@@ -236,7 +236,7 @@
236
236
  "Files created in this session": "In dieser Sitzung erstellte Dateien",
237
237
  "A file of the demo: nothing to open": "Eine Datei der Demo: nichts zu öffnen",
238
238
  "Could not open the folder": "Der Ordner konnte nicht geöffnet werden",
239
- "Files made for you, when a turn ends": "Für Sie erstellte Dateien, am Ende einer Runde",
239
+ "Files made for you, when a turn ends": "Für dich erstellte Dateien, am Ende einer Runde",
240
240
  "🐞 Report a problem": "🐞 Problem melden",
241
241
  "Report a problem": "Problem melden",
242
242
  "Nothing is sent from here. The button opens a draft on GitHub with the text below: read it, say what happened, then send it yourself.": "Von hier aus wird nichts gesendet. Die Schaltfläche öffnet auf GitHub einen Entwurf mit dem Text unten: Lies ihn, beschreibe, was passiert ist, und sende ihn dann selbst ab.",
@@ -252,7 +252,7 @@
252
252
  "Open on claude.ai": "Auf claude.ai öffnen",
253
253
  "Publishing ": "Veröffentliche ",
254
254
  "Showing ": "Zeige ",
255
- "This page uses libraries kept on other servers: they are loaded only if you ask": "Diese Seite nutzt Bibliotheken von anderen Servern: Sie werden nur geladen, wenn Sie es verlangen",
255
+ "This page uses libraries kept on other servers: they are loaded only if you ask": "Diese Seite nutzt Bibliotheken von anderen Servern: Sie werden nur geladen, wenn du es verlangst",
256
256
  "Mark as done": "Als erledigt markieren",
257
257
  "Open the pull request": "Pull Request öffnen",
258
258
  "Reopen": "Wieder öffnen",
@@ -262,8 +262,9 @@
262
262
  "This purchase was refunded.": "Dieser Kauf wurde erstattet.",
263
263
  "This payment is not complete yet.": "Diese Zahlung ist noch nicht abgeschlossen.",
264
264
  "The shop is not open yet.": "Der Shop ist noch nicht geöffnet.",
265
- "The shop cannot be reached. Check your connection and try again.": "Der Shop ist nicht erreichbar. Prüfen Sie Ihre Verbindung und versuchen Sie es erneut.",
265
+ "The shop cannot be reached. Check your connection and try again.": "Der Shop ist nicht erreichbar. Prüfe deine Verbindung und versuche es erneut.",
266
266
  "Hand-drawn Halloween characters, each in its own room.": "Handgezeichnete Halloween-Figuren, jede in ihrem eigenen Raum.",
267
+ "Entirely optional: the app stays free. It is a way to support the artist and the developer.": "Ganz freiwillig: Die App bleibt kostenlos. Es ist eine Möglichkeit, den Künstler und den Entwickler zu unterstützen.",
267
268
  "One payment, by card, on a Stripe page. No account.": "Eine einzige Zahlung per Karte auf einer Stripe-Seite. Kein Konto.",
268
269
  "Buy": "Kaufen",
269
270
  "I already bought it": "Ich habe es schon gekauft",
@@ -305,5 +306,27 @@
305
306
  "Got it": "Verstanden",
306
307
  "Reset to defaults": "Auf Standard zurücksetzen",
307
308
  "Your settings moved: the everyday ones are here, the rest in “All settings”.": "Deine Einstellungen sind umgezogen: die alltäglichen sind hier, der Rest unter „Alle Einstellungen“.",
308
- "2 € minimum: you can pay more on the payment page if you like.": "Mindestens 2 €: Auf der Zahlungsseite kannst du gern mehr zahlen."
309
+ "2 € minimum: you can pay more on the payment page if you like.": "Mindestens 2 €: Auf der Zahlungsseite kannst du gern mehr zahlen.",
310
+ "worked": "hat gearbeitet",
311
+ "waiting on you for": "wartet seit",
312
+ "working for": "arbeitet seit",
313
+ "(one or more)": "(eine oder mehrere)",
314
+ "(pick one)": "(eine Wahl)",
315
+ "Answer it in Claude Code": "In Claude Code beantworten",
316
+ "asks permission to use": "bittet um Erlaubnis für",
317
+ "asks to edit this file": "möchte diese Datei bearbeiten",
318
+ "asks to open this page": "möchte diese Seite öffnen",
319
+ "asks to run this command": "möchte diesen Befehl ausführen",
320
+ "has a question for you": "hat eine Frage an dich",
321
+ "has several questions for you": "hat mehrere Fragen an dich",
322
+ "Hide until the next question": "Bis zur nächsten Frage ausblenden",
323
+ "may be waiting for your go-ahead on this command": "wartet vielleicht auf dein OK für diesen Befehl",
324
+ "may be waiting for your go-ahead to edit this file": "wartet vielleicht auf dein OK, diese Datei zu bearbeiten",
325
+ "proposes this plan": "schlägt diesen Plan vor",
326
+ "the numbers match the menu": "die Nummern sind die des Menüs",
327
+ "What the session is waiting for from you": "Worauf die Sitzung von dir wartet",
328
+ "is waiting for your answer": "wartet auf deine Antwort",
329
+ "A menu is open in Claude Code.": "In Claude Code ist ein Menü offen.",
330
+ "Speed presets": "Geschwindigkeitsvorgaben",
331
+ "pages": "Seiten"
309
332
  }