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.
Files changed (2) hide show
  1. package/lib/doctor.js +9 -28
  2. 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 getRecentLogPaths(tool) {
20
- const dateStamp = formatDateStamp();
21
- return [
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
- const raw = fs.readFileSync(filePath, 'utf8');
33
- const lines = raw.split('\n').filter((line) => line.trim() !== '');
34
- return lines.slice(-maxLines);
35
- }
36
-
37
- function readRecentLogs(tool) {
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ronds_ai",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "CLI for reporting AI code edit events.",
5
5
  "bin": {
6
6
  "ronds_ai": "bin/ronds_ai.js"