@double_geste/agent-standup 1.41.2 → 1.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/agent-standup.js +6 -4
- package/codex.js +64 -14
- package/package.json +1 -1
- package/public/index.html +103 -37
- package/public/locales/da.json +17 -3
- package/public/locales/de.json +17 -3
- package/public/locales/en.json +16 -2
- package/public/locales/es.json +17 -3
- package/public/locales/ja.json +17 -3
- package/public/locales/ko.json +17 -3
- package/public/locales/pt-BR.json +17 -3
- package/public/locales/zh-CN.json +17 -3
- package/public/locales/zh-TW.json +17 -3
- package/server.js +104 -30
package/bin/agent-standup.js
CHANGED
|
@@ -24,9 +24,11 @@ Usage
|
|
|
24
24
|
Options
|
|
25
25
|
--port N port of the local server (default 4747)
|
|
26
26
|
--open open the page in your browser
|
|
27
|
-
--projects DIR where the session files are (default ~/.claude/projects, or $CLAUDE_CONFIG_DIR/projects
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
--projects DIR where the session files are (default ~/.claude/projects, or $CLAUDE_CONFIG_DIR/projects, and those of
|
|
28
|
+
each ~/.claude-<name> folder of another account); when it is named projects, the sessions folder
|
|
29
|
+
beside it is read too (what waits for you)
|
|
30
|
+
--config DIR Claude Code's config folder, as CLAUDE_CONFIG_DIR (its projects and sessions folders are read, and
|
|
31
|
+
no other account's)
|
|
30
32
|
--codex DIR where Codex keeps its files (default ~/.codex, or $CODEX_HOME); "off" to leave Codex sessions out
|
|
31
33
|
--vibe DIR where Mistral Vibe keeps its files (default ~/.vibe, or $VIBE_HOME); "off" to leave Vibe sessions out
|
|
32
34
|
--cowork DIR where the Claude desktop app keeps its Cowork sessions (default: its local-agent-mode-sessions folder); "off" to leave them out
|
|
@@ -44,7 +46,7 @@ if (flags.projects && path.basename(path.resolve(flags.projects)) === 'projects'
|
|
|
44
46
|
if (flags.codex !== undefined) process.env.AGENT_STANDUP_CODEX = /^(0|off|no|false)?$/i.test(String(flags.codex)) ? 'off' : path.resolve(String(flags.codex));
|
|
45
47
|
if (flags.vibe !== undefined) process.env.AGENT_STANDUP_VIBE = /^(0|off|no|false)?$/i.test(String(flags.vibe)) ? 'off' : path.resolve(String(flags.vibe));
|
|
46
48
|
if (flags.cowork !== undefined) process.env.AGENT_STANDUP_COWORK = /^(0|off|no|false)?$/i.test(String(flags.cowork)) ? 'off' : path.resolve(String(flags.cowork));
|
|
47
|
-
if (flags.config) process.env.CLAUDE_CONFIG_DIR = path.resolve(flags.config);
|
|
49
|
+
if (flags.config) { process.env.CLAUDE_CONFIG_DIR = path.resolve(flags.config); process.env.AGENT_STANDUP_CLAUDE_DIRS = 'off'; } // the one account asked for, not the other Claude Code folders
|
|
48
50
|
if (flags.characters) process.env.AGENT_STANDUP_CHARACTERS = path.resolve(flags.characters);
|
|
49
51
|
if (flags.port !== undefined) { // a real port number or nothing: no silent fallback to another port
|
|
50
52
|
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); }
|
package/codex.js
CHANGED
|
@@ -61,7 +61,12 @@ function headOf(text, capped) {
|
|
|
61
61
|
let out = { ok: false, cwd: '', dir: '', child: false };
|
|
62
62
|
if (!text) return out; // not written yet: looked at again next time
|
|
63
63
|
let p = null; try { const r = JSON.parse(text); if (r && r.type === 'session_meta' && r.payload && typeof r.payload === 'object') p = r.payload; } catch {}
|
|
64
|
-
if (p)
|
|
64
|
+
if (p) {
|
|
65
|
+
const sub = p.source && typeof p.source === 'object' && p.source.subagent, spawn = sub && typeof sub.thread_spawn === 'object' && sub.thread_spawn;
|
|
66
|
+
out = { ok: true, cwd: typeof p.cwd === 'string' ? p.cwd : '', child: !!p.parent_thread_id || !!sub };
|
|
67
|
+
if (spawn) Object.assign(out, { parent: String(spawn.parent_thread_id || p.parent_thread_id || '').toLowerCase(), born: Date.parse(p.timestamp) || 0,
|
|
68
|
+
name: String(p.agent_nickname || spawn.agent_nickname || ''), role: String(p.agent_role || spawn.agent_role || 'agent'), task: String(spawn.agent_path || '').split('/').pop() || '' });
|
|
69
|
+
}
|
|
65
70
|
else if (capped && /^\{"timestamp":"[^"]*","(?:ordinal":\d+,")?type":"session_meta"/.test(text)) { // a first line longer than what was read: the two facts, without the rest
|
|
66
71
|
const cwd = text.match(/"cwd":"((?:[^"\\]|\\.)*)"/); let c = ''; try { c = cwd ? JSON.parse('"' + cwd[1] + '"') : ''; } catch {}
|
|
67
72
|
out = { ok: true, cwd: c, child: /"parent_thread_id":"[^"]+"/.test(text) || /"source":\{"subagent"/.test(text) };
|
|
@@ -69,9 +74,45 @@ function headOf(text, capped) {
|
|
|
69
74
|
out.dir = dirKey(out.cwd);
|
|
70
75
|
return out;
|
|
71
76
|
}
|
|
77
|
+
// Only explicit thread_spawn relationships are team members. Guardian/approval reviews and unrelated sessions never join a call.
|
|
78
|
+
const kinCache = new Map(); // file → { top, parent }: a file's place in its family, from its first line, which never changes. Kept whatever the size of headCache, so that a poll does not read every first line again
|
|
79
|
+
function kin(r) {
|
|
80
|
+
const was = kinCache.get(r.file); if (was) return was;
|
|
81
|
+
const h = head(r.file), k = { top: h.ok && !h.child, parent: h.parent && h.parent !== r.id ? h.parent : '' };
|
|
82
|
+
if (headCache.get(r.file) === h) kinCache.set(r.file, k); // a first line still being written is read again next time
|
|
83
|
+
return k;
|
|
84
|
+
}
|
|
85
|
+
let familyMemo = { scan: null, children: new Map() };
|
|
86
|
+
function descendants(id) {
|
|
87
|
+
const s = scan();
|
|
88
|
+
if (familyMemo.scan !== s) {
|
|
89
|
+
const children = new Map();
|
|
90
|
+
for (const r of s.rows) { const k = kin(r); if (!k.parent) continue; const list = children.get(k.parent) || []; list.push(r); children.set(k.parent, list); }
|
|
91
|
+
if (kinCache.size > s.rows.length * 2 + 100) { const live = new Set(s.rows.map((r) => r.file)); for (const f of kinCache.keys()) if (!live.has(f)) kinCache.delete(f); } // files gone or compressed under another name
|
|
92
|
+
familyMemo = { scan: s, children };
|
|
93
|
+
}
|
|
94
|
+
const out = [], seen = new Set([id]), pending = [id];
|
|
95
|
+
for (let i = 0; i < pending.length; i++) for (const r of familyMemo.children.get(pending[i]) || []) {
|
|
96
|
+
if (seen.has(r.id)) continue; seen.add(r.id); pending.push(r.id); out.push({ ...r, h: head(r.file) });
|
|
97
|
+
}
|
|
98
|
+
return out.sort((a, b) => a.h.born - b.h.born || a.id.localeCompare(b.id));
|
|
99
|
+
}
|
|
100
|
+
function subFiles(id) { // a compressed child is read whole only when the timeline is built (state, called by server.js), not each time its files are listed
|
|
101
|
+
const out = descendants(id).map((r) => ({ file: r.file, aid: r.id, mtime: r.mtime,
|
|
102
|
+
meta: { agentType: r.h.role, description: r.h.task || r.h.role, name: r.h.name || r.h.task, parent: r.h.parent === id ? 'main' : r.h.parent, startedAt: r.h.born },
|
|
103
|
+
...(r.zst ? { zst: true } : {}) }));
|
|
104
|
+
out.dirs = []; out.journals = []; return out;
|
|
105
|
+
}
|
|
106
|
+
const subCount = (id) => descendants(id).length;
|
|
72
107
|
// The threads a person started, newest first. A thread started by another thread (Codex's review of a command before it runs, a sub-agent) is not a session of its own.
|
|
108
|
+
// A thread with sub-agents is as recent as the newest of them: the rows come newest first, so the first one met of a family places the whole family, and the list stops at limit.
|
|
73
109
|
function sessions(limit = 80) {
|
|
74
|
-
const
|
|
110
|
+
const s = scan(), out = [], seen = new Set();
|
|
111
|
+
for (const r of s.rows) {
|
|
112
|
+
let top = r, k = kin(r); for (let n = 0; k.parent && n < 32; n++) { const p = s.byId.get(k.parent); if (!p) break; top = p; k = kin(p); } // up to the thread the person started
|
|
113
|
+
if (!k.top || seen.has(top.id)) continue; seen.add(top.id);
|
|
114
|
+
const h = head(top.file); out.push({ ...top, mtime: r.mtime, cwd: h.cwd, dir: h.dir }); if (out.length >= limit) break;
|
|
115
|
+
}
|
|
75
116
|
return out;
|
|
76
117
|
}
|
|
77
118
|
const under = (cwd, key) => { for (let d = String(cwd || ''); d;) { if (dirKey(d) === key) return true; const up = path.dirname(d); if (up === d) return false; d = up; } return false; }; // key is the folder itself or one above it: a dashed name alone cannot tell app/old (inside app) from app-old (beside it)
|
|
@@ -132,7 +173,7 @@ const title = (r) => threadNames().get(r.id) || firstPrompt(r) || r.id;
|
|
|
132
173
|
|
|
133
174
|
// ---- the board: is the agent in the middle of a turn, or is it the person's turn? Read from the end of the file.
|
|
134
175
|
const tailCache = new Map();
|
|
135
|
-
function
|
|
176
|
+
function tailState(r) {
|
|
136
177
|
const sig = r.mtime + ':' + r.size; let t = r.zst ? zFacts(r.file) || { turn: 'closed', asked: 0 } : tailCache.get(r.file); // a compressed thread not read yet: Codex compresses only a thread nobody uses
|
|
137
178
|
if (!r.zst && (!t || t.sig !== sig)) {
|
|
138
179
|
t = { sig, turn: '', asked: (t && t.asked) || 0 }; // asked: when the person last typed something there, which is what moves the live call (see currentSession in server.js)
|
|
@@ -142,8 +183,12 @@ function boardRow(r, now) {
|
|
|
142
183
|
} catch {}
|
|
143
184
|
if (tailCache.size > 200) tailCache.delete(tailCache.keys().next().value); tailCache.set(r.file, t);
|
|
144
185
|
}
|
|
145
|
-
|
|
146
|
-
|
|
186
|
+
return t;
|
|
187
|
+
}
|
|
188
|
+
function boardRow(r, now) {
|
|
189
|
+
const t = tailState(r), kids = descendants(r.id), subActive = kids.filter((k) => now - k.mtime < 10 * 60e3 && tailState(k).turn !== 'closed').length;
|
|
190
|
+
const mtime = Math.max(r.mtime, ...kids.map((k) => k.mtime)), age = now - mtime, state = subActive ? 'working' : age >= 30 * 60e3 ? 'idle' : t.turn === 'closed' ? 'turn' : age < 10 * 60e3 ? 'working' : 'idle';
|
|
191
|
+
return { proj: PROJ, id: r.id, title: title(r), mtime, state, tool: '', ageMs: age, subActive, subTotal: kids.length, asked: t.asked, dir: r.dir, source: 'codex' };
|
|
147
192
|
}
|
|
148
193
|
function tailOf(text, t) { // the end of a file: whether the last turn is open or over (t.turn), and when the person last typed something (t.asked)
|
|
149
194
|
for (const l of text.split('\n')) { const m = /"type":"(task_started|task_complete|turn_started|turn_complete|turn_aborted)"/.exec(l.slice(0, 400)); if (m && l.includes('"event_msg"')) t.turn = /started/.test(m[1]) ? 'open' : 'closed';
|
|
@@ -185,18 +230,19 @@ function zNext() { // one file at a time
|
|
|
185
230
|
src.pipe(z);
|
|
186
231
|
}
|
|
187
232
|
let made = null; // the record reader server.js made with parser(): a compressed thread goes through it here, whole
|
|
188
|
-
const zStates = new Map(); // compressed file → { sig, st }: the events of the last
|
|
189
|
-
function state(id) { // null: a plain file, which server.js reads line by line itself
|
|
233
|
+
const zStates = new Map(); // compressed file and agent → { sig, st, size }: the events of the threads read last; a call with several compressed workers keeps them all, within about 64 MB of compressed files
|
|
234
|
+
function state(id, agent = 'main') { // null: a plain file, which server.js reads line by line itself
|
|
190
235
|
const r = row(id); if (!r || !r.zst || !made) return null;
|
|
191
|
-
const sig = r.mtime + ':' + r.size, hit = zStates.get(
|
|
192
|
-
const st = { agent
|
|
236
|
+
const sig = r.mtime + ':' + r.size, key = r.file + ':' + agent, hit = zStates.get(key); if (hit && hit.sig === sig) { zStates.delete(key); zStates.set(key, hit); return hit.st; }
|
|
237
|
+
const st = { agent, file: r.file, journal: false, raw: [], toolName: {}, msgUsage: new Map() }; // what server.js's own reader would make of the plain file
|
|
193
238
|
let buf = null; try { buf = unzst(r.file); } catch {} if (!buf) return st; // unreadable for now: an empty session, never the compressed bytes taken for lines
|
|
194
239
|
for (let at = 0; at < buf.length;) {
|
|
195
240
|
let nl = buf.indexOf(10, at); if (nl < 0) nl = buf.length;
|
|
196
241
|
if (nl > at) { let j = null; try { j = JSON.parse(buf.toString('utf8', at, nl)); } catch {} if (j && typeof j === 'object') { try { made(st, j); } catch {} } } // one odd record must not take the whole timeline down
|
|
197
242
|
at = nl + 1;
|
|
198
243
|
}
|
|
199
|
-
zStates.set(
|
|
244
|
+
zStates.set(key, { sig, st, size: r.size }); let total = 0; for (const v of zStates.values()) total += v.size || 0;
|
|
245
|
+
while (zStates.size > 2 && (zStates.size > 12 || total > 64 * 1024 * 1024)) { const k0 = zStates.keys().next().value; total -= zStates.get(k0).size || 0; zStates.delete(k0); }
|
|
200
246
|
return st;
|
|
201
247
|
}
|
|
202
248
|
|
|
@@ -215,13 +261,15 @@ function parser({ toolLabel, clip, clipOut = clip, testsOf = () => null, diffOf
|
|
|
215
261
|
};
|
|
216
262
|
const NO_RESULT = new Set(['TodoWrite']);
|
|
217
263
|
return (made = function record(st, r) {
|
|
264
|
+
if (r.type === 'session_meta') { const h = headOf(JSON.stringify(r)); if (st.agent !== 'main' && h.parent && !st.birth) st.birth = h.born; return; } // the child's own first line: a fork of a fork may carry its parent's session_meta further down
|
|
218
265
|
if (r.type !== 'event_msg' && r.type !== 'response_item' && r.type !== 'turn_context' && r.type !== 'compacted') return;
|
|
266
|
+
if (st.birth && Date.parse(r.timestamp) < st.birth) return; // a fork may include its parent's earlier history: it is not work this child did
|
|
219
267
|
const agent = st.agent, p = r.payload && typeof r.payload === 'object' ? r.payload : {}, cx = st.cx || (st.cx = { items: false, model: '', n: 0, tot: null, last: 0, userAt: -1 });
|
|
220
268
|
const ts = Math.max(Date.parse(r.timestamp) || 0, st.lastTs || 0); st.lastTs = ts; // the lines of one file are in order; a line without a time takes the last one
|
|
221
269
|
const push = (e) => { e.k = agent + ':' + st.raw.length; st.raw.push(e); if (e.ts > cx.last) cx.last = e.ts; return e; };
|
|
222
270
|
const th = () => { const t = st.th; st.th = ''; return t ? { th: t } : {}; };
|
|
223
271
|
const say = (text, final) => { const t = String(text == null ? '' : text).trim(); if (!t) return; const e = push({ ts, agent, kind: 'say', text: t, ...th() }); st.act = st.raw.length - 1; if (final && agent === 'main') e.end = 1; };
|
|
224
|
-
const user = (text, img, iid) => { const t = typed(text); if (!t) return; push({ ts, agent: 'user', kind: 'user', text: t, ...(img > 0 && typeof iid === 'string' && /^[\w.\-]{6,200}$/.test(iid) ? { img, iid } : {}) }); cx.userAt = st.raw.length - 1; };
|
|
272
|
+
const user = (text, img, iid) => { const t = typed(text); if (!t) return; if (agent !== 'main') { if (!/^gAAAAA[\w=-]+$/.test(t)) { if (!st.prompt) st.prompt = { ts, text: t }; else (st.prompts || (st.prompts = [])).push({ ts, text: t }); } return; } push({ ts, agent: 'user', kind: 'user', text: t, ...(img > 0 && typeof iid === 'string' && /^[\w.\-]{6,200}$/.test(iid) ? { img, iid } : {}) }); cx.userAt = st.raw.length - 1; };
|
|
225
273
|
const call = (id, name, input, at) => { const when = Math.max(Math.min(at || ts, ts), cx.last); st.toolName[id] = name; push({ ts: when, agent, kind: 'tool', tool: toolLabel({ id, name, input: input || {} }, when), ...th() }); st.act = st.raw.length - 1; }; // a command is placed when it started, never before what the file already said
|
|
226
274
|
const result = (id, out, err, more) => { const n = st.toolName[id]; if (!n || NO_RESULT.has(n)) return; push({ ts, agent, kind: 'results', items: [{ id, err: !!err, out: clipOut(String(out == null ? '' : out).trimEnd(), resultMax[n] || (/^mcp__/.test(n) ? 900 : 600)), ...more }] }); }; // more: what else the screen shows of it (img, tests, diff, search)
|
|
227
275
|
const views = () => { const v = cx.views || []; cx.views = []; return v; }; // the pictures looked at (ImageView) whose output has not come yet
|
|
@@ -231,6 +279,7 @@ function parser({ toolLabel, clip, clipOut = clip, testsOf = () => null, diffOf
|
|
|
231
279
|
if (r.type === 'turn_context') { if (typeof p.model === 'string') cx.model = p.model; return; }
|
|
232
280
|
if (r.type === 'compacted') { push({ ts, agent, kind: 'compact' }); return; }
|
|
233
281
|
if (r.type === 'event_msg') {
|
|
282
|
+
if (p.type === 'task_started' || p.type === 'turn_started') { st.completed = false; return; }
|
|
234
283
|
if (p.type === 'item_completed' && p.item && typeof p.item === 'object') {
|
|
235
284
|
const it = p.item, id = String(it.id || 'cx' + st.raw.length), at = +p.started_at_ms || 0; cx.items = true;
|
|
236
285
|
if (it.type === 'UserMessage') { viewed(null); user(partsText(it.content), localImages(it.content), it.id); }
|
|
@@ -262,7 +311,7 @@ function parser({ toolLabel, clip, clipOut = clip, testsOf = () => null, diffOf
|
|
|
262
311
|
st.msgUsage.set('t' + cx.n++, { ts, u: { i: Math.max(0, (u.input_tokens || 0) - cached - w), o: u.output_tokens || 0, r: cached, w }, model: cx.model || 'codex', ...(info.model_context_window > 0 ? { cw: info.model_context_window } : {}) }); // cw: the size of the context window, which Codex states
|
|
263
312
|
return;
|
|
264
313
|
}
|
|
265
|
-
if (p.type === 'task_complete' || p.type === 'turn_complete' || p.type === 'turn_aborted') { viewed(null); endTurn(); }
|
|
314
|
+
if (p.type === 'task_complete' || p.type === 'turn_complete' || p.type === 'turn_aborted') { viewed(null); endTurn(); st.completed = true; st.completedAt = ts; }
|
|
266
315
|
return;
|
|
267
316
|
}
|
|
268
317
|
// response_item: what the model sent, raw
|
|
@@ -330,7 +379,8 @@ function findImage(buf, toolId, n, user) { // { type, data } or null
|
|
|
330
379
|
}
|
|
331
380
|
const sniff = (b, type) => (b[0] === 0x89 && b[1] === 0x50 ? 'image/png' : b[0] === 0xff && b[1] === 0xd8 ? 'image/jpeg' : b.toString('latin1', 0, 4) === 'GIF8' ? 'image/gif' : b.toString('latin1', 8, 12) === 'WEBP' ? 'image/webp' : type); // the bytes say what they are: a computer-use screenshot written image/png is often a JPEG
|
|
332
381
|
const imgMemo = new Map();
|
|
333
|
-
function image(id, toolId, n, user) { // { type, buf } or null
|
|
382
|
+
function image(id, toolId, n, user, agent = 'main') { // { type, buf } or null
|
|
383
|
+
if (agent !== 'main' && agent !== 'user') { if (!descendants(id).some((r) => r.id === agent)) return null; id = agent; }
|
|
334
384
|
const r = row(id); if (!r || typeof toolId !== 'string' || toolId.length < 4 || !(n >= 0)) return null;
|
|
335
385
|
const key = r.file + '|' + r.mtime + '|' + toolId + '|' + n + (user ? '|u' : ''); if (imgMemo.has(key)) return imgMemo.get(key);
|
|
336
386
|
let found = null; try { const buf = rollout(r); found = buf ? findImage(buf, toolId, n, !!user) : null; } catch {}
|
|
@@ -338,4 +388,4 @@ function image(id, toolId, n, user) { // { type, buf } or null
|
|
|
338
388
|
imgMemo.set(key, out); if (imgMemo.size > 12) imgMemo.delete(imgMemo.keys().next().value);
|
|
339
389
|
return out;
|
|
340
390
|
}
|
|
341
|
-
module.exports = { PROJ, SOURCE, home, dirKey, sessions, row, fileOf, cwd, inProject, projectLabel, title, boardRow, state, parser, image };
|
|
391
|
+
module.exports = { PROJ, SOURCE, home, dirKey, sessions, row, fileOf, cwd, inProject, projectLabel, title, boardRow, subFiles, subCount, state, parser, image };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@double_geste/agent-standup",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.43.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"
|