# Class Codebolt

Codebolt

#### Description

This class provides a unified interface to interact with various modules.

- Defined in src/index.ts:32

#####
Index

### Constructors

constructor

### Properties

browser
cbstate
chat
chatSummary
codeparsers
codeutils
crawler
dbmemory
debug
docutils
fs
git
knowledge
llm
outputparsers
project
rag
search
taskplaner
terminal
tokenizer
vectordb
websocket

### Methods

waitForConnection

## Constructors

### constructor

- new Codebolt(): Codebolt

- #### Returns Codebolt

  #### Description

  Initializes the websocket connection.

  - Defined in src/index.ts:38

## Properties

### browser

browser: {
click: ((elementid) => Promise<unknown>);
close: (() => void);
enter: (() => Promise<unknown>);
extractText: (() => Promise<ExtractTextResponse>);
getBrowserInfo: (() => Promise<any>);
getContent: (() => Promise<GetContentResponse>);
getHTML: (() => Promise<HtmlReceived>);
getMarkdown: (() => Promise<GetMarkdownResponse>);
getPDF: (() => void);
getSnapShot: (() => Promise<any>);
getUrl: (() => Promise<UrlResponse>);
goToPage: ((url) => Promise<GoToPageResponse>);
newPage: (() => Promise<unknown>);
pdfToText: (() => void);
screenshot: (() => Promise<unknown>);
scroll: ((direction, pixels) => Promise<unknown>);
search: ((elementid, query) => Promise<unknown>);
type: ((elementid, text) => Promise<unknown>);
} = cbbrowser

#### Type declaration

- ##### click: ((elementid) => Promise<unknown>)

  Clicks on a specified element on the page.

  #### Returns

  A promise that resolves when the click action is complete.

  - - (elementid): Promise<unknown>

    - #### Parameters

      - elementid: string

        The ID of the element to click.

      #### Returns Promise<unknown>

- ##### close: (() => void)

  Closes the current page.

  - - (): void

    - #### Returns void

- ##### enter: (() => Promise<unknown>)

  Simulates the Enter key press on the current page.

  #### Returns

  A promise that resolves when the Enter action is complete.

  - - (): Promise<unknown>

    - #### Returns Promise<unknown>

- ##### extractText: (() => Promise<ExtractTextResponse>)

  Extracts text from the current page.

  #### Returns

  A promise that resolves with the extracted text.

  - - (): Promise<ExtractTextResponse>

    - #### Returns Promise<ExtractTextResponse>

- ##### getBrowserInfo: (() => Promise<any>)

  Retrieves browser info like height width scrollx scrolly of the current page.

  #### Returns

  A promise that resolves with the content.

  - - (): Promise<any>

    - #### Returns Promise<any>

- ##### getContent: (() => Promise<GetContentResponse>)

  Retrieves the content of the current page.

  #### Returns

  A promise that resolves with the content.

  - - (): Promise<GetContentResponse>

    - #### Returns Promise<GetContentResponse>

- ##### getHTML: (() => Promise<HtmlReceived>)

  Retrieves the HTML content of the current page.

  #### Returns

  A promise that resolves with the HTML content.

  - - (): Promise<HtmlReceived>

    - #### Returns Promise<HtmlReceived>

- ##### getMarkdown: (() => Promise<GetMarkdownResponse>)

  Retrieves the Markdown content of the current page.

  #### Returns

  A promise that resolves with the Markdown content.

  - - (): Promise<GetMarkdownResponse>

    - #### Returns Promise<GetMarkdownResponse>

- ##### getPDF: (() => void)

  Retrieves the PDF content of the current page.

  - - (): void

    - #### Returns void

- ##### getSnapShot: (() => Promise<any>)

  Retrieves the snapshot of the current page.

  #### Returns

  A promise that resolves with the content.

  - - (): Promise<any>

    - #### Returns Promise<any>

- ##### getUrl: (() => Promise<UrlResponse>)

  Retrieves the current URL of the browser's active page.

  #### Returns

  A promise that resolves with the URL.

  - - (): Promise<UrlResponse>

    - #### Returns Promise<UrlResponse>

- ##### goToPage: ((url) => Promise<GoToPageResponse>)

  Navigates to a specified URL.

  #### Returns

  A promise that resolves when navigation is complete.

  - - (url): Promise<GoToPageResponse>

    - #### Parameters

      - url: string

        The URL to navigate to.

      #### Returns Promise<GoToPageResponse>

- ##### newPage: (() => Promise<unknown>)

  Opens a new page in the browser.

  - - (): Promise<unknown>

    - #### Returns Promise<unknown>

- ##### pdfToText: (() => void)

  Converts the PDF content of the current page to text.

  - - (): void

    - #### Returns void

- ##### screenshot: (() => Promise<unknown>)

  Takes a screenshot of the current page.

  - - (): Promise<unknown>

    - #### Returns Promise<unknown>

- ##### scroll: ((direction, pixels) => Promise<unknown>)

  Scrolls the current page in a specified direction by a specified number of pixels.

  #### Returns

  A promise that resolves when the scroll action is complete.

  - - (direction, pixels): Promise<unknown>

    - #### Parameters

      - direction: string

        The direction to scroll.

      - pixels: string

        The number of pixels to scroll.

      #### Returns Promise<unknown>

- ##### search: ((elementid, query) => Promise<unknown>)

  Performs a search on the current page using a specified query.

  #### Returns

  A promise that resolves with the search results.

  - - (elementid, query): Promise<unknown>

    - #### Parameters

      - elementid: string

        The ID of the element to perform the search in.

      - query: string

        The search query.

      #### Returns Promise<unknown>

- ##### type: ((elementid, text) => Promise<unknown>)

  Types text into a specified element on the page.

  #### Returns

  A promise that resolves when the typing action is complete.

  - - (elementid, text): Promise<unknown>

    - #### Parameters

      - elementid: string

        The ID of the element to type into.

      - text: string

        The text to type.

      #### Returns Promise<unknown>

- Defined in src/index.ts:75

### cbstate

cbstate: {
addToAgentState: ((key, value) => Promise<AddToAgentStateResponse>);
getAgentState: (() => Promise<GetAgentStateResponse>);
getApplicationState: (() => Promise<ApplicationState>);
} = cbstate

#### Type declaration

- ##### addToAgentState: ((key, value) => Promise<AddToAgentStateResponse>)

  Adds a key-value pair to the agent's state on the server via WebSocket.

  #### Returns

  A promise that resolves with the response to the addition request.

  - - (key, value): Promise<AddToAgentStateResponse>

    - #### Parameters

      - key: string

        The key to add to the agent's state.

      - value: string

        The value associated with the key.

      #### Returns Promise<AddToAgentStateResponse>

- ##### getAgentState: (() => Promise<GetAgentStateResponse>)

  Retrieves the current state of the agent from the server via WebSocket.

  #### Returns

  A promise that resolves with the agent's state.

  - - (): Promise<GetAgentStateResponse>

    - #### Returns Promise<GetAgentStateResponse>

- ##### getApplicationState: (() => Promise<ApplicationState>)

  Retrieves the current application state from the server via WebSocket.

  #### Returns

  A promise that resolves with the application state.

  - - (): Promise<ApplicationState>

    - #### Returns Promise<ApplicationState>

- Defined in src/index.ts:88

### chat

chat: {
getChatHistory: (() => Promise<ChatMessage[]>);
onActionMessage: (() => undefined | CustomEventEmitter);
processFinished: (() => void);
processStarted: (() => {
event: CustomEventEmitter;
stopProcess: (() => void);
});
sendConfirmationRequest: ((confirmationMessage, buttons?, withFeedback?) => Promise<string>);
sendMessage: ((message, payload) => void);
sendNotificationEvent: ((notificationMessage, type) => void);
stopProcess: (() => void);
waitforReply: ((message) => Promise<UserMessage>);
} = cbchat

#### Type declaration

- ##### getChatHistory: (() => Promise<ChatMessage[]>)

  Retrieves the chat history from the server.

  #### Returns

  A promise that resolves with an array of ChatMessage objects representing the chat history.

  - - (): Promise<ChatMessage[]>

    - #### Returns Promise<ChatMessage[]>

- ##### onActionMessage: (() => undefined | CustomEventEmitter)

  Sets up a listener for incoming WebSocket messages and emits a custom event when a message is received.

  #### Returns

  The event emitter used for emitting custom events.

  - - (): undefined | CustomEventEmitter

    - #### Returns undefined | CustomEventEmitter

- ##### processFinished: (() => void)

  Stops the ongoing process. Sends a specific message to the server to stop the process.

  - - (): void

    - #### Returns void

- ##### processStarted: (() => {
  event: CustomEventEmitter;
  stopProcess: (() => void);
  })

  Notifies the server that a process has started and sets up an event listener for stopProcessClicked events.

  #### Returns

  An object containing the event emitter and a stopProcess method.

  - - (): {
      event: CustomEventEmitter;
      stopProcess: (() => void);
      }

    - #### Returns {
      event: CustomEventEmitter;
      stopProcess: (() => void);
      }

      - ##### event: CustomEventEmitter

      - ##### stopProcess: (() => void)

        - - (): void

          - #### Returns void

- ##### sendConfirmationRequest: ((confirmationMessage, buttons?, withFeedback?) => Promise<string>)

  Sends a confirmation request to the server with two options: Yes or No.

  #### Returns

  A promise that resolves with the server's response.

  - - (confirmationMessage, buttons?, withFeedback?): Promise<string>

    - #### Parameters

      - confirmationMessage: string
      - buttons: string[] = []
      - withFeedback: boolean = false

      #### Returns Promise<string>

- ##### sendMessage: ((message, payload) => void)

  Sends a message through the WebSocket connection.

  - - (message, payload): void

    - #### Parameters

      - message: string

        The message to be sent.

      - payload: any

      #### Returns void

- ##### sendNotificationEvent: ((notificationMessage, type) => void)

  Sends a notification event to the server.

  - - (notificationMessage, type): void

    - #### Parameters

      - notificationMessage: string

        The message to be sent in the notification.

      - type: "debug" | "git" | "planner" | "browser" | "editor" | "terminal" | "preview"

      #### Returns void

- ##### stopProcess: (() => void)

  Stops the ongoing process. Sends a specific message to the server to stop the process.

  - - (): void

    - #### Returns void

- ##### waitforReply: ((message) => Promise<UserMessage>)

  Waits for a reply to a sent message.

  #### Returns

  A promise that resolves with the reply.

  - - (message): Promise<UserMessage>

    - #### Parameters

      - message: string

        The message for which a reply is expected.

      #### Returns Promise<UserMessage>

- Defined in src/index.ts:76

### chatSummary

chatSummary: {
summarize: ((messages, depth) => Promise<{
content: string;
role: string;
}[]>);
summarizeAll: (() => Promise<{
content: string;
role: string;
}[]>);
} = chatSummary

#### Type declaration

- ##### summarize: ((messages, depth) => Promise<{
  content: string;
  role: string;
  }[]>)

  - - (messages, depth): Promise<{
      content: string;
      role: string;
      }[]>

    - #### Parameters

      - messages: {
        content: string;
        role: string;
        }[]
      - depth: number

      #### Returns Promise<{
      content: string;
      role: string;
      }[]>

- ##### summarizeAll: (() => Promise<{
  content: string;
  role: string;
  }[]>)

  - - (): Promise<{
      content: string;
      role: string;
      }[]>

    - #### Returns Promise<{
      content: string;
      role: string;
      }[]>

- Defined in src/index.ts:93

### codeparsers

codeparsers: {
getAstTreeInFile: ((file, className) => void);
getClassesInFile: ((file) => void);
getFunctionsinClass: ((file, className) => void);
} = cbcodeparsers

#### Type declaration

- ##### getAstTreeInFile: ((file, className) => void)

  Generates an Abstract Syntax Tree (AST) for a given file.

  - - (file, className): void

    - #### Parameters

      - file: any

        The file to generate an AST for.

      - className: any

        The name of the class to focus the AST generation on.

      #### Returns void

- ##### getClassesInFile: ((file) => void)

  Retrieves the classes in a given file.

  - - (file): void

    - #### Parameters

      - file: any

        The file to parse for classes.

      #### Returns void

- ##### getFunctionsinClass: ((file, className) => void)

  Retrieves the functions in a given class within a file.

  - - (file, className): void

    - #### Parameters

      - file: any

        The file containing the class.

      - className: any

        The name of the class to parse for functions.

      #### Returns void

- Defined in src/index.ts:84

### codeutils

codeutils: {
getAllFilesAsMarkDown: (() => Promise<string>);
getJsTree: ((filePath?) => Promise<any>);
getMatcherList: (() => Promise<GetMatcherListTreeResponse>);
matchDetail: ((matcher) => Promise<getMatchDetail>);
performMatch: ((matcherDefinition, problemPatterns, problems) => Promise<MatchProblemResponse>);
} = cbcodeutils

#### Type declaration

- ##### getAllFilesAsMarkDown: (() => Promise<string>)

  Retrieves all files as Markdown.

  #### Returns

  A promise that resolves with the Markdown content of all files.

  - - (): Promise<string>

    - #### Returns Promise<string>

- ##### getJsTree: ((filePath?) => Promise<any>)

  Retrieves a JavaScript tree structure for a given file path.

  #### Returns

  A promise that resolves with the JS tree response.

  - - (filePath?): Promise<any>

    - #### Parameters

      - `Optional` filePath: string

        The path of the file to retrieve the JS tree for.

      #### Returns Promise<any>

- ##### getMatcherList: (() => Promise<GetMatcherListTreeResponse>)

  Retrieves the list of matchers.

  #### Returns

  A promise that resolves with the list of matchers response.

  - - (): Promise<GetMatcherListTreeResponse>

    - #### Returns Promise<GetMatcherListTreeResponse>

- ##### matchDetail: ((matcher) => Promise<getMatchDetail>)

  Retrieves details of a match.

  #### Returns

  A promise that resolves with the match detail response.

  - - (matcher): Promise<getMatchDetail>

    - #### Parameters

      - matcher: string

        The matcher to retrieve details for.

      #### Returns Promise<getMatchDetail>

- ##### performMatch: ((matcherDefinition, problemPatterns, problems) => Promise<MatchProblemResponse>)

  Performs a matching operation based on the provided matcher definition and problem patterns.

  #### Returns

  A promise that resolves with the matching problem response.

  - - (matcherDefinition, problemPatterns, problems): Promise<MatchProblemResponse>

    - #### Parameters

      - matcherDefinition: object

        The definition of the matcher.

      - problemPatterns: any[]

        The patterns to match against.

      - problems: any[]

        The list of problems.

      #### Returns Promise<MatchProblemResponse>

- Defined in src/index.ts:78

### crawler

crawler: {
click: ((id) => Promise<unknown>);
crawl: ((query) => Promise<unknown>);
enter: (() => void);
goToPage: ((url) => void);
screenshot: (() => void);
scroll: ((direction) => void);
start: (() => void);
type: ((id, text) => Promise<unknown>);
} = cbcrawler

#### Type declaration

- ##### click: ((id) => Promise<unknown>)

  Simulates a click event on an element with the specified ID.

  #### Returns

  A promise that resolves when the click action is complete.

  - - (id): Promise<unknown>

    - #### Parameters

      - id: string

        The ID of the element to be clicked.

      #### Returns Promise<unknown>

- ##### crawl: ((query) => Promise<unknown>)

  Initiates a crawl process.

  - - (query): Promise<unknown>

    - #### Parameters

      - query: string

      #### Returns Promise<unknown>

- ##### enter: (() => void)

  Simulates the Enter key press using the crawler.

  - - (): void

    - #### Returns void

- ##### goToPage: ((url) => void)

  Directs the crawler to navigate to a specified URL.

  - - (url): void

    - #### Parameters

      - url: string

        The URL for the crawler to navigate to.

      #### Returns void

- ##### screenshot: (() => void)

  Takes a screenshot using the crawler.

  - - (): void

    - #### Returns void

- ##### scroll: ((direction) => void)

  Scrolls the crawler in a specified direction.

  - - (direction): void

    - #### Parameters

      - direction: string

        The direction to scroll ('up', 'down', 'left', 'right').

      #### Returns void

- ##### start: (() => void)

  Starts the crawler.

  - - (): void

    - #### Returns void

- ##### type: ((id, text) => Promise<unknown>)

  Types the provided text into an element with the specified ID.

  #### Returns

  A promise that resolves when the type action is complete.

  - - (id, text): Promise<unknown>

    - #### Parameters

      - id: string

        The ID of the element where text will be typed.

      - text: string

        The text to type into the element.

      #### Returns Promise<unknown>

- Defined in src/index.ts:80

### dbmemory

dbmemory: {
addKnowledge: ((key, value) => Promise<MemorySetResponse>);
getKnowledge: ((key) => Promise<MemoryGetResponse>);
} = dbmemory

#### Type declaration

- ##### addKnowledge: ((key, value) => Promise<MemorySetResponse>)

  Adds a key-value pair to the in-memory database.

  #### Returns

  A promise that resolves with the response from the memory set event.

  - - (key, value): Promise<MemorySetResponse>

    - #### Parameters

      - key: string

        The key under which to store the value.

      - value: any

        The value to be stored.

      #### Returns Promise<MemorySetResponse>

- ##### getKnowledge: ((key) => Promise<MemoryGetResponse>)

  Retrieves a value from the in-memory database by key.

  #### Returns

  A promise that resolves with the response from the memory get event.

  - - (key): Promise<MemoryGetResponse>

    - #### Parameters

      - key: string

        The key of the value to retrieve.

      #### Returns Promise<MemoryGetResponse>

- Defined in src/index.ts:87

### debug

debug: {
debug: ((log, type) => Promise<DebugAddLogResponse>);
openDebugBrowser: ((url, port) => Promise<OpenDebugBrowserResponse>);
} = debug

#### Type declaration

- ##### debug: ((log, type) => Promise<DebugAddLogResponse>)

  Sends a log message to the debug websocket and waits for a response.

  #### Returns

  A promise that resolves with the response from the debug event.

  - - (log, type): Promise<DebugAddLogResponse>

    - #### Parameters

      - log: string

        The log message to send.

      - type: logType

        The type of the log message (info, error, warning).

      #### Returns Promise<DebugAddLogResponse>

- ##### openDebugBrowser: ((url, port) => Promise<OpenDebugBrowserResponse>)

  Requests to open a debug browser at the specified URL and port.

  #### Returns

  A promise that resolves with the response from the open debug browser event.

  - - (url, port): Promise<OpenDebugBrowserResponse>

    - #### Parameters

      - url: string

        The URL where the debug browser should be opened.

      - port: number

        The port on which the debug browser will listen.

      #### Returns Promise<OpenDebugBrowserResponse>

- Defined in src/index.ts:91

### docutils

docutils: {
pdf_to_text: ((pdf_path) => Promise<string>);
} = cbdocutils

#### Type declaration

- ##### pdf_to_text: ((pdf_path) => Promise<string>)

  Converts a PDF document to text.

  #### Returns

  A promise that resolves with the converted text.

  - - (pdf_path): Promise<string>

    - #### Parameters

      - pdf_path: any

        The file path to the PDF document to be converted.

      #### Returns Promise<string>

- Defined in src/index.ts:79

### fs

fs: {
createFile: ((fileName, source, filePath) => Promise<CreateFileResponse>);
createFolder: ((folderName, folderPath) => Promise<CreateFolderResponse>);
deleteFile: ((filename, filePath) => Promise<DeleteFileResponse>);
deleteFolder: ((foldername, folderpath) => Promise<DeleteFolderResponse>);
listCodeDefinitionNames: ((path) => Promise<{
result: any;
success: boolean;
}>);
listFile: ((folderPath, isRecursive?) => Promise<unknown>);
readFile: ((filePath) => Promise<ReadFileResponse>);
searchFiles: ((path, regex, filePattern) => Promise<{
result: any;
success: boolean;
}>);
updateFile: ((filename, filePath, newContent) => Promise<UpdateFileResponse>);
writeToFile: ((relPath, newContent) => Promise<unknown>);
} = cbfs

#### Type declaration

- ##### createFile: ((fileName, source, filePath) => Promise<CreateFileResponse>)

  #### Function

  createFile

  #### Description

  Creates a new file.

  #### Returns

  A promise that resolves with the server response.

  - - (fileName, source, filePath): Promise<CreateFileResponse>

    - #### Parameters

      - fileName: string

        The name of the file to create.

      - source: string

        The source content to write into the file.

      - filePath: string

        The path where the file should be created.

      #### Returns Promise<CreateFileResponse>

- ##### createFolder: ((folderName, folderPath) => Promise<CreateFolderResponse>)

  #### Function

  createFolder

  #### Description

  Creates a new folder.

  #### Returns

  A promise that resolves with the server response.

  - - (folderName, folderPath): Promise<CreateFolderResponse>

    - #### Parameters

      - folderName: string

        The name of the folder to create.

      - folderPath: string

        The path where the folder should be created.

      #### Returns Promise<CreateFolderResponse>

- ##### deleteFile: ((filename, filePath) => Promise<DeleteFileResponse>)

  #### Function

  deleteFile

  #### Description

  Deletes a file.

  #### Returns

  A promise that resolves with the server response.

  - - (filename, filePath): Promise<DeleteFileResponse>

    - #### Parameters

      - filename: string

        The name of the file to delete.

      - filePath: string

        The path of the file to delete.

      #### Returns Promise<DeleteFileResponse>

- ##### deleteFolder: ((foldername, folderpath) => Promise<DeleteFolderResponse>)

  #### Function

  deleteFolder

  #### Description

  Deletes a folder.

  #### Returns

  A promise that resolves with the server response.

  - - (foldername, folderpath): Promise<DeleteFolderResponse>

    - #### Parameters

      - foldername: string

        The name of the folder to delete.

      - folderpath: string

        The path of the folder to delete.

      #### Returns Promise<DeleteFolderResponse>

- ##### listCodeDefinitionNames: ((path) => Promise<{
  result: any;
  success: boolean;
  }>)

  #### Function

  listCodeDefinitionNames

  #### Description

  Lists all code definition names in a given path.

  #### Returns

  A promise that resolves with the list of code definition names.

  - - (path): Promise<{
      result: any;
      success: boolean;
      }>

    - #### Parameters

      - path: string

        The path to search for code definitions.

      #### Returns Promise<{
      result: any;
      success: boolean;
      }>

- ##### listFile: ((folderPath, isRecursive?) => Promise<unknown>)

  #### Function

  listFile

  #### Description

  Lists all files.

  #### Returns

  A promise that resolves with the list of files.

  - - (folderPath, isRecursive?): Promise<unknown>

    - #### Parameters

      - folderPath: string
      - isRecursive: boolean = false

      #### Returns Promise<unknown>

- ##### readFile: ((filePath) => Promise<ReadFileResponse>)

  #### Function

  readFile

  #### Description

  Reads the content of a file.

  #### Returns

  A promise that resolves with the server response.

  - - (filePath): Promise<ReadFileResponse>

    - #### Parameters

      - filePath: string

        The path of the file to read.

      #### Returns Promise<ReadFileResponse>

- ##### searchFiles: ((path, regex, filePattern) => Promise<{
  result: any;
  success: boolean;
  }>)

  #### Function

  searchFiles

  #### Description

  Searches files in a given path using a regex pattern.

  #### Returns

  A promise that resolves with the search results.

  - - (path, regex, filePattern): Promise<{
      result: any;
      success: boolean;
      }>

    - #### Parameters

      - path: string

        The path to search within.

      - regex: string

        The regex pattern to search for.

      - filePattern: string

        The file pattern to match files.

      #### Returns Promise<{
      result: any;
      success: boolean;
      }>

- ##### updateFile: ((filename, filePath, newContent) => Promise<UpdateFileResponse>)

  #### Function

  updateFile

  #### Description

  Updates the content of a file.

  #### Returns

  A promise that resolves with the server response.

  - - (filename, filePath, newContent): Promise<UpdateFileResponse>

    - #### Parameters

      - filename: string

        The name of the file to update.

      - filePath: string

        The path of the file to update.

      - newContent: string

        The new content to write into the file.

      #### Returns Promise<UpdateFileResponse>

- ##### writeToFile: ((relPath, newContent) => Promise<unknown>)

  #### Function

  writeToFile

  #### Description

  Writes content to a file.

  #### Returns

  A promise that resolves with the write operation result.

  - - (relPath, newContent): Promise<unknown>

    - #### Parameters

      - relPath: string

        The relative path of the file to write to.

      - newContent: string

        The new content to write into the file.

      #### Returns Promise<unknown>

- Defined in src/index.ts:72

### git

git: {
add: ((path) => Promise<any>);
branch: ((path, branch) => Promise<any>);
checkout: ((path, branch) => Promise<any>);
clone: ((url, path) => Promise<any>);
commit: ((message) => Promise<any>);
diff: ((commitHash, path) => Promise<any>);
init: ((path) => Promise<any>);
logs: ((path) => Promise<any>);
pull: ((path) => Promise<any>);
push: ((path) => Promise<any>);
status: ((path) => Promise<any>);
} = git

#### Type declaration

- ##### add: ((path) => Promise<any>)

  Adds changes in the local repository to the staging area at the given path.

  #### Returns

  A promise that resolves with the response from the add event.

  - - (path): Promise<any>

    - #### Parameters

      - path: string

        The file system path of the local Git repository.

      #### Returns Promise<any>

- ##### branch: ((path, branch) => Promise<any>)

  Creates a new branch in the local repository at the given path.

  #### Returns

  A promise that resolves with the response from the branch event.

  - - (path, branch): Promise<any>

    - #### Parameters

      - path: string

        The file system path of the local Git repository.

      - branch: string

        The name of the new branch to create.

      #### Returns Promise<any>

- ##### checkout: ((path, branch) => Promise<any>)

  Checks out a branch or commit in the local repository at the given path.

  #### Returns

  A promise that resolves with the response from the checkout event.

  - - (path, branch): Promise<any>

    - #### Parameters

      - path: string

        The file system path of the local Git repository.

      - branch: string

        The name of the branch or commit to check out.

      #### Returns Promise<any>

- ##### clone: ((url, path) => Promise<any>)

  Clones a Git repository from the given URL to the specified path.

  #### Returns

  A promise that resolves with the response from the clone event.

  - - (url, path): Promise<any>

    - #### Parameters

      - url: string

        The URL of the Git repository to clone.

      - path: string

        The file system path where the repository should be cloned to.

      #### Returns Promise<any>

- ##### commit: ((message) => Promise<any>)

  Commits the staged changes in the local repository with the given commit message.

  #### Returns

  A promise that resolves with the response from the commit event.

  - - (message): Promise<any>

    - #### Parameters

      - message: string

        The commit message to use for the commit.

      #### Returns Promise<any>

- ##### diff: ((commitHash, path) => Promise<any>)

  Retrieves the diff of changes for a specific commit in the local repository.

  #### Returns

  A promise that resolves with the response from the diff event.

  - - (commitHash, path): Promise<any>

    - #### Parameters

      - commitHash: string

        The hash of the commit to retrieve the diff for.

      - path: string

        The file system path of the local Git repository.

      #### Returns Promise<any>

- ##### init: ((path) => Promise<any>)

  Initializes a new Git repository at the given path.

  #### Returns

  A promise that resolves with the response from the init event.

  - - (path): Promise<any>

    - #### Parameters

      - path: string

        The file system path where the Git repository should be initialized.

      #### Returns Promise<any>

- ##### logs: ((path) => Promise<any>)

  Retrieves the commit logs for the local repository at the given path.

  #### Returns

  A promise that resolves with the response from the logs event.

  - - (path): Promise<any>

    - #### Parameters

      - path: string

        The file system path of the local Git repository.

      #### Returns Promise<any>

- ##### pull: ((path) => Promise<any>)

  Pulls the latest changes from the remote repository to the local repository at the given path.

  #### Returns

  A promise that resolves with the response from the pull event.

  - - (path): Promise<any>

    - #### Parameters

      - path: string

        The file system path of the local Git repository.

      #### Returns Promise<any>

- ##### push: ((path) => Promise<any>)

  Pushes local repository changes to the remote repository at the given path.

  #### Returns

  A promise that resolves with the response from the push event.

  - - (path): Promise<any>

    - #### Parameters

      - path: string

        The file system path of the local Git repository.

      #### Returns Promise<any>

- ##### status: ((path) => Promise<any>)

  Retrieves the status of the local repository at the given path.

  #### Returns

  A promise that resolves with the response from the status event.

  - - (path): Promise<any>

    - #### Parameters

      - path: string

        The file system path of the local Git repository.

      #### Returns Promise<any>

- Defined in src/index.ts:73

### knowledge

knowledge: {} = cbknowledge

#### Type declaration

- Defined in src/index.ts:82

### llm

llm: {
inference: ((message, llmrole) => Promise<LLMResponse>);
} = cbllm

#### Type declaration

- ##### inference: ((message, llmrole) => Promise<LLMResponse>)

  Sends an inference request to the LLM and returns the model's response. The model is selected based on the provided `llmrole`. If the specific model for the role is not found, it falls back to the default model for the current agent, and ultimately to the default application-wide LLM if necessary.

  #### Returns

  A promise that resolves with the LLM's response.

  - - (message, llmrole): Promise<LLMResponse>

    - #### Parameters

      - message: string

        The input message or prompt to be sent to the LLM.

      - llmrole: string

        The role of the LLM to determine which model to use.

      #### Returns Promise<LLMResponse>

- Defined in src/index.ts:74

### outputparsers

outputparsers: {
init: ((output) => void);
parseErrors: ((output) => string[]);
parseWarnings: ((output) => string[]);
} = cboutputparsers

#### Type declaration

- ##### init: ((output) => void)

  Initializes the output parser module. Currently, this function does not perform any operations.

  - - (output): void

    - #### Parameters

      - output: any

        The output to be initialized.

      #### Returns void

- ##### parseErrors: ((output) => string[])

  Parses the given output and returns all the error messages.

  #### Returns

  An array of error messages.

  - - (output): string[]

    - #### Parameters

      - output: any

        The output to parse for error messages.

      #### Returns string[]

- ##### parseWarnings: ((output) => string[])

  Parses the given output and returns all the warning messages.

  #### Returns

  An array of warning messages.

  - - (output): string[]

    - #### Parameters

      - output: any

        The output to parse for warning messages.

      #### Returns string[]

- Defined in src/index.ts:85

### project

project: {
getProjectPath: (() => Promise<GetProjectPathResponse>);
getProjectSettings: ((output) => void);
getRepoMap: ((message) => Promise<GetProjectPathResponse>);
runProject: (() => void);
} = cbproject

#### Type declaration

- ##### getProjectPath: (() => Promise<GetProjectPathResponse>)

  Retrieves the path of the current project.

  #### Returns

  A promise that resolves with the project path response.

  - - (): Promise<GetProjectPathResponse>

    - #### Returns Promise<GetProjectPathResponse>

- ##### getProjectSettings: ((output) => void)

  Placeholder for a method to get project settings. Currently, this method does not perform any operations.

  - - (output): void

    - #### Parameters

      - output: any

        The output where project settings would be stored.

      #### Returns void

- ##### getRepoMap: ((message) => Promise<GetProjectPathResponse>)

  - - (message): Promise<GetProjectPathResponse>

    - #### Parameters

      - message: any

      #### Returns Promise<GetProjectPathResponse>

- ##### runProject: (() => void)

  - - (): void

    - #### Returns void

- Defined in src/index.ts:86

### rag

rag: {
add_file: ((filename, file_path) => void);
init: (() => void);
retrieve_related_knowledge: ((query, filename) => void);
} = cbrag

#### Type declaration

- ##### add_file: ((filename, file_path) => void)

  Adds a file to the CodeBolt File System.

  - - (filename, file_path): void

    - #### Parameters

      - filename: string

        The name of the file to add.

      - file_path: string

        The path where the file should be added.

      #### Returns void

- ##### init: (() => void)

  Initializes the CodeBolt File System Module.

  - - (): void

    - #### Returns void

- ##### retrieve_related_knowledge: ((query, filename) => void)

  Retrieves related knowledge for a given query and filename.

  - - (query, filename): void

    - #### Parameters

      - query: string

        The query to retrieve related knowledge for.

      - filename: string

        The name of the file associated with the query.

      #### Returns void

- Defined in src/index.ts:83

### search

search: {
get_first_link: ((query) => Promise<string>);
init: ((engine?) => void);
search: ((query) => Promise<string>);
} = cbsearch

#### Type declaration

- ##### get_first_link: ((query) => Promise<string>)

  Retrieves the first link from the search results for the given query.

  #### Returns

  A promise that resolves with the first link of the search results.

  - - (query): Promise<string>

    - #### Parameters

      - query: string

        The search query.

      #### Returns Promise<string>

- ##### init: ((engine?) => void)

  Initializes the search module with the specified search engine.

  - - (engine?): void

    - #### Parameters

      - `Optional` engine: string = "bing"

        The search engine to use for initializing the module.

      #### Returns void

- ##### search: ((query) => Promise<string>)

  Performs a search operation for the given query.

  #### Returns

  A promise that resolves with the search results.

  - - (query): Promise<string>

    - #### Parameters

      - query: string

        The search query.

      #### Returns Promise<string>

- Defined in src/index.ts:81

### taskplaner

taskplaner: {
addTask: ((task) => Promise<any>);
getTasks: (() => Promise<any>);
updateTask: ((task) => Promise<any>);
} = task

#### Type declaration

- ##### addTask: ((task) => Promise<any>)

  Adds a task using a WebSocket message.

  #### Returns

  A promise that resolves with the response from the add task event.

  - - (task): Promise<any>

    - #### Parameters

      - task: string

        The task to be added.

      #### Returns Promise<any>

- ##### getTasks: (() => Promise<any>)

  Retrieves all tasks using a WebSocket message.

  #### Returns

  A promise that resolves with the response from the get tasks event.

  - - (): Promise<any>

    - #### Returns Promise<any>

- ##### updateTask: ((task) => Promise<any>)

  Updates an existing task using a WebSocket message.

  #### Returns

  A promise that resolves with the response from the update task event.

  - - (task): Promise<any>

    - #### Parameters

      - task: string

        The updated task information.

      #### Returns Promise<any>

- Defined in src/index.ts:89

### terminal

terminal: {
eventEmitter: CustomEventEmitter;
executeCommand: ((command, returnEmptyStringOnSuccess?) => Promise<unknown>);
executeCommandRunUntilError: ((command, executeInMain?) => Promise<CommandError>);
executeCommandWithStream(command, executeInMain?): EventEmitter<DefaultEventMap>;
sendManualInterrupt(): Promise<TerminalInterruptResponse>;
} = cbterminal

#### Type declaration

- ##### eventEmitter: CustomEventEmitter

- ##### executeCommand: ((command, returnEmptyStringOnSuccess?) => Promise<unknown>)

  Executes a given command and returns the result. Listens for messages from the WebSocket that indicate the output, error, or finish state of the executed command and resolves the promise accordingly.

  #### Returns

  A promise that resolves with the command's output, error, or finish signal.

  - - (command, returnEmptyStringOnSuccess?): Promise<unknown>

    - #### Parameters

      - command: string

        The command to be executed.

      - returnEmptyStringOnSuccess: boolean = false

      #### Returns Promise<unknown>

- ##### executeCommandRunUntilError: ((command, executeInMain?) => Promise<CommandError>)

  Executes a given command and keeps running until an error occurs. Listens for messages from the WebSocket and resolves the promise when an error is encountered.

  #### Returns

  A promise that resolves when an error occurs during command execution.

  - - (command, executeInMain?): Promise<CommandError>

    - #### Parameters

      - command: string

        The command to be executed.

      - executeInMain: boolean = false

      #### Returns Promise<CommandError>

- ##### executeCommandWithStream:function

  - executeCommandWithStream(command, executeInMain?): EventEmitter<DefaultEventMap>

  - Executes a given command and streams the output. Listens for messages from the WebSocket and streams the output data.

    #### Parameters

    - command: string

      The command to be executed.

    - executeInMain: boolean = false

    #### Returns EventEmitter<DefaultEventMap>

    A promise that streams the output data during command execution.

    - Defined in src/modules/terminal.ts:90

- ##### sendManualInterrupt:function

  - sendManualInterrupt(): Promise<TerminalInterruptResponse>

  - Sends a manual interrupt signal to the terminal.

    #### Returns Promise<TerminalInterruptResponse>

    - Defined in src/modules/terminal.ts:68

- Defined in src/index.ts:77

### tokenizer

tokenizer: {
addToken: ((key) => Promise<AddTokenResponse>);
getToken: ((key) => Promise<GetTokenResponse>);
} = tokenizer

#### Type declaration

- ##### addToken: ((key) => Promise<AddTokenResponse>)

  Adds a token to the system via WebSocket.

  #### Returns

  A promise that resolves with the response from the add token event.

  - - (key): Promise<AddTokenResponse>

    - #### Parameters

      - key: string

        The key associated with the token to be added.

      #### Returns Promise<AddTokenResponse>

- ##### getToken: ((key) => Promise<GetTokenResponse>)

  Retrieves a token from the system via WebSocket.

  #### Returns

  A promise that resolves with the response from the get token event.

  - - (key): Promise<GetTokenResponse>

    - #### Parameters

      - key: string

        The key associated with the token to be retrieved.

      #### Returns Promise<GetTokenResponse>

- Defined in src/index.ts:92

### vectordb

vectordb: {
addVectorItem: ((item) => Promise<AddVectorItemResponse>);
getVector: ((key) => Promise<GetVectorResponse>);
queryVectorItem: ((key) => Promise<QueryVectorItemResponse>);
queryVectorItems: ((items, dbPath) => Promise<QueryVectorItemResponse>);
} = vectorDB

#### Type declaration

- ##### addVectorItem: ((item) => Promise<AddVectorItemResponse>)

  Adds a new vector item to the vector database.

  #### Returns

  A promise that resolves when the item is successfully added.

  - - (item): Promise<AddVectorItemResponse>

    - #### Parameters

      - item: any

        The item to add to the vector.

      #### Returns Promise<AddVectorItemResponse>

- ##### getVector: ((key) => Promise<GetVectorResponse>)

  Retrieves a vector from the vector database based on the provided key.

  #### Returns

  A promise that resolves with the retrieved vector.

  - - (key): Promise<GetVectorResponse>

    - #### Parameters

      - key: string

        The key of the vector to retrieve.

      #### Returns Promise<GetVectorResponse>

- ##### queryVectorItem: ((key) => Promise<QueryVectorItemResponse>)

  Queries a vector item from the vector database based on the provided key.

  #### Returns

  A promise that resolves with the queried vector item.

  - - (key): Promise<QueryVectorItemResponse>

    - #### Parameters

      - key: string

        The key of the vector to query the item from.

      #### Returns Promise<QueryVectorItemResponse>

- ##### queryVectorItems: ((items, dbPath) => Promise<QueryVectorItemResponse>)

  Queries a vector item from the vector database based on the provided key.

  #### Returns

  A promise that resolves with the queried vector item.

  - - (items, dbPath): Promise<QueryVectorItemResponse>

    - #### Parameters

      - items: []
      - dbPath: string

      #### Returns Promise<QueryVectorItemResponse>

- Defined in src/index.ts:90

### websocket

websocket: null | WebSocket = null

- Defined in src/index.ts:71

## Methods

### waitForConnection

- waitForConnection(): Promise<void>

- #### Returns Promise<void>

  A promise that resolves when the WebSocket connection is open.

  #### Method

  waitForConnection

  #### Description

  Waits for the WebSocket connection to open.

  - Defined in src/index.ts:48