symforge 1.5.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/install.js +44 -24
package/package.json
CHANGED
package/scripts/install.js
CHANGED
|
@@ -259,10 +259,14 @@ function createInstaller(overrides = {}) {
|
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
/**
|
|
262
|
-
* Detect which CLI agents are installed and
|
|
263
|
-
*
|
|
262
|
+
* Detect which home-scoped CLI agents are installed and can be safely
|
|
263
|
+
* initialized from a global npm postinstall context.
|
|
264
|
+
*
|
|
265
|
+
* Workspace-local clients such as Kilo Code are intentionally excluded here:
|
|
266
|
+
* global npm installs run from the package directory, not from a user
|
|
267
|
+
* workspace, so emitting `.kilocode/*` there would be wrong.
|
|
264
268
|
*/
|
|
265
|
-
function
|
|
269
|
+
function detectHomeScopedClients() {
|
|
266
270
|
const clients = [];
|
|
267
271
|
|
|
268
272
|
// Claude Code: check for ~/.claude directory
|
|
@@ -283,11 +287,7 @@ function createInstaller(overrides = {}) {
|
|
|
283
287
|
clients.push("gemini");
|
|
284
288
|
}
|
|
285
289
|
|
|
286
|
-
|
|
287
|
-
if (clients.length === 0 || clients.length >= 2) {
|
|
288
|
-
return "all";
|
|
289
|
-
}
|
|
290
|
-
return clients[0];
|
|
290
|
+
return clients;
|
|
291
291
|
}
|
|
292
292
|
|
|
293
293
|
/**
|
|
@@ -295,24 +295,44 @@ function createInstaller(overrides = {}) {
|
|
|
295
295
|
* hooks and MCP server registration for detected CLI agents.
|
|
296
296
|
*/
|
|
297
297
|
function runAutoInit(binPath) {
|
|
298
|
-
const
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
const output = execFileSyncFn(binPath, ["init", "--client", client], {
|
|
302
|
-
encoding: "utf8",
|
|
303
|
-
timeout: 15000,
|
|
304
|
-
env: processMod.env,
|
|
305
|
-
});
|
|
306
|
-
if (output) {
|
|
307
|
-
for (const line of output.trim().split(/\r?\n/)) {
|
|
308
|
-
consoleMod.log(line);
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
} catch (error) {
|
|
298
|
+
const clients = detectHomeScopedClients();
|
|
299
|
+
const initCwd = osMod.homedir();
|
|
300
|
+
if (clients.length === 0) {
|
|
312
301
|
consoleMod.log(
|
|
313
|
-
|
|
302
|
+
"Auto-configuring skipped: no home-scoped clients detected. " +
|
|
303
|
+
"Run `symforge init --client <client>` manually if needed."
|
|
314
304
|
);
|
|
305
|
+
consoleMod.log(
|
|
306
|
+
"Kilo Code is workspace-local; run `symforge init --client kilo-code` from your project directory."
|
|
307
|
+
);
|
|
308
|
+
return;
|
|
315
309
|
}
|
|
310
|
+
|
|
311
|
+
consoleMod.log(`Auto-configuring for detected client(s): ${clients.join(", ")}`);
|
|
312
|
+
for (const client of clients) {
|
|
313
|
+
try {
|
|
314
|
+
const output = execFileSyncFn(binPath, ["init", "--client", client], {
|
|
315
|
+
encoding: "utf8",
|
|
316
|
+
timeout: 15000,
|
|
317
|
+
env: processMod.env,
|
|
318
|
+
cwd: initCwd,
|
|
319
|
+
});
|
|
320
|
+
if (output) {
|
|
321
|
+
for (const line of output.trim().split(/\r?\n/)) {
|
|
322
|
+
consoleMod.log(line);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
} catch (error) {
|
|
326
|
+
consoleMod.log(
|
|
327
|
+
`Auto-init warning for ${client}: ${error.message}\n` +
|
|
328
|
+
"You can run manually: symforge init --client " +
|
|
329
|
+
client
|
|
330
|
+
);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
consoleMod.log(
|
|
334
|
+
"Kilo Code is workspace-local; run `symforge init --client kilo-code` from your project directory."
|
|
335
|
+
);
|
|
316
336
|
}
|
|
317
337
|
|
|
318
338
|
async function main() {
|
|
@@ -401,7 +421,7 @@ function createInstaller(overrides = {}) {
|
|
|
401
421
|
main,
|
|
402
422
|
stopAllRunningProcesses,
|
|
403
423
|
stopRunningWindowsProcesses,
|
|
404
|
-
|
|
424
|
+
detectHomeScopedClients,
|
|
405
425
|
runAutoInit,
|
|
406
426
|
};
|
|
407
427
|
}
|