@canonry/canonry 7.57.2 → 7.58.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 (139) hide show
  1. package/README.md +28 -0
  2. package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +6 -0
  3. package/assets/assets/{AgentSetupPage-Cc_zsHR0.js → AgentSetupPage-DZBjF9HP.js} +3 -3
  4. package/assets/assets/{AuditHistoryPanel-vMTAZBj_.js → AuditHistoryPanel-DAY6GbzH.js} +1 -1
  5. package/assets/assets/{BacklinksPage-CbploUJf.js → BacklinksPage-Ci9s8osY.js} +1 -1
  6. package/assets/assets/{HistoryPage-m-59cu3N.js → HistoryPage-BM7PM3Ow.js} +1 -1
  7. package/assets/assets/MeasurementPropertyPage-DgMIc9zm.js +4 -0
  8. package/assets/assets/ProjectPage-OOpNW437.js +9 -0
  9. package/assets/assets/RunsPage-B6dUljTT.js +1 -0
  10. package/assets/assets/{SettingsPage-UT9KpfMj.js → SettingsPage-DjhPnQNP.js} +1 -1
  11. package/assets/assets/SiteHealthSection-CQipxjCq.js +2 -0
  12. package/assets/assets/ToneBadge-Bk7cBexZ.js +60 -0
  13. package/assets/assets/{TrafficPage-BPwgnTWA.js → TrafficPage-TceTtJmu.js} +2 -2
  14. package/assets/assets/{TrafficSourceDetailPage-D7_b16wr.js → TrafficSourceDetailPage-BVAVo-JO.js} +1 -1
  15. package/assets/assets/{account-context-BAJ4-K7g.js → account-context-ChEngAKj.js} +1 -1
  16. package/assets/assets/{card-OSE9muoF.js → card-qOcJFZhl.js} +1 -1
  17. package/assets/assets/{extract-error-message-CmAMG5OS.js → extract-error-message-bWEYiDDO.js} +1 -1
  18. package/assets/assets/{format-helpers-k8DWKWfO.js → format-helpers-CvOZG1pt.js} +1 -1
  19. package/assets/assets/{index-BMD46UDb.css → index-D67dZGOY.css} +1 -1
  20. package/assets/assets/index-cRQCvw6S.js +56 -0
  21. package/assets/assets/query-client-nsJhXK9R.js +1 -0
  22. package/assets/assets/react-query-BKjNH2ek.js +1 -0
  23. package/assets/assets/{react-sigma_core.esm.min-DLc_m5Ao.js → react-sigma_core.esm.min-RpFcdsyW.js} +1 -1
  24. package/assets/assets/{service-B51xJDz2.js → service-DwTt-v6l.js} +1 -1
  25. package/assets/index.html +8 -8
  26. package/dist/{ads-5ZKOYN72.js → ads-BMBXQB67.js} +3 -3
  27. package/dist/{agent-Q63YJLFN.js → agent-S6CU36RL.js} +7 -7
  28. package/dist/{agent-ask-5EZKRAMG.js → agent-ask-XG7WQBX6.js} +3 -3
  29. package/dist/{agent-conversations-B3P2DHD2.js → agent-conversations-C4QBZAPC.js} +3 -3
  30. package/dist/{agent-memory-4672STKY.js → agent-memory-I7UJ7MKH.js} +3 -3
  31. package/dist/{agent-providers-IARC3ZE6.js → agent-providers-YHRIYJDT.js} +3 -3
  32. package/dist/{agent-transcript-CQLUO6TR.js → agent-transcript-2WICUOEW.js} +3 -3
  33. package/dist/{analytics-HBWILHPQ.js → analytics-Y5AGSYWD.js} +3 -3
  34. package/dist/{apply-YRVGOW4D.js → apply-DLVLMU3O.js} +3 -3
  35. package/dist/{backfill-T2R2QTOZ.js → backfill-JAHDHVXJ.js} +9 -9
  36. package/dist/{backlinks-KOSJ4BAT.js → backlinks-TEZTPNZ5.js} +3 -3
  37. package/dist/{bing-LYCNZP6M.js → bing-IIA5HLND.js} +3 -3
  38. package/dist/{bootstrap-AI7CKW3E.js → bootstrap-AKGA3BJI.js} +10 -10
  39. package/dist/{cdp-LP3GDIXS.js → cdp-WWOFWFYU.js} +7 -7
  40. package/dist/{chunk-46S3COHT.js → chunk-27SGL3DF.js} +1 -1
  41. package/dist/{chunk-PXEU7GIW.js → chunk-2DZYA62C.js} +18 -6
  42. package/dist/{chunk-XJJNKNX3.js → chunk-3U7LL3JM.js} +1 -1
  43. package/dist/{chunk-TRXD3CXS.js → chunk-4P7NK7XM.js} +2 -2
  44. package/dist/{chunk-ICVMS2JE.js → chunk-4TM4NXQR.js} +2 -2
  45. package/dist/{chunk-MUSBD3EX.js → chunk-4UGM5YV4.js} +3 -3
  46. package/dist/{chunk-TCXRQZYE.js → chunk-52NCZIAC.js} +1 -1
  47. package/dist/{chunk-HRYRYUI2.js → chunk-6IBLGQVZ.js} +1 -1
  48. package/dist/{chunk-4PYN2J6Z.js → chunk-7CKJTD3Q.js} +1129 -905
  49. package/dist/{chunk-ADWVQ3UM.js → chunk-BP5OKJIC.js} +2 -2
  50. package/dist/{chunk-JZX4CR7V.js → chunk-F6W7FCS2.js} +196 -2
  51. package/dist/{chunk-QTFHMU6I.js → chunk-G34BVUMF.js} +1 -1
  52. package/dist/{chunk-ZD37CGTP.js → chunk-IFVTHGXG.js} +2 -2
  53. package/dist/{chunk-7RLF3PV4.js → chunk-JGRUCEL4.js} +2 -2
  54. package/dist/{chunk-4NDWRR4B.js → chunk-KWXARGCT.js} +27 -5
  55. package/dist/{chunk-2THE4GKG.js → chunk-L7TKNHEX.js} +1 -1
  56. package/dist/{chunk-KZZAU4SN.js → chunk-N2HCXIQ3.js} +1 -1
  57. package/dist/{chunk-4MJYGB56.js → chunk-NCIPNVD6.js} +8 -0
  58. package/dist/{chunk-UMMF5KC5.js → chunk-NMLVLFF7.js} +5 -5
  59. package/dist/{chunk-YWUB5ZU6.js → chunk-NS7KRCND.js} +1140 -573
  60. package/dist/{chunk-IVSJLTKC.js → chunk-NWQQYLZV.js} +2845 -2243
  61. package/dist/{chunk-WODNZ6PH.js → chunk-PEZO3YEC.js} +4 -4
  62. package/dist/{chunk-42V5EYJX.js → chunk-Q4J3XSWE.js} +1 -1
  63. package/dist/{chunk-DJ4YDAI6.js → chunk-QFO7JHX2.js} +9 -4
  64. package/dist/{chunk-QN3YYE4J.js → chunk-QSPLYPVA.js} +1 -1
  65. package/dist/{chunk-N3WRXGRW.js → chunk-RXMGU7AF.js} +8 -8
  66. package/dist/{chunk-EIGZFAQJ.js → chunk-SCS7R2ND.js} +2269 -2011
  67. package/dist/{chunk-3PMACMXD.js → chunk-TH3NNUJW.js} +17 -1
  68. package/dist/{chunk-FILMLHNG.js → chunk-TVANRUBO.js} +108 -83
  69. package/dist/{chunk-TX6JOU2D.js → chunk-U65LWABS.js} +7 -3
  70. package/dist/{chunk-BM4AWHD6.js → chunk-WLIGKWVB.js} +3 -3
  71. package/dist/{chunk-LACYPNQA.js → chunk-Y7NX6EIK.js} +1801 -1456
  72. package/dist/{chunk-T76XI4DS.js → chunk-YDSY5YJE.js} +4 -4
  73. package/dist/{chunk-TAEBXXGQ.js → chunk-YJPQBJZO.js} +250 -3
  74. package/dist/{chunk-BMLVLHSH.js → chunk-ZYL3LCDZ.js} +1 -1
  75. package/dist/{citations-XUAOQHRF.js → citations-4LVBHTDX.js} +3 -3
  76. package/dist/{cli-catalog-R6JZ5ELQ.js → cli-catalog-PJYR3JHX.js} +3 -3
  77. package/dist/{cli-commands-YFN3ZE4O.js → cli-commands-2HYNKJDJ.js} +7 -7
  78. package/dist/cli.js +13 -13
  79. package/dist/{competitor-67DBTBBA.js → competitor-T7UXAW4F.js} +3 -3
  80. package/dist/{content-3OVMQETU.js → content-DFYYGGPI.js} +3 -3
  81. package/dist/{dashboard-LFJXKLFE.js → dashboard-2P3TEH6S.js} +6 -6
  82. package/dist/{demo-6ANGZSRC.js → demo-UBMNDBRF.js} +1 -1
  83. package/dist/{demo-server-HUVMI3XH.js → demo-server-F4M74FVL.js} +11 -11
  84. package/dist/{discover-YF3FDGSD.js → discover-QTC5OBQG.js} +3 -3
  85. package/dist/{discover-eval-CMHDYK5O.js → discover-eval-QQZGUPR6.js} +3 -3
  86. package/dist/{doctor-WKNWJSK4.js → doctor-VHFDL5MH.js} +3 -3
  87. package/dist/{evidence-CLNQ2CYR.js → evidence-4PRFOC2I.js} +3 -3
  88. package/dist/{export-cmd-OHRV4TVH.js → export-cmd-BQE7BPKZ.js} +3 -3
  89. package/dist/{ga-FX742WRJ.js → ga-ULY5XDBK.js} +3 -3
  90. package/dist/{gbp-MRQ4IZCG.js → gbp-4WHNZAFY.js} +3 -3
  91. package/dist/{google-C7TZMMMK.js → google-O4IVWLSG.js} +4 -4
  92. package/dist/{google-marketing-D2UGYDMK.js → google-marketing-DCQDTDDG.js} +1 -1
  93. package/dist/{health-cmd-67I3W2ZU.js → health-cmd-I2JTACS7.js} +3 -3
  94. package/dist/{history-ZWVARGNG.js → history-LUPHO3P3.js} +3 -3
  95. package/dist/index.d.ts +1212 -19
  96. package/dist/index.js +25 -25
  97. package/dist/{init-AOBSZ2LL.js → init-YKMNKERW.js} +11 -11
  98. package/dist/{insights-7LBGR4WZ.js → insights-GC2W45U4.js} +3 -3
  99. package/dist/intelligence-service-4PHEK5F4.js +15 -0
  100. package/dist/{keys-6QJRMT55.js → keys-DXQBSOBI.js} +3 -3
  101. package/dist/{keyword-OPBDMSWK.js → keyword-2DCR2QCJ.js} +3 -3
  102. package/dist/{logs-EGD3OBA4.js → logs-H45QFIEB.js} +3 -3
  103. package/dist/{mcp-KAM74JPU.js → mcp-NXXP6M3C.js} +2 -2
  104. package/dist/mcp.js +10 -10
  105. package/dist/{measurement-plan-V53W3HSX.js → measurement-plan-IG4JUKKW.js} +5 -5
  106. package/dist/{notify-KYZJ2RDC.js → notify-BLLWXMBB.js} +3 -3
  107. package/dist/{organic-evidence-N53Z2XJH.js → organic-evidence-73K7W7SB.js} +3 -3
  108. package/dist/{overview-BE25C6Q5.js → overview-4TAULPUG.js} +4 -4
  109. package/dist/{project-NO32ZURN.js → project-ANX4JTWS.js} +3 -3
  110. package/dist/{query-NKVTEXLS.js → query-U3MFTLGR.js} +3 -3
  111. package/dist/{research-YISKR3TJ.js → research-3YZ6QI67.js} +3 -3
  112. package/dist/{results-export-HD6Q6ZNB.js → results-export-72OVLKSC.js} +3 -3
  113. package/dist/{run-MAOMVPZL.js → run-SI6IL4FC.js} +4 -4
  114. package/dist/{schedule-NWDR5YEK.js → schedule-FYEHU2VH.js} +3 -3
  115. package/dist/{search-PBA5FKL7.js → search-MXDT3DQE.js} +3 -3
  116. package/dist/{serve-VRTPB4I3.js → serve-C4FOCQEX.js} +26 -26
  117. package/dist/{session-M2SYYRPJ.js → session-VTFLD3C5.js} +13 -13
  118. package/dist/{settings-Q2FL6ONA.js → settings-ZGS26QOP.js} +3 -3
  119. package/dist/{skills-7LRRFGYJ.js → skills-ZMMCKKSA.js} +2 -2
  120. package/dist/{snapshot-BPYTJ4C4.js → snapshot-5AGGUQKE.js} +3 -3
  121. package/dist/{src-5KXLTZQQ.js → src-AIM5FPLZ.js} +15 -2
  122. package/dist/{status-T56ADODQ.js → status-HVQI4E5X.js} +4 -4
  123. package/dist/{technical-aeo-W5VS6DYU.js → technical-aeo-S4OFCURE.js} +3 -3
  124. package/dist/{telemetry-4V3L3ZQ2.js → telemetry-SPSC5MUN.js} +4 -4
  125. package/dist/{tools-M4S6JACN.js → tools-LRHO7QOT.js} +11 -11
  126. package/dist/{traffic-ESXWT2F2.js → traffic-5AXVN37M.js} +5 -5
  127. package/dist/{users-YCOSFESL.js → users-WFKSUCGV.js} +3 -3
  128. package/dist/{visibility-stats-AA4AQPSL.js → visibility-stats-5S26GC27.js} +3 -3
  129. package/dist/{wordpress-GSONHGOA.js → wordpress-IUPZC7II.js} +3 -3
  130. package/package.json +2 -1
  131. package/assets/assets/MeasurementPropertyPage-C68Gtag-.js +0 -4
  132. package/assets/assets/ProjectPage-BLdhBCRJ.js +0 -7
  133. package/assets/assets/RunsPage-qnNeAXTI.js +0 -1
  134. package/assets/assets/SiteHealthSection-DUYFjszN.js +0 -2
  135. package/assets/assets/ToneBadge-Yt2Lm4cB.js +0 -60
  136. package/assets/assets/index-C04O5pbQ.js +0 -56
  137. package/assets/assets/query-client-CmCGzr9j.js +0 -1
  138. package/assets/assets/react-query-CWskqnJ3.js +0 -1
  139. package/dist/intelligence-service-B266DYRT.js +0 -15
@@ -3421,6 +3421,17 @@ function hostOf(value) {
3421
3421
  const hostname = getHostname(trimmed);
3422
3422
  return hostname ? hostname.replace(/^www\./i, "").toLowerCase() : null;
3423
3423
  }
3424
+ function normalizeHostname(input) {
3425
+ const value = input.trim();
3426
+ if (!value || /[\s/\\:@?#%]/.test(value) || value.endsWith(".")) return null;
3427
+ try {
3428
+ const host = new URL(`https://${value}`).hostname.toLowerCase();
3429
+ if (/^\d+\.\d+\.\d+\.\d+$/.test(host) || host.length > 253 || host.split(".").some((label) => !/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/.test(label))) return null;
3430
+ return host;
3431
+ } catch {
3432
+ return null;
3433
+ }
3434
+ }
3424
3435
  function registrableDomain(value) {
3425
3436
  if (value == null || value.trim() === "") return "";
3426
3437
  return getDomain2(value, DOMAIN_PARSE_OPTIONS)?.toLowerCase() ?? "";
@@ -6159,6 +6170,42 @@ function compileMeasurementPlanPreview(input, context) {
6159
6170
  function canonicalMeasurementPlanJson(plan) {
6160
6171
  return JSON.stringify(canonicalJsonValue2(plan));
6161
6172
  }
6173
+ function parseMeasurementUrl(value) {
6174
+ const trimmed = value.trim();
6175
+ if (!trimmed) return null;
6176
+ try {
6177
+ const parsed = new URL(trimmed.includes("://") ? trimmed : `https://${trimmed}`);
6178
+ if (parsed.protocol !== "http:" && parsed.protocol !== "https:") return null;
6179
+ const host = normalizeMeasurementHost(parsed.hostname);
6180
+ return { host, pathname: canonicalizeMeasurementPath(parsed.pathname || "/") };
6181
+ } catch {
6182
+ return null;
6183
+ }
6184
+ }
6185
+ function equalPath(left, right, pathCase) {
6186
+ return pathCase === "insensitive" ? foldPathCase(left) === foldPathCase(right) : left === right;
6187
+ }
6188
+ function hasPathPrefix(pathname, prefix, pathCase) {
6189
+ const actual = pathCase === "insensitive" ? foldPathCase(pathname) : pathname;
6190
+ const expected = pathCase === "insensitive" ? foldPathCase(prefix) : prefix;
6191
+ return expected === "/" || actual === expected || actual.startsWith(`${expected}/`);
6192
+ }
6193
+ function matchesMeasurementTargetUrl(url, input) {
6194
+ const parsedMatcher = measurementTargetUrlMatcherSchema.safeParse(input);
6195
+ const parsedUrl = parseMeasurementUrl(url);
6196
+ if (!parsedMatcher.success || !parsedUrl) return false;
6197
+ const matcher = parsedMatcher.data;
6198
+ const parts = matcherParts(matcher);
6199
+ if (parsedUrl.host !== parts.host) return false;
6200
+ switch (matcher.kind) {
6201
+ case "host":
6202
+ return true;
6203
+ case "prefix":
6204
+ return hasPathPrefix(parsedUrl.pathname, matcher.pathPrefix, matcher.pathCase);
6205
+ case "exact":
6206
+ return equalPath(parsedUrl.pathname, parts.pathname, matcher.pathCase);
6207
+ }
6208
+ }
6162
6209
 
6163
6210
  // ../contracts/src/answer-evidence.ts
6164
6211
  import { z as z13 } from "zod";
@@ -6611,7 +6658,8 @@ var runKindSchema = z17.enum([
6611
6658
  "gbp-sync",
6612
6659
  "ads-sync",
6613
6660
  "google-ads-sync",
6614
- "gtm-sync"
6661
+ "gtm-sync",
6662
+ "seo-sync"
6615
6663
  ]);
6616
6664
  var RunKinds = runKindSchema.enum;
6617
6665
  var runListFilterQuerySchema = z17.object({
@@ -13142,6 +13190,7 @@ var LIVE_READ_OPERATIONS = /* @__PURE__ */ new Set([
13142
13190
  "POST /api/v1/projects/{name}/measurement-discovery"
13143
13191
  ]);
13144
13192
  var READ_SEMANTIC_OPERATIONS = /* @__PURE__ */ new Set([
13193
+ "POST /api/v1/projects/{name}/seo/refresh-intents",
13145
13194
  "POST /api/v1/projects/{name}/measurement-plan/compile-preview",
13146
13195
  "POST /api/v1/projects/{name}/measurement-plan/diff-preview",
13147
13196
  "POST /api/v1/projects/{name}/measurement-plan/draft/actions/preview-assignments",
@@ -13160,6 +13209,17 @@ var WRITE_OPERATIONS = /* @__PURE__ */ new Set([
13160
13209
  "GET /api/v1/projects/{name}/bing/coverage"
13161
13210
  ]);
13162
13211
  var STORED_READ_OPERATIONS = /* @__PURE__ */ new Set([
13212
+ "GET /api/v1/seo/operator/tasks/{id}",
13213
+ "GET /api/v1/projects/{name}/seo/context",
13214
+ "GET /api/v1/projects/{name}/seo/status",
13215
+ "GET /api/v1/projects/{name}/seo/profiles",
13216
+ "GET /api/v1/projects/{name}/seo/profiles/{id}",
13217
+ "GET /api/v1/projects/{name}/seo/runs",
13218
+ "GET /api/v1/projects/{name}/seo/runs/{id}",
13219
+ "GET /api/v1/projects/{name}/seo/overview",
13220
+ "GET /api/v1/projects/{name}/seo/keyword-metrics",
13221
+ "GET /api/v1/projects/{name}/seo/domain-intelligence",
13222
+ "GET /api/v1/projects/{name}/seo/ranked-keywords",
13163
13223
  "GET /api/v1/projects/{name}/gbp/local-post-attempt",
13164
13224
  "GET /api/v1/openapi.json",
13165
13225
  "GET /api/v1/screenshots/{snapshotId}",
@@ -18209,14 +18269,14 @@ function median(values) {
18209
18269
  const middle = Math.floor(sorted.length / 2);
18210
18270
  return sorted.length % 2 === 1 ? sorted[middle] : (sorted[middle - 1] + sorted[middle]) / 2;
18211
18271
  }
18212
- function wilsonInterval(successes, n, z90 = 1.96) {
18272
+ function wilsonInterval(successes, n, z91 = 1.96) {
18213
18273
  if (!Number.isFinite(n) || n <= 0) return null;
18214
18274
  const s = Math.max(0, Math.min(successes, n));
18215
18275
  const p = s / n;
18216
- const z210 = z90 * z90;
18276
+ const z210 = z91 * z91;
18217
18277
  const denom = 1 + z210 / n;
18218
18278
  const center = (p + z210 / (2 * n)) / denom;
18219
- const margin = z90 / denom * Math.sqrt(p * (1 - p) / n + z210 / (4 * n * n));
18279
+ const margin = z91 / denom * Math.sqrt(p * (1 - p) / n + z210 / (4 * n * n));
18220
18280
  return {
18221
18281
  low: round(Math.max(0, center - margin)),
18222
18282
  high: round(Math.min(1, center + margin))
@@ -20196,6 +20256,8 @@ var gbpLiveReviewsSchema = z59.object({
20196
20256
  var READ_ONLY_SCOPE = "read";
20197
20257
  var WILDCARD_SCOPE = "*";
20198
20258
  var RESEARCH_RUN_SCOPE = "research.run";
20259
+ var SEO_RUN_SCOPE = "seo.run";
20260
+ var SEO_WRITE_SCOPE = "seo.write";
20199
20261
  var PROJECTS_WRITE_SCOPE = "projects.write";
20200
20262
  var ADS_WRITE_SCOPE = "ads.write";
20201
20263
  var ADS_APPROVE_SCOPE = "ads.approve";
@@ -20203,11 +20265,11 @@ var ADS_ACTIVATE_SCOPE = "ads.activate";
20203
20265
  var GOOGLE_MARKETING_LIVE_READ_SCOPE = "google-marketing.read-live";
20204
20266
  var GOOGLE_MARKETING_WRITE_SCOPE = "google-marketing.write";
20205
20267
  function grantsWrite(scope) {
20206
- return scope === WILDCARD_SCOPE || scope === "write" || scope.endsWith(".write") || scope === ADS_APPROVE_SCOPE || scope === ADS_ACTIVATE_SCOPE || scope === RESEARCH_RUN_SCOPE;
20268
+ return scope === WILDCARD_SCOPE || scope === "write" || scope.endsWith(".write") || scope === ADS_APPROVE_SCOPE || scope === ADS_ACTIVATE_SCOPE || scope === RESEARCH_RUN_SCOPE || scope === SEO_RUN_SCOPE;
20207
20269
  }
20208
20270
  function restrictedWriteScopes(scopes) {
20209
20271
  const writes = scopes.filter(grantsWrite);
20210
- const restricted = /* @__PURE__ */ new Set([ADS_WRITE_SCOPE, ADS_APPROVE_SCOPE, ADS_ACTIVATE_SCOPE, RESEARCH_RUN_SCOPE, GBP_POSTS_WRITE_SCOPE]);
20272
+ const restricted = /* @__PURE__ */ new Set([ADS_WRITE_SCOPE, ADS_APPROVE_SCOPE, ADS_ACTIVATE_SCOPE, RESEARCH_RUN_SCOPE, SEO_RUN_SCOPE, SEO_WRITE_SCOPE, GBP_POSTS_WRITE_SCOPE]);
20211
20273
  return writes.length > 0 && writes.every((scope) => restricted.has(scope)) ? writes : null;
20212
20274
  }
20213
20275
  function intersectScopes(authority, requested) {
@@ -20716,19 +20778,260 @@ function uncheckedSourcesLabel(value) {
20716
20778
  return `${value.unchecked} of ${total} ${total === 1 ? "answer" : "answers"} had sources that could not be checked`;
20717
20779
  }
20718
20780
 
20719
- // ../contracts/src/api-keys.ts
20781
+ // ../contracts/src/seo.ts
20720
20782
  import { z as z64 } from "zod";
20721
- var apiKeyDtoSchema = z64.object({
20783
+ var seoCapabilitySchema = z64.enum(["keyword-metrics", "domain-intelligence", "ranked-keywords"]);
20784
+ var SeoCapabilities = seoCapabilitySchema.enum;
20785
+ var seoProviderSchema = z64.enum(["dataforseo"]);
20786
+ var SeoProviders = seoProviderSchema.enum;
20787
+ var seoTargetKindSchema = z64.enum(["domain", "host"]);
20788
+ var SeoTargetKinds = seoTargetKindSchema.enum;
20789
+ var seoScopeKindSchema = z64.enum(["project", "group", "market", "property"]);
20790
+ var SeoScopeKinds = seoScopeKindSchema.enum;
20791
+ var seoRunStatusSchema = z64.enum(["queued", "running", "completed", "partial", "failed", "cancelled", "reconciliation-required"]);
20792
+ var SeoRunStatuses = seoRunStatusSchema.enum;
20793
+ var seoAvailabilitySchema = z64.enum(["ready", "unavailable"]);
20794
+ var SeoAvailability = seoAvailabilitySchema.enum;
20795
+ var seoTargetSchema = z64.object({
20796
+ kind: seoTargetKindSchema,
20797
+ value: z64.string().min(1).max(253),
20798
+ includeSubdomains: z64.boolean()
20799
+ }).strict();
20800
+ var seoScopeSelectionSchema = z64.object({
20801
+ kind: seoScopeKindSchema,
20802
+ key: z64.string().min(1).max(200).optional(),
20803
+ expectedPlanRevision: z64.number().int().nonnegative().optional()
20804
+ }).strict();
20805
+ var seoProfileInputSchema = z64.object({
20806
+ name: z64.string().trim().min(1).max(120),
20807
+ connectionId: z64.string().min(1).max(100),
20808
+ capabilities: z64.array(seoCapabilitySchema).min(1).max(3),
20809
+ targets: z64.array(seoTargetSchema).max(20),
20810
+ keywords: z64.array(z64.string().trim().min(1).max(80).regex(/^\S+(?:\s+\S+){0,9}$/, "Use at most 10 words per keyword.")).max(700),
20811
+ locationCode: z64.number().int().positive(),
20812
+ languageCode: z64.string().min(2).max(10),
20813
+ limit: z64.number().int().min(1).max(1e3),
20814
+ scope: seoScopeSelectionSchema
20815
+ }).strict();
20816
+ var seoProfileSchema = seoProfileInputSchema.extend({
20817
+ id: z64.string(),
20818
+ revision: z64.number().int().positive(),
20819
+ createdAt: z64.string(),
20820
+ updatedAt: z64.string()
20821
+ });
20822
+ var seoProfileListSchema = z64.object({ profiles: z64.array(seoProfileSchema) }).strict();
20823
+ var seoConnectionSummarySchema = z64.object({
20722
20824
  id: z64.string(),
20723
- name: z64.string(),
20825
+ label: z64.string(),
20826
+ provider: seoProviderSchema,
20827
+ capabilities: z64.array(seoCapabilitySchema)
20828
+ }).strict();
20829
+ var seoContextSchema = z64.object({
20830
+ available: z64.boolean(),
20831
+ reason: z64.string().nullable(),
20832
+ connections: z64.array(seoConnectionSummarySchema),
20833
+ scopes: z64.array(z64.object({
20834
+ kind: seoScopeKindSchema,
20835
+ key: z64.string().nullable(),
20836
+ label: z64.string(),
20837
+ planRevision: z64.number().int().nonnegative().optional(),
20838
+ supported: z64.boolean(),
20839
+ reason: z64.string().nullable(),
20840
+ capabilities: z64.array(seoCapabilitySchema).optional()
20841
+ }).strict()),
20842
+ access: z64.object({ canRun: z64.boolean(), canWrite: z64.boolean() }).strict()
20843
+ }).strict();
20844
+ var seoStatusSchema = z64.object({
20845
+ available: z64.boolean(),
20846
+ reason: z64.string().nullable(),
20847
+ capabilities: z64.array(seoCapabilitySchema),
20848
+ profileCount: z64.number().int().nonnegative(),
20849
+ latestRunId: z64.string().nullable(),
20850
+ latestRunStatus: seoRunStatusSchema.nullable(),
20851
+ lastCompletedAt: z64.string().nullable()
20852
+ }).strict();
20853
+ var seoEstimateInputSchema = z64.object({ profileId: z64.string().min(1) }).strict();
20854
+ var seoRefreshIntentInputSchema = seoEstimateInputSchema;
20855
+ var seoQuoteSchema = z64.object({
20856
+ token: z64.string(),
20857
+ expiresAt: z64.string(),
20858
+ profileId: z64.string(),
20859
+ profileRevision: z64.number().int().positive(),
20860
+ taskCount: z64.number().int().nonnegative(),
20861
+ targets: z64.array(seoTargetSchema),
20862
+ capabilities: z64.array(seoCapabilitySchema),
20863
+ availability: seoAvailabilitySchema,
20864
+ reason: z64.string().nullable()
20865
+ }).strict();
20866
+ var seoSyncInputSchema = z64.object({
20867
+ quoteToken: z64.string().min(1).max(16384),
20868
+ idempotencyKey: z64.string().min(1).max(200)
20869
+ }).strict();
20870
+ var seoProvenanceSchema = z64.object({
20871
+ provider: seoProviderSchema,
20872
+ dataset: z64.string(),
20873
+ engine: z64.literal("google"),
20874
+ locationCode: z64.number().int().positive(),
20875
+ languageCode: z64.string(),
20876
+ device: z64.literal("unspecified"),
20877
+ collectedAt: z64.string(),
20878
+ sourceUpdatedAt: z64.string().nullable()
20879
+ }).strict();
20880
+ var seoMonthlyVolumeSchema = z64.object({
20881
+ year: z64.number().int(),
20882
+ month: z64.number().int().min(1).max(12),
20883
+ searchVolume: z64.number().int().nonnegative().nullable()
20884
+ }).strict();
20885
+ var seoKeywordMetricsSchema = z64.object({
20886
+ keyword: z64.string(),
20887
+ searchVolume: z64.number().int().nonnegative().nullable(),
20888
+ cpcUsd: z64.number().nonnegative().nullable(),
20889
+ adCompetition: fraction(z64.number().min(0).max(1)).nullable(),
20890
+ keywordDifficulty: z64.number().min(0).max(100).nullable().describe("Provider difficulty score on a 0\u2013100 scale; not a percentage."),
20891
+ searchIntent: z64.string().nullable(),
20892
+ monthlySearches: z64.array(seoMonthlyVolumeSchema),
20893
+ coreKeyword: z64.string().nullable(),
20894
+ provenance: seoProvenanceSchema
20895
+ }).strict();
20896
+ var seoDomainIntelligenceSchema = z64.object({
20897
+ target: seoTargetSchema,
20898
+ organicKeywords: z64.number().int().nonnegative().nullable(),
20899
+ estimatedOrganicTraffic: z64.number().nonnegative().nullable(),
20900
+ estimatedOrganicTrafficValueUsd: z64.number().nonnegative().nullable(),
20901
+ top1: z64.number().int().nonnegative().nullable(),
20902
+ top2To3: z64.number().int().nonnegative().nullable(),
20903
+ top4To10: z64.number().int().nonnegative().nullable(),
20904
+ top11To20: z64.number().int().nonnegative().nullable(),
20905
+ provenance: seoProvenanceSchema
20906
+ }).strict();
20907
+ var seoRankedKeywordSchema = z64.object({
20908
+ target: seoTargetSchema,
20909
+ keyword: z64.string(),
20910
+ url: z64.string().nullable(),
20911
+ rankOrganic: z64.number().int().positive().nullable(),
20912
+ rankAbsolute: z64.number().int().positive().nullable(),
20913
+ searchVolume: z64.number().int().nonnegative().nullable(),
20914
+ estimatedTraffic: z64.number().nonnegative().nullable(),
20915
+ cpcUsd: z64.number().nonnegative().nullable(),
20916
+ keywordDifficulty: z64.number().min(0).max(100).nullable().describe("Provider difficulty score on a 0\u2013100 scale; not a percentage."),
20917
+ serpFeatures: z64.array(z64.string()),
20918
+ provenance: seoProvenanceSchema
20919
+ }).strict();
20920
+ var seoResultsSchema = z64.object({
20921
+ keywordMetrics: z64.array(seoKeywordMetricsSchema),
20922
+ domainIntelligence: z64.array(seoDomainIntelligenceSchema),
20923
+ rankedKeywords: z64.array(seoRankedKeywordSchema)
20924
+ }).strict();
20925
+ function emptySeoResults() {
20926
+ return { keywordMetrics: [], domainIntelligence: [], rankedKeywords: [] };
20927
+ }
20928
+ var seoRunSchema = z64.object({
20929
+ id: z64.string(),
20930
+ projectId: z64.string(),
20931
+ profileId: z64.string(),
20932
+ profileRevision: z64.number().int().positive(),
20933
+ locationCode: z64.number().int().positive(),
20934
+ languageCode: z64.string(),
20935
+ cancelRequested: z64.boolean(),
20936
+ status: seoRunStatusSchema,
20937
+ capabilities: z64.array(seoCapabilitySchema),
20938
+ scope: seoScopeSelectionSchema,
20939
+ taskCount: z64.number().int().nonnegative(),
20940
+ completedTasks: z64.number().int().nonnegative(),
20941
+ failedTasks: z64.number().int().nonnegative(),
20942
+ createdAt: z64.string(),
20943
+ startedAt: z64.string().nullable(),
20944
+ finishedAt: z64.string().nullable(),
20945
+ error: z64.string().nullable()
20946
+ }).strict();
20947
+ var seoTaskSchema = z64.object({
20948
+ id: z64.string(),
20949
+ capability: seoCapabilitySchema,
20950
+ target: seoTargetSchema.nullable(),
20951
+ status: seoRunStatusSchema,
20952
+ error: z64.string().nullable(),
20953
+ remoteTaskId: z64.string().nullable()
20954
+ }).strict();
20955
+ var seoResultCountsSchema = z64.object({
20956
+ keywordMetrics: z64.number().int().nonnegative(),
20957
+ domainIntelligence: z64.number().int().nonnegative(),
20958
+ rankedKeywords: z64.number().int().nonnegative()
20959
+ }).strict();
20960
+ var seoRunDetailSchema = seoRunSchema.extend({
20961
+ tasks: z64.array(seoTaskSchema),
20962
+ results: seoResultsSchema,
20963
+ resultCounts: seoResultCountsSchema,
20964
+ resultsTruncated: z64.boolean()
20965
+ });
20966
+ var seoRunListSchema = z64.object({ runs: z64.array(seoRunSchema) }).strict();
20967
+ var seoEvidenceQuerySchema = z64.object({
20968
+ profileId: z64.string().optional(),
20969
+ runId: z64.string().optional(),
20970
+ limit: z64.number().int().min(1).max(100).optional(),
20971
+ offset: z64.number().int().min(0).max(1e5).optional()
20972
+ }).strict();
20973
+ var seoPageShape = {
20974
+ runId: z64.string().nullable(),
20975
+ total: z64.number().int().nonnegative(),
20976
+ limit: z64.number().int().min(1).max(100),
20977
+ offset: z64.number().int().nonnegative()
20978
+ };
20979
+ var seoKeywordMetricsListSchema = z64.object({ ...seoPageShape, items: z64.array(seoKeywordMetricsSchema) }).strict();
20980
+ var seoDomainIntelligenceListSchema = z64.object({ ...seoPageShape, items: z64.array(seoDomainIntelligenceSchema) }).strict();
20981
+ var seoRankedKeywordListSchema = z64.object({ ...seoPageShape, items: z64.array(seoRankedKeywordSchema) }).strict();
20982
+ var seoOverviewSchema = z64.object({
20983
+ status: seoStatusSchema,
20984
+ profiles: z64.array(seoProfileSchema),
20985
+ latestRun: seoRunSchema.nullable(),
20986
+ evidenceRunId: z64.string().nullable(),
20987
+ evidenceRun: seoRunSchema.nullable(),
20988
+ summary: z64.object({
20989
+ target: seoTargetSchema,
20990
+ organicKeywords: z64.number().int().nonnegative().nullable(),
20991
+ inTop10: z64.number().int().nonnegative().nullable(),
20992
+ estimatedOrganicTraffic: z64.number().nonnegative().nullable(),
20993
+ provenance: seoProvenanceSchema
20994
+ }).strict().nullable(),
20995
+ keywordMetricsCount: z64.number().int().nonnegative(),
20996
+ domainIntelligenceCount: z64.number().int().nonnegative(),
20997
+ rankedKeywordCount: z64.number().int().nonnegative()
20998
+ }).strict();
20999
+ var seoMicrosSchema = z64.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
21000
+ var seoOperatorTaskSchema = z64.object({
21001
+ id: z64.string(),
21002
+ runId: z64.string(),
21003
+ status: seoRunStatusSchema,
21004
+ reservedCostMicros: seoMicrosSchema,
21005
+ actualCostMicros: seoMicrosSchema.nullable(),
21006
+ receipts: z64.array(z64.object({
21007
+ remoteTaskId: z64.string().nullable(),
21008
+ statusCode: z64.number().int().nullable(),
21009
+ costMicros: seoMicrosSchema.nullable()
21010
+ }).strict())
21011
+ }).strict();
21012
+ var seoReconcileInputSchema = z64.object({
21013
+ actualCostMicros: seoMicrosSchema,
21014
+ remoteTaskId: z64.string().min(1).max(255),
21015
+ outcome: z64.enum(["completed", "failed"]),
21016
+ note: z64.string().trim().min(10).max(2e3)
21017
+ }).strict();
21018
+ var seoReconcileResultSchema = z64.object({ id: z64.string(), status: seoRunStatusSchema }).strict();
21019
+ var seoAdapterOutcomeSchema = z64.enum(["completed", "partial", "failed", "unknown"]);
21020
+ var SeoAdapterOutcomes = seoAdapterOutcomeSchema.enum;
21021
+
21022
+ // ../contracts/src/api-keys.ts
21023
+ import { z as z65 } from "zod";
21024
+ var apiKeyDtoSchema = z65.object({
21025
+ id: z65.string(),
21026
+ name: z65.string(),
20724
21027
  /** First 9 chars of the raw token (`cnry_` + 4 hex). Safe to display. */
20725
- keyPrefix: z64.string(),
20726
- scopes: z64.array(z64.string()),
21028
+ keyPrefix: z65.string(),
21029
+ scopes: z65.array(z65.string()),
20727
21030
  /**
20728
21031
  * The project this key is scoped to, or `null` for a full-instance key. A
20729
21032
  * scoped key may only read/write its own project (enforced server-side).
20730
21033
  */
20731
- projectId: z64.string().nullable(),
21034
+ projectId: z65.string().nullable(),
20732
21035
  /**
20733
21036
  * The scoped project's name, or `null` for a full-instance key. Resolved
20734
21037
  * server-side so a surface listing keys does not have to fetch every project
@@ -20736,89 +21039,89 @@ var apiKeyDtoSchema = z64.object({
20736
21039
  * "is this key safe to hand to someone", which is the question the list is
20737
21040
  * usually open to answer. Additive field.
20738
21041
  */
20739
- projectName: z64.string().nullable(),
21042
+ projectName: z65.string().nullable(),
20740
21043
  /**
20741
21044
  * Server-derived convenience flag: `true` when this key is read-only (carries
20742
21045
  * the `read` scope and no write-granting scope), in which case the API rejects
20743
21046
  * every write HTTP method for it. Derived from `scopes` via `isReadOnlyKey`
20744
21047
  * — surfaces don't recompute it (see the UI/CLI parity rule). Additive field.
20745
21048
  */
20746
- readOnly: z64.boolean(),
21049
+ readOnly: z65.boolean(),
20747
21050
  /** Present on /keys/self: host-derived direct-bearer authority, never a mintable scope. */
20748
- operator: z64.boolean().optional(),
20749
- createdAt: z64.string(),
20750
- lastUsedAt: z64.string().nullable(),
20751
- revokedAt: z64.string().nullable()
21051
+ operator: z65.boolean().optional(),
21052
+ createdAt: z65.string(),
21053
+ lastUsedAt: z65.string().nullable(),
21054
+ revokedAt: z65.string().nullable()
20752
21055
  });
20753
- var apiKeyListDtoSchema = z64.object({
20754
- keys: z64.array(apiKeyDtoSchema)
21056
+ var apiKeyListDtoSchema = z65.object({
21057
+ keys: z65.array(apiKeyDtoSchema)
20755
21058
  });
20756
- var createApiKeyRequestSchema = z64.object({
20757
- name: z64.string().min(1).max(100),
21059
+ var createApiKeyRequestSchema = z65.object({
21060
+ name: z65.string().min(1).max(100),
20758
21061
  /**
20759
21062
  * Scopes granted to the new key. Omit to default to `['*']` (full access,
20760
21063
  * what `canonry init` writes for the root key). When provided it must be a
20761
21064
  * non-empty list — an empty array would mint a key that can do nothing.
20762
21065
  */
20763
- scopes: z64.array(z64.string()).min(1).optional(),
21066
+ scopes: z65.array(z65.string()).min(1).optional(),
20764
21067
  /**
20765
21068
  * Bind the new key to a SINGLE project (by project id). Omit for a
20766
21069
  * full-instance key (the default). A scoped key may only read/write that
20767
21070
  * project; the server validates the id exists at creation time.
20768
21071
  */
20769
- projectId: z64.string().optional()
21072
+ projectId: z65.string().optional()
20770
21073
  });
20771
21074
  var createdApiKeyDtoSchema = apiKeyDtoSchema.extend({
20772
- key: z64.string()
21075
+ key: z65.string()
20773
21076
  });
20774
21077
 
20775
21078
  // ../contracts/src/config-schema.ts
20776
- import { z as z66 } from "zod";
21079
+ import { z as z67 } from "zod";
20777
21080
 
20778
21081
  // ../contracts/src/schedule.ts
20779
- import { z as z65 } from "zod";
20780
- var schedulableRunKindSchema = z65.enum(["answer-visibility", "traffic-sync", "gbp-sync", "data-refresh", "backlinks-sync", "site-audit", "ads-sync", "doctor"]);
21082
+ import { z as z66 } from "zod";
21083
+ var schedulableRunKindSchema = z66.enum(["answer-visibility", "traffic-sync", "gbp-sync", "data-refresh", "backlinks-sync", "site-audit", "ads-sync", "doctor"]);
20781
21084
  var SchedulableRunKinds = schedulableRunKindSchema.enum;
20782
- var calendarRecurrenceSchema = z65.object({
20783
- everyDays: z65.number().int().min(1).max(3650),
20784
- startDate: z65.string().date(),
20785
- time: z65.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/, "Time must be HH:mm")
20786
- }).strict();
20787
- var scheduleDtoSchema = z65.object({
20788
- id: z65.string(),
20789
- projectId: z65.string(),
21085
+ var calendarRecurrenceSchema = z66.object({
21086
+ everyDays: z66.number().int().min(1).max(3650),
21087
+ startDate: z66.string().date(),
21088
+ time: z66.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/, "Time must be HH:mm")
21089
+ }).strict();
21090
+ var scheduleDtoSchema = z66.object({
21091
+ id: z66.string(),
21092
+ projectId: z66.string(),
20790
21093
  /** Run kind dispatched when this schedule fires. Defaults to 'answer-visibility' for legacy rows. */
20791
21094
  kind: schedulableRunKindSchema,
20792
21095
  /** Empty for calendar recurrence schedules. */
20793
- cronExpr: z65.string(),
21096
+ cronExpr: z66.string(),
20794
21097
  recurrence: calendarRecurrenceSchema.nullable().optional(),
20795
- preset: z65.string().nullable().optional(),
20796
- timezone: z65.string().default("UTC"),
20797
- enabled: z65.boolean().default(true),
20798
- providers: z65.array(providerNameSchema).default([]),
21098
+ preset: z66.string().nullable().optional(),
21099
+ timezone: z66.string().default("UTC"),
21100
+ enabled: z66.boolean().default(true),
21101
+ providers: z66.array(providerNameSchema).default([]),
20799
21102
  /** Traffic-source UUID for `kind === 'traffic-sync'` schedules. Null otherwise. */
20800
- sourceId: z65.string().nullable().optional(),
20801
- lastRunAt: z65.string().nullable().optional(),
20802
- nextRunAt: z65.string().nullable().optional(),
20803
- createdAt: z65.string(),
20804
- updatedAt: z65.string()
21103
+ sourceId: z66.string().nullable().optional(),
21104
+ lastRunAt: z66.string().nullable().optional(),
21105
+ nextRunAt: z66.string().nullable().optional(),
21106
+ createdAt: z66.string(),
21107
+ updatedAt: z66.string()
20805
21108
  });
20806
- var scheduleExpectedUpdatedAtSchema = z65.string().datetime();
21109
+ var scheduleExpectedUpdatedAtSchema = z66.string().datetime();
20807
21110
  function nextScheduleUpdatedAt(previous, nowMs = Date.now()) {
20808
21111
  const previousMs = previous === void 0 ? Number.NaN : Date.parse(previous);
20809
21112
  return new Date(Number.isFinite(previousMs) ? Math.max(nowMs, previousMs + 1) : nowMs).toISOString();
20810
21113
  }
20811
- var scheduleUpsertRequestSchema = z65.object({
21114
+ var scheduleUpsertRequestSchema = z66.object({
20812
21115
  /** Run kind. Defaults to 'answer-visibility' so existing callers don't have to change. */
20813
21116
  kind: schedulableRunKindSchema.optional(),
20814
- preset: z65.string().min(1).optional(),
20815
- cron: z65.string().min(1).optional(),
21117
+ preset: z66.string().min(1).optional(),
21118
+ cron: z66.string().min(1).optional(),
20816
21119
  recurrence: calendarRecurrenceSchema.optional(),
20817
- timezone: z65.string().optional().default("UTC"),
20818
- enabled: z65.boolean().optional().default(true),
20819
- providers: z65.array(providerNameSchema).optional().default([]),
21120
+ timezone: z66.string().optional().default("UTC"),
21121
+ enabled: z66.boolean().optional().default(true),
21122
+ providers: z66.array(providerNameSchema).optional().default([]),
20820
21123
  /** Required when kind === 'traffic-sync'. Forbidden for other kinds. Validated server-side. */
20821
- sourceId: z65.string().optional(),
21124
+ sourceId: z66.string().optional(),
20822
21125
  /**
20823
21126
  * Optimistic concurrency guard. A timestamp updates only that exact version;
20824
21127
  * null creates only while the schedule is absent. Omit for legacy behavior.
@@ -20830,18 +21133,18 @@ var scheduleUpsertRequestSchema = z65.object({
20830
21133
  );
20831
21134
 
20832
21135
  // ../contracts/src/config-schema.ts
20833
- var configMetadataSchema = z66.object({
20834
- name: z66.string().min(1).max(63).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/, {
21136
+ var configMetadataSchema = z67.object({
21137
+ name: z67.string().min(1).max(63).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/, {
20835
21138
  message: "Name must be a lowercase slug (letters, numbers, hyphens)"
20836
21139
  }),
20837
- labels: z66.record(z66.string(), z66.string()).optional().default({})
21140
+ labels: z67.record(z67.string(), z67.string()).optional().default({})
20838
21141
  });
20839
- var configScheduleObjectSchema = z66.object({
20840
- preset: z66.string().min(1).optional(),
20841
- cron: z66.string().min(1).optional(),
21142
+ var configScheduleObjectSchema = z67.object({
21143
+ preset: z67.string().min(1).optional(),
21144
+ cron: z67.string().min(1).optional(),
20842
21145
  recurrence: calendarRecurrenceSchema.optional(),
20843
- timezone: z66.string().optional().default("UTC"),
20844
- providers: z66.array(providerNameSchema).optional().default([]),
21146
+ timezone: z67.string().optional().default("UTC"),
21147
+ providers: z67.array(providerNameSchema).optional().default([]),
20845
21148
  /**
20846
21149
  * Whether the schedule fires. Omit to leave an existing schedule's state
20847
21150
  * alone — a schedule paused from the dashboard or the API stays paused
@@ -20849,59 +21152,59 @@ var configScheduleObjectSchema = z66.object({
20849
21152
  * someone deliberately stopped. A schedule created by this apply defaults
20850
21153
  * to enabled.
20851
21154
  */
20852
- enabled: z66.boolean().optional()
21155
+ enabled: z67.boolean().optional()
20853
21156
  });
20854
21157
  function hasOneScheduleTiming(schedule) {
20855
21158
  return [schedule.preset, schedule.cron, schedule.recurrence].filter((value) => value !== void 0).length === 1;
20856
21159
  }
20857
21160
  var oneScheduleTimingMessage = { message: 'Exactly one of "preset", "cron", or "recurrence" must be provided' };
20858
21161
  var configScheduleSchema = configScheduleObjectSchema.refine(hasOneScheduleTiming, oneScheduleTimingMessage).optional();
20859
- var configNotificationSchema = z66.object({
20860
- id: z66.string().min(1).optional(),
20861
- channel: z66.literal("webhook"),
20862
- url: z66.string().url(),
20863
- events: z66.array(notificationEventSchema).min(1)
20864
- });
20865
- var configGoogleSchema = z66.object({
20866
- gsc: z66.object({
20867
- propertyUrl: z66.string()
21162
+ var configNotificationSchema = z67.object({
21163
+ id: z67.string().min(1).optional(),
21164
+ channel: z67.literal("webhook"),
21165
+ url: z67.string().url(),
21166
+ events: z67.array(notificationEventSchema).min(1)
21167
+ });
21168
+ var configGoogleSchema = z67.object({
21169
+ gsc: z67.object({
21170
+ propertyUrl: z67.string()
20868
21171
  }).optional(),
20869
- syncSchedule: z66.object({
20870
- preset: z66.string().optional(),
20871
- cron: z66.string().optional()
21172
+ syncSchedule: z67.object({
21173
+ preset: z67.string().optional(),
21174
+ cron: z67.string().optional()
20872
21175
  }).optional()
20873
21176
  }).optional();
20874
- var configQueryListSchema = z66.array(z66.string().min(1));
21177
+ var configQueryListSchema = z67.array(z67.string().min(1));
20875
21178
  var configSpecShape = {
20876
- displayName: z66.string().min(1),
20877
- canonicalDomain: z66.string().min(1),
20878
- ownedDomains: z66.array(z66.string().min(1)).optional().default([]),
20879
- aliases: z66.array(z66.string().min(1)).optional().default([]),
21179
+ displayName: z67.string().min(1),
21180
+ canonicalDomain: z67.string().min(1),
21181
+ ownedDomains: z67.array(z67.string().min(1)).optional().default([]),
21182
+ aliases: z67.array(z67.string().min(1)).optional().default([]),
20880
21183
  // No default on purpose: an apply that omits it keeps the project's stored
20881
21184
  // list, minus names that no longer qualify against this spec's `aliases`,
20882
21185
  // display name and competitors. Each entry must be an alias.
20883
- qualifiedAliases: z66.array(z66.string().min(1).max(PROJECT_QUALIFIED_ALIAS_MAX_LENGTH)).max(PROJECT_QUALIFIED_ALIAS_LIMIT).optional(),
20884
- country: z66.string().length(2),
20885
- language: z66.string().min(2),
21186
+ qualifiedAliases: z67.array(z67.string().min(1).max(PROJECT_QUALIFIED_ALIAS_MAX_LENGTH)).max(PROJECT_QUALIFIED_ALIAS_LIMIT).optional(),
21187
+ country: z67.string().length(2),
21188
+ language: z67.string().min(2),
20886
21189
  queries: configQueryListSchema.optional(),
20887
21190
  keywords: configQueryListSchema.optional(),
20888
21191
  // Each entry is a bare domain or `{ domain, aliases }`. A bare domain (or an
20889
21192
  // object without `aliases`) keeps that competitor's stored aliases on apply;
20890
21193
  // `aliases` sets them exactly (`[]` clears). The domain set itself is still
20891
21194
  // replaced by this list.
20892
- competitors: z66.array(competitorEntrySchema).optional().default([]),
20893
- providers: z66.array(providerNameSchema).optional().default([]),
21195
+ competitors: z67.array(competitorEntrySchema).optional().default([]),
21196
+ providers: z67.array(providerNameSchema).optional().default([]),
20894
21197
  providerModels: providerModelsSchema.optional().default({}),
20895
21198
  // No default on purpose: an apply that omits it leaves the project's stored
20896
21199
  // preference alone, the same rule as `queries`.
20897
21200
  providerDispatchModes: providerDispatchModesSchema.optional(),
20898
- locations: z66.array(locationContextSchema).optional().default([]),
20899
- defaultLocation: z66.string().optional(),
21201
+ locations: z67.array(locationContextSchema).optional().default([]),
21202
+ defaultLocation: z67.string().optional(),
20900
21203
  measurement: measurementConfigSchema.optional().default(defaultMeasurementConfig),
20901
21204
  schedule: configScheduleSchema,
20902
- notifications: z66.array(configNotificationSchema).optional().default([]),
21205
+ notifications: z67.array(configNotificationSchema).optional().default([]),
20903
21206
  google: configGoogleSchema,
20904
- autoExtractBacklinks: z66.boolean().optional().default(false),
21207
+ autoExtractBacklinks: z67.boolean().optional().default(false),
20905
21208
  /** Highest star rating that counts as a negative Google review (1-4). Omitted means the default of 3. */
20906
21209
  negativeReviewMaxStars: gbpNegativeReviewMaxStarsSchema.optional(),
20907
21210
  /**
@@ -20941,20 +21244,20 @@ function checkConfigSpec(spec, ctx) {
20941
21244
  });
20942
21245
  }
20943
21246
  }
20944
- var configSpecSchema = z66.object(configSpecShape).superRefine(checkConfigSpec);
20945
- var projectConfigSchema = z66.object({
20946
- apiVersion: z66.literal("canonry/v1"),
20947
- kind: z66.literal("Project"),
21247
+ var configSpecSchema = z67.object(configSpecShape).superRefine(checkConfigSpec);
21248
+ var projectConfigSchema = z67.object({
21249
+ apiVersion: z67.literal("canonry/v1"),
21250
+ kind: z67.literal("Project"),
20948
21251
  metadata: configMetadataSchema,
20949
21252
  spec: configSpecSchema
20950
21253
  });
20951
21254
  var projectConfigExportSchema = projectConfigSchema.extend({
20952
- spec: z66.object({
21255
+ spec: z67.object({
20953
21256
  ...configSpecShape,
20954
21257
  queries: configQueryListSchema,
20955
21258
  providerModels: providerModelsSchema.optional(),
20956
- schedule: configScheduleObjectSchema.extend({ enabled: z66.boolean() }).refine(hasOneScheduleTiming, oneScheduleTimingMessage).optional(),
20957
- autoExtractBacklinks: z66.boolean().optional()
21259
+ schedule: configScheduleObjectSchema.extend({ enabled: z67.boolean() }).refine(hasOneScheduleTiming, oneScheduleTimingMessage).optional(),
21260
+ autoExtractBacklinks: z67.boolean().optional()
20958
21261
  }).superRefine(checkConfigSpec)
20959
21262
  });
20960
21263
  function resolveConfigSpecQueries(spec) {
@@ -20962,134 +21265,134 @@ function resolveConfigSpecQueries(spec) {
20962
21265
  }
20963
21266
 
20964
21267
  // ../contracts/src/config-diff.ts
20965
- import { z as z67 } from "zod";
21268
+ import { z as z68 } from "zod";
20966
21269
  function fieldChangeSchema(schema) {
20967
- return z67.object({ before: schema.nullable(), after: schema.nullable() });
20968
- }
20969
- var projectFieldsStateSchema = z67.object({
20970
- displayName: z67.string().optional(),
20971
- canonicalDomain: z67.string().optional(),
20972
- ownedDomains: z67.array(z67.string()).optional(),
20973
- aliases: z67.array(z67.string()).optional(),
20974
- qualifiedAliases: z67.array(z67.string()).optional(),
20975
- country: z67.string().optional(),
20976
- language: z67.string().optional(),
20977
- labels: z67.record(z67.string(), z67.string()).optional(),
20978
- providers: z67.array(z67.string()).optional(),
21270
+ return z68.object({ before: schema.nullable(), after: schema.nullable() });
21271
+ }
21272
+ var projectFieldsStateSchema = z68.object({
21273
+ displayName: z68.string().optional(),
21274
+ canonicalDomain: z68.string().optional(),
21275
+ ownedDomains: z68.array(z68.string()).optional(),
21276
+ aliases: z68.array(z68.string()).optional(),
21277
+ qualifiedAliases: z68.array(z68.string()).optional(),
21278
+ country: z68.string().optional(),
21279
+ language: z68.string().optional(),
21280
+ labels: z68.record(z68.string(), z68.string()).optional(),
21281
+ providers: z68.array(z68.string()).optional(),
20979
21282
  providerModels: providerModelsSchema.optional(),
20980
21283
  providerDispatchModes: providerDispatchModesSchema.optional(),
20981
21284
  "measurement.marketingHosts": measurementConfigSchema.shape.marketingHosts.optional(),
20982
21285
  "measurement.brandTerms": measurementConfigSchema.shape.brandTerms.optional(),
20983
21286
  "measurement.leadEventNames": measurementConfigSchema.shape.leadEventNames.optional(),
20984
- locations: z67.array(locationContextSchema).optional(),
20985
- defaultLocation: z67.string().nullable().optional(),
20986
- autoExtractBacklinks: z67.boolean().optional(),
20987
- negativeReviewMaxStars: z67.number().int().nullable().optional(),
20988
- siteAuditMaxPages: z67.number().int().nullable().optional(),
20989
- competitorAutoAliases: z67.enum(["off", "preview", "apply"]).optional(),
21287
+ locations: z68.array(locationContextSchema).optional(),
21288
+ defaultLocation: z68.string().nullable().optional(),
21289
+ autoExtractBacklinks: z68.boolean().optional(),
21290
+ negativeReviewMaxStars: z68.number().int().nullable().optional(),
21291
+ siteAuditMaxPages: z68.number().int().nullable().optional(),
21292
+ competitorAutoAliases: z68.enum(["off", "preview", "apply"]).optional(),
20990
21293
  configSource: configSourceSchema.optional()
20991
21294
  }).strict();
20992
- var projectFieldsChangeSchema = z67.object({
20993
- displayName: fieldChangeSchema(z67.string()).optional(),
20994
- canonicalDomain: fieldChangeSchema(z67.string()).optional(),
20995
- ownedDomains: fieldChangeSchema(z67.array(z67.string())).optional(),
20996
- aliases: fieldChangeSchema(z67.array(z67.string())).optional(),
20997
- qualifiedAliases: fieldChangeSchema(z67.array(z67.string())).optional(),
20998
- country: fieldChangeSchema(z67.string()).optional(),
20999
- language: fieldChangeSchema(z67.string()).optional(),
21000
- labels: fieldChangeSchema(z67.record(z67.string(), z67.string())).optional(),
21001
- providers: fieldChangeSchema(z67.array(z67.string())).optional(),
21295
+ var projectFieldsChangeSchema = z68.object({
21296
+ displayName: fieldChangeSchema(z68.string()).optional(),
21297
+ canonicalDomain: fieldChangeSchema(z68.string()).optional(),
21298
+ ownedDomains: fieldChangeSchema(z68.array(z68.string())).optional(),
21299
+ aliases: fieldChangeSchema(z68.array(z68.string())).optional(),
21300
+ qualifiedAliases: fieldChangeSchema(z68.array(z68.string())).optional(),
21301
+ country: fieldChangeSchema(z68.string()).optional(),
21302
+ language: fieldChangeSchema(z68.string()).optional(),
21303
+ labels: fieldChangeSchema(z68.record(z68.string(), z68.string())).optional(),
21304
+ providers: fieldChangeSchema(z68.array(z68.string())).optional(),
21002
21305
  providerModels: fieldChangeSchema(providerModelsSchema).optional(),
21003
21306
  providerDispatchModes: fieldChangeSchema(providerDispatchModesSchema).optional(),
21004
21307
  "measurement.marketingHosts": fieldChangeSchema(measurementConfigSchema.shape.marketingHosts).optional(),
21005
21308
  "measurement.brandTerms": fieldChangeSchema(measurementConfigSchema.shape.brandTerms).optional(),
21006
21309
  "measurement.leadEventNames": fieldChangeSchema(measurementConfigSchema.shape.leadEventNames).optional(),
21007
- locations: fieldChangeSchema(z67.array(locationContextSchema)).optional(),
21008
- defaultLocation: fieldChangeSchema(z67.string()).optional(),
21009
- autoExtractBacklinks: fieldChangeSchema(z67.boolean()).optional(),
21010
- negativeReviewMaxStars: fieldChangeSchema(z67.number().int()).optional(),
21011
- siteAuditMaxPages: fieldChangeSchema(z67.number().int().nullable()).optional(),
21012
- competitorAutoAliases: fieldChangeSchema(z67.enum(["off", "preview", "apply"])).optional(),
21310
+ locations: fieldChangeSchema(z68.array(locationContextSchema)).optional(),
21311
+ defaultLocation: fieldChangeSchema(z68.string()).optional(),
21312
+ autoExtractBacklinks: fieldChangeSchema(z68.boolean()).optional(),
21313
+ negativeReviewMaxStars: fieldChangeSchema(z68.number().int()).optional(),
21314
+ siteAuditMaxPages: fieldChangeSchema(z68.number().int().nullable()).optional(),
21315
+ competitorAutoAliases: fieldChangeSchema(z68.enum(["off", "preview", "apply"])).optional(),
21013
21316
  configSource: fieldChangeSchema(configSourceSchema).optional()
21014
21317
  }).strict();
21015
- var scheduleStateSchema = z67.object({
21016
- cron: z67.string().optional(),
21017
- preset: z67.string().optional(),
21318
+ var scheduleStateSchema = z68.object({
21319
+ cron: z68.string().optional(),
21320
+ preset: z68.string().optional(),
21018
21321
  recurrence: calendarRecurrenceSchema.optional(),
21019
- timezone: z67.string(),
21020
- providers: z67.array(z67.string()),
21021
- enabled: z67.boolean()
21022
- }).strict();
21023
- var droppedAliasSchema = z67.object({
21024
- domain: z67.string(),
21025
- alias: z67.string(),
21026
- reason: z67.enum(["too-long", "too-short", "project-brand", "other-competitor", "market-competitor", "claimed-by-alias"]),
21027
- conflictsWith: z67.string().optional(),
21028
- conflictingName: z67.string().optional(),
21029
- markets: z67.array(z67.string()).optional()
21030
- }).strict();
21031
- var configStateNotificationSchema = z67.object({
21032
- id: z67.string(),
21033
- url: z67.string().optional(),
21034
- urlHost: z67.string(),
21035
- events: z67.array(z67.string()),
21036
- enabled: z67.boolean(),
21037
- source: z67.string().optional()
21038
- });
21039
- var projectConfigStateSchema = z67.object({
21040
- project: z67.object({ id: z67.string(), name: z67.string() }),
21041
- configRevision: z67.number().int(),
21322
+ timezone: z68.string(),
21323
+ providers: z68.array(z68.string()),
21324
+ enabled: z68.boolean()
21325
+ }).strict();
21326
+ var droppedAliasSchema = z68.object({
21327
+ domain: z68.string(),
21328
+ alias: z68.string(),
21329
+ reason: z68.enum(["too-long", "too-short", "project-brand", "other-competitor", "market-competitor", "claimed-by-alias"]),
21330
+ conflictsWith: z68.string().optional(),
21331
+ conflictingName: z68.string().optional(),
21332
+ markets: z68.array(z68.string()).optional()
21333
+ }).strict();
21334
+ var configStateNotificationSchema = z68.object({
21335
+ id: z68.string(),
21336
+ url: z68.string().optional(),
21337
+ urlHost: z68.string(),
21338
+ events: z68.array(z68.string()),
21339
+ enabled: z68.boolean(),
21340
+ source: z68.string().optional()
21341
+ });
21342
+ var projectConfigStateSchema = z68.object({
21343
+ project: z68.object({ id: z68.string(), name: z68.string() }),
21344
+ configRevision: z68.number().int(),
21042
21345
  fields: projectFieldsStateSchema,
21043
- queries: z67.array(z67.object({ id: z67.string(), text: z67.string() })),
21044
- competitors: z67.array(z67.object({ id: z67.string(), domain: z67.string(), aliases: z67.array(z67.string()) })),
21346
+ queries: z68.array(z68.object({ id: z68.string(), text: z68.string() })),
21347
+ competitors: z68.array(z68.object({ id: z68.string(), domain: z68.string(), aliases: z68.array(z68.string()) })),
21045
21348
  schedule: scheduleStateSchema.nullable(),
21046
- notifications: z67.array(configStateNotificationSchema),
21047
- managed: z67.object({ queries: z67.boolean(), competitors: z67.boolean(), schedule: z67.boolean(), notifications: z67.boolean() }),
21048
- detachedSnapshotCount: z67.number().int().nonnegative()
21049
- });
21050
- var notificationAddedSchema = z67.object({ urlHost: z67.string(), events: z67.array(z67.string()) });
21051
- var notificationRemovedSchema = notificationAddedSchema.extend({ id: z67.string() });
21052
- var notificationKeptSchema = z67.object({
21053
- id: z67.string(),
21054
- urlHost: z67.string(),
21055
- urlChanged: z67.boolean(),
21056
- eventsBefore: z67.array(z67.string()),
21057
- eventsAfter: z67.array(z67.string())
21058
- });
21059
- var applyPreviewDtoSchema = z67.object({
21060
- project: z67.object({ id: z67.string().nullable(), name: z67.string() }),
21061
- action: z67.enum(["create", "update", "none"]),
21062
- changed: z67.boolean(),
21063
- configRevision: z67.object({ before: z67.number().int().nullable(), after: z67.number().int() }),
21349
+ notifications: z68.array(configStateNotificationSchema),
21350
+ managed: z68.object({ queries: z68.boolean(), competitors: z68.boolean(), schedule: z68.boolean(), notifications: z68.boolean() }),
21351
+ detachedSnapshotCount: z68.number().int().nonnegative()
21352
+ });
21353
+ var notificationAddedSchema = z68.object({ urlHost: z68.string(), events: z68.array(z68.string()) });
21354
+ var notificationRemovedSchema = notificationAddedSchema.extend({ id: z68.string() });
21355
+ var notificationKeptSchema = z68.object({
21356
+ id: z68.string(),
21357
+ urlHost: z68.string(),
21358
+ urlChanged: z68.boolean(),
21359
+ eventsBefore: z68.array(z68.string()),
21360
+ eventsAfter: z68.array(z68.string())
21361
+ });
21362
+ var applyPreviewDtoSchema = z68.object({
21363
+ project: z68.object({ id: z68.string().nullable(), name: z68.string() }),
21364
+ action: z68.enum(["create", "update", "none"]),
21365
+ changed: z68.boolean(),
21366
+ configRevision: z68.object({ before: z68.number().int().nullable(), after: z68.number().int() }),
21064
21367
  fields: projectFieldsChangeSchema,
21065
- queries: z67.object({
21066
- managed: z67.boolean(),
21067
- added: z67.array(z67.string()),
21068
- removed: z67.array(z67.string()),
21069
- unchangedCount: z67.number().int().nonnegative(),
21070
- snapshotsDetached: z67.number().int().nonnegative()
21368
+ queries: z68.object({
21369
+ managed: z68.boolean(),
21370
+ added: z68.array(z68.string()),
21371
+ removed: z68.array(z68.string()),
21372
+ unchangedCount: z68.number().int().nonnegative(),
21373
+ snapshotsDetached: z68.number().int().nonnegative()
21071
21374
  }),
21072
- competitors: z67.object({
21073
- managed: z67.boolean(),
21074
- added: z67.array(z67.string()),
21075
- removed: z67.array(z67.string()),
21076
- aliasChanges: z67.array(z67.object({ domain: z67.string(), before: z67.array(z67.string()), after: z67.array(z67.string()) })),
21077
- droppedAliases: z67.array(droppedAliasSchema)
21375
+ competitors: z68.object({
21376
+ managed: z68.boolean(),
21377
+ added: z68.array(z68.string()),
21378
+ removed: z68.array(z68.string()),
21379
+ aliasChanges: z68.array(z68.object({ domain: z68.string(), before: z68.array(z68.string()), after: z68.array(z68.string()) })),
21380
+ droppedAliases: z68.array(droppedAliasSchema)
21078
21381
  }),
21079
- schedule: z67.object({
21080
- managed: z67.boolean(),
21081
- action: z67.enum(["create", "update", "delete", "none"]),
21382
+ schedule: z68.object({
21383
+ managed: z68.boolean(),
21384
+ action: z68.enum(["create", "update", "delete", "none"]),
21082
21385
  before: scheduleStateSchema.nullable(),
21083
21386
  after: scheduleStateSchema.nullable()
21084
21387
  }),
21085
- notifications: z67.object({
21086
- managed: z67.boolean(),
21087
- added: z67.array(notificationAddedSchema),
21088
- removed: z67.array(notificationRemovedSchema),
21089
- kept: z67.array(notificationKeptSchema),
21090
- secretsRotated: z67.number().int().nonnegative()
21388
+ notifications: z68.object({
21389
+ managed: z68.boolean(),
21390
+ added: z68.array(notificationAddedSchema),
21391
+ removed: z68.array(notificationRemovedSchema),
21392
+ kept: z68.array(notificationKeptSchema),
21393
+ secretsRotated: z68.number().int().nonnegative()
21091
21394
  }),
21092
- effects: z67.array(z67.enum([
21395
+ effects: z68.array(z68.enum([
21093
21396
  "mention-backfill",
21094
21397
  "competitor-rescore",
21095
21398
  "competitor-auto-alias-rescan",
@@ -21201,46 +21504,46 @@ function diffProjectConfigState(before, after, options = {}) {
21201
21504
  }
21202
21505
 
21203
21506
  // ../contracts/src/simple-measurement-definition.ts
21204
- import { z as z68 } from "zod";
21507
+ import { z as z69 } from "zod";
21205
21508
  var SIMPLE_MEASUREMENT_DEFINITION_SCHEMA_VERSION = 1;
21206
- var nonBlankStringSchema = z68.string().refine((value) => value.trim().length > 0, {
21509
+ var nonBlankStringSchema = z69.string().refine((value) => value.trim().length > 0, {
21207
21510
  message: "Must not be blank"
21208
21511
  });
21209
- var simpleMeasurementIdentitySchema = z68.object({
21512
+ var simpleMeasurementIdentitySchema = z69.object({
21210
21513
  // These fields intentionally preserve their stored presentation. The shared
21211
21514
  // matcher derives its normalized form separately when classifying queries.
21212
- displayName: z68.string(),
21213
- aliases: z68.array(z68.string()),
21214
- canonicalDomain: z68.string(),
21215
- ownedDomains: z68.array(z68.string()),
21515
+ displayName: z69.string(),
21516
+ aliases: z69.array(z69.string()),
21517
+ canonicalDomain: z69.string(),
21518
+ ownedDomains: z69.array(z69.string()),
21216
21519
  // Sentiment-only: the aliases the evaluator is told are this brand's own
21217
21520
  // names. Omitted when empty, so a sidecar that never opted in keeps its
21218
21521
  // checksum. No bounds or matcher rules here: a later change to the write
21219
21522
  // rules must never make a stored sidecar unreadable.
21220
- qualifiedAliases: z68.array(z68.string()).optional()
21523
+ qualifiedAliases: z69.array(z69.string()).optional()
21221
21524
  }).strict();
21222
- var simpleMeasurementEngineSchema = z68.object({
21525
+ var simpleMeasurementEngineSchema = z69.object({
21223
21526
  provider: providerNameSchema.refine((value) => value.trim().length > 0, {
21224
21527
  message: "Provider must not be blank"
21225
21528
  }),
21226
21529
  // Preserve the requested model exactly; null does not claim a served model.
21227
21530
  // A legacy empty value can resolve to an adapter default.
21228
- requestedModel: z68.string().nullable()
21531
+ requestedModel: z69.string().nullable()
21229
21532
  }).strict();
21230
- var simpleMeasurementCompetitorSchema = z68.object({
21533
+ var simpleMeasurementCompetitorSchema = z69.object({
21231
21534
  // This is a snapshot of legacy dispatch inputs, not a competitor write API.
21232
21535
  // Stored identifiers may be labels, URLs, or blank. Preserve them exactly;
21233
21536
  // readers derive hostname attribution separately when the value supports it.
21234
- domain: z68.string(),
21235
- label: z68.string(),
21236
- aliases: z68.array(z68.string())
21537
+ domain: z69.string(),
21538
+ label: z69.string(),
21539
+ aliases: z69.array(z69.string())
21237
21540
  }).strict();
21238
- var simpleMeasurementQueryInputSchema = z68.object({
21541
+ var simpleMeasurementQueryInputSchema = z69.object({
21239
21542
  queryId: nonBlankStringSchema,
21240
21543
  // The legacy runner can dispatch a stored empty query. Preserve that exact
21241
21544
  // selected input rather than making first capture change its behavior.
21242
- queryText: z68.string(),
21243
- provenance: z68.string().nullable()
21545
+ queryText: z69.string(),
21546
+ provenance: z69.string().nullable()
21244
21547
  }).strict();
21245
21548
  var simpleMeasurementQuerySchema = simpleMeasurementQueryInputSchema.extend({
21246
21549
  queryClass: queryClassSchema.nullable()
@@ -21251,7 +21554,7 @@ function addCollectionIssues(value, ctx) {
21251
21554
  const key = engine.provider.trim().toLocaleLowerCase("en");
21252
21555
  if (engineProviders.has(key)) {
21253
21556
  ctx.addIssue({
21254
- code: z68.ZodIssueCode.custom,
21557
+ code: z69.ZodIssueCode.custom,
21255
21558
  path: ["engines", index, "provider"],
21256
21559
  message: `Duplicate engine provider "${engine.provider}"`
21257
21560
  });
@@ -21262,7 +21565,7 @@ function addCollectionIssues(value, ctx) {
21262
21565
  value.queries.forEach((query, index) => {
21263
21566
  if (queryIds.has(query.queryId)) {
21264
21567
  ctx.addIssue({
21265
- code: z68.ZodIssueCode.custom,
21568
+ code: z69.ZodIssueCode.custom,
21266
21569
  path: ["queries", index, "queryId"],
21267
21570
  message: `Duplicate query id "${query.queryId}"`
21268
21571
  });
@@ -21274,7 +21577,7 @@ function addCollectionIssues(value, ctx) {
21274
21577
  const key = competitor.domain;
21275
21578
  if (competitorDomains.has(key)) {
21276
21579
  ctx.addIssue({
21277
- code: z68.ZodIssueCode.custom,
21580
+ code: z69.ZodIssueCode.custom,
21278
21581
  path: ["competitors", index, "domain"],
21279
21582
  message: `Duplicate competitor domain "${competitor.domain}"`
21280
21583
  });
@@ -21282,28 +21585,28 @@ function addCollectionIssues(value, ctx) {
21282
21585
  competitorDomains.add(key);
21283
21586
  });
21284
21587
  }
21285
- var simpleMeasurementDefinitionInputSchema = z68.object({
21286
- capturedAt: z68.string().datetime(),
21588
+ var simpleMeasurementDefinitionInputSchema = z69.object({
21589
+ capturedAt: z69.string().datetime(),
21287
21590
  identity: simpleMeasurementIdentitySchema,
21288
- country: z68.string(),
21289
- language: z68.string(),
21591
+ country: z69.string(),
21592
+ language: z69.string(),
21290
21593
  location: locationContextSchema.nullable(),
21291
- engines: z68.array(simpleMeasurementEngineSchema).min(1),
21594
+ engines: z69.array(simpleMeasurementEngineSchema).min(1),
21292
21595
  /** Missing on historical sidecars; an empty array means the captured set was intentionally empty. */
21293
- competitors: z68.array(simpleMeasurementCompetitorSchema).optional(),
21294
- queries: z68.array(simpleMeasurementQueryInputSchema)
21596
+ competitors: z69.array(simpleMeasurementCompetitorSchema).optional(),
21597
+ queries: z69.array(simpleMeasurementQueryInputSchema)
21295
21598
  }).strict().superRefine(addCollectionIssues);
21296
- var simpleMeasurementDefinitionSchema = z68.object({
21297
- schemaVersion: z68.literal(SIMPLE_MEASUREMENT_DEFINITION_SCHEMA_VERSION),
21298
- capturedAt: z68.string().datetime(),
21599
+ var simpleMeasurementDefinitionSchema = z69.object({
21600
+ schemaVersion: z69.literal(SIMPLE_MEASUREMENT_DEFINITION_SCHEMA_VERSION),
21601
+ capturedAt: z69.string().datetime(),
21299
21602
  identity: simpleMeasurementIdentitySchema,
21300
- country: z68.string(),
21301
- language: z68.string(),
21603
+ country: z69.string(),
21604
+ language: z69.string(),
21302
21605
  // Requested adapter input, not proof that the provider applied this context.
21303
21606
  location: locationContextSchema.nullable(),
21304
- engines: z68.array(simpleMeasurementEngineSchema).min(1),
21305
- competitors: z68.array(simpleMeasurementCompetitorSchema).optional(),
21306
- queries: z68.array(simpleMeasurementQuerySchema)
21607
+ engines: z69.array(simpleMeasurementEngineSchema).min(1),
21608
+ competitors: z69.array(simpleMeasurementCompetitorSchema).optional(),
21609
+ queries: z69.array(simpleMeasurementQuerySchema)
21307
21610
  }).strict().superRefine(addCollectionIssues);
21308
21611
  function simpleMeasurementCompetitorNames(competitors) {
21309
21612
  return competitors?.flatMap((competitor) => [competitor.label, ...competitor.aliases]) ?? [];
@@ -21396,21 +21699,21 @@ function canonicalSimpleMeasurementDefinitionJson(definition) {
21396
21699
  }
21397
21700
 
21398
21701
  // ../contracts/src/measurement-group-import.ts
21399
- import { z as z69 } from "zod";
21702
+ import { z as z70 } from "zod";
21400
21703
  var MEASUREMENT_GROUP_MEMBERSHIP_CSV_PARSER_VERSION = "canonry.measurement-group-membership-csv/v1";
21401
21704
  var MEASUREMENT_GROUP_MEMBERSHIP_CSV_MAX_BYTES = 1048576;
21402
21705
  var MEASUREMENT_GROUP_MEMBERSHIP_CSV_MAX_DATA_ROWS = 5e3;
21403
- var sha256HexSchema4 = z69.string().regex(/^[a-f0-9]{64}$/);
21404
- var dataRowNumberSchema = z69.number().int().positive();
21405
- var measurementDraftSegmentDescriptorSchema = z69.object({
21706
+ var sha256HexSchema4 = z70.string().regex(/^[a-f0-9]{64}$/);
21707
+ var dataRowNumberSchema = z70.number().int().positive();
21708
+ var measurementDraftSegmentDescriptorSchema = z70.object({
21406
21709
  stableKey: measurementV2StableKeySchema,
21407
- kind: z69.enum(["target", "group"]),
21408
- retiredAt: z69.string().datetime().nullable()
21710
+ kind: z70.enum(["target", "group"]),
21711
+ retiredAt: z70.string().datetime().nullable()
21409
21712
  }).strict();
21410
- var measurementDraftPreviewGroupMembershipRequestSchema = z69.object({
21411
- csv: z69.string()
21713
+ var measurementDraftPreviewGroupMembershipRequestSchema = z70.object({
21714
+ csv: z70.string()
21412
21715
  }).strict();
21413
- var measurementDraftGroupMembershipRowStatusSchema = z69.enum([
21716
+ var measurementDraftGroupMembershipRowStatusSchema = z70.enum([
21414
21717
  "matched",
21415
21718
  "ambiguous",
21416
21719
  "unmatched",
@@ -21419,7 +21722,7 @@ var measurementDraftGroupMembershipRowStatusSchema = z69.enum([
21419
21722
  "proposed",
21420
21723
  "excluded"
21421
21724
  ]);
21422
- var measurementDraftGroupMembershipRowReasonSchema = z69.enum([
21725
+ var measurementDraftGroupMembershipRowReasonSchema = z70.enum([
21423
21726
  "column-count",
21424
21727
  "missing-property",
21425
21728
  "missing-group",
@@ -21432,103 +21735,103 @@ var measurementDraftGroupMembershipRowReasonSchema = z69.enum([
21432
21735
  "group-label-ambiguous",
21433
21736
  "group-key-conflict"
21434
21737
  ]);
21435
- var rowSourceSchema = z69.object({
21738
+ var rowSourceSchema = z70.object({
21436
21739
  /** One-based logical record number after the CSV header, not a physical line number. */
21437
21740
  dataRow: dataRowNumberSchema,
21438
- property: z69.string(),
21439
- group: z69.string(),
21440
- url: z69.string().nullable(),
21441
- normalizedProperty: z69.string(),
21442
- normalizedGroupLabel: z69.string()
21741
+ property: z70.string(),
21742
+ group: z70.string(),
21743
+ url: z70.string().nullable(),
21744
+ normalizedProperty: z70.string(),
21745
+ normalizedGroupLabel: z70.string()
21443
21746
  }).strict();
21444
21747
  var rowFailureSchema = rowSourceSchema.extend({
21445
21748
  reason: measurementDraftGroupMembershipRowReasonSchema
21446
21749
  });
21447
- var measurementDraftGroupKeyConflictEvidenceSchema = z69.object({
21448
- source: z69.enum(["draft-target", "draft-group", "persisted-segment", "retired-segment", "proposed-group"]),
21750
+ var measurementDraftGroupKeyConflictEvidenceSchema = z70.object({
21751
+ source: z70.enum(["draft-target", "draft-group", "persisted-segment", "retired-segment", "proposed-group"]),
21449
21752
  stableKey: measurementV2StableKeySchema,
21450
- kind: z69.enum(["target", "group"]).optional(),
21451
- retiredAt: z69.string().datetime().nullable().optional(),
21452
- normalizedGroupLabel: z69.string().optional()
21753
+ kind: z70.enum(["target", "group"]).optional(),
21754
+ retiredAt: z70.string().datetime().nullable().optional(),
21755
+ normalizedGroupLabel: z70.string().optional()
21453
21756
  }).strict();
21454
- var measurementDraftGroupKeyConflictSchema = z69.object({
21757
+ var measurementDraftGroupKeyConflictSchema = z70.object({
21455
21758
  proposedGroupKey: measurementV2StableKeySchema,
21456
- evidence: z69.array(measurementDraftGroupKeyConflictEvidenceSchema).min(1)
21759
+ evidence: z70.array(measurementDraftGroupKeyConflictEvidenceSchema).min(1)
21457
21760
  }).strict();
21458
- var measurementDraftGroupMembershipRowSchema = z69.discriminatedUnion("status", [
21761
+ var measurementDraftGroupMembershipRowSchema = z70.discriminatedUnion("status", [
21459
21762
  rowSourceSchema.extend({
21460
- status: z69.literal("matched"),
21763
+ status: z70.literal("matched"),
21461
21764
  targetKey: measurementV2StableKeySchema,
21462
21765
  groupKey: measurementV2StableKeySchema
21463
21766
  }).strict(),
21464
21767
  rowFailureSchema.extend({
21465
- status: z69.literal("ambiguous"),
21466
- candidateTargetKeys: z69.array(measurementV2StableKeySchema).min(1).optional(),
21467
- candidateGroupKeys: z69.array(measurementV2StableKeySchema).min(1).optional()
21768
+ status: z70.literal("ambiguous"),
21769
+ candidateTargetKeys: z70.array(measurementV2StableKeySchema).min(1).optional(),
21770
+ candidateGroupKeys: z70.array(measurementV2StableKeySchema).min(1).optional()
21468
21771
  }).strict(),
21469
21772
  rowFailureSchema.extend({
21470
- status: z69.literal("unmatched")
21773
+ status: z70.literal("unmatched")
21471
21774
  }).strict(),
21472
21775
  rowFailureSchema.extend({
21473
- status: z69.literal("invalid"),
21776
+ status: z70.literal("invalid"),
21474
21777
  groupKeyConflict: measurementDraftGroupKeyConflictSchema.optional()
21475
21778
  }).strict(),
21476
21779
  rowSourceSchema.extend({
21477
- status: z69.literal("duplicate"),
21780
+ status: z70.literal("duplicate"),
21478
21781
  duplicateOfRow: dataRowNumberSchema,
21479
21782
  targetKey: measurementV2StableKeySchema,
21480
21783
  groupKey: measurementV2StableKeySchema
21481
21784
  }).strict(),
21482
21785
  rowFailureSchema.extend({
21483
- status: z69.literal("proposed"),
21786
+ status: z70.literal("proposed"),
21484
21787
  targetKey: measurementV2StableKeySchema
21485
21788
  }).strict(),
21486
21789
  rowFailureSchema.extend({
21487
- status: z69.literal("excluded"),
21790
+ status: z70.literal("excluded"),
21488
21791
  targetKey: measurementV2StableKeySchema
21489
21792
  }).strict()
21490
21793
  ]);
21491
- var measurementDraftGroupMembershipChangeSchema = z69.object({
21492
- normalizedGroupLabel: z69.string(),
21794
+ var measurementDraftGroupMembershipChangeSchema = z70.object({
21795
+ normalizedGroupLabel: z70.string(),
21493
21796
  groupKey: measurementV2StableKeySchema,
21494
- label: z69.string().trim().min(1),
21495
- action: z69.enum(["create", "extend"]),
21496
- matchedRows: z69.array(dataRowNumberSchema),
21497
- targetKeys: z69.array(measurementV2StableKeySchema),
21498
- addedTargetKeys: z69.array(measurementV2StableKeySchema),
21499
- unchangedTargetKeys: z69.array(measurementV2StableKeySchema)
21500
- }).strict();
21501
- var measurementDraftGroupMembershipImportCountsSchema = z69.object({
21502
- dataRows: z69.number().int().nonnegative(),
21503
- matchedRows: z69.number().int().nonnegative(),
21504
- ambiguousRows: z69.number().int().nonnegative(),
21505
- unmatchedRows: z69.number().int().nonnegative(),
21506
- invalidRows: z69.number().int().nonnegative(),
21507
- duplicateRows: z69.number().int().nonnegative(),
21508
- proposedRows: z69.number().int().nonnegative(),
21509
- excludedRows: z69.number().int().nonnegative(),
21797
+ label: z70.string().trim().min(1),
21798
+ action: z70.enum(["create", "extend"]),
21799
+ matchedRows: z70.array(dataRowNumberSchema),
21800
+ targetKeys: z70.array(measurementV2StableKeySchema),
21801
+ addedTargetKeys: z70.array(measurementV2StableKeySchema),
21802
+ unchangedTargetKeys: z70.array(measurementV2StableKeySchema)
21803
+ }).strict();
21804
+ var measurementDraftGroupMembershipImportCountsSchema = z70.object({
21805
+ dataRows: z70.number().int().nonnegative(),
21806
+ matchedRows: z70.number().int().nonnegative(),
21807
+ ambiguousRows: z70.number().int().nonnegative(),
21808
+ unmatchedRows: z70.number().int().nonnegative(),
21809
+ invalidRows: z70.number().int().nonnegative(),
21810
+ duplicateRows: z70.number().int().nonnegative(),
21811
+ proposedRows: z70.number().int().nonnegative(),
21812
+ excludedRows: z70.number().int().nonnegative(),
21510
21813
  /** Rows that cannot be committed without correcting the draft or source. */
21511
- needsAttention: z69.number().int().nonnegative(),
21512
- groupsReady: z69.number().int().nonnegative(),
21513
- groupsToCreate: z69.number().int().nonnegative(),
21514
- groupsToExtend: z69.number().int().nonnegative(),
21515
- membershipsReady: z69.number().int().nonnegative(),
21516
- addedMemberships: z69.number().int().nonnegative(),
21517
- unchangedMemberships: z69.number().int().nonnegative()
21518
- }).strict();
21519
- var measurementDraftPreviewGroupMembershipResponseSchema = z69.object({
21520
- draftEtag: z69.string().trim().min(1),
21814
+ needsAttention: z70.number().int().nonnegative(),
21815
+ groupsReady: z70.number().int().nonnegative(),
21816
+ groupsToCreate: z70.number().int().nonnegative(),
21817
+ groupsToExtend: z70.number().int().nonnegative(),
21818
+ membershipsReady: z70.number().int().nonnegative(),
21819
+ addedMemberships: z70.number().int().nonnegative(),
21820
+ unchangedMemberships: z70.number().int().nonnegative()
21821
+ }).strict();
21822
+ var measurementDraftPreviewGroupMembershipResponseSchema = z70.object({
21823
+ draftEtag: z70.string().trim().min(1),
21521
21824
  sourceChecksum: sha256HexSchema4,
21522
21825
  previewChecksum: sha256HexSchema4,
21523
- rows: z69.array(measurementDraftGroupMembershipRowSchema),
21524
- groupChanges: z69.array(measurementDraftGroupMembershipChangeSchema),
21826
+ rows: z70.array(measurementDraftGroupMembershipRowSchema),
21827
+ groupChanges: z70.array(measurementDraftGroupMembershipChangeSchema),
21525
21828
  counts: measurementDraftGroupMembershipImportCountsSchema
21526
21829
  }).strict();
21527
- var measurementDraftApplyGroupMembershipRequestSchema = z69.object({
21528
- csv: z69.string(),
21830
+ var measurementDraftApplyGroupMembershipRequestSchema = z70.object({
21831
+ csv: z70.string(),
21529
21832
  sourceChecksum: sha256HexSchema4,
21530
21833
  previewChecksum: sha256HexSchema4,
21531
- acceptedRows: z69.array(dataRowNumberSchema).min(1)
21834
+ acceptedRows: z70.array(dataRowNumberSchema).min(1)
21532
21835
  }).strict().superRefine((value, context) => {
21533
21836
  if (new Set(value.acceptedRows).size === value.acceptedRows.length) return;
21534
21837
  context.addIssue({
@@ -21539,9 +21842,9 @@ var measurementDraftApplyGroupMembershipRequestSchema = z69.object({
21539
21842
  });
21540
21843
  var measurementDraftApplyGroupMembershipResponseSchema = measurementDraftMutationResponseSchema.extend({
21541
21844
  /** Accepted matched CSV records, including records whose membership was already present. */
21542
- appliedRows: z69.number().int().nonnegative(),
21543
- addedMemberships: z69.number().int().nonnegative(),
21544
- unchangedMemberships: z69.number().int().nonnegative()
21845
+ appliedRows: z70.number().int().nonnegative(),
21846
+ addedMemberships: z70.number().int().nonnegative(),
21847
+ unchangedMemberships: z70.number().int().nonnegative()
21545
21848
  }).strict();
21546
21849
 
21547
21850
  // ../contracts/src/measurement-target-names.ts
@@ -21596,44 +21899,44 @@ function measurementTargetNameIssueMessage(issue) {
21596
21899
  }
21597
21900
 
21598
21901
  // ../contracts/src/google.ts
21599
- import { z as z70 } from "zod";
21600
- var googleConnectionTypeSchema = z70.enum(["gsc", "ga4", "gbp"]);
21601
- var googleConnectionDtoSchema = z70.object({
21602
- id: z70.string(),
21603
- domain: z70.string(),
21902
+ import { z as z71 } from "zod";
21903
+ var googleConnectionTypeSchema = z71.enum(["gsc", "ga4", "gbp"]);
21904
+ var googleConnectionDtoSchema = z71.object({
21905
+ id: z71.string(),
21906
+ domain: z71.string(),
21604
21907
  connectionType: googleConnectionTypeSchema,
21605
- propertyId: z70.string().nullable().optional(),
21606
- sitemapUrl: z70.string().nullable().optional(),
21607
- scopes: z70.array(z70.string()).default([]),
21608
- createdAt: z70.string(),
21609
- updatedAt: z70.string()
21610
- });
21611
- var googleOAuthStartResponseSchema = z70.object({
21612
- authUrl: z70.string().url(),
21613
- redirectUri: z70.string().url()
21614
- }).strict();
21615
- var gscSearchDataDtoSchema = z70.object({
21616
- date: z70.string(),
21617
- query: z70.string(),
21618
- page: z70.string(),
21619
- country: z70.string().nullable().optional(),
21620
- device: z70.string().nullable().optional(),
21621
- clicks: z70.number(),
21622
- impressions: z70.number(),
21908
+ propertyId: z71.string().nullable().optional(),
21909
+ sitemapUrl: z71.string().nullable().optional(),
21910
+ scopes: z71.array(z71.string()).default([]),
21911
+ createdAt: z71.string(),
21912
+ updatedAt: z71.string()
21913
+ });
21914
+ var googleOAuthStartResponseSchema = z71.object({
21915
+ authUrl: z71.string().url(),
21916
+ redirectUri: z71.string().url()
21917
+ }).strict();
21918
+ var gscSearchDataDtoSchema = z71.object({
21919
+ date: z71.string(),
21920
+ query: z71.string(),
21921
+ page: z71.string(),
21922
+ country: z71.string().nullable().optional(),
21923
+ device: z71.string().nullable().optional(),
21924
+ clicks: z71.number(),
21925
+ impressions: z71.number(),
21623
21926
  ctr: fraction(),
21624
- position: z70.number()
21625
- });
21626
- var gscPerformanceOrderBySchema = z70.enum(["clicks", "impressions", "date"]);
21627
- var gscPerformanceResponseDtoSchema = z70.object({
21628
- rows: z70.array(gscSearchDataDtoSchema),
21629
- totalMatching: z70.number(),
21630
- truncated: z70.boolean(),
21631
- latestAvailableDate: z70.string().nullable()
21632
- });
21633
- var gscPerformanceDailyPointSchema = z70.object({
21634
- date: z70.string(),
21635
- clicks: z70.number(),
21636
- impressions: z70.number(),
21927
+ position: z71.number()
21928
+ });
21929
+ var gscPerformanceOrderBySchema = z71.enum(["clicks", "impressions", "date"]);
21930
+ var gscPerformanceResponseDtoSchema = z71.object({
21931
+ rows: z71.array(gscSearchDataDtoSchema),
21932
+ totalMatching: z71.number(),
21933
+ truncated: z71.boolean(),
21934
+ latestAvailableDate: z71.string().nullable()
21935
+ });
21936
+ var gscPerformanceDailyPointSchema = z71.object({
21937
+ date: z71.string(),
21938
+ clicks: z71.number(),
21939
+ impressions: z71.number(),
21637
21940
  ctr: fraction(),
21638
21941
  /**
21639
21942
  * Average ranking position for the day, or `null` on a date served by the
@@ -21642,15 +21945,15 @@ var gscPerformanceDailyPointSchema = z70.object({
21642
21945
  * absence is reported rather than a fabricated `0` — which would also read as
21643
21946
  * an impossibly good rank on a chart with an inverted axis.
21644
21947
  */
21645
- position: z70.number().nullable()
21948
+ position: z71.number().nullable()
21646
21949
  });
21647
- var gscWindowRangeSchema = z70.object({
21950
+ var gscWindowRangeSchema = z71.object({
21648
21951
  /** Inclusive lower bound, or `null` for the `all` window. */
21649
- startDate: z70.string().nullable(),
21952
+ startDate: z71.string().nullable(),
21650
21953
  /** Inclusive upper bound: the last date the property published. */
21651
- endDate: z70.string().nullable(),
21954
+ endDate: z71.string().nullable(),
21652
21955
  /** `MAX(date)` across the project's GSC data, ignoring the window. */
21653
- latestDataDate: z70.string().nullable(),
21956
+ latestDataDate: z71.string().nullable(),
21654
21957
  /**
21655
21958
  * Calendar days since the last day with recorded traffic, on GSC's Pacific
21656
21959
  * calendar. `null` with no data.
@@ -21660,37 +21963,37 @@ var gscWindowRangeSchema = z70.object({
21660
21963
  * number. Render it as "data through <endDate>", never as "Search Console is
21661
21964
  * N days behind".
21662
21965
  */
21663
- daysSinceLatestData: z70.number().nullable()
21966
+ daysSinceLatestData: z71.number().nullable()
21664
21967
  });
21665
- var gscPerformanceTrendsSchema = z70.object({
21968
+ var gscPerformanceTrendsSchema = z71.object({
21666
21969
  clicks: linearTrendSchema.nullable(),
21667
21970
  impressions: linearTrendSchema.nullable(),
21668
21971
  ctr: linearTrendSchema.nullable(),
21669
21972
  position: linearTrendSchema.nullable()
21670
21973
  });
21671
- var gscPeriodTotalsSchema = z70.object({
21672
- startDate: z70.string(),
21673
- endDate: z70.string(),
21674
- clicks: z70.number(),
21675
- impressions: z70.number(),
21974
+ var gscPeriodTotalsSchema = z71.object({
21975
+ startDate: z71.string(),
21976
+ endDate: z71.string(),
21977
+ clicks: z71.number(),
21978
+ impressions: z71.number(),
21676
21979
  /** The period's own `clicks / impressions`, never a mean of daily ratios. */
21677
21980
  ctr: fraction().nullable(),
21678
21981
  /** Impression-weighted mean position, or null when no day carried one. */
21679
- position: z70.number().nullable(),
21982
+ position: z71.number().nullable(),
21680
21983
  /**
21681
21984
  * Which table the figures came from. `gsc_daily_totals` (property-daily) and
21682
21985
  * `SUM(gsc_search_data)` (dimensioned) are not interchangeable: on one real
21683
21986
  * property-month the same period reads 1,142 clicks / 34,916 impressions from
21684
21987
  * the first and 792 / 45,266 from the second.
21685
21988
  */
21686
- source: z70.enum(["property-daily", "dimensioned", "mixed", "empty"])
21989
+ source: z71.enum(["property-daily", "dimensioned", "mixed", "empty"])
21687
21990
  });
21688
- var gscPeriodComparisonSchema = z70.object({
21991
+ var gscPeriodComparisonSchema = z71.object({
21689
21992
  /**
21690
21993
  * Length of EACH period in calendar days. Equals the selected window under
21691
21994
  * `basis: 'prior-window'`, and half of it under `basis: 'split-window'`.
21692
21995
  */
21693
- days: z70.number(),
21996
+ days: z71.number(),
21694
21997
  /**
21695
21998
  * Which two periods these are, so a surface can say what it is showing.
21696
21999
  *
@@ -21712,7 +22015,7 @@ var gscPeriodComparisonSchema = z70.object({
21712
22015
  * split the window, but a surface should render the absence with its
21713
22016
  * period-length copy rather than assert a basis nobody sent.
21714
22017
  */
21715
- basis: z70.enum(["prior-window", "split-window"]).optional(),
22018
+ basis: z71.enum(["prior-window", "split-window"]).optional(),
21716
22019
  prior: gscPeriodTotalsSchema,
21717
22020
  trailing: gscPeriodTotalsSchema,
21718
22021
  /**
@@ -21720,24 +22023,24 @@ var gscPeriodComparisonSchema = z70.object({
21720
22023
  * case every `change` is null. Empty/property-daily halves are comparable;
21721
22024
  * `SUM(gsc_search_data)` is never valid for property totals.
21722
22025
  */
21723
- comparable: z70.boolean(),
22026
+ comparable: z71.boolean(),
21724
22027
  /**
21725
22028
  * Relative change as a ratio (0.5 = +50%), null where the prior period gives
21726
22029
  * nothing to divide by or the trailing metric is unavailable. The sign is
21727
22030
  * mathematical: a POSITIVE `position` means the rank number rose, which is
21728
22031
  * worse. Desirability is the renderer's call.
21729
22032
  */
21730
- change: z70.object({
22033
+ change: z71.object({
21731
22034
  clicks: fraction().nullable(),
21732
22035
  impressions: fraction().nullable(),
21733
22036
  ctr: fraction().nullable(),
21734
22037
  position: fraction().nullable()
21735
22038
  })
21736
22039
  });
21737
- var gscPerformanceDailyDtoSchema = z70.object({
21738
- totals: z70.object({
21739
- clicks: z70.number(),
21740
- impressions: z70.number(),
22040
+ var gscPerformanceDailyDtoSchema = z71.object({
22041
+ totals: z71.object({
22042
+ clicks: z71.number(),
22043
+ impressions: z71.number(),
21741
22044
  ctr: fraction(),
21742
22045
  /**
21743
22046
  * Impression-weighted mean position over the window, or `null` when no day
@@ -21745,15 +22048,15 @@ var gscPerformanceDailyDtoSchema = z70.object({
21745
22048
  * daily values: position is non-additive, and an unweighted mean lets a
21746
22049
  * one-impression day count as much as a thousand-impression day.
21747
22050
  */
21748
- position: z70.number().nullable(),
22051
+ position: z71.number().nullable(),
21749
22052
  /**
21750
22053
  * Days that carried a property-level position. Below `days`, `position`
21751
22054
  * describes a subset of the window and must be labelled as partial.
21752
22055
  */
21753
- positionDays: z70.number(),
21754
- days: z70.number()
22056
+ positionDays: z71.number(),
22057
+ days: z71.number()
21755
22058
  }),
21756
- daily: z70.array(gscPerformanceDailyPointSchema),
22059
+ daily: z71.array(gscPerformanceDailyPointSchema),
21757
22060
  /**
21758
22061
  * Optional because a server older than this field omits it. Both the web and
21759
22062
  * the CLI guard for that skew; declaring it required here would tell a
@@ -21774,23 +22077,23 @@ var gscPerformanceDailyDtoSchema = z70.object({
21774
22077
  */
21775
22078
  periodComparison: gscPeriodComparisonSchema.nullable().optional()
21776
22079
  });
21777
- var gscTopPageRowSchema = z70.object({
21778
- page: z70.string(),
21779
- clicks: z70.number(),
21780
- impressions: z70.number(),
22080
+ var gscTopPageRowSchema = z71.object({
22081
+ page: z71.string(),
22082
+ clicks: z71.number(),
22083
+ impressions: z71.number(),
21781
22084
  ctr: fraction()
21782
22085
  });
21783
- var gscTopPagesDtoSchema = z70.object({
21784
- rows: z70.array(gscTopPageRowSchema),
21785
- totals: z70.object({
21786
- clicks: z70.number(),
21787
- impressions: z70.number(),
22086
+ var gscTopPagesDtoSchema = z71.object({
22087
+ rows: z71.array(gscTopPageRowSchema),
22088
+ totals: z71.object({
22089
+ clicks: z71.number(),
22090
+ impressions: z71.number(),
21788
22091
  ctr: fraction(),
21789
- days: z70.number(),
22092
+ days: z71.number(),
21790
22093
  /** First date the property-level totals actually cover. */
21791
- coveredFrom: z70.string().nullable(),
22094
+ coveredFrom: z71.string().nullable(),
21792
22095
  /** Last date the property-level totals actually cover. */
21793
- coveredThrough: z70.string().nullable(),
22096
+ coveredThrough: z71.string().nullable(),
21794
22097
  /**
21795
22098
  * False when the totals span less than the ranked rows above.
21796
22099
  *
@@ -21798,19 +22101,19 @@ var gscTopPagesDtoSchema = z70.object({
21798
22101
  * 30-day totals sync can sit next to months of dimensioned rows. Printing
21799
22102
  * both as one period would misstate the window the totals belong to.
21800
22103
  */
21801
- complete: z70.boolean()
22104
+ complete: z71.boolean()
21802
22105
  }).nullable(),
21803
- totalsSource: z70.literal("property-daily"),
22106
+ totalsSource: z71.literal("property-daily"),
21804
22107
  /** First date the ranked rows cover, so a caller can compare spans. */
21805
- rankedFrom: z70.string().nullable(),
22108
+ rankedFrom: z71.string().nullable(),
21806
22109
  /** Last date the ranked rows cover. */
21807
- rankedThrough: z70.string().nullable()
22110
+ rankedThrough: z71.string().nullable()
21808
22111
  });
21809
- var gscQueryTotalsSourceSchema = z70.enum(["google", "page-summed", "mixed"]);
21810
- var gscQueryTotalRowSchema = z70.object({
21811
- query: z70.string(),
21812
- clicks: z70.number(),
21813
- impressions: z70.number(),
22112
+ var gscQueryTotalsSourceSchema = z71.enum(["google", "page-summed", "mixed"]);
22113
+ var gscQueryTotalRowSchema = z71.object({
22114
+ query: z71.string(),
22115
+ clicks: z71.number(),
22116
+ impressions: z71.number(),
21814
22117
  /** clicks / impressions as a 0..1 fraction, 0 when impressions are 0. */
21815
22118
  ctr: fraction(),
21816
22119
  /**
@@ -21818,15 +22121,15 @@ var gscQueryTotalRowSchema = z70.object({
21818
22121
  * sum(position * impressions) / sum(impressions). When the query has no
21819
22122
  * impressions in the window, the plain mean of its daily positions.
21820
22123
  */
21821
- position: z70.number(),
22124
+ position: z71.number(),
21822
22125
  /** Distinct dates the query appeared on in the window. */
21823
- days: z70.number(),
22126
+ days: z71.number(),
21824
22127
  source: gscQueryTotalsSourceSchema
21825
22128
  });
21826
- var gscQueryTotalsDtoSchema = z70.object({
21827
- rows: z70.array(gscQueryTotalRowSchema),
21828
- totalMatching: z70.number(),
21829
- truncated: z70.boolean(),
22129
+ var gscQueryTotalsDtoSchema = z71.object({
22130
+ rows: z71.array(gscQueryTotalRowSchema),
22131
+ totalMatching: z71.number(),
22132
+ truncated: z71.boolean(),
21830
22133
  /**
21831
22134
  * The range the rows were read from, exactly. Explicit dates win; a labelled
21832
22135
  * window paired with only `endDate` spans that many days ending on it. A
@@ -21844,49 +22147,49 @@ var gscQueryTotalsDtoSchema = z70.object({
21844
22147
  * omits it, which means coverage is unknown, not that no rows are stored.
21845
22148
  * This route always sends it.
21846
22149
  */
21847
- earliestDataDate: z70.string().nullable().optional()
22150
+ earliestDataDate: z71.string().nullable().optional()
21848
22151
  })
21849
22152
  });
21850
- var gscUrlInspectionDtoSchema = z70.object({
21851
- id: z70.string(),
21852
- url: z70.string(),
21853
- indexingState: z70.string().nullable().optional(),
21854
- verdict: z70.string().nullable().optional(),
21855
- coverageState: z70.string().nullable().optional(),
21856
- pageFetchState: z70.string().nullable().optional(),
21857
- robotsTxtState: z70.string().nullable().optional(),
21858
- crawlTime: z70.string().nullable().optional(),
21859
- lastCrawlResult: z70.string().nullable().optional(),
21860
- isMobileFriendly: z70.boolean().nullable().optional(),
21861
- richResults: z70.array(z70.string()).default([]),
22153
+ var gscUrlInspectionDtoSchema = z71.object({
22154
+ id: z71.string(),
22155
+ url: z71.string(),
22156
+ indexingState: z71.string().nullable().optional(),
22157
+ verdict: z71.string().nullable().optional(),
22158
+ coverageState: z71.string().nullable().optional(),
22159
+ pageFetchState: z71.string().nullable().optional(),
22160
+ robotsTxtState: z71.string().nullable().optional(),
22161
+ crawlTime: z71.string().nullable().optional(),
22162
+ lastCrawlResult: z71.string().nullable().optional(),
22163
+ isMobileFriendly: z71.boolean().nullable().optional(),
22164
+ richResults: z71.array(z71.string()).default([]),
21862
22165
  // Spec gap: server has returned `referringUrls` since the GSC inspect
21863
22166
  // route shipped (see google.ts handler at /gsc/inspect + /gsc/inspections),
21864
22167
  // but the schema dropped the field so the generated TS client (and
21865
22168
  // anything else reading from this DTO) lost the data silently. Adding
21866
22169
  // here restores end-to-end visibility.
21867
- referringUrls: z70.array(z70.string()).default([]),
21868
- inspectedAt: z70.string()
21869
- });
21870
- var indexTransitionSchema = z70.enum(["stable", "reindexed", "deindexed", "still-missing", "new"]);
21871
- var gscDeindexedRowSchema = z70.object({
21872
- url: z70.string(),
21873
- previousState: z70.string().nullable(),
21874
- currentState: z70.string().nullable(),
21875
- transitionDate: z70.string()
21876
- });
21877
- var gscReasonGroupSchema = z70.object({
21878
- reason: z70.string(),
21879
- count: z70.number(),
21880
- urls: z70.array(gscUrlInspectionDtoSchema).default([])
21881
- });
21882
- var gscCoverageSummaryDtoSchema = z70.object({
21883
- summary: z70.object({
22170
+ referringUrls: z71.array(z71.string()).default([]),
22171
+ inspectedAt: z71.string()
22172
+ });
22173
+ var indexTransitionSchema = z71.enum(["stable", "reindexed", "deindexed", "still-missing", "new"]);
22174
+ var gscDeindexedRowSchema = z71.object({
22175
+ url: z71.string(),
22176
+ previousState: z71.string().nullable(),
22177
+ currentState: z71.string().nullable(),
22178
+ transitionDate: z71.string()
22179
+ });
22180
+ var gscReasonGroupSchema = z71.object({
22181
+ reason: z71.string(),
22182
+ count: z71.number(),
22183
+ urls: z71.array(gscUrlInspectionDtoSchema).default([])
22184
+ });
22185
+ var gscCoverageSummaryDtoSchema = z71.object({
22186
+ summary: z71.object({
21884
22187
  /** Inspected pages, each in exactly one of `indexed` / `notIndexed`. */
21885
- total: z70.number(),
21886
- indexed: z70.number(),
21887
- notIndexed: z70.number(),
22188
+ total: z71.number(),
22189
+ indexed: z71.number(),
22190
+ notIndexed: z71.number(),
21888
22191
  /** Pages whose latest inspection lost the indexed state of the one before it. */
21889
- deindexed: z70.number(),
22192
+ deindexed: z71.number(),
21890
22193
  /** `indexed / total` as a 0..100 percent rounded to one decimal; 0 when nothing was inspected. */
21891
22194
  percentage: percent(),
21892
22195
  /**
@@ -21894,92 +22197,92 @@ var gscCoverageSummaryDtoSchema = z70.object({
21894
22197
  * full coverage still reads short of 100%. Null when nothing was
21895
22198
  * inspected: an empty site has no coverage share, not a 0% one.
21896
22199
  */
21897
- indexedShare: fraction(z70.number().min(0).max(1)).nullable(),
22200
+ indexedShare: fraction(z71.number().min(0).max(1)).nullable(),
21898
22201
  /** `notIndexed / total`, 0..1. With `indexedShare` it sums to 1. Null when nothing was inspected. */
21899
- notIndexedShare: fraction(z70.number().min(0).max(1)).nullable()
22202
+ notIndexedShare: fraction(z71.number().min(0).max(1)).nullable()
21900
22203
  }),
21901
- lastInspectedAt: z70.string().nullable(),
21902
- lastSyncedAt: z70.string().nullable(),
21903
- indexed: z70.array(gscUrlInspectionDtoSchema).default([]),
21904
- notIndexed: z70.array(gscUrlInspectionDtoSchema).default([]),
21905
- deindexed: z70.array(gscDeindexedRowSchema).default([]),
21906
- reasonGroups: z70.array(gscReasonGroupSchema).default([])
21907
- });
21908
- var indexingNotificationDtoSchema = z70.object({
21909
- url: z70.string(),
21910
- type: z70.enum(["URL_UPDATED", "URL_DELETED"]),
21911
- notifiedAt: z70.string()
21912
- });
21913
- var indexingRequestResultDtoSchema = z70.object({
21914
- url: z70.string(),
21915
- type: z70.enum(["URL_UPDATED", "URL_DELETED"]),
21916
- notifiedAt: z70.string(),
21917
- status: z70.enum(["success", "error"]),
21918
- error: z70.string().optional()
21919
- });
21920
- var indexingRequestResponseDtoSchema = z70.object({
21921
- summary: z70.object({
21922
- total: z70.number().int().nonnegative(),
21923
- succeeded: z70.number().int().nonnegative(),
21924
- failed: z70.number().int().nonnegative()
22204
+ lastInspectedAt: z71.string().nullable(),
22205
+ lastSyncedAt: z71.string().nullable(),
22206
+ indexed: z71.array(gscUrlInspectionDtoSchema).default([]),
22207
+ notIndexed: z71.array(gscUrlInspectionDtoSchema).default([]),
22208
+ deindexed: z71.array(gscDeindexedRowSchema).default([]),
22209
+ reasonGroups: z71.array(gscReasonGroupSchema).default([])
22210
+ });
22211
+ var indexingNotificationDtoSchema = z71.object({
22212
+ url: z71.string(),
22213
+ type: z71.enum(["URL_UPDATED", "URL_DELETED"]),
22214
+ notifiedAt: z71.string()
22215
+ });
22216
+ var indexingRequestResultDtoSchema = z71.object({
22217
+ url: z71.string(),
22218
+ type: z71.enum(["URL_UPDATED", "URL_DELETED"]),
22219
+ notifiedAt: z71.string(),
22220
+ status: z71.enum(["success", "error"]),
22221
+ error: z71.string().optional()
22222
+ });
22223
+ var indexingRequestResponseDtoSchema = z71.object({
22224
+ summary: z71.object({
22225
+ total: z71.number().int().nonnegative(),
22226
+ succeeded: z71.number().int().nonnegative(),
22227
+ failed: z71.number().int().nonnegative()
21925
22228
  }),
21926
- results: z70.array(indexingRequestResultDtoSchema).default([])
22229
+ results: z71.array(indexingRequestResultDtoSchema).default([])
21927
22230
  });
21928
- var gscCoverageSnapshotDtoSchema = z70.object({
21929
- date: z70.string(),
21930
- indexed: z70.number(),
21931
- notIndexed: z70.number(),
22231
+ var gscCoverageSnapshotDtoSchema = z71.object({
22232
+ date: z71.string(),
22233
+ indexed: z71.number(),
22234
+ notIndexed: z71.number(),
21932
22235
  /**
21933
22236
  * Pages with no evidence either way — no impressions in the window and never
21934
22237
  * inspected. Deliberately NOT folded into `notIndexed`: absence of
21935
22238
  * impressions is not evidence of exclusion, and merging the two would report
21936
22239
  * every unmeasured page as a problem.
21937
22240
  */
21938
- unknownPages: z70.number().default(0),
22241
+ unknownPages: z71.number().default(0),
21939
22242
  /** Of the total, how many carry a real URL Inspection verdict. */
21940
- verifiedByInspection: z70.number().default(0),
22243
+ verifiedByInspection: z71.number().default(0),
21941
22244
  /** Pages proven indexed by impressions alone, costing no inspection quota. */
21942
- derivedFromImpressions: z70.number().default(0),
21943
- reasonBreakdown: z70.record(z70.string(), z70.number()).default({})
22245
+ derivedFromImpressions: z71.number().default(0),
22246
+ reasonBreakdown: z71.record(z71.string(), z71.number()).default({})
21944
22247
  });
21945
- var gscSiteDtoSchema = z70.object({
21946
- siteUrl: z70.string(),
21947
- permissionLevel: z70.string()
22248
+ var gscSiteDtoSchema = z71.object({
22249
+ siteUrl: z71.string(),
22250
+ permissionLevel: z71.string()
21948
22251
  });
21949
- var gscSiteListResponseDtoSchema = z70.object({
21950
- sites: z70.array(gscSiteDtoSchema).default([])
22252
+ var gscSiteListResponseDtoSchema = z71.object({
22253
+ sites: z71.array(gscSiteDtoSchema).default([])
21951
22254
  });
21952
- var gscSitemapContentDtoSchema = z70.object({
21953
- type: z70.string(),
21954
- submitted: z70.string(),
22255
+ var gscSitemapContentDtoSchema = z71.object({
22256
+ type: z71.string(),
22257
+ submitted: z71.string(),
21955
22258
  // Google still returns this for existing sitemap reads, but it is not a
21956
22259
  // reliable submission outcome. Retained only for response compatibility.
21957
- indexed: z70.string().optional().describe("Deprecated compatibility field.")
21958
- });
21959
- var gscSitemapDtoSchema = z70.object({
21960
- path: z70.string(),
21961
- parentSitemapUrl: z70.string().optional(),
21962
- lastSubmitted: z70.string().optional(),
21963
- isPending: z70.boolean().optional(),
21964
- isSitemapsIndex: z70.boolean().optional(),
21965
- type: z70.string().optional(),
21966
- lastDownloaded: z70.string().optional(),
21967
- warnings: z70.string().optional(),
21968
- errors: z70.string().optional(),
21969
- contents: z70.array(gscSitemapContentDtoSchema).optional()
21970
- });
21971
- var gscSitemapListResponseDtoSchema = z70.object({
21972
- sitemaps: z70.array(gscSitemapDtoSchema).default([]),
21973
- summary: z70.object({
21974
- total: z70.number().int().nonnegative(),
21975
- indexes: z70.number().int().nonnegative(),
21976
- files: z70.number().int().nonnegative()
22260
+ indexed: z71.string().optional().describe("Deprecated compatibility field.")
22261
+ });
22262
+ var gscSitemapDtoSchema = z71.object({
22263
+ path: z71.string(),
22264
+ parentSitemapUrl: z71.string().optional(),
22265
+ lastSubmitted: z71.string().optional(),
22266
+ isPending: z71.boolean().optional(),
22267
+ isSitemapsIndex: z71.boolean().optional(),
22268
+ type: z71.string().optional(),
22269
+ lastDownloaded: z71.string().optional(),
22270
+ warnings: z71.string().optional(),
22271
+ errors: z71.string().optional(),
22272
+ contents: z71.array(gscSitemapContentDtoSchema).optional()
22273
+ });
22274
+ var gscSitemapListResponseDtoSchema = z71.object({
22275
+ sitemaps: z71.array(gscSitemapDtoSchema).default([]),
22276
+ summary: z71.object({
22277
+ total: z71.number().int().nonnegative(),
22278
+ indexes: z71.number().int().nonnegative(),
22279
+ files: z71.number().int().nonnegative()
21977
22280
  }),
21978
- preferredSubmissionUrls: z70.array(z70.string()).default([])
22281
+ preferredSubmissionUrls: z71.array(z71.string()).default([])
21979
22282
  });
21980
- var gscSubmitSitemapsRequestDtoSchema = z70.object({
21981
- sitemapUrls: z70.array(
21982
- z70.string().url().refine(
22283
+ var gscSubmitSitemapsRequestDtoSchema = z71.object({
22284
+ sitemapUrls: z71.array(
22285
+ z71.string().url().refine(
21983
22286
  (value) => {
21984
22287
  const protocol = new URL(value).protocol;
21985
22288
  return protocol === "http:" || protocol === "https:";
@@ -21988,30 +22291,30 @@ var gscSubmitSitemapsRequestDtoSchema = z70.object({
21988
22291
  )
21989
22292
  ).min(1).max(50)
21990
22293
  });
21991
- var gscSubmitSitemapResultDtoSchema = z70.object({
21992
- sitemapUrl: z70.string(),
21993
- status: z70.enum(["accepted", "error"]),
21994
- submittedAt: z70.string().optional(),
21995
- error: z70.string().optional()
21996
- });
21997
- var gscSubmitSitemapsResponseDtoSchema = z70.object({
21998
- summary: z70.object({
21999
- total: z70.number().int().nonnegative(),
22000
- accepted: z70.number().int().nonnegative(),
22001
- failed: z70.number().int().nonnegative()
22294
+ var gscSubmitSitemapResultDtoSchema = z71.object({
22295
+ sitemapUrl: z71.string(),
22296
+ status: z71.enum(["accepted", "error"]),
22297
+ submittedAt: z71.string().optional(),
22298
+ error: z71.string().optional()
22299
+ });
22300
+ var gscSubmitSitemapsResponseDtoSchema = z71.object({
22301
+ summary: z71.object({
22302
+ total: z71.number().int().nonnegative(),
22303
+ accepted: z71.number().int().nonnegative(),
22304
+ failed: z71.number().int().nonnegative()
22002
22305
  }),
22003
- results: z70.array(gscSubmitSitemapResultDtoSchema)
22004
- });
22005
- var gscDiscoverSitemapsResponseDtoSchema = z70.object({
22006
- sitemaps: z70.array(gscSitemapDtoSchema),
22007
- primarySitemapUrl: z70.string(),
22008
- run: z70.object({
22009
- id: z70.string(),
22010
- projectId: z70.string(),
22011
- kind: z70.string(),
22012
- status: z70.string(),
22013
- trigger: z70.string(),
22014
- createdAt: z70.string()
22306
+ results: z71.array(gscSubmitSitemapResultDtoSchema)
22307
+ });
22308
+ var gscDiscoverSitemapsResponseDtoSchema = z71.object({
22309
+ sitemaps: z71.array(gscSitemapDtoSchema),
22310
+ primarySitemapUrl: z71.string(),
22311
+ run: z71.object({
22312
+ id: z71.string(),
22313
+ projectId: z71.string(),
22314
+ kind: z71.string(),
22315
+ status: z71.string(),
22316
+ trigger: z71.string(),
22317
+ createdAt: z71.string()
22015
22318
  }).nullable()
22016
22319
  });
22017
22320
 
@@ -22130,255 +22433,255 @@ async function mapWithConcurrency(items, concurrency, fn) {
22130
22433
  }
22131
22434
 
22132
22435
  // ../contracts/src/bing.ts
22133
- import { z as z71 } from "zod";
22134
- var bingConnectionDtoSchema = z71.object({
22135
- id: z71.string(),
22136
- domain: z71.string(),
22137
- siteUrl: z71.string().nullable().optional(),
22138
- createdAt: z71.string(),
22139
- updatedAt: z71.string()
22140
- });
22141
- var bingUrlInspectionDtoSchema = z71.object({
22142
- id: z71.string(),
22143
- url: z71.string(),
22144
- httpCode: z71.number().nullable().optional(),
22145
- inIndex: z71.boolean().nullable().optional(),
22146
- lastCrawledDate: z71.string().nullable().optional(),
22147
- inIndexDate: z71.string().nullable().optional(),
22148
- inspectedAt: z71.string(),
22436
+ import { z as z72 } from "zod";
22437
+ var bingConnectionDtoSchema = z72.object({
22438
+ id: z72.string(),
22439
+ domain: z72.string(),
22440
+ siteUrl: z72.string().nullable().optional(),
22441
+ createdAt: z72.string(),
22442
+ updatedAt: z72.string()
22443
+ });
22444
+ var bingUrlInspectionDtoSchema = z72.object({
22445
+ id: z72.string(),
22446
+ url: z72.string(),
22447
+ httpCode: z72.number().nullable().optional(),
22448
+ inIndex: z72.boolean().nullable().optional(),
22449
+ lastCrawledDate: z72.string().nullable().optional(),
22450
+ inIndexDate: z72.string().nullable().optional(),
22451
+ inspectedAt: z72.string(),
22149
22452
  // Fields derived from GetUrlInfo response (more reliable than InIndex)
22150
- documentSize: z71.number().nullable().optional(),
22151
- anchorCount: z71.number().nullable().optional(),
22152
- discoveryDate: z71.string().nullable().optional()
22153
- });
22154
- var bingCoverageSummaryDtoSchema = z71.object({
22155
- summary: z71.object({
22156
- total: z71.number(),
22157
- indexed: z71.number(),
22158
- notIndexed: z71.number(),
22159
- unknown: z71.number().optional(),
22453
+ documentSize: z72.number().nullable().optional(),
22454
+ anchorCount: z72.number().nullable().optional(),
22455
+ discoveryDate: z72.string().nullable().optional()
22456
+ });
22457
+ var bingCoverageSummaryDtoSchema = z72.object({
22458
+ summary: z72.object({
22459
+ total: z72.number(),
22460
+ indexed: z72.number(),
22461
+ notIndexed: z72.number(),
22462
+ unknown: z72.number().optional(),
22160
22463
  percentage: percent()
22161
22464
  }),
22162
- lastInspectedAt: z71.string().nullable(),
22163
- indexed: z71.array(bingUrlInspectionDtoSchema).default([]),
22164
- notIndexed: z71.array(bingUrlInspectionDtoSchema).default([]),
22165
- unknown: z71.array(bingUrlInspectionDtoSchema).default([]).optional()
22166
- });
22167
- var bingKeywordStatsDtoSchema = z71.object({
22168
- query: z71.string(),
22169
- impressions: z71.number(),
22170
- clicks: z71.number(),
22465
+ lastInspectedAt: z72.string().nullable(),
22466
+ indexed: z72.array(bingUrlInspectionDtoSchema).default([]),
22467
+ notIndexed: z72.array(bingUrlInspectionDtoSchema).default([]),
22468
+ unknown: z72.array(bingUrlInspectionDtoSchema).default([]).optional()
22469
+ });
22470
+ var bingKeywordStatsDtoSchema = z72.object({
22471
+ query: z72.string(),
22472
+ impressions: z72.number(),
22473
+ clicks: z72.number(),
22171
22474
  ctr: fraction(),
22172
- averagePosition: z71.number()
22173
- });
22174
- var bingCoverageSnapshotDtoSchema = z71.object({
22175
- date: z71.string(),
22176
- indexed: z71.number(),
22177
- notIndexed: z71.number(),
22178
- unknown: z71.number()
22179
- });
22180
- var bingSubmitResultDtoSchema = z71.object({
22181
- url: z71.string(),
22182
- status: z71.enum(["success", "error"]),
22183
- submittedAt: z71.string(),
22184
- error: z71.string().optional()
22185
- });
22186
- var bingIndexingRequestResponseDtoSchema = z71.object({
22187
- summary: z71.object({
22188
- total: z71.number().int().nonnegative(),
22189
- succeeded: z71.number().int().nonnegative(),
22190
- failed: z71.number().int().nonnegative()
22475
+ averagePosition: z72.number()
22476
+ });
22477
+ var bingCoverageSnapshotDtoSchema = z72.object({
22478
+ date: z72.string(),
22479
+ indexed: z72.number(),
22480
+ notIndexed: z72.number(),
22481
+ unknown: z72.number()
22482
+ });
22483
+ var bingSubmitResultDtoSchema = z72.object({
22484
+ url: z72.string(),
22485
+ status: z72.enum(["success", "error"]),
22486
+ submittedAt: z72.string(),
22487
+ error: z72.string().optional()
22488
+ });
22489
+ var bingIndexingRequestResponseDtoSchema = z72.object({
22490
+ summary: z72.object({
22491
+ total: z72.number().int().nonnegative(),
22492
+ succeeded: z72.number().int().nonnegative(),
22493
+ failed: z72.number().int().nonnegative()
22191
22494
  }),
22192
- results: z71.array(bingSubmitResultDtoSchema).default([])
22495
+ results: z72.array(bingSubmitResultDtoSchema).default([])
22193
22496
  });
22194
- var bingSiteDtoSchema = z71.object({
22195
- url: z71.string(),
22196
- verified: z71.boolean()
22497
+ var bingSiteDtoSchema = z72.object({
22498
+ url: z72.string(),
22499
+ verified: z72.boolean()
22197
22500
  });
22198
- var bingSitesResponseDtoSchema = z71.object({
22199
- sites: z71.array(bingSiteDtoSchema).default([])
22501
+ var bingSitesResponseDtoSchema = z72.object({
22502
+ sites: z72.array(bingSiteDtoSchema).default([])
22200
22503
  });
22201
- var bingStatusDtoSchema = z71.object({
22202
- connected: z71.boolean(),
22203
- domain: z71.string(),
22204
- siteUrl: z71.string().nullable(),
22205
- createdAt: z71.string().nullable(),
22206
- updatedAt: z71.string().nullable()
22504
+ var bingStatusDtoSchema = z72.object({
22505
+ connected: z72.boolean(),
22506
+ domain: z72.string(),
22507
+ siteUrl: z72.string().nullable(),
22508
+ createdAt: z72.string().nullable(),
22509
+ updatedAt: z72.string().nullable()
22207
22510
  });
22208
- var bingConnectResponseDtoSchema = z71.object({
22209
- connected: z71.boolean(),
22210
- domain: z71.string(),
22211
- siteUrl: z71.string().nullable(),
22212
- availableSites: z71.array(bingSiteDtoSchema).default([])
22511
+ var bingConnectResponseDtoSchema = z72.object({
22512
+ connected: z72.boolean(),
22513
+ domain: z72.string(),
22514
+ siteUrl: z72.string().nullable(),
22515
+ availableSites: z72.array(bingSiteDtoSchema).default([])
22213
22516
  });
22214
- var bingSetSiteResponseDtoSchema = z71.object({
22215
- siteUrl: z71.string()
22517
+ var bingSetSiteResponseDtoSchema = z72.object({
22518
+ siteUrl: z72.string()
22216
22519
  });
22217
22520
 
22218
22521
  // ../contracts/src/cdp.ts
22219
- import { z as z72 } from "zod";
22220
- var cdpTargetStatusDtoSchema = z72.object({
22221
- name: z72.string(),
22222
- alive: z72.boolean(),
22223
- lastUsed: z72.string().nullable()
22522
+ import { z as z73 } from "zod";
22523
+ var cdpTargetStatusDtoSchema = z73.object({
22524
+ name: z73.string(),
22525
+ alive: z73.boolean(),
22526
+ lastUsed: z73.string().nullable()
22224
22527
  });
22225
- var cdpStatusDtoSchema = z72.object({
22226
- connected: z72.boolean(),
22227
- endpoint: z72.string(),
22228
- version: z72.string().optional(),
22229
- browserVersion: z72.string().optional(),
22230
- targets: z72.array(cdpTargetStatusDtoSchema).default([])
22528
+ var cdpStatusDtoSchema = z73.object({
22529
+ connected: z73.boolean(),
22530
+ endpoint: z73.string(),
22531
+ version: z73.string().optional(),
22532
+ browserVersion: z73.string().optional(),
22533
+ targets: z73.array(cdpTargetStatusDtoSchema).default([])
22231
22534
  });
22232
22535
 
22233
22536
  // ../contracts/src/wordpress.ts
22234
- import { z as z73 } from "zod";
22235
- var wordpressEnvSchema = z73.enum(["live", "staging"]);
22236
- var wordpressConnectionDtoSchema = z73.object({
22237
- projectName: z73.string(),
22238
- url: z73.string(),
22239
- stagingUrl: z73.string().optional(),
22240
- username: z73.string(),
22537
+ import { z as z74 } from "zod";
22538
+ var wordpressEnvSchema = z74.enum(["live", "staging"]);
22539
+ var wordpressConnectionDtoSchema = z74.object({
22540
+ projectName: z74.string(),
22541
+ url: z74.string(),
22542
+ stagingUrl: z74.string().optional(),
22543
+ username: z74.string(),
22241
22544
  defaultEnv: wordpressEnvSchema,
22242
- createdAt: z73.string(),
22243
- updatedAt: z73.string()
22244
- });
22245
- var wordpressSiteStatusDtoSchema = z73.object({
22246
- url: z73.string(),
22247
- reachable: z73.boolean(),
22248
- pageCount: z73.number().nullable().optional(),
22249
- version: z73.string().nullable().optional(),
22250
- error: z73.string().nullable().optional(),
22251
- plugins: z73.array(z73.string()).optional(),
22252
- authenticatedUser: z73.object({
22253
- id: z73.number(),
22254
- slug: z73.string()
22545
+ createdAt: z74.string(),
22546
+ updatedAt: z74.string()
22547
+ });
22548
+ var wordpressSiteStatusDtoSchema = z74.object({
22549
+ url: z74.string(),
22550
+ reachable: z74.boolean(),
22551
+ pageCount: z74.number().nullable().optional(),
22552
+ version: z74.string().nullable().optional(),
22553
+ error: z74.string().nullable().optional(),
22554
+ plugins: z74.array(z74.string()).optional(),
22555
+ authenticatedUser: z74.object({
22556
+ id: z74.number(),
22557
+ slug: z74.string()
22255
22558
  }).nullable().optional()
22256
22559
  });
22257
- var wordpressStatusDtoSchema = z73.object({
22258
- connected: z73.boolean(),
22259
- projectName: z73.string(),
22560
+ var wordpressStatusDtoSchema = z74.object({
22561
+ connected: z74.boolean(),
22562
+ projectName: z74.string(),
22260
22563
  defaultEnv: wordpressEnvSchema,
22261
22564
  live: wordpressSiteStatusDtoSchema.nullable(),
22262
22565
  staging: wordpressSiteStatusDtoSchema.nullable(),
22263
- adminUrl: z73.string().nullable().optional()
22566
+ adminUrl: z74.string().nullable().optional()
22264
22567
  });
22265
- var wordpressPageSummaryDtoSchema = z73.object({
22266
- id: z73.number(),
22267
- slug: z73.string(),
22268
- title: z73.string(),
22269
- status: z73.string(),
22270
- modifiedAt: z73.string().nullable().optional(),
22271
- link: z73.string().nullable().optional()
22568
+ var wordpressPageSummaryDtoSchema = z74.object({
22569
+ id: z74.number(),
22570
+ slug: z74.string(),
22571
+ title: z74.string(),
22572
+ status: z74.string(),
22573
+ modifiedAt: z74.string().nullable().optional(),
22574
+ link: z74.string().nullable().optional()
22272
22575
  });
22273
- var wordpressPageListDtoSchema = z73.object({
22576
+ var wordpressPageListDtoSchema = z74.object({
22274
22577
  env: wordpressEnvSchema,
22275
- pages: z73.array(wordpressPageSummaryDtoSchema)
22578
+ pages: z74.array(wordpressPageSummaryDtoSchema)
22276
22579
  });
22277
- var wordpressSeoStateDtoSchema = z73.object({
22278
- title: z73.string().nullable(),
22279
- description: z73.string().nullable(),
22280
- noindex: z73.boolean().nullable(),
22281
- writable: z73.boolean().default(false),
22282
- writeTargets: z73.array(z73.string()).default([])
22580
+ var wordpressSeoStateDtoSchema = z74.object({
22581
+ title: z74.string().nullable(),
22582
+ description: z74.string().nullable(),
22583
+ noindex: z74.boolean().nullable(),
22584
+ writable: z74.boolean().default(false),
22585
+ writeTargets: z74.array(z74.string()).default([])
22283
22586
  });
22284
- var wordpressSchemaBlockDtoSchema = z73.object({
22285
- type: z73.string(),
22286
- json: z73.record(z73.string(), z73.unknown())
22587
+ var wordpressSchemaBlockDtoSchema = z74.object({
22588
+ type: z74.string(),
22589
+ json: z74.record(z74.string(), z74.unknown())
22287
22590
  });
22288
22591
  var wordpressPageDetailDtoSchema = wordpressPageSummaryDtoSchema.extend({
22289
22592
  env: wordpressEnvSchema,
22290
- content: z73.string(),
22593
+ content: z74.string(),
22291
22594
  seo: wordpressSeoStateDtoSchema,
22292
- schemaBlocks: z73.array(wordpressSchemaBlockDtoSchema).default([])
22595
+ schemaBlocks: z74.array(wordpressSchemaBlockDtoSchema).default([])
22293
22596
  });
22294
22597
  var wordpressDiffPageDtoSchema = wordpressPageDetailDtoSchema.extend({
22295
- contentHash: z73.string(),
22296
- contentSnippet: z73.string()
22297
- });
22298
- var wordpressManualAssistDtoSchema = z73.object({
22299
- manualRequired: z73.literal(true),
22300
- targetUrl: z73.string(),
22301
- adminUrl: z73.string().nullable().optional(),
22302
- content: z73.string(),
22303
- nextSteps: z73.array(z73.string()).default([])
22304
- });
22305
- var wordpressAuditIssueDtoSchema = z73.object({
22306
- slug: z73.string(),
22307
- severity: z73.enum(["high", "medium", "low"]),
22308
- code: z73.enum([
22598
+ contentHash: z74.string(),
22599
+ contentSnippet: z74.string()
22600
+ });
22601
+ var wordpressManualAssistDtoSchema = z74.object({
22602
+ manualRequired: z74.literal(true),
22603
+ targetUrl: z74.string(),
22604
+ adminUrl: z74.string().nullable().optional(),
22605
+ content: z74.string(),
22606
+ nextSteps: z74.array(z74.string()).default([])
22607
+ });
22608
+ var wordpressAuditIssueDtoSchema = z74.object({
22609
+ slug: z74.string(),
22610
+ severity: z74.enum(["high", "medium", "low"]),
22611
+ code: z74.enum([
22309
22612
  "noindex",
22310
22613
  "missing-seo-title",
22311
22614
  "missing-meta-description",
22312
22615
  "missing-schema",
22313
22616
  "thin-content"
22314
22617
  ]),
22315
- message: z73.string()
22618
+ message: z74.string()
22316
22619
  });
22317
- var wordpressAuditPageDtoSchema = z73.object({
22318
- slug: z73.string(),
22319
- title: z73.string(),
22320
- status: z73.string(),
22321
- wordCount: z73.number(),
22620
+ var wordpressAuditPageDtoSchema = z74.object({
22621
+ slug: z74.string(),
22622
+ title: z74.string(),
22623
+ status: z74.string(),
22624
+ wordCount: z74.number(),
22322
22625
  seo: wordpressSeoStateDtoSchema,
22323
- schemaPresent: z73.boolean(),
22324
- issues: z73.array(wordpressAuditIssueDtoSchema).default([])
22626
+ schemaPresent: z74.boolean(),
22627
+ issues: z74.array(wordpressAuditIssueDtoSchema).default([])
22325
22628
  });
22326
- var wordpressBulkMetaEntryResultDtoSchema = z73.object({
22327
- slug: z73.string(),
22328
- status: z73.enum(["applied", "skipped", "manual"]),
22329
- error: z73.string().optional(),
22629
+ var wordpressBulkMetaEntryResultDtoSchema = z74.object({
22630
+ slug: z74.string(),
22631
+ status: z74.enum(["applied", "skipped", "manual"]),
22632
+ error: z74.string().optional(),
22330
22633
  manualAssist: wordpressManualAssistDtoSchema.optional()
22331
22634
  });
22332
- var wordpressBulkMetaResultDtoSchema = z73.object({
22635
+ var wordpressBulkMetaResultDtoSchema = z74.object({
22333
22636
  env: wordpressEnvSchema,
22334
- strategy: z73.enum(["plugin", "manual"]),
22335
- results: z73.array(wordpressBulkMetaEntryResultDtoSchema)
22637
+ strategy: z74.enum(["plugin", "manual"]),
22638
+ results: z74.array(wordpressBulkMetaEntryResultDtoSchema)
22336
22639
  });
22337
- var wordpressSchemaDeployEntryResultDtoSchema = z73.object({
22338
- slug: z73.string(),
22339
- status: z73.enum(["deployed", "stripped", "skipped", "failed"]),
22340
- schemasInjected: z73.array(z73.string()).optional(),
22640
+ var wordpressSchemaDeployEntryResultDtoSchema = z74.object({
22641
+ slug: z74.string(),
22642
+ status: z74.enum(["deployed", "stripped", "skipped", "failed"]),
22643
+ schemasInjected: z74.array(z74.string()).optional(),
22341
22644
  manualAssist: wordpressManualAssistDtoSchema.optional(),
22342
- error: z73.string().optional()
22645
+ error: z74.string().optional()
22343
22646
  });
22344
- var wordpressSchemaDeployResultDtoSchema = z73.object({
22647
+ var wordpressSchemaDeployResultDtoSchema = z74.object({
22345
22648
  env: wordpressEnvSchema,
22346
- results: z73.array(wordpressSchemaDeployEntryResultDtoSchema)
22649
+ results: z74.array(wordpressSchemaDeployEntryResultDtoSchema)
22347
22650
  });
22348
- var wordpressSchemaStatusPageDtoSchema = z73.object({
22349
- slug: z73.string(),
22350
- title: z73.string(),
22351
- canonrySchemas: z73.array(z73.string()),
22352
- thirdPartySchemas: z73.array(z73.string()),
22353
- hasCanonrySchema: z73.boolean()
22651
+ var wordpressSchemaStatusPageDtoSchema = z74.object({
22652
+ slug: z74.string(),
22653
+ title: z74.string(),
22654
+ canonrySchemas: z74.array(z74.string()),
22655
+ thirdPartySchemas: z74.array(z74.string()),
22656
+ hasCanonrySchema: z74.boolean()
22354
22657
  });
22355
- var wordpressSchemaStatusResultDtoSchema = z73.object({
22658
+ var wordpressSchemaStatusResultDtoSchema = z74.object({
22356
22659
  env: wordpressEnvSchema,
22357
- pages: z73.array(wordpressSchemaStatusPageDtoSchema)
22660
+ pages: z74.array(wordpressSchemaStatusPageDtoSchema)
22358
22661
  });
22359
- var wordpressOnboardStepDtoSchema = z73.object({
22360
- name: z73.string(),
22361
- status: z73.enum(["completed", "skipped", "failed"]),
22362
- summary: z73.string().optional(),
22363
- error: z73.string().optional()
22662
+ var wordpressOnboardStepDtoSchema = z74.object({
22663
+ name: z74.string(),
22664
+ status: z74.enum(["completed", "skipped", "failed"]),
22665
+ summary: z74.string().optional(),
22666
+ error: z74.string().optional()
22364
22667
  });
22365
- var wordpressOnboardResultDtoSchema = z73.object({
22366
- projectName: z73.string(),
22367
- steps: z73.array(wordpressOnboardStepDtoSchema)
22668
+ var wordpressOnboardResultDtoSchema = z74.object({
22669
+ projectName: z74.string(),
22670
+ steps: z74.array(wordpressOnboardStepDtoSchema)
22368
22671
  });
22369
- var wordpressDiffDtoSchema = z73.object({
22370
- slug: z73.string(),
22672
+ var wordpressDiffDtoSchema = z74.object({
22673
+ slug: z74.string(),
22371
22674
  live: wordpressDiffPageDtoSchema,
22372
22675
  staging: wordpressDiffPageDtoSchema,
22373
- hasDifferences: z73.boolean(),
22374
- differences: z73.object({
22375
- title: z73.boolean(),
22376
- slug: z73.boolean(),
22377
- content: z73.boolean(),
22378
- seoTitle: z73.boolean(),
22379
- seoDescription: z73.boolean(),
22380
- noindex: z73.boolean(),
22381
- schema: z73.boolean()
22676
+ hasDifferences: z74.boolean(),
22677
+ differences: z74.object({
22678
+ title: z74.boolean(),
22679
+ slug: z74.boolean(),
22680
+ content: z74.boolean(),
22681
+ seoTitle: z74.boolean(),
22682
+ seoDescription: z74.boolean(),
22683
+ noindex: z74.boolean(),
22684
+ schema: z74.boolean()
22382
22685
  })
22383
22686
  });
22384
22687
 
@@ -22561,61 +22864,61 @@ var LlmCapabilities = {
22561
22864
  var LLM_CAPABILITIES = Object.values(LlmCapabilities);
22562
22865
 
22563
22866
  // ../contracts/src/status.ts
22564
- import { z as z74 } from "zod";
22565
- var statusIntegrationSchema = z74.enum(["gsc", "ga", "gbp", "bing", "ads", "google-ads", "gtm", "traffic"]);
22867
+ import { z as z75 } from "zod";
22868
+ var statusIntegrationSchema = z75.enum(["gsc", "ga", "gbp", "bing", "ads", "google-ads", "gtm", "traffic"]);
22566
22869
  var StatusIntegrations = statusIntegrationSchema.enum;
22567
- var integrationStateSchema = z74.enum(["ok", "failing", "stale", "never-synced"]);
22870
+ var integrationStateSchema = z75.enum(["ok", "failing", "stale", "never-synced"]);
22568
22871
  var IntegrationStates = integrationStateSchema.enum;
22569
- var dateTimeSchema2 = z74.string().datetime({ offset: true });
22570
- var dateSchema = z74.string().regex(/^\d{4}-\d{2}-\d{2}$/);
22571
- var integrationStatusRowSchema = z74.object({
22872
+ var dateTimeSchema2 = z75.string().datetime({ offset: true });
22873
+ var dateSchema = z75.string().regex(/^\d{4}-\d{2}-\d{2}$/);
22874
+ var integrationStatusRowSchema = z75.object({
22572
22875
  integration: statusIntegrationSchema,
22573
- label: z74.string(),
22876
+ label: z75.string(),
22574
22877
  runKind: runKindSchema,
22575
- sourceId: z74.string().nullable(),
22878
+ sourceId: z75.string().nullable(),
22576
22879
  state: integrationStateSchema,
22577
22880
  lastSuccessAt: dateTimeSchema2.nullable(),
22578
22881
  latestRunAt: dateTimeSchema2.nullable(),
22579
- latestRunId: z74.string().nullable(),
22882
+ latestRunId: z75.string().nullable(),
22580
22883
  latestStatus: runStatusSchema.nullable(),
22581
22884
  latestTrigger: runTriggerSchema.nullable(),
22582
- consecutiveFailures: z74.number().int().nonnegative(),
22583
- latestError: z74.string().max(300).nullable(),
22885
+ consecutiveFailures: z75.number().int().nonnegative(),
22886
+ latestError: z75.string().max(300).nullable(),
22584
22887
  dataThrough: dateSchema.nullable(),
22585
- dataAgeDays: z74.number().int().nonnegative().nullable(),
22586
- doctorChecks: z74.array(z74.string())
22888
+ dataAgeDays: z75.number().int().nonnegative().nullable(),
22889
+ doctorChecks: z75.array(z75.string())
22587
22890
  });
22588
- var statusHealthSchema = z74.object({
22589
- status: z74.enum(["ok", "warn", "fail"]),
22590
- code: z74.string(),
22591
- summary: z74.string(),
22891
+ var statusHealthSchema = z75.object({
22892
+ status: z75.enum(["ok", "warn", "fail"]),
22893
+ code: z75.string(),
22894
+ summary: z75.string(),
22592
22895
  checkedAt: dateTimeSchema2,
22593
22896
  notifiedAt: dateTimeSchema2.nullable()
22594
22897
  });
22595
- var projectStatusSchema = z74.object({
22596
- project: z74.string(),
22597
- displayName: z74.string(),
22598
- state: z74.enum([...integrationStateSchema.options, "warning"]),
22898
+ var projectStatusSchema = z75.object({
22899
+ project: z75.string(),
22900
+ displayName: z75.string(),
22901
+ state: z75.enum([...integrationStateSchema.options, "warning"]),
22599
22902
  health: statusHealthSchema.nullable(),
22600
- integrations: z74.array(integrationStatusRowSchema)
22903
+ integrations: z75.array(integrationStatusRowSchema)
22601
22904
  });
22602
- var instanceStatusDtoSchema = z74.object({
22905
+ var instanceStatusDtoSchema = z75.object({
22603
22906
  generatedAt: dateTimeSchema2,
22604
22907
  mcp: mcpHealthSchema.optional(),
22605
- summary: z74.object({
22606
- projects: z74.number().int().nonnegative(),
22607
- ok: z74.number().int().nonnegative(),
22608
- failing: z74.number().int().nonnegative(),
22609
- warning: z74.number().int().nonnegative().optional(),
22610
- stale: z74.number().int().nonnegative(),
22611
- neverSynced: z74.number().int().nonnegative()
22908
+ summary: z75.object({
22909
+ projects: z75.number().int().nonnegative(),
22910
+ ok: z75.number().int().nonnegative(),
22911
+ failing: z75.number().int().nonnegative(),
22912
+ warning: z75.number().int().nonnegative().optional(),
22913
+ stale: z75.number().int().nonnegative(),
22914
+ neverSynced: z75.number().int().nonnegative()
22612
22915
  }),
22613
- projects: z74.array(projectStatusSchema)
22916
+ projects: z75.array(projectStatusSchema)
22614
22917
  });
22615
22918
 
22616
22919
  // ../contracts/src/run-dispatch.ts
22617
- import { z as z75 } from "zod";
22618
- var providerBatchRequestOutcomeSchema = z75.enum([
22920
+ import { z as z76 } from "zod";
22921
+ var providerBatchRequestOutcomeSchema = z76.enum([
22619
22922
  "recorded",
22620
22923
  "errored",
22621
22924
  "expired",
@@ -22624,7 +22927,7 @@ var providerBatchRequestOutcomeSchema = z75.enum([
22624
22927
  "duplicate"
22625
22928
  ]);
22626
22929
  var ProviderBatchRequestOutcomes = providerBatchRequestOutcomeSchema.enum;
22627
- var providerBatchIneligibilityReasonSchema = z75.enum([
22930
+ var providerBatchIneligibilityReasonSchema = z76.enum([
22628
22931
  "not_plan_run",
22629
22932
  "scoped_run",
22630
22933
  "probe_run",
@@ -22727,18 +23030,18 @@ function summarizeRunUsage(rows) {
22727
23030
  }
22728
23031
 
22729
23032
  // ../contracts/src/snapshot.ts
22730
- import { z as z76 } from "zod";
22731
- var snapshotProviderModeSchema = z76.enum(["all", "api", "browser"]);
23033
+ import { z as z77 } from "zod";
23034
+ var snapshotProviderModeSchema = z77.enum(["all", "api", "browser"]);
22732
23035
  var SnapshotProviderModes = snapshotProviderModeSchema.enum;
22733
- var snapshotAccuracySchema = z76.enum(["yes", "no", "unknown", "not-mentioned"]);
22734
- var snapshotQueryListSchema = z76.array(z76.string().min(1));
22735
- var snapshotRequestInputSchema = z76.object({
22736
- companyName: z76.string().min(1),
22737
- domain: z76.string().min(1),
23036
+ var snapshotAccuracySchema = z77.enum(["yes", "no", "unknown", "not-mentioned"]);
23037
+ var snapshotQueryListSchema = z77.array(z77.string().min(1));
23038
+ var snapshotRequestInputSchema = z77.object({
23039
+ companyName: z77.string().min(1),
23040
+ domain: z77.string().min(1),
22738
23041
  queries: snapshotQueryListSchema.optional(),
22739
23042
  phrases: snapshotQueryListSchema.optional(),
22740
- competitors: z76.array(z76.string().min(1)).optional(),
22741
- providers: z76.array(z76.string().trim().min(1)).min(1).optional().describe("Configured provider names to use for both answers and analysis. Omit to use all providers matching providerMode."),
23043
+ competitors: z77.array(z77.string().min(1)).optional(),
23044
+ providers: z77.array(z77.string().trim().min(1)).min(1).optional().describe("Configured provider names to use for both answers and analysis. Omit to use all providers matching providerMode."),
22742
23045
  providerMode: snapshotProviderModeSchema.optional().describe("Filter providers by transport; defaults to all. Browser-only selection requires manual queries and uses no API provider for analysis.")
22743
23046
  }).superRefine((input, ctx) => {
22744
23047
  if (input.queries !== void 0 && input.phrases !== void 0) {
@@ -22755,106 +23058,106 @@ var snapshotRequestSchema = snapshotRequestInputSchema.safeExtend({
22755
23058
  function resolveSnapshotRequestQueries(input) {
22756
23059
  return input.queries ?? input.phrases ?? [];
22757
23060
  }
22758
- var snapshotCompetitorEntrySchema = z76.object({
22759
- name: z76.string(),
22760
- count: z76.number().int().nonnegative()
22761
- });
22762
- var snapshotAuditFactorSchema = z76.object({
22763
- id: z76.string(),
22764
- name: z76.string(),
22765
- weight: z76.number(),
22766
- score: z76.number(),
22767
- findings: z76.array(z76.object({
22768
- type: z76.string(),
22769
- message: z76.string()
23061
+ var snapshotCompetitorEntrySchema = z77.object({
23062
+ name: z77.string(),
23063
+ count: z77.number().int().nonnegative()
23064
+ });
23065
+ var snapshotAuditFactorSchema = z77.object({
23066
+ id: z77.string(),
23067
+ name: z77.string(),
23068
+ weight: z77.number(),
23069
+ score: z77.number(),
23070
+ findings: z77.array(z77.object({
23071
+ type: z77.string(),
23072
+ message: z77.string()
22770
23073
  })).default([]),
22771
- recommendations: z76.array(z76.string()).default([])
22772
- });
22773
- var snapshotAuditSchema = z76.object({
22774
- url: z76.string(),
22775
- finalUrl: z76.string(),
22776
- auditedAt: z76.string(),
22777
- overallScore: z76.number(),
22778
- summary: z76.string(),
22779
- factors: z76.array(snapshotAuditFactorSchema).default([])
22780
- });
22781
- var snapshotProfileSchema = z76.object({
22782
- industry: z76.string(),
22783
- summary: z76.string(),
22784
- services: z76.array(z76.string()).default([]),
22785
- categoryTerms: z76.array(z76.string()).default([])
22786
- });
22787
- var snapshotProviderResultSchema = z76.object({
22788
- provider: z76.string(),
22789
- displayName: z76.string(),
22790
- model: z76.string().nullable().optional(),
22791
- mentioned: z76.boolean(),
22792
- cited: z76.boolean(),
23074
+ recommendations: z77.array(z77.string()).default([])
23075
+ });
23076
+ var snapshotAuditSchema = z77.object({
23077
+ url: z77.string(),
23078
+ finalUrl: z77.string(),
23079
+ auditedAt: z77.string(),
23080
+ overallScore: z77.number(),
23081
+ summary: z77.string(),
23082
+ factors: z77.array(snapshotAuditFactorSchema).default([])
23083
+ });
23084
+ var snapshotProfileSchema = z77.object({
23085
+ industry: z77.string(),
23086
+ summary: z77.string(),
23087
+ services: z77.array(z77.string()).default([]),
23088
+ categoryTerms: z77.array(z77.string()).default([])
23089
+ });
23090
+ var snapshotProviderResultSchema = z77.object({
23091
+ provider: z77.string(),
23092
+ displayName: z77.string(),
23093
+ model: z77.string().nullable().optional(),
23094
+ mentioned: z77.boolean(),
23095
+ cited: z77.boolean(),
22793
23096
  describedAccurately: snapshotAccuracySchema,
22794
- accuracyNotes: z76.string().nullable().optional(),
22795
- incorrectClaims: z76.array(z76.string()).default([]),
22796
- recommendedCompetitors: z76.array(z76.string()).default([]),
22797
- citedDomains: z76.array(z76.string()).default([]),
22798
- groundingSources: z76.array(groundingSourceSchema).default([]),
22799
- searchQueries: z76.array(z76.string()).default([]),
22800
- answerText: z76.string(),
22801
- error: z76.string().nullable().optional(),
23097
+ accuracyNotes: z77.string().nullable().optional(),
23098
+ incorrectClaims: z77.array(z77.string()).default([]),
23099
+ recommendedCompetitors: z77.array(z77.string()).default([]),
23100
+ citedDomains: z77.array(z77.string()).default([]),
23101
+ groundingSources: z77.array(groundingSourceSchema).default([]),
23102
+ searchQueries: z77.array(z77.string()).default([]),
23103
+ answerText: z77.string(),
23104
+ error: z77.string().nullable().optional(),
22802
23105
  /** Vendor-neutral answer evidence (answer services); absent for answer engines. */
22803
23106
  evidence: answerEvidenceSchema.nullable().optional(),
22804
23107
  /** False when the provider's sources are not tied to its answer, so `cited` was not measured. */
22805
- citationMeasured: z76.boolean().optional()
23108
+ citationMeasured: z77.boolean().optional()
22806
23109
  });
22807
- var snapshotQueryResultSchema = z76.object({
22808
- query: z76.string(),
22809
- providerResults: z76.array(snapshotProviderResultSchema).default([])
23110
+ var snapshotQueryResultSchema = z77.object({
23111
+ query: z77.string(),
23112
+ providerResults: z77.array(snapshotProviderResultSchema).default([])
22810
23113
  });
22811
- var snapshotSummarySchema = z76.object({
22812
- totalQueries: z76.number().int().nonnegative(),
22813
- totalProviders: z76.number().int().nonnegative(),
22814
- totalComparisons: z76.number().int().nonnegative(),
22815
- mentionCount: z76.number().int().nonnegative(),
23114
+ var snapshotSummarySchema = z77.object({
23115
+ totalQueries: z77.number().int().nonnegative(),
23116
+ totalProviders: z77.number().int().nonnegative(),
23117
+ totalComparisons: z77.number().int().nonnegative(),
23118
+ mentionCount: z77.number().int().nonnegative(),
22816
23119
  /** Successful responses whose citation was measured and found the domain cited; read against `citationComparisons`. */
22817
- citationCount: z76.number().int().nonnegative(),
23120
+ citationCount: z77.number().int().nonnegative(),
22818
23121
  /**
22819
23122
  * Successful responses whose citation could be measured: the denominator of
22820
23123
  * `citationCount`. Lower than `totalComparisons` when a provider's sources
22821
23124
  * are not tied to its answer, so those answers are neither cited nor not
22822
23125
  * cited. Absent on reports made before it existed (read `totalComparisons`).
22823
23126
  */
22824
- citationComparisons: z76.number().int().nonnegative().optional(),
22825
- topCompetitors: z76.array(snapshotCompetitorEntrySchema).default([]),
22826
- visibilityGap: z76.string(),
22827
- whatThisMeans: z76.array(z76.string()).default([]),
22828
- recommendedActions: z76.array(z76.string()).default([])
22829
- });
22830
- var snapshotReportSchema = z76.object({
22831
- companyName: z76.string(),
22832
- domain: z76.string(),
22833
- homepageUrl: z76.string(),
22834
- generatedAt: z76.string(),
22835
- queries: z76.array(z76.string()).default([]),
22836
- competitors: z76.array(z76.string()).default([]),
23127
+ citationComparisons: z77.number().int().nonnegative().optional(),
23128
+ topCompetitors: z77.array(snapshotCompetitorEntrySchema).default([]),
23129
+ visibilityGap: z77.string(),
23130
+ whatThisMeans: z77.array(z77.string()).default([]),
23131
+ recommendedActions: z77.array(z77.string()).default([])
23132
+ });
23133
+ var snapshotReportSchema = z77.object({
23134
+ companyName: z77.string(),
23135
+ domain: z77.string(),
23136
+ homepageUrl: z77.string(),
23137
+ generatedAt: z77.string(),
23138
+ queries: z77.array(z77.string()).default([]),
23139
+ competitors: z77.array(z77.string()).default([]),
22837
23140
  profile: snapshotProfileSchema,
22838
23141
  audit: snapshotAuditSchema,
22839
- queryResults: z76.array(snapshotQueryResultSchema).default([]),
23142
+ queryResults: z77.array(snapshotQueryResultSchema).default([]),
22840
23143
  summary: snapshotSummarySchema
22841
23144
  });
22842
23145
 
22843
23146
  // ../contracts/src/competitor-suggestions.ts
22844
- import { z as z77 } from "zod";
22845
- var competitorSuggestionsQuerySchema = z77.object({
23147
+ import { z as z78 } from "zod";
23148
+ var competitorSuggestionsQuerySchema = z78.object({
22846
23149
  window: metricsWindowSchema.optional(),
22847
- minAnswers: z77.coerce.number().int().min(1).max(1e3).optional(),
22848
- queryClass: z77.enum(["non-brand", "branded", "all"]).optional(),
22849
- groupKey: z77.string().trim().min(1).optional(),
22850
- limit: z77.coerce.number().int().min(1).max(100).optional()
23150
+ minAnswers: z78.coerce.number().int().min(1).max(1e3).optional(),
23151
+ queryClass: z78.enum(["non-brand", "branded", "all"]).optional(),
23152
+ groupKey: z78.string().trim().min(1).optional(),
23153
+ limit: z78.coerce.number().int().min(1).max(100).optional()
22851
23154
  }).strict();
22852
- var competitorSuggestionNameSchema = z77.object({
22853
- name: z77.string().trim().min(1),
22854
- answerCount: z77.number().int().nonnegative(),
22855
- pairedAnswers: z77.number().int().nonnegative()
23155
+ var competitorSuggestionNameSchema = z78.object({
23156
+ name: z78.string().trim().min(1),
23157
+ answerCount: z78.number().int().nonnegative(),
23158
+ pairedAnswers: z78.number().int().nonnegative()
22856
23159
  }).strict();
22857
- var competitorSuggestionReasonSchema = z77.enum([
23160
+ var competitorSuggestionReasonSchema = z78.enum([
22858
23161
  "below-min-answers",
22859
23162
  "not-named",
22860
23163
  "unpaired-name",
@@ -22865,56 +23168,56 @@ var competitorSuggestionReasonSchema = z77.enum([
22865
23168
  "shared-host"
22866
23169
  ]);
22867
23170
  var CompetitorSuggestionReasons = competitorSuggestionReasonSchema.enum;
22868
- var competitorSuggestionStatusSchema = z77.enum(["suggested", "tracked", "excluded"]);
23171
+ var competitorSuggestionStatusSchema = z78.enum(["suggested", "tracked", "excluded"]);
22869
23172
  var CompetitorSuggestionStatuses = competitorSuggestionStatusSchema.enum;
22870
- var competitorSuggestionSchema = z77.object({
22871
- domain: z77.string().trim().min(1),
22872
- label: z77.string().trim().min(1),
22873
- names: z77.array(competitorSuggestionNameSchema).max(5),
22874
- namingAnswers: z77.number().int().nonnegative(),
22875
- citingAnswers: z77.number().int().nonnegative(),
22876
- bothAnswers: z77.number().int().nonnegative(),
22877
- pairedAnswers: z77.number().int().nonnegative(),
22878
- namedByOtherNameAnswers: z77.number().int().nonnegative(),
22879
- sweeps: z77.number().int().nonnegative(),
22880
- firstSeenAt: z77.string().datetime().nullable(),
22881
- lastSeenAt: z77.string().datetime().nullable(),
23173
+ var competitorSuggestionSchema = z78.object({
23174
+ domain: z78.string().trim().min(1),
23175
+ label: z78.string().trim().min(1),
23176
+ names: z78.array(competitorSuggestionNameSchema).max(5),
23177
+ namingAnswers: z78.number().int().nonnegative(),
23178
+ citingAnswers: z78.number().int().nonnegative(),
23179
+ bothAnswers: z78.number().int().nonnegative(),
23180
+ pairedAnswers: z78.number().int().nonnegative(),
23181
+ namedByOtherNameAnswers: z78.number().int().nonnegative(),
23182
+ sweeps: z78.number().int().nonnegative(),
23183
+ firstSeenAt: z78.string().datetime().nullable(),
23184
+ lastSeenAt: z78.string().datetime().nullable(),
22882
23185
  surfaceClass: competitorLandscapeSurfaceClassSchema,
22883
- tracked: z77.boolean(),
22884
- marketKeys: z77.array(z77.string().trim().min(1)).optional(),
23186
+ tracked: z78.boolean(),
23187
+ marketKeys: z78.array(z78.string().trim().min(1)).optional(),
22885
23188
  status: competitorSuggestionStatusSchema,
22886
23189
  reason: competitorSuggestionReasonSchema.nullable(),
22887
- sampleUrls: z77.array(z77.string().url()).max(3)
23190
+ sampleUrls: z78.array(z78.string().url()).max(3)
22888
23191
  }).strict();
22889
- var competitorSuggestionsResponseSchema = z77.object({
22890
- project: z77.string().trim().min(1),
23192
+ var competitorSuggestionsResponseSchema = z78.object({
23193
+ project: z78.string().trim().min(1),
22891
23194
  window: metricsWindowSchema,
22892
23195
  scope: competitorLandscapeScopeSchema,
22893
- filters: z77.object({
22894
- queryClass: z77.enum(["non-brand", "branded", "all"]),
22895
- groupKey: z77.string().nullable(),
22896
- limit: z77.number().int().positive(),
22897
- minAnswers: z77.number().int().positive()
23196
+ filters: z78.object({
23197
+ queryClass: z78.enum(["non-brand", "branded", "all"]),
23198
+ groupKey: z78.string().nullable(),
23199
+ limit: z78.number().int().positive(),
23200
+ minAnswers: z78.number().int().positive()
22898
23201
  }).strict(),
22899
- thresholds: z77.object({ minAnswers: z77.number().int().positive() }).strict(),
22900
- candidates: z77.array(competitorSuggestionSchema),
22901
- candidatesTotal: z77.number().int().nonnegative(),
22902
- excludedCounts: z77.record(z77.string(), z77.number().int().nonnegative()),
22903
- unresolvedNames: z77.array(z77.object({ name: z77.string().trim().min(1), answerCount: z77.number().int().nonnegative() }).strict()),
22904
- evidence: z77.object({
22905
- answeredResults: z77.number().int().nonnegative(),
22906
- sourceResults: z77.number().int().nonnegative(),
22907
- excludedProbeResults: z77.number().int().nonnegative(),
22908
- excludedNonCompletedResults: z77.number().int().nonnegative()
23202
+ thresholds: z78.object({ minAnswers: z78.number().int().positive() }).strict(),
23203
+ candidates: z78.array(competitorSuggestionSchema),
23204
+ candidatesTotal: z78.number().int().nonnegative(),
23205
+ excludedCounts: z78.record(z78.string(), z78.number().int().nonnegative()),
23206
+ unresolvedNames: z78.array(z78.object({ name: z78.string().trim().min(1), answerCount: z78.number().int().nonnegative() }).strict()),
23207
+ evidence: z78.object({
23208
+ answeredResults: z78.number().int().nonnegative(),
23209
+ sourceResults: z78.number().int().nonnegative(),
23210
+ excludedProbeResults: z78.number().int().nonnegative(),
23211
+ excludedNonCompletedResults: z78.number().int().nonnegative()
22909
23212
  }).strict(),
22910
- runCount: z77.number().int().nonnegative(),
22911
- runIds: z77.array(z77.string()),
22912
- countUnits: z77.object({
22913
- answers: z77.array(z77.string()),
22914
- distinctNames: z77.array(z77.string()),
22915
- runs: z77.array(z77.string())
23213
+ runCount: z78.number().int().nonnegative(),
23214
+ runIds: z78.array(z78.string()),
23215
+ countUnits: z78.object({
23216
+ answers: z78.array(z78.string()),
23217
+ distinctNames: z78.array(z78.string()),
23218
+ runs: z78.array(z78.string())
22916
23219
  }).strict(),
22917
- truncated: z77.boolean()
23220
+ truncated: z78.boolean()
22918
23221
  }).strict();
22919
23222
  var COMPETITOR_SUGGESTION_COUNT_UNITS = {
22920
23223
  ...COMPETITOR_LANDSCAPE_COUNT_UNITS,
@@ -22932,9 +23235,9 @@ var COMPETITOR_SUGGESTION_COUNT_UNITS = {
22932
23235
  };
22933
23236
 
22934
23237
  // ../contracts/src/intelligence.ts
22935
- import { z as z78 } from "zod";
22936
- var insightSeveritySchema = z78.enum(["critical", "high", "medium", "low"]);
22937
- var insightActionGroupSchema = z78.enum(["write", "investigate", "monitor"]);
23238
+ import { z as z79 } from "zod";
23239
+ var insightSeveritySchema = z79.enum(["critical", "high", "medium", "low"]);
23240
+ var insightActionGroupSchema = z79.enum(["write", "investigate", "monitor"]);
22938
23241
  var InsightActionGroups = insightActionGroupSchema.enum;
22939
23242
  var insightActionGroupByType = {
22940
23243
  // Content-required: a missing or competitive answer needs new or updated material.
@@ -22956,10 +23259,10 @@ var insightActionGroupByType = {
22956
23259
  "gbp-metric-drop": InsightActionGroups.investigate,
22957
23260
  "gbp-keyword-drop": InsightActionGroups.investigate
22958
23261
  };
22959
- var healthSnapshotDtoSchema = z78.object({
22960
- id: z78.string(),
22961
- projectId: z78.string(),
22962
- runId: z78.string().nullable(),
23262
+ var healthSnapshotDtoSchema = z79.object({
23263
+ id: z79.string(),
23264
+ projectId: z79.string(),
23265
+ runId: z79.string().nullable(),
22963
23266
  overallCitedRate: fraction(),
22964
23267
  /**
22965
23268
  * Share of (query × provider) pairs where the project was MENTIONED in the
@@ -22968,46 +23271,50 @@ var healthSnapshotDtoSchema = z78.object({
22968
23271
  * as 0 (the API coalesces NULL→0).
22969
23272
  */
22970
23273
  overallMentionRate: fraction(),
22971
- totalPairs: z78.number().int().nonnegative(),
22972
- citedPairs: z78.number().int().nonnegative(),
23274
+ totalPairs: z79.number().int().nonnegative(),
23275
+ citedPairs: z79.number().int().nonnegative(),
22973
23276
  /** Count of pairs mentioned in the answer text. Legacy rows read back as 0. */
22974
- mentionedPairs: z78.number().int().nonnegative(),
22975
- providerBreakdown: z78.record(z78.string(), z78.object({
23277
+ mentionedPairs: z79.number().int().nonnegative(),
23278
+ providerBreakdown: z79.record(z79.string(), z79.object({
22976
23279
  citedRate: fraction(),
22977
23280
  mentionRate: fraction(),
22978
- cited: z78.number().int().nonnegative(),
22979
- mentioned: z78.number().int().nonnegative(),
22980
- total: z78.number().int().nonnegative()
23281
+ cited: z79.number().int().nonnegative(),
23282
+ mentioned: z79.number().int().nonnegative(),
23283
+ total: z79.number().int().nonnegative()
22981
23284
  })),
22982
- createdAt: z78.string(),
23285
+ createdAt: z79.string(),
22983
23286
  /**
22984
23287
  * `'ready'` when the snapshot reflects real data; `'no-data'` for the
22985
23288
  * sentinel returned by `/health/latest` when a project has no health
22986
23289
  * snapshots yet (newly created, or only failed runs). Numeric fields are
22987
23290
  * zero and `providerBreakdown` is `{}` in the no-data case.
22988
23291
  */
22989
- status: z78.enum(["ready", "no-data"]),
23292
+ status: z79.enum(["ready", "no-data"]),
22990
23293
  /** Reason for `status === 'no-data'`. Absent when `status === 'ready'`. */
22991
- reason: z78.literal("no-runs-yet").optional()
23294
+ reason: z79.literal("no-runs-yet").optional()
22992
23295
  });
22993
23296
 
22994
23297
  // ../contracts/src/agent.ts
22995
- import { z as z79 } from "zod";
22996
- var agentViewContextSchema = z79.object({
22997
- view: z79.enum(["project", "visibility", "property", "queries", "site-health"]),
22998
- unavailableReason: z79.string().trim().min(1).max(512).optional(),
23298
+ import { z as z80 } from "zod";
23299
+ var agentViewContextSchema = z80.object({
23300
+ view: z80.enum(["project", "visibility", "property", "queries", "site-health", "seo"]),
23301
+ seoProfileId: z80.string().trim().min(1).max(128).optional(),
23302
+ seoRunId: z80.string().trim().min(1).max(128).optional(),
23303
+ unavailableReason: z80.string().trim().min(1).max(512).optional(),
22999
23304
  selection: visibilityReportRequestSchema.optional(),
23000
- page: z79.object({
23001
- runId: z79.string().trim().min(1).max(256).optional(),
23002
- nodeKey: z79.string().trim().min(1).max(2048).optional()
23305
+ page: z80.object({
23306
+ runId: z80.string().trim().min(1).max(256).optional(),
23307
+ nodeKey: z80.string().trim().min(1).max(2048).optional()
23003
23308
  }).strict().optional()
23004
23309
  }).strict().superRefine((value, ctx) => {
23310
+ if (value.seoProfileId && value.view !== "seo") ctx.addIssue({ code: "custom", message: "SEO profile context requires the SEO view." });
23311
+ if (value.seoRunId && value.view !== "seo") ctx.addIssue({ code: "custom", message: "SEO run context requires the SEO view." });
23005
23312
  if (value.page && value.view !== "site-health") ctx.addIssue({ code: "custom", message: "Page context requires Site Health." });
23006
23313
  if (value.selection && !["visibility", "property", "queries"].includes(value.view)) ctx.addIssue({ code: "custom", message: "Measurement selection requires a measurement view." });
23007
23314
  });
23008
- var agentTurnLimitsSchema = z79.object({
23009
- maxToolCalls: z79.number().int().min(1).max(100).default(30),
23010
- timeoutMs: z79.number().int().min(1e3).max(6e5).default(18e4)
23315
+ var agentTurnLimitsSchema = z80.object({
23316
+ maxToolCalls: z80.number().int().min(1).max(100).default(30),
23317
+ timeoutMs: z80.number().int().min(1e3).max(6e5).default(18e4)
23011
23318
  }).strict();
23012
23319
  function agentVisibilityEvidence(report, project, retrievedAt) {
23013
23320
  const selection = report.selection;
@@ -23050,34 +23357,34 @@ function agentVisibilityEvidence(report, project, retrievedAt) {
23050
23357
  ))
23051
23358
  };
23052
23359
  }
23053
- var agentProviderIdSchema = z79.enum(["claude", "openai", "gemini", "zai", "openrouter"]);
23054
- var agentProviderOptionDtoSchema = z79.object({
23360
+ var agentProviderIdSchema = z80.enum(["claude", "openai", "gemini", "zai", "openrouter"]);
23361
+ var agentProviderOptionDtoSchema = z80.object({
23055
23362
  /** Stable identifier — what clients pass back as `provider` on the prompt endpoint. */
23056
23363
  id: agentProviderIdSchema,
23057
23364
  /** Human-readable label for UI pickers, e.g. "Anthropic (Claude)". */
23058
- label: z79.string(),
23365
+ label: z80.string(),
23059
23366
  /** Default model if the caller doesn't pick one. */
23060
- defaultModel: z79.string(),
23367
+ defaultModel: z80.string(),
23061
23368
  /** Whether a usable API key was found (config.yaml or provider env var). */
23062
- configured: z79.boolean(),
23369
+ configured: z80.boolean(),
23063
23370
  /**
23064
23371
  * Where the key resolved from, if any. `null` when `configured === false`.
23065
23372
  * Surfaced so the UI can nudge users toward their preferred source of truth.
23066
23373
  */
23067
- keySource: z79.enum(["config", "env"]).nullable(),
23374
+ keySource: z80.enum(["config", "env"]).nullable(),
23068
23375
  /**
23069
23376
  * A short list of models to offer for this provider: the default first,
23070
23377
  * then a few stronger current models. A pinned model outside the list is
23071
23378
  * listed first. Any other model ID can still be requested.
23072
23379
  */
23073
- models: z79.array(z79.object({ id: z79.string(), displayName: z79.string() })).optional()
23380
+ models: z80.array(z80.object({ id: z80.string(), displayName: z80.string() })).optional()
23074
23381
  });
23075
- var agentProvidersResponseDtoSchema = z79.object({
23382
+ var agentProvidersResponseDtoSchema = z80.object({
23076
23383
  /**
23077
23384
  * Every provider Aero knows about. `configured === false` entries are
23078
23385
  * included so the UI can render them disabled with an onboarding hint.
23079
23386
  */
23080
- providers: z79.array(agentProviderOptionDtoSchema).default([]),
23387
+ providers: z80.array(agentProviderOptionDtoSchema).default([]),
23081
23388
  /**
23082
23389
  * Provider a new session uses when the caller names none: the
23083
23390
  * `agent.provider` pin when set (reported even without a key, as its
@@ -23087,50 +23394,50 @@ var agentProvidersResponseDtoSchema = z79.object({
23087
23394
  */
23088
23395
  defaultProvider: agentProviderIdSchema.nullable()
23089
23396
  });
23090
- var memorySourceSchema = z79.enum(["aero", "user", "compaction"]);
23397
+ var memorySourceSchema = z80.enum(["aero", "user", "compaction"]);
23091
23398
  var MemorySources = memorySourceSchema.enum;
23092
23399
  var AGENT_MEMORY_VALUE_MAX_BYTES = 2 * 1024;
23093
23400
  var AGENT_MEMORY_KEY_MAX_LENGTH = 128;
23094
- var agentMemoryUpsertRequestSchema = z79.object({
23095
- key: z79.string().min(1).max(AGENT_MEMORY_KEY_MAX_LENGTH),
23096
- value: z79.string().min(1)
23401
+ var agentMemoryUpsertRequestSchema = z80.object({
23402
+ key: z80.string().min(1).max(AGENT_MEMORY_KEY_MAX_LENGTH),
23403
+ value: z80.string().min(1)
23097
23404
  });
23098
- var agentMemoryDeleteRequestSchema = z79.object({
23099
- key: z79.string().min(1).max(AGENT_MEMORY_KEY_MAX_LENGTH)
23405
+ var agentMemoryDeleteRequestSchema = z80.object({
23406
+ key: z80.string().min(1).max(AGENT_MEMORY_KEY_MAX_LENGTH)
23100
23407
  });
23101
- var agentPromptRequestSchema = z79.object({
23102
- prompt: z79.string().trim().min(1),
23103
- conversationId: z79.string().min(1).nullable().optional(),
23408
+ var agentPromptRequestSchema = z80.object({
23409
+ prompt: z80.string().trim().min(1),
23410
+ conversationId: z80.string().min(1).nullable().optional(),
23104
23411
  provider: agentProviderIdSchema.optional(),
23105
- modelId: z79.string().trim().min(1).optional(),
23106
- scope: z79.enum(["all", "read-only"]).optional(),
23107
- profile: z79.enum(["default", "ads-operator"]).optional(),
23412
+ modelId: z80.string().trim().min(1).optional(),
23413
+ scope: z80.enum(["all", "read-only"]).optional(),
23414
+ profile: z80.enum(["default", "ads-operator"]).optional(),
23108
23415
  context: agentViewContextSchema.optional(),
23109
23416
  limits: agentTurnLimitsSchema.optional()
23110
23417
  });
23111
- var agentConversationMessageSchema = z79.looseObject({ role: z79.string(), content: z79.unknown().optional() });
23112
- var agentConversationSummarySchema = z79.object({
23113
- id: z79.string(),
23114
- title: z79.string(),
23115
- active: z79.boolean(),
23116
- modelProvider: z79.string(),
23117
- modelId: z79.string(),
23118
- createdAt: z79.string(),
23119
- updatedAt: z79.string()
23418
+ var agentConversationMessageSchema = z80.looseObject({ role: z80.string(), content: z80.unknown().optional() });
23419
+ var agentConversationSummarySchema = z80.object({
23420
+ id: z80.string(),
23421
+ title: z80.string(),
23422
+ active: z80.boolean(),
23423
+ modelProvider: z80.string(),
23424
+ modelId: z80.string(),
23425
+ createdAt: z80.string(),
23426
+ updatedAt: z80.string()
23120
23427
  });
23121
23428
  var agentConversationSchema = agentConversationSummarySchema.extend({
23122
- messages: z79.array(agentConversationMessageSchema),
23123
- isStreaming: z79.boolean()
23429
+ messages: z80.array(agentConversationMessageSchema),
23430
+ isStreaming: z80.boolean()
23124
23431
  });
23125
- var agentConversationListSchema = z79.object({
23126
- conversations: z79.array(agentConversationSummarySchema),
23127
- currentConversationId: z79.string().nullable(),
23128
- nextOffset: z79.number().int().nullable()
23432
+ var agentConversationListSchema = z80.object({
23433
+ conversations: z80.array(agentConversationSummarySchema),
23434
+ currentConversationId: z80.string().nullable(),
23435
+ nextOffset: z80.number().int().nullable()
23129
23436
  });
23130
- var agentConversationCreateSchema = z79.object({
23131
- id: z79.uuid()
23437
+ var agentConversationCreateSchema = z80.object({
23438
+ id: z80.uuid()
23132
23439
  }).strict();
23133
- var agentConversationDeleteSchema = z79.object({ id: z79.string(), status: z79.literal("deleted") });
23440
+ var agentConversationDeleteSchema = z80.object({ id: z80.string(), status: z80.literal("deleted") });
23134
23441
  function agentConversationTitle(messages) {
23135
23442
  for (const message of messages) {
23136
23443
  if (message.role !== "user") continue;
@@ -23142,49 +23449,49 @@ function agentConversationTitle(messages) {
23142
23449
  return "New conversation";
23143
23450
  }
23144
23451
  var aeroPreviewStarterIds = ["status", "changes", "gaps", "insights"];
23145
- var aeroPreviewStarterIdSchema = z79.enum(aeroPreviewStarterIds);
23146
- var aeroPreviewStepSchema = z79.object({
23452
+ var aeroPreviewStarterIdSchema = z80.enum(aeroPreviewStarterIds);
23453
+ var aeroPreviewStepSchema = z80.object({
23147
23454
  /** Assistant text shown before the tool call, when the turn narrates it. */
23148
- text: z79.string().optional(),
23149
- tool: z79.object({
23455
+ text: z80.string().optional(),
23456
+ tool: z80.object({
23150
23457
  /** Real Canonry MCP tool name, such as canonry_visibility_report. */
23151
- name: z79.string(),
23458
+ name: z80.string(),
23152
23459
  /** The tool's registered title, which the live bar shows as the card label. */
23153
- label: z79.string(),
23154
- arguments: z79.record(z79.string(), z79.unknown()),
23460
+ label: z80.string(),
23461
+ arguments: z80.record(z80.string(), z80.unknown()),
23155
23462
  /** A compact excerpt of the stored result, not the full payload. */
23156
- result: z79.unknown(),
23157
- durationMs: z79.number().int().nonnegative()
23463
+ result: z80.unknown(),
23464
+ durationMs: z80.number().int().nonnegative()
23158
23465
  })
23159
23466
  });
23160
- var aeroPreviewStarterSchema = z79.object({
23467
+ var aeroPreviewStarterSchema = z80.object({
23161
23468
  id: aeroPreviewStarterIdSchema,
23162
- steps: z79.array(aeroPreviewStepSchema),
23469
+ steps: z80.array(aeroPreviewStepSchema),
23163
23470
  /** Final assistant markdown. */
23164
- answer: z79.string()
23471
+ answer: z80.string()
23165
23472
  });
23166
- var aeroPreviewResponseSchema = z79.object({
23167
- project: z79.string(),
23168
- seededAt: z79.string(),
23169
- starters: z79.array(aeroPreviewStarterSchema)
23473
+ var aeroPreviewResponseSchema = z80.object({
23474
+ project: z80.string(),
23475
+ seededAt: z80.string(),
23476
+ starters: z80.array(aeroPreviewStarterSchema)
23170
23477
  });
23171
- var agentConversationListQuerySchema = z79.object({
23172
- offset: z79.coerce.number().int().min(0).default(0),
23173
- limit: z79.coerce.number().int().min(1).max(100).default(50)
23478
+ var agentConversationListQuerySchema = z80.object({
23479
+ offset: z80.coerce.number().int().min(0).default(0),
23480
+ limit: z80.coerce.number().int().min(1).max(100).default(50)
23174
23481
  }).strict();
23175
23482
 
23176
23483
  // ../contracts/src/sentiment.ts
23177
- import { z as z80 } from "zod";
23484
+ import { z as z81 } from "zod";
23178
23485
  var SENTIMENT_MODEL = "jev-1.13.0";
23179
23486
  var SENTIMENT_OPENROUTER_MODEL = "typesafe/jev-1.13";
23180
23487
  var SENTIMENT_OPENROUTER_SERVED_MODEL = "typesafe/jev-1.13-20260917";
23181
- var sentimentEvaluatorProviderSchema = z80.enum(["typesafe", "openrouter"]);
23488
+ var sentimentEvaluatorProviderSchema = z81.enum(["typesafe", "openrouter"]);
23182
23489
  var SENTIMENT_INTERVAL_LIMITATION = "Wilson 95% intervals assume independent observations. They exclude classifier error and dependence among related queries, Properties, and sweeps.";
23183
- var id = z80.string().trim().min(1).max(256);
23184
- var count = z80.number().int().nonnegative();
23185
- var runIds = z80.preprocess((value) => typeof value === "string" ? [value] : value, z80.array(id).min(1).max(100));
23186
- var rate = fraction(z80.number().min(0).max(1)).nullable();
23187
- var sentimentOutcomeSchema = z80.enum([
23490
+ var id = z81.string().trim().min(1).max(256);
23491
+ var count = z81.number().int().nonnegative();
23492
+ var runIds = z81.preprocess((value) => typeof value === "string" ? [value] : value, z81.array(id).min(1).max(100));
23493
+ var rate = fraction(z81.number().min(0).max(1)).nullable();
23494
+ var sentimentOutcomeSchema = z81.enum([
23188
23495
  "favorable",
23189
23496
  "mixed",
23190
23497
  "unfavorable",
@@ -23205,22 +23512,22 @@ var sentimentOutcomeSchema = z80.enum([
23205
23512
  "canceled"
23206
23513
  ]);
23207
23514
  var SentimentOutcomes = sentimentOutcomeSchema.enum;
23208
- var sentimentStateSchema = z80.enum(["disabled", "not-measured", "processing", "partial", "complete", "failed", "canceled", "unsupported"]);
23209
- var sentimentEvaluationDefinitionSchema = z80.object({
23210
- schemaVersion: z80.union([z80.literal(1), z80.literal(2)]),
23211
- requestedModel: z80.enum([SENTIMENT_MODEL, SENTIMENT_OPENROUTER_MODEL]),
23515
+ var sentimentStateSchema = z81.enum(["disabled", "not-measured", "processing", "partial", "complete", "failed", "canceled", "unsupported"]);
23516
+ var sentimentEvaluationDefinitionSchema = z81.object({
23517
+ schemaVersion: z81.union([z81.literal(1), z81.literal(2)]),
23518
+ requestedModel: z81.enum([SENTIMENT_MODEL, SENTIMENT_OPENROUTER_MODEL]),
23212
23519
  /** Omitted on historical direct TypeSafe definitions to preserve their immutable identity. */
23213
23520
  provider: sentimentEvaluatorProviderSchema.optional(),
23214
- expectedReturnedModel: z80.literal(SENTIMENT_OPENROUTER_SERVED_MODEL).optional(),
23521
+ expectedReturnedModel: z81.literal(SENTIMENT_OPENROUTER_SERVED_MODEL).optional(),
23215
23522
  verdictVersion: id,
23216
23523
  identityVersion: id,
23217
23524
  evidenceVersion: id,
23218
23525
  segmentationVersion: id,
23219
23526
  preprocessingVersion: id,
23220
- languagePolicy: z80.literal("en-only"),
23221
- comparisonMethodVersion: z80.literal("wilson-independent-v1"),
23222
- confidenceThreshold: z80.number().min(0).max(1).nullable(),
23223
- questions: z80.object({ identity: z80.string(), judgment: z80.string(), stance: z80.string(), conclusion: z80.string(), complaint: z80.string() }).strict()
23527
+ languagePolicy: z81.literal("en-only"),
23528
+ comparisonMethodVersion: z81.literal("wilson-independent-v1"),
23529
+ confidenceThreshold: z81.number().min(0).max(1).nullable(),
23530
+ questions: z81.object({ identity: z81.string(), judgment: z81.string(), stance: z81.string(), conclusion: z81.string(), complaint: z81.string() }).strict()
23224
23531
  }).strict().superRefine((definition, ctx) => {
23225
23532
  const routed = definition.provider === "openrouter";
23226
23533
  if (definition.requestedModel !== (routed ? SENTIMENT_OPENROUTER_MODEL : SENTIMENT_MODEL) || (routed ? definition.expectedReturnedModel !== SENTIMENT_OPENROUTER_SERVED_MODEL : definition.expectedReturnedModel !== void 0)) {
@@ -23263,7 +23570,7 @@ function storedDefinitionProjection(value) {
23263
23570
  if (typeof projected.questions === "object" && projected.questions !== null) projected.questions = Object.fromEntries(Object.entries(projected.questions).filter(([key]) => key !== "theme"));
23264
23571
  return projected;
23265
23572
  }
23266
- var storedSentimentEvaluationDefinitionSchema = z80.preprocess(storedDefinitionProjection, sentimentEvaluationDefinitionSchema);
23573
+ var storedSentimentEvaluationDefinitionSchema = z81.preprocess(storedDefinitionProjection, sentimentEvaluationDefinitionSchema);
23267
23574
  function canonicalSentimentJson(value) {
23268
23575
  function canonical(item) {
23269
23576
  if (Array.isArray(item)) return item.map(canonical);
@@ -23272,69 +23579,69 @@ function canonicalSentimentJson(value) {
23272
23579
  }
23273
23580
  return JSON.stringify(canonical(value));
23274
23581
  }
23275
- var sentimentSubjectSchema = z80.object({ id, displayName: z80.string(), aliases: z80.array(z80.string()), qualifiedAliases: z80.array(z80.string()).default([]), urls: z80.array(z80.string()), mentionNotApplicable: z80.boolean() }).strict();
23276
- var sentimentUsageEdgeSchema = z80.object({ queryId: id, executionNodeKey: id.nullable(), targetId: id, propertyId: id.nullable(), groupId: id.nullable(), marketId: id.nullable(), queryClass: z80.enum(["branded", "non-brand"]), queryText: z80.string().optional(), location: z80.string().nullable() }).strict();
23277
- var sentimentExecutionContextSchema = z80.object({
23582
+ var sentimentSubjectSchema = z81.object({ id, displayName: z81.string(), aliases: z81.array(z81.string()), qualifiedAliases: z81.array(z81.string()).default([]), urls: z81.array(z81.string()), mentionNotApplicable: z81.boolean() }).strict();
23583
+ var sentimentUsageEdgeSchema = z81.object({ queryId: id, executionNodeKey: id.nullable(), targetId: id, propertyId: id.nullable(), groupId: id.nullable(), marketId: id.nullable(), queryClass: z81.enum(["branded", "non-brand"]), queryText: z81.string().optional(), location: z81.string().nullable() }).strict();
23584
+ var sentimentExecutionContextSchema = z81.object({
23278
23585
  queryId: id,
23279
- queryText: z80.string(),
23280
- queryClass: z80.enum(["branded", "non-brand"]),
23586
+ queryText: z81.string(),
23587
+ queryClass: z81.enum(["branded", "non-brand"]),
23281
23588
  provider: id,
23282
- requestedModel: z80.string().nullable(),
23283
- servedModel: z80.string().nullable(),
23284
- location: z80.string().nullable(),
23285
- revision: z80.number().int().nullable(),
23286
- usageEdges: z80.array(sentimentUsageEdgeSchema),
23589
+ requestedModel: z81.string().nullable(),
23590
+ servedModel: z81.string().nullable(),
23591
+ location: z81.string().nullable(),
23592
+ revision: z81.number().int().nullable(),
23593
+ usageEdges: z81.array(sentimentUsageEdgeSchema),
23287
23594
  locationContext: locationContextSchema.nullable().default(null)
23288
23595
  }).strict();
23289
- var sentimentEvidenceSchema = z80.object({ id, text: z80.string().min(1), start: count, end: count }).strict();
23290
- var sentimentUsageSchema = z80.object({ kind: z80.enum(["reported", "estimated", "unknown"]), inputTokens: count.nullable(), outputTokens: count.nullable() }).strict();
23291
- var sentimentClassifierInputSchema = z80.object({
23596
+ var sentimentEvidenceSchema = z81.object({ id, text: z81.string().min(1), start: count, end: count }).strict();
23597
+ var sentimentUsageSchema = z81.object({ kind: z81.enum(["reported", "estimated", "unknown"]), inputTokens: count.nullable(), outputTokens: count.nullable() }).strict();
23598
+ var sentimentClassifierInputSchema = z81.object({
23292
23599
  sourceSnapshotId: id,
23293
- sourceText: z80.string(),
23600
+ sourceText: z81.string(),
23294
23601
  sourceTextHash: id,
23295
23602
  subject: sentimentSubjectSchema,
23296
23603
  subjectHash: id,
23297
23604
  context: sentimentExecutionContextSchema,
23298
- language: z80.string(),
23605
+ language: z81.string(),
23299
23606
  definition: sentimentEvaluationDefinitionSchema,
23300
- sentences: z80.array(sentimentEvidenceSchema)
23607
+ sentences: z81.array(sentimentEvidenceSchema)
23301
23608
  }).strict();
23302
- var storedSentimentClassifierInputSchema = z80.preprocess((value) => {
23609
+ var storedSentimentClassifierInputSchema = z81.preprocess((value) => {
23303
23610
  if (typeof value !== "object" || value === null || !("definition" in value)) return value;
23304
23611
  return { ...value, definition: storedDefinitionProjection(value.definition) };
23305
23612
  }, sentimentClassifierInputSchema);
23306
- var classifierCommon = { returnedModel: z80.string().nullable(), usage: sentimentUsageSchema };
23307
- var sentimentClassifierOutputSchema = z80.discriminatedUnion("kind", [
23308
- z80.object({
23309
- kind: z80.literal("classified"),
23613
+ var classifierCommon = { returnedModel: z81.string().nullable(), usage: sentimentUsageSchema };
23614
+ var sentimentClassifierOutputSchema = z81.discriminatedUnion("kind", [
23615
+ z81.object({
23616
+ kind: z81.literal("classified"),
23310
23617
  ...classifierCommon,
23311
- returnedModel: z80.string(),
23618
+ returnedModel: z81.string(),
23312
23619
  outcome: sentimentOutcomeSchema,
23313
- conclusion: z80.array(sentimentEvidenceSchema),
23314
- complaint: z80.array(sentimentEvidenceSchema).nullable(),
23315
- confidence: z80.number().min(0).max(1).nullable()
23620
+ conclusion: z81.array(sentimentEvidenceSchema),
23621
+ complaint: z81.array(sentimentEvidenceSchema).nullable(),
23622
+ confidence: z81.number().min(0).max(1).nullable()
23316
23623
  }).strict(),
23317
- z80.object({ kind: z80.literal("abstained"), ...classifierCommon, outcome: sentimentOutcomeSchema, reason: z80.string() }).strict(),
23318
- z80.object({ kind: z80.literal("failed"), ...classifierCommon, outcome: z80.literal("failed"), error: z80.object({ code: id, message: z80.string(), retryable: z80.boolean(), retryAfterMs: z80.number().nonnegative().nullable() }).strict() }).strict()
23624
+ z81.object({ kind: z81.literal("abstained"), ...classifierCommon, outcome: sentimentOutcomeSchema, reason: z81.string() }).strict(),
23625
+ z81.object({ kind: z81.literal("failed"), ...classifierCommon, outcome: z81.literal("failed"), error: z81.object({ code: id, message: z81.string(), retryable: z81.boolean(), retryAfterMs: z81.number().nonnegative().nullable() }).strict() }).strict()
23319
23626
  ]).superRefine((result, ctx) => {
23320
23627
  if (result.kind === "classified" && ["favorable", "mixed", "unfavorable"].includes(result.outcome) && result.conclusion.length === 0) {
23321
23628
  ctx.addIssue({ code: "custom", path: ["conclusion"], message: "Judgments require conclusion evidence" });
23322
23629
  }
23323
23630
  });
23324
- var storedSentimentClassifierOutputSchema = z80.preprocess((value) => typeof value === "object" && value !== null ? Object.fromEntries(Object.entries(value).filter(([key]) => key !== "themes")) : value, sentimentClassifierOutputSchema);
23325
- var sentimentSelectionBaseSchema = z80.object({
23631
+ var storedSentimentClassifierOutputSchema = z81.preprocess((value) => typeof value === "object" && value !== null ? Object.fromEntries(Object.entries(value).filter(([key]) => key !== "themes")) : value, sentimentClassifierOutputSchema);
23632
+ var sentimentSelectionBaseSchema = z81.object({
23326
23633
  runId: id.optional(),
23327
23634
  runIds: runIds.optional(),
23328
- revision: z80.coerce.number().int().positive().optional(),
23329
- mode: z80.enum(["auto", "simple", "advanced"]).default("auto"),
23330
- queryClass: z80.enum(["branded", "non-brand"]).default("branded"),
23331
- scope: z80.enum(["project", "property", "group", "market"]).default("project"),
23635
+ revision: z81.coerce.number().int().positive().optional(),
23636
+ mode: z81.enum(["auto", "simple", "advanced"]).default("auto"),
23637
+ queryClass: z81.enum(["branded", "non-brand"]).default("branded"),
23638
+ scope: z81.enum(["project", "property", "group", "market"]).default("project"),
23332
23639
  queryId: id.optional(),
23333
23640
  scopeKey: id.optional(),
23334
23641
  marketKey: id.optional(),
23335
23642
  provider: id.optional(),
23336
23643
  model: id.optional(),
23337
- location: z80.string().min(1).optional(),
23644
+ location: z81.string().min(1).optional(),
23338
23645
  evaluationDefinitionId: id.optional(),
23339
23646
  /** Exact frozen Advanced execution node of the selected query. Identity: it narrows the assessed population. */
23340
23647
  executionNodeKey: id.optional()
@@ -23344,26 +23651,26 @@ function exclusiveSentimentRuns(value, ctx) {
23344
23651
  if (value.runIds && new Set(value.runIds).size !== value.runIds.length) ctx.addIssue({ code: "custom", path: ["runIds"], message: "Run IDs must be unique." });
23345
23652
  }
23346
23653
  var sentimentSelectionSchema = sentimentSelectionBaseSchema.superRefine(exclusiveSentimentRuns);
23347
- var sentimentSummaryIncludeSchema = z80.enum(["assessments", "locations"]);
23654
+ var sentimentSummaryIncludeSchema = z81.enum(["assessments", "locations"]);
23348
23655
  var SENTIMENT_QUERY_PAGE_DEFAULT = 25;
23349
23656
  var SENTIMENT_QUERY_PAGE_MAX = 500;
23350
23657
  var sentimentSummaryRequestSchema = sentimentSelectionBaseSchema.extend({
23351
- include: z80.preprocess((value) => typeof value === "string" ? value.split(",").map((item) => item.trim()).filter(Boolean) : value, z80.array(sentimentSummaryIncludeSchema).max(2)).optional(),
23352
- queryLimit: z80.coerce.number().int().min(1).max(SENTIMENT_QUERY_PAGE_MAX).default(SENTIMENT_QUERY_PAGE_DEFAULT),
23353
- queryCursor: z80.string().min(1).max(16384).optional()
23658
+ include: z81.preprocess((value) => typeof value === "string" ? value.split(",").map((item) => item.trim()).filter(Boolean) : value, z81.array(sentimentSummaryIncludeSchema).max(2)).optional(),
23659
+ queryLimit: z81.coerce.number().int().min(1).max(SENTIMENT_QUERY_PAGE_MAX).default(SENTIMENT_QUERY_PAGE_DEFAULT),
23660
+ queryCursor: z81.string().min(1).max(16384).optional()
23354
23661
  }).superRefine(exclusiveSentimentRuns);
23355
- var sentimentEvidenceOutcomeFilterSchema = z80.preprocess((value) => {
23662
+ var sentimentEvidenceOutcomeFilterSchema = z81.preprocess((value) => {
23356
23663
  const items = typeof value === "string" ? [value] : Array.isArray(value) ? value : null;
23357
23664
  return items ? [...new Set(items.flatMap((item) => typeof item === "string" ? item.split(",").map((part) => part.trim()).filter(Boolean) : [item]))] : value;
23358
- }, z80.array(sentimentOutcomeSchema).min(1).max(sentimentOutcomeSchema.options.length));
23359
- var sentimentEvidenceRequestSchema = sentimentSelectionBaseSchema.extend({ assessmentId: id.optional(), outcome: sentimentEvidenceOutcomeFilterSchema.optional(), cursor: z80.string().min(1).max(16384).optional(), limit: z80.coerce.number().int().min(1).max(100).default(50) }).superRefine(exclusiveSentimentRuns);
23665
+ }, z81.array(sentimentOutcomeSchema).min(1).max(sentimentOutcomeSchema.options.length));
23666
+ var sentimentEvidenceRequestSchema = sentimentSelectionBaseSchema.extend({ assessmentId: id.optional(), outcome: sentimentEvidenceOutcomeFilterSchema.optional(), cursor: z81.string().min(1).max(16384).optional(), limit: z81.coerce.number().int().min(1).max(100).default(50) }).superRefine(exclusiveSentimentRuns);
23360
23667
  var sentimentCompareRequestSchema = sentimentSelectionBaseSchema.extend({ fromRunId: id.describe("Run ID or previous-rated to select the preceding run with stored ratings in this scope."), toRunId: id }).superRefine((value, ctx) => {
23361
23668
  exclusiveSentimentRuns(value, ctx);
23362
23669
  if (value.runIds) ctx.addIssue({ code: "custom", path: ["runIds"], message: "Comparison requires one explicit run per period." });
23363
23670
  });
23364
- var sentimentResolvedSelectionSchema = sentimentSelectionBaseSchema.extend({ runId: id.nullable(), revision: z80.number().int().nullable(), evaluationDefinitionId: id.nullable(), mode: z80.enum(["simple", "advanced"]) });
23365
- var sentimentCountsSchema = z80.object(Object.fromEntries(sentimentOutcomeSchema.options.map((outcome) => [outcome, count]))).strict();
23366
- var sentimentCoverageSchema = z80.object({
23671
+ var sentimentResolvedSelectionSchema = sentimentSelectionBaseSchema.extend({ runId: id.nullable(), revision: z81.number().int().nullable(), evaluationDefinitionId: id.nullable(), mode: z81.enum(["simple", "advanced"]) });
23672
+ var sentimentCountsSchema = z81.object(Object.fromEntries(sentimentOutcomeSchema.options.map((outcome) => [outcome, count]))).strict();
23673
+ var sentimentCoverageSchema = z81.object({
23367
23674
  selected: count,
23368
23675
  eligibleAssessments: count,
23369
23676
  unadmittedAssessments: count,
@@ -23377,45 +23684,45 @@ var sentimentCoverageSchema = z80.object({
23377
23684
  expectedProviderSlots: count,
23378
23685
  completedProviderSlots: count
23379
23686
  }).strict();
23380
- var sentimentScoreSchema = z80.object({ favorableRate: rate, mixedRate: rate, unfavorableRate: rate, favorableDisplay: z80.string(), mixedDisplay: z80.string(), unfavorableDisplay: z80.string(), interval: z80.object({ low: z80.number(), high: z80.number() }).strict().nullable(), method: z80.literal("wilson-independent-v1"), limitation: z80.string() }).strict();
23381
- var headlineFields = { state: sentimentStateSchema, reason: z80.string().nullable(), provisional: z80.boolean(), coverage: sentimentCoverageSchema, score: sentimentScoreSchema };
23382
- var sentimentHeadlineSchema = z80.object({ ...headlineFields, selection: sentimentResolvedSelectionSchema, runIds: z80.array(id) }).strict();
23383
- var sentimentOverallHeadlineSchema = z80.object({ ...headlineFields, queryClass: z80.literal("all"), pooled: z80.literal(true).optional(), runIds: z80.array(id) }).strict();
23384
- var sentimentOverviewSchema = z80.object({ configured: z80.boolean(), branded: sentimentHeadlineSchema, nonBrand: sentimentHeadlineSchema, headlineQueryClass: z80.literal("branded").optional(), pooledOverall: sentimentOverallHeadlineSchema.optional(), overall: sentimentOverallHeadlineSchema.optional().describe("Deprecated compatibility field. Pooled branded and non-brand assessments; never use as the sentiment headline.") }).strict();
23385
- var sentimentAssessmentSummarySchema = z80.object({
23687
+ var sentimentScoreSchema = z81.object({ favorableRate: rate, mixedRate: rate, unfavorableRate: rate, favorableDisplay: z81.string(), mixedDisplay: z81.string(), unfavorableDisplay: z81.string(), interval: z81.object({ low: z81.number(), high: z81.number() }).strict().nullable(), method: z81.literal("wilson-independent-v1"), limitation: z81.string() }).strict();
23688
+ var headlineFields = { state: sentimentStateSchema, reason: z81.string().nullable(), provisional: z81.boolean(), coverage: sentimentCoverageSchema, score: sentimentScoreSchema };
23689
+ var sentimentHeadlineSchema = z81.object({ ...headlineFields, selection: sentimentResolvedSelectionSchema, runIds: z81.array(id) }).strict();
23690
+ var sentimentOverallHeadlineSchema = z81.object({ ...headlineFields, queryClass: z81.literal("all"), pooled: z81.literal(true).optional(), runIds: z81.array(id) }).strict();
23691
+ var sentimentOverviewSchema = z81.object({ configured: z81.boolean(), branded: sentimentHeadlineSchema, nonBrand: sentimentHeadlineSchema, headlineQueryClass: z81.literal("branded").optional(), pooledOverall: sentimentOverallHeadlineSchema.optional(), overall: sentimentOverallHeadlineSchema.optional().describe("Deprecated compatibility field. Pooled branded and non-brand assessments; never use as the sentiment headline.") }).strict();
23692
+ var sentimentAssessmentSummarySchema = z81.object({
23386
23693
  assessmentId: id.nullable(),
23387
23694
  sourceSnapshotId: id,
23388
23695
  runId: id,
23389
23696
  subjectId: id,
23390
- subjectLabel: z80.string(),
23697
+ subjectLabel: z81.string(),
23391
23698
  executionNodeKey: id.nullable(),
23392
23699
  provider: id,
23393
- requestedModel: z80.string().nullable(),
23394
- servedModel: z80.string().nullable(),
23395
- location: z80.string().nullable(),
23700
+ requestedModel: z81.string().nullable(),
23701
+ servedModel: z81.string().nullable(),
23702
+ location: z81.string().nullable(),
23396
23703
  evaluationDefinitionId: id.nullable(),
23397
23704
  state: sentimentStateSchema,
23398
- outcome: z80.union([sentimentOutcomeSchema, z80.null()]),
23399
- reason: z80.string().nullable()
23705
+ outcome: z81.union([sentimentOutcomeSchema, z81.null()]),
23706
+ reason: z81.string().nullable()
23400
23707
  }).strict();
23401
- var sentimentQuerySummarySchema = z80.object({ ...headlineFields, queryId: id, executionNodeKey: id.nullable().optional(), queryText: z80.string(), queryClass: z80.enum(["branded", "non-brand"]), sourceSnapshotIds: z80.array(id), assessments: z80.array(sentimentAssessmentSummarySchema).default([]), locations: z80.array(z80.object({ ...headlineFields, location: z80.string().nullable(), sourceSnapshotIds: z80.array(id) }).strict()) }).strict();
23402
- var sentimentBreakdownSchema = z80.object({ ...headlineFields, dimension: z80.enum(["provider", "property", "market", "query"]), key: z80.string(), label: z80.string(), queryClass: z80.enum(["branded", "non-brand"]) }).strict();
23403
- var sentimentSummarySchema = z80.object({
23708
+ var sentimentQuerySummarySchema = z81.object({ ...headlineFields, queryId: id, executionNodeKey: id.nullable().optional(), queryText: z81.string(), queryClass: z81.enum(["branded", "non-brand"]), sourceSnapshotIds: z81.array(id), assessments: z81.array(sentimentAssessmentSummarySchema).default([]), locations: z81.array(z81.object({ ...headlineFields, location: z81.string().nullable(), sourceSnapshotIds: z81.array(id) }).strict()) }).strict();
23709
+ var sentimentBreakdownSchema = z81.object({ ...headlineFields, dimension: z81.enum(["provider", "property", "market", "query"]), key: z81.string(), label: z81.string(), queryClass: z81.enum(["branded", "non-brand"]) }).strict();
23710
+ var sentimentSummarySchema = z81.object({
23404
23711
  ...headlineFields,
23405
- configured: z80.boolean(),
23712
+ configured: z81.boolean(),
23406
23713
  selection: sentimentResolvedSelectionSchema,
23407
23714
  evaluationDefinition: sentimentEvaluationDefinitionSchema.nullable(),
23408
- breakdowns: z80.array(sentimentBreakdownSchema),
23409
- queries: z80.array(sentimentQuerySummarySchema),
23715
+ breakdowns: z81.array(sentimentBreakdownSchema),
23716
+ queries: z81.array(sentimentQuerySummarySchema),
23410
23717
  /**
23411
23718
  * Branded reads: the Properties with a mixed or unfavorable rating, most criticized first
23412
23719
  * ({@link rankCriticizedProperties}). `keys` are the first {@link SENTIMENT_CRITICIZED_PROPERTY_LIMIT}
23413
23720
  * property breakdown keys; `total` counts them all; `{ total: 0, keys: [] }` with fewer than two
23414
23721
  * Properties in view. Absent from older servers, comparison periods, and non-brand, disabled or unavailable reads.
23415
23722
  */
23416
- criticizedProperties: z80.object({ total: count, keys: z80.array(z80.string()) }).strict().optional(),
23723
+ criticizedProperties: z81.object({ total: count, keys: z81.array(z81.string()) }).strict().optional(),
23417
23724
  /** Present on the paged summary read; follow `nextCursor` as `queryCursor` for the next query rows. */
23418
- queryPage: z80.object({ total: count, limit: count, nextCursor: z80.string().nullable() }).strict().optional()
23725
+ queryPage: z81.object({ total: count, limit: count, nextCursor: z81.string().nullable() }).strict().optional()
23419
23726
  }).strict();
23420
23727
  var SENTIMENT_CRITICIZED_PROPERTY_LIMIT = 5;
23421
23728
  function rankCriticizedProperties(rows) {
@@ -23426,91 +23733,91 @@ function rankCriticizedProperties(rows) {
23426
23733
  criticized.sort((a, b) => criticism(b) - criticism(a) || b.coverage.counts.unfavorable - a.coverage.counts.unfavorable || a.coverage.counts.favorable - b.coverage.counts.favorable || a.label.localeCompare(b.label) || a.key.localeCompare(b.key));
23427
23734
  return { total: criticized.length, keys: criticized.slice(0, SENTIMENT_CRITICIZED_PROPERTY_LIMIT).map((row) => row.key) };
23428
23735
  }
23429
- var sentimentSettingsUpdateSchema = z80.object({ enabled: z80.boolean().optional() }).strict();
23430
- var sentimentSettingsSchema = z80.object({
23736
+ var sentimentSettingsUpdateSchema = z81.object({ enabled: z81.boolean().optional() }).strict();
23737
+ var sentimentSettingsSchema = z81.object({
23431
23738
  provider: sentimentEvaluatorProviderSchema.optional(),
23432
- installEnabled: z80.boolean(),
23433
- enabled: z80.boolean(),
23434
- ready: z80.boolean(),
23435
- readinessReasons: z80.array(z80.string()),
23436
- model: z80.string(),
23739
+ installEnabled: z81.boolean(),
23740
+ enabled: z81.boolean(),
23741
+ ready: z81.boolean(),
23742
+ readinessReasons: z81.array(z81.string()),
23743
+ model: z81.string(),
23437
23744
  enablementEpoch: count,
23438
23745
  completionBoundary: count,
23439
23746
  evaluationDefinitionId: id.nullable(),
23440
- actions: z80.object({ configure: z80.boolean(), backfill: z80.boolean() }).strict(),
23441
- experimental: z80.literal(true),
23442
- disclosure: z80.string()
23443
- }).strict();
23444
- var sentimentBackfillSelectionSchema = sentimentSelectionBaseSchema.extend({ runIds: runIds.optional(), from: z80.string().datetime().optional(), to: z80.string().datetime().optional() }).superRefine(exclusiveSentimentRuns);
23445
- var sentimentBackfillRequestSchema = z80.object({ previewToken: z80.string().min(1).max(65536), idempotencyKey: z80.string().trim().min(1).max(128) }).strict();
23446
- var sentimentBackfillPreviewSchema = z80.object({
23447
- previewToken: z80.string().nullable(),
23448
- expiresAt: z80.string().nullable(),
23747
+ actions: z81.object({ configure: z81.boolean(), backfill: z81.boolean() }).strict(),
23748
+ experimental: z81.literal(true),
23749
+ disclosure: z81.string()
23750
+ }).strict();
23751
+ var sentimentBackfillSelectionSchema = sentimentSelectionBaseSchema.extend({ runIds: runIds.optional(), from: z81.string().datetime().optional(), to: z81.string().datetime().optional() }).superRefine(exclusiveSentimentRuns);
23752
+ var sentimentBackfillRequestSchema = z81.object({ previewToken: z81.string().min(1).max(65536), idempotencyKey: z81.string().trim().min(1).max(128) }).strict();
23753
+ var sentimentBackfillPreviewSchema = z81.object({
23754
+ previewToken: z81.string().nullable(),
23755
+ expiresAt: z81.string().nullable(),
23449
23756
  selection: sentimentBackfillSelectionSchema,
23450
23757
  evaluationDefinitionId: id.nullable(),
23451
23758
  eligibleAssessments: count,
23452
23759
  alreadyClassified: count,
23453
- skipped: z80.array(z80.object({ runId: id, reason: z80.string(), count }).strict()),
23760
+ skipped: z81.array(z81.object({ runId: id, reason: z81.string(), count }).strict()),
23454
23761
  estimatedInputTokens: count,
23455
- estimatedCostUsd: z80.number().nonnegative().nullable(),
23456
- estimateMethod: z80.string()
23762
+ estimatedCostUsd: z81.number().nonnegative().nullable(),
23763
+ estimateMethod: z81.string()
23457
23764
  }).strict();
23458
- var sentimentJobStateSchema = z80.enum(["pending", "running", "waiting-to-retry", "complete", "partial", "failed", "canceled"]);
23459
- var sentimentAttemptReceiptSchema = z80.object({ id, workItemId: id, dispatchedAt: z80.string(), completedAt: z80.string().nullable(), returnedModel: z80.string().nullable(), usage: sentimentUsageSchema, errorCode: z80.string().nullable() }).strict();
23460
- var sentimentJobSchema = z80.object({
23765
+ var sentimentJobStateSchema = z81.enum(["pending", "running", "waiting-to-retry", "complete", "partial", "failed", "canceled"]);
23766
+ var sentimentAttemptReceiptSchema = z81.object({ id, workItemId: id, dispatchedAt: z81.string(), completedAt: z81.string().nullable(), returnedModel: z81.string().nullable(), usage: sentimentUsageSchema, errorCode: z81.string().nullable() }).strict();
23767
+ var sentimentJobSchema = z81.object({
23461
23768
  id,
23462
23769
  projectId: id,
23463
- origin: z80.enum(["automatic", "backfill"]),
23770
+ origin: z81.enum(["automatic", "backfill"]),
23464
23771
  state: sentimentJobStateSchema,
23465
23772
  enablementEpoch: count,
23466
23773
  evaluationDefinitionId: id,
23467
23774
  selection: sentimentBackfillSelectionSchema,
23468
- createdAt: z80.string(),
23469
- updatedAt: z80.string(),
23775
+ createdAt: z81.string(),
23776
+ updatedAt: z81.string(),
23470
23777
  counts: sentimentCountsSchema,
23471
23778
  selected: count,
23472
- cancellationReason: z80.string().nullable(),
23473
- attempts: z80.array(sentimentAttemptReceiptSchema),
23779
+ cancellationReason: z81.string().nullable(),
23780
+ attempts: z81.array(sentimentAttemptReceiptSchema),
23474
23781
  /** Paged job read: every attempt of the job, and the cursor for the next (older) attempts. */
23475
23782
  attemptCount: count.optional(),
23476
- nextAttemptCursor: z80.string().nullable().optional()
23783
+ nextAttemptCursor: z81.string().nullable().optional()
23477
23784
  }).strict();
23478
23785
  var sentimentJobSummarySchema = sentimentJobSchema.omit({ attempts: true, attemptCount: true, nextAttemptCursor: true }).extend({ attemptCount: count }).strict();
23479
- var sentimentJobsSchema = z80.object({ jobs: z80.array(sentimentJobSummarySchema) }).strict();
23786
+ var sentimentJobsSchema = z81.object({ jobs: z81.array(sentimentJobSummarySchema) }).strict();
23480
23787
  var SENTIMENT_ATTEMPT_PAGE_DEFAULT = 50;
23481
- var sentimentJobRequestSchema = z80.object({
23482
- attemptLimit: z80.coerce.number().int().min(1).max(200).default(SENTIMENT_ATTEMPT_PAGE_DEFAULT),
23483
- attemptCursor: z80.string().min(1).max(4096).optional()
23788
+ var sentimentJobRequestSchema = z81.object({
23789
+ attemptLimit: z81.coerce.number().int().min(1).max(200).default(SENTIMENT_ATTEMPT_PAGE_DEFAULT),
23790
+ attemptCursor: z81.string().min(1).max(4096).optional()
23484
23791
  }).strict();
23485
- var sentimentEvidenceItemSchema = z80.object({
23792
+ var sentimentEvidenceItemSchema = z81.object({
23486
23793
  assessmentId: id,
23487
23794
  runId: id,
23488
23795
  sourceSnapshotId: id,
23489
- sourceText: z80.string(),
23796
+ sourceText: z81.string(),
23490
23797
  sourceTextHash: id,
23491
23798
  subject: sentimentSubjectSchema,
23492
23799
  subjectHash: id,
23493
23800
  context: sentimentExecutionContextSchema,
23494
23801
  evaluationDefinitionId: id,
23495
23802
  outcome: sentimentOutcomeSchema,
23496
- conclusion: z80.array(sentimentEvidenceSchema),
23497
- complaint: z80.array(sentimentEvidenceSchema).nullable(),
23498
- returnedModel: z80.string().nullable(),
23499
- reason: z80.string().nullable()
23803
+ conclusion: z81.array(sentimentEvidenceSchema),
23804
+ complaint: z81.array(sentimentEvidenceSchema).nullable(),
23805
+ returnedModel: z81.string().nullable(),
23806
+ reason: z81.string().nullable()
23500
23807
  }).strict();
23501
- var sentimentEvidencePageSchema = z80.object({ state: sentimentStateSchema, selection: sentimentResolvedSelectionSchema.extend({ assessmentId: id.optional(), outcome: z80.array(sentimentOutcomeSchema).optional() }), items: z80.array(sentimentEvidenceItemSchema), nextCursor: z80.string().nullable() }).strict();
23502
- var sentimentComparisonSchema = z80.object({
23808
+ var sentimentEvidencePageSchema = z81.object({ state: sentimentStateSchema, selection: sentimentResolvedSelectionSchema.extend({ assessmentId: id.optional(), outcome: z81.array(sentimentOutcomeSchema).optional() }), items: z81.array(sentimentEvidenceItemSchema), nextCursor: z81.string().nullable() }).strict();
23809
+ var sentimentComparisonSchema = z81.object({
23503
23810
  from: sentimentSummarySchema,
23504
23811
  to: sentimentSummarySchema,
23505
- verdict: z80.enum(["improved", "declined", "no-clear-change"]).nullable(),
23506
- favorableRateDelta: z80.number().nullable(),
23507
- refusalReasons: z80.array(z80.string()),
23812
+ verdict: z81.enum(["improved", "declined", "no-clear-change"]).nullable(),
23813
+ favorableRateDelta: z81.number().nullable(),
23814
+ refusalReasons: z81.array(z81.string()),
23508
23815
  commonUnits: count,
23509
23816
  excludedFrom: count,
23510
23817
  excludedTo: count,
23511
- changedScope: z80.boolean(),
23512
- method: z80.literal("wilson-independent-v1"),
23513
- limitation: z80.string()
23818
+ changedScope: z81.boolean(),
23819
+ method: z81.literal("wilson-independent-v1"),
23820
+ limitation: z81.string()
23514
23821
  }).strict();
23515
23822
  function emptySentimentCounts() {
23516
23823
  return Object.fromEntries(sentimentOutcomeSchema.options.map((outcome) => [outcome, 0]));
@@ -23547,7 +23854,7 @@ function aggregateSentiment(items, options = {}) {
23547
23854
  }
23548
23855
 
23549
23856
  // ../contracts/src/composites.ts
23550
- import { z as z81 } from "zod";
23857
+ import { z as z82 } from "zod";
23551
23858
  var PROJECT_OVERVIEW_QUERY_CLASS_SCOPE = {
23552
23859
  queryClass: "all",
23553
23860
  figures: [
@@ -23569,26 +23876,26 @@ var PROJECT_OVERVIEW_QUERY_CLASS_SCOPE = {
23569
23876
  ],
23570
23877
  note: "These figures pool branded and non-brand queries in one denominator. Only scores.mentionShare splits the classes. For one class, use a read filtered by queryClass."
23571
23878
  };
23572
- var metricToneSchema = z81.enum(["positive", "caution", "negative", "neutral"]);
23573
- var scoreSummarySchema = z81.object({
23574
- label: z81.string(),
23575
- value: z81.string(),
23576
- delta: z81.string(),
23879
+ var metricToneSchema = z82.enum(["positive", "caution", "negative", "neutral"]);
23880
+ var scoreSummarySchema = z82.object({
23881
+ label: z82.string(),
23882
+ value: z82.string(),
23883
+ delta: z82.string(),
23577
23884
  tone: metricToneSchema,
23578
- description: z81.string(),
23579
- tooltip: z81.string().optional(),
23580
- trend: z81.array(percent()),
23885
+ description: z82.string(),
23886
+ tooltip: z82.string().optional(),
23887
+ trend: z82.array(percent()),
23581
23888
  progress: percent().optional(),
23582
- providerCoverage: z81.string().optional()
23889
+ providerCoverage: z82.string().optional()
23583
23890
  });
23584
- var mentionShareBreakdownSchema = z81.object({
23585
- projectMentionSnapshots: z81.number().int().nonnegative(),
23586
- competitorMentionSnapshots: z81.number().int().nonnegative(),
23891
+ var mentionShareBreakdownSchema = z82.object({
23892
+ projectMentionSnapshots: z82.number().int().nonnegative(),
23893
+ competitorMentionSnapshots: z82.number().int().nonnegative(),
23587
23894
  /** `projectMentionSnapshots + competitorMentionSnapshots`, the denominator of `score` and every `ranking` share. */
23588
- combinedMentionSnapshots: z81.number().int().nonnegative(),
23589
- perCompetitor: z81.array(z81.object({
23590
- domain: z81.string(),
23591
- mentionSnapshots: z81.number().int().nonnegative(),
23895
+ combinedMentionSnapshots: z82.number().int().nonnegative(),
23896
+ perCompetitor: z82.array(z82.object({
23897
+ domain: z82.string(),
23898
+ mentionSnapshots: z82.number().int().nonnegative(),
23592
23899
  shareOfCompetitiveTotal: percent()
23593
23900
  })),
23594
23901
  /**
@@ -23598,50 +23905,50 @@ var mentionShareBreakdownSchema = z81.object({
23598
23905
  * Empty when there is no head-to-head: no tracked competitors, or no brand
23599
23906
  * named in this class.
23600
23907
  */
23601
- ranking: z81.array(z81.object({
23602
- kind: z81.enum(["project", "competitor"]),
23908
+ ranking: z82.array(z82.object({
23909
+ kind: z82.enum(["project", "competitor"]),
23603
23910
  /** The tracked competitor's domain. Null on the project's row. */
23604
- domain: z81.string().nullable(),
23605
- mentionSnapshots: z81.number().int().nonnegative(),
23606
- share: fraction(z81.number().min(0).max(1))
23911
+ domain: z82.string().nullable(),
23912
+ mentionSnapshots: z82.number().int().nonnegative(),
23913
+ share: fraction(z82.number().min(0).max(1))
23607
23914
  })),
23608
- snapshotsWithAnswerText: z81.number().int().nonnegative(),
23609
- snapshotsTotal: z81.number().int().nonnegative(),
23610
- score: percent(z81.number().min(0).max(100)).nullable()
23915
+ snapshotsWithAnswerText: z82.number().int().nonnegative(),
23916
+ snapshotsTotal: z82.number().int().nonnegative(),
23917
+ score: percent(z82.number().min(0).max(100)).nullable()
23611
23918
  });
23612
23919
  var mentionShareSchema = scoreSummarySchema.extend({
23613
23920
  /** Non-brand queries — the competitive figure. See `MentionShareDto`. */
23614
23921
  breakdown: mentionShareBreakdownSchema,
23615
- scope: z81.enum(["non-brand", "pooled"]),
23922
+ scope: z82.enum(["non-brand", "pooled"]),
23616
23923
  /** Branded queries, beside the competitive figure and never inside it. */
23617
23924
  branded: mentionShareBreakdownSchema
23618
23925
  });
23619
- var movementSummarySchema = z81.object({
23620
- gained: z81.number().int().nonnegative(),
23621
- lost: z81.number().int().nonnegative(),
23926
+ var movementSummarySchema = z82.object({
23927
+ gained: z82.number().int().nonnegative(),
23928
+ lost: z82.number().int().nonnegative(),
23622
23929
  tone: metricToneSchema,
23623
- hasPreviousRun: z81.boolean(),
23624
- gainedQueries: z81.array(z81.string()).optional(),
23625
- lostQueries: z81.array(z81.string()).optional()
23626
- });
23627
- var movementComparisonSchema = z81.object({
23628
- hasPreviousRun: z81.boolean(),
23629
- comparable: z81.boolean(),
23630
- querySetChanged: z81.boolean(),
23631
- previousRunAt: z81.string().nullable(),
23632
- currentQueryCount: z81.number().int().nonnegative(),
23633
- previousQueryCount: z81.number().int().nonnegative(),
23634
- comparableQueryCount: z81.number().int().nonnegative(),
23635
- addedQueryCount: z81.number().int().nonnegative(),
23636
- removedQueryCount: z81.number().int().nonnegative(),
23637
- addedQueries: z81.array(z81.string()),
23638
- removedQueries: z81.array(z81.string())
23639
- });
23640
- var projectOverviewInsightSchema = z81.object({
23641
- id: z81.string(),
23642
- projectId: z81.string(),
23643
- runId: z81.string().nullable(),
23644
- type: z81.enum([
23930
+ hasPreviousRun: z82.boolean(),
23931
+ gainedQueries: z82.array(z82.string()).optional(),
23932
+ lostQueries: z82.array(z82.string()).optional()
23933
+ });
23934
+ var movementComparisonSchema = z82.object({
23935
+ hasPreviousRun: z82.boolean(),
23936
+ comparable: z82.boolean(),
23937
+ querySetChanged: z82.boolean(),
23938
+ previousRunAt: z82.string().nullable(),
23939
+ currentQueryCount: z82.number().int().nonnegative(),
23940
+ previousQueryCount: z82.number().int().nonnegative(),
23941
+ comparableQueryCount: z82.number().int().nonnegative(),
23942
+ addedQueryCount: z82.number().int().nonnegative(),
23943
+ removedQueryCount: z82.number().int().nonnegative(),
23944
+ addedQueries: z82.array(z82.string()),
23945
+ removedQueries: z82.array(z82.string())
23946
+ });
23947
+ var projectOverviewInsightSchema = z82.object({
23948
+ id: z82.string(),
23949
+ projectId: z82.string(),
23950
+ runId: z82.string().nullable(),
23951
+ type: z82.enum([
23645
23952
  "regression",
23646
23953
  "gain",
23647
23954
  "opportunity",
@@ -23658,75 +23965,75 @@ var projectOverviewInsightSchema = z81.object({
23658
23965
  "gbp-keyword-drop"
23659
23966
  ]),
23660
23967
  severity: insightSeveritySchema,
23661
- title: z81.string(),
23662
- query: z81.string(),
23663
- provider: z81.string(),
23664
- recommendation: z81.object({
23665
- action: z81.string(),
23666
- target: z81.string().optional(),
23667
- reason: z81.string()
23968
+ title: z82.string(),
23969
+ query: z82.string(),
23970
+ provider: z82.string(),
23971
+ recommendation: z82.object({
23972
+ action: z82.string(),
23973
+ target: z82.string().optional(),
23974
+ reason: z82.string()
23668
23975
  }).optional(),
23669
- cause: z81.object({
23670
- cause: z81.string(),
23671
- competitorDomain: z81.string().optional(),
23672
- details: z81.string().optional()
23976
+ cause: z82.object({
23977
+ cause: z82.string(),
23978
+ competitorDomain: z82.string().optional(),
23979
+ details: z82.string().optional()
23673
23980
  }).optional(),
23674
- dismissed: z81.boolean(),
23675
- createdAt: z81.string()
23981
+ dismissed: z82.boolean(),
23982
+ createdAt: z82.string()
23676
23983
  });
23677
- var projectOverviewHealthSchema = z81.object({
23678
- id: z81.string(),
23679
- projectId: z81.string(),
23680
- runId: z81.string().nullable(),
23984
+ var projectOverviewHealthSchema = z82.object({
23985
+ id: z82.string(),
23986
+ projectId: z82.string(),
23987
+ runId: z82.string().nullable(),
23681
23988
  overallCitedRate: fraction(),
23682
23989
  overallMentionRate: fraction(),
23683
- totalPairs: z81.number().int().nonnegative(),
23684
- citedPairs: z81.number().int().nonnegative(),
23685
- mentionedPairs: z81.number().int().nonnegative(),
23686
- providerBreakdown: z81.record(z81.string(), z81.object({
23990
+ totalPairs: z82.number().int().nonnegative(),
23991
+ citedPairs: z82.number().int().nonnegative(),
23992
+ mentionedPairs: z82.number().int().nonnegative(),
23993
+ providerBreakdown: z82.record(z82.string(), z82.object({
23687
23994
  citedRate: fraction(),
23688
23995
  mentionRate: fraction(),
23689
- cited: z81.number().int().nonnegative(),
23690
- mentioned: z81.number().int().nonnegative(),
23691
- total: z81.number().int().nonnegative()
23996
+ cited: z82.number().int().nonnegative(),
23997
+ mentioned: z82.number().int().nonnegative(),
23998
+ total: z82.number().int().nonnegative()
23692
23999
  })),
23693
- createdAt: z81.string(),
23694
- status: z81.enum(["ready", "no-data"]),
23695
- reason: z81.literal("no-runs-yet").optional()
24000
+ createdAt: z82.string(),
24001
+ status: z82.enum(["ready", "no-data"]),
24002
+ reason: z82.literal("no-runs-yet").optional()
23696
24003
  });
23697
- var projectOverviewDtoSchema = z81.object({
24004
+ var projectOverviewDtoSchema = z82.object({
23698
24005
  sentiment: sentimentOverviewSchema.optional(),
23699
24006
  project: projectDtoSchema,
23700
24007
  latestRun: latestProjectRunDtoSchema,
23701
24008
  health: projectOverviewHealthSchema.nullable(),
23702
- topInsights: z81.array(projectOverviewInsightSchema),
23703
- queryClassScope: z81.object({
23704
- queryClass: z81.literal("all"),
23705
- figures: z81.array(z81.string()),
23706
- note: z81.string()
24009
+ topInsights: z82.array(projectOverviewInsightSchema),
24010
+ queryClassScope: z82.object({
24011
+ queryClass: z82.literal("all"),
24012
+ figures: z82.array(z82.string()),
24013
+ note: z82.string()
23707
24014
  }).optional(),
23708
- queryCounts: z81.object({
23709
- totalQueries: z81.number().int().nonnegative(),
23710
- citedQueries: z81.number().int().nonnegative(),
23711
- notCitedQueries: z81.number().int().nonnegative(),
24015
+ queryCounts: z82.object({
24016
+ totalQueries: z82.number().int().nonnegative(),
24017
+ citedQueries: z82.number().int().nonnegative(),
24018
+ notCitedQueries: z82.number().int().nonnegative(),
23712
24019
  citedRate: fraction(),
23713
- mentionedQueries: z81.number().int().nonnegative(),
23714
- notMentionedQueries: z81.number().int().nonnegative(),
24020
+ mentionedQueries: z82.number().int().nonnegative(),
24021
+ notMentionedQueries: z82.number().int().nonnegative(),
23715
24022
  mentionRate: fraction()
23716
24023
  }),
23717
- providers: z81.array(z81.object({
23718
- provider: z81.string(),
24024
+ providers: z82.array(z82.object({
24025
+ provider: z82.string(),
23719
24026
  citedRate: fraction(),
23720
- cited: z81.number().int().nonnegative(),
23721
- total: z81.number().int().nonnegative()
24027
+ cited: z82.number().int().nonnegative(),
24028
+ total: z82.number().int().nonnegative()
23722
24029
  })),
23723
- transitions: z81.object({
23724
- since: z81.string().nullable(),
23725
- gained: z81.number().int().nonnegative(),
23726
- lost: z81.number().int().nonnegative(),
23727
- emerging: z81.number().int().nonnegative()
24030
+ transitions: z82.object({
24031
+ since: z82.string().nullable(),
24032
+ gained: z82.number().int().nonnegative(),
24033
+ lost: z82.number().int().nonnegative(),
24034
+ emerging: z82.number().int().nonnegative()
23728
24035
  }),
23729
- scores: z81.object({
24036
+ scores: z82.object({
23730
24037
  mention: scoreSummarySchema,
23731
24038
  visibility: scoreSummarySchema,
23732
24039
  mentionShare: mentionShareSchema,
@@ -23740,74 +24047,74 @@ var projectOverviewDtoSchema = z81.object({
23740
24047
  citationMovement: movementSummarySchema,
23741
24048
  mentionMovement: movementSummarySchema,
23742
24049
  movementComparison: movementComparisonSchema,
23743
- competitors: z81.array(z81.object({
23744
- id: z81.string(),
23745
- domain: z81.string(),
23746
- aliases: z81.array(z81.string()).optional(),
23747
- autoAliasNames: z81.array(z81.string()).optional(),
23748
- citationCount: z81.number().int().nonnegative(),
23749
- totalQueries: z81.number().int().nonnegative(),
23750
- pressureLabel: z81.enum(["None", "Low", "Moderate", "High"]),
23751
- citedQueries: z81.array(z81.string())
24050
+ competitors: z82.array(z82.object({
24051
+ id: z82.string(),
24052
+ domain: z82.string(),
24053
+ aliases: z82.array(z82.string()).optional(),
24054
+ autoAliasNames: z82.array(z82.string()).optional(),
24055
+ citationCount: z82.number().int().nonnegative(),
24056
+ totalQueries: z82.number().int().nonnegative(),
24057
+ pressureLabel: z82.enum(["None", "Low", "Moderate", "High"]),
24058
+ citedQueries: z82.array(z82.string())
23752
24059
  })),
23753
- providerScores: z81.array(z81.object({
23754
- provider: z81.string(),
23755
- model: z81.string().nullable(),
24060
+ providerScores: z82.array(z82.object({
24061
+ provider: z82.string(),
24062
+ model: z82.string().nullable(),
23756
24063
  score: percent(),
23757
- cited: z81.number().int().nonnegative(),
23758
- total: z81.number().int().nonnegative(),
23759
- trend: z81.array(percent()).optional()
24064
+ cited: z82.number().int().nonnegative(),
24065
+ total: z82.number().int().nonnegative(),
24066
+ trend: z82.array(percent()).optional()
23760
24067
  })),
23761
- attentionItems: z81.array(z81.object({
23762
- id: z81.string(),
24068
+ attentionItems: z82.array(z82.object({
24069
+ id: z82.string(),
23763
24070
  tone: metricToneSchema,
23764
- title: z81.string(),
23765
- detail: z81.string(),
23766
- actionLabel: z81.string(),
23767
- href: z81.string()
24071
+ title: z82.string(),
24072
+ detail: z82.string(),
24073
+ actionLabel: z82.string(),
24074
+ href: z82.string()
23768
24075
  })),
23769
- runHistory: z81.array(z81.object({
23770
- runId: z81.string(),
23771
- createdAt: z81.string(),
23772
- citedCount: z81.number().int().nonnegative(),
23773
- totalCount: z81.number().int().nonnegative(),
24076
+ runHistory: z82.array(z82.object({
24077
+ runId: z82.string(),
24078
+ createdAt: z82.string(),
24079
+ citedCount: z82.number().int().nonnegative(),
24080
+ totalCount: z82.number().int().nonnegative(),
23774
24081
  citationRate: percent(),
23775
- mentionedCount: z81.number().int().nonnegative(),
24082
+ mentionedCount: z82.number().int().nonnegative(),
23776
24083
  mentionRate: percent(),
23777
- status: z81.string()
24084
+ status: z82.string()
23778
24085
  })),
23779
- suggestedQueries: z81.object({
23780
- rows: z81.array(z81.object({
23781
- query: z81.string(),
23782
- impressions: z81.number(),
23783
- clicks: z81.number(),
23784
- avgPosition: z81.number(),
23785
- reason: z81.string()
24086
+ suggestedQueries: z82.object({
24087
+ rows: z82.array(z82.object({
24088
+ query: z82.string(),
24089
+ impressions: z82.number(),
24090
+ clicks: z82.number(),
24091
+ avgPosition: z82.number(),
24092
+ reason: z82.string()
23786
24093
  })),
23787
- totalCandidates: z81.number().int().nonnegative(),
23788
- skippedAlreadyTracked: z81.number().int().nonnegative()
24094
+ totalCandidates: z82.number().int().nonnegative(),
24095
+ skippedAlreadyTracked: z82.number().int().nonnegative()
23789
24096
  }),
23790
- dateRangeLabel: z81.string(),
23791
- contextLabel: z81.string()
23792
- });
23793
- var searchHitKindSchema = z81.enum(["snapshot", "insight"]);
23794
- var projectSearchSnapshotHitSchema = z81.object({
23795
- kind: z81.literal("snapshot"),
23796
- id: z81.string(),
23797
- runId: z81.string(),
23798
- query: z81.string(),
23799
- provider: z81.string(),
23800
- model: z81.string().nullable(),
24097
+ dateRangeLabel: z82.string(),
24098
+ contextLabel: z82.string()
24099
+ });
24100
+ var searchHitKindSchema = z82.enum(["snapshot", "insight"]);
24101
+ var projectSearchSnapshotHitSchema = z82.object({
24102
+ kind: z82.literal("snapshot"),
24103
+ id: z82.string(),
24104
+ runId: z82.string(),
24105
+ query: z82.string(),
24106
+ provider: z82.string(),
24107
+ model: z82.string().nullable(),
23801
24108
  citationState: citationStateSchema,
23802
- matchedField: z81.enum(["answerText", "citedDomains", "citedUrls", "searchQueries", "query"]),
23803
- snippet: z81.string(),
23804
- createdAt: z81.string()
23805
- });
23806
- var projectSearchInsightHitSchema = z81.object({
23807
- kind: z81.literal("insight"),
23808
- id: z81.string(),
23809
- runId: z81.string().nullable(),
23810
- type: z81.enum([
24109
+ matchedField: z82.enum(["answerText", "citedDomains", "citedUrls", "searchQueries", "query"]),
24110
+ snippet: z82.string(),
24111
+ createdAt: z82.string()
24112
+ });
24113
+ var projectSearchInsightHitSchema = z82.object({
24114
+ kind: z82.literal("insight"),
24115
+ id: z82.string(),
24116
+ runId: z82.string().nullable(),
24117
+ type: z82.enum([
23811
24118
  "regression",
23812
24119
  "gain",
23813
24120
  "opportunity",
@@ -23825,23 +24132,23 @@ var projectSearchInsightHitSchema = z81.object({
23825
24132
  "gbp-keyword-drop"
23826
24133
  ]),
23827
24134
  severity: insightSeveritySchema,
23828
- title: z81.string(),
23829
- query: z81.string(),
23830
- provider: z81.string(),
23831
- matchedField: z81.enum(["title", "query", "recommendation", "cause"]),
23832
- snippet: z81.string(),
23833
- dismissed: z81.boolean(),
23834
- createdAt: z81.string()
23835
- });
23836
- var projectSearchHitSchema = z81.discriminatedUnion("kind", [
24135
+ title: z82.string(),
24136
+ query: z82.string(),
24137
+ provider: z82.string(),
24138
+ matchedField: z82.enum(["title", "query", "recommendation", "cause"]),
24139
+ snippet: z82.string(),
24140
+ dismissed: z82.boolean(),
24141
+ createdAt: z82.string()
24142
+ });
24143
+ var projectSearchHitSchema = z82.discriminatedUnion("kind", [
23837
24144
  projectSearchSnapshotHitSchema,
23838
24145
  projectSearchInsightHitSchema
23839
24146
  ]);
23840
- var projectSearchResponseSchema = z81.object({
23841
- query: z81.string(),
23842
- totalHits: z81.number().int().nonnegative(),
23843
- truncated: z81.boolean(),
23844
- hits: z81.array(projectSearchHitSchema)
24147
+ var projectSearchResponseSchema = z82.object({
24148
+ query: z82.string(),
24149
+ totalHits: z82.number().int().nonnegative(),
24150
+ truncated: z82.boolean(),
24151
+ hits: z82.array(projectSearchHitSchema)
23845
24152
  });
23846
24153
 
23847
24154
  // ../contracts/src/index-coverage.ts
@@ -23905,52 +24212,52 @@ function summarizeObservedQueryCounts(snapshots) {
23905
24212
  }
23906
24213
 
23907
24214
  // ../contracts/src/citations.ts
23908
- import { z as z82 } from "zod";
23909
- var citationCoverageProviderSchema = z82.object({
23910
- provider: z82.string(),
24215
+ import { z as z83 } from "zod";
24216
+ var citationCoverageProviderSchema = z83.object({
24217
+ provider: z83.string(),
23911
24218
  citationState: citationStateSchema,
23912
- cited: z82.boolean(),
23913
- mentioned: z82.boolean(),
23914
- runId: z82.string(),
23915
- runCreatedAt: z82.string()
23916
- });
23917
- var citationCoverageRowSchema = z82.object({
23918
- queryId: z82.string(),
23919
- query: z82.string(),
23920
- providers: z82.array(citationCoverageProviderSchema),
23921
- citedCount: z82.number().int().nonnegative(),
23922
- mentionedCount: z82.number().int().nonnegative(),
23923
- totalProviders: z82.number().int().nonnegative()
23924
- });
23925
- var competitorGapRowSchema = z82.object({
23926
- queryId: z82.string(),
23927
- query: z82.string(),
23928
- provider: z82.string(),
23929
- citingCompetitors: z82.array(z82.string()),
23930
- runId: z82.string(),
23931
- runCreatedAt: z82.string()
23932
- });
23933
- var citationVisibilitySummarySchema = z82.object({
23934
- providersConfigured: z82.number().int().nonnegative(),
23935
- providersCiting: z82.number().int().nonnegative(),
23936
- providersMentioning: z82.number().int().nonnegative(),
23937
- totalQueries: z82.number().int().nonnegative(),
24219
+ cited: z83.boolean(),
24220
+ mentioned: z83.boolean(),
24221
+ runId: z83.string(),
24222
+ runCreatedAt: z83.string()
24223
+ });
24224
+ var citationCoverageRowSchema = z83.object({
24225
+ queryId: z83.string(),
24226
+ query: z83.string(),
24227
+ providers: z83.array(citationCoverageProviderSchema),
24228
+ citedCount: z83.number().int().nonnegative(),
24229
+ mentionedCount: z83.number().int().nonnegative(),
24230
+ totalProviders: z83.number().int().nonnegative()
24231
+ });
24232
+ var competitorGapRowSchema = z83.object({
24233
+ queryId: z83.string(),
24234
+ query: z83.string(),
24235
+ provider: z83.string(),
24236
+ citingCompetitors: z83.array(z83.string()),
24237
+ runId: z83.string(),
24238
+ runCreatedAt: z83.string()
24239
+ });
24240
+ var citationVisibilitySummarySchema = z83.object({
24241
+ providersConfigured: z83.number().int().nonnegative(),
24242
+ providersCiting: z83.number().int().nonnegative(),
24243
+ providersMentioning: z83.number().int().nonnegative(),
24244
+ totalQueries: z83.number().int().nonnegative(),
23938
24245
  // Cross-tab buckets — each tracked query with at least one snapshot lands
23939
24246
  // in exactly one of these. Queries with zero snapshots are not counted in
23940
24247
  // any bucket; (sum of buckets) ≤ totalQueries.
23941
- queriesCitedAndMentioned: z82.number().int().nonnegative(),
23942
- queriesCitedOnly: z82.number().int().nonnegative(),
23943
- queriesMentionedOnly: z82.number().int().nonnegative(),
23944
- queriesInvisible: z82.number().int().nonnegative(),
23945
- latestRunId: z82.string().nullable(),
23946
- latestRunAt: z82.string().nullable()
23947
- });
23948
- var citationVisibilityResponseSchema = z82.object({
24248
+ queriesCitedAndMentioned: z83.number().int().nonnegative(),
24249
+ queriesCitedOnly: z83.number().int().nonnegative(),
24250
+ queriesMentionedOnly: z83.number().int().nonnegative(),
24251
+ queriesInvisible: z83.number().int().nonnegative(),
24252
+ latestRunId: z83.string().nullable(),
24253
+ latestRunAt: z83.string().nullable()
24254
+ });
24255
+ var citationVisibilityResponseSchema = z83.object({
23949
24256
  summary: citationVisibilitySummarySchema,
23950
- byQuery: z82.array(citationCoverageRowSchema),
23951
- competitorGaps: z82.array(competitorGapRowSchema),
23952
- status: z82.enum(["ready", "no-data"]),
23953
- reason: z82.enum(["no-runs-yet", "no-queries"]).optional()
24257
+ byQuery: z83.array(citationCoverageRowSchema),
24258
+ competitorGaps: z83.array(competitorGapRowSchema),
24259
+ status: z83.enum(["ready", "no-data"]),
24260
+ reason: z83.enum(["no-runs-yet", "no-queries"]).optional()
23954
24261
  });
23955
24262
  function emptyCitationVisibility(reason) {
23956
24263
  return {
@@ -23977,103 +24284,103 @@ function citationStateToCited(state) {
23977
24284
  }
23978
24285
 
23979
24286
  // ../contracts/src/organic-evidence.ts
23980
- import { z as z83 } from "zod";
23981
- var organicEvidencePeriodSchema = z83.union(windowDayValues(WINDOW_SETS.organicEvidence).map((value) => z83.literal(value)));
24287
+ import { z as z84 } from "zod";
24288
+ var organicEvidencePeriodSchema = z84.union(windowDayValues(WINDOW_SETS.organicEvidence).map((value) => z84.literal(value)));
23982
24289
  function parseOrganicEvidencePeriod(value) {
23983
24290
  return windowDays(parseWindowIn(value, WINDOW_SETS.organicEvidence, { field: "period", fallback: "90d" }));
23984
24291
  }
23985
- var cohortNameSchema = z83.enum(["earliest", "middle", "prior", "latest"]);
23986
- var countSchema = z83.object({
23987
- clicks: z83.number().int().nonnegative(),
23988
- impressions: z83.number().int().nonnegative()
24292
+ var cohortNameSchema = z84.enum(["earliest", "middle", "prior", "latest"]);
24293
+ var countSchema = z84.object({
24294
+ clicks: z84.number().int().nonnegative(),
24295
+ impressions: z84.number().int().nonnegative()
23989
24296
  });
23990
- var cohortSchema = z83.object({
24297
+ var cohortSchema = z84.object({
23991
24298
  name: cohortNameSchema,
23992
- startDate: z83.string(),
23993
- endDate: z83.string()
24299
+ startDate: z84.string(),
24300
+ endDate: z84.string()
23994
24301
  });
23995
24302
  var searchCohortSchema = cohortSchema.extend({ totals: countSchema });
23996
24303
  var sessionCohortSchema = cohortSchema.extend({
23997
- organicSessions: z83.number().int().nonnegative()
23998
- });
23999
- var sourceCoverageSchema = z83.object({
24000
- startDate: z83.string(),
24001
- endDate: z83.string(),
24002
- observedDays: z83.number().int().nonnegative()
24003
- });
24004
- var crawlerCountsSchema = z83.object({
24005
- verified: z83.number().int().nonnegative(),
24006
- claimedUnverified: z83.number().int().nonnegative(),
24007
- unknownAiLike: z83.number().int().nonnegative()
24008
- });
24009
- var referralCountsSchema = z83.object({
24010
- total: z83.number().int().nonnegative(),
24011
- paid: z83.number().int().nonnegative(),
24012
- organic: z83.number().int().nonnegative(),
24013
- unknown: z83.number().int().nonnegative()
24014
- });
24015
- var organicEvidenceDtoSchema = z83.object({
24016
- contractVersion: z83.literal("organic-evidence/v1"),
24304
+ organicSessions: z84.number().int().nonnegative()
24305
+ });
24306
+ var sourceCoverageSchema = z84.object({
24307
+ startDate: z84.string(),
24308
+ endDate: z84.string(),
24309
+ observedDays: z84.number().int().nonnegative()
24310
+ });
24311
+ var crawlerCountsSchema = z84.object({
24312
+ verified: z84.number().int().nonnegative(),
24313
+ claimedUnverified: z84.number().int().nonnegative(),
24314
+ unknownAiLike: z84.number().int().nonnegative()
24315
+ });
24316
+ var referralCountsSchema = z84.object({
24317
+ total: z84.number().int().nonnegative(),
24318
+ paid: z84.number().int().nonnegative(),
24319
+ organic: z84.number().int().nonnegative(),
24320
+ unknown: z84.number().int().nonnegative()
24321
+ });
24322
+ var organicEvidenceDtoSchema = z84.object({
24323
+ contractVersion: z84.literal("organic-evidence/v1"),
24017
24324
  periodDays: organicEvidencePeriodSchema,
24018
24325
  /** Latest headline evidence date, preferring the GSC property date when available. */
24019
- asOfDate: z83.string().nullable(),
24020
- coverage: z83.object({
24021
- gsc: z83.boolean(),
24022
- ga4: z83.boolean(),
24023
- server: z83.boolean(),
24024
- visibility: z83.boolean()
24326
+ asOfDate: z84.string().nullable(),
24327
+ coverage: z84.object({
24328
+ gsc: z84.boolean(),
24329
+ ga4: z84.boolean(),
24330
+ server: z84.boolean(),
24331
+ visibility: z84.boolean()
24025
24332
  }),
24026
- sourceCoverage: z83.object({
24333
+ sourceCoverage: z84.object({
24027
24334
  gsc: sourceCoverageSchema.nullable(),
24028
24335
  ga4: sourceCoverageSchema.nullable(),
24029
24336
  server: sourceCoverageSchema.nullable(),
24030
- visibility: z83.object({ completedAt: z83.string(), ageDays: z83.number().nonnegative() }).nullable()
24337
+ visibility: z84.object({ completedAt: z84.string(), ageDays: z84.number().nonnegative() }).nullable()
24031
24338
  }),
24032
- gsc: z83.object({
24339
+ gsc: z84.object({
24033
24340
  propertyTotals: countSchema,
24034
24341
  namedBrand: countSchema,
24035
24342
  namedNonBrand: countSchema,
24036
24343
  suppressedOrUnreportedResidual: countSchema,
24037
- cohorts: z83.array(searchCohortSchema)
24344
+ cohorts: z84.array(searchCohortSchema)
24038
24345
  }).nullable(),
24039
- ga4: z83.object({
24040
- organicSessions: z83.number().int().nonnegative(),
24041
- cohorts: z83.array(sessionCohortSchema)
24346
+ ga4: z84.object({
24347
+ organicSessions: z84.number().int().nonnegative(),
24348
+ cohorts: z84.array(sessionCohortSchema)
24042
24349
  }).nullable(),
24043
- gaAiReferrals: z83.object({
24044
- paidSessions: z83.number().int().nonnegative(),
24045
- organicSessions: z83.number().int().nonnegative()
24350
+ gaAiReferrals: z84.object({
24351
+ paidSessions: z84.number().int().nonnegative(),
24352
+ organicSessions: z84.number().int().nonnegative()
24046
24353
  }).nullable(),
24047
- server: z83.object({
24354
+ server: z84.object({
24048
24355
  crawlerHits: crawlerCountsSchema,
24049
24356
  userFetchHits: crawlerCountsSchema,
24050
24357
  referralSessions: referralCountsSchema
24051
24358
  }).nullable(),
24052
- visibility: z83.object({
24053
- runId: z83.string(),
24054
- completedAt: z83.string(),
24055
- ageDays: z83.number().nonnegative(),
24056
- answerPairs: z83.number().int().nonnegative(),
24057
- mentionedPairs: z83.number().int().nonnegative(),
24058
- citedPairs: z83.number().int().nonnegative()
24359
+ visibility: z84.object({
24360
+ runId: z84.string(),
24361
+ completedAt: z84.string(),
24362
+ ageDays: z84.number().nonnegative(),
24363
+ answerPairs: z84.number().int().nonnegative(),
24364
+ mentionedPairs: z84.number().int().nonnegative(),
24365
+ citedPairs: z84.number().int().nonnegative()
24059
24366
  }).nullable(),
24060
24367
  measurement: gaMeasurementAnalysisDtoSchema,
24061
- pages: z83.array(z83.object({
24062
- path: z83.string(),
24368
+ pages: z84.array(z84.object({
24369
+ path: z84.string(),
24063
24370
  gsc: countSchema,
24064
- ga4OrganicSessions: z83.number().int().nonnegative(),
24065
- server: z83.object({
24371
+ ga4OrganicSessions: z84.number().int().nonnegative(),
24372
+ server: z84.object({
24066
24373
  crawlerHits: crawlerCountsSchema,
24067
24374
  userFetchHits: crawlerCountsSchema,
24068
24375
  referralSessions: referralCountsSchema
24069
24376
  })
24070
24377
  })),
24071
- findings: z83.array(z83.object({
24072
- tone: z83.enum(["positive", "caution", "neutral"]),
24073
- title: z83.string(),
24074
- detail: z83.string()
24378
+ findings: z84.array(z84.object({
24379
+ tone: z84.enum(["positive", "caution", "neutral"]),
24380
+ title: z84.string(),
24381
+ detail: z84.string()
24075
24382
  })),
24076
- limitations: z83.array(z83.object({ code: z83.string(), detail: z83.string() }))
24383
+ limitations: z84.array(z84.object({ code: z84.string(), detail: z84.string() }))
24077
24384
  });
24078
24385
 
24079
24386
  // ../contracts/src/traffic-path.ts
@@ -24371,9 +24678,9 @@ function serializeForInlineScript(value) {
24371
24678
  }
24372
24679
 
24373
24680
  // ../contracts/src/outcome-telemetry.ts
24374
- import { z as z84 } from "zod";
24681
+ import { z as z85 } from "zod";
24375
24682
  var OUTCOME_SURFACES = ["cli", "mcp-stdio", "mcp-http", "aero", "api", "dashboard", "system"];
24376
- var outcomeSurfaceSchema = z84.enum(OUTCOME_SURFACES);
24683
+ var outcomeSurfaceSchema = z85.enum(OUTCOME_SURFACES);
24377
24684
  var OutcomeSurfaces = outcomeSurfaceSchema.enum;
24378
24685
  var INTEGRATION_NAMES = [
24379
24686
  "provider",
@@ -24395,19 +24702,19 @@ var INTEGRATION_NAMES = [
24395
24702
  /** The WordPress traffic-logger plugin source, apart from the WordPress publishing connection. */
24396
24703
  "traffic_wordpress"
24397
24704
  ];
24398
- var integrationNameSchema = z84.enum(INTEGRATION_NAMES);
24705
+ var integrationNameSchema = z85.enum(INTEGRATION_NAMES);
24399
24706
  var IntegrationNames = integrationNameSchema.enum;
24400
24707
  var CONNECTION_ACTIONS = ["connect", "disconnect", "test", "reauth", "select"];
24401
- var connectionActionSchema = z84.enum(CONNECTION_ACTIONS);
24708
+ var connectionActionSchema = z85.enum(CONNECTION_ACTIONS);
24402
24709
  var ConnectionActions = connectionActionSchema.enum;
24403
24710
  var CONNECTION_STATUSES = ["started", "succeeded", "failed", "cancelled"];
24404
- var connectionStatusSchema = z84.enum(CONNECTION_STATUSES);
24711
+ var connectionStatusSchema = z85.enum(CONNECTION_STATUSES);
24405
24712
  var ConnectionStatuses = connectionStatusSchema.enum;
24406
24713
  var OUTCOME_STATUSES = ["succeeded", "partial", "failed", "skipped", "cancelled"];
24407
- var outcomeStatusSchema = z84.enum(OUTCOME_STATUSES);
24714
+ var outcomeStatusSchema = z85.enum(OUTCOME_STATUSES);
24408
24715
  var OutcomeStatuses = outcomeStatusSchema.enum;
24409
24716
  var OUTCOME_TRIGGERS = ["manual", "scheduled", "agent", "startup", "retry", "push"];
24410
- var outcomeTriggerSchema = z84.enum(OUTCOME_TRIGGERS);
24717
+ var outcomeTriggerSchema = z85.enum(OUTCOME_TRIGGERS);
24411
24718
  var OutcomeTriggers = outcomeTriggerSchema.enum;
24412
24719
  var OUTCOME_REASON_CODES = [
24413
24720
  "AUTH_DENIED",
@@ -24444,7 +24751,7 @@ var OUTCOME_REASON_CODES = [
24444
24751
  "UNCAUGHT_EXCEPTION",
24445
24752
  "UNHANDLED_REJECTION"
24446
24753
  ];
24447
- var outcomeReasonCodeSchema = z84.enum(OUTCOME_REASON_CODES);
24754
+ var outcomeReasonCodeSchema = z85.enum(OUTCOME_REASON_CODES);
24448
24755
  var OutcomeReasonCodes = outcomeReasonCodeSchema.enum;
24449
24756
  var FEATURE_OPERATIONS = {
24450
24757
  search_console: ["sync", "inspect", "sitemap_submit"],
@@ -24474,7 +24781,7 @@ var FEATURE_OPERATIONS = {
24474
24781
  server: ["start", "crash"]
24475
24782
  };
24476
24783
  var FEATURE_NAMES = Object.keys(FEATURE_OPERATIONS);
24477
- var featureNameSchema = z84.enum(FEATURE_NAMES);
24784
+ var featureNameSchema = z85.enum(FEATURE_NAMES);
24478
24785
  var FeatureNames = featureNameSchema.enum;
24479
24786
  var OUTCOME_COUNT_KEYS = [
24480
24787
  "rows",
@@ -24512,16 +24819,16 @@ var OUTCOME_COUNT_KEYS = [
24512
24819
  ];
24513
24820
  var COUNT_KEY_SET = new Set(OUTCOME_COUNT_KEYS);
24514
24821
  var MAX_COUNT = 1e12;
24515
- var countValueSchema = z84.number().int().min(0).max(MAX_COUNT);
24516
- var countsSchema2 = z84.record(z84.string(), countValueSchema).refine((obj) => Object.keys(obj).length > 0 && Object.keys(obj).length <= 12, "counts must have 1 to 12 keys").refine((obj) => Object.keys(obj).every((k) => COUNT_KEY_SET.has(k)), "unknown count key");
24822
+ var countValueSchema = z85.number().int().min(0).max(MAX_COUNT);
24823
+ var countsSchema2 = z85.record(z85.string(), countValueSchema).refine((obj) => Object.keys(obj).length > 0 && Object.keys(obj).length <= 12, "counts must have 1 to 12 keys").refine((obj) => Object.keys(obj).every((k) => COUNT_KEY_SET.has(k)), "unknown count key");
24517
24824
  var WEBHOOK_TARGETS = ["first_party", "slack", "discord"];
24518
- var webhookTargetSchema = z84.enum(WEBHOOK_TARGETS);
24825
+ var webhookTargetSchema = z85.enum(WEBHOOK_TARGETS);
24519
24826
  var WebhookTargets = webhookTargetSchema.enum;
24520
24827
  var STATUS_CLASSES = ["2xx", "3xx", "4xx", "5xx", "timeout", "network", "blocked"];
24521
- var statusClassSchema = z84.enum(STATUS_CLASSES);
24828
+ var statusClassSchema = z85.enum(STATUS_CLASSES);
24522
24829
  var StatusClasses = statusClassSchema.enum;
24523
24830
  var DURATION_BUCKETS = ["under_1s", "1s_to_10s", "10s_to_1m", "1m_to_5m", "5m_to_30m", "30m_or_more"];
24524
- var durationBucketSchema = z84.enum(DURATION_BUCKETS);
24831
+ var durationBucketSchema = z85.enum(DURATION_BUCKETS);
24525
24832
  var DurationBuckets = durationBucketSchema.enum;
24526
24833
  function bucketDuration(durationMs) {
24527
24834
  const duration = Number.isFinite(durationMs) ? Math.max(0, durationMs) : 0;
@@ -24532,12 +24839,12 @@ function bucketDuration(durationMs) {
24532
24839
  if (duration < 18e5) return "5m_to_30m";
24533
24840
  return "30m_or_more";
24534
24841
  }
24535
- var errorNameSchema = z84.string().regex(/^[A-Z_$][\w$]{0,39}$/i);
24536
- var agentSlugSchema = z84.string().regex(/^[a-z0-9][a-z0-9._-]{0,39}$/);
24537
- var providerNameSchema2 = z84.enum(PROVIDER_NAMES);
24538
- var modelIdSchema2 = z84.string().regex(/^[A-Z0-9][\w.:/@-]{0,99}$/i).refine((v) => !v.includes("://"), "a model id is never a URL");
24539
- var slugSchema = z84.string().regex(/^[a-z0-9][a-z0-9._-]{0,31}$/);
24540
- var integrationConnectionPropertiesSchema = z84.object({
24842
+ var errorNameSchema = z85.string().regex(/^[A-Z_$][\w$]{0,39}$/i);
24843
+ var agentSlugSchema = z85.string().regex(/^[a-z0-9][a-z0-9._-]{0,39}$/);
24844
+ var providerNameSchema2 = z85.enum(PROVIDER_NAMES);
24845
+ var modelIdSchema2 = z85.string().regex(/^[A-Z0-9][\w.:/@-]{0,99}$/i).refine((v) => !v.includes("://"), "a model id is never a URL");
24846
+ var slugSchema = z85.string().regex(/^[a-z0-9][a-z0-9._-]{0,31}$/);
24847
+ var integrationConnectionPropertiesSchema = z85.object({
24541
24848
  integration: integrationNameSchema,
24542
24849
  provider: providerNameSchema2.optional(),
24543
24850
  action: connectionActionSchema,
@@ -24548,9 +24855,9 @@ var integrationConnectionPropertiesSchema = z84.object({
24548
24855
  surface: outcomeSurfaceSchema.optional(),
24549
24856
  agent: agentSlugSchema.optional(),
24550
24857
  durationBucket: durationBucketSchema.optional(),
24551
- attempt: z84.number().int().min(1).max(1e6).optional(),
24858
+ attempt: z85.number().int().min(1).max(1e6).optional(),
24552
24859
  /** The install's first success of this kind; set by the helpers, never by callers. */
24553
- first: z84.literal(true).optional()
24860
+ first: z85.literal(true).optional()
24554
24861
  }).strict().refine(
24555
24862
  (p) => p.integration === IntegrationNames.provider === (p.provider !== void 0),
24556
24863
  "provider is required for, and only for, integration provider"
@@ -24558,9 +24865,9 @@ var integrationConnectionPropertiesSchema = z84.object({
24558
24865
  (p) => p.status === ConnectionStatuses.succeeded || p.status === ConnectionStatuses.started || p.reasonCode !== void 0,
24559
24866
  "a failed or cancelled attempt needs a reasonCode"
24560
24867
  );
24561
- var featureCompletedPropertiesSchema = z84.object({
24868
+ var featureCompletedPropertiesSchema = z85.object({
24562
24869
  feature: featureNameSchema,
24563
- operation: z84.string().regex(/^[a-z][a-z_]{0,31}$/),
24870
+ operation: z85.string().regex(/^[a-z][a-z_]{0,31}$/),
24564
24871
  status: outcomeStatusSchema,
24565
24872
  trigger: outcomeTriggerSchema.optional(),
24566
24873
  surface: outcomeSurfaceSchema.optional(),
@@ -24575,17 +24882,17 @@ var featureCompletedPropertiesSchema = z84.object({
24575
24882
  provider: providerNameSchema2.optional(),
24576
24883
  model: modelIdSchema2.optional(),
24577
24884
  modelProvider: slugSchema.optional(),
24578
- sampleRate: z84.number().int().min(1).max(1e6).optional(),
24579
- droppedBefore: z84.number().int().min(0).max(MAX_COUNT).optional(),
24580
- domainHash: z84.string().regex(/^[0-9a-f]{64}$/).optional(),
24581
- first: z84.literal(true).optional()
24885
+ sampleRate: z85.number().int().min(1).max(1e6).optional(),
24886
+ droppedBefore: z85.number().int().min(0).max(MAX_COUNT).optional(),
24887
+ domainHash: z85.string().regex(/^[0-9a-f]{64}$/).optional(),
24888
+ first: z85.literal(true).optional()
24582
24889
  }).strict().refine(
24583
24890
  (p) => FEATURE_OPERATIONS[p.feature].includes(p.operation),
24584
24891
  "operation is not one this feature reports"
24585
24892
  ).refine((p) => p.status === OutcomeStatuses.succeeded || p.reasonCode !== void 0, "a non-succeeded outcome needs a reasonCode");
24586
24893
  var INSTALL_SOURCES = ["npm", "homebrew", "docker", "source"];
24587
- var installSourceSchema = z84.enum(INSTALL_SOURCES);
24588
- var installRefSchema = z84.string().regex(/^[a-z0-9][a-z0-9-]{0,31}$/);
24894
+ var installSourceSchema = z85.enum(INSTALL_SOURCES);
24895
+ var installRefSchema = z85.string().regex(/^[a-z0-9][a-z0-9-]{0,31}$/);
24589
24896
  function normalizeInstallRef(value) {
24590
24897
  const ref = value?.trim().toLowerCase();
24591
24898
  return ref && installRefSchema.safeParse(ref).success ? ref : void 0;
@@ -24620,11 +24927,11 @@ var INSTALL_STATE_USAGE_KEYS = [
24620
24927
  ];
24621
24928
  var fixedKeyCounts = (keys) => {
24622
24929
  const allowed = new Set(keys);
24623
- return z84.record(z84.string(), countValueSchema).refine((obj) => Object.keys(obj).every((k) => allowed.has(k)), "unknown key");
24930
+ return z85.record(z85.string(), countValueSchema).refine((obj) => Object.keys(obj).every((k) => allowed.has(k)), "unknown key");
24624
24931
  };
24625
- var installStatePropertiesSchema = z84.object({
24626
- providers: z84.array(providerNameSchema2).max(PROVIDER_NAMES.length),
24627
- integrations: z84.array(integrationNameSchema.exclude([IntegrationNames.provider])).max(INTEGRATION_NAMES.length),
24932
+ var installStatePropertiesSchema = z85.object({
24933
+ providers: z85.array(providerNameSchema2).max(PROVIDER_NAMES.length),
24934
+ integrations: z85.array(integrationNameSchema.exclude([IntegrationNames.provider])).max(INTEGRATION_NAMES.length),
24628
24935
  counts: fixedKeyCounts(INSTALL_STATE_COUNT_KEYS),
24629
24936
  usage24h: fixedKeyCounts(INSTALL_STATE_USAGE_KEYS),
24630
24937
  providerCalls24h: fixedKeyCounts(PROVIDER_NAMES).optional(),
@@ -24705,13 +25012,14 @@ function classifyProviderOutcomeError(err) {
24705
25012
  }
24706
25013
 
24707
25014
  // ../contracts/src/ui-telemetry.ts
24708
- import { z as z85 } from "zod";
25015
+ import { z as z86 } from "zod";
24709
25016
  var UI_PAGES = [
24710
25017
  "/",
24711
25018
  "/projects",
24712
25019
  "/projects/:projectName",
24713
25020
  "/projects/:projectName/portfolio",
24714
25021
  "/projects/:projectName/search-console",
25022
+ "/projects/:projectName/seo-data",
24715
25023
  "/projects/:projectName/conversions",
24716
25024
  "/projects/:projectName/local",
24717
25025
  "/projects/:projectName/discovery",
@@ -24734,11 +25042,12 @@ var UI_PAGES = [
24734
25042
  "not-found",
24735
25043
  "other"
24736
25044
  ];
24737
- var uiPageSchema = z85.enum(UI_PAGES);
25045
+ var uiPageSchema = z86.enum(UI_PAGES);
24738
25046
  var UI_PROJECT_TABS = [
24739
25047
  "overview",
24740
25048
  "portfolio",
24741
25049
  "search-console",
25050
+ "seo-data",
24742
25051
  "conversions",
24743
25052
  "local",
24744
25053
  "discovery",
@@ -24752,7 +25061,7 @@ var UI_PROJECT_TABS = [
24752
25061
  "settings",
24753
25062
  "other"
24754
25063
  ];
24755
- var uiProjectTabSchema = z85.enum(UI_PROJECT_TABS);
25064
+ var uiProjectTabSchema = z86.enum(UI_PROJECT_TABS);
24756
25065
  var UI_ACTIONS = [
24757
25066
  "sweep.launch",
24758
25067
  "sweep.cancel",
@@ -24775,6 +25084,9 @@ var UI_ACTIONS = [
24775
25084
  "integration.connect",
24776
25085
  "integration.disconnect",
24777
25086
  "traffic.sync",
25087
+ "seo.refresh",
25088
+ "seo.profile.save",
25089
+ "seo.cancel",
24778
25090
  "notification.save",
24779
25091
  "notification.test",
24780
25092
  "measurement_plan.publish",
@@ -24794,7 +25106,7 @@ var UI_ACTIONS = [
24794
25106
  /** A table search settled on a non-empty query (debounced or Enter; the text is never sent). */
24795
25107
  "search.submit"
24796
25108
  ];
24797
- var uiActionSchema = z85.enum(UI_ACTIONS);
25109
+ var uiActionSchema = z86.enum(UI_ACTIONS);
24798
25110
  var UI_INTEGRATIONS = [
24799
25111
  "google",
24800
25112
  "gsc",
@@ -24810,9 +25122,9 @@ var UI_INTEGRATIONS = [
24810
25122
  "traffic_cloud_run",
24811
25123
  "traffic_wordpress"
24812
25124
  ];
24813
- var uiIntegrationSchema = z85.enum(UI_INTEGRATIONS);
24814
- var UI_FILTERS = ["provider", "model", "location", "window", "query_class", "other"];
24815
- var uiFilterSchema = z85.enum(UI_FILTERS);
25125
+ var uiIntegrationSchema = z86.enum(UI_INTEGRATIONS);
25126
+ var UI_FILTERS = ["provider", "model", "location", "window", "query_class", "seoProfile", "other"];
25127
+ var uiFilterSchema = z86.enum(UI_FILTERS);
24816
25128
  var UI_EXPORT_FORMATS = ["csv", "json", "html"];
24817
25129
  var UI_ERROR_KINDS = ["render", "unhandled", "api"];
24818
25130
  var UI_STATUS_CLASSES = ["4xx", "5xx", "network"];
@@ -24897,45 +25209,45 @@ function isUiApiRouteTemplate(route) {
24897
25209
  return PARAM_SEGMENT.test(segment) || UI_ROUTE_FIXED_CHILDREN.has(`${previous}/${segment}`);
24898
25210
  });
24899
25211
  }
24900
- var uiEventBaseSchema = z85.object({
24901
- eventId: z85.string().uuid(),
24902
- uiSessionId: z85.string().uuid(),
25212
+ var uiEventBaseSchema = z86.object({
25213
+ eventId: z86.string().uuid(),
25214
+ uiSessionId: z86.string().uuid(),
24903
25215
  page: uiPageSchema
24904
25216
  });
24905
- var uiTelemetryEventSchema = z85.discriminatedUnion("event", [
25217
+ var uiTelemetryEventSchema = z86.discriminatedUnion("event", [
24906
25218
  uiEventBaseSchema.extend({
24907
- event: z85.literal("ui.page_viewed"),
25219
+ event: z86.literal("ui.page_viewed"),
24908
25220
  tab: uiProjectTabSchema.optional()
24909
25221
  }).strict(),
24910
25222
  uiEventBaseSchema.extend({
24911
- event: z85.literal("ui.action"),
25223
+ event: z86.literal("ui.action"),
24912
25224
  action: uiActionSchema,
24913
25225
  tab: uiProjectTabSchema.optional(),
24914
25226
  integration: uiIntegrationSchema.optional(),
24915
- format: z85.enum(UI_EXPORT_FORMATS).optional(),
25227
+ format: z86.enum(UI_EXPORT_FORMATS).optional(),
24916
25228
  filter: uiFilterSchema.optional()
24917
25229
  }).strict(),
24918
25230
  uiEventBaseSchema.extend({
24919
- event: z85.literal("ui.error"),
24920
- kind: z85.enum(UI_ERROR_KINDS),
25231
+ event: z86.literal("ui.error"),
25232
+ kind: z86.enum(UI_ERROR_KINDS),
24921
25233
  tab: uiProjectTabSchema.optional(),
24922
- component: z85.string().regex(UI_COMPONENT_PATTERN).optional(),
24923
- errorName: z85.string().regex(UI_ERROR_NAME_PATTERN).optional(),
24924
- route: z85.string().max(UI_API_ROUTE_MAX_LENGTH).refine(isUiApiRouteTemplate, "route must be a route template").optional(),
24925
- method: z85.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]).optional(),
24926
- statusClass: z85.enum(UI_STATUS_CLASSES).optional(),
24927
- status: z85.number().int().min(400).max(599).optional()
25234
+ component: z86.string().regex(UI_COMPONENT_PATTERN).optional(),
25235
+ errorName: z86.string().regex(UI_ERROR_NAME_PATTERN).optional(),
25236
+ route: z86.string().max(UI_API_ROUTE_MAX_LENGTH).refine(isUiApiRouteTemplate, "route must be a route template").optional(),
25237
+ method: z86.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]).optional(),
25238
+ statusClass: z86.enum(UI_STATUS_CLASSES).optional(),
25239
+ status: z86.number().int().min(400).max(599).optional()
24928
25240
  }).strict(),
24929
25241
  uiEventBaseSchema.extend({
24930
- event: z85.literal("ui.vitals"),
24931
- metric: z85.enum(UI_VITAL_METRICS),
24932
- rating: z85.enum(UI_VITAL_RATINGS),
25242
+ event: z86.literal("ui.vitals"),
25243
+ metric: z86.enum(UI_VITAL_METRICS),
25244
+ rating: z86.enum(UI_VITAL_RATINGS),
24933
25245
  tab: uiProjectTabSchema.optional()
24934
25246
  }).strict()
24935
25247
  ]);
24936
25248
 
24937
25249
  // ../contracts/src/feedback.ts
24938
- import { z as z86 } from "zod";
25250
+ import { z as z87 } from "zod";
24939
25251
 
24940
25252
  // ../contracts/src/log-redaction.ts
24941
25253
  var REDACTED = "[REDACTED]";
@@ -25087,7 +25399,7 @@ function redactEmbeddedUrls(value) {
25087
25399
 
25088
25400
  // ../contracts/src/feedback.ts
25089
25401
  var FEEDBACK_KINDS = ["struggle", "bug", "improvement", "other"];
25090
- var feedbackKindSchema = z86.enum(FEEDBACK_KINDS);
25402
+ var feedbackKindSchema = z87.enum(FEEDBACK_KINDS);
25091
25403
  var FEEDBACK_LIMITS = {
25092
25404
  summary: 500,
25093
25405
  details: 4e3,
@@ -25095,17 +25407,17 @@ var FEEDBACK_LIMITS = {
25095
25407
  command: 120,
25096
25408
  errorCode: 40
25097
25409
  };
25098
- var feedbackSubmissionSchema = z86.object({
25410
+ var feedbackSubmissionSchema = z87.object({
25099
25411
  kind: feedbackKindSchema,
25100
- summary: z86.string().trim().min(1).max(FEEDBACK_LIMITS.summary),
25101
- details: z86.string().trim().min(1).max(FEEDBACK_LIMITS.details).optional(),
25102
- area: z86.string().trim().min(1).max(FEEDBACK_LIMITS.area).optional(),
25103
- command: z86.string().trim().min(1).max(FEEDBACK_LIMITS.command).optional(),
25104
- errorCode: z86.string().trim().min(1).max(FEEDBACK_LIMITS.errorCode).optional()
25412
+ summary: z87.string().trim().min(1).max(FEEDBACK_LIMITS.summary),
25413
+ details: z87.string().trim().min(1).max(FEEDBACK_LIMITS.details).optional(),
25414
+ area: z87.string().trim().min(1).max(FEEDBACK_LIMITS.area).optional(),
25415
+ command: z87.string().trim().min(1).max(FEEDBACK_LIMITS.command).optional(),
25416
+ errorCode: z87.string().trim().min(1).max(FEEDBACK_LIMITS.errorCode).optional()
25105
25417
  }).strict();
25106
- var feedbackAcceptedDtoSchema = z86.object({
25107
- accepted: z86.boolean(),
25108
- id: z86.string()
25418
+ var feedbackAcceptedDtoSchema = z87.object({
25419
+ accepted: z87.boolean(),
25420
+ id: z87.string()
25109
25421
  });
25110
25422
  function redactFeedbackText(value, limit) {
25111
25423
  return truncateUtf16(
@@ -25184,7 +25496,7 @@ function asRecord(value) {
25184
25496
  }
25185
25497
 
25186
25498
  // ../contracts/src/tolerant-read.ts
25187
- import { z as z87 } from "zod";
25499
+ import { z as z88 } from "zod";
25188
25500
  var WRAPPER_TYPES = /* @__PURE__ */ new Set(["optional", "nullable", "default", "prefault", "readonly", "catch", "nonoptional"]);
25189
25501
  var DEPTH_LIMIT = 64;
25190
25502
  function defOf(schema) {
@@ -25195,9 +25507,9 @@ function cloneWith(schema, changes) {
25195
25507
  }
25196
25508
  function openPrimitive(values) {
25197
25509
  if (values.length === 0) return void 0;
25198
- if (values.every((value) => typeof value === "string")) return z87.string();
25199
- if (values.every((value) => typeof value === "number")) return z87.number();
25200
- if (values.every((value) => typeof value === "boolean")) return z87.boolean();
25510
+ if (values.every((value) => typeof value === "string")) return z88.string();
25511
+ if (values.every((value) => typeof value === "number")) return z88.number();
25512
+ if (values.every((value) => typeof value === "boolean")) return z88.boolean();
25201
25513
  return void 0;
25202
25514
  }
25203
25515
  function walk2(schema, open, memo, depth) {
@@ -25211,7 +25523,7 @@ function walk2(schema, open, memo, depth) {
25211
25523
  const shape = Object.fromEntries(Object.entries(schema.shape).map(([key, child]) => [key, next(child)]));
25212
25524
  const declared = def.catchall;
25213
25525
  const catchall = open.get(schema) ?? (declared && defOf(declared).type !== "never" ? next(declared) : void 0);
25214
- result = catchall ? z87.object(shape).catchall(catchall) : z87.object(shape);
25526
+ result = catchall ? z88.object(shape).catchall(catchall) : z88.object(shape);
25215
25527
  } else if (WRAPPER_TYPES.has(def.type)) {
25216
25528
  const inner = def.innerType;
25217
25529
  const mapped = next(inner);
@@ -25228,10 +25540,10 @@ function walk2(schema, open, memo, depth) {
25228
25540
  const options = def.options;
25229
25541
  const mapped = options.map(next);
25230
25542
  const changed = mapped.some((option, index) => option !== options[index]);
25231
- result = !changed ? schema : def.discriminator ? z87.union(mapped) : cloneWith(schema, { options: mapped });
25543
+ result = !changed ? schema : def.discriminator ? z88.union(mapped) : cloneWith(schema, { options: mapped });
25232
25544
  } else if (def.type === "record") {
25233
25545
  const keyType = def.keyType, valueType = def.valueType;
25234
- const mappedKey = defOf(keyType).type === "enum" ? z87.string() : keyType;
25546
+ const mappedKey = defOf(keyType).type === "enum" ? z88.string() : keyType;
25235
25547
  const mappedValue = next(valueType);
25236
25548
  result = mappedKey === keyType && mappedValue === valueType ? schema : cloneWith(schema, { keyType: mappedKey, valueType: mappedValue });
25237
25549
  } else if (def.type === "intersection") {
@@ -25247,7 +25559,7 @@ function walk2(schema, open, memo, depth) {
25247
25559
  result = changed ? cloneWith(schema, { items: mappedItems, rest: mappedRest }) : schema;
25248
25560
  } else if (def.type === "lazy") {
25249
25561
  const getter = def.getter;
25250
- result = z87.lazy(() => next(getter()));
25562
+ result = z88.lazy(() => next(getter()));
25251
25563
  } else if (def.type === "enum") {
25252
25564
  result = openPrimitive(Object.values(def.entries)) ?? schema;
25253
25565
  } else if (def.type === "literal") {
@@ -25262,8 +25574,8 @@ function tolerantReadSchema(schema, options = {}) {
25262
25574
  }
25263
25575
 
25264
25576
  // ../contracts/src/sentiment-read.ts
25265
- import { z as z88 } from "zod";
25266
- var OPEN_COUNTS = { openKeys: [[sentimentCountsSchema, z88.number().int().nonnegative()]] };
25577
+ import { z as z89 } from "zod";
25578
+ var OPEN_COUNTS = { openKeys: [[sentimentCountsSchema, z89.number().int().nonnegative()]] };
25267
25579
  var sentimentSettingsReadSchema = tolerantReadSchema(sentimentSettingsSchema, OPEN_COUNTS);
25268
25580
  var sentimentSummaryReadSchema = tolerantReadSchema(sentimentSummarySchema, OPEN_COUNTS);
25269
25581
  var sentimentEvidencePageReadSchema = tolerantReadSchema(sentimentEvidencePageSchema, OPEN_COUNTS);
@@ -25293,29 +25605,29 @@ function rateOverChecked(numerator, answers, excluded, field) {
25293
25605
  }
25294
25606
 
25295
25607
  // ../contracts/src/cli-catalog.ts
25296
- import { z as z89 } from "zod";
25297
- var cliCatalogOptionSchema = z89.object({
25298
- name: z89.string(),
25299
- type: z89.enum(["string", "boolean"]),
25300
- multiple: z89.boolean()
25301
- });
25302
- var cliCatalogCommandSchema = z89.object({
25303
- id: z89.string(),
25304
- path: z89.array(z89.string()).min(1),
25305
- usage: z89.string(),
25306
- supportsDryRun: z89.boolean(),
25307
- windows: z89.array(z89.string()).optional(),
25308
- options: z89.array(cliCatalogOptionSchema),
25608
+ import { z as z90 } from "zod";
25609
+ var cliCatalogOptionSchema = z90.object({
25610
+ name: z90.string(),
25611
+ type: z90.enum(["string", "boolean"]),
25612
+ multiple: z90.boolean()
25613
+ });
25614
+ var cliCatalogCommandSchema = z90.object({
25615
+ id: z90.string(),
25616
+ path: z90.array(z90.string()).min(1),
25617
+ usage: z90.string(),
25618
+ supportsDryRun: z90.boolean(),
25619
+ windows: z90.array(z90.string()).optional(),
25620
+ options: z90.array(cliCatalogOptionSchema),
25309
25621
  access: operationAccessSchema
25310
25622
  });
25311
- var cliCatalogSchema = z89.object({
25312
- version: z89.string(),
25313
- globalOptions: z89.array(cliCatalogOptionSchema),
25314
- groups: z89.array(z89.object({
25315
- root: z89.string(),
25316
- section: z89.string(),
25317
- summary: z89.string(),
25318
- commands: z89.array(cliCatalogCommandSchema)
25623
+ var cliCatalogSchema = z90.object({
25624
+ version: z90.string(),
25625
+ globalOptions: z90.array(cliCatalogOptionSchema),
25626
+ groups: z90.array(z90.object({
25627
+ root: z90.string(),
25628
+ section: z90.string(),
25629
+ summary: z90.string(),
25630
+ commands: z90.array(cliCatalogCommandSchema)
25319
25631
  }))
25320
25632
  });
25321
25633
 
@@ -25413,6 +25725,7 @@ export {
25413
25725
  compareText,
25414
25726
  sortedUnique,
25415
25727
  hostOf,
25728
+ normalizeHostname,
25416
25729
  registrableDomain,
25417
25730
  normalizeProjectDomain,
25418
25731
  normalizeCompetitorDomain,
@@ -25550,6 +25863,7 @@ export {
25550
25863
  measurementPlanCounts,
25551
25864
  compileMeasurementPlanPreview,
25552
25865
  canonicalMeasurementPlanJson,
25866
+ matchesMeasurementTargetUrl,
25553
25867
  SourceRelationships,
25554
25868
  CompletionStatuses,
25555
25869
  CostBases,
@@ -25710,6 +26024,7 @@ export {
25710
26024
  competitorAliasesRequestSchema,
25711
26025
  competitorEntryParts,
25712
26026
  formatPercent,
26027
+ formatNumber,
25713
26028
  formatIsoDate,
25714
26029
  formatIsoDateInTimeZone,
25715
26030
  calendarDateRange,
@@ -25840,6 +26155,7 @@ export {
25840
26155
  OperationAccesses,
25841
26156
  OPERATION_ACCESS_HEADER,
25842
26157
  STORED_ONLY_HEADER,
26158
+ READ_SEMANTIC_OPERATIONS,
25843
26159
  operationAccess,
25844
26160
  maxOperationAccess,
25845
26161
  matchOperationTemplate,
@@ -26413,6 +26729,8 @@ export {
26413
26729
  READ_ONLY_SCOPE,
26414
26730
  WILDCARD_SCOPE,
26415
26731
  RESEARCH_RUN_SCOPE,
26732
+ SEO_RUN_SCOPE,
26733
+ SEO_WRITE_SCOPE,
26416
26734
  PROJECTS_WRITE_SCOPE,
26417
26735
  ADS_WRITE_SCOPE,
26418
26736
  ADS_APPROVE_SCOPE,
@@ -26499,5 +26817,32 @@ export {
26499
26817
  UNATTRIBUTED_MENTION_REASON,
26500
26818
  unattributedAnswersLabel,
26501
26819
  uncheckedSourcesLabel,
26502
- rateOverChecked
26820
+ rateOverChecked,
26821
+ SeoCapabilities,
26822
+ SeoProviders,
26823
+ SeoTargetKinds,
26824
+ SeoScopeKinds,
26825
+ SeoRunStatuses,
26826
+ SeoAvailability,
26827
+ seoProfileInputSchema,
26828
+ seoProfileSchema,
26829
+ seoProfileListSchema,
26830
+ seoContextSchema,
26831
+ seoStatusSchema,
26832
+ seoRefreshIntentInputSchema,
26833
+ seoQuoteSchema,
26834
+ seoSyncInputSchema,
26835
+ emptySeoResults,
26836
+ seoRunSchema,
26837
+ seoRunDetailSchema,
26838
+ seoRunListSchema,
26839
+ seoEvidenceQuerySchema,
26840
+ seoKeywordMetricsListSchema,
26841
+ seoDomainIntelligenceListSchema,
26842
+ seoRankedKeywordListSchema,
26843
+ seoOverviewSchema,
26844
+ seoOperatorTaskSchema,
26845
+ seoReconcileInputSchema,
26846
+ seoReconcileResultSchema,
26847
+ SeoAdapterOutcomes
26503
26848
  };