tryharness 0.7.45 → 0.7.54
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/README.md +239 -14
- package/assets/dsh-plugin.mjs +72 -0
- package/assets/opencode-plugin.js +4 -3
- package/cli.mjs +497 -196
- package/lib/actorRoster.mjs +28 -5
- package/lib/adapters.mjs +165 -222
- package/lib/agentRuntimeConfig.mjs +36 -0
- package/lib/agentRuntimes.mjs +570 -0
- package/lib/agentSignIn.mjs +226 -0
- package/lib/atlas.mjs +7 -2
- package/lib/audit.mjs +643 -0
- package/lib/backupSetup.mjs +141 -0
- package/lib/boardAccess.mjs +8 -1
- package/lib/boardBackup.mjs +283 -0
- package/lib/boardCommands.mjs +5 -10
- package/lib/boardFileCommands.mjs +2 -1
- package/lib/boardMirror.mjs +523 -0
- package/lib/boardProtocol.json +263 -6
- package/lib/boardTools.mjs +2 -6
- package/lib/boardWaits.mjs +102 -0
- package/lib/book.mjs +659 -0
- package/lib/bridge.mjs +26 -4
- package/lib/browserWake.mjs +60 -0
- package/lib/cards.mjs +159 -16
- package/lib/cloudBoot.mjs +124 -0
- package/lib/commands.mjs +25 -5
- package/lib/connectionTools.d.ts +13 -0
- package/lib/connectionTools.js +45 -0
- package/lib/connectorAuth.mjs +309 -0
- package/lib/connectorCatalog.json +41 -0
- package/lib/connectorCommands.mjs +121 -0
- package/lib/connectorGoogle.mjs +513 -0
- package/lib/connectors.mjs +805 -0
- package/lib/context.mjs +18 -4
- package/lib/contractGate.mjs +377 -0
- package/lib/coordinator.mjs +152 -39
- package/lib/coreModels.mjs +78 -0
- package/lib/daemon.mjs +973 -54
- package/lib/desk.mjs +239 -0
- package/lib/desktop.mjs +113 -8
- package/lib/digest.mjs +32 -0
- package/lib/directLink.mjs +283 -0
- package/lib/environments.mjs +825 -0
- package/lib/folders.mjs +4 -4
- package/lib/gitHost.mjs +174 -0
- package/lib/goalCommands.mjs +58 -14
- package/lib/hookDialects.mjs +298 -0
- package/lib/inference.mjs +263 -152
- package/lib/landed.mjs +887 -0
- package/lib/lessons.mjs +6 -0
- package/lib/lineup.mjs +324 -0
- package/lib/live.mjs +284 -13
- package/lib/localmodels.mjs +10 -0
- package/lib/machineIdentity.mjs +3 -0
- package/lib/machineRoutes.mjs +40 -2
- package/lib/machineRuns.mjs +30 -3
- package/lib/machineSeal.mjs +69 -10
- package/lib/mcp-stdio.mjs +189 -120
- package/lib/mcpRelay.mjs +119 -0
- package/lib/members.json +26 -0
- package/lib/members.mjs +33 -0
- package/lib/modelMemory.mjs +100 -0
- package/lib/models.mjs +48 -15
- package/lib/museSession.mjs +122 -0
- package/lib/nativeHost.mjs +203 -0
- package/lib/neovim.mjs +126 -0
- package/lib/network.mjs +7 -2
- package/lib/nudge.mjs +57 -18
- package/lib/onboard.mjs +430 -1
- package/lib/oneclawLocal.mjs +150 -0
- package/lib/ownMachines.mjs +828 -39
- package/lib/pairing.mjs +182 -0
- package/lib/paths.mjs +8 -0
- package/lib/personModel.mjs +89 -0
- package/lib/phones.mjs +119 -3
- package/lib/placeCommands.mjs +27 -0
- package/lib/places.mjs +337 -9
- package/lib/plans.mjs +151 -27
- package/lib/profile.mjs +152 -0
- package/lib/projects.mjs +624 -137
- package/lib/readiness.mjs +400 -0
- package/lib/record.mjs +115 -0
- package/lib/repoLinks.mjs +354 -0
- package/lib/roomChannels.mjs +641 -0
- package/lib/runBrief.mjs +32 -2
- package/lib/runRequests.mjs +157 -0
- package/lib/runWorker.mjs +37 -9
- package/lib/runner.mjs +74 -11
- package/lib/secretPatterns.json +55 -0
- package/lib/secrets.mjs +10 -27
- package/lib/seen.mjs +102 -0
- package/lib/service.mjs +11 -6
- package/lib/sessionControl.mjs +386 -96
- package/lib/sessionIndex.mjs +5 -3
- package/lib/specialties.json +74 -0
- package/lib/specialties.mjs +477 -0
- package/lib/specialtyKeys.d.ts +3 -0
- package/lib/specialtyKeys.js +58 -0
- package/lib/specialtyNotice.mjs +147 -0
- package/lib/specialtySnapshot.mjs +138 -0
- package/lib/store.mjs +829 -29
- package/lib/subagents.mjs +8 -4
- package/lib/swarm.mjs +483 -37
- package/lib/swarmMemory.mjs +947 -0
- package/lib/t3.mjs +56 -17
- package/lib/taskCommands.mjs +91 -13
- package/lib/taskRuns.mjs +68 -11
- package/lib/team.json +253 -144
- package/lib/team.mjs +538 -147
- package/lib/threadLine.mjs +116 -0
- package/lib/threadRuns.mjs +78 -12
- package/lib/threadView.mjs +66 -16
- package/lib/tokenizer.mjs +405 -0
- package/lib/ui.mjs +16 -2
- package/lib/usageTotals.mjs +148 -0
- package/lib/vault.mjs +1144 -0
- package/lib/vaultCloud.mjs +117 -0
- package/lib/vaultCommands.mjs +201 -0
- package/lib/vaultTools.d.ts +12 -0
- package/lib/vaultTools.js +42 -0
- package/lib/windowAsks.mjs +42 -0
- package/lib/workFocus.mjs +59 -0
- package/lib/workLinks.mjs +90 -0
- package/lib/worktrees.mjs +51 -13
- package/package.json +10 -5
package/lib/seen.mjs
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// What the person saw, for the swarm's memory (owner, October 22: the swarm should know what the person has seen, read
|
|
2
|
+
// from the Harness extension's hidden page, "part of the memories" rather than on its own clock). Each dream asks the
|
|
3
|
+
// person's Harness window (windowAsks.mjs, which wakes the hidden page) for one described frame per hour since the last
|
|
4
|
+
// read, by browser, and drops what the person deleted there since.
|
|
5
|
+
//
|
|
6
|
+
// It stays on this computer: never sent to Harness's server (no dream reads it), never in a brief (the person's local
|
|
7
|
+
// agents run on hosted models too), and recall shows it to the person's own searches only (default no, owner,
|
|
8
|
+
// October 22). Frames themselves stay in the browser; this keeps only their descriptions.
|
|
9
|
+
|
|
10
|
+
// The answering browser keeps what it last read for at most this many of the frames kept here.
|
|
11
|
+
const KEPT_REFS = 200;
|
|
12
|
+
const SHOWN = 6;
|
|
13
|
+
|
|
14
|
+
export function createSeen({
|
|
15
|
+
store,
|
|
16
|
+
askWindows,
|
|
17
|
+
// Whether Harness can carry a sealed question to the window now (connected, and it offers sealed_ask).
|
|
18
|
+
canAsk = () => true,
|
|
19
|
+
log = () => {},
|
|
20
|
+
}) {
|
|
21
|
+
const cursorKey = (browser) => `seen-cursor:${browser}`;
|
|
22
|
+
// Every browser read so far, kept apart from what it saw: one whose items were all forgotten keeps its place.
|
|
23
|
+
const browsers = () => {
|
|
24
|
+
try {
|
|
25
|
+
return JSON.parse(store.meta("seen-browsers") || "[]");
|
|
26
|
+
} catch {
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/** One read from the person's window: { ok, kept, gone } or { ok: false, why }. */
|
|
32
|
+
const read = async () => {
|
|
33
|
+
if (!canAsk())
|
|
34
|
+
return { ok: false, why: "Harness cannot reach the person's window now" };
|
|
35
|
+
const known = browsers();
|
|
36
|
+
const reply = await askWindows({
|
|
37
|
+
tool: "screen_seen_since",
|
|
38
|
+
agent: "memory",
|
|
39
|
+
input: {
|
|
40
|
+
since: Object.fromEntries(
|
|
41
|
+
known.map((browser) => [
|
|
42
|
+
browser,
|
|
43
|
+
Number(store.meta(cursorKey(browser))) || 0,
|
|
44
|
+
])
|
|
45
|
+
),
|
|
46
|
+
kept: Object.fromEntries(
|
|
47
|
+
known.map((browser) => [browser, store.seenRefs(browser, KEPT_REFS)])
|
|
48
|
+
),
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
if (!reply?.ok) return { ok: false, why: reply?.error || "no answer" };
|
|
52
|
+
let answer;
|
|
53
|
+
try {
|
|
54
|
+
answer = JSON.parse(reply.text);
|
|
55
|
+
} catch {
|
|
56
|
+
return { ok: false, why: "the window's answer was not readable" };
|
|
57
|
+
}
|
|
58
|
+
const browser = String(answer.browser || "");
|
|
59
|
+
if (!browser) return { ok: false, why: "the window did not say who it is" };
|
|
60
|
+
if (!known.includes(browser))
|
|
61
|
+
store.meta("seen-browsers", JSON.stringify([...known, browser]));
|
|
62
|
+
let kept = 0;
|
|
63
|
+
for (const item of answer.seen ?? [])
|
|
64
|
+
if (
|
|
65
|
+
Number.isInteger(item.ref) &&
|
|
66
|
+
typeof item.text === "string" &&
|
|
67
|
+
item.text.trim() &&
|
|
68
|
+
store.addSeen({
|
|
69
|
+
window: browser,
|
|
70
|
+
ref: item.ref,
|
|
71
|
+
at: new Date(Number(item.at)).toISOString(),
|
|
72
|
+
text: item.text.slice(0, 1_000),
|
|
73
|
+
frames: Number(item.frames) || 1,
|
|
74
|
+
})
|
|
75
|
+
)
|
|
76
|
+
kept++;
|
|
77
|
+
let gone = 0;
|
|
78
|
+
for (const ref of answer.gone ?? [])
|
|
79
|
+
if (store.removeSeen(`${browser}:${ref}`)) gone++;
|
|
80
|
+
if (Number.isFinite(answer.through))
|
|
81
|
+
store.meta(cursorKey(browser), String(answer.through));
|
|
82
|
+
if (kept || gone) log(`seen: kept ${kept}, dropped ${gone} deleted`);
|
|
83
|
+
return { ok: true, kept, gone };
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const view = (row) => ({
|
|
87
|
+
id: row.id,
|
|
88
|
+
at: row.at,
|
|
89
|
+
text: row.text,
|
|
90
|
+
frames: row.frames,
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
return {
|
|
94
|
+
read,
|
|
95
|
+
/** What the person saw that matches a search of theirs, best first. */
|
|
96
|
+
matching: (query, limit = SHOWN) =>
|
|
97
|
+
store.seenMatching(query, limit).map(view),
|
|
98
|
+
list: (options) => store.seen(options).map(view),
|
|
99
|
+
/** The person forgets one by id: true when it was kept. */
|
|
100
|
+
forget: (id) => store.removeSeen(String(id)),
|
|
101
|
+
};
|
|
102
|
+
}
|
package/lib/service.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 { spawn } from "node:child_process";
|
|
5
|
-
import {
|
|
5
|
+
import { detectAgents, run } from "./commands.mjs";
|
|
6
6
|
import { ensureDir } from "./files.mjs";
|
|
7
7
|
import { paths } from "./paths.mjs";
|
|
8
8
|
import { appProgram } from "./desktop.mjs";
|
|
@@ -143,9 +143,8 @@ function agentPath() {
|
|
|
143
143
|
"/usr/bin",
|
|
144
144
|
"/bin",
|
|
145
145
|
]);
|
|
146
|
-
for (const
|
|
147
|
-
|
|
148
|
-
if (found) dirs.add(path.dirname(found));
|
|
146
|
+
for (const agent of detectAgents()) {
|
|
147
|
+
if (agent.path) dirs.add(path.dirname(agent.path));
|
|
149
148
|
}
|
|
150
149
|
return [...dirs].join(path.delimiter);
|
|
151
150
|
}
|
|
@@ -243,7 +242,12 @@ export function installService({
|
|
|
243
242
|
run("launchctl", ["kickstart", "-k", `${domain}/${LABEL}`]);
|
|
244
243
|
return { manager: "launchd", file: plist };
|
|
245
244
|
}
|
|
246
|
-
|
|
245
|
+
// A Linux computer without a systemd user session (a container, WSL, a minimal install) starts the daemon for this
|
|
246
|
+
// login instead, as other platforms do; setup used to stop here with "could not start Harness daemon with systemd".
|
|
247
|
+
if (
|
|
248
|
+
platform === "linux" &&
|
|
249
|
+
execute("systemctl", ["--user", "show-environment"]).ok
|
|
250
|
+
) {
|
|
247
251
|
const unit = servicePath();
|
|
248
252
|
ensureDir(path.dirname(unit));
|
|
249
253
|
fs.writeFileSync(
|
|
@@ -323,7 +327,8 @@ export function serviceInfo({
|
|
|
323
327
|
manager:
|
|
324
328
|
platform === "darwin"
|
|
325
329
|
? "launchd"
|
|
326
|
-
: platform === "linux"
|
|
330
|
+
: platform === "linux" &&
|
|
331
|
+
execute("systemctl", ["--user", "show-environment"]).ok
|
|
327
332
|
? "systemd"
|
|
328
333
|
: "detached",
|
|
329
334
|
installed: Boolean(file && fs.existsSync(file)),
|