ai-gains 1.3.4 → 1.3.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-gains",
3
- "version": "1.3.4",
3
+ "version": "1.3.5",
4
4
  "description": "Interactive browser dashboard for AI development session tracking",
5
5
  "main": "src/server.js",
6
6
  "bin": {
package/src/init.js CHANGED
@@ -15,17 +15,24 @@ function mergeSettings(existing, template) {
15
15
  continue;
16
16
  }
17
17
 
18
- // Collect all labels already registered for this hook type
19
- const existingLabels = new Set();
18
+ // Build a map of label -> hook object for existing hooks so we can update in-place
19
+ const existingByLabel = new Map();
20
20
  for (const entry of result.hooks[hookType]) {
21
21
  for (const hook of (entry.hooks || [])) {
22
- if (hook.label) existingLabels.add(hook.label);
22
+ if (hook.label) existingByLabel.set(hook.label, hook);
23
23
  }
24
24
  }
25
25
 
26
- // Append only hooks whose label isn't already present
26
+ // Update existing hooks in-place; append hooks whose label isn't already present
27
27
  for (const templateEntry of templateEntries) {
28
- const newHooks = (templateEntry.hooks || []).filter(h => !existingLabels.has(h.label));
28
+ const newHooks = [];
29
+ for (const templateHook of (templateEntry.hooks || [])) {
30
+ if (existingByLabel.has(templateHook.label)) {
31
+ Object.assign(existingByLabel.get(templateHook.label), templateHook);
32
+ } else {
33
+ newHooks.push(templateHook);
34
+ }
35
+ }
29
36
  if (newHooks.length > 0) {
30
37
  result.hooks[hookType].push({ hooks: newHooks });
31
38
  }
@@ -6,7 +6,7 @@
6
6
  {
7
7
  "type": "command",
8
8
  "label": "ai-gains",
9
- "command": "node .claude/scripts/ai-gains/session-start.js"
9
+ "command": "node .claude/scripts/ai-gains/session-start.cjs"
10
10
  }
11
11
  ]
12
12
  }
@@ -17,7 +17,7 @@
17
17
  {
18
18
  "type": "command",
19
19
  "label": "ai-gains",
20
- "command": "node .claude/scripts/ai-gains/user-prompt-submit.js"
20
+ "command": "node .claude/scripts/ai-gains/user-prompt-submit.cjs"
21
21
  }
22
22
  ]
23
23
  }
@@ -28,7 +28,7 @@
28
28
  {
29
29
  "type": "command",
30
30
  "label": "ai-gains",
31
- "command": "node .claude/scripts/ai-gains/stop.js"
31
+ "command": "node .claude/scripts/ai-gains/stop.cjs"
32
32
  }
33
33
  ]
34
34
  }