bonzai-burn 1.0.11 → 1.0.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/package.json +1 -1
- package/payload-bonzai/config.json +1 -0
- package/src/baccept.js +2 -4
- package/src/bburn.js +48 -5
package/package.json
CHANGED
package/src/baccept.js
CHANGED
|
@@ -35,9 +35,6 @@ async function accept() {
|
|
|
35
35
|
// Merge burn branch into original
|
|
36
36
|
execVisible(`git merge ${burnBranch} -m "Accept bonzai burn from ${burnBranch}"`);
|
|
37
37
|
|
|
38
|
-
// Delete burn branch
|
|
39
|
-
execVisible(`git branch -D ${burnBranch}`);
|
|
40
|
-
|
|
41
38
|
// If we made a WIP commit, we need to handle it
|
|
42
39
|
// The merge already includes the burn changes on top of the WIP commit
|
|
43
40
|
// So we can optionally squash or leave as-is
|
|
@@ -51,7 +48,8 @@ async function accept() {
|
|
|
51
48
|
exec('git config --unset bonzai.madeWipCommit');
|
|
52
49
|
|
|
53
50
|
console.log(`\n✓ Burn accepted and merged`);
|
|
54
|
-
console.log(`Now on: ${originalBranch}
|
|
51
|
+
console.log(`Now on: ${originalBranch}`);
|
|
52
|
+
console.log(`Branch kept: ${burnBranch}\n`);
|
|
55
53
|
|
|
56
54
|
} catch (error) {
|
|
57
55
|
console.error('❌ Accept failed:', error.message);
|
package/src/bburn.js
CHANGED
|
@@ -15,6 +15,36 @@ const CONFIG_FILE = 'config.json';
|
|
|
15
15
|
// Template folder in the package (ships as payload-bonzai, copied as bonzai)
|
|
16
16
|
const TEMPLATE_DIR = join(__dirname, '..', 'payload-bonzai');
|
|
17
17
|
|
|
18
|
+
// Parse --provider / -p argument, with config as fallback
|
|
19
|
+
function parseProvider(configDefault = 'claude') {
|
|
20
|
+
const args = process.argv.slice(2);
|
|
21
|
+
let provider = null;
|
|
22
|
+
|
|
23
|
+
for (let i = 0; i < args.length; i++) {
|
|
24
|
+
if (args[i] === '--provider' || args[i] === '-p') {
|
|
25
|
+
provider = args[i + 1];
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
if (args[i].startsWith('--provider=')) {
|
|
29
|
+
provider = args[i].split('=')[1];
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Use config default if no CLI arg provided
|
|
35
|
+
if (!provider) {
|
|
36
|
+
provider = configDefault;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const validProviders = ['claude', 'cursor'];
|
|
40
|
+
if (!validProviders.includes(provider)) {
|
|
41
|
+
console.error(`❌ Invalid provider: "${provider}". Must be one of: ${validProviders.join(', ')}`);
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return provider;
|
|
46
|
+
}
|
|
47
|
+
|
|
18
48
|
function initializeBonzai() {
|
|
19
49
|
const bonzaiPath = join(process.cwd(), BONZAI_DIR);
|
|
20
50
|
const specsPath = join(bonzaiPath, SPECS_FILE);
|
|
@@ -125,6 +155,7 @@ function executeClaude(requirements, config) {
|
|
|
125
155
|
console.log('🖥️ Running in interactive mode...\n');
|
|
126
156
|
return new Promise((resolve, reject) => {
|
|
127
157
|
const args = [
|
|
158
|
+
'-p', requirements,
|
|
128
159
|
'--allowedTools', 'Read,Write,Edit,Bash',
|
|
129
160
|
'--permission-mode', 'dontAsk'
|
|
130
161
|
];
|
|
@@ -250,6 +281,11 @@ function getToolIcon(toolName) {
|
|
|
250
281
|
return icons[toolName] || '🔹';
|
|
251
282
|
}
|
|
252
283
|
|
|
284
|
+
function executeCursor(requirements, config) {
|
|
285
|
+
console.log('🔥 Burning through Cursor...');
|
|
286
|
+
return Promise.resolve();
|
|
287
|
+
}
|
|
288
|
+
|
|
253
289
|
async function burn() {
|
|
254
290
|
try {
|
|
255
291
|
// Initialize bonzai folder and specs.md on first execution
|
|
@@ -260,8 +296,8 @@ async function burn() {
|
|
|
260
296
|
const config = loadConfig(configPath);
|
|
261
297
|
const specs = loadSpecs(specsPath, config);
|
|
262
298
|
|
|
263
|
-
//
|
|
264
|
-
|
|
299
|
+
// Determine provider: CLI arg overrides config
|
|
300
|
+
const provider = parseProvider(config.provider || 'claude');
|
|
265
301
|
|
|
266
302
|
// Check if in git repo
|
|
267
303
|
try {
|
|
@@ -303,13 +339,20 @@ async function burn() {
|
|
|
303
339
|
exec(`git config bonzai.madeWipCommit ${madeWipCommit}`);
|
|
304
340
|
|
|
305
341
|
console.log(`📋 Specs loaded from: ${BONZAI_DIR}/${SPECS_FILE}`);
|
|
306
|
-
console.log(
|
|
342
|
+
console.log(`🤖 Provider: ${provider}`);
|
|
343
|
+
if (provider === 'claude') {
|
|
344
|
+
console.log(`⚙️ Headless mode: ${config.headlessClaude !== false ? 'on' : 'off'}`);
|
|
345
|
+
}
|
|
307
346
|
console.log('🔥 Running Bonzai burn...\n');
|
|
308
347
|
|
|
309
348
|
const startTime = Date.now();
|
|
310
349
|
|
|
311
|
-
// Execute
|
|
312
|
-
|
|
350
|
+
// Execute with the selected provider
|
|
351
|
+
if (provider === 'cursor') {
|
|
352
|
+
await executeCursor(specs, config);
|
|
353
|
+
} else {
|
|
354
|
+
await executeClaude(specs, config);
|
|
355
|
+
}
|
|
313
356
|
|
|
314
357
|
const duration = Math.round((Date.now() - startTime) / 1000);
|
|
315
358
|
|