trantor 0.17.94 → 0.17.96

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trantor",
3
- "version": "0.17.94",
3
+ "version": "0.17.96",
4
4
  "description": "Trantor \u2014 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/hub.mjs CHANGED
@@ -388,7 +388,13 @@ function dutyTick() {
388
388
  const floor = now() - 24 * 3600 * 1000; // never escalate ancient history
389
389
  for (const m of state.messages) {
390
390
  if (m.ts > cutoff || m.ts < floor) continue;
391
- if (!m.to || m.to === "all" || m.to === DUTY_SESSION || m.from === "hub:duty") continue;
391
+ // `hub:*` is the hub's own pseudo-identity, not a session: nothing polls it and nothing ever
392
+ // will, so a message addressed there can never be "delivered". Escalating it is a category
393
+ // error that feeds itself — the duty seat acks the escalation to hub:duty, that ack is
394
+ // undelivered too, and since dutyEscalated prunes its oldest ids at 5,000 the same ones come
395
+ // back around. Reported from the seat as "a fresh identical echo every stop-hook cycle".
396
+ // Skipping the FROM side was already here; the TO side is the half that loops.
397
+ if (!m.to || m.to === "all" || m.to === DUTY_SESSION || m.from === "hub:duty" || m.to.startsWith("hub:")) continue;
392
398
  if (dutyEscalated.has(m.id)) continue;
393
399
  if ((state.peers[m.to]?.deliveredUpTo || 0) >= m.id) continue;
394
400
  dutyEscalated.add(m.id);
@@ -2260,6 +2266,25 @@ const server = http.createServer(async (req, res) => {
2260
2266
  // outcome: strictly by `re`, or, for seats that predate it, oldest-open-first. Broadcasts are
2261
2267
  // never contracts. Each open one carries the assignee's presence, because the actionable half
2262
2268
  // of "still waiting" is whether anyone is still on the other end.
2269
+ // ---- /delivered: an endpoint that has actually READ its mail says so ----------------------
2270
+ // The desktop app lists with peek=1 on purpose, so it never steals a message from a session's
2271
+ // delivery hooks. For a HUMAN endpoint there are no hooks — the app is the only reader — so
2272
+ // sasha@mac's deliveredUpTo sat at 0 forever while mail piled up. dutyTick then escalated every
2273
+ // message the human had already read, told the duty seat about it, the seat messaged the human,
2274
+ // and that was undelivered too: about six escalations a minute, all about mail already read.
2275
+ // Peeking stays the default; this lets a reader record delivery explicitly instead.
2276
+ if (req.method === "POST" && P === "/delivered") {
2277
+ const b = await body(req);
2278
+ const session = String(b.session || "");
2279
+ if (!session) return json(res, 400, { error: "session required" });
2280
+ if (auth?.identity && String(auth.identity.name || "") !== session) {
2281
+ return json(res, 403, { error: "session must match signer" });
2282
+ }
2283
+ touch(session, undefined, undefined, undefined, auth);
2284
+ markDelivered(session, Number(b.upTo || 0));
2285
+ return json(res, 200, { ok: true, deliveredUpTo: state.peers[session]?.deliveredUpTo || 0 });
2286
+ }
2287
+
2263
2288
  if (req.method === "GET" && P === "/contracts") {
2264
2289
  const session = String(q.session || "");
2265
2290
  if (!session) return json(res, 400, { error: "session required" });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trantor",
3
- "version": "0.17.94",
3
+ "version": "0.17.96",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "trantor": "bin/cli.mjs"
@@ -11,7 +11,7 @@
11
11
  "zod": "^4.4.3"
12
12
  },
13
13
  "scripts": {
14
- "test": "node bin/slop-gate.mjs --surface desktop/src && node test.mjs && node test-scenarios.mjs && node test-failure.mjs && node test-redelivery.mjs && node test-crew-completion.mjs && node test-contracts.mjs && node test-handoff.mjs && node test-handoff-summarizer.mjs && node test-agents.mjs && node test-update.mjs && node test-handoff-guard.mjs && node test-baton-latest.mjs && node test-balances.mjs && node test-subagent-cost.mjs && node test-inbox.mjs && node test-inflight.mjs && node test-notify.mjs && node test-focus.mjs && node test-cardlog.mjs && node test-relay-note.mjs && node test-reaper.mjs && node test-events.mjs && node test-proposals.mjs && node test-scrub.mjs && node test-store-delta.mjs && node test-message-re.mjs && node test-claims.mjs && node test-adopt.mjs && node test-summarize.mjs && node test-identity-core.mjs && node test-identity.mjs && node test-identity-instances.mjs && node test-duty.mjs && node test-duty-seat.mjs && node test-discovery.mjs && node test-doctor.mjs && node test-splitbrain.mjs && node test-overseer.mjs && node test-overseer-lib.mjs && node test-overseer-warn.mjs && node test-provider-keys.mjs && node test-inbox-delivery.mjs && node test-identity-drift.mjs && node test-seats.mjs && node test-seat-identity.mjs && node test-hub-routing.mjs && node test-hook-routing.mjs && node test-relay-wait.mjs && node test-dsh-seat.mjs && node test-kimi-bridge.mjs && node test-kimi-events.mjs && python3 engine/test-routing.py && node test-reconcile.mjs && node test-resources.mjs && node test-patrol.mjs && node test-bridge.mjs && bash test-crew.sh"
14
+ "test": "node bin/slop-gate.mjs --surface desktop/src && node test.mjs && node test-scenarios.mjs && node test-failure.mjs && node test-redelivery.mjs && node test-crew-completion.mjs && node test-contracts.mjs && node test-handoff.mjs && node test-handoff-summarizer.mjs && node test-agents.mjs && node test-update.mjs && node test-handoff-guard.mjs && node test-baton-latest.mjs && node test-balances.mjs && node test-subagent-cost.mjs && node test-inbox.mjs && node test-inflight.mjs && node test-notify.mjs && node test-focus.mjs && node test-cardlog.mjs && node test-relay-note.mjs && node test-reaper.mjs && node test-events.mjs && node test-proposals.mjs && node test-scrub.mjs && node test-store-delta.mjs && node test-message-re.mjs && node test-claims.mjs && node test-adopt.mjs && node test-summarize.mjs && node test-identity-core.mjs && node test-identity.mjs && node test-identity-instances.mjs && node test-duty.mjs && node test-duty-seat.mjs && node test-discovery.mjs && node test-doctor.mjs && node test-splitbrain.mjs && node test-overseer.mjs && node test-overseer-lib.mjs && node test-overseer-warn.mjs && node test-provider-keys.mjs && node test-inbox-delivery.mjs && node test-identity-drift.mjs && node test-inbox-staleness.mjs && node test-seats.mjs && node test-seat-identity.mjs && node test-hub-routing.mjs && node test-hook-routing.mjs && node test-relay-wait.mjs && node test-dsh-seat.mjs && node test-kimi-bridge.mjs && node test-kimi-events.mjs && python3 engine/test-routing.py && node test-reconcile.mjs && node test-resources.mjs && node test-patrol.mjs && node test-bridge.mjs && bash test-crew.sh"
15
15
  },
16
16
  "description": "The hub-world for AI agent crews \u2014 orchestrate Claude Code, Codex, GLM, Kimi, DeepSeek & any OpenRouter model as live crews with a plan-aware Advisor, a Kanban/flow command center, a testing gate, and an economics brain (Scrooge).",
17
17
  "files": [