@bugbug-io/cli 13.39.1 → 13.39.2
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/README.md +1 -5
- package/bin/bugbug.mjs +4 -0
- package/dist/{NavigatorApp-WSJMM3OT.js → NavigatorApp-6ZB6F4RF.js} +4 -9
- package/dist/{app-A4ZLLFP5.js → app-L5OYLEKP.js} +5 -3
- package/dist/chunk-BSHFIPEX.js +1092 -0
- package/dist/chunk-GNCJ7Y4W.js +65666 -0
- package/dist/chunk-PR4QN5HX.js +43 -0
- package/dist/chunk-WZXVS2EO.js +9 -0
- package/dist/getMachineId-bsd-QKL32ATF.js +29 -0
- package/dist/getMachineId-darwin-MNPDTPSO.js +29 -0
- package/dist/getMachineId-linux-6BBPG345.js +23 -0
- package/dist/getMachineId-unsupported-A7ZABDRN.js +14 -0
- package/dist/getMachineId-win-WYJ4B4CV.js +31 -0
- package/dist/index.js +24 -194
- package/dist/render-RAJK5JCO.js +8 -0
- package/package.json +4 -5
- package/dist/chunk-NTNHB6R6.js +0 -6098
- package/dist/render-UGRPBJOT.js +0 -7
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
9
|
+
}) : x)(function(x) {
|
|
10
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
12
|
+
});
|
|
13
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
14
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
15
|
+
};
|
|
16
|
+
var __export = (target, all) => {
|
|
17
|
+
for (var name in all)
|
|
18
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
+
};
|
|
20
|
+
var __copyProps = (to, from, except, desc) => {
|
|
21
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
+
for (let key of __getOwnPropNames(from))
|
|
23
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
+
}
|
|
26
|
+
return to;
|
|
27
|
+
};
|
|
28
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
+
mod
|
|
35
|
+
));
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
__require,
|
|
39
|
+
__commonJS,
|
|
40
|
+
__export,
|
|
41
|
+
__toESM
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=chunk-PR4QN5HX.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// ../../node_modules/@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/execAsync.js
|
|
2
|
+
import * as child_process from "child_process";
|
|
3
|
+
import * as util from "util";
|
|
4
|
+
var execAsync = util.promisify(child_process.exec);
|
|
5
|
+
|
|
6
|
+
export {
|
|
7
|
+
execAsync
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=chunk-WZXVS2EO.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
execAsync
|
|
3
|
+
} from "./chunk-WZXVS2EO.js";
|
|
4
|
+
import {
|
|
5
|
+
diag
|
|
6
|
+
} from "./chunk-BSHFIPEX.js";
|
|
7
|
+
import "./chunk-PR4QN5HX.js";
|
|
8
|
+
|
|
9
|
+
// ../../node_modules/@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/getMachineId-bsd.js
|
|
10
|
+
import { promises as fs } from "fs";
|
|
11
|
+
async function getMachineId() {
|
|
12
|
+
try {
|
|
13
|
+
const result = await fs.readFile("/etc/hostid", { encoding: "utf8" });
|
|
14
|
+
return result.trim();
|
|
15
|
+
} catch (e) {
|
|
16
|
+
diag.debug(`error reading machine id: ${e}`);
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
const result = await execAsync("kenv -q smbios.system.uuid");
|
|
20
|
+
return result.stdout.trim();
|
|
21
|
+
} catch (e) {
|
|
22
|
+
diag.debug(`error reading machine id: ${e}`);
|
|
23
|
+
}
|
|
24
|
+
return void 0;
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
getMachineId
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=getMachineId-bsd-QKL32ATF.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
execAsync
|
|
3
|
+
} from "./chunk-WZXVS2EO.js";
|
|
4
|
+
import {
|
|
5
|
+
diag
|
|
6
|
+
} from "./chunk-BSHFIPEX.js";
|
|
7
|
+
import "./chunk-PR4QN5HX.js";
|
|
8
|
+
|
|
9
|
+
// ../../node_modules/@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/getMachineId-darwin.js
|
|
10
|
+
async function getMachineId() {
|
|
11
|
+
try {
|
|
12
|
+
const result = await execAsync('ioreg -rd1 -c "IOPlatformExpertDevice"');
|
|
13
|
+
const idLine = result.stdout.split("\n").find((line) => line.includes("IOPlatformUUID"));
|
|
14
|
+
if (!idLine) {
|
|
15
|
+
return void 0;
|
|
16
|
+
}
|
|
17
|
+
const parts = idLine.split('" = "');
|
|
18
|
+
if (parts.length === 2) {
|
|
19
|
+
return parts[1].slice(0, -1);
|
|
20
|
+
}
|
|
21
|
+
} catch (e) {
|
|
22
|
+
diag.debug(`error reading machine id: ${e}`);
|
|
23
|
+
}
|
|
24
|
+
return void 0;
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
getMachineId
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=getMachineId-darwin-MNPDTPSO.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
diag
|
|
3
|
+
} from "./chunk-BSHFIPEX.js";
|
|
4
|
+
import "./chunk-PR4QN5HX.js";
|
|
5
|
+
|
|
6
|
+
// ../../node_modules/@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/getMachineId-linux.js
|
|
7
|
+
import { promises as fs } from "fs";
|
|
8
|
+
async function getMachineId() {
|
|
9
|
+
const paths = ["/etc/machine-id", "/var/lib/dbus/machine-id"];
|
|
10
|
+
for (const path of paths) {
|
|
11
|
+
try {
|
|
12
|
+
const result = await fs.readFile(path, { encoding: "utf8" });
|
|
13
|
+
return result.trim();
|
|
14
|
+
} catch (e) {
|
|
15
|
+
diag.debug(`error reading machine id: ${e}`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return void 0;
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
getMachineId
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=getMachineId-linux-6BBPG345.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
diag
|
|
3
|
+
} from "./chunk-BSHFIPEX.js";
|
|
4
|
+
import "./chunk-PR4QN5HX.js";
|
|
5
|
+
|
|
6
|
+
// ../../node_modules/@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/getMachineId-unsupported.js
|
|
7
|
+
async function getMachineId() {
|
|
8
|
+
diag.debug("could not read machine-id: unsupported platform");
|
|
9
|
+
return void 0;
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
getMachineId
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=getMachineId-unsupported-A7ZABDRN.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
execAsync
|
|
3
|
+
} from "./chunk-WZXVS2EO.js";
|
|
4
|
+
import {
|
|
5
|
+
diag
|
|
6
|
+
} from "./chunk-BSHFIPEX.js";
|
|
7
|
+
import "./chunk-PR4QN5HX.js";
|
|
8
|
+
|
|
9
|
+
// ../../node_modules/@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/getMachineId-win.js
|
|
10
|
+
import * as process from "process";
|
|
11
|
+
async function getMachineId() {
|
|
12
|
+
const args = "QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid";
|
|
13
|
+
let command = "%windir%\\System32\\REG.exe";
|
|
14
|
+
if (process.arch === "ia32" && "PROCESSOR_ARCHITEW6432" in process.env) {
|
|
15
|
+
command = "%windir%\\sysnative\\cmd.exe /c " + command;
|
|
16
|
+
}
|
|
17
|
+
try {
|
|
18
|
+
const result = await execAsync(`${command} ${args}`);
|
|
19
|
+
const parts = result.stdout.split("REG_SZ");
|
|
20
|
+
if (parts.length === 2) {
|
|
21
|
+
return parts[1].trim();
|
|
22
|
+
}
|
|
23
|
+
} catch (e) {
|
|
24
|
+
diag.debug(`error reading machine id: ${e}`);
|
|
25
|
+
}
|
|
26
|
+
return void 0;
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
getMachineId
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=getMachineId-win-WYJ4B4CV.js.map
|
package/dist/index.js
CHANGED
|
@@ -5,10 +5,8 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
BaseSuiteRunDetails,
|
|
7
7
|
BaseTestRunDetails,
|
|
8
|
-
DEFAULT_MCP_URL,
|
|
9
8
|
EXIT_GENERAL_ERROR,
|
|
10
9
|
EXIT_USAGE_ERROR,
|
|
11
|
-
MCP_SERVER_PACKAGE,
|
|
12
10
|
PLUGIN_PACKAGE_NAME,
|
|
13
11
|
PLUGIN_REPO_SOURCE,
|
|
14
12
|
addBreadcrumb,
|
|
@@ -56,7 +54,9 @@ import {
|
|
|
56
54
|
waitForSuiteRun,
|
|
57
55
|
waitForTestRun,
|
|
58
56
|
writeReportXml
|
|
59
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-GNCJ7Y4W.js";
|
|
58
|
+
import "./chunk-BSHFIPEX.js";
|
|
59
|
+
import "./chunk-PR4QN5HX.js";
|
|
60
60
|
|
|
61
61
|
// src/instrument.ts
|
|
62
62
|
initSentry({ telemetryEnabled: getCliConfig().telemetryEnabled, env: process.env });
|
|
@@ -120,153 +120,6 @@ var registerAuthCommands = (program2) => {
|
|
|
120
120
|
import { homedir } from "os";
|
|
121
121
|
|
|
122
122
|
// ../core/dist/install/clients.js
|
|
123
|
-
import { join } from "path";
|
|
124
|
-
|
|
125
|
-
// ../core/dist/install/skills.js
|
|
126
|
-
import { existsSync } from "fs";
|
|
127
|
-
var SKILLS_AGENT = {
|
|
128
|
-
windsurf: "windsurf",
|
|
129
|
-
cursor: "cursor",
|
|
130
|
-
vscode: "github-copilot"
|
|
131
|
-
};
|
|
132
|
-
var skillsAddArgv = (agent) => [
|
|
133
|
-
"npx",
|
|
134
|
-
"skills",
|
|
135
|
-
"add",
|
|
136
|
-
"bugbug-io/agent-plugin/skills",
|
|
137
|
-
"--agent",
|
|
138
|
-
agent,
|
|
139
|
-
"--global",
|
|
140
|
-
"--copy",
|
|
141
|
-
"--yes"
|
|
142
|
-
];
|
|
143
|
-
var installSkillsViaCli = async (clientId, finalDir, dryRun = false, options = {}) => {
|
|
144
|
-
const existedBefore = existsSync(finalDir);
|
|
145
|
-
if (dryRun)
|
|
146
|
-
return existedBefore ? "updated" : "created";
|
|
147
|
-
const agent = SKILLS_AGENT[clientId];
|
|
148
|
-
if (!agent) {
|
|
149
|
-
throw new Error(`BugBug skills are not supported for ${clientId}.`);
|
|
150
|
-
}
|
|
151
|
-
const argv = skillsAddArgv(agent);
|
|
152
|
-
const { ok, code } = runClientCommand(argv, options);
|
|
153
|
-
if (!ok) {
|
|
154
|
-
throw new Error(`Failed to install BugBug skills. (exit ${code}).`);
|
|
155
|
-
}
|
|
156
|
-
return existedBefore ? "updated" : "created";
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
// ../core/dist/install/writers.js
|
|
160
|
-
import { existsSync as existsSync3 } from "fs";
|
|
161
|
-
|
|
162
|
-
// ../core/dist/install/jsonConfig.js
|
|
163
|
-
import { existsSync as existsSync2, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
164
|
-
import { dirname } from "path";
|
|
165
|
-
var readJsonObject = (path) => {
|
|
166
|
-
if (!existsSync2(path))
|
|
167
|
-
return {};
|
|
168
|
-
try {
|
|
169
|
-
const parsed = JSON.parse(readFileSync(path, "utf8"));
|
|
170
|
-
return parsed && typeof parsed === "object" ? parsed : {};
|
|
171
|
-
} catch {
|
|
172
|
-
return {};
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
var writeJsonObject = (path, value) => {
|
|
176
|
-
mkdirSync(dirname(path), { recursive: true });
|
|
177
|
-
writeFileSync(path, `${JSON.stringify(value, null, 2)}
|
|
178
|
-
`, "utf8");
|
|
179
|
-
};
|
|
180
|
-
var getObject = (parent, key) => {
|
|
181
|
-
const existing = parent[key];
|
|
182
|
-
return existing && typeof existing === "object" ? existing : {};
|
|
183
|
-
};
|
|
184
|
-
var sameEntry = (a, b) => JSON.stringify(a) === JSON.stringify(b);
|
|
185
|
-
|
|
186
|
-
// ../core/dist/install/writers.js
|
|
187
|
-
var MCP_SERVER_KEY = "bugbug";
|
|
188
|
-
var buildMcpEntry = (shape, endpoint) => {
|
|
189
|
-
if (endpoint.transport === "stdio") {
|
|
190
|
-
const env = {};
|
|
191
|
-
if (endpoint.token)
|
|
192
|
-
env.API_TOKEN = endpoint.token;
|
|
193
|
-
if (endpoint.apiUrl)
|
|
194
|
-
env.BUGBUG_API_URL = endpoint.apiUrl;
|
|
195
|
-
if (endpoint.publicBaseUrl)
|
|
196
|
-
env.MCP_PUBLIC_BASE_URL = endpoint.publicBaseUrl;
|
|
197
|
-
const entry2 = {
|
|
198
|
-
command: "npx",
|
|
199
|
-
args: ["-y", MCP_SERVER_PACKAGE]
|
|
200
|
-
};
|
|
201
|
-
if (Object.keys(env).length > 0)
|
|
202
|
-
entry2.env = env;
|
|
203
|
-
return entry2;
|
|
204
|
-
}
|
|
205
|
-
const entry = { url: endpoint.url };
|
|
206
|
-
if (!shape.omitsHttpType)
|
|
207
|
-
entry.type = "http";
|
|
208
|
-
if (shape.oauthResource)
|
|
209
|
-
entry.oauth_resource = endpoint.url;
|
|
210
|
-
if (endpoint.token) {
|
|
211
|
-
entry.headers = { Authorization: `Bearer ${endpoint.token}` };
|
|
212
|
-
}
|
|
213
|
-
return entry;
|
|
214
|
-
};
|
|
215
|
-
var mergeMcpEntry = (existing, built) => {
|
|
216
|
-
const previous = existing && typeof existing === "object" ? { ...existing } : {};
|
|
217
|
-
if (!("headers" in built))
|
|
218
|
-
delete previous.headers;
|
|
219
|
-
return { ...previous, ...built };
|
|
220
|
-
};
|
|
221
|
-
var writeMcpConfig = (path, shape, endpoint, dryRun = false) => {
|
|
222
|
-
const existed = existsSync3(path);
|
|
223
|
-
const config = readJsonObject(path);
|
|
224
|
-
const servers = getObject(config, shape.serversKey);
|
|
225
|
-
const entry = mergeMcpEntry(servers[MCP_SERVER_KEY], buildMcpEntry(shape, endpoint));
|
|
226
|
-
if (existed && sameEntry(servers[MCP_SERVER_KEY], entry)) {
|
|
227
|
-
return "skipped";
|
|
228
|
-
}
|
|
229
|
-
if (dryRun)
|
|
230
|
-
return existed ? "updated" : "created";
|
|
231
|
-
servers[MCP_SERVER_KEY] = entry;
|
|
232
|
-
config[shape.serversKey] = servers;
|
|
233
|
-
writeJsonObject(path, config);
|
|
234
|
-
return existed ? "updated" : "created";
|
|
235
|
-
};
|
|
236
|
-
|
|
237
|
-
// ../core/dist/install/manualPlugin.js
|
|
238
|
-
var RANK = {
|
|
239
|
-
skipped: 0,
|
|
240
|
-
executed: 1,
|
|
241
|
-
unsupported: 2,
|
|
242
|
-
updated: 3,
|
|
243
|
-
created: 4
|
|
244
|
-
};
|
|
245
|
-
var strongest = (a, b) => RANK[a] >= RANK[b] ? a : b;
|
|
246
|
-
var manualPlugin = async (client, ctx, { shape, mcpPath, skillsClient, skillsDir }) => {
|
|
247
|
-
const mcpAction = writeMcpConfig(mcpPath, shape, ctx.endpoint, ctx.dryRun);
|
|
248
|
-
let skillsAction;
|
|
249
|
-
try {
|
|
250
|
-
skillsAction = await installSkillsViaCli(skillsClient, skillsDir, ctx.dryRun, ctx.runnerOptions);
|
|
251
|
-
} catch (err) {
|
|
252
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
253
|
-
return {
|
|
254
|
-
client,
|
|
255
|
-
path: `${mcpPath} (mcp: ${mcpAction})`,
|
|
256
|
-
action: "unsupported",
|
|
257
|
-
message: `Wrote MCP config but could not install skills: ${message}`
|
|
258
|
-
};
|
|
259
|
-
}
|
|
260
|
-
return {
|
|
261
|
-
client,
|
|
262
|
-
path: `${mcpPath}, ${skillsDir}`,
|
|
263
|
-
action: strongest(mcpAction, skillsAction)
|
|
264
|
-
};
|
|
265
|
-
};
|
|
266
|
-
|
|
267
|
-
// ../core/dist/install/clients.js
|
|
268
|
-
var windsurfMcpPath = (ctx) => join(ctx.home, ".codeium", "windsurf", "mcp_config.json");
|
|
269
|
-
var windsurfSkillsDir = (ctx) => join(ctx.home, ".codeium", "windsurf", "skills");
|
|
270
123
|
var CLIENTS = {
|
|
271
124
|
cursor: {
|
|
272
125
|
id: "cursor",
|
|
@@ -313,22 +166,6 @@ var CLIENTS = {
|
|
|
313
166
|
// Registers the source as a marketplace then installs `plugin@marketplace`,
|
|
314
167
|
// avoiding Copilot's deprecated direct local-path installs.
|
|
315
168
|
pluginsTarget: "github-copilot"
|
|
316
|
-
},
|
|
317
|
-
windsurf: {
|
|
318
|
-
id: "windsurf",
|
|
319
|
-
displayName: "Windsurf",
|
|
320
|
-
detectDir: join(".codeium", "windsurf"),
|
|
321
|
-
// The one client the `plugins` CLI has no target for, so it keeps the
|
|
322
|
-
// hand-written install: the MCP server written into its own config plus the
|
|
323
|
-
// BugBug skills installed via the `skills` CLI. This is also the only path
|
|
324
|
-
// that can carry a bearer token, since delegated clients authenticate
|
|
325
|
-
// through their own MCP OAuth flow.
|
|
326
|
-
installPlugin: (ctx) => manualPlugin("windsurf", ctx, {
|
|
327
|
-
shape: { serversKey: "mcpServers" },
|
|
328
|
-
mcpPath: windsurfMcpPath(ctx),
|
|
329
|
-
skillsClient: "windsurf",
|
|
330
|
-
skillsDir: windsurfSkillsDir(ctx)
|
|
331
|
-
})
|
|
332
169
|
}
|
|
333
170
|
};
|
|
334
171
|
|
|
@@ -415,33 +252,14 @@ var installPlugin = (client, ctx) => {
|
|
|
415
252
|
var PLUGIN_PACKAGE = PLUGIN_PACKAGE_NAME;
|
|
416
253
|
var resolvePluginRef = () => ({ kind: "package", value: PLUGIN_PACKAGE });
|
|
417
254
|
|
|
418
|
-
// src/utils/toolbox.ts
|
|
419
|
-
var padRight = (value, width) => {
|
|
420
|
-
if (value.length >= width) return value;
|
|
421
|
-
return value + " ".repeat(width - value.length);
|
|
422
|
-
};
|
|
423
|
-
var capitalize = (value) => value.charAt(0).toUpperCase() + value.slice(1);
|
|
424
|
-
var stripTrailingSlash = (value) => value.replace(/\/+$/, "");
|
|
425
|
-
|
|
426
255
|
// src/features/install/install.service.ts
|
|
427
256
|
var userHome = () => homedir();
|
|
428
|
-
var resolveEndpoint = ({
|
|
429
|
-
transport,
|
|
430
|
-
env = process.env,
|
|
431
|
-
token
|
|
432
|
-
}) => {
|
|
433
|
-
const apiUrl = env.BUGBUG_API_URL?.trim() || void 0;
|
|
434
|
-
const publicBaseUrl = env.MCP_PUBLIC_BASE_URL?.trim() || void 0;
|
|
435
|
-
const url = publicBaseUrl ? `${stripTrailingSlash(publicBaseUrl)}/mcp` : DEFAULT_MCP_URL;
|
|
436
|
-
return { transport, url, apiUrl, publicBaseUrl, token };
|
|
437
|
-
};
|
|
438
257
|
var resolveTargetClients = (opts) => {
|
|
439
258
|
if (opts.client) return [opts.client];
|
|
440
259
|
throw new Error("Agent is required. Pass --agent=<name>.");
|
|
441
260
|
};
|
|
442
261
|
var install = async (opts) => {
|
|
443
262
|
const home = opts.home ?? userHome();
|
|
444
|
-
const token = opts.token ?? getCliConfig().token;
|
|
445
263
|
const dryRun = opts.dryRun ?? false;
|
|
446
264
|
const clients = resolveTargetClients({
|
|
447
265
|
client: opts.client,
|
|
@@ -450,22 +268,20 @@ var install = async (opts) => {
|
|
|
450
268
|
isCliAvailable: opts.isCliAvailable
|
|
451
269
|
});
|
|
452
270
|
const pluginRef = resolvePluginRef();
|
|
453
|
-
const endpoint = resolveEndpoint({ transport: "http", env: opts.env, token });
|
|
454
271
|
return Promise.all(
|
|
455
272
|
clients.map(
|
|
456
273
|
(client) => installPlugin(client, {
|
|
457
274
|
home,
|
|
458
275
|
dryRun,
|
|
459
276
|
runnerOptions: opts.runnerOptions,
|
|
460
|
-
pluginRef
|
|
461
|
-
endpoint
|
|
277
|
+
pluginRef
|
|
462
278
|
})
|
|
463
279
|
)
|
|
464
280
|
);
|
|
465
281
|
};
|
|
466
282
|
|
|
467
283
|
// ../core/dist/install/install.types.js
|
|
468
|
-
var CLIENT_IDS = ["cursor", "claude", "vscode", "codex", "
|
|
284
|
+
var CLIENT_IDS = ["cursor", "claude", "vscode", "codex", "copilot"];
|
|
469
285
|
var isKnownClient = (value) => CLIENT_IDS.includes(value);
|
|
470
286
|
|
|
471
287
|
// src/features/install/install.utils.ts
|
|
@@ -546,6 +362,13 @@ var renderOutput = async (mode, value, formatters) => {
|
|
|
546
362
|
`);
|
|
547
363
|
};
|
|
548
364
|
|
|
365
|
+
// src/utils/toolbox.ts
|
|
366
|
+
var padRight = (value, width) => {
|
|
367
|
+
if (value.length >= width) return value;
|
|
368
|
+
return value + " ".repeat(width - value.length);
|
|
369
|
+
};
|
|
370
|
+
var capitalize = (value) => value.charAt(0).toUpperCase() + value.slice(1);
|
|
371
|
+
|
|
549
372
|
// src/utils/table.ts
|
|
550
373
|
var renderTable = (rows, columns, options = {}) => {
|
|
551
374
|
if (rows.length === 0) {
|
|
@@ -1348,6 +1171,11 @@ process.on("unhandledRejection", async (reason) => {
|
|
|
1348
1171
|
showError(formatErrorMessage(reason));
|
|
1349
1172
|
process.exit(1);
|
|
1350
1173
|
});
|
|
1174
|
+
var isRunCommand = (actionCommand) => {
|
|
1175
|
+
const commandName = actionCommand.name();
|
|
1176
|
+
const parentName = actionCommand.parent?.name();
|
|
1177
|
+
return commandName === "run" && (parentName === "tests" || parentName === "suites") || parentName === "run" && (commandName === "test" || commandName === "suite");
|
|
1178
|
+
};
|
|
1351
1179
|
var version = getVersion();
|
|
1352
1180
|
var program = new Command();
|
|
1353
1181
|
program.name("bugbug").description(`BugBug CLI ${version}`).version(version).showSuggestionAfterError().option("-t, --token <token>", "API token for BugBug (overrides config)").option(
|
|
@@ -1364,9 +1192,11 @@ program.hook("preAction", async (_thisCommand, actionCommand) => {
|
|
|
1364
1192
|
setSentryTag("Command", parent);
|
|
1365
1193
|
}
|
|
1366
1194
|
addBreadcrumb(`Run "${fullCommand}" command`, "Command");
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1195
|
+
if (isRunCommand(actionCommand)) {
|
|
1196
|
+
analytics.trackEvent("cli_command_used", {
|
|
1197
|
+
command: fullCommand
|
|
1198
|
+
});
|
|
1199
|
+
}
|
|
1370
1200
|
});
|
|
1371
1201
|
registerTestsCommand(program);
|
|
1372
1202
|
registerTestRunsCommand(program);
|
|
@@ -1391,7 +1221,7 @@ program.exitOverride();
|
|
|
1391
1221
|
process.argv,
|
|
1392
1222
|
Boolean(config.token && config.projectId)
|
|
1393
1223
|
)) {
|
|
1394
|
-
const { startNavigator } = await import("./app-
|
|
1224
|
+
const { startNavigator } = await import("./app-L5OYLEKP.js");
|
|
1395
1225
|
await startNavigator({
|
|
1396
1226
|
initialRoute: "/init",
|
|
1397
1227
|
initialRouteState: {
|
|
@@ -1403,7 +1233,7 @@ program.exitOverride();
|
|
|
1403
1233
|
return;
|
|
1404
1234
|
}
|
|
1405
1235
|
if (startupMode.type === "navigator") {
|
|
1406
|
-
const { startNavigator } = await import("./app-
|
|
1236
|
+
const { startNavigator } = await import("./app-L5OYLEKP.js");
|
|
1407
1237
|
await startNavigator({
|
|
1408
1238
|
initialRoute: startupMode.route,
|
|
1409
1239
|
token: config.token,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bugbug-io/cli",
|
|
3
|
-
"version": "13.39.
|
|
3
|
+
"version": "13.39.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"bugbug": "bin/bugbug.mjs"
|
|
@@ -38,15 +38,14 @@
|
|
|
38
38
|
},
|
|
39
39
|
"author": "BugBug.io",
|
|
40
40
|
"license": "MIT",
|
|
41
|
+
"homepage": "https://docs.bugbug.io/integrations/cli",
|
|
41
42
|
"dependencies": {
|
|
42
43
|
"@inkjs/ui": "^2.0.0",
|
|
43
|
-
"@sentry/node": "^10.62.0",
|
|
44
44
|
"commander": "^12.1.0",
|
|
45
45
|
"ink": "^6.3.0",
|
|
46
46
|
"ink-text-input": "^6.0.0",
|
|
47
47
|
"react": "19.1.1",
|
|
48
|
-
"react-router": "^7.9.4"
|
|
49
|
-
"yaml": "^2.8.4"
|
|
48
|
+
"react-router": "^7.9.4"
|
|
50
49
|
},
|
|
51
50
|
"devDependencies": {
|
|
52
51
|
"@bugbug-io/config": "*",
|
|
@@ -60,4 +59,4 @@
|
|
|
60
59
|
"engines": {
|
|
61
60
|
"node": ">=24"
|
|
62
61
|
}
|
|
63
|
-
}
|
|
62
|
+
}
|