UNPKG

eve

Version:

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

53 lines (52 loc) 2.21 kB
import type { RegistryCatalogItem } from "#cli/commands/registry.js"; import type { Prompter } from "#setup/prompter.js"; import { type RegistrySessionResult } from "./registry-session.js"; type Item = RegistryCatalogItem; export interface RegistryPlannerContext { /** Steps owned by an enclosing journey, rendered before the registry steps. */ prefixSteps?: readonly { label: string; complete?: boolean; }[]; /** Facts owned by the enclosing journey, rendered before registry selections. */ reviewMetadata?: readonly { label: string; value: string; }[]; reviewMessage?: string; primaryActionLabel?: string; emptyActionLabel?: string; } export interface RegistryFlowDeps { browseRegistryCatalog: (typeof import("#cli/commands/registry.js"))["browseRegistryCatalog"]; installRegistryItem: (typeof import("#cli/commands/registry.js"))["installRegistryItem"]; detectDeployment: (typeof import("#setup/project-resolution.js"))["detectDeployment"]; runDeployFlow: (typeof import("./deploy.js"))["runDeployFlow"]; } export declare class RegistryFlowFailedError extends Error { readonly completed: RegistrySessionResult; constructor(error: unknown, completed: RegistrySessionResult); } /** Collects a channel and integration plan, then installs every chosen item in order. */ export declare function runRegistryFlow(input: { appRoot: string; prompter: Prompter; signal?: AbortSignal; /** Registry item supplied by `/add <item>`, confirmed and installed directly. */ initialAddress?: string; plannerContext?: RegistryPlannerContext; onScreen?: (input: { screen: "registry_channels" | "registry_integrations" | "registry_review" | "registry_install"; registrySelectedCount?: number; }) => void; onItemStart?: (item: Item, index: number, total: number) => void; /** Gives each installation its own cancellation boundary without ending the batch. */ runItem?<T>(task: (signal?: AbortSignal) => Promise<T>): Promise<T>; deps?: Partial<RegistryFlowDeps>; }): Promise<{ kind: "done"; result: RegistrySessionResult; } | { kind: "cancelled"; }>; export {};