Skip to main content

Task API

The task module of the @codebolt/plugin-sdk.

import plugin from '@codebolt/plugin-sdk';

Quick Reference

MethodDescription
assignAgentToTaskAssigns an agent to a task.
createTaskCreates a new task.
deleteTaskDeletes a task.
executeTaskWithAgentExecutes a task with a specific agent.
getTaskDetailRetrieves detailed information about a specific task.
getTaskListRetrieves a list of tasks.
getTaskStatusGets the status of a task.
getTaskSummaryGets the summary (description) of a task.
updateTaskUpdates an existing task.

Methods


assignAgentToTask

plugin.task.assignAgentToTask(taskId: string, agentId: string): Promise<object>

Assigns an agent to a task.

ParameterTypeRequiredDescription
taskIdstringYesThe task ID
agentIdstringYesThe agent ID to assign

Returns: Promise<object>

Full reference →


createTask

plugin.task.createTask(options: object): Promise<object>

Creates a new task.

ParameterTypeRequiredDescription
optionsobjectYesThe task creation parameters

Returns: Promise<object>

Full reference →


deleteTask

plugin.task.deleteTask(taskId: string): Promise<object>

Deletes a task.

ParameterTypeRequiredDescription
taskIdstringYesThe task ID to delete

Returns: Promise<object>

Full reference →


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.

ParameterTypeRequiredDescription
taskIdstringYesThe task ID
agentIdstringYesThe agent ID

Returns: Promise<object>

Full reference →


getTaskDetail

plugin.task.getTaskDetail(options: object): Promise<object>

Retrieves detailed information about a specific task.

ParameterTypeRequiredDescription
optionsobjectYesThe task detail options

Returns: Promise<object>

Full reference →


getTaskList

plugin.task.getTaskList(options: object): Promise<object>

Retrieves a list of tasks.

ParameterTypeRequiredDescription
optionsobjectYesOptional filters for tasks (default: {})

Returns: Promise<object>

Full reference →


getTaskStatus

plugin.task.getTaskStatus(taskId: string): Promise<string | undefined>

Gets the status of a task.

ParameterTypeRequiredDescription
taskIdstringYesThe task ID

Returns: Promise<string | undefined> — The task status

Full reference →


getTaskSummary

plugin.task.getTaskSummary(taskId: string): Promise<string | undefined>

Gets the summary (description) of a task.

ParameterTypeRequiredDescription
taskIdstringYesThe task ID

Returns: Promise<string | undefined> — The task description

Full reference →


updateTask

plugin.task.updateTask(taskId: string, updates: object): Promise<object>

Updates an existing task.

ParameterTypeRequiredDescription
taskIdstringYesThe task ID to update
updatesobjectYesThe task update parameters

Returns: Promise<object>

Full reference →