@h-rig/cli 0.0.6-alpha.27 → 0.0.6-alpha.29

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 (42) hide show
  1. package/dist/bin/rig.js +1505 -907
  2. package/dist/src/commands/_cli-format.js +211 -6
  3. package/dist/src/commands/_connection-state.js +1 -3
  4. package/dist/src/commands/_doctor-checks.js +3 -5
  5. package/dist/src/commands/_help-catalog.js +251 -66
  6. package/dist/src/commands/_operator-view.js +1 -3
  7. package/dist/src/commands/_parsers.js +0 -2
  8. package/dist/src/commands/_pi-frontend.js +1 -3
  9. package/dist/src/commands/_pi-worker-bridge-extension.js +1 -3
  10. package/dist/src/commands/_policy.js +0 -2
  11. package/dist/src/commands/_preflight.js +2 -4
  12. package/dist/src/commands/_run-driver-helpers.js +0 -2
  13. package/dist/src/commands/_server-client.js +1 -3
  14. package/dist/src/commands/_snapshot-upload.js +1 -3
  15. package/dist/src/commands/agent.js +7 -9
  16. package/dist/src/commands/browser.js +4 -6
  17. package/dist/src/commands/connect.js +5 -6
  18. package/dist/src/commands/dist.js +4 -6
  19. package/dist/src/commands/doctor.js +3 -5
  20. package/dist/src/commands/github.js +1 -3
  21. package/dist/src/commands/inbox.js +351 -31
  22. package/dist/src/commands/init.js +3 -5
  23. package/dist/src/commands/inspect.js +10 -12
  24. package/dist/src/commands/inspector.js +2 -4
  25. package/dist/src/commands/plugin.js +76 -22
  26. package/dist/src/commands/profile-and-review.js +8 -10
  27. package/dist/src/commands/queue.js +1 -3
  28. package/dist/src/commands/remote.js +18 -20
  29. package/dist/src/commands/repo-git-harness.js +6 -8
  30. package/dist/src/commands/run.js +159 -41
  31. package/dist/src/commands/server.js +6 -7
  32. package/dist/src/commands/setup.js +7 -15
  33. package/dist/src/commands/task-report-bug.js +5 -7
  34. package/dist/src/commands/task-run-driver.js +1 -3
  35. package/dist/src/commands/task.js +483 -50
  36. package/dist/src/commands/test.js +3 -5
  37. package/dist/src/commands/workspace.js +4 -6
  38. package/dist/src/commands.js +1508 -901
  39. package/dist/src/index.js +1511 -916
  40. package/dist/src/report-bug.js +3 -3
  41. package/dist/src/runner.js +2 -17
  42. package/package.json +6 -6
@@ -9,8 +9,6 @@ import { cancel as cancel2, confirm, isCancel as isCancel2 } from "@clack/prompt
9
9
  import { EventBus } from "@rig/runtime/control-plane/runtime/events";
10
10
  import { CliError } from "@rig/runtime/control-plane/errors";
11
11
  import { evaluate, loadPolicy, resolveAction } from "@rig/runtime/control-plane/runtime/guard";
12
- import { PluginManager } from "@rig/runtime/control-plane/runtime/plugins";
13
- import { loadRuntimeContextFromEnv } from "@rig/runtime/control-plane/runtime/context";
14
12
  import { buildBinary } from "@rig/runtime/control-plane/runtime/isolation";
15
13
  import { CliError as CliError2 } from "@rig/runtime/control-plane/errors";
16
14
  function takeFlag(args, flag) {
@@ -182,7 +180,7 @@ function resolveSelectedConnection(projectRoot, options = {}) {
182
180
  const global = readGlobalConnections(options);
183
181
  const connection = global.connections[repo.selected];
184
182
  if (!connection) {
185
- throw new CliError2(`Selected Rig connection "${repo.selected}" was not found. Run \`rig connect list\` or \`rig connect use local\`.`, 1);
183
+ throw new CliError2(`Selected Rig server "${repo.selected}" was not found. Run \`rig server list\` or \`rig server use local\`.`, 1);
186
184
  }
187
185
  return { alias: repo.selected, connection };
188
186
  }
@@ -562,7 +560,7 @@ async function runFastTaskRunPreflight(context, options = {}) {
562
560
  }
563
561
  }
564
562
  const repo = readRepoConnection(context.projectRoot);
565
- checks.push(repo ? preflightCheck("project-link", "project linked to Rig connection", repo.project ? "pass" : "warn", `${repo.selected}${repo.project ? ` -> ${repo.project}` : ""}`, "Run `rig init --yes --repo owner/repo` to record the GitHub repo slug.") : preflightCheck("project-link", "project linked to Rig connection", legacyServerCompatibility ? "warn" : "fail", "missing .rig/state/connection.json", "Run `rig init` or `rig connect use <alias|local>`."));
563
+ checks.push(repo ? preflightCheck("project-link", "project linked to Rig server", repo.project ? "pass" : "warn", `${repo.selected}${repo.project ? ` -> ${repo.project}` : ""}`, "Run `rig init --yes --repo owner/repo` to record the GitHub repo slug.") : preflightCheck("project-link", "project linked to Rig server", legacyServerCompatibility ? "warn" : "fail", "missing .rig/state/connection.json", "Run `rig init` or `rig server use <alias|local>`."));
566
564
  try {
567
565
  const auth = await request("/api/github/auth/status");
568
566
  checks.push(isAuthenticated(auth) ? preflightCheck("github-auth", "GitHub auth valid", "pass") : preflightCheck("github-auth", "GitHub auth valid", legacyServerCompatibility ? "warn" : "fail", "not authenticated", "Run `rig github auth import-gh` or `rig github auth token --token <token>`."));
@@ -1622,11 +1620,16 @@ async function attachRunOperatorView(context, input) {
1622
1620
  }
1623
1621
 
1624
1622
  // packages/cli/src/commands/_cli-format.ts
1623
+ import { log, note } from "@clack/prompts";
1625
1624
  import pc from "picocolors";
1626
1625
  function stringField(record, key, fallback = "") {
1627
1626
  const value = record[key];
1628
1627
  return typeof value === "string" && value.trim() ? value.trim() : fallback;
1629
1628
  }
1629
+ function numberField(record, key) {
1630
+ const value = record[key];
1631
+ return typeof value === "number" && Number.isFinite(value) ? value : null;
1632
+ }
1630
1633
  function arrayField(record, key) {
1631
1634
  const value = record[key];
1632
1635
  return Array.isArray(value) ? value.flatMap((entry) => typeof entry === "string" && entry.trim() ? [entry.trim()] : []) : [];
@@ -1647,16 +1650,40 @@ function pad(value, width) {
1647
1650
  }
1648
1651
  function statusColor(status) {
1649
1652
  const normalized = status.toLowerCase();
1650
- if (["completed", "merged", "closed", "done", "accepted", "pass", "selected"].includes(normalized))
1653
+ if (["completed", "merged", "closed", "done", "accepted", "pass", "selected", "approved"].includes(normalized))
1651
1654
  return pc.green;
1652
- if (["failed", "needs_attention", "needs-attention", "blocked", "error"].includes(normalized))
1655
+ if (["failed", "needs_attention", "needs-attention", "blocked", "error", "rejected"].includes(normalized))
1653
1656
  return pc.red;
1654
1657
  if (["running", "reviewing", "validating", "in_progress", "in-progress", "remote"].includes(normalized))
1655
1658
  return pc.cyan;
1656
- if (["ready", "open", "queued", "created", "preparing", "local"].includes(normalized))
1659
+ if (["ready", "open", "queued", "created", "preparing", "local", "pending"].includes(normalized))
1657
1660
  return pc.yellow;
1658
1661
  return pc.dim;
1659
1662
  }
1663
+ function compactValue(value) {
1664
+ if (value === null || value === undefined)
1665
+ return "";
1666
+ if (typeof value === "string")
1667
+ return value;
1668
+ if (typeof value === "number" || typeof value === "boolean")
1669
+ return String(value);
1670
+ if (Array.isArray(value))
1671
+ return value.map(compactValue).filter(Boolean).join(", ");
1672
+ return JSON.stringify(value);
1673
+ }
1674
+ function shouldUseClackOutput() {
1675
+ return Boolean(process.stdout.isTTY) && process.env.RIG_CLI_PLAIN_HELP !== "1";
1676
+ }
1677
+ function printFormattedOutput(message2, options = {}) {
1678
+ if (!shouldUseClackOutput()) {
1679
+ console.log(message2);
1680
+ return;
1681
+ }
1682
+ if (options.title)
1683
+ note(message2, options.title);
1684
+ else
1685
+ log.message(message2);
1686
+ }
1660
1687
  function formatStatusPill(status) {
1661
1688
  const label = status || "unknown";
1662
1689
  return statusColor(label)(`\u25CF ${label}`);
@@ -1665,7 +1692,7 @@ function formatSection(title, subtitle) {
1665
1692
  return `${pc.bold(pc.cyan("\u25C6"))} ${pc.bold(title)}${subtitle ? pc.dim(` \u2014 ${subtitle}`) : ""}`;
1666
1693
  }
1667
1694
  function formatSuccessCard(title, rows = []) {
1668
- const body = rows.filter(([, value]) => value !== undefined && value !== null && String(value).length > 0).map(([key, value]) => `${pc.dim("\u2502")} ${pc.dim(key.padEnd(9))} ${value}`);
1695
+ const body = rows.filter(([, value]) => value !== undefined && value !== null && String(value).length > 0).map(([key, value]) => `${pc.dim("\u2502")} ${pc.dim(key.padEnd(12))} ${value}`);
1669
1696
  return [formatSection(title), ...body].join(`
1670
1697
  `);
1671
1698
  }
@@ -1705,6 +1732,40 @@ function formatTaskList(tasks, options = {}) {
1705
1732
  return [formatSection("Tasks", `${rows.length} shown`), header, ...body, "", ...formatNextSteps(["Run one: `rig task run <id>` or `rig task run --next`", "Attach later: `rig run attach <run-id> --follow`"])].join(`
1706
1733
  `);
1707
1734
  }
1735
+ function formatTaskCard(task, options = {}) {
1736
+ const raw = rawObject(task);
1737
+ const id = stringField(task, "id", stringField(raw, "id", "<unknown>"));
1738
+ const status = stringField(task, "status", stringField(raw, "status", "unknown"));
1739
+ const title = stringField(task, "title", stringField(raw, "title", "Untitled task"));
1740
+ const source = stringField(task, "source", stringField(raw, "source", ""));
1741
+ const url = stringField(task, "url", stringField(raw, "url", ""));
1742
+ const number = numberField(task, "number") ?? numberField(raw, "number");
1743
+ const labels = arrayField(task, "labels").length > 0 ? arrayField(task, "labels") : arrayField(raw, "labels");
1744
+ const assignees = arrayField(task, "assignees").length > 0 ? arrayField(task, "assignees") : arrayField(raw, "assignees");
1745
+ const readiness = compactValue(task.readiness ?? raw.readiness);
1746
+ const validators = compactValue(task.validators ?? raw.validators ?? task.validation ?? raw.validation);
1747
+ const rows = [
1748
+ ["task", pc.bold(id)],
1749
+ ["status", formatStatusPill(status)],
1750
+ ["title", title],
1751
+ ["source", source],
1752
+ ["number", number],
1753
+ ["labels", labels.length ? labels.map((label) => `#${label}`).join(" ") : ""],
1754
+ ["assignees", assignees.join(", ")],
1755
+ ["readiness", readiness],
1756
+ ["validators", validators],
1757
+ ["url", url]
1758
+ ];
1759
+ return [
1760
+ formatSuccessCard(options.title ?? (options.selected ? "Selected task" : "Task"), rows),
1761
+ "",
1762
+ ...formatNextSteps([`Start: \`rig task run ${id}\``, `Details: \`rig task show ${id} --raw\``])
1763
+ ].join(`
1764
+ `);
1765
+ }
1766
+ function formatTaskDetails(task) {
1767
+ return formatTaskCard(task, { title: "Task details" });
1768
+ }
1708
1769
  function formatSubmittedRun(input) {
1709
1770
  const rows = [["run", pc.bold(input.runId)]];
1710
1771
  if (input.task) {
@@ -1713,14 +1774,361 @@ function formatSubmittedRun(input) {
1713
1774
  const title = stringField(input.task, "title", "Untitled task");
1714
1775
  rows.push(["task", `${pc.bold(id)} ${formatStatusPill(status)} ${title}`]);
1715
1776
  }
1777
+ const runtime = [input.runtimeAdapter || "pi", input.runtimeMode || "full-access", input.interactionMode || "default"].filter(Boolean).join(" \xB7 ");
1778
+ rows.push(["runtime", runtime]);
1716
1779
  return [
1717
1780
  formatSuccessCard("Run submitted", rows),
1718
1781
  "",
1719
- ...formatNextSteps([`Attach: \`rig run attach ${input.runId} --follow\``, `Inspect: \`rig run show --run ${input.runId}\``])
1782
+ ...formatNextSteps([
1783
+ `Attach: \`rig run attach ${input.runId} --follow\``,
1784
+ `Inspect: \`rig run show ${input.runId}\``,
1785
+ input.detached ? "Submitted detached; attach when you are ready." : "Interactive mode opens the native bundled Pi frontend."
1786
+ ])
1720
1787
  ].join(`
1721
1788
  `);
1722
1789
  }
1723
1790
 
1791
+ // packages/cli/src/commands/_help-catalog.ts
1792
+ import { intro, log as log2, note as note2, outro } from "@clack/prompts";
1793
+ import pc2 from "picocolors";
1794
+ var TOP_LEVEL_SECTIONS = [
1795
+ {
1796
+ title: "Server",
1797
+ subtitle: "choose the local or remote Rig server that owns this repo",
1798
+ commands: [
1799
+ { command: "rig server status", description: "Show the selected local/remote server for this repo." },
1800
+ { command: "rig server use local", description: "Switch this repo back to the local Rig server." },
1801
+ { command: "rig server add <alias> <url>", description: "Save a remote Rig server alias." },
1802
+ { command: "rig server use <alias>", description: "Switch this repo to a saved remote server." },
1803
+ { command: "rig server list", description: "Show saved server aliases, including local." }
1804
+ ]
1805
+ },
1806
+ {
1807
+ title: "Tasks",
1808
+ subtitle: "find work, inspect it, and submit Pi-backed workers",
1809
+ commands: [
1810
+ { command: "rig task list", description: "List tasks from the selected task source/server." },
1811
+ { command: "rig task next", description: "Show the next matching task as a selected-task card." },
1812
+ { command: "rig task show <id>", description: "Show a human task summary; add --raw or --json for the full payload." },
1813
+ { command: "rig task run <id|--next> [--detach]", description: "Submit a task run; interactive mode follows with bundled Pi." }
1814
+ ]
1815
+ },
1816
+ {
1817
+ title: "Runs",
1818
+ subtitle: "observe, attach to, and stop live or recent runs",
1819
+ commands: [
1820
+ { command: "rig run list", description: "List recent runs from the selected server or local state." },
1821
+ { command: "rig run show <id>", description: "Show a human run summary; add --raw or --json for the full payload." },
1822
+ { command: "rig run attach <id> --follow", description: "Open the native bundled Pi live view for a worker run." },
1823
+ { command: "rig run stop <id>", description: "Request cancellation for a running worker." }
1824
+ ]
1825
+ },
1826
+ {
1827
+ title: "Review / inbox",
1828
+ subtitle: "clear blocked runs and configure completion review",
1829
+ commands: [
1830
+ { command: "rig inbox approvals", description: "List pending approval requests from local/server run state." },
1831
+ { command: "rig inbox inputs", description: "List pending user-input requests from local/server run state." },
1832
+ { command: "rig review show|set", description: "Inspect or change the review gate policy." }
1833
+ ]
1834
+ },
1835
+ {
1836
+ title: "Health / setup",
1837
+ subtitle: "bootstrap and diagnose the repo/server/GitHub/Pi path",
1838
+ commands: [
1839
+ { command: "rig init", description: "Interactive setup: config, GitHub auth, task source, server, checkout, Pi." },
1840
+ { command: "rig doctor", description: "Diagnose project/server/GitHub/task/Pi wiring." },
1841
+ { command: "rig github auth status", description: "Show GitHub auth state on the selected Rig server." }
1842
+ ]
1843
+ }
1844
+ ];
1845
+ var PRIMARY_GROUPS = [
1846
+ {
1847
+ name: "server",
1848
+ summary: "Choose, inspect, and start the Rig server that owns tasks and runs.",
1849
+ usage: ["rig server <status|list|add|use|start> [options]"],
1850
+ commands: [
1851
+ { command: "status", description: "Show the selected server for this repo.", primary: true },
1852
+ { command: "use local", description: "Switch this repo to the local Rig server.", primary: true },
1853
+ { command: "add <alias> <url>", description: "Save a remote Rig server URL.", primary: true },
1854
+ { command: "use <alias>", description: "Select a saved remote server alias.", primary: true },
1855
+ { command: "list", description: "List saved local/remote server aliases.", primary: true },
1856
+ { command: "start [--host <host>] [--port <n>]", description: "Start a local rig-server process." }
1857
+ ],
1858
+ examples: [
1859
+ "rig server status",
1860
+ "rig server add prod https://where.rig-does.work",
1861
+ "rig server use prod",
1862
+ "rig server use local",
1863
+ "rig server start --port 3773"
1864
+ ],
1865
+ next: ["Use `rig task list` to see server-owned work.", "Use `rig run list` or `rig run attach <id> --follow` to monitor runs."],
1866
+ advanced: ["Compatibility alias: `rig connect ...` remains callable."]
1867
+ },
1868
+ {
1869
+ name: "task",
1870
+ summary: "Find work, start Pi-backed runs, and validate task results.",
1871
+ usage: ["rig task <list|next|show|run> [options]"],
1872
+ commands: [
1873
+ { command: "list [--assignee <login|@me>] [--state open|closed]", description: "List tasks from the selected server/source.", primary: true },
1874
+ { command: "next [filters]", description: "Render the next matching task as a selected-task card.", primary: true },
1875
+ { command: "show <id>|--task <id> [--raw]", description: "Show a human task summary; --raw prints the full payload.", primary: true },
1876
+ { command: "run [#<issue>|<task-id>|--next|--task <id>]", description: "Submit a task run; interactive follows with bundled Pi.", primary: true },
1877
+ { command: "validate|verify [--task <id>]", description: "Run configured task checks/review gates." },
1878
+ { command: "details --task <id>", description: "Show full task info from the configured source." },
1879
+ { command: "reopen [--task <id> | --all] [--reason <text>]", description: "Reopen closed task(s) in the configured source." },
1880
+ { command: "reset --task <id>", description: "Compatibility spelling of `reopen --task <id>`." },
1881
+ { command: "artifacts|artifact-dir|artifact-write", description: "Inspect or write task artifacts." },
1882
+ { command: "report-bug", description: "Create a structured bug report/task." }
1883
+ ],
1884
+ examples: [
1885
+ "rig task list --assignee @me --limit 20",
1886
+ "rig task next",
1887
+ "rig task show 123 --raw",
1888
+ "rig task run --next",
1889
+ "rig task run #123 --runtime-adapter pi",
1890
+ "rig task run --title 'Investigate deploy drift' --initial-prompt 'Check server health'"
1891
+ ],
1892
+ next: ["Use `--detach` to submit without attaching.", "Use `rig run attach <run-id> --follow` to rejoin a live run."]
1893
+ },
1894
+ {
1895
+ name: "run",
1896
+ summary: "Observe, attach to, and control Rig runs.",
1897
+ usage: ["rig run <list|status|show|attach|stop> [options]"],
1898
+ commands: [
1899
+ { command: "list", description: "List recent runs from the selected server or local state.", primary: true },
1900
+ { command: "status", description: "Render active and recent run groups.", primary: true },
1901
+ { command: "show <id>|--run <id> [--raw]", description: "Show a human run summary; --raw prints the full payload.", primary: true },
1902
+ { command: "attach <run-id>|--run <id> [--follow]", description: "Attach to the run; --follow launches native bundled Pi for live Pi runs.", primary: true },
1903
+ { command: "stop [<run-id>|--run <id>]", description: "Request stop for one run or local active runs.", primary: true },
1904
+ { command: "timeline --run <id> [--follow]", description: "Stream raw run timeline events." },
1905
+ { command: "resume", description: "Resume the most recent interrupted local run." },
1906
+ { command: "restart", description: "Restart the most recent local run from a clean runtime." },
1907
+ { command: "delete|cleanup", description: "Remove completed run records/artifacts." }
1908
+ ],
1909
+ examples: [
1910
+ "rig run list",
1911
+ "rig run status",
1912
+ "rig run show <run-id>",
1913
+ "rig run attach <run-id> --follow",
1914
+ "rig run stop <run-id>"
1915
+ ],
1916
+ next: ["Use `rig task run --next` to create a new run.", "Use `--json` when scripts need the full structured record."]
1917
+ },
1918
+ {
1919
+ name: "inbox",
1920
+ summary: "Review approval and user-input requests that block worker runs.",
1921
+ usage: ["rig inbox <approvals|approve|inputs|respond> [options]"],
1922
+ commands: [
1923
+ { command: "approvals [--run <id>] [--task <id>]", description: "List pending approvals.", primary: true },
1924
+ { command: "inputs [--run <id>] [--task <id>]", description: "List pending user-input requests.", primary: true },
1925
+ { command: "approve --run <id> --request <id> --decision approve|reject", description: "Resolve an approval request." },
1926
+ { command: "respond --run <id> --request <id> --answer key=value", description: "Answer a user-input request." }
1927
+ ],
1928
+ examples: [
1929
+ "rig inbox approvals",
1930
+ "rig inbox inputs --run <run-id>",
1931
+ "rig inbox approve --run <run-id> --request <request-id> --decision approve"
1932
+ ],
1933
+ next: ["Rejoin the run after resolving a block: `rig run attach <run-id> --follow`."]
1934
+ },
1935
+ {
1936
+ name: "review",
1937
+ summary: "Inspect or change completion review gate policy.",
1938
+ usage: ["rig review <show|set>"],
1939
+ commands: [
1940
+ { command: "show", description: "Show current review gate settings.", primary: true },
1941
+ { command: "set <off|advisory|required> [--provider greptile]", description: "Change review strictness/provider.", primary: true }
1942
+ ],
1943
+ examples: ["rig review show", "rig review set required --provider greptile"],
1944
+ next: ["Use `rig inbox approvals` for blocked run handoffs."]
1945
+ },
1946
+ {
1947
+ name: "init",
1948
+ summary: "Set up Rig for this repo: server, GitHub auth, checkout strategy, task source, and Pi wiring.",
1949
+ usage: ["rig init [--yes] [--server local|remote] [--repo owner/repo] [--remote-url <url>]"],
1950
+ commands: [
1951
+ { command: "init", description: "Interactive setup wizard for a new or existing Rig repo.", primary: true },
1952
+ { command: "init --yes", description: "Non-interactive setup using detected/default settings.", primary: true },
1953
+ { command: "init --server remote --remote-url <url>", description: "Link this repo to a remote Rig server.", primary: true },
1954
+ { command: "init --repair", description: "Repair missing private state without replacing project config." }
1955
+ ],
1956
+ examples: [
1957
+ "rig init",
1958
+ "rig init --yes --repo humanity-org/humanwork",
1959
+ "rig init --server remote --remote-url https://where.rig-does.work --repo owner/repo"
1960
+ ],
1961
+ next: ["After init, run `rig server status`.", "Then use `rig task list` and `rig task run --next` for day-to-day work."]
1962
+ },
1963
+ {
1964
+ name: "doctor",
1965
+ summary: "Diagnostics for project/server/GitHub/Pi state.",
1966
+ usage: ["rig doctor"],
1967
+ commands: [
1968
+ { command: "doctor", description: "Run setup and runtime diagnostics.", primary: true },
1969
+ { command: "check", description: "Compatibility spelling for diagnostics." }
1970
+ ],
1971
+ examples: ["rig doctor", "rig doctor --json"],
1972
+ next: ["Use `rig server status` and `rig github auth status` to inspect common failure points."]
1973
+ },
1974
+ {
1975
+ name: "github",
1976
+ summary: "GitHub auth helpers for the selected Rig server.",
1977
+ usage: ["rig github auth <status|import-gh|token>"],
1978
+ commands: [
1979
+ { command: "auth status", description: "Show GitHub auth state.", primary: true },
1980
+ { command: "auth import-gh", description: "Import the current `gh` token into the selected server." },
1981
+ { command: "auth token --token <token>", description: "Store a token on the selected server." }
1982
+ ],
1983
+ examples: ["rig github auth status", "rig github auth import-gh"],
1984
+ next: ["After auth is valid, use `rig task run --next`."]
1985
+ }
1986
+ ];
1987
+ var ADVANCED_GROUPS = [
1988
+ { name: "connect", summary: "Compatibility alias for `rig server` selection commands.", usage: ["rig connect <status|list|add|use>"], commands: [{ command: "status|list|add|use", description: "Use `rig server ...` for the primary UX." }] },
1989
+ { name: "setup", summary: "Bootstrap/check local setup.", usage: ["rig setup <bootstrap|check|preflight>"], commands: [{ command: "bootstrap|check|preflight", description: "Setup helpers." }] },
1990
+ { name: "inspect", summary: "Inspect logs, artifacts, graphs, failures.", usage: ["rig inspect <logs|artifacts|failures|graph|audit|diff>"], commands: [{ command: "logs --task <id>", description: "Inspect task logs." }] },
1991
+ { name: "repo", summary: "Repository sync/baseline helpers.", usage: ["rig repo <sync|reset-baseline>"], commands: [{ command: "sync", description: "Sync project repository state." }] },
1992
+ { name: "profile", summary: "Runtime profile/model defaults.", usage: ["rig profile <show|set>"], commands: [{ command: "show", description: "Show active profile." }] },
1993
+ {
1994
+ name: "browser",
1995
+ summary: "Browser/app diagnostics for browser-required tasks.",
1996
+ usage: ["rig browser <help|explain|demo|app|hp-next> [options]"],
1997
+ commands: [
1998
+ { command: "help", description: "Rich browser command help (canonical: `rig browser help`)." },
1999
+ { command: "explain", description: "Explain the browser-required task contract." },
2000
+ { command: "demo", description: "Run browser demo flows against a local page." },
2001
+ { command: "app", description: "Launch the Rig Browser workstation app." },
2002
+ { command: "hp-next <dev|check|e2e|reset>", description: "Drive the hp-next browser test harness." }
2003
+ ]
2004
+ },
2005
+ {
2006
+ name: "plugin",
2007
+ summary: "Plugin listing, validation, and plugin-contributed commands.",
2008
+ usage: ["rig plugin <list|validate|run> [options]"],
2009
+ commands: [
2010
+ { command: "list", description: "List plugins declared in rig.config.ts and their contributions." },
2011
+ { command: "validate --task <id>", description: "Run plugin-contributed validators for a task." },
2012
+ { command: "run <command-id> [args...]", description: "Execute a plugin-contributed CLI command (also callable as `rig <command-id>`)." }
2013
+ ]
2014
+ },
2015
+ { name: "queue", summary: "Run task queues locally.", usage: ["rig queue run [options]"], commands: [{ command: "run", description: "Process queue work." }] },
2016
+ { name: "agent", summary: "Runtime agent workspace helpers.", usage: ["rig agent <list|prepare|run|cleanup>"], commands: [{ command: "list", description: "List prepared agents." }] },
2017
+ { name: "inspector", summary: "Event stream and drift scanners.", usage: ["rig inspector <stream|scan-upstream-drift>"], commands: [{ command: "stream", description: "Stream events." }] },
2018
+ { name: "dist", summary: "Build/install packaged Rig CLI.", usage: ["rig dist <build|install|doctor>"], commands: [{ command: "build", description: "Build distribution." }] },
2019
+ { name: "workspace", summary: "Workspace topology/service helpers.", usage: ["rig workspace <summary|topology|remote-hosts>"], commands: [{ command: "summary", description: "Show workspace summary." }] },
2020
+ { name: "remote", summary: "Compatibility remote orchestration controls.", usage: ["rig remote <status|watch|pause|resume|...>"], commands: [{ command: "status", description: "Show remote state." }] },
2021
+ { name: "git", summary: "Pass through to Rig git-flow helper.", usage: ["rig git <args...>"], commands: [{ command: "<args...>", description: "Advanced git flow operations." }] },
2022
+ { name: "harness", summary: "Pass through to runtime harness CLI.", usage: ["rig harness <args...>"], commands: [{ command: "<args...>", description: "Advanced harness operations." }] },
2023
+ { name: "test", summary: "Project test wrappers.", usage: ["rig test <unit|e2e|all>"], commands: [{ command: "all", description: "Run configured project tests." }] }
2024
+ ];
2025
+ var ALL_GROUPS = [...PRIMARY_GROUPS, ...ADVANCED_GROUPS];
2026
+ function heading(title) {
2027
+ return pc2.bold(pc2.cyan(title));
2028
+ }
2029
+ function commandLine(command, description) {
2030
+ const commandColumn = command.length >= 38 ? `${command} ` : command.padEnd(38);
2031
+ return `${pc2.dim("\u2502")} ${pc2.bold(commandColumn)} ${description}`;
2032
+ }
2033
+ function renderCommandBlock(commands) {
2034
+ return commands.map((entry) => commandLine(entry.command, entry.description)).join(`
2035
+ `);
2036
+ }
2037
+ function renderGroup(group) {
2038
+ const lines = [
2039
+ `${heading(`rig ${group.name}`)} \u2014 ${group.summary}`,
2040
+ "",
2041
+ pc2.bold("Usage"),
2042
+ ...group.usage.map((line) => ` ${line}`),
2043
+ "",
2044
+ pc2.bold("Commands"),
2045
+ ...group.commands.map((entry) => commandLine(entry.command, entry.description))
2046
+ ];
2047
+ if (group.examples?.length) {
2048
+ lines.push("", pc2.bold("Examples"), ...group.examples.map((line) => ` ${pc2.dim("$")} ${line}`));
2049
+ }
2050
+ if (group.next?.length) {
2051
+ lines.push("", pc2.bold("Next steps"), ...group.next.map((line) => ` ${pc2.dim("\u203A")} ${line}`));
2052
+ }
2053
+ if (group.advanced?.length) {
2054
+ lines.push("", pc2.bold("Compatibility / advanced"), ...group.advanced.map((line) => ` ${pc2.dim("\u203A")} ${line}`));
2055
+ }
2056
+ return lines.join(`
2057
+ `);
2058
+ }
2059
+ function renderTopLevelHelp() {
2060
+ return [
2061
+ `${heading("rig")} ${pc2.dim("\u2014 server-owned task/run control plane for Pi-backed engineering work")}`,
2062
+ pc2.dim("Current path: select a server, choose a task, submit a run, attach with native Pi, clear inbox/review gates."),
2063
+ "",
2064
+ ...TOP_LEVEL_SECTIONS.flatMap((section) => [
2065
+ `${pc2.bold(pc2.magenta(`\u25C7 ${section.title}`))} \u2014 ${pc2.dim(section.subtitle)}`,
2066
+ renderCommandBlock(section.commands),
2067
+ ""
2068
+ ]),
2069
+ pc2.dim("More: `rig help --advanced` for dev/compatibility commands; `rig <group> --help` for rich per-group help; `rig --version` for the installed version."),
2070
+ "",
2071
+ pc2.bold("Global options"),
2072
+ commandLine("--project <path>", "Use a project root instead of auto-discovery."),
2073
+ commandLine("--json", "Emit structured output for scripts/agents."),
2074
+ commandLine("--dry-run", "Print the command plan without mutating state.")
2075
+ ].join(`
2076
+ `).trimEnd();
2077
+ }
2078
+ function renderGroupHelp(groupName) {
2079
+ const group = ALL_GROUPS.find((candidate) => candidate.name === groupName);
2080
+ return group ? renderGroup(group) : null;
2081
+ }
2082
+ function shouldUseClackOutput2() {
2083
+ return Boolean(process.stdout.isTTY) && process.env.RIG_CLI_PLAIN_HELP !== "1";
2084
+ }
2085
+ function printTopLevelHelp() {
2086
+ if (!shouldUseClackOutput2()) {
2087
+ console.log(renderTopLevelHelp());
2088
+ return;
2089
+ }
2090
+ intro("rig");
2091
+ for (const section of TOP_LEVEL_SECTIONS) {
2092
+ note2(renderCommandBlock(section.commands), `${section.title} \u2014 ${section.subtitle}`);
2093
+ }
2094
+ log2.info("More: rig help --advanced \xB7 rig <group> --help \xB7 rig --version");
2095
+ note2([
2096
+ commandLine("--project <path>", "Use a project root instead of auto-discovery."),
2097
+ commandLine("--json", "Emit structured output for scripts/agents."),
2098
+ commandLine("--dry-run", "Print the command plan without mutating state.")
2099
+ ].join(`
2100
+ `), "Global options");
2101
+ outro("Server \u2192 task \u2192 run \u2192 inbox/review.");
2102
+ }
2103
+ function printGroupHelpDocument(groupName) {
2104
+ const rendered = renderGroupHelp(groupName) ?? renderTopLevelHelp();
2105
+ if (!shouldUseClackOutput2()) {
2106
+ console.log(rendered);
2107
+ return;
2108
+ }
2109
+ const group = ALL_GROUPS.find((candidate) => candidate.name === groupName);
2110
+ if (!group) {
2111
+ printTopLevelHelp();
2112
+ return;
2113
+ }
2114
+ intro(`rig ${group.name}`);
2115
+ note2(group.summary, "Purpose");
2116
+ note2(group.usage.join(`
2117
+ `), "Usage");
2118
+ note2(group.commands.map((entry) => commandLine(entry.command, entry.description)).join(`
2119
+ `), "Commands");
2120
+ if (group.examples?.length)
2121
+ note2(group.examples.map((line) => `$ ${line}`).join(`
2122
+ `), "Examples");
2123
+ if (group.next?.length)
2124
+ note2(group.next.map((line) => `\u203A ${line}`).join(`
2125
+ `), "Next steps");
2126
+ if (group.advanced?.length)
2127
+ log2.info(group.advanced.join(`
2128
+ `));
2129
+ outro("Run with --json when scripts need structured output.");
2130
+ }
2131
+
1724
2132
  // packages/cli/src/commands/task.ts
1725
2133
  import { buildPluginHostContext } from "@rig/runtime/control-plane/plugin-host-context";
1726
2134
  import { loadConfig } from "@rig/core/load-config";
@@ -1872,27 +2280,30 @@ function summarizeTask(task, options = {}) {
1872
2280
  ...options.raw ? { raw: raw ?? task } : {}
1873
2281
  };
1874
2282
  }
1875
- function printTaskSummary(task) {
1876
- console.log(formatTaskList([task]));
1877
- }
1878
2283
  async function validatorRegistryForTaskCommands(projectRoot) {
1879
2284
  return buildPluginHostContext(projectRoot).then((ctx) => ctx?.validatorRegistry ?? undefined).catch(() => {
1880
2285
  return;
1881
2286
  });
1882
2287
  }
1883
2288
  async function executeTask(context, args, options) {
1884
- const [command = "info", ...rest] = args;
2289
+ if (args.length === 0) {
2290
+ if (context.outputMode === "text") {
2291
+ printGroupHelpDocument("task");
2292
+ }
2293
+ return { ok: true, group: "task", command: "help" };
2294
+ }
2295
+ const [command = "help", ...rest] = args;
1885
2296
  switch (command) {
1886
2297
  case "list": {
1887
2298
  let pending = rest;
1888
2299
  const rawResult = takeFlag(pending, "--raw");
1889
2300
  pending = rawResult.rest;
1890
2301
  const { filters, rest: remaining } = parseTaskFilters(pending);
1891
- requireNoExtraArgs(remaining, "bun run rig task list [--raw] [--assignee <login|@me>] [--assigned-to <login|me|@me>] [--state open|closed] [--status <status>] [--limit <n>]");
2302
+ requireNoExtraArgs(remaining, "rig task list [--raw] [--assignee <login|@me>] [--assigned-to <login|me|@me>] [--state open|closed] [--status <status>] [--limit <n>]");
1892
2303
  const tasks = await listWorkspaceTasksViaServer(context, filters);
1893
2304
  if (context.outputMode === "text") {
1894
2305
  const renderedTasks = rawResult.value ? tasks.map((task) => summarizeTask(task, { raw: true })) : tasks.map((task) => summarizeTask(task));
1895
- console.log(formatTaskList(renderedTasks, { raw: rawResult.value }));
2306
+ printFormattedOutput(formatTaskList(renderedTasks, { raw: rawResult.value }));
1896
2307
  }
1897
2308
  return {
1898
2309
  ok: true,
@@ -1902,10 +2313,13 @@ async function executeTask(context, args, options) {
1902
2313
  };
1903
2314
  }
1904
2315
  case "show": {
1905
- const taskOption = takeOption(rest, "--task");
2316
+ let pending = rest;
2317
+ const rawResult = takeFlag(pending, "--raw");
2318
+ pending = rawResult.rest;
2319
+ const taskOption = takeOption(pending, "--task");
1906
2320
  const positional = taskOption.rest.length > 0 && taskOption.rest[0] && !taskOption.rest[0].startsWith("-") ? taskOption.rest[0] : undefined;
1907
2321
  const remaining = positional ? taskOption.rest.slice(1) : taskOption.rest;
1908
- requireNoExtraArgs(remaining, "bun run rig task show <id>|--task <id>");
2322
+ requireNoExtraArgs(remaining, "rig task show <id>|--task <id> [--raw]");
1909
2323
  const taskId3 = normalizeTaskRunTaskId(taskOption.value ?? positional);
1910
2324
  if (!taskId3)
1911
2325
  throw new CliError2("task show requires a task id.", 2);
@@ -1913,19 +2327,20 @@ async function executeTask(context, args, options) {
1913
2327
  if (!task)
1914
2328
  throw new CliError2(`Task not found: ${taskId3}`, 3);
1915
2329
  const summary = summarizeTask(task, { raw: true });
1916
- if (context.outputMode === "text")
1917
- console.log(JSON.stringify(summary, null, 2));
1918
- return { ok: true, group: "task", command, details: { task: summary } };
2330
+ if (context.outputMode === "text") {
2331
+ printFormattedOutput(rawResult.value ? JSON.stringify(summary, null, 2) : formatTaskDetails(summary));
2332
+ }
2333
+ return { ok: true, group: "task", command, details: { task: summary, raw: rawResult.value } };
1919
2334
  }
1920
2335
  case "next": {
1921
2336
  const { filters, rest: remaining } = parseTaskFilters(rest);
1922
- requireNoExtraArgs(remaining, "bun run rig task next [--assignee <login|@me>] [--assigned-to <login|me|@me>] [--state open|closed] [--status <status>] [--limit <n>]");
2337
+ requireNoExtraArgs(remaining, "rig task next [--assignee <login|@me>] [--assigned-to <login|me|@me>] [--state open|closed] [--status <status>] [--limit <n>]");
1923
2338
  const selected = await selectNextWorkspaceTaskViaServer(context, filters);
1924
2339
  if (context.outputMode === "text") {
1925
2340
  if (selected.task) {
1926
- printTaskSummary(selected.task);
2341
+ printFormattedOutput(formatTaskCard(summarizeTask(selected.task, { raw: true }), { title: "Selected task", selected: true }));
1927
2342
  } else {
1928
- console.log("No matching tasks.");
2343
+ printFormattedOutput("No matching tasks.\n\nNext\n\u203A Try `rig task list` to inspect available work.\n\u203A Check server: `rig server status`");
1929
2344
  }
1930
2345
  }
1931
2346
  return {
@@ -1941,31 +2356,31 @@ async function executeTask(context, args, options) {
1941
2356
  }
1942
2357
  case "info": {
1943
2358
  const { value: task, rest: remaining } = takeOption(rest, "--task");
1944
- requireNoExtraArgs(remaining, "bun run rig task info [--task <beads-id>]");
2359
+ requireNoExtraArgs(remaining, "rig task info [--task <task-id>]");
1945
2360
  await withMutedConsole(context.outputMode === "json", () => taskInfo(context.projectRoot, task || undefined));
1946
2361
  return { ok: true, group: "task", command, details: { task: task || null } };
1947
2362
  }
1948
2363
  case "scope": {
1949
2364
  const filesFlag = takeFlag(rest, "--files");
1950
2365
  const { value: task, rest: remaining } = takeOption(filesFlag.rest, "--task");
1951
- requireNoExtraArgs(remaining, "bun run rig task scope [--task <id>] [--files]");
2366
+ requireNoExtraArgs(remaining, "rig task scope [--task <id>] [--files]");
1952
2367
  await withMutedConsole(context.outputMode === "json", () => taskScope(context.projectRoot, filesFlag.value, task || undefined));
1953
2368
  return { ok: true, group: "task", command, details: { files: filesFlag.value, task: task || null } };
1954
2369
  }
1955
2370
  case "deps":
1956
- requireNoExtraArgs(rest, "bun run rig task deps");
2371
+ requireNoExtraArgs(rest, "rig task deps");
1957
2372
  await withMutedConsole(context.outputMode === "json", () => taskDeps(context.projectRoot));
1958
2373
  return { ok: true, group: "task", command };
1959
2374
  case "status":
1960
- requireNoExtraArgs(rest, "bun run rig task status");
2375
+ requireNoExtraArgs(rest, "rig task status");
1961
2376
  withMutedConsole(context.outputMode === "json", () => taskStatus2(context.projectRoot));
1962
2377
  return { ok: true, group: "task", command };
1963
2378
  case "artifacts":
1964
- requireNoExtraArgs(rest, "bun run rig task artifacts");
2379
+ requireNoExtraArgs(rest, "rig task artifacts");
1965
2380
  withMutedConsole(context.outputMode === "json", () => taskArtifacts(context.projectRoot));
1966
2381
  return { ok: true, group: "task", command };
1967
2382
  case "artifact-dir": {
1968
- requireNoExtraArgs(rest, "bun run rig task artifact-dir");
2383
+ requireNoExtraArgs(rest, "rig task artifact-dir");
1969
2384
  const path = taskArtifactDir(context.projectRoot);
1970
2385
  if (context.outputMode === "text") {
1971
2386
  console.log(path);
@@ -1974,7 +2389,7 @@ async function executeTask(context, args, options) {
1974
2389
  }
1975
2390
  case "artifact-write": {
1976
2391
  if (rest.length < 1) {
1977
- throw new CliError2(`Usage: bun run rig task artifact-write <filename> [--file <path>]
2392
+ throw new CliError2(`Usage: rig task artifact-write <filename> [--file <path>]
1978
2393
  ` + ` Reads content from stdin (or --file), writes to the active task artifact dir.
1979
2394
  ` + " Example: echo '...' | rig task artifact-write collection-audit.md");
1980
2395
  }
@@ -1987,7 +2402,7 @@ async function executeTask(context, args, options) {
1987
2402
  content = await readStdin();
1988
2403
  }
1989
2404
  if (!artifactFilename) {
1990
- throw new CliError2("Usage: bun run rig task artifact-write <filename> [--file path]");
2405
+ throw new CliError2("Usage: rig task artifact-write <filename> [--file path]");
1991
2406
  }
1992
2407
  withMutedConsole(context.outputMode === "json", () => taskArtifactWrite(context.projectRoot, artifactFilename, content));
1993
2408
  return { ok: true, group: "task", command, details: { filename: artifactFilename } };
@@ -1996,11 +2411,11 @@ async function executeTask(context, args, options) {
1996
2411
  return options.executeTaskReportBug(context, rest);
1997
2412
  case "lookup": {
1998
2413
  if (rest.length !== 1) {
1999
- throw new CliError2("Usage: bun run rig task lookup <beads-id>");
2414
+ throw new CliError2("Usage: rig task lookup <task-id>");
2000
2415
  }
2001
2416
  const lookupId = rest[0];
2002
2417
  if (!lookupId) {
2003
- throw new CliError2("Usage: bun run rig task lookup <beads-id>");
2418
+ throw new CliError2("Usage: rig task lookup <task-id>");
2004
2419
  }
2005
2420
  const result = taskLookup(context.projectRoot, lookupId);
2006
2421
  if (context.outputMode === "text") {
@@ -2010,17 +2425,17 @@ async function executeTask(context, args, options) {
2010
2425
  }
2011
2426
  case "record": {
2012
2427
  if (rest.length < 2) {
2013
- throw new CliError2("Usage: bun run rig task record <decision|failure> <text>");
2428
+ throw new CliError2("Usage: rig task record <decision|failure> <text>");
2014
2429
  }
2015
2430
  const type = rest[0];
2016
2431
  if (type !== "decision" && type !== "failure") {
2017
- throw new CliError2("Usage: bun run rig task record <decision|failure> <text>");
2432
+ throw new CliError2("Usage: rig task record <decision|failure> <text>");
2018
2433
  }
2019
2434
  withMutedConsole(context.outputMode === "json", () => taskRecord(context.projectRoot, type, rest.slice(1).join(" ")));
2020
2435
  return { ok: true, group: "task", command, details: { type: rest[0] } };
2021
2436
  }
2022
2437
  case "ready":
2023
- requireNoExtraArgs(rest, "bun run rig task ready");
2438
+ requireNoExtraArgs(rest, "rig task ready");
2024
2439
  await withMutedConsole(context.outputMode === "json", () => taskReady(context.projectRoot));
2025
2440
  return { ok: true, group: "task", command };
2026
2441
  case "run": {
@@ -2057,7 +2472,7 @@ async function executeTask(context, args, options) {
2057
2472
  if (positionalTaskId) {
2058
2473
  pending = pending.slice(1);
2059
2474
  }
2060
- requireNoExtraArgs(pending, "bun run rig task run [#<issue>|<task-id>] [--next] [--task <id>] [--detach] [--assignee <login|@me>] [--assigned-to <login|me|@me>] [--state open|closed] [--status <status>] [--limit <n>] [--title <text>] [--runtime-adapter claude-code|codex|pi] [--model <model>] [--runtime-mode <mode>] [--interaction-mode <mode>] [--initial-prompt <text>] [--pr auto|ask|off] [--no-pr] [--dirty-baseline head|dirty-snapshot] [--skip-project-sync]");
2475
+ requireNoExtraArgs(pending, "rig task run [#<issue>|<task-id>] [--next] [--task <id>] [--detach] [--assignee <login|@me>] [--assigned-to <login|me|@me>] [--state open|closed] [--status <status>] [--limit <n>] [--title <text>] [--runtime-adapter claude-code|codex|pi] [--model <model>] [--runtime-mode <mode>] [--interaction-mode <mode>] [--initial-prompt <text>] [--pr auto|ask|off] [--no-pr] [--dirty-baseline head|dirty-snapshot] [--skip-project-sync]");
2061
2476
  if (nextResult.value && (taskResult.value || positionalTaskId)) {
2062
2477
  throw new CliError2("task run cannot combine --next with an explicit task id.", 2);
2063
2478
  }
@@ -2111,10 +2526,24 @@ async function executeTask(context, args, options) {
2111
2526
  });
2112
2527
  let attachDetails = null;
2113
2528
  if (!detachResult.value && context.outputMode === "text") {
2114
- console.log(formatSubmittedRun({ runId: submitted.runId, task: selectedTask ? summarizeTask(selectedTask) : null }));
2529
+ printFormattedOutput(formatSubmittedRun({
2530
+ runId: submitted.runId,
2531
+ task: selectedTask ? summarizeTask(selectedTask) : null,
2532
+ runtimeAdapter,
2533
+ runtimeMode: runtimeModeResult.value || projectDefaults.runtimeMode || "full-access",
2534
+ interactionMode: interactionModeResult.value || "default",
2535
+ detached: false
2536
+ }));
2115
2537
  attachDetails = await attachRunOperatorView(context, { runId: submitted.runId, follow: true });
2116
2538
  } else if (context.outputMode === "text") {
2117
- console.log(formatSubmittedRun({ runId: submitted.runId, task: selectedTask ? summarizeTask(selectedTask) : null }));
2539
+ printFormattedOutput(formatSubmittedRun({
2540
+ runId: submitted.runId,
2541
+ task: selectedTask ? summarizeTask(selectedTask) : null,
2542
+ runtimeAdapter,
2543
+ runtimeMode: runtimeModeResult.value || projectDefaults.runtimeMode || "full-access",
2544
+ interactionMode: interactionModeResult.value || "default",
2545
+ detached: true
2546
+ }));
2118
2547
  }
2119
2548
  return {
2120
2549
  ok: true,
@@ -2138,7 +2567,7 @@ async function executeTask(context, args, options) {
2138
2567
  }
2139
2568
  case "validate": {
2140
2569
  const { value: task, rest: remaining } = takeOption(rest, "--task");
2141
- requireNoExtraArgs(remaining, "bun run rig task validate [--task <beads-id>]");
2570
+ requireNoExtraArgs(remaining, "rig task validate [--task <task-id>]");
2142
2571
  if (context.dryRun) {
2143
2572
  await context.runCommand(["rig", "task", "validate", ...task ? ["--task", task] : []]);
2144
2573
  return { ok: true, group: "task", command, details: { task: task || "active" } };
@@ -2151,12 +2580,12 @@ async function executeTask(context, args, options) {
2151
2580
  }
2152
2581
  case "verify": {
2153
2582
  const { value: task, rest: remaining } = takeOption(rest, "--task");
2154
- requireNoExtraArgs(remaining, "bun run rig task verify [--task <beads-id>]");
2583
+ requireNoExtraArgs(remaining, "rig task verify [--task <task-id>]");
2155
2584
  if (context.dryRun) {
2156
2585
  await context.runCommand(["rig", "task", "verify", ...task ? ["--task", task] : []]);
2157
2586
  return { ok: true, group: "task", command, details: { task: task || "active" } };
2158
2587
  }
2159
- const ok = await withMutedConsole(context.outputMode === "json", () => taskVerify(context.projectRoot, context.plugins, task || undefined));
2588
+ const ok = await withMutedConsole(context.outputMode === "json", () => taskVerify(context.projectRoot, task || undefined));
2160
2589
  if (!ok) {
2161
2590
  throw new CliError2(`Verification rejected for ${task || "active task"}.`, 2);
2162
2591
  }
@@ -2164,15 +2593,19 @@ async function executeTask(context, args, options) {
2164
2593
  }
2165
2594
  case "reset": {
2166
2595
  const { value: task, rest: remaining } = takeOption(rest, "--task");
2167
- requireNoExtraArgs(remaining, "bun run rig task reset --task <beads-id>");
2168
- const requiredTask = requireTask(task, "bun run rig task reset --task <beads-id>");
2169
- await context.runCommand(["br", "--no-db", "update", requiredTask, "--status", "open"]);
2170
- return { ok: true, group: "task", command, details: { task: requiredTask } };
2596
+ requireNoExtraArgs(remaining, "rig task reset --task <task-id>");
2597
+ const requiredTask = requireTask(task, "rig task reset --task <task-id>");
2598
+ const summary = withMutedConsole(context.outputMode === "json", () => taskReopen(context.projectRoot, {
2599
+ all: false,
2600
+ taskId: requiredTask,
2601
+ dryRun: false
2602
+ }));
2603
+ return { ok: true, group: "task", command, details: summary };
2171
2604
  }
2172
2605
  case "details": {
2173
2606
  const { value: task, rest: remaining } = takeOption(rest, "--task");
2174
- requireNoExtraArgs(remaining, "bun run rig task details --task <beads-id>");
2175
- const requiredTask = requireTask(task, "bun run rig task details --task <beads-id>");
2607
+ requireNoExtraArgs(remaining, "rig task details --task <task-id>");
2608
+ const requiredTask = requireTask(task, "rig task details --task <task-id>");
2176
2609
  await withMutedConsole(context.outputMode === "json", () => taskInfo(context.projectRoot, requiredTask));
2177
2610
  return { ok: true, group: "task", command, details: { task: requiredTask } };
2178
2611
  }
@@ -2180,9 +2613,9 @@ async function executeTask(context, args, options) {
2180
2613
  const { value: task, rest: rest1 } = takeOption(rest, "--task");
2181
2614
  const allFlag = takeFlag(rest1, "--all");
2182
2615
  const { rest: remaining } = takeOption(allFlag.rest, "--reason");
2183
- requireNoExtraArgs(remaining, "bun run rig task reopen [--task <id> | --all] [--reason <text>]");
2616
+ requireNoExtraArgs(remaining, "rig task reopen [--task <id> | --all] [--reason <text>]");
2184
2617
  if (!allFlag.value && !task) {
2185
- throw new CliError2("Usage: bun run rig task reopen [--task <id> | --all] [--reason <text>]");
2618
+ throw new CliError2("Usage: rig task reopen [--task <id> | --all] [--reason <text>]");
2186
2619
  }
2187
2620
  const summary = withMutedConsole(context.outputMode === "json", () => taskReopen(context.projectRoot, {
2188
2621
  all: allFlag.value,