tryharness 0.7.53 → 0.7.57
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 +23 -19
- package/assets/dsh-plugin.mjs +72 -0
- package/assets/opencode-plugin.js +4 -3
- package/cli.mjs +484 -90
- package/lib/activity.mjs +10 -10
- package/lib/adapters.mjs +173 -222
- package/lib/agentBinaries.mjs +71 -0
- package/lib/agentRuntimeConfig.mjs +1 -1
- package/lib/agentRuntimes.mjs +34 -18
- package/lib/agentSignIn.mjs +456 -0
- package/lib/answers.mjs +5 -5
- package/lib/archetypes.d.ts +64 -0
- package/lib/archetypes.js +989 -0
- package/lib/asks.mjs +4 -4
- package/lib/audit.mjs +666 -0
- package/lib/backupSetup.mjs +143 -0
- package/lib/boardAccess.mjs +24 -11
- package/lib/boardBackup.mjs +283 -0
- package/lib/boardFileCommands.mjs +6 -6
- package/lib/boardFiles.mjs +13 -12
- package/lib/boardMirror.mjs +124 -25
- package/lib/boardProtocol.json +88 -2
- package/lib/boardWaits.mjs +101 -0
- package/lib/book.mjs +659 -0
- package/lib/bridge.mjs +6 -6
- package/lib/cards.mjs +138 -28
- package/lib/cloudAgents.mjs +216 -0
- package/lib/cloudAi.mjs +1312 -0
- package/lib/cloudAssistants.mjs +242 -0
- package/lib/cloudBoot.mjs +119 -0
- package/lib/cloudSave.mjs +197 -0
- package/lib/cloudSsh.mjs +178 -0
- package/lib/commands.mjs +7 -2
- package/lib/context.mjs +19 -5
- package/lib/contractGate.mjs +399 -0
- package/lib/control-client.mjs +9 -1
- package/lib/controlSocket.mjs +86 -0
- package/lib/coordinator.mjs +252 -144
- package/lib/daemon.mjs +1351 -2767
- package/lib/desk.mjs +240 -0
- package/lib/desktop.mjs +178 -74
- package/lib/directLink.mjs +16 -5
- package/lib/environment.mjs +2 -1
- package/lib/environments.mjs +247 -9
- package/lib/firewall.mjs +9 -9
- package/lib/folders.mjs +20 -16
- package/lib/frames.mjs +2 -3
- package/lib/gitHost.mjs +174 -0
- package/lib/goalCommands.mjs +25 -7
- package/lib/goals.mjs +7 -7
- package/lib/guestRequests.mjs +94 -0
- package/lib/handoffs.mjs +8 -7
- package/lib/handover.mjs +4 -4
- package/lib/harnessModel.mjs +6 -6
- package/lib/harnessOffers.mjs +266 -0
- package/lib/hookDialects.mjs +298 -0
- package/lib/inference.mjs +26 -8
- package/lib/jobAnswers.mjs +190 -0
- package/lib/landed.mjs +887 -0
- package/lib/lane.mjs +42 -11
- package/lib/lessons.mjs +16 -16
- package/lib/library.mjs +3 -3
- package/lib/lineup.mjs +3 -0
- package/lib/linkRelay.mjs +574 -0
- package/lib/live.mjs +284 -13
- package/lib/localAgentAsk.mjs +74 -0
- package/lib/localStack.mjs +536 -0
- package/lib/localmodels.mjs +6 -4
- package/lib/loopBackstop.mjs +4 -4
- package/lib/machineIdentity.mjs +9 -1
- package/lib/machineRoutes.mjs +181 -2
- package/lib/machineRuns.mjs +76 -1
- package/lib/machineSeal.mjs +39 -12
- package/lib/mcp-stdio.mjs +163 -27
- package/lib/mcpRelay.mjs +1 -1
- package/lib/members.json +29 -2
- package/lib/members.mjs +1 -1
- package/lib/models.mjs +85 -31
- package/lib/museSession.mjs +21 -13
- package/lib/nativeHost.mjs +36 -8
- package/lib/neovim.mjs +126 -0
- package/lib/network.mjs +50 -5
- package/lib/notify.mjs +7 -5
- package/lib/nudge.mjs +50 -19
- package/lib/ocr.mjs +9 -9
- package/lib/onboard.mjs +26 -20
- package/lib/oneLine.mjs +7 -7
- package/lib/ownMachines.mjs +1223 -140
- package/lib/pairing.mjs +60 -16
- package/lib/paths.mjs +19 -1
- package/lib/peerProcess.mjs +124 -0
- package/lib/personModel.mjs +89 -0
- package/lib/personNotices.mjs +151 -0
- package/lib/phones.mjs +538 -31
- package/lib/placeCommands.mjs +4 -4
- package/lib/places.mjs +400 -12
- package/lib/profile.mjs +67 -14
- package/lib/projectGit.mjs +158 -14
- package/lib/projectPieces.mjs +902 -0
- package/lib/projectSettings.mjs +7 -4
- package/lib/projects.mjs +384 -62
- package/lib/provenance.mjs +5 -1
- package/lib/proxyLinks.mjs +267 -0
- package/lib/reactions.mjs +7 -5
- package/lib/readiness.mjs +145 -23
- package/lib/record.mjs +128 -0
- package/lib/redact.mjs +4 -4
- package/lib/relayLimits.mjs +62 -0
- package/lib/release.mjs +170 -0
- package/lib/releaseKeys.json +6 -0
- package/lib/repoLinks.mjs +4 -4
- package/lib/roomChannels.mjs +24 -0
- package/lib/roomPage.mjs +1 -1
- package/lib/runAuthority.mjs +101 -0
- package/lib/runBrief.mjs +19 -8
- package/lib/runWorker.mjs +31 -7
- package/lib/runner.mjs +223 -29
- package/lib/runtime-install.mjs +143 -9
- package/lib/schedules.mjs +2 -2
- package/lib/screens.mjs +1 -1
- package/lib/sealed.mjs +11 -2
- package/lib/sealedThreads.mjs +671 -0
- package/lib/secretPatterns.json +1 -1
- package/lib/secrets.mjs +4 -4
- package/lib/seen.mjs +6 -6
- package/lib/serverWords.mjs +175 -0
- package/lib/service.mjs +22 -12
- package/lib/sessionControl.mjs +378 -90
- package/lib/specialties.json +74 -0
- package/lib/specialties.mjs +477 -0
- package/lib/specialtyKeys.d.ts +3 -0
- package/lib/specialtyKeys.js +57 -0
- package/lib/specialtyNotice.mjs +147 -0
- package/lib/specialtySnapshot.mjs +138 -0
- package/lib/speech.mjs +5 -5
- package/lib/store.mjs +420 -36
- package/lib/stuck.mjs +1 -1
- package/lib/swarm.mjs +304 -37
- package/lib/swarmDevices.mjs +319 -0
- package/lib/swarmMemory.mjs +27 -25
- package/lib/t3.mjs +24 -15
- package/lib/taskCommands.mjs +80 -20
- package/lib/taskRooms.mjs +125 -0
- package/lib/taskRuns.mjs +45 -3
- package/lib/team.json +255 -148
- package/lib/team.mjs +554 -190
- package/lib/threadActions.mjs +315 -0
- package/lib/threadAuthority.mjs +101 -0
- package/lib/threadBriefs.mjs +178 -0
- package/lib/threadLine.mjs +116 -0
- package/lib/threadRuns.mjs +209 -50
- package/lib/threadView.mjs +20 -7
- package/lib/usageTotals.mjs +2 -3
- package/lib/vault.mjs +101 -10
- package/lib/vaultCloud.mjs +2 -2
- package/lib/vaultCommands.mjs +15 -6
- package/lib/vaultTools.js +2 -2
- package/lib/verdicts.mjs +328 -0
- package/lib/wakes.mjs +1 -1
- package/lib/watches.mjs +2 -2
- package/lib/windowAsks.mjs +13 -5
- package/lib/worktrees.mjs +157 -25
- package/npm-shrinkwrap.json +1093 -0
- package/package.json +12 -11
- package/release.json +220 -0
- package/lib/modelTiers.json +0 -1183
- package/lib/modelTiers.mjs +0 -133
package/lib/lane.mjs
CHANGED
|
@@ -3,16 +3,47 @@ import path from "node:path";
|
|
|
3
3
|
import { readJson, writeJsonAtomic } from "./files.mjs";
|
|
4
4
|
import { paths } from "./paths.mjs";
|
|
5
5
|
|
|
6
|
-
// The person's own model lane, kept on this computer once they let Harness Relay use it
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
6
|
+
// The person's own model lane, kept on this computer once they let Harness Relay use it: the API key or model endpoint
|
|
7
|
+
// their Harness window runs on, so Harness can answer in their swarm's threads while that window is closed. Only their
|
|
8
|
+
// linked Harness window gives it (sealed, phones.mjs), only they can take it back, and it leaves this computer only
|
|
9
|
+
// with a task given to Harness, the way the window sends it with each of its own turns: Harness's server uses it for
|
|
10
|
+
// that task and keeps nothing. An endpoint only this computer reaches (localhost or the person's network) is called
|
|
11
|
+
// from here for Harness's server (`fetch`), and only that endpoint.
|
|
12
12
|
|
|
13
13
|
const PROVIDERS = new Set(["venice", "bankr", "openai", "dot"]);
|
|
14
14
|
export const laneFile = () => path.join(paths.home, "harness-lane.json");
|
|
15
15
|
|
|
16
|
+
// The model API calls Harness's server makes to the person's endpoint (an OpenAI-compatible one: the chat call, and the
|
|
17
|
+
// model list), each with its method, under the endpoint's own path. Any other path on the person's model host (an
|
|
18
|
+
// admin page, another app on the same port) is not a model call (security audit S11).
|
|
19
|
+
const MODEL_CALLS = new Map([
|
|
20
|
+
["/chat/completions", "POST"],
|
|
21
|
+
["/completions", "POST"],
|
|
22
|
+
["/responses", "POST"],
|
|
23
|
+
["/models", "GET"],
|
|
24
|
+
]);
|
|
25
|
+
/**
|
|
26
|
+
* The address asked for, if it is one of `calls` (Harness's server's: MODEL_CALLS) on the endpoint itself; null
|
|
27
|
+
* otherwise.
|
|
28
|
+
*/
|
|
29
|
+
export function modelCallUrl(baseUrl, url, method, calls = MODEL_CALLS) {
|
|
30
|
+
let base, target;
|
|
31
|
+
try {
|
|
32
|
+
base = new URL(baseUrl);
|
|
33
|
+
target = new URL(String(url));
|
|
34
|
+
} catch {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
// URL resolves dot segments; an encoded slash, dot or backslash could still mean another path to the endpoint.
|
|
38
|
+
if (/%2e|%2f|%5c/i.test(target.pathname)) return null;
|
|
39
|
+
if (target.origin !== base.origin || target.username || target.password)
|
|
40
|
+
return null;
|
|
41
|
+
const root = base.pathname.replace(/\/+$/, "");
|
|
42
|
+
if (!target.pathname.startsWith(`${root}/`)) return null;
|
|
43
|
+
const call = target.pathname.slice(root.length).replace(/\/+$/, "");
|
|
44
|
+
return calls.get(call) === method ? target.href : null;
|
|
45
|
+
}
|
|
46
|
+
|
|
16
47
|
// The shape Harness's server takes (src/schemas/credentials.ts), checked here so a malformed lane is refused when given.
|
|
17
48
|
function credentialOf(value) {
|
|
18
49
|
if (!value || typeof value !== "object") return null;
|
|
@@ -131,14 +162,14 @@ export function createHarnessLane({
|
|
|
131
162
|
credential?.type === "custom" && credential.endpoint.transport === "relay"
|
|
132
163
|
? credential.endpoint.baseUrl.replace(/\/+$/, "")
|
|
133
164
|
: null;
|
|
134
|
-
|
|
135
|
-
|
|
165
|
+
if (!["GET", "POST"].includes(method))
|
|
166
|
+
return failed(403, `${method} is not a model call`);
|
|
167
|
+
const target = base ? modelCallUrl(base, url, method) : null;
|
|
168
|
+
if (!target)
|
|
136
169
|
return failed(
|
|
137
170
|
403,
|
|
138
|
-
"that address is not
|
|
171
|
+
"that address is not a model call on the endpoint the person let Harness Relay use"
|
|
139
172
|
);
|
|
140
|
-
if (!["GET", "POST"].includes(method))
|
|
141
|
-
return failed(403, `${method} is not a model call`);
|
|
142
173
|
let response;
|
|
143
174
|
try {
|
|
144
175
|
response = await fetchImpl(target, {
|
package/lib/lessons.mjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
// What the swarm learns from the person, step 2 of its learning. Each post the person writes in a thread is read on
|
|
2
|
-
// Harness's server
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
2
|
+
// Harness's server with the agents' work since they last wrote and the few lessons kept here closest to it. A post that
|
|
3
|
+
// says something lasting comes back as lessons, each standing on the person's exact words: a new one is kept, the same
|
|
4
|
+
// one again adds the new words to it, and an update or a reversal replaces the kept one (which stays as the record of
|
|
5
|
+
// what was). Lessons are about the person (tastes, standards, ways of working), one agent (what it should or should not
|
|
6
|
+
// do), or a kind of work (how it goes well), and hold everywhere or in the thread's folder. They are kept apart from
|
|
7
|
+
// Harness's own memory. Nothing is read on the privacy setting, with this computer off Harness, or from a Harness that
|
|
8
|
+
// does not read lessons (swarm_lessons). Posts are read one at a time, so two quick ones never both add the same
|
|
9
|
+
// lesson.
|
|
10
10
|
|
|
11
11
|
import path from "node:path";
|
|
12
12
|
import { workSince } from "./reactions.mjs";
|
|
13
13
|
import { fromBlob, toBlob, topK } from "./vectors.mjs";
|
|
14
14
|
|
|
15
|
-
// The kept lessons a post is compared with, closest first. At today's scale that is every lesson: in
|
|
16
|
-
//
|
|
15
|
+
// The kept lessons a post is compared with, closest first. At today's scale that is every lesson: in a replay of
|
|
16
|
+
// real threads, six chosen by words left out the lessons a repeat repeated.
|
|
17
17
|
const KNOWN = 24;
|
|
18
18
|
const POST_CHARS = 4_000;
|
|
19
19
|
|
|
@@ -80,10 +80,10 @@ export function createLessons({
|
|
|
80
80
|
});
|
|
81
81
|
|
|
82
82
|
const read = async (thread, post) => {
|
|
83
|
-
// Learned from the person's threads, not from a single job's room, where their words settle that job (
|
|
84
|
-
//
|
|
85
|
-
//
|
|
86
|
-
//
|
|
83
|
+
// Learned from the person's threads, not from a single job's room, where their words settle that job (a room's "the
|
|
84
|
+
// bankr agent will have tools to be able to call the transaction" was once kept as a lasting lesson).
|
|
85
|
+
// No wording separated such answers from wishes when Jev read them; the two among the posts measured were both in
|
|
86
|
+
// task rooms, and none of the person's lasting wishes was.
|
|
87
87
|
if (!readsLessons() || isTaskRoom(thread)) return [];
|
|
88
88
|
const known = await closest(post.text);
|
|
89
89
|
const { before } = workSince(
|
|
@@ -149,8 +149,8 @@ export function createLessons({
|
|
|
149
149
|
};
|
|
150
150
|
if (!fresh.text || !["person", "agent", "work"].includes(fresh.about))
|
|
151
151
|
continue;
|
|
152
|
-
// A lesson about one agent stands only to another about the same agent (
|
|
153
|
-
//
|
|
152
|
+
// A lesson about one agent stands only to another about the same agent (once, "Harness should be generating the
|
|
153
|
+
// videos" read as the opposite of Claude Code's role, and replaced it); the person's and the work's stand to each
|
|
154
154
|
// other, as the writer words the same wish either way (the candy track came back once as each).
|
|
155
155
|
const target = knownIds.has(lesson.match?.id)
|
|
156
156
|
? store.getLesson(lesson.match.id)
|
package/lib/library.mjs
CHANGED
|
@@ -25,11 +25,11 @@ const MAX_BYTES = { image: 20e6, pdf: 200e6, doc: 20e6 };
|
|
|
25
25
|
const Z_GATE = 2.0;
|
|
26
26
|
// A brief nobody asked for takes a file only when it stands out much further, and close to the best one: among 268
|
|
27
27
|
// files, right answers stood 3.9 to 8.2 above the rest and the best answer to a task about something never written 3.9
|
|
28
|
-
// at most, while an unrelated README in second place trailed the right file by more than a point
|
|
28
|
+
// at most, while an unrelated README in second place trailed the right file by more than a point.
|
|
29
29
|
const BRIEF_Z = 4.0;
|
|
30
30
|
const BRIEF_NEAR_BEST = 1.0;
|
|
31
|
-
// Below this many parts the spread says little, and a fixed similarity stands in (
|
|
32
|
-
// 0.68 and up, never-said questions 0.675 at most).
|
|
31
|
+
// Below this many parts the spread says little, and a fixed similarity stands in (in media search, right answers
|
|
32
|
+
// scored 0.68 and up, never-said questions 0.675 at most).
|
|
33
33
|
const MIN_SCALE = 200;
|
|
34
34
|
const FLOOR = { image: 0.7, audio: 0.7, text: 0.7 };
|
|
35
35
|
const SMALL_GROUP = 20;
|
package/lib/lineup.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import path from "node:path";
|
|
|
4
4
|
import { detectAgents } from "./commands.mjs";
|
|
5
5
|
import { detectLocalAgents, setupHermes, setupOpenClaw } from "./wakes.mjs";
|
|
6
6
|
import { configureAgents } from "./adapters.mjs";
|
|
7
|
+
import { confirmAgentBinary } from "./agentBinaries.mjs";
|
|
7
8
|
import { MACHINE_RUNNERS, nameOf } from "./members.mjs";
|
|
8
9
|
import { paths } from "./paths.mjs";
|
|
9
10
|
import { readJson, writeJsonAtomic } from "./files.mjs";
|
|
@@ -257,6 +258,8 @@ export function joinAgent({
|
|
|
257
258
|
...config,
|
|
258
259
|
agentStates: { ...config.agentStates, [agent]: state },
|
|
259
260
|
});
|
|
261
|
+
// Adding an agent is the person's word on the program it runs as (agentBinaries.mjs).
|
|
262
|
+
confirmAgentBinary(agent, { file });
|
|
260
263
|
} else {
|
|
261
264
|
const result = localSetup[agent]({ runtimeRoot });
|
|
262
265
|
if (!result.ok) return { ok: false, error: result.detail };
|