@bugbug-io/cli 14.4.2 → 14.5.0

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.
@@ -62,7 +62,7 @@ import {
62
62
  waitForSuiteRun,
63
63
  waitForTestRun,
64
64
  writeReportXml
65
- } from "./chunk-4RFEZBW7.js";
65
+ } from "./chunk-2ZIWRWZK.js";
66
66
  import "./chunk-XLIBEETK.js";
67
67
  import "./chunk-3PJ4ZE2N.js";
68
68
  import {
@@ -11130,5 +11130,5 @@ react-router/dist/development/index.mjs:
11130
11130
  * @license MIT
11131
11131
  *)
11132
11132
  */
11133
- //# sourceMappingURL=NavigatorApp-6G45ERVL.js.map
11133
+ //# sourceMappingURL=NavigatorApp-76WOOBZX.js.map
11134
11134
  //# debugId=9e90a61c-d567-5034-bd9e-55c33ff018a1
@@ -12,7 +12,7 @@ var startNavigator = async (opts = {}) => {
12
12
  const [{ render }, React, { NavigatorApp }] = await Promise.all([
13
13
  import("./render-CSMURV5U.js"),
14
14
  importReact(),
15
- import("./NavigatorApp-6G45ERVL.js")
15
+ import("./NavigatorApp-76WOOBZX.js")
16
16
  ]);
17
17
  const element = React.createElement(
18
18
  NavigatorApp,
@@ -27,5 +27,5 @@ var startNavigator = async (opts = {}) => {
27
27
  export {
28
28
  startNavigator
29
29
  };
30
- //# sourceMappingURL=app-MH7KCWNW.js.map
30
+ //# sourceMappingURL=app-SJH7MMH6.js.map
31
31
  //# debugId=cecc8c80-302a-54e0-a1fb-74d6bb70c0a1
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ab25891e-91a8-5df9-bc74-dc36230e31d2")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="11f5fc11-595f-51d4-8e05-bca1f6eb53a0")}catch(e){}}();
3
3
  import { createRequire as __nodeCreateRequire } from 'node:module';
4
4
  const require = __nodeCreateRequire(import.meta.url);
5
5
  import {
@@ -8930,7 +8930,7 @@ var require_main = __commonJS({
8930
8930
  // ../core/package.json
8931
8931
  var package_default = {
8932
8932
  name: "@bugbug-io/core",
8933
- version: "14.4.2",
8933
+ version: "14.5.0",
8934
8934
  private: true,
8935
8935
  type: "module",
8936
8936
  main: "dist/index.js",
@@ -47999,12 +47999,15 @@ var initSentry = ({ telemetryEnabled, env }) => {
47999
47999
  logger2.info(`Sentry initialized for ${environment} environment`);
48000
48000
  }
48001
48001
  };
48002
- var captureException2 = (error3, context2) => {
48003
- if (context2) {
48002
+ var captureException2 = (error3, context2, fingerprint) => {
48003
+ if (context2 || fingerprint) {
48004
48004
  withScope2((scope) => {
48005
- Object.entries(context2).forEach(([key, value]) => {
48005
+ Object.entries(context2 ?? {}).forEach(([key, value]) => {
48006
48006
  scope.setTag(key, String(value));
48007
48007
  });
48008
+ if (fingerprint) {
48009
+ scope.setFingerprint(fingerprint);
48010
+ }
48008
48011
  captureException(error3);
48009
48012
  });
48010
48013
  } else {
@@ -48399,6 +48402,44 @@ var analytics = {
48399
48402
  }
48400
48403
  };
48401
48404
 
48405
+ // src/utils/exit.ts
48406
+ var EXIT_OK = 0;
48407
+ var EXIT_GENERAL_ERROR = 1;
48408
+ var EXIT_FAILED = 2;
48409
+ var EXIT_STOPPED = 3;
48410
+ var EXIT_AUTH_ERROR = 1;
48411
+ var EXIT_USAGE_ERROR = 64;
48412
+ var exitCodeForStatus = (status) => {
48413
+ switch (status) {
48414
+ case "passed":
48415
+ return EXIT_OK;
48416
+ case "failed":
48417
+ return EXIT_FAILED;
48418
+ case "stopped":
48419
+ return EXIT_STOPPED;
48420
+ default:
48421
+ return EXIT_GENERAL_ERROR;
48422
+ }
48423
+ };
48424
+ var emitError = (mode, envelope) => {
48425
+ if (mode === "json") {
48426
+ process.stderr.write(`${JSON.stringify(envelope, null, 2)}
48427
+ `);
48428
+ return;
48429
+ }
48430
+ process.stderr.write(`Error: ${envelope.error}
48431
+ `);
48432
+ };
48433
+ var exitWith = (code) => {
48434
+ try {
48435
+ process.exit(code);
48436
+ } catch (err) {
48437
+ process.exitCode = code;
48438
+ throw err;
48439
+ }
48440
+ return void 0;
48441
+ };
48442
+
48402
48443
  // ../sdk/dist/index.js
48403
48444
  import { createRequire as createRequire2 } from "module";
48404
48445
  import { existsSync as existsSync32, readFileSync as readFileSync32 } from "fs";
@@ -58221,7 +58262,7 @@ var readEnvFiles2 = (cwd) => {
58221
58262
  var buildUserAgent2 = (clientType, version) => `BugBug ${clientType.toUpperCase()} ${version}`;
58222
58263
  var package_default2 = {
58223
58264
  name: "@bugbug-io/core",
58224
- version: "14.4.2",
58265
+ version: "14.5.0",
58225
58266
  private: true,
58226
58267
  type: "module",
58227
58268
  main: "dist/index.js",
@@ -58921,6 +58962,8 @@ var BugBugApiClient = class {
58921
58962
  */
58922
58963
  #handleOpenApiError = async (error3, response, request2) => {
58923
58964
  const status = response?.status;
58965
+ const requestId = response?.headers.get("X-Request-Id")?.trim();
58966
+ const requestWithResponseContext = requestId ? { ...request2, requestId } : request2;
58924
58967
  const errorMessage = formatApiErrorMessage(error3);
58925
58968
  const errorBody = parseErrorBody(error3);
58926
58969
  const fields = extractFieldErrors(errorBody);
@@ -58930,33 +58973,37 @@ var BugBugApiClient = class {
58930
58973
  throw new AuthenticationError(
58931
58974
  errorMessage || "Invalid API token or authentication failed",
58932
58975
  response,
58933
- request2
58976
+ requestWithResponseContext
58934
58977
  );
58935
58978
  case 402:
58936
58979
  throw new SubscriptionError(
58937
58980
  errorMessage || "This operation is not available on your current plan. Upgrade your plan to continue.",
58938
58981
  response,
58939
- request2,
58982
+ requestWithResponseContext,
58940
58983
  subscriptionUpgradeUrl
58941
58984
  );
58942
58985
  case 403:
58943
58986
  throw new AuthorizationError(
58944
58987
  errorMessage || "Access denied. Check your permissions.",
58945
58988
  response,
58946
- request2
58989
+ requestWithResponseContext
58947
58990
  );
58948
58991
  case 404:
58949
- throw new NotFoundError(errorMessage || "Resource not found", response, request2);
58992
+ throw new NotFoundError(
58993
+ errorMessage || "Resource not found",
58994
+ response,
58995
+ requestWithResponseContext
58996
+ );
58950
58997
  case 400:
58951
58998
  case 422:
58952
58999
  if (status === 400 && this.#isMissingProjectId(errorMessage, fields)) {
58953
- throw new MissingProjectIdError(void 0, response, request2);
59000
+ throw new MissingProjectIdError(void 0, response, requestWithResponseContext);
58954
59001
  }
58955
59002
  throw new ValidationError(
58956
59003
  errorMessage || "Validation failed. Check your request data.",
58957
59004
  response,
58958
59005
  fields,
58959
- request2
59006
+ requestWithResponseContext
58960
59007
  );
58961
59008
  case 429: {
58962
59009
  const retryAfter = response?.headers.get("Retry-After");
@@ -58965,14 +59012,14 @@ var BugBugApiClient = class {
58965
59012
  retryAfterMs,
58966
59013
  errorMessage || "Rate limit exceeded",
58967
59014
  response,
58968
- request2
59015
+ requestWithResponseContext
58969
59016
  );
58970
59017
  }
58971
59018
  case 500:
58972
59019
  throw new InternalServerError(
58973
59020
  errorMessage || "Internal server error. Please try again later.",
58974
59021
  response,
58975
- request2
59022
+ requestWithResponseContext
58976
59023
  );
58977
59024
  case 502:
58978
59025
  case 503:
@@ -58980,21 +59027,21 @@ var BugBugApiClient = class {
58980
59027
  throw new ServiceUnavailableError(
58981
59028
  errorMessage || "Service temporarily unavailable. Please try again later.",
58982
59029
  response,
58983
- request2
59030
+ requestWithResponseContext
58984
59031
  );
58985
59032
  default:
58986
59033
  if (status === void 0) {
58987
59034
  throw new NetworkError(
58988
59035
  errorMessage || "No response received from BugBug API",
58989
59036
  void 0,
58990
- request2
59037
+ requestWithResponseContext
58991
59038
  );
58992
59039
  }
58993
59040
  throw new HttpError(
58994
59041
  errorMessage || `HTTP ${status}: ${response?.statusText || "Unknown error"}`,
58995
59042
  status,
58996
59043
  response,
58997
- request2
59044
+ requestWithResponseContext
58998
59045
  );
58999
59046
  }
59000
59047
  };
@@ -63734,7 +63781,7 @@ var STEP_ERROR_CODES = [
63734
63781
  ];
63735
63782
  var WaitingConditionSchema = external_exports.object({
63736
63783
  type: WaitingConditionTypeSchema,
63737
- expected: external_exports.string().nullable().describe("Expected value for the waiting condition, if any.")
63784
+ expected: external_exports.string().nullable().optional().default(null).describe("Expected value for the waiting condition, if any.")
63738
63785
  }).passthrough();
63739
63786
  var StepErrorCodeSchema = external_exports.enum(STEP_ERROR_CODES);
63740
63787
  var StepSourceSchema = external_exports.enum(["api", "agent"]).describe("Creation source for public API step writes.");
@@ -64155,11 +64202,11 @@ Upgrade your plan: ${error3.upgradeUrl}` : headline;
64155
64202
  }
64156
64203
  return lines.join("\n");
64157
64204
  };
64158
- var showError = (message, exitCode = 1) => {
64205
+ var showError = (message, exitCode = EXIT_GENERAL_ERROR) => {
64159
64206
  if (!isInteractive()) {
64160
64207
  process.stderr.write(`Error: ${message}
64161
64208
  `);
64162
- process.exit(exitCode);
64209
+ exitWith(exitCode);
64163
64210
  }
64164
64211
  void renderInteractiveError(message, exitCode);
64165
64212
  };
@@ -64176,42 +64223,10 @@ var renderInteractiveError = async (message, exitCode) => {
64176
64223
  );
64177
64224
  setTimeout(() => {
64178
64225
  unmount();
64179
- process.exit(exitCode);
64226
+ exitWith(exitCode);
64180
64227
  }, 100);
64181
64228
  };
64182
64229
 
64183
- // src/utils/exit.ts
64184
- var EXIT_OK = 0;
64185
- var EXIT_GENERAL_ERROR = 1;
64186
- var EXIT_FAILED = 2;
64187
- var EXIT_STOPPED = 3;
64188
- var EXIT_AUTH_ERROR = 1;
64189
- var EXIT_USAGE_ERROR = 64;
64190
- var exitCodeForStatus = (status) => {
64191
- switch (status) {
64192
- case "passed":
64193
- return EXIT_OK;
64194
- case "failed":
64195
- return EXIT_FAILED;
64196
- case "stopped":
64197
- return EXIT_STOPPED;
64198
- default:
64199
- return EXIT_GENERAL_ERROR;
64200
- }
64201
- };
64202
- var emitError = (mode, envelope) => {
64203
- if (mode === "json") {
64204
- process.stderr.write(`${JSON.stringify(envelope, null, 2)}
64205
- `);
64206
- return;
64207
- }
64208
- process.stderr.write(`Error: ${envelope.error}
64209
- `);
64210
- };
64211
- var exitWith = (code) => {
64212
- process.exit(code);
64213
- };
64214
-
64215
64230
  // src/utils/sdk.ts
64216
64231
  var cached2;
64217
64232
  var createCliSdk = (overrides = {}) => {
@@ -64901,5 +64916,5 @@ export {
64901
64916
  formatErrorMessage,
64902
64917
  showError
64903
64918
  };
64904
- //# sourceMappingURL=chunk-4RFEZBW7.js.map
64905
- //# debugId=ab25891e-91a8-5df9-bc74-dc36230e31d2
64919
+ //# sourceMappingURL=chunk-2ZIWRWZK.js.map
64920
+ //# debugId=11f5fc11-595f-51d4-8e05-bca1f6eb53a0
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="544ba384-9e50-5f6e-8092-ee763d03e7a5")}catch(e){}}();
3
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3568797f-f45b-54bd-bfb8-2f70f433660f")}catch(e){}}();
4
4
  import { createRequire as __nodeCreateRequire } from 'node:module';
5
5
  const require = __nodeCreateRequire(import.meta.url);
6
6
  import {
@@ -55,7 +55,7 @@ import {
55
55
  waitForSuiteRun,
56
56
  waitForTestRun,
57
57
  writeReportXml
58
- } from "./chunk-4RFEZBW7.js";
58
+ } from "./chunk-2ZIWRWZK.js";
59
59
  import "./chunk-XLIBEETK.js";
60
60
  import "./chunk-3PJ4ZE2N.js";
61
61
  import {
@@ -4177,18 +4177,17 @@ var getStartupMode = (argv) => {
4177
4177
  };
4178
4178
 
4179
4179
  // src/index.ts
4180
- process.on("uncaughtException", async (err) => {
4181
- captureException(err);
4180
+ var isExitingAfterFatalError = false;
4181
+ var handleFatalError = async (error) => {
4182
+ if (isExitingAfterFatalError) return;
4183
+ isExitingAfterFatalError = true;
4184
+ captureException(error);
4182
4185
  await closeSentry();
4183
- showError(formatErrorMessage(err));
4184
- process.exit(1);
4185
- });
4186
- process.on("unhandledRejection", async (reason) => {
4187
- captureException(reason);
4188
- await closeSentry();
4189
- showError(formatErrorMessage(reason));
4190
- process.exit(1);
4191
- });
4186
+ showError(formatErrorMessage(error));
4187
+ exitWith(EXIT_GENERAL_ERROR);
4188
+ };
4189
+ process.on("uncaughtException", handleFatalError);
4190
+ process.on("unhandledRejection", handleFatalError);
4192
4191
  var isRunCommand = (actionCommand) => {
4193
4192
  const commandName = actionCommand.name();
4194
4193
  const parentName = actionCommand.parent?.name();
@@ -4236,7 +4235,7 @@ program2.exitOverride();
4236
4235
  });
4237
4236
  analytics.trackEvent("cli_session_started");
4238
4237
  if (startupMode.type === "commandline" && await shouldRedirectUnauthenticatedCommandToInit(process.argv, hasUsableSession)) {
4239
- const { startNavigator } = await import("./app-MH7KCWNW.js");
4238
+ const { startNavigator } = await import("./app-SJH7MMH6.js");
4240
4239
  await startNavigator({
4241
4240
  initialRoute: "/init",
4242
4241
  initialRouteState: {
@@ -4248,7 +4247,7 @@ program2.exitOverride();
4248
4247
  return;
4249
4248
  }
4250
4249
  if (startupMode.type === "navigator") {
4251
- const { startNavigator } = await import("./app-MH7KCWNW.js");
4250
+ const { startNavigator } = await import("./app-SJH7MMH6.js");
4252
4251
  await startNavigator({
4253
4252
  initialRoute: startupMode.route,
4254
4253
  token: config.token,
@@ -4276,13 +4275,13 @@ program2.exitOverride();
4276
4275
  } catch (err) {
4277
4276
  analytics.trackEvent("cli_session_ended", { success: false });
4278
4277
  if (err instanceof CommanderError) {
4279
- process.exit(err.exitCode);
4278
+ exitWith(err.exitCode);
4280
4279
  }
4281
4280
  captureException(err);
4282
4281
  await closeSentry();
4283
4282
  showError(formatErrorMessage(err));
4284
- process.exit(1);
4283
+ exitWith(EXIT_GENERAL_ERROR);
4285
4284
  }
4286
4285
  })();
4287
4286
  //# sourceMappingURL=index.js.map
4288
- //# debugId=544ba384-9e50-5f6e-8092-ee763d03e7a5
4287
+ //# debugId=3568797f-f45b-54bd-bfb8-2f70f433660f
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bugbug-io/cli",
3
- "version": "14.4.2",
3
+ "version": "14.5.0",
4
4
  "description": "BugBug CLI for test automation, CI workflows, and AI-agent plugin installation",
5
5
  "type": "module",
6
6
  "bin": {
@@ -57,6 +57,7 @@
57
57
  "tsx": "^4.19.3"
58
58
  },
59
59
  "engines": {
60
- "node": ">=24"
60
+ "node": ">=24",
61
+ "npm": ">=11"
61
62
  }
62
63
  }