@double_geste/agent-standup 1.38.0 → 1.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/agent-standup.js +4 -2
- package/package.json +1 -1
- package/public/index.html +72 -35
- package/public/locales/da.json +9 -1
- package/public/locales/de.json +9 -1
- package/public/locales/en.json +8 -0
- package/public/locales/es.json +9 -1
- package/public/locales/ja.json +9 -1
- package/public/locales/ko.json +9 -1
- package/public/locales/pt-BR.json +9 -1
- package/public/locales/zh-CN.json +9 -1
- package/public/locales/zh-TW.json +9 -1
- package/server.js +48 -7
package/bin/agent-standup.js
CHANGED
|
@@ -10,7 +10,7 @@ const argv = process.argv.slice(2), flags = {}, rest = [];
|
|
|
10
10
|
for (let i = 0; i < argv.length; i++) {
|
|
11
11
|
const a = argv[i], val = () => argv[++i];
|
|
12
12
|
if (a === '--port') flags.port = val(); else if (a === '--projects') flags.projects = val(); else if (a === '--codex') flags.codex = val(); else if (a === '--vibe') flags.vibe = val(); else if (a === '--cowork') flags.cowork = val(); else if (a === '--characters') flags.characters = val(); else if (a === '--config-dir') flags.config = val();
|
|
13
|
-
else if (a === '--open') flags.open = true; else if (a === '--here') flags.here = true; else if (a === '--json') flags.json = true; else if (a === '--titles') flags.titles = true;
|
|
13
|
+
else if (a === '--from') flags.from = val(); else if (a === '--open') flags.open = true; else if (a === '--here') flags.here = true; else if (a === '--json') flags.json = true; else if (a === '--titles') flags.titles = true;
|
|
14
14
|
else if (a === '-h' || a === '--help') flags.help = true; else if (a === '-v' || a === '--version') flags.version = true; else rest.push(a);
|
|
15
15
|
}
|
|
16
16
|
const cmd = rest[0] || 'serve';
|
|
@@ -29,6 +29,8 @@ Options
|
|
|
29
29
|
--vibe DIR where Mistral Vibe keeps its files (default ~/.vibe, or $VIBE_HOME); "off" to leave Vibe sessions out
|
|
30
30
|
--cowork DIR where the Claude desktop app keeps its Cowork sessions (default: its local-agent-mode-sessions folder); "off" to leave them out
|
|
31
31
|
--characters DIR folder with your own pixel-art characters (default ~/.agent-standup/characters)
|
|
32
|
+
--from plugin how the Claude Code plugin starts it (its usage, if you agree to share it, is counted apart); also AGENT_STANDUP_FROM=plugin,
|
|
33
|
+
which older versions ignore instead of refusing
|
|
32
34
|
--here status: only sessions of the current folder (matched on its real path, as Claude Code names it)
|
|
33
35
|
--json status: machine-readable output (add --titles to include session titles)
|
|
34
36
|
`;
|
|
@@ -44,7 +46,7 @@ if (flags.port !== undefined) { // a real port number or nothing: no silent fa
|
|
|
44
46
|
if (!/^\d+$/.test(String(flags.port)) || +flags.port < 1 || +flags.port > 65535) { console.error(`Invalid --port "${flags.port}": use a number between 1 and 65535.`); process.exit(2); }
|
|
45
47
|
process.env.PORT = String(+flags.port);
|
|
46
48
|
}
|
|
47
|
-
process.env.AGENT_STANDUP_HOST = 'command line'; // named in a problem report (⚙ › Report a problem)
|
|
49
|
+
process.env.AGENT_STANDUP_HOST = (flags.from || process.env.AGENT_STANDUP_FROM) === 'plugin' ? 'claude code plugin' : 'command line'; // named in a problem report (⚙ › Report a problem), and what the usage count counts (--from plugin or AGENT_STANDUP_FROM=plugin: the Claude Code plugin's commands; the plugin uses the variable, since a version without --from refuses the flag)
|
|
48
50
|
const server = require('../server.js');
|
|
49
51
|
const projKey = (dir) => String(dir || '').replace(/[^a-zA-Z0-9]/g, '-'); // Claude Code's project folder naming
|
|
50
52
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@double_geste/agent-standup",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.39.0",
|
|
4
4
|
"description": "Your Claude Code, Codex and Mistral Vibe agents as a live video call, from the terminal: a local page in your browser, plus one-line status for status bars. Free, open source, zero token cost.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"agent-standup": "bin/agent-standup.js"
|
package/public/index.html
CHANGED
|
@@ -51,7 +51,7 @@
|
|
|
51
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 */
|
|
52
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 }
|
|
53
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) }
|
|
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 */
|
|
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.gave:not(.on) { color:#ffb347 } .stab.all { flex:none; min-width:0; padding:2px 8px } /* a narrow panel: the tabs keep a readable width and the row scrolls */
|
|
55
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 }
|
|
56
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 }
|
|
57
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 */
|
|
@@ -89,12 +89,12 @@
|
|
|
89
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 */
|
|
90
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 }
|
|
91
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 }
|
|
92
|
-
.rr.k-done { opacity:.82 } .rr.k-done .st { color:var(--ok) } .rr.turn { opacity:1; border-left-color:var(--accent) } .rr.turn .st { color:var(--accent); font-weight:700 } .rr.k-idle .st { color:var(--dim) } .rr.speaking { box-shadow:0 0 0 2px rgba(124,156,255,.5) }
|
|
92
|
+
.rr.k-done { opacity:.82 } .rr.k-done .st { color:var(--ok) } .rr.turn { opacity:1; border-left-color:var(--accent) } .rr.turn .st { color:var(--accent); font-weight:700 } .rr.turn.gave { border-left-color:#ffb347 } .rr.turn.gave .st { color:#ffb347 } .rr.k-idle .st { color:var(--dim) } .rr.speaking { box-shadow:0 0 0 2px rgba(124,156,255,.5) }
|
|
93
93
|
#boardv { flex:1; overflow:auto; padding:16px 18px; display:none }
|
|
94
94
|
.bsum { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px; font-size:12.5px } .bsum span { padding:3px 10px; border-radius:99px; background:var(--panel2); border:1px solid var(--line) }
|
|
95
95
|
.bgrid { display:grid; grid-template-columns:repeat(auto-fill,minmax(270px,1fr)); gap:10px }
|
|
96
96
|
.bcard { text-align:left; background:var(--panel2); border:1px solid var(--line); border-radius:12px; padding:11px 13px; display:flex; flex-direction:column; gap:5px; cursor:pointer }
|
|
97
|
-
.bcard:hover { border-color:var(--accent) } .bcard.blocked { border-color:#ff5252; box-shadow:0 0 0 2px rgba(255,82,82,.25) } .bcard.working { border-color:rgba(240,160,32,.7) } .bcard.waiting { border-color:rgba(110,190,255,.8) } .bcard.idle { opacity:.8 }
|
|
97
|
+
.bcard:hover { border-color:var(--accent) } .bcard.blocked { border-color:#ff5252; box-shadow:0 0 0 2px rgba(255,82,82,.25) } .bcard.gave { border-color:#ffb347 } .bcard.gave .bq { border-left-color:#ffb347 } .bcard.working { border-color:rgba(240,160,32,.7) } .bcard.waiting { border-color:rgba(110,190,255,.8) } .bcard.idle { opacity:.8 }
|
|
98
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 }
|
|
99
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 }
|
|
100
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 }
|
|
@@ -204,7 +204,7 @@
|
|
|
204
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
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 */
|
|
206
206
|
.status.working { color:var(--gold) } .status.done { color:var(--ok) } .status.turn { color:#0b1020; background:var(--accent) }
|
|
207
|
-
.status.waiting { color:#8fd3ff } .status.blocked { color:#fff; background:#c0392b; font-weight:700 } .status.stalled { color:#1b1d27; background:#ffb347; font-weight:700 }
|
|
207
|
+
.status.waiting { color:#8fd3ff } .status.blocked { color:#fff; background:#c0392b; font-weight:700 } .status.stalled, .status.gave { color:#1b1d27; background:#ffb347; font-weight:700 }
|
|
208
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 }
|
|
209
209
|
/* the header's status chips are styled by id: "board" is also the class the Sessions view puts on <body>, and a rule on .board used to hide the whole page in a narrow window */
|
|
210
210
|
#board { display:flex; gap:6px; font-size:11.5px; flex-wrap:nowrap; min-width:0; overflow:hidden } #board em { font-style:normal } #board span { flex:none; padding:2px 8px; border-radius:99px; background:var(--panel2); border:1px solid var(--line); white-space:nowrap }
|
|
@@ -232,7 +232,8 @@
|
|
|
232
232
|
@keyframes flash2 { 40% { opacity:.9 } }
|
|
233
233
|
.puff { position:fixed; left:0; top:0; z-index:9; pointer-events:none; border-radius:50% }
|
|
234
234
|
#toasts { position:absolute; left:12px; bottom:12px; z-index:6; display:flex; flex-direction:column; gap:6px; pointer-events:none }
|
|
235
|
-
.toast.offer { pointer-events:auto; animation:none; display:flex; align-items:center; gap:8px; padding:4px 6px 4px 12px; order:9 } .toast.offer .btn { padding:3px 10px; font-size:12px; white-space:nowrap } .toast.offer .ic { font-size:11px; padding:2px 6px }
|
|
235
|
+
.toast.offer { pointer-events:auto; animation:none; display:flex; align-items:center; gap:8px; padding:4px 6px 4px 12px; order:9 } .toast.offer .btn { padding:3px 10px; font-size:12px; white-space:nowrap } .toast.offer .ic { font-size:11px; padding:2px 6px }
|
|
236
|
+
#packNoteI { width:48px; height:36px; border-radius:4px; object-fit:cover; flex:none; cursor:pointer; margin-left:-6px } /* the offer of the real voices: stays until answered, under the passing toasts */
|
|
236
237
|
.toast { background:rgba(27,29,39,.92); border:1px solid var(--line); border-radius:99px; padding:5px 12px; font-size:12px; animation:toast 3s ease forwards } @keyframes toast { 0% { opacity:0; transform:translateY(6px) } 10%, 80% { opacity:1; transform:none } 100% { opacity:0 } }
|
|
237
238
|
.eye { transform-box:fill-box; transform-origin:center; animation:blink 4.6s infinite; animation-delay:var(--d,0s) } @keyframes blink { 0%,94%,100% { transform:scaleY(1) } 97% { transform:scaleY(.08) } }
|
|
238
239
|
.brow { transform-box:fill-box; transform-origin:center; transition:transform .25s } .tile.speaking .brow { animation:brow .7s ease-in-out infinite } @keyframes brow { 50% { transform:translateY(-1.1px) } }
|
|
@@ -303,7 +304,7 @@
|
|
|
303
304
|
#prefs .flash { animation:flash 1.6s ease } @keyframes flash { 0%, 40% { background:rgba(124,156,255,.28) } }
|
|
304
305
|
#prefs .pfoot { display:flex; justify-content:flex-end; padding:12px 10px 0; margin-top:8px; border-top:1px solid var(--line) } #prefsReset.sure { border-color:#ff7a6b; color:#ffb4a8 }
|
|
305
306
|
#menuTip { position:fixed; z-index:13; max-width:260px; padding:10px 12px; border-radius:10px; background:#2b3352; border:1px solid var(--accent); box-shadow:0 10px 30px rgba(0,0,0,.5); font-size:12.5px; line-height:1.45; color:var(--text) } #menuTip::before { content:''; position:absolute; top:-7px; right:var(--ax,14px); width:12px; height:12px; background:#2b3352; border-left:1px solid var(--accent); border-top:1px solid var(--accent); transform:rotate(45deg) } #menuTip .btn { display:block; margin:8px 0 0 auto } /* once, after the menu moved */
|
|
306
|
-
#rateTip, #coffeeTip { position:fixed; z-index:13; max-width:280px; padding:10px 12px; border-radius:10px; background:#2b3352; border:1px solid var(--accent); box-shadow:0 10px 30px rgba(0,0,0,.5); font-size:12.5px; line-height:1.45; color:var(--text) } #rateTip::before, #coffeeTip::before { content:''; position:absolute; top:-7px; right:var(--ax,14px); width:12px; height:12px; background:#2b3352; border-left:1px solid var(--accent); border-top:1px solid var(--accent); transform:rotate(45deg) } #rateTip .rtb, #coffeeTip .rtb { display:flex; flex-wrap:wrap; gap:6px; justify-content:flex-end; margin-top:8px } #rateYes, #coffeeYes { border-color:var(--accent) } /* once, on the third day: a star (desktop app, command line) */
|
|
307
|
+
#rateTip, #coffeeTip, #usageTip { position:fixed; z-index:13; max-width:280px; padding:10px 12px; border-radius:10px; background:#2b3352; border:1px solid var(--accent); box-shadow:0 10px 30px rgba(0,0,0,.5); font-size:12.5px; line-height:1.45; color:var(--text) } #rateTip::before, #coffeeTip::before, #usageTip::before { content:''; position:absolute; top:-7px; right:var(--ax,14px); width:12px; height:12px; background:#2b3352; border-left:1px solid var(--accent); border-top:1px solid var(--accent); transform:rotate(45deg) } #rateTip .rtb, #coffeeTip .rtb, #usageTip .rtb { display:flex; flex-wrap:wrap; gap:6px; justify-content:flex-end; margin-top:8px } #usageTip { max-width:360px } #rateYes, #coffeeYes, #usageYes { border-color:var(--accent) } /* once, on the third day: a star (desktop app, command line) */
|
|
307
308
|
a.artist { color:#f5c04a; text-underline-offset:2px } #menuShop:empty { display:none } #menuShop { margin:2px 0 8px; font-size:12px; line-height:1.5; color:#c3c6d4 } /* the Halloween pack, for those who do not have it */
|
|
308
309
|
#recap { position:fixed; inset:0; z-index:15; background:rgba(5,6,12,.88); display:none; overflow:auto; padding:28px 16px } #recap.on { display:block }
|
|
309
310
|
#recap .box { max-width:860px; margin:0 auto; background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:22px 26px }
|
|
@@ -378,6 +379,7 @@
|
|
|
378
379
|
</div>
|
|
379
380
|
<div id="menuTip" role="status" style="display:none"><span id="menuTipT"></span><button class="btn" id="menuTipOk"></button></div>
|
|
380
381
|
<div id="btip" role="tooltip"></div>
|
|
382
|
+
<div id="usageTip" role="dialog" aria-live="polite" style="display:none"><span id="usageTipT"></span><div class="rtb"><button class="btn" id="usageRead"></button><button class="btn" id="usageNo"></button><button class="btn" id="usageYes"></button></div></div>
|
|
381
383
|
<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>
|
|
382
384
|
<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>
|
|
383
385
|
<div id="prefs" role="dialog" aria-modal="true" aria-labelledby="prefsT"><div class="pbox">
|
|
@@ -388,7 +390,7 @@
|
|
|
388
390
|
<div class="box" id="officeBox" style="display:none"><input id="officeVol" type="range" min="0.1" max="1" step="0.05" style="width:100%" aria-label="Ambience volume"></div>
|
|
389
391
|
<button class="mi" data-t="music"><span data-fr="Musique d’ambiance (radio FIP)" data-en="Office music (FIP radio)">Musique d’ambiance (radio FIP)</span><i class="sw"></i></button>
|
|
390
392
|
<div class="box" id="musicBox" style="display:none"><select id="station"></select><input id="musicVol" type="range" min="0" max="1" step="0.05" style="width:100%" aria-label="Music volume"></div>
|
|
391
|
-
<button class="mi" data-t="notify"><span data-fr="Me prévenir quand les agents ont fini" data-en="Notify me when agents finish">Me prévenir quand les agents ont fini</span><i class="sw"></i></button>
|
|
393
|
+
<button class="mi" data-t="shareUsage" id="mShare" style="display:none"><span data-fr="Aider à compter les utilisateurs (1 requête par semaine)" data-en="Help count users (1 request a week)">Aider à compter les utilisateurs (1 requête par semaine)</span><i class="sw"></i></button> <button class="mi" data-t="notify"><span data-fr="Me prévenir quand les agents ont fini" data-en="Notify me when agents finish">Me prévenir quand les agents ont fini</span><i class="sw"></i></button>
|
|
392
394
|
<h4 data-fr="Personnages" data-en="Characters">Personnages</h4>
|
|
393
395
|
<button class="mi" data-t="customLaptop"><span data-fr="Ordinateur devant vos personnages" data-en="Laptop in front of your own characters">Ordinateur devant vos personnages</span><i class="sw"></i></button>
|
|
394
396
|
<button class="mi" data-t="ownNames"><span data-fr="Garder les noms de mes agents" data-en="Keep my agents’ own names">Garder les noms de mes agents</span><i class="sw"></i></button>
|
|
@@ -419,7 +421,7 @@
|
|
|
419
421
|
<div id="files"></div>
|
|
420
422
|
<div id="hl"></div>
|
|
421
423
|
<canvas id="gantt" height="90"></canvas>
|
|
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>
|
|
424
|
+
<div id="toasts" role="status" aria-live="polite"><div class="toast offer" id="vOffer" style="display:none"><span id="vOfferT"></span><button class="btn" id="vOfferB"></button><button class="ic" id="vOfferX" aria-label="Close">✕</button></div><div class="toast offer" id="packNote" style="display:none"><img id="packNoteI" src="pack-halloween.jpg" alt="" width="48" height="36"><span id="packNoteT"></span><button class="btn" id="packNoteB"></button><button class="ic" id="packNoteX" aria-label="Close">✕</button></div><div class="toast offer" id="trNote" style="display:none"><span id="trNoteT"></span><button class="btn" id="trNoteOk"></button><button class="btn" id="trNoteOff"></button></div></div><div id="visit" role="status" aria-live="polite"></div><div id="askc" role="region" aria-live="polite"></div>
|
|
423
425
|
<div id="empty"><h2 id="eT"></h2><p id="eP"></p><button class="cta" id="eDemo"></button></div>
|
|
424
426
|
<div id="gate"><button class="cta" id="gB"></button></div>
|
|
425
427
|
<div id="detail"><div class="hd"><b id="dname"></b><button class="ic" id="dclose">✕</button></div><div id="dbody"></div></div>
|
|
@@ -464,7 +466,8 @@ const APP = window.AS_APP && typeof window.AS_APP === 'object' && typeof window.
|
|
|
464
466
|
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 };
|
|
465
467
|
const PREF_DEFAULTS = { ...prefs }; // for ⚙ → All settings → Reset to defaults
|
|
466
468
|
{ 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
|
|
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);
|
|
469
|
+
const sv = window.SAVED_PREFS && typeof window.SAVED_PREFS === 'object' ? window.SAVED_PREFS : {}; Object.assign(prefs, (sv._t || 0) > (loc._t || 0) ? sv : loc);
|
|
470
|
+
if ((+sv.shareUsageT || 0) > (+prefs.shareUsageT || 0)) { prefs.shareUsage = sv.shareUsage; prefs.shareUsageT = sv.shareUsageT; prefs.usageAsked = sv.usageAsked; } } // the usage answer: the newest one, as the server keeps it (this origin's copy may hold an older one)
|
|
468
471
|
const HAD_PREFS = !!prefs._t; // someone who used the app before this page: shown once where the settings went
|
|
469
472
|
if (!HAD_PREFS) prefs.menuTipSeen = true; // a first visit: the menu was never anywhere else for this person, so the tip is not shown on the next visits either
|
|
470
473
|
if (prefs.vstyle === 'babble') prefs.vstyle = 'animal', prefs.vstyleChosen = true;
|
|
@@ -475,7 +478,8 @@ if (prefs.vstyle === 'sims' && prefs.vstyleChosen) prefs.vstyle = 'animal';
|
|
|
475
478
|
if (prefs.vstyle !== 'animal' || !prefs.vstyleChosen) prefs.vstyle = 'kokoro';
|
|
476
479
|
if (!prefs.notifyChosen) prefs.notify = true; // “tell me when the agents are done” is on unless the person chose otherwise
|
|
477
480
|
let prefsTimer = null;
|
|
478
|
-
|
|
481
|
+
let shareWas = prefs.shareUsage; // the usage answer as last saved: when it changes, savePrefs dates it, and the server keeps the newest (another page may write older settings)
|
|
482
|
+
const savePrefs = () => { prefs._t = Date.now(); if (prefs.shareUsage !== shareWas) { shareWas = prefs.shareUsage; prefs.shareUsageT = Date.now(); } try { localStorage.setItem('cc.prefs', JSON.stringify(prefs)); } catch {} clearTimeout(prefsTimer); prefsTimer = setTimeout(() => { fetch('/api/prefs', { method: 'PUT', headers: { 'content-type': 'application/json' }, body: JSON.stringify(prefs) }).catch(() => {}); }, 400); };
|
|
479
483
|
// Languages: French and English live in the code as pairs L(french, english); every other language is a catalogue public/locales/<code>.json mapping the English text to its translation.
|
|
480
484
|
// A missing string falls back to English, so a half-translated language still works. See public/locales/README.md to add one.
|
|
481
485
|
const LANGS = [['en', 'English', 'en'], ['fr', 'Français', 'fr'], ['zh-TW', '繁體中文', 'zh-Hant-TW'], ['zh-CN', '简体中文', 'zh-Hans-CN'], ['es', 'Español', 'es'], ['de', 'Deutsch', 'de'], ['da', 'Dansk', 'da'], ['pt-BR', 'Português (Brasil)', 'pt-BR'], ['ja', '日本語', 'ja'], ['ko', '한국어', 'ko']];
|
|
@@ -646,10 +650,15 @@ function renderFolder(el, mine) { // one's own pictures: where they are, a but
|
|
|
646
650
|
el.querySelectorAll('[data-rm]').forEach((b) => (b.onclick = async () => { await post('/api/characters/remove', { file: b.dataset.rm }); await reloadChars(); }));
|
|
647
651
|
$('#charReload').onclick = () => reloadChars(); if ($('#charOpen')) $('#charOpen').onclick = () => window.parent.postMessage({ agentStandup: 'openCharacters' }, '*');
|
|
648
652
|
}
|
|
649
|
-
function packNote() { //
|
|
650
|
-
const d = new Date(),
|
|
651
|
-
const
|
|
652
|
-
|
|
653
|
+
function packNote() { // the Halloween pack, to someone without it, twice a season at most: one line in October (the vampire's before the 19th, to the vampire only; from the 19th, to everyone), one on the 30th or 31st if the first was 5 days before or more. Never on a first day, nor the first day the usage question shows (usagePending); shown, it stays until ✕ or the button, also after a reload that day
|
|
654
|
+
const d = new Date(), m = d.getMonth(), dd = d.getDate(), phase = dd >= 30 ? 2 : 1, seen = +prefs.packSeen || (prefs.vampSeen ? 1 : 0), el = $('#packNote'); if (!el) return; // vampSeen: the vampire's line, closed in 1.33 to 1.38, counts as the first
|
|
655
|
+
const early = dd < 19 && CHARS.youFrom !== 'vampire', open = prefs.packOpen && prefs.packDay === utcDay(), due = !early && seen < phase && !askedToday('pack') && !firstDay() && !(usagePending() && (!prefs.usageDay || prefs.usageDay >= utcDay())) && $('#usageTip').style.display === 'none' && (!prefs.packDay || Date.parse(utcDay()) - Date.parse(prefs.packDay) >= 5 * 864e5);
|
|
656
|
+
const on = m === 9 && (open || due) && !Q.get('demo') && !(SHOP.halloween && SHOP.halloween.n) && !voiceOffer.busy; el.style.display = on ? '' : 'none'; if (!on) return; // busy: the voices are downloading, and their line says so
|
|
657
|
+
if (due && !open) { prefs.packSeen = phase; prefs.packDay = utcDay(); prefs.packOpen = true; savePrefs(); } noteAsk('pack'); $('#vOffer').style.display = 'none'; // one offer at a time: the voices' line comes back when this one is closed
|
|
658
|
+
const price = (SHOP.halloween && SHOP.halloween.price) || '2 €';
|
|
659
|
+
$('#packNoteT').textContent = dd === 31 ? L('Joyeux Halloween ! Vos agents peuvent venir à l’appel déguisés.', 'Happy Halloween! Your agents can come to the call in costume.') : dd === 30 ? L('Halloween, c’est demain : vos agents peuvent venir à l’appel déguisés.', 'Halloween is tomorrow: your agents can come to the call in costume.')
|
|
660
|
+
: dd >= 19 ? L('Halloween approche : déguisez vos agents en citrouille, fantôme, sorcière ou squelette, dessinés à la main par Fabien Coupas.', 'Halloween is coming: dress your agents up as a pumpkin, a ghost, a witch or a skeleton, drawn by hand by Fabien Coupas.') : L('Pour Halloween, vous êtes le vampire. Le reste de l’équipe est dans le pack Halloween.', 'This Halloween, you are the vampire. The rest of the cast is in the Halloween pack.');
|
|
661
|
+
$('#packNoteB').textContent = L('Voir le pack', 'See the pack') + ' · ' + price;
|
|
653
662
|
}
|
|
654
663
|
function persona(a) { const p = persona0(a); p.custom = customFor(a.id); return p; }
|
|
655
664
|
const subName = (a, h) => (a.own && prefs.ownNames ? (nameBook[a.id] = a.own) : a.given || uniqueName(a.id, h)); // own: the name the person gave this agent (see ownName in server.js); otherwise a first name from the list. a.own is tested first: the landing page reuses this section and has no settings
|
|
@@ -1455,12 +1464,15 @@ function camTok() { // the one who shares a screen: what it has used so far, n
|
|
|
1455
1464
|
// file edits are instant, so one that stays pending is almost surely an approval prompt; a Bash command may legitimately run long (⏳ badge instead)
|
|
1456
1465
|
const NEEDS_OK = /^(Edit|Write|MultiEdit|NotebookEdit|AskUserQuestion|ExitPlanMode)/, ASKS = /^(AskUserQuestion|ExitPlanMode)/;
|
|
1457
1466
|
const atTail = () => S.idx >= S.events.length - 3; // only trust wall-clock ages when playback has caught up with the live end
|
|
1467
|
+
function gaveOf(la) { // the turn of the followed session ended on "I couldn't…" or on an error (the server's gave): its first sentence, unless the session moved since that answer
|
|
1468
|
+
const row = S.live && atTail() ? rowOf(S.cur) : null; return row && row.state === 'turn' && row.gave && !(la > S.rowsAt) ? row.gave : '';
|
|
1469
|
+
}
|
|
1458
1470
|
function agentState(id, now) {
|
|
1459
1471
|
let s = S.status[id]; const r = S.run[id], w = S.waitOn[id], la = S.lastAct[id];
|
|
1460
1472
|
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
|
|
1461
1473
|
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
|
|
1462
1474
|
const open = S.live && la && (S.sawEnd ? !S.turnOver && now - la < 180000 : now - la < 25000);
|
|
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)) };
|
|
1475
|
+
if (r || (w && w.size) || open) s = 'working'; else if (S.live && la) { const g = gaveOf(la); return { k: 'done', txt: (g ? '⚠ ' + L('a abandonné ?', 'gave up?') : '✓ ' + L('à vous', 'your turn')) + ' · ' + fmtShort(Math.max(0, now - la)), ...(g ? { gave: g } : {}) }; }
|
|
1464
1476
|
}
|
|
1465
1477
|
if (s === 'done') return { k: 'done', txt: '✓ ' + L('terminé', 'done') };
|
|
1466
1478
|
if (!s) return { k: 'idle', txt: '' };
|
|
@@ -1506,8 +1518,9 @@ function paintStates() {
|
|
|
1506
1518
|
if (p.id === 'user') continue; const t = $('#t-' + p.id); if (!t) continue;
|
|
1507
1519
|
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); }
|
|
1508
1520
|
STATE_CLASSES.forEach((c) => t.classList.toggle(c, st.k === c));
|
|
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' : '');
|
|
1521
|
+
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' : '') + (st.gave ? ' gave' : '');
|
|
1510
1522
|
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"
|
|
1523
|
+
const spot = S.spotted || (S.spotted = new Set()); if (st.k !== 'blocked') spot.delete(p.id); else if (!spot.has(p.id) && shown && !S.gone.has(p.id) && !S.speakers.size && !(S.focusLock > Date.now())) { spot.add(p.id); setFocus(p.id); } // one that waits on you takes the spotlight once per wait, as soon as nobody talks (the speaker has it until then)
|
|
1511
1524
|
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); }
|
|
1512
1525
|
else if (!pr.classList.contains('cheer')) { if (pr.textContent !== want) pr.textContent = want; pr.className = 'prop ' + (want ? st.k : ''); }
|
|
1513
1526
|
if (shown && !S.gone.has(p.id)) ros.push({ p, st });
|
|
@@ -1528,14 +1541,14 @@ function fitBoard(force) { // the chips lose their words when they do not all
|
|
|
1528
1541
|
addEventListener('resize', () => fitBoard(true)); new ResizeObserver(() => requestAnimationFrame(() => fitBoard(true))).observe($('#board')); /* the room the chips have also changes when the texts beside them do (a title, a longer status) */
|
|
1529
1542
|
const RORDER = { blocked: 0, stalled: 1, working: 2, waiting: 3, idle: 4, done: 5 };
|
|
1530
1543
|
const TOOL = { _codex: 'Codex', _vibe: 'Vibe', _cowork: 'Cowork' }, leadTool = (p) => (p.id === 'main' && S.cur && TOOL[S.cur.proj] ? ' · ' + TOOL[S.cur.proj] : ''); // a session that is not a Claude Code one says which tool runs it: on its tab, and next to its lead, who has the same name in every call
|
|
1531
|
-
const modelShort = (m) => { const v = String(m || ''); if (!v || v[0] === '<') return ''; const c = /(opus|sonnet|haiku|fable)[-_ ]?(\d{1,2})(?:[-.](\d{1,2})(?!\d))?(?!\d)/i.exec(v); const o = /claude-(\d)(?:-(\d))?-(opus|sonnet|haiku)/i.exec(v), cap = (w) => w[0].toUpperCase() + w.slice(1).toLowerCase(); if (o) return cap(o[3]) + ' ' + o[1] + (o[2] ? '.' + o[2] : ''); return c ? cap(c[1]) + ' ' + c[2] + (c[3] ? '.' + c[3] : '') : v.replace(/^.*\//, '').replace(/-\d{8}$/, '').slice(0, 24); }; /* older ids put the version first: claude-3-5-sonnet → Sonnet 3.5 */ // claude-haiku-4-5-20251001 → Haiku 4.5
|
|
1544
|
+
const modelShort = (m) => { const v = String(m || ''); if (!v || v[0] === '<') return ''; const c = /(opus|sonnet|haiku|fable)[-_ ]?(\d{1,2})(?:[-.](\d{1,2})(?!\d))?(?!\d)/i.exec(v); const o = /claude-(\d)(?:-(\d))?-(opus|sonnet|haiku)/i.exec(v), cap = (w) => w[0].toUpperCase() + w.slice(1).toLowerCase(); if (o) return cap(o[3]) + ' ' + o[1] + (o[2] ? '.' + o[2] : ''); const g = /^gpt-(\d+(?:\.\d+)?[a-z]?)(?:-(.+))?$/i.exec(v.replace(/^.*\//, '').replace(/-\d{4}-?\d{2}-?\d{2}$/, '')); if (g) return ('GPT-' + g[1].toLowerCase() + (g[2] ? ' ' + g[2].split('-').map((w) => (/^(mini|nano)$/i.test(w) ? w.toLowerCase() : cap(w))).join(' ') : '')).slice(0, 24); /* Codex: gpt-6-pro → GPT-6 Pro, gpt-5.1-codex-max → GPT-5.1 Codex Max, gpt-5-mini → GPT-5 mini */ return c ? cap(c[1]) + ' ' + c[2] + (c[3] ? '.' + c[3] : '') : v.replace(/^.*\//, '').replace(/-\d{8}$/, '').slice(0, 24); }; /* older ids put the version first: claude-3-5-sonnet → Sonnet 3.5 */ // claude-haiku-4-5-20251001 → Haiku 4.5
|
|
1532
1545
|
const mixedModels = () => new Set(Object.keys(S.usage).filter((id) => S.agents[id] && S.model[id] && tokTotal(S.usage[id])).map((id) => modelShort(S.model[id])).filter(Boolean)).size > 1; // only then is the model worth a place next to the count
|
|
1533
1546
|
const modelTip = (id) => (S.model[id] && modelShort(S.model[id]) ? '\n' + L('Modèle', 'Model') + ' · ' + S.model[id] : '');
|
|
1534
1547
|
const rosTok = (id) => { const u = S.usage[id]; return u && tokTotal(u) ? `<span class="rt" title="${esc(tokTip(u) + modelTip(id))}">⚡${fmtTok(tokTotal(u))}${mixedModels() && modelShort(S.model[id]) ? ' · ' + esc(modelShort(S.model[id])) : ''}</span>` : ''; };
|
|
1535
1548
|
function paintRoster(ros) { // a fixed list beside the call: who is doing what, urgent first, readable even with dozens of agents
|
|
1536
1549
|
const box = $('#roster'); if (!box || !document.body.classList.contains('rost')) return;
|
|
1537
1550
|
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)));
|
|
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('');
|
|
1551
|
+
const rows = ros.slice(0, 60).map(({ p, st }) => `<div class="rr k-${st.k}${isTurn(p.id, st) ? ' turn' : ''}${st.gave ? ' gave' : ''}${S.focus === p.id ? ' sel' : ''}${S.speakers.has(p.id) ? ' speaking' : ''}" data-id="${esc(p.id)}" tabindex="0" role="button" aria-label="${esc(p.name)}, ${esc(st.txt || '')}" title="${esc(p.name + ' — ' + p.role + leadTool(p) + (st.txt ? '\n' + st.txt : '') + (S.lastTool[p.id] ? '\n' + S.lastTool[p.id] : ''))}"><div class="n"><span class="dot" style="background:${p.shirt}"></span><b>${esc(p.name)}</b><span class="ro">${esc(p.role + leadTool(p))}</span>${rosTok(p.id)}</div><div class="st">${esc(st.txt || L('en veille', 'standing by'))}${S.loops[p.id] ? ' 🔁' : ''}${S.wst.items && S.wst.items[p.id] && S.wst.items[p.id].length ? ' ♻' + S.wst.items[p.id].length : ''}</div></div>`).join('');
|
|
1539
1552
|
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
|
|
1540
1553
|
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('');
|
|
1541
1554
|
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}` : ''}`;
|
|
@@ -2080,9 +2093,9 @@ $('#mCoffee').onclick = () => { $('#menu').classList.remove('on'); openExternal(
|
|
|
2080
2093
|
$('#mRate').onclick = () => { $('#menu').classList.remove('on'); rateGo(); };
|
|
2081
2094
|
function rateGo() { rateEnd(); if (EMBED && APP.kind === 'editor') window.parent.postMessage({ agentStandup: 'rate' }, '*'); else openExternal(APP.rate); }
|
|
2082
2095
|
const rateEnd = () => { prefs.rateDone = utcDay(); savePrefs(); $('#rateTip').style.display = 'none'; };
|
|
2083
|
-
const RATE_ASKS = (APP.kind === 'desktop' || APP.kind === 'cli') && !EMBED && !Q.get('demo'), utcDay = () => new Date().toISOString().slice(0, 10);
|
|
2096
|
+
const RATE_ASKS = (APP.kind === 'desktop' || APP.kind === 'cli' || APP.kind === 'plugin') && !EMBED && !Q.get('demo'), utcDay = () => new Date().toISOString().slice(0, 10);
|
|
2084
2097
|
// 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
|
|
2098
|
+
// The real voices are not an ask but an offer of the app itself: they keep their line until answered, and step aside on the few days the Halloween pack's line shows (not while they download).
|
|
2086
2099
|
const firstDay = () => !prefs.firstDay || prefs.firstDay >= utcDay(), askedToday = (k) => prefs.askDay === utcDay() && prefs.askWhat !== k;
|
|
2087
2100
|
const noteAsk = (k) => { if (prefs.askDay !== utcDay() || prefs.askWhat !== k) { prefs.askDay = utcDay(); prefs.askWhat = k; savePrefs(); } };
|
|
2088
2101
|
function rateDay() { // a day of use: the page in view that day
|
|
@@ -2091,7 +2104,7 @@ function rateDay() { // a day of use: the page in view that day
|
|
|
2091
2104
|
rateTip();
|
|
2092
2105
|
}
|
|
2093
2106
|
function rateTip() {
|
|
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; }
|
|
2107
|
+
const t = $('#rateTip'); if (!RATE_ASKS || prefs.rateDone || firstDay() || askedToday('rate') || (+prefs.rateDays || 0) < 3 || (prefs.rateLater && utcDay() < prefs.rateLater) || $('#menuTip').style.display !== 'none' || $('#usageTip').style.display !== 'none' || $('#menu').classList.contains('on')) { t.style.display = 'none'; return; }
|
|
2095
2108
|
const r = $('#bMenu').getBoundingClientRect(); if (!r.width) return;
|
|
2096
2109
|
$('#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.');
|
|
2097
2110
|
$('#rateYes').textContent = L('⭐ Mettre une étoile', '⭐ Star it'); $('#rateLater').textContent = L('Plus tard', 'Later'); $('#rateNo').textContent = L('Non merci', 'No thanks');
|
|
@@ -2107,7 +2120,7 @@ function coffeeAsk(busyAt) {
|
|
|
2107
2120
|
if (!SUPPORT.url || prefs.coffeeAsked || Q.get('demo') || firstDay() || askedToday('coffee') || !prefs.useFirst || prefs.useFirst >= utcDay() || document.hidden) return;
|
|
2108
2121
|
const now = Date.now(), team = Object.keys(S.agents).filter((id) => id !== 'main' && id !== 'user' && S.lastAct[id] >= busyAt).length;
|
|
2109
2122
|
if (!(now - busyAt >= 10 * 60e3 || (team >= 3 && now - busyAt >= 2 * 60e3))) return;
|
|
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 */
|
|
2123
|
+
if ($('#rateTip').style.display !== 'none' || $('#usageTip').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 */
|
|
2111
2124
|
clearTimeout(coffeeAsk.t); coffeeAsk.t = setTimeout(() => { if (prefs.coffeeAsked || document.hidden || $('#menu').classList.contains('on') || $('#menuTip').style.display !== 'none' || $('#rateTip').style.display !== 'none' || agentState('main', Date.now()).k !== 'done') return; coffeeTip(); }, 8000); /* after the confetti and the lead's last word */
|
|
2112
2125
|
}
|
|
2113
2126
|
function coffeeTip() {
|
|
@@ -2120,6 +2133,29 @@ function coffeeTip() {
|
|
|
2120
2133
|
}
|
|
2121
2134
|
$('#coffeeYes').onclick = () => { $('#coffeeTip').style.display = 'none'; openExternal(SUPPORT.url); }; $('#coffeeNo').onclick = () => ($('#coffeeTip').style.display = 'none');
|
|
2122
2135
|
document.addEventListener('visibilitychange', coffeeDay); setInterval(coffeeDay, 3600e3);
|
|
2136
|
+
// Usage, asked once in the desktop app, the command line and the Claude Code plugin (the editor asks in its own way: extension.js, askUsage): would they help count how many people use
|
|
2137
|
+
// it? "Count me in" turns prefs.shareUsage on; then, each time the call is opened, the server sends at most one empty request a week (server.js, usageWeek). Any other answer leaves it
|
|
2138
|
+
// off and it is not asked again; ⚙ › All settings turns it on or off. Never asked, and nothing sent, with DO_NOT_TRACK set (APP.track), in a demo or embedded.
|
|
2139
|
+
const USAGE_ASKS = ['desktop', 'cli', 'plugin'].includes(APP.kind) && APP.track !== false && !EMBED && !Q.get('demo');
|
|
2140
|
+
function usageOpened(fresh) { if (USAGE_ASKS && prefs.shareUsage === true && !document.hidden) (fresh ? fetch('/api/prefs', { method: 'PUT', headers: { 'content-type': 'application/json' }, body: JSON.stringify(prefs) }) : Promise.resolve()).then(() => fetch('/api/usage', { method: 'POST' })).catch(() => {}); } /* the server sends it once a week at most, and only once the settings file says yes: fresh, just answered, writes it there first (savePrefs waits 400 ms) */
|
|
2141
|
+
function usagePending() { return USAGE_ASKS && !prefs.usageAsked && prefs.shareUsage !== true; } // the usage question, not answered yet: it has its first day to itself, then takes turns with the Halloween pack's line
|
|
2142
|
+
function usageStart() {
|
|
2143
|
+
if (!USAGE_ASKS) return; $('#mShare').style.display = ''; usageOpened();
|
|
2144
|
+
if (prefs.usageAsked || prefs.shareUsage === true) return; clearTimeout(usageStart.t); usageStart.t = setTimeout(usageTip, 2500);
|
|
2145
|
+
}
|
|
2146
|
+
function usageTip() {
|
|
2147
|
+
const t = $('#usageTip'); if (!USAGE_ASKS || prefs.usageAsked || prefs.shareUsage === true || firstDay() || document.hidden || $('#menu').classList.contains('on')) { t.style.display = 'none'; return; } /* firstDay: like every ask, not the first day the app is used */
|
|
2148
|
+
if ($('#menuTip').style.display !== 'none') { usageStart.t = setTimeout(usageTip, 4000); return; } /* after the tip about the moved menu */
|
|
2149
|
+
if (prefs.askDay === utcDay() && prefs.askWhat === 'pack') { t.style.display = 'none'; return; } /* the Halloween pack's day: one ask at a time, this one comes back on the next */
|
|
2150
|
+
const r = $('#bMenu').getBoundingClientRect(); if (!r.width) return;
|
|
2151
|
+
$('#rateTip').style.display = 'none'; $('#coffeeTip').style.display = 'none'; noteAsk('usage'); if (!prefs.usageDay) { prefs.usageDay = utcDay(); savePrefs(); }
|
|
2152
|
+
$('#usageTipT').textContent = L('Aider à compter combien de personnes utilisent Agent Standup ? Quand vous ouvrez l’appel, au plus une fois par semaine, l’app chargerait un fichier vide d’un pixel sur GitHub : aucun identifiant, rien sur vous ni sur vos sessions. GitHub voit votre adresse IP, comme pour tout téléchargement. Vous pouvez l’arrêter quand vous voulez dans ⚙ › Tous les réglages.', 'Help count how many people use Agent Standup? When you open the call, at most once a week, the app would load an empty 1-pixel file from GitHub: no identifier, nothing about you or your sessions. GitHub sees your IP address, as with any download. You can turn it off any time in ⚙ › All settings.');
|
|
2153
|
+
$('#usageYes').textContent = L('Je participe', 'Count me in'); $('#usageNo').textContent = L('Non merci', 'No thanks'); $('#usageRead').textContent = L('Confidentialité', 'Privacy policy');
|
|
2154
|
+
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');
|
|
2155
|
+
}
|
|
2156
|
+
const usageAnswer = (yes) => { prefs.shareUsage = yes; prefs.usageAsked = true; savePrefs(); $('#usageTip').style.display = 'none'; syncSwitches(); document.querySelectorAll('.mi[data-t="shareUsage"] .sw').forEach((x) => x.classList.toggle('on', yes)); if (yes) usageOpened(true); };
|
|
2157
|
+
$('#usageYes').onclick = () => usageAnswer(true); $('#usageNo').onclick = () => usageAnswer(false); $('#usageRead').onclick = () => openExternal('https://agent-standup.com/privacy/');
|
|
2158
|
+
document.addEventListener('visibilitychange', () => { if (!document.hidden) { usageOpened(); if (USAGE_ASKS && !prefs.usageAsked && prefs.shareUsage !== true && $('#usageTip').style.display === 'none') usageStart(); } });
|
|
2123
2159
|
|
|
2124
2160
|
// =====================================================================
|
|
2125
2161
|
// recap
|
|
@@ -2650,12 +2686,12 @@ let boardBusy = false, boardAll = null, boardDoneOpen = false, boardIdleOpen = f
|
|
|
2650
2686
|
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
|
|
2651
2687
|
const isDone = (r) => !!r.done; // put away by you, until the session moves again: the server says so, to every window
|
|
2652
2688
|
function bcard(r, now, done) {
|
|
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
|
|
2689
|
+
const g = r.state === 'turn' && r.gave ? r.gave : '', [ic, en0, fr0] = g ? ['⚠', 'gave up?', 'a abandonné ?'] : 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
|
|
2654
2690
|
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 : '';
|
|
2655
2691
|
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
|
|
2656
2692
|
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>` : '';
|
|
2657
2693
|
const put = done ? `<button class="bdo" data-undo="1" title="${esc(L('Rouvrir', 'Reopen'))}" aria-label="${esc(L('Rouvrir', 'Reopen'))}">↩</button>` : r.state === 'turn' || r.state === 'idle' ? `<button class="bdo" title="${esc(L('Marquer comme traitée', 'Mark as done'))}" aria-label="${esc(L('Marquer comme traitée', 'Mark as done'))}">✓</button>` : '';
|
|
2658
|
-
return `<div class="bcard ${r.state}" tabindex="0" role="button" data-p="${esc(r.proj)}" data-i="${esc(r.id)}"><div class="bh"><span class="stc ${r.state}">${ic} ${L(fr, en)}${extra}</span>${pr}${put}</div><div class="bt">${esc(/^[0-9a-f]{8}-[0-9a-f-]{27}$/.test(r.title) ? L('Session sans titre', 'Untitled session') : r.title)}</div>${r.ask ? `<div class="bq">${esc(r.ask)}</div>` : ''}<div class="bp">${esc(niceProj(r.proj))}</div>${took ? `<div class="bm">${took}</div>` : ''}${r.subTotal ? `<div class="bm">👥 ${r.subActive}/${r.subTotal} ${L('sous-agents actifs', 'sub-agents active')}</div>` : ''}</div>`;
|
|
2694
|
+
return `<div class="bcard ${r.state}${g ? ' gave' : ''}" tabindex="0" role="button" data-p="${esc(r.proj)}" data-i="${esc(r.id)}"><div class="bh"><span class="stc ${g ? 'stalled' : r.state}">${ic} ${L(fr, en)}${extra}</span>${pr}${put}</div><div class="bt">${esc(/^[0-9a-f]{8}-[0-9a-f-]{27}$/.test(r.title) ? L('Session sans titre', 'Untitled session') : r.title)}</div>${r.ask || g ? `<div class="bq">${esc(r.ask || g)}</div>` : ''}<div class="bp">${esc(niceProj(r.proj))}</div>${took ? `<div class="bm">${took}</div>` : ''}${r.subTotal ? `<div class="bm">👥 ${r.subActive}/${r.subTotal} ${L('sous-agents actifs', 'sub-agents active')}</div>` : ''}</div>`;
|
|
2659
2695
|
}
|
|
2660
2696
|
function paintBoard() {
|
|
2661
2697
|
if (!boardAll || !document.body.classList.contains('board')) return; const now = Date.now(), recent = (a, b) => b.mtime - a.mtime;
|
|
@@ -2723,8 +2759,8 @@ function paintTabs() {
|
|
|
2723
2759
|
for (const k of by.keys()) if (!S.tabOrder.includes(k)) S.tabOrder.push(k); // a session keeps its place while it has no tab: the call now goes by itself to a session that is started, sometimes before the list has the one it leaves, which then came back second
|
|
2724
2760
|
const ks = S.tabOrder.filter((k) => by.has(k)).slice(0, 8); if (!ks.includes(ck)) ks[ks.length - 1] = ck; // the others are in ⋯
|
|
2725
2761
|
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
|
|
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') : '');
|
|
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('')
|
|
2762
|
+
const pinned = on && !!S.pick && !!S.pick.pin && sessKey(S.pick) === k, tip = tabName(r) + '\n' + niceProj(r.proj) + (r.state === 'turn' && r.gave ? ' · ⚠ ' + L('a abandonné ?', 'gave up?') + '\n' + r.gave : st ? ' · ' + L(st[2], st[1]) : '') + (pinned ? '\n' + L('Épinglé : cliquez pour désépingler', 'Pinned: click to unpin') : '');
|
|
2763
|
+
return `<button class="stab ${r.state}${r.state === 'turn' && r.gave ? ' gave' : ''}${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('')
|
|
2728
2764
|
+ `<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());
|
|
2729
2765
|
if (html === paintTabs.html) return; if (!html) paintTabs.cur = ''; el.innerHTML = paintTabs.html = html;
|
|
2730
2766
|
if (paintTabs.cur !== ck) { paintTabs.cur = ck; const on = el.querySelector('.on'); if (on) on.scrollIntoView({ block: 'nearest', inline: 'nearest' }); }
|
|
@@ -2890,7 +2926,7 @@ async function exportVideo(from = 0, to = 0, clip = 0) { // clip: length in ms
|
|
|
2890
2926
|
// UI wiring
|
|
2891
2927
|
// =====================================================================
|
|
2892
2928
|
function applyLang() {
|
|
2893
|
-
renderCharInfo(); packNote(); menuTip(); rateDay(); coffeeDay();
|
|
2929
|
+
renderCharInfo(); packNote(); menuTip(); rateDay(); coffeeDay(); usageStart();
|
|
2894
2930
|
try { for (const id in S.act) { const b = S.term[id], t = b && b[b.length - 1]; if (t && t.tool) S.act[id] = activityLabel(t.tool); } if (S.live) fillProjects(); } catch {} // what each agent is doing, and the list of projects, were written in the language before
|
|
2895
2931
|
document.documentElement.lang = (LANGS.find((l) => l[0] === prefs.lang) || LANGS[0])[2];
|
|
2896
2932
|
document.querySelectorAll('[data-fr]').forEach((el) => (el.textContent = FR() ? el.dataset.fr : tr(el.dataset.en)));
|
|
@@ -2931,8 +2967,9 @@ setInterval(() => {
|
|
|
2931
2967
|
}, 5000);
|
|
2932
2968
|
async function reloadChars() { await loadChars(); for (const k in imgCache) delete imgCache[k]; for (const id in S.agents) S.agents[id].custom = null; for (const id in S.agents) S.agents[id].custom = customFor(id); buildStage(); paintStatus(); packNote(); await renderCharInfo(); }
|
|
2933
2969
|
$('#charPick').onclick = () => { $('#menu').classList.remove('on'); CHPICK.more = ''; openChars(); };
|
|
2934
|
-
|
|
2935
|
-
$('#
|
|
2970
|
+
const packShut = () => { prefs.packOpen = false; savePrefs(); packNote(); voiceOffer(); };
|
|
2971
|
+
$('#packNoteB').onclick = $('#packNoteI').onclick = () => { packShut(); CHPICK.more = 'halloween'; openChars(); };
|
|
2972
|
+
$('#packNoteX').onclick = packShut;
|
|
2936
2973
|
$('#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
|
|
2937
2974
|
// ⚙ menu: sections that fold (remembered) and a search box
|
|
2938
2975
|
function menuInit() {
|
|
@@ -2952,7 +2989,7 @@ function menuInit() {
|
|
|
2952
2989
|
$('#menuNone').style.display = q && !far.length && !secs.some((sc) => sc.items.some((e) => !e.classList.contains('mhide'))) ? '' : 'none';
|
|
2953
2990
|
};
|
|
2954
2991
|
}
|
|
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(); }
|
|
2992
|
+
const onSwitch = (e) => { const b = e.target.closest('.mi[data-t]'); if (!b) return; prefs[b.dataset.t] = !prefs[b.dataset.t]; savePrefs(); if (prefs[b.dataset.t] && ['voice', 'office', 'music', 'notify'].includes(b.dataset.t)) claimAudio(); b.querySelector('.sw').classList.toggle('on', prefs[b.dataset.t]); AUD.apply(); if (b.dataset.t === 'shareUsage') { prefs.usageAsked = true; savePrefs(); usageOpened(true); } if (b.dataset.t === 'office') $('#officeBox').style.display = prefs.office ? '' : 'none'; if (b.dataset.t === 'callTr') { prefs.callTrSeen = true; savePrefs(); setLang(prefs.lang); } if (b.dataset.t === 'voice') voiceOffer(); 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
2993
|
if (b.dataset.t === 'askCard') paintAsk(Date.now());
|
|
2957
2994
|
if (b.dataset.t === 'music') { $('#musicBox').style.display = prefs.music ? '' : 'none'; if (prefs.music) { AUD.init(); AUD.apply(); } } };
|
|
2958
2995
|
$('#menu').onclick = onSwitch; $('#prefs').onclick = (e) => { if (e.target === $('#prefs')) return closePrefs(); onSwitch(e); setTimeout(syncSwitches); };
|
|
@@ -3006,16 +3043,16 @@ kokoroUI();
|
|
|
3006
3043
|
// 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.
|
|
3007
3044
|
let offerTimer = null;
|
|
3008
3045
|
async function voiceOffer() {
|
|
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
|
|
3046
|
+
const el = $('#vOffer'), hide = () => { voiceOffer.busy = false; 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, kept back while the voices download, can show now
|
|
3010
3047
|
if (!prefs.voice || prefs.voiceOffer === 'no' || Q.get('demo')) return hide();
|
|
3011
3048
|
let st; try { st = await (await fetch('/api/kokoro')).json(); } catch { return; }
|
|
3012
3049
|
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)
|
|
3013
3050
|
if (st.ready && prefs.voiceOffer === 'want' && !st.installing && !add) { prefs.voiceOffer = 'no'; prefs.vstyle = 'kokoro'; prefs.vstyleChosen = true; savePrefs(); $('#vstyle').value = 'kokoro'; hide(); await TTS.init(); kokoroUI(); toast(L('Voix prêtes.', 'Voices ready.')); return; }
|
|
3014
|
-
const busy = st.installing || (st.installed && !st.ready && !st.gaveUp && prefs.voiceOffer === 'want');
|
|
3051
|
+
const busy = voiceOffer.busy = st.installing || (st.installed && !st.ready && !st.gaveUp && prefs.voiceOffer === 'want');
|
|
3015
3052
|
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
|
|
3016
3053
|
if ((st.installed && !busy && !add) || !st.npm) return hide(); // they have them; or cannot have them (no npm), which ⚙ explains
|
|
3017
3054
|
$('#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.'));
|
|
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';
|
|
3055
|
+
$('#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)`); if (!busy && $('#packNote').style.display !== 'none') { el.style.display = 'none'; return; } el.style.display = ''; if ($('#packNote').style.display !== 'none') $('#packNote').style.display = 'none'; /* the pack's line, shown a few days a year, goes first; a download in progress goes before it */
|
|
3019
3056
|
if (busy && !offerTimer) offerTimer = setInterval(voiceOffer, 2500); if (!busy && offerTimer) { clearInterval(offerTimer); offerTimer = null; }
|
|
3020
3057
|
}
|
|
3021
3058
|
$('#vOfferB').onclick = async () => { prefs.voiceOffer = 'want'; savePrefs(); try { await fetch('/api/kokoro/install', { method: 'POST' }); } catch {} voiceOffer(); kokoroUI(); };
|
|
@@ -3111,7 +3148,7 @@ function paintPill() {
|
|
|
3111
3148
|
const w = by.working, wt = lead.k === 'waiting' ? 'main' : w.length ? '' : by.waiting[0]; cls = 'working'; to = wt || (w.length === 1 ? w[0] : 'main');
|
|
3112
3149
|
txt = (w.length === 1 && !wt ? '⚙ ' + what(w[0]) : w.length ? `⚙ ${w.length} ${L('au travail', 'working')}` : '') + (wt ? (w.length ? ' · ' : '🔗 ') + what(wt) : '');
|
|
3113
3150
|
}
|
|
3114
|
-
else if (isTurn('main', lead)) { const last = lastWord(); cls = 'turn'; to = 'main'; txt = '👉 ' + L('à vous', 'your turn') + (last ? ' · ' + (last.length > 110 ? last.slice(0, 108).replace(/\s+\S*$/, '') + '…' : last) : ''); tip = last; }
|
|
3151
|
+
else if (isTurn('main', lead)) { const g = lead.gave, last = g || lastWord(); cls = g ? 'stalled' : 'turn'; to = 'main'; txt = (g ? '⚠ ' + L('a abandonné ?', 'gave up?') : '👉 ' + L('à vous', 'your turn')) + (last ? ' · ' + (last.length > 110 ? last.slice(0, 108).replace(/\s+\S*$/, '') + '…' : last) : ''); tip = last; } // gave: what it says it could not do, in its own first sentence
|
|
3115
3152
|
else { cls = 'idle'; to = 'main'; txt = '💤 ' + L('inactif', 'idle'); }
|
|
3116
3153
|
}
|
|
3117
3154
|
const c = cls + (to ? ' go' : ''), sub = !sess && S.cur && S.title ? ' · ' + S.title : '';
|
|
@@ -3136,7 +3173,7 @@ for (const q of ['#gate', '#empty']) new MutationObserver(focusDoor).observe($(q
|
|
|
3136
3173
|
function syncSwitches() { document.querySelectorAll('#menu .mi[data-t], #prefs .mi[data-t]').forEach((b) => { b.setAttribute('role', 'switch'); b.setAttribute('aria-checked', String(!!prefs[b.dataset.t])); }); }
|
|
3137
3174
|
new MutationObserver(() => { // the menu opens under the header and the status line, not over them
|
|
3138
3175
|
const m = $('#menu'), on = m.classList.contains('on'), h = Math.round($('main').getBoundingClientRect().top); $('#bMenu').setAttribute('aria-expanded', String(on)); if (!on) return;
|
|
3139
|
-
syncSwitches(); menuTipDone(); $('#rateTip').style.display = 'none'; $('#coffeeTip').style.display = 'none'; if (!$('#menuShop').innerHTML) renderMenuShop(); m.style.top = h + 3 + 'px'; m.style.maxHeight = `calc(100dvh - ${h + 13}px)`;
|
|
3176
|
+
syncSwitches(); menuTipDone(); $('#rateTip').style.display = 'none'; $('#coffeeTip').style.display = 'none'; $('#usageTip').style.display = 'none'; if (!$('#menuShop').innerHTML) renderMenuShop(); m.style.top = h + 3 + 'px'; m.style.maxHeight = `calc(100dvh - ${h + 13}px)`;
|
|
3140
3177
|
}).observe($('#menu'), { attributes: true, attributeFilter: ['class'] });
|
|
3141
3178
|
$('#menu').addEventListener('click', () => setTimeout(syncSwitches)); $('#bMenu').setAttribute('aria-expanded', 'false'); syncSwitches();
|
|
3142
3179
|
addEventListener('keydown', (e) => { // on the way down: Escape also works from the search box and the selects of the menu, which the shortcuts below ignore
|
package/public/locales/da.json
CHANGED
|
@@ -269,6 +269,7 @@
|
|
|
269
269
|
"characters": "figurer",
|
|
270
270
|
"Choose a picture": "Vælg et billede",
|
|
271
271
|
"Free, from the Halloween pack": "Gratis, fra Halloween-pakken",
|
|
272
|
+
"gave up?": "gav op?",
|
|
272
273
|
"Hand-drawn, each in its own room": "Håndtegnede, hver i sit eget rum",
|
|
273
274
|
"Like the cast": "Som resten af holdet",
|
|
274
275
|
"No picture yet.": "Ingen billeder endnu.",
|
|
@@ -373,5 +374,12 @@
|
|
|
373
374
|
"waits for your answer or approval (with “?”: probably, from how long it has waited)": "venter på dit svar eller din godkendelse (med “?”: sandsynligvis, ud fra hvor længe den har ventet)",
|
|
374
375
|
"where the work is": "hvor arbejdet foregår",
|
|
375
376
|
"where you last typed": "hvor du sidst skrev",
|
|
376
|
-
"you went there": "du gik derhen"
|
|
377
|
+
"you went there": "du gik derhen",
|
|
378
|
+
"Help count how many people use Agent Standup? When you open the call, at most once a week, the app would load an empty 1-pixel file from GitHub: no identifier, nothing about you or your sessions. GitHub sees your IP address, as with any download. You can turn it off any time in ⚙ › All settings.": "Vil du hjælpe med at tælle, hvor mange der bruger Agent Standup? Når du åbner opkaldet, højst én gang om ugen, henter appen en tom fil på 1 pixel fra GitHub: ingen identifikator, intet om dig eller dine sessioner. GitHub ser din IP-adresse, som ved enhver download. Du kan slå det fra når som helst under ⚙ › Alle indstillinger.",
|
|
379
|
+
"Count me in": "Tæl mig med",
|
|
380
|
+
"Privacy policy": "Privatlivspolitik",
|
|
381
|
+
"Help count users (1 request a week)": "Hjælp med at tælle brugere (1 forespørgsel om ugen)",
|
|
382
|
+
"Halloween is coming: dress your agents up as a pumpkin, a ghost, a witch or a skeleton, drawn by hand by Fabien Coupas.": "Halloween nærmer sig: klæd dine agenter ud som græskar, spøgelse, heks eller skelet, tegnet i hånden af Fabien Coupas.",
|
|
383
|
+
"Happy Halloween! Your agents can come to the call in costume.": "Glædelig Halloween! Dine agenter kan komme til opkaldet i kostume.",
|
|
384
|
+
"Halloween is tomorrow: your agents can come to the call in costume.": "Det er Halloween i morgen: dine agenter kan komme til opkaldet i kostume."
|
|
377
385
|
}
|
package/public/locales/de.json
CHANGED
|
@@ -270,6 +270,7 @@
|
|
|
270
270
|
"characters": "Figuren",
|
|
271
271
|
"Choose a picture": "Bild auswählen",
|
|
272
272
|
"Free, from the Halloween pack": "Gratis, aus dem Halloween-Pack",
|
|
273
|
+
"gave up?": "aufgegeben?",
|
|
273
274
|
"Hand-drawn, each in its own room": "Handgezeichnet, jede in ihrem eigenen Raum",
|
|
274
275
|
"Like the cast": "Wie das restliche Team",
|
|
275
276
|
"No picture yet.": "Noch kein Bild.",
|
|
@@ -374,5 +375,12 @@
|
|
|
374
375
|
"waits for your answer or approval (with “?”: probably, from how long it has waited)": "wartet auf deine Antwort oder Freigabe (mit „?“: wahrscheinlich, nach der Wartezeit)",
|
|
375
376
|
"where the work is": "wo gearbeitet wird",
|
|
376
377
|
"where you last typed": "wo du zuletzt geschrieben hast",
|
|
377
|
-
"you went there": "du bist dorthin gegangen"
|
|
378
|
+
"you went there": "du bist dorthin gegangen",
|
|
379
|
+
"Help count how many people use Agent Standup? When you open the call, at most once a week, the app would load an empty 1-pixel file from GitHub: no identifier, nothing about you or your sessions. GitHub sees your IP address, as with any download. You can turn it off any time in ⚙ › All settings.": "Hilfst du zu zählen, wie viele Leute Agent Standup nutzen? Wenn du den Anruf öffnest, höchstens einmal pro Woche, würde die App eine leere 1-Pixel-Datei von GitHub laden: keine Kennung, nichts über dich oder deine Sitzungen. GitHub sieht deine IP-Adresse, wie bei jedem Download. Du kannst es jederzeit unter ⚙ › Alle Einstellungen ausschalten.",
|
|
380
|
+
"Count me in": "Ich mache mit",
|
|
381
|
+
"Privacy policy": "Datenschutzerklärung",
|
|
382
|
+
"Help count users (1 request a week)": "Beim Zählen der Nutzer helfen (1 Anfrage pro Woche)",
|
|
383
|
+
"Halloween is coming: dress your agents up as a pumpkin, a ghost, a witch or a skeleton, drawn by hand by Fabien Coupas.": "Halloween steht vor der Tür: Verkleide deine Agenten als Kürbis, Geist, Hexe oder Skelett, von Hand gezeichnet von Fabien Coupas.",
|
|
384
|
+
"Happy Halloween! Your agents can come to the call in costume.": "Fröhliches Halloween! Deine Agenten können verkleidet zum Call kommen.",
|
|
385
|
+
"Halloween is tomorrow: your agents can come to the call in costume.": "Morgen ist Halloween: Deine Agenten können verkleidet zum Call kommen."
|
|
378
386
|
}
|
package/public/locales/en.json
CHANGED
|
@@ -78,6 +78,7 @@
|
|
|
78
78
|
"Copy as Markdown": "Copy as Markdown",
|
|
79
79
|
"Copy failed": "Copy failed",
|
|
80
80
|
"Could not open the folder": "Could not open the folder",
|
|
81
|
+
"Count me in": "Count me in",
|
|
81
82
|
"Demo": "Demo",
|
|
82
83
|
"Demo — a team fixes a slow login": "Demo — a team fixes a slow login",
|
|
83
84
|
"Display": "Display",
|
|
@@ -114,6 +115,7 @@
|
|
|
114
115
|
"Following: ": "Following: ",
|
|
115
116
|
"For the best experience, pick the natural voices.": "For the best experience, pick the natural voices.",
|
|
116
117
|
"Free, from the Halloween pack": "Free, from the Halloween pack",
|
|
118
|
+
"gave up?": "gave up?",
|
|
117
119
|
"Go there": "Go there",
|
|
118
120
|
"Go to a session": "Go to a session",
|
|
119
121
|
"Go to what needs you (here or in another session)": "Go to what needs you (here or in another session)",
|
|
@@ -121,11 +123,16 @@
|
|
|
121
123
|
"Good-quality local voices, in English. Free, nothing leaves your machine.": "Good-quality local voices, in English. Free, nothing leaves your machine.",
|
|
122
124
|
"Good-quality local voices, in this language and in English. Free, nothing leaves your machine.": "Good-quality local voices, in this language and in English. Free, nothing leaves your machine.",
|
|
123
125
|
"Got it": "Got it",
|
|
126
|
+
"Halloween is coming: dress your agents up as a pumpkin, a ghost, a witch or a skeleton, drawn by hand by Fabien Coupas.": "Halloween is coming: dress your agents up as a pumpkin, a ghost, a witch or a skeleton, drawn by hand by Fabien Coupas.",
|
|
127
|
+
"Halloween is tomorrow: your agents can come to the call in costume.": "Halloween is tomorrow: your agents can come to the call in costume.",
|
|
124
128
|
"Halloween pack": "Halloween pack",
|
|
125
129
|
"Hand-drawn Halloween characters, each in its own room.": "Hand-drawn Halloween characters, each in its own room.",
|
|
126
130
|
"Hand-drawn, each in its own room": "Hand-drawn, each in its own room",
|
|
131
|
+
"Happy Halloween! Your agents can come to the call in costume.": "Happy Halloween! Your agents can come to the call in costume.",
|
|
127
132
|
"has a question for you": "has a question for you",
|
|
128
133
|
"has several questions for you": "has several questions for you",
|
|
134
|
+
"Help count how many people use Agent Standup? When you open the call, at most once a week, the app would load an empty 1-pixel file from GitHub: no identifier, nothing about you or your sessions. GitHub sees your IP address, as with any download. You can turn it off any time in ⚙ › All settings.": "Help count how many people use Agent Standup? When you open the call, at most once a week, the app would load an empty 1-pixel file from GitHub: no identifier, nothing about you or your sessions. GitHub sees your IP address, as with any download. You can turn it off any time in ⚙ › All settings.",
|
|
135
|
+
"Help count users (1 request a week)": "Help count users (1 request a week)",
|
|
129
136
|
"Hide code & file names in videos": "Hide code & file names in videos",
|
|
130
137
|
"Hide until the next question": "Hide until the next question",
|
|
131
138
|
"Highlights": "Highlights",
|
|
@@ -217,6 +224,7 @@
|
|
|
217
224
|
"pick one": "pick one",
|
|
218
225
|
"pinned by you": "pinned by you",
|
|
219
226
|
"Pinned: click to unpin": "Pinned: click to unpin",
|
|
227
|
+
"Privacy policy": "Privacy policy",
|
|
220
228
|
"Project to follow": "Project to follow",
|
|
221
229
|
"Prompt from": "Prompt from",
|
|
222
230
|
"proposes this plan": "proposes this plan",
|
package/public/locales/es.json
CHANGED
|
@@ -270,6 +270,7 @@
|
|
|
270
270
|
"characters": "personajes",
|
|
271
271
|
"Choose a picture": "Elegir una imagen",
|
|
272
272
|
"Free, from the Halloween pack": "Gratis, del pack de Halloween",
|
|
273
|
+
"gave up?": "¿se rindió?",
|
|
273
274
|
"Hand-drawn, each in its own room": "Dibujados a mano, cada uno en su habitación",
|
|
274
275
|
"Like the cast": "Como el resto del equipo",
|
|
275
276
|
"No picture yet.": "Todavía no hay imágenes.",
|
|
@@ -374,5 +375,12 @@
|
|
|
374
375
|
"waits for your answer or approval (with “?”: probably, from how long it has waited)": "espera tu respuesta o tu aprobación (con “?”: probablemente, por el tiempo que lleva esperando)",
|
|
375
376
|
"where the work is": "donde se trabaja",
|
|
376
377
|
"where you last typed": "donde escribiste por última vez",
|
|
377
|
-
"you went there": "fuiste allí"
|
|
378
|
+
"you went there": "fuiste allí",
|
|
379
|
+
"Help count how many people use Agent Standup? When you open the call, at most once a week, the app would load an empty 1-pixel file from GitHub: no identifier, nothing about you or your sessions. GitHub sees your IP address, as with any download. You can turn it off any time in ⚙ › All settings.": "¿Nos ayudas a contar cuántas personas usan Agent Standup? Cuando abres la llamada, como mucho una vez por semana, la app cargaría un archivo vacío de 1 píxel desde GitHub: ningún identificador, nada sobre ti ni sobre tus sesiones. GitHub ve tu dirección IP, como en cualquier descarga. Puedes desactivarlo cuando quieras en ⚙ › Todos los ajustes.",
|
|
380
|
+
"Count me in": "Cuenta conmigo",
|
|
381
|
+
"Privacy policy": "Política de privacidad",
|
|
382
|
+
"Help count users (1 request a week)": "Ayudar a contar usuarios (1 petición por semana)",
|
|
383
|
+
"Halloween is coming: dress your agents up as a pumpkin, a ghost, a witch or a skeleton, drawn by hand by Fabien Coupas.": "Se acerca Halloween: disfraza a tus agentes de calabaza, fantasma, bruja o esqueleto, dibujados a mano por Fabien Coupas.",
|
|
384
|
+
"Happy Halloween! Your agents can come to the call in costume.": "¡Feliz Halloween! Tus agentes pueden venir disfrazados a la llamada.",
|
|
385
|
+
"Halloween is tomorrow: your agents can come to the call in costume.": "Mañana es Halloween: tus agentes pueden venir disfrazados a la llamada."
|
|
378
386
|
}
|
package/public/locales/ja.json
CHANGED
|
@@ -270,6 +270,7 @@
|
|
|
270
270
|
"characters": "キャラクター",
|
|
271
271
|
"Choose a picture": "画像を選ぶ",
|
|
272
272
|
"Free, from the Halloween pack": "無料、ハロウィンパックから",
|
|
273
|
+
"gave up?": "断念した?",
|
|
273
274
|
"Hand-drawn, each in its own room": "手描き、それぞれ専用の部屋つき",
|
|
274
275
|
"Like the cast": "チームと同じ",
|
|
275
276
|
"No picture yet.": "まだ画像がありません。",
|
|
@@ -374,5 +375,12 @@
|
|
|
374
375
|
"waits for your answer or approval (with “?”: probably, from how long it has waited)": "あなたの回答か承認を待っています(「?」付き:待ち時間からの推測)",
|
|
375
376
|
"where the work is": "作業中のところ",
|
|
376
377
|
"where you last typed": "最後に入力したところ",
|
|
377
|
-
"you went there": "あなたが移動したところ"
|
|
378
|
+
"you went there": "あなたが移動したところ",
|
|
379
|
+
"Help count how many people use Agent Standup? When you open the call, at most once a week, the app would load an empty 1-pixel file from GitHub: no identifier, nothing about you or your sessions. GitHub sees your IP address, as with any download. You can turn it off any time in ⚙ › All settings.": "Agent Standup の利用者数を数えるのに協力しませんか? 通話を開いたときに、週に1回まで、アプリが GitHub から空の1ピクセルのファイルを読み込みます。識別子はなく、あなたやセッションについての情報も送りません。他のダウンロードと同じく、GitHub にはあなたの IP アドレスが見えます。⚙ › すべての設定 でいつでもオフにできます。",
|
|
380
|
+
"Count me in": "協力する",
|
|
381
|
+
"Privacy policy": "プライバシーポリシー",
|
|
382
|
+
"Help count users (1 request a week)": "利用者数のカウントに協力する(週に1回のリクエスト)",
|
|
383
|
+
"Halloween is coming: dress your agents up as a pumpkin, a ghost, a witch or a skeleton, drawn by hand by Fabien Coupas.": "もうすぐハロウィン:エージェントをかぼちゃ、おばけ、魔女、がいこつに仮装させましょう。Fabien Coupas による手描きです。",
|
|
384
|
+
"Happy Halloween! Your agents can come to the call in costume.": "ハッピーハロウィン!エージェントは仮装して通話に参加できます。",
|
|
385
|
+
"Halloween is tomorrow: your agents can come to the call in costume.": "明日はハロウィン:エージェントは仮装して通話に参加できます。"
|
|
378
386
|
}
|
package/public/locales/ko.json
CHANGED
|
@@ -270,6 +270,7 @@
|
|
|
270
270
|
"characters": "캐릭터",
|
|
271
271
|
"Choose a picture": "이미지 선택",
|
|
272
272
|
"Free, from the Halloween pack": "무료, 핼러윈 팩에서",
|
|
273
|
+
"gave up?": "포기했나요?",
|
|
273
274
|
"Hand-drawn, each in its own room": "손으로 그린, 각자 자기 방이 있는",
|
|
274
275
|
"Like the cast": "팀과 같게",
|
|
275
276
|
"No picture yet.": "아직 이미지가 없습니다.",
|
|
@@ -374,5 +375,12 @@
|
|
|
374
375
|
"waits for your answer or approval (with “?”: probably, from how long it has waited)": "답변이나 승인을 기다려요 (“?”가 있으면: 기다린 시간으로 본 추정)",
|
|
375
376
|
"where the work is": "작업이 진행 중인 곳",
|
|
376
377
|
"where you last typed": "마지막으로 입력한 곳",
|
|
377
|
-
"you went there": "직접 이동한 곳"
|
|
378
|
+
"you went there": "직접 이동한 곳",
|
|
379
|
+
"Help count how many people use Agent Standup? When you open the call, at most once a week, the app would load an empty 1-pixel file from GitHub: no identifier, nothing about you or your sessions. GitHub sees your IP address, as with any download. You can turn it off any time in ⚙ › All settings.": "Agent Standup을 쓰는 사람 수를 세는 데 도움을 주시겠어요? 통화를 열 때 최대 일주일에 한 번, 앱이 GitHub에서 빈 1픽셀 파일을 불러옵니다. 식별자도 없고, 사용자나 세션에 대한 정보도 없습니다. 다른 다운로드와 마찬가지로 GitHub는 IP 주소를 볼 수 있습니다. ⚙ › 모든 설정에서 언제든지 끌 수 있습니다.",
|
|
380
|
+
"Count me in": "참여하기",
|
|
381
|
+
"Privacy policy": "개인정보 처리방침",
|
|
382
|
+
"Help count users (1 request a week)": "사용자 수 세기 돕기 (일주일에 요청 1번)",
|
|
383
|
+
"Halloween is coming: dress your agents up as a pumpkin, a ghost, a witch or a skeleton, drawn by hand by Fabien Coupas.": "핼러윈이 다가옵니다: 에이전트에게 호박, 유령, 마녀, 해골 분장을 해 보세요. Fabien Coupas가 손으로 그렸습니다.",
|
|
384
|
+
"Happy Halloween! Your agents can come to the call in costume.": "해피 핼러윈! 에이전트가 분장하고 통화에 올 수 있어요.",
|
|
385
|
+
"Halloween is tomorrow: your agents can come to the call in costume.": "내일은 핼러윈: 에이전트가 분장하고 통화에 올 수 있어요."
|
|
378
386
|
}
|
|
@@ -270,6 +270,7 @@
|
|
|
270
270
|
"characters": "personagens",
|
|
271
271
|
"Choose a picture": "Escolher uma imagem",
|
|
272
272
|
"Free, from the Halloween pack": "Grátis, do pacote de Halloween",
|
|
273
|
+
"gave up?": "desistiu?",
|
|
273
274
|
"Hand-drawn, each in its own room": "Desenhados à mão, cada um em seu cômodo",
|
|
274
275
|
"Like the cast": "Como o resto da equipe",
|
|
275
276
|
"No picture yet.": "Nenhuma imagem ainda.",
|
|
@@ -374,5 +375,12 @@
|
|
|
374
375
|
"waits for your answer or approval (with “?”: probably, from how long it has waited)": "espera a sua resposta ou aprovação (com “?”: provavelmente, pelo tempo de espera)",
|
|
375
376
|
"where the work is": "onde está o trabalho",
|
|
376
377
|
"where you last typed": "onde você escreveu por último",
|
|
377
|
-
"you went there": "você foi para lá"
|
|
378
|
+
"you went there": "você foi para lá",
|
|
379
|
+
"Help count how many people use Agent Standup? When you open the call, at most once a week, the app would load an empty 1-pixel file from GitHub: no identifier, nothing about you or your sessions. GitHub sees your IP address, as with any download. You can turn it off any time in ⚙ › All settings.": "Quer ajudar a contar quantas pessoas usam o Agent Standup? Quando você abre a chamada, no máximo uma vez por semana, o app carregaria um arquivo vazio de 1 pixel do GitHub: nenhum identificador, nada sobre você ou suas sessões. O GitHub vê seu endereço IP, como em qualquer download. Você pode desativar quando quiser em ⚙ › Todas as configurações.",
|
|
380
|
+
"Count me in": "Pode contar comigo",
|
|
381
|
+
"Privacy policy": "Política de privacidade",
|
|
382
|
+
"Help count users (1 request a week)": "Ajudar a contar usuários (1 solicitação por semana)",
|
|
383
|
+
"Halloween is coming: dress your agents up as a pumpkin, a ghost, a witch or a skeleton, drawn by hand by Fabien Coupas.": "O Halloween está chegando: fantasie seus agentes de abóbora, fantasma, bruxa ou esqueleto, desenhados à mão por Fabien Coupas.",
|
|
384
|
+
"Happy Halloween! Your agents can come to the call in costume.": "Feliz Halloween! Seus agentes podem vir fantasiados para a chamada.",
|
|
385
|
+
"Halloween is tomorrow: your agents can come to the call in costume.": "Amanhã é Halloween: seus agentes podem vir fantasiados para a chamada."
|
|
378
386
|
}
|
|
@@ -270,6 +270,7 @@
|
|
|
270
270
|
"characters": "个角色",
|
|
271
271
|
"Choose a picture": "选择图片",
|
|
272
272
|
"Free, from the Halloween pack": "免费,来自万圣节角色包",
|
|
273
|
+
"gave up?": "放弃了?",
|
|
273
274
|
"Hand-drawn, each in its own room": "手绘,每个角色都有自己的房间",
|
|
274
275
|
"Like the cast": "和团队一样",
|
|
275
276
|
"No picture yet.": "还没有图片。",
|
|
@@ -374,5 +375,12 @@
|
|
|
374
375
|
"waits for your answer or approval (with “?”: probably, from how long it has waited)": "等待你的回答或批准(带“?”:根据等待时间推测)",
|
|
375
376
|
"where the work is": "正在工作的地方",
|
|
376
377
|
"where you last typed": "你最后输入的地方",
|
|
377
|
-
"you went there": "你去过那里"
|
|
378
|
+
"you went there": "你去过那里",
|
|
379
|
+
"Help count how many people use Agent Standup? When you open the call, at most once a week, the app would load an empty 1-pixel file from GitHub: no identifier, nothing about you or your sessions. GitHub sees your IP address, as with any download. You can turn it off any time in ⚙ › All settings.": "愿意帮忙统计有多少人在用 Agent Standup 吗?打开通话时,每周最多一次,应用会从 GitHub 加载一个 1 像素的空文件:没有任何标识,也不涉及你或你的会话。和任何下载一样,GitHub 会看到你的 IP 地址。你可以随时在 ⚙ › 全部设置 中关闭。",
|
|
380
|
+
"Count me in": "参与统计",
|
|
381
|
+
"Privacy policy": "隐私政策",
|
|
382
|
+
"Help count users (1 request a week)": "帮忙统计用户(每周 1 次请求)",
|
|
383
|
+
"Halloween is coming: dress your agents up as a pumpkin, a ghost, a witch or a skeleton, drawn by hand by Fabien Coupas.": "万圣节快到了:把你的智能体打扮成南瓜、幽灵、女巫或骷髅,均由 Fabien Coupas 手绘。",
|
|
384
|
+
"Happy Halloween! Your agents can come to the call in costume.": "万圣节快乐!你的智能体可以穿着装扮来开会。",
|
|
385
|
+
"Halloween is tomorrow: your agents can come to the call in costume.": "明天就是万圣节:你的智能体可以穿着装扮来开会。"
|
|
378
386
|
}
|
|
@@ -270,6 +270,7 @@
|
|
|
270
270
|
"characters": "個角色",
|
|
271
271
|
"Choose a picture": "選擇圖片",
|
|
272
272
|
"Free, from the Halloween pack": "免費,來自萬聖節角色包",
|
|
273
|
+
"gave up?": "放棄了?",
|
|
273
274
|
"Hand-drawn, each in its own room": "手繪,每個角色都有自己的房間",
|
|
274
275
|
"Like the cast": "和團隊一樣",
|
|
275
276
|
"No picture yet.": "還沒有圖片。",
|
|
@@ -374,5 +375,12 @@
|
|
|
374
375
|
"waits for your answer or approval (with “?”: probably, from how long it has waited)": "等待你的回答或核准(帶「?」:依等待時間推測)",
|
|
375
376
|
"where the work is": "正在工作的地方",
|
|
376
377
|
"where you last typed": "你最後輸入的地方",
|
|
377
|
-
"you went there": "你去過那裡"
|
|
378
|
+
"you went there": "你去過那裡",
|
|
379
|
+
"Help count how many people use Agent Standup? When you open the call, at most once a week, the app would load an empty 1-pixel file from GitHub: no identifier, nothing about you or your sessions. GitHub sees your IP address, as with any download. You can turn it off any time in ⚙ › All settings.": "願意幫忙統計有多少人在用 Agent Standup 嗎?開啟通話時,每週最多一次,應用程式會從 GitHub 載入一個 1 像素的空檔案:沒有任何識別碼,也不涉及你或你的工作階段。和任何下載一樣,GitHub 會看到你的 IP 位址。你可以隨時在 ⚙ › 全部設定 中關閉。",
|
|
380
|
+
"Count me in": "參與統計",
|
|
381
|
+
"Privacy policy": "隱私權政策",
|
|
382
|
+
"Help count users (1 request a week)": "幫忙統計使用者(每週 1 次請求)",
|
|
383
|
+
"Halloween is coming: dress your agents up as a pumpkin, a ghost, a witch or a skeleton, drawn by hand by Fabien Coupas.": "萬聖節快到了:把你的智慧體打扮成南瓜、幽靈、女巫或骷髏,皆由 Fabien Coupas 手繪。",
|
|
384
|
+
"Happy Halloween! Your agents can come to the call in costume.": "萬聖節快樂!你的智慧體可以穿著裝扮來開會。",
|
|
385
|
+
"Halloween is tomorrow: your agents can come to the call in costume.": "明天就是萬聖節:你的智慧體可以穿著裝扮來開會。"
|
|
378
386
|
}
|
package/server.js
CHANGED
|
@@ -367,6 +367,23 @@ const feedSince = (entry, after) => { const ev = entry.tl.events, sq = entry.sq,
|
|
|
367
367
|
const readTail = (file, bytes) => { const fd = fs.openSync(file, 'r'); try { const sz = fs.fstatSync(fd).size, n = Math.min(bytes, sz), buf = Buffer.alloc(n); fs.readSync(fd, buf, 0, n, sz - n); return { text: buf.toString('utf8'), cut: sz > bytes }; } finally { fs.closeSync(fd); } };
|
|
368
368
|
const readHead = (file, bytes) => { const fd = fs.openSync(file, 'r'); try { const n = Math.min(bytes, fs.fstatSync(fd).size), buf = Buffer.alloc(n); fs.readSync(fd, buf, 0, n, 0); return buf.toString('utf8'); } finally { fs.closeSync(fd); } };
|
|
369
369
|
const APPROVAL = /^(Edit|Write|MultiEdit|NotebookEdit)/, ASKS = /^(AskUserQuestion|ExitPlanMode)/, SUBTOOL = /^(Task|Agent)$/;
|
|
370
|
+
// A turn that ended without doing what was asked ("I couldn't verify how old the posts were, so 0 drafts"): to the eye, the same "your turn" as one that did. It says so in its first sentence;
|
|
371
|
+
// later on, "I couldn't" is mostly a caveat on work that was done ("Done. I couldn't test on Windows"), and so is a first sentence that says what worked before a "but". On 1,676 real ends of turn
|
|
372
|
+
// this flags 11, each a real "could not". A turn that ended on an error Claude Code wrote itself (the API, the login, the limit) is one too; "No response requested." is not.
|
|
373
|
+
const GAVE = /\b(?:I|we) (?:couldn't|could not|can't|cannot|wasn't able to|was unable to|am unable to|'m unable to|was not able to|failed to|did not manage|didn't manage)\b|\b(?:gave up|giving up|unable to (?:proceed|continue|complete))\b|je n'ai pas (?:pu|réussi)|\bimpossible de\b|\bje ne (?:peux|parviens|suis pas parvenu)|je n'arrive pas|\bno (?:pude|he podido|puedo|logré)\b|\bnão (?:consegui|posso|pude)\b|\bich (?:konnte|kann) (?:\S+ )?nicht\b/i;
|
|
374
|
+
// "I couldn't find any bugs", "I can't see a problem with it", "I can't reproduce it: it already works": a check that came out clean, not work left undone.
|
|
375
|
+
const CLEAN = /^\s+(?:(?:find|see|spot|detect|identify|trouver|voir|repérer|détecter|relever)\b[^.!?,;:]{0,30}?\b(?:bugs?|issues?|problems?|errors?|regressions?|mistakes?|flaws?|faults?|wrong|problèmes?|erreurs?|soucis|anomalies?|fautes?)\b|(?:reproduce|reproduire)\b[^.!?]{0,60}?\b(?:works|working|passes|already|fonctionne|marche|déjà|passent)\b)/i;
|
|
376
|
+
function gaveUp(text) { // the first sentence when it says it could not, else ''
|
|
377
|
+
const s = String(text || '').replace(/[’‘]/g, "'").replace(/^\s*#{1,6} ([^\n]*)\n+/, (h, t) => (GAVE.test(t) ? t + '. ' : '')).replace(/^[#>*\s]+/, '').replace(/\*\*/g, ''), m = s.match(/^[\s\S]{0,240}?[.!?:](?:\s|$)/), lead = (m ? m[0] : s.slice(0, 240)).trim(), all = new RegExp(GAVE.source, 'gi');
|
|
378
|
+
for (let f; (f = all.exec(lead));) { // each "could not" of the sentence: one that is a clean check does not count, the next one may
|
|
379
|
+
if (CLEAN.test(s.slice(f.index + f[0].length, f.index + f[0].length + 200))) continue; /* s, not lead: "I can't reproduce it: it already works" goes on after the colon (s and lead start at the same place) */
|
|
380
|
+
if (/\b(?:but|though|however|mais|cependant|pero|mas|aber)\b|;/i.test(lead.slice(0, f.index))) return '';
|
|
381
|
+
const rest = lead.slice(f.index + f[0].length), clear = /,\s*(?:but|however) (?:I|we) (?!(?:couldn't|could not|can't|cannot|didn't|did not|still)\b)|,\s*mais j'ai\b|,\s*pero (?:he|hemos)\b|\binstead\b(?! of)|\bà la place\b|,\s*so (?:I|we) (?:ran|used|switched|fell back|went with|worked around|tested|checked|verified|fixed|replaced|chose)\b|,\s*so (?:it|this|that|the \w+)(?:'s| is| are) (?:safe|done|complete|ready)\b/i;
|
|
382
|
+
if (clear.test(rest) && !/\b(?:still|also fails?|fail(?:s|ed)?|doesn't|didn't|won't|couldn't|can't|cannot|not|only|untested|yourself|left|what I could|partly|partially)\b|, but (?!I |we )/i.test(rest)) return ''; /* the same sentence goes on to what was done instead ("I couldn't reproduce it, but I found the cause", "…, so I switched to https.get"); not "…, so I wrote 0 drafts", a workaround that failed too, or work handed back ("but the commit is ready: push it yourself") */
|
|
383
|
+
return lead.replace(/\s+/g, ' ').replace(/\s*:$/, '');
|
|
384
|
+
}
|
|
385
|
+
return '';
|
|
386
|
+
}
|
|
370
387
|
const boardCache = new Map(); // file → { sig, parsed, title }
|
|
371
388
|
let boardMemo = { at: 0, rows: [] }, boardForced = 0;
|
|
372
389
|
const PR_URL = /^https:\/\/github\.com\/[\w.-]+\/[\w.-]+\/pull\/\d+$/; // nothing else is given to the page as a link to open
|
|
@@ -412,7 +429,7 @@ function typedBefore(file) { // the first look at a session whose last order i
|
|
|
412
429
|
function parseTail(file, st) {
|
|
413
430
|
const sig = st.mtimeMs + ':' + st.size, hit = boardCache.get(file); if (hit && hit.sig === sig) return hit;
|
|
414
431
|
const { text, cut } = readTail(file, 192 * 1024), lines = text.split('\n'); if (cut) lines.shift();
|
|
415
|
-
const pend = new Map(); let lastType = null, lastTool = false, lastStop = null, stops = false, esc = false, lastTs = 0, custom = (hit && hit.custom) || null, ai = (hit && hit.ai) || null, first = hit ? hit.first : undefined, pr = (hit && hit.pr) || null, asked = (hit && hit.asked) || 0, plan = (hit && hit.plan) || null;
|
|
432
|
+
const pend = new Map(); let lastType = null, lastTool = false, lastStop = null, stops = false, esc = false, lastTs = 0, custom = (hit && hit.custom) || null, ai = (hit && hit.ai) || null, first = hit ? hit.first : undefined, pr = (hit && hit.pr) || null, asked = (hit && hit.asked) || 0, plan = (hit && hit.plan) || null, say = '', err = ''; // say: the first text since the last call or message of yours, the start of what closes the turn; err: an error that closed it
|
|
416
433
|
for (const l of lines) try { // one odd record costs that record, not the whole card
|
|
417
434
|
if (!l) continue; let r; try { r = JSON.parse(l); } catch { continue; }
|
|
418
435
|
const a = typedAt(r); if (a > asked) asked = a;
|
|
@@ -421,6 +438,8 @@ function parseTail(file, st) {
|
|
|
421
438
|
const t = Date.parse(r.timestamp) || 0, bl = blocks(r);
|
|
422
439
|
if (r.type === 'assistant' || r.type === 'user') { lastType = r.type; lastTool = bl.some((b) => b.type === 'tool_use'); lastStop = (r.type === 'assistant' && r.message && r.message.stop_reason) || null; if (lastStop) stops = true; if (t) lastTs = t;
|
|
423
440
|
esc = r.type === 'user' && bl.some((b) => b.type === 'text' && /^\s*\[Request interrupted/i.test(b.text || '')); if (esc) pend.clear(); } // Esc: the turn stops there, and no call is waited for any more
|
|
441
|
+
if (r.type === 'user' || (r.type === 'assistant' && lastTool)) { say = ''; err = ''; }
|
|
442
|
+
else if (r.type === 'assistant' && !r.isSidechain) { const tx = bl.filter((b) => b.type === 'text' && typeof b.text === 'string').map((b) => b.text).join('\n').trim(), m = r.message || {}; err = (r.isApiErrorMessage || m.model === '<synthetic>') && tx && !/^No response requested/i.test(tx) ? tx : ''; if (tx && !say) say = tx; }
|
|
424
443
|
for (const b of bl) if (b.type === 'tool_use' && /^(Write|Edit|MultiEdit)$/.test(b.name) && b.input && planFile(String(b.input.file_path || ''))) plan = { file: String(b.input.file_path), ts: t }; // the plan, written in its own file before it is shown for approval
|
|
425
444
|
for (const b of bl) { if (b.type === 'tool_use') pend.set(b.id, { id: String(b.id || ''), name: b.name, ts: t, q: askOf(b), c: callOf(b), m: menuOf(b) }); else if (b.type === 'tool_result') pend.delete(b.tool_use_id); }
|
|
426
445
|
} catch {}
|
|
@@ -430,7 +449,7 @@ function parseTail(file, st) {
|
|
|
430
449
|
}
|
|
431
450
|
if (!custom && !ai && first == null) first = firstPrompt(file) || (st.size > 64 * 1024 ? '' : null); // '' = looked for and not there; a file that has just been created is looked at again
|
|
432
451
|
if (!hit && !asked && cut) asked = typedBefore(file);
|
|
433
|
-
const out = { sig, title: custom || ai || first || null, custom, ai, first, pr, lastType, lastTool, lastStop, stops, esc, lastTs, pending: [...pend.values()] }; // a title the person typed wins over the generated one, and both over the first prompt
|
|
452
|
+
const out = { sig, title: custom || ai || first || null, custom, ai, first, pr, lastType, lastTool, lastStop, stops, esc, lastTs, pending: [...pend.values()], ...(lastType === 'assistant' && (err || gaveUp(say)) ? { gave: (err || gaveUp(say)).replace(/\s+/g, ' ').slice(0, 240) } : {}) }; // a title the person typed wins over the generated one, and both over the first prompt
|
|
434
453
|
out.asked = asked; out.plan = plan; boardCache.set(file, out); if (boardCache.size > 3 * ROWS_MAX) boardCache.delete(boardCache.keys().next().value); return out; // more than the list can hold: a full list never pushes its own rows out, which read every row again at each scan
|
|
435
454
|
}
|
|
436
455
|
function firstPrompt(file) { // the first thing the person typed, read record by record: a pattern over the raw text ran from a user record into the assistant's first answer and took that as the title
|
|
@@ -482,7 +501,7 @@ function boardRows0() {
|
|
|
482
501
|
let subActive = 0, subTotal = 0;
|
|
483
502
|
for (const x of subFiles(proj, id)) { subTotal++; if (now - mtimeOf(x.file) < 90e3) subActive++; }
|
|
484
503
|
const ran = since && p.asked && p.asked < since ? since - p.asked : 0, ask = state === 'blocked' && lp ? lp.q || lp.c : ''; // since: when it started to wait on you; ran: how long it worked, from your last order to then
|
|
485
|
-
return { proj, id, title: coworkTitle(proj, id) || p.title || id, mtime: st.mtimeMs, state, tool, ageMs, subActive, subTotal, asked: p.asked || 0, ...(since ? { since } : {}), ...(ran ? { ran } : {}), ...(p.pr ? { pr: p.pr } : {}), ...(ask ? { ask } : {}), ...(state === 'blocked' && w && w.status === 'waiting' ? { sure: 1 } : {}), ...(open ? { menu: open } : state === 'blocked' && lp && lp.m && !SUBTOOL.test(lp.name) ? { menu: { id: lp.id, tool: lp.name, ...lp.m, ...(w && w.status === 'waiting' ? { sure: 1 } : {}) } } : {}), ...(p.esc ? { cut: 1 } : {}), ...(tmpKey(proj) ? { tmp: 1 } : {}) }; // cut: stopped by you, which is no news to tell you
|
|
504
|
+
return { proj, id, title: coworkTitle(proj, id) || p.title || id, mtime: st.mtimeMs, state, tool, ageMs, subActive, subTotal, asked: p.asked || 0, ...(since ? { since } : {}), ...(ran ? { ran } : {}), ...(p.pr ? { pr: p.pr } : {}), ...(ask ? { ask } : {}), ...(state === 'blocked' && w && w.status === 'waiting' ? { sure: 1 } : {}), ...(open ? { menu: open } : state === 'blocked' && lp && lp.m && !SUBTOOL.test(lp.name) ? { menu: { id: lp.id, tool: lp.name, ...lp.m, ...(w && w.status === 'waiting' ? { sure: 1 } : {}) } } : {}), ...(state === 'turn' && p.gave ? { gave: p.gave } : {}), ...(p.esc ? { cut: 1 } : {}), ...(tmpKey(proj) ? { tmp: 1 } : {}) }; // cut: stopped by you, which is no news to tell you
|
|
486
505
|
}).filter(Boolean);
|
|
487
506
|
}
|
|
488
507
|
// Settings live in a file, not only in the page's localStorage: the port changes between VS Code windows and reloads, and localStorage is per origin (port included).
|
|
@@ -544,8 +563,30 @@ function logError(where, e) {
|
|
|
544
563
|
const RATE_STORES = /^https:\/\/(marketplace\.visualstudio\.com|open-vsx\.org)\//, GITHUB_REPO = 'https://github.com/Atoll92/agent-standup';
|
|
545
564
|
function appKind() {
|
|
546
565
|
const h = String(process.env.AGENT_STANDUP_HOST || ''), rate = String(process.env.AGENT_STANDUP_RATE || '');
|
|
547
|
-
const kind = h === 'desktop app' ? 'desktop' : h === 'command line' ? 'cli' : h ? 'editor' : '';
|
|
548
|
-
return { kind, rate: kind === 'editor' && RATE_STORES.test(rate) ? rate : GITHUB_REPO };
|
|
566
|
+
const kind = h === 'desktop app' ? 'desktop' : h === 'command line' ? 'cli' : h === 'claude code plugin' ? 'plugin' : h ? 'editor' : '';
|
|
567
|
+
return { kind, rate: kind === 'editor' && RATE_STORES.test(rate) ? rate : GITHUB_REPO, track: !noTrack() }; // track: false when DO_NOT_TRACK is set, and the page does not ask about usage
|
|
568
|
+
}
|
|
569
|
+
// Usage, counted only for those who said yes, in the desktop app, the command line and the Claude Code plugin (the editor counts itself: extension.js, pingWeek). The page asks once
|
|
570
|
+
// (prefs.shareUsage, which this server reads again in the settings file before it sends anything); when the call is opened it asks this server, which sends at most one empty request a week (weeks from Monday, UTC) for the 1-pixel file of its kind in the "stats"
|
|
571
|
+
// release on GitHub: the requests of a week are the people who opened the call that week from there. Nothing is sent in a request: no id, no path, no content. Never with DO_NOT_TRACK set.
|
|
572
|
+
// A file per week beside the settings (sent-<kind>-week-<monday>) makes several servers and pages send it once. AGENT_STANDUP_PING_BASE: where the tests receive it.
|
|
573
|
+
const USAGE_PIXELS = { desktop: 'desktop-week.gif', cli: 'cli-week.gif', plugin: 'plugin-week.gif' };
|
|
574
|
+
const noTrack = () => /^(1|true|yes)$/i.test(String(process.env.DO_NOT_TRACK || '').trim());
|
|
575
|
+
const mondayOf = (d) => new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate() - ((d.getUTCDay() + 6) % 7))).toISOString().slice(0, 10);
|
|
576
|
+
function usageWeek(now = new Date()) {
|
|
577
|
+
const kind = appKind().kind, name = USAGE_PIXELS[kind]; if (!name || noTrack() || (readPrefs() || {}).shareUsage !== true) return { sent: false }; // the answer is read here too, from the settings file: the page asking is not enough
|
|
578
|
+
const week = mondayOf(now), dir = path.dirname(PREFS), mine = 'sent-' + kind + '-week-' + week;
|
|
579
|
+
try {
|
|
580
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
581
|
+
for (const f of fs.readdirSync(dir)) if (f.startsWith('sent-' + kind + '-week-') && f !== mine) try { fs.unlinkSync(path.join(dir, f)); } catch {}
|
|
582
|
+
fs.closeSync(fs.openSync(path.join(dir, mine), 'wx'));
|
|
583
|
+
} catch (e) { if (!(e && e.code === 'EEXIST')) logError('usage', e); return { sent: false, week }; }
|
|
584
|
+
try {
|
|
585
|
+
const u = new URL(name, process.env.AGENT_STANDUP_PING_BASE || 'https://github.com/Atoll92/agent-standup/releases/download/stats/');
|
|
586
|
+
const r = require(u.protocol === 'http:' ? 'http' : 'https').get(u, { headers: { 'user-agent': 'agent-standup' }, timeout: 5000 }, (m) => { m.resume(); m.destroy(); });
|
|
587
|
+
r.on('error', () => {}); r.on('timeout', () => r.destroy());
|
|
588
|
+
} catch (e) { logError('usage', e); }
|
|
589
|
+
return { sent: true, week };
|
|
549
590
|
}
|
|
550
591
|
function errorReport() { // what ⚙ › Report a problem shows: the app, the system and the last errors of the log
|
|
551
592
|
let errors = []; try { errors = fs.readFileSync(ERRLOG, 'utf8').split('\n').filter(Boolean).slice(-40).map((l) => { try { return JSON.parse(l); } catch { return null; } }).filter((x) => x && typeof x === 'object'); } catch {}
|
|
@@ -1112,7 +1153,7 @@ function start(port = PORT) {
|
|
|
1112
1153
|
if (url.searchParams.get('engine') === 'kokoro') { const st = kokoro.status(); if (st.installed && !st.gaveUp) kokoro.warm(); return json({ available: st.installed && !st.gaveUp, ready: st.ready, voices: kokoro.voices(), platform: process.platform, engine: 'kokoro' }); }
|
|
1113
1154
|
return loadVoices().then((v) => json(v));
|
|
1114
1155
|
}
|
|
1115
|
-
if (url.pathname === '/api/kokoro/install' && req.method === 'POST') return json(kokoro.install());
|
|
1156
|
+
if (url.pathname === '/api/kokoro/install' && req.method === 'POST') return json(kokoro.install()); if (url.pathname === '/api/usage' && req.method === 'POST') return json(usageWeek());
|
|
1116
1157
|
if (url.pathname === '/api/kokoro') return json(kokoro.status());
|
|
1117
1158
|
if (url.pathname === '/api/tts') {
|
|
1118
1159
|
return tts(url.searchParams.get('text') || '', url.searchParams.get('voice'), url.searchParams.get('rate'), url.searchParams.get('engine'), url.searchParams.get('fb'))
|
|
@@ -1120,7 +1161,7 @@ function start(port = PORT) {
|
|
|
1120
1161
|
.catch((e) => json({ error: String(e.message) }, 400));
|
|
1121
1162
|
}
|
|
1122
1163
|
if (url.pathname === '/api/prefs.js') { res.writeHead(200, { 'content-type': 'application/javascript', 'cache-control': 'no-store' }); return res.end('window.SAVED_PREFS = ' + JSON.stringify(readPrefs()).replace(/</g, '\\u003c') + '; window.AS_APP = ' + JSON.stringify(appKind()).replace(/</g, '\\u003c') + ';'); }
|
|
1123
|
-
if (url.pathname === '/api/prefs' && req.method === 'PUT') return readBody((body) => { try { const v = JSON.parse(body); if (!v || typeof v !== 'object' || Array.isArray(v)) throw new Error('prefs must be an object'); writePrefs(v); json({ ok: true }); } catch (e) { json({ error: String(e.message || e) }, 400); } });
|
|
1164
|
+
if (url.pathname === '/api/prefs' && req.method === 'PUT') return readBody((body) => { try { const v = JSON.parse(body); if (!v || typeof v !== 'object' || Array.isArray(v)) throw new Error('prefs must be an object'); const cur = readPrefs() || {}; if ((+cur.shareUsageT || 0) > (+v.shareUsageT || 0)) { v.shareUsage = cur.shareUsage; v.shareUsageT = cur.shareUsageT; v.usageAsked = cur.usageAsked; } writePrefs(v); /* the usage answer: a page opened before it was changed elsewhere (another tab, the desktop app) writes back its old settings, not its old answer */ json({ ok: true }); } catch (e) { json({ error: String(e.message || e) }, 400); } });
|
|
1124
1165
|
if (url.pathname === '/api/prefs') return json(readPrefs() || {});
|
|
1125
1166
|
if (url.pathname === '/api/done' && req.method === 'POST') return readBody((body) => { try { const v = JSON.parse(body); json({ ok: setDone(String(v.proj || ''), String(v.id || ''), v.on !== false) }); } catch (e) { logError('done', e); json({ error: String(e.message || e) }, 400); } });
|
|
1126
1167
|
if (url.pathname === '/api/errors' && req.method === 'POST') return readBody((body) => { try { const b = JSON.parse(body) || {}; logError('page' + (typeof b.where === 'string' && b.where ? ' ' + b.where.slice(0, 40) : ''), { message: String(b.msg || ''), stack: String(b.stack || '') }); json({ ok: true }); } catch (e) { json({ error: String(e.message || e) }, 400); } }); // an error of the page, written to the local log
|