@double_geste/agent-standup 1.47.1 → 1.49.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/server.js CHANGED
@@ -8,6 +8,7 @@ const os = require('os');
8
8
  const crypto = require('crypto');
9
9
  const codex = require('./codex.js'); // Codex sessions, read as the same call (see codex.js)
10
10
  const vibe = require('./vibe.js'); // Mistral Vibe sessions, the same way (see vibe.js)
11
+ const limits = require('./limits.js'); // plan limits (5-hour and weekly windows), read from local files only (see limits.js)
11
12
  const boards = require('./boards.js'); // Claude Whiteboards and Sheets, drawn again from the session's writes for the shared screen (see boards.js)
12
13
  const reply = require('./reply.js'); // the human's line, typed into the session's tmux pane (see reply.js); off unless AGENT_STANDUP_REPLY=on
13
14
  const SOURCES = [codex, vibe], sourceOf = (proj) => SOURCES.find((m) => m.PROJ === proj) || null, guard = (fn, or) => { try { return fn(); } catch (e) { logError('reader', e); return or; } }; // guard: a session of another tool that cannot be read costs that session, never the list // the tools other than Claude Code: each lists its sessions under one made-up project
@@ -1559,6 +1560,7 @@ function start(port = PORT) {
1559
1560
  if (url.pathname === '/api/errors') return json(errorReport());
1560
1561
  if (url.pathname === '/api/current') { const q = (k) => url.searchParams.get(k) || ''; return json(currentSession(q('proj'), q('pid') ? { proj: q('pproj'), id: q('pid'), since: q('since') ? +q('since') : NaN, pin: q('pin') === '1' } : null, { proj: q('sproj'), id: q('sid') })); }
1561
1562
  if (url.pathname === '/api/board') return json(boardRows());
1563
+ if (url.pathname === '/api/limits') { const tool = url.searchParams.get('tool'); return json(tool === 'codex' ? guard(() => (codex.home() ? limits.codex(codex.files()) : null), null) : guard(() => limits.claude(path.dirname(PREFS)), null)); } // { windows: [{ key, pct, resetsAt }], asOf, src } or null
1562
1564
  if (url.pathname === '/api/missing') return json(missingTranscripts()); // live Claude Code sessions whose transcript is not where the call reads (missingTranscripts)
1563
1565
  if (url.pathname === '/api/characters') return json(listCharacters(url.searchParams.get('pack') || ''));
1564
1566
  if (url.pathname === '/api/characters/add' && req.method === 'POST') return readBody((body) => { try { const b = JSON.parse(body || '{}') || {}; json(addCharacter(String(b.role || ''), b.name, b.data)); } catch (e) { if (!e.word) logError('add character', e); json({ error: e.word || 'write' }, e.word ? 400 : 500); } }, 512 * 1024); // a picture of 300 KB is 400 KB once written as text
@@ -1642,7 +1644,7 @@ function start(port = PORT) {
1642
1644
  } catch (e) { logError(req.method + ' ' + url.pathname, e); if (res.headersSent) return res.destroy(); json({ error: String(e.message || e) }, 500); }
1643
1645
  }).listen(port, '127.0.0.1', function () { console.log(`Agent Standup → http://localhost:${this.address().port}`); });
1644
1646
  }
1645
- module.exports = { answerIn, missingTranscripts, noteEditor, forgetEditor, _winArg: winArg, start, currentSession, shutdown, findClaude, bundledClaude, boardRows, timeline: (proj, id) => timelineEntry(proj, id).tl, transcriptFile: (proj, id) => path.join(projDir(proj, id), id + '.jsonl'), sessionRows: listSessions, sessionsSince: (t) => listSessions0(+t || 0), codexPending: () => guard(() => !!(codex.zPending && codex.zPending()), false), charactersDir, listCharacters, packsDir, installPack, logError, updateInfo, _reveal: reveal, _scrub: { tidy, homeRe }, _artifact: { page: artifactPage, csp: artifactCsp }, readPrefs, leadKey: (proj, id) => guard(() => (leadProject(proj, id) || {}).key || '', '') };
1647
+ module.exports = { saveLimits: (statusJson) => guard(() => limits.save(path.dirname(PREFS), statusJson), false), answerIn, missingTranscripts, noteEditor, forgetEditor, _winArg: winArg, start, currentSession, shutdown, findClaude, bundledClaude, boardRows, timeline: (proj, id) => timelineEntry(proj, id).tl, transcriptFile: (proj, id) => path.join(projDir(proj, id), id + '.jsonl'), sessionRows: listSessions, sessionsSince: (t) => listSessions0(+t || 0), codexPending: () => guard(() => !!(codex.zPending && codex.zPending()), false), charactersDir, listCharacters, packsDir, installPack, logError, updateInfo, _reveal: reveal, _scrub: { tidy, homeRe }, _artifact: { page: artifactPage, csp: artifactCsp }, readPrefs, leadKey: (proj, id) => guard(() => (leadProject(proj, id) || {}).key || '', '') };
1646
1648
  if (require.main === module && process.env.AGENT_STANDUP_CHILD === '1' && typeof process.send === 'function') { // started by the VS Code extension in a process of its own (see extension.js): reading a large session no longer stops the editor's extensions. Asked for by name: pm2 and others give any app a channel too
1647
1649
  const srv = start(+process.env.PORT || 0), tell = (m) => { try { process.send(m); } catch {} };
1648
1650
  srv.on('listening', () => tell({ port: srv.address().port })).on('error', (e) => { tell({ error: e.code || String(e) }); process.exit(1); });