@debugbundle/mcp 1.4.0 → 1.5.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/README.md +1 -1
- package/dist/main.cjs +1274 -147
- package/package.json +1 -1
- package/server.json +3 -3
package/dist/main.cjs
CHANGED
|
@@ -16484,6 +16484,113 @@ function createWeeklyReportApi(client) {
|
|
|
16484
16484
|
var import_promises2 = require("node:fs/promises");
|
|
16485
16485
|
var import_node_path2 = require("node:path");
|
|
16486
16486
|
|
|
16487
|
+
// ../../packages/shared-types/src/tier-capabilities.ts
|
|
16488
|
+
var TIER_CAPABILITIES = {
|
|
16489
|
+
free: {
|
|
16490
|
+
remote_probes: false,
|
|
16491
|
+
github_automation: false,
|
|
16492
|
+
slack_integration: false,
|
|
16493
|
+
cloud_improvement_bundles: false,
|
|
16494
|
+
shared_dashboards: false,
|
|
16495
|
+
member_invites: false,
|
|
16496
|
+
included_capacity_units: 1,
|
|
16497
|
+
max_members: 1,
|
|
16498
|
+
ingestion_rate_per_min: 1e3,
|
|
16499
|
+
retrieval_rate_per_min: 100,
|
|
16500
|
+
bundle_retention_days: 7,
|
|
16501
|
+
raw_event_retention_days: 7,
|
|
16502
|
+
// Allowance buckets (account-level pool, not per capacity unit)
|
|
16503
|
+
monthly_bundle_requests: 100,
|
|
16504
|
+
monthly_raw_ingested_events: 750,
|
|
16505
|
+
retained_bundle_cap: 50,
|
|
16506
|
+
monthly_remote_activations: 0,
|
|
16507
|
+
monthly_alert_deliveries: 25,
|
|
16508
|
+
monthly_webhook_deliveries: 100,
|
|
16509
|
+
availability_checks_per_project: 1,
|
|
16510
|
+
availability_check_min_interval_seconds: 300
|
|
16511
|
+
},
|
|
16512
|
+
solo: {
|
|
16513
|
+
remote_probes: true,
|
|
16514
|
+
github_automation: true,
|
|
16515
|
+
slack_integration: false,
|
|
16516
|
+
cloud_improvement_bundles: true,
|
|
16517
|
+
shared_dashboards: false,
|
|
16518
|
+
member_invites: false,
|
|
16519
|
+
included_capacity_units: 3,
|
|
16520
|
+
max_members: 1,
|
|
16521
|
+
ingestion_rate_per_min: 5e3,
|
|
16522
|
+
retrieval_rate_per_min: 300,
|
|
16523
|
+
bundle_retention_days: 30,
|
|
16524
|
+
raw_event_retention_days: 14,
|
|
16525
|
+
// Per-unit allowance (multiply by included and purchased capacity units)
|
|
16526
|
+
monthly_bundle_requests: 250,
|
|
16527
|
+
monthly_raw_ingested_events: 3500,
|
|
16528
|
+
retained_bundle_cap: 150,
|
|
16529
|
+
monthly_remote_activations: 25,
|
|
16530
|
+
monthly_alert_deliveries: 75,
|
|
16531
|
+
monthly_webhook_deliveries: 250,
|
|
16532
|
+
availability_checks_per_project: 5,
|
|
16533
|
+
availability_check_min_interval_seconds: 60
|
|
16534
|
+
},
|
|
16535
|
+
team: {
|
|
16536
|
+
remote_probes: true,
|
|
16537
|
+
github_automation: true,
|
|
16538
|
+
slack_integration: true,
|
|
16539
|
+
cloud_improvement_bundles: true,
|
|
16540
|
+
shared_dashboards: true,
|
|
16541
|
+
member_invites: true,
|
|
16542
|
+
included_capacity_units: 15,
|
|
16543
|
+
max_members: 1e3,
|
|
16544
|
+
ingestion_rate_per_min: 1e4,
|
|
16545
|
+
retrieval_rate_per_min: 500,
|
|
16546
|
+
bundle_retention_days: 90,
|
|
16547
|
+
raw_event_retention_days: 30,
|
|
16548
|
+
// Per-unit allowance (multiply by included and purchased capacity units)
|
|
16549
|
+
monthly_bundle_requests: 1e3,
|
|
16550
|
+
monthly_raw_ingested_events: 1e4,
|
|
16551
|
+
retained_bundle_cap: 400,
|
|
16552
|
+
monthly_remote_activations: 50,
|
|
16553
|
+
monthly_alert_deliveries: 300,
|
|
16554
|
+
monthly_webhook_deliveries: 1e3,
|
|
16555
|
+
availability_checks_per_project: 25,
|
|
16556
|
+
availability_check_min_interval_seconds: 30
|
|
16557
|
+
}
|
|
16558
|
+
};
|
|
16559
|
+
var SELFHOST_CAPABILITIES = {
|
|
16560
|
+
remote_probes: true,
|
|
16561
|
+
github_automation: true,
|
|
16562
|
+
slack_integration: true,
|
|
16563
|
+
cloud_improvement_bundles: true,
|
|
16564
|
+
shared_dashboards: true,
|
|
16565
|
+
member_invites: true,
|
|
16566
|
+
included_capacity_units: 1e6,
|
|
16567
|
+
max_members: 1e3,
|
|
16568
|
+
ingestion_rate_per_min: 1e6,
|
|
16569
|
+
retrieval_rate_per_min: 1e5,
|
|
16570
|
+
bundle_retention_days: 36500,
|
|
16571
|
+
raw_event_retention_days: 36500,
|
|
16572
|
+
monthly_bundle_requests: 1e9,
|
|
16573
|
+
monthly_raw_ingested_events: 1e9,
|
|
16574
|
+
retained_bundle_cap: 1e6,
|
|
16575
|
+
monthly_remote_activations: 1e6,
|
|
16576
|
+
monthly_alert_deliveries: 1e6,
|
|
16577
|
+
monthly_webhook_deliveries: 1e6,
|
|
16578
|
+
availability_checks_per_project: 1e6,
|
|
16579
|
+
availability_check_min_interval_seconds: 30
|
|
16580
|
+
};
|
|
16581
|
+
function isSelfHostMode() {
|
|
16582
|
+
return typeof process !== "undefined" && process.env["SELFHOST_MODE"] === "true";
|
|
16583
|
+
}
|
|
16584
|
+
function getTierCapabilities(plan) {
|
|
16585
|
+
if (isSelfHostMode()) {
|
|
16586
|
+
return SELFHOST_CAPABILITIES;
|
|
16587
|
+
}
|
|
16588
|
+
if (plan !== void 0 && plan in TIER_CAPABILITIES) {
|
|
16589
|
+
return TIER_CAPABILITIES[plan];
|
|
16590
|
+
}
|
|
16591
|
+
return TIER_CAPABILITIES.free;
|
|
16592
|
+
}
|
|
16593
|
+
|
|
16487
16594
|
// ../../packages/shared-types/src/capture-policy.ts
|
|
16488
16595
|
var EventClassValues = [
|
|
16489
16596
|
"incident_signal",
|
|
@@ -16729,6 +16836,7 @@ function isRouteOnlyExternalProbe(normalizedRoute) {
|
|
|
16729
16836
|
"/__debug__/render_panel",
|
|
16730
16837
|
"/actuator",
|
|
16731
16838
|
"/autodiscover/autodiscover.json",
|
|
16839
|
+
"/containers/json",
|
|
16732
16840
|
"/developmentserver/metadatauploader",
|
|
16733
16841
|
"/cpanel",
|
|
16734
16842
|
"/favicon.ico",
|
|
@@ -17841,8 +17949,10 @@ function buildSkill() {
|
|
|
17841
17949
|
"name: debugbundle",
|
|
17842
17950
|
"description: >-",
|
|
17843
17951
|
" Investigate runtime incidents, inspect debug bundles, generate reproductions,",
|
|
17844
|
-
"
|
|
17845
|
-
" Use when the user reports a bug, runtime
|
|
17952
|
+
" run improvement analysis, and inspect operational controls using the DebugBundle",
|
|
17953
|
+
" CLI and local project scaffold. Use when the user reports a bug, runtime",
|
|
17954
|
+
" failure, production incident, endpoint downtime, health-check issue, missing",
|
|
17955
|
+
" notification, webhook delivery failure, probe request, or noisy incident.",
|
|
17846
17956
|
"metadata:",
|
|
17847
17957
|
" author: debugbundle",
|
|
17848
17958
|
' version: "1.0"',
|
|
@@ -17880,6 +17990,24 @@ function buildSkill() {
|
|
|
17880
17990
|
"4. Apply the narrowest fix, then validate it with the repository test workflow from `.debugbundle/profile.json`.",
|
|
17881
17991
|
"5. When the fix is confirmed, or when the incident was intentionally generated for smoke, verification, or dogfooding, resolve it with `debugbundle resolve <incident-id> [incident-id ...]` or MCP `resolve_incident` / `resolve_incidents` so the open queue stays actionable.",
|
|
17882
17992
|
"",
|
|
17993
|
+
"## Investigation Controls",
|
|
17994
|
+
"",
|
|
17995
|
+
"Use these controls when the user's issue is about observability behavior, notification delivery, targeted evidence gathering, or event noise rather than only application code.",
|
|
17996
|
+
"",
|
|
17997
|
+
"- Availability checks: use hosted health checks for endpoint downtime, public reachability, or project Health tab issues. These are DebugBundle-run external `GET`/`HEAD` checks, not SDK events from the customer app.",
|
|
17998
|
+
"- Probes: inspect active probes with `debugbundle probe list <project-id> --json` or MCP `list_active_probes` before activating more probes. Activate probes only when targeted runtime evidence is needed and the user has asked for investigation.",
|
|
17999
|
+
"- Capture policy and rules: inspect policy/rules before suppressing noisy incidents. Prefer `debugbundle capture-rule suggest <incident-id> --json` and narrow capture-policy path rules over broad drops or demotions.",
|
|
18000
|
+
"- Alerts and webhooks: when the user reports missing, duplicate, or failed notifications, inspect alert config, webhook config, and webhook delivery history before changing application code.",
|
|
18001
|
+
"",
|
|
18002
|
+
"## Availability Checks",
|
|
18003
|
+
"",
|
|
18004
|
+
"- Start with `debugbundle health checks list --project-id <id> --json` or MCP `list_health_checks` to inspect saved checks and plan limits.",
|
|
18005
|
+
"- For a failing check, inspect `debugbundle health checks results <check-id> --project-id <id> --json` and `debugbundle health checks daily-rollups <check-id> --project-id <id> --json` before changing code.",
|
|
18006
|
+
"- Use `debugbundle health checks test --project-id <id> --url <url> --json` or MCP `test_health_check` before creating or updating a saved check. Tests are side-effect-free: no incidents, retained history rows, or counters.",
|
|
18007
|
+
"- Create, update, delete, enable, or disable checks only when the user explicitly asks to change monitoring.",
|
|
18008
|
+
"- Availability incidents reuse the normal incident lifecycle. If a check opened an incident, fetch the incident context, bundle, and reproduction before proposing a fix, then resolve only after the endpoint recovers or the intentional verification incident has served its purpose.",
|
|
18009
|
+
"- Do not configure private, localhost, metadata-service, credentialed, or state-mutating targets. V1 health-check targets must be external `http`/`https` URLs on safe ports.",
|
|
18010
|
+
"",
|
|
17883
18011
|
"## Incident Hygiene",
|
|
17884
18012
|
"",
|
|
17885
18013
|
"- Treat `open` as actionable work, not historical record.",
|
|
@@ -17896,6 +18024,25 @@ function buildSkill() {
|
|
|
17896
18024
|
"- Scope frontend noise by structured evidence such as service, environment, `browser_event_kind`, `browser_event_opaque`, `client_kind`, `bot_family`, and message fields. Do not broadly demote generic `Unhandled promise rejection` incidents without bot-scoped or otherwise narrow evidence.",
|
|
17897
18025
|
"- For expected or intentionally promoted 4xx responses on known routes, use capture-policy client-error path rules instead of promoting all client errors: `debugbundle capture-policy set --client-error-path-rule <status=/path/*@GET>`.",
|
|
17898
18026
|
"",
|
|
18027
|
+
"## Notification Delivery",
|
|
18028
|
+
"",
|
|
18029
|
+
"When notification or automation delivery is the reported failure, inspect configuration and delivery records before changing incident logic.",
|
|
18030
|
+
"",
|
|
18031
|
+
"- Alerts route incident notifications to configured channels. Start with `debugbundle alert list --project-id <id> --json` and confirm condition, severity, service, cooldown, channel, and enabled state.",
|
|
18032
|
+
"- Webhooks deliver signed lifecycle events to external systems. Start with `debugbundle webhook list --project-id <id> --json`, then inspect `debugbundle webhook deliveries <webhook-id> --project-id <id> --json` before retrying or testing.",
|
|
18033
|
+
"- Webhook tests and retries are side-effecting delivery actions. Use them only when validating a destination or replaying an explicit failed delivery.",
|
|
18034
|
+
"",
|
|
18035
|
+
"## Full Documentation",
|
|
18036
|
+
"",
|
|
18037
|
+
"- CLI: `https://debugbundle.com/docs/cli`",
|
|
18038
|
+
"- MCP tools: `https://debugbundle.com/docs/mcp/tools`",
|
|
18039
|
+
"- Availability checks: `https://debugbundle.com/docs/availability-checks`",
|
|
18040
|
+
"- Probes: `https://debugbundle.com/docs/probes`",
|
|
18041
|
+
"- Capture policy and rules: `https://debugbundle.com/docs/capture-policy`",
|
|
18042
|
+
"- Alerts: `https://debugbundle.com/docs/alerts` and `https://debugbundle.com/docs/cli/alerts`",
|
|
18043
|
+
"- Webhooks: `https://debugbundle.com/docs/webhooks` and `https://debugbundle.com/docs/cli/webhooks`",
|
|
18044
|
+
"- API ingestion: `https://debugbundle.com/docs/api/ingestion`",
|
|
18045
|
+
"",
|
|
17899
18046
|
"## Profile Validation",
|
|
17900
18047
|
"",
|
|
17901
18048
|
"Use this task after setup or whenever architecture changes make the static profile stale.",
|
|
@@ -17973,6 +18120,56 @@ function buildCliReference() {
|
|
|
17973
18120
|
"",
|
|
17974
18121
|
"Use capture-rule suggestions for repeated operational noise after inspecting an incident bundle. Use capture-policy client-error path rules for route-scoped 4xx incidents instead of promoting all client errors.",
|
|
17975
18122
|
"",
|
|
18123
|
+
"## Probes",
|
|
18124
|
+
"",
|
|
18125
|
+
"- `debugbundle probe activate <project-id> --label-pattern <pattern> [--service <name>] [--environment <name>] [--ttl-seconds <n>] [--trigger-ttl-seconds <n>] [--auth-file <path>] [--json]`",
|
|
18126
|
+
"- `debugbundle probe list <project-id> [--auth-file <path>] [--json]`",
|
|
18127
|
+
"- `debugbundle probe deactivate <project-id> <activation-id> [--auth-file <path>] [--json]`",
|
|
18128
|
+
"",
|
|
18129
|
+
"Use probes for targeted evidence gathering when bundle context is insufficient. Prefer narrow label patterns, scoped service/environment values, and explicit TTLs.",
|
|
18130
|
+
"",
|
|
18131
|
+
"## Notifications",
|
|
18132
|
+
"",
|
|
18133
|
+
"- `debugbundle alert list --project-id <id> [--limit <n>] [--auth-file <path>] [--json]`",
|
|
18134
|
+
"- `debugbundle alert create --project-id <id> --channel <channel> --condition <condition> [--service-id <id>] [--severity-min <level>] [--cooldown <seconds>] --config-json <json> [--is-enabled <true|false>] [--auth-file <path>] [--json]`",
|
|
18135
|
+
"- `debugbundle alert update <alert-id> --project-id <id> [--service-id <id|null>] [--channel <channel>] [--condition <condition>] [--severity-min <level|null>] [--cooldown <seconds>] [--config-json <json|null>] [--is-enabled <true|false>] [--auth-file <path>] [--json]`",
|
|
18136
|
+
"- `debugbundle alert delete <alert-id> --project-id <id> [--auth-file <path>] [--json]`",
|
|
18137
|
+
"- `debugbundle webhook list --project-id <id> [--limit <n>] [--auth-file <path>] [--json]`",
|
|
18138
|
+
"- `debugbundle webhook create --project-id <id> --url <url> --event <event[,event]> [--environment <env[,env]>] [--service <svc[,svc]>] [--severity-min <level>] [--bundle-type <type[,type]>] [--verification <true|false>] [--is-enabled <true|false>] [--auth-file <path>] [--json]`",
|
|
18139
|
+
"- `debugbundle webhook update <webhook-id> --project-id <id> [--url <url>] [--event <event[,event]>] [--environment <env[,env]>] [--service <svc[,svc]>] [--severity-min <level>] [--bundle-type <type[,type]>] [--verification <true|false>] [--is-enabled <true|false>] [--auth-file <path>] [--json]`",
|
|
18140
|
+
"- `debugbundle webhook delete <webhook-id> --project-id <id> [--auth-file <path>] [--json]`",
|
|
18141
|
+
"- `debugbundle webhook test <webhook-id> --project-id <id> [--event <verification.passed|verification.failed>] [--auth-file <path>] [--json]`",
|
|
18142
|
+
"- `debugbundle webhook deliveries <webhook-id> --project-id <id> [--limit <n>] [--auth-file <path>] [--json]`",
|
|
18143
|
+
"- `debugbundle webhook retry <webhook-id> <delivery-id> --project-id <id> [--auth-file <path>] [--json]`",
|
|
18144
|
+
"",
|
|
18145
|
+
"Use alert commands for notification routing and webhook commands for signed event delivery, delivery history, synthetic tests, and manual retries.",
|
|
18146
|
+
"",
|
|
18147
|
+
"## Availability Checks",
|
|
18148
|
+
"",
|
|
18149
|
+
"- `debugbundle health checks list --project-id <id> [--limit <n>] [--auth-file <path>] [--json]`",
|
|
18150
|
+
"- `debugbundle health checks get <check-id> --project-id <id> [--auth-file <path>] [--json]`",
|
|
18151
|
+
"- `debugbundle health checks create --project-id <id> --name <name> --url <url> --interval-seconds <n> [--method <GET|HEAD>] [--expected-status-min <code>] [--expected-status-max <code>] [--timeout-ms <n>] [--failure-threshold <n>] [--recovery-threshold <n>] [--environment <name>] [--service <name|null>] [--enabled <true|false>] [--auth-file <path>] [--json]`",
|
|
18152
|
+
"- `debugbundle health checks update <check-id> --project-id <id> [--name <name>] [--url <url>] [--method <GET|HEAD>] [--expected-status-min <code>] [--expected-status-max <code>] [--timeout-ms <n>] [--interval-seconds <n>] [--failure-threshold <n>] [--recovery-threshold <n>] [--environment <name>] [--service <name|null>] [--enabled <true|false>] [--auth-file <path>] [--json]`",
|
|
18153
|
+
"- `debugbundle health checks delete <check-id> --project-id <id> [--auth-file <path>] [--json]`",
|
|
18154
|
+
"- `debugbundle health checks test --project-id <id> --url <url> [--method <GET|HEAD>] [--expected-status-min <code>] [--expected-status-max <code>] [--timeout-ms <n>] [--auth-file <path>] [--json]`",
|
|
18155
|
+
"- `debugbundle health checks results <check-id> --project-id <id> [--limit <n>] [--auth-file <path>] [--json]`",
|
|
18156
|
+
"- `debugbundle health checks daily-rollups <check-id> --project-id <id> [--limit <n>] [--auth-file <path>] [--json]`",
|
|
18157
|
+
"",
|
|
18158
|
+
"Use availability-check commands for hosted endpoint reachability. Prefer `test` before saving a new target. `test` is side-effect-free and does not create incidents or retained history. Saved checks remain visible after downgrade, but checks beyond current count or interval limits pause until the project becomes eligible again.",
|
|
18159
|
+
"",
|
|
18160
|
+
"## Documentation URLs",
|
|
18161
|
+
"",
|
|
18162
|
+
"- CLI overview: `https://debugbundle.com/docs/cli`",
|
|
18163
|
+
"- Cloud workflow: `https://debugbundle.com/docs/cli/cloud-workflow`",
|
|
18164
|
+
"- API overview: `https://debugbundle.com/docs/api`",
|
|
18165
|
+
"- API ingestion: `https://debugbundle.com/docs/api/ingestion`",
|
|
18166
|
+
"- Alerts: `https://debugbundle.com/docs/alerts` and `https://debugbundle.com/docs/cli/alerts`",
|
|
18167
|
+
"- Webhooks: `https://debugbundle.com/docs/webhooks`, `https://debugbundle.com/docs/cli/webhooks`, and `https://debugbundle.com/docs/api/webhooks`",
|
|
18168
|
+
"- Probes: `https://debugbundle.com/docs/probes` and `https://debugbundle.com/docs/api/probes`",
|
|
18169
|
+
"- Capture policy and rules: `https://debugbundle.com/docs/capture-policy`",
|
|
18170
|
+
"- Availability checks: `https://debugbundle.com/docs/availability-checks`",
|
|
18171
|
+
"- MCP tool catalog: `https://debugbundle.com/docs/mcp/tools`",
|
|
18172
|
+
"",
|
|
17976
18173
|
"## Operational Paths",
|
|
17977
18174
|
"",
|
|
17978
18175
|
"- `.debugbundle/profile.json` \u2014 committed project map and agent validation state",
|
|
@@ -17994,7 +18191,7 @@ function buildCliReference() {
|
|
|
17994
18191
|
"",
|
|
17995
18192
|
"```bash",
|
|
17996
18193
|
"debugbundle incidents --status open --json",
|
|
17997
|
-
"debugbundle resolve <incident-id>",
|
|
18194
|
+
"debugbundle resolve <incident-id> [incident-id ...]",
|
|
17998
18195
|
"debugbundle incidents --status open --json",
|
|
17999
18196
|
"```",
|
|
18000
18197
|
"",
|
|
@@ -18039,6 +18236,45 @@ function buildMcpReference() {
|
|
|
18039
18236
|
"",
|
|
18040
18237
|
"Use these tools for repeated low-value operational noise only after inspecting incident evidence. Keep frontend suppression scoped by structured browser and client signals, and use path-scoped capture policy for known 4xx routes.",
|
|
18041
18238
|
"",
|
|
18239
|
+
"## Probe Tools",
|
|
18240
|
+
"",
|
|
18241
|
+
"- `activate_probe` \u2014 activate a remote probe pattern with optional service/environment scope and TTL.",
|
|
18242
|
+
"- `list_active_probes` \u2014 list active probe activations for a project.",
|
|
18243
|
+
"- `deactivate_probe` \u2014 deactivate one active probe.",
|
|
18244
|
+
"",
|
|
18245
|
+
"Use probes for targeted evidence gathering when incident bundles do not contain enough runtime context.",
|
|
18246
|
+
"",
|
|
18247
|
+
"## Notification Tools",
|
|
18248
|
+
"",
|
|
18249
|
+
"- `list_alerts`, `create_alert`, `update_alert`, `delete_alert` \u2014 manage incident alert rules.",
|
|
18250
|
+
"- `list_webhooks`, `create_webhook`, `update_webhook`, `delete_webhook` \u2014 manage signed webhook destinations.",
|
|
18251
|
+
"- `test_webhook`, `list_webhook_deliveries` \u2014 validate webhook delivery and inspect delivery history.",
|
|
18252
|
+
"",
|
|
18253
|
+
"Use these tools when the reported problem is missing, duplicate, delayed, disabled, or failed notification delivery.",
|
|
18254
|
+
"",
|
|
18255
|
+
"## Availability Check Tools",
|
|
18256
|
+
"",
|
|
18257
|
+
"- `list_health_checks` \u2014 list hosted health checks and plan limits for a project.",
|
|
18258
|
+
"- `get_health_check` \u2014 fetch one hosted health check by id.",
|
|
18259
|
+
"- `test_health_check` \u2014 run a side-effect-free target test without opening incidents or writing retained history.",
|
|
18260
|
+
"- `create_health_check`, `update_health_check`, `delete_health_check` \u2014 manage saved hosted health checks when the user explicitly asks to change monitoring.",
|
|
18261
|
+
"- `list_health_check_results` \u2014 inspect recent raw executions for one check.",
|
|
18262
|
+
"- `list_health_check_daily_rollups` \u2014 inspect retained per-day status history for one check.",
|
|
18263
|
+
"",
|
|
18264
|
+
"Use these tools for endpoint downtime, public reachability, and project Health tab issues. Start with list/results/rollups, use `test_health_check` before saving target changes, and inspect the linked normal incident bundle when failures crossed the configured threshold.",
|
|
18265
|
+
"",
|
|
18266
|
+
"## Documentation URLs",
|
|
18267
|
+
"",
|
|
18268
|
+
"- MCP overview: `https://debugbundle.com/docs/mcp`",
|
|
18269
|
+
"- MCP workflows: `https://debugbundle.com/docs/mcp/workflows`",
|
|
18270
|
+
"- MCP tools: `https://debugbundle.com/docs/mcp/tools`",
|
|
18271
|
+
"- Availability checks: `https://debugbundle.com/docs/availability-checks`",
|
|
18272
|
+
"- Probes: `https://debugbundle.com/docs/probes`",
|
|
18273
|
+
"- Capture policy and rules: `https://debugbundle.com/docs/capture-policy`",
|
|
18274
|
+
"- Alerts: `https://debugbundle.com/docs/alerts`",
|
|
18275
|
+
"- Webhooks: `https://debugbundle.com/docs/webhooks`",
|
|
18276
|
+
"- API ingestion: `https://debugbundle.com/docs/api/ingestion`",
|
|
18277
|
+
"",
|
|
18042
18278
|
"## Smoke-Test Cleanup Recipe",
|
|
18043
18279
|
"",
|
|
18044
18280
|
'1. Call `list_incidents` with `status: "open"`.',
|
|
@@ -18173,6 +18409,15 @@ function buildSkillEvals() {
|
|
|
18173
18409
|
"Use capture-policy path rules for known route-scoped 4xx incidents."
|
|
18174
18410
|
]
|
|
18175
18411
|
},
|
|
18412
|
+
{
|
|
18413
|
+
name: "operational_controls_guidance",
|
|
18414
|
+
prompt: "The user reports missing webhook deliveries and asks whether probes or alerts are available. Confirm the skill points the agent to the relevant operational controls and docs.",
|
|
18415
|
+
expected_behavior: [
|
|
18416
|
+
"Inspect alert and webhook configuration plus webhook delivery history before changing application code.",
|
|
18417
|
+
"Use probes for targeted evidence gathering with narrow scope and TTL.",
|
|
18418
|
+
"Point to the full CLI, MCP, alerts, webhooks, probes, capture policy, availability checks, and ingestion documentation URLs."
|
|
18419
|
+
]
|
|
18420
|
+
},
|
|
18176
18421
|
{
|
|
18177
18422
|
name: "artifact_path_discovery",
|
|
18178
18423
|
prompt: "The user reports an unknown local runtime error. Confirm the skill tells the agent which DebugBundle paths and commands to inspect first.",
|
|
@@ -19048,6 +19293,189 @@ function createProbeApi(httpClient) {
|
|
|
19048
19293
|
};
|
|
19049
19294
|
}
|
|
19050
19295
|
|
|
19296
|
+
// ../cli/src/health-check-commands.ts
|
|
19297
|
+
var HealthCheckApiError = class extends Error {
|
|
19298
|
+
status;
|
|
19299
|
+
code;
|
|
19300
|
+
constructor(status, code) {
|
|
19301
|
+
super(`health_check_api_error: ${status}:${code}`);
|
|
19302
|
+
this.name = "HealthCheckApiError";
|
|
19303
|
+
this.status = status;
|
|
19304
|
+
this.code = code;
|
|
19305
|
+
}
|
|
19306
|
+
};
|
|
19307
|
+
function toApiError6(status, body) {
|
|
19308
|
+
if (typeof body === "object" && body !== null && "error" in body && typeof body.error === "string") {
|
|
19309
|
+
return new HealthCheckApiError(status, body.error);
|
|
19310
|
+
}
|
|
19311
|
+
return new HealthCheckApiError(status, "unknown_error");
|
|
19312
|
+
}
|
|
19313
|
+
function buildCreateRequestBody(input) {
|
|
19314
|
+
const body = {
|
|
19315
|
+
name: input.name,
|
|
19316
|
+
url: input.url,
|
|
19317
|
+
method: input.method,
|
|
19318
|
+
expected_status_min: input.expectedStatusMin,
|
|
19319
|
+
expected_status_max: input.expectedStatusMax,
|
|
19320
|
+
timeout_ms: input.timeoutMs,
|
|
19321
|
+
interval_seconds: input.intervalSeconds,
|
|
19322
|
+
failure_threshold: input.failureThreshold,
|
|
19323
|
+
recovery_threshold: input.recoveryThreshold,
|
|
19324
|
+
enabled: input.enabled
|
|
19325
|
+
};
|
|
19326
|
+
if (input.environment !== void 0) {
|
|
19327
|
+
body["environment"] = input.environment;
|
|
19328
|
+
}
|
|
19329
|
+
if (input.serviceName !== void 0) {
|
|
19330
|
+
body["service_name"] = input.serviceName;
|
|
19331
|
+
}
|
|
19332
|
+
return body;
|
|
19333
|
+
}
|
|
19334
|
+
function buildUpdateRequestBody(input) {
|
|
19335
|
+
const body = {};
|
|
19336
|
+
if (input.name !== void 0) {
|
|
19337
|
+
body["name"] = input.name;
|
|
19338
|
+
}
|
|
19339
|
+
if (input.url !== void 0) {
|
|
19340
|
+
body["url"] = input.url;
|
|
19341
|
+
}
|
|
19342
|
+
if (input.method !== void 0) {
|
|
19343
|
+
body["method"] = input.method;
|
|
19344
|
+
}
|
|
19345
|
+
if (input.expectedStatusMin !== void 0) {
|
|
19346
|
+
body["expected_status_min"] = input.expectedStatusMin;
|
|
19347
|
+
}
|
|
19348
|
+
if (input.expectedStatusMax !== void 0) {
|
|
19349
|
+
body["expected_status_max"] = input.expectedStatusMax;
|
|
19350
|
+
}
|
|
19351
|
+
if (input.timeoutMs !== void 0) {
|
|
19352
|
+
body["timeout_ms"] = input.timeoutMs;
|
|
19353
|
+
}
|
|
19354
|
+
if (input.intervalSeconds !== void 0) {
|
|
19355
|
+
body["interval_seconds"] = input.intervalSeconds;
|
|
19356
|
+
}
|
|
19357
|
+
if (input.failureThreshold !== void 0) {
|
|
19358
|
+
body["failure_threshold"] = input.failureThreshold;
|
|
19359
|
+
}
|
|
19360
|
+
if (input.recoveryThreshold !== void 0) {
|
|
19361
|
+
body["recovery_threshold"] = input.recoveryThreshold;
|
|
19362
|
+
}
|
|
19363
|
+
if (input.environment !== void 0) {
|
|
19364
|
+
body["environment"] = input.environment;
|
|
19365
|
+
}
|
|
19366
|
+
if (input.serviceName !== void 0) {
|
|
19367
|
+
body["service_name"] = input.serviceName;
|
|
19368
|
+
}
|
|
19369
|
+
if (input.enabled !== void 0) {
|
|
19370
|
+
body["enabled"] = input.enabled;
|
|
19371
|
+
}
|
|
19372
|
+
return body;
|
|
19373
|
+
}
|
|
19374
|
+
function createHealthCheckApi(httpClient) {
|
|
19375
|
+
return {
|
|
19376
|
+
async listHealthChecks(input) {
|
|
19377
|
+
const limit = input.limit ?? 100;
|
|
19378
|
+
const response = await httpClient.request({
|
|
19379
|
+
method: "GET",
|
|
19380
|
+
path: `/v1/projects/${encodeURIComponent(input.projectId)}/availability-checks?limit=${encodeURIComponent(String(limit))}`,
|
|
19381
|
+
bearerToken: input.bearerToken
|
|
19382
|
+
});
|
|
19383
|
+
if (response.status !== 200) {
|
|
19384
|
+
throw toApiError6(response.status, response.body);
|
|
19385
|
+
}
|
|
19386
|
+
return response.body;
|
|
19387
|
+
},
|
|
19388
|
+
async getHealthCheck(input) {
|
|
19389
|
+
const response = await httpClient.request({
|
|
19390
|
+
method: "GET",
|
|
19391
|
+
path: `/v1/projects/${encodeURIComponent(input.projectId)}/availability-checks/${encodeURIComponent(input.checkId)}`,
|
|
19392
|
+
bearerToken: input.bearerToken
|
|
19393
|
+
});
|
|
19394
|
+
if (response.status !== 200) {
|
|
19395
|
+
throw toApiError6(response.status, response.body);
|
|
19396
|
+
}
|
|
19397
|
+
return response.body;
|
|
19398
|
+
},
|
|
19399
|
+
async createHealthCheck(input) {
|
|
19400
|
+
const response = await httpClient.request({
|
|
19401
|
+
method: "POST",
|
|
19402
|
+
path: `/v1/projects/${encodeURIComponent(input.projectId)}/availability-checks`,
|
|
19403
|
+
bearerToken: input.bearerToken,
|
|
19404
|
+
body: buildCreateRequestBody(input)
|
|
19405
|
+
});
|
|
19406
|
+
if (response.status !== 201) {
|
|
19407
|
+
throw toApiError6(response.status, response.body);
|
|
19408
|
+
}
|
|
19409
|
+
return response.body;
|
|
19410
|
+
},
|
|
19411
|
+
async updateHealthCheck(input) {
|
|
19412
|
+
const response = await httpClient.request({
|
|
19413
|
+
method: "PATCH",
|
|
19414
|
+
path: `/v1/projects/${encodeURIComponent(input.projectId)}/availability-checks/${encodeURIComponent(input.checkId)}`,
|
|
19415
|
+
bearerToken: input.bearerToken,
|
|
19416
|
+
body: buildUpdateRequestBody(input)
|
|
19417
|
+
});
|
|
19418
|
+
if (response.status !== 200) {
|
|
19419
|
+
throw toApiError6(response.status, response.body);
|
|
19420
|
+
}
|
|
19421
|
+
return response.body;
|
|
19422
|
+
},
|
|
19423
|
+
async deleteHealthCheck(input) {
|
|
19424
|
+
const response = await httpClient.request({
|
|
19425
|
+
method: "DELETE",
|
|
19426
|
+
path: `/v1/projects/${encodeURIComponent(input.projectId)}/availability-checks/${encodeURIComponent(input.checkId)}`,
|
|
19427
|
+
bearerToken: input.bearerToken
|
|
19428
|
+
});
|
|
19429
|
+
if (response.status !== 200) {
|
|
19430
|
+
throw toApiError6(response.status, response.body);
|
|
19431
|
+
}
|
|
19432
|
+
return response.body;
|
|
19433
|
+
},
|
|
19434
|
+
async testHealthCheck(input) {
|
|
19435
|
+
const response = await httpClient.request({
|
|
19436
|
+
method: "POST",
|
|
19437
|
+
path: `/v1/projects/${encodeURIComponent(input.projectId)}/availability-checks/test`,
|
|
19438
|
+
bearerToken: input.bearerToken,
|
|
19439
|
+
body: {
|
|
19440
|
+
url: input.url,
|
|
19441
|
+
method: input.method,
|
|
19442
|
+
expected_status_min: input.expectedStatusMin,
|
|
19443
|
+
expected_status_max: input.expectedStatusMax,
|
|
19444
|
+
timeout_ms: input.timeoutMs
|
|
19445
|
+
}
|
|
19446
|
+
});
|
|
19447
|
+
if (response.status !== 200) {
|
|
19448
|
+
throw toApiError6(response.status, response.body);
|
|
19449
|
+
}
|
|
19450
|
+
return response.body;
|
|
19451
|
+
},
|
|
19452
|
+
async listHealthCheckResults(input) {
|
|
19453
|
+
const limit = input.limit ?? 20;
|
|
19454
|
+
const response = await httpClient.request({
|
|
19455
|
+
method: "GET",
|
|
19456
|
+
path: `/v1/projects/${encodeURIComponent(input.projectId)}/availability-checks/${encodeURIComponent(input.checkId)}/results?limit=${encodeURIComponent(String(limit))}`,
|
|
19457
|
+
bearerToken: input.bearerToken
|
|
19458
|
+
});
|
|
19459
|
+
if (response.status !== 200) {
|
|
19460
|
+
throw toApiError6(response.status, response.body);
|
|
19461
|
+
}
|
|
19462
|
+
return response.body;
|
|
19463
|
+
},
|
|
19464
|
+
async listHealthCheckDailyRollups(input) {
|
|
19465
|
+
const limit = input.limit ?? 30;
|
|
19466
|
+
const response = await httpClient.request({
|
|
19467
|
+
method: "GET",
|
|
19468
|
+
path: `/v1/projects/${encodeURIComponent(input.projectId)}/availability-checks/${encodeURIComponent(input.checkId)}/daily-rollups?limit=${encodeURIComponent(String(limit))}`,
|
|
19469
|
+
bearerToken: input.bearerToken
|
|
19470
|
+
});
|
|
19471
|
+
if (response.status !== 200) {
|
|
19472
|
+
throw toApiError6(response.status, response.body);
|
|
19473
|
+
}
|
|
19474
|
+
return response.body;
|
|
19475
|
+
}
|
|
19476
|
+
};
|
|
19477
|
+
}
|
|
19478
|
+
|
|
19051
19479
|
// ../cli/src/doctor-command.ts
|
|
19052
19480
|
var import_promises4 = require("node:fs/promises");
|
|
19053
19481
|
var import_node_path4 = require("node:path");
|
|
@@ -20102,7 +20530,7 @@ async function doctorCommand(input, dependencies = {}) {
|
|
|
20102
20530
|
}
|
|
20103
20531
|
|
|
20104
20532
|
// ../cli/src/verify-command.ts
|
|
20105
|
-
var
|
|
20533
|
+
var import_node_crypto7 = require("node:crypto");
|
|
20106
20534
|
var import_promises7 = require("node:fs/promises");
|
|
20107
20535
|
var import_node_path9 = require("node:path");
|
|
20108
20536
|
|
|
@@ -20508,6 +20936,16 @@ var DEFAULT_SESSION_LIFETIME_MS = 1e3 * 60 * 60 * 24 * 7;
|
|
|
20508
20936
|
var DEFAULT_EMAIL_AUTH_CODE_LIFETIME_MS = 1e3 * 60 * 10;
|
|
20509
20937
|
var DEFAULT_GITHUB_OAUTH_STATE_LIFETIME_MS = 1e3 * 60 * 10;
|
|
20510
20938
|
|
|
20939
|
+
// ../../packages/storage/src/availability-check-store-helpers.ts
|
|
20940
|
+
var TIER_CAPABILITIES_SQL = {
|
|
20941
|
+
free_limit: getTierCapabilities("free").availability_checks_per_project,
|
|
20942
|
+
solo_limit: getTierCapabilities("solo").availability_checks_per_project,
|
|
20943
|
+
team_limit: getTierCapabilities("team").availability_checks_per_project,
|
|
20944
|
+
free_interval: getTierCapabilities("free").availability_check_min_interval_seconds,
|
|
20945
|
+
solo_interval: getTierCapabilities("solo").availability_check_min_interval_seconds,
|
|
20946
|
+
team_interval: getTierCapabilities("team").availability_check_min_interval_seconds
|
|
20947
|
+
};
|
|
20948
|
+
|
|
20511
20949
|
// ../../packages/storage/src/auth-rate-limiter.ts
|
|
20512
20950
|
var import_ioredis = __toESM(require_built3(), 1);
|
|
20513
20951
|
|
|
@@ -20525,8 +20963,131 @@ var import_ioredis3 = __toESM(require_built3(), 1);
|
|
|
20525
20963
|
var import_ioredis4 = __toESM(require_built3(), 1);
|
|
20526
20964
|
var DEFAULT_PROCESSING_TIMEOUT_MS = 5 * 60 * 1e3;
|
|
20527
20965
|
|
|
20528
|
-
// ../../packages/storage/src/
|
|
20529
|
-
var
|
|
20966
|
+
// ../../packages/storage/src/availability-check-bootstrap-statements.ts
|
|
20967
|
+
var AVAILABILITY_CHECK_BOOTSTRAP_STATEMENTS = [
|
|
20968
|
+
`
|
|
20969
|
+
CREATE TABLE availability_checks (
|
|
20970
|
+
id uuid PRIMARY KEY,
|
|
20971
|
+
project_id uuid NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
|
|
20972
|
+
created_by_user_id uuid REFERENCES users(id) ON DELETE SET NULL,
|
|
20973
|
+
name text NOT NULL,
|
|
20974
|
+
url text NOT NULL,
|
|
20975
|
+
method text NOT NULL CHECK (method IN ('GET', 'HEAD')),
|
|
20976
|
+
expected_status_min integer NOT NULL DEFAULT 200 CHECK (expected_status_min BETWEEN 100 AND 599),
|
|
20977
|
+
expected_status_max integer NOT NULL DEFAULT 399 CHECK (expected_status_max BETWEEN 100 AND 599),
|
|
20978
|
+
timeout_ms integer NOT NULL DEFAULT 5000 CHECK (timeout_ms BETWEEN 500 AND 5000),
|
|
20979
|
+
interval_seconds integer NOT NULL CHECK (interval_seconds >= 30),
|
|
20980
|
+
failure_threshold integer NOT NULL DEFAULT 3 CHECK (failure_threshold BETWEEN 1 AND 10),
|
|
20981
|
+
recovery_threshold integer NOT NULL DEFAULT 2 CHECK (recovery_threshold BETWEEN 1 AND 10),
|
|
20982
|
+
environment text NOT NULL DEFAULT 'production',
|
|
20983
|
+
service_name text,
|
|
20984
|
+
enabled boolean NOT NULL DEFAULT true,
|
|
20985
|
+
status text NOT NULL DEFAULT 'unknown' CHECK (status IN ('unknown', 'passing', 'failing')),
|
|
20986
|
+
consecutive_failures integer NOT NULL DEFAULT 0,
|
|
20987
|
+
consecutive_successes integer NOT NULL DEFAULT 0,
|
|
20988
|
+
linked_incident_id uuid REFERENCES incidents(id) ON DELETE SET NULL,
|
|
20989
|
+
last_checked_at timestamptz,
|
|
20990
|
+
next_check_at timestamptz,
|
|
20991
|
+
claimed_at timestamptz,
|
|
20992
|
+
last_result_status text CHECK (
|
|
20993
|
+
last_result_status IS NULL OR last_result_status IN (
|
|
20994
|
+
'success',
|
|
20995
|
+
'http_status_mismatch',
|
|
20996
|
+
'timeout',
|
|
20997
|
+
'dns_error',
|
|
20998
|
+
'tls_error',
|
|
20999
|
+
'connection_error',
|
|
21000
|
+
'redirect_blocked',
|
|
21001
|
+
'security_blocked',
|
|
21002
|
+
'internal_error'
|
|
21003
|
+
)
|
|
21004
|
+
),
|
|
21005
|
+
last_result_http_status integer,
|
|
21006
|
+
last_result_error_kind text,
|
|
21007
|
+
last_result_error_message text,
|
|
21008
|
+
last_result_duration_ms integer,
|
|
21009
|
+
deleted_at timestamptz,
|
|
21010
|
+
created_at timestamptz NOT NULL DEFAULT now(),
|
|
21011
|
+
updated_at timestamptz NOT NULL DEFAULT now()
|
|
21012
|
+
)
|
|
21013
|
+
`,
|
|
21014
|
+
`
|
|
21015
|
+
CREATE INDEX availability_checks_project_created_idx
|
|
21016
|
+
ON availability_checks (project_id, created_at DESC)
|
|
21017
|
+
`,
|
|
21018
|
+
`
|
|
21019
|
+
CREATE INDEX availability_checks_due_idx
|
|
21020
|
+
ON availability_checks (next_check_at, project_id)
|
|
21021
|
+
`,
|
|
21022
|
+
`
|
|
21023
|
+
CREATE INDEX availability_checks_claimed_idx
|
|
21024
|
+
ON availability_checks (claimed_at)
|
|
21025
|
+
`,
|
|
21026
|
+
`
|
|
21027
|
+
CREATE TABLE availability_check_results (
|
|
21028
|
+
id uuid PRIMARY KEY,
|
|
21029
|
+
check_id uuid NOT NULL REFERENCES availability_checks(id) ON DELETE CASCADE,
|
|
21030
|
+
project_id uuid NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
|
|
21031
|
+
started_at timestamptz NOT NULL,
|
|
21032
|
+
completed_at timestamptz NOT NULL,
|
|
21033
|
+
duration_ms integer NOT NULL,
|
|
21034
|
+
status text NOT NULL CHECK (
|
|
21035
|
+
status IN (
|
|
21036
|
+
'success',
|
|
21037
|
+
'http_status_mismatch',
|
|
21038
|
+
'timeout',
|
|
21039
|
+
'dns_error',
|
|
21040
|
+
'tls_error',
|
|
21041
|
+
'connection_error',
|
|
21042
|
+
'redirect_blocked',
|
|
21043
|
+
'security_blocked',
|
|
21044
|
+
'internal_error'
|
|
21045
|
+
)
|
|
21046
|
+
),
|
|
21047
|
+
http_status integer,
|
|
21048
|
+
error_kind text,
|
|
21049
|
+
error_message text,
|
|
21050
|
+
redirect_count integer NOT NULL DEFAULT 0,
|
|
21051
|
+
checked_url_host text NOT NULL,
|
|
21052
|
+
checked_url_path text NOT NULL,
|
|
21053
|
+
final_url text NOT NULL,
|
|
21054
|
+
created_at timestamptz NOT NULL DEFAULT now()
|
|
21055
|
+
)
|
|
21056
|
+
`,
|
|
21057
|
+
`
|
|
21058
|
+
CREATE INDEX availability_check_results_check_started_idx
|
|
21059
|
+
ON availability_check_results (check_id, started_at DESC)
|
|
21060
|
+
`,
|
|
21061
|
+
`
|
|
21062
|
+
CREATE INDEX availability_check_results_project_started_idx
|
|
21063
|
+
ON availability_check_results (project_id, started_at DESC)
|
|
21064
|
+
`,
|
|
21065
|
+
`
|
|
21066
|
+
CREATE TABLE availability_check_daily_rollups (
|
|
21067
|
+
id uuid PRIMARY KEY,
|
|
21068
|
+
check_id uuid NOT NULL REFERENCES availability_checks(id) ON DELETE CASCADE,
|
|
21069
|
+
project_id uuid NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
|
|
21070
|
+
day date NOT NULL,
|
|
21071
|
+
state text NOT NULL CHECK (state IN ('unknown', 'operational', 'degraded', 'down', 'paused')),
|
|
21072
|
+
total_checks integer NOT NULL DEFAULT 0,
|
|
21073
|
+
successful_checks integer NOT NULL DEFAULT 0,
|
|
21074
|
+
failed_checks integer NOT NULL DEFAULT 0,
|
|
21075
|
+
degraded_checks integer NOT NULL DEFAULT 0,
|
|
21076
|
+
avg_duration_ms integer,
|
|
21077
|
+
first_checked_at timestamptz,
|
|
21078
|
+
last_checked_at timestamptz,
|
|
21079
|
+
downtime_seconds integer NOT NULL DEFAULT 0,
|
|
21080
|
+
incident_ids uuid[] NOT NULL DEFAULT '{}'::uuid[],
|
|
21081
|
+
created_at timestamptz NOT NULL DEFAULT now(),
|
|
21082
|
+
updated_at timestamptz NOT NULL DEFAULT now(),
|
|
21083
|
+
UNIQUE (check_id, day)
|
|
21084
|
+
)
|
|
21085
|
+
`,
|
|
21086
|
+
`
|
|
21087
|
+
CREATE INDEX availability_check_daily_rollups_project_day_idx
|
|
21088
|
+
ON availability_check_daily_rollups (project_id, day DESC)
|
|
21089
|
+
`
|
|
21090
|
+
];
|
|
20530
21091
|
|
|
20531
21092
|
// ../../packages/storage/src/storage-bootstrap-statements.ts
|
|
20532
21093
|
var STORAGE_BOOTSTRAP_STATEMENTS = [
|
|
@@ -20695,6 +21256,7 @@ var STORAGE_BOOTSTRAP_STATEMENTS = [
|
|
|
20695
21256
|
user_id uuid NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
|
20696
21257
|
organization_id uuid NOT NULL REFERENCES organizations(id) ON DELETE CASCADE,
|
|
20697
21258
|
session_token_hash text UNIQUE NOT NULL,
|
|
21259
|
+
auth_method text CHECK (auth_method IS NULL OR auth_method IN ('email_code', 'github_oauth')),
|
|
20698
21260
|
created_at timestamptz NOT NULL DEFAULT now(),
|
|
20699
21261
|
expires_at timestamptz NOT NULL,
|
|
20700
21262
|
revoked_at timestamptz
|
|
@@ -21623,80 +22185,325 @@ var STORAGE_BOOTSTRAP_STATEMENTS = [
|
|
|
21623
22185
|
`
|
|
21624
22186
|
];
|
|
21625
22187
|
|
|
22188
|
+
// ../../packages/storage/src/storage-bootstrap-all-statements.ts
|
|
22189
|
+
var STORAGE_BOOTSTRAP_STATEMENTS2 = [
|
|
22190
|
+
...STORAGE_BOOTSTRAP_STATEMENTS,
|
|
22191
|
+
...AVAILABILITY_CHECK_BOOTSTRAP_STATEMENTS
|
|
22192
|
+
];
|
|
22193
|
+
|
|
21626
22194
|
// ../../packages/storage/src/migrations.ts
|
|
21627
|
-
var STORAGE_BOOTSTRAP_SQL =
|
|
22195
|
+
var STORAGE_BOOTSTRAP_SQL = STORAGE_BOOTSTRAP_STATEMENTS2.join(";\n\n");
|
|
21628
22196
|
|
|
21629
|
-
// ../../packages/storage/src/schema-migrations.ts
|
|
21630
|
-
|
|
21631
|
-
|
|
21632
|
-
}
|
|
21633
|
-
function defineStorageSchemaMigration(input) {
|
|
22197
|
+
// ../../packages/storage/src/availability-check-schema-migrations.ts
|
|
22198
|
+
var import_node_crypto3 = require("node:crypto");
|
|
22199
|
+
function defineAvailabilityCheckStorageSchemaMigration(input) {
|
|
21634
22200
|
return {
|
|
21635
22201
|
...input,
|
|
21636
|
-
checksum:
|
|
22202
|
+
checksum: (0, import_node_crypto3.createHash)("sha256").update(JSON.stringify(input)).digest("hex")
|
|
21637
22203
|
};
|
|
21638
22204
|
}
|
|
21639
|
-
var
|
|
21640
|
-
|
|
21641
|
-
id: "
|
|
21642
|
-
description: "Add
|
|
21643
|
-
statements: [
|
|
21644
|
-
"ALTER TABLE organizations ADD COLUMN IF NOT EXISTS suspended_at timestamptz",
|
|
21645
|
-
"ALTER TABLE organization_members ADD COLUMN IF NOT EXISTS suspended_at timestamptz"
|
|
21646
|
-
]
|
|
21647
|
-
}),
|
|
21648
|
-
defineStorageSchemaMigration({
|
|
21649
|
-
id: "202605120001_add_github_device_authorizations",
|
|
21650
|
-
description: "Add persisted GitHub CLI bootstrap state for device-flow login.",
|
|
22205
|
+
var AVAILABILITY_CHECK_STORAGE_SCHEMA_MIGRATIONS = [
|
|
22206
|
+
defineAvailabilityCheckStorageSchemaMigration({
|
|
22207
|
+
id: "202606150001_add_availability_checks",
|
|
22208
|
+
description: "Add project-scoped availability checks, result history, and daily rollups.",
|
|
21651
22209
|
statements: [
|
|
21652
22210
|
`
|
|
21653
|
-
CREATE TABLE IF NOT EXISTS
|
|
22211
|
+
CREATE TABLE IF NOT EXISTS availability_checks (
|
|
21654
22212
|
id uuid PRIMARY KEY,
|
|
21655
|
-
|
|
21656
|
-
|
|
21657
|
-
|
|
22213
|
+
project_id uuid NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
|
|
22214
|
+
created_by_user_id uuid REFERENCES users(id) ON DELETE SET NULL,
|
|
22215
|
+
name text NOT NULL,
|
|
22216
|
+
url text NOT NULL,
|
|
22217
|
+
method text NOT NULL,
|
|
22218
|
+
expected_status_min integer NOT NULL DEFAULT 200,
|
|
22219
|
+
expected_status_max integer NOT NULL DEFAULT 399,
|
|
22220
|
+
timeout_ms integer NOT NULL DEFAULT 5000,
|
|
21658
22221
|
interval_seconds integer NOT NULL,
|
|
21659
|
-
|
|
21660
|
-
|
|
21661
|
-
|
|
21662
|
-
|
|
22222
|
+
failure_threshold integer NOT NULL DEFAULT 3,
|
|
22223
|
+
recovery_threshold integer NOT NULL DEFAULT 2,
|
|
22224
|
+
environment text NOT NULL DEFAULT 'production',
|
|
22225
|
+
service_name text,
|
|
22226
|
+
enabled boolean NOT NULL DEFAULT true,
|
|
22227
|
+
status text NOT NULL DEFAULT 'unknown',
|
|
22228
|
+
consecutive_failures integer NOT NULL DEFAULT 0,
|
|
22229
|
+
consecutive_successes integer NOT NULL DEFAULT 0,
|
|
22230
|
+
linked_incident_id uuid REFERENCES incidents(id) ON DELETE SET NULL,
|
|
22231
|
+
last_checked_at timestamptz,
|
|
22232
|
+
next_check_at timestamptz,
|
|
21663
22233
|
claimed_at timestamptz,
|
|
21664
|
-
|
|
21665
|
-
|
|
21666
|
-
|
|
22234
|
+
last_result_status text,
|
|
22235
|
+
last_result_http_status integer,
|
|
22236
|
+
last_result_error_kind text,
|
|
22237
|
+
last_result_error_message text,
|
|
22238
|
+
last_result_duration_ms integer,
|
|
22239
|
+
deleted_at timestamptz,
|
|
22240
|
+
created_at timestamptz NOT NULL DEFAULT now(),
|
|
22241
|
+
updated_at timestamptz NOT NULL DEFAULT now()
|
|
21667
22242
|
)
|
|
21668
22243
|
`,
|
|
21669
22244
|
`
|
|
21670
|
-
|
|
21671
|
-
|
|
22245
|
+
ALTER TABLE availability_checks
|
|
22246
|
+
DROP CONSTRAINT IF EXISTS availability_checks_method_check
|
|
21672
22247
|
`,
|
|
21673
22248
|
`
|
|
21674
|
-
|
|
21675
|
-
|
|
22249
|
+
ALTER TABLE availability_checks
|
|
22250
|
+
ADD CONSTRAINT availability_checks_method_check
|
|
22251
|
+
CHECK (method IN ('GET', 'HEAD'))
|
|
22252
|
+
`,
|
|
21676
22253
|
`
|
|
21677
|
-
|
|
21678
|
-
|
|
21679
|
-
|
|
21680
|
-
id: "202605130001_allow_synthetic_webhook_test_deliveries_without_incident_fk",
|
|
21681
|
-
description: "Allow webhook test deliveries to persist without requiring a backing incidents row.",
|
|
21682
|
-
statements: ["ALTER TABLE webhook_deliveries ALTER COLUMN incident_id DROP NOT NULL"]
|
|
21683
|
-
}),
|
|
21684
|
-
defineStorageSchemaMigration({
|
|
21685
|
-
id: "202605130002_add_slack_destinations",
|
|
21686
|
-
description: "Add reusable encrypted Slack alert destinations scoped to organizations.",
|
|
21687
|
-
statements: [
|
|
22254
|
+
ALTER TABLE availability_checks
|
|
22255
|
+
DROP CONSTRAINT IF EXISTS availability_checks_expected_status_min_check
|
|
22256
|
+
`,
|
|
21688
22257
|
`
|
|
21689
|
-
|
|
21690
|
-
|
|
21691
|
-
|
|
21692
|
-
|
|
21693
|
-
|
|
21694
|
-
|
|
21695
|
-
|
|
21696
|
-
|
|
21697
|
-
|
|
21698
|
-
|
|
21699
|
-
|
|
22258
|
+
ALTER TABLE availability_checks
|
|
22259
|
+
ADD CONSTRAINT availability_checks_expected_status_min_check
|
|
22260
|
+
CHECK (expected_status_min BETWEEN 100 AND 599)
|
|
22261
|
+
`,
|
|
22262
|
+
`
|
|
22263
|
+
ALTER TABLE availability_checks
|
|
22264
|
+
DROP CONSTRAINT IF EXISTS availability_checks_expected_status_max_check
|
|
22265
|
+
`,
|
|
22266
|
+
`
|
|
22267
|
+
ALTER TABLE availability_checks
|
|
22268
|
+
ADD CONSTRAINT availability_checks_expected_status_max_check
|
|
22269
|
+
CHECK (expected_status_max BETWEEN 100 AND 599)
|
|
22270
|
+
`,
|
|
22271
|
+
`
|
|
22272
|
+
ALTER TABLE availability_checks
|
|
22273
|
+
DROP CONSTRAINT IF EXISTS availability_checks_timeout_ms_check
|
|
22274
|
+
`,
|
|
22275
|
+
`
|
|
22276
|
+
ALTER TABLE availability_checks
|
|
22277
|
+
ADD CONSTRAINT availability_checks_timeout_ms_check
|
|
22278
|
+
CHECK (timeout_ms BETWEEN 500 AND 5000)
|
|
22279
|
+
`,
|
|
22280
|
+
`
|
|
22281
|
+
ALTER TABLE availability_checks
|
|
22282
|
+
DROP CONSTRAINT IF EXISTS availability_checks_interval_seconds_check
|
|
22283
|
+
`,
|
|
22284
|
+
`
|
|
22285
|
+
ALTER TABLE availability_checks
|
|
22286
|
+
ADD CONSTRAINT availability_checks_interval_seconds_check
|
|
22287
|
+
CHECK (interval_seconds >= 30)
|
|
22288
|
+
`,
|
|
22289
|
+
`
|
|
22290
|
+
ALTER TABLE availability_checks
|
|
22291
|
+
DROP CONSTRAINT IF EXISTS availability_checks_failure_threshold_check
|
|
22292
|
+
`,
|
|
22293
|
+
`
|
|
22294
|
+
ALTER TABLE availability_checks
|
|
22295
|
+
ADD CONSTRAINT availability_checks_failure_threshold_check
|
|
22296
|
+
CHECK (failure_threshold BETWEEN 1 AND 10)
|
|
22297
|
+
`,
|
|
22298
|
+
`
|
|
22299
|
+
ALTER TABLE availability_checks
|
|
22300
|
+
DROP CONSTRAINT IF EXISTS availability_checks_recovery_threshold_check
|
|
22301
|
+
`,
|
|
22302
|
+
`
|
|
22303
|
+
ALTER TABLE availability_checks
|
|
22304
|
+
ADD CONSTRAINT availability_checks_recovery_threshold_check
|
|
22305
|
+
CHECK (recovery_threshold BETWEEN 1 AND 10)
|
|
22306
|
+
`,
|
|
22307
|
+
`
|
|
22308
|
+
ALTER TABLE availability_checks
|
|
22309
|
+
DROP CONSTRAINT IF EXISTS availability_checks_status_check
|
|
22310
|
+
`,
|
|
22311
|
+
`
|
|
22312
|
+
ALTER TABLE availability_checks
|
|
22313
|
+
ADD CONSTRAINT availability_checks_status_check
|
|
22314
|
+
CHECK (status IN ('unknown', 'passing', 'failing'))
|
|
22315
|
+
`,
|
|
22316
|
+
`
|
|
22317
|
+
ALTER TABLE availability_checks
|
|
22318
|
+
DROP CONSTRAINT IF EXISTS availability_checks_last_result_status_check
|
|
22319
|
+
`,
|
|
22320
|
+
`
|
|
22321
|
+
ALTER TABLE availability_checks
|
|
22322
|
+
ADD CONSTRAINT availability_checks_last_result_status_check
|
|
22323
|
+
CHECK (
|
|
22324
|
+
last_result_status IS NULL OR last_result_status IN (
|
|
22325
|
+
'success',
|
|
22326
|
+
'http_status_mismatch',
|
|
22327
|
+
'timeout',
|
|
22328
|
+
'dns_error',
|
|
22329
|
+
'tls_error',
|
|
22330
|
+
'connection_error',
|
|
22331
|
+
'redirect_blocked',
|
|
22332
|
+
'security_blocked',
|
|
22333
|
+
'internal_error'
|
|
22334
|
+
)
|
|
22335
|
+
)
|
|
22336
|
+
`,
|
|
22337
|
+
`
|
|
22338
|
+
CREATE INDEX IF NOT EXISTS availability_checks_project_created_idx
|
|
22339
|
+
ON availability_checks (project_id, created_at DESC)
|
|
22340
|
+
`,
|
|
22341
|
+
`
|
|
22342
|
+
CREATE INDEX IF NOT EXISTS availability_checks_due_idx
|
|
22343
|
+
ON availability_checks (next_check_at, project_id)
|
|
22344
|
+
`,
|
|
22345
|
+
`
|
|
22346
|
+
CREATE INDEX IF NOT EXISTS availability_checks_claimed_idx
|
|
22347
|
+
ON availability_checks (claimed_at)
|
|
22348
|
+
`,
|
|
22349
|
+
`
|
|
22350
|
+
CREATE TABLE IF NOT EXISTS availability_check_results (
|
|
22351
|
+
id uuid PRIMARY KEY,
|
|
22352
|
+
check_id uuid NOT NULL REFERENCES availability_checks(id) ON DELETE CASCADE,
|
|
22353
|
+
project_id uuid NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
|
|
22354
|
+
started_at timestamptz NOT NULL,
|
|
22355
|
+
completed_at timestamptz NOT NULL,
|
|
22356
|
+
duration_ms integer NOT NULL,
|
|
22357
|
+
status text NOT NULL,
|
|
22358
|
+
http_status integer,
|
|
22359
|
+
error_kind text,
|
|
22360
|
+
error_message text,
|
|
22361
|
+
redirect_count integer NOT NULL DEFAULT 0,
|
|
22362
|
+
checked_url_host text NOT NULL,
|
|
22363
|
+
checked_url_path text NOT NULL,
|
|
22364
|
+
final_url text NOT NULL,
|
|
22365
|
+
created_at timestamptz NOT NULL DEFAULT now()
|
|
22366
|
+
)
|
|
22367
|
+
`,
|
|
22368
|
+
`
|
|
22369
|
+
ALTER TABLE availability_check_results
|
|
22370
|
+
DROP CONSTRAINT IF EXISTS availability_check_results_status_check
|
|
22371
|
+
`,
|
|
22372
|
+
`
|
|
22373
|
+
ALTER TABLE availability_check_results
|
|
22374
|
+
ADD CONSTRAINT availability_check_results_status_check
|
|
22375
|
+
CHECK (
|
|
22376
|
+
status IN (
|
|
22377
|
+
'success',
|
|
22378
|
+
'http_status_mismatch',
|
|
22379
|
+
'timeout',
|
|
22380
|
+
'dns_error',
|
|
22381
|
+
'tls_error',
|
|
22382
|
+
'connection_error',
|
|
22383
|
+
'redirect_blocked',
|
|
22384
|
+
'security_blocked',
|
|
22385
|
+
'internal_error'
|
|
22386
|
+
)
|
|
22387
|
+
)
|
|
22388
|
+
`,
|
|
22389
|
+
`
|
|
22390
|
+
CREATE INDEX IF NOT EXISTS availability_check_results_check_started_idx
|
|
22391
|
+
ON availability_check_results (check_id, started_at DESC)
|
|
22392
|
+
`,
|
|
22393
|
+
`
|
|
22394
|
+
CREATE INDEX IF NOT EXISTS availability_check_results_project_started_idx
|
|
22395
|
+
ON availability_check_results (project_id, started_at DESC)
|
|
22396
|
+
`,
|
|
22397
|
+
`
|
|
22398
|
+
CREATE TABLE IF NOT EXISTS availability_check_daily_rollups (
|
|
22399
|
+
id uuid PRIMARY KEY,
|
|
22400
|
+
check_id uuid NOT NULL REFERENCES availability_checks(id) ON DELETE CASCADE,
|
|
22401
|
+
project_id uuid NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
|
|
22402
|
+
day date NOT NULL,
|
|
22403
|
+
state text NOT NULL,
|
|
22404
|
+
total_checks integer NOT NULL DEFAULT 0,
|
|
22405
|
+
successful_checks integer NOT NULL DEFAULT 0,
|
|
22406
|
+
failed_checks integer NOT NULL DEFAULT 0,
|
|
22407
|
+
degraded_checks integer NOT NULL DEFAULT 0,
|
|
22408
|
+
avg_duration_ms integer,
|
|
22409
|
+
first_checked_at timestamptz,
|
|
22410
|
+
last_checked_at timestamptz,
|
|
22411
|
+
downtime_seconds integer NOT NULL DEFAULT 0,
|
|
22412
|
+
incident_ids uuid[] NOT NULL DEFAULT '{}'::uuid[],
|
|
22413
|
+
created_at timestamptz NOT NULL DEFAULT now(),
|
|
22414
|
+
updated_at timestamptz NOT NULL DEFAULT now(),
|
|
22415
|
+
UNIQUE (check_id, day)
|
|
22416
|
+
)
|
|
22417
|
+
`,
|
|
22418
|
+
`
|
|
22419
|
+
ALTER TABLE availability_check_daily_rollups
|
|
22420
|
+
DROP CONSTRAINT IF EXISTS availability_check_daily_rollups_state_check
|
|
22421
|
+
`,
|
|
22422
|
+
`
|
|
22423
|
+
ALTER TABLE availability_check_daily_rollups
|
|
22424
|
+
ADD CONSTRAINT availability_check_daily_rollups_state_check
|
|
22425
|
+
CHECK (state IN ('unknown', 'operational', 'degraded', 'down', 'paused'))
|
|
22426
|
+
`,
|
|
22427
|
+
`
|
|
22428
|
+
CREATE INDEX IF NOT EXISTS availability_check_daily_rollups_project_day_idx
|
|
22429
|
+
ON availability_check_daily_rollups (project_id, day DESC)
|
|
22430
|
+
`
|
|
22431
|
+
]
|
|
22432
|
+
})
|
|
22433
|
+
];
|
|
22434
|
+
|
|
22435
|
+
// ../../packages/storage/src/schema-migrations-catalog.ts
|
|
22436
|
+
var import_node_crypto4 = require("node:crypto");
|
|
22437
|
+
function computeMigrationChecksum(input) {
|
|
22438
|
+
return (0, import_node_crypto4.createHash)("sha256").update(JSON.stringify(input)).digest("hex");
|
|
22439
|
+
}
|
|
22440
|
+
function defineStorageSchemaMigration(input) {
|
|
22441
|
+
return {
|
|
22442
|
+
...input,
|
|
22443
|
+
checksum: computeMigrationChecksum(input)
|
|
22444
|
+
};
|
|
22445
|
+
}
|
|
22446
|
+
var STORAGE_SCHEMA_MIGRATIONS = [
|
|
22447
|
+
defineStorageSchemaMigration({
|
|
22448
|
+
id: "202605050001_add_auth_suspension_columns",
|
|
22449
|
+
description: "Add organization and membership suspension timestamps used by auth gates.",
|
|
22450
|
+
statements: [
|
|
22451
|
+
"ALTER TABLE organizations ADD COLUMN IF NOT EXISTS suspended_at timestamptz",
|
|
22452
|
+
"ALTER TABLE organization_members ADD COLUMN IF NOT EXISTS suspended_at timestamptz"
|
|
22453
|
+
]
|
|
22454
|
+
}),
|
|
22455
|
+
defineStorageSchemaMigration({
|
|
22456
|
+
id: "202605120001_add_github_device_authorizations",
|
|
22457
|
+
description: "Add persisted GitHub CLI bootstrap state for device-flow login.",
|
|
22458
|
+
statements: [
|
|
22459
|
+
`
|
|
22460
|
+
CREATE TABLE IF NOT EXISTS github_device_authorizations (
|
|
22461
|
+
id uuid PRIMARY KEY,
|
|
22462
|
+
device_code text NOT NULL UNIQUE,
|
|
22463
|
+
user_code text NOT NULL,
|
|
22464
|
+
verification_uri text NOT NULL,
|
|
22465
|
+
interval_seconds integer NOT NULL,
|
|
22466
|
+
expires_at timestamptz NOT NULL,
|
|
22467
|
+
accepted_terms_at timestamptz,
|
|
22468
|
+
created_at timestamptz NOT NULL DEFAULT now(),
|
|
22469
|
+
completed_at timestamptz,
|
|
22470
|
+
claimed_at timestamptz,
|
|
22471
|
+
terminal_error text,
|
|
22472
|
+
user_id uuid REFERENCES users(id) ON DELETE SET NULL,
|
|
22473
|
+
organization_id uuid REFERENCES organizations(id) ON DELETE SET NULL
|
|
22474
|
+
)
|
|
22475
|
+
`,
|
|
22476
|
+
`
|
|
22477
|
+
CREATE INDEX IF NOT EXISTS github_device_authorizations_user_code_idx
|
|
22478
|
+
ON github_device_authorizations (user_code, created_at DESC)
|
|
22479
|
+
`,
|
|
22480
|
+
`
|
|
22481
|
+
CREATE INDEX IF NOT EXISTS github_device_authorizations_expires_at_idx
|
|
22482
|
+
ON github_device_authorizations (expires_at)
|
|
22483
|
+
`
|
|
22484
|
+
]
|
|
22485
|
+
}),
|
|
22486
|
+
defineStorageSchemaMigration({
|
|
22487
|
+
id: "202605130001_allow_synthetic_webhook_test_deliveries_without_incident_fk",
|
|
22488
|
+
description: "Allow webhook test deliveries to persist without requiring a backing incidents row.",
|
|
22489
|
+
statements: ["ALTER TABLE webhook_deliveries ALTER COLUMN incident_id DROP NOT NULL"]
|
|
22490
|
+
}),
|
|
22491
|
+
defineStorageSchemaMigration({
|
|
22492
|
+
id: "202605130002_add_slack_destinations",
|
|
22493
|
+
description: "Add reusable encrypted Slack alert destinations scoped to organizations.",
|
|
22494
|
+
statements: [
|
|
22495
|
+
`
|
|
22496
|
+
CREATE TABLE IF NOT EXISTS slack_destinations (
|
|
22497
|
+
id uuid PRIMARY KEY,
|
|
22498
|
+
organization_id uuid NOT NULL REFERENCES organizations(id) ON DELETE CASCADE,
|
|
22499
|
+
slack_team_id text NOT NULL,
|
|
22500
|
+
slack_team_name text,
|
|
22501
|
+
slack_channel_id text NOT NULL,
|
|
22502
|
+
slack_channel_name text,
|
|
22503
|
+
webhook_url_ciphertext text NOT NULL,
|
|
22504
|
+
installed_by_member_id uuid REFERENCES users(id) ON DELETE SET NULL,
|
|
22505
|
+
is_active boolean NOT NULL DEFAULT true,
|
|
22506
|
+
created_at timestamptz NOT NULL DEFAULT now(),
|
|
21700
22507
|
updated_at timestamptz NOT NULL DEFAULT now(),
|
|
21701
22508
|
UNIQUE (organization_id, slack_team_id, slack_channel_id)
|
|
21702
22509
|
)
|
|
@@ -22457,15 +23264,47 @@ var STORAGE_SCHEMA_MIGRATIONS = [
|
|
|
22457
23264
|
ON account_payment_provider_events (provider, provider_event_id)
|
|
22458
23265
|
`
|
|
22459
23266
|
]
|
|
23267
|
+
}),
|
|
23268
|
+
defineStorageSchemaMigration({
|
|
23269
|
+
id: "202606120001_add_session_auth_method",
|
|
23270
|
+
description: "Track the auth method used to create each browser session.",
|
|
23271
|
+
statements: [
|
|
23272
|
+
"ALTER TABLE sessions ADD COLUMN IF NOT EXISTS auth_method text",
|
|
23273
|
+
"ALTER TABLE sessions DROP CONSTRAINT IF EXISTS sessions_auth_method_check",
|
|
23274
|
+
`
|
|
23275
|
+
ALTER TABLE sessions
|
|
23276
|
+
ADD CONSTRAINT sessions_auth_method_check
|
|
23277
|
+
CHECK (auth_method IS NULL OR auth_method IN ('email_code', 'github_oauth'))
|
|
23278
|
+
`
|
|
23279
|
+
]
|
|
23280
|
+
}),
|
|
23281
|
+
defineStorageSchemaMigration({
|
|
23282
|
+
id: "202606130001_retire_expired_project_invites",
|
|
23283
|
+
description: "Retire already-expired project invites so re-inviting the same email is unblocked.",
|
|
23284
|
+
statements: [
|
|
23285
|
+
`
|
|
23286
|
+
UPDATE project_invites
|
|
23287
|
+
SET canceled_at = expires_at
|
|
23288
|
+
WHERE accepted_at IS NULL
|
|
23289
|
+
AND canceled_at IS NULL
|
|
23290
|
+
AND expires_at <= now()
|
|
23291
|
+
`
|
|
23292
|
+
]
|
|
22460
23293
|
})
|
|
22461
23294
|
];
|
|
22462
23295
|
|
|
23296
|
+
// ../../packages/storage/src/schema-migrations.ts
|
|
23297
|
+
var STORAGE_SCHEMA_MIGRATIONS2 = [
|
|
23298
|
+
...STORAGE_SCHEMA_MIGRATIONS,
|
|
23299
|
+
...AVAILABILITY_CHECK_STORAGE_SCHEMA_MIGRATIONS
|
|
23300
|
+
];
|
|
23301
|
+
|
|
22463
23302
|
// ../cli/src/ingest-command.ts
|
|
22464
|
-
var
|
|
23303
|
+
var import_node_crypto6 = require("node:crypto");
|
|
22465
23304
|
var import_node_path7 = require("node:path");
|
|
22466
23305
|
|
|
22467
23306
|
// ../cli/src/process-command.ts
|
|
22468
|
-
var
|
|
23307
|
+
var import_node_crypto5 = require("node:crypto");
|
|
22469
23308
|
var import_promises5 = require("node:fs/promises");
|
|
22470
23309
|
var import_node_path6 = require("node:path");
|
|
22471
23310
|
|
|
@@ -23651,7 +24490,7 @@ function mergeAggregateGroup(aggregates) {
|
|
|
23651
24490
|
});
|
|
23652
24491
|
}
|
|
23653
24492
|
function hashIdentifier(parts, prefix, length) {
|
|
23654
|
-
const digest = (0,
|
|
24493
|
+
const digest = (0, import_node_crypto5.createHash)("sha256").update(parts.join("\0")).digest("hex");
|
|
23655
24494
|
return `${prefix}_${digest.slice(0, length)}`;
|
|
23656
24495
|
}
|
|
23657
24496
|
function deriveIncidentId(projectId, serviceName, environment, incidentFingerprint) {
|
|
@@ -23685,7 +24524,7 @@ function stableJson3(value) {
|
|
|
23685
24524
|
return `{${keys.map((key) => `${JSON.stringify(key)}:${stableJson3(record[key])}`).join(",")}}`;
|
|
23686
24525
|
}
|
|
23687
24526
|
function buildRequestAnomalyFingerprint(input) {
|
|
23688
|
-
return (0,
|
|
24527
|
+
return (0, import_node_crypto5.createHash)("sha256").update(
|
|
23689
24528
|
stableJson3({
|
|
23690
24529
|
kind: "request_status_anomaly",
|
|
23691
24530
|
project_id: input.projectId,
|
|
@@ -24316,7 +25155,7 @@ function buildEventFileName(events, filePath) {
|
|
|
24316
25155
|
const candidate = Date.parse(event.occurred_at);
|
|
24317
25156
|
return Number.isFinite(candidate) && candidate > latest ? candidate : latest;
|
|
24318
25157
|
}, 0);
|
|
24319
|
-
const digest = (0,
|
|
25158
|
+
const digest = (0, import_node_crypto6.createHash)("sha256").update([filePath, ...events.map((event) => event.event_id)].join("\0")).digest("hex").slice(0, 8);
|
|
24320
25159
|
return `${lastOccurredAt}-${digest}-${slugify(events[0]?.service.name ?? (0, import_node_path7.basename)(filePath))}.events.json`;
|
|
24321
25160
|
}
|
|
24322
25161
|
async function readProfile(rootDirectory, readFile) {
|
|
@@ -24725,7 +25564,7 @@ function cloudVerificationRunId(now) {
|
|
|
24725
25564
|
return now.toISOString().replace(/[-:.TZ]/g, "").slice(0, 14);
|
|
24726
25565
|
}
|
|
24727
25566
|
function defaultCloudVerificationSuffix() {
|
|
24728
|
-
return (0,
|
|
25567
|
+
return (0, import_node_crypto7.randomUUID)().replace(/-/g, "").slice(0, 12);
|
|
24729
25568
|
}
|
|
24730
25569
|
function normalizeCloudVerificationSuffix(suffix) {
|
|
24731
25570
|
const normalized = suffix.toLowerCase().replace(/[^a-z0-9]/g, "").slice(0, 12);
|
|
@@ -26509,8 +27348,176 @@ function createProbeMcpTools(api) {
|
|
|
26509
27348
|
};
|
|
26510
27349
|
}
|
|
26511
27350
|
|
|
26512
|
-
// src/
|
|
27351
|
+
// src/health-check-tools.ts
|
|
26513
27352
|
function mapMcpError11(error) {
|
|
27353
|
+
if (error instanceof HealthCheckApiError) {
|
|
27354
|
+
throw new Error(`mcp_tool_error:${error.code}`);
|
|
27355
|
+
}
|
|
27356
|
+
throw new Error("mcp_tool_error:unknown_error");
|
|
27357
|
+
}
|
|
27358
|
+
function createHealthCheckMcpTools(api) {
|
|
27359
|
+
return {
|
|
27360
|
+
async list_health_checks(input) {
|
|
27361
|
+
try {
|
|
27362
|
+
const requestInput = {
|
|
27363
|
+
bearerToken: String(input["bearerToken"]),
|
|
27364
|
+
projectId: String(input["projectId"])
|
|
27365
|
+
};
|
|
27366
|
+
if (typeof input["limit"] === "number") {
|
|
27367
|
+
requestInput.limit = input["limit"];
|
|
27368
|
+
}
|
|
27369
|
+
return await api.listHealthChecks(requestInput);
|
|
27370
|
+
} catch (error) {
|
|
27371
|
+
mapMcpError11(error);
|
|
27372
|
+
}
|
|
27373
|
+
},
|
|
27374
|
+
async get_health_check(input) {
|
|
27375
|
+
try {
|
|
27376
|
+
return await api.getHealthCheck({
|
|
27377
|
+
bearerToken: String(input["bearerToken"]),
|
|
27378
|
+
projectId: String(input["projectId"]),
|
|
27379
|
+
checkId: String(input["checkId"])
|
|
27380
|
+
});
|
|
27381
|
+
} catch (error) {
|
|
27382
|
+
mapMcpError11(error);
|
|
27383
|
+
}
|
|
27384
|
+
},
|
|
27385
|
+
async create_health_check(input) {
|
|
27386
|
+
try {
|
|
27387
|
+
const requestInput = {
|
|
27388
|
+
bearerToken: String(input["bearerToken"]),
|
|
27389
|
+
projectId: String(input["projectId"]),
|
|
27390
|
+
name: String(input["name"]),
|
|
27391
|
+
url: String(input["url"]),
|
|
27392
|
+
method: input["method"] === "HEAD" ? "HEAD" : "GET",
|
|
27393
|
+
expectedStatusMin: typeof input["expectedStatusMin"] === "number" ? input["expectedStatusMin"] : 200,
|
|
27394
|
+
expectedStatusMax: typeof input["expectedStatusMax"] === "number" ? input["expectedStatusMax"] : 399,
|
|
27395
|
+
timeoutMs: typeof input["timeoutMs"] === "number" ? input["timeoutMs"] : 5e3,
|
|
27396
|
+
intervalSeconds: Number(input["intervalSeconds"]),
|
|
27397
|
+
failureThreshold: typeof input["failureThreshold"] === "number" ? input["failureThreshold"] : 3,
|
|
27398
|
+
recoveryThreshold: typeof input["recoveryThreshold"] === "number" ? input["recoveryThreshold"] : 2,
|
|
27399
|
+
enabled: typeof input["enabled"] === "boolean" ? input["enabled"] : true
|
|
27400
|
+
};
|
|
27401
|
+
if (typeof input["environment"] === "string") {
|
|
27402
|
+
requestInput.environment = input["environment"];
|
|
27403
|
+
}
|
|
27404
|
+
if (typeof input["serviceName"] === "string" || input["serviceName"] === null) {
|
|
27405
|
+
requestInput.serviceName = input["serviceName"];
|
|
27406
|
+
}
|
|
27407
|
+
return await api.createHealthCheck(requestInput);
|
|
27408
|
+
} catch (error) {
|
|
27409
|
+
mapMcpError11(error);
|
|
27410
|
+
}
|
|
27411
|
+
},
|
|
27412
|
+
async update_health_check(input) {
|
|
27413
|
+
try {
|
|
27414
|
+
const requestInput = {
|
|
27415
|
+
bearerToken: String(input["bearerToken"]),
|
|
27416
|
+
projectId: String(input["projectId"]),
|
|
27417
|
+
checkId: String(input["checkId"])
|
|
27418
|
+
};
|
|
27419
|
+
if (typeof input["name"] === "string") {
|
|
27420
|
+
requestInput.name = input["name"];
|
|
27421
|
+
}
|
|
27422
|
+
if (typeof input["url"] === "string") {
|
|
27423
|
+
requestInput.url = input["url"];
|
|
27424
|
+
}
|
|
27425
|
+
if (input["method"] === "GET" || input["method"] === "HEAD") {
|
|
27426
|
+
requestInput.method = input["method"];
|
|
27427
|
+
}
|
|
27428
|
+
if (typeof input["expectedStatusMin"] === "number") {
|
|
27429
|
+
requestInput.expectedStatusMin = input["expectedStatusMin"];
|
|
27430
|
+
}
|
|
27431
|
+
if (typeof input["expectedStatusMax"] === "number") {
|
|
27432
|
+
requestInput.expectedStatusMax = input["expectedStatusMax"];
|
|
27433
|
+
}
|
|
27434
|
+
if (typeof input["timeoutMs"] === "number") {
|
|
27435
|
+
requestInput.timeoutMs = input["timeoutMs"];
|
|
27436
|
+
}
|
|
27437
|
+
if (typeof input["intervalSeconds"] === "number") {
|
|
27438
|
+
requestInput.intervalSeconds = input["intervalSeconds"];
|
|
27439
|
+
}
|
|
27440
|
+
if (typeof input["failureThreshold"] === "number") {
|
|
27441
|
+
requestInput.failureThreshold = input["failureThreshold"];
|
|
27442
|
+
}
|
|
27443
|
+
if (typeof input["recoveryThreshold"] === "number") {
|
|
27444
|
+
requestInput.recoveryThreshold = input["recoveryThreshold"];
|
|
27445
|
+
}
|
|
27446
|
+
if (typeof input["environment"] === "string") {
|
|
27447
|
+
requestInput.environment = input["environment"];
|
|
27448
|
+
}
|
|
27449
|
+
if (typeof input["serviceName"] === "string" || input["serviceName"] === null) {
|
|
27450
|
+
requestInput.serviceName = input["serviceName"];
|
|
27451
|
+
}
|
|
27452
|
+
if (typeof input["enabled"] === "boolean") {
|
|
27453
|
+
requestInput.enabled = input["enabled"];
|
|
27454
|
+
}
|
|
27455
|
+
return await api.updateHealthCheck(requestInput);
|
|
27456
|
+
} catch (error) {
|
|
27457
|
+
mapMcpError11(error);
|
|
27458
|
+
}
|
|
27459
|
+
},
|
|
27460
|
+
async delete_health_check(input) {
|
|
27461
|
+
try {
|
|
27462
|
+
return await api.deleteHealthCheck({
|
|
27463
|
+
bearerToken: String(input["bearerToken"]),
|
|
27464
|
+
projectId: String(input["projectId"]),
|
|
27465
|
+
checkId: String(input["checkId"])
|
|
27466
|
+
});
|
|
27467
|
+
} catch (error) {
|
|
27468
|
+
mapMcpError11(error);
|
|
27469
|
+
}
|
|
27470
|
+
},
|
|
27471
|
+
async test_health_check(input) {
|
|
27472
|
+
try {
|
|
27473
|
+
return await api.testHealthCheck({
|
|
27474
|
+
bearerToken: String(input["bearerToken"]),
|
|
27475
|
+
projectId: String(input["projectId"]),
|
|
27476
|
+
url: String(input["url"]),
|
|
27477
|
+
method: input["method"] === "HEAD" ? "HEAD" : "GET",
|
|
27478
|
+
expectedStatusMin: typeof input["expectedStatusMin"] === "number" ? input["expectedStatusMin"] : 200,
|
|
27479
|
+
expectedStatusMax: typeof input["expectedStatusMax"] === "number" ? input["expectedStatusMax"] : 399,
|
|
27480
|
+
timeoutMs: typeof input["timeoutMs"] === "number" ? input["timeoutMs"] : 5e3
|
|
27481
|
+
});
|
|
27482
|
+
} catch (error) {
|
|
27483
|
+
mapMcpError11(error);
|
|
27484
|
+
}
|
|
27485
|
+
},
|
|
27486
|
+
async list_health_check_results(input) {
|
|
27487
|
+
try {
|
|
27488
|
+
const requestInput = {
|
|
27489
|
+
bearerToken: String(input["bearerToken"]),
|
|
27490
|
+
projectId: String(input["projectId"]),
|
|
27491
|
+
checkId: String(input["checkId"])
|
|
27492
|
+
};
|
|
27493
|
+
if (typeof input["limit"] === "number") {
|
|
27494
|
+
requestInput.limit = input["limit"];
|
|
27495
|
+
}
|
|
27496
|
+
return await api.listHealthCheckResults(requestInput);
|
|
27497
|
+
} catch (error) {
|
|
27498
|
+
mapMcpError11(error);
|
|
27499
|
+
}
|
|
27500
|
+
},
|
|
27501
|
+
async list_health_check_daily_rollups(input) {
|
|
27502
|
+
try {
|
|
27503
|
+
const requestInput = {
|
|
27504
|
+
bearerToken: String(input["bearerToken"]),
|
|
27505
|
+
projectId: String(input["projectId"]),
|
|
27506
|
+
checkId: String(input["checkId"])
|
|
27507
|
+
};
|
|
27508
|
+
if (typeof input["limit"] === "number") {
|
|
27509
|
+
requestInput.limit = input["limit"];
|
|
27510
|
+
}
|
|
27511
|
+
return await api.listHealthCheckDailyRollups(requestInput);
|
|
27512
|
+
} catch (error) {
|
|
27513
|
+
mapMcpError11(error);
|
|
27514
|
+
}
|
|
27515
|
+
}
|
|
27516
|
+
};
|
|
27517
|
+
}
|
|
27518
|
+
|
|
27519
|
+
// src/project-tools.ts
|
|
27520
|
+
function mapMcpError12(error) {
|
|
26514
27521
|
if (error instanceof ProjectManagementApiError) {
|
|
26515
27522
|
throw new Error(`mcp_tool_error:${error.code}`);
|
|
26516
27523
|
}
|
|
@@ -26528,7 +27535,7 @@ function createProjectMcpTools(api) {
|
|
|
26528
27535
|
}
|
|
26529
27536
|
return { projects: await api.listProjects(requestInput) };
|
|
26530
27537
|
} catch (error) {
|
|
26531
|
-
|
|
27538
|
+
mapMcpError12(error);
|
|
26532
27539
|
}
|
|
26533
27540
|
},
|
|
26534
27541
|
async create_project(input) {
|
|
@@ -26543,7 +27550,7 @@ function createProjectMcpTools(api) {
|
|
|
26543
27550
|
}
|
|
26544
27551
|
return { project: await api.createProject(requestInput) };
|
|
26545
27552
|
} catch (error) {
|
|
26546
|
-
|
|
27553
|
+
mapMcpError12(error);
|
|
26547
27554
|
}
|
|
26548
27555
|
},
|
|
26549
27556
|
async update_project(input) {
|
|
@@ -26563,7 +27570,7 @@ function createProjectMcpTools(api) {
|
|
|
26563
27570
|
}
|
|
26564
27571
|
return { project: await api.updateProject(requestInput) };
|
|
26565
27572
|
} catch (error) {
|
|
26566
|
-
|
|
27573
|
+
mapMcpError12(error);
|
|
26567
27574
|
}
|
|
26568
27575
|
},
|
|
26569
27576
|
async delete_project(input) {
|
|
@@ -26575,7 +27582,7 @@ function createProjectMcpTools(api) {
|
|
|
26575
27582
|
})
|
|
26576
27583
|
};
|
|
26577
27584
|
} catch (error) {
|
|
26578
|
-
|
|
27585
|
+
mapMcpError12(error);
|
|
26579
27586
|
}
|
|
26580
27587
|
}
|
|
26581
27588
|
};
|
|
@@ -26782,7 +27789,7 @@ async function persistCloudArtifact(directoryPath, fileName, payload, dependenci
|
|
|
26782
27789
|
}
|
|
26783
27790
|
|
|
26784
27791
|
// src/retrieval-tools.ts
|
|
26785
|
-
function
|
|
27792
|
+
function mapMcpError13(error) {
|
|
26786
27793
|
if (error instanceof RetrievalApiError) {
|
|
26787
27794
|
throw new Error(`mcp_tool_error:${error.code}`);
|
|
26788
27795
|
}
|
|
@@ -26972,7 +27979,7 @@ function createRetrievalMcpTools(api) {
|
|
|
26972
27979
|
incidents: incidents.incidents.map((incident) => attachSourceToRecord(incident, "cloud"))
|
|
26973
27980
|
};
|
|
26974
27981
|
} catch (error) {
|
|
26975
|
-
|
|
27982
|
+
mapMcpError13(error);
|
|
26976
27983
|
}
|
|
26977
27984
|
},
|
|
26978
27985
|
async get_incident(input) {
|
|
@@ -27007,7 +28014,7 @@ function createRetrievalMcpTools(api) {
|
|
|
27007
28014
|
)
|
|
27008
28015
|
};
|
|
27009
28016
|
} catch (error) {
|
|
27010
|
-
|
|
28017
|
+
mapMcpError13(error);
|
|
27011
28018
|
}
|
|
27012
28019
|
},
|
|
27013
28020
|
async get_incident_context(input) {
|
|
@@ -27036,7 +28043,7 @@ function createRetrievalMcpTools(api) {
|
|
|
27036
28043
|
"cloud"
|
|
27037
28044
|
);
|
|
27038
28045
|
} catch (error) {
|
|
27039
|
-
|
|
28046
|
+
mapMcpError13(error);
|
|
27040
28047
|
}
|
|
27041
28048
|
},
|
|
27042
28049
|
async resolve_incident(input) {
|
|
@@ -27081,7 +28088,7 @@ function createRetrievalMcpTools(api) {
|
|
|
27081
28088
|
})()
|
|
27082
28089
|
};
|
|
27083
28090
|
} catch (error) {
|
|
27084
|
-
|
|
28091
|
+
mapMcpError13(error);
|
|
27085
28092
|
}
|
|
27086
28093
|
},
|
|
27087
28094
|
async resolve_incidents(input) {
|
|
@@ -27142,7 +28149,7 @@ function createRetrievalMcpTools(api) {
|
|
|
27142
28149
|
incidents: incidentIds.map((incidentId) => localIncidents.get(incidentId))
|
|
27143
28150
|
};
|
|
27144
28151
|
} catch (error) {
|
|
27145
|
-
|
|
28152
|
+
mapMcpError13(error);
|
|
27146
28153
|
}
|
|
27147
28154
|
},
|
|
27148
28155
|
async reopen_incident(input) {
|
|
@@ -27187,7 +28194,7 @@ function createRetrievalMcpTools(api) {
|
|
|
27187
28194
|
})()
|
|
27188
28195
|
};
|
|
27189
28196
|
} catch (error) {
|
|
27190
|
-
|
|
28197
|
+
mapMcpError13(error);
|
|
27191
28198
|
}
|
|
27192
28199
|
},
|
|
27193
28200
|
async reopen_incidents(input) {
|
|
@@ -27248,7 +28255,7 @@ function createRetrievalMcpTools(api) {
|
|
|
27248
28255
|
incidents: incidentIds.map((incidentId) => localIncidents.get(incidentId))
|
|
27249
28256
|
};
|
|
27250
28257
|
} catch (error) {
|
|
27251
|
-
|
|
28258
|
+
mapMcpError13(error);
|
|
27252
28259
|
}
|
|
27253
28260
|
},
|
|
27254
28261
|
async get_bundle(input) {
|
|
@@ -27279,7 +28286,7 @@ function createRetrievalMcpTools(api) {
|
|
|
27279
28286
|
}
|
|
27280
28287
|
);
|
|
27281
28288
|
} catch (error) {
|
|
27282
|
-
|
|
28289
|
+
mapMcpError13(error);
|
|
27283
28290
|
}
|
|
27284
28291
|
},
|
|
27285
28292
|
async get_logs(input) {
|
|
@@ -27299,7 +28306,7 @@ function createRetrievalMcpTools(api) {
|
|
|
27299
28306
|
}
|
|
27300
28307
|
return await api.getLogs(requestInput);
|
|
27301
28308
|
} catch (error) {
|
|
27302
|
-
|
|
28309
|
+
mapMcpError13(error);
|
|
27303
28310
|
}
|
|
27304
28311
|
},
|
|
27305
28312
|
async get_reproduction(input) {
|
|
@@ -27330,14 +28337,14 @@ function createRetrievalMcpTools(api) {
|
|
|
27330
28337
|
}
|
|
27331
28338
|
);
|
|
27332
28339
|
} catch (error) {
|
|
27333
|
-
|
|
28340
|
+
mapMcpError13(error);
|
|
27334
28341
|
}
|
|
27335
28342
|
}
|
|
27336
28343
|
};
|
|
27337
28344
|
}
|
|
27338
28345
|
|
|
27339
28346
|
// src/services-tools.ts
|
|
27340
|
-
function
|
|
28347
|
+
function mapMcpError14(error) {
|
|
27341
28348
|
if (error instanceof RetrievalApiError) {
|
|
27342
28349
|
throw new Error(`mcp_tool_error:${error.code}`);
|
|
27343
28350
|
}
|
|
@@ -27358,14 +28365,14 @@ function createServicesMcpTools(api) {
|
|
|
27358
28365
|
services: await api.listServices(requestInput)
|
|
27359
28366
|
};
|
|
27360
28367
|
} catch (error) {
|
|
27361
|
-
|
|
28368
|
+
mapMcpError14(error);
|
|
27362
28369
|
}
|
|
27363
28370
|
}
|
|
27364
28371
|
};
|
|
27365
28372
|
}
|
|
27366
28373
|
|
|
27367
28374
|
// src/setup-tools.ts
|
|
27368
|
-
function
|
|
28375
|
+
function mapMcpError15() {
|
|
27369
28376
|
throw new Error("mcp_tool_error:unknown_error");
|
|
27370
28377
|
}
|
|
27371
28378
|
function parseJsonOutput2(output) {
|
|
@@ -27380,7 +28387,7 @@ async function runJsonCommand2(command) {
|
|
|
27380
28387
|
const result = await command();
|
|
27381
28388
|
return parseJsonOutput2(result.output);
|
|
27382
28389
|
} catch {
|
|
27383
|
-
|
|
28390
|
+
mapMcpError15();
|
|
27384
28391
|
}
|
|
27385
28392
|
}
|
|
27386
28393
|
function createSetupMcpTools(commands) {
|
|
@@ -27439,7 +28446,7 @@ function createSetupMcpTools(commands) {
|
|
|
27439
28446
|
}
|
|
27440
28447
|
|
|
27441
28448
|
// src/slack-tools.ts
|
|
27442
|
-
function
|
|
28449
|
+
function mapMcpError16(error) {
|
|
27443
28450
|
if (error instanceof SlackApiError) {
|
|
27444
28451
|
throw new Error(`mcp_tool_error:${error.code}`);
|
|
27445
28452
|
}
|
|
@@ -27456,7 +28463,7 @@ function createSlackMcpTools(api) {
|
|
|
27456
28463
|
})
|
|
27457
28464
|
};
|
|
27458
28465
|
} catch (error) {
|
|
27459
|
-
|
|
28466
|
+
mapMcpError16(error);
|
|
27460
28467
|
}
|
|
27461
28468
|
},
|
|
27462
28469
|
async get_slack_connect_url(input) {
|
|
@@ -27469,7 +28476,7 @@ function createSlackMcpTools(api) {
|
|
|
27469
28476
|
})
|
|
27470
28477
|
};
|
|
27471
28478
|
} catch (error) {
|
|
27472
|
-
|
|
28479
|
+
mapMcpError16(error);
|
|
27473
28480
|
}
|
|
27474
28481
|
},
|
|
27475
28482
|
async test_slack_destination(input) {
|
|
@@ -27482,7 +28489,7 @@ function createSlackMcpTools(api) {
|
|
|
27482
28489
|
})
|
|
27483
28490
|
};
|
|
27484
28491
|
} catch (error) {
|
|
27485
|
-
|
|
28492
|
+
mapMcpError16(error);
|
|
27486
28493
|
}
|
|
27487
28494
|
},
|
|
27488
28495
|
async delete_slack_destination(input) {
|
|
@@ -27495,14 +28502,14 @@ function createSlackMcpTools(api) {
|
|
|
27495
28502
|
})
|
|
27496
28503
|
};
|
|
27497
28504
|
} catch (error) {
|
|
27498
|
-
|
|
28505
|
+
mapMcpError16(error);
|
|
27499
28506
|
}
|
|
27500
28507
|
}
|
|
27501
28508
|
};
|
|
27502
28509
|
}
|
|
27503
28510
|
|
|
27504
28511
|
// src/token-tools.ts
|
|
27505
|
-
function
|
|
28512
|
+
function mapMcpError17(error) {
|
|
27506
28513
|
if (error instanceof TokenManagementApiError) {
|
|
27507
28514
|
throw new Error(`mcp_tool_error:${error.code}`);
|
|
27508
28515
|
}
|
|
@@ -27523,7 +28530,7 @@ function createTokenMcpTools(api) {
|
|
|
27523
28530
|
tokens: await api.listProjectTokens(requestInput)
|
|
27524
28531
|
};
|
|
27525
28532
|
} catch (error) {
|
|
27526
|
-
|
|
28533
|
+
mapMcpError17(error);
|
|
27527
28534
|
}
|
|
27528
28535
|
},
|
|
27529
28536
|
async create_project_token(input) {
|
|
@@ -27538,7 +28545,7 @@ function createTokenMcpTools(api) {
|
|
|
27538
28545
|
})
|
|
27539
28546
|
};
|
|
27540
28547
|
} catch (error) {
|
|
27541
|
-
|
|
28548
|
+
mapMcpError17(error);
|
|
27542
28549
|
}
|
|
27543
28550
|
},
|
|
27544
28551
|
async revoke_project_token(input) {
|
|
@@ -27551,7 +28558,7 @@ function createTokenMcpTools(api) {
|
|
|
27551
28558
|
})
|
|
27552
28559
|
};
|
|
27553
28560
|
} catch (error) {
|
|
27554
|
-
|
|
28561
|
+
mapMcpError17(error);
|
|
27555
28562
|
}
|
|
27556
28563
|
},
|
|
27557
28564
|
async list_member_tokens(input) {
|
|
@@ -27566,7 +28573,7 @@ function createTokenMcpTools(api) {
|
|
|
27566
28573
|
tokens: await api.listMemberTokens(requestInput)
|
|
27567
28574
|
};
|
|
27568
28575
|
} catch (error) {
|
|
27569
|
-
|
|
28576
|
+
mapMcpError17(error);
|
|
27570
28577
|
}
|
|
27571
28578
|
},
|
|
27572
28579
|
async create_member_token(input) {
|
|
@@ -27578,7 +28585,7 @@ function createTokenMcpTools(api) {
|
|
|
27578
28585
|
})
|
|
27579
28586
|
};
|
|
27580
28587
|
} catch (error) {
|
|
27581
|
-
|
|
28588
|
+
mapMcpError17(error);
|
|
27582
28589
|
}
|
|
27583
28590
|
},
|
|
27584
28591
|
async revoke_member_token(input) {
|
|
@@ -27590,14 +28597,14 @@ function createTokenMcpTools(api) {
|
|
|
27590
28597
|
})
|
|
27591
28598
|
};
|
|
27592
28599
|
} catch (error) {
|
|
27593
|
-
|
|
28600
|
+
mapMcpError17(error);
|
|
27594
28601
|
}
|
|
27595
28602
|
}
|
|
27596
28603
|
};
|
|
27597
28604
|
}
|
|
27598
28605
|
|
|
27599
28606
|
// src/webhook-tools.ts
|
|
27600
|
-
function
|
|
28607
|
+
function mapMcpError18(error) {
|
|
27601
28608
|
if (error instanceof WebhookApiError) {
|
|
27602
28609
|
throw new Error(`mcp_tool_error:${error.code}`);
|
|
27603
28610
|
}
|
|
@@ -27618,7 +28625,7 @@ function createWebhookMcpTools(api) {
|
|
|
27618
28625
|
webhooks: await api.listWebhooks(requestInput)
|
|
27619
28626
|
};
|
|
27620
28627
|
} catch (error) {
|
|
27621
|
-
|
|
28628
|
+
mapMcpError18(error);
|
|
27622
28629
|
}
|
|
27623
28630
|
},
|
|
27624
28631
|
async create_webhook(input) {
|
|
@@ -27639,7 +28646,7 @@ function createWebhookMcpTools(api) {
|
|
|
27639
28646
|
webhook: await api.createWebhook(requestInput)
|
|
27640
28647
|
};
|
|
27641
28648
|
} catch (error) {
|
|
27642
|
-
|
|
28649
|
+
mapMcpError18(error);
|
|
27643
28650
|
}
|
|
27644
28651
|
},
|
|
27645
28652
|
async update_webhook(input) {
|
|
@@ -27665,7 +28672,7 @@ function createWebhookMcpTools(api) {
|
|
|
27665
28672
|
webhook: await api.updateWebhook(requestInput)
|
|
27666
28673
|
};
|
|
27667
28674
|
} catch (error) {
|
|
27668
|
-
|
|
28675
|
+
mapMcpError18(error);
|
|
27669
28676
|
}
|
|
27670
28677
|
},
|
|
27671
28678
|
async delete_webhook(input) {
|
|
@@ -27678,7 +28685,7 @@ function createWebhookMcpTools(api) {
|
|
|
27678
28685
|
})
|
|
27679
28686
|
};
|
|
27680
28687
|
} catch (error) {
|
|
27681
|
-
|
|
28688
|
+
mapMcpError18(error);
|
|
27682
28689
|
}
|
|
27683
28690
|
},
|
|
27684
28691
|
async test_webhook(input) {
|
|
@@ -27695,7 +28702,7 @@ function createWebhookMcpTools(api) {
|
|
|
27695
28702
|
delivery: await api.testWebhook(requestInput)
|
|
27696
28703
|
};
|
|
27697
28704
|
} catch (error) {
|
|
27698
|
-
|
|
28705
|
+
mapMcpError18(error);
|
|
27699
28706
|
}
|
|
27700
28707
|
},
|
|
27701
28708
|
async list_webhook_deliveries(input) {
|
|
@@ -27712,7 +28719,7 @@ function createWebhookMcpTools(api) {
|
|
|
27712
28719
|
deliveries: await api.listWebhookDeliveries(requestInput)
|
|
27713
28720
|
};
|
|
27714
28721
|
} catch (error) {
|
|
27715
|
-
|
|
28722
|
+
mapMcpError18(error);
|
|
27716
28723
|
}
|
|
27717
28724
|
},
|
|
27718
28725
|
async retry_webhook_delivery(input) {
|
|
@@ -27724,14 +28731,14 @@ function createWebhookMcpTools(api) {
|
|
|
27724
28731
|
deliveryId: String(input["deliveryId"])
|
|
27725
28732
|
});
|
|
27726
28733
|
} catch (error) {
|
|
27727
|
-
|
|
28734
|
+
mapMcpError18(error);
|
|
27728
28735
|
}
|
|
27729
28736
|
}
|
|
27730
28737
|
};
|
|
27731
28738
|
}
|
|
27732
28739
|
|
|
27733
28740
|
// src/weekly-report-tools.ts
|
|
27734
|
-
function
|
|
28741
|
+
function mapMcpError19(error) {
|
|
27735
28742
|
if (error instanceof WeeklyReportApiError) {
|
|
27736
28743
|
throw new Error(`mcp_tool_error:${error.code}`);
|
|
27737
28744
|
}
|
|
@@ -27749,7 +28756,7 @@ function createWeeklyReportMcpTools(api) {
|
|
|
27749
28756
|
})
|
|
27750
28757
|
};
|
|
27751
28758
|
} catch (error) {
|
|
27752
|
-
|
|
28759
|
+
mapMcpError19(error);
|
|
27753
28760
|
}
|
|
27754
28761
|
},
|
|
27755
28762
|
async create_weekly_report_channel(input) {
|
|
@@ -27765,7 +28772,7 @@ function createWeeklyReportMcpTools(api) {
|
|
|
27765
28772
|
})
|
|
27766
28773
|
};
|
|
27767
28774
|
} catch (error) {
|
|
27768
|
-
|
|
28775
|
+
mapMcpError19(error);
|
|
27769
28776
|
}
|
|
27770
28777
|
},
|
|
27771
28778
|
async update_weekly_report_channel(input) {
|
|
@@ -27780,7 +28787,7 @@ function createWeeklyReportMcpTools(api) {
|
|
|
27780
28787
|
})
|
|
27781
28788
|
};
|
|
27782
28789
|
} catch (error) {
|
|
27783
|
-
|
|
28790
|
+
mapMcpError19(error);
|
|
27784
28791
|
}
|
|
27785
28792
|
},
|
|
27786
28793
|
async delete_weekly_report_channel(input) {
|
|
@@ -27792,7 +28799,7 @@ function createWeeklyReportMcpTools(api) {
|
|
|
27792
28799
|
})
|
|
27793
28800
|
};
|
|
27794
28801
|
} catch (error) {
|
|
27795
|
-
|
|
28802
|
+
mapMcpError19(error);
|
|
27796
28803
|
}
|
|
27797
28804
|
}
|
|
27798
28805
|
};
|
|
@@ -27861,6 +28868,7 @@ async function createDefaultMcpTools(input = {}) {
|
|
|
27861
28868
|
...createCapturePolicyMcpTools(createCapturePolicyApi(httpClient)),
|
|
27862
28869
|
...createImprovementSettingsMcpTools(createImprovementSettingsApi(httpClient)),
|
|
27863
28870
|
...createProbeMcpTools(createProbeApi(httpClient)),
|
|
28871
|
+
...createHealthCheckMcpTools(createHealthCheckApi(httpClient)),
|
|
27864
28872
|
...createBillingMcpTools(createBillingApi(httpClient)),
|
|
27865
28873
|
...createMemberMcpTools(createMemberApi(httpClient)),
|
|
27866
28874
|
...createGitHubMcpTools(createGitHubManagementApi(httpClient))
|
|
@@ -29160,7 +30168,7 @@ var zodToJsonSchema = (schema, options) => {
|
|
|
29160
30168
|
var package_default = {
|
|
29161
30169
|
name: "@debugbundle/mcp",
|
|
29162
30170
|
mcpName: "com.debugbundle/mcp",
|
|
29163
|
-
version: "1.
|
|
30171
|
+
version: "1.5.1",
|
|
29164
30172
|
private: false,
|
|
29165
30173
|
description: "Model Context Protocol server for DebugBundle",
|
|
29166
30174
|
license: "AGPL-3.0-only",
|
|
@@ -29196,6 +30204,156 @@ var package_default = {
|
|
|
29196
30204
|
}
|
|
29197
30205
|
};
|
|
29198
30206
|
|
|
30207
|
+
// src/health-check-tool-catalog.ts
|
|
30208
|
+
var HEALTH_CHECK_MCP_TOOL_CATALOG = [
|
|
30209
|
+
{
|
|
30210
|
+
name: "list_health_checks",
|
|
30211
|
+
group: "health_checks",
|
|
30212
|
+
description: "List hosted health checks for a project.",
|
|
30213
|
+
inputSchema: external_exports.object({
|
|
30214
|
+
bearerToken: external_exports.string(),
|
|
30215
|
+
projectId: external_exports.string(),
|
|
30216
|
+
limit: external_exports.number().optional()
|
|
30217
|
+
})
|
|
30218
|
+
},
|
|
30219
|
+
{
|
|
30220
|
+
name: "get_health_check",
|
|
30221
|
+
group: "health_checks",
|
|
30222
|
+
description: "Get one hosted health check by id.",
|
|
30223
|
+
inputSchema: external_exports.object({
|
|
30224
|
+
bearerToken: external_exports.string(),
|
|
30225
|
+
projectId: external_exports.string(),
|
|
30226
|
+
checkId: external_exports.string()
|
|
30227
|
+
})
|
|
30228
|
+
},
|
|
30229
|
+
{
|
|
30230
|
+
name: "create_health_check",
|
|
30231
|
+
group: "health_checks",
|
|
30232
|
+
description: "Create a hosted health check for a project.",
|
|
30233
|
+
inputSchema: external_exports.object({
|
|
30234
|
+
bearerToken: external_exports.string(),
|
|
30235
|
+
projectId: external_exports.string(),
|
|
30236
|
+
name: external_exports.string(),
|
|
30237
|
+
url: external_exports.string(),
|
|
30238
|
+
method: external_exports.enum(["GET", "HEAD"]).optional(),
|
|
30239
|
+
expectedStatusMin: external_exports.number().optional(),
|
|
30240
|
+
expectedStatusMax: external_exports.number().optional(),
|
|
30241
|
+
timeoutMs: external_exports.number().optional(),
|
|
30242
|
+
intervalSeconds: external_exports.number(),
|
|
30243
|
+
failureThreshold: external_exports.number().optional(),
|
|
30244
|
+
recoveryThreshold: external_exports.number().optional(),
|
|
30245
|
+
environment: external_exports.string().optional(),
|
|
30246
|
+
serviceName: external_exports.string().nullable().optional(),
|
|
30247
|
+
enabled: external_exports.boolean().optional()
|
|
30248
|
+
})
|
|
30249
|
+
},
|
|
30250
|
+
{
|
|
30251
|
+
name: "update_health_check",
|
|
30252
|
+
group: "health_checks",
|
|
30253
|
+
description: "Update a hosted health check.",
|
|
30254
|
+
inputSchema: external_exports.object({
|
|
30255
|
+
bearerToken: external_exports.string(),
|
|
30256
|
+
projectId: external_exports.string(),
|
|
30257
|
+
checkId: external_exports.string(),
|
|
30258
|
+
name: external_exports.string().optional(),
|
|
30259
|
+
url: external_exports.string().optional(),
|
|
30260
|
+
method: external_exports.enum(["GET", "HEAD"]).optional(),
|
|
30261
|
+
expectedStatusMin: external_exports.number().optional(),
|
|
30262
|
+
expectedStatusMax: external_exports.number().optional(),
|
|
30263
|
+
timeoutMs: external_exports.number().optional(),
|
|
30264
|
+
intervalSeconds: external_exports.number().optional(),
|
|
30265
|
+
failureThreshold: external_exports.number().optional(),
|
|
30266
|
+
recoveryThreshold: external_exports.number().optional(),
|
|
30267
|
+
environment: external_exports.string().optional(),
|
|
30268
|
+
serviceName: external_exports.string().nullable().optional(),
|
|
30269
|
+
enabled: external_exports.boolean().optional()
|
|
30270
|
+
})
|
|
30271
|
+
},
|
|
30272
|
+
{
|
|
30273
|
+
name: "delete_health_check",
|
|
30274
|
+
group: "health_checks",
|
|
30275
|
+
description: "Delete a hosted health check.",
|
|
30276
|
+
inputSchema: external_exports.object({
|
|
30277
|
+
bearerToken: external_exports.string(),
|
|
30278
|
+
projectId: external_exports.string(),
|
|
30279
|
+
checkId: external_exports.string()
|
|
30280
|
+
})
|
|
30281
|
+
},
|
|
30282
|
+
{
|
|
30283
|
+
name: "test_health_check",
|
|
30284
|
+
group: "health_checks",
|
|
30285
|
+
description: "Run a side-effect-free test for a hosted health-check target.",
|
|
30286
|
+
inputSchema: external_exports.object({
|
|
30287
|
+
bearerToken: external_exports.string(),
|
|
30288
|
+
projectId: external_exports.string(),
|
|
30289
|
+
url: external_exports.string(),
|
|
30290
|
+
method: external_exports.enum(["GET", "HEAD"]).optional(),
|
|
30291
|
+
expectedStatusMin: external_exports.number().optional(),
|
|
30292
|
+
expectedStatusMax: external_exports.number().optional(),
|
|
30293
|
+
timeoutMs: external_exports.number().optional()
|
|
30294
|
+
})
|
|
30295
|
+
},
|
|
30296
|
+
{
|
|
30297
|
+
name: "list_health_check_results",
|
|
30298
|
+
group: "health_checks",
|
|
30299
|
+
description: "List recent execution results for one hosted health check.",
|
|
30300
|
+
inputSchema: external_exports.object({
|
|
30301
|
+
bearerToken: external_exports.string(),
|
|
30302
|
+
projectId: external_exports.string(),
|
|
30303
|
+
checkId: external_exports.string(),
|
|
30304
|
+
limit: external_exports.number().optional()
|
|
30305
|
+
})
|
|
30306
|
+
},
|
|
30307
|
+
{
|
|
30308
|
+
name: "list_health_check_daily_rollups",
|
|
30309
|
+
group: "health_checks",
|
|
30310
|
+
description: "List retained per-day history for one hosted health check.",
|
|
30311
|
+
inputSchema: external_exports.object({
|
|
30312
|
+
bearerToken: external_exports.string(),
|
|
30313
|
+
projectId: external_exports.string(),
|
|
30314
|
+
checkId: external_exports.string(),
|
|
30315
|
+
limit: external_exports.number().optional()
|
|
30316
|
+
})
|
|
30317
|
+
}
|
|
30318
|
+
];
|
|
30319
|
+
|
|
30320
|
+
// src/probe-tool-catalog.ts
|
|
30321
|
+
var PROBE_MCP_TOOL_CATALOG = [
|
|
30322
|
+
{
|
|
30323
|
+
name: "activate_probe",
|
|
30324
|
+
group: "probes",
|
|
30325
|
+
description: "Activate a remote probe on a project.",
|
|
30326
|
+
inputSchema: external_exports.object({
|
|
30327
|
+
bearerToken: external_exports.string(),
|
|
30328
|
+
projectId: external_exports.string(),
|
|
30329
|
+
labelPattern: external_exports.string(),
|
|
30330
|
+
service: external_exports.string().optional(),
|
|
30331
|
+
environment: external_exports.string().optional(),
|
|
30332
|
+
ttlSeconds: external_exports.number().optional(),
|
|
30333
|
+
triggerTtlSeconds: external_exports.number().optional()
|
|
30334
|
+
})
|
|
30335
|
+
},
|
|
30336
|
+
{
|
|
30337
|
+
name: "list_active_probes",
|
|
30338
|
+
group: "probes",
|
|
30339
|
+
description: "List active probe activations for a project.",
|
|
30340
|
+
inputSchema: external_exports.object({
|
|
30341
|
+
bearerToken: external_exports.string(),
|
|
30342
|
+
projectId: external_exports.string()
|
|
30343
|
+
})
|
|
30344
|
+
},
|
|
30345
|
+
{
|
|
30346
|
+
name: "deactivate_probe",
|
|
30347
|
+
group: "probes",
|
|
30348
|
+
description: "Deactivate a probe activation.",
|
|
30349
|
+
inputSchema: external_exports.object({
|
|
30350
|
+
bearerToken: external_exports.string(),
|
|
30351
|
+
projectId: external_exports.string(),
|
|
30352
|
+
activationId: external_exports.string()
|
|
30353
|
+
})
|
|
30354
|
+
}
|
|
30355
|
+
];
|
|
30356
|
+
|
|
29199
30357
|
// src/tool-catalog.ts
|
|
29200
30358
|
var jsonObjectSchema = external_exports.record(external_exports.unknown());
|
|
29201
30359
|
var optionalBearerTokenSchema = external_exports.string().optional();
|
|
@@ -29953,39 +31111,8 @@ var MCP_TOOL_CATALOG = [
|
|
|
29953
31111
|
})
|
|
29954
31112
|
})
|
|
29955
31113
|
},
|
|
29956
|
-
|
|
29957
|
-
|
|
29958
|
-
group: "probes",
|
|
29959
|
-
description: "Activate a remote probe on a project.",
|
|
29960
|
-
inputSchema: external_exports.object({
|
|
29961
|
-
bearerToken: external_exports.string(),
|
|
29962
|
-
projectId: external_exports.string(),
|
|
29963
|
-
labelPattern: external_exports.string(),
|
|
29964
|
-
service: external_exports.string().optional(),
|
|
29965
|
-
environment: external_exports.string().optional(),
|
|
29966
|
-
ttlSeconds: external_exports.number().optional(),
|
|
29967
|
-
triggerTtlSeconds: external_exports.number().optional()
|
|
29968
|
-
})
|
|
29969
|
-
},
|
|
29970
|
-
{
|
|
29971
|
-
name: "list_active_probes",
|
|
29972
|
-
group: "probes",
|
|
29973
|
-
description: "List active probe activations for a project.",
|
|
29974
|
-
inputSchema: external_exports.object({
|
|
29975
|
-
bearerToken: external_exports.string(),
|
|
29976
|
-
projectId: external_exports.string()
|
|
29977
|
-
})
|
|
29978
|
-
},
|
|
29979
|
-
{
|
|
29980
|
-
name: "deactivate_probe",
|
|
29981
|
-
group: "probes",
|
|
29982
|
-
description: "Deactivate a probe activation.",
|
|
29983
|
-
inputSchema: external_exports.object({
|
|
29984
|
-
bearerToken: external_exports.string(),
|
|
29985
|
-
projectId: external_exports.string(),
|
|
29986
|
-
activationId: external_exports.string()
|
|
29987
|
-
})
|
|
29988
|
-
},
|
|
31114
|
+
...PROBE_MCP_TOOL_CATALOG,
|
|
31115
|
+
...HEALTH_CHECK_MCP_TOOL_CATALOG,
|
|
29989
31116
|
{
|
|
29990
31117
|
name: "get_billing_summary",
|
|
29991
31118
|
group: "billing",
|