coder-config 0.42.35 → 0.42.38

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/constants.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * Constants and tool path configurations
3
3
  */
4
4
 
5
- const VERSION = '0.42.35';
5
+ const VERSION = '0.42.38';
6
6
 
7
7
  // Tool-specific path configurations
8
8
  const TOOL_PATHS = {
package/lib/sessions.js CHANGED
@@ -118,7 +118,7 @@ function installHooks() {
118
118
  // Continue even if chmod fails
119
119
  }
120
120
 
121
- // Add SessionStart hook
121
+ // Add SessionStart hook (new format with matcher/hooks)
122
122
  if (!settings.hooks.SessionStart) {
123
123
  settings.hooks.SessionStart = [];
124
124
  }
@@ -126,11 +126,23 @@ function installHooks() {
126
126
  settings.hooks.SessionStart = [settings.hooks.SessionStart];
127
127
  }
128
128
 
129
- const hasStartHook = settings.hooks.SessionStart.some(h =>
130
- typeof h === 'object' && h.command === sessionStartHook
131
- );
129
+ // Check for hook in both old and new formats
130
+ const hasStartHook = settings.hooks.SessionStart.some(h => {
131
+ if (typeof h !== 'object') return false;
132
+ // Old format: { type, command }
133
+ if (h.command === sessionStartHook) return true;
134
+ // New format: { matcher, hooks: [{ type, command }] }
135
+ if (Array.isArray(h.hooks)) {
136
+ return h.hooks.some(hh => hh.command === sessionStartHook);
137
+ }
138
+ return false;
139
+ });
132
140
  if (!hasStartHook) {
133
- settings.hooks.SessionStart.push({ type: 'command', command: sessionStartHook });
141
+ // Use new hook format with matcher
142
+ settings.hooks.SessionStart.push({
143
+ matcher: {},
144
+ hooks: [{ type: 'command', command: sessionStartHook }]
145
+ });
134
146
  }
135
147
 
136
148
  // Add permission to write session context file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coder-config",
3
- "version": "0.42.35",
3
+ "version": "0.42.38",
4
4
  "description": "Configuration manager for AI coding tools - Claude Code, Gemini CLI, Codex CLI, Antigravity. Manage MCPs, rules, permissions, memory, and workstreams.",
5
5
  "author": "regression.io",
6
6
  "main": "config-loader.js",
@@ -17,6 +17,8 @@ Check for `.claude/` directory:
17
17
  - "Create `.claude/` in current directory?"
18
18
  - If yes, create it. If no, abort.
19
19
 
20
+ 3. **If creating new `.claude/`**: After creating, ask if they want to run `/init` to set up project configuration (CLAUDE.md, rules, etc.)
21
+
20
22
  ### Step 2: Create Session Summary
21
23
 
22
24
  Create a comprehensive summary including:
@@ -44,9 +44,16 @@ function getSessionStatus(projectDir) {
44
44
  const settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8'));
45
45
  const hooks = settings.hooks || {};
46
46
  const sessionStartHooks = Array.isArray(hooks.SessionStart) ? hooks.SessionStart : [];
47
- status.hooksInstalled = sessionStartHooks.some(h =>
48
- typeof h === 'object' && h.command && h.command.includes('session-start')
49
- );
47
+ status.hooksInstalled = sessionStartHooks.some(h => {
48
+ if (typeof h !== 'object') return false;
49
+ // Old format: { type, command }
50
+ if (h.command && h.command.includes('session-start')) return true;
51
+ // New format: { matcher, hooks: [{ type, command }] }
52
+ if (Array.isArray(h.hooks)) {
53
+ return h.hooks.some(hh => hh.command && hh.command.includes('session-start'));
54
+ }
55
+ return false;
56
+ });
50
57
 
51
58
  // Check for write permission
52
59
  const permissions = settings.permissions || {};
@@ -131,11 +138,23 @@ function installHooks() {
131
138
  settings.hooks.SessionStart = [settings.hooks.SessionStart];
132
139
  }
133
140
 
134
- const hasStartHook = settings.hooks.SessionStart.some(h =>
135
- typeof h === 'object' && h.command === sessionStartHook
136
- );
141
+ // Check for hook in both old and new formats
142
+ const hasStartHook = settings.hooks.SessionStart.some(h => {
143
+ if (typeof h !== 'object') return false;
144
+ // Old format: { type, command }
145
+ if (h.command === sessionStartHook) return true;
146
+ // New format: { matcher, hooks: [{ type, command }] }
147
+ if (Array.isArray(h.hooks)) {
148
+ return h.hooks.some(hh => hh.command === sessionStartHook);
149
+ }
150
+ return false;
151
+ });
137
152
  if (!hasStartHook) {
138
- settings.hooks.SessionStart.push({ type: 'command', command: sessionStartHook });
153
+ // Use new hook format with matcher
154
+ settings.hooks.SessionStart.push({
155
+ matcher: {},
156
+ hooks: [{ type: 'command', command: sessionStartHook }]
157
+ });
139
158
  }
140
159
 
141
160
  // Add permission to write session context file