ronds_ai 0.1.12 → 0.1.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/lib/doctor.js +9 -28
- package/package.json +1 -1
package/lib/doctor.js
CHANGED
|
@@ -5,41 +5,22 @@ const { runGit } = require('./git');
|
|
|
5
5
|
|
|
6
6
|
const SUPPORTED_TOOLS = new Set(['claude', 'codex', 'cursor']);
|
|
7
7
|
|
|
8
|
-
function formatDateStamp(date = new Date()) {
|
|
9
|
-
const year = String(date.getFullYear());
|
|
10
|
-
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
11
|
-
const day = String(date.getDate()).padStart(2, '0');
|
|
12
|
-
return `${year}${month}${day}`;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
8
|
function getFailedEventDir() {
|
|
16
9
|
return path.join(os.homedir(), '.ronds_ai', 'failed-events');
|
|
17
10
|
}
|
|
18
11
|
|
|
19
|
-
function
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
path.join(getFailedEventDir(), `${dateStamp}-${tool}-error.jsonl`),
|
|
23
|
-
path.join(getFailedEventDir(), `${dateStamp}-cli-error.jsonl`),
|
|
24
|
-
];
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function tailFileLines(filePath, maxLines = 20) {
|
|
28
|
-
if (!fs.existsSync(filePath)) {
|
|
12
|
+
function readRecentLogs(tool) {
|
|
13
|
+
const dir = getFailedEventDir();
|
|
14
|
+
if (!fs.existsSync(dir)) {
|
|
29
15
|
return [];
|
|
30
16
|
}
|
|
31
17
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return getRecentLogPaths(tool).map((filePath) => ({
|
|
39
|
-
path: filePath,
|
|
40
|
-
exists: fs.existsSync(filePath),
|
|
41
|
-
lines: tailFileLines(filePath),
|
|
42
|
-
}));
|
|
18
|
+
return fs.readdirSync(dir)
|
|
19
|
+
.filter((name) => name.endsWith('.jsonl') && (name.includes(`-${tool}-error`) || name.includes('-cli-error')))
|
|
20
|
+
.sort()
|
|
21
|
+
.reverse()
|
|
22
|
+
.slice(0, 3)
|
|
23
|
+
.map((name) => path.join(dir, name));
|
|
43
24
|
}
|
|
44
25
|
|
|
45
26
|
function getConfigChecks(tool, baseDir) {
|