@codebolt/codeboltjs 1.1.94 → 1.1.96

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.
@@ -1,6 +1,16 @@
1
1
  import { UserMessage } from '../utils';
2
2
  import cbws from './websocket';
3
+
4
+ /**
5
+ * Object containing methods for interacting with Codebolt MCP (Model Context Protocol) tools.
6
+ * Provides functionality to discover, list, and execute tools.
7
+ */
3
8
  const codeboltMCP = {
9
+ /**
10
+ * Gets the list of currently enabled toolboxes.
11
+ *
12
+ * @returns Promise with the enabled toolboxes data
13
+ */
4
14
  getEnabledToolBoxes: (): Promise<any> => {
5
15
  return new Promise((resolve, reject) => {
6
16
  cbws.getWebsocket.send(JSON.stringify({
@@ -22,6 +32,12 @@ const codeboltMCP = {
22
32
  });
23
33
  });
24
34
  },
35
+
36
+ /**
37
+ * Gets the list of locally available toolboxes.
38
+ *
39
+ * @returns Promise with the local toolboxes data
40
+ */
25
41
  getLocalToolBoxes: (): Promise<any> => {
26
42
  return new Promise((resolve, reject) => {
27
43
  cbws.getWebsocket.send(JSON.stringify({
@@ -43,11 +59,24 @@ const codeboltMCP = {
43
59
  });
44
60
  });
45
61
  },
62
+
63
+ /**
64
+ * Gets toolboxes mentioned in a user message.
65
+ *
66
+ * @param userMessage - The user message to extract mentions from
67
+ * @returns Promise with the mentioned toolboxes
68
+ */
46
69
  getMentionedToolBoxes: (userMessage: UserMessage): Promise<any> => {
47
70
  return new Promise((resolve, reject) => {
48
71
  resolve(userMessage.mentionedMCPs);
49
72
  });
50
73
  },
74
+
75
+ /**
76
+ * Gets all available toolboxes.
77
+ *
78
+ * @returns Promise with all available toolboxes data
79
+ */
51
80
  getAvailableToolBoxes: (): Promise<any> => {
52
81
  return new Promise((resolve, reject) => {
53
82
  cbws.getWebsocket.send(JSON.stringify({
@@ -69,6 +98,13 @@ const codeboltMCP = {
69
98
  });
70
99
  });
71
100
  },
101
+
102
+ /**
103
+ * Searches for available toolboxes matching a query.
104
+ *
105
+ * @param query - The search query string
106
+ * @returns Promise with matching toolboxes data
107
+ */
72
108
  searchAvailableToolBoxes: (query: string): Promise<any> => {
73
109
  return new Promise((resolve, reject) => {
74
110
  cbws.getWebsocket.send(JSON.stringify({
@@ -91,6 +127,13 @@ const codeboltMCP = {
91
127
  });
92
128
  });
93
129
  },
130
+
131
+ /**
132
+ * Lists all tools from the specified toolboxes.
133
+ *
134
+ * @param toolBoxes - Array of toolbox names to list tools from
135
+ * @returns Promise with tools from the specified toolboxes
136
+ */
94
137
  listToolsFromToolBoxes: (toolBoxes: string[]): Promise<any> => {
95
138
  return new Promise((resolve, reject) => {
96
139
  cbws.getWebsocket.send(JSON.stringify({
@@ -114,6 +157,14 @@ const codeboltMCP = {
114
157
  });
115
158
 
116
159
  },
160
+
161
+ /**
162
+ * Configures a specific toolbox with provided configuration.
163
+ *
164
+ * @param name - The name of the toolbox to configure
165
+ * @param config - Configuration object for the toolbox
166
+ * @returns Promise with the configuration result
167
+ */
117
168
  configureToolBox: (name: string, config: any): Promise<any> => {
118
169
  return new Promise((resolve, reject) => {
119
170
  cbws.getWebsocket.send(JSON.stringify({
@@ -137,6 +188,13 @@ const codeboltMCP = {
137
188
  });
138
189
  });
139
190
  },
191
+
192
+ /**
193
+ * Gets detailed information about specific tools.
194
+ *
195
+ * @param tools - Array of toolbox and tool name pairs
196
+ * @returns Promise with detailed information about the tools
197
+ */
140
198
  getTools: (tools: { toolbox: string, toolName: string }[]): Promise<any[]> => {
141
199
  return new Promise((resolve, reject) => {
142
200
  cbws.getWebsocket.send(JSON.stringify({
@@ -159,6 +217,15 @@ const codeboltMCP = {
159
217
  });
160
218
  });
161
219
  },
220
+
221
+ /**
222
+ * Executes a specific tool with provided parameters.
223
+ *
224
+ * @param toolbox - The name of the toolbox containing the tool
225
+ * @param toolName - The name of the tool to execute
226
+ * @param params - Parameters to pass to the tool
227
+ * @returns Promise with the execution result
228
+ */
162
229
  executeTool: (toolbox: string, toolName: string, params: any): Promise<any> => {
163
230
  return new Promise((resolve, reject) => {
164
231
  cbws.getWebsocket.send(JSON.stringify({
@@ -1,282 +0,0 @@
1
- {
2
- "name": "lib",
3
- "lockfileVersion": 3,
4
- "requires": true,
5
- "packages": {
6
- "": {
7
- "dependencies": {
8
- "@codebolt/codeboltjs": "^1.1.89",
9
- "js-yaml": "^4.1.0"
10
- }
11
- },
12
- "node_modules/@codebolt/codeboltjs": {
13
- "version": "1.1.89",
14
- "resolved": "https://registry.npmjs.org/@codebolt/codeboltjs/-/codeboltjs-1.1.89.tgz",
15
- "integrity": "sha512-hnYgk2U+jSCQUmfUqqqIZ6NDgY+dQ77scUZkKAD1364+khtxE0iQx3PmMKolLZt4Z9VEWFzgVX37S/9683OV1w==",
16
- "license": "MIT",
17
- "dependencies": {
18
- "@codebolt/types": "^1.0.10",
19
- "js-yaml": "^4.1.0",
20
- "tree-sitter": "^0.21.1",
21
- "tree-sitter-javascript": "^0.23.1",
22
- "tree-sitter-typescript": "^0.23.2",
23
- "typedoc-plugin-missing-exports": "^2.2.0",
24
- "ws": "^8.17.0"
25
- }
26
- },
27
- "node_modules/@codebolt/types": {
28
- "version": "1.0.10",
29
- "resolved": "https://registry.npmjs.org/@codebolt/types/-/types-1.0.10.tgz",
30
- "integrity": "sha512-tQgFq9Lo9oJNIZHOvvyVjcsE+1Tk515VhMel2YyoDZvKFbfQauNripAfaKDOxBO4naZ8davqmq3pXsDTX8vb8w==",
31
- "license": "ISC"
32
- },
33
- "node_modules/ansi-sequence-parser": {
34
- "version": "1.1.3",
35
- "resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.3.tgz",
36
- "integrity": "sha512-+fksAx9eG3Ab6LDnLs3ZqZa8KVJ/jYnX+D4Qe1azX+LFGFAXqynCQLOdLpNYN/l9e7l6hMWwZbrnctqr6eSQSw==",
37
- "license": "MIT",
38
- "peer": true
39
- },
40
- "node_modules/argparse": {
41
- "version": "2.0.1",
42
- "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
43
- "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
44
- "license": "Python-2.0"
45
- },
46
- "node_modules/balanced-match": {
47
- "version": "1.0.2",
48
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
49
- "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
50
- "license": "MIT",
51
- "peer": true
52
- },
53
- "node_modules/brace-expansion": {
54
- "version": "2.0.1",
55
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
56
- "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
57
- "license": "MIT",
58
- "peer": true,
59
- "dependencies": {
60
- "balanced-match": "^1.0.0"
61
- }
62
- },
63
- "node_modules/js-yaml": {
64
- "version": "4.1.0",
65
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
66
- "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
67
- "license": "MIT",
68
- "dependencies": {
69
- "argparse": "^2.0.1"
70
- },
71
- "bin": {
72
- "js-yaml": "bin/js-yaml.js"
73
- }
74
- },
75
- "node_modules/jsonc-parser": {
76
- "version": "3.3.1",
77
- "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz",
78
- "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==",
79
- "license": "MIT",
80
- "peer": true
81
- },
82
- "node_modules/lunr": {
83
- "version": "2.3.9",
84
- "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz",
85
- "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==",
86
- "license": "MIT",
87
- "peer": true
88
- },
89
- "node_modules/marked": {
90
- "version": "4.3.0",
91
- "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz",
92
- "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==",
93
- "license": "MIT",
94
- "peer": true,
95
- "bin": {
96
- "marked": "bin/marked.js"
97
- },
98
- "engines": {
99
- "node": ">= 12"
100
- }
101
- },
102
- "node_modules/minimatch": {
103
- "version": "9.0.5",
104
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",
105
- "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",
106
- "license": "ISC",
107
- "peer": true,
108
- "dependencies": {
109
- "brace-expansion": "^2.0.1"
110
- },
111
- "engines": {
112
- "node": ">=16 || 14 >=14.17"
113
- },
114
- "funding": {
115
- "url": "https://github.com/sponsors/isaacs"
116
- }
117
- },
118
- "node_modules/node-addon-api": {
119
- "version": "8.3.0",
120
- "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-8.3.0.tgz",
121
- "integrity": "sha512-8VOpLHFrOQlAH+qA0ZzuGRlALRA6/LVh8QJldbrC4DY0hXoMP0l4Acq8TzFC018HztWiRqyCEj2aTWY2UvnJUg==",
122
- "license": "MIT",
123
- "engines": {
124
- "node": "^18 || ^20 || >= 21"
125
- }
126
- },
127
- "node_modules/node-gyp-build": {
128
- "version": "4.8.4",
129
- "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz",
130
- "integrity": "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==",
131
- "license": "MIT",
132
- "bin": {
133
- "node-gyp-build": "bin.js",
134
- "node-gyp-build-optional": "optional.js",
135
- "node-gyp-build-test": "build-test.js"
136
- }
137
- },
138
- "node_modules/shiki": {
139
- "version": "0.14.7",
140
- "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.7.tgz",
141
- "integrity": "sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==",
142
- "license": "MIT",
143
- "peer": true,
144
- "dependencies": {
145
- "ansi-sequence-parser": "^1.1.0",
146
- "jsonc-parser": "^3.2.0",
147
- "vscode-oniguruma": "^1.7.0",
148
- "vscode-textmate": "^8.0.0"
149
- }
150
- },
151
- "node_modules/tree-sitter": {
152
- "version": "0.21.1",
153
- "resolved": "https://registry.npmjs.org/tree-sitter/-/tree-sitter-0.21.1.tgz",
154
- "integrity": "sha512-7dxoA6kYvtgWw80265MyqJlkRl4yawIjO7S5MigytjELkX43fV2WsAXzsNfO7sBpPPCF5Gp0+XzHk0DwLCq3xQ==",
155
- "hasInstallScript": true,
156
- "license": "MIT",
157
- "dependencies": {
158
- "node-addon-api": "^8.0.0",
159
- "node-gyp-build": "^4.8.0"
160
- }
161
- },
162
- "node_modules/tree-sitter-javascript": {
163
- "version": "0.23.1",
164
- "resolved": "https://registry.npmjs.org/tree-sitter-javascript/-/tree-sitter-javascript-0.23.1.tgz",
165
- "integrity": "sha512-/bnhbrTD9frUYHQTiYnPcxyHORIw157ERBa6dqzaKxvR/x3PC4Yzd+D1pZIMS6zNg2v3a8BZ0oK7jHqsQo9fWA==",
166
- "hasInstallScript": true,
167
- "license": "MIT",
168
- "dependencies": {
169
- "node-addon-api": "^8.2.2",
170
- "node-gyp-build": "^4.8.2"
171
- },
172
- "peerDependencies": {
173
- "tree-sitter": "^0.21.1"
174
- },
175
- "peerDependenciesMeta": {
176
- "tree-sitter": {
177
- "optional": true
178
- }
179
- }
180
- },
181
- "node_modules/tree-sitter-typescript": {
182
- "version": "0.23.2",
183
- "resolved": "https://registry.npmjs.org/tree-sitter-typescript/-/tree-sitter-typescript-0.23.2.tgz",
184
- "integrity": "sha512-e04JUUKxTT53/x3Uq1zIL45DoYKVfHH4CZqwgZhPg5qYROl5nQjV+85ruFzFGZxu+QeFVbRTPDRnqL9UbU4VeA==",
185
- "hasInstallScript": true,
186
- "license": "MIT",
187
- "dependencies": {
188
- "node-addon-api": "^8.2.2",
189
- "node-gyp-build": "^4.8.2",
190
- "tree-sitter-javascript": "^0.23.1"
191
- },
192
- "peerDependencies": {
193
- "tree-sitter": "^0.21.0"
194
- },
195
- "peerDependenciesMeta": {
196
- "tree-sitter": {
197
- "optional": true
198
- }
199
- }
200
- },
201
- "node_modules/typedoc": {
202
- "version": "0.25.13",
203
- "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.13.tgz",
204
- "integrity": "sha512-pQqiwiJ+Z4pigfOnnysObszLiU3mVLWAExSPf+Mu06G/qsc3wzbuM56SZQvONhHLncLUhYzOVkjFFpFfL5AzhQ==",
205
- "license": "Apache-2.0",
206
- "peer": true,
207
- "dependencies": {
208
- "lunr": "^2.3.9",
209
- "marked": "^4.3.0",
210
- "minimatch": "^9.0.3",
211
- "shiki": "^0.14.7"
212
- },
213
- "bin": {
214
- "typedoc": "bin/typedoc"
215
- },
216
- "engines": {
217
- "node": ">= 16"
218
- },
219
- "peerDependencies": {
220
- "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x"
221
- }
222
- },
223
- "node_modules/typedoc-plugin-missing-exports": {
224
- "version": "2.3.0",
225
- "resolved": "https://registry.npmjs.org/typedoc-plugin-missing-exports/-/typedoc-plugin-missing-exports-2.3.0.tgz",
226
- "integrity": "sha512-iI9ITNNLlbsLCBBeYDyu0Qqp3GN/9AGyWNKg8bctRXuZEPT7G1L+0+MNWG9MsHcf/BFmNbXL0nQ8mC/tXRicog==",
227
- "license": "MIT",
228
- "peerDependencies": {
229
- "typedoc": "0.24.x || 0.25.x"
230
- }
231
- },
232
- "node_modules/typescript": {
233
- "version": "5.4.5",
234
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
235
- "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
236
- "license": "Apache-2.0",
237
- "peer": true,
238
- "bin": {
239
- "tsc": "bin/tsc",
240
- "tsserver": "bin/tsserver"
241
- },
242
- "engines": {
243
- "node": ">=14.17"
244
- }
245
- },
246
- "node_modules/vscode-oniguruma": {
247
- "version": "1.7.0",
248
- "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz",
249
- "integrity": "sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==",
250
- "license": "MIT",
251
- "peer": true
252
- },
253
- "node_modules/vscode-textmate": {
254
- "version": "8.0.0",
255
- "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-8.0.0.tgz",
256
- "integrity": "sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==",
257
- "license": "MIT",
258
- "peer": true
259
- },
260
- "node_modules/ws": {
261
- "version": "8.18.0",
262
- "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz",
263
- "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==",
264
- "license": "MIT",
265
- "engines": {
266
- "node": ">=10.0.0"
267
- },
268
- "peerDependencies": {
269
- "bufferutil": "^4.0.1",
270
- "utf-8-validate": ">=5.0.2"
271
- },
272
- "peerDependenciesMeta": {
273
- "bufferutil": {
274
- "optional": true
275
- },
276
- "utf-8-validate": {
277
- "optional": true
278
- }
279
- }
280
- }
281
- }
282
- }
@@ -1,6 +0,0 @@
1
- {
2
- "dependencies": {
3
- "js-yaml": "^4.1.0",
4
- "@codebolt/codeboltjs": "^1.1.89"
5
- }
6
- }
File without changes