feat: add gemini-cli support for codebase context
This commit is contained in:
@@ -25,7 +25,7 @@ import {
|
||||
markMigrationForNotice
|
||||
} from '../utils.js';
|
||||
import { generateObjectService } from '../ai-services-unified.js';
|
||||
import { getDefaultPriority, isClaudeCode } from '../config-manager.js';
|
||||
import { getDefaultPriority, hasCodebaseAnalysis } from '../config-manager.js';
|
||||
import { getPromptManager } from '../prompt-manager.js';
|
||||
import ContextGatherer from '../utils/contextGatherer.js';
|
||||
import generateTaskFiles from './generate-task-files.js';
|
||||
@@ -426,7 +426,7 @@ async function addTask(
|
||||
useResearch,
|
||||
priority: effectivePriority,
|
||||
dependencies: numericDependencies,
|
||||
isClaudeCode: isClaudeCode(useResearch, projectRoot),
|
||||
hasCodebaseAnalysis: hasCodebaseAnalysis(useResearch, projectRoot),
|
||||
projectRoot: projectRoot
|
||||
}
|
||||
);
|
||||
|
||||
@@ -21,13 +21,11 @@ import { generateTextService } from '../ai-services-unified.js';
|
||||
import {
|
||||
getDefaultSubtasks,
|
||||
getDebugFlag,
|
||||
getMainProvider,
|
||||
getResearchProvider
|
||||
hasCodebaseAnalysis
|
||||
} from '../config-manager.js';
|
||||
import { getPromptManager } from '../prompt-manager.js';
|
||||
import generateTaskFiles from './generate-task-files.js';
|
||||
import { COMPLEXITY_REPORT_FILE } from '../../../src/constants/paths.js';
|
||||
import { CUSTOM_PROVIDERS } from '../../../src/constants/providers.js';
|
||||
import { ContextGatherer } from '../utils/contextGatherer.js';
|
||||
import { FuzzyTaskSearch } from '../utils/fuzzyTaskSearch.js';
|
||||
import { flattenTasksWithSubtasks, findProjectRoot } from '../utils.js';
|
||||
@@ -457,11 +455,8 @@ async function expandTask(
|
||||
// Load prompts using PromptManager
|
||||
const promptManager = getPromptManager();
|
||||
|
||||
// Check if Claude Code is being used as the provider
|
||||
const currentProvider = useResearch
|
||||
? getResearchProvider(projectRoot)
|
||||
: getMainProvider(projectRoot);
|
||||
const isClaudeCode = currentProvider === CUSTOM_PROVIDERS.CLAUDE_CODE;
|
||||
// Check if a codebase analysis provider is being used
|
||||
const hasCodebaseAnalysisCapability = hasCodebaseAnalysis(useResearch, projectRoot);
|
||||
|
||||
// Combine all context sources into a single additionalContext parameter
|
||||
let combinedAdditionalContext = '';
|
||||
@@ -508,7 +503,7 @@ async function expandTask(
|
||||
gatheredContext: gatheredContextText || '',
|
||||
useResearch: useResearch,
|
||||
expansionPrompt: expansionPromptText || undefined,
|
||||
isClaudeCode: isClaudeCode,
|
||||
hasCodebaseAnalysis: hasCodebaseAnalysisCapability,
|
||||
projectRoot: projectRoot || ''
|
||||
};
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import { TASK_PRIORITY_OPTIONS } from '../../../../src/constants/task-priority.j
|
||||
import { getCurrentTag, isSilentMode, log } from '../../utils.js';
|
||||
import { Duration } from '../../../../src/utils/timeout-manager.js';
|
||||
import { CUSTOM_PROVIDERS } from '../../../../src/constants/providers.js';
|
||||
import { getMainProvider, getResearchProvider } from '../../config-manager.js';
|
||||
import { getMainProvider, getResearchProvider, hasCodebaseAnalysis } from '../../config-manager.js';
|
||||
|
||||
// ============================================================================
|
||||
// SCHEMAS
|
||||
@@ -75,13 +75,10 @@ export class PrdParseConfig {
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if Claude Code is being used
|
||||
* Check if codebase analysis is available (Claude Code or Gemini CLI)
|
||||
*/
|
||||
isClaudeCode() {
|
||||
const currentProvider = this.research
|
||||
? getResearchProvider(this.projectRoot)
|
||||
: getMainProvider(this.projectRoot);
|
||||
return currentProvider === CUSTOM_PROVIDERS.CLAUDE_CODE;
|
||||
hasCodebaseAnalysis() {
|
||||
return hasCodebaseAnalysis(this.research, this.projectRoot);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -242,7 +242,7 @@ export async function buildPrompts(config, prdContent, nextId) {
|
||||
prdContent,
|
||||
prdPath: config.prdPath,
|
||||
defaultTaskPriority,
|
||||
isClaudeCode: config.isClaudeCode(),
|
||||
isClaudeCode: config.hasCodebaseAnalysis(),
|
||||
projectRoot: config.projectRoot || ''
|
||||
});
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
flattenTasksWithSubtasks
|
||||
} from '../utils.js';
|
||||
import { generateTextService } from '../ai-services-unified.js';
|
||||
import { getDebugFlag, isClaudeCode } from '../config-manager.js';
|
||||
import { getDebugFlag, hasCodebaseAnalysis } from '../config-manager.js';
|
||||
import { getPromptManager } from '../prompt-manager.js';
|
||||
import generateTaskFiles from './generate-task-files.js';
|
||||
import { ContextGatherer } from '../utils/contextGatherer.js';
|
||||
@@ -232,7 +232,7 @@ async function updateSubtaskById(
|
||||
updatePrompt: prompt,
|
||||
useResearch: useResearch,
|
||||
gatheredContext: gatheredContext || '',
|
||||
isClaudeCode: isClaudeCode(useResearch, projectRoot),
|
||||
hasCodebaseAnalysis: hasCodebaseAnalysis(useResearch, projectRoot),
|
||||
projectRoot: projectRoot
|
||||
};
|
||||
|
||||
|
||||
@@ -23,7 +23,11 @@ import {
|
||||
} from '../ui.js';
|
||||
|
||||
import { generateTextService } from '../ai-services-unified.js';
|
||||
import { getDebugFlag, isApiKeySet, isClaudeCode } from '../config-manager.js';
|
||||
import {
|
||||
getDebugFlag,
|
||||
isApiKeySet,
|
||||
hasCodebaseAnalysis
|
||||
} from '../config-manager.js';
|
||||
import { getPromptManager } from '../prompt-manager.js';
|
||||
import { ContextGatherer } from '../utils/contextGatherer.js';
|
||||
import { FuzzyTaskSearch } from '../utils/fuzzyTaskSearch.js';
|
||||
@@ -454,7 +458,7 @@ async function updateTaskById(
|
||||
useResearch: useResearch,
|
||||
currentDetails: taskToUpdate.details || '(No existing details)',
|
||||
gatheredContext: gatheredContext || '',
|
||||
isClaudeCode: isClaudeCode(useResearch, projectRoot),
|
||||
hasCodebaseAnalysis: hasCodebaseAnalysis(useResearch, projectRoot),
|
||||
projectRoot: projectRoot
|
||||
};
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
displayAiUsageSummary
|
||||
} from '../ui.js';
|
||||
|
||||
import { getDebugFlag, isClaudeCode } from '../config-manager.js';
|
||||
import { getDebugFlag, hasCodebaseAnalysis } from '../config-manager.js';
|
||||
import { getPromptManager } from '../prompt-manager.js';
|
||||
import generateTaskFiles from './generate-task-files.js';
|
||||
import { generateTextService } from '../ai-services-unified.js';
|
||||
@@ -436,7 +436,7 @@ async function updateTasks(
|
||||
updatePrompt: prompt,
|
||||
useResearch,
|
||||
projectContext: gatheredContext,
|
||||
isClaudeCode: isClaudeCode(useResearch, projectRoot),
|
||||
hasCodebaseAnalysis: hasCodebaseAnalysis(useResearch, projectRoot),
|
||||
projectRoot: projectRoot
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user