@debugbundle/mcp 1.1.1 → 1.2.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 +233 -38
- package/package.json +1 -1
- package/server.json +2 -2
package/dist/main.cjs
CHANGED
|
@@ -15094,7 +15094,7 @@ var ProjectMetricsSchema = external_exports.object({
|
|
|
15094
15094
|
monthly_raw_ingested_events: external_exports.number().int().nonnegative(),
|
|
15095
15095
|
retained_bundles: external_exports.number().int().nonnegative(),
|
|
15096
15096
|
monthly_alert_deliveries: external_exports.number().int().nonnegative()
|
|
15097
|
-
})
|
|
15097
|
+
});
|
|
15098
15098
|
var ProjectRecordSchema = external_exports.object({
|
|
15099
15099
|
project_id: external_exports.string(),
|
|
15100
15100
|
organization_id: external_exports.string(),
|
|
@@ -15111,13 +15111,13 @@ var ProjectRecordSchema = external_exports.object({
|
|
|
15111
15111
|
metrics: ProjectMetricsSchema,
|
|
15112
15112
|
created_at: external_exports.string(),
|
|
15113
15113
|
updated_at: external_exports.string()
|
|
15114
|
-
})
|
|
15114
|
+
});
|
|
15115
15115
|
var ProjectListResponseSchema = external_exports.object({
|
|
15116
15116
|
projects: external_exports.array(ProjectRecordSchema)
|
|
15117
|
-
})
|
|
15117
|
+
});
|
|
15118
15118
|
var ProjectCreateResponseSchema = external_exports.object({
|
|
15119
15119
|
project: ProjectRecordSchema
|
|
15120
|
-
})
|
|
15120
|
+
});
|
|
15121
15121
|
var DeletedProjectRecordSchema = external_exports.object({
|
|
15122
15122
|
project_id: external_exports.string(),
|
|
15123
15123
|
organization_id: external_exports.string(),
|
|
@@ -15133,10 +15133,10 @@ var DeletedProjectRecordSchema = external_exports.object({
|
|
|
15133
15133
|
organization_plan: external_exports.enum(["free", "solo", "team"]),
|
|
15134
15134
|
created_at: external_exports.string(),
|
|
15135
15135
|
updated_at: external_exports.string()
|
|
15136
|
-
})
|
|
15136
|
+
});
|
|
15137
15137
|
var ProjectDeleteResponseSchema = external_exports.object({
|
|
15138
15138
|
project: DeletedProjectRecordSchema
|
|
15139
|
-
})
|
|
15139
|
+
});
|
|
15140
15140
|
var ApiErrorResponseSchema4 = external_exports.object({
|
|
15141
15141
|
error: external_exports.string()
|
|
15142
15142
|
}).strict();
|
|
@@ -16501,25 +16501,74 @@ var CaptureProbeEventsSchema = external_exports.enum(CaptureProbeEventsValues);
|
|
|
16501
16501
|
var RequestSignalClassificationValues = ["incident_signal", "context_signal"];
|
|
16502
16502
|
var RequestSignalClassificationSchema = external_exports.enum(RequestSignalClassificationValues);
|
|
16503
16503
|
var RECOMMENDED_IMMEDIATE_CLIENT_ERROR_STATUSES = [401, 403, 409, 422];
|
|
16504
|
+
var HTTP_METHOD_VALUES = ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"];
|
|
16504
16505
|
var ImmediateClientErrorStatusSchema = external_exports.number().int().min(400).max(499);
|
|
16506
|
+
var HttpMethodSchema = external_exports.enum(HTTP_METHOD_VALUES);
|
|
16505
16507
|
function normalizeImmediateClientErrorStatuses(statuses) {
|
|
16506
16508
|
return Array.from(new Set(statuses)).sort((left, right) => left - right);
|
|
16507
16509
|
}
|
|
16508
16510
|
var ImmediateClientErrorStatusesSchema = external_exports.array(ImmediateClientErrorStatusSchema).max(12).transform((statuses) => normalizeImmediateClientErrorStatuses(statuses));
|
|
16511
|
+
function normalizePathPattern(value) {
|
|
16512
|
+
return value.trim().replace(/\/{2,}/g, "/");
|
|
16513
|
+
}
|
|
16514
|
+
function isValidPathPattern(value) {
|
|
16515
|
+
const normalized = normalizePathPattern(value);
|
|
16516
|
+
if (!normalized.startsWith("/") || normalized.includes("?") || normalized.includes("#")) {
|
|
16517
|
+
return false;
|
|
16518
|
+
}
|
|
16519
|
+
const wildcardIndex = normalized.indexOf("*");
|
|
16520
|
+
return wildcardIndex === -1 || wildcardIndex === normalized.length - 1;
|
|
16521
|
+
}
|
|
16522
|
+
function normalizeHttpMethods(methods) {
|
|
16523
|
+
if (methods === void 0 || methods.length === 0) {
|
|
16524
|
+
return [];
|
|
16525
|
+
}
|
|
16526
|
+
const normalized = methods.map((method) => method.toUpperCase()).filter(
|
|
16527
|
+
(method) => HTTP_METHOD_VALUES.includes(method)
|
|
16528
|
+
);
|
|
16529
|
+
return Array.from(new Set(normalized)).sort();
|
|
16530
|
+
}
|
|
16531
|
+
function normalizeImmediateClientErrorPathRules(rules) {
|
|
16532
|
+
const normalized = rules.map((rule) => ({
|
|
16533
|
+
status_code: rule.status_code,
|
|
16534
|
+
path_pattern: normalizePathPattern(rule.path_pattern),
|
|
16535
|
+
methods: normalizeHttpMethods(rule.methods)
|
|
16536
|
+
}));
|
|
16537
|
+
const deduped = /* @__PURE__ */ new Map();
|
|
16538
|
+
for (const rule of normalized) {
|
|
16539
|
+
deduped.set(`${rule.status_code}:${rule.path_pattern}:${rule.methods.join(",")}`, rule);
|
|
16540
|
+
}
|
|
16541
|
+
return Array.from(deduped.values()).sort((left, right) => {
|
|
16542
|
+
if (left.status_code !== right.status_code) return left.status_code - right.status_code;
|
|
16543
|
+
const pathComparison = left.path_pattern.localeCompare(right.path_pattern);
|
|
16544
|
+
if (pathComparison !== 0) return pathComparison;
|
|
16545
|
+
return left.methods.join(",").localeCompare(right.methods.join(","));
|
|
16546
|
+
});
|
|
16547
|
+
}
|
|
16548
|
+
var ImmediateClientErrorPathRuleSchema = external_exports.object({
|
|
16549
|
+
status_code: ImmediateClientErrorStatusSchema,
|
|
16550
|
+
path_pattern: external_exports.string().min(1).max(256).transform(normalizePathPattern).refine(isValidPathPattern, {
|
|
16551
|
+
message: "path_pattern must start with / and may only use a terminal * wildcard"
|
|
16552
|
+
}),
|
|
16553
|
+
methods: external_exports.array(HttpMethodSchema).max(7).optional().default([]).transform(normalizeHttpMethods)
|
|
16554
|
+
});
|
|
16555
|
+
var ImmediateClientErrorPathRulesSchema = external_exports.array(ImmediateClientErrorPathRuleSchema).max(25).transform((rules) => normalizeImmediateClientErrorPathRules(rules));
|
|
16509
16556
|
var ResolvedCapturePolicySchema = external_exports.object({
|
|
16510
16557
|
preset: CapturePresetSchema,
|
|
16511
16558
|
capture_logs: CaptureLogsSchema,
|
|
16512
16559
|
capture_request_events: CaptureRequestEventsSchema,
|
|
16513
16560
|
capture_breadcrumbs: CaptureBreadcrumbsSchema,
|
|
16514
16561
|
capture_probe_events: CaptureProbeEventsSchema,
|
|
16515
|
-
immediate_client_error_statuses: ImmediateClientErrorStatusesSchema
|
|
16562
|
+
immediate_client_error_statuses: ImmediateClientErrorStatusesSchema,
|
|
16563
|
+
immediate_client_error_path_rules: ImmediateClientErrorPathRulesSchema.default([])
|
|
16516
16564
|
});
|
|
16517
16565
|
var CapturePolicyOverridesSchema = external_exports.object({
|
|
16518
16566
|
capture_logs: CaptureLogsSchema.nullable(),
|
|
16519
16567
|
capture_request_events: CaptureRequestEventsSchema.nullable(),
|
|
16520
16568
|
capture_breadcrumbs: CaptureBreadcrumbsSchema.nullable(),
|
|
16521
16569
|
capture_probe_events: CaptureProbeEventsSchema.nullable(),
|
|
16522
|
-
immediate_client_error_statuses: ImmediateClientErrorStatusesSchema.nullable()
|
|
16570
|
+
immediate_client_error_statuses: ImmediateClientErrorStatusesSchema.nullable(),
|
|
16571
|
+
immediate_client_error_path_rules: ImmediateClientErrorPathRulesSchema.nullable().default(null)
|
|
16523
16572
|
});
|
|
16524
16573
|
var CapturePolicyResponseSchema = external_exports.object({
|
|
16525
16574
|
access_mode: external_exports.enum(["manage", "preview"]),
|
|
@@ -16534,6 +16583,7 @@ var CapturePolicySchema = external_exports.object({
|
|
|
16534
16583
|
capture_breadcrumbs: CaptureBreadcrumbsSchema.nullable(),
|
|
16535
16584
|
capture_probe_events: CaptureProbeEventsSchema.nullable(),
|
|
16536
16585
|
immediate_client_error_statuses: ImmediateClientErrorStatusesSchema.nullable(),
|
|
16586
|
+
immediate_client_error_path_rules: ImmediateClientErrorPathRulesSchema.nullable().default(null),
|
|
16537
16587
|
updated_at: external_exports.string().datetime()
|
|
16538
16588
|
});
|
|
16539
16589
|
var CapturePolicyUpdateSchema = external_exports.object({
|
|
@@ -16542,7 +16592,8 @@ var CapturePolicyUpdateSchema = external_exports.object({
|
|
|
16542
16592
|
capture_request_events: CaptureRequestEventsSchema.nullable().optional(),
|
|
16543
16593
|
capture_breadcrumbs: CaptureBreadcrumbsSchema.nullable().optional(),
|
|
16544
16594
|
capture_probe_events: CaptureProbeEventsSchema.nullable().optional(),
|
|
16545
|
-
immediate_client_error_statuses: ImmediateClientErrorStatusesSchema.nullable().optional()
|
|
16595
|
+
immediate_client_error_statuses: ImmediateClientErrorStatusesSchema.nullable().optional(),
|
|
16596
|
+
immediate_client_error_path_rules: ImmediateClientErrorPathRulesSchema.nullable().optional()
|
|
16546
16597
|
});
|
|
16547
16598
|
var PRESET_DEFAULTS = {
|
|
16548
16599
|
minimal: {
|
|
@@ -16550,30 +16601,69 @@ var PRESET_DEFAULTS = {
|
|
|
16550
16601
|
capture_request_events: "failures_only",
|
|
16551
16602
|
capture_breadcrumbs: "local_only",
|
|
16552
16603
|
capture_probe_events: "buffer_only",
|
|
16553
|
-
immediate_client_error_statuses: []
|
|
16604
|
+
immediate_client_error_statuses: [],
|
|
16605
|
+
immediate_client_error_path_rules: []
|
|
16554
16606
|
},
|
|
16555
16607
|
balanced: {
|
|
16556
16608
|
capture_logs: "warning",
|
|
16557
16609
|
capture_request_events: "failures_only",
|
|
16558
16610
|
capture_breadcrumbs: "exception_only",
|
|
16559
16611
|
capture_probe_events: "buffer_only",
|
|
16560
|
-
immediate_client_error_statuses: []
|
|
16612
|
+
immediate_client_error_statuses: [],
|
|
16613
|
+
immediate_client_error_path_rules: []
|
|
16561
16614
|
},
|
|
16562
16615
|
investigative: {
|
|
16563
16616
|
capture_logs: "info",
|
|
16564
16617
|
capture_request_events: "all",
|
|
16565
16618
|
capture_breadcrumbs: "standalone",
|
|
16566
16619
|
capture_probe_events: "standalone_when_activated",
|
|
16567
|
-
immediate_client_error_statuses: [...RECOMMENDED_IMMEDIATE_CLIENT_ERROR_STATUSES]
|
|
16620
|
+
immediate_client_error_statuses: [...RECOMMENDED_IMMEDIATE_CLIENT_ERROR_STATUSES],
|
|
16621
|
+
immediate_client_error_path_rules: []
|
|
16568
16622
|
}
|
|
16569
16623
|
};
|
|
16570
16624
|
var BALANCED_IMMEDIATE_REQUEST_STATUSES = /* @__PURE__ */ new Set([408, 423, 424, 425, 429]);
|
|
16571
16625
|
var INVESTIGATIVE_IMMEDIATE_REQUEST_STATUSES = /* @__PURE__ */ new Set([...BALANCED_IMMEDIATE_REQUEST_STATUSES, 409]);
|
|
16572
|
-
|
|
16573
|
-
|
|
16574
|
-
|
|
16626
|
+
function normalizeRequestPath(value) {
|
|
16627
|
+
if (typeof value !== "string") {
|
|
16628
|
+
return null;
|
|
16629
|
+
}
|
|
16630
|
+
const trimmed = value.trim();
|
|
16631
|
+
if (trimmed.length === 0) {
|
|
16632
|
+
return null;
|
|
16633
|
+
}
|
|
16634
|
+
const path = trimmed.startsWith("http://") || trimmed.startsWith("https://") ? (() => {
|
|
16635
|
+
try {
|
|
16636
|
+
return new URL(trimmed).pathname;
|
|
16637
|
+
} catch {
|
|
16638
|
+
return trimmed;
|
|
16639
|
+
}
|
|
16640
|
+
})() : trimmed;
|
|
16641
|
+
return (path.split(/[?#]/, 1)[0] ?? path).replace(/\/{2,}/g, "/");
|
|
16642
|
+
}
|
|
16643
|
+
function pathPatternMatches(rulePattern, requestPath) {
|
|
16644
|
+
const pattern = normalizePathPattern(rulePattern);
|
|
16645
|
+
if (!pattern.endsWith("*")) {
|
|
16646
|
+
return requestPath === pattern;
|
|
16647
|
+
}
|
|
16648
|
+
const prefix = pattern.slice(0, -1);
|
|
16649
|
+
return requestPath.startsWith(prefix);
|
|
16650
|
+
}
|
|
16651
|
+
function matchesImmediateClientErrorPathRule(input) {
|
|
16652
|
+
const { responseStatus, immediateClientErrorPathRules = [] } = input;
|
|
16653
|
+
if (responseStatus === null || !Number.isFinite(responseStatus) || immediateClientErrorPathRules.length === 0) {
|
|
16654
|
+
return false;
|
|
16655
|
+
}
|
|
16656
|
+
const requestPath = normalizeRequestPath(input.requestPath);
|
|
16657
|
+
if (requestPath === null) {
|
|
16658
|
+
return false;
|
|
16659
|
+
}
|
|
16660
|
+
const httpMethod = typeof input.httpMethod === "string" ? input.httpMethod.toUpperCase() : null;
|
|
16661
|
+
return immediateClientErrorPathRules.some(
|
|
16662
|
+
(rule) => rule.status_code === responseStatus && (rule.methods.length === 0 || httpMethod !== null && rule.methods.includes(httpMethod)) && pathPatternMatches(rule.path_pattern, requestPath)
|
|
16663
|
+
);
|
|
16664
|
+
}
|
|
16575
16665
|
function classifyRequestStatus(input) {
|
|
16576
|
-
const { responseStatus, capturePreset, immediateClientErrorStatuses = [] } = input;
|
|
16666
|
+
const { responseStatus, capturePreset, immediateClientErrorStatuses = [], immediateClientErrorPathRules = [] } = input;
|
|
16577
16667
|
if (responseStatus === null || !Number.isFinite(responseStatus)) {
|
|
16578
16668
|
return "context_signal";
|
|
16579
16669
|
}
|
|
@@ -16583,6 +16673,14 @@ function classifyRequestStatus(input) {
|
|
|
16583
16673
|
if (immediateClientErrorStatuses.includes(responseStatus)) {
|
|
16584
16674
|
return "incident_signal";
|
|
16585
16675
|
}
|
|
16676
|
+
if (matchesImmediateClientErrorPathRule({
|
|
16677
|
+
responseStatus,
|
|
16678
|
+
requestPath: input.requestPath,
|
|
16679
|
+
httpMethod: input.httpMethod,
|
|
16680
|
+
immediateClientErrorPathRules
|
|
16681
|
+
})) {
|
|
16682
|
+
return "incident_signal";
|
|
16683
|
+
}
|
|
16586
16684
|
if (capturePreset === "investigative") {
|
|
16587
16685
|
return INVESTIGATIVE_IMMEDIATE_REQUEST_STATUSES.has(responseStatus) ? "incident_signal" : "context_signal";
|
|
16588
16686
|
}
|
|
@@ -16592,33 +16690,101 @@ function classifyRequestStatus(input) {
|
|
|
16592
16690
|
return "context_signal";
|
|
16593
16691
|
}
|
|
16594
16692
|
function getRequestAnomalyThreshold(input) {
|
|
16595
|
-
const { responseStatus
|
|
16693
|
+
const { responseStatus } = input;
|
|
16596
16694
|
if (responseStatus === null || !Number.isFinite(responseStatus) || responseStatus < 400 || responseStatus >= 500) {
|
|
16597
16695
|
return null;
|
|
16598
16696
|
}
|
|
16599
|
-
|
|
16600
|
-
|
|
16697
|
+
return null;
|
|
16698
|
+
}
|
|
16699
|
+
|
|
16700
|
+
// ../../packages/shared-types/src/request-failure-noise.ts
|
|
16701
|
+
function isLowValueExternalProbeRequestFailure404(input) {
|
|
16702
|
+
if (input.responseStatus !== 404 || input.httpMethod.toUpperCase() !== "GET") {
|
|
16703
|
+
return false;
|
|
16601
16704
|
}
|
|
16602
|
-
|
|
16603
|
-
|
|
16604
|
-
|
|
16605
|
-
|
|
16606
|
-
|
|
16705
|
+
const normalizedRoute = input.routeTemplate.toLowerCase().replace(/\/+$/, "") || "/";
|
|
16706
|
+
const normalizedPath = normalizePath(input.requestPath ?? input.routeTemplate);
|
|
16707
|
+
const routesToCheck = /* @__PURE__ */ new Set([normalizedRoute, normalizedPath]);
|
|
16708
|
+
for (const route of routesToCheck) {
|
|
16709
|
+
if (isRouteOnlyExternalProbe(route)) {
|
|
16710
|
+
return true;
|
|
16711
|
+
}
|
|
16607
16712
|
}
|
|
16608
|
-
|
|
16609
|
-
|
|
16610
|
-
|
|
16611
|
-
|
|
16612
|
-
|
|
16713
|
+
return isDirectIpRequest(input.headers ?? null) && [...routesToCheck].some(isGenericDirectIpProbeRoute);
|
|
16714
|
+
}
|
|
16715
|
+
function normalizePath(path) {
|
|
16716
|
+
const withoutQuery = path.split("?")[0] ?? path;
|
|
16717
|
+
return withoutQuery.toLowerCase().replace(/\/+$/, "") || "/";
|
|
16718
|
+
}
|
|
16719
|
+
function isRouteOnlyExternalProbe(normalizedRoute) {
|
|
16720
|
+
const exactRoutes = /* @__PURE__ */ new Set([
|
|
16721
|
+
"/.env",
|
|
16722
|
+
"/__debug__/render_panel",
|
|
16723
|
+
"/actuator",
|
|
16724
|
+
"/autodiscover/autodiscover.json",
|
|
16725
|
+
"/developmentserver/metadatauploader",
|
|
16726
|
+
"/cpanel",
|
|
16727
|
+
"/favicon.ico",
|
|
16728
|
+
"/geoserver/web",
|
|
16729
|
+
"/hnap1",
|
|
16730
|
+
"/logon/logonpoint/index.html",
|
|
16731
|
+
"/owa/auth/logon.aspx",
|
|
16732
|
+
"/robots.txt",
|
|
16733
|
+
"/rdweb/pages",
|
|
16734
|
+
"/web",
|
|
16735
|
+
"/webclient/login.xhtml",
|
|
16736
|
+
"/webconsole",
|
|
16737
|
+
"/webui",
|
|
16738
|
+
"/whm",
|
|
16739
|
+
"/wp-admin",
|
|
16740
|
+
"/wp-login.php",
|
|
16741
|
+
"/wsman",
|
|
16742
|
+
"/xmlrpc.php"
|
|
16743
|
+
]);
|
|
16744
|
+
if (exactRoutes.has(normalizedRoute)) {
|
|
16745
|
+
return true;
|
|
16613
16746
|
}
|
|
16614
|
-
|
|
16615
|
-
|
|
16616
|
-
|
|
16617
|
-
|
|
16618
|
-
|
|
16747
|
+
return normalizedRoute.includes("/.git/") || normalizedRoute.includes("/.svn/") || normalizedRoute.includes("/api_keys") || normalizedRoute.includes("/backup/api_keys") || normalizedRoute.includes("/phpmyadmin") || normalizedRoute.includes("/pma/") || normalizedRoute.includes("/vendor/phpunit/") || normalizedRoute.startsWith("/autodiscover/") || normalizedRoute.startsWith("/cgi-bin/") || normalizedRoute.startsWith("/ecp/") || normalizedRoute.endsWith("/.git/config") || normalizedRoute.endsWith("/composer.json") || normalizedRoute.endsWith("/composer.lock") || normalizedRoute.endsWith("/package-lock.json") || normalizedRoute.endsWith("/package.json") || normalizedRoute.endsWith("/server-status") || normalizedRoute.includes("wp-config") || normalizedRoute.startsWith("/owa/") || normalizedRoute.startsWith("/rdweb/") || normalizedRoute.startsWith("/vpn/") || normalizedRoute.startsWith("/wp-") || isSensitiveBackupFileProbe(normalizedRoute);
|
|
16748
|
+
}
|
|
16749
|
+
function isSensitiveBackupFileProbe(normalizedRoute) {
|
|
16750
|
+
if (!/\.(?:bak|backup|dump|old|orig|save|sql|swp|tar|tar\.gz|zip)$/.test(normalizedRoute)) {
|
|
16751
|
+
return false;
|
|
16752
|
+
}
|
|
16753
|
+
return /(?:^|\/|\.)(?:backup|config|database|db|dump|env|secret|site|www|wp-config)(?:\/|\.|_|-|$)/.test(normalizedRoute);
|
|
16754
|
+
}
|
|
16755
|
+
function isGenericDirectIpProbeRoute(normalizedRoute) {
|
|
16756
|
+
return [
|
|
16757
|
+
"/admin",
|
|
16758
|
+
"/administrator",
|
|
16759
|
+
"/login",
|
|
16760
|
+
"/logincheck",
|
|
16761
|
+
"/remote/logincheck"
|
|
16762
|
+
].includes(normalizedRoute);
|
|
16763
|
+
}
|
|
16764
|
+
function isDirectIpRequest(headers) {
|
|
16765
|
+
if (headers === null) {
|
|
16766
|
+
return false;
|
|
16767
|
+
}
|
|
16768
|
+
const host = readHeader(headers, "x-forwarded-host") ?? readHeader(headers, "host");
|
|
16769
|
+
if (host === null) {
|
|
16770
|
+
return false;
|
|
16771
|
+
}
|
|
16772
|
+
return isIpLikeHost(host);
|
|
16773
|
+
}
|
|
16774
|
+
function readHeader(headers, name) {
|
|
16775
|
+
const direct = headers[name] ?? headers[name.toLowerCase()];
|
|
16776
|
+
if (typeof direct === "string") {
|
|
16777
|
+
return direct;
|
|
16778
|
+
}
|
|
16779
|
+
if (Array.isArray(direct) && typeof direct[0] === "string") {
|
|
16780
|
+
return direct[0];
|
|
16619
16781
|
}
|
|
16620
16782
|
return null;
|
|
16621
16783
|
}
|
|
16784
|
+
function isIpLikeHost(value) {
|
|
16785
|
+
const host = value.trim().replace(/:\d+$/, "");
|
|
16786
|
+
return /^(?:\d{1,3}\.){3}\d{1,3}$/.test(host) || /^\[[0-9a-f:]+\]$/i.test(host) || host.includes(":") && /^[0-9a-f:]+$/i.test(host);
|
|
16787
|
+
}
|
|
16622
16788
|
|
|
16623
16789
|
// ../../packages/shared-types/src/capture-rules.ts
|
|
16624
16790
|
var CAPTURE_RULE_EVENT_TYPES = [
|
|
@@ -19236,7 +19402,7 @@ function getRequestResponseStatus(payload) {
|
|
|
19236
19402
|
const status = payload?.["response_status"];
|
|
19237
19403
|
return typeof status === "number" && Number.isFinite(status) ? status : null;
|
|
19238
19404
|
}
|
|
19239
|
-
function classifyEvent(eventType, logLevel, probeActivationId, payload, capturePreset = "minimal", immediateClientErrorStatuses = []) {
|
|
19405
|
+
function classifyEvent(eventType, logLevel, probeActivationId, payload, capturePreset = "minimal", immediateClientErrorStatuses = [], immediateClientErrorPathRules = []) {
|
|
19240
19406
|
switch (eventType) {
|
|
19241
19407
|
case "backend_exception":
|
|
19242
19408
|
case "frontend_exception":
|
|
@@ -19248,7 +19414,14 @@ function classifyEvent(eventType, logLevel, probeActivationId, payload, captureP
|
|
|
19248
19414
|
return "context_signal";
|
|
19249
19415
|
case "request_event": {
|
|
19250
19416
|
const responseStatus = getRequestResponseStatus(payload);
|
|
19251
|
-
return classifyRequestStatus({
|
|
19417
|
+
return classifyRequestStatus({
|
|
19418
|
+
responseStatus,
|
|
19419
|
+
requestPath: payload?.["path"],
|
|
19420
|
+
httpMethod: payload?.["method"],
|
|
19421
|
+
capturePreset,
|
|
19422
|
+
immediateClientErrorStatuses,
|
|
19423
|
+
immediateClientErrorPathRules
|
|
19424
|
+
});
|
|
19252
19425
|
}
|
|
19253
19426
|
case "frontend_breadcrumb":
|
|
19254
19427
|
case "deploy_metadata":
|
|
@@ -20445,6 +20618,7 @@ var STORAGE_BOOTSTRAP_STATEMENTS = [
|
|
|
20445
20618
|
capture_breadcrumbs text,
|
|
20446
20619
|
capture_probe_events text,
|
|
20447
20620
|
immediate_client_error_statuses jsonb,
|
|
20621
|
+
immediate_client_error_path_rules jsonb,
|
|
20448
20622
|
updated_at timestamptz NOT NULL DEFAULT now()
|
|
20449
20623
|
)
|
|
20450
20624
|
`,
|
|
@@ -21800,6 +21974,13 @@ var STORAGE_SCHEMA_MIGRATIONS = [
|
|
|
21800
21974
|
ON plan_cleanup_tasks (completed_at, next_attempt_at, created_at)
|
|
21801
21975
|
`
|
|
21802
21976
|
]
|
|
21977
|
+
}),
|
|
21978
|
+
defineStorageSchemaMigration({
|
|
21979
|
+
id: "202606080001_add_capture_policy_client_error_path_rules",
|
|
21980
|
+
description: "Add path-scoped client error incident promotion rules to capture policies.",
|
|
21981
|
+
statements: [
|
|
21982
|
+
"ALTER TABLE capture_policies ADD COLUMN IF NOT EXISTS immediate_client_error_path_rules jsonb"
|
|
21983
|
+
]
|
|
21803
21984
|
})
|
|
21804
21985
|
];
|
|
21805
21986
|
|
|
@@ -23080,6 +23261,15 @@ function collectRequestAnomalyAggregates(batches, capturePreset) {
|
|
|
23080
23261
|
if (threshold === null || responseStatus === null || method === null || routeTemplate === null) {
|
|
23081
23262
|
continue;
|
|
23082
23263
|
}
|
|
23264
|
+
if (isLowValueExternalProbeRequestFailure404({
|
|
23265
|
+
httpMethod: method,
|
|
23266
|
+
requestPath: event.payload.path,
|
|
23267
|
+
routeTemplate,
|
|
23268
|
+
responseStatus,
|
|
23269
|
+
headers: event.payload.headers
|
|
23270
|
+
})) {
|
|
23271
|
+
continue;
|
|
23272
|
+
}
|
|
23083
23273
|
const projectId = requireProjectId(event);
|
|
23084
23274
|
const incidentFingerprint = buildRequestAnomalyFingerprint({
|
|
23085
23275
|
projectId,
|
|
@@ -28486,7 +28676,7 @@ var zodToJsonSchema = (schema, options) => {
|
|
|
28486
28676
|
var package_default = {
|
|
28487
28677
|
name: "@debugbundle/mcp",
|
|
28488
28678
|
mcpName: "com.debugbundle/mcp",
|
|
28489
|
-
version: "1.
|
|
28679
|
+
version: "1.2.0",
|
|
28490
28680
|
private: false,
|
|
28491
28681
|
description: "Model Context Protocol server for DebugBundle",
|
|
28492
28682
|
license: "AGPL-3.0-only",
|
|
@@ -29247,7 +29437,12 @@ var MCP_TOOL_CATALOG = [
|
|
|
29247
29437
|
capture_request_events: external_exports.string().nullable().optional(),
|
|
29248
29438
|
capture_breadcrumbs: external_exports.string().nullable().optional(),
|
|
29249
29439
|
capture_probe_events: external_exports.string().nullable().optional(),
|
|
29250
|
-
immediate_client_error_statuses: external_exports.array(external_exports.number().int().min(400).max(499)).nullable().optional()
|
|
29440
|
+
immediate_client_error_statuses: external_exports.array(external_exports.number().int().min(400).max(499)).nullable().optional(),
|
|
29441
|
+
immediate_client_error_path_rules: external_exports.array(external_exports.object({
|
|
29442
|
+
status_code: external_exports.number().int().min(400).max(499),
|
|
29443
|
+
path_pattern: external_exports.string(),
|
|
29444
|
+
methods: external_exports.array(external_exports.enum(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"])).optional()
|
|
29445
|
+
})).nullable().optional()
|
|
29251
29446
|
})
|
|
29252
29447
|
})
|
|
29253
29448
|
},
|
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.
|
|
11
|
+
"version": "1.2.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.
|
|
17
|
+
"version": "1.2.0",
|
|
18
18
|
"transport": {
|
|
19
19
|
"type": "stdio"
|
|
20
20
|
},
|