@debugbundle/cli 1.5.4 → 1.6.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.
Files changed (2) hide show
  1. package/dist/main.cjs +31 -7
  2. package/package.json +1 -1
package/dist/main.cjs CHANGED
@@ -15312,6 +15312,8 @@ var CaptureRuleSuggestionSchema = external_exports.object({
15312
15312
  confidence: CaptureRuleSuggestionConfidenceSchema,
15313
15313
  reason: external_exports.string().min(1).max(500),
15314
15314
  requires_confirmation: external_exports.boolean(),
15315
+ created_rule_id: external_exports.string().min(1).max(120).nullable().default(null),
15316
+ created_rule_enabled: external_exports.boolean().nullable().default(null),
15315
15317
  rule: CaptureRuleCreateSchema
15316
15318
  });
15317
15319
  var CaptureRuleSuggestionsResponseSchema = external_exports.object({
@@ -16064,6 +16066,7 @@ function buildSkill() {
16064
16066
  "- Availability checks: `https://debugbundle.com/docs/availability-checks`",
16065
16067
  "- Probes: `https://debugbundle.com/docs/probes`",
16066
16068
  "- Capture policy and rules: `https://debugbundle.com/docs/capture-policy`",
16069
+ "- Managing noise: `https://debugbundle.com/docs/managing-noise`",
16067
16070
  "- Alerts: `https://debugbundle.com/docs/alerts` and `https://debugbundle.com/docs/cli/alerts`",
16068
16071
  "- Webhooks: `https://debugbundle.com/docs/webhooks` and `https://debugbundle.com/docs/cli/webhooks`",
16069
16072
  "- API ingestion: `https://debugbundle.com/docs/api/ingestion`",
@@ -16192,6 +16195,7 @@ function buildCliReference() {
16192
16195
  "- Webhooks: `https://debugbundle.com/docs/webhooks`, `https://debugbundle.com/docs/cli/webhooks`, and `https://debugbundle.com/docs/api/webhooks`",
16193
16196
  "- Probes: `https://debugbundle.com/docs/probes` and `https://debugbundle.com/docs/api/probes`",
16194
16197
  "- Capture policy and rules: `https://debugbundle.com/docs/capture-policy`",
16198
+ "- Managing noise: `https://debugbundle.com/docs/managing-noise`",
16195
16199
  "- Availability checks: `https://debugbundle.com/docs/availability-checks`",
16196
16200
  "- MCP tool catalog: `https://debugbundle.com/docs/mcp/tools`",
16197
16201
  "",
@@ -16296,6 +16300,7 @@ function buildMcpReference() {
16296
16300
  "- Availability checks: `https://debugbundle.com/docs/availability-checks`",
16297
16301
  "- Probes: `https://debugbundle.com/docs/probes`",
16298
16302
  "- Capture policy and rules: `https://debugbundle.com/docs/capture-policy`",
16303
+ "- Managing noise: `https://debugbundle.com/docs/managing-noise`",
16299
16304
  "- Alerts: `https://debugbundle.com/docs/alerts`",
16300
16305
  "- Webhooks: `https://debugbundle.com/docs/webhooks`",
16301
16306
  "- API ingestion: `https://debugbundle.com/docs/api/ingestion`",
@@ -25319,6 +25324,26 @@ function selectPrimarySignalEnvelope(envelopes, sourceEventId) {
25319
25324
  (envelope) => envelope.event_type === "backend_exception" || envelope.event_type === "frontend_exception" || envelope.event_type === "request_event"
25320
25325
  ) ?? null;
25321
25326
  }
25327
+ function deriveBundleSdk(envelopes, sourceEventId) {
25328
+ const sourceEnvelope = envelopes.find((envelope) => envelope.event_id === sourceEventId);
25329
+ if (sourceEnvelope !== void 0) {
25330
+ return {
25331
+ name: sourceEnvelope.sdk_name,
25332
+ version: sourceEnvelope.sdk_version
25333
+ };
25334
+ }
25335
+ const latestCapturedEnvelope = selectLatestEnvelope(envelopes, (envelope) => envelope.event_type !== "probe_event");
25336
+ if (latestCapturedEnvelope !== null) {
25337
+ return {
25338
+ name: latestCapturedEnvelope.sdk_name,
25339
+ version: latestCapturedEnvelope.sdk_version
25340
+ };
25341
+ }
25342
+ return {
25343
+ name: "unknown",
25344
+ version: "unknown"
25345
+ };
25346
+ }
25322
25347
  function mapSignalType(eventType) {
25323
25348
  if (eventType === "request_event") {
25324
25349
  return "request_failure";
@@ -25936,6 +25961,7 @@ function buildBundle(input2) {
25936
25961
  const firstSeenAt = new Date(input2.incident.first_seen_at).toISOString();
25937
25962
  const lastSeenAt = new Date(input2.incident.last_seen_at).toISOString();
25938
25963
  const capturedAt = primarySignalEnvelope !== null ? toIsoTimestamp(primarySignalEnvelope.occurred_at) : toIsoTimestamp(input2.bundleMetadata.source_occurred_at);
25964
+ const bundleSdk = deriveBundleSdk(sourceEnvelopes, input2.bundleMetadata.source_event_id);
25939
25965
  const serviceRuntime = input2.incident.service_runtime ?? selectLatestEnvelope(sourceEnvelopes, (envelope) => envelope.event_type !== "probe_event")?.service.runtime ?? null;
25940
25966
  const serviceFramework = input2.incident.service_framework ?? selectLatestEnvelope(sourceEnvelopes, (envelope) => envelope.event_type !== "probe_event")?.service.framework ?? null;
25941
25967
  const customerVisible = frontendContext !== null;
@@ -25954,10 +25980,7 @@ function buildBundle(input2) {
25954
25980
  bundle_id: `bnd_${input2.incident.incident_id}`,
25955
25981
  bundle_type: "failure",
25956
25982
  captured_at: capturedAt,
25957
- sdk: {
25958
- name: "debugbundle-worker",
25959
- version: "0.1.0"
25960
- },
25983
+ sdk: bundleSdk,
25961
25984
  project: {
25962
25985
  id: input2.incident.project_id,
25963
25986
  slug: input2.incident.project_id,
@@ -34688,7 +34711,7 @@ function createCaptureRuleApi(httpClient) {
34688
34711
  bearerToken: input2.bearerToken,
34689
34712
  body: input2.create
34690
34713
  });
34691
- if (response.status !== 201) {
34714
+ if (response.status !== 200 && response.status !== 201) {
34692
34715
  throw toApiError5(response.status, response.body, "Failed to create capture rule from suggestion.");
34693
34716
  }
34694
34717
  const parsed = CaptureRuleResponseSchema.safeParse(response.body);
@@ -34825,6 +34848,7 @@ function formatSuggestionResponse(response) {
34825
34848
  suggestion.reason,
34826
34849
  `matcher: ${formatMatcherFromValue(suggestion.rule.matcher)}`,
34827
34850
  `requires_confirmation: ${String(suggestion.requires_confirmation)}`,
34851
+ suggestion.created_rule_id == null ? "existing_rule: none" : `existing_rule: ${suggestion.created_rule_id} (${suggestion.created_rule_enabled === false ? "disabled" : "enabled"})`,
34828
34852
  `apply: debugbundle capture-rule create-from-suggestion <incident-id> --suggestion-id ${suggestion.suggestion_id}`
34829
34853
  ].join("\n")
34830
34854
  ).join("\n\n");
@@ -34917,7 +34941,7 @@ async function createCaptureRuleFromIncidentSuggestionCommand(input2, api) {
34917
34941
  });
34918
34942
  return {
34919
34943
  exitCode: 0,
34920
- output: input2.json ? JSON.stringify(response) : `Capture rule created.
34944
+ output: input2.json ? JSON.stringify(response) : `Capture rule applied.
34921
34945
  ${formatRule(response.rule)}`
34922
34946
  };
34923
34947
  } catch (error) {
@@ -37142,7 +37166,7 @@ async function handleCaptureRuleCommand2(parsedArgv, dependencies) {
37142
37166
  // package.json
37143
37167
  var package_default = {
37144
37168
  name: "@debugbundle/cli",
37145
- version: "1.5.4",
37169
+ version: "1.6.2",
37146
37170
  private: false,
37147
37171
  description: "Command-line interface for DebugBundle",
37148
37172
  license: "AGPL-3.0-only",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@debugbundle/cli",
3
- "version": "1.5.4",
3
+ "version": "1.6.2",
4
4
  "private": false,
5
5
  "description": "Command-line interface for DebugBundle",
6
6
  "license": "AGPL-3.0-only",