@canonry/canonry 4.160.0 → 4.162.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 (28) hide show
  1. package/assets/assets/{AuditHistoryPanel-AtgoG2AH.js → AuditHistoryPanel-BTtqk1mK.js} +1 -1
  2. package/assets/assets/{BacklinksPage-DrOSF7Mu.js → BacklinksPage-wqRYkJFG.js} +1 -1
  3. package/assets/assets/ChartPrimitives-BoYe2M-i.js +1 -0
  4. package/assets/assets/{HistoryPage-CGQXleJc.js → HistoryPage-Dj1FU5WV.js} +1 -1
  5. package/assets/assets/{MeasurementPropertyPage-C7D2OgIQ.js → MeasurementPropertyPage-CPCYzznG.js} +1 -1
  6. package/assets/assets/ProjectPage-7vg1El9D.js +9 -0
  7. package/assets/assets/{RunRow-BdzKKODo.js → RunRow-CTgtgq5x.js} +1 -1
  8. package/assets/assets/{RunsPage-BU96L07S.js → RunsPage-qS7etC5f.js} +1 -1
  9. package/assets/assets/{SettingsPage-LEca0kDH.js → SettingsPage-BlUWPiA7.js} +1 -1
  10. package/assets/assets/{SiteHealthSection-CKM4DUfE.js → SiteHealthSection-tUFchSy-.js} +3 -3
  11. package/assets/assets/{TrafficPage-tU9wl1F_.js → TrafficPage-BSWUsXM1.js} +1 -1
  12. package/assets/assets/{TrafficSourceDetailPage-DZTpnU9f.js → TrafficSourceDetailPage-DOTtU4SK.js} +1 -1
  13. package/assets/assets/{extract-error-message-BAyN-ftk.js → extract-error-message-DOWCsWL0.js} +1 -1
  14. package/assets/assets/{index-Wqv7kvs-.js → index-BYGqta_M.js} +20 -20
  15. package/assets/assets/{index-CACRaOmZ.css → index-CHluSPlN.css} +1 -1
  16. package/assets/assets/{react-sigma_core.esm.min-DlZOAc_w.js → react-sigma_core.esm.min-C4kgfZfm.js} +1 -1
  17. package/assets/index.html +2 -2
  18. package/dist/{chunk-HQAVEK42.js → chunk-2TLRE2L3.js} +1 -1
  19. package/dist/{chunk-X7CYY5Q7.js → chunk-C6ZZH3XI.js} +206 -38
  20. package/dist/{chunk-XGESWHFP.js → chunk-FZAAGXTK.js} +35 -18
  21. package/dist/{chunk-7M7T5QXS.js → chunk-NG7OR6GO.js} +3354 -3216
  22. package/dist/cli.js +42 -15
  23. package/dist/index.js +4 -4
  24. package/dist/{intelligence-service-6XQMM466.js → intelligence-service-ANRFEQWX.js} +2 -2
  25. package/dist/mcp.js +2 -2
  26. package/package.json +12 -12
  27. package/assets/assets/ChartPrimitives-DXVLCdBi.js +0 -1
  28. package/assets/assets/ProjectPage-Lp1VjNvL.js +0 -12
@@ -10,12 +10,13 @@ import {
10
10
  loadConfig,
11
11
  loadConfigRaw,
12
12
  saveConfigPatch
13
- } from "./chunk-HQAVEK42.js";
13
+ } from "./chunk-2TLRE2L3.js";
14
14
  import {
15
15
  CC_CACHE_DIR,
16
16
  DUCKDB_SPEC,
17
17
  GBP_DAILY_METRICS,
18
18
  GSC_DATA_LAG_DAYS,
19
+ GSC_REPORTING_TIME_ZONE,
19
20
  IntelligenceService,
20
21
  PLUGIN_DIR,
21
22
  adsAdGroups,
@@ -79,6 +80,7 @@ import {
79
80
  groupRunsByCreatedAt,
80
81
  gscCoverageSnapshots,
81
82
  gscDailyTotals,
83
+ gscDataWatermarks,
82
84
  gscQueryDailyTotals,
83
85
  gscSearchData,
84
86
  gscUrlInspections,
@@ -137,7 +139,7 @@ import {
137
139
  siteCrawlSnapshots,
138
140
  toAlertView,
139
141
  usageCounters
140
- } from "./chunk-X7CYY5Q7.js";
142
+ } from "./chunk-C6ZZH3XI.js";
141
143
  import {
142
144
  AGENT_MEMORY_VALUE_MAX_BYTES,
143
145
  AGENT_PROVIDER_IDS,
@@ -236,6 +238,7 @@ import {
236
238
  resolveSnapshotRequestQueries,
237
239
  serializeForInlineScript,
238
240
  serializeRunError,
241
+ shiftIsoCalendarDate,
239
242
  siteAuditRequestIdentity,
240
243
  skillsClientSchema,
241
244
  splitList,
@@ -247,7 +250,7 @@ import {
247
250
  validationError,
248
251
  winnabilityClassLabel,
249
252
  withRetry
250
- } from "./chunk-7M7T5QXS.js";
253
+ } from "./chunk-NG7OR6GO.js";
251
254
 
252
255
  // src/telemetry.ts
253
256
  import crypto from "crypto";
@@ -4428,14 +4431,6 @@ function writeCoverageSnapshot(db, projectId, runId, opts = {}) {
4428
4431
 
4429
4432
  // src/gsc-sync.ts
4430
4433
  var log2 = createLogger("GscSync");
4431
- function formatDate(d) {
4432
- return d.toISOString().split("T")[0];
4433
- }
4434
- function daysAgo(n) {
4435
- const d = /* @__PURE__ */ new Date();
4436
- d.setDate(d.getDate() - n);
4437
- return d;
4438
- }
4439
4434
  async function executeGscSync(db, runId, projectId, opts) {
4440
4435
  const now = (/* @__PURE__ */ new Date()).toISOString();
4441
4436
  db.update(runs).set({ status: "running", startedAt: now }).where(eq4(runs.id, runId)).run();
@@ -4469,9 +4464,9 @@ async function executeGscSync(db, runId, projectId, opts) {
4469
4464
  saveConfigPatch(opts.config);
4470
4465
  }
4471
4466
  const lagOffset = GSC_DATA_LAG_DAYS;
4472
- const endDate = formatDate(daysAgo(lagOffset));
4467
+ const endDate = formatIsoDateInTimeZone((/* @__PURE__ */ new Date()).toISOString(), GSC_REPORTING_TIME_ZONE);
4473
4468
  const days = opts.full ? 480 : opts.days ?? 30;
4474
- const startDate = formatDate(daysAgo(days + lagOffset));
4469
+ const startDate = shiftIsoCalendarDate(endDate, -(days + lagOffset));
4475
4470
  log2.info("fetch.start", { runId, projectId, propertyId: conn.propertyId, startDate, endDate });
4476
4471
  const rows = await fetchSearchAnalytics(accessToken, conn.propertyId, {
4477
4472
  startDate,
@@ -4533,7 +4528,29 @@ async function executeGscSync(db, runId, projectId, opts) {
4533
4528
  createdAt: dailyTotalsNow
4534
4529
  }).run();
4535
4530
  }
4536
- log2.info("daily-totals.complete", { runId, projectId, rowCount: totalRows.length });
4531
+ const observedThrough = totalRows.map((row) => row.keys[0] ?? "").filter((date) => date !== "").reduce((max, date) => max === null || date > max ? date : max, null);
4532
+ if (observedThrough !== null || endDate) {
4533
+ const existing = db.select().from(gscDataWatermarks).where(eq4(gscDataWatermarks.projectId, projectId)).get();
4534
+ const nextThrough = [existing?.dataThroughDate ?? null, observedThrough].filter((d) => d !== null).reduce((max, d) => max === null || d > max ? d : max, null);
4535
+ if (nextThrough !== null) {
4536
+ db.insert(gscDataWatermarks).values({
4537
+ projectId,
4538
+ dataThroughDate: nextThrough,
4539
+ syncedThroughDate: endDate,
4540
+ updatedAt: dailyTotalsNow
4541
+ }).onConflictDoUpdate({
4542
+ target: gscDataWatermarks.projectId,
4543
+ set: { dataThroughDate: nextThrough, syncedThroughDate: endDate, updatedAt: dailyTotalsNow }
4544
+ }).run();
4545
+ }
4546
+ }
4547
+ log2.info("daily-totals.complete", {
4548
+ runId,
4549
+ projectId,
4550
+ rowCount: totalRows.length,
4551
+ observedThrough,
4552
+ syncedThrough: endDate
4553
+ });
4537
4554
  const queryTotalRows = await fetchSearchAnalytics(accessToken, propertyId, {
4538
4555
  startDate,
4539
4556
  endDate,
@@ -4585,7 +4602,7 @@ var DEFAULT_DAYS_OF_METRICS = 30;
4585
4602
  var DEFAULT_MONTHS_OF_KEYWORDS = 12;
4586
4603
  var KEYWORD_TREND_MONTHS = 3;
4587
4604
  var KEYWORD_HISTORY_RETENTION_MONTHS = 18;
4588
- function daysAgo2(n) {
4605
+ function daysAgo(n) {
4589
4606
  const d = /* @__PURE__ */ new Date();
4590
4607
  d.setUTCDate(d.getUTCDate() - n);
4591
4608
  return d;
@@ -4633,8 +4650,8 @@ async function executeGbpSync(db, runId, projectId, opts) {
4633
4650
  locationRows = await refreshSelectedLocationProfiles(db, projectId, accessToken, locationRows);
4634
4651
  const daysOfMetrics = opts.daysOfMetrics ?? DEFAULT_DAYS_OF_METRICS;
4635
4652
  const monthsOfKeywords = opts.monthsOfKeywords ?? DEFAULT_MONTHS_OF_KEYWORDS;
4636
- const metricsStart = daysAgo2(daysOfMetrics);
4637
- const metricsEnd = daysAgo2(1);
4653
+ const metricsStart = daysAgo(daysOfMetrics);
4654
+ const metricsEnd = daysAgo(1);
4638
4655
  const keywordsStart = monthMinus(monthsOfKeywords);
4639
4656
  const keywordsEnd = monthMinus(0);
4640
4657
  const trendMonths = Array.from({ length: KEYWORD_TREND_MONTHS }, (_, i) => monthMinus(i + 1));
@@ -9017,7 +9034,7 @@ function readStoredGroundingSources(rawResponse) {
9017
9034
  return result;
9018
9035
  }
9019
9036
  async function backfillInsightsCommand(project, opts) {
9020
- const { IntelligenceService: IntelligenceService2 } = await import("./intelligence-service-6XQMM466.js");
9037
+ const { IntelligenceService: IntelligenceService2 } = await import("./intelligence-service-ANRFEQWX.js");
9021
9038
  const config = loadConfig();
9022
9039
  const db = createClient(config.database);
9023
9040
  migrate(db);