@mutagent/cli 0.1.96 → 0.1.98

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
@@ -743,6 +743,32 @@ class SDKClientWrapper {
743
743
  this.handleError(error);
744
744
  }
745
745
  }
746
+ async listOptimizations() {
747
+ try {
748
+ const response = await this.request("/api/optimizations");
749
+ if (Array.isArray(response))
750
+ return response;
751
+ const r = response;
752
+ if (Array.isArray(r.data))
753
+ return r.data;
754
+ return [];
755
+ } catch (error) {
756
+ this.handleError(error);
757
+ }
758
+ }
759
+ async listExperiments() {
760
+ try {
761
+ const response = await this.request("/api/experiments");
762
+ if (Array.isArray(response))
763
+ return response;
764
+ const r = response;
765
+ if (Array.isArray(r.data))
766
+ return r.data;
767
+ return [];
768
+ } catch (error) {
769
+ this.handleError(error);
770
+ }
771
+ }
746
772
  async startOptimization(promptId, datasetId, evaluationId, config) {
747
773
  try {
748
774
  return await this.request(`/api/prompt/${promptId}/optimize`, {
@@ -8488,7 +8514,7 @@ After \`mutagent auth login\`, the user lands in one of 3 paths:
8488
8514
  3. \`mutagent prompts create --data '{...}'\` — Upload with REQUIRED outputSchema
8489
8515
  4. Guided eval creator OR \`mutagent prompts evaluation create\`
8490
8516
  5. \`mutagent prompts dataset add\` — Upload/curate datasets (named)
8491
- 6. \`mutagent usage --json\` — Verify remaining optimization runs
8517
+ 6. \`mutagent usage --json\` — View resource counts
8492
8518
  7. \`mutagent prompts optimize start\` — Run optimization
8493
8519
  8. Review scorecard → Apply/Reject optimized prompt
8494
8520
 
@@ -8593,18 +8619,9 @@ import { Command as Command17 } from "commander";
8593
8619
  import chalk30 from "chalk";
8594
8620
  init_errors();
8595
8621
  init_sdk_client();
8596
- var FREE_OPTIMIZATION_LIMIT = 5;
8597
8622
  var PROVIDERS_URL = "https://app.mutagent.io/settings/providers";
8598
- function renderProgressBar(used, limit, width = 30) {
8599
- const ratio = Math.min(used / limit, 1);
8600
- const filled = Math.round(ratio * width);
8601
- const empty = width - filled;
8602
- const bar = "█".repeat(filled) + "░".repeat(empty);
8603
- const percent = Math.round(ratio * 100);
8604
- return `${bar} ${String(percent)}%`;
8605
- }
8606
8623
  function createUsageCommand() {
8607
- const usage = new Command17("usage").description("Show resource counts and optimization run limits").addHelpText("after", `
8624
+ const usage = new Command17("usage").description("Show resource counts (prompts, datasets, evaluations, optimizations, experiments)").addHelpText("after", `
8608
8625
  Examples:
8609
8626
  ${chalk30.dim("$")} mutagent usage
8610
8627
  ${chalk30.dim("$")} mutagent usage --json
@@ -8637,9 +8654,12 @@ Examples:
8637
8654
  evaluationCount += r.evaluations;
8638
8655
  }
8639
8656
  }
8640
- const optimizationLimit = FREE_OPTIMIZATION_LIMIT;
8641
- const optimizationUsed = 0;
8642
- const optimizationRemaining = optimizationLimit - optimizationUsed;
8657
+ const [optimizations, experiments] = await Promise.all([
8658
+ client.listOptimizations().catch(() => []),
8659
+ client.listExperiments().catch(() => [])
8660
+ ]);
8661
+ const optimizationCount = Array.isArray(optimizations) ? optimizations.length : 0;
8662
+ const experimentCount = Array.isArray(experiments) ? experiments.length : 0;
8643
8663
  if (spinner && typeof spinner.stop === "function") {
8644
8664
  spinner.stop();
8645
8665
  }
@@ -8648,16 +8668,13 @@ Examples:
8648
8668
  resources: {
8649
8669
  prompts: promptCount,
8650
8670
  datasets: datasetCount,
8651
- evaluations: evaluationCount
8652
- },
8653
- optimizationRuns: {
8654
- used: optimizationUsed,
8655
- limit: optimizationLimit,
8656
- remaining: optimizationRemaining,
8657
- plan: "free"
8671
+ evaluations: evaluationCount,
8672
+ optimizations: optimizationCount,
8673
+ experiments: experimentCount
8658
8674
  },
8659
8675
  _links: {
8660
- providers: PROVIDERS_URL
8676
+ providers: PROVIDERS_URL,
8677
+ dashboard: "https://app.mutagent.io"
8661
8678
  }
8662
8679
  });
8663
8680
  } else {
@@ -8666,16 +8683,12 @@ Examples:
8666
8683
  console.log(chalk30.dim("─".repeat(45)));
8667
8684
  console.log("");
8668
8685
  console.log(chalk30.bold("Resources:"));
8669
- console.log(` Prompts: ${chalk30.cyan(String(promptCount))}`);
8670
- console.log(` Datasets: ${chalk30.cyan(String(datasetCount))}`);
8671
- console.log(` Evaluations: ${chalk30.cyan(String(evaluationCount))}`);
8672
- console.log("");
8673
- console.log(chalk30.bold(`Optimization Runs (${chalk30.cyan("free")} plan):`));
8674
- console.log(` Remaining: ${chalk30.cyan(String(optimizationRemaining))} / ${String(optimizationLimit)}`);
8675
- console.log(` ${renderProgressBar(optimizationUsed, optimizationLimit)}`);
8686
+ console.log(` Prompts: ${chalk30.cyan(String(promptCount))}`);
8687
+ console.log(` Datasets: ${chalk30.cyan(String(datasetCount))}`);
8688
+ console.log(` Evaluations: ${chalk30.cyan(String(evaluationCount))}`);
8689
+ console.log(` Optimizations: ${chalk30.cyan(String(optimizationCount))}`);
8690
+ console.log(` Experiments: ${chalk30.cyan(String(experimentCount))}`);
8676
8691
  console.log("");
8677
- console.log(chalk30.cyan(` ${String(optimizationRemaining)} optimization runs this period`));
8678
- console.log(chalk30.dim(` ℹ Optimization run counts are approximate`));
8679
8692
  console.log(` Providers: ${chalk30.underline(PROVIDERS_URL)}`);
8680
8693
  console.log("");
8681
8694
  }
@@ -9260,5 +9273,5 @@ program.addCommand(createHooksCommand());
9260
9273
  program.addCommand(createFeedbackCommand());
9261
9274
  program.parse();
9262
9275
 
9263
- //# debugId=241E284B326DFD6A64756E2164756E21
9276
+ //# debugId=8D938D88D070E37F64756E2164756E21
9264
9277
  //# sourceMappingURL=cli.js.map