@codebolt/codeboltjs 1.1.52 → 1.1.54

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.d.ts CHANGED
@@ -107,6 +107,7 @@ declare class Codebolt {
107
107
  stopProcess: () => void;
108
108
  };
109
109
  stopProcess: () => void;
110
+ processFinished: () => void;
110
111
  sendConfirmationRequest: (confirmationMessage: string, buttons?: string[]) => Promise<string>;
111
112
  sendNotificationEvent: (notificationMessage: string, type: "debug" | "git" | "planner" | "browser" | "editor" | "terminal" | "preview") => void;
112
113
  };
@@ -197,6 +198,7 @@ declare class Codebolt {
197
198
  getVector: (key: string) => Promise<import("@codebolt/types").GetVectorResponse>;
198
199
  addVectorItem: (item: any) => Promise<import("@codebolt/types").AddVectorItemResponse>;
199
200
  queryVectorItem: (key: string) => Promise<import("@codebolt/types").QueryVectorItemResponse>;
201
+ queryVectorItems: (items: [], dbPath: string) => Promise<import("@codebolt/types").QueryVectorItemResponse>;
200
202
  };
201
203
  debug: {
202
204
  debug: (log: string, type: import("./modules/debug").logType) => Promise<import("@codebolt/types").DebugAddLogResponse>;
package/modules/chat.d.ts CHANGED
@@ -44,6 +44,11 @@ declare const cbchat: {
44
44
  * Sends a specific message to the server to stop the process.
45
45
  */
46
46
  stopProcess: () => void;
47
+ /**
48
+ * Stops the ongoing process.
49
+ * Sends a specific message to the server to stop the process.
50
+ */
51
+ processFinished: () => void;
47
52
  /**
48
53
  * Sends a confirmation request to the server with two options: Yes or No.
49
54
  * @returns {Promise<string>} A promise that resolves with the server's response.
package/modules/chat.js CHANGED
@@ -126,6 +126,18 @@ const cbchat = {
126
126
  "type": "processStoped"
127
127
  }));
128
128
  },
129
+ /**
130
+ * Stops the ongoing process.
131
+ * Sends a specific message to the server to stop the process.
132
+ */
133
+ processFinished: () => {
134
+ // Implement the logic to stop the process here
135
+ console.log("Process Finished ...");
136
+ // For example, you might want to send a specific message to the server to stop the process
137
+ websocket_1.default.getWebsocket.send(JSON.stringify({
138
+ "type": "processFinished"
139
+ }));
140
+ },
129
141
  /**
130
142
  * Sends a confirmation request to the server with two options: Yes or No.
131
143
  * @returns {Promise<string>} A promise that resolves with the server's response.
@@ -22,5 +22,12 @@ declare const VectorDB: {
22
22
  * @returns {Promise<QueryVectorItemResponse>} A promise that resolves with the queried vector item.
23
23
  */
24
24
  queryVectorItem: (key: string) => Promise<QueryVectorItemResponse>;
25
+ /**
26
+ * Queries a vector item from the vector database based on the provided key.
27
+ *
28
+ * @param {string} key - The key of the vector to query the item from.
29
+ * @returns {Promise<QueryVectorItemResponse>} A promise that resolves with the queried vector item.
30
+ */
31
+ queryVectorItems: (items: [], dbPath: string) => Promise<QueryVectorItemResponse>;
25
32
  };
26
33
  export default VectorDB;
@@ -75,5 +75,29 @@ const VectorDB = {
75
75
  });
76
76
  });
77
77
  },
78
+ /**
79
+ * Queries a vector item from the vector database based on the provided key.
80
+ *
81
+ * @param {string} key - The key of the vector to query the item from.
82
+ * @returns {Promise<QueryVectorItemResponse>} A promise that resolves with the queried vector item.
83
+ */
84
+ queryVectorItems: async (items, dbPath) => {
85
+ return new Promise((resolve, reject) => {
86
+ websocket_1.default.getWebsocket.send(JSON.stringify({
87
+ "type": "vectordbEvent",
88
+ "action": "queryVectorItem",
89
+ "message": {
90
+ items,
91
+ dbPath
92
+ },
93
+ }));
94
+ websocket_1.default.getWebsocket.on('message', (data) => {
95
+ const response = JSON.parse(data);
96
+ if (response.type === "qeryVectorItemsResponse") {
97
+ resolve(response);
98
+ }
99
+ });
100
+ });
101
+ },
78
102
  };
79
103
  exports.default = VectorDB;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codebolt/codeboltjs",
3
- "version": "1.1.52",
3
+ "version": "1.1.54",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "author": "",
@@ -130,6 +130,18 @@ const cbchat = {
130
130
  "type": "processStoped"
131
131
  }));
132
132
  },
133
+ /**
134
+ * Stops the ongoing process.
135
+ * Sends a specific message to the server to stop the process.
136
+ */
137
+ processFinished: () => {
138
+ // Implement the logic to stop the process here
139
+ console.log("Process Finished ...");
140
+ // For example, you might want to send a specific message to the server to stop the process
141
+ cbws.getWebsocket.send(JSON.stringify({
142
+ "type": "processFinished"
143
+ }));
144
+ },
133
145
 
134
146
  /**
135
147
  * Sends a confirmation request to the server with two options: Yes or No.
@@ -73,6 +73,30 @@ const VectorDB = {
73
73
  });
74
74
  });
75
75
  },
76
+ /**
77
+ * Queries a vector item from the vector database based on the provided key.
78
+ *
79
+ * @param {string} key - The key of the vector to query the item from.
80
+ * @returns {Promise<QueryVectorItemResponse>} A promise that resolves with the queried vector item.
81
+ */
82
+ queryVectorItems: async (items: [],dbPath:string): Promise<QueryVectorItemResponse> => {
83
+ return new Promise((resolve, reject) => {
84
+ cbws.getWebsocket.send(JSON.stringify({
85
+ "type":"vectordbEvent",
86
+ "action": "queryVectorItem",
87
+ "message": {
88
+ items,
89
+ dbPath
90
+ },
91
+ }));
92
+ cbws.getWebsocket.on('message', (data: string) => {
93
+ const response = JSON.parse(data);
94
+ if (response.type === "qeryVectorItemsResponse") {
95
+ resolve(response);
96
+ }
97
+ });
98
+ });
99
+ },
76
100
  };
77
101
 
78
102
  export default VectorDB;