@double_geste/agent-standup 1.37.0 → 1.38.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/README.md +2 -2
- package/bin/agent-standup.js +1 -1
- package/kokoro.js +2 -1
- package/package.json +1 -1
- package/public/index.html +185 -71
- package/public/locales/da.json +40 -10
- package/public/locales/de.json +40 -10
- package/public/locales/en.json +39 -9
- package/public/locales/es.json +40 -10
- package/public/locales/ja.json +40 -10
- package/public/locales/ko.json +40 -10
- package/public/locales/pt-BR.json +40 -10
- package/public/locales/zh-CN.json +40 -10
- package/public/locales/zh-TW.json +40 -10
- package/server.js +6 -6
package/public/index.html
CHANGED
|
@@ -26,13 +26,22 @@
|
|
|
26
26
|
.sp { flex:1 }
|
|
27
27
|
.tok { font-size:11px; font-weight:600; padding:3px 9px; border-radius:99px; background:var(--panel2); color:#c3c6d4; white-space:nowrap } .tok:hover { color:#fff }
|
|
28
28
|
.tbadge { position:absolute; top:30px; right:6px; display:flex; gap:4px; z-index:2; pointer-events:none } .tbadge span { font-size:10.5px; padding:1px 7px; border-radius:99px; background:rgba(14,15,24,.78); backdrop-filter:blur(6px) }
|
|
29
|
-
.tbadge .e { color:#ff7b72 } .tbadge .w { color:#79c0ff } .tbadge .s { color:#ffb347 } .tbadge .q { color:#9aa3bd }
|
|
29
|
+
.tbadge .e { color:#ff7b72 } .tbadge .w { color:#79c0ff } .tbadge .s { color:#ffb347 } .tbadge .q { color:#9aa3bd } .tbadge [data-tip] { pointer-events:auto; cursor:help }
|
|
30
|
+
#btip { position:fixed; z-index:30; top:0; left:0; width:max-content; max-width:min(360px, calc(100vw - 16px)); padding:12px 12px 10px; border-radius:12px; background:rgba(22,25,40,.97); border:1px solid rgba(255,255,255,.09); box-shadow:0 18px 48px rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.3); backdrop-filter:blur(10px); color:var(--text); font-size:12.5px; line-height:1.45; pointer-events:none; opacity:0; transform:translateY(-4px); transition:opacity .14s ease, transform .14s ease; visibility:hidden }
|
|
31
|
+
#btip.on { opacity:1; transform:none; visibility:visible } #btip.k-e { --c:#ff7b72; --cb:rgba(255,123,114,.15) } #btip.k-w { --c:#79c0ff; --cb:rgba(121,192,255,.15) } #btip.k-l { --c:#d2a8ff; --cb:rgba(210,168,255,.15) } #btip.k-s { --c:#ffb347; --cb:rgba(255,179,71,.15) } #btip.k-q { --c:#9aa3bd; --cb:rgba(154,163,189,.15) }
|
|
32
|
+
#btip .bh { display:flex; align-items:center; gap:8px; padding:0 2px } #btip .bi { flex:none; width:24px; height:24px; border-radius:7px; display:grid; place-items:center; font-size:12.5px; background:var(--cb); color:var(--c) } #btip .bt { font-weight:650; font-size:13px; white-space:nowrap } #btip .bn { padding:0 7px; border-radius:99px; background:var(--cb); color:var(--c); font-size:11px; font-weight:700; line-height:18px } #btip .ba { margin-left:auto; padding-left:14px; color:var(--dim); font-size:11.5px; white-space:nowrap }
|
|
33
|
+
#btip ul { list-style:none; margin:10px 0 0; padding:0; display:flex; flex-direction:column; gap:6px } #btip li { padding:7px 9px 8px; border-radius:8px; background:rgba(255,255,255,.045); box-shadow:inset 2px 0 0 var(--c); min-width:0 } #btip .r1 { display:flex; align-items:center; gap:8px } #btip .rk { font-weight:600 } #btip .rn { min-width:0; color:var(--dim); font-size:11.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap } #btip .rt { margin-left:auto; padding-left:10px; color:var(--dim); font-size:11px; font-variant-numeric:tabular-nums; white-space:nowrap }
|
|
34
|
+
#btip .pill { font-size:10.5px; font-weight:650; padding:1px 6px; border-radius:5px; background:rgba(255,255,255,.08); color:#cfd6e6 } #btip code { display:block; margin-top:3px; font:11.5px/1.45 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; color:#d6dcea; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
|
|
35
|
+
#btip .ro { margin-top:5px; padding:5px 7px; border-radius:6px; background:rgba(255,123,114,.08); font:11px/1.45 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; color:#ffc1bb } #btip .ro div { overflow:hidden; text-overflow:ellipsis; white-space:nowrap } #btip .bf { margin:8px 2px 0; color:var(--dim); font-size:11px } #btip .bf + .bf { margin-top:2px }
|
|
36
|
+
@media (prefers-reduced-motion:reduce) { #btip { transition:none } }
|
|
30
37
|
.tile.slow { border-color:#ff9f1c !important; animation:slowp 1.6s ease-in-out infinite } @keyframes slowp { 50% { box-shadow:0 0 0 4px rgba(255,159,28,.35) } }
|
|
31
38
|
.tile.quiet { opacity:.72 }
|
|
32
39
|
.tag .tk { color:#aab2c5; font-size:10px } .tag .tk:empty { display:none }
|
|
33
40
|
.tile.focus .tag .tk, #pcam .tag .tk { font-size:11.5px; color:#cfd6e6 } body:not(.compact):not(.presenting) .tile.focus .tag .tk:not(:empty)::after { content:' ' attr(data-w) } /* what an agent has used so far, readable where there is room: the large tile (with the word) and the camera of the one who shares a screen */
|
|
34
41
|
.keys { padding:6px 10px 4px; color:var(--dim); font-size:10.5px; line-height:1.5 }
|
|
35
42
|
/* the status of the session: a pill in the header of a wide window, a line of its own under the header from 1080 px down (#sline), where it stays readable in the narrowest side panel. Two lines at most, the whole text in the tooltip */
|
|
43
|
+
#attn { flex:none; display:flex; align-items:center; gap:8px; width:100%; min-width:0; padding:5px 12px; border-bottom:1px solid #ff8a80; background:#c0392b; color:#fff; font-weight:600; font-size:12.5px; text-align:left } #attn[hidden] { display:none } #attn:hover { filter:brightness(1.1) } #attn:focus-visible { outline:2px solid #fff; outline-offset:-3px }
|
|
44
|
+
#attn .aw { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap } #attn .am { flex:none; padding:0 8px; border-radius:99px; background:rgba(0,0,0,.25); font-size:11.5px } #attn .ak { flex:none; opacity:.8; font-weight:500; font-size:11px } /* what needs you, here or in another session: one line in every view, a click goes there (G) */
|
|
36
45
|
#pill, #sline { font-weight:600; background:var(--panel2); color:var(--dim); cursor:default; overflow:hidden; -webkit-box-orient:vertical; -webkit-line-clamp:2 }
|
|
37
46
|
#pill { display:-webkit-box; font-size:11px; letter-spacing:.04em; line-height:1.3; padding:3px 9px; border-radius:12px; max-width:min(34vw,440px) } #sline { display:none; flex:none; font-size:12px; line-height:1.4; padding:5px 12px; border-bottom:1px solid var(--line) }
|
|
38
47
|
:is(#pill, #sline).go { cursor:pointer } :is(#pill, #sline).go:hover { filter:brightness(1.15) } :is(#pill, #sline).off { color:#fff; background:#b3261e; box-shadow:inset 0 0 0 1.5px #ff8a80 } :is(#pill, #sline).blocked { color:#fff; background:#c0392b } :is(#pill, #sline).stalled { color:#1b1d27; background:#ffb347 }
|
|
@@ -40,17 +49,19 @@
|
|
|
40
49
|
@media (max-width:1080px) { #pill { display:none } #sline { display:-webkit-box } } @media (max-width:760px) { #sline::after { content:attr(data-sub); font-weight:400; opacity:.8 } } @media (max-width:400px) { #sline { -webkit-line-clamp:3 } }
|
|
41
50
|
@media (min-width:1081px) { header .brand { min-width:150px } #pill { flex-shrink:20 } .tok, .ctxp { flex-shrink:0 } } /* wide: a long status gives way before the name and the counters */
|
|
42
51
|
/* several sessions at once (live): the sessions of the moment as tabs under the header, the one the call is in among them, each with its state; and a visitor from another session that needs you, who takes you there on a click */
|
|
43
|
-
#tabs { display:none; flex:none; align-items:center; gap:5px; padding:4px 10px; border-bottom:1px solid var(--line); overflow-x:auto; scrollbar-width:none } #tabs::-webkit-scrollbar { display:none } #tabs:not(:empty) { display:flex }
|
|
52
|
+
#tabs { display:none; flex:none; align-items:center; gap:5px; padding:4px 10px; border-bottom:1px solid var(--line); overflow-x:auto; scrollbar-width:none } #tabs::-webkit-scrollbar { display:none } #tabs:not(:empty) { display:flex } #tabs .why { margin-left:auto; flex:none; padding-left:10px; color:var(--dim); font-size:11px; white-space:nowrap; cursor:default } body.narrow #tabs .why { display:none }
|
|
44
53
|
.stab { flex:0 1 auto; min-width:92px; max-width:190px; display:flex; align-items:center; gap:5px; padding:2px 9px; border-radius:99px; border:1px solid var(--line); color:var(--dim); font-size:11.5px; line-height:1.5; white-space:nowrap } .stab span { overflow:hidden; text-overflow:ellipsis } .stab i { flex:none; font-style:normal; font-size:9px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; padding:0 5px; border-radius:99px; border:1px solid currentColor; opacity:.85 } .stab:hover { color:var(--text); border-color:var(--accent) }
|
|
45
54
|
.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
55
|
#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
56
|
#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(
|
|
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 {
|
|
51
|
-
#askc .
|
|
52
|
-
#askc
|
|
53
|
-
#askc .
|
|
57
|
+
#askc { position:absolute; left:12px; bottom:14px; z-index:6; display:none; align-items:flex-end; gap:8px; max-width:min(520px,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 */
|
|
58
|
+
#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 } @media (max-width:520px) { #askc .awho { display:none } }
|
|
59
|
+
#askc .asay { min-width:0; display:flex; flex-direction:column; max-height:min(60vh,480px); overflow:hidden; background:#fff; color:#1b1d27; border-radius:12px 12px 12px 3px; font-size:13px; line-height:1.45; box-shadow:0 6px 20px rgba(0,0,0,.42); overflow-wrap:break-word } /* a head and a foot that stay, the menu between them scrolls */
|
|
60
|
+
#askc .ahd { flex:none; display:flex; align-items:center; gap:6px; padding:7px 6px 6px 12px; border-bottom:1px solid #eceef4; color:#5a6072; font-size:11.5px } #askc .ahd span:first-child { min-width:0; flex:1 } #askc .ak-t { flex:none; color:#c62828; font-weight:600; font-variant-numeric:tabular-nums } #askc .abody { min-height:0; overflow:auto; overscroll-behavior:contain; padding:9px 12px 11px; scrollbar-width:thin } #askc .aab { margin:0 0 4px }
|
|
61
|
+
#askc .aqs + .aqs { margin-top:11px; padding-top:10px; border-top:1px solid #eceef4 } #askc .aqh { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-bottom:4px; font-size:11px; color:#5a6072 } #askc .atag { padding:1px 8px; border-radius:99px; background:#eef1ff; color:#3949ab; font-weight:600 } #askc .anum { font-variant-numeric:tabular-nums } #askc .aq { margin:0 0 8px; font-size:13.5px; font-weight:500; text-wrap:pretty }
|
|
62
|
+
#askc .aops { list-style:none; margin:0; padding:0; display:grid; gap:5px } #askc .aops li { display:grid; grid-template-columns:20px 1fr; gap:9px; align-items:start; padding:6px 9px; border:1px solid #e6e7ee; border-radius:8px; background:#f8f9fc } #askc .aops i { width:20px; height:20px; margin-top:1px; border-radius:50%; background:#1b1d27; color:#fff; font:700 11px/20px system-ui,sans-serif; text-align:center } #askc .multi .aops i { border-radius:5px } #askc .aops b { display:block; font-weight:600 } #askc .aops span { display:block; margin-top:1px; color:#5a6072; font-size:12px; line-height:1.4; text-wrap:pretty } /* a round number for one choice, a square one for several, as radio buttons and boxes */
|
|
63
|
+
#askc pre { margin:0; padding:7px 9px; background:#f1f2f6; border-radius:7px; font:12px/1.45 ui-monospace,Menlo,Consolas,monospace; white-space:pre-wrap } #askc .afoot { flex:none; padding:6px 12px 7px; border-top:1px solid #eceef4; background:#f7f8fb; color:#5a6072; font-size:11.5px }
|
|
64
|
+
#askc .ax { flex:none; 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 }
|
|
54
65
|
#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 }
|
|
55
66
|
#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) }
|
|
56
67
|
@keyframes pulse { 50% { opacity:.3 } }
|
|
@@ -74,7 +85,7 @@
|
|
|
74
85
|
.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 }
|
|
75
86
|
.rr:hover { background:#2a2f45 } .rr.sel { outline:1px solid var(--accent) }
|
|
76
87
|
.rr .n { display:flex; align-items:center; gap:7px; min-width:0 } .rr .dot { width:9px; height:9px; border-radius:50%; flex:none } .rr b { font-size:12.5px } .rr .ro { color:var(--dim); font-size:11px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0 }
|
|
77
|
-
.rr .st { font-size:11.5px; overflow:hidden;
|
|
88
|
+
.rr .st { font-size:11.5px; overflow:hidden; overflow-wrap:anywhere; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical } /* two lines before it is cut; the whole text is in the tooltip */
|
|
78
89
|
.rr .rt { margin-left:auto; flex:none; padding-left:6px; color:#aab2c5; font-size:10.5px; white-space:nowrap } .rr.left { opacity:.72; padding-top:4px; padding-bottom:4px } .rr.left:hover { opacity:1 } /* what each agent has used so far; those who left the call keep their line, and their count with it */
|
|
79
90
|
.rr.k-working { border-left-color:var(--gold) } .rr.k-working .st { color:var(--gold) } .rr.k-waiting { border-left-color:#8fd3ff } .rr.k-waiting .st { color:#8fd3ff }
|
|
80
91
|
.rr.k-blocked { border-left-color:#ff5252; background:rgba(192,57,43,.28) } .rr.k-blocked .st { color:#fff; font-weight:700 } .rr.k-stalled { border-left-color:#ffb347 } .rr.k-stalled .st { color:#ffb347; font-weight:700 }
|
|
@@ -87,6 +98,7 @@
|
|
|
87
98
|
.bcard .bt { font-weight:600; font-size:13.5px; overflow:hidden; text-overflow:ellipsis; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical } .bcard .bp, .bcard .bm { color:var(--dim); font-size:11.5px }
|
|
88
99
|
.bcard .stc { align-self:flex-start } .bcard .bh { display:flex; align-items:center; gap:6px; min-width:0 } .bcard .bh .stc { overflow:hidden; text-overflow:ellipsis }
|
|
89
100
|
.bcard .bq { font-size:12.5px; color:var(--text); border-left:2px solid #ff5252; padding-left:8px; overflow:hidden; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical }
|
|
101
|
+
.bfilt { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 14px } .bft { padding:2px 11px; border-radius:99px; border:1px solid var(--line); color:var(--dim); font-size:12px } .bft:hover { color:var(--text) } .bft.on { color:var(--text); border-color:var(--accent); background:var(--panel2) } .bft i { font-style:normal; opacity:.7 } details.bidle > summary { cursor:pointer; list-style:none } details.bidle > summary::-webkit-details-marker { display:none } details.bidle:not([open]) > summary::after { content:'▸'; margin-left:2px; opacity:.6 }
|
|
90
102
|
.bsec { margin-bottom:18px } .bhd { display:flex; align-items:center; gap:7px; margin:0 0 9px; font-size:12.5px; font-weight:700; color:var(--dim) } .bhd.blocked { color:#ff8a80 } .bhd.turn { color:var(--text) }
|
|
91
103
|
.bhd .bl { display:inline-block } .bhd .bl::first-letter { text-transform:uppercase } .bhd i { font-style:normal; font-weight:600; font-size:11.5px; padding:0 7px; border-radius:99px; background:var(--panel2); border:1px solid var(--line) }
|
|
92
104
|
.bdone summary { cursor:pointer; list-style:none } .bdone summary::-webkit-details-marker { display:none } .bdone summary::after { content:'▸' } .bdone[open] summary::after { content:'▾' } .bdone .bcard { opacity:.7 }
|
|
@@ -123,6 +135,7 @@
|
|
|
123
135
|
.prop.cheer { animation:cheer 1.1s ease-out both } @keyframes cheer { 0% { transform:scale(.3) translateY(10px); opacity:0 } 40% { transform:scale(1.25); opacity:1 } 100% { transform:translateY(-14px); opacity:0 } }
|
|
124
136
|
/* ---------- screen sharing (presentation mode) ---------- */
|
|
125
137
|
#present { display:none; flex:0 1 auto; min-height:96px; overflow:hidden; position:relative; height:clamp(190px,46vh,430px); background:radial-gradient(ellipse at 50% 0,#1b2033,#0b0d14); border-bottom:1px solid var(--line); padding:12px 16px; justify-content:center }
|
|
138
|
+
body.focusl #present { height:clamp(240px,58vh,900px) } body.focusl #present.pic { height:clamp(260px,68vh,1000px) } body.focusl #present.pin { height:clamp(240px,74vh,1000px) } /* Focus layout: the shared screen gets the room the characters gave up */
|
|
126
139
|
#present.on { display:flex; animation:fadein .3s } #present.pic { height:clamp(220px,60vh,640px) }
|
|
127
140
|
.pwin { flex:0 1 900px; display:flex; flex-direction:column; border-radius:10px; overflow:hidden; background:#0d1117; box-shadow:0 18px 50px rgba(0,0,0,.6), 0 0 0 2px rgba(240,160,32,.55) }
|
|
128
141
|
.pbar { display:flex; align-items:center; gap:6px; padding:7px 10px; background:#1c1f2b; font-size:11.5px; color:#9aa0b4 } .pbar i { width:10px; height:10px; border-radius:50%; display:inline-block }
|
|
@@ -189,6 +202,7 @@
|
|
|
189
202
|
.tag b, .tag span { background:rgba(14,15,24,.78); backdrop-filter:blur(6px); padding:2px 9px; border-radius:99px; font-size:11.5px; white-space:nowrap }
|
|
190
203
|
.tag span { color:#e3e6f0; font-size:10.5px; overflow:hidden; text-overflow:ellipsis; min-width:0 }
|
|
191
204
|
.status { position:absolute; top:6px; right:6px; font-size:11.5px; font-weight:600; padding:2px 9px; border-radius:99px; background:rgba(14,15,24,.8); backdrop-filter:blur(6px) }
|
|
205
|
+
#stage .tile .status { white-space:normal; overflow-wrap:anywhere; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; line-height:1.3; border-radius:10px } #stage .tile .status:empty { display:none } /* what a tile is doing: two lines before it is cut */
|
|
192
206
|
.status.working { color:var(--gold) } .status.done { color:var(--ok) } .status.turn { color:#0b1020; background:var(--accent) }
|
|
193
207
|
.status.waiting { color:#8fd3ff } .status.blocked { color:#fff; background:#c0392b; font-weight:700 } .status.stalled { color:#1b1d27; background:#ffb347; font-weight:700 }
|
|
194
208
|
.tile.waiting { border-color:rgba(110,190,255,.85) } .tile.blocked { border-color:#ff5252 !important; animation:slowp 1.2s ease-in-out infinite } .tile.stalled { border-color:#ffb347 !important }
|
|
@@ -239,10 +253,11 @@
|
|
|
239
253
|
.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)) }
|
|
240
254
|
|
|
241
255
|
/* ---------- overlays ---------- */
|
|
242
|
-
#
|
|
243
|
-
#
|
|
244
|
-
|
|
245
|
-
#
|
|
256
|
+
#empty { position:absolute; inset:0; z-index:4; display:none; flex-direction:column; align-items:center; justify-content:center; gap:14px; text-align:center; padding:24px; background:var(--bg) }
|
|
257
|
+
#empty.on { display:flex } #empty.on ~ #gate { display:none } /* no session at all: the empty state and its demo button are what there is to see */
|
|
258
|
+
#gate { position:absolute; top:10px; left:50%; transform:translateX(-50%); z-index:7; display:none } #gate.on { display:block } #gate .cta { padding:7px 16px; font-size:13px; box-shadow:0 6px 20px rgba(0,0,0,.45); white-space:nowrap } /* the call plays at once, silent: this chip (or any click) turns its sound on, which a browser allows only after one */
|
|
259
|
+
body:has(#empty.on) .toast.offer { display:none !important } /* the lines that offer something wait for the call */
|
|
260
|
+
#empty h2 { margin:0; font:800 22px "Comic Sans MS","Chalkboard SE",system-ui,sans-serif } #empty p { margin:0; color:var(--dim); max-width:380px } #eP b { color:var(--text) }
|
|
246
261
|
.cta { background:var(--accent); color:#0b1020; font-weight:700; padding:10px 22px; border-radius:99px; font-size:14px } .cta:hover { filter:brightness(1.1) } .cta:empty { display:none }
|
|
247
262
|
.btn { background:var(--panel2); border:1px solid var(--line); padding:6px 12px; border-radius:8px } .btn:hover { border-color:var(--accent) }
|
|
248
263
|
#menu { position:absolute; top:52px; right:10px; z-index:12; width:280px; background:var(--panel); border:1px solid var(--line); border-radius:12px; box-shadow:0 14px 40px rgba(0,0,0,.55); padding:6px; display:none; max-height:calc(100vh - 62px); max-height:calc(100dvh - 62px); overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin } /* never taller than the window: it scrolls instead of being cut off */
|
|
@@ -326,6 +341,7 @@
|
|
|
326
341
|
<button class="ic" id="bMenu" title="Réglages">⚙</button>
|
|
327
342
|
</header>
|
|
328
343
|
<div id="sline"></div>
|
|
344
|
+
<button id="attn" hidden></button>
|
|
329
345
|
<div id="tabs" role="tablist" aria-label="Sessions"></div>
|
|
330
346
|
|
|
331
347
|
<div id="menu">
|
|
@@ -361,6 +377,7 @@
|
|
|
361
377
|
<button class="mi" id="mReport"><span data-fr="🐞 Signaler un problème" data-en="🐞 Report a problem">🐞 Signaler un problème</span></button>
|
|
362
378
|
</div>
|
|
363
379
|
<div id="menuTip" role="status" style="display:none"><span id="menuTipT"></span><button class="btn" id="menuTipOk"></button></div>
|
|
380
|
+
<div id="btip" role="tooltip"></div>
|
|
364
381
|
<div id="coffeeTip" role="status" style="display:none"><span id="coffeeTipT"></span><div class="rtb"><button class="btn" id="coffeeNo"></button><button class="btn" id="coffeeYes"></button></div></div>
|
|
365
382
|
<div id="rateTip" role="status" style="display:none"><span id="rateTipT"></span><div class="rtb"><button class="btn" id="rateNo"></button><button class="btn" id="rateLater"></button><button class="btn" id="rateYes"></button></div></div>
|
|
366
383
|
<div id="prefs" role="dialog" aria-modal="true" aria-labelledby="prefsT"><div class="pbox">
|
|
@@ -378,6 +395,7 @@
|
|
|
378
395
|
</div><div class="pcol">
|
|
379
396
|
<h4 data-fr="Affichage" data-en="Display">Affichage</h4>
|
|
380
397
|
<button class="mi" data-t="roster"><span data-fr="Liste des agents (à gauche)" data-en="Agents list (left)">Liste des agents (à gauche)</span><i class="sw"></i></button>
|
|
398
|
+
<button class="mi" data-t="focusLayout"><span data-fr="Mise en page concentrée : petites caméras, grand écran partagé" data-en="Focus layout: small cameras, big shared screen">Mise en page concentrée : petites caméras, grand écran partagé</span><i class="sw"></i></button>
|
|
381
399
|
<button class="mi" data-t="reactions"><span data-fr="Barre de réactions (👍 👏 ☕)" data-en="Reactions bar (👍 👏 ☕)">Barre de réactions (👍 👏 ☕)</span><i class="sw"></i></button>
|
|
382
400
|
<button class="mi" data-t="banter"><span data-fr="Petites répliques et animations" data-en="Little lines & animations">Petites répliques et animations</span><i class="sw"></i></button>
|
|
383
401
|
<div class="box"><div class="lbl"><span data-fr="Bavardage entre agents" data-en="Chatter between agents">Bavardage entre agents</span></div><select id="chatSel"><option value="quiet" data-fr="Discret" data-en="Quiet">Discret</option><option value="normal" data-fr="Normal" data-en="Normal">Normal</option><option value="lively" data-fr="Animé" data-en="Lively">Animé</option></select></div>
|
|
@@ -386,6 +404,7 @@
|
|
|
386
404
|
<button class="mi" data-t="files"><span data-fr="Fichiers créés pour vous, à la fin d’un tour" data-en="Files made for you, when a turn ends">Fichiers créés pour vous, à la fin d’un tour</span><i class="sw"></i></button>
|
|
387
405
|
<button class="mi" data-t="artNet"><span data-fr="Artifacts : charger leurs bibliothèques (depuis Internet)" data-en="Artifacts: load their libraries (from the internet)">Artifacts : charger leurs bibliothèques (depuis Internet)</span><i class="sw"></i></button>
|
|
388
406
|
<button class="mi" data-t="visits"><span data-fr="Un visiteur quand une autre session vous attend" data-en="A visitor when another session needs you">Un visiteur quand une autre session vous attend</span><i class="sw"></i></button>
|
|
407
|
+
<button class="mi" data-t="askCard"><span data-fr="Une carte avec ce que la session vous demande" data-en="A card with what the session asks you">Une carte avec ce que la session vous demande</span><i class="sw"></i></button>
|
|
389
408
|
<button class="mi" data-t="followTab" id="mFollowTab" style="display:none"><span data-fr="Suivre l’onglet Claude Code affiché" data-en="Follow the Claude Code tab I am on">Suivre l’onglet Claude Code affiché</span><i class="sw"></i></button>
|
|
390
409
|
</div></div>
|
|
391
410
|
<div class="pfoot"><button class="btn" id="prefsReset" data-fr="Réglages par défaut" data-en="Reset to defaults">Réglages par défaut</button></div>
|
|
@@ -402,7 +421,7 @@
|
|
|
402
421
|
<canvas id="gantt" height="90"></canvas>
|
|
403
422
|
<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>
|
|
404
423
|
<div id="empty"><h2 id="eT"></h2><p id="eP"></p><button class="cta" id="eDemo"></button></div>
|
|
405
|
-
<div id="gate"><
|
|
424
|
+
<div id="gate"><button class="cta" id="gB"></button></div>
|
|
406
425
|
<div id="detail"><div class="hd"><b id="dname"></b><button class="ic" id="dclose">✕</button></div><div id="dbody"></div></div>
|
|
407
426
|
</section>
|
|
408
427
|
<aside><h2 id="logH">Transcript</h2><input id="logQ" type="search" placeholder="Search…" aria-label="Search the transcript" style="margin:8px 10px;width:calc(100% - 20px)"><div id="log"></div></aside>
|
|
@@ -442,7 +461,7 @@ const Q = new URLSearchParams(location.search);
|
|
|
442
461
|
const EMBED = Q.get('embed') === '1' || window.parent !== window;
|
|
443
462
|
const APP = window.AS_APP && typeof window.AS_APP === 'object' && typeof window.AS_APP.rate === 'string' ? window.AS_APP : { kind: '', rate: 'https://github.com/Atoll92/agent-standup' }; // where this page runs (appKind in server.js)
|
|
444
463
|
|
|
445
|
-
let prefs = { lang: 'en', voice: true, roster: true, banter: true, reactions: false, office: false, officeVol: 0.8, vstyle: 'kokoro', notify: false, epi: false, vanish: true, music: false, station: 'fip', musicVol: 0.35, view: 'call', hideCode: false, ownNames: true, visits: true, followTab: true, files: true, callTr: true };
|
|
464
|
+
let prefs = { lang: 'en', voice: true, roster: true, banter: true, reactions: false, office: false, officeVol: 0.8, vstyle: 'kokoro', notify: false, epi: false, vanish: true, music: false, station: 'fip', musicVol: 0.35, view: 'call', hideCode: false, ownNames: true, visits: true, askCard: false, followTab: true, files: true, callTr: true };
|
|
446
465
|
const PREF_DEFAULTS = { ...prefs }; // for ⚙ → All settings → Reset to defaults
|
|
447
466
|
{ 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
|
|
448
467
|
const sv = window.SAVED_PREFS && typeof window.SAVED_PREFS === 'object' ? window.SAVED_PREFS : {}; Object.assign(prefs, (sv._t || 0) > (loc._t || 0) ? sv : loc); }
|
|
@@ -628,7 +647,8 @@ function renderFolder(el, mine) { // one's own pictures: where they are, a but
|
|
|
628
647
|
$('#charReload').onclick = () => reloadChars(); if ($('#charOpen')) $('#charOpen').onclick = () => window.parent.postMessage({ agentStandup: 'openCharacters' }, '*');
|
|
629
648
|
}
|
|
630
649
|
function packNote() { // once, to someone who is the vampire without the pack: where the rest of the cast is
|
|
631
|
-
const
|
|
650
|
+
const d = new Date(), season = d.getMonth() === 9 || (d.getMonth() === 10 && d.getDate() <= 2); // its words say “this Halloween”: they stop on 2 November, the pack stays in ⚙ → Characters
|
|
651
|
+
const on = CHARS.youFrom === 'vampire' && !prefs.vampSeen && !Q.get('demo') && !(SHOP.halloween && SHOP.halloween.n) && season && !firstDay() && !askedToday('pack') && $('#vOffer').style.display === 'none', el = $('#packNote'); if (!el) return; el.style.display = on ? '' : 'none'; if (!on) return; noteAsk('pack');
|
|
632
652
|
$('#packNoteT').textContent = 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.'); $('#packNoteB').textContent = L('Voir le pack', 'See the pack');
|
|
633
653
|
}
|
|
634
654
|
function persona(a) { const p = persona0(a); p.custom = customFor(a.id); return p; }
|
|
@@ -873,7 +893,7 @@ function updateHint() {
|
|
|
873
893
|
// =====================================================================
|
|
874
894
|
const AUD = {
|
|
875
895
|
ctx: null, muted: false, live: new Set(), lastClick: 0,
|
|
876
|
-
off() { return this.muted || !!(S.owner && S.owner !== CID); }, // muted here, or another window holds the sound
|
|
896
|
+
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
|
|
877
897
|
init() {
|
|
878
898
|
if (this.ctx) { this.ctx.resume(); return; }
|
|
879
899
|
let c; try { c = this.ctx = new (window.AudioContext || window.webkitAudioContext)(); } catch { return; }
|
|
@@ -1185,7 +1205,7 @@ function pieces(text) {
|
|
|
1185
1205
|
const capTimers = new Map(); // agent id → timers that advance its subtitle
|
|
1186
1206
|
function captionClear(id) { (capTimers.get(id) || []).forEach(clearTimeout); capTimers.delete(id); }
|
|
1187
1207
|
function setCaption(id, text) {
|
|
1188
|
-
const t =
|
|
1208
|
+
const t = document.getElementById('t-' + id), b = t && t.querySelector('.bubble'), say = S.say[id]; if (!b || !say) return; // by id: a visitor's id holds a session path (":" and "/"), which a selector cannot take
|
|
1189
1209
|
b.innerHTML = (say.label ? `<small>${esc(say.label)}</small>` : '') + esc(text); if (S.present === id) $('#pcap').textContent = text;
|
|
1190
1210
|
}
|
|
1191
1211
|
function captionRun(id, text, totalMs, from = 0) { // from: how far into the line the voice already is, when the timing is corrected along the way
|
|
@@ -1242,7 +1262,7 @@ function buildStage() { // the tiles, and the presenter camera with them: a ch
|
|
|
1242
1262
|
const pr = S.present && S.agents[S.present]; if (pr) { $('#pcam').innerHTML = avatarSVG(pr, undefined, 'c' + pr.gid + '_') + `<div class="tag"><b>${esc(pr.name)}</b><span class="tk"></span></div>`; S.camFor = pr.id; camTok(); }
|
|
1243
1263
|
}
|
|
1244
1264
|
const layout = () => {
|
|
1245
|
-
const st = $('#stage'), w = st.clientWidth - 28 || 600, nar = $('#center').clientWidth < 480, cols = nar ? (w >= 300 ? 2 : 1) : Math.max(1, Math.floor((w + 12) / 212)), colw = (w - 12 * (cols - 1)) / cols;
|
|
1265
|
+
const st = $('#stage'), w = st.clientWidth - 28 || 600, nar = $('#center').clientWidth < 480, foc = !nar && document.body.classList.contains('focusl'), cols = nar ? (w >= 300 ? 2 : 1) : Math.max(1, Math.floor((w + 12) / (foc ? 162 : 212))), colw = (w - 12 * (cols - 1)) / cols; // foc: ⚙ → Focus layout, small cameras and no big spotlight tile
|
|
1246
1266
|
const rh = Math.round(colw * (nar ? 0.66 : 0.74)); st.style.setProperty('--cols', cols); st.style.setProperty('--rh', rh + 'px'); // Spotlight size: the biggest block (k columns × fr rows) that stays close to 3:2 and leaves room beside it for the others.
|
|
1247
1267
|
const maxRows = Math.max(cols > 1 ? 2 : 1, Math.floor((st.clientHeight * 0.7 + 12) / (rh + 12))); // the stage scrolls, so the spotlight may be a bit taller than the free space
|
|
1248
1268
|
let k = 1, fr = 1, best = -1;
|
|
@@ -1252,11 +1272,17 @@ const layout = () => {
|
|
|
1252
1272
|
if (area > best) { best = area; k = kk; fr = rr; }
|
|
1253
1273
|
}
|
|
1254
1274
|
if (nar) { k = cols; fr = cols > 1 ? 2 : 1; } // side panel: small tiles, a banner-sized spotlight
|
|
1275
|
+
else if (foc) { k = 1; fr = 1; }
|
|
1255
1276
|
else if (best < 0) { k = Math.min(2, cols); fr = Math.min(2, maxRows); }
|
|
1256
1277
|
st.style.setProperty('--fcols', k); st.style.setProperty('--fr', fr); st.classList.toggle('one', cols === 1);
|
|
1257
1278
|
document.body.classList.toggle('narrow', $('#center').clientWidth <= 480); document.body.classList.toggle('compact', $('#center').clientWidth <= 480 && !$('#roster').offsetWidth); document.body.classList.toggle('tiny', $('#center').clientWidth < 300); drawGantt();
|
|
1258
1279
|
};
|
|
1259
1280
|
new ResizeObserver(layout).observe($('#center'));
|
|
1281
|
+
function placeToasts() { // the toasts and the offers sit just above what is under the stage (the line of files, the highlights, the timeline), never over it
|
|
1282
|
+
const v = ['#stage', '#tree', '#boardv'].map((q) => $(q)).find((x) => x && x.offsetParent); if (!v) return; const gap = $('#center').clientHeight - (v.offsetTop + v.offsetHeight), b = Math.max(12, Math.round(gap) + 12) + 'px';
|
|
1283
|
+
if ($('#toasts').style.bottom !== b) $('#toasts').style.bottom = b;
|
|
1284
|
+
}
|
|
1285
|
+
for (const q of ['#stage', '#tree', '#boardv', '#center']) new ResizeObserver(() => requestAnimationFrame(placeToasts)).observe($(q));
|
|
1260
1286
|
|
|
1261
1287
|
function logRow(i) {
|
|
1262
1288
|
const e = S.events[i], arrow = e.to ? ` <span class="arrow">→</span> <span class="who">${esc(nameOf(e.to))}</span>` : '';
|
|
@@ -1297,7 +1323,7 @@ const applyStatus = (ev) => {
|
|
|
1297
1323
|
};
|
|
1298
1324
|
function recomputeStatus(upTo) {
|
|
1299
1325
|
S.files = new Map(); S.cands = new Map(); S.turnN = 0; S.turnSaid = ''; S.arts = new Map(); S.artCalls = new Map();
|
|
1300
|
-
S.term = {}; S.todos = {}; S.run = {}; S.act = {}; S.usage = {}; S.errs = {}; S.lastAct = {}; S.waitOn = {}; S.orderTs = {}; S.prevState = {}; S.lastTool = {}; S.mainBusyAt = 0; S.turnOver = false; S.th = {}; S.ctx = {}; S.model = {}; S.cw = {}; S.compacts = {}; S.ctxWarned = {}; S.rep = {}; S.loops = {}; S.wst = {}; S.recomputing = true; document.querySelectorAll('.tile').forEach((t) => { clearTimeout(t._byeT); t.classList.remove('bye'); }); hidePresent();
|
|
1326
|
+
S.term = {}; S.todos = {}; S.run = {}; S.act = {}; S.usage = {}; S.errs = {}; S.lastAct = {}; S.waitOn = {}; S.orderTs = {}; S.prevState = {}; S.lastTool = {}; S.mainBusyAt = 0; S.turnOver = false; S.th = {}; S.ctx = {}; S.model = {}; S.cw = {}; S.compacts = {}; S.ctxWarned = {}; S.rep = {}; S.loops = {}; S.wst = {}; S.errList = {}; S.callById = new Map(); S.recomputing = true; document.querySelectorAll('.tile').forEach((t) => { clearTimeout(t._byeT); t.classList.remove('bye'); }); hidePresent();
|
|
1301
1327
|
S.status = {}; S.tc = {}; S.doneAt = {}; S.gone.clear(); S.leaving.clear(); document.querySelectorAll('.tile.vanishing').forEach((t) => t.classList.remove('vanishing')); const doneIdx = {}; document.querySelectorAll('.ticker').forEach((x) => { x.classList.remove('on'); x.innerHTML = ''; });
|
|
1302
1328
|
for (let i = 0; i < upTo; i++) {
|
|
1303
1329
|
const e = S.events[i]; applyStatus(e); tally(e); if (e.kind === 'tools') S.tc[e.agent] = (S.tc[e.agent] || 0) + e.tools.length;
|
|
@@ -1316,7 +1342,7 @@ function syncUI() {
|
|
|
1316
1342
|
|
|
1317
1343
|
// ---------- tool ticker, shared screen, flying messages ----------
|
|
1318
1344
|
// ---------- what each agent is doing: tool calls with their real outputs ----------
|
|
1319
|
-
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.wst = {}; S.present = null; S.camFor = null; let presentTimer = null;
|
|
1345
|
+
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.wst = {}; S.errList = {}; S.callById = new Map(); S.present = null; S.camFor = null; let presentTimer = null;
|
|
1320
1346
|
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
|
|
1321
1347
|
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
|
|
1322
1348
|
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');
|
|
@@ -1336,7 +1362,7 @@ function ctxWin(model, ctx) { const base = WIN1M.test(model || '') ? 1e6 : 2e5;
|
|
|
1336
1362
|
const fileOf = (f) => String(f || '').split(/[\\/]/).pop();
|
|
1337
1363
|
function wasteStep(W, ev) { // W: the session's state (S.wst, or a fresh one for the recap); true when something was noted
|
|
1338
1364
|
if (!W.reads) { const N = () => Object.create(null); Object.assign(W, { reads: N(), finds: N(), calls: N(), failed: N(), items: N() }); } /* no prototype: a file or a search named __proto__ is just a name */
|
|
1339
|
-
const a = ev.agent; let hit = false; const note = (it) => { const l = (W.items[a] = W.items[a] || []); l.push(it); if (l.length > 60) l.shift(); hit = true; };
|
|
1365
|
+
const a = ev.agent; let hit = false; const note = (it) => { const l = (W.items[a] = W.items[a] || []); l.push({ ...it, ts: ev.ts }); if (l.length > 60) l.shift(); hit = true; };
|
|
1340
1366
|
if (ev.kind === 'tools') for (const t of ev.tools) { const d = t.d || {};
|
|
1341
1367
|
if (d.kind === 'read' && d.file) { const m = (W.reads[d.file] = W.reads[d.file] || Object.create(null)), part = (d.offset || '') + ':' + (d.limit || ''), o = Object.keys(m).find((x) => x !== a); /* a part of a long file is another read */
|
|
1342
1368
|
if (m[a] && m[a].has(part)) note({ k: 'again', f: d.file }); else if (o) note({ k: 'other', f: d.file, by: o }); (m[a] = m[a] || new Set()).add(part); }
|
|
@@ -1351,10 +1377,53 @@ function wasteStep(W, ev) { // W: the session's state (S.wst, or a fresh one f
|
|
|
1351
1377
|
const wasteLine = (it) => it.k === 'again' ? L('relu : {0}', 'read again: {0}').replace('{0}', () => fileOf(it.f)) : it.k === 'other' ? L('déjà lu par {0} : {1}', 'already read by {0}: {1}').replace('{0}', () => nameOf(it.by)).replace('{1}', () => fileOf(it.f))
|
|
1352
1378
|
: it.k === 'find' ? L('même recherche relancée : {0}', 'same search again: {0}').replace('{0}', () => '“' + it.q + '”') : it.k === 'findOther' ? L('même recherche que {0} : {1}', 'same search as {0}: {1}').replace('{0}', () => nameOf(it.by)).replace('{1}', () => '“' + it.q + '”')
|
|
1353
1379
|
: L('relance une commande qui a échoué : {0}', 'reran a failing command: {0}').replace('{0}', () => it.c);
|
|
1380
|
+
// The badges' card: on hover (or a tap), what is behind ✗ ♻ 🔁 ⏳ 💤, read from the session alone.
|
|
1381
|
+
function noteCalls(ev) {
|
|
1382
|
+
if (!S.callById) { S.callById = new Map(); S.errList = {}; }
|
|
1383
|
+
if (ev.kind === 'tools') for (const t of ev.tools) { S.callById.set(t.id, { name: t.name, arg: t.arg, d: t.d, ts: ev.ts }); if (S.callById.size > 3000) S.callById.delete(S.callById.keys().next().value); }
|
|
1384
|
+
else if (ev.kind === 'results') for (const it of ev.items) { if (it.err) { const l = (S.errList[ev.agent] = S.errList[ev.agent] || []); l.push({ ts: ev.ts, call: S.callById.get(it.id), out: it.out }); if (l.length > 40) l.shift(); } S.callById.delete(it.id); }
|
|
1385
|
+
}
|
|
1386
|
+
var BT = { el: null, h: 0 }; const toolShort = (n) => (String(n || '').startsWith('mcp__') ? String(n).split('__').pop() : String(n || ''));
|
|
1387
|
+
const clockOf = (ts) => { try { return ts ? new Date(ts).toLocaleTimeString(document.documentElement.lang || undefined, { hour: '2-digit', minute: '2-digit' }) : ''; } catch { return ''; } };
|
|
1388
|
+
const callText = (c) => String((c && ((c.d && (c.d.text || c.d.file || c.d.pattern || c.d.url || c.d.query)) || c.arg)) || '').replace(/\s+/g, ' ').trim().slice(0, 240);
|
|
1389
|
+
const errBit = (o) => { const ls = String(o || '').replace(/\x1b\[[0-9;]*m/g, '').split('\n').map((x) => x.trim()).filter(Boolean), i = Math.max(0, ls.findIndex((x) => /error|fail|denied|not found|no such|exception|cannot|refused|invalid|expected|✗|●/i.test(x))); return ls.slice(i, i + 3).map((x) => x.slice(0, 160)); };
|
|
1390
|
+
const wasteParts = (it) => { const path = String(it.f || '').split(/[\\/]/).slice(-2).join('/');
|
|
1391
|
+
return it.k === 'again' ? [L('Relu', 'Read again'), path] : it.k === 'other' ? [L('Déjà lu par {0}', 'Already read by {0}').replace('{0}', () => nameOf(it.by)), path]
|
|
1392
|
+
: it.k === 'find' ? [L('Même recherche relancée', 'Same search again'), '“' + it.q + '”'] : it.k === 'findOther' ? [L('Même recherche que {0}', 'Same search as {0}').replace('{0}', () => nameOf(it.by)), '“' + it.q + '”'] : [L('Relance une commande en échec', 'Reran a failing command'), it.c || '']; };
|
|
1393
|
+
function tipHtml(k, id) {
|
|
1394
|
+
const head = (icon, title, n) => `<div class="bh"><span class="bi">${icon}</span><span class="bt">${esc(title)}</span>${n ? `<span class="bn">${esc(String(n))}</span>` : ''}<span class="ba">${esc(nameOf(id))}</span></div>`;
|
|
1395
|
+
const foot = (t) => (t ? `<div class="bf">${esc(t)}</div>` : ''), more = (n) => foot(n > 0 ? L('+ {0} plus tôt', '+ {0} earlier').replace('{0}', () => n) : '');
|
|
1396
|
+
const row = (name, time, txt, extra) => `<li><div class="r1">${name}<span class="rt">${esc(time)}</span></div>${txt ? `<code>${esc(txt)}</code>` : ''}${extra || ''}</li>`;
|
|
1397
|
+
if (k === 'e') { const l = (S.errList && S.errList[id]) || [], n = S.errs[id] || l.length, sh = l.slice(-4).reverse(); if (!n) return '';
|
|
1398
|
+
return head('✗', L('Appels en échec', 'Failed calls'), n) + (sh.length ? `<ul>${sh.map((x) => { const bit = errBit(x.out); return row((x.call && x.call.name ? `<span class="pill">${esc(toolShort(x.call.name))}</span>` : '') + (x.call && x.call.d && x.call.d.note ? `<span class="rn">${esc(x.call.d.note)}</span>` : ''), clockOf(x.ts), callText(x.call), bit.length ? `<div class="ro">${bit.map((x) => `<div>${esc(x)}</div>`).join('')}</div>` : ''); }).join('')}</ul>` : '') + more(n - sh.length); }
|
|
1399
|
+
if (k === 'w') { const l = (S.wst.items && S.wst.items[id]) || [], sh = l.slice(-5).reverse(); if (!l.length) return '';
|
|
1400
|
+
return head('♻', L('Travail répété', 'Repeated work'), l.length) + `<ul>${sh.map((it) => { const [lab, sub] = wasteParts(it); return row(`<span class="rk">${esc(lab)}</span>`, clockOf(it.ts), sub); }).join('')}</ul>` + more(l.length - sh.length) + foot(L('Repéré dans la session elle-même, sans appel au modèle.', 'Spotted in the session itself, with no model call.')); }
|
|
1401
|
+
if (k === 'l') { const x = S.loops[id]; if (!x) return ''; const errs = x.kind === 'errors';
|
|
1402
|
+
return head('🔁', errs ? L('Échecs répétés', 'Repeated failures') : L('Même appel répété', 'Same call repeated'), '×' + x.n) + foot((errs ? L('{0} échecs d’affilée', '{0} failures in a row') : L('{0} fois d’affilée', '{0} times in a row')).replace('{0}', () => x.n) + (x.tool ? ' · ' + toolShort(x.tool) : '')); }
|
|
1403
|
+
if (k === 's') { const r = S.run[id]; if (!r) return ''; const c = S.callById && S.callById.get(r.id);
|
|
1404
|
+
return head('⏳', L('Commande longue', 'Long-running command'), r.ts ? fmtShort(Date.now() - r.ts) : '') + `<ul>${row(r.name ? `<span class="pill">${esc(toolShort(r.name))}</span>` : '', clockOf(r.ts), callText(c) || (c && c.d && c.d.note) || '')}</ul>`; }
|
|
1405
|
+
if (k === 'q') return S.lastAct[id] ? head('💤', L('Silencieux', 'Gone quiet'), '') + foot(L('Aucune activité depuis {0}.', 'No activity for {0}.').replace('{0}', () => fmtShort(Date.now() - S.lastAct[id]))) : '';
|
|
1406
|
+
return '';
|
|
1407
|
+
}
|
|
1408
|
+
function showTip(el) {
|
|
1409
|
+
const t = el.closest('.tile'), b = $('#btip'); if (!t) return; const id = t.id.slice(2), k = el.dataset.tip, h = tipHtml(k, id); if (!h) return hideTip();
|
|
1410
|
+
clearTimeout(BT.h); const was = b.classList.contains('on') && BT.el; BT.el = el; if (b.innerHTML !== h) b.innerHTML = h; b.className = 'k-' + k + (was ? ' on' : ''); placeTip(); if (!was) requestAnimationFrame(() => BT.el && b.classList.add('on'));
|
|
1411
|
+
}
|
|
1412
|
+
function placeTip() {
|
|
1413
|
+
const b = $('#btip'), r = BT.el.getBoundingClientRect(), w = b.offsetWidth, h = b.offsetHeight;
|
|
1414
|
+
let top = r.bottom + 8; if (top + h > innerHeight - 8 && r.top - h - 8 > 8) top = r.top - h - 8;
|
|
1415
|
+
b.style.left = Math.round(Math.max(8, Math.min(r.right - w, innerWidth - w - 8))) + 'px'; b.style.top = Math.round(Math.max(8, top)) + 'px';
|
|
1416
|
+
}
|
|
1417
|
+
function hideTip() { clearTimeout(BT.h); BT.el = null; $('#btip').classList.remove('on'); }
|
|
1418
|
+
function refreshTip() { const k = BT.el.dataset.tip, t = document.getElementById(BT.el._tile || ''), el = BT.el.isConnected ? BT.el : t && t.querySelector('.tbadge [data-tip="' + k + '"]'); if (el) { el._tile = BT.el._tile; showTip(el); } else hideTip(); } /* the badges were drawn again: follow the new one, or close */
|
|
1419
|
+
document.addEventListener('mouseover', (e) => { const el = e.target.closest && e.target.closest('.tbadge [data-tip]'); if (el) { el._tile = el.closest('.tile') && el.closest('.tile').id; showTip(el); } });
|
|
1420
|
+
document.addEventListener('mouseout', (e) => { const el = e.target.closest && e.target.closest('.tbadge [data-tip]'); if (el && !(e.relatedTarget && el.contains(e.relatedTarget))) { clearTimeout(BT.h); BT.h = setTimeout(hideTip, 120); } });
|
|
1421
|
+
document.addEventListener('click', (e) => { const el = e.target.closest && e.target.closest('.tbadge [data-tip]'); if (el) { e.stopPropagation(); e.preventDefault(); el._tile = el.closest('.tile') && el.closest('.tile').id; showTip(el); } else if (BT.el) hideTip(); }, true); /* a tap shows it on a touch screen, and does not open the agent */
|
|
1422
|
+
document.addEventListener('keydown', (e) => { if (e.key === 'Escape' && BT.el) hideTip(); }); addEventListener('resize', () => BT.el && hideTip()); addEventListener('scroll', () => BT.el && hideTip(), true);
|
|
1354
1423
|
function tally(ev) { // numbers that pile up over a session: token usage, errors, last sign of life, the files it created
|
|
1355
1424
|
noteFiles(ev);
|
|
1356
1425
|
if (ev.kind === 'compact') { S.compacts[ev.agent] = (S.compacts[ev.agent] || 0) + 1; delete S.ctxWarned[ev.agent]; }
|
|
1357
|
-
if (wasteStep(S.wst, ev)) later('badges', renderBadges, 300);
|
|
1426
|
+
noteCalls(ev); if (wasteStep(S.wst, ev)) later('badges', renderBadges, 300);
|
|
1358
1427
|
const det = loopStep(S.rep, ev); if (det) { S.loops[ev.agent] = det; later('badges', renderBadges, 300); } else if (S.loops[ev.agent] && (ev.kind === 'results' ? (S.loops[ev.agent].kind === 'errors' && ev.items.every((it) => !it.err)) : (ev.kind === 'tools' && S.rep[ev.agent].n < 2))) { delete S.loops[ev.agent]; later('badges', renderBadges, 300); }
|
|
1359
1428
|
if (ev.kind === 'usage') { const c = ev.u.i + ev.u.r + ev.u.w; if (c > 0 && ev.model !== '<synthetic>') { S.ctx[ev.agent] = c; S.model[ev.agent] = ev.model; if (ev.cw) S.cw[ev.agent] = ev.cw; } const u = (S.usage[ev.agent] = S.usage[ev.agent] || { i: 0, o: 0, r: 0, w: 0 }); u.i += ev.u.i; u.o += ev.u.o; u.r += ev.u.r; u.w += ev.u.w; later('tok', renderTokens, 300); } // which also redraws the context chips. Asking for those first, under the same name, left this one unasked: the counts on the tiles and in the header stood still during a live call
|
|
1360
1429
|
else if (ev.kind === 'results') ev.items.forEach((it) => { if (it.err) { S.errs[ev.agent] = (S.errs[ev.agent] || 0) + 1; later('badges', renderBadges, 300); oops(ev.agent); noteTrouble(ev.agent, false); } else noteTrouble(ev.agent, true); });
|
|
@@ -1388,14 +1457,14 @@ const NEEDS_OK = /^(Edit|Write|MultiEdit|NotebookEdit|AskUserQuestion|ExitPlanMo
|
|
|
1388
1457
|
const atTail = () => S.idx >= S.events.length - 3; // only trust wall-clock ages when playback has caught up with the live end
|
|
1389
1458
|
function agentState(id, now) {
|
|
1390
1459
|
let s = S.status[id]; const r = S.run[id], w = S.waitOn[id], la = S.lastAct[id];
|
|
1391
|
-
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
|
|
1460
|
+
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: '✋ ' + (row.sure ? L('vous attend ', 'needs you ') : L('attend vous ? ', 'needs you? ')) + fmtShort(Math.max(0, now - row.since)), ask: row.ask || '', sure: !!row.sure, since: row.since }; } // 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
|
|
1392
1461
|
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
|
|
1393
1462
|
const open = S.live && la && (S.sawEnd ? !S.turnOver && now - la < 180000 : now - la < 25000);
|
|
1394
1463
|
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)) };
|
|
1395
1464
|
}
|
|
1396
1465
|
if (s === 'done') return { k: 'done', txt: '✓ ' + L('terminé', 'done') };
|
|
1397
1466
|
if (!s) return { k: 'idle', txt: '' };
|
|
1398
|
-
if (S.live && atTail() && r && r.ts && r.name && NEEDS_OK.test(r.name)) { const age = now - r.ts; if (age > (ASKS.test(r.name) ? 4000 : 15000)) return { k: 'blocked', txt: '✋ ' + L('attend vous ? ', 'needs you? ') + fmtShort(age) }; }
|
|
1467
|
+
if (S.live && atTail() && r && r.ts && r.name && NEEDS_OK.test(r.name)) { const age = now - r.ts; if (age > (ASKS.test(r.name) ? 4000 : 15000)) return { k: 'blocked', txt: '✋ ' + L('attend vous ? ', 'needs you? ') + fmtShort(age), since: r.ts }; }
|
|
1399
1468
|
if (w && w.size) { // really waiting only while the lead has a sub-agent call pending, or while those agents are still active (background agents never block the lead)
|
|
1400
1469
|
const pendingSub = r && /^(Task|Agent)$/.test(r.name), open = [...w].filter((c) => S.status[c] !== 'done' && (pendingSub || !S.live || now - Math.max(S.lastAct[c] || 0, S.orderTs[c] || 0) < 120000));
|
|
1401
1470
|
if (open.length) {
|
|
@@ -1407,12 +1476,13 @@ function agentState(id, now) {
|
|
|
1407
1476
|
}
|
|
1408
1477
|
const STATE_CLASSES = ['working', 'waiting', 'blocked', 'stalled', 'done'];
|
|
1409
1478
|
// 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.
|
|
1410
|
-
// It stays until the menu is answered (where Claude Code runs: nothing is answered from here); ✕ puts it away until the next one.
|
|
1479
|
+
// It stays until the menu is answered (where Claude Code runs: nothing is answered from here); ✕ puts it away until the next one. Off unless ⚙ → All settings turns it on: the header, the card and the board already say a menu waits.
|
|
1411
1480
|
const ASKC = { off: '' };
|
|
1412
1481
|
function askHtml(m, p) {
|
|
1413
1482
|
const who = esc(p.name), pre = (x) => (x ? '<pre>' + esc(x) + '</pre>' : ''); let head, body = '';
|
|
1414
1483
|
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'));
|
|
1415
|
-
body = m.questions.map((q) => '<div class="
|
|
1484
|
+
body = m.questions.map((q, k, all) => '<div class="aqs' + (q.multi ? ' multi' : '') + '"><div class="aqh">' + (all.length > 1 ? '<span class="anum">' + (k + 1) + '/' + all.length + '</span>' : '') + (q.head ? '<b class="atag">' + esc(q.head) + '</b>' : '') + '<span>' + (q.multi ? L('un ou plusieurs choix', 'one or more') : L('un seul choix', 'pick one')) + '</span></div><p class="aq">' + esc(q.q) + '</p>'
|
|
1485
|
+
+ (q.options.length ? '<ol class="aops">' + q.options.map((o, j) => '<li><i>' + (j + 1) + '</i><div><b>' + esc(o.label) + '</b>' + (o.about ? '<span>' + esc(o.about) + '</span>' : '') + '</div></li>').join('') + '</ol>' : '') + '</div>').join(''); } // each question apart: its number, the short label Claude Code gives it, then each option on its own row with what it means under it
|
|
1416
1486
|
else if (m.kind === 'plan') { head = '📋 ' + who + ' ' + L('vous propose ce plan', 'proposes this plan'); body = pre(m.text); }
|
|
1417
1487
|
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); }
|
|
1418
1488
|
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); }
|
|
@@ -1420,11 +1490,11 @@ function askHtml(m, p) {
|
|
|
1420
1490
|
else if (m.kind === 'fetch') { head = '🔐 ' + who + ' ' + L('demande à ouvrir cette page', 'asks to open this page'); body = pre(m.url); }
|
|
1421
1491
|
else { head = '🔐 ' + who + ' ' + L('demande la permission d\'utiliser', 'asks permission to use') + ' ' + esc(m.tool || ''); }
|
|
1422
1492
|
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') : '');
|
|
1423
|
-
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
|
|
1493
|
+
return '<div class="awho">' + avatarSVG(p, undefined, 'ak' + p.gid + '_') + '</div><div class="asay"><div class="ahd"><span>' + head + '</span><span class="ak-t"></span><button class="ax" aria-label="' + esc(L('Masquer jusqu\'à la prochaine question', 'Hide until the next question')) + '">✕</button></div>' + (body ? '<div class="abody">' + body + '</div>' : '') + '<div class="afoot">' + foot + '</div></div>';
|
|
1424
1494
|
}
|
|
1425
1495
|
function paintAsk(now) {
|
|
1426
1496
|
const el = $('#askc'); if (!el) return; let row = null; try { row = rowOf(S.cur); } catch {}
|
|
1427
|
-
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');
|
|
1497
|
+
const m = row && row.menu, p = S.agents.main, show = !!(prefs.askCard && m && p && S.live && !S.demo && ASKC.off !== m.id && agentState('main', now).k === 'blocked');
|
|
1428
1498
|
if (!show) { if (el.dataset.k) { el.className = ''; el.innerHTML = ''; el.dataset.k = ''; } return; }
|
|
1429
1499
|
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
|
|
1430
1500
|
const t = el.querySelector('.ak-t'); if (t) t.textContent = fmtShort(Math.max(0, now - (row.since || now)));
|
|
@@ -1436,7 +1506,7 @@ function paintStates() {
|
|
|
1436
1506
|
if (p.id === 'user') continue; const t = $('#t-' + p.id); if (!t) continue;
|
|
1437
1507
|
const st = agentState(p.id, now), shown = t.style.display !== 'none'; if (shown && n[st.k] !== undefined && !S.gone.has(p.id)) { n[st.k]++; if (st.k === 'blocked' || st.k === 'stalled') attn.push(p.id); }
|
|
1438
1508
|
STATE_CLASSES.forEach((c) => t.classList.toggle(c, st.k === c));
|
|
1439
|
-
const el = t.querySelector('.status'); if (el.textContent !== st.txt) el.textContent = st.txt; el.className = 'status ' + st.k + (isTurn(p.id, st) ? ' turn' : '');
|
|
1509
|
+
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 */ el.className = 'status ' + st.k + (isTurn(p.id, st) ? ' turn' : '');
|
|
1440
1510
|
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"
|
|
1441
1511
|
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); }
|
|
1442
1512
|
else if (!pr.classList.contains('cheer')) { if (pr.textContent !== want) pr.textContent = want; pr.className = 'prop ' + (want ? st.k : ''); }
|
|
@@ -1446,9 +1516,9 @@ function paintStates() {
|
|
|
1446
1516
|
S.prevState[p.id] = st.k; const tip = `${p.name} — ${p.role}${st.txt ? '\n' + st.txt : ''}${S.lastTool[p.id] ? '\n' + S.lastTool[p.id] : ''}`; if (t.title !== tip) t.title = tip;
|
|
1447
1517
|
}
|
|
1448
1518
|
paintPill();
|
|
1449
|
-
const b = $('#board'), parts = [['working', '⚙', L('au travail', 'working')], ['waiting', '🔗', L('
|
|
1519
|
+
const b = $('#board'), parts = [['working', '⚙', L('au travail', 'working')], ['waiting', '🔗', L('attendent leurs sous-agents', 'on sub-agents')], ['blocked', '✋', L('vous attendent', 'need you')], ['stalled', '⚠', L('bloqués', 'stalled')], ['done', '✓', L('terminés', 'done')]]
|
|
1450
1520
|
.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('');
|
|
1451
|
-
if (b.innerHTML !== parts) b.innerHTML = parts; fitBoard(); S.nBlocked = n.blocked + n.stalled; S.attn = attn; paintRoster(ros); paintFiles(); paintAsk(now); return n;
|
|
1521
|
+
if (b.innerHTML !== parts) b.innerHTML = parts; fitBoard(); S.nBlocked = n.blocked + n.stalled; S.attn = attn; paintRoster(ros); paintFiles(); paintAsk(now); paintAttn(now); return n;
|
|
1452
1522
|
}
|
|
1453
1523
|
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
|
|
1454
1524
|
const b = $('#board'), key = innerWidth + '|' + b.textContent.length + '|' + $('#pill').textContent.length + '|' + $('#subtitle').textContent.length;
|
|
@@ -1465,7 +1535,7 @@ const rosTok = (id) => { const u = S.usage[id]; return u && tokTotal(u) ? `<span
|
|
|
1465
1535
|
function paintRoster(ros) { // a fixed list beside the call: who is doing what, urgent first, readable even with dozens of agents
|
|
1466
1536
|
const box = $('#roster'); if (!box || !document.body.classList.contains('rost')) return;
|
|
1467
1537
|
ros.sort((a, b) => (a.p.id === 'main' ? -1 : b.p.id === 'main' ? 1 : (RORDER[a.st.k] - RORDER[b.st.k]) || (S.lastAct[b.p.id] || 0) - (S.lastAct[a.p.id] || 0)));
|
|
1468
|
-
const rows = ros.slice(0, 60).map(({ p, st }) => `<div class="rr k-${st.k}${isTurn(p.id, st) ? ' turn' : ''}${S.focus === p.id ? ' sel' : ''}${S.speakers.has(p.id) ? ' speaking' : ''}" data-id="${esc(p.id)}" tabindex="0" role="button" aria-label="${esc(p.name)}, ${esc(st.txt || '')}"><div class="n"><span class="dot" style="background:${p.shirt}"></span><b>${esc(p.name)}</b><span class="ro">${esc(p.role + leadTool(p))}</span>${rosTok(p.id)}</div><div class="st">${esc(st.txt || L('en veille', 'standing by'))}${S.loops[p.id] ? ' 🔁' : ''}${S.wst.items && S.wst.items[p.id] && S.wst.items[p.id].length ? ' ♻' + S.wst.items[p.id].length : ''}</div></div>`).join('');
|
|
1538
|
+
const rows = ros.slice(0, 60).map(({ p, st }) => `<div class="rr k-${st.k}${isTurn(p.id, st) ? ' turn' : ''}${S.focus === p.id ? ' sel' : ''}${S.speakers.has(p.id) ? ' speaking' : ''}" data-id="${esc(p.id)}" tabindex="0" role="button" aria-label="${esc(p.name)}, ${esc(st.txt || '')}" title="${esc(p.name + ' — ' + p.role + leadTool(p) + (st.txt ? '\n' + st.txt : '') + (S.lastTool[p.id] ? '\n' + S.lastTool[p.id] : ''))}"><div class="n"><span class="dot" style="background:${p.shirt}"></span><b>${esc(p.name)}</b><span class="ro">${esc(p.role + leadTool(p))}</span>${rosTok(p.id)}</div><div class="st">${esc(st.txt || L('en veille', 'standing by'))}${S.loops[p.id] ? ' 🔁' : ''}${S.wst.items && S.wst.items[p.id] && S.wst.items[p.id].length ? ' ♻' + S.wst.items[p.id].length : ''}</div></div>`).join('');
|
|
1469
1539
|
const left = Object.values(S.agents).filter((p) => S.gone.has(p.id) && p.id !== 'main' && p.id !== 'user').sort((a, b) => (S.lastAct[b.id] || 0) - (S.lastAct[a.id] || 0)); // a finished agent's tile leaves the stage: its line stays here, with what it used
|
|
1470
1540
|
const gone = left.slice(0, 40).map((p) => `<div class="rr left" data-id="${esc(p.id)}" tabindex="0" role="button" aria-label="${esc(p.name)}"><div class="n"><span class="dot" style="background:${p.shirt}"></span><b>${esc(p.name)}</b><span class="ro">${esc(p.role)}</span>${rosTok(p.id)}</div></div>`).join('');
|
|
1471
1541
|
const html = `<h3>${L('Agents', 'Agents')} · ${ros.length}</h3>${rows}${ros.length > 60 ? `<div class="ro" style="padding:4px 8px">+${ros.length - 60}</div>` : ''}${left.length ? `<h3 style="margin-top:8px">${L('terminés', 'done')} · ${left.length}</h3>${gone}` : ''}`;
|
|
@@ -1478,16 +1548,17 @@ function renderBadges() { // per tile: failed tool calls, a command that has b
|
|
|
1478
1548
|
const now = Date.now();
|
|
1479
1549
|
for (const id in S.agents) {
|
|
1480
1550
|
const t = $('#t-' + id); if (!t) continue; const b = t.querySelector('.tbadge'), parts = []; let slow = false, quiet = false;
|
|
1481
|
-
if (S.errs[id]) parts.push(`<span class="e">✗ ${S.errs[id]}</span>`);
|
|
1482
|
-
const ws = S.wst.items && S.wst.items[id]; if (ws && ws.length) parts.push(`<span class="w" title="
|
|
1483
|
-
if (S.loops[id]) parts.push(`<span class="l" title="
|
|
1551
|
+
if (S.errs[id]) parts.push(`<span class="e" title="" data-tip="e">✗ ${S.errs[id]}</span>`);
|
|
1552
|
+
const ws = S.wst.items && S.wst.items[id]; if (ws && ws.length) parts.push(`<span class="w" title="" data-tip="w">♻ ${ws.length}</span>`);
|
|
1553
|
+
if (S.loops[id]) parts.push(`<span class="l" title="" data-tip="l">🔁 ×${S.loops[id].n}</span>`);
|
|
1484
1554
|
if (S.live && S.status[id] === 'working') {
|
|
1485
1555
|
const r = S.run[id];
|
|
1486
|
-
if (r && r.ts && atTail() && now - r.ts > 60000) { slow = true; parts.push(`<span class="s">⏳ ${fmtShort(now - r.ts)}</span>`); }
|
|
1487
|
-
else if (!r && S.lastAct[id] && now - S.lastAct[id] > 180000) { quiet = true; parts.push(`<span class="q">💤 ${fmtShort(now - S.lastAct[id])}</span>`); }
|
|
1556
|
+
if (r && r.ts && atTail() && now - r.ts > 60000) { slow = true; parts.push(`<span class="s" title="" data-tip="s">⏳ ${fmtShort(now - r.ts)}</span>`); }
|
|
1557
|
+
else if (!r && S.lastAct[id] && now - S.lastAct[id] > 180000) { quiet = true; parts.push(`<span class="q" title="" data-tip="q">💤 ${fmtShort(now - S.lastAct[id])}</span>`); }
|
|
1488
1558
|
}
|
|
1489
1559
|
t.classList.toggle('slow', slow); t.classList.toggle('quiet', quiet); const h = parts.join(''); if (b.innerHTML !== h) b.innerHTML = h;
|
|
1490
1560
|
}
|
|
1561
|
+
if (BT && BT.el) refreshTip();
|
|
1491
1562
|
}
|
|
1492
1563
|
const fmtShort = (ms) => { const s = Math.round(ms / 1000); return s < 90 ? `${s}s` : `${Math.round(s / 60)} min`; };
|
|
1493
1564
|
function askNotify() { try { if (!EMBED && 'Notification' in window && Notification.permission === 'default') Notification.requestPermission(); } catch {} AUD.init(); AUD.alert(); }
|
|
@@ -1998,7 +2069,7 @@ const coffeeMsg = () => L('Ce développeur a été remplacé par ses propres age
|
|
|
1998
2069
|
function openExternal(url) { if (EMBED) window.parent.postMessage({ agentStandup: 'openExternal', url }, '*'); else window.open(url, '_blank', 'noopener'); } // VS Code webviews must ask the extension
|
|
1999
2070
|
function renderCoffee() {
|
|
2000
2071
|
const on = !!SUPPORT.url, b = $('#mCoffee'); b.style.display = on ? '' : 'none'; $('#mCoffeeT').textContent = L('☕ Offrir un café au développeur', '☕ Buy the (replaced) dev a coffee'); b.title = coffeeMsg();
|
|
2001
|
-
const h = $('#bCoffee'); h.style.display = on ? '' : 'none'; h.title = coffeeMsg(); h.setAttribute('aria-label', coffeeMsg());
|
|
2072
|
+
const h = $('#bCoffee'); h.style.display = on && !firstDay() ? '' : 'none'; /* the gold cup in the header: not on the first day, which is for the call */ h.title = coffeeMsg(); h.setAttribute('aria-label', coffeeMsg());
|
|
2002
2073
|
$('#mRateT').textContent = APP.kind === 'editor' ? L('⭐ Noter Agent Standup', '⭐ Rate Agent Standup') : L('⭐ Une étoile pour Agent Standup sur GitHub', '⭐ Star Agent Standup on GitHub');
|
|
2003
2074
|
}
|
|
2004
2075
|
$('#bCoffee').onclick = () => openExternal(SUPPORT.url);
|
|
@@ -2010,17 +2081,21 @@ $('#mRate').onclick = () => { $('#menu').classList.remove('on'); rateGo(); };
|
|
|
2010
2081
|
function rateGo() { rateEnd(); if (EMBED && APP.kind === 'editor') window.parent.postMessage({ agentStandup: 'rate' }, '*'); else openExternal(APP.rate); }
|
|
2011
2082
|
const rateEnd = () => { prefs.rateDone = utcDay(); savePrefs(); $('#rateTip').style.display = 'none'; };
|
|
2012
2083
|
const RATE_ASKS = (APP.kind === 'desktop' || APP.kind === 'cli') && !EMBED && !Q.get('demo'), utcDay = () => new Date().toISOString().slice(0, 10);
|
|
2084
|
+
// One ask a day at most, and none the first day the call is in view (prefs.firstDay): the star, the coffee and the pack each wait for a day nothing else was asked (prefs.askDay, and which one in askWhat, so the same ask can show again that day).
|
|
2085
|
+
// The real voices are not an ask but an offer of the app itself: they keep their line until answered, and the pack waits while it shows.
|
|
2086
|
+
const firstDay = () => !prefs.firstDay || prefs.firstDay >= utcDay(), askedToday = (k) => prefs.askDay === utcDay() && prefs.askWhat !== k;
|
|
2087
|
+
const noteAsk = (k) => { if (prefs.askDay !== utcDay() || prefs.askWhat !== k) { prefs.askDay = utcDay(); prefs.askWhat = k; savePrefs(); } };
|
|
2013
2088
|
function rateDay() { // a day of use: the page in view that day
|
|
2014
2089
|
if (!RATE_ASKS || prefs.rateDone || document.hidden) return;
|
|
2015
2090
|
const day = utcDay(); if (prefs.rateLast !== day) { prefs.rateLast = day; prefs.rateDays = (+prefs.rateDays || 0) + 1; savePrefs(); }
|
|
2016
2091
|
rateTip();
|
|
2017
2092
|
}
|
|
2018
2093
|
function rateTip() {
|
|
2019
|
-
const t = $('#rateTip'); if (!RATE_ASKS || prefs.rateDone || (+prefs.rateDays || 0) < 3 || (prefs.rateLater && utcDay() < prefs.rateLater) || $('#menuTip').style.display !== 'none' || $('#menu').classList.contains('on')) { t.style.display = 'none'; return; }
|
|
2094
|
+
const t = $('#rateTip'); if (!RATE_ASKS || prefs.rateDone || firstDay() || askedToday('rate') || (+prefs.rateDays || 0) < 3 || (prefs.rateLater && utcDay() < prefs.rateLater) || $('#menuTip').style.display !== 'none' || $('#menu').classList.contains('on')) { t.style.display = 'none'; return; }
|
|
2020
2095
|
const r = $('#bMenu').getBoundingClientRect(); if (!r.width) return;
|
|
2021
2096
|
$('#rateTipT').textContent = L('Agent Standup vous plaît ? Une étoile sur GitHub aide d’autres personnes à le trouver.', 'Enjoying Agent Standup? A star on GitHub helps other people find it.');
|
|
2022
2097
|
$('#rateYes').textContent = L('⭐ Mettre une étoile', '⭐ Star it'); $('#rateLater').textContent = L('Plus tard', 'Later'); $('#rateNo').textContent = L('Non merci', 'No thanks');
|
|
2023
|
-
rateTip.seen = utcDay(); t.style.display = ''; t.style.top = Math.round(r.bottom + 10) + 'px'; t.style.right = Math.max(8, Math.round(innerWidth - r.right - 6)) + 'px'; t.style.setProperty('--ax', Math.max(8, Math.round(r.width / 2 - 2)) + 'px');
|
|
2098
|
+
rateTip.seen = utcDay(); noteAsk('rate'); t.style.display = ''; t.style.top = Math.round(r.bottom + 10) + 'px'; t.style.right = Math.max(8, Math.round(innerWidth - r.right - 6)) + 'px'; t.style.setProperty('--ax', Math.max(8, Math.round(r.width / 2 - 2)) + 'px');
|
|
2024
2099
|
}
|
|
2025
2100
|
$('#rateYes').onclick = rateGo; $('#rateNo').onclick = rateEnd;
|
|
2026
2101
|
$('#rateLater').onclick = () => { if (prefs.rateLater) return rateEnd(); prefs.rateLater = new Date(Date.parse(utcDay()) + 7 * 864e5).toISOString().slice(0, 10); savePrefs(); $('#rateTip').style.display = 'none'; };
|
|
@@ -2029,7 +2104,7 @@ document.addEventListener('visibilitychange', rateDay); setInterval(rateDay, 360
|
|
|
2029
2104
|
// Never twice ("No thanks", the coffee or nothing at all end it), never the day the star is asked, never in a demo. The days are kept in the settings file; nothing is sent.
|
|
2030
2105
|
function coffeeDay() { if (document.hidden || !SUPPORT.url || prefs.coffeeAsked || prefs.useFirst) return; prefs.useFirst = utcDay(); savePrefs(); } /* one write, ever: the first day the call is in view (a window left open overnight must not write its old settings over newer ones) */
|
|
2031
2106
|
function coffeeAsk(busyAt) {
|
|
2032
|
-
if (!SUPPORT.url || prefs.coffeeAsked || Q.get('demo') || !prefs.useFirst || prefs.useFirst >= utcDay() || document.hidden) return;
|
|
2107
|
+
if (!SUPPORT.url || prefs.coffeeAsked || Q.get('demo') || firstDay() || askedToday('coffee') || !prefs.useFirst || prefs.useFirst >= utcDay() || document.hidden) return;
|
|
2033
2108
|
const now = Date.now(), team = Object.keys(S.agents).filter((id) => id !== 'main' && id !== 'user' && S.lastAct[id] >= busyAt).length;
|
|
2034
2109
|
if (!(now - busyAt >= 10 * 60e3 || (team >= 3 && now - busyAt >= 2 * 60e3))) return;
|
|
2035
2110
|
if ($('#rateTip').style.display !== 'none' || rateTip.seen === utcDay() || prefs.rateDone === utcDay() || (RATE_ASKS && !prefs.rateDone && prefs.rateLast === utcDay() && (+prefs.rateDays || 0) >= 3)) return; /* the star shown, given or declined today */
|
|
@@ -2037,7 +2112,7 @@ function coffeeAsk(busyAt) {
|
|
|
2037
2112
|
}
|
|
2038
2113
|
function coffeeTip() {
|
|
2039
2114
|
const at = [$('#bCoffee'), $('#bMenu')].find((b) => b.getBoundingClientRect().width), t = $('#coffeeTip'); if (!at) return;
|
|
2040
|
-
prefs.coffeeAsked = utcDay(); savePrefs(); const r = at.getBoundingClientRect();
|
|
2115
|
+
prefs.coffeeAsked = utcDay(); noteAsk('coffee'); savePrefs(); const r = at.getBoundingClientRect();
|
|
2041
2116
|
$('#coffeeTipT').textContent = L('{0} et l’équipe ont fini. Si l’appel vous a aidé à suivre ce long travail, un café aide Agent Standup à continuer. (On ne le demande qu’une fois.)', '{0} and the team are done. If the call helped you follow this long run, a coffee keeps Agent Standup going. (We only ask once.)').replace('{0}', () => nameOf('main'));
|
|
2042
2117
|
$('#coffeeYes').textContent = L('☕ Offrir un café', '☕ Buy a coffee'); $('#coffeeNo').textContent = L('Non merci', 'No thanks');
|
|
2043
2118
|
t.style.display = ''; t.style.top = Math.round(r.bottom + 10) + 'px'; t.style.right = Math.max(8, Math.round(innerWidth - r.right - 6)) + 'px'; t.style.setProperty('--ax', Math.max(8, Math.round(r.width / 2 - 2)) + 'px');
|
|
@@ -2494,7 +2569,7 @@ async function followCurrent() {
|
|
|
2494
2569
|
const cur = await (await fetch('/api/current?proj=' + enc(watch) + (at ? '&pproj=' + enc(at.proj || watch) + '&pid=' + enc(at.id) + (at.since != null ? '&since=' + at.since : '') + (at.pin ? '&pin=1' : '') : '') + (S.cur ? '&sproj=' + enc(S.cur.proj) + '&sid=' + enc(S.cur.id) : ''))).json();
|
|
2495
2570
|
if (S.pick !== at) return false; // asked before a click or a tab sent the call elsewhere: the answer to act on is the one asked since. This one undid the click
|
|
2496
2571
|
if (!cur.pick) { S.pick = null; S.wide = !!cur.wide; } else if (at.since == null) at.since = cur.asked || 0; /* not kept there any more: you typed somewhere since, or that session is gone · wide: the folder the call follows has no session, the server looked everywhere, and so do the tabs (inWatch). An answer about a session you went to says nothing of that folder · since: the latest order there was when you went there, which a later one is told from */
|
|
2497
|
-
if (!cur.id) { $('#empty').classList.add('on'); return false; } $('#empty').classList.remove('on');
|
|
2572
|
+
if (!cur.id) { $('#empty').classList.add('on'); return false; } $('#empty').classList.remove('on'); if (S.why !== (cur.why || '')) { S.why = cur.why || ''; paintTabs(); } // why the call is in this session: said at the end of the row of tabs
|
|
2498
2573
|
if (S.cur && S.cur.id === cur.id && S.cur.proj === cur.proj) return false;
|
|
2499
2574
|
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
|
|
2500
2575
|
if (!(await loadSession(cur.proj, cur.id))) return false;
|
|
@@ -2571,10 +2646,11 @@ const BSTATE = { blocked: ['✋', 'needs you?', 'attend vous ?'], working: ['⚙
|
|
|
2571
2646
|
const BORDER = ['blocked', 'working', 'waiting', 'turn', 'idle'];
|
|
2572
2647
|
const agoStr = (ms) => (ms < 90e3 ? Math.max(1, Math.round(ms / 1000)) + 's' : ms < 5400e3 ? Math.round(ms / 60e3) + ' min' : Math.round(ms / 3600e3) + ' h');
|
|
2573
2648
|
const BGROUP = ['blocked', 'turn', 'working', 'waiting', 'idle']; // the board is in sections, what waits for you first
|
|
2574
|
-
let boardBusy = false, boardAll = null, boardDoneOpen = false;
|
|
2649
|
+
let boardBusy = false, boardAll = null, boardDoneOpen = false, boardIdleOpen = false;
|
|
2650
|
+
const BTOOLS = [['claude', 'Claude Code'], ['_codex', 'Codex'], ['_vibe', 'Mistral Vibe'], ['_cowork', 'Cowork']], toolOf = (r) => (BTOOLS.some(([k]) => k === r.proj) ? r.proj : 'claude'); // the filter at the top of the board, shown when sessions of two tools or more are listed
|
|
2575
2651
|
const isDone = (r) => !!r.done; // put away by you, until the session moves again: the server says so, to every window
|
|
2576
2652
|
function bcard(r, now, done) {
|
|
2577
|
-
const [ic,
|
|
2653
|
+
const [ic, en0, fr0] = BSTATE[r.state], [en, fr] = r.state === 'blocked' && r.sure ? ['needs you', 'vous attend'] : [en0, fr0], 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
|
|
2578
2654
|
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 : '';
|
|
2579
2655
|
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
|
|
2580
2656
|
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>` : '';
|
|
@@ -2583,8 +2659,12 @@ function bcard(r, now, done) {
|
|
|
2583
2659
|
}
|
|
2584
2660
|
function paintBoard() {
|
|
2585
2661
|
if (!boardAll || !document.body.classList.contains('board')) return; const now = Date.now(), recent = (a, b) => b.mtime - a.mtime;
|
|
2586
|
-
const
|
|
2587
|
-
const
|
|
2662
|
+
const kinds = BTOOLS.filter(([k]) => boardAll.some((r) => toolOf(r) === k)), pick = kinds.some(([k]) => k === prefs.boardTool) ? prefs.boardTool : '', mine = boardAll.filter((r) => !pick || toolOf(r) === pick);
|
|
2663
|
+
const filt = kinds.length < 2 ? '' : `<div class="bfilt" role="group" aria-label="${esc(L('Outil', 'Tool'))}">${[['', L('Tous', 'All')], ...kinds].map(([k, n]) => `<button class="bft${k === pick ? ' on' : ''}" data-tool="${esc(k)}" aria-pressed="${k === pick}">${esc(n)} <i>${k ? boardAll.filter((r) => toolOf(r) === k).length : boardAll.length}</i></button>`).join('')}</div>`;
|
|
2664
|
+
const live = mine.filter((r) => !isDone(r)), done = mine.filter(isDone).sort(recent), head = (k, label, n) => `${BSTATE[k] ? BSTATE[k][0] : '✓'} <span class="bl">${label}</span><i>${n}</i>`;
|
|
2665
|
+
const secs = filt + BGROUP.map((k) => [k, live.filter((r) => r.state === k).sort(recent)]).filter(([, rs]) => rs.length).map(([k, rs]) => k === 'idle' /* idle: folded into one line, opened on demand (and kept open while the board is painted again) */
|
|
2666
|
+
? `<details class="bsec bidle"${boardIdleOpen ? ' open' : ''}><summary class="bhd ${k}">${head(k, L(BSTATE[k][2], BSTATE[k][1]), rs.length)}</summary><div class="bgrid">${rs.map((r) => bcard(r, now, false)).join('')}</div></details>`
|
|
2667
|
+
: `<section class="bsec"><h3 class="bhd ${k}">${head(k, L(BSTATE[k][2], BSTATE[k][1]), rs.length)}</h3><div class="bgrid">${rs.map((r) => bcard(r, now, false)).join('')}</div></section>`).join('');
|
|
2588
2668
|
const put = done.length ? `<details class="bsec bdone"${boardDoneOpen ? ' open' : ''}><summary class="bhd">${head('', L('Traitées', 'Done'), done.length)}</summary><div class="bgrid">${done.map((r) => bcard(r, now, true)).join('')}</div></details>` : '';
|
|
2589
2669
|
$('#boardv').innerHTML = secs + put || `<div class="bsum"><span>${L('Aucune session récente', 'No recent session')}</span></div>`;
|
|
2590
2670
|
}
|
|
@@ -2595,13 +2675,14 @@ async function renderBoardView() {
|
|
|
2595
2675
|
paintBoard();
|
|
2596
2676
|
} catch {} finally { boardBusy = false; }
|
|
2597
2677
|
}
|
|
2598
|
-
$('#boardv').addEventListener('toggle', (e) => { if (e.target.classList && e.target.classList.contains('bdone')) boardDoneOpen = e.target.open; }, true);
|
|
2678
|
+
$('#boardv').addEventListener('toggle', (e) => { if (e.target.classList && e.target.classList.contains('bdone')) boardDoneOpen = e.target.open; if (e.target.classList && e.target.classList.contains('bidle')) boardIdleOpen = e.target.open; }, true);
|
|
2599
2679
|
$('#boardv').onkeydown = (e) => { if ((e.key === 'Enter' || e.key === ' ') && e.target.classList.contains('bcard')) { e.preventDefault(); e.target.click(); } };
|
|
2600
2680
|
async function openSession(proj, id) {
|
|
2601
2681
|
if (!TOOL[proj]) prefs.proj = proj; S.pick = { proj, id }; savePrefs(); setView('call'); // a Vibe or Codex session is listed under its tool, which is not a folder to follow: kept as the project, it left a window with no folder showing that tool's sessions only, for good
|
|
2602
2682
|
if (S.live || S.demo) { if (S.demo) await setMode('live'); S.cur = null; fillProjects(); await followCurrent(); } else await setMode('live');
|
|
2603
2683
|
}
|
|
2604
2684
|
$('#boardv').onclick = (e) => {
|
|
2685
|
+
const ft = e.target.closest('.bft'); if (ft) { prefs.boardTool = ft.dataset.tool; savePrefs(); paintBoard(); return; }
|
|
2605
2686
|
const pr = e.target.closest('.bpr'), put = e.target.closest('.bdo'), c = e.target.closest('.bcard'); if (pr) return openExternal(pr.dataset.url); if (!c) return;
|
|
2606
2687
|
if (put) { const proj = c.dataset.p, id = c.dataset.i, on = !put.dataset.undo; // shown at once here, and told to the server, which the other windows ask
|
|
2607
2688
|
for (const list of [boardAll || [], S.rows]) { const r = list.find((x) => x.proj === proj && x.id === id); if (r) { if (on) r.done = 1; else delete r.done; } }
|
|
@@ -2644,10 +2725,15 @@ function paintTabs() {
|
|
|
2644
2725
|
const html = by.size < 2 ? '' : ks.map((k) => { const r = by.get(k), on = k === ck, st = BSTATE[r.state]; // one session: no row, there is nothing to tell apart
|
|
2645
2726
|
const pinned = on && !!S.pick && !!S.pick.pin && sessKey(S.pick) === k, tip = tabName(r) + '\n' + niceProj(r.proj) + (st ? ' · ' + L(st[2], st[1]) : '') + (pinned ? '\n' + L('Épinglé : cliquez pour désépingler', 'Pinned: click to unpin') : '');
|
|
2646
2727
|
return `<button class="stab ${r.state}${on ? ' on' : ''}" role="tab" aria-selected="${on}" data-k="${esc(k)}" title="${esc(tip)}">${st ? st[0] : ''}${TOOL[r.proj] ? `<i>${TOOL[r.proj]}</i>` : ''}<span>${esc(tabName(r))}</span>${pinned ? '📌' : ''}</button>`; }).join('')
|
|
2647
|
-
+ `<button class="stab all" title="${esc(L('Aller à une session', 'Go to a session'))} (Cmd / Ctrl + K)" aria-label="${esc(L('Aller à une session', 'Go to a session'))}">⋯</button
|
|
2728
|
+
+ `<button class="stab all" title="${esc(L('Aller à une session', 'Go to a session'))} (Cmd / Ctrl + K)" aria-label="${esc(L('Aller à une session', 'Go to a session'))}">⋯</button>` + (by.size < 2 ? '' : whyTag());
|
|
2648
2729
|
if (html === paintTabs.html) return; if (!html) paintTabs.cur = ''; el.innerHTML = paintTabs.html = html;
|
|
2649
2730
|
if (paintTabs.cur !== ck) { paintTabs.cur = ck; const on = el.querySelector('.on'); if (on) on.scrollIntoView({ block: 'nearest', inline: 'nearest' }); }
|
|
2650
2731
|
}
|
|
2732
|
+
function whyTag() { // which rule put the call in this session (currentSession in server.js): the call moves by itself, and this says why it is here
|
|
2733
|
+
const w = { pin: ['📌 ', L('épinglée par vous', 'pinned by you')], pick: ['↪ ', L('vous y êtes allé', 'you went there')], typed: ['⌨ ', L('là où vous avez écrit en dernier', 'where you last typed')], busy: ['⚙ ', L('là où l’on travaille', 'where the work is')], stay: ['· ', L('personne au travail : l’appel reste ici', 'nobody at work: the call stays')], latest: ['· ', L('la dernière session écrite', 'the latest session written')] }[S.why];
|
|
2734
|
+
if (!w) return ''; const tip = L('L’appel suit la session où vous avez écrit en dernier. Un clic sur un onglet l’y emmène ; un second clic l’y épingle. G : ce qui a besoin de vous.', 'The call follows the session you last typed in. A click on a tab takes it there; a second click pins it there. G: what needs you.');
|
|
2735
|
+
return `<span class="why" title="${esc(tip)}">${w[0]}${esc(L('Suivie : ', 'Following: ') + w[1])}</span>`;
|
|
2736
|
+
}
|
|
2651
2737
|
function goSession(proj, id, pin) { // you go to this session: the call is kept there until you type somewhere (since: filled by the first answer, see followCurrent)
|
|
2652
2738
|
// pin: by a click on its tab. The call is pinned there (📌): it stays while you go through the Claude Code tabs of the editor and while you type in it, until you ask something in another session. A click on that tab again unpins it
|
|
2653
2739
|
const held = !!pin && !!S.pick && !!S.pick.pin && S.pick.proj === proj && S.pick.id === id; S.pick = pin && !held ? { proj, id, pin: true } : { proj, id };
|
|
@@ -2692,7 +2778,7 @@ async function visitSay(v, token) {
|
|
|
2692
2778
|
$('#visit').onclick = (e) => { const v = S.visit; if (!v) return; if (e.target.closest('.vx')) hideVisit(); else goSession(v.r.proj, v.r.id); };
|
|
2693
2779
|
async function sessPoll() {
|
|
2694
2780
|
if (!S.live || S.demo || document.hidden || sessPoll.busy) return; sessPoll.busy = true;
|
|
2695
|
-
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; }
|
|
2781
|
+
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(); paintAttn(); } } catch {} finally { sessPoll.busy = false; }
|
|
2696
2782
|
}
|
|
2697
2783
|
setInterval(sessPoll, 3000);
|
|
2698
2784
|
async function setMode(m) {
|
|
@@ -2812,15 +2898,15 @@ function applyLang() {
|
|
|
2812
2898
|
$('#callTrMi').style.display = CALL_LANG[prefs.lang] && !FR() ? '' : 'none';
|
|
2813
2899
|
const sel = $('#langSel'); if (!sel.options.length) sel.innerHTML = LANGS.map(([c, n]) => `<option value="${c}">${n}</option>`).join(''); sel.value = prefs.lang;
|
|
2814
2900
|
[['#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));
|
|
2815
|
-
$('#
|
|
2816
|
-
$('#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}
|
|
2901
|
+
$('#gB').textContent = L('🔊 Activer le son', '🔊 Turn on sound'); $('#gB').title = L('Ou cliquez n’importe où dans l’appel', 'Or click anywhere in the call');
|
|
2902
|
+
$('#eDemo').textContent = L('▶ Voir la démo', '▶ Watch the demo'); $('#eT').textContent = L('En attente d’une session', 'Waiting for a session'); $('#eP').innerHTML = watched() ? esc(L('Aucune session pour l’instant. Lancez Claude Code, Codex ou Mistral Vibe dans {0} : l’appel démarrera tout seul.', 'No session yet. Start Claude Code, Codex or Mistral Vibe in {0}: the call will start by itself.')).replace('{0}', () => `<b>${esc(watched())}</b>`) : esc(L('Aucune session sur cet ordinateur pour l’instant. Lancez Claude Code, Codex ou Mistral Vibe (ou une tâche Cowork) : l’appel démarrera tout seul.', 'No session on this computer yet. Start Claude Code, Codex or Mistral Vibe (or a Cowork task): the call will start by itself.'));
|
|
2817
2903
|
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; } }
|
|
2818
2904
|
document.querySelectorAll('#menu .mi[data-t], #prefs .mi[data-t]').forEach((b) => b.querySelector('.sw').classList.toggle('on', !!prefs[b.dataset.t])); renderCoffee(); renderTokens(); updateHint(); renderLog(true); syncUI();
|
|
2819
2905
|
}
|
|
2820
2906
|
const elsewhere = () => !!(S.owner && S.owner !== CID);
|
|
2821
2907
|
function applyMute() {
|
|
2822
|
-
const b = $('#bMute'); b.textContent = AUD.muted ? '🔇' : elsewhere() ? '🔈' : '🔊';
|
|
2823
|
-
b.title = 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)');
|
|
2908
|
+
const b = $('#bMute'); b.textContent = AUD.muted || S.hush ? '🔇' : elsewhere() ? '🔈' : '🔊';
|
|
2909
|
+
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)');
|
|
2824
2910
|
AUD.apply(); if (AUD.off()) { synth && synth.cancel(); AUD.stopAll(); }
|
|
2825
2911
|
}
|
|
2826
2912
|
async function audioSync(claim) { // heartbeat + ownership: avoids two Agent Standup windows talking at the same time
|
|
@@ -2831,7 +2917,7 @@ async function audioSync(claim) { // heartbeat + ownership: avoids two Agent S
|
|
|
2831
2917
|
}
|
|
2832
2918
|
const claimAudio = () => { S.owner = CID; applyMute(); audioSync(true); };
|
|
2833
2919
|
setInterval(() => audioSync(false), 1500);
|
|
2834
|
-
function toggleMute() { if (elsewhere()) { AUD.muted = false; claimAudio(); return; } AUD.muted = !AUD.muted; applyMute(); }
|
|
2920
|
+
function toggleMute() { if (S.hush) return joinSound(); if (elsewhere()) { AUD.muted = false; claimAudio(); return; } AUD.muted = !AUD.muted; applyMute(); }
|
|
2835
2921
|
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(); }
|
|
2836
2922
|
|
|
2837
2923
|
$('#viewSeg').onclick = (e) => { const b = e.target.closest('button'); if (b) setView(b.dataset.v); };
|
|
@@ -2847,7 +2933,7 @@ async function reloadChars() { await loadChars(); for (const k in imgCache) dele
|
|
|
2847
2933
|
$('#charPick').onclick = () => { $('#menu').classList.remove('on'); CHPICK.more = ''; openChars(); };
|
|
2848
2934
|
$('#packNoteB').onclick = () => { prefs.vampSeen = true; savePrefs(); packNote(); CHPICK.more = 'halloween'; openChars(); };
|
|
2849
2935
|
$('#packNoteX').onclick = () => { prefs.vampSeen = true; savePrefs(); packNote(); };
|
|
2850
|
-
$('#modeSeg').onclick = (e) => { const b = e.target.closest('button'); if (b) setMode(b.dataset.m); };
|
|
2936
|
+
$('#modeSeg').onclick = async (e) => { const b = e.target.closest('button'); if (!b) return; await setMode(b.dataset.m); if (b.dataset.m === 'demo' && S.demo && !S.playing) togglePlay(); }; // the demo plays at once, as from the empty state
|
|
2851
2937
|
// ⚙ menu: sections that fold (remembered) and a search box
|
|
2852
2938
|
function menuInit() {
|
|
2853
2939
|
const m = $('#menu'), secs = []; let cur = null;
|
|
@@ -2866,14 +2952,15 @@ function menuInit() {
|
|
|
2866
2952
|
$('#menuNone').style.display = q && !far.length && !secs.some((sc) => sc.items.some((e) => !e.classList.contains('mhide'))) ? '' : 'none';
|
|
2867
2953
|
};
|
|
2868
2954
|
}
|
|
2869
|
-
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 === '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(); if (b.dataset.t === 'customLaptop') { for (const k in imgCache) delete imgCache[k]; buildStage(); paintStatus(); } if (b.dataset.t === 'files') paintFiles(); if (b.dataset.t === 'artNet' && S.present) renderPresent(); if (b.dataset.t === 'ownNames') renameAll(); if (b.dataset.t === 'reactions') document.body.classList.toggle('react', prefs.reactions); if (b.dataset.t === '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(); }
|
|
2955
|
+
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 === '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(); if (b.dataset.t === 'customLaptop') { for (const k in imgCache) delete imgCache[k]; buildStage(); paintStatus(); } if (b.dataset.t === 'files') paintFiles(); if (b.dataset.t === 'artNet' && S.present) renderPresent(); if (b.dataset.t === 'ownNames') renameAll(); if (b.dataset.t === 'reactions') document.body.classList.toggle('react', prefs.reactions); if (b.dataset.t === 'focusLayout') { document.body.classList.toggle('focusl', !!prefs.focusLayout); layout(); } if (b.dataset.t === 'roster') { document.body.classList.toggle('rost', prefs.roster); paintStates(); } if (b.dataset.t === 'notify') { prefs.notifyChosen = true; savePrefs(); } if (b.dataset.t === 'notify' && prefs.notify) askNotify(); if (b.dataset.t === 'vanish' && !prefs.vanish) { S.gone.clear(); paintStatus(); }
|
|
2956
|
+
if (b.dataset.t === 'askCard') paintAsk(Date.now());
|
|
2870
2957
|
if (b.dataset.t === 'music') { $('#musicBox').style.display = prefs.music ? '' : 'none'; if (prefs.music) { AUD.init(); AUD.apply(); } } };
|
|
2871
2958
|
$('#menu').onclick = onSwitch; $('#prefs').onclick = (e) => { if (e.target === $('#prefs')) return closePrefs(); onSwitch(e); setTimeout(syncSwitches); };
|
|
2872
2959
|
function openPrefs(target) { // ⚙ → All settings; target: one of its settings, found by the search of the menu, shown and lit up
|
|
2873
2960
|
$('#menu').classList.remove('on'); $('#prefs').classList.add('on'); syncSwitches(); document.querySelectorAll('#prefs .mi[data-t]').forEach((b) => b.querySelector('.sw').classList.toggle('on', !!prefs[b.dataset.t]));
|
|
2874
2961
|
if (target) { target.scrollIntoView({ block: 'center' }); target.classList.remove('flash'); void target.offsetWidth; target.classList.add('flash'); (target.matches('.mi') ? target : target.querySelector('select, input, button') || target).focus(); } else $('#prefsX').focus();
|
|
2875
2962
|
}
|
|
2876
|
-
const PANEL_KEYS = ['office', 'officeVol', 'music', 'station', 'musicVol', 'notify', 'customLaptop', 'ownNames', 'roster', 'reactions', 'banter', 'chat', 'vanish', 'epi', 'files', 'artNet', 'visits', 'followTab']; // what the panel holds, and so what Reset puts back
|
|
2963
|
+
const PANEL_KEYS = ['office', 'officeVol', 'music', 'station', 'musicVol', 'notify', 'customLaptop', 'ownNames', 'roster', 'reactions', 'banter', 'chat', 'vanish', 'epi', 'files', 'artNet', 'visits', 'askCard', 'followTab']; // what the panel holds, and so what Reset puts back
|
|
2877
2964
|
$('#prefsReset').onclick = async () => {
|
|
2878
2965
|
const b = $('#prefsReset'); if (!b.classList.contains('sure')) { b.classList.add('sure'); b.textContent = L('Cliquez encore pour tout remettre', 'Click again to reset them all'); setTimeout(() => { b.classList.remove('sure'); b.textContent = L('Réglages par défaut', 'Reset to defaults'); }, 4000); return; } // two clicks: nothing is lost by a stray one
|
|
2879
2966
|
for (const k of PANEL_KEYS) { if (k in PREF_DEFAULTS) prefs[k] = PREF_DEFAULTS[k]; else delete prefs[k]; } delete prefs.notifyChosen; // notifyChosen too: the default of notifications is decided at start-up from it
|
|
@@ -2891,7 +2978,8 @@ $('#menuTipOk').onclick = menuTipDone;
|
|
|
2891
2978
|
function closePrefs() { $('#prefs').classList.remove('on'); $('#bMenu').focus(); }
|
|
2892
2979
|
$('#prefsX').onclick = closePrefs; $('#mPrefs').onclick = () => openPrefs();
|
|
2893
2980
|
function renderMenuShop() { // in the menu, under Characters: the Halloween pack for those who do not have it. Emptied while the Characters window shows the same panel (one set of ids at a time)
|
|
2894
|
-
const el = $('#menuShop'), sp = SHOP.halloween; if (!el) return; if (!sp || sp.n || $('#recap.on #chdlg')) { el.innerHTML = ''; return; }
|
|
2981
|
+
const el = $('#menuShop'), sp = SHOP.halloween; if (!el) return; if (!sp || sp.n || $('#recap.on #chdlg')) { el.innerHTML = ''; return; } // one line: the pictures, the price and the buttons are in the Characters window
|
|
2982
|
+
el.innerHTML = `<button class="btn" id="menuShopGo" style="width:100%;text-align:left">🎃 ${esc(L('Le pack Halloween, dessiné à la main', 'The hand-drawn Halloween pack'))} ›</button>`; $('#menuShopGo').onclick = () => { $('#menu').classList.remove('on'); CHPICK.more = 'halloween'; openChars(); };
|
|
2895
2983
|
}
|
|
2896
2984
|
$('#station').innerHTML = STATIONS.map((s) => `<option value="${s.id}">📻 ${s.name}</option>`).join('');
|
|
2897
2985
|
$('#station').value = prefs.station; $('#musicVol').value = prefs.musicVol; $('#musicBox').style.display = prefs.music ? '' : 'none';
|
|
@@ -2918,7 +3006,7 @@ kokoroUI();
|
|
|
2918
3006
|
// to them once they are ready, not before); ✕ and the line never comes back. Not in the scripted demo (?demo=1), which is what the pictures and videos are made from.
|
|
2919
3007
|
let offerTimer = null;
|
|
2920
3008
|
async function voiceOffer() {
|
|
2921
|
-
const el = $('#vOffer'), hide = () => { el.style.display = 'none'; clearInterval(offerTimer); offerTimer = null; };
|
|
3009
|
+
const el = $('#vOffer'), hide = () => { const was = el.style.display !== 'none'; el.style.display = 'none'; clearInterval(offerTimer); offerTimer = null; if (was) packNote(); }; // one offer at a time: the pack's line waits for this one
|
|
2922
3010
|
if (!prefs.voice || prefs.voiceOffer === 'no' || Q.get('demo')) return hide();
|
|
2923
3011
|
let st; try { st = await (await fetch('/api/kokoro')).json(); } catch { return; }
|
|
2924
3012
|
const add = st.installed && st.ready && !st.g2p && !!CALL_LANG[prefs.lang] && prefs.vstyle === 'kokoro'; // the voices are there, from before French, Spanish and Portuguese were added: one small package more, said on the call where one of them is the language of the interface (⚙ said it, and nothing else)
|
|
@@ -2927,7 +3015,7 @@ async function voiceOffer() {
|
|
|
2927
3015
|
if (busy && !st.installing && !voiceOffer.woke) { voiceOffer.woke = true; fetch('/api/voices?engine=kokoro').catch(() => {}); } // installed in an earlier run, closed before the model was ready: nothing else starts the engine while another style is in use, and the line would say “Downloading” for good
|
|
2928
3016
|
if ((st.installed && !busy && !add) || !st.npm) return hide(); // they have them; or cannot have them (no npm), which ⚙ explains
|
|
2929
3017
|
$('#vOfferT').textContent = busy ? L('Téléchargement des vraies voix… vous pouvez continuer.', 'Downloading the real voices… you can carry on.') : st.error || (add ? L('Voix prêtes en anglais. Le français est encore lu par les voix du système.', 'Voices ready in English. This language is still read by the system voices.') : L('Vos agents peuvent parler avec de vraies voix.', 'Your agents can speak with real voices.'));
|
|
2930
|
-
$('#vOfferB').style.display = busy ? 'none' : ''; $('#vOfferB').textContent = add ? L('Ajouter les voix françaises', 'Add the voices of this language') + L(` (${st.g2pMb} Mo)`, ` (${st.g2pMb} MB)`) : L('Installer', 'Install') + L(` (${st.sizeMb} Mo)`, ` (${st.sizeMb} MB)`); el.style.display = '';
|
|
3018
|
+
$('#vOfferB').style.display = busy ? 'none' : ''; $('#vOfferB').textContent = add ? L('Ajouter les voix françaises', 'Add the voices of this language') + L(` (${st.g2pMb} Mo)`, ` (${st.g2pMb} MB)`) : L('Installer', 'Install') + L(` (${st.sizeMb} Mo)`, ` (${st.sizeMb} MB)`); el.style.display = ''; if ($('#packNote').style.display !== 'none') $('#packNote').style.display = 'none';
|
|
2931
3019
|
if (busy && !offerTimer) offerTimer = setInterval(voiceOffer, 2500); if (!busy && offerTimer) { clearInterval(offerTimer); offerTimer = null; }
|
|
2932
3020
|
}
|
|
2933
3021
|
$('#vOfferB').onclick = async () => { prefs.voiceOffer = 'want'; savePrefs(); try { await fetch('/api/kokoro/install', { method: 'POST' }); } catch {} voiceOffer(); kokoroUI(); };
|
|
@@ -2956,11 +3044,36 @@ $('#mClip').onclick = () => { $('#menu').classList.remove('on'); exportVideo(0,
|
|
|
2956
3044
|
$('#mBrowser').onclick = () => { $('#menu').classList.remove('on'); window.parent.postMessage({ agentStandup: 'openBrowser' }, '*'); };
|
|
2957
3045
|
$('#seek').oninput = (e) => seekTo(+e.target.value);
|
|
2958
3046
|
$('#eDemo').onclick = async () => { await setMode('demo'); if (S.demo && !S.playing) togglePlay(); }; // "Watch the demo" plays it
|
|
2959
|
-
|
|
2960
|
-
|
|
3047
|
+
// The live call plays as soon as the page opens, silent: a browser lets a page make sound only after a click or a key. The first one, anywhere, turns the sound on (the chip at the top says so).
|
|
3048
|
+
// The mute button and its M key are left to themselves: they turn the sound on too (toggleMute), instead of the click turning it on and the button turning it straight off again.
|
|
3049
|
+
function joinSound() {
|
|
3050
|
+
if (!S.hush) return; S.hush = false; $('#gate').classList.remove('on'); claimAudio(); AUD.init(); AUD.apply(); applyMute(); syncUI();
|
|
2961
3051
|
if (synth && !EMBED) { try { synth.speak(new SpeechSynthesisUtterance('')); } catch {} } // unlock browser speech
|
|
2962
|
-
|
|
2963
|
-
|
|
3052
|
+
}
|
|
3053
|
+
$('#gB').onclick = joinSound;
|
|
3054
|
+
addEventListener('pointerdown', (e) => { if (S.hush && !(e.target.closest && e.target.closest('#bMute'))) joinSound(); }, true);
|
|
3055
|
+
addEventListener('keydown', (e) => { if (S.hush && !e.metaKey && !e.ctrlKey && !e.altKey && e.key.toLowerCase() !== 'm' && e.key !== 'Escape' && !/INPUT|SELECT|TEXTAREA/.test(e.target.tagName)) { joinSound(); if (e.key === ' ') { e.preventDefault(); e.stopImmediatePropagation(); } } }, true); // the first Space turns the sound on, as Join did, without pausing the call too
|
|
3056
|
+
// The strip under the header: what needs you, in the call's session first (its agents), then in the other sessions (the list the tabs come from). Live only, in every view.
|
|
3057
|
+
// Certain when Claude Code says a menu is open there (sure); a guess otherwise, from how long a call has waited ("may need you"). A click, or G, goes to the next one.
|
|
3058
|
+
function attnItems(now) {
|
|
3059
|
+
if (!S.live || S.demo || !S.cur) return []; const ck = sessKey(S.cur), out = [];
|
|
3060
|
+
for (const id of S.attn || []) { const st = agentState(id, now); if (st.k === 'blocked') out.push({ id, who: nameOf(id), what: st.ask || S.lastTool[id] || (S.run[id] && S.run[id].name) || '', sure: !!st.sure, since: st.since || 0 }); }
|
|
3061
|
+
for (const r of S.rows) if (r.state === 'blocked' && !r.done && sessKey(r) !== ck && inWatch(r)) out.push({ r, who: '“' + tabName(r) + '”', what: r.ask || r.tool || '', sure: !!r.sure, since: r.since || now - (r.ageMs || 0) });
|
|
3062
|
+
return out;
|
|
3063
|
+
}
|
|
3064
|
+
function paintAttn(now = Date.now()) {
|
|
3065
|
+
const el = $('#attn'), a = attnItems(now), f = a[0];
|
|
3066
|
+
const html = f ? `<span class="aw">✋ <b>${esc(f.who)}</b> ${esc(f.sure ? L('vous attend', 'needs you') : L('vous attend peut-être', 'may need you'))}${f.what ? ' · ' + esc(f.what.replace(/\s+/g, ' ').slice(0, 120)) : ''}${f.since ? ' · ' + agoStr(Math.max(0, now - f.since)) : ''}</span>${a.length > 1 ? `<span class="am">+${a.length - 1}</span>` : ''}<span class="ak">G</span>` : '';
|
|
3067
|
+
if (html !== paintAttn.html) { paintAttn.html = html; el.innerHTML = html; el.hidden = !f; el.title = a.map((x) => x.who + (x.what ? ' · ' + x.what : '')).join('\n'); }
|
|
3068
|
+
}
|
|
3069
|
+
function goAttn() { // the next thing that needs you: an agent of this session, or another session (which the call goes to)
|
|
3070
|
+
const a = attnItems(Date.now()); if (!a.length) { toast(L('Personne n’a besoin de vous pour le moment', 'Nobody needs you right now')); return; }
|
|
3071
|
+
goAttn.i = ((goAttn.i || 0) + (goAttn.at && Date.now() - goAttn.at < 30000 ? 1 : 0)) % a.length; goAttn.at = Date.now(); const x = a[goAttn.i];
|
|
3072
|
+
if (x.r) { goAttn.i = 0; setView('call'); goSession(x.r.proj, x.r.id); return; }
|
|
3073
|
+
if (document.body.classList.contains('tree') || document.body.classList.contains('board')) setView('call');
|
|
3074
|
+
S.focusLock = Date.now() + 25000; setFocus(x.id); const t = $('#t-' + x.id); if (t) { t.scrollIntoView({ block: 'nearest', behavior: 'smooth' }); popTile(x.id); }
|
|
3075
|
+
}
|
|
3076
|
+
$('#attn').onclick = goAttn;
|
|
2964
3077
|
// J / K (or a click on the “need you” chip) jump to the agents that need you or are stalled, one after the other
|
|
2965
3078
|
function jumpAttn(dir = 1) {
|
|
2966
3079
|
const a = (S.attn || []).filter((id) => $('#t-' + id));
|
|
@@ -3060,8 +3173,8 @@ setInterval(() => {
|
|
|
3060
3173
|
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(); }
|
|
3061
3174
|
}, 3000);
|
|
3062
3175
|
function openKeys() {
|
|
3063
|
-
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 coupé / activé', 'Mute / unmute')], ['T', L('Vue arbre ↔ appel', 'Tree view ↔ call')], ['R', L('Récapitulatif', 'Recap')], ['L', L('Transcription', 'Transcript')], ['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')]];
|
|
3064
|
-
$('#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
|
|
3176
|
+
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 coupé / activé', 'Mute / unmute')], ['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')]];
|
|
3177
|
+
$('#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>`;
|
|
3065
3178
|
$('#recapx').onclick = () => $('#recap').classList.remove('on'); $('#recap').classList.add('on');
|
|
3066
3179
|
}
|
|
3067
3180
|
$('#mKeys').onclick = () => { $('#menu').classList.remove('on'); openKeys(); };
|
|
@@ -3092,13 +3205,14 @@ addEventListener('keydown', (e) => {
|
|
|
3092
3205
|
if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === 'k') { e.preventDefault(); openSwitcher(); return; }
|
|
3093
3206
|
if (/INPUT|SELECT|TEXTAREA/.test(e.target.tagName) || e.metaKey || e.ctrlKey || e.altKey) return; // browser shortcuts (Cmd+R, Ctrl+N…) stay the browser's
|
|
3094
3207
|
if (e.key === '?') { openKeys(); return; }
|
|
3095
|
-
if (e.key === ' ') { if (e.target.closest && e.target.closest('button, .tile, .rr, .bcard, a, [role=button]')) return; e.preventDefault(); togglePlay(); } else if (e.key.toLowerCase() === 'm') toggleMute(); else if (e.key.toLowerCase() === 't') { const toTree = !document.body.classList.contains('tree'); setView(toTree ? 'tree' : 'call'); if (toTree) toast(L('Vue arbre : T pour revenir, ? pour l’aide', 'Tree view: T to go back, ? for help')); } else if (e.key.toLowerCase() === 'r') openRecap(); else if (e.key.toLowerCase() === 'l') $('#bLog').click(); else if (e.key === 'ArrowRight' && !S.live) { e.preventDefault(); stepEvent(1); } else if (e.key === 'ArrowLeft' && !S.live) { e.preventDefault(); stepEvent(-1); } else if (e.key.toLowerCase() === 'n') stepHighlight(e.shiftKey ? -1 : 1); else if (e.key.toLowerCase() === 'j') jumpAttn(1); else if (e.key.toLowerCase() === 'k') jumpAttn(-1); else if (e.key === 'Escape') { $('#recap').classList.remove('on'); $('#menu').classList.remove('on'); }
|
|
3208
|
+
if (e.key === ' ') { if (e.target.closest && e.target.closest('button, .tile, .rr, .bcard, a, [role=button]')) return; e.preventDefault(); togglePlay(); } else if (e.key.toLowerCase() === 'm') toggleMute(); else if (e.key.toLowerCase() === 't') { const toTree = !document.body.classList.contains('tree'); setView(toTree ? 'tree' : 'call'); if (toTree) toast(L('Vue arbre : T pour revenir, ? pour l’aide', 'Tree view: T to go back, ? for help')); } else if (e.key.toLowerCase() === 'r') openRecap(); else if (e.key.toLowerCase() === 'l') $('#bLog').click(); else if (e.key === 'ArrowRight' && !S.live) { e.preventDefault(); stepEvent(1); } else if (e.key === 'ArrowLeft' && !S.live) { e.preventDefault(); stepEvent(-1); } else if (e.key.toLowerCase() === 'n') stepHighlight(e.shiftKey ? -1 : 1); else if (e.key.toLowerCase() === 'g') goAttn(); else if (e.key.toLowerCase() === 'j') jumpAttn(1); else if (e.key.toLowerCase() === 'k') jumpAttn(-1); else if (e.key === 'Escape') { $('#recap').classList.remove('on'); $('#menu').classList.remove('on'); }
|
|
3096
3209
|
});
|
|
3097
3210
|
if (EMBED) $('#mBrowser').style.display = $('#mFollowTab').style.display = '';
|
|
3098
3211
|
|
|
3099
3212
|
(async function init() {
|
|
3213
|
+
if (!prefs.firstDay) { prefs.firstDay = HAD_PREFS ? '2000-01-01' : new Date().toISOString().slice(0, 10); savePrefs(); } // the first day the call is in view asks nothing (see firstDay); someone who used the app before has had theirs
|
|
3100
3214
|
if (!LANGS.some((l) => l[0] === prefs.lang)) prefs.lang = 'en'; await loadLocale(prefs.lang); voiceOffer(); kokoroUI(); await loadChars();
|
|
3101
|
-
document.body.classList.toggle('rost', prefs.roster !== false); document.body.classList.toggle('react', !!prefs.reactions); setView(prefs.view); menuInit(); addEventListener('click', () => { try { if (prefs.notify && !EMBED && 'Notification' in window && Notification.permission === 'default') Notification.requestPermission(); } catch {} }, { once: true }); applyLang(); applyMute(); TTS.init().then(updateHint);
|
|
3215
|
+
document.body.classList.toggle('rost', prefs.roster !== false); document.body.classList.toggle('react', !!prefs.reactions); document.body.classList.toggle('focusl', !!prefs.focusLayout); setView(prefs.view); menuInit(); addEventListener('click', () => { try { if (prefs.notify && !EMBED && 'Notification' in window && Notification.permission === 'default') Notification.requestPermission(); } catch {} }, { once: true }); applyLang(); applyMute(); TTS.init().then(updateHint);
|
|
3102
3216
|
loadHealth().then(() => { // French by default only if translation can actually work; otherwise stay in English without a warning
|
|
3103
3217
|
const h = S.health || {};
|
|
3104
3218
|
if (!prefs.langChosen && FR() && h.claude === null && !h.apiKey) { prefs.lang = 'en'; applyLang(); }
|
|
@@ -3112,7 +3226,7 @@ if (EMBED) $('#mBrowser').style.display = $('#mFollowTab').style.display = '';
|
|
|
3112
3226
|
return;
|
|
3113
3227
|
}
|
|
3114
3228
|
S.live = Q.get('live') !== '0'; document.querySelectorAll('#modeSeg button').forEach((b) => b.classList.toggle('on', b.dataset.m === (S.live ? 'live' : 'replay')));
|
|
3115
|
-
if (S.live) { S.
|
|
3229
|
+
if (S.live) { S.hush = true; S.locked = false; $('#gate').classList.add('on'); applyMute(); S.cur = null; syncUI(); fillProjects(); await followCurrent(); } else { S.live = true; await setMode('replay'); if (Q.get('at') != null && S.events.length) seekTo(Math.max(0, Math.min(S.events.length - 1, +Q.get('at') || 0))); }
|
|
3116
3230
|
syncUI();
|
|
3117
3231
|
})();
|
|
3118
3232
|
</script>
|