mcp-scraper 0.26.1 → 0.26.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,7 @@ import {
7
7
  registerMemoryMcpTools,
8
8
  registerPaaExtractorMcpTools,
9
9
  registerSerpIntelligenceCaptureTools
10
- } from "../chunk-YMEPX46N.js";
10
+ } from "../chunk-QO2TRJ3L.js";
11
11
  import "../chunk-R7EETU7Z.js";
12
12
  import "../chunk-MTSBI7ZH.js";
13
13
  import {
@@ -16,7 +16,7 @@ import {
16
16
  import "../chunk-XGIPATLV.js";
17
17
  import {
18
18
  PACKAGE_VERSION
19
- } from "../chunk-FQQC5OZJ.js";
19
+ } from "../chunk-V37MZON3.js";
20
20
  import "../chunk-4767BA2O.js";
21
21
  import "../chunk-M2S27J6Z.js";
22
22
  import "../chunk-ICT7DDHL.js";
@@ -19,7 +19,7 @@ import {
19
19
  } from "./chunk-XGIPATLV.js";
20
20
  import {
21
21
  PACKAGE_VERSION
22
- } from "./chunk-FQQC5OZJ.js";
22
+ } from "./chunk-V37MZON3.js";
23
23
  import {
24
24
  MC_PER_CREDIT
25
25
  } from "./chunk-4767BA2O.js";
@@ -10054,4 +10054,4 @@ export {
10054
10054
  registerMemoryMcpTools,
10055
10055
  MemoryMcpToolExecutor
10056
10056
  };
10057
- //# sourceMappingURL=chunk-YMEPX46N.js.map
10057
+ //# sourceMappingURL=chunk-QO2TRJ3L.js.map
@@ -0,0 +1,7 @@
1
+ // src/version.ts
2
+ var PACKAGE_VERSION = "0.26.2";
3
+
4
+ export {
5
+ PACKAGE_VERSION
6
+ };
7
+ //# sourceMappingURL=chunk-V37MZON3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/version.ts"],"sourcesContent":["export const PACKAGE_VERSION = '0.26.2'\n"],"mappings":";AAAO,IAAM,kBAAkB;","names":[]}
@@ -35,7 +35,7 @@ import {
35
35
  sanitizeAttempts,
36
36
  sanitizeHarvestResult,
37
37
  transcribeMediaUrl
38
- } from "./chunk-YMEPX46N.js";
38
+ } from "./chunk-QO2TRJ3L.js";
39
39
  import {
40
40
  auditImages,
41
41
  buildLinkReport,
@@ -76,7 +76,7 @@ import {
76
76
  RawMapsOverviewSchema,
77
77
  RawMapsReviewStatsSchema
78
78
  } from "./chunk-XGIPATLV.js";
79
- import "./chunk-FQQC5OZJ.js";
79
+ import "./chunk-V37MZON3.js";
80
80
  import {
81
81
  completeExtractJob,
82
82
  countSuccessfulPages,
@@ -22499,6 +22499,42 @@ var MainNangoTransportError = class extends Error {
22499
22499
  this.retryable = retryable;
22500
22500
  }
22501
22501
  };
22502
+ function nangoClientErrorText(error) {
22503
+ if (error instanceof Error) return error.message;
22504
+ if (typeof error === "string") return error;
22505
+ try {
22506
+ return JSON.stringify(error);
22507
+ } catch {
22508
+ return "";
22509
+ }
22510
+ }
22511
+ function normalizeNangoClientError(error) {
22512
+ if (error instanceof MainNangoTransportError) return error;
22513
+ const detail = nangoClientErrorText(error);
22514
+ if (/SERVICE_DISABLED|accessNotConfigured/i.test(detail)) {
22515
+ return new MainNangoTransportError(
22516
+ "The provider API required by this connection is disabled. Enable it in the provider project, wait for propagation, then retry.",
22517
+ 409,
22518
+ "provider_api_disabled",
22519
+ false
22520
+ );
22521
+ }
22522
+ if (/PERMISSION_DENIED|insufficientPermissions|insufficient permission/i.test(detail)) {
22523
+ return new MainNangoTransportError(
22524
+ "The connected account does not have permission to run this provider operation.",
22525
+ 403,
22526
+ "missing_provider_permission",
22527
+ false
22528
+ );
22529
+ }
22530
+ if (/RESOURCE_EXHAUSTED|rate.?limit|status["']?\s*:\s*429/i.test(detail)) {
22531
+ return new MainNangoTransportError("The connected provider is temporarily rate limited.", 429, "upstream_rate_limited", true);
22532
+ }
22533
+ if (/UNAUTHENTICATED|invalid_grant|status["']?\s*:\s*401/i.test(detail)) {
22534
+ return new MainNangoTransportError("The service connection requires reconnection.", 409, "connection_inactive", false);
22535
+ }
22536
+ return new MainNangoTransportError("The service connection is temporarily unavailable.", 503, "connection_transport_unavailable");
22537
+ }
22502
22538
  function asRecord(value) {
22503
22539
  return value && typeof value === "object" && !Array.isArray(value) ? value : null;
22504
22540
  }
@@ -22730,19 +22766,31 @@ async function withNangoClient(connection, run) {
22730
22766
  });
22731
22767
  return value;
22732
22768
  } catch (error) {
22769
+ const normalized = normalizeNangoClientError(error);
22733
22770
  await recordServiceConnectionHealth({
22734
22771
  connectionId: connection.id,
22735
- operationalStatus: "unavailable",
22736
- failureCode: "connection_transport_unavailable",
22737
- retryable: true,
22772
+ operationalStatus: normalized.code === "connection_transport_unavailable" ? "unavailable" : "degraded",
22773
+ failureCode: normalized.code,
22774
+ retryable: normalized.retryable,
22738
22775
  evidenceSource: "nango_mcp"
22739
22776
  }).catch(() => void 0);
22740
- if (error instanceof MainNangoTransportError) throw error;
22741
- throw new MainNangoTransportError("The service connection is temporarily unavailable.", 503, "connection_transport_unavailable");
22777
+ throw normalized;
22742
22778
  } finally {
22743
22779
  await client2.close().catch(() => void 0);
22744
22780
  }
22745
22781
  }
22782
+ async function probeNangoConnectionDirect(identity, connectionId) {
22783
+ const connection = await requireOwnedActiveConnection(identity, connectionId);
22784
+ const providerKey = connection.provider ?? connection.providerConfigKey;
22785
+ if (providerKey !== "google-search-console") return;
22786
+ await withNangoClient(connection, async (client2) => {
22787
+ const listed = await client2.listTools();
22788
+ if (!listed.tools.some((tool) => tool.name === "list-sites")) {
22789
+ throw new MainNangoTransportError("The Search Console health-check tool is unavailable.", 404, "live_tool_missing", false);
22790
+ }
22791
+ await client2.callTool({ name: "list-sites", arguments: {} });
22792
+ });
22793
+ }
22746
22794
  async function listNangoToolsDirect(identity, connectionId) {
22747
22795
  const connection = await requireOwnedActiveConnection(identity, connectionId);
22748
22796
  const listed = await withNangoClient(connection, (client2) => client2.listTools());
@@ -23056,6 +23104,7 @@ var SAFE_CONTROL_ERROR_CODES = /* @__PURE__ */ new Set([
23056
23104
  "connection_transport_unavailable",
23057
23105
  "connection_control_failed",
23058
23106
  "missing_provider_permission",
23107
+ "provider_api_disabled",
23059
23108
  "permission_verification_unavailable",
23060
23109
  "meta_app_feature_not_enabled",
23061
23110
  "insufficient_credits",
@@ -23649,6 +23698,7 @@ async function testNangoConnection(identity, connectionId) {
23649
23698
  }
23650
23699
  try {
23651
23700
  const { tools } = await listNangoToolsDirect(identity, connectionId);
23701
+ await probeNangoConnectionDirect(identity, connectionId);
23652
23702
  return { operationalStatus: "available", checkedAt: (/* @__PURE__ */ new Date()).toISOString(), toolCount: tools.length };
23653
23703
  } catch (error) {
23654
23704
  throw asNangoControlError(error);
@@ -27095,4 +27145,4 @@ app.get("/blog/:slug/", (c) => {
27095
27145
  export {
27096
27146
  app
27097
27147
  };
27098
- //# sourceMappingURL=server-UHDJ5TH5.js.map
27148
+ //# sourceMappingURL=server-K6ODZOZA.js.map