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

@@ -684,10 +684,13 @@ pub struct ExternalAgentConfigDetectParams {
/// Zero or more working directories to include for repo-scoped detection.
#[ts(optional = nullable)]
pub cwds: Option<Vec<PathBuf>>,
/// Optional import-source selector. Missing or unrecognized values use the default source for
/// backwards compatibility.
/// Deprecated field retained for compatibility. This field is ignored; use `migrationSource`
/// to select the migration source.
#[ts(optional = nullable)]
pub source: Option<String>,
/// Optional migration-source selector. Missing or unrecognized values use the default source.
#[ts(optional = nullable)]
pub migration_source: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
@@ -695,11 +698,13 @@ pub struct ExternalAgentConfigDetectParams {
#[ts(export_to = "v2/")]
pub struct ExternalAgentConfigImportParams {
pub migration_items: Vec<ExternalAgentConfigMigrationItem>,
/// Import-source selector used to produce the migration items. Pass the same value to detection
/// and import; missing or unrecognized values use the default source for backwards
/// compatibility.
/// Optional identifier for the product that initiated the import.
#[ts(optional = nullable)]
pub source: Option<String>,
/// Migration-source selector used to produce the migration items. Pass the same value to
/// detection and import; missing or unrecognized values use the default source.
#[ts(optional = nullable)]
pub migration_source: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
@@ -435,6 +435,7 @@ fn external_agent_config_import_params_accept_legacy_plugin_details() {
}),
}],
source: None,
migration_source: None,
}
);
}