@uxcontinuum/ccwrapped 1.0.2 → 1.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.
Files changed (2) hide show
  1. package/index.js +19 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -24,6 +24,11 @@ function findClaudeDir() {
24
24
  }
25
25
  } catch (_) {}
26
26
  }
27
+ for (const c of candidates) {
28
+ try {
29
+ if (fs.statSync(c).isDirectory() && hasJsonl(c)) return c;
30
+ } catch (_) {}
31
+ }
27
32
  for (const c of candidates) {
28
33
  try {
29
34
  if (fs.statSync(c).isDirectory()) return c;
@@ -31,6 +36,18 @@ function findClaudeDir() {
31
36
  }
32
37
  return candidates[0];
33
38
  }
39
+
40
+ function hasJsonl(dir) {
41
+ let entries;
42
+ try { entries = fs.readdirSync(dir, { withFileTypes: true }); } catch (_) { return false; }
43
+ for (const e of entries) {
44
+ if (e.name === 'subagents') continue;
45
+ const full = path.join(dir, e.name);
46
+ if (e.isDirectory()) { if (hasJsonl(full)) return true; continue; }
47
+ if (e.name.endsWith('.jsonl')) return true;
48
+ }
49
+ return false;
50
+ }
34
51
  const CLAUDE_DIR = findClaudeDir();
35
52
 
36
53
  // ── FILE SCAN ─────────────────────────────────────────────────────────────────
@@ -55,8 +72,8 @@ function projName(filePath) {
55
72
  const idx = parts.lastIndexOf('projects');
56
73
  if (idx < 0 || idx + 1 >= parts.length) return 'unknown';
57
74
  let raw = parts[idx + 1];
58
- const prefix = `-home-${os.userInfo().username}-`;
59
- if (raw.startsWith(prefix)) raw = raw.slice(prefix.length);
75
+ const m = raw.match(/^-home-[^-]+-(.+)$/);
76
+ if (m) raw = m[1];
60
77
  else if (raw.startsWith('-home-')) raw = raw.replace(/^-+/, '');
61
78
  return raw || '(home)';
62
79
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxcontinuum/ccwrapped",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Spotify Wrapped, but for your Claude Code sessions. Zero install: npx @uxcontinuum/ccwrapped",
5
5
  "main": "index.js",
6
6
  "bin": {