@bugbug-io/cli 14.0.0 → 14.0.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.
@@ -47,7 +47,7 @@ import {
47
47
  waitForSuiteRun,
48
48
  waitForTestRun,
49
49
  writeReportXml
50
- } from "./chunk-4IJVD32G.js";
50
+ } from "./chunk-5M4R5OWY.js";
51
51
  import "./chunk-BSHFIPEX.js";
52
52
  import "./chunk-PR4QN5HX.js";
53
53
 
@@ -3298,4 +3298,4 @@ var NavigatorApp = ({ initialRoute, initialRouteState }) => {
3298
3298
  export {
3299
3299
  NavigatorApp
3300
3300
  };
3301
- //# sourceMappingURL=NavigatorApp-3SRWEK5J.js.map
3301
+ //# sourceMappingURL=NavigatorApp-OPLOBDB6.js.map
@@ -5,7 +5,7 @@ var startNavigator = async (opts = {}) => {
5
5
  const [{ render }, React, { NavigatorApp }] = await Promise.all([
6
6
  import("./render-U36YSDSA.js"),
7
7
  import("react"),
8
- import("./NavigatorApp-3SRWEK5J.js")
8
+ import("./NavigatorApp-OPLOBDB6.js")
9
9
  ]);
10
10
  const element = React.createElement(
11
11
  NavigatorApp,
@@ -20,4 +20,4 @@ var startNavigator = async (opts = {}) => {
20
20
  export {
21
21
  startNavigator
22
22
  };
23
- //# sourceMappingURL=app-UMUDDKR3.js.map
23
+ //# sourceMappingURL=app-EHNWKK6F.js.map
@@ -8923,7 +8923,7 @@ var require_main = __commonJS({
8923
8923
  // ../core/package.json
8924
8924
  var package_default = {
8925
8925
  name: "@bugbug-io/core",
8926
- version: "14.0.0",
8926
+ version: "14.0.2",
8927
8927
  private: true,
8928
8928
  type: "module",
8929
8929
  main: "dist/index.js",
@@ -56419,32 +56419,48 @@ var require_dist2 = __commonJS2({
56419
56419
  exports.visitAsync = visit2.visitAsync;
56420
56420
  }
56421
56421
  });
56422
+ var DEFAULT_CONFIG_FILE_NAME2 = "bugbug.yaml";
56423
+ var DEFAULT_API_URL2 = "https://app.bugbug.io/api/v2";
56424
+ var DEFAULT_YAML_SCHEMA_URL2 = `${DEFAULT_API_URL2}/schema/yaml/v1/`;
56425
+ var DEFAULT_MCP_URL2 = "https://mcp.bugbug.io";
56426
+ var DEFAULT_MCP_ACCESS_PATH2 = "/mcp";
56427
+ var DEFAULT_MCP_ACCESS_URL2 = `${DEFAULT_MCP_URL2}${DEFAULT_MCP_ACCESS_PATH2}`;
56428
+ var DOCS_BASE_URL2 = "https://docs.bugbug.io";
56429
+ var DOCS_ASK_URL2 = `${DOCS_BASE_URL2}/master.md`;
56430
+ var CREDENTIALS_DIR_NAME2 = ".bugbug";
56431
+ var GLOBAL_CONFIG_FILE_NAME2 = "config.yaml";
56432
+ var DEFAULT_ROOT_CONFIG_FILE_NAME2 = `~/${CREDENTIALS_DIR_NAME2}/${GLOBAL_CONFIG_FILE_NAME2}`;
56433
+ var DEFAULT_ROOT_CONFIG_TEMP2 = `~/${CREDENTIALS_DIR_NAME2}/tmp`;
56422
56434
  var AuthModule = class {
56423
56435
  #client;
56424
56436
  constructor(client) {
56425
56437
  this.#client = client;
56426
56438
  }
56439
+ #oauthPath = (path3) => !process.env.BUGBUG_APP_URL && this.#client.getConfig().apiUrl === DEFAULT_API_URL2 ? `/rest${path3}` : path3;
56427
56440
  getAuth = async (params, options = {}) => {
56428
- const response = await this.#client.getAppRoot("/auth/authorize-url", {
56429
- ...options,
56430
- authenticated: false,
56431
- acceptRedirect: true,
56432
- redirect: "manual",
56433
- queryParams: {
56434
- client_id: params.clientId,
56435
- redirect_uri: params.redirectUri,
56436
- code_challenge: params.codeChallenge,
56437
- code_challenge_method: params.codeChallengeMethod,
56438
- state: params.state
56441
+ const response = await this.#client.getAppRoot(
56442
+ this.#oauthPath("/auth/authorize-url"),
56443
+ {
56444
+ ...options,
56445
+ authenticated: false,
56446
+ acceptRedirect: true,
56447
+ redirect: "manual",
56448
+ queryParams: {
56449
+ client_id: params.clientId,
56450
+ redirect_uri: params.redirectUri,
56451
+ code_challenge: params.codeChallenge,
56452
+ code_challenge_method: params.codeChallengeMethod,
56453
+ state: params.state
56454
+ }
56439
56455
  }
56440
- });
56456
+ );
56441
56457
  const authorizeUrl = response instanceof Response ? response.headers.get("location") : void 0;
56442
56458
  if (!authorizeUrl) {
56443
56459
  throw new Error("BugBug OAuth authorize response did not include a redirect URL.");
56444
56460
  }
56445
56461
  return { authorizeUrl: new URL(authorizeUrl, response.url).toString() };
56446
56462
  };
56447
- exchangeCode = async (payload, options = {}) => this.#client.postAppRoot("/auth/oauth/token/", {
56463
+ exchangeCode = async (payload, options = {}) => this.#client.postAppRoot(this.#oauthPath("/auth/oauth/token/"), {
56448
56464
  ...options,
56449
56465
  authenticated: false,
56450
56466
  body: {
@@ -56455,7 +56471,7 @@ var AuthModule = class {
56455
56471
  code_verifier: payload.codeVerifier
56456
56472
  }
56457
56473
  });
56458
- identity = async (options = {}) => this.#client.getAppRoot("/auth/identity", options);
56474
+ identity = async (options = {}) => this.#client.getAppRoot(this.#oauthPath("/auth/identity"), options);
56459
56475
  };
56460
56476
  var ComponentsModule = class {
56461
56477
  #client;
@@ -58033,18 +58049,6 @@ var VisualRegressionModule = class {
58033
58049
  };
58034
58050
  };
58035
58051
  var import_dotenv2 = __toESM2(require_main2(), 1);
58036
- var DEFAULT_CONFIG_FILE_NAME2 = "bugbug.yaml";
58037
- var DEFAULT_API_URL2 = "https://app.bugbug.io/api/v2";
58038
- var DEFAULT_YAML_SCHEMA_URL2 = `${DEFAULT_API_URL2}/schema/yaml/v1/`;
58039
- var DEFAULT_MCP_URL2 = "https://mcp.bugbug.io";
58040
- var DEFAULT_MCP_ACCESS_PATH2 = "/mcp";
58041
- var DEFAULT_MCP_ACCESS_URL2 = `${DEFAULT_MCP_URL2}${DEFAULT_MCP_ACCESS_PATH2}`;
58042
- var DOCS_BASE_URL2 = "https://docs.bugbug.io";
58043
- var DOCS_ASK_URL2 = `${DOCS_BASE_URL2}/master.md`;
58044
- var CREDENTIALS_DIR_NAME2 = ".bugbug";
58045
- var GLOBAL_CONFIG_FILE_NAME2 = "config.yaml";
58046
- var DEFAULT_ROOT_CONFIG_FILE_NAME2 = `~/${CREDENTIALS_DIR_NAME2}/${GLOBAL_CONFIG_FILE_NAME2}`;
58047
- var DEFAULT_ROOT_CONFIG_TEMP2 = `~/${CREDENTIALS_DIR_NAME2}/tmp`;
58048
58052
  var import_yaml4 = __toESM2(require_dist2(), 1);
58049
58053
  var globalConfigFilePath2 = (home = homedir2()) => resolve5(home, CREDENTIALS_DIR_NAME2, GLOBAL_CONFIG_FILE_NAME2);
58050
58054
  var readGlobalConfig2 = (home = homedir2()) => {
@@ -58189,7 +58193,7 @@ var readEnvFiles2 = (cwd) => {
58189
58193
  var buildUserAgent2 = (clientType, version) => `BugBug ${clientType.toUpperCase()} ${version}`;
58190
58194
  var package_default2 = {
58191
58195
  name: "@bugbug-io/core",
58192
- version: "14.0.0",
58196
+ version: "14.0.2",
58193
58197
  private: true,
58194
58198
  type: "module",
58195
58199
  main: "dist/index.js",
@@ -64824,4 +64828,4 @@ export {
64824
64828
  formatErrorMessage,
64825
64829
  showError
64826
64830
  };
64827
- //# sourceMappingURL=chunk-4IJVD32G.js.map
64831
+ //# sourceMappingURL=chunk-5M4R5OWY.js.map
package/dist/index.js CHANGED
@@ -51,7 +51,7 @@ import {
51
51
  waitForSuiteRun,
52
52
  waitForTestRun,
53
53
  writeReportXml
54
- } from "./chunk-4IJVD32G.js";
54
+ } from "./chunk-5M4R5OWY.js";
55
55
  import "./chunk-BSHFIPEX.js";
56
56
  import "./chunk-PR4QN5HX.js";
57
57
 
@@ -1208,7 +1208,7 @@ program.exitOverride();
1208
1208
  });
1209
1209
  analytics.trackEvent("cli_session_started");
1210
1210
  if (startupMode.type === "commandline" && await shouldRedirectUnauthenticatedCommandToInit(process.argv, hasUsableSession)) {
1211
- const { startNavigator } = await import("./app-UMUDDKR3.js");
1211
+ const { startNavigator } = await import("./app-EHNWKK6F.js");
1212
1212
  await startNavigator({
1213
1213
  initialRoute: "/init",
1214
1214
  initialRouteState: {
@@ -1220,7 +1220,7 @@ program.exitOverride();
1220
1220
  return;
1221
1221
  }
1222
1222
  if (startupMode.type === "navigator") {
1223
- const { startNavigator } = await import("./app-UMUDDKR3.js");
1223
+ const { startNavigator } = await import("./app-EHNWKK6F.js");
1224
1224
  await startNavigator({
1225
1225
  initialRoute: startupMode.route,
1226
1226
  token: config.token,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bugbug-io/cli",
3
- "version": "14.0.0",
3
+ "version": "14.0.2",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "bugbug": "bin/bugbug.mjs"