coder-config 0.41.17 → 0.41.21
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/loops.js +18 -32
- package/package.json +1 -1
- package/ui/dist/assets/{index-CLOEO79k.js → index-CySxCEgN.js} +44 -44
- package/ui/dist/index.html +1 -1
- package/ui/routes/loops.js +47 -143
package/lib/constants.js
CHANGED
package/lib/loops.js
CHANGED
|
@@ -126,9 +126,9 @@ function saveHistory(installDir, data) {
|
|
|
126
126
|
function getDefaultConfig() {
|
|
127
127
|
return {
|
|
128
128
|
maxIterations: 50,
|
|
129
|
-
maxCost: 10.00,
|
|
130
129
|
autoApprovePlan: false,
|
|
131
|
-
maxClarifyIterations: 5
|
|
130
|
+
maxClarifyIterations: 5,
|
|
131
|
+
completionPromise: 'DONE' // For ralph-loop plugin integration
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
134
|
|
|
@@ -144,6 +144,8 @@ function generateLoopId() {
|
|
|
144
144
|
*/
|
|
145
145
|
function createLoopState(name, task, options = {}) {
|
|
146
146
|
const config = options.config || getDefaultConfig();
|
|
147
|
+
const maxIterations = options.maxIterations || config.maxIterations;
|
|
148
|
+
const completionPromise = options.completionPromise || config.completionPromise || 'DONE';
|
|
147
149
|
|
|
148
150
|
return {
|
|
149
151
|
id: generateLoopId(),
|
|
@@ -159,14 +161,10 @@ function createLoopState(name, task, options = {}) {
|
|
|
159
161
|
},
|
|
160
162
|
iterations: {
|
|
161
163
|
current: 0,
|
|
162
|
-
max:
|
|
164
|
+
max: maxIterations,
|
|
163
165
|
history: []
|
|
164
166
|
},
|
|
165
|
-
|
|
166
|
-
maxIterations: config.maxIterations,
|
|
167
|
-
maxCost: config.maxCost,
|
|
168
|
-
currentCost: 0
|
|
169
|
-
},
|
|
167
|
+
completionPromise: completionPromise, // For ralph-loop plugin
|
|
170
168
|
taskComplete: false,
|
|
171
169
|
createdAt: new Date().toISOString(),
|
|
172
170
|
updatedAt: new Date().toISOString(),
|
|
@@ -200,9 +198,6 @@ function loopList(installDir) {
|
|
|
200
198
|
|
|
201
199
|
console.log(`${statusIcon} ${loop.name} ${phaseLabel} ${iterLabel}`);
|
|
202
200
|
console.log(` Task: ${(loop.task?.original || '').substring(0, 60)}${(loop.task?.original || '').length > 60 ? '...' : ''}`);
|
|
203
|
-
if (loop.budget?.currentCost > 0) {
|
|
204
|
-
console.log(` Cost: $${loop.budget.currentCost.toFixed(2)}/$${loop.budget.maxCost.toFixed(2)}`);
|
|
205
|
-
}
|
|
206
201
|
}
|
|
207
202
|
console.log('');
|
|
208
203
|
return enrichedLoops;
|
|
@@ -257,6 +252,8 @@ function loopCreate(installDir, taskOrName, options = {}) {
|
|
|
257
252
|
|
|
258
253
|
console.log(`✓ Created loop: ${state.name}`);
|
|
259
254
|
console.log(` ID: ${state.id}`);
|
|
255
|
+
console.log(` Max Iterations: ${state.iterations.max}`);
|
|
256
|
+
console.log(` Completion Promise: ${state.completionPromise}`);
|
|
260
257
|
console.log(` Start with: coder-config loop start ${state.id}`);
|
|
261
258
|
|
|
262
259
|
return state;
|
|
@@ -314,11 +311,6 @@ function loopUpdate(installDir, idOrName, updates) {
|
|
|
314
311
|
state.task = { ...state.task, ...updates.task };
|
|
315
312
|
}
|
|
316
313
|
|
|
317
|
-
// Update budget
|
|
318
|
-
if (updates.budget) {
|
|
319
|
-
state.budget = { ...state.budget, ...updates.budget };
|
|
320
|
-
}
|
|
321
|
-
|
|
322
314
|
// Update iterations
|
|
323
315
|
if (updates.iterations) {
|
|
324
316
|
state.iterations = { ...state.iterations, ...updates.iterations };
|
|
@@ -395,10 +387,11 @@ function loopStart(installDir, idOrName) {
|
|
|
395
387
|
console.log(` Phase: ${state.phase}`);
|
|
396
388
|
console.log(` Iteration: ${state.iterations.current}/${state.iterations.max}`);
|
|
397
389
|
|
|
398
|
-
// Output
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
console.log(
|
|
390
|
+
// Output run instructions (using official ralph-loop plugin)
|
|
391
|
+
const task = state.task.original.replace(/"/g, '\\"');
|
|
392
|
+
const completionPromise = state.completionPromise || 'DONE';
|
|
393
|
+
console.log('\nTo run this loop with Claude Code (uses official ralph-loop plugin):');
|
|
394
|
+
console.log(` claude --dangerously-skip-permissions "/ralph-loop ${task} --max-iterations ${state.iterations.max} --completion-promise '${completionPromise}'"`);
|
|
402
395
|
|
|
403
396
|
return state;
|
|
404
397
|
}
|
|
@@ -530,7 +523,7 @@ function displayLoopStatus(installDir, state) {
|
|
|
530
523
|
console.log(` Status: ${state.status}${state.pauseReason ? ` (${state.pauseReason})` : ''}`);
|
|
531
524
|
console.log(` Phase: ${state.phase}`);
|
|
532
525
|
console.log(` Iteration: ${state.iterations.current}/${state.iterations.max}`);
|
|
533
|
-
console.log(`
|
|
526
|
+
console.log(` Completion Promise: ${state.completionPromise || 'DONE'}`);
|
|
534
527
|
console.log(` Task: ${state.task.original}`);
|
|
535
528
|
|
|
536
529
|
if (state.task.clarified) {
|
|
@@ -567,7 +560,6 @@ function loopHistory(installDir) {
|
|
|
567
560
|
console.log(`${statusIcon} ${entry.name}`);
|
|
568
561
|
console.log(` Completed: ${entry.completedAt}`);
|
|
569
562
|
console.log(` Iterations: ${entry.totalIterations}`);
|
|
570
|
-
console.log(` Cost: $${entry.totalCost?.toFixed(2) || '0.00'}`);
|
|
571
563
|
}
|
|
572
564
|
console.log('');
|
|
573
565
|
return history.completed;
|
|
@@ -587,7 +579,6 @@ function archiveLoop(installDir, loopId) {
|
|
|
587
579
|
task: state.task.original,
|
|
588
580
|
status: state.status,
|
|
589
581
|
totalIterations: state.iterations.current,
|
|
590
|
-
totalCost: state.budget.currentCost,
|
|
591
582
|
createdAt: state.createdAt,
|
|
592
583
|
completedAt: state.completedAt || new Date().toISOString()
|
|
593
584
|
});
|
|
@@ -615,9 +606,9 @@ function loopConfig(installDir, updates = null) {
|
|
|
615
606
|
if (!updates) {
|
|
616
607
|
console.log('\n⚙️ Loop Configuration:\n');
|
|
617
608
|
console.log(` Max Iterations: ${data.config.maxIterations}`);
|
|
618
|
-
console.log(` Max Cost: $${data.config.maxCost.toFixed(2)}`);
|
|
619
609
|
console.log(` Auto-approve Plan: ${data.config.autoApprovePlan}`);
|
|
620
610
|
console.log(` Max Clarify Iterations: ${data.config.maxClarifyIterations}`);
|
|
611
|
+
console.log(` Completion Promise: ${data.config.completionPromise || 'DONE'}`);
|
|
621
612
|
console.log('');
|
|
622
613
|
return data.config;
|
|
623
614
|
}
|
|
@@ -626,15 +617,15 @@ function loopConfig(installDir, updates = null) {
|
|
|
626
617
|
if (updates.maxIterations !== undefined) {
|
|
627
618
|
data.config.maxIterations = parseInt(updates.maxIterations, 10);
|
|
628
619
|
}
|
|
629
|
-
if (updates.maxCost !== undefined) {
|
|
630
|
-
data.config.maxCost = parseFloat(updates.maxCost);
|
|
631
|
-
}
|
|
632
620
|
if (updates.autoApprovePlan !== undefined) {
|
|
633
621
|
data.config.autoApprovePlan = updates.autoApprovePlan === true || updates.autoApprovePlan === 'true';
|
|
634
622
|
}
|
|
635
623
|
if (updates.maxClarifyIterations !== undefined) {
|
|
636
624
|
data.config.maxClarifyIterations = parseInt(updates.maxClarifyIterations, 10);
|
|
637
625
|
}
|
|
626
|
+
if (updates.completionPromise !== undefined) {
|
|
627
|
+
data.config.completionPromise = updates.completionPromise;
|
|
628
|
+
}
|
|
638
629
|
|
|
639
630
|
saveLoops(installDir, data);
|
|
640
631
|
console.log('✓ Configuration updated');
|
|
@@ -671,11 +662,6 @@ function recordIteration(installDir, loopId, iteration) {
|
|
|
671
662
|
state.iterations.history.push(iteration);
|
|
672
663
|
state.iterations.current = iteration.n;
|
|
673
664
|
|
|
674
|
-
// Update cost
|
|
675
|
-
if (iteration.cost) {
|
|
676
|
-
state.budget.currentCost += iteration.cost;
|
|
677
|
-
}
|
|
678
|
-
|
|
679
665
|
// Save iteration file
|
|
680
666
|
const iterDir = path.join(getLoopDir(installDir, loopId), 'iterations');
|
|
681
667
|
if (!fs.existsSync(iterDir)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coder-config",
|
|
3
|
-
"version": "0.41.
|
|
3
|
+
"version": "0.41.21",
|
|
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",
|