Tm start (#1200)
Co-authored-by: Max Tuzzolino <maxtuzz@Maxs-MacBook-Pro.local> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Max Tuzzolino <max.tuzsmith@gmail.com> Co-authored-by: Ralph Khreish <35776126+Crunchyman-ralph@users.noreply.github.com>
This commit is contained in:
@@ -57,7 +57,12 @@ const DEFAULTS = {
|
||||
responseLanguage: 'English',
|
||||
enableCodebaseAnalysis: true
|
||||
},
|
||||
claudeCode: {}
|
||||
claudeCode: {},
|
||||
grokCli: {
|
||||
timeout: 120000,
|
||||
workingDirectory: null,
|
||||
defaultModel: 'grok-4-latest'
|
||||
}
|
||||
};
|
||||
|
||||
// --- Internal Config Loading ---
|
||||
@@ -132,7 +137,8 @@ function _loadAndValidateConfig(explicitRoot = null) {
|
||||
: { ...defaults.models.fallback }
|
||||
},
|
||||
global: { ...defaults.global, ...parsedConfig?.global },
|
||||
claudeCode: { ...defaults.claudeCode, ...parsedConfig?.claudeCode }
|
||||
claudeCode: { ...defaults.claudeCode, ...parsedConfig?.claudeCode },
|
||||
grokCli: { ...defaults.grokCli, ...parsedConfig?.grokCli }
|
||||
};
|
||||
configSource = `file (${configPath})`; // Update source info
|
||||
|
||||
@@ -373,6 +379,22 @@ function getClaudeCodeSettingsForCommand(
|
||||
return { ...settings, ...commandSpecific[commandName] };
|
||||
}
|
||||
|
||||
function getGrokCliSettings(explicitRoot = null, forceReload = false) {
|
||||
const config = getConfig(explicitRoot, forceReload);
|
||||
// Ensure Grok CLI defaults are applied if Grok CLI section is missing
|
||||
return { ...DEFAULTS.grokCli, ...(config?.grokCli || {}) };
|
||||
}
|
||||
|
||||
function getGrokCliSettingsForCommand(
|
||||
commandName,
|
||||
explicitRoot = null,
|
||||
forceReload = false
|
||||
) {
|
||||
const settings = getGrokCliSettings(explicitRoot, forceReload);
|
||||
const commandSpecific = settings?.commandSpecific || {};
|
||||
return { ...settings, ...commandSpecific[commandName] };
|
||||
}
|
||||
|
||||
// --- Role-Specific Getters ---
|
||||
|
||||
function getModelConfigForRole(role, explicitRoot = null) {
|
||||
@@ -463,7 +485,8 @@ function hasCodebaseAnalysis(
|
||||
|
||||
return (
|
||||
currentProvider === CUSTOM_PROVIDERS.CLAUDE_CODE ||
|
||||
currentProvider === CUSTOM_PROVIDERS.GEMINI_CLI
|
||||
currentProvider === CUSTOM_PROVIDERS.GEMINI_CLI ||
|
||||
currentProvider === CUSTOM_PROVIDERS.GROK_CLI
|
||||
);
|
||||
}
|
||||
|
||||
@@ -583,8 +606,8 @@ function getResponseLanguage(explicitRoot = null) {
|
||||
}
|
||||
|
||||
function getCodebaseAnalysisEnabled(explicitRoot = null) {
|
||||
// Directly return value from config
|
||||
return getGlobalConfig(explicitRoot).enableCodebaseAnalysis;
|
||||
// Return boolean-safe value with default true
|
||||
return getGlobalConfig(explicitRoot).enableCodebaseAnalysis !== false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -692,7 +715,8 @@ function isApiKeySet(providerName, session = null, projectRoot = null) {
|
||||
CUSTOM_PROVIDERS.OLLAMA,
|
||||
CUSTOM_PROVIDERS.BEDROCK,
|
||||
CUSTOM_PROVIDERS.MCP,
|
||||
CUSTOM_PROVIDERS.GEMINI_CLI
|
||||
CUSTOM_PROVIDERS.GEMINI_CLI,
|
||||
CUSTOM_PROVIDERS.GROK_CLI
|
||||
];
|
||||
|
||||
if (providersWithoutApiKeys.includes(providerName?.toLowerCase())) {
|
||||
@@ -998,6 +1022,7 @@ export const providersWithoutApiKeys = [
|
||||
CUSTOM_PROVIDERS.OLLAMA,
|
||||
CUSTOM_PROVIDERS.BEDROCK,
|
||||
CUSTOM_PROVIDERS.GEMINI_CLI,
|
||||
CUSTOM_PROVIDERS.GROK_CLI,
|
||||
CUSTOM_PROVIDERS.MCP
|
||||
];
|
||||
|
||||
@@ -1010,6 +1035,9 @@ export {
|
||||
// Claude Code settings
|
||||
getClaudeCodeSettings,
|
||||
getClaudeCodeSettingsForCommand,
|
||||
// Grok CLI settings
|
||||
getGrokCliSettings,
|
||||
getGrokCliSettingsForCommand,
|
||||
// Validation
|
||||
validateProvider,
|
||||
validateProviderModelCombination,
|
||||
|
||||
Reference in New Issue
Block a user