agent-coord-mcp 0.26.21 → 0.26.22

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.
Files changed (62) hide show
  1. package/dist/capabilities.js +250 -2
  2. package/dist/capabilities.js.map +1 -1
  3. package/dist/closing-line.js +83 -0
  4. package/dist/closing-line.js.map +1 -0
  5. package/dist/commit-cite.js +55 -0
  6. package/dist/commit-cite.js.map +1 -0
  7. package/dist/gated-head.js +67 -20
  8. package/dist/gated-head.js.map +1 -1
  9. package/dist/server-spread.js +195 -0
  10. package/dist/server-spread.js.map +1 -0
  11. package/dist/server.js +2 -2
  12. package/dist/server.js.map +1 -1
  13. package/dist/store.js +32 -0
  14. package/dist/store.js.map +1 -1
  15. package/dist/tools/away.js +67 -7
  16. package/dist/tools/away.js.map +1 -1
  17. package/dist/tools/board-ref.js +44 -4
  18. package/dist/tools/board-ref.js.map +1 -1
  19. package/dist/tools/event-kinds.js +5 -1
  20. package/dist/tools/event-kinds.js.map +1 -1
  21. package/dist/tools/events.js +31 -2
  22. package/dist/tools/events.js.map +1 -1
  23. package/dist/tools/messaging.js +64 -6
  24. package/dist/tools/messaging.js.map +1 -1
  25. package/dist/tools/record-events.js +85 -5
  26. package/dist/tools/record-events.js.map +1 -1
  27. package/dist/tools/records.js +231 -38
  28. package/dist/tools/records.js.map +1 -1
  29. package/dist/tools/registry.js +52 -2
  30. package/dist/tools/registry.js.map +1 -1
  31. package/dist/tools/seat-build.js +173 -0
  32. package/dist/tools/seat-build.js.map +1 -0
  33. package/dist/tools/shared.js.map +1 -1
  34. package/dist/tools/stall.js +1095 -18
  35. package/dist/tools/stall.js.map +1 -1
  36. package/dist/tools/transport.js +21 -2
  37. package/dist/tools/transport.js.map +1 -1
  38. package/dist/tools/worktrees.js +14 -0
  39. package/dist/tools/worktrees.js.map +1 -1
  40. package/package.json +1 -1
  41. package/scripts/coord-attention-clock.mjs +2 -0
  42. package/scripts/coord-stall-clock.mjs +52 -11
  43. package/src/capabilities.ts +264 -2
  44. package/src/closing-line.ts +85 -0
  45. package/src/commit-cite.ts +58 -0
  46. package/src/gated-head.ts +128 -26
  47. package/src/server-spread.ts +233 -0
  48. package/src/server.ts +2 -2
  49. package/src/store.ts +32 -0
  50. package/src/tools/away.ts +82 -9
  51. package/src/tools/board-ref.ts +70 -3
  52. package/src/tools/event-kinds.ts +17 -1
  53. package/src/tools/events.ts +33 -2
  54. package/src/tools/messaging.ts +63 -6
  55. package/src/tools/record-events.ts +78 -5
  56. package/src/tools/records.ts +248 -38
  57. package/src/tools/registry.ts +54 -3
  58. package/src/tools/seat-build.ts +194 -0
  59. package/src/tools/shared.ts +22 -0
  60. package/src/tools/stall.ts +1266 -23
  61. package/src/tools/transport.ts +21 -2
  62. package/src/tools/worktrees.ts +13 -0
@@ -33,6 +33,7 @@ import { promises as fsp } from "node:fs";
33
33
  import { spawn, spawnSync } from "node:child_process";
34
34
  import { fileURLToPath } from "node:url";
35
35
  import { z } from "zod";
36
+ import { seatBuildOf, installedFrom, psReader } from "./seat-build.js";
36
37
  import path from "node:path";
37
38
  import {
38
39
  AGENTS_FILE,
@@ -157,12 +158,17 @@ export async function pingTool(args: { from: string; to: string; echo?: boolean
157
158
 
158
159
  let echoSent = false;
159
160
  if (args.echo && alive) {
160
- await sendMessageTool({
161
+ // ⟨q-138f4b78⟩ — the echo is an agent→agent DM, so past the typed-record
162
+ // cutover it MUST carry a record or the send is refused; and `echoSent`
163
+ // reports what the send SAID, never that a call was made — measured on the
164
+ // cutover morning: this reported true while nothing was written.
165
+ const sent = await sendMessageTool({
161
166
  from: args.from,
162
167
  to: args.to,
163
168
  text: `PING: echo requested by ${args.from} — DM back if responsive.`,
169
+ record: { type: "fyi", payload: { summary: `PING echo requested by ${args.from}` } },
164
170
  });
165
- echoSent = true;
171
+ echoSent = sent.ok === true;
166
172
  }
167
173
 
168
174
  return {
@@ -899,9 +905,22 @@ export async function statusTool(args: { agentId: string }) {
899
905
  // is the case every other instrument here reports as if the fleet were one
900
906
  // thing.
901
907
  const capabilities = await capabilitiesTool();
908
+ // ⟨q-8a3f1c05⟩ — THIS SEAT'S BUILD STATE, both halves: the pusher from its marker's
909
+ // pid via ps (keyed by --agent), the server from THIS process — status is called
910
+ // by the seat about itself, which is the one case the server half is knowable.
911
+ const id = resolveServerIdentity();
912
+ const installed = installedFrom(id.path);
913
+ const build = seatBuildOf({
914
+ agentId: args.agentId,
915
+ marker: transport,
916
+ installed,
917
+ ps: psReader,
918
+ server: { pid: process.pid, startedAt: Date.now() - Math.round(process.uptime() * 1000), buildMtime: installed.buildMtime },
919
+ });
902
920
 
903
921
  return {
904
922
  agentId: args.agentId,
923
+ build,
905
924
  registered: !!entry,
906
925
  entry,
907
926
  attached: !!transport,
@@ -215,12 +215,25 @@ async function create(a: {
215
215
  } catch (e) {
216
216
  return { ok: false as const, error: `git worktree add failed: ${String((e as Error).message).split("\n")[0]}` };
217
217
  }
218
+ // ⟨q-7b2f6c04⟩ — THE EMPTY PUSH AT CLAIM. The branch goes to origin at the
219
+ // base's tip, so the lane has a ref on the remote from its first minute: the
220
+ // VCS axis sees it, and the stall clock scores it on the CLAIM axis (a ref
221
+ // sitting on the base has no commits of its own to date). Best-effort and
222
+ // REPORTED, never fatal — a tree cut offline is still a tree.
223
+ let pushed: { ok: true; ref: string } | { ok: false; why: string };
224
+ try {
225
+ execFileSync("git", ["push", "-q", "-u", "origin", `${branch}:refs/heads/${branch}`], { cwd: repo, encoding: "utf8", stdio: ["ignore", "pipe", "pipe"], timeout: 20_000 });
226
+ pushed = { ok: true, ref: `origin/${branch}` };
227
+ } catch (e) {
228
+ pushed = { ok: false, why: `the empty claim-time push did not land: ${String((e as Error).message).split("\n").find((l) => l.trim()) ?? "unknown"} — the lane is observable on the claim axis from the board's history only` };
229
+ }
218
230
  return {
219
231
  ok: true as const,
220
232
  path: target,
221
233
  sha,
222
234
  branch,
223
235
  created: true,
236
+ pushed,
224
237
  base: ref,
225
238
  // Cut from `sha`, which IS origin/<base> — true by construction here, and
226
239
  // stated so callers need not special-case "created" to know it.