tryharness 0.7.72 → 0.7.73
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/assets/opencode-plugin.js +70 -3
- package/lib/asks.mjs +2 -0
- package/lib/boardCommands.mjs +9 -1
- package/lib/boardProtocol.json +23 -19
- package/lib/bridge.mjs +2 -0
- package/lib/capabilityCheck.mjs +86 -0
- package/lib/computerAddress.mjs +6 -14
- package/lib/coordinator.mjs +207 -26
- package/lib/daemon.mjs +150 -125
- package/lib/dispatchContract.json +1 -31
- package/lib/dispatchTools.js +8 -39
- package/lib/dispatches.mjs +27 -285
- package/lib/goalCommands.mjs +7 -3
- package/lib/herdr.mjs +159 -0
- package/lib/hookDialects.mjs +36 -2
- package/lib/jobAnswers.mjs +3 -0
- package/lib/kanban.mjs +256 -0
- package/lib/localAgentAsk.mjs +20 -29
- package/lib/machineRoutes.mjs +1 -5
- package/lib/manager.mjs +254 -0
- package/lib/mcp-stdio.mjs +58 -39
- package/lib/moves.mjs +365 -0
- package/lib/nudge.mjs +13 -3
- package/lib/ownMachines.mjs +43 -6
- package/lib/places.mjs +29 -2
- package/lib/runAuthority.mjs +2 -14
- package/lib/runBrief.mjs +14 -1
- package/lib/runWorker.mjs +4 -10
- package/lib/runner.mjs +1 -49
- package/lib/sessionControl.mjs +65 -1
- package/lib/steerHook.mjs +124 -0
- package/lib/steerQueue.mjs +176 -0
- package/lib/store.mjs +9 -23
- package/lib/subagentSteering.mjs +363 -0
- package/lib/subagents.mjs +138 -29
- package/lib/swarm.mjs +13 -3
- package/lib/taskCommands.mjs +0 -62
- package/lib/threadActions.mjs +4 -2
- package/lib/threadBriefs.mjs +9 -3
- package/lib/threadRuns.mjs +13 -0
- package/npm-shrinkwrap.json +14 -14
- package/package.json +4 -4
- package/release.json +44 -40
- package/lib/comfyExecution.mjs +0 -545
- package/lib/promptDecider.mjs +0 -471
- package/lib/promptFlow.mjs +0 -597
- package/lib/promptScopes.mjs +0 -670
package/lib/daemon.mjs
CHANGED
|
@@ -15,6 +15,7 @@ import { createSpecialtyNotice } from "./specialtyNotice.mjs";
|
|
|
15
15
|
import { specialtiesOf } from "./specialties.mjs";
|
|
16
16
|
import { underperforming } from "./record.mjs";
|
|
17
17
|
import { createSubagents } from "./subagents.mjs";
|
|
18
|
+
import { createSubagentSteering } from "./subagentSteering.mjs";
|
|
18
19
|
import { createEnvironments } from "./environments.mjs";
|
|
19
20
|
import { createGuestRequests } from "./guestRequests.mjs";
|
|
20
21
|
import {
|
|
@@ -23,7 +24,9 @@ import {
|
|
|
23
24
|
viewRequest,
|
|
24
25
|
} from "./liveViews.mjs";
|
|
25
26
|
import { createBoardWaits } from "./boardWaits.mjs";
|
|
26
|
-
import { createCoordinator } from "./coordinator.mjs";
|
|
27
|
+
import { createCoordinator, going } from "./coordinator.mjs";
|
|
28
|
+
import { createMoves } from "./moves.mjs";
|
|
29
|
+
import { createManager } from "./manager.mjs";
|
|
27
30
|
import { createServerWords } from "./serverWords.mjs";
|
|
28
31
|
import { LOCAL_DECIDERS } from "./localAgentAsk.mjs";
|
|
29
32
|
import { createHarnessLane } from "./lane.mjs";
|
|
@@ -129,6 +132,7 @@ import { startUpdate } from "./selfUpdate.mjs";
|
|
|
129
132
|
import { createBoardBackup } from "./boardBackup.mjs";
|
|
130
133
|
import { createMachineRuns } from "./machineRuns.mjs";
|
|
131
134
|
import { createPlans } from "./plans.mjs";
|
|
135
|
+
import { createKanban } from "./kanban.mjs";
|
|
132
136
|
import { createAdoption } from "./adoption.mjs";
|
|
133
137
|
import { createBoardWatches } from "./boardWatches.mjs";
|
|
134
138
|
import { createBoardTools } from "./boardTools.mjs";
|
|
@@ -164,9 +168,7 @@ import {
|
|
|
164
168
|
import { createThreadActions, inRoom, mentionsIn } from "./threadActions.mjs";
|
|
165
169
|
import { createThreadAuthority } from "./threadAuthority.mjs";
|
|
166
170
|
import { createDispatches } from "./dispatches.mjs";
|
|
167
|
-
import {
|
|
168
|
-
import { createComfyExecution } from "./comfyExecution.mjs";
|
|
169
|
-
import { createPromptDecider } from "./promptDecider.mjs";
|
|
171
|
+
import { createCapabilityCheck } from "./capabilityCheck.mjs";
|
|
170
172
|
import { createThreadBriefs } from "./threadBriefs.mjs";
|
|
171
173
|
|
|
172
174
|
// claude-mem 13.35.0, scratch worker with 3,000 observations, on the same machine: the whole lookup (git calls,
|
|
@@ -807,6 +809,12 @@ export async function startDaemon() {
|
|
|
807
809
|
}
|
|
808
810
|
});
|
|
809
811
|
};
|
|
812
|
+
// Each thread's board of cards (kanban.mjs): a task linked to a card moves it.
|
|
813
|
+
const kanban = createKanban({
|
|
814
|
+
store,
|
|
815
|
+
log,
|
|
816
|
+
onChange: (threadId) => notifyBoard(store.getTask(threadId)),
|
|
817
|
+
});
|
|
810
818
|
const notifyBoard = (task) => {
|
|
811
819
|
if (!task) return;
|
|
812
820
|
boardChanged();
|
|
@@ -819,6 +827,7 @@ export async function startDaemon() {
|
|
|
819
827
|
)
|
|
820
828
|
void ownMachines?.noticeTo(task.target_machine, { work: true });
|
|
821
829
|
plans?.changed(task);
|
|
830
|
+
kanban.changed(task);
|
|
822
831
|
localWaker.onChange(task);
|
|
823
832
|
send({
|
|
824
833
|
type: "board_changed",
|
|
@@ -899,39 +908,6 @@ export async function startDaemon() {
|
|
|
899
908
|
worktreeRoot: path.join(paths.home, "worktrees"),
|
|
900
909
|
projectRoot: path.join(paths.home, "projects"),
|
|
901
910
|
});
|
|
902
|
-
const promptArtifact = ({
|
|
903
|
-
taskId,
|
|
904
|
-
name,
|
|
905
|
-
bytes,
|
|
906
|
-
author,
|
|
907
|
-
mime = "text/plain",
|
|
908
|
-
}) => {
|
|
909
|
-
const sha256 = keepBlob(bytes);
|
|
910
|
-
const prior = store
|
|
911
|
-
.taskFiles(taskId)
|
|
912
|
-
.find(
|
|
913
|
-
(file) =>
|
|
914
|
-
file.sha256 === sha256 && file.name === name && file.author === author
|
|
915
|
-
);
|
|
916
|
-
if (prior) return prior;
|
|
917
|
-
const file = store.addFile({
|
|
918
|
-
taskId,
|
|
919
|
-
name,
|
|
920
|
-
mime,
|
|
921
|
-
bytes: bytes.length,
|
|
922
|
-
sha256,
|
|
923
|
-
author,
|
|
924
|
-
});
|
|
925
|
-
store.addContribution({
|
|
926
|
-
taskId,
|
|
927
|
-
kind: "file",
|
|
928
|
-
author,
|
|
929
|
-
text: `${author} attached ${fileLine(file)}`,
|
|
930
|
-
source: `file:${file.id}`,
|
|
931
|
-
});
|
|
932
|
-
notifyBoard(store.getTask(taskId));
|
|
933
|
-
return file;
|
|
934
|
-
};
|
|
935
911
|
const dispatches = createDispatches({
|
|
936
912
|
store,
|
|
937
913
|
machineId: () => machine.id,
|
|
@@ -941,76 +917,7 @@ export async function startDaemon() {
|
|
|
941
917
|
notifyBoard,
|
|
942
918
|
inferenceRefusal: (agent) => cloudAi?.refusal(agent) ?? null,
|
|
943
919
|
projectRoom: (id) => projects?.isProjectRoom(id) ?? false,
|
|
944
|
-
standingRules: authority.standingRules,
|
|
945
|
-
standingVerdict: authority.standingVerdict,
|
|
946
|
-
computers: () => [
|
|
947
|
-
...new Map(
|
|
948
|
-
[
|
|
949
|
-
{ id: machine.id, label: machine.label },
|
|
950
|
-
...(ownMachines?.all() ?? []),
|
|
951
|
-
...store
|
|
952
|
-
.ownMachines()
|
|
953
|
-
.map((c) => ({ id: c.machine_id, label: c.label })),
|
|
954
|
-
]
|
|
955
|
-
.filter((c) => c.label)
|
|
956
|
-
.map((c) => [c.id, c])
|
|
957
|
-
).values(),
|
|
958
|
-
],
|
|
959
|
-
privacy: () => coordinatorMode() === "local",
|
|
960
|
-
artifact: promptArtifact,
|
|
961
|
-
});
|
|
962
|
-
const comfyExecution = createComfyExecution({
|
|
963
|
-
store,
|
|
964
|
-
configuration: () => readJson(paths.config, {}).comfy,
|
|
965
|
-
machine: () => machine,
|
|
966
|
-
publish: async (execution) => {
|
|
967
|
-
const call = {
|
|
968
|
-
command: "board.prompt.receipt",
|
|
969
|
-
agent: "user",
|
|
970
|
-
execution,
|
|
971
|
-
};
|
|
972
|
-
if (machine.role === "worker") {
|
|
973
|
-
if (store.meta("machine-home") !== execution.from) return { ok: false };
|
|
974
|
-
return ownMachines?.callHome(call);
|
|
975
|
-
}
|
|
976
|
-
return promptFlow.localReceipt(execution);
|
|
977
|
-
},
|
|
978
|
-
});
|
|
979
|
-
const promptFlow = createPromptFlow({
|
|
980
|
-
store,
|
|
981
|
-
machine: () => machine,
|
|
982
|
-
computers: () => [
|
|
983
|
-
{ id: machine.id, label: machine.label },
|
|
984
|
-
...new Map(
|
|
985
|
-
[
|
|
986
|
-
...store.ownMachines().map((c) => ({
|
|
987
|
-
id: c.machine_id,
|
|
988
|
-
label: c.label,
|
|
989
|
-
connected: false,
|
|
990
|
-
})),
|
|
991
|
-
...(ownMachines?.all() ?? []),
|
|
992
|
-
]
|
|
993
|
-
.filter((c) => c.id !== machine.id)
|
|
994
|
-
.map((c) => [c.id, c])
|
|
995
|
-
).values(),
|
|
996
|
-
],
|
|
997
|
-
remote: (id, call) => ownMachines?.promptTo(id, call),
|
|
998
|
-
executeHere: comfyExecution.answer,
|
|
999
|
-
authority,
|
|
1000
|
-
privacy: () => coordinatorMode() === "local",
|
|
1001
|
-
artifact: promptArtifact,
|
|
1002
|
-
notify: notifyBoard,
|
|
1003
|
-
dispatch: dispatches.command,
|
|
1004
|
-
decider: createPromptDecider({
|
|
1005
|
-
configuration: () => readJson(paths.config, {}),
|
|
1006
|
-
record: (trace) =>
|
|
1007
|
-
store.meta(
|
|
1008
|
-
`prompt-flow-response:${trace.requestRef}`,
|
|
1009
|
-
JSON.stringify(trace)
|
|
1010
|
-
),
|
|
1011
|
-
}),
|
|
1012
920
|
});
|
|
1013
|
-
|
|
1014
921
|
// Threads: one objective the person set for a team, worked in a room. A post wakes the agents it names; a job posted
|
|
1015
922
|
// in the thread runs on the thread's authority; Harness facilitates and answers once. Backstops pause the room
|
|
1016
923
|
// instead of limiting it: a post ceiling, a wake ceiling per agent, a job that already failed posted again, and Stop.
|
|
@@ -1151,7 +1058,7 @@ export async function startDaemon() {
|
|
|
1151
1058
|
goals,
|
|
1152
1059
|
handoffs,
|
|
1153
1060
|
projectNeeds: (threadId) => projects?.needsOf(threadId) ?? [],
|
|
1154
|
-
agentNeeds: () => specialtyNotice.needs(),
|
|
1061
|
+
agentNeeds: () => [...specialtyNotice.needs(), ...subagentSteering.needs()],
|
|
1155
1062
|
computerOf,
|
|
1156
1063
|
});
|
|
1157
1064
|
const handoffTimer = setInterval(
|
|
@@ -1219,7 +1126,13 @@ export async function startDaemon() {
|
|
|
1219
1126
|
team: teams,
|
|
1220
1127
|
wakeRun: (...args) => threadRuns.wake(...args),
|
|
1221
1128
|
});
|
|
1129
|
+
// A run the person's steer or stop ends: here, or on the computer that took it, by a sealed notice Harness keeps for it.
|
|
1130
|
+
const stopRunAnywhere = (run) =>
|
|
1131
|
+
run.claimed_machine && run.claimed_machine !== machine.id
|
|
1132
|
+
? Boolean(ownMachines?.noticeTo(run.claimed_machine, { stop: run.id }))
|
|
1133
|
+
: stopAgentTask(run.id);
|
|
1222
1134
|
const threadRuns = createThreadRuns({
|
|
1135
|
+
reported: (thread, post) => void manager.reported(thread, post),
|
|
1223
1136
|
store,
|
|
1224
1137
|
log,
|
|
1225
1138
|
installedAgents,
|
|
@@ -1251,11 +1164,7 @@ export async function startDaemon() {
|
|
|
1251
1164
|
.map((computer) => computer.label),
|
|
1252
1165
|
},
|
|
1253
1166
|
stepHeld: (goalId, agent) => teams.stepHeld(goalId, agent),
|
|
1254
|
-
|
|
1255
|
-
stopRun: (run) =>
|
|
1256
|
-
run.claimed_machine && run.claimed_machine !== machine.id
|
|
1257
|
-
? Boolean(ownMachines?.noticeTo(run.claimed_machine, { stop: run.id }))
|
|
1258
|
-
: stopAgentTask(run.id),
|
|
1167
|
+
stopRun: stopRunAnywhere,
|
|
1259
1168
|
});
|
|
1260
1169
|
// Harness's tasks in threads, taken by its server while no Harness window is open (harnessOffers.mjs).
|
|
1261
1170
|
const harnessOffers = createHarnessOffers({
|
|
@@ -1354,7 +1263,46 @@ export async function startDaemon() {
|
|
|
1354
1263
|
log,
|
|
1355
1264
|
});
|
|
1356
1265
|
// A job under a thread changed: its answer lands in the thread (jobAnswers.mjs).
|
|
1266
|
+
// Wake an agent with work in a thread, as a round's hand-on does: a runner here with the person's go (owner, October
|
|
1267
|
+
// 13, kept October 26 over security audit S4), any other agent through an ask.
|
|
1268
|
+
const handOnAgent = (
|
|
1269
|
+
goalId,
|
|
1270
|
+
agent,
|
|
1271
|
+
reason,
|
|
1272
|
+
{ review, words, routeMachine } = {}
|
|
1273
|
+
) =>
|
|
1274
|
+
RUNNERS.has(agent)
|
|
1275
|
+
? threadRuns.wake(goalId, agent, reason, {
|
|
1276
|
+
review,
|
|
1277
|
+
routeMachine,
|
|
1278
|
+
go: threadAuthority.personsGo("harness", agent),
|
|
1279
|
+
})
|
|
1280
|
+
: actions.ask(goalId, agent, reason, "harness", words);
|
|
1281
|
+
// The swarm's manager (manager.mjs): the person's asks, kept to their words.
|
|
1282
|
+
const manager = createManager({
|
|
1283
|
+
store,
|
|
1284
|
+
askHarness,
|
|
1285
|
+
usesServer: () =>
|
|
1286
|
+
coordinatorMode() !== "local" &&
|
|
1287
|
+
state.connected &&
|
|
1288
|
+
bridge.has("swarm_manager"),
|
|
1289
|
+
localJudge: () =>
|
|
1290
|
+
coordinatorMode() === "local"
|
|
1291
|
+
? (coordinatorPick() ??
|
|
1292
|
+
LOCAL_DECIDERS.find((agent) => installedAgents.includes(agent)) ??
|
|
1293
|
+
null)
|
|
1294
|
+
: null,
|
|
1295
|
+
handOn: handOnAgent,
|
|
1296
|
+
post: (entry) => {
|
|
1297
|
+
const posted = store.roomPost(entry);
|
|
1298
|
+
if (posted) store.meta(`coordinator-post:${posted.id}`, "1");
|
|
1299
|
+
return posted;
|
|
1300
|
+
},
|
|
1301
|
+
notifyBoard,
|
|
1302
|
+
log,
|
|
1303
|
+
});
|
|
1357
1304
|
const jobAnswers = createJobAnswers({
|
|
1305
|
+
reported: (goal, post) => void manager.reported(goal, post),
|
|
1358
1306
|
store,
|
|
1359
1307
|
roomAgents: ROOM_AGENTS,
|
|
1360
1308
|
runsHere: (agent) => RUNNERS.has(agent),
|
|
@@ -1451,11 +1399,13 @@ export async function startDaemon() {
|
|
|
1451
1399
|
// Everything the person writes in a thread is read for their reaction to the work before it, for lessons, and for what
|
|
1452
1400
|
// it changes in the memory.
|
|
1453
1401
|
const heardPerson = (thread, post) => {
|
|
1402
|
+
void manager.heard(thread, post);
|
|
1454
1403
|
void reactions.heard(thread, post);
|
|
1455
1404
|
void lessons.heard(thread, post);
|
|
1456
1405
|
void memory.heard(thread, post);
|
|
1457
1406
|
};
|
|
1458
1407
|
const goalCommand = createGoalCommands({
|
|
1408
|
+
heardRelayed: (thread, post) => void manager.heard(thread, post),
|
|
1459
1409
|
computerOf,
|
|
1460
1410
|
teams,
|
|
1461
1411
|
learned: (goalId, agent, text) => projects?.learned(goalId, agent, text),
|
|
@@ -1780,7 +1730,58 @@ export async function startDaemon() {
|
|
|
1780
1730
|
// An ask lost on the way to Harness while this computer stayed connected goes again (asks.mjs).
|
|
1781
1731
|
const askRetry = setInterval(() => asks.retry(), 60_000);
|
|
1782
1732
|
askRetry.unref?.();
|
|
1733
|
+
const capabilityCheck = createCapabilityCheck({
|
|
1734
|
+
machine: () => machine,
|
|
1735
|
+
installedAgents,
|
|
1736
|
+
ownMachines: () => ownMachines,
|
|
1737
|
+
log,
|
|
1738
|
+
});
|
|
1739
|
+
// The coordinator's moves beyond bringing agents in (moves.mjs); its own state is read through the coordinator.
|
|
1740
|
+
const moves = createMoves({
|
|
1741
|
+
openAsks: (goalId) => manager.open(goalId),
|
|
1742
|
+
store,
|
|
1743
|
+
going,
|
|
1744
|
+
hostedAtWork: (goalId) => coordinator.hostedAtWork(goalId),
|
|
1745
|
+
hostedTaskOf: (goalId, agent) =>
|
|
1746
|
+
store.meta(`hosted-ask:${goalId}:${agent}`) || null,
|
|
1747
|
+
wakeAll: (goalId, names, words, why) =>
|
|
1748
|
+
actions.wakeFor(goalId, { text: words, kind: "post" }, "user", names, {
|
|
1749
|
+
why,
|
|
1750
|
+
}),
|
|
1751
|
+
start: (id) => boardCommand({ command: "board.run", agent: "user", id }),
|
|
1752
|
+
stopRun: stopRunAnywhere,
|
|
1753
|
+
cancelHosted: (id) =>
|
|
1754
|
+
askHarness("board_call", { command: "board.cancel", agent: "user", id }),
|
|
1755
|
+
// Closed on the person's word: the goal's summary where there is one, and how many of its checks were not shown met.
|
|
1756
|
+
finishGoal: (goalId, by, closing) => {
|
|
1757
|
+
const open =
|
|
1758
|
+
goals.view(goalId)?.criteria.filter((one) => one.status === "open")
|
|
1759
|
+
.length ?? 0;
|
|
1760
|
+
return goalCommand(
|
|
1761
|
+
{
|
|
1762
|
+
command: "board.goal.finish",
|
|
1763
|
+
id: goalId,
|
|
1764
|
+
result: [
|
|
1765
|
+
goals.summary(goalId),
|
|
1766
|
+
closing,
|
|
1767
|
+
open ? `${open} of the goal's checks were not shown met.` : "",
|
|
1768
|
+
]
|
|
1769
|
+
.filter(Boolean)
|
|
1770
|
+
.join("\n\n"),
|
|
1771
|
+
},
|
|
1772
|
+
by
|
|
1773
|
+
);
|
|
1774
|
+
},
|
|
1775
|
+
post: (entry) => {
|
|
1776
|
+
const posted = store.roomPost(entry);
|
|
1777
|
+
if (posted) store.meta(`coordinator-post:${posted.id}`, "1");
|
|
1778
|
+
return posted;
|
|
1779
|
+
},
|
|
1780
|
+
notifyBoard,
|
|
1781
|
+
log,
|
|
1782
|
+
});
|
|
1783
1783
|
const coordinator = createCoordinator({
|
|
1784
|
+
moves,
|
|
1784
1785
|
holdsBoard,
|
|
1785
1786
|
store,
|
|
1786
1787
|
serverWords,
|
|
@@ -1822,20 +1823,15 @@ export async function startDaemon() {
|
|
|
1822
1823
|
),
|
|
1823
1824
|
machinesOf: (agent, workspace) =>
|
|
1824
1825
|
ownMachines?.computersFor(agent, workspace),
|
|
1826
|
+
capabilities: capabilityCheck,
|
|
1825
1827
|
computerOf: threadRuns.computerOf,
|
|
1826
1828
|
placeable: (agent, workspace) =>
|
|
1827
1829
|
installedAgents.includes(agent) ||
|
|
1828
1830
|
Boolean(ownMachines?.placeElsewhere(agent, workspace)),
|
|
1829
1831
|
// A round's hand-ons carry the person's go whoever decided it, Harness's server included (owner, October 13, kept
|
|
1830
1832
|
// October 26 over security audit S4: waiting on every round's Start costs the swarm acting on its own).
|
|
1831
|
-
handOn:
|
|
1832
|
-
|
|
1833
|
-
? threadRuns.wake(goalId, agent, reason, {
|
|
1834
|
-
review,
|
|
1835
|
-
routeMachine,
|
|
1836
|
-
go: threadAuthority.personsGo("harness", agent),
|
|
1837
|
-
})
|
|
1838
|
-
: actions.ask(goalId, agent, reason, "harness", words),
|
|
1833
|
+
handOn: handOnAgent,
|
|
1834
|
+
openAsks: (goalId) => manager.open(goalId),
|
|
1839
1835
|
harnessQueued: (goalId) => asks.waitingFor(goalId, "harness"),
|
|
1840
1836
|
failedAsks: (goalId) => asks.failed(goalId),
|
|
1841
1837
|
pauseGoal: actions.pause,
|
|
@@ -1885,6 +1881,11 @@ export async function startDaemon() {
|
|
|
1885
1881
|
notifyBoard,
|
|
1886
1882
|
log,
|
|
1887
1883
|
});
|
|
1884
|
+
// The subagents each run's own session spawned (subagents.mjs): the thread's read and the person's window share one
|
|
1885
|
+
// reader, so a finished subagent is read once.
|
|
1886
|
+
const subagents = createSubagents({
|
|
1887
|
+
scrub: (value) => vault.scrubDeep(value),
|
|
1888
|
+
});
|
|
1888
1889
|
const swarmCommand = createSwarm({
|
|
1889
1890
|
landed,
|
|
1890
1891
|
browserWake,
|
|
@@ -1927,6 +1928,7 @@ export async function startDaemon() {
|
|
|
1927
1928
|
here: () => machine.id,
|
|
1928
1929
|
store,
|
|
1929
1930
|
plansOf: (threadId) => plans?.of(threadId) ?? [],
|
|
1931
|
+
boardOf: (threadId) => kanban.of(threadId),
|
|
1930
1932
|
goals,
|
|
1931
1933
|
heardPerson,
|
|
1932
1934
|
lessons,
|
|
@@ -1973,7 +1975,18 @@ export async function startDaemon() {
|
|
|
1973
1975
|
whyWaiting: (goalId, run) => whyWaiting(goalId, run),
|
|
1974
1976
|
schedules,
|
|
1975
1977
|
threadView,
|
|
1976
|
-
subagents:
|
|
1978
|
+
// A run's subagents: read here, or as the computer the run is on says (subagentSteering.mjs).
|
|
1979
|
+
subagents: { of: (run) => subagentSteering.of(run) },
|
|
1980
|
+
});
|
|
1981
|
+
// The person's window into a session's subagents and their word to one (subagentSteering.mjs).
|
|
1982
|
+
const subagentSteering = createSubagentSteering({
|
|
1983
|
+
store,
|
|
1984
|
+
subagents,
|
|
1985
|
+
log,
|
|
1986
|
+
machineId: () => machine.id,
|
|
1987
|
+
remote: (computer, call) => ownMachines.askSubagents(computer, call),
|
|
1988
|
+
changed: () => boardChanged(),
|
|
1989
|
+
desktop: (title, line) => notifyDesktop(`${title}: ${line}`),
|
|
1977
1990
|
});
|
|
1978
1991
|
|
|
1979
1992
|
// The person's own sessions running now (live.mjs), and what they sent one from Harness: it waits here until that
|
|
@@ -1989,6 +2002,8 @@ export async function startDaemon() {
|
|
|
1989
2002
|
store,
|
|
1990
2003
|
log,
|
|
1991
2004
|
validAgent,
|
|
2005
|
+
// Each running session's subagents, for the list of what runs (subagentSteering.mjs).
|
|
2006
|
+
subagentsOf: (session) => subagentSteering.ofSession(session),
|
|
1992
2007
|
opencodeExecutable:
|
|
1993
2008
|
detected.find((entry) => entry.agent === "opencode")?.path || null,
|
|
1994
2009
|
activeRuns: () => activeRuns.values(),
|
|
@@ -2092,6 +2107,11 @@ export async function startDaemon() {
|
|
|
2092
2107
|
store,
|
|
2093
2108
|
validAgent,
|
|
2094
2109
|
touchListener,
|
|
2110
|
+
// A task posted for a card on its thread's board is linked to it once it exists (kanban.mjs).
|
|
2111
|
+
answered: (request, answer) =>
|
|
2112
|
+
request.command === "board.post" && request.card
|
|
2113
|
+
? kanban.posted(request, answer)
|
|
2114
|
+
: answer,
|
|
2095
2115
|
machineOf: (request) => request[FROM_MACHINE] ?? machine.id,
|
|
2096
2116
|
handlers: {
|
|
2097
2117
|
goals: (request, { agent, machine }) =>
|
|
@@ -2103,6 +2123,9 @@ export async function startDaemon() {
|
|
|
2103
2123
|
environments: (request, { agent }) =>
|
|
2104
2124
|
environments.command(request, agent),
|
|
2105
2125
|
landed: (request, { agent }) => landed.command(request, agent),
|
|
2126
|
+
subagents: (request, { agent }) =>
|
|
2127
|
+
subagentSteering.command(request, agent),
|
|
2128
|
+
kanban: (request, { agent }) => kanban.command(request, agent),
|
|
2106
2129
|
nativeRequests: (request, { agent }) =>
|
|
2107
2130
|
nativeRequests.command(request, agent),
|
|
2108
2131
|
relay: (request, { agent }) =>
|
|
@@ -2178,7 +2201,6 @@ export async function startDaemon() {
|
|
|
2178
2201
|
},
|
|
2179
2202
|
task: createTaskCommands({
|
|
2180
2203
|
dispatches,
|
|
2181
|
-
promptFlow,
|
|
2182
2204
|
outside: () => environments,
|
|
2183
2205
|
readByGuard: (text) => local.readByGuard(text),
|
|
2184
2206
|
CLOUD_TARGETS,
|
|
@@ -2315,6 +2337,7 @@ export async function startDaemon() {
|
|
|
2315
2337
|
threadFilesNote: briefs.threadFilesNote,
|
|
2316
2338
|
t3CatchUp: threadRuns.worker.t3CatchUp,
|
|
2317
2339
|
wakeBrief: threadRuns.worker.wakeBrief,
|
|
2340
|
+
boardBrief: (threadId) => kanban.brief(threadId),
|
|
2318
2341
|
});
|
|
2319
2342
|
const worker = createRunWorker({
|
|
2320
2343
|
dispatches,
|
|
@@ -2420,6 +2443,8 @@ export async function startDaemon() {
|
|
|
2420
2443
|
return result?.pending ? await result.pending : result;
|
|
2421
2444
|
}
|
|
2422
2445
|
if (live?.open) return openRequests.open(live.open);
|
|
2446
|
+
// One read or steer of a subagent of a session on this computer, for the person at another of theirs.
|
|
2447
|
+
if (live?.subagent) return subagentSteering.local(live.subagent);
|
|
2423
2448
|
if (live?.read)
|
|
2424
2449
|
return liveCommand(
|
|
2425
2450
|
{
|
|
@@ -2603,13 +2628,11 @@ export async function startDaemon() {
|
|
|
2603
2628
|
void machineRuns.check();
|
|
2604
2629
|
void boardMirror.sync();
|
|
2605
2630
|
void swarmDevices.report();
|
|
2606
|
-
void comfyExecution.resume();
|
|
2607
2631
|
},
|
|
2608
2632
|
answerMirror: (call) => boardMirror.since(call),
|
|
2609
2633
|
answerMerge: (page, options) => boardMirror.merge(page, options),
|
|
2610
2634
|
answerDevices: (from, call, options) =>
|
|
2611
2635
|
swarmDevices.answer(from, call, options),
|
|
2612
|
-
answerPrompt: comfyExecution.answer,
|
|
2613
2636
|
// A worker takes Home's place only once Home has been away about a week; a deadline in the person's config replaces
|
|
2614
2637
|
// it.
|
|
2615
2638
|
standInAfterMs: Number.isFinite(config.standInAfterMs)
|
|
@@ -2621,6 +2644,7 @@ export async function startDaemon() {
|
|
|
2621
2644
|
askOwnWindows: (call) => askOwnWindows(call),
|
|
2622
2645
|
ownModels,
|
|
2623
2646
|
ownLive,
|
|
2647
|
+
answerCapability: capabilityCheck.answer,
|
|
2624
2648
|
answerLink: proxyLinks
|
|
2625
2649
|
? (from, call) => proxyLinks.answer(from, call)
|
|
2626
2650
|
: null,
|
|
@@ -2639,7 +2663,6 @@ export async function startDaemon() {
|
|
|
2639
2663
|
},
|
|
2640
2664
|
});
|
|
2641
2665
|
// The board's encrypted backup, for Residents: home seals it, Harness keeps what it cannot read (boardBackup.mjs).
|
|
2642
|
-
void comfyExecution.resume();
|
|
2643
2666
|
const boardBackup = createBoardBackup({
|
|
2644
2667
|
store,
|
|
2645
2668
|
log,
|
|
@@ -3329,6 +3352,8 @@ export async function startDaemon() {
|
|
|
3329
3352
|
serverMessages[message.type](message);
|
|
3330
3353
|
};
|
|
3331
3354
|
threadRuns.recover();
|
|
3355
|
+
// A round's decision a restart cut off is finished once (coordinator.mjs outbox), on the computer that keeps the board.
|
|
3356
|
+
if (holdsBoard()) coordinator.recover();
|
|
3332
3357
|
// Local agents' retries that were due when the daemon stopped go at their time; then open work wakes each agent once,
|
|
3333
3358
|
// which a retry still waiting carries instead (wakes.mjs).
|
|
3334
3359
|
localWaker.start();
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"room_post": 251,
|
|
5
5
|
"reviewed_decision_sha256": "bfe002b51b9c4df9791558030f4c270d2b2c5bf094dc15868a2beffb5a6982d5"
|
|
6
6
|
},
|
|
7
|
-
"implemented_capabilities": ["start-exact-owner-run", "start-owner-template"
|
|
7
|
+
"implemented_capabilities": ["start-exact-owner-run", "start-owner-template"],
|
|
8
8
|
"accounting_unit": "one native task start; no financial or service-dollar allowance is created",
|
|
9
9
|
"decision_output_schema": {
|
|
10
10
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
@@ -279,35 +279,5 @@
|
|
|
279
279
|
"no remote execution lease",
|
|
280
280
|
"no financial allowance"
|
|
281
281
|
]
|
|
282
|
-
},
|
|
283
|
-
"prompt_scope": {
|
|
284
|
-
"entry": "owner natural-language objective with application-supplied workspace/message identity; no fixed child templates",
|
|
285
|
-
"permissions": "existing standing scope and cumulative native-start reservations; generated fields never raise it",
|
|
286
|
-
"interpreter": "temporary tool-free native Claude adapter; not the Relay-shipped fine-tuned model; private mode refuses unverified transport",
|
|
287
|
-
"capabilities": {
|
|
288
|
-
"workspace-read@1": [
|
|
289
|
-
"list source names",
|
|
290
|
-
"read ordinary source/staged text"
|
|
291
|
-
],
|
|
292
|
-
"workspace-files@1": [
|
|
293
|
-
"list source names",
|
|
294
|
-
"read ordinary source/staged text",
|
|
295
|
-
"write private staged text artifacts"
|
|
296
|
-
]
|
|
297
|
-
},
|
|
298
|
-
"execution": "Claude Code >=2.1.248, bare/restricted with built-ins disabled and only scoped MCP",
|
|
299
|
-
"bounds": {
|
|
300
|
-
"observed_files": 100,
|
|
301
|
-
"file_bytes": 64000
|
|
302
|
-
},
|
|
303
|
-
"source": "original owner prompt, named computer source spans, pinned source revision and observed file/absence receipts",
|
|
304
|
-
"children": "free objectives/briefs are agent data; identical proposals deduplicate; children wait for their proposing task to finish successfully",
|
|
305
|
-
"limits": [
|
|
306
|
-
"no native shell or direct filesystem tools",
|
|
307
|
-
"no network, vault, wallet or financial adapter",
|
|
308
|
-
"remote execution refuses rather than falling back to Home",
|
|
309
|
-
"no automatic application of generated code to the source checkout",
|
|
310
|
-
"normal app routing, full controller and live semantic evaluation remain work"
|
|
311
|
-
]
|
|
312
282
|
}
|
|
313
283
|
}
|
package/lib/dispatchTools.js
CHANGED
|
@@ -6,28 +6,13 @@ const fields = {
|
|
|
6
6
|
root_id: { type: "string" },
|
|
7
7
|
task_id: { type: "string" },
|
|
8
8
|
proposal: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
required: ["scope_ref", "template_ref"],
|
|
17
|
-
additionalProperties: false,
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
type: "object",
|
|
21
|
-
properties: {
|
|
22
|
-
scope_ref: { type: "string" },
|
|
23
|
-
objective: { type: "string" },
|
|
24
|
-
brief: { type: "string" },
|
|
25
|
-
capability_ref: { type: "string" },
|
|
26
|
-
},
|
|
27
|
-
required: ["scope_ref", "objective", "brief", "capability_ref"],
|
|
28
|
-
additionalProperties: false,
|
|
29
|
-
},
|
|
30
|
-
],
|
|
9
|
+
type: "object",
|
|
10
|
+
properties: {
|
|
11
|
+
scope_ref: { type: "string" },
|
|
12
|
+
template_ref: { type: "string" },
|
|
13
|
+
},
|
|
14
|
+
required: ["scope_ref", "template_ref"],
|
|
15
|
+
additionalProperties: false,
|
|
31
16
|
},
|
|
32
17
|
decision: contract.decision_output_schema,
|
|
33
18
|
};
|
|
@@ -35,7 +20,7 @@ const fields = {
|
|
|
35
20
|
export const DISPATCH_WORK_TOOL = {
|
|
36
21
|
name: "dispatch_work",
|
|
37
22
|
description:
|
|
38
|
-
"Use an existing scope without another Start.
|
|
23
|
+
"Use an existing owner-approved local scope without another Start. Read scopes for an owner root, propose one exact offered template, inspect that task's eligible agent/computer assignments, then dispatch with the unchanged code-offered typed decision references. A proposal creates no run or approval. Templates and all proposed tasks share the scope's native-start limit. Agent text cannot supply executable instructions, destinations or new authority. No remote execution or financial allowance is provided by this capability.",
|
|
39
24
|
inputSchema: {
|
|
40
25
|
definitions: contract.decision_output_schema.definitions,
|
|
41
26
|
type: "object",
|
|
@@ -44,22 +29,6 @@ export const DISPATCH_WORK_TOOL = {
|
|
|
44
29
|
additionalProperties: false,
|
|
45
30
|
},
|
|
46
31
|
};
|
|
47
|
-
export const SCOPE_WORKSPACE_TOOL = {
|
|
48
|
-
name: "scope_workspace",
|
|
49
|
-
description:
|
|
50
|
-
"List/read source files and stage file writes in this run's private workspace through Relay. Writes return reviewable artifacts. Paths are relative; hidden paths, symlinks, runtime code, credentials and paths outside the workspace are refused. Writes need the exact sha256 returned by read, or null to create a new file. No shell, networking or financial operation is available.",
|
|
51
|
-
inputSchema: {
|
|
52
|
-
type: "object",
|
|
53
|
-
properties: {
|
|
54
|
-
operation: { type: "string", enum: ["list", "read", "write"] },
|
|
55
|
-
path: { type: "string" },
|
|
56
|
-
text: { type: "string" },
|
|
57
|
-
expected_sha256: { type: ["string", "null"] },
|
|
58
|
-
},
|
|
59
|
-
required: ["operation"],
|
|
60
|
-
additionalProperties: false,
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
32
|
export function dispatchWorkRequest(args) {
|
|
64
33
|
const required = {
|
|
65
34
|
scopes: ["action", "root_id"],
|