coder-config 0.42.41 → 0.43.2

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.41';
5
+ const VERSION = '0.43.2';
6
6
 
7
7
  // Tool-specific path configurations
8
8
  const TOOL_PATHS = {
@@ -52,8 +52,9 @@ function workstreamList(installDir) {
52
52
  }
53
53
 
54
54
  console.log('\nšŸ“‹ Workstreams:\n');
55
+ const detected = workstreamDetect(installDir, process.cwd());
55
56
  for (const ws of data.workstreams) {
56
- const active = ws.id === data.activeId ? 'ā— ' : 'ā—‹ ';
57
+ const active = detected && ws.id === detected.id ? 'ā— ' : 'ā—‹ ';
57
58
  console.log(`${active}${ws.name}`);
58
59
  if (ws.projects && ws.projects.length > 0) {
59
60
  console.log(` Projects: ${ws.projects.map(p => path.basename(p)).join(', ')}`);
@@ -93,11 +94,6 @@ function workstreamCreate(installDir, name, projects = [], rules = '') {
93
94
  };
94
95
 
95
96
  data.workstreams.push(workstream);
96
-
97
- if (!data.activeId) {
98
- data.activeId = workstream.id;
99
- }
100
-
101
97
  saveWorkstreams(installDir, data);
102
98
  console.log(`āœ“ Created workstream: ${name}`);
103
99
  return workstream;
@@ -146,11 +142,6 @@ function workstreamDelete(installDir, idOrName) {
146
142
  }
147
143
 
148
144
  const removed = data.workstreams.splice(idx, 1)[0];
149
-
150
- if (data.activeId === removed.id) {
151
- data.activeId = data.workstreams[0]?.id || null;
152
- }
153
-
154
145
  saveWorkstreams(installDir, data);
155
146
  console.log(`āœ“ Deleted workstream: ${removed.name}`);
156
147
  return true;
@@ -160,31 +151,29 @@ function workstreamDelete(installDir, idOrName) {
160
151
  * Set active workstream
161
152
  */
162
153
  function workstreamUse(installDir, idOrName) {
163
- const data = loadWorkstreams(installDir);
164
-
154
+ // Show current auto-detected workstream
165
155
  if (!idOrName) {
166
- const active = data.workstreams.find(w => w.id === data.activeId);
167
- if (active) {
168
- console.log(`Active workstream: ${active.name}`);
156
+ const detected = workstreamDetect(installDir, process.cwd());
157
+ if (detected) {
158
+ console.log(`Auto-detected workstream: ${detected.name}`);
159
+ console.log(` (based on current directory)`);
169
160
  } else {
170
- console.log('No active workstream');
161
+ console.log('No workstream detected for current directory');
171
162
  }
172
- return active || null;
173
- }
174
163
 
175
- const ws = data.workstreams.find(
176
- w => w.id === idOrName || w.name.toLowerCase() === idOrName.toLowerCase()
177
- );
178
-
179
- if (!ws) {
180
- console.error(`Workstream not found: ${idOrName}`);
181
- return null;
164
+ const envWs = process.env.CODER_WORKSTREAM;
165
+ if (envWs) {
166
+ console.log(`\nCODER_WORKSTREAM env var: ${envWs}`);
167
+ }
168
+ return detected || null;
182
169
  }
183
170
 
184
- data.activeId = ws.id;
185
- saveWorkstreams(installDir, data);
186
- console.log(`āœ“ Switched to workstream: ${ws.name}`);
187
- return ws;
171
+ // Deprecated: global active workstream
172
+ console.log('Global active workstream has been removed.');
173
+ console.log('\nWorkstreams are now auto-detected from the current directory.');
174
+ console.log('To override, set the CODER_WORKSTREAM environment variable:');
175
+ console.log(` export CODER_WORKSTREAM=${idOrName}`);
176
+ return null;
188
177
  }
189
178
 
190
179
  /**
@@ -267,14 +256,12 @@ function getActiveWorkstream(installDir, autoDetect = true) {
267
256
  if (ws) return ws;
268
257
  }
269
258
 
270
- // Auto-detect from current directory (takes precedence over global active)
259
+ // Auto-detect from current directory
271
260
  if (autoDetect) {
272
- const detected = workstreamDetect(installDir, process.cwd());
273
- if (detected) return detected;
261
+ return workstreamDetect(installDir, process.cwd());
274
262
  }
275
263
 
276
- // Fall back to file-based activeId (global active workstream)
277
- return data.workstreams.find(w => w.id === data.activeId) || null;
264
+ return null;
278
265
  }
279
266
 
280
267
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coder-config",
3
- "version": "0.42.41",
3
+ "version": "0.43.2",
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",