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:
@@ -43,6 +43,7 @@ import {
|
||||
ClaudeCodeProvider,
|
||||
GeminiCliProvider,
|
||||
GoogleAIProvider,
|
||||
GrokCliProvider,
|
||||
GroqProvider,
|
||||
OllamaAIProvider,
|
||||
OpenAIProvider,
|
||||
@@ -69,7 +70,8 @@ const PROVIDERS = {
|
||||
azure: new AzureProvider(),
|
||||
vertex: new VertexAIProvider(),
|
||||
'claude-code': new ClaudeCodeProvider(),
|
||||
'gemini-cli': new GeminiCliProvider()
|
||||
'gemini-cli': new GeminiCliProvider(),
|
||||
'grok-cli': new GrokCliProvider()
|
||||
};
|
||||
|
||||
function _getProvider(providerName) {
|
||||
|
||||
@@ -21,6 +21,7 @@ import {
|
||||
ShowCommand,
|
||||
AuthCommand,
|
||||
ContextCommand,
|
||||
StartCommand,
|
||||
SetStatusCommand,
|
||||
checkForUpdate,
|
||||
performAutoUpdate,
|
||||
@@ -1706,6 +1707,10 @@ function registerCommands(programInstance) {
|
||||
// Displays detailed information about tasks
|
||||
ShowCommand.registerOn(programInstance);
|
||||
|
||||
// Register the start command from @tm/cli
|
||||
// Starts working on a task by launching claude-code with a standardized prompt
|
||||
StartCommand.registerOn(programInstance);
|
||||
|
||||
// expand command
|
||||
programInstance
|
||||
.command('expand')
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -106,6 +106,56 @@
|
||||
"supported": true
|
||||
}
|
||||
],
|
||||
"grok-cli": [
|
||||
{
|
||||
"id": "grok-4-latest",
|
||||
"name": "Grok 4 Latest",
|
||||
"swe_score": 0.7,
|
||||
"cost_per_1m_tokens": {
|
||||
"input": 0,
|
||||
"output": 0
|
||||
},
|
||||
"allowed_roles": ["main", "fallback", "research"],
|
||||
"max_tokens": 131072,
|
||||
"supported": true
|
||||
},
|
||||
{
|
||||
"id": "grok-3-latest",
|
||||
"name": "Grok 3 Latest",
|
||||
"swe_score": 0.65,
|
||||
"cost_per_1m_tokens": {
|
||||
"input": 0,
|
||||
"output": 0
|
||||
},
|
||||
"allowed_roles": ["main", "fallback", "research"],
|
||||
"max_tokens": 131072,
|
||||
"supported": true
|
||||
},
|
||||
{
|
||||
"id": "grok-3-fast",
|
||||
"name": "Grok 3 Fast",
|
||||
"swe_score": 0.6,
|
||||
"cost_per_1m_tokens": {
|
||||
"input": 0,
|
||||
"output": 0
|
||||
},
|
||||
"allowed_roles": ["main", "fallback", "research"],
|
||||
"max_tokens": 131072,
|
||||
"supported": true
|
||||
},
|
||||
{
|
||||
"id": "grok-3-mini-fast",
|
||||
"name": "Grok 3 Mini Fast",
|
||||
"swe_score": 0.55,
|
||||
"cost_per_1m_tokens": {
|
||||
"input": 0,
|
||||
"output": 0
|
||||
},
|
||||
"allowed_roles": ["main", "fallback", "research"],
|
||||
"max_tokens": 32768,
|
||||
"supported": true
|
||||
}
|
||||
],
|
||||
"openai": [
|
||||
{
|
||||
"id": "gpt-4o",
|
||||
|
||||
Reference in New Issue
Block a user