agentaudit 3.9.23 → 3.9.24

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.
Files changed (2) hide show
  1. package/cli.mjs +11 -4
  2. package/package.json +1 -1
package/cli.mjs CHANGED
@@ -52,11 +52,18 @@ function resolveProvider(flagOverride, keys) {
52
52
  return p;
53
53
  }
54
54
 
55
- // Smart inference: if model override looks like "provider/model" (e.g. z-ai/glm-5, anthropic/claude-sonnet-4)
56
- // → auto-select OpenRouter (which uses that format)
55
+ // Smart inference: if model is set, try to match it to a provider
57
56
  const activeModel = globalModelOverride || process.env.AGENTAUDIT_MODEL || loadConfig()?.preferred_model;
58
- if (activeModel && activeModel.includes('/') && providers.openrouter) {
59
- return providers.openrouter;
57
+ if (activeModel) {
58
+ const lm = activeModel.toLowerCase();
59
+ // Direct provider models (no slash = native format)
60
+ if (!lm.includes('/')) {
61
+ if (lm.startsWith('claude') && providers.anthropic) return providers.anthropic;
62
+ if ((lm.startsWith('gpt') || lm.startsWith('o3') || lm.startsWith('o4') || lm.startsWith('o1')) && providers.openai) return providers.openai;
63
+ if (providers.ollama && (process.env.OLLAMA_MODEL || process.env.OLLAMA_HOST)) return providers.ollama;
64
+ }
65
+ // Slash format = OpenRouter convention (provider/model)
66
+ if (lm.includes('/') && providers.openrouter) return providers.openrouter;
60
67
  }
61
68
 
62
69
  // Auto-detect priority: Anthropic > OpenAI > OpenRouter > Custom > Ollama (local last — usually weaker)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentaudit",
3
- "version": "3.9.23",
3
+ "version": "3.9.24",
4
4
  "description": "Security scanner for AI packages — MCP server + CLI",
5
5
  "type": "module",
6
6
  "bin": {