@formigio/fazemos-cli 0.10.10 → 0.10.11

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/index.js CHANGED
@@ -26,6 +26,13 @@ function parseStreamSilenceAbortMs(val) {
26
26
  }
27
27
  return n;
28
28
  }
29
+ function parseEvalMaxTurns(val) {
30
+ const n = Number(val);
31
+ if (!Number.isInteger(n) || n < 8 || n > 30) {
32
+ throw new Error(`eval_max_turns must be an integer between 8 and 30 (got ${val})`);
33
+ }
34
+ return n;
35
+ }
29
36
  function formatMsHuman(ms) {
30
37
  if (ms >= 60000) {
31
38
  const min = ms / 60000;
@@ -2823,6 +2830,9 @@ templates
2823
2830
  else if (step.outputs?.length) {
2824
2831
  console.log(' Inputs: none');
2825
2832
  }
2833
+ if (step.eval_max_turns != null) {
2834
+ console.log(` Eval Max Turns: ${step.eval_max_turns}`);
2835
+ }
2826
2836
  if (step.stream_silence_abort_ms) {
2827
2837
  console.log(` Stream Silence Abort: ${step.stream_silence_abort_ms.toLocaleString()}ms (${formatMsHuman(step.stream_silence_abort_ms)})`);
2828
2838
  }
@@ -3179,6 +3189,7 @@ templates
3179
3189
  .option('--sort-order <n>', 'Set sort_order directly (lower-level escape hatch)', parseNumber)
3180
3190
  .option('--agent-config <json>', 'Per-step agent config overrides as JSON (e.g., \'{"model":"opus","maxBudgetUsd":20}\'). Overrides agent member defaults for: model, maxBudgetUsd, maxTurns, timeoutMs, cwd, repos')
3181
3191
  .option('--stream-silence-abort-ms <ms>', 'Stream silence abort threshold in milliseconds (30000-1800000)', parseStreamSilenceAbortMs)
3192
+ .option('--eval-max-turns <n>', 'Evaluator turn budget for tool-enabled (agent) evals on this step (8-30). Has no effect on script-typed steps (rejected by API).', parseEvalMaxTurns)
3182
3193
  .action(async (templateId, opts) => {
3183
3194
  try {
3184
3195
  if (!VALID_STEP_TYPES.includes(opts.type)) {
@@ -3240,6 +3251,8 @@ templates
3240
3251
  step.agent_config = parseJson(opts.agentConfig, '--agent-config');
3241
3252
  if (opts.streamSilenceAbortMs !== undefined)
3242
3253
  step.stream_silence_abort_ms = opts.streamSilenceAbortMs;
3254
+ if (opts.evalMaxTurns !== undefined)
3255
+ step.eval_max_turns = opts.evalMaxTurns;
3243
3256
  // Positioning: --after or --sort-order
3244
3257
  if (opts.after && opts.sortOrder !== undefined) {
3245
3258
  console.error(chalk.red('Cannot use both --after and --sort-order'));
@@ -3268,6 +3281,9 @@ templates
3268
3281
  if (step.stream_silence_abort_ms) {
3269
3282
  console.log(` Stream Silence Abort: ${step.stream_silence_abort_ms.toLocaleString()}ms (${formatMsHuman(step.stream_silence_abort_ms)})`);
3270
3283
  }
3284
+ if (step.eval_max_turns != null) {
3285
+ console.log(` Eval Max Turns: ${step.eval_max_turns}`);
3286
+ }
3271
3287
  }
3272
3288
  catch (err) {
3273
3289
  console.error(chalk.red(err.message));
@@ -3337,12 +3353,20 @@ templates
3337
3353
  .option('--sections <text>', 'Agent instructions / step content. Use @filepath to load from a file (e.g., --sections @steps/review.md)')
3338
3354
  .option('--agent-config <json>', 'Per-step agent config overrides as JSON (merges with existing)')
3339
3355
  .option('--stream-silence-abort-ms <ms>', 'Stream silence abort threshold in milliseconds (30000-1800000)', parseStreamSilenceAbortMs)
3356
+ .option('--eval-max-turns <n>', 'Evaluator turn budget for tool-enabled (agent) evals on this step (8-30). Mutually exclusive with --clear-eval-max-turns.', parseEvalMaxTurns)
3357
+ .option('--clear-eval-max-turns', 'Remove a previously-set eval_max_turns from this step, reverting to runner default. Mutually exclusive with --eval-max-turns.')
3340
3358
  .action(async (templateId, opts) => {
3341
3359
  try {
3360
+ if (opts.evalMaxTurns !== undefined && opts.clearEvalMaxTurns) {
3361
+ console.error(chalk.red('--eval-max-turns and --clear-eval-max-turns are mutually exclusive'));
3362
+ process.exit(1);
3363
+ return;
3364
+ }
3342
3365
  const hasUpdate = opts.name || opts.type || opts.role || opts.description != null
3343
3366
  || opts.reviewer != null || opts.maxReviewCycles != null || opts.parallelGroup != null
3344
3367
  || opts.image || opts.command || opts.timeout !== undefined || opts.workingDir || opts.env
3345
- || opts.agentConfig || opts.sections != null || opts.streamSilenceAbortMs !== undefined;
3368
+ || opts.agentConfig || opts.sections != null || opts.streamSilenceAbortMs !== undefined
3369
+ || opts.evalMaxTurns !== undefined || opts.clearEvalMaxTurns;
3346
3370
  if (!hasUpdate) {
3347
3371
  console.error(chalk.red('Provide at least one field to update'));
3348
3372
  process.exit(1);
@@ -3415,6 +3439,13 @@ templates
3415
3439
  if (opts.streamSilenceAbortMs !== undefined) {
3416
3440
  step.stream_silence_abort_ms = opts.streamSilenceAbortMs;
3417
3441
  }
3442
+ // eval_max_turns: set or clear (mutually exclusive — checked above)
3443
+ if (opts.evalMaxTurns !== undefined) {
3444
+ step.eval_max_turns = opts.evalMaxTurns;
3445
+ }
3446
+ else if (opts.clearEvalMaxTurns) {
3447
+ delete step.eval_max_turns;
3448
+ }
3418
3449
  await api('PUT', `/api/pipeline-templates/${templateId}`, { definition: t.definition });
3419
3450
  console.log(chalk.green(`Updated step: ${step.name}`));
3420
3451
  }