crewswarm-cli 0.2.0 → 0.2.2
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/crew.mjs +47 -19
- package/dist/crew.mjs.map +3 -3
- package/package.json +1 -1
package/dist/crew.mjs
CHANGED
|
@@ -10442,6 +10442,7 @@ __export(dashboard_exports, {
|
|
|
10442
10442
|
renderStatusDashboard: () => renderStatusDashboard
|
|
10443
10443
|
});
|
|
10444
10444
|
import chalk2 from "chalk";
|
|
10445
|
+
import { homedir as homedir8 } from "os";
|
|
10445
10446
|
async function getSystemStatus() {
|
|
10446
10447
|
const status = {
|
|
10447
10448
|
online: false,
|
|
@@ -10453,20 +10454,43 @@ async function getSystemStatus() {
|
|
|
10453
10454
|
version: "0.1.0-alpha"
|
|
10454
10455
|
};
|
|
10455
10456
|
const providers = [];
|
|
10456
|
-
|
|
10457
|
-
|
|
10458
|
-
|
|
10459
|
-
|
|
10460
|
-
|
|
10461
|
-
|
|
10457
|
+
try {
|
|
10458
|
+
const { readFileSync: readFileSync8 } = await import("node:fs");
|
|
10459
|
+
const cfgPath = `${homedir8()}/.crewswarm/crewswarm.json`;
|
|
10460
|
+
const cfg = JSON.parse(readFileSync8(cfgPath, "utf8"));
|
|
10461
|
+
const providerEntries = cfg.providers || {};
|
|
10462
|
+
for (const [id, p] of Object.entries(providerEntries)) {
|
|
10463
|
+
if (p.apiKey && String(p.apiKey).trim()) {
|
|
10464
|
+
providers.push(id);
|
|
10465
|
+
}
|
|
10466
|
+
}
|
|
10467
|
+
} catch {
|
|
10468
|
+
}
|
|
10469
|
+
const envMap = {
|
|
10470
|
+
GEMINI_API_KEY: "google",
|
|
10471
|
+
GOOGLE_API_KEY: "google",
|
|
10472
|
+
GROQ_API_KEY: "groq",
|
|
10473
|
+
XAI_API_KEY: "xai",
|
|
10474
|
+
OPENAI_API_KEY: "openai",
|
|
10475
|
+
ANTHROPIC_API_KEY: "anthropic",
|
|
10476
|
+
DEEPSEEK_API_KEY: "deepseek",
|
|
10477
|
+
MISTRAL_API_KEY: "mistral",
|
|
10478
|
+
PERPLEXITY_API_KEY: "perplexity",
|
|
10479
|
+
TOGETHER_API_KEY: "together",
|
|
10480
|
+
FIREWORKS_API_KEY: "fireworks",
|
|
10481
|
+
HUGGINGFACE_API_KEY: "huggingface"
|
|
10482
|
+
};
|
|
10483
|
+
for (const [envKey, id] of Object.entries(envMap)) {
|
|
10484
|
+
if (process.env[envKey] && !providers.includes(id)) providers.push(id);
|
|
10485
|
+
}
|
|
10462
10486
|
status.models = providers;
|
|
10463
10487
|
status.online = providers.length > 0;
|
|
10464
10488
|
try {
|
|
10465
10489
|
let authToken = "";
|
|
10466
10490
|
try {
|
|
10467
10491
|
const { readFileSync: readFileSync8 } = await import("node:fs");
|
|
10468
|
-
const { homedir:
|
|
10469
|
-
const cfg = JSON.parse(readFileSync8(`${
|
|
10492
|
+
const { homedir: homedir12 } = await import("node:os");
|
|
10493
|
+
const cfg = JSON.parse(readFileSync8(`${homedir12()}/.crewswarm/config.json`, "utf8"));
|
|
10470
10494
|
authToken = cfg?.rt?.authToken || "";
|
|
10471
10495
|
} catch {
|
|
10472
10496
|
}
|
|
@@ -10494,7 +10518,7 @@ function renderStatusDashboard(status) {
|
|
|
10494
10518
|
const value = chalk2.white.bold;
|
|
10495
10519
|
const accent = chalk2.blue;
|
|
10496
10520
|
const providerCount = models.length;
|
|
10497
|
-
const maxProviders =
|
|
10521
|
+
const maxProviders = 24;
|
|
10498
10522
|
const filled = Math.min(10, Math.floor(providerCount / maxProviders * 10));
|
|
10499
10523
|
const empty = 10 - filled;
|
|
10500
10524
|
const progressBar = chalk2.green("\u2588".repeat(filled)) + chalk2.gray("\u2591".repeat(empty));
|
|
@@ -12094,7 +12118,7 @@ var Planner = class {
|
|
|
12094
12118
|
|
|
12095
12119
|
// src/cli/index.ts
|
|
12096
12120
|
import { existsSync as existsSync20 } from "node:fs";
|
|
12097
|
-
import { homedir as
|
|
12121
|
+
import { homedir as homedir11 } from "node:os";
|
|
12098
12122
|
|
|
12099
12123
|
// src/diagnostics/doctor.ts
|
|
12100
12124
|
import { access as access4 } from "node:fs/promises";
|
|
@@ -16259,7 +16283,7 @@ import { randomUUID as randomUUID9 } from "node:crypto";
|
|
|
16259
16283
|
import { existsSync as existsSync15, readFileSync as readFileSync6 } from "node:fs";
|
|
16260
16284
|
import { appendFile as appendFile5, mkdir as mkdir21, readFile as readFile27, readdir as readdir7, writeFile as writeFile21 } from "node:fs/promises";
|
|
16261
16285
|
import { join as join34 } from "node:path";
|
|
16262
|
-
import { homedir as
|
|
16286
|
+
import { homedir as homedir9 } from "node:os";
|
|
16263
16287
|
import chalk3 from "chalk";
|
|
16264
16288
|
init_agentkeeper();
|
|
16265
16289
|
|
|
@@ -16599,7 +16623,7 @@ function buildModelSummary(projectDir, state) {
|
|
|
16599
16623
|
})
|
|
16600
16624
|
)
|
|
16601
16625
|
);
|
|
16602
|
-
const swarmCfg = readJsonFile(join34(
|
|
16626
|
+
const swarmCfg = readJsonFile(join34(homedir9(), ".crewswarm", "crewswarm.json")) || {};
|
|
16603
16627
|
const agents = Array.isArray(swarmCfg?.agents) ? swarmCfg.agents : [];
|
|
16604
16628
|
const agentModels = Array.from(
|
|
16605
16629
|
new Set(
|
|
@@ -16887,7 +16911,9 @@ async function startRepl(options) {
|
|
|
16887
16911
|
let selectedMode = options.initialMode || repoConfig?.repl?.mode || "manual";
|
|
16888
16912
|
if (!options.initialMode && !repoConfig?.repl?.mode && process.stdin.isTTY) {
|
|
16889
16913
|
try {
|
|
16890
|
-
|
|
16914
|
+
console.log("");
|
|
16915
|
+
const inquirer = await getInquirer();
|
|
16916
|
+
const modeAnswer = await inquirer.prompt([
|
|
16891
16917
|
{
|
|
16892
16918
|
type: "list",
|
|
16893
16919
|
name: "mode",
|
|
@@ -16914,7 +16940,8 @@ async function startRepl(options) {
|
|
|
16914
16940
|
}
|
|
16915
16941
|
]);
|
|
16916
16942
|
selectedMode = modeAnswer.mode;
|
|
16917
|
-
} catch {
|
|
16943
|
+
} catch (err) {
|
|
16944
|
+
console.error("[repl] Mode picker failed, using manual:", err.message);
|
|
16918
16945
|
selectedMode = "manual";
|
|
16919
16946
|
}
|
|
16920
16947
|
}
|
|
@@ -16923,7 +16950,8 @@ async function startRepl(options) {
|
|
|
16923
16950
|
let selectedInterfaceMode = options.initialInterfaceMode || (envInterfaceMode === "connected" ? "connected" : envInterfaceMode === "standalone" ? "standalone" : repoDefaultInterface);
|
|
16924
16951
|
if (options.promptInterfaceMode && process.stdin.isTTY) {
|
|
16925
16952
|
try {
|
|
16926
|
-
const
|
|
16953
|
+
const inquirer2 = await getInquirer();
|
|
16954
|
+
const ifaceAnswer = await inquirer2.prompt([
|
|
16927
16955
|
{
|
|
16928
16956
|
type: "list",
|
|
16929
16957
|
name: "interfaceMode",
|
|
@@ -18584,11 +18612,11 @@ init_agentkeeper();
|
|
|
18584
18612
|
// src/xai/search.ts
|
|
18585
18613
|
import { existsSync as existsSync16, readFileSync as readFileSync7 } from "node:fs";
|
|
18586
18614
|
import { join as join35 } from "node:path";
|
|
18587
|
-
import { homedir as
|
|
18615
|
+
import { homedir as homedir10 } from "node:os";
|
|
18588
18616
|
function getXaiApiKey() {
|
|
18589
18617
|
if (process.env.XAI_API_KEY) return process.env.XAI_API_KEY;
|
|
18590
18618
|
if (process.env.GROK_API_KEY) return process.env.GROK_API_KEY;
|
|
18591
|
-
const cfgPath = join35(
|
|
18619
|
+
const cfgPath = join35(homedir10(), ".crewswarm", "crewswarm.json");
|
|
18592
18620
|
if (!existsSync16(cfgPath)) return null;
|
|
18593
18621
|
try {
|
|
18594
18622
|
const raw = readFileSync7(cfgPath, "utf8");
|
|
@@ -19592,7 +19620,7 @@ function detectCliAuthStatus() {
|
|
|
19592
19620
|
const text = (result2.output || "").toLowerCase();
|
|
19593
19621
|
return text.includes("logged in");
|
|
19594
19622
|
})() : false;
|
|
19595
|
-
const cursor = hasBinary("cursor") && existsSync20(join40(
|
|
19623
|
+
const cursor = hasBinary("cursor") && existsSync20(join40(homedir11(), ".cursor", "User", "globalStorage", "state.vscdb"));
|
|
19596
19624
|
return { claude, codex, cursor };
|
|
19597
19625
|
}
|
|
19598
19626
|
function detectSubscriptionEngines(tokens) {
|
|
@@ -19858,7 +19886,7 @@ async function main(args = []) {
|
|
|
19858
19886
|
normalizedArgs.splice(idx, 1);
|
|
19859
19887
|
args = normalizedArgs;
|
|
19860
19888
|
}
|
|
19861
|
-
const bannerFile = join40(process.env.HOME ||
|
|
19889
|
+
const bannerFile = join40(process.env.HOME || homedir11(), ".crew", "cli-banner-seen");
|
|
19862
19890
|
const showAlways = process.env.CREW_SHOW_BANNER === "1";
|
|
19863
19891
|
if (showAlways || !existsSync20(bannerFile)) {
|
|
19864
19892
|
const banner = `
|