/** * How this copy of the package got onto the machine, and therefore how it is * upgraded. * * ONE ANSWER PER INSTALL, DERIVED FROM OUR OWN PATH rather than from the * environment, because the environment belongs to whatever launched us. An MCP * server is started by a client, not by a shell, so `npm_config_global`, * `npm_lifecycle_event` and the rest are absent exactly when this question is * being asked. The directory the built module sits in, however, is always * present and is the thing npm actually placed. * * WHY THE METHOD AND NOT JUST A VERSION: `npm install -g` fixes a stale global * and does nothing for a stale copy inside a project's `node_modules`, and * neither touches a plugin install. Reporting "you are behind" without the * command that ends it leaves the reader to guess among three answers, two of * which silently do nothing. */ /** The ways this package is installed, and the only values `detect` returns. */ export declare enum InstallMethod { /** `npm install -g` -- one copy, on the PATH, shared by every client. */ GlobalNpm = "GlobalNpm", /** An `npx`/`npm exec` cache entry, which is replaced rather than upgraded. */ NpxCache = "NpxCache", /** A dependency of some project's `package.json`. */ ProjectDependency = "ProjectDependency", /** Installed as a Claude Code plugin, upgraded through the plugin surface. */ ClaudePlugin = "ClaudePlugin", /** A git checkout being built in place -- upgraded with `git pull`. */ SourceCheckout = "SourceCheckout", /** Somewhere none of the above describes. Reported, never guessed at. */ Unknown = "Unknown" } /** The npm name this package publishes under, used for the upgrade commands. */ export declare const PACKAGE_NAME = "@ooples/token-optimizer-mcp"; /** Which install this is. Never throws; `Unknown` is a real answer. */ export declare function detectInstallMethod(moduleUrl: string): InstallMethod; /** * What to run to stop being behind, or null when there is nothing to run. * * A NULL IS NOT A FAILURE. `SourceCheckout` and `Unknown` are installs this * package did not place and cannot speak for, and printing a plausible-looking * `npm install -g` for a git checkout would replace a developer's working tree * with a published copy. Saying nothing is the correct answer there. */ export declare function upgradeCommand(method: InstallMethod): string | null; /** * The methods `token-optimizer-update` will upgrade in place. * * Narrower than the set with an `upgradeCommand`, deliberately. `NpxCache` has * a command, but that command RUNS the package rather than upgrading anything, * so performing it would report success having changed nothing. `ClaudePlugin` * is the client's to upgrade, and `SourceCheckout` would have a developer's * working tree replaced by the published tarball. * * It lives here rather than beside `applyUpdate` because it is a property of * the install method, and both the applier and the diagnostic line that names * the command need it -- and `apply.ts` already imports `check.ts`, so a home * there would make that pair circular. */ export declare const UPGRADABLE_METHODS: readonly InstallMethod[]; /** How the method reads in a diagnostic line. */ export declare function describeInstallMethod(method: InstallMethod): string; //# sourceMappingURL=install-method.d.ts.map