tryharness 0.7.45 → 0.7.53

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 (99) hide show
  1. package/README.md +232 -12
  2. package/cli.mjs +406 -184
  3. package/lib/actorRoster.mjs +28 -5
  4. package/lib/adapters.mjs +9 -1
  5. package/lib/agentRuntimeConfig.mjs +36 -0
  6. package/lib/agentRuntimes.mjs +560 -0
  7. package/lib/atlas.mjs +7 -2
  8. package/lib/boardCommands.mjs +5 -10
  9. package/lib/boardFileCommands.mjs +2 -1
  10. package/lib/boardMirror.mjs +459 -0
  11. package/lib/boardProtocol.json +206 -6
  12. package/lib/boardTools.mjs +2 -6
  13. package/lib/bridge.mjs +25 -3
  14. package/lib/browserWake.mjs +60 -0
  15. package/lib/cards.mjs +35 -2
  16. package/lib/commands.mjs +20 -5
  17. package/lib/connectionTools.d.ts +13 -0
  18. package/lib/connectionTools.js +45 -0
  19. package/lib/connectorAuth.mjs +309 -0
  20. package/lib/connectorCatalog.json +41 -0
  21. package/lib/connectorCommands.mjs +121 -0
  22. package/lib/connectorGoogle.mjs +513 -0
  23. package/lib/connectors.mjs +805 -0
  24. package/lib/coordinator.mjs +8 -1
  25. package/lib/coreModels.mjs +78 -0
  26. package/lib/daemon.mjs +643 -45
  27. package/lib/desktop.mjs +7 -2
  28. package/lib/digest.mjs +32 -0
  29. package/lib/directLink.mjs +283 -0
  30. package/lib/environments.mjs +595 -0
  31. package/lib/folders.mjs +2 -2
  32. package/lib/goalCommands.mjs +58 -14
  33. package/lib/inference.mjs +263 -152
  34. package/lib/lessons.mjs +6 -0
  35. package/lib/lineup.mjs +324 -0
  36. package/lib/localmodels.mjs +10 -0
  37. package/lib/machineIdentity.mjs +3 -0
  38. package/lib/machineRoutes.mjs +40 -2
  39. package/lib/machineRuns.mjs +30 -3
  40. package/lib/machineSeal.mjs +69 -10
  41. package/lib/mcp-stdio.mjs +121 -118
  42. package/lib/mcpRelay.mjs +119 -0
  43. package/lib/members.json +12 -0
  44. package/lib/members.mjs +33 -0
  45. package/lib/modelMemory.mjs +100 -0
  46. package/lib/modelTiers.json +1183 -0
  47. package/lib/modelTiers.mjs +133 -0
  48. package/lib/models.mjs +41 -8
  49. package/lib/museSession.mjs +119 -0
  50. package/lib/nativeHost.mjs +203 -0
  51. package/lib/network.mjs +7 -2
  52. package/lib/nudge.mjs +10 -2
  53. package/lib/onboard.mjs +430 -1
  54. package/lib/oneclawLocal.mjs +150 -0
  55. package/lib/ownMachines.mjs +521 -36
  56. package/lib/pairing.mjs +165 -0
  57. package/lib/paths.mjs +4 -0
  58. package/lib/phones.mjs +61 -0
  59. package/lib/placeCommands.mjs +27 -0
  60. package/lib/places.mjs +10 -2
  61. package/lib/plans.mjs +151 -27
  62. package/lib/profile.mjs +152 -0
  63. package/lib/projects.mjs +624 -137
  64. package/lib/readiness.mjs +283 -0
  65. package/lib/repoLinks.mjs +354 -0
  66. package/lib/roomChannels.mjs +641 -0
  67. package/lib/runBrief.mjs +32 -2
  68. package/lib/runRequests.mjs +157 -0
  69. package/lib/runWorker.mjs +20 -7
  70. package/lib/runner.mjs +67 -8
  71. package/lib/secretPatterns.json +55 -0
  72. package/lib/secrets.mjs +10 -27
  73. package/lib/seen.mjs +102 -0
  74. package/lib/service.mjs +11 -6
  75. package/lib/sessionControl.mjs +10 -8
  76. package/lib/sessionIndex.mjs +5 -3
  77. package/lib/store.mjs +546 -29
  78. package/lib/subagents.mjs +8 -4
  79. package/lib/swarm.mjs +367 -37
  80. package/lib/swarmMemory.mjs +947 -0
  81. package/lib/t3.mjs +43 -13
  82. package/lib/taskCommands.mjs +56 -5
  83. package/lib/taskRuns.mjs +61 -11
  84. package/lib/team.json +17 -15
  85. package/lib/team.mjs +68 -18
  86. package/lib/threadRuns.mjs +3 -1
  87. package/lib/threadView.mjs +51 -14
  88. package/lib/tokenizer.mjs +405 -0
  89. package/lib/ui.mjs +16 -2
  90. package/lib/usageTotals.mjs +148 -0
  91. package/lib/vault.mjs +1144 -0
  92. package/lib/vaultCloud.mjs +117 -0
  93. package/lib/vaultCommands.mjs +201 -0
  94. package/lib/vaultTools.d.ts +12 -0
  95. package/lib/vaultTools.js +42 -0
  96. package/lib/windowAsks.mjs +42 -0
  97. package/lib/workFocus.mjs +59 -0
  98. package/lib/workLinks.mjs +90 -0
  99. package/package.json +9 -4
package/README.md CHANGED
@@ -8,8 +8,9 @@ npx tryharness
8
8
 
9
9
  Supports the Node.js 18, 20, 22, and 24 release lines.
10
10
 
11
- That one command pairs the machine, detects Claude Code, Codex, pi, and opencode,
12
- configures every installed agent, installs the Harness daemon as a user-level login
11
+ That one command signs this computer in to your Harness account (one page in the browser: your
12
+ email, then Connect), lists the agents installed here with the ones that are signed in already
13
+ ticked, connects the ones you keep, installs the Harness daemon as a user-level login
13
14
  service (launchd on macOS, a systemd user service on Linux, a Task Scheduler logon task
14
15
  on Windows; all without elevation), validates readiness, and starts indexing existing
15
16
  coding sessions locally in SQLite. Setup returns as soon as the daemon is ready; indexing continues in the
@@ -19,8 +20,91 @@ JSONL histories are streamed from beginning to end and only normalized conversat
19
20
  records are retained. Source-file size does not truncate recall; long read results are
20
21
  paged when Harness displays them.
21
22
 
22
- The command is idempotent. Run it again after installing another agent or to repair its
23
- configuration.
23
+ The command is idempotent; run it again to repair a configuration. Your swarm holds only the
24
+ agents you picked: `npx tryharness agents` shows who is in it and who can be added,
25
+ `npx tryharness agents add [agent]` adds one (with no name, pick from the ones found here) and
26
+ `npx tryharness agents remove <agent>` takes one out. The buddy's settings has the same, under
27
+ Your swarm and Add an agent. A new account gets $20 of Harness credit once its first computer
28
+ is running Harness.
29
+
30
+ ## Coding agents and existing work
31
+
32
+ Local execution supports Claude Code, Codex, Pi and OpenCode through their native
33
+ interfaces; Cursor (`cursor-agent acp`), Grok Build (`grok agent stdio`) and
34
+ Antigravity (`agy_acp_server.par`, `.exe` on Windows) through ACP; and Muse Code
35
+ (`muse serve`) through MSP. Each needs its own installation and authentication.
36
+ T3 is optional. Grok Build and Muse Code are separate from hosted Grok Bot and Muse.
37
+ Muse Code's SDK requires Node 20 or newer and is pinned to 1.4.11; incompatible
38
+ handshakes fail without substituting another agent. New protocol adapters do not
39
+ provide Harness's restricted or read-only execution contract.
40
+
41
+ An executable outside PATH can be selected in `~/.harness/config.json`, preserving
42
+ the rest of that file:
43
+
44
+ ```json
45
+ {
46
+ "agentCommands": {
47
+ "cursor": { "command": "/absolute/path/to/cursor-agent", "args": ["acp"] }
48
+ },
49
+ "acpAgents": [
50
+ {
51
+ "id": "acp-example",
52
+ "name": "My installed ACP agent",
53
+ "command": "/absolute/path/to/agent",
54
+ "args": ["acp"]
55
+ }
56
+ ]
57
+ }
58
+ ```
59
+
60
+ Custom IDs start with `acp-`. Restart the daemon after adding a custom agent.
61
+ Registry packages are not automatically downloaded or installed. Model and effort
62
+ overrides must be offered by the actual protocol; otherwise the run refuses the
63
+ override. Muse preserves its configured permission policy; its optional
64
+ `agentCommands["muse-code"].approvalMode` selects an existing native mode.
65
+ An explicit model refresh now reads ACP model selectors and Muse's `model/list`
66
+ through disposable connections. Discovery submits no inference prompt. Automatic
67
+ startup refresh leaves these protocol sessions alone. Missing selectors and
68
+ unknown effort capabilities stay unavailable; overrides are checked again against
69
+ the opened session. Native session-history parsers and terminal reopen commands
70
+ still cover the original four agents. Muse requires the negotiated `sessionMcp`
71
+ capability and injects Harness tools into its owned session. Continuations resume
72
+ the exact durable native session; a model change is applied and read back while
73
+ that session is idle. ACP and Muse native permission requests appear in the buddy
74
+ and paired surfaces with only the agent's offered one-time choices. Decisions
75
+ are pinned to the live run and current request; Stop cancels a pending decision.
76
+ Muse native questionnaires remain unadvertised; agents can ask through Harness's
77
+ existing task-question path.
78
+
79
+ After approving Harness's T3 connection, existing T3 work appears in the ordinary
80
+ thread list and buddy canvas, including explicit delegated and native children.
81
+ The connection catalog includes custom provider instances, models and unavailable
82
+ providers with their reasons. Messages and Stop act on original root sessions;
83
+ Stop is pinned to the observed run. Delegated children open in their original
84
+ environment and remain controlled through their parent. Read-only grants permit
85
+ inspection. A lost action receipt is held for inspection rather than replayed.
86
+
87
+ The buddy's Following view keeps selected outside sessions alongside Harness work;
88
+ All discovers the rest. Followed work with words the person has not read carries a
89
+ dot. Reading a thread to its end records that version as read on the computer,
90
+ shared by paired surfaces; agents starting or stopping work do not change it, new
91
+ words, a new question or a later child update do. The thread then opens at a "New
92
+ since you looked" rule. Send to… on an agent's message puts it, with its source and
93
+ time, in the chosen thread's composer, the menu naming that thread's participants;
94
+ it stays an editable draft until the person sends it. Web/PiP thread views work the
95
+ same way. Nothing infers hidden connections or exports whole conversations.
96
+
97
+ Add existing work keeps original sessions beside a Harness objective, under the
98
+ thread's Related, in the buddy and paired web/PiP views. These references are
99
+ private to the person. Linked
100
+ updates bring the objective back into Following; revocation drops cached titles
101
+ and results. Use result here prepares an attributed draft. In an open PiP thread,
102
+ Use selected page text previews the permitted selection, address and capture time;
103
+ Add to reply preserves existing reply text and edits. The person's Send shares it
104
+ with the shown thread participants. Page context Pause prevents a new read.
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.
24
108
 
25
109
  ## Daemon ownership
26
110
 
@@ -44,6 +128,7 @@ socket and authenticated bridge. Features own their state and command handling:
44
128
  | `goalCommands.mjs`, `taskCommands.mjs` | Goal/room operations and task lifecycle operations |
45
129
  | `boardThreads.mjs`, `boardWatches.mjs`, `boardTools.mjs` | Relay-thread messages, watch/digest commands and local tool commands |
46
130
  | `boardAccess.mjs` | Plain hosted-call policy and metadata-only responses |
131
+ | `connectors.mjs`, `connectorAuth.mjs` | Local app credentials, OAuth, discovered tools, scoped agent grants and durable operation receipts |
47
132
 
48
133
  `createModelRouter` returns the complete run selection, including model, effort,
49
134
  provenance and any fallback explanation. It owns the precedence of a run's explicit
@@ -89,14 +174,115 @@ rescan; it is diagnostic, not part of normal setup.
89
174
 
90
175
  Delegated coding tasks start when the user presses Start on Harness's proposal card, or
91
176
  at once when standing permission covers the folder (see Task board); either way the task is
92
- posted on the machine's board under the run id. They then run non-interactively with each agent's full-authority/auto-approve mode
93
- inside the exact absolute working directory shown on that card; Harness never falls
94
- back to the user's home directory. The card immediately shows a
177
+ posted on the machine's board under the run id. Native CLI runners use their
178
+ existing full-authority modes; ACP and Muse preserve native session policies and
179
+ surface interactive one-time permission decisions. Every run uses the exact
180
+ absolute working directory shown on that card; Harness never falls back to the
181
+ user's home directory. The card immediately shows a
95
182
  `npx tryharness task <run-id> --follow` command for watching the machine-local raw output
96
- in a terminal. Both the card and the follow command print the agent's native session
97
- command as soon as the agent reports its session id, including while the run is active,
98
- so the user can enter and steer the agent directly rather than interacting through a
99
- Harness wrapper.
183
+ in a terminal. For the original four native agents, the card and follow command
184
+ print their native session command once its id arrives, including while active.
185
+ Other protocols keep their native session identity without inventing a terminal
186
+ reopen command.
187
+
188
+ ## Vault
189
+
190
+ Your keys, tokens and passwords are kept on this computer, in 1claw's open
191
+ local-vault format (`~/.harness/vault.enc`, sealed with `~/.harness/vault-key`).
192
+ Agents use them through `use_secret`: the relay puts the value into the request,
193
+ sends it only to the websites you named for it, and gives the agent the answer with
194
+ the value replaced by a marker. An agent uses a secret only once you allow it; one
195
+ that asks first shows up in `npx tryharness vault`, the buddy and the dashboard.
196
+
197
+ ```sh
198
+ npx tryharness vault # what is kept, who asks, who may use what
199
+ npx tryharness vault add fly-token --hosts api.fly.io # typed hidden or piped; never on the command line
200
+ npx tryharness vault allow codex fly-token
201
+ npx tryharness vault runs codex fly-token FLY_API_TOKEN [--elsewhere]
202
+ npx tryharness vault backup you@example.com [--bring-in]
203
+ npx tryharness vault share fly-token --hours 24 --uses 1
204
+ ```
205
+
206
+ `runs` puts the value in that agent's runs as an environment variable: the agent can
207
+ read it there, and what its runs say is cleaned of it. With `--elsewhere` it also
208
+ goes, sealed, to runs on your other computers; otherwise it stays in runs here. Your
209
+ other computers use the vault on your home computer. Backup keeps a copy in your
210
+ 1claw account (the email you sign in to 1claw with; a new email makes an account,
211
+ and an account that signs in with a wallet cannot back up yet); a new computer gets
212
+ it back by turning backup on with the same email. A 1claw payment request stops the backup:
213
+ nothing is ever paid.
214
+
215
+ ## App connections
216
+
217
+ Connect apps once on this computer, then grant particular operations to agents:
218
+
219
+ ```sh
220
+ npx tryharness connections catalog
221
+ npx tryharness connections add linear
222
+ npx tryharness connections list
223
+ npx tryharness connections tools <connection-id>
224
+ npx tryharness connections grant <connection-id> --agent codex --tool <listed-tool> --effect read
225
+ npx tryharness connections operations
226
+ npx tryharness connections approve <operation-id>
227
+ npx tryharness connections revoke <connection-id>
228
+ ```
229
+
230
+ The catalog includes Google Calendar, Gmail, Slack, Notion and Linear. Google uses
231
+ its public APIs, without Workspace MCP Developer Preview enrollment. Configure a
232
+ Google **Desktop app** OAuth client in the daemon environment with
233
+ `HARNESS_GOOGLE_CLIENT_ID` and `HARNESS_GOOGLE_CLIENT_SECRET`, or enter the client
234
+ fields in settings. The client must have the Calendar/Gmail APIs enabled and the
235
+ appropriate Google consent/verification configuration. Read access is the default;
236
+ settings offers explicit additional consent for calendar edits, Gmail drafts, or
237
+ Gmail sending.
238
+ Calendar edits/deletions require a last-read etag. Draft approvals display the
239
+ complete decoded MIME content. Calendar effects and saved drafts include an
240
+ independent read-back receipt; an unavailable check stays unverified. Gmail sends
241
+ the exact approved MIME message bytes with their recipients and content. Sending
242
+ requires its own provider scope and an agent's `send` grant. A sent-copy check
243
+ verifies those contents in Gmail; delivery to recipients remains unverified. An
244
+ uncertain send is never automatically repeated.
245
+
246
+ Notion and Linear advertise dynamic OAuth registration. Slack requires an internal
247
+ or Marketplace-published OAuth app, its client secret and an approved callback.
248
+ Advanced `--client-id`, `--client-secret-env`, `--scope` and `--callback` options
249
+ support registered clients. A fixed callback must be
250
+ `http://127.0.0.1:PORT/callback`; otherwise Relay allocates a loopback port for that
251
+ sign-in. Finish sign-in on the computer running Relay. These presets and public
252
+ metadata probes do not certify live authenticated provider behavior.
253
+
254
+ A custom server uses `connections add <name> --url <url>`; an existing access token
255
+ can be read from an environment variable with `--token-env <name>`. Credentials
256
+ rest encrypted on this computer and never go to agents. `connections reconnect
257
+ <id>` signs in again and clears the previous grants, since a new sign-in can select
258
+ a different account. Disconnect removes stored credentials and grants; refreshing
259
+ discovery cannot reconnect a disconnected account. Remove the app in the provider's
260
+ own settings as well to revoke the upstream OAuth authorization.
261
+ New grants do not restore an agent's access to operation content from an earlier
262
+ authority revision or a previously connected account.
263
+
264
+ Every agent uses the `connection` MCP tool to list its granted connections, inspect
265
+ their tools, request an operation and retrieve its result. Harness chat/PiP uses
266
+ the same tool under the `harness` identity. A hosted client separately needs the
267
+ `connections` token scope (manual token or explicit OAuth consent) and a grant made with `--hosted`; that permits selected
268
+ results to pass through Harness to the agent. It does not permit credential access.
269
+
270
+ Grant effects explicitly: `read`, `write` (including provider-saved drafts), `send`
271
+ or `delete`. Writes wait for approval unless `--standing` was chosen. Use
272
+ `--arguments-file <json-file>` to bind resource arguments exactly, and `--task <id>`
273
+ to restrict work to a task/objective. Resource restrictions left empty allow all
274
+ arguments of that tool within the provider account's access. Changing an operation's
275
+ content, grant or tool definition invalidates its previous approval. Reusing a
276
+ request ID cannot repeat an uncertain effect. `connections result <operation-id>`
277
+ reports returned, failed, unknown or cancelled; returned does not mean verified.
278
+
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.
100
286
 
101
287
  ## Local models
102
288
 
@@ -212,10 +398,44 @@ Connection tokens stay in `~/.harness/config.json` with owner-only permissions.
212
398
  history and the board stay in the local SQLite database unless an explicit operation
213
399
  sends content through Harness.
214
400
 
401
+ ## Your computers
402
+
403
+ One computer is home: it holds the board. Run `npx tryharness setup` on another computer and it
404
+ shows one 16-character code; type it on home (Add a Computer in the Harness menu, or
405
+ `tryharness machines add <code>`) and the new computer joins as a worker. Setup installs the daemon
406
+ as a login service, or runs it detached on a Linux computer without a systemd user session.
407
+ `tryharness machines` lists them; `machines name <name>` renames this one and `machines home`
408
+ moves the board here.
409
+
410
+ Any computer can start work; home's board is the one every agent works off. A worker keeps a copy
411
+ of home's board, read-only, so its agents can still read while home is away; what they post then
412
+ waits on the worker and reaches home when it is back. Only the computer holding the board runs its
413
+ tasks, rounds and sweeps. When the copy has to start over, the old one is kept in
414
+ `~/.harness/board-backups`.
415
+
416
+ Once home confirms a worker, the two also link directly (HyperDHT), each admitting only the
417
+ other's key, so a worker's agents reach home's board even when its line to Harness is down. A call
418
+ that gets no answer over the link goes through Harness instead.
419
+
420
+ A worker can stand in for home when home has been away past `standInAfterMs` in
421
+ `~/.harness/config.json`. That is unset, so off, until its deadline is measured. While it stands in,
422
+ the worker holds the board; once home is back it takes the board back with the stand-in's changes
423
+ and the worker follows it again.
424
+
425
+ The browser you use Harness in links to this computer, end to end. Setup installs a native
426
+ messaging host (`ai.tryharness.daemon`); once the extension is allowed to reach it ("Harness on
427
+ this computer" in its setup, an optional permission), the Harness window links by itself. Without
428
+ it, `tryharness link` does the same. Each browser is paired with the computer it linked to;
429
+ Settings lists every computer's and revokes each where it lives.
430
+
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.
434
+
215
435
  ## Goals
216
436
 
217
437
  `tryharness goal set --objective <text> [--team a,b] [--workspace <dir>]` sets a goal your agents work on together in one
218
- room. Agents read, post and search the room with `read_room`, `post_to_room` and `search_room`; mentioning `@codex` or
438
+ room. Agents read and post in the room with `read_room` and `post_to_room`, and search it, the whole swarm's memory or add to it with `swarm_memory`; mentioning `@codex` or
219
439
  `@claude` wakes that agent with a run in the goal's folder, and jobs they post with the goal as parent run without a
220
440
  Start. Harness facilitates and answers once. `tryharness goal show <id>` prints the room, `goal stop <id>` ends
221
441
  everything, `goal resume <id>` reopens a room that paused at a backstop, and `goal invite <id> handle/agent` asks another