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/lib/service.mjs CHANGED
@@ -2,7 +2,7 @@ import fs from "node:fs";
2
2
  import os from "node:os";
3
3
  import path from "node:path";
4
4
  import { spawn } from "node:child_process";
5
- import { resolveCommand, run } from "./commands.mjs";
5
+ import { detectAgents, run } from "./commands.mjs";
6
6
  import { ensureDir } from "./files.mjs";
7
7
  import { paths } from "./paths.mjs";
8
8
  import { appProgram } from "./desktop.mjs";
@@ -143,9 +143,8 @@ function agentPath() {
143
143
  "/usr/bin",
144
144
  "/bin",
145
145
  ]);
146
- for (const command of ["claude", "codex", "pi", "opencode"]) {
147
- const found = resolveCommand(command);
148
- if (found) dirs.add(path.dirname(found));
146
+ for (const agent of detectAgents()) {
147
+ if (agent.path) dirs.add(path.dirname(agent.path));
149
148
  }
150
149
  return [...dirs].join(path.delimiter);
151
150
  }
@@ -243,7 +242,12 @@ export function installService({
243
242
  run("launchctl", ["kickstart", "-k", `${domain}/${LABEL}`]);
244
243
  return { manager: "launchd", file: plist };
245
244
  }
246
- if (platform === "linux") {
245
+ // A Linux computer without a systemd user session (a container, WSL, a minimal install) starts the daemon for this
246
+ // login instead, as other platforms do; setup used to stop here with "could not start Harness daemon with systemd".
247
+ if (
248
+ platform === "linux" &&
249
+ execute("systemctl", ["--user", "show-environment"]).ok
250
+ ) {
247
251
  const unit = servicePath();
248
252
  ensureDir(path.dirname(unit));
249
253
  fs.writeFileSync(
@@ -323,7 +327,8 @@ export function serviceInfo({
323
327
  manager:
324
328
  platform === "darwin"
325
329
  ? "launchd"
326
- : platform === "linux"
330
+ : platform === "linux" &&
331
+ execute("systemctl", ["--user", "show-environment"]).ok
327
332
  ? "systemd"
328
333
  : "detached",
329
334
  installed: Boolean(file && fs.existsSync(file)),
@@ -48,6 +48,8 @@ export function createSessionControl({
48
48
  validAgent,
49
49
  opencodeExecutable,
50
50
  activeRuns,
51
+ // Every value in the person's vault out of what a live read shows (vault.mjs).
52
+ scrub = (value) => value,
51
53
  }) {
52
54
  const saidKey = (agent, sessionId) => `said:${agent}:${sessionId}`;
53
55
  const said = (agent, sessionId) => {
@@ -684,10 +686,12 @@ export function createSessionControl({
684
686
  if (agentId === "opencode")
685
687
  return {
686
688
  ok: true,
687
- items: opencodeFeed(
688
- opencodeExecutable || "opencode",
689
- sessionId,
690
- Math.min(200, Number(request.limit) || 80)
689
+ items: scrub(
690
+ opencodeFeed(
691
+ opencodeExecutable || "opencode",
692
+ sessionId,
693
+ Math.min(200, Number(request.limit) || 80)
694
+ )
691
695
  ),
692
696
  };
693
697
  const file = sessionFile(
@@ -699,10 +703,8 @@ export function createSessionControl({
699
703
  if (!file) return { ok: true, items: [] };
700
704
  return {
701
705
  ok: true,
702
- items: sessionFeed(
703
- agentId,
704
- file,
705
- Math.min(200, Number(request.limit) || 80)
706
+ items: scrub(
707
+ sessionFeed(agentId, file, Math.min(200, Number(request.limit) || 80))
706
708
  ),
707
709
  };
708
710
  }
@@ -14,6 +14,8 @@ export function createSessionIndex({
14
14
  state,
15
15
  saveStatus,
16
16
  log,
17
+ // Every value in the person's vault out of what an agent's session says, before it is kept or passed on (vault.mjs).
18
+ scrub = (value) => value,
17
19
  }) {
18
20
  const opencodeExecutable =
19
21
  detected.find((entry) => entry.agent === "opencode")?.path || null;
@@ -100,7 +102,7 @@ export function createSessionIndex({
100
102
  const sessionId = path.basename(item.file);
101
103
  if (!store.needsIndex(agent, sessionId, item.mtime, item.size))
102
104
  return false;
103
- const parsed = await parseSessionFile(agent, item.file);
105
+ const parsed = scrub(await parseSessionFile(agent, item.file));
104
106
  store.indexParsed({
105
107
  agent,
106
108
  sessionId,
@@ -139,7 +141,7 @@ export function createSessionIndex({
139
141
  );
140
142
  if (!messagesResponse.ok) return false;
141
143
  const messages = await messagesResponse.json();
142
- const raw = JSON.stringify({ info, messages });
144
+ const raw = scrub(JSON.stringify({ info, messages }));
143
145
  store.indexRaw({
144
146
  agent: "opencode",
145
147
  sessionId,
@@ -230,7 +232,7 @@ export function createSessionIndex({
230
232
  // traffic is served from the normalized SQLite transcript and never ships raw logs.
231
233
  try {
232
234
  return {
233
- raw: fs.readFileSync(row.source, "utf8"),
235
+ raw: scrub(fs.readFileSync(row.source, "utf8")),
234
236
  cwd: row.cwd || undefined,
235
237
  };
236
238
  } catch {