import type { DependencyInstallError, DependencyUpgradeError } from "@superblocksteam/library-shared/types"; import { type NpmInstallBlocked, type ParseContext } from "@superblocksteam/vite-plugin-file-sync/npm-registry"; /** Marker thrown by the INITIAL verification install so the dev.mts catch can * degrade by ORIGIN (never on classifiability). Carries the classified error. */ export declare class InitialInstallFailed extends Error { readonly serverError: DependencyInstallError; constructor(serverError: DependencyInstallError); } /** Marker thrown by the best-effort CLI/library auto-upgrade so the dev.mts * catch can DEGRADE (keep serving the current version) instead of crash-looping * the pod. Carries the classified, non-blocking upgrade error. */ export declare class UpgradeFailed extends Error { readonly serverError: DependencyUpgradeError; constructor(serverError: DependencyUpgradeError); } interface ExecFailure { stdout?: string; stderr?: string; message?: string; code?: number | string; } /** Map a gate/registry `NpmInstallBlocked` into the startup degrade marker. */ export declare function initialInstallFailedFromBlocked(blocked: NpmInstallBlocked): InitialInstallFailed; /** * Keep a captured stream inside a size budget without dropping the diagnosis. * * Trimming one end loses it, whichever end you pick. pnpm names the error near * the top and then lists every package it wanted, so cutting the tail is safe * but cutting the head is not; npm buries the error after thousands of `npm * timing` lines, so it is the other way round. Keep both ends and say how much * went missing in between. */ export declare function boundCapturedOutput(text: string): string; /** Always returns a DependencyInstallError (never null). */ export declare function classifyInitialInstallError(failure: ExecFailure, ctx: ParseContext): DependencyInstallError; /** * Classify a failed CLI/library auto-upgrade exec into a non-blocking * `DependencyUpgradeError`. Always returns an error (never null) — every * upgrade failure degrades, because the pod keeps running the current version. * * Mirrors `classifyInitialInstallError` but maps to the upgrade error's * narrower category set: registry/network reasons keep their classification; * everything else (no install command, post-install version mismatch, * unclassified exec error) folds to `unknown`. We deliberately do NOT surface * `dependency_conflict` / `disk_full` here — a global `-g` CLI install does not * resolve the app's dependency tree, and the remediation is uniform (an org * admin makes the target version installable), so finer buckets would not * change the user-facing guidance. */ export declare function classifyUpgradeError(failure: ExecFailure, ctx: ParseContext, versions?: { currentVersion?: string; targetVersion?: string; }): DependencyUpgradeError; export {}; //# sourceMappingURL=dependency-install-classifier.d.mts.map