@lisa.ai/agent 1.0.5 → 1.0.6
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/utils/parser.js +4 -2
- package/package.json +1 -1
package/dist/utils/parser.js
CHANGED
|
@@ -2,17 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.extractFilePath = extractFilePath;
|
|
4
4
|
function extractFilePath(errorLog) {
|
|
5
|
+
// Sanitize invisible ANSI color codes (e.g. \x1b[96m) from CLI output logs
|
|
6
|
+
const cleanLog = errorLog.replace(/\x1B\[[0-9;]*[a-zA-Z]/g, '');
|
|
5
7
|
// Matches typical TS/Angular error patterns:
|
|
6
8
|
// e.g., "src/app/app.component.ts:12:3 - error TS2322:"
|
|
7
9
|
// e.g., "Error: src/app/app.component.ts:12:3"
|
|
8
10
|
// Try to match path near an error
|
|
9
11
|
const tsErrorRegex = /([a-zA-Z0-9_.\-\/\\]+\.ts)(?:[:(])/;
|
|
10
|
-
const match = tsErrorRegex.exec(
|
|
12
|
+
const match = tsErrorRegex.exec(cleanLog);
|
|
11
13
|
if (match && match[1]) {
|
|
12
14
|
return match[1];
|
|
13
15
|
}
|
|
14
16
|
// Fallback: Just try to find anything that looks like a .ts file path
|
|
15
17
|
const fallbackRegex = /([a-zA-Z0-9_.\-\/\\]+\.ts)/;
|
|
16
|
-
const fallbackMatch = fallbackRegex.exec(
|
|
18
|
+
const fallbackMatch = fallbackRegex.exec(cleanLog);
|
|
17
19
|
return fallbackMatch ? fallbackMatch[1] : null;
|
|
18
20
|
}
|