coder-config 0.43.2 → 0.43.4

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/config-loader.js CHANGED
@@ -135,7 +135,7 @@ class ClaudeConfigManager {
135
135
  workstreamCreate(name, projects, rules) { return workstreamCreate(this.installDir, name, projects, rules); }
136
136
  workstreamUpdate(idOrName, updates) { return workstreamUpdate(this.installDir, idOrName, updates); }
137
137
  workstreamDelete(idOrName) { return workstreamDelete(this.installDir, idOrName); }
138
- workstreamUse(idOrName) { return workstreamUse(this.installDir, idOrName); }
138
+ workstreamUse(idOrName, evalMode) { return workstreamUse(this.installDir, idOrName, evalMode); }
139
139
  workstreamActive() { return workstreamActive(this.installDir); }
140
140
  workstreamAddProject(idOrName, projectPath) { return workstreamAddProject(this.installDir, idOrName, projectPath); }
141
141
  workstreamRemoveProject(idOrName, projectPath) { return workstreamRemoveProject(this.installDir, idOrName, projectPath); }
package/lib/cli.js CHANGED
@@ -120,7 +120,8 @@ function runCli(manager) {
120
120
  } else if (args[1] === 'delete' || args[1] === 'rm') {
121
121
  manager.workstreamDelete(args[2]);
122
122
  } else if (args[1] === 'use' || args[1] === 'switch') {
123
- manager.workstreamUse(args[2]);
123
+ const evalMode = args.includes('--eval') || args.includes('-e');
124
+ manager.workstreamUse(args[2], evalMode);
124
125
  } else if (args[1] === 'add') {
125
126
  manager.workstreamAddProject(args[2], args[3]);
126
127
  } else if (args[1] === 'remove' || args[1] === 'rm') {
package/lib/constants.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * Constants and tool path configurations
3
3
  */
4
4
 
5
- const VERSION = '0.43.2';
5
+ const VERSION = '0.43.4';
6
6
 
7
7
  // Tool-specific path configurations
8
8
  const TOOL_PATHS = {
@@ -150,9 +150,20 @@ function workstreamDelete(installDir, idOrName) {
150
150
  /**
151
151
  * Set active workstream
152
152
  */
153
- function workstreamUse(installDir, idOrName) {
154
- // Show current auto-detected workstream
153
+ function workstreamUse(installDir, idOrName, evalMode = false) {
154
+ const data = loadWorkstreams(installDir);
155
+
156
+ // Show current workstream
155
157
  if (!idOrName) {
158
+ const envWs = process.env.CODER_WORKSTREAM;
159
+ if (envWs) {
160
+ const ws = data.workstreams.find(
161
+ w => w.id === envWs || w.name.toLowerCase() === envWs.toLowerCase()
162
+ );
163
+ console.log(`Active workstream: ${ws ? ws.name : envWs} (via CODER_WORKSTREAM)`);
164
+ return ws || null;
165
+ }
166
+
156
167
  const detected = workstreamDetect(installDir, process.cwd());
157
168
  if (detected) {
158
169
  console.log(`Auto-detected workstream: ${detected.name}`);
@@ -160,20 +171,31 @@ function workstreamUse(installDir, idOrName) {
160
171
  } else {
161
172
  console.log('No workstream detected for current directory');
162
173
  }
163
-
164
- const envWs = process.env.CODER_WORKSTREAM;
165
- if (envWs) {
166
- console.log(`\nCODER_WORKSTREAM env var: ${envWs}`);
167
- }
168
174
  return detected || null;
169
175
  }
170
176
 
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;
177
+ // Find workstream
178
+ const ws = data.workstreams.find(
179
+ w => w.id === idOrName || w.name.toLowerCase() === idOrName.toLowerCase()
180
+ );
181
+
182
+ if (!ws) {
183
+ console.error(`Workstream not found: ${idOrName}`);
184
+ return null;
185
+ }
186
+
187
+ // Output for eval mode: eval "$(coder-config workstream use name --eval)"
188
+ if (evalMode) {
189
+ console.log(`export CODER_WORKSTREAM="${ws.name}"`);
190
+ return ws;
191
+ }
192
+
193
+ // Normal mode: show instructions
194
+ console.log(`To activate workstream "${ws.name}", run:`);
195
+ console.log(` eval "$(coder-config workstream use ${ws.name} --eval)"`);
196
+ console.log(`\nOr manually:`);
197
+ console.log(` export CODER_WORKSTREAM="${ws.name}"`);
198
+ return ws;
177
199
  }
178
200
 
179
201
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coder-config",
3
- "version": "0.43.2",
3
+ "version": "0.43.4",
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",