codebolt 1.10.4 → 1.10.5

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.
@@ -1337,7 +1337,7 @@
1337
1337
  "code-generation"
1338
1338
  ],
1339
1339
  "title": "Act",
1340
- "zipFilePath": "https://pub-cd2980acaa6d4462a4356b5afe3a82d6.r2.dev/agent/6f54b0a3-abaf-4ebf-b997-445ff4bfd1b8.zip",
1340
+ "zipFilePath": "https://pub-cd2980acaa6d4462a4356b5afe3a82d6.r2.dev/agent/73cad597-237f-46d3-b558-b0d3dabd7ca0.zip",
1341
1341
  "unique_id": "act",
1342
1342
  "metadata": {
1343
1343
  "agent_routing": {
@@ -1420,11 +1420,11 @@
1420
1420
  }
1421
1421
  ],
1422
1422
  "slug": "c4d3fdb9cf9e4f828a1d0160bbfc9ae9",
1423
- "version": "1.1.52",
1423
+ "version": "1.1.58",
1424
1424
  "author": "ravi",
1425
1425
  "status": 1,
1426
- "updatedAt": "2026-03-03T03:41:02.339Z",
1427
- "sourceCodeUrl": "https://pub-cd2980acaa6d4462a4356b5afe3a82d6.r2.dev/agentsource/5ed06b01-d76e-4ac7-9ba5-6d505db7a383.zip",
1426
+ "updatedAt": "2026-03-03T17:48:56.102Z",
1427
+ "sourceCodeUrl": "https://pub-cd2980acaa6d4462a4356b5afe3a82d6.r2.dev/agentsource/81787018-7f43-4aac-b65a-4bd95337195c.zip",
1428
1428
  "lastUpdatedUI": 0,
1429
1429
  "githubUrl": null,
1430
1430
  "isInvalid": 0,
@@ -1882,4 +1882,4 @@
1882
1882
  "isDisabled": 0,
1883
1883
  "isPrivate": 0
1884
1884
  }
1885
- ]
1885
+ ]
package/dist/index.js CHANGED
@@ -1049,10 +1049,13 @@ function parseArgs() {
1049
1049
  let projectPath;
1050
1050
  let help = false;
1051
1051
  let version = false;
1052
- let tui = false;
1052
+ let tui = true;
1053
+ let server = false;
1053
1054
  let web = false;
1054
1055
  let connect;
1055
1056
  let authToken;
1057
+ let prompt;
1058
+ let agent;
1056
1059
  for (let i = 0; i < args.length; i++) {
1057
1060
  if (args[i] === '--help' || args[i] === '-h') {
1058
1061
  help = true;
@@ -1060,12 +1063,28 @@ function parseArgs() {
1060
1063
  else if (args[i] === '--version' || args[i] === '-v') {
1061
1064
  version = true;
1062
1065
  }
1063
- else if (args[i] === '--tui' || args[i] === '-t') {
1064
- tui = true;
1066
+ else if (args[i] === '--server' || args[i] === '-s') {
1067
+ server = true;
1068
+ tui = false;
1065
1069
  }
1066
1070
  else if (args[i] === '--web' || args[i] === '-w') {
1067
1071
  web = true;
1068
1072
  }
1073
+ else if (args[i] === '--prompt') {
1074
+ prompt = args[++i];
1075
+ if (!prompt) {
1076
+ console.error('Missing value for --prompt flag');
1077
+ process.exit(1);
1078
+ }
1079
+ tui = false;
1080
+ }
1081
+ else if (args[i] === '--agent') {
1082
+ agent = args[++i];
1083
+ if (!agent) {
1084
+ console.error('Missing value for --agent flag');
1085
+ process.exit(1);
1086
+ }
1087
+ }
1069
1088
  else if (args[i] === '--connect' || args[i] === '-c') {
1070
1089
  const val = parseInt(args[++i], 10);
1071
1090
  if (isNaN(val) || val < 1 || val > 65535) {
@@ -1097,7 +1116,7 @@ function parseArgs() {
1097
1116
  }
1098
1117
  }
1099
1118
  }
1100
- return { port, projectPath, help, version, tui, web, connect, authToken };
1119
+ return { port, projectPath, help, version, tui, server, web, connect, authToken, prompt, agent };
1101
1120
  }
1102
1121
  function printHelp() {
1103
1122
  console.log(`
@@ -1106,20 +1125,22 @@ Usage: codebolt [options]
1106
1125
  Options:
1107
1126
  -p, --port <number> Port to listen on (default: ${DEFAULT_PORT}, or next free port)
1108
1127
  -d, --project <path> Project directory (default: current working directory)
1109
- -t, --tui Launch the Go TUI client after server starts
1110
- -w, --web Serve the web frontend (access at http://localhost:<port>)
1128
+ -s, --server Server-only mode (no TUI)
1129
+ -w, --web Require the web frontend (error if not found; served by default when available)
1111
1130
  -c, --connect <port> Connect to an existing server (don't start a new one)
1131
+ --prompt <text> Run an agent with the given prompt and print the response
1132
+ --agent <name> Agent to use with --prompt (default: $CODEBOLT_AGENT or codebolt-agent)
1112
1133
  --auth-token <token> Authentication token for headless login
1113
1134
  -h, --help Show this help message
1114
1135
  -v, --version Show version
1115
1136
 
1116
1137
  Examples:
1117
- codebolt # Start server only
1118
- codebolt --web # Start server + serve web UI
1119
- codebolt --tui # Start server + launch TUI
1120
- codebolt --web --tui # Start server + serve web UI + launch TUI
1121
- codebolt --connect 12345 --tui # Connect TUI to existing server on port 12345
1122
- codebolt --connect 12345 # Print URL of existing server
1138
+ codebolt # Start server + web UI + TUI (default)
1139
+ codebolt --project /path/to/project # Start with a specific project directory
1140
+ codebolt --server # Start server + web UI only (no TUI)
1141
+ codebolt --connect 12345 # Connect TUI to existing server on port 12345
1142
+ codebolt --prompt "fix the login bug" # Run default agent with a prompt
1143
+ codebolt --prompt "refactor utils" --agent my-agent # Run a specific agent
1123
1144
  `);
1124
1145
  }
1125
1146
  function resolveWebDistPath() {
@@ -1158,7 +1179,7 @@ function resolveSimpleUIDistPath() {
1158
1179
  return null;
1159
1180
  }
1160
1181
  async function main() {
1161
- const { port: requestedPort, projectPath, help, version, tui, web, connect, authToken } = parseArgs();
1182
+ const { port: requestedPort, projectPath, help, version, tui, web, connect, authToken, prompt, agent } = parseArgs();
1162
1183
  if (help) {
1163
1184
  printHelp();
1164
1185
  process.exit(0);
@@ -1222,24 +1243,24 @@ async function main() {
1222
1243
  // ── Mode B: Normal server start ──
1223
1244
  const port = requestedPort || await (0, findPort_1.findFreePort)(DEFAULT_PORT, 12346, 13000);
1224
1245
  const resolvedProjectPath = projectPath || process.cwd();
1225
- // Resolve web dist path if --web flag is set
1246
+ // Always resolve web dist path so the web UI is accessible by default
1226
1247
  let webDistPath;
1227
1248
  let simpleUIDistPath;
1228
- if (web) {
1229
- const resolved = resolveWebDistPath();
1230
- if (!resolved) {
1231
- console.error('Error: Web frontend not found.');
1232
- console.error('Expected index.html in one of:');
1233
- console.error(` - ${(__webpack_require__(62003).join)(__dirname, '..', '..', 'web', 'dist')}`);
1234
- console.error(` - ${(__webpack_require__(62003).join)(__dirname, '..', 'web-dist')}`);
1235
- console.error('');
1236
- console.error('Build the web frontend first:');
1237
- console.error(' cd packages/web && npm run build');
1238
- process.exit(1);
1239
- }
1240
- webDistPath = resolved;
1241
- // Also resolve SimpleUI (Mission Control) if available
1242
- simpleUIDistPath = resolveSimpleUIDistPath();
1249
+ const resolvedWeb = resolveWebDistPath();
1250
+ if (resolvedWeb) {
1251
+ webDistPath = resolvedWeb;
1252
+ simpleUIDistPath = resolveSimpleUIDistPath() ?? undefined;
1253
+ }
1254
+ else if (web) {
1255
+ // Only error out if the user explicitly requested --web but it's missing
1256
+ console.error('Error: Web frontend not found.');
1257
+ console.error('Expected index.html in one of:');
1258
+ console.error(` - ${(__webpack_require__(62003).join)(__dirname, '..', '..', 'web', 'dist')}`);
1259
+ console.error(` - ${(__webpack_require__(62003).join)(__dirname, '..', 'web-dist')}`);
1260
+ console.error('');
1261
+ console.error('Build the web frontend first:');
1262
+ console.error(' cd packages/web && npm run build');
1263
+ process.exit(1);
1243
1264
  }
1244
1265
  // Set auth token as env var so the server bootstrap can use it
1245
1266
  if (authToken) {
@@ -1247,7 +1268,7 @@ async function main() {
1247
1268
  }
1248
1269
  console.log(`Starting CodeBolt server on port ${port}...`);
1249
1270
  console.log(`Project path: ${resolvedProjectPath}`);
1250
- if (web) {
1271
+ if (webDistPath) {
1251
1272
  console.log(`Web frontend: ${webDistPath}`);
1252
1273
  if (simpleUIDistPath) {
1253
1274
  console.log(`Mission Control UI: ${simpleUIDistPath}`);
@@ -1263,12 +1284,117 @@ async function main() {
1263
1284
  simpleUIDistPath,
1264
1285
  });
1265
1286
  console.log(`CodeBolt server running at ${url}`);
1266
- if (web) {
1287
+ if (webDistPath) {
1267
1288
  console.log(`Web UI available at ${url}`);
1268
1289
  if (simpleUIDistPath) {
1269
1290
  console.log(`Mission Control available at ${url}/ui`);
1270
1291
  }
1271
1292
  }
1293
+ // ── Mode: --prompt (headless agent execution via WebSocket) ──
1294
+ if (prompt) {
1295
+ const agentName = agent || process.env.CODEBOLT_AGENT || 'codebolt-agent';
1296
+ console.log(`Running agent "${agentName}" with prompt: ${prompt}`);
1297
+ const WebSocket = (await Promise.resolve().then(() => __importStar(__webpack_require__(15086)))).default;
1298
+ const wsUrl = url.replace('http', 'ws');
1299
+ await new Promise((resolve, reject) => {
1300
+ const ws = new WebSocket(`${wsUrl}/chat`);
1301
+ let lastAgentMessage = '';
1302
+ let receivedAny = false;
1303
+ ws.on('open', () => {
1304
+ // Send user message in the same format the web UI uses
1305
+ const message = {
1306
+ type: 'messageResponse',
1307
+ message: {
1308
+ userMessage: prompt,
1309
+ type: 'messageResponse',
1310
+ templateType: 'userChat',
1311
+ selectedAgent: agentName !== 'codebolt-agent' ? { id: agentName, name: agentName } : { id: '', name: '' },
1312
+ mentionedAgents: agentName !== 'codebolt-agent' ? [{ name: agentName }] : [],
1313
+ mentionedFiles: [],
1314
+ mentionedFolders: [],
1315
+ mentionedMultiFile: [],
1316
+ mentionedMCPs: [],
1317
+ uploadedImages: [],
1318
+ actions: [],
1319
+ links: [],
1320
+ controlFiles: [],
1321
+ currentFile: '',
1322
+ selection: null,
1323
+ },
1324
+ };
1325
+ ws.send(JSON.stringify(message));
1326
+ console.log('Prompt sent, waiting for agent...\n');
1327
+ });
1328
+ ws.on('message', (data) => {
1329
+ try {
1330
+ const msg = JSON.parse(data.toString());
1331
+ const tpl = msg.templateType || '';
1332
+ const type = msg.type || '';
1333
+ const actionType = msg.actionType || '';
1334
+ // Detect agent content messages
1335
+ const isAgent = tpl === 'agentChat' || tpl === 'agentChatWithButton'
1336
+ || tpl === 'agentResponse' || msg.sender?.senderType === 'agent'
1337
+ || (type === 'message' && actionType === 'SendMessage');
1338
+ // Stream agent messages to terminal
1339
+ if (isAgent && msg.content) {
1340
+ receivedAny = true;
1341
+ const content = typeof msg.content === 'string' ? msg.content : JSON.stringify(msg.content);
1342
+ lastAgentMessage = content;
1343
+ process.stdout.write(content + '\n');
1344
+ }
1345
+ // Agent finished
1346
+ if (type === 'processStoped' || actionType === 'ProcessStoped') {
1347
+ console.log('\n--- Agent Finished ---');
1348
+ // The processStoped message itself carries the final response in content
1349
+ if (msg.content) {
1350
+ const content = typeof msg.content === 'string' ? msg.content : JSON.stringify(msg.content);
1351
+ if (!receivedAny) {
1352
+ // If we haven't streamed anything yet, print the final response
1353
+ console.log(content);
1354
+ }
1355
+ lastAgentMessage = content;
1356
+ }
1357
+ else if (!receivedAny) {
1358
+ console.log('No response from agent (agent may have crashed).');
1359
+ }
1360
+ ws.close();
1361
+ resolve();
1362
+ return;
1363
+ }
1364
+ // Also catch error/info messages that may explain failures
1365
+ if (type === 'message' && msg.content && !isAgent) {
1366
+ const content = typeof msg.content === 'string' ? msg.content : JSON.stringify(msg.content);
1367
+ // Show info/error messages (confirmations, status updates, etc.)
1368
+ if (tpl === 'infoWithLink' || tpl === 'error' || tpl === 'warning') {
1369
+ console.log(`[${tpl}] ${content}`);
1370
+ }
1371
+ }
1372
+ }
1373
+ catch {
1374
+ // ignore parse errors
1375
+ }
1376
+ });
1377
+ ws.on('error', (err) => {
1378
+ console.error(`WebSocket error: ${err.message}`);
1379
+ reject(err);
1380
+ });
1381
+ ws.on('close', () => {
1382
+ if (!receivedAny && !lastAgentMessage) {
1383
+ console.log('Connection closed without agent response.');
1384
+ }
1385
+ resolve();
1386
+ });
1387
+ // Safety timeout
1388
+ // setTimeout(() => {
1389
+ // console.error('\nTimeout: Agent did not finish within 10 minutes.');
1390
+ // ws.close();
1391
+ // resolve();
1392
+ // }, 10 * 60 * 1000);
1393
+ });
1394
+ shutdown('PROMPT_DONE');
1395
+ return;
1396
+ }
1397
+ // ── Mode: TUI (default) ──
1272
1398
  if (tui) {
1273
1399
  const { spawn } = await Promise.resolve().then(() => __importStar(__webpack_require__(13200)));
1274
1400
  const path = await Promise.resolve().then(() => __importStar(__webpack_require__(62003)));
@@ -1289,8 +1415,8 @@ async function main() {
1289
1415
  break;
1290
1416
  }
1291
1417
  }
1292
- if (web) {
1293
- // When both --web and --tui, print URL but don't auto-open (TUI takes over terminal)
1418
+ if (webDistPath) {
1419
+ // When both web and TUI, print URL but don't auto-open (TUI takes over terminal)
1294
1420
  console.log(`Open ${url} in your browser for the web UI.`);
1295
1421
  }
1296
1422
  console.log(`Launching TUI: ${tuiPath}`);
@@ -1313,10 +1439,8 @@ async function main() {
1313
1439
  shutdown('TUI_EXIT');
1314
1440
  });
1315
1441
  }
1316
- else if (web) {
1317
- console.log('Press Ctrl+C to stop.');
1318
- }
1319
1442
  else {
1443
+ // ── Mode: --server (server-only) ──
1320
1444
  console.log('Press Ctrl+C to stop.');
1321
1445
  }
1322
1446
  }
@@ -89072,6 +89196,10 @@ router.post('/threads/:threadId/steps', async (req, res) => {
89072
89196
  return res.status(500).json({ success: false, error: error.message || 'Failed to create thread step' });
89073
89197
  }
89074
89198
  });
89199
+ // Start thread execution (process first pending step with agent)
89200
+ router.post('/start-task', chatController_1.startTask);
89201
+ // Start a specific step in a thread
89202
+ router.post('/start-step', chatController_1.startStep);
89075
89203
  exports["default"] = router;
89076
89204
  //# sourceMappingURL=chatRoutes.js.map
89077
89205
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codebolt",
3
- "version": "1.10.4",
3
+ "version": "1.10.5",
4
4
  "description": "CodeBolt headless server CLI",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",