@canonry/canonry 7.93.0 → 7.95.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.
Files changed (142) hide show
  1. package/assets/agent-workspace/skills/aero/references/ai-traffic-tracking.md +7 -1
  2. package/assets/agent-workspace/skills/canonry/references/ai-traffic-tracking.md +7 -1
  3. package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +6 -4
  4. package/assets/assets/{AgentSetupPage-D53_2n_4.js → AgentSetupPage-BV0TvyWO.js} +4 -4
  5. package/assets/assets/{AuditHistoryPanel-BFRuRv_c.js → AuditHistoryPanel-CTVhEVjr.js} +1 -1
  6. package/assets/assets/{BacklinksPage-DpSbhjVf.js → BacklinksPage-CE1Bfpf6.js} +1 -1
  7. package/assets/assets/{HistoryPage-1z0GDe6W.js → HistoryPage-BhqA-Udl.js} +1 -1
  8. package/assets/assets/MeasurementPropertyPage-BiJ06H7w.js +4 -0
  9. package/assets/assets/ProjectPage-BqS0rfDT.js +11 -0
  10. package/assets/assets/{RunsPage-DpsqauyB.js → RunsPage-BII3_JsE.js} +1 -1
  11. package/assets/assets/{SettingsPage-ChIbt7x6.js → SettingsPage-DS4ivpsX.js} +1 -1
  12. package/assets/assets/SiteHealthSection-IywsGGIA.js +2 -0
  13. package/assets/assets/ToneBadge-CTZ_JZLD.js +60 -0
  14. package/assets/assets/{TrafficPage-yoq0n5vi.js → TrafficPage-Bg9JrnxC.js} +1 -1
  15. package/assets/assets/{TrafficSourceDetailPage-eCf7k39J.js → TrafficSourceDetailPage-BuD8BlaT.js} +1 -1
  16. package/assets/assets/{account-context-vYgW6LGe.js → account-context-ylqeghOr.js} +1 -1
  17. package/assets/assets/{agent-trust-copy-CJ7pZlY5.js → agent-trust-copy-DxpavxIA.js} +1 -1
  18. package/assets/assets/{card-CArOADSj.js → card-rZ7BA4sl.js} +1 -1
  19. package/assets/assets/{format-helpers-kCHfk00b.js → format-helpers-PdOXn5Yf.js} +1 -1
  20. package/assets/assets/index-CU7tAhKY.js +60 -0
  21. package/assets/assets/{query-client-DWFpwopf.js → query-client-Cq4kP41m.js} +1 -1
  22. package/assets/assets/react-query-DVctucqC.js +1 -0
  23. package/assets/assets/{react-sigma_core.esm.min-CaW_CBlP.js → react-sigma_core.esm.min-DYhAEr2t.js} +1 -1
  24. package/assets/assets/{server-traffic-B1Fb2oFZ.js → server-traffic-Owp6jMwT.js} +1 -1
  25. package/assets/assets/{service-Cu6wI40I.js → service-y3nQY3Ue.js} +1 -1
  26. package/assets/index.html +7 -7
  27. package/dist/{ads-X3VXFPB7.js → ads-GN7QSEUV.js} +3 -3
  28. package/dist/{agent-VVPPGM2P.js → agent-J46OIQHH.js} +7 -7
  29. package/dist/{agent-ask-FJVCKO3R.js → agent-ask-755DZ4YB.js} +3 -3
  30. package/dist/{agent-conversations-5YXYDZEK.js → agent-conversations-QO7C6F6L.js} +3 -3
  31. package/dist/{agent-journeys-DBMYKLJX.js → agent-journeys-SVI6LWKM.js} +3 -3
  32. package/dist/{agent-memory-7HOF4LNF.js → agent-memory-V3ZJZT5W.js} +3 -3
  33. package/dist/{agent-providers-AO25NSCX.js → agent-providers-QIHZ222U.js} +3 -3
  34. package/dist/{agent-transcript-IRZ2QDU7.js → agent-transcript-6TS3ZOCA.js} +3 -3
  35. package/dist/{analytics-RH5NXDQX.js → analytics-LFT5OAOR.js} +3 -3
  36. package/dist/{apply-XNTW4GYA.js → apply-3XXMVLBK.js} +3 -3
  37. package/dist/{backfill-O6BON2NA.js → backfill-F62Y47XV.js} +10 -10
  38. package/dist/{backlinks-VHK5TJU4.js → backlinks-AOA5KHHB.js} +3 -3
  39. package/dist/{bing-A4SQ5MIN.js → bing-75F4W4E2.js} +3 -3
  40. package/dist/{bootstrap-I2NLTHBM.js → bootstrap-CDGVAICZ.js} +10 -10
  41. package/dist/{cdp-LAD7DM6U.js → cdp-YBCWRWY4.js} +7 -7
  42. package/dist/{chunk-U3KBGIJ6.js → chunk-46YXUJSW.js} +2 -2
  43. package/dist/{chunk-5LLEZ6YL.js → chunk-5TPLZD4I.js} +1 -1
  44. package/dist/{chunk-4CPCYR5M.js → chunk-6RDBULDN.js} +1 -1
  45. package/dist/{chunk-ON4G7RCY.js → chunk-6S6XEEGX.js} +35 -22
  46. package/dist/{chunk-4UA2Y24K.js → chunk-73AUPWSG.js} +6 -6
  47. package/dist/{chunk-LWVLQCQH.js → chunk-7PUUMJXY.js} +2973 -2639
  48. package/dist/{chunk-QXT6QVBE.js → chunk-A6O6X6FU.js} +1 -1
  49. package/dist/{chunk-7RWVMCMK.js → chunk-BUZBBVDZ.js} +1 -1
  50. package/dist/{chunk-SOJIEKH6.js → chunk-C6UU2PDJ.js} +21 -21
  51. package/dist/{chunk-GO5OUMY5.js → chunk-CVCUADCM.js} +669 -635
  52. package/dist/{chunk-J6QOUWDQ.js → chunk-EWSVH5TU.js} +1 -1
  53. package/dist/{chunk-VYZIXIDN.js → chunk-FESPLVBO.js} +6 -6
  54. package/dist/{chunk-CWEEHODU.js → chunk-FWY5HUSB.js} +2 -2
  55. package/dist/{chunk-SNQVHD2O.js → chunk-GUVN5OSX.js} +3 -3
  56. package/dist/{chunk-YUHP5IUB.js → chunk-IATTIKXF.js} +3 -3
  57. package/dist/{chunk-HE4ZCVSF.js → chunk-J3NS6NGM.js} +146 -3
  58. package/dist/{chunk-CM3BXAMM.js → chunk-JVOOKVCW.js} +2 -2
  59. package/dist/{chunk-3SVI6OY3.js → chunk-KK7NWOGH.js} +7 -7
  60. package/dist/{chunk-67WZEUEE.js → chunk-KMT7I5KZ.js} +5 -5
  61. package/dist/{chunk-N6CIAFEO.js → chunk-L7W72K4X.js} +367 -367
  62. package/dist/{chunk-OLEMJTEJ.js → chunk-LHU3KIKG.js} +2 -2
  63. package/dist/{chunk-GS3KXIFK.js → chunk-MKLAX5KY.js} +2 -1
  64. package/dist/{chunk-VNPYFXO5.js → chunk-NJG6WFRK.js} +1 -1
  65. package/dist/{chunk-7BEQY4YS.js → chunk-NMUL63XG.js} +2 -2
  66. package/dist/{chunk-QBMMHMDZ.js → chunk-NVWTGVZ4.js} +3 -3
  67. package/dist/{chunk-WCUXKDJZ.js → chunk-PHOMW3R4.js} +4 -4
  68. package/dist/{chunk-5X6CWQ6P.js → chunk-Q6WHXY7D.js} +1 -1
  69. package/dist/{chunk-VFYZVQVX.js → chunk-RPPB4H4D.js} +1 -1
  70. package/dist/{chunk-BOUEM6D6.js → chunk-T3FYWUQL.js} +2 -2
  71. package/dist/{chunk-IFVVXGLK.js → chunk-TG5D4E2Y.js} +1 -1
  72. package/dist/{chunk-2ORBI7PS.js → chunk-TS5Q63NE.js} +3 -3
  73. package/dist/{chunk-U3DFWCTU.js → chunk-TXW2FPNJ.js} +4 -4
  74. package/dist/{chunk-UPUJSQ2U.js → chunk-VOP74COR.js} +2 -2
  75. package/dist/{chunk-2OJJPSFS.js → chunk-WK6IPTTM.js} +4 -4
  76. package/dist/{chunk-AAUJZ43Q.js → chunk-YTRXALSU.js} +1 -1
  77. package/dist/{citations-D2ZLKEAZ.js → citations-SQYZTJQ6.js} +3 -3
  78. package/dist/{cli-catalog-ZJX65B35.js → cli-catalog-N3JLEU77.js} +3 -3
  79. package/dist/{cli-commands-BSX2GGJL.js → cli-commands-QOJJMX2X.js} +7 -7
  80. package/dist/cli.js +13 -13
  81. package/dist/{competitor-GMBE6HDJ.js → competitor-C5JAHHR7.js} +3 -3
  82. package/dist/{content-V7VKNFRA.js → content-RVPODQI6.js} +3 -3
  83. package/dist/{dashboard-DOIM7F3F.js → dashboard-3NAY2SX6.js} +6 -6
  84. package/dist/{demo-TKNEM6WC.js → demo-OSYK452E.js} +1 -1
  85. package/dist/{demo-server-K6LAEKGV.js → demo-server-GO4V5UXK.js} +14 -14
  86. package/dist/{discover-TALBBFX7.js → discover-U2DNK2TO.js} +3 -3
  87. package/dist/{discover-eval-2R3F3C7O.js → discover-eval-ESLS56AH.js} +3 -3
  88. package/dist/{doctor-UW7QBZR3.js → doctor-SBF54WXE.js} +3 -3
  89. package/dist/{evidence-CMXDXINS.js → evidence-WHDCM7Z5.js} +3 -3
  90. package/dist/{export-cmd-HO6K6ZDO.js → export-cmd-7CHS6K3S.js} +3 -3
  91. package/dist/{ga-VSS5Z44P.js → ga-XRASDAVX.js} +4 -4
  92. package/dist/{gbp-RYMAOVON.js → gbp-FEOFMTBH.js} +3 -3
  93. package/dist/{google-RZQSM3VZ.js → google-MWJ4HAUB.js} +4 -4
  94. package/dist/{google-marketing-ULMGHDFF.js → google-marketing-GELTQ32D.js} +1 -1
  95. package/dist/{health-cmd-5AJLSCWH.js → health-cmd-IO7YMTRQ.js} +3 -3
  96. package/dist/{history-ZEWDWGKK.js → history-I74D3NTT.js} +3 -3
  97. package/dist/index.d.ts +261 -64
  98. package/dist/index.js +25 -25
  99. package/dist/{init-NAMFIDDT.js → init-ZLJMCJ3Q.js} +12 -12
  100. package/dist/{insights-F747HGKV.js → insights-EAMVEB5Y.js} +3 -3
  101. package/dist/intelligence-service-GSQ7YAYU.js +16 -0
  102. package/dist/{journeys-IN6PKYC6.js → journeys-E373TZZS.js} +3 -3
  103. package/dist/{keys-JPOCEVCO.js → keys-27JRRWKZ.js} +3 -3
  104. package/dist/{keyword-P6EYHLKS.js → keyword-45H2TBRG.js} +3 -3
  105. package/dist/{logs-3WC6OWDD.js → logs-K4K4OJDY.js} +3 -3
  106. package/dist/{mcp-LU6BKIGI.js → mcp-734WXNIA.js} +4 -4
  107. package/dist/mcp.js +9 -9
  108. package/dist/{measurement-plan-G4E42X4M.js → measurement-plan-XZXK3YLO.js} +5 -5
  109. package/dist/{notify-ADPO6H5M.js → notify-ZGLVTSVC.js} +3 -3
  110. package/dist/{organic-evidence-6C4ADEAQ.js → organic-evidence-CRTYFYAN.js} +3 -3
  111. package/dist/{overview-NLKLGTIL.js → overview-5URBJKI4.js} +4 -4
  112. package/dist/{project-4QVFGUPT.js → project-R5W4Y4L4.js} +3 -3
  113. package/dist/{query-6JVOPG7E.js → query-LPGNI3ZR.js} +3 -3
  114. package/dist/{research-NG2HHDTB.js → research-GTVKPIO2.js} +3 -3
  115. package/dist/{results-export-RUBBBAKB.js → results-export-UNQQHELR.js} +3 -3
  116. package/dist/{run-4ZM7F4T4.js → run-DLAFXVF4.js} +4 -4
  117. package/dist/{schedule-NYJD7QNS.js → schedule-7I5VIJFS.js} +3 -3
  118. package/dist/{search-Z5TMFDQD.js → search-MUS7FSOJ.js} +3 -3
  119. package/dist/{serve-ZHUBM33Q.js → serve-5TV26VAH.js} +26 -26
  120. package/dist/{session-VNIHR75J.js → session-FWALDL3F.js} +13 -13
  121. package/dist/{settings-2YWI2XEK.js → settings-EB433IDI.js} +3 -3
  122. package/dist/{sitemaps-PPRANFJS.js → sitemaps-5EVGGGQ5.js} +3 -3
  123. package/dist/{skills-WKAHQ42S.js → skills-2HS4MYNT.js} +2 -2
  124. package/dist/{snapshot-J2RMG6IC.js → snapshot-4DMW7AK2.js} +3 -3
  125. package/dist/{src-ZNFSBJSC.js → src-OYMKXD6L.js} +4 -2
  126. package/dist/{status-S7WMZ437.js → status-2CRLY5B6.js} +4 -4
  127. package/dist/{technical-aeo-NKCIAWHJ.js → technical-aeo-HIQJCEML.js} +3 -3
  128. package/dist/{telemetry-DT4BLD5L.js → telemetry-H3SGPKZC.js} +4 -4
  129. package/dist/{tools-22WRA2TI.js → tools-PHYD6WYF.js} +11 -11
  130. package/dist/{traffic-HTBFYDKA.js → traffic-47L2EV6Q.js} +8 -5
  131. package/dist/{trends-SHT3BBXE.js → trends-CCWE7MF6.js} +3 -3
  132. package/dist/{users-BV6QFK4Q.js → users-BGIGSKB2.js} +3 -3
  133. package/dist/{visibility-stats-TGCKVC7I.js → visibility-stats-XVF64BMX.js} +3 -3
  134. package/dist/{wordpress-LYXQ3AWR.js → wordpress-DQ6DAQPS.js} +3 -3
  135. package/package.json +1 -1
  136. package/assets/assets/MeasurementPropertyPage-Dzjx179C.js +0 -4
  137. package/assets/assets/ProjectPage-BgPs3YQG.js +0 -11
  138. package/assets/assets/SiteHealthSection-B-79VmOp.js +0 -2
  139. package/assets/assets/ToneBadge-Cx8uzsd6.js +0 -60
  140. package/assets/assets/index-9HU3ZsRh.js +0 -60
  141. package/assets/assets/react-query-DdeD3n1W.js +0 -1
  142. package/dist/intelligence-service-7FVMY2WA.js +0 -16
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  USAGE_TELEMETRY_HEADERS,
3
3
  redactLogString
4
- } from "./chunk-GO5OUMY5.js";
4
+ } from "./chunk-CVCUADCM.js";
5
5
 
6
6
  // ../api-routes/src/request-context.ts
7
7
  import { AsyncLocalStorage } from "async_hooks";
@@ -5,7 +5,7 @@ import {
5
5
  isStoredPageReadTool,
6
6
  isStoredReadTool,
7
7
  truncateToolResult
8
- } from "./chunk-2OJJPSFS.js";
8
+ } from "./chunk-WK6IPTTM.js";
9
9
  import {
10
10
  CANONRY_MCP_TOOLKITS,
11
11
  resolveAeroSkillDir
@@ -23,18 +23,18 @@ import {
23
23
  resolveApiKeyFor,
24
24
  resolveModelForProvider,
25
25
  validateAgentProviderRegistry
26
- } from "./chunk-5LLEZ6YL.js";
26
+ } from "./chunk-5TPLZD4I.js";
27
27
  import {
28
28
  CanonryMcpToolNames,
29
29
  canonryMcpTools
30
- } from "./chunk-4UA2Y24K.js";
30
+ } from "./chunk-73AUPWSG.js";
31
31
  import {
32
32
  createLogger
33
- } from "./chunk-BOUEM6D6.js";
33
+ } from "./chunk-T3FYWUQL.js";
34
34
  import {
35
35
  agentToolEvents,
36
36
  llmUsageEvents
37
- } from "./chunk-HE4ZCVSF.js";
37
+ } from "./chunk-J3NS6NGM.js";
38
38
  import {
39
39
  MeasurementPortfolioLists,
40
40
  SeoCapabilities,
@@ -43,7 +43,7 @@ import {
43
43
  describeError,
44
44
  validationError,
45
45
  visibilityReportRequestSchema
46
- } from "./chunk-GO5OUMY5.js";
46
+ } from "./chunk-CVCUADCM.js";
47
47
 
48
48
  // src/agent/session.ts
49
49
  import fs2 from "fs";
@@ -5,7 +5,7 @@ import {
5
5
  siteCrawlGraphNodes,
6
6
  siteCrawlPages,
7
7
  siteCrawlSnapshots
8
- } from "./chunk-HE4ZCVSF.js";
8
+ } from "./chunk-J3NS6NGM.js";
9
9
  import {
10
10
  SITE_CRAWL_GRAPH_MAX_EDGES,
11
11
  SITE_CRAWL_GRAPH_MAX_NODES,
@@ -15,7 +15,7 @@ import {
15
15
  factorStatusFromDistribution,
16
16
  factorStatusFromScore,
17
17
  roundPreservingTotal
18
- } from "./chunk-GO5OUMY5.js";
18
+ } from "./chunk-CVCUADCM.js";
19
19
 
20
20
  // src/site-audit-factors.ts
21
21
  function recordedSharePct(factor) {
@@ -3,7 +3,7 @@ import {
3
3
  resolveCliAccess,
4
4
  resolveCliAccessForInvocation,
5
5
  windowOptions
6
- } from "./chunk-IFVVXGLK.js";
6
+ } from "./chunk-TG5D4E2Y.js";
7
7
  import {
8
8
  emitJsonl
9
9
  } from "./chunk-Z7IUAJOF.js";
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk-HGMYEDAQ.js";
15
15
  import {
16
16
  OperationAccesses
17
- } from "./chunk-GO5OUMY5.js";
17
+ } from "./chunk-CVCUADCM.js";
18
18
 
19
19
  // src/cli-catalog.ts
20
20
  import { createRequire } from "module";
@@ -111,7 +111,7 @@ async function dispatchRegisteredCommand(args, fallbackFormat, specs) {
111
111
  const accessValue = accessFilterFromArgs(argsWithoutHelp);
112
112
  validateAccessFilter(accessValue);
113
113
  if (fallbackFormat !== "text") {
114
- const { printCliCatalog: printCliCatalog2 } = await import("./cli-catalog-ZJX65B35.js");
114
+ const { printCliCatalog: printCliCatalog2 } = await import("./cli-catalog-N3JLEU77.js");
115
115
  const group2 = argsWithoutHelp.find((arg) => !arg.startsWith("--"));
116
116
  printCliCatalog2(specs, fallbackFormat, group2, accessValue);
117
117
  return true;
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createApiClient
3
- } from "./chunk-CM3BXAMM.js";
3
+ } from "./chunk-JVOOKVCW.js";
4
4
  import {
5
5
  emitJsonl
6
6
  } from "./chunk-Z7IUAJOF.js";
7
7
  import {
8
8
  measurementDraftOperationSchema,
9
9
  runMeasurementDraftAction
10
- } from "./chunk-VFYZVQVX.js";
10
+ } from "./chunk-RPPB4H4D.js";
11
11
  import {
12
12
  isMachineFormat,
13
13
  systemError
@@ -37,7 +37,7 @@ import {
37
37
  unattributedAnswersLabel,
38
38
  uncheckedSourcesLabel,
39
39
  visibilityReportRequestSchema
40
- } from "./chunk-GO5OUMY5.js";
40
+ } from "./chunk-CVCUADCM.js";
41
41
 
42
42
  // src/commands/measurement-plan.ts
43
43
  import crypto from "crypto";
@@ -20,7 +20,7 @@ import {
20
20
  templateLinkRatio,
21
21
  templateLinkUbiquityAvailable,
22
22
  validationError
23
- } from "./chunk-GO5OUMY5.js";
23
+ } from "./chunk-CVCUADCM.js";
24
24
  import {
25
25
  __export
26
26
  } from "./chunk-MLKGABMK.js";
@@ -91,6 +91,7 @@ __export(schema_exports, {
91
91
  gaSearchLandingPages: () => gaSearchLandingPages,
92
92
  gaSearchLandingWindows: () => gaSearchLandingWindows,
93
93
  gaSocialReferrals: () => gaSocialReferrals,
94
+ gaSyncCoverage: () => gaSyncCoverage,
94
95
  gaTrafficSnapshots: () => gaTrafficSnapshots,
95
96
  gaTrafficSummaries: () => gaTrafficSummaries,
96
97
  gaTrafficWindowSummaries: () => gaTrafficWindowSummaries,
@@ -1981,6 +1982,19 @@ var gaTrafficSnapshots = sqliteTable2("ga_traffic_snapshots", {
1981
1982
  index2("idx_ga_traffic_page_normalized").on(table.projectId, table.date, table.landingPageNormalized),
1982
1983
  index2("idx_ga_traffic_run").on(table.syncRunId)
1983
1984
  ]);
1985
+ var gaSyncCoverage = sqliteTable2("ga_sync_coverage", {
1986
+ projectId: text2("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
1987
+ component: text2("component").notNull(),
1988
+ syncRunId: text2("sync_run_id").notNull().references(() => runs.id, { onDelete: "cascade" }),
1989
+ date: text2("date").notNull(),
1990
+ propertyId: text2("property_id").notNull(),
1991
+ definition: text2("definition").notNull(),
1992
+ settled: integer2("settled", { mode: "boolean" }).notNull(),
1993
+ syncedAt: text2("synced_at").notNull()
1994
+ }, (t) => [
1995
+ primaryKey2({ columns: [t.projectId, t.component, t.date] }),
1996
+ index2("idx_ga_sync_coverage_run").on(t.syncRunId)
1997
+ ]);
1984
1998
  var gaDailyTotals = sqliteTable2("ga_daily_totals", {
1985
1999
  id: text2("id").primaryKey(),
1986
2000
  projectId: text2("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
@@ -2253,6 +2267,8 @@ var gaSearchLandingWindows = sqliteTable2("ga_search_landing_windows", {
2253
2267
  periodEnd: text2("period_end").notNull(),
2254
2268
  /** GA4 property reporting time zone the period dates are in. */
2255
2269
  timeZone: text2("time_zone"),
2270
+ /** Report definition that produced this snapshot; null legacy snapshots cannot be reused. */
2271
+ reportDefinition: text2("report_definition"),
2256
2272
  totalClicks: integer2("total_clicks").notNull().default(0),
2257
2273
  totalImpressions: integer2("total_impressions").notNull().default(0),
2258
2274
  /** GA4's CTR for the window (0..1); null when there were no impressions. */
@@ -2270,7 +2286,7 @@ var gaSearchLandingWindows = sqliteTable2("ga_search_landing_windows", {
2270
2286
  }, (table) => [
2271
2287
  uniqueIndex2("idx_ga_search_landing_windows_project_window").on(table.projectId, table.windowKey),
2272
2288
  index2("idx_ga_search_landing_windows_run").on(table.syncRunId),
2273
- check("chk_ga_search_landing_windows_window", sql`${table.windowKey} IN ('7d', '28d', '90d')`),
2289
+ check("chk_ga_search_landing_windows_window", sql`${table.windowKey} IN ('7d', '28d', '90d', '180d')`),
2274
2290
  check("chk_ga_search_landing_windows_counts", sql`${table.totalClicks} >= 0 AND ${table.totalImpressions} >= 0 AND ${table.totalActiveUsers} >= 0 AND ${table.reportRowCount} >= 0`),
2275
2291
  check("chk_ga_search_landing_windows_ctr", sql`${table.totalCtr} IS NULL OR (${table.totalCtr} >= 0 AND ${table.totalCtr} <= 1)`)
2276
2292
  ]);
@@ -2292,7 +2308,7 @@ var gaSearchLandingPages = sqliteTable2("ga_search_landing_pages", {
2292
2308
  uniqueIndex2("idx_ga_search_landing_pages_grain").on(table.projectId, table.windowKey, table.landingPage),
2293
2309
  index2("idx_ga_search_landing_pages_order").on(table.projectId, table.windowKey, table.clicks),
2294
2310
  index2("idx_ga_search_landing_pages_run").on(table.syncRunId),
2295
- check("chk_ga_search_landing_pages_window", sql`${table.windowKey} IN ('7d', '28d', '90d')`),
2311
+ check("chk_ga_search_landing_pages_window", sql`${table.windowKey} IN ('7d', '28d', '90d', '180d')`),
2296
2312
  check("chk_ga_search_landing_pages_counts", sql`${table.clicks} >= 0 AND ${table.impressions} >= 0 AND ${table.activeUsers} >= 0`),
2297
2313
  check("chk_ga_search_landing_pages_ctr", sql`${table.ctr} IS NULL OR (${table.ctr} >= 0 AND ${table.ctr} <= 1)`)
2298
2314
  ]);
@@ -2520,6 +2536,17 @@ var trafficSources = sqliteTable2("traffic_sources", {
2520
2536
  */
2521
2537
  skippedThroughAt: text2("skipped_through_at"),
2522
2538
  lastEventIds: text2("last_event_ids", { mode: "json" }).$type(),
2539
+ /**
2540
+ * When this source's AI-referral hours stopped being counted by the older
2541
+ * arrival rule, which also counted a visitor's later pages, assets and API
2542
+ * calls. Set by migration v211, only for a source holding referral rows
2543
+ * written before v207 changed the rule; NULL otherwise. Hours before it can
2544
+ * read high, so charts mark them and trend fits and comparisons leave them
2545
+ * out. A one-time recount (`ai-referral-recount.ts`) rebuilds the hours AI
2546
+ * visitor journeys cover on Cloudflare and Cloud Run sources and moves this
2547
+ * back to where journeys began, or clears it when no older hour is left.
2548
+ */
2549
+ aiReferralOlderCountUntil: text2("ai_referral_older_count_until"),
2523
2550
  archivedAt: text2("archived_at"),
2524
2551
  configJson: text2("config_json", { mode: "json" }).$type().notNull().default({}),
2525
2552
  // sha256 hex of the per-source bearer token issued at connect time. Only
@@ -8933,6 +8960,121 @@ var MIGRATION_VERSIONS = [
8933
8960
  statements: [
8934
8961
  `ALTER TABLE schedules ADD COLUMN site_audit_checks TEXT`
8935
8962
  ]
8963
+ },
8964
+ {
8965
+ version: 211,
8966
+ name: "ai-referral-older-count-until",
8967
+ // v207 began counting each AI-referral arrival once per visit. Hours a
8968
+ // source wrote before it also counted the visitor's later requests and
8969
+ // cannot be recounted, so stamp when that older count ended, for sources
8970
+ // that hold such rows. A fresh install holds none and stamps nothing.
8971
+ statements: [
8972
+ `ALTER TABLE traffic_sources ADD COLUMN ai_referral_older_count_until TEXT`,
8973
+ `UPDATE traffic_sources
8974
+ SET ai_referral_older_count_until = (
8975
+ SELECT strftime('%Y-%m-%dT%H:%M:%fZ', applied_at) FROM _migrations WHERE version = 207
8976
+ )
8977
+ WHERE EXISTS (
8978
+ SELECT 1 FROM ai_referral_events_hourly r
8979
+ WHERE r.source_id = traffic_sources.id
8980
+ AND r.created_at < (SELECT strftime('%Y-%m-%dT%H:%M:%fZ', applied_at) FROM _migrations WHERE version = 207)
8981
+ )`
8982
+ ]
8983
+ },
8984
+ {
8985
+ version: 212,
8986
+ name: "ga-sync-coverage",
8987
+ statements: [
8988
+ `CREATE TABLE IF NOT EXISTS ga_sync_coverage (
8989
+ project_id TEXT NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
8990
+ component TEXT NOT NULL,
8991
+ sync_run_id TEXT NOT NULL REFERENCES runs(id) ON DELETE CASCADE,
8992
+ date TEXT NOT NULL,
8993
+ property_id TEXT NOT NULL,
8994
+ definition TEXT NOT NULL,
8995
+ settled INTEGER NOT NULL,
8996
+ synced_at TEXT NOT NULL,
8997
+ PRIMARY KEY (project_id, component, date)
8998
+ )`,
8999
+ `CREATE INDEX IF NOT EXISTS idx_ga_sync_coverage_run ON ga_sync_coverage(sync_run_id)`
9000
+ ]
9001
+ },
9002
+ {
9003
+ version: 213,
9004
+ name: "ga-search-landing-180-day-windows",
9005
+ // The two tables reference projects/runs, not each other. Rebuilding them
9006
+ // keeps foreign keys enabled and preserves the original sync provenance.
9007
+ // Add the nullable definition first so replay copies it without erasing it.
9008
+ statements: [
9009
+ `ALTER TABLE ga_search_landing_windows ADD COLUMN report_definition TEXT`,
9010
+ `DROP TABLE IF EXISTS ga_search_landing_windows_v213`,
9011
+ `CREATE TABLE ga_search_landing_windows_v213 (
9012
+ id TEXT PRIMARY KEY,
9013
+ project_id TEXT NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
9014
+ property_id TEXT NOT NULL,
9015
+ window_key TEXT NOT NULL CHECK (window_key IN ('7d', '28d', '90d', '180d')),
9016
+ period_start TEXT NOT NULL,
9017
+ period_end TEXT NOT NULL,
9018
+ time_zone TEXT,
9019
+ report_definition TEXT,
9020
+ total_clicks INTEGER NOT NULL DEFAULT 0,
9021
+ total_impressions INTEGER NOT NULL DEFAULT 0,
9022
+ total_ctr REAL CHECK (total_ctr IS NULL OR (total_ctr >= 0 AND total_ctr <= 1)),
9023
+ total_average_position REAL,
9024
+ total_active_users INTEGER NOT NULL DEFAULT 0,
9025
+ report_row_count INTEGER NOT NULL DEFAULT 0,
9026
+ rows_capped INTEGER NOT NULL DEFAULT 0,
9027
+ subject_to_thresholding INTEGER NOT NULL DEFAULT 0,
9028
+ data_loss_from_other_row INTEGER NOT NULL DEFAULT 0,
9029
+ synced_at TEXT NOT NULL,
9030
+ sync_run_id TEXT REFERENCES runs(id) ON DELETE CASCADE,
9031
+ created_at TEXT NOT NULL,
9032
+ CHECK (total_clicks >= 0 AND total_impressions >= 0 AND total_active_users >= 0 AND report_row_count >= 0)
9033
+ )`,
9034
+ `INSERT INTO ga_search_landing_windows_v213 (
9035
+ id, project_id, property_id, window_key, period_start, period_end,
9036
+ time_zone, report_definition, total_clicks, total_impressions, total_ctr,
9037
+ total_average_position, total_active_users, report_row_count, rows_capped,
9038
+ subject_to_thresholding, data_loss_from_other_row, synced_at, sync_run_id, created_at
9039
+ ) SELECT
9040
+ id, project_id, property_id, window_key, period_start, period_end,
9041
+ time_zone, report_definition, total_clicks, total_impressions, total_ctr,
9042
+ total_average_position, total_active_users, report_row_count, rows_capped,
9043
+ subject_to_thresholding, data_loss_from_other_row, synced_at, sync_run_id, created_at
9044
+ FROM ga_search_landing_windows`,
9045
+ `DROP TABLE ga_search_landing_windows`,
9046
+ `ALTER TABLE ga_search_landing_windows_v213 RENAME TO ga_search_landing_windows`,
9047
+ `CREATE UNIQUE INDEX IF NOT EXISTS idx_ga_search_landing_windows_project_window ON ga_search_landing_windows(project_id, window_key)`,
9048
+ `CREATE INDEX IF NOT EXISTS idx_ga_search_landing_windows_run ON ga_search_landing_windows(sync_run_id)`,
9049
+ `DROP TABLE IF EXISTS ga_search_landing_pages_v213`,
9050
+ `CREATE TABLE ga_search_landing_pages_v213 (
9051
+ id TEXT PRIMARY KEY,
9052
+ project_id TEXT NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
9053
+ window_key TEXT NOT NULL CHECK (window_key IN ('7d', '28d', '90d', '180d')),
9054
+ landing_page TEXT NOT NULL,
9055
+ clicks INTEGER NOT NULL DEFAULT 0,
9056
+ impressions INTEGER NOT NULL DEFAULT 0,
9057
+ ctr REAL CHECK (ctr IS NULL OR (ctr >= 0 AND ctr <= 1)),
9058
+ average_position REAL,
9059
+ active_users INTEGER NOT NULL DEFAULT 0,
9060
+ synced_at TEXT NOT NULL,
9061
+ sync_run_id TEXT REFERENCES runs(id) ON DELETE CASCADE,
9062
+ created_at TEXT NOT NULL,
9063
+ CHECK (clicks >= 0 AND impressions >= 0 AND active_users >= 0)
9064
+ )`,
9065
+ `INSERT INTO ga_search_landing_pages_v213 (
9066
+ id, project_id, window_key, landing_page, clicks, impressions, ctr,
9067
+ average_position, active_users, synced_at, sync_run_id, created_at
9068
+ ) SELECT
9069
+ id, project_id, window_key, landing_page, clicks, impressions, ctr,
9070
+ average_position, active_users, synced_at, sync_run_id, created_at
9071
+ FROM ga_search_landing_pages`,
9072
+ `DROP TABLE ga_search_landing_pages`,
9073
+ `ALTER TABLE ga_search_landing_pages_v213 RENAME TO ga_search_landing_pages`,
9074
+ `CREATE UNIQUE INDEX IF NOT EXISTS idx_ga_search_landing_pages_grain ON ga_search_landing_pages(project_id, window_key, landing_page)`,
9075
+ `CREATE INDEX IF NOT EXISTS idx_ga_search_landing_pages_order ON ga_search_landing_pages(project_id, window_key, clicks)`,
9076
+ `CREATE INDEX IF NOT EXISTS idx_ga_search_landing_pages_run ON ga_search_landing_pages(sync_run_id)`
9077
+ ]
8936
9078
  }
8937
9079
  ];
8938
9080
  var AERO_LEDGER_REBUILDS = [
@@ -10419,6 +10561,7 @@ export {
10419
10561
  bingKeywordDemand,
10420
10562
  gaConnections,
10421
10563
  gaTrafficSnapshots,
10564
+ gaSyncCoverage,
10422
10565
  gaDailyTotals,
10423
10566
  gaAcquisitionDaily,
10424
10567
  gaLeadEventsDaily,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  loadConfig
3
- } from "./chunk-5LLEZ6YL.js";
3
+ } from "./chunk-5TPLZD4I.js";
4
4
  import {
5
5
  PACKAGE_VERSION
6
6
  } from "./chunk-AOJU5LKX.js";
@@ -36,7 +36,7 @@ import {
36
36
  sentimentSettingsReadSchema,
37
37
  sentimentSummaryReadSchema,
38
38
  upgradeCommandFor
39
- } from "./chunk-GO5OUMY5.js";
39
+ } from "./chunk-CVCUADCM.js";
40
40
 
41
41
  // ../api-client-generated/src/generated/core/bodySerializer.gen.ts
42
42
  var jsonBodySerializer = {
@@ -8,23 +8,23 @@ import {
8
8
  reparseStoredResult4,
9
9
  reparseStoredResult5,
10
10
  resolveStoredApiResponse
11
- } from "./chunk-ON4G7RCY.js";
11
+ } from "./chunk-6S6XEEGX.js";
12
12
  import {
13
13
  loadConfig
14
- } from "./chunk-5LLEZ6YL.js";
14
+ } from "./chunk-5TPLZD4I.js";
15
15
  import {
16
16
  isMachineFormat
17
17
  } from "./chunk-HGMYEDAQ.js";
18
18
  import {
19
19
  determineCitationState
20
- } from "./chunk-AAUJZ43Q.js";
20
+ } from "./chunk-YTRXALSU.js";
21
21
  import {
22
22
  backfillProjectAnswerMentions,
23
23
  competitorIdentityColumns,
24
24
  createRunCompetitorResolver,
25
25
  readMarketCompetitorNames,
26
26
  refreshSnapshotMentionIdentity
27
- } from "./chunk-LWVLQCQH.js";
27
+ } from "./chunk-7PUUMJXY.js";
28
28
  import {
29
29
  RawEventSampleEventTypes,
30
30
  auditLog,
@@ -38,7 +38,7 @@ import {
38
38
  querySnapshots,
39
39
  rawEventSamples,
40
40
  runs
41
- } from "./chunk-HE4ZCVSF.js";
41
+ } from "./chunk-J3NS6NGM.js";
42
42
  import {
43
43
  ProviderNames,
44
44
  RetrievalContracts,
@@ -51,7 +51,7 @@ import {
51
51
  extractRecommendedCompetitors,
52
52
  normalizeUrlPath,
53
53
  openRouterRouteModel
54
- } from "./chunk-GO5OUMY5.js";
54
+ } from "./chunk-CVCUADCM.js";
55
55
 
56
56
  // src/commands/backfill.ts
57
57
  import { setImmediate as yieldToEventLoop } from "timers/promises";
@@ -429,7 +429,7 @@ No DB writes performed. Re-run without --dry-run to apply.`);
429
429
  }
430
430
  }
431
431
  async function backfillInsightsCommand(project, opts) {
432
- const { IntelligenceService } = await import("./intelligence-service-7FVMY2WA.js");
432
+ const { IntelligenceService } = await import("./intelligence-service-GSQ7YAYU.js");
433
433
  const config = loadConfig();
434
434
  const db = createClient(config.database);
435
435
  migrate(db);
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  pickProjectCitedDomain
3
- } from "./chunk-AAUJZ43Q.js";
3
+ } from "./chunk-YTRXALSU.js";
4
4
  import {
5
5
  createLogger
6
- } from "./chunk-BOUEM6D6.js";
6
+ } from "./chunk-T3FYWUQL.js";
7
7
  import {
8
8
  GBP_INSIGHT_PROVIDER,
9
9
  PERSISTENT_GAP_THRESHOLD,
@@ -17,7 +17,7 @@ import {
17
17
  mergeGscQueryTotalsWithFallback,
18
18
  readGscQueryDailyRows,
19
19
  readLatestGscDataDate
20
- } from "./chunk-LWVLQCQH.js";
20
+ } from "./chunk-7PUUMJXY.js";
21
21
  import {
22
22
  competitors,
23
23
  gbpDailyMetrics,
@@ -35,14 +35,14 @@ import {
35
35
  queries,
36
36
  querySnapshots,
37
37
  runs
38
- } from "./chunk-HE4ZCVSF.js";
38
+ } from "./chunk-J3NS6NGM.js";
39
39
  import {
40
40
  CitationStates,
41
41
  RunKinds,
42
42
  RunStatuses,
43
43
  RunTriggers,
44
44
  effectiveDomains
45
- } from "./chunk-GO5OUMY5.js";
45
+ } from "./chunk-CVCUADCM.js";
46
46
 
47
47
  // src/intelligence-service.ts
48
48
  import { eq, desc, asc, and, ne, or, inArray, gte, lte, isNull, sql, exists } from "drizzle-orm";