mcp-scraper 0.72.7 → 0.73.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +35 -1
  2. package/README.md +16 -2
  3. package/dist/{analytics-repository-6YLRSWYO.js → analytics-repository-7XYPQ2YJ.js} +15 -1
  4. package/dist/bin/api-server.js +3 -3
  5. package/dist/bin/mcp-scraper-cli.js +1 -1
  6. package/dist/bin/mcp-scraper-install.js +2 -2
  7. package/dist/bin/mcp-stdio-server.js +4 -4
  8. package/dist/{chunk-FVL4GUTP.js → chunk-EQJRPDUS.js} +2 -2
  9. package/dist/{chunk-ZSVXNLLM.js → chunk-G75QXTBE.js} +188 -14
  10. package/dist/{chunk-SR7GSLEA.js → chunk-M6XDENOO.js} +953 -122
  11. package/dist/{chunk-RRZAYUEX.js → chunk-NLPFY2IF.js} +1 -1
  12. package/dist/{chunk-RAFQEPJ4.js → chunk-Q2J23DHY.js} +1 -1
  13. package/dist/{chunk-I45JV4EU.js → chunk-RV2D27R4.js} +1 -1
  14. package/dist/{chunk-K2SXQGKM.js → chunk-S45DGELW.js} +1 -1
  15. package/dist/{extract-bundle-337ZDIIQ.js → extract-bundle-2V22S7EU.js} +2 -2
  16. package/dist/{gmail-service-QXDGNWUJ.js → gmail-service-JHL4PQFN.js} +2 -2
  17. package/dist/{server-M5FLUWYD.js → server-663CRTGY.js} +14433 -12846
  18. package/dist/{site-extract-repository-ACNAVNDN.js → site-extract-repository-DUAEAU6A.js} +2 -2
  19. package/dist/{worker-JQORPCFQ.js → worker-CBK5DWEE.js} +1 -1
  20. package/package.json +16 -4
  21. package/dist/bin/api-server.cjs +0 -108656
  22. package/dist/bin/api-server.d.cts +0 -1
  23. package/dist/bin/api-server.d.ts +0 -1
  24. package/dist/bin/mcp-scraper-cli.cjs +0 -3219
  25. package/dist/bin/mcp-scraper-cli.d.cts +0 -1
  26. package/dist/bin/mcp-scraper-cli.d.ts +0 -1
  27. package/dist/bin/mcp-scraper-install.cjs +0 -134
  28. package/dist/bin/mcp-scraper-install.d.cts +0 -1
  29. package/dist/bin/mcp-scraper-install.d.ts +0 -1
  30. package/dist/bin/mcp-stdio-server.cjs +0 -22333
  31. package/dist/bin/mcp-stdio-server.d.cts +0 -1
  32. package/dist/bin/mcp-stdio-server.d.ts +0 -1
  33. package/dist/bin/paa-harvest.cjs +0 -4745
  34. package/dist/bin/paa-harvest.d.cts +0 -1
  35. package/dist/bin/paa-harvest.d.ts +0 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,38 @@ All notable changes to MCP Scraper are documented here. The format is based on [
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.73.1] - 2026-08-28
8
+
9
+ ### Fixed
10
+
11
+ - Applied additive, idempotent X-Ray schema changes as individually committed statements so production reads cannot deadlock against a release-long DDL transaction and an interrupted migration can resume safely.
12
+ - Reused the earliest confirmed person when a verified email, phone, account ID, or order identity already belongs to the Site graph, preventing a normalized account ID from splitting a legacy email-keyed journey.
13
+
14
+ ## [0.73.0] - 2026-08-27
15
+
16
+ ### Added
17
+
18
+ - Added a backend-owned, 142-operation analytics REST contract with generated Web validators and exact MCP/SDK projections for enhanced confirmed journeys.
19
+ - Added consent-governed identity promotion for verified forms and authenticated accounts, including same-Site anonymous-history backfill, encrypted masked identity profiles, audited single-person reads, and deletion tombstones that prevent silent recreation.
20
+ - Added date-bounded Journey reporting for summaries, common pages, events, acquisition and referrers, sessions, and chronology, with confirmed and best-guess totals kept separate.
21
+ - Added first-party MCP Scraper subscription revenue outcomes through the ordinary versioned conversion-rule pipeline without copying billing contact data into analytics.
22
+ - Added real PostgreSQL integration coverage for tenant isolation, consent withdrawal, deletion, no-resurrection, migration replay, and provider activation eligibility.
23
+
24
+ ### Changed
25
+
26
+ - Consolidated Scheduler, Web, and Memory source ownership into this product repository under isolated `apps/` project roots while retaining the public SDK as the only separate client repository.
27
+ - Aligned the main server with `mcpscraper-memory-tools` 1.16.0 so nested Mastra builds cannot inherit the server's former package versions from the shared repository root.
28
+ - Expanded the public MCP catalog to 331 tools, including distinct confirmed/best-guess Journey listing and complete enhanced Journey reads with bounded `from` and `to` windows.
29
+ - Browser and embedded-form conversions now preserve the conversion record while allowing provider activation only for a confirmed person with current advertising-measurement consent.
30
+
31
+ ### Fixed
32
+
33
+ - Kept nested `apps/` source available to Vercel so each consolidated project can build from its configured monorepo root.
34
+ - Prevented cross-Site identity, privacy, and Journey references; removed subject-specific export/provider payload remnants on withdrawal or deletion; and normalized unknown/deleted references to zero-discovery responses.
35
+ - Normalized PostgreSQL timestamp projections and reconciled consent-withdrawal responses with the strict public REST contract.
36
+ - Made consented login and first-party form resolution self-initialize an approved Site-scoped primary identity graph, so older Sites persist stable person references and masked profiles without manual namespace setup.
37
+ - Retried the authenticated browser identity handoff during the bounded Pixel/consent bootstrap window, preventing a consent-readiness race from leaving a signed-in visitor anonymous for the rest of the page.
38
+
7
39
  ## [0.72.7] - 2026-08-27
8
40
 
9
41
  ### Fixed
@@ -1284,7 +1316,9 @@ All notable changes to MCP Scraper are documented here. The format is based on [
1284
1316
  - Write actions remain unavailable until the account owner explicitly enables them.
1285
1317
  - Provider-specific connection data is normalized into one agent-facing contract.
1286
1318
 
1287
- [Unreleased]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.72.7...HEAD
1319
+ [Unreleased]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.73.1...HEAD
1320
+ [0.73.1]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.73.0...v0.73.1
1321
+ [0.73.0]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.72.7...v0.73.0
1288
1322
  [0.72.7]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.72.6...v0.72.7
1289
1323
  [0.72.6]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.72.5...v0.72.6
1290
1324
  [0.72.5]: https://github.com/VilovietaSEO/mcp-scraper/compare/v0.72.4...v0.72.5
package/README.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  MCP Scraper is an MCP server for live web intelligence tools backed by `https://mcpscraper.dev`.
4
4
 
5
+ ## Product repository
6
+
7
+ This repository owns the complete private product runtime while preserving independent service and
8
+ deployment boundaries:
9
+
10
+ - `/` — primary MCP/API server and public `mcp-scraper` package;
11
+ - `apps/scheduler` — private scheduled execution and orchestration service;
12
+ - `apps/web` — private Next.js product and marketing application;
13
+ - `apps/memory` — hosted Memory service plus its independently publishable DB, Tools, and stdio packages.
14
+
15
+ `mcpscraper-sdk` remains the only separate public-client repository. See [`apps/README.md`](apps/README.md)
16
+ and [`product-topology.json`](product-topology.json) for exact ownership, source receipts, release units,
17
+ deployment roots, and verification commands.
18
+
5
19
  ## Install
6
20
 
7
21
  Use the MCPB Desktop Extension for the branded Claude Desktop install, or use the npm package from any MCP client that can run stdio commands.
@@ -159,7 +173,7 @@ Build the branded one-click bundle:
159
173
  npm run build:mcpb
160
174
  ```
161
175
 
162
- The generated bundle is written to `build/mcpb/mcp-scraper-<version>.mcpb` and copied to `public/downloads/` for the hosted download. The current public bundle is `https://mcpscraper.dev/downloads/mcp-scraper.mcpb` (`0.72.7`, SHA-256 `f33e2aa375a3a9e4a497bd03306db559a7c40282bd741b241c65b688d21e1dc2`). Install it by opening or dragging it into Claude Desktop. Claude displays the `MCP Scraper` install card, icon, API-key configuration field, and manually curated current-release message from the bundle manifest.
176
+ The generated bundle is written to `build/mcpb/mcp-scraper-<version>.mcpb` and copied to `public/downloads/` for the hosted download. The current public bundle is `https://mcpscraper.dev/downloads/mcp-scraper.mcpb` (`0.73.1`, SHA-256 `6d28c003fa95efba8867529ea8b9546e1213bbbe0575f03342b8bbe054535550`). Install it by opening or dragging it into Claude Desktop. Claude displays the `MCP Scraper` install card, icon, API-key configuration field, and manually curated current-release message from the bundle manifest.
163
177
 
164
178
  The MCPB install exposes every tool — web-intelligence plus all `browser_*` tools — through the one `mcp-scraper` server.
165
179
 
@@ -321,7 +335,7 @@ The `mcp-scraper` server (and the MCPB bundle, which runs it) exposes both secti
321
335
 
322
336
  All MCP tools return `structuredContent` with the IDs, URLs, CSV paths, transcripts, browser session handles, replay paths, artifacts, recipe fields, or blueprint fields needed by the next step, plus readable text content for compatibility. Runtime `tools/list` omits output schemas so strict clients can register the complete catalog; the generated developer manifest retains every canonical output schema for validation and typed SDK generation. All tools carry MCP annotations; file-writing tools such as replay downloads and annotations state their filesystem side effects.
323
337
 
324
- The canonical tool inventory is generated at `docs/mcp-tool-manifest.generated.json`. The unified server exposes 330 tools: 229 scraper, browser, workflow, billing, and connected-service tools plus 101 durable-memory tools. The scraper-side inventory includes complete Gmail selection, message, attachment, export, bulk-action, and Memory-import workflows; durable PAA starts and status; rendered site-content similarity; governed Local Sourcebook and Transparent Commons workflows; direct site-export reads; Editorial Reading Room and News Publisher templates; and production X-Ray analytics, attribution, CRM policy and receipt, campaign, export, and scheduled-report tools. Successful evidence-compiled Local Sourcebook revisions publish automatically to their canonical `localsourcebook.com` category profile and review URLs; administrator controls handle exceptional rejection or unpublishing. Release verification compares the exact local and hosted tool-name sets, not only the count.
338
+ The canonical tool inventory is generated at `docs/mcp-tool-manifest.generated.json`. The unified server exposes 331 tools: 230 scraper, browser, workflow, billing, and connected-service tools plus 101 durable-memory tools. The scraper-side inventory includes complete Gmail selection, message, attachment, export, bulk-action, and Memory-import workflows; durable PAA starts and status; rendered site-content similarity; governed Local Sourcebook and Transparent Commons workflows; direct site-export reads; Editorial Reading Room and News Publisher templates; and production X-Ray analytics, attribution, CRM policy and receipt, campaign, export, and scheduled-report tools. Successful evidence-compiled Local Sourcebook revisions publish automatically to their canonical `localsourcebook.com` category profile and review URLs; administrator controls handle exceptional rejection or unpublishing. Release verification compares the exact local and hosted tool-name sets, not only the count.
325
339
 
326
340
  For contract parity, stdio and MCPB memory calls invoke the matching public tool on the hosted MCP Scraper `/mcp` endpoint. The hosted aggregate runtime owns MCP Scraper-specific billing, scheduling, credential, and in-process cutover policy; its internal `/memory/mcp-call` bridge is a fallback to the standalone memory service, not the public stdio execution path. Direct `mcp-memory` OAuth and stdio clients continue to use `memory.mcpscraper.dev` and must be verified as a separate dependent release surface.
327
341
 
@@ -12,11 +12,14 @@ import {
12
12
  analyticsEventCounts,
13
13
  analyticsForecast,
14
14
  analyticsHealth,
15
+ analyticsIdentityPromotionAllowed,
16
+ analyticsIdentityResolutionAllowed,
15
17
  analyticsOverview,
16
18
  analyticsPaths,
17
19
  analyticsTimeseries,
18
20
  archiveAnalyticsActivationDestination,
19
21
  archiveAnalyticsCampaignLink,
22
+ backfillAnalyticsConfirmedHistory,
20
23
  claimAnalyticsCrmImportRows,
21
24
  claimAnalyticsFormDeliveryJobs,
22
25
  closeAnalyticsPool,
@@ -33,6 +36,7 @@ import {
33
36
  deferAnalyticsCrmImportRow,
34
37
  deferAnalyticsFormDelivery,
35
38
  deleteAnalyticsSite,
39
+ enrichAnalyticsExistingCrmIdentity,
36
40
  getAnalyticsActivationDestinationConnectionRef,
37
41
  getAnalyticsPersonJourney,
38
42
  getAnalyticsPool,
@@ -41,6 +45,7 @@ import {
41
45
  ingestAnalyticsEvents,
42
46
  isAnalyticsFormPlacementApproved,
43
47
  linkAnalyticsFormIdentity,
48
+ linkAnalyticsIdentityInTransaction,
44
49
  listAnalyticsActivationDestinations,
45
50
  listAnalyticsActivationReceipts,
46
51
  listAnalyticsCampaignLinks,
@@ -57,6 +62,7 @@ import {
57
62
  normalizeObservedHostname,
58
63
  pollAnalyticsActivationDiagnostics,
59
64
  prepareAnalyticsLinkerIssue,
65
+ projectAnalyticsPixelEventConsent,
60
66
  queueAnalyticsActivation,
61
67
  queueAnalyticsFormDelivery,
62
68
  recordAnalyticsFormSubmission,
@@ -66,6 +72,7 @@ import {
66
72
  requireAnalyticsAccess,
67
73
  requireAnalyticsEditor,
68
74
  resolveAnalyticsCampaignLink,
75
+ resolveAnalyticsConfirmedActivationIdentity,
69
76
  retryAnalyticsActivationJob,
70
77
  sanitizeAnalyticsProperties,
71
78
  sanitizeClickIds,
@@ -77,7 +84,7 @@ import {
77
84
  updateAnalyticsPixel,
78
85
  upsertAnalyticsAdSpend,
79
86
  upsertAnalyticsHostGroup
80
- } from "./chunk-SR7GSLEA.js";
87
+ } from "./chunk-M6XDENOO.js";
81
88
  import "./chunk-PJEEKOUM.js";
82
89
  import "./chunk-WEFPBAAG.js";
83
90
  export {
@@ -94,11 +101,14 @@ export {
94
101
  analyticsEventCounts,
95
102
  analyticsForecast,
96
103
  analyticsHealth,
104
+ analyticsIdentityPromotionAllowed,
105
+ analyticsIdentityResolutionAllowed,
97
106
  analyticsOverview,
98
107
  analyticsPaths,
99
108
  analyticsTimeseries,
100
109
  archiveAnalyticsActivationDestination,
101
110
  archiveAnalyticsCampaignLink,
111
+ backfillAnalyticsConfirmedHistory,
102
112
  claimAnalyticsCrmImportRows,
103
113
  claimAnalyticsFormDeliveryJobs,
104
114
  closeAnalyticsPool,
@@ -115,6 +125,7 @@ export {
115
125
  deferAnalyticsCrmImportRow,
116
126
  deferAnalyticsFormDelivery,
117
127
  deleteAnalyticsSite,
128
+ enrichAnalyticsExistingCrmIdentity,
118
129
  getAnalyticsActivationDestinationConnectionRef,
119
130
  getAnalyticsPersonJourney,
120
131
  getAnalyticsPool,
@@ -123,6 +134,7 @@ export {
123
134
  ingestAnalyticsEvents,
124
135
  isAnalyticsFormPlacementApproved,
125
136
  linkAnalyticsFormIdentity,
137
+ linkAnalyticsIdentityInTransaction,
126
138
  listAnalyticsActivationDestinations,
127
139
  listAnalyticsActivationReceipts,
128
140
  listAnalyticsCampaignLinks,
@@ -139,6 +151,7 @@ export {
139
151
  normalizeObservedHostname,
140
152
  pollAnalyticsActivationDiagnostics,
141
153
  prepareAnalyticsLinkerIssue,
154
+ projectAnalyticsPixelEventConsent,
142
155
  queueAnalyticsActivation,
143
156
  queueAnalyticsFormDelivery,
144
157
  recordAnalyticsFormSubmission,
@@ -148,6 +161,7 @@ export {
148
161
  requireAnalyticsAccess,
149
162
  requireAnalyticsEditor,
150
163
  resolveAnalyticsCampaignLink,
164
+ resolveAnalyticsConfirmedActivationIdentity,
151
165
  retryAnalyticsActivationJob,
152
166
  sanitizeAnalyticsProperties,
153
167
  sanitizeClickIds,
@@ -17,15 +17,15 @@ loadDotEnv();
17
17
  async function main() {
18
18
  const [{ serve }, { app }, { startWorker }, { migrate }] = await Promise.all([
19
19
  import("@hono/node-server"),
20
- import("../server-M5FLUWYD.js"),
21
- import("../worker-JQORPCFQ.js"),
20
+ import("../server-663CRTGY.js"),
21
+ import("../worker-CBK5DWEE.js"),
22
22
  import("../db-566MOHHD.js")
23
23
  ]);
24
24
  const PORT = parseInt(process.env.PORT ?? "3001");
25
25
  try {
26
26
  await migrate();
27
27
  if (process.env.ANALYTICS_DATABASE_URL) {
28
- const { migrateAnalytics } = await import("../analytics-repository-6YLRSWYO.js");
28
+ const { migrateAnalytics } = await import("../analytics-repository-7XYPQ2YJ.js");
29
29
  await migrateAnalytics();
30
30
  }
31
31
  startWorker();
@@ -13,7 +13,7 @@ import "../chunk-VXLU74YZ.js";
13
13
  import "../chunk-GGZEC22A.js";
14
14
  import {
15
15
  PACKAGE_VERSION
16
- } from "../chunk-RRZAYUEX.js";
16
+ } from "../chunk-NLPFY2IF.js";
17
17
 
18
18
  // src/cli/human-cli.ts
19
19
  import { Command } from "commander";
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  renderInstallTerminal
4
- } from "../chunk-RAFQEPJ4.js";
4
+ } from "../chunk-Q2J23DHY.js";
5
5
  import {
6
6
  PACKAGE_VERSION
7
- } from "../chunk-RRZAYUEX.js";
7
+ } from "../chunk-NLPFY2IF.js";
8
8
 
9
9
  // bin/mcp-scraper-install.ts
10
10
  var noColor = process.argv.includes("--no-color") || process.env.NO_COLOR !== void 0 || process.env.FORCE_COLOR === "0" || !process.stdout.isTTY;
@@ -13,7 +13,7 @@ import {
13
13
  registerScheduledResultsMcpTools,
14
14
  registerSerpIntelligenceCaptureTools,
15
15
  resolveDeploymentProfile
16
- } from "../chunk-ZSVXNLLM.js";
16
+ } from "../chunk-G75QXTBE.js";
17
17
  import "../chunk-PGJQDMC2.js";
18
18
  import "../chunk-T3MZISOF.js";
19
19
  import "../chunk-7RQULQF3.js";
@@ -21,14 +21,14 @@ import "../chunk-OM7HVEJ3.js";
21
21
  import "../chunk-CXY5WV45.js";
22
22
  import {
23
23
  renderInstallTerminal
24
- } from "../chunk-RAFQEPJ4.js";
24
+ } from "../chunk-Q2J23DHY.js";
25
25
  import "../chunk-VXLU74YZ.js";
26
26
  import "../chunk-GGZEC22A.js";
27
27
  import {
28
28
  PACKAGE_VERSION
29
- } from "../chunk-RRZAYUEX.js";
29
+ } from "../chunk-NLPFY2IF.js";
30
30
  import "../chunk-DNM65UCK.js";
31
- import "../chunk-FVL4GUTP.js";
31
+ import "../chunk-EQJRPDUS.js";
32
32
  import "../chunk-WEFPBAAG.js";
33
33
 
34
34
  // bin/mcp-stdio-server.ts
@@ -213,8 +213,8 @@ var PUBLIC_PRODUCT_CONTRACT = {
213
213
  "freeSignupCredits": 0
214
214
  },
215
215
  "inventory": {
216
- "totalTools": 330,
217
- "scraperTools": 229,
216
+ "totalTools": 331,
217
+ "scraperTools": 230,
218
218
  "memoryTools": 101
219
219
  },
220
220
  "concurrencyPack": {
@@ -32,7 +32,7 @@ import {
32
32
  } from "./chunk-VXLU74YZ.js";
33
33
  import {
34
34
  PACKAGE_VERSION
35
- } from "./chunk-RRZAYUEX.js";
35
+ } from "./chunk-NLPFY2IF.js";
36
36
  import {
37
37
  createPrivateArtifact,
38
38
  privateArtifactOwnerId,
@@ -45,7 +45,7 @@ import {
45
45
  PAA_QUESTION_CREDITS,
46
46
  PAGE_SCRAPE_CREDITS,
47
47
  SERP_SEARCH_CREDITS
48
- } from "./chunk-FVL4GUTP.js";
48
+ } from "./chunk-EQJRPDUS.js";
49
49
  import {
50
50
  PUBLIC_ERROR_CODES,
51
51
  buildPublicErrorEnvelope,
@@ -12326,9 +12326,17 @@ var AnalyticsExplorerInputSchema = {
12326
12326
  maximumDurationMs: z11.number().int().min(0).max(31536e6).optional().describe("Maximum measured session duration in milliseconds."),
12327
12327
  journeyTier: z11.enum(["confirmed", "best_guess", "all"]).default("confirmed").describe("Confirmed is the default. Best-guess totals remain separate and cannot drive CRM or advertising actions.")
12328
12328
  };
12329
+ var AnalyticsJourneysInputSchema = {
12330
+ siteId: z11.string().uuid().describe("Analytics Site id returned by analytics_list_sites."),
12331
+ journeyTier: z11.enum(["confirmed", "best_guess", "all"]).default("confirmed").describe("Select confirmed journeys, separately labeled best-guess journeys, or both branches. Confirmed is the default; best-guess evidence can never drive CRM or advertising actions."),
12332
+ limit: z11.number().int().min(1).max(100).default(50).describe("Maximum rows returned in each selected journey branch."),
12333
+ cursor: z11.string().max(1e3).optional().describe("Opaque keyset cursor returned in a selected branch pageInfo.nextCursor.")
12334
+ };
12329
12335
  var AnalyticsExplorerDetailInputSchema = {
12330
12336
  siteId: z11.string().uuid().describe("Analytics Site id returned by analytics_list_sites."),
12331
- reference: AnalyticsOpaqueRef
12337
+ reference: AnalyticsOpaqueRef,
12338
+ from: z11.string().datetime({ offset: true }).optional().describe("Inclusive ISO time. Defaults to 90 days before to; max window 366 days."),
12339
+ to: z11.string().datetime({ offset: true }).optional().describe("Exclusive ISO time. Defaults to now; max window 366 days.")
12332
12340
  };
12333
12341
  var AnalyticsFunnelStage = z11.object({
12334
12342
  key: z11.string().regex(/^[a-z][a-z0-9_]{1,79}$/).describe("Stable stage key."),
@@ -12578,6 +12586,7 @@ var AnalyticsActivationAssetsInputSchema = {
12578
12586
  };
12579
12587
  var AnalyticsActivationMappingInputSchema = {
12580
12588
  siteId: z11.string().uuid().describe("Analytics Site id returned by analytics_list_sites."),
12589
+ journeyTier: z11.literal("confirmed").default("confirmed").describe("External activation is confirmed-only. Best-guess and candidate-assisted journey evidence is schema-invalid."),
12581
12590
  platform: z11.enum(["meta", "google", "tiktok", "reddit"]).describe("Destination provider."),
12582
12591
  externalDatasetId: z11.string().min(1).max(500).describe("Authorized dataset, Pixel, or conversion-action id."),
12583
12592
  eventMapping: z11.record(z11.string().regex(/^[a-z][a-z0-9_]{1,79}$/), z11.string().min(1).max(160)).describe("Confirmed X-Ray event to provider event mapping. Candidate-assisted events are ineligible.")
@@ -12635,6 +12644,154 @@ var AnalyticsSafeOutputRecord = z11.record(z11.string(), z11.unknown());
12635
12644
  var AnalyticsSafeOutputRecords = z11.array(AnalyticsSafeOutputRecord);
12636
12645
  var analyticsRecordOutput = (field) => ({ ok: z11.boolean(), [field]: AnalyticsSafeOutputRecord });
12637
12646
  var analyticsRecordsOutput = (field) => ({ ok: z11.boolean(), [field]: AnalyticsSafeOutputRecords });
12647
+ var AnalyticsJourneyRevenueSchema = z11.object({
12648
+ valueMinor: z11.number().int().min(0).max(Number.MAX_SAFE_INTEGER),
12649
+ currency: z11.string().length(3).nullable()
12650
+ }).strict();
12651
+ var AnalyticsJourneyPageInfoSchema = z11.object({
12652
+ nextCursor: z11.string().min(8).max(1e3).nullable(),
12653
+ hasNextPage: z11.boolean()
12654
+ }).strict();
12655
+ var AnalyticsConfirmedJourneyPageSchema = z11.object({
12656
+ journeyTier: z11.literal("confirmed"),
12657
+ items: z11.array(z11.object({
12658
+ journeyTier: z11.literal("confirmed"),
12659
+ personRef: AnalyticsOpaqueRef,
12660
+ firstSeenAt: z11.string().datetime().nullable(),
12661
+ lastSeenAt: z11.string().datetime().nullable(),
12662
+ sessions: z11.number().int().min(0),
12663
+ events: z11.number().int().min(0),
12664
+ conversions: z11.number().int().min(0),
12665
+ revenue: AnalyticsJourneyRevenueSchema.nullable(),
12666
+ evidenceClass: z11.literal("deterministic")
12667
+ }).strict()).max(100),
12668
+ pageInfo: AnalyticsJourneyPageInfoSchema
12669
+ }).strict();
12670
+ var AnalyticsBestGuessJourneyPageSchema = z11.object({
12671
+ journeyTier: z11.literal("candidate_assisted"),
12672
+ totalsAreSeparated: z11.literal(true),
12673
+ items: z11.array(z11.object({
12674
+ journeyTier: z11.literal("candidate_assisted"),
12675
+ inferenceRef: AnalyticsOpaqueRef,
12676
+ confirmedTotals: z11.object({
12677
+ sessions: z11.number().int().min(0),
12678
+ events: z11.number().int().min(0),
12679
+ conversions: z11.number().int().min(0),
12680
+ revenue: AnalyticsJourneyRevenueSchema.nullable()
12681
+ }).strict(),
12682
+ inferredIncrementalTotals: z11.object({
12683
+ sessions: z11.number().int().min(0),
12684
+ events: z11.number().int().min(0),
12685
+ conversions: z11.number().int().min(0),
12686
+ revenue: AnalyticsJourneyRevenueSchema.nullable()
12687
+ }).strict(),
12688
+ candidateCount: z11.number().int().min(1),
12689
+ confidenceBand: z11.literal("high"),
12690
+ modelVersion: z11.string().min(1).max(160),
12691
+ featureClasses: z11.array(z11.string().min(1).max(160)).max(100),
12692
+ coverage: z11.enum(["incremental_sessions_available", "no_incremental_sessions"]),
12693
+ expiresAt: z11.string().datetime(),
12694
+ provenance: z11.literal("consented_high_confidence_candidate_association")
12695
+ }).strict()).max(100),
12696
+ pageInfo: AnalyticsJourneyPageInfoSchema
12697
+ }).strict();
12698
+ var AnalyticsJourneysResultSchema = z11.discriminatedUnion("journeyTier", [
12699
+ z11.object({ ok: z11.boolean(), journeyTier: z11.literal("confirmed"), confirmed: AnalyticsConfirmedJourneyPageSchema, bestGuess: z11.null(), totalsAreSeparated: z11.literal(false) }).strict(),
12700
+ z11.object({ ok: z11.boolean(), journeyTier: z11.literal("best_guess"), confirmed: z11.null(), bestGuess: AnalyticsBestGuessJourneyPageSchema, totalsAreSeparated: z11.literal(false) }).strict(),
12701
+ z11.object({ ok: z11.boolean(), journeyTier: z11.literal("all"), confirmed: AnalyticsConfirmedJourneyPageSchema, bestGuess: AnalyticsBestGuessJourneyPageSchema, totalsAreSeparated: z11.literal(true) }).strict()
12702
+ ]);
12703
+ var AnalyticsJourneysOutputSchema = {
12704
+ ok: z11.boolean(),
12705
+ journeyTier: z11.enum(["confirmed", "best_guess", "all"]),
12706
+ confirmed: AnalyticsConfirmedJourneyPageSchema.nullable(),
12707
+ bestGuess: AnalyticsBestGuessJourneyPageSchema.nullable(),
12708
+ totalsAreSeparated: z11.boolean()
12709
+ };
12710
+ var AnalyticsEnhancedJourneyMoneySchema = z11.object({
12711
+ valueMinor: z11.number().int().safe(),
12712
+ currency: z11.string().regex(/^[A-Z]{3}$/).nullable()
12713
+ }).strict();
12714
+ var AnalyticsEnhancedJourneyAcquisitionSchema = z11.object({
12715
+ source: z11.string().nullable(),
12716
+ medium: z11.string().nullable(),
12717
+ campaign: z11.string().nullable(),
12718
+ referrer: z11.string().url().nullable()
12719
+ }).strict();
12720
+ var AnalyticsEnhancedJourneyDataSchema = z11.object({
12721
+ subject: z11.object({
12722
+ kind: z11.enum(["person", "visitor", "session"]),
12723
+ reference: z11.string().min(8),
12724
+ personRef: z11.string().min(8).nullable()
12725
+ }).strict(),
12726
+ range: z11.object({
12727
+ from: z11.string().datetime({ offset: true }),
12728
+ to: z11.string().datetime({ offset: true }),
12729
+ fromInclusive: z11.literal(true),
12730
+ toExclusive: z11.literal(true)
12731
+ }).strict(),
12732
+ journeyTier: z11.literal("confirmed"),
12733
+ candidateAssisted: z11.null(),
12734
+ summary: z11.object({
12735
+ sessions: z11.number().int().nonnegative(),
12736
+ pageviews: z11.number().int().nonnegative(),
12737
+ events: z11.number().int().nonnegative(),
12738
+ conversions: z11.number().int().nonnegative(),
12739
+ revenue: AnalyticsEnhancedJourneyMoneySchema.nullable(),
12740
+ totalEngagementMs: z11.number().nonnegative().nullable(),
12741
+ averageEngagementMs: z11.number().nonnegative().nullable()
12742
+ }).strict(),
12743
+ commonPages: z11.array(z11.object({
12744
+ path: z11.string(),
12745
+ visits: z11.number().int().nonnegative(),
12746
+ uniqueSessions: z11.number().int().nonnegative(),
12747
+ engagedMs: z11.number().nonnegative().nullable(),
12748
+ conversions: z11.number().int().nonnegative()
12749
+ }).strict()),
12750
+ acquisition: z11.array(AnalyticsEnhancedJourneyAcquisitionSchema.extend({
12751
+ sessions: z11.number().int().nonnegative(),
12752
+ events: z11.number().int().nonnegative(),
12753
+ conversions: z11.number().int().nonnegative()
12754
+ }).strict()),
12755
+ eventBreakdown: z11.array(z11.object({
12756
+ name: z11.string().min(1),
12757
+ count: z11.number().int().nonnegative(),
12758
+ uniqueSessions: z11.number().int().nonnegative(),
12759
+ conversions: z11.number().int().nonnegative()
12760
+ }).strict()),
12761
+ sessions: z11.array(z11.object({
12762
+ sessionRef: z11.string().min(8),
12763
+ startedAt: z11.string().datetime({ offset: true }),
12764
+ endedAt: z11.string().datetime({ offset: true }).nullable(),
12765
+ durationMs: z11.number().nonnegative().nullable(),
12766
+ pageviews: z11.number().int().nonnegative(),
12767
+ events: z11.number().int().nonnegative(),
12768
+ conversions: z11.number().int().nonnegative(),
12769
+ revenue: AnalyticsEnhancedJourneyMoneySchema.nullable(),
12770
+ landingPath: z11.string().nullable(),
12771
+ exitPath: z11.string().nullable(),
12772
+ acquisition: AnalyticsEnhancedJourneyAcquisitionSchema.nullable()
12773
+ }).strict()),
12774
+ items: z11.array(z11.object({
12775
+ occurredAt: z11.string().datetime({ offset: true }),
12776
+ type: z11.string().min(1),
12777
+ name: z11.string().min(1),
12778
+ path: z11.string().nullable(),
12779
+ referrer: z11.string().url().nullable(),
12780
+ acquisition: AnalyticsEnhancedJourneyAcquisitionSchema.omit({ referrer: true }).nullable(),
12781
+ value: AnalyticsEnhancedJourneyMoneySchema.nullable(),
12782
+ evidenceClass: z11.enum(["deterministic", "candidate"]),
12783
+ provenance: z11.string().min(1)
12784
+ }).strict()),
12785
+ pageInfo: z11.object({
12786
+ nextCursor: z11.string().min(1).nullable(),
12787
+ hasNextPage: z11.boolean()
12788
+ }).strict()
12789
+ }).strict();
12790
+ var AnalyticsEnhancedJourneyResultSchema = z11.object({
12791
+ ok: z11.literal(true),
12792
+ data: AnalyticsEnhancedJourneyDataSchema
12793
+ }).strict();
12794
+ var AnalyticsEnhancedJourneyOutputSchema = AnalyticsEnhancedJourneyResultSchema.shape;
12638
12795
  var AnalyticsOnboardingOutputSchema = analyticsRecordOutput("onboarding");
12639
12796
  var AnalyticsOnboardingPreferencesOutputSchema = analyticsRecordOutput("presentation");
12640
12797
  var AnalyticsExplorerOutputSchema = analyticsRecordOutput("data");
@@ -12867,8 +13024,9 @@ var productionOutputSchemas = {
12867
13024
  analytics_update_onboarding_preferences: AnalyticsOnboardingPreferencesOutputSchema,
12868
13025
  analytics_list_sessions: AnalyticsExplorerOutputSchema,
12869
13026
  analytics_list_visitors: AnalyticsExplorerOutputSchema,
12870
- analytics_get_session_timeline: AnalyticsExplorerOutputSchema,
12871
- analytics_get_visitor_journey: AnalyticsExplorerOutputSchema,
13027
+ analytics_list_journeys: AnalyticsJourneysOutputSchema,
13028
+ analytics_get_session_timeline: AnalyticsEnhancedJourneyOutputSchema,
13029
+ analytics_get_visitor_journey: AnalyticsEnhancedJourneyOutputSchema,
12872
13030
  analytics_list_funnels: AnalyticsFunnelDefinitionsOutputSchema,
12873
13031
  analytics_get_funnel: AnalyticsFunnelReportOutputSchema,
12874
13032
  analytics_create_funnel: AnalyticsFunnelDefinitionOutputSchema,
@@ -12994,7 +13152,7 @@ function registerAnalyticsMcpTools(server, executor) {
12994
13152
  ["analytics_list_conversion_rules", "List Conversion Rules", "List deterministic versioned rules that turn canonical phone, CRM, transaction, and server events into conversions.", AnalyticsSiteResourceInputSchema, "analyticsListConversionRules"],
12995
13153
  ["analytics_list_event_definitions", "List Browser Event Definitions", "List declarative page, click, and form-submit tags applied by the first-party X-Ray Pixel.", AnalyticsSiteResourceInputSchema, "analyticsListEventDefinitions"],
12996
13154
  ["analytics_get_coverage", "Get Attribution Coverage", "Measure click-ID coverage and call/CRM journey join rates. Null rates mean there is not yet a denominator.", AnalyticsSiteResourceInputSchema, "analyticsGetCoverage"],
12997
- ["analytics_get_person_journey", "Get Person Journey", "Read one identified person timeline across sessions, immutable touches, calls, CRM stages, conversions, and ad-delivery receipts.", AnalyticsJourneyInputSchema, "analyticsGetPersonJourney"]
13155
+ ["analytics_get_person_journey", "Get Person Journey", "Read CRM-oriented identified-person history: touches, calls, CRM stages, conversions, and delivery receipts. For analytics chronology use analytics_get_visitor_journey.", AnalyticsJourneyInputSchema, "analyticsGetPersonJourney"]
12998
13156
  ];
12999
13157
  for (const [name, title, description, inputSchema, handler] of reads) {
13000
13158
  server.registerTool(name, {
@@ -13077,9 +13235,10 @@ function registerAnalyticsMcpTools(server, executor) {
13077
13235
  const productionReads = [
13078
13236
  ["analytics_get_onboarding_state", "Get X-Ray Setup State", "Read evidence-derived setup milestones. Client input cannot mark evidence milestones complete.", AnalyticsSiteResourceInputSchema, "analyticsGetOnboardingState"],
13079
13237
  ["analytics_list_sessions", "List X-Ray Sessions", "Read bounded sessions using opaque references. Raw visitor/session/device identifiers, contact data, IP, and click IDs are omitted.", AnalyticsExplorerInputSchema, "analyticsListSessions"],
13080
- ["analytics_list_visitors", "List X-Ray Visitors", "Read bounded visitor summaries using opaque references and separately labeled confirmed or candidate-assisted tiers.", AnalyticsExplorerInputSchema, "analyticsListVisitors"],
13081
- ["analytics_get_session_timeline", "Get Session Timeline", "Read one safe chronological session timeline by opaque Site-scoped reference.", AnalyticsExplorerDetailInputSchema, "analyticsGetSessionTimeline"],
13082
- ["analytics_get_visitor_journey", "Get Visitor Journey", "Read one safe visitor journey by opaque Site-scoped reference. Candidate evidence is labeled and never treated as confirmed identity.", AnalyticsExplorerDetailInputSchema, "analyticsGetVisitorJourney"],
13238
+ ["analytics_list_visitors", "List X-Ray Visitors", "Read bounded visitor summaries with opaque references, visit counts, returning status, and confirmed conversion status.", AnalyticsExplorerInputSchema, "analyticsListVisitors"],
13239
+ ["analytics_list_journeys", "List X-Ray Journeys", "List confirmed cross-session paths, separately labeled best-guess paths, or both. Candidate-assisted evidence cannot drive CRM or advertising actions.", AnalyticsJourneysInputSchema, "analyticsListJourneys"],
13240
+ ["analytics_get_session_timeline", "Get Session Timeline", "Read confirmed session summary, pages, events, acquisition, session rollups, and chronology. Use visitor journey for cross-session history.", AnalyticsExplorerDetailInputSchema, "analyticsGetSessionTimeline"],
13241
+ ["analytics_get_visitor_journey", "Get Visitor Journey", "Read one confirmed cross-session visitor/person journey: summary, pages, events, acquisition, session rollups, and chronology. Candidate evidence is excluded.", AnalyticsExplorerDetailInputSchema, "analyticsGetVisitorJourney"],
13083
13242
  ["analytics_list_funnels", "List Lead Funnels", "List versioned lead-stage funnel definitions.", AnalyticsSiteResourceInputSchema, "analyticsListFunnels"],
13084
13243
  ["analytics_get_funnel", "Get Lead Funnel Report", "Read a bounded lead-stage funnel report with documented denominators and safe drill-down references.", AnalyticsFunnelReportInputSchema, "analyticsGetFunnel"],
13085
13244
  ["analytics_list_saved_views", "List Saved Analytics Views", "List account-scoped validated report views without unrestricted sharing.", AnalyticsSiteResourceInputSchema, "analyticsListSavedViews"],
@@ -15026,11 +15185,26 @@ var HttpMcpToolExecutor = class {
15026
15185
  analyticsListVisitors(input) {
15027
15186
  return this.getJson(this.analyticsExplorerPath(input, "visitors"));
15028
15187
  }
15188
+ analyticsListJourneys(input) {
15189
+ const query = new URLSearchParams({
15190
+ journeyTier: input.journeyTier ?? "confirmed",
15191
+ limit: String(input.limit ?? 50)
15192
+ });
15193
+ if (input.cursor) query.set("cursor", input.cursor);
15194
+ return this.getJson(`${analyticsSitePath(input.siteId, "journeys")}?${query}`);
15195
+ }
15029
15196
  analyticsGetSessionTimeline(input) {
15030
- return this.getJson(analyticsSitePath(input.siteId, `journeys/${encodeURIComponent(input.reference)}/timeline`));
15197
+ return this.getJson(this.analyticsJourneyTimelinePath(input));
15031
15198
  }
15032
15199
  analyticsGetVisitorJourney(input) {
15033
- return this.getJson(analyticsSitePath(input.siteId, `journeys/${encodeURIComponent(input.reference)}/timeline`));
15200
+ return this.getJson(this.analyticsJourneyTimelinePath(input));
15201
+ }
15202
+ analyticsJourneyTimelinePath(input) {
15203
+ const path = analyticsSitePath(input.siteId, `journeys/${encodeURIComponent(input.reference)}/timeline`);
15204
+ const query = new URLSearchParams();
15205
+ if (input.from) query.set("from", input.from);
15206
+ if (input.to) query.set("to", input.to);
15207
+ return query.size ? `${path}?${query}` : path;
15034
15208
  }
15035
15209
  analyticsListFunnels(input) {
15036
15210
  const query = new URLSearchParams({ limit: String(input.limit ?? 50) });
@@ -15170,18 +15344,18 @@ var HttpMcpToolExecutor = class {
15170
15344
  }
15171
15345
  analyticsExportPrivacySubject(input) {
15172
15346
  const { siteId, idempotencyKey, ...body } = input;
15173
- return this.call(analyticsSitePath(siteId, "privacy/subject/export"), { ...body, idempotencyKey }, this.timeoutMs, "POST", analyticsIdempotencyHeaders("analytics-privacy-export", idempotencyKey));
15347
+ return this.call(analyticsSitePath(siteId, "privacy/subject/export"), body, this.timeoutMs, "POST", analyticsIdempotencyHeaders("analytics-privacy-export", idempotencyKey));
15174
15348
  }
15175
15349
  analyticsDeletePrivacySubject(input) {
15176
15350
  const { siteId, idempotencyKey, ...body } = input;
15177
- return this.call(analyticsSitePath(siteId, "privacy/subject/delete"), { ...body, idempotencyKey }, this.timeoutMs, "POST", analyticsIdempotencyHeaders("analytics-privacy-delete", idempotencyKey));
15351
+ return this.call(analyticsSitePath(siteId, "privacy/subject/delete"), body, this.timeoutMs, "POST", analyticsIdempotencyHeaders("analytics-privacy-delete", idempotencyKey));
15178
15352
  }
15179
15353
  analyticsDiscoverActivationAssets(input) {
15180
15354
  const query = new URLSearchParams({ platform: input.platform, connectionRef: input.connectionRef });
15181
15355
  return this.getJson(`${analyticsSitePath(input.siteId, "activation-assets")}?${query}`);
15182
15356
  }
15183
15357
  analyticsValidateActivationMapping(input) {
15184
- const { siteId, ...body } = input;
15358
+ const { siteId, journeyTier: _journeyTier, ...body } = input;
15185
15359
  return this.call(analyticsSitePath(siteId, "activation-mappings/validate"), body, this.timeoutMs, "POST");
15186
15360
  }
15187
15361
  commonsSearchEntities(input) {