@the-vibe-company/armada 0.2.10 → 0.2.12

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.
Files changed (2) hide show
  1. package/dist/armada.js +91 -10
  2. package/package.json +1 -1
package/dist/armada.js CHANGED
@@ -4,6 +4,7 @@
4
4
  import { spawn as spawn2, spawnSync } from "node:child_process";
5
5
  import { createReadStream } from "node:fs";
6
6
  import { readFile as readFile3 } from "node:fs/promises";
7
+ import { hostname as hostname2 } from "node:os";
7
8
  import { isatty } from "node:tty";
8
9
 
9
10
  // src/cli.ts
@@ -3362,6 +3363,8 @@ var WORKER_FLEET_OPS = ["claim", "report", "ask", "release"];
3362
3363
  var FLEET_OPS = [
3363
3364
  ...WORKER_FLEET_OPS,
3364
3365
  "register",
3366
+ "coordinator",
3367
+ "request",
3365
3368
  "events/latest",
3366
3369
  "launches",
3367
3370
  "inbox",
@@ -3380,6 +3383,10 @@ var CALL_TIMEOUT_MS = 15000;
3380
3383
  function fleetClient(o) {
3381
3384
  const call = async (op, input) => await o.api.fleet(o.signIn, op, { project: o.project, input }, CALL_TIMEOUT_MS);
3382
3385
  return {
3386
+ coordinator: (facts) => call("coordinator", facts).then(() => {
3387
+ return;
3388
+ }),
3389
+ request: (input) => call("request", input),
3383
3390
  register: () => call("register", {}).then(() => {
3384
3391
  return;
3385
3392
  }),
@@ -3442,13 +3449,19 @@ function normalizePull(raw, repo) {
3442
3449
  const status = raw.commits.nodes[0]?.commit.statusCheckRollup ?? null;
3443
3450
  const checks = status?.contexts.nodes.map((c) => c.__typename === "CheckRun" ? { name: c.name, state: checkState(c.status, c.conclusion) } : { name: c.context, state: checkState("", c.state) });
3444
3451
  return {
3452
+ files: raw.files?.nodes ?? null,
3453
+ additions: raw.additions ?? null,
3454
+ deletions: raw.deletions ?? null,
3455
+ filesComplete: !!raw.files && !raw.files.pageInfo.hasNextPage,
3456
+ checksComplete: !status || status.contexts.pageInfo?.hasNextPage === false,
3457
+ mergeability: raw.mergeable === "CONFLICTING" || raw.mergeStateStatus === "DIRTY" ? "conflicting" : raw.mergeStateStatus === "BEHIND" ? "behind" : raw.mergeable === "MERGEABLE" ? "clean" : "unknown",
3445
3458
  url: raw.url,
3446
3459
  number: raw.number,
3447
3460
  repo,
3448
3461
  title: raw.title,
3449
3462
  state: raw.state === "OPEN" ? "open" : raw.state === "MERGED" ? "merged" : "closed",
3450
3463
  draft: raw.isDraft,
3451
- ci: checks ? rollup(checks.map((c) => c.state)) : "none",
3464
+ ci: status?.contexts.pageInfo?.hasNextPage ? checkState("", status.state) : checks ? rollup(checks.map((c) => c.state)) : "none",
3452
3465
  checks: checks ?? [],
3453
3466
  mergeable: raw.mergeable,
3454
3467
  headRef: raw.headRefName,
@@ -3460,8 +3473,9 @@ function normalizePull(raw, repo) {
3460
3473
  }
3461
3474
  var PULL_FIELDS = `
3462
3475
  fragment P on PullRequest {
3463
- number title url state isDraft mergeable headRefName headRefOid createdAt updatedAt mergedAt
3464
- commits(last: 1) { nodes { commit { statusCheckRollup { state contexts(first: 50) { nodes {
3476
+ number title url state isDraft mergeable mergeStateStatus headRefName headRefOid createdAt updatedAt mergedAt additions deletions
3477
+ files(first: 100) { nodes { path additions deletions } pageInfo { hasNextPage } }
3478
+ commits(last: 1) { nodes { commit { statusCheckRollup { state contexts(first: 50) { pageInfo { hasNextPage } nodes {
3465
3479
  __typename
3466
3480
  ... on CheckRun { name status conclusion }
3467
3481
  ... on StatusContext { context state }
@@ -3519,7 +3533,13 @@ async function fetchForge(opts) {
3519
3533
  repo: opts.repository,
3520
3534
  fetchedAt: (opts.now?.() ?? new Date).toISOString(),
3521
3535
  prs: [...repo.open.nodes, ...repo.closed.nodes].map((p) => normalizePull(p, opts.repository)),
3522
- warnings: repo.open.pageInfo?.hasNextPage ? ["more than 100 open pull requests; the least recently updated are ignored"] : []
3536
+ warnings: [
3537
+ ...repo.open.pageInfo?.hasNextPage ? ["more than 100 open pull requests; the least recently updated are ignored"] : [],
3538
+ ...repo.open.nodes.flatMap((pr) => [
3539
+ ...pr.files?.pageInfo.hasNextPage ? [`PR #${pr.number}: changed files are incomplete (first 100)`] : [],
3540
+ ...pr.commits.nodes[0]?.commit.statusCheckRollup?.contexts.pageInfo?.hasNextPage ? [`PR #${pr.number}: checks are incomplete (first 50)`] : []
3541
+ ])
3542
+ ]
3523
3543
  };
3524
3544
  }
3525
3545
  function attachPullRequests(program, forge) {
@@ -3677,6 +3697,7 @@ async function checkInbox(fleet, o) {
3677
3697
  const query = {
3678
3698
  coordinator: o.coordinator ?? null,
3679
3699
  silentAfterMinutes: o.silentAfterMinutes,
3700
+ ...o.facts ? { facts: o.facts } : {},
3680
3701
  ...o.notStartedMinutes !== undefined ? { notStartedMinutes: o.notStartedMinutes } : {}
3681
3702
  };
3682
3703
  const first = await fleet.inbox({ ...query, etag: null });
@@ -3727,7 +3748,16 @@ function statusComment(phase, word, text, ref) {
3727
3748
 
3728
3749
  ${detail}` : line;
3729
3750
  }
3730
- var ANSWERABLE = ["question", "plan", "request", "answer-request", "launch-request"];
3751
+ var ANSWERABLE = [
3752
+ "question",
3753
+ "plan",
3754
+ "request",
3755
+ "answer-request",
3756
+ "launch-request",
3757
+ "merge-request",
3758
+ "release-request",
3759
+ "plan-changes"
3760
+ ];
3731
3761
  async function answerItem(ctx, input) {
3732
3762
  const { config, linear } = ctx;
3733
3763
  const project = config.project.slug;
@@ -3764,6 +3794,10 @@ async function answerItem(ctx, input) {
3764
3794
  }
3765
3795
  if (item?.kind === "launch-request")
3766
3796
  return declineLaunch(ctx, item, text, warnings);
3797
+ if (item && ["merge-request", "release-request", "plan-changes"].includes(item.kind)) {
3798
+ const recorded = await live(ctx, warnings, "resolve the dashboard request", (fleet) => fleet.answer({ text, note: false, ticket: item.ticket, item: item.id }));
3799
+ return { ticket: item.ticket ?? `#${item.id}`, url: "", lines: recorded ? [recorded] : [], warnings, inbox: null };
3800
+ }
3767
3801
  const question = item?.kind === "answer-request" ? item.request?.question ?? null : null;
3768
3802
  const answered = question === null ? item : await live(ctx, warnings, `read the item answered by #${item?.id}`, (fleet) => fleet.inboxItem(question));
3769
3803
  const answerKind = answered?.kind === "plan" ? "plan" : "question";
@@ -4050,6 +4084,7 @@ async function watchInbox(fleet, o) {
4050
4084
  const query = {
4051
4085
  coordinator: o.coordinator,
4052
4086
  silentAfterMinutes: o.silentAfterMinutes,
4087
+ ...o.facts ? { facts: o.facts } : {},
4053
4088
  ...o.notStartedMinutes !== undefined ? { notStartedMinutes: o.notStartedMinutes } : {}
4054
4089
  };
4055
4090
  const pollMs = o.pollMs ?? WATCH_POLL_MS;
@@ -5077,7 +5112,7 @@ async function readProjectConfig(p, opts) {
5077
5112
  import { createHash as createHash2 } from "node:crypto";
5078
5113
 
5079
5114
  // ../../skills/armada-coordinator/MERGE.md
5080
- var MERGE_default = "# Merging a pull request\n\nRun `armada merge <pr>` (add `--dry-run` to see the checklist only, `--wait` when main keeps moving, `--no-ticket` for a pull request no ticket owns). It checks everything below, takes the project's merge lock, merges pinned to the handed-back SHA, confirms the merge on GitHub and closes the ticket. Its output lists the workers in flight to tell and the worker session to archive. When a refusal names a rule, fix the cause (usually: ask the worker to bring the default branch in and report again) rather than merging by hand. When you must merge by hand, follow the same steps.\n\n## Main kept moving: `--wait`\n\nWith several workers in flight, main often moves between a green hand-back and its merge. Instead of asking the worker to bring main in, run `armada merge <pr> --wait [--timeout <min>]` (30 minutes by default), in the background where your runtime allows it (Claude Code: `run_in_background`):\n\n- A head behind main that GitHub says merges cleanly is updated with GitHub's \"update branch\": a merge commit on the branch, no force-push. Squash merges make that merge commit harmless. When main does not require heads to be up to date and `[gates] local_commands` is set, it is test-merged instead, as without `--wait`, so a busy main does not restart CI each time.\n- It waits for every required check on the new head, then merges pinned to that head.\n- It holds the project's merge lock only while merging, not while waiting, so two waits never block each other. Signed in with Armada down, it refuses before touching the branch.\n- It stops at once, naming the cause, on a red check, a conflict, any other refused rule, or when GitHub refuses the update (a branch protection rule or ruleset can forbid it) or accepts it without the head moving within 3 minutes: ask the worker to fix it. A refusal after an update says so: the worker pulls the updated branch before pushing again.\n- The updated head still counts as the worker's hand-back, because the only change is main coming in: `armada merge` accepts a head that is the handed-back SHA followed only by merge commits, each bringing in a commit of main, with the tree of a clean merge (checked with git). That holds without `--wait` too, for example after \"Update branch\" on GitHub. The ticket's merged comment names both heads: `head <new>, the handed-back <old> updated with main`.\n\n## No ticket: `--no-ticket`\n\n`armada merge <pr> --no-ticket` merges a pull request no ticket owns: the `armada init` pull request (its output names the command) or the release pull request below. There is no hand-back and nothing is written to Linear; every other check is unchanged, and the merge is pinned to the head it checked. It refuses a branch that names a ticket of the program: that one is merged on its worker's hand-back.\n\nWhen none of the required checks ran on the head (a release pull request opened with the workflow's own token gets no CI run), it passes with a note, on GitHub's own state (`UNSTABLE` included, when nothing failed) and the checks that did run, once the head is a minute old; a younger head, or a head this run updated (its update starts CI), is waited for (`--wait`) or refused.\n\n## Before\n\n1. The worker has handed back: `Agent phase` is `ready-to-merge` and you have the full 40-character head SHA it reported.\n2. `gh pr view <n> --json headRefOid,mergeStateStatus,isDraft,title` shows that SHA (or that SHA with only main merged in), `CLEAN` (or `HAS_HOOKS`), not a draft, and a Commitizen title.\n3. `gh pr checks <n>` shows every required check passing.\n4. The head contains the current default branch: `git merge-base --is-ancestor origin/<default> <sha>`. If not, update it (`--wait`) or ask the worker to bring the default branch in (rebase, or merge it into their branch; never force-push a branch someone else pushed to).\n5. Semantic check: search the default branch for callers of anything the pull request deletes or renames.\n\n## Merge\n\n```sh\ngh pr merge <n> --squash --match-head-commit <full-sha>\n```\n\n- One merge at a time: `armada merge` holds the project's merge lock. If it refuses because Armada is down, use `--no-lock` only when you are sure no other coordinator merges in the project.\n- Leave out `--delete-branch`: it deletes local worktrees that have the branch checked out, including other agents'. Delete the branch once its worktree is gone.\n- If GitHub answers with a 5xx, check `gh pr view <n> --json state` before retrying.\n\n## After\n\n1. The ticket is Done, its `Agent phase` and `Agent runtime` labels removed, the pull request linked.\n2. Tell every in-flight worker what the merge changes for them: a shared file, a migration, a new check, code they must now reuse or delete.\n3. Archive the merged worker's workspace with the \"Stop and archive\" section of its runtime guide.\n4. Launch the tickets this merge unblocked.\n\n## The release pull request\n\nSome repositories publish through release-please: every merge to the default branch opens or updates one release pull request, and merging it tags the version and publishes it. When the repository's rules (`AGENTS.md`) say to merge it after each merge, do it right after the ticket's merge, without a hand-back: no worker owns it.\n\n- **What it looks like.** Title `chore(main): release <version>`, opened by `github-actions`, label `autorelease: pending`, and a diff that only touches the changelog, the manifest and version fields. It is opened with the workflow's own token, so **no CI check runs on it** (only checks from apps such as Vercel, if any) and `mergeStateStatus` is often `UNSTABLE` (`armada merge --no-ticket` accepts it when none of the required checks ran and nothing failed). Both are expected: the publish job runs the repository's checks again before publishing. Anything else in the diff, or a `DIRTY` state, is not expected: stop and tell the owner.\n- **Find it and its head:**\n\n```sh\ngh pr list --state open --label \"autorelease: pending\" --json number,title,headRefOid,mergeStateStatus\n```\n\n- **Merge it** with `armada merge <n> --no-ticket`: no ticket owns it, and no required check runs on it (see \"No ticket\" above). By hand, pin it to that head, like any merge, and without `--delete-branch`:\n\n```sh\ngh pr merge <n> --squash --match-head-commit <full-sha>\n```\n\n- **Check the publish.** After a minute or two the new version is on the registry, for example `npm view <package> version` for an npm package (the package is named in `AGENTS.md` or the release workflow). If it is not, open the Release run (`gh run list --workflow release.yml --limit 3`), fix the cause and re-run its failed jobs: a later push does not publish a version already tagged.\n- Release-please updates the same pull request on each merge to the default branch; one release pull request can carry several merges.\n";
5115
+ var MERGE_default = "# Merging a pull request\n\nRun `armada merge <pr>` (add `--dry-run` to see the checklist only, `--wait` when main keeps moving, `--no-ticket` for a pull request no ticket owns). It checks everything below, takes the project's merge lock, merges pinned to the handed-back SHA, confirms the merge on GitHub and closes the ticket. Its output lists the workers in flight to tell and the worker session to archive. When a refusal names a rule, fix the cause (usually: ask the worker to bring the default branch in and report again) rather than merging by hand. When you must merge by hand, follow the same steps.\n\n## Main kept moving: `--wait`\n\nWith several workers in flight, main often moves between a green hand-back and its merge. Instead of asking the worker to bring main in, run `armada merge <pr> --wait [--timeout <min>]` (30 minutes by default), in the background where your runtime allows it (Claude Code: `run_in_background`):\n\n- A head behind main that GitHub says merges cleanly is updated with GitHub's \"update branch\": a merge commit on the branch, no force-push. Squash merges make that merge commit harmless. When main does not require heads to be up to date and `[gates] local_commands` is set, it is test-merged instead, as without `--wait`, so a busy main does not restart CI each time.\n- It waits for every required check on the new head, then merges pinned to that head.\n- It holds the project's merge lock only while merging, not while waiting, so two waits never block each other. Signed in with Armada down, it refuses before touching the branch.\n- It stops at once, naming the cause, on a red check, a conflict, any other refused rule, or when GitHub refuses the update (a branch protection rule or ruleset can forbid it) or accepts it without the head moving within 3 minutes: ask the worker to fix it. A refusal after an update says so: the worker pulls the updated branch before pushing again.\n- The updated head still counts as the worker's hand-back, because the only change is main coming in: `armada merge` accepts a head that is the handed-back SHA followed only by merge commits, each bringing in a commit of main, with the tree of a clean merge (checked with git). That holds without `--wait` too, for example after \"Update branch\" on GitHub. The ticket's merged comment names both heads: `head <new>, the handed-back <old> updated with main`.\n\n## No ticket: `--no-ticket`\n\n`armada merge <pr> --no-ticket` merges a pull request no ticket owns: the `armada init` pull request (its output names the command) or the release pull request below. There is no hand-back and nothing is written to Linear; every other check is unchanged, and the merge is pinned to the head it checked. It refuses a branch that names a ticket of the program: that one is merged on its worker's hand-back.\n\nWhen none of the required checks ran on the head (a release pull request opened with the workflow's own token gets no CI run), it passes with a note, on GitHub's own state (`UNSTABLE` included, when nothing failed) and the checks that did run, once the head is a minute old; a younger head, or a head this run updated (its update starts CI), is waited for (`--wait`) or refused.\n\n## Before\n\n1. The worker has handed back: `Agent phase` is `ready-to-merge` and you have the full 40-character head SHA it reported.\n2. `gh pr view <n> --json headRefOid,mergeStateStatus,isDraft,title` shows that SHA (or that SHA with only main merged in), `CLEAN` (or `HAS_HOOKS`), not a draft, and a Commitizen title.\n3. `gh pr checks <n>` shows every required check passing.\n4. The head contains the current default branch: `git merge-base --is-ancestor origin/<default> <sha>`. If not, update it (`--wait`) or ask the worker to bring the default branch in (rebase, or merge it into their branch; never force-push a branch someone else pushed to).\n5. Semantic check: search the default branch for callers of anything the pull request deletes or renames.\n6. A dashboard pull request (one that changes Armada's own dashboard, `packages/dashboard`): compare with /agents and /design. Open each page it changes on its preview or the demo next to `/agents` and `/design`. The header bar, the toolbar, the sections and the rows must match them. A page with a title of its own, another font or its own list style goes back to the worker.\n\n## Merge\n\n```sh\ngh pr merge <n> --squash --match-head-commit <full-sha>\n```\n\n- One merge at a time: `armada merge` holds the project's merge lock. If it refuses because Armada is down, use `--no-lock` only when you are sure no other coordinator merges in the project.\n- Leave out `--delete-branch`: it deletes local worktrees that have the branch checked out, including other agents'. Delete the branch once its worktree is gone.\n- If GitHub answers with a 5xx, check `gh pr view <n> --json state` before retrying.\n\n## After\n\n1. The ticket is Done, its `Agent phase` and `Agent runtime` labels removed, the pull request linked.\n2. Tell every in-flight worker what the merge changes for them: a shared file, a migration, a new check, code they must now reuse or delete.\n3. Archive the merged worker's workspace with the \"Stop and archive\" section of its runtime guide.\n4. Launch the tickets this merge unblocked.\n\n## The release pull request\n\nSome repositories publish through release-please: every merge to the default branch opens or updates one release pull request, and merging it tags the version and publishes it. When the repository's rules (`AGENTS.md`) say to merge it after each merge, do it right after the ticket's merge, without a hand-back: no worker owns it.\n\n- **What it looks like.** Title `chore(main): release <version>`, opened by `github-actions`, label `autorelease: pending`, and a diff that only touches the changelog, the manifest and version fields. It is opened with the workflow's own token, so **no CI check runs on it** (only checks from apps such as Vercel, if any) and `mergeStateStatus` is often `UNSTABLE` (`armada merge --no-ticket` accepts it when none of the required checks ran and nothing failed). Both are expected: the publish job runs the repository's checks again before publishing. Anything else in the diff, or a `DIRTY` state, is not expected: stop and tell the owner.\n- **Find it and its head:**\n\n```sh\ngh pr list --state open --label \"autorelease: pending\" --json number,title,headRefOid,mergeStateStatus\n```\n\n- **Merge it** with `armada merge <n> --no-ticket`: no ticket owns it, and no required check runs on it (see \"No ticket\" above). By hand, pin it to that head, like any merge, and without `--delete-branch`:\n\n```sh\ngh pr merge <n> --squash --match-head-commit <full-sha>\n```\n\n- **Check the publish.** After a minute or two the new version is on the registry, for example `npm view <package> version` for an npm package (the package is named in `AGENTS.md` or the release workflow). If it is not, open the Release run (`gh run list --workflow release.yml --limit 3`), fix the cause and re-run its failed jobs: a later push does not publish a version already tagged.\n- Release-please updates the same pull request on each merge to the default branch; one release pull request can carry several merges.\n";
5081
5116
 
5082
5117
  // ../../skills/armada-coordinator/SKILL.md
5083
5118
  var SKILL_default = `---
@@ -5689,6 +5724,13 @@ function buildStatus({
5689
5724
  });
5690
5725
  const phaseOf = new Map(lanes.map((l) => [l.issue.id, l.phase]));
5691
5726
  const prRef = (p) => ({
5727
+ files: p.files ?? null,
5728
+ additions: p.additions ?? null,
5729
+ deletions: p.deletions ?? null,
5730
+ filesComplete: p.filesComplete ?? false,
5731
+ checksComplete: p.checksComplete ?? false,
5732
+ mergeability: p.mergeability ?? "unknown",
5733
+ failingChecks: (p.checks ?? []).filter((check) => check.state === "failure").map((check) => check.name),
5692
5734
  number: p.number,
5693
5735
  url: p.url,
5694
5736
  title: p.title,
@@ -5698,6 +5740,10 @@ function buildStatus({
5698
5740
  });
5699
5741
  return {
5700
5742
  schemaVersion: STATUS_SCHEMA_VERSION,
5743
+ progress: {
5744
+ done: m.program.filter((ticket) => m.isLeaf(ticket) && isDone(ticket)).length,
5745
+ total: m.program.filter(m.isLeaf).length
5746
+ },
5701
5747
  generatedAt: now.toISOString(),
5702
5748
  project: { name: config.project.name, slug: config.project.slug, repository: config.github.repository },
5703
5749
  programRoot: { id: m.root.id, title: m.root.title, url: m.root.url },
@@ -5798,7 +5844,7 @@ async function loadStatus(config, opts) {
5798
5844
  });
5799
5845
  }
5800
5846
  // package.json
5801
- var version = "0.2.10";
5847
+ var version = "0.2.12";
5802
5848
 
5803
5849
  // src/api.ts
5804
5850
  var runs = new WeakMap;
@@ -6464,6 +6510,29 @@ async function endWorkerSessions(io, config, credentials, ticket, reason, quiet)
6464
6510
  }
6465
6511
  }
6466
6512
 
6513
+ // src/presence.ts
6514
+ function detectCoordinator(io) {
6515
+ const read = (name) => io.env[name]?.trim() || null;
6516
+ const workspace = read("CONDUCTOR_WORKSPACE_ID");
6517
+ const harness = workspace ? "conductor-cloud" : read("CLAUDECODE") ? "claude-code" : ["CODEX_THREAD_ID", "CODEX_CI", "CODEX_SANDBOX_ENV", "CODEX_SESSION_ID"].some(read) ? "codex" : "terminal";
6518
+ const handle = read("ARMADA_COORDINATOR_HANDLE") ?? (workspace ? [workspace, read("CONDUCTOR_SESSION_ID")].filter(Boolean).join("/") : [io.machineName, io.ttyName].filter(Boolean).join("/") || null);
6519
+ const model = harness === "conductor-cloud" ? read("CONDUCTOR_MODEL") ?? read("CODEX_MODEL") ?? read("CLAUDE_MODEL") : harness === "claude-code" ? read("CLAUDE_MODEL") ?? read("ANTHROPIC_MODEL") : harness === "codex" ? read("CODEX_MODEL") ?? read("OPENAI_MODEL") : null;
6520
+ return { harness, handle, model, cliVersion: version };
6521
+ }
6522
+ async function recordPresence(io, config, credentials) {
6523
+ if (!credentials.armadaSignIn || credentials.armadaSignIn.kind === "worker")
6524
+ return;
6525
+ const { fleet, warning } = liveFleet(io, config, credentials);
6526
+ try {
6527
+ if (!fleet)
6528
+ throw new Error(warning ?? "Armada is unreachable");
6529
+ await fleet.coordinator(detectCoordinator(io));
6530
+ } catch (error) {
6531
+ io.stderr(`armada: warning: could not record coordinator activity (${error instanceof Error ? error.message : String(error)})
6532
+ `);
6533
+ }
6534
+ }
6535
+
6467
6536
  // src/inbox.ts
6468
6537
  var DEFAULT_WAIT_SECONDS = 300;
6469
6538
  async function ask(io, config, credentials, a) {
@@ -6513,8 +6582,9 @@ function renderEntries(project, items) {
6513
6582
  e.id === null ? e.kind : `#${e.id} ${e.kind}`,
6514
6583
  e.ticket,
6515
6584
  e.author && `from ${e.author}`,
6516
- e.request?.question && `answers #${e.request.question}`,
6585
+ e.request?.question && `${e.kind === "plan-changes" ? "amends" : "answers"} #${e.request.question}`,
6517
6586
  e.request?.profile && `profile ${e.request.profile}`,
6587
+ e.request?.pr && `PR #${e.request.pr}`,
6518
6588
  e.createdAt
6519
6589
  ].filter(Boolean).join(" · ");
6520
6590
  out.push(`${e.new ? "* " : " "}${head}`, ...e.body.split(`
@@ -6522,8 +6592,8 @@ function renderEntries(project, items) {
6522
6592
  }
6523
6593
  if (items.some((e) => e.kind === "question" || e.kind === "plan"))
6524
6594
  out.push(`Deliver each answer in the worker's session with the runtime guide, then record it: armada answer <id> "<answer>".`);
6525
- if (items.some((e) => e.kind === "answer-request" || e.kind === "launch-request"))
6526
- out.push('Dashboard requests: deliver an answer-request, then armada answer <id> "<answer>"; launch a launch-request (its claim resolves it), or decline it with armada answer <id> "<why>".');
6595
+ if (items.some((e) => ["answer-request", "launch-request", "merge-request", "release-request", "plan-changes"].includes(e.kind)))
6596
+ out.push('Dashboard requests: deliver an answer-request, then armada answer <id> "<answer>"; launch a launch-request (its claim resolves it), or decline it with armada answer <id> "<why>". Handle or decline merge-request, release-request and plan-changes, then resolve them with armada answer <id> "<result>". Plan changes are not an approval.');
6527
6597
  return out;
6528
6598
  }
6529
6599
  function renderInbox(r, next) {
@@ -6551,6 +6621,7 @@ async function inbox2(io, config, credentials, a) {
6551
6621
  const report = await checkInbox(fleet, {
6552
6622
  project: config.project.slug,
6553
6623
  coordinator: coordinatorHandle(io),
6624
+ facts: detectCoordinator(io),
6554
6625
  silentAfterMinutes: config.policy.silentAfterMinutes,
6555
6626
  notStartedMinutes: config.policy.notStartedMinutes,
6556
6627
  now: io.now ?? (() => new Date),
@@ -6679,6 +6750,7 @@ async function watchUntil(io, config, credentials, json, configPath) {
6679
6750
  const report = await watchInbox(fleet, {
6680
6751
  project,
6681
6752
  coordinator: coordinatorHandle(io),
6753
+ facts: detectCoordinator(io),
6682
6754
  silentAfterMinutes: config.policy.silentAfterMinutes,
6683
6755
  notStartedMinutes: config.policy.notStartedMinutes,
6684
6756
  seen: before?.seen ?? [],
@@ -7800,6 +7872,7 @@ async function statusAll(io, json) {
7800
7872
  warning = read.warning;
7801
7873
  const config = read.config;
7802
7874
  const own = p.ownLinearKey && !io.env.LINEAR_API_KEY?.trim() ? (await api.credentials(signIn, { project: p.slug })).linear?.apiKey : undefined;
7875
+ await recordPresence(io, config, credentials);
7803
7876
  const report = await loadStatus(config, {
7804
7877
  linearApiKey: own ?? linearApiKey,
7805
7878
  githubToken: credentials.githubToken,
@@ -8362,6 +8435,7 @@ async function status2(io, args) {
8362
8435
  const config = parseConfig(text, path);
8363
8436
  const { credentials } = await loadCredentials(io, { project: config.project.slug });
8364
8437
  const { linearApiKey, githubToken } = credentials;
8438
+ await recordPresence(io, config, credentials);
8365
8439
  if (!linearApiKey)
8366
8440
  throw missingKey(LINEAR_KEY);
8367
8441
  const live = statusLive(io, config, credentials);
@@ -8469,12 +8543,15 @@ async function dispatch(argv, io) {
8469
8543
  ticket: (stored) => command === "claim" ? args.rest[0]?.toUpperCase() ?? null : currentTicket(io, config, args.options.ticket, stored)
8470
8544
  } : undefined;
8471
8545
  const { credentials } = await loadCredentials(io, scope ? { worker: scope } : { project: config.project.slug });
8546
+ if (command === "inbox")
8547
+ await recordPresence(io, config, credentials);
8472
8548
  return await worker(io, config, credentials, args);
8473
8549
  }
8474
8550
  if (args.command === "watch") {
8475
8551
  const { path, text } = await findConfig(io, args.config, "watch");
8476
8552
  const config = parseConfig(text, path);
8477
8553
  const { credentials } = await loadCredentials(io, { project: config.project.slug });
8554
+ await recordPresence(io, config, credentials);
8478
8555
  return await watch2(io, config, credentials, args, path);
8479
8556
  }
8480
8557
  if (args.command === "hook")
@@ -8483,12 +8560,14 @@ async function dispatch(argv, io) {
8483
8560
  const { path, text } = await findConfig(io, args.config, "merge");
8484
8561
  const config = parseConfig(text, path);
8485
8562
  const { credentials } = await loadCredentials(io, { project: config.project.slug });
8563
+ await recordPresence(io, config, credentials);
8486
8564
  return await merge2(io, config, credentials, args, path);
8487
8565
  }
8488
8566
  if (args.command === "brief") {
8489
8567
  const { path, text } = await findConfig(io, args.config, "brief");
8490
8568
  const config = parseConfig(text, path);
8491
8569
  const { credentials } = await loadCredentials(io, { project: config.project.slug });
8570
+ await recordPresence(io, config, credentials);
8492
8571
  return await brief2(io, config, credentials, args, version, path);
8493
8572
  }
8494
8573
  if (args.command === "status") {
@@ -8683,6 +8762,8 @@ var exec = (command, args, { cwd }) => new Promise((done, fail) => {
8683
8762
  child.on("close", (code) => done({ code: code ?? 1, stdout, stderr }));
8684
8763
  });
8685
8764
  var code = await run(process.argv.slice(2), {
8765
+ machineName: hostname2(),
8766
+ ttyName: process.stdin.isTTY ? spawnSync("tty", [], { encoding: "utf8", stdio: ["inherit", "pipe", "ignore"] }).stdout?.trim() || null : null,
8686
8767
  cwd: process.cwd(),
8687
8768
  env: process.env,
8688
8769
  readFile: (path) => readFile3(path, "utf8").catch((err) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@the-vibe-company/armada",
3
- "version": "0.2.10",
3
+ "version": "0.2.12",
4
4
  "type": "module",
5
5
  "description": "Run a fleet of coding agents on one project: the armada command line.",
6
6
  "license": "MIT",