tryharness 0.7.62 → 0.7.64

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.
@@ -92,7 +92,7 @@ Routing, when \`team\` is null or \`team.nextPiece\` is given, and \`teamMembers
92
92
  .map(([level, rigor]) => `${level}: ${rigor.steps.join(", ")}`)
93
93
  .join(
94
94
  "; "
95
- )}; combine also runs when several agents make. At light the work goes straight to one maker. Anything the person depends on, or that moves money, is careful at least. Make may have several agents side by side, only when its parts are independent; every other step has one. Check and judge never go to a maker, judge never to the framer, and combine is one agent, never a vote. An agent the person tagged fills a step, Make unless they said otherwise; a pin in \`pins\` (specialty: agent) holds the step that asks for that specialty. An agent with work running or waiting elsewhere is less available. When you route, hand on to the agents of the route's first step. Specialty ids: ${SPECIALTIES.map((specialty) => specialty.id).join(", ")}.`;
95
+ )}; combine also runs when several agents make. At light the work goes straight to one maker. Anything the person depends on, or that moves money, is careful at least. Make may have several agents side by side, only when its parts are independent; when the person wants every agent to take part (each answering, or all pitching in), add "everyone": true to the plan and put every agent in \`teamMembers\` on make. Every other step has one. Check and judge never go to a maker, judge never to the framer, and combine is one agent, never a vote. An agent the person tagged fills a step, Make unless they said otherwise; a pin in \`pins\` (specialty: agent) holds the step that asks for that specialty. An agent with work running or waiting elsewhere is less available. When you route, hand on to the agents of the route's first step. Specialty ids: ${SPECIALTIES.map((specialty) => specialty.id).join(", ")}.`;
96
96
 
97
97
  const localDecision = (agent, facts) =>
98
98
  askLocalAgent(agent, `${LOCAL_PROMPT}\n\n${JSON.stringify(facts)}`);
package/lib/runner.mjs CHANGED
@@ -9,7 +9,7 @@ import { agentEnvironment } from "./agentnode.mjs";
9
9
  import { runtimeOf } from "./agentRuntimeConfig.mjs";
10
10
  import { runProtocolTask } from "./agentRuntimes.mjs";
11
11
  import { scrubValues } from "./vault.mjs";
12
- import { paths } from "./paths.mjs";
12
+ import { historyRoots, paths } from "./paths.mjs";
13
13
 
14
14
  const running = new Set();
15
15
  const children = new Map();
@@ -234,6 +234,33 @@ const MODEL_FLAGS = {
234
234
  effort: (level) => ["--variant", level],
235
235
  },
236
236
  };
237
+ // Pi keeps each session in `<sessions>/<project>/<time>_<id>.jsonl`. Given only an id, Pi asks on the terminal whether
238
+ // to fork a session from another folder, and a non-interactive run cannot answer; given the file, it opens it. With
239
+ // no file, the run starts a new session: an id Pi can't find ends the run.
240
+ const piSessionFile = (sessionId) => {
241
+ const name = `_${sessionId}.jsonl`;
242
+ for (const root of historyRoots("pi")) {
243
+ let projects = [];
244
+ try {
245
+ projects = fs.readdirSync(root, { withFileTypes: true });
246
+ } catch {
247
+ continue;
248
+ }
249
+ for (const project of projects) {
250
+ if (!project.isDirectory()) continue;
251
+ const folder = path.join(root, project.name);
252
+ let files = [];
253
+ try {
254
+ files = fs.readdirSync(folder);
255
+ } catch {
256
+ continue;
257
+ }
258
+ const file = files.find((entry) => entry.endsWith(name));
259
+ if (file) return path.join(folder, file);
260
+ }
261
+ }
262
+ return null;
263
+ };
237
264
  const modelFlags = ({ agent, model, effort }) => [
238
265
  ...(model ? (MODEL_FLAGS[agent]?.model(model) ?? []) : []),
239
266
  ...(effort ? (MODEL_FLAGS[agent]?.effort(effort) ?? []) : []),
@@ -386,7 +413,10 @@ export function agentInvocation(task) {
386
413
  // Pi has no permission prompts. --approve trusts project-local configuration for
387
414
  // this non-interactive run; its complete built-in tool set remains enabled. Another
388
415
  // person's ask ignores project-local files instead (--no-approve).
389
- if (task.agent === "pi")
416
+ if (task.agent === "pi") {
417
+ const session = task.resumeSession
418
+ ? piSessionFile(task.resumeSession)
419
+ : null;
390
420
  return {
391
421
  command: "pi",
392
422
  args: [
@@ -394,10 +424,12 @@ export function agentInvocation(task) {
394
424
  "json",
395
425
  task.ownSettingsOnly ? "--no-approve" : "--approve",
396
426
  ...modelFlags(task),
427
+ ...(session ? ["--session", session] : []),
397
428
  "-p",
398
429
  task.brief,
399
430
  ],
400
431
  };
432
+ }
401
433
  if (task.agent === "opencode") {
402
434
  return {
403
435
  command: "opencode",
@@ -756,6 +788,7 @@ export function runAgentTask(task, emit, observe = () => {}, hooks = {}) {
756
788
  continue;
757
789
  }
758
790
  const sessionId =
791
+ (event.type === "session" ? event.id : null) ||
759
792
  event.session_id ||
760
793
  event.sessionId ||
761
794
  event.sessionID ||
@@ -422,6 +422,13 @@ export function createSessionControl({
422
422
  return app ? { name: path.basename(app, ".app"), app } : setupTerminal();
423
423
  };
424
424
  const lastResort = () => personTerminal() ?? { name: "Terminal", app: null };
425
+ // DeepSeek Harness and Muse Code take no session to resume from a terminal: their sessions reopen only in their own
426
+ // apps. Open starts the agent in the session's folder there instead, and says it is not that session.
427
+ const startsFresh = (agentId, sessionId) =>
428
+ Boolean(sessionId && agentCommand(agentId)) &&
429
+ !resumeLine(agentId, sessionId);
430
+ const freshNote = (agentId, where) =>
431
+ `${nameOf(agentId)} can't be opened at an earlier session from Harness, so it starts fresh in ${where}. Its earlier sessions are in its own app.`;
425
432
  const terminalPlace = ({ name, app }) => ({ kind: "terminal", name, app });
426
433
 
427
434
  // An agent's home: the place most of its sessions started in over the last thirty days (ties: the latest), where its
@@ -647,22 +654,30 @@ export function createSessionControl({
647
654
  : { opensIn: name, note: busy };
648
655
  // In a Neovim of theirs still open (this one first, else the latest they used the agent in), in a new tab; with
649
656
  // none open, the buddy opens their terminal with Neovim running the session.
650
- const command = sessionId
651
- ? resumeLine(agentId, sessionId)
652
- : agentCommand(agentId);
657
+ const fresh = startsFresh(agentId, sessionId);
658
+ const command =
659
+ sessionId && !fresh
660
+ ? resumeLine(agentId, sessionId)
661
+ : agentCommand(agentId);
653
662
  for (const open of act ? neovimsFor(agentId, place) : []) {
654
663
  const shown = resumeInNeovim(open.server, command, folder);
655
- if (shown) return { opensIn: name, ...focusTerminal(shown, open) };
664
+ if (shown)
665
+ return {
666
+ opensIn: name,
667
+ ...focusTerminal(shown, open),
668
+ ...(fresh ? { note: freshNote(agentId, name) } : {}),
669
+ };
656
670
  }
657
671
  return {
658
672
  opensIn: name,
659
673
  resume: {
660
674
  agent: agentId,
661
- session: sessionId ?? null,
675
+ session: fresh ? null : (sessionId ?? null),
662
676
  cwd: folder ?? null,
663
677
  app: place.app ?? null,
664
678
  within: "nvim",
665
679
  },
680
+ ...(fresh ? { note: freshNote(agentId, name) } : {}),
666
681
  };
667
682
  }
668
683
  if (place.kind === "terminal") {
@@ -671,14 +686,16 @@ export function createSessionControl({
671
686
  return place.app
672
687
  ? { opensIn: name, app: place.app, note: busy }
673
688
  : { opensIn: name, note: busy };
689
+ const fresh = startsFresh(agentId, sessionId);
674
690
  return {
675
691
  opensIn: name,
676
692
  resume: {
677
693
  agent: agentId,
678
- session: sessionId ?? null,
694
+ session: fresh ? null : (sessionId ?? null),
679
695
  cwd: folder ?? null,
680
696
  app: place.app ?? null,
681
697
  },
698
+ ...(fresh ? { note: freshNote(agentId, name) } : {}),
682
699
  };
683
700
  }
684
701
  return place.app ? { opensIn: name, app: place.app } : null;
@@ -841,9 +858,11 @@ export function createSessionControl({
841
858
  placePlan(agentId, homeOf(agentId), sessionId, where, act) ??
842
859
  placePlan(agentId, usable(own), sessionId, where, act);
843
860
  if (plan) return plan;
844
- // Nothing else shows it (T3 never had it, say): the exact session, picked up in the person's terminal.
845
- if (CODING_AGENTS.includes(agentId)) {
861
+ // Nothing else shows it (T3 never had it, say): the exact session, picked up in the person's terminal; an agent
862
+ // that can't resume one there starts in its folder.
863
+ if (CODING_AGENTS.includes(agentId) || startsFresh(agentId, sessionId)) {
846
864
  const terminal = lastResort();
865
+ const fresh = startsFresh(agentId, sessionId);
847
866
  // Until Harness may send into T3, a thread's runs happen in Harness's own copy of the repo, which T3 doesn't list.
848
867
  const inCopy =
849
868
  sessionId &&
@@ -854,10 +873,11 @@ export function createSessionControl({
854
873
  opensIn: terminal.name,
855
874
  resume: {
856
875
  agent: agentId,
857
- session: sessionId,
876
+ session: fresh ? null : sessionId,
858
877
  cwd: where,
859
878
  app: terminal.app,
860
879
  },
880
+ ...(fresh ? { note: freshNote(agentId, terminal.name) } : {}),
861
881
  ...(inCopy
862
882
  ? {
863
883
  note: `This run happened in Harness's own copy of the repo, which T3 Code doesn't list, so it opens in ${terminal.name}. Approve Harness in T3 Code and this thread's next turns run there.`,
package/lib/team.mjs CHANGED
@@ -73,6 +73,8 @@ export function validPlan(
73
73
  ? proposed.rigor
74
74
  : "standard";
75
75
  const split = !piece && Boolean(proposed?.split);
76
+ // The person wants every agent in: Make keeps every one the round put there, past the side-by-side cap.
77
+ const everyone = !piece && proposed?.everyone === true;
76
78
  const given = new Map(
77
79
  (Array.isArray(proposed?.steps) ? proposed.steps : [])
78
80
  .filter((step) => STEP_IDS.includes(step?.id))
@@ -116,9 +118,11 @@ export function validPlan(
116
118
  }
117
119
  // Make is never left empty while the person tagged someone.
118
120
  if (id === "make" && !agents.length && !split) agents = tagged;
119
- agents = stepOf(id).together
120
- ? agents.slice(0, TEAM.mostSideBySide)
121
- : agents.slice(0, 1);
121
+ agents = !stepOf(id).together
122
+ ? agents.slice(0, 1)
123
+ : everyone
124
+ ? agents
125
+ : agents.slice(0, TEAM.mostSideBySide);
122
126
  holders[id] = agents;
123
127
  return { id, specialty: step.specialty, agents };
124
128
  });
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "tryharness",
3
- "version": "0.7.62",
3
+ "version": "0.7.64",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "tryharness",
9
- "version": "0.7.62",
9
+ "version": "0.7.64",
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.62",
36
- "tryharness-desktop-darwin-x64": "0.7.62",
37
- "tryharness-desktop-linux-x64": "0.7.62"
35
+ "tryharness-desktop-darwin-arm64": "0.7.64",
36
+ "tryharness-desktop-darwin-x64": "0.7.64",
37
+ "tryharness-desktop-linux-x64": "0.7.64"
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.62",
1055
- "resolved": "https://registry.npmjs.org/tryharness-desktop-darwin-arm64/-/tryharness-desktop-darwin-arm64-0.7.62.tgz",
1056
- "integrity": "sha512-zlyu7H1UTLOeEUFsPwbYy6qBmGK6nnbBd2q9/vbFQCWzAM8iUD7fLL4OFygWx9abuCTm0q2RCZEs5aUlddzptA==",
1054
+ "version": "0.7.64",
1055
+ "resolved": "https://registry.npmjs.org/tryharness-desktop-darwin-arm64/-/tryharness-desktop-darwin-arm64-0.7.64.tgz",
1056
+ "integrity": "sha512-hB/HjdMGZzLAmKUmIa1+4+UnxFVAjIgT1vvb8d1kop/0nLn/uZk7xkzZTtQMTeBcdHdieozS5+OZhSczb9Uk2w==",
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.62",
1068
- "resolved": "https://registry.npmjs.org/tryharness-desktop-darwin-x64/-/tryharness-desktop-darwin-x64-0.7.62.tgz",
1069
- "integrity": "sha512-5MT/t1tjuRQkyKWKSOlqMalc9jvYqEIA8Paci+ujyKaRw7bbQ5Rp3sMYgeX3SLy4Cb8fxA0PhVw7KGh2w4Bi8A==",
1067
+ "version": "0.7.64",
1068
+ "resolved": "https://registry.npmjs.org/tryharness-desktop-darwin-x64/-/tryharness-desktop-darwin-x64-0.7.64.tgz",
1069
+ "integrity": "sha512-oDwPfrA6jav82YzYhLAJ/IxLpWFLJwjj/MeOjMq75bvWnsSKr5lj6Ft+I6XdAkfs+e72BhM1J8pnQOPbdVAehA==",
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.62",
1081
- "resolved": "https://registry.npmjs.org/tryharness-desktop-linux-x64/-/tryharness-desktop-linux-x64-0.7.62.tgz",
1082
- "integrity": "sha512-5/wL+oV15r07i85mZM3WglLrS3x/xrTmYOVMxt6NjhS4ySUnjBaL1udZbQxmiYLmSS9Hhvo360td2xt3pbTEAw==",
1080
+ "version": "0.7.64",
1081
+ "resolved": "https://registry.npmjs.org/tryharness-desktop-linux-x64/-/tryharness-desktop-linux-x64-0.7.64.tgz",
1082
+ "integrity": "sha512-P9OC73WTR3TgSeeQKyAQ83VVtFqvO9Pd/mSvB5ViiX+jtXD+j9Ql6SnU5oHVKp7urK3ymauO1wG5op6tgZ2Dcg==",
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.62",
3
+ "version": "0.7.64",
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.62",
52
- "tryharness-desktop-darwin-x64": "0.7.62",
53
- "tryharness-desktop-linux-x64": "0.7.62"
51
+ "tryharness-desktop-darwin-arm64": "0.7.64",
52
+ "tryharness-desktop-darwin-x64": "0.7.64",
53
+ "tryharness-desktop-linux-x64": "0.7.64"
54
54
  }
55
55
  }
package/release.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest": {
3
3
  "name": "tryharness",
4
- "version": "0.7.62",
4
+ "version": "0.7.64",
5
5
  "files": {
6
6
  "README.md": "b1c3d6f614dd896b6ffda089c512811ea21c41f2970181162cdba230ac7fb77e",
7
7
  "assets/dsh-plugin.mjs": "143d31361d3c34b0a9effdeaa9248f1df6166f9bb45826a9a96ec9aa21899411",
@@ -61,7 +61,7 @@
61
61
  "lib/contractGate.mjs": "f6c2f7ebe5834bf1716c5d4298a4e0636f81a981fef9b8ce4f38ff2d4cf4e0fb",
62
62
  "lib/control-client.mjs": "16130df5d4a04cfea5a327a4c57a1177b268b7073b4f060dd3d2732ff8ac91d5",
63
63
  "lib/controlSocket.mjs": "24b366d24c0cc9ca6b9c9b3490d47440edac1b1be91e2bc04e8b693b635a952e",
64
- "lib/coordinator.mjs": "e5d7e800c5ee05c1f1c42a6e60a45c546aa9f0edc7a29472c6e4996913def29c",
64
+ "lib/coordinator.mjs": "3e3163d5b6d58e888704d833f8e7d34ce022f9b6073f9791ad04e3f1cbc6c8fe",
65
65
  "lib/coreModels.mjs": "481633a56283bbed58688300c5139962ae3d8602559015df5801decd8aa8d233",
66
66
  "lib/daemon.mjs": "0c64bbb48b273dc91594003c076495f13ba1fe84bf609f3383eaade1e9e4932d",
67
67
  "lib/desk.mjs": "e769e1f68117d9d6163538ba73318b2fdae48c179274e6da4f93db8f4febcdf8",
@@ -158,7 +158,7 @@
158
158
  "lib/runBrief.mjs": "e7a65a83e6e5554c746e10e3a48cd68b6bf6c9520c1c32b384c1b7099c07f848",
159
159
  "lib/runRequests.mjs": "3f35d95f7204ef60b3be2d9852d84aed063e83420b26b83701930cc826e1b170",
160
160
  "lib/runWorker.mjs": "ac86dd9bdc54aee8684b21766fa8be640496dc4130909a4216d6650ca5a4fa95",
161
- "lib/runner.mjs": "f0cbbfc528f10a11212c50b53f8b0518ac01797e569ba4ea5daf93be1cf1a757",
161
+ "lib/runner.mjs": "6e2050a4a5026abf76f43df9fa204b1b99a0967182856761c83a8c73ad9ab914",
162
162
  "lib/runtime-install.mjs": "da24b88a8106adf61443a66dc5eeef12162dc4a51b49137d9b76641f6bc24025",
163
163
  "lib/schedules.mjs": "1746435cfe3722ea2fb99c89c051384de6b2db1548968d2b8af36292e4410248",
164
164
  "lib/screens.mjs": "dd573149e1d49771b9d7257811f2162f4345e78bae5b04265724265e2ec8e295",
@@ -169,7 +169,7 @@
169
169
  "lib/seen.mjs": "2d1f7c75897d7046bdc72ff201f2613ffa909d05f333b502c7b5d707907679d6",
170
170
  "lib/serverWords.mjs": "fab6e31b59e8b57de80d3dd060b874a5801eb745cbf58f2aaed5ed1d4147a37e",
171
171
  "lib/service.mjs": "5ed3df2e4b19dd4c5b91c87a736d97bf8d183a4ba6b2deff65d989bc2f15dc1f",
172
- "lib/sessionControl.mjs": "23a51af7df0518970068f107102babb458269c1d6d31469ed7908d37bf540b9c",
172
+ "lib/sessionControl.mjs": "2623e0239fdaaff3e0eb4e86f6d3b38eed0e4845951df467fdb217ae13403c59",
173
173
  "lib/sessionIndex.mjs": "a2f2478dbe8350927421423fc5bf74a1bdd409f7b2d659ede88d3f30eafef5f2",
174
174
  "lib/snippets.mjs": "f1f68da74bcaf7b1fd5f769804b2868c7ead1e930532483e42f9663d88b77519",
175
175
  "lib/specialties.json": "8d129882d8b968662e29fb1e35b0539852fe76d933c6f14045030a0ef4928eb4",
@@ -190,7 +190,7 @@
190
190
  "lib/taskRooms.mjs": "a5c1179a30787f36b3435d57799d5a33c23222482bbc2584b69e1a5b3d95619e",
191
191
  "lib/taskRuns.mjs": "4f3a05c3479348fd760af73fa565c3ced9a99fe5b353375c10cef6b50722a359",
192
192
  "lib/team.json": "5ab27433bdafc5be8aa98e4ad1e75c43446541005dd62de632b827bafc730cc1",
193
- "lib/team.mjs": "83c4bfbdfc4f0c99b57729ddaed14e6833884370b103289ee416195089cec7da",
193
+ "lib/team.mjs": "f838fe0a9afd4b75a56bb4ed2b9646d09e85176997d2419b30b268b937e0626b",
194
194
  "lib/threadActions.mjs": "285f0596e23898b8fcefd33bb11d8a43c106c5b99da07274532bcf7cd90bea0a",
195
195
  "lib/threadAuthority.mjs": "3288f4d8e2bbc5f4d9baf7433587f0b7bc817a61f75152639c41a3bd6c8923f8",
196
196
  "lib/threadBriefs.mjs": "f4012411846171ddd3fbdd8b7d4a1c8567b0b933fcfa0bc8fc0e0c4470ff470c",
@@ -215,10 +215,10 @@
215
215
  "lib/workFocus.mjs": "08d3002d6114859bf7623fbcb62a5ed1dd12cecba6c8e37ed55a550a15a207a4",
216
216
  "lib/workLinks.mjs": "8269180900fdf5fbd547a4c2337bcde4d5f733621c5b72bc2c23f01e72ad3d7d",
217
217
  "lib/worktrees.mjs": "a040441863ee76e39e292e262b903b392e12d4158aa886e4c237b6fa98c0d7d2",
218
- "npm-shrinkwrap.json": "50df49e6cc1be1b7bfb0696af9424f3e6b085df8a1947238ad531bdcf6e5bbfc",
219
- "package.json": "6aa518be26dc986667b3f54ba262548f430a3afd61bc317fbd31f7030713673a"
218
+ "npm-shrinkwrap.json": "892bcdd0ae0c1d70cedcca9ee27858f7320fcf5392a3eab56ecac4af24916023",
219
+ "package.json": "29a49890c924c539c7c72b8dc017cfd96e77ce4f242f3747bb8a6ededa5d91ba"
220
220
  }
221
221
  },
222
222
  "key": "5bf9e60f5cabb530",
223
- "signature": "MA+n6cUpC+tgfMaD+3DcYWzbVA4pKlc1KfyDlf9nSA9nmr2ex1anPkEGJ9MT+jVV7CzmoAn3xQZKm30MxU0YBw=="
223
+ "signature": "dluZA+0jzT62bDJVmm87q57LLywyB5/BwtSSjazAcofFaHdkGf4YkgfMCDCAL57tvt+SZglmrQPHb5x0jdB9CA=="
224
224
  }