Skip to main content

Thread API

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

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

Quick Reference

MethodDescription
createAndStartThreadCreates and immediately starts a new thread.
createThreadCreates a new thread with comprehensive options.
createThreadInBackgroundCreates a thread in the background and resolves when the agent starts or fails.
deleteThreadDeletes a thread.
getThreadDetailRetrieves detailed information about a specific thread.
getThreadFileChangesRetrieves file changes associated with a specific thread.
getThreadFileChangesSummaryRetrieves file changes summary for ChangesSummaryPanel.
getThreadListRetrieves a list of threads with optional filtering.
getThreadMessagesRetrieves messages for a specific thread.
startThreadStarts a thread.
updateThreadUpdates an existing thread.
updateThreadStatusUpdates the status of a thread.

Methods


createAndStartThread

plugin.thread.createAndStartThread(options: object): Promise<object>

Creates and immediately starts a new thread.

ParameterTypeRequiredDescription
optionsobjectYesThe thread creation and start parameters

Returns: Promise<object> — A promise that resolves with the thread start response

Full reference →


createThread

plugin.thread.createThread(options: object): Promise<object>

Creates a new thread with comprehensive options.

ParameterTypeRequiredDescription
optionsobjectYesThe thread creation parameters

Returns: Promise<object> — A promise that resolves with the thread creation response

Full reference →


createThreadInBackground

plugin.thread.createThreadInBackground(options: object): Promise<object | object>

Creates a thread in the background and resolves when the agent starts or fails.

ParameterTypeRequiredDescription
optionsobjectYesThe thread creation and start parameters

Returns: Promise<object | object> — A promise that resolves with ThreadAgentStarted or ThreadAgentStartFailed response

Full reference →


deleteThread

plugin.thread.deleteThread(threadId: string): Promise<object>

Deletes a thread.

ParameterTypeRequiredDescription
threadIdstringYesThe thread ID to delete

Returns: Promise<object> — A promise that resolves with the thread deletion response

Full reference →


getThreadDetail

plugin.thread.getThreadDetail(options: object): Promise<object>

Retrieves detailed information about a specific thread.

ParameterTypeRequiredDescription
optionsobjectYesThe thread detail options

Returns: Promise<object> — A promise that resolves with the thread detail response

Full reference →


getThreadFileChanges

plugin.thread.getThreadFileChanges(threadId: string): Promise<ThreadFileChangesResponse>

Retrieves file changes associated with a specific thread.

ParameterTypeRequiredDescription
threadIdstringYesThe thread ID

Returns: Promise<ThreadFileChangesResponse> — A promise that resolves with the file changes

Full reference →


getThreadFileChangesSummary

plugin.thread.getThreadFileChangesSummary(threadId: string): Promise<ThreadFileChangesSummaryResponse>

Retrieves file changes summary for ChangesSummaryPanel. Returns data in the format: { title, changes, files }

ParameterTypeRequiredDescription
threadIdstringYesThe thread ID

Returns: Promise<ThreadFileChangesSummaryResponse> — A promise that resolves with the file changes summary

Full reference →


getThreadList

plugin.thread.getThreadList(options: object): Promise<object>

Retrieves a list of threads with optional filtering.

ParameterTypeRequiredDescription
optionsobjectYesOptional filters for threads (default: {})

Returns: Promise<object> — A promise that resolves with the thread list response

Full reference →


getThreadMessages

plugin.thread.getThreadMessages(options: object): Promise<object>

Retrieves messages for a specific thread.

ParameterTypeRequiredDescription
optionsobjectYesThe thread messages options

Returns: Promise<object> — A promise that resolves with the thread messages response

Full reference →


startThread

plugin.thread.startThread(threadId: string): Promise<object>

Starts a thread.

ParameterTypeRequiredDescription
threadIdstringYesThe thread ID to start

Returns: Promise<object> — A promise that resolves with the thread start response

Full reference →


updateThread

plugin.thread.updateThread(threadId: string, updates: object): Promise<object>

Updates an existing thread.

ParameterTypeRequiredDescription
threadIdstringYesThe thread ID to update
updatesobjectYesThe thread update parameters

Returns: Promise<object> — A promise that resolves with the thread update response

Full reference →


updateThreadStatus

plugin.thread.updateThreadStatus(threadId: string, status: string): Promise<object>

Updates the status of a thread.

ParameterTypeRequiredDescription
threadIdstringYesThe thread ID
statusstringYesThe new status

Returns: Promise<object> — A promise that resolves with the thread status update response

Full reference →