tryharness 0.7.73 → 0.7.76

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 (49) hide show
  1. package/assets/pi-extension.ts +7 -1
  2. package/cli.mjs +67 -4
  3. package/lib/actorRoster.mjs +20 -9
  4. package/lib/adoption.mjs +5 -3
  5. package/lib/audit.mjs +7 -2
  6. package/lib/boardFiles.mjs +4 -2
  7. package/lib/boardMirror.mjs +2 -0
  8. package/lib/boardProtocol.json +4 -0
  9. package/lib/bridge.mjs +3 -0
  10. package/lib/capabilityCheck.mjs +39 -3
  11. package/lib/coordinator.mjs +480 -117
  12. package/lib/daemon.mjs +74 -21
  13. package/lib/dispatcher.mjs +568 -0
  14. package/lib/goalCommands.mjs +21 -6
  15. package/lib/handoffs.mjs +8 -7
  16. package/lib/handover.mjs +2 -2
  17. package/lib/inference.mjs +53 -3
  18. package/lib/jobAnswers.mjs +7 -6
  19. package/lib/lessons.mjs +6 -1
  20. package/lib/library.mjs +83 -7
  21. package/lib/lineup.mjs +17 -9
  22. package/lib/localAgentAsk.mjs +68 -29
  23. package/lib/localStack.mjs +19 -3
  24. package/lib/localmodels.mjs +59 -25
  25. package/lib/machineRoutes.mjs +1 -0
  26. package/lib/manager.mjs +97 -52
  27. package/lib/mcp-stdio.mjs +14 -7
  28. package/lib/members.json +5 -1
  29. package/lib/members.mjs +21 -1
  30. package/lib/moves.mjs +15 -2
  31. package/lib/nudge.mjs +5 -0
  32. package/lib/plans.mjs +2 -1
  33. package/lib/projects.mjs +16 -9
  34. package/lib/runAuthority.mjs +2 -1
  35. package/lib/runBrief.mjs +2 -2
  36. package/lib/runWorker.mjs +6 -6
  37. package/lib/snippets.mjs +5 -5
  38. package/lib/store.mjs +79 -10
  39. package/lib/swarm.mjs +56 -12
  40. package/lib/taskCommands.mjs +8 -8
  41. package/lib/taskRooms.mjs +6 -8
  42. package/lib/team.mjs +5 -3
  43. package/lib/threadActions.mjs +6 -30
  44. package/lib/threadAuthority.mjs +16 -3
  45. package/lib/threadRuns.mjs +26 -16
  46. package/lib/verdicts.mjs +2 -2
  47. package/npm-shrinkwrap.json +14 -14
  48. package/package.json +4 -4
  49. package/release.json +50 -49
@@ -208,7 +208,13 @@ export default function tryHarness(pi) {
208
208
  const board = await harness().catch(() => null);
209
209
  if (!board) return undefined;
210
210
  await board.notePrompt(AGENT, where(ctx), pids);
211
- const text = [await said(board, ctx), await board.boardNudge(AGENT)]
211
+ // What every agent with an MCP client reads in the handshake, then the queue. An older runtime has no
212
+ // HARNESS_INSTRUCTIONS and gives the queue alone.
213
+ const text = [
214
+ await said(board, ctx),
215
+ board.HARNESS_INSTRUCTIONS,
216
+ await board.boardNudge(AGENT),
217
+ ]
212
218
  .filter(Boolean)
213
219
  .join("\n\n");
214
220
  if (!text || typeof event?.systemPrompt !== "string") return undefined;
package/cli.mjs CHANGED
@@ -36,6 +36,7 @@ import pc from "picocolors";
36
36
  import { removeLocalWakes } from "./lib/wakes.mjs";
37
37
  import { detectAgents } from "./lib/commands.mjs";
38
38
  import { PROPOSERS, nameOf } from "./lib/members.mjs";
39
+ import { describeDispatcher } from "./lib/dispatcher.mjs";
39
40
  import { daemonRequest } from "./lib/control-client.mjs";
40
41
  import { ensureDir, readJson, writeJsonAtomic } from "./lib/files.mjs";
41
42
  import { hostApp, processTable } from "./lib/live.mjs";
@@ -1562,7 +1563,7 @@ async function goal() {
1562
1563
  if (!response.ok) throw new Error(response.error || "the goal was not set");
1563
1564
  const g = response.task;
1564
1565
  console.log(
1565
- `Goal ${g.id} is set. ${g.goal.facilitator} facilitates; the team is ${g.goal.team.join(", ")}${g.goal.workspace ? `; coding agents work in ${g.goal.workspace}` : ""}. Follow it: ${relayCommand()} goal show ${g.id}`
1566
+ `Goal ${g.id} is set. ${nameOf(g.goal.facilitator)} facilitates; the team is ${g.goal.team.join(", ")}${g.goal.workspace ? `; coding agents work in ${g.goal.workspace}` : ""}. Follow it: ${relayCommand()} goal show ${g.id}`
1566
1567
  );
1567
1568
  return;
1568
1569
  }
@@ -1715,6 +1716,68 @@ async function swarm() {
1715
1716
  );
1716
1717
  return;
1717
1718
  }
1719
+ // What fills the dispatcher slot (owner, November 1): the relay's LFM3-Omni or the person's own GGUF, a Surplus model
1720
+ // paid from their Harness account, an agent here on a model it offers, or an OpenAI-compatible endpoint of theirs.
1721
+ if (sub === "dispatcher") {
1722
+ const [kind, first, second] = argv.slice(1);
1723
+ if (kind === "models") {
1724
+ const response = await daemonRequest({
1725
+ command: "board.swarm.dispatcher",
1726
+ agent: "user",
1727
+ models: true,
1728
+ });
1729
+ if (!response.ok) throw new Error(response.error || "no models listed");
1730
+ if (!response.surplus)
1731
+ console.log(
1732
+ "Harness's server did not list its Surplus models just now."
1733
+ );
1734
+ else {
1735
+ console.log(
1736
+ "Surplus models (tryharness swarm dispatcher surplus <id>):"
1737
+ );
1738
+ for (const model of response.surplus)
1739
+ console.log(` ${model.id} ${model.name}`);
1740
+ }
1741
+ console.log(
1742
+ "An agent's models: tryharness agents models <agent>, then tryharness swarm dispatcher agent <agent> <model>"
1743
+ );
1744
+ return;
1745
+ }
1746
+ const setting = !kind
1747
+ ? undefined
1748
+ : kind === "local"
1749
+ ? { provider: "local", ...(first ? { file: path.resolve(first) } : {}) }
1750
+ : kind === "surplus"
1751
+ ? { provider: "surplus", model: first }
1752
+ : kind === "endpoint"
1753
+ ? {
1754
+ provider: "endpoint",
1755
+ url: first,
1756
+ ...(second ? { model: second } : {}),
1757
+ }
1758
+ : kind === "agent"
1759
+ ? {
1760
+ provider: "agent",
1761
+ agent: first,
1762
+ ...(second ? { model: second } : {}),
1763
+ }
1764
+ : { provider: kind };
1765
+ const response = await daemonRequest({
1766
+ command: "board.swarm.dispatcher",
1767
+ agent: "user",
1768
+ ...(setting ? { setting } : {}),
1769
+ });
1770
+ if (!response.ok)
1771
+ throw new Error(response.error || "the dispatcher was not changed");
1772
+ console.log(
1773
+ `The dispatcher is ${describeDispatcher(response.setting, nameOf)}.`
1774
+ );
1775
+ if (!kind)
1776
+ console.log(
1777
+ "To change it: tryharness swarm dispatcher local [your-model.gguf] | surplus <model> | agent <agent> [model] | endpoint <url> [model] (models lists the Surplus ones)"
1778
+ );
1779
+ return;
1780
+ }
1718
1781
  if (sub === "rounds") {
1719
1782
  const response = await daemonRequest({
1720
1783
  command: "board.swarm.rounds",
@@ -1832,12 +1895,12 @@ async function swarm() {
1832
1895
  }
1833
1896
  for (const d of response.days)
1834
1897
  console.log(
1835
- `${d.day} ${String(d.rounds).padStart(4)} rounds: Harness ${d.harness}, backup ${d.backup}, this computer ${d.local}, undecided ${d.undecided}`
1898
+ `${d.day} ${String(d.rounds).padStart(4)} rounds: Jev ${d.jev}, backup ${d.backup}, this computer ${d.local}, undecided ${d.undecided}`
1836
1899
  );
1837
1900
  return;
1838
1901
  }
1839
1902
  throw new Error(
1840
- "usage: tryharness swarm [rounds [<thread>] [--limit n] | health [<thread>] [--days n] | ceiling <thread> <dollars|off> | coordinator [harness|local]]"
1903
+ "usage: tryharness swarm [rounds [<thread>] [--limit n] | health [<thread>] [--days n] | ceiling <thread> <dollars|off> | coordinator [harness|local] | dispatcher [models | local [file.gguf] | surplus <model> | agent <agent> [model] | endpoint <url> [model]]]"
1841
1904
  );
1842
1905
  }
1843
1906
 
@@ -2682,7 +2745,7 @@ function installedLine() {
2682
2745
 
2683
2746
  function help() {
2684
2747
  console.log(
2685
- `tryharness ${VERSION}\n\n${installedLine()}Commands:\n tryharness set up everything and start the daemon\n tryharness upgrade [version] fetch a newer release, check it is signed with Harness's release key, then set it up\n tryharness desktop open the Harness desktop app (setup opens it too; --no-desktop skips it)\n tryharness status show daemon, bridge, agent, and index health\n tryharness doctor diagnose the complete connection\n tryharness local [learn] the relay's local models, where they run, what is indexed and the last learning\n tryharness local on|off search over your Desktop, Documents and Downloads by what is in the files (on by default)\n tryharness local add|remove <folder> another folder to search the same way\n tryharness watch [add <name> --run <command> [--every 5m] [--field f | --age f | --count text] [--above n] [--below n] | start <id> | remove <id>]\n watches the relay checks and says out loud only when they are off\n tryharness sync [--agent] rescan local coding history in the background\n tryharness task <id> --follow\n follow a delegated agent run in this terminal\n tryharness runs what your agents are running on this computer now\n tryharness steer <thread or run> "<words>" [--agent <agent>]\n tell an agent something while it works\n tryharness ssh [<cloud computer>] [--key <file>] [--print] [-- <command>]\n SSH into your cloud computer with your own key; it wakes if asleep\n tryharness board [--all] list open work on the machine's task board\n tryharness board post --for <agent> --objective <text> [--file <brief.md>]\n tryharness board show <id>\n tryharness board post --for codex --objective <text> --run --workspace <dir>\n the daemon runs it and reports back on the task\n tryharness board run <id> authorize a run an agent asked for\n tryharness board release <id>\n tryharness board agents when each agent last read the board\n tryharness board --watch follow the board in this terminal\n tryharness notify on|off desktop notifications for what waits on you\n tryharness usage-totals on|off daily counts of your swarm's work, without your account or any text (on by default)\n tryharness board send <task> <message> send a held reply to another person's agent\n tryharness board snippet [<id> share|keep] code an agent elsewhere asked to see; nothing leaves until you share it\n tryharness board auto <task> on|off auto-send replies on that thread\n tryharness board end <task> --outcome <text>\n tryharness board context <task> <query> search everything written about a task\n tryharness goal set --objective <text> [--team a,b] [--workspace <dir>] a goal your agents work together in one room\n tryharness goal [list | show <id> | stop <id> | resume <id>]\n tryharness room <goal> | room post <goal> <text> [--ask agent,agent]\n tryharness swarm rounds [<thread>] what the coordinator saw, chose and cost each round\n tryharness swarm health [<thread>] who decided each day's rounds: Harness, a backup, or no one\n tryharness swarm ceiling <thread> <dollars|off> what a thread may spend of your Harness credits\n tryharness swarm checkin <thread> "<what>" (--in 2h | --at 14:30 | --every 30m | --daily 09:00 [--days mon-fri]) [--wake codex] [--times n] [--until <date>]\n the thread comes back on its own then, waking those agents or its lead\n tryharness swarm checkins [<thread>] [--all] | swarm checkin remove <id>\n tryharness swarm coordinator [harness|local] who coordinates your threads\n tryharness connect <handle/agent> --about <text> ask another person's agent to work an issue with yours, sealed to their computer\n tryharness peers the keys of other people's computers this one has worked with, to compare\n tryharness machines your computers: which holds the board (home) and which work through it; machines add <code> [--hosted] | name <name> | home | update <name> [version] | remove <name>\n tryharness backup [on | now | restore | off] an encrypted backup of your board, for Residents; only your passphrase opens it\n tryharness agents who is in your swarm, and who can be added\n tryharness agents add [<agent>…] put agents in your swarm; with no name, pick from the ones found here\n tryharness agents remove <agent> take an agent out of your swarm\n tryharness agents confirm <agent> the program Harness starts for an agent, after you install it somewhere new\n tryharness agents setup [<agent>] | agents test <agent> how Harness wakes each agent\n tryharness agents cards what each of your agents is told about the others\n tryharness agents note <agent> <text> [--clear] your own note on an agent's card, told to every other agent\n tryharness lessons [--replaced | --retired] | lessons remove <id> | lessons edit <id> "<text>"\n what your swarm learned from your words, to read, change or take out\n tryharness memory [dream | forget <id> | delete <post id> | back <id>]\n what your swarm keeps from its work, overnight; forget, delete or bring back\n tryharness agents models [<agent>] [--refresh] the models each coding agent lists and the one it runs on\n tryharness agents model <agent> <model> [--effort <level>] | auto | default the model it runs on; auto lets Harness pick per run\n tryharness agents routing "<text>" [--clear] how Auto picks models for your swarm\n tryharness connections on|off outside apps (Gmail, Calendar, Slack, Notion, Linear) for your agents; off by default\n tryharness connections connect apps, choose agent access and review approvals (connections catalog for providers)\n tryharness vault your secrets, kept on this computer: agents use them without seeing them (vault add <name> --hosts <host> | allow <agent> <name> | runs <agent> <name> <VARIABLE> | backup <email> | share <name>)\n tryharness mcp grok-bot print the MCP snippet that puts Grok Bot on the board\n tryharness link connect the browser you use Harness in to this computer, end to end (--print shows the link)\n tryharness phone pair show a QR code that pairs your phone with this computer\n tryharness phone list | revoke <id>\n tryharness t3 approve Harness in T3 Code once, so your messages go into its threads (t3 status | t3 forget)\n tryharness logs [--follow]\n tryharness uninstall [--everything] take Harness off this computer; --everything also deletes your board and history\n`
2748
+ `tryharness ${VERSION}\n\n${installedLine()}Commands:\n tryharness set up everything and start the daemon\n tryharness upgrade [version] fetch a newer release, check it is signed with Harness's release key, then set it up\n tryharness desktop open the Harness desktop app (setup opens it too; --no-desktop skips it)\n tryharness status show daemon, bridge, agent, and index health\n tryharness doctor diagnose the complete connection\n tryharness local [learn] the relay's local models, where they run, what is indexed and the last learning\n tryharness local on|off search over your Desktop, Documents and Downloads by what is in the files (on by default)\n tryharness local add|remove <folder> another folder to search the same way\n tryharness watch [add <name> --run <command> [--every 5m] [--field f | --age f | --count text] [--above n] [--below n] | start <id> | remove <id>]\n watches the relay checks and says out loud only when they are off\n tryharness sync [--agent] rescan local coding history in the background\n tryharness task <id> --follow\n follow a delegated agent run in this terminal\n tryharness runs what your agents are running on this computer now\n tryharness steer <thread or run> "<words>" [--agent <agent>]\n tell an agent something while it works\n tryharness ssh [<cloud computer>] [--key <file>] [--print] [-- <command>]\n SSH into your cloud computer with your own key; it wakes if asleep\n tryharness board [--all] list open work on the machine's task board\n tryharness board post --for <agent> --objective <text> [--file <brief.md>]\n tryharness board show <id>\n tryharness board post --for codex --objective <text> --run --workspace <dir>\n the daemon runs it and reports back on the task\n tryharness board run <id> authorize a run an agent asked for\n tryharness board release <id>\n tryharness board agents when each agent last read the board\n tryharness board --watch follow the board in this terminal\n tryharness notify on|off desktop notifications for what waits on you\n tryharness usage-totals on|off daily counts of your swarm's work, without your account or any text (on by default)\n tryharness board send <task> <message> send a held reply to another person's agent\n tryharness board snippet [<id> share|keep] code an agent elsewhere asked to see; nothing leaves until you share it\n tryharness board auto <task> on|off auto-send replies on that thread\n tryharness board end <task> --outcome <text>\n tryharness board context <task> <query> search everything written about a task\n tryharness goal set --objective <text> [--team a,b] [--workspace <dir>] a goal your agents work together in one room\n tryharness goal [list | show <id> | stop <id> | resume <id>]\n tryharness room <goal> | room post <goal> <text> [--ask agent,agent]\n tryharness swarm rounds [<thread>] what the coordinator saw, chose and cost each round\n tryharness swarm health [<thread>] who decided each day's rounds: Jev, a backup, or no one\n tryharness swarm ceiling <thread> <dollars|off> what a thread may spend of your Harness credits\n tryharness swarm checkin <thread> "<what>" (--in 2h | --at 14:30 | --every 30m | --daily 09:00 [--days mon-fri]) [--wake codex] [--times n] [--until <date>]\n the thread comes back on its own then, waking those agents or its lead\n tryharness swarm checkins [<thread>] [--all] | swarm checkin remove <id>\n tryharness swarm coordinator [harness|local] who coordinates your threads\n tryharness swarm dispatcher [models | local [file.gguf] | surplus <model> | agent <agent> [model] | endpoint <url> [model]]\n what words your threads and checks results: the relay's LFM3-Omni or your own model, a Surplus model, one of your agents, or your endpoint\n tryharness connect <handle/agent> --about <text> ask another person's agent to work an issue with yours, sealed to their computer\n tryharness peers the keys of other people's computers this one has worked with, to compare\n tryharness machines your computers: which holds the board (home) and which work through it; machines add <code> [--hosted] | name <name> | home | update <name> [version] | remove <name>\n tryharness backup [on | now | restore | off] an encrypted backup of your board, for Residents; only your passphrase opens it\n tryharness agents who is in your swarm, and who can be added\n tryharness agents add [<agent>…] put agents in your swarm; with no name, pick from the ones found here\n tryharness agents remove <agent> take an agent out of your swarm\n tryharness agents confirm <agent> the program Harness starts for an agent, after you install it somewhere new\n tryharness agents setup [<agent>] | agents test <agent> how Harness wakes each agent\n tryharness agents cards what each of your agents is told about the others\n tryharness agents note <agent> <text> [--clear] your own note on an agent's card, told to every other agent\n tryharness lessons [--replaced | --retired] | lessons remove <id> | lessons edit <id> "<text>"\n what your swarm learned from your words, to read, change or take out\n tryharness memory [dream | forget <id> | delete <post id> | back <id>]\n what your swarm keeps from its work, overnight; forget, delete or bring back\n tryharness agents models [<agent>] [--refresh] the models each coding agent lists and the one it runs on\n tryharness agents model <agent> <model> [--effort <level>] | auto | default the model it runs on; auto lets Harness pick per run\n tryharness agents routing "<text>" [--clear] how Auto picks models for your swarm\n tryharness connections on|off outside apps (Gmail, Calendar, Slack, Notion, Linear) for your agents; off by default\n tryharness connections connect apps, choose agent access and review approvals (connections catalog for providers)\n tryharness vault your secrets, kept on this computer: agents use them without seeing them (vault add <name> --hosts <host> | allow <agent> <name> | runs <agent> <name> <VARIABLE> | backup <email> | share <name>)\n tryharness mcp grok-bot print the MCP snippet that puts Grok Bot on the board\n tryharness link connect the browser you use Harness in to this computer, end to end (--print shows the link)\n tryharness phone pair show a QR code that pairs your phone with this computer\n tryharness phone list | revoke <id>\n tryharness t3 approve Harness in T3 Code once, so your messages go into its threads (t3 status | t3 forget)\n tryharness logs [--follow]\n tryharness uninstall [--everything] take Harness off this computer; --everything also deletes your board and history\n`
2686
2749
  );
2687
2750
  }
2688
2751
 
@@ -1,4 +1,8 @@
1
- import { CLOUD_HOMED, TARGETS as ROOM_AGENTS } from "./members.mjs";
1
+ import {
2
+ CLOUD_HOMED,
3
+ TARGETS as ROOM_AGENTS,
4
+ ids as membersWhere,
5
+ } from "./members.mjs";
2
6
  import { localWakes, LOCAL_WAKE_AGENTS } from "./wakes.mjs";
3
7
  import { swarmCards } from "./cards.mjs";
4
8
  import { nameOf } from "./members.mjs";
@@ -17,7 +21,11 @@ export function createActorRoster({
17
21
  computersWith = () => [],
18
22
  }) {
19
23
  const RUNNERS = authority.RUNNERS;
20
- const CLOUD_AGENTS = new Set(CLOUD_HOMED);
24
+ // The agents that work on or through Harness's server (Harness, Bankr, Quotient, Muse): askable while connected.
25
+ const CLOUD_AGENTS = new Set([
26
+ ...CLOUD_HOMED,
27
+ ...membersWhere((entry) => entry.target && entry.runs === "server"),
28
+ ]);
21
29
  // What each agent that runs elsewhere needs before it picks up work by itself (Grok Bot, Muse), as Harness last said
22
30
  // (`agent_setup`, sent on connect and on every change); OpenClaw and Hermes are set up and woken here.
23
31
  let cloudSetup = new Map();
@@ -57,15 +65,18 @@ export function createActorRoster({
57
65
  return `${nameOf(agent)} is not answering right now, so this waits until it does.`;
58
66
  return null;
59
67
  };
60
- /** The agents this person can ask right now, of those in their swarm: coding agents installed here, the server's while connected, any agent that has used the board, and those Harness says can be set up. */
68
+ /** The agents this person can ask right now, of those in their swarm: coding agents installed here, the server's while connected, any agent that has used the board, and those Harness says can be set up. Harness is one of the server's, by the same rule. */
61
69
  const available = () => {
62
70
  const seen = new Set(store.agentsSeen().map((row) => row.agent));
63
71
  const woken = localWakes();
64
- return ROOM_AGENTS.filter(
65
- (agent) =>
66
- agent === "harness" ||
67
- // A coding agent is in the lineup of the computer it runs on, which runs it only then (installedAgents).
68
- (RUNNERS.has(agent)
72
+ return ROOM_AGENTS.filter((agent) =>
73
+ // Harness takes work through Harness's server or the person's own Harness window, and its part waits on the board
74
+ // for a window when neither is there: it can always be asked while it is in the swarm, as an installed coding
75
+ // agent can (the e2e desktop-island run of 0.7.76 refused work for it with this computer off Harness).
76
+ agent === "harness"
77
+ ? inLineup(agent)
78
+ : // A coding agent is in the lineup of the computer it runs on, which runs it only then (installedAgents).
79
+ RUNNERS.has(agent)
69
80
  ? installedAgents.includes(agent) ||
70
81
  computersWith(agent).some((computer) => !computer.here)
71
82
  : inLineup(agent) &&
@@ -73,7 +84,7 @@ export function createActorRoster({
73
84
  ? connected()
74
85
  : seen.has(agent) ||
75
86
  Boolean(woken[agent]) ||
76
- cloudSetup.has(agent)))
87
+ cloudSetup.has(agent))
77
88
  );
78
89
  };
79
90
  // Each agent's card (cards.mjs) as every other agent is told it, its setup included; `lessons`: what the person said
package/lib/adoption.mjs CHANGED
@@ -7,6 +7,8 @@
7
7
  // The tool's own listing of the thread stops showing in Harness (environments.mjs `adopted`), so the person sees one
8
8
  // thread.
9
9
 
10
+ import { DISPATCHER } from "./members.mjs";
11
+
10
12
  const INDEX_KEY = "adopted";
11
13
  const recordKey = (outsideId) => `adopted:${outsideId}`;
12
14
  const fromKey = (threadId) => `adopted-from:${threadId}`;
@@ -79,13 +81,13 @@ export function createAdoption({
79
81
  if (kept) return { ok: true, thread: kept.thread, runs: kept.runs };
80
82
  const { thread: outside, runs, posts } = read;
81
83
  const root = runs.find((run) => run.id === outsideId) ?? runs[0];
82
- const team = [...new Set([...outside.agents.filter(agentHere), "harness"])];
84
+ const team = [...new Set(outside.agents.filter(agentHere))];
83
85
  const thread = store.createGoal({
84
86
  objective: String(outside.title || "Work from T3 Code").slice(0, 120),
85
87
  originAgent: "user",
86
88
  provenance: provenanceFor("user"),
87
89
  team,
88
- facilitator: "harness",
90
+ facilitator: DISPATCHER,
89
91
  workspace: outside.folder ?? root?.folder ?? null,
90
92
  maxPosts: defaults.maxPosts,
91
93
  maxWakes: defaults.maxWakes,
@@ -101,7 +103,7 @@ export function createAdoption({
101
103
  store.meta(`t3-thread:${thread.id}:${root.agent}`, root.source.threadId);
102
104
  store.roomPost({
103
105
  goalId: thread.id,
104
- author: "harness",
106
+ author: DISPATCHER,
105
107
  kind: "note",
106
108
  text: `This thread started in ${outside.source?.environmentName ?? "T3 Code"}. What was said there is below; ${root ? `${root.agent}'s next turn carries on in the same session there` : "its session stays there"}.`,
107
109
  });
package/lib/audit.mjs CHANGED
@@ -1,5 +1,10 @@
1
1
  import fs from "node:fs";
2
- import { CLOUD_HOMED, MACHINE_RUNNERS, nameOf } from "./members.mjs";
2
+ import {
3
+ CLOUD_HOMED,
4
+ DISPATCHER,
5
+ MACHINE_RUNNERS,
6
+ nameOf,
7
+ } from "./members.mjs";
3
8
  import { receiptOfTransaction, receiptsForThread } from "./book.mjs";
4
9
  import { offices } from "./specialties.mjs";
5
10
  import { underperforming } from "./record.mjs";
@@ -535,7 +540,7 @@ export function createAuditor({
535
540
  const task = store.postTask({
536
541
  objective: `Weekly audit, ${from.slice(0, 10)} to ${to.slice(0, 10)}`,
537
542
  brief: weekBrief(weekRecord(store, from), from, to),
538
- originAgent: "harness",
543
+ originAgent: DISPATCHER,
539
544
  targetAgent: holder.agent,
540
545
  // The person's appointment is their go for this one read-only run; an agent that runs itself picks it up.
541
546
  runWorkspace: runs ? folder : null,
@@ -17,7 +17,7 @@ import { ensureModels } from "./localmodels.mjs";
17
17
  import { scrubDeep } from "./firewall.mjs";
18
18
  import { imageKind } from "./ocr.mjs";
19
19
  import { REDACTION_VERSION, describeMasked, redactImage } from "./redact.mjs";
20
- import { nameOf } from "./members.mjs";
20
+ import { DISPATCHER, nameOf } from "./members.mjs";
21
21
  import { roomPage } from "./roomPage.mjs";
22
22
 
23
23
  // A file one agent hands another, of any type. Its bytes stay in ~/.harness/files under their SHA-256; Harness carries
@@ -288,7 +288,7 @@ export function createBoardFiles({
288
288
  id,
289
289
  taskId: file.task_id,
290
290
  kind: "note",
291
- author: "harness",
291
+ author: DISPATCHER,
292
292
  text: `Hid ${found.count} thing${found.count === 1 ? "" : "s"} in ${file.name} before ${reader}: ${found.text}.`,
293
293
  source: `file:${file.id}`,
294
294
  });
@@ -514,6 +514,8 @@ export function createBoardFiles({
514
514
  ["done", "failed"].includes(task.status) &&
515
515
  place.kind === "goal" &&
516
516
  place.status === "open" &&
517
+ task.origin_agent !== DISPATCHER &&
518
+ // Asked before the dispatcher facilitated threads.
517
519
  task.origin_agent !== "harness"
518
520
  ) {
519
521
  const forWhom =
@@ -54,6 +54,8 @@ export const MIRRORED = {
54
54
  board_pins: ["specialty"],
55
55
  board_offices: ["office"],
56
56
  board_specialty_benchmarks: ["agent", "model", "effort", "specialty"],
57
+ // The person's choices for the whole swarm (the dispatcher slot), so they follow home when it moves.
58
+ board_settings: ["key"],
57
59
  };
58
60
  // The person's grants, made on whichever computer was home: never taken from a board a computer kept on its own.
59
61
  const AUTHORITY_TABLES = new Set(["board_standing", "board_offices"]);
@@ -125,6 +125,7 @@
125
125
  "board.swarm.checkin.remove": "swarm",
126
126
  "board.swarm.checkins": "swarm",
127
127
  "board.swarm.coordinator": "swarm",
128
+ "board.swarm.dispatcher": "swarm",
128
129
  "board.swarm.diff": "swarm",
129
130
  "board.swarm.discard": "swarm",
130
131
  "board.swarm.file": "swarm",
@@ -323,6 +324,7 @@
323
324
  "board.swarm.resume",
324
325
  "board.swarm.folder",
325
326
  "board.swarm.coordinator",
327
+ "board.swarm.dispatcher",
326
328
  "board.swarm.diff",
327
329
  "board.swarm.merge",
328
330
  "board.swarm.discard",
@@ -422,6 +424,7 @@
422
424
  "board.swarm.resume",
423
425
  "board.swarm.folder",
424
426
  "board.swarm.coordinator",
427
+ "board.swarm.dispatcher",
425
428
  "board.swarm.diff",
426
429
  "board.swarm.merge",
427
430
  "board.swarm.discard",
@@ -631,6 +634,7 @@
631
634
  "board.swarm.resume",
632
635
  "board.swarm.folder",
633
636
  "board.swarm.coordinator",
637
+ "board.swarm.dispatcher",
634
638
  "board.swarm.diff",
635
639
  "board.swarm.merge",
636
640
  "board.swarm.discard",
package/lib/bridge.mjs CHANGED
@@ -33,6 +33,8 @@ const SCRUBBED = new Set([
33
33
  "coordinate",
34
34
  // The swarm's manager (manager.mjs): what the person's message is, and where their asks stand.
35
35
  "manage",
36
+ // The dispatcher slot on a Surplus model (dispatcher.mjs): one job's words.
37
+ "dispatch_write",
36
38
  "pick_folder",
37
39
  "route_model",
38
40
  "check_work",
@@ -48,6 +50,7 @@ const SCRUBBED = new Set([
48
50
  // Work that acts (board calls, Harness's own tasks) keeps them, as Bankr needs the real address.
49
51
  const DECIDE_ONLY = new Set([
50
52
  "coordinate",
53
+ "dispatch_write",
51
54
  "pick_folder",
52
55
  "route_model",
53
56
  "check_work",
@@ -6,11 +6,12 @@ import { askLocalAgent, LOCAL_DECIDERS } from "./localAgentAsk.mjs";
6
6
  // features any one person's machines happen to have.
7
7
 
8
8
  const ANSWERS = ["yes", "no", "unknown"];
9
+ const LOOKERS = ["codex", ...LOCAL_DECIDERS.filter((id) => id !== "codex")];
9
10
 
10
11
  const question = (label, work) =>
11
12
  [
12
13
  `You are checking the computer "${label}" for the person who owns it. Their swarm of agents may send the work below to this computer.`,
13
- "Look at this computer to see whether it can do that work: what is installed, set up and available here that the work needs. Change nothing.",
14
+ "Look at this computer to see whether it can do that work: what is installed, set up and available here that the work needs. You may run commands that only read (for example a version or a device listing) and read any folder. Change nothing.",
14
15
  'Answer with only this JSON: {"answer": "yes" | "no" | "unknown", "why": "one sentence naming what you found"}.',
15
16
  "",
16
17
  "The work:",
@@ -35,7 +36,10 @@ export function createCapabilityCheck({
35
36
  }) {
36
37
  /** This computer's answer for `work`, from the first agent here that can look. */
37
38
  const answer = async (work) => {
38
- const agent = LOCAL_DECIDERS.find((id) => installedAgents.includes(id));
39
+ // Codex first: its read-only sandbox lets it run commands that change nothing (python3 --version, nvidia-smi) with
40
+ // the operating system refusing every write. Claude Code with only Read, Glob and Grep could not see /opt/homebrew
41
+ // and answered "no" for this Mac in the owner's A1 test (November 1).
42
+ const agent = LOOKERS.find((id) => installedAgents.includes(id));
39
43
  if (!agent) return unknown("no agent on this computer can look");
40
44
  try {
41
45
  return shaped(
@@ -82,5 +86,37 @@ export function createCapabilityCheck({
82
86
  return Promise.all(asked);
83
87
  };
84
88
 
85
- return { answer, check };
89
+ // The person's other computers online now.
90
+ const othersOnline = () => {
91
+ const here = machine();
92
+ return (ownMachines()?.all() ?? []).filter(
93
+ (computer) => computer.id !== here.id && computer.connected
94
+ );
95
+ };
96
+
97
+ /** Whether there is a computer to choose: another of the person's computers is online. */
98
+ const choosing = () => othersOnline().length > 0;
99
+
100
+ /** One computer's answer for `work`: this one for its own id or none, another over the person's own link. */
101
+ const on = async (id, work) => {
102
+ const here = machine();
103
+ if (!id || id === here.id) return answer(work);
104
+ const computer = othersOnline().find((each) => each.id === id);
105
+ if (!computer || computer.unanswered)
106
+ return unknown("the computer did not answer");
107
+ const reply = await ownMachines().capabilityOf(id, work);
108
+ return reply ? shaped(reply) : unknown("the computer did not answer");
109
+ };
110
+
111
+ /** A computer's name as the person knows it. */
112
+ const labelOf = (id) =>
113
+ !id || id === machine().id
114
+ ? machine().label
115
+ : ((ownMachines()?.all() ?? []).find((each) => each.id === id)?.label ??
116
+ "That computer");
117
+
118
+ /** This computer's id, for an answer kept beside it. */
119
+ const here = () => machine().id;
120
+
121
+ return { answer, check, choosing, on, labelOf, here };
86
122
  }