UNPKG

eve

Version:

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

48 lines (47 loc) 2 kB
import { inspectApplication } from "#services/inspect-application.js"; import { type DeployProjectDeps } from "../boxes/deploy-project.js"; import { type LinkProjectDeps } from "../boxes/link-project.js"; import { type ResolveProvisioningDeps } from "../boxes/resolve-provisioning.js"; import { detectDeployment } from "../project-resolution.js"; import type { Prompter } from "../prompter.js"; import { runLoginFlow } from "./login.js"; /** Injected for tests; defaults to the real detection and box effects. */ export interface DeployFlowDeps { detectDeployment: typeof detectDeployment; inspectApplication: typeof inspectApplication; runLoginFlow: typeof runLoginFlow; resolveProvisioning?: ResolveProvisioningDeps; linkProject?: LinkProjectDeps; deployProject?: DeployProjectDeps; } export type DeployFlowResult = { kind: "deployed"; productionUrl?: string; } | { kind: "cancelled"; } | { kind: "local-model"; } /** Unlinked directory in a non-interactive run: refused before any effect. */ | { kind: "needs-link"; }; /** * THE DEPLOY FLOW, shared by `eve deploy` and the dev TUI's `/deploy`. Link * state is the safety-critical input for a deploy, so it is re-detected at * decision time, never trusted from an earlier render. An already-linked * project goes straight to the deploy box; an unlinked one walks the same * login and team/project flow as onboarding (resolve-provisioning with the * deploy gate pre-answered — invoking deploy IS the deploy decision), then * links non-interactively so the deploy box never hits its bare-`vercel link` * fallback. A non-interactive run with no link refuses with `needs-link` * before any side effect. */ export declare function runDeployFlow(input: { appRoot: string; prompter: Prompter; signal?: AbortSignal; /** False when no TTY: an unlinked directory refuses instead of prompting. */ interactive: boolean; deps?: Partial<DeployFlowDeps>; }): Promise<DeployFlowResult>;