-
Notifications
You must be signed in to change notification settings - Fork 576
feat: add Cursor Agent CLI as alternative AI provider #273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
tony-nekola-silk
wants to merge
15
commits into
AutoMaker-Org:main
from
tony-nekola-silk:feature/cursor-agent-provider
Closed
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
5e0f6ee
feat: add cursor-agent provider support
tony-nekola-silk 6279ac2
refactor: centralize cursor-agent CLI detection in CursorProvider
tony-nekola-silk bc8ff22
fix: correct cursor-agent installation command
tony-nekola-silk 156184e
fix: update cursor models - add composer, change default to opus-thin…
tony-nekola-silk 5ccd780
test: fix cursor-provider tests for centralized CLI detection
tony-nekola-silk 3e329e1
fix: add default property to ModelOption type
tony-nekola-silk b1e7b0b
fix: correct cursor model aliases in AgentModel docstring
tony-nekola-silk 3f6c40f
fix: prevent race condition by attaching close listener early
tony-nekola-silk 7b0f45d
test: use documented model aliases in cursor-provider tests
tony-nekola-silk 8b8a82e
test: fix mock reuse in detectInstallation test
tony-nekola-silk 91d13fa
feat(ui): add provider selection to feature dialogs and profiles view
tony-nekola-silk 321048b
refactor: rename "Cursor Agent" to "Cursor CLI" in UI and code
tony-nekola-silk 882f380
test(ui): add provider and model selection tests
tony-nekola-silk 21d5aff
fix(ui): filter profiles by selected provider in feature dialogs
tony-nekola-silk 27edc13
fix(ui): align cursor model mappings with capability tiers
tony-nekola-silk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| /** | ||
| * Business logic for getting Cursor CLI status | ||
| * Uses CursorProvider as the single source of truth for CLI detection | ||
| */ | ||
|
|
||
| import { CursorProvider } from '../../providers/cursor-provider.js'; | ||
|
|
||
| export interface CursorStatus { | ||
| status: 'installed' | 'not_installed'; | ||
| installed: boolean; | ||
| method: string; | ||
| version: string; | ||
| path: string; | ||
| auth: { | ||
| authenticated: boolean; | ||
| method: string; | ||
| hasApiKey: boolean; | ||
| }; | ||
| } | ||
|
|
||
| export async function getCursorStatus(): Promise<CursorStatus> { | ||
| const provider = new CursorProvider({}); | ||
| const installStatus = await provider.detectInstallation(); | ||
| // Determine auth method | ||
| let authMethod = 'none'; | ||
| if (installStatus.authenticated) { | ||
| authMethod = process.env.CURSOR_API_KEY ? 'api_key_env' : 'oauth'; | ||
| } | ||
| return { | ||
| status: installStatus.installed ? 'installed' : 'not_installed', | ||
| installed: installStatus.installed, | ||
| method: installStatus.method || 'none', | ||
| version: installStatus.version || '', | ||
| path: installStatus.path || '', | ||
| auth: { | ||
| authenticated: installStatus.authenticated || false, | ||
| method: authMethod, | ||
| hasApiKey: installStatus.hasApiKey || false, | ||
| }, | ||
| }; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| /** | ||
| * GET /cursor-status endpoint - Get Cursor CLI status | ||
| */ | ||
|
|
||
| import type { Request, Response } from 'express'; | ||
| import { getCursorStatus } from '../get-cursor-status.js'; | ||
| import { getErrorMessage, logError } from '../common.js'; | ||
|
|
||
| export function createCursorStatusHandler() { | ||
| return async (_req: Request, res: Response): Promise<void> => { | ||
| try { | ||
| const status = await getCursorStatus(); | ||
| res.json({ | ||
| success: true, | ||
| ...status, | ||
| }); | ||
| } catch (error) { | ||
| logError(error, 'Get Cursor status failed'); | ||
| res.status(500).json({ success: false, error: getErrorMessage(error) }); | ||
| } | ||
| }; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file contains complex logic to detect the
cursor-agentCLI installation path. This logic is duplicated and more advanced than the detection logic withinCursorProvideritself.As mentioned in my other comment on
cursor-provider.ts, this can cause inconsistencies where the CLI is detected for status checks but not found for execution.This detection logic should be moved into the
CursorProviderclass to act as a single source of truth for interacting with thecursor-agentCLI. This file'sgetCursorStatusfunction could then be a thin wrapper around a method on theCursorProvider.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 656dde2 - this file now uses
CursorProvider.detectInstallation()as the single source of truth. Reduced from 129 lines to 41 lines.