Add Cursor support to setup import (#33426)

## What changed

- Detect and import supported Cursor settings, sandbox permissions, MCP servers,
  project instructions, hooks, agents, commands, plugins, and recent chat
  sessions.
- Update the `/import` flow to check Claude Code and Cursor, prompting for a
  source when both have importable data.
- Add `migrationSource` to the app-server detect and import requests so each
  operation uses the selected adapter, while retaining `source` for import
  attribution and backwards compatibility.

## Testing

- Add coverage for Cursor config conversion, hooks, plugins, session discovery
  and conversion, app-server imports, and TUI source selection.

GitOrigin-RevId: a65a1511b6c1c2f9e3e0cfe4f816bb435807282e
This commit is contained in:
charlesgong-openai authored and copyberry committed 2026-07-15 21:03:49 +00:00
1 parent 0f2321f244
commit 1c4af96394
47 files changed
+2962 -247

No files matched your search

@@ -0,0 +1,42 @@
use super::*;
use crate::test_backend::VT100Backend;
use crossterm::event::KeyEvent;
use crossterm::event::KeyModifiers;
use pretty_assertions::assert_eq;
use ratatui::Terminal;
fn new_screen() -> ExternalAgentConfigSourceScreen {
ExternalAgentConfigSourceScreen::new(
FrameRequester::test_dummy(),
&ExternalAgentConfigMigrationSource::ALL,
)
}
#[test]
fn external_agent_config_source_prompt_snapshot() {
let screen = new_screen();
let mut terminal =
Terminal::new(VT100Backend::new(/*width*/ 80, /*height*/ 12)).expect("terminal");
terminal
.draw(|frame| frame.render_widget_ref(&screen, frame.area()))
.expect("render source prompt");
insta::assert_snapshot!("external_agent_config_source_prompt", terminal.backend());
}
#[test]
fn external_agent_config_source_prompt_selects_highlighted_source() {
let mut screen = new_screen();
screen.handle_key(KeyEvent::new(KeyCode::Down, KeyModifiers::NONE));
screen.handle_key(KeyEvent::new(KeyCode::Enter, KeyModifiers::NONE));
assert_eq!(
screen.selection(),
Some(ExternalAgentConfigMigrationSource::Cur)
);
}
#[test]
fn external_agent_config_source_prompt_can_cancel() {
let mut screen = new_screen();
screen.handle_key(KeyEvent::new(KeyCode::Esc, KeyModifiers::NONE));
assert_eq!(screen.selection(), None);
}