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/lib/onboard.mjs CHANGED
@@ -8,6 +8,7 @@ import {
8
8
  } from "./wakes.mjs";
9
9
  import { columns, createUi, wrap } from "./ui.mjs";
10
10
  import { CHECKABLE, SIGN_IN } from "./readiness.mjs";
11
+ import { relayCommand } from "./runtime-install.mjs";
11
12
 
12
13
  // "Your swarm" in setup: every agent class with how Harness reaches it, the recommended way already chosen, and a real
13
14
  // test at the end that passes only when the agent claims and reports a task. Also reachable on its own as
@@ -20,10 +21,10 @@ const LABEL = {
20
21
  "grok-bot": "Grok Bot",
21
22
  };
22
23
  const later = (agent) =>
23
- `Later: ${pc.cyan(`npx tryharness agents setup ${agent}`)}`;
24
+ `Later: ${pc.cyan(`${relayCommand()} agents setup ${agent}`)}`;
24
25
 
25
- // The Harness mark (src/main/home/landing/walkthrough/BrandMark.tsx) in box characters: dim corners, the bright one in
26
- // Harness teal, the wordmark beside it. Plain when the output is not a terminal or NO_COLOR is set.
26
+ // The Harness mark, as the app's walkthrough draws it, in box characters: dim corners, the bright one in Harness teal,
27
+ // the wordmark beside it. Plain when the output is not a terminal or NO_COLOR is set.
27
28
  export function banner(version, { color = pc.isColorSupported } = {}) {
28
29
  const c = pc.createColors(color),
29
30
  teal = (text) => (color ? `\x1b[38;5;36m${text}\x1b[39m` : text);
@@ -120,7 +121,7 @@ export async function testAgent({
120
121
  }
121
122
  }
122
123
  spin.stop(
123
- `No answer after ${Math.round(waitMs / 60_000)} minutes. Check that ${name} is running, then: npx tryharness agents test ${agent}`,
124
+ `No answer after ${Math.round(waitMs / 60_000)} minutes. Check that ${name} is running, then: ${relayCommand()} agents test ${agent}`,
124
125
  2
125
126
  );
126
127
  return false;
@@ -292,7 +293,7 @@ async function setupGrok({ ui, daemonRequest, clipboard }) {
292
293
  });
293
294
  if (!saved.ok) {
294
295
  ui.warn(
295
- `${saved.error}. Try again: npx tryharness agents setup grok-bot`
296
+ `${saved.error}. Try again: ${relayCommand()} agents setup grok-bot`
296
297
  );
297
298
  return false;
298
299
  }
@@ -363,7 +364,7 @@ async function setupGrok({ ui, daemonRequest, clipboard }) {
363
364
  ? { ok, line: "Grok registered its address" }
364
365
  : {
365
366
  ok,
366
- line: "Grok has not registered yet. When it has: npx tryharness agents test grok-bot",
367
+ line: `Grok has not registered yet. When it has: ${relayCommand()} agents test grok-bot`,
367
368
  }
368
369
  );
369
370
  const answer = await ui.waitOrType({
@@ -444,8 +445,12 @@ export async function setupSwarm({
444
445
  );
445
446
  }
446
447
 
447
- const ADD_LATER = `Add another agent any time: ${pc.cyan("npx tryharness agents add")}, or Settings, then Your swarm, in the Harness app.`;
448
- const JOINS_LATER = `Install or sign in another agent any time: it joins your swarm by itself once it answers. ${pc.dim(`Or: npx tryharness agents add`)}`;
448
+ // A function, not a constant: the installed command only exists once setup has installed the runtime.
449
+ const ADD_LATER = () =>
450
+ `Add another agent any time: ${pc.cyan(`${relayCommand()} agents add`)}, or Settings, then Your swarm, in the Harness app.`;
451
+ // A function, not a constant: the installed command only exists once setup has installed the runtime.
452
+ const JOINS_LATER = () =>
453
+ `Install or sign in another agent any time: it joins your swarm by itself once it answers. ${pc.dim(`Or: ${relayCommand()} agents add`)}`;
449
454
 
450
455
  const COMMAND = {
451
456
  "claude-code": "claude",
@@ -609,10 +614,11 @@ export async function setupChosen({
609
614
  );
610
615
  for (const entry of local)
611
616
  await setupLocal({ entry, runtimeRoot, ui, daemonRequest, ask: false });
612
- ui.info(JOINS_LATER);
617
+ ui.info(JOINS_LATER());
613
618
  }
614
619
 
615
- const T3_LATER = `Later: ${pc.cyan("npx tryharness t3")}`;
620
+ // A function, not a constant: the installed command only exists once setup has installed the runtime.
621
+ const T3_LATER = () => `Later: ${pc.cyan(`${relayCommand()} t3`)}`;
616
622
  const t3Line = (access) =>
617
623
  access?.state === "send"
618
624
  ? {
@@ -651,7 +657,7 @@ export async function setupT3({ ui = createUi(), daemonRequest, open }) {
651
657
  if (first.t3?.state === "expired")
652
658
  ui.info("Harness's approval in T3 Code ran out.");
653
659
  if (!ui.interactive) {
654
- ui.info(T3_LATER);
660
+ ui.info(T3_LATER());
655
661
  return;
656
662
  }
657
663
  const approve = await ui.select({
@@ -666,7 +672,7 @@ export async function setupT3({ ui = createUi(), daemonRequest, open }) {
666
672
  ],
667
673
  });
668
674
  if (approve !== "approve") {
669
- ui.info(`Skipped. ${T3_LATER}`);
675
+ ui.info(`Skipped. ${T3_LATER()}`);
670
676
  return;
671
677
  }
672
678
  for (;;) {
@@ -675,7 +681,7 @@ export async function setupT3({ ui = createUi(), daemonRequest, open }) {
675
681
  if (!started.ok) {
676
682
  ui.warn(started.error || "Harness could not start the approval.");
677
683
  if (started.code !== "not_running") {
678
- ui.info(T3_LATER);
684
+ ui.info(T3_LATER());
679
685
  return;
680
686
  }
681
687
  const next = await ui.select({
@@ -686,7 +692,7 @@ export async function setupT3({ ui = createUi(), daemonRequest, open }) {
686
692
  ],
687
693
  });
688
694
  if (next !== "check") {
689
- ui.info(`Skipped. ${T3_LATER}`);
695
+ ui.info(`Skipped. ${T3_LATER()}`);
690
696
  return;
691
697
  }
692
698
  continue;
@@ -718,7 +724,7 @@ export async function setupT3({ ui = createUi(), daemonRequest, open }) {
718
724
  if (answer.cancelled) {
719
725
  settled = true;
720
726
  ui.info(
721
- `Stopped waiting. Approving it on that page still counts. ${T3_LATER}`
727
+ `Stopped waiting. Approving it on that page still counts. ${T3_LATER()}`
722
728
  );
723
729
  return;
724
730
  }
@@ -754,7 +760,7 @@ export async function showLineup({ daemonRequest, ui = createUi() }) {
754
760
  const lineup = await daemonRequest({ command: "swarm.lineup" });
755
761
  if (!lineup?.ok) {
756
762
  ui.warn(
757
- lineup?.error || "Harness is not running here. Run: npx tryharness"
763
+ lineup?.error || `Harness is not running here. Run: ${relayCommand()}`
758
764
  );
759
765
  return;
760
766
  }
@@ -765,7 +771,7 @@ export async function showLineup({ daemonRequest, ui = createUi() }) {
765
771
  ui.step(
766
772
  `Your swarm ${pc.dim("· ✓ in it, + can be added")}\n${rows.join("\n")}`
767
773
  );
768
- ui.info(ADD_LATER);
774
+ ui.info(ADD_LATER());
769
775
  }
770
776
 
771
777
  /**
@@ -781,7 +787,7 @@ export async function addAgents({
781
787
  const lineup = await daemonRequest({ command: "swarm.lineup" });
782
788
  if (!lineup?.ok) {
783
789
  ui.warn(
784
- lineup?.error || "Harness is not running here. Run: npx tryharness"
790
+ lineup?.error || `Harness is not running here. Run: ${relayCommand()}`
785
791
  );
786
792
  return false;
787
793
  }
@@ -806,7 +812,7 @@ export async function addAgents({
806
812
  }
807
813
  if (!ui.interactive) {
808
814
  ui.info(
809
- `Can be added: ${open.map((entry) => entry.id).join(", ")}. Run: npx tryharness agents add <agent>`
815
+ `Can be added: ${open.map((entry) => entry.id).join(", ")}. Run: ${relayCommand()} agents add <agent>`
810
816
  );
811
817
  return true;
812
818
  }
@@ -856,7 +862,7 @@ export async function removeAgent({ daemonRequest, agent, ui = createUi() }) {
856
862
  return false;
857
863
  }
858
864
  ui.success(
859
- `${removed.name} is out of your swarm. Add it back any time: npx tryharness agents add ${agent}`
865
+ `${removed.name} is out of your swarm. Add it back any time: ${relayCommand()} agents add ${agent}`
860
866
  );
861
867
  return true;
862
868
  }
package/lib/oneLine.mjs CHANGED
@@ -1,12 +1,12 @@
1
- // A field one agent wrote that another agent reads as one line (an objective, an origin chain, a thread title in a frame,
2
- // a steering header, a card's model) is made safe here: a line break or control character in it could otherwise start a
3
- // line of its own and forge one, such as a "Harness task board:" line in another agent's session start (33 agent-written
4
- // task objectives on the owner's board held line breaks on October 20). Every control and separator character becomes
5
- // one space, and the field is cut to a fixed length, marked with an ellipsis.
1
+ // A field one agent wrote that another agent reads as one line (an objective, an origin chain, a thread title in a
2
+ // frame, a steering header, a card's model) is made safe here: a line break or control character in it could otherwise
3
+ // start a line of its own and forge one, such as a "Harness task board:" line in another agent's session start (33
4
+ // agent-written task objectives on one real board held line breaks). Every control and separator character becomes one
5
+ // space, and the field is cut to a fixed length, marked with an ellipsis.
6
6
 
7
7
  // The length the relay already cuts titles at (run titles, plan lines, the coordinator's session titles). Measured on
8
- // the owner's board, October 20: every thread title (60, at most 120) and file name (334, at most 51) fits whole; task
9
- // objectives (median 346) are cut, and get_task still gives each whole.
8
+ // one real board: every thread title (60, at most 120) and file name (334, at most 51) fits whole; task objectives
9
+ // (median 346) are cut, and get_task still gives each whole.
10
10
  export const LINE_LIMIT = 120;
11
11
 
12
12
  // C0 and C1 controls with DEL (Cc), the line and paragraph separators (U+2028, U+2029) and format characters that