mirror of
https://github.com/morluto/rea.git
synced 2026-10-22 05:42:31 -05:00
* 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.
47 lines
1.4 KiB
TypeScript
47 lines
1.4 KiB
TypeScript
import { afterEach, describe, expect, it } from "vitest";
|
|
|
|
import { logCliCommand } from "../../src/cliLogging.js";
|
|
import { silentLogger } from "../../src/logger.js";
|
|
|
|
const originalExitCode = process.exitCode;
|
|
|
|
afterEach(() => {
|
|
process.exitCode = originalExitCode;
|
|
});
|
|
|
|
describe("CLI operation status", () => {
|
|
it("treats a requested setup dry run and cancellation as successful outcomes", async () => {
|
|
for (const status of ["planned", "cancelled"]) {
|
|
process.exitCode = undefined;
|
|
await logCliCommand(silentLogger, "setup", () =>
|
|
Promise.resolve({ status }),
|
|
);
|
|
expect(process.exitCode).toBeUndefined();
|
|
}
|
|
});
|
|
|
|
it("keeps unapproved setup applications unsuccessful", async () => {
|
|
process.exitCode = undefined;
|
|
await logCliCommand(silentLogger, "setup", () =>
|
|
Promise.resolve({ status: "needs_confirmation" }),
|
|
);
|
|
expect(process.exitCode).toBe(1);
|
|
});
|
|
|
|
it("sets a nonzero process status without replacing structured output", async () => {
|
|
const output = {
|
|
error: "Analysis failed",
|
|
category: "integrity_mismatch",
|
|
message: "Artifact integrity check failed.",
|
|
details: { logical_path: "main.js" },
|
|
};
|
|
|
|
await expect(
|
|
logCliCommand(silentLogger, "inspect-artifact", () =>
|
|
Promise.resolve(output),
|
|
),
|
|
).resolves.toBe(output);
|
|
expect(process.exitCode).toBe(1);
|
|
});
|
|
});
|