/** * `openlore update` — upgrade openlore to the latest published version * (change: add-zero-interaction-onboarding). * * The explicit companion to the passive update notifier. It detects HOW openlore * was installed (Homebrew / global npm / npx) and runs the correct upgrade, or * with --check just reports whether a newer version exists. Deterministic, no * LLM. The only network call is the npm dist-tag lookup (shared with the * notifier), and it fails soft. */ import { Command } from 'commander'; export type InstallMethod = 'homebrew' | 'npm-global' | 'npm-local' | 'npx' | 'unknown'; /** * Deterministic local evidence used to tell a global npm install apart from a * project-local one — the one distinction the module path alone cannot make * (a Windows global prefix and a project's `node_modules/openlore/` are * path-shaped alike). Every field is gathered from a local command or file read; * absent fields mean "no evidence", never "false". */ export interface InstallEvidence { /** Global `node_modules` root(s) from `npm root -g` (normalized). */ npmGlobalRoots?: string[]; /** True iff the project enclosing this install declares an `openlore` dependency. */ declaredAsProjectDependency?: boolean; } /** * Infer how the running openlore was installed from the executing module path * plus deterministic local evidence. Pure function of its inputs so it is * unit-testable; the impure evidence gathering lives in `gatherInstallEvidence`. * * Global-vs-local is decided by evidence, not a substring guess: a path under a * proven `npm root -g` (or a POSIX `lib/node_modules` global prefix) is global; a * `node_modules/openlore/` whose enclosing project declares the dependency is * local. Contradictory or absent evidence yields `'unknown'` — the command then * defers to the human rather than mutating the wrong install. */ export declare function detectInstallMethod(modulePath: string, evidence?: InstallEvidence): InstallMethod; /** * Gather the deterministic local evidence `detectInstallMethod` needs. Impure * (one local subprocess + one file read), fail-soft, no network. */ export declare function gatherInstallEvidence(modulePath: string): Promise; /** * The shell command that upgrades each install method (null = nothing to run). * `npm-local` returns the per-project command, but `runUpdate` only PRINTS it — * a local dependency is never mutated for the user. */ export declare function upgradeCommandFor(method: InstallMethod): { cmd: string; args: string[]; } | null; interface UpdateOpts { check?: boolean; dryRun?: boolean; } export declare function runUpdate(opts: UpdateOpts): Promise; export declare const updateCommand: Command; export {}; //# sourceMappingURL=update.d.ts.map