codebolt 1.11.7 → 1.12.0

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 (2) hide show
  1. package/dist/index.js +35 -15
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -378073,7 +378073,7 @@ function createCliHostBridge() {
378073
378073
  return path_1.default.join(process.cwd(), relativePath);
378074
378074
  },
378075
378075
  spawnPty(file, args, options) {
378076
- const nodePty = __webpack_require__(14566);
378076
+ const nodePty = __webpack_require__(22511);
378077
378077
  return nodePty.spawn(file, args, options);
378078
378078
  },
378079
378079
  async sqliteRun(dbPath, sql, params = []) {
@@ -378622,7 +378622,7 @@ async function main() {
378622
378622
  }
378623
378623
  // ── Mode: --prompt (headless agent execution via WebSocket) ──
378624
378624
  if (prompt) {
378625
- const agentName = agent || process.env.CODEBOLT_AGENT || 'codebolt-agent';
378625
+ const agentName = agent || process.env.CODEBOLT_AGENT || 'c4d3fdb9-cf9e-4f82-8a1d-0160bbfc9ae9';
378626
378626
  console.log(`Running agent "${agentName}" with prompt: ${prompt}`);
378627
378627
  const WebSocket = (await Promise.resolve().then(() => __importStar(__webpack_require__(90848)))).default;
378628
378628
  const wsUrl = url.replace('http', 'ws');
@@ -569017,6 +569017,7 @@ const todoService_1 = __importDefault(__webpack_require__(77468));
569017
569017
  const markdownMemoryService_1 = __importDefault(__webpack_require__(32758));
569018
569018
  const jsonMemoryService_1 = __importDefault(__webpack_require__(19535));
569019
569019
  const aiTerminal_1 = __webpack_require__(77481);
569020
+ const serverPaths_1 = __webpack_require__(52047);
569020
569021
  const installAgent_1 = __webpack_require__(2367);
569021
569022
  const jobService_1 = __importDefault(__webpack_require__(28077));
569022
569023
  const agentHelper_1 = __webpack_require__(5069);
@@ -569138,6 +569139,7 @@ const createProjectService = async (projectFolderPath, projectName, workspaceId,
569138
569139
  // console.log(error)
569139
569140
  }
569140
569141
  settingService_1.settingService.init();
569142
+ (0, serverPaths_1.setProjectPath)(path_1.default.normalize(projectFolderPath));
569141
569143
  await chatManager_1.default.init(projectFolderPath);
569142
569144
  debugManager_1.default.init(projectFolderPath);
569143
569145
  try {
@@ -569189,6 +569191,7 @@ const createProjectInDefaultService = async (projectFolderPath) => {
569189
569191
  // Always set as active project and initialize services
569190
569192
  await db_1.default.setActiveProject(projectFolderPath, settingService_1.projectSetting.user_username);
569191
569193
  settingService_1.settingService.init();
569194
+ (0, serverPaths_1.setProjectPath)(path_1.default.normalize(projectFolderPath));
569192
569195
  await chatManager_1.default.init(projectFolderPath);
569193
569196
  debugManager_1.default.init(projectFolderPath);
569194
569197
  todoService_1.default.init(projectFolderPath);
@@ -569235,6 +569238,7 @@ const setActiveProjectService = async (projectPath) => {
569235
569238
  stores_1.projectState.reinitialize();
569236
569239
  await db_1.default.setActiveProject(projectPath, settingService_1.projectSetting.user_username);
569237
569240
  await settingService_1.settingService.init();
569241
+ (0, serverPaths_1.setProjectPath)(normalizedPath);
569238
569242
  await jobService_1.default.initialize(projectPath);
569239
569243
  // Initialize application event bus after project settings are available
569240
569244
  await applicationEventBus_1.applicationEventBus.initialize(projectPath);
@@ -584000,7 +584004,15 @@ const os_1 = __importDefault(__webpack_require__(70857));
584000
584004
  const serverPaths_1 = __webpack_require__(52047);
584001
584005
  const appLogger_1 = __importDefault(__webpack_require__(8479));
584002
584006
  const socketManager_1 = __webpack_require__(94351);
584003
- const settingService_1 = __webpack_require__(26152);
584007
+ // Dynamic getter to always read the latest projectSetting value.
584008
+ // With CommonJS modules, a named import captures the value at require-time.
584009
+ // If settingService.init() reassigns projectSetting later, the stale reference is returned.
584010
+ // This getter re-requires the module each time, ensuring the current value is used.
584011
+ function getProjectSetting() {
584012
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
584013
+ const settingModule = __webpack_require__(26152);
584014
+ return settingModule.projectSetting;
584015
+ }
584004
584016
  const portScannerService_1 = __webpack_require__(71381);
584005
584017
  const stateService_cli_1 = __webpack_require__(45544);
584006
584018
  const componentType_1 = __webpack_require__(24339);
@@ -584066,7 +584078,7 @@ const getLogWriteStream = (ptyProcess) => {
584066
584078
  const pid = ptyProcess.pid;
584067
584079
  let stream = logWriteStreams.get(pid);
584068
584080
  if (!stream || stream.destroyed) {
584069
- const filePath = path.join((0, serverPaths_1.getProjectPath)() || settingService_1.projectSetting?.user_active_project_path || process.cwd(), '.codebolt', `${pid}_output.txt`);
584081
+ const filePath = path.join((0, serverPaths_1.getProjectPath)() || getProjectSetting()?.user_active_project_path || process.cwd(), '.codebolt', `${pid}_output.txt`);
584070
584082
  // Ensure directory exists
584071
584083
  const dir = path.dirname(filePath);
584072
584084
  if (!fs.existsSync(dir)) {
@@ -584259,7 +584271,7 @@ async function createPtyProcess(terminalId, command, messageId) {
584259
584271
  // console.log(process.env)
584260
584272
  const shell = os_1.default.platform() === 'win32' ? 'cmd.exe' : 'bash';
584261
584273
  appLogger_1.default.info(shell);
584262
- let cwd = (0, serverPaths_1.getProjectPath)() || settingService_1.projectSetting?.user_active_project_path || process.cwd();
584274
+ let cwd = (0, serverPaths_1.getProjectPath)() || getProjectSetting()?.user_active_project_path || process.cwd();
584263
584275
  appLogger_1.default.info("cwd is" + cwd);
584264
584276
  // Strip application-internal env vars so user processes don't inherit them
584265
584277
  const ptyEnv = { ...process.env };
@@ -584473,7 +584485,7 @@ async function handleTerminalConnection(ws, processId) {
584473
584485
  flushQueuedMessages(ptyProcess, [ws]);
584474
584486
  }
584475
584487
  // Enhanced log loading with better coordination and error handling
584476
- const logFilePath = path.join((0, serverPaths_1.getProjectPath)() || settingService_1.projectSetting?.user_active_project_path || process.cwd(), '.codebolt', `${processId}_output.txt`);
584488
+ const logFilePath = path.join((0, serverPaths_1.getProjectPath)() || getProjectSetting()?.user_active_project_path || process.cwd(), '.codebolt', `${processId}_output.txt`);
584477
584489
  // Load and send log data immediately when connection is established
584478
584490
  // The queue flush above already sent any pending messages, this adds historical logs
584479
584491
  loadAndSendLogData(ptyProcess, logFilePath, processId);
@@ -584502,7 +584514,7 @@ async function handleTerminalConnection(ws, processId) {
584502
584514
  // Handle request_history messages - send historical log data
584503
584515
  if (parsedMessage.type === 'request_history') {
584504
584516
  const requestedProcessId = parsedMessage.processId || processId;
584505
- const historyLogPath = path.join((0, serverPaths_1.getProjectPath)() || settingService_1.projectSetting?.user_active_project_path || process.cwd(), '.codebolt', `${requestedProcessId}_output.txt`);
584517
+ const historyLogPath = path.join((0, serverPaths_1.getProjectPath)() || getProjectSetting()?.user_active_project_path || process.cwd(), '.codebolt', `${requestedProcessId}_output.txt`);
584506
584518
  loadAndSendLogData(ptyProcess, historyLogPath, requestedProcessId);
584507
584519
  appLogger_1.default.info(`[Terminal Connection] Sent historical log data for process ${requestedProcessId}`);
584508
584520
  return;
@@ -584739,6 +584751,14 @@ async function executeCommandInShell(command, ptyProcess, terminalId, finalMessa
584739
584751
  for (const line of lines) {
584740
584752
  ptyProcess.write(line + lineEnding);
584741
584753
  }
584754
+ // Delay the exit code echo slightly so the shell has time to
584755
+ // process the command's Enter keystroke before receiving the next
584756
+ // input. Without this delay the PTY echoes the command and the
584757
+ // exit-code probe on a single line (e.g.
584758
+ // "npm create vite@latest ...echo EXIT_CODE=$?") because the
584759
+ // shell hasn't yet consumed the first \r when the second write
584760
+ // arrives.
584761
+ await new Promise(resolve => setTimeout(resolve, 100));
584742
584762
  ptyProcess.write(exitCodeEcho + lineEnding);
584743
584763
  }
584744
584764
  catch (error) {
@@ -619724,6 +619744,14 @@ module.exports = require("@codebolt/narrative");
619724
619744
 
619725
619745
  /***/ },
619726
619746
 
619747
+ /***/ 22511
619748
+ (module) {
619749
+
619750
+ "use strict";
619751
+ module.exports = require("@homebridge/node-pty-prebuilt-multiarch");
619752
+
619753
+ /***/ },
619754
+
619727
619755
  /***/ 92157
619728
619756
  (module) {
619729
619757
 
@@ -619780,14 +619808,6 @@ module.exports = require("link-preview-js");
619780
619808
 
619781
619809
  /***/ },
619782
619810
 
619783
- /***/ 14566
619784
- (module) {
619785
-
619786
- "use strict";
619787
- module.exports = require("node-pty");
619788
-
619789
- /***/ },
619790
-
619791
619811
  /***/ 9288
619792
619812
  (module) {
619793
619813
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codebolt",
3
- "version": "1.11.7",
3
+ "version": "1.12.0",
4
4
  "description": "CodeBolt headless server CLI",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -26,7 +26,7 @@
26
26
  "@codebolt/narrative": "1.11.0",
27
27
  "@huggingface/tokenizers": "^0.1.2",
28
28
  "@codebolt/kuzu": "^0.11.3",
29
- "node-pty": "^1.2.0-beta.11",
29
+ "@homebridge/node-pty-prebuilt-multiarch": "^0.13.1",
30
30
  "better-sqlite3": "^11.0.0",
31
31
  "sqlite-vec": "^0.1.6",
32
32
  "@vscode/ripgrep": "^1.17.0",