feat(setup)!: expand agent integrations and verify updates (#577)

* feat(setup)!: expand agent integrations and simplify onboarding

Add native configuration formats for OpenCode, Antigravity, GitHub Copilot
CLI, VS Code, and Devin. Preserve JSONC comments and unrelated settings
while making setup and uninstall ownership-aware and idempotent.

Select agent targets before planning, separate discovery from intent, and
keep agent-only setup independent of optional provider prerequisites.
Cover configuration boundaries and interactive behavior in packaged checks.

BREAKING CHANGE: unscoped setup refreshes only existing REA-owned
registrations. Use --all-detected to configure every detected client.
Setup JSON contains a compact doctor summary; use rea doctor for full
diagnostics. Cancellation and successful dry runs now exit successfully.

* feat(cli)!: replace upgrade with verified updates

Resolve an exact release through npm's configured registry, update only the
identified installation, and verify its new executable before reporting success.
Return a read-only maintenance plan for existing enabled REA integrations.

BREAKING CHANGE: replace rea upgrade with rea update; no alias is retained.
Successful update JSON uses status "updated", reports the verified installed
version, and returns an unapplied maintenance plan instead of opening setup.
This commit is contained in:
morluto
2026-10-05 23:06:19 +08:00
committed by GitHub
parent b225b0f64b
commit 6256b68666
51 changed files with 3951 additions and 1378 deletions
+16 -14
View File
@@ -11,7 +11,8 @@ import {
type SetupOptions,
} from "../application/Setup.js";
import { runUninstall } from "../application/Uninstall.js";
import { runUpgrade, systemUpgradeHost } from "../application/Upgrade.js";
import { runUpdate } from "../application/Update.js";
import { systemUpdateHost } from "../application/UpdateRuntime.js";
import {
confirmInteractiveSetup,
renderInteractiveSetupResult,
@@ -33,7 +34,7 @@ const supportedClientSchema = z
"Unsupported agent integration",
);
/** Register setup, doctor, uninstall, and upgrade CLI commands. */
/** Register setup, doctor, uninstall, and update CLI commands. */
export const registerSetupCommands = (
cli: CliInstance,
logger: Logger,
@@ -45,7 +46,7 @@ export const registerSetupCommands = (
const registerSetupCommand = (cli: CliInstance, logger: Logger): void => {
cli.command(CLI_COMMANDS.setup, {
description: "Install requirements and configure agents",
description: "Configure agent integrations and optional analysis providers",
outputPolicy: "agent-only",
options: z.object({
yes: z
@@ -132,13 +133,14 @@ const registerMaintenanceCommands = (
run: ({ options }) =>
logCliCommand(logger, "uninstall", () => runUninstall(options.purgeData)),
});
cli.command(CLI_COMMANDS.upgrade, {
description: "Upgrade a global npm installation to the latest REA release",
cli.command(CLI_COMMANDS.update, {
description:
"Update this REA installation and verify the installed release",
run: ({ formatExplicit }) =>
logCliCommand(logger, "upgrade", () =>
runUpgrade(
logCliCommand(logger, "update", () =>
runUpdate(
PRODUCT_IDENTITY.packageVersion,
systemUpgradeHost(),
systemUpdateHost(),
formatExplicit ? "structured" : "human",
),
),
@@ -162,15 +164,12 @@ const runSetupCommand = async (input: {
const { options } = input;
const interactive = setupIsInteractive(options, input.formatExplicit);
const hasExplicitScope = setupHasExplicitScope(options);
if (options.yes && !hasExplicitScope)
process.stderr.write(
"! Implicit `rea setup --yes` scope is deprecated; use `--all-detected` to retain it.\n",
);
const result = await runSetup(
setupRunOptions(input, interactive, hasExplicitScope),
systemSetupHost(createSystemDoctorHost()),
interactive
? (actions) => confirmInteractiveSetup(actions, options.accessible)
? (actions, context) =>
confirmInteractiveSetup(actions, options.accessible, context)
: undefined,
);
if (interactive) renderInteractiveSetupResult(result);
@@ -193,7 +192,9 @@ const setupRunOptions = (
approved: options.yes && !options.dryRun,
installHopper: options.installHopper,
structured: input.formatExplicit || options.dryRun,
proposeHopper: !hasExplicitScope || options.installHopper,
dryRun: options.dryRun,
allDetectedClients: options.allDetected,
proposeHopper: interactive || options.installHopper,
...(hasSelectedClients ? { clientIds: options.client } : {}),
...(hasExplicitScope
? { installSkill: options.skill ?? agentIntegrationSelected }
@@ -219,6 +220,7 @@ const setupIsInteractive = (
!options.dryRun &&
!formatExplicit &&
process.stdin.isTTY === true &&
process.stdout.isTTY === true &&
process.stderr.isTTY === true;
const setupHasExplicitScope = (options: SetupCommandOptions): boolean =>