feat: Add Cursor CLI configuration and status endpoints

- Implemented new routes for managing Cursor CLI configuration, including getting current settings and updating default models.
- Created status endpoint to check Cursor CLI installation and authentication status.
- Updated HttpApiClient to include methods for interacting with the new Cursor API endpoints.
- Marked completion of the setup routes and status endpoints phase in the integration plan.
This commit is contained in:
Shirone
2025-12-28 00:53:31 +01:00
parent 6e9468a56e
commit 59612231bb
6 changed files with 272 additions and 19 deletions

View File

@@ -508,6 +508,59 @@ export class HttpApiClient implements ElectronAPI {
error?: string;
}> => this.get('/api/setup/gh-status'),
// Cursor CLI methods
getCursorStatus: (): Promise<{
success: boolean;
installed?: boolean;
version?: string | null;
path?: string | null;
auth?: {
authenticated: boolean;
method: string;
};
installCommand?: string;
loginCommand?: string;
error?: string;
}> => this.get('/api/setup/cursor-status'),
getCursorConfig: (
projectPath: string
): Promise<{
success: boolean;
config?: {
defaultModel?: string;
models?: string[];
mcpServers?: string[];
rules?: string[];
};
availableModels?: Array<{
id: string;
label: string;
description: string;
hasThinking: boolean;
tier: 'free' | 'pro';
}>;
error?: string;
}> => this.get(`/api/setup/cursor-config?projectPath=${encodeURIComponent(projectPath)}`),
setCursorDefaultModel: (
projectPath: string,
model: string
): Promise<{
success: boolean;
model?: string;
error?: string;
}> => this.post('/api/setup/cursor-config/default-model', { projectPath, model }),
setCursorModels: (
projectPath: string,
models: string[]
): Promise<{
success: boolean;
models?: string[];
error?: string;
}> => this.post('/api/setup/cursor-config/models', { projectPath, models }),
onInstallProgress: (callback: (progress: unknown) => void) => {
return this.subscribeToEvent('agent:stream', callback);
},