Skip to content

Fleet

Defined in: packages/agentic-control/src/fleet/fleet.ts:86

Fleet management for Cursor Background Agents

Provides high-level operations for managing AI agents across multiple GitHub organizations with automatic token switching and coordination.

const fleet = new Fleet();
// Spawn a new agent
const result = await fleet.spawn({
repository: 'https://github.com/owner/repo',
task: 'Fix the authentication bug',
target: { autoCreatePr: true }
});
// Monitor agent status
const status = await fleet.status(result.data.id);

new Fleet(config?): Fleet

Defined in: packages/agentic-control/src/fleet/fleet.ts:96

Create a new Fleet instance

FleetConfig = {}

Fleet configuration options including API key and timeout

Fleet

archive(agentId, outputPath?): Promise<Result<string>>

Defined in: packages/agentic-control/src/fleet/fleet.ts:278

Archive agent conversation to disk

string

string

Promise<Result<string>>


broadcast(agentIds, message): Promise<Map<string, Result<void>>>

Defined in: packages/agentic-control/src/fleet/fleet.ts:249

Broadcast message to multiple agents

string[]

string

Promise<Map<string, Result<void>>>


conversation(agentId): Promise<Result<Conversation>>

Defined in: packages/agentic-control/src/fleet/fleet.ts:268

Get agent conversation

string

Promise<Result<Conversation>>


coordinate(config): Promise<void>

Defined in: packages/agentic-control/src/fleet/fleet.ts:495

Run bidirectional coordination loop with intelligent token switching

CoordinationConfig

Promise<void>


createDiamond(config): Promise<Result<{ counterpartyAgent: Agent; targetAgents: Agent[]; }>>

Defined in: packages/agentic-control/src/fleet/fleet.ts:324

Create a diamond pattern orchestration

DiamondConfig

Promise<Result<{ counterpartyAgent: Agent; targetAgents: Agent[]; }>>


find(agentId): Promise<Result<Agent | undefined>>

Defined in: packages/agentic-control/src/fleet/fleet.ts:159

Find agent by ID

string

Promise<Result<Agent | undefined>>


followup(agentId, message): Promise<Result<void>>

Defined in: packages/agentic-control/src/fleet/fleet.ts:239

Send a follow-up message to an agent

string

string

Promise<Result<void>>


isApiAvailable(): boolean

Defined in: packages/agentic-control/src/fleet/fleet.ts:119

Check if direct API is available

boolean


list(): Promise<Result<Agent[]>>

Defined in: packages/agentic-control/src/fleet/fleet.ts:130

List all agents

Promise<Result<Agent[]>>


listByStatus(status): Promise<Result<Agent[]>>

Defined in: packages/agentic-control/src/fleet/fleet.ts:140

List agents filtered by status

AgentStatus

Promise<Result<Agent[]>>


listModels(): Promise<Result<string[]>>

Defined in: packages/agentic-control/src/fleet/fleet.ts:310

List available Cursor models

Promise<Result<string[]>>


monitorAgents(agentIds, options?): Promise<Map<string, Agent>>

Defined in: packages/agentic-control/src/fleet/fleet.ts:451

Monitor specific agents until all complete

string[]

(status) => void

number

Promise<Map<string, Agent>>


repositories(): Promise<Result<Repository[]>>

Defined in: packages/agentic-control/src/fleet/fleet.ts:300

List available repositories

Promise<Result<Repository[]>>


running(): Promise<Result<Agent[]>>

Defined in: packages/agentic-control/src/fleet/fleet.ts:152

Get running agents only

Promise<Result<Agent[]>>


spawn(options): Promise<Result<Agent>>

Defined in: packages/agentic-control/src/fleet/fleet.ts:186

Spawn a new agent

API Spec: https://cursor.com/docs/cloud-agent/api/endpoints

SpawnOptions & object

Spawn options including repository, task, ref, target, and webhook

Promise<Result<Agent>>


status(agentId): Promise<Result<Agent>>

Defined in: packages/agentic-control/src/fleet/fleet.ts:168

Get agent status

string

Promise<Result<Agent>>


summary(): Promise<Result<{ agents: Agent[]; completed: number; failed: number; running: number; total: number; }>>

Defined in: packages/agentic-control/src/fleet/fleet.ts:395

Get fleet summary

Promise<Result<{ agents: Agent[]; completed: number; failed: number; running: number; total: number; }>>


waitFor(agentId, options?): Promise<Result<Agent>>

Defined in: packages/agentic-control/src/fleet/fleet.ts:423

Wait for agent to complete

string

number

number

Promise<Result<Agent>>