Skip to content

armgit / eve

Public Imported from GitHub
0

The Open Framework for Building Agents

docs(eve): guide agents through headless setup (#1800)

OwenKephart55b5cc7f44c7
diff --git a/.changeset/fresh-agent-setup-guide.md b/.changeset/fresh-agent-setup-guide.md
new file mode 100644
index 000000000..32237b7be
--- /dev/null
+++ b/.changeset/fresh-agent-setup-guide.md
@@ -0,0 +1,5 @@
+---
+"eve": patch
+---
+
+Teach newly scaffolded coding agents to discover integrations and follow the structured `eve add --headless` setup flow through completion.
diff --git a/apps/docs/registry.json b/apps/docs/registry.json
index 1e71092a8..fcbaaec53 100644
--- a/apps/docs/registry.json
+++ b/apps/docs/registry.json
@@ -1200,7 +1200,9 @@
"bin": "eve",
"args": ["integration", "setup", "slack"]
},
- "requires": ">=0.31.4"
+ "requires": ">=0.31.4",
+ "docs": "/docs/channels/slack",
+ "implementation": "native"
}
},
"dependencies": ["@vercel/connect@>=0.4.2"]
@@ -1219,7 +1221,9 @@
"bin": "eve",
"args": ["integration", "setup", "discord"]
},
- "requires": ">=0.31.4"
+ "requires": ">=0.31.4",
+ "docs": "/docs/channels/discord",
+ "implementation": "native"
}
}
},
@@ -1238,7 +1242,13 @@
"type": "registry:file",
"target": "agent/channels/teams.ts"
}
- ]
+ ],
+ "meta": {
+ "eve": {
+ "docs": "/docs/channels/teams",
+ "implementation": "native"
+ }
+ }
},
{
"name": "channel/telegram",
@@ -1254,7 +1264,13 @@
"type": "registry:file",
"target": "agent/channels/telegram.ts"
}
- ]
+ ],
+ "meta": {
+ "eve": {
+ "docs": "/docs/channels/telegram",
+ "implementation": "native"
+ }
+ }
},
{
"name": "channel/twilio",
@@ -1271,7 +1287,13 @@
"type": "registry:file",
"target": "agent/channels/twilio.ts"
}
- ]
+ ],
+ "meta": {
+ "eve": {
+ "docs": "/docs/channels/twilio",
+ "implementation": "native"
+ }
+ }
},
{
"name": "channel/github",
@@ -1286,7 +1308,9 @@
"bin": "eve",
"args": ["integration", "setup", "github"]
},
- "requires": ">=0.31.4"
+ "requires": ">=0.31.4",
+ "docs": "/docs/channels/github",
+ "implementation": "native"
}
},
"dependencies": ["@vercel/connect@>=0.6.0"]
@@ -1304,7 +1328,9 @@
"bin": "eve",
"args": ["integration", "setup", "linear"]
},
- "requires": ">=0.31.4"
+ "requires": ">=0.31.4",
+ "docs": "/docs/channels/linear",
+ "implementation": "native"
}
},
"dependencies": ["@vercel/connect"]
@@ -1322,7 +1348,9 @@
"bin": "eve",
"args": ["integration", "setup", "web"]
},
- "requires": ">=0.31.4"
+ "requires": ">=0.31.4",
+ "docs": "/docs/channels/eve",
+ "implementation": "native"
}
},
"dependencies": [
@@ -1557,6 +1585,12 @@
],
"envVars": {
"GOOGLE_CHAT_CREDENTIALS": ""
+ },
+ "meta": {
+ "eve": {
+ "docs": "/docs/channels/chat-sdk",
+ "implementation": "chat-sdk"
+ }
}
},
{
@@ -1577,6 +1611,12 @@
"WHATSAPP_APP_SECRET": "",
"WHATSAPP_PHONE_NUMBER_ID": "",
"WHATSAPP_VERIFY_TOKEN": ""
+ },
+ "meta": {
+ "eve": {
+ "docs": "/docs/channels/chat-sdk",
+ "implementation": "chat-sdk"
+ }
}
},
{
@@ -1595,6 +1635,12 @@
"envVars": {
"X_CONSUMER_SECRET": "",
"X_USER_ACCESS_TOKEN": ""
+ },
+ "meta": {
+ "eve": {
+ "docs": "/docs/channels/chat-sdk",
+ "implementation": "chat-sdk"
+ }
}
},
{
@@ -1614,6 +1660,12 @@
"FACEBOOK_APP_SECRET": "",
"FACEBOOK_PAGE_ACCESS_TOKEN": "",
"FACEBOOK_VERIFY_TOKEN": ""
+ },
+ "meta": {
+ "eve": {
+ "docs": "/docs/channels/chat-sdk",
+ "implementation": "chat-sdk"
+ }
}
},
{
@@ -1632,7 +1684,13 @@
"type": "registry:file",
"target": "agent/channels/zernio.ts"
}
- ]
+ ],
+ "meta": {
+ "eve": {
+ "docs": "/docs/channels/chat-sdk",
+ "implementation": "chat-sdk"
+ }
+ }
},
{
"name": "channel/chat-sdk-velt",
@@ -1650,7 +1708,13 @@
"type": "registry:file",
"target": "agent/channels/velt.ts"
}
- ]
+ ],
+ "meta": {
+ "eve": {
+ "docs": "/docs/channels/chat-sdk",
+ "implementation": "chat-sdk"
+ }
+ }
},
{
"name": "channel/chat-sdk-sendblue",
@@ -1669,7 +1733,13 @@
"type": "registry:file",
"target": "agent/channels/sendblue.ts"
}
- ]
+ ],
+ "meta": {
+ "eve": {
+ "docs": "/docs/channels/chat-sdk",
+ "implementation": "chat-sdk"
+ }
+ }
},
{
"name": "channel/chat-sdk-novu",
@@ -1687,6 +1757,12 @@
"envVars": {
"NOVU_SECRET_KEY": "",
"NOVU_AGENT_IDENTIFIER": ""
+ },
+ "meta": {
+ "eve": {
+ "docs": "/docs/channels/chat-sdk",
+ "implementation": "chat-sdk"
+ }
}
},
{
@@ -1705,7 +1781,13 @@
"type": "registry:file",
"target": "agent/channels/liveblocks.ts"
}
- ]
+ ],
+ "meta": {
+ "eve": {
+ "docs": "/docs/channels/chat-sdk",
+ "implementation": "chat-sdk"
+ }
+ }
},
{
"name": "channel/chat-sdk-linq",
@@ -1723,7 +1805,13 @@
"type": "registry:file",
"target": "agent/channels/linq.ts"
}
- ]
+ ],
+ "meta": {
+ "eve": {
+ "docs": "/docs/channels/chat-sdk",
+ "implementation": "chat-sdk"
+ }
+ }
},
{
"name": "channel/chat-sdk-kapso",
@@ -1742,7 +1830,13 @@
"type": "registry:file",
"target": "agent/channels/kapso.ts"
}
- ]
+ ],
+ "meta": {
+ "eve": {
+ "docs": "/docs/channels/chat-sdk",
+ "implementation": "chat-sdk"
+ }
+ }
},
{
"name": "channel/photon-imessage",
@@ -1758,7 +1852,9 @@
"bin": "eve",
"args": ["integration", "setup", "photon"]
},
- "requires": ">=0.31.4"
+ "requires": ">=0.31.4",
+ "docs": "/docs/channels/photon",
+ "implementation": "native"
}
}
},
@@ -1779,7 +1875,13 @@
"type": "registry:file",
"target": "agent/channels/dial.ts"
}
- ]
+ ],
+ "meta": {
+ "eve": {
+ "docs": "/docs/channels/chat-sdk",
+ "implementation": "chat-sdk"
+ }
+ }
},
{
"name": "channel/chat-sdk-agentphone",
@@ -1798,7 +1900,13 @@
"type": "registry:file",
"target": "agent/channels/agentphone.ts"
}
- ]
+ ],
+ "meta": {
+ "eve": {
+ "docs": "/docs/channels/chat-sdk",
+ "implementation": "chat-sdk"
+ }
+ }
},
{
"name": "channel/chat-sdk-lark",
@@ -1816,7 +1924,13 @@
"type": "registry:file",
"target": "agent/channels/lark.ts"
}
- ]
+ ],
+ "meta": {
+ "eve": {
+ "docs": "/docs/channels/chat-sdk",
+ "implementation": "chat-sdk"
+ }
+ }
},
{
"name": "channel/chat-sdk-beeper",
@@ -1834,6 +1948,12 @@
"envVars": {
"MATRIX_BASE_URL": "",
"MATRIX_ACCESS_TOKEN": ""
+ },
+ "meta": {
+ "eve": {
+ "docs": "/docs/channels/chat-sdk",
+ "implementation": "chat-sdk"
+ }
}
},
{
@@ -1853,7 +1973,13 @@
"type": "registry:file",
"target": "agent/channels/resend.ts"
}
- ]
+ ],
+ "meta": {
+ "eve": {
+ "docs": "/docs/channels/chat-sdk",
+ "implementation": "chat-sdk"
+ }
+ }
},
{
"name": "instrumentation/braintrust",
diff --git a/docs/install-integrations.mdx b/docs/install-integrations.mdx
index f79db5e56..2400971e2 100644
--- a/docs/install-integrations.mdx
+++ b/docs/install-integrations.mdx
@@ -22,6 +22,8 @@ Some integrations package several independently installable components. For exam
When an official item declares an interactive setup flow or flows, eve asks whether to run them after installation and runs multiple flows in declaration order. Run the printed `eve add <item> --skip-install` command to resume a skipped or cancelled setup later; it reruns the selected components' declared flows from the beginning.
+For non-interactive automation, run `eve add <item> --non-interactive`. Add `--yes` to accept recommended setup values and reduce setup round trips; explicit `--answer` values take precedence. Eve returns structured component, setup-input, or prerequisite instructions instead of prompting. Use the continuation command in the response and add the requested answer; it adds `--skip-install` once registry installation has completed; resupply any prior answers from the calling agent's state. Pass non-secret answers with repeatable `--answer 'key=<JSON value>'` options. Supply secrets through the integration's documented environment variable or secret store rather than command-line arguments.
+
## Find an integration
Browse the [Integrations directory](/integrations) to see the official integrations available from the eve registry.
diff --git a/docs/reference/cli.md b/docs/reference/cli.md
index 796fb305d..20af15f7d 100644
--- a/docs/reference/cli.md
+++ b/docs/reference/cli.md
@@ -100,7 +100,9 @@ eve add @acme/my-extension
`eve add` asks before running setup declared by an official item and runs multiple declared flows in declaration order. Product-level packages can offer independently installable components: `eve add linear` lets you select the Linear Channel, Linear MCP, or both, with both selected by default. `--yes` installs a package's default components and accepts detected or recommended setup answers.
-When setup is skipped or cancelled, eve prints the matching `eve add <item> --skip-install` command. `--skip-install` reruns the selected components' declared flows from the beginning without reinstalling them.
+Coding agents should use `eve add <item> --non-interactive`, adding `--yes` to accept recommended setup values and reduce setup round trips. Explicit `--answer` values take precedence. This mode never opens an eve prompt. When a component or setup decision is missing, the NDJSON terminal event includes a stable question key and a safe continuation command; add the requested answer to that command. Supply answers with repeatable `--answer 'key=<JSON value>'` options. Follow a reported `eve link` prerequisite before retrying Vercel Connect setup. Do not put secrets in command-line answers; use the integration's documented environment variable or secret store.
+
+When setup is skipped, cancelled, or needs more input after installation, eve prints or returns the matching `eve add <item> --skip-install` continuation. It reruns the selected components' declared flows without reinstalling registry files.
`eve registry add` records configured sources in `package.json#registries`. `eve registry list` aggregates the official catalog and all configured sources by default. `eve registry search` also includes [skills.sh](https://skills.sh), available without configuration at `@skills`, and groups results by source with each source's available result count. Search returns up to 10 matches per source by default; pass `--limit <count>` to request between 1 and 100. Either command can browse one supplied URL or namespace. Official and other universal items with explicit file targets do not require shadcn project configuration.
diff --git a/packages/eve/src/cli/commands/integration-connect.test.ts b/packages/eve/src/cli/commands/integration-connect.test.ts
index 684d977b0..89a6a1c86 100644
--- a/packages/eve/src/cli/commands/integration-connect.test.ts
+++ b/packages/eve/src/cli/commands/integration-connect.test.ts
@@ -117,6 +117,23 @@ describe("runIntegrationConnect", () => {
expect(process.exitCode).toBe(2);
});
+ it("does not create an interactive prompter for a non-interactive command", async () => {
+ const createPrompter = vi.fn(() => createFakePrompter().prompter);
+ const deps = dependencies({ createPrompter });
+
+ await runIntegrationConnectCommand(
+ { log: vi.fn(), error: vi.fn() },
+ "/project",
+ "linear",
+ "mcp.linear.app",
+ undefined,
+ { nonInteractive: true },
+ deps,
+ );
+
+ expect(createPrompter).not.toHaveBeenCalled();
+ });
+
it("cleans up a newly-created connector when the installed file cannot be patched", async () => {
const deps = dependencies({
setupConnectionConnector: vi.fn(async () => ({
diff --git a/packages/eve/src/cli/commands/integration-connect.ts b/packages/eve/src/cli/commands/integration-connect.ts
index c47bc08fc..7dfa8567d 100644
--- a/packages/eve/src/cli/commands/integration-connect.ts
+++ b/packages/eve/src/cli/commands/integration-connect.ts
@@ -137,7 +137,10 @@ export async function runIntegrationConnectCommand(
dependencies: {
...dependencies,
createPrompter: () =>
- client?.prompter ?? dependencies.createPrompter?.() ?? createPrompter(),
+ client?.prompter ??
+ (options.nonInteractive
+ ? createHeadlessPrompter(() => {})
+ : (dependencies.createPrompter?.() ?? createPrompter())),
},
});
client?.complete();
diff --git a/packages/eve/src/cli/commands/register-registry-commands.ts b/packages/eve/src/cli/commands/register-registry-commands.ts
index 704e1bd98..9582c6ec9 100644
--- a/packages/eve/src/cli/commands/register-registry-commands.ts
+++ b/packages/eve/src/cli/commands/register-registry-commands.ts
@@ -110,9 +110,10 @@ export function registerRegistryCommands(input: {
registry
.command("view <item>")
- .description("Print one registry item as JSON.")
- .action(async (item: string) => {
+ .description("Inspect one registry item.")
+ .option("--json", "Output the raw registry item as JSON.")
+ .action(async (item: string, options: { json?: boolean }) => {
const { runRegistryViewCommand } = await import("./registry.js");
- await runRegistryViewCommand(logger, appRoot, item);
+ await runRegistryViewCommand(logger, appRoot, item, options);
});
}
diff --git a/packages/eve/src/cli/commands/registry-metadata.test.ts b/packages/eve/src/cli/commands/registry-metadata.test.ts
new file mode 100644
index 000000000..0ff6227d7
--- /dev/null
+++ b/packages/eve/src/cli/commands/registry-metadata.test.ts
@@ -0,0 +1,34 @@
+import { describe, expect, it } from "vitest";
+
+import {
+ parseOfficialRegistrySearchMetadata,
+ parseRegistryPresentationManifest,
+} from "./registry-metadata.js";
+
+describe("registry metadata", () => {
+ it("parses official search metadata by item name", () => {
+ const metadata = parseOfficialRegistrySearchMetadata({
+ items: [
+ {
+ name: "channel/photon-imessage",
+ meta: {
+ eve: { docs: "/docs/channels/photon", implementation: "native" },
+ },
+ },
+ { name: "extension/browser" },
+ ],
+ });
+
+ expect([...metadata]).toEqual([
+ ["channel/photon-imessage", { docs: "/docs/channels/photon", implementation: "native" }],
+ ]);
+ });
+
+ it("rejects malformed official catalog items", () => {
+ expect(() => parseOfficialRegistrySearchMetadata({ items: [{ name: 42 }] })).toThrow();
+ });
+
+ it("returns undefined for values that cannot be presented as manifests", () => {
+ expect(parseRegistryPresentationManifest(["not", "a", "manifest"])).toBeUndefined();
+ });
+});
diff --git a/packages/eve/src/cli/commands/registry-metadata.ts b/packages/eve/src/cli/commands/registry-metadata.ts
index a4ccb2d1b..6a8fdb33d 100644
--- a/packages/eve/src/cli/commands/registry-metadata.ts
+++ b/packages/eve/src/cli/commands/registry-metadata.ts
@@ -8,24 +8,63 @@ const RegistrySetupSchema = z.object({
args: z.array(z.string()).default([]),
});
-const EveRegistryItemMetadataSchema = z.object({
- meta: z
- .object({
- eve: z
- .object({
- requires: z.string().optional(),
- setup: z
- .union([RegistrySetupSchema, z.array(RegistrySetupSchema).min(1)])
- .transform((setup) => (Array.isArray(setup) ? setup : [setup]))
- .optional(),
- components: z.array(RegistryPackageComponentSchema).min(1).optional(),
- })
- .optional(),
- })
+const EveRegistryMetadataSchema = z.object({
+ requires: z.string().optional(),
+ docs: z.string().min(1).optional(),
+ implementation: z.enum(["native", "chat-sdk"]).optional(),
+ setup: z
+ .union([RegistrySetupSchema, z.array(RegistrySetupSchema).min(1)])
+ .transform((setup) => (Array.isArray(setup) ? setup : [setup]))
.optional(),
+ components: z.array(RegistryPackageComponentSchema).min(1).optional(),
+});
+
+const EveRegistryItemMetadataSchema = z.object({
+ meta: z.object({ eve: EveRegistryMetadataSchema.optional() }).optional(),
});
+const OfficialRegistryCatalogSchema = z.object({
+ items: z.array(
+ z.object({
+ name: z.string().min(1),
+ meta: z.object({ eve: EveRegistryMetadataSchema.optional() }).optional(),
+ }),
+ ),
+});
+
+const RegistryPresentationManifestSchema = EveRegistryItemMetadataSchema.extend({
+ title: z.string().optional(),
+ description: z.string().optional(),
+ dependencies: z.array(z.string()).optional(),
+ files: z.array(z.object({ target: z.string() })).optional(),
+});
+
+export type RegistrySearchMetadata = Pick<
+ z.infer<typeof EveRegistryMetadataSchema>,
+ "docs" | "implementation"
+>;
+
/** Parses eve-owned metadata from a registry item manifest. */
export function eveMetadataFromRegistryItem(item: unknown) {
return EveRegistryItemMetadataSchema.parse(item).meta?.eve;
}
+
+/** Extracts search metadata from the eve-owned official registry catalog. */
+export function parseOfficialRegistrySearchMetadata(
+ input: unknown,
+): ReadonlyMap<string, RegistrySearchMetadata> {
+ const { items } = OfficialRegistryCatalogSchema.parse(input);
+ const metadata = new Map<string, RegistrySearchMetadata>();
+ for (const item of items) {
+ const { docs, implementation } = item.meta?.eve ?? {};
+ if (docs !== undefined || implementation !== undefined) {
+ metadata.set(item.name, { docs, implementation });
+ }
+ }
+ return metadata;
+}
+
+/** Parses the fields used by the human-readable registry item view. */
+export function parseRegistryPresentationManifest(input: unknown) {
+ return RegistryPresentationManifestSchema.safeParse(input).data;
+}
diff --git a/packages/eve/src/cli/commands/registry-presentation.ts b/packages/eve/src/cli/commands/registry-presentation.ts
new file mode 100644
index 000000000..3f98ac874
--- /dev/null
+++ b/packages/eve/src/cli/commands/registry-presentation.ts
@@ -0,0 +1,125 @@
+import type { RegistrySearchItem } from "#compiled/shadcn-registry/index.js";
+import { createCliTheme, sanitizeForTerminal } from "#cli/ui/output.js";
+import { clipVisible, wrapVisibleLine } from "#cli/ui/terminal-text.js";
+
+import {
+ parseRegistryPresentationManifest,
+ type RegistrySearchMetadata,
+} from "./registry-metadata.js";
+
+export interface RegistrySearchPresentationItem extends RegistrySearchMetadata {
+ address: string;
+ item: RegistrySearchItem;
+}
+
+export interface RegistrySearchPresentationSection {
+ label: string;
+ items: RegistrySearchPresentationItem[];
+ total: number;
+}
+
+export function normalizeRegistryText(value: string): string {
+ return sanitizeForTerminal(value)
+ .replaceAll('\\"', '"')
+ .replaceAll("\\'", "'")
+ .replaceAll(/\s+/gu, " ")
+ .trim();
+}
+
+function registryDescriptionSummary(description: string): string {
+ const normalized = normalizeRegistryText(description);
+ return normalized.match(/^.*?[.!?](?=\s|$)/u)?.[0] ?? normalized;
+}
+
+function renderSearchItem(
+ item: RegistrySearchPresentationItem,
+ width: number,
+ theme: ReturnType<typeof createCliTheme>,
+): string {
+ const valueWidth = Math.max(1, width - 4);
+ const addressLines = wrapVisibleLine(normalizeRegistryText(item.address), valueWidth);
+ const implementationLabel =
+ item.implementation === "native"
+ ? "First-class eve channel"
+ : item.implementation === "chat-sdk"
+ ? "Chat SDK adapter"
+ : undefined;
+ const name = normalizeRegistryText(item.item.name);
+ const title = name.split("/").at(-1) ?? name;
+ const lines = [
+ ` ${theme.label(title)}${implementationLabel === undefined ? "" : theme.muted(` · ${implementationLabel}`)}`,
+ ...addressLines.map((line) => ` ${line}`),
+ ];
+ if (!item.item.description) return lines.join("\n");
+
+ const description = registryDescriptionSummary(item.item.description);
+ if (description.length === 0) return lines.join("\n");
+
+ const wrapped = wrapVisibleLine(description, valueWidth);
+ const descriptionLines =
+ wrapped.length <= 2
+ ? wrapped
+ : [wrapped[0]!, `${clipVisible(wrapped[1]!, Math.max(1, valueWidth - 1)).trimEnd()}…`];
+ lines.push(...descriptionLines.map((line) => theme.muted(` ${line}`)));
+ return lines.join("\n");
+}
+
+export function printRegistrySearchResults(
+ logger: { log(message: string): void },
+ input: {
+ json?: unknown;
+ query: string | undefined;
+ sections: readonly RegistrySearchPresentationSection[];
+ },
+): void {
+ if (input.json !== undefined) {
+ logger.log(JSON.stringify(input.json, null, 2));
+ return;
+ }
+ if (input.sections.every((section) => section.items.length === 0)) {
+ const query = input.query && normalizeRegistryText(input.query);
+ logger.log(query ? `No registry items match "${query}".` : "No registry items found.");
+ return;
+ }
+
+ const theme = createCliTheme();
+ const width = Math.max(20, process.stdout.columns ?? 80);
+ const rendered = input.sections.flatMap((section) => {
+ if (section.items.length === 0) return [];
+ const count = `${section.total} result${section.total === 1 ? "" : "s"}`;
+ const detail =
+ section.items.length < section.total ? `showing ${section.items.length} of ${count}` : count;
+ const heading = `${theme.label(section.label)} ${theme.muted(`(${detail})`)}`;
+ return [
+ [heading, ...section.items.map((item) => renderSearchItem(item, width, theme))].join("\n"),
+ ];
+ });
+ logger.log(rendered.join("\n"));
+}
+
+export function registryViewText(item: string, input: unknown): string {
+ const manifest = parseRegistryPresentationManifest(input);
+ if (manifest === undefined) return JSON.stringify(input, null, 2);
+
+ const metadata = manifest.meta?.eve;
+ const lines = [manifest.title ?? item, item];
+ if (manifest.description !== undefined) lines.push("", manifest.description);
+ if (metadata?.implementation !== undefined) {
+ lines.push(
+ "",
+ `Implementation ${metadata.implementation === "native" ? "First-class eve channel" : "Chat SDK adapter"}`,
+ );
+ }
+ if (metadata?.setup !== undefined) lines.push("Setup Guided setup");
+ if (metadata?.docs !== undefined) {
+ const docs = metadata.docs.startsWith("/") ? `https://eve.dev${metadata.docs}` : metadata.docs;
+ lines.push(`Documentation ${docs}`);
+ }
+ lines.push("Source Official eve registry");
+ if (manifest.dependencies?.length) {
+ lines.push("", "Packages", ...manifest.dependencies.map((value) => ` ${value}`));
+ }
+ const files = manifest.files?.map((file) => file.target) ?? [];
+ if (files.length > 0) lines.push("", "Files", ...files.map((value) => ` ${value}`));
+ return lines.join("\n");
+}
diff --git a/packages/eve/src/cli/commands/registry.test.ts b/packages/eve/src/cli/commands/registry.test.ts
index 3bb123eab..75160e7bb 100644
--- a/packages/eve/src/cli/commands/registry.test.ts
+++ b/packages/eve/src/cli/commands/registry.test.ts
@@ -206,6 +206,41 @@ describe("registry commands", () => {
expect(process.exitCode).toBe(2);
});
+ it("surfaces required deployment in non-interactive completion", async () => {
+ const logger = createLogger();
+ const runSetupCommand = vi.fn(async () => ({
+ kind: "completed" as const,
+ facts: [],
+ deploymentRequired: true as const,
+ }));
+ getRegistryItems.mockResolvedValue([
+ {
+ meta: {
+ eve: {
+ setup: [{ package: "eve", bin: "eve", args: ["integration", "setup", "web"] }],
+ },
+ },
+ },
+ ]);
+
+ await runAddCommand(
+ logger,
+ "/project",
+ "channel/web",
+ { nonInteractive: true, yes: true },
+ { loadSetupCommandRunner: async () => runSetupCommand },
+ );
+
+ expect(JSON.parse(logger.logs.at(-1)!)).toEqual({
+ version: 1,
+ type: "completed",
+ item: "channel/web",
+ completedItems: ["channel/web"],
+ deploymentRequired: true,
+ next: { command: "eve", args: ["deploy"] },
+ });
+ });
+
it("uses an answered component selection headlessly", async () => {
const logger = createLogger();
getRegistryItems
@@ -1162,6 +1197,49 @@ describe("registry commands", () => {
expect(logger.logs).toEqual(['No registry items match "missing".']);
});
+ it("includes official implementation and docs metadata in search JSON", async () => {
+ const logger = createLogger();
+ searchRegistries.mockResolvedValue({
+ items: [
+ {
+ registry: "https://eve.dev/r/registry.json",
+ name: "channel/photon-imessage",
+ addCommandArgument: "https://eve.dev/r/channel/photon-imessage.json",
+ },
+ ],
+ pagination: { total: 1, offset: 0, limit: 1, hasMore: false },
+ });
+ vi.stubGlobal(
+ "fetch",
+ vi.fn(
+ async () =>
+ new Response(
+ JSON.stringify({
+ items: [
+ {
+ name: "channel/photon-imessage",
+ meta: {
+ eve: {
+ docs: "/docs/channels/photon",
+ implementation: "native",
+ },
+ },
+ },
+ ],
+ }),
+ ),
+ ),
+ );
+
+ await runRegistrySearchCommand(logger, "/project", "imessage", undefined, { json: true });
+
+ expect(JSON.parse(logger.logs[0]!).items[0]).toMatchObject({
+ name: "channel/photon-imessage",
+ docs: "/docs/channels/photon",
+ implementation: "native",
+ });
+ });
+
it("emits search results as JSON", async () => {
const logger = createLogger();
const result = {
@@ -1231,22 +1309,38 @@ describe("registry commands", () => {
expect(process.exitCode).toBe(1);
});
- it("prints a registry item as JSON", async () => {
+ it("prints a planning-oriented registry item view", 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: {
- "@skills": "https://www.skills.sh/r/{name}?agent=eve",
- "@acme": "https://example.com/r/{name}.json",
+ getRegistryItems.mockResolvedValue([
+ {
+ title: "Photon iMessage",
+ description: "Connect an eve agent to iMessage through Photon.",
+ dependencies: ["@vercel/connect@>=0.5.0"],
+ files: [{ target: "agent/channels/photon.ts" }],
+ meta: {
+ eve: {
+ docs: "/docs/channels/photon",
+ implementation: "native",
+ setup: { package: "eve", bin: "eve", args: ["integration", "setup", "photon"] },
+ },
},
},
- });
- expect(logger.logs).toEqual([
- JSON.stringify({ name: "browser", type: "registry:item" }, null, 2),
]);
+
+ await runRegistryViewCommand(logger, "/project", "channel/photon-imessage");
+
+ expect(logger.logs[0]).toContain("Photon iMessage\nchannel/photon-imessage");
+ expect(logger.logs[0]).toContain("Implementation First-class eve channel");
+ expect(logger.logs[0]).toContain("Documentation https://eve.dev/docs/channels/photon");
+ });
+
+ it("prints the raw registry item with --json", async () => {
+ const logger = createLogger();
+ const item = { name: "browser", type: "registry:item" };
+ getRegistryItems.mockResolvedValue([item]);
+
+ await runRegistryViewCommand(logger, "/project", "extension/browser", { json: true });
+
+ expect(logger.logs).toEqual([JSON.stringify(item, null, 2)]);
});
});
diff --git a/packages/eve/src/cli/commands/registry.ts b/packages/eve/src/cli/commands/registry.ts
index f2f477cf0..a9266b889 100644
--- a/packages/eve/src/cli/commands/registry.ts
+++ b/packages/eve/src/cli/commands/registry.ts
@@ -14,9 +14,18 @@ import { WizardCancelledError } from "#setup/step.js";
import { hasInteractiveTerminal, NOT_AN_AGENT_MESSAGE } from "./preconditions.js";
import { runDeclaredSetups } from "./registry-declared-setups.js";
-import { eveMetadataFromRegistryItem } from "./registry-metadata.js";
+import {
+ eveMetadataFromRegistryItem,
+ parseOfficialRegistrySearchMetadata,
+ type RegistrySearchMetadata,
+} from "./registry-metadata.js";
import { runRegistryPackage } from "./registry-package.js";
-import { printRegistrySearchResults } from "./registry-search-presentation.js";
+import {
+ printRegistrySearchResults,
+ registryViewText,
+ type RegistrySearchPresentationItem,
+ type RegistrySearchPresentationSection,
+} from "./registry-presentation.js";
import type { runRegistrySetupCommand } from "./registry-setup-command.js";
import { serializeHeadlessSetupEvent } from "./setup-headless.js";
import { addRegistryMappings, readRegistryConfig } from "./registry-project.js";
@@ -224,14 +233,47 @@ function validateRegistrySource(source: string | undefined): void {
type RegistrySearchResult = Awaited<ReturnType<typeof searchRegistries>>;
+async function loadOfficialSearchMetadata(): Promise<ReadonlyMap<string, RegistrySearchMetadata>> {
+ const response = await fetch(OFFICIAL_CATALOG);
+ if (!response.ok) throw new Error(`Could not read the eve registry (${response.status}).`);
+ return parseOfficialRegistrySearchMetadata(await response.json());
+}
+
+function searchItemAddress(item: RegistrySearchItem): string {
+ return item.registry === OFFICIAL_CATALOG ? item.name : item.addCommandArgument;
+}
+
+function enrichSearchItem(
+ item: RegistrySearchItem,
+ metadataByAddress: ReadonlyMap<string, RegistrySearchMetadata>,
+): RegistrySearchPresentationItem {
+ const address = searchItemAddress(item);
+ return { item, address, ...metadataByAddress.get(address) };
+}
+
function registrySourceLabel(source: string): string {
if (source === OFFICIAL_CATALOG) return "eve";
if (source === SKILLS_REGISTRY) return "skills.sh";
return source;
}
-function searchItemAddress(item: RegistrySearchItem): string {
- return item.registry === OFFICIAL_CATALOG ? item.name : item.addCommandArgument;
+function searchPresentationSections(
+ sources: readonly string[],
+ resultsBySource: ReadonlyMap<string, RegistrySearchResult>,
+ metadataByAddress: ReadonlyMap<string, RegistrySearchMetadata>,
+): RegistrySearchPresentationSection[] {
+ return sources.flatMap((source) => {
+ const result = resultsBySource.get(source);
+ return result === undefined
+ ? []
+ : [
+ {
+ label: registrySourceLabel(source),
+ items: result.items.map((item) => enrichSearchItem(item, metadataByAddress)),
+ total: result.pagination.total,
+ },
+ ];
+ });
}
async function searchRegistryCatalog(
@@ -289,6 +331,17 @@ async function searchRegistryCatalog(
const uniqueErrors = new Map(
errors.map((error) => [`${error.registry}\0${error.message}`, error]),
);
+ const metadataByAddress = resultsBySource.has(OFFICIAL_CATALOG)
+ ? await loadOfficialSearchMetadata()
+ : new Map<string, RegistrySearchMetadata>();
+ const official = resultsBySource.get(OFFICIAL_CATALOG);
+ if (official !== undefined) {
+ official.items.sort((left, right) => {
+ const rank = (item: RegistrySearchItem) =>
+ metadataByAddress.get(searchItemAddress(item))?.implementation === "native" ? 0 : 1;
+ return rank(left) - rank(right);
+ });
+ }
const results = [...resultsBySource.values()];
const result: RegistrySearchResult = {
items: results.flatMap((entry) => entry.items),
@@ -300,7 +353,7 @@ async function searchRegistryCatalog(
},
...(uniqueErrors.size > 0 ? { errors: [...uniqueErrors.values()] } : {}),
};
- return { config, result, resultsBySource, sources };
+ return { config, result, resultsBySource, sources, metadataByAddress };
}
function registryManifestTitle(manifest: unknown): string | undefined {
@@ -347,27 +400,26 @@ async function browseRegistryItems(
source: string | undefined,
options: RegistrySearchCommandOptions = {},
): Promise<void> {
- const { result, resultsBySource, sources } = await searchRegistryCatalog(appRoot, {
- limit: options.limit,
- query,
- source,
- });
+ const { result, resultsBySource, sources, metadataByAddress } = await searchRegistryCatalog(
+ appRoot,
+ {
+ limit: options.limit,
+ query,
+ source,
+ },
+ );
const errors = result.errors ?? [];
if (options.json || resultsBySource.size > 0) {
- const sections = sources.flatMap((source) => {
- const sourceResult = resultsBySource.get(source);
- return sourceResult === undefined
- ? []
- : [
- {
- label: registrySourceLabel(source),
- items: sourceResult.items,
- total: sourceResult.pagination.total,
- address: searchItemAddress,
- },
- ];
- });
- printRegistrySearchResults(logger, result, { ...options, query, sections });
+ const items = result.items.map((item) => ({
+ ...item,
+ ...metadataByAddress.get(searchItemAddress(item)),
+ }));
+ const presentation: Parameters<typeof printRegistrySearchResults>[1] = {
+ query,
+ sections: searchPresentationSections(sources, resultsBySource, metadataByAddress),
+ };
+ if (options.json) presentation.json = { ...result, items };
+ printRegistrySearchResults(logger, presentation);
}
for (const error of errors) {
logger.error(`${error.registry}: ${error.message}`);
@@ -571,6 +623,12 @@ export async function runAddCommand(
type: "completed",
item,
completedItems: [item],
+ ...(completion.deploymentRequired === true
+ ? {
+ deploymentRequired: true as const,
+ next: { command: "eve", args: ["deploy"] },
+ }
+ : {}),
}),
);
}
@@ -626,15 +684,17 @@ export async function runRegistrySearchCommand(
);
}
-/** Prints one official, configured, or URL-addressed registry item as JSON. */
+/** Inspects one official, configured, or URL-addressed registry item. */
export async function runRegistryViewCommand(
logger: RegistryCommandLogger,
appRoot: string,
item: string,
+ options: RegistryCommandOptions = {},
): Promise<void> {
await runRegistryAction(logger, appRoot, async () => {
const config = await readEveRegistryConfig(appRoot);
const items = await getRegistryItems([itemAddress(item)], { config });
- logger.log(JSON.stringify(items.length === 1 ? items[0] : items, null, 2));
+ const result = items.length === 1 ? items[0] : items;
+ logger.log(options.json ? JSON.stringify(result, null, 2) : registryViewText(item, result));
});
}
diff --git a/packages/eve/src/cli/commands/setup-headless.ts b/packages/eve/src/cli/commands/setup-headless.ts
index 75c1f3291..194687e1c 100644
--- a/packages/eve/src/cli/commands/setup-headless.ts
+++ b/packages/eve/src/cli/commands/setup-headless.ts
@@ -17,7 +17,14 @@ export type HeadlessSetupEvent =
userCode?: string;
}
| { version: 1; type: "external_action_resolved"; id: string }
- | { version: 1; type: "completed"; item: string; completedItems: readonly string[] }
+ | {
+ version: 1;
+ type: "completed";
+ item: string;
+ completedItems: readonly string[];
+ deploymentRequired?: true;
+ next?: HeadlessSetupCommand;
+ }
| ({
version: 1;
type: "blocked";
diff --git a/packages/eve/src/cli/run.test.ts b/packages/eve/src/cli/run.test.ts
index 4cd55a78a..1ceeb6252 100644
--- a/packages/eve/src/cli/run.test.ts
+++ b/packages/eve/src/cli/run.test.ts
@@ -104,7 +104,7 @@ describe("CLI command registration", () => {
expect(help).toContain("add <registries...>");
expect(help).toContain("list [options]");
expect(help).toContain("search [options] <query>");
- expect(help).toContain("view <item>");
+ expect(help).toContain("view [options] <item>");
expect(help).not.toContain("remove [arguments...]");
expect(help).not.toContain("sources [arguments...]");
});
diff --git a/packages/eve/src/setup/scaffold/create/project.ts b/packages/eve/src/setup/scaffold/create/project.ts
index aad81a55d..33fca8972 100644
--- a/packages/eve/src/setup/scaffold/create/project.ts
+++ b/packages/eve/src/setup/scaffold/create/project.ts
@@ -269,10 +269,50 @@ from the installed eve package docs. In most installs, those docs are at
installed \`eve\` package location first and read its \`docs/\` directory. If
package docs are unavailable, use https://eve.dev/docs as a fallback.
-Before implementing an integration yourself, use
-\`eve registry search <query>\` or \`eve registry list\` to discover available
-integrations. Inspect one with \`eve registry view <item>\`, then install it with
-\`eve add <item>\`.
+## Adding integrations
+
+Before implementing an integration yourself, discover existing integrations:
+
+\`\`\`sh
+eve registry search <query> --json
+eve registry view <item>
+\`\`\`
+
+Prefer registry items whose \`implementation\` is \`native\`; use Chat SDK adapters when no
+native channel fits. \`registry view\` provides the selected item's documentation link.
+
+Install and configure one without driving interactive terminal prompts:
+
+\`\`\`sh
+eve add <item> --non-interactive
+\`\`\`
+
+Exit code 0 means setup completed, 1 means setup failed, and 2 means setup needs
+input or a prerequisite. On exit 2, parse the final NDJSON event and use its
+\`next.command\` as the continuation.
+
+Every \`--answer\` value is JSON, so strings need JSON quotes. For an editable
+question, you may supply its nested \`editable.key\` with the parent key in one
+invocation:
+
+\`\`\`sh
+eve add channel/photon-imessage --non-interactive \\
+ --answer 'photon-project-source="create"' \\
+ --answer 'photon-project-name="eve · my-agent"'
+\`\`\`
+
+Add \`--yes\` to accept recommended setup values and reduce setup round trips;
+explicit \`--answer\` values take precedence. Use the reported \`--skip-install\`
+continuation after installation.
+A Vercel Connect setup may report \`eve link\` as a prerequisite; run it and
+retry the continuation. Never pass secrets in \`--answer\`; use the documented
+environment variable or secret store.
+
+An \`external_action\` event with \`blocking: true\` means the command is still
+running while it waits for the user. Surface its URL and code, keep the process
+alive, and wait for its matching \`external_action_resolved\` event or a terminal
+event. Do not start a continuation. When a completed event has
+\`deploymentRequired: true\`, recommend its \`next\` command to deploy the changes.
`,
"CLAUDE.md": `@AGENTS.md
`,
diff --git a/packages/eve/src/setup/scaffold/index.integration.test.ts b/packages/eve/src/setup/scaffold/index.integration.test.ts
index 6fbfe45f7..611d46e4d 100644
--- a/packages/eve/src/setup/scaffold/index.integration.test.ts
+++ b/packages/eve/src/setup/scaffold/index.integration.test.ts
@@ -917,10 +917,16 @@ describe("scaffoldBaseProject", () => {
expect(agentsMd).toContain("installed eve package docs");
expect(agentsMd).toContain("node_modules/eve/docs/");
expect(agentsMd).toContain("resolve the\ninstalled `eve` package location");
- expect(agentsMd).toContain("`eve registry search <query>`");
- expect(agentsMd).toContain("`eve registry list`");
- expect(agentsMd).toContain("`eve registry view <item>`");
- expect(agentsMd).toContain("`eve add <item>`");
+ expect(agentsMd).toContain("eve registry search <query> --json");
+ expect(agentsMd).toContain("eve registry view <item>");
+ expect(agentsMd).toContain("eve add <item> --non-interactive");
+ expect(agentsMd).toContain("`implementation` is `native`");
+ expect(agentsMd).toContain("`deploymentRequired: true`");
+ expect(agentsMd).toContain("Exit code 0 means setup completed");
+ expect(agentsMd).toContain("next.command");
+ expect(agentsMd).toContain("--skip-install");
+ expect(agentsMd).toContain("eve link");
+ expect(agentsMd).toContain("external_action_resolved");
// `vercel deploy` uploads everything a .vercelignore doesn't exclude, and
// the platform default-ignores only the .env.local variants — eve's dev
// artifacts and a bare .env must be excluded here or a source deploy