@mutagent/cli 0.1.87 → 0.1.88

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
@@ -3845,6 +3845,35 @@ async function buildGuidedWorkflow(promptId) {
3845
3845
  };
3846
3846
  }
3847
3847
 
3848
+ // src/lib/adapters/eval-criteria.ts
3849
+ function cliCriterionToCanonical(c) {
3850
+ return {
3851
+ criteria: c.description,
3852
+ evaluationParameter: c.evaluationParameter,
3853
+ name: c.name
3854
+ };
3855
+ }
3856
+ function canonicalCriterionToCli(c) {
3857
+ if (!c || typeof c !== "object") {
3858
+ return { name: undefined, description: "", evaluationParameter: "" };
3859
+ }
3860
+ return {
3861
+ name: c.name ?? c.id,
3862
+ description: c.criteria ?? c.description ?? "",
3863
+ evaluationParameter: c.evaluationParameter ?? c.parameter ?? ""
3864
+ };
3865
+ }
3866
+ function cliCriteriaArrayToCanonical(arr) {
3867
+ if (!Array.isArray(arr))
3868
+ return [];
3869
+ return arr.map(cliCriterionToCanonical);
3870
+ }
3871
+ function canonicalCriteriaArrayToCli(arr) {
3872
+ if (!Array.isArray(arr))
3873
+ return [];
3874
+ return arr.map(canonicalCriterionToCli);
3875
+ }
3876
+
3848
3877
  // src/commands/prompts/evaluations.ts
3849
3878
  function registerEvaluationCommands(prompts) {
3850
3879
  const evaluation = new Command4("evaluation").description("Manage evaluations for prompts").addHelpText("after", `
@@ -3919,8 +3948,8 @@ Examples:
3919
3948
  console.log(` Created: ${evalObj.createdAt ? new Date(String(evalObj.createdAt)).toLocaleDateString() : "N/A"}`);
3920
3949
  console.log("");
3921
3950
  const config = evalObj.evalConfig;
3922
- const criteria = config?.criteria;
3923
- if (criteria && Array.isArray(criteria) && criteria.length > 0) {
3951
+ const criteria = canonicalCriteriaArrayToCli(config?.criteria);
3952
+ if (criteria.length > 0) {
3924
3953
  console.log(" Criteria:");
3925
3954
  for (const c of criteria) {
3926
3955
  console.log(` ${chalk8.cyan(c.name)}`);
@@ -4170,6 +4199,10 @@ Example:
4170
4199
  ` + "Run: mutagent prompts evaluation create " + promptId + " --guided --json");
4171
4200
  }
4172
4201
  }
4202
+ if (evalData.evalConfig && Array.isArray(evalData.evalConfig.criteria)) {
4203
+ const cliCriteria = evalData.evalConfig.criteria;
4204
+ evalData.evalConfig.criteria = cliCriteriaArrayToCanonical(cliCriteria);
4205
+ }
4173
4206
  const client = await getSDKClient();
4174
4207
  const evalResult = await client.createEvaluation(promptId, evalData);
4175
4208
  if (isJson) {
@@ -9156,5 +9189,5 @@ program.addCommand(createHooksCommand());
9156
9189
  program.addCommand(createFeedbackCommand());
9157
9190
  program.parse();
9158
9191
 
9159
- //# debugId=2CB8DD62F405DABB64756E2164756E21
9192
+ //# debugId=3313422F119EC74164756E2164756E21
9160
9193
  //# sourceMappingURL=cli.js.map