trantor 0.18.81 → 0.18.82
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/wake-nudge.mjs +2 -1
- package/lib/duty-recipient.mjs +11 -9
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trantor",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.82",
|
|
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/wake-nudge.mjs
CHANGED
|
@@ -24,6 +24,7 @@ import { sfetchJson } from "../lib/signed-fetch.mjs";
|
|
|
24
24
|
import { busDir, hostId, readConfig } from "../lib/project.mjs";
|
|
25
25
|
import { ledgerPaths } from "../hooks/lib/inbox-ledger.mjs";
|
|
26
26
|
import { dutyEscalations, claimDutyNudges, auditDutyNudges } from "../lib/duty-nudges.mjs";
|
|
27
|
+
import { recipientPanes } from "../lib/duty-recipient.mjs";
|
|
27
28
|
|
|
28
29
|
const SELF = fileURLToPath(import.meta.url);
|
|
29
30
|
const LABEL = "com.trantor.wake-nudge";
|
|
@@ -64,7 +65,7 @@ export function resolveRecipient(recipient, { bus = busDir(), localHost = hostId
|
|
|
64
65
|
const mapped = read(join(bus, "orch-sessions.txt")).split("\n").find(line => line.split("\t")[0] === project)?.split("\t")[1]?.trim();
|
|
65
66
|
let agents = [];
|
|
66
67
|
try { agents = JSON.parse(command("herdr", ["agent", "list"])).result.agents; } catch { /* #7429: map remains available without herdr. */ }
|
|
67
|
-
const panes =
|
|
68
|
+
const panes = recipientPanes(project, mapped, agents);
|
|
68
69
|
if (panes.length > 1) return null;
|
|
69
70
|
const pane = panes[0];
|
|
70
71
|
if (["working", "busy"].includes(pane?.agent_status)) return null;
|
package/lib/duty-recipient.mjs
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
// #7430:
|
|
2
|
-
// nudge. A recipient observed busy is a no-op (prompt rule 4a agrees), a recipient that is not a
|
|
3
|
-
// socket-nudgeable local interactive session is terminal, and a resolver that cannot see at all
|
|
4
|
-
// throws so lib/duty-nudges.mjs fails OPEN to a standing nudge.
|
|
1
|
+
// #7430: preflight skips busy or nonlocal recipients; uncertain local discovery leaves duty a nudge.
|
|
5
2
|
import { execFile } from "node:child_process";
|
|
6
3
|
import { readFileSync } from "node:fs";
|
|
7
4
|
import { join } from "node:path";
|
|
@@ -9,16 +6,21 @@ import { busDir, hostId } from "./project.mjs";
|
|
|
9
6
|
|
|
10
7
|
const BUSY_STATUSES = new Set(["working", "busy"]);
|
|
11
8
|
|
|
9
|
+
// #11109: the recorded session outranks cwd; stale panes often share the orchestrator's directory.
|
|
10
|
+
export function recipientPanes(project, mapped, agents) {
|
|
11
|
+
const claude = (Array.isArray(agents) ? agents : []).filter(agent => agent?.agent === "claude");
|
|
12
|
+
const exact = mapped ? claude.filter(agent => agent.agent_session?.value === mapped) : [];
|
|
13
|
+
return exact.length ? exact : claude.filter(agent => String(agent.cwd || "").split("/").pop() === project);
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
export function recipientVerdict(recipient, { localHost, mapped, agents }) {
|
|
13
17
|
// Remote hosts and crew slugs (`glm:trantor`) have no socket here: the hub delivers their mail
|
|
14
18
|
// through their own runners, so a nudge from this machine is neither possible nor needed.
|
|
15
19
|
if (!String(recipient || "").startsWith(`${localHost}:`)) return "unknown";
|
|
16
20
|
const project = recipient.slice(localHost.length + 1);
|
|
17
|
-
const panes = (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
// Zero or ambiguous panes both mean "no single local session to nudge" (#7429 agrees).
|
|
21
|
-
if (panes.length !== 1) return "unknown";
|
|
21
|
+
const panes = recipientPanes(project, mapped, agents);
|
|
22
|
+
// #11109: uncertain local discovery must reach duty's ListAgents, never a permanent terminal mark.
|
|
23
|
+
if (panes.length !== 1) return mapped || panes.length ? "unresolved" : "unknown";
|
|
22
24
|
return BUSY_STATUSES.has(panes[0].agent_status) ? "busy" : "idle";
|
|
23
25
|
}
|
|
24
26
|
|