codebolt 1.12.7 → 1.12.9
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/dist/index.js
CHANGED
|
@@ -556972,6 +556972,7 @@ const registerEnvironmentProviderConnection = async (connectionId, socket, envir
|
|
|
556972
556972
|
environmentName,
|
|
556973
556973
|
timestamp: new Date().toISOString(),
|
|
556974
556974
|
projectPath: settingService_1.projectSetting.user_active_project_path,
|
|
556975
|
+
projectName: path.basename(settingService_1.projectSetting.user_active_project_path),
|
|
556975
556976
|
archivePath: snapshotResult?.archivePath,
|
|
556976
556977
|
snapshotId: snapshotResult?.snapshotId,
|
|
556977
556978
|
};
|
|
@@ -557246,8 +557247,16 @@ const sendProviderAgentStartToEnvironment = async (environmentId, userMessage, t
|
|
|
557246
557247
|
} : {}),
|
|
557247
557248
|
};
|
|
557248
557249
|
if (message.userMessage.message.selectedAgent) {
|
|
557250
|
+
const resolvedAgentId = message.agentId; // already resolved with fallback above
|
|
557249
557251
|
message.userMessage.message.selectedAgent.agentType = 'marketplace';
|
|
557250
|
-
message.userMessage.message.selectedAgent.agentDetails =
|
|
557252
|
+
message.userMessage.message.selectedAgent.agentDetails = resolvedAgentId;
|
|
557253
|
+
// Ensure id is populated (remote sandbox needs it to find the agent)
|
|
557254
|
+
if (!message.userMessage.message.selectedAgent.id) {
|
|
557255
|
+
message.userMessage.message.selectedAgent.id = resolvedAgentId;
|
|
557256
|
+
}
|
|
557257
|
+
if (!message.userMessage.message.selectedAgent.name) {
|
|
557258
|
+
message.userMessage.message.selectedAgent.name = resolvedAgentId;
|
|
557259
|
+
}
|
|
557251
557260
|
}
|
|
557252
557261
|
// Store the pending request using environmentId as key (without timeout)
|
|
557253
557262
|
pendingAgentStartRequests.set(environmentId, {
|
|
@@ -586061,8 +586070,14 @@ class PluginService {
|
|
|
586061
586070
|
const globalDir = this.getGlobalPluginDir();
|
|
586062
586071
|
const projectDir = this.getProjectPluginDir();
|
|
586063
586072
|
// Load built-in plugins (shipped with CodeBolt)
|
|
586073
|
+
// In monorepo: __dirname = packages/server/src/services → ../../../../plugins
|
|
586074
|
+
// In npm bundle (webpack): __dirname = dist/ → ./plugins (copied by CopyPlugin)
|
|
586064
586075
|
const builtinDir = path.resolve(__dirname, '../../../../plugins');
|
|
586076
|
+
const bundledDir = path.resolve(__dirname, 'plugins');
|
|
586065
586077
|
await this.scanDirectory(builtinDir);
|
|
586078
|
+
if (bundledDir !== builtinDir) {
|
|
586079
|
+
await this.scanDirectory(bundledDir);
|
|
586080
|
+
}
|
|
586066
586081
|
// Load global plugins
|
|
586067
586082
|
await this.scanDirectory(globalDir);
|
|
586068
586083
|
// Load per-project plugins (overrides global ones with the same name)
|
|
@@ -612483,6 +612498,7 @@ exports.ChatThreadManager = void 0;
|
|
|
612483
612498
|
const threadFileStore_1 = __webpack_require__(58962);
|
|
612484
612499
|
const appLogger_1 = __importDefault(__webpack_require__(8479));
|
|
612485
612500
|
const socket_constants_1 = __webpack_require__(91836);
|
|
612501
|
+
const agentHelper_1 = __webpack_require__(5069);
|
|
612486
612502
|
class ChatThreadManager {
|
|
612487
612503
|
/**
|
|
612488
612504
|
* Get or create thread ID from incoming message
|
|
@@ -612589,8 +612605,11 @@ class ChatThreadManager {
|
|
|
612589
612605
|
incomingMessage.data = {
|
|
612590
612606
|
text: incomingMessage?.message?.userMessage || ""
|
|
612591
612607
|
};
|
|
612592
|
-
// Ensure messageId
|
|
612593
|
-
if (incomingMessage?.message?.messageId
|
|
612608
|
+
// Ensure messageId exists - generate one if the client didn't provide it
|
|
612609
|
+
if (!incomingMessage?.message?.messageId) {
|
|
612610
|
+
incomingMessage.message.messageId = (0, agentHelper_1.getMessageId)();
|
|
612611
|
+
}
|
|
612612
|
+
if (!incomingMessage.messageId) {
|
|
612594
612613
|
incomingMessage.messageId = incomingMessage.message.messageId;
|
|
612595
612614
|
}
|
|
612596
612615
|
// Add timestamp if missing
|
|
@@ -614888,8 +614907,11 @@ chatSocket.handleMessage = async (_ws, payload) => {
|
|
|
614888
614907
|
return;
|
|
614889
614908
|
}
|
|
614890
614909
|
try {
|
|
614910
|
+
console.log('[ChatSocket:mux] prepareMessage...');
|
|
614891
614911
|
incomingMessage = chatThreadManager.prepareMessage(incomingMessage);
|
|
614912
|
+
console.log('[ChatSocket:mux] getOrCreateThreadId...');
|
|
614892
614913
|
let messageThreadId = await chatThreadManager.getOrCreateThreadId(incomingMessage);
|
|
614914
|
+
console.log('[ChatSocket:mux] threadId:', messageThreadId);
|
|
614893
614915
|
global.globalThreadId = messageThreadId;
|
|
614894
614916
|
await chatThreadManager.processActiveStep(incomingMessage, messageThreadId);
|
|
614895
614917
|
chatThreadManager.logThreadInfo(incomingMessage, messageThreadId);
|
|
@@ -614900,10 +614922,13 @@ chatSocket.handleMessage = async (_ws, payload) => {
|
|
|
614900
614922
|
// Broadcast incoming user message to all connected plugins
|
|
614901
614923
|
(0, broadcastChatToPlugins_1.broadcastChatToPlugins)(incomingMessage, 'incoming');
|
|
614902
614924
|
chatManager_1.default.addChat(messageThreadId, incomingMessage);
|
|
614925
|
+
console.log('[ChatSocket:mux] routing message, type:', incomingMessage.type, 'hasEnvironment:', !!incomingMessage?.message?.environment, 'isRemoteTask:', incomingMessage?.message?.isRemoteTask);
|
|
614903
614926
|
const messageRouter = new handlers_1.MessageRouter(messageThreadId);
|
|
614904
614927
|
await messageRouter.routeMessage(incomingMessage);
|
|
614928
|
+
console.log('[ChatSocket:mux] routeMessage done');
|
|
614905
614929
|
}
|
|
614906
614930
|
catch (error) {
|
|
614931
|
+
console.error('[ChatSocket:mux] ERROR:', error?.message || error);
|
|
614907
614932
|
utils_1.ErrorHandler.handleMessageError(error, 'ChatSocket', incomingMessage);
|
|
614908
614933
|
}
|
|
614909
614934
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@codebolt/remote-execution-plugin",
|
|
3
|
+
"version": "1.0.5",
|
|
4
|
+
"description": "Bridges ExecutionGateway with a provider from another environment",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "node build.mjs",
|
|
8
|
+
"build:types": "tsc --emitDeclarationOnly",
|
|
9
|
+
"dev": "tsc --watch"
|
|
10
|
+
},
|
|
11
|
+
"codebolt": {
|
|
12
|
+
"plugin": {
|
|
13
|
+
"type": "execution",
|
|
14
|
+
"gateway": {
|
|
15
|
+
"claimsExecutionGateway": true
|
|
16
|
+
},
|
|
17
|
+
"triggers": [
|
|
18
|
+
{ "type": "startup" }
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@codebolt/plugin-sdk": "*",
|
|
24
|
+
"ws": "^8.16.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/ws": "^8.5.10",
|
|
28
|
+
"typescript": "^5.3.0"
|
|
29
|
+
}
|
|
30
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codebolt",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.9",
|
|
4
4
|
"description": "CodeBolt headless server CLI",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"files": [
|
|
11
11
|
"dist",
|
|
12
12
|
"bin",
|
|
13
|
-
"!dist/**/*.map"
|
|
13
|
+
"!dist/**/*.map",
|
|
14
|
+
"dist/plugins"
|
|
14
15
|
],
|
|
15
16
|
"scripts": {
|
|
16
17
|
"build": "npm run build:deps && webpack --config webpack.config.js",
|