UNPKG

eve

Version:

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

80 lines (79 loc) 4.02 kB
import type { PackageManagerKind } from "../../package-manager.js"; import { type WorkspaceRootMutation } from "../workspace-root.js"; export declare const CURRENT_DIRECTORY_PROJECT_NAME = "."; export declare const DEFAULT_AI_PACKAGE_VERSION = "__AI_SDK_VERSION__"; export declare const DEFAULT_CONNECT_PACKAGE_VERSION = "__VERCEL_CONNECT_VERSION__"; export declare const DEFAULT_ZOD_PACKAGE_VERSION = "__ZOD_VERSION__"; /** * The eve package metadata that generated projects consume together. Keeping * the dependency version and Node.js requirement in one value prevents a * scaffold from installing one eve release while declaring another release's * runtime contract. */ export interface EvePackageContract { /** eve dependency version or npm specifier written to the generated package. */ version: string; /** The matching eve release's authored `package.json` `engines.node` value. */ nodeEngine: string; } export declare const DEFAULT_EVE_PACKAGE_CONTRACT: EvePackageContract; /** Resolves a stamped or explicitly supplied eve package contract. */ export declare function resolveEvePackageContract(contract?: EvePackageContract): EvePackageContract; /** * Provider slug a gateway model id routes through: the segment before the * first "/" (e.g. `anthropic/claude-sonnet-5` → `anthropic`). The slug is * injected into generated source, so characters outside the catalog's slug * alphabet are dropped; an id without a usable prefix falls back to * `anthropic`. */ export declare function modelProviderSlug(modelId: string): string; /** * Env var the byok scaffold reads the provider API key from, derived from the * model's provider slug (e.g. `anthropic/...` → `ANTHROPIC_API_KEY`). The name * is the scaffold's convention: the key is passed to the gateway `byok` block * explicitly, so users can rename it freely. Non-alphanumerics fold to `_` * and a leading digit is prefixed, keeping `process.env.<name>` valid source. */ export declare function byokProviderEnvVar(modelId: string): string; /** * The files that define the agent itself, rendered for `model`. This is the * subset `eve init` writes when adding an agent to an existing project, where * everything outside `agent/` belongs to the host app. */ export declare function agentTemplateFiles(model: string): Record<string, string>; export declare function formatEveDependencySpecifier(versionOrSpecifier: string): string; /** Trailing fields only written when the scaffold is not a workspace member. */ export declare const ROOT_ONLY_PACKAGE_JSON_TEMPLATE_SUFFIX = ",\n \"engines\": {\n \"node\": \"__EVE_INIT_NODE_ENGINE__\"\n }\n"; export interface ScaffoldBaseProjectOptions { projectName: string; model: string; /** * The manager that owns command execution and manager-specific generated * project files for this scaffold. * Defaults to pnpm. */ packageManager?: PackageManagerKind; targetDirectory?: string; overwriteExisting?: boolean; onOverwriteFile?: (filePath: string) => void | Promise<void>; evePackage?: EvePackageContract; aiPackageVersion?: string; connectPackageVersion?: string; zodPackageVersion?: string; typescriptPackageVersion?: string; /** * Final project path used to discover ancestor workspaces. This differs from * the write target only when the CLI stages a scaffold before moving it into * place. */ workspaceProbeDirectory?: string; onWorkspaceRootMutation?: (mutation: WorkspaceRootMutation) => void | Promise<void>; /** * Scaffold an inline provider `byok` block in `agent.ts` that reads the * provider key from `process.env` instead of relying on the managed Vercel * AI Gateway. `process` is typed by the `@types/node` every scaffold ships. */ byokProvider?: boolean; } export declare function scaffoldBaseProject(options: ScaffoldBaseProjectOptions): Promise<string>; export declare function isEveProject(projectRoot: string): Promise<boolean>;