trantor 0.18.126 → 0.18.127
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/.claude-plugin/plugin.json +1 -1
- package/bin/crew-runner.mjs +8 -3
- package/bin/turn-watchdog.mjs +16 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trantor",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.127",
|
|
4
4
|
"description": "Trantor — the hub-world for AI agent crews: live message bus, presence, project Kanban/flow board + crew orchestration for independent AI coding agents (Claude, Codex, Gemini, Kimi, DeepSeek)",
|
|
5
5
|
"mcpServers": {
|
|
6
6
|
"relay": {
|
package/bin/crew-runner.mjs
CHANGED
|
@@ -609,9 +609,10 @@ async function balanceRows() {
|
|
|
609
609
|
}
|
|
610
610
|
|
|
611
611
|
// ---- activity truth (#5965): the RUNNER is the source for this seat ----------------
|
|
612
|
-
//
|
|
613
|
-
// `working · <trigger>` at start, `idle` on a clean landing. Bounded 5s, one call per transition.
|
|
612
|
+
// The runner reports `working · <trigger>` at start and `idle` on a clean landing, bounded to 5s.
|
|
614
613
|
// #7749: the live phase + its start ride the same call, so /peers answers what the seat does NOW.
|
|
614
|
+
// The detached watchdog repeats the working payload once a minute: runTurn blocks this event loop.
|
|
615
|
+
const PRESENCE_MS = Math.max(100, Number(process.env.RUNNER_PRESENCE_MS) || 60_000);
|
|
615
616
|
async function registerStatus(status, extra = {}) {
|
|
616
617
|
const url = HUB + "/register";
|
|
617
618
|
const payload = { session: SESSION, project: PROJ, status, persona: PERSONA, agent: AGENT, llm: AGENT, model: MODEL, ...extra };
|
|
@@ -957,7 +958,11 @@ async function runTurn(prompt, isFirst, trigger = "kickoff", opts = {}) {
|
|
|
957
958
|
kind: cli.pinned ? "opencode" : AGENT, sid, db: OC_DB, workDir: TURN_DIR,
|
|
958
959
|
home: homedir(), startedAt: t0, transcriptDir: TRANSCRIPT_DIR,
|
|
959
960
|
} : undefined;
|
|
960
|
-
|
|
961
|
+
const presencePayload = { session: SESSION, project: PROJ, status: `working · ${trigger}`, persona: PERSONA,
|
|
962
|
+
agent: AGENT, llm: AGENT, model: MODEL, kind: "agent", phase: "working", phaseSince: t0, card: sessionCard || 0 };
|
|
963
|
+
if (MACHINE_LABEL) presencePayload.machine = MACHINE_LABEL;
|
|
964
|
+
writeFileSync(STAMPF, JSON.stringify({ turn: TURN, startedAt: Date.now(), runner: RUNNER_ID, box: boxPlan, activity,
|
|
965
|
+
presence: { intervalMs: PRESENCE_MS, payload: presencePayload } }));
|
|
961
966
|
const wd = spawn(process.execPath, [join(import.meta.dirname, "turn-watchdog.mjs"), STAMPF, ERRF, String(WD_MS), SESSION, PROJ, HUB, TRANSCRIPT_DIR, TURN_DIR,
|
|
962
967
|
// #7752: the stall marker only exists when a box does — with no box there is no sweep to
|
|
963
968
|
// end the turn, so the watchdog stays report-only (reporting is the whole job, boxless).
|
package/bin/turn-watchdog.mjs
CHANGED
|
@@ -52,6 +52,22 @@ const runnerAlive = () => {
|
|
|
52
52
|
try { process.kill(runnerPid, 0); return true; } catch { return false; }
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
+
// The runner is blocked in spawnSync for the whole turn, so presence beats from this helper.
|
|
56
|
+
// The stamp check pins every beat to this runner and turn; killing the watchdog clears the timer.
|
|
57
|
+
const presence = armed.presence;
|
|
58
|
+
let presenceBusy = false;
|
|
59
|
+
async function beatPresence() {
|
|
60
|
+
if (!presence || presenceBusy) return;
|
|
61
|
+
const current = readStamp();
|
|
62
|
+
if (!current || current.turn !== armed.turn || (armed.runner && current.runner !== armed.runner) || !runnerAlive()) return;
|
|
63
|
+
presenceBusy = true;
|
|
64
|
+
try {
|
|
65
|
+
await signedPost(`${hub}/register`, presence.payload, { session, timeoutMs: 5000 });
|
|
66
|
+
} catch {} finally { presenceBusy = false; }
|
|
67
|
+
}
|
|
68
|
+
const presenceTimer = presence ? setInterval(beatPresence, Math.max(100, Number(presence.intervalMs) || 60000)) : null;
|
|
69
|
+
process.on("exit", () => { if (presenceTimer) clearInterval(presenceTimer); });
|
|
70
|
+
|
|
55
71
|
// One observation of every liveness channel: stderr growth, transcript mtime, worktree mtime.
|
|
56
72
|
const ago = (t) => (t > 0 ? `${Math.max(1, Math.round((Date.now() - t) / 60000))}m ago` : "never");
|
|
57
73
|
const describeLast = (b) => {
|