@debugbundle/mcp 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.cjs CHANGED
@@ -15103,6 +15103,7 @@ var ProjectRecordSchema = external_exports.object({
15103
15103
  relationship: external_exports.enum(["owned", "shared"]),
15104
15104
  sharing_state: external_exports.enum(["private", "shared_by_you", "shared_with_you"]),
15105
15105
  effective_role: external_exports.enum(["owner", "admin", "member"]),
15106
+ shared_access_suspended: external_exports.boolean().optional(),
15106
15107
  name: external_exports.string(),
15107
15108
  slug: external_exports.string(),
15108
15109
  environment_default: external_exports.string(),
@@ -15125,6 +15126,7 @@ var DeletedProjectRecordSchema = external_exports.object({
15125
15126
  relationship: external_exports.enum(["owned", "shared"]),
15126
15127
  sharing_state: external_exports.enum(["private", "shared_by_you", "shared_with_you"]),
15127
15128
  effective_role: external_exports.enum(["owner", "admin", "member"]),
15129
+ shared_access_suspended: external_exports.boolean().optional(),
15128
15130
  name: external_exports.string(),
15129
15131
  slug: external_exports.string(),
15130
15132
  environment_default: external_exports.string(),
@@ -15326,6 +15328,9 @@ var IncidentsResponseSchema = external_exports.object({
15326
15328
  var IncidentResponseSchema = external_exports.object({
15327
15329
  incident: IncidentSchema
15328
15330
  }).strict();
15331
+ var BulkIncidentResponseSchema = external_exports.object({
15332
+ incidents: external_exports.array(IncidentSchema)
15333
+ }).strict();
15329
15334
  var ImprovementResponseSchema = external_exports.object({
15330
15335
  improvement: ImprovementSchema
15331
15336
  }).strict();
@@ -15532,6 +15537,20 @@ function createRetrievalApi(client) {
15532
15537
  );
15533
15538
  return parsed.incident;
15534
15539
  },
15540
+ async resolveIncidents(input) {
15541
+ const parsed = await expectParsed(
15542
+ client.request({
15543
+ method: "POST",
15544
+ path: "/v1/incidents/resolve",
15545
+ bearerToken: input.bearerToken,
15546
+ body: {
15547
+ incident_ids: input.incidentIds
15548
+ }
15549
+ }),
15550
+ BulkIncidentResponseSchema
15551
+ );
15552
+ return parsed.incidents;
15553
+ },
15535
15554
  async reopenIncident(input) {
15536
15555
  const parsed = await expectParsed(
15537
15556
  client.request({
@@ -15543,6 +15562,20 @@ function createRetrievalApi(client) {
15543
15562
  );
15544
15563
  return parsed.incident;
15545
15564
  },
15565
+ async reopenIncidents(input) {
15566
+ const parsed = await expectParsed(
15567
+ client.request({
15568
+ method: "POST",
15569
+ path: "/v1/incidents/reopen",
15570
+ bearerToken: input.bearerToken,
15571
+ body: {
15572
+ incident_ids: input.incidentIds
15573
+ }
15574
+ }),
15575
+ BulkIncidentResponseSchema
15576
+ );
15577
+ return parsed.incidents;
15578
+ },
15546
15579
  async getBundle(input) {
15547
15580
  const bundle = await expectParsed(
15548
15581
  client.request({
@@ -20963,7 +20996,8 @@ var STORAGE_BOOTSTRAP_STATEMENTS = [
20963
20996
  `
20964
20997
  CREATE TABLE github_dispatch_deliveries (
20965
20998
  id uuid PRIMARY KEY,
20966
- rule_id uuid NOT NULL REFERENCES github_dispatch_rules(id) ON DELETE CASCADE,
20999
+ rule_id uuid NOT NULL,
21000
+ rule_name text NOT NULL,
20967
21001
  project_id uuid NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
20968
21002
  incident_id uuid REFERENCES incidents(id) ON DELETE CASCADE,
20969
21003
  improvement_opportunity_id uuid REFERENCES improvement_opportunities(id) ON DELETE CASCADE,
@@ -21051,6 +21085,26 @@ var STORAGE_BOOTSTRAP_STATEMENTS = [
21051
21085
  `
21052
21086
  CREATE INDEX trial_lifecycle_events_org_event_created_idx
21053
21087
  ON trial_lifecycle_events (organization_id, event_type, created_at DESC)
21088
+ `,
21089
+ `
21090
+ CREATE TABLE plan_cleanup_tasks (
21091
+ id uuid PRIMARY KEY,
21092
+ organization_id uuid NOT NULL REFERENCES organizations(id) ON DELETE CASCADE,
21093
+ project_id uuid NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
21094
+ cleanup_type text NOT NULL
21095
+ CHECK (cleanup_type IN ('delete_improvement_bundle_objects')),
21096
+ attempt_count integer NOT NULL DEFAULT 0,
21097
+ last_error text,
21098
+ next_attempt_at timestamptz NOT NULL DEFAULT now(),
21099
+ completed_at timestamptz,
21100
+ created_at timestamptz NOT NULL DEFAULT now(),
21101
+ updated_at timestamptz NOT NULL DEFAULT now(),
21102
+ UNIQUE (project_id, cleanup_type)
21103
+ )
21104
+ `,
21105
+ `
21106
+ CREATE INDEX plan_cleanup_tasks_pending_idx
21107
+ ON plan_cleanup_tasks (completed_at, next_attempt_at, created_at)
21054
21108
  `
21055
21109
  ];
21056
21110
 
@@ -21702,6 +21756,50 @@ var STORAGE_SCHEMA_MIGRATIONS = [
21702
21756
  )
21703
21757
  `
21704
21758
  ]
21759
+ }),
21760
+ defineStorageSchemaMigration({
21761
+ id: "202606050001_preserve_github_dispatch_history_when_rules_are_deleted",
21762
+ description: "Snapshot GitHub rule names onto deliveries and decouple delivery history from live rule rows.",
21763
+ statements: [
21764
+ "ALTER TABLE github_dispatch_deliveries ADD COLUMN IF NOT EXISTS rule_name text",
21765
+ `
21766
+ UPDATE github_dispatch_deliveries deliveries
21767
+ SET rule_name = rules.name
21768
+ FROM github_dispatch_rules rules
21769
+ WHERE deliveries.rule_id = rules.id
21770
+ AND deliveries.rule_name IS NULL
21771
+ `,
21772
+ "ALTER TABLE github_dispatch_deliveries ALTER COLUMN rule_name SET DEFAULT ''",
21773
+ "UPDATE github_dispatch_deliveries SET rule_name = '' WHERE rule_name IS NULL",
21774
+ "ALTER TABLE github_dispatch_deliveries ALTER COLUMN rule_name SET NOT NULL",
21775
+ "ALTER TABLE github_dispatch_deliveries DROP CONSTRAINT IF EXISTS github_dispatch_deliveries_rule_id_fkey"
21776
+ ]
21777
+ }),
21778
+ defineStorageSchemaMigration({
21779
+ id: "202606050002_add_durable_plan_cleanup_tasks",
21780
+ description: "Persist retryable external cleanup tasks for side effects that cannot be completed transactionally.",
21781
+ statements: [
21782
+ `
21783
+ CREATE TABLE IF NOT EXISTS plan_cleanup_tasks (
21784
+ id uuid PRIMARY KEY,
21785
+ organization_id uuid NOT NULL REFERENCES organizations(id) ON DELETE CASCADE,
21786
+ project_id uuid NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
21787
+ cleanup_type text NOT NULL
21788
+ CHECK (cleanup_type IN ('delete_improvement_bundle_objects')),
21789
+ attempt_count integer NOT NULL DEFAULT 0,
21790
+ last_error text,
21791
+ next_attempt_at timestamptz NOT NULL DEFAULT now(),
21792
+ completed_at timestamptz,
21793
+ created_at timestamptz NOT NULL DEFAULT now(),
21794
+ updated_at timestamptz NOT NULL DEFAULT now(),
21795
+ UNIQUE (project_id, cleanup_type)
21796
+ )
21797
+ `,
21798
+ `
21799
+ CREATE INDEX IF NOT EXISTS plan_cleanup_tasks_pending_idx
21800
+ ON plan_cleanup_tasks (completed_at, next_attempt_at, created_at)
21801
+ `
21802
+ ]
21705
21803
  })
21706
21804
  ];
21707
21805
 
@@ -26312,6 +26410,67 @@ function createRetrievalMcpTools(api) {
26312
26410
  mapMcpError12(error);
26313
26411
  }
26314
26412
  },
26413
+ async resolve_incidents(input) {
26414
+ try {
26415
+ const incidentIds = Array.from(
26416
+ new Set((Array.isArray(input["incidentIds"]) ? input["incidentIds"] : []).map((value) => String(value)))
26417
+ );
26418
+ const localIncidents = /* @__PURE__ */ new Map();
26419
+ const cloudIncidentIds = [];
26420
+ if (await shouldUseLocalSource(input)) {
26421
+ return {
26422
+ incidents: await Promise.all(
26423
+ incidentIds.map((incidentId) => resolveLocalIncident({ incidentId }))
26424
+ )
26425
+ };
26426
+ }
26427
+ if (await shouldCombineLocalAndCloudSource(input)) {
26428
+ for (const incidentId of incidentIds) {
26429
+ try {
26430
+ localIncidents.set(incidentId, await resolveLocalIncident({ incidentId }));
26431
+ } catch (error) {
26432
+ if (!isNotFoundRetrievalError(error)) {
26433
+ throw error;
26434
+ }
26435
+ cloudIncidentIds.push(incidentId);
26436
+ }
26437
+ }
26438
+ } else {
26439
+ cloudIncidentIds.push(...incidentIds);
26440
+ }
26441
+ if (cloudIncidentIds.length > 0) {
26442
+ const cloudIncidents = api.resolveIncidents === void 0 ? await Promise.all(
26443
+ cloudIncidentIds.map(
26444
+ async (incidentId) => attachSourceToRecord(
26445
+ await api.resolveIncident({
26446
+ bearerToken: await requireCloudBearerToken(input),
26447
+ incidentId
26448
+ }),
26449
+ "cloud"
26450
+ )
26451
+ )
26452
+ ) : (await api.resolveIncidents({
26453
+ bearerToken: await requireCloudBearerToken(input),
26454
+ incidentIds: cloudIncidentIds
26455
+ })).map((incident) => attachSourceToRecord(incident, "cloud"));
26456
+ for (const incident of cloudIncidents) {
26457
+ await syncCloudIncidentCacheStatus({
26458
+ incidentId: String(incident["incident_id"]),
26459
+ incident: {
26460
+ ...typeof incident["status"] === "string" ? { status: incident["status"] } : {},
26461
+ resolved_at: typeof incident["resolved_at"] === "string" || incident["resolved_at"] === null ? incident["resolved_at"] : null
26462
+ }
26463
+ });
26464
+ localIncidents.set(String(incident["incident_id"]), incident);
26465
+ }
26466
+ }
26467
+ return {
26468
+ incidents: incidentIds.map((incidentId) => localIncidents.get(incidentId))
26469
+ };
26470
+ } catch (error) {
26471
+ mapMcpError12(error);
26472
+ }
26473
+ },
26315
26474
  async reopen_incident(input) {
26316
26475
  try {
26317
26476
  if (await shouldUseLocalSource(input)) {
@@ -26357,6 +26516,67 @@ function createRetrievalMcpTools(api) {
26357
26516
  mapMcpError12(error);
26358
26517
  }
26359
26518
  },
26519
+ async reopen_incidents(input) {
26520
+ try {
26521
+ const incidentIds = Array.from(
26522
+ new Set((Array.isArray(input["incidentIds"]) ? input["incidentIds"] : []).map((value) => String(value)))
26523
+ );
26524
+ const localIncidents = /* @__PURE__ */ new Map();
26525
+ const cloudIncidentIds = [];
26526
+ if (await shouldUseLocalSource(input)) {
26527
+ return {
26528
+ incidents: await Promise.all(
26529
+ incidentIds.map((incidentId) => reopenLocalIncident({ incidentId }))
26530
+ )
26531
+ };
26532
+ }
26533
+ if (await shouldCombineLocalAndCloudSource(input)) {
26534
+ for (const incidentId of incidentIds) {
26535
+ try {
26536
+ localIncidents.set(incidentId, await reopenLocalIncident({ incidentId }));
26537
+ } catch (error) {
26538
+ if (!isNotFoundRetrievalError(error)) {
26539
+ throw error;
26540
+ }
26541
+ cloudIncidentIds.push(incidentId);
26542
+ }
26543
+ }
26544
+ } else {
26545
+ cloudIncidentIds.push(...incidentIds);
26546
+ }
26547
+ if (cloudIncidentIds.length > 0) {
26548
+ const cloudIncidents = api.reopenIncidents === void 0 ? await Promise.all(
26549
+ cloudIncidentIds.map(
26550
+ async (incidentId) => attachSourceToRecord(
26551
+ await api.reopenIncident({
26552
+ bearerToken: await requireCloudBearerToken(input),
26553
+ incidentId
26554
+ }),
26555
+ "cloud"
26556
+ )
26557
+ )
26558
+ ) : (await api.reopenIncidents({
26559
+ bearerToken: await requireCloudBearerToken(input),
26560
+ incidentIds: cloudIncidentIds
26561
+ })).map((incident) => attachSourceToRecord(incident, "cloud"));
26562
+ for (const incident of cloudIncidents) {
26563
+ await syncCloudIncidentCacheStatus({
26564
+ incidentId: String(incident["incident_id"]),
26565
+ incident: {
26566
+ ...typeof incident["status"] === "string" ? { status: incident["status"] } : {},
26567
+ resolved_at: null
26568
+ }
26569
+ });
26570
+ localIncidents.set(String(incident["incident_id"]), incident);
26571
+ }
26572
+ }
26573
+ return {
26574
+ incidents: incidentIds.map((incidentId) => localIncidents.get(incidentId))
26575
+ };
26576
+ } catch (error) {
26577
+ mapMcpError12(error);
26578
+ }
26579
+ },
26360
26580
  async get_bundle(input) {
26361
26581
  try {
26362
26582
  if (await shouldUseLocalSource(input)) {
@@ -28266,7 +28486,7 @@ var zodToJsonSchema = (schema, options) => {
28266
28486
  var package_default = {
28267
28487
  name: "@debugbundle/mcp",
28268
28488
  mcpName: "com.debugbundle/mcp",
28269
- version: "1.1.0",
28489
+ version: "1.1.1",
28270
28490
  private: false,
28271
28491
  description: "Model Context Protocol server for DebugBundle",
28272
28492
  license: "AGPL-3.0-only",
@@ -28328,6 +28548,11 @@ var incidentLookupInputSchema = external_exports.object({
28328
28548
  source: sourceSchema,
28329
28549
  incidentId: external_exports.string()
28330
28550
  });
28551
+ var bulkIncidentLookupInputSchema = external_exports.object({
28552
+ bearerToken: optionalBearerTokenSchema,
28553
+ source: sourceSchema,
28554
+ incidentIds: external_exports.array(external_exports.string()).min(1).max(1e3)
28555
+ });
28331
28556
  var improvementLookupInputSchema = external_exports.object({
28332
28557
  bearerToken: external_exports.string(),
28333
28558
  improvementId: external_exports.string()
@@ -28415,12 +28640,24 @@ var MCP_TOOL_CATALOG = [
28415
28640
  description: "Resolve an incident by incident id.",
28416
28641
  inputSchema: incidentLookupInputSchema
28417
28642
  },
28643
+ {
28644
+ name: "resolve_incidents",
28645
+ group: "retrieval",
28646
+ description: "Resolve incidents in bulk by incident id.",
28647
+ inputSchema: bulkIncidentLookupInputSchema
28648
+ },
28418
28649
  {
28419
28650
  name: "reopen_incident",
28420
28651
  group: "retrieval",
28421
- description: "Reopen a locally stored resolved incident.",
28652
+ description: "Reopen an incident by incident id.",
28422
28653
  inputSchema: incidentLookupInputSchema
28423
28654
  },
28655
+ {
28656
+ name: "reopen_incidents",
28657
+ group: "retrieval",
28658
+ description: "Reopen incidents in bulk by incident id.",
28659
+ inputSchema: bulkIncidentLookupInputSchema
28660
+ },
28424
28661
  {
28425
28662
  name: "get_bundle",
28426
28663
  group: "retrieval",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@debugbundle/mcp",
3
3
  "mcpName": "com.debugbundle/mcp",
4
- "version": "1.1.0",
4
+ "version": "1.1.1",
5
5
  "private": false,
6
6
  "description": "Model Context Protocol server for DebugBundle",
7
7
  "license": "AGPL-3.0-only",
package/server.json CHANGED
@@ -8,13 +8,13 @@
8
8
  "source": "github",
9
9
  "subfolder": "apps/mcp"
10
10
  },
11
- "version": "1.1.0",
11
+ "version": "1.1.1",
12
12
  "packages": [
13
13
  {
14
14
  "registryType": "npm",
15
15
  "registryBaseUrl": "https://registry.npmjs.org",
16
16
  "identifier": "@debugbundle/mcp",
17
- "version": "1.1.0",
17
+ "version": "1.1.1",
18
18
  "transport": {
19
19
  "type": "stdio"
20
20
  },