@canonry/canonry 7.112.0 → 7.114.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 (144) hide show
  1. package/assets/agent-workspace/skills/canonry/references/aeo-analysis.md +8 -0
  2. package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +3 -0
  3. package/assets/assets/AccessControls-CZ9e8JQj.js +2 -0
  4. package/assets/assets/{AgentSetupPage-q1Ku1PAd.js → AgentSetupPage-GAYSye6c.js} +1 -1
  5. package/assets/assets/{AuditHistoryPanel-6EnlABwM.js → AuditHistoryPanel-B8Nvxw1T.js} +1 -1
  6. package/assets/assets/{BacklinksPage-BaHCJEuK.js → BacklinksPage-DYDrtPvl.js} +1 -1
  7. package/assets/assets/{ChartPrimitives-C3lJj3eO.js → ChartPrimitives-D5jY1n81.js} +1 -1
  8. package/assets/assets/{HistoryPage-B_NVeDCn.js → HistoryPage-oWlfgq2q.js} +1 -1
  9. package/assets/assets/MeasurementPropertyPage-8_IMBhbd.js +4 -0
  10. package/assets/assets/ProjectPage-mopnzPrl.js +15 -0
  11. package/assets/assets/{RunsPage-9T1OrQw3.js → RunsPage-BQVy2FfY.js} +1 -1
  12. package/assets/assets/{ServerTrafficSection-iUdFKWEc.js → ServerTrafficSection-rxO0hr0U.js} +1 -1
  13. package/assets/assets/{SettingsPage-BswQYkkB.js → SettingsPage-DNd1rljp.js} +1 -1
  14. package/assets/assets/{ToneBadge-CWufDJgM.js → ToneBadge-ClBoU45-.js} +2 -2
  15. package/assets/assets/{TrafficPage-DN9DxoWm.js → TrafficPage-DS7e2HJF.js} +1 -1
  16. package/assets/assets/{TrafficSourceDetailPage-D6TdTyP-.js → TrafficSourceDetailPage-GM_NYof2.js} +1 -1
  17. package/assets/assets/{account-context-CyE8qMvH.js → account-context-DPSUr6ab.js} +1 -1
  18. package/assets/assets/{agent-trust-copy-CinW-f_8.js → agent-trust-copy-CzC0CyvN.js} +1 -1
  19. package/assets/assets/{card-CI9gz2Hb.js → card-BuGARNWu.js} +1 -1
  20. package/assets/assets/index-7gTTbr2Y.js +43 -0
  21. package/assets/assets/{query-client-BlAtm9zS.js → query-client-20-WKWRF.js} +1 -1
  22. package/assets/assets/{react-query-DE_LaZkX.js → react-query-BcbS-PEL.js} +1 -1
  23. package/assets/assets/{react-sigma_core.esm.min-CZkN6sL0.js → react-sigma_core.esm.min-BPHKUIql.js} +1 -1
  24. package/assets/assets/{server-traffic-Ci9JbS2U.js → server-traffic-k9hvgv11.js} +1 -1
  25. package/assets/assets/service-CNCw9nYd.js +1 -0
  26. package/assets/index.html +8 -8
  27. package/dist/{ads-WRMNYPJ7.js → ads-MBUYUCIO.js} +3 -3
  28. package/dist/{agent-V4PAGAPZ.js → agent-H4TXDFUY.js} +7 -7
  29. package/dist/{agent-ask-3LAAT4WN.js → agent-ask-VYCPGN7W.js} +3 -3
  30. package/dist/{agent-conversations-TVNDZY54.js → agent-conversations-HOAJSJ2V.js} +3 -3
  31. package/dist/{agent-journeys-UB7ZGAKP.js → agent-journeys-GCN2DMNW.js} +3 -3
  32. package/dist/{agent-memory-RWF2WODB.js → agent-memory-5ZY5GMXL.js} +3 -3
  33. package/dist/{agent-providers-77A45KZD.js → agent-providers-3BFMXJZZ.js} +3 -3
  34. package/dist/{agent-transcript-K5WZJHJX.js → agent-transcript-BMGQADZ2.js} +3 -3
  35. package/dist/{analytics-RNSYOGUP.js → analytics-4OBHR4V2.js} +3 -3
  36. package/dist/{apply-UU6GFYIJ.js → apply-JQHWDI43.js} +3 -3
  37. package/dist/{backfill-DOYPYZJL.js → backfill-XU4QLLNT.js} +10 -10
  38. package/dist/{backlinks-UKRILGDJ.js → backlinks-LFDFDL4X.js} +3 -3
  39. package/dist/{bing-P6GTLGIP.js → bing-HSZ2HYX4.js} +3 -3
  40. package/dist/{bootstrap-BRXDKCNB.js → bootstrap-5M3WJOHV.js} +10 -10
  41. package/dist/{cdp-CPGVPWTU.js → cdp-3L2UFZ6G.js} +7 -7
  42. package/dist/{chunk-NICTKJ3O.js → chunk-3T6YDOJX.js} +1 -1
  43. package/dist/{chunk-M2RTTCLC.js → chunk-4IB3LHZV.js} +3 -3
  44. package/dist/{chunk-N5K35MDQ.js → chunk-4UZR7UUC.js} +1 -1
  45. package/dist/{chunk-SNL4C4BV.js → chunk-AP7ZGBXF.js} +2 -2
  46. package/dist/{chunk-JCK5TDIU.js → chunk-B4CKWKSX.js} +858 -712
  47. package/dist/{chunk-W3UYVNYQ.js → chunk-BRAUKTBG.js} +1 -1
  48. package/dist/{chunk-4WXNCSYL.js → chunk-CD5JEVPS.js} +2 -2
  49. package/dist/{chunk-YXCMVHYJ.js → chunk-CHDPNIRF.js} +4 -4
  50. package/dist/{chunk-NLU2MMFA.js → chunk-D7KVKYYT.js} +279 -90
  51. package/dist/{chunk-YN7OV22K.js → chunk-EUQ6F4FY.js} +4 -4
  52. package/dist/{chunk-ZVDUBOE4.js → chunk-FXMIX2BP.js} +30 -3
  53. package/dist/{chunk-SJD3ZAEH.js → chunk-GLAOBAJP.js} +2 -2
  54. package/dist/{chunk-B27F7C6S.js → chunk-HDCBIMFZ.js} +5 -5
  55. package/dist/{chunk-4PMS7CAF.js → chunk-HK72OBW5.js} +2 -2
  56. package/dist/{chunk-DZCJNSBY.js → chunk-HNHJ7HQK.js} +1 -1
  57. package/dist/{chunk-S6ULO6H5.js → chunk-K3H67IQZ.js} +1 -1
  58. package/dist/{chunk-LGAQXH3L.js → chunk-KOMFBAUK.js} +2 -1
  59. package/dist/{chunk-7IF576RC.js → chunk-M5C7R7OF.js} +5 -5
  60. package/dist/{chunk-Q4XHWZDT.js → chunk-MHNMMFON.js} +1 -1
  61. package/dist/{chunk-I4YRKF6G.js → chunk-MSBSKTO2.js} +3 -3
  62. package/dist/{chunk-CIDXBCEW.js → chunk-NNHI6SOT.js} +2 -2
  63. package/dist/{chunk-WHBLQJGZ.js → chunk-ODFPL6P5.js} +1 -1
  64. package/dist/{chunk-JHAG6DEG.js → chunk-PPM2ZLVN.js} +3 -3
  65. package/dist/{chunk-KYZ5A7AX.js → chunk-QDBKBXC7.js} +1 -1
  66. package/dist/{chunk-ZMCRVQ6Q.js → chunk-RFJM6G7L.js} +1 -1
  67. package/dist/{chunk-Y6D7K63F.js → chunk-RSTJWK3S.js} +3 -3
  68. package/dist/{chunk-R4PQ7D32.js → chunk-SGQGEKBN.js} +7 -7
  69. package/dist/{chunk-F6CYO37C.js → chunk-TCCGE2WF.js} +7 -7
  70. package/dist/{chunk-C44S7EE7.js → chunk-TJGGK6IQ.js} +4 -4
  71. package/dist/{chunk-OBDRDAIK.js → chunk-UK2WX3PM.js} +1 -1
  72. package/dist/{chunk-2LXLJXTG.js → chunk-VTT4VYJC.js} +2 -2
  73. package/dist/{chunk-AZPWF42S.js → chunk-WBGBCRVH.js} +26 -2
  74. package/dist/{chunk-YWKALX6A.js → chunk-WMMIMZHL.js} +4 -4
  75. package/dist/{chunk-4ALKLWSQ.js → chunk-WW7XJXSQ.js} +1560 -1297
  76. package/dist/{chunk-TDSISMOJ.js → chunk-X5ITRJ5N.js} +22 -22
  77. package/dist/{chunk-PT3VROG7.js → chunk-Y2ZQFWH2.js} +399 -366
  78. package/dist/{chunk-TDRPVIUB.js → chunk-ZWWEWFCM.js} +1 -1
  79. package/dist/{citations-GW2ELWME.js → citations-KLOXXIX5.js} +52 -4
  80. package/dist/{cli-catalog-PDU4Z4IO.js → cli-catalog-SPUYWLST.js} +3 -3
  81. package/dist/{cli-commands-XWIWF4VG.js → cli-commands-4WVVOSGO.js} +7 -7
  82. package/dist/cli.js +13 -13
  83. package/dist/{competitor-MS4P6GJ4.js → competitor-TVOPWBTO.js} +3 -3
  84. package/dist/{content-3QQRT3Q4.js → content-FOHOEMPN.js} +3 -3
  85. package/dist/{dashboard-FDVY7CMI.js → dashboard-Y2MWS75I.js} +6 -6
  86. package/dist/{demo-WRF3ZSQ5.js → demo-KKYQOGOL.js} +1 -1
  87. package/dist/{demo-server-Q77EUE5A.js → demo-server-7W7G3WBF.js} +13 -12
  88. package/dist/{discover-BAKAHH5X.js → discover-NEFL3GNJ.js} +4 -4
  89. package/dist/{discover-eval-KMYMVZVX.js → discover-eval-5UTXVZN2.js} +3 -3
  90. package/dist/{doctor-OAYNGBBT.js → doctor-IPEY4PEU.js} +3 -3
  91. package/dist/{evidence-FEDSZTLW.js → evidence-2I55I5RU.js} +3 -3
  92. package/dist/{export-cmd-OYQVBE5C.js → export-cmd-CMCUOJY4.js} +3 -3
  93. package/dist/{ga-MWJQ2S4D.js → ga-HBFR7YAV.js} +3 -3
  94. package/dist/{gbp-K4FXHF6N.js → gbp-6KGE44C3.js} +3 -3
  95. package/dist/{google-B6VUPLQN.js → google-PFQMLRET.js} +4 -4
  96. package/dist/{google-marketing-3KKTACAA.js → google-marketing-DKZPDKSJ.js} +1 -1
  97. package/dist/{health-cmd-YEHYFXEN.js → health-cmd-YQ2CYZJF.js} +4 -4
  98. package/dist/{history-5EYU4PQT.js → history-GC6KSYLZ.js} +3 -3
  99. package/dist/index.d.ts +28 -28
  100. package/dist/index.js +26 -26
  101. package/dist/{init-2HLTEB5Y.js → init-YOI6WNXX.js} +12 -12
  102. package/dist/{insights-MW5VTF7N.js → insights-M5H3P2VD.js} +3 -3
  103. package/dist/intelligence-service-ODVPS6D6.js +16 -0
  104. package/dist/{journeys-YW2IWDMN.js → journeys-EXIVMEY7.js} +3 -3
  105. package/dist/{keys-RRT26LGV.js → keys-VFAC5KWZ.js} +3 -3
  106. package/dist/{keyword-KSN3JTCX.js → keyword-I5TY67XC.js} +3 -3
  107. package/dist/{logs-IPAE4F4W.js → logs-3LEGAI5D.js} +3 -3
  108. package/dist/{mcp-WJR6RKYK.js → mcp-6TETRXJ2.js} +4 -4
  109. package/dist/mcp.js +10 -10
  110. package/dist/{measurement-plan-DGLUEK7M.js → measurement-plan-76O3EEXW.js} +5 -5
  111. package/dist/{notify-3QOG6NWS.js → notify-KIUJJX7L.js} +3 -3
  112. package/dist/{organic-evidence-M3VSSLQR.js → organic-evidence-R7TA4MZM.js} +3 -3
  113. package/dist/{overview-7RRCHUWZ.js → overview-PMD3GYMJ.js} +5 -5
  114. package/dist/{project-T3JZJPVK.js → project-R7AAYKYH.js} +3 -3
  115. package/dist/{project-setup-Y6DSDF4V.js → project-setup-VDEHXJ6V.js} +3 -3
  116. package/dist/{query-24JZPB3M.js → query-QPPVYE6C.js} +3 -3
  117. package/dist/{research-ERVKTKMV.js → research-UZCT66YL.js} +3 -3
  118. package/dist/{results-export-KSGIWPAM.js → results-export-YITLJ6QN.js} +3 -3
  119. package/dist/{run-XX6YUJRI.js → run-6WWMQSYW.js} +5 -5
  120. package/dist/{schedule-JBZENJ2V.js → schedule-ZZ4N4NWR.js} +3 -3
  121. package/dist/{search-V67KUYIZ.js → search-PFNLSSB2.js} +3 -3
  122. package/dist/{serve-HTQ76BFW.js → serve-7OKBRXOG.js} +27 -27
  123. package/dist/{session-AJ6R6K4B.js → session-UOJNPN2F.js} +14 -14
  124. package/dist/{settings-KVKWFTJZ.js → settings-J5DVHHRL.js} +3 -3
  125. package/dist/{sitemaps-UDIC4YUU.js → sitemaps-E4EEEB2G.js} +3 -3
  126. package/dist/{skills-35CPSNXM.js → skills-XOEQIEV6.js} +2 -2
  127. package/dist/{snapshot-OHGM7JBF.js → snapshot-MHNO5GFX.js} +3 -3
  128. package/dist/{src-GNBUAHT7.js → src-TWXSURXK.js} +2 -2
  129. package/dist/{status-GKWSTMUV.js → status-CASSB3RI.js} +5 -5
  130. package/dist/{technical-aeo-IHQYV4TT.js → technical-aeo-WNNXAOVE.js} +3 -3
  131. package/dist/{telemetry-AA2CONG2.js → telemetry-5PJFKHDT.js} +4 -4
  132. package/dist/{tools-CWNRV7PQ.js → tools-OACYTLJ5.js} +11 -11
  133. package/dist/{traffic-F7WR32VB.js → traffic-Q5QRTBKR.js} +5 -5
  134. package/dist/{trends-YB2GNT75.js → trends-4X5EDJAA.js} +3 -3
  135. package/dist/{users-PXTIUGXI.js → users-5FZLNPXR.js} +3 -3
  136. package/dist/{visibility-stats-KSPE4GHQ.js → visibility-stats-AKIM3332.js} +4 -4
  137. package/dist/{wordpress-YGSH5MSK.js → wordpress-CO6XLP53.js} +3 -3
  138. package/package.json +1 -1
  139. package/assets/assets/AccessControls-BxtFDXYH.js +0 -2
  140. package/assets/assets/MeasurementPropertyPage-DxCRxoIF.js +0 -4
  141. package/assets/assets/ProjectPage-BjGsilZJ.js +0 -15
  142. package/assets/assets/index-DshFRkPM.js +0 -43
  143. package/assets/assets/service-CiYDMju_.js +0 -1
  144. package/dist/intelligence-service-PTAA5WJB.js +0 -16
@@ -11878,6 +11878,7 @@ var SOURCE_CATEGORY_RULES = [
11878
11878
  { pattern: "threads.net", category: "social", label: "Threads" },
11879
11879
  { pattern: "pinterest.com", category: "social", label: "Pinterest" },
11880
11880
  { pattern: "tiktok.com", category: "social", label: "TikTok" },
11881
+ { pattern: "lemon8-app.com", category: "social", label: "Lemon8" },
11881
11882
  // Video
11882
11883
  { pattern: "youtube.com", category: "video", label: "YouTube" },
11883
11884
  { pattern: "youtu.be", category: "video", label: "YouTube" },
@@ -14847,6 +14848,7 @@ var STORED_READ_OPERATIONS = new Set(withLegacyAgentReadinessPaths([
14847
14848
  "GET /api/v1/projects/{name}/health/latest",
14848
14849
  "GET /api/v1/projects/{name}/health/history",
14849
14850
  "GET /api/v1/projects/{name}/citations/visibility",
14851
+ "GET /api/v1/projects/{name}/citations/urls",
14850
14852
  "GET /api/v1/projects/{name}/overview",
14851
14853
  "GET /api/v1/projects/{name}/search",
14852
14854
  "GET /api/v1/mcp/profile",
@@ -18344,14 +18346,14 @@ function median(values) {
18344
18346
  const middle = Math.floor(sorted.length / 2);
18345
18347
  return sorted.length % 2 === 1 ? sorted[middle] : (sorted[middle - 1] + sorted[middle]) / 2;
18346
18348
  }
18347
- function wilsonInterval(successes, n, z99 = 1.96) {
18349
+ function wilsonInterval(successes, n, z100 = 1.96) {
18348
18350
  if (!Number.isFinite(n) || n <= 0) return null;
18349
18351
  const s = Math.max(0, Math.min(successes, n));
18350
18352
  const p = s / n;
18351
- const z210 = z99 * z99;
18353
+ const z210 = z100 * z100;
18352
18354
  const denom = 1 + z210 / n;
18353
18355
  const center = (p + z210 / (2 * n)) / denom;
18354
- const margin = z99 / denom * Math.sqrt(p * (1 - p) / n + z210 / (4 * n * n));
18356
+ const margin = z100 / denom * Math.sqrt(p * (1 - p) / n + z210 / (4 * n * n));
18355
18357
  return {
18356
18358
  low: round(Math.max(0, center - margin)),
18357
18359
  high: round(Math.min(1, center + margin))
@@ -26112,21 +26114,157 @@ var snapshotReportSchema = z84.object({
26112
26114
  summary: snapshotSummarySchema
26113
26115
  });
26114
26116
 
26115
- // ../contracts/src/competitor-suggestions.ts
26117
+ // ../contracts/src/citation-urls.ts
26116
26118
  import { z as z85 } from "zod";
26117
- var competitorSuggestionsQuerySchema = z85.object({
26119
+ var CITED_URL_TRACKING_KEYS = /* @__PURE__ */ new Set([
26120
+ "fbclid",
26121
+ "gclid",
26122
+ "msclkid",
26123
+ "ttclid",
26124
+ "li_fat_id",
26125
+ "igshid",
26126
+ "yclid",
26127
+ "dclid",
26128
+ "gbraid",
26129
+ "wbraid",
26130
+ "bingid",
26131
+ "srsltid",
26132
+ "mc_cid",
26133
+ "mc_eid",
26134
+ "_ga",
26135
+ "_gl",
26136
+ "share_id",
26137
+ "rdt",
26138
+ "si"
26139
+ ]);
26140
+ function citedUrlHost(value) {
26141
+ const trimmed = value.trim().toLowerCase();
26142
+ if (!trimmed) return null;
26143
+ let host;
26144
+ try {
26145
+ host = new URL(/^[a-z][a-z0-9+.-]*:\/\//.test(trimmed) ? trimmed : `https://${trimmed}`).hostname;
26146
+ } catch {
26147
+ return null;
26148
+ }
26149
+ return host.replace(/^(?:www|m|old)\./, "") || null;
26150
+ }
26151
+ function canonicalCitedUrl(value) {
26152
+ let url;
26153
+ try {
26154
+ url = new URL(value.trim());
26155
+ } catch {
26156
+ return null;
26157
+ }
26158
+ if (url.protocol !== "http:" && url.protocol !== "https:") return null;
26159
+ const host = url.hostname.toLowerCase().replace(/^(?:www|m|old)\./, "");
26160
+ let path = url.pathname.replace(/\/+$/, "");
26161
+ const reddit = /^\/r\/([^/]+)\/comments\/([a-z0-9]+)/i.exec(path);
26162
+ if ((host === "reddit.com" || host.endsWith(".reddit.com")) && reddit) {
26163
+ path = `/r/${reddit[1].toLowerCase()}/comments/${reddit[2].toLowerCase()}`;
26164
+ }
26165
+ const params = [...url.searchParams.entries()].filter(([key]) => !/^utm_/i.test(key) && !CITED_URL_TRACKING_KEYS.has(key.toLowerCase())).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
26166
+ const query = params.length > 0 ? `?${new URLSearchParams(params).toString()}` : "";
26167
+ return `https://${host}${path}${query}`;
26168
+ }
26169
+ var CITATION_URL_CATEGORY_HINT = `one or more (comma-separated) of: ${sourceCategorySchema.options.join(", ")}`;
26170
+ function parseCitationUrlCategories(value) {
26171
+ const categories = [];
26172
+ for (const member of value.split(",").map((part) => part.trim()).filter(Boolean)) {
26173
+ const parsed = sourceCategorySchema.safeParse(member);
26174
+ if (!parsed.success) return null;
26175
+ if (!categories.includes(parsed.data)) categories.push(parsed.data);
26176
+ }
26177
+ return categories.length > 0 ? categories : null;
26178
+ }
26179
+ var citationUrlSortSchema = z85.enum(["answers", "newest"]);
26180
+ var CITATION_URLS_DEFAULT_LIMIT = 100;
26181
+ var CITATION_URLS_MAX_LIMIT = 1e3;
26182
+ var citationUrlEntrySchema = z85.object({
26183
+ /** The page, written one way (see `canonicalCitedUrl`). */
26184
+ url: z85.string(),
26185
+ /** Host without `www.`. */
26186
+ domain: z85.string(),
26187
+ category: sourceCategorySchema,
26188
+ label: z85.string(),
26189
+ /** Answers in scope that cite this page; one credit per answer however often it links it. Pools both query classes unless `queryClass` names one. */
26190
+ answers: z85.number().int().nonnegative(),
26191
+ /** Of those answers, how many mention the brand in their text. */
26192
+ answersMentioned: z85.number().int().nonnegative(),
26193
+ /** Of those answers, how many were never checked for a mention (no stored text). Never read these as not mentioned. */
26194
+ answersMentionUnchecked: z85.number().int().nonnegative(),
26195
+ /** Answers citing the page, per engine. */
26196
+ providers: z85.record(z85.string(), z85.number().int().nonnegative()),
26197
+ /** Every tracked query whose answers cite the page, most answers first. */
26198
+ queries: z85.array(z85.object({
26199
+ query: z85.string(),
26200
+ answers: z85.number().int().nonnegative()
26201
+ })),
26202
+ /** Sweeps in scope that cite the page. A multi-location sweep is one sweep. */
26203
+ sweeps: z85.number().int().nonnegative(),
26204
+ /** First sweep in scope that cited the page. "First" means within the window: read window=all for all history. */
26205
+ firstSeenAt: z85.string(),
26206
+ firstRunId: z85.string(),
26207
+ lastSeenAt: z85.string(),
26208
+ lastRunId: z85.string(),
26209
+ /**
26210
+ * True when the latest sweep in scope cites the page, no earlier sweep in
26211
+ * scope did, and an earlier sweep in scope captured pages at all. Without
26212
+ * that earlier sweep there is nothing to be new against, so it stays false.
26213
+ */
26214
+ newInLatest: z85.boolean(),
26215
+ /** True when the latest sweep in scope cites the page. */
26216
+ citedInLatest: z85.boolean()
26217
+ });
26218
+ var citationUrlsResponseSchema = z85.object({
26219
+ filters: z85.object({
26220
+ window: metricsWindowSchema,
26221
+ /** Host filter: the host or any subdomain of it. */
26222
+ domain: z85.string().nullable(),
26223
+ categories: z85.array(sourceCategorySchema),
26224
+ provider: z85.string().nullable(),
26225
+ queryClass: queryClassFilterSchema,
26226
+ newInLatest: z85.boolean(),
26227
+ sort: citationUrlSortSchema
26228
+ }),
26229
+ /** The latest sweep in scope, or null when no sweep is. A multi-location sweep is one sweep. */
26230
+ latestRun: z85.object({ id: z85.string(), createdAt: z85.string() }).nullable(),
26231
+ /** Sweeps in scope: completed or partial, never probes, inside the window. */
26232
+ runCount: z85.number().int().nonnegative(),
26233
+ /** Answers in scope whose engine returns sources and whose pages were captured. An engine that returns none is left out, as in the sources read. */
26234
+ answerTotal: z85.number().int().nonnegative(),
26235
+ /** Sweeps in scope with at least one answer whose pages were captured. Pages were first captured in August 2026. */
26236
+ sweepsWithPages: z85.number().int().nonnegative(),
26237
+ /** Answers stored before page capture existed: their pages are unknown, never "cited nothing". Left out of every count. */
26238
+ answersPagesNotCaptured: z85.number().int().nonnegative(),
26239
+ /** Answers whose page capture was partial or failed. Their captured pages count; a page they missed may read as new later. */
26240
+ answersPagesIncomplete: z85.number().int().nonnegative(),
26241
+ /** Answers left out because their question has no class for `queryClass`. */
26242
+ unclassifiedAnswers: z85.number().int().nonnegative(),
26243
+ /** Pages that match, across all pages. */
26244
+ total: z85.number().int().nonnegative(),
26245
+ returned: z85.number().int().nonnegative(),
26246
+ /** True when another page follows; read it with `nextCursor`. */
26247
+ truncated: z85.boolean(),
26248
+ /** Pass as `cursor`, with the same filters, for the next page; null on the last page. */
26249
+ nextCursor: z85.string().nullable(),
26250
+ urls: z85.array(citationUrlEntrySchema)
26251
+ });
26252
+
26253
+ // ../contracts/src/competitor-suggestions.ts
26254
+ import { z as z86 } from "zod";
26255
+ var competitorSuggestionsQuerySchema = z86.object({
26118
26256
  window: metricsWindowSchema.optional(),
26119
- minAnswers: z85.coerce.number().int().min(1).max(1e3).optional(),
26120
- queryClass: z85.enum(["non-brand", "branded", "all"]).optional(),
26121
- groupKey: z85.string().trim().min(1).optional(),
26122
- limit: z85.coerce.number().int().min(1).max(100).optional()
26257
+ minAnswers: z86.coerce.number().int().min(1).max(1e3).optional(),
26258
+ queryClass: z86.enum(["non-brand", "branded", "all"]).optional(),
26259
+ groupKey: z86.string().trim().min(1).optional(),
26260
+ limit: z86.coerce.number().int().min(1).max(100).optional()
26123
26261
  }).strict();
26124
- var competitorSuggestionNameSchema = z85.object({
26125
- name: z85.string().trim().min(1),
26126
- answerCount: z85.number().int().nonnegative(),
26127
- pairedAnswers: z85.number().int().nonnegative()
26262
+ var competitorSuggestionNameSchema = z86.object({
26263
+ name: z86.string().trim().min(1),
26264
+ answerCount: z86.number().int().nonnegative(),
26265
+ pairedAnswers: z86.number().int().nonnegative()
26128
26266
  }).strict();
26129
- var competitorSuggestionReasonSchema = z85.enum([
26267
+ var competitorSuggestionReasonSchema = z86.enum([
26130
26268
  "below-min-answers",
26131
26269
  "not-named",
26132
26270
  "unpaired-name",
@@ -26137,56 +26275,56 @@ var competitorSuggestionReasonSchema = z85.enum([
26137
26275
  "shared-host"
26138
26276
  ]);
26139
26277
  var CompetitorSuggestionReasons = competitorSuggestionReasonSchema.enum;
26140
- var competitorSuggestionStatusSchema = z85.enum(["suggested", "tracked", "excluded"]);
26278
+ var competitorSuggestionStatusSchema = z86.enum(["suggested", "tracked", "excluded"]);
26141
26279
  var CompetitorSuggestionStatuses = competitorSuggestionStatusSchema.enum;
26142
- var competitorSuggestionSchema = z85.object({
26143
- domain: z85.string().trim().min(1),
26144
- label: z85.string().trim().min(1),
26145
- names: z85.array(competitorSuggestionNameSchema).max(5),
26146
- namingAnswers: z85.number().int().nonnegative(),
26147
- citingAnswers: z85.number().int().nonnegative(),
26148
- bothAnswers: z85.number().int().nonnegative(),
26149
- pairedAnswers: z85.number().int().nonnegative(),
26150
- namedByOtherNameAnswers: z85.number().int().nonnegative(),
26151
- sweeps: z85.number().int().nonnegative(),
26152
- firstSeenAt: z85.string().datetime().nullable(),
26153
- lastSeenAt: z85.string().datetime().nullable(),
26280
+ var competitorSuggestionSchema = z86.object({
26281
+ domain: z86.string().trim().min(1),
26282
+ label: z86.string().trim().min(1),
26283
+ names: z86.array(competitorSuggestionNameSchema).max(5),
26284
+ namingAnswers: z86.number().int().nonnegative(),
26285
+ citingAnswers: z86.number().int().nonnegative(),
26286
+ bothAnswers: z86.number().int().nonnegative(),
26287
+ pairedAnswers: z86.number().int().nonnegative(),
26288
+ namedByOtherNameAnswers: z86.number().int().nonnegative(),
26289
+ sweeps: z86.number().int().nonnegative(),
26290
+ firstSeenAt: z86.string().datetime().nullable(),
26291
+ lastSeenAt: z86.string().datetime().nullable(),
26154
26292
  surfaceClass: competitorLandscapeSurfaceClassSchema,
26155
- tracked: z85.boolean(),
26156
- marketKeys: z85.array(z85.string().trim().min(1)).optional(),
26293
+ tracked: z86.boolean(),
26294
+ marketKeys: z86.array(z86.string().trim().min(1)).optional(),
26157
26295
  status: competitorSuggestionStatusSchema,
26158
26296
  reason: competitorSuggestionReasonSchema.nullable(),
26159
- sampleUrls: z85.array(z85.string().url()).max(3)
26297
+ sampleUrls: z86.array(z86.string().url()).max(3)
26160
26298
  }).strict();
26161
- var competitorSuggestionsResponseSchema = z85.object({
26162
- project: z85.string().trim().min(1),
26299
+ var competitorSuggestionsResponseSchema = z86.object({
26300
+ project: z86.string().trim().min(1),
26163
26301
  window: metricsWindowSchema,
26164
26302
  scope: competitorLandscapeScopeSchema,
26165
- filters: z85.object({
26166
- queryClass: z85.enum(["non-brand", "branded", "all"]),
26167
- groupKey: z85.string().nullable(),
26168
- limit: z85.number().int().positive(),
26169
- minAnswers: z85.number().int().positive()
26303
+ filters: z86.object({
26304
+ queryClass: z86.enum(["non-brand", "branded", "all"]),
26305
+ groupKey: z86.string().nullable(),
26306
+ limit: z86.number().int().positive(),
26307
+ minAnswers: z86.number().int().positive()
26170
26308
  }).strict(),
26171
- thresholds: z85.object({ minAnswers: z85.number().int().positive() }).strict(),
26172
- candidates: z85.array(competitorSuggestionSchema),
26173
- candidatesTotal: z85.number().int().nonnegative(),
26174
- excludedCounts: z85.record(z85.string(), z85.number().int().nonnegative()),
26175
- unresolvedNames: z85.array(z85.object({ name: z85.string().trim().min(1), answerCount: z85.number().int().nonnegative() }).strict()),
26176
- evidence: z85.object({
26177
- answeredResults: z85.number().int().nonnegative(),
26178
- sourceResults: z85.number().int().nonnegative(),
26179
- excludedProbeResults: z85.number().int().nonnegative(),
26180
- excludedNonCompletedResults: z85.number().int().nonnegative()
26309
+ thresholds: z86.object({ minAnswers: z86.number().int().positive() }).strict(),
26310
+ candidates: z86.array(competitorSuggestionSchema),
26311
+ candidatesTotal: z86.number().int().nonnegative(),
26312
+ excludedCounts: z86.record(z86.string(), z86.number().int().nonnegative()),
26313
+ unresolvedNames: z86.array(z86.object({ name: z86.string().trim().min(1), answerCount: z86.number().int().nonnegative() }).strict()),
26314
+ evidence: z86.object({
26315
+ answeredResults: z86.number().int().nonnegative(),
26316
+ sourceResults: z86.number().int().nonnegative(),
26317
+ excludedProbeResults: z86.number().int().nonnegative(),
26318
+ excludedNonCompletedResults: z86.number().int().nonnegative()
26181
26319
  }).strict(),
26182
- runCount: z85.number().int().nonnegative(),
26183
- runIds: z85.array(z85.string()),
26184
- countUnits: z85.object({
26185
- answers: z85.array(z85.string()),
26186
- distinctNames: z85.array(z85.string()),
26187
- runs: z85.array(z85.string())
26320
+ runCount: z86.number().int().nonnegative(),
26321
+ runIds: z86.array(z86.string()),
26322
+ countUnits: z86.object({
26323
+ answers: z86.array(z86.string()),
26324
+ distinctNames: z86.array(z86.string()),
26325
+ runs: z86.array(z86.string())
26188
26326
  }).strict(),
26189
- truncated: z85.boolean()
26327
+ truncated: z86.boolean()
26190
26328
  }).strict();
26191
26329
  var COMPETITOR_SUGGESTION_COUNT_UNITS = {
26192
26330
  ...COMPETITOR_LANDSCAPE_COUNT_UNITS,
@@ -26204,9 +26342,9 @@ var COMPETITOR_SUGGESTION_COUNT_UNITS = {
26204
26342
  };
26205
26343
 
26206
26344
  // ../contracts/src/intelligence.ts
26207
- import { z as z86 } from "zod";
26208
- var insightSeveritySchema = z86.enum(["critical", "high", "medium", "low"]);
26209
- var insightActionGroupSchema = z86.enum(["write", "investigate", "monitor"]);
26345
+ import { z as z87 } from "zod";
26346
+ var insightSeveritySchema = z87.enum(["critical", "high", "medium", "low"]);
26347
+ var insightActionGroupSchema = z87.enum(["write", "investigate", "monitor"]);
26210
26348
  var InsightActionGroups = insightActionGroupSchema.enum;
26211
26349
  var insightActionGroupByType = {
26212
26350
  // Content-required: a missing or competitive answer needs new or updated material.
@@ -26228,10 +26366,10 @@ var insightActionGroupByType = {
26228
26366
  "gbp-metric-drop": InsightActionGroups.investigate,
26229
26367
  "gbp-keyword-drop": InsightActionGroups.investigate
26230
26368
  };
26231
- var healthSnapshotDtoSchema = z86.object({
26232
- id: z86.string(),
26233
- projectId: z86.string(),
26234
- runId: z86.string().nullable(),
26369
+ var healthSnapshotDtoSchema = z87.object({
26370
+ id: z87.string(),
26371
+ projectId: z87.string(),
26372
+ runId: z87.string().nullable(),
26235
26373
  /**
26236
26374
  * `citedPairs` over the pairs whose sources were checked (`totalPairs -
26237
26375
  * citationNotMeasuredPairs`). Null when the engines returned no sources for
@@ -26246,57 +26384,57 @@ var healthSnapshotDtoSchema = z86.object({
26246
26384
  * as 0 (the API coalesces NULL→0).
26247
26385
  */
26248
26386
  overallMentionRate: fraction(),
26249
- totalPairs: z86.number().int().nonnegative(),
26250
- citedPairs: z86.number().int().nonnegative(),
26387
+ totalPairs: z87.number().int().nonnegative(),
26388
+ citedPairs: z87.number().int().nonnegative(),
26251
26389
  /**
26252
26390
  * Pairs whose engine returns no sources (a local model), out of every cited
26253
26391
  * rate. Snapshots stored before this field existed read 0: they were
26254
26392
  * computed with those pairs counted as not cited and are not rewritten.
26255
26393
  */
26256
- citationNotMeasuredPairs: z86.number().int().nonnegative(),
26394
+ citationNotMeasuredPairs: z87.number().int().nonnegative(),
26257
26395
  /** Count of pairs mentioned in the answer text. Legacy rows read back as 0. */
26258
- mentionedPairs: z86.number().int().nonnegative(),
26259
- providerBreakdown: z86.record(z86.string(), z86.object({
26396
+ mentionedPairs: z87.number().int().nonnegative(),
26397
+ providerBreakdown: z87.record(z87.string(), z87.object({
26260
26398
  /** `cited / (total - citationNotMeasured)`; null when none of the engine's pairs carried sources. */
26261
26399
  citedRate: fraction().nullable(),
26262
26400
  mentionRate: fraction(),
26263
- cited: z86.number().int().nonnegative(),
26264
- mentioned: z86.number().int().nonnegative(),
26265
- total: z86.number().int().nonnegative(),
26266
- citationNotMeasured: z86.number().int().nonnegative()
26401
+ cited: z87.number().int().nonnegative(),
26402
+ mentioned: z87.number().int().nonnegative(),
26403
+ total: z87.number().int().nonnegative(),
26404
+ citationNotMeasured: z87.number().int().nonnegative()
26267
26405
  })),
26268
- createdAt: z86.string(),
26406
+ createdAt: z87.string(),
26269
26407
  /**
26270
26408
  * `'ready'` when the snapshot reflects real data; `'no-data'` for the
26271
26409
  * sentinel returned by `/health/latest` when a project has no health
26272
26410
  * snapshots yet (newly created, or only failed runs). Numeric fields are
26273
26411
  * zero and `providerBreakdown` is `{}` in the no-data case.
26274
26412
  */
26275
- status: z86.enum(["ready", "no-data"]),
26413
+ status: z87.enum(["ready", "no-data"]),
26276
26414
  /** Reason for `status === 'no-data'`. Absent when `status === 'ready'`. */
26277
- reason: z86.literal("no-runs-yet").optional()
26415
+ reason: z87.literal("no-runs-yet").optional()
26278
26416
  });
26279
26417
 
26280
26418
  // ../contracts/src/agent.ts
26281
- import { z as z87 } from "zod";
26282
- var agentViewContextSchema = z87.object({
26283
- view: z87.enum(["project", "visibility", "property", "queries", "site-health", "seo"]),
26284
- seoProfileId: z87.string().trim().min(1).max(128).optional(),
26285
- seoRunId: z87.string().trim().min(1).max(128).optional(),
26419
+ import { z as z88 } from "zod";
26420
+ var agentViewContextSchema = z88.object({
26421
+ view: z88.enum(["project", "visibility", "property", "queries", "site-health", "seo"]),
26422
+ seoProfileId: z88.string().trim().min(1).max(128).optional(),
26423
+ seoRunId: z88.string().trim().min(1).max(128).optional(),
26286
26424
  /** The market-rankings region and market the SEO view is narrowed to. */
26287
- seoRegionKey: z87.string().trim().min(1).max(200).optional(),
26288
- seoMarketKey: z87.string().trim().min(1).max(200).optional(),
26425
+ seoRegionKey: z88.string().trim().min(1).max(200).optional(),
26426
+ seoMarketKey: z88.string().trim().min(1).max(200).optional(),
26289
26427
  /** The active series of a saved SEO history chart. */
26290
- seoTrend: z87.object({
26428
+ seoTrend: z88.object({
26291
26429
  days: seoTrendDaysSchema,
26292
26430
  metric: seoTrendMetricSchema,
26293
26431
  keyword: seoTrendKeywordSchema.optional()
26294
26432
  }).strict().optional(),
26295
- unavailableReason: z87.string().trim().min(1).max(512).optional(),
26433
+ unavailableReason: z88.string().trim().min(1).max(512).optional(),
26296
26434
  selection: visibilityReportRequestSchema.optional(),
26297
- page: z87.object({
26298
- runId: z87.string().trim().min(1).max(256).optional(),
26299
- nodeKey: z87.string().trim().min(1).max(2048).optional()
26435
+ page: z88.object({
26436
+ runId: z88.string().trim().min(1).max(256).optional(),
26437
+ nodeKey: z88.string().trim().min(1).max(2048).optional()
26300
26438
  }).strict().optional()
26301
26439
  }).strict().superRefine((value, ctx) => {
26302
26440
  if (value.seoProfileId && value.view !== "seo") ctx.addIssue({ code: "custom", message: "SEO profile context requires the SEO view." });
@@ -26310,9 +26448,9 @@ var agentViewContextSchema = z87.object({
26310
26448
  if (value.page && value.view !== "site-health") ctx.addIssue({ code: "custom", message: "Page context requires the Agent Readiness view." });
26311
26449
  if (value.selection && !["visibility", "property", "queries"].includes(value.view)) ctx.addIssue({ code: "custom", message: "Measurement selection requires a measurement view." });
26312
26450
  });
26313
- var agentTurnLimitsSchema = z87.object({
26314
- maxToolCalls: z87.number().int().min(1).max(100).default(30),
26315
- timeoutMs: z87.number().int().min(1e3).max(6e5).default(18e4)
26451
+ var agentTurnLimitsSchema = z88.object({
26452
+ maxToolCalls: z88.number().int().min(1).max(100).default(30),
26453
+ timeoutMs: z88.number().int().min(1e3).max(6e5).default(18e4)
26316
26454
  }).strict();
26317
26455
  function agentVisibilityEvidence(report, project, retrievedAt) {
26318
26456
  const selection = report.selection;
@@ -26355,26 +26493,26 @@ function agentVisibilityEvidence(report, project, retrievedAt) {
26355
26493
  ))
26356
26494
  };
26357
26495
  }
26358
- var agentProviderIdSchema = z87.enum(["claude", "openai", "gemini", "zai", "openrouter"]);
26359
- var agentProviderBackgroundPauseSchema = z87.object({
26496
+ var agentProviderIdSchema = z88.enum(["claude", "openai", "gemini", "zai", "openrouter"]);
26497
+ var agentProviderBackgroundPauseSchema = z88.object({
26360
26498
  reason: providerErrorCodeSchema.extract(["PROVIDER_AUTH", "PROVIDER_BILLING"]),
26361
- retryAt: z87.iso.datetime(),
26362
- recovery: z87.string()
26499
+ retryAt: z88.iso.datetime(),
26500
+ recovery: z88.string()
26363
26501
  });
26364
- var agentProviderOptionDtoSchema = z87.object({
26502
+ var agentProviderOptionDtoSchema = z88.object({
26365
26503
  /** Stable identifier — what clients pass back as `provider` on the prompt endpoint. */
26366
26504
  id: agentProviderIdSchema,
26367
26505
  /** Human-readable label for UI pickers, e.g. "Anthropic (Claude)". */
26368
- label: z87.string(),
26506
+ label: z88.string(),
26369
26507
  /** Default model if the caller doesn't pick one. */
26370
- defaultModel: z87.string(),
26508
+ defaultModel: z88.string(),
26371
26509
  /** Whether a usable API key was found (config.yaml or provider env var). */
26372
- configured: z87.boolean(),
26510
+ configured: z88.boolean(),
26373
26511
  /**
26374
26512
  * Where the key resolved from, if any. `null` when `configured === false`.
26375
26513
  * Surfaced so the UI can nudge users toward their preferred source of truth.
26376
26514
  */
26377
- keySource: z87.enum(["config", "env"]).nullable(),
26515
+ keySource: z88.enum(["config", "env"]).nullable(),
26378
26516
  /** Current credential's automatic-work hold; omitted by hosts predating this field. */
26379
26517
  backgroundPause: agentProviderBackgroundPauseSchema.nullable().optional(),
26380
26518
  /**
@@ -26382,14 +26520,14 @@ var agentProviderOptionDtoSchema = z87.object({
26382
26520
  * then a few stronger current models. A pinned model outside the list is
26383
26521
  * listed first. Any other model ID can still be requested.
26384
26522
  */
26385
- models: z87.array(z87.object({ id: z87.string(), displayName: z87.string() })).optional()
26523
+ models: z88.array(z88.object({ id: z88.string(), displayName: z88.string() })).optional()
26386
26524
  });
26387
- var agentProvidersResponseDtoSchema = z87.object({
26525
+ var agentProvidersResponseDtoSchema = z88.object({
26388
26526
  /**
26389
26527
  * Every provider Aero knows about. `configured === false` entries are
26390
26528
  * included so the UI can render them disabled with an onboarding hint.
26391
26529
  */
26392
- providers: z87.array(agentProviderOptionDtoSchema).default([]),
26530
+ providers: z88.array(agentProviderOptionDtoSchema).default([]),
26393
26531
  /**
26394
26532
  * Provider a new session uses when the caller names none: the
26395
26533
  * `agent.provider` pin when set (reported even without a key, as its
@@ -26399,50 +26537,50 @@ var agentProvidersResponseDtoSchema = z87.object({
26399
26537
  */
26400
26538
  defaultProvider: agentProviderIdSchema.nullable()
26401
26539
  });
26402
- var memorySourceSchema = z87.enum(["aero", "user", "compaction"]);
26540
+ var memorySourceSchema = z88.enum(["aero", "user", "compaction"]);
26403
26541
  var MemorySources = memorySourceSchema.enum;
26404
26542
  var AGENT_MEMORY_VALUE_MAX_BYTES = 2 * 1024;
26405
26543
  var AGENT_MEMORY_KEY_MAX_LENGTH = 128;
26406
- var agentMemoryUpsertRequestSchema = z87.object({
26407
- key: z87.string().min(1).max(AGENT_MEMORY_KEY_MAX_LENGTH),
26408
- value: z87.string().min(1)
26544
+ var agentMemoryUpsertRequestSchema = z88.object({
26545
+ key: z88.string().min(1).max(AGENT_MEMORY_KEY_MAX_LENGTH),
26546
+ value: z88.string().min(1)
26409
26547
  });
26410
- var agentMemoryDeleteRequestSchema = z87.object({
26411
- key: z87.string().min(1).max(AGENT_MEMORY_KEY_MAX_LENGTH)
26548
+ var agentMemoryDeleteRequestSchema = z88.object({
26549
+ key: z88.string().min(1).max(AGENT_MEMORY_KEY_MAX_LENGTH)
26412
26550
  });
26413
- var agentPromptRequestSchema = z87.object({
26414
- prompt: z87.string().trim().min(1),
26415
- conversationId: z87.string().min(1).nullable().optional(),
26551
+ var agentPromptRequestSchema = z88.object({
26552
+ prompt: z88.string().trim().min(1),
26553
+ conversationId: z88.string().min(1).nullable().optional(),
26416
26554
  provider: agentProviderIdSchema.optional(),
26417
- modelId: z87.string().trim().min(1).optional(),
26418
- scope: z87.enum(["all", "read-only"]).optional(),
26419
- profile: z87.enum(["default", "ads-operator"]).optional(),
26555
+ modelId: z88.string().trim().min(1).optional(),
26556
+ scope: z88.enum(["all", "read-only"]).optional(),
26557
+ profile: z88.enum(["default", "ads-operator"]).optional(),
26420
26558
  context: agentViewContextSchema.optional(),
26421
26559
  limits: agentTurnLimitsSchema.optional()
26422
26560
  });
26423
- var agentConversationMessageSchema = z87.looseObject({ role: z87.string(), content: z87.unknown().optional() });
26424
- var agentConversationSummarySchema = z87.object({
26425
- id: z87.string(),
26426
- title: z87.string(),
26427
- active: z87.boolean(),
26428
- modelProvider: z87.string(),
26429
- modelId: z87.string(),
26430
- createdAt: z87.string(),
26431
- updatedAt: z87.string()
26561
+ var agentConversationMessageSchema = z88.looseObject({ role: z88.string(), content: z88.unknown().optional() });
26562
+ var agentConversationSummarySchema = z88.object({
26563
+ id: z88.string(),
26564
+ title: z88.string(),
26565
+ active: z88.boolean(),
26566
+ modelProvider: z88.string(),
26567
+ modelId: z88.string(),
26568
+ createdAt: z88.string(),
26569
+ updatedAt: z88.string()
26432
26570
  });
26433
26571
  var agentConversationSchema = agentConversationSummarySchema.extend({
26434
- messages: z87.array(agentConversationMessageSchema),
26435
- isStreaming: z87.boolean()
26572
+ messages: z88.array(agentConversationMessageSchema),
26573
+ isStreaming: z88.boolean()
26436
26574
  });
26437
- var agentConversationListSchema = z87.object({
26438
- conversations: z87.array(agentConversationSummarySchema),
26439
- currentConversationId: z87.string().nullable(),
26440
- nextOffset: z87.number().int().nullable()
26575
+ var agentConversationListSchema = z88.object({
26576
+ conversations: z88.array(agentConversationSummarySchema),
26577
+ currentConversationId: z88.string().nullable(),
26578
+ nextOffset: z88.number().int().nullable()
26441
26579
  });
26442
- var agentConversationCreateSchema = z87.object({
26443
- id: z87.uuid()
26580
+ var agentConversationCreateSchema = z88.object({
26581
+ id: z88.uuid()
26444
26582
  }).strict();
26445
- var agentConversationDeleteSchema = z87.object({ id: z87.string(), status: z87.literal("deleted") });
26583
+ var agentConversationDeleteSchema = z88.object({ id: z88.string(), status: z88.literal("deleted") });
26446
26584
  function agentConversationTitle(messages) {
26447
26585
  for (const message of messages) {
26448
26586
  if (message.role !== "user") continue;
@@ -26454,49 +26592,49 @@ function agentConversationTitle(messages) {
26454
26592
  return "New conversation";
26455
26593
  }
26456
26594
  var aeroPreviewStarterIds = ["status", "changes", "gaps", "insights"];
26457
- var aeroPreviewStarterIdSchema = z87.enum(aeroPreviewStarterIds);
26458
- var aeroPreviewStepSchema = z87.object({
26595
+ var aeroPreviewStarterIdSchema = z88.enum(aeroPreviewStarterIds);
26596
+ var aeroPreviewStepSchema = z88.object({
26459
26597
  /** Assistant text shown before the tool call, when the turn narrates it. */
26460
- text: z87.string().optional(),
26461
- tool: z87.object({
26598
+ text: z88.string().optional(),
26599
+ tool: z88.object({
26462
26600
  /** Real Canonry MCP tool name, such as canonry_visibility_report. */
26463
- name: z87.string(),
26601
+ name: z88.string(),
26464
26602
  /** The tool's registered title, which the live bar shows as the card label. */
26465
- label: z87.string(),
26466
- arguments: z87.record(z87.string(), z87.unknown()),
26603
+ label: z88.string(),
26604
+ arguments: z88.record(z88.string(), z88.unknown()),
26467
26605
  /** A compact excerpt of the stored result, not the full payload. */
26468
- result: z87.unknown(),
26469
- durationMs: z87.number().int().nonnegative()
26606
+ result: z88.unknown(),
26607
+ durationMs: z88.number().int().nonnegative()
26470
26608
  })
26471
26609
  });
26472
- var aeroPreviewStarterSchema = z87.object({
26610
+ var aeroPreviewStarterSchema = z88.object({
26473
26611
  id: aeroPreviewStarterIdSchema,
26474
- steps: z87.array(aeroPreviewStepSchema),
26612
+ steps: z88.array(aeroPreviewStepSchema),
26475
26613
  /** Final assistant markdown. */
26476
- answer: z87.string()
26614
+ answer: z88.string()
26477
26615
  });
26478
- var aeroPreviewResponseSchema = z87.object({
26479
- project: z87.string(),
26480
- seededAt: z87.string(),
26481
- starters: z87.array(aeroPreviewStarterSchema)
26616
+ var aeroPreviewResponseSchema = z88.object({
26617
+ project: z88.string(),
26618
+ seededAt: z88.string(),
26619
+ starters: z88.array(aeroPreviewStarterSchema)
26482
26620
  });
26483
- var agentConversationListQuerySchema = z87.object({
26484
- offset: z87.coerce.number().int().min(0).default(0),
26485
- limit: z87.coerce.number().int().min(1).max(100).default(50)
26621
+ var agentConversationListQuerySchema = z88.object({
26622
+ offset: z88.coerce.number().int().min(0).default(0),
26623
+ limit: z88.coerce.number().int().min(1).max(100).default(50)
26486
26624
  }).strict();
26487
26625
 
26488
26626
  // ../contracts/src/sentiment.ts
26489
- import { z as z88 } from "zod";
26627
+ import { z as z89 } from "zod";
26490
26628
  var SENTIMENT_MODEL = "jev-1.13.0";
26491
26629
  var SENTIMENT_OPENROUTER_MODEL = "typesafe/jev-1.13";
26492
26630
  var SENTIMENT_OPENROUTER_SERVED_MODEL = "typesafe/jev-1.13-20260917";
26493
- var sentimentEvaluatorProviderSchema = z88.enum(["typesafe", "openrouter"]);
26631
+ var sentimentEvaluatorProviderSchema = z89.enum(["typesafe", "openrouter"]);
26494
26632
  var SENTIMENT_INTERVAL_LIMITATION = "Wilson 95% intervals assume independent observations. They exclude classifier error and dependence among related queries, Properties, and sweeps.";
26495
- var id = z88.string().trim().min(1).max(256);
26496
- var count2 = z88.number().int().nonnegative();
26497
- var runIds = z88.preprocess((value) => typeof value === "string" ? [value] : value, z88.array(id).min(1).max(100));
26498
- var rate = fraction(z88.number().min(0).max(1)).nullable();
26499
- var sentimentOutcomeSchema = z88.enum([
26633
+ var id = z89.string().trim().min(1).max(256);
26634
+ var count2 = z89.number().int().nonnegative();
26635
+ var runIds = z89.preprocess((value) => typeof value === "string" ? [value] : value, z89.array(id).min(1).max(100));
26636
+ var rate = fraction(z89.number().min(0).max(1)).nullable();
26637
+ var sentimentOutcomeSchema = z89.enum([
26500
26638
  "favorable",
26501
26639
  "mixed",
26502
26640
  "unfavorable",
@@ -26517,22 +26655,22 @@ var sentimentOutcomeSchema = z88.enum([
26517
26655
  "canceled"
26518
26656
  ]);
26519
26657
  var SentimentOutcomes = sentimentOutcomeSchema.enum;
26520
- var sentimentStateSchema = z88.enum(["disabled", "not-measured", "processing", "partial", "complete", "failed", "canceled", "unsupported"]);
26521
- var sentimentEvaluationDefinitionSchema = z88.object({
26522
- schemaVersion: z88.union([z88.literal(1), z88.literal(2)]),
26523
- requestedModel: z88.enum([SENTIMENT_MODEL, SENTIMENT_OPENROUTER_MODEL]),
26658
+ var sentimentStateSchema = z89.enum(["disabled", "not-measured", "processing", "partial", "complete", "failed", "canceled", "unsupported"]);
26659
+ var sentimentEvaluationDefinitionSchema = z89.object({
26660
+ schemaVersion: z89.union([z89.literal(1), z89.literal(2)]),
26661
+ requestedModel: z89.enum([SENTIMENT_MODEL, SENTIMENT_OPENROUTER_MODEL]),
26524
26662
  /** Omitted on historical direct TypeSafe definitions to preserve their immutable identity. */
26525
26663
  provider: sentimentEvaluatorProviderSchema.optional(),
26526
- expectedReturnedModel: z88.literal(SENTIMENT_OPENROUTER_SERVED_MODEL).optional(),
26664
+ expectedReturnedModel: z89.literal(SENTIMENT_OPENROUTER_SERVED_MODEL).optional(),
26527
26665
  verdictVersion: id,
26528
26666
  identityVersion: id,
26529
26667
  evidenceVersion: id,
26530
26668
  segmentationVersion: id,
26531
26669
  preprocessingVersion: id,
26532
- languagePolicy: z88.literal("en-only"),
26533
- comparisonMethodVersion: z88.literal("wilson-independent-v1"),
26534
- confidenceThreshold: z88.number().min(0).max(1).nullable(),
26535
- questions: z88.object({ identity: z88.string(), judgment: z88.string(), stance: z88.string(), conclusion: z88.string(), complaint: z88.string() }).strict()
26670
+ languagePolicy: z89.literal("en-only"),
26671
+ comparisonMethodVersion: z89.literal("wilson-independent-v1"),
26672
+ confidenceThreshold: z89.number().min(0).max(1).nullable(),
26673
+ questions: z89.object({ identity: z89.string(), judgment: z89.string(), stance: z89.string(), conclusion: z89.string(), complaint: z89.string() }).strict()
26536
26674
  }).strict().superRefine((definition, ctx) => {
26537
26675
  const routed = definition.provider === "openrouter";
26538
26676
  if (definition.requestedModel !== (routed ? SENTIMENT_OPENROUTER_MODEL : SENTIMENT_MODEL) || (routed ? definition.expectedReturnedModel !== SENTIMENT_OPENROUTER_SERVED_MODEL : definition.expectedReturnedModel !== void 0)) {
@@ -26575,7 +26713,7 @@ function storedDefinitionProjection(value) {
26575
26713
  if (typeof projected.questions === "object" && projected.questions !== null) projected.questions = Object.fromEntries(Object.entries(projected.questions).filter(([key]) => key !== "theme"));
26576
26714
  return projected;
26577
26715
  }
26578
- var storedSentimentEvaluationDefinitionSchema = z88.preprocess(storedDefinitionProjection, sentimentEvaluationDefinitionSchema);
26716
+ var storedSentimentEvaluationDefinitionSchema = z89.preprocess(storedDefinitionProjection, sentimentEvaluationDefinitionSchema);
26579
26717
  function canonicalSentimentJson(value) {
26580
26718
  function canonical(item) {
26581
26719
  if (Array.isArray(item)) return item.map(canonical);
@@ -26584,69 +26722,69 @@ function canonicalSentimentJson(value) {
26584
26722
  }
26585
26723
  return JSON.stringify(canonical(value));
26586
26724
  }
26587
- var sentimentSubjectSchema = z88.object({ id, displayName: z88.string(), aliases: z88.array(z88.string()), qualifiedAliases: z88.array(z88.string()).default([]), urls: z88.array(z88.string()), mentionNotApplicable: z88.boolean() }).strict();
26588
- var sentimentUsageEdgeSchema = z88.object({ queryId: id, executionNodeKey: id.nullable(), targetId: id, propertyId: id.nullable(), groupId: id.nullable(), marketId: id.nullable(), queryClass: z88.enum(["branded", "non-brand"]), queryText: z88.string().optional(), location: z88.string().nullable() }).strict();
26589
- var sentimentExecutionContextSchema = z88.object({
26725
+ var sentimentSubjectSchema = z89.object({ id, displayName: z89.string(), aliases: z89.array(z89.string()), qualifiedAliases: z89.array(z89.string()).default([]), urls: z89.array(z89.string()), mentionNotApplicable: z89.boolean() }).strict();
26726
+ var sentimentUsageEdgeSchema = z89.object({ queryId: id, executionNodeKey: id.nullable(), targetId: id, propertyId: id.nullable(), groupId: id.nullable(), marketId: id.nullable(), queryClass: z89.enum(["branded", "non-brand"]), queryText: z89.string().optional(), location: z89.string().nullable() }).strict();
26727
+ var sentimentExecutionContextSchema = z89.object({
26590
26728
  queryId: id,
26591
- queryText: z88.string(),
26592
- queryClass: z88.enum(["branded", "non-brand"]),
26729
+ queryText: z89.string(),
26730
+ queryClass: z89.enum(["branded", "non-brand"]),
26593
26731
  provider: id,
26594
- requestedModel: z88.string().nullable(),
26595
- servedModel: z88.string().nullable(),
26596
- location: z88.string().nullable(),
26597
- revision: z88.number().int().nullable(),
26598
- usageEdges: z88.array(sentimentUsageEdgeSchema),
26732
+ requestedModel: z89.string().nullable(),
26733
+ servedModel: z89.string().nullable(),
26734
+ location: z89.string().nullable(),
26735
+ revision: z89.number().int().nullable(),
26736
+ usageEdges: z89.array(sentimentUsageEdgeSchema),
26599
26737
  locationContext: locationContextSchema.nullable().default(null)
26600
26738
  }).strict();
26601
- var sentimentEvidenceSchema = z88.object({ id, text: z88.string().min(1), start: count2, end: count2 }).strict();
26602
- var sentimentUsageSchema = z88.object({ kind: z88.enum(["reported", "estimated", "unknown"]), inputTokens: count2.nullable(), outputTokens: count2.nullable() }).strict();
26603
- var sentimentClassifierInputSchema = z88.object({
26739
+ var sentimentEvidenceSchema = z89.object({ id, text: z89.string().min(1), start: count2, end: count2 }).strict();
26740
+ var sentimentUsageSchema = z89.object({ kind: z89.enum(["reported", "estimated", "unknown"]), inputTokens: count2.nullable(), outputTokens: count2.nullable() }).strict();
26741
+ var sentimentClassifierInputSchema = z89.object({
26604
26742
  sourceSnapshotId: id,
26605
- sourceText: z88.string(),
26743
+ sourceText: z89.string(),
26606
26744
  sourceTextHash: id,
26607
26745
  subject: sentimentSubjectSchema,
26608
26746
  subjectHash: id,
26609
26747
  context: sentimentExecutionContextSchema,
26610
- language: z88.string(),
26748
+ language: z89.string(),
26611
26749
  definition: sentimentEvaluationDefinitionSchema,
26612
- sentences: z88.array(sentimentEvidenceSchema)
26750
+ sentences: z89.array(sentimentEvidenceSchema)
26613
26751
  }).strict();
26614
- var storedSentimentClassifierInputSchema = z88.preprocess((value) => {
26752
+ var storedSentimentClassifierInputSchema = z89.preprocess((value) => {
26615
26753
  if (typeof value !== "object" || value === null || !("definition" in value)) return value;
26616
26754
  return { ...value, definition: storedDefinitionProjection(value.definition) };
26617
26755
  }, sentimentClassifierInputSchema);
26618
- var classifierCommon = { returnedModel: z88.string().nullable(), usage: sentimentUsageSchema };
26619
- var sentimentClassifierOutputSchema = z88.discriminatedUnion("kind", [
26620
- z88.object({
26621
- kind: z88.literal("classified"),
26756
+ var classifierCommon = { returnedModel: z89.string().nullable(), usage: sentimentUsageSchema };
26757
+ var sentimentClassifierOutputSchema = z89.discriminatedUnion("kind", [
26758
+ z89.object({
26759
+ kind: z89.literal("classified"),
26622
26760
  ...classifierCommon,
26623
- returnedModel: z88.string(),
26761
+ returnedModel: z89.string(),
26624
26762
  outcome: sentimentOutcomeSchema,
26625
- conclusion: z88.array(sentimentEvidenceSchema),
26626
- complaint: z88.array(sentimentEvidenceSchema).nullable(),
26627
- confidence: z88.number().min(0).max(1).nullable()
26763
+ conclusion: z89.array(sentimentEvidenceSchema),
26764
+ complaint: z89.array(sentimentEvidenceSchema).nullable(),
26765
+ confidence: z89.number().min(0).max(1).nullable()
26628
26766
  }).strict(),
26629
- z88.object({ kind: z88.literal("abstained"), ...classifierCommon, outcome: sentimentOutcomeSchema, reason: z88.string() }).strict(),
26630
- z88.object({ kind: z88.literal("failed"), ...classifierCommon, outcome: z88.literal("failed"), error: z88.object({ code: id, message: z88.string(), retryable: z88.boolean(), retryAfterMs: z88.number().nonnegative().nullable() }).strict() }).strict()
26767
+ z89.object({ kind: z89.literal("abstained"), ...classifierCommon, outcome: sentimentOutcomeSchema, reason: z89.string() }).strict(),
26768
+ z89.object({ kind: z89.literal("failed"), ...classifierCommon, outcome: z89.literal("failed"), error: z89.object({ code: id, message: z89.string(), retryable: z89.boolean(), retryAfterMs: z89.number().nonnegative().nullable() }).strict() }).strict()
26631
26769
  ]).superRefine((result, ctx) => {
26632
26770
  if (result.kind === "classified" && ["favorable", "mixed", "unfavorable"].includes(result.outcome) && result.conclusion.length === 0) {
26633
26771
  ctx.addIssue({ code: "custom", path: ["conclusion"], message: "Judgments require conclusion evidence" });
26634
26772
  }
26635
26773
  });
26636
- var storedSentimentClassifierOutputSchema = z88.preprocess((value) => typeof value === "object" && value !== null ? Object.fromEntries(Object.entries(value).filter(([key]) => key !== "themes")) : value, sentimentClassifierOutputSchema);
26637
- var sentimentSelectionBaseSchema = z88.object({
26774
+ var storedSentimentClassifierOutputSchema = z89.preprocess((value) => typeof value === "object" && value !== null ? Object.fromEntries(Object.entries(value).filter(([key]) => key !== "themes")) : value, sentimentClassifierOutputSchema);
26775
+ var sentimentSelectionBaseSchema = z89.object({
26638
26776
  runId: id.optional(),
26639
26777
  runIds: runIds.optional(),
26640
- revision: z88.coerce.number().int().positive().optional(),
26641
- mode: z88.enum(["auto", "simple", "advanced"]).default("auto"),
26642
- queryClass: z88.enum(["branded", "non-brand"]).default("branded"),
26643
- scope: z88.enum(["project", "property", "group", "market"]).default("project"),
26778
+ revision: z89.coerce.number().int().positive().optional(),
26779
+ mode: z89.enum(["auto", "simple", "advanced"]).default("auto"),
26780
+ queryClass: z89.enum(["branded", "non-brand"]).default("branded"),
26781
+ scope: z89.enum(["project", "property", "group", "market"]).default("project"),
26644
26782
  queryId: id.optional(),
26645
26783
  scopeKey: id.optional(),
26646
26784
  marketKey: id.optional(),
26647
26785
  provider: id.optional(),
26648
26786
  model: id.optional(),
26649
- location: z88.string().min(1).optional(),
26787
+ location: z89.string().min(1).optional(),
26650
26788
  evaluationDefinitionId: id.optional(),
26651
26789
  /** Exact frozen Advanced execution node of the selected query. Identity: it narrows the assessed population. */
26652
26790
  executionNodeKey: id.optional()
@@ -26656,26 +26794,26 @@ function exclusiveSentimentRuns(value, ctx) {
26656
26794
  if (value.runIds && new Set(value.runIds).size !== value.runIds.length) ctx.addIssue({ code: "custom", path: ["runIds"], message: "Run IDs must be unique." });
26657
26795
  }
26658
26796
  var sentimentSelectionSchema = sentimentSelectionBaseSchema.superRefine(exclusiveSentimentRuns);
26659
- var sentimentSummaryIncludeSchema = z88.enum(["assessments", "locations"]);
26797
+ var sentimentSummaryIncludeSchema = z89.enum(["assessments", "locations"]);
26660
26798
  var SENTIMENT_QUERY_PAGE_DEFAULT = 25;
26661
26799
  var SENTIMENT_QUERY_PAGE_MAX = 500;
26662
26800
  var sentimentSummaryRequestSchema = sentimentSelectionBaseSchema.extend({
26663
- include: z88.preprocess((value) => typeof value === "string" ? value.split(",").map((item) => item.trim()).filter(Boolean) : value, z88.array(sentimentSummaryIncludeSchema).max(2)).optional(),
26664
- queryLimit: z88.coerce.number().int().min(1).max(SENTIMENT_QUERY_PAGE_MAX).default(SENTIMENT_QUERY_PAGE_DEFAULT),
26665
- queryCursor: z88.string().min(1).max(16384).optional()
26801
+ include: z89.preprocess((value) => typeof value === "string" ? value.split(",").map((item) => item.trim()).filter(Boolean) : value, z89.array(sentimentSummaryIncludeSchema).max(2)).optional(),
26802
+ queryLimit: z89.coerce.number().int().min(1).max(SENTIMENT_QUERY_PAGE_MAX).default(SENTIMENT_QUERY_PAGE_DEFAULT),
26803
+ queryCursor: z89.string().min(1).max(16384).optional()
26666
26804
  }).superRefine(exclusiveSentimentRuns);
26667
- var sentimentEvidenceOutcomeFilterSchema = z88.preprocess((value) => {
26805
+ var sentimentEvidenceOutcomeFilterSchema = z89.preprocess((value) => {
26668
26806
  const items = typeof value === "string" ? [value] : Array.isArray(value) ? value : null;
26669
26807
  return items ? [...new Set(items.flatMap((item) => typeof item === "string" ? item.split(",").map((part) => part.trim()).filter(Boolean) : [item]))] : value;
26670
- }, z88.array(sentimentOutcomeSchema).min(1).max(sentimentOutcomeSchema.options.length));
26671
- var sentimentEvidenceRequestSchema = sentimentSelectionBaseSchema.extend({ assessmentId: id.optional(), outcome: sentimentEvidenceOutcomeFilterSchema.optional(), cursor: z88.string().min(1).max(16384).optional(), limit: z88.coerce.number().int().min(1).max(100).default(50) }).superRefine(exclusiveSentimentRuns);
26808
+ }, z89.array(sentimentOutcomeSchema).min(1).max(sentimentOutcomeSchema.options.length));
26809
+ var sentimentEvidenceRequestSchema = sentimentSelectionBaseSchema.extend({ assessmentId: id.optional(), outcome: sentimentEvidenceOutcomeFilterSchema.optional(), cursor: z89.string().min(1).max(16384).optional(), limit: z89.coerce.number().int().min(1).max(100).default(50) }).superRefine(exclusiveSentimentRuns);
26672
26810
  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) => {
26673
26811
  exclusiveSentimentRuns(value, ctx);
26674
26812
  if (value.runIds) ctx.addIssue({ code: "custom", path: ["runIds"], message: "Comparison requires one explicit run per period." });
26675
26813
  });
26676
- var sentimentResolvedSelectionSchema = sentimentSelectionBaseSchema.extend({ runId: id.nullable(), revision: z88.number().int().nullable(), evaluationDefinitionId: id.nullable(), mode: z88.enum(["simple", "advanced"]) });
26677
- var sentimentCountsSchema = z88.object(Object.fromEntries(sentimentOutcomeSchema.options.map((outcome) => [outcome, count2]))).strict();
26678
- var sentimentCoverageSchema = z88.object({
26814
+ var sentimentResolvedSelectionSchema = sentimentSelectionBaseSchema.extend({ runId: id.nullable(), revision: z89.number().int().nullable(), evaluationDefinitionId: id.nullable(), mode: z89.enum(["simple", "advanced"]) });
26815
+ var sentimentCountsSchema = z89.object(Object.fromEntries(sentimentOutcomeSchema.options.map((outcome) => [outcome, count2]))).strict();
26816
+ var sentimentCoverageSchema = z89.object({
26679
26817
  selected: count2,
26680
26818
  eligibleAssessments: count2,
26681
26819
  unadmittedAssessments: count2,
@@ -26689,45 +26827,45 @@ var sentimentCoverageSchema = z88.object({
26689
26827
  expectedProviderSlots: count2,
26690
26828
  completedProviderSlots: count2
26691
26829
  }).strict();
26692
- var sentimentScoreSchema = z88.object({ favorableRate: rate, mixedRate: rate, unfavorableRate: rate, favorableDisplay: z88.string(), mixedDisplay: z88.string(), unfavorableDisplay: z88.string(), interval: z88.object({ low: z88.number(), high: z88.number() }).strict().nullable(), method: z88.literal("wilson-independent-v1"), limitation: z88.string() }).strict();
26693
- var headlineFields = { state: sentimentStateSchema, reason: z88.string().nullable(), provisional: z88.boolean(), coverage: sentimentCoverageSchema, score: sentimentScoreSchema };
26694
- var sentimentHeadlineSchema = z88.object({ ...headlineFields, selection: sentimentResolvedSelectionSchema, runIds: z88.array(id) }).strict();
26695
- var sentimentOverallHeadlineSchema = z88.object({ ...headlineFields, queryClass: z88.literal("all"), pooled: z88.literal(true).optional(), runIds: z88.array(id) }).strict();
26696
- var sentimentOverviewSchema = z88.object({ configured: z88.boolean(), branded: sentimentHeadlineSchema, nonBrand: sentimentHeadlineSchema, headlineQueryClass: z88.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();
26697
- var sentimentAssessmentSummarySchema = z88.object({
26830
+ var sentimentScoreSchema = z89.object({ favorableRate: rate, mixedRate: rate, unfavorableRate: rate, favorableDisplay: z89.string(), mixedDisplay: z89.string(), unfavorableDisplay: z89.string(), interval: z89.object({ low: z89.number(), high: z89.number() }).strict().nullable(), method: z89.literal("wilson-independent-v1"), limitation: z89.string() }).strict();
26831
+ var headlineFields = { state: sentimentStateSchema, reason: z89.string().nullable(), provisional: z89.boolean(), coverage: sentimentCoverageSchema, score: sentimentScoreSchema };
26832
+ var sentimentHeadlineSchema = z89.object({ ...headlineFields, selection: sentimentResolvedSelectionSchema, runIds: z89.array(id) }).strict();
26833
+ var sentimentOverallHeadlineSchema = z89.object({ ...headlineFields, queryClass: z89.literal("all"), pooled: z89.literal(true).optional(), runIds: z89.array(id) }).strict();
26834
+ var sentimentOverviewSchema = z89.object({ configured: z89.boolean(), branded: sentimentHeadlineSchema, nonBrand: sentimentHeadlineSchema, headlineQueryClass: z89.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();
26835
+ var sentimentAssessmentSummarySchema = z89.object({
26698
26836
  assessmentId: id.nullable(),
26699
26837
  sourceSnapshotId: id,
26700
26838
  runId: id,
26701
26839
  subjectId: id,
26702
- subjectLabel: z88.string(),
26840
+ subjectLabel: z89.string(),
26703
26841
  executionNodeKey: id.nullable(),
26704
26842
  provider: id,
26705
- requestedModel: z88.string().nullable(),
26706
- servedModel: z88.string().nullable(),
26707
- location: z88.string().nullable(),
26843
+ requestedModel: z89.string().nullable(),
26844
+ servedModel: z89.string().nullable(),
26845
+ location: z89.string().nullable(),
26708
26846
  evaluationDefinitionId: id.nullable(),
26709
26847
  state: sentimentStateSchema,
26710
- outcome: z88.union([sentimentOutcomeSchema, z88.null()]),
26711
- reason: z88.string().nullable()
26848
+ outcome: z89.union([sentimentOutcomeSchema, z89.null()]),
26849
+ reason: z89.string().nullable()
26712
26850
  }).strict();
26713
- var sentimentQuerySummarySchema = z88.object({ ...headlineFields, queryId: id, executionNodeKey: id.nullable().optional(), queryText: z88.string(), queryClass: z88.enum(["branded", "non-brand"]), sourceSnapshotIds: z88.array(id), assessments: z88.array(sentimentAssessmentSummarySchema).default([]), locations: z88.array(z88.object({ ...headlineFields, location: z88.string().nullable(), sourceSnapshotIds: z88.array(id) }).strict()) }).strict();
26714
- var sentimentBreakdownSchema = z88.object({ ...headlineFields, dimension: z88.enum(["provider", "property", "market", "query"]), key: z88.string(), label: z88.string(), queryClass: z88.enum(["branded", "non-brand"]) }).strict();
26715
- var sentimentSummarySchema = z88.object({
26851
+ var sentimentQuerySummarySchema = z89.object({ ...headlineFields, queryId: id, executionNodeKey: id.nullable().optional(), queryText: z89.string(), queryClass: z89.enum(["branded", "non-brand"]), sourceSnapshotIds: z89.array(id), assessments: z89.array(sentimentAssessmentSummarySchema).default([]), locations: z89.array(z89.object({ ...headlineFields, location: z89.string().nullable(), sourceSnapshotIds: z89.array(id) }).strict()) }).strict();
26852
+ var sentimentBreakdownSchema = z89.object({ ...headlineFields, dimension: z89.enum(["provider", "property", "market", "query"]), key: z89.string(), label: z89.string(), queryClass: z89.enum(["branded", "non-brand"]) }).strict();
26853
+ var sentimentSummarySchema = z89.object({
26716
26854
  ...headlineFields,
26717
- configured: z88.boolean(),
26855
+ configured: z89.boolean(),
26718
26856
  selection: sentimentResolvedSelectionSchema,
26719
26857
  evaluationDefinition: sentimentEvaluationDefinitionSchema.nullable(),
26720
- breakdowns: z88.array(sentimentBreakdownSchema),
26721
- queries: z88.array(sentimentQuerySummarySchema),
26858
+ breakdowns: z89.array(sentimentBreakdownSchema),
26859
+ queries: z89.array(sentimentQuerySummarySchema),
26722
26860
  /**
26723
26861
  * Branded reads: the Properties with a mixed or unfavorable rating, most criticized first
26724
26862
  * ({@link rankCriticizedProperties}). `keys` are the first {@link SENTIMENT_CRITICIZED_PROPERTY_LIMIT}
26725
26863
  * property breakdown keys; `total` counts them all; `{ total: 0, keys: [] }` with fewer than two
26726
26864
  * Properties in view. Absent from older servers, comparison periods, and non-brand, disabled or unavailable reads.
26727
26865
  */
26728
- criticizedProperties: z88.object({ total: count2, keys: z88.array(z88.string()) }).strict().optional(),
26866
+ criticizedProperties: z89.object({ total: count2, keys: z89.array(z89.string()) }).strict().optional(),
26729
26867
  /** Present on the paged summary read; follow `nextCursor` as `queryCursor` for the next query rows. */
26730
- queryPage: z88.object({ total: count2, limit: count2, nextCursor: z88.string().nullable() }).strict().optional()
26868
+ queryPage: z89.object({ total: count2, limit: count2, nextCursor: z89.string().nullable() }).strict().optional()
26731
26869
  }).strict();
26732
26870
  var SENTIMENT_CRITICIZED_PROPERTY_LIMIT = 5;
26733
26871
  function rankCriticizedProperties(rows) {
@@ -26738,92 +26876,92 @@ function rankCriticizedProperties(rows) {
26738
26876
  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));
26739
26877
  return { total: criticized.length, keys: criticized.slice(0, SENTIMENT_CRITICIZED_PROPERTY_LIMIT).map((row) => row.key) };
26740
26878
  }
26741
- var sentimentSettingsUpdateSchema = z88.object({ enabled: z88.boolean().optional() }).strict();
26742
- var sentimentSettingsSchema = z88.object({
26879
+ var sentimentSettingsUpdateSchema = z89.object({ enabled: z89.boolean().optional() }).strict();
26880
+ var sentimentSettingsSchema = z89.object({
26743
26881
  provider: sentimentEvaluatorProviderSchema.optional(),
26744
- installEnabled: z88.boolean(),
26745
- enabled: z88.boolean(),
26746
- ready: z88.boolean(),
26747
- readinessReasons: z88.array(z88.string()),
26748
- model: z88.string(),
26882
+ installEnabled: z89.boolean(),
26883
+ enabled: z89.boolean(),
26884
+ ready: z89.boolean(),
26885
+ readinessReasons: z89.array(z89.string()),
26886
+ model: z89.string(),
26749
26887
  enablementEpoch: count2,
26750
26888
  completionBoundary: count2,
26751
26889
  evaluationDefinitionId: id.nullable(),
26752
- actions: z88.object({ configure: z88.boolean(), backfill: z88.boolean() }).strict(),
26890
+ actions: z89.object({ configure: z89.boolean(), backfill: z89.boolean() }).strict(),
26753
26891
  // Kept for older clients. Sentiment is no longer labelled experimental, so the server sends false.
26754
- experimental: z88.boolean(),
26755
- disclosure: z88.string()
26756
- }).strict();
26757
- var sentimentBackfillSelectionSchema = sentimentSelectionBaseSchema.extend({ runIds: runIds.optional(), from: z88.string().datetime().optional(), to: z88.string().datetime().optional() }).superRefine(exclusiveSentimentRuns);
26758
- var sentimentBackfillRequestSchema = z88.object({ previewToken: z88.string().min(1).max(65536), idempotencyKey: z88.string().trim().min(1).max(128) }).strict();
26759
- var sentimentBackfillPreviewSchema = z88.object({
26760
- previewToken: z88.string().nullable(),
26761
- expiresAt: z88.string().nullable(),
26892
+ experimental: z89.boolean(),
26893
+ disclosure: z89.string()
26894
+ }).strict();
26895
+ var sentimentBackfillSelectionSchema = sentimentSelectionBaseSchema.extend({ runIds: runIds.optional(), from: z89.string().datetime().optional(), to: z89.string().datetime().optional() }).superRefine(exclusiveSentimentRuns);
26896
+ var sentimentBackfillRequestSchema = z89.object({ previewToken: z89.string().min(1).max(65536), idempotencyKey: z89.string().trim().min(1).max(128) }).strict();
26897
+ var sentimentBackfillPreviewSchema = z89.object({
26898
+ previewToken: z89.string().nullable(),
26899
+ expiresAt: z89.string().nullable(),
26762
26900
  selection: sentimentBackfillSelectionSchema,
26763
26901
  evaluationDefinitionId: id.nullable(),
26764
26902
  eligibleAssessments: count2,
26765
26903
  alreadyClassified: count2,
26766
- skipped: z88.array(z88.object({ runId: id, reason: z88.string(), count: count2 }).strict()),
26904
+ skipped: z89.array(z89.object({ runId: id, reason: z89.string(), count: count2 }).strict()),
26767
26905
  estimatedInputTokens: count2,
26768
- estimatedCostUsd: z88.number().nonnegative().nullable(),
26769
- estimateMethod: z88.string()
26906
+ estimatedCostUsd: z89.number().nonnegative().nullable(),
26907
+ estimateMethod: z89.string()
26770
26908
  }).strict();
26771
- var sentimentJobStateSchema = z88.enum(["pending", "running", "waiting-to-retry", "complete", "partial", "failed", "canceled"]);
26772
- var sentimentAttemptReceiptSchema = z88.object({ id, workItemId: id, dispatchedAt: z88.string(), completedAt: z88.string().nullable(), returnedModel: z88.string().nullable(), usage: sentimentUsageSchema, errorCode: z88.string().nullable() }).strict();
26773
- var sentimentJobSchema = z88.object({
26909
+ var sentimentJobStateSchema = z89.enum(["pending", "running", "waiting-to-retry", "complete", "partial", "failed", "canceled"]);
26910
+ var sentimentAttemptReceiptSchema = z89.object({ id, workItemId: id, dispatchedAt: z89.string(), completedAt: z89.string().nullable(), returnedModel: z89.string().nullable(), usage: sentimentUsageSchema, errorCode: z89.string().nullable() }).strict();
26911
+ var sentimentJobSchema = z89.object({
26774
26912
  id,
26775
26913
  projectId: id,
26776
- origin: z88.enum(["automatic", "backfill"]),
26914
+ origin: z89.enum(["automatic", "backfill"]),
26777
26915
  state: sentimentJobStateSchema,
26778
26916
  enablementEpoch: count2,
26779
26917
  evaluationDefinitionId: id,
26780
26918
  selection: sentimentBackfillSelectionSchema,
26781
- createdAt: z88.string(),
26782
- updatedAt: z88.string(),
26919
+ createdAt: z89.string(),
26920
+ updatedAt: z89.string(),
26783
26921
  counts: sentimentCountsSchema,
26784
26922
  selected: count2,
26785
- cancellationReason: z88.string().nullable(),
26786
- attempts: z88.array(sentimentAttemptReceiptSchema),
26923
+ cancellationReason: z89.string().nullable(),
26924
+ attempts: z89.array(sentimentAttemptReceiptSchema),
26787
26925
  /** Paged job read: every attempt of the job, and the cursor for the next (older) attempts. */
26788
26926
  attemptCount: count2.optional(),
26789
- nextAttemptCursor: z88.string().nullable().optional()
26927
+ nextAttemptCursor: z89.string().nullable().optional()
26790
26928
  }).strict();
26791
26929
  var sentimentJobSummarySchema = sentimentJobSchema.omit({ attempts: true, attemptCount: true, nextAttemptCursor: true }).extend({ attemptCount: count2 }).strict();
26792
- var sentimentJobsSchema = z88.object({ jobs: z88.array(sentimentJobSummarySchema) }).strict();
26930
+ var sentimentJobsSchema = z89.object({ jobs: z89.array(sentimentJobSummarySchema) }).strict();
26793
26931
  var SENTIMENT_ATTEMPT_PAGE_DEFAULT = 50;
26794
- var sentimentJobRequestSchema = z88.object({
26795
- attemptLimit: z88.coerce.number().int().min(1).max(200).default(SENTIMENT_ATTEMPT_PAGE_DEFAULT),
26796
- attemptCursor: z88.string().min(1).max(4096).optional()
26932
+ var sentimentJobRequestSchema = z89.object({
26933
+ attemptLimit: z89.coerce.number().int().min(1).max(200).default(SENTIMENT_ATTEMPT_PAGE_DEFAULT),
26934
+ attemptCursor: z89.string().min(1).max(4096).optional()
26797
26935
  }).strict();
26798
- var sentimentEvidenceItemSchema = z88.object({
26936
+ var sentimentEvidenceItemSchema = z89.object({
26799
26937
  assessmentId: id,
26800
26938
  runId: id,
26801
26939
  sourceSnapshotId: id,
26802
- sourceText: z88.string(),
26940
+ sourceText: z89.string(),
26803
26941
  sourceTextHash: id,
26804
26942
  subject: sentimentSubjectSchema,
26805
26943
  subjectHash: id,
26806
26944
  context: sentimentExecutionContextSchema,
26807
26945
  evaluationDefinitionId: id,
26808
26946
  outcome: sentimentOutcomeSchema,
26809
- conclusion: z88.array(sentimentEvidenceSchema),
26810
- complaint: z88.array(sentimentEvidenceSchema).nullable(),
26811
- returnedModel: z88.string().nullable(),
26812
- reason: z88.string().nullable()
26947
+ conclusion: z89.array(sentimentEvidenceSchema),
26948
+ complaint: z89.array(sentimentEvidenceSchema).nullable(),
26949
+ returnedModel: z89.string().nullable(),
26950
+ reason: z89.string().nullable()
26813
26951
  }).strict();
26814
- var sentimentEvidencePageSchema = z88.object({ state: sentimentStateSchema, selection: sentimentResolvedSelectionSchema.extend({ assessmentId: id.optional(), outcome: z88.array(sentimentOutcomeSchema).optional() }), items: z88.array(sentimentEvidenceItemSchema), nextCursor: z88.string().nullable() }).strict();
26815
- var sentimentComparisonSchema = z88.object({
26952
+ var sentimentEvidencePageSchema = z89.object({ state: sentimentStateSchema, selection: sentimentResolvedSelectionSchema.extend({ assessmentId: id.optional(), outcome: z89.array(sentimentOutcomeSchema).optional() }), items: z89.array(sentimentEvidenceItemSchema), nextCursor: z89.string().nullable() }).strict();
26953
+ var sentimentComparisonSchema = z89.object({
26816
26954
  from: sentimentSummarySchema,
26817
26955
  to: sentimentSummarySchema,
26818
- verdict: z88.enum(["improved", "declined", "no-clear-change"]).nullable(),
26819
- favorableRateDelta: z88.number().nullable(),
26820
- refusalReasons: z88.array(z88.string()),
26956
+ verdict: z89.enum(["improved", "declined", "no-clear-change"]).nullable(),
26957
+ favorableRateDelta: z89.number().nullable(),
26958
+ refusalReasons: z89.array(z89.string()),
26821
26959
  commonUnits: count2,
26822
26960
  excludedFrom: count2,
26823
26961
  excludedTo: count2,
26824
- changedScope: z88.boolean(),
26825
- method: z88.literal("wilson-independent-v1"),
26826
- limitation: z88.string()
26962
+ changedScope: z89.boolean(),
26963
+ method: z89.literal("wilson-independent-v1"),
26964
+ limitation: z89.string()
26827
26965
  }).strict();
26828
26966
  function emptySentimentCounts() {
26829
26967
  return Object.fromEntries(sentimentOutcomeSchema.options.map((outcome) => [outcome, 0]));
@@ -26860,7 +26998,7 @@ function aggregateSentiment(items, options = {}) {
26860
26998
  }
26861
26999
 
26862
27000
  // ../contracts/src/composites.ts
26863
- import { z as z89 } from "zod";
27001
+ import { z as z90 } from "zod";
26864
27002
  var PROJECT_OVERVIEW_QUERY_CLASS_SCOPE = {
26865
27003
  queryClass: "all",
26866
27004
  figures: [
@@ -26882,36 +27020,36 @@ var PROJECT_OVERVIEW_QUERY_CLASS_SCOPE = {
26882
27020
  ],
26883
27021
  note: "These legacy figures pool branded and non-brand queries in one denominator. mentionCoverage and scores.mentionShare preserve separate class populations."
26884
27022
  };
26885
- var projectOverviewMentionCoverageSchema = z89.object({
27023
+ var projectOverviewMentionCoverageSchema = z90.object({
26886
27024
  selection: visibilityReportSelectionSchema,
26887
- populations: z89.array(z89.object({
27025
+ populations: z90.array(z90.object({
26888
27026
  queryClass: visibilityReportPopulationClassSchema,
26889
- queryCount: z89.number().int().nonnegative(),
26890
- answerCount: z89.number().int().nonnegative(),
27027
+ queryCount: z90.number().int().nonnegative(),
27028
+ answerCount: z90.number().int().nonnegative(),
26891
27029
  mentionCoverage: visibilityReportRateSchema,
26892
27030
  citationCoverage: visibilityReportRateSchema
26893
27031
  }).strict())
26894
27032
  }).strict();
26895
- var metricToneSchema = z89.enum(["positive", "caution", "negative", "neutral"]);
26896
- var scoreSummarySchema = z89.object({
26897
- label: z89.string(),
26898
- value: z89.string(),
26899
- delta: z89.string(),
27033
+ var metricToneSchema = z90.enum(["positive", "caution", "negative", "neutral"]);
27034
+ var scoreSummarySchema = z90.object({
27035
+ label: z90.string(),
27036
+ value: z90.string(),
27037
+ delta: z90.string(),
26900
27038
  tone: metricToneSchema,
26901
- description: z89.string(),
26902
- tooltip: z89.string().optional(),
26903
- trend: z89.array(percent()),
27039
+ description: z90.string(),
27040
+ tooltip: z90.string().optional(),
27041
+ trend: z90.array(percent()),
26904
27042
  progress: percent().optional(),
26905
- providerCoverage: z89.string().optional()
27043
+ providerCoverage: z90.string().optional()
26906
27044
  });
26907
- var mentionShareBreakdownSchema = z89.object({
26908
- projectMentionSnapshots: z89.number().int().nonnegative(),
26909
- competitorMentionSnapshots: z89.number().int().nonnegative(),
27045
+ var mentionShareBreakdownSchema = z90.object({
27046
+ projectMentionSnapshots: z90.number().int().nonnegative(),
27047
+ competitorMentionSnapshots: z90.number().int().nonnegative(),
26910
27048
  /** `projectMentionSnapshots + competitorMentionSnapshots`, the denominator of `score` and every `ranking` share. */
26911
- combinedMentionSnapshots: z89.number().int().nonnegative(),
26912
- perCompetitor: z89.array(z89.object({
26913
- domain: z89.string(),
26914
- mentionSnapshots: z89.number().int().nonnegative(),
27049
+ combinedMentionSnapshots: z90.number().int().nonnegative(),
27050
+ perCompetitor: z90.array(z90.object({
27051
+ domain: z90.string(),
27052
+ mentionSnapshots: z90.number().int().nonnegative(),
26915
27053
  shareOfCompetitiveTotal: percent()
26916
27054
  })),
26917
27055
  /**
@@ -26921,50 +27059,50 @@ var mentionShareBreakdownSchema = z89.object({
26921
27059
  * Empty when there is no head-to-head: no tracked competitors, or no brand
26922
27060
  * named in this class.
26923
27061
  */
26924
- ranking: z89.array(z89.object({
26925
- kind: z89.enum(["project", "competitor"]),
27062
+ ranking: z90.array(z90.object({
27063
+ kind: z90.enum(["project", "competitor"]),
26926
27064
  /** The tracked competitor's domain. Null on the project's row. */
26927
- domain: z89.string().nullable(),
26928
- mentionSnapshots: z89.number().int().nonnegative(),
26929
- share: fraction(z89.number().min(0).max(1))
27065
+ domain: z90.string().nullable(),
27066
+ mentionSnapshots: z90.number().int().nonnegative(),
27067
+ share: fraction(z90.number().min(0).max(1))
26930
27068
  })),
26931
- snapshotsWithAnswerText: z89.number().int().nonnegative(),
26932
- snapshotsTotal: z89.number().int().nonnegative(),
26933
- score: percent(z89.number().min(0).max(100)).nullable()
27069
+ snapshotsWithAnswerText: z90.number().int().nonnegative(),
27070
+ snapshotsTotal: z90.number().int().nonnegative(),
27071
+ score: percent(z90.number().min(0).max(100)).nullable()
26934
27072
  });
26935
27073
  var mentionShareSchema = scoreSummarySchema.extend({
26936
27074
  /** Non-brand queries — the competitive figure. See `MentionShareDto`. */
26937
27075
  breakdown: mentionShareBreakdownSchema,
26938
- scope: z89.enum(["non-brand", "pooled"]),
27076
+ scope: z90.enum(["non-brand", "pooled"]),
26939
27077
  /** Branded queries, beside the competitive figure and never inside it. */
26940
27078
  branded: mentionShareBreakdownSchema
26941
27079
  });
26942
- var movementSummarySchema = z89.object({
26943
- gained: z89.number().int().nonnegative(),
26944
- lost: z89.number().int().nonnegative(),
27080
+ var movementSummarySchema = z90.object({
27081
+ gained: z90.number().int().nonnegative(),
27082
+ lost: z90.number().int().nonnegative(),
26945
27083
  tone: metricToneSchema,
26946
- hasPreviousRun: z89.boolean(),
26947
- gainedQueries: z89.array(z89.string()).optional(),
26948
- lostQueries: z89.array(z89.string()).optional()
26949
- });
26950
- var movementComparisonSchema = z89.object({
26951
- hasPreviousRun: z89.boolean(),
26952
- comparable: z89.boolean(),
26953
- querySetChanged: z89.boolean(),
26954
- previousRunAt: z89.string().nullable(),
26955
- currentQueryCount: z89.number().int().nonnegative(),
26956
- previousQueryCount: z89.number().int().nonnegative(),
26957
- comparableQueryCount: z89.number().int().nonnegative(),
26958
- addedQueryCount: z89.number().int().nonnegative(),
26959
- removedQueryCount: z89.number().int().nonnegative(),
26960
- addedQueries: z89.array(z89.string()),
26961
- removedQueries: z89.array(z89.string())
26962
- });
26963
- var projectOverviewInsightSchema = z89.object({
26964
- id: z89.string(),
26965
- projectId: z89.string(),
26966
- runId: z89.string().nullable(),
26967
- type: z89.enum([
27084
+ hasPreviousRun: z90.boolean(),
27085
+ gainedQueries: z90.array(z90.string()).optional(),
27086
+ lostQueries: z90.array(z90.string()).optional()
27087
+ });
27088
+ var movementComparisonSchema = z90.object({
27089
+ hasPreviousRun: z90.boolean(),
27090
+ comparable: z90.boolean(),
27091
+ querySetChanged: z90.boolean(),
27092
+ previousRunAt: z90.string().nullable(),
27093
+ currentQueryCount: z90.number().int().nonnegative(),
27094
+ previousQueryCount: z90.number().int().nonnegative(),
27095
+ comparableQueryCount: z90.number().int().nonnegative(),
27096
+ addedQueryCount: z90.number().int().nonnegative(),
27097
+ removedQueryCount: z90.number().int().nonnegative(),
27098
+ addedQueries: z90.array(z90.string()),
27099
+ removedQueries: z90.array(z90.string())
27100
+ });
27101
+ var projectOverviewInsightSchema = z90.object({
27102
+ id: z90.string(),
27103
+ projectId: z90.string(),
27104
+ runId: z90.string().nullable(),
27105
+ type: z90.enum([
26968
27106
  "regression",
26969
27107
  "gain",
26970
27108
  "opportunity",
@@ -26981,51 +27119,51 @@ var projectOverviewInsightSchema = z89.object({
26981
27119
  "gbp-keyword-drop"
26982
27120
  ]),
26983
27121
  severity: insightSeveritySchema,
26984
- title: z89.string(),
26985
- query: z89.string(),
26986
- provider: z89.string(),
26987
- recommendation: z89.object({
26988
- action: z89.string(),
26989
- target: z89.string().optional(),
26990
- reason: z89.string()
27122
+ title: z90.string(),
27123
+ query: z90.string(),
27124
+ provider: z90.string(),
27125
+ recommendation: z90.object({
27126
+ action: z90.string(),
27127
+ target: z90.string().optional(),
27128
+ reason: z90.string()
26991
27129
  }).optional(),
26992
- cause: z89.object({
26993
- cause: z89.string(),
26994
- competitorDomain: z89.string().optional(),
26995
- details: z89.string().optional()
27130
+ cause: z90.object({
27131
+ cause: z90.string(),
27132
+ competitorDomain: z90.string().optional(),
27133
+ details: z90.string().optional()
26996
27134
  }).optional(),
26997
- dismissed: z89.boolean(),
26998
- createdAt: z89.string()
27135
+ dismissed: z90.boolean(),
27136
+ createdAt: z90.string()
26999
27137
  });
27000
- var projectOverviewHealthSchema = z89.object({
27001
- id: z89.string(),
27002
- projectId: z89.string(),
27003
- runId: z89.string().nullable(),
27138
+ var projectOverviewHealthSchema = z90.object({
27139
+ id: z90.string(),
27140
+ projectId: z90.string(),
27141
+ runId: z90.string().nullable(),
27004
27142
  overallCitedRate: fraction().nullable(),
27005
27143
  overallMentionRate: fraction(),
27006
- totalPairs: z89.number().int().nonnegative(),
27007
- citedPairs: z89.number().int().nonnegative(),
27008
- citationNotMeasuredPairs: z89.number().int().nonnegative(),
27009
- mentionedPairs: z89.number().int().nonnegative(),
27010
- providerBreakdown: z89.record(z89.string(), z89.object({
27144
+ totalPairs: z90.number().int().nonnegative(),
27145
+ citedPairs: z90.number().int().nonnegative(),
27146
+ citationNotMeasuredPairs: z90.number().int().nonnegative(),
27147
+ mentionedPairs: z90.number().int().nonnegative(),
27148
+ providerBreakdown: z90.record(z90.string(), z90.object({
27011
27149
  citedRate: fraction().nullable(),
27012
27150
  mentionRate: fraction(),
27013
- cited: z89.number().int().nonnegative(),
27014
- mentioned: z89.number().int().nonnegative(),
27015
- total: z89.number().int().nonnegative(),
27016
- citationNotMeasured: z89.number().int().nonnegative()
27151
+ cited: z90.number().int().nonnegative(),
27152
+ mentioned: z90.number().int().nonnegative(),
27153
+ total: z90.number().int().nonnegative(),
27154
+ citationNotMeasured: z90.number().int().nonnegative()
27017
27155
  })),
27018
- createdAt: z89.string(),
27019
- status: z89.enum(["ready", "no-data"]),
27020
- reason: z89.literal("no-runs-yet").optional()
27156
+ createdAt: z90.string(),
27157
+ status: z90.enum(["ready", "no-data"]),
27158
+ reason: z90.literal("no-runs-yet").optional()
27021
27159
  });
27022
- var attentionItemSchema = z89.object({
27023
- id: z89.string(),
27160
+ var attentionItemSchema = z90.object({
27161
+ id: z90.string(),
27024
27162
  tone: metricToneSchema,
27025
- title: z89.string(),
27026
- detail: z89.string(),
27027
- actionLabel: z89.string(),
27028
- href: z89.string()
27163
+ title: z90.string(),
27164
+ detail: z90.string(),
27165
+ actionLabel: z90.string(),
27166
+ href: z90.string()
27029
27167
  });
27030
27168
  var OVERVIEW_WHAT_CHANGED_QUERY_LIMIT = 25;
27031
27169
  var OVERVIEW_WHAT_CHANGED_UNAVAILABLE_REASONS = [
@@ -27044,94 +27182,94 @@ var OVERVIEW_WHAT_CHANGED_UNAVAILABLE_REASONS = [
27044
27182
  /** Advanced: the previous sweep could not be read. */
27045
27183
  "unreadable"
27046
27184
  ];
27047
- var overviewWhatChangedQuerySchema = z89.object({
27185
+ var overviewWhatChangedQuerySchema = z90.object({
27048
27186
  /** The tracked query's id (Simple) or the plan's query id (Advanced). */
27049
- queryId: z89.string().nullable(),
27050
- query: z89.string(),
27187
+ queryId: z90.string().nullable(),
27188
+ query: z90.string(),
27051
27189
  /** The server's class for the query; null when it has no single class. */
27052
27190
  queryClass: queryClassSchema.nullable(),
27053
27191
  /** Answer engines whose answer lost the signal. */
27054
- providers: z89.array(z89.string()),
27192
+ providers: z90.array(z90.string()),
27055
27193
  /** Locations of those answers; null is an answer measured without a location. */
27056
- locations: z89.array(z89.string().nullable()),
27194
+ locations: z90.array(z90.string().nullable()),
27057
27195
  /** Advanced: the Properties that lost the signal on this query. Always empty for Simple. */
27058
- properties: z89.array(z89.object({ key: z89.string(), label: z89.string() })),
27196
+ properties: z90.array(z90.object({ key: z90.string(), label: z90.string() })),
27059
27197
  /** Advanced: the frozen markets of the answers that lost it. Always empty for Simple. */
27060
- markets: z89.array(z89.object({ key: z89.string(), label: z89.string() }))
27198
+ markets: z90.array(z90.object({ key: z90.string(), label: z90.string() }))
27061
27199
  });
27062
- var overviewWhatChangedSignalSchema = z89.object({
27200
+ var overviewWhatChangedSignalSchema = z90.object({
27063
27201
  /** Distinct queries that lost the signal in at least one answer of the latest check. */
27064
- queryCount: z89.number().int().nonnegative(),
27202
+ queryCount: z90.number().int().nonnegative(),
27065
27203
  /** At most `OVERVIEW_WHAT_CHANGED_QUERY_LIMIT` of those queries, in query text order. */
27066
- queries: z89.array(overviewWhatChangedQuerySchema),
27204
+ queries: z90.array(overviewWhatChangedQuerySchema),
27067
27205
  /** True when `queries` names fewer queries than `queryCount`. */
27068
- truncated: z89.boolean()
27206
+ truncated: z90.boolean()
27069
27207
  });
27070
- var overviewWhatChangedComparisonSchema = z89.discriminatedUnion("state", [
27071
- z89.object({
27072
- state: z89.literal("available"),
27208
+ var overviewWhatChangedComparisonSchema = z90.discriminatedUnion("state", [
27209
+ z90.object({
27210
+ state: z90.literal("available"),
27073
27211
  /** The earlier runs the latest check was compared with, newest first. */
27074
- previousRunIds: z89.array(z89.string()).min(1)
27212
+ previousRunIds: z90.array(z90.string()).min(1)
27075
27213
  }),
27076
- z89.object({
27077
- state: z89.literal("unavailable"),
27078
- reason: z89.enum(OVERVIEW_WHAT_CHANGED_UNAVAILABLE_REASONS)
27214
+ z90.object({
27215
+ state: z90.literal("unavailable"),
27216
+ reason: z90.enum(OVERVIEW_WHAT_CHANGED_UNAVAILABLE_REASONS)
27079
27217
  })
27080
27218
  ]);
27081
- var projectOverviewWhatChangedSchema = z89.object({
27082
- mode: z89.enum(["simple", "advanced"]),
27219
+ var projectOverviewWhatChangedSchema = z90.object({
27220
+ mode: z90.enum(["simple", "advanced"]),
27083
27221
  /** The completed check the lost signals read; null before the first one. */
27084
- latestCheck: z89.object({
27085
- runIds: z89.array(z89.string()).min(1),
27086
- createdAt: z89.string()
27222
+ latestCheck: z90.object({
27223
+ runIds: z90.array(z90.string()).min(1),
27224
+ createdAt: z90.string()
27087
27225
  }).nullable(),
27088
27226
  comparison: overviewWhatChangedComparisonSchema,
27089
27227
  lostMentions: overviewWhatChangedSignalSchema,
27090
27228
  lostCitations: overviewWhatChangedSignalSchema,
27091
27229
  /** Queued and running AI Visibility runs, probes left out. */
27092
- activeRuns: z89.object({
27093
- count: z89.number().int().nonnegative(),
27094
- runIds: z89.array(z89.string())
27230
+ activeRuns: z90.object({
27231
+ count: z90.number().int().nonnegative(),
27232
+ runIds: z90.array(z90.string())
27095
27233
  }),
27096
27234
  /** The rows Overview lists for this project, in order. Empty when nothing changed. */
27097
- items: z89.array(attentionItemSchema)
27235
+ items: z90.array(attentionItemSchema)
27098
27236
  });
27099
- var projectOverviewDtoSchema = z89.object({
27237
+ var projectOverviewDtoSchema = z90.object({
27100
27238
  sentiment: sentimentOverviewSchema.optional(),
27101
27239
  mentionCoverage: projectOverviewMentionCoverageSchema.optional(),
27102
27240
  project: projectDtoSchema,
27103
27241
  latestRun: latestProjectRunDtoSchema,
27104
27242
  health: projectOverviewHealthSchema.nullable(),
27105
- topInsights: z89.array(projectOverviewInsightSchema),
27106
- queryClassScope: z89.object({
27107
- queryClass: z89.literal("all"),
27108
- figures: z89.array(z89.string()),
27109
- note: z89.string()
27243
+ topInsights: z90.array(projectOverviewInsightSchema),
27244
+ queryClassScope: z90.object({
27245
+ queryClass: z90.literal("all"),
27246
+ figures: z90.array(z90.string()),
27247
+ note: z90.string()
27110
27248
  }).optional(),
27111
- queryCounts: z89.object({
27112
- totalQueries: z89.number().int().nonnegative(),
27113
- citedQueries: z89.number().int().nonnegative(),
27114
- notCitedQueries: z89.number().int().nonnegative(),
27249
+ queryCounts: z90.object({
27250
+ totalQueries: z90.number().int().nonnegative(),
27251
+ citedQueries: z90.number().int().nonnegative(),
27252
+ notCitedQueries: z90.number().int().nonnegative(),
27115
27253
  citedRate: fraction().nullable(),
27116
- citationNotMeasuredQueries: z89.number().int().nonnegative(),
27117
- mentionedQueries: z89.number().int().nonnegative(),
27118
- notMentionedQueries: z89.number().int().nonnegative(),
27254
+ citationNotMeasuredQueries: z90.number().int().nonnegative(),
27255
+ mentionedQueries: z90.number().int().nonnegative(),
27256
+ notMentionedQueries: z90.number().int().nonnegative(),
27119
27257
  mentionRate: fraction()
27120
27258
  }),
27121
- providers: z89.array(z89.object({
27122
- provider: z89.string(),
27259
+ providers: z90.array(z90.object({
27260
+ provider: z90.string(),
27123
27261
  citedRate: fraction().nullable(),
27124
- cited: z89.number().int().nonnegative(),
27125
- total: z89.number().int().nonnegative(),
27126
- citationNotMeasured: z89.number().int().nonnegative()
27262
+ cited: z90.number().int().nonnegative(),
27263
+ total: z90.number().int().nonnegative(),
27264
+ citationNotMeasured: z90.number().int().nonnegative()
27127
27265
  })),
27128
- transitions: z89.object({
27129
- since: z89.string().nullable(),
27130
- gained: z89.number().int().nonnegative(),
27131
- lost: z89.number().int().nonnegative(),
27132
- emerging: z89.number().int().nonnegative()
27266
+ transitions: z90.object({
27267
+ since: z90.string().nullable(),
27268
+ gained: z90.number().int().nonnegative(),
27269
+ lost: z90.number().int().nonnegative(),
27270
+ emerging: z90.number().int().nonnegative()
27133
27271
  }),
27134
- scores: z89.object({
27272
+ scores: z90.object({
27135
27273
  mention: scoreSummarySchema,
27136
27274
  visibility: scoreSummarySchema,
27137
27275
  mentionShare: mentionShareSchema,
@@ -27145,70 +27283,70 @@ var projectOverviewDtoSchema = z89.object({
27145
27283
  citationMovement: movementSummarySchema,
27146
27284
  mentionMovement: movementSummarySchema,
27147
27285
  movementComparison: movementComparisonSchema,
27148
- competitors: z89.array(z89.object({
27149
- id: z89.string(),
27150
- domain: z89.string(),
27151
- aliases: z89.array(z89.string()).optional(),
27152
- autoAliasNames: z89.array(z89.string()).optional(),
27153
- citationCount: z89.number().int().nonnegative(),
27154
- totalQueries: z89.number().int().nonnegative(),
27155
- pressureLabel: z89.enum(["None", "Low", "Moderate", "High"]),
27156
- citedQueries: z89.array(z89.string())
27286
+ competitors: z90.array(z90.object({
27287
+ id: z90.string(),
27288
+ domain: z90.string(),
27289
+ aliases: z90.array(z90.string()).optional(),
27290
+ autoAliasNames: z90.array(z90.string()).optional(),
27291
+ citationCount: z90.number().int().nonnegative(),
27292
+ totalQueries: z90.number().int().nonnegative(),
27293
+ pressureLabel: z90.enum(["None", "Low", "Moderate", "High"]),
27294
+ citedQueries: z90.array(z90.string())
27157
27295
  })),
27158
- providerScores: z89.array(z89.object({
27159
- provider: z89.string(),
27160
- model: z89.string().nullable(),
27296
+ providerScores: z90.array(z90.object({
27297
+ provider: z90.string(),
27298
+ model: z90.string().nullable(),
27161
27299
  score: percent().nullable(),
27162
- cited: z89.number().int().nonnegative(),
27163
- total: z89.number().int().nonnegative(),
27164
- citationNotMeasured: z89.number().int().nonnegative(),
27165
- trend: z89.array(percent()).optional()
27300
+ cited: z90.number().int().nonnegative(),
27301
+ total: z90.number().int().nonnegative(),
27302
+ citationNotMeasured: z90.number().int().nonnegative(),
27303
+ trend: z90.array(percent()).optional()
27166
27304
  })),
27167
- attentionItems: z89.array(attentionItemSchema),
27305
+ attentionItems: z90.array(attentionItemSchema),
27168
27306
  whatChanged: projectOverviewWhatChangedSchema.optional(),
27169
- runHistory: z89.array(z89.object({
27170
- runId: z89.string(),
27171
- createdAt: z89.string(),
27172
- citedCount: z89.number().int().nonnegative(),
27173
- totalCount: z89.number().int().nonnegative(),
27174
- citationNotMeasuredCount: z89.number().int().nonnegative(),
27307
+ runHistory: z90.array(z90.object({
27308
+ runId: z90.string(),
27309
+ createdAt: z90.string(),
27310
+ citedCount: z90.number().int().nonnegative(),
27311
+ totalCount: z90.number().int().nonnegative(),
27312
+ citationNotMeasuredCount: z90.number().int().nonnegative(),
27175
27313
  citationRate: percent().nullable(),
27176
- mentionedCount: z89.number().int().nonnegative(),
27314
+ mentionedCount: z90.number().int().nonnegative(),
27177
27315
  mentionRate: percent(),
27178
- status: z89.string()
27316
+ status: z90.string()
27179
27317
  })),
27180
- suggestedQueries: z89.object({
27181
- rows: z89.array(z89.object({
27182
- query: z89.string(),
27183
- impressions: z89.number(),
27184
- clicks: z89.number(),
27185
- avgPosition: z89.number(),
27186
- reason: z89.string()
27318
+ suggestedQueries: z90.object({
27319
+ rows: z90.array(z90.object({
27320
+ query: z90.string(),
27321
+ impressions: z90.number(),
27322
+ clicks: z90.number(),
27323
+ avgPosition: z90.number(),
27324
+ reason: z90.string()
27187
27325
  })),
27188
- totalCandidates: z89.number().int().nonnegative(),
27189
- skippedAlreadyTracked: z89.number().int().nonnegative()
27326
+ totalCandidates: z90.number().int().nonnegative(),
27327
+ skippedAlreadyTracked: z90.number().int().nonnegative()
27190
27328
  }),
27191
- dateRangeLabel: z89.string(),
27192
- contextLabel: z89.string()
27193
- });
27194
- var searchHitKindSchema = z89.enum(["snapshot", "insight"]);
27195
- var projectSearchSnapshotHitSchema = z89.object({
27196
- kind: z89.literal("snapshot"),
27197
- id: z89.string(),
27198
- runId: z89.string(),
27199
- query: z89.string(),
27200
- provider: z89.string(),
27201
- model: z89.string().nullable(),
27329
+ dateRangeLabel: z90.string(),
27330
+ contextLabel: z90.string()
27331
+ });
27332
+ var searchHitKindSchema = z90.enum(["snapshot", "insight"]);
27333
+ var projectSearchSnapshotHitSchema = z90.object({
27334
+ kind: z90.literal("snapshot"),
27335
+ id: z90.string(),
27336
+ runId: z90.string(),
27337
+ query: z90.string(),
27338
+ provider: z90.string(),
27339
+ model: z90.string().nullable(),
27202
27340
  citationState: citationStateSchema,
27203
- matchedField: z89.enum(["answerText", "citedDomains", "citedUrls", "searchQueries", "query"]),
27204
- snippet: z89.string(),
27205
- createdAt: z89.string()
27206
- });
27207
- var projectSearchInsightHitSchema = z89.object({
27208
- kind: z89.literal("insight"),
27209
- id: z89.string(),
27210
- runId: z89.string().nullable(),
27211
- type: z89.enum([
27341
+ matchedField: z90.enum(["answerText", "citedDomains", "citedUrls", "searchQueries", "query"]),
27342
+ snippet: z90.string(),
27343
+ createdAt: z90.string()
27344
+ });
27345
+ var projectSearchInsightHitSchema = z90.object({
27346
+ kind: z90.literal("insight"),
27347
+ id: z90.string(),
27348
+ runId: z90.string().nullable(),
27349
+ type: z90.enum([
27212
27350
  "regression",
27213
27351
  "gain",
27214
27352
  "opportunity",
@@ -27226,23 +27364,23 @@ var projectSearchInsightHitSchema = z89.object({
27226
27364
  "gbp-keyword-drop"
27227
27365
  ]),
27228
27366
  severity: insightSeveritySchema,
27229
- title: z89.string(),
27230
- query: z89.string(),
27231
- provider: z89.string(),
27232
- matchedField: z89.enum(["title", "query", "recommendation", "cause"]),
27233
- snippet: z89.string(),
27234
- dismissed: z89.boolean(),
27235
- createdAt: z89.string()
27236
- });
27237
- var projectSearchHitSchema = z89.discriminatedUnion("kind", [
27367
+ title: z90.string(),
27368
+ query: z90.string(),
27369
+ provider: z90.string(),
27370
+ matchedField: z90.enum(["title", "query", "recommendation", "cause"]),
27371
+ snippet: z90.string(),
27372
+ dismissed: z90.boolean(),
27373
+ createdAt: z90.string()
27374
+ });
27375
+ var projectSearchHitSchema = z90.discriminatedUnion("kind", [
27238
27376
  projectSearchSnapshotHitSchema,
27239
27377
  projectSearchInsightHitSchema
27240
27378
  ]);
27241
- var projectSearchResponseSchema = z89.object({
27242
- query: z89.string(),
27243
- totalHits: z89.number().int().nonnegative(),
27244
- truncated: z89.boolean(),
27245
- hits: z89.array(projectSearchHitSchema)
27379
+ var projectSearchResponseSchema = z90.object({
27380
+ query: z90.string(),
27381
+ totalHits: z90.number().int().nonnegative(),
27382
+ truncated: z90.boolean(),
27383
+ hits: z90.array(projectSearchHitSchema)
27246
27384
  });
27247
27385
 
27248
27386
  // ../contracts/src/index-coverage.ts
@@ -27330,107 +27468,107 @@ function summarizeObservedQueryCountsByClass(snapshots, classOf) {
27330
27468
  }
27331
27469
 
27332
27470
  // ../contracts/src/organic-evidence.ts
27333
- import { z as z90 } from "zod";
27334
- var organicEvidencePeriodSchema = z90.union(windowDayValues(WINDOW_SETS.organicEvidence).map((value) => z90.literal(value)));
27471
+ import { z as z91 } from "zod";
27472
+ var organicEvidencePeriodSchema = z91.union(windowDayValues(WINDOW_SETS.organicEvidence).map((value) => z91.literal(value)));
27335
27473
  function parseOrganicEvidencePeriod(value) {
27336
27474
  return windowDays(parseWindowIn(value, WINDOW_SETS.organicEvidence, { field: "period", fallback: "90d" }));
27337
27475
  }
27338
- var cohortNameSchema = z90.enum(["earliest", "middle", "prior", "latest"]);
27339
- var countSchema2 = z90.object({
27340
- clicks: z90.number().int().nonnegative(),
27341
- impressions: z90.number().int().nonnegative()
27476
+ var cohortNameSchema = z91.enum(["earliest", "middle", "prior", "latest"]);
27477
+ var countSchema2 = z91.object({
27478
+ clicks: z91.number().int().nonnegative(),
27479
+ impressions: z91.number().int().nonnegative()
27342
27480
  });
27343
- var cohortSchema = z90.object({
27481
+ var cohortSchema = z91.object({
27344
27482
  name: cohortNameSchema,
27345
- startDate: z90.string(),
27346
- endDate: z90.string()
27483
+ startDate: z91.string(),
27484
+ endDate: z91.string()
27347
27485
  });
27348
27486
  var searchCohortSchema = cohortSchema.extend({ totals: countSchema2 });
27349
27487
  var sessionCohortSchema = cohortSchema.extend({
27350
- organicSessions: z90.number().int().nonnegative()
27351
- });
27352
- var sourceCoverageSchema = z90.object({
27353
- startDate: z90.string(),
27354
- endDate: z90.string(),
27355
- observedDays: z90.number().int().nonnegative()
27356
- });
27357
- var crawlerCountsSchema = z90.object({
27358
- verified: z90.number().int().nonnegative(),
27359
- claimedUnverified: z90.number().int().nonnegative(),
27360
- unknownAiLike: z90.number().int().nonnegative()
27361
- });
27362
- var referralCountsSchema = z90.object({
27363
- total: z90.number().int().nonnegative(),
27364
- paid: z90.number().int().nonnegative(),
27365
- organic: z90.number().int().nonnegative(),
27366
- unknown: z90.number().int().nonnegative()
27367
- });
27368
- var organicEvidenceDtoSchema = z90.object({
27369
- contractVersion: z90.literal("organic-evidence/v1"),
27488
+ organicSessions: z91.number().int().nonnegative()
27489
+ });
27490
+ var sourceCoverageSchema = z91.object({
27491
+ startDate: z91.string(),
27492
+ endDate: z91.string(),
27493
+ observedDays: z91.number().int().nonnegative()
27494
+ });
27495
+ var crawlerCountsSchema = z91.object({
27496
+ verified: z91.number().int().nonnegative(),
27497
+ claimedUnverified: z91.number().int().nonnegative(),
27498
+ unknownAiLike: z91.number().int().nonnegative()
27499
+ });
27500
+ var referralCountsSchema = z91.object({
27501
+ total: z91.number().int().nonnegative(),
27502
+ paid: z91.number().int().nonnegative(),
27503
+ organic: z91.number().int().nonnegative(),
27504
+ unknown: z91.number().int().nonnegative()
27505
+ });
27506
+ var organicEvidenceDtoSchema = z91.object({
27507
+ contractVersion: z91.literal("organic-evidence/v1"),
27370
27508
  periodDays: organicEvidencePeriodSchema,
27371
27509
  /** Latest headline evidence date, preferring the GSC property date when available. */
27372
- asOfDate: z90.string().nullable(),
27373
- coverage: z90.object({
27374
- gsc: z90.boolean(),
27375
- ga4: z90.boolean(),
27376
- server: z90.boolean(),
27377
- visibility: z90.boolean()
27510
+ asOfDate: z91.string().nullable(),
27511
+ coverage: z91.object({
27512
+ gsc: z91.boolean(),
27513
+ ga4: z91.boolean(),
27514
+ server: z91.boolean(),
27515
+ visibility: z91.boolean()
27378
27516
  }),
27379
- sourceCoverage: z90.object({
27517
+ sourceCoverage: z91.object({
27380
27518
  gsc: sourceCoverageSchema.nullable(),
27381
27519
  ga4: sourceCoverageSchema.nullable(),
27382
27520
  server: sourceCoverageSchema.nullable(),
27383
- visibility: z90.object({ completedAt: z90.string(), ageDays: z90.number().nonnegative() }).nullable()
27521
+ visibility: z91.object({ completedAt: z91.string(), ageDays: z91.number().nonnegative() }).nullable()
27384
27522
  }),
27385
- gsc: z90.object({
27523
+ gsc: z91.object({
27386
27524
  propertyTotals: countSchema2,
27387
27525
  namedBrand: countSchema2,
27388
27526
  namedNonBrand: countSchema2,
27389
27527
  suppressedOrUnreportedResidual: countSchema2,
27390
- cohorts: z90.array(searchCohortSchema)
27528
+ cohorts: z91.array(searchCohortSchema)
27391
27529
  }).nullable(),
27392
- ga4: z90.object({
27393
- organicSessions: z90.number().int().nonnegative(),
27394
- cohorts: z90.array(sessionCohortSchema)
27530
+ ga4: z91.object({
27531
+ organicSessions: z91.number().int().nonnegative(),
27532
+ cohorts: z91.array(sessionCohortSchema)
27395
27533
  }).nullable(),
27396
- gaAiReferrals: z90.object({
27397
- paidSessions: z90.number().int().nonnegative(),
27398
- organicSessions: z90.number().int().nonnegative()
27534
+ gaAiReferrals: z91.object({
27535
+ paidSessions: z91.number().int().nonnegative(),
27536
+ organicSessions: z91.number().int().nonnegative()
27399
27537
  }).nullable(),
27400
- server: z90.object({
27538
+ server: z91.object({
27401
27539
  crawlerHits: crawlerCountsSchema,
27402
27540
  userFetchHits: crawlerCountsSchema,
27403
27541
  referralSessions: referralCountsSchema
27404
27542
  }).nullable(),
27405
- visibility: z90.object({
27406
- runId: z90.string(),
27407
- completedAt: z90.string(),
27408
- ageDays: z90.number().nonnegative(),
27543
+ visibility: z91.object({
27544
+ runId: z91.string(),
27545
+ completedAt: z91.string(),
27546
+ ageDays: z91.number().nonnegative(),
27409
27547
  /** Every (query × engine) answer in the run. The base of `mentionedPairs`. */
27410
- answerPairs: z90.number().int().nonnegative(),
27411
- mentionedPairs: z90.number().int().nonnegative(),
27548
+ answerPairs: z91.number().int().nonnegative(),
27549
+ mentionedPairs: z91.number().int().nonnegative(),
27412
27550
  /** Out of `answerPairs - citationNotMeasuredPairs`, the answers whose sources were checked. */
27413
- citedPairs: z90.number().int().nonnegative(),
27551
+ citedPairs: z91.number().int().nonnegative(),
27414
27552
  /** Answers whose engine returns no sources (a local model): neither cited nor not cited. */
27415
- citationNotMeasuredPairs: z90.number().int().nonnegative()
27553
+ citationNotMeasuredPairs: z91.number().int().nonnegative()
27416
27554
  }).nullable(),
27417
27555
  measurement: gaMeasurementAnalysisDtoSchema,
27418
- pages: z90.array(z90.object({
27419
- path: z90.string(),
27556
+ pages: z91.array(z91.object({
27557
+ path: z91.string(),
27420
27558
  gsc: countSchema2,
27421
- ga4OrganicSessions: z90.number().int().nonnegative(),
27422
- server: z90.object({
27559
+ ga4OrganicSessions: z91.number().int().nonnegative(),
27560
+ server: z91.object({
27423
27561
  crawlerHits: crawlerCountsSchema,
27424
27562
  userFetchHits: crawlerCountsSchema,
27425
27563
  referralSessions: referralCountsSchema
27426
27564
  })
27427
27565
  })),
27428
- findings: z90.array(z90.object({
27429
- tone: z90.enum(["positive", "caution", "neutral"]),
27430
- title: z90.string(),
27431
- detail: z90.string()
27566
+ findings: z91.array(z91.object({
27567
+ tone: z91.enum(["positive", "caution", "neutral"]),
27568
+ title: z91.string(),
27569
+ detail: z91.string()
27432
27570
  })),
27433
- limitations: z90.array(z90.object({ code: z90.string(), detail: z90.string() }))
27571
+ limitations: z91.array(z91.object({ code: z91.string(), detail: z91.string() }))
27434
27572
  });
27435
27573
 
27436
27574
  // ../contracts/src/traffic-path.ts
@@ -27611,7 +27749,7 @@ function escapeLikePattern(value) {
27611
27749
  }
27612
27750
 
27613
27751
  // ../contracts/src/chatgpt.ts
27614
- import { z as z91 } from "zod";
27752
+ import { z as z92 } from "zod";
27615
27753
  var CHATGPT_ISSUER = "https://auth.openai.com";
27616
27754
  var CHATGPT_DISCOVERY_URL = `${CHATGPT_ISSUER}/.well-known/openid-configuration`;
27617
27755
  var CHATGPT_RESOURCE = "https://api.openai.com/v1";
@@ -27627,7 +27765,7 @@ var ChatGptSignInIntents = {
27627
27765
  login: "login",
27628
27766
  connect: "connect"
27629
27767
  };
27630
- var chatGptSignInIntentSchema = z91.enum(["login", "connect"]);
27768
+ var chatGptSignInIntentSchema = z92.enum(["login", "connect"]);
27631
27769
  var ChatGptPlanStatuses = {
27632
27770
  /** No plan grant: identity only, never connected, or disconnected. */
27633
27771
  notConnected: "not-connected",
@@ -27636,7 +27774,7 @@ var ChatGptPlanStatuses = {
27636
27774
  /** The grant stopped working (revoked in ChatGPT, refresh refused); connect again. */
27637
27775
  reconnectRequired: "reconnect-required"
27638
27776
  };
27639
- var chatGptPlanStatusSchema = z91.enum(["not-connected", "connected", "reconnect-required"]);
27777
+ var chatGptPlanStatusSchema = z92.enum(["not-connected", "connected", "reconnect-required"]);
27640
27778
  var ChatGptSignInErrors = {
27641
27779
  disabled: "disabled",
27642
27780
  notInvited: "not-invited",
@@ -27646,7 +27784,7 @@ var ChatGptSignInErrors = {
27646
27784
  unverifiedEmail: "unverified-email",
27647
27785
  failed: "failed"
27648
27786
  };
27649
- var chatGptSignInErrorSchema = z91.enum([
27787
+ var chatGptSignInErrorSchema = z92.enum([
27650
27788
  "disabled",
27651
27789
  "not-invited",
27652
27790
  "denied",
@@ -27655,36 +27793,36 @@ var chatGptSignInErrorSchema = z91.enum([
27655
27793
  "unverified-email",
27656
27794
  "failed"
27657
27795
  ]);
27658
- var chatGptAccountStatusSchema = z91.object({
27796
+ var chatGptAccountStatusSchema = z92.object({
27659
27797
  /** True once a ChatGPT account is linked to this person. */
27660
- linked: z91.boolean(),
27798
+ linked: z92.boolean(),
27661
27799
  /** The linked ChatGPT account's email, as OpenAI reported it at the last sign-in. */
27662
- email: z91.string().nullable(),
27663
- plan: z91.object({
27800
+ email: z92.string().nullable(),
27801
+ plan: z92.object({
27664
27802
  status: chatGptPlanStatusSchema,
27665
27803
  /** The model Aero uses on this plan, once one has been chosen. */
27666
- modelId: z91.string().nullable(),
27667
- connectedAt: z91.string().nullable()
27804
+ modelId: z92.string().nullable(),
27805
+ connectedAt: z92.string().nullable()
27668
27806
  })
27669
27807
  });
27670
- var chatGptStatusDtoSchema = z91.object({
27671
- signInEnabled: z91.boolean(),
27672
- planUsageEnabled: z91.boolean(),
27808
+ var chatGptStatusDtoSchema = z92.object({
27809
+ signInEnabled: z92.boolean(),
27810
+ planUsageEnabled: z92.boolean(),
27673
27811
  /** True when a viewer must connect their own ChatGPT plan to use Aero at all (`chatgpt.requirePlan`). */
27674
- planRequired: z91.boolean(),
27675
- usageUrl: z91.string(),
27812
+ planRequired: z92.boolean(),
27813
+ usageUrl: z92.string(),
27676
27814
  account: chatGptAccountStatusSchema.nullable()
27677
27815
  });
27678
- var chatGptModelDtoSchema = z91.object({
27679
- id: z91.string(),
27680
- name: z91.string()
27816
+ var chatGptModelDtoSchema = z92.object({
27817
+ id: z92.string(),
27818
+ name: z92.string()
27681
27819
  });
27682
- var chatGptModelListDtoSchema = z91.object({
27683
- models: z91.array(chatGptModelDtoSchema),
27684
- selected: z91.string().nullable()
27820
+ var chatGptModelListDtoSchema = z92.object({
27821
+ models: z92.array(chatGptModelDtoSchema),
27822
+ selected: z92.string().nullable()
27685
27823
  });
27686
- var chatGptModelSelectionRequestSchema = z91.object({
27687
- modelId: z91.string().trim().min(1).max(200)
27824
+ var chatGptModelSelectionRequestSchema = z92.object({
27825
+ modelId: z92.string().trim().min(1).max(200)
27688
27826
  });
27689
27827
  var CHATGPT_AERO_ERRORS = {
27690
27828
  connectRequired: "CHATGPT_CONNECT_REQUIRED: Connect your ChatGPT plan to use Aero on this dashboard.",
@@ -27841,9 +27979,9 @@ function serializeForInlineScript(value) {
27841
27979
  }
27842
27980
 
27843
27981
  // ../contracts/src/outcome-telemetry.ts
27844
- import { z as z92 } from "zod";
27982
+ import { z as z93 } from "zod";
27845
27983
  var OUTCOME_SURFACES = ["cli", "mcp-stdio", "mcp-http", "aero", "api", "dashboard", "system"];
27846
- var outcomeSurfaceSchema = z92.enum(OUTCOME_SURFACES);
27984
+ var outcomeSurfaceSchema = z93.enum(OUTCOME_SURFACES);
27847
27985
  var OutcomeSurfaces = outcomeSurfaceSchema.enum;
27848
27986
  var INTEGRATION_NAMES = [
27849
27987
  "provider",
@@ -27865,19 +28003,19 @@ var INTEGRATION_NAMES = [
27865
28003
  /** The WordPress traffic-logger plugin source, apart from the WordPress publishing connection. */
27866
28004
  "traffic_wordpress"
27867
28005
  ];
27868
- var integrationNameSchema = z92.enum(INTEGRATION_NAMES);
28006
+ var integrationNameSchema = z93.enum(INTEGRATION_NAMES);
27869
28007
  var IntegrationNames = integrationNameSchema.enum;
27870
28008
  var CONNECTION_ACTIONS = ["connect", "disconnect", "test", "reauth", "select"];
27871
- var connectionActionSchema = z92.enum(CONNECTION_ACTIONS);
28009
+ var connectionActionSchema = z93.enum(CONNECTION_ACTIONS);
27872
28010
  var ConnectionActions = connectionActionSchema.enum;
27873
28011
  var CONNECTION_STATUSES = ["started", "succeeded", "failed", "cancelled"];
27874
- var connectionStatusSchema = z92.enum(CONNECTION_STATUSES);
28012
+ var connectionStatusSchema = z93.enum(CONNECTION_STATUSES);
27875
28013
  var ConnectionStatuses = connectionStatusSchema.enum;
27876
28014
  var OUTCOME_STATUSES = ["succeeded", "partial", "failed", "skipped", "cancelled"];
27877
- var outcomeStatusSchema = z92.enum(OUTCOME_STATUSES);
28015
+ var outcomeStatusSchema = z93.enum(OUTCOME_STATUSES);
27878
28016
  var OutcomeStatuses = outcomeStatusSchema.enum;
27879
28017
  var OUTCOME_TRIGGERS = ["manual", "scheduled", "agent", "startup", "retry", "push"];
27880
- var outcomeTriggerSchema = z92.enum(OUTCOME_TRIGGERS);
28018
+ var outcomeTriggerSchema = z93.enum(OUTCOME_TRIGGERS);
27881
28019
  var OutcomeTriggers = outcomeTriggerSchema.enum;
27882
28020
  var OUTCOME_REASON_CODES = [
27883
28021
  "AUTH_DENIED",
@@ -27914,7 +28052,7 @@ var OUTCOME_REASON_CODES = [
27914
28052
  "UNCAUGHT_EXCEPTION",
27915
28053
  "UNHANDLED_REJECTION"
27916
28054
  ];
27917
- var outcomeReasonCodeSchema = z92.enum(OUTCOME_REASON_CODES);
28055
+ var outcomeReasonCodeSchema = z93.enum(OUTCOME_REASON_CODES);
27918
28056
  var OutcomeReasonCodes = outcomeReasonCodeSchema.enum;
27919
28057
  var FEATURE_OPERATIONS = {
27920
28058
  search_console: ["sync", "inspect", "sitemap_submit"],
@@ -27944,7 +28082,7 @@ var FEATURE_OPERATIONS = {
27944
28082
  server: ["start", "crash"]
27945
28083
  };
27946
28084
  var FEATURE_NAMES = Object.keys(FEATURE_OPERATIONS);
27947
- var featureNameSchema = z92.enum(FEATURE_NAMES);
28085
+ var featureNameSchema = z93.enum(FEATURE_NAMES);
27948
28086
  var FeatureNames = featureNameSchema.enum;
27949
28087
  var OUTCOME_COUNT_KEYS = [
27950
28088
  "rows",
@@ -27982,16 +28120,16 @@ var OUTCOME_COUNT_KEYS = [
27982
28120
  ];
27983
28121
  var COUNT_KEY_SET = new Set(OUTCOME_COUNT_KEYS);
27984
28122
  var MAX_COUNT = 1e12;
27985
- var countValueSchema = z92.number().int().min(0).max(MAX_COUNT);
27986
- var countsSchema2 = z92.record(z92.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");
28123
+ var countValueSchema = z93.number().int().min(0).max(MAX_COUNT);
28124
+ var countsSchema2 = z93.record(z93.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");
27987
28125
  var WEBHOOK_TARGETS = ["first_party", "slack", "discord"];
27988
- var webhookTargetSchema = z92.enum(WEBHOOK_TARGETS);
28126
+ var webhookTargetSchema = z93.enum(WEBHOOK_TARGETS);
27989
28127
  var WebhookTargets = webhookTargetSchema.enum;
27990
28128
  var STATUS_CLASSES = ["2xx", "3xx", "4xx", "5xx", "timeout", "network", "blocked"];
27991
- var statusClassSchema = z92.enum(STATUS_CLASSES);
28129
+ var statusClassSchema = z93.enum(STATUS_CLASSES);
27992
28130
  var StatusClasses = statusClassSchema.enum;
27993
28131
  var DURATION_BUCKETS = ["under_1s", "1s_to_10s", "10s_to_1m", "1m_to_5m", "5m_to_30m", "30m_or_more"];
27994
- var durationBucketSchema = z92.enum(DURATION_BUCKETS);
28132
+ var durationBucketSchema = z93.enum(DURATION_BUCKETS);
27995
28133
  var DurationBuckets = durationBucketSchema.enum;
27996
28134
  function bucketDuration(durationMs) {
27997
28135
  const duration = Number.isFinite(durationMs) ? Math.max(0, durationMs) : 0;
@@ -28002,14 +28140,14 @@ function bucketDuration(durationMs) {
28002
28140
  if (duration < 18e5) return "5m_to_30m";
28003
28141
  return "30m_or_more";
28004
28142
  }
28005
- var outcomeOperationKindSchema = z92.enum(["data-refresh", "url-coverage", "url-inspection", "agent-turn", "site-audit"]);
28143
+ var outcomeOperationKindSchema = z93.enum(["data-refresh", "url-coverage", "url-inspection", "agent-turn", "site-audit"]);
28006
28144
  var OutcomeOperationKinds = outcomeOperationKindSchema.enum;
28007
- var outcomePhaseSchema = z92.enum(["setup", "provider-request", "crawl", "persistence", "unknown"]);
28145
+ var outcomePhaseSchema = z93.enum(["setup", "provider-request", "crawl", "persistence", "unknown"]);
28008
28146
  var OutcomePhases = outcomePhaseSchema.enum;
28009
- var outcomeDiagnosticsSchema = z92.object({
28147
+ var outcomeDiagnosticsSchema = z93.object({
28010
28148
  phase: outcomePhaseSchema,
28011
- httpStatus: z92.number().int().min(100).max(599).optional(),
28012
- retryCount: z92.number().int().min(0).max(1e6).optional(),
28149
+ httpStatus: z93.number().int().min(100).max(599).optional(),
28150
+ retryCount: z93.number().int().min(0).max(1e6).optional(),
28013
28151
  retryAfterBucket: durationBucketSchema.optional(),
28014
28152
  /** Unresolved units in this operation: URLs for coverage, sections for a refresh. */
28015
28153
  remainingWork: countValueSchema.optional()
@@ -28032,12 +28170,12 @@ function buildOutcomeDiagnostics(error, context) {
28032
28170
  return { phase: context.phase };
28033
28171
  }
28034
28172
  }
28035
- var errorNameSchema = z92.string().regex(/^[A-Z_$][\w$]{0,39}$/i);
28036
- var agentSlugSchema = z92.string().regex(/^[a-z0-9][a-z0-9._-]{0,39}$/);
28037
- var providerNameSchema2 = z92.enum(PROVIDER_NAMES);
28038
- var modelIdSchema2 = z92.string().regex(/^[A-Z0-9][\w.:/@-]{0,99}$/i).refine((v) => !v.includes("://"), "a model id is never a URL");
28039
- var slugSchema = z92.string().regex(/^[a-z0-9][a-z0-9._-]{0,31}$/);
28040
- var integrationConnectionPropertiesSchema = z92.object({
28173
+ var errorNameSchema = z93.string().regex(/^[A-Z_$][\w$]{0,39}$/i);
28174
+ var agentSlugSchema = z93.string().regex(/^[a-z0-9][a-z0-9._-]{0,39}$/);
28175
+ var providerNameSchema2 = z93.enum(PROVIDER_NAMES);
28176
+ var modelIdSchema2 = z93.string().regex(/^[A-Z0-9][\w.:/@-]{0,99}$/i).refine((v) => !v.includes("://"), "a model id is never a URL");
28177
+ var slugSchema = z93.string().regex(/^[a-z0-9][a-z0-9._-]{0,31}$/);
28178
+ var integrationConnectionPropertiesSchema = z93.object({
28041
28179
  integration: integrationNameSchema,
28042
28180
  provider: providerNameSchema2.optional(),
28043
28181
  action: connectionActionSchema,
@@ -28048,9 +28186,9 @@ var integrationConnectionPropertiesSchema = z92.object({
28048
28186
  surface: outcomeSurfaceSchema.optional(),
28049
28187
  agent: agentSlugSchema.optional(),
28050
28188
  durationBucket: durationBucketSchema.optional(),
28051
- attempt: z92.number().int().min(1).max(1e6).optional(),
28189
+ attempt: z93.number().int().min(1).max(1e6).optional(),
28052
28190
  /** The install's first success of this kind; set by the helpers, never by callers. */
28053
- first: z92.literal(true).optional()
28191
+ first: z93.literal(true).optional()
28054
28192
  }).strict().refine(
28055
28193
  (p) => p.integration === IntegrationNames.provider === (p.provider !== void 0),
28056
28194
  "provider is required for, and only for, integration provider"
@@ -28058,12 +28196,12 @@ var integrationConnectionPropertiesSchema = z92.object({
28058
28196
  (p) => p.status === ConnectionStatuses.succeeded || p.status === ConnectionStatuses.started || p.reasonCode !== void 0,
28059
28197
  "a failed or cancelled attempt needs a reasonCode"
28060
28198
  );
28061
- var featureCompletedPropertiesSchema = z92.object({
28199
+ var featureCompletedPropertiesSchema = z93.object({
28062
28200
  feature: featureNameSchema,
28063
- operation: z92.string().regex(/^[a-z][a-z_]{0,31}$/),
28201
+ operation: z93.string().regex(/^[a-z][a-z_]{0,31}$/),
28064
28202
  operationKind: outcomeOperationKindSchema.optional(),
28065
28203
  /** Fresh random correlation id, never a project, run, account or conversation id. */
28066
- operationId: z92.string().uuid().optional(),
28204
+ operationId: z93.string().uuid().optional(),
28067
28205
  diagnostics: outcomeDiagnosticsSchema.optional(),
28068
28206
  status: outcomeStatusSchema,
28069
28207
  trigger: outcomeTriggerSchema.optional(),
@@ -28079,17 +28217,17 @@ var featureCompletedPropertiesSchema = z92.object({
28079
28217
  provider: providerNameSchema2.optional(),
28080
28218
  model: modelIdSchema2.optional(),
28081
28219
  modelProvider: slugSchema.optional(),
28082
- sampleRate: z92.number().int().min(1).max(1e6).optional(),
28083
- droppedBefore: z92.number().int().min(0).max(MAX_COUNT).optional(),
28084
- domainHash: z92.string().regex(/^[0-9a-f]{64}$/).optional(),
28085
- first: z92.literal(true).optional()
28220
+ sampleRate: z93.number().int().min(1).max(1e6).optional(),
28221
+ droppedBefore: z93.number().int().min(0).max(MAX_COUNT).optional(),
28222
+ domainHash: z93.string().regex(/^[0-9a-f]{64}$/).optional(),
28223
+ first: z93.literal(true).optional()
28086
28224
  }).strict().refine(
28087
28225
  (p) => FEATURE_OPERATIONS[p.feature].includes(p.operation),
28088
28226
  "operation is not one this feature reports"
28089
28227
  ).refine((p) => p.status === OutcomeStatuses.succeeded || p.reasonCode !== void 0, "a non-succeeded outcome needs a reasonCode").refine((p) => Object.values(p).filter((value) => value !== void 0).length <= 20, "collector accepts at most 20 properties");
28090
28228
  var INSTALL_SOURCES = ["npm", "homebrew", "docker", "source"];
28091
- var installSourceSchema = z92.enum(INSTALL_SOURCES);
28092
- var installRefSchema = z92.string().regex(/^[a-z0-9][a-z0-9-]{0,31}$/);
28229
+ var installSourceSchema = z93.enum(INSTALL_SOURCES);
28230
+ var installRefSchema = z93.string().regex(/^[a-z0-9][a-z0-9-]{0,31}$/);
28093
28231
  function normalizeInstallRef(value) {
28094
28232
  const ref = value?.trim().toLowerCase();
28095
28233
  return ref && installRefSchema.safeParse(ref).success ? ref : void 0;
@@ -28124,11 +28262,11 @@ var INSTALL_STATE_USAGE_KEYS = [
28124
28262
  ];
28125
28263
  var fixedKeyCounts = (keys) => {
28126
28264
  const allowed = new Set(keys);
28127
- return z92.record(z92.string(), countValueSchema).refine((obj) => Object.keys(obj).every((k) => allowed.has(k)), "unknown key");
28265
+ return z93.record(z93.string(), countValueSchema).refine((obj) => Object.keys(obj).every((k) => allowed.has(k)), "unknown key");
28128
28266
  };
28129
- var installStatePropertiesSchema = z92.object({
28130
- providers: z92.array(providerNameSchema2).max(PROVIDER_NAMES.length),
28131
- integrations: z92.array(integrationNameSchema.exclude([IntegrationNames.provider])).max(INTEGRATION_NAMES.length),
28267
+ var installStatePropertiesSchema = z93.object({
28268
+ providers: z93.array(providerNameSchema2).max(PROVIDER_NAMES.length),
28269
+ integrations: z93.array(integrationNameSchema.exclude([IntegrationNames.provider])).max(INTEGRATION_NAMES.length),
28132
28270
  counts: fixedKeyCounts(INSTALL_STATE_COUNT_KEYS),
28133
28271
  usage24h: fixedKeyCounts(INSTALL_STATE_USAGE_KEYS),
28134
28272
  providerCalls24h: fixedKeyCounts(PROVIDER_NAMES).optional(),
@@ -28209,7 +28347,7 @@ function classifyProviderOutcomeError(err) {
28209
28347
  }
28210
28348
 
28211
28349
  // ../contracts/src/ui-telemetry.ts
28212
- import { z as z93 } from "zod";
28350
+ import { z as z94 } from "zod";
28213
28351
  var UI_PAGES = [
28214
28352
  "/",
28215
28353
  "/projects",
@@ -28243,7 +28381,7 @@ var UI_PAGES = [
28243
28381
  "not-found",
28244
28382
  "other"
28245
28383
  ];
28246
- var uiPageSchema = z93.enum(UI_PAGES);
28384
+ var uiPageSchema = z94.enum(UI_PAGES);
28247
28385
  var UI_PROJECT_TABS = [
28248
28386
  "overview",
28249
28387
  "portfolio",
@@ -28265,7 +28403,7 @@ var UI_PROJECT_TABS = [
28265
28403
  "settings",
28266
28404
  "other"
28267
28405
  ];
28268
- var uiProjectTabSchema = z93.enum(UI_PROJECT_TABS);
28406
+ var uiProjectTabSchema = z94.enum(UI_PROJECT_TABS);
28269
28407
  var UI_ACTIONS = [
28270
28408
  "sweep.launch",
28271
28409
  "sweep.cancel",
@@ -28318,7 +28456,7 @@ var UI_ACTIONS = [
28318
28456
  /** A table search settled on a non-empty query (debounced or Enter; the text is never sent). */
28319
28457
  "search.submit"
28320
28458
  ];
28321
- var uiActionSchema = z93.enum(UI_ACTIONS);
28459
+ var uiActionSchema = z94.enum(UI_ACTIONS);
28322
28460
  var UI_INTEGRATIONS = [
28323
28461
  "google",
28324
28462
  "gsc",
@@ -28334,9 +28472,9 @@ var UI_INTEGRATIONS = [
28334
28472
  "traffic_cloud_run",
28335
28473
  "traffic_wordpress"
28336
28474
  ];
28337
- var uiIntegrationSchema = z93.enum(UI_INTEGRATIONS);
28475
+ var uiIntegrationSchema = z94.enum(UI_INTEGRATIONS);
28338
28476
  var UI_FILTERS = ["provider", "model", "location", "window", "query_class", "seoProfile", "other"];
28339
- var uiFilterSchema = z93.enum(UI_FILTERS);
28477
+ var uiFilterSchema = z94.enum(UI_FILTERS);
28340
28478
  var UI_EXPORT_FORMATS = ["csv", "json", "html"];
28341
28479
  var UI_ERROR_KINDS = ["render", "unhandled", "api"];
28342
28480
  var UI_STATUS_CLASSES = ["4xx", "5xx", "network"];
@@ -28422,54 +28560,54 @@ function isUiApiRouteTemplate(route) {
28422
28560
  return PARAM_SEGMENT.test(segment) || UI_ROUTE_FIXED_CHILDREN.has(`${previous}/${segment}`);
28423
28561
  });
28424
28562
  }
28425
- var uiEventBaseSchema = z93.object({
28426
- eventId: z93.string().uuid(),
28427
- uiSessionId: z93.string().uuid(),
28563
+ var uiEventBaseSchema = z94.object({
28564
+ eventId: z94.string().uuid(),
28565
+ uiSessionId: z94.string().uuid(),
28428
28566
  page: uiPageSchema
28429
28567
  });
28430
28568
  var UI_PAGE_TIME_MAX_MS = 864e5;
28431
- var uiTelemetryEventSchema = z93.discriminatedUnion("event", [
28569
+ var uiTelemetryEventSchema = z94.discriminatedUnion("event", [
28432
28570
  uiEventBaseSchema.extend({
28433
- event: z93.literal("ui.page_time"),
28571
+ event: z94.literal("ui.page_time"),
28434
28572
  tab: uiProjectTabSchema.optional(),
28435
- visitId: z93.string().uuid(),
28436
- foregroundMs: z93.number().int().min(1).max(UI_PAGE_TIME_MAX_MS),
28437
- activeMs: z93.number().int().min(0).max(UI_PAGE_TIME_MAX_MS),
28438
- completed: z93.boolean()
28573
+ visitId: z94.string().uuid(),
28574
+ foregroundMs: z94.number().int().min(1).max(UI_PAGE_TIME_MAX_MS),
28575
+ activeMs: z94.number().int().min(0).max(UI_PAGE_TIME_MAX_MS),
28576
+ completed: z94.boolean()
28439
28577
  }).strict().refine((value) => value.activeMs <= value.foregroundMs, "active time cannot exceed foreground time"),
28440
28578
  uiEventBaseSchema.extend({
28441
- event: z93.literal("ui.page_viewed"),
28579
+ event: z94.literal("ui.page_viewed"),
28442
28580
  tab: uiProjectTabSchema.optional()
28443
28581
  }).strict(),
28444
28582
  uiEventBaseSchema.extend({
28445
- event: z93.literal("ui.action"),
28583
+ event: z94.literal("ui.action"),
28446
28584
  action: uiActionSchema,
28447
28585
  tab: uiProjectTabSchema.optional(),
28448
28586
  integration: uiIntegrationSchema.optional(),
28449
- format: z93.enum(UI_EXPORT_FORMATS).optional(),
28587
+ format: z94.enum(UI_EXPORT_FORMATS).optional(),
28450
28588
  filter: uiFilterSchema.optional()
28451
28589
  }).strict(),
28452
28590
  uiEventBaseSchema.extend({
28453
- event: z93.literal("ui.error"),
28454
- kind: z93.enum(UI_ERROR_KINDS),
28591
+ event: z94.literal("ui.error"),
28592
+ kind: z94.enum(UI_ERROR_KINDS),
28455
28593
  tab: uiProjectTabSchema.optional(),
28456
- component: z93.string().regex(UI_COMPONENT_PATTERN).optional(),
28457
- errorName: z93.string().regex(UI_ERROR_NAME_PATTERN).optional(),
28458
- route: z93.string().max(UI_API_ROUTE_MAX_LENGTH).refine(isUiApiRouteTemplate, "route must be a route template").optional(),
28459
- method: z93.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]).optional(),
28460
- statusClass: z93.enum(UI_STATUS_CLASSES).optional(),
28461
- status: z93.number().int().min(400).max(599).optional()
28594
+ component: z94.string().regex(UI_COMPONENT_PATTERN).optional(),
28595
+ errorName: z94.string().regex(UI_ERROR_NAME_PATTERN).optional(),
28596
+ route: z94.string().max(UI_API_ROUTE_MAX_LENGTH).refine(isUiApiRouteTemplate, "route must be a route template").optional(),
28597
+ method: z94.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]).optional(),
28598
+ statusClass: z94.enum(UI_STATUS_CLASSES).optional(),
28599
+ status: z94.number().int().min(400).max(599).optional()
28462
28600
  }).strict(),
28463
28601
  uiEventBaseSchema.extend({
28464
- event: z93.literal("ui.vitals"),
28465
- metric: z93.enum(UI_VITAL_METRICS),
28466
- rating: z93.enum(UI_VITAL_RATINGS),
28602
+ event: z94.literal("ui.vitals"),
28603
+ metric: z94.enum(UI_VITAL_METRICS),
28604
+ rating: z94.enum(UI_VITAL_RATINGS),
28467
28605
  tab: uiProjectTabSchema.optional()
28468
28606
  }).strict()
28469
28607
  ]);
28470
28608
 
28471
28609
  // ../contracts/src/feedback.ts
28472
- import { z as z94 } from "zod";
28610
+ import { z as z95 } from "zod";
28473
28611
 
28474
28612
  // ../contracts/src/log-redaction.ts
28475
28613
  var REDACTED = "[REDACTED]";
@@ -28628,7 +28766,7 @@ function redactEmbeddedUrls(value) {
28628
28766
 
28629
28767
  // ../contracts/src/feedback.ts
28630
28768
  var FEEDBACK_KINDS = ["struggle", "bug", "improvement", "other"];
28631
- var feedbackKindSchema = z94.enum(FEEDBACK_KINDS);
28769
+ var feedbackKindSchema = z95.enum(FEEDBACK_KINDS);
28632
28770
  var FEEDBACK_LIMITS = {
28633
28771
  summary: 500,
28634
28772
  details: 4e3,
@@ -28636,17 +28774,17 @@ var FEEDBACK_LIMITS = {
28636
28774
  command: 120,
28637
28775
  errorCode: 40
28638
28776
  };
28639
- var feedbackSubmissionSchema = z94.object({
28777
+ var feedbackSubmissionSchema = z95.object({
28640
28778
  kind: feedbackKindSchema,
28641
- summary: z94.string().trim().min(1).max(FEEDBACK_LIMITS.summary),
28642
- details: z94.string().trim().min(1).max(FEEDBACK_LIMITS.details).optional(),
28643
- area: z94.string().trim().min(1).max(FEEDBACK_LIMITS.area).optional(),
28644
- command: z94.string().trim().min(1).max(FEEDBACK_LIMITS.command).optional(),
28645
- errorCode: z94.string().trim().min(1).max(FEEDBACK_LIMITS.errorCode).optional()
28779
+ summary: z95.string().trim().min(1).max(FEEDBACK_LIMITS.summary),
28780
+ details: z95.string().trim().min(1).max(FEEDBACK_LIMITS.details).optional(),
28781
+ area: z95.string().trim().min(1).max(FEEDBACK_LIMITS.area).optional(),
28782
+ command: z95.string().trim().min(1).max(FEEDBACK_LIMITS.command).optional(),
28783
+ errorCode: z95.string().trim().min(1).max(FEEDBACK_LIMITS.errorCode).optional()
28646
28784
  }).strict();
28647
- var feedbackAcceptedDtoSchema = z94.object({
28648
- accepted: z94.boolean(),
28649
- id: z94.string()
28785
+ var feedbackAcceptedDtoSchema = z95.object({
28786
+ accepted: z95.boolean(),
28787
+ id: z95.string()
28650
28788
  });
28651
28789
  function redactFeedbackText(value, limit) {
28652
28790
  return truncateUtf16(
@@ -28725,7 +28863,7 @@ function asRecord(value) {
28725
28863
  }
28726
28864
 
28727
28865
  // ../contracts/src/tolerant-read.ts
28728
- import { z as z95 } from "zod";
28866
+ import { z as z96 } from "zod";
28729
28867
  var WRAPPER_TYPES = /* @__PURE__ */ new Set(["optional", "nullable", "default", "prefault", "readonly", "catch", "nonoptional"]);
28730
28868
  var DEPTH_LIMIT = 64;
28731
28869
  function defOf(schema) {
@@ -28736,9 +28874,9 @@ function cloneWith(schema, changes) {
28736
28874
  }
28737
28875
  function openPrimitive(values) {
28738
28876
  if (values.length === 0) return void 0;
28739
- if (values.every((value) => typeof value === "string")) return z95.string();
28740
- if (values.every((value) => typeof value === "number")) return z95.number();
28741
- if (values.every((value) => typeof value === "boolean")) return z95.boolean();
28877
+ if (values.every((value) => typeof value === "string")) return z96.string();
28878
+ if (values.every((value) => typeof value === "number")) return z96.number();
28879
+ if (values.every((value) => typeof value === "boolean")) return z96.boolean();
28742
28880
  return void 0;
28743
28881
  }
28744
28882
  function walk2(schema, open, memo, depth) {
@@ -28752,7 +28890,7 @@ function walk2(schema, open, memo, depth) {
28752
28890
  const shape = Object.fromEntries(Object.entries(schema.shape).map(([key, child]) => [key, next(child)]));
28753
28891
  const declared = def.catchall;
28754
28892
  const catchall = open.get(schema) ?? (declared && defOf(declared).type !== "never" ? next(declared) : void 0);
28755
- result = catchall ? z95.object(shape).catchall(catchall) : z95.object(shape);
28893
+ result = catchall ? z96.object(shape).catchall(catchall) : z96.object(shape);
28756
28894
  } else if (WRAPPER_TYPES.has(def.type)) {
28757
28895
  const inner = def.innerType;
28758
28896
  const mapped = next(inner);
@@ -28769,10 +28907,10 @@ function walk2(schema, open, memo, depth) {
28769
28907
  const options = def.options;
28770
28908
  const mapped = options.map(next);
28771
28909
  const changed = mapped.some((option, index) => option !== options[index]);
28772
- result = !changed ? schema : def.discriminator ? z95.union(mapped) : cloneWith(schema, { options: mapped });
28910
+ result = !changed ? schema : def.discriminator ? z96.union(mapped) : cloneWith(schema, { options: mapped });
28773
28911
  } else if (def.type === "record") {
28774
28912
  const keyType = def.keyType, valueType = def.valueType;
28775
- const mappedKey = defOf(keyType).type === "enum" ? z95.string() : keyType;
28913
+ const mappedKey = defOf(keyType).type === "enum" ? z96.string() : keyType;
28776
28914
  const mappedValue = next(valueType);
28777
28915
  result = mappedKey === keyType && mappedValue === valueType ? schema : cloneWith(schema, { keyType: mappedKey, valueType: mappedValue });
28778
28916
  } else if (def.type === "intersection") {
@@ -28788,7 +28926,7 @@ function walk2(schema, open, memo, depth) {
28788
28926
  result = changed ? cloneWith(schema, { items: mappedItems, rest: mappedRest }) : schema;
28789
28927
  } else if (def.type === "lazy") {
28790
28928
  const getter = def.getter;
28791
- result = z95.lazy(() => next(getter()));
28929
+ result = z96.lazy(() => next(getter()));
28792
28930
  } else if (def.type === "enum") {
28793
28931
  result = openPrimitive(Object.values(def.entries)) ?? schema;
28794
28932
  } else if (def.type === "literal") {
@@ -28803,8 +28941,8 @@ function tolerantReadSchema(schema, options = {}) {
28803
28941
  }
28804
28942
 
28805
28943
  // ../contracts/src/sentiment-read.ts
28806
- import { z as z96 } from "zod";
28807
- var OPEN_COUNTS = { openKeys: [[sentimentCountsSchema, z96.number().int().nonnegative()]] };
28944
+ import { z as z97 } from "zod";
28945
+ var OPEN_COUNTS = { openKeys: [[sentimentCountsSchema, z97.number().int().nonnegative()]] };
28808
28946
  var sentimentSettingsReadSchema = tolerantReadSchema(sentimentSettingsSchema, OPEN_COUNTS);
28809
28947
  var sentimentSummaryReadSchema = tolerantReadSchema(sentimentSummarySchema, OPEN_COUNTS);
28810
28948
  var sentimentEvidencePageReadSchema = tolerantReadSchema(sentimentEvidencePageSchema, OPEN_COUNTS);
@@ -28843,29 +28981,29 @@ function rateOverCheckedAnswers(numerator, answers, excluded) {
28843
28981
  }
28844
28982
 
28845
28983
  // ../contracts/src/cli-catalog.ts
28846
- import { z as z97 } from "zod";
28847
- var cliCatalogOptionSchema = z97.object({
28848
- name: z97.string(),
28849
- type: z97.enum(["string", "boolean"]),
28850
- multiple: z97.boolean()
28851
- });
28852
- var cliCatalogCommandSchema = z97.object({
28853
- id: z97.string(),
28854
- path: z97.array(z97.string()).min(1),
28855
- usage: z97.string(),
28856
- supportsDryRun: z97.boolean(),
28857
- windows: z97.array(z97.string()).optional(),
28858
- options: z97.array(cliCatalogOptionSchema),
28984
+ import { z as z98 } from "zod";
28985
+ var cliCatalogOptionSchema = z98.object({
28986
+ name: z98.string(),
28987
+ type: z98.enum(["string", "boolean"]),
28988
+ multiple: z98.boolean()
28989
+ });
28990
+ var cliCatalogCommandSchema = z98.object({
28991
+ id: z98.string(),
28992
+ path: z98.array(z98.string()).min(1),
28993
+ usage: z98.string(),
28994
+ supportsDryRun: z98.boolean(),
28995
+ windows: z98.array(z98.string()).optional(),
28996
+ options: z98.array(cliCatalogOptionSchema),
28859
28997
  access: operationAccessSchema
28860
28998
  });
28861
- var cliCatalogSchema = z97.object({
28862
- version: z97.string(),
28863
- globalOptions: z97.array(cliCatalogOptionSchema),
28864
- groups: z97.array(z97.object({
28865
- root: z97.string(),
28866
- section: z97.string(),
28867
- summary: z97.string(),
28868
- commands: z97.array(cliCatalogCommandSchema)
28999
+ var cliCatalogSchema = z98.object({
29000
+ version: z98.string(),
29001
+ globalOptions: z98.array(cliCatalogOptionSchema),
29002
+ groups: z98.array(z98.object({
29003
+ root: z98.string(),
29004
+ section: z98.string(),
29005
+ summary: z98.string(),
29006
+ commands: z98.array(cliCatalogCommandSchema)
28869
29007
  }))
28870
29008
  });
28871
29009
 
@@ -29105,41 +29243,41 @@ function compareSeoKeywordGapsBy(sort) {
29105
29243
  }
29106
29244
 
29107
29245
  // ../contracts/src/sitemaps.ts
29108
- import { z as z98 } from "zod";
29109
- var sitemapEngineSchema = z98.enum(["google", "bing"]);
29246
+ import { z as z99 } from "zod";
29247
+ var sitemapEngineSchema = z99.enum(["google", "bing"]);
29110
29248
  var SitemapEngines = sitemapEngineSchema.enum;
29111
- var sitemapSourceSchema = z98.enum(["site", "google", "bing"]);
29112
- var sitemapStateSchema = z98.enum(["ok", "pending", "warnings", "errors", "other"]);
29249
+ var sitemapSourceSchema = z99.enum(["site", "google", "bing"]);
29250
+ var sitemapStateSchema = z99.enum(["ok", "pending", "warnings", "errors", "other"]);
29113
29251
  var SitemapStates = sitemapStateSchema.enum;
29114
- var engineSitemapDtoSchema = z98.object({
29115
- url: z98.string(),
29252
+ var engineSitemapDtoSchema = z99.object({
29253
+ url: z99.string(),
29116
29254
  /** The index this file was read from; null for a sitemap listed on its own. */
29117
- parentUrl: z98.string().nullable(),
29118
- isIndex: z98.boolean(),
29255
+ parentUrl: z99.string().nullable(),
29256
+ isIndex: z99.boolean(),
29119
29257
  /** The engine's own type word (Bing: `Sitemap`, `Sitemap Index`, `RSS`; Google: `sitemap`, `rssFeed`). */
29120
- type: z98.string().nullable(),
29258
+ type: z99.string().nullable(),
29121
29259
  state: sitemapStateSchema,
29122
29260
  /** The engine's status as it reads in its own console (Google: Success, Processing, Warnings, Errors; Bing's word as sent). */
29123
- statusLabel: z98.string(),
29124
- warnings: z98.number().int().nonnegative().nullable(),
29125
- errors: z98.number().int().nonnegative().nullable(),
29261
+ statusLabel: z99.string(),
29262
+ warnings: z99.number().int().nonnegative().nullable(),
29263
+ errors: z99.number().int().nonnegative().nullable(),
29126
29264
  /** URLs the engine counted in the sitemap; null when it reported none. */
29127
- urlCount: z98.number().int().nonnegative().nullable(),
29265
+ urlCount: z99.number().int().nonnegative().nullable(),
29128
29266
  /** Null when nobody submitted it: the engine found it itself. */
29129
- submittedAt: z98.string().nullable(),
29267
+ submittedAt: z99.string().nullable(),
29130
29268
  /** When the engine last read the file (Google: downloaded; Bing: crawled). */
29131
- lastReadAt: z98.string().nullable()
29269
+ lastReadAt: z99.string().nullable()
29132
29270
  });
29133
- var sitemapMissingDtoSchema = z98.object({
29134
- url: z98.string(),
29271
+ var sitemapMissingDtoSchema = z99.object({
29272
+ url: z99.string(),
29135
29273
  /** Where Canonry saw it: the site's own sitemaps, or a submission to the other engine. */
29136
- foundIn: z98.array(sitemapSourceSchema)
29274
+ foundIn: z99.array(sitemapSourceSchema)
29137
29275
  });
29138
- var engineSitemapsDtoSchema = z98.object({
29276
+ var engineSitemapsDtoSchema = z99.object({
29139
29277
  /** When this engine's list was last read in full. */
29140
- syncedAt: z98.string(),
29278
+ syncedAt: z99.string(),
29141
29279
  /** Every sitemap the engine lists, files inside an index included (`parentUrl`). */
29142
- sitemaps: z98.array(engineSitemapDtoSchema),
29280
+ sitemaps: z99.array(engineSitemapDtoSchema),
29143
29281
  /**
29144
29282
  * Sitemaps the site declares or someone submitted to the other engine that
29145
29283
  * this engine does not have, by URL. A file inside an index that is itself missing is left
@@ -29148,24 +29286,24 @@ var engineSitemapsDtoSchema = z98.object({
29148
29286
  * this engine already has every sitemap the site declares. Google lists only
29149
29287
  * sitemaps inside the connected property.
29150
29288
  */
29151
- missing: z98.array(sitemapMissingDtoSchema)
29289
+ missing: z99.array(sitemapMissingDtoSchema)
29152
29290
  });
29153
- var sitemapCoverageResponseDtoSchema = z98.object({
29154
- site: z98.object({
29291
+ var sitemapCoverageResponseDtoSchema = z99.object({
29292
+ site: z99.object({
29155
29293
  /** When the scan behind `sitemaps` ran; null before the first Agent Readiness audit scan. */
29156
- scannedAt: z98.string().nullable(),
29157
- runId: z98.string().nullable(),
29294
+ scannedAt: z99.string().nullable(),
29295
+ runId: z99.string().nullable(),
29158
29296
  /** Sitemap files the scan read pages from. An index appears through its files. */
29159
- sitemaps: z98.array(z98.string())
29297
+ sitemaps: z99.array(z99.string())
29160
29298
  }),
29161
29299
  /** Null when the engine is not connected or its list was never read. */
29162
29300
  google: engineSitemapsDtoSchema.nullable(),
29163
29301
  bing: engineSitemapsDtoSchema.nullable()
29164
29302
  });
29165
- var bingSubmitSitemapResponseDtoSchema = z98.object({
29166
- sitemapUrl: z98.string(),
29303
+ var bingSubmitSitemapResponseDtoSchema = z99.object({
29304
+ sitemapUrl: z99.string(),
29167
29305
  /** Bing accepted the request. It lists a new sitemap after it reads it, so it shows from the next sync. */
29168
- accepted: z98.literal(true)
29306
+ accepted: z99.literal(true)
29169
29307
  });
29170
29308
 
29171
29309
  export {
@@ -30057,6 +30195,14 @@ export {
30057
30195
  resultsExportDtoSchema,
30058
30196
  resultsClearRequestSchema,
30059
30197
  resultsClearResponseSchema,
30198
+ citedUrlHost,
30199
+ canonicalCitedUrl,
30200
+ CITATION_URL_CATEGORY_HINT,
30201
+ parseCitationUrlCategories,
30202
+ citationUrlSortSchema,
30203
+ CITATION_URLS_DEFAULT_LIMIT,
30204
+ CITATION_URLS_MAX_LIMIT,
30205
+ citationUrlsResponseSchema,
30060
30206
  AiReferralTrafficClasses,
30061
30207
  classifyAiReferralTrafficClass,
30062
30208
  aiReferralClassCounts,