feat(cursor): split legacy bridge from cliproxy provider

This commit is contained in:
Tam Nhu Tran committed 2026-04-15 17:04:37 -04:00
1 parent 1bad3b0305
commit 3b5941c60b
36 files changed
+974 -155

No files matched your search

+16 -7
View File
@@ -202,7 +202,14 @@ describe('ProfileDetector', () => {
}
});
it('should detect cursor as a first-class runtime profile when enabled', () => {
it('should detect cursor as a CLIProxy provider shortcut', () => {
const result = detector.detectProfileType('cursor');
expect(result.type).toBe('cliproxy');
expect(result.name).toBe('cursor');
expect(result.provider).toBe('cursor');
});
it('should detect legacy-cursor as a first-class runtime profile when enabled', () => {
const isUnifiedModeSpy = spyOn(unifiedConfigLoader, 'isUnifiedMode').mockReturnValue(true);
const getCursorConfigSpy = spyOn(unifiedConfigLoader, 'getCursorConfig').mockReturnValue({
enabled: true,
@@ -213,9 +220,9 @@ describe('ProfileDetector', () => {
});
try {
const result = detector.detectProfileType('cursor');
const result = detector.detectProfileType('legacy-cursor');
expect(result.type).toBe('cursor');
expect(result.name).toBe('cursor');
expect(result.name).toBe('legacy-cursor');
expect(result.cursorConfig?.auto_start).toBe(true);
} finally {
isUnifiedModeSpy.mockRestore();
@@ -223,7 +230,7 @@ describe('ProfileDetector', () => {
}
});
it('should merge default cursor fields when enabled via partial unified config', () => {
it('should merge default legacy cursor fields when enabled via partial unified config', () => {
const originalCcsHome = process.env.CCS_HOME;
process.env.CCS_HOME = tempDir;
const ccsDir = path.join(tempDir, '.ccs');
@@ -235,7 +242,7 @@ describe('ProfileDetector', () => {
try {
const localDetector = new ProfileDetector();
const result = localDetector.detectProfileType('cursor');
const result = localDetector.detectProfileType('legacy-cursor');
expect(result.type).toBe('cursor');
expect(result.cursorConfig).toEqual({
enabled: true,
@@ -253,7 +260,7 @@ describe('ProfileDetector', () => {
}
});
it('should throw a helpful error when cursor profile is disabled', () => {
it('should throw a helpful error when legacy cursor profile is disabled', () => {
const isUnifiedModeSpy = spyOn(unifiedConfigLoader, 'isUnifiedMode').mockReturnValue(true);
const getCursorConfigSpy = spyOn(unifiedConfigLoader, 'getCursorConfig').mockReturnValue({
enabled: false,
@@ -264,7 +271,9 @@ describe('ProfileDetector', () => {
});
try {
expect(() => detector.detectProfileType('cursor')).toThrow(/Cursor profile is not enabled/);
expect(() => detector.detectProfileType('legacy-cursor')).toThrow(
/Legacy Cursor profile is not enabled/
);
} finally {
isUnifiedModeSpy.mockRestore();
getCursorConfigSpy.mockRestore();