feat(ui): Enhance AI model handling with Cursor support

- Refactor model handling to support both Claude and Cursor models across various components.
- Introduce `stripProviderPrefix` utility for consistent model ID processing.
- Update `CursorProvider` to utilize `isCursorModel` for model validation.
- Implement model override functionality in GitHub issue validation and enhancement routes.
- Add `useCursorStatusInit` hook to initialize Cursor CLI status on app startup.
- Update UI components to reflect changes in model selection and validation processes.

This update improves the flexibility of AI model usage and enhances user experience by allowing quick model overrides.
This commit is contained in:
Kacper
2025-12-30 04:01:56 +01:00
parent 3d655c3298
commit 39f2c8c9ff
38 changed files with 713 additions and 258 deletions

View File

@@ -4,7 +4,7 @@ import type { Project, TrashedProject } from '@/lib/electron';
import type {
Feature as BaseFeature,
FeatureImagePath,
AgentModel,
ModelAlias,
PlanningMode,
AIProfile,
CursorModelId,
@@ -13,8 +13,8 @@ import type {
} from '@automaker/types';
import { getAllCursorModelIds, DEFAULT_PHASE_MODELS } from '@automaker/types';
// Re-export ThemeMode for convenience
export type { ThemeMode };
// Re-export types for convenience
export type { ThemeMode, ModelAlias };
export type ViewMode =
| 'welcome'
@@ -477,10 +477,10 @@ export interface AppState {
muteDoneSound: boolean; // When true, mute the notification sound when agents complete (default: false)
// Enhancement Model Settings
enhancementModel: AgentModel; // Model used for feature enhancement (default: sonnet)
enhancementModel: ModelAlias; // Model used for feature enhancement (default: sonnet)
// Validation Model Settings
validationModel: AgentModel; // Model used for GitHub issue validation (default: opus)
validationModel: ModelAlias; // Model used for GitHub issue validation (default: opus)
// Phase Model Settings - per-phase AI model configuration
phaseModels: PhaseModelConfig;
@@ -760,13 +760,13 @@ export interface AppActions {
setMuteDoneSound: (muted: boolean) => void;
// Enhancement Model actions
setEnhancementModel: (model: AgentModel) => void;
setEnhancementModel: (model: ModelAlias) => void;
// Validation Model actions
setValidationModel: (model: AgentModel) => void;
setValidationModel: (model: ModelAlias) => void;
// Phase Model actions
setPhaseModel: (phase: PhaseModelKey, model: AgentModel | CursorModelId) => void;
setPhaseModel: (phase: PhaseModelKey, model: ModelAlias | CursorModelId) => void;
setPhaseModels: (models: Partial<PhaseModelConfig>) => void;
resetPhaseModels: () => void;