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