tryharness 0.7.71 → 0.7.73

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 (57) hide show
  1. package/README.md +13 -8
  2. package/assets/opencode-plugin.js +70 -3
  3. package/cli.mjs +27 -12
  4. package/lib/asks.mjs +4 -0
  5. package/lib/boardCommands.mjs +9 -1
  6. package/lib/boardProtocol.json +23 -19
  7. package/lib/bridge.mjs +2 -0
  8. package/lib/capabilityCheck.mjs +86 -0
  9. package/lib/computerAddress.mjs +6 -14
  10. package/lib/coordinator.mjs +259 -30
  11. package/lib/daemon.mjs +164 -133
  12. package/lib/dispatchContract.json +1 -31
  13. package/lib/dispatchTools.js +8 -39
  14. package/lib/dispatches.mjs +27 -285
  15. package/lib/goalCommands.mjs +21 -38
  16. package/lib/herdr.mjs +159 -0
  17. package/lib/hookDialects.mjs +36 -2
  18. package/lib/jobAnswers.mjs +3 -0
  19. package/lib/kanban.mjs +256 -0
  20. package/lib/live.mjs +25 -3
  21. package/lib/localAgentAsk.mjs +20 -29
  22. package/lib/machineRoutes.mjs +1 -5
  23. package/lib/machineRuns.mjs +42 -22
  24. package/lib/manager.mjs +254 -0
  25. package/lib/mcp-stdio.mjs +58 -39
  26. package/lib/moves.mjs +365 -0
  27. package/lib/nudge.mjs +13 -3
  28. package/lib/ownMachines.mjs +122 -12
  29. package/lib/places.mjs +29 -2
  30. package/lib/plans.mjs +7 -1
  31. package/lib/projectSettings.mjs +11 -1
  32. package/lib/projects.mjs +20 -4
  33. package/lib/runAuthority.mjs +104 -35
  34. package/lib/runBrief.mjs +14 -1
  35. package/lib/runWorker.mjs +48 -24
  36. package/lib/runner.mjs +184 -75
  37. package/lib/selfUpdate.mjs +41 -0
  38. package/lib/serverWords.mjs +11 -11
  39. package/lib/sessionControl.mjs +68 -3
  40. package/lib/steerHook.mjs +124 -0
  41. package/lib/steerQueue.mjs +176 -0
  42. package/lib/store.mjs +34 -34
  43. package/lib/subagentSteering.mjs +363 -0
  44. package/lib/subagents.mjs +138 -29
  45. package/lib/swarm.mjs +16 -3
  46. package/lib/taskCommands.mjs +36 -71
  47. package/lib/threadActions.mjs +13 -3
  48. package/lib/threadAuthority.mjs +21 -14
  49. package/lib/threadBriefs.mjs +9 -3
  50. package/lib/threadRuns.mjs +35 -8
  51. package/npm-shrinkwrap.json +14 -14
  52. package/package.json +4 -4
  53. package/release.json +54 -49
  54. package/lib/comfyExecution.mjs +0 -545
  55. package/lib/promptDecider.mjs +0 -471
  56. package/lib/promptFlow.mjs +0 -562
  57. package/lib/promptScopes.mjs +0 -670
package/README.md CHANGED
@@ -350,14 +350,19 @@ authorizes it with `tryharness board run <id>`) is claimed by the daemon in that
350
350
  run non-interactively through the same runner as a delegated run, and reported back on the
351
351
  task with the result and the agent's session id; `tryharness task <id> --follow` works on it.
352
352
  One run per agent at a time; a daemon restart marks a running task unknown.
353
- A coding agent also starts, without `board run`, the tasks you or Harness post for it with a workspace in a
354
- folder it has already worked in (its indexed sessions; your home folder counts only as itself, links are
355
- followed), up to 10 a day. That is on by default, and the daemon says so once when it first starts with it. A
356
- task Claude Code or Codex posts from a session you typed in counts as yours: the prompt hook tells the daemon
357
- which agent process you typed in, and a post through that process's board MCP is yours. A run the daemon
358
- started is never your session, and an agent holding a task another agent wrote posts as an agent until it
359
- reports. Any other task another agent wrote, anything continuing one, or one Harness posts from a turn you did
360
- not start or while working another agent's task, always waits for you. `tryharness board standing` shows it; `tryharness board standing <agent> <folder>...
353
+ A coding agent also starts, without `board run`, the tasks you, Harness or any of your own agents post for it, in
354
+ any folder below your home (your home folder itself and anything outside it are not covered; links are followed).
355
+ That is on by default, and the daemon says so once when it first starts with it. Its limits are the ones you set:
356
+ off, named folders and a daily cap, or `--from` to choose which of your agents may start it. By default there is no
357
+ daily cap; instead, past 10 hand-offs in a row between your agents with no word from you, the next one waits. Words the local injection guard
358
+ reads as orders aimed at your agents, or words through Harness's server it could not read, also wait; a flag is only
359
+ a label. A task with no folder runs in its thread's scratch folder, and your Start always works on one that waits.
360
+ Different agents work in one folder side by side; one agent takes one turn at a time there. A task Claude Code or
361
+ Codex posts from a session you typed in counts as yours. Work another person's agents ask for runs held in: Claude
362
+ Code or Codex in restricted mode in a copy of the folder, with none of your credentials, screen, memory,
363
+ conversations, library, wallet or secrets in reach and no network. It reads only its own folder, git's folder for
364
+ its repository and the programs it builds with, nothing else of yours, until you press Start; Pi and OpenCode wait
365
+ for you. `tryharness board standing` shows it; `tryharness board standing <agent> <folder>...
361
366
  [--cap <n>]` names the folders instead; `tryharness board standing <agent> off` and `on` turn it off or back to
362
367
  the default. An interactive
363
368
  claim carries a lease (default 60 minutes); a lapsed lease shows the claim as stale and only
@@ -11,6 +11,14 @@ const RUNTIME = "__HARNESS_RUNTIME__";
11
11
  const AGENT = "__HARNESS_AGENT__";
12
12
  const harness = () =>
13
13
  import(pathToFileURL(path.join(RUNTIME, "lib", "nudge.mjs")).href);
14
+ // What the person tells a subagent from Harness waits in steerQueue.mjs for that session's next tool call.
15
+ let queue = null;
16
+ const steering = () =>
17
+ (queue ??= import(
18
+ pathToFileURL(path.join(RUNTIME, "lib", "steerQueue.mjs")).href
19
+ ).catch(() => null));
20
+ // When OpenCode's client cannot take the message, a note rides on what the tool returns instead.
21
+ const notes = new Map();
14
22
  const socketPath = async () =>
15
23
  (await import(pathToFileURL(path.join(RUNTIME, "lib", "paths.mjs")).href))
16
24
  .paths.socket;
@@ -46,6 +54,35 @@ const partId = () => {
46
54
  };
47
55
 
48
56
  export const TryHarnessPlugin = async ({ directory, client }) => ({
57
+ // An OpenCode subagent is a session of its own, so the person's word for it waits under that session. A note or a new
58
+ // brief goes in as the person's next message, which OpenCode queues for a session at work and the model reads as the
59
+ // person's own (words added to a tool's result are read as the tool's, Claude Code showed). A stop refuses every call
60
+ // with the reason until the session goes idle.
61
+ "tool.execute.before": async (input) => {
62
+ const steer = input?.sessionID ? await steering() : null;
63
+ if (!steer) return;
64
+ const items = steer.takeSteers(input.sessionID, steer.PARENT, {
65
+ tool: input.tool ?? null,
66
+ });
67
+ if (!items.length) return;
68
+ const text = steer.steerText(items);
69
+ if (items.some((item) => item.kind === "stop")) throw new Error(text);
70
+ const send =
71
+ client?.session?.promptAsync?.bind(client.session) ??
72
+ client?.session?.prompt?.bind(client.session);
73
+ if (send)
74
+ await send({
75
+ path: { id: input.sessionID },
76
+ body: { parts: [{ type: "text", text }] },
77
+ }).catch(() => notes.set(input.callID, text));
78
+ else notes.set(input.callID, text);
79
+ },
80
+ "tool.execute.after": async (input, output) => {
81
+ const text = notes.get(input?.callID);
82
+ if (!text || !output) return;
83
+ notes.delete(input.callID);
84
+ output.output = `${output.output ?? ""}\n\n${text}`;
85
+ },
49
86
  // A session's first message is its start (Claude Code's SessionStart: the whole board); each later one carries the
50
87
  // board again only when it changed (UserPromptSubmit).
51
88
  "chat.message": async (input, output) => {
@@ -92,12 +129,19 @@ export const TryHarnessPlugin = async ({ directory, client }) => ({
92
129
  const send =
93
130
  client?.session?.promptAsync?.bind(client.session) ??
94
131
  client?.session?.prompt?.bind(client.session);
95
- if (messages.length && send)
132
+ const steerWords = await leftSteers(client, sessionId);
133
+ const text = [
134
+ messages.length ? board.messagesText(messages) : "",
135
+ steerWords,
136
+ ]
137
+ .filter(Boolean)
138
+ .join("\n\n");
139
+ if (text && send)
96
140
  await send({
97
141
  path: { id: sessionId },
98
- body: { parts: [{ type: "text", text: board.messagesText(messages) }] },
142
+ body: { parts: [{ type: "text", text }] },
99
143
  }).catch(() => {});
100
- else if (board && !messages.length)
144
+ else if (board && !text)
101
145
  await board.noteTurn(
102
146
  AGENT,
103
147
  { session_id: sessionId, cwd: directory },
@@ -105,3 +149,26 @@ export const TryHarnessPlugin = async ({ directory, client }) => ({
105
149
  );
106
150
  },
107
151
  });
152
+
153
+ // A session went idle: a stop for it is spent. A word the person sent a subagent that finished before reading it goes to
154
+ // the session that started the subagent, which has its answer now; one for a session of the person's own is its next
155
+ // turn (returned, for the caller to send).
156
+ async function leftSteers(client, sessionId) {
157
+ const steer = await steering();
158
+ const left = steer
159
+ ? steer.endSteers(sessionId, steer.PARENT, { event: "end" })
160
+ : [];
161
+ if (!left.length) return "";
162
+ const got = await client?.session
163
+ ?.get?.({ path: { id: sessionId } })
164
+ .catch(() => null);
165
+ const info = got?.data ?? got;
166
+ if (!info?.parentID) return steer.steerText(left);
167
+ steer.putSteer({
168
+ session: info.parentID,
169
+ agent: steer.PARENT,
170
+ kind: "parent",
171
+ text: `Your subagent "${info.title ?? sessionId}" finished before it read what they sent it, so it is yours to act on:\n\n${left.map((item) => item.text).join("\n\n")}`,
172
+ });
173
+ return "";
174
+ }
package/cli.mjs CHANGED
@@ -449,7 +449,7 @@ async function connect() {
449
449
  `Your agents here can search your Desktop, Documents and Downloads. That stays on this computer${process.platform === "darwin" ? ", and your Mac asks you once" : ""}. ${pc.dim(`Change it: ${relayCommand()} local off`)}`,
450
450
  ]
451
451
  : []),
452
- `Your coding agents start the tasks you ask for in folders they have worked in, up to 10 a day each. Tasks another agent wrote wait for your Start. ${pc.dim(`Change it: ${relayCommand()} board standing`)}`,
452
+ `Your coding agents start the tasks you and your own agents ask for, in any folder below your home, without a Start. Work someone else's agents ask for runs held in its own folder: it reads nothing else of yours and has no network until you press Start. ${pc.dim(`Change it: ${relayCommand()} board standing`)}`,
453
453
  ].join("\n\n"),
454
454
  "Good to know"
455
455
  );
@@ -924,6 +924,24 @@ async function machines() {
924
924
  console.log(`This computer is now called ${response.label}.`);
925
925
  return;
926
926
  }
927
+ if (sub === "update") {
928
+ // `machines update <name> [version]`: that computer fetches the release (the newest by default), checks it is
929
+ // signed with Harness's release key and sets it up; asked from home over the pair's sealed line.
930
+ const named = argv.slice(1);
931
+ const version = /^(\d+\.\d+\.\d+|latest)$/.test(named.at(-1) ?? "")
932
+ ? named.pop()
933
+ : "latest";
934
+ const computer = named.join(" ").trim();
935
+ if (!computer)
936
+ throw new Error("usage: tryharness machines update <name> [version]");
937
+ const response = await daemonRequest(
938
+ { command: "machines.update", agent: "user", computer, version },
939
+ 20_000
940
+ );
941
+ if (!response.ok) throw new Error(response.error || "not updated");
942
+ console.log(`${computer}: ${response.note}`);
943
+ return;
944
+ }
927
945
  if (sub === "remove") {
928
946
  const computer = argv.slice(1).join(" ").trim();
929
947
  if (!computer) throw new Error("usage: tryharness machines remove <name>");
@@ -1245,10 +1263,9 @@ async function board() {
1245
1263
  );
1246
1264
  return;
1247
1265
  }
1248
- // Standing permission: a coding agent starts the tasks you or Harness post for it without a Start. On by default
1249
- // for the folders you have used it in; name folders and a daily cap instead, turn it off, or back on to the default.
1250
- // Tasks another agent wrote wait for you, except a clean ask from one of your own agents elsewhere you named with
1251
- // --from (Grok Bot, Muse) in a thread; --from none takes them back.
1266
+ // Standing permission: a coding agent starts the tasks you, Harness or any of your own agents post for it without a
1267
+ // Start. On by default in any folder below home; name folders and a daily cap instead, turn it off, or back on to the
1268
+ // default. --from names which of your agents may start it; --from none takes them all back.
1252
1269
  if (sub === "standing") {
1253
1270
  const rest = argv
1254
1271
  .slice(argv.indexOf(sub) + 1)
@@ -1314,18 +1331,16 @@ async function board() {
1314
1331
  }
1315
1332
  const where =
1316
1333
  rule.mode === "default"
1317
- ? rule.workspaces.length
1318
- ? `in the ${rule.workspaces.length} folder${rule.workspaces.length === 1 ? "" : "s"} you have used it in (${rule.workspaces.slice(0, 5).join(", ")}${rule.workspaces.length > 5 ? ", ..." : ""})`
1319
- : "in folders you have used it in (none yet)"
1320
- : `in ${rule.workspaces.join(", ")}`;
1334
+ ? `in any folder below your home, ${rule.runs_today} today`
1335
+ : `in ${rule.workspaces.join(", ")}; ${rule.runs_today} of ${rule.daily_cap} today`;
1321
1336
  const everyone = PROPOSERS.every((name) =>
1322
1337
  rule.proposers?.includes(name)
1323
1338
  );
1324
1339
  const from = rule.proposers?.length
1325
- ? `, and on clean asks from ${everyone ? "any of your agents" : rule.proposers.join(", ")} (stop: ${relayCommand()} board standing ${rule.agent} --from none)`
1340
+ ? `, and on asks from ${everyone ? "any of your agents" : rule.proposers.join(", ")} (stop: ${relayCommand()} board standing ${rule.agent} --from none)`
1326
1341
  : "";
1327
1342
  console.log(
1328
- `${rule.agent} starts tasks from you or Harness without asking${from}, ${where}; ${rule.runs_today} of ${rule.daily_cap} today. Turn it off: ${relayCommand()} board standing ${rule.agent} off`
1343
+ `${rule.agent} starts tasks from you or Harness without asking${from}, ${where}. Turn it off: ${relayCommand()} board standing ${rule.agent} off`
1329
1344
  );
1330
1345
  }
1331
1346
  return;
@@ -2667,7 +2682,7 @@ function installedLine() {
2667
2682
 
2668
2683
  function help() {
2669
2684
  console.log(
2670
- `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 | 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`
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`
2671
2686
  );
2672
2687
  }
2673
2688
 
package/lib/asks.mjs CHANGED
@@ -111,6 +111,8 @@ export function createAsks({
111
111
  agent: ask.agent,
112
112
  objective: objectiveOf(thread, ask),
113
113
  result: `Could not be asked: ${reason}`.slice(0, 4_000),
114
+ // When, so a round reads the failure as the agent's answer to the job posted for it (coordinator.mjs).
115
+ at: new Date().toISOString(),
114
116
  },
115
117
  ].slice(-5)
116
118
  )
@@ -150,6 +152,8 @@ export function createAsks({
150
152
  if (sent?.pending) await sent.pending;
151
153
  else if (!sent?.ok)
152
154
  throw Object.assign(new Error(sent?.error), { refused: connected() });
155
+ // The agent's newest task on Harness's server in this thread, by the ask's own id: what a stop ends (moves.mjs).
156
+ store.meta(`hosted-ask:${thread.id}:${ask.agent}`, ask.id);
153
157
  forget(thread.id, ask.id);
154
158
  } catch (error) {
155
159
  const tries = (ask.tries ?? 0) + 1;
@@ -9,6 +9,8 @@ export function createBoardCommands({
9
9
  handlers,
10
10
  task,
11
11
  machineOf = () => null,
12
+ // What a feature's answer becomes before the caller has it; a pending answer is passed on once it settles.
13
+ answered = (request, answer) => answer,
12
14
  }) {
13
15
  return (request) => {
14
16
  if (!validAgent(request.agent))
@@ -25,6 +27,12 @@ export function createBoardCommands({
25
27
  const context = { agent, id, expected, machine };
26
28
  const owner = boardCommandOwner(String(request.command));
27
29
  const handler = Object.hasOwn(handlers, owner) ? handlers[owner] : task;
28
- return handler(request, context);
30
+ const answer = handler(request, context);
31
+ return answer?.pending
32
+ ? {
33
+ ...answer,
34
+ pending: answer.pending.then((settled) => answered(request, settled)),
35
+ }
36
+ : answered(request, answer);
29
37
  };
30
38
  }
@@ -22,12 +22,6 @@
22
22
  "board.dispatch.scope.list": "task",
23
23
  "board.dispatch.scope.revoke": "task",
24
24
  "board.dispatch.propose": "task",
25
- "board.dispatch.prompt": "task",
26
- "board.prompt.start": "task",
27
- "board.prompt.status": "task",
28
- "board.prompt.cancel": "task",
29
- "board.prompt.receipt": "task",
30
- "board.dispatch.workspace": "task",
31
25
  "board.dispatch.view": "task",
32
26
  "board.dispatch.apply": "task",
33
27
  "board.dispatch.advisory": "task",
@@ -68,6 +62,7 @@
68
62
  "board.media.search": "tools",
69
63
  "board.notices.take": "watch",
70
64
  "board.place.op": "place",
65
+ "board.kanban.update": "kanban",
71
66
  "board.plan.add": "plans",
72
67
  "board.plan.edit": "plans",
73
68
  "board.plan.remove": "plans",
@@ -214,7 +209,9 @@
214
209
  "board.native.decide": "nativeRequests",
215
210
  "board.swarm.links": "swarm",
216
211
  "board.swarm.link": "swarm",
217
- "board.wait": "waits"
212
+ "board.wait": "waits",
213
+ "board.subagent.read": "subagents",
214
+ "board.subagent.steer": "subagents"
218
215
  },
219
216
  "families": [
220
217
  {
@@ -229,6 +226,10 @@
229
226
  "owner": "landed",
230
227
  "prefixes": ["board.landed."]
231
228
  },
229
+ {
230
+ "owner": "subagents",
231
+ "prefixes": ["board.subagent."]
232
+ },
232
233
  {
233
234
  "owner": "relay",
234
235
  "prefixes": ["board.relay."]
@@ -257,6 +258,10 @@
257
258
  "owner": "plans",
258
259
  "prefixes": ["board.plan.", "board.template."]
259
260
  },
261
+ {
262
+ "owner": "kanban",
263
+ "prefixes": ["board.kanban."]
264
+ },
260
265
  {
261
266
  "owner": "projects",
262
267
  "prefixes": ["board.project."]
@@ -284,6 +289,8 @@
284
289
  ],
285
290
  "access": {
286
291
  "phone": [
292
+ "board.subagent.read",
293
+ "board.subagent.steer",
287
294
  "board.list",
288
295
  "board.get",
289
296
  "board.children",
@@ -342,6 +349,7 @@
342
349
  "board.swarm.link",
343
350
  "board.vault.allow",
344
351
  "board.vault.dismiss",
352
+ "board.kanban.update",
345
353
  "board.plan.add",
346
354
  "board.plan.edit",
347
355
  "board.plan.remove",
@@ -376,12 +384,11 @@
376
384
  "board.swarm.specialty",
377
385
  "board.swarm.pin",
378
386
  "board.swarm.offices",
379
- "board.swarm.office",
380
- "board.prompt.start",
381
- "board.prompt.status",
382
- "board.prompt.cancel"
387
+ "board.swarm.office"
383
388
  ],
384
389
  "browserPerson": [
390
+ "board.subagent.read",
391
+ "board.subagent.steer",
385
392
  "board.list",
386
393
  "board.get",
387
394
  "board.children",
@@ -501,10 +508,7 @@
501
508
  "board.vault.share",
502
509
  "board.vault.unshare",
503
510
  "board.vault.import",
504
- "board.vault.allow",
505
- "board.prompt.start",
506
- "board.prompt.status",
507
- "board.prompt.cancel"
511
+ "board.vault.allow"
508
512
  ],
509
513
  "harnessBrowser": [
510
514
  "board.list",
@@ -591,6 +595,8 @@
591
595
  "board.room.search"
592
596
  ],
593
597
  "desktop": [
598
+ "board.subagent.read",
599
+ "board.subagent.steer",
594
600
  "board.audit.week",
595
601
  "board.desk.book",
596
602
  "board.desk.contract",
@@ -674,6 +680,7 @@
674
680
  "board.relay.seen",
675
681
  "board.relay.defaults",
676
682
  "board.relay.peers",
683
+ "board.kanban.update",
677
684
  "board.plan.add",
678
685
  "board.plan.edit",
679
686
  "board.plan.remove",
@@ -763,10 +770,7 @@
763
770
  "board.wait",
764
771
  "board.landed.thread",
765
772
  "board.landed.folder",
766
- "board.landed.open",
767
- "board.prompt.start",
768
- "board.prompt.status",
769
- "board.prompt.cancel"
773
+ "board.landed.open"
770
774
  ],
771
775
  "plainPerson": ["board.standing.off"],
772
776
  "plainHarnessReads": [
package/lib/bridge.mjs CHANGED
@@ -31,6 +31,8 @@ const SCRUBBED = new Set([
31
31
  "harness_task",
32
32
  "harness_steer",
33
33
  "coordinate",
34
+ // The swarm's manager (manager.mjs): what the person's message is, and where their asks stand.
35
+ "manage",
34
36
  "pick_folder",
35
37
  "route_model",
36
38
  "check_work",
@@ -0,0 +1,86 @@
1
+ import { askLocalAgent, LOCAL_DECIDERS } from "./localAgentAsk.mjs";
2
+
3
+ // The capability check (owner, November 1): when work comes in, each of the person's computers is asked whether it
4
+ // can do that specific work, and an agent there looks at what the computer has. The coordinator gives the answers to
5
+ // Jev with each agent's computers, so routing goes by what each computer can actually do rather than a fixed list of
6
+ // features any one person's machines happen to have.
7
+
8
+ const ANSWERS = ["yes", "no", "unknown"];
9
+
10
+ const question = (label, work) =>
11
+ [
12
+ `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
+ 'Answer with only this JSON: {"answer": "yes" | "no" | "unknown", "why": "one sentence naming what you found"}.',
15
+ "",
16
+ "The work:",
17
+ work,
18
+ ].join("\n");
19
+
20
+ const unknown = (why) => ({ answer: "unknown", why });
21
+
22
+ /** An agent's reply as an answer, or unknown when it is not one. */
23
+ const shaped = (reply) =>
24
+ ANSWERS.includes(reply?.answer) && typeof reply.why === "string"
25
+ ? { answer: reply.answer, why: reply.why.slice(0, 300) }
26
+ : unknown("the check did not answer in the agreed shape");
27
+
28
+ export function createCapabilityCheck({
29
+ machine,
30
+ installedAgents,
31
+ // The person's other computers (ownMachines.mjs), read when a check runs: they connect after this is made.
32
+ ownMachines = () => null,
33
+ log,
34
+ ask = askLocalAgent,
35
+ }) {
36
+ /** This computer's answer for `work`, from the first agent here that can look. */
37
+ const answer = async (work) => {
38
+ const agent = LOCAL_DECIDERS.find((id) => installedAgents.includes(id));
39
+ if (!agent) return unknown("no agent on this computer can look");
40
+ try {
41
+ return shaped(
42
+ await ask(agent, question(machine().label, String(work)), {
43
+ look: true,
44
+ })
45
+ );
46
+ } catch (error) {
47
+ log(`capability check: ${error.message}`);
48
+ return unknown(`the check failed: ${error.message}`);
49
+ }
50
+ };
51
+
52
+ /** Every online computer's answer for `work`, this one included: [{ id, label, answer, why }]. */
53
+ const check = async (work) => {
54
+ const here = machine();
55
+ const own = ownMachines();
56
+ const others = (own?.all() ?? []).filter(
57
+ (computer) => computer.id !== here.id && computer.connected
58
+ );
59
+ // With no other computer online there is no choice of computer to make.
60
+ if (!others.length) return [];
61
+ const asked = [
62
+ answer(work).then((found) => ({
63
+ id: here.id,
64
+ label: here.label,
65
+ ...found,
66
+ })),
67
+ ...others.map(async (computer) => {
68
+ if (computer.unanswered)
69
+ return {
70
+ id: computer.id,
71
+ label: computer.label,
72
+ ...unknown("it did not answer its last request from home"),
73
+ };
74
+ const reply = await own.capabilityOf(computer.id, work);
75
+ return {
76
+ id: computer.id,
77
+ label: computer.label,
78
+ ...(reply ? shaped(reply) : unknown("the computer did not answer")),
79
+ };
80
+ }),
81
+ ];
82
+ return Promise.all(asked);
83
+ };
84
+
85
+ return { answer, check };
86
+ }
@@ -53,16 +53,12 @@ export function computerAddress({
53
53
  text,
54
54
  computers,
55
55
  target = null,
56
- recipient = null,
57
56
  agentOf = (name) => name,
58
57
  }) {
59
58
  const refuse = (error) => ({ ok: false, error });
60
- const original = String(text ?? "");
61
- // A task already names its recipient in a typed field; "On pop-os: ..." is the same address without repeating @agent.
62
- const words =
63
- recipient && /^\s*on\s+/i.test(original)
64
- ? `@${recipient} ${original.trimStart()}`
65
- : original;
59
+ // Only explicit addresses are read here: #computer, `@agent on computer` and a typed computer. Whether plain words
60
+ // ("On pop-os: ...") mean a computer is the coordinator's judgment (Jev), never a pattern (owner, November 1).
61
+ const words = String(text ?? "");
66
62
  let typed = null;
67
63
  if (target != null && String(target).trim()) {
68
64
  const wanted = String(target).trim();
@@ -118,13 +114,9 @@ export function computerAddress({
118
114
  const after = words.slice(match.index + match[0].length);
119
115
  const found = computersAtStart(after, computers);
120
116
  if (!found.length) {
121
- // A # or a computer-shaped handle makes an unknown address explicit. A plain phrase before a colon can be
122
- // ordinary prose ("on this:", "On Monday:"), so it does not choose or refuse a computer.
123
- const unknown = after.match(/^([\w.-]+(?: [\w.-]+)*):(?:\s|$)/)?.[1];
124
- const explicit =
125
- match[0].endsWith("#") ||
126
- (unknown && /^[\w.-]+$/.test(unknown) && /[-._\d]/.test(unknown));
127
- if (several && unknown && explicit)
117
+ // "@agent on #name" with no such computer is an explicit address to a computer that does not exist.
118
+ const unknown = after.match(/^[\w.-]+/)?.[0];
119
+ if (several && unknown && match[0].endsWith("#"))
128
120
  return refuse(
129
121
  `No computer is called "${unknown}". Your computers: ${listOf(computers)}.`
130
122
  );