@debugbundle/mcp 1.0.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.cjs CHANGED
@@ -14628,8 +14628,22 @@ var BillingUsageMetricSchema = external_exports.object({
14628
14628
  used: external_exports.number().int().nonnegative(),
14629
14629
  limit: external_exports.number().int().nonnegative()
14630
14630
  }).strict();
14631
+ var BillingStateSchema = external_exports.enum(["active", "past_due", "canceled", "unpaid", "incomplete", "admin_override", "trialing", "trial_expired"]).nullable();
14632
+ var BillingTrialPlanSchema = external_exports.enum(["solo", "team"]);
14633
+ var BillingTrialSummarySchema = external_exports.object({
14634
+ available: external_exports.boolean(),
14635
+ active: external_exports.boolean(),
14636
+ plan: BillingTrialPlanSchema.nullable(),
14637
+ started_at: external_exports.string().nullable(),
14638
+ ends_at: external_exports.string().nullable(),
14639
+ used_at: external_exports.string().nullable(),
14640
+ converted_at: external_exports.string().nullable(),
14641
+ expired_at: external_exports.string().nullable(),
14642
+ days_remaining: external_exports.number().int().nullable()
14643
+ }).strict();
14631
14644
  var BillingSummarySchema = external_exports.object({
14632
14645
  plan: external_exports.enum(["free", "solo", "team"]),
14646
+ billing_state: BillingStateSchema,
14633
14647
  stripe_customer_id: external_exports.string().nullable(),
14634
14648
  active_projects: external_exports.number().int().nonnegative(),
14635
14649
  capacity_units: external_exports.object({
@@ -14653,7 +14667,8 @@ var BillingSummarySchema = external_exports.object({
14653
14667
  monthly_remote_activations: BillingUsageMetricSchema,
14654
14668
  monthly_alert_deliveries: BillingUsageMetricSchema,
14655
14669
  monthly_webhook_deliveries: BillingUsageMetricSchema
14656
- }).strict()
14670
+ }).strict(),
14671
+ trial: BillingTrialSummarySchema
14657
14672
  }).strict();
14658
14673
  var BillingSummaryResponseSchema = external_exports.object({
14659
14674
  billing: BillingSummarySchema
@@ -14699,6 +14714,18 @@ function createBillingApi(client) {
14699
14714
  })
14700
14715
  );
14701
14716
  },
14717
+ async startTrial(input) {
14718
+ return expectBilling(
14719
+ client.request({
14720
+ method: "POST",
14721
+ path: "/v1/billing/trial/start",
14722
+ bearerToken: input.bearerToken,
14723
+ body: {
14724
+ target_plan: input.targetPlan
14725
+ }
14726
+ })
14727
+ );
14728
+ },
14702
14729
  async increaseCapacity(input) {
14703
14730
  return expectBilling(
14704
14731
  client.request({
@@ -17569,10 +17596,11 @@ function buildSkill() {
17569
17596
  "When the user reports a bug, runtime failure, production incident, regression, broken deploy, or unknown error, start here before reading arbitrary source files.",
17570
17597
  "",
17571
17598
  "1. Run `debugbundle doctor --json` to learn whether the project is local-only or connected and whether the local scaffold is healthy.",
17572
- "2. List actionable failures with `debugbundle incidents --source local --status open --json` for local data, or `debugbundle incidents --source cloud --status open --json` when the issue came from a hosted environment.",
17573
- "3. Inspect the chosen incident with `debugbundle inspect <incident-id> --source <local|cloud> --json` and `debugbundle explain <incident-id> --source <local|cloud> --json`.",
17574
- "4. Fetch evidence before editing code: `debugbundle bundle <incident-id> --source <local|cloud> --json` and `debugbundle reproduce <incident-id> --source <local|cloud> --json`.",
17575
- "5. If local SDK or relay events have landed but no bundle exists yet, run `debugbundle process --preset <minimal|balanced|investigative> --json` and then list incidents again.",
17599
+ "2. If `debugbundle doctor --json` reports `mode=local-only`, start with `debugbundle incidents --source local --status open --json`.",
17600
+ "3. If `debugbundle doctor --json` reports `mode=connected` and the target environment is cloud-enabled, check both `debugbundle incidents --source local --status open --json` and `debugbundle incidents --source cloud --status open --json` unless the user explicitly scoped the issue to local-only development. For user-reported production incidents, check cloud incidents after local incidents and explicitly report whether each source had matches.",
17601
+ "4. Inspect the chosen incident with `debugbundle inspect <incident-id> --source <local|cloud> --json` and `debugbundle explain <incident-id> --source <local|cloud> --json`.",
17602
+ "5. Fetch evidence before editing code: `debugbundle bundle <incident-id> --source <local|cloud> --json` and `debugbundle reproduce <incident-id> --source <local|cloud> --json`.",
17603
+ "6. If local SDK or relay events have landed but no bundle exists yet, run `debugbundle process --preset <minimal|balanced|investigative> --json` and then list incidents again.",
17576
17604
  "",
17577
17605
  "Key local paths:",
17578
17606
  "- `.debugbundle/profile.json` \u2014 project map, service paths, and validation state",
@@ -17857,7 +17885,8 @@ function buildSkillEvals() {
17857
17885
  name: "connected_incident_fetch",
17858
17886
  prompt: "The user says a production incident fired in the hosted DebugBundle project. Confirm the skill points the agent to the cloud retrieval path.",
17859
17887
  expected_behavior: [
17860
- "List cloud open incidents or use MCP list_incidents with source cloud.",
17888
+ "Check both local and cloud incident sources when the project is connected and the environment is cloud-enabled.",
17889
+ "Explicitly report whether the local source, the cloud source, or both had matches.",
17861
17890
  "Fetch inspect, context, bundle, and reproduction artifacts before editing code."
17862
17891
  ]
17863
17892
  }
@@ -20069,7 +20098,7 @@ var DEFAULT_PROCESSING_TIMEOUT_MS = 5 * 60 * 1e3;
20069
20098
  // ../../packages/storage/src/schema-migrations.ts
20070
20099
  var import_node_crypto3 = require("node:crypto");
20071
20100
 
20072
- // ../../packages/storage/src/migrations.ts
20101
+ // ../../packages/storage/src/storage-bootstrap-statements.ts
20073
20102
  var STORAGE_BOOTSTRAP_STATEMENTS = [
20074
20103
  `
20075
20104
  CREATE TABLE users (
@@ -20101,7 +20130,22 @@ var STORAGE_BOOTSTRAP_STATEMENTS = [
20101
20130
  billing_period_ends_at timestamptz,
20102
20131
  last_billing_sync_at timestamptz,
20103
20132
  last_billing_event_id text,
20104
- billing_period_starts_at timestamptz
20133
+ billing_period_starts_at timestamptz,
20134
+ trial_plan text CHECK (trial_plan IN ('solo', 'team') OR trial_plan IS NULL),
20135
+ trial_started_at timestamptz,
20136
+ trial_ends_at timestamptz,
20137
+ trial_used_at timestamptz,
20138
+ trial_converted_at timestamptz,
20139
+ trial_expired_at timestamptz,
20140
+ CONSTRAINT organizations_trial_window_check CHECK (
20141
+ trial_started_at IS NULL
20142
+ OR trial_ends_at IS NULL
20143
+ OR trial_ends_at > trial_started_at
20144
+ ),
20145
+ CONSTRAINT organizations_trial_started_requires_plan_check CHECK (
20146
+ trial_started_at IS NULL
20147
+ OR trial_plan IS NOT NULL
20148
+ )
20105
20149
  )
20106
20150
  `,
20107
20151
  `
@@ -20965,9 +21009,18 @@ var STORAGE_BOOTSTRAP_STATEMENTS = [
20965
21009
  CREATE TABLE operational_email_deliveries (
20966
21010
  id uuid PRIMARY KEY,
20967
21011
  organization_id uuid NOT NULL REFERENCES organizations(id) ON DELETE CASCADE,
20968
- project_id uuid NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
21012
+ project_id uuid REFERENCES projects(id) ON DELETE CASCADE,
20969
21013
  kind text NOT NULL
20970
- CHECK (kind IN ('webhook_auto_disabled', 'allowance_warning_80', 'allowance_limit_reached', 'retention_rotation_notice')),
21014
+ CHECK (kind IN (
21015
+ 'webhook_auto_disabled',
21016
+ 'allowance_warning_80',
21017
+ 'allowance_limit_reached',
21018
+ 'retention_rotation_notice',
21019
+ 'trial_started',
21020
+ 'trial_ending_soon',
21021
+ 'trial_expired',
21022
+ 'trial_converted'
21023
+ )),
20971
21024
  dedupe_key text NOT NULL,
20972
21025
  payload jsonb NOT NULL DEFAULT '{}'::jsonb,
20973
21026
  status text NOT NULL DEFAULT 'pending'
@@ -20984,8 +21037,24 @@ var STORAGE_BOOTSTRAP_STATEMENTS = [
20984
21037
  `
20985
21038
  CREATE INDEX operational_email_deliveries_status_next_attempt_idx
20986
21039
  ON operational_email_deliveries (status, next_attempt_at, created_at)
21040
+ `,
21041
+ `
21042
+ CREATE TABLE trial_lifecycle_events (
21043
+ id uuid PRIMARY KEY,
21044
+ organization_id uuid NOT NULL REFERENCES organizations(id) ON DELETE CASCADE,
21045
+ event_type text NOT NULL,
21046
+ dedupe_key text NOT NULL,
21047
+ created_at timestamptz NOT NULL DEFAULT now(),
21048
+ UNIQUE (organization_id, event_type, dedupe_key)
21049
+ )
21050
+ `,
21051
+ `
21052
+ CREATE INDEX trial_lifecycle_events_org_event_created_idx
21053
+ ON trial_lifecycle_events (organization_id, event_type, created_at DESC)
20987
21054
  `
20988
21055
  ];
21056
+
21057
+ // ../../packages/storage/src/migrations.ts
20989
21058
  var STORAGE_BOOTSTRAP_SQL = STORAGE_BOOTSTRAP_STATEMENTS.join(";\n\n");
20990
21059
 
20991
21060
  // ../../packages/storage/src/schema-migrations.ts
@@ -21041,9 +21110,7 @@ var STORAGE_SCHEMA_MIGRATIONS = [
21041
21110
  defineStorageSchemaMigration({
21042
21111
  id: "202605130001_allow_synthetic_webhook_test_deliveries_without_incident_fk",
21043
21112
  description: "Allow webhook test deliveries to persist without requiring a backing incidents row.",
21044
- statements: [
21045
- "ALTER TABLE webhook_deliveries ALTER COLUMN incident_id DROP NOT NULL"
21046
- ]
21113
+ statements: ["ALTER TABLE webhook_deliveries ALTER COLUMN incident_id DROP NOT NULL"]
21047
21114
  }),
21048
21115
  defineStorageSchemaMigration({
21049
21116
  id: "202605130002_add_slack_destinations",
@@ -21560,6 +21627,81 @@ var STORAGE_SCHEMA_MIGRATIONS = [
21560
21627
  ON alert_email_digest_items (alert_id, notification_key, created_at DESC)
21561
21628
  `
21562
21629
  ]
21630
+ }),
21631
+ defineStorageSchemaMigration({
21632
+ id: "202606040001_add_no_card_trial_billing_state",
21633
+ description: "Add organization no-card trial metadata and the lifecycle event ledger.",
21634
+ statements: [
21635
+ "ALTER TABLE organizations ADD COLUMN IF NOT EXISTS trial_plan text",
21636
+ "ALTER TABLE organizations ADD COLUMN IF NOT EXISTS trial_started_at timestamptz",
21637
+ "ALTER TABLE organizations ADD COLUMN IF NOT EXISTS trial_ends_at timestamptz",
21638
+ "ALTER TABLE organizations ADD COLUMN IF NOT EXISTS trial_used_at timestamptz",
21639
+ "ALTER TABLE organizations ADD COLUMN IF NOT EXISTS trial_converted_at timestamptz",
21640
+ "ALTER TABLE organizations ADD COLUMN IF NOT EXISTS trial_expired_at timestamptz",
21641
+ "ALTER TABLE organizations DROP CONSTRAINT IF EXISTS organizations_trial_plan_check",
21642
+ `
21643
+ ALTER TABLE organizations
21644
+ ADD CONSTRAINT organizations_trial_plan_check
21645
+ CHECK (trial_plan IN ('solo', 'team') OR trial_plan IS NULL)
21646
+ `,
21647
+ "ALTER TABLE organizations DROP CONSTRAINT IF EXISTS organizations_trial_window_check",
21648
+ `
21649
+ ALTER TABLE organizations
21650
+ ADD CONSTRAINT organizations_trial_window_check
21651
+ CHECK (
21652
+ trial_started_at IS NULL
21653
+ OR trial_ends_at IS NULL
21654
+ OR trial_ends_at > trial_started_at
21655
+ )
21656
+ `,
21657
+ "ALTER TABLE organizations DROP CONSTRAINT IF EXISTS organizations_trial_started_requires_plan_check",
21658
+ `
21659
+ ALTER TABLE organizations
21660
+ ADD CONSTRAINT organizations_trial_started_requires_plan_check
21661
+ CHECK (
21662
+ trial_started_at IS NULL
21663
+ OR trial_plan IS NOT NULL
21664
+ )
21665
+ `,
21666
+ `
21667
+ CREATE TABLE IF NOT EXISTS trial_lifecycle_events (
21668
+ id uuid PRIMARY KEY,
21669
+ organization_id uuid NOT NULL REFERENCES organizations(id) ON DELETE CASCADE,
21670
+ event_type text NOT NULL,
21671
+ dedupe_key text NOT NULL,
21672
+ created_at timestamptz NOT NULL DEFAULT now(),
21673
+ UNIQUE (organization_id, event_type, dedupe_key)
21674
+ )
21675
+ `,
21676
+ `
21677
+ CREATE INDEX IF NOT EXISTS trial_lifecycle_events_org_event_created_idx
21678
+ ON trial_lifecycle_events (organization_id, event_type, created_at DESC)
21679
+ `
21680
+ ]
21681
+ }),
21682
+ defineStorageSchemaMigration({
21683
+ id: "202606040002_expand_operational_emails_for_trial_lifecycle",
21684
+ description: "Allow operational email deliveries without a project and add no-card trial email kinds.",
21685
+ statements: [
21686
+ "ALTER TABLE operational_email_deliveries ALTER COLUMN project_id DROP NOT NULL",
21687
+ "ALTER TABLE operational_email_deliveries DROP CONSTRAINT IF EXISTS operational_email_deliveries_kind_check",
21688
+ `
21689
+ ALTER TABLE operational_email_deliveries
21690
+ ADD CONSTRAINT operational_email_deliveries_kind_check
21691
+ CHECK (
21692
+ kind IN (
21693
+ 'webhook_auto_disabled',
21694
+ 'allowance_warning_80',
21695
+ 'allowance_limit_reached',
21696
+ 'retention_rotation_notice',
21697
+ 'trial_started',
21698
+ 'trial_ending_soon',
21699
+ 'trial_expired',
21700
+ 'trial_converted'
21701
+ )
21702
+ )
21703
+ `
21704
+ ]
21563
21705
  })
21564
21706
  ];
21565
21707
 
@@ -24985,6 +25127,9 @@ function mapMcpError3(error) {
24985
25127
  if (error instanceof BillingApiError) {
24986
25128
  throw new Error(`mcp_tool_error:${error.code}`);
24987
25129
  }
25130
+ if (error instanceof Error && error.message.startsWith("mcp_tool_error:")) {
25131
+ throw error;
25132
+ }
24988
25133
  throw new Error("mcp_tool_error:unknown_error");
24989
25134
  }
24990
25135
  function createBillingMcpTools(api) {
@@ -25000,6 +25145,22 @@ function createBillingMcpTools(api) {
25000
25145
  mapMcpError3(error);
25001
25146
  }
25002
25147
  },
25148
+ async start_trial(input) {
25149
+ try {
25150
+ const targetPlan = input["targetPlan"] ?? input["target_plan"];
25151
+ if (targetPlan !== "solo" && targetPlan !== "team") {
25152
+ throw new Error("mcp_tool_error:invalid_arguments");
25153
+ }
25154
+ return {
25155
+ billing: await api.startTrial({
25156
+ bearerToken: String(input["bearerToken"]),
25157
+ targetPlan
25158
+ })
25159
+ };
25160
+ } catch (error) {
25161
+ mapMcpError3(error);
25162
+ }
25163
+ },
25003
25164
  async increase_capacity(input) {
25004
25165
  try {
25005
25166
  return {
@@ -28105,7 +28266,7 @@ var zodToJsonSchema = (schema, options) => {
28105
28266
  var package_default = {
28106
28267
  name: "@debugbundle/mcp",
28107
28268
  mcpName: "com.debugbundle/mcp",
28108
- version: "1.0.2",
28269
+ version: "1.1.0",
28109
28270
  private: false,
28110
28271
  description: "Model Context Protocol server for DebugBundle",
28111
28272
  license: "AGPL-3.0-only",
@@ -28916,6 +29077,15 @@ var MCP_TOOL_CATALOG = [
28916
29077
  bearerToken: external_exports.string()
28917
29078
  })
28918
29079
  },
29080
+ {
29081
+ name: "start_trial",
29082
+ group: "billing",
29083
+ description: "Start an eligible no-card trial for the organization.",
29084
+ inputSchema: external_exports.object({
29085
+ bearerToken: external_exports.string(),
29086
+ targetPlan: external_exports.enum(["solo", "team"])
29087
+ })
29088
+ },
28919
29089
  {
28920
29090
  name: "increase_capacity",
28921
29091
  group: "billing",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@debugbundle/mcp",
3
3
  "mcpName": "com.debugbundle/mcp",
4
- "version": "1.0.2",
4
+ "version": "1.1.0",
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.0.2",
11
+ "version": "1.1.0",
12
12
  "packages": [
13
13
  {
14
14
  "registryType": "npm",
15
15
  "registryBaseUrl": "https://registry.npmjs.org",
16
16
  "identifier": "@debugbundle/mcp",
17
- "version": "1.0.2",
17
+ "version": "1.1.0",
18
18
  "transport": {
19
19
  "type": "stdio"
20
20
  },