/** * @fileoverview Plugin host directory + installed-package introspection. * * Each plugin domain owns a `node_modules` tree under * `/opensip-cli/.runtime/plugins//`. This module * creates the host package.json, peeks at installed packages to * resolve real package names (for local-path specs that don't carry a * name), and walks peerDependencies for auto-install. * * Extracted from `commands/plugin.ts` so the install/uninstall flows * there stay focused on Commander + npm orchestration. */ /** Filename of the host package.json that pins plugin installs. */ export declare const HOST_PACKAGE_JSON = "package.json"; /** * Guard against argv-injection through npm. execFileSync doesn't spawn * a shell, so shell metacharacters are safe, but any arg starting with * '-' would be consumed by npm as a flag (e.g. '-g', '--prefix=/etc'). */ export declare function isSafeNpmSpec(spec: string): boolean; /** Create (if absent) a plugin host dir + its host package.json; returns `dir`. */ export declare function ensureHostDir(dir: string, domain: string): string; /** Project-local plugin host dir: `/opensip-cli/.runtime/plugins/`. */ export declare function ensurePluginHostDir(domain: string, cwd: string): string; /** * User-global plugin host dir: `~/.opensip-cli/plugins/`. Used by * the `tool` domain so a `plugin add ` makes the subcommand available * across every project (the cross-project analogue of `npm i -g`). */ export declare function ensureUserPluginHostDir(domain: string): string; /** * After installing a plugin, look at its peerDependencies and install any that * Node cannot already resolve from the plugin host. This follows ordinary peer * dependency semantics: a project dependency in an ancestor `node_modules` * satisfies the plugin without downloading a second copy into the private host. * Best-effort: missing peers produce no error here; the loader surfaces a clear * error if the plugin still cannot resolve its imports. */ export declare function installMissingPeers(dir: string, requestedSpec: string, depsBefore: Set): void; export declare function findInstalledName(dir: string, requestedSpec: string, depsBefore: Set): string | undefined; export declare function readHostDependencies(dir: string): Set; //# sourceMappingURL=host-dir.d.ts.map