an open-source alternative to the dots, bots and muses of the world, run an office of claude code/codex like agents on your laptop, sandboxes or anywhere, uses your existing subscriptions
HTML agent-harnessagent-orchestrationagentsai-agentsautonomous-agentsclaude-codecodexcoding-agentsdesktop-appdeveloper-toolselectrongemini-cliharnessharness-engineeringlocal-firstmemorymulti-agentopencodeorchestrationtypescript
feat(provider): add Cursor Agent CLI (`agent`) engine preset
George Burchellf65f5bba0350
diff --git a/src/main/realtimeActions.ts b/src/main/realtimeActions.tsindex 9c10ed68..0f146eb6 100644--- a/src/main/realtimeActions.ts+++ b/src/main/realtimeActions.ts@@ -160,7 +160,8 @@ const PENDING_TTL_MS = 120_000;const PROVIDER_COMMAND: Record<string, string> = {claude: 'claude', codex: 'codex', antigravity: 'antigravity', gemini: 'gemini',- opencode: 'opencode', crush: 'crush', pi: 'pi', qwen: 'qwen', copilot: 'copilot'+ opencode: 'opencode', crush: 'crush', pi: 'pi', qwen: 'qwen', copilot: 'copilot',+ cursor: 'agent'};/** Bare affirmations that must NEVER authorize a destructive op on their own —diff --git a/src/renderer/src/components/OnboardingWizard.tsx b/src/renderer/src/components/OnboardingWizard.tsxindex c592e9cb..6894f40b 100644--- a/src/renderer/src/components/OnboardingWizard.tsx+++ b/src/renderer/src/components/OnboardingWizard.tsx@@ -28,9 +28,9 @@ interface Feature {const FEATURES: Feature[] = [{icon: 'mcp',- label: 'TEN ENGINES, ONE OFFICE',- desc: 'Claude Code, Codex, Grok, Kimi, Antigravity, Qwen, OpenCode, Crush, pi & Copilot — live agents on one floor.',- descPlain: 'Ten AI assistants — Claude, Codex, Gemini, Grok and more — working side by side in one shared office.',+ label: 'ELEVEN ENGINES, ONE OFFICE',+ desc: 'Claude Code, Codex, Grok, Kimi, Antigravity, Qwen, OpenCode, Crush, pi, Copilot & Cursor — live agents on one floor.',+ descPlain: 'Eleven AI assistants — Claude, Codex, Cursor, Gemini, Grok and more — working side by side in one shared office.',tint: 'var(--cth-lilac-light)', edge: 'var(--cth-lilac)'},{@@ -76,7 +76,8 @@ const PROVIDER_BLURB: Partial<Record<AgentProvider, string>> = {claude: 'Claude Code — Anthropic',codex: 'Codex — OpenAI',antigravity: 'Antigravity — Google Gemini',- qwen: 'Qwen — runs a local Qwen model on your machine'+ qwen: 'Qwen — runs a local Qwen model on your machine',+ cursor: 'Cursor Agent CLI — uses your Cursor credits (Luna, Composer, …)'};export function OnboardingWizard({ onComplete }: OnboardingWizardProps) {diff --git a/src/renderer/src/realtime/actions.ts b/src/renderer/src/realtime/actions.tsindex 57066a57..552fbbe1 100644--- a/src/renderer/src/realtime/actions.ts+++ b/src/renderer/src/realtime/actions.ts@@ -187,7 +187,7 @@ export function realtimeActionTools(): ReturnType<typeof tool>[] {parameters: {type: 'object',properties: {- provider: { type: 'string', description: 'Engine: claude (default), codex, gemini, opencode, crush, pi, qwen, copilot.' },+ provider: { type: 'string', description: 'Engine: claude (default), codex, gemini, opencode, crush, pi, qwen, copilot, cursor.' },role: { type: 'string', description: 'Optional. The role/job for the new agent.' },name: { type: 'string', description: 'Optional. A name for the agent.' },cwd: { type: 'string', description: 'Optional. Working directory; defaults to the hive root.' }diff --git a/src/renderer/src/store/config.ts b/src/renderer/src/store/config.tsindex abe1a75b..e35af49e 100644--- a/src/renderer/src/store/config.ts+++ b/src/renderer/src/store/config.ts@@ -276,6 +276,23 @@ export const COPILOT_MODELS: ModelOption[] = [{ id: 'gpt-5', label: 'GPT-5' }];+/** Models offered when an agent runs on Cursor Agent CLI (`agent`). Ids match+ * `agent models` / `--model` (Cursor account catalog). Luna is the cheap,+ * high-context default for Michael; other entries are curated quick-picks —+ * the command field stays editable for any live slug. */+export const CURSOR_MODELS: ModelOption[] = [+ { id: undefined, label: 'CLI default (auto)' },+ { id: 'auto', label: 'Auto' },+ { id: 'gpt-5.6-luna-high', label: 'GPT-5.6 Luna 1M High (cheap)' },+ { id: 'gpt-5.6-sol-medium', label: 'GPT-5.6 Sol 1M' },+ { id: 'gpt-5.6-sol-high', label: 'GPT-5.6 Sol 1M High' },+ { id: 'composer-2.5', label: 'Composer 2.5' },+ { id: 'composer-2.5-fast', label: 'Composer 2.5 Fast' },+ { id: 'gpt-5.2', label: 'GPT-5.2' },+ { id: 'claude-opus-4-8-high', label: 'Opus 4.8 1M' },+ { id: 'claude-sonnet-5-thinking-high', label: 'Sonnet 5 1M Thinking' }+];+/** Models reported by the installed Grok CLI (`grok models`). */export const GROK_MODELS: ModelOption[] = [// No `--model` flag at all — whatever the CLI itself defaults to. NOT the@@ -318,6 +335,7 @@ export function modelsForProvider(provider: AgentProvider): ModelOption[] {if (provider === 'crush') return CRUSH_MODELS;if (provider === 'pi') return PI_MODELS;if (provider === 'copilot') return COPILOT_MODELS;+ if (provider === 'cursor') return CURSOR_MODELS;if (provider === 'custom') return [];return AGENT_MODELS;}diff --git a/src/shared/agentProvider.ts b/src/shared/agentProvider.tsindex aa41c58f..d0da5c79 100644--- a/src/shared/agentProvider.ts+++ b/src/shared/agentProvider.ts@@ -32,6 +32,7 @@ export type AgentProvider =| 'crush'| 'pi'| 'copilot'+ | 'cursor'| 'custom';/** Structured descriptor for how a NON-hiveAware provider gets hive lifecycle@@ -465,6 +466,44 @@ export const AGENT_PROVIDER_PRESETS: AgentProviderPreset[] = [installCommand: 'npm install -g @github/copilot', // trusted, hardcodeddocsUrl: 'https://docs.github.com/copilot/concepts/agents/about-copilot-cli'},+ {+ // Cursor Agent CLI (`agent`, https://cursor.com/docs/cli). Interactive TUI by+ // default (no `-p`), so the session stays alive for hive mail via the renderer+ // idle / work-order path — same class as Crush. Print mode (`agent -p`) is+ // available for scripts but exits per turn; this preset intentionally does+ // NOT use `-p` so Michael and workers remain god-eligible / inbox-capable.+ // Models (including cheap gpt-5.6-luna-*) bill against Cursor credits via the+ // logged-in CLI — there is no separate "plain OpenAI API" path for Luna.+ id: 'cursor',+ label: 'Cursor',+ defaultCommand: 'agent',+ commandGroups: [],+ // --force/--yolo: allow tool calls without confirmations. --trust: skip the+ // workspace trust prompt so unattended Mac Mini spawns do not stall. Gated by+ // the floor config.autoMode toggle like every other engine.+ autoModeFlag: '--force --trust',+ autoFlag: '--force --trust',+ supportsModel: true,+ modelFlag: '--model', // e.g. gpt-5.6-luna-high, auto, composer-2.5+ hiveAware: false,+ // No Cursor hook bridge yet — mail delivery uses the terminal work-order /+ // idle-nudge fallback (same honesty as Crush before its proxy is verified).+ canReceiveInbox: true,+ // `agent` parses early argv as Cobra-style commands (login, models, mcp, …).+ // A long hive protocol string must NOT ride as a positional — type it into+ // the TUI after boot instead (Crush pattern).+ initialPromptFlag: undefined,+ seedDelivery: 'type-into-tui',+ recommendedOrchestratorModel: 'gpt-5.6-luna-high',+ resumeFlag: '--resume',+ // Official install is a curl|bash script (not npm). Prefer the native rung so+ // a node-free machine can still self-heal. Trusted hardcoded constants only.+ nativeInstallCommand: {+ posix: 'curl https://cursor.com/install -fsS | bash',+ win32: 'irm https://cursor.com/install?win32=true | iex'+ },+ docsUrl: 'https://cursor.com/docs/cli/install'+ },{id: 'custom',label: 'Custom',@@ -490,6 +529,7 @@ export function isAgentProvider(value: unknown): value is AgentProvider {value === 'crush' ||value === 'pi' ||value === 'copilot' ||+ value === 'cursor' ||value === 'custom');}@@ -540,6 +580,8 @@ export function inferAgentProvider(command: string | undefined, explicit?: unknoif (bin === 'crush') return 'crush';if (bin === 'pi') return 'pi';if (bin === 'copilot') return 'copilot';+ // Cursor ships as `agent` (and sometimes `cursor-agent` on older installs).+ if (bin === 'agent' || bin === 'cursor-agent') return 'cursor';if (bin === 'claude' || !bin) return 'claude';return 'custom';}diff --git a/src/shared/providerAutomation.ts b/src/shared/providerAutomation.tsindex e25dff1b..1ea40922 100644--- a/src/shared/providerAutomation.ts+++ b/src/shared/providerAutomation.ts@@ -133,6 +133,12 @@ const CONTEXT_COMMANDS: Record<AgentProvider, ProviderContextCommands> = {// into, so both are null by construction rather than by ignorance.copilot: NO_CONTEXT_COMMANDS,+ // Cursor Agent CLI (`agent`) is interactive in this preset, but its slash /+ // command surface is not yet verified against a frozen binary catalog in-repo.+ // Prefer null over guessing — wrong slashes into a live TUI are worse than no+ // auto-compact. Revisit when a shipped command table is transcribed.+ cursor: NO_CONTEXT_COMMANDS,+// An arbitrary user binary. We cannot know its command surface, and guessing// means typing slashes into someone's unknown REPL.custom: NO_CONTEXT_COMMANDSdiff --git a/test/agent-provider.test.cjs b/test/agent-provider.test.cjsindex aa82d5ed..03406cfe 100644--- a/test/agent-provider.test.cjs+++ b/test/agent-provider.test.cjs@@ -62,6 +62,32 @@ test('copilot passes model + resume through, non-hiveAware, never auto-receivesassert.strictEqual(ap.bridgeOf('copilot'), undefined, 'no hook/proxy bridge');});+test('cursor is a recognized, selectable, god-eligible provider', () => {+ assert.ok(ap.isAgentProvider('cursor'), 'isAgentProvider("cursor")');+ assert.ok(ap.AGENT_PROVIDER_PRESETS.some((p) => p.id === 'cursor'), 'preset registered');+ assert.strictEqual(ap.canReceiveInbox('cursor'), true, 'interactive TUI can receive inbox');+});++test('inferAgentProvider maps the agent / cursor-agent binary to cursor', () => {+ assert.strictEqual(ap.inferAgentProvider('agent'), 'cursor');+ assert.strictEqual(ap.inferAgentProvider('/Users/me/.local/bin/agent --model gpt-5.6-luna-high'), 'cursor');+ assert.strictEqual(ap.inferAgentProvider('cursor-agent'), 'cursor');+});++test('cursor preset is interactive (no -p), uses force+trust auto flags, types seed into TUI', () => {+ const p = ap.providerPreset('cursor');+ assert.strictEqual(p.defaultCommand, 'agent', 'default command binary');+ assert.strictEqual(p.initialPromptFlag, undefined, 'no -p; stay interactive');+ assert.strictEqual(p.seedDelivery, 'type-into-tui', 'hive protocol typed after boot');+ assert.strictEqual(ap.autoModeFlagForProvider('cursor'), '--force --trust');+ assert.strictEqual(p.autoFlag, '--force --trust', 'autoFlag mirrors autoModeFlag');+ assert.strictEqual(p.recommendedOrchestratorModel, 'gpt-5.6-luna-high');+ assert.ok(p.supportsModel && p.modelFlag === '--model', 'model picker + --model');+ assert.strictEqual(p.resumeFlag, '--resume', 'session resume flag');+ assert.strictEqual(p.hiveAware, false, 'no Claude-only identity injection');+ assert.strictEqual(ap.bridgeOf('cursor'), undefined, 'no hook/proxy bridge yet');+});+test('codex preset still resolves (no regression)', () => {assert.strictEqual(ap.inferAgentProvider('codex'), 'codex');assert.strictEqual(ap.providerPreset('codex').defaultCommand, 'codex');diff --git a/test/cli-install-ladder.test.cjs b/test/cli-install-ladder.test.cjsindex d319e2a5..499ea136 100644--- a/test/cli-install-ladder.test.cjs+++ b/test/cli-install-ladder.test.cjs@@ -34,6 +34,17 @@ test('with npm absent, a provider shipping a native installer uses it', () => {assert.doesNotMatch(rung.command, /\bnpm\b/, 'the whole point is that npm is not there');});+test('cursor prefers its native curl installer (no npm package)', () => {+ const info = installInfoForProvider('cursor');+ assert.equal(info.command, undefined, 'cursor is not an npm global package');+ assert.ok(info.nativeCommand, 'ships curl|bash / irm|iex installer');+ const withNpm = chooseInstallRung(info, true);+ assert.equal(withNpm.kind, 'native', 'native rung even when npm exists');+ const withoutNpm = chooseInstallRung(info, false);+ assert.equal(withoutNpm.kind, 'native');+ assert.match(withoutNpm.command, /cursor\.com\/install/);+});+test('with npm absent and no native installer, NOTHING is run', () => {const info = installInfoForProvider('codex');assert.equal(info.nativeCommand, undefined, 'fixture assumes codex has no native installer');diff --git a/test/provider-automation.test.cjs b/test/provider-automation.test.cjsindex c93848a9..09ce203e 100644--- a/test/provider-automation.test.cjs+++ b/test/provider-automation.test.cjs@@ -17,7 +17,7 @@ const {// — the queue's one-pending-compact invariant depends entirely on this predicate —test('isCompactionCommand matches every provider that has a compact verb', () => {- for (const p of ['claude', 'codex', 'grok', 'kimi', 'qwen', 'opencode', 'pi', 'copilot']) {+ for (const p of ['claude', 'codex', 'grok', 'kimi', 'qwen', 'opencode', 'pi', 'copilot', 'cursor']) {const cmd = compactionCommandForProvider(p, '');if (!cmd) continue; // provider has no typeable compaction — nothing to dedupeassert.equal(isCompactionCommand(cmd), true, `${p}: ${cmd}`);@@ -58,7 +58,7 @@ test('each provider receives only its supported compaction syntax', () => {assert.equal(compactionCommandForProvider('pi', ''), '/compact');// No command we can trust → no keystrokes at all.- for (const p of ['antigravity', 'crush', 'copilot', 'custom']) {+ for (const p of ['antigravity', 'crush', 'copilot', 'cursor', 'custom']) {assert.equal(compactionCommandForProvider(p), null, p);}});@@ -95,8 +95,8 @@ test('clearing uses each CLI own verb, not a hardcoded /clear', () => {assert.equal(clearCommandForProvider('grok'), '/new');assert.equal(clearCommandForProvider('opencode'), '/new');assert.equal(clearCommandForProvider('pi'), '/new');- // Palette-only TUI, print-mode CLI, unknown binary: nothing typed can land.- for (const p of ['crush', 'copilot', 'custom']) {+ // Palette-only TUI, print-mode CLI, Cursor (unverified slash surface), unknown binary.+ for (const p of ['crush', 'copilot', 'cursor', 'custom']) {assert.equal(clearCommandForProvider(p), null, p);}});diff --git a/test/provider-config.test.cjs b/test/provider-config.test.cjsindex 3448145b..a2661e2c 100644--- a/test/provider-config.test.cjs+++ b/test/provider-config.test.cjs@@ -103,12 +103,13 @@ test('Command Center model choices round-trip provider and model', () => {test('God only sees providers that can drain hive inbox messages', () => {// God-eligible = supportsModel && canReceiveInbox: kimi and copilot are// excluded (no inbox drain path), custom is excluded (no model picker).+ // Cursor is interactive (no -p) so it IS god-eligible.assert.deepEqual(modelProvidersForAgent(true).map((preset) => preset.id),- ['claude', 'codex', 'grok', 'antigravity', 'qwen', 'opencode', 'crush', 'pi']+ ['claude', 'codex', 'grok', 'antigravity', 'qwen', 'opencode', 'crush', 'pi', 'cursor']);assert.deepEqual(modelProvidersForAgent(false).map((preset) => preset.id),- ['claude', 'codex', 'grok', 'kimi', 'antigravity', 'qwen', 'opencode', 'crush', 'pi', 'copilot']+ ['claude', 'codex', 'grok', 'kimi', 'antigravity', 'qwen', 'opencode', 'crush', 'pi', 'copilot', 'cursor']);});