@the-vibe-company/armada 0.2.40 → 0.2.42
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 +1 -0
- package/dist/armada.js +101 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -422,6 +422,7 @@ slug = "widgets" # stable id: lowercase letters, digits, dashes
|
|
|
422
422
|
program_root = "ABC-1" # Linear issue at the root of the program (required)
|
|
423
423
|
language = "en" # owner-facing language (default "en"; output is English for now)
|
|
424
424
|
ready_label = "ready-for-agent" # marks a ticket an agent may take (default)
|
|
425
|
+
parked_label = "parked" # marks a ticket parked on purpose: never listed as work to start (default)
|
|
425
426
|
|
|
426
427
|
[tracker.labels]
|
|
427
428
|
phase_group = "Agent phase" # single-select label group for the agent phase (default)
|
package/dist/armada.js
CHANGED
|
@@ -965,7 +965,7 @@ function inFlight(m, comments, opts) {
|
|
|
965
965
|
};
|
|
966
966
|
return m.program.filter((i) => m.isLeaf(i) && !isClosed(i) && held(i)).map((i) => buildLane(m, comments, i, opts)).sort((a, b) => PHASE_RANK[a.phase] - PHASE_RANK[b.phase] || a.issue.id.localeCompare(b.issue.id, "en", { numeric: true }));
|
|
967
967
|
}
|
|
968
|
-
function frontier(m,
|
|
968
|
+
function frontier(m, labels) {
|
|
969
969
|
const dependents = new Map;
|
|
970
970
|
for (const i of m.program)
|
|
971
971
|
for (const b of i.blockedBy)
|
|
@@ -979,11 +979,11 @@ function frontier(m, readyLabel) {
|
|
|
979
979
|
return seen;
|
|
980
980
|
};
|
|
981
981
|
const critical = criticalIds(m);
|
|
982
|
-
return m.program.filter((i) => m.isLeaf(i) && isNotStarted(i) && !i.agentPhase && m.openBlockersOf(i).length === 0 && !i.prs.some((p) => p.state === "open")).map((issue) => {
|
|
982
|
+
return m.program.filter((i) => m.isLeaf(i) && isNotStarted(i) && !i.agentPhase && !i.labels.includes(labels.parked) && m.openBlockersOf(i).length === 0 && !i.prs.some((p) => p.state === "open")).map((issue) => {
|
|
983
983
|
const spec = m.specOf(issue.id);
|
|
984
984
|
const unlocksAll = [...transitive(issue.id)];
|
|
985
985
|
const unlocksNow = (dependents.get(issue.id) ?? []).filter((d) => !isClosed(d) && m.openBlockersOf(d).every((b) => b === issue.id)).map((d) => d.id);
|
|
986
|
-
const readyForAgent = issue.labels.includes(
|
|
986
|
+
const readyForAgent = issue.labels.includes(labels.ready) && issue.statusType !== "triage";
|
|
987
987
|
const onCriticalPath = critical.has(issue.id);
|
|
988
988
|
const score = (readyForAgent ? 1000 : 0) + (onCriticalPath ? 300 : 0) + unlocksAll.length * 20 + unlocksNow.length * 10 - (spec?.ordinal ?? 99);
|
|
989
989
|
return {
|
|
@@ -2094,6 +2094,7 @@ var HERDR_HARNESSES = ["claude", "codex", "opencode", "deepseek"];
|
|
|
2094
2094
|
var CONFIG_DEFAULTS = {
|
|
2095
2095
|
language: "en",
|
|
2096
2096
|
readyLabel: "ready-for-agent",
|
|
2097
|
+
parkedLabel: "parked",
|
|
2097
2098
|
phaseGroup: "Agent phase",
|
|
2098
2099
|
runtimeGroup: "Agent runtime",
|
|
2099
2100
|
runtimes: ["Claude Code", "Codex", "Conductor", "Herdr"],
|
|
@@ -2215,7 +2216,7 @@ function parseConfig(text, source = CONFIG_FILE) {
|
|
|
2215
2216
|
const herdrProfilesT = isTable(herdrProfilesRaw) ? herdrProfilesRaw : {};
|
|
2216
2217
|
const known = [
|
|
2217
2218
|
["project", project, ["name", "slug"]],
|
|
2218
|
-
["tracker", tracker, ["program_root", "language", "ready_label", "labels"]],
|
|
2219
|
+
["tracker", tracker, ["program_root", "language", "ready_label", "parked_label", "labels"]],
|
|
2219
2220
|
["tracker.labels", labelsT, ["phase_group", "runtime_group", "runtimes"]],
|
|
2220
2221
|
["github", github, ["repository"]],
|
|
2221
2222
|
["gates", gatesT, ["required_checks", "local_commands"]],
|
|
@@ -2503,6 +2504,7 @@ function parseConfig(text, source = CONFIG_FILE) {
|
|
|
2503
2504
|
}),
|
|
2504
2505
|
language: str(tracker, "tracker", "language", { default: CONFIG_DEFAULTS.language }),
|
|
2505
2506
|
readyLabel: str(tracker, "tracker", "ready_label", { default: CONFIG_DEFAULTS.readyLabel }),
|
|
2507
|
+
parkedLabel: str(tracker, "tracker", "parked_label", { default: CONFIG_DEFAULTS.parkedLabel }),
|
|
2506
2508
|
labels: {
|
|
2507
2509
|
phaseGroup: str(labelsT, "tracker.labels", "phase_group", { default: CONFIG_DEFAULTS.phaseGroup }),
|
|
2508
2510
|
runtimeGroup: str(labelsT, "tracker.labels", "runtime_group", { default: CONFIG_DEFAULTS.runtimeGroup }),
|
|
@@ -2550,6 +2552,7 @@ slug = ${q(p.slug)} # stable id: lowercase letters, digits and dashes
|
|
|
2550
2552
|
program_root = ${q(p.programRoot)} # Linear issue at the root of the program
|
|
2551
2553
|
language = "en" # language of owner-facing output
|
|
2552
2554
|
ready_label = "ready-for-agent"
|
|
2555
|
+
# parked_label = "parked" # a ticket with this label is parked on purpose: never listed as work to start
|
|
2553
2556
|
|
|
2554
2557
|
[tracker.labels]
|
|
2555
2558
|
phase_group = "Agent phase"
|
|
@@ -9943,7 +9946,10 @@ function buildStatus({
|
|
|
9943
9946
|
const issue = issues.find((i) => i.id === l.ticket);
|
|
9944
9947
|
return { ...l, title: issue?.title ?? null, url: issue?.url ?? null, detail: notStartedBody(l, now) };
|
|
9945
9948
|
}),
|
|
9946
|
-
frontier: frontier(m,
|
|
9949
|
+
frontier: frontier(m, {
|
|
9950
|
+
ready: config.tracker.readyLabel,
|
|
9951
|
+
parked: config.tracker.parkedLabel ?? CONFIG_DEFAULTS.parkedLabel
|
|
9952
|
+
}).filter((c) => !phaseOf.has(c.issue.id)).map((c) => ({
|
|
9947
9953
|
id: c.issue.id,
|
|
9948
9954
|
title: c.issue.title,
|
|
9949
9955
|
url: c.issue.url,
|
|
@@ -10150,7 +10156,7 @@ ${attachments.join(`
|
|
|
10150
10156
|
};
|
|
10151
10157
|
}
|
|
10152
10158
|
// package.json
|
|
10153
|
-
var version = "0.2.
|
|
10159
|
+
var version = "0.2.42";
|
|
10154
10160
|
|
|
10155
10161
|
// src/attach.ts
|
|
10156
10162
|
import { resolve } from "node:path";
|
|
@@ -10687,6 +10693,68 @@ async function logout(io) {
|
|
|
10687
10693
|
return 0;
|
|
10688
10694
|
}
|
|
10689
10695
|
|
|
10696
|
+
// src/opencode-model.ts
|
|
10697
|
+
import { stripVTControlCharacters } from "node:util";
|
|
10698
|
+
function modelsFrom(raw) {
|
|
10699
|
+
const models = [];
|
|
10700
|
+
for (const match of stripVTControlCharacters(raw).matchAll(/^([^\s/#]+\/[^\s#]+)\r?\n(\{\r?\n[\s\S]*?^\})/gm)) {
|
|
10701
|
+
try {
|
|
10702
|
+
const metadata = JSON.parse(match[2] ?? "");
|
|
10703
|
+
const id = match[1] ?? "";
|
|
10704
|
+
if (metadata && `${metadata.providerID}/${metadata.id}` === id && typeof metadata.name === "string" && metadata.name.trim() && !/[\r\n]/.test(metadata.name) && stripVTControlCharacters(metadata.name) === metadata.name)
|
|
10705
|
+
models.push({ id, name: metadata.name });
|
|
10706
|
+
} catch {}
|
|
10707
|
+
}
|
|
10708
|
+
return models;
|
|
10709
|
+
}
|
|
10710
|
+
function selectedModel(pane, models) {
|
|
10711
|
+
const lines = stripVTControlCharacters(pane).split(`
|
|
10712
|
+
`);
|
|
10713
|
+
const footers = lines.flatMap((line, index) => {
|
|
10714
|
+
if (!/^\s*╹/.test(lines[index + 1] ?? ""))
|
|
10715
|
+
return [];
|
|
10716
|
+
const match = line.trim().match(/^(?:[┃│]\s*)?[A-Z][\w-]*(?:\s+auto)?(?:\s+·)?\s+(.+)$/);
|
|
10717
|
+
return match?.[1] ? [match[1]] : [];
|
|
10718
|
+
});
|
|
10719
|
+
const candidates = models.filter((model) => footers.some((footer) => footer.startsWith(`${model.name} `) || footer.startsWith(`${model.id} `)));
|
|
10720
|
+
const ids = [...new Set(candidates.map((model) => model.id))];
|
|
10721
|
+
return ids.length === 1 ? ids[0] ?? null : null;
|
|
10722
|
+
}
|
|
10723
|
+
async function verifyOpenCodeModel(io, pane, expected) {
|
|
10724
|
+
const failure = () => new UsageError(`could not verify OpenCode model ${expected} from its pane; launch stopped`);
|
|
10725
|
+
if (!io.exec)
|
|
10726
|
+
throw failure();
|
|
10727
|
+
const metadata = await io.exec("opencode", ["models", "--verbose"], { cwd: io.cwd, timeoutMs: 5000 }).catch(() => null);
|
|
10728
|
+
const models = metadata?.code === 0 ? modelsFrom(metadata.stdout) : [];
|
|
10729
|
+
if (!models.some((model) => model.id === expected))
|
|
10730
|
+
throw failure();
|
|
10731
|
+
const now = io.now ?? (() => new Date);
|
|
10732
|
+
const deadline = now().getTime() + 5000;
|
|
10733
|
+
for (let attempt = 0;attempt < 20; attempt++) {
|
|
10734
|
+
const remaining = deadline - now().getTime();
|
|
10735
|
+
if (remaining <= 0)
|
|
10736
|
+
break;
|
|
10737
|
+
const reading = await io.exec("herdr", ["pane", "read", pane, "--source", "visible"], {
|
|
10738
|
+
cwd: io.cwd,
|
|
10739
|
+
timeoutMs: Math.min(1000, remaining)
|
|
10740
|
+
}).catch(() => null);
|
|
10741
|
+
if (reading?.code !== 0)
|
|
10742
|
+
throw failure();
|
|
10743
|
+
const text = stripVTControlCharacters(reading.stdout);
|
|
10744
|
+
if (/ProviderModelNotFoundError|Model not found:/i.test(text))
|
|
10745
|
+
throw new UsageError(`OpenCode could not load profile model ${expected}; launch stopped`);
|
|
10746
|
+
const selected = selectedModel(text, models);
|
|
10747
|
+
if (selected === expected)
|
|
10748
|
+
return;
|
|
10749
|
+
if (selected)
|
|
10750
|
+
throw new UsageError(`OpenCode model differs from profile ${expected}; launch stopped`);
|
|
10751
|
+
const delay = Math.min(250, deadline - now().getTime());
|
|
10752
|
+
if (delay > 0)
|
|
10753
|
+
await (io.sleep ?? ((ms) => new Promise((done) => setTimeout(done, ms))))(delay);
|
|
10754
|
+
}
|
|
10755
|
+
throw failure();
|
|
10756
|
+
}
|
|
10757
|
+
|
|
10690
10758
|
// src/herdr.ts
|
|
10691
10759
|
class HerdrError extends UsageError {
|
|
10692
10760
|
code;
|
|
@@ -10697,7 +10765,7 @@ class HerdrError extends UsageError {
|
|
|
10697
10765
|
}
|
|
10698
10766
|
var harnessArgs = (p) => [
|
|
10699
10767
|
"--model",
|
|
10700
|
-
|
|
10768
|
+
p.model,
|
|
10701
10769
|
...p.harness === "codex" ? ["-c", `model_reasoning_effort=${JSON.stringify(p.effort)}`] : p.harness === "claude" ? ["--effort", p.effort] : [],
|
|
10702
10770
|
...p.extraArgs
|
|
10703
10771
|
];
|
|
@@ -10857,6 +10925,18 @@ class Herdr {
|
|
|
10857
10925
|
...harnessArgs(profile)
|
|
10858
10926
|
]);
|
|
10859
10927
|
this.checkAgent(r, handle);
|
|
10928
|
+
if (herdrHarnessKind(profile.harness) === "opencode") {
|
|
10929
|
+
try {
|
|
10930
|
+
await verifyOpenCodeModel(this.io, handle.pane, profile.model);
|
|
10931
|
+
} catch (error) {
|
|
10932
|
+
let closed = false;
|
|
10933
|
+
try {
|
|
10934
|
+
await this.call(["pane", "close", handle.pane]);
|
|
10935
|
+
closed = true;
|
|
10936
|
+
} catch {}
|
|
10937
|
+
throw new UsageError(`${error instanceof UsageError ? error.message : "could not verify OpenCode model"}; ${closed ? "worker pane closed" : "could not close worker pane; close it with herdr pane close"}. No worker brief was sent.`);
|
|
10938
|
+
}
|
|
10939
|
+
}
|
|
10860
10940
|
}
|
|
10861
10941
|
async prompt(handle, prompt) {
|
|
10862
10942
|
const r = await this.call([
|
|
@@ -11897,7 +11977,7 @@ ${next.line}
|
|
|
11897
11977
|
import { join as join4 } from "node:path";
|
|
11898
11978
|
|
|
11899
11979
|
// src/local-tools.ts
|
|
11900
|
-
import { stripVTControlCharacters } from "node:util";
|
|
11980
|
+
import { stripVTControlCharacters as stripVTControlCharacters2 } from "node:util";
|
|
11901
11981
|
var MINIMUM_HERDR_VERSION = "0.9.1";
|
|
11902
11982
|
var TOOLS = {
|
|
11903
11983
|
herdr: { command: "herdr", install: "curl -fsSL https://herdr.dev/install.sh | sh" },
|
|
@@ -12013,7 +12093,7 @@ async function openCodeModels(io) {
|
|
|
12013
12093
|
if (result?.code !== 0)
|
|
12014
12094
|
return null;
|
|
12015
12095
|
return [
|
|
12016
|
-
...new Set(
|
|
12096
|
+
...new Set(stripVTControlCharacters2(result.stdout).split(`
|
|
12017
12097
|
`).map((line) => line.trim()).filter((line) => /^[^\s/#]+\/[^\s#]+$/.test(line)))
|
|
12018
12098
|
];
|
|
12019
12099
|
}
|
|
@@ -12508,7 +12588,18 @@ async function localRuntimeChecks(io, config, options = { readOnly: true }) {
|
|
|
12508
12588
|
return [];
|
|
12509
12589
|
const result = await offerLocalInstalls(io, await detectLocalTools(io, harnesses, config ? localModelProfiles(config) : []), options);
|
|
12510
12590
|
const selected = await offerLocalModels(io, result, options.configPath ?? join4(io.cwd, CONFIG_FILE), options);
|
|
12511
|
-
return [
|
|
12591
|
+
return [
|
|
12592
|
+
...selected.checks,
|
|
12593
|
+
...harnesses.some((harness) => harness === "opencode" || harness === "deepseek") ? [
|
|
12594
|
+
{
|
|
12595
|
+
id: "local-opencode-effort",
|
|
12596
|
+
level: "warning",
|
|
12597
|
+
message: "effort is not applied for OpenCode (including DeepSeek); the interactive UI uses its default variant",
|
|
12598
|
+
fix: null
|
|
12599
|
+
}
|
|
12600
|
+
] : [],
|
|
12601
|
+
...harnesses.includes("deepseek") ? [await dshInformation(io)] : []
|
|
12602
|
+
];
|
|
12512
12603
|
}
|
|
12513
12604
|
async function buildDoctor(io, armadaVersion, options = { readOnly: true }) {
|
|
12514
12605
|
const root = (io.exec ? await gitRoot(io.exec, io.cwd) : null) ?? io.cwd;
|