Skip to content

armgit / eve

Public Imported from GitHub
0

The Open Framework for Building Agents

feat(eve): set up registry connections during add (#1427)

OwenKephart155d46a20b75
diff --git a/.changeset/registry-setup-disconnect.md b/.changeset/registry-setup-disconnect.md
new file mode 100644
index 000000000..de1a4700a
--- /dev/null
+++ b/.changeset/registry-setup-disconnect.md
@@ -0,0 +1,5 @@
+---
+"eve": patch
+---
+
+Connection registry items now configure their Vercel Connect connector during `eve add`, and registry setup commands close their IPC channel after reporting an outcome so `/add` returns instead of remaining stuck.
diff --git a/apps/docs/registry.json b/apps/docs/registry.json
index 58008e42a..0cec1502f 100644
--- a/apps/docs/registry.json
+++ b/apps/docs/registry.json
@@ -125,6 +125,17 @@
"type": "registry:item",
"title": "Vercel",
"description": "Manage Vercel projects, deployments, and logs through Vercel's MCP server.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "vercel", "vercel", "vercel"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -139,6 +150,17 @@
"type": "registry:item",
"title": "Linear",
"description": "Issues, projects, cycles, and comments via Linear's MCP server.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "linear", "mcp.linear.app", "linear"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -153,6 +175,17 @@
"type": "registry:item",
"title": "Notion",
"description": "Search and edit Notion pages and databases over MCP or OpenAPI.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "notion", "mcp.notion.com", "notion"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -167,6 +200,17 @@
"type": "registry:item",
"title": "Datadog",
"description": "Query metrics, monitors, and logs through Datadog's MCP server.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "datadog", "mcp.datadoghq.com", "datadog"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -181,6 +225,17 @@
"type": "registry:item",
"title": "Honeycomb",
"description": "Explore traces and run queries through Honeycomb's MCP server.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "honeycomb", "mcp.honeycomb.io", "honeycomb"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -195,6 +250,17 @@
"type": "registry:item",
"title": "Airtable",
"description": "Bases, tables, and records through Airtable's MCP server.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "airtable", "airtable", "airtable"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -209,6 +275,17 @@
"type": "registry:item",
"title": "Bitly",
"description": "Shorten links, generate QR Codes, and track performance.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "bitly", "bitly", "bitly"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -223,6 +300,17 @@
"type": "registry:item",
"title": "Brex",
"description": "Expenses, cards, and cash through Brex's finance automation.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "brex", "brex", "brex"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -237,6 +325,17 @@
"type": "registry:item",
"title": "Candid",
"description": "Research nonprofits and funders using Candid's data.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "candid", "candid", "candid"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -251,6 +350,17 @@
"type": "registry:item",
"title": "ClickHouse",
"description": "Query and explore your ClickHouse Cloud data.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "clickhouse", "clickhouse", "clickhouse"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -265,6 +375,17 @@
"type": "registry:item",
"title": "Cloudinary",
"description": "Manage, transform, and deliver your images and videos.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "cloudinary", "cloudinary", "cloudinary"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -279,6 +400,17 @@
"type": "registry:item",
"title": "Coda",
"description": "Create, search, and update docs and tables.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "coda", "coda", "coda"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -293,6 +425,17 @@
"type": "registry:item",
"title": "Egnyte",
"description": "Securely access and analyze Egnyte content.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "egnyte", "egnyte", "egnyte"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -307,6 +450,17 @@
"type": "registry:item",
"title": "Embat",
"description": "Ask Embat about cash, debt, payments, and accounting.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "embat", "embat", "embat"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -321,6 +475,17 @@
"type": "registry:item",
"title": "Hugging Face",
"description": "Access the Hugging Face Hub and thousands of Gradio apps.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "hugging-face", "hugging-face", "hugging-face"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -335,6 +500,17 @@
"type": "registry:item",
"title": "Local Falcon",
"description": "AI visibility and local search intelligence.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "local-falcon", "local-falcon", "local-falcon"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -349,6 +525,17 @@
"type": "registry:item",
"title": "Make",
"description": "Run Make scenarios and manage your Make account.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "make", "make", "make"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -363,6 +550,17 @@
"type": "registry:item",
"title": "Manufact",
"description": "Deploy and monitor MCP servers with Manufact.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "manufact", "manufact", "manufact"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -377,6 +575,17 @@
"type": "registry:item",
"title": "Mem0",
"description": "Persistent memory for AI agents and assistants.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "mem0", "mem0", "mem0"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -391,6 +600,17 @@
"type": "registry:item",
"title": "Miro",
"description": "Access and create content on Miro boards.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "miro", "miro", "miro"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -405,6 +625,17 @@
"type": "registry:item",
"title": "Mixpanel",
"description": "Analyze, query, and manage your Mixpanel data.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "mixpanel", "mixpanel", "mixpanel"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -419,6 +650,17 @@
"type": "registry:item",
"title": "Netlify",
"description": "Create, deploy, manage, and secure websites on Netlify.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "netlify", "netlify", "netlify"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -433,6 +675,17 @@
"type": "registry:item",
"title": "O'Reilly",
"description": "Discover O'Reilly's expert learning content.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "oreilly", "oreilly", "oreilly"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -447,6 +700,17 @@
"type": "registry:item",
"title": "PlanetScale",
"description": "Authenticated access to your PlanetScale Postgres and MySQL databases.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "planetscale", "planetscale", "planetscale"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -461,6 +725,17 @@
"type": "registry:item",
"title": "PostHog",
"description": "Query, analyze, and manage your PostHog insights.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "posthog", "posthog", "posthog"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -475,6 +750,17 @@
"type": "registry:item",
"title": "Postman",
"description": "Give API context to your coding agents with Postman.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "postman", "postman", "postman"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -489,6 +775,17 @@
"type": "registry:item",
"title": "Razorpay",
"description": "Razorpay payments, settlements, and dashboard data.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "razorpay", "razorpay", "razorpay"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -503,6 +800,17 @@
"type": "registry:item",
"title": "Sentry",
"description": "Search, query, and debug errors intelligently.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "sentry", "sentry", "sentry"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -517,6 +825,17 @@
"type": "registry:item",
"title": "Similarweb",
"description": "Real-time web, mobile app, and market data.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "similarweb", "similarweb", "similarweb"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -531,6 +850,17 @@
"type": "registry:item",
"title": "Stripe",
"description": "Payment processing and financial infrastructure tools.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "stripe", "stripe", "stripe"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -545,6 +875,17 @@
"type": "registry:item",
"title": "Supabase",
"description": "Manage databases, authentication, and storage.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "supabase", "supabase", "supabase"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -559,6 +900,17 @@
"type": "registry:item",
"title": "Ticket Tailor",
"description": "Manage tickets, orders, and events with Ticket Tailor.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "ticket-tailor", "ticket-tailor", "ticket-tailor"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -573,6 +925,17 @@
"type": "registry:item",
"title": "TickTick",
"description": "Search, create, and manage your tasks and habits in TickTick.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "ticktick", "ticktick", "ticktick"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -587,6 +950,17 @@
"type": "registry:item",
"title": "Todoist",
"description": "Search, complete, and manage your tasks in Todoist.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "todoist", "todoist", "todoist"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -601,6 +975,17 @@
"type": "registry:item",
"title": "Webflow",
"description": "Manage Webflow CMS, pages, assets, and sites.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "webflow", "webflow", "webflow"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -615,6 +1000,17 @@
"type": "registry:item",
"title": "Wix",
"description": "Manage and build sites and apps on Wix.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "wix", "wix", "wix"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -629,6 +1025,17 @@
"type": "registry:item",
"title": "Zapier",
"description": "Automate workflows across thousands of apps.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "zapier", "zapier", "zapier"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
@@ -643,6 +1050,17 @@
"type": "registry:item",
"title": "Zomato",
"description": "Online food ordering and delivery through Zomato.",
+ "meta": {
+ "eve": {
+ "setup": {
+ "command": "eve",
+ "package": "eve",
+ "bin": "eve",
+ "args": ["integration", "connect", "zomato", "zomato", "zomato"]
+ },
+ "requires": ">=0.29.0"
+ }
+ },
"dependencies": ["@vercel/connect"],
"files": [
{
diff --git a/apps/docs/scripts/validate-connection-registry.ts b/apps/docs/scripts/validate-connection-registry.ts
index 54e22531f..517212178 100644
--- a/apps/docs/scripts/validate-connection-registry.ts
+++ b/apps/docs/scripts/validate-connection-registry.ts
@@ -36,6 +36,13 @@ const expectedSlugs = connectionEntries()
.filter((entry) => entry.surfaces.gallery)
.map((entry) => entry.slug);
const actualSlugs = items.map((item) => item.name.slice("connection/".length));
+const CONNECT_SERVICES: Readonly<Record<string, string>> = {
+ vercel: "vercel",
+ linear: "mcp.linear.app",
+ notion: "mcp.notion.com",
+ datadog: "mcp.datadoghq.com",
+ honeycomb: "mcp.honeycomb.io",
+};
if (JSON.stringify(actualSlugs) !== JSON.stringify(expectedSlugs)) {
throw new Error(
@@ -58,6 +65,20 @@ for (const item of items) {
}
const slug = item.name.slice("connection/".length);
+ if (slug !== "browser-use") {
+ const expectedSetup = {
+ command: "eve",
+ package: "eve",
+ bin: "eve",
+ args: ["integration", "connect", slug, CONNECT_SERVICES[slug] ?? slug, slug],
+ };
+ if (JSON.stringify(setup) !== JSON.stringify(expectedSetup)) {
+ throw new Error(
+ `Registry item "${item.name}" must configure its Vercel Connect connector through eve.`,
+ );
+ }
+ }
+
const expectedPath = `registry/connections/${slug}.ts`;
const expectedTarget = `agent/connections/${slug}.ts`;
const file = item.files?.[0];
diff --git a/packages/eve/src/cli/commands/register-integration-commands.ts b/packages/eve/src/cli/commands/register-integration-commands.ts
index 5bd79409d..d9fba4dbd 100644
--- a/packages/eve/src/cli/commands/register-integration-commands.ts
+++ b/packages/eve/src/cli/commands/register-integration-commands.ts
@@ -25,6 +25,7 @@ export function registerIntegrationCommands(input: {
integration
.command("connect <slug> <service> [canonical-name]")
+ .option("-y, --yes")
.action(async (slug: string, service: string, canonicalName: string | undefined) => {
const { runIntegrationConnectCommand } = await import("./integration-connect.js");
await runIntegrationConnectCommand(logger, appRoot, slug, service, canonicalName);
diff --git a/packages/eve/src/cli/commands/registry.test.ts b/packages/eve/src/cli/commands/registry.test.ts
index 6acf857b1..e91dc7871 100644
--- a/packages/eve/src/cli/commands/registry.test.ts
+++ b/packages/eve/src/cli/commands/registry.test.ts
@@ -7,6 +7,7 @@ import {
runRegistryAddCommand,
runRegistryListCommand,
runRegistrySearchCommand,
+ resolveOfficialRegistryUrl,
runRegistryViewCommand,
type RegistryCommandLogger,
} from "./registry.js";
@@ -55,6 +56,7 @@ function createLogger(): RegistryCommandLogger & { errors: string[]; logs: strin
describe("registry commands", () => {
beforeEach(() => {
+ delete process.env.EVE_DEV_OFFICIAL_REGISTRY_URL;
vi.clearAllMocks();
vi.stubGlobal(
"fetch",
@@ -70,10 +72,25 @@ describe("registry commands", () => {
});
afterEach(() => {
+ delete process.env.EVE_DEV_OFFICIAL_REGISTRY_URL;
process.exitCode = undefined;
vi.unstubAllGlobals();
});
+ it("normalizes the explicit development official-registry override", () => {
+ expect(resolveOfficialRegistryUrl("http://localhost:4173/r/")).toBe("http://localhost:4173/r");
+ });
+
+ it.each([
+ ["invalid URL", "not a URL"],
+ ["unsupported protocol", "file:///tmp/registry"],
+ ["credentials", "https://user:[email protected]/r"],
+ ["query", "https://example.com/r?token=secret"],
+ ["fragment", "https://example.com/r#preview"],
+ ])("rejects a development official-registry override with %s", (_reason, value) => {
+ expect(() => resolveOfficialRegistryUrl(value)).toThrow(/EVE_DEV_OFFICIAL_REGISTRY_URL/);
+ });
+
it("installs official items through the registry SDK", async () => {
const logger = createLogger();
getRegistryItems.mockResolvedValue([{ name: "extension/browser", type: "registry:item" }]);
diff --git a/packages/eve/src/cli/commands/registry.ts b/packages/eve/src/cli/commands/registry.ts
index 569309f32..513511c2b 100644
--- a/packages/eve/src/cli/commands/registry.ts
+++ b/packages/eve/src/cli/commands/registry.ts
@@ -68,7 +68,40 @@ const defaultAddCommandDependencies: AddCommandDependencies = {
(await import("./registry-setup-command.js")).runRegistrySetupCommand,
};
-const OFFICIAL_REGISTRY = process.env.EVE_DEV_OFFICIAL_REGISTRY_URL ?? "https://eve.dev/r";
+const DEFAULT_OFFICIAL_REGISTRY_URL = "https://eve.dev/r";
+
+/**
+ * Resolves the official registry URL, honoring the explicit development trust override.
+ *
+ * The override makes its registry eligible to supply setup commands, so it must be
+ * configured in the process environment rather than project configuration.
+ */
+export function resolveOfficialRegistryUrl(
+ configured = process.env.EVE_DEV_OFFICIAL_REGISTRY_URL,
+): string {
+ if (configured === undefined) return DEFAULT_OFFICIAL_REGISTRY_URL;
+
+ let url: URL;
+ try {
+ url = new URL(configured);
+ } catch {
+ throw new Error("EVE_DEV_OFFICIAL_REGISTRY_URL must be an HTTP(S) URL.");
+ }
+ if (url.protocol !== "http:" && url.protocol !== "https:") {
+ throw new Error("EVE_DEV_OFFICIAL_REGISTRY_URL must be an HTTP(S) URL.");
+ }
+ if (url.username !== "" || url.password !== "") {
+ throw new Error("EVE_DEV_OFFICIAL_REGISTRY_URL must not include credentials.");
+ }
+ if (url.search !== "" || url.hash !== "") {
+ throw new Error("EVE_DEV_OFFICIAL_REGISTRY_URL must not include a query or fragment.");
+ }
+
+ url.pathname = url.pathname.replace(/\/+$/, "");
+ return url.toString().replace(/\/$/, "");
+}
+
+const OFFICIAL_REGISTRY = resolveOfficialRegistryUrl();
const OFFICIAL_CATALOG = `${OFFICIAL_REGISTRY}/registry.json`;
// shadcn's registry search response omits titles. Keep this one exception until it includes them.
diff --git a/packages/eve/src/setup/registry-setup-client.test.ts b/packages/eve/src/setup/registry-setup-client.test.ts
new file mode 100644
index 000000000..e6945154d
--- /dev/null
+++ b/packages/eve/src/setup/registry-setup-client.test.ts
@@ -0,0 +1,66 @@
+import { EventEmitter } from "node:events";
+
+import { afterEach, describe, expect, it, vi } from "vitest";
+
+import { createRegistrySetupClient, type RegistrySetupClient } from "./registry-setup-client.js";
+import type { RegistrySetupChildMessage } from "./registry-setup-protocol.js";
+
+class SetupProcessStub extends EventEmitter {
+ connected = true;
+ sent: RegistrySetupChildMessage[] = [];
+ send = vi.fn((message: RegistrySetupChildMessage) => {
+ this.sent.push(message);
+ return true;
+ });
+ disconnect = vi.fn(() => {
+ this.connected = false;
+ });
+}
+
+const previousProtocol = process.env.EVE_SETUP_PROTOCOL;
+
+afterEach(() => {
+ if (previousProtocol === undefined) delete process.env.EVE_SETUP_PROTOCOL;
+ else process.env.EVE_SETUP_PROTOCOL = previousProtocol;
+});
+
+function client(processStub: SetupProcessStub): RegistrySetupClient {
+ process.env.EVE_SETUP_PROTOCOL = "1";
+ const result = createRegistrySetupClient({
+ process: processStub,
+ });
+ if (result === undefined) throw new Error("Expected a registry setup client.");
+ return result;
+}
+
+describe("createRegistrySetupClient", () => {
+ it("disconnects the IPC channel after reporting a terminal outcome", () => {
+ const processStub = new SetupProcessStub();
+ const setup = client(processStub);
+
+ setup.complete([{ label: "Connector", value: "linear/agent" }]);
+
+ expect(processStub.sent.at(-1)).toEqual({
+ type: "result",
+ outcome: {
+ kind: "completed",
+ facts: [{ label: "Connector", value: "linear/agent" }],
+ },
+ });
+ expect(processStub.disconnect).toHaveBeenCalledOnce();
+ expect(processStub.listenerCount("message")).toBe(0);
+ });
+
+ it("reports only the first terminal outcome", () => {
+ const processStub = new SetupProcessStub();
+ const setup = client(processStub);
+
+ setup.cancel();
+ setup.complete();
+
+ expect(processStub.sent.filter((message) => message.type === "result")).toEqual([
+ { type: "result", outcome: { kind: "cancelled" } },
+ ]);
+ expect(processStub.disconnect).toHaveBeenCalledOnce();
+ });
+});
diff --git a/packages/eve/src/setup/registry-setup-client.ts b/packages/eve/src/setup/registry-setup-client.ts
index 1e6c5e82c..14dcec483 100644
--- a/packages/eve/src/setup/registry-setup-client.ts
+++ b/packages/eve/src/setup/registry-setup-client.ts
@@ -16,8 +16,12 @@ import {
type RegistrySetupPrompt,
} from "./registry-setup-protocol.js";
-interface SetupProcess extends NodeJS.Process {
+interface SetupProcess {
+ connected?: boolean;
send?: (message: RegistrySetupChildMessage) => boolean;
+ disconnect?: () => void;
+ on(event: "message", listener: (message: RegistrySetupParentMessage) => void): unknown;
+ off(event: "message", listener: (message: RegistrySetupParentMessage) => void): unknown;
}
function send(process: SetupProcess, message: RegistrySetupChildMessage): void {
@@ -202,6 +206,8 @@ export function createRegistrySetupClient(
if (terminal) return;
terminal = true;
send(childProcess, { type: "result", outcome });
+ childProcess.off("message", onMessage);
+ childProcess.disconnect?.();
};
return {
prompter,