Swarm API
Swarm API
import { CodeBoltClient } from '@codebolt/clientsdk';
const client = new CodeBoltClient();
Quick Reference
| Method | Description |
|---|---|
addAgent | Add an agent to a swarm. |
applyToVacancy | Apply to a vacancy in a swarm. |
approveSpawnRequest | Approve a spawn request. |
approveTerminationRequest | Approve a termination request. |
assignRole | Assign a role to an agent in a swarm. |
closeVacancy | Close a vacancy in a swarm. |
createRole | Create a role in a swarm. |
createSpawnRequest | Create a spawn request for a swarm. |
createSwarm | Create a new swarm. |
createTeam | Create a team in a swarm. |
createTerminationRequest | Create a termination request for a swarm. |
createVacancy | Create a vacancy in a swarm. |
deleteRole | Delete a role from a swarm. |
deleteSwarm | Delete a swarm by ID. |
deleteTeam | Delete a team from a swarm. |
getAgentsByStatus | Get agents filtered by status in a swarm. |
getAgentStatus | Get the status of a specific agent in a swarm. |
getConfig | Get the configuration of a swarm. |
getExecutionStatus | Get the execution status of a swarm. |
getLayout | Get the swarm layout. |
getRole | Get a role by ID within a swarm. |
getRoleAgents | Get agents assigned to a specific role. |
getRoleStatistics | Get role statistics for a swarm. |
getSpawnRegistry | Get the spawn registry for a swarm. |
getSwarm | Get a swarm by ID. |
getSwarmStatus | Get the overall status of a swarm. |
getTeam | Get a team by ID within a swarm. |
getTeamMembers | Get the members of a team within a swarm. |
getTeamStatistics | Get team statistics for a swarm. |
getTerminationRegistry | Get the termination registry for a swarm. |
healthCheck | Health check for swarm service. |
joinTeam | Join a team within a swarm. |
leaveTeam | Leave a team within a swarm. |
listAgents | List agents in a swarm. |
listRoles | List roles in a swarm. |
listSpawnRequests | List spawn requests for a swarm. |
listSwarms | List all swarms. |
listTeams | List teams in a swarm. |
listTerminationRequests | List termination requests for a swarm. |
listVacancies | List vacancies in a swarm. |
rejectSpawnRequest | Reject a spawn request. |
rejectTerminationRequest | Reject a termination request. |
removeAgent | Remove an agent from a swarm. |
saveLayout | Save or update the swarm layout. |
startSwarm | Start a swarm. |
stopSwarm | Stop a swarm. |
unassignRole | Unassign a role from an agent in a swarm. |
updateAgentStatus | Update the status of an agent in a swarm. |
updateConfig | Update the configuration of a swarm. |
Methods
addAgent
client.swarm.addAgent(swarmId: string, data: AgentRegistration): Promise<SwarmAgentInfo>
Add an agent to a swarm.
Registers a new agent with the swarm, making it available for assignment to teams and roles. Agents are the worker entities that perform tasks within the swarm context.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
data | AgentRegistration | Yes | The agent registration information |
Returns: Promise<SwarmAgentInfo> — A promise that resolves to the registered SwarmAgentInfo object
applyToVacancy
client.swarm.applyToVacancy(swarmId: string, vacancyId: string, data?: ApplyToVacancyRequest): Promise<void>
Apply to a vacancy in a swarm.
Submits an application from an agent for a specific vacancy. The agent will be considered for the position and may be selected based on qualifications and availability.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
vacancyId | string | Yes | The unique identifier of the vacancy |
data | ApplyToVacancyRequest | No | Optional application information |
Returns: Promise<void> — A promise that resolves when the application is submitted
approveSpawnRequest
client.swarm.approveSpawnRequest(swarmId: string, requestId: string, data?: SpawnRequestActionBody): Promise<void>
Approve a spawn request.
Approves a pending spawn request, authorizing the creation of new agent instances. The agents will be spawned according to the request specifications.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
requestId | string | Yes | The unique identifier of the spawn request |
data | SpawnRequestActionBody | No | Optional approval information |
Returns: Promise<void> — A promise that resolves when the request is approved
approveTerminationRequest
client.swarm.approveTerminationRequest(swarmId: string, requestId: string, data?: TerminationRequestActionBody): Promise<void>
Approve a termination request.
Approves a pending termination request, authorizing the removal of specified agent instances. The agents will be terminated gracefully.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
requestId | string | Yes | The unique identifier of the termination request |
data | TerminationRequestActionBody | No | Optional approval information |
Returns: Promise<void> — A promise that resolves when the request is approved
assignRole
client.swarm.assignRole(swarmId: string, roleId: string, data: AssignRoleRequest): Promise<void>
Assign a role to an agent in a swarm.
Grants a role to an agent, giving them the associated permissions and responsibilities. The agent can now perform actions authorized by this role.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
roleId | string | Yes | The unique identifier of the role to assign |
data | AssignRoleRequest | Yes | The role assignment information |
Returns: Promise<void> — A promise that resolves when the role is assigned
closeVacancy
client.swarm.closeVacancy(swarmId: string, vacancyId: string, data?: CloseVacancyRequest): Promise<void>
Close a vacancy in a swarm.
Marks a vacancy as closed, preventing further applications. This is used when a position has been filled or is no longer available.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
vacancyId | string | Yes | The unique identifier of the vacancy to close |
data | CloseVacancyRequest | No | Optional closure information |
Returns: Promise<void> — A promise that resolves when the vacancy is closed
createRole
client.swarm.createRole(swarmId: string, data: CreateRoleRequest): Promise<SwarmRole>
Create a role in a swarm.
Creates a new role that agents can be assigned to. Roles define agent responsibilities, permissions, and capabilities within the swarm context.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
data | CreateRoleRequest | Yes | The role creation information |
Returns: Promise<SwarmRole> — A promise that resolves to the created SwarmRole object
createSpawnRequest
client.swarm.createSpawnRequest(swarmId: string, data: CreateSpawnRequestBody): Promise<SpawnRequest>
Create a spawn request for a swarm.
Submits a request to spawn new agent instances within the swarm. This is used to dynamically scale the swarm by adding more agents to handle increased workload.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
data | CreateSpawnRequestBody | Yes | The spawn request details |
Returns: Promise<SpawnRequest> — A promise that resolves to the created SpawnRequest object
createSwarm
client.swarm.createSwarm(data: CreateSwarmRequest): Promise<SwarmData>
Create a new swarm.
Initializes a new swarm with the specified configuration. Swarms are the top-level organizational unit for multi-agent coordination, containing teams, roles, and agents that work together on tasks.
| Parameter | Type | Required | Description |
|---|---|---|---|
data | CreateSwarmRequest | Yes | The swarm configuration and metadata |
Returns: Promise<SwarmData> — A promise that resolves to the created SwarmData object
createTeam
client.swarm.createTeam(swarmId: string, data: CreateTeamRequest): Promise<SwarmTeam>
Create a team in a swarm.
Creates a new team within the swarm, providing organizational structure for grouping agents. Teams can be assigned specific goals and tasks, with agents collaborating within the team context.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
data | CreateTeamRequest | Yes | The team creation information |
Returns: Promise<SwarmTeam> — A promise that resolves to the created SwarmTeam object
createTerminationRequest
client.swarm.createTerminationRequest(swarmId: string, data: CreateTerminationRequestBody): Promise<unknown>
Create a termination request for a swarm.
Submits a request to terminate specific agent instances within the swarm. This is used to reduce swarm size or remove specific agents.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
data | CreateTerminationRequestBody | Yes | The termination request details |
Returns: Promise<unknown> — A promise that resolves to the created termination request
createVacancy
client.swarm.createVacancy(swarmId: string, data: CreateVacancyRequest): Promise<SwarmVacancy>
Create a vacancy in a swarm.
Creates a new vacancy that agents can apply for. Vacancies represent open positions within teams or roles that need to be filled by qualified agents.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
data | CreateVacancyRequest | Yes | The vacancy creation information |
Returns: Promise<SwarmVacancy> — A promise that resolves to the created SwarmVacancy object
deleteRole
client.swarm.deleteRole(swarmId: string, roleId: string): Promise<void>
Delete a role from a swarm.
Permanently removes a role and unassigns all agents from it. Agents will lose the permissions and responsibilities associated with the role.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
roleId | string | Yes | The unique identifier of the role to delete |
Returns: Promise<void> — A promise that resolves when the role is deleted
deleteSwarm
client.swarm.deleteSwarm(swarmId: string): Promise<void>
Delete a swarm by ID.
Permanently removes a swarm and all its associated resources including teams, roles, agents, and configurations. This action cannot be undone.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm to delete |
Returns: Promise<void> — A promise that resolves when the swarm is deleted
deleteTeam
client.swarm.deleteTeam(swarmId: string, teamId: string): Promise<void>
Delete a team from a swarm.
Permanently removes a team and all its associated memberships. Agents will be unassigned from the team but remain in the swarm.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
teamId | string | Yes | The unique identifier of the team to delete |
Returns: Promise<void> — A promise that resolves when the team is deleted
getAgentsByStatus
client.swarm.getAgentsByStatus(swarmId: string, status: string): Promise<SwarmAgentInfo[]>
Get agents filtered by status in a swarm.
Retrieves all agents in a swarm that match a specific status, such as all available agents or all agents in error state. This is useful for finding agents ready for task assignment.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
status | string | Yes | The status to filter by (available, busy, offline, etc.) |
Returns: Promise<SwarmAgentInfo[]> — A promise that resolves to an array of matching SwarmAgentInfo objects
getAgentStatus
client.swarm.getAgentStatus(swarmId: string, agentId: string): Promise<SwarmAgentInfo>
Get the status of a specific agent in a swarm.
Retrieves current status information for an agent including its state, last activity timestamp, and any status messages. Use this for monitoring agent availability and health.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
agentId | string | Yes | The unique identifier of the agent |
Returns: Promise<SwarmAgentInfo> — A promise that resolves to the SwarmAgentInfo object with status details
getConfig
client.swarm.getConfig(swarmId: string): Promise<SwarmConfig>
Get the configuration of a swarm.
Retrieves the current configuration settings for a swarm, including operational parameters, limits, and behavioral settings. Use this to view swarm settings or for configuration management.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
Returns: Promise<SwarmConfig> — A promise that resolves to the SwarmConfig object
getExecutionStatus
client.swarm.getExecutionStatus(swarmId: string): Promise<SwarmStatusUpdate>
Get the execution status of a swarm.
Retrieves real-time information about swarm execution including current tasks, agent activity, progress metrics, and any errors or warnings encountered.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
Returns: Promise<SwarmStatusUpdate> — A promise that resolves to the SwarmStatusUpdate object with execution details
getLayout
client.swarm.getLayout(): Promise<SwarmLayout>
Get the swarm layout.
Retrieves the current layout configuration for swarms in the system. The layout defines how swarms, teams, and agents are organized and displayed in user interfaces.
No parameters.
Returns: Promise<SwarmLayout> — A promise that resolves to the SwarmLayout object
getRole
client.swarm.getRole(swarmId: string, roleId: string): Promise<SwarmRole>
Get a role by ID within a swarm.
Retrieves detailed information about a specific role including its permissions and assigned agents. Use this for displaying role details or managing role assignments.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
roleId | string | Yes | The unique identifier of the role |
Returns: Promise<SwarmRole> — A promise that resolves to the SwarmRole object
getRoleAgents
client.swarm.getRoleAgents(swarmId: string, roleId: string): Promise<SwarmAgentInfo[]>
Get agents assigned to a specific role.
Retrieves all agents that currently have the specified role assigned to them. Use this to view role membership or manage role assignments.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
roleId | string | Yes | The unique identifier of the role |
Returns: Promise<SwarmAgentInfo[]> — A promise that resolves to an array of SwarmAgentInfo objects with the role
getRoleStatistics
client.swarm.getRoleStatistics(swarmId: string): Promise<SwarmRoleStatistics[]>
Get role statistics for a swarm.
Retrieves statistical information about all roles in a swarm, including assignment counts, utilization rates, and activity metrics. Use this for monitoring role distribution and workload balance.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
Returns: Promise<SwarmRoleStatistics[]> — A promise that resolves to an array of SwarmRoleStatistics objects
getSpawnRegistry
client.swarm.getSpawnRegistry(swarmId: string): Promise<unknown>
Get the spawn registry for a swarm.
Retrieves the spawn registry containing information about all agents that have been spawned for the swarm, including their configuration and lifecycle status.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
Returns: Promise<unknown> — A promise that resolves to the spawn registry data
getSwarm
client.swarm.getSwarm(swarmId: string): Promise<SwarmData>
Get a swarm by ID.
Retrieves detailed information about a specific swarm including its configuration, teams, roles, and agents. Use this for displaying swarm details or managing swarm state.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
Returns: Promise<SwarmData> — A promise that resolves to the SwarmData object
getSwarmStatus
client.swarm.getSwarmStatus(swarmId: string): Promise<SwarmStatusUpdate>
Get the overall status of a swarm.
Retrieves comprehensive status information about a swarm including its operational state, agent availability, team health, and overall readiness to execute tasks.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
Returns: Promise<SwarmStatusUpdate> — A promise that resolves to the SwarmStatusUpdate object
getTeam
client.swarm.getTeam(swarmId: string, teamId: string): Promise<SwarmTeam>
Get a team by ID within a swarm.
Retrieves detailed information about a specific team including its members, roles, and configuration. Use this for displaying team details or managing team state.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
teamId | string | Yes | The unique identifier of the team |
Returns: Promise<SwarmTeam> — A promise that resolves to the SwarmTeam object
getTeamMembers
client.swarm.getTeamMembers(swarmId: string, teamId: string): Promise<SwarmAgentInfo[]>
Get the members of a team within a swarm.
Retrieves all agents that are currently members of the specified team. Use this to view team composition or manage team membership.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
teamId | string | Yes | The unique identifier of the team |
Returns: Promise<SwarmAgentInfo[]> — A promise that resolves to an array of SwarmAgentInfo objects representing team members
getTeamStatistics
client.swarm.getTeamStatistics(swarmId: string): Promise<SwarmTeamStatistics[]>
Get team statistics for a swarm.
Retrieves statistical information about all teams in a swarm, including member counts, activity levels, and performance metrics. Use this for monitoring team health and utilization.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
Returns: Promise<SwarmTeamStatistics[]> — A promise that resolves to an array of SwarmTeamStatistics objects
getTerminationRegistry
client.swarm.getTerminationRegistry(swarmId: string): Promise<unknown>
Get the termination registry for a swarm.
Retrieves the termination registry containing information about all agents that have been terminated from the swarm, including their lifecycle history and termination reasons.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
Returns: Promise<unknown> — A promise that resolves to the termination registry data
healthCheck
client.swarm.healthCheck(): Promise<object>
Health check for swarm service.
Returns service status, useful for monitoring and health dashboards.
No parameters.
Returns: Promise<object> — A promise that resolves to service status
joinTeam
client.swarm.joinTeam(swarmId: string, teamId: string, data?: JoinTeamRequest): Promise<void>
Join a team within a swarm.
Adds an agent to a team as a member. The agent will be associated with the team and can participate in team-specific tasks and activities.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
teamId | string | Yes | The unique identifier of the team to join |
data | JoinTeamRequest | No | Optional join request information |
Returns: Promise<void> — A promise that resolves when the agent has joined the team
leaveTeam
client.swarm.leaveTeam(swarmId: string, teamId: string, data?: LeaveTeamRequest): Promise<void>
Leave a team within a swarm.
Removes an agent from a team, ending their membership. The agent will no longer participate in team activities but remains in the swarm.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
teamId | string | Yes | The unique identifier of the team to leave |
data | LeaveTeamRequest | No | Optional leave request information |
Returns: Promise<void> — A promise that resolves when the agent has left the team
listAgents
client.swarm.listAgents(swarmId: string, params?: Record<string, unknown>): Promise<SwarmAgentInfo[]>
List agents in a swarm.
Retrieves all agents registered with a specific swarm, optionally filtered by query parameters. Use this to view available agents or populate agent selection interfaces.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
params | Record<string, unknown> | No | Optional query parameters for filtering agents |
Returns: Promise<SwarmAgentInfo[]> — A promise that resolves to an array of SwarmAgentInfo objects
listRoles
client.swarm.listRoles(swarmId: string, params?: Record<string, unknown>): Promise<SwarmRole[]>
List roles in a swarm.
Retrieves all roles defined in a swarm, optionally filtered by query parameters. Use this to view available roles or populate role selection interfaces.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
params | Record<string, unknown> | No | Optional query parameters for filtering roles |
Returns: Promise<SwarmRole[]> — A promise that resolves to an array of SwarmRole objects
listSpawnRequests
client.swarm.listSpawnRequests(swarmId: string, params?: Record<string, unknown>): Promise<SpawnRequest[]>
List spawn requests for a swarm.
Retrieves all spawn requests associated with a swarm, including pending, approved, and completed requests. Use this to track spawn request status and history.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
params | Record<string, unknown> | No | Optional query parameters for filtering requests |
Returns: Promise<SpawnRequest[]> — A promise that resolves to an array of SpawnRequest objects
listSwarms
client.swarm.listSwarms(params?: Record<string, unknown>): Promise<SwarmSummary[]>
List all swarms.
Retrieves all swarms in the system, optionally filtered by query parameters. Use this to discover available swarms or populate swarm selection interfaces.
| Parameter | Type | Required | Description |
|---|---|---|---|
params | Record<string, unknown> | No | Optional query parameters for filtering swarms |
Returns: Promise<SwarmSummary[]> — A promise that resolves to an array of SwarmSummary objects
listTeams
client.swarm.listTeams(swarmId: string, params?: Record<string, unknown>): Promise<SwarmTeam[]>
List teams in a swarm.
Retrieves all teams within a swarm, optionally filtered by query parameters. Use this to view team structure or populate team selection interfaces.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
params | Record<string, unknown> | No | Optional query parameters for filtering teams |
Returns: Promise<SwarmTeam[]> — A promise that resolves to an array of SwarmTeam objects
listTerminationRequests
client.swarm.listTerminationRequests(swarmId: string, params?: Record<string, unknown>): Promise<unknown[]>
List termination requests for a swarm.
Retrieves all termination requests associated with a swarm, including pending, approved, and completed requests. Use this to track termination request status and history.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
params | Record<string, unknown> | No | Optional query parameters for filtering requests |
Returns: Promise<unknown[]> — A promise that resolves to an array of termination requests
listVacancies
client.swarm.listVacancies(swarmId: string, params?: Record<string, unknown>): Promise<SwarmVacancy[]>
List vacancies in a swarm.
Retrieves all open vacancies in a swarm, optionally filtered by query parameters. Use this to find available positions for agents to apply.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
params | Record<string, unknown> | No | Optional query parameters for filtering vacancies |
Returns: Promise<SwarmVacancy[]> — A promise that resolves to an array of SwarmVacancy objects
rejectSpawnRequest
client.swarm.rejectSpawnRequest(swarmId: string, requestId: string, data?: SpawnRequestActionBody): Promise<void>
Reject a spawn request.
Rejects a pending spawn request, preventing the creation of new agent instances. The request will be marked as rejected and no agents will be spawned.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
requestId | string | Yes | The unique identifier of the spawn request |
data | SpawnRequestActionBody | No | Optional rejection information |
Returns: Promise<void> — A promise that resolves when the request is rejected
rejectTerminationRequest
client.swarm.rejectTerminationRequest(swarmId: string, requestId: string, data?: TerminationRequestActionBody): Promise<void>
Reject a termination request.
Rejects a pending termination request, preventing the removal of agent instances. The agents will continue operating in the swarm.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
requestId | string | Yes | The unique identifier of the termination request |
data | TerminationRequestActionBody | No | Optional rejection information |
Returns: Promise<void> — A promise that resolves when the request is rejected
removeAgent
client.swarm.removeAgent(swarmId: string, agentId: string): Promise<void>
Remove an agent from a swarm.
Unregisters an agent from the swarm, removing it from all teams and roles. The agent will no longer participate in swarm activities.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
agentId | string | Yes | The unique identifier of the agent to remove |
Returns: Promise<void> — A promise that resolves when the agent is removed
saveLayout
client.swarm.saveLayout(data: SaveLayoutRequest): Promise<void>
Save or update the swarm layout.
Persists a new layout configuration for swarms. The layout defines how swarms, teams, and agents are organized and displayed. Use this to save custom arrangements or update the structure.
| Parameter | Type | Required | Description |
|---|---|---|---|
data | SaveLayoutRequest | Yes | The layout configuration to save |
Returns: Promise<void> — A promise that resolves when the layout is saved
startSwarm
client.swarm.startSwarm(swarmId: string, data?: StartSwarmRequest): Promise<void>
Start a swarm.
Activates a swarm, enabling it to begin processing tasks and coordinating agent activities. The swarm will start executing its assigned workflow according to its configuration.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
data | StartSwarmRequest | No | Optional start parameters |
Returns: Promise<void> — A promise that resolves when the swarm has started
stopSwarm
client.swarm.stopSwarm(swarmId: string, data?: Record<string, unknown>): Promise<void>
Stop a swarm.
Deactivates a swarm, halting all in-progress tasks and agent activities. The swarm will gracefully shut down and return to an idle state.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
data | Record<string, unknown> | No | Optional stop parameters |
Returns: Promise<void> — A promise that resolves when the swarm has stopped
unassignRole
client.swarm.unassignRole(swarmId: string, roleId: string, data: UnassignRoleRequest): Promise<void>
Unassign a role from an agent in a swarm.
Removes a role from an agent, revoking the associated permissions and responsibilities. The agent will no longer be able to perform actions authorized by this role.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
roleId | string | Yes | The unique identifier of the role to unassign |
data | UnassignRoleRequest | Yes | The role unassignment information |
Returns: Promise<void> — A promise that resolves when the role is unassigned
updateAgentStatus
client.swarm.updateAgentStatus(swarmId: string, agentId: string, data: AgentStatusUpdateRequest): Promise<void>
Update the status of an agent in a swarm.
Changes the operational status of an agent, such as marking it as available, busy, offline, or in error. Status updates affect agent assignment and task distribution.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
agentId | string | Yes | The unique identifier of the agent |
data | AgentStatusUpdateRequest | Yes | The status update information |
Returns: Promise<void> — A promise that resolves when the status is updated
updateConfig
client.swarm.updateConfig(swarmId: string, data: UpdateSwarmConfigRequest): Promise<void>
Update the configuration of a swarm.
Modifies the configuration settings for a swarm. Changes take effect immediately and affect all subsequent swarm operations. Use this to adjust swarm behavior and operational parameters.
| Parameter | Type | Required | Description |
|---|---|---|---|
swarmId | string | Yes | The unique identifier of the swarm |
data | UpdateSwarmConfigRequest | Yes | The configuration updates |
Returns: Promise<void> — A promise that resolves when the configuration is updated