bugzero 0.0.1 → 0.0.4
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/.turbo/turbo-build.log +6 -4
- package/README.md +165 -0
- package/dist/chunk-4ANZDGVD.js +426 -0
- package/dist/dist-FQYNA36C.js +4 -0
- package/dist/index.js +234 -510
- package/package.json +3 -3
- package/src/index.ts +94 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bugzero",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"bin": {
|
|
5
5
|
"bugzero": "dist/index.js"
|
|
6
6
|
},
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"execa": "^7.2.0"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@opspilot/agents": "0.0.1",
|
|
16
15
|
"@opspilot/config": "0.0.1",
|
|
17
|
-
"@opspilot/core": "0.0.1"
|
|
16
|
+
"@opspilot/core": "0.0.1",
|
|
17
|
+
"@opspilot/agents": "0.0.1"
|
|
18
18
|
},
|
|
19
19
|
"main": "./dist/index.js",
|
|
20
20
|
"types": "./dist/index.d.ts",
|
package/src/index.ts
CHANGED
|
@@ -13,9 +13,9 @@ program
|
|
|
13
13
|
.description("AI-powered build issue fixer — detects and repairs build errors automatically")
|
|
14
14
|
.version("0.0.1");
|
|
15
15
|
|
|
16
|
-
// ── bugzero
|
|
16
|
+
// ── bugzero hunt ─────────────────────────────────────────────────────────────
|
|
17
17
|
program
|
|
18
|
-
.command("
|
|
18
|
+
.command("hunt")
|
|
19
19
|
.description("Run build, lint, and tests — report issues without modifying files")
|
|
20
20
|
.option("-p, --path <dir>", "Path to the target project", ".")
|
|
21
21
|
.action(async (opts) => {
|
|
@@ -53,13 +53,13 @@ program
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
const allPassed = build.success && lint.success && test.success;
|
|
56
|
-
console.log(`\n${allPassed ? "✅ All checks passed" : "❌ Issues found — run 'bugzero
|
|
56
|
+
console.log(`\n${allPassed ? "✅ All checks passed" : "❌ Issues found — run 'bugzero rescue' to repair"}\n`);
|
|
57
57
|
process.exit(allPassed ? 0 : 1);
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
-
// ── bugzero
|
|
60
|
+
// ── bugzero rescue ───────────────────────────────────────────────────────────
|
|
61
61
|
program
|
|
62
|
-
.command("
|
|
62
|
+
.command("rescue")
|
|
63
63
|
.description("Detect build failures and automatically apply AI-generated fixes")
|
|
64
64
|
.option("-p, --path <dir>", "Path to the target project", ".")
|
|
65
65
|
.option("-n, --max-attempts <number>", "Maximum AI fix attempts", "3")
|
|
@@ -99,11 +99,98 @@ program
|
|
|
99
99
|
// ── bugzero protect (legacy) ────────────────────────────────────────────────
|
|
100
100
|
program
|
|
101
101
|
.command("protect")
|
|
102
|
-
.description("[Deprecated] Use '
|
|
102
|
+
.description("[Deprecated] Use 'hunt' instead")
|
|
103
103
|
.action(async () => {
|
|
104
|
-
console.warn("⚠️ 'protect' is deprecated — use 'bugzero
|
|
104
|
+
console.warn("⚠️ 'protect' is deprecated — use 'bugzero hunt' instead.\n");
|
|
105
105
|
const result = await orchestrate();
|
|
106
106
|
console.log(result);
|
|
107
107
|
});
|
|
108
108
|
|
|
109
|
+
// ── bugzero vibe ─────────────────────────────────────────────────────────────
|
|
110
|
+
program
|
|
111
|
+
.command("vibe")
|
|
112
|
+
.description("Select which AI model (brain) to use for resolving bugs")
|
|
113
|
+
.action(async () => {
|
|
114
|
+
const { getLocalConfig, saveLocalConfig } = await import("@opspilot/config");
|
|
115
|
+
const readline = await import("readline");
|
|
116
|
+
const axios = (await import("axios")).default;
|
|
117
|
+
|
|
118
|
+
console.log(`\n🧠 BugZero Brain Selector`);
|
|
119
|
+
console.log(`──────────────────────────────────────────────`);
|
|
120
|
+
|
|
121
|
+
let popularModels: any[] = [];
|
|
122
|
+
try {
|
|
123
|
+
console.log("🌀 Fetching active models list from OpenRouter...");
|
|
124
|
+
const response = await axios.get("https://openrouter.ai/api/v1/models", { timeout: 8000 });
|
|
125
|
+
const allModels = response.data?.data || [];
|
|
126
|
+
const popularModelIds = [
|
|
127
|
+
"deepseek/deepseek-chat",
|
|
128
|
+
"deepseek/deepseek-r1",
|
|
129
|
+
"anthropic/claude-3.5-sonnet",
|
|
130
|
+
"google/gemini-2.5-pro",
|
|
131
|
+
"google/gemini-2.5-flash",
|
|
132
|
+
"openai/gpt-4o",
|
|
133
|
+
"meta-llama/llama-3.3-70b-instruct"
|
|
134
|
+
];
|
|
135
|
+
popularModels = allModels.filter((m: any) => popularModelIds.includes(m.id));
|
|
136
|
+
} catch (e: any) {
|
|
137
|
+
console.warn("⚠️ Failed to fetch models list from OpenRouter. Using cached default list.");
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (popularModels.length === 0) {
|
|
141
|
+
popularModels = [
|
|
142
|
+
{ id: "deepseek/deepseek-chat", name: "DeepSeek V3 (Chat)" },
|
|
143
|
+
{ id: "deepseek/deepseek-r1", name: "DeepSeek R1" },
|
|
144
|
+
{ id: "anthropic/claude-3.5-sonnet", name: "Claude 3.5 Sonnet" },
|
|
145
|
+
{ id: "google/gemini-2.5-pro", name: "Gemini 2.5 Pro" },
|
|
146
|
+
{ id: "google/gemini-2.5-flash", name: "Gemini 2.5 Flash" },
|
|
147
|
+
{ id: "openai/gpt-4o", name: "GPT-4o" },
|
|
148
|
+
{ id: "meta-llama/llama-3.3-70b-instruct", name: "Llama 3.3 Instruct" }
|
|
149
|
+
];
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const currentModel = getLocalConfig().model || "deepseek/deepseek-chat";
|
|
153
|
+
console.log(`\nCurrent active model: \x1b[36m${currentModel}\x1b[0m\n`);
|
|
154
|
+
|
|
155
|
+
popularModels.forEach((m, idx) => {
|
|
156
|
+
console.log(` [${idx + 1}] ${m.name} (${m.id})`);
|
|
157
|
+
});
|
|
158
|
+
console.log(` [${popularModels.length + 1}] 🖋️ Custom Model (Type manually)`);
|
|
159
|
+
console.log();
|
|
160
|
+
|
|
161
|
+
const rl = readline.createInterface({
|
|
162
|
+
input: process.stdin,
|
|
163
|
+
output: process.stdout,
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
rl.question(`Select a number (1-${popularModels.length + 1}): `, (answer) => {
|
|
167
|
+
const choice = parseInt(answer.trim(), 10);
|
|
168
|
+
if (isNaN(choice) || choice < 1 || choice > popularModels.length + 1) {
|
|
169
|
+
console.log("❌ Invalid selection. Keeping current model.");
|
|
170
|
+
rl.close();
|
|
171
|
+
process.exit(1);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if (choice === popularModels.length + 1) {
|
|
175
|
+
rl.question("Enter custom OpenRouter Model ID (e.g. microsoft/phi-3-medium-128k-instruct): ", (customModel) => {
|
|
176
|
+
const selected = customModel.trim();
|
|
177
|
+
if (!selected) {
|
|
178
|
+
console.log("❌ No model entered. Keeping current model.");
|
|
179
|
+
} else {
|
|
180
|
+
saveLocalConfig({ model: selected });
|
|
181
|
+
console.log(`\n✅ Saved! Model set to: \x1b[32m${selected}\x1b[0m`);
|
|
182
|
+
console.log(` Saved config to: .bugzerorc`);
|
|
183
|
+
}
|
|
184
|
+
rl.close();
|
|
185
|
+
});
|
|
186
|
+
} else {
|
|
187
|
+
const selected = popularModels[choice - 1].id;
|
|
188
|
+
saveLocalConfig({ model: selected });
|
|
189
|
+
console.log(`\n✅ Saved! Model set to: \x1b[32m${selected}\x1b[0m`);
|
|
190
|
+
console.log(` Saved config to: .bugzerorc`);
|
|
191
|
+
rl.close();
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
|
|
109
196
|
program.parse();
|