@lisa.ai/agent 2.0.0 → 2.0.3

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.
@@ -69,23 +69,39 @@ async function coverageCommand(command, modelProvider, attempt = 1, maxRetries =
69
69
  // Node 21+ Deprecation Fix: When shell is true, pass the entire raw command string
70
70
  // rather than explicitly escaping array arguments to bypass DEP0190.
71
71
  const child = (0, child_process_1.spawn)(cmd, { shell: true, stdio: ['ignore', 'pipe', 'pipe'] });
72
+ let stdoutData = '';
73
+ let stderrData = '';
72
74
  child.stdout?.on('data', (data) => {
73
75
  const text = data.toString();
76
+ stdoutData += text;
74
77
  if (printProgress) {
75
78
  const lines = text.split('\n');
76
79
  for (const line of lines) {
77
80
  if (line.includes('Executed')) {
78
- process.stdout.write(line + '\n');
81
+ const cleanLine = line.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, '').trim();
82
+ if (process.stdout.isTTY) {
83
+ process.stdout.clearLine(0);
84
+ process.stdout.cursorTo(0);
85
+ process.stdout.write(`⏳ [Lisa.ai Testing] ${cleanLine}`);
86
+ }
87
+ else {
88
+ process.stdout.write(`\r⏳ [Lisa.ai Testing] ${cleanLine}`);
89
+ }
79
90
  }
80
91
  }
81
92
  }
82
93
  });
94
+ child.stderr?.on('data', (data) => {
95
+ stderrData += data.toString();
96
+ });
83
97
  child.on('close', (code) => {
98
+ if (printProgress)
99
+ process.stdout.write('\n');
84
100
  if (code === 0) {
85
101
  resolve();
86
102
  }
87
103
  else {
88
- reject(new Error(`Test process exited with code ${code}`));
104
+ reject({ message: `Test process exited with code ${code}`, stdout: stdoutData, stderr: stderrData });
89
105
  }
90
106
  });
91
107
  });
@@ -129,7 +129,15 @@ async function healCommand(command, modelProvider, attempt = 1, healedFilePath =
129
129
  const lines = text.split('\n');
130
130
  for (const line of lines) {
131
131
  if (line.includes('Executed')) {
132
- process.stdout.write(line + '\n');
132
+ const cleanLine = line.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, '').trim();
133
+ if (process.stdout.isTTY) {
134
+ process.stdout.clearLine(0);
135
+ process.stdout.cursorTo(0);
136
+ process.stdout.write(`⏳ [Lisa.ai Testing] ${cleanLine}`);
137
+ }
138
+ else {
139
+ process.stdout.write(`\r⏳ [Lisa.ai Testing] ${cleanLine}`);
140
+ }
133
141
  }
134
142
  }
135
143
  }
@@ -138,6 +146,8 @@ async function healCommand(command, modelProvider, attempt = 1, healedFilePath =
138
146
  stderrData += data.toString();
139
147
  });
140
148
  child.on('close', (code) => {
149
+ if (printProgress)
150
+ process.stdout.write('\n');
141
151
  if (code === 0) {
142
152
  resolve({ stdout: stdoutData, stderr: stderrData });
143
153
  }
@@ -205,7 +215,10 @@ async function healCommand(command, modelProvider, attempt = 1, healedFilePath =
205
215
  }
206
216
  catch (isolatedError) {
207
217
  console.log(`❌ [Lisa.ai Micro-Heal] Isolated verification failed.`);
208
- currentErrorLog = (isolatedError.stderr || '') + '\n' + (isolatedError.stdout || '') + '\n' + (isolatedError.message || '');
218
+ // CRITICAL FIX: Ensure `stdout` is aggressively extracted because Karma/Jest pump compiler failures into stdout, not stderr.
219
+ const fallbackStdout = isolatedError.stdout ? isolatedError.stdout.toString() : '';
220
+ const fallbackStderr = isolatedError.stderr ? isolatedError.stderr.toString() : '';
221
+ currentErrorLog = fallbackStderr + '\n' + fallbackStdout + '\n' + (isolatedError.message || '');
209
222
  previousContext = `### Attempt ${localAttempt} Failed\n\`\`\`typescript\n${fixedCode}\n\`\`\`\n\n**New Error:**\n${currentErrorLog}`;
210
223
  localAttempt++;
211
224
  }
package/dist/index.js CHANGED
@@ -25,7 +25,7 @@ program
25
25
  .option('-p, --project-id <id>', 'Control Plane Project ID to fetch dynamic config')
26
26
  .action(async (options) => {
27
27
  printBanner();
28
- let maxRetries = 3;
28
+ let maxRetries = 5;
29
29
  let model = options.model;
30
30
  let apiKey = undefined;
31
31
  if (options.projectId) {
@@ -53,7 +53,7 @@ program
53
53
  .option('-p, --project-id <id>', 'Control Plane Project ID to fetch dynamic config')
54
54
  .action(async (options) => {
55
55
  printBanner();
56
- let maxRetries = 3;
56
+ let maxRetries = 5;
57
57
  let model = options.model;
58
58
  let apiKey = undefined;
59
59
  if (options.projectId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lisa.ai/agent",
3
- "version": "2.0.0",
3
+ "version": "2.0.3",
4
4
  "description": "Lisa.ai Autonomous CI/CD Worker Agent",
5
5
  "main": "dist/index.js",
6
6
  "bin": {