clawmoney 0.15.19 → 0.15.20
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/dist/commands/relay-setup.js +14 -45
- package/package.json +1 -1
|
@@ -370,21 +370,10 @@ export async function relaySetupCommand() {
|
|
|
370
370
|
// separately as a daemon refactor task.
|
|
371
371
|
const uniqueClis = Array.from(new Set(selectedClis));
|
|
372
372
|
if (uniqueClis.length === 1) {
|
|
373
|
-
// Single cli_type —
|
|
373
|
+
// Single cli_type — go straight into the daemon. The user already
|
|
374
|
+
// confirmed "Register all N providers?" above, so asking a second
|
|
375
|
+
// time just adds friction.
|
|
374
376
|
const cli = uniqueClis[0];
|
|
375
|
-
const startNow = await confirm({
|
|
376
|
-
message: `Start the ${chalk.cyan(cli)} relay daemon now?`,
|
|
377
|
-
initialValue: true,
|
|
378
|
-
});
|
|
379
|
-
if (isCancel(startNow) || !startNow) {
|
|
380
|
-
log.message("");
|
|
381
|
-
log.message(chalk.dim("You can start it later with:"));
|
|
382
|
-
log.message(` ${chalk.cyan(`clawmoney relay start --cli ${cli}`)}`);
|
|
383
|
-
outro(chalk.green("Setup complete"));
|
|
384
|
-
return;
|
|
385
|
-
}
|
|
386
|
-
// Hand off to the existing relay start command. Importing lazily
|
|
387
|
-
// to keep the wizard's startup time down.
|
|
388
377
|
const { relayStartCommand } = await import("./relay.js");
|
|
389
378
|
try {
|
|
390
379
|
await relayStartCommand({ cli });
|
|
@@ -403,45 +392,25 @@ export async function relaySetupCommand() {
|
|
|
403
392
|
outro(chalk.green("Setup complete · daemon running"));
|
|
404
393
|
return;
|
|
405
394
|
}
|
|
406
|
-
// Multi cli_type — daemon can only host one at a time.
|
|
407
|
-
//
|
|
395
|
+
// Multi cli_type — daemon can only host one at a time today. Start
|
|
396
|
+
// the first registered cli_type directly and tell the user how to
|
|
397
|
+
// switch to the others later.
|
|
398
|
+
const firstCli = uniqueClis[0];
|
|
408
399
|
log.warn(`You registered providers across ${uniqueClis.length} CLI families ` +
|
|
409
|
-
`(${uniqueClis.join(", ")}). The daemon currently
|
|
410
|
-
`
|
|
411
|
-
const startChoice = await select({
|
|
412
|
-
message: "Which cli_type's daemon to start now?",
|
|
413
|
-
options: [
|
|
414
|
-
...uniqueClis.map((cli) => ({
|
|
415
|
-
value: cli,
|
|
416
|
-
label: `Start ${chalk.cyan(cli)} daemon`,
|
|
417
|
-
hint: undefined,
|
|
418
|
-
})),
|
|
419
|
-
{ value: "__none__", label: "Don't start anything yet (I'll start manually)", hint: undefined },
|
|
420
|
-
],
|
|
421
|
-
initialValue: uniqueClis[0],
|
|
422
|
-
});
|
|
423
|
-
if (isCancel(startChoice) || startChoice === "__none__") {
|
|
424
|
-
log.message("");
|
|
425
|
-
log.message(chalk.dim("Manual start commands:"));
|
|
426
|
-
for (const cli of uniqueClis) {
|
|
427
|
-
log.message(` ${chalk.cyan(`clawmoney relay start --cli ${cli}`)}`);
|
|
428
|
-
}
|
|
429
|
-
log.message(chalk.dim(" (only one can run at a time today — switch with `clawmoney relay stop` first)"));
|
|
430
|
-
outro(chalk.green("Setup complete"));
|
|
431
|
-
return;
|
|
432
|
-
}
|
|
400
|
+
`(${uniqueClis.join(", ")}). The daemon currently serves ONE cli_type ` +
|
|
401
|
+
`per process — starting ${chalk.cyan(firstCli)} first.`);
|
|
433
402
|
const { relayStartCommand } = await import("./relay.js");
|
|
434
403
|
try {
|
|
435
|
-
await relayStartCommand({ cli:
|
|
404
|
+
await relayStartCommand({ cli: firstCli });
|
|
436
405
|
}
|
|
437
406
|
catch (err) {
|
|
438
407
|
log.error(`Failed to start daemon: ${err.message}\n` +
|
|
439
|
-
`Try manually: ${chalk.cyan(`clawmoney relay start --cli ${
|
|
408
|
+
`Try manually: ${chalk.cyan(`clawmoney relay start --cli ${firstCli}`)}`);
|
|
440
409
|
outro(chalk.yellow("Setup complete (daemon not started)"));
|
|
441
410
|
return;
|
|
442
411
|
}
|
|
443
412
|
log.message("");
|
|
444
|
-
log.message(chalk.dim(
|
|
445
|
-
log.message(chalk.dim(` ${chalk.cyan("clawmoney relay stop")} && ${chalk.cyan(
|
|
446
|
-
outro(chalk.green(`Setup complete · ${
|
|
413
|
+
log.message(chalk.dim("To switch to a different cli_type later:"));
|
|
414
|
+
log.message(chalk.dim(` ${chalk.cyan("clawmoney relay stop")} && ${chalk.cyan("clawmoney relay start --cli <other-cli>")}`));
|
|
415
|
+
outro(chalk.green(`Setup complete · ${firstCli} daemon running`));
|
|
447
416
|
}
|