tryharness 0.7.75 → 0.7.76
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/cli.mjs +66 -3
- package/lib/actorRoster.mjs +20 -9
- package/lib/adoption.mjs +5 -3
- package/lib/audit.mjs +7 -2
- package/lib/boardFiles.mjs +4 -2
- package/lib/boardMirror.mjs +2 -0
- package/lib/boardProtocol.json +4 -0
- package/lib/bridge.mjs +3 -0
- package/lib/capabilityCheck.mjs +39 -3
- package/lib/coordinator.mjs +464 -105
- package/lib/daemon.mjs +64 -20
- package/lib/dispatcher.mjs +568 -0
- package/lib/goalCommands.mjs +21 -6
- package/lib/handoffs.mjs +8 -7
- package/lib/handover.mjs +2 -2
- package/lib/inference.mjs +53 -3
- package/lib/jobAnswers.mjs +7 -6
- package/lib/lessons.mjs +6 -1
- package/lib/lineup.mjs +17 -9
- package/lib/localAgentAsk.mjs +68 -29
- package/lib/localmodels.mjs +59 -25
- package/lib/machineRoutes.mjs +1 -0
- package/lib/manager.mjs +97 -52
- package/lib/members.json +5 -1
- package/lib/members.mjs +21 -1
- package/lib/moves.mjs +15 -2
- package/lib/plans.mjs +2 -1
- package/lib/projects.mjs +16 -9
- package/lib/runAuthority.mjs +2 -1
- package/lib/runBrief.mjs +2 -2
- package/lib/runWorker.mjs +6 -6
- package/lib/snippets.mjs +5 -5
- package/lib/store.mjs +68 -4
- package/lib/swarm.mjs +53 -9
- package/lib/taskCommands.mjs +8 -8
- package/lib/taskRooms.mjs +6 -8
- package/lib/team.mjs +5 -3
- package/lib/threadActions.mjs +6 -30
- package/lib/threadAuthority.mjs +16 -3
- package/lib/threadRuns.mjs +26 -16
- package/lib/verdicts.mjs +2 -2
- package/npm-shrinkwrap.json +14 -14
- package/package.json +4 -4
- package/release.json +45 -44
package/lib/handoffs.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { nameOf } from "./members.mjs";
|
|
1
|
+
import { JEV, nameOf } from "./members.mjs";
|
|
2
2
|
|
|
3
3
|
// Work handed to an agent that has to be woken (Grok Bot by email, OpenClaw and Hermes on their gateways) is watched
|
|
4
4
|
// until the agent picks it up. A wake can be accepted and still never start a run (two of Grok Bot's emails once went
|
|
5
5
|
// unanswered for 2 h and 20 min), so a missed pickup is never silent: the agent is woken again at 3 minutes, and at 10
|
|
6
|
-
// the
|
|
7
|
-
//
|
|
6
|
+
// the dispatcher takes the work back and Jev picks another agent for it (owner, November 1: Harness is not
|
|
7
|
+
// load-bearing; it took every missed pickup before). The thread says so each time.
|
|
8
8
|
//
|
|
9
9
|
// The 3 and 10 minutes: Grok Bot's 36 email wakes over five days were claimed 13 to 59 s after sending, so 3
|
|
10
10
|
// minutes is three times its slowest normal pickup.
|
|
@@ -25,7 +25,8 @@ const minutes = (ms) => Math.max(1, Math.round(ms / 60_000));
|
|
|
25
25
|
export function createHandoffs({
|
|
26
26
|
store,
|
|
27
27
|
wakeAgain,
|
|
28
|
-
|
|
28
|
+
// Takes the work back from the agent that never picked it up, for Jev to place again; false when it cannot.
|
|
29
|
+
giveBack,
|
|
29
30
|
say,
|
|
30
31
|
timing = HANDOFF_TIMING,
|
|
31
32
|
now = Date.now,
|
|
@@ -59,18 +60,18 @@ export function createHandoffs({
|
|
|
59
60
|
|
|
60
61
|
function move(task) {
|
|
61
62
|
const waited = waitedMs(task);
|
|
62
|
-
if (!
|
|
63
|
+
if (!giveBack(task)) return;
|
|
63
64
|
store.meta(
|
|
64
65
|
movedKey(task.id),
|
|
65
66
|
JSON.stringify({
|
|
66
67
|
from: task.target_agent,
|
|
67
|
-
to:
|
|
68
|
+
to: JEV,
|
|
68
69
|
at: new Date(now()).toISOString(),
|
|
69
70
|
})
|
|
70
71
|
);
|
|
71
72
|
say(
|
|
72
73
|
task.parent_id,
|
|
73
|
-
`${nameOf(task.target_agent)} didn't pick this up in ${minutes(waited)} min, so
|
|
74
|
+
`${nameOf(task.target_agent)} didn't pick this up in ${minutes(waited)} min, so Jev picks another agent for it.`
|
|
74
75
|
);
|
|
75
76
|
}
|
|
76
77
|
|
package/lib/handover.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readTrail } from "./trails.mjs";
|
|
2
2
|
import { sessionFile } from "./live.mjs";
|
|
3
3
|
import { catalogOf } from "./models.mjs";
|
|
4
|
-
import { nameOf } from "./members.mjs";
|
|
4
|
+
import { DISPATCHER, nameOf } from "./members.mjs";
|
|
5
5
|
import { oneLine } from "./oneLine.mjs";
|
|
6
6
|
|
|
7
7
|
// A thread's agent resumes its own session each turn. A session close to its model's window would compact within the
|
|
@@ -118,7 +118,7 @@ export function createHandover({ store, log, sync }) {
|
|
|
118
118
|
store.meta(`handover:${taskId}`, JSON.stringify(handed.record));
|
|
119
119
|
store.roomPost({
|
|
120
120
|
goalId: threadId,
|
|
121
|
-
author:
|
|
121
|
+
author: DISPATCHER,
|
|
122
122
|
kind: "note",
|
|
123
123
|
text: `${nameOf(agent)} starts a fresh session here: its last one (${handed.record.from}) was too full to continue, as ${handed.why}. The new session's brief replays its last exchanges from the record and names the old transcript.`,
|
|
124
124
|
});
|
package/lib/inference.mjs
CHANGED
|
@@ -147,10 +147,12 @@ export function createInference({
|
|
|
147
147
|
root,
|
|
148
148
|
log = () => {},
|
|
149
149
|
power = createPower(),
|
|
150
|
-
list = MODELS,
|
|
150
|
+
list: given = MODELS,
|
|
151
151
|
ceilingMb = memoryCeilingMb(),
|
|
152
152
|
}) {
|
|
153
153
|
ensureDir(root);
|
|
154
|
+
// A copy: a model the person brings (the dispatcher's own GGUF, useModel) joins this host's list, not the catalog.
|
|
155
|
+
const list = [...given];
|
|
154
156
|
const deviceFile = path.join(root, "device.json");
|
|
155
157
|
// The model server answers only this daemon: a key of its own, read from an owner-only file (not the command line,
|
|
156
158
|
// which any program here can list), and no slots endpoint, which shows what was last sent to a model. The models'
|
|
@@ -192,13 +194,19 @@ export function createInference({
|
|
|
192
194
|
const weights = entry.llama?.weights
|
|
193
195
|
? modelById(entry.llama.weights, list)
|
|
194
196
|
: null;
|
|
197
|
+
// A model that carries its own projector names the file it is in (the dispatcher's LFM3-Omni).
|
|
198
|
+
const ownProjector = Number.isInteger(entry.llama?.mmproj)
|
|
199
|
+
? modelFile(root, entry, entry.llama.mmproj)
|
|
200
|
+
: null;
|
|
201
|
+
const projector = weights ? modelFile(root, entry) : ownProjector;
|
|
195
202
|
lines.push(
|
|
196
203
|
`[${entry.id}]`,
|
|
197
204
|
`model = ${modelFile(root, weights ?? entry)}`,
|
|
198
|
-
...(
|
|
205
|
+
...(projector ? [`mmproj = ${projector}`] : [])
|
|
199
206
|
);
|
|
200
207
|
for (const [key, value] of Object.entries(entry.llama ?? {}))
|
|
201
|
-
if (key !== "weights"
|
|
208
|
+
if (key !== "weights" && key !== "mmproj")
|
|
209
|
+
lines.push(`${key} = ${value}`);
|
|
202
210
|
}
|
|
203
211
|
const file = path.join(root, "router.ini");
|
|
204
212
|
fs.writeFileSync(file, lines.join("\n") + "\n");
|
|
@@ -244,6 +252,13 @@ export function createInference({
|
|
|
244
252
|
base,
|
|
245
253
|
gpu,
|
|
246
254
|
media: modelsPresent(root, ["search", "media"], list),
|
|
255
|
+
// The GGUF models this server's preset holds: one downloaded after it started needs a restart to load.
|
|
256
|
+
serves: new Set(
|
|
257
|
+
list
|
|
258
|
+
.filter((model) => model.runtime === "llama")
|
|
259
|
+
.filter((model) => modelsPresent(root, [model.id], list))
|
|
260
|
+
.map((model) => model.id)
|
|
261
|
+
),
|
|
247
262
|
marker: null,
|
|
248
263
|
};
|
|
249
264
|
} catch {}
|
|
@@ -584,6 +599,41 @@ export function createInference({
|
|
|
584
599
|
return out;
|
|
585
600
|
})
|
|
586
601
|
),
|
|
602
|
+
/**
|
|
603
|
+
* One chat completion on a local GGUF model (the dispatcher's): an OpenAI-style request, its `model` set here. A
|
|
604
|
+
* server started before the model came down is restarted once with it.
|
|
605
|
+
*/
|
|
606
|
+
/**
|
|
607
|
+
* A model of the person's own (the dispatcher's fine-tune) in this host's list, replacing one with its id: the
|
|
608
|
+
* server reloads with it the next time it is asked, so a changed file is read again.
|
|
609
|
+
*/
|
|
610
|
+
useModel: async (entry) => {
|
|
611
|
+
const at = list.findIndex((each) => each.id === entry.id);
|
|
612
|
+
const same =
|
|
613
|
+
at >= 0 && JSON.stringify(list[at]) === JSON.stringify(entry);
|
|
614
|
+
if (same) return;
|
|
615
|
+
if (at >= 0) list[at] = entry;
|
|
616
|
+
else list.push(entry);
|
|
617
|
+
if (server) await stopServer();
|
|
618
|
+
},
|
|
619
|
+
chat: (id, request, { lane = "handoff" } = {}) =>
|
|
620
|
+
schedule("llama", lane, () =>
|
|
621
|
+
inUse("llama", async () => {
|
|
622
|
+
if (!modelsPresent(root, [id], list))
|
|
623
|
+
throw new Error(
|
|
624
|
+
`${modelById(id, list)?.name ?? id} is not downloaded yet`
|
|
625
|
+
);
|
|
626
|
+
let ready = await llamaFor(id);
|
|
627
|
+
if (!ready.serves?.has(id)) {
|
|
628
|
+
await stopServer();
|
|
629
|
+
ready = await llamaFor(id);
|
|
630
|
+
}
|
|
631
|
+
return post(ready.base, "/v1/chat/completions", {
|
|
632
|
+
...request,
|
|
633
|
+
model: id,
|
|
634
|
+
});
|
|
635
|
+
})
|
|
636
|
+
),
|
|
587
637
|
/**
|
|
588
638
|
* Embeds recordings and images with the search model's projector, in the same space as typed questions. items:
|
|
589
639
|
* { title, data (a Buffer of WAV, MP3, FLAC, PNG or JPEG) }. A server started before the projector came down is
|
package/lib/jobAnswers.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { askerOf } from "./answers.mjs";
|
|
2
|
-
import { TAGGED_ONLY, member, nameOf } from "./members.mjs";
|
|
2
|
+
import { DISPATCHER, TAGGED_ONLY, member, nameOf } from "./members.mjs";
|
|
3
3
|
import { notifyDesktop } from "./notify.mjs";
|
|
4
4
|
import { restrictedRun } from "./runWorker.mjs";
|
|
5
5
|
import { secretReason } from "./secrets.mjs";
|
|
@@ -83,7 +83,7 @@ export function createJobAnswers({
|
|
|
83
83
|
if (!ENDED.includes(task.status)) return;
|
|
84
84
|
const who = task.claimed_by || task.target_agent || "an agent";
|
|
85
85
|
// An answer that came through Harness's server (Bankr's, Quotient's, Harness's server answering for a closed
|
|
86
|
-
// window) wakes
|
|
86
|
+
// window) wakes whoever it names with the person's go (personsGo) only on words the guard reads as clean.
|
|
87
87
|
const hosted =
|
|
88
88
|
member(who)?.runs === "server" &&
|
|
89
89
|
(who !== "harness" || Boolean(store.meta(`harness-served:${task.id}`)));
|
|
@@ -116,7 +116,7 @@ export function createJobAnswers({
|
|
|
116
116
|
const hearsHere =
|
|
117
117
|
!root ||
|
|
118
118
|
runsHere(asker) ||
|
|
119
|
-
(asker === "harness" && !conversationOf(task));
|
|
119
|
+
((asker === "harness" || asker === DISPATCHER) && !conversationOf(task));
|
|
120
120
|
const mentions = [
|
|
121
121
|
...new Set([
|
|
122
122
|
...(hearsHere ? [asker] : []),
|
|
@@ -163,11 +163,12 @@ export function createJobAnswers({
|
|
|
163
163
|
});
|
|
164
164
|
} else if (
|
|
165
165
|
goal.status === "open" &&
|
|
166
|
-
(fromElsewhere(who) ||
|
|
166
|
+
(fromElsewhere(who) || hosted) &&
|
|
167
167
|
!flag
|
|
168
168
|
)
|
|
169
|
-
// An answer from the person's agents elsewhere
|
|
170
|
-
//
|
|
169
|
+
// An answer from the person's agents elsewhere or on Harness's server, any of them, wakes whoever it names on the
|
|
170
|
+
// guard's reading of it, as their posts do (owner, November 1: no Start for work the person started, but Bankr's
|
|
171
|
+
// spending, which Bankr holds under its own approval and limits).
|
|
171
172
|
void readByGuard(text).then((guard) => {
|
|
172
173
|
if (guard?.verdict === "flag" || guard?.verdict === "hold")
|
|
173
174
|
store.meta(`flagged:${post.id}`, String(guard.score));
|
package/lib/lessons.mjs
CHANGED
|
@@ -24,6 +24,9 @@ export function createLessons({
|
|
|
24
24
|
isCoordinatorPost,
|
|
25
25
|
// A task's own room (one job given to an agent): what the person writes there settles that job.
|
|
26
26
|
isTaskRoom = () => false,
|
|
27
|
+
// Every agent in the person's swarm: a lesson can be about any of them, in the thread or not yet (owner, November 1:
|
|
28
|
+
// Harness is no longer put in every thread's team, and "Harness makes the videos" is still about Harness).
|
|
29
|
+
swarmAgents = () => [],
|
|
27
30
|
// Vectors for texts (`kind` query or document), or null while the local search model is not here.
|
|
28
31
|
embed = async () => null,
|
|
29
32
|
log,
|
|
@@ -100,7 +103,9 @@ export function createLessons({
|
|
|
100
103
|
id: thread.id,
|
|
101
104
|
title: thread.objective.slice(0, 500),
|
|
102
105
|
folder: thread.goal?.workspace ?? null,
|
|
103
|
-
agents:
|
|
106
|
+
agents: [
|
|
107
|
+
...new Set([...(thread.goal?.team ?? []), ...swarmAgents()]),
|
|
108
|
+
].slice(0, 16),
|
|
104
109
|
},
|
|
105
110
|
post: { seq: post.seq, text: post.text.slice(0, POST_CHARS) },
|
|
106
111
|
before,
|
package/lib/lineup.mjs
CHANGED
|
@@ -14,12 +14,13 @@ import { createAgentReadiness, SIGN_IN } from "./readiness.mjs";
|
|
|
14
14
|
// computer, already ticked, and the person keeps the ones they want; every other agent joins only when they add it
|
|
15
15
|
// (`npx tryharness agents add`, or Add an agent in the buddy's settings). The list lives in the config as
|
|
16
16
|
// `swarmAgents`. A config from before the lineup has none, and its swarm stays as it was: every agent the roster finds.
|
|
17
|
-
// Harness
|
|
17
|
+
// Harness is one agent like the others (owner, November 1: "@harness is just another agent"): in the swarm until the
|
|
18
|
+
// person takes it out. A lineup written while Harness was always in left it off the list; it reads with Harness in.
|
|
18
19
|
|
|
19
20
|
/** Agents that run on this computer: the coding agents Harness starts, and the assistants it wakes by webhook. */
|
|
20
21
|
const HERE = [...MACHINE_RUNNERS, "openclaw", "hermes"];
|
|
21
22
|
/** Agents that live elsewhere and are added on purpose; Grok Bot and Muse also need their own setup in Harness. */
|
|
22
|
-
const ELSEWHERE = ["grok-bot", "bankr", "quotient", "muse"];
|
|
23
|
+
const ELSEWHERE = ["harness", "grok-bot", "bankr", "quotient", "muse"];
|
|
23
24
|
const NEEDS_SETUP_ELSEWHERE = new Set(["grok-bot", "muse"]);
|
|
24
25
|
|
|
25
26
|
const PROVIDER_KEYS = [
|
|
@@ -119,9 +120,17 @@ const signInHint = (id, check) =>
|
|
|
119
120
|
? `sign in to ${nameOf(id)} first: run ${SIGN_IN[id]}`
|
|
120
121
|
: `sign in to ${nameOf(id)} first`;
|
|
121
122
|
|
|
123
|
+
// Lineups this version writes say whether Harness is in; older ones never listed it, as it was always in.
|
|
124
|
+
const LINEUP_VERSION = 2;
|
|
125
|
+
|
|
122
126
|
/** The lineup in a config, or null for a config from before it (every agent the roster finds is in). */
|
|
123
|
-
export
|
|
124
|
-
Array.isArray(config?.swarmAgents)
|
|
127
|
+
export function lineupOf(config) {
|
|
128
|
+
if (!Array.isArray(config?.swarmAgents)) return null;
|
|
129
|
+
const listsHarness = config.swarmLineup >= LINEUP_VERSION;
|
|
130
|
+
return listsHarness || config.swarmAgents.includes("harness")
|
|
131
|
+
? config.swarmAgents
|
|
132
|
+
: [...config.swarmAgents, "harness"];
|
|
133
|
+
}
|
|
125
134
|
|
|
126
135
|
/** One module the daemon, setup and the CLI share: the lineup in the config file, read again only when it changes. */
|
|
127
136
|
export function createLineup({ file = paths.config } = {}) {
|
|
@@ -145,21 +154,22 @@ export function createLineup({ file = paths.config } = {}) {
|
|
|
145
154
|
...config,
|
|
146
155
|
swarmAgents: [...new Set(list)],
|
|
147
156
|
swarmRemoved: [...new Set(kept)],
|
|
157
|
+
swarmLineup: LINEUP_VERSION,
|
|
148
158
|
});
|
|
149
159
|
cached = { mtimeMs: -1, list: null };
|
|
150
160
|
};
|
|
151
161
|
return {
|
|
152
|
-
/** Whether an agent is in the swarm;
|
|
162
|
+
/** Whether an agent is in the swarm; everyone is when there is no lineup yet. */
|
|
153
163
|
has: (agent) => {
|
|
154
164
|
const list = read();
|
|
155
|
-
return
|
|
165
|
+
return list === null || list.includes(agent);
|
|
156
166
|
},
|
|
157
167
|
list: () => read(),
|
|
158
168
|
/** Whether the person took this agent out of their swarm themselves. */
|
|
159
169
|
removedByPerson: (agent) =>
|
|
160
170
|
(readJson(file, {}).swarmRemoved ?? []).includes(agent),
|
|
161
171
|
/** Start the lineup (setup) with exactly these agents. */
|
|
162
|
-
set: (agents) => write(agents
|
|
172
|
+
set: (agents) => write(agents),
|
|
163
173
|
add: (agent) => {
|
|
164
174
|
const list = read();
|
|
165
175
|
// A swarm from before the lineup keeps everything it had; adding to it changes nothing.
|
|
@@ -317,8 +327,6 @@ export function createLineupCommands({
|
|
|
317
327
|
if (joined.ok) onChanged(agent);
|
|
318
328
|
return joined;
|
|
319
329
|
}
|
|
320
|
-
if (agent === "harness")
|
|
321
|
-
return { ok: false, error: "Harness is always in your swarm." };
|
|
322
330
|
lineup.remove(agent);
|
|
323
331
|
onChanged(agent);
|
|
324
332
|
return { ok: true, agent, name: nameOf(agent) };
|
package/lib/localAgentAsk.mjs
CHANGED
|
@@ -5,6 +5,9 @@ import { spawn } from "node:child_process";
|
|
|
5
5
|
// in its read-only sandbox. The coordinator asks them to decide a round on the privacy setting or as Harness's backup
|
|
6
6
|
// (coordinator.mjs), and to read a round Harness's server decided before its words reach an agent (serverWords.mjs).
|
|
7
7
|
export const LOCAL_DECIDERS = ["claude-code", "codex"];
|
|
8
|
+
// The agents that can fill the dispatcher slot (dispatcher.mjs): every coding agent with a one-shot mode and its tools
|
|
9
|
+
// off, each on any model it offers (owner, November 1: "swapped to another agent running on the users machine").
|
|
10
|
+
export const DISPATCH_AGENTS = ["claude-code", "codex", "pi", "opencode"];
|
|
8
11
|
|
|
9
12
|
/**
|
|
10
13
|
* One question to `agent`, answered with one JSON object. It runs in the system's temporary folder, away from any
|
|
@@ -12,7 +15,11 @@ export const LOCAL_DECIDERS = ["claude-code", "codex"];
|
|
|
12
15
|
* this computer to answer but never
|
|
13
16
|
* change it: Codex in its read-only sandbox, Claude Code with only its read, glob and grep tools.
|
|
14
17
|
*/
|
|
15
|
-
export function askLocalAgent(
|
|
18
|
+
export function askLocalAgent(
|
|
19
|
+
agent,
|
|
20
|
+
prompt,
|
|
21
|
+
{ look = false, model = null } = {}
|
|
22
|
+
) {
|
|
16
23
|
return new Promise((resolve, reject) => {
|
|
17
24
|
const invocation =
|
|
18
25
|
agent === "codex"
|
|
@@ -24,36 +31,67 @@ export function askLocalAgent(agent, prompt, { look = false } = {}) {
|
|
|
24
31
|
"--sandbox",
|
|
25
32
|
"read-only",
|
|
26
33
|
"--skip-git-repo-check",
|
|
34
|
+
...(model ? ["-m", model] : []),
|
|
27
35
|
"-",
|
|
28
36
|
],
|
|
29
37
|
stdin: prompt,
|
|
30
38
|
}
|
|
31
|
-
:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
39
|
+
: agent === "pi"
|
|
40
|
+
? {
|
|
41
|
+
command: "pi",
|
|
42
|
+
args: [
|
|
43
|
+
"-p",
|
|
44
|
+
prompt,
|
|
45
|
+
"--no-session",
|
|
46
|
+
"--no-tools",
|
|
47
|
+
"--no-mcp",
|
|
48
|
+
"--no-extensions",
|
|
49
|
+
"--no-skills",
|
|
50
|
+
"--no-context-files",
|
|
51
|
+
...(model ? ["--model", model] : []),
|
|
52
|
+
],
|
|
53
|
+
}
|
|
54
|
+
: agent === "opencode"
|
|
55
|
+
? {
|
|
56
|
+
command: "opencode",
|
|
57
|
+
// The plan agent edits nothing; --pure leaves the person's plugins out of a one-shot answer.
|
|
58
|
+
args: [
|
|
59
|
+
"run",
|
|
60
|
+
prompt,
|
|
61
|
+
"--pure",
|
|
62
|
+
"--agent",
|
|
63
|
+
"plan",
|
|
64
|
+
...(model ? ["-m", model] : []),
|
|
65
|
+
],
|
|
66
|
+
}
|
|
67
|
+
: {
|
|
68
|
+
command: "claude",
|
|
69
|
+
// Only the model reads: the person's MCP servers, hooks and settings made each reading take ~15 s instead
|
|
70
|
+
// of ~2 s, and a question with no tools uses none of them.
|
|
71
|
+
args: [
|
|
72
|
+
"-p",
|
|
73
|
+
prompt,
|
|
74
|
+
"--output-format",
|
|
75
|
+
"json",
|
|
76
|
+
...(look
|
|
77
|
+
? [
|
|
78
|
+
"--tools",
|
|
79
|
+
"Read,Glob,Grep",
|
|
80
|
+
"--allowedTools",
|
|
81
|
+
"Read Glob Grep",
|
|
82
|
+
// The whole computer, read only: what a check needs may sit outside the home folder (/opt/homebrew).
|
|
83
|
+
"--add-dir",
|
|
84
|
+
"/",
|
|
85
|
+
"--permission-mode",
|
|
86
|
+
"dontAsk",
|
|
87
|
+
]
|
|
88
|
+
: ["--tools", ""]),
|
|
89
|
+
"--strict-mcp-config",
|
|
90
|
+
"--setting-sources",
|
|
91
|
+
"",
|
|
92
|
+
...(model ? ["--model", model] : []),
|
|
93
|
+
],
|
|
94
|
+
};
|
|
57
95
|
let child;
|
|
58
96
|
try {
|
|
59
97
|
child = spawn(invocation.command, invocation.args, { cwd: os.tmpdir() });
|
|
@@ -76,8 +114,9 @@ export function askLocalAgent(agent, prompt, { look = false } = {}) {
|
|
|
76
114
|
reject(new Error(`${agent} exited with code ${code}`));
|
|
77
115
|
return;
|
|
78
116
|
}
|
|
79
|
-
// Claude answers one JSON object with its text in `result`; Codex streams events, its words in agent_message
|
|
80
|
-
|
|
117
|
+
// Claude answers one JSON object with its text in `result`; Codex streams events, its words in agent_message;
|
|
118
|
+
// Pi and OpenCode print their answer as text.
|
|
119
|
+
let text = agent === "pi" || agent === "opencode" ? out : "";
|
|
81
120
|
for (const line of out.split("\n")) {
|
|
82
121
|
try {
|
|
83
122
|
const event = JSON.parse(line);
|
package/lib/localmodels.mjs
CHANGED
|
@@ -14,61 +14,64 @@ export const LICENCES = new Set([
|
|
|
14
14
|
"mit",
|
|
15
15
|
"bsd-3-clause",
|
|
16
16
|
"cc-by-4.0",
|
|
17
|
+
// Liquid AI's LFM Open License v1.0, for the manager's LFM3 model (owner, November 1: "license be damned include it
|
|
18
|
+
// on the whitelist").
|
|
19
|
+
"lfm1.0",
|
|
17
20
|
]);
|
|
18
21
|
|
|
19
22
|
// llama.cpp's own release build: the server that hosts every GGUF model (search, decision models) on the GPU when
|
|
20
23
|
// there is one. Release archives as published, pinned by the digest GitHub reports for each asset.
|
|
21
24
|
export const LLAMA = {
|
|
22
|
-
build: "
|
|
25
|
+
build: "b12032",
|
|
23
26
|
licence: "mit",
|
|
24
27
|
assets: {
|
|
25
28
|
"darwin-arm64": {
|
|
26
|
-
name: "llama-
|
|
29
|
+
name: "llama-b12032-bin-macos-arm64.tar.gz",
|
|
27
30
|
sha256:
|
|
28
|
-
"
|
|
29
|
-
size:
|
|
31
|
+
"00468fe833eb000b78a748122f5921b6c7b07dc82331a8d0c68196c69cb26382",
|
|
32
|
+
size: 16513842,
|
|
30
33
|
},
|
|
31
34
|
"darwin-x64": {
|
|
32
|
-
name: "llama-
|
|
35
|
+
name: "llama-b12032-bin-macos-x64.tar.gz",
|
|
33
36
|
sha256:
|
|
34
|
-
"
|
|
35
|
-
size:
|
|
37
|
+
"291d99f3b6f45f67f73afe5381540f29928840a1a14d9c19d6595bd649a035fc",
|
|
38
|
+
size: 12258802,
|
|
36
39
|
},
|
|
37
40
|
"linux-x64-vulkan": {
|
|
38
|
-
name: "llama-
|
|
41
|
+
name: "llama-b12032-bin-ubuntu-vulkan-x64.tar.gz",
|
|
39
42
|
sha256:
|
|
40
|
-
"
|
|
41
|
-
size:
|
|
43
|
+
"f75e7107f9450034c5467492c41e9ed91816e2d815fc4b802c6bd58de7d5b126",
|
|
44
|
+
size: 35669614,
|
|
42
45
|
},
|
|
43
46
|
"linux-x64": {
|
|
44
|
-
name: "llama-
|
|
47
|
+
name: "llama-b12032-bin-ubuntu-x64.tar.gz",
|
|
45
48
|
sha256:
|
|
46
|
-
"
|
|
47
|
-
size:
|
|
49
|
+
"9f10432ca3f66ef003a7a540aaffb9da0acadaefd05404521b9ab7a2436af304",
|
|
50
|
+
size: 22886629,
|
|
48
51
|
},
|
|
49
52
|
"linux-arm64-vulkan": {
|
|
50
|
-
name: "llama-
|
|
53
|
+
name: "llama-b12032-bin-ubuntu-vulkan-arm64.tar.gz",
|
|
51
54
|
sha256:
|
|
52
|
-
"
|
|
53
|
-
size:
|
|
55
|
+
"cd5dd8071fa7998b6fa7c3b05d8cfd3c5fe9ca293c987845dc63c558a3972fb6",
|
|
56
|
+
size: 29008240,
|
|
54
57
|
},
|
|
55
58
|
"linux-arm64": {
|
|
56
|
-
name: "llama-
|
|
59
|
+
name: "llama-b12032-bin-ubuntu-arm64.tar.gz",
|
|
57
60
|
sha256:
|
|
58
|
-
"
|
|
59
|
-
size:
|
|
61
|
+
"4246edb69267ac637899594dd158878b7db8b8ff7961203fc2e18ebee27b9f94",
|
|
62
|
+
size: 18593046,
|
|
60
63
|
},
|
|
61
64
|
"win32-x64-vulkan": {
|
|
62
|
-
name: "llama-
|
|
65
|
+
name: "llama-b12032-bin-win-vulkan-x64.zip",
|
|
63
66
|
sha256:
|
|
64
|
-
"
|
|
65
|
-
size:
|
|
67
|
+
"19a8bbf269fa683ae7bc04f886c9c2a93e0655c2606f37d2b60069bf9e8bcc32",
|
|
68
|
+
size: 37523450,
|
|
66
69
|
},
|
|
67
70
|
"win32-x64": {
|
|
68
|
-
name: "llama-
|
|
71
|
+
name: "llama-b12032-bin-win-cpu-x64.zip",
|
|
69
72
|
sha256:
|
|
70
|
-
"
|
|
71
|
-
size:
|
|
73
|
+
"5296f5d18bb7d422c7c26f4bb9bc796d9d4f41e1312a8c296cff475bdc60d0d4",
|
|
74
|
+
size: 24582754,
|
|
72
75
|
},
|
|
73
76
|
},
|
|
74
77
|
};
|
|
@@ -338,6 +341,37 @@ export const MODELS = [
|
|
|
338
341
|
},
|
|
339
342
|
],
|
|
340
343
|
},
|
|
344
|
+
// The dispatcher slot's default model (owner, November 1: "LFM 3-omni not the 1.7b version", "the slot should use the
|
|
345
|
+
// base model for now and ill work on a fine tune"). Words what needs words and checks results against the person's
|
|
346
|
+
// words; it never decides who takes the work (Jev does). Measured at 759 MB phys_footprint with a 16K window on this
|
|
347
|
+
// M-series Mac after a goal-writing job; needs llama.cpp b12032 or later (b11609 does not know the lfm3 architecture).
|
|
348
|
+
{
|
|
349
|
+
id: "dispatcher",
|
|
350
|
+
name: "LFM3-Omni 2B (base)",
|
|
351
|
+
purpose:
|
|
352
|
+
"Dispatches the swarm's work: words what needs words and checks results against the person's words",
|
|
353
|
+
tier: "extended",
|
|
354
|
+
memoryMb: 760,
|
|
355
|
+
runtime: "llama",
|
|
356
|
+
licence: "lfm1.0",
|
|
357
|
+
repo: "LiquidAI/LFM3-Omni-2B-GGUF",
|
|
358
|
+
revision: "3d29af2ad166f8299c2d820937e47dc0add20ffc",
|
|
359
|
+
files: [
|
|
360
|
+
{
|
|
361
|
+
path: "LFM3-Omni-2B-Q4_K_M.gguf",
|
|
362
|
+
sha256:
|
|
363
|
+
"9f8d30e9d4fd7a9349d586e077988229b3ca0a0e4ad730897563d1eccc9893e2",
|
|
364
|
+
size: 1099630080,
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
path: "mmproj-LFM3-Omni-2B-Q4_K_M.gguf",
|
|
368
|
+
sha256:
|
|
369
|
+
"0a746c0794782a16d4456b230c2a0b5888a2d94a6677211edbed7d7a4177a39a",
|
|
370
|
+
size: 291586720,
|
|
371
|
+
},
|
|
372
|
+
],
|
|
373
|
+
llama: { mmproj: 1, c: 16384 },
|
|
374
|
+
},
|
|
341
375
|
];
|
|
342
376
|
|
|
343
377
|
export const modelById = (id, list = MODELS) =>
|
package/lib/machineRoutes.mjs
CHANGED