Task API
The task module of the @codebolt/plugin-sdk.
import plugin from '@codebolt/plugin-sdk';
Quick Reference
| Method | Description |
|---|---|
assignAgentToTask | Assigns an agent to a task. |
createTask | Creates a new task. |
deleteTask | Deletes a task. |
executeTaskWithAgent | Executes a task with a specific agent. |
getTaskDetail | Retrieves detailed information about a specific task. |
getTaskList | Retrieves a list of tasks. |
getTaskStatus | Gets the status of a task. |
getTaskSummary | Gets the summary (description) of a task. |
updateTask | Updates an existing task. |
Methods
assignAgentToTask
plugin.task.assignAgentToTask(taskId: string, agentId: string): Promise<object>
Assigns an agent to a task.
| Parameter | Type | Required | Description |
|---|---|---|---|
taskId | string | Yes | The task ID |
agentId | string | Yes | The agent ID to assign |
Returns: Promise<object>
createTask
plugin.task.createTask(options: object): Promise<object>
Creates a new task.
| Parameter | Type | Required | Description |
|---|---|---|---|
options | object | Yes | The task creation parameters |
Returns: Promise<object>
deleteTask
plugin.task.deleteTask(taskId: string): Promise<object>
Deletes a task.
| Parameter | Type | Required | Description |
|---|---|---|---|
taskId | string | Yes | The task ID to delete |
Returns: Promise<object>
executeTaskWithAgent
plugin.task.executeTaskWithAgent(taskId: string, agentId: string): Promise<object>
Executes a task with a specific agent. Assigns the agent and then starts the task.
| Parameter | Type | Required | Description |
|---|---|---|---|
taskId | string | Yes | The task ID |
agentId | string | Yes | The agent ID |
Returns: Promise<object>
getTaskDetail
plugin.task.getTaskDetail(options: object): Promise<object>
Retrieves detailed information about a specific task.
| Parameter | Type | Required | Description |
|---|---|---|---|
options | object | Yes | The task detail options |
Returns: Promise<object>
getTaskList
plugin.task.getTaskList(options: object): Promise<object>
Retrieves a list of tasks.
| Parameter | Type | Required | Description |
|---|---|---|---|
options | object | Yes | Optional filters for tasks (default: {}) |
Returns: Promise<object>
getTaskStatus
plugin.task.getTaskStatus(taskId: string): Promise<string | undefined>
Gets the status of a task.
| Parameter | Type | Required | Description |
|---|---|---|---|
taskId | string | Yes | The task ID |
Returns: Promise<string | undefined> — The task status
getTaskSummary
plugin.task.getTaskSummary(taskId: string): Promise<string | undefined>
Gets the summary (description) of a task.
| Parameter | Type | Required | Description |
|---|---|---|---|
taskId | string | Yes | The task ID |
Returns: Promise<string | undefined> — The task description
updateTask
plugin.task.updateTask(taskId: string, updates: object): Promise<object>
Updates an existing task.
| Parameter | Type | Required | Description |
|---|---|---|---|
taskId | string | Yes | The task ID to update |
updates | object | Yes | The task update parameters |
Returns: Promise<object>