tryharness 0.7.44 → 0.7.53

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 (101) hide show
  1. package/README.md +232 -12
  2. package/cli.mjs +406 -184
  3. package/lib/actorRoster.mjs +28 -5
  4. package/lib/adapters.mjs +9 -1
  5. package/lib/agentRuntimeConfig.mjs +36 -0
  6. package/lib/agentRuntimes.mjs +560 -0
  7. package/lib/atlas.mjs +7 -2
  8. package/lib/boardCommands.mjs +5 -10
  9. package/lib/boardFileCommands.mjs +2 -1
  10. package/lib/boardMirror.mjs +459 -0
  11. package/lib/boardProtocol.json +259 -6
  12. package/lib/boardTools.mjs +2 -6
  13. package/lib/bridge.mjs +27 -3
  14. package/lib/browserWake.mjs +60 -0
  15. package/lib/cards.mjs +35 -2
  16. package/lib/commands.mjs +20 -5
  17. package/lib/connectionTools.d.ts +13 -0
  18. package/lib/connectionTools.js +45 -0
  19. package/lib/connectorAuth.mjs +309 -0
  20. package/lib/connectorCatalog.json +41 -0
  21. package/lib/connectorCommands.mjs +121 -0
  22. package/lib/connectorGoogle.mjs +513 -0
  23. package/lib/connectors.mjs +805 -0
  24. package/lib/coordinator.mjs +16 -2
  25. package/lib/coreModels.mjs +78 -0
  26. package/lib/daemon.mjs +775 -46
  27. package/lib/desktop.mjs +7 -2
  28. package/lib/digest.mjs +32 -0
  29. package/lib/directLink.mjs +283 -0
  30. package/lib/environments.mjs +595 -0
  31. package/lib/folders.mjs +2 -2
  32. package/lib/goalCommands.mjs +61 -12
  33. package/lib/inference.mjs +263 -152
  34. package/lib/lessons.mjs +6 -0
  35. package/lib/lineup.mjs +324 -0
  36. package/lib/localmodels.mjs +10 -0
  37. package/lib/machineIdentity.mjs +3 -0
  38. package/lib/machineRoutes.mjs +40 -2
  39. package/lib/machineRuns.mjs +30 -3
  40. package/lib/machineSeal.mjs +69 -10
  41. package/lib/mcp-stdio.mjs +180 -98
  42. package/lib/mcpRelay.mjs +119 -0
  43. package/lib/members.json +12 -0
  44. package/lib/members.mjs +33 -0
  45. package/lib/modelMemory.mjs +100 -0
  46. package/lib/modelTiers.json +1183 -0
  47. package/lib/modelTiers.mjs +133 -0
  48. package/lib/models.mjs +41 -8
  49. package/lib/museSession.mjs +119 -0
  50. package/lib/nativeHost.mjs +203 -0
  51. package/lib/network.mjs +38 -1
  52. package/lib/nudge.mjs +10 -2
  53. package/lib/onboard.mjs +430 -1
  54. package/lib/oneclawLocal.mjs +150 -0
  55. package/lib/ownMachines.mjs +521 -36
  56. package/lib/pairing.mjs +165 -0
  57. package/lib/paths.mjs +4 -0
  58. package/lib/phones.mjs +61 -0
  59. package/lib/placeCommands.mjs +27 -0
  60. package/lib/places.mjs +10 -2
  61. package/lib/plans.mjs +151 -27
  62. package/lib/profile.mjs +152 -0
  63. package/lib/projectGit.mjs +328 -0
  64. package/lib/projectSettings.mjs +120 -0
  65. package/lib/projects.mjs +2539 -0
  66. package/lib/readiness.mjs +283 -0
  67. package/lib/repoLinks.mjs +354 -0
  68. package/lib/roomChannels.mjs +641 -0
  69. package/lib/runBrief.mjs +32 -2
  70. package/lib/runRequests.mjs +157 -0
  71. package/lib/runWorker.mjs +20 -7
  72. package/lib/runner.mjs +67 -8
  73. package/lib/secretPatterns.json +55 -0
  74. package/lib/secrets.mjs +10 -27
  75. package/lib/seen.mjs +102 -0
  76. package/lib/service.mjs +11 -6
  77. package/lib/sessionControl.mjs +10 -8
  78. package/lib/sessionIndex.mjs +5 -3
  79. package/lib/store.mjs +559 -30
  80. package/lib/subagents.mjs +8 -4
  81. package/lib/swarm.mjs +379 -38
  82. package/lib/swarmMemory.mjs +947 -0
  83. package/lib/t3.mjs +43 -13
  84. package/lib/taskCommands.mjs +58 -5
  85. package/lib/taskRuns.mjs +61 -11
  86. package/lib/team.json +17 -15
  87. package/lib/team.mjs +68 -18
  88. package/lib/threadRuns.mjs +50 -7
  89. package/lib/threadView.mjs +68 -15
  90. package/lib/tokenizer.mjs +405 -0
  91. package/lib/ui.mjs +16 -2
  92. package/lib/usageTotals.mjs +148 -0
  93. package/lib/vault.mjs +1144 -0
  94. package/lib/vaultCloud.mjs +117 -0
  95. package/lib/vaultCommands.mjs +201 -0
  96. package/lib/vaultTools.d.ts +12 -0
  97. package/lib/vaultTools.js +42 -0
  98. package/lib/windowAsks.mjs +42 -0
  99. package/lib/workFocus.mjs +59 -0
  100. package/lib/workLinks.mjs +90 -0
  101. package/package.json +9 -4
@@ -0,0 +1,595 @@
1
+ import { createHash } from "node:crypto";
2
+ import { detectAgents } from "./commands.mjs";
3
+ import { member, nameOf } from "./members.mjs";
4
+ import { t3Access, t3Tool } from "./t3.mjs";
5
+ import { t3Link } from "./places.mjs";
6
+
7
+ const DRIVER_AGENT = {
8
+ codex: "codex",
9
+ claudeAgent: "claude-code",
10
+ cursor: "cursor",
11
+ grok: "grok-build",
12
+ opencode: "opencode",
13
+ antigravity: "antigravity",
14
+ muse: "muse-code",
15
+ pi: "pi",
16
+ };
17
+ const ACTIVE = new Set([
18
+ "preparing",
19
+ "queued",
20
+ "starting",
21
+ "running",
22
+ "waiting",
23
+ ]);
24
+ const stateOf = (status) =>
25
+ ACTIVE.has(status)
26
+ ? "working"
27
+ : status === "failed"
28
+ ? "failed"
29
+ : ["cancelled", "interrupted"].includes(status)
30
+ ? "stopped"
31
+ : "returned";
32
+ const failure = (error) => ({
33
+ ok: false,
34
+ code: error.code || "environment_error",
35
+ error: error.message,
36
+ });
37
+
38
+ /** Existing work owned by another execution environment, projected into the same swarm view. */
39
+ export function createEnvironments({ store, log, notify = () => {} }) {
40
+ let providers = [];
41
+ let threads = new Map();
42
+ let projects = new Map();
43
+ let refreshing = null;
44
+ let lastError = null;
45
+ let grant = null;
46
+ const controls = new Map();
47
+ const keyOf = (id) =>
48
+ `outside-t3-${createHash("sha256").update(`${t3Access()?.environmentId}:${id}`).digest("hex")}`;
49
+ const grantOf = (access) =>
50
+ JSON.stringify([
51
+ access?.environmentId,
52
+ access?.grantedAt,
53
+ access?.until,
54
+ access?.state,
55
+ ]);
56
+ const clear = () => {
57
+ providers = [];
58
+ threads = new Map();
59
+ projects = new Map();
60
+ };
61
+ const authorized = () => {
62
+ const access = t3Access();
63
+ if (!access || access.state === "expired") {
64
+ clear();
65
+ grant = null;
66
+ return null;
67
+ }
68
+ const current = grantOf(access);
69
+ if (grant !== current) clear();
70
+ grant = current;
71
+ return access;
72
+ };
73
+ const providerAgent = (id) => {
74
+ const provider = providers.find((entry) => entry.providerInstanceId === id);
75
+ return DRIVER_AGENT[provider?.driverKind] || `t3-${id}`;
76
+ };
77
+ const sourceOf = (entry) => ({
78
+ environment: "t3",
79
+ environmentName: "T3 Code",
80
+ threadId: entry.threadId,
81
+ providerInstanceId: entry.providerInstanceId,
82
+ parentThreadId: entry.parentThreadId ?? null,
83
+ relationship: entry.relationshipToParent ?? null,
84
+ native: entry.creationSource === "provider",
85
+ url: t3Link(entry.threadId),
86
+ controls: {
87
+ read: true,
88
+ send:
89
+ authorized()?.state === "send" &&
90
+ entry.relationshipToParent !== "subagent" &&
91
+ entry.creationSource !== "provider",
92
+ stop:
93
+ authorized()?.state === "send" &&
94
+ entry.relationshipToParent !== "subagent" &&
95
+ entry.creationSource !== "provider" &&
96
+ ACTIVE.has(entry.status),
97
+ },
98
+ });
99
+ const treeOf = (root) => {
100
+ const selected = new Map([[root.threadId, root]]);
101
+ let changed = true;
102
+ while (changed) {
103
+ changed = false;
104
+ for (const entry of threads.values())
105
+ if (
106
+ entry.relationshipToParent === "subagent" &&
107
+ selected.has(entry.parentThreadId) &&
108
+ !selected.has(entry.threadId)
109
+ ) {
110
+ selected.set(entry.threadId, entry);
111
+ changed = true;
112
+ }
113
+ }
114
+ return selected;
115
+ };
116
+ const summary = (entry) => {
117
+ const family = [...treeOf(entry).values()];
118
+ const active = family.filter((child) => ACTIVE.has(child.status));
119
+ const state = active.length ? "working" : stateOf(entry.status);
120
+ const agent = providerAgent(entry.providerInstanceId);
121
+ return {
122
+ id: keyOf(entry.threadId),
123
+ title: entry.title || "Untitled work",
124
+ objective: entry.title || "Untitled work",
125
+ status: "open",
126
+ agents: [
127
+ ...new Set(
128
+ family.map((child) => providerAgent(child.providerInstanceId))
129
+ ),
130
+ ],
131
+ coordinator: agent,
132
+ source: sourceOf(entry),
133
+ view: {
134
+ title: entry.title || "Untitled work",
135
+ state,
136
+ line: `${nameOf(agent)} · T3 Code`,
137
+ needsYou: [],
138
+ done: false,
139
+ },
140
+ folder: projects.get(entry.projectId)?.workspaceRoot ?? null,
141
+ working: [
142
+ ...new Set(
143
+ active.map((child) => providerAgent(child.providerInstanceId))
144
+ ),
145
+ ],
146
+ queued: [],
147
+ waiting: null,
148
+ step: null,
149
+ last: null,
150
+ posts: family.reduce((sum, child) => sum + (child.itemCount ?? 0), 0),
151
+ spend: { runs: 0, cost_usd: null },
152
+ changes: null,
153
+ createdAt: entry.createdAt,
154
+ updatedAt:
155
+ family
156
+ .map((child) => child.updatedAt)
157
+ .sort()
158
+ .at(-1) ?? entry.updatedAt,
159
+ activityVersion: family.map((child) => [
160
+ child.threadId,
161
+ child.status,
162
+ child.settled,
163
+ child.updatedAt,
164
+ child.itemCount,
165
+ ]),
166
+ openItems: [],
167
+ coordination: null,
168
+ };
169
+ };
170
+ async function paged(name, args, field) {
171
+ const result = [];
172
+ let cursor = null;
173
+ const seen = new Set();
174
+ do {
175
+ const page = await t3Tool(name, {
176
+ ...args,
177
+ limit: 100,
178
+ ...(cursor === null ? {} : { cursor }),
179
+ });
180
+ result.push(...(page[field] ?? []));
181
+ cursor = page.nextCursor ?? null;
182
+ if (cursor !== null && seen.has(cursor))
183
+ throw new Error(
184
+ "T3 Code repeated its page cursor; the view is incomplete."
185
+ );
186
+ seen.add(cursor);
187
+ } while (cursor !== null);
188
+ return result;
189
+ }
190
+ const refresh = () => {
191
+ if (!authorized()) return Promise.resolve();
192
+ if (refreshing) return refreshing;
193
+ const startedGrant = grant;
194
+ refreshing = (async () => {
195
+ try {
196
+ const [catalog, listedProjects] = await Promise.all([
197
+ t3Tool("orchestrator_capabilities", {}),
198
+ paged("t3_project_list", {}, "projects"),
199
+ ]);
200
+ const listedThreads = (
201
+ await Promise.all(
202
+ listedProjects.map((project) =>
203
+ paged(
204
+ "t3_thread_list",
205
+ {
206
+ projectId: project.id,
207
+ includeSubagents: true,
208
+ },
209
+ "threads"
210
+ )
211
+ )
212
+ )
213
+ ).flat();
214
+ if (!authorized() || startedGrant !== grant) return;
215
+ providers = catalog.providers ?? [];
216
+ projects = new Map(listedProjects.map((entry) => [entry.id, entry]));
217
+ threads = new Map(
218
+ listedThreads.map((entry) => [keyOf(entry.threadId), entry])
219
+ );
220
+ lastError = null;
221
+ notify();
222
+ } catch (error) {
223
+ clear();
224
+ lastError = error.message;
225
+ log(`outside environments: ${error.message}`);
226
+ } finally {
227
+ refreshing = null;
228
+ }
229
+ })();
230
+ return refreshing;
231
+ };
232
+ const roots = () => {
233
+ if (!authorized()) return [];
234
+ const known = new Set([...threads.values()].map((entry) => entry.threadId));
235
+ return [...threads.values()]
236
+ .filter(
237
+ (entry) =>
238
+ entry.relationshipToParent !== "subagent" ||
239
+ !known.has(entry.parentThreadId)
240
+ )
241
+ .map(summary);
242
+ };
243
+ const catalog = () => ({
244
+ ok: true,
245
+ environments: [
246
+ { id: "local", name: "This computer", available: true },
247
+ {
248
+ id: "t3",
249
+ name: "T3 Code",
250
+ access: authorized()?.state ?? null,
251
+ error: lastError,
252
+ },
253
+ ],
254
+ agents: [
255
+ ...detectAgents().map((entry) => ({
256
+ id: `local:${entry.agent}`,
257
+ agent: entry.agent,
258
+ name: nameOf(entry.agent),
259
+ environment: "local",
260
+ available: Boolean(entry.path),
261
+ reason: entry.path ? null : "Not found on this computer's PATH.",
262
+ protocol: member(entry.agent)?.runtime?.protocol ?? "native",
263
+ authentication: "not_checked",
264
+ })),
265
+ ...(authorized()
266
+ ? providers.map((entry) => ({
267
+ id: `t3:${entry.providerInstanceId}`,
268
+ agent: providerAgent(entry.providerInstanceId),
269
+ name:
270
+ entry.displayName ||
271
+ nameOf(providerAgent(entry.providerInstanceId)),
272
+ environment: "t3",
273
+ providerInstanceId: entry.providerInstanceId,
274
+ driverKind: entry.driverKind,
275
+ available: entry.canRunChildTask === true,
276
+ reason: entry.constraints?.join(" ") || null,
277
+ models: entry.models ?? [],
278
+ }))
279
+ : []),
280
+ ],
281
+ });
282
+ const owns = (id) => typeof id === "string" && id.startsWith("outside-t3-");
283
+ async function read(id) {
284
+ if (!authorized())
285
+ return {
286
+ ok: false,
287
+ code: "not_connected",
288
+ error: "Connect Harness to T3 Code to read this work.",
289
+ };
290
+ await refresh();
291
+ const readGrant = grant;
292
+ const root = threads.get(id);
293
+ if (!root)
294
+ return { ok: false, error: "This source thread is no longer available." };
295
+ const selected = treeOf(root);
296
+ const runs = [];
297
+ const posts = [];
298
+ const timeline = [];
299
+ for (const entry of selected.values()) {
300
+ let after = null;
301
+ let more = true;
302
+ const items = [];
303
+ const positions = new Set();
304
+ let detail;
305
+ while (more) {
306
+ const page = await t3Tool("t3_thread_read", {
307
+ threadId: entry.threadId,
308
+ view: "activity",
309
+ limit: 100,
310
+ maxCharsPerItem: 12_000,
311
+ runLimit: 5,
312
+ ...(after === null ? {} : { afterPosition: after }),
313
+ });
314
+ detail = page;
315
+ items.push(...(page.items ?? []));
316
+ more = page.hasMore === true;
317
+ if (
318
+ more &&
319
+ (!Number.isInteger(page.nextPosition) ||
320
+ positions.has(page.nextPosition))
321
+ )
322
+ throw new Error("T3 Code returned an incomplete activity page.");
323
+ positions.add(page.nextPosition);
324
+ after = page.nextPosition;
325
+ }
326
+ const actual = { ...entry, ...detail.thread };
327
+ if (
328
+ !actual.activeRunId &&
329
+ actual.status === "idle" &&
330
+ detail.recentRuns?.[0]?.status
331
+ )
332
+ actual.status = detail.recentRuns[0].status;
333
+ const agent = providerAgent(entry.providerInstanceId);
334
+ const messages = items.filter((item) =>
335
+ ["user_message", "assistant_message"].includes(item.type)
336
+ );
337
+ const answer =
338
+ messages.filter((item) => item.type === "assistant_message").at(-1)
339
+ ?.text ?? null;
340
+ const ownPosts = messages.map((item) => ({
341
+ id: `${entry.threadId}:${item.itemId}`,
342
+ seq: posts.length + messages.indexOf(item) + 1,
343
+ author: item.type === "user_message" ? "user" : agent,
344
+ kind: item.type === "user_message" ? "message" : "result",
345
+ text:
346
+ (item.text ?? "") +
347
+ (item.textTruncated
348
+ ? "\n\n[Truncated by T3 Code. Open the original session for the full item.]"
349
+ : ""),
350
+ created_at: item.updatedAt || entry.updatedAt,
351
+ source: {
352
+ ...sourceOf(entry),
353
+ itemId: item.itemId,
354
+ truncated: item.textTruncated === true,
355
+ },
356
+ }));
357
+ posts.push(...ownPosts);
358
+ timeline.push(
359
+ ...ownPosts.map((post) => ({
360
+ type: "message",
361
+ seq: post.seq,
362
+ author: post.author,
363
+ text: post.text,
364
+ at: post.created_at,
365
+ result: post.kind === "result",
366
+ headline: null,
367
+ asks: false,
368
+ }))
369
+ );
370
+ const status = ACTIVE.has(actual.status)
371
+ ? "running"
372
+ : actual.status === "completed" || actual.settled === true
373
+ ? "done"
374
+ : actual.status === "failed"
375
+ ? "failed"
376
+ : "unknown";
377
+ runs.push({
378
+ kind: "task",
379
+ usage: null,
380
+ id: keyOf(entry.threadId),
381
+ agent,
382
+ ask:
383
+ messages.find((item) => item.type === "user_message")?.text ||
384
+ entry.title,
385
+ askedBy: entry.parentThreadId
386
+ ? providerAgent(
387
+ selected.get(entry.parentThreadId)?.providerInstanceId
388
+ )
389
+ : "user",
390
+ after: selected.has(entry.parentThreadId)
391
+ ? [keyOf(entry.parentThreadId)]
392
+ : [],
393
+ status,
394
+ answer,
395
+ startedAt: entry.createdAt,
396
+ endedAt: ACTIVE.has(actual.status) ? null : entry.updatedAt,
397
+ sessionId: entry.threadId,
398
+ folder:
399
+ actual.worktreePath ??
400
+ projects.get(entry.projectId)?.workspaceRoot ??
401
+ null,
402
+ source: {
403
+ ...sourceOf(actual),
404
+ runId: actual.activeRunId ?? detail.recentRuns?.[0]?.runId ?? null,
405
+ },
406
+ model: { model: entry.model, effort: null, by: "T3 Code" },
407
+ subagents: [],
408
+ steps: items
409
+ .filter(
410
+ (item) =>
411
+ item.type !== "reasoning" &&
412
+ item.type !== "user_message" &&
413
+ item.text
414
+ )
415
+ .slice(-10)
416
+ .map((item) => ({
417
+ kind: item.type === "assistant_message" ? "say" : "do",
418
+ text: item.text.slice(0, 1_000),
419
+ })),
420
+ });
421
+ }
422
+ if (!authorized() || grant !== readGrant)
423
+ return {
424
+ ok: false,
425
+ code: "not_connected",
426
+ error: "T3 Code access changed while reading this work.",
427
+ };
428
+ return {
429
+ ok: true,
430
+ thread: { ...summary(root), source: runs[0].source },
431
+ runs,
432
+ posts: posts.sort(
433
+ (a, b) => a.created_at.localeCompare(b.created_at) || a.seq - b.seq
434
+ ),
435
+ timeline: timeline.sort(
436
+ (a, b) => a.at.localeCompare(b.at) || a.seq - b.seq
437
+ ),
438
+ plans: [],
439
+ files: [],
440
+ kept: [],
441
+ rendering: [],
442
+ };
443
+ }
444
+ async function control(request, agent) {
445
+ if (agent !== "user" || request.hostedCaller)
446
+ return { ok: false, error: "Only the person controls outside sessions." };
447
+ if (authorized()?.state !== "send")
448
+ return {
449
+ ok: false,
450
+ code: "read_only",
451
+ error:
452
+ "T3 Code access is read-only; approve control in T3 to send or stop.",
453
+ };
454
+ const id = String(request.id || "");
455
+ await refresh();
456
+ const entry = threads.get(id);
457
+ if (!entry)
458
+ return {
459
+ ok: false,
460
+ error: "This source session is no longer available.",
461
+ };
462
+ if (
463
+ entry.relationshipToParent === "subagent" ||
464
+ entry.creationSource === "provider"
465
+ )
466
+ return {
467
+ ok: false,
468
+ error:
469
+ "Control this delegated child through its original parent session.",
470
+ };
471
+ if (authorized()?.state !== "send")
472
+ return {
473
+ ok: false,
474
+ code: "read_only",
475
+ error: "T3 Code control access changed. Reconnect before sending.",
476
+ };
477
+ const requestId = String(request.requestId || "");
478
+ if (!/^[A-Za-z0-9._-]{1,128}$/.test(requestId))
479
+ return {
480
+ ok: false,
481
+ error: "A stable request identity is required for this action.",
482
+ };
483
+ const action = request.action;
484
+ if (!["send", "steer", "stop"].includes(action))
485
+ return { ok: false, error: "Choose send, steer or stop." };
486
+ const text = String(request.text || "").trim();
487
+ if (action !== "stop" && (!text || text.length > 50_000))
488
+ return {
489
+ ok: false,
490
+ error: "Write a message of at most 50,000 characters.",
491
+ };
492
+ const identity = createHash("sha256")
493
+ .update(
494
+ JSON.stringify({ id, action, text, runId: request.runId ?? null })
495
+ )
496
+ .digest("hex");
497
+ const receiptKey = `outside-control:${t3Access().environmentId}:${requestId}`;
498
+ const previous = controls.get(requestId);
499
+ if (previous)
500
+ return previous.identity === identity
501
+ ? previous.result
502
+ : {
503
+ ok: false,
504
+ error: "This action identity already belongs to different work.",
505
+ };
506
+ const saved = store.meta(receiptKey);
507
+ if (saved) {
508
+ const receipt = JSON.parse(saved);
509
+ if (receipt.identity !== identity)
510
+ return {
511
+ ok: false,
512
+ error: "This action identity already belongs to different work.",
513
+ };
514
+ return (
515
+ receipt.result ?? {
516
+ ok: false,
517
+ uncertain: true,
518
+ error:
519
+ "The previous delivery has no receipt. Inspect the original session before sending another message.",
520
+ }
521
+ );
522
+ }
523
+ const controlGrant = grant;
524
+ const perform = async () => {
525
+ if (grantOf(authorized()) !== controlGrant)
526
+ return {
527
+ ok: false,
528
+ error: "T3 Code access changed before this action.",
529
+ };
530
+ if (action === "stop") {
531
+ if (!request.runId)
532
+ return {
533
+ ok: false,
534
+ error: "Select the current run before stopping it.",
535
+ };
536
+ const current = await t3Tool("t3_thread_read", {
537
+ threadId: entry.threadId,
538
+ limit: 1,
539
+ runLimit: 1,
540
+ });
541
+ if (grantOf(authorized()) !== controlGrant)
542
+ return {
543
+ ok: false,
544
+ error: "T3 Code access changed before stopping this run.",
545
+ };
546
+ if (current.thread?.activeRunId !== request.runId)
547
+ return {
548
+ ok: false,
549
+ code: "changed",
550
+ error:
551
+ "This session changed. Read its current run before stopping it.",
552
+ };
553
+ return {
554
+ ok: true,
555
+ ...(await t3Tool("t3_thread_interrupt", {
556
+ threadId: entry.threadId,
557
+ runId: request.runId,
558
+ })),
559
+ };
560
+ }
561
+ return {
562
+ ok: true,
563
+ ...(await t3Tool("t3_thread_send", {
564
+ threadId: entry.threadId,
565
+ message: text,
566
+ mode: action === "steer" ? "steer" : "auto",
567
+ clientRequestId: requestId,
568
+ })),
569
+ };
570
+ };
571
+ store.meta(receiptKey, JSON.stringify({ identity }));
572
+ const result = perform()
573
+ .catch((error) => ({ ...failure(error), uncertain: true }))
574
+ .then((result) => {
575
+ store.meta(receiptKey, JSON.stringify({ identity, result }));
576
+ return result;
577
+ });
578
+ controls.set(requestId, { identity, result });
579
+ return result;
580
+ }
581
+ const command = (request, agent) => {
582
+ if (request.hostedCaller || !["user", "harness"].includes(agent))
583
+ return {
584
+ ok: false,
585
+ error: "Outside sessions are private to the person.",
586
+ };
587
+ const pending = (operation) => ({ pending: operation.catch(failure) });
588
+ if (request.command === "board.environments.list")
589
+ return pending(refresh().then(catalog));
590
+ if (request.command === "board.environments.control")
591
+ return pending(control(request, agent));
592
+ return { ok: false, error: "Unknown environment command." };
593
+ };
594
+ return { command, refresh, roots, owns, read, control, catalog };
595
+ }
package/lib/folders.mjs CHANGED
@@ -2,7 +2,7 @@ import fs from "node:fs";
2
2
  import os from "node:os";
3
3
  import path from "node:path";
4
4
  import { spawnSync } from "node:child_process";
5
- import { nameOf } from "./members.mjs";
5
+ import { MACHINE_RUNNERS, nameOf } from "./members.mjs";
6
6
  import { paths } from "./paths.mjs";
7
7
  import { t3Projects } from "./places.mjs";
8
8
 
@@ -14,7 +14,7 @@ import { t3Projects } from "./places.mjs";
14
14
  // there is never what was meant (the owner's October 13 thread ran Codex over their whole home folder; on October 14 a
15
15
  // buddy message was picked into ~/harness/src).
16
16
 
17
- const CODING = new Set(["claude-code", "codex", "pi", "opencode"]);
17
+ const CODING = new Set(MACHINE_RUNNERS);
18
18
  // Folders offered and sent to Jev: the most recently worked in. Browsing reaches any other.
19
19
  const OFFERED = 60;
20
20
  const LISTED = 200;