@codebolt/codeboltjs 1.1.99 → 2.0.1
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.
|
@@ -63,7 +63,7 @@ class UserMessage {
|
|
|
63
63
|
else {
|
|
64
64
|
let finalPrompt = `
|
|
65
65
|
The user has sent the following query:
|
|
66
|
-
|
|
66
|
+
<user_query> ${this.message.userMessage} </user_query>.
|
|
67
67
|
`;
|
|
68
68
|
if ((_a = this.message.mentionedFiles) === null || _a === void 0 ? void 0 : _a.length) {
|
|
69
69
|
finalPrompt += `The Attached files are:`;
|
|
@@ -105,8 +105,11 @@ class UserMessage {
|
|
|
105
105
|
* @returns Promise with an array of MCP tools
|
|
106
106
|
*/
|
|
107
107
|
async getMentionedMcpsTools() {
|
|
108
|
+
console.log("mentionedMCPs", this.mentionedMCPs);
|
|
108
109
|
if (this.mentionedMCPs.length > 0) {
|
|
110
|
+
console.log("mentionedMCPs", this.mentionedMCPs);
|
|
109
111
|
let tools = await tools_1.default.listToolsFromToolBoxes(this.mentionedMCPs);
|
|
112
|
+
console.log("tools", tools);
|
|
110
113
|
return tools;
|
|
111
114
|
}
|
|
112
115
|
else {
|
package/modules/websocket.js
CHANGED
|
@@ -53,7 +53,8 @@ class cbws {
|
|
|
53
53
|
const agentIdParam = process.env.agentId ? `&agentId=${process.env.agentId}` : '';
|
|
54
54
|
const parentIdParam = process.env.parentId ? `&parentId=${process.env.parentId}` : '';
|
|
55
55
|
const parentAgentInstanceIdParam = process.env.parentAgentInstanceId ? `&parentAgentInstanceId=${process.env.parentAgentInstanceId}` : '';
|
|
56
|
-
|
|
56
|
+
const agentTask = process.env.agentTask ? `&agentTask=${process.env.agentTask}` : '';
|
|
57
|
+
this.websocket = new ws_1.default(`ws://localhost:${process.env.SOCKET_PORT}/codebolt?id=${uniqueConnectionId}${agentIdParam}${parentIdParam}${parentAgentInstanceIdParam}${agentTask}${process.env.Is_Dev ? '&dev=true' : ''}`);
|
|
57
58
|
return new Promise((resolve, reject) => {
|
|
58
59
|
this.websocket.on('error', (error) => {
|
|
59
60
|
reject(error);
|
package/package.json
CHANGED
|
@@ -76,6 +76,7 @@ class UserMessage {
|
|
|
76
76
|
*/
|
|
77
77
|
constructor(message: Message, promptOverride: boolean = false) {
|
|
78
78
|
this.message = message;
|
|
79
|
+
|
|
79
80
|
this.promptOverride = promptOverride;
|
|
80
81
|
this.userMessages = [];
|
|
81
82
|
this.mentionedMCPs = message.mentionedMCPs || [];
|
|
@@ -108,7 +109,7 @@ class UserMessage {
|
|
|
108
109
|
} else {
|
|
109
110
|
let finalPrompt = `
|
|
110
111
|
The user has sent the following query:
|
|
111
|
-
|
|
112
|
+
<user_query> ${this.message.userMessage} </user_query>.
|
|
112
113
|
`;
|
|
113
114
|
if (this.message.mentionedFiles?.length) {
|
|
114
115
|
finalPrompt += `The Attached files are:`;
|
|
@@ -155,8 +156,11 @@ class UserMessage {
|
|
|
155
156
|
* @returns Promise with an array of MCP tools
|
|
156
157
|
*/
|
|
157
158
|
async getMentionedMcpsTools() {
|
|
159
|
+
console.log("mentionedMCPs", this.mentionedMCPs);
|
|
158
160
|
if (this.mentionedMCPs.length > 0) {
|
|
161
|
+
console.log("mentionedMCPs", this.mentionedMCPs);
|
|
159
162
|
let tools = await mcp.listToolsFromToolBoxes(this.mentionedMCPs)
|
|
163
|
+
console.log("tools", tools);
|
|
160
164
|
return tools
|
|
161
165
|
}
|
|
162
166
|
else {
|
package/src/modules/websocket.ts
CHANGED
|
@@ -56,7 +56,8 @@ class cbws {
|
|
|
56
56
|
const agentIdParam = process.env.agentId ? `&agentId=${process.env.agentId}` : '';
|
|
57
57
|
const parentIdParam = process.env.parentId ? `&parentId=${process.env.parentId}` : '';
|
|
58
58
|
const parentAgentInstanceIdParam = process.env.parentAgentInstanceId ? `&parentAgentInstanceId=${process.env.parentAgentInstanceId}` : '';
|
|
59
|
-
|
|
59
|
+
const agentTask = process.env.agentTask ? `&agentTask=${process.env.agentTask}` : '';
|
|
60
|
+
this.websocket = new WebSocket(`ws://localhost:${process.env.SOCKET_PORT}/codebolt?id=${uniqueConnectionId}${agentIdParam}${parentIdParam}${parentAgentInstanceIdParam}${agentTask}${process.env.Is_Dev ? '&dev=true' : ''}`);
|
|
60
61
|
|
|
61
62
|
return new Promise((resolve, reject) => {
|
|
62
63
|
this.websocket.on('error', (error: Error) => {
|