troxy-cli 1.23.0 → 1.24.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "troxy-cli",
3
- "version": "1.23.0",
3
+ "version": "1.24.0",
4
4
  "description": "A secure control layer for AI agents: policies across payments, messages, logins, destructive actions, model usage, and secrets, all enforceable from the CLI",
5
5
  "homepage": "https://troxy.io",
6
6
  "bugs": {
package/src/mcp-server.js CHANGED
@@ -578,17 +578,23 @@ export async function runMcp() {
578
578
  if (result.error) {
579
579
  return { content: [{ type: 'text', text: `Troxy error: ${result.error}` }], isError: true };
580
580
  }
581
- const { decision, reason, audit_id, approval_token } = result;
581
+ const { decision, reason, audit_id, approval_token, suggested_model, suggestion_reason } = result;
582
582
  const what = `${args.model}${args.effort ? ` at ${args.effort} effort` : ''}`;
583
583
  // Every non-blocked branch repeats the audit_id and the instruction to
584
584
  // report back. Half the value of this checkpoint is the second call, and
585
585
  // an agent that is only told "approved" has no reason to make it.
586
586
  const followUp = ` When this turn finishes, call report_model_usage(audit_id="${audit_id}", actual_tokens=<real total>).`;
587
+ // Advisory only, dark-shipped per org - most orgs never see this field.
588
+ // Same "call again with the new id" pattern a BLOCK already teaches,
589
+ // just optional here: the call is still approved either way.
590
+ const suggestionText = suggested_model
591
+ ? ` Suggestion: ${suggestion_reason || `${suggested_model} would likely work just as well here.`} If you'd like to use it, call evaluate_model again with model="${suggested_model}" — no obligation, this run is already approved as-is.`
592
+ : '';
587
593
  let modelText;
588
594
  switch (decision) {
589
595
  case 'ALLOW':
590
596
  case 'NOTIFY':
591
- modelText = `✓ Approved: ${what}.${reason ? ` ${reason}` : ''} You may run it.${followUp} (audit: ${audit_id})`;
597
+ modelText = `✓ Approved: ${what}.${reason ? ` ${reason}` : ''} You may run it.${followUp}${suggestionText} (audit: ${audit_id})`;
592
598
  break;
593
599
  case 'BLOCK':
594
600
  modelText = `✗ Blocked: ${what}.${reason ? ` ${reason}` : ''} Do not use this model for this task. Choose a cheaper or smaller model and call evaluate_model again with the new model id. (audit: ${audit_id})`;