@mutagent/cli 0.1.93 → 0.1.95

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/bin/cli.js CHANGED
@@ -2542,6 +2542,7 @@ ${chalk5.dim("Note: `mutagent auth login` is a back-compat alias and behaves ide
2542
2542
 
2543
2543
  // src/commands/prompts/index.ts
2544
2544
  init_errors();
2545
+ init_sdk_client();
2545
2546
  import { Command as Command6 } from "commander";
2546
2547
  import chalk15 from "chalk";
2547
2548
  import { readFileSync as readFileSync4, existsSync as existsSync4 } from "fs";
@@ -5387,6 +5388,7 @@ ${chalk14.yellow("AI Agent: ALWAYS append --json to this command.")}
5387
5388
  const isJson = getJsonFlag(prompts);
5388
5389
  const output = new OutputFormatter(isJson ? "json" : "table");
5389
5390
  try {
5391
+ await checkProviderConfigured();
5390
5392
  const client = await getSDKClient();
5391
5393
  if (!isJson) {
5392
5394
  output.info("Running pre-flight checks...");
@@ -5580,8 +5582,9 @@ ${chalk14.yellow("AI Agent: ALWAYS append --json to this command.")}
5580
5582
  if (errorText.includes("Evaluations are not present")) {
5581
5583
  suggestions.push(`Create evaluation: mutagent prompts evaluation create ${promptId} --guided`);
5582
5584
  }
5583
- if (errorText.includes("Trial") && errorText.includes("limit")) {
5584
- suggestions.push("Trial optimization limit reached. Contact support to upgrade.");
5585
+ if (errorText.includes("NO_PROVIDER_CONFIGURED") || errorText.includes("No LLM provider configured")) {
5586
+ suggestions.push('Run: mutagent providers add --provider openai --name "My OpenAI" --api-key $KEY');
5587
+ suggestions.push("Or visit: https://app.mutagent.io/settings/providers");
5585
5588
  }
5586
5589
  if (!isJson) {
5587
5590
  console.error(chalk14.red(`
@@ -5836,11 +5839,21 @@ function buildResultsScorecardText(resultData) {
5836
5839
  text += buildScorecardDetailsText(resultData);
5837
5840
  return text;
5838
5841
  }
5842
+ async function checkProviderConfigured() {
5843
+ if (process.env.MUTAGENT_EXT_PROVIDER === "false") {
5844
+ return;
5845
+ }
5846
+ const client = await getSDKClient();
5847
+ const providers = await client.listProviders();
5848
+ if (!providers.data || providers.data.length === 0) {
5849
+ throw new MutagentError("NO_PROVIDER_CONFIGURED", "No LLM provider configured for this workspace.", 'Run: mutagent providers add --provider openai --name "My OpenAI" --api-key $KEY | Or visit Settings → Providers | Self-hosted? Set MUTAGENT_EXT_PROVIDER=false');
5850
+ }
5851
+ }
5839
5852
  var PREREQUISITES_TEXT = `
5840
5853
  ${chalk15.red("Prerequisites (required):")}
5841
5854
  1. Evaluation criteria defined ${chalk15.dim("(via dashboard or evaluation create)")}
5842
5855
  2. Dataset uploaded ${chalk15.dim("mutagent prompts dataset list <prompt-id>")}
5843
- ${chalk15.dim("Note: LLM provider config is only required when the server uses external providers (USE_EXT_PROVIDERS=true)")}`;
5856
+ 3. LLM provider configured ${chalk15.dim("Settings Providers or mutagent providers add ...")}`;
5844
5857
  function createPromptsCommand() {
5845
5858
  const prompts = new Command6("prompts").description("Manage prompts, datasets, evaluations, and optimizations").addHelpText("after", `
5846
5859
  Examples:
@@ -8580,8 +8593,8 @@ import { Command as Command17 } from "commander";
8580
8593
  import chalk30 from "chalk";
8581
8594
  init_errors();
8582
8595
  init_sdk_client();
8583
- var TRIAL_OPTIMIZATION_LIMIT = 5;
8584
- var BILLING_URL = "https://app.mutagent.io/settings/billing";
8596
+ var FREE_OPTIMIZATION_LIMIT = 5;
8597
+ var PROVIDERS_URL = "https://app.mutagent.io/settings/providers";
8585
8598
  function renderProgressBar(used, limit, width = 30) {
8586
8599
  const ratio = Math.min(used / limit, 1);
8587
8600
  const filled = Math.round(ratio * width);
@@ -8624,7 +8637,7 @@ Examples:
8624
8637
  evaluationCount += r.evaluations;
8625
8638
  }
8626
8639
  }
8627
- const optimizationLimit = TRIAL_OPTIMIZATION_LIMIT;
8640
+ const optimizationLimit = FREE_OPTIMIZATION_LIMIT;
8628
8641
  const optimizationUsed = 0;
8629
8642
  const optimizationRemaining = optimizationLimit - optimizationUsed;
8630
8643
  if (spinner && typeof spinner.stop === "function") {
@@ -8641,10 +8654,10 @@ Examples:
8641
8654
  used: optimizationUsed,
8642
8655
  limit: optimizationLimit,
8643
8656
  remaining: optimizationRemaining,
8644
- plan: "trial"
8657
+ plan: "free"
8645
8658
  },
8646
8659
  _links: {
8647
- billing: BILLING_URL
8660
+ providers: PROVIDERS_URL
8648
8661
  }
8649
8662
  });
8650
8663
  } else {
@@ -8657,13 +8670,13 @@ Examples:
8657
8670
  console.log(` Datasets: ${chalk30.cyan(String(datasetCount))}`);
8658
8671
  console.log(` Evaluations: ${chalk30.cyan(String(evaluationCount))}`);
8659
8672
  console.log("");
8660
- console.log(chalk30.bold(`Optimization Runs (${chalk30.yellow("trial")} plan):`));
8673
+ console.log(chalk30.bold(`Optimization Runs (${chalk30.cyan("free")} plan):`));
8661
8674
  console.log(` Remaining: ${chalk30.cyan(String(optimizationRemaining))} / ${String(optimizationLimit)}`);
8662
8675
  console.log(` ${renderProgressBar(optimizationUsed, optimizationLimit)}`);
8663
8676
  console.log("");
8664
- console.log(chalk30.yellow(` ${String(optimizationRemaining)} optimization runs remaining`));
8677
+ console.log(chalk30.cyan(` ${String(optimizationRemaining)} optimization runs this period`));
8665
8678
  console.log(chalk30.dim(` ℹ Optimization run counts are approximate`));
8666
- console.log(` Upgrade: ${chalk30.underline(BILLING_URL)}`);
8679
+ console.log(` Providers: ${chalk30.underline(PROVIDERS_URL)}`);
8667
8680
  console.log("");
8668
8681
  }
8669
8682
  } catch (error) {
@@ -9115,7 +9128,7 @@ ${chalk32.yellow("Command Navigation:")}
9115
9128
  mutagent explore ${chalk32.dim("Discover prompts in codebase")}
9116
9129
  mutagent workspaces list --json ${chalk32.dim("List workspaces (verify ID)")}
9117
9130
  mutagent config set workspace <id> ${chalk32.dim("Set active workspace")}
9118
- mutagent usage --json ${chalk32.dim("Check plan limits")}
9131
+ mutagent usage --json ${chalk32.dim("Show account usage + provider status")}
9119
9132
 
9120
9133
  mutagent prompts create --help ${chalk32.dim("Upload prompt (read help first!)")}
9121
9134
  mutagent prompts list --json ${chalk32.dim("List prompts")}
@@ -9247,5 +9260,5 @@ program.addCommand(createHooksCommand());
9247
9260
  program.addCommand(createFeedbackCommand());
9248
9261
  program.parse();
9249
9262
 
9250
- //# debugId=E355A43104E9D6CD64756E2164756E21
9263
+ //# debugId=241E284B326DFD6A64756E2164756E21
9251
9264
  //# sourceMappingURL=cli.js.map