swarm-code 0.1.10 → 0.1.11
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/interactive-swarm.js +20 -2
- package/package.json +1 -1
|
@@ -546,7 +546,12 @@ async function cmdConfigure(config, resolved, rl) {
|
|
|
546
546
|
out.write(` ${dim(symbols.horizontal.repeat(40))}\n\n`);
|
|
547
547
|
out.write(` ${dim("Current settings:")}\n`);
|
|
548
548
|
out.write(` ${cyan("1")} Agent ${bold(config.default_agent)}\n`);
|
|
549
|
-
|
|
549
|
+
const displayModel = resolved.provider === "ollama"
|
|
550
|
+
? `ollama/${resolved.model.id}`
|
|
551
|
+
: resolved.provider === "openrouter"
|
|
552
|
+
? `openrouter/${resolved.model.id}`
|
|
553
|
+
: resolved.model.id;
|
|
554
|
+
out.write(` ${cyan("2")} Model ${bold(displayModel)}${displayModel !== config.default_model ? dim(` (config: ${config.default_model})`) : ""}\n`);
|
|
550
555
|
out.write(` ${cyan("3")} Max threads ${bold(String(config.max_threads))}\n`);
|
|
551
556
|
out.write(` ${cyan("4")} Auto routing ${bold(config.auto_model_selection ? "on" : "off")}\n`);
|
|
552
557
|
out.write(` ${cyan("5")} Session budget ${bold(`$${config.max_session_budget_usd.toFixed(2)}`)}\n`);
|
|
@@ -574,8 +579,21 @@ async function cmdConfigure(config, resolved, rl) {
|
|
|
574
579
|
}
|
|
575
580
|
case "2": {
|
|
576
581
|
out.write(`\n ${dim("Enter model ID (e.g. ollama/deepseek-coder-v2, anthropic/claude-sonnet-4-6, openrouter/auto)")}\n`);
|
|
577
|
-
const val = await ask(` ${coral(symbols.arrow)} New model [${
|
|
582
|
+
const val = await ask(` ${coral(symbols.arrow)} New model [${displayModel}]: `);
|
|
578
583
|
if (val) {
|
|
584
|
+
// Check for OpenRouter API key
|
|
585
|
+
if (val.startsWith("openrouter/") && !process.env.OPENROUTER_API_KEY) {
|
|
586
|
+
out.write(`\n ${dim("OpenRouter requires an API key (https://openrouter.ai/keys)")}\n`);
|
|
587
|
+
const key = await ask(` ${coral(symbols.arrow)} OPENROUTER_API_KEY: `);
|
|
588
|
+
if (key) {
|
|
589
|
+
process.env.OPENROUTER_API_KEY = key;
|
|
590
|
+
logSuccess("OpenRouter API key set for this session");
|
|
591
|
+
}
|
|
592
|
+
else {
|
|
593
|
+
logWarn("No API key provided — cannot use OpenRouter");
|
|
594
|
+
break;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
579
597
|
const lookupId = val.startsWith("ollama/") || val.startsWith("openrouter/")
|
|
580
598
|
? val
|
|
581
599
|
: val.replace(/^(anthropic|openai|google)\//, "");
|
package/package.json
CHANGED