Skip to content

armgit / eve

Public Imported from GitHub
0

The Open Framework for Building Agents

fix(eve): avoid per-item registry title requests (#2314)

OwenKepharte843b4da3c4c
diff --git a/.changeset/fresh-registries-smile.md b/.changeset/fresh-registries-smile.md
new file mode 100644
index 000000000..e5f3d4182
--- /dev/null
+++ b/.changeset/fresh-registries-smile.md
@@ -0,0 +1,5 @@
+---
+"eve": patch
+---
+
+Registry browsing now uses titles returned by the catalog, avoiding a separate request for every displayed item.
diff --git a/packages/eve/package.json b/packages/eve/package.json
index 8744ff060..1a697bda7 100644
--- a/packages/eve/package.json
+++ b/packages/eve/package.json
@@ -382,7 +382,7 @@
"react": "catalog:",
"react-test-renderer": "19.2.6",
"semver": "7.8.4",
- "shadcn": "4.16.1",
+ "shadcn": "4.18.0",
"svelte": "^5.0.0",
"turndown": "7.2.4",
"vite": "^8.1.5",
diff --git a/packages/eve/scripts/vendor-compiled/declarations/shadcn-registry.d.ts b/packages/eve/scripts/vendor-compiled/declarations/shadcn-registry.d.ts
index de27cfee8..9c117ce88 100644
--- a/packages/eve/scripts/vendor-compiled/declarations/shadcn-registry.d.ts
+++ b/packages/eve/scripts/vendor-compiled/declarations/shadcn-registry.d.ts
@@ -20,6 +20,7 @@ export interface AddRegistryItemsOptions {
export interface RegistrySearchItem {
registry: string;
name: string;
+ title?: string;
addCommandArgument: string;
type?: string;
description?: string;
diff --git a/packages/eve/src/cli/commands/registry.test.ts b/packages/eve/src/cli/commands/registry.test.ts
index 872e2e582..a5fb53250 100644
--- a/packages/eve/src/cli/commands/registry.test.ts
+++ b/packages/eve/src/cli/commands/registry.test.ts
@@ -998,43 +998,32 @@ describe("registry commands", () => {
expect(logger.logs).toContain("Added @other to package.json.");
});
- it("loads real item titles in parallel for a page of search results", async () => {
+ it("uses titles returned with a page of search results", async () => {
searchRegistries.mockResolvedValue({
items: [
{
registry: "https://eve.dev/r/registry.json",
name: "channel/photon-imessage",
+ title: "Photon iMessage",
addCommandArgument: "https://eve.dev/r/channel/photon-imessage.json",
},
{
registry: "@acme",
name: "extension/ai-sdk-tools",
+ title: "AI SDK Tools",
addCommandArgument: "@acme/ai-sdk-tools",
},
],
pagination: { total: 2, offset: 0, limit: 2, hasMore: false },
});
- const resolvers = new Map<string, (value: unknown[]) => void>();
- getRegistryItems.mockImplementation(
- ([address]: string[]) =>
- new Promise((resolve) => {
- resolvers.set(address!, resolve);
- }),
- );
-
- const catalog = browseRegistryCatalog("/project", { query: "sdk" });
- await vi.waitFor(() => expect(getRegistryItems).toHaveBeenCalledTimes(2));
- resolvers.get("https://eve.dev/r/channel/photon-imessage.json")?.([
- { title: "Photon iMessage" },
- ]);
- resolvers.get("@acme/ai-sdk-tools")?.([{ title: "AI SDK Tools" }]);
- await expect(catalog).resolves.toMatchObject({
+ await expect(browseRegistryCatalog("/project", { query: "sdk" })).resolves.toMatchObject({
items: [
{ name: "channel/photon-imessage", title: "Photon iMessage" },
{ name: "extension/ai-sdk-tools", title: "AI SDK Tools" },
],
});
+ expect(getRegistryItems).not.toHaveBeenCalled();
expect(searchRegistries).toHaveBeenCalledWith(
["https://eve.dev/r/registry.json"],
expect.objectContaining({ limit: 100, query: "sdk" }),
diff --git a/packages/eve/src/cli/commands/registry.ts b/packages/eve/src/cli/commands/registry.ts
index a0e8e0f7a..2eb5864be 100644
--- a/packages/eve/src/cli/commands/registry.ts
+++ b/packages/eve/src/cli/commands/registry.ts
@@ -345,34 +345,20 @@ async function searchRegistryCatalog(
return { config, result, resultsBySource, sources, metadataByAddress };
}
-function registryManifestTitle(manifest: unknown): string | undefined {
- if (typeof manifest !== "object" || manifest === null || Array.isArray(manifest))
- return undefined;
- const title = (manifest as { title?: unknown }).title;
- return typeof title === "string" ? title : undefined;
-}
-
/** Browses all configured catalogs, or one namespace or URL source. */
export async function browseRegistryCatalog(
appRoot: string,
options: { query?: string; source?: string } = {},
): Promise<RegistryCatalogResult> {
- const { config, result } = await searchRegistryCatalog(appRoot, options);
- const manifests = await Promise.all(
- result.items.map(async (item) => {
- const [manifest] = await getRegistryItems([item.addCommandArgument], { config });
- return manifest;
- }),
- );
+ const { result } = await searchRegistryCatalog(appRoot, options);
return {
- items: result.items.map((item: RegistrySearchItem, index) => {
+ items: result.items.map((item: RegistrySearchItem) => {
const catalogItem: RegistryCatalogItem = {
address: item.registry === OFFICIAL_CATALOG ? item.name : item.addCommandArgument,
name: item.name,
source: item.registry === OFFICIAL_CATALOG ? "Vercel" : item.registry,
};
- const title = registryManifestTitle(manifests[index]);
- if (title !== undefined) catalogItem.title = title;
+ if (item.title !== undefined) catalogItem.title = item.title;
if (item.type !== undefined) catalogItem.type = item.type;
if (item.description !== undefined) catalogItem.description = item.description;
return catalogItem;
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 3fbe228e6..880b6ccde 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1338,8 +1338,8 @@ importers:
specifier: 7.8.4
version: 7.8.4
shadcn:
- specifier: 4.16.1
+ specifier: 4.18.0
svelte:
specifier: ^5.0.0
version: 5.56.1(@typescript-eslint/[email protected])
@@ -13817,8 +13817,8 @@ packages:
resolution: {integrity: sha512-kPr4RrQmbbZeAjwBYeBSpFvAHV8rkTlNPUluIxkRriq5TpevfFelVO5xvcF6oguHPVn0R6wPuVer4HudfcLy/A==}
engines: {node: '>=20.18.1'}
- resolution: {integrity: sha512-XLFzfNNIUPlUlyheFEzj0H4Vnhi9nI0nl3Nfgg8HYXW1FkUVhVT1X+mgmOUW8aWL5SeG0A+yJIV5fm3Hr9MVkQ==}
+ resolution: {integrity: sha512-tUFZgkYmfVNQVm3xX7lhSzOvDsp+O14ac5dwgXIr5mIsr79ISueb/Mu+ZtWMz0DH6v77u4eYyvbQ9TTMpSn3aw==}
engines: {node: '>=20.18.1'}
@@ -30686,7 +30686,7 @@ snapshots:
- supports-color
- typescript
dependencies:
'@babel/core': 7.29.0([email protected])
'@babel/parser': 7.29.7
@@ -30712,11 +30712,12 @@ snapshots:
postcss-selector-parser: 7.1.4
prompts: 2.4.2
recast: 0.23.12
+ socks: 2.8.9
stringify-object: 5.0.0
tailwind-merge: 3.6.0
ts-morph: 26.0.0
tsconfig-paths: 4.2.0
- undici: 7.28.0
+ undici: 7.29.0
validate-npm-package-name: 7.0.2
zod: 3.25.76
zod-to-json-schema: 3.25.2([email protected])