s9n-devops-agent 2.0.18-dev.11 → 2.0.18-dev.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "s9n-devops-agent",
3
- "version": "2.0.18-dev.11",
3
+ "version": "2.0.18-dev.13",
4
4
  "description": "CS_DevOpsAgent - Intelligent Git Automation System with multi-agent support and session management",
5
5
  "type": "module",
6
6
  "main": "src/cs-devops-agent-worker.js",
@@ -1008,10 +1008,20 @@ async function checkAndPerformRebase(repoRoot) {
1008
1008
 
1009
1009
  if (dirty) {
1010
1010
  log('Stashing uncommitted changes before rebase...');
1011
- const stashRes = await run('git', ['stash', 'push', '-m', `Auto-stash before rebase ${new Date().toISOString()}`]);
1012
- if (stashRes.ok) stashed = true;
1013
- else {
1014
- console.error('\x1b[31m✗ Failed to stash changes. Aborting rebase.\x1b[0m');
1011
+ // Use -u to include untracked files, ensuring we capture everything status --porcelain sees
1012
+ const stashRes = await run('git', ['stash', 'push', '-u', '-m', `Auto-stash before rebase ${new Date().toISOString()}`]);
1013
+
1014
+ // Only mark as stashed if we actually saved something
1015
+ // git stash returns 0 even if nothing to save, so we must check stdout
1016
+ if (stashRes.ok && stashRes.stdout && stashRes.stdout.includes('Saved working directory')) {
1017
+ stashed = true;
1018
+ log('Changes stashed successfully.');
1019
+ } else if (stashRes.ok && stashRes.stdout && stashRes.stdout.includes('No local changes to save')) {
1020
+ stashed = false;
1021
+ log('No changes needed stashing (git reported no local changes).');
1022
+ } else {
1023
+ console.error('\\x1b[31m✗ Failed to stash changes. Aborting rebase.\\x1b[0m');
1024
+ if (stashRes.stdout) console.error(stashRes.stdout);
1015
1025
  busy = false;
1016
1026
  return false;
1017
1027
  }
@@ -1537,7 +1547,7 @@ function saveProjectSettings(settings, settingsPath) {
1537
1547
  // Display copyright and license information immediately
1538
1548
  console.log("\n" + "=".repeat(70));
1539
1549
  console.log(" CS_DevOpsAgent - Intelligent Git Automation System");
1540
- console.log(" Version 2.0.18-dev.11 | Build 20260107");
1550
+ console.log(" Version 2.0.18-dev.13 | Build 20260107");
1541
1551
  console.log(" Copyright (c) 2026 SeKondBrain AI Labs Limited");
1542
1552
  console.log(" Author: Sachin Dev Duggal");
1543
1553
  console.log(" \n Licensed under the MIT License");
@@ -1942,7 +1952,7 @@ console.log();
1942
1952
 
1943
1953
  // Split: Left (Interactive) 40%, Right (Logs) 60%
1944
1954
  // Ensure minimum widths
1945
- const leftPercent = 0.4;
1955
+ const leftPercent = 0.3; // Reduce left panel to 30% to give more room for logs
1946
1956
  const leftWidth = Math.floor(width * leftPercent) - 2;
1947
1957
  const rightWidth = width - leftWidth - 3; // -3 for separator " | "
1948
1958
 
@@ -1951,13 +1961,40 @@ console.log();
1951
1961
  // Or simple stacked? Let's just proceed, it will look messy but functional.
1952
1962
  }
1953
1963
 
1964
+ // Helper to prepare view buffers with text wrapping
1965
+ function getView(buffer, width, height) {
1966
+ const view = [];
1967
+ for (let i = buffer.length - 1; i >= 0; i--) {
1968
+ if (view.length >= height) break;
1969
+
1970
+ const line = buffer[i];
1971
+ const plain = stripAnsi(line);
1972
+
1973
+ if (plain.length <= width) {
1974
+ view.unshift(line);
1975
+ } else {
1976
+ // Wrap long lines (using plain text to avoid ANSI artifacting)
1977
+ const chunks = [];
1978
+ for (let j = 0; j < plain.length; j += width) {
1979
+ chunks.push(plain.substring(j, j + width));
1980
+ }
1981
+ // Add chunks in reverse order so they appear correctly
1982
+ for (let k = chunks.length - 1; k >= 0; k--) {
1983
+ if (view.length >= height) break;
1984
+ view.unshift(chunks[k]);
1985
+ }
1986
+ }
1987
+ }
1988
+ return view;
1989
+ }
1990
+
1954
1991
  // Prepare views (Bottom-Anchored)
1955
- const leftView = TUI.leftLogs.slice(-contentHeight);
1956
- const rightView = TUI.rightLogs.slice(-contentHeight);
1992
+ const leftView = getView(TUI.leftLogs, leftWidth, contentHeight);
1993
+ const rightView = getView(TUI.rightLogs, rightWidth, contentHeight);
1957
1994
 
1958
1995
  const leftEmpty = contentHeight - leftView.length;
1959
1996
  const rightEmpty = contentHeight - rightView.length;
1960
-
1997
+
1961
1998
  // Draw Frame
1962
1999
  process.stdout.write('\x1b[2J'); // Clear
1963
2000
  process.stdout.write('\x1b[H'); // Home (standard ANSI)
@@ -1969,34 +2006,15 @@ console.log();
1969
2006
 
1970
2007
  // 2. Columns
1971
2008
  for (let i = 0; i < contentHeight; i++) {
1972
- let lLine = (i >= leftEmpty) ? leftView[i - leftEmpty] : '';
1973
- let rLine = (i >= rightEmpty) ? rightView[i - rightEmpty] : '';
1974
-
1975
- // Removing ANSI for length calculation is essential for alignment
1976
- const lPlain = stripAnsi(lLine);
1977
- const rPlain = stripAnsi(rLine);
1978
-
1979
- // Truncate to prevent wrapping and breaking layout
1980
- let lDisp = lLine;
1981
- let rDisp = rLine;
1982
-
1983
- if (lPlain.length > leftWidth) {
1984
- // Simple truncation (note: might cut ansi codes, but prevents layout break)
1985
- // We use the plain length to determine cut point
1986
- // For safety, we just display the plain truncated text to avoid hanging colors
1987
- lDisp = lPlain.substring(0, leftWidth - 3) + '...';
1988
- }
1989
-
1990
- if (rPlain.length > rightWidth) {
1991
- rDisp = rPlain.substring(0, rightWidth - 3) + '...';
1992
- }
2009
+ let lDisp = (i >= leftEmpty) ? leftView[i - leftEmpty] : '';
2010
+ let rDisp = (i >= rightEmpty) ? rightView[i - rightEmpty] : '';
1993
2011
 
1994
- // Pad using the length of the *displayed* string (re-strip to be sure)
1995
- const lDispLen = stripAnsi(lDisp).length;
1996
- const rDispLen = stripAnsi(rDisp).length;
2012
+ // Pad to fill width
2013
+ const lPlain = stripAnsi(lDisp);
2014
+ const rPlain = stripAnsi(rDisp);
1997
2015
 
1998
- const lPad = Math.max(0, leftWidth - lDispLen);
1999
- const rPad = Math.max(0, rightWidth - rDispLen);
2016
+ const lPad = Math.max(0, leftWidth - lPlain.length);
2017
+ const rPad = Math.max(0, rightWidth - rPlain.length);
2000
2018
 
2001
2019
  process.stdout.write(lDisp + ' '.repeat(lPad));
2002
2020
  process.stdout.write('\x1b[90m │ \x1b[0m');