ai-gains 1.2.0 → 1.3.0

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/README.md CHANGED
@@ -80,4 +80,3 @@ Add `.ai-gains/` to your repository to share gains across your team. Each file i
80
80
 
81
81
  - Node.js 16+
82
82
  - [Claude Code](https://claude.ai/code)
83
- - `jq` (used in hooks — available via `brew install jq` on macOS)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-gains",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Interactive browser dashboard for AI development session tracking",
5
5
  "main": "src/server.js",
6
6
  "bin": {
@@ -15,9 +15,10 @@ process.stdin.on('end', () => {
15
15
  .toString().trim();
16
16
  } catch {}
17
17
 
18
+ const safeTs = start_time.replace(/:/g, '-');
18
19
  fs.mkdirSync('.ai-gains', { recursive: true });
19
20
  fs.writeFileSync(
20
- `.ai-gains/${session_id}.json`,
21
+ `.ai-gains/${safeTs}_${session_id}.json`,
21
22
  JSON.stringify({ session_id, start_time, author }, null, 2) + '\n'
22
23
  );
23
24
  });
@@ -6,8 +6,9 @@ process.stdin.setEncoding('utf8');
6
6
  process.stdin.on('data', chunk => { raw += chunk; });
7
7
  process.stdin.on('end', () => {
8
8
  const { session_id } = JSON.parse(raw);
9
- const file = `.ai-gains/${session_id}.json`;
10
- if (!fs.existsSync(file)) return;
9
+ const match = fs.readdirSync('.ai-gains').find(f => f.endsWith(`_${session_id}.json`));
10
+ if (!match) return;
11
+ const file = `.ai-gains/${match}`;
11
12
 
12
13
  const session = JSON.parse(fs.readFileSync(file, 'utf8'));
13
14
  session.end_time = new Date().toISOString().replace(/\.\d{3}Z$/, 'Z');