mcp-scraper 0.84.0 → 0.86.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -1
- package/README.md +2 -2
- package/dist/{analytics-repository-4VZQ4TKW.js → analytics-repository-GGJJCVVP.js} +9 -1
- package/dist/bin/api-server.js +3 -3
- package/dist/bin/mcp-scraper-cli.js +3 -3
- package/dist/bin/mcp-scraper-core.js +6 -6
- package/dist/bin/mcp-scraper-install.js +2 -2
- package/dist/bin/mcp-stdio-server.js +6 -6
- package/dist/{chunk-OUTE3755.js → chunk-36EAKRR6.js} +1 -1
- package/dist/{chunk-LHIWX7RM.js → chunk-6IOGTFNS.js} +1 -1
- package/dist/{chunk-NLWBM55O.js → chunk-7523VOQT.js} +2 -2
- package/dist/{chunk-U77X4NIR.js → chunk-FBB6DEUV.js} +5735 -292
- package/dist/{chunk-ZB55UMMF.js → chunk-KQWVJOVR.js} +1 -1
- package/dist/{chunk-UM7DCY6W.js → chunk-NKRO2SUO.js} +3 -3
- package/dist/{chunk-4S6HPHPB.js → chunk-P7FWOMU7.js} +6 -9
- package/dist/{chunk-WDWWCNMW.js → chunk-QKWNEMGH.js} +3 -3
- package/dist/{chunk-4KFD2WXG.js → chunk-WFGAR4BZ.js} +33 -7
- package/dist/{chunk-TLRJV4SL.js → chunk-X623GTBV.js} +427 -155
- package/dist/{extract-bundle-SI35H4HR.js → extract-bundle-FALNLKYY.js} +2 -2
- package/dist/{gmail-service-MOZ6S56I.js → gmail-service-BUSU4BVX.js} +2 -2
- package/dist/{server-3F3JMHBF.js → server-OZBTZIDZ.js} +1518 -1249
- package/dist/{site-extract-repository-3WC3VB5Y.js → site-extract-repository-S5FYNFDY.js} +2 -2
- package/dist/{worker-VTFGHWZL.js → worker-OQSFSLNG.js} +1 -1
- package/package.json +15 -4
- package/public/.well-known/xray-install.json +5 -8
- package/public/agent-install.md +4 -8
|
@@ -213,9 +213,9 @@ var PUBLIC_PRODUCT_CONTRACT = {
|
|
|
213
213
|
"freeSignupCredits": 0
|
|
214
214
|
},
|
|
215
215
|
"inventory": {
|
|
216
|
-
"totalTools":
|
|
217
|
-
"scraperTools":
|
|
218
|
-
"memoryTools":
|
|
216
|
+
"totalTools": 377,
|
|
217
|
+
"scraperTools": 249,
|
|
218
|
+
"memoryTools": 128
|
|
219
219
|
},
|
|
220
220
|
"concurrencyPack": {
|
|
221
221
|
"ratePolicyVersion": "2026-08-14.concurrency-pack-v1",
|
|
@@ -147,9 +147,8 @@ function extractContactEvidence(html, pageUrl) {
|
|
|
147
147
|
|
|
148
148
|
// src/mcp/xray-install-contract.ts
|
|
149
149
|
import { createHash } from "crypto";
|
|
150
|
-
var XRAY_INSTALL_PROTOCOL_VERSION = "
|
|
150
|
+
var XRAY_INSTALL_PROTOCOL_VERSION = "3.0.0";
|
|
151
151
|
var XRAY_SETUP_TOOL = "analytics_setup_site";
|
|
152
|
-
var XRAY_REVENUE_SETUP_TOOL = "analytics_setup_revenue_source";
|
|
153
152
|
var XRAY_TRIGGER_PHRASE = "Install X-Ray";
|
|
154
153
|
var XRAY_CANONICAL_GOAL = "Install X-Ray and tell me what drives customers";
|
|
155
154
|
var CONTINUATION = `Call ${XRAY_SETUP_TOOL} with { "startUrl": "<site URL>", "goal": "${XRAY_CANONICAL_GOAL}" }; on every later call, reuse the returned setupId and revision.`;
|
|
@@ -179,10 +178,8 @@ var XRAY_INSTALL_CONTRACT_PAYLOAD = {
|
|
|
179
178
|
},
|
|
180
179
|
facade: {
|
|
181
180
|
tool: XRAY_SETUP_TOOL,
|
|
182
|
-
saasRevenueTool: XRAY_REVENUE_SETUP_TOOL,
|
|
183
181
|
initialCall: { startUrl: "<site URL>", goal: XRAY_CANONICAL_GOAL },
|
|
184
|
-
continuationRule: "Treat setupId plus revision as the durable continuation handle. Reuse both after approval, runtime publication, verification, retry, or return."
|
|
185
|
-
saasContinuationRule: `When the Site setup reaches outcome_connection_required for SaaS, continue through ${XRAY_REVENUE_SETUP_TOOL} with an already-authorized connection reference. Never request or accept provider credentials.`
|
|
182
|
+
continuationRule: "Treat setupId plus revision as the durable continuation handle. Reuse both after approval, runtime publication, verification, retry, or return."
|
|
186
183
|
},
|
|
187
184
|
topologies: {
|
|
188
185
|
local_stdio: {
|
|
@@ -294,7 +291,7 @@ var XRAY_INSTALL_CONTRACT_PAYLOAD = {
|
|
|
294
291
|
"Infer the business model and customer outcome, then propose one privacy-safe measurement plan.",
|
|
295
292
|
"If the Pixel is absent, return the canonical one-time tag and exact uncovered surfaces; do not claim ongoing control there.",
|
|
296
293
|
"Publish an approved measurement revision as a digest-bound runtime manifest; source or repository access is not required.",
|
|
297
|
-
|
|
294
|
+
"For SaaS, verify the measurement foundation: global tag coverage, ad-source capture, lifecycle events, currency and timezone, consent, and observed outcome events.",
|
|
298
295
|
"Optionally publish a structured post-purchase survey after approved disclosure evidence; reported influence remains separate from deterministic touches.",
|
|
299
296
|
"Compare observed attribution with customer-reported influence only with explicit weights totaling 1,000,000 micros and a named methodology version.",
|
|
300
297
|
"Keep view-through reporting unavailable until event-level provider evidence can join to an eligible X-Ray subject; aggregate impressions never qualify.",
|
|
@@ -310,10 +307,10 @@ var XRAY_INSTALL_CONTRACT_PAYLOAD = {
|
|
|
310
307
|
"Never treat a CTA click as a customer, sale, or revenue event without verified outcome evidence.",
|
|
311
308
|
"Never claim full-domain installation while an in-scope route or renderer is missing, excluded without approval, or unverifiable.",
|
|
312
309
|
"Never treat event-name presence as verification; require persisted definition ID and version evidence.",
|
|
313
|
-
"Never accept
|
|
310
|
+
"Never accept survey invitation tokens or exchange codes through MCP inputs or prompts.",
|
|
314
311
|
"Never treat customer-reported influence as identity, CRM mutation authority, ad-activation evidence, or a deterministic touch."
|
|
315
312
|
],
|
|
316
|
-
terminalStates: ["complete", "tag_required", "input_required", "approval_required", "runtime_convergence_required", "
|
|
313
|
+
terminalStates: ["complete", "tag_required", "input_required", "approval_required", "runtime_convergence_required", "not_ready", "error"]
|
|
317
314
|
};
|
|
318
315
|
function canonicalJson(value) {
|
|
319
316
|
if (Array.isArray(value)) return `[${value.map(canonicalJson).join(",")}]`;
|
|
@@ -343,7 +340,7 @@ function renderXraySetupPrompt() {
|
|
|
343
340
|
"",
|
|
344
341
|
`Use ${XRAY_SETUP_TOOL} as the single conversational setup facade. Ask for the target site URL if it is missing, then call it with the goal \u201C${XRAY_CANONICAL_GOAL}\u201D.`,
|
|
345
342
|
"",
|
|
346
|
-
|
|
343
|
+
"Continue the same setup with its setupId and revision. Confirm one global Pixel across all public rendering surfaces; present one measurement plan; publish it as a digest-bound runtime manifest after exact-revision approval; verify manifest and rule versions; then return first customer-journey answers or explicit readiness thresholds. For SaaS, verify the provider-neutral measurement foundation. Browser events never prove paid revenue. GitHub or repository access is not required after the tag is installed.",
|
|
347
344
|
"",
|
|
348
345
|
"Do not request pasted credentials, invent tracking code, silently activate measurement, call ad platforms directly, or claim customers/revenue from CTA clicks."
|
|
349
346
|
].join("\n");
|
|
@@ -12,13 +12,13 @@ import {
|
|
|
12
12
|
registerScheduledResultsMcpTools,
|
|
13
13
|
registerSerpIntelligenceCaptureTools,
|
|
14
14
|
resolveDeploymentProfile
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-FBB6DEUV.js";
|
|
16
16
|
import {
|
|
17
17
|
renderInstallTerminal
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-7523VOQT.js";
|
|
19
19
|
import {
|
|
20
20
|
PACKAGE_VERSION
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-36EAKRR6.js";
|
|
22
22
|
|
|
23
23
|
// src/mcp/stdio-runtime.ts
|
|
24
24
|
import { readFileSync } from "fs";
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
LedgerOperation,
|
|
20
20
|
MC_PER_CREDIT,
|
|
21
21
|
calculateConnectedUsageCharge
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-NKRO2SUO.js";
|
|
23
23
|
import {
|
|
24
24
|
recordVendorUsage,
|
|
25
25
|
runWithCostContext
|
|
@@ -528,6 +528,11 @@ var NANGO_TOOL_CALL_TIMEOUT_MS = 24e4;
|
|
|
528
528
|
var NANGO_CONNECTION_PAGE_SIZE = 100;
|
|
529
529
|
var NANGO_CONNECTION_MAX_PAGES = 20;
|
|
530
530
|
var PROVIDER_IDENTITY_RETRY_MS = 6 * 60 * 60 * 1e3;
|
|
531
|
+
var WITHDRAWN_NANGO_PROVIDER_CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
532
|
+
"stripe_revenue",
|
|
533
|
+
"salesforce",
|
|
534
|
+
"pipedrive"
|
|
535
|
+
]);
|
|
531
536
|
var MAIN_INTEGRATION_CONTRACT_VERSION = "2026-07-16.1";
|
|
532
537
|
var MAIN_INTEGRATION_CONTRACT_HASH = "f037859ec80c2ea2fac6e4a67c1a59f3200dd22d3642c97789b9bb3236723d3e";
|
|
533
538
|
var MainNangoTransportError = class extends Error {
|
|
@@ -544,6 +549,18 @@ var MainNangoTransportError = class extends Error {
|
|
|
544
549
|
this.retryAfterMs = retryAfterMs;
|
|
545
550
|
}
|
|
546
551
|
};
|
|
552
|
+
function isWithdrawnNangoProvider(providerConfigKey) {
|
|
553
|
+
return typeof providerConfigKey === "string" && WITHDRAWN_NANGO_PROVIDER_CONFIG_KEYS.has(providerConfigKey.normalize("NFKC").trim().toLowerCase());
|
|
554
|
+
}
|
|
555
|
+
function assertNangoProviderAvailable(providerConfigKey) {
|
|
556
|
+
if (!isWithdrawnNangoProvider(providerConfigKey)) return;
|
|
557
|
+
throw new MainNangoTransportError(
|
|
558
|
+
"This provider integration is not currently available.",
|
|
559
|
+
409,
|
|
560
|
+
"provider_unavailable",
|
|
561
|
+
false
|
|
562
|
+
);
|
|
563
|
+
}
|
|
547
564
|
function nangoClientErrorText(error) {
|
|
548
565
|
if (error instanceof Error) return error.message;
|
|
549
566
|
if (typeof error === "string") return error;
|
|
@@ -907,12 +924,13 @@ async function discoverOwnedNangoConnections(identity, options = {}) {
|
|
|
907
924
|
}
|
|
908
925
|
const discovered = rows.filter((row) => connectionIdentityMatches(row, identity)).map(discoveredConnection).filter((connection) => connection !== null);
|
|
909
926
|
const reconciled = await reconcileDiscoveredNangoConnections(identity, discovered);
|
|
910
|
-
|
|
927
|
+
const visibleConnections = reconciled.filter((connection) => !isWithdrawnNangoProvider(connection.providerConfigKey));
|
|
928
|
+
if (options.resolveProviderIdentity === false) return visibleConnections;
|
|
911
929
|
const remoteByKey = new Map(discovered.map((connection) => [
|
|
912
930
|
`${connection.providerConfigKey}\0${connection.upstreamConnectionId}`,
|
|
913
931
|
connection
|
|
914
932
|
]));
|
|
915
|
-
await Promise.all(
|
|
933
|
+
await Promise.all(visibleConnections.map(async (connection) => {
|
|
916
934
|
if (connection.lifecycleStatus !== "connected" || !connection.upstreamConnectionId) return;
|
|
917
935
|
const remote = remoteByKey.get(`${connection.providerConfigKey}\0${connection.upstreamConnectionId}`);
|
|
918
936
|
if (!remote) return;
|
|
@@ -935,7 +953,7 @@ async function discoverOwnedNangoConnections(identity, options = {}) {
|
|
|
935
953
|
sourceUpdatedAt
|
|
936
954
|
});
|
|
937
955
|
}));
|
|
938
|
-
return reconcileDiscoveredNangoConnections(identity, discovered);
|
|
956
|
+
return (await reconcileDiscoveredNangoConnections(identity, discovered)).filter((connection) => !isWithdrawnNangoProvider(connection.providerConfigKey));
|
|
939
957
|
}
|
|
940
958
|
async function listNangoCatalogDirect() {
|
|
941
959
|
const [integrationsPayload, providersPayload] = await Promise.all([
|
|
@@ -952,7 +970,7 @@ async function listNangoCatalogDirect() {
|
|
|
952
970
|
const row = asRecord(value);
|
|
953
971
|
const id = text(row?.unique_key) ?? text(row?.id);
|
|
954
972
|
const provider = text(row?.provider);
|
|
955
|
-
if (!id || !provider) return [];
|
|
973
|
+
if (!id || !provider || isWithdrawnNangoProvider(id)) return [];
|
|
956
974
|
const definition = providers.get(provider);
|
|
957
975
|
return [{
|
|
958
976
|
id,
|
|
@@ -986,6 +1004,7 @@ function sessionPayload(value) {
|
|
|
986
1004
|
return { connectLink, expiresAt: text(data?.expires_at) };
|
|
987
1005
|
}
|
|
988
1006
|
async function createNangoSessionDirect(identity, providerConfigKey) {
|
|
1007
|
+
assertNangoProviderAvailable(providerConfigKey);
|
|
989
1008
|
const defaults = connectDefaults(providerConfigKey);
|
|
990
1009
|
return sessionPayload(await nangoRequest("/connect/sessions", {
|
|
991
1010
|
method: "POST",
|
|
@@ -1010,7 +1029,7 @@ async function createNangoReconnectSessionDirect(identity, connectionId) {
|
|
|
1010
1029
|
}));
|
|
1011
1030
|
}
|
|
1012
1031
|
async function deleteNangoConnectionDirect(identity, connectionId) {
|
|
1013
|
-
const connection = await
|
|
1032
|
+
const connection = await requireOwnedNangoConnectionForCleanup(identity, connectionId);
|
|
1014
1033
|
try {
|
|
1015
1034
|
await nangoRequest(`/connections/${encodeURIComponent(connection.upstreamConnectionId)}`, {
|
|
1016
1035
|
method: "DELETE",
|
|
@@ -1020,11 +1039,16 @@ async function deleteNangoConnectionDirect(identity, connectionId) {
|
|
|
1020
1039
|
if (!(error instanceof MainNangoTransportError) || error.status !== 404) throw error;
|
|
1021
1040
|
}
|
|
1022
1041
|
}
|
|
1023
|
-
async function
|
|
1042
|
+
async function requireOwnedNangoConnectionForCleanup(identity, connectionId) {
|
|
1024
1043
|
const connection = await getOwnedServiceConnection(identity, connectionId);
|
|
1025
1044
|
if (!connection || connection.transport !== "nango" || !connection.upstreamConnectionId) {
|
|
1026
1045
|
throw new MainNangoTransportError("Service connection not found.", 404, "connection_not_found", false);
|
|
1027
1046
|
}
|
|
1047
|
+
return connection;
|
|
1048
|
+
}
|
|
1049
|
+
async function requireOwnedActiveConnection(identity, connectionId, allowNeedsReauth = false) {
|
|
1050
|
+
const connection = await requireOwnedNangoConnectionForCleanup(identity, connectionId);
|
|
1051
|
+
assertNangoProviderAvailable(connection.providerConfigKey);
|
|
1028
1052
|
if (connection.lifecycleStatus !== "connected" && !(allowNeedsReauth && connection.lifecycleStatus === "needs_reauth")) {
|
|
1029
1053
|
throw new MainNangoTransportError("Service connection requires reconnection.", 409, "connection_inactive", false);
|
|
1030
1054
|
}
|
|
@@ -2028,6 +2052,8 @@ export {
|
|
|
2028
2052
|
settleConnectedUsage,
|
|
2029
2053
|
listConnectedUsageHistory,
|
|
2030
2054
|
MainNangoTransportError,
|
|
2055
|
+
isWithdrawnNangoProvider,
|
|
2056
|
+
assertNangoProviderAvailable,
|
|
2031
2057
|
discoverOwnedNangoConnections,
|
|
2032
2058
|
listNangoCatalogDirect,
|
|
2033
2059
|
createNangoSessionDirect,
|