tryharness 0.7.68 → 0.7.70
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 +33 -13
- package/lib/boardCommands.mjs +1 -2
- package/lib/boardProtocol.json +47 -64
- package/lib/cards.mjs +15 -3
- package/lib/comfyExecution.mjs +545 -0
- package/lib/computerAddress.mjs +150 -0
- package/lib/coordinator.mjs +201 -13
- package/lib/daemon.mjs +161 -9
- package/lib/dispatchContract.json +313 -0
- package/lib/dispatchTools.js +87 -0
- package/lib/dispatches.mjs +975 -0
- package/lib/goalCommands.mjs +13 -1
- package/lib/localAgentAsk.mjs +27 -4
- package/lib/machineRoutes.mjs +5 -0
- package/lib/machineRuns.mjs +58 -11
- package/lib/mcp-stdio.mjs +69 -5
- package/lib/ownMachines.mjs +182 -51
- package/lib/promptDecider.mjs +471 -0
- package/lib/promptFlow.mjs +562 -0
- package/lib/promptScopes.mjs +670 -0
- package/lib/provenance.mjs +3 -2
- package/lib/runAuthority.mjs +171 -3
- package/lib/runBrief.mjs +1 -1
- package/lib/runWorker.mjs +44 -6
- package/lib/runner.mjs +62 -6
- package/lib/store.mjs +417 -20
- package/lib/swarm.mjs +35 -15
- package/lib/taskCommands.mjs +271 -10
- package/lib/team.json +10 -0
- package/lib/team.mjs +270 -14
- package/lib/threadActions.mjs +54 -18
- package/lib/threadBriefs.mjs +30 -29
- package/lib/threadRuns.mjs +160 -9
- package/lib/wakes.mjs +1 -1
- package/npm-shrinkwrap.json +10 -10
- package/package.json +3 -3
- package/release.json +38 -30
package/cli.mjs
CHANGED
|
@@ -1247,7 +1247,8 @@ async function board() {
|
|
|
1247
1247
|
}
|
|
1248
1248
|
// Standing permission: a coding agent starts the tasks you or Harness post for it without a Start. On by default
|
|
1249
1249
|
// for the folders you have used it in; name folders and a daily cap instead, turn it off, or back on to the default.
|
|
1250
|
-
// Tasks another agent wrote
|
|
1250
|
+
// Tasks another agent wrote wait for you, except a clean ask from one of your own agents elsewhere you named with
|
|
1251
|
+
// --from (Grok Bot, Muse) in a thread; --from none takes them back.
|
|
1251
1252
|
if (sub === "standing") {
|
|
1252
1253
|
const rest = argv
|
|
1253
1254
|
.slice(argv.indexOf(sub) + 1)
|
|
@@ -1255,33 +1256,49 @@ async function board() {
|
|
|
1255
1256
|
(value, index, all) =>
|
|
1256
1257
|
!value.startsWith("--") &&
|
|
1257
1258
|
all[index - 1] !== "--cap" &&
|
|
1258
|
-
all[index - 1] !== "--as"
|
|
1259
|
+
all[index - 1] !== "--as" &&
|
|
1260
|
+
all[index - 1] !== "--from"
|
|
1259
1261
|
);
|
|
1260
1262
|
const [target, ...dirs] = rest;
|
|
1261
1263
|
const usage =
|
|
1262
|
-
"usage: tryharness board standing [<agent> <folder> [<folder>...] [--cap <runs a day, default 10>] | <agent> off | <agent> on]";
|
|
1264
|
+
"usage: tryharness board standing [<agent> <folder> [<folder>...] [--cap <runs a day, default 10>] | <agent> off | <agent> on | <agent> --from <grok-bot|muse>[,...] | <agent> --from none]";
|
|
1263
1265
|
if (target && !AGENTS.includes(target)) throw new Error(usage);
|
|
1264
1266
|
const toggle =
|
|
1265
1267
|
dirs.length === 1 && ["on", "off"].includes(dirs[0]) ? dirs[0] : null;
|
|
1268
|
+
const from = argv.includes("--from") ? arg("--from", "") : null;
|
|
1269
|
+
const proposers =
|
|
1270
|
+
from === null
|
|
1271
|
+
? undefined
|
|
1272
|
+
: from === "none"
|
|
1273
|
+
? []
|
|
1274
|
+
: from.split(",").filter(Boolean);
|
|
1266
1275
|
const response = !target
|
|
1267
1276
|
? await daemonRequest({ command: "board.standing", agent })
|
|
1268
|
-
:
|
|
1277
|
+
: proposers && !dirs.length
|
|
1269
1278
|
? await daemonRequest({
|
|
1270
|
-
command:
|
|
1279
|
+
command: "board.standing.set",
|
|
1271
1280
|
agent,
|
|
1272
1281
|
targetAgent: target,
|
|
1282
|
+
proposers,
|
|
1273
1283
|
})
|
|
1274
|
-
:
|
|
1284
|
+
: toggle
|
|
1275
1285
|
? await daemonRequest({
|
|
1276
|
-
command:
|
|
1286
|
+
command: `board.standing.${toggle}`,
|
|
1277
1287
|
agent,
|
|
1278
1288
|
targetAgent: target,
|
|
1279
|
-
workspaces: dirs.map((dir) => path.resolve(dir)),
|
|
1280
|
-
dailyCap: Number(arg("--cap", "10")),
|
|
1281
1289
|
})
|
|
1282
|
-
:
|
|
1283
|
-
|
|
1284
|
-
|
|
1290
|
+
: dirs.length
|
|
1291
|
+
? await daemonRequest({
|
|
1292
|
+
command: "board.standing.set",
|
|
1293
|
+
agent,
|
|
1294
|
+
targetAgent: target,
|
|
1295
|
+
workspaces: dirs.map((dir) => path.resolve(dir)),
|
|
1296
|
+
dailyCap: Number(arg("--cap", "10")),
|
|
1297
|
+
...(proposers ? { proposers } : {}),
|
|
1298
|
+
})
|
|
1299
|
+
: (() => {
|
|
1300
|
+
throw new Error(usage);
|
|
1301
|
+
})();
|
|
1285
1302
|
if (!response.ok)
|
|
1286
1303
|
throw new Error(response.error || "standing permission failed");
|
|
1287
1304
|
if (!response.standing.length) {
|
|
@@ -1301,8 +1318,11 @@ async function board() {
|
|
|
1301
1318
|
? `in the ${rule.workspaces.length} folder${rule.workspaces.length === 1 ? "" : "s"} you have used it in (${rule.workspaces.slice(0, 5).join(", ")}${rule.workspaces.length > 5 ? ", ..." : ""})`
|
|
1302
1319
|
: "in folders you have used it in (none yet)"
|
|
1303
1320
|
: `in ${rule.workspaces.join(", ")}`;
|
|
1321
|
+
const from = rule.proposers?.length
|
|
1322
|
+
? `, and on clean asks from ${rule.proposers.join(", ")} in a thread (stop: ${relayCommand()} board standing ${rule.agent} --from none)`
|
|
1323
|
+
: "";
|
|
1304
1324
|
console.log(
|
|
1305
|
-
`${rule.agent} starts tasks from you or Harness without asking, ${where}; ${rule.runs_today} of ${rule.daily_cap} today. Turn it off: ${relayCommand()} board standing ${rule.agent} off`
|
|
1325
|
+
`${rule.agent} starts tasks from you or Harness without asking${from}, ${where}; ${rule.runs_today} of ${rule.daily_cap} today. Turn it off: ${relayCommand()} board standing ${rule.agent} off`
|
|
1306
1326
|
);
|
|
1307
1327
|
}
|
|
1308
1328
|
return;
|
package/lib/boardCommands.mjs
CHANGED
|
@@ -17,13 +17,12 @@ export function createBoardCommands({
|
|
|
17
17
|
const agent = String(request.agent);
|
|
18
18
|
// The computer the call came from: this one, or a worker whose call home opened (ownMachines.mjs).
|
|
19
19
|
const machine = machineOf(request);
|
|
20
|
-
const lastLooked = store.lastSeenAt(agent, machine);
|
|
21
20
|
store.touchAgent(agent, machine);
|
|
22
21
|
const id = String(request.id || "");
|
|
23
22
|
const expected = Number.isInteger(request.expectedVersion)
|
|
24
23
|
? request.expectedVersion
|
|
25
24
|
: null;
|
|
26
|
-
const context = { agent,
|
|
25
|
+
const context = { agent, id, expected, machine };
|
|
27
26
|
const owner = boardCommandOwner(String(request.command));
|
|
28
27
|
const handler = Object.hasOwn(handlers, owner) ? handlers[owner] : task;
|
|
29
28
|
return handler(request, context);
|
package/lib/boardProtocol.json
CHANGED
|
@@ -17,6 +17,22 @@
|
|
|
17
17
|
"board.answer": "task",
|
|
18
18
|
"board.audio.listen": "tools",
|
|
19
19
|
"board.children": "task",
|
|
20
|
+
"board.dispatch.scope.create": "task",
|
|
21
|
+
"board.dispatch.scope.read": "task",
|
|
22
|
+
"board.dispatch.scope.list": "task",
|
|
23
|
+
"board.dispatch.scope.revoke": "task",
|
|
24
|
+
"board.dispatch.propose": "task",
|
|
25
|
+
"board.dispatch.prompt": "task",
|
|
26
|
+
"board.prompt.start": "task",
|
|
27
|
+
"board.prompt.status": "task",
|
|
28
|
+
"board.prompt.cancel": "task",
|
|
29
|
+
"board.prompt.receipt": "task",
|
|
30
|
+
"board.dispatch.workspace": "task",
|
|
31
|
+
"board.dispatch.view": "task",
|
|
32
|
+
"board.dispatch.apply": "task",
|
|
33
|
+
"board.dispatch.advisory": "task",
|
|
34
|
+
"board.dispatch.advisories": "task",
|
|
35
|
+
"board.dispatch.revoke": "task",
|
|
20
36
|
"board.claim": "task",
|
|
21
37
|
"board.code.search": "tools",
|
|
22
38
|
"board.context.add": "task",
|
|
@@ -203,101 +219,67 @@
|
|
|
203
219
|
"families": [
|
|
204
220
|
{
|
|
205
221
|
"owner": "goals",
|
|
206
|
-
"prefixes": [
|
|
207
|
-
"board.goal.",
|
|
208
|
-
"board.room."
|
|
209
|
-
]
|
|
222
|
+
"prefixes": ["board.goal.", "board.room."]
|
|
210
223
|
},
|
|
211
224
|
{
|
|
212
225
|
"owner": "swarm",
|
|
213
|
-
"prefixes": [
|
|
214
|
-
"board.swarm."
|
|
215
|
-
]
|
|
226
|
+
"prefixes": ["board.swarm."]
|
|
216
227
|
},
|
|
217
228
|
{
|
|
218
229
|
"owner": "landed",
|
|
219
|
-
"prefixes": [
|
|
220
|
-
"board.landed."
|
|
221
|
-
]
|
|
230
|
+
"prefixes": ["board.landed."]
|
|
222
231
|
},
|
|
223
232
|
{
|
|
224
233
|
"owner": "relay",
|
|
225
|
-
"prefixes": [
|
|
226
|
-
"board.relay."
|
|
227
|
-
]
|
|
234
|
+
"prefixes": ["board.relay."]
|
|
228
235
|
},
|
|
229
236
|
{
|
|
230
237
|
"owner": "place",
|
|
231
|
-
"prefixes": [
|
|
232
|
-
"board.place."
|
|
233
|
-
]
|
|
238
|
+
"prefixes": ["board.place."]
|
|
234
239
|
},
|
|
235
240
|
{
|
|
236
241
|
"owner": "live",
|
|
237
|
-
"prefixes": [
|
|
238
|
-
"board.live"
|
|
239
|
-
]
|
|
242
|
+
"prefixes": ["board.live"]
|
|
240
243
|
},
|
|
241
244
|
{
|
|
242
245
|
"owner": "watch",
|
|
243
|
-
"prefixes": [
|
|
244
|
-
"board.watch."
|
|
245
|
-
]
|
|
246
|
+
"prefixes": ["board.watch."]
|
|
246
247
|
},
|
|
247
248
|
{
|
|
248
249
|
"owner": "thread",
|
|
249
|
-
"prefixes": [
|
|
250
|
-
"board.thread."
|
|
251
|
-
]
|
|
250
|
+
"prefixes": ["board.thread."]
|
|
252
251
|
},
|
|
253
252
|
{
|
|
254
253
|
"owner": "file",
|
|
255
|
-
"prefixes": [
|
|
256
|
-
"board.file."
|
|
257
|
-
]
|
|
254
|
+
"prefixes": ["board.file."]
|
|
258
255
|
},
|
|
259
256
|
{
|
|
260
257
|
"owner": "plans",
|
|
261
|
-
"prefixes": [
|
|
262
|
-
"board.plan.",
|
|
263
|
-
"board.template."
|
|
264
|
-
]
|
|
258
|
+
"prefixes": ["board.plan.", "board.template."]
|
|
265
259
|
},
|
|
266
260
|
{
|
|
267
261
|
"owner": "projects",
|
|
268
|
-
"prefixes": [
|
|
269
|
-
"board.project."
|
|
270
|
-
]
|
|
262
|
+
"prefixes": ["board.project."]
|
|
271
263
|
},
|
|
272
264
|
{
|
|
273
265
|
"owner": "environments",
|
|
274
|
-
"prefixes": [
|
|
275
|
-
"board.environments."
|
|
276
|
-
]
|
|
266
|
+
"prefixes": ["board.environments."]
|
|
277
267
|
},
|
|
278
268
|
{
|
|
279
269
|
"owner": "nativeRequests",
|
|
280
|
-
"prefixes": [
|
|
281
|
-
"board.native."
|
|
282
|
-
]
|
|
270
|
+
"prefixes": ["board.native."]
|
|
283
271
|
},
|
|
284
272
|
{
|
|
285
273
|
"owner": "vault",
|
|
286
|
-
"prefixes": [
|
|
287
|
-
"board.vault."
|
|
288
|
-
]
|
|
274
|
+
"prefixes": ["board.vault."]
|
|
289
275
|
},
|
|
290
276
|
{
|
|
291
277
|
"owner": "desk",
|
|
292
|
-
"prefixes": [
|
|
293
|
-
"board.desk."
|
|
294
|
-
]
|
|
278
|
+
"prefixes": ["board.desk."]
|
|
295
279
|
},
|
|
296
280
|
{
|
|
297
281
|
"owner": "audit",
|
|
298
|
-
"prefixes": [
|
|
299
|
-
"board.audit."
|
|
300
|
-
]
|
|
282
|
+
"prefixes": ["board.audit."]
|
|
301
283
|
}
|
|
302
284
|
],
|
|
303
285
|
"access": {
|
|
@@ -394,7 +376,10 @@
|
|
|
394
376
|
"board.swarm.specialty",
|
|
395
377
|
"board.swarm.pin",
|
|
396
378
|
"board.swarm.offices",
|
|
397
|
-
"board.swarm.office"
|
|
379
|
+
"board.swarm.office",
|
|
380
|
+
"board.prompt.start",
|
|
381
|
+
"board.prompt.status",
|
|
382
|
+
"board.prompt.cancel"
|
|
398
383
|
],
|
|
399
384
|
"browserPerson": [
|
|
400
385
|
"board.list",
|
|
@@ -516,7 +501,10 @@
|
|
|
516
501
|
"board.vault.share",
|
|
517
502
|
"board.vault.unshare",
|
|
518
503
|
"board.vault.import",
|
|
519
|
-
"board.vault.allow"
|
|
504
|
+
"board.vault.allow",
|
|
505
|
+
"board.prompt.start",
|
|
506
|
+
"board.prompt.status",
|
|
507
|
+
"board.prompt.cancel"
|
|
520
508
|
],
|
|
521
509
|
"harnessBrowser": [
|
|
522
510
|
"board.list",
|
|
@@ -775,11 +763,12 @@
|
|
|
775
763
|
"board.wait",
|
|
776
764
|
"board.landed.thread",
|
|
777
765
|
"board.landed.folder",
|
|
778
|
-
"board.landed.open"
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
"board.
|
|
766
|
+
"board.landed.open",
|
|
767
|
+
"board.prompt.start",
|
|
768
|
+
"board.prompt.status",
|
|
769
|
+
"board.prompt.cancel"
|
|
782
770
|
],
|
|
771
|
+
"plainPerson": ["board.standing.off"],
|
|
783
772
|
"plainHarnessReads": [
|
|
784
773
|
"board.list",
|
|
785
774
|
"board.get",
|
|
@@ -815,14 +804,8 @@
|
|
|
815
804
|
"agents.models",
|
|
816
805
|
"agents.model"
|
|
817
806
|
],
|
|
818
|
-
"browserLinks": [
|
|
819
|
-
|
|
820
|
-
"links.list",
|
|
821
|
-
"links.forget"
|
|
822
|
-
],
|
|
823
|
-
"browserSsh": [
|
|
824
|
-
"ssh.allow"
|
|
825
|
-
]
|
|
807
|
+
"browserLinks": ["links.allow", "links.list", "links.forget"],
|
|
808
|
+
"browserSsh": ["ssh.allow"]
|
|
826
809
|
},
|
|
827
810
|
"metadata": {
|
|
828
811
|
"task": [
|
package/lib/cards.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computerHandle } from "./
|
|
1
|
+
import { computerHandle } from "./computerAddress.mjs";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
import { member, nameOf } from "./members.mjs";
|
|
4
4
|
import { agentModelInUse, describeAgentModel } from "./models.mjs";
|
|
@@ -92,7 +92,12 @@ export const roundFields = (card) => ({
|
|
|
92
92
|
// `lessons`: what the person has said about each agent (lessons.mjs), left off a card going to a caller off this computer.
|
|
93
93
|
export function swarmCards(store, entries, { home, lessons = true } = {}) {
|
|
94
94
|
const work = new Map();
|
|
95
|
-
|
|
95
|
+
const rows = store.agentWork();
|
|
96
|
+
const recent = rows
|
|
97
|
+
.slice()
|
|
98
|
+
.sort((a, b) => Date.parse(b.started_at) - Date.parse(a.started_at))
|
|
99
|
+
.slice(0, RECENT);
|
|
100
|
+
for (const row of rows) {
|
|
96
101
|
const entry = work.get(row.agent) ?? {
|
|
97
102
|
done: 0,
|
|
98
103
|
failed: 0,
|
|
@@ -146,6 +151,13 @@ export function swarmCards(store, entries, { home, lessons = true } = {}) {
|
|
|
146
151
|
about: roster.about ?? "",
|
|
147
152
|
limits: roster.limits ?? null,
|
|
148
153
|
where: roster.where ?? null,
|
|
154
|
+
editsFiles: roster.runs === "machine",
|
|
155
|
+
recentSelections: {
|
|
156
|
+
count: recent.filter((row) => row.agent === entry.id).length,
|
|
157
|
+
outOf: recent.length,
|
|
158
|
+
lastAt:
|
|
159
|
+
recent.find((row) => row.agent === entry.id)?.started_at ?? null,
|
|
160
|
+
},
|
|
149
161
|
...(roster.runs === "machine"
|
|
150
162
|
? {
|
|
151
163
|
review: roster.review === true,
|
|
@@ -260,7 +272,7 @@ export function cardLine(card, now = Date.now(), { evidence = true } = {}) {
|
|
|
260
272
|
if (specialties) parts.push(specialties);
|
|
261
273
|
if (card.machines?.length)
|
|
262
274
|
parts.push(
|
|
263
|
-
`On the person's computers: ${card.machines.map((computer) => `${card.name} (${computer.label}${computer.online ? "" : ", offline"})`).join(", ")}; name one
|
|
275
|
+
`On the person's computers: ${card.machines.map((computer) => `${card.name} (${computer.label}${computer.online ? "" : ", offline"})`).join(", ")}; name one in a thread (@${card.id} on ${computerHandle(card.machines[0].label)}), or with target_machine on a task, thread or post.`
|
|
264
276
|
);
|
|
265
277
|
parts.push(sentence(card.answers));
|
|
266
278
|
const { done, failed, ended, medianMinutes } = card.record;
|