UNPKG

eve

Version:

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

68 lines (67 loc) 3.51 kB
import { type VercelProjectLink } from "#internal/vercel/project-link.js"; /** Link and production-deployment status for a Vercel project directory. */ export type DeploymentState = "unlinked" | "linked" | "deployed"; /** Vercel project data resolved from local link metadata and the API. */ export interface DeploymentInfo { state: DeploymentState; projectId?: string; orgId?: string; productionUrl?: string; } /** Validated Vercel owner and project identifiers. */ export type VercelProjectReference = VercelProjectLink; /** Parses the complete Vercel owner and project environment pair. */ export declare function projectReferenceFromEnvironment(environment: Readonly<Record<string, string | undefined>>): VercelProjectReference | undefined; /** Rejects Vercel's unsupported legacy link directory before link mutation. */ export declare function assertNoLegacyProjectLinkDirectory(projectRoot: string): Promise<void>; /** Reads a validated project reference from Vercel's link metadata directory. */ export declare function readProjectLink(projectPath: string): Promise<VercelProjectReference | undefined>; /** Cancellation options shared by Vercel project read/operation helpers. */ export interface VercelProjectOperationOptions { readonly signal?: AbortSignal; } /** * Reads local Vercel link metadata and checks whether the linked project has a production alias. */ export declare function detectDeployment(projectPath: string, options?: VercelProjectOperationOptions): Promise<DeploymentInfo>; /** Human-readable identity of a linked Vercel project, for the dashboard status bar. */ export interface ProjectIdentity { projectName: string; /** The team's display name; absent for a personal-account project. */ teamName?: string; } /** * Resolves a linked project's human-readable name and team for the dashboard * status bar, from local `.vercel/project.json` plus the Vercel API. A * personal-account project (a non-`team_` org) carries no team, so `teamName` * is absent; the project name falls back to its id if the API call fails. * * Returns `undefined` when the directory is not linked. Network-bound: callers * render a loading affordance and cache the result. * * @param projectPath Absolute path of the linked project directory. */ export declare function detectProjectIdentity(projectPath: string, options?: VercelProjectOperationOptions): Promise<ProjectIdentity | undefined>; export type ProjectResolution = { kind: "unresolved"; } | { kind: "linked"; projectId: string; } | { kind: "deployed"; projectId: string; productionUrl: string; }; export declare function projectResolutionFromDeployment(deployment: DeploymentInfo): ProjectResolution; /** * Side-effect-free fact gathering after a link: reads `.vercel/project.json` * to resolve the project. The on-disk link is the single source of truth. */ export declare function detectProjectResolution(projectRoot: string, options?: VercelProjectOperationOptions): Promise<ProjectResolution>; export declare function mergeProjectResolution(current: ProjectResolution, next: ProjectResolution): ProjectResolution; export declare function projectResolutionFromDeployResult(project: ProjectResolution, deploy: { deployed: boolean; productionUrl?: string; }): ProjectResolution; export declare function isProjectResolved(project: ProjectResolution): boolean; export declare function projectProductionUrlFromResolution(project: ProjectResolution): string | undefined;