bugzero 0.0.8 → 0.0.10
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 -8
- package/dist/index.js +526 -113
- package/package.json +5 -6
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
> bugzero@0.0.
|
|
3
|
-
> tsup src/index.ts --format
|
|
2
|
+
> bugzero@0.0.10 build D:\WD projects\OpsPilot\packages\cli
|
|
3
|
+
> tsup src/index.ts --format cjs --dts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
6
6
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
7
|
[34mCLI[39m tsup v8.5.1
|
|
8
8
|
[34mCLI[39m Target: es2022
|
|
9
|
-
[
|
|
10
|
-
[
|
|
11
|
-
[
|
|
12
|
-
[32mESM[39m [1mdist\chunk-4ANZDGVD.js [22m[32m16.11 KB[39m
|
|
13
|
-
[32mESM[39m ⚡️ Build success in 150ms
|
|
9
|
+
[34mCJS[39m Build start
|
|
10
|
+
[32mCJS[39m [1mdist\index.js [22m[32m47.28 KB[39m
|
|
11
|
+
[32mCJS[39m ⚡️ Build success in 393ms
|
|
14
12
|
[34mDTS[39m Build start
|
|
15
|
-
[32mDTS[39m ⚡️ Build success in
|
|
13
|
+
[32mDTS[39m ⚡️ Build success in 1398ms
|
|
16
14
|
[32mDTS[39m [1mdist\index.d.ts [22m[32m20.00 B[39m
|
package/dist/index.js
CHANGED
|
@@ -1,32 +1,441 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
"use strict";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
10
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
|
|
29
|
+
// ../../node_modules/.pnpm/dotenv@17.4.2/node_modules/dotenv/lib/main.js
|
|
30
|
+
var require_main = __commonJS({
|
|
31
|
+
"../../node_modules/.pnpm/dotenv@17.4.2/node_modules/dotenv/lib/main.js"(exports2, module2) {
|
|
32
|
+
"use strict";
|
|
33
|
+
var fs = require("fs");
|
|
34
|
+
var path2 = require("path");
|
|
35
|
+
var os = require("os");
|
|
36
|
+
var crypto = require("crypto");
|
|
37
|
+
var TIPS = [
|
|
38
|
+
"\u25C8 encrypted .env [www.dotenvx.com]",
|
|
39
|
+
"\u25C8 secrets for agents [www.dotenvx.com]",
|
|
40
|
+
"\u2301 auth for agents [www.vestauth.com]",
|
|
41
|
+
"\u2318 custom filepath { path: '/custom/path/.env' }",
|
|
42
|
+
"\u2318 enable debugging { debug: true }",
|
|
43
|
+
"\u2318 override existing { override: true }",
|
|
44
|
+
"\u2318 suppress logs { quiet: true }",
|
|
45
|
+
"\u2318 multiple files { path: ['.env.local', '.env'] }"
|
|
46
|
+
];
|
|
47
|
+
function _getRandomTip() {
|
|
48
|
+
return TIPS[Math.floor(Math.random() * TIPS.length)];
|
|
49
|
+
}
|
|
50
|
+
function parseBoolean(value) {
|
|
51
|
+
if (typeof value === "string") {
|
|
52
|
+
return !["false", "0", "no", "off", ""].includes(value.toLowerCase());
|
|
53
|
+
}
|
|
54
|
+
return Boolean(value);
|
|
55
|
+
}
|
|
56
|
+
function supportsAnsi() {
|
|
57
|
+
return process.stdout.isTTY;
|
|
58
|
+
}
|
|
59
|
+
function dim(text) {
|
|
60
|
+
return supportsAnsi() ? `\x1B[2m${text}\x1B[0m` : text;
|
|
61
|
+
}
|
|
62
|
+
var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
|
63
|
+
function parse(src) {
|
|
64
|
+
const obj = {};
|
|
65
|
+
let lines = src.toString();
|
|
66
|
+
lines = lines.replace(/\r\n?/mg, "\n");
|
|
67
|
+
let match;
|
|
68
|
+
while ((match = LINE.exec(lines)) != null) {
|
|
69
|
+
const key = match[1];
|
|
70
|
+
let value = match[2] || "";
|
|
71
|
+
value = value.trim();
|
|
72
|
+
const maybeQuote = value[0];
|
|
73
|
+
value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2");
|
|
74
|
+
if (maybeQuote === '"') {
|
|
75
|
+
value = value.replace(/\\n/g, "\n");
|
|
76
|
+
value = value.replace(/\\r/g, "\r");
|
|
77
|
+
}
|
|
78
|
+
obj[key] = value;
|
|
79
|
+
}
|
|
80
|
+
return obj;
|
|
81
|
+
}
|
|
82
|
+
function _parseVault(options) {
|
|
83
|
+
options = options || {};
|
|
84
|
+
const vaultPath = _vaultPath(options);
|
|
85
|
+
options.path = vaultPath;
|
|
86
|
+
const result = DotenvModule.configDotenv(options);
|
|
87
|
+
if (!result.parsed) {
|
|
88
|
+
const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
|
|
89
|
+
err.code = "MISSING_DATA";
|
|
90
|
+
throw err;
|
|
91
|
+
}
|
|
92
|
+
const keys = _dotenvKey(options).split(",");
|
|
93
|
+
const length = keys.length;
|
|
94
|
+
let decrypted;
|
|
95
|
+
for (let i = 0; i < length; i++) {
|
|
96
|
+
try {
|
|
97
|
+
const key = keys[i].trim();
|
|
98
|
+
const attrs = _instructions(result, key);
|
|
99
|
+
decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
|
|
100
|
+
break;
|
|
101
|
+
} catch (error) {
|
|
102
|
+
if (i + 1 >= length) {
|
|
103
|
+
throw error;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return DotenvModule.parse(decrypted);
|
|
108
|
+
}
|
|
109
|
+
function _warn(message) {
|
|
110
|
+
console.error(`\u26A0 ${message}`);
|
|
111
|
+
}
|
|
112
|
+
function _debug(message) {
|
|
113
|
+
console.log(`\u2506 ${message}`);
|
|
114
|
+
}
|
|
115
|
+
function _log(message) {
|
|
116
|
+
console.log(`\u25C7 ${message}`);
|
|
117
|
+
}
|
|
118
|
+
function _dotenvKey(options) {
|
|
119
|
+
if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
|
|
120
|
+
return options.DOTENV_KEY;
|
|
121
|
+
}
|
|
122
|
+
if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
|
|
123
|
+
return process.env.DOTENV_KEY;
|
|
124
|
+
}
|
|
125
|
+
return "";
|
|
126
|
+
}
|
|
127
|
+
function _instructions(result, dotenvKey) {
|
|
128
|
+
let uri;
|
|
129
|
+
try {
|
|
130
|
+
uri = new URL(dotenvKey);
|
|
131
|
+
} catch (error) {
|
|
132
|
+
if (error.code === "ERR_INVALID_URL") {
|
|
133
|
+
const err = new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");
|
|
134
|
+
err.code = "INVALID_DOTENV_KEY";
|
|
135
|
+
throw err;
|
|
136
|
+
}
|
|
137
|
+
throw error;
|
|
138
|
+
}
|
|
139
|
+
const key = uri.password;
|
|
140
|
+
if (!key) {
|
|
141
|
+
const err = new Error("INVALID_DOTENV_KEY: Missing key part");
|
|
142
|
+
err.code = "INVALID_DOTENV_KEY";
|
|
143
|
+
throw err;
|
|
144
|
+
}
|
|
145
|
+
const environment = uri.searchParams.get("environment");
|
|
146
|
+
if (!environment) {
|
|
147
|
+
const err = new Error("INVALID_DOTENV_KEY: Missing environment part");
|
|
148
|
+
err.code = "INVALID_DOTENV_KEY";
|
|
149
|
+
throw err;
|
|
150
|
+
}
|
|
151
|
+
const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
|
|
152
|
+
const ciphertext = result.parsed[environmentKey];
|
|
153
|
+
if (!ciphertext) {
|
|
154
|
+
const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
|
|
155
|
+
err.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
|
|
156
|
+
throw err;
|
|
157
|
+
}
|
|
158
|
+
return { ciphertext, key };
|
|
159
|
+
}
|
|
160
|
+
function _vaultPath(options) {
|
|
161
|
+
let possibleVaultPath = null;
|
|
162
|
+
if (options && options.path && options.path.length > 0) {
|
|
163
|
+
if (Array.isArray(options.path)) {
|
|
164
|
+
for (const filepath of options.path) {
|
|
165
|
+
if (fs.existsSync(filepath)) {
|
|
166
|
+
possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
} else {
|
|
170
|
+
possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
|
|
171
|
+
}
|
|
172
|
+
} else {
|
|
173
|
+
possibleVaultPath = path2.resolve(process.cwd(), ".env.vault");
|
|
174
|
+
}
|
|
175
|
+
if (fs.existsSync(possibleVaultPath)) {
|
|
176
|
+
return possibleVaultPath;
|
|
177
|
+
}
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
function _resolveHome(envPath) {
|
|
181
|
+
return envPath[0] === "~" ? path2.join(os.homedir(), envPath.slice(1)) : envPath;
|
|
182
|
+
}
|
|
183
|
+
function _configVault(options) {
|
|
184
|
+
const debug = parseBoolean(process.env.DOTENV_CONFIG_DEBUG || options && options.debug);
|
|
185
|
+
const quiet = parseBoolean(process.env.DOTENV_CONFIG_QUIET || options && options.quiet);
|
|
186
|
+
if (debug || !quiet) {
|
|
187
|
+
_log("loading env from encrypted .env.vault");
|
|
188
|
+
}
|
|
189
|
+
const parsed = DotenvModule._parseVault(options);
|
|
190
|
+
let processEnv = process.env;
|
|
191
|
+
if (options && options.processEnv != null) {
|
|
192
|
+
processEnv = options.processEnv;
|
|
193
|
+
}
|
|
194
|
+
DotenvModule.populate(processEnv, parsed, options);
|
|
195
|
+
return { parsed };
|
|
196
|
+
}
|
|
197
|
+
function configDotenv(options) {
|
|
198
|
+
const dotenvPath = path2.resolve(process.cwd(), ".env");
|
|
199
|
+
let encoding = "utf8";
|
|
200
|
+
let processEnv = process.env;
|
|
201
|
+
if (options && options.processEnv != null) {
|
|
202
|
+
processEnv = options.processEnv;
|
|
203
|
+
}
|
|
204
|
+
let debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || options && options.debug);
|
|
205
|
+
let quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || options && options.quiet);
|
|
206
|
+
if (options && options.encoding) {
|
|
207
|
+
encoding = options.encoding;
|
|
208
|
+
} else {
|
|
209
|
+
if (debug) {
|
|
210
|
+
_debug("no encoding is specified (UTF-8 is used by default)");
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
let optionPaths = [dotenvPath];
|
|
214
|
+
if (options && options.path) {
|
|
215
|
+
if (!Array.isArray(options.path)) {
|
|
216
|
+
optionPaths = [_resolveHome(options.path)];
|
|
217
|
+
} else {
|
|
218
|
+
optionPaths = [];
|
|
219
|
+
for (const filepath of options.path) {
|
|
220
|
+
optionPaths.push(_resolveHome(filepath));
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
let lastError;
|
|
225
|
+
const parsedAll = {};
|
|
226
|
+
for (const path3 of optionPaths) {
|
|
227
|
+
try {
|
|
228
|
+
const parsed = DotenvModule.parse(fs.readFileSync(path3, { encoding }));
|
|
229
|
+
DotenvModule.populate(parsedAll, parsed, options);
|
|
230
|
+
} catch (e) {
|
|
231
|
+
if (debug) {
|
|
232
|
+
_debug(`failed to load ${path3} ${e.message}`);
|
|
233
|
+
}
|
|
234
|
+
lastError = e;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
const populated = DotenvModule.populate(processEnv, parsedAll, options);
|
|
238
|
+
debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || debug);
|
|
239
|
+
quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || quiet);
|
|
240
|
+
if (debug || !quiet) {
|
|
241
|
+
const keysCount = Object.keys(populated).length;
|
|
242
|
+
const shortPaths = [];
|
|
243
|
+
for (const filePath of optionPaths) {
|
|
244
|
+
try {
|
|
245
|
+
const relative = path2.relative(process.cwd(), filePath);
|
|
246
|
+
shortPaths.push(relative);
|
|
247
|
+
} catch (e) {
|
|
248
|
+
if (debug) {
|
|
249
|
+
_debug(`failed to load ${filePath} ${e.message}`);
|
|
250
|
+
}
|
|
251
|
+
lastError = e;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
_log(`injected env (${keysCount}) from ${shortPaths.join(",")} ${dim(`// tip: ${_getRandomTip()}`)}`);
|
|
255
|
+
}
|
|
256
|
+
if (lastError) {
|
|
257
|
+
return { parsed: parsedAll, error: lastError };
|
|
258
|
+
} else {
|
|
259
|
+
return { parsed: parsedAll };
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
function config(options) {
|
|
263
|
+
if (_dotenvKey(options).length === 0) {
|
|
264
|
+
return DotenvModule.configDotenv(options);
|
|
265
|
+
}
|
|
266
|
+
const vaultPath = _vaultPath(options);
|
|
267
|
+
if (!vaultPath) {
|
|
268
|
+
_warn(`you set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}`);
|
|
269
|
+
return DotenvModule.configDotenv(options);
|
|
270
|
+
}
|
|
271
|
+
return DotenvModule._configVault(options);
|
|
272
|
+
}
|
|
273
|
+
function decrypt(encrypted, keyStr) {
|
|
274
|
+
const key = Buffer.from(keyStr.slice(-64), "hex");
|
|
275
|
+
let ciphertext = Buffer.from(encrypted, "base64");
|
|
276
|
+
const nonce = ciphertext.subarray(0, 12);
|
|
277
|
+
const authTag = ciphertext.subarray(-16);
|
|
278
|
+
ciphertext = ciphertext.subarray(12, -16);
|
|
279
|
+
try {
|
|
280
|
+
const aesgcm = crypto.createDecipheriv("aes-256-gcm", key, nonce);
|
|
281
|
+
aesgcm.setAuthTag(authTag);
|
|
282
|
+
return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
|
|
283
|
+
} catch (error) {
|
|
284
|
+
const isRange = error instanceof RangeError;
|
|
285
|
+
const invalidKeyLength = error.message === "Invalid key length";
|
|
286
|
+
const decryptionFailed = error.message === "Unsupported state or unable to authenticate data";
|
|
287
|
+
if (isRange || invalidKeyLength) {
|
|
288
|
+
const err = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
|
|
289
|
+
err.code = "INVALID_DOTENV_KEY";
|
|
290
|
+
throw err;
|
|
291
|
+
} else if (decryptionFailed) {
|
|
292
|
+
const err = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
|
|
293
|
+
err.code = "DECRYPTION_FAILED";
|
|
294
|
+
throw err;
|
|
295
|
+
} else {
|
|
296
|
+
throw error;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
function populate(processEnv, parsed, options = {}) {
|
|
301
|
+
const debug = Boolean(options && options.debug);
|
|
302
|
+
const override = Boolean(options && options.override);
|
|
303
|
+
const populated = {};
|
|
304
|
+
if (typeof parsed !== "object") {
|
|
305
|
+
const err = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
|
|
306
|
+
err.code = "OBJECT_REQUIRED";
|
|
307
|
+
throw err;
|
|
308
|
+
}
|
|
309
|
+
for (const key of Object.keys(parsed)) {
|
|
310
|
+
if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
|
|
311
|
+
if (override === true) {
|
|
312
|
+
processEnv[key] = parsed[key];
|
|
313
|
+
populated[key] = parsed[key];
|
|
314
|
+
}
|
|
315
|
+
if (debug) {
|
|
316
|
+
if (override === true) {
|
|
317
|
+
_debug(`"${key}" is already defined and WAS overwritten`);
|
|
318
|
+
} else {
|
|
319
|
+
_debug(`"${key}" is already defined and was NOT overwritten`);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
} else {
|
|
323
|
+
processEnv[key] = parsed[key];
|
|
324
|
+
populated[key] = parsed[key];
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
return populated;
|
|
328
|
+
}
|
|
329
|
+
var DotenvModule = {
|
|
330
|
+
configDotenv,
|
|
331
|
+
_configVault,
|
|
332
|
+
_parseVault,
|
|
333
|
+
config,
|
|
334
|
+
decrypt,
|
|
335
|
+
parse,
|
|
336
|
+
populate
|
|
337
|
+
};
|
|
338
|
+
module2.exports.configDotenv = DotenvModule.configDotenv;
|
|
339
|
+
module2.exports._configVault = DotenvModule._configVault;
|
|
340
|
+
module2.exports._parseVault = DotenvModule._parseVault;
|
|
341
|
+
module2.exports.config = DotenvModule.config;
|
|
342
|
+
module2.exports.decrypt = DotenvModule.decrypt;
|
|
343
|
+
module2.exports.parse = DotenvModule.parse;
|
|
344
|
+
module2.exports.populate = DotenvModule.populate;
|
|
345
|
+
module2.exports = DotenvModule;
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
// ../config/dist/index.js
|
|
350
|
+
var require_dist = __commonJS({
|
|
351
|
+
"../config/dist/index.js"(exports2, module2) {
|
|
352
|
+
"use strict";
|
|
353
|
+
var __create2 = Object.create;
|
|
354
|
+
var __defProp2 = Object.defineProperty;
|
|
355
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
356
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
357
|
+
var __getProtoOf2 = Object.getPrototypeOf;
|
|
358
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
359
|
+
var __export = (target, all) => {
|
|
360
|
+
for (var name in all)
|
|
361
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
362
|
+
};
|
|
363
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
364
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
365
|
+
for (let key of __getOwnPropNames2(from))
|
|
366
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
367
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
368
|
+
}
|
|
369
|
+
return to;
|
|
370
|
+
};
|
|
371
|
+
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
372
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
373
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
374
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
375
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
376
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
377
|
+
mod
|
|
378
|
+
));
|
|
379
|
+
var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
380
|
+
var index_exports = {};
|
|
381
|
+
__export(index_exports, {
|
|
382
|
+
env: () => env,
|
|
383
|
+
getLocalConfig: () => getLocalConfig,
|
|
384
|
+
getSelectedModel: () => getSelectedModel,
|
|
385
|
+
saveLocalConfig: () => saveLocalConfig
|
|
386
|
+
});
|
|
387
|
+
module2.exports = __toCommonJS(index_exports);
|
|
388
|
+
var import_dotenv = __toESM2(require_main());
|
|
389
|
+
import_dotenv.default.config();
|
|
390
|
+
var env = {
|
|
391
|
+
openRouterKey: process.env.OPENROUTER_API_KEY
|
|
392
|
+
};
|
|
393
|
+
var import_fs = __toESM2(require("fs"));
|
|
394
|
+
var import_path2 = __toESM2(require("path"));
|
|
395
|
+
var CONFIG_FILENAME = ".bugzerorc";
|
|
396
|
+
function getLocalConfig(cwd = process.cwd()) {
|
|
397
|
+
try {
|
|
398
|
+
const configPath = import_path2.default.resolve(cwd, CONFIG_FILENAME);
|
|
399
|
+
if (import_fs.default.existsSync(configPath)) {
|
|
400
|
+
const content = import_fs.default.readFileSync(configPath, "utf-8");
|
|
401
|
+
return JSON.parse(content);
|
|
402
|
+
}
|
|
403
|
+
} catch (e) {
|
|
404
|
+
}
|
|
405
|
+
return {};
|
|
406
|
+
}
|
|
407
|
+
function saveLocalConfig(config, cwd = process.cwd()) {
|
|
408
|
+
const configPath = import_path2.default.resolve(cwd, CONFIG_FILENAME);
|
|
409
|
+
import_fs.default.writeFileSync(configPath, JSON.stringify(config, null, 2), "utf-8");
|
|
410
|
+
}
|
|
411
|
+
function getSelectedModel(cwd = process.cwd()) {
|
|
412
|
+
const config = getLocalConfig(cwd);
|
|
413
|
+
return config.model || "deepseek/deepseek-chat";
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
});
|
|
8
417
|
|
|
9
418
|
// ../analyzers/dist/index.js
|
|
10
419
|
var require_dist2 = __commonJS({
|
|
11
|
-
"../analyzers/dist/index.js"(
|
|
420
|
+
"../analyzers/dist/index.js"(exports2, module2) {
|
|
12
421
|
"use strict";
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
422
|
+
var __defProp2 = Object.defineProperty;
|
|
423
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
424
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
425
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
17
426
|
var __export = (target, all) => {
|
|
18
427
|
for (var name in all)
|
|
19
|
-
|
|
428
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
20
429
|
};
|
|
21
|
-
var
|
|
430
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
22
431
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
23
|
-
for (let key of
|
|
24
|
-
if (!
|
|
25
|
-
|
|
432
|
+
for (let key of __getOwnPropNames2(from))
|
|
433
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
434
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
26
435
|
}
|
|
27
436
|
return to;
|
|
28
437
|
};
|
|
29
|
-
var __toCommonJS = (mod) =>
|
|
438
|
+
var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
30
439
|
var index_exports = {};
|
|
31
440
|
__export(index_exports, {
|
|
32
441
|
parseErrors: () => parseErrors,
|
|
@@ -35,14 +444,18 @@ var require_dist2 = __commonJS({
|
|
|
35
444
|
runLint: () => runLint,
|
|
36
445
|
runTests: () => runTests
|
|
37
446
|
});
|
|
38
|
-
|
|
447
|
+
module2.exports = __toCommonJS(index_exports);
|
|
39
448
|
async function runCommand(command, cwd) {
|
|
40
449
|
const { execa } = await import("execa");
|
|
41
450
|
try {
|
|
42
451
|
const result = await execa(command, {
|
|
43
452
|
shell: true,
|
|
44
453
|
cwd: cwd ?? process.cwd(),
|
|
45
|
-
all: true
|
|
454
|
+
all: true,
|
|
455
|
+
env: {
|
|
456
|
+
...process.env,
|
|
457
|
+
CI: "true"
|
|
458
|
+
}
|
|
46
459
|
});
|
|
47
460
|
return {
|
|
48
461
|
success: true,
|
|
@@ -112,43 +525,43 @@ var require_dist2 = __commonJS({
|
|
|
112
525
|
|
|
113
526
|
// ../ai-provider/dist/index.js
|
|
114
527
|
var require_dist3 = __commonJS({
|
|
115
|
-
"../ai-provider/dist/index.js"(
|
|
528
|
+
"../ai-provider/dist/index.js"(exports2, module2) {
|
|
116
529
|
"use strict";
|
|
117
|
-
var
|
|
118
|
-
var
|
|
119
|
-
var
|
|
120
|
-
var
|
|
121
|
-
var
|
|
122
|
-
var
|
|
530
|
+
var __create2 = Object.create;
|
|
531
|
+
var __defProp2 = Object.defineProperty;
|
|
532
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
533
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
534
|
+
var __getProtoOf2 = Object.getPrototypeOf;
|
|
535
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
123
536
|
var __export = (target, all) => {
|
|
124
537
|
for (var name in all)
|
|
125
|
-
|
|
538
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
126
539
|
};
|
|
127
|
-
var
|
|
540
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
128
541
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
129
|
-
for (let key of
|
|
130
|
-
if (!
|
|
131
|
-
|
|
542
|
+
for (let key of __getOwnPropNames2(from))
|
|
543
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
544
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
132
545
|
}
|
|
133
546
|
return to;
|
|
134
547
|
};
|
|
135
|
-
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ?
|
|
548
|
+
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
136
549
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
137
550
|
// file that has been converted to a CommonJS file using a Babel-
|
|
138
551
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
139
552
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
140
|
-
isNodeMode || !mod || !mod.__esModule ?
|
|
553
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
141
554
|
mod
|
|
142
555
|
));
|
|
143
|
-
var __toCommonJS = (mod) =>
|
|
556
|
+
var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
144
557
|
var index_exports = {};
|
|
145
558
|
__export(index_exports, {
|
|
146
559
|
OpenRouterProvider: () => OpenRouterProvider
|
|
147
560
|
});
|
|
148
|
-
|
|
149
|
-
var import_axios = __toESM2(
|
|
150
|
-
var import_fs = __toESM2(
|
|
151
|
-
var import_path2 = __toESM2(
|
|
561
|
+
module2.exports = __toCommonJS(index_exports);
|
|
562
|
+
var import_axios = __toESM2(require("axios"));
|
|
563
|
+
var import_fs = __toESM2(require("fs"));
|
|
564
|
+
var import_path2 = __toESM2(require("path"));
|
|
152
565
|
function resolveModel(cwd) {
|
|
153
566
|
try {
|
|
154
567
|
const configPath = import_path2.default.resolve(cwd ?? process.cwd(), ".bugzerorc");
|
|
@@ -209,30 +622,30 @@ var require_dist3 = __commonJS({
|
|
|
209
622
|
|
|
210
623
|
// ../prompts/dist/index.js
|
|
211
624
|
var require_dist4 = __commonJS({
|
|
212
|
-
"../prompts/dist/index.js"(
|
|
625
|
+
"../prompts/dist/index.js"(exports2, module2) {
|
|
213
626
|
"use strict";
|
|
214
|
-
var
|
|
215
|
-
var
|
|
216
|
-
var
|
|
217
|
-
var
|
|
627
|
+
var __defProp2 = Object.defineProperty;
|
|
628
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
629
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
630
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
218
631
|
var __export = (target, all) => {
|
|
219
632
|
for (var name in all)
|
|
220
|
-
|
|
633
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
221
634
|
};
|
|
222
|
-
var
|
|
635
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
223
636
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
224
|
-
for (let key of
|
|
225
|
-
if (!
|
|
226
|
-
|
|
637
|
+
for (let key of __getOwnPropNames2(from))
|
|
638
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
639
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
227
640
|
}
|
|
228
641
|
return to;
|
|
229
642
|
};
|
|
230
|
-
var __toCommonJS = (mod) =>
|
|
643
|
+
var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
231
644
|
var index_exports = {};
|
|
232
645
|
__export(index_exports, {
|
|
233
646
|
buildAnalysisPrompt: () => buildAnalysisPrompt
|
|
234
647
|
});
|
|
235
|
-
|
|
648
|
+
module2.exports = __toCommonJS(index_exports);
|
|
236
649
|
function buildAnalysisPrompt(errorOutput, cwd) {
|
|
237
650
|
return `You are an expert software engineer specialising in fixing build, lint, and test failures.
|
|
238
651
|
|
|
@@ -267,42 +680,42 @@ Critical rules:
|
|
|
267
680
|
|
|
268
681
|
// ../patcher/dist/index.js
|
|
269
682
|
var require_dist5 = __commonJS({
|
|
270
|
-
"../patcher/dist/index.js"(
|
|
683
|
+
"../patcher/dist/index.js"(exports2, module2) {
|
|
271
684
|
"use strict";
|
|
272
|
-
var
|
|
273
|
-
var
|
|
274
|
-
var
|
|
275
|
-
var
|
|
276
|
-
var
|
|
277
|
-
var
|
|
685
|
+
var __create2 = Object.create;
|
|
686
|
+
var __defProp2 = Object.defineProperty;
|
|
687
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
688
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
689
|
+
var __getProtoOf2 = Object.getPrototypeOf;
|
|
690
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
278
691
|
var __export = (target, all) => {
|
|
279
692
|
for (var name in all)
|
|
280
|
-
|
|
693
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
281
694
|
};
|
|
282
|
-
var
|
|
695
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
283
696
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
284
|
-
for (let key of
|
|
285
|
-
if (!
|
|
286
|
-
|
|
697
|
+
for (let key of __getOwnPropNames2(from))
|
|
698
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
699
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
287
700
|
}
|
|
288
701
|
return to;
|
|
289
702
|
};
|
|
290
|
-
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ?
|
|
703
|
+
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
291
704
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
292
705
|
// file that has been converted to a CommonJS file using a Babel-
|
|
293
706
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
294
707
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
295
|
-
isNodeMode || !mod || !mod.__esModule ?
|
|
708
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
296
709
|
mod
|
|
297
710
|
));
|
|
298
|
-
var __toCommonJS = (mod) =>
|
|
711
|
+
var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
299
712
|
var index_exports = {};
|
|
300
713
|
__export(index_exports, {
|
|
301
714
|
applyPatch: () => applyPatch
|
|
302
715
|
});
|
|
303
|
-
|
|
304
|
-
var import_fs = __toESM2(
|
|
305
|
-
var import_path2 = __toESM2(
|
|
716
|
+
module2.exports = __toCommonJS(index_exports);
|
|
717
|
+
var import_fs = __toESM2(require("fs"));
|
|
718
|
+
var import_path2 = __toESM2(require("path"));
|
|
306
719
|
function applyPatch(absoluteFilePath, search, replace) {
|
|
307
720
|
try {
|
|
308
721
|
if (!import_fs.default.existsSync(absoluteFilePath)) {
|
|
@@ -332,43 +745,43 @@ var require_dist5 = __commonJS({
|
|
|
332
745
|
|
|
333
746
|
// ../agents/dist/index.js
|
|
334
747
|
var require_dist6 = __commonJS({
|
|
335
|
-
"../agents/dist/index.js"(
|
|
748
|
+
"../agents/dist/index.js"(exports2, module2) {
|
|
336
749
|
"use strict";
|
|
337
|
-
var
|
|
338
|
-
var
|
|
339
|
-
var
|
|
340
|
-
var
|
|
341
|
-
var
|
|
342
|
-
var
|
|
750
|
+
var __create2 = Object.create;
|
|
751
|
+
var __defProp2 = Object.defineProperty;
|
|
752
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
753
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
754
|
+
var __getProtoOf2 = Object.getPrototypeOf;
|
|
755
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
343
756
|
var __export = (target, all) => {
|
|
344
757
|
for (var name in all)
|
|
345
|
-
|
|
758
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
346
759
|
};
|
|
347
|
-
var
|
|
760
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
348
761
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
349
|
-
for (let key of
|
|
350
|
-
if (!
|
|
351
|
-
|
|
762
|
+
for (let key of __getOwnPropNames2(from))
|
|
763
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
764
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
352
765
|
}
|
|
353
766
|
return to;
|
|
354
767
|
};
|
|
355
|
-
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ?
|
|
768
|
+
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
356
769
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
357
770
|
// file that has been converted to a CommonJS file using a Babel-
|
|
358
771
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
359
772
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
360
|
-
isNodeMode || !mod || !mod.__esModule ?
|
|
773
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
361
774
|
mod
|
|
362
775
|
));
|
|
363
|
-
var __toCommonJS = (mod) =>
|
|
776
|
+
var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
364
777
|
var index_exports = {};
|
|
365
778
|
__export(index_exports, {
|
|
366
779
|
workflow: () => workflow
|
|
367
780
|
});
|
|
368
|
-
|
|
369
|
-
var import_langgraph2 =
|
|
370
|
-
var import_path2 = __toESM2(
|
|
371
|
-
var import_langgraph =
|
|
781
|
+
module2.exports = __toCommonJS(index_exports);
|
|
782
|
+
var import_langgraph2 = require("@langchain/langgraph");
|
|
783
|
+
var import_path2 = __toESM2(require("path"));
|
|
784
|
+
var import_langgraph = require("@langchain/langgraph");
|
|
372
785
|
var GraphState = import_langgraph.Annotation.Root({
|
|
373
786
|
/** Absolute path to the project being fixed */
|
|
374
787
|
cwd: (0, import_langgraph.Annotation)({
|
|
@@ -482,44 +895,44 @@ var require_dist6 = __commonJS({
|
|
|
482
895
|
|
|
483
896
|
// ../core/dist/index.js
|
|
484
897
|
var require_dist7 = __commonJS({
|
|
485
|
-
"../core/dist/index.js"(
|
|
898
|
+
"../core/dist/index.js"(exports2, module2) {
|
|
486
899
|
"use strict";
|
|
487
|
-
var
|
|
488
|
-
var
|
|
489
|
-
var
|
|
490
|
-
var
|
|
491
|
-
var
|
|
492
|
-
var
|
|
900
|
+
var __create2 = Object.create;
|
|
901
|
+
var __defProp2 = Object.defineProperty;
|
|
902
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
903
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
904
|
+
var __getProtoOf2 = Object.getPrototypeOf;
|
|
905
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
493
906
|
var __export = (target, all) => {
|
|
494
907
|
for (var name in all)
|
|
495
|
-
|
|
908
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
496
909
|
};
|
|
497
|
-
var
|
|
910
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
498
911
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
499
|
-
for (let key of
|
|
500
|
-
if (!
|
|
501
|
-
|
|
912
|
+
for (let key of __getOwnPropNames2(from))
|
|
913
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
914
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
502
915
|
}
|
|
503
916
|
return to;
|
|
504
917
|
};
|
|
505
|
-
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ?
|
|
918
|
+
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
506
919
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
507
920
|
// file that has been converted to a CommonJS file using a Babel-
|
|
508
921
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
509
922
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
510
|
-
isNodeMode || !mod || !mod.__esModule ?
|
|
923
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
511
924
|
mod
|
|
512
925
|
));
|
|
513
|
-
var __toCommonJS = (mod) =>
|
|
926
|
+
var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
514
927
|
var index_exports = {};
|
|
515
928
|
__export(index_exports, {
|
|
516
929
|
detectFramework: () => detectFramework2,
|
|
517
930
|
orchestrate: () => orchestrate2,
|
|
518
931
|
orchestrateAndFix: () => orchestrateAndFix2
|
|
519
932
|
});
|
|
520
|
-
|
|
521
|
-
var import_fs = __toESM2(
|
|
522
|
-
var import_path2 = __toESM2(
|
|
933
|
+
module2.exports = __toCommonJS(index_exports);
|
|
934
|
+
var import_fs = __toESM2(require("fs"));
|
|
935
|
+
var import_path2 = __toESM2(require("path"));
|
|
523
936
|
function detectFramework2(cwd = process.cwd()) {
|
|
524
937
|
const has = (...files) => files.some((f) => import_fs.default.existsSync(import_path2.default.join(cwd, f)));
|
|
525
938
|
if (has("next.config.js", "next.config.ts", "next.config.mjs")) return "nextjs";
|
|
@@ -595,14 +1008,14 @@ var require_dist7 = __commonJS({
|
|
|
595
1008
|
});
|
|
596
1009
|
|
|
597
1010
|
// src/index.ts
|
|
598
|
-
var import_config = __toESM(require_dist()
|
|
599
|
-
var
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
var program = new Command();
|
|
1011
|
+
var import_config = __toESM(require_dist());
|
|
1012
|
+
var import_commander = require("commander");
|
|
1013
|
+
var import_path = __toESM(require("path"));
|
|
1014
|
+
var import_core = __toESM(require_dist7());
|
|
1015
|
+
var program = new import_commander.Command();
|
|
603
1016
|
program.name("bugzero").description("AI-powered build issue fixer \u2014 detects and repairs build errors automatically").version("0.0.1");
|
|
604
1017
|
program.command("hunt").description("Run build, lint, and tests \u2014 report issues without modifying files").option("-p, --path <dir>", "Path to the target project", ".").action(async (opts) => {
|
|
605
|
-
const cwd =
|
|
1018
|
+
const cwd = import_path.default.resolve(opts.path);
|
|
606
1019
|
const framework = (0, import_core.detectFramework)(cwd);
|
|
607
1020
|
console.log(`
|
|
608
1021
|
\u{1F50D} BugZero \u2014 Analyzing project`);
|
|
@@ -638,7 +1051,7 @@ ${allPassed ? "\u2705 All checks passed" : "\u274C Issues found \u2014 run 'bugz
|
|
|
638
1051
|
process.exit(allPassed ? 0 : 1);
|
|
639
1052
|
});
|
|
640
1053
|
program.command("rescue").description("Detect build failures and automatically apply AI-generated fixes").option("-p, --path <dir>", "Path to the target project", ".").option("-n, --max-attempts <number>", "Maximum AI fix attempts", "3").option("--dry-run", "Analyse only \u2014 print what would be fixed without writing files", false).action(async (opts) => {
|
|
641
|
-
const cwd =
|
|
1054
|
+
const cwd = import_path.default.resolve(opts.path);
|
|
642
1055
|
const maxAttempts = parseInt(opts.maxAttempts, 10);
|
|
643
1056
|
const dryRun = opts.dryRun;
|
|
644
1057
|
const framework = (0, import_core.detectFramework)(cwd);
|
|
@@ -671,7 +1084,7 @@ program.command("protect").description("[Deprecated] Use 'hunt' instead").action
|
|
|
671
1084
|
console.log(result);
|
|
672
1085
|
});
|
|
673
1086
|
program.command("vibe").description("Select which AI model (brain) to use for resolving bugs").action(async () => {
|
|
674
|
-
const { getLocalConfig, saveLocalConfig } = await
|
|
1087
|
+
const { getLocalConfig, saveLocalConfig } = await Promise.resolve().then(() => __toESM(require_dist()));
|
|
675
1088
|
const readline = await import("readline");
|
|
676
1089
|
const axios = (await import("axios")).default;
|
|
677
1090
|
console.log(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bugzero",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"bin": {
|
|
5
5
|
"bugzero": "dist/index.js"
|
|
6
6
|
},
|
|
@@ -12,14 +12,13 @@
|
|
|
12
12
|
"execa": "^7.2.0"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@opspilot/
|
|
16
|
-
"@opspilot/
|
|
17
|
-
"@opspilot/
|
|
15
|
+
"@opspilot/agents": "workspace:*",
|
|
16
|
+
"@opspilot/config": "workspace:*",
|
|
17
|
+
"@opspilot/core": "workspace:*"
|
|
18
18
|
},
|
|
19
19
|
"main": "./dist/index.js",
|
|
20
20
|
"types": "./dist/index.d.ts",
|
|
21
|
-
"type": "module",
|
|
22
21
|
"scripts": {
|
|
23
|
-
"build": "tsup src/index.ts --format
|
|
22
|
+
"build": "tsup src/index.ts --format cjs --dts"
|
|
24
23
|
}
|
|
25
24
|
}
|