tryharness 0.7.71 → 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.
Files changed (57) hide show
  1. package/README.md +13 -8
  2. package/assets/opencode-plugin.js +70 -3
  3. package/cli.mjs +27 -12
  4. package/lib/asks.mjs +4 -0
  5. package/lib/boardCommands.mjs +9 -1
  6. package/lib/boardProtocol.json +23 -19
  7. package/lib/bridge.mjs +2 -0
  8. package/lib/capabilityCheck.mjs +86 -0
  9. package/lib/computerAddress.mjs +6 -14
  10. package/lib/coordinator.mjs +259 -30
  11. package/lib/daemon.mjs +164 -133
  12. package/lib/dispatchContract.json +1 -31
  13. package/lib/dispatchTools.js +8 -39
  14. package/lib/dispatches.mjs +27 -285
  15. package/lib/goalCommands.mjs +21 -38
  16. package/lib/herdr.mjs +159 -0
  17. package/lib/hookDialects.mjs +36 -2
  18. package/lib/jobAnswers.mjs +3 -0
  19. package/lib/kanban.mjs +256 -0
  20. package/lib/live.mjs +25 -3
  21. package/lib/localAgentAsk.mjs +20 -29
  22. package/lib/machineRoutes.mjs +1 -5
  23. package/lib/machineRuns.mjs +42 -22
  24. package/lib/manager.mjs +254 -0
  25. package/lib/mcp-stdio.mjs +58 -39
  26. package/lib/moves.mjs +365 -0
  27. package/lib/nudge.mjs +13 -3
  28. package/lib/ownMachines.mjs +122 -12
  29. package/lib/places.mjs +29 -2
  30. package/lib/plans.mjs +7 -1
  31. package/lib/projectSettings.mjs +11 -1
  32. package/lib/projects.mjs +20 -4
  33. package/lib/runAuthority.mjs +104 -35
  34. package/lib/runBrief.mjs +14 -1
  35. package/lib/runWorker.mjs +48 -24
  36. package/lib/runner.mjs +184 -75
  37. package/lib/selfUpdate.mjs +41 -0
  38. package/lib/serverWords.mjs +11 -11
  39. package/lib/sessionControl.mjs +68 -3
  40. package/lib/steerHook.mjs +124 -0
  41. package/lib/steerQueue.mjs +176 -0
  42. package/lib/store.mjs +34 -34
  43. package/lib/subagentSteering.mjs +363 -0
  44. package/lib/subagents.mjs +138 -29
  45. package/lib/swarm.mjs +16 -3
  46. package/lib/taskCommands.mjs +36 -71
  47. package/lib/threadActions.mjs +13 -3
  48. package/lib/threadAuthority.mjs +21 -14
  49. package/lib/threadBriefs.mjs +9 -3
  50. package/lib/threadRuns.mjs +35 -8
  51. package/npm-shrinkwrap.json +14 -14
  52. package/package.json +4 -4
  53. package/release.json +54 -49
  54. package/lib/comfyExecution.mjs +0 -545
  55. package/lib/promptDecider.mjs +0 -471
  56. package/lib/promptFlow.mjs +0 -562
  57. 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";
@@ -125,9 +128,11 @@ import { createProxyLinks } from "./proxyLinks.mjs";
125
128
  import { createCloudSsh } from "./cloudSsh.mjs";
126
129
  import { loadMachine, saveMachine } from "./machineIdentity.mjs";
127
130
  import { createOwnMachines, FROM_MACHINE } from "./ownMachines.mjs";
131
+ import { startUpdate } from "./selfUpdate.mjs";
128
132
  import { createBoardBackup } from "./boardBackup.mjs";
129
133
  import { createMachineRuns } from "./machineRuns.mjs";
130
134
  import { createPlans } from "./plans.mjs";
135
+ import { createKanban } from "./kanban.mjs";
131
136
  import { createAdoption } from "./adoption.mjs";
132
137
  import { createBoardWatches } from "./boardWatches.mjs";
133
138
  import { createBoardTools } from "./boardTools.mjs";
@@ -163,9 +168,7 @@ import {
163
168
  import { createThreadActions, inRoom, mentionsIn } from "./threadActions.mjs";
164
169
  import { createThreadAuthority } from "./threadAuthority.mjs";
165
170
  import { createDispatches } from "./dispatches.mjs";
166
- import { createPromptFlow } from "./promptFlow.mjs";
167
- import { createComfyExecution } from "./comfyExecution.mjs";
168
- import { createPromptDecider } from "./promptDecider.mjs";
171
+ import { createCapabilityCheck } from "./capabilityCheck.mjs";
169
172
  import { createThreadBriefs } from "./threadBriefs.mjs";
170
173
 
171
174
  // claude-mem 13.35.0, scratch worker with 3,000 observations, on the same machine: the whole lookup (git calls,
@@ -806,6 +809,12 @@ export async function startDaemon() {
806
809
  }
807
810
  });
808
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
+ });
809
818
  const notifyBoard = (task) => {
810
819
  if (!task) return;
811
820
  boardChanged();
@@ -818,6 +827,7 @@ export async function startDaemon() {
818
827
  )
819
828
  void ownMachines?.noticeTo(task.target_machine, { work: true });
820
829
  plans?.changed(task);
830
+ kanban.changed(task);
821
831
  localWaker.onChange(task);
822
832
  send({
823
833
  type: "board_changed",
@@ -885,11 +895,10 @@ export async function startDaemon() {
885
895
  for (const id of store.backfillContributions())
886
896
  log(`context: backfilled task ${id}`);
887
897
 
888
- // Standing permission, decided when a task is posted: a run the person asked for (themselves or through Harness),
889
- // for a coding agent installed here, in a folder the permission covers, under today's cap, starts without a Start.
890
- // By default it covers the folders the person has already used that agent in; home and anything above it count only
891
- // as themselves, never as a root. Anything another agent wrote never starts. Links are followed, so no path inside a
892
- // covered folder leads out of it.
898
+ // Standing permission, decided when a task is posted: a run the person asked for (themselves, through Harness or
899
+ // through any of their own agents), for a coding agent installed here, in a folder the permission covers, starts
900
+ // without a Start. By default it covers any folder below home, with no daily limit; the person may name folders and a
901
+ // limit instead (runAuthority.mjs covers). Links are followed, so no path inside a covered folder leads out of it.
893
902
  const authority = createRunAuthority({ store, installedAgents });
894
903
  const { RUNNERS } = authority;
895
904
  const threadAuthority = createThreadAuthority({
@@ -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
920
  });
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
- });
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
- // A run the person's steer stops: here, or on the computer that took it, by a sealed notice Harness keeps for it.
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),
@@ -1481,7 +1431,6 @@ export async function startDaemon() {
1481
1431
  replaceHeld,
1482
1432
  sendThreadMessage: sealed.sendMessage,
1483
1433
  setupNote,
1484
- slotOf: (...args) => slotOf(...args),
1485
1434
  state,
1486
1435
  store,
1487
1436
  swarmCommand: (...args) => swarmCommand(...args),
@@ -1781,7 +1730,58 @@ export async function startDaemon() {
1781
1730
  // An ask lost on the way to Harness while this computer stayed connected goes again (asks.mjs).
1782
1731
  const askRetry = setInterval(() => asks.retry(), 60_000);
1783
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
+ });
1784
1783
  const coordinator = createCoordinator({
1784
+ moves,
1785
1785
  holdsBoard,
1786
1786
  store,
1787
1787
  serverWords,
@@ -1823,20 +1823,15 @@ export async function startDaemon() {
1823
1823
  ),
1824
1824
  machinesOf: (agent, workspace) =>
1825
1825
  ownMachines?.computersFor(agent, workspace),
1826
+ capabilities: capabilityCheck,
1826
1827
  computerOf: threadRuns.computerOf,
1827
1828
  placeable: (agent, workspace) =>
1828
1829
  installedAgents.includes(agent) ||
1829
1830
  Boolean(ownMachines?.placeElsewhere(agent, workspace)),
1830
1831
  // A round's hand-ons carry the person's go whoever decided it, Harness's server included (owner, October 13, kept
1831
1832
  // October 26 over security audit S4: waiting on every round's Start costs the swarm acting on its own).
1832
- handOn: (goalId, agent, reason, { review, words, routeMachine }) =>
1833
- RUNNERS.has(agent)
1834
- ? threadRuns.wake(goalId, agent, reason, {
1835
- review,
1836
- routeMachine,
1837
- go: threadAuthority.personsGo("harness", agent),
1838
- })
1839
- : actions.ask(goalId, agent, reason, "harness", words),
1833
+ handOn: handOnAgent,
1834
+ openAsks: (goalId) => manager.open(goalId),
1840
1835
  harnessQueued: (goalId) => asks.waitingFor(goalId, "harness"),
1841
1836
  failedAsks: (goalId) => asks.failed(goalId),
1842
1837
  pauseGoal: actions.pause,
@@ -1886,6 +1881,11 @@ export async function startDaemon() {
1886
1881
  notifyBoard,
1887
1882
  log,
1888
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
+ });
1889
1889
  const swarmCommand = createSwarm({
1890
1890
  landed,
1891
1891
  browserWake,
@@ -1928,6 +1928,7 @@ export async function startDaemon() {
1928
1928
  here: () => machine.id,
1929
1929
  store,
1930
1930
  plansOf: (threadId) => plans?.of(threadId) ?? [],
1931
+ boardOf: (threadId) => kanban.of(threadId),
1931
1932
  goals,
1932
1933
  heardPerson,
1933
1934
  lessons,
@@ -1974,7 +1975,18 @@ export async function startDaemon() {
1974
1975
  whyWaiting: (goalId, run) => whyWaiting(goalId, run),
1975
1976
  schedules,
1976
1977
  threadView,
1977
- subagents: createSubagents({ scrub: (value) => vault.scrubDeep(value) }),
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}`),
1978
1990
  });
1979
1991
 
1980
1992
  // The person's own sessions running now (live.mjs), and what they sent one from Harness: it waits here until that
@@ -1990,6 +2002,8 @@ export async function startDaemon() {
1990
2002
  store,
1991
2003
  log,
1992
2004
  validAgent,
2005
+ // Each running session's subagents, for the list of what runs (subagentSteering.mjs).
2006
+ subagentsOf: (session) => subagentSteering.ofSession(session),
1993
2007
  opencodeExecutable:
1994
2008
  detected.find((entry) => entry.agent === "opencode")?.path || null,
1995
2009
  activeRuns: () => activeRuns.values(),
@@ -2093,6 +2107,11 @@ export async function startDaemon() {
2093
2107
  store,
2094
2108
  validAgent,
2095
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,
2096
2115
  machineOf: (request) => request[FROM_MACHINE] ?? machine.id,
2097
2116
  handlers: {
2098
2117
  goals: (request, { agent, machine }) =>
@@ -2104,6 +2123,9 @@ export async function startDaemon() {
2104
2123
  environments: (request, { agent }) =>
2105
2124
  environments.command(request, agent),
2106
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),
2107
2129
  nativeRequests: (request, { agent }) =>
2108
2130
  nativeRequests.command(request, agent),
2109
2131
  relay: (request, { agent }) =>
@@ -2179,7 +2201,6 @@ export async function startDaemon() {
2179
2201
  },
2180
2202
  task: createTaskCommands({
2181
2203
  dispatches,
2182
- promptFlow,
2183
2204
  outside: () => environments,
2184
2205
  readByGuard: (text) => local.readByGuard(text),
2185
2206
  CLOUD_TARGETS,
@@ -2316,6 +2337,7 @@ export async function startDaemon() {
2316
2337
  threadFilesNote: briefs.threadFilesNote,
2317
2338
  t3CatchUp: threadRuns.worker.t3CatchUp,
2318
2339
  wakeBrief: threadRuns.worker.wakeBrief,
2340
+ boardBrief: (threadId) => kanban.brief(threadId),
2319
2341
  });
2320
2342
  const worker = createRunWorker({
2321
2343
  dispatches,
@@ -2342,7 +2364,7 @@ export async function startDaemon() {
2342
2364
  });
2343
2365
  // A session's agent hears its work again after its context is compacted (compaction.mjs, the session hook).
2344
2366
  const compaction = createCompaction({ store, goals });
2345
- const { activeRuns, slotOf, whyWaiting, runBoard } = worker;
2367
+ const { activeRuns, whyWaiting, runBoard } = worker;
2346
2368
 
2347
2369
  // The agents the person picked for this cloud computer, installed here and joined to the swarm (cloudAgents.mjs).
2348
2370
  const cloudSave = config.cloud
@@ -2421,6 +2443,8 @@ export async function startDaemon() {
2421
2443
  return result?.pending ? await result.pending : result;
2422
2444
  }
2423
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);
2424
2448
  if (live?.read)
2425
2449
  return liveCommand(
2426
2450
  {
@@ -2604,13 +2628,11 @@ export async function startDaemon() {
2604
2628
  void machineRuns.check();
2605
2629
  void boardMirror.sync();
2606
2630
  void swarmDevices.report();
2607
- void comfyExecution.resume();
2608
2631
  },
2609
2632
  answerMirror: (call) => boardMirror.since(call),
2610
2633
  answerMerge: (page, options) => boardMirror.merge(page, options),
2611
2634
  answerDevices: (from, call, options) =>
2612
2635
  swarmDevices.answer(from, call, options),
2613
- answerPrompt: comfyExecution.answer,
2614
2636
  // A worker takes Home's place only once Home has been away about a week; a deadline in the person's config replaces
2615
2637
  // it.
2616
2638
  standInAfterMs: Number.isFinite(config.standInAfterMs)
@@ -2622,10 +2644,13 @@ export async function startDaemon() {
2622
2644
  askOwnWindows: (call) => askOwnWindows(call),
2623
2645
  ownModels,
2624
2646
  ownLive,
2647
+ answerCapability: capabilityCheck.answer,
2625
2648
  answerLink: proxyLinks
2626
2649
  ? (from, call) => proxyLinks.answer(from, call)
2627
2650
  : null,
2628
2651
  ownSsh: cloudSsh?.allow ?? null,
2652
+ ownUpdate: (spec) => startUpdate(spec, { from: DAEMON_VERSION, log }),
2653
+ runningVersion: DAEMON_VERSION,
2629
2654
  onNotice: (notice) => {
2630
2655
  // Home stopped a run on this computer (the person stopped or removed its task).
2631
2656
  if (typeof notice?.stop === "string") stopAgentTask(notice.stop);
@@ -2638,7 +2663,6 @@ export async function startDaemon() {
2638
2663
  },
2639
2664
  });
2640
2665
  // The board's encrypted backup, for Residents: home seals it, Harness keeps what it cannot read (boardBackup.mjs).
2641
- void comfyExecution.resume();
2642
2666
  const boardBackup = createBoardBackup({
2643
2667
  store,
2644
2668
  log,
@@ -2653,7 +2677,6 @@ export async function startDaemon() {
2653
2677
  callHome: (request) => ownMachines.callHome(request),
2654
2678
  taskRuns,
2655
2679
  agents: installedAgents,
2656
- // Only in a folder this computer's own agents' sessions or T3 Code worked in, never just one home names.
2657
2680
  knownFolders: () => folders.known({ own: true }).map((place) => place.path),
2658
2681
  // A folder-less thread's files, as this computer's copy of the board lists them (boardMirror.mjs).
2659
2682
  threadFileIds: (threadId) => {
@@ -2896,6 +2919,12 @@ export async function startDaemon() {
2896
2919
  ? ownMachines.remove(request.computer)
2897
2920
  : { ok: false, error: "only the person removes a computer" }
2898
2921
  ),
2922
+ // tryharness machines update: one of the person's computers fetches a newer signed release and sets it up.
2923
+ "machines.update": onMachines((request) =>
2924
+ request.agent === "user"
2925
+ ? ownMachines.update(request)
2926
+ : { ok: false, error: "only the person updates a computer" }
2927
+ ),
2899
2928
  "machines.models": onMachines((request) =>
2900
2929
  ownMachines.models({ refresh: request.refresh === true })
2901
2930
  ),
@@ -3323,6 +3352,8 @@ export async function startDaemon() {
3323
3352
  serverMessages[message.type](message);
3324
3353
  };
3325
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();
3326
3357
  // Local agents' retries that were due when the daemon stopped go at their time; then open work wakes each agent once,
3327
3358
  // which a retry still waiting carries instead (wakes.mjs).
3328
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", "workspace-read@1", "workspace-files@1"],
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
  }
@@ -6,28 +6,13 @@ const fields = {
6
6
  root_id: { type: "string" },
7
7
  task_id: { type: "string" },
8
8
  proposal: {
9
- oneOf: [
10
- {
11
- type: "object",
12
- properties: {
13
- scope_ref: { type: "string" },
14
- template_ref: { type: "string" },
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. Prompt scopes accept new child objectives and briefs under their offered capability; legacy scopes accept an offered template. Read the task's eligible assignments, then dispatch with code-offered typed references. All children share the cumulative start budget. Agent prose cannot widen permissions. The original owner prompt remains the completion standard.",
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"],