tryharness 0.7.53 → 0.7.57

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 (167) hide show
  1. package/README.md +23 -19
  2. package/assets/dsh-plugin.mjs +72 -0
  3. package/assets/opencode-plugin.js +4 -3
  4. package/cli.mjs +484 -90
  5. package/lib/activity.mjs +10 -10
  6. package/lib/adapters.mjs +173 -222
  7. package/lib/agentBinaries.mjs +71 -0
  8. package/lib/agentRuntimeConfig.mjs +1 -1
  9. package/lib/agentRuntimes.mjs +34 -18
  10. package/lib/agentSignIn.mjs +456 -0
  11. package/lib/answers.mjs +5 -5
  12. package/lib/archetypes.d.ts +64 -0
  13. package/lib/archetypes.js +989 -0
  14. package/lib/asks.mjs +4 -4
  15. package/lib/audit.mjs +666 -0
  16. package/lib/backupSetup.mjs +143 -0
  17. package/lib/boardAccess.mjs +24 -11
  18. package/lib/boardBackup.mjs +283 -0
  19. package/lib/boardFileCommands.mjs +6 -6
  20. package/lib/boardFiles.mjs +13 -12
  21. package/lib/boardMirror.mjs +124 -25
  22. package/lib/boardProtocol.json +88 -2
  23. package/lib/boardWaits.mjs +101 -0
  24. package/lib/book.mjs +659 -0
  25. package/lib/bridge.mjs +6 -6
  26. package/lib/cards.mjs +138 -28
  27. package/lib/cloudAgents.mjs +216 -0
  28. package/lib/cloudAi.mjs +1312 -0
  29. package/lib/cloudAssistants.mjs +242 -0
  30. package/lib/cloudBoot.mjs +119 -0
  31. package/lib/cloudSave.mjs +197 -0
  32. package/lib/cloudSsh.mjs +178 -0
  33. package/lib/commands.mjs +7 -2
  34. package/lib/context.mjs +19 -5
  35. package/lib/contractGate.mjs +399 -0
  36. package/lib/control-client.mjs +9 -1
  37. package/lib/controlSocket.mjs +86 -0
  38. package/lib/coordinator.mjs +252 -144
  39. package/lib/daemon.mjs +1351 -2767
  40. package/lib/desk.mjs +240 -0
  41. package/lib/desktop.mjs +178 -74
  42. package/lib/directLink.mjs +16 -5
  43. package/lib/environment.mjs +2 -1
  44. package/lib/environments.mjs +247 -9
  45. package/lib/firewall.mjs +9 -9
  46. package/lib/folders.mjs +20 -16
  47. package/lib/frames.mjs +2 -3
  48. package/lib/gitHost.mjs +174 -0
  49. package/lib/goalCommands.mjs +25 -7
  50. package/lib/goals.mjs +7 -7
  51. package/lib/guestRequests.mjs +94 -0
  52. package/lib/handoffs.mjs +8 -7
  53. package/lib/handover.mjs +4 -4
  54. package/lib/harnessModel.mjs +6 -6
  55. package/lib/harnessOffers.mjs +266 -0
  56. package/lib/hookDialects.mjs +298 -0
  57. package/lib/inference.mjs +26 -8
  58. package/lib/jobAnswers.mjs +190 -0
  59. package/lib/landed.mjs +887 -0
  60. package/lib/lane.mjs +42 -11
  61. package/lib/lessons.mjs +16 -16
  62. package/lib/library.mjs +3 -3
  63. package/lib/lineup.mjs +3 -0
  64. package/lib/linkRelay.mjs +574 -0
  65. package/lib/live.mjs +284 -13
  66. package/lib/localAgentAsk.mjs +74 -0
  67. package/lib/localStack.mjs +536 -0
  68. package/lib/localmodels.mjs +6 -4
  69. package/lib/loopBackstop.mjs +4 -4
  70. package/lib/machineIdentity.mjs +9 -1
  71. package/lib/machineRoutes.mjs +181 -2
  72. package/lib/machineRuns.mjs +76 -1
  73. package/lib/machineSeal.mjs +39 -12
  74. package/lib/mcp-stdio.mjs +163 -27
  75. package/lib/mcpRelay.mjs +1 -1
  76. package/lib/members.json +29 -2
  77. package/lib/members.mjs +1 -1
  78. package/lib/models.mjs +85 -31
  79. package/lib/museSession.mjs +21 -13
  80. package/lib/nativeHost.mjs +36 -8
  81. package/lib/neovim.mjs +126 -0
  82. package/lib/network.mjs +50 -5
  83. package/lib/notify.mjs +7 -5
  84. package/lib/nudge.mjs +50 -19
  85. package/lib/ocr.mjs +9 -9
  86. package/lib/onboard.mjs +26 -20
  87. package/lib/oneLine.mjs +7 -7
  88. package/lib/ownMachines.mjs +1223 -140
  89. package/lib/pairing.mjs +60 -16
  90. package/lib/paths.mjs +19 -1
  91. package/lib/peerProcess.mjs +124 -0
  92. package/lib/personModel.mjs +89 -0
  93. package/lib/personNotices.mjs +151 -0
  94. package/lib/phones.mjs +538 -31
  95. package/lib/placeCommands.mjs +4 -4
  96. package/lib/places.mjs +400 -12
  97. package/lib/profile.mjs +67 -14
  98. package/lib/projectGit.mjs +158 -14
  99. package/lib/projectPieces.mjs +902 -0
  100. package/lib/projectSettings.mjs +7 -4
  101. package/lib/projects.mjs +384 -62
  102. package/lib/provenance.mjs +5 -1
  103. package/lib/proxyLinks.mjs +267 -0
  104. package/lib/reactions.mjs +7 -5
  105. package/lib/readiness.mjs +145 -23
  106. package/lib/record.mjs +128 -0
  107. package/lib/redact.mjs +4 -4
  108. package/lib/relayLimits.mjs +62 -0
  109. package/lib/release.mjs +170 -0
  110. package/lib/releaseKeys.json +6 -0
  111. package/lib/repoLinks.mjs +4 -4
  112. package/lib/roomChannels.mjs +24 -0
  113. package/lib/roomPage.mjs +1 -1
  114. package/lib/runAuthority.mjs +101 -0
  115. package/lib/runBrief.mjs +19 -8
  116. package/lib/runWorker.mjs +31 -7
  117. package/lib/runner.mjs +223 -29
  118. package/lib/runtime-install.mjs +143 -9
  119. package/lib/schedules.mjs +2 -2
  120. package/lib/screens.mjs +1 -1
  121. package/lib/sealed.mjs +11 -2
  122. package/lib/sealedThreads.mjs +671 -0
  123. package/lib/secretPatterns.json +1 -1
  124. package/lib/secrets.mjs +4 -4
  125. package/lib/seen.mjs +6 -6
  126. package/lib/serverWords.mjs +175 -0
  127. package/lib/service.mjs +22 -12
  128. package/lib/sessionControl.mjs +378 -90
  129. package/lib/specialties.json +74 -0
  130. package/lib/specialties.mjs +477 -0
  131. package/lib/specialtyKeys.d.ts +3 -0
  132. package/lib/specialtyKeys.js +57 -0
  133. package/lib/specialtyNotice.mjs +147 -0
  134. package/lib/specialtySnapshot.mjs +138 -0
  135. package/lib/speech.mjs +5 -5
  136. package/lib/store.mjs +420 -36
  137. package/lib/stuck.mjs +1 -1
  138. package/lib/swarm.mjs +304 -37
  139. package/lib/swarmDevices.mjs +319 -0
  140. package/lib/swarmMemory.mjs +27 -25
  141. package/lib/t3.mjs +24 -15
  142. package/lib/taskCommands.mjs +80 -20
  143. package/lib/taskRooms.mjs +125 -0
  144. package/lib/taskRuns.mjs +45 -3
  145. package/lib/team.json +255 -148
  146. package/lib/team.mjs +554 -190
  147. package/lib/threadActions.mjs +315 -0
  148. package/lib/threadAuthority.mjs +101 -0
  149. package/lib/threadBriefs.mjs +178 -0
  150. package/lib/threadLine.mjs +116 -0
  151. package/lib/threadRuns.mjs +209 -50
  152. package/lib/threadView.mjs +20 -7
  153. package/lib/usageTotals.mjs +2 -3
  154. package/lib/vault.mjs +101 -10
  155. package/lib/vaultCloud.mjs +2 -2
  156. package/lib/vaultCommands.mjs +15 -6
  157. package/lib/vaultTools.js +2 -2
  158. package/lib/verdicts.mjs +328 -0
  159. package/lib/wakes.mjs +1 -1
  160. package/lib/watches.mjs +2 -2
  161. package/lib/windowAsks.mjs +13 -5
  162. package/lib/worktrees.mjs +157 -25
  163. package/npm-shrinkwrap.json +1093 -0
  164. package/package.json +12 -11
  165. package/release.json +220 -0
  166. package/lib/modelTiers.json +0 -1183
  167. package/lib/modelTiers.mjs +0 -133
package/README.md CHANGED
@@ -103,8 +103,8 @@ Use selected page text previews the permitted selection, address and capture tim
103
103
  Add to reply preserves existing reply text and edits. The person's Send shares it
104
104
  with the shown thread participants. Page context Pause prevents a new read.
105
105
 
106
- See [CURRENT.md](../CURRENT.md) for release evidence and installed-agent
107
- availability. Native session authentication still requires each agent’s own setup.
106
+ Which agents are available depends on what is installed on the computer. Native
107
+ session authentication still requires each agent’s own setup.
108
108
 
109
109
  ## Daemon ownership
110
110
 
@@ -149,11 +149,11 @@ asks for Start, so recovery preserves the request without replaying unknown effe
149
149
 
150
150
  `lib/boardProtocol.json` owns command names, routing, protocol/inbox versions,
151
151
  metadata fields and the separate grants for each caller surface. Node consumers use
152
- `boardProtocol.mjs`; web consumers use `src/schemas/boardProtocol.ts`; the Rust
153
- desktop adapter embeds the JSON at build time. A surface uses only its own list:
154
- adding a command to the catalog does not enable it for any caller. Browser and
155
- hosted Harness grants deliberately differ. When adding a command, update its owner
156
- and only the intended surface grants, then exercise that caller's runtime path.
152
+ `boardProtocol.mjs`; the Harness web app reads the same JSON; the Rust desktop
153
+ adapter embeds the JSON at build time. A surface uses only its own list: adding a
154
+ command to the catalog does not enable it for any caller. Browser and hosted Harness
155
+ grants deliberately differ. When adding a command, update its owner and only the
156
+ intended surface grants, then exercise that caller's runtime path.
157
157
 
158
158
  ## Operations
159
159
 
@@ -165,12 +165,14 @@ npx tryharness task <run-id> --follow
165
165
  npx tryharness logs --follow
166
166
  npx tryharness board
167
167
  npx tryharness board post --for claude-code --objective "Port the parser" --file ./brief.md
168
- npx tryharness disconnect
168
+ npx tryharness uninstall
169
169
  ```
170
170
 
171
171
  `status` is the normal health view. `doctor` verifies pairing, the login service, the
172
172
  daemon, the bridge, the database, and agent discovery. `sync` requests a background
173
- rescan; it is diagnostic, not part of normal setup.
173
+ rescan; it is diagnostic, not part of normal setup. `uninstall` removes the app, the service and
174
+ Harness's setup in every agent, and keeps the board, history and keys in `~/.harness`;
175
+ `uninstall --everything` deletes those too.
174
176
 
175
177
  Delegated coding tasks start when the user presses Start on Harness's proposal card, or
176
178
  at once when standing permission covers the folder (see Task board); either way the task is
@@ -276,13 +278,12 @@ content, grant or tool definition invalidates its previous approval. Reusing a
276
278
  request ID cannot repeat an uncertain effect. `connections result <operation-id>`
277
279
  reports returned, failed, unknown or cancelled; returned does not mean verified.
278
280
 
279
- Dashboard Settings → Tools & connections → Apps and buddy Settings → Apps manage
280
- the same accounts, grants and approvals. Calendar access has a picker populated from
281
- the connected account; custom operation restrictions remain advanced exact JSON
282
- arguments. Pending requests refresh while settings is visible. This local
283
- presentation awaits owner review. The older browser-owned connected-server card
284
- remains available under Apps, with separate custody and grants; no credentials are
285
- automatically transferred.
281
+ Dashboard Settings → Tools & connections → Apps and buddy Settings → Apps manage the
282
+ same accounts, grants and approvals. Calendar access has a picker populated from the
283
+ connected account; custom operation restrictions remain advanced exact JSON arguments.
284
+ Pending requests refresh while settings is visible. The older browser-owned
285
+ connected-server card remains available under Apps, with separate custody and grants;
286
+ no credentials are automatically transferred.
286
287
 
287
288
  ## Local models
288
289
 
@@ -428,9 +429,12 @@ this computer" in its setup, an optional permission), the Harness window links b
428
429
  it, `tryharness link` does the same. Each browser is paired with the computer it linked to;
429
430
  Settings lists every computer's and revokes each where it lives.
430
431
 
431
- `tryharness agents tier <agent> top|middle|bottom|auto` sets who may hold a team's important
432
- roles. Auto goes by the agent's model and effort in a snapshot of a public benchmark: the reviewer
433
- needs a top model, the synthesizer, director, builder and checker a middle one.
432
+ Each agent's card names its model and effort and its specialties on that model, each with its
433
+ evidence: a specialist agent's fixed role (Bankr, Quotient), benchmarks, its record on this board and
434
+ the person's own adds. The person adds or removes a specialty (a removal is final for that agent and
435
+ model), pins an agent for a specialty and appoints offices through the relay
436
+ (`board.swarm.specialty`, `board.swarm.pin`, `board.swarm.office`). An office is one of the swarm's
437
+ standing functions, held by Harness or by the agent the person appoints.
434
438
 
435
439
  ## Goals
436
440
 
@@ -0,0 +1,72 @@
1
+ // Installed by tryharness for DeepSeek Harness: a Cordis plugin its own patch file loads (~/.dsh/cordis.patch.yml).
2
+ // It tells a session about its board when it starts, notes the person's prompts with what changed on the board, and
3
+ // hands a session what the person sent it from Harness when its turn would end, with lib/nudge.mjs, the code Claude
4
+ // Code's hooks run. Its tools come from the Harness server in the same patch file. Read from DeepSeek Harness's
5
+ // source (deepseek-ai/deepseek-harness, October 2026): packages/experimental/hooks-claude-code, core/agent-loop.
6
+ import { randomUUID } from "node:crypto";
7
+ import path from "node:path";
8
+ import { pathToFileURL } from "node:url";
9
+
10
+ // Filled in by setup: the runtime the other agents' Harness server runs from.
11
+ const RUNTIME = "__HARNESS_RUNTIME__";
12
+ const AGENT = "dsh";
13
+ const harness = () =>
14
+ import(pathToFileURL(path.join(RUNTIME, "lib", "nudge.mjs")).href).catch(
15
+ () => null
16
+ );
17
+
18
+ export const name = "tryharness";
19
+
20
+ const pids = [process.pid, process.ppid];
21
+ // A message as DeepSeek Harness's createUserMessage makes one; its source says Harness added it, not the person.
22
+ const message = (text) =>
23
+ Object.freeze({
24
+ role: "user",
25
+ content: [{ type: "text", text }],
26
+ source: { kind: "tryharness" },
27
+ id: randomUUID(),
28
+ });
29
+ const where = (agent) => ({
30
+ session_id: agent?.session?.header?.id,
31
+ cwd: process.cwd(),
32
+ });
33
+ const typedByPerson = (messages) =>
34
+ messages.some((entry) => entry?.source?.kind === "user");
35
+
36
+ export function apply(ctx) {
37
+ // A session starting: where it runs, and the whole board.
38
+ ctx.on("agent/created", async ({ agent }) => {
39
+ const board = await harness();
40
+ if (!board || !where(agent).session_id) return;
41
+ await board.notePlace(AGENT, where(agent), pids);
42
+ const notice = await board.boardNudge(AGENT);
43
+ if (notice) agent.inject(message(notice));
44
+ });
45
+ // The person's prompt: noted, with a message from Harness and what changed on the board since the session last saw it.
46
+ ctx.on("agent/pre-step", async ({ agent, messages }, next) => {
47
+ const downstream = await next();
48
+ if (!typedByPerson(messages ?? []) || downstream.kind !== "enter")
49
+ return downstream;
50
+ const board = await harness();
51
+ if (!board || !where(agent).session_id) return downstream;
52
+ await board.notePrompt(AGENT, where(agent), pids);
53
+ const waiting = await board.takeMessages(AGENT, where(agent).session_id);
54
+ const text = [
55
+ waiting.length ? board.messagesText(waiting) : "",
56
+ await board.boardNudgeIfChanged(AGENT),
57
+ ]
58
+ .filter(Boolean)
59
+ .join("\n\n");
60
+ return text
61
+ ? { ...downstream, messages: [...downstream.messages, message(text)] }
62
+ : downstream;
63
+ });
64
+ // A turn about to end: a message waiting from Harness keeps it going; otherwise the session waits for the person.
65
+ ctx.on("agent/turn-stopping", async ({ agent }) => {
66
+ const board = await harness();
67
+ if (!board || !where(agent).session_id) return;
68
+ const waiting = await board.takeMessages(AGENT, where(agent).session_id);
69
+ if (waiting.length) agent.steer(message(board.messagesText(waiting)));
70
+ else await board.noteTurn(AGENT, where(agent), pids);
71
+ });
72
+ }
@@ -1,13 +1,14 @@
1
- // Installed globally by tryharness. It tells opencode about its board and hands it what the person sends a session from
1
+ // Installed globally by tryharness for OpenCode and Kilo. It tells opencode about its board and hands it what the person sends a session from
2
2
  // Harness with lib/nudge.mjs, the code Claude Code's and Codex's hooks run, and nudges the local daemon to index a session; indexing and retry state stay in the daemon's
3
3
  // SQLite database and never block opencode's idle event. Its tools come from the Harness server in its MCP config.
4
4
  import net from "node:net";
5
5
  import path from "node:path";
6
6
  import { pathToFileURL } from "node:url";
7
7
 
8
- // Filled in by setup: the runtime the other agents' Harness server runs from.
8
+ // Filled in by setup: the runtime the other agents' Harness server runs from, and the agent this copy serves (OpenCode,
9
+ // or Kilo, its fork with the same plugin API).
9
10
  const RUNTIME = "__HARNESS_RUNTIME__";
10
- const AGENT = "opencode";
11
+ const AGENT = "__HARNESS_AGENT__";
11
12
  const harness = () =>
12
13
  import(pathToFileURL(path.join(RUNTIME, "lib", "nudge.mjs")).href);
13
14
  const socketPath = async () =>