import type { DevCredential, EnvKeyProvider } from "../harnesses/inference/resolve.js"; import { type Output } from "./shared.js"; /** Which provider module the resolved credential will load at runtime. The Vendo Cloud gateway speaks the Anthropic-compatible /messages API through the host-installed @ai-sdk/anthropic (dev-creds/model.ts). */ export declare function providerModuleFor(credential: DevCredential): { module: string; spec: string; } | null; export interface InstallCommand { command: string; args: string[]; /** Where to run it. The app dir for pnpm/yarn/bun (they locate their own workspace root); the lockfile root for a nested npm-workspace app. */ cwd: string; } /** Lockfile-sniffed installer, resolved the way package managers resolve their own root: walk UP from the app dir to the NEAREST lockfile or workspace marker. A nested workspace app usually carries neither in its own dir — sniffing only there fell back to npm and the printed/run command would mint a conflicting package-lock.json inside the app. npm stays the no-evidence fallback. */ export declare function installCommandFor(root: string): Promise; /** The paste-ready zod bump for this host's package manager and workspace shape — shared by init's print path and doctor's E-DEP-003 story. */ export declare function zodBumpInvocation(root: string): Promise; /** The paste-ready ai@6 install, same shape — doctor's E-DEP-001 floor story names the host's own package manager, not a generic npm line. */ export declare function aiBumpInvocation(root: string): Promise; /** Test seam: resolves to the child's exit code (null on spawn error). */ export type InstallRunner = (command: string, args: string[], cwd: string) => Promise; /** What the last default-runner child printed to stderr (bounded tail, "" for a clean exit). The failure warnings carry it because an exit code alone left users hunting the reason in the wrong place (FINDINGS F2-win). */ export declare function installStderrTail(): string; /** The `--ignore-scripts` flag for the package managers that accept it, so Vendo's automatic dep repair never runs the host repo's lifecycle scripts. yarn is absent on purpose — berry rejects the flag (yarnpkg/berry#5540) and honors YARN_ENABLE_SCRIPTS on the child env instead. */ export declare const ignoreScriptsArgs: (command: string) => string[]; /** Package managers install as .cmd shims on Windows, so the spawn must go through the platform shell there — a shell-less spawn ENOENTs before the install starts. cmd.exe treats `^` (as in ai@^6) as an escape character OUTSIDE double quotes, so every arg is quoted; none of ours carry quotes of their own (specs, flags, relative paths). */ export declare const defaultRunner: InstallRunner; export interface EnsureProviderDepsOptions { root: string; credential: DevCredential; /** The provider init WROTE into the composition this run (scaffoldModel's answer), when it wrote one. */ wrote?: EnvKeyProvider; output: Output; run?: InstallRunner; } /** Installs `ai@^6` + every provider this host needs (see providerModulesFor) when it can't resolve them. Never fatal: a failed install degrades to the exact manual command (the same one doctor's E-DEP-001 story names). */ export declare function ensureProviderDeps(options: EnsureProviderDepsOptions): Promise; /** The package every scaffold imports, pinned to the CLI that wrote them — the same spec doctor's E-DEP-002 story names, so the repair can never mint the split-brain install that check warns about. */ export declare const VENDO_PACKAGE_SPEC = "@vendoai/vendo@0.62.1"; /** The paste-ready `@vendoai/vendo` install for this host's package manager and workspace shape — shared by init's failed-repair warning and doctor's E-WIRE-011 story. */ export declare function vendoPackageInvocation(root: string): Promise; /** * #1153: every scaffold imports `@vendoai/vendo/*`, but a host whose only * direct dependency is the `vendoai` alias keeps that package inside the * alias's OWN nested resolution. Under pnpm's strict node_modules host source * may only resolve its direct dependencies, so the wired route never compiles * ("Module not found: Can't resolve '@vendoai/vendo/server'") and every route * 500s — a failure the live probes can only report as an unreachable server. * Init wrote those imports, so init makes them resolvable, exactly as it does * for the provider the first turn loads. * * Resolvability is the evidence, never package.json: a hoisting installer * (npm, yarn) already satisfies the import through the alias's own dependency, * and a host that has installed nothing yet is not this repair's business — * its own install is the next thing to run. */ export declare function ensureVendoPackage(options: { root: string; output: Output; run?: InstallRunner; }): Promise; /** * Every package the files this run GENERATED import, declared in the host's * package.json — installing whatever is missing. * * Init authored those imports, so init owns their resolvability, exactly as it * does for the model provider the first turn loads. `ensureVendoPackage` above * covers only the alias case (`vendoai` declared, `@vendoai/vendo` nested), and * it asks node_modules; this asks the MANIFEST, which is the half that bit the * backend path — the docs there never install `@vendoai/vendo` at all, so a host * following them got a generated `lib/vendo.ts` importing a package it does not * depend on, and the build could not resolve it. * * The `vendoai` alias satisfies `@vendoai/vendo` here: a host that declared the * alias has made its choice, and the nested-resolution half is * `ensureVendoPackage`'s call to make. A host that has installed NOTHING yet is * skipped for the same reason `ensureVendoPackage` skips it (hasInstalledTree). * A failure degrades to the exact manual command, like every other repair here. */ export declare function ensureGeneratedImports(options: { root: string; /** The source of every file this run created (generated code only — a file init did not author says nothing about what init owes). */ sources: readonly string[]; output: Output; run?: InstallRunner; }): Promise; /** True when an installed ai predates the v6 peer contract (FINDINGS F3). v7 is inside the contract and never below it; the majors above the pair are E-DEP-001's ceiling story, and an unparseable version is not evidence of an old ai — only a plain pre-6 major is below the floor. */ export declare function aiBelowPeerFloor(version: string): boolean; /** The bump that satisfies the AI SDK's zod floor while keeping zod 3 semantics — ai@6 imports the `zod/v3` + `zod/v4` subpaths that arrive in zod 3.25, and ^3.25.0 still satisfies the common `^3.2x` host ranges. */ export declare const ZOD_FLOOR_SPEC = "zod@^3.25.0"; /** True when an installed zod predates the AI SDK's subpath imports (FINDINGS F2). zod 4 exposes them too, so only pre-3.25 threes (and anything older) are below the floor. */ export declare function zodBelowAiSdkFloor(version: string): boolean; export interface EnsureZodFloorOptions { root: string; output: Output; /** Interactive consent (init's confirm shape). Absent without `yes`, the bump is never performed — the exact command is printed instead. */ confirm?: (question: string, defaultYes: boolean) => Promise; /** --yes: perform the bump without the ask. */ yes?: boolean; run?: InstallRunner; } /** * FINDINGS F2 (skateshop): installing Vendo onto a host pinning zod < 3.25 * turns a green build red — ai@6 imports the `zod/v3` + `zod/v4` subpaths * that arrive in 3.25, and the host's own older pin wins the installed tree * no matter what the vendo packages declare. Init is where the host's deps * are already being managed, so the floor is surfaced (and, with consent, * fixed) here. Never a silent mutation: interactive runs ask, --yes performs * the announced bump, and a non-interactive run without --yes only prints * the exact command (the same story doctor's E-DEP-003 tells). */ export declare function ensureZodFloor(options: EnsureZodFloorOptions): Promise;