winter-super-cli 2026.5.29 → 2026.5.30
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 +1 -1
- package/src/cli/repl.js +8 -5
- package/src/context/router.js +26 -22
package/package.json
CHANGED
package/src/cli/repl.js
CHANGED
|
@@ -1112,14 +1112,17 @@ ${colors.reset}
|
|
|
1112
1112
|
const activeProvider = this.ai?.getActiveProvider?.() || Object.keys(providers)[0] || null;
|
|
1113
1113
|
const hasProvider = name => !!providers[name]?.model || !!providers[name]?.ready;
|
|
1114
1114
|
|
|
1115
|
-
|
|
1116
|
-
|
|
1115
|
+
const activeProviderIsValid = activeProvider && hasProvider(activeProvider);
|
|
1116
|
+
const allowAutoRoute = options.autoRouteProvider === true && !activeProviderIsValid;
|
|
1117
|
+
|
|
1118
|
+
let provider = activeProviderIsValid ? activeProvider : Object.keys(providers).find(hasProvider) || activeProvider;
|
|
1119
|
+
if (allowAutoRoute && /\b(review|refactor|debug|fix|bug|error|stack trace|test|tool|patch|code)\b/.test(text) && hasProvider('claude')) {
|
|
1117
1120
|
provider = 'claude';
|
|
1118
|
-
} else if (/\b(summary|summarize|commit message|changelog|docs|explain|rewrite)\b/.test(text) && hasProvider('openai')) {
|
|
1121
|
+
} else if (allowAutoRoute && /\b(summary|summarize|commit message|changelog|docs|explain|rewrite)\b/.test(text) && hasProvider('openai')) {
|
|
1119
1122
|
provider = 'openai';
|
|
1120
|
-
} else if (/\b(local|offline|privacy|private|on-device)\b/.test(text) && hasProvider('ollama')) {
|
|
1123
|
+
} else if (allowAutoRoute && /\b(local|offline|privacy|private|on-device)\b/.test(text) && hasProvider('ollama')) {
|
|
1121
1124
|
provider = 'ollama';
|
|
1122
|
-
} else if (/\b(quick|brief|short|fast)\b/.test(text) && hasProvider('groq')) {
|
|
1125
|
+
} else if (allowAutoRoute && /\b(quick|brief|short|fast)\b/.test(text) && hasProvider('groq')) {
|
|
1123
1126
|
provider = 'groq';
|
|
1124
1127
|
}
|
|
1125
1128
|
|
package/src/context/router.js
CHANGED
|
@@ -23,28 +23,32 @@ function bumpReasoningLevel(level, steps) {
|
|
|
23
23
|
if (idx === -1) return level;
|
|
24
24
|
const newIdx = Math.min(idx + steps, order.length - 1);
|
|
25
25
|
return order[newIdx];
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function selectExecutionProfile({ messages = [], activeProvider = null, providers = {}, options = {} } = {}) {
|
|
29
|
+
const text = flattenMessageText(messages);
|
|
30
|
+
const providerNames = Object.keys(providers).filter(name => providers[name]?.ready || providers[name]?.model);
|
|
31
|
+
const hasProvider = name => providerNames.includes(name);
|
|
32
|
+
|
|
33
|
+
const explicitProvider = options.provider && hasProvider(options.provider) ? options.provider : null;
|
|
34
|
+
const activeProviderIsValid = activeProvider && hasProvider(activeProvider);
|
|
35
|
+
let provider = explicitProvider || (activeProviderIsValid ? activeProvider : providerNames[0] || null);
|
|
36
|
+
const allowAutoRoute = options.autoRouteProvider === true && !explicitProvider && !activeProviderIsValid;
|
|
37
|
+
|
|
38
|
+
if (explicitProvider) {
|
|
39
|
+
provider = explicitProvider;
|
|
40
|
+
} else if (allowAutoRoute && /\b(review|refactor|debug|fix|bug|error|stack trace|test|tool|patch|code)\b/.test(text) && hasProvider('claude')) {
|
|
41
|
+
provider = 'claude';
|
|
42
|
+
} else if (allowAutoRoute && /\b(summary|summarize|commit message|changelog|docs|explain|rewrite)\b/.test(text) && hasProvider('openai')) {
|
|
43
|
+
provider = 'openai';
|
|
44
|
+
} else if (allowAutoRoute && /\b(local|offline|privacy|private|on-device)\b/.test(text) && hasProvider('ollama')) {
|
|
45
|
+
provider = 'ollama';
|
|
46
|
+
} else if (allowAutoRoute && /\b(quick|brief|short|fast)\b/.test(text) && hasProvider('groq')) {
|
|
47
|
+
provider = 'groq';
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const providerConfig = providers[provider] || providers[activeProvider] || {};
|
|
51
|
+
const model = options.model || providerConfig.model || providers[activeProvider]?.model || null;
|
|
48
52
|
|
|
49
53
|
// Detect model capability tier
|
|
50
54
|
const modelTier = classifyModelTier(model, provider);
|