UNPKG

eve

Version:

Filesystem-first framework for durable backend AI agents that run anywhere.

65 lines (64 loc) • 2.54 kB
import type { Asker } from "#setup/ask.js"; import type { Prompter } from "#setup/prompter.js"; import type { VercelProjectReference } from "#setup/project-resolution.js"; import type { RegistrySetupCompletion } from "#setup/registry-setup-protocol.js"; import type { IntegrationSetupEnvironment } from "./shared/environment.js"; export interface SetupExternalAction { complete(): void; } export type SetupPresenter = Pick<Prompter, "log" | "note"> & { nextSteps(lines: readonly string[]): void; beginExternalAction(input: { url: string; userCode?: string; message: string; }): SetupExternalAction; }; export interface SetupPrepareContext { /** Selected agent project where authored files are changed. */ readonly appRoot: string; /** Project root for shared dependencies, Vercel links, and environment files. */ readonly projectRoot: string; readonly asker: Asker; readonly environment: IntegrationSetupEnvironment; readonly presenter: SetupPresenter; readonly resolveVercelProject: (integration: string) => Promise<VercelProjectReference>; signal?: AbortSignal; force?: boolean; } export interface SetupApplyContext { /** Selected agent project where authored files are changed. */ readonly appRoot: string; /** Project root for shared dependencies, Vercel links, and environment files. */ readonly projectRoot: string; readonly presenter: SetupPresenter; signal?: AbortSignal; force?: boolean; } export type IntegrationSetupResult = { readonly kind: "done"; readonly completion: RegistrySetupCompletion; } | { readonly kind: "cancelled"; }; interface SetupIntegrationDefinition<Plan> { readonly kind: string; readonly label: string; readonly hint?: string; describeEnvironment?(environment: IntegrationSetupEnvironment): string; prepare(context: SetupPrepareContext): Promise<Plan>; apply(plan: Plan, context: SetupApplyContext): Promise<RegistrySetupCompletion>; } export interface SetupIntegration { readonly kind: string; readonly label: string; hint?: string; describeEnvironment?(environment: IntegrationSetupEnvironment): string; run(input: { prepare: SetupPrepareContext; apply: SetupApplyContext; }): Promise<IntegrationSetupResult>; } /** Captures an integration's private plan type behind one executable lifecycle. */ export declare function defineSetupIntegration<Plan>(definition: SetupIntegrationDefinition<Plan>): SetupIntegration; export {};