@codebolt/codeboltjs 1.1.72 → 1.1.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +92 -0
- package/package.json +4 -2
package/index.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const websocket_1 = __importDefault(require("./modules/websocket"));
|
|
7
|
+
const fs_1 = __importDefault(require("./modules/fs"));
|
|
8
|
+
const llm_1 = __importDefault(require("./modules/llm"));
|
|
9
|
+
const terminal_1 = __importDefault(require("./modules/terminal"));
|
|
10
|
+
const browser_1 = __importDefault(require("./modules/browser"));
|
|
11
|
+
const chat_1 = __importDefault(require("./modules/chat"));
|
|
12
|
+
const codeutils_1 = __importDefault(require("./modules/codeutils"));
|
|
13
|
+
const docutils_1 = __importDefault(require("./modules/docutils"));
|
|
14
|
+
const crawler_1 = __importDefault(require("./modules/crawler"));
|
|
15
|
+
const search_1 = __importDefault(require("./modules/search"));
|
|
16
|
+
const knowledge_1 = __importDefault(require("./modules/knowledge"));
|
|
17
|
+
const rag_1 = __importDefault(require("./modules/rag"));
|
|
18
|
+
const codeparsers_1 = __importDefault(require("./modules/codeparsers"));
|
|
19
|
+
const outputparsers_1 = __importDefault(require("./modules/outputparsers"));
|
|
20
|
+
const project_1 = __importDefault(require("./modules/project"));
|
|
21
|
+
const git_1 = __importDefault(require("./modules/git"));
|
|
22
|
+
const dbmemory_1 = __importDefault(require("./modules/dbmemory"));
|
|
23
|
+
const state_1 = __importDefault(require("./modules/state"));
|
|
24
|
+
const task_1 = __importDefault(require("./modules/task"));
|
|
25
|
+
const vectordb_1 = __importDefault(require("./modules/vectordb"));
|
|
26
|
+
const debug_1 = __importDefault(require("./modules/debug"));
|
|
27
|
+
const tokenizer_1 = __importDefault(require("./modules/tokenizer"));
|
|
28
|
+
const ws_1 = __importDefault(require("ws"));
|
|
29
|
+
const history_1 = require("./modules/history");
|
|
30
|
+
const mcp_1 = __importDefault(require("./modules/mcp"));
|
|
31
|
+
/**
|
|
32
|
+
* @class Codebolt
|
|
33
|
+
* @description This class provides a unified interface to interact with various modules.
|
|
34
|
+
*/
|
|
35
|
+
class Codebolt {
|
|
36
|
+
/**
|
|
37
|
+
* @constructor
|
|
38
|
+
* @description Initializes the websocket connection.
|
|
39
|
+
*/
|
|
40
|
+
constructor() {
|
|
41
|
+
this.websocket = null;
|
|
42
|
+
this.fs = fs_1.default;
|
|
43
|
+
this.git = git_1.default;
|
|
44
|
+
this.llm = llm_1.default;
|
|
45
|
+
this.browser = browser_1.default;
|
|
46
|
+
this.chat = chat_1.default;
|
|
47
|
+
this.terminal = terminal_1.default;
|
|
48
|
+
this.codeutils = codeutils_1.default;
|
|
49
|
+
this.docutils = docutils_1.default;
|
|
50
|
+
this.crawler = crawler_1.default;
|
|
51
|
+
this.search = search_1.default;
|
|
52
|
+
this.knowledge = knowledge_1.default;
|
|
53
|
+
this.rag = rag_1.default;
|
|
54
|
+
this.codeparsers = codeparsers_1.default;
|
|
55
|
+
this.outputparsers = outputparsers_1.default;
|
|
56
|
+
this.project = project_1.default;
|
|
57
|
+
this.dbmemory = dbmemory_1.default;
|
|
58
|
+
this.cbstate = state_1.default;
|
|
59
|
+
this.taskplaner = task_1.default;
|
|
60
|
+
this.vectordb = vectordb_1.default;
|
|
61
|
+
this.debug = debug_1.default;
|
|
62
|
+
this.tokenizer = tokenizer_1.default;
|
|
63
|
+
this.chatSummary = history_1.chatSummary;
|
|
64
|
+
this.MCP = mcp_1.default;
|
|
65
|
+
this.websocket = websocket_1.default.getWebsocket;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* @method waitForConnection
|
|
69
|
+
* @description Waits for the WebSocket connection to open.
|
|
70
|
+
* @returns {Promise<void>} A promise that resolves when the WebSocket connection is open.
|
|
71
|
+
*/
|
|
72
|
+
async waitForConnection() {
|
|
73
|
+
return new Promise((resolve, reject) => {
|
|
74
|
+
if (!this.websocket) {
|
|
75
|
+
reject(new Error('WebSocket is not initialized'));
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (this.websocket.readyState === ws_1.default.OPEN) {
|
|
79
|
+
resolve();
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
this.websocket.addEventListener('open', () => {
|
|
83
|
+
resolve();
|
|
84
|
+
});
|
|
85
|
+
this.websocket.addEventListener('error', (error) => {
|
|
86
|
+
reject(error);
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
exports.default = new Codebolt();
|
|
92
|
+
// module.exports = new Codebolt();
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codebolt/codeboltjs",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.73",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"build": "
|
|
9
|
+
"build": "tsc",
|
|
10
10
|
"build:docs": "typedoc --plugin typedoc-plugin-missing-exports",
|
|
11
11
|
"build:jsondocs": "typedoc --plugin typedoc-plugin-missing-exports --json out.json --pretty",
|
|
12
12
|
"test": "jest fs.test.js"
|
|
@@ -19,8 +19,10 @@
|
|
|
19
19
|
"homepage": "https://codeboltai.github.io",
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@codebolt/types": "^1.0.10",
|
|
22
|
+
"bufferutil": "^4.0.9",
|
|
22
23
|
"js-yaml": "^4.1.0",
|
|
23
24
|
"typedoc-plugin-missing-exports": "^2.2.0",
|
|
25
|
+
"utf-8-validate": "^6.0.5",
|
|
24
26
|
"ws": "^8.17.0"
|
|
25
27
|
},
|
|
26
28
|
"devDependencies": {
|