@the-vibe-company/armada 0.2.16 → 0.2.17
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 +2 -2
- package/dist/armada.js +91 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -89,8 +89,8 @@ armada brief ABC-12 --profile codex --reason "a back-end bug behind a web label"
|
|
|
89
89
|
- **A version npm serves.** The brief pins the coordinator's Armada version, after one request to npm (3 s at most, beside the Linear reads). When npm does not serve it yet (a release still publishing, a checkout ahead of npm), the brief pins the newest published version and warns; offline, it only warns. Merging or releasing the ticket ends the worker's session, and Organization > Workers on the dashboard revokes one.
|
|
90
90
|
- The settings give the profile's agent, model and effort from `[conductor]` in `armada.toml`, and the environment variables: `ARMADA_TICKET=<ticket>`, and, only without a launch token, `LINEAR_API_KEY` (required). Each shows whether this shell has it. No value is ever printed.
|
|
91
91
|
- A profile with `runtime = "claude-code"` routes the launch to the `armada-runtime-claude-code` skill: the `Runtime:` line names the skill, the claim runs `--runtime claude-code` with the subagent's name as its handle (the ticket id in lowercase), and the prompt first makes the worker check it runs in its own worktree. The Agent tool applies no effort; the brief says so.
|
|
92
|
-
-
|
|
93
|
-
- `--profile` overrides
|
|
92
|
+
- Label rules win: the first `[[conductor.routing]]` rule with a label the ticket carries (case, spaces and punctuation ignored) selects its profile. Otherwise, profiles with `when = "front end: dashboard pages, components, styles, design, UI copy"` or `when = "back end: CLI, core rules, API, database, migrations, tests, docs"` ask the coordinator to choose. `armada brief ABC-12` prints **Choose a profile**, the ticket's title and In short, and every profile's rule; it creates no launch token or watch entry. `--json` returns the choice information; `--prompt` refuses until a profile is chosen. Read the ticket and parent spec, choose the rule covering most files/work (explain mixed work), then run `armada brief ABC-12 --profile codex --reason "mostly CLI and core rules" --prompt`. Armada does not call a model to classify tickets. Projects without `when` keep their old `conductor.default_profile` or only-profile fallback.
|
|
93
|
+
- `--profile` also overrides a label route. `--reason` is required for semantic choices and, when routing rules exist, overrides of the routed profile. Keep both flags on subsequent `--prompt` calls. The generated claim command carries the reason; the claim comment, `armada status` and dashboard agent Profile row show it. An unknown profile exits 2. The dashboard's ready-to-launch row shows a label-routed profile or "chosen by the coordinator"; Launch still sends an inbox request, not a runtime call.
|
|
94
94
|
|
|
95
95
|
## Work on a ticket (workers)
|
|
96
96
|
|
package/dist/armada.js
CHANGED
|
@@ -1130,7 +1130,7 @@ function parseConfig(text, source = CONFIG_FILE) {
|
|
|
1130
1130
|
problems.push(`"${path}" is not a usable profile name`);
|
|
1131
1131
|
continue;
|
|
1132
1132
|
}
|
|
1133
|
-
known.push([path, p, ["runtime", "agent", "model", "effort", "fast_mode"]]);
|
|
1133
|
+
known.push([path, p, ["runtime", "agent", "model", "effort", "fast_mode", "when"]]);
|
|
1134
1134
|
if (p.fast_mode !== undefined && typeof p.fast_mode !== "boolean")
|
|
1135
1135
|
problems.push(`"${path}.fast_mode" must be true or false`);
|
|
1136
1136
|
const runtime = p.runtime ?? "conductor";
|
|
@@ -1139,6 +1139,7 @@ function parseConfig(text, source = CONFIG_FILE) {
|
|
|
1139
1139
|
if (runtime === "claude-code" && p.agent !== undefined && p.agent !== "claude")
|
|
1140
1140
|
problems.push(`"${path}.agent" must be "claude" with runtime = "claude-code"`);
|
|
1141
1141
|
profiles[name] = {
|
|
1142
|
+
...p.when !== undefined ? { when: str(p, path, "when") } : {},
|
|
1142
1143
|
runtime: PROFILE_RUNTIMES.includes(runtime) ? runtime : "conductor",
|
|
1143
1144
|
agent: str(p, path, "agent"),
|
|
1144
1145
|
model: str(p, path, "model"),
|
|
@@ -1174,7 +1175,7 @@ function parseConfig(text, source = CONFIG_FILE) {
|
|
|
1174
1175
|
if (ok && profile)
|
|
1175
1176
|
routing.push({ labels: labels.map((l) => l.trim()), profile });
|
|
1176
1177
|
}
|
|
1177
|
-
if (Array.isArray(routingRaw) && routingRaw.length && conductorT.default_profile === undefined)
|
|
1178
|
+
if (Array.isArray(routingRaw) && routingRaw.length && conductorT.default_profile === undefined && !Object.values(profiles).some((profile) => profile.when))
|
|
1178
1179
|
problems.push(`"conductor.default_profile" is required with [[conductor.routing]], for tickets no rule matches`);
|
|
1179
1180
|
for (const [path, t, keys] of known)
|
|
1180
1181
|
for (const key of Object.keys(t))
|
|
@@ -1330,19 +1331,22 @@ coordinator_minutes = 10 # an inbox item open longer than this shows "waiting fo
|
|
|
1330
1331
|
# How \`armada brief\` launches workers on Conductor. Every value is passed explicitly;
|
|
1331
1332
|
# \`conductor model\` lists each agent's model ids and effort levels.
|
|
1332
1333
|
[conductor]
|
|
1333
|
-
default_profile = "opus" #
|
|
1334
|
+
default_profile = "opus" # used only when no profile has a when rule
|
|
1334
1335
|
|
|
1335
1336
|
[conductor.profiles.opus]
|
|
1337
|
+
when = "front end: dashboard pages, components, styles, design, UI copy"
|
|
1336
1338
|
agent = "claude"
|
|
1337
1339
|
model = "opus-5-5-1m"
|
|
1338
1340
|
effort = "high"
|
|
1339
1341
|
|
|
1340
1342
|
[conductor.profiles.codex]
|
|
1343
|
+
when = "back end: CLI, core rules, API, database, migrations, tests, docs"
|
|
1341
1344
|
agent = "codex"
|
|
1342
1345
|
model = "gpt-6.1-sol"
|
|
1343
1346
|
effort = "high"
|
|
1344
1347
|
|
|
1345
1348
|
[conductor.profiles.debug]
|
|
1349
|
+
when = "a bug to diagnose"
|
|
1346
1350
|
agent = "codex"
|
|
1347
1351
|
model = "gpt-6.1-sol"
|
|
1348
1352
|
effort = "xhigh"
|
|
@@ -1757,12 +1761,15 @@ function parseClaim(body, at, author) {
|
|
|
1757
1761
|
const v = line.match(new RegExp(`(?:${k})[*_\`]*\\s*:\\s*([^·|]+)`, "i"))?.[1];
|
|
1758
1762
|
return v && trimMarks(v) || null;
|
|
1759
1763
|
};
|
|
1764
|
+
const profileReason = body.split(`
|
|
1765
|
+
`).map(unescapeMarkdown).find((entry) => entry.startsWith("Profile reason: "))?.slice("Profile reason: ".length).trim();
|
|
1760
1766
|
return {
|
|
1761
1767
|
runtime: field("runtime"),
|
|
1762
1768
|
session: field("session"),
|
|
1763
1769
|
branch: field("branch|branche"),
|
|
1764
1770
|
startedAt: field("started|démarré|demarre"),
|
|
1765
1771
|
profile: field("profile"),
|
|
1772
|
+
...profileReason ? { profileReason } : {},
|
|
1766
1773
|
at,
|
|
1767
1774
|
author
|
|
1768
1775
|
};
|
|
@@ -2400,6 +2407,8 @@ var checkProblems = (checks, requiredChecks) => checkIssues(checks, requiredChec
|
|
|
2400
2407
|
class ProfileError extends Error {
|
|
2401
2408
|
name = "ProfileError";
|
|
2402
2409
|
}
|
|
2410
|
+
var hasProfileRules = (config) => Object.values(config.conductor.profiles).some((profile) => !!profile.when);
|
|
2411
|
+
var profileChoiceHint = (ticket) => `Choose a profile: read the ticket and its parent, match the profiles' when rules, then run armada brief ${ticket} --profile <name> --reason "<why>"`;
|
|
2403
2412
|
function routeProfile(config, labels) {
|
|
2404
2413
|
const { routing, defaultProfile, profiles } = config.conductor;
|
|
2405
2414
|
for (const [i, rule] of routing.entries()) {
|
|
@@ -2408,6 +2417,8 @@ function routeProfile(config, labels) {
|
|
|
2408
2417
|
if (label !== undefined)
|
|
2409
2418
|
return { name: rule.profile, source: "rule", rule: { index: i + 1, labels: rule.labels, label } };
|
|
2410
2419
|
}
|
|
2420
|
+
if (hasProfileRules(config))
|
|
2421
|
+
return null;
|
|
2411
2422
|
if (defaultProfile)
|
|
2412
2423
|
return { name: defaultProfile, source: "default", rule: null };
|
|
2413
2424
|
const names = Object.keys(profiles);
|
|
@@ -2431,6 +2442,9 @@ function chooseProfile(config, input) {
|
|
|
2431
2442
|
const { profiles } = config.conductor;
|
|
2432
2443
|
const reason = input.reason?.replace(/\s+/g, " ").trim() || null;
|
|
2433
2444
|
const route = routeProfile(config, input.labels);
|
|
2445
|
+
const semantic = !route && hasProfileRules(config);
|
|
2446
|
+
if (semantic && (input.requested === null || !reason))
|
|
2447
|
+
throw new ProfileError(profileChoiceHint(input.ticket));
|
|
2434
2448
|
if (input.requested === null) {
|
|
2435
2449
|
if (route && Object.hasOwn(profiles, route.name))
|
|
2436
2450
|
return {
|
|
@@ -2461,7 +2475,7 @@ function chooseProfile(config, input) {
|
|
|
2461
2475
|
};
|
|
2462
2476
|
if (route && !reason && config.conductor.routing.length)
|
|
2463
2477
|
throw new ProfileError(`${input.ticket} is routed to "${route.name}" by ${describeRoute(route, config)}; say why "${name}" instead with --reason "<why>"`);
|
|
2464
|
-
const why = `--profile${route ? `, instead of "${route.name}" from ${describeRoute(route, config)}` : ""}${reason ? `: ${reason}` : ""}`;
|
|
2478
|
+
const why = semantic ? `Chosen by the coordinator: ${reason}` : `--profile${route ? `, instead of "${route.name}" from ${describeRoute(route, config)}` : ""}${reason ? `: ${reason}` : ""}`;
|
|
2465
2479
|
return { name, profile, source: "requested", rule: null, routed: route?.name ?? null, reason, why };
|
|
2466
2480
|
}
|
|
2467
2481
|
|
|
@@ -2576,8 +2590,10 @@ function claimLine(o) {
|
|
|
2576
2590
|
if (!p)
|
|
2577
2591
|
return line;
|
|
2578
2592
|
const settings = `agent ${p.profile.agent}, model ${p.profile.model}, effort ${p.profile.effort}${p.profile.fastMode ? ", fast mode" : ""}`;
|
|
2593
|
+
const why = p.why.startsWith("Chosen by the coordinator:") ? p.why : `chosen by ${p.why}`;
|
|
2579
2594
|
return `${line} · profile: ${p.name}
|
|
2580
|
-
Profile: ${p.name} (${settings}),
|
|
2595
|
+
Profile: ${p.name} (${settings}), ${why}${p.reason ? `
|
|
2596
|
+
Profile reason: ${p.reason}` : ""}`;
|
|
2581
2597
|
}
|
|
2582
2598
|
async function claimTicket(ctx, input) {
|
|
2583
2599
|
const { config, linear } = ctx;
|
|
@@ -3116,8 +3132,37 @@ async function loadBrief(config, opts) {
|
|
|
3116
3132
|
]);
|
|
3117
3133
|
if (!ticket)
|
|
3118
3134
|
throw new Refusal(`ticket ${opts.ticket} not found in Linear`, "armada status, to see the tickets of the program");
|
|
3119
|
-
|
|
3120
|
-
|
|
3135
|
+
if (opts.profile === null && hasProfileRules(config) && !routeProfile(config, ticket.labels))
|
|
3136
|
+
return {
|
|
3137
|
+
ticket: {
|
|
3138
|
+
id: ticket.id,
|
|
3139
|
+
title: ticket.title,
|
|
3140
|
+
url: ticket.url,
|
|
3141
|
+
inShort: ticket.description.match(/^## In short[^\S\n]*\n([\s\S]*)/m)?.[1]?.split(/^## |^---\s*$/m)[0]?.trim() ?? ""
|
|
3142
|
+
},
|
|
3143
|
+
parent: ticket.parent,
|
|
3144
|
+
selection: {
|
|
3145
|
+
profiles: Object.entries(config.conductor.profiles).map(([name, profile]) => ({
|
|
3146
|
+
name,
|
|
3147
|
+
when: profile.when ?? null
|
|
3148
|
+
})),
|
|
3149
|
+
hint: profileChoiceHint(ticket.id)
|
|
3150
|
+
},
|
|
3151
|
+
warnings: [...new Set([...ticket.warnings, ...program.warnings])]
|
|
3152
|
+
};
|
|
3153
|
+
try {
|
|
3154
|
+
chooseProfile(config, {
|
|
3155
|
+
ticket: ticket.id,
|
|
3156
|
+
labels: ticket.labels,
|
|
3157
|
+
requested: opts.profile,
|
|
3158
|
+
reason: opts.reason ?? null
|
|
3159
|
+
});
|
|
3160
|
+
} catch (err) {
|
|
3161
|
+
if (err instanceof ProfileError)
|
|
3162
|
+
throw new BriefError(err.message);
|
|
3163
|
+
throw err;
|
|
3164
|
+
}
|
|
3165
|
+
const launch = await launchForBrief(ticket, opts.launch);
|
|
3121
3166
|
const made = launch && "token" in launch ? launch : null;
|
|
3122
3167
|
const missed = launch && "reason" in launch ? launch : null;
|
|
3123
3168
|
if (missed?.warn)
|
|
@@ -3138,6 +3183,9 @@ async function loadBrief(config, opts) {
|
|
|
3138
3183
|
now: now()
|
|
3139
3184
|
});
|
|
3140
3185
|
}
|
|
3186
|
+
async function launchForBrief(ticket, launch) {
|
|
3187
|
+
return ticket.statusType !== "completed" && ticket.statusType !== "canceled" && launch ? launch(ticket.id) : null;
|
|
3188
|
+
}
|
|
3141
3189
|
// ../core/src/credentials.ts
|
|
3142
3190
|
var DEFAULT_ARMADA_API_URL = "https://armada.thevibecompany.co";
|
|
3143
3191
|
var SESSION_TOKEN_VARIABLE = "ARMADA_SESSION_TOKEN";
|
|
@@ -5150,12 +5198,12 @@ A coordinator may start cold, on a laptop or in a fresh cloud session, with noth
|
|
|
5150
5198
|
2. **Answer what waits for you first.** For each question in \`armada inbox\`: decide it, or escalate it to the owner when it is a product decision and wait for theirs. For each \`plan\` item: read the full plan, approve it or give concrete amendments. Deliver the decision in the worker's session with the runtime guide's *message* section, then record it with \`armada answer <item> "approved"\` or \`armada answer <item> "<amendments and reason>"\`. The worker resumes with \`implementing\` on approval, or returns to \`planning\` and submits a revised plan. \`armada answer\` only records; it never reaches the worker. Decide reversible choices yourself and prefer the option that keeps behaviour observable. When two workers need the same shared resource (a migration slot, a generated file, a version number), set the rule once and tell both. A message the worker did not ask for (main moved, bring it in) takes the same path: deliver it with the runtime guide, then \`armada answer --note <ticket> "<message>"\`. Done when the inbox shows no open question or plan.
|
|
5151
5199
|
3. **Carry out the owner's dashboard requests.** They are the owner's word, signed with their name; they never reached a worker.
|
|
5152
5200
|
- \`answer-request\` (it names the question or plan it answers, \`answers #<id>\`): deliver its text in the worker's session with the runtime guide's *message* section, as the owner's answer or plan approval, then \`armada answer <request id> "<the text you delivered>"\`. That resolves the request and its question or plan, and the ticket names who answered. If the item is gone (the worker was released or changed phase), \`armada answer <request id> "<why>"\` closes it.
|
|
5153
|
-
- \`launch-request
|
|
5201
|
+
- \`launch-request\`: launch the ticket as in step 5. A request may name a label-routed profile or one the owner chose; otherwise choose from the profiles' \`when\` rules. Pass \`--profile\` and \`--reason\` when a choice or override is needed. The worker's \`armada claim\` resolves the request and posts who asked. If the ticket must not start (it collides with work in flight, or its plan changed), decline it: \`armada answer <request id> "<why>"\`, and tell the owner in your report.
|
|
5154
5202
|
Done when the inbox shows no open request.
|
|
5155
5203
|
4. **Check silent workers and workers that never started** with the runtime guide's *status* section. A worker that is still working gets a nudge to report; a worker that died is relaunched or its ticket released. A \`not-started\` entry is a worker launched that has not claimed after \`[policy] not_started_minutes\` (10 by default); it says whether the worker never used its launch token (it never reached its \`armada login\` line: an install that failed, a prompt cut short) or signed in and stopped before its claim. Read its session: a worker stuck on a setup choice gets a message to take the safe option and go on; one that is gone is launched again with a new brief, or its launch revoked on the dashboard's Workers page. The entry clears on the claim.
|
|
5156
5204
|
5. **Launch ready tickets** that do not collide with work in flight, one at a time:
|
|
5157
5205
|
- pick the ticket from the frontier in \`armada status\`;
|
|
5158
|
-
- run \`armada brief <ticket>\` and resolve its warnings.
|
|
5206
|
+
- run \`armada brief <ticket>\` and resolve its warnings. A matching \`[[conductor.routing]]\` label rule wins. Otherwise, when profiles have \`when\` rules, the brief prints **Choose a profile** and mints no launch token. Read the ticket and its parent spec; match each profile's plain-language rule and prefer the one covering most files the ticket will change. If it spans front end and back end, choose where most of the work is and say so. Run \`armada brief <ticket> --profile <name> --reason "<why>"\`, naming the files or work that justify the choice. Armada never calls a model to classify tickets. Only projects without \`when\` rules fall back to \`default_profile\` (or their only profile). Override a matching label rule only when the labels mislead, with the same reasoned command. Keep \`--profile\` and \`--reason\` on every subsequent \`--prompt\` call; the reason reaches the worker's claim, status and agent page;
|
|
5159
5207
|
- write the prompt with \`armada brief <ticket> --prompt > <file>\`. **The launch message is that \`--prompt\` output, never text cut from the human view or \`--json\`**: those show the token masked as \`armada_launch_••••\`, which signs nobody in. Add what only you know: which parallel workers touch neighbouring code and where the boundary is, and decisions not yet on the ticket. The brief already says whether the plan needs approval (\`[policy] plans\`, or the ticket's label) and ends with the project's conventions (\`[brief] extra\`): put a note every worker needs in that file, not in each prompt;
|
|
5160
5208
|
- launch it with the runtime guide's *launch* section, passing the profile's values. When the brief's \`Launch:\` line says the prompt carries a one-time token, pass no key: the worker signs in with it. When it says there is none, fix the reason (usually your sign-in) and brief again, rather than pass keys; the token works once, within the hour, so brief right before the launch;
|
|
5161
5209
|
- check the claim: \`armada status\` shows the ticket in flight, phase \`planning\`, with the handle the runtime returned. Done when every launched ticket is In Progress with a claim.
|
|
@@ -5202,7 +5250,7 @@ Armada never calls a runtime. This guide tells a coordinator running inside Clau
|
|
|
5202
5250
|
## Launch
|
|
5203
5251
|
|
|
5204
5252
|
1. Pick a ready ticket from \`armada status\` that does not collide with work in flight.
|
|
5205
|
-
2. Run \`armada brief ABC-12\`
|
|
5253
|
+
2. Run \`armada brief ABC-12\`, right before the launch. A matching label rule wins. If it prints **Choose a profile**, read the ticket and parent, match the profiles' \`when\` rules by most files/work and rerun with \`--profile <name> --reason "<why>"\`. Mixed front-end/back-end work: choose the larger part and say why. Use those flags also for a label-route override and keep them on every subsequent \`--prompt\` call. Its \`Runtime:\` line must say \`claude-code\`: the profile has \`runtime = "claude-code"\` in \`armada.toml\`. Read the profile (model), the \`Launch:\` line and the warnings, and resolve every warning first. The profile's effort is not applied by the Agent tool; a worker that needs a set effort goes to Conductor.
|
|
5206
5254
|
- \`Launch: one-time token in the prompt\` is the normal case. \`Launch: no launch token (…)\` says why: usually \`armada login\`, then brief again.
|
|
5207
5255
|
3. Read the prompt: \`armada brief ABC-12 --prompt\`. **The launch message is that \`--prompt\` output, and only it**: the human view and \`--json\` mask the token as \`armada_launch_••••\`, which signs nobody in. The token in it works once, within the hour: brief again when that hour has passed before the launch. Add what only you know (the boundary with a parallel worker, a decision not yet on the ticket) at the end.
|
|
5208
5256
|
4. Launch with the Agent tool, every value set:
|
|
@@ -5295,7 +5343,7 @@ A subagent launched without \`isolation: "worktree"\` runs in your checkout. The
|
|
|
5295
5343
|
`;
|
|
5296
5344
|
|
|
5297
5345
|
// ../../skills/armada-runtime-conductor/SKILL.md
|
|
5298
|
-
var SKILL_default3 = "---\nname: armada-runtime-conductor\ndescription: Runtime guide for running Armada workers on Conductor Cloud. Use when an Armada coordinator must launch a worker on a ticket, send it a message, check whether a silent worker is still alive, or stop and archive it. Four fixed sections, each with the exact conductor command and how to read its output.\n---\n\nArmada never calls a runtime. This guide tells the coordinator how to launch, message, check and stop a worker with the `conductor` command line tool, and what to record in Armada afterwards. It was checked against `conductor` 0.89.x (the desktop app's CLI, macOS) and 0.1.x (the CLI inside a Conductor Cloud workspace, Linux); every command below works in both. `conductor --version` prints yours; if a flag is refused, compare with `conductor <command> --help`.\n\n- On a Mac, the app ships the CLI at `/Applications/Conductor.app/Contents/Resources/bin/conductor`, which is not on PATH. `armada doctor` looks for it and prints the fix: a link from a directory already on PATH (`ln -s \"/Applications/Conductor.app/Contents/Resources/bin/conductor\" ~/.local/bin/conductor`), or a PATH line for your shell profile.\n- Always pass `--json` and read fields with `jq`. Exit codes: 0 ok, 1 runtime error, 2 usage error, 3 authentication, 4 server error.\n- On exit code 3, `conductor auth whoami` checks the token the CLI uses (it exits 0 when the token works). Do not rely on `conductor auth status`: it only looks for a macOS Keychain entry and fails on Linux (\"Keychain storage is only supported on macOS\"). In a Conductor Cloud workspace the CLI reads `CONDUCTOR_API_KEY` from the environment and needs no login; on a Mac, `conductor auth login` stores a token in the Keychain.\n- A worker is one workspace with one session. Its Armada handle is `<workspaceId>/<sessionId>`; the worker's claim comment carries it, so `armada status` and the ticket always lead back to the session.\n- A worker needs no key in its workspace: the prompt of `armada brief` carries a one-time launch token, and the worker's first command exchanges it for a session limited to its ticket, through which Armada gives each command its keys. The token works once, within the hour, so a copy left in a transcript is useless once used.\n- Never type a secret value into a command, a file or a message: name the variable and let your shell expand it. The expanded value is still in the `conductor` process's arguments while it runs, so launch from a machine only you use.\n\n## Launch\n\n1. Pick a ready ticket from `armada status` that does not collide with work in flight.\n2. Run `armada brief ABC-12` (with `--profile <name> --reason \"<why>\"` when you override the routed profile), right before the launch. Read the profile (agent, model, effort, fast mode), the `Launch:` line and the warnings. Resolve every warning first: an open blocker, a ticket already in flight.\n - `Launch: one-time token in the prompt` is the normal case: the worker signs in to Armada with it and fetches its own keys. Its workspace receives no key at all. This view and `--json` show the token as `armada_launch_••••`; only `--prompt` prints it.\n - `Launch: no launch token (…)` says why. Not signed in: `armada login` (a headless coordinator sets `ARMADA_API_KEY`), then brief again; `armada doctor` checks the sign-in. Launch with keys (step 4, second block) only on an Armada that keeps no keys yet (no accounts or no vault: a self-hosted one, CI, or before the owner's switch to the Keys page).\n3. **The launch message is the `--prompt` output, and only it.** Never cut the prompt out of the human view of `armada brief` or its `--json`: they mask the token as `armada_launch_••••`, which signs nobody in, and the worker's `armada login` stops on it. Write the prompt to a file only you can read with `--prompt`, and add what only you know (the boundary with a parallel worker, a decision not yet on the ticket). The token in it works once, within the hour: brief again when that hour has passed before the launch.\n\n```sh\n(umask 077; armada brief ABC-12 --prompt > /tmp/abc-12-brief.md)\n```\n\n4. Create the workspace with every value from the profile. Never leave the agent, model or effort to Conductor's defaults. Add `--fast-mode` when the profile says fast mode. Run the whole block as one command: shell state does not carry over between separate calls.\n\n```sh\nconductor --json workspace create \\\n --repo-url https://github.com/<owner>/<name> \\\n --branch main \\\n --name \"ABC-12 <short title>\" \\\n --agent claude --model opus-5-5-1m --effort high \\\n --message-file - \\\n --env ARMADA_TICKET=ABC-12 \\\n < /tmp/abc-12-brief.md > /tmp/abc-12-launch.json\nrm -f /tmp/abc-12-brief.md\njq -r '\"\\(.workspaceId)/\\(.sessionId)\"' /tmp/abc-12-launch.json\n```\n\nWithout a launch token (an Armada that keeps no keys), pass the keys the brief's environment table marks `required`, from your shell or from Armada's credentials file (`in credentials file`: the `set -a` line loads it without printing it; drop it when every variable is set in your shell). The subshell keeps the keys out of the rest of your session. Without a launch token the worker is not signed in to Armada: its claims and reports reach Linear only, with a warning. When Conductor's organization environment still holds the keys, every workspace already has them: use the first block.\n\n```sh\n(\n set -a; . \"${XDG_CONFIG_HOME:-$HOME/.config}/armada/credentials\"; set +a\n [ -n \"$LINEAR_API_KEY\" ] || { echo \"LINEAR_API_KEY is missing\" >&2; exit 1; }\n conductor --json workspace create \\\n --repo-url https://github.com/<owner>/<name> \\\n --branch main \\\n --name \"ABC-12 <short title>\" \\\n --agent claude --model opus-5-5-1m --effort high \\\n --message-file - \\\n --env ARMADA_TICKET=ABC-12 \\\n --env LINEAR_API_KEY=\"$LINEAR_API_KEY\" \\\n < /tmp/abc-12-brief.md > /tmp/abc-12-launch.json\n)\nrm -f /tmp/abc-12-brief.md\n```\n\n- `--branch` is the base branch (the default branch). Conductor creates a branch named `conductor/<slug of --name>`; the brief tells the worker to rename it to the ticket's branch.\n- The output has `workspaceId`, `sessionId`, `deepLink` and `initialMessage` (`messageId`, `state: \"queued\"`). Keep the handle the `jq` line prints, and give the owner the `deepLink` when they want to watch.\n- Conductor sets `CONDUCTOR_WORKSPACE_ID` and `CONDUCTOR_SESSION_ID` inside the workspace, and signs `gh` in for the worker's pushes. The brief's first commands install your Armada version (`npm install -g`), sign in with the launch token (`armada login --launch-token`) and claim the ticket. `--env` values are not shown back by `workspace get`.\n- Keys in Conductor's organization environment reach every workspace, workers included: once Armada keeps the organization's keys, they belong on Armada's Keys page, not there.\n- An unknown agent, model or effort fails the command. Check the ids with `conductor model` (each agent's models, efforts and defaults) and fix the profile in `armada.toml`.\n\n5. **Check the claim.** Within a few minutes, `armada status` lists the ticket in flight, phase `planning`, runtime `Conductor`, and the ticket's claim comment reads `session: <workspaceId>/<sessionId>` and `profile: <name>`. No claim after `[policy] not_started_minutes` (ten by default): `armada watch` and `armada inbox` show a `not-started` entry, and `armada status` lists the ticket under \"Launched, not started\". It says whether the worker never used its launch token (it never reached its login line) or signed in and stopped before its claim. Read the transcript (Status section). A worker whose launch token was refused (already used, or more than an hour old) needs a new one: `armada brief ABC-12 --prompt` again, and message it only the `armada login --launch-token …` line of the new `--prompt` output (Message section). A worker cut off from Armada was revoked on the dashboard (Organization > Workers says by whom) or left idle for three days: ask the owner before you give a revoked worker a new token. If the worker cannot claim for another reason, fix the cause and message it; as a last resort record the handle yourself with `armada claim ABC-12 --runtime conductor --handle <workspaceId>/<sessionId> --profile <name>`, adding the brief's `--reason` for an override.\n\n## Message\n\n```sh\nprintf '%s\\n' \"Plan approved. Go on.\" | conductor --json message create --session <sessionId> --message-file -\nconductor --json message create --session <sessionId> --message-file - < /tmp/abc-12-answer.md\n```\n\nThe output is `{\"messageId\": …, \"state\": \"sent\"}`. Exit code 0 means Conductor accepted the message, not that the worker read it: check that the session turns `working`, then read its reply in the transcript. Use it to deliver an answer, a plan approval, or a heads-up that the default branch moved. Then record it in Armada: `armada answer <item> \"<answer>\"` for a question from `armada inbox`, `armada answer --note ABC-12 \"<message>\"` for a message the worker did not ask for.\n\n## Status\n\n```sh\nconductor --json session status <sessionId>\n```\n\nThe output is `{\"workspaceId\", \"sessionId\", \"status\", \"updatedAt\"}`. For a worker:\n\n- `working`: a turn is running. A silent worker that is `working` is busy (a long build or test run): leave it, and read the transcript if it stays silent past twice `policy.silence_minutes`.\n- `idle`: no turn is running. The worker finished its turn: it handed back, it waits for an answer, or it stopped without finishing. If `armada status` does not show it `ready-to-merge`, `awaiting-approval` or `blocked`, it has stopped: read its last reply, then message it to go on, or release and relaunch the ticket.\n- `error`: the last turn failed (agent or provider failure). Read the transcript and message it to resume; if it fails again, cancel, archive, release and relaunch.\n- Right after launch the session is `idle` for a few seconds while the workspace is initializing and the first message is queued; it turns `working` when the agent starts.\n\nThe workspace itself: `conductor --json workspace status <workspaceId>` gives `status` `initializing`, `ready` or `archived`.\n\n**Read the transcript** to see what a worker did or said. Events come oldest first, 100 per page; `hasMore` tells when to fetch the next page with `--after` the last event id. Keep the last id you read and poll from it.\n\n```sh\nconductor --json session message <sessionId> --limit 100 > /tmp/abc-12-events.json\njq -r '.hasMore, .data[-1].id' /tmp/abc-12-events.json\nconductor --json session message <sessionId> --after <lastEventId> --limit 100\n```\n\nThe second line prints whether more pages exist and the id to continue from. `.content.rawPayload` is the agent's own event format, so the filters depend on the worker's agent (the `agent` of its profile in `armada.toml`).\n\nA `claude` worker: each turn's final reply, then the commands and tools it ran.\n\n```sh\njq -r '.data[] | select(.content.rawPayload.type == \"result\") | .content.rawPayload | \"error=\\(.is_error)\\n\\(.result)\"' /tmp/abc-12-events.json\njq -r '.data[] | select(.content.rawPayload.type == \"assistant\") | .content.rawPayload.message.content[] | select(.type == \"tool_use\") | .input.command // .name' /tmp/abc-12-events.json\n```\n\nA `codex` worker: its events are `.content.rawPayload.event`, each item once as `item.started` and once as `item.completed`; read the completed ones. Its messages (`phase` is `commentary` along the way, `final_answer` at the end of a turn), then each command with its exit code, and its tool calls (Linear and other MCP servers).\n\n```sh\njq -r '.data[] | .content.rawPayload.event | select(.type == \"item.completed\") | .item | select(.type == \"agentMessage\") | \"[\\(.phase)] \\(.text)\"' /tmp/abc-12-events.json\njq -r '.data[] | .content.rawPayload.event | select(.type == \"item.completed\") | .item | select(.type == \"commandExecution\") | \"exit=\\(.exitCode) \\(.command)\"' /tmp/abc-12-events.json\njq -r '.data[] | .content.rawPayload.event | select(.type == \"item.completed\") | .item | select(.type == \"mcpToolCall\") | \"\\(.server) \\(.tool)\"' /tmp/abc-12-events.json\n```\n\nAnother agent, or a filter that prints nothing: count the event types, look at one event of the type you need, and adapt the filter.\n\n```sh\njq -r '.data[].content.rawPayload | .type // .event.type // \"(no payload)\"' /tmp/abc-12-events.json | sort | uniq -c\n```\n\n## Stop and archive\n\n```sh\nconductor --json session cancel <sessionId>\nconductor --json workspace archive <workspaceId>\n```\n\n- `session cancel` stops the running turn: `{\"status\", \"canceledQueuedMessages\"}`, and the session is `idle` within seconds. The workspace stays; a message starts a new turn. Use it on a worker that runs the wrong thing.\n- `workspace archive` answers `{\"status\": \"archived\"}`. Archive a worker's workspace after its pull request is merged, or after `armada release --ticket ABC-12 --reason \"<why>\"` for a worker that stops without handing back. The branch and the pull request stay on GitHub.\n- **Wait for `idle` before archiving.** A hand-back often arrives while the worker's session is still `working`: `armada report ready-to-merge` runs inside its last turn, which then writes its final reply. Archive only once `session status` answers `idle`. Poll it every 15 seconds; if it is still `working` after 10 minutes, cancel the turn and archive (the transcript keeps what it was doing). Run the whole block as one command; it can take up to 10 minutes, so run it in the background or give it a longer command timeout:\n\n```sh\nfor i in $(seq 40); do\n [ \"$(conductor --json session status <sessionId> | jq -r .status)\" = working ] || break\n sleep 15\ndone\n[ \"$(conductor --json session status <sessionId> | jq -r .status)\" = working ] && conductor --json session cancel <sessionId>\nconductor --json workspace archive <workspaceId>\n```\n- After an archive, `session status` still answers `idle`; `workspace status` says `archived`.\n";
|
|
5346
|
+
var SKILL_default3 = "---\nname: armada-runtime-conductor\ndescription: Runtime guide for running Armada workers on Conductor Cloud. Use when an Armada coordinator must launch a worker on a ticket, send it a message, check whether a silent worker is still alive, or stop and archive it. Four fixed sections, each with the exact conductor command and how to read its output.\n---\n\nArmada never calls a runtime. This guide tells the coordinator how to launch, message, check and stop a worker with the `conductor` command line tool, and what to record in Armada afterwards. It was checked against `conductor` 0.89.x (the desktop app's CLI, macOS) and 0.1.x (the CLI inside a Conductor Cloud workspace, Linux); every command below works in both. `conductor --version` prints yours; if a flag is refused, compare with `conductor <command> --help`.\n\n- On a Mac, the app ships the CLI at `/Applications/Conductor.app/Contents/Resources/bin/conductor`, which is not on PATH. `armada doctor` looks for it and prints the fix: a link from a directory already on PATH (`ln -s \"/Applications/Conductor.app/Contents/Resources/bin/conductor\" ~/.local/bin/conductor`), or a PATH line for your shell profile.\n- Always pass `--json` and read fields with `jq`. Exit codes: 0 ok, 1 runtime error, 2 usage error, 3 authentication, 4 server error.\n- On exit code 3, `conductor auth whoami` checks the token the CLI uses (it exits 0 when the token works). Do not rely on `conductor auth status`: it only looks for a macOS Keychain entry and fails on Linux (\"Keychain storage is only supported on macOS\"). In a Conductor Cloud workspace the CLI reads `CONDUCTOR_API_KEY` from the environment and needs no login; on a Mac, `conductor auth login` stores a token in the Keychain.\n- A worker is one workspace with one session. Its Armada handle is `<workspaceId>/<sessionId>`; the worker's claim comment carries it, so `armada status` and the ticket always lead back to the session.\n- A worker needs no key in its workspace: the prompt of `armada brief` carries a one-time launch token, and the worker's first command exchanges it for a session limited to its ticket, through which Armada gives each command its keys. The token works once, within the hour, so a copy left in a transcript is useless once used.\n- Never type a secret value into a command, a file or a message: name the variable and let your shell expand it. The expanded value is still in the `conductor` process's arguments while it runs, so launch from a machine only you use.\n\n## Launch\n\n1. Pick a ready ticket from `armada status` that does not collide with work in flight.\n2. Run `armada brief ABC-12`, right before the launch. A matching label rule wins. If it prints **Choose a profile**, read the ticket and parent, match the profiles' `when` rules by most files/work and rerun with `--profile <name> --reason \"<why>\"`. Mixed front-end/back-end work: choose the larger part and say why. Use those flags also for a label-route override and keep them on every subsequent `--prompt` call. Read the profile (agent, model, effort, fast mode), the `Launch:` line and the warnings. Resolve every warning first: an open blocker, a ticket already in flight.\n - `Launch: one-time token in the prompt` is the normal case: the worker signs in to Armada with it and fetches its own keys. Its workspace receives no key at all. This view and `--json` show the token as `armada_launch_••••`; only `--prompt` prints it.\n - `Launch: no launch token (…)` says why. Not signed in: `armada login` (a headless coordinator sets `ARMADA_API_KEY`), then brief again; `armada doctor` checks the sign-in. Launch with keys (step 4, second block) only on an Armada that keeps no keys yet (no accounts or no vault: a self-hosted one, CI, or before the owner's switch to the Keys page).\n3. **The launch message is the `--prompt` output, and only it.** Never cut the prompt out of the human view of `armada brief` or its `--json`: they mask the token as `armada_launch_••••`, which signs nobody in, and the worker's `armada login` stops on it. Write the prompt to a file only you can read with `--prompt`, and add what only you know (the boundary with a parallel worker, a decision not yet on the ticket). The token in it works once, within the hour: brief again when that hour has passed before the launch.\n\n```sh\n(umask 077; armada brief ABC-12 --prompt > /tmp/abc-12-brief.md)\n```\n\n4. Create the workspace with every value from the profile. Never leave the agent, model or effort to Conductor's defaults. Add `--fast-mode` when the profile says fast mode. Run the whole block as one command: shell state does not carry over between separate calls.\n\n```sh\nconductor --json workspace create \\\n --repo-url https://github.com/<owner>/<name> \\\n --branch main \\\n --name \"ABC-12 <short title>\" \\\n --agent claude --model opus-5-5-1m --effort high \\\n --message-file - \\\n --env ARMADA_TICKET=ABC-12 \\\n < /tmp/abc-12-brief.md > /tmp/abc-12-launch.json\nrm -f /tmp/abc-12-brief.md\njq -r '\"\\(.workspaceId)/\\(.sessionId)\"' /tmp/abc-12-launch.json\n```\n\nWithout a launch token (an Armada that keeps no keys), pass the keys the brief's environment table marks `required`, from your shell or from Armada's credentials file (`in credentials file`: the `set -a` line loads it without printing it; drop it when every variable is set in your shell). The subshell keeps the keys out of the rest of your session. Without a launch token the worker is not signed in to Armada: its claims and reports reach Linear only, with a warning. When Conductor's organization environment still holds the keys, every workspace already has them: use the first block.\n\n```sh\n(\n set -a; . \"${XDG_CONFIG_HOME:-$HOME/.config}/armada/credentials\"; set +a\n [ -n \"$LINEAR_API_KEY\" ] || { echo \"LINEAR_API_KEY is missing\" >&2; exit 1; }\n conductor --json workspace create \\\n --repo-url https://github.com/<owner>/<name> \\\n --branch main \\\n --name \"ABC-12 <short title>\" \\\n --agent claude --model opus-5-5-1m --effort high \\\n --message-file - \\\n --env ARMADA_TICKET=ABC-12 \\\n --env LINEAR_API_KEY=\"$LINEAR_API_KEY\" \\\n < /tmp/abc-12-brief.md > /tmp/abc-12-launch.json\n)\nrm -f /tmp/abc-12-brief.md\n```\n\n- `--branch` is the base branch (the default branch). Conductor creates a branch named `conductor/<slug of --name>`; the brief tells the worker to rename it to the ticket's branch.\n- The output has `workspaceId`, `sessionId`, `deepLink` and `initialMessage` (`messageId`, `state: \"queued\"`). Keep the handle the `jq` line prints, and give the owner the `deepLink` when they want to watch.\n- Conductor sets `CONDUCTOR_WORKSPACE_ID` and `CONDUCTOR_SESSION_ID` inside the workspace, and signs `gh` in for the worker's pushes. The brief's first commands install your Armada version (`npm install -g`), sign in with the launch token (`armada login --launch-token`) and claim the ticket. `--env` values are not shown back by `workspace get`.\n- Keys in Conductor's organization environment reach every workspace, workers included: once Armada keeps the organization's keys, they belong on Armada's Keys page, not there.\n- An unknown agent, model or effort fails the command. Check the ids with `conductor model` (each agent's models, efforts and defaults) and fix the profile in `armada.toml`.\n\n5. **Check the claim.** Within a few minutes, `armada status` lists the ticket in flight, phase `planning`, runtime `Conductor`, and the ticket's claim comment reads `session: <workspaceId>/<sessionId>` and `profile: <name>`. No claim after `[policy] not_started_minutes` (ten by default): `armada watch` and `armada inbox` show a `not-started` entry, and `armada status` lists the ticket under \"Launched, not started\". It says whether the worker never used its launch token (it never reached its login line) or signed in and stopped before its claim. Read the transcript (Status section). A worker whose launch token was refused (already used, or more than an hour old) needs a new one: `armada brief ABC-12 --prompt` again, and message it only the `armada login --launch-token …` line of the new `--prompt` output (Message section). A worker cut off from Armada was revoked on the dashboard (Organization > Workers says by whom) or left idle for three days: ask the owner before you give a revoked worker a new token. If the worker cannot claim for another reason, fix the cause and message it; as a last resort record the handle yourself with `armada claim ABC-12 --runtime conductor --handle <workspaceId>/<sessionId> --profile <name>`, adding the brief's `--reason` for an override.\n\n## Message\n\n```sh\nprintf '%s\\n' \"Plan approved. Go on.\" | conductor --json message create --session <sessionId> --message-file -\nconductor --json message create --session <sessionId> --message-file - < /tmp/abc-12-answer.md\n```\n\nThe output is `{\"messageId\": …, \"state\": \"sent\"}`. Exit code 0 means Conductor accepted the message, not that the worker read it: check that the session turns `working`, then read its reply in the transcript. Use it to deliver an answer, a plan approval, or a heads-up that the default branch moved. Then record it in Armada: `armada answer <item> \"<answer>\"` for a question from `armada inbox`, `armada answer --note ABC-12 \"<message>\"` for a message the worker did not ask for.\n\n## Status\n\n```sh\nconductor --json session status <sessionId>\n```\n\nThe output is `{\"workspaceId\", \"sessionId\", \"status\", \"updatedAt\"}`. For a worker:\n\n- `working`: a turn is running. A silent worker that is `working` is busy (a long build or test run): leave it, and read the transcript if it stays silent past twice `policy.silence_minutes`.\n- `idle`: no turn is running. The worker finished its turn: it handed back, it waits for an answer, or it stopped without finishing. If `armada status` does not show it `ready-to-merge`, `awaiting-approval` or `blocked`, it has stopped: read its last reply, then message it to go on, or release and relaunch the ticket.\n- `error`: the last turn failed (agent or provider failure). Read the transcript and message it to resume; if it fails again, cancel, archive, release and relaunch.\n- Right after launch the session is `idle` for a few seconds while the workspace is initializing and the first message is queued; it turns `working` when the agent starts.\n\nThe workspace itself: `conductor --json workspace status <workspaceId>` gives `status` `initializing`, `ready` or `archived`.\n\n**Read the transcript** to see what a worker did or said. Events come oldest first, 100 per page; `hasMore` tells when to fetch the next page with `--after` the last event id. Keep the last id you read and poll from it.\n\n```sh\nconductor --json session message <sessionId> --limit 100 > /tmp/abc-12-events.json\njq -r '.hasMore, .data[-1].id' /tmp/abc-12-events.json\nconductor --json session message <sessionId> --after <lastEventId> --limit 100\n```\n\nThe second line prints whether more pages exist and the id to continue from. `.content.rawPayload` is the agent's own event format, so the filters depend on the worker's agent (the `agent` of its profile in `armada.toml`).\n\nA `claude` worker: each turn's final reply, then the commands and tools it ran.\n\n```sh\njq -r '.data[] | select(.content.rawPayload.type == \"result\") | .content.rawPayload | \"error=\\(.is_error)\\n\\(.result)\"' /tmp/abc-12-events.json\njq -r '.data[] | select(.content.rawPayload.type == \"assistant\") | .content.rawPayload.message.content[] | select(.type == \"tool_use\") | .input.command // .name' /tmp/abc-12-events.json\n```\n\nA `codex` worker: its events are `.content.rawPayload.event`, each item once as `item.started` and once as `item.completed`; read the completed ones. Its messages (`phase` is `commentary` along the way, `final_answer` at the end of a turn), then each command with its exit code, and its tool calls (Linear and other MCP servers).\n\n```sh\njq -r '.data[] | .content.rawPayload.event | select(.type == \"item.completed\") | .item | select(.type == \"agentMessage\") | \"[\\(.phase)] \\(.text)\"' /tmp/abc-12-events.json\njq -r '.data[] | .content.rawPayload.event | select(.type == \"item.completed\") | .item | select(.type == \"commandExecution\") | \"exit=\\(.exitCode) \\(.command)\"' /tmp/abc-12-events.json\njq -r '.data[] | .content.rawPayload.event | select(.type == \"item.completed\") | .item | select(.type == \"mcpToolCall\") | \"\\(.server) \\(.tool)\"' /tmp/abc-12-events.json\n```\n\nAnother agent, or a filter that prints nothing: count the event types, look at one event of the type you need, and adapt the filter.\n\n```sh\njq -r '.data[].content.rawPayload | .type // .event.type // \"(no payload)\"' /tmp/abc-12-events.json | sort | uniq -c\n```\n\n## Stop and archive\n\n```sh\nconductor --json session cancel <sessionId>\nconductor --json workspace archive <workspaceId>\n```\n\n- `session cancel` stops the running turn: `{\"status\", \"canceledQueuedMessages\"}`, and the session is `idle` within seconds. The workspace stays; a message starts a new turn. Use it on a worker that runs the wrong thing.\n- `workspace archive` answers `{\"status\": \"archived\"}`. Archive a worker's workspace after its pull request is merged, or after `armada release --ticket ABC-12 --reason \"<why>\"` for a worker that stops without handing back. The branch and the pull request stay on GitHub.\n- **Wait for `idle` before archiving.** A hand-back often arrives while the worker's session is still `working`: `armada report ready-to-merge` runs inside its last turn, which then writes its final reply. Archive only once `session status` answers `idle`. Poll it every 15 seconds; if it is still `working` after 10 minutes, cancel the turn and archive (the transcript keeps what it was doing). Run the whole block as one command; it can take up to 10 minutes, so run it in the background or give it a longer command timeout:\n\n```sh\nfor i in $(seq 40); do\n [ \"$(conductor --json session status <sessionId> | jq -r .status)\" = working ] || break\n sleep 15\ndone\n[ \"$(conductor --json session status <sessionId> | jq -r .status)\" = working ] && conductor --json session cancel <sessionId>\nconductor --json workspace archive <workspaceId>\n```\n- After an archive, `session status` still answers `idle`; `workspace status` says `archived`.\n";
|
|
5299
5347
|
|
|
5300
5348
|
// ../../skills/armada-worker/SKILL.md
|
|
5301
5349
|
var SKILL_default4 = `---
|
|
@@ -5770,6 +5818,7 @@ function buildStatus({
|
|
|
5770
5818
|
runtime: l.runtime,
|
|
5771
5819
|
handle: l.handle,
|
|
5772
5820
|
profile: live?.handles?.[l.issue.id]?.profile ?? l.claim?.profile ?? null,
|
|
5821
|
+
profileReason: l.claim?.profileReason ?? null,
|
|
5773
5822
|
agent: l.agent,
|
|
5774
5823
|
since: l.since,
|
|
5775
5824
|
lastUpdate: l.lastUpdate,
|
|
@@ -5853,7 +5902,7 @@ async function loadStatus(config, opts) {
|
|
|
5853
5902
|
});
|
|
5854
5903
|
}
|
|
5855
5904
|
// package.json
|
|
5856
|
-
var version = "0.2.
|
|
5905
|
+
var version = "0.2.17";
|
|
5857
5906
|
|
|
5858
5907
|
// src/api.ts
|
|
5859
5908
|
var runs = new WeakMap;
|
|
@@ -6828,6 +6877,7 @@ function hideLaunchToken(b) {
|
|
|
6828
6877
|
}
|
|
6829
6878
|
function renderBrief(b) {
|
|
6830
6879
|
const p = b.profile;
|
|
6880
|
+
const promptCommand = `armada brief ${b.ticket.id}${p && (b.routing?.source === "requested" || b.routing?.reason) ? ` --profile ${shellWord(p.name)}${b.routing?.reason ? ` --reason ${shellWord(b.routing.reason)}` : ""}` : ""} --prompt`;
|
|
6831
6881
|
const width = Math.max(...b.environment.map((v) => v.name.length + (v.value ? v.value.length + 1 : 0)));
|
|
6832
6882
|
const out = [
|
|
6833
6883
|
`Brief for ${b.ticket.id} — ${b.ticket.title} (${b.ticket.status})`,
|
|
@@ -6841,7 +6891,7 @@ function renderBrief(b) {
|
|
|
6841
6891
|
`Repository: ${b.repository.url}`,
|
|
6842
6892
|
`Branch: ${b.ticket.branch ?? "none suggested by Linear"} (the worker renames its workspace branch to it)`,
|
|
6843
6893
|
`Launch: ${b.launch ? `one-time token in the prompt, valid until ${b.launch.expiresAt.slice(0, 16).replace("T", " ")} UTC: the worker needs no key
|
|
6844
|
-
(shown as ${HIDDEN_LAUNCH_TOKEN} here;
|
|
6894
|
+
(shown as ${HIDDEN_LAUNCH_TOKEN} here; \`${promptCommand}\` prints it)` : `no launch token${b.noLaunch ? ` (${b.noLaunch})` : ""}: pass the keys below in the worker's environment`}`,
|
|
6845
6895
|
"",
|
|
6846
6896
|
"Environment to pass (values are never printed):",
|
|
6847
6897
|
...b.environment.map((v) => {
|
|
@@ -6852,10 +6902,26 @@ function renderBrief(b) {
|
|
|
6852
6902
|
];
|
|
6853
6903
|
if (b.warnings.length)
|
|
6854
6904
|
out.push("", "Warnings:", ...b.warnings.map((w) => ` - ${w}`));
|
|
6855
|
-
out.push("", `----- prompt (
|
|
6905
|
+
out.push("", `----- prompt (\`${promptCommand}\` prints only this) -----`, "", b.prompt);
|
|
6856
6906
|
return out.join(`
|
|
6857
6907
|
`);
|
|
6858
6908
|
}
|
|
6909
|
+
function renderProfileSelection(b) {
|
|
6910
|
+
return [
|
|
6911
|
+
`Choose a profile for ${b.ticket.id} — ${b.ticket.title}`,
|
|
6912
|
+
b.ticket.url,
|
|
6913
|
+
"",
|
|
6914
|
+
"In short:",
|
|
6915
|
+
b.ticket.inShort || "No In short section on this ticket; read the full ticket before choosing.",
|
|
6916
|
+
"",
|
|
6917
|
+
...b.parent ? [`Parent: ${b.parent.id} — ${b.parent.title} (${b.parent.url}). Read it before choosing.`, ""] : [],
|
|
6918
|
+
...b.selection.profiles.map((profile) => ` ${profile.name}: ${profile.when ?? "no when rule; choose only with a reason"}`),
|
|
6919
|
+
"",
|
|
6920
|
+
b.selection.hint,
|
|
6921
|
+
...b.warnings.map((warning) => `Warning: ${warning}`)
|
|
6922
|
+
].join(`
|
|
6923
|
+
`);
|
|
6924
|
+
}
|
|
6859
6925
|
function launcher(io, config, credentials) {
|
|
6860
6926
|
return async (ticket) => {
|
|
6861
6927
|
const signIn = credentials.armadaSignIn;
|
|
@@ -6924,6 +6990,13 @@ async function brief2(io, config, credentials, a, version, configPath) {
|
|
|
6924
6990
|
throw new UsageError(err.message);
|
|
6925
6991
|
throw err;
|
|
6926
6992
|
}
|
|
6993
|
+
if ("selection" in b) {
|
|
6994
|
+
if (promptOnly)
|
|
6995
|
+
throw new UsageError(b.selection.hint);
|
|
6996
|
+
io.stdout(`${a.json ? JSON.stringify(b, null, 2) : renderProfileSelection(b)}
|
|
6997
|
+
`);
|
|
6998
|
+
return 0;
|
|
6999
|
+
}
|
|
6927
7000
|
const project = config.project.slug;
|
|
6928
7001
|
const known = (await watchOf(io, project)).state?.inFlight ?? [];
|
|
6929
7002
|
const inFlight = [...new Set([...known, b.ticket.id])].sort((x, y) => x.localeCompare(y, "en", { numeric: true }));
|
|
@@ -7802,6 +7875,8 @@ function renderStatus(r) {
|
|
|
7802
7875
|
const who = [t.runtime, t.agent].filter(Boolean).join(" · ") || "unassigned";
|
|
7803
7876
|
out.push(` ${pad(t.id, idWidth)} ${pad(phaseLabel(t), phaseWidth)} ${who} · ${t.lastReport ? `reported ${relative2(t.lastReport, now)}` : `updated ${relative2(t.lastUpdate, now)}`}`);
|
|
7804
7877
|
out.push(`${indent}${truncate(t.title, 90)}${t.spec ? ` [${t.spec}]` : ""}`);
|
|
7878
|
+
if (t.profile)
|
|
7879
|
+
out.push(`${indent}Profile: ${t.profile}${t.profileReason ? ` — ${t.profileReason}` : ""}`);
|
|
7805
7880
|
if (t.statusLine?.summary)
|
|
7806
7881
|
out.push(`${indent}“${truncate(t.statusLine.summary, 100)}”`);
|
|
7807
7882
|
if (t.statusLine?.plan)
|
|
@@ -8209,7 +8284,8 @@ var COMMAND_HELP = {
|
|
|
8209
8284
|
A new worker's launch prompt, the Conductor profile (agent, model,
|
|
8210
8285
|
effort) and the environment variables to pass, named, never shown.
|
|
8211
8286
|
The profile follows [[conductor.routing]] on the ticket's labels, then
|
|
8212
|
-
|
|
8287
|
+
profiles' when rules ask the coordinator to choose with --profile and
|
|
8288
|
+
--reason. Only projects without when fall back to default_profile.
|
|
8213
8289
|
Signed in to Armada, the prompt starts with a one-time launch token, so
|
|
8214
8290
|
the worker needs no key. --prompt prints only the prompt, for \`--message-file -\`
|
|
8215
8291
|
`,
|