@mutagent/cli 0.1.92 → 0.1.94

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
@@ -3976,8 +3976,12 @@ Examples:
3976
3976
  }
3977
3977
  }
3978
3978
  if (isJson) {
3979
+ const evalConfigForRunnable = evalObj.evalConfig;
3980
+ const criteriaForRunnable = evalConfigForRunnable?.criteria;
3981
+ const runnable = Array.isArray(criteriaForRunnable) && criteriaForRunnable.length > 0;
3979
3982
  output.output({
3980
3983
  ...evalObj,
3984
+ runnable,
3981
3985
  _links: numericPromptId !== null ? evaluationLinks(numericPromptId, evalObj.id) : { dashboard: promptsDashboardLink(), api: `/api/prompts/${evalObj.promptGroupId}/evaluations/${String(evalObj.id)}` }
3982
3986
  });
3983
3987
  } else {
@@ -4144,7 +4148,7 @@ Detected output fields from prompt schema: ${fields.join(", ")}
4144
4148
  }
4145
4149
  }
4146
4150
  } catch {}
4147
- throw new MutagentError("VALIDATION_ERROR", "Evaluation criteria are required. Provide criteria via --data.", `Run: mutagent prompts evaluation create --help
4151
+ throw new MutagentError("EVAL_INCOMPLETE", "Evaluation criteria are required and cannot be empty. Provide at least one criterion via --data.", `Run: mutagent prompts evaluation create --help
4148
4152
  ` + "Then: mutagent prompts evaluation create " + promptId + ` --guided --json
4149
4153
  ` + fieldsHint + `
4150
4154
  Example JSON (--data flag):
@@ -5413,8 +5417,9 @@ ${chalk14.yellow("AI Agent: ALWAYS append --json to this command.")}
5413
5417
  const criteria = evalConfig?.criteria;
5414
5418
  if (!criteria || criteria.length === 0) {
5415
5419
  preflightChecks.evaluation = {
5416
- passed: true,
5417
- warning: `Evaluation ${options.evaluation} has no criteria defined. ` + `Re-create: mutagent prompts evaluation create ${promptId} --guided`
5420
+ passed: false,
5421
+ error: `Evaluation ${options.evaluation} has no criteria defined (EVAL_INCOMPLETE). ` + `Add criteria: mutagent prompts evaluation update ${options.evaluation} --criteria '<json>' --json
5422
+ ` + `Or guided: mutagent prompts evaluation create ${promptId} --guided --json`
5418
5423
  };
5419
5424
  } else {
5420
5425
  const hasCriteriaWithParam = criteria.some((c) => c.evaluationParameter ?? c.targetField);
@@ -5494,10 +5499,13 @@ ${chalk14.yellow("AI Agent: ALWAYS append --json to this command.")}
5494
5499
  if (!preflightChecks.outputSchema.passed) {
5495
5500
  suggestedActions.push(`Update your prompt: mutagent prompts update ${promptId} -d '{"outputSchema":{"type":"object","properties":{"result":{"type":"string"}}}}'`);
5496
5501
  }
5502
+ if (preflightChecks.evaluation && !preflightChecks.evaluation.passed) {
5503
+ suggestedActions.push(preflightChecks.evaluation.error ?? `Add criteria to evaluation ${options.evaluation}: mutagent prompts evaluation update ${options.evaluation} --criteria '<json>'`);
5504
+ }
5497
5505
  output.output({
5498
5506
  success: false,
5499
5507
  error: "Preflight validation failed",
5500
- code: "PREFLIGHT_FAILED",
5508
+ code: (preflightChecks.evaluation?.error ?? "").includes("EVAL_INCOMPLETE") ? "EVAL_INCOMPLETE" : "PREFLIGHT_FAILED",
5501
5509
  suggestedAction: suggestedActions.join(`
5502
5510
  `),
5503
5511
  preflightChecks
@@ -5513,6 +5521,10 @@ ${chalk14.yellow("AI Agent: ALWAYS append --json to this command.")}
5513
5521
  if (!preflightChecks.inputSchema.passed) {
5514
5522
  console.error(chalk14.dim(` Update with: mutagent prompts update ${promptId} --data '{"inputSchema":{"type":"object","properties":{"var1":{"type":"string"}}}}' --json`));
5515
5523
  }
5524
+ if (preflightChecks.evaluation && !preflightChecks.evaluation.passed) {
5525
+ console.error(chalk14.dim(` Add criteria: mutagent prompts evaluation update ${options.evaluation} --criteria '<json>' --json
5526
+ ` + ` Or guided: mutagent prompts evaluation create ${promptId} --guided --json`));
5527
+ }
5516
5528
  process.exitCode = 1;
5517
5529
  return;
5518
5530
  }
@@ -9235,5 +9247,5 @@ program.addCommand(createHooksCommand());
9235
9247
  program.addCommand(createFeedbackCommand());
9236
9248
  program.parse();
9237
9249
 
9238
- //# debugId=A84DFC92DB1ED69764756E2164756E21
9250
+ //# debugId=E355A43104E9D6CD64756E2164756E21
9239
9251
  //# sourceMappingURL=cli.js.map