coder-config 0.40.11 → 0.40.13

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/cli.js CHANGED
@@ -51,6 +51,25 @@ if (command === 'ui' || command === 'web' || command === 'server') {
51
51
  }
52
52
 
53
53
  function stopDaemon() {
54
+ // Check for LaunchAgent first (macOS)
55
+ if (process.platform === 'darwin' && fs.existsSync(LAUNCH_AGENT_PATH)) {
56
+ try {
57
+ const { spawnSync } = require('child_process');
58
+ const result = spawnSync('launchctl', ['list', LAUNCH_AGENT_LABEL], { encoding: 'utf8' });
59
+ if (result.status === 0 && result.stdout) {
60
+ // LaunchAgent is loaded, unload it to stop
61
+ console.log('Stopping LaunchAgent daemon...');
62
+ const unload = spawnSync('launchctl', ['unload', LAUNCH_AGENT_PATH], { encoding: 'utf8' });
63
+ if (unload.status === 0) {
64
+ console.log('Stopped daemon (LaunchAgent unloaded)');
65
+ console.log('Run "coder-config ui" to restart');
66
+ return;
67
+ }
68
+ }
69
+ } catch {}
70
+ }
71
+
72
+ // Check PID file (manual daemon mode)
54
73
  if (!fs.existsSync(PID_FILE)) {
55
74
  console.log('No daemon running (PID file not found)');
56
75
  return;
@@ -253,7 +272,28 @@ function uninstallLaunchAgent() {
253
272
  }
254
273
 
255
274
  function startDaemon(flags) {
256
- // Check if already running
275
+ const { spawnSync } = require('child_process');
276
+
277
+ // Check if LaunchAgent is installed (macOS) - if so, reload it instead of PID mode
278
+ if (process.platform === 'darwin' && fs.existsSync(LAUNCH_AGENT_PATH)) {
279
+ // Unload first (ignore errors if not loaded)
280
+ spawnSync('launchctl', ['unload', LAUNCH_AGENT_PATH], { encoding: 'utf8' });
281
+
282
+ // Load the LaunchAgent
283
+ const result = spawnSync('launchctl', ['load', LAUNCH_AGENT_PATH], { encoding: 'utf8' });
284
+ if (result.status === 0) {
285
+ console.log('Started daemon (LaunchAgent reloaded)');
286
+ console.log(`UI available at: http://localhost:${flags.port}`);
287
+ console.log('\nCommands:');
288
+ console.log(' coder-config ui status - Check daemon status');
289
+ console.log(' coder-config ui stop - Stop the daemon');
290
+ return;
291
+ }
292
+ // If LaunchAgent load failed, fall through to PID mode
293
+ console.log('LaunchAgent failed to load, falling back to PID mode');
294
+ }
295
+
296
+ // Check if already running via PID
257
297
  if (fs.existsSync(PID_FILE)) {
258
298
  try {
259
299
  const existingPid = parseInt(fs.readFileSync(PID_FILE, 'utf8').trim());
package/lib/constants.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * Constants and tool path configurations
3
3
  */
4
4
 
5
- const VERSION = '0.40.11';
5
+ const VERSION = '0.40.13';
6
6
 
7
7
  // Tool-specific path configurations
8
8
  const TOOL_PATHS = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coder-config",
3
- "version": "0.40.11",
3
+ "version": "0.40.13",
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",