bonzai-burn 1.0.10 → 1.0.12
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 +13 -1
- package/payload-bonzai/specs.md +3 -3
- package/src/baccept.js +0 -0
- package/src/bburn.js +25 -3
package/package.json
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
{
|
|
2
|
+
"isClaude": false,
|
|
3
|
+
"isCursor": true,
|
|
2
4
|
"headlessClaude": true,
|
|
3
|
-
"autoBurn": false
|
|
5
|
+
"autoBurn": false,
|
|
6
|
+
"lineLimit": {
|
|
7
|
+
"enabled": true,
|
|
8
|
+
"limit": 70,
|
|
9
|
+
"prompt": "Split any file with over {{ linelimit }} lines into smaller files."
|
|
10
|
+
},
|
|
11
|
+
"folderLimit": {
|
|
12
|
+
"enabled": true,
|
|
13
|
+
"limit": 10,
|
|
14
|
+
"prompt": "Split any folder with over {{ folderlimit }} items into smaller, compartmentalized folders."
|
|
15
|
+
}
|
|
4
16
|
}
|
package/payload-bonzai/specs.md
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Define your cleanup requirements below. bburn will follow these instructions.
|
|
4
4
|
|
|
5
|
-
## Requirements:
|
|
5
|
+
## Custom Requirements:
|
|
6
6
|
- Remove unused imports and variables
|
|
7
|
-
- Split any folder with over 10 items into smaller, compartmentalized folders.
|
|
8
7
|
- Remove all console log statements
|
|
9
|
-
- Split any
|
|
8
|
+
- Split any file with over {{ linelimit }} lines into smaller files
|
|
9
|
+
- Split any folder with over {{ folderlimit }} items into smaller, compartmentalized folders
|
package/src/baccept.js
CHANGED
|
File without changes
|
package/src/bburn.js
CHANGED
|
@@ -73,8 +73,29 @@ function loadConfig(configPath) {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
function loadSpecs(specsPath) {
|
|
77
|
-
|
|
76
|
+
function loadSpecs(specsPath, config) {
|
|
77
|
+
let content = fs.readFileSync(specsPath, 'utf-8');
|
|
78
|
+
|
|
79
|
+
// Process lineLimit if enabled
|
|
80
|
+
if (config.lineLimit?.enabled) {
|
|
81
|
+
content = content.replace(/\{\{\s*linelimit\s*\}\}/gi, config.lineLimit.limit);
|
|
82
|
+
} else {
|
|
83
|
+
// Remove lines containing {{ linelimit }} if disabled
|
|
84
|
+
content = content.split('\n')
|
|
85
|
+
.filter(line => !/\{\{\s*linelimit\s*\}\}/i.test(line))
|
|
86
|
+
.join('\n');
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Process folderLimit if enabled
|
|
90
|
+
if (config.folderLimit?.enabled) {
|
|
91
|
+
content = content.replace(/\{\{\s*folderlimit\s*\}\}/gi, config.folderLimit.limit);
|
|
92
|
+
} else {
|
|
93
|
+
// Remove lines containing {{ folderlimit }} if disabled
|
|
94
|
+
content = content.split('\n')
|
|
95
|
+
.filter(line => !/\{\{\s*folderlimit\s*\}\}/i.test(line))
|
|
96
|
+
.join('\n');
|
|
97
|
+
}
|
|
98
|
+
|
|
78
99
|
return `You are a code cleanup assistant. Follow these specifications:\n\n${content}`;
|
|
79
100
|
}
|
|
80
101
|
|
|
@@ -104,6 +125,7 @@ function executeClaude(requirements, config) {
|
|
|
104
125
|
console.log('🖥️ Running in interactive mode...\n');
|
|
105
126
|
return new Promise((resolve, reject) => {
|
|
106
127
|
const args = [
|
|
128
|
+
'-p', requirements,
|
|
107
129
|
'--allowedTools', 'Read,Write,Edit,Bash',
|
|
108
130
|
'--permission-mode', 'dontAsk'
|
|
109
131
|
];
|
|
@@ -236,8 +258,8 @@ async function burn() {
|
|
|
236
258
|
|
|
237
259
|
// Ensure bonzai directory and specs file exist
|
|
238
260
|
const { specsPath, configPath } = ensureBonzaiDir();
|
|
239
|
-
const specs = loadSpecs(specsPath);
|
|
240
261
|
const config = loadConfig(configPath);
|
|
262
|
+
const specs = loadSpecs(specsPath, config);
|
|
241
263
|
|
|
242
264
|
// Check if Claude CLI exists and execute
|
|
243
265
|
console.log('🔍 Checking for Claude Code CLI...');
|