Lines 32-126javascript
32 var ownKeys = function(o) {
33 ownKeys = Object.getOwnPropertyNames || function (o) {
35 for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
40 return function (mod) {
41 if (mod && mod.__esModule) return mod;
43 if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
44 __setModuleDefault(result, mod);
48Object.defineProperty(exports, "__esModule", { value: true });
49exports.runInstaller = runInstaller;
50exports.runInstallerWithOptions = runInstallerWithOptions;
51exports.uninstallTargets = uninstallTargets;
52exports.runUninstaller = runUninstaller;
53const child_process_1 = require("child_process");
54const path = __importStar(require("path"));
HighChild Process
Package source references child process execution.
dist/installer/index.jsView on unpkg · L52 55const fs = __importStar(require("fs"));
56const os = __importStar(require("os"));
57const registry_1 = require("./targets/registry");
58// Dynamic import helper — tsc compiles import() to require() in CJS mode,
59// which fails for ESM-only packages. This bypasses the transformation.
60// eslint-disable-next-line @typescript-eslint/no-implied-eval
61const importESM = new Function('specifier', 'return import(specifier)');
62function getVersion() {
LowEval
Package source references a known benign dynamic code generation pattern.
dist/installer/index.jsView on unpkg · L60 64 const packageJsonPath = path.join(__dirname, '..', '..', 'package.json');
65 const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
66 return packageJson.version;
73 * Interactive entry point — preserves the existing UX (`cssgraph
74 * install` with no args goes through the prompts), but now starts
75 * the targets multi-select pre-populated with detected agents.
77async function runInstaller() {
78 return runInstallerWithOptions({});
80async function runInstallerWithOptions(opts) {
86 // they're committing to before we touch npm or disk.
87 const detectionLocation = opts.location ?? 'global';
88 const targets = await resolveTargets(clack, opts, detectionLocation, useDefaults);
89 if (targets.length === 0) {
90 clack.outro('No agent targets selected — nothing to do.');
93 // Step 2: install the cssgraph npm package on PATH. Skipped when --yes.
95 const shouldInstallGlobally = await clack.confirm({
96 message: 'Install the cssgraph CLI on your PATH? (Required so agents can launch the MCP server)',
99 if (clack.isCancel(shouldInstallGlobally)) {
100 clack.cancel('Installation cancelled.');
103 if (shouldInstallGlobally) {
104 const s = clack.spinner();
105 s.start('Installing cssgraph CLI...');
107 (0, child_process_1.execSync)('npm install -g cssgraph', { stdio: 'pipe', windowsHide: true });
108 s.stop('Installed cssgraph CLI on PATH');
HighRuntime Package Install
Package source invokes a package manager install command at runtime.
dist/installer/index.jsView on unpkg · L106 111 s.stop('Could not install (permission denied)');
112 clack.log.warn('Try: sudo npm install -g cssgraph');
116 clack.log.info('Skipped CLI install — agents will not be able to launch the MCP server without it');
119 // Step 3: where the per-agent config files should land.
122 location = opts.location;
124 else if (useDefaults) {