/** * plugin-host-ops — host-mutation helpers for the `plugin` command. * * The npm install/uninstall primitives and the Tool-plugin add/remove * wrappers that mutate a plugin host dir. Extracted from `plugin.ts` so the * command bodies (`pluginList`/`pluginAdd`/`pluginRemove`/`pluginSync`) stay * focused on argument validation and config wiring; this module owns the * side-effecting npm + host-dir mutation. */ import type { PluginResult } from '@opensip-cli/contracts'; export { editPluginList } from './plugin/config-edit.js'; /** Outcome of an npm install into a host dir: the resolved installed name, or an error message. */ export type InstallOutcome = { readonly ok: true; readonly installedName: string; } | { readonly ok: false; readonly error: string; }; /** * `npm install --ignore-scripts ` into a plugin host dir, then * resolve the real installed name and auto-install peers. Shared by the * fit/sim domain path and the Tool-plugin path. * * --ignore-scripts: plugins run via dynamic import() at tool time; they * don't legitimately need install-time code execution. Blocks supply-chain * attacks via postinstall hooks. npm's stdout is routed to stderr so JSON * renderers (which own process stdout) are not contaminated. */ export declare function npmInstallIntoHost(dir: string, packageName: string): InstallOutcome; /** * Install a Tool plugin into its host dir (user-global by default, * project-local with `--project`). No `plugins.` config entry — * Tool plugins auto-discover by their `kind: "tool"` marker. */ export declare function addToolPlugin(packageName: string, cwd: string, project: boolean): PluginResult; /** npm-uninstall a package from a host dir. Pure of config concerns. */ export declare function npmUninstallFromHost(dir: string, packageName: string): boolean; /** Remove a Tool plugin from its host dir (user-global by default, --project otherwise). */ export declare function removeToolPlugin(packageName: string, cwd: string, project: boolean): PluginResult; //# sourceMappingURL=plugin-host-ops.d.ts.map