/** * PATH augmentation for processes spectral spawns. * * Why this exists: * A GUI-launched host (Dock, Spotlight, launchd, a `.app` bundle) inherits a * minimal `PATH` — usually just `/usr/bin:/bin:/usr/sbin:/sbin`. MCP servers * declared as `npx -y ` (and every other `npm`/`node`/`git` child * process) then die with `Executable not found in $PATH: "npx"`. The Electron * desktop app solved this by augmenting the PATH of the `spectral serve` * child it spawned. That app is gone; the same logic now lives here so the * `spectral desktop` wrapper, `spectral serve` itself, and the MCP stdio * transports all get a usable PATH regardless of how spectral was launched. * * Sources merged, in priority order (first occurrence wins — shell lookup is * left-to-right): * 1. the current process PATH, * 2. macOS `/etc/paths` + `/etc/paths.d/*` (what `path_helper` uses), * 3. `getconf PATH` (the platform default), * 4. well-known Node/npm/Homebrew/Git install directories, * 5. the newest nvm-managed Node `bin` directory. * * Ported from `electron/path-resolver.ts` when the Electron app was removed, so * behaviour is unchanged for existing users. */ /** * Returns the case-correct name of the PATH environment variable on this * platform. Windows allows "Path", Unix is usually "PATH". */ export declare function getPathEnvKey(env?: NodeJS.ProcessEnv): string; /** Test-only hook: forget the cached /etc/paths + getconf + nvm lookup. */ export declare function _resetAugmentPathCacheForTests(): void; /** * Build an augmented PATH string. * * @param base PATH to start from. Defaults to the current process PATH, so * callers holding a custom env (e.g. the MCP stdio transport env) can * augment that instead. */ export declare function augmentPath(base?: string): string; /** * Return a single-entry env patch — `{ PATH: }` under the * case-correct key — ready to spread into a spawn `env`. */ export declare function augmentedPathEnvPatch(base?: string, env?: NodeJS.ProcessEnv): Record; /** * Augment `env`'s PATH in place and return it. Used at daemon start so every * descendant (bash tool, dev-process registry, MCP transports, git) inherits a * PATH that can actually find `node`/`npx`/`git`. */ export declare function applyAugmentedPath(env?: NodeJS.ProcessEnv): NodeJS.ProcessEnv; //# sourceMappingURL=augment-path.d.ts.map