@debugbundle/mcp 0.1.5 → 0.1.7

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 (3) hide show
  1. package/README.md +1 -1
  2. package/dist/main.cjs +807 -136
  3. package/package.json +1 -1
package/dist/main.cjs CHANGED
@@ -14470,6 +14470,7 @@ var AlertConditionTypeSchema = external_exports.enum([
14470
14470
  var AlertSchema = external_exports.object({
14471
14471
  alert_id: external_exports.string(),
14472
14472
  project_id: external_exports.string(),
14473
+ created_by_user_id: external_exports.string(),
14473
14474
  service_id: external_exports.string().nullable(),
14474
14475
  channel: AlertChannelSchema,
14475
14476
  condition_type: AlertConditionTypeSchema,
@@ -14595,7 +14596,7 @@ function createAlertApi(client) {
14595
14596
  return expectAlert(
14596
14597
  client.request({
14597
14598
  method: "PATCH",
14598
- path: `/v1/alerts/${input.alertId}`,
14599
+ path: `/v1/alerts/${input.alertId}${buildQuery({ project_id: input.projectId })}`,
14599
14600
  bearerToken: input.bearerToken,
14600
14601
  body
14601
14602
  })
@@ -14604,7 +14605,7 @@ function createAlertApi(client) {
14604
14605
  async deleteAlert(input) {
14605
14606
  const response = await client.request({
14606
14607
  method: "DELETE",
14607
- path: `/v1/alerts/${input.alertId}`,
14608
+ path: `/v1/alerts/${input.alertId}${buildQuery({ project_id: input.projectId })}`,
14608
14609
  bearerToken: input.bearerToken
14609
14610
  });
14610
14611
  if (response.status < 200 || response.status >= 300) {
@@ -14643,9 +14644,9 @@ var BillingSummarySchema = external_exports.object({
14643
14644
  monthly_raw_ingested_events: BillingUsageMetricSchema,
14644
14645
  retained_bundle_cap: BillingUsageMetricSchema,
14645
14646
  monthly_remote_activations: BillingUsageMetricSchema,
14646
- monthly_alert_deliveries: BillingUsageMetricSchema
14647
- }).strict(),
14648
- email_verification_required: external_exports.boolean().optional()
14647
+ monthly_alert_deliveries: BillingUsageMetricSchema,
14648
+ monthly_webhook_deliveries: BillingUsageMetricSchema
14649
+ }).strict()
14649
14650
  }).strict();
14650
14651
  var BillingSummaryResponseSchema = external_exports.object({
14651
14652
  billing: BillingSummarySchema
@@ -14758,6 +14759,7 @@ var ProjectGitHubRepoSchema = external_exports.object({
14758
14759
  var GitHubDispatchRuleSchema = external_exports.object({
14759
14760
  rule_id: external_exports.string(),
14760
14761
  project_id: external_exports.string(),
14762
+ created_by_user_id: external_exports.string(),
14761
14763
  name: external_exports.string(),
14762
14764
  enabled: external_exports.boolean(),
14763
14765
  event_types: external_exports.array(external_exports.string().min(1)),
@@ -14776,7 +14778,7 @@ var GitHubDispatchDeliverySchema = external_exports.object({
14776
14778
  rule_name: external_exports.string(),
14777
14779
  incident_id: external_exports.string(),
14778
14780
  incident_title: external_exports.string(),
14779
- status: external_exports.enum(["pending", "retrying", "delivered", "failed"]),
14781
+ status: external_exports.enum(["pending", "retrying", "delivered", "failed", "skipped"]),
14780
14782
  attempt_count: external_exports.number().int(),
14781
14783
  last_attempt_at: external_exports.string().nullable(),
14782
14784
  last_error: external_exports.string().nullable(),
@@ -14913,19 +14915,21 @@ async function expectNoContent(responsePromise) {
14913
14915
  function createGitHubManagementApi(client) {
14914
14916
  return {
14915
14917
  async getInstallation(input) {
14918
+ const query = input.projectId === void 0 ? "" : `?project_id=${encodeURIComponent(input.projectId)}`;
14916
14919
  return expectInstallation(
14917
14920
  client.request({
14918
14921
  method: "GET",
14919
- path: "/v1/github/installation",
14922
+ path: `/v1/github/installation${query}`,
14920
14923
  bearerToken: input.bearerToken
14921
14924
  })
14922
14925
  );
14923
14926
  },
14924
14927
  async listRepositories(input) {
14928
+ const query = input.projectId === void 0 ? "" : `?project_id=${encodeURIComponent(input.projectId)}`;
14925
14929
  return expectRepositories(
14926
14930
  client.request({
14927
14931
  method: "GET",
14928
- path: "/v1/github/repositories",
14932
+ path: `/v1/github/repositories${query}`,
14929
14933
  bearerToken: input.bearerToken
14930
14934
  })
14931
14935
  );
@@ -15059,6 +15063,11 @@ var ProjectMetricsSchema = external_exports.object({
15059
15063
  var ProjectRecordSchema = external_exports.object({
15060
15064
  project_id: external_exports.string(),
15061
15065
  organization_id: external_exports.string(),
15066
+ owner_user_id: external_exports.string(),
15067
+ owner_email: external_exports.string().email(),
15068
+ relationship: external_exports.enum(["owned", "shared"]),
15069
+ sharing_state: external_exports.enum(["private", "shared_by_you", "shared_with_you"]),
15070
+ effective_role: external_exports.enum(["owner", "admin", "member"]),
15062
15071
  name: external_exports.string(),
15063
15072
  slug: external_exports.string(),
15064
15073
  environment_default: external_exports.string(),
@@ -15076,6 +15085,11 @@ var ProjectCreateResponseSchema = external_exports.object({
15076
15085
  var DeletedProjectRecordSchema = external_exports.object({
15077
15086
  project_id: external_exports.string(),
15078
15087
  organization_id: external_exports.string(),
15088
+ owner_user_id: external_exports.string(),
15089
+ owner_email: external_exports.string().email(),
15090
+ relationship: external_exports.enum(["owned", "shared"]),
15091
+ sharing_state: external_exports.enum(["private", "shared_by_you", "shared_with_you"]),
15092
+ effective_role: external_exports.enum(["owner", "admin", "member"]),
15079
15093
  name: external_exports.string(),
15080
15094
  slug: external_exports.string(),
15081
15095
  environment_default: external_exports.string(),
@@ -15226,6 +15240,34 @@ var IncidentSchema = external_exports.object({
15226
15240
  matched_fields: external_exports.array(external_exports.string()),
15227
15241
  incident_reason: IncidentReasonSchema.optional()
15228
15242
  }).strict();
15243
+ var ImprovementSchema = external_exports.object({
15244
+ improvement_id: external_exports.string(),
15245
+ project_id: external_exports.string(),
15246
+ project_name: external_exports.string(),
15247
+ project_slug: external_exports.string(),
15248
+ service_id: external_exports.string().nullable(),
15249
+ service_name: external_exports.string(),
15250
+ service_runtime: external_exports.string().nullable(),
15251
+ service_framework: external_exports.string().nullable(),
15252
+ environment: external_exports.string(),
15253
+ kind: external_exports.enum(["warning_hotspot", "slow_request", "request_failure_pattern", "recurring_incident", "post_deploy_regression"]),
15254
+ status: external_exports.enum(["open", "resolved", "snoozed"]),
15255
+ severity: external_exports.enum(["low", "medium", "high", "critical"]),
15256
+ confidence: external_exports.number(),
15257
+ fingerprint: external_exports.string(),
15258
+ title: external_exports.string(),
15259
+ summary: external_exports.string(),
15260
+ occurrence_count: external_exports.number().int(),
15261
+ evidence: external_exports.record(external_exports.unknown()),
15262
+ first_detected_at: external_exports.string(),
15263
+ last_detected_at: external_exports.string(),
15264
+ resolved_at: external_exports.string().nullable(),
15265
+ snoozed_until: external_exports.string().nullable(),
15266
+ bundle_generation_number: external_exports.number().int(),
15267
+ bundle_created_at: external_exports.string().nullable(),
15268
+ bundle_updated_at: external_exports.string().nullable(),
15269
+ bundle_failure_reason: external_exports.string().nullable()
15270
+ }).strict();
15229
15271
  var ServiceSchema = external_exports.object({
15230
15272
  service_id: external_exports.string(),
15231
15273
  project_id: external_exports.string(),
@@ -15248,6 +15290,9 @@ var IncidentsResponseSchema = external_exports.object({
15248
15290
  var IncidentResponseSchema = external_exports.object({
15249
15291
  incident: IncidentSchema
15250
15292
  }).strict();
15293
+ var ImprovementResponseSchema = external_exports.object({
15294
+ improvement: ImprovementSchema
15295
+ }).strict();
15251
15296
  var IncidentContextArtifactSchema = external_exports.object({
15252
15297
  status: external_exports.enum(["ready", "pending", "failed"]),
15253
15298
  body: external_exports.unknown().optional(),
@@ -15318,6 +15363,10 @@ var IncidentContextSchema = external_exports.object({
15318
15363
  var ServicesResponseSchema = external_exports.object({
15319
15364
  services: external_exports.array(ServiceSchema)
15320
15365
  }).strict();
15366
+ var ImprovementsResponseSchema = external_exports.object({
15367
+ improvements: external_exports.array(ImprovementSchema),
15368
+ next_cursor: external_exports.string().nullable().optional()
15369
+ }).strict();
15321
15370
  var LogsResponseSchema = external_exports.object({
15322
15371
  logs: external_exports.array(LogSchema),
15323
15372
  next_cursor: external_exports.string().nullable().optional()
@@ -15516,6 +15565,108 @@ function createRetrievalApi(client) {
15516
15565
  bearerToken: input.bearerToken
15517
15566
  })
15518
15567
  );
15568
+ },
15569
+ async listImprovements(input) {
15570
+ const query = new URLSearchParams();
15571
+ if (input.projectId !== void 0) {
15572
+ query.set("project_id", input.projectId);
15573
+ }
15574
+ if (input.environment !== void 0) {
15575
+ query.set("environment", input.environment);
15576
+ }
15577
+ if (input.service !== void 0) {
15578
+ query.set("service", input.service);
15579
+ }
15580
+ if (input.status !== void 0) {
15581
+ query.set("status", input.status);
15582
+ }
15583
+ if (input.severity !== void 0) {
15584
+ query.set("severity", input.severity);
15585
+ }
15586
+ if (input.kind !== void 0) {
15587
+ query.set("kind", input.kind);
15588
+ }
15589
+ if (input.cursor !== void 0) {
15590
+ query.set("cursor", input.cursor);
15591
+ }
15592
+ if (input.limit !== void 0) {
15593
+ query.set("limit", String(input.limit));
15594
+ }
15595
+ const path = query.size > 0 ? `/v1/improvements?${query.toString()}` : "/v1/improvements";
15596
+ const parsed = await expectParsed(
15597
+ client.request({
15598
+ method: "GET",
15599
+ path,
15600
+ bearerToken: input.bearerToken
15601
+ }),
15602
+ ImprovementsResponseSchema
15603
+ );
15604
+ return {
15605
+ improvements: parsed.improvements,
15606
+ next_cursor: parsed.next_cursor ?? null
15607
+ };
15608
+ },
15609
+ async getImprovement(input) {
15610
+ const parsed = await expectParsed(
15611
+ client.request({
15612
+ method: "GET",
15613
+ path: `/v1/improvements/${input.improvementId}`,
15614
+ bearerToken: input.bearerToken
15615
+ }),
15616
+ ImprovementResponseSchema
15617
+ );
15618
+ return parsed.improvement;
15619
+ },
15620
+ async resolveImprovement(input) {
15621
+ const parsed = await expectParsed(
15622
+ client.request({
15623
+ method: "POST",
15624
+ path: `/v1/improvements/${input.improvementId}/resolve`,
15625
+ bearerToken: input.bearerToken
15626
+ }),
15627
+ ImprovementResponseSchema
15628
+ );
15629
+ return parsed.improvement;
15630
+ },
15631
+ async reopenImprovement(input) {
15632
+ const parsed = await expectParsed(
15633
+ client.request({
15634
+ method: "POST",
15635
+ path: `/v1/improvements/${input.improvementId}/reopen`,
15636
+ bearerToken: input.bearerToken
15637
+ }),
15638
+ ImprovementResponseSchema
15639
+ );
15640
+ return parsed.improvement;
15641
+ },
15642
+ async snoozeImprovement(input) {
15643
+ const parsed = await expectParsed(
15644
+ client.request({
15645
+ method: "POST",
15646
+ path: `/v1/improvements/${input.improvementId}/snooze`,
15647
+ bearerToken: input.bearerToken,
15648
+ body: { snoozed_until: input.snoozedUntil }
15649
+ }),
15650
+ ImprovementResponseSchema
15651
+ );
15652
+ return parsed.improvement;
15653
+ },
15654
+ async getImprovementBundle(input) {
15655
+ return await expectParsed(
15656
+ client.request({
15657
+ method: "GET",
15658
+ path: `/v1/projects/${input.projectId}/improvements/${input.improvementId}/bundle`,
15659
+ bearerToken: input.bearerToken
15660
+ }),
15661
+ external_exports.union([
15662
+ PendingStatusSchema,
15663
+ BundleSchema,
15664
+ external_exports.object({
15665
+ status: external_exports.literal("failed"),
15666
+ reason: external_exports.string()
15667
+ }).strict()
15668
+ ])
15669
+ );
15519
15670
  }
15520
15671
  };
15521
15672
  }
@@ -15849,6 +16000,7 @@ var WebhookFiltersSchema = external_exports.object({
15849
16000
  var WebhookSchema = external_exports.object({
15850
16001
  webhook_id: external_exports.string(),
15851
16002
  project_id: external_exports.string(),
16003
+ created_by_user_id: external_exports.string(),
15852
16004
  url: external_exports.string(),
15853
16005
  events: external_exports.array(WebhookEventTypeSchema),
15854
16006
  filters: WebhookFiltersSchema,
@@ -16019,7 +16171,7 @@ function createWebhookApi(client) {
16019
16171
  return expectWebhook(
16020
16172
  client.request({
16021
16173
  method: "GET",
16022
- path: `/v1/webhooks/${input.webhookId}`,
16174
+ path: `/v1/webhooks/${input.webhookId}${buildQuery3({ project_id: input.projectId })}`,
16023
16175
  bearerToken: input.bearerToken
16024
16176
  })
16025
16177
  );
@@ -16041,7 +16193,7 @@ function createWebhookApi(client) {
16041
16193
  return expectWebhook(
16042
16194
  client.request({
16043
16195
  method: "PATCH",
16044
- path: `/v1/webhooks/${input.webhookId}`,
16196
+ path: `/v1/webhooks/${input.webhookId}${buildQuery3({ project_id: input.projectId })}`,
16045
16197
  bearerToken: input.bearerToken,
16046
16198
  body
16047
16199
  })
@@ -16050,7 +16202,7 @@ function createWebhookApi(client) {
16050
16202
  async deleteWebhook(input) {
16051
16203
  const response = await client.request({
16052
16204
  method: "DELETE",
16053
- path: `/v1/webhooks/${input.webhookId}`,
16205
+ path: `/v1/webhooks/${input.webhookId}${buildQuery3({ project_id: input.projectId })}`,
16054
16206
  bearerToken: input.bearerToken
16055
16207
  });
16056
16208
  if (response.status < 200 || response.status >= 300) {
@@ -16068,7 +16220,7 @@ function createWebhookApi(client) {
16068
16220
  return expectWebhookTestDelivery(
16069
16221
  client.request({
16070
16222
  method: "POST",
16071
- path: `/v1/webhooks/${input.webhookId}/test`,
16223
+ path: `/v1/webhooks/${input.webhookId}/test${buildQuery3({ project_id: input.projectId })}`,
16072
16224
  bearerToken: input.bearerToken,
16073
16225
  body
16074
16226
  })
@@ -16078,7 +16230,7 @@ function createWebhookApi(client) {
16078
16230
  return expectWebhookDeliveries(
16079
16231
  client.request({
16080
16232
  method: "GET",
16081
- path: `/v1/webhooks/${input.webhookId}/deliveries${buildQuery3({ limit: input.limit })}`,
16233
+ path: `/v1/webhooks/${input.webhookId}/deliveries${buildQuery3({ project_id: input.projectId, limit: input.limit })}`,
16082
16234
  bearerToken: input.bearerToken
16083
16235
  })
16084
16236
  );
@@ -16087,7 +16239,7 @@ function createWebhookApi(client) {
16087
16239
  return expectRetryDelivery(
16088
16240
  client.request({
16089
16241
  method: "POST",
16090
- path: `/v1/webhooks/${input.webhookId}/deliveries/${input.deliveryId}/retry`,
16242
+ path: `/v1/webhooks/${input.webhookId}/deliveries/${input.deliveryId}/retry${buildQuery3({ project_id: input.projectId })}`,
16091
16243
  bearerToken: input.bearerToken,
16092
16244
  body: {}
16093
16245
  })
@@ -16298,6 +16450,7 @@ var CapturePolicyOverridesSchema = external_exports.object({
16298
16450
  immediate_client_error_statuses: ImmediateClientErrorStatusesSchema.nullable()
16299
16451
  });
16300
16452
  var CapturePolicyResponseSchema = external_exports.object({
16453
+ access_mode: external_exports.enum(["manage", "preview"]),
16301
16454
  policy: ResolvedCapturePolicySchema,
16302
16455
  overrides: CapturePolicyOverridesSchema
16303
16456
  });
@@ -16395,6 +16548,29 @@ function getRequestAnomalyThreshold(input) {
16395
16548
  return null;
16396
16549
  }
16397
16550
 
16551
+ // ../../packages/shared-types/src/improvement-settings.ts
16552
+ var ImprovementBundleSensitivityValues = [
16553
+ "high_confidence",
16554
+ "balanced",
16555
+ "verbose"
16556
+ ];
16557
+ var ImprovementBundleSensitivitySchema = external_exports.enum(ImprovementBundleSensitivityValues);
16558
+ var ImprovementSettingsSchema = external_exports.object({
16559
+ automated_improvement_bundles_enabled: external_exports.boolean(),
16560
+ improvement_bundle_sensitivity: ImprovementBundleSensitivitySchema
16561
+ });
16562
+ var ImprovementSettingsResponseSchema = external_exports.object({
16563
+ access_mode: external_exports.enum(["manage", "preview"]),
16564
+ cloud_automation_available: external_exports.boolean(),
16565
+ settings: ImprovementSettingsSchema
16566
+ });
16567
+ var ImprovementSettingsUpdateSchema = external_exports.object({
16568
+ automated_improvement_bundles_enabled: external_exports.boolean().optional(),
16569
+ improvement_bundle_sensitivity: ImprovementBundleSensitivitySchema.optional()
16570
+ }).refine((input) => Object.keys(input).length > 0, {
16571
+ message: "At least one improvement settings field must be provided."
16572
+ });
16573
+
16398
16574
  // ../../packages/shared-types/src/index.ts
16399
16575
  function createUuidV4() {
16400
16576
  const cryptoSource = globalThis.crypto;
@@ -17661,6 +17837,57 @@ function createCapturePolicyApi(httpClient) {
17661
17837
  };
17662
17838
  }
17663
17839
 
17840
+ // ../cli/src/improvement-settings-commands.ts
17841
+ var ImprovementSettingsApiError = class extends Error {
17842
+ status;
17843
+ constructor(status, message) {
17844
+ super(message);
17845
+ this.name = "ImprovementSettingsApiError";
17846
+ this.status = status;
17847
+ }
17848
+ };
17849
+ function toApiError2(status, body, fallback) {
17850
+ if (typeof body === "object" && body !== null && "error" in body && typeof body.error === "string") {
17851
+ return new ImprovementSettingsApiError(status, body.error);
17852
+ }
17853
+ return new ImprovementSettingsApiError(status, fallback);
17854
+ }
17855
+ function createImprovementSettingsApi(httpClient) {
17856
+ return {
17857
+ async getImprovementSettings(input) {
17858
+ const response = await httpClient.request({
17859
+ method: "GET",
17860
+ path: `/v1/projects/${encodeURIComponent(input.projectId)}/improvement-settings`,
17861
+ bearerToken: input.bearerToken
17862
+ });
17863
+ if (response.status !== 200) {
17864
+ throw toApiError2(response.status, response.body, "Failed to get improvement settings.");
17865
+ }
17866
+ const parsed = ImprovementSettingsResponseSchema.safeParse(response.body);
17867
+ if (!parsed.success) {
17868
+ throw new ImprovementSettingsApiError(500, "Invalid improvement settings response.");
17869
+ }
17870
+ return parsed.data;
17871
+ },
17872
+ async updateImprovementSettings(input) {
17873
+ const response = await httpClient.request({
17874
+ method: "PATCH",
17875
+ path: `/v1/projects/${encodeURIComponent(input.projectId)}/improvement-settings`,
17876
+ bearerToken: input.bearerToken,
17877
+ body: input.update
17878
+ });
17879
+ if (response.status !== 200) {
17880
+ throw toApiError2(response.status, response.body, "Failed to update improvement settings.");
17881
+ }
17882
+ const parsed = ImprovementSettingsResponseSchema.safeParse(response.body);
17883
+ if (!parsed.success) {
17884
+ throw new ImprovementSettingsApiError(500, "Invalid improvement settings response.");
17885
+ }
17886
+ return parsed.data;
17887
+ }
17888
+ };
17889
+ }
17890
+
17664
17891
  // ../cli/src/member-commands.ts
17665
17892
  var MemberApiError = class extends Error {
17666
17893
  status;
@@ -17672,7 +17899,7 @@ var MemberApiError = class extends Error {
17672
17899
  this.code = code;
17673
17900
  }
17674
17901
  };
17675
- function toApiError2(status, body) {
17902
+ function toApiError3(status, body) {
17676
17903
  if (typeof body === "object" && body !== null && "error" in body && typeof body.error === "string") {
17677
17904
  return new MemberApiError(status, body.error);
17678
17905
  }
@@ -17683,68 +17910,68 @@ function createMemberApi(httpClient) {
17683
17910
  async listMembers(input) {
17684
17911
  const response = await httpClient.request({
17685
17912
  method: "GET",
17686
- path: "/v1/organization/members",
17913
+ path: `/v1/projects/${input.projectId}/members`,
17687
17914
  bearerToken: input.bearerToken
17688
17915
  });
17689
17916
  if (response.status !== 200) {
17690
- throw toApiError2(response.status, response.body);
17917
+ throw toApiError3(response.status, response.body);
17691
17918
  }
17692
17919
  return response.body;
17693
17920
  },
17694
17921
  async listInvites(input) {
17695
17922
  const response = await httpClient.request({
17696
17923
  method: "GET",
17697
- path: "/v1/organization/members/invites",
17924
+ path: `/v1/projects/${input.projectId}/invites`,
17698
17925
  bearerToken: input.bearerToken
17699
17926
  });
17700
17927
  if (response.status !== 200) {
17701
- throw toApiError2(response.status, response.body);
17928
+ throw toApiError3(response.status, response.body);
17702
17929
  }
17703
17930
  return response.body;
17704
17931
  },
17705
17932
  async inviteMember(input) {
17706
17933
  const response = await httpClient.request({
17707
17934
  method: "POST",
17708
- path: "/v1/organization/members/invite",
17935
+ path: `/v1/projects/${input.projectId}/invite`,
17709
17936
  bearerToken: input.bearerToken,
17710
17937
  body: { email: input.email, role: input.role }
17711
17938
  });
17712
17939
  if (response.status !== 201) {
17713
- throw toApiError2(response.status, response.body);
17940
+ throw toApiError3(response.status, response.body);
17714
17941
  }
17715
17942
  return response.body;
17716
17943
  },
17717
17944
  async cancelInvite(input) {
17718
17945
  const response = await httpClient.request({
17719
17946
  method: "DELETE",
17720
- path: `/v1/organization/members/invites/${input.inviteId}`,
17947
+ path: `/v1/projects/${input.projectId}/invites/${input.inviteId}`,
17721
17948
  bearerToken: input.bearerToken
17722
17949
  });
17723
17950
  if (response.status !== 200) {
17724
- throw toApiError2(response.status, response.body);
17951
+ throw toApiError3(response.status, response.body);
17725
17952
  }
17726
17953
  return response.body;
17727
17954
  },
17728
17955
  async updateMemberRole(input) {
17729
17956
  const response = await httpClient.request({
17730
17957
  method: "PATCH",
17731
- path: `/v1/organization/members/${input.userId}`,
17958
+ path: `/v1/projects/${input.projectId}/members/${input.userId}`,
17732
17959
  bearerToken: input.bearerToken,
17733
17960
  body: { role: input.role }
17734
17961
  });
17735
17962
  if (response.status !== 200) {
17736
- throw toApiError2(response.status, response.body);
17963
+ throw toApiError3(response.status, response.body);
17737
17964
  }
17738
17965
  return response.body;
17739
17966
  },
17740
17967
  async removeMember(input) {
17741
17968
  const response = await httpClient.request({
17742
17969
  method: "DELETE",
17743
- path: `/v1/organization/members/${input.userId}`,
17970
+ path: `/v1/projects/${input.projectId}/members/${input.userId}`,
17744
17971
  bearerToken: input.bearerToken
17745
17972
  });
17746
17973
  if (response.status !== 200) {
17747
- throw toApiError2(response.status, response.body);
17974
+ throw toApiError3(response.status, response.body);
17748
17975
  }
17749
17976
  return response.body;
17750
17977
  }
@@ -17762,7 +17989,7 @@ var ProbeApiError = class extends Error {
17762
17989
  this.code = code;
17763
17990
  }
17764
17991
  };
17765
- function toApiError3(status, body) {
17992
+ function toApiError4(status, body) {
17766
17993
  if (typeof body === "object" && body !== null && "error" in body && typeof body.error === "string") {
17767
17994
  return new ProbeApiError(status, body.error);
17768
17995
  }
@@ -17793,7 +18020,7 @@ function createProbeApi(httpClient) {
17793
18020
  body
17794
18021
  });
17795
18022
  if (response.status !== 201) {
17796
- throw toApiError3(response.status, response.body);
18023
+ throw toApiError4(response.status, response.body);
17797
18024
  }
17798
18025
  return response.body;
17799
18026
  },
@@ -17804,7 +18031,7 @@ function createProbeApi(httpClient) {
17804
18031
  bearerToken: input.bearerToken
17805
18032
  });
17806
18033
  if (response.status !== 200) {
17807
- throw toApiError3(response.status, response.body);
18034
+ throw toApiError4(response.status, response.body);
17808
18035
  }
17809
18036
  return response.body;
17810
18037
  },
@@ -17816,7 +18043,7 @@ function createProbeApi(httpClient) {
17816
18043
  body: { activation_id: input.activationId }
17817
18044
  });
17818
18045
  if (response.status !== 200) {
17819
- throw toApiError3(response.status, response.body);
18046
+ throw toApiError4(response.status, response.body);
17820
18047
  }
17821
18048
  return response.body;
17822
18049
  }
@@ -19028,6 +19255,181 @@ var STORAGE_SCHEMA_MIGRATIONS = [
19028
19255
  statements: [
19029
19256
  "ALTER TABLE capture_policies ADD COLUMN IF NOT EXISTS immediate_client_error_statuses jsonb"
19030
19257
  ]
19258
+ }),
19259
+ defineStorageSchemaMigration({
19260
+ id: "202605150001_add_user_avatar_columns",
19261
+ description: "Add cached user avatar metadata for GitHub and Gravatar profile images.",
19262
+ statements: [
19263
+ "ALTER TABLE users ADD COLUMN IF NOT EXISTS avatar_source text",
19264
+ "ALTER TABLE users ADD COLUMN IF NOT EXISTS avatar_object_key text",
19265
+ "ALTER TABLE users ADD COLUMN IF NOT EXISTS avatar_content_type text",
19266
+ "ALTER TABLE users ADD COLUMN IF NOT EXISTS avatar_updated_at timestamptz"
19267
+ ]
19268
+ }),
19269
+ defineStorageSchemaMigration({
19270
+ id: "202605170001_add_alert_email_digest_queue",
19271
+ description: "Add queued email alert digests and digest items for fixed-window alert batching.",
19272
+ statements: [
19273
+ `
19274
+ CREATE TABLE IF NOT EXISTS alert_email_digests (
19275
+ id uuid PRIMARY KEY,
19276
+ project_id uuid NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
19277
+ recipient text NOT NULL,
19278
+ status text NOT NULL,
19279
+ next_attempt_at timestamptz,
19280
+ claimed_at timestamptz,
19281
+ last_error text,
19282
+ delivered_at timestamptz,
19283
+ created_at timestamptz NOT NULL DEFAULT now(),
19284
+ updated_at timestamptz NOT NULL DEFAULT now()
19285
+ )
19286
+ `,
19287
+ `
19288
+ CREATE UNIQUE INDEX IF NOT EXISTS alert_email_digests_project_recipient_pending_idx
19289
+ ON alert_email_digests (project_id, recipient)
19290
+ WHERE status = 'pending' AND claimed_at IS NULL
19291
+ `,
19292
+ `
19293
+ CREATE INDEX IF NOT EXISTS alert_email_digests_status_next_attempt_idx
19294
+ ON alert_email_digests (status, next_attempt_at)
19295
+ `,
19296
+ `
19297
+ CREATE TABLE IF NOT EXISTS alert_email_digest_items (
19298
+ id uuid PRIMARY KEY,
19299
+ digest_id uuid NOT NULL REFERENCES alert_email_digests(id) ON DELETE CASCADE,
19300
+ alert_id uuid NOT NULL REFERENCES alert_rules(id) ON DELETE CASCADE,
19301
+ project_id uuid NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
19302
+ incident_id uuid NOT NULL REFERENCES incidents(id) ON DELETE CASCADE,
19303
+ condition_type text NOT NULL,
19304
+ dedupe_key text NOT NULL,
19305
+ payload jsonb NOT NULL,
19306
+ created_at timestamptz NOT NULL DEFAULT now(),
19307
+ UNIQUE (alert_id, incident_id, dedupe_key)
19308
+ )
19309
+ `,
19310
+ `
19311
+ CREATE INDEX IF NOT EXISTS alert_email_digest_items_digest_created_idx
19312
+ ON alert_email_digest_items (digest_id, created_at ASC)
19313
+ `
19314
+ ]
19315
+ }),
19316
+ defineStorageSchemaMigration({
19317
+ id: "202605180001_add_skipped_github_dispatch_status",
19318
+ description: "Allow GitHub dispatch delivery history to record rate-limited skips without retrying them.",
19319
+ statements: [
19320
+ "ALTER TABLE github_dispatch_deliveries DROP CONSTRAINT IF EXISTS github_dispatch_deliveries_status_check",
19321
+ "ALTER TABLE github_dispatch_deliveries ADD CONSTRAINT github_dispatch_deliveries_status_check CHECK (status IN ('pending', 'retrying', 'delivered', 'failed', 'skipped'))"
19322
+ ]
19323
+ }),
19324
+ defineStorageSchemaMigration({
19325
+ id: "202605180002_add_project_improvement_settings",
19326
+ description: "Add project-level automated improvement settings columns.",
19327
+ statements: [
19328
+ "ALTER TABLE projects ADD COLUMN IF NOT EXISTS automated_improvement_bundles_enabled boolean NOT NULL DEFAULT true",
19329
+ "ALTER TABLE projects ADD COLUMN IF NOT EXISTS improvement_bundle_sensitivity text NOT NULL DEFAULT 'balanced'",
19330
+ `
19331
+ ALTER TABLE projects
19332
+ DROP CONSTRAINT IF EXISTS projects_improvement_bundle_sensitivity_check
19333
+ `,
19334
+ `
19335
+ ALTER TABLE projects
19336
+ ADD CONSTRAINT projects_improvement_bundle_sensitivity_check
19337
+ CHECK (improvement_bundle_sensitivity IN ('high_confidence', 'balanced', 'verbose'))
19338
+ `
19339
+ ]
19340
+ }),
19341
+ defineStorageSchemaMigration({
19342
+ id: "202605180003_add_improvement_opportunities_and_bundle_generation_shape",
19343
+ description: "Add hosted improvement opportunity storage and allow bundle generations to reference improvements directly.",
19344
+ statements: [
19345
+ `
19346
+ CREATE TABLE IF NOT EXISTS improvement_opportunities (
19347
+ id uuid PRIMARY KEY,
19348
+ project_id uuid NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
19349
+ service_id uuid REFERENCES services(id) ON DELETE SET NULL,
19350
+ service_name text NOT NULL,
19351
+ environment text NOT NULL DEFAULT 'production',
19352
+ kind text NOT NULL,
19353
+ status text NOT NULL DEFAULT 'open',
19354
+ severity text NOT NULL,
19355
+ confidence numeric NOT NULL,
19356
+ fingerprint text NOT NULL,
19357
+ title text NOT NULL,
19358
+ summary text NOT NULL,
19359
+ occurrence_count integer NOT NULL DEFAULT 1,
19360
+ evidence jsonb NOT NULL,
19361
+ first_detected_at timestamptz NOT NULL,
19362
+ last_detected_at timestamptz NOT NULL,
19363
+ last_source_event_id uuid,
19364
+ related_incident_ids uuid[] NOT NULL DEFAULT '{}',
19365
+ bundle_generation_number integer NOT NULL DEFAULT 0,
19366
+ bundle_created_at timestamptz,
19367
+ bundle_updated_at timestamptz,
19368
+ bundle_source_event_id uuid,
19369
+ bundle_failure_reason text,
19370
+ resolved_at timestamptz,
19371
+ resolved_by_user_id uuid REFERENCES users(id) ON DELETE SET NULL,
19372
+ snoozed_until timestamptz,
19373
+ created_at timestamptz NOT NULL DEFAULT now(),
19374
+ updated_at timestamptz NOT NULL DEFAULT now(),
19375
+ UNIQUE (project_id, fingerprint)
19376
+ )
19377
+ `,
19378
+ `
19379
+ CREATE INDEX IF NOT EXISTS improvement_opportunities_project_status_detected_idx
19380
+ ON improvement_opportunities (project_id, status, last_detected_at DESC)
19381
+ `,
19382
+ `
19383
+ CREATE INDEX IF NOT EXISTS improvement_opportunities_project_kind_detected_idx
19384
+ ON improvement_opportunities (project_id, kind, last_detected_at DESC)
19385
+ `,
19386
+ `
19387
+ CREATE INDEX IF NOT EXISTS improvement_opportunities_project_service_env_idx
19388
+ ON improvement_opportunities (project_id, service_id, environment)
19389
+ `,
19390
+ `
19391
+ CREATE TABLE IF NOT EXISTS improvement_opportunity_events (
19392
+ improvement_opportunity_id uuid NOT NULL REFERENCES improvement_opportunities(id) ON DELETE CASCADE,
19393
+ event_id uuid NOT NULL,
19394
+ event_type text NOT NULL,
19395
+ occurred_at timestamptz NOT NULL,
19396
+ PRIMARY KEY (improvement_opportunity_id, event_id)
19397
+ )
19398
+ `,
19399
+ `
19400
+ CREATE INDEX IF NOT EXISTS improvement_opportunity_events_detected_idx
19401
+ ON improvement_opportunity_events (improvement_opportunity_id, occurred_at DESC, event_id DESC)
19402
+ `,
19403
+ "ALTER TABLE bundle_generations ALTER COLUMN incident_id DROP NOT NULL",
19404
+ "ALTER TABLE bundle_generations ADD COLUMN IF NOT EXISTS improvement_opportunity_id uuid REFERENCES improvement_opportunities(id) ON DELETE CASCADE",
19405
+ "ALTER TABLE bundle_generations DROP CONSTRAINT IF EXISTS bundle_generations_incident_id_source_event_id_key",
19406
+ "DROP INDEX IF EXISTS bundle_generations_incident_source_idx",
19407
+ "DROP INDEX IF EXISTS bundle_generations_improvement_source_idx",
19408
+ `
19409
+ CREATE UNIQUE INDEX IF NOT EXISTS bundle_generations_incident_source_idx
19410
+ ON bundle_generations (incident_id, source_event_id)
19411
+ WHERE incident_id IS NOT NULL
19412
+ `,
19413
+ `
19414
+ CREATE UNIQUE INDEX IF NOT EXISTS bundle_generations_improvement_source_idx
19415
+ ON bundle_generations (improvement_opportunity_id, source_event_id)
19416
+ WHERE improvement_opportunity_id IS NOT NULL
19417
+ `,
19418
+ "DROP INDEX IF EXISTS bundle_generations_improvement_generation_idx",
19419
+ `
19420
+ CREATE INDEX IF NOT EXISTS bundle_generations_improvement_generation_idx
19421
+ ON bundle_generations (improvement_opportunity_id, generation_number DESC)
19422
+ WHERE improvement_opportunity_id IS NOT NULL
19423
+ `,
19424
+ "ALTER TABLE bundle_generations DROP CONSTRAINT IF EXISTS bundle_generations_owner_check",
19425
+ `
19426
+ ALTER TABLE bundle_generations
19427
+ ADD CONSTRAINT bundle_generations_owner_check CHECK (
19428
+ (incident_id IS NOT NULL AND improvement_opportunity_id IS NULL AND bundle_type = 'failure')
19429
+ OR (incident_id IS NULL AND improvement_opportunity_id IS NOT NULL AND bundle_type = 'improvement')
19430
+ )
19431
+ `
19432
+ ]
19031
19433
  })
19032
19434
  ];
19033
19435
 
@@ -21125,7 +21527,7 @@ function formatResult(input, exitCode, checks, errors, incidentId) {
21125
21527
  };
21126
21528
  }
21127
21529
  function buildCloudSuggestedActions(status, incidentId, mode = "passive_recent_incident") {
21128
- if (status === "healthy" && incidentId !== void 0 && mode === "active_5xx") {
21530
+ if (status === "healthy" && incidentId !== void 0 && (mode === "active_5xx" || mode === "active_4xx")) {
21129
21531
  return [
21130
21532
  `Run debugbundle inspect ${incidentId} --source cloud to inspect why the incident fired.`,
21131
21533
  `Run debugbundle bundle ${incidentId} --source cloud to fetch the generated debug bundle.`
@@ -21195,11 +21597,11 @@ function localFailureStepName(checks) {
21195
21597
  function cloudVerificationRunId(now) {
21196
21598
  return now.toISOString().replace(/[-:.TZ]/g, "").slice(0, 14);
21197
21599
  }
21198
- function requestFailureReason() {
21600
+ function requestFailureReason(responseStatus) {
21199
21601
  const incidentReason = deriveIncidentReasonFromSignal({
21200
21602
  event_type: "request_event",
21201
21603
  event_class: "incident_signal",
21202
- response_status: 503
21604
+ response_status: responseStatus
21203
21605
  });
21204
21606
  if (incidentReason === null) {
21205
21607
  throw new Error("request_failure_reason_unavailable");
@@ -21208,6 +21610,9 @@ function requestFailureReason() {
21208
21610
  }
21209
21611
  function buildCloudVerificationEvent(input) {
21210
21612
  const runId = cloudVerificationRunId(input.now);
21613
+ const is5xxVerification = input.responseStatus >= 500;
21614
+ const routeTemplate = is5xxVerification ? "/debugbundle/verify/cloud" : `/debugbundle/verify/cloud/client-error/${input.responseStatus}`;
21615
+ const verificationLabel = is5xxVerification ? "true" : `client-error-${input.responseStatus}`;
21211
21616
  return createEventEnvelope({
21212
21617
  event_type: "request_event",
21213
21618
  sdk_name: "debugbundle-cli",
@@ -21221,28 +21626,39 @@ function buildCloudVerificationEvent(input) {
21221
21626
  occurred_at: input.now.toISOString(),
21222
21627
  payload: {
21223
21628
  method: "GET",
21224
- path: "/debugbundle/verify/cloud",
21225
- route_template: "/debugbundle/verify/cloud",
21629
+ path: routeTemplate,
21630
+ route_template: routeTemplate,
21226
21631
  query: {
21227
21632
  debugbundle_verification: true,
21228
- run_id: runId
21633
+ run_id: runId,
21634
+ synthetic_status: input.responseStatus
21229
21635
  },
21230
21636
  headers: {
21231
- "x-debugbundle-verification": "true"
21637
+ "x-debugbundle-verification": verificationLabel
21232
21638
  },
21233
- response_status: 503,
21639
+ response_status: input.responseStatus,
21234
21640
  duration_ms: 37,
21235
21641
  response_headers: {
21236
- "x-debugbundle-verification": "true"
21642
+ "x-debugbundle-verification": verificationLabel
21237
21643
  },
21238
21644
  response_body: {
21239
- error: "debugbundle_cloud_verification",
21645
+ error: is5xxVerification ? "debugbundle_cloud_verification" : "debugbundle_cloud_client_error_verification",
21240
21646
  synthetic: true,
21241
- run_id: runId
21647
+ run_id: runId,
21648
+ response_status: input.responseStatus
21242
21649
  }
21243
21650
  }
21244
21651
  });
21245
21652
  }
21653
+ function validateActiveCloudVerificationInput(input) {
21654
+ if (input.trigger5xx === true && input.trigger4xxStatus !== void 0) {
21655
+ return "Choose either --trigger-5xx or --trigger-4xx, not both.";
21656
+ }
21657
+ if (input.trigger4xxStatus !== void 0 && (input.trigger4xxStatus < 400 || input.trigger4xxStatus > 499)) {
21658
+ return "--trigger-4xx must be an integer status between 400 and 499.";
21659
+ }
21660
+ return null;
21661
+ }
21246
21662
  async function sendEventsToApi(input, dependencies = {}) {
21247
21663
  const fetchImpl = dependencies.fetchImpl ?? fetch;
21248
21664
  const baseUrl = input.baseUrl.endsWith("/") ? input.baseUrl.slice(0, -1) : input.baseUrl;
@@ -21434,6 +21850,15 @@ async function verifyCloudCommand(input, dependencies = {}) {
21434
21850
  const checks = [];
21435
21851
  const environment = input.environment ?? "production";
21436
21852
  const maxAgeMinutes = input.maxAgeMinutes ?? 15;
21853
+ const activeInputError = validateActiveCloudVerificationInput(input);
21854
+ if (activeInputError !== null) {
21855
+ checks.push({
21856
+ name: "trigger-input",
21857
+ status: "error",
21858
+ message: activeInputError
21859
+ });
21860
+ return formatCloudResult(input, 4, checks, [activeInputError]);
21861
+ }
21437
21862
  const readAuthState = dependencies.readAuthState ?? readCliAuthState;
21438
21863
  let authState;
21439
21864
  try {
@@ -21466,7 +21891,7 @@ async function verifyCloudCommand(input, dependencies = {}) {
21466
21891
  requestInput,
21467
21892
  dependencies.fetchImpl === void 0 ? {} : { fetchImpl: dependencies.fetchImpl }
21468
21893
  ));
21469
- if (input.trigger5xx === true) {
21894
+ if (input.trigger5xx === true || input.trigger4xxStatus !== void 0) {
21470
21895
  const verificationStartedAt = now();
21471
21896
  const runId = cloudVerificationRunId(verificationStartedAt);
21472
21897
  const serviceName = input.service ?? `debugbundle-verify-cloud-${runId}`;
@@ -21474,16 +21899,20 @@ async function verifyCloudCommand(input, dependencies = {}) {
21474
21899
  const pollAttempts = dependencies.pollAttempts ?? 6;
21475
21900
  const pollIntervalMs = dependencies.pollIntervalMs ?? 2e3;
21476
21901
  const sleep = dependencies.sleep ?? ((milliseconds) => new Promise((resolve) => setTimeout(resolve, milliseconds)));
21902
+ const responseStatus = input.trigger4xxStatus ?? 503;
21903
+ const activeMode = input.trigger4xxStatus !== void 0 ? "active_4xx" : "active_5xx";
21904
+ const activeCheckName = input.trigger4xxStatus !== void 0 ? "active-4xx-event" : "active-5xx-event";
21905
+ const statusLabel = input.trigger4xxStatus !== void 0 ? `${responseStatus}` : "5xx";
21477
21906
  const verification = {
21478
- mode: "active_5xx",
21907
+ mode: activeMode,
21479
21908
  bundle_status: "unknown",
21480
- classification_reason: requestFailureReason()
21909
+ classification_reason: requestFailureReason(responseStatus)
21481
21910
  };
21482
21911
  const errors = [];
21483
21912
  let exitCode = 0;
21484
21913
  let tokenId = null;
21485
21914
  let incidentId;
21486
- let activeStep = "active-5xx-event";
21915
+ let activeStep = activeCheckName;
21487
21916
  try {
21488
21917
  const token = await createProjectToken({
21489
21918
  bearerToken: authState.bearer_token,
@@ -21497,7 +21926,8 @@ async function verifyCloudCommand(input, dependencies = {}) {
21497
21926
  const event = buildCloudVerificationEvent({
21498
21927
  now: verificationStartedAt,
21499
21928
  serviceName,
21500
- environment
21929
+ environment,
21930
+ responseStatus
21501
21931
  });
21502
21932
  const ingestion = await sendEvents({
21503
21933
  baseUrl: authState.base_url,
@@ -21506,12 +21936,12 @@ async function verifyCloudCommand(input, dependencies = {}) {
21506
21936
  });
21507
21937
  verification.accepted_event_count = ingestion.accepted;
21508
21938
  if (ingestion.accepted < 1 || ingestion.rejected > 0 || ingestion.errors.length > 0) {
21509
- throw new Error(`Synthetic 5xx ingestion was not fully accepted: accepted=${ingestion.accepted}, rejected=${ingestion.rejected}.`);
21939
+ throw new Error(`Synthetic ${statusLabel} ingestion was not fully accepted: accepted=${ingestion.accepted}, rejected=${ingestion.rejected}.`);
21510
21940
  }
21511
21941
  checks.push({
21512
- name: "active-5xx-event",
21942
+ name: activeCheckName,
21513
21943
  status: "ok",
21514
- message: "Sent synthetic 5xx request_event through cloud ingestion."
21944
+ message: `Sent synthetic ${statusLabel} request_event through cloud ingestion.`
21515
21945
  });
21516
21946
  activeStep = "incident-retrieval";
21517
21947
  for (let attempt = 1; attempt <= pollAttempts; attempt += 1) {
@@ -21529,7 +21959,7 @@ async function verifyCloudCommand(input, dependencies = {}) {
21529
21959
  if (candidate !== void 0) {
21530
21960
  incidentId = candidate.incident_id;
21531
21961
  verification.incident_id = candidate.incident_id;
21532
- verification.classification_reason = candidate.incident_reason ?? requestFailureReason();
21962
+ verification.classification_reason = candidate.incident_reason ?? requestFailureReason(responseStatus);
21533
21963
  break;
21534
21964
  }
21535
21965
  if (attempt < pollAttempts) {
@@ -21537,12 +21967,12 @@ async function verifyCloudCommand(input, dependencies = {}) {
21537
21967
  }
21538
21968
  }
21539
21969
  if (incidentId === void 0) {
21540
- throw new Error("Synthetic 5xx request was accepted but no matching cloud incident was visible yet.");
21970
+ throw new Error(`Synthetic ${statusLabel} request was accepted but no matching cloud incident was visible yet.`);
21541
21971
  }
21542
21972
  checks.push({
21543
21973
  name: "incident-retrieval",
21544
21974
  status: "ok",
21545
- message: `Retrieved cloud incident ${incidentId} for the synthetic 5xx request.`
21975
+ message: `Retrieved cloud incident ${incidentId} for the synthetic ${statusLabel} request.`
21546
21976
  });
21547
21977
  activeStep = "bundle-status";
21548
21978
  const bundle = await getBundle({
@@ -22046,6 +22476,7 @@ function createAlertMcpTools(api) {
22046
22476
  try {
22047
22477
  const requestInput = {
22048
22478
  bearerToken: String(input["bearerToken"]),
22479
+ projectId: String(input["projectId"]),
22049
22480
  alertId: String(input["alertId"])
22050
22481
  };
22051
22482
  if (typeof input["serviceId"] === "string") {
@@ -22080,6 +22511,7 @@ function createAlertMcpTools(api) {
22080
22511
  return {
22081
22512
  alert: await api.deleteAlert({
22082
22513
  bearerToken: String(input["bearerToken"]),
22514
+ projectId: String(input["projectId"]),
22083
22515
  alertId: String(input["alertId"])
22084
22516
  })
22085
22517
  };
@@ -22227,8 +22659,11 @@ function createGitHubMcpTools(api) {
22227
22659
  async get_github_status(input) {
22228
22660
  try {
22229
22661
  const bearerToken = String(input["bearerToken"]);
22230
- const installation = await api.getInstallation({ bearerToken });
22231
22662
  const projectId = typeof input["projectId"] === "string" ? input["projectId"] : void 0;
22663
+ const installation = await api.getInstallation({
22664
+ bearerToken,
22665
+ ...projectId === void 0 ? {} : { projectId }
22666
+ });
22232
22667
  const repo = projectId === void 0 || api.getProjectRepo === void 0 ? void 0 : await api.getProjectRepo({ bearerToken, projectId });
22233
22668
  return repo === void 0 ? { installation } : { installation, repo };
22234
22669
  } catch (error) {
@@ -22239,7 +22674,8 @@ function createGitHubMcpTools(api) {
22239
22674
  try {
22240
22675
  return {
22241
22676
  repositories: await api.listRepositories({
22242
- bearerToken: String(input["bearerToken"])
22677
+ bearerToken: String(input["bearerToken"]),
22678
+ ...typeof input["projectId"] === "string" ? { projectId: input["projectId"] } : {}
22243
22679
  })
22244
22680
  };
22245
22681
  } catch (error) {
@@ -22375,8 +22811,134 @@ function createGitHubMcpTools(api) {
22375
22811
  };
22376
22812
  }
22377
22813
 
22378
- // src/member-tools.ts
22814
+ // src/improvement-tools.ts
22379
22815
  function mapMcpError6(error) {
22816
+ if (error instanceof RetrievalApiError) {
22817
+ throw new Error(`mcp_tool_error:${error.code}`);
22818
+ }
22819
+ throw new Error("mcp_tool_error:unknown_error");
22820
+ }
22821
+ function requireBearerToken(input) {
22822
+ const bearerToken = input["bearerToken"];
22823
+ if (typeof bearerToken !== "string" || bearerToken.length === 0) {
22824
+ throw new RetrievalApiError(401, "auth_required");
22825
+ }
22826
+ return bearerToken;
22827
+ }
22828
+ function readString2(input, key) {
22829
+ const value = input[key];
22830
+ return typeof value === "string" ? value : "";
22831
+ }
22832
+ function createImprovementMcpTools(api) {
22833
+ return {
22834
+ async list_improvements(input) {
22835
+ try {
22836
+ return await api.listImprovements({
22837
+ bearerToken: requireBearerToken(input),
22838
+ ...typeof input["projectId"] === "string" ? { projectId: input["projectId"] } : {},
22839
+ ...typeof input["environment"] === "string" ? { environment: input["environment"] } : {},
22840
+ ...typeof input["service"] === "string" ? { service: input["service"] } : {},
22841
+ ...typeof input["status"] === "string" ? { status: input["status"] } : {},
22842
+ ...typeof input["severity"] === "string" ? { severity: input["severity"] } : {},
22843
+ ...typeof input["kind"] === "string" ? { kind: input["kind"] } : {},
22844
+ ...typeof input["cursor"] === "string" ? { cursor: input["cursor"] } : {},
22845
+ ...typeof input["limit"] === "number" ? { limit: input["limit"] } : {}
22846
+ });
22847
+ } catch (error) {
22848
+ mapMcpError6(error);
22849
+ }
22850
+ },
22851
+ async get_improvement(input) {
22852
+ try {
22853
+ return await api.getImprovement({
22854
+ bearerToken: requireBearerToken(input),
22855
+ improvementId: readString2(input, "improvementId")
22856
+ });
22857
+ } catch (error) {
22858
+ mapMcpError6(error);
22859
+ }
22860
+ },
22861
+ async get_improvement_bundle(input) {
22862
+ try {
22863
+ return await api.getImprovementBundle({
22864
+ bearerToken: requireBearerToken(input),
22865
+ projectId: readString2(input, "projectId"),
22866
+ improvementId: readString2(input, "improvementId")
22867
+ });
22868
+ } catch (error) {
22869
+ mapMcpError6(error);
22870
+ }
22871
+ },
22872
+ async resolve_improvement(input) {
22873
+ try {
22874
+ return await api.resolveImprovement({
22875
+ bearerToken: requireBearerToken(input),
22876
+ improvementId: readString2(input, "improvementId")
22877
+ });
22878
+ } catch (error) {
22879
+ mapMcpError6(error);
22880
+ }
22881
+ },
22882
+ async reopen_improvement(input) {
22883
+ try {
22884
+ return await api.reopenImprovement({
22885
+ bearerToken: requireBearerToken(input),
22886
+ improvementId: readString2(input, "improvementId")
22887
+ });
22888
+ } catch (error) {
22889
+ mapMcpError6(error);
22890
+ }
22891
+ },
22892
+ async snooze_improvement(input) {
22893
+ try {
22894
+ return await api.snoozeImprovement({
22895
+ bearerToken: requireBearerToken(input),
22896
+ improvementId: readString2(input, "improvementId"),
22897
+ snoozedUntil: readString2(input, "snoozedUntil")
22898
+ });
22899
+ } catch (error) {
22900
+ mapMcpError6(error);
22901
+ }
22902
+ }
22903
+ };
22904
+ }
22905
+
22906
+ // src/improvement-settings-tools.ts
22907
+ function mapMcpError7(error) {
22908
+ if (error instanceof ImprovementSettingsApiError) {
22909
+ throw new Error(`mcp_tool_error:${error.message}`);
22910
+ }
22911
+ throw new Error("mcp_tool_error:unknown_error");
22912
+ }
22913
+ function createImprovementSettingsMcpTools(api) {
22914
+ return {
22915
+ async get_improvement_settings(input) {
22916
+ try {
22917
+ return await api.getImprovementSettings({
22918
+ bearerToken: String(input["bearerToken"]),
22919
+ projectId: String(input["projectId"])
22920
+ });
22921
+ } catch (error) {
22922
+ mapMcpError7(error);
22923
+ }
22924
+ },
22925
+ async update_improvement_settings(input) {
22926
+ try {
22927
+ const update = typeof input["update"] === "object" && input["update"] !== null ? input["update"] : {};
22928
+ return await api.updateImprovementSettings({
22929
+ bearerToken: String(input["bearerToken"]),
22930
+ projectId: String(input["projectId"]),
22931
+ update
22932
+ });
22933
+ } catch (error) {
22934
+ mapMcpError7(error);
22935
+ }
22936
+ }
22937
+ };
22938
+ }
22939
+
22940
+ // src/member-tools.ts
22941
+ function mapMcpError8(error) {
22380
22942
  if (error instanceof MemberApiError) {
22381
22943
  throw new Error(`mcp_tool_error:${error.code}`);
22382
22944
  }
@@ -22384,71 +22946,77 @@ function mapMcpError6(error) {
22384
22946
  }
22385
22947
  function createMemberMcpTools(api) {
22386
22948
  return {
22387
- async list_members(input) {
22949
+ async list_project_members(input) {
22388
22950
  try {
22389
22951
  return await api.listMembers({
22390
- bearerToken: String(input["bearerToken"])
22952
+ bearerToken: String(input["bearerToken"]),
22953
+ projectId: String(input["projectId"])
22391
22954
  });
22392
22955
  } catch (error) {
22393
- mapMcpError6(error);
22956
+ mapMcpError8(error);
22394
22957
  }
22395
22958
  },
22396
- async list_member_invites(input) {
22959
+ async list_project_member_invites(input) {
22397
22960
  try {
22398
22961
  return await api.listInvites({
22399
- bearerToken: String(input["bearerToken"])
22962
+ bearerToken: String(input["bearerToken"]),
22963
+ projectId: String(input["projectId"])
22400
22964
  });
22401
22965
  } catch (error) {
22402
- mapMcpError6(error);
22966
+ mapMcpError8(error);
22403
22967
  }
22404
22968
  },
22405
- async invite_member(input) {
22969
+ async invite_project_member(input) {
22406
22970
  try {
22407
22971
  return await api.inviteMember({
22408
22972
  bearerToken: String(input["bearerToken"]),
22973
+ projectId: String(input["projectId"]),
22409
22974
  email: String(input["email"]),
22410
22975
  role: String(input["role"])
22411
22976
  });
22412
22977
  } catch (error) {
22413
- mapMcpError6(error);
22978
+ mapMcpError8(error);
22414
22979
  }
22415
22980
  },
22416
- async cancel_member_invite(input) {
22981
+ async cancel_project_member_invite(input) {
22417
22982
  try {
22418
22983
  return await api.cancelInvite({
22419
22984
  bearerToken: String(input["bearerToken"]),
22985
+ projectId: String(input["projectId"]),
22420
22986
  inviteId: String(input["inviteId"])
22421
22987
  });
22422
22988
  } catch (error) {
22423
- mapMcpError6(error);
22989
+ mapMcpError8(error);
22424
22990
  }
22425
22991
  },
22426
- async update_member_role(input) {
22992
+ async update_project_member_role(input) {
22427
22993
  try {
22428
22994
  return await api.updateMemberRole({
22429
22995
  bearerToken: String(input["bearerToken"]),
22996
+ projectId: String(input["projectId"]),
22430
22997
  userId: String(input["userId"]),
22431
22998
  role: String(input["role"])
22432
22999
  });
22433
23000
  } catch (error) {
22434
- mapMcpError6(error);
23001
+ mapMcpError8(error);
22435
23002
  }
22436
23003
  },
22437
- async remove_member(input) {
23004
+ async remove_project_member(input) {
22438
23005
  try {
22439
23006
  return await api.removeMember({
22440
23007
  bearerToken: String(input["bearerToken"]),
23008
+ projectId: String(input["projectId"]),
22441
23009
  userId: String(input["userId"])
22442
23010
  });
22443
23011
  } catch (error) {
22444
- mapMcpError6(error);
23012
+ mapMcpError8(error);
22445
23013
  }
22446
23014
  }
22447
23015
  };
22448
23016
  }
22449
23017
 
22450
23018
  // src/probe-tools.ts
22451
- function mapMcpError7(error) {
23019
+ function mapMcpError9(error) {
22452
23020
  if (error instanceof ProbeApiError) {
22453
23021
  throw new Error(`mcp_tool_error:${error.code}`);
22454
23022
  }
@@ -22477,7 +23045,7 @@ function createProbeMcpTools(api) {
22477
23045
  }
22478
23046
  return await api.activateProbe(requestInput);
22479
23047
  } catch (error) {
22480
- mapMcpError7(error);
23048
+ mapMcpError9(error);
22481
23049
  }
22482
23050
  },
22483
23051
  async list_active_probes(input) {
@@ -22487,7 +23055,7 @@ function createProbeMcpTools(api) {
22487
23055
  projectId: String(input["projectId"])
22488
23056
  });
22489
23057
  } catch (error) {
22490
- mapMcpError7(error);
23058
+ mapMcpError9(error);
22491
23059
  }
22492
23060
  },
22493
23061
  async deactivate_probe(input) {
@@ -22498,14 +23066,14 @@ function createProbeMcpTools(api) {
22498
23066
  activationId: String(input["activationId"])
22499
23067
  });
22500
23068
  } catch (error) {
22501
- mapMcpError7(error);
23069
+ mapMcpError9(error);
22502
23070
  }
22503
23071
  }
22504
23072
  };
22505
23073
  }
22506
23074
 
22507
23075
  // src/project-tools.ts
22508
- function mapMcpError8(error) {
23076
+ function mapMcpError10(error) {
22509
23077
  if (error instanceof ProjectManagementApiError) {
22510
23078
  throw new Error(`mcp_tool_error:${error.code}`);
22511
23079
  }
@@ -22523,7 +23091,7 @@ function createProjectMcpTools(api) {
22523
23091
  }
22524
23092
  return { projects: await api.listProjects(requestInput) };
22525
23093
  } catch (error) {
22526
- mapMcpError8(error);
23094
+ mapMcpError10(error);
22527
23095
  }
22528
23096
  },
22529
23097
  async create_project(input) {
@@ -22538,7 +23106,7 @@ function createProjectMcpTools(api) {
22538
23106
  }
22539
23107
  return { project: await api.createProject(requestInput) };
22540
23108
  } catch (error) {
22541
- mapMcpError8(error);
23109
+ mapMcpError10(error);
22542
23110
  }
22543
23111
  },
22544
23112
  async update_project(input) {
@@ -22558,7 +23126,7 @@ function createProjectMcpTools(api) {
22558
23126
  }
22559
23127
  return { project: await api.updateProject(requestInput) };
22560
23128
  } catch (error) {
22561
- mapMcpError8(error);
23129
+ mapMcpError10(error);
22562
23130
  }
22563
23131
  },
22564
23132
  async delete_project(input) {
@@ -22570,7 +23138,7 @@ function createProjectMcpTools(api) {
22570
23138
  })
22571
23139
  };
22572
23140
  } catch (error) {
22573
- mapMcpError8(error);
23141
+ mapMcpError10(error);
22574
23142
  }
22575
23143
  }
22576
23144
  };
@@ -22777,7 +23345,7 @@ async function persistCloudArtifact(directoryPath, fileName, payload, dependenci
22777
23345
  }
22778
23346
 
22779
23347
  // src/retrieval-tools.ts
22780
- function mapMcpError9(error) {
23348
+ function mapMcpError11(error) {
22781
23349
  if (error instanceof RetrievalApiError) {
22782
23350
  throw new Error(`mcp_tool_error:${error.code}`);
22783
23351
  }
@@ -22959,7 +23527,7 @@ function createRetrievalMcpTools(api) {
22959
23527
  incidents: incidents.incidents.map((incident) => attachSourceToRecord(incident, "cloud"))
22960
23528
  };
22961
23529
  } catch (error) {
22962
- mapMcpError9(error);
23530
+ mapMcpError11(error);
22963
23531
  }
22964
23532
  },
22965
23533
  async get_incident(input) {
@@ -22994,7 +23562,7 @@ function createRetrievalMcpTools(api) {
22994
23562
  )
22995
23563
  };
22996
23564
  } catch (error) {
22997
- mapMcpError9(error);
23565
+ mapMcpError11(error);
22998
23566
  }
22999
23567
  },
23000
23568
  async get_incident_context(input) {
@@ -23023,7 +23591,7 @@ function createRetrievalMcpTools(api) {
23023
23591
  "cloud"
23024
23592
  );
23025
23593
  } catch (error) {
23026
- mapMcpError9(error);
23594
+ mapMcpError11(error);
23027
23595
  }
23028
23596
  },
23029
23597
  async resolve_incident(input) {
@@ -23068,7 +23636,7 @@ function createRetrievalMcpTools(api) {
23068
23636
  })()
23069
23637
  };
23070
23638
  } catch (error) {
23071
- mapMcpError9(error);
23639
+ mapMcpError11(error);
23072
23640
  }
23073
23641
  },
23074
23642
  async reopen_incident(input) {
@@ -23113,7 +23681,7 @@ function createRetrievalMcpTools(api) {
23113
23681
  })()
23114
23682
  };
23115
23683
  } catch (error) {
23116
- mapMcpError9(error);
23684
+ mapMcpError11(error);
23117
23685
  }
23118
23686
  },
23119
23687
  async get_bundle(input) {
@@ -23144,7 +23712,7 @@ function createRetrievalMcpTools(api) {
23144
23712
  }
23145
23713
  );
23146
23714
  } catch (error) {
23147
- mapMcpError9(error);
23715
+ mapMcpError11(error);
23148
23716
  }
23149
23717
  },
23150
23718
  async get_logs(input) {
@@ -23164,7 +23732,7 @@ function createRetrievalMcpTools(api) {
23164
23732
  }
23165
23733
  return await api.getLogs(requestInput);
23166
23734
  } catch (error) {
23167
- mapMcpError9(error);
23735
+ mapMcpError11(error);
23168
23736
  }
23169
23737
  },
23170
23738
  async get_reproduction(input) {
@@ -23195,14 +23763,14 @@ function createRetrievalMcpTools(api) {
23195
23763
  }
23196
23764
  );
23197
23765
  } catch (error) {
23198
- mapMcpError9(error);
23766
+ mapMcpError11(error);
23199
23767
  }
23200
23768
  }
23201
23769
  };
23202
23770
  }
23203
23771
 
23204
23772
  // src/services-tools.ts
23205
- function mapMcpError10(error) {
23773
+ function mapMcpError12(error) {
23206
23774
  if (error instanceof RetrievalApiError) {
23207
23775
  throw new Error(`mcp_tool_error:${error.code}`);
23208
23776
  }
@@ -23223,14 +23791,14 @@ function createServicesMcpTools(api) {
23223
23791
  services: await api.listServices(requestInput)
23224
23792
  };
23225
23793
  } catch (error) {
23226
- mapMcpError10(error);
23794
+ mapMcpError12(error);
23227
23795
  }
23228
23796
  }
23229
23797
  };
23230
23798
  }
23231
23799
 
23232
23800
  // src/setup-tools.ts
23233
- function mapMcpError11() {
23801
+ function mapMcpError13() {
23234
23802
  throw new Error("mcp_tool_error:unknown_error");
23235
23803
  }
23236
23804
  function parseJsonOutput2(output) {
@@ -23245,7 +23813,7 @@ async function runJsonCommand2(command) {
23245
23813
  const result = await command();
23246
23814
  return parseJsonOutput2(result.output);
23247
23815
  } catch {
23248
- mapMcpError11();
23816
+ mapMcpError13();
23249
23817
  }
23250
23818
  }
23251
23819
  function createSetupMcpTools(commands) {
@@ -23282,6 +23850,7 @@ function createSetupMcpTools(commands) {
23282
23850
  ...typeof input["environment"] === "string" ? { environment: input["environment"] } : {},
23283
23851
  ...typeof input["maxAgeMinutes"] === "number" ? { maxAgeMinutes: input["maxAgeMinutes"] } : {},
23284
23852
  ...input["trigger5xx"] === true ? { trigger5xx: true } : {},
23853
+ ...typeof input["trigger4xxStatus"] === "number" ? { trigger4xxStatus: input["trigger4xxStatus"] } : {},
23285
23854
  ...typeof input["authFilePath"] === "string" ? { authFilePath: input["authFilePath"] } : {},
23286
23855
  json: true
23287
23856
  })
@@ -23303,7 +23872,7 @@ function createSetupMcpTools(commands) {
23303
23872
  }
23304
23873
 
23305
23874
  // src/slack-tools.ts
23306
- function mapMcpError12(error) {
23875
+ function mapMcpError14(error) {
23307
23876
  if (error instanceof SlackApiError) {
23308
23877
  throw new Error(`mcp_tool_error:${error.code}`);
23309
23878
  }
@@ -23320,7 +23889,7 @@ function createSlackMcpTools(api) {
23320
23889
  })
23321
23890
  };
23322
23891
  } catch (error) {
23323
- mapMcpError12(error);
23892
+ mapMcpError14(error);
23324
23893
  }
23325
23894
  },
23326
23895
  async get_slack_connect_url(input) {
@@ -23333,7 +23902,7 @@ function createSlackMcpTools(api) {
23333
23902
  })
23334
23903
  };
23335
23904
  } catch (error) {
23336
- mapMcpError12(error);
23905
+ mapMcpError14(error);
23337
23906
  }
23338
23907
  },
23339
23908
  async test_slack_destination(input) {
@@ -23346,7 +23915,7 @@ function createSlackMcpTools(api) {
23346
23915
  })
23347
23916
  };
23348
23917
  } catch (error) {
23349
- mapMcpError12(error);
23918
+ mapMcpError14(error);
23350
23919
  }
23351
23920
  },
23352
23921
  async delete_slack_destination(input) {
@@ -23359,14 +23928,14 @@ function createSlackMcpTools(api) {
23359
23928
  })
23360
23929
  };
23361
23930
  } catch (error) {
23362
- mapMcpError12(error);
23931
+ mapMcpError14(error);
23363
23932
  }
23364
23933
  }
23365
23934
  };
23366
23935
  }
23367
23936
 
23368
23937
  // src/token-tools.ts
23369
- function mapMcpError13(error) {
23938
+ function mapMcpError15(error) {
23370
23939
  if (error instanceof TokenManagementApiError) {
23371
23940
  throw new Error(`mcp_tool_error:${error.code}`);
23372
23941
  }
@@ -23387,7 +23956,7 @@ function createTokenMcpTools(api) {
23387
23956
  tokens: await api.listProjectTokens(requestInput)
23388
23957
  };
23389
23958
  } catch (error) {
23390
- mapMcpError13(error);
23959
+ mapMcpError15(error);
23391
23960
  }
23392
23961
  },
23393
23962
  async create_project_token(input) {
@@ -23400,7 +23969,7 @@ function createTokenMcpTools(api) {
23400
23969
  })
23401
23970
  };
23402
23971
  } catch (error) {
23403
- mapMcpError13(error);
23972
+ mapMcpError15(error);
23404
23973
  }
23405
23974
  },
23406
23975
  async revoke_project_token(input) {
@@ -23413,7 +23982,7 @@ function createTokenMcpTools(api) {
23413
23982
  })
23414
23983
  };
23415
23984
  } catch (error) {
23416
- mapMcpError13(error);
23985
+ mapMcpError15(error);
23417
23986
  }
23418
23987
  },
23419
23988
  async list_member_tokens(input) {
@@ -23428,7 +23997,7 @@ function createTokenMcpTools(api) {
23428
23997
  tokens: await api.listMemberTokens(requestInput)
23429
23998
  };
23430
23999
  } catch (error) {
23431
- mapMcpError13(error);
24000
+ mapMcpError15(error);
23432
24001
  }
23433
24002
  },
23434
24003
  async create_member_token(input) {
@@ -23440,7 +24009,7 @@ function createTokenMcpTools(api) {
23440
24009
  })
23441
24010
  };
23442
24011
  } catch (error) {
23443
- mapMcpError13(error);
24012
+ mapMcpError15(error);
23444
24013
  }
23445
24014
  },
23446
24015
  async revoke_member_token(input) {
@@ -23452,14 +24021,14 @@ function createTokenMcpTools(api) {
23452
24021
  })
23453
24022
  };
23454
24023
  } catch (error) {
23455
- mapMcpError13(error);
24024
+ mapMcpError15(error);
23456
24025
  }
23457
24026
  }
23458
24027
  };
23459
24028
  }
23460
24029
 
23461
24030
  // src/webhook-tools.ts
23462
- function mapMcpError14(error) {
24031
+ function mapMcpError16(error) {
23463
24032
  if (error instanceof WebhookApiError) {
23464
24033
  throw new Error(`mcp_tool_error:${error.code}`);
23465
24034
  }
@@ -23480,7 +24049,7 @@ function createWebhookMcpTools(api) {
23480
24049
  webhooks: await api.listWebhooks(requestInput)
23481
24050
  };
23482
24051
  } catch (error) {
23483
- mapMcpError14(error);
24052
+ mapMcpError16(error);
23484
24053
  }
23485
24054
  },
23486
24055
  async create_webhook(input) {
@@ -23501,13 +24070,14 @@ function createWebhookMcpTools(api) {
23501
24070
  webhook: await api.createWebhook(requestInput)
23502
24071
  };
23503
24072
  } catch (error) {
23504
- mapMcpError14(error);
24073
+ mapMcpError16(error);
23505
24074
  }
23506
24075
  },
23507
24076
  async update_webhook(input) {
23508
24077
  try {
23509
24078
  const requestInput = {
23510
24079
  bearerToken: String(input["bearerToken"]),
24080
+ projectId: String(input["projectId"]),
23511
24081
  webhookId: String(input["webhookId"])
23512
24082
  };
23513
24083
  if (typeof input["url"] === "string") {
@@ -23526,7 +24096,7 @@ function createWebhookMcpTools(api) {
23526
24096
  webhook: await api.updateWebhook(requestInput)
23527
24097
  };
23528
24098
  } catch (error) {
23529
- mapMcpError14(error);
24099
+ mapMcpError16(error);
23530
24100
  }
23531
24101
  },
23532
24102
  async delete_webhook(input) {
@@ -23534,17 +24104,19 @@ function createWebhookMcpTools(api) {
23534
24104
  return {
23535
24105
  webhook: await api.deleteWebhook({
23536
24106
  bearerToken: String(input["bearerToken"]),
24107
+ projectId: String(input["projectId"]),
23537
24108
  webhookId: String(input["webhookId"])
23538
24109
  })
23539
24110
  };
23540
24111
  } catch (error) {
23541
- mapMcpError14(error);
24112
+ mapMcpError16(error);
23542
24113
  }
23543
24114
  },
23544
24115
  async test_webhook(input) {
23545
24116
  try {
23546
24117
  const requestInput = {
23547
24118
  bearerToken: String(input["bearerToken"]),
24119
+ projectId: String(input["projectId"]),
23548
24120
  webhookId: String(input["webhookId"])
23549
24121
  };
23550
24122
  if (input["eventType"] === "verification.passed" || input["eventType"] === "verification.failed") {
@@ -23554,13 +24126,14 @@ function createWebhookMcpTools(api) {
23554
24126
  delivery: await api.testWebhook(requestInput)
23555
24127
  };
23556
24128
  } catch (error) {
23557
- mapMcpError14(error);
24129
+ mapMcpError16(error);
23558
24130
  }
23559
24131
  },
23560
24132
  async list_webhook_deliveries(input) {
23561
24133
  try {
23562
24134
  const requestInput = {
23563
24135
  bearerToken: String(input["bearerToken"]),
24136
+ projectId: String(input["projectId"]),
23564
24137
  webhookId: String(input["webhookId"])
23565
24138
  };
23566
24139
  if (typeof input["limit"] === "number") {
@@ -23570,25 +24143,26 @@ function createWebhookMcpTools(api) {
23570
24143
  deliveries: await api.listWebhookDeliveries(requestInput)
23571
24144
  };
23572
24145
  } catch (error) {
23573
- mapMcpError14(error);
24146
+ mapMcpError16(error);
23574
24147
  }
23575
24148
  },
23576
24149
  async retry_webhook_delivery(input) {
23577
24150
  try {
23578
24151
  return await api.retryWebhookDelivery({
23579
24152
  bearerToken: String(input["bearerToken"]),
24153
+ projectId: String(input["projectId"]),
23580
24154
  webhookId: String(input["webhookId"]),
23581
24155
  deliveryId: String(input["deliveryId"])
23582
24156
  });
23583
24157
  } catch (error) {
23584
- mapMcpError14(error);
24158
+ mapMcpError16(error);
23585
24159
  }
23586
24160
  }
23587
24161
  };
23588
24162
  }
23589
24163
 
23590
24164
  // src/weekly-report-tools.ts
23591
- function mapMcpError15(error) {
24165
+ function mapMcpError17(error) {
23592
24166
  if (error instanceof WeeklyReportApiError) {
23593
24167
  throw new Error(`mcp_tool_error:${error.code}`);
23594
24168
  }
@@ -23606,7 +24180,7 @@ function createWeeklyReportMcpTools(api) {
23606
24180
  })
23607
24181
  };
23608
24182
  } catch (error) {
23609
- mapMcpError15(error);
24183
+ mapMcpError17(error);
23610
24184
  }
23611
24185
  },
23612
24186
  async create_weekly_report_channel(input) {
@@ -23622,7 +24196,7 @@ function createWeeklyReportMcpTools(api) {
23622
24196
  })
23623
24197
  };
23624
24198
  } catch (error) {
23625
- mapMcpError15(error);
24199
+ mapMcpError17(error);
23626
24200
  }
23627
24201
  },
23628
24202
  async update_weekly_report_channel(input) {
@@ -23637,7 +24211,7 @@ function createWeeklyReportMcpTools(api) {
23637
24211
  })
23638
24212
  };
23639
24213
  } catch (error) {
23640
- mapMcpError15(error);
24214
+ mapMcpError17(error);
23641
24215
  }
23642
24216
  },
23643
24217
  async delete_weekly_report_channel(input) {
@@ -23649,7 +24223,7 @@ function createWeeklyReportMcpTools(api) {
23649
24223
  })
23650
24224
  };
23651
24225
  } catch (error) {
23652
- mapMcpError15(error);
24226
+ mapMcpError17(error);
23653
24227
  }
23654
24228
  }
23655
24229
  };
@@ -23697,6 +24271,7 @@ async function createDefaultMcpTools(input = {}) {
23697
24271
  ...retrievalApi,
23698
24272
  getLogs: (requestInput) => retrievalApi.listLogs(requestInput)
23699
24273
  }),
24274
+ ...createImprovementMcpTools(retrievalApi),
23700
24275
  ...createServicesMcpTools(retrievalApi),
23701
24276
  ...createTokenMcpTools(createTokenManagementApi(httpClient)),
23702
24277
  ...createWebhookMcpTools(createWebhookApi(httpClient)),
@@ -23705,6 +24280,7 @@ async function createDefaultMcpTools(input = {}) {
23705
24280
  ...createAlertMcpTools(createAlertApi(httpClient)),
23706
24281
  ...createProjectMcpTools(createProjectManagementApi(httpClient)),
23707
24282
  ...createCapturePolicyMcpTools(createCapturePolicyApi(httpClient)),
24283
+ ...createImprovementSettingsMcpTools(createImprovementSettingsApi(httpClient)),
23708
24284
  ...createProbeMcpTools(createProbeApi(httpClient)),
23709
24285
  ...createBillingMcpTools(createBillingApi(httpClient)),
23710
24286
  ...createMemberMcpTools(createMemberApi(httpClient)),
@@ -25027,6 +25603,10 @@ var incidentLookupInputSchema = external_exports.object({
25027
25603
  source: sourceSchema,
25028
25604
  incidentId: external_exports.string()
25029
25605
  });
25606
+ var improvementLookupInputSchema = external_exports.object({
25607
+ bearerToken: external_exports.string(),
25608
+ improvementId: external_exports.string()
25609
+ });
25030
25610
  var MCP_TOOL_CATALOG = [
25031
25611
  {
25032
25612
  name: "doctor",
@@ -25054,13 +25634,14 @@ var MCP_TOOL_CATALOG = [
25054
25634
  {
25055
25635
  name: "verify_cloud",
25056
25636
  group: "setup",
25057
- description: "Verify that a hosted project is sending data to DebugBundle.",
25637
+ description: "Verify hosted ingestion or actively prove hosted incident creation.",
25058
25638
  inputSchema: external_exports.object({
25059
25639
  projectId: external_exports.string(),
25060
25640
  service: external_exports.string().optional(),
25061
25641
  environment: external_exports.string().optional(),
25062
25642
  maxAgeMinutes: external_exports.number().optional(),
25063
25643
  trigger5xx: external_exports.boolean().optional(),
25644
+ trigger4xxStatus: external_exports.number().int().min(400).max(499).optional(),
25064
25645
  authFilePath: external_exports.string().optional()
25065
25646
  })
25066
25647
  },
@@ -25139,10 +25720,64 @@ var MCP_TOOL_CATALOG = [
25139
25720
  limit: external_exports.number().optional()
25140
25721
  })
25141
25722
  },
25723
+ {
25724
+ name: "list_improvements",
25725
+ group: "improvements",
25726
+ description: "List hosted improvement opportunities for the current workspace or a specific project.",
25727
+ inputSchema: external_exports.object({
25728
+ bearerToken: external_exports.string(),
25729
+ projectId: external_exports.string().optional(),
25730
+ environment: external_exports.string().optional(),
25731
+ service: external_exports.string().optional(),
25732
+ status: external_exports.string().optional(),
25733
+ severity: external_exports.string().optional(),
25734
+ kind: external_exports.string().optional(),
25735
+ cursor: external_exports.string().optional(),
25736
+ limit: external_exports.number().optional()
25737
+ })
25738
+ },
25739
+ {
25740
+ name: "get_improvement",
25741
+ group: "improvements",
25742
+ description: "Fetch a single hosted improvement opportunity by id.",
25743
+ inputSchema: improvementLookupInputSchema
25744
+ },
25745
+ {
25746
+ name: "get_improvement_bundle",
25747
+ group: "improvements",
25748
+ description: "Fetch the hosted improvement bundle artifact for a project improvement opportunity.",
25749
+ inputSchema: external_exports.object({
25750
+ bearerToken: external_exports.string(),
25751
+ projectId: external_exports.string(),
25752
+ improvementId: external_exports.string()
25753
+ })
25754
+ },
25755
+ {
25756
+ name: "resolve_improvement",
25757
+ group: "improvements",
25758
+ description: "Resolve a hosted improvement opportunity.",
25759
+ inputSchema: improvementLookupInputSchema
25760
+ },
25761
+ {
25762
+ name: "reopen_improvement",
25763
+ group: "improvements",
25764
+ description: "Reopen a hosted improvement opportunity.",
25765
+ inputSchema: improvementLookupInputSchema
25766
+ },
25767
+ {
25768
+ name: "snooze_improvement",
25769
+ group: "improvements",
25770
+ description: "Snooze a hosted improvement opportunity until an ISO8601 timestamp.",
25771
+ inputSchema: external_exports.object({
25772
+ bearerToken: external_exports.string(),
25773
+ improvementId: external_exports.string(),
25774
+ snoozedUntil: external_exports.string()
25775
+ })
25776
+ },
25142
25777
  {
25143
25778
  name: "get_github_status",
25144
25779
  group: "github",
25145
- description: "Get the organization GitHub App installation status and optional project repo assignment.",
25780
+ description: "Get the project GitHub App installation status and optional project repo assignment.",
25146
25781
  inputSchema: external_exports.object({
25147
25782
  bearerToken: external_exports.string(),
25148
25783
  projectId: external_exports.string().optional()
@@ -25151,9 +25786,10 @@ var MCP_TOOL_CATALOG = [
25151
25786
  {
25152
25787
  name: "list_github_repositories",
25153
25788
  group: "github",
25154
- description: "List repositories available to the organization GitHub App installation.",
25789
+ description: "List repositories available to the project GitHub App installation for owner/admin callers.",
25155
25790
  inputSchema: external_exports.object({
25156
- bearerToken: external_exports.string()
25791
+ bearerToken: external_exports.string(),
25792
+ projectId: external_exports.string().optional()
25157
25793
  })
25158
25794
  },
25159
25795
  {
@@ -25219,7 +25855,7 @@ var MCP_TOOL_CATALOG = [
25219
25855
  inputSchema: external_exports.object({
25220
25856
  bearerToken: external_exports.string(),
25221
25857
  projectId: external_exports.string(),
25222
- status: external_exports.enum(["pending", "retrying", "delivered", "failed"]).optional(),
25858
+ status: external_exports.enum(["pending", "retrying", "delivered", "failed", "skipped"]).optional(),
25223
25859
  limit: external_exports.number().optional()
25224
25860
  })
25225
25861
  },
@@ -25339,6 +25975,7 @@ var MCP_TOOL_CATALOG = [
25339
25975
  description: "Update a webhook endpoint.",
25340
25976
  inputSchema: external_exports.object({
25341
25977
  bearerToken: external_exports.string(),
25978
+ projectId: external_exports.string(),
25342
25979
  webhookId: external_exports.string(),
25343
25980
  url: external_exports.string().optional(),
25344
25981
  events: external_exports.array(external_exports.string()).optional(),
@@ -25352,6 +25989,7 @@ var MCP_TOOL_CATALOG = [
25352
25989
  description: "Delete a webhook endpoint.",
25353
25990
  inputSchema: external_exports.object({
25354
25991
  bearerToken: external_exports.string(),
25992
+ projectId: external_exports.string(),
25355
25993
  webhookId: external_exports.string()
25356
25994
  })
25357
25995
  },
@@ -25361,6 +25999,7 @@ var MCP_TOOL_CATALOG = [
25361
25999
  description: "Queue a synthetic webhook delivery.",
25362
26000
  inputSchema: external_exports.object({
25363
26001
  bearerToken: external_exports.string(),
26002
+ projectId: external_exports.string(),
25364
26003
  webhookId: external_exports.string(),
25365
26004
  eventType: verificationEventTypeSchema.optional()
25366
26005
  })
@@ -25371,6 +26010,7 @@ var MCP_TOOL_CATALOG = [
25371
26010
  description: "List deliveries for a webhook endpoint.",
25372
26011
  inputSchema: external_exports.object({
25373
26012
  bearerToken: external_exports.string(),
26013
+ projectId: external_exports.string(),
25374
26014
  webhookId: external_exports.string(),
25375
26015
  limit: external_exports.number().optional()
25376
26016
  })
@@ -25381,6 +26021,7 @@ var MCP_TOOL_CATALOG = [
25381
26021
  description: "Retry a webhook delivery.",
25382
26022
  inputSchema: external_exports.object({
25383
26023
  bearerToken: external_exports.string(),
26024
+ projectId: external_exports.string(),
25384
26025
  webhookId: external_exports.string(),
25385
26026
  deliveryId: external_exports.string()
25386
26027
  })
@@ -25499,6 +26140,7 @@ var MCP_TOOL_CATALOG = [
25499
26140
  description: "Update an alert rule.",
25500
26141
  inputSchema: external_exports.object({
25501
26142
  bearerToken: external_exports.string(),
26143
+ projectId: external_exports.string(),
25502
26144
  alertId: external_exports.string(),
25503
26145
  serviceId: external_exports.string().nullable().optional(),
25504
26146
  channel: external_exports.string().optional(),
@@ -25514,6 +26156,7 @@ var MCP_TOOL_CATALOG = [
25514
26156
  description: "Delete an alert rule.",
25515
26157
  inputSchema: external_exports.object({
25516
26158
  bearerToken: external_exports.string(),
26159
+ projectId: external_exports.string(),
25517
26160
  alertId: external_exports.string()
25518
26161
  })
25519
26162
  },
@@ -25584,6 +26227,28 @@ var MCP_TOOL_CATALOG = [
25584
26227
  })
25585
26228
  })
25586
26229
  },
26230
+ {
26231
+ name: "get_improvement_settings",
26232
+ group: "improvement_settings",
26233
+ description: "Get automated improvement settings for a project.",
26234
+ inputSchema: external_exports.object({
26235
+ bearerToken: external_exports.string(),
26236
+ projectId: external_exports.string()
26237
+ })
26238
+ },
26239
+ {
26240
+ name: "update_improvement_settings",
26241
+ group: "improvement_settings",
26242
+ description: "Update automated improvement settings for a project.",
26243
+ inputSchema: external_exports.object({
26244
+ bearerToken: external_exports.string(),
26245
+ projectId: external_exports.string(),
26246
+ update: external_exports.object({
26247
+ automated_improvement_bundles_enabled: external_exports.boolean().optional(),
26248
+ improvement_bundle_sensitivity: external_exports.enum(["high_confidence", "balanced", "verbose"]).optional()
26249
+ })
26250
+ })
26251
+ },
25587
26252
  {
25588
26253
  name: "activate_probe",
25589
26254
  group: "probes",
@@ -25652,56 +26317,62 @@ var MCP_TOOL_CATALOG = [
25652
26317
  })
25653
26318
  },
25654
26319
  {
25655
- name: "list_members",
26320
+ name: "list_project_members",
25656
26321
  group: "members",
25657
- description: "List organization members.",
26322
+ description: "List members for a project.",
25658
26323
  inputSchema: external_exports.object({
25659
- bearerToken: external_exports.string()
26324
+ bearerToken: external_exports.string(),
26325
+ projectId: external_exports.string()
25660
26326
  })
25661
26327
  },
25662
26328
  {
25663
- name: "list_member_invites",
26329
+ name: "list_project_member_invites",
25664
26330
  group: "members",
25665
- description: "List pending organization invites.",
26331
+ description: "List pending invites for a project.",
25666
26332
  inputSchema: external_exports.object({
25667
- bearerToken: external_exports.string()
26333
+ bearerToken: external_exports.string(),
26334
+ projectId: external_exports.string()
25668
26335
  })
25669
26336
  },
25670
26337
  {
25671
- name: "invite_member",
26338
+ name: "invite_project_member",
25672
26339
  group: "members",
25673
- description: "Invite a member to the organization.",
26340
+ description: "Invite a collaborator to a project.",
25674
26341
  inputSchema: external_exports.object({
25675
26342
  bearerToken: external_exports.string(),
26343
+ projectId: external_exports.string(),
25676
26344
  email: external_exports.string(),
25677
26345
  role: external_exports.string()
25678
26346
  })
25679
26347
  },
25680
26348
  {
25681
- name: "cancel_member_invite",
26349
+ name: "cancel_project_member_invite",
25682
26350
  group: "members",
25683
- description: "Cancel a pending organization invite.",
26351
+ description: "Cancel a pending project invite.",
25684
26352
  inputSchema: external_exports.object({
25685
26353
  bearerToken: external_exports.string(),
26354
+ projectId: external_exports.string(),
25686
26355
  inviteId: external_exports.string()
25687
26356
  })
25688
26357
  },
25689
26358
  {
25690
- name: "update_member_role",
26359
+ name: "update_project_member_role",
25691
26360
  group: "members",
25692
- description: "Update the role of an organization member.",
26361
+ description: "Update the role of a project collaborator.",
25693
26362
  inputSchema: external_exports.object({
25694
26363
  bearerToken: external_exports.string(),
26364
+ projectId: external_exports.string(),
25695
26365
  userId: external_exports.string(),
25696
26366
  role: external_exports.string()
25697
26367
  })
25698
26368
  },
25699
26369
  {
25700
- name: "remove_member",
26370
+ name: "remove_project_member",
25701
26371
  group: "members",
25702
- description: "Remove a member from the organization.",
26372
+ description: "Remove a collaborator from a project.",
25703
26373
  inputSchema: external_exports.object({
25704
26374
  bearerToken: external_exports.string(),
26375
+ projectId: external_exports.string(),
25705
26376
  userId: external_exports.string()
25706
26377
  })
25707
26378
  },