import { Stack, CrumbtrailConfig } from 'crumbtrail-core'; import { AutoCaptureOptions, CrumbtrailExpressOptions } from 'crumbtrail-node'; import { F as FileReader } from './types-Oq-S4_9j.cjs'; type PackageManager = "pnpm" | "yarn" | "bun" | "npm"; /** How the manager was decided — surfaced so the CLI can explain the choice. */ type PackageManagerSource = /** `packageManager` field in the workspace root's package.json (corepack). */ "package-manager-field" /** `pnpm-workspace.yaml` at the workspace root. */ | "workspace-file" /** A lockfile. */ | "lockfile" /** Nothing found anywhere; the caller defaults to npm. */ | "none"; interface PackageManagerResolution { /** null when no evidence was found at all — callers default to npm. */ manager: PackageManager | null; source: PackageManagerSource; /** Directory the decision was made from, when there was any evidence. */ decidedIn: string | null; /** Absolute path to the nearest declared workspace root, when there is one. */ workspaceRoot: string | null; /** * Lockfiles found strictly below `workspaceRoot` that were deliberately * ignored. Each entry is an absolute path. A non-empty list means the repo * disagrees with itself and the user should be told which file was ignored. */ ignoredNestedLockfiles: string[]; } /** Match a workspace member path against positive and negative patterns. */ declare function workspacePatternsMatch(patterns: readonly string[], relPath: string): boolean; /** * Extract the `packages:` list from a pnpm-workspace.yaml without a YAML dep. * * Canonical home: detect.ts re-exports this rather than keeping a second copy, * because membership and workspace expansion must read the same list or they * disagree about which packages the root owns. */ declare function parsePnpmWorkspace(text: string): string[]; /** * Resolve the one package manager every install in this run must use. * * Climbs from `startDir` to the nearest declared workspace root and decides * there. With no workspace root anywhere, falls back to the nearest directory * with any evidence, which is the right answer for a standalone app. */ declare function resolveWorkspacePackageManager(startDir: string, reader: FileReader): PackageManagerResolution; /** Injection recipes, ordered most-specific-first during detection. */ type Recipe = "tauri" | "next" | "sveltekit" | "nuxt" | "remix" | "astro" | "angular" | "vite-spa" | "cra" | "capacitor" | "flutter" | "aws-lambda" | "vercel-functions" | "vercel-edge-functions" | "vercel-functions-ambiguous" | "netlify-functions" | "netlify-edge-functions" | "netlify-functions-ambiguous" | "cloudflare-workers" | "deno-deploy" | "nestjs" | "express" | "hono" | "fastify" | "react-native" | "node" | "static" | "otlp"; interface WorkspacePackage { /** package.json `name`, falling back to the directory basename. */ name: string; /** Absolute path to the workspace package directory. */ dir: string; } interface DetectResult { cwd: string; packageJsonPath: string | null; /** Winning recipe, or null when nothing matched. */ recipe: Recipe | null; packageManager: PackageManager | null; /** * The full workspace-scoped decision behind `packageManager`: where it was * decided, what decided it, and any lockfile inside a workspace member that * was deliberately ignored. Optional only so hand-built fixtures stay valid; * `detect()` always sets it. */ packageManagerInfo?: PackageManagerResolution; /** * Absolute path to the file the recipe would edit (vite-spa / node), when it * could be resolved with confidence. null for create-a-new-file recipes and * whenever resolution was ambiguous. */ entryFile: string | null; /** Raw `next` version range from package.json, when the recipe is `next`. */ nextVersion: string | null; /** * The non-JS backend Stack resolved from filesystem markers when `recipe` is * `"otlp"` (django/flask/fastapi/go/rails/dotnet). null for every other recipe. * This is the ONE recipe that carries a variable Stack; call sites must prefer * it over the static `RECIPE_REGISTRY["otlp"].stack` placeholder. */ otlpStack: Stack | null; isMonorepo: boolean; /** Workspace packages when `isMonorepo` — the caller picks which app to wire. */ workspaces: WorkspacePackage[]; /** * True when the caller must resolve a choice before injecting: monorepo root, * no recipe matched, or the recipe's entry file could not be resolved. */ ambiguous: boolean; /** Human-readable trail of why detection landed where it did. */ reasons: string[]; /** * Non-blocking, informational messages about the project that do NOT affect * `recipe`/`ambiguous`/`isMonorepo`/`entryFile` — e.g. a "Docker files found, * infra evidence sources coming soon" note. Kept separate from `reasons` (the * detection trail); the caller surfaces these on both success and no-recipe * paths without changing any outcome. */ notes: string[]; } interface PackageJson { name?: string; main?: string; module?: string; bin?: string | Record; scripts?: Record; dependencies?: Record; devDependencies?: Record; workspaces?: string[] | { packages?: string[]; }; } /** * The package manager every install in this run must use. * * Resolved from the WORKSPACE, not from `startDir` — see * `install/workspace-package-manager.ts` for why a per-directory answer split * one wizard run across two package managers and damaged the repo. */ declare function detectPackageManager(startDir: string, reader?: FileReader): PackageManager | null; /** Resolve the Vite entry from index.html's `