crewswarm-cli 0.2.1 → 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 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
- if (process.env.GEMINI_API_KEY || process.env.GOOGLE_API_KEY) providers.push("Gemini");
10457
- if (process.env.GROQ_API_KEY) providers.push("Groq");
10458
- if (process.env.XAI_API_KEY) providers.push("Grok");
10459
- if (process.env.OPENAI_API_KEY) providers.push("OpenAI");
10460
- if (process.env.ANTHROPIC_API_KEY) providers.push("Anthropic");
10461
- if (process.env.DEEPSEEK_API_KEY) providers.push("DeepSeek");
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: homedir11 } = await import("node:os");
10469
- const cfg = JSON.parse(readFileSync8(`${homedir11()}/.crewswarm/config.json`, "utf8"));
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 = 6;
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 homedir10 } from "node:os";
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 homedir8 } from "node:os";
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(homedir8(), ".crewswarm", "crewswarm.json")) || {};
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(
@@ -18588,11 +18612,11 @@ init_agentkeeper();
18588
18612
  // src/xai/search.ts
18589
18613
  import { existsSync as existsSync16, readFileSync as readFileSync7 } from "node:fs";
18590
18614
  import { join as join35 } from "node:path";
18591
- import { homedir as homedir9 } from "node:os";
18615
+ import { homedir as homedir10 } from "node:os";
18592
18616
  function getXaiApiKey() {
18593
18617
  if (process.env.XAI_API_KEY) return process.env.XAI_API_KEY;
18594
18618
  if (process.env.GROK_API_KEY) return process.env.GROK_API_KEY;
18595
- const cfgPath = join35(homedir9(), ".crewswarm", "crewswarm.json");
18619
+ const cfgPath = join35(homedir10(), ".crewswarm", "crewswarm.json");
18596
18620
  if (!existsSync16(cfgPath)) return null;
18597
18621
  try {
18598
18622
  const raw = readFileSync7(cfgPath, "utf8");
@@ -19596,7 +19620,7 @@ function detectCliAuthStatus() {
19596
19620
  const text = (result2.output || "").toLowerCase();
19597
19621
  return text.includes("logged in");
19598
19622
  })() : false;
19599
- const cursor = hasBinary("cursor") && existsSync20(join40(homedir10(), ".cursor", "User", "globalStorage", "state.vscdb"));
19623
+ const cursor = hasBinary("cursor") && existsSync20(join40(homedir11(), ".cursor", "User", "globalStorage", "state.vscdb"));
19600
19624
  return { claude, codex, cursor };
19601
19625
  }
19602
19626
  function detectSubscriptionEngines(tokens) {
@@ -19862,7 +19886,7 @@ async function main(args = []) {
19862
19886
  normalizedArgs.splice(idx, 1);
19863
19887
  args = normalizedArgs;
19864
19888
  }
19865
- const bannerFile = join40(process.env.HOME || homedir10(), ".crew", "cli-banner-seen");
19889
+ const bannerFile = join40(process.env.HOME || homedir11(), ".crew", "cli-banner-seen");
19866
19890
  const showAlways = process.env.CREW_SHOW_BANNER === "1";
19867
19891
  if (showAlways || !existsSync20(bannerFile)) {
19868
19892
  const banner = `