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.
Example
Section titled “Example”const fleet = new Fleet();
// Spawn a new agentconst result = await fleet.spawn({ repository: 'https://github.com/owner/repo', task: 'Fix the authentication bug', target: { autoCreatePr: true }});
// Monitor agent statusconst status = await fleet.status(result.data.id);Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Fleet(
config?):Fleet
Defined in: packages/agentic-control/src/fleet/fleet.ts:96
Create a new Fleet instance
Parameters
Section titled “Parameters”config?
Section titled “config?”FleetConfig = {}
Fleet configuration options including API key and timeout
Returns
Section titled “Returns”Fleet
Methods
Section titled “Methods”archive()
Section titled “archive()”archive(
agentId,outputPath?):Promise<Result<string>>
Defined in: packages/agentic-control/src/fleet/fleet.ts:278
Archive agent conversation to disk
Parameters
Section titled “Parameters”agentId
Section titled “agentId”string
outputPath?
Section titled “outputPath?”string
Returns
Section titled “Returns”Promise<Result<string>>
broadcast()
Section titled “broadcast()”broadcast(
agentIds,message):Promise<Map<string,Result<void>>>
Defined in: packages/agentic-control/src/fleet/fleet.ts:249
Broadcast message to multiple agents
Parameters
Section titled “Parameters”agentIds
Section titled “agentIds”string[]
message
Section titled “message”string
Returns
Section titled “Returns”Promise<Map<string, Result<void>>>
conversation()
Section titled “conversation()”conversation(
agentId):Promise<Result<Conversation>>
Defined in: packages/agentic-control/src/fleet/fleet.ts:268
Get agent conversation
Parameters
Section titled “Parameters”agentId
Section titled “agentId”string
Returns
Section titled “Returns”Promise<Result<Conversation>>
coordinate()
Section titled “coordinate()”coordinate(
config):Promise<void>
Defined in: packages/agentic-control/src/fleet/fleet.ts:495
Run bidirectional coordination loop with intelligent token switching
Parameters
Section titled “Parameters”config
Section titled “config”Returns
Section titled “Returns”Promise<void>
createDiamond()
Section titled “createDiamond()”createDiamond(
config):Promise<Result<{counterpartyAgent:Agent;targetAgents:Agent[]; }>>
Defined in: packages/agentic-control/src/fleet/fleet.ts:324
Create a diamond pattern orchestration
Parameters
Section titled “Parameters”config
Section titled “config”Returns
Section titled “Returns”Promise<Result<{ counterpartyAgent: Agent; targetAgents: Agent[]; }>>
find()
Section titled “find()”Defined in: packages/agentic-control/src/fleet/fleet.ts:159
Find agent by ID
Parameters
Section titled “Parameters”agentId
Section titled “agentId”string
Returns
Section titled “Returns”Promise<Result<Agent | undefined>>
followup()
Section titled “followup()”followup(
agentId,message):Promise<Result<void>>
Defined in: packages/agentic-control/src/fleet/fleet.ts:239
Send a follow-up message to an agent
Parameters
Section titled “Parameters”agentId
Section titled “agentId”string
message
Section titled “message”string
Returns
Section titled “Returns”Promise<Result<void>>
isApiAvailable()
Section titled “isApiAvailable()”isApiAvailable():
boolean
Defined in: packages/agentic-control/src/fleet/fleet.ts:119
Check if direct API is available
Returns
Section titled “Returns”boolean
list()
Section titled “list()”Defined in: packages/agentic-control/src/fleet/fleet.ts:130
List all agents
Returns
Section titled “Returns”listByStatus()
Section titled “listByStatus()”Defined in: packages/agentic-control/src/fleet/fleet.ts:140
List agents filtered by status
Parameters
Section titled “Parameters”status
Section titled “status”Returns
Section titled “Returns”listModels()
Section titled “listModels()”listModels():
Promise<Result<string[]>>
Defined in: packages/agentic-control/src/fleet/fleet.ts:310
List available Cursor models
Returns
Section titled “Returns”Promise<Result<string[]>>
monitorAgents()
Section titled “monitorAgents()”monitorAgents(
agentIds,options?):Promise<Map<string,Agent>>
Defined in: packages/agentic-control/src/fleet/fleet.ts:451
Monitor specific agents until all complete
Parameters
Section titled “Parameters”agentIds
Section titled “agentIds”string[]
options?
Section titled “options?”onProgress?
Section titled “onProgress?”(status) => void
pollInterval?
Section titled “pollInterval?”number
Returns
Section titled “Returns”Promise<Map<string, Agent>>
repositories()
Section titled “repositories()”repositories():
Promise<Result<Repository[]>>
Defined in: packages/agentic-control/src/fleet/fleet.ts:300
List available repositories
Returns
Section titled “Returns”Promise<Result<Repository[]>>
running()
Section titled “running()”Defined in: packages/agentic-control/src/fleet/fleet.ts:152
Get running agents only
Returns
Section titled “Returns”spawn()
Section titled “spawn()”Defined in: packages/agentic-control/src/fleet/fleet.ts:186
Spawn a new agent
API Spec: https://cursor.com/docs/cloud-agent/api/endpoints
Parameters
Section titled “Parameters”options
Section titled “options”SpawnOptions & object
Spawn options including repository, task, ref, target, and webhook
Returns
Section titled “Returns”status()
Section titled “status()”Defined in: packages/agentic-control/src/fleet/fleet.ts:168
Get agent status
Parameters
Section titled “Parameters”agentId
Section titled “agentId”string
Returns
Section titled “Returns”summary()
Section titled “summary()”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
Returns
Section titled “Returns”Promise<Result<{ agents: Agent[]; completed: number; failed: number; running: number; total: number; }>>
waitFor()
Section titled “waitFor()”Defined in: packages/agentic-control/src/fleet/fleet.ts:423
Wait for agent to complete
Parameters
Section titled “Parameters”agentId
Section titled “agentId”string
options?
Section titled “options?”pollInterval?
Section titled “pollInterval?”number
timeout?
Section titled “timeout?”number