@codebolt/codeboltjs 1.1.70 → 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.
Files changed (82) hide show
  1. package/index.js +2 -0
  2. package/package.json +4 -2
  3. package/src/index.ts +3 -1
  4. package/webpack.config.js +1 -1
  5. package/docs/modules/_internal_.EventEmitter.html +0 -6
  6. package/docs/modules/_internal_.WebSocket.html +0 -21
  7. package/docs/modules/_internal_._node_stream_consumers_.html +0 -6
  8. package/docs/modules/_internal_._node_stream_promises_.html +0 -3
  9. package/docs/modules/_internal_.html +0 -228
  10. package/docs/modules/_internal_.internal.finished.html +0 -2
  11. package/docs/modules/_internal_.internal.html +0 -36
  12. package/docs/modules/_internal_.internal.pipeline.html +0 -2
  13. package/index.d.ts +0 -238
  14. package/modules/browser.d.ts +0 -108
  15. package/modules/browser.js +0 -331
  16. package/modules/chat.d.ts +0 -63
  17. package/modules/chat.js +0 -174
  18. package/modules/codeparsers.d.ts +0 -23
  19. package/modules/codeparsers.js +0 -30
  20. package/modules/codeutils.d.ts +0 -37
  21. package/modules/codeutils.js +0 -166
  22. package/modules/crawler.d.ts +0 -45
  23. package/modules/crawler.js +0 -123
  24. package/modules/dbmemory.d.ts +0 -20
  25. package/modules/dbmemory.js +0 -54
  26. package/modules/debug.d.ts +0 -23
  27. package/modules/debug.js +0 -64
  28. package/modules/docutils.d.ts +0 -12
  29. package/modules/docutils.js +0 -19
  30. package/modules/fs.d.ts +0 -94
  31. package/modules/fs.js +0 -264
  32. package/modules/git.d.ts +0 -76
  33. package/modules/git.js +0 -240
  34. package/modules/history.d.ts +0 -19
  35. package/modules/history.js +0 -46
  36. package/modules/knowledge.d.ts +0 -2
  37. package/modules/knowledge.js +0 -6
  38. package/modules/llm.d.ts +0 -18
  39. package/modules/llm.js +0 -39
  40. package/modules/outputparsers.d.ts +0 -24
  41. package/modules/outputparsers.js +0 -32
  42. package/modules/project.d.ts +0 -21
  43. package/modules/project.js +0 -72
  44. package/modules/rag.d.ts +0 -22
  45. package/modules/rag.js +0 -30
  46. package/modules/search.d.ts +0 -23
  47. package/modules/search.js +0 -37
  48. package/modules/state.d.ts +0 -21
  49. package/modules/state.js +0 -68
  50. package/modules/task.d.ts +0 -23
  51. package/modules/task.js +0 -75
  52. package/modules/terminal.d.ts +0 -46
  53. package/modules/terminal.js +0 -108
  54. package/modules/tokenizer.d.ts +0 -19
  55. package/modules/tokenizer.js +0 -56
  56. package/modules/vectordb.d.ts +0 -33
  57. package/modules/vectordb.js +0 -103
  58. package/modules/websocket.d.ts +0 -27
  59. package/modules/websocket.js +0 -88
  60. package/src/modules/browser.ts +0 -352
  61. package/src/modules/chat.ts +0 -182
  62. package/src/modules/codeparsers.ts +0 -30
  63. package/src/modules/codeutils.ts +0 -181
  64. package/src/modules/crawler.ts +0 -121
  65. package/src/modules/dbmemory.ts +0 -52
  66. package/src/modules/debug.ts +0 -68
  67. package/src/modules/docutils.ts +0 -18
  68. package/src/modules/fs.ts +0 -263
  69. package/src/modules/git.ts +0 -237
  70. package/src/modules/history.ts +0 -61
  71. package/src/modules/knowledge.ts +0 -5
  72. package/src/modules/llm.ts +0 -36
  73. package/src/modules/outputparsers.ts +0 -30
  74. package/src/modules/project.ts +0 -68
  75. package/src/modules/rag.ts +0 -28
  76. package/src/modules/search.ts +0 -35
  77. package/src/modules/state.ts +0 -69
  78. package/src/modules/task.ts +0 -73
  79. package/src/modules/terminal.ts +0 -114
  80. package/src/modules/tokenizer.ts +0 -56
  81. package/src/modules/vectordb.ts +0 -102
  82. package/src/modules/websocket.ts +0 -89
package/modules/git.js DELETED
@@ -1,240 +0,0 @@
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("./websocket"));
7
- /**
8
- * A service for interacting with Git operations via WebSocket messages.
9
- */
10
- const gitService = {
11
- /**
12
- * Initializes a new Git repository at the given path.
13
- * @param {string} path - The file system path where the Git repository should be initialized.
14
- * @returns {Promise<any>} A promise that resolves with the response from the init event.
15
- */
16
- init: async (path) => {
17
- return new Promise((resolve, reject) => {
18
- websocket_1.default.getWebsocket.send(JSON.stringify({
19
- "type": "gitEvent",
20
- "action": "Init",
21
- "path": path
22
- }));
23
- websocket_1.default.getWebsocket.on('message', (data) => {
24
- const response = JSON.parse(data);
25
- if (response.type === "InitResponse") {
26
- resolve(response);
27
- }
28
- });
29
- });
30
- },
31
- /**
32
- * Clones a Git repository from the given URL to the specified path.
33
- * @param {string} url - The URL of the Git repository to clone.
34
- * @param {string} path - The file system path where the repository should be cloned to.
35
- * @returns {Promise<any>} A promise that resolves with the response from the clone event.
36
- */
37
- clone: async (url, path) => {
38
- return new Promise((resolve, reject) => {
39
- websocket_1.default.getWebsocket.send(JSON.stringify({
40
- "type": "gitEvent",
41
- "action": "Clone",
42
- "url": url,
43
- "path": path
44
- }));
45
- websocket_1.default.getWebsocket.on('message', (data) => {
46
- const response = JSON.parse(data);
47
- if (response.type === "CloneResponse") {
48
- resolve(response);
49
- }
50
- });
51
- });
52
- },
53
- /**
54
- * Pulls the latest changes from the remote repository to the local repository at the given path.
55
- * @param {string} path - The file system path of the local Git repository.
56
- * @returns {Promise<any>} A promise that resolves with the response from the pull event.
57
- */
58
- pull: async (path) => {
59
- return new Promise((resolve, reject) => {
60
- websocket_1.default.getWebsocket.send(JSON.stringify({
61
- "type": "gitEvent",
62
- "action": "Pull",
63
- "path": path
64
- }));
65
- websocket_1.default.getWebsocket.on('message', (data) => {
66
- const response = JSON.parse(data);
67
- if (response.type === "PullResponse") {
68
- resolve(response);
69
- }
70
- });
71
- });
72
- },
73
- /**
74
- * Pushes local repository changes to the remote repository at the given path.
75
- * @param {string} path - The file system path of the local Git repository.
76
- * @returns {Promise<any>} A promise that resolves with the response from the push event.
77
- */
78
- push: async (path) => {
79
- return new Promise((resolve, reject) => {
80
- websocket_1.default.getWebsocket.send(JSON.stringify({
81
- "type": "gitEvent",
82
- "action": "Push",
83
- "path": path
84
- }));
85
- websocket_1.default.getWebsocket.on('message', (data) => {
86
- const response = JSON.parse(data);
87
- if (response.type === "PushResponse") {
88
- resolve(response);
89
- }
90
- });
91
- });
92
- },
93
- /**
94
- * Retrieves the status of the local repository at the given path.
95
- * @param {string} path - The file system path of the local Git repository.
96
- * @returns {Promise<any>} A promise that resolves with the response from the status event.
97
- */
98
- status: async (path) => {
99
- return new Promise((resolve, reject) => {
100
- websocket_1.default.getWebsocket.send(JSON.stringify({
101
- "type": "gitEvent",
102
- "action": "Status",
103
- "path": path
104
- }));
105
- websocket_1.default.getWebsocket.on('message', (data) => {
106
- const response = JSON.parse(data);
107
- if (response.type === "StatusResponse") {
108
- resolve(response);
109
- }
110
- });
111
- });
112
- },
113
- /**
114
- * Adds changes in the local repository to the staging area at the given path.
115
- * @param {string} path - The file system path of the local Git repository.
116
- * @returns {Promise<any>} A promise that resolves with the response from the add event.
117
- */
118
- add: async (path) => {
119
- return new Promise((resolve, reject) => {
120
- websocket_1.default.getWebsocket.send(JSON.stringify({
121
- "type": "gitEvent",
122
- "action": "Add",
123
- "path": path
124
- }));
125
- websocket_1.default.getWebsocket.on('message', (data) => {
126
- const response = JSON.parse(data);
127
- if (response.type === "AddResponse") {
128
- resolve(response);
129
- }
130
- });
131
- });
132
- },
133
- /**
134
- * Commits the staged changes in the local repository with the given commit message.
135
- * @param {string} message - The commit message to use for the commit.
136
- * @returns {Promise<any>} A promise that resolves with the response from the commit event.
137
- */
138
- commit: async (message) => {
139
- return new Promise((resolve, reject) => {
140
- websocket_1.default.getWebsocket.send(JSON.stringify({
141
- "type": "gitEvent",
142
- "action": "Commit",
143
- "message": message
144
- }));
145
- websocket_1.default.getWebsocket.on('message', (data) => {
146
- const response = JSON.parse(data);
147
- if (response.type === "gitCommitResponse") {
148
- resolve(response);
149
- }
150
- });
151
- });
152
- },
153
- /**
154
- * Checks out a branch or commit in the local repository at the given path.
155
- * @param {string} path - The file system path of the local Git repository.
156
- * @param {string} branch - The name of the branch or commit to check out.
157
- * @returns {Promise<any>} A promise that resolves with the response from the checkout event.
158
- */
159
- checkout: async (path, branch) => {
160
- return new Promise((resolve, reject) => {
161
- websocket_1.default.getWebsocket.send(JSON.stringify({
162
- "type": "gitEvent",
163
- "action": "Checkout",
164
- "path": path,
165
- "branch": branch
166
- }));
167
- websocket_1.default.getWebsocket.on('message', (data) => {
168
- const response = JSON.parse(data);
169
- if (response.type === "CheckoutResponse") {
170
- resolve(response);
171
- }
172
- });
173
- });
174
- },
175
- /**
176
- * Creates a new branch in the local repository at the given path.
177
- * @param {string} path - The file system path of the local Git repository.
178
- * @param {string} branch - The name of the new branch to create.
179
- * @returns {Promise<any>} A promise that resolves with the response from the branch event.
180
- */
181
- branch: async (path, branch) => {
182
- return new Promise((resolve, reject) => {
183
- websocket_1.default.getWebsocket.send(JSON.stringify({
184
- "type": "gitEvent",
185
- "action": "Branch",
186
- "path": path,
187
- "branch": branch
188
- }));
189
- websocket_1.default.getWebsocket.on('message', (data) => {
190
- const response = JSON.parse(data);
191
- if (response.type === "BranchResponse") {
192
- resolve(response);
193
- }
194
- });
195
- });
196
- },
197
- /**
198
- * Retrieves the commit logs for the local repository at the given path.
199
- * @param {string} path - The file system path of the local Git repository.
200
- * @returns {Promise<any>} A promise that resolves with the response from the logs event.
201
- */
202
- logs: async (path) => {
203
- return new Promise((resolve, reject) => {
204
- websocket_1.default.getWebsocket.send(JSON.stringify({
205
- "type": "gitEvent",
206
- "action": "Logs",
207
- "path": path
208
- }));
209
- websocket_1.default.getWebsocket.on('message', (data) => {
210
- const response = JSON.parse(data);
211
- if (response.type === "LogsResponse") {
212
- resolve(response);
213
- }
214
- });
215
- });
216
- },
217
- /**
218
- * Retrieves the diff of changes for a specific commit in the local repository.
219
- * @param {string} commitHash - The hash of the commit to retrieve the diff for.
220
- * @param {string} path - The file system path of the local Git repository.
221
- * @returns {Promise<any>} A promise that resolves with the response from the diff event.
222
- */
223
- diff: async (commitHash, path) => {
224
- return new Promise((resolve, reject) => {
225
- websocket_1.default.getWebsocket.send(JSON.stringify({
226
- "type": "gitEvent",
227
- "action": "Diff",
228
- "path": path,
229
- "commitHash": commitHash
230
- }));
231
- websocket_1.default.getWebsocket.on('message', (data) => {
232
- const response = JSON.parse(data);
233
- if (response.type === "DiffResponse") {
234
- resolve(response);
235
- }
236
- });
237
- });
238
- }
239
- };
240
- exports.default = gitService;
@@ -1,19 +0,0 @@
1
- export declare enum logType {
2
- info = "info",
3
- error = "error",
4
- warning = "warning"
5
- }
6
- export declare const chatSummary: {
7
- summarizeAll: () => Promise<{
8
- role: string;
9
- content: string;
10
- }[]>;
11
- summarize: (messages: {
12
- role: string;
13
- content: string;
14
- }[], depth: number) => Promise<{
15
- role: string;
16
- content: string;
17
- }[]>;
18
- };
19
- export default chatSummary;
@@ -1,46 +0,0 @@
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
- exports.chatSummary = exports.logType = void 0;
7
- const websocket_1 = __importDefault(require("./websocket"));
8
- var logType;
9
- (function (logType) {
10
- logType["info"] = "info";
11
- logType["error"] = "error";
12
- logType["warning"] = "warning";
13
- })(logType || (exports.logType = logType = {}));
14
- exports.chatSummary = {
15
- summarizeAll: () => {
16
- return new Promise((resolve, reject) => {
17
- websocket_1.default.getWebsocket.send(JSON.stringify({
18
- "type": "chatSummaryEvent",
19
- "action": "summarizeAll",
20
- }));
21
- websocket_1.default.getWebsocket.on('message', (data) => {
22
- const response = JSON.parse(data);
23
- if (response.type === "getSummarizeAllResponse") {
24
- resolve(response.payload); // Resolve the Promise with the response data
25
- }
26
- });
27
- });
28
- },
29
- summarize: (messages, depth) => {
30
- return new Promise((resolve, reject) => {
31
- websocket_1.default.getWebsocket.send(JSON.stringify({
32
- "type": "chatSummaryEvent",
33
- "action": "summarize",
34
- messages,
35
- depth
36
- }));
37
- websocket_1.default.getWebsocket.on('message', (data) => {
38
- const response = JSON.parse(data);
39
- if (response.type === "getSummarizeResponse") {
40
- resolve(response.payload); // Resolve the Promise with the response data
41
- }
42
- });
43
- });
44
- }
45
- };
46
- exports.default = exports.chatSummary;
@@ -1,2 +0,0 @@
1
- declare const cbKnowledge: {};
2
- export default cbKnowledge;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const cbKnowledge = {
4
- // Methods related to knowledge handling can be added here
5
- };
6
- exports.default = cbKnowledge;
package/modules/llm.d.ts DELETED
@@ -1,18 +0,0 @@
1
- import { LLMResponse } from '@codebolt/types';
2
- /**
3
- * A module for interacting with language learning models (LLMs) via WebSocket.
4
- */
5
- declare const cbllm: {
6
- /**
7
- * Sends an inference request to the LLM and returns the model's response.
8
- * The model is selected based on the provided `llmrole`. If the specific model
9
- * for the role is not found, it falls back to the default model for the current agent,
10
- * and ultimately to the default application-wide LLM if necessary.
11
- *
12
- * @param {string} message - The input message or prompt to be sent to the LLM.
13
- * @param {string} llmrole - The role of the LLM to determine which model to use.
14
- * @returns {Promise<LLMResponse>} A promise that resolves with the LLM's response.
15
- */
16
- inference: (message: string, llmrole: string) => Promise<LLMResponse>;
17
- };
18
- export default cbllm;
package/modules/llm.js DELETED
@@ -1,39 +0,0 @@
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("./websocket"));
7
- /**
8
- * A module for interacting with language learning models (LLMs) via WebSocket.
9
- */
10
- const cbllm = {
11
- /**
12
- * Sends an inference request to the LLM and returns the model's response.
13
- * The model is selected based on the provided `llmrole`. If the specific model
14
- * for the role is not found, it falls back to the default model for the current agent,
15
- * and ultimately to the default application-wide LLM if necessary.
16
- *
17
- * @param {string} message - The input message or prompt to be sent to the LLM.
18
- * @param {string} llmrole - The role of the LLM to determine which model to use.
19
- * @returns {Promise<LLMResponse>} A promise that resolves with the LLM's response.
20
- */
21
- inference: async (message, llmrole) => {
22
- return new Promise((resolve, reject) => {
23
- websocket_1.default.getWebsocket.send(JSON.stringify({
24
- "type": "inference",
25
- "message": {
26
- prompt: message,
27
- llmrole
28
- },
29
- }));
30
- websocket_1.default.getWebsocket.on('message', (data) => {
31
- const response = JSON.parse(data);
32
- if (response.type === "llmResponse") {
33
- resolve(response); // Resolve the Promise with the response data
34
- }
35
- });
36
- });
37
- }
38
- };
39
- exports.default = cbllm;
@@ -1,24 +0,0 @@
1
- /**
2
- * A module for parsing output messages to identify errors and warnings.
3
- */
4
- declare const cboutputparsers: {
5
- /**
6
- * Initializes the output parser module.
7
- * Currently, this function does not perform any operations.
8
- * @param {any} output - The output to be initialized.
9
- */
10
- init: (output: any) => void;
11
- /**
12
- * Parses the given output and returns all the error messages.
13
- * @param {any} output - The output to parse for error messages.
14
- * @returns {string[]} An array of error messages.
15
- */
16
- parseErrors: (output: any) => string[];
17
- /**
18
- * Parses the given output and returns all the warning messages.
19
- * @param {any} output - The output to parse for warning messages.
20
- * @returns {string[]} An array of warning messages.
21
- */
22
- parseWarnings: (output: any) => string[];
23
- };
24
- export default cboutputparsers;
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
- * A module for parsing output messages to identify errors and warnings.
5
- */
6
- const cboutputparsers = {
7
- /**
8
- * Initializes the output parser module.
9
- * Currently, this function does not perform any operations.
10
- * @param {any} output - The output to be initialized.
11
- */
12
- init: (output) => {
13
- // Initialization code can be added here if necessary
14
- },
15
- /**
16
- * Parses the given output and returns all the error messages.
17
- * @param {any} output - The output to parse for error messages.
18
- * @returns {string[]} An array of error messages.
19
- */
20
- parseErrors: (output) => {
21
- return output.split('\n').filter((line) => line.includes('Error:'));
22
- },
23
- /**
24
- * Parses the given output and returns all the warning messages.
25
- * @param {any} output - The output to parse for warning messages.
26
- * @returns {string[]} An array of warning messages.
27
- */
28
- parseWarnings: (output) => {
29
- return output.split('\n').filter((line) => line.includes('Warning:'));
30
- }
31
- };
32
- exports.default = cboutputparsers;
@@ -1,21 +0,0 @@
1
- import { GetProjectPathResponse } from '@codebolt/types';
2
- /**
3
- * A module for interacting with project settings and paths.
4
- */
5
- declare const cbproject: {
6
- /**
7
- * Placeholder for a method to get project settings.
8
- * Currently, this method does not perform any operations.
9
- * @param {any} output - The output where project settings would be stored.
10
- */
11
- getProjectSettings: (output: any) => void;
12
- /**
13
- * Retrieves the path of the current project.
14
- * @returns {Promise<GetProjectPathResponse>} A promise that resolves with the project path response.
15
- */
16
- getProjectPath: () => Promise<GetProjectPathResponse>;
17
- getRepoMap: (message: any) => Promise<GetProjectPathResponse>;
18
- runProject: () => void;
19
- getEditorFileStatus: () => Promise<unknown>;
20
- };
21
- export default cbproject;
@@ -1,72 +0,0 @@
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("./websocket"));
7
- /**
8
- * A module for interacting with project settings and paths.
9
- */
10
- const cbproject = {
11
- /**
12
- * Placeholder for a method to get project settings.
13
- * Currently, this method does not perform any operations.
14
- * @param {any} output - The output where project settings would be stored.
15
- */
16
- getProjectSettings: (output) => {
17
- // Implementation for getting project settings will be added here
18
- },
19
- /**
20
- * Retrieves the path of the current project.
21
- * @returns {Promise<GetProjectPathResponse>} A promise that resolves with the project path response.
22
- */
23
- getProjectPath: () => {
24
- return new Promise((resolve, reject) => {
25
- websocket_1.default.getWebsocket.send(JSON.stringify({
26
- "type": "settingEvent",
27
- "action": "getProjectPath"
28
- }));
29
- websocket_1.default.getWebsocket.on('message', (data) => {
30
- const response = JSON.parse(data);
31
- if (response.type === "getProjectPathResponse") {
32
- resolve(response);
33
- }
34
- });
35
- });
36
- },
37
- getRepoMap: (message) => {
38
- return new Promise((resolve, reject) => {
39
- websocket_1.default.getWebsocket.send(JSON.stringify({
40
- "type": "settingEvent",
41
- "action": "getRepoMap",
42
- message
43
- }));
44
- websocket_1.default.getWebsocket.on('message', (data) => {
45
- const response = JSON.parse(data);
46
- if (response.type === "getRepoMapResponse") {
47
- resolve(response);
48
- }
49
- });
50
- });
51
- },
52
- runProject: () => {
53
- websocket_1.default.getWebsocket.send(JSON.stringify({
54
- "type": "runProject"
55
- }));
56
- },
57
- getEditorFileStatus: () => {
58
- return new Promise((resolve, reject) => {
59
- websocket_1.default.getWebsocket.send(JSON.stringify({
60
- "type": "settingEvent",
61
- "action": "getEditorFileStatus",
62
- }));
63
- websocket_1.default.getWebsocket.on('message', (data) => {
64
- const response = JSON.parse(data);
65
- if (response.type === "getEditorFileStatusResponse") {
66
- resolve(response);
67
- }
68
- });
69
- });
70
- }
71
- };
72
- exports.default = cbproject;
package/modules/rag.d.ts DELETED
@@ -1,22 +0,0 @@
1
- /**
2
- * A module for managing files within the CodeBolt File System.
3
- */
4
- declare const cbrag: {
5
- /**
6
- * Initializes the CodeBolt File System Module.
7
- */
8
- init: () => void;
9
- /**
10
- * Adds a file to the CodeBolt File System.
11
- * @param {string} filename - The name of the file to add.
12
- * @param {string} file_path - The path where the file should be added.
13
- */
14
- add_file: (filename: string, file_path: string) => void;
15
- /**
16
- * Retrieves related knowledge for a given query and filename.
17
- * @param {string} query - The query to retrieve related knowledge for.
18
- * @param {string} filename - The name of the file associated with the query.
19
- */
20
- retrieve_related_knowledge: (query: string, filename: string) => void;
21
- };
22
- export default cbrag;
package/modules/rag.js DELETED
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
- * A module for managing files within the CodeBolt File System.
5
- */
6
- const cbrag = {
7
- /**
8
- * Initializes the CodeBolt File System Module.
9
- */
10
- init: () => {
11
- console.log("Initializing CodeBolt File System Module");
12
- },
13
- /**
14
- * Adds a file to the CodeBolt File System.
15
- * @param {string} filename - The name of the file to add.
16
- * @param {string} file_path - The path where the file should be added.
17
- */
18
- add_file: (filename, file_path) => {
19
- // Implementation for adding a file will be added here
20
- },
21
- /**
22
- * Retrieves related knowledge for a given query and filename.
23
- * @param {string} query - The query to retrieve related knowledge for.
24
- * @param {string} filename - The name of the file associated with the query.
25
- */
26
- retrieve_related_knowledge: (query, filename) => {
27
- // Implementation for retrieving related knowledge will be added here
28
- },
29
- };
30
- exports.default = cbrag;
@@ -1,23 +0,0 @@
1
- /**
2
- * A module for handling search operations.
3
- */
4
- declare const cbsearch: {
5
- /**
6
- * Initializes the search module with the specified search engine.
7
- * @param {string} [engine="bing"] - The search engine to use for initializing the module.
8
- */
9
- init: (engine?: string) => void;
10
- /**
11
- * Performs a search operation for the given query.
12
- * @param {string} query - The search query.
13
- * @returns {Promise<string>} A promise that resolves with the search results.
14
- */
15
- search: (query: string) => Promise<string>;
16
- /**
17
- * Retrieves the first link from the search results for the given query.
18
- * @param {string} query - The search query.
19
- * @returns {Promise<string>} A promise that resolves with the first link of the search results.
20
- */
21
- get_first_link: (query: string) => Promise<string>;
22
- };
23
- export default cbsearch;
package/modules/search.js DELETED
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
- * A module for handling search operations.
5
- */
6
- const cbsearch = {
7
- /**
8
- * Initializes the search module with the specified search engine.
9
- * @param {string} [engine="bing"] - The search engine to use for initializing the module.
10
- */
11
- init: (engine = "bing") => {
12
- console.log("Initializing Search Module with engine: " + engine);
13
- },
14
- /**
15
- * Performs a search operation for the given query.
16
- * @param {string} query - The search query.
17
- * @returns {Promise<string>} A promise that resolves with the search results.
18
- */
19
- search: async (query) => {
20
- console.log("Searching for " + query);
21
- return new Promise((resolve, reject) => {
22
- resolve("Search Results for " + query);
23
- });
24
- },
25
- /**
26
- * Retrieves the first link from the search results for the given query.
27
- * @param {string} query - The search query.
28
- * @returns {Promise<string>} A promise that resolves with the first link of the search results.
29
- */
30
- get_first_link: async (query) => {
31
- console.log("Getting first link for " + query);
32
- return new Promise((resolve, reject) => {
33
- resolve("First Link for " + query);
34
- });
35
- }
36
- };
37
- exports.default = cbsearch;
@@ -1,21 +0,0 @@
1
- import { ApplicationState, AddToAgentStateResponse, GetAgentStateResponse } from '@codebolt/types';
2
- declare const cbstate: {
3
- /**
4
- * Retrieves the current application state from the server via WebSocket.
5
- * @returns {Promise<ApplicationState>} A promise that resolves with the application state.
6
- */
7
- getApplicationState: () => Promise<ApplicationState>;
8
- /**
9
- * Adds a key-value pair to the agent's state on the server via WebSocket.
10
- * @param {string} key - The key to add to the agent's state.
11
- * @param {string} value - The value associated with the key.
12
- * @returns {Promise<AddToAgentStateResponse>} A promise that resolves with the response to the addition request.
13
- */
14
- addToAgentState: (key: string, value: string) => Promise<AddToAgentStateResponse>;
15
- /**
16
- * Retrieves the current state of the agent from the server via WebSocket.
17
- * @returns {Promise<GetAgentStateResponse>} A promise that resolves with the agent's state.
18
- */
19
- getAgentState: () => Promise<GetAgentStateResponse>;
20
- };
21
- export default cbstate;