Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions ai-tools/cursor.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Cursor Integration"
description: "Use Cursor as an agent provider in ADE — launch sessions, route models, and track work through the Agent Control Protocol (ACP)."
description: "Use Cursor as an agent provider in ADE — launch sessions, route models, and track work through the Cursor SDK."
icon: "arrow-pointer"
---

Expand All @@ -9,21 +9,21 @@ icon: "arrow-pointer"
ADE integrates with [Cursor](https://cursor.com) in two ways:

1. **Launch Cursor from ADE** — open your project or a lane's worktree in Cursor from the Run tab
2. **Cursor as an agent provider** — use Cursor's AI agent as a chat provider inside ADE via the Agent Control Protocol (ACP)
2. **Cursor as an agent provider** — use Cursor's AI agent as a chat provider inside ADE via the Cursor SDK

The ACP integration means Cursor's agent capabilities are available directly in ADE's chat interface, alongside Claude, Codex, and other providers. You can switch between providers per-session.
The SDK integration means Cursor's agent capabilities are available directly in ADE's chat interface, alongside Claude, Codex, and other providers. You can switch between providers per-session.

---

## Requirements

| Requirement | Details |
|------------|---------|
| **Cursor installed** | Cursor desktop app must be installed on your machine |
| **Cursor agent CLI** | The Cursor `agent` executable must be available (ADE checks standard install paths and PATH) |
| **Authentication** | Cursor must be authenticated — either sign in through the Cursor app or set `CURSOR_API_KEY` / `CURSOR_AUTH_TOKEN` environment variables |
| **Cursor installed** | Cursor desktop app must be installed to launch Cursor from ADE |
| **Cursor SDK auth** | Cursor chat requires `CURSOR_API_KEY` or a Cursor API key saved in ADE Settings |
| **Authentication** | ADE uses API-key authentication for Cursor chat. Cursor desktop sign-in is only needed for launching the editor. |

ADE auto-detects the Cursor CLI executable and checks authentication status during onboarding and in **Settings → AI**. When environment-based credentials (`CURSOR_API_KEY` or `CURSOR_AUTH_TOKEN`) are present, ADE recognizes them as valid authentication signals and the AI status indicator in Settings may reflect those variables rather than an interactive sign-in session.
ADE checks Cursor API-key authentication during onboarding and in **Settings → AI**. When `CURSOR_API_KEY` is present, ADE recognizes it as a valid authentication signal. You can also save the key in ADE's encrypted provider settings.

---

Expand All @@ -35,16 +35,16 @@ The session is linked back to the active lane for tracking. File changes made in

---

## Cursor as an agent provider (ACP)
## Cursor as an agent provider

When Cursor's agent executable is detected, ADE can use it as a chat provider through the **Agent Control Protocol (ACP)**.
When Cursor API-key auth is configured, ADE can use Cursor as a chat provider through the **Cursor SDK**.

### How it works

1. ADE resolves the Cursor agent executable path (checks standard install locations and PATH)
2. An ACP session pool manages connections to the Cursor agent process
3. Chat messages are routed through the ACP protocol, and the Cursor agent has access to the `ade` CLI for ADE workflows
4. Model discovery queries Cursor for available models and capabilities
1. ADE starts an isolated SDK worker for the active lane
2. The worker creates or resumes a Cursor SDK agent with the selected model
3. Chat messages are routed through SDK runs, and Cursor has access to the `ade` CLI for ADE workflows
4. Model discovery queries Cursor SDK metadata for available models and capabilities

### Selecting Cursor in chat

Expand All @@ -61,10 +61,10 @@ ADE queries Cursor for its available models at startup and caches the result. Th

| Behavior | Details |
|----------|---------|
| **Session lifecycle** | Managed by the ACP pool; sessions are reused when possible |
| **Event mapping** | ACP events are mapped to ADE's chat event model for consistent UI |
| **Session lifecycle** | Managed by the Cursor SDK pool; sessions are reused when possible |
| **Event mapping** | SDK events are mapped to ADE's chat event model for consistent UI |
| **ADE CLI access** | The `ade` CLI is on `PATH` so Cursor agents can call ADE lane, git, PR, and action tools |
| **Interrupts** | Supported via ACP session cancel |
| **Interrupts** | Supported via SDK run cancel |

---

Expand All @@ -74,25 +74,25 @@ ADE shows Cursor's connection status in **Settings → AI**:

| Status | Meaning |
|--------|---------|
| **Connected** (green) | Cursor agent executable found, authenticated, and ready |
| **CLI found, not authenticated** (amber) | Cursor is installed but not signed in — sign in through the Cursor app |
| **Not found** (gray) | Cursor CLI not detected — install Cursor or add it to PATH |
| **Connected** (green) | Cursor API key found and ready |
| **Not authenticated** (amber) | Cursor API key is missing or invalid |
| **Not found** (gray) | Cursor desktop is not detected for editor launch |

---

## Troubleshooting

<AccordionGroup>
<Accordion title="Cursor not detected" icon="circle-question">
ADE checks standard installation paths for the Cursor agent executable. If Cursor is installed in a non-standard location, ensure the `agent` command (Cursor agent CLI) is available in your PATH. You can verify by running `which agent` (macOS/Linux) or `where agent` (Windows) in a terminal. If neither works, try running `agent --version` directly — if the command is not found, add the directory containing the `agent` binary to your PATH environment variable.
ADE checks standard installation paths for the Cursor desktop app when launching the editor. If Cursor is installed in a non-standard location, open the project directly from Cursor or add the app to the standard Applications location.
</Accordion>
<Accordion title="Authentication failed" icon="lock">
Open the Cursor desktop app and sign in. ADE detects Cursor's auth status through the CLI — it does not manage Cursor credentials directly.
Add a Cursor API key in **Settings → AI Providers** or set `CURSOR_API_KEY` in the environment used to launch ADE.
</Accordion>
<Accordion title="Models not appearing" icon="list">
Model discovery runs at ADE startup. If you installed Cursor after starting ADE, restart ADE or go to **Settings → AI** and click **Refresh** to re-run model discovery.
</Accordion>
<Accordion title="Session errors" icon="circle-exclamation">
If ACP sessions fail, check that Cursor is running and authenticated. The ACP pool retries connections with backoff. Check ADE's developer logs (**Settings → Developer → Log file**) for detailed ACP error messages.
If SDK sessions fail, check that the Cursor API key is configured and that the selected model is available. Check ADE's developer logs (**Settings → Developer → Log file**) for detailed SDK worker errors.
</Accordion>
</AccordionGroup>
4 changes: 2 additions & 2 deletions ai-tools/windsurf.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ ADE supports multiple external AI tools. Here is how Windsurf compares:
|-----------|----------|--------|-------------|
| **Launch from ADE** | Yes | Yes | Yes |
| **Session tracking** | Yes | Yes | Yes |
| **Agent provider in ADE chat** | No | Yes (via ACP) | Yes (via CLI) |
| **Agent provider in ADE chat** | No | Yes (via SDK) | Yes (via CLI) |
| **ADE CLI access** | No | Yes | Yes |
| **Model routing through ADE** | No | Yes | Yes |

Windsurf is a good choice when you want to use Codeium's AI features directly in the editor while keeping the session tracked in ADE. For deeper integration where ADE manages the AI agent lifecycle, use Cursor (via ACP) or Claude Code (via CLI).
Windsurf is a good choice when you want to use Codeium's AI features directly in the editor while keeping the session tracked in ADE. For deeper integration where ADE manages the AI agent lifecycle, use Cursor (via SDK) or Claude Code (via CLI).

---

Expand Down
9 changes: 6 additions & 3 deletions apps/desktop/native/ios-sim-helpers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ streaming and touch input on macOS.
Indigo; unsupported keyboard/text operations are reported as typed failures so
ADE can fall back to idb for that method.
- `build.sh` compiles both helpers lazily into `build/xcode-<version>-<hash>/`.
Set `ADE_IOS_SIM_HELPER_BUILD_ROOT` to place that cache somewhere else;
packaged ADE builds use this to keep generated binaries outside the signed
`.app` bundle.

These helpers intentionally use Apple private frameworks. They are local
developer tooling, not app runtime code. Keep the supported Xcode major-version
set explicit in `iosSimulatorService.ts`, and expand it only after testing the
helpers against that Xcode. `iosurface-indigo` is currently gated off in
packaged ADE builds until the helper signing/notarization story is cleared; set
`ADE_IOS_SURFACE_ALLOW_PACKAGED=1` only for explicit packaging experiments.
helpers against that Xcode. Packaged ADE builds ship these sources as resources
and compile the selected-Xcode helper binaries into the user's ADE cache at
runtime.

To rebuild manually:

Expand Down
11 changes: 10 additions & 1 deletion apps/desktop/native/ios-sim-helpers/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BUILD_ROOT="$SCRIPT_DIR/build"
BUILD_ROOT="${ADE_IOS_SIM_HELPER_BUILD_ROOT:-"$SCRIPT_DIR/build"}"
PRINT_JSON=0
SMOKE=0

Expand Down Expand Up @@ -82,6 +82,15 @@ if [[ ! -x "$CAPTURE" || ! -x "$INPUT" ]]; then
-o "$INPUT"
fi

if command -v codesign >/dev/null 2>&1; then
if ! codesign --force --sign - "$CAPTURE" >/dev/null 2>&1; then
echo "warning: failed to ad-hoc sign $CAPTURE" >&2
fi
if ! codesign --force --sign - "$INPUT" >/dev/null 2>&1; then
echo "warning: failed to ad-hoc sign $INPUT" >&2
fi
fi

if [[ "$SMOKE" == "1" ]]; then
"$CAPTURE" --smoke-test >/dev/null
"$INPUT" --smoke-test >/dev/null
Expand Down
15 changes: 14 additions & 1 deletion apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"test:coverage": "vitest run --coverage",
"test:orchestrator-smoke": "vitest run src/main/services/orchestrator/orchestratorSmoke.test.ts --reporter=verbose",
"test:orchestrator-complex-mock": "vitest run src/main/services/orchestrator/orchestratorSmoke.test.ts -t \"complex mock prompt\" --reporter=verbose",
"test:chat-model-runtime-audit": "node ./scripts/audit-chat-model-runtime.mjs --mode=dry-run --max-per-provider=2",
"ade:dev": "npm --prefix ../ade-cli run dev -- --project-root ../..",
"ade:build": "npm --prefix ../ade-cli run build",
"ade:typecheck": "npm --prefix ../ade-cli run typecheck",
Expand Down Expand Up @@ -227,7 +228,19 @@
"entitlementsInherit": "build/entitlements.mac.inherit.plist",
"notarize": true,
"mergeASARs": false,
"x64ArchFiles": "Contents/Resources/app.asar.unpacked/{node_modules,vendor}/**/*"
"x64ArchFiles": "Contents/Resources/app.asar.unpacked/{node_modules,vendor}/**/*",
"extraResources": [
{
"from": "native/ios-sim-helpers",
"to": "native/ios-sim-helpers",
"filter": [
"README.md",
"build.sh",
"sim-capture.swift",
"sim-input.m"
]
}
]
}
}
}
6 changes: 6 additions & 0 deletions apps/desktop/scripts/after-pack-runtime-fixes.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,16 @@ module.exports = async function afterPack(context) {
if (platform === "darwin") {
const bundledCliBinPath = path.join(resourcesRoot, "ade-cli", "bin", "ade");
const bundledCliInstallerPath = path.join(resourcesRoot, "ade-cli", "install-path.sh");
const iosSimHelperRoot = path.join(resourcesRoot, "native", "ios-sim-helpers");
const iosSimHelperBuildScript = path.join(iosSimHelperRoot, "build.sh");
requireFile(bundledCliBinPath, "bundled ADE CLI wrapper");
requireFile(bundledCliInstallerPath, "bundled ADE CLI PATH installer");
requireFile(iosSimHelperBuildScript, "bundled iOS simulator helper build script");
requireFile(path.join(iosSimHelperRoot, "sim-capture.swift"), "bundled iOS simulator capture helper source");
requireFile(path.join(iosSimHelperRoot, "sim-input.m"), "bundled iOS simulator input helper source");
fs.chmodSync(bundledCliBinPath, 0o755);
fs.chmodSync(bundledCliInstallerPath, 0o755);
fs.chmodSync(iosSimHelperBuildScript, 0o755);
} else if (platform === "win32") {
requireFile(path.join(resourcesRoot, "ade-cli", "bin", "ade.cmd"), "bundled ADE CLI Windows wrapper");
requireFile(path.join(resourcesRoot, "ade-cli", "install-path.cmd"), "bundled ADE CLI Windows PATH installer");
Expand Down
Loading
Loading