coder-config 0.44.28 → 0.44.30
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 +1 -1
- package/lib/workstreams.js +21 -1
- package/package.json +1 -1
- package/ui/routes/loops.js +30 -3
- package/ui/routes/projects.js +1 -1
package/lib/constants.js
CHANGED
package/lib/workstreams.js
CHANGED
|
@@ -666,6 +666,25 @@ async function generateRulesWithClaude(projects) {
|
|
|
666
666
|
}
|
|
667
667
|
|
|
668
668
|
const { execFileSync } = require('child_process');
|
|
669
|
+
const os = require('os');
|
|
670
|
+
|
|
671
|
+
// Find claude binary (daemon processes may not have full PATH)
|
|
672
|
+
const getClaudePath = () => {
|
|
673
|
+
const candidates = [
|
|
674
|
+
path.join(os.homedir(), '.local', 'bin', 'claude'),
|
|
675
|
+
'/usr/local/bin/claude',
|
|
676
|
+
'/opt/homebrew/bin/claude',
|
|
677
|
+
path.join(os.homedir(), '.npm-global', 'bin', 'claude'),
|
|
678
|
+
];
|
|
679
|
+
for (const p of candidates) {
|
|
680
|
+
if (fs.existsSync(p)) return p;
|
|
681
|
+
}
|
|
682
|
+
try {
|
|
683
|
+
const resolved = execFileSync('which', ['claude'], { encoding: 'utf8' }).trim();
|
|
684
|
+
if (resolved && fs.existsSync(resolved)) return resolved;
|
|
685
|
+
} catch (e) {}
|
|
686
|
+
return 'claude';
|
|
687
|
+
};
|
|
669
688
|
|
|
670
689
|
const projectPaths = projects.map(p =>
|
|
671
690
|
path.resolve(p.replace(/^~/, process.env.HOME || ''))
|
|
@@ -686,7 +705,8 @@ Output markdown suitable for injecting into an AI assistant's context. Keep it c
|
|
|
686
705
|
|
|
687
706
|
try {
|
|
688
707
|
// Run claude -p with the prompt using execFileSync (safer than exec)
|
|
689
|
-
const
|
|
708
|
+
const claudePath = getClaudePath();
|
|
709
|
+
const result = execFileSync(claudePath, ['-p', prompt], {
|
|
690
710
|
cwd: projectPaths[0],
|
|
691
711
|
encoding: 'utf8',
|
|
692
712
|
timeout: 60000, // 60 second timeout
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coder-config",
|
|
3
|
-
"version": "0.44.
|
|
3
|
+
"version": "0.44.30",
|
|
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",
|
package/ui/routes/loops.js
CHANGED
|
@@ -5,6 +5,31 @@
|
|
|
5
5
|
const fs = require('fs');
|
|
6
6
|
const path = require('path');
|
|
7
7
|
const os = require('os');
|
|
8
|
+
const { execFileSync } = require('child_process');
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Get the full path to the claude binary
|
|
12
|
+
* Needed because daemon processes may not have full PATH
|
|
13
|
+
*/
|
|
14
|
+
function getClaudePath() {
|
|
15
|
+
const candidates = [
|
|
16
|
+
path.join(os.homedir(), '.local', 'bin', 'claude'),
|
|
17
|
+
'/usr/local/bin/claude',
|
|
18
|
+
'/opt/homebrew/bin/claude',
|
|
19
|
+
path.join(os.homedir(), '.npm-global', 'bin', 'claude'),
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
for (const p of candidates) {
|
|
23
|
+
if (fs.existsSync(p)) return p;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
try {
|
|
27
|
+
const resolved = execFileSync('which', ['claude'], { encoding: 'utf8' }).trim();
|
|
28
|
+
if (resolved && fs.existsSync(resolved)) return resolved;
|
|
29
|
+
} catch (e) {}
|
|
30
|
+
|
|
31
|
+
return 'claude';
|
|
32
|
+
}
|
|
8
33
|
|
|
9
34
|
/**
|
|
10
35
|
* Get all loops
|
|
@@ -330,12 +355,12 @@ function getRalphLoopPluginStatus() {
|
|
|
330
355
|
* Uses execFileSync with fixed args (no shell injection risk)
|
|
331
356
|
*/
|
|
332
357
|
async function installRalphLoopPlugin() {
|
|
333
|
-
const
|
|
358
|
+
const claudePath = getClaudePath();
|
|
334
359
|
|
|
335
360
|
try {
|
|
336
361
|
// Run claude plugin install command with execFileSync (safer than execSync)
|
|
337
362
|
// All arguments are fixed strings - no user input
|
|
338
|
-
execFileSync(
|
|
363
|
+
execFileSync(claudePath, ['plugin', 'install', 'ralph-loop@claude-plugins-official', '--scope', 'user'], {
|
|
339
364
|
encoding: 'utf8',
|
|
340
365
|
timeout: 30000, // 30 second timeout
|
|
341
366
|
stdio: ['pipe', 'pipe', 'pipe']
|
|
@@ -458,6 +483,8 @@ ${task}
|
|
|
458
483
|
## Rewritten Task:`;
|
|
459
484
|
|
|
460
485
|
return new Promise((resolve) => {
|
|
486
|
+
const { spawn } = require('child_process');
|
|
487
|
+
const claudePath = getClaudePath();
|
|
461
488
|
const args = ['-p', metaPrompt];
|
|
462
489
|
|
|
463
490
|
// Run from project directory if provided
|
|
@@ -471,7 +498,7 @@ ${task}
|
|
|
471
498
|
let resolved = false;
|
|
472
499
|
let timeoutId = null;
|
|
473
500
|
|
|
474
|
-
const proc = spawn(
|
|
501
|
+
const proc = spawn(claudePath, args, options);
|
|
475
502
|
|
|
476
503
|
const safeResolve = (result) => {
|
|
477
504
|
if (resolved) return;
|
package/ui/routes/projects.js
CHANGED
|
@@ -109,7 +109,7 @@ function addProject(manager, projectPath, name, setProjectDir, runClaudeInit = f
|
|
|
109
109
|
// Run claude /init if requested and CLAUDE.md doesn't exist
|
|
110
110
|
if (runClaudeInit && !fs.existsSync(claudeMd)) {
|
|
111
111
|
try {
|
|
112
|
-
execFileSync(
|
|
112
|
+
execFileSync(getClaudePath(), ['-p', '/init'], {
|
|
113
113
|
cwd: absPath,
|
|
114
114
|
stdio: 'pipe',
|
|
115
115
|
timeout: 30000
|