@the-vibe-company/armada 0.2.36 → 0.2.37
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/dist/armada.js +321 -126
- package/package.json +1 -1
package/dist/armada.js
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
// src/main.ts
|
|
4
4
|
import { spawn as spawn2, spawnSync } from "node:child_process";
|
|
5
5
|
import { createReadStream } from "node:fs";
|
|
6
|
-
import { open as open2, readFile as readFile4 } from "node:fs/promises";
|
|
6
|
+
import { open as open2, readFile as readFile4, writeFile as writeFile3 } from "node:fs/promises";
|
|
7
7
|
import { hostname as hostname2 } from "node:os";
|
|
8
8
|
import { isatty } from "node:tty";
|
|
9
9
|
|
|
10
10
|
// src/cli.ts
|
|
11
|
-
import { dirname as dirname8, join as
|
|
11
|
+
import { dirname as dirname8, join as join8, resolve as resolve3 } from "node:path";
|
|
12
12
|
|
|
13
13
|
// ../core/src/types.ts
|
|
14
14
|
var LABEL_PHASES = [
|
|
@@ -998,56 +998,6 @@ function waitingPullRequests(m, prs) {
|
|
|
998
998
|
return prs.filter((p) => p.state === "open").map((pr) => ({ pr, ticket: ticketOf.get(pr.url) ?? null })).sort((a, b) => a.pr.number - b.pr.number);
|
|
999
999
|
}
|
|
1000
1000
|
|
|
1001
|
-
// ../core/src/herdr-profile.ts
|
|
1002
|
-
function herdrChoice(choice) {
|
|
1003
|
-
return {
|
|
1004
|
-
...choice,
|
|
1005
|
-
profile: {
|
|
1006
|
-
runtime: "herdr",
|
|
1007
|
-
agent: choice.profile.harness,
|
|
1008
|
-
model: choice.profile.model,
|
|
1009
|
-
effort: choice.profile.effort,
|
|
1010
|
-
fastMode: false
|
|
1011
|
-
}
|
|
1012
|
-
};
|
|
1013
|
-
}
|
|
1014
|
-
var herdrClaimHandle = (handle) => JSON.stringify({ workspace: handle.workspace, pane: handle.pane, agent: handle.agent });
|
|
1015
|
-
|
|
1016
|
-
// ../core/src/npm.ts
|
|
1017
|
-
var ARMADA_PACKAGE = CLI_PACKAGE;
|
|
1018
|
-
var NPM_REGISTRY_URL = `https://registry.npmjs.org/${ARMADA_PACKAGE.replace("/", "%2f")}`;
|
|
1019
|
-
var NPM_CHECK_MS = 3000;
|
|
1020
|
-
async function checkPublished(version, fetch2, timeoutMs = NPM_CHECK_MS) {
|
|
1021
|
-
try {
|
|
1022
|
-
const signal = AbortSignal.timeout(timeoutMs);
|
|
1023
|
-
const res = await fetch2(NPM_REGISTRY_URL, {
|
|
1024
|
-
headers: { accept: "application/vnd.npm.install-v1+json" },
|
|
1025
|
-
cache: "no-store",
|
|
1026
|
-
signal
|
|
1027
|
-
});
|
|
1028
|
-
if (!res.ok)
|
|
1029
|
-
return { state: "unknown", reason: `npm answered HTTP ${res.status}` };
|
|
1030
|
-
const body = await res.json();
|
|
1031
|
-
const versions = body?.versions;
|
|
1032
|
-
if (!versions || typeof versions !== "object" || Array.isArray(versions) || !Object.keys(versions).length)
|
|
1033
|
-
return { state: "unknown", reason: "npm listed no version" };
|
|
1034
|
-
const candidates = Object.keys(versions).filter((candidate) => /^\d+\.\d+\.\d+$/.test(candidate) && compareVersions(candidate, version) <= 0).sort((first, second) => compareVersions(second, first));
|
|
1035
|
-
for (const candidate of candidates) {
|
|
1036
|
-
const tarball = versions[candidate]?.dist?.tarball;
|
|
1037
|
-
if (typeof tarball !== "string" || !tarball)
|
|
1038
|
-
continue;
|
|
1039
|
-
const download = await fetch2(tarball, { method: "HEAD", cache: "no-store", signal });
|
|
1040
|
-
if (download.status === 200)
|
|
1041
|
-
return candidate === version ? { state: "published" } : { state: "missing", newest: candidate };
|
|
1042
|
-
if (download.status !== 404)
|
|
1043
|
-
return { state: "unknown", reason: `npm tarball answered HTTP ${download.status}` };
|
|
1044
|
-
}
|
|
1045
|
-
return { state: "missing", newest: null };
|
|
1046
|
-
} catch (err) {
|
|
1047
|
-
return { state: "unknown", reason: networkReason(err, timeoutMs) };
|
|
1048
|
-
}
|
|
1049
|
-
}
|
|
1050
|
-
|
|
1051
1001
|
// ../../node_modules/.bun/smol-toml@1.9.0/node_modules/smol-toml/dist/error.js
|
|
1052
1002
|
/*!
|
|
1053
1003
|
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
@@ -2016,12 +1966,124 @@ var HAS_WELLFORMED = !!"".isWellFormed;
|
|
|
2016
1966
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
2017
1967
|
*/
|
|
2018
1968
|
|
|
1969
|
+
// ../core/src/herdr-profile.ts
|
|
1970
|
+
var herdrHarnessKind = (harness) => harness === "deepseek" ? "opencode" : harness;
|
|
1971
|
+
var herdrHarnessLabel = (harness) => harness === "deepseek" ? "deepseek (OpenCode + DeepSeek model)" : harness;
|
|
1972
|
+
function herdrChoice(choice) {
|
|
1973
|
+
return {
|
|
1974
|
+
...choice,
|
|
1975
|
+
profile: {
|
|
1976
|
+
runtime: "herdr",
|
|
1977
|
+
agent: herdrHarnessLabel(choice.profile.harness),
|
|
1978
|
+
model: choice.profile.model,
|
|
1979
|
+
effort: choice.profile.effort,
|
|
1980
|
+
fastMode: false
|
|
1981
|
+
}
|
|
1982
|
+
};
|
|
1983
|
+
}
|
|
1984
|
+
var herdrClaimHandle = (handle) => JSON.stringify({ workspace: handle.workspace, pane: handle.pane, agent: handle.agent });
|
|
1985
|
+
function isDeepseekModel(model) {
|
|
1986
|
+
const [provider, ...parts] = model.split("/");
|
|
1987
|
+
return !!parts.length && (provider === "deepseek" || /(?:^|[/-])deepseek(?:$|[/-])/i.test(parts.join("/")));
|
|
1988
|
+
}
|
|
1989
|
+
function setHerdrModel(text, name, model) {
|
|
1990
|
+
const raw = parse(text);
|
|
1991
|
+
const profiles = raw.herdr?.profiles;
|
|
1992
|
+
if (!profiles?.[name])
|
|
1993
|
+
throw new Error("profile is no longer present");
|
|
1994
|
+
const lines = text.split(/(?<=\n)/);
|
|
1995
|
+
let section = -1;
|
|
1996
|
+
let end = lines.length;
|
|
1997
|
+
for (let i = 0;i < lines.length; i++) {
|
|
1998
|
+
const header = lines[i]?.match(/^\s*\[herdr\s*\.\s*profiles\s*\.\s*(.+?)\]\s*(?:#.*)?(?:\r?\n)?$/);
|
|
1999
|
+
if (header) {
|
|
2000
|
+
const key = header[1]?.trim();
|
|
2001
|
+
if (key && Object.hasOwn(parse(`[${key}]
|
|
2002
|
+
`), name)) {
|
|
2003
|
+
section = i;
|
|
2004
|
+
break;
|
|
2005
|
+
}
|
|
2006
|
+
}
|
|
2007
|
+
}
|
|
2008
|
+
if (section < 0)
|
|
2009
|
+
throw new Error("use an explicit [herdr.profiles.<name>] section to save the model");
|
|
2010
|
+
for (let i = section + 1;i < lines.length; i++) {
|
|
2011
|
+
if (/^\s*\[/.test(lines[i] ?? "")) {
|
|
2012
|
+
end = i;
|
|
2013
|
+
break;
|
|
2014
|
+
}
|
|
2015
|
+
}
|
|
2016
|
+
let replaced = false;
|
|
2017
|
+
for (let i = section + 1;i < end; i++) {
|
|
2018
|
+
const match = lines[i]?.match(/^(\s*(?:model|"model"|'model')\s*=\s*)("(?:[^"\\]|\\.)*"|'[^']*')(.*?)(\r?\n)?$/);
|
|
2019
|
+
if (match) {
|
|
2020
|
+
const value = match[2]?.startsWith("'") && !model.includes("'") ? `'${model}'` : JSON.stringify(model);
|
|
2021
|
+
lines[i] = `${match[1]}${value}${match[3]}${match[4] ?? ""}`;
|
|
2022
|
+
replaced = true;
|
|
2023
|
+
break;
|
|
2024
|
+
}
|
|
2025
|
+
}
|
|
2026
|
+
if (!replaced) {
|
|
2027
|
+
const newline = text.includes(`\r
|
|
2028
|
+
`) ? `\r
|
|
2029
|
+
` : `
|
|
2030
|
+
`;
|
|
2031
|
+
if (!(lines[section] ?? "").endsWith(`
|
|
2032
|
+
`))
|
|
2033
|
+
lines[section] += newline;
|
|
2034
|
+
lines.splice(section + 1, 0, `model = ${JSON.stringify(model)}${newline}`);
|
|
2035
|
+
}
|
|
2036
|
+
const next = lines.join("");
|
|
2037
|
+
profiles[name].model = model;
|
|
2038
|
+
if (JSON.stringify(parse(next)) !== JSON.stringify(raw)) {
|
|
2039
|
+
const canonical = (value) => JSON.stringify(value, (_, v) => typeof v === "object" && v !== null && !Array.isArray(v) ? Object.fromEntries(Object.keys(v).sort().map((key) => [key, v[key]])) : v);
|
|
2040
|
+
if (canonical(parse(next)) !== canonical(raw))
|
|
2041
|
+
throw new Error("could not safely edit the profile model");
|
|
2042
|
+
}
|
|
2043
|
+
return next;
|
|
2044
|
+
}
|
|
2045
|
+
|
|
2046
|
+
// ../core/src/npm.ts
|
|
2047
|
+
var ARMADA_PACKAGE = CLI_PACKAGE;
|
|
2048
|
+
var NPM_REGISTRY_URL = `https://registry.npmjs.org/${ARMADA_PACKAGE.replace("/", "%2f")}`;
|
|
2049
|
+
var NPM_CHECK_MS = 3000;
|
|
2050
|
+
async function checkPublished(version, fetch2, timeoutMs = NPM_CHECK_MS) {
|
|
2051
|
+
try {
|
|
2052
|
+
const signal = AbortSignal.timeout(timeoutMs);
|
|
2053
|
+
const res = await fetch2(NPM_REGISTRY_URL, {
|
|
2054
|
+
headers: { accept: "application/vnd.npm.install-v1+json" },
|
|
2055
|
+
cache: "no-store",
|
|
2056
|
+
signal
|
|
2057
|
+
});
|
|
2058
|
+
if (!res.ok)
|
|
2059
|
+
return { state: "unknown", reason: `npm answered HTTP ${res.status}` };
|
|
2060
|
+
const body = await res.json();
|
|
2061
|
+
const versions = body?.versions;
|
|
2062
|
+
if (!versions || typeof versions !== "object" || Array.isArray(versions) || !Object.keys(versions).length)
|
|
2063
|
+
return { state: "unknown", reason: "npm listed no version" };
|
|
2064
|
+
const candidates = Object.keys(versions).filter((candidate) => /^\d+\.\d+\.\d+$/.test(candidate) && compareVersions(candidate, version) <= 0).sort((first, second) => compareVersions(second, first));
|
|
2065
|
+
for (const candidate of candidates) {
|
|
2066
|
+
const tarball = versions[candidate]?.dist?.tarball;
|
|
2067
|
+
if (typeof tarball !== "string" || !tarball)
|
|
2068
|
+
continue;
|
|
2069
|
+
const download = await fetch2(tarball, { method: "HEAD", cache: "no-store", signal });
|
|
2070
|
+
if (download.status === 200)
|
|
2071
|
+
return candidate === version ? { state: "published" } : { state: "missing", newest: candidate };
|
|
2072
|
+
if (download.status !== 404)
|
|
2073
|
+
return { state: "unknown", reason: `npm tarball answered HTTP ${download.status}` };
|
|
2074
|
+
}
|
|
2075
|
+
return { state: "missing", newest: null };
|
|
2076
|
+
} catch (err) {
|
|
2077
|
+
return { state: "unknown", reason: networkReason(err, timeoutMs) };
|
|
2078
|
+
}
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2019
2081
|
// ../core/src/config.ts
|
|
2020
2082
|
var CONFIG_FILE = "armada.toml";
|
|
2021
2083
|
var PLAN_POLICIES = ["approve", "pre-approved"];
|
|
2022
2084
|
var routingLabelKey = (name) => name.normalize("NFKC").toLowerCase().replace(/[^\p{L}\p{M}\p{N}]/gu, "");
|
|
2023
2085
|
var PROFILE_RUNTIMES = ["conductor", "claude-code"];
|
|
2024
|
-
var HERDR_HARNESSES = ["claude", "codex", "opencode"];
|
|
2086
|
+
var HERDR_HARNESSES = ["claude", "codex", "opencode", "deepseek"];
|
|
2025
2087
|
var CONFIG_DEFAULTS = {
|
|
2026
2088
|
language: "en",
|
|
2027
2089
|
readyLabel: "ready-for-agent",
|
|
@@ -2258,10 +2320,13 @@ function parseConfig(text, source = CONFIG_FILE) {
|
|
|
2258
2320
|
else
|
|
2259
2321
|
problems.push(`"${path}.extra_args" must be a list of non-empty argument strings`);
|
|
2260
2322
|
}
|
|
2323
|
+
if (harness === "deepseek" && extraArgs.some((arg) => /^(?:--model(?:=|$)|-m)/.test(arg.trim())))
|
|
2324
|
+
problems.push(`"${path}.extra_args" must not override the DeepSeek model; use "${path}.model"`);
|
|
2325
|
+
const model = (harness === "opencode" || harness === "deepseek") && (p.model === undefined || typeof p.model === "string" && !p.model.trim()) ? "" : str(p, path, "model");
|
|
2261
2326
|
herdrProfiles[name] = {
|
|
2262
2327
|
...p.when !== undefined ? { when: str(p, path, "when") } : {},
|
|
2263
2328
|
harness,
|
|
2264
|
-
model
|
|
2329
|
+
model,
|
|
2265
2330
|
effort: str(p, path, "effort"),
|
|
2266
2331
|
extraArgs
|
|
2267
2332
|
};
|
|
@@ -2567,7 +2632,7 @@ profile = "debug"
|
|
|
2567
2632
|
# default_profile = "claude"
|
|
2568
2633
|
|
|
2569
2634
|
# [herdr.profiles.claude]
|
|
2570
|
-
# harness = "claude" # "claude", "codex" or "
|
|
2635
|
+
# harness = "claude" # "claude", "codex", "opencode" or "deepseek" (OpenCode + DeepSeek model)
|
|
2571
2636
|
# model = "sonnet"
|
|
2572
2637
|
# effort = "high"
|
|
2573
2638
|
# extra_args = ["--verbose"]
|
|
@@ -3008,7 +3073,7 @@ ${validation}` : ""}`;
|
|
|
3008
3073
|
await linear.deleteComment(mine.id);
|
|
3009
3074
|
throw new Refusal(`${ticket.id} was claimed first by ${winner.claim?.runtime ?? "another worker"} · ${winner.claim?.session ?? "unknown session"}; your claim was withdrawn`, "armada status, to pick another ticket ready to start");
|
|
3010
3075
|
}
|
|
3011
|
-
lines.push(`Claimed ${ticket.id} for ${runtime.name} (${input.handle})${profile ? ` on profile ${profile.name}` : ""}.`);
|
|
3076
|
+
lines.push(`Claimed ${ticket.id} for ${runtime.name} (${input.handle})${profile ? ` on profile ${profile.name}${profile.profile.runtime === "herdr" ? ` (${profile.profile.agent})` : ""}` : ""}.`);
|
|
3012
3077
|
} else {
|
|
3013
3078
|
lines.push(`${ticket.id} is already claimed by this session (${input.handle}); labels and state repaired.`);
|
|
3014
3079
|
if (input.profile && (holder?.profile ?? null) !== input.profile)
|
|
@@ -3448,6 +3513,8 @@ function renderPrompt(b) {
|
|
|
3448
3513
|
""
|
|
3449
3514
|
] : []
|
|
3450
3515
|
];
|
|
3516
|
+
if (b.runtime === "herdr" && b.profile)
|
|
3517
|
+
out.push("## Harness", "", `Profile ${b.profile.name}: ${b.profile.agent}, model ${b.profile.model}, effort ${b.profile.effort}.`, "");
|
|
3451
3518
|
if (t.description)
|
|
3452
3519
|
out.push("## Ticket", "", quote(t.description), "");
|
|
3453
3520
|
if (b.parent)
|
|
@@ -9797,28 +9864,33 @@ function buildStatus({
|
|
|
9797
9864
|
},
|
|
9798
9865
|
silentAfterMinutes: config.policy.silentAfterMinutes,
|
|
9799
9866
|
coordinatorMinutes: config.policy.coordinatorMinutes,
|
|
9800
|
-
inFlight: lanes.map((l) =>
|
|
9801
|
-
|
|
9802
|
-
|
|
9803
|
-
|
|
9804
|
-
|
|
9805
|
-
|
|
9806
|
-
|
|
9807
|
-
|
|
9808
|
-
|
|
9809
|
-
|
|
9810
|
-
|
|
9811
|
-
|
|
9812
|
-
|
|
9813
|
-
|
|
9814
|
-
|
|
9815
|
-
|
|
9816
|
-
|
|
9817
|
-
|
|
9818
|
-
|
|
9819
|
-
|
|
9820
|
-
|
|
9821
|
-
|
|
9867
|
+
inFlight: lanes.map((l) => {
|
|
9868
|
+
const profileName = live?.handles?.[l.issue.id]?.profile ?? l.claim?.profile ?? null;
|
|
9869
|
+
const profile = profileName && l.runtime?.toLowerCase() === "herdr" ? config.herdr.profiles[profileName] : null;
|
|
9870
|
+
return {
|
|
9871
|
+
id: l.issue.id,
|
|
9872
|
+
title: l.issue.title,
|
|
9873
|
+
url: l.issue.url,
|
|
9874
|
+
spec: l.spec,
|
|
9875
|
+
phase: l.phase,
|
|
9876
|
+
phaseSource: l.phaseSource,
|
|
9877
|
+
runtime: l.runtime,
|
|
9878
|
+
handle: l.handle,
|
|
9879
|
+
profile: profileName,
|
|
9880
|
+
profileReason: l.claim?.profileReason ?? null,
|
|
9881
|
+
...profile ? { harness: herdrHarnessLabel(profile.harness) } : {},
|
|
9882
|
+
agent: l.agent,
|
|
9883
|
+
since: l.since,
|
|
9884
|
+
lastUpdate: l.lastUpdate,
|
|
9885
|
+
lastReport: l.lastReport,
|
|
9886
|
+
lastHeartbeat: l.lastHeartbeat,
|
|
9887
|
+
silent: l.flags.includes("silent"),
|
|
9888
|
+
statusLine: l.statusLine ? { summary: l.statusLine.summary, at: l.statusLine.at, url: l.statusLine.url, plan: l.statusLine.plan } : null,
|
|
9889
|
+
pr: l.pr ? prRef(l.pr) : null,
|
|
9890
|
+
openBlockers: l.openBlockers,
|
|
9891
|
+
flags: l.flags
|
|
9892
|
+
};
|
|
9893
|
+
}),
|
|
9822
9894
|
pendingLaunches: followedLaunches(launches, now),
|
|
9823
9895
|
notStarted: notStartedLaunches(launches, now, config.policy.notStartedMinutes).map((l) => {
|
|
9824
9896
|
const issue = issues.find((i) => i.id === l.ticket);
|
|
@@ -10021,7 +10093,7 @@ ${attachments.join(`
|
|
|
10021
10093
|
};
|
|
10022
10094
|
}
|
|
10023
10095
|
// package.json
|
|
10024
|
-
var version = "0.2.
|
|
10096
|
+
var version = "0.2.37";
|
|
10025
10097
|
|
|
10026
10098
|
// src/attach.ts
|
|
10027
10099
|
import { resolve } from "node:path";
|
|
@@ -11350,6 +11422,9 @@ ${next.line}
|
|
|
11350
11422
|
return 0;
|
|
11351
11423
|
}
|
|
11352
11424
|
|
|
11425
|
+
// src/doctor.ts
|
|
11426
|
+
import { join as join4 } from "node:path";
|
|
11427
|
+
|
|
11353
11428
|
// src/local-tools.ts
|
|
11354
11429
|
import { stripVTControlCharacters } from "node:util";
|
|
11355
11430
|
var MINIMUM_HERDR_VERSION = "0.9.1";
|
|
@@ -11358,11 +11433,14 @@ var TOOLS = {
|
|
|
11358
11433
|
claude: { command: "claude", install: "curl -fsSL https://claude.ai/install.sh | bash" },
|
|
11359
11434
|
codex: { command: "codex", install: "npm i -g @openai/codex" },
|
|
11360
11435
|
opencode: { command: "opencode", install: "curl -fsSL https://opencode.ai/install | bash" },
|
|
11361
|
-
|
|
11436
|
+
dsh: { command: "dsh", install: "" }
|
|
11362
11437
|
};
|
|
11363
11438
|
function localHarnesses(config) {
|
|
11364
11439
|
return [...new Set(Object.values(config.herdr?.profiles ?? {}).map((profile) => profile.harness))];
|
|
11365
11440
|
}
|
|
11441
|
+
function localModelProfiles(config) {
|
|
11442
|
+
return Object.entries(config.herdr?.profiles ?? {}).flatMap(([name, profile]) => profile.harness === "opencode" || profile.harness === "deepseek" ? [{ name, harness: profile.harness, model: profile.model ?? "" }] : []);
|
|
11443
|
+
}
|
|
11366
11444
|
async function probe(io, command, args) {
|
|
11367
11445
|
if (!io.exec)
|
|
11368
11446
|
return null;
|
|
@@ -11443,7 +11521,7 @@ async function signInCheck(io, harness) {
|
|
|
11443
11521
|
}
|
|
11444
11522
|
} catch {}
|
|
11445
11523
|
}
|
|
11446
|
-
} else
|
|
11524
|
+
} else {
|
|
11447
11525
|
login = "codex login";
|
|
11448
11526
|
const result = await probe(io, command, ["login", "status"]);
|
|
11449
11527
|
if (result?.code === 0)
|
|
@@ -11451,38 +11529,121 @@ async function signInCheck(io, harness) {
|
|
|
11451
11529
|
else if (result?.code === 1 && /(?:^|\n)Not logged in\s*(?:\n|$)/i.test(`${result.stdout}
|
|
11452
11530
|
${result.stderr}`))
|
|
11453
11531
|
state = "missing";
|
|
11454
|
-
} else if (harness === "opencode") {
|
|
11455
|
-
login = "opencode auth login";
|
|
11456
|
-
const result = await probe(io, command, ["auth", "list"]);
|
|
11457
|
-
if (result?.code === 0) {
|
|
11458
|
-
const text = stripVTControlCharacters(`${result.stdout}
|
|
11459
|
-
${result.stderr}`);
|
|
11460
|
-
const count = text.match(/\b(\d+) credentials\b/);
|
|
11461
|
-
const environment = text.match(/\b(\d+) environment variables?\b/);
|
|
11462
|
-
if (count)
|
|
11463
|
-
state = Number(count[1]) > 0 || Number(environment?.[1] ?? 0) > 0 ? "ready" : "missing";
|
|
11464
|
-
}
|
|
11465
|
-
} else {
|
|
11466
|
-
login = "dsh web";
|
|
11467
11532
|
}
|
|
11468
11533
|
return {
|
|
11469
11534
|
id: `local-${command}-sign-in`,
|
|
11470
11535
|
level: state === "ready" ? "ok" : state === "missing" ? "error" : "warning",
|
|
11471
|
-
message: state === "ready" ? `${command} reports credentials are present
|
|
11472
|
-
fix: state === "ready" ? null : `the owner runs \`${login}
|
|
11536
|
+
message: state === "ready" ? `${command} reports credentials are present` : state === "missing" ? `${command} is not signed in` : `${command}: could not check sign-in`,
|
|
11537
|
+
fix: state === "ready" ? null : `the owner runs \`${login}\`; Armada never runs sign-in`
|
|
11473
11538
|
};
|
|
11474
11539
|
}
|
|
11475
|
-
async function
|
|
11540
|
+
async function openCodeModels(io) {
|
|
11541
|
+
const result = await probe(io, "opencode", ["models"]);
|
|
11542
|
+
if (result?.code !== 0)
|
|
11543
|
+
return null;
|
|
11544
|
+
return [
|
|
11545
|
+
...new Set(stripVTControlCharacters(result.stdout).split(`
|
|
11546
|
+
`).map((line) => line.trim()).filter((line) => /^[^\s/#]+\/[^\s#]+$/.test(line)))
|
|
11547
|
+
];
|
|
11548
|
+
}
|
|
11549
|
+
function modelCheck(profile, available) {
|
|
11550
|
+
const model = profile.model;
|
|
11551
|
+
const matching = available?.filter((id) => profile.harness !== "deepseek" || isDeepseekModel(id)) ?? [];
|
|
11552
|
+
const ready = !!model && matching.includes(model);
|
|
11553
|
+
const label = profile.harness === "deepseek" ? "deepseek (OpenCode + DeepSeek model)" : "opencode";
|
|
11554
|
+
return {
|
|
11555
|
+
id: `local-opencode-${profile.harness}:${profile.name || model}`,
|
|
11556
|
+
level: ready ? "ok" : "error",
|
|
11557
|
+
message: `${label}${profile.name ? ` profile ${profile.name}` : ""}: ${ready ? `OpenCode lists ${model}` : available === null ? "could not check opencode models" : `${model || "the profile's model"} is not listed by OpenCode`}
|
|
11558
|
+
${ready ? "" : `Available models: ${matching.length ? matching.map((id, i) => `${i + 1}. ${id} — model = ${JSON.stringify(id)}`).join("; ") : "none"}`}`.trimEnd(),
|
|
11559
|
+
fix: ready ? null : `the owner runs \`opencode\`, then \`/connect\`, or picks a model listed by \`opencode models\`; add \`model = "<exact model id>"\`${profile.name ? ` under [herdr.profiles.${profile.name}]` : ""}; Armada never handles the key`
|
|
11560
|
+
};
|
|
11561
|
+
}
|
|
11562
|
+
async function offerLocalModels(io, detected, configPath, options = {}) {
|
|
11563
|
+
if (detected.availableModels === null)
|
|
11564
|
+
return detected;
|
|
11565
|
+
let changed = false;
|
|
11566
|
+
for (const profile of detected.profiles) {
|
|
11567
|
+
if (modelCheck(profile, detected.availableModels).level === "ok")
|
|
11568
|
+
continue;
|
|
11569
|
+
const models = detected.availableModels.filter((id) => profile.harness !== "deepseek" || isDeepseekModel(id));
|
|
11570
|
+
if (!models.length || options.readOnly || !io.interactive || io.env.CI || !io.prompt || !io.writeFile || !configPath || !profile.name)
|
|
11571
|
+
continue;
|
|
11572
|
+
io.stderr(`Choose a model for [herdr.profiles.${profile.name}]:
|
|
11573
|
+
${models.map((id, i) => ` ${i + 1}. ${id}`).join(`
|
|
11574
|
+
`)}
|
|
11575
|
+
`);
|
|
11576
|
+
const before = await io.readFile(configPath);
|
|
11577
|
+
const answer = await io.prompt("Model number (Enter to leave unchanged): ", { hidden: false });
|
|
11578
|
+
if (answer === null)
|
|
11579
|
+
break;
|
|
11580
|
+
if (!answer.trim())
|
|
11581
|
+
continue;
|
|
11582
|
+
const selected = /^\d+$/.test(answer.trim()) ? models[Number(answer.trim()) - 1] : undefined;
|
|
11583
|
+
if (!selected) {
|
|
11584
|
+
io.stderr(`No model was selected; configuration unchanged.
|
|
11585
|
+
`);
|
|
11586
|
+
continue;
|
|
11587
|
+
}
|
|
11588
|
+
try {
|
|
11589
|
+
if (before === null)
|
|
11590
|
+
throw new Error("missing config");
|
|
11591
|
+
const after = setHerdrModel(before, profile.name, selected);
|
|
11592
|
+
if (await io.readFile(configPath) !== before)
|
|
11593
|
+
throw new Error("config changed");
|
|
11594
|
+
await io.writeFile(configPath, after);
|
|
11595
|
+
profile.model = selected;
|
|
11596
|
+
changed = true;
|
|
11597
|
+
io.stderr(`Wrote model = ${JSON.stringify(selected)} under [herdr.profiles.${profile.name}] in ${configPath}.
|
|
11598
|
+
`);
|
|
11599
|
+
} catch {
|
|
11600
|
+
io.stderr(`Could not safely save the model in ${configPath}; add model = ${JSON.stringify(selected)} under [herdr.profiles.${profile.name}] yourself.
|
|
11601
|
+
`);
|
|
11602
|
+
}
|
|
11603
|
+
}
|
|
11604
|
+
return changed ? detectLocalTools(io, detected.harnesses, detected.profiles) : detected;
|
|
11605
|
+
}
|
|
11606
|
+
async function dshInformation(io) {
|
|
11607
|
+
const tool = await detectTool(io, "dsh");
|
|
11608
|
+
const present = tool.state === "ready";
|
|
11609
|
+
return {
|
|
11610
|
+
id: "local-dsh",
|
|
11611
|
+
level: "ok",
|
|
11612
|
+
message: `${present ? `dsh ${tool.version} is on PATH` : tool.state === "missing" ? "dsh is not installed" : "dsh installation could not be checked"}; information only: deepseek (OpenCode + DeepSeek model) runs OpenCode. Inspected dsh 0.1.5-rc.2 is one-shot, with no follow-up input or --resume`,
|
|
11613
|
+
fix: null
|
|
11614
|
+
};
|
|
11615
|
+
}
|
|
11616
|
+
async function detectLocalTools(io, harnesses, configured = []) {
|
|
11617
|
+
const profiles = configured.map((profile) => typeof profile === "string" ? { name: "", harness: "deepseek", model: profile } : { ...profile });
|
|
11618
|
+
for (const harness of harnesses) {
|
|
11619
|
+
if ((harness === "opencode" || harness === "deepseek") && !profiles.some((profile) => profile.harness === harness))
|
|
11620
|
+
profiles.push({ name: "", harness, model: "" });
|
|
11621
|
+
}
|
|
11622
|
+
let availableModels = null;
|
|
11476
11623
|
const tools = [];
|
|
11477
11624
|
const checks = [];
|
|
11478
|
-
|
|
11625
|
+
const binaries = new Set(harnesses.map((harness) => harness === "deepseek" ? "opencode" : harness));
|
|
11626
|
+
for (const name of ["herdr", ...binaries]) {
|
|
11479
11627
|
const tool = await detectTool(io, name);
|
|
11480
11628
|
tools.push(tool);
|
|
11481
11629
|
checks.push(toolCheck(tool));
|
|
11482
|
-
if (name !== "herdr" && tool.state === "ready")
|
|
11483
|
-
|
|
11630
|
+
if (name !== "herdr" && tool.state === "ready") {
|
|
11631
|
+
if (name !== "opencode")
|
|
11632
|
+
checks.push(await signInCheck(io, name));
|
|
11633
|
+
else {
|
|
11634
|
+
availableModels = await openCodeModels(io);
|
|
11635
|
+
checks.push(...profiles.map((profile) => modelCheck(profile, availableModels)));
|
|
11636
|
+
}
|
|
11637
|
+
}
|
|
11484
11638
|
}
|
|
11485
|
-
return {
|
|
11639
|
+
return {
|
|
11640
|
+
tools,
|
|
11641
|
+
profiles,
|
|
11642
|
+
availableModels,
|
|
11643
|
+
harnesses: [...new Set(harnesses)],
|
|
11644
|
+
checks,
|
|
11645
|
+
ready: !checks.some((check) => check.level === "error")
|
|
11646
|
+
};
|
|
11486
11647
|
}
|
|
11487
11648
|
async function offerLocalInstalls(io, detected, options = {}) {
|
|
11488
11649
|
const platform = io.platform ?? process.platform;
|
|
@@ -11490,7 +11651,7 @@ async function offerLocalInstalls(io, detected, options = {}) {
|
|
|
11490
11651
|
return detected;
|
|
11491
11652
|
let attempted = false;
|
|
11492
11653
|
for (const tool of detected.tools) {
|
|
11493
|
-
if (tool.state === "ready" || tool.state === "unknown")
|
|
11654
|
+
if (tool.name === "dsh" || tool.state === "ready" || tool.state === "unknown")
|
|
11494
11655
|
continue;
|
|
11495
11656
|
const check = toolCheck(tool);
|
|
11496
11657
|
const answer = await io.prompt(`${check.message}: \`${tool.install}\` — install now? [y/N] `, { hidden: false });
|
|
@@ -11500,21 +11661,24 @@ async function offerLocalInstalls(io, detected, options = {}) {
|
|
|
11500
11661
|
continue;
|
|
11501
11662
|
attempted = true;
|
|
11502
11663
|
const definition = TOOLS[tool.name];
|
|
11503
|
-
const npm = tool.name === "codex"
|
|
11504
|
-
const code = await io.spawn(npm ? "npm" : "sh", npm ? ["i", "-g",
|
|
11664
|
+
const npm = tool.name === "codex";
|
|
11665
|
+
const code = await io.spawn(npm ? "npm" : "sh", npm ? ["i", "-g", "@openai/codex"] : ["-c", definition.install], {
|
|
11666
|
+
cwd: io.cwd,
|
|
11667
|
+
env: installerEnv(io.env)
|
|
11668
|
+
}).catch(() => null);
|
|
11505
11669
|
if (code !== 0)
|
|
11506
11670
|
io.stderr(`${tool.command} installation failed${code === null ? "" : ` (exit ${code})`}. Run \`${definition.install}\` yourself.
|
|
11507
11671
|
`);
|
|
11508
11672
|
}
|
|
11509
11673
|
if (!attempted)
|
|
11510
11674
|
return detected;
|
|
11511
|
-
const result = await detectLocalTools(io, detected.
|
|
11675
|
+
const result = await detectLocalTools(io, detected.harnesses, detected.profiles);
|
|
11512
11676
|
if (result.tools.some((tool) => tool.state !== "ready"))
|
|
11513
11677
|
io.stderr(`Some local tools still cannot run. Check PATH, open a new terminal if needed, and retry.
|
|
11514
11678
|
`);
|
|
11515
11679
|
return result;
|
|
11516
11680
|
}
|
|
11517
|
-
async function ensureLocalTools(io, harness) {
|
|
11681
|
+
async function ensureLocalTools(io, harness, model) {
|
|
11518
11682
|
const print = (detected) => {
|
|
11519
11683
|
for (const check of detected.checks) {
|
|
11520
11684
|
if (check.level === "ok")
|
|
@@ -11523,13 +11687,26 @@ async function ensureLocalTools(io, harness) {
|
|
|
11523
11687
|
`);
|
|
11524
11688
|
}
|
|
11525
11689
|
};
|
|
11526
|
-
const detected = await detectLocalTools(io, [harness]);
|
|
11690
|
+
const detected = await detectLocalTools(io, [harness], harness === "deepseek" || harness === "opencode" ? [{ name: "", harness, model: model ?? "" }] : []);
|
|
11527
11691
|
print(detected);
|
|
11528
11692
|
const result = await offerLocalInstalls(io, detected);
|
|
11529
11693
|
if (result !== detected)
|
|
11530
11694
|
print(result);
|
|
11531
11695
|
return result.ready;
|
|
11532
11696
|
}
|
|
11697
|
+
async function ensureLocalProfile(io, configPath, name, profile) {
|
|
11698
|
+
if (profile.harness !== "opencode" && profile.harness !== "deepseek")
|
|
11699
|
+
return await ensureLocalTools(io, profile.harness, profile.model) ? profile.model : null;
|
|
11700
|
+
const detected = await detectLocalTools(io, [profile.harness], [{ name, harness: profile.harness, model: profile.model }]);
|
|
11701
|
+
const installed = await offerLocalInstalls(io, detected);
|
|
11702
|
+
const chosen = await offerLocalModels(io, installed, configPath);
|
|
11703
|
+
for (const check of chosen.checks) {
|
|
11704
|
+
if (check.level !== "ok")
|
|
11705
|
+
io.stderr(`${check.message}${check.fix ? `: ${check.fix}` : ""}
|
|
11706
|
+
`);
|
|
11707
|
+
}
|
|
11708
|
+
return chosen.ready ? chosen.profiles[0]?.model ?? null : null;
|
|
11709
|
+
}
|
|
11533
11710
|
|
|
11534
11711
|
// src/repo.ts
|
|
11535
11712
|
import { lstat, mkdir as mkdir2, readdir, readFile as readFile2, readlink, rm as rm2, symlink, writeFile as writeFile2 } from "node:fs/promises";
|
|
@@ -11858,7 +12035,9 @@ async function localRuntimeChecks(io, config, options = { readOnly: true }) {
|
|
|
11858
12035
|
const harnesses = config ? localHarnesses(config) : [];
|
|
11859
12036
|
if (!harnesses.length)
|
|
11860
12037
|
return [];
|
|
11861
|
-
|
|
12038
|
+
const result = await offerLocalInstalls(io, await detectLocalTools(io, harnesses, config ? localModelProfiles(config) : []), options);
|
|
12039
|
+
const selected = await offerLocalModels(io, result, options.configPath ?? join4(io.cwd, CONFIG_FILE), options);
|
|
12040
|
+
return [...selected.checks, ...harnesses.includes("deepseek") ? [await dshInformation(io)] : []];
|
|
11862
12041
|
}
|
|
11863
12042
|
async function buildDoctor(io, armadaVersion, options = { readOnly: true }) {
|
|
11864
12043
|
const root = (io.exec ? await gitRoot(io.exec, io.cwd) : null) ?? io.cwd;
|
|
@@ -11891,7 +12070,7 @@ async function buildDoctor(io, armadaVersion, options = { readOnly: true }) {
|
|
|
11891
12070
|
...keyFileChecks(machine, credentials),
|
|
11892
12071
|
...await labelChecks(io, config, credentials),
|
|
11893
12072
|
...await conductorChecks(io, config),
|
|
11894
|
-
...await localRuntimeChecks(io, config, options),
|
|
12073
|
+
...await localRuntimeChecks(io, config, { ...options, configPath: join4(root, CONFIG_FILE) }),
|
|
11895
12074
|
...config ? await reviewRuntimeChecks(io, root) : [],
|
|
11896
12075
|
...await secretChecks(api, config, credentials)
|
|
11897
12076
|
];
|
|
@@ -12025,7 +12204,7 @@ async function heartbeat(io, config, credentials, args) {
|
|
|
12025
12204
|
// src/init.ts
|
|
12026
12205
|
import { mkdtemp, realpath, rm as rm3 } from "node:fs/promises";
|
|
12027
12206
|
import { tmpdir } from "node:os";
|
|
12028
|
-
import { join as
|
|
12207
|
+
import { join as join5 } from "node:path";
|
|
12029
12208
|
var STOP_HOOK_QUESTION = "Add the Claude Code stop hook to this repository's .claude/settings.json? A coordinator then cannot end its turn while workers are in flight and no armada watch runs; your user settings are not touched. [Y/n] ";
|
|
12030
12209
|
async function wantsStopHook(io, opts) {
|
|
12031
12210
|
if (opts.stopHook !== null)
|
|
@@ -12058,7 +12237,7 @@ async function resolveConfig(exec, root, checkout, opts) {
|
|
|
12058
12237
|
return { config: parse(onDefault, `${CONFIG_FILE} on the default branch`), text: null, source: "default branch" };
|
|
12059
12238
|
const local = await fsRepoView(root).readFile(CONFIG_FILE);
|
|
12060
12239
|
if (local !== null && !opts.programRoot)
|
|
12061
|
-
return { config: parse(local,
|
|
12240
|
+
return { config: parse(local, join5(root, CONFIG_FILE)), text: local, source: "working tree" };
|
|
12062
12241
|
const branch = initBranch(opts.armadaVersion);
|
|
12063
12242
|
if (!opts.programRoot && await sh(exec, root, "git", ["ls-remote", "origin", `refs/heads/${branch}`])) {
|
|
12064
12243
|
await sh(exec, root, "git", ["fetch", "--quiet", "origin", branch]);
|
|
@@ -12129,7 +12308,7 @@ async function init(io, opts) {
|
|
|
12129
12308
|
const base = await defaultBranch(exec, root);
|
|
12130
12309
|
await sh(exec, root, "git", ["fetch", "--quiet", "origin", base]);
|
|
12131
12310
|
const baseSha = await sh(exec, root, "git", ["rev-parse", "FETCH_HEAD"]);
|
|
12132
|
-
const checkout = await realpath(await mkdtemp(
|
|
12311
|
+
const checkout = await realpath(await mkdtemp(join5(tmpdir(), "armada-init-")));
|
|
12133
12312
|
try {
|
|
12134
12313
|
await sh(exec, root, "git", ["worktree", "add", "--quiet", "--detach", checkout, baseSha]);
|
|
12135
12314
|
const { config, text, source } = await resolveConfig(exec, root, checkout, opts);
|
|
@@ -12232,12 +12411,12 @@ async function init(io, opts) {
|
|
|
12232
12411
|
}
|
|
12233
12412
|
|
|
12234
12413
|
// src/launch.ts
|
|
12235
|
-
import { dirname as dirname5, join as
|
|
12414
|
+
import { dirname as dirname5, join as join6 } from "node:path";
|
|
12236
12415
|
|
|
12237
12416
|
// src/herdr.ts
|
|
12238
12417
|
var harnessArgs = (p) => [
|
|
12239
12418
|
"--model",
|
|
12240
|
-
p.harness === "opencode" ? `${p.model.split("#")[0]}#${p.effort}` : p.model,
|
|
12419
|
+
herdrHarnessKind(p.harness) === "opencode" ? `${p.model.split("#")[0]}#${p.effort}` : p.model,
|
|
12241
12420
|
...p.harness === "codex" ? ["-c", `model_reasoning_effort=${JSON.stringify(p.effort)}`] : p.harness === "claude" ? ["--effort", p.effort] : [],
|
|
12242
12421
|
...p.extraArgs
|
|
12243
12422
|
];
|
|
@@ -12358,7 +12537,7 @@ class Herdr {
|
|
|
12358
12537
|
"start",
|
|
12359
12538
|
handle.agent,
|
|
12360
12539
|
"--kind",
|
|
12361
|
-
profile.harness,
|
|
12540
|
+
herdrHarnessKind(profile.harness),
|
|
12362
12541
|
"--pane",
|
|
12363
12542
|
handle.pane,
|
|
12364
12543
|
"--timeout",
|
|
@@ -12420,13 +12599,13 @@ async function launchLocal(io, config, credentials, args, version, configPath) {
|
|
|
12420
12599
|
const [input, ...extra] = args.rest;
|
|
12421
12600
|
const o = args.options;
|
|
12422
12601
|
if (!input || extra.length || !/^[A-Za-z][A-Za-z0-9]{0,15}-\d{1,9}$/.test(input) || o.runtime !== "herdr")
|
|
12423
|
-
throw new UsageError("launch needs a ticket and runtime: armada launch <ticket> --runtime herdr [--harness claude|codex|opencode]");
|
|
12602
|
+
throw new UsageError("launch needs a ticket and runtime: armada launch <ticket> --runtime herdr [--harness claude|codex|opencode|deepseek]");
|
|
12424
12603
|
const requested = o.profile?.trim() || null;
|
|
12425
12604
|
const reason = o.reason?.trim() || null;
|
|
12426
12605
|
if (reason && !requested)
|
|
12427
12606
|
throw new UsageError("--reason goes with --profile");
|
|
12428
12607
|
if (o.harness && !HERDR_HARNESSES.includes(o.harness))
|
|
12429
|
-
throw new UsageError("--harness must be claude, codex or
|
|
12608
|
+
throw new UsageError("--harness must be claude, codex, opencode or deepseek (OpenCode + DeepSeek model)");
|
|
12430
12609
|
try {
|
|
12431
12610
|
checkRequestedProfile(config, requested, "herdr");
|
|
12432
12611
|
} catch (error) {
|
|
@@ -12489,8 +12668,18 @@ async function launchLocal(io, config, credentials, args, version, configPath) {
|
|
|
12489
12668
|
interactive: args.json ? false : io.interactive,
|
|
12490
12669
|
exec: (command, argv, options) => execute(command, argv, { ...options, timeoutMs: options.timeoutMs ?? 1e4 })
|
|
12491
12670
|
};
|
|
12492
|
-
|
|
12671
|
+
const model = await ensureLocalProfile(preflight, configPath, choice.name, choice.profile);
|
|
12672
|
+
if (model === null)
|
|
12493
12673
|
return 1;
|
|
12674
|
+
choice.profile.model = model;
|
|
12675
|
+
const openCode = herdrHarnessKind(choice.profile.harness) === "opencode";
|
|
12676
|
+
const configSnapshot = openCode ? await io.readFile(configPath) : null;
|
|
12677
|
+
if (openCode) {
|
|
12678
|
+
if (!io.writeFile || configSnapshot === null)
|
|
12679
|
+
throw new UsageError("local OpenCode launch needs the configuration copied into its worker worktree");
|
|
12680
|
+
if (JSON.stringify(parseConfig(configSnapshot, configPath)) !== JSON.stringify(config))
|
|
12681
|
+
throw new UsageError("configuration changed during preflight; retry launch with the saved model");
|
|
12682
|
+
}
|
|
12494
12683
|
const root = await io.exec("git", ["rev-parse", "--show-toplevel"], { cwd: io.cwd, timeoutMs: 1e4 });
|
|
12495
12684
|
if (root.code !== 0 || !root.stdout.trim().startsWith("/"))
|
|
12496
12685
|
throw new UsageError("local launch must run in a git repository");
|
|
@@ -12499,7 +12688,7 @@ async function launchLocal(io, config, credentials, args, version, configPath) {
|
|
|
12499
12688
|
const base = remote.code === 0 ? remote.stdout.match(/^ref:\s+refs\/heads\/(\S+)\s+HEAD/m)?.[1] : null;
|
|
12500
12689
|
if (!base)
|
|
12501
12690
|
throw new UsageError("could not read the default branch of origin");
|
|
12502
|
-
const conventions = config.brief.extra ? { path: config.brief.extra, text: await io.readFile(
|
|
12691
|
+
const conventions = config.brief.extra ? { path: config.brief.extra, text: await io.readFile(join6(dirname5(configPath), config.brief.extra)) } : null;
|
|
12503
12692
|
const npm = await checkPublished(version, io.fetch ?? fetch);
|
|
12504
12693
|
if (npm.state === "missing")
|
|
12505
12694
|
throw new UsageError(`armada ${version} is not on npm yet; publish this version before launching local workers`);
|
|
@@ -12510,6 +12699,8 @@ async function launchLocal(io, config, credentials, args, version, configPath) {
|
|
|
12510
12699
|
try {
|
|
12511
12700
|
await runtime.ensureServer();
|
|
12512
12701
|
handle = await runtime.create({ repo, branch, base, ticket: ticketId, secrets: config.secrets.names });
|
|
12702
|
+
if (configSnapshot !== null && io.writeFile)
|
|
12703
|
+
await io.writeFile(join6(handle.path, CONFIG_FILE), configSnapshot);
|
|
12513
12704
|
const b = buildBrief({
|
|
12514
12705
|
config,
|
|
12515
12706
|
ticket,
|
|
@@ -12545,6 +12736,8 @@ async function launchLocal(io, config, credentials, args, version, configPath) {
|
|
|
12545
12736
|
runtime: "herdr",
|
|
12546
12737
|
profile: choice.name,
|
|
12547
12738
|
harness: choice.profile.harness,
|
|
12739
|
+
actualHarness: herdrHarnessKind(choice.profile.harness),
|
|
12740
|
+
harnessDescription: herdrHarnessLabel(choice.profile.harness),
|
|
12548
12741
|
branch,
|
|
12549
12742
|
handle: herdrClaimHandle(handle),
|
|
12550
12743
|
path: handle.path,
|
|
@@ -12552,7 +12745,7 @@ async function launchLocal(io, config, credentials, args, version, configPath) {
|
|
|
12552
12745
|
watch
|
|
12553
12746
|
};
|
|
12554
12747
|
io.stdout(args.json ? `${JSON.stringify(result, null, 2)}
|
|
12555
|
-
` : `Launched ${ticketId} with ${result.
|
|
12748
|
+
` : `Launched ${ticketId} with ${result.harnessDescription} on profile ${choice.name}.
|
|
12556
12749
|
Worktree: ${handle.path}
|
|
12557
12750
|
Handle: ${result.handle}
|
|
12558
12751
|
The worker signs in and claims its ticket from the brief.
|
|
@@ -12565,7 +12758,7 @@ ${watch.line}
|
|
|
12565
12758
|
import { randomUUID } from "node:crypto";
|
|
12566
12759
|
import { rm as rm4 } from "node:fs/promises";
|
|
12567
12760
|
import { hostname, tmpdir as tmpdir2 } from "node:os";
|
|
12568
|
-
import { dirname as dirname6, join as
|
|
12761
|
+
import { dirname as dirname6, join as join7 } from "node:path";
|
|
12569
12762
|
var TRANSIENT = /\bHTTP 5\d\d\b|\b5\d\d (?:Bad Gateway|Service Unavailable|Gateway Time-?out|Internal Server Error)\b|Bad Gateway|Service Unavailable|Gateway Time-?out|ECONNRESET|ETIMEDOUT|connection reset|i\/o timeout|TLS handshake timeout/i;
|
|
12570
12763
|
var tail = (text, lines = 30) => text.trimEnd().split(`
|
|
12571
12764
|
`).slice(-lines).join(`
|
|
@@ -12643,7 +12836,7 @@ function gitRepo(exec, cwd) {
|
|
|
12643
12836
|
},
|
|
12644
12837
|
async testMerge({ branch, base, head, number, commands }) {
|
|
12645
12838
|
await must(["fetch", "--quiet", "origin", branch, `refs/pull/${number}/head`]);
|
|
12646
|
-
const dir =
|
|
12839
|
+
const dir = join7(tmpdir2(), `armada-merge-${number}-${randomUUID().slice(0, 8)}`);
|
|
12647
12840
|
const remove = async () => {
|
|
12648
12841
|
await git(["worktree", "remove", "--force", dir]);
|
|
12649
12842
|
await git(["worktree", "prune"]);
|
|
@@ -12787,7 +12980,7 @@ async function merge(io, config, credentials, a, configPath) {
|
|
|
12787
12980
|
`),
|
|
12788
12981
|
installedSkill: async (name) => {
|
|
12789
12982
|
for (const dir of [AGENTS_SKILLS_DIR, CLAUDE_SKILLS_DIR])
|
|
12790
|
-
if (await io.readFile(
|
|
12983
|
+
if (await io.readFile(join7(repoDir, dir, name, "SKILL.md")) !== null)
|
|
12791
12984
|
return true;
|
|
12792
12985
|
return false;
|
|
12793
12986
|
}
|
|
@@ -12885,7 +13078,7 @@ function renderStatus(r) {
|
|
|
12885
13078
|
out.push(` ${pad(t.id, idWidth)} ${pad(phaseLabel(t), phaseWidth)} ${who} · ${t.lastReport ? `reported ${relative2(t.lastReport, now)}` : `updated ${relative2(t.lastUpdate, now)}`}`);
|
|
12886
13079
|
out.push(`${indent}${truncate(t.title, 90)}${t.spec ? ` [${t.spec}]` : ""}`);
|
|
12887
13080
|
if (t.profile)
|
|
12888
|
-
out.push(`${indent}Profile: ${t.profile}${t.profileReason ? ` — ${t.profileReason}` : ""}`);
|
|
13081
|
+
out.push(`${indent}Profile: ${t.profile}${t.harness ? ` · ${t.harness}` : ""}${t.profileReason ? ` — ${t.profileReason}` : ""}`);
|
|
12889
13082
|
if (t.statusLine?.summary)
|
|
12890
13083
|
out.push(`${indent}“${truncate(t.statusLine.summary, 100)}”`);
|
|
12891
13084
|
if (t.statusLine?.plan)
|
|
@@ -13446,7 +13639,8 @@ var COMMAND_HELP = {
|
|
|
13446
13639
|
A pull request the owner was asked about merges only once they approved
|
|
13447
13640
|
that exact head (or it with only the base merged in).
|
|
13448
13641
|
`,
|
|
13449
|
-
launch: ` launch <ticket> --runtime herdr [--harness claude|codex|opencode]
|
|
13642
|
+
launch: ` launch <ticket> --runtime herdr [--harness claude|codex|opencode|deepseek]
|
|
13643
|
+
deepseek (OpenCode + DeepSeek model) runs a persistent session
|
|
13450
13644
|
[--profile <name> [--reason <why>]] [--validation <n|none>]
|
|
13451
13645
|
Create the ticket's worktree and start a persistent local worker
|
|
13452
13646
|
with its launch-token brief. Profiles follow [[herdr.routing]]
|
|
@@ -13719,7 +13913,7 @@ async function findConfig(io, explicit, command = "status") {
|
|
|
13719
13913
|
return { path, text };
|
|
13720
13914
|
}
|
|
13721
13915
|
for (let dir = resolve3(io.cwd);; dir = dirname8(dir)) {
|
|
13722
|
-
const path =
|
|
13916
|
+
const path = join8(dir, CONFIG_FILE);
|
|
13723
13917
|
const text = await io.readFile(path);
|
|
13724
13918
|
if (text !== null)
|
|
13725
13919
|
return { path, text };
|
|
@@ -14199,6 +14393,7 @@ var code = await run(process.argv.slice(2), {
|
|
|
14199
14393
|
return null;
|
|
14200
14394
|
throw err;
|
|
14201
14395
|
}),
|
|
14396
|
+
writeFile: (path, text) => writeFile3(path, text, "utf8"),
|
|
14202
14397
|
stdout: (t) => process.stdout.write(t),
|
|
14203
14398
|
readBinaryFile: async (path, maxBytes) => {
|
|
14204
14399
|
const file = await open2(path, "r").catch((err) => {
|