@debugbundle/mcp 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.cjs +263 -54
- package/package.json +1 -1
- package/server.json +2 -2
package/dist/main.cjs
CHANGED
|
@@ -14475,6 +14475,7 @@ var AlertSchema = external_exports.object({
|
|
|
14475
14475
|
channel: AlertChannelSchema,
|
|
14476
14476
|
condition_type: AlertConditionTypeSchema,
|
|
14477
14477
|
severity_min: external_exports.enum(["low", "medium", "high", "critical"]).nullable(),
|
|
14478
|
+
cooldown_seconds: external_exports.number().int().min(0),
|
|
14478
14479
|
config: external_exports.record(external_exports.string(), external_exports.unknown()),
|
|
14479
14480
|
is_enabled: external_exports.boolean(),
|
|
14480
14481
|
created_at: external_exports.string(),
|
|
@@ -14561,6 +14562,9 @@ function createAlertApi(client) {
|
|
|
14561
14562
|
if (input.severityMin !== void 0) {
|
|
14562
14563
|
body.severity_min = input.severityMin;
|
|
14563
14564
|
}
|
|
14565
|
+
if (input.cooldownSeconds !== void 0) {
|
|
14566
|
+
body.cooldown_seconds = input.cooldownSeconds;
|
|
14567
|
+
}
|
|
14564
14568
|
if (input.isEnabled !== void 0) {
|
|
14565
14569
|
body.is_enabled = input.isEnabled;
|
|
14566
14570
|
}
|
|
@@ -14587,6 +14591,9 @@ function createAlertApi(client) {
|
|
|
14587
14591
|
if (input.severityMin !== void 0) {
|
|
14588
14592
|
body.severity_min = input.severityMin;
|
|
14589
14593
|
}
|
|
14594
|
+
if (input.cooldownSeconds !== void 0) {
|
|
14595
|
+
body.cooldown_seconds = input.cooldownSeconds;
|
|
14596
|
+
}
|
|
14590
14597
|
if (input.config !== void 0) {
|
|
14591
14598
|
body.config = input.config;
|
|
14592
14599
|
}
|
|
@@ -17117,8 +17124,24 @@ var BrowserExceptionEventSchema = external_exports.object({
|
|
|
17117
17124
|
column_number: external_exports.number().int().nonnegative().nullable(),
|
|
17118
17125
|
target: external_exports.object({
|
|
17119
17126
|
tag_name: external_exports.string().nullable(),
|
|
17120
|
-
source_url: external_exports.string().nullable()
|
|
17121
|
-
|
|
17127
|
+
source_url: external_exports.string().nullable(),
|
|
17128
|
+
attributes: external_exports.object({
|
|
17129
|
+
rel: external_exports.string().optional(),
|
|
17130
|
+
as: external_exports.string().optional(),
|
|
17131
|
+
type: external_exports.string().optional(),
|
|
17132
|
+
media: external_exports.string().optional(),
|
|
17133
|
+
cross_origin: external_exports.string().optional(),
|
|
17134
|
+
async: external_exports.boolean().optional(),
|
|
17135
|
+
defer: external_exports.boolean().optional(),
|
|
17136
|
+
integrity_present: external_exports.boolean().optional()
|
|
17137
|
+
}).strict().optional()
|
|
17138
|
+
}).strict().nullable(),
|
|
17139
|
+
page: external_exports.object({
|
|
17140
|
+
url: external_exports.string().nullable(),
|
|
17141
|
+
referrer: external_exports.string().nullable(),
|
|
17142
|
+
ready_state: external_exports.enum(["loading", "interactive", "complete"]).nullable(),
|
|
17143
|
+
visibility_state: external_exports.enum(["visible", "hidden", "prerender", "unloaded"]).nullable()
|
|
17144
|
+
}).strict().optional(),
|
|
17122
17145
|
opaque: external_exports.boolean()
|
|
17123
17146
|
}).strict();
|
|
17124
17147
|
var FrontendExceptionPayloadSchema = external_exports.object({
|
|
@@ -20638,6 +20661,7 @@ var STORAGE_BOOTSTRAP_STATEMENTS = [
|
|
|
20638
20661
|
channel text NOT NULL,
|
|
20639
20662
|
condition_type text NOT NULL,
|
|
20640
20663
|
severity_min text,
|
|
20664
|
+
cooldown_seconds integer NOT NULL DEFAULT 0,
|
|
20641
20665
|
config jsonb NOT NULL DEFAULT '{}'::jsonb,
|
|
20642
20666
|
is_enabled boolean NOT NULL DEFAULT true,
|
|
20643
20667
|
created_at timestamptz NOT NULL DEFAULT now(),
|
|
@@ -20676,6 +20700,7 @@ var STORAGE_BOOTSTRAP_STATEMENTS = [
|
|
|
20676
20700
|
incident_id uuid NOT NULL REFERENCES incidents(id) ON DELETE CASCADE,
|
|
20677
20701
|
condition_type text NOT NULL,
|
|
20678
20702
|
dedupe_key text NOT NULL,
|
|
20703
|
+
notification_key text NOT NULL DEFAULT '',
|
|
20679
20704
|
channel text NOT NULL,
|
|
20680
20705
|
status text NOT NULL,
|
|
20681
20706
|
payload jsonb NOT NULL,
|
|
@@ -20690,6 +20715,10 @@ var STORAGE_BOOTSTRAP_STATEMENTS = [
|
|
|
20690
20715
|
CREATE INDEX alert_deliveries_project_status_idx
|
|
20691
20716
|
ON alert_deliveries (project_id, status, created_at DESC)
|
|
20692
20717
|
`,
|
|
20718
|
+
`
|
|
20719
|
+
CREATE INDEX alert_deliveries_alert_notification_idx
|
|
20720
|
+
ON alert_deliveries (alert_id, notification_key, created_at DESC)
|
|
20721
|
+
`,
|
|
20693
20722
|
`
|
|
20694
20723
|
CREATE TABLE alert_email_digests (
|
|
20695
20724
|
id uuid PRIMARY KEY,
|
|
@@ -20722,6 +20751,7 @@ var STORAGE_BOOTSTRAP_STATEMENTS = [
|
|
|
20722
20751
|
incident_id uuid NOT NULL REFERENCES incidents(id) ON DELETE CASCADE,
|
|
20723
20752
|
condition_type text NOT NULL,
|
|
20724
20753
|
dedupe_key text NOT NULL,
|
|
20754
|
+
notification_key text NOT NULL DEFAULT '',
|
|
20725
20755
|
payload jsonb NOT NULL,
|
|
20726
20756
|
created_at timestamptz NOT NULL DEFAULT now(),
|
|
20727
20757
|
UNIQUE (alert_id, incident_id, dedupe_key)
|
|
@@ -20731,6 +20761,10 @@ var STORAGE_BOOTSTRAP_STATEMENTS = [
|
|
|
20731
20761
|
CREATE INDEX alert_email_digest_items_digest_created_idx
|
|
20732
20762
|
ON alert_email_digest_items (digest_id, created_at ASC)
|
|
20733
20763
|
`,
|
|
20764
|
+
`
|
|
20765
|
+
CREATE INDEX alert_email_digest_items_alert_notification_idx
|
|
20766
|
+
ON alert_email_digest_items (alert_id, notification_key, created_at DESC)
|
|
20767
|
+
`,
|
|
20734
20768
|
`
|
|
20735
20769
|
CREATE TABLE agent_webhooks (
|
|
20736
20770
|
id uuid PRIMARY KEY,
|
|
@@ -20782,6 +20816,19 @@ var STORAGE_BOOTSTRAP_STATEMENTS = [
|
|
|
20782
20816
|
processed_at timestamptz NOT NULL DEFAULT now()
|
|
20783
20817
|
)
|
|
20784
20818
|
`,
|
|
20819
|
+
`
|
|
20820
|
+
CREATE TABLE processed_github_marketplace_events (
|
|
20821
|
+
delivery_id text PRIMARY KEY,
|
|
20822
|
+
event_name text NOT NULL,
|
|
20823
|
+
marketplace_account_id bigint,
|
|
20824
|
+
action text,
|
|
20825
|
+
processed_at timestamptz NOT NULL DEFAULT now()
|
|
20826
|
+
)
|
|
20827
|
+
`,
|
|
20828
|
+
`
|
|
20829
|
+
CREATE INDEX processed_github_marketplace_events_account_idx
|
|
20830
|
+
ON processed_github_marketplace_events (marketplace_account_id, processed_at DESC)
|
|
20831
|
+
`,
|
|
20785
20832
|
`
|
|
20786
20833
|
CREATE TABLE github_installations (
|
|
20787
20834
|
id uuid PRIMARY KEY,
|
|
@@ -20799,6 +20846,41 @@ var STORAGE_BOOTSTRAP_STATEMENTS = [
|
|
|
20799
20846
|
CREATE INDEX github_installations_status_idx
|
|
20800
20847
|
ON github_installations (status)
|
|
20801
20848
|
`,
|
|
20849
|
+
`
|
|
20850
|
+
CREATE TABLE github_marketplace_accounts (
|
|
20851
|
+
id uuid PRIMARY KEY,
|
|
20852
|
+
organization_id uuid REFERENCES organizations(id) ON DELETE SET NULL,
|
|
20853
|
+
marketplace_account_id bigint NOT NULL UNIQUE,
|
|
20854
|
+
marketplace_account_login text NOT NULL,
|
|
20855
|
+
marketplace_account_type text NOT NULL CHECK (marketplace_account_type IN ('Organization', 'User')),
|
|
20856
|
+
marketplace_account_node_id text,
|
|
20857
|
+
marketplace_listing_plan_id bigint NOT NULL,
|
|
20858
|
+
marketplace_listing_plan_name text NOT NULL,
|
|
20859
|
+
marketplace_plan_price_model text,
|
|
20860
|
+
billing_cycle text CHECK (billing_cycle IN ('monthly', 'yearly')),
|
|
20861
|
+
unit_count integer,
|
|
20862
|
+
on_free_trial boolean NOT NULL DEFAULT false,
|
|
20863
|
+
free_trial_ends_on timestamptz,
|
|
20864
|
+
next_billing_date timestamptz,
|
|
20865
|
+
effective_date timestamptz NOT NULL,
|
|
20866
|
+
installation_id bigint,
|
|
20867
|
+
marketplace_purchase_status text NOT NULL
|
|
20868
|
+
CHECK (marketplace_purchase_status IN ('purchased', 'cancelled', 'pending_change', 'pending_change_cancelled', 'changed')),
|
|
20869
|
+
last_event_id text NOT NULL,
|
|
20870
|
+
last_event_action text NOT NULL,
|
|
20871
|
+
created_at timestamptz NOT NULL DEFAULT now(),
|
|
20872
|
+
updated_at timestamptz NOT NULL DEFAULT now()
|
|
20873
|
+
)
|
|
20874
|
+
`,
|
|
20875
|
+
`
|
|
20876
|
+
CREATE INDEX github_marketplace_accounts_org_idx
|
|
20877
|
+
ON github_marketplace_accounts (organization_id, updated_at DESC)
|
|
20878
|
+
`,
|
|
20879
|
+
`
|
|
20880
|
+
CREATE UNIQUE INDEX github_marketplace_accounts_installation_idx
|
|
20881
|
+
ON github_marketplace_accounts (installation_id)
|
|
20882
|
+
WHERE installation_id IS NOT NULL
|
|
20883
|
+
`,
|
|
20802
20884
|
`
|
|
20803
20885
|
CREATE TABLE project_github_repos (
|
|
20804
20886
|
id uuid PRIMARY KEY,
|
|
@@ -21398,6 +21480,86 @@ var STORAGE_SCHEMA_MIGRATIONS = [
|
|
|
21398
21480
|
ON capture_rules (project_id, updated_at DESC)
|
|
21399
21481
|
`
|
|
21400
21482
|
]
|
|
21483
|
+
}),
|
|
21484
|
+
defineStorageSchemaMigration({
|
|
21485
|
+
id: "202606020001_add_github_marketplace_tracking",
|
|
21486
|
+
description: "Add GitHub Marketplace purchase tracking tables and webhook idempotency ledger.",
|
|
21487
|
+
statements: [
|
|
21488
|
+
`
|
|
21489
|
+
CREATE TABLE IF NOT EXISTS processed_github_marketplace_events (
|
|
21490
|
+
delivery_id text PRIMARY KEY,
|
|
21491
|
+
event_name text NOT NULL,
|
|
21492
|
+
marketplace_account_id bigint,
|
|
21493
|
+
action text,
|
|
21494
|
+
processed_at timestamptz NOT NULL DEFAULT now()
|
|
21495
|
+
)
|
|
21496
|
+
`,
|
|
21497
|
+
`
|
|
21498
|
+
CREATE INDEX IF NOT EXISTS processed_github_marketplace_events_account_idx
|
|
21499
|
+
ON processed_github_marketplace_events (marketplace_account_id, processed_at DESC)
|
|
21500
|
+
`,
|
|
21501
|
+
`
|
|
21502
|
+
CREATE TABLE IF NOT EXISTS github_marketplace_accounts (
|
|
21503
|
+
id uuid PRIMARY KEY,
|
|
21504
|
+
organization_id uuid REFERENCES organizations(id) ON DELETE SET NULL,
|
|
21505
|
+
marketplace_account_id bigint NOT NULL UNIQUE,
|
|
21506
|
+
marketplace_account_login text NOT NULL,
|
|
21507
|
+
marketplace_account_type text NOT NULL CHECK (marketplace_account_type IN ('Organization', 'User')),
|
|
21508
|
+
marketplace_account_node_id text,
|
|
21509
|
+
marketplace_listing_plan_id bigint NOT NULL,
|
|
21510
|
+
marketplace_listing_plan_name text NOT NULL,
|
|
21511
|
+
marketplace_plan_price_model text,
|
|
21512
|
+
billing_cycle text CHECK (billing_cycle IN ('monthly', 'yearly')),
|
|
21513
|
+
unit_count integer,
|
|
21514
|
+
on_free_trial boolean NOT NULL DEFAULT false,
|
|
21515
|
+
free_trial_ends_on timestamptz,
|
|
21516
|
+
next_billing_date timestamptz,
|
|
21517
|
+
effective_date timestamptz NOT NULL,
|
|
21518
|
+
installation_id bigint,
|
|
21519
|
+
marketplace_purchase_status text NOT NULL
|
|
21520
|
+
CHECK (marketplace_purchase_status IN ('purchased', 'cancelled', 'pending_change', 'pending_change_cancelled', 'changed')),
|
|
21521
|
+
last_event_id text NOT NULL,
|
|
21522
|
+
last_event_action text NOT NULL,
|
|
21523
|
+
created_at timestamptz NOT NULL DEFAULT now(),
|
|
21524
|
+
updated_at timestamptz NOT NULL DEFAULT now()
|
|
21525
|
+
)
|
|
21526
|
+
`,
|
|
21527
|
+
`
|
|
21528
|
+
CREATE INDEX IF NOT EXISTS github_marketplace_accounts_org_idx
|
|
21529
|
+
ON github_marketplace_accounts (organization_id, updated_at DESC)
|
|
21530
|
+
`,
|
|
21531
|
+
`
|
|
21532
|
+
CREATE UNIQUE INDEX IF NOT EXISTS github_marketplace_accounts_installation_idx
|
|
21533
|
+
ON github_marketplace_accounts (installation_id)
|
|
21534
|
+
WHERE installation_id IS NOT NULL
|
|
21535
|
+
`
|
|
21536
|
+
]
|
|
21537
|
+
}),
|
|
21538
|
+
defineStorageSchemaMigration({
|
|
21539
|
+
id: "202606030001_add_alert_notification_cooldowns_and_rule_window",
|
|
21540
|
+
description: "Add configurable alert cooldown windows and notification keys for cross-incident suppression.",
|
|
21541
|
+
statements: [
|
|
21542
|
+
"ALTER TABLE alert_rules ADD COLUMN IF NOT EXISTS cooldown_seconds integer",
|
|
21543
|
+
"UPDATE alert_rules SET cooldown_seconds = 0 WHERE cooldown_seconds IS NULL",
|
|
21544
|
+
"ALTER TABLE alert_rules ALTER COLUMN cooldown_seconds SET DEFAULT 0",
|
|
21545
|
+
"ALTER TABLE alert_rules ALTER COLUMN cooldown_seconds SET NOT NULL",
|
|
21546
|
+
"ALTER TABLE alert_deliveries ADD COLUMN IF NOT EXISTS notification_key text",
|
|
21547
|
+
"UPDATE alert_deliveries SET notification_key = dedupe_key WHERE notification_key IS NULL",
|
|
21548
|
+
"ALTER TABLE alert_deliveries ALTER COLUMN notification_key SET DEFAULT ''",
|
|
21549
|
+
"ALTER TABLE alert_deliveries ALTER COLUMN notification_key SET NOT NULL",
|
|
21550
|
+
`
|
|
21551
|
+
CREATE INDEX IF NOT EXISTS alert_deliveries_alert_notification_idx
|
|
21552
|
+
ON alert_deliveries (alert_id, notification_key, created_at DESC)
|
|
21553
|
+
`,
|
|
21554
|
+
"ALTER TABLE alert_email_digest_items ADD COLUMN IF NOT EXISTS notification_key text",
|
|
21555
|
+
"UPDATE alert_email_digest_items SET notification_key = dedupe_key WHERE notification_key IS NULL",
|
|
21556
|
+
"ALTER TABLE alert_email_digest_items ALTER COLUMN notification_key SET DEFAULT ''",
|
|
21557
|
+
"ALTER TABLE alert_email_digest_items ALTER COLUMN notification_key SET NOT NULL",
|
|
21558
|
+
`
|
|
21559
|
+
CREATE INDEX IF NOT EXISTS alert_email_digest_items_alert_notification_idx
|
|
21560
|
+
ON alert_email_digest_items (alert_id, notification_key, created_at DESC)
|
|
21561
|
+
`
|
|
21562
|
+
]
|
|
21401
21563
|
})
|
|
21402
21564
|
];
|
|
21403
21565
|
|
|
@@ -21521,7 +21683,8 @@ function normalizeRouteTemplate(path) {
|
|
|
21521
21683
|
return normalizedSegments.length === 0 ? "/" : `/${normalizedSegments.join("/")}`;
|
|
21522
21684
|
}
|
|
21523
21685
|
function isBrowserSdkFallbackFrame(frame) {
|
|
21524
|
-
|
|
21686
|
+
const normalizedFrame = frame.toLowerCase();
|
|
21687
|
+
return normalizedFrame.includes("onerror") && (normalizedFrame.includes("debugbundle-browser-sdk") || normalizedFrame.includes("debugbundle-browser.js") || normalizedFrame.includes("wp-content/plugins/debugbundle/"));
|
|
21525
21688
|
}
|
|
21526
21689
|
function deriveFirstApplicationFrame(errorContext) {
|
|
21527
21690
|
const firstFrame = errorContext?.top_frames[0];
|
|
@@ -21566,6 +21729,20 @@ function isOpaqueBrowserError(errorContext, browserEvent) {
|
|
|
21566
21729
|
const firstFrame = errorContext?.top_frames[0];
|
|
21567
21730
|
return errorContext?.message === "Window error" && firstFrame !== void 0 && isBrowserSdkFallbackFrame(firstFrame);
|
|
21568
21731
|
}
|
|
21732
|
+
function stableJson2(value) {
|
|
21733
|
+
if (value === null || typeof value !== "object") {
|
|
21734
|
+
return JSON.stringify(value);
|
|
21735
|
+
}
|
|
21736
|
+
if (Array.isArray(value)) {
|
|
21737
|
+
return `[${value.map((entry) => stableJson2(entry)).join(",")}]`;
|
|
21738
|
+
}
|
|
21739
|
+
const record = value;
|
|
21740
|
+
const keys = Object.keys(record).sort();
|
|
21741
|
+
return `{${keys.map((key) => `${JSON.stringify(key)}:${stableJson2(record[key])}`).join(",")}}`;
|
|
21742
|
+
}
|
|
21743
|
+
function buildFrontendBreadcrumbKey(input) {
|
|
21744
|
+
return `${input.breadcrumb_type}:${input.ts}:${input.route ?? ""}:${stableJson2(input.data)}`;
|
|
21745
|
+
}
|
|
21569
21746
|
function buildErrorContext(envelopes, incident, primarySignalEnvelope) {
|
|
21570
21747
|
if (primarySignalEnvelope !== null && isBackendExceptionEnvelope(primarySignalEnvelope)) {
|
|
21571
21748
|
return {
|
|
@@ -21827,6 +22004,7 @@ function buildLogsContext(envelopes) {
|
|
|
21827
22004
|
};
|
|
21828
22005
|
}
|
|
21829
22006
|
function buildFrontendContext(envelopes) {
|
|
22007
|
+
const breadcrumbs = /* @__PURE__ */ new Map();
|
|
21830
22008
|
const routeChanges = [];
|
|
21831
22009
|
const clicks = [];
|
|
21832
22010
|
const formSubmissions = [];
|
|
@@ -21835,54 +22013,24 @@ function buildFrontendContext(envelopes) {
|
|
|
21835
22013
|
const exceptions = [];
|
|
21836
22014
|
for (const envelope of envelopes) {
|
|
21837
22015
|
if (isFrontendBreadcrumbEnvelope(envelope)) {
|
|
21838
|
-
const
|
|
21839
|
-
|
|
21840
|
-
|
|
21841
|
-
|
|
21842
|
-
|
|
21843
|
-
}
|
|
21844
|
-
|
|
21845
|
-
|
|
21846
|
-
|
|
21847
|
-
|
|
21848
|
-
ts: timestamp
|
|
21849
|
-
});
|
|
21850
|
-
}
|
|
21851
|
-
if (envelope.payload.breadcrumb_type === "form_submit") {
|
|
21852
|
-
formSubmissions.push({
|
|
21853
|
-
form: typeof envelope.payload.data["form"] === "string" ? envelope.payload.data["form"] : "unknown",
|
|
21854
|
-
fields: envelope.payload.data["fields"] !== null && typeof envelope.payload.data["fields"] === "object" ? envelope.payload.data["fields"] : {},
|
|
21855
|
-
ts: timestamp
|
|
21856
|
-
});
|
|
21857
|
-
}
|
|
21858
|
-
if (envelope.payload.breadcrumb_type === "console_log") {
|
|
21859
|
-
consoleLogs.push({
|
|
21860
|
-
ts: timestamp,
|
|
21861
|
-
...envelope.payload.data
|
|
21862
|
-
});
|
|
21863
|
-
}
|
|
21864
|
-
if (envelope.payload.breadcrumb_type === "network_request") {
|
|
21865
|
-
const d = envelope.payload.data;
|
|
22016
|
+
const entry = {
|
|
22017
|
+
breadcrumb_type: envelope.payload.breadcrumb_type,
|
|
22018
|
+
route: envelope.payload.route,
|
|
22019
|
+
data: envelope.payload.data,
|
|
22020
|
+
ts: toIsoTimestamp(envelope.occurred_at)
|
|
22021
|
+
};
|
|
22022
|
+
breadcrumbs.set(buildFrontendBreadcrumbKey(entry), entry);
|
|
22023
|
+
}
|
|
22024
|
+
if (isFrontendExceptionEnvelope(envelope)) {
|
|
22025
|
+
for (const breadcrumb of envelope.payload.breadcrumbs ?? []) {
|
|
21866
22026
|
const entry = {
|
|
21867
|
-
|
|
21868
|
-
|
|
21869
|
-
|
|
21870
|
-
ts:
|
|
22027
|
+
breadcrumb_type: breadcrumb.breadcrumb_type,
|
|
22028
|
+
route: breadcrumb.route,
|
|
22029
|
+
data: breadcrumb.data,
|
|
22030
|
+
ts: toIsoTimestamp(breadcrumb.ts)
|
|
21871
22031
|
};
|
|
21872
|
-
|
|
21873
|
-
if (Array.isArray(d["caller_trace"])) entry.caller_trace = d["caller_trace"];
|
|
21874
|
-
if (d["response_body"] !== void 0) entry.response_body = d["response_body"];
|
|
21875
|
-
if (d["request_body"] !== void 0) entry.request_body = d["request_body"];
|
|
21876
|
-
if (typeof d["response_headers"] === "object" && d["response_headers"] !== null) {
|
|
21877
|
-
entry.response_headers = d["response_headers"];
|
|
21878
|
-
}
|
|
21879
|
-
if (typeof d["response_content_length"] === "number") {
|
|
21880
|
-
entry.response_content_length = d["response_content_length"];
|
|
21881
|
-
}
|
|
21882
|
-
networkRequests.push(entry);
|
|
22032
|
+
breadcrumbs.set(buildFrontendBreadcrumbKey(entry), entry);
|
|
21883
22033
|
}
|
|
21884
|
-
}
|
|
21885
|
-
if (isFrontendExceptionEnvelope(envelope)) {
|
|
21886
22034
|
exceptions.push({
|
|
21887
22035
|
name: envelope.payload.name,
|
|
21888
22036
|
message: envelope.payload.message,
|
|
@@ -21893,6 +22041,59 @@ function buildFrontendContext(envelopes) {
|
|
|
21893
22041
|
});
|
|
21894
22042
|
}
|
|
21895
22043
|
}
|
|
22044
|
+
const sortedBreadcrumbs = [...breadcrumbs.values()].sort((left, right) => {
|
|
22045
|
+
const timestampComparison = left.ts.localeCompare(right.ts);
|
|
22046
|
+
if (timestampComparison !== 0) {
|
|
22047
|
+
return timestampComparison;
|
|
22048
|
+
}
|
|
22049
|
+
return buildFrontendBreadcrumbKey(left).localeCompare(buildFrontendBreadcrumbKey(right));
|
|
22050
|
+
});
|
|
22051
|
+
for (const breadcrumb of sortedBreadcrumbs) {
|
|
22052
|
+
if (breadcrumb.breadcrumb_type === "route_change") {
|
|
22053
|
+
const from = typeof breadcrumb.data["from"] === "string" ? breadcrumb.data["from"] : "unknown";
|
|
22054
|
+
const to = typeof breadcrumb.data["to"] === "string" ? breadcrumb.data["to"] : breadcrumb.route ?? "unknown";
|
|
22055
|
+
routeChanges.push({ from, to, ts: breadcrumb.ts });
|
|
22056
|
+
}
|
|
22057
|
+
if (breadcrumb.breadcrumb_type === "click") {
|
|
22058
|
+
clicks.push({
|
|
22059
|
+
selector: typeof breadcrumb.data["selector"] === "string" ? breadcrumb.data["selector"] : "unknown",
|
|
22060
|
+
label: typeof breadcrumb.data["label"] === "string" ? breadcrumb.data["label"] : "unknown",
|
|
22061
|
+
ts: breadcrumb.ts
|
|
22062
|
+
});
|
|
22063
|
+
}
|
|
22064
|
+
if (breadcrumb.breadcrumb_type === "form_submit") {
|
|
22065
|
+
formSubmissions.push({
|
|
22066
|
+
form: typeof breadcrumb.data["form"] === "string" ? breadcrumb.data["form"] : "unknown",
|
|
22067
|
+
fields: breadcrumb.data["fields"] !== null && typeof breadcrumb.data["fields"] === "object" ? breadcrumb.data["fields"] : {},
|
|
22068
|
+
ts: breadcrumb.ts
|
|
22069
|
+
});
|
|
22070
|
+
}
|
|
22071
|
+
if (breadcrumb.breadcrumb_type === "console_log") {
|
|
22072
|
+
consoleLogs.push({
|
|
22073
|
+
ts: breadcrumb.ts,
|
|
22074
|
+
...breadcrumb.data
|
|
22075
|
+
});
|
|
22076
|
+
}
|
|
22077
|
+
if (breadcrumb.breadcrumb_type === "network_request") {
|
|
22078
|
+
const entry = {
|
|
22079
|
+
method: typeof breadcrumb.data["method"] === "string" ? breadcrumb.data["method"] : "GET",
|
|
22080
|
+
url: typeof breadcrumb.data["url"] === "string" ? breadcrumb.data["url"] : "unknown",
|
|
22081
|
+
status: typeof breadcrumb.data["status_code"] === "number" && Number.isInteger(breadcrumb.data["status_code"]) ? breadcrumb.data["status_code"] : typeof breadcrumb.data["status"] === "number" && Number.isInteger(breadcrumb.data["status"]) ? breadcrumb.data["status"] : 0,
|
|
22082
|
+
ts: breadcrumb.ts
|
|
22083
|
+
};
|
|
22084
|
+
if (typeof breadcrumb.data["duration_ms"] === "number") entry.duration_ms = breadcrumb.data["duration_ms"];
|
|
22085
|
+
if (Array.isArray(breadcrumb.data["caller_trace"])) entry.caller_trace = breadcrumb.data["caller_trace"];
|
|
22086
|
+
if (breadcrumb.data["response_body"] !== void 0) entry.response_body = breadcrumb.data["response_body"];
|
|
22087
|
+
if (breadcrumb.data["request_body"] !== void 0) entry.request_body = breadcrumb.data["request_body"];
|
|
22088
|
+
if (typeof breadcrumb.data["response_headers"] === "object" && breadcrumb.data["response_headers"] !== null) {
|
|
22089
|
+
entry.response_headers = breadcrumb.data["response_headers"];
|
|
22090
|
+
}
|
|
22091
|
+
if (typeof breadcrumb.data["response_content_length"] === "number") {
|
|
22092
|
+
entry.response_content_length = breadcrumb.data["response_content_length"];
|
|
22093
|
+
}
|
|
22094
|
+
networkRequests.push(entry);
|
|
22095
|
+
}
|
|
22096
|
+
}
|
|
21896
22097
|
const latestFrontendException = selectLatestEnvelopeByType(envelopes, isFrontendExceptionEnvelope);
|
|
21897
22098
|
const domContext = latestFrontendException?.payload.dom_context ?? null;
|
|
21898
22099
|
if (routeChanges.length === 0 && clicks.length === 0 && formSubmissions.length === 0 && consoleLogs.length === 0 && networkRequests.length === 0 && exceptions.length === 0 && domContext === null) {
|
|
@@ -22042,7 +22243,7 @@ function buildBundle(input) {
|
|
|
22042
22243
|
const serviceRuntime = input.incident.service_runtime ?? selectLatestEnvelope(sourceEnvelopes, (envelope) => envelope.event_type !== "probe_event")?.service.runtime ?? null;
|
|
22043
22244
|
const serviceFramework = input.incident.service_framework ?? selectLatestEnvelope(sourceEnvelopes, (envelope) => envelope.event_type !== "probe_event")?.service.framework ?? null;
|
|
22044
22245
|
const customerVisible = frontendContext !== null;
|
|
22045
|
-
const firstApplicationFrame = deriveFirstApplicationFrame(errorContext);
|
|
22246
|
+
const firstApplicationFrame = opaqueBrowserError ? null : deriveFirstApplicationFrame(errorContext);
|
|
22046
22247
|
const summaryGuidance = buildSummaryGuidance({
|
|
22047
22248
|
errorContext,
|
|
22048
22249
|
requestContext,
|
|
@@ -22575,20 +22776,20 @@ function mergeSourceEvents(existingEvents, nextEvents) {
|
|
|
22575
22776
|
}
|
|
22576
22777
|
return [...merged.values()].sort(compareEventEnvelopes);
|
|
22577
22778
|
}
|
|
22578
|
-
function
|
|
22779
|
+
function stableJson3(value) {
|
|
22579
22780
|
if (value === null || typeof value !== "object") {
|
|
22580
22781
|
return JSON.stringify(value);
|
|
22581
22782
|
}
|
|
22582
22783
|
if (Array.isArray(value)) {
|
|
22583
|
-
return `[${value.map((entry) =>
|
|
22784
|
+
return `[${value.map((entry) => stableJson3(entry)).join(",")}]`;
|
|
22584
22785
|
}
|
|
22585
22786
|
const record = value;
|
|
22586
22787
|
const keys = Object.keys(record).sort();
|
|
22587
|
-
return `{${keys.map((key) => `${JSON.stringify(key)}:${
|
|
22788
|
+
return `{${keys.map((key) => `${JSON.stringify(key)}:${stableJson3(record[key])}`).join(",")}}`;
|
|
22588
22789
|
}
|
|
22589
22790
|
function buildRequestAnomalyFingerprint(input) {
|
|
22590
22791
|
return (0, import_node_crypto4.createHash)("sha256").update(
|
|
22591
|
-
|
|
22792
|
+
stableJson3({
|
|
22592
22793
|
kind: "request_status_anomaly",
|
|
22593
22794
|
project_id: input.projectId,
|
|
22594
22795
|
service_name: input.serviceName,
|
|
@@ -24682,6 +24883,9 @@ function createAlertMcpTools(api) {
|
|
|
24682
24883
|
if (typeof input["severityMin"] === "string") {
|
|
24683
24884
|
requestInput.severityMin = input["severityMin"];
|
|
24684
24885
|
}
|
|
24886
|
+
if (typeof input["cooldownSeconds"] === "number") {
|
|
24887
|
+
requestInput.cooldownSeconds = input["cooldownSeconds"];
|
|
24888
|
+
}
|
|
24685
24889
|
if (typeof input["isEnabled"] === "boolean") {
|
|
24686
24890
|
requestInput.isEnabled = input["isEnabled"];
|
|
24687
24891
|
}
|
|
@@ -24713,6 +24917,9 @@ function createAlertMcpTools(api) {
|
|
|
24713
24917
|
} else if (input["severityMin"] === null) {
|
|
24714
24918
|
requestInput.severityMin = null;
|
|
24715
24919
|
}
|
|
24920
|
+
if (typeof input["cooldownSeconds"] === "number") {
|
|
24921
|
+
requestInput.cooldownSeconds = input["cooldownSeconds"];
|
|
24922
|
+
}
|
|
24716
24923
|
if (typeof input["config"] === "object") {
|
|
24717
24924
|
requestInput.config = input["config"];
|
|
24718
24925
|
}
|
|
@@ -27898,7 +28105,7 @@ var zodToJsonSchema = (schema, options) => {
|
|
|
27898
28105
|
var package_default = {
|
|
27899
28106
|
name: "@debugbundle/mcp",
|
|
27900
28107
|
mcpName: "com.debugbundle/mcp",
|
|
27901
|
-
version: "1.0.
|
|
28108
|
+
version: "1.0.2",
|
|
27902
28109
|
private: false,
|
|
27903
28110
|
description: "Model Context Protocol server for DebugBundle",
|
|
27904
28111
|
license: "AGPL-3.0-only",
|
|
@@ -28488,6 +28695,7 @@ var MCP_TOOL_CATALOG = [
|
|
|
28488
28695
|
channel: external_exports.string(),
|
|
28489
28696
|
conditionType: external_exports.string(),
|
|
28490
28697
|
severityMin: external_exports.string().optional(),
|
|
28698
|
+
cooldownSeconds: external_exports.number().int().min(0).max(604800).optional(),
|
|
28491
28699
|
config: jsonObjectSchema,
|
|
28492
28700
|
isEnabled: external_exports.boolean().optional()
|
|
28493
28701
|
})
|
|
@@ -28504,6 +28712,7 @@ var MCP_TOOL_CATALOG = [
|
|
|
28504
28712
|
channel: external_exports.string().optional(),
|
|
28505
28713
|
conditionType: external_exports.string().optional(),
|
|
28506
28714
|
severityMin: external_exports.string().nullable().optional(),
|
|
28715
|
+
cooldownSeconds: external_exports.number().int().min(0).max(604800).optional(),
|
|
28507
28716
|
config: jsonObjectSchema.nullable().optional(),
|
|
28508
28717
|
isEnabled: external_exports.boolean().optional()
|
|
28509
28718
|
})
|
package/package.json
CHANGED
package/server.json
CHANGED
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
"source": "github",
|
|
9
9
|
"subfolder": "apps/mcp"
|
|
10
10
|
},
|
|
11
|
-
"version": "1.0.
|
|
11
|
+
"version": "1.0.2",
|
|
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.
|
|
17
|
+
"version": "1.0.2",
|
|
18
18
|
"transport": {
|
|
19
19
|
"type": "stdio"
|
|
20
20
|
},
|