@mcpjam/inspector 0.9.60 → 0.9.61

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.
@@ -5,7 +5,7 @@
5
5
  <link rel="icon" type="image/svg+xml" href="/mcp_jam.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>MCPJam Inspector</title>
8
- <script type="module" crossorigin src="/assets/index-DzLO0GZl.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-BukehDzl.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-B-6IFHCF.css">
10
10
  </head>
11
11
  <body>
@@ -1,8 +1,46 @@
1
+ // sentry.ts
2
+ import * as Sentry from "@sentry/node";
3
+
4
+ // ../shared/sentry-config.ts
5
+ var baseSentryConfig = {
6
+ environment: process.env.NODE_ENV || "development",
7
+ sendDefaultPii: false,
8
+ tracesSampleRate: 0.1,
9
+ tracePropagationTargets: [
10
+ "localhost",
11
+ /^\//,
12
+ // All relative URLs (includes /api/*, /sse/message, /health, etc.)
13
+ /^https?:\/\/[^/]*\.convex\.(cloud|site)/
14
+ // Convex backend
15
+ ]
16
+ };
17
+ var electronSentryConfig = {
18
+ ...baseSentryConfig,
19
+ dsn: "https://6a41a208e72267f181f66c47138f2b9d@o4510109778378752.ingest.us.sentry.io/4510112190431232"
20
+ };
21
+ var serverSentryConfig = {
22
+ ...baseSentryConfig,
23
+ dsn: "https://ec309069e18ebe1d0be9088fa7bf56d9@o4510109778378752.ingest.us.sentry.io/4510112186433536"
24
+ };
25
+ var clientSentryConfig = {
26
+ ...baseSentryConfig,
27
+ dsn: "https://c9df3785c734acfe9dad2d0c1e963e28@o4510109778378752.ingest.us.sentry.io/4510111435063296",
28
+ replaysSessionSampleRate: 0.1,
29
+ // Session replay sample rate
30
+ replaysOnErrorSampleRate: 1
31
+ // Always capture replay on error
32
+ };
33
+
34
+ // sentry.ts
35
+ Sentry.init(serverSentryConfig);
36
+
1
37
  // index.ts
38
+ import * as Sentry2 from "@sentry/node";
2
39
  import { serve } from "@hono/node-server";
3
40
  import dotenv from "dotenv";
4
41
  import fixPath from "fix-path";
5
42
  import { Hono as Hono13 } from "hono";
43
+ import { HTTPException } from "hono/http-exception";
6
44
  import { cors } from "hono/cors";
7
45
  import { logger } from "hono/logger";
8
46
  import { serveStatic } from "@hono/node-server/serve-static";
@@ -1417,8 +1455,8 @@ function validateServerConfig(serverConfig) {
1417
1455
  headers: authHeaders
1418
1456
  };
1419
1457
  config.eventSourceInit = {
1420
- fetch(input, init) {
1421
- const headers = new Headers(init?.headers || {});
1458
+ fetch(input, init2) {
1459
+ const headers = new Headers(init2?.headers || {});
1422
1460
  headers.set(
1423
1461
  "Authorization",
1424
1462
  `Bearer ${config.oauth.access_token}`
@@ -1432,21 +1470,21 @@ function validateServerConfig(serverConfig) {
1432
1470
  });
1433
1471
  }
1434
1472
  return fetch(input, {
1435
- ...init,
1473
+ ...init2,
1436
1474
  headers
1437
1475
  });
1438
1476
  }
1439
1477
  };
1440
1478
  } else if (config.requestInit?.headers) {
1441
1479
  config.eventSourceInit = {
1442
- fetch(input, init) {
1443
- const headers = new Headers(init?.headers || {});
1480
+ fetch(input, init2) {
1481
+ const headers = new Headers(init2?.headers || {});
1444
1482
  const requestHeaders = new Headers(config.requestInit.headers);
1445
1483
  requestHeaders.forEach((value, key) => {
1446
1484
  headers.set(key, value);
1447
1485
  });
1448
1486
  return fetch(input, {
1449
- ...init,
1487
+ ...init2,
1450
1488
  headers
1451
1489
  });
1452
1490
  }
@@ -2503,14 +2541,14 @@ async function handleProxy(c) {
2503
2541
  filtered.set(key, value);
2504
2542
  }
2505
2543
  }
2506
- const init = {
2544
+ const init2 = {
2507
2545
  method: req.method,
2508
2546
  headers: filtered
2509
2547
  };
2510
2548
  if (req.method !== "GET" && req.method !== "HEAD") {
2511
- init.body = requestBody;
2549
+ init2.body = requestBody;
2512
2550
  }
2513
- const targetReq = new Request(upstreamUrl.toString(), init);
2551
+ const targetReq = new Request(upstreamUrl.toString(), init2);
2514
2552
  try {
2515
2553
  const res = await fetch(targetReq);
2516
2554
  const resClone = res.clone();
@@ -3626,7 +3664,14 @@ try {
3626
3664
  fixPath();
3627
3665
  } catch {
3628
3666
  }
3629
- var app = new Hono13();
3667
+ var app = new Hono13().onError((err, c) => {
3668
+ console.error("Unhandled error:", err);
3669
+ Sentry2.captureException(err);
3670
+ if (err instanceof HTTPException) {
3671
+ return err.getResponse();
3672
+ }
3673
+ return c.json({ error: "Internal server error" }, 500);
3674
+ });
3630
3675
  var envFile = process.env.NODE_ENV === "production" ? ".env.production" : ".env.development";
3631
3676
  var envPath = envFile;
3632
3677
  if (process.env.ELECTRON_APP === "true" && process.env.ELECTRON_RESOURCES_PATH) {