The Open Framework for Building Agents
feat(eve): add registry commands (#1154)
Colton Paddena69faaeb9954
diff --git a/.changeset/cool-extensions-wrap.md b/.changeset/cool-extensions-wrap.mdnew file mode 100644index 000000000..b209dd71d--- /dev/null+++ b/.changeset/cool-extensions-wrap.md@@ -0,0 +1,5 @@+---+"eve": patch+---++Add `eve add` and `eve registry` commands for installing and discovering official or configured shadcn registry items.diff --git a/docs/reference/cli.md b/docs/reference/cli.mdindex b18453573..e6a00e9a0 100644--- a/docs/reference/cli.md+++ b/docs/reference/cli.md@@ -24,6 +24,8 @@ The `eve` binary (`bin: eve`) runs from your app root, and every command first l| `eve channels list` | List user-authored channels || `eve extension init [target]` | Create a new extension package || `eve extension build` | Build the current package as an extension |+| `eve add <item>` | Install an item from the official or a configured shadcn registry |+| `eve registry <command>` | Add sources and list, search, or view registry catalog items |When `eve build` fails on discovery errors, it prints the full diagnostics report (severity, message, source path) and the diagnostics artifact path.@@ -77,6 +79,22 @@ eve extension buildBuilds the complete agent-shaped extension tree into its configured dist root, emits declarations and compatibility metadata, and fills the package `exports` map. The original TypeScript source is not required in the published package.+## Registry items++Commands for installing and discovering [shadcn registry](https://ui.shadcn.com/docs/registry) items. Official registry items use a kind and slug (for example, `extension/agent-browser`); URLs and configured registry addresses are also supported.++```bash+eve add extension/agent-browser+eve add https://example.com/r/my-extension.json --overwrite+eve registry add @acme=https://example.com/r/{name}.json+eve registry search browser+eve registry search browser --registry @acme+eve registry view @acme/my-extension+eve add @acme/my-extension+```++`eve registry add` records configured sources in `package.json#registries`. `eve registry list` and `search` aggregate the official catalog and all configured sources by default, or browse one supplied URL or namespace. Official and other universal items with explicit file targets do not require shadcn project configuration.+## `eve info````bashdiff --git a/packages/eve/package.json b/packages/eve/package.jsonindex 65fc0d7c4..cd79004ec 100644--- a/packages/eve/package.json+++ b/packages/eve/package.json@@ -351,6 +351,7 @@"react": "catalog:","react-test-renderer": "19.2.6","semver": "7.8.4",+ "shadcn": "4.16.0","svelte": "^5.0.0","turndown": "7.2.4","vite": "^8.1.5",diff --git a/packages/eve/scripts/vendor-compiled/_shared.mjs b/packages/eve/scripts/vendor-compiled/_shared.mjsindex 8fdc80050..ec095cd3b 100644--- a/packages/eve/scripts/vendor-compiled/_shared.mjs+++ b/packages/eve/scripts/vendor-compiled/_shared.mjs@@ -30,6 +30,7 @@* platform?: "node" | "neutral",* resolve?: ResolveOptions,* bundling?: "shared" | "standalone", // default "shared"+ * banner?: string, // standalone bundle prelude* chunkGroup?: string, // default "node"* typeOnly?: boolean, // skips JS bundling entirely* }@@ -651,7 +652,7 @@ async function bundleStandaloneModule({ destinationRoot, module, packageInfo, paresolve: module.resolve ?? getDefaultResolve(platform),treeshake: true,output: {- banner: "/* oxlint-disable */",+ banner: module.banner ?? "/* oxlint-disable */",codeSplitting: false,comments: false,file: join(destinationRoot, "index.js"),diff --git a/packages/eve/scripts/vendor-compiled/declarations/shadcn-registry.d.ts b/packages/eve/scripts/vendor-compiled/declarations/shadcn-registry.d.tsnew file mode 100644index 000000000..4bf7f7ba9--- /dev/null+++ b/packages/eve/scripts/vendor-compiled/declarations/shadcn-registry.d.ts@@ -0,0 +1,56 @@+export type RegistrySource =+ | string+ | {+ url: string;+ params?: Record<string, string>;+ headers?: Record<string, string>;+ };++export interface RegistryConfig {+ registries?: Record<string, RegistrySource>;+}++export interface AddRegistryItemsOptions {+ cwd?: string;+ config?: RegistryConfig;+ overwrite?: boolean;+}++export interface RegistrySearchItem {+ registry: string;+ name: string;+ addCommandArgument: string;+ type?: string;+ description?: string;+}++export interface RegistrySearchResult {+ items: RegistrySearchItem[];+ pagination: {+ total: number;+ offset: number;+ limit: number;+ hasMore: boolean;+ };+ errors?: Array<{ message: string; registry: string }>;+}++export function addRegistryItems(items: string[], options?: AddRegistryItemsOptions): Promise<void>;++export function getRegistryItems(+ items: string[],+ options?: { config?: RegistryConfig; useCache?: boolean },+): Promise<unknown[]>;++export function searchRegistries(+ registries: string[],+ options?: {+ query?: string;+ types?: string[];+ limit?: number;+ offset?: number;+ config?: RegistryConfig;+ useCache?: boolean;+ continueOnError?: boolean;+ },+): Promise<RegistrySearchResult>;diff --git a/packages/eve/scripts/vendor-compiled/entries/shadcn-registry.mjs b/packages/eve/scripts/vendor-compiled/entries/shadcn-registry.mjsnew file mode 100644index 000000000..ffc16386b--- /dev/null+++ b/packages/eve/scripts/vendor-compiled/entries/shadcn-registry.mjs@@ -0,0 +1 @@+export { addRegistryItems, getRegistryItems, searchRegistries } from "shadcn/registry";diff --git a/packages/eve/scripts/vendor-compiled/index.mjs b/packages/eve/scripts/vendor-compiled/index.mjsindex 6a8c930e7..2357b31bc 100644--- a/packages/eve/scripts/vendor-compiled/index.mjs+++ b/packages/eve/scripts/vendor-compiled/index.mjs@@ -40,6 +40,7 @@ import jsonSchema from "./json-schema.mjs";import marked from "./marked.mjs";import picocolors from "./picocolors.mjs";import semver from "./semver.mjs";+import shadcnRegistry from "./shadcn-registry.mjs";import turndown from "./turndown.mjs";import zod from "./zod.mjs";import zodValidationError from "./zod-validation-error.mjs";@@ -69,6 +70,7 @@ export const MODULES = [provider,providerUtils,semver,+ shadcnRegistry,standardSchemaSpec,turndown,vercelDetectAgent,diff --git a/packages/eve/scripts/vendor-compiled/shadcn-registry.mjs b/packages/eve/scripts/vendor-compiled/shadcn-registry.mjsnew file mode 100644index 000000000..d52e2aec5--- /dev/null+++ b/packages/eve/scripts/vendor-compiled/shadcn-registry.mjs@@ -0,0 +1,52 @@+import { fileURLToPath } from "node:url";++import { loadDeclaration } from "./_shared.mjs";++const declaration = await loadDeclaration("shadcn-registry.d.ts");++// Rolldown miscompiles tsconfig-paths' CommonJS JSON5 namespace import after minification.+// Parse tsconfig's JSONC syntax through an explicit ESM module instead.+const json5ShimPlugin = {+ name: "eve-json5-shim",+ resolveId(source) {+ return source === "json5" ? "eve-json5-shim" : undefined;+ },+ load(id) {+ if (id !== "eve-json5-shim") return undefined;+ return {+ code: `+import { parse as parseJsonc, printParseErrorCode } from "jsonc-parser";+export function parse(source) {+ const errors = [];+ const value = parseJsonc(source, errors, { allowTrailingComma: true });+ if (errors.length > 0) {+ const error = errors[0];+ throw new SyntaxError(printParseErrorCode(error.error) + " at offset " + error.offset);+ }+ return value;+}+export default { parse };+`,+ moduleType: "js",+ };+ },+};++export default {+ packageName: "shadcn",+ compiledPath: "shadcn-registry",+ entries: [+ {+ input: fileURLToPath(new URL("./entries/shadcn-registry.mjs", import.meta.url)),+ outputPath: "index",+ declaration,+ },+ ],+ bundling: "standalone",+ plugins: [json5ShimPlugin],+ banner: `/* oxlint-disable */+import { fileURLToPath as __eveFileURLToPath } from "node:url";+import { dirname as __eveDirname } from "node:path";+const __filename = __eveFileURLToPath(import.meta.url);+const __dirname = __eveDirname(__filename);`,+};diff --git a/packages/eve/src/cli/commands/register-registry-commands.ts b/packages/eve/src/cli/commands/register-registry-commands.tsnew file mode 100644index 000000000..5c54ddbf4--- /dev/null+++ b/packages/eve/src/cli/commands/register-registry-commands.ts@@ -0,0 +1,62 @@+import type { Command } from "#compiled/commander/index.js";++interface RegistryCommandLogger {+ error(message: string): void;+ log(message: string): void;+}++/** Registers registry installation, configuration, and discovery commands. */+export function registerRegistryCommands(input: {+ program: Command;+ logger: RegistryCommandLogger;+ appRoot: string;+}): void {+ const { appRoot, logger, program } = input;++ program+ .command("add <item>")+ .description("Install a registry item; relative paths use the official eve registry.")+ .option("-o, --overwrite", "Overwrite existing files.")+ .action(async (item: string, options: { overwrite?: boolean }) => {+ const { runAddCommand } = await import("./registry.js");+ await runAddCommand(logger, appRoot, item, options);+ });++ const registry = program+ .command("registry")+ .description("Configure and browse extension and agent registry catalogs.");++ registry+ .command("add <registries...>")+ .description("Add registry namespace mappings to package.json.")+ .action(async (registries: string[]) => {+ const { runRegistryAddCommand } = await import("./registry.js");+ await runRegistryAddCommand(logger, appRoot, registries);+ });++ registry+ .command("list")+ .description("List items from all registries or one source.")+ .option("-r, --registry <source>", "List items from one registry.")+ .action(async (options: { registry?: string }) => {+ const { runRegistryListCommand } = await import("./registry.js");+ await runRegistryListCommand(logger, appRoot, options.registry);+ });++ registry+ .command("search <query>")+ .description("Search all registries or one source.")+ .option("-r, --registry <source>", "Search one registry.")+ .action(async (query: string, options: { registry?: string }) => {+ const { runRegistrySearchCommand } = await import("./registry.js");+ await runRegistrySearchCommand(logger, appRoot, query, options.registry);+ });++ registry+ .command("view <item>")+ .description("Print one registry item as JSON.")+ .action(async (item: string) => {+ const { runRegistryViewCommand } = await import("./registry.js");+ await runRegistryViewCommand(logger, appRoot, item);+ });+}diff --git a/packages/eve/src/cli/commands/registry-project.ts b/packages/eve/src/cli/commands/registry-project.tsnew file mode 100644index 000000000..e02fdcc07--- /dev/null+++ b/packages/eve/src/cli/commands/registry-project.ts@@ -0,0 +1,118 @@+import { readFile, writeFile } from "node:fs/promises";+import { join } from "node:path";++import type { RegistryConfig, RegistrySource } from "#compiled/shadcn-registry/index.js";++interface RegistryPackage {+ path: string;+ document: Record<string, unknown>;+ config: RegistryConfig;+}++export interface AddRegistryMappingsResult {+ added: string[];+ skippedBuiltIn: string[];+ skippedExisting: string[];+}++function errorMessage(error: unknown): string {+ return error instanceof Error ? error.message : String(error);+}++function isRegistrySource(value: unknown): value is RegistrySource {+ if (typeof value === "string") return true;+ if (typeof value !== "object" || value === null || !("url" in value)) return false;+ return typeof (value as { url?: unknown }).url === "string";+}++function parseRegistries(path: string, value: unknown): Record<string, RegistrySource> {+ if (value === undefined) return {};+ if (typeof value !== "object" || value === null || Array.isArray(value)) {+ throw new Error(`${path} has an invalid registries field.`);+ }++ const registries: Record<string, RegistrySource> = {};+ for (const [namespace, source] of Object.entries(value)) {+ if (!namespace.startsWith("@") || !isRegistrySource(source)) {+ throw new Error(`${path} has an invalid registry entry for ${namespace}.`);+ }+ registries[namespace] = source;+ }+ return registries;+}++async function readRegistryPackage(appRoot: string): Promise<RegistryPackage> {+ const path = join(appRoot, "package.json");+ let parsed: unknown;+ try {+ parsed = JSON.parse(await readFile(path, "utf8"));+ } catch (error) {+ throw new Error(`Could not read ${path}: ${errorMessage(error)}`);+ }+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {+ throw new Error(`${path} must contain a JSON object.`);+ }++ const document = parsed as Record<string, unknown>;+ return {+ path,+ document,+ config: { registries: parseRegistries(path, document.registries) },+ };+}++function parseRegistryMapping(argument: string): { namespace: string; url: string } {+ const separator = argument.indexOf("=");+ const namespace = separator === -1 ? argument : argument.slice(0, separator);+ const url = separator === -1 ? "" : argument.slice(separator + 1);+ if (!namespace.startsWith("@")) {+ throw new Error(`Registry namespaces must start with @: ${namespace}`);+ }+ if (!url.includes("{name}")) {+ throw new Error(+ `Pass a registry URL containing {name}, for example ${namespace}=https://example.com/r/{name}.json.`,+ );+ }+ return { namespace, url };+}++/** Reads registry namespace mappings from package.json. */+export async function readRegistryConfig(appRoot: string): Promise<RegistryConfig> {+ return (await readRegistryPackage(appRoot)).config;+}++/** Adds explicit registry namespace mappings to package.json. */+export async function addRegistryMappings(+ appRoot: string,+ arguments_: readonly string[],+): Promise<AddRegistryMappingsResult> {+ if (arguments_.length === 0) throw new Error("Pass at least one registry to add.");+ const project = await readRegistryPackage(appRoot);+ const mappings = arguments_.map(parseRegistryMapping);+ const configured = { ...project.config.registries };+ const result: AddRegistryMappingsResult = {+ added: [],+ skippedBuiltIn: [],+ skippedExisting: [],+ };++ for (const mapping of mappings) {+ if (mapping.namespace === "@shadcn") {+ result.skippedBuiltIn.push(mapping.namespace);+ } else if (configured[mapping.namespace] !== undefined) {+ result.skippedExisting.push(mapping.namespace);+ } else {+ configured[mapping.namespace] = mapping.url;+ result.added.push(mapping.namespace);+ }+ }++ if (result.added.length > 0) {+ await writeFile(+ project.path,+ `${JSON.stringify({ ...project.document, registries: configured }, null, 2)}\n`,+ "utf8",+ );+ }+ return result;+}diff --git a/packages/eve/src/cli/commands/registry.test.ts b/packages/eve/src/cli/commands/registry.test.tsnew file mode 100644index 000000000..4e2b565d7--- /dev/null+++ b/packages/eve/src/cli/commands/registry.test.ts@@ -0,0 +1,178 @@+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";++import {+ runAddCommand,+ runRegistryAddCommand,+ runRegistryListCommand,+ runRegistrySearchCommand,+ runRegistryViewCommand,+ type RegistryCommandLogger,+} from "./registry.js";++const { addRegistryItems, getRegistryItems, isEveProject, readFile, searchRegistries, writeFile } =+ vi.hoisted(() => ({+ addRegistryItems: vi.fn(),+ getRegistryItems: vi.fn(),+ isEveProject: vi.fn(),+ readFile: vi.fn(),+ searchRegistries: vi.fn(),+ writeFile: vi.fn(),+ }));++vi.mock("#compiled/shadcn-registry/index.js", () => ({+ addRegistryItems,+ getRegistryItems,+ searchRegistries,+}));++vi.mock("#setup/scaffold/index.js", () => ({ isEveProject }));+vi.mock("node:fs/promises", () => ({ readFile, writeFile }));++function createLogger(): RegistryCommandLogger & { errors: string[]; logs: string[] } {+ const errors: string[] = [];+ const logs: string[] = [];+ return {+ errors,+ logs,+ error: (message) => errors.push(message),+ log: (message) => logs.push(message),+ };+}++describe("registry commands", () => {+ beforeEach(() => {+ vi.clearAllMocks();+ isEveProject.mockResolvedValue(true);+ readFile.mockResolvedValue(+ JSON.stringify({+ name: "project",+ registries: { "@acme": "https://example.com/r/{name}.json" },+ }),+ );+ });++ afterEach(() => {+ process.exitCode = undefined;+ });++ it("installs official items through the registry SDK", async () => {+ const logger = createLogger();++ await runAddCommand(logger, "/project", "extension/browser", {+ overwrite: true,+ });++ expect(addRegistryItems).toHaveBeenCalledWith(["https://eve.dev/r/extension/browser.json"], {+ config: {+ registries: { "@acme": "https://example.com/r/{name}.json" },+ },+ cwd: "/project",+ overwrite: true,+ });+ expect(logger.errors).toEqual([]);+ });++ it("adds namespace mappings to package.json", async () => {+ const logger = createLogger();++ await runRegistryAddCommand(logger, "/project", ["@other=https://other.example/r/{name}.json"]);++ expect(writeFile).toHaveBeenCalledWith(+ "/project/package.json",+ `${JSON.stringify(+ {+ name: "project",+ registries: {+ "@acme": "https://example.com/r/{name}.json",+ "@other": "https://other.example/r/{name}.json",+ },+ },+ null,+ 2,+ )}\n`,+ "utf8",+ );+ expect(logger.logs).toContain("Added @other to package.json.");+ });++ it("lists the official registry without configured namespaces", async () => {+ const logger = createLogger();+ readFile.mockResolvedValue(JSON.stringify({ name: "project" }));+ searchRegistries.mockResolvedValue({+ items: [],+ pagination: { total: 0, offset: 0, limit: 0, hasMore: false },+ });++ await runRegistryListCommand(logger, "/project");++ expect(searchRegistries).toHaveBeenCalledWith(["https://eve.dev/r/registry.json"], {+ config: { registries: {} },+ continueOnError: false,+ query: undefined,+ });+ expect(logger.logs).toEqual(["No registry items found."]);+ });++ it("searches the official catalog and configured registries", async () => {+ const logger = createLogger();+ searchRegistries.mockResolvedValue({+ items: [+ {+ registry: "@acme",+ name: "browser",+ addCommandArgument: "@acme/browser",+ description: "Browser tools",+ },+ ],+ pagination: { total: 1, offset: 0, limit: 1, hasMore: false },+ });++ await runRegistrySearchCommand(logger, "/project", "browser");++ expect(searchRegistries).toHaveBeenCalledWith(["https://eve.dev/r/registry.json", "@acme"], {+ config: {+ registries: { "@acme": "https://example.com/r/{name}.json" },+ },+ continueOnError: true,+ query: "browser",+ });+ expect(logger.logs).toEqual(["@acme/browser — Browser tools"]);+ });++ it("reports total registry failure without describing it as an empty result", async () => {+ const logger = createLogger();+ searchRegistries.mockResolvedValue({+ items: [],+ errors: [+ { registry: "https://eve.dev/r/registry.json", message: "eve unavailable" },+ { registry: "@acme", message: "acme unavailable" },+ ],+ pagination: { total: 0, offset: 0, limit: 0, hasMore: false },+ });++ await runRegistrySearchCommand(logger, "/project", "browser");++ expect(logger.logs).toEqual([]);+ expect(logger.errors).toEqual([+ "https://eve.dev/r/registry.json: eve unavailable",+ "@acme: acme unavailable",+ ]);+ expect(process.exitCode).toBe(1);+ });++ it("prints a registry item as JSON", async () => {+ const logger = createLogger();+ getRegistryItems.mockResolvedValue([{ name: "browser", type: "registry:item" }]);++ await runRegistryViewCommand(logger, "/project", "extension/browser");++ expect(getRegistryItems).toHaveBeenCalledWith(["https://eve.dev/r/extension/browser.json"], {+ config: {+ registries: { "@acme": "https://example.com/r/{name}.json" },+ },+ });+ expect(logger.logs).toEqual([+ JSON.stringify({ name: "browser", type: "registry:item" }, null, 2),+ ]);+ });+});diff --git a/packages/eve/src/cli/commands/registry.ts b/packages/eve/src/cli/commands/registry.tsnew file mode 100644index 000000000..4c2ede37c--- /dev/null+++ b/packages/eve/src/cli/commands/registry.ts@@ -0,0 +1,169 @@+import {+ addRegistryItems,+ getRegistryItems,+ searchRegistries,+ type RegistryConfig,+} from "#compiled/shadcn-registry/index.js";+import { isEveProject } from "#setup/scaffold/index.js";++import { NOT_AN_AGENT_MESSAGE } from "./preconditions.js";+import { addRegistryMappings, readRegistryConfig } from "./registry-project.js";++export interface RegistryCommandLogger {+ error(message: string): void;+ log(message: string): void;+}++export interface AddCommandOptions {+ overwrite?: boolean;+}++const OFFICIAL_REGISTRY = "https://eve.dev/r";+const OFFICIAL_CATALOG = `${OFFICIAL_REGISTRY}/registry.json`;++function isRegistryAddress(value: string): boolean {+ return value.startsWith("@") || /^https?:\/\//.test(value);+}++function itemAddress(item: string): string {+ return isRegistryAddress(item) ? item : `${OFFICIAL_REGISTRY}/${item}.json`;+}++function errorMessage(error: unknown): string {+ return error instanceof Error ? error.message : String(error);+}++async function runRegistryAction(+ logger: RegistryCommandLogger,+ appRoot: string,+ action: () => Promise<void>,+): Promise<void> {+ if (!(await isEveProject(appRoot))) {+ logger.error(NOT_AN_AGENT_MESSAGE);+ process.exitCode = 1;+ return;+ }++ try {+ await action();+ } catch (error) {+ logger.error(errorMessage(error));+ process.exitCode = 1;+ }+}++function configuredRegistrySources(config: RegistryConfig): string[] {+ return Object.keys(config.registries ?? {});+}++function validateRegistrySource(source: string | undefined): void {+ if (source !== undefined && !isRegistryAddress(source)) {+ throw new Error(`Registry sources must be a namespace or URL: ${source}`);+ }+}++function printSearchResults(+ logger: RegistryCommandLogger,+ items: Array<{ addCommandArgument: string; description?: string }>,+): void {+ if (items.length === 0) {+ logger.log("No registry items found.");+ return;+ }+ for (const item of items) {+ logger.log(`${item.addCommandArgument}${item.description ? ` — ${item.description}` : ""}`);+ }+}++async function browseRegistryItems(+ logger: RegistryCommandLogger,+ appRoot: string,+ query: string | undefined,+ source: string | undefined,+): Promise<void> {+ validateRegistrySource(source);+ const config = await readRegistryConfig(appRoot);+ const sources = source ? [source] : [OFFICIAL_CATALOG, ...configuredRegistrySources(config)];+ const result = await searchRegistries(sources, {+ config,+ continueOnError: sources.length > 1,+ query,+ });+ const errors = result.errors ?? [];+ if (errors.length < sources.length) {+ printSearchResults(logger, result.items);+ }+ for (const error of errors) {+ logger.error(`${error.registry}: ${error.message}`);+ }+ if (errors.length > 0) process.exitCode = 1;+}++/** Installs an official, configured, or URL-addressed registry item. */+export async function runAddCommand(+ logger: RegistryCommandLogger,+ appRoot: string,+ item: string,+ options: AddCommandOptions,+): Promise<void> {+ await runRegistryAction(logger, appRoot, async () => {+ const config = await readRegistryConfig(appRoot);+ await addRegistryItems([itemAddress(item)], { ...options, config, cwd: appRoot });+ });+}++/** Adds registry namespace mappings to the project's package.json. */+export async function runRegistryAddCommand(+ logger: RegistryCommandLogger,+ appRoot: string,+ mappings: readonly string[],+): Promise<void> {+ await runRegistryAction(logger, appRoot, async () => {+ const result = await addRegistryMappings(appRoot, mappings);+ for (const namespace of result.skippedBuiltIn) {+ logger.log(`Skipped ${namespace} because it is built in.`);+ }+ for (const namespace of result.skippedExisting) {+ logger.log(`Skipped ${namespace} because it is already configured.`);+ }+ if (result.added.length > 0) {+ logger.log(`Added ${result.added.join(", ")} to package.json.`);+ }+ });+}++/** Lists registry items from every configured source or one selected source. */+export async function runRegistryListCommand(+ logger: RegistryCommandLogger,+ appRoot: string,+ source?: string,+): Promise<void> {+ await runRegistryAction(logger, appRoot, () =>+ browseRegistryItems(logger, appRoot, undefined, source),+ );+}++/** Searches registry items across every configured source or one selected source. */+export async function runRegistrySearchCommand(+ logger: RegistryCommandLogger,+ appRoot: string,+ query: string,+ source?: string,+): Promise<void> {+ await runRegistryAction(logger, appRoot, () =>+ browseRegistryItems(logger, appRoot, query, source),+ );+}++/** Prints one official, configured, or URL-addressed registry item as JSON. */+export async function runRegistryViewCommand(+ logger: RegistryCommandLogger,+ appRoot: string,+ item: string,+): Promise<void> {+ await runRegistryAction(logger, appRoot, async () => {+ const config = await readRegistryConfig(appRoot);+ const items = await getRegistryItems([itemAddress(item)], { config });+ logger.log(JSON.stringify(items.length === 1 ? items[0] : items, null, 2));+ });+}diff --git a/packages/eve/src/cli/run.test.ts b/packages/eve/src/cli/run.test.tsindex c18febeed..29eb8fa2b 100644--- a/packages/eve/src/cli/run.test.ts+++ b/packages/eve/src/cli/run.test.ts@@ -52,9 +52,45 @@ describe("CLI command registration", () => {expect(help).toContain("init [options] [target]");expect(help).toContain("link");expect(help).toContain("deploy");+ expect(help).toContain("registry");expect(help).not.toContain("setup");});+ it("keeps registry installation options minimal", async () => {+ const output: string[] = [];+ const logger = {+ error: (message: string) => output.push(message),+ log: (message: string) => output.push(message),+ };++ await runCli(["add", "--help"], logger).catch(() => {});++ const help = output.join("\n");+ expect(help).toContain("--overwrite");+ expect(help).not.toContain("--yes");+ expect(help).not.toContain("--silent");+ expect(help).not.toContain("--skip-fonts");+ expect(help).not.toContain("--path");+ });++ it("registers only supported shadcn registry commands", async () => {+ const output: string[] = [];+ const logger = {+ error: (message: string) => output.push(message),+ log: (message: string) => output.push(message),+ };++ await runCli(["registry", "--help"], logger).catch(() => {});++ const help = output.join("\n");+ expect(help).toContain("add <registries...>");+ expect(help).toContain("list [options]");+ expect(help).toContain("search [options] <query>");+ expect(help).toContain("view <item>");+ expect(help).not.toContain("remove [arguments...]");+ expect(help).not.toContain("sources [arguments...]");+ });+it("registers the diagnostic logs commands", async () => {const output: string[] = [];const logger = {diff --git a/packages/eve/src/cli/run.ts b/packages/eve/src/cli/run.tsindex eaf71773a..c1b32d1a2 100644--- a/packages/eve/src/cli/run.ts+++ b/packages/eve/src/cli/run.ts@@ -6,6 +6,7 @@ import { resolveInstalledPackageInfo } from "#internal/application/package.js";import { isCodingAgentLaunch } from "#cli/agent-detection.js";import { eveCliBanner } from "#cli/banner.js";import { registerProjectCommands } from "#cli/commands/register-project-commands.js";+import { registerRegistryCommands } from "#cli/commands/register-registry-commands.js";import { resolveDevUiMode, resolveTuiDisplayOptions } from "#cli/dev/ui-options.js";import {FORCED_EXIT_BACKSTOP_MS,@@ -306,6 +307,8 @@ function createCliProgram(logger: CliLogger, runtime: CliRuntimeOverrides): Commawait runExtensionBuildCommand(logger, appRoot);});+ registerRegistryCommands({ program, logger, appRoot });+program// Optional: a missing target scaffolds or updates the current directory,// matching `eve init .`.diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex a5ce8a510..7e0f56bd4 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -363,7 +363,7 @@ importers:version: 0.41.2'@vercel/connect':specifier: 'catalog:'- version: 0.4.2(@ai-sdk/[email protected]([email protected]))(@auth/[email protected])(@chat-adapter/[email protected]([email protected]([email protected]))([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))(eve@packages+eve)+ version: 0.4.2(@ai-sdk/[email protected]([email protected]))(@auth/[email protected])(@chat-adapter/[email protected]([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))(eve@packages+eve)'@vercel/oidc':specifier: 3.8.0version: 3.8.0@@ -1269,6 +1269,9 @@ importers:semver:specifier: 7.8.4version: 7.8.4+ shadcn:+ specifier: 4.16.0+ version: 4.16.0([email protected])([email protected])svelte:specifier: ^5.0.0version: 5.56.1(@typescript-eslint/[email protected])@@ -12804,10 +12807,6 @@ packages:resolution: {integrity: sha512-b484I/7b8rDEdSDKckSSBA8knMpcdsXudlE/LNL639wFoHKwLbEkQFZHWEYwDC0wa0FKUcCY+GAF73Z7wxNVFA==}- resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==}- engines: {node: '>= 0.6'}-resolution: {integrity: sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw==}engines: {node: '>= 0.6'}@@ -13273,6 +13272,11 @@ packages:engines: {node: '>=20.18.1'}hasBin: true+ resolution: {integrity: sha512-kPr4RrQmbbZeAjwBYeBSpFvAHV8rkTlNPUluIxkRriq5TpevfFelVO5xvcF6oguHPVn0R6wPuVer4HudfcLy/A==}+ engines: {node: '>=20.18.1'}+ hasBin: true+resolution: {integrity: sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==}engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}@@ -15639,21 +15643,6 @@ snapshots:- utf-8-validate- zod- '@chat-adapter/[email protected]([email protected]([email protected]))([email protected]([email protected]))([email protected])([email protected])':- dependencies:- '@chat-adapter/shared': 4.34.0([email protected]([email protected]))([email protected])([email protected])- '@slack/socket-mode': 2.0.7([email protected])([email protected]([email protected]))([email protected])- transitivePeerDependencies:- - ai- - bufferutil- - debug- - supports-color- - utf-8-validate- - zod- optional: true-'@chat-adapter/[email protected]([email protected]([email protected]))([email protected])([email protected])':dependencies:@@ -21181,13 +21170,13 @@ snapshots:ai: 6.0.191([email protected])eve: link:packages/eve- '@vercel/[email protected](@ai-sdk/[email protected]([email protected]))(@auth/[email protected])(@chat-adapter/[email protected]([email protected]([email protected]))([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))(eve@packages+eve)':+ '@vercel/[email protected](@ai-sdk/[email protected]([email protected]))(@auth/[email protected])(@chat-adapter/[email protected]([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))(eve@packages+eve)':dependencies:'@vercel/oidc': 3.8.0optionalDependencies:'@ai-sdk/mcp': 2.0.16([email protected])'@auth/core': 0.41.2- '@chat-adapter/slack': 4.34.0([email protected]([email protected]))([email protected]([email protected]))([email protected])([email protected])+ '@chat-adapter/slack': 4.34.0([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])([email protected])ai: 7.0.34([email protected])eve: link:packages/eve@@ -24013,7 +24002,7 @@ snapshots:parseurl: 1.3.3proxy-addr: 2.0.7qs: 6.15.2- range-parser: 1.2.1+ range-parser: 1.3.0router: 2.2.0([email protected])send: 1.2.1([email protected])serve-static: 2.2.1([email protected])@@ -28122,8 +28111,6 @@ snapshots:- [email protected]: {}-@@ -28816,6 +28803,46 @@ snapshots:- supports-color- typescript+ dependencies:+ '@babel/core': 7.29.0([email protected])+ '@babel/parser': 7.29.7+ '@babel/plugin-transform-typescript': 7.29.7(@babel/[email protected]([email protected]))([email protected])+ '@babel/preset-typescript': 7.29.7(@babel/[email protected]([email protected]))([email protected])+ '@dotenvx/dotenvx': 1.75.1+ '@modelcontextprotocol/sdk': 1.29.0([email protected])([email protected])+ '@types/validate-npm-package-name': 4.0.2+ browserslist: 4.28.6+ commander: 14.0.3+ cosmiconfig: 9.0.2([email protected])+ dedent: 1.7.2+ deepmerge: 4.3.1+ diff: 8.0.4+ execa: 9.6.1+ fast-glob: 3.3.3+ fs-extra: 11.3.6+ fuzzysort: 3.1.0+ kleur: 4.1.5+ open: 11.0.0+ ora: 8.2.0+ postcss: 8.5.15+ postcss-selector-parser: 7.1.4+ prompts: 2.4.2+ recast: 0.23.12+ stringify-object: 5.0.0+ tailwind-merge: 3.6.0+ ts-morph: 26.0.0+ tsconfig-paths: 4.2.0+ undici: 7.28.0+ validate-npm-package-name: 7.0.2+ zod: 3.25.76+ zod-to-json-schema: 3.25.2([email protected])+ transitivePeerDependencies:+ - '@cfworker/json-schema'+ - babel-plugin-macros+ - supports-color+ - typescript+dependencies:'@img/colour': 1.1.0diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yamlindex 105e9e1c7..cebc8af14 100644--- a/pnpm-workspace.yaml+++ b/pnpm-workspace.yaml@@ -69,6 +69,8 @@ minimumReleaseAgeExclude:- eve- nitro- rolldown+ # This release contains the reviewed package-config registry APIs used by the eve CLI.- turbo- typescript- vercel