tryharness 0.7.57 → 0.7.58
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.
- package/cli.mjs +7 -0
- package/lib/onboard.mjs +121 -36
- package/lib/pairing.mjs +6 -2
- package/npm-shrinkwrap.json +14 -14
- package/package.json +4 -4
- package/release.json +7 -7
package/cli.mjs
CHANGED
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
removeAgent,
|
|
20
20
|
showLineup,
|
|
21
21
|
setupChosen,
|
|
22
|
+
setupElsewhere,
|
|
22
23
|
setupT3,
|
|
23
24
|
setupSwarm,
|
|
24
25
|
testAgent,
|
|
@@ -384,6 +385,12 @@ async function connect() {
|
|
|
384
385
|
daemonRequest,
|
|
385
386
|
ui,
|
|
386
387
|
});
|
|
388
|
+
await setupElsewhere({
|
|
389
|
+
daemonRequest,
|
|
390
|
+
ui,
|
|
391
|
+
fresh: !previous && !before.agentStates,
|
|
392
|
+
removed,
|
|
393
|
+
});
|
|
387
394
|
await setupT3({
|
|
388
395
|
ui,
|
|
389
396
|
daemonRequest,
|
package/lib/onboard.mjs
CHANGED
|
@@ -70,15 +70,21 @@ const copy = (text) => {
|
|
|
70
70
|
return result.status === 0;
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
// How long setup waits for an agent's answer to its check before moving on. A gateway on this computer (OpenClaw,
|
|
74
|
+
// Hermes) answers within seconds or is not running; Grok Bot is woken by email, whose pickups have taken up to 59 s.
|
|
75
|
+
const ANSWER_WAIT_MS = { "grok-bot": 10 * 60_000 };
|
|
76
|
+
const DEFAULT_ANSWER_WAIT_MS = 60_000;
|
|
77
|
+
|
|
78
|
+
/** Post a setup check for the agent and wait for its report: the same path real work takes. Enter skips the wait. */
|
|
74
79
|
export async function testAgent({
|
|
75
80
|
agent,
|
|
76
81
|
daemonRequest,
|
|
77
82
|
ui = createUi(),
|
|
78
|
-
waitMs =
|
|
83
|
+
waitMs = ANSWER_WAIT_MS[agent] ?? DEFAULT_ANSWER_WAIT_MS,
|
|
79
84
|
sleep = (ms) => new Promise((r) => setTimeout(r, ms)),
|
|
80
85
|
}) {
|
|
81
86
|
const name = LABEL[agent] || agent;
|
|
87
|
+
const retry = `${relayCommand()} agents test ${agent}`;
|
|
82
88
|
const posted = await daemonRequest({
|
|
83
89
|
command: "board.post",
|
|
84
90
|
agent: "user",
|
|
@@ -94,37 +100,56 @@ export async function testAgent({
|
|
|
94
100
|
);
|
|
95
101
|
return false;
|
|
96
102
|
}
|
|
97
|
-
const started = Date.now()
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
);
|
|
120
|
-
return false;
|
|
103
|
+
const started = Date.now();
|
|
104
|
+
let skipped = false;
|
|
105
|
+
const answered = (async () => {
|
|
106
|
+
while (!skipped && Date.now() - started < waitMs) {
|
|
107
|
+
await sleep(2_000);
|
|
108
|
+
const task = (
|
|
109
|
+
await daemonRequest({
|
|
110
|
+
command: "board.get",
|
|
111
|
+
agent: "user",
|
|
112
|
+
id: posted.task.id,
|
|
113
|
+
}).catch(() => null)
|
|
114
|
+
)?.task;
|
|
115
|
+
if (task?.status === "done")
|
|
116
|
+
return {
|
|
117
|
+
ok: true,
|
|
118
|
+
line: `${name} answered in ${Math.round((Date.now() - started) / 1000)}s. Ready.`,
|
|
119
|
+
};
|
|
120
|
+
if (task && ["failed", "needs_input"].includes(task.status))
|
|
121
|
+
return {
|
|
122
|
+
ok: false,
|
|
123
|
+
line: `${name} answered, but the task is ${task.status}${task.result ? `: ${task.result}` : ""}`,
|
|
124
|
+
};
|
|
121
125
|
}
|
|
126
|
+
const waited =
|
|
127
|
+
waitMs < 60_000
|
|
128
|
+
? `${Math.round(waitMs / 1000)} seconds`
|
|
129
|
+
: waitMs === 60_000
|
|
130
|
+
? "a minute"
|
|
131
|
+
: `${Math.round(waitMs / 60_000)} minutes`;
|
|
132
|
+
return {
|
|
133
|
+
ok: false,
|
|
134
|
+
line: `No answer after ${waited}. Check that ${name} is running, then: ${retry}`,
|
|
135
|
+
};
|
|
136
|
+
})();
|
|
137
|
+
if (ui.interactive) {
|
|
138
|
+
const answer = await ui.waitOrType({
|
|
139
|
+
message: `Waiting for ${name} to answer a test task`,
|
|
140
|
+
placeholder: "press Enter to skip",
|
|
141
|
+
until: answered,
|
|
142
|
+
});
|
|
143
|
+
if (answer.done) return answer.done.ok;
|
|
144
|
+
skipped = true;
|
|
145
|
+
ui.info(`Skipped. When ${name} is running: ${retry}`);
|
|
146
|
+
return false;
|
|
122
147
|
}
|
|
123
|
-
spin.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
);
|
|
127
|
-
return
|
|
148
|
+
const spin = ui.spinner();
|
|
149
|
+
spin.start(`Waiting for ${name} to answer a test task`);
|
|
150
|
+
const result = await answered;
|
|
151
|
+
spin.stop(result.line, result.ok ? 0 : 2);
|
|
152
|
+
return result.ok;
|
|
128
153
|
}
|
|
129
154
|
|
|
130
155
|
async function setupLocal({
|
|
@@ -446,11 +471,9 @@ export async function setupSwarm({
|
|
|
446
471
|
}
|
|
447
472
|
|
|
448
473
|
// 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
474
|
// A function, not a constant: the installed command only exists once setup has installed the runtime.
|
|
452
|
-
const
|
|
453
|
-
`
|
|
475
|
+
const ADD_LATER = () =>
|
|
476
|
+
`Add an agent any time: in the Harness app, Agents, then Add an agent, or run ${pc.cyan(`${relayCommand()} agents add`)}. A coding agent you install or sign in to later joins by itself once it answers.`;
|
|
454
477
|
|
|
455
478
|
const COMMAND = {
|
|
456
479
|
"claude-code": "claude",
|
|
@@ -614,7 +637,69 @@ export async function setupChosen({
|
|
|
614
637
|
);
|
|
615
638
|
for (const entry of local)
|
|
616
639
|
await setupLocal({ entry, runtimeRoot, ui, daemonRequest, ask: false });
|
|
617
|
-
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
// What each agent that runs elsewhere is, in the offer below.
|
|
643
|
+
const ELSEWHERE_HINT = {
|
|
644
|
+
"grok-bot": "Grok in its own cloud, woken by email or webhook: set up next",
|
|
645
|
+
muse: "set up in Harness once added",
|
|
646
|
+
bankr: "trades and wallets: set Bankr up in Harness so it can act",
|
|
647
|
+
};
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* The agents that run elsewhere, at the end of setup, so a person finds them without knowing their names. Quotient has
|
|
651
|
+
* nothing to set up and Bankr's setup is on the account, so on a first setup Quotient joins, and Bankr too once the
|
|
652
|
+
* person set it up in Harness; Grok Bot and Muse each need their own setup, so they are offered. An agent the person
|
|
653
|
+
* took out of their swarm (`removed`) is left out.
|
|
654
|
+
*/
|
|
655
|
+
export async function setupElsewhere({
|
|
656
|
+
daemonRequest,
|
|
657
|
+
ui = createUi(),
|
|
658
|
+
fresh,
|
|
659
|
+
removed = [],
|
|
660
|
+
clipboard = copy,
|
|
661
|
+
}) {
|
|
662
|
+
const lineup = await daemonRequest({ command: "swarm.lineup" }).catch(
|
|
663
|
+
() => null
|
|
664
|
+
);
|
|
665
|
+
if (lineup?.ok) {
|
|
666
|
+
const outside = (id) =>
|
|
667
|
+
!removed.includes(id) &&
|
|
668
|
+
lineup.agents.some((entry) => entry.id === id && !entry.inSwarm);
|
|
669
|
+
const account = await daemonRequest({
|
|
670
|
+
command: "wake.server",
|
|
671
|
+
input: { action: "list" },
|
|
672
|
+
}).catch(() => null);
|
|
673
|
+
const joining = fresh
|
|
674
|
+
? ["quotient", ...(account?.bankrWallet ? ["bankr"] : [])].filter(outside)
|
|
675
|
+
: [];
|
|
676
|
+
const joined = [];
|
|
677
|
+
for (const id of joining) {
|
|
678
|
+
const added = await daemonRequest({ command: "swarm.add", target: id });
|
|
679
|
+
if (added?.ok) joined.push({ id, name: added.name });
|
|
680
|
+
}
|
|
681
|
+
if (joined.length)
|
|
682
|
+
ui.success(
|
|
683
|
+
`${joined.map((agent) => agent.name).join(" and ")} ${joined.length > 1 ? "are" : "is"} in your swarm ${pc.dim(`· ${joined.length > 1 ? "they run" : "it runs"} on Harness, nothing to set up`)}`
|
|
684
|
+
);
|
|
685
|
+
const offered = ["grok-bot", "muse", "bankr"].filter(
|
|
686
|
+
(id) => outside(id) && !joined.some((agent) => agent.id === id)
|
|
687
|
+
);
|
|
688
|
+
if (offered.length && ui.interactive) {
|
|
689
|
+
const picked =
|
|
690
|
+
(await ui.multiselect({
|
|
691
|
+
message: `Agents that run elsewhere. Add any? ${pc.dim("(space to tick, enter to go on)")}`,
|
|
692
|
+
options: offered.map((id) => ({
|
|
693
|
+
value: id,
|
|
694
|
+
label: lineup.agents.find((entry) => entry.id === id).name,
|
|
695
|
+
hint: ELSEWHERE_HINT[id],
|
|
696
|
+
})),
|
|
697
|
+
})) ?? [];
|
|
698
|
+
if (picked.length)
|
|
699
|
+
await addAgents({ daemonRequest, wanted: picked, ui, clipboard });
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
ui.info(ADD_LATER());
|
|
618
703
|
}
|
|
619
704
|
|
|
620
705
|
// A function, not a constant: the installed command only exists once setup has installed the runtime.
|
package/lib/pairing.mjs
CHANGED
|
@@ -176,11 +176,15 @@ export async function joinSwarm({
|
|
|
176
176
|
const started = Date.now();
|
|
177
177
|
let told = false;
|
|
178
178
|
while (listed?.joinCode && Date.now() - started < waitMs) {
|
|
179
|
+
// The steps go above the spinner once: a spinner line wider than the terminal wraps, and every frame then
|
|
180
|
+
// prints it again.
|
|
179
181
|
if (!told && Date.now() - started > quietMs) {
|
|
180
182
|
told = true;
|
|
181
|
-
spin.
|
|
182
|
-
|
|
183
|
+
spin.stop(`Waiting for ${homeName()}`);
|
|
184
|
+
ui.info(
|
|
185
|
+
`On ${homeName()}, click the Harness icon in the menu bar, choose Add a Computer, and type ${listed.joinCode}${listed.joinCode === code ? " (the same code)" : ""}. Or run there: npx tryharness machines add ${listed.joinCode}. This computer already works on its own, so you can close this.`
|
|
183
186
|
);
|
|
187
|
+
spin.start(`Waiting for ${homeName()}`);
|
|
184
188
|
}
|
|
185
189
|
await new Promise((resolve) => setTimeout(resolve, 1_000));
|
|
186
190
|
listed = (await read()) ?? listed;
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tryharness",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.58",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "tryharness",
|
|
9
|
-
"version": "0.7.
|
|
9
|
+
"version": "0.7.58",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@agentclientprotocol/sdk": "2.0.0",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"node": ">=18"
|
|
33
33
|
},
|
|
34
34
|
"optionalDependencies": {
|
|
35
|
-
"tryharness-desktop-darwin-arm64": "0.7.
|
|
36
|
-
"tryharness-desktop-darwin-x64": "0.7.
|
|
37
|
-
"tryharness-desktop-linux-x64": "0.7.
|
|
35
|
+
"tryharness-desktop-darwin-arm64": "0.7.58",
|
|
36
|
+
"tryharness-desktop-darwin-x64": "0.7.58",
|
|
37
|
+
"tryharness-desktop-linux-x64": "0.7.58"
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"node_modules/@agentclientprotocol/sdk": {
|
|
@@ -1051,9 +1051,9 @@
|
|
|
1051
1051
|
}
|
|
1052
1052
|
},
|
|
1053
1053
|
"node_modules/tryharness-desktop-darwin-arm64": {
|
|
1054
|
-
"version": "0.7.
|
|
1055
|
-
"resolved": "https://registry.npmjs.org/tryharness-desktop-darwin-arm64/-/tryharness-desktop-darwin-arm64-0.7.
|
|
1056
|
-
"integrity": "sha512-
|
|
1054
|
+
"version": "0.7.58",
|
|
1055
|
+
"resolved": "https://registry.npmjs.org/tryharness-desktop-darwin-arm64/-/tryharness-desktop-darwin-arm64-0.7.58.tgz",
|
|
1056
|
+
"integrity": "sha512-9510OCbkbj9Dz2Br9hpWYCOzHQtMO+jhbXsLs+Rumo0D9ftDJFxo6EW275URBewLdPCXWo2KhPPB4n5IeJuc0g==",
|
|
1057
1057
|
"cpu": [
|
|
1058
1058
|
"arm64"
|
|
1059
1059
|
],
|
|
@@ -1064,9 +1064,9 @@
|
|
|
1064
1064
|
]
|
|
1065
1065
|
},
|
|
1066
1066
|
"node_modules/tryharness-desktop-darwin-x64": {
|
|
1067
|
-
"version": "0.7.
|
|
1068
|
-
"resolved": "https://registry.npmjs.org/tryharness-desktop-darwin-x64/-/tryharness-desktop-darwin-x64-0.7.
|
|
1069
|
-
"integrity": "sha512-
|
|
1067
|
+
"version": "0.7.58",
|
|
1068
|
+
"resolved": "https://registry.npmjs.org/tryharness-desktop-darwin-x64/-/tryharness-desktop-darwin-x64-0.7.58.tgz",
|
|
1069
|
+
"integrity": "sha512-dkrxfhFRm4yOajAt8hBegbx25pxO16y/nJ+NmIVkY0Tr31Dq5QEhvlUHOsDFw4mNhS8NM2HaE0bvnKK7OeqVUg==",
|
|
1070
1070
|
"cpu": [
|
|
1071
1071
|
"x64"
|
|
1072
1072
|
],
|
|
@@ -1077,9 +1077,9 @@
|
|
|
1077
1077
|
]
|
|
1078
1078
|
},
|
|
1079
1079
|
"node_modules/tryharness-desktop-linux-x64": {
|
|
1080
|
-
"version": "0.7.
|
|
1081
|
-
"resolved": "https://registry.npmjs.org/tryharness-desktop-linux-x64/-/tryharness-desktop-linux-x64-0.7.
|
|
1082
|
-
"integrity": "sha512-
|
|
1080
|
+
"version": "0.7.58",
|
|
1081
|
+
"resolved": "https://registry.npmjs.org/tryharness-desktop-linux-x64/-/tryharness-desktop-linux-x64-0.7.58.tgz",
|
|
1082
|
+
"integrity": "sha512-SqBq6TME7UEP2wUo3EdZVH54QHAd2LfeC1AnoI/8i9l31YFBk0civ69lFpeXmsjJZfMhOhwupZz0hLzIJ2SE8A==",
|
|
1083
1083
|
"cpu": [
|
|
1084
1084
|
"x64"
|
|
1085
1085
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tryharness",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.58",
|
|
4
4
|
"description": "Harness Relay: the daemon that turns the agents on this machine into your personal swarm. Memory, history, and work handed between any of them.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"tryharness": "cli.mjs"
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"zod": "4.6.7"
|
|
49
49
|
},
|
|
50
50
|
"optionalDependencies": {
|
|
51
|
-
"tryharness-desktop-darwin-arm64": "0.7.
|
|
52
|
-
"tryharness-desktop-darwin-x64": "0.7.
|
|
53
|
-
"tryharness-desktop-linux-x64": "0.7.
|
|
51
|
+
"tryharness-desktop-darwin-arm64": "0.7.58",
|
|
52
|
+
"tryharness-desktop-darwin-x64": "0.7.58",
|
|
53
|
+
"tryharness-desktop-linux-x64": "0.7.58"
|
|
54
54
|
}
|
|
55
55
|
}
|
package/release.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest": {
|
|
3
3
|
"name": "tryharness",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.58",
|
|
5
5
|
"files": {
|
|
6
6
|
"README.md": "b1c3d6f614dd896b6ffda089c512811ea21c41f2970181162cdba230ac7fb77e",
|
|
7
7
|
"assets/dsh-plugin.mjs": "143d31361d3c34b0a9effdeaa9248f1df6166f9bb45826a9a96ec9aa21899411",
|
|
8
8
|
"assets/opencode-plugin.js": "3f0d2f533f648dbfddbe0ea77dcb2c5bc8d4969ac8c2f1fc8c3af196fe91cb3e",
|
|
9
9
|
"assets/pi-extension.ts": "2803040a0adeeb32ad1aece491eacb70f492dc39a7181ad504eea8b3cffd26a2",
|
|
10
|
-
"cli.mjs": "
|
|
10
|
+
"cli.mjs": "f45d47058ea12d8850e6a42edad26031c34fe9be665bab4e3f033c68ca614281",
|
|
11
11
|
"lib/activity.mjs": "e90b877d34bd4a8af84621f0475a99789d871dfc9cfea1dfffaf37b76e5a1459",
|
|
12
12
|
"lib/actorRoster.mjs": "8cea41c9f6225618f3e6b52c4ae9dedd3584882e757ca70273b389c306548d29",
|
|
13
13
|
"lib/adapters.mjs": "f349e8651610bcd4e6517365edbb72d6722726aa85868320907867dffdb151ca",
|
|
@@ -116,11 +116,11 @@
|
|
|
116
116
|
"lib/notify.mjs": "59d3b0c75561339e5c15cbca182c6a15e401140eabbbded0c40f30d5e3e2ccd8",
|
|
117
117
|
"lib/nudge.mjs": "7778446ddd7df6a93d049719d3fb3d45fe1cfac32d3407f489a4d4685a2cf767",
|
|
118
118
|
"lib/ocr.mjs": "0f9b94f1a9daf20841cbad83924827e1b7c34c656565d88ac33bdb2d38779885",
|
|
119
|
-
"lib/onboard.mjs": "
|
|
119
|
+
"lib/onboard.mjs": "5359c9d5e3c22b2ac0acfadfb310a896d22cd881cdcccfacc8ed19c941935e57",
|
|
120
120
|
"lib/oneLine.mjs": "0864a8fcc1138dd5f62bc1147fbcc70a9d181d7ec3301b51e00aca25ee93d249",
|
|
121
121
|
"lib/oneclawLocal.mjs": "da17884178b1a88e5cc4125b5112ae5def66806fdf934e0ad73bafb641a7dc97",
|
|
122
122
|
"lib/ownMachines.mjs": "187c5f887dc7b1cd86c0ce4a7e93850bdd2849805ac9ad758c192b391c7d1274",
|
|
123
|
-
"lib/pairing.mjs": "
|
|
123
|
+
"lib/pairing.mjs": "4f0328f1876ff9a7275759a061cee69e44108db490966489ef0eb7ff6c0804c9",
|
|
124
124
|
"lib/parsers.mjs": "b329b683cf36939984dfc7463b8584f74bb5eb00f34ad89bf7e80abd7145bbf2",
|
|
125
125
|
"lib/paths.mjs": "087afff9453fad097e766ee3a46af5d76c8cd1112ffce291db7e35cde08a0088",
|
|
126
126
|
"lib/peerProcess.mjs": "041b8760b21ce0762294f084bf5244d54bff793ed686fcc6b22c40dc4f0d0f51",
|
|
@@ -211,10 +211,10 @@
|
|
|
211
211
|
"lib/workFocus.mjs": "08d3002d6114859bf7623fbcb62a5ed1dd12cecba6c8e37ed55a550a15a207a4",
|
|
212
212
|
"lib/workLinks.mjs": "8269180900fdf5fbd547a4c2337bcde4d5f733621c5b72bc2c23f01e72ad3d7d",
|
|
213
213
|
"lib/worktrees.mjs": "a040441863ee76e39e292e262b903b392e12d4158aa886e4c237b6fa98c0d7d2",
|
|
214
|
-
"npm-shrinkwrap.json": "
|
|
215
|
-
"package.json": "
|
|
214
|
+
"npm-shrinkwrap.json": "91f7cb413f4e2ddf52f9aaefa467475083e3564db0462d501ee5871cab87e378",
|
|
215
|
+
"package.json": "784680ceb46d8ee20602dd44c674756e1216fe8c370d01b24e3223cce6238840"
|
|
216
216
|
}
|
|
217
217
|
},
|
|
218
218
|
"key": "5bf9e60f5cabb530",
|
|
219
|
-
"signature": "
|
|
219
|
+
"signature": "chK2AwW3tfOTAMEWOJW1/hCs54+hlIisAKlLnnwL+viYhiAlzw0341YV0WYgR6HIRqKOX0PnT/Zn69X0+YIEBQ=="
|
|
220
220
|
}
|