@canonry/canonry 7.56.1 → 7.57.1

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 (129) hide show
  1. package/assets/agent-workspace/skills/canonry/references/google-business-profile.md +1 -1
  2. package/assets/assets/{AgentSetupPage-BkKw_in_.js → AgentSetupPage-C-kQupMX.js} +1 -1
  3. package/assets/assets/{AuditHistoryPanel-UtRnS-sh.js → AuditHistoryPanel-DvZk-ikR.js} +1 -1
  4. package/assets/assets/{BacklinksPage-DCSmuAOQ.js → BacklinksPage-TLB85t4y.js} +1 -1
  5. package/assets/assets/{HistoryPage-DzpqCNJM.js → HistoryPage-C4nHeKDs.js} +1 -1
  6. package/assets/assets/{MeasurementPropertyPage-Dh0BJw_f.js → MeasurementPropertyPage-8E17rN5d.js} +1 -1
  7. package/assets/assets/{ProjectPage-D-9IeFap.js → ProjectPage-B4SbAE_N.js} +1 -1
  8. package/assets/assets/{RunsPage-DtllYN3I.js → RunsPage-Enho1Wqz.js} +1 -1
  9. package/assets/assets/{SettingsPage-_p15s-OC.js → SettingsPage-BjLpSN4f.js} +1 -1
  10. package/assets/assets/{SiteHealthSection-BEpXTW3G.js → SiteHealthSection-BUOBO4VH.js} +2 -2
  11. package/assets/assets/ToneBadge-BLQKJIMR.js +60 -0
  12. package/assets/assets/{TrafficPage-wru6cQPP.js → TrafficPage-BtjRPsdl.js} +1 -1
  13. package/assets/assets/{TrafficSourceDetailPage-_XKbd-aS.js → TrafficSourceDetailPage-Bw-9JMOF.js} +1 -1
  14. package/assets/assets/{account-context-BekDho6K.js → account-context-bLel7cL8.js} +1 -1
  15. package/assets/assets/{card-By9JlCCv.js → card-DFlbarlV.js} +1 -1
  16. package/assets/assets/{extract-error-message-SMPhaAkr.js → extract-error-message-BYvs9oIt.js} +1 -1
  17. package/assets/assets/{format-helpers-CVjOUs0j.js → format-helpers-DPVlVrlp.js} +1 -1
  18. package/assets/assets/{index-el2M4tYf.js → index-DWP0Oz6d.js} +4 -4
  19. package/assets/assets/{query-client-8RITTP1A.js → query-client-DLuEpFRm.js} +1 -1
  20. package/assets/assets/{react-query-BXwc1UHc.js → react-query-BVY1CIRz.js} +1 -1
  21. package/assets/assets/{react-sigma_core.esm.min-CM12VcoB.js → react-sigma_core.esm.min-BaR2koVY.js} +1 -1
  22. package/assets/assets/{service-B0wkGxvy.js → service-DiBkOka7.js} +1 -1
  23. package/assets/index.html +7 -7
  24. package/dist/{ads-SPXNKDEW.js → ads-6PCFYPZ6.js} +3 -3
  25. package/dist/{agent-THPYOGXD.js → agent-UA3J23KG.js} +7 -7
  26. package/dist/{agent-ask-VHRA5RVU.js → agent-ask-D4RWVHZX.js} +3 -3
  27. package/dist/{agent-conversations-5HXXVMZV.js → agent-conversations-BSKUJF7H.js} +3 -3
  28. package/dist/{agent-memory-SKBUFHGV.js → agent-memory-ENPPLOV7.js} +3 -3
  29. package/dist/{agent-providers-TOIA75C6.js → agent-providers-5NV7YEVG.js} +3 -3
  30. package/dist/{agent-transcript-DFE2PDTS.js → agent-transcript-TXDTQ7Q2.js} +3 -3
  31. package/dist/{analytics-JJHPK2TK.js → analytics-6ITOJIGW.js} +3 -3
  32. package/dist/{apply-AC36NXPF.js → apply-EPQXYQRO.js} +3 -3
  33. package/dist/{backfill-73XI3CEL.js → backfill-WHQ5PRQY.js} +9 -9
  34. package/dist/{backlinks-EKSQJXMS.js → backlinks-ECIDQQ4I.js} +3 -3
  35. package/dist/{bing-XZQ6CQM4.js → bing-LHTVVJK7.js} +3 -3
  36. package/dist/{bootstrap-GJUT3AVH.js → bootstrap-KHYUCFLP.js} +10 -10
  37. package/dist/{cdp-QROXKBXS.js → cdp-YZWEKVRO.js} +7 -7
  38. package/dist/{chunk-AOBMI5UM.js → chunk-2R32P77U.js} +1 -1
  39. package/dist/{chunk-NZ6KZLTM.js → chunk-3HRHHFQM.js} +6 -1
  40. package/dist/{chunk-ADCVXKSD.js → chunk-522MYBLV.js} +1 -1
  41. package/dist/{chunk-37YB52NM.js → chunk-5AJWITKP.js} +45 -1
  42. package/dist/{chunk-SJLCALSV.js → chunk-5L2ZTXBH.js} +3 -3
  43. package/dist/{chunk-RELKG6XH.js → chunk-6MK426LA.js} +2 -2
  44. package/dist/{chunk-H4IJXVG5.js → chunk-72GHLLA5.js} +5 -5
  45. package/dist/{chunk-4J7PL5R2.js → chunk-AMN7DC25.js} +618 -282
  46. package/dist/{chunk-2Z7FALTN.js → chunk-BURMKOEF.js} +2 -2
  47. package/dist/{chunk-TPCXTUL5.js → chunk-E3YBETL6.js} +1 -1
  48. package/dist/{chunk-ZNAAZHNT.js → chunk-F7WRZW3A.js} +47 -3
  49. package/dist/{chunk-VRFTXW6H.js → chunk-FC2JA3FN.js} +3414 -2311
  50. package/dist/{chunk-DDM6PVXJ.js → chunk-GT7HWKBO.js} +3 -3
  51. package/dist/{chunk-UDF3A2O7.js → chunk-HFMRK3V3.js} +5 -5
  52. package/dist/{chunk-VZURJP3T.js → chunk-HPC3CBPI.js} +1 -1
  53. package/dist/{chunk-C5LD76KR.js → chunk-JWBFDZIP.js} +3 -3
  54. package/dist/{chunk-WRYVESRH.js → chunk-KRIZF753.js} +1 -1
  55. package/dist/{chunk-NSE55FZE.js → chunk-LCC5ZJPV.js} +2 -2
  56. package/dist/{chunk-F5DLOQ3B.js → chunk-MVUYDJ7G.js} +2 -2
  57. package/dist/{chunk-JZEK26CT.js → chunk-N6P3NLEI.js} +375 -325
  58. package/dist/{chunk-CFGQOIXW.js → chunk-OJ5IDPYY.js} +3 -3
  59. package/dist/{chunk-A3NZOK4X.js → chunk-RNDQREJC.js} +4 -4
  60. package/dist/{chunk-Q5ZRUA57.js → chunk-S2UDQAT7.js} +1 -1
  61. package/dist/{chunk-UJRPQOKE.js → chunk-SLN2KNEE.js} +8 -8
  62. package/dist/{chunk-V4V7WOHY.js → chunk-SOKD3TRA.js} +46 -2
  63. package/dist/{chunk-QAGZQ2DY.js → chunk-TIKT62IV.js} +1749 -1634
  64. package/dist/{chunk-SVLNIJS2.js → chunk-TIYL4KVS.js} +1 -1
  65. package/dist/{chunk-P2OVWQKT.js → chunk-TXBL3N46.js} +1 -1
  66. package/dist/{chunk-W5FAL4LJ.js → chunk-ULFDCKIC.js} +4 -4
  67. package/dist/{chunk-ZOVL5NAP.js → chunk-VF36TGF4.js} +1 -1
  68. package/dist/{chunk-TJJLANDV.js → chunk-W7EX6AYN.js} +4 -4
  69. package/dist/{chunk-4QRF7TNW.js → chunk-XXYBDAS2.js} +2 -2
  70. package/dist/{chunk-PUTJ6LPE.js → chunk-YFUQHJRZ.js} +1 -1
  71. package/dist/{chunk-RCCZ6VGK.js → chunk-ZUAXF73A.js} +1 -1
  72. package/dist/{citations-5ARZ6M42.js → citations-HXVWVRDO.js} +3 -3
  73. package/dist/{cli-catalog-XD7VY3ES.js → cli-catalog-EDAH3242.js} +3 -3
  74. package/dist/{cli-commands-FWCI6VIN.js → cli-commands-5O54JBVV.js} +7 -7
  75. package/dist/cli.js +13 -13
  76. package/dist/{competitor-XWTEIVZL.js → competitor-XYPBUM4Q.js} +3 -3
  77. package/dist/{content-4EVGV32G.js → content-SDTRO2XT.js} +3 -3
  78. package/dist/{dashboard-QZXKGD6T.js → dashboard-TERSQLOV.js} +6 -6
  79. package/dist/{demo-3DMRH7BC.js → demo-UT5Y2RFF.js} +1 -1
  80. package/dist/{demo-server-TU3BW763.js → demo-server-5D6QLZOA.js} +11 -11
  81. package/dist/{discover-VQYJ4UOL.js → discover-I6AQJPUK.js} +3 -3
  82. package/dist/{discover-eval-FMEMPSM3.js → discover-eval-GLGBZC7B.js} +3 -3
  83. package/dist/{doctor-VYES5HCM.js → doctor-Q47J7GZI.js} +3 -3
  84. package/dist/{evidence-BG45EBS3.js → evidence-AMLTPRHA.js} +3 -3
  85. package/dist/{export-cmd-PQZCMR7C.js → export-cmd-NTCX43DE.js} +3 -3
  86. package/dist/{ga-ZQL2LHQA.js → ga-END6LQJW.js} +3 -3
  87. package/dist/{gbp-KNWDBHFM.js → gbp-CVJXSTTB.js} +33 -4
  88. package/dist/{google-GOKE6J5E.js → google-4OCFGWGV.js} +4 -4
  89. package/dist/{google-marketing-7DYEKRHS.js → google-marketing-NW27PADK.js} +1 -1
  90. package/dist/{health-cmd-4OZ7EYWI.js → health-cmd-2KMNASB3.js} +3 -3
  91. package/dist/{history-U2W77DIY.js → history-6LBFXVKF.js} +3 -3
  92. package/dist/index.d.ts +311 -5
  93. package/dist/index.js +24 -24
  94. package/dist/{init-LEGXLKPA.js → init-ONIDATRC.js} +11 -11
  95. package/dist/{insights-LWMDBEYC.js → insights-YH7NP5LX.js} +3 -3
  96. package/dist/intelligence-service-KRIDKJH2.js +15 -0
  97. package/dist/{keys-RSKVNMJI.js → keys-CJ5DTL4Y.js} +3 -3
  98. package/dist/{keyword-IM4GUM5U.js → keyword-7FMLF3B7.js} +3 -3
  99. package/dist/{logs-B35V2RPE.js → logs-362Y2Z55.js} +3 -3
  100. package/dist/{mcp-UFMKQFGP.js → mcp-RTJ3HZLY.js} +2 -2
  101. package/dist/mcp.js +9 -9
  102. package/dist/{measurement-plan-BOHLLJD5.js → measurement-plan-ICT6U62D.js} +5 -5
  103. package/dist/{notify-RQIQP5ZF.js → notify-HT7QBF3B.js} +3 -3
  104. package/dist/{organic-evidence-C3OZR7UY.js → organic-evidence-CAGEQ5OR.js} +3 -3
  105. package/dist/{overview-OVIPKMAY.js → overview-Y6RVRPC7.js} +4 -4
  106. package/dist/{project-QBUTYR6J.js → project-7OBPDHLH.js} +3 -3
  107. package/dist/{query-KCGET5FS.js → query-23GN3BC6.js} +3 -3
  108. package/dist/{research-HTURJWRL.js → research-N7EVBN47.js} +3 -3
  109. package/dist/{results-export-GJNXEXV4.js → results-export-BHEYAZXQ.js} +3 -3
  110. package/dist/{run-ZNTT7W5M.js → run-KVPMLHGQ.js} +4 -4
  111. package/dist/{schedule-S2ODDXFB.js → schedule-EZ2TLM22.js} +3 -3
  112. package/dist/{search-UW56VG5B.js → search-UHUPUGT3.js} +3 -3
  113. package/dist/{serve-UMF32HVA.js → serve-VG52MHRC.js} +25 -25
  114. package/dist/{session-GEJOH3FN.js → session-IQKGJYKH.js} +12 -12
  115. package/dist/{settings-TGSORPVW.js → settings-QCFPNHSC.js} +3 -3
  116. package/dist/{skills-SBZZLY4T.js → skills-FXPAKCVV.js} +2 -2
  117. package/dist/{snapshot-OMS33CN4.js → snapshot-NY5PNDWR.js} +3 -3
  118. package/dist/{src-LKNW35M6.js → src-V6W5XBAI.js} +4 -2
  119. package/dist/{status-7D7NUW7M.js → status-MYXAVPIB.js} +4 -4
  120. package/dist/{technical-aeo-UFDHAV7G.js → technical-aeo-4C2EQ6C5.js} +3 -3
  121. package/dist/{telemetry-ZPVJITHJ.js → telemetry-SMY4NDD2.js} +4 -4
  122. package/dist/{tools-EJ5AHYFS.js → tools-KKSEFA25.js} +11 -11
  123. package/dist/{traffic-T6YAKUY5.js → traffic-QTHEOB5M.js} +5 -5
  124. package/dist/{users-6N2YMWAP.js → users-FDZPHCWI.js} +3 -3
  125. package/dist/{visibility-stats-GODBRQVG.js → visibility-stats-6B3S3AIY.js} +3 -3
  126. package/dist/{wordpress-ISFI67TH.js → wordpress-5IIA4H3G.js} +3 -3
  127. package/package.json +1 -1
  128. package/assets/assets/ToneBadge-nxe12_3b.js +0 -60
  129. package/dist/intelligence-service-3JS4X4Y4.js +0 -15
@@ -304,6 +304,24 @@ var notificationCreateRequestSchema = z4.object({
304
304
  events: z4.array(notificationEventSchema).min(1),
305
305
  source: z4.string().optional()
306
306
  });
307
+ var ReviewDeliveryStates = Object.freeze({
308
+ Pending: "pending",
309
+ Attempting: "attempting",
310
+ Sent: "sent",
311
+ Uncertain: "uncertain",
312
+ Failed: "failed",
313
+ Canceled: "canceled"
314
+ });
315
+ function googleBusinessReviewUrl(value) {
316
+ try {
317
+ if (!value) return null;
318
+ const url = new URL(value);
319
+ const providerPath = ["www.google.com", "google.com"].includes(url.hostname) && url.pathname.startsWith("/maps") || url.hostname === "maps.google.com" || url.hostname === "local.google.com" && url.pathname === "/place";
320
+ return url.protocol === "https:" && !url.username && !url.password && !url.port && providerPath ? url.href : null;
321
+ } catch {
322
+ return null;
323
+ }
324
+ }
307
325
 
308
326
  // ../contracts/src/errors.ts
309
327
  var AppError = class extends Error {
@@ -13090,6 +13108,9 @@ var LIVE_READ_OPERATIONS = /* @__PURE__ */ new Set([
13090
13108
  "GET /api/v1/projects/{name}/google/properties",
13091
13109
  "GET /api/v1/projects/{name}/google/gsc/sitemaps",
13092
13110
  "GET /api/v1/projects/{name}/gbp/accounts",
13111
+ "GET /api/v1/projects/{name}/gbp/local-posts",
13112
+ "GET /api/v1/projects/{name}/gbp/local-post",
13113
+ "GET /api/v1/projects/{name}/gbp/reviews/live",
13093
13114
  "GET /api/v1/projects/{name}/ga/properties",
13094
13115
  "GET /api/v1/projects/{name}/bing/sites",
13095
13116
  // Performance reads query Bing directly rather than the local snapshot.
@@ -13139,6 +13160,7 @@ var WRITE_OPERATIONS = /* @__PURE__ */ new Set([
13139
13160
  "GET /api/v1/projects/{name}/bing/coverage"
13140
13161
  ]);
13141
13162
  var STORED_READ_OPERATIONS = /* @__PURE__ */ new Set([
13163
+ "GET /api/v1/projects/{name}/gbp/local-post-attempt",
13142
13164
  "GET /api/v1/openapi.json",
13143
13165
  "GET /api/v1/screenshots/{snapshotId}",
13144
13166
  "GET /api/v1/projects/{name}/technical-aeo/runs/{runId}/page-health-preview",
@@ -18187,14 +18209,14 @@ function median(values) {
18187
18209
  const middle = Math.floor(sorted.length / 2);
18188
18210
  return sorted.length % 2 === 1 ? sorted[middle] : (sorted[middle - 1] + sorted[middle]) / 2;
18189
18211
  }
18190
- function wilsonInterval(successes, n, z89 = 1.96) {
18212
+ function wilsonInterval(successes, n, z90 = 1.96) {
18191
18213
  if (!Number.isFinite(n) || n <= 0) return null;
18192
18214
  const s = Math.max(0, Math.min(successes, n));
18193
18215
  const p = s / n;
18194
- const z210 = z89 * z89;
18216
+ const z210 = z90 * z90;
18195
18217
  const denom = 1 + z210 / n;
18196
18218
  const center = (p + z210 / (2 * n)) / denom;
18197
- const margin = z89 / denom * Math.sqrt(p * (1 - p) / n + z210 / (4 * n * n));
18219
+ const margin = z90 / denom * Math.sqrt(p * (1 - p) / n + z210 / (4 * n * n));
18198
18220
  return {
18199
18221
  low: round(Math.max(0, center - margin)),
18200
18222
  high: round(Math.min(1, center + margin))
@@ -20089,6 +20111,85 @@ function formatMicros(micros, currencyCode = "USD", options = {}) {
20089
20111
  return formatted;
20090
20112
  }
20091
20113
 
20114
+ // ../contracts/src/gbp-local-posts.ts
20115
+ import { z as z59 } from "zod";
20116
+ var GBP_POSTS_WRITE_SCOPE = "gbp.posts.write";
20117
+ var GBP_LIVE_READ_SCOPE = "gbp.read";
20118
+ var gbpAccountNameSchema = z59.string().regex(/^accounts\/[1-9]\d{0,29}$/u);
20119
+ var gbpLocationNameSchema = z59.string().regex(/^locations\/[1-9]\d{0,29}$/u);
20120
+ var gbpLocalPostNameSchema = z59.string().regex(
20121
+ /^accounts\/[1-9]\d{0,29}\/locations\/[1-9]\d{0,29}\/localPosts\/[\w-]{1,200}$/u
20122
+ );
20123
+ var publicUrl = z59.url().refine((value) => {
20124
+ const url = new URL(value);
20125
+ return url.protocol === "https:" && !url.username && !url.password && !url.hash;
20126
+ }, "An HTTPS URL without credentials or fragment is required");
20127
+ var gbpLocalPostStateSchema = z59.enum([
20128
+ "LIVE",
20129
+ "PROCESSING",
20130
+ "REJECTED",
20131
+ "SCHEDULED",
20132
+ "RECURRING",
20133
+ "LOCAL_POST_STATE_UNSPECIFIED"
20134
+ ]);
20135
+ var GbpLocalPostStates = Object.freeze(gbpLocalPostStateSchema.enum);
20136
+ var gbpLocalPostContentSchema = z59.object({
20137
+ languageCode: z59.string().regex(/^[a-z]{2}(?:-[A-Z]{2})?$/u),
20138
+ summary: z59.string().trim().min(1).max(1500).refine((value) => !/[\p{Cc}\p{Cf}]/u.test(value.replace(/\n/gu, ""))),
20139
+ topicType: z59.literal("STANDARD"),
20140
+ callToAction: z59.object({ actionType: z59.literal("LEARN_MORE"), url: publicUrl }).strict(),
20141
+ media: z59.tuple([
20142
+ z59.object({ mediaFormat: z59.literal("PHOTO"), sourceUrl: publicUrl }).strict()
20143
+ ])
20144
+ }).strict();
20145
+ var gbpLocalPostDtoSchema = z59.object({
20146
+ name: gbpLocalPostNameSchema,
20147
+ languageCode: z59.string(),
20148
+ summary: z59.string(),
20149
+ topicType: z59.string(),
20150
+ state: gbpLocalPostStateSchema,
20151
+ actionType: z59.string().nullable(),
20152
+ articleUrl: z59.string().nullable(),
20153
+ imageUrls: z59.array(z59.string()),
20154
+ createTime: z59.string().datetime({ offset: true }),
20155
+ updateTime: z59.string().datetime({ offset: true }),
20156
+ searchUrl: z59.string().nullable()
20157
+ });
20158
+ var gbpLocalPostListSchema = z59.object({
20159
+ posts: z59.array(gbpLocalPostDtoSchema),
20160
+ nextPageToken: z59.string().nullable()
20161
+ });
20162
+ var gbpLocalPostCreateSchema = z59.object({
20163
+ accountName: gbpAccountNameSchema,
20164
+ locationName: gbpLocationNameSchema,
20165
+ attemptId: z59.string().uuid(),
20166
+ packageId: z59.string().regex(/^[a-f0-9]{64}$/u),
20167
+ content: gbpLocalPostContentSchema
20168
+ }).strict();
20169
+ var gbpLocalPostAttemptSchema = z59.object({
20170
+ attemptId: z59.string().uuid(),
20171
+ packageId: z59.string().regex(/^[a-f0-9]{64}$/u),
20172
+ status: z59.enum(["accepted", "uncertain", "rejected"]),
20173
+ post: gbpLocalPostDtoSchema.nullable()
20174
+ });
20175
+ var gbpLiveReviewsSchema = z59.object({
20176
+ accountName: gbpAccountNameSchema,
20177
+ locationName: gbpLocationNameSchema,
20178
+ profileUrl: publicUrl.nullable(),
20179
+ checkedAt: z59.string().datetime(),
20180
+ complete: z59.literal(true),
20181
+ reviews: z59.array(
20182
+ z59.object({
20183
+ reviewName: z59.string(),
20184
+ starRating: z59.number().int().min(1).max(5).nullable(),
20185
+ comment: z59.string().nullable(),
20186
+ reviewerName: z59.string().nullable(),
20187
+ createTime: z59.string().nullable(),
20188
+ updateTime: z59.string()
20189
+ })
20190
+ )
20191
+ });
20192
+
20092
20193
  // ../contracts/src/scopes.ts
20093
20194
  var READ_ONLY_SCOPE = "read";
20094
20195
  var WILDCARD_SCOPE = "*";
@@ -20104,7 +20205,7 @@ function grantsWrite(scope) {
20104
20205
  }
20105
20206
  function restrictedWriteScopes(scopes) {
20106
20207
  const writes = scopes.filter(grantsWrite);
20107
- const restricted = /* @__PURE__ */ new Set([ADS_WRITE_SCOPE, ADS_APPROVE_SCOPE, ADS_ACTIVATE_SCOPE, RESEARCH_RUN_SCOPE]);
20208
+ const restricted = /* @__PURE__ */ new Set([ADS_WRITE_SCOPE, ADS_APPROVE_SCOPE, ADS_ACTIVATE_SCOPE, RESEARCH_RUN_SCOPE, GBP_POSTS_WRITE_SCOPE]);
20108
20209
  return writes.length > 0 && writes.every((scope) => restricted.has(scope)) ? writes : null;
20109
20210
  }
20110
20211
  function intersectScopes(authority, requested) {
@@ -20116,8 +20217,8 @@ function isReadOnlyKey(scopes) {
20116
20217
  }
20117
20218
 
20118
20219
  // ../contracts/src/telemetry.ts
20119
- import { z as z59 } from "zod";
20120
- var telemetryEffectiveReasonSchema = z59.enum([
20220
+ import { z as z60 } from "zod";
20221
+ var telemetryEffectiveReasonSchema = z60.enum([
20121
20222
  "enabled",
20122
20223
  "configured_disabled",
20123
20224
  "CANONRY_TELEMETRY_DISABLED",
@@ -20126,12 +20227,12 @@ var telemetryEffectiveReasonSchema = z59.enum([
20126
20227
  "NO_CONFIG",
20127
20228
  "CONFIG_UNAVAILABLE"
20128
20229
  ]);
20129
- var telemetryTargetSchema = z59.enum(["server", "local"]);
20130
- var telemetryStatusDtoSchema = z59.object({
20131
- enabled: z59.boolean(),
20132
- configuredEnabled: z59.boolean(),
20230
+ var telemetryTargetSchema = z60.enum(["server", "local"]);
20231
+ var telemetryStatusDtoSchema = z60.object({
20232
+ enabled: z60.boolean(),
20233
+ configuredEnabled: z60.boolean(),
20133
20234
  reason: telemetryEffectiveReasonSchema,
20134
- anonymousId: z59.string().regex(/^[0-9a-f]{8}\.\.\.$/i).optional(),
20235
+ anonymousId: z60.string().regex(/^[0-9a-f]{8}\.\.\.$/i).optional(),
20135
20236
  target: telemetryTargetSchema.optional()
20136
20237
  }).strict();
20137
20238
  function normalizeTelemetryStatus(status, target = "server") {
@@ -20151,7 +20252,7 @@ function maskTelemetryAnonymousId(value) {
20151
20252
  return /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(value) ? `${value.slice(0, 8)}...` : void 0;
20152
20253
  }
20153
20254
  var ONBOARDING_FLOW_VERSION = 1;
20154
- var onboardingStepSchema = z59.enum([
20255
+ var onboardingStepSchema = z60.enum([
20155
20256
  "system",
20156
20257
  "project",
20157
20258
  "queries",
@@ -20162,7 +20263,7 @@ var onboardingStepSchema = z59.enum([
20162
20263
  // silently drops unknown ones, while step is an open property there.
20163
20264
  "finish"
20164
20265
  ]);
20165
- var onboardingNextActionSchema = z59.enum([
20266
+ var onboardingNextActionSchema = z60.enum([
20166
20267
  "copy_agent_command",
20167
20268
  "connect_server_traffic",
20168
20269
  "connect_search_console",
@@ -20173,7 +20274,7 @@ var onboardingNextActionSchema = z59.enum([
20173
20274
  "open_project",
20174
20275
  "review_page_health"
20175
20276
  ]);
20176
- var onboardingCountBucketSchema = z59.enum([
20277
+ var onboardingCountBucketSchema = z60.enum([
20177
20278
  "0",
20178
20279
  "1",
20179
20280
  "2-3",
@@ -20189,7 +20290,7 @@ function bucketOnboardingCount(value) {
20189
20290
  if (value < 11) return "6-10";
20190
20291
  return "11+";
20191
20292
  }
20192
- var onboardingBlockReasonSchema = z59.enum([
20293
+ var onboardingBlockReasonSchema = z60.enum([
20193
20294
  "api_unavailable",
20194
20295
  "database_unavailable",
20195
20296
  "worker_unavailable",
@@ -20209,41 +20310,41 @@ var onboardingBlockReasonSchema = z59.enum([
20209
20310
  "network",
20210
20311
  "unknown"
20211
20312
  ]);
20212
- var onboardingSurfaceSchema = z59.enum([
20313
+ var onboardingSurfaceSchema = z60.enum([
20213
20314
  "wizard",
20214
20315
  "platform",
20215
20316
  "site_health"
20216
20317
  ]);
20217
- var onboardingEventBaseSchema = z59.object({
20218
- eventId: z59.string().uuid(),
20219
- flowVersion: z59.literal(ONBOARDING_FLOW_VERSION),
20220
- onboardingSessionId: z59.string().uuid(),
20318
+ var onboardingEventBaseSchema = z60.object({
20319
+ eventId: z60.string().uuid(),
20320
+ flowVersion: z60.literal(ONBOARDING_FLOW_VERSION),
20321
+ onboardingSessionId: z60.string().uuid(),
20221
20322
  surface: onboardingSurfaceSchema.optional()
20222
20323
  });
20223
- var onboardingTelemetryEventSchema = z59.discriminatedUnion("event", [
20324
+ var onboardingTelemetryEventSchema = z60.discriminatedUnion("event", [
20224
20325
  onboardingEventBaseSchema.extend({
20225
- event: z59.literal("onboarding.started"),
20326
+ event: z60.literal("onboarding.started"),
20226
20327
  step: onboardingStepSchema,
20227
- resumed: z59.boolean()
20328
+ resumed: z60.boolean()
20228
20329
  }).strict(),
20229
20330
  onboardingEventBaseSchema.extend({
20230
- event: z59.literal("onboarding.step_completed"),
20331
+ event: z60.literal("onboarding.step_completed"),
20231
20332
  step: onboardingStepSchema,
20232
- method: z59.enum(["existing", "inline", "manual", "generated", "skipped", "automatic"]),
20333
+ method: z60.enum(["existing", "inline", "manual", "generated", "skipped", "automatic"]),
20233
20334
  countBucket: onboardingCountBucketSchema.optional(),
20234
20335
  /** Set only with `step: 'finish'`: the next action the operator chose. */
20235
20336
  nextAction: onboardingNextActionSchema.optional()
20236
20337
  }).strict(),
20237
20338
  onboardingEventBaseSchema.extend({
20238
- event: z59.literal("onboarding.blocked"),
20339
+ event: z60.literal("onboarding.blocked"),
20239
20340
  step: onboardingStepSchema,
20240
- action: z59.enum(["continue", "configure_provider", "generate_queries", "save", "launch_run", "retry_run"]),
20341
+ action: z60.enum(["continue", "configure_provider", "generate_queries", "save", "launch_run", "retry_run"]),
20241
20342
  reasonCode: onboardingBlockReasonSchema
20242
20343
  }).strict(),
20243
20344
  onboardingEventBaseSchema.extend({
20244
- event: z59.literal("run.requested"),
20245
- origin: z59.literal("dashboard_setup"),
20246
- result: z59.enum(["queued", "rejected"]),
20345
+ event: z60.literal("run.requested"),
20346
+ origin: z60.literal("dashboard_setup"),
20347
+ result: z60.enum(["queued", "rejected"]),
20247
20348
  /**
20248
20349
  * What kind of run was asked for. A site-health crawl has no providers and
20249
20350
  * no tracked queries, so its buckets are legitimately `0`; without this
@@ -20252,7 +20353,7 @@ var onboardingTelemetryEventSchema = z59.discriminatedUnion("event", [
20252
20353
  * `surface`: a documented fallback that nothing applies becomes a null
20253
20354
  * bucket downstream.
20254
20355
  */
20255
- kind: z59.enum(["answer_visibility", "site_health"]).optional(),
20356
+ kind: z60.enum(["answer_visibility", "site_health"]).optional(),
20256
20357
  providerCountBucket: onboardingCountBucketSchema,
20257
20358
  queryCountBucket: onboardingCountBucketSchema,
20258
20359
  reasonCode: onboardingBlockReasonSchema.optional()
@@ -20262,8 +20363,8 @@ function normalizeOnboardingEventForCollection(event) {
20262
20363
  const surfaced = { ...event, surface: event.surface ?? "wizard" };
20263
20364
  return surfaced.event === "run.requested" ? { ...surfaced, kind: surfaced.kind ?? "answer_visibility" } : surfaced;
20264
20365
  }
20265
- var telemetryEventAcceptedDtoSchema = z59.object({
20266
- accepted: z59.boolean()
20366
+ var telemetryEventAcceptedDtoSchema = z60.object({
20367
+ accepted: z60.boolean()
20267
20368
  });
20268
20369
  var GHOST_TELEMETRY_TEST_LOCATIONS = /* @__PURE__ */ new Set(["nyc", "lax", "chi"]);
20269
20370
  function isGhostTelemetryEvent(eventName, properties) {
@@ -20273,7 +20374,7 @@ function isGhostTelemetryEvent(eventName, properties) {
20273
20374
  const location = typeof properties.location === "string" ? properties.location.trim().toLowerCase() : "";
20274
20375
  return GHOST_TELEMETRY_TEST_LOCATIONS.has(location);
20275
20376
  }
20276
- var usageSurfaceSchema = z59.enum(["cli", "mcp-stdio", "mcp-http", "aero", "api", "dashboard"]);
20377
+ var usageSurfaceSchema = z60.enum(["cli", "mcp-stdio", "mcp-http", "aero", "api", "dashboard"]);
20277
20378
  var USAGE_TELEMETRY_HEADERS = {
20278
20379
  surface: "x-canonry-surface",
20279
20380
  agent: "x-canonry-agent",
@@ -20318,125 +20419,125 @@ function detectAgentRuntime(env) {
20318
20419
  }
20319
20420
 
20320
20421
  // ../contracts/src/operational-logs.ts
20321
- import { z as z60 } from "zod";
20322
- var operationalLogLevelSchema = z60.enum(["trace", "debug", "info", "warn", "error", "fatal"]);
20323
- var diagnosticContextSchema = z60.object({
20324
- runId: z60.string().min(1).max(256).optional(),
20325
- projectId: z60.string().min(1).max(256).optional(),
20326
- requestId: z60.string().min(1).max(256).optional(),
20327
- actor: z60.string().min(1).max(512).optional(),
20328
- credentialId: z60.string().min(1).max(512).optional(),
20329
- userAgent: z60.string().min(1).max(512).optional(),
20330
- actorSession: z60.string().min(1).max(512).optional(),
20331
- method: z60.string().min(1).max(16).optional(),
20332
- route: z60.string().min(1).max(256).optional(),
20333
- operationId: z60.string().min(1).max(256).optional(),
20334
- jobId: z60.string().min(1).max(256).optional(),
20335
- taskId: z60.string().min(1).max(256).optional(),
20336
- traceId: z60.string().min(1).max(256).optional(),
20337
- provider: z60.string().min(1).max(256).optional(),
20338
- errorCode: z60.string().min(1).max(128).optional(),
20339
- attempt: z60.number().finite().optional(),
20340
- count: z60.number().finite().optional(),
20341
- total: z60.number().finite().optional(),
20342
- progress: z60.number().finite().optional(),
20343
- httpStatus: z60.number().finite().optional(),
20344
- statusCode: z60.number().finite().optional(),
20345
- durationMs: z60.number().finite().optional(),
20346
- bytes: z60.number().finite().optional(),
20347
- retryAfterMs: z60.number().finite().optional(),
20348
- retriable: z60.boolean().optional(),
20349
- retrying: z60.boolean().optional(),
20350
- cancelled: z60.boolean().optional(),
20351
- success: z60.boolean().optional()
20352
- }).strict();
20353
- var operationalLogEntryDtoSchema = z60.object({
20354
- cursor: z60.string().min(1).max(512),
20355
- ts: z60.string().datetime(),
20422
+ import { z as z61 } from "zod";
20423
+ var operationalLogLevelSchema = z61.enum(["trace", "debug", "info", "warn", "error", "fatal"]);
20424
+ var diagnosticContextSchema = z61.object({
20425
+ runId: z61.string().min(1).max(256).optional(),
20426
+ projectId: z61.string().min(1).max(256).optional(),
20427
+ requestId: z61.string().min(1).max(256).optional(),
20428
+ actor: z61.string().min(1).max(512).optional(),
20429
+ credentialId: z61.string().min(1).max(512).optional(),
20430
+ userAgent: z61.string().min(1).max(512).optional(),
20431
+ actorSession: z61.string().min(1).max(512).optional(),
20432
+ method: z61.string().min(1).max(16).optional(),
20433
+ route: z61.string().min(1).max(256).optional(),
20434
+ operationId: z61.string().min(1).max(256).optional(),
20435
+ jobId: z61.string().min(1).max(256).optional(),
20436
+ taskId: z61.string().min(1).max(256).optional(),
20437
+ traceId: z61.string().min(1).max(256).optional(),
20438
+ provider: z61.string().min(1).max(256).optional(),
20439
+ errorCode: z61.string().min(1).max(128).optional(),
20440
+ attempt: z61.number().finite().optional(),
20441
+ count: z61.number().finite().optional(),
20442
+ total: z61.number().finite().optional(),
20443
+ progress: z61.number().finite().optional(),
20444
+ httpStatus: z61.number().finite().optional(),
20445
+ statusCode: z61.number().finite().optional(),
20446
+ durationMs: z61.number().finite().optional(),
20447
+ bytes: z61.number().finite().optional(),
20448
+ retryAfterMs: z61.number().finite().optional(),
20449
+ retriable: z61.boolean().optional(),
20450
+ retrying: z61.boolean().optional(),
20451
+ cancelled: z61.boolean().optional(),
20452
+ success: z61.boolean().optional()
20453
+ }).strict();
20454
+ var operationalLogEntryDtoSchema = z61.object({
20455
+ cursor: z61.string().min(1).max(512),
20456
+ ts: z61.string().datetime(),
20356
20457
  level: operationalLogLevelSchema,
20357
- module: z60.string().min(1).max(256),
20358
- action: z60.string().min(1).max(256),
20359
- message: z60.string().max(4096).optional(),
20360
- runId: z60.string().min(1).max(256).optional(),
20361
- projectId: z60.string().min(1).max(256).optional(),
20458
+ module: z61.string().min(1).max(256),
20459
+ action: z61.string().min(1).max(256),
20460
+ message: z61.string().max(4096).optional(),
20461
+ runId: z61.string().min(1).max(256).optional(),
20462
+ projectId: z61.string().min(1).max(256).optional(),
20362
20463
  context: diagnosticContextSchema
20363
20464
  }).strict();
20364
- var logQuerySchema = z60.object({
20465
+ var logQuerySchema = z61.object({
20365
20466
  level: operationalLogLevelSchema.optional(),
20366
- module: z60.string().trim().min(1).max(256).optional(),
20367
- runId: z60.string().trim().min(1).max(256).optional(),
20368
- projectId: z60.string().trim().min(1).max(256).optional(),
20369
- actor: z60.string().trim().min(1).max(512).optional(),
20370
- requestId: z60.string().trim().min(1).max(256).optional(),
20371
- since: z60.string().datetime().optional(),
20372
- until: z60.string().datetime().optional(),
20373
- limit: z60.coerce.number().int().min(1).max(200).default(100),
20374
- cursor: z60.string().trim().min(1).max(512).optional()
20467
+ module: z61.string().trim().min(1).max(256).optional(),
20468
+ runId: z61.string().trim().min(1).max(256).optional(),
20469
+ projectId: z61.string().trim().min(1).max(256).optional(),
20470
+ actor: z61.string().trim().min(1).max(512).optional(),
20471
+ requestId: z61.string().trim().min(1).max(256).optional(),
20472
+ since: z61.string().datetime().optional(),
20473
+ until: z61.string().datetime().optional(),
20474
+ limit: z61.coerce.number().int().min(1).max(200).default(100),
20475
+ cursor: z61.string().trim().min(1).max(512).optional()
20375
20476
  }).strict().superRefine((query, ctx) => {
20376
20477
  if (query.since && query.until && Date.parse(query.since) > Date.parse(query.until)) {
20377
- ctx.addIssue({ code: z60.ZodIssueCode.custom, path: ["until"], message: '"until" must be on or after "since".' });
20478
+ ctx.addIssue({ code: z61.ZodIssueCode.custom, path: ["until"], message: '"until" must be on or after "since".' });
20378
20479
  }
20379
20480
  });
20380
- var retentionPolicySchema = z60.object({
20381
- maxEntries: z60.number().int().positive(),
20382
- maxAgeSeconds: z60.number().int().positive()
20481
+ var retentionPolicySchema = z61.object({
20482
+ maxEntries: z61.number().int().positive(),
20483
+ maxAgeSeconds: z61.number().int().positive()
20383
20484
  }).strict();
20384
- var operationalLogListDtoSchema = z60.object({
20385
- entries: z60.array(operationalLogEntryDtoSchema),
20386
- nextCursor: z60.string().min(1).max(512).nullable(),
20485
+ var operationalLogListDtoSchema = z61.object({
20486
+ entries: z61.array(operationalLogEntryDtoSchema),
20487
+ nextCursor: z61.string().min(1).max(512).nullable(),
20387
20488
  /** Matching entries left after this page. */
20388
- truncated: z60.number().int().nonnegative(),
20489
+ truncated: z61.number().int().nonnegative(),
20389
20490
  /** Entries evicted by the active retention policy. */
20390
- dropped: z60.number().int().nonnegative(),
20391
- retention: z60.enum(["process", "durable"]),
20491
+ dropped: z61.number().int().nonnegative(),
20492
+ retention: z61.enum(["process", "durable"]),
20392
20493
  retentionPolicy: retentionPolicySchema.optional(),
20393
20494
  /** Best-effort persistence failures observed by this store. */
20394
- captureErrors: z60.number().int().nonnegative().optional(),
20395
- observedAt: z60.string().datetime()
20495
+ captureErrors: z61.number().int().nonnegative().optional(),
20496
+ observedAt: z61.string().datetime()
20396
20497
  }).strict();
20397
20498
  var OPERATIONAL_LOG_FIELDS_HEADER = "x-canonry-log-fields";
20398
20499
  var OPERATIONAL_LOG_OPT_IN_CONTEXT_FIELDS = ["provider"];
20399
- var diagnosticContextReadSchema = z60.object(diagnosticContextSchema.shape);
20400
- var operationalLogEntryReadSchema = z60.object({ ...operationalLogEntryDtoSchema.shape, context: diagnosticContextReadSchema });
20401
- var operationalLogListReadSchema = z60.object({
20500
+ var diagnosticContextReadSchema = z61.object(diagnosticContextSchema.shape);
20501
+ var operationalLogEntryReadSchema = z61.object({ ...operationalLogEntryDtoSchema.shape, context: diagnosticContextReadSchema });
20502
+ var operationalLogListReadSchema = z61.object({
20402
20503
  ...operationalLogListDtoSchema.shape,
20403
- entries: z60.array(operationalLogEntryReadSchema),
20404
- retentionPolicy: z60.object(retentionPolicySchema.shape).optional()
20504
+ entries: z61.array(operationalLogEntryReadSchema),
20505
+ retentionPolicy: z61.object(retentionPolicySchema.shape).optional()
20405
20506
  });
20406
20507
 
20407
20508
  // ../contracts/src/referral-assessment.ts
20408
- import { z as z61 } from "zod";
20409
- var referralAssessmentQuerySchema = z61.object({
20509
+ import { z as z62 } from "zod";
20510
+ var referralAssessmentQuerySchema = z62.object({
20410
20511
  startDate: calendarDateSchema,
20411
20512
  endDate: calendarDateSchema,
20412
- sourceId: z61.string().trim().min(1).optional(),
20413
- burstThreshold: z61.number().int().min(1).max(1e6).optional(),
20414
- ratioThreshold: z61.number().min(1).max(1e3).optional(),
20415
- limit: z61.number().int().min(1).max(500).optional()
20416
- }).strict();
20417
- var countsSchema = z61.object({
20418
- total: z61.number().int().nonnegative(),
20419
- paid: z61.number().int().nonnegative(),
20420
- organic: z61.number().int().nonnegative(),
20421
- unknown: z61.number().int().nonnegative()
20422
- });
20423
- var referralAssessmentSchema = z61.object({
20424
- scope: z61.object({
20425
- project: z61.string(),
20426
- sourceId: z61.string().nullable(),
20427
- attribution: z61.literal("project-source-only"),
20428
- unavailableDimensions: z61.array(z61.enum(["property", "target", "market"]))
20513
+ sourceId: z62.string().trim().min(1).optional(),
20514
+ burstThreshold: z62.number().int().min(1).max(1e6).optional(),
20515
+ ratioThreshold: z62.number().min(1).max(1e3).optional(),
20516
+ limit: z62.number().int().min(1).max(500).optional()
20517
+ }).strict();
20518
+ var countsSchema = z62.object({
20519
+ total: z62.number().int().nonnegative(),
20520
+ paid: z62.number().int().nonnegative(),
20521
+ organic: z62.number().int().nonnegative(),
20522
+ unknown: z62.number().int().nonnegative()
20523
+ });
20524
+ var referralAssessmentSchema = z62.object({
20525
+ scope: z62.object({
20526
+ project: z62.string(),
20527
+ sourceId: z62.string().nullable(),
20528
+ attribution: z62.literal("project-source-only"),
20529
+ unavailableDimensions: z62.array(z62.enum(["property", "target", "market"]))
20429
20530
  }),
20430
- window: z61.object({ startDate: calendarDateSchema, endDate: calendarDateSchema, timeZone: z61.literal("UTC") }),
20431
- rule: z61.object({
20432
- version: z61.literal("hourly-normalized-path-v1"),
20433
- burstThreshold: z61.number().int().positive(),
20434
- ratioThreshold: z61.number().positive(),
20435
- calibration: z61.enum(["uncalibrated-default", "request-override"]),
20436
- grouping: z61.array(z61.string()),
20437
- confirmsAutomation: z61.literal(false)
20531
+ window: z62.object({ startDate: calendarDateSchema, endDate: calendarDateSchema, timeZone: z62.literal("UTC") }),
20532
+ rule: z62.object({
20533
+ version: z62.literal("hourly-normalized-path-v1"),
20534
+ burstThreshold: z62.number().int().positive(),
20535
+ ratioThreshold: z62.number().positive(),
20536
+ calibration: z62.enum(["uncalibrated-default", "request-override"]),
20537
+ grouping: z62.array(z62.string()),
20538
+ confirmsAutomation: z62.literal(false)
20438
20539
  }),
20439
- totals: z61.object({
20540
+ totals: z62.object({
20440
20541
  raw: countsSchema,
20441
20542
  redirects: countsSchema,
20442
20543
  subresources: countsSchema,
@@ -20444,58 +20545,58 @@ var referralAssessmentSchema = z61.object({
20444
20545
  suspected: countsSchema,
20445
20546
  adjustedEstimate: countsSchema
20446
20547
  }),
20447
- bursts: z61.array(z61.object({
20448
- sourceId: z61.string(),
20449
- product: z61.string(),
20450
- landingPathNormalized: z61.string(),
20451
- tsHour: z61.string(),
20548
+ bursts: z62.array(z62.object({
20549
+ sourceId: z62.string(),
20550
+ product: z62.string(),
20551
+ landingPathNormalized: z62.string(),
20552
+ tsHour: z62.string(),
20452
20553
  counts: countsSchema
20453
20554
  })),
20454
- evidence: z61.object({ total: z61.number().int().nonnegative(), returned: z61.number().int().nonnegative(), truncated: z61.boolean() }),
20455
- comparison: z61.object({
20456
- status: z61.literal("unavailable"),
20457
- serverCountable: z61.number().int().nonnegative(),
20458
- serverObservation: z61.enum(["missing", "observed-zero", "observed-positive"]),
20555
+ evidence: z62.object({ total: z62.number().int().nonnegative(), returned: z62.number().int().nonnegative(), truncated: z62.boolean() }),
20556
+ comparison: z62.object({
20557
+ status: z62.literal("unavailable"),
20558
+ serverCountable: z62.number().int().nonnegative(),
20559
+ serverObservation: z62.enum(["missing", "observed-zero", "observed-positive"]),
20459
20560
  /**
20460
20561
  * Dimension-deduplicated GA AI sessions. With no stored AI row in the
20461
20562
  * window: `0` (`observed-zero`) when the latest GA sync queried the whole
20462
20563
  * window (GA4 omits zero rows), else `null` (`missing`).
20463
20564
  */
20464
- gaSessions: z61.number().int().nonnegative().nullable(),
20465
- gaObservation: z61.enum(["missing", "observed-zero", "observed-positive"]),
20565
+ gaSessions: z62.number().int().nonnegative().nullable(),
20566
+ gaObservation: z62.enum(["missing", "observed-zero", "observed-positive"]),
20466
20567
  /**
20467
20568
  * Descriptive quotient only (`serverCountable / gaSessions`, a multiplier
20468
20569
  * where 3 is three times as many, never a percent), rounded to 2
20469
20570
  * decimals. Not a matched, coverage-complete comparison.
20470
20571
  */
20471
- observedRatio: z61.number().nonnegative().nullable(),
20572
+ observedRatio: z62.number().nonnegative().nullable(),
20472
20573
  /** Compares the rounded `observedRatio` with `rule.ratioThreshold`. */
20473
- observedRatioAboveThreshold: z61.boolean().nullable(),
20474
- ratio: z61.null(),
20475
- reasons: z61.array(z61.string()),
20476
- gaScope: z61.literal("project")
20574
+ observedRatioAboveThreshold: z62.boolean().nullable(),
20575
+ ratio: z62.null(),
20576
+ reasons: z62.array(z62.string()),
20577
+ gaScope: z62.literal("project")
20477
20578
  }),
20478
- caveats: z61.array(z61.string())
20579
+ caveats: z62.array(z62.string())
20479
20580
  });
20480
20581
 
20481
20582
  // ../contracts/src/traffic-analytics.ts
20482
- import { z as z62 } from "zod";
20583
+ import { z as z63 } from "zod";
20483
20584
  var TRAFFIC_ANALYTICS_PERIOD_OPTIONS = windowDayValues(WINDOW_SETS.trafficAnalytics);
20484
- var trafficAnalyticsPeriodSchema = z62.union(TRAFFIC_ANALYTICS_PERIOD_OPTIONS.map((value) => z62.literal(value))).describe("Traffic activity window in days (7, 14, 30, or 90). Defaults to 30 when omitted.");
20585
+ var trafficAnalyticsPeriodSchema = z63.union(TRAFFIC_ANALYTICS_PERIOD_OPTIONS.map((value) => z63.literal(value))).describe("Traffic activity window in days (7, 14, 30, or 90). Defaults to 30 when omitted.");
20485
20586
  function parseTrafficAnalyticsPeriod(value) {
20486
20587
  return windowDays(parseWindowIn(value, WINDOW_SETS.trafficAnalytics, { field: "period", fallback: "30d" }));
20487
20588
  }
20488
- var trafficActivityCountSchema = z62.object({ current: z62.number(), prior: z62.number(), deltaPct: percent().nullable() });
20489
- var trafficActivitySummarySchema = z62.object({
20589
+ var trafficActivityCountSchema = z63.object({ current: z63.number(), prior: z63.number(), deltaPct: percent().nullable() });
20590
+ var trafficActivitySummarySchema = z63.object({
20490
20591
  /** ISO8601 inclusive lower bound of the selected window (default: 30 days). */
20491
- windowStart: z62.string(),
20592
+ windowStart: z63.string(),
20492
20593
  /** ISO8601 inclusive upper bound. */
20493
- windowEnd: z62.string(),
20594
+ windowEnd: z63.string(),
20494
20595
  /** Earliest stored project observation across crawler, user-fetch and referral hourly rows; not window-bound. */
20495
- coverageStart: z62.string().nullable(),
20596
+ coverageStart: z63.string().nullable(),
20496
20597
  /** Recording began on or before the prior window start. This does not establish uninterrupted ingestion. */
20497
- priorWindowComplete: z62.boolean(),
20498
- hasData: z62.boolean().describe("True when the selected or prior window has stored crawler, user-fetch, countable referral or operator evidence, or the selected window has referral redirects. False means no qualifying stored evidence; it can occur with no, paused, errored or never-synced ingestion and out-of-window observations. It does not establish measured zero traffic or source health."),
20598
+ priorWindowComplete: z63.boolean(),
20599
+ hasData: z63.boolean().describe("True when the selected or prior window has stored crawler, user-fetch, countable referral or operator evidence, or the selected window has referral redirects. False means no qualifying stored evidence; it can occur with no, paused, errored or never-synced ingestion and out-of-window observations. It does not establish measured zero traffic or source health."),
20499
20600
  /** Verified crawler hits during the selected period and the equal preceding period. */
20500
20601
  verifiedCrawlerHits: trafficActivityCountSchema,
20501
20602
  /** Unverified crawler hits during the selected period, separate from verified hits. */
@@ -20524,7 +20625,7 @@ var trafficActivitySummarySchema = z62.object({
20524
20625
  * is exactly the thing to fix, so the summary must show it rather
20525
20626
  * than render an empty section.
20526
20627
  */
20527
- referralRedirects: z62.number().int().nonnegative(),
20628
+ referralRedirects: z63.number().int().nonnegative(),
20528
20629
  /**
20529
20630
  * `referralArrivals` split by traffic class. The three buckets sum to it.
20530
20631
  *
@@ -20533,31 +20634,31 @@ var trafficActivitySummarySchema = z62.object({
20533
20634
  * never be resolved. Reporting them as organic would overstate earned AI
20534
20635
  * traffic by exactly a client's ad volume.
20535
20636
  */
20536
- referralArrivalsByClass: z62.object({
20637
+ referralArrivalsByClass: z63.object({
20537
20638
  paid: trafficActivityCountSchema,
20538
20639
  organic: trafficActivityCountSchema,
20539
20640
  unclassified: trafficActivityCountSchema
20540
20641
  }),
20541
20642
  /** Pre-rendered one-line breakdown, e.g. "Paid 1,200 · Organic 24". Empty when there is nothing to split. */
20542
- referralArrivalsClassSummary: z62.string(),
20643
+ referralArrivalsClassSummary: z63.string(),
20543
20644
  /** Per-AI-operator breakdown (OpenAI, Anthropic, Google AI, Perplexity, …). */
20544
- byOperator: z62.array(z62.object({
20545
- operator: z62.string(),
20546
- verifiedHits: z62.number(),
20645
+ byOperator: z63.array(z63.object({
20646
+ operator: z63.string(),
20647
+ verifiedHits: z63.number(),
20547
20648
  /** claimed-bot UA, source IP not in a published range. */
20548
- unverifiedHits: z62.number(),
20649
+ unverifiedHits: z63.number(),
20549
20650
  /** Per-user fetches from this operator's AI surface (ChatGPT-User, …). */
20550
- userFetchHits: z62.number(),
20551
- referralArrivals: z62.number(),
20651
+ userFetchHits: z63.number(),
20652
+ referralArrivals: z63.number(),
20552
20653
  deltaPct: percent().nullable()
20553
20654
  })),
20554
20655
  /**
20555
20656
  * Top crawled paths during the selected period, with both verified and
20556
20657
  * unverified crawler hits. These are request counts, not citation evidence.
20557
20658
  */
20558
- topCrawledPaths: z62.array(z62.object({
20559
- path: z62.string(),
20560
- verifiedHits: z62.number(),
20659
+ topCrawledPaths: z63.array(z63.object({
20660
+ path: z63.string(),
20661
+ verifiedHits: z63.number(),
20561
20662
  /**
20562
20663
  * Hits from a crawler that identified itself but whose source IP could not
20563
20664
  * be matched against the operator's published ranges. Additive, not an
@@ -20565,36 +20666,36 @@ var trafficActivitySummarySchema = z62.object({
20565
20666
  * logs, for one), so for those projects every hit lands here and a
20566
20667
  * verified-only view reports zero against real crawl activity.
20567
20668
  */
20568
- unverifiedHits: z62.number().default(0),
20669
+ unverifiedHits: z63.number().default(0),
20569
20670
  /** How many distinct AI operators crawled this path in the window. */
20570
- distinctOperators: z62.number()
20671
+ distinctOperators: z63.number()
20571
20672
  })),
20572
20673
  /** AI products that sent ≥1 session in the window (referral by destination). */
20573
- referralProducts: z62.array(z62.object({
20574
- product: z62.string(),
20575
- arrivals: z62.number(),
20576
- distinctLandingPaths: z62.number()
20674
+ referralProducts: z63.array(z63.object({
20675
+ product: z63.string(),
20676
+ arrivals: z63.number(),
20677
+ distinctLandingPaths: z63.number()
20577
20678
  })),
20578
20679
  /** Daily request counts during the selected period. */
20579
- dailyTrend: z62.array(z62.object({
20580
- date: z62.string(),
20581
- verifiedCrawlerHits: z62.number(),
20680
+ dailyTrend: z63.array(z63.object({
20681
+ date: z63.string(),
20682
+ verifiedCrawlerHits: z63.number(),
20582
20683
  /** See topCrawledPaths.unverifiedHits. Plotted alongside, never instead. */
20583
- unverifiedCrawlerHits: z62.number().default(0),
20584
- userFetchHits: z62.number(),
20585
- referralArrivals: z62.number()
20684
+ unverifiedCrawlerHits: z63.number().default(0),
20685
+ userFetchHits: z63.number(),
20686
+ referralArrivals: z63.number()
20586
20687
  })),
20587
20688
  /**
20588
20689
  * Top landing paths for AI-referral sessions during the selected period.
20589
20690
  * Complements crawler paths with server-observed referral arrivals.
20590
20691
  */
20591
- topReferralLandingPaths: z62.array(z62.object({
20592
- path: z62.string(),
20593
- arrivals: z62.number(),
20594
- distinctProducts: z62.number()
20692
+ topReferralLandingPaths: z63.array(z63.object({
20693
+ path: z63.string(),
20694
+ arrivals: z63.number(),
20695
+ distinctProducts: z63.number()
20595
20696
  }))
20596
20697
  });
20597
- var trafficAnalyticsResponseSchema = z62.object({
20698
+ var trafficAnalyticsResponseSchema = z63.object({
20598
20699
  /** Null when no non-archived traffic source is connected. Connected sources without events return zero counts. */
20599
20700
  activity: trafficActivitySummarySchema.nullable()
20600
20701
  });
@@ -20614,18 +20715,18 @@ function uncheckedSourcesLabel(value) {
20614
20715
  }
20615
20716
 
20616
20717
  // ../contracts/src/api-keys.ts
20617
- import { z as z63 } from "zod";
20618
- var apiKeyDtoSchema = z63.object({
20619
- id: z63.string(),
20620
- name: z63.string(),
20718
+ import { z as z64 } from "zod";
20719
+ var apiKeyDtoSchema = z64.object({
20720
+ id: z64.string(),
20721
+ name: z64.string(),
20621
20722
  /** First 9 chars of the raw token (`cnry_` + 4 hex). Safe to display. */
20622
- keyPrefix: z63.string(),
20623
- scopes: z63.array(z63.string()),
20723
+ keyPrefix: z64.string(),
20724
+ scopes: z64.array(z64.string()),
20624
20725
  /**
20625
20726
  * The project this key is scoped to, or `null` for a full-instance key. A
20626
20727
  * scoped key may only read/write its own project (enforced server-side).
20627
20728
  */
20628
- projectId: z63.string().nullable(),
20729
+ projectId: z64.string().nullable(),
20629
20730
  /**
20630
20731
  * The scoped project's name, or `null` for a full-instance key. Resolved
20631
20732
  * server-side so a surface listing keys does not have to fetch every project
@@ -20633,89 +20734,89 @@ var apiKeyDtoSchema = z63.object({
20633
20734
  * "is this key safe to hand to someone", which is the question the list is
20634
20735
  * usually open to answer. Additive field.
20635
20736
  */
20636
- projectName: z63.string().nullable(),
20737
+ projectName: z64.string().nullable(),
20637
20738
  /**
20638
20739
  * Server-derived convenience flag: `true` when this key is read-only (carries
20639
20740
  * the `read` scope and no write-granting scope), in which case the API rejects
20640
20741
  * every write HTTP method for it. Derived from `scopes` via `isReadOnlyKey`
20641
20742
  * — surfaces don't recompute it (see the UI/CLI parity rule). Additive field.
20642
20743
  */
20643
- readOnly: z63.boolean(),
20744
+ readOnly: z64.boolean(),
20644
20745
  /** Present on /keys/self: host-derived direct-bearer authority, never a mintable scope. */
20645
- operator: z63.boolean().optional(),
20646
- createdAt: z63.string(),
20647
- lastUsedAt: z63.string().nullable(),
20648
- revokedAt: z63.string().nullable()
20746
+ operator: z64.boolean().optional(),
20747
+ createdAt: z64.string(),
20748
+ lastUsedAt: z64.string().nullable(),
20749
+ revokedAt: z64.string().nullable()
20649
20750
  });
20650
- var apiKeyListDtoSchema = z63.object({
20651
- keys: z63.array(apiKeyDtoSchema)
20751
+ var apiKeyListDtoSchema = z64.object({
20752
+ keys: z64.array(apiKeyDtoSchema)
20652
20753
  });
20653
- var createApiKeyRequestSchema = z63.object({
20654
- name: z63.string().min(1).max(100),
20754
+ var createApiKeyRequestSchema = z64.object({
20755
+ name: z64.string().min(1).max(100),
20655
20756
  /**
20656
20757
  * Scopes granted to the new key. Omit to default to `['*']` (full access,
20657
20758
  * what `canonry init` writes for the root key). When provided it must be a
20658
20759
  * non-empty list — an empty array would mint a key that can do nothing.
20659
20760
  */
20660
- scopes: z63.array(z63.string()).min(1).optional(),
20761
+ scopes: z64.array(z64.string()).min(1).optional(),
20661
20762
  /**
20662
20763
  * Bind the new key to a SINGLE project (by project id). Omit for a
20663
20764
  * full-instance key (the default). A scoped key may only read/write that
20664
20765
  * project; the server validates the id exists at creation time.
20665
20766
  */
20666
- projectId: z63.string().optional()
20767
+ projectId: z64.string().optional()
20667
20768
  });
20668
20769
  var createdApiKeyDtoSchema = apiKeyDtoSchema.extend({
20669
- key: z63.string()
20770
+ key: z64.string()
20670
20771
  });
20671
20772
 
20672
20773
  // ../contracts/src/config-schema.ts
20673
- import { z as z65 } from "zod";
20774
+ import { z as z66 } from "zod";
20674
20775
 
20675
20776
  // ../contracts/src/schedule.ts
20676
- import { z as z64 } from "zod";
20677
- var schedulableRunKindSchema = z64.enum(["answer-visibility", "traffic-sync", "gbp-sync", "data-refresh", "backlinks-sync", "site-audit", "ads-sync", "doctor"]);
20777
+ import { z as z65 } from "zod";
20778
+ var schedulableRunKindSchema = z65.enum(["answer-visibility", "traffic-sync", "gbp-sync", "data-refresh", "backlinks-sync", "site-audit", "ads-sync", "doctor"]);
20678
20779
  var SchedulableRunKinds = schedulableRunKindSchema.enum;
20679
- var calendarRecurrenceSchema = z64.object({
20680
- everyDays: z64.number().int().min(1).max(3650),
20681
- startDate: z64.string().date(),
20682
- time: z64.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/, "Time must be HH:mm")
20683
- }).strict();
20684
- var scheduleDtoSchema = z64.object({
20685
- id: z64.string(),
20686
- projectId: z64.string(),
20780
+ var calendarRecurrenceSchema = z65.object({
20781
+ everyDays: z65.number().int().min(1).max(3650),
20782
+ startDate: z65.string().date(),
20783
+ time: z65.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/, "Time must be HH:mm")
20784
+ }).strict();
20785
+ var scheduleDtoSchema = z65.object({
20786
+ id: z65.string(),
20787
+ projectId: z65.string(),
20687
20788
  /** Run kind dispatched when this schedule fires. Defaults to 'answer-visibility' for legacy rows. */
20688
20789
  kind: schedulableRunKindSchema,
20689
20790
  /** Empty for calendar recurrence schedules. */
20690
- cronExpr: z64.string(),
20791
+ cronExpr: z65.string(),
20691
20792
  recurrence: calendarRecurrenceSchema.nullable().optional(),
20692
- preset: z64.string().nullable().optional(),
20693
- timezone: z64.string().default("UTC"),
20694
- enabled: z64.boolean().default(true),
20695
- providers: z64.array(providerNameSchema).default([]),
20793
+ preset: z65.string().nullable().optional(),
20794
+ timezone: z65.string().default("UTC"),
20795
+ enabled: z65.boolean().default(true),
20796
+ providers: z65.array(providerNameSchema).default([]),
20696
20797
  /** Traffic-source UUID for `kind === 'traffic-sync'` schedules. Null otherwise. */
20697
- sourceId: z64.string().nullable().optional(),
20698
- lastRunAt: z64.string().nullable().optional(),
20699
- nextRunAt: z64.string().nullable().optional(),
20700
- createdAt: z64.string(),
20701
- updatedAt: z64.string()
20798
+ sourceId: z65.string().nullable().optional(),
20799
+ lastRunAt: z65.string().nullable().optional(),
20800
+ nextRunAt: z65.string().nullable().optional(),
20801
+ createdAt: z65.string(),
20802
+ updatedAt: z65.string()
20702
20803
  });
20703
- var scheduleExpectedUpdatedAtSchema = z64.string().datetime();
20804
+ var scheduleExpectedUpdatedAtSchema = z65.string().datetime();
20704
20805
  function nextScheduleUpdatedAt(previous, nowMs = Date.now()) {
20705
20806
  const previousMs = previous === void 0 ? Number.NaN : Date.parse(previous);
20706
20807
  return new Date(Number.isFinite(previousMs) ? Math.max(nowMs, previousMs + 1) : nowMs).toISOString();
20707
20808
  }
20708
- var scheduleUpsertRequestSchema = z64.object({
20809
+ var scheduleUpsertRequestSchema = z65.object({
20709
20810
  /** Run kind. Defaults to 'answer-visibility' so existing callers don't have to change. */
20710
20811
  kind: schedulableRunKindSchema.optional(),
20711
- preset: z64.string().min(1).optional(),
20712
- cron: z64.string().min(1).optional(),
20812
+ preset: z65.string().min(1).optional(),
20813
+ cron: z65.string().min(1).optional(),
20713
20814
  recurrence: calendarRecurrenceSchema.optional(),
20714
- timezone: z64.string().optional().default("UTC"),
20715
- enabled: z64.boolean().optional().default(true),
20716
- providers: z64.array(providerNameSchema).optional().default([]),
20815
+ timezone: z65.string().optional().default("UTC"),
20816
+ enabled: z65.boolean().optional().default(true),
20817
+ providers: z65.array(providerNameSchema).optional().default([]),
20717
20818
  /** Required when kind === 'traffic-sync'. Forbidden for other kinds. Validated server-side. */
20718
- sourceId: z64.string().optional(),
20819
+ sourceId: z65.string().optional(),
20719
20820
  /**
20720
20821
  * Optimistic concurrency guard. A timestamp updates only that exact version;
20721
20822
  * null creates only while the schedule is absent. Omit for legacy behavior.
@@ -20727,18 +20828,18 @@ var scheduleUpsertRequestSchema = z64.object({
20727
20828
  );
20728
20829
 
20729
20830
  // ../contracts/src/config-schema.ts
20730
- var configMetadataSchema = z65.object({
20731
- name: z65.string().min(1).max(63).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/, {
20831
+ var configMetadataSchema = z66.object({
20832
+ name: z66.string().min(1).max(63).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/, {
20732
20833
  message: "Name must be a lowercase slug (letters, numbers, hyphens)"
20733
20834
  }),
20734
- labels: z65.record(z65.string(), z65.string()).optional().default({})
20835
+ labels: z66.record(z66.string(), z66.string()).optional().default({})
20735
20836
  });
20736
- var configScheduleObjectSchema = z65.object({
20737
- preset: z65.string().min(1).optional(),
20738
- cron: z65.string().min(1).optional(),
20837
+ var configScheduleObjectSchema = z66.object({
20838
+ preset: z66.string().min(1).optional(),
20839
+ cron: z66.string().min(1).optional(),
20739
20840
  recurrence: calendarRecurrenceSchema.optional(),
20740
- timezone: z65.string().optional().default("UTC"),
20741
- providers: z65.array(providerNameSchema).optional().default([]),
20841
+ timezone: z66.string().optional().default("UTC"),
20842
+ providers: z66.array(providerNameSchema).optional().default([]),
20742
20843
  /**
20743
20844
  * Whether the schedule fires. Omit to leave an existing schedule's state
20744
20845
  * alone — a schedule paused from the dashboard or the API stays paused
@@ -20746,59 +20847,59 @@ var configScheduleObjectSchema = z65.object({
20746
20847
  * someone deliberately stopped. A schedule created by this apply defaults
20747
20848
  * to enabled.
20748
20849
  */
20749
- enabled: z65.boolean().optional()
20850
+ enabled: z66.boolean().optional()
20750
20851
  });
20751
20852
  function hasOneScheduleTiming(schedule) {
20752
20853
  return [schedule.preset, schedule.cron, schedule.recurrence].filter((value) => value !== void 0).length === 1;
20753
20854
  }
20754
20855
  var oneScheduleTimingMessage = { message: 'Exactly one of "preset", "cron", or "recurrence" must be provided' };
20755
20856
  var configScheduleSchema = configScheduleObjectSchema.refine(hasOneScheduleTiming, oneScheduleTimingMessage).optional();
20756
- var configNotificationSchema = z65.object({
20757
- id: z65.string().min(1).optional(),
20758
- channel: z65.literal("webhook"),
20759
- url: z65.string().url(),
20760
- events: z65.array(notificationEventSchema).min(1)
20761
- });
20762
- var configGoogleSchema = z65.object({
20763
- gsc: z65.object({
20764
- propertyUrl: z65.string()
20857
+ var configNotificationSchema = z66.object({
20858
+ id: z66.string().min(1).optional(),
20859
+ channel: z66.literal("webhook"),
20860
+ url: z66.string().url(),
20861
+ events: z66.array(notificationEventSchema).min(1)
20862
+ });
20863
+ var configGoogleSchema = z66.object({
20864
+ gsc: z66.object({
20865
+ propertyUrl: z66.string()
20765
20866
  }).optional(),
20766
- syncSchedule: z65.object({
20767
- preset: z65.string().optional(),
20768
- cron: z65.string().optional()
20867
+ syncSchedule: z66.object({
20868
+ preset: z66.string().optional(),
20869
+ cron: z66.string().optional()
20769
20870
  }).optional()
20770
20871
  }).optional();
20771
- var configQueryListSchema = z65.array(z65.string().min(1));
20872
+ var configQueryListSchema = z66.array(z66.string().min(1));
20772
20873
  var configSpecShape = {
20773
- displayName: z65.string().min(1),
20774
- canonicalDomain: z65.string().min(1),
20775
- ownedDomains: z65.array(z65.string().min(1)).optional().default([]),
20776
- aliases: z65.array(z65.string().min(1)).optional().default([]),
20874
+ displayName: z66.string().min(1),
20875
+ canonicalDomain: z66.string().min(1),
20876
+ ownedDomains: z66.array(z66.string().min(1)).optional().default([]),
20877
+ aliases: z66.array(z66.string().min(1)).optional().default([]),
20777
20878
  // No default on purpose: an apply that omits it keeps the project's stored
20778
20879
  // list, minus names that no longer qualify against this spec's `aliases`,
20779
20880
  // display name and competitors. Each entry must be an alias.
20780
- qualifiedAliases: z65.array(z65.string().min(1).max(PROJECT_QUALIFIED_ALIAS_MAX_LENGTH)).max(PROJECT_QUALIFIED_ALIAS_LIMIT).optional(),
20781
- country: z65.string().length(2),
20782
- language: z65.string().min(2),
20881
+ qualifiedAliases: z66.array(z66.string().min(1).max(PROJECT_QUALIFIED_ALIAS_MAX_LENGTH)).max(PROJECT_QUALIFIED_ALIAS_LIMIT).optional(),
20882
+ country: z66.string().length(2),
20883
+ language: z66.string().min(2),
20783
20884
  queries: configQueryListSchema.optional(),
20784
20885
  keywords: configQueryListSchema.optional(),
20785
20886
  // Each entry is a bare domain or `{ domain, aliases }`. A bare domain (or an
20786
20887
  // object without `aliases`) keeps that competitor's stored aliases on apply;
20787
20888
  // `aliases` sets them exactly (`[]` clears). The domain set itself is still
20788
20889
  // replaced by this list.
20789
- competitors: z65.array(competitorEntrySchema).optional().default([]),
20790
- providers: z65.array(providerNameSchema).optional().default([]),
20890
+ competitors: z66.array(competitorEntrySchema).optional().default([]),
20891
+ providers: z66.array(providerNameSchema).optional().default([]),
20791
20892
  providerModels: providerModelsSchema.optional().default({}),
20792
20893
  // No default on purpose: an apply that omits it leaves the project's stored
20793
20894
  // preference alone, the same rule as `queries`.
20794
20895
  providerDispatchModes: providerDispatchModesSchema.optional(),
20795
- locations: z65.array(locationContextSchema).optional().default([]),
20796
- defaultLocation: z65.string().optional(),
20896
+ locations: z66.array(locationContextSchema).optional().default([]),
20897
+ defaultLocation: z66.string().optional(),
20797
20898
  measurement: measurementConfigSchema.optional().default(defaultMeasurementConfig),
20798
20899
  schedule: configScheduleSchema,
20799
- notifications: z65.array(configNotificationSchema).optional().default([]),
20900
+ notifications: z66.array(configNotificationSchema).optional().default([]),
20800
20901
  google: configGoogleSchema,
20801
- autoExtractBacklinks: z65.boolean().optional().default(false),
20902
+ autoExtractBacklinks: z66.boolean().optional().default(false),
20802
20903
  /** Highest star rating that counts as a negative Google review (1-4). Omitted means the default of 3. */
20803
20904
  negativeReviewMaxStars: gbpNegativeReviewMaxStarsSchema.optional(),
20804
20905
  /**
@@ -20838,20 +20939,20 @@ function checkConfigSpec(spec, ctx) {
20838
20939
  });
20839
20940
  }
20840
20941
  }
20841
- var configSpecSchema = z65.object(configSpecShape).superRefine(checkConfigSpec);
20842
- var projectConfigSchema = z65.object({
20843
- apiVersion: z65.literal("canonry/v1"),
20844
- kind: z65.literal("Project"),
20942
+ var configSpecSchema = z66.object(configSpecShape).superRefine(checkConfigSpec);
20943
+ var projectConfigSchema = z66.object({
20944
+ apiVersion: z66.literal("canonry/v1"),
20945
+ kind: z66.literal("Project"),
20845
20946
  metadata: configMetadataSchema,
20846
20947
  spec: configSpecSchema
20847
20948
  });
20848
20949
  var projectConfigExportSchema = projectConfigSchema.extend({
20849
- spec: z65.object({
20950
+ spec: z66.object({
20850
20951
  ...configSpecShape,
20851
20952
  queries: configQueryListSchema,
20852
20953
  providerModels: providerModelsSchema.optional(),
20853
- schedule: configScheduleObjectSchema.extend({ enabled: z65.boolean() }).refine(hasOneScheduleTiming, oneScheduleTimingMessage).optional(),
20854
- autoExtractBacklinks: z65.boolean().optional()
20954
+ schedule: configScheduleObjectSchema.extend({ enabled: z66.boolean() }).refine(hasOneScheduleTiming, oneScheduleTimingMessage).optional(),
20955
+ autoExtractBacklinks: z66.boolean().optional()
20855
20956
  }).superRefine(checkConfigSpec)
20856
20957
  });
20857
20958
  function resolveConfigSpecQueries(spec) {
@@ -20859,134 +20960,134 @@ function resolveConfigSpecQueries(spec) {
20859
20960
  }
20860
20961
 
20861
20962
  // ../contracts/src/config-diff.ts
20862
- import { z as z66 } from "zod";
20963
+ import { z as z67 } from "zod";
20863
20964
  function fieldChangeSchema(schema) {
20864
- return z66.object({ before: schema.nullable(), after: schema.nullable() });
20865
- }
20866
- var projectFieldsStateSchema = z66.object({
20867
- displayName: z66.string().optional(),
20868
- canonicalDomain: z66.string().optional(),
20869
- ownedDomains: z66.array(z66.string()).optional(),
20870
- aliases: z66.array(z66.string()).optional(),
20871
- qualifiedAliases: z66.array(z66.string()).optional(),
20872
- country: z66.string().optional(),
20873
- language: z66.string().optional(),
20874
- labels: z66.record(z66.string(), z66.string()).optional(),
20875
- providers: z66.array(z66.string()).optional(),
20965
+ return z67.object({ before: schema.nullable(), after: schema.nullable() });
20966
+ }
20967
+ var projectFieldsStateSchema = z67.object({
20968
+ displayName: z67.string().optional(),
20969
+ canonicalDomain: z67.string().optional(),
20970
+ ownedDomains: z67.array(z67.string()).optional(),
20971
+ aliases: z67.array(z67.string()).optional(),
20972
+ qualifiedAliases: z67.array(z67.string()).optional(),
20973
+ country: z67.string().optional(),
20974
+ language: z67.string().optional(),
20975
+ labels: z67.record(z67.string(), z67.string()).optional(),
20976
+ providers: z67.array(z67.string()).optional(),
20876
20977
  providerModels: providerModelsSchema.optional(),
20877
20978
  providerDispatchModes: providerDispatchModesSchema.optional(),
20878
20979
  "measurement.marketingHosts": measurementConfigSchema.shape.marketingHosts.optional(),
20879
20980
  "measurement.brandTerms": measurementConfigSchema.shape.brandTerms.optional(),
20880
20981
  "measurement.leadEventNames": measurementConfigSchema.shape.leadEventNames.optional(),
20881
- locations: z66.array(locationContextSchema).optional(),
20882
- defaultLocation: z66.string().nullable().optional(),
20883
- autoExtractBacklinks: z66.boolean().optional(),
20884
- negativeReviewMaxStars: z66.number().int().nullable().optional(),
20885
- siteAuditMaxPages: z66.number().int().nullable().optional(),
20886
- competitorAutoAliases: z66.enum(["off", "preview", "apply"]).optional(),
20982
+ locations: z67.array(locationContextSchema).optional(),
20983
+ defaultLocation: z67.string().nullable().optional(),
20984
+ autoExtractBacklinks: z67.boolean().optional(),
20985
+ negativeReviewMaxStars: z67.number().int().nullable().optional(),
20986
+ siteAuditMaxPages: z67.number().int().nullable().optional(),
20987
+ competitorAutoAliases: z67.enum(["off", "preview", "apply"]).optional(),
20887
20988
  configSource: configSourceSchema.optional()
20888
20989
  }).strict();
20889
- var projectFieldsChangeSchema = z66.object({
20890
- displayName: fieldChangeSchema(z66.string()).optional(),
20891
- canonicalDomain: fieldChangeSchema(z66.string()).optional(),
20892
- ownedDomains: fieldChangeSchema(z66.array(z66.string())).optional(),
20893
- aliases: fieldChangeSchema(z66.array(z66.string())).optional(),
20894
- qualifiedAliases: fieldChangeSchema(z66.array(z66.string())).optional(),
20895
- country: fieldChangeSchema(z66.string()).optional(),
20896
- language: fieldChangeSchema(z66.string()).optional(),
20897
- labels: fieldChangeSchema(z66.record(z66.string(), z66.string())).optional(),
20898
- providers: fieldChangeSchema(z66.array(z66.string())).optional(),
20990
+ var projectFieldsChangeSchema = z67.object({
20991
+ displayName: fieldChangeSchema(z67.string()).optional(),
20992
+ canonicalDomain: fieldChangeSchema(z67.string()).optional(),
20993
+ ownedDomains: fieldChangeSchema(z67.array(z67.string())).optional(),
20994
+ aliases: fieldChangeSchema(z67.array(z67.string())).optional(),
20995
+ qualifiedAliases: fieldChangeSchema(z67.array(z67.string())).optional(),
20996
+ country: fieldChangeSchema(z67.string()).optional(),
20997
+ language: fieldChangeSchema(z67.string()).optional(),
20998
+ labels: fieldChangeSchema(z67.record(z67.string(), z67.string())).optional(),
20999
+ providers: fieldChangeSchema(z67.array(z67.string())).optional(),
20899
21000
  providerModels: fieldChangeSchema(providerModelsSchema).optional(),
20900
21001
  providerDispatchModes: fieldChangeSchema(providerDispatchModesSchema).optional(),
20901
21002
  "measurement.marketingHosts": fieldChangeSchema(measurementConfigSchema.shape.marketingHosts).optional(),
20902
21003
  "measurement.brandTerms": fieldChangeSchema(measurementConfigSchema.shape.brandTerms).optional(),
20903
21004
  "measurement.leadEventNames": fieldChangeSchema(measurementConfigSchema.shape.leadEventNames).optional(),
20904
- locations: fieldChangeSchema(z66.array(locationContextSchema)).optional(),
20905
- defaultLocation: fieldChangeSchema(z66.string()).optional(),
20906
- autoExtractBacklinks: fieldChangeSchema(z66.boolean()).optional(),
20907
- negativeReviewMaxStars: fieldChangeSchema(z66.number().int()).optional(),
20908
- siteAuditMaxPages: fieldChangeSchema(z66.number().int().nullable()).optional(),
20909
- competitorAutoAliases: fieldChangeSchema(z66.enum(["off", "preview", "apply"])).optional(),
21005
+ locations: fieldChangeSchema(z67.array(locationContextSchema)).optional(),
21006
+ defaultLocation: fieldChangeSchema(z67.string()).optional(),
21007
+ autoExtractBacklinks: fieldChangeSchema(z67.boolean()).optional(),
21008
+ negativeReviewMaxStars: fieldChangeSchema(z67.number().int()).optional(),
21009
+ siteAuditMaxPages: fieldChangeSchema(z67.number().int().nullable()).optional(),
21010
+ competitorAutoAliases: fieldChangeSchema(z67.enum(["off", "preview", "apply"])).optional(),
20910
21011
  configSource: fieldChangeSchema(configSourceSchema).optional()
20911
21012
  }).strict();
20912
- var scheduleStateSchema = z66.object({
20913
- cron: z66.string().optional(),
20914
- preset: z66.string().optional(),
21013
+ var scheduleStateSchema = z67.object({
21014
+ cron: z67.string().optional(),
21015
+ preset: z67.string().optional(),
20915
21016
  recurrence: calendarRecurrenceSchema.optional(),
20916
- timezone: z66.string(),
20917
- providers: z66.array(z66.string()),
20918
- enabled: z66.boolean()
20919
- }).strict();
20920
- var droppedAliasSchema = z66.object({
20921
- domain: z66.string(),
20922
- alias: z66.string(),
20923
- reason: z66.enum(["too-long", "too-short", "project-brand", "other-competitor", "market-competitor", "claimed-by-alias"]),
20924
- conflictsWith: z66.string().optional(),
20925
- conflictingName: z66.string().optional(),
20926
- markets: z66.array(z66.string()).optional()
20927
- }).strict();
20928
- var configStateNotificationSchema = z66.object({
20929
- id: z66.string(),
20930
- url: z66.string().optional(),
20931
- urlHost: z66.string(),
20932
- events: z66.array(z66.string()),
20933
- enabled: z66.boolean(),
20934
- source: z66.string().optional()
20935
- });
20936
- var projectConfigStateSchema = z66.object({
20937
- project: z66.object({ id: z66.string(), name: z66.string() }),
20938
- configRevision: z66.number().int(),
21017
+ timezone: z67.string(),
21018
+ providers: z67.array(z67.string()),
21019
+ enabled: z67.boolean()
21020
+ }).strict();
21021
+ var droppedAliasSchema = z67.object({
21022
+ domain: z67.string(),
21023
+ alias: z67.string(),
21024
+ reason: z67.enum(["too-long", "too-short", "project-brand", "other-competitor", "market-competitor", "claimed-by-alias"]),
21025
+ conflictsWith: z67.string().optional(),
21026
+ conflictingName: z67.string().optional(),
21027
+ markets: z67.array(z67.string()).optional()
21028
+ }).strict();
21029
+ var configStateNotificationSchema = z67.object({
21030
+ id: z67.string(),
21031
+ url: z67.string().optional(),
21032
+ urlHost: z67.string(),
21033
+ events: z67.array(z67.string()),
21034
+ enabled: z67.boolean(),
21035
+ source: z67.string().optional()
21036
+ });
21037
+ var projectConfigStateSchema = z67.object({
21038
+ project: z67.object({ id: z67.string(), name: z67.string() }),
21039
+ configRevision: z67.number().int(),
20939
21040
  fields: projectFieldsStateSchema,
20940
- queries: z66.array(z66.object({ id: z66.string(), text: z66.string() })),
20941
- competitors: z66.array(z66.object({ id: z66.string(), domain: z66.string(), aliases: z66.array(z66.string()) })),
21041
+ queries: z67.array(z67.object({ id: z67.string(), text: z67.string() })),
21042
+ competitors: z67.array(z67.object({ id: z67.string(), domain: z67.string(), aliases: z67.array(z67.string()) })),
20942
21043
  schedule: scheduleStateSchema.nullable(),
20943
- notifications: z66.array(configStateNotificationSchema),
20944
- managed: z66.object({ queries: z66.boolean(), competitors: z66.boolean(), schedule: z66.boolean(), notifications: z66.boolean() }),
20945
- detachedSnapshotCount: z66.number().int().nonnegative()
20946
- });
20947
- var notificationAddedSchema = z66.object({ urlHost: z66.string(), events: z66.array(z66.string()) });
20948
- var notificationRemovedSchema = notificationAddedSchema.extend({ id: z66.string() });
20949
- var notificationKeptSchema = z66.object({
20950
- id: z66.string(),
20951
- urlHost: z66.string(),
20952
- urlChanged: z66.boolean(),
20953
- eventsBefore: z66.array(z66.string()),
20954
- eventsAfter: z66.array(z66.string())
20955
- });
20956
- var applyPreviewDtoSchema = z66.object({
20957
- project: z66.object({ id: z66.string().nullable(), name: z66.string() }),
20958
- action: z66.enum(["create", "update", "none"]),
20959
- changed: z66.boolean(),
20960
- configRevision: z66.object({ before: z66.number().int().nullable(), after: z66.number().int() }),
21044
+ notifications: z67.array(configStateNotificationSchema),
21045
+ managed: z67.object({ queries: z67.boolean(), competitors: z67.boolean(), schedule: z67.boolean(), notifications: z67.boolean() }),
21046
+ detachedSnapshotCount: z67.number().int().nonnegative()
21047
+ });
21048
+ var notificationAddedSchema = z67.object({ urlHost: z67.string(), events: z67.array(z67.string()) });
21049
+ var notificationRemovedSchema = notificationAddedSchema.extend({ id: z67.string() });
21050
+ var notificationKeptSchema = z67.object({
21051
+ id: z67.string(),
21052
+ urlHost: z67.string(),
21053
+ urlChanged: z67.boolean(),
21054
+ eventsBefore: z67.array(z67.string()),
21055
+ eventsAfter: z67.array(z67.string())
21056
+ });
21057
+ var applyPreviewDtoSchema = z67.object({
21058
+ project: z67.object({ id: z67.string().nullable(), name: z67.string() }),
21059
+ action: z67.enum(["create", "update", "none"]),
21060
+ changed: z67.boolean(),
21061
+ configRevision: z67.object({ before: z67.number().int().nullable(), after: z67.number().int() }),
20961
21062
  fields: projectFieldsChangeSchema,
20962
- queries: z66.object({
20963
- managed: z66.boolean(),
20964
- added: z66.array(z66.string()),
20965
- removed: z66.array(z66.string()),
20966
- unchangedCount: z66.number().int().nonnegative(),
20967
- snapshotsDetached: z66.number().int().nonnegative()
21063
+ queries: z67.object({
21064
+ managed: z67.boolean(),
21065
+ added: z67.array(z67.string()),
21066
+ removed: z67.array(z67.string()),
21067
+ unchangedCount: z67.number().int().nonnegative(),
21068
+ snapshotsDetached: z67.number().int().nonnegative()
20968
21069
  }),
20969
- competitors: z66.object({
20970
- managed: z66.boolean(),
20971
- added: z66.array(z66.string()),
20972
- removed: z66.array(z66.string()),
20973
- aliasChanges: z66.array(z66.object({ domain: z66.string(), before: z66.array(z66.string()), after: z66.array(z66.string()) })),
20974
- droppedAliases: z66.array(droppedAliasSchema)
21070
+ competitors: z67.object({
21071
+ managed: z67.boolean(),
21072
+ added: z67.array(z67.string()),
21073
+ removed: z67.array(z67.string()),
21074
+ aliasChanges: z67.array(z67.object({ domain: z67.string(), before: z67.array(z67.string()), after: z67.array(z67.string()) })),
21075
+ droppedAliases: z67.array(droppedAliasSchema)
20975
21076
  }),
20976
- schedule: z66.object({
20977
- managed: z66.boolean(),
20978
- action: z66.enum(["create", "update", "delete", "none"]),
21077
+ schedule: z67.object({
21078
+ managed: z67.boolean(),
21079
+ action: z67.enum(["create", "update", "delete", "none"]),
20979
21080
  before: scheduleStateSchema.nullable(),
20980
21081
  after: scheduleStateSchema.nullable()
20981
21082
  }),
20982
- notifications: z66.object({
20983
- managed: z66.boolean(),
20984
- added: z66.array(notificationAddedSchema),
20985
- removed: z66.array(notificationRemovedSchema),
20986
- kept: z66.array(notificationKeptSchema),
20987
- secretsRotated: z66.number().int().nonnegative()
21083
+ notifications: z67.object({
21084
+ managed: z67.boolean(),
21085
+ added: z67.array(notificationAddedSchema),
21086
+ removed: z67.array(notificationRemovedSchema),
21087
+ kept: z67.array(notificationKeptSchema),
21088
+ secretsRotated: z67.number().int().nonnegative()
20988
21089
  }),
20989
- effects: z66.array(z66.enum([
21090
+ effects: z67.array(z67.enum([
20990
21091
  "mention-backfill",
20991
21092
  "competitor-rescore",
20992
21093
  "competitor-auto-alias-rescan",
@@ -21098,46 +21199,46 @@ function diffProjectConfigState(before, after, options = {}) {
21098
21199
  }
21099
21200
 
21100
21201
  // ../contracts/src/simple-measurement-definition.ts
21101
- import { z as z67 } from "zod";
21202
+ import { z as z68 } from "zod";
21102
21203
  var SIMPLE_MEASUREMENT_DEFINITION_SCHEMA_VERSION = 1;
21103
- var nonBlankStringSchema = z67.string().refine((value) => value.trim().length > 0, {
21204
+ var nonBlankStringSchema = z68.string().refine((value) => value.trim().length > 0, {
21104
21205
  message: "Must not be blank"
21105
21206
  });
21106
- var simpleMeasurementIdentitySchema = z67.object({
21207
+ var simpleMeasurementIdentitySchema = z68.object({
21107
21208
  // These fields intentionally preserve their stored presentation. The shared
21108
21209
  // matcher derives its normalized form separately when classifying queries.
21109
- displayName: z67.string(),
21110
- aliases: z67.array(z67.string()),
21111
- canonicalDomain: z67.string(),
21112
- ownedDomains: z67.array(z67.string()),
21210
+ displayName: z68.string(),
21211
+ aliases: z68.array(z68.string()),
21212
+ canonicalDomain: z68.string(),
21213
+ ownedDomains: z68.array(z68.string()),
21113
21214
  // Sentiment-only: the aliases the evaluator is told are this brand's own
21114
21215
  // names. Omitted when empty, so a sidecar that never opted in keeps its
21115
21216
  // checksum. No bounds or matcher rules here: a later change to the write
21116
21217
  // rules must never make a stored sidecar unreadable.
21117
- qualifiedAliases: z67.array(z67.string()).optional()
21218
+ qualifiedAliases: z68.array(z68.string()).optional()
21118
21219
  }).strict();
21119
- var simpleMeasurementEngineSchema = z67.object({
21220
+ var simpleMeasurementEngineSchema = z68.object({
21120
21221
  provider: providerNameSchema.refine((value) => value.trim().length > 0, {
21121
21222
  message: "Provider must not be blank"
21122
21223
  }),
21123
21224
  // Preserve the requested model exactly; null does not claim a served model.
21124
21225
  // A legacy empty value can resolve to an adapter default.
21125
- requestedModel: z67.string().nullable()
21226
+ requestedModel: z68.string().nullable()
21126
21227
  }).strict();
21127
- var simpleMeasurementCompetitorSchema = z67.object({
21228
+ var simpleMeasurementCompetitorSchema = z68.object({
21128
21229
  // This is a snapshot of legacy dispatch inputs, not a competitor write API.
21129
21230
  // Stored identifiers may be labels, URLs, or blank. Preserve them exactly;
21130
21231
  // readers derive hostname attribution separately when the value supports it.
21131
- domain: z67.string(),
21132
- label: z67.string(),
21133
- aliases: z67.array(z67.string())
21232
+ domain: z68.string(),
21233
+ label: z68.string(),
21234
+ aliases: z68.array(z68.string())
21134
21235
  }).strict();
21135
- var simpleMeasurementQueryInputSchema = z67.object({
21236
+ var simpleMeasurementQueryInputSchema = z68.object({
21136
21237
  queryId: nonBlankStringSchema,
21137
21238
  // The legacy runner can dispatch a stored empty query. Preserve that exact
21138
21239
  // selected input rather than making first capture change its behavior.
21139
- queryText: z67.string(),
21140
- provenance: z67.string().nullable()
21240
+ queryText: z68.string(),
21241
+ provenance: z68.string().nullable()
21141
21242
  }).strict();
21142
21243
  var simpleMeasurementQuerySchema = simpleMeasurementQueryInputSchema.extend({
21143
21244
  queryClass: queryClassSchema.nullable()
@@ -21148,7 +21249,7 @@ function addCollectionIssues(value, ctx) {
21148
21249
  const key = engine.provider.trim().toLocaleLowerCase("en");
21149
21250
  if (engineProviders.has(key)) {
21150
21251
  ctx.addIssue({
21151
- code: z67.ZodIssueCode.custom,
21252
+ code: z68.ZodIssueCode.custom,
21152
21253
  path: ["engines", index, "provider"],
21153
21254
  message: `Duplicate engine provider "${engine.provider}"`
21154
21255
  });
@@ -21159,7 +21260,7 @@ function addCollectionIssues(value, ctx) {
21159
21260
  value.queries.forEach((query, index) => {
21160
21261
  if (queryIds.has(query.queryId)) {
21161
21262
  ctx.addIssue({
21162
- code: z67.ZodIssueCode.custom,
21263
+ code: z68.ZodIssueCode.custom,
21163
21264
  path: ["queries", index, "queryId"],
21164
21265
  message: `Duplicate query id "${query.queryId}"`
21165
21266
  });
@@ -21171,7 +21272,7 @@ function addCollectionIssues(value, ctx) {
21171
21272
  const key = competitor.domain;
21172
21273
  if (competitorDomains.has(key)) {
21173
21274
  ctx.addIssue({
21174
- code: z67.ZodIssueCode.custom,
21275
+ code: z68.ZodIssueCode.custom,
21175
21276
  path: ["competitors", index, "domain"],
21176
21277
  message: `Duplicate competitor domain "${competitor.domain}"`
21177
21278
  });
@@ -21179,28 +21280,28 @@ function addCollectionIssues(value, ctx) {
21179
21280
  competitorDomains.add(key);
21180
21281
  });
21181
21282
  }
21182
- var simpleMeasurementDefinitionInputSchema = z67.object({
21183
- capturedAt: z67.string().datetime(),
21283
+ var simpleMeasurementDefinitionInputSchema = z68.object({
21284
+ capturedAt: z68.string().datetime(),
21184
21285
  identity: simpleMeasurementIdentitySchema,
21185
- country: z67.string(),
21186
- language: z67.string(),
21286
+ country: z68.string(),
21287
+ language: z68.string(),
21187
21288
  location: locationContextSchema.nullable(),
21188
- engines: z67.array(simpleMeasurementEngineSchema).min(1),
21289
+ engines: z68.array(simpleMeasurementEngineSchema).min(1),
21189
21290
  /** Missing on historical sidecars; an empty array means the captured set was intentionally empty. */
21190
- competitors: z67.array(simpleMeasurementCompetitorSchema).optional(),
21191
- queries: z67.array(simpleMeasurementQueryInputSchema)
21291
+ competitors: z68.array(simpleMeasurementCompetitorSchema).optional(),
21292
+ queries: z68.array(simpleMeasurementQueryInputSchema)
21192
21293
  }).strict().superRefine(addCollectionIssues);
21193
- var simpleMeasurementDefinitionSchema = z67.object({
21194
- schemaVersion: z67.literal(SIMPLE_MEASUREMENT_DEFINITION_SCHEMA_VERSION),
21195
- capturedAt: z67.string().datetime(),
21294
+ var simpleMeasurementDefinitionSchema = z68.object({
21295
+ schemaVersion: z68.literal(SIMPLE_MEASUREMENT_DEFINITION_SCHEMA_VERSION),
21296
+ capturedAt: z68.string().datetime(),
21196
21297
  identity: simpleMeasurementIdentitySchema,
21197
- country: z67.string(),
21198
- language: z67.string(),
21298
+ country: z68.string(),
21299
+ language: z68.string(),
21199
21300
  // Requested adapter input, not proof that the provider applied this context.
21200
21301
  location: locationContextSchema.nullable(),
21201
- engines: z67.array(simpleMeasurementEngineSchema).min(1),
21202
- competitors: z67.array(simpleMeasurementCompetitorSchema).optional(),
21203
- queries: z67.array(simpleMeasurementQuerySchema)
21302
+ engines: z68.array(simpleMeasurementEngineSchema).min(1),
21303
+ competitors: z68.array(simpleMeasurementCompetitorSchema).optional(),
21304
+ queries: z68.array(simpleMeasurementQuerySchema)
21204
21305
  }).strict().superRefine(addCollectionIssues);
21205
21306
  function simpleMeasurementCompetitorNames(competitors) {
21206
21307
  return competitors?.flatMap((competitor) => [competitor.label, ...competitor.aliases]) ?? [];
@@ -21293,21 +21394,21 @@ function canonicalSimpleMeasurementDefinitionJson(definition) {
21293
21394
  }
21294
21395
 
21295
21396
  // ../contracts/src/measurement-group-import.ts
21296
- import { z as z68 } from "zod";
21397
+ import { z as z69 } from "zod";
21297
21398
  var MEASUREMENT_GROUP_MEMBERSHIP_CSV_PARSER_VERSION = "canonry.measurement-group-membership-csv/v1";
21298
21399
  var MEASUREMENT_GROUP_MEMBERSHIP_CSV_MAX_BYTES = 1048576;
21299
21400
  var MEASUREMENT_GROUP_MEMBERSHIP_CSV_MAX_DATA_ROWS = 5e3;
21300
- var sha256HexSchema4 = z68.string().regex(/^[a-f0-9]{64}$/);
21301
- var dataRowNumberSchema = z68.number().int().positive();
21302
- var measurementDraftSegmentDescriptorSchema = z68.object({
21401
+ var sha256HexSchema4 = z69.string().regex(/^[a-f0-9]{64}$/);
21402
+ var dataRowNumberSchema = z69.number().int().positive();
21403
+ var measurementDraftSegmentDescriptorSchema = z69.object({
21303
21404
  stableKey: measurementV2StableKeySchema,
21304
- kind: z68.enum(["target", "group"]),
21305
- retiredAt: z68.string().datetime().nullable()
21405
+ kind: z69.enum(["target", "group"]),
21406
+ retiredAt: z69.string().datetime().nullable()
21306
21407
  }).strict();
21307
- var measurementDraftPreviewGroupMembershipRequestSchema = z68.object({
21308
- csv: z68.string()
21408
+ var measurementDraftPreviewGroupMembershipRequestSchema = z69.object({
21409
+ csv: z69.string()
21309
21410
  }).strict();
21310
- var measurementDraftGroupMembershipRowStatusSchema = z68.enum([
21411
+ var measurementDraftGroupMembershipRowStatusSchema = z69.enum([
21311
21412
  "matched",
21312
21413
  "ambiguous",
21313
21414
  "unmatched",
@@ -21316,7 +21417,7 @@ var measurementDraftGroupMembershipRowStatusSchema = z68.enum([
21316
21417
  "proposed",
21317
21418
  "excluded"
21318
21419
  ]);
21319
- var measurementDraftGroupMembershipRowReasonSchema = z68.enum([
21420
+ var measurementDraftGroupMembershipRowReasonSchema = z69.enum([
21320
21421
  "column-count",
21321
21422
  "missing-property",
21322
21423
  "missing-group",
@@ -21329,103 +21430,103 @@ var measurementDraftGroupMembershipRowReasonSchema = z68.enum([
21329
21430
  "group-label-ambiguous",
21330
21431
  "group-key-conflict"
21331
21432
  ]);
21332
- var rowSourceSchema = z68.object({
21433
+ var rowSourceSchema = z69.object({
21333
21434
  /** One-based logical record number after the CSV header, not a physical line number. */
21334
21435
  dataRow: dataRowNumberSchema,
21335
- property: z68.string(),
21336
- group: z68.string(),
21337
- url: z68.string().nullable(),
21338
- normalizedProperty: z68.string(),
21339
- normalizedGroupLabel: z68.string()
21436
+ property: z69.string(),
21437
+ group: z69.string(),
21438
+ url: z69.string().nullable(),
21439
+ normalizedProperty: z69.string(),
21440
+ normalizedGroupLabel: z69.string()
21340
21441
  }).strict();
21341
21442
  var rowFailureSchema = rowSourceSchema.extend({
21342
21443
  reason: measurementDraftGroupMembershipRowReasonSchema
21343
21444
  });
21344
- var measurementDraftGroupKeyConflictEvidenceSchema = z68.object({
21345
- source: z68.enum(["draft-target", "draft-group", "persisted-segment", "retired-segment", "proposed-group"]),
21445
+ var measurementDraftGroupKeyConflictEvidenceSchema = z69.object({
21446
+ source: z69.enum(["draft-target", "draft-group", "persisted-segment", "retired-segment", "proposed-group"]),
21346
21447
  stableKey: measurementV2StableKeySchema,
21347
- kind: z68.enum(["target", "group"]).optional(),
21348
- retiredAt: z68.string().datetime().nullable().optional(),
21349
- normalizedGroupLabel: z68.string().optional()
21448
+ kind: z69.enum(["target", "group"]).optional(),
21449
+ retiredAt: z69.string().datetime().nullable().optional(),
21450
+ normalizedGroupLabel: z69.string().optional()
21350
21451
  }).strict();
21351
- var measurementDraftGroupKeyConflictSchema = z68.object({
21452
+ var measurementDraftGroupKeyConflictSchema = z69.object({
21352
21453
  proposedGroupKey: measurementV2StableKeySchema,
21353
- evidence: z68.array(measurementDraftGroupKeyConflictEvidenceSchema).min(1)
21454
+ evidence: z69.array(measurementDraftGroupKeyConflictEvidenceSchema).min(1)
21354
21455
  }).strict();
21355
- var measurementDraftGroupMembershipRowSchema = z68.discriminatedUnion("status", [
21456
+ var measurementDraftGroupMembershipRowSchema = z69.discriminatedUnion("status", [
21356
21457
  rowSourceSchema.extend({
21357
- status: z68.literal("matched"),
21458
+ status: z69.literal("matched"),
21358
21459
  targetKey: measurementV2StableKeySchema,
21359
21460
  groupKey: measurementV2StableKeySchema
21360
21461
  }).strict(),
21361
21462
  rowFailureSchema.extend({
21362
- status: z68.literal("ambiguous"),
21363
- candidateTargetKeys: z68.array(measurementV2StableKeySchema).min(1).optional(),
21364
- candidateGroupKeys: z68.array(measurementV2StableKeySchema).min(1).optional()
21463
+ status: z69.literal("ambiguous"),
21464
+ candidateTargetKeys: z69.array(measurementV2StableKeySchema).min(1).optional(),
21465
+ candidateGroupKeys: z69.array(measurementV2StableKeySchema).min(1).optional()
21365
21466
  }).strict(),
21366
21467
  rowFailureSchema.extend({
21367
- status: z68.literal("unmatched")
21468
+ status: z69.literal("unmatched")
21368
21469
  }).strict(),
21369
21470
  rowFailureSchema.extend({
21370
- status: z68.literal("invalid"),
21471
+ status: z69.literal("invalid"),
21371
21472
  groupKeyConflict: measurementDraftGroupKeyConflictSchema.optional()
21372
21473
  }).strict(),
21373
21474
  rowSourceSchema.extend({
21374
- status: z68.literal("duplicate"),
21475
+ status: z69.literal("duplicate"),
21375
21476
  duplicateOfRow: dataRowNumberSchema,
21376
21477
  targetKey: measurementV2StableKeySchema,
21377
21478
  groupKey: measurementV2StableKeySchema
21378
21479
  }).strict(),
21379
21480
  rowFailureSchema.extend({
21380
- status: z68.literal("proposed"),
21481
+ status: z69.literal("proposed"),
21381
21482
  targetKey: measurementV2StableKeySchema
21382
21483
  }).strict(),
21383
21484
  rowFailureSchema.extend({
21384
- status: z68.literal("excluded"),
21485
+ status: z69.literal("excluded"),
21385
21486
  targetKey: measurementV2StableKeySchema
21386
21487
  }).strict()
21387
21488
  ]);
21388
- var measurementDraftGroupMembershipChangeSchema = z68.object({
21389
- normalizedGroupLabel: z68.string(),
21489
+ var measurementDraftGroupMembershipChangeSchema = z69.object({
21490
+ normalizedGroupLabel: z69.string(),
21390
21491
  groupKey: measurementV2StableKeySchema,
21391
- label: z68.string().trim().min(1),
21392
- action: z68.enum(["create", "extend"]),
21393
- matchedRows: z68.array(dataRowNumberSchema),
21394
- targetKeys: z68.array(measurementV2StableKeySchema),
21395
- addedTargetKeys: z68.array(measurementV2StableKeySchema),
21396
- unchangedTargetKeys: z68.array(measurementV2StableKeySchema)
21397
- }).strict();
21398
- var measurementDraftGroupMembershipImportCountsSchema = z68.object({
21399
- dataRows: z68.number().int().nonnegative(),
21400
- matchedRows: z68.number().int().nonnegative(),
21401
- ambiguousRows: z68.number().int().nonnegative(),
21402
- unmatchedRows: z68.number().int().nonnegative(),
21403
- invalidRows: z68.number().int().nonnegative(),
21404
- duplicateRows: z68.number().int().nonnegative(),
21405
- proposedRows: z68.number().int().nonnegative(),
21406
- excludedRows: z68.number().int().nonnegative(),
21492
+ label: z69.string().trim().min(1),
21493
+ action: z69.enum(["create", "extend"]),
21494
+ matchedRows: z69.array(dataRowNumberSchema),
21495
+ targetKeys: z69.array(measurementV2StableKeySchema),
21496
+ addedTargetKeys: z69.array(measurementV2StableKeySchema),
21497
+ unchangedTargetKeys: z69.array(measurementV2StableKeySchema)
21498
+ }).strict();
21499
+ var measurementDraftGroupMembershipImportCountsSchema = z69.object({
21500
+ dataRows: z69.number().int().nonnegative(),
21501
+ matchedRows: z69.number().int().nonnegative(),
21502
+ ambiguousRows: z69.number().int().nonnegative(),
21503
+ unmatchedRows: z69.number().int().nonnegative(),
21504
+ invalidRows: z69.number().int().nonnegative(),
21505
+ duplicateRows: z69.number().int().nonnegative(),
21506
+ proposedRows: z69.number().int().nonnegative(),
21507
+ excludedRows: z69.number().int().nonnegative(),
21407
21508
  /** Rows that cannot be committed without correcting the draft or source. */
21408
- needsAttention: z68.number().int().nonnegative(),
21409
- groupsReady: z68.number().int().nonnegative(),
21410
- groupsToCreate: z68.number().int().nonnegative(),
21411
- groupsToExtend: z68.number().int().nonnegative(),
21412
- membershipsReady: z68.number().int().nonnegative(),
21413
- addedMemberships: z68.number().int().nonnegative(),
21414
- unchangedMemberships: z68.number().int().nonnegative()
21415
- }).strict();
21416
- var measurementDraftPreviewGroupMembershipResponseSchema = z68.object({
21417
- draftEtag: z68.string().trim().min(1),
21509
+ needsAttention: z69.number().int().nonnegative(),
21510
+ groupsReady: z69.number().int().nonnegative(),
21511
+ groupsToCreate: z69.number().int().nonnegative(),
21512
+ groupsToExtend: z69.number().int().nonnegative(),
21513
+ membershipsReady: z69.number().int().nonnegative(),
21514
+ addedMemberships: z69.number().int().nonnegative(),
21515
+ unchangedMemberships: z69.number().int().nonnegative()
21516
+ }).strict();
21517
+ var measurementDraftPreviewGroupMembershipResponseSchema = z69.object({
21518
+ draftEtag: z69.string().trim().min(1),
21418
21519
  sourceChecksum: sha256HexSchema4,
21419
21520
  previewChecksum: sha256HexSchema4,
21420
- rows: z68.array(measurementDraftGroupMembershipRowSchema),
21421
- groupChanges: z68.array(measurementDraftGroupMembershipChangeSchema),
21521
+ rows: z69.array(measurementDraftGroupMembershipRowSchema),
21522
+ groupChanges: z69.array(measurementDraftGroupMembershipChangeSchema),
21422
21523
  counts: measurementDraftGroupMembershipImportCountsSchema
21423
21524
  }).strict();
21424
- var measurementDraftApplyGroupMembershipRequestSchema = z68.object({
21425
- csv: z68.string(),
21525
+ var measurementDraftApplyGroupMembershipRequestSchema = z69.object({
21526
+ csv: z69.string(),
21426
21527
  sourceChecksum: sha256HexSchema4,
21427
21528
  previewChecksum: sha256HexSchema4,
21428
- acceptedRows: z68.array(dataRowNumberSchema).min(1)
21529
+ acceptedRows: z69.array(dataRowNumberSchema).min(1)
21429
21530
  }).strict().superRefine((value, context) => {
21430
21531
  if (new Set(value.acceptedRows).size === value.acceptedRows.length) return;
21431
21532
  context.addIssue({
@@ -21436,9 +21537,9 @@ var measurementDraftApplyGroupMembershipRequestSchema = z68.object({
21436
21537
  });
21437
21538
  var measurementDraftApplyGroupMembershipResponseSchema = measurementDraftMutationResponseSchema.extend({
21438
21539
  /** Accepted matched CSV records, including records whose membership was already present. */
21439
- appliedRows: z68.number().int().nonnegative(),
21440
- addedMemberships: z68.number().int().nonnegative(),
21441
- unchangedMemberships: z68.number().int().nonnegative()
21540
+ appliedRows: z69.number().int().nonnegative(),
21541
+ addedMemberships: z69.number().int().nonnegative(),
21542
+ unchangedMemberships: z69.number().int().nonnegative()
21442
21543
  }).strict();
21443
21544
 
21444
21545
  // ../contracts/src/measurement-target-names.ts
@@ -21493,44 +21594,44 @@ function measurementTargetNameIssueMessage(issue) {
21493
21594
  }
21494
21595
 
21495
21596
  // ../contracts/src/google.ts
21496
- import { z as z69 } from "zod";
21497
- var googleConnectionTypeSchema = z69.enum(["gsc", "ga4", "gbp"]);
21498
- var googleConnectionDtoSchema = z69.object({
21499
- id: z69.string(),
21500
- domain: z69.string(),
21597
+ import { z as z70 } from "zod";
21598
+ var googleConnectionTypeSchema = z70.enum(["gsc", "ga4", "gbp"]);
21599
+ var googleConnectionDtoSchema = z70.object({
21600
+ id: z70.string(),
21601
+ domain: z70.string(),
21501
21602
  connectionType: googleConnectionTypeSchema,
21502
- propertyId: z69.string().nullable().optional(),
21503
- sitemapUrl: z69.string().nullable().optional(),
21504
- scopes: z69.array(z69.string()).default([]),
21505
- createdAt: z69.string(),
21506
- updatedAt: z69.string()
21507
- });
21508
- var googleOAuthStartResponseSchema = z69.object({
21509
- authUrl: z69.string().url(),
21510
- redirectUri: z69.string().url()
21511
- }).strict();
21512
- var gscSearchDataDtoSchema = z69.object({
21513
- date: z69.string(),
21514
- query: z69.string(),
21515
- page: z69.string(),
21516
- country: z69.string().nullable().optional(),
21517
- device: z69.string().nullable().optional(),
21518
- clicks: z69.number(),
21519
- impressions: z69.number(),
21603
+ propertyId: z70.string().nullable().optional(),
21604
+ sitemapUrl: z70.string().nullable().optional(),
21605
+ scopes: z70.array(z70.string()).default([]),
21606
+ createdAt: z70.string(),
21607
+ updatedAt: z70.string()
21608
+ });
21609
+ var googleOAuthStartResponseSchema = z70.object({
21610
+ authUrl: z70.string().url(),
21611
+ redirectUri: z70.string().url()
21612
+ }).strict();
21613
+ var gscSearchDataDtoSchema = z70.object({
21614
+ date: z70.string(),
21615
+ query: z70.string(),
21616
+ page: z70.string(),
21617
+ country: z70.string().nullable().optional(),
21618
+ device: z70.string().nullable().optional(),
21619
+ clicks: z70.number(),
21620
+ impressions: z70.number(),
21520
21621
  ctr: fraction(),
21521
- position: z69.number()
21522
- });
21523
- var gscPerformanceOrderBySchema = z69.enum(["clicks", "impressions", "date"]);
21524
- var gscPerformanceResponseDtoSchema = z69.object({
21525
- rows: z69.array(gscSearchDataDtoSchema),
21526
- totalMatching: z69.number(),
21527
- truncated: z69.boolean(),
21528
- latestAvailableDate: z69.string().nullable()
21529
- });
21530
- var gscPerformanceDailyPointSchema = z69.object({
21531
- date: z69.string(),
21532
- clicks: z69.number(),
21533
- impressions: z69.number(),
21622
+ position: z70.number()
21623
+ });
21624
+ var gscPerformanceOrderBySchema = z70.enum(["clicks", "impressions", "date"]);
21625
+ var gscPerformanceResponseDtoSchema = z70.object({
21626
+ rows: z70.array(gscSearchDataDtoSchema),
21627
+ totalMatching: z70.number(),
21628
+ truncated: z70.boolean(),
21629
+ latestAvailableDate: z70.string().nullable()
21630
+ });
21631
+ var gscPerformanceDailyPointSchema = z70.object({
21632
+ date: z70.string(),
21633
+ clicks: z70.number(),
21634
+ impressions: z70.number(),
21534
21635
  ctr: fraction(),
21535
21636
  /**
21536
21637
  * Average ranking position for the day, or `null` on a date served by the
@@ -21539,15 +21640,15 @@ var gscPerformanceDailyPointSchema = z69.object({
21539
21640
  * absence is reported rather than a fabricated `0` — which would also read as
21540
21641
  * an impossibly good rank on a chart with an inverted axis.
21541
21642
  */
21542
- position: z69.number().nullable()
21643
+ position: z70.number().nullable()
21543
21644
  });
21544
- var gscWindowRangeSchema = z69.object({
21645
+ var gscWindowRangeSchema = z70.object({
21545
21646
  /** Inclusive lower bound, or `null` for the `all` window. */
21546
- startDate: z69.string().nullable(),
21647
+ startDate: z70.string().nullable(),
21547
21648
  /** Inclusive upper bound: the last date the property published. */
21548
- endDate: z69.string().nullable(),
21649
+ endDate: z70.string().nullable(),
21549
21650
  /** `MAX(date)` across the project's GSC data, ignoring the window. */
21550
- latestDataDate: z69.string().nullable(),
21651
+ latestDataDate: z70.string().nullable(),
21551
21652
  /**
21552
21653
  * Calendar days since the last day with recorded traffic, on GSC's Pacific
21553
21654
  * calendar. `null` with no data.
@@ -21557,37 +21658,37 @@ var gscWindowRangeSchema = z69.object({
21557
21658
  * number. Render it as "data through <endDate>", never as "Search Console is
21558
21659
  * N days behind".
21559
21660
  */
21560
- daysSinceLatestData: z69.number().nullable()
21661
+ daysSinceLatestData: z70.number().nullable()
21561
21662
  });
21562
- var gscPerformanceTrendsSchema = z69.object({
21663
+ var gscPerformanceTrendsSchema = z70.object({
21563
21664
  clicks: linearTrendSchema.nullable(),
21564
21665
  impressions: linearTrendSchema.nullable(),
21565
21666
  ctr: linearTrendSchema.nullable(),
21566
21667
  position: linearTrendSchema.nullable()
21567
21668
  });
21568
- var gscPeriodTotalsSchema = z69.object({
21569
- startDate: z69.string(),
21570
- endDate: z69.string(),
21571
- clicks: z69.number(),
21572
- impressions: z69.number(),
21669
+ var gscPeriodTotalsSchema = z70.object({
21670
+ startDate: z70.string(),
21671
+ endDate: z70.string(),
21672
+ clicks: z70.number(),
21673
+ impressions: z70.number(),
21573
21674
  /** The period's own `clicks / impressions`, never a mean of daily ratios. */
21574
21675
  ctr: fraction().nullable(),
21575
21676
  /** Impression-weighted mean position, or null when no day carried one. */
21576
- position: z69.number().nullable(),
21677
+ position: z70.number().nullable(),
21577
21678
  /**
21578
21679
  * Which table the figures came from. `gsc_daily_totals` (property-daily) and
21579
21680
  * `SUM(gsc_search_data)` (dimensioned) are not interchangeable: on one real
21580
21681
  * property-month the same period reads 1,142 clicks / 34,916 impressions from
21581
21682
  * the first and 792 / 45,266 from the second.
21582
21683
  */
21583
- source: z69.enum(["property-daily", "dimensioned", "mixed", "empty"])
21684
+ source: z70.enum(["property-daily", "dimensioned", "mixed", "empty"])
21584
21685
  });
21585
- var gscPeriodComparisonSchema = z69.object({
21686
+ var gscPeriodComparisonSchema = z70.object({
21586
21687
  /**
21587
21688
  * Length of EACH period in calendar days. Equals the selected window under
21588
21689
  * `basis: 'prior-window'`, and half of it under `basis: 'split-window'`.
21589
21690
  */
21590
- days: z69.number(),
21691
+ days: z70.number(),
21591
21692
  /**
21592
21693
  * Which two periods these are, so a surface can say what it is showing.
21593
21694
  *
@@ -21609,7 +21710,7 @@ var gscPeriodComparisonSchema = z69.object({
21609
21710
  * split the window, but a surface should render the absence with its
21610
21711
  * period-length copy rather than assert a basis nobody sent.
21611
21712
  */
21612
- basis: z69.enum(["prior-window", "split-window"]).optional(),
21713
+ basis: z70.enum(["prior-window", "split-window"]).optional(),
21613
21714
  prior: gscPeriodTotalsSchema,
21614
21715
  trailing: gscPeriodTotalsSchema,
21615
21716
  /**
@@ -21617,24 +21718,24 @@ var gscPeriodComparisonSchema = z69.object({
21617
21718
  * case every `change` is null. Empty/property-daily halves are comparable;
21618
21719
  * `SUM(gsc_search_data)` is never valid for property totals.
21619
21720
  */
21620
- comparable: z69.boolean(),
21721
+ comparable: z70.boolean(),
21621
21722
  /**
21622
21723
  * Relative change as a ratio (0.5 = +50%), null where the prior period gives
21623
21724
  * nothing to divide by or the trailing metric is unavailable. The sign is
21624
21725
  * mathematical: a POSITIVE `position` means the rank number rose, which is
21625
21726
  * worse. Desirability is the renderer's call.
21626
21727
  */
21627
- change: z69.object({
21728
+ change: z70.object({
21628
21729
  clicks: fraction().nullable(),
21629
21730
  impressions: fraction().nullable(),
21630
21731
  ctr: fraction().nullable(),
21631
21732
  position: fraction().nullable()
21632
21733
  })
21633
21734
  });
21634
- var gscPerformanceDailyDtoSchema = z69.object({
21635
- totals: z69.object({
21636
- clicks: z69.number(),
21637
- impressions: z69.number(),
21735
+ var gscPerformanceDailyDtoSchema = z70.object({
21736
+ totals: z70.object({
21737
+ clicks: z70.number(),
21738
+ impressions: z70.number(),
21638
21739
  ctr: fraction(),
21639
21740
  /**
21640
21741
  * Impression-weighted mean position over the window, or `null` when no day
@@ -21642,15 +21743,15 @@ var gscPerformanceDailyDtoSchema = z69.object({
21642
21743
  * daily values: position is non-additive, and an unweighted mean lets a
21643
21744
  * one-impression day count as much as a thousand-impression day.
21644
21745
  */
21645
- position: z69.number().nullable(),
21746
+ position: z70.number().nullable(),
21646
21747
  /**
21647
21748
  * Days that carried a property-level position. Below `days`, `position`
21648
21749
  * describes a subset of the window and must be labelled as partial.
21649
21750
  */
21650
- positionDays: z69.number(),
21651
- days: z69.number()
21751
+ positionDays: z70.number(),
21752
+ days: z70.number()
21652
21753
  }),
21653
- daily: z69.array(gscPerformanceDailyPointSchema),
21754
+ daily: z70.array(gscPerformanceDailyPointSchema),
21654
21755
  /**
21655
21756
  * Optional because a server older than this field omits it. Both the web and
21656
21757
  * the CLI guard for that skew; declaring it required here would tell a
@@ -21671,23 +21772,23 @@ var gscPerformanceDailyDtoSchema = z69.object({
21671
21772
  */
21672
21773
  periodComparison: gscPeriodComparisonSchema.nullable().optional()
21673
21774
  });
21674
- var gscTopPageRowSchema = z69.object({
21675
- page: z69.string(),
21676
- clicks: z69.number(),
21677
- impressions: z69.number(),
21775
+ var gscTopPageRowSchema = z70.object({
21776
+ page: z70.string(),
21777
+ clicks: z70.number(),
21778
+ impressions: z70.number(),
21678
21779
  ctr: fraction()
21679
21780
  });
21680
- var gscTopPagesDtoSchema = z69.object({
21681
- rows: z69.array(gscTopPageRowSchema),
21682
- totals: z69.object({
21683
- clicks: z69.number(),
21684
- impressions: z69.number(),
21781
+ var gscTopPagesDtoSchema = z70.object({
21782
+ rows: z70.array(gscTopPageRowSchema),
21783
+ totals: z70.object({
21784
+ clicks: z70.number(),
21785
+ impressions: z70.number(),
21685
21786
  ctr: fraction(),
21686
- days: z69.number(),
21787
+ days: z70.number(),
21687
21788
  /** First date the property-level totals actually cover. */
21688
- coveredFrom: z69.string().nullable(),
21789
+ coveredFrom: z70.string().nullable(),
21689
21790
  /** Last date the property-level totals actually cover. */
21690
- coveredThrough: z69.string().nullable(),
21791
+ coveredThrough: z70.string().nullable(),
21691
21792
  /**
21692
21793
  * False when the totals span less than the ranked rows above.
21693
21794
  *
@@ -21695,19 +21796,19 @@ var gscTopPagesDtoSchema = z69.object({
21695
21796
  * 30-day totals sync can sit next to months of dimensioned rows. Printing
21696
21797
  * both as one period would misstate the window the totals belong to.
21697
21798
  */
21698
- complete: z69.boolean()
21799
+ complete: z70.boolean()
21699
21800
  }).nullable(),
21700
- totalsSource: z69.literal("property-daily"),
21801
+ totalsSource: z70.literal("property-daily"),
21701
21802
  /** First date the ranked rows cover, so a caller can compare spans. */
21702
- rankedFrom: z69.string().nullable(),
21803
+ rankedFrom: z70.string().nullable(),
21703
21804
  /** Last date the ranked rows cover. */
21704
- rankedThrough: z69.string().nullable()
21805
+ rankedThrough: z70.string().nullable()
21705
21806
  });
21706
- var gscQueryTotalsSourceSchema = z69.enum(["google", "page-summed", "mixed"]);
21707
- var gscQueryTotalRowSchema = z69.object({
21708
- query: z69.string(),
21709
- clicks: z69.number(),
21710
- impressions: z69.number(),
21807
+ var gscQueryTotalsSourceSchema = z70.enum(["google", "page-summed", "mixed"]);
21808
+ var gscQueryTotalRowSchema = z70.object({
21809
+ query: z70.string(),
21810
+ clicks: z70.number(),
21811
+ impressions: z70.number(),
21711
21812
  /** clicks / impressions as a 0..1 fraction, 0 when impressions are 0. */
21712
21813
  ctr: fraction(),
21713
21814
  /**
@@ -21715,15 +21816,15 @@ var gscQueryTotalRowSchema = z69.object({
21715
21816
  * sum(position * impressions) / sum(impressions). When the query has no
21716
21817
  * impressions in the window, the plain mean of its daily positions.
21717
21818
  */
21718
- position: z69.number(),
21819
+ position: z70.number(),
21719
21820
  /** Distinct dates the query appeared on in the window. */
21720
- days: z69.number(),
21821
+ days: z70.number(),
21721
21822
  source: gscQueryTotalsSourceSchema
21722
21823
  });
21723
- var gscQueryTotalsDtoSchema = z69.object({
21724
- rows: z69.array(gscQueryTotalRowSchema),
21725
- totalMatching: z69.number(),
21726
- truncated: z69.boolean(),
21824
+ var gscQueryTotalsDtoSchema = z70.object({
21825
+ rows: z70.array(gscQueryTotalRowSchema),
21826
+ totalMatching: z70.number(),
21827
+ truncated: z70.boolean(),
21727
21828
  /**
21728
21829
  * The range the rows were read from, exactly. Explicit dates win; a labelled
21729
21830
  * window paired with only `endDate` spans that many days ending on it. A
@@ -21741,49 +21842,49 @@ var gscQueryTotalsDtoSchema = z69.object({
21741
21842
  * omits it, which means coverage is unknown, not that no rows are stored.
21742
21843
  * This route always sends it.
21743
21844
  */
21744
- earliestDataDate: z69.string().nullable().optional()
21845
+ earliestDataDate: z70.string().nullable().optional()
21745
21846
  })
21746
21847
  });
21747
- var gscUrlInspectionDtoSchema = z69.object({
21748
- id: z69.string(),
21749
- url: z69.string(),
21750
- indexingState: z69.string().nullable().optional(),
21751
- verdict: z69.string().nullable().optional(),
21752
- coverageState: z69.string().nullable().optional(),
21753
- pageFetchState: z69.string().nullable().optional(),
21754
- robotsTxtState: z69.string().nullable().optional(),
21755
- crawlTime: z69.string().nullable().optional(),
21756
- lastCrawlResult: z69.string().nullable().optional(),
21757
- isMobileFriendly: z69.boolean().nullable().optional(),
21758
- richResults: z69.array(z69.string()).default([]),
21848
+ var gscUrlInspectionDtoSchema = z70.object({
21849
+ id: z70.string(),
21850
+ url: z70.string(),
21851
+ indexingState: z70.string().nullable().optional(),
21852
+ verdict: z70.string().nullable().optional(),
21853
+ coverageState: z70.string().nullable().optional(),
21854
+ pageFetchState: z70.string().nullable().optional(),
21855
+ robotsTxtState: z70.string().nullable().optional(),
21856
+ crawlTime: z70.string().nullable().optional(),
21857
+ lastCrawlResult: z70.string().nullable().optional(),
21858
+ isMobileFriendly: z70.boolean().nullable().optional(),
21859
+ richResults: z70.array(z70.string()).default([]),
21759
21860
  // Spec gap: server has returned `referringUrls` since the GSC inspect
21760
21861
  // route shipped (see google.ts handler at /gsc/inspect + /gsc/inspections),
21761
21862
  // but the schema dropped the field so the generated TS client (and
21762
21863
  // anything else reading from this DTO) lost the data silently. Adding
21763
21864
  // here restores end-to-end visibility.
21764
- referringUrls: z69.array(z69.string()).default([]),
21765
- inspectedAt: z69.string()
21766
- });
21767
- var indexTransitionSchema = z69.enum(["stable", "reindexed", "deindexed", "still-missing", "new"]);
21768
- var gscDeindexedRowSchema = z69.object({
21769
- url: z69.string(),
21770
- previousState: z69.string().nullable(),
21771
- currentState: z69.string().nullable(),
21772
- transitionDate: z69.string()
21773
- });
21774
- var gscReasonGroupSchema = z69.object({
21775
- reason: z69.string(),
21776
- count: z69.number(),
21777
- urls: z69.array(gscUrlInspectionDtoSchema).default([])
21778
- });
21779
- var gscCoverageSummaryDtoSchema = z69.object({
21780
- summary: z69.object({
21865
+ referringUrls: z70.array(z70.string()).default([]),
21866
+ inspectedAt: z70.string()
21867
+ });
21868
+ var indexTransitionSchema = z70.enum(["stable", "reindexed", "deindexed", "still-missing", "new"]);
21869
+ var gscDeindexedRowSchema = z70.object({
21870
+ url: z70.string(),
21871
+ previousState: z70.string().nullable(),
21872
+ currentState: z70.string().nullable(),
21873
+ transitionDate: z70.string()
21874
+ });
21875
+ var gscReasonGroupSchema = z70.object({
21876
+ reason: z70.string(),
21877
+ count: z70.number(),
21878
+ urls: z70.array(gscUrlInspectionDtoSchema).default([])
21879
+ });
21880
+ var gscCoverageSummaryDtoSchema = z70.object({
21881
+ summary: z70.object({
21781
21882
  /** Inspected pages, each in exactly one of `indexed` / `notIndexed`. */
21782
- total: z69.number(),
21783
- indexed: z69.number(),
21784
- notIndexed: z69.number(),
21883
+ total: z70.number(),
21884
+ indexed: z70.number(),
21885
+ notIndexed: z70.number(),
21785
21886
  /** Pages whose latest inspection lost the indexed state of the one before it. */
21786
- deindexed: z69.number(),
21887
+ deindexed: z70.number(),
21787
21888
  /** `indexed / total` as a 0..100 percent rounded to one decimal; 0 when nothing was inspected. */
21788
21889
  percentage: percent(),
21789
21890
  /**
@@ -21791,92 +21892,92 @@ var gscCoverageSummaryDtoSchema = z69.object({
21791
21892
  * full coverage still reads short of 100%. Null when nothing was
21792
21893
  * inspected: an empty site has no coverage share, not a 0% one.
21793
21894
  */
21794
- indexedShare: fraction(z69.number().min(0).max(1)).nullable(),
21895
+ indexedShare: fraction(z70.number().min(0).max(1)).nullable(),
21795
21896
  /** `notIndexed / total`, 0..1. With `indexedShare` it sums to 1. Null when nothing was inspected. */
21796
- notIndexedShare: fraction(z69.number().min(0).max(1)).nullable()
21897
+ notIndexedShare: fraction(z70.number().min(0).max(1)).nullable()
21797
21898
  }),
21798
- lastInspectedAt: z69.string().nullable(),
21799
- lastSyncedAt: z69.string().nullable(),
21800
- indexed: z69.array(gscUrlInspectionDtoSchema).default([]),
21801
- notIndexed: z69.array(gscUrlInspectionDtoSchema).default([]),
21802
- deindexed: z69.array(gscDeindexedRowSchema).default([]),
21803
- reasonGroups: z69.array(gscReasonGroupSchema).default([])
21804
- });
21805
- var indexingNotificationDtoSchema = z69.object({
21806
- url: z69.string(),
21807
- type: z69.enum(["URL_UPDATED", "URL_DELETED"]),
21808
- notifiedAt: z69.string()
21809
- });
21810
- var indexingRequestResultDtoSchema = z69.object({
21811
- url: z69.string(),
21812
- type: z69.enum(["URL_UPDATED", "URL_DELETED"]),
21813
- notifiedAt: z69.string(),
21814
- status: z69.enum(["success", "error"]),
21815
- error: z69.string().optional()
21816
- });
21817
- var indexingRequestResponseDtoSchema = z69.object({
21818
- summary: z69.object({
21819
- total: z69.number().int().nonnegative(),
21820
- succeeded: z69.number().int().nonnegative(),
21821
- failed: z69.number().int().nonnegative()
21899
+ lastInspectedAt: z70.string().nullable(),
21900
+ lastSyncedAt: z70.string().nullable(),
21901
+ indexed: z70.array(gscUrlInspectionDtoSchema).default([]),
21902
+ notIndexed: z70.array(gscUrlInspectionDtoSchema).default([]),
21903
+ deindexed: z70.array(gscDeindexedRowSchema).default([]),
21904
+ reasonGroups: z70.array(gscReasonGroupSchema).default([])
21905
+ });
21906
+ var indexingNotificationDtoSchema = z70.object({
21907
+ url: z70.string(),
21908
+ type: z70.enum(["URL_UPDATED", "URL_DELETED"]),
21909
+ notifiedAt: z70.string()
21910
+ });
21911
+ var indexingRequestResultDtoSchema = z70.object({
21912
+ url: z70.string(),
21913
+ type: z70.enum(["URL_UPDATED", "URL_DELETED"]),
21914
+ notifiedAt: z70.string(),
21915
+ status: z70.enum(["success", "error"]),
21916
+ error: z70.string().optional()
21917
+ });
21918
+ var indexingRequestResponseDtoSchema = z70.object({
21919
+ summary: z70.object({
21920
+ total: z70.number().int().nonnegative(),
21921
+ succeeded: z70.number().int().nonnegative(),
21922
+ failed: z70.number().int().nonnegative()
21822
21923
  }),
21823
- results: z69.array(indexingRequestResultDtoSchema).default([])
21924
+ results: z70.array(indexingRequestResultDtoSchema).default([])
21824
21925
  });
21825
- var gscCoverageSnapshotDtoSchema = z69.object({
21826
- date: z69.string(),
21827
- indexed: z69.number(),
21828
- notIndexed: z69.number(),
21926
+ var gscCoverageSnapshotDtoSchema = z70.object({
21927
+ date: z70.string(),
21928
+ indexed: z70.number(),
21929
+ notIndexed: z70.number(),
21829
21930
  /**
21830
21931
  * Pages with no evidence either way — no impressions in the window and never
21831
21932
  * inspected. Deliberately NOT folded into `notIndexed`: absence of
21832
21933
  * impressions is not evidence of exclusion, and merging the two would report
21833
21934
  * every unmeasured page as a problem.
21834
21935
  */
21835
- unknownPages: z69.number().default(0),
21936
+ unknownPages: z70.number().default(0),
21836
21937
  /** Of the total, how many carry a real URL Inspection verdict. */
21837
- verifiedByInspection: z69.number().default(0),
21938
+ verifiedByInspection: z70.number().default(0),
21838
21939
  /** Pages proven indexed by impressions alone, costing no inspection quota. */
21839
- derivedFromImpressions: z69.number().default(0),
21840
- reasonBreakdown: z69.record(z69.string(), z69.number()).default({})
21940
+ derivedFromImpressions: z70.number().default(0),
21941
+ reasonBreakdown: z70.record(z70.string(), z70.number()).default({})
21841
21942
  });
21842
- var gscSiteDtoSchema = z69.object({
21843
- siteUrl: z69.string(),
21844
- permissionLevel: z69.string()
21943
+ var gscSiteDtoSchema = z70.object({
21944
+ siteUrl: z70.string(),
21945
+ permissionLevel: z70.string()
21845
21946
  });
21846
- var gscSiteListResponseDtoSchema = z69.object({
21847
- sites: z69.array(gscSiteDtoSchema).default([])
21947
+ var gscSiteListResponseDtoSchema = z70.object({
21948
+ sites: z70.array(gscSiteDtoSchema).default([])
21848
21949
  });
21849
- var gscSitemapContentDtoSchema = z69.object({
21850
- type: z69.string(),
21851
- submitted: z69.string(),
21950
+ var gscSitemapContentDtoSchema = z70.object({
21951
+ type: z70.string(),
21952
+ submitted: z70.string(),
21852
21953
  // Google still returns this for existing sitemap reads, but it is not a
21853
21954
  // reliable submission outcome. Retained only for response compatibility.
21854
- indexed: z69.string().optional().describe("Deprecated compatibility field.")
21855
- });
21856
- var gscSitemapDtoSchema = z69.object({
21857
- path: z69.string(),
21858
- parentSitemapUrl: z69.string().optional(),
21859
- lastSubmitted: z69.string().optional(),
21860
- isPending: z69.boolean().optional(),
21861
- isSitemapsIndex: z69.boolean().optional(),
21862
- type: z69.string().optional(),
21863
- lastDownloaded: z69.string().optional(),
21864
- warnings: z69.string().optional(),
21865
- errors: z69.string().optional(),
21866
- contents: z69.array(gscSitemapContentDtoSchema).optional()
21867
- });
21868
- var gscSitemapListResponseDtoSchema = z69.object({
21869
- sitemaps: z69.array(gscSitemapDtoSchema).default([]),
21870
- summary: z69.object({
21871
- total: z69.number().int().nonnegative(),
21872
- indexes: z69.number().int().nonnegative(),
21873
- files: z69.number().int().nonnegative()
21955
+ indexed: z70.string().optional().describe("Deprecated compatibility field.")
21956
+ });
21957
+ var gscSitemapDtoSchema = z70.object({
21958
+ path: z70.string(),
21959
+ parentSitemapUrl: z70.string().optional(),
21960
+ lastSubmitted: z70.string().optional(),
21961
+ isPending: z70.boolean().optional(),
21962
+ isSitemapsIndex: z70.boolean().optional(),
21963
+ type: z70.string().optional(),
21964
+ lastDownloaded: z70.string().optional(),
21965
+ warnings: z70.string().optional(),
21966
+ errors: z70.string().optional(),
21967
+ contents: z70.array(gscSitemapContentDtoSchema).optional()
21968
+ });
21969
+ var gscSitemapListResponseDtoSchema = z70.object({
21970
+ sitemaps: z70.array(gscSitemapDtoSchema).default([]),
21971
+ summary: z70.object({
21972
+ total: z70.number().int().nonnegative(),
21973
+ indexes: z70.number().int().nonnegative(),
21974
+ files: z70.number().int().nonnegative()
21874
21975
  }),
21875
- preferredSubmissionUrls: z69.array(z69.string()).default([])
21976
+ preferredSubmissionUrls: z70.array(z70.string()).default([])
21876
21977
  });
21877
- var gscSubmitSitemapsRequestDtoSchema = z69.object({
21878
- sitemapUrls: z69.array(
21879
- z69.string().url().refine(
21978
+ var gscSubmitSitemapsRequestDtoSchema = z70.object({
21979
+ sitemapUrls: z70.array(
21980
+ z70.string().url().refine(
21880
21981
  (value) => {
21881
21982
  const protocol = new URL(value).protocol;
21882
21983
  return protocol === "http:" || protocol === "https:";
@@ -21885,30 +21986,30 @@ var gscSubmitSitemapsRequestDtoSchema = z69.object({
21885
21986
  )
21886
21987
  ).min(1).max(50)
21887
21988
  });
21888
- var gscSubmitSitemapResultDtoSchema = z69.object({
21889
- sitemapUrl: z69.string(),
21890
- status: z69.enum(["accepted", "error"]),
21891
- submittedAt: z69.string().optional(),
21892
- error: z69.string().optional()
21893
- });
21894
- var gscSubmitSitemapsResponseDtoSchema = z69.object({
21895
- summary: z69.object({
21896
- total: z69.number().int().nonnegative(),
21897
- accepted: z69.number().int().nonnegative(),
21898
- failed: z69.number().int().nonnegative()
21989
+ var gscSubmitSitemapResultDtoSchema = z70.object({
21990
+ sitemapUrl: z70.string(),
21991
+ status: z70.enum(["accepted", "error"]),
21992
+ submittedAt: z70.string().optional(),
21993
+ error: z70.string().optional()
21994
+ });
21995
+ var gscSubmitSitemapsResponseDtoSchema = z70.object({
21996
+ summary: z70.object({
21997
+ total: z70.number().int().nonnegative(),
21998
+ accepted: z70.number().int().nonnegative(),
21999
+ failed: z70.number().int().nonnegative()
21899
22000
  }),
21900
- results: z69.array(gscSubmitSitemapResultDtoSchema)
21901
- });
21902
- var gscDiscoverSitemapsResponseDtoSchema = z69.object({
21903
- sitemaps: z69.array(gscSitemapDtoSchema),
21904
- primarySitemapUrl: z69.string(),
21905
- run: z69.object({
21906
- id: z69.string(),
21907
- projectId: z69.string(),
21908
- kind: z69.string(),
21909
- status: z69.string(),
21910
- trigger: z69.string(),
21911
- createdAt: z69.string()
22001
+ results: z70.array(gscSubmitSitemapResultDtoSchema)
22002
+ });
22003
+ var gscDiscoverSitemapsResponseDtoSchema = z70.object({
22004
+ sitemaps: z70.array(gscSitemapDtoSchema),
22005
+ primarySitemapUrl: z70.string(),
22006
+ run: z70.object({
22007
+ id: z70.string(),
22008
+ projectId: z70.string(),
22009
+ kind: z70.string(),
22010
+ status: z70.string(),
22011
+ trigger: z70.string(),
22012
+ createdAt: z70.string()
21912
22013
  }).nullable()
21913
22014
  });
21914
22015
 
@@ -22027,255 +22128,255 @@ async function mapWithConcurrency(items, concurrency, fn) {
22027
22128
  }
22028
22129
 
22029
22130
  // ../contracts/src/bing.ts
22030
- import { z as z70 } from "zod";
22031
- var bingConnectionDtoSchema = z70.object({
22032
- id: z70.string(),
22033
- domain: z70.string(),
22034
- siteUrl: z70.string().nullable().optional(),
22035
- createdAt: z70.string(),
22036
- updatedAt: z70.string()
22037
- });
22038
- var bingUrlInspectionDtoSchema = z70.object({
22039
- id: z70.string(),
22040
- url: z70.string(),
22041
- httpCode: z70.number().nullable().optional(),
22042
- inIndex: z70.boolean().nullable().optional(),
22043
- lastCrawledDate: z70.string().nullable().optional(),
22044
- inIndexDate: z70.string().nullable().optional(),
22045
- inspectedAt: z70.string(),
22131
+ import { z as z71 } from "zod";
22132
+ var bingConnectionDtoSchema = z71.object({
22133
+ id: z71.string(),
22134
+ domain: z71.string(),
22135
+ siteUrl: z71.string().nullable().optional(),
22136
+ createdAt: z71.string(),
22137
+ updatedAt: z71.string()
22138
+ });
22139
+ var bingUrlInspectionDtoSchema = z71.object({
22140
+ id: z71.string(),
22141
+ url: z71.string(),
22142
+ httpCode: z71.number().nullable().optional(),
22143
+ inIndex: z71.boolean().nullable().optional(),
22144
+ lastCrawledDate: z71.string().nullable().optional(),
22145
+ inIndexDate: z71.string().nullable().optional(),
22146
+ inspectedAt: z71.string(),
22046
22147
  // Fields derived from GetUrlInfo response (more reliable than InIndex)
22047
- documentSize: z70.number().nullable().optional(),
22048
- anchorCount: z70.number().nullable().optional(),
22049
- discoveryDate: z70.string().nullable().optional()
22050
- });
22051
- var bingCoverageSummaryDtoSchema = z70.object({
22052
- summary: z70.object({
22053
- total: z70.number(),
22054
- indexed: z70.number(),
22055
- notIndexed: z70.number(),
22056
- unknown: z70.number().optional(),
22148
+ documentSize: z71.number().nullable().optional(),
22149
+ anchorCount: z71.number().nullable().optional(),
22150
+ discoveryDate: z71.string().nullable().optional()
22151
+ });
22152
+ var bingCoverageSummaryDtoSchema = z71.object({
22153
+ summary: z71.object({
22154
+ total: z71.number(),
22155
+ indexed: z71.number(),
22156
+ notIndexed: z71.number(),
22157
+ unknown: z71.number().optional(),
22057
22158
  percentage: percent()
22058
22159
  }),
22059
- lastInspectedAt: z70.string().nullable(),
22060
- indexed: z70.array(bingUrlInspectionDtoSchema).default([]),
22061
- notIndexed: z70.array(bingUrlInspectionDtoSchema).default([]),
22062
- unknown: z70.array(bingUrlInspectionDtoSchema).default([]).optional()
22063
- });
22064
- var bingKeywordStatsDtoSchema = z70.object({
22065
- query: z70.string(),
22066
- impressions: z70.number(),
22067
- clicks: z70.number(),
22160
+ lastInspectedAt: z71.string().nullable(),
22161
+ indexed: z71.array(bingUrlInspectionDtoSchema).default([]),
22162
+ notIndexed: z71.array(bingUrlInspectionDtoSchema).default([]),
22163
+ unknown: z71.array(bingUrlInspectionDtoSchema).default([]).optional()
22164
+ });
22165
+ var bingKeywordStatsDtoSchema = z71.object({
22166
+ query: z71.string(),
22167
+ impressions: z71.number(),
22168
+ clicks: z71.number(),
22068
22169
  ctr: fraction(),
22069
- averagePosition: z70.number()
22070
- });
22071
- var bingCoverageSnapshotDtoSchema = z70.object({
22072
- date: z70.string(),
22073
- indexed: z70.number(),
22074
- notIndexed: z70.number(),
22075
- unknown: z70.number()
22076
- });
22077
- var bingSubmitResultDtoSchema = z70.object({
22078
- url: z70.string(),
22079
- status: z70.enum(["success", "error"]),
22080
- submittedAt: z70.string(),
22081
- error: z70.string().optional()
22082
- });
22083
- var bingIndexingRequestResponseDtoSchema = z70.object({
22084
- summary: z70.object({
22085
- total: z70.number().int().nonnegative(),
22086
- succeeded: z70.number().int().nonnegative(),
22087
- failed: z70.number().int().nonnegative()
22170
+ averagePosition: z71.number()
22171
+ });
22172
+ var bingCoverageSnapshotDtoSchema = z71.object({
22173
+ date: z71.string(),
22174
+ indexed: z71.number(),
22175
+ notIndexed: z71.number(),
22176
+ unknown: z71.number()
22177
+ });
22178
+ var bingSubmitResultDtoSchema = z71.object({
22179
+ url: z71.string(),
22180
+ status: z71.enum(["success", "error"]),
22181
+ submittedAt: z71.string(),
22182
+ error: z71.string().optional()
22183
+ });
22184
+ var bingIndexingRequestResponseDtoSchema = z71.object({
22185
+ summary: z71.object({
22186
+ total: z71.number().int().nonnegative(),
22187
+ succeeded: z71.number().int().nonnegative(),
22188
+ failed: z71.number().int().nonnegative()
22088
22189
  }),
22089
- results: z70.array(bingSubmitResultDtoSchema).default([])
22190
+ results: z71.array(bingSubmitResultDtoSchema).default([])
22090
22191
  });
22091
- var bingSiteDtoSchema = z70.object({
22092
- url: z70.string(),
22093
- verified: z70.boolean()
22192
+ var bingSiteDtoSchema = z71.object({
22193
+ url: z71.string(),
22194
+ verified: z71.boolean()
22094
22195
  });
22095
- var bingSitesResponseDtoSchema = z70.object({
22096
- sites: z70.array(bingSiteDtoSchema).default([])
22196
+ var bingSitesResponseDtoSchema = z71.object({
22197
+ sites: z71.array(bingSiteDtoSchema).default([])
22097
22198
  });
22098
- var bingStatusDtoSchema = z70.object({
22099
- connected: z70.boolean(),
22100
- domain: z70.string(),
22101
- siteUrl: z70.string().nullable(),
22102
- createdAt: z70.string().nullable(),
22103
- updatedAt: z70.string().nullable()
22199
+ var bingStatusDtoSchema = z71.object({
22200
+ connected: z71.boolean(),
22201
+ domain: z71.string(),
22202
+ siteUrl: z71.string().nullable(),
22203
+ createdAt: z71.string().nullable(),
22204
+ updatedAt: z71.string().nullable()
22104
22205
  });
22105
- var bingConnectResponseDtoSchema = z70.object({
22106
- connected: z70.boolean(),
22107
- domain: z70.string(),
22108
- siteUrl: z70.string().nullable(),
22109
- availableSites: z70.array(bingSiteDtoSchema).default([])
22206
+ var bingConnectResponseDtoSchema = z71.object({
22207
+ connected: z71.boolean(),
22208
+ domain: z71.string(),
22209
+ siteUrl: z71.string().nullable(),
22210
+ availableSites: z71.array(bingSiteDtoSchema).default([])
22110
22211
  });
22111
- var bingSetSiteResponseDtoSchema = z70.object({
22112
- siteUrl: z70.string()
22212
+ var bingSetSiteResponseDtoSchema = z71.object({
22213
+ siteUrl: z71.string()
22113
22214
  });
22114
22215
 
22115
22216
  // ../contracts/src/cdp.ts
22116
- import { z as z71 } from "zod";
22117
- var cdpTargetStatusDtoSchema = z71.object({
22118
- name: z71.string(),
22119
- alive: z71.boolean(),
22120
- lastUsed: z71.string().nullable()
22217
+ import { z as z72 } from "zod";
22218
+ var cdpTargetStatusDtoSchema = z72.object({
22219
+ name: z72.string(),
22220
+ alive: z72.boolean(),
22221
+ lastUsed: z72.string().nullable()
22121
22222
  });
22122
- var cdpStatusDtoSchema = z71.object({
22123
- connected: z71.boolean(),
22124
- endpoint: z71.string(),
22125
- version: z71.string().optional(),
22126
- browserVersion: z71.string().optional(),
22127
- targets: z71.array(cdpTargetStatusDtoSchema).default([])
22223
+ var cdpStatusDtoSchema = z72.object({
22224
+ connected: z72.boolean(),
22225
+ endpoint: z72.string(),
22226
+ version: z72.string().optional(),
22227
+ browserVersion: z72.string().optional(),
22228
+ targets: z72.array(cdpTargetStatusDtoSchema).default([])
22128
22229
  });
22129
22230
 
22130
22231
  // ../contracts/src/wordpress.ts
22131
- import { z as z72 } from "zod";
22132
- var wordpressEnvSchema = z72.enum(["live", "staging"]);
22133
- var wordpressConnectionDtoSchema = z72.object({
22134
- projectName: z72.string(),
22135
- url: z72.string(),
22136
- stagingUrl: z72.string().optional(),
22137
- username: z72.string(),
22232
+ import { z as z73 } from "zod";
22233
+ var wordpressEnvSchema = z73.enum(["live", "staging"]);
22234
+ var wordpressConnectionDtoSchema = z73.object({
22235
+ projectName: z73.string(),
22236
+ url: z73.string(),
22237
+ stagingUrl: z73.string().optional(),
22238
+ username: z73.string(),
22138
22239
  defaultEnv: wordpressEnvSchema,
22139
- createdAt: z72.string(),
22140
- updatedAt: z72.string()
22141
- });
22142
- var wordpressSiteStatusDtoSchema = z72.object({
22143
- url: z72.string(),
22144
- reachable: z72.boolean(),
22145
- pageCount: z72.number().nullable().optional(),
22146
- version: z72.string().nullable().optional(),
22147
- error: z72.string().nullable().optional(),
22148
- plugins: z72.array(z72.string()).optional(),
22149
- authenticatedUser: z72.object({
22150
- id: z72.number(),
22151
- slug: z72.string()
22240
+ createdAt: z73.string(),
22241
+ updatedAt: z73.string()
22242
+ });
22243
+ var wordpressSiteStatusDtoSchema = z73.object({
22244
+ url: z73.string(),
22245
+ reachable: z73.boolean(),
22246
+ pageCount: z73.number().nullable().optional(),
22247
+ version: z73.string().nullable().optional(),
22248
+ error: z73.string().nullable().optional(),
22249
+ plugins: z73.array(z73.string()).optional(),
22250
+ authenticatedUser: z73.object({
22251
+ id: z73.number(),
22252
+ slug: z73.string()
22152
22253
  }).nullable().optional()
22153
22254
  });
22154
- var wordpressStatusDtoSchema = z72.object({
22155
- connected: z72.boolean(),
22156
- projectName: z72.string(),
22255
+ var wordpressStatusDtoSchema = z73.object({
22256
+ connected: z73.boolean(),
22257
+ projectName: z73.string(),
22157
22258
  defaultEnv: wordpressEnvSchema,
22158
22259
  live: wordpressSiteStatusDtoSchema.nullable(),
22159
22260
  staging: wordpressSiteStatusDtoSchema.nullable(),
22160
- adminUrl: z72.string().nullable().optional()
22261
+ adminUrl: z73.string().nullable().optional()
22161
22262
  });
22162
- var wordpressPageSummaryDtoSchema = z72.object({
22163
- id: z72.number(),
22164
- slug: z72.string(),
22165
- title: z72.string(),
22166
- status: z72.string(),
22167
- modifiedAt: z72.string().nullable().optional(),
22168
- link: z72.string().nullable().optional()
22263
+ var wordpressPageSummaryDtoSchema = z73.object({
22264
+ id: z73.number(),
22265
+ slug: z73.string(),
22266
+ title: z73.string(),
22267
+ status: z73.string(),
22268
+ modifiedAt: z73.string().nullable().optional(),
22269
+ link: z73.string().nullable().optional()
22169
22270
  });
22170
- var wordpressPageListDtoSchema = z72.object({
22271
+ var wordpressPageListDtoSchema = z73.object({
22171
22272
  env: wordpressEnvSchema,
22172
- pages: z72.array(wordpressPageSummaryDtoSchema)
22273
+ pages: z73.array(wordpressPageSummaryDtoSchema)
22173
22274
  });
22174
- var wordpressSeoStateDtoSchema = z72.object({
22175
- title: z72.string().nullable(),
22176
- description: z72.string().nullable(),
22177
- noindex: z72.boolean().nullable(),
22178
- writable: z72.boolean().default(false),
22179
- writeTargets: z72.array(z72.string()).default([])
22275
+ var wordpressSeoStateDtoSchema = z73.object({
22276
+ title: z73.string().nullable(),
22277
+ description: z73.string().nullable(),
22278
+ noindex: z73.boolean().nullable(),
22279
+ writable: z73.boolean().default(false),
22280
+ writeTargets: z73.array(z73.string()).default([])
22180
22281
  });
22181
- var wordpressSchemaBlockDtoSchema = z72.object({
22182
- type: z72.string(),
22183
- json: z72.record(z72.string(), z72.unknown())
22282
+ var wordpressSchemaBlockDtoSchema = z73.object({
22283
+ type: z73.string(),
22284
+ json: z73.record(z73.string(), z73.unknown())
22184
22285
  });
22185
22286
  var wordpressPageDetailDtoSchema = wordpressPageSummaryDtoSchema.extend({
22186
22287
  env: wordpressEnvSchema,
22187
- content: z72.string(),
22288
+ content: z73.string(),
22188
22289
  seo: wordpressSeoStateDtoSchema,
22189
- schemaBlocks: z72.array(wordpressSchemaBlockDtoSchema).default([])
22290
+ schemaBlocks: z73.array(wordpressSchemaBlockDtoSchema).default([])
22190
22291
  });
22191
22292
  var wordpressDiffPageDtoSchema = wordpressPageDetailDtoSchema.extend({
22192
- contentHash: z72.string(),
22193
- contentSnippet: z72.string()
22194
- });
22195
- var wordpressManualAssistDtoSchema = z72.object({
22196
- manualRequired: z72.literal(true),
22197
- targetUrl: z72.string(),
22198
- adminUrl: z72.string().nullable().optional(),
22199
- content: z72.string(),
22200
- nextSteps: z72.array(z72.string()).default([])
22201
- });
22202
- var wordpressAuditIssueDtoSchema = z72.object({
22203
- slug: z72.string(),
22204
- severity: z72.enum(["high", "medium", "low"]),
22205
- code: z72.enum([
22293
+ contentHash: z73.string(),
22294
+ contentSnippet: z73.string()
22295
+ });
22296
+ var wordpressManualAssistDtoSchema = z73.object({
22297
+ manualRequired: z73.literal(true),
22298
+ targetUrl: z73.string(),
22299
+ adminUrl: z73.string().nullable().optional(),
22300
+ content: z73.string(),
22301
+ nextSteps: z73.array(z73.string()).default([])
22302
+ });
22303
+ var wordpressAuditIssueDtoSchema = z73.object({
22304
+ slug: z73.string(),
22305
+ severity: z73.enum(["high", "medium", "low"]),
22306
+ code: z73.enum([
22206
22307
  "noindex",
22207
22308
  "missing-seo-title",
22208
22309
  "missing-meta-description",
22209
22310
  "missing-schema",
22210
22311
  "thin-content"
22211
22312
  ]),
22212
- message: z72.string()
22313
+ message: z73.string()
22213
22314
  });
22214
- var wordpressAuditPageDtoSchema = z72.object({
22215
- slug: z72.string(),
22216
- title: z72.string(),
22217
- status: z72.string(),
22218
- wordCount: z72.number(),
22315
+ var wordpressAuditPageDtoSchema = z73.object({
22316
+ slug: z73.string(),
22317
+ title: z73.string(),
22318
+ status: z73.string(),
22319
+ wordCount: z73.number(),
22219
22320
  seo: wordpressSeoStateDtoSchema,
22220
- schemaPresent: z72.boolean(),
22221
- issues: z72.array(wordpressAuditIssueDtoSchema).default([])
22321
+ schemaPresent: z73.boolean(),
22322
+ issues: z73.array(wordpressAuditIssueDtoSchema).default([])
22222
22323
  });
22223
- var wordpressBulkMetaEntryResultDtoSchema = z72.object({
22224
- slug: z72.string(),
22225
- status: z72.enum(["applied", "skipped", "manual"]),
22226
- error: z72.string().optional(),
22324
+ var wordpressBulkMetaEntryResultDtoSchema = z73.object({
22325
+ slug: z73.string(),
22326
+ status: z73.enum(["applied", "skipped", "manual"]),
22327
+ error: z73.string().optional(),
22227
22328
  manualAssist: wordpressManualAssistDtoSchema.optional()
22228
22329
  });
22229
- var wordpressBulkMetaResultDtoSchema = z72.object({
22330
+ var wordpressBulkMetaResultDtoSchema = z73.object({
22230
22331
  env: wordpressEnvSchema,
22231
- strategy: z72.enum(["plugin", "manual"]),
22232
- results: z72.array(wordpressBulkMetaEntryResultDtoSchema)
22332
+ strategy: z73.enum(["plugin", "manual"]),
22333
+ results: z73.array(wordpressBulkMetaEntryResultDtoSchema)
22233
22334
  });
22234
- var wordpressSchemaDeployEntryResultDtoSchema = z72.object({
22235
- slug: z72.string(),
22236
- status: z72.enum(["deployed", "stripped", "skipped", "failed"]),
22237
- schemasInjected: z72.array(z72.string()).optional(),
22335
+ var wordpressSchemaDeployEntryResultDtoSchema = z73.object({
22336
+ slug: z73.string(),
22337
+ status: z73.enum(["deployed", "stripped", "skipped", "failed"]),
22338
+ schemasInjected: z73.array(z73.string()).optional(),
22238
22339
  manualAssist: wordpressManualAssistDtoSchema.optional(),
22239
- error: z72.string().optional()
22340
+ error: z73.string().optional()
22240
22341
  });
22241
- var wordpressSchemaDeployResultDtoSchema = z72.object({
22342
+ var wordpressSchemaDeployResultDtoSchema = z73.object({
22242
22343
  env: wordpressEnvSchema,
22243
- results: z72.array(wordpressSchemaDeployEntryResultDtoSchema)
22344
+ results: z73.array(wordpressSchemaDeployEntryResultDtoSchema)
22244
22345
  });
22245
- var wordpressSchemaStatusPageDtoSchema = z72.object({
22246
- slug: z72.string(),
22247
- title: z72.string(),
22248
- canonrySchemas: z72.array(z72.string()),
22249
- thirdPartySchemas: z72.array(z72.string()),
22250
- hasCanonrySchema: z72.boolean()
22346
+ var wordpressSchemaStatusPageDtoSchema = z73.object({
22347
+ slug: z73.string(),
22348
+ title: z73.string(),
22349
+ canonrySchemas: z73.array(z73.string()),
22350
+ thirdPartySchemas: z73.array(z73.string()),
22351
+ hasCanonrySchema: z73.boolean()
22251
22352
  });
22252
- var wordpressSchemaStatusResultDtoSchema = z72.object({
22353
+ var wordpressSchemaStatusResultDtoSchema = z73.object({
22253
22354
  env: wordpressEnvSchema,
22254
- pages: z72.array(wordpressSchemaStatusPageDtoSchema)
22355
+ pages: z73.array(wordpressSchemaStatusPageDtoSchema)
22255
22356
  });
22256
- var wordpressOnboardStepDtoSchema = z72.object({
22257
- name: z72.string(),
22258
- status: z72.enum(["completed", "skipped", "failed"]),
22259
- summary: z72.string().optional(),
22260
- error: z72.string().optional()
22357
+ var wordpressOnboardStepDtoSchema = z73.object({
22358
+ name: z73.string(),
22359
+ status: z73.enum(["completed", "skipped", "failed"]),
22360
+ summary: z73.string().optional(),
22361
+ error: z73.string().optional()
22261
22362
  });
22262
- var wordpressOnboardResultDtoSchema = z72.object({
22263
- projectName: z72.string(),
22264
- steps: z72.array(wordpressOnboardStepDtoSchema)
22363
+ var wordpressOnboardResultDtoSchema = z73.object({
22364
+ projectName: z73.string(),
22365
+ steps: z73.array(wordpressOnboardStepDtoSchema)
22265
22366
  });
22266
- var wordpressDiffDtoSchema = z72.object({
22267
- slug: z72.string(),
22367
+ var wordpressDiffDtoSchema = z73.object({
22368
+ slug: z73.string(),
22268
22369
  live: wordpressDiffPageDtoSchema,
22269
22370
  staging: wordpressDiffPageDtoSchema,
22270
- hasDifferences: z72.boolean(),
22271
- differences: z72.object({
22272
- title: z72.boolean(),
22273
- slug: z72.boolean(),
22274
- content: z72.boolean(),
22275
- seoTitle: z72.boolean(),
22276
- seoDescription: z72.boolean(),
22277
- noindex: z72.boolean(),
22278
- schema: z72.boolean()
22371
+ hasDifferences: z73.boolean(),
22372
+ differences: z73.object({
22373
+ title: z73.boolean(),
22374
+ slug: z73.boolean(),
22375
+ content: z73.boolean(),
22376
+ seoTitle: z73.boolean(),
22377
+ seoDescription: z73.boolean(),
22378
+ noindex: z73.boolean(),
22379
+ schema: z73.boolean()
22279
22380
  })
22280
22381
  });
22281
22382
 
@@ -22458,61 +22559,61 @@ var LlmCapabilities = {
22458
22559
  var LLM_CAPABILITIES = Object.values(LlmCapabilities);
22459
22560
 
22460
22561
  // ../contracts/src/status.ts
22461
- import { z as z73 } from "zod";
22462
- var statusIntegrationSchema = z73.enum(["gsc", "ga", "gbp", "bing", "ads", "google-ads", "gtm", "traffic"]);
22562
+ import { z as z74 } from "zod";
22563
+ var statusIntegrationSchema = z74.enum(["gsc", "ga", "gbp", "bing", "ads", "google-ads", "gtm", "traffic"]);
22463
22564
  var StatusIntegrations = statusIntegrationSchema.enum;
22464
- var integrationStateSchema = z73.enum(["ok", "failing", "stale", "never-synced"]);
22565
+ var integrationStateSchema = z74.enum(["ok", "failing", "stale", "never-synced"]);
22465
22566
  var IntegrationStates = integrationStateSchema.enum;
22466
- var dateTimeSchema2 = z73.string().datetime({ offset: true });
22467
- var dateSchema = z73.string().regex(/^\d{4}-\d{2}-\d{2}$/);
22468
- var integrationStatusRowSchema = z73.object({
22567
+ var dateTimeSchema2 = z74.string().datetime({ offset: true });
22568
+ var dateSchema = z74.string().regex(/^\d{4}-\d{2}-\d{2}$/);
22569
+ var integrationStatusRowSchema = z74.object({
22469
22570
  integration: statusIntegrationSchema,
22470
- label: z73.string(),
22571
+ label: z74.string(),
22471
22572
  runKind: runKindSchema,
22472
- sourceId: z73.string().nullable(),
22573
+ sourceId: z74.string().nullable(),
22473
22574
  state: integrationStateSchema,
22474
22575
  lastSuccessAt: dateTimeSchema2.nullable(),
22475
22576
  latestRunAt: dateTimeSchema2.nullable(),
22476
- latestRunId: z73.string().nullable(),
22577
+ latestRunId: z74.string().nullable(),
22477
22578
  latestStatus: runStatusSchema.nullable(),
22478
22579
  latestTrigger: runTriggerSchema.nullable(),
22479
- consecutiveFailures: z73.number().int().nonnegative(),
22480
- latestError: z73.string().max(300).nullable(),
22580
+ consecutiveFailures: z74.number().int().nonnegative(),
22581
+ latestError: z74.string().max(300).nullable(),
22481
22582
  dataThrough: dateSchema.nullable(),
22482
- dataAgeDays: z73.number().int().nonnegative().nullable(),
22483
- doctorChecks: z73.array(z73.string())
22583
+ dataAgeDays: z74.number().int().nonnegative().nullable(),
22584
+ doctorChecks: z74.array(z74.string())
22484
22585
  });
22485
- var statusHealthSchema = z73.object({
22486
- status: z73.enum(["ok", "warn", "fail"]),
22487
- code: z73.string(),
22488
- summary: z73.string(),
22586
+ var statusHealthSchema = z74.object({
22587
+ status: z74.enum(["ok", "warn", "fail"]),
22588
+ code: z74.string(),
22589
+ summary: z74.string(),
22489
22590
  checkedAt: dateTimeSchema2,
22490
22591
  notifiedAt: dateTimeSchema2.nullable()
22491
22592
  });
22492
- var projectStatusSchema = z73.object({
22493
- project: z73.string(),
22494
- displayName: z73.string(),
22495
- state: z73.enum([...integrationStateSchema.options, "warning"]),
22593
+ var projectStatusSchema = z74.object({
22594
+ project: z74.string(),
22595
+ displayName: z74.string(),
22596
+ state: z74.enum([...integrationStateSchema.options, "warning"]),
22496
22597
  health: statusHealthSchema.nullable(),
22497
- integrations: z73.array(integrationStatusRowSchema)
22598
+ integrations: z74.array(integrationStatusRowSchema)
22498
22599
  });
22499
- var instanceStatusDtoSchema = z73.object({
22600
+ var instanceStatusDtoSchema = z74.object({
22500
22601
  generatedAt: dateTimeSchema2,
22501
22602
  mcp: mcpHealthSchema.optional(),
22502
- summary: z73.object({
22503
- projects: z73.number().int().nonnegative(),
22504
- ok: z73.number().int().nonnegative(),
22505
- failing: z73.number().int().nonnegative(),
22506
- warning: z73.number().int().nonnegative().optional(),
22507
- stale: z73.number().int().nonnegative(),
22508
- neverSynced: z73.number().int().nonnegative()
22603
+ summary: z74.object({
22604
+ projects: z74.number().int().nonnegative(),
22605
+ ok: z74.number().int().nonnegative(),
22606
+ failing: z74.number().int().nonnegative(),
22607
+ warning: z74.number().int().nonnegative().optional(),
22608
+ stale: z74.number().int().nonnegative(),
22609
+ neverSynced: z74.number().int().nonnegative()
22509
22610
  }),
22510
- projects: z73.array(projectStatusSchema)
22611
+ projects: z74.array(projectStatusSchema)
22511
22612
  });
22512
22613
 
22513
22614
  // ../contracts/src/run-dispatch.ts
22514
- import { z as z74 } from "zod";
22515
- var providerBatchRequestOutcomeSchema = z74.enum([
22615
+ import { z as z75 } from "zod";
22616
+ var providerBatchRequestOutcomeSchema = z75.enum([
22516
22617
  "recorded",
22517
22618
  "errored",
22518
22619
  "expired",
@@ -22521,7 +22622,7 @@ var providerBatchRequestOutcomeSchema = z74.enum([
22521
22622
  "duplicate"
22522
22623
  ]);
22523
22624
  var ProviderBatchRequestOutcomes = providerBatchRequestOutcomeSchema.enum;
22524
- var providerBatchIneligibilityReasonSchema = z74.enum([
22625
+ var providerBatchIneligibilityReasonSchema = z75.enum([
22525
22626
  "not_plan_run",
22526
22627
  "scoped_run",
22527
22628
  "probe_run",
@@ -22624,18 +22725,18 @@ function summarizeRunUsage(rows) {
22624
22725
  }
22625
22726
 
22626
22727
  // ../contracts/src/snapshot.ts
22627
- import { z as z75 } from "zod";
22628
- var snapshotProviderModeSchema = z75.enum(["all", "api", "browser"]);
22728
+ import { z as z76 } from "zod";
22729
+ var snapshotProviderModeSchema = z76.enum(["all", "api", "browser"]);
22629
22730
  var SnapshotProviderModes = snapshotProviderModeSchema.enum;
22630
- var snapshotAccuracySchema = z75.enum(["yes", "no", "unknown", "not-mentioned"]);
22631
- var snapshotQueryListSchema = z75.array(z75.string().min(1));
22632
- var snapshotRequestInputSchema = z75.object({
22633
- companyName: z75.string().min(1),
22634
- domain: z75.string().min(1),
22731
+ var snapshotAccuracySchema = z76.enum(["yes", "no", "unknown", "not-mentioned"]);
22732
+ var snapshotQueryListSchema = z76.array(z76.string().min(1));
22733
+ var snapshotRequestInputSchema = z76.object({
22734
+ companyName: z76.string().min(1),
22735
+ domain: z76.string().min(1),
22635
22736
  queries: snapshotQueryListSchema.optional(),
22636
22737
  phrases: snapshotQueryListSchema.optional(),
22637
- competitors: z75.array(z75.string().min(1)).optional(),
22638
- providers: z75.array(z75.string().trim().min(1)).min(1).optional().describe("Configured provider names to use for both answers and analysis. Omit to use all providers matching providerMode."),
22738
+ competitors: z76.array(z76.string().min(1)).optional(),
22739
+ providers: z76.array(z76.string().trim().min(1)).min(1).optional().describe("Configured provider names to use for both answers and analysis. Omit to use all providers matching providerMode."),
22639
22740
  providerMode: snapshotProviderModeSchema.optional().describe("Filter providers by transport; defaults to all. Browser-only selection requires manual queries and uses no API provider for analysis.")
22640
22741
  }).superRefine((input, ctx) => {
22641
22742
  if (input.queries !== void 0 && input.phrases !== void 0) {
@@ -22652,106 +22753,106 @@ var snapshotRequestSchema = snapshotRequestInputSchema.safeExtend({
22652
22753
  function resolveSnapshotRequestQueries(input) {
22653
22754
  return input.queries ?? input.phrases ?? [];
22654
22755
  }
22655
- var snapshotCompetitorEntrySchema = z75.object({
22656
- name: z75.string(),
22657
- count: z75.number().int().nonnegative()
22658
- });
22659
- var snapshotAuditFactorSchema = z75.object({
22660
- id: z75.string(),
22661
- name: z75.string(),
22662
- weight: z75.number(),
22663
- score: z75.number(),
22664
- findings: z75.array(z75.object({
22665
- type: z75.string(),
22666
- message: z75.string()
22756
+ var snapshotCompetitorEntrySchema = z76.object({
22757
+ name: z76.string(),
22758
+ count: z76.number().int().nonnegative()
22759
+ });
22760
+ var snapshotAuditFactorSchema = z76.object({
22761
+ id: z76.string(),
22762
+ name: z76.string(),
22763
+ weight: z76.number(),
22764
+ score: z76.number(),
22765
+ findings: z76.array(z76.object({
22766
+ type: z76.string(),
22767
+ message: z76.string()
22667
22768
  })).default([]),
22668
- recommendations: z75.array(z75.string()).default([])
22669
- });
22670
- var snapshotAuditSchema = z75.object({
22671
- url: z75.string(),
22672
- finalUrl: z75.string(),
22673
- auditedAt: z75.string(),
22674
- overallScore: z75.number(),
22675
- summary: z75.string(),
22676
- factors: z75.array(snapshotAuditFactorSchema).default([])
22677
- });
22678
- var snapshotProfileSchema = z75.object({
22679
- industry: z75.string(),
22680
- summary: z75.string(),
22681
- services: z75.array(z75.string()).default([]),
22682
- categoryTerms: z75.array(z75.string()).default([])
22683
- });
22684
- var snapshotProviderResultSchema = z75.object({
22685
- provider: z75.string(),
22686
- displayName: z75.string(),
22687
- model: z75.string().nullable().optional(),
22688
- mentioned: z75.boolean(),
22689
- cited: z75.boolean(),
22769
+ recommendations: z76.array(z76.string()).default([])
22770
+ });
22771
+ var snapshotAuditSchema = z76.object({
22772
+ url: z76.string(),
22773
+ finalUrl: z76.string(),
22774
+ auditedAt: z76.string(),
22775
+ overallScore: z76.number(),
22776
+ summary: z76.string(),
22777
+ factors: z76.array(snapshotAuditFactorSchema).default([])
22778
+ });
22779
+ var snapshotProfileSchema = z76.object({
22780
+ industry: z76.string(),
22781
+ summary: z76.string(),
22782
+ services: z76.array(z76.string()).default([]),
22783
+ categoryTerms: z76.array(z76.string()).default([])
22784
+ });
22785
+ var snapshotProviderResultSchema = z76.object({
22786
+ provider: z76.string(),
22787
+ displayName: z76.string(),
22788
+ model: z76.string().nullable().optional(),
22789
+ mentioned: z76.boolean(),
22790
+ cited: z76.boolean(),
22690
22791
  describedAccurately: snapshotAccuracySchema,
22691
- accuracyNotes: z75.string().nullable().optional(),
22692
- incorrectClaims: z75.array(z75.string()).default([]),
22693
- recommendedCompetitors: z75.array(z75.string()).default([]),
22694
- citedDomains: z75.array(z75.string()).default([]),
22695
- groundingSources: z75.array(groundingSourceSchema).default([]),
22696
- searchQueries: z75.array(z75.string()).default([]),
22697
- answerText: z75.string(),
22698
- error: z75.string().nullable().optional(),
22792
+ accuracyNotes: z76.string().nullable().optional(),
22793
+ incorrectClaims: z76.array(z76.string()).default([]),
22794
+ recommendedCompetitors: z76.array(z76.string()).default([]),
22795
+ citedDomains: z76.array(z76.string()).default([]),
22796
+ groundingSources: z76.array(groundingSourceSchema).default([]),
22797
+ searchQueries: z76.array(z76.string()).default([]),
22798
+ answerText: z76.string(),
22799
+ error: z76.string().nullable().optional(),
22699
22800
  /** Vendor-neutral answer evidence (answer services); absent for answer engines. */
22700
22801
  evidence: answerEvidenceSchema.nullable().optional(),
22701
22802
  /** False when the provider's sources are not tied to its answer, so `cited` was not measured. */
22702
- citationMeasured: z75.boolean().optional()
22803
+ citationMeasured: z76.boolean().optional()
22703
22804
  });
22704
- var snapshotQueryResultSchema = z75.object({
22705
- query: z75.string(),
22706
- providerResults: z75.array(snapshotProviderResultSchema).default([])
22805
+ var snapshotQueryResultSchema = z76.object({
22806
+ query: z76.string(),
22807
+ providerResults: z76.array(snapshotProviderResultSchema).default([])
22707
22808
  });
22708
- var snapshotSummarySchema = z75.object({
22709
- totalQueries: z75.number().int().nonnegative(),
22710
- totalProviders: z75.number().int().nonnegative(),
22711
- totalComparisons: z75.number().int().nonnegative(),
22712
- mentionCount: z75.number().int().nonnegative(),
22809
+ var snapshotSummarySchema = z76.object({
22810
+ totalQueries: z76.number().int().nonnegative(),
22811
+ totalProviders: z76.number().int().nonnegative(),
22812
+ totalComparisons: z76.number().int().nonnegative(),
22813
+ mentionCount: z76.number().int().nonnegative(),
22713
22814
  /** Successful responses whose citation was measured and found the domain cited; read against `citationComparisons`. */
22714
- citationCount: z75.number().int().nonnegative(),
22815
+ citationCount: z76.number().int().nonnegative(),
22715
22816
  /**
22716
22817
  * Successful responses whose citation could be measured: the denominator of
22717
22818
  * `citationCount`. Lower than `totalComparisons` when a provider's sources
22718
22819
  * are not tied to its answer, so those answers are neither cited nor not
22719
22820
  * cited. Absent on reports made before it existed (read `totalComparisons`).
22720
22821
  */
22721
- citationComparisons: z75.number().int().nonnegative().optional(),
22722
- topCompetitors: z75.array(snapshotCompetitorEntrySchema).default([]),
22723
- visibilityGap: z75.string(),
22724
- whatThisMeans: z75.array(z75.string()).default([]),
22725
- recommendedActions: z75.array(z75.string()).default([])
22726
- });
22727
- var snapshotReportSchema = z75.object({
22728
- companyName: z75.string(),
22729
- domain: z75.string(),
22730
- homepageUrl: z75.string(),
22731
- generatedAt: z75.string(),
22732
- queries: z75.array(z75.string()).default([]),
22733
- competitors: z75.array(z75.string()).default([]),
22822
+ citationComparisons: z76.number().int().nonnegative().optional(),
22823
+ topCompetitors: z76.array(snapshotCompetitorEntrySchema).default([]),
22824
+ visibilityGap: z76.string(),
22825
+ whatThisMeans: z76.array(z76.string()).default([]),
22826
+ recommendedActions: z76.array(z76.string()).default([])
22827
+ });
22828
+ var snapshotReportSchema = z76.object({
22829
+ companyName: z76.string(),
22830
+ domain: z76.string(),
22831
+ homepageUrl: z76.string(),
22832
+ generatedAt: z76.string(),
22833
+ queries: z76.array(z76.string()).default([]),
22834
+ competitors: z76.array(z76.string()).default([]),
22734
22835
  profile: snapshotProfileSchema,
22735
22836
  audit: snapshotAuditSchema,
22736
- queryResults: z75.array(snapshotQueryResultSchema).default([]),
22837
+ queryResults: z76.array(snapshotQueryResultSchema).default([]),
22737
22838
  summary: snapshotSummarySchema
22738
22839
  });
22739
22840
 
22740
22841
  // ../contracts/src/competitor-suggestions.ts
22741
- import { z as z76 } from "zod";
22742
- var competitorSuggestionsQuerySchema = z76.object({
22842
+ import { z as z77 } from "zod";
22843
+ var competitorSuggestionsQuerySchema = z77.object({
22743
22844
  window: metricsWindowSchema.optional(),
22744
- minAnswers: z76.coerce.number().int().min(1).max(1e3).optional(),
22745
- queryClass: z76.enum(["non-brand", "branded", "all"]).optional(),
22746
- groupKey: z76.string().trim().min(1).optional(),
22747
- limit: z76.coerce.number().int().min(1).max(100).optional()
22845
+ minAnswers: z77.coerce.number().int().min(1).max(1e3).optional(),
22846
+ queryClass: z77.enum(["non-brand", "branded", "all"]).optional(),
22847
+ groupKey: z77.string().trim().min(1).optional(),
22848
+ limit: z77.coerce.number().int().min(1).max(100).optional()
22748
22849
  }).strict();
22749
- var competitorSuggestionNameSchema = z76.object({
22750
- name: z76.string().trim().min(1),
22751
- answerCount: z76.number().int().nonnegative(),
22752
- pairedAnswers: z76.number().int().nonnegative()
22850
+ var competitorSuggestionNameSchema = z77.object({
22851
+ name: z77.string().trim().min(1),
22852
+ answerCount: z77.number().int().nonnegative(),
22853
+ pairedAnswers: z77.number().int().nonnegative()
22753
22854
  }).strict();
22754
- var competitorSuggestionReasonSchema = z76.enum([
22855
+ var competitorSuggestionReasonSchema = z77.enum([
22755
22856
  "below-min-answers",
22756
22857
  "not-named",
22757
22858
  "unpaired-name",
@@ -22762,56 +22863,56 @@ var competitorSuggestionReasonSchema = z76.enum([
22762
22863
  "shared-host"
22763
22864
  ]);
22764
22865
  var CompetitorSuggestionReasons = competitorSuggestionReasonSchema.enum;
22765
- var competitorSuggestionStatusSchema = z76.enum(["suggested", "tracked", "excluded"]);
22866
+ var competitorSuggestionStatusSchema = z77.enum(["suggested", "tracked", "excluded"]);
22766
22867
  var CompetitorSuggestionStatuses = competitorSuggestionStatusSchema.enum;
22767
- var competitorSuggestionSchema = z76.object({
22768
- domain: z76.string().trim().min(1),
22769
- label: z76.string().trim().min(1),
22770
- names: z76.array(competitorSuggestionNameSchema).max(5),
22771
- namingAnswers: z76.number().int().nonnegative(),
22772
- citingAnswers: z76.number().int().nonnegative(),
22773
- bothAnswers: z76.number().int().nonnegative(),
22774
- pairedAnswers: z76.number().int().nonnegative(),
22775
- namedByOtherNameAnswers: z76.number().int().nonnegative(),
22776
- sweeps: z76.number().int().nonnegative(),
22777
- firstSeenAt: z76.string().datetime().nullable(),
22778
- lastSeenAt: z76.string().datetime().nullable(),
22868
+ var competitorSuggestionSchema = z77.object({
22869
+ domain: z77.string().trim().min(1),
22870
+ label: z77.string().trim().min(1),
22871
+ names: z77.array(competitorSuggestionNameSchema).max(5),
22872
+ namingAnswers: z77.number().int().nonnegative(),
22873
+ citingAnswers: z77.number().int().nonnegative(),
22874
+ bothAnswers: z77.number().int().nonnegative(),
22875
+ pairedAnswers: z77.number().int().nonnegative(),
22876
+ namedByOtherNameAnswers: z77.number().int().nonnegative(),
22877
+ sweeps: z77.number().int().nonnegative(),
22878
+ firstSeenAt: z77.string().datetime().nullable(),
22879
+ lastSeenAt: z77.string().datetime().nullable(),
22779
22880
  surfaceClass: competitorLandscapeSurfaceClassSchema,
22780
- tracked: z76.boolean(),
22781
- marketKeys: z76.array(z76.string().trim().min(1)).optional(),
22881
+ tracked: z77.boolean(),
22882
+ marketKeys: z77.array(z77.string().trim().min(1)).optional(),
22782
22883
  status: competitorSuggestionStatusSchema,
22783
22884
  reason: competitorSuggestionReasonSchema.nullable(),
22784
- sampleUrls: z76.array(z76.string().url()).max(3)
22885
+ sampleUrls: z77.array(z77.string().url()).max(3)
22785
22886
  }).strict();
22786
- var competitorSuggestionsResponseSchema = z76.object({
22787
- project: z76.string().trim().min(1),
22887
+ var competitorSuggestionsResponseSchema = z77.object({
22888
+ project: z77.string().trim().min(1),
22788
22889
  window: metricsWindowSchema,
22789
22890
  scope: competitorLandscapeScopeSchema,
22790
- filters: z76.object({
22791
- queryClass: z76.enum(["non-brand", "branded", "all"]),
22792
- groupKey: z76.string().nullable(),
22793
- limit: z76.number().int().positive(),
22794
- minAnswers: z76.number().int().positive()
22891
+ filters: z77.object({
22892
+ queryClass: z77.enum(["non-brand", "branded", "all"]),
22893
+ groupKey: z77.string().nullable(),
22894
+ limit: z77.number().int().positive(),
22895
+ minAnswers: z77.number().int().positive()
22795
22896
  }).strict(),
22796
- thresholds: z76.object({ minAnswers: z76.number().int().positive() }).strict(),
22797
- candidates: z76.array(competitorSuggestionSchema),
22798
- candidatesTotal: z76.number().int().nonnegative(),
22799
- excludedCounts: z76.record(z76.string(), z76.number().int().nonnegative()),
22800
- unresolvedNames: z76.array(z76.object({ name: z76.string().trim().min(1), answerCount: z76.number().int().nonnegative() }).strict()),
22801
- evidence: z76.object({
22802
- answeredResults: z76.number().int().nonnegative(),
22803
- sourceResults: z76.number().int().nonnegative(),
22804
- excludedProbeResults: z76.number().int().nonnegative(),
22805
- excludedNonCompletedResults: z76.number().int().nonnegative()
22897
+ thresholds: z77.object({ minAnswers: z77.number().int().positive() }).strict(),
22898
+ candidates: z77.array(competitorSuggestionSchema),
22899
+ candidatesTotal: z77.number().int().nonnegative(),
22900
+ excludedCounts: z77.record(z77.string(), z77.number().int().nonnegative()),
22901
+ unresolvedNames: z77.array(z77.object({ name: z77.string().trim().min(1), answerCount: z77.number().int().nonnegative() }).strict()),
22902
+ evidence: z77.object({
22903
+ answeredResults: z77.number().int().nonnegative(),
22904
+ sourceResults: z77.number().int().nonnegative(),
22905
+ excludedProbeResults: z77.number().int().nonnegative(),
22906
+ excludedNonCompletedResults: z77.number().int().nonnegative()
22806
22907
  }).strict(),
22807
- runCount: z76.number().int().nonnegative(),
22808
- runIds: z76.array(z76.string()),
22809
- countUnits: z76.object({
22810
- answers: z76.array(z76.string()),
22811
- distinctNames: z76.array(z76.string()),
22812
- runs: z76.array(z76.string())
22908
+ runCount: z77.number().int().nonnegative(),
22909
+ runIds: z77.array(z77.string()),
22910
+ countUnits: z77.object({
22911
+ answers: z77.array(z77.string()),
22912
+ distinctNames: z77.array(z77.string()),
22913
+ runs: z77.array(z77.string())
22813
22914
  }).strict(),
22814
- truncated: z76.boolean()
22915
+ truncated: z77.boolean()
22815
22916
  }).strict();
22816
22917
  var COMPETITOR_SUGGESTION_COUNT_UNITS = {
22817
22918
  ...COMPETITOR_LANDSCAPE_COUNT_UNITS,
@@ -22829,9 +22930,9 @@ var COMPETITOR_SUGGESTION_COUNT_UNITS = {
22829
22930
  };
22830
22931
 
22831
22932
  // ../contracts/src/intelligence.ts
22832
- import { z as z77 } from "zod";
22833
- var insightSeveritySchema = z77.enum(["critical", "high", "medium", "low"]);
22834
- var insightActionGroupSchema = z77.enum(["write", "investigate", "monitor"]);
22933
+ import { z as z78 } from "zod";
22934
+ var insightSeveritySchema = z78.enum(["critical", "high", "medium", "low"]);
22935
+ var insightActionGroupSchema = z78.enum(["write", "investigate", "monitor"]);
22835
22936
  var InsightActionGroups = insightActionGroupSchema.enum;
22836
22937
  var insightActionGroupByType = {
22837
22938
  // Content-required: a missing or competitive answer needs new or updated material.
@@ -22853,10 +22954,10 @@ var insightActionGroupByType = {
22853
22954
  "gbp-metric-drop": InsightActionGroups.investigate,
22854
22955
  "gbp-keyword-drop": InsightActionGroups.investigate
22855
22956
  };
22856
- var healthSnapshotDtoSchema = z77.object({
22857
- id: z77.string(),
22858
- projectId: z77.string(),
22859
- runId: z77.string().nullable(),
22957
+ var healthSnapshotDtoSchema = z78.object({
22958
+ id: z78.string(),
22959
+ projectId: z78.string(),
22960
+ runId: z78.string().nullable(),
22860
22961
  overallCitedRate: fraction(),
22861
22962
  /**
22862
22963
  * Share of (query × provider) pairs where the project was MENTIONED in the
@@ -22865,46 +22966,46 @@ var healthSnapshotDtoSchema = z77.object({
22865
22966
  * as 0 (the API coalesces NULL→0).
22866
22967
  */
22867
22968
  overallMentionRate: fraction(),
22868
- totalPairs: z77.number().int().nonnegative(),
22869
- citedPairs: z77.number().int().nonnegative(),
22969
+ totalPairs: z78.number().int().nonnegative(),
22970
+ citedPairs: z78.number().int().nonnegative(),
22870
22971
  /** Count of pairs mentioned in the answer text. Legacy rows read back as 0. */
22871
- mentionedPairs: z77.number().int().nonnegative(),
22872
- providerBreakdown: z77.record(z77.string(), z77.object({
22972
+ mentionedPairs: z78.number().int().nonnegative(),
22973
+ providerBreakdown: z78.record(z78.string(), z78.object({
22873
22974
  citedRate: fraction(),
22874
22975
  mentionRate: fraction(),
22875
- cited: z77.number().int().nonnegative(),
22876
- mentioned: z77.number().int().nonnegative(),
22877
- total: z77.number().int().nonnegative()
22976
+ cited: z78.number().int().nonnegative(),
22977
+ mentioned: z78.number().int().nonnegative(),
22978
+ total: z78.number().int().nonnegative()
22878
22979
  })),
22879
- createdAt: z77.string(),
22980
+ createdAt: z78.string(),
22880
22981
  /**
22881
22982
  * `'ready'` when the snapshot reflects real data; `'no-data'` for the
22882
22983
  * sentinel returned by `/health/latest` when a project has no health
22883
22984
  * snapshots yet (newly created, or only failed runs). Numeric fields are
22884
22985
  * zero and `providerBreakdown` is `{}` in the no-data case.
22885
22986
  */
22886
- status: z77.enum(["ready", "no-data"]),
22987
+ status: z78.enum(["ready", "no-data"]),
22887
22988
  /** Reason for `status === 'no-data'`. Absent when `status === 'ready'`. */
22888
- reason: z77.literal("no-runs-yet").optional()
22989
+ reason: z78.literal("no-runs-yet").optional()
22889
22990
  });
22890
22991
 
22891
22992
  // ../contracts/src/agent.ts
22892
- import { z as z78 } from "zod";
22893
- var agentViewContextSchema = z78.object({
22894
- view: z78.enum(["project", "visibility", "property", "queries", "site-health"]),
22895
- unavailableReason: z78.string().trim().min(1).max(512).optional(),
22993
+ import { z as z79 } from "zod";
22994
+ var agentViewContextSchema = z79.object({
22995
+ view: z79.enum(["project", "visibility", "property", "queries", "site-health"]),
22996
+ unavailableReason: z79.string().trim().min(1).max(512).optional(),
22896
22997
  selection: visibilityReportRequestSchema.optional(),
22897
- page: z78.object({
22898
- runId: z78.string().trim().min(1).max(256).optional(),
22899
- nodeKey: z78.string().trim().min(1).max(2048).optional()
22998
+ page: z79.object({
22999
+ runId: z79.string().trim().min(1).max(256).optional(),
23000
+ nodeKey: z79.string().trim().min(1).max(2048).optional()
22900
23001
  }).strict().optional()
22901
23002
  }).strict().superRefine((value, ctx) => {
22902
23003
  if (value.page && value.view !== "site-health") ctx.addIssue({ code: "custom", message: "Page context requires Site Health." });
22903
23004
  if (value.selection && !["visibility", "property", "queries"].includes(value.view)) ctx.addIssue({ code: "custom", message: "Measurement selection requires a measurement view." });
22904
23005
  });
22905
- var agentTurnLimitsSchema = z78.object({
22906
- maxToolCalls: z78.number().int().min(1).max(100).default(30),
22907
- timeoutMs: z78.number().int().min(1e3).max(6e5).default(18e4)
23006
+ var agentTurnLimitsSchema = z79.object({
23007
+ maxToolCalls: z79.number().int().min(1).max(100).default(30),
23008
+ timeoutMs: z79.number().int().min(1e3).max(6e5).default(18e4)
22908
23009
  }).strict();
22909
23010
  function agentVisibilityEvidence(report, project, retrievedAt) {
22910
23011
  const selection = report.selection;
@@ -22947,34 +23048,34 @@ function agentVisibilityEvidence(report, project, retrievedAt) {
22947
23048
  ))
22948
23049
  };
22949
23050
  }
22950
- var agentProviderIdSchema = z78.enum(["claude", "openai", "gemini", "zai", "openrouter"]);
22951
- var agentProviderOptionDtoSchema = z78.object({
23051
+ var agentProviderIdSchema = z79.enum(["claude", "openai", "gemini", "zai", "openrouter"]);
23052
+ var agentProviderOptionDtoSchema = z79.object({
22952
23053
  /** Stable identifier — what clients pass back as `provider` on the prompt endpoint. */
22953
23054
  id: agentProviderIdSchema,
22954
23055
  /** Human-readable label for UI pickers, e.g. "Anthropic (Claude)". */
22955
- label: z78.string(),
23056
+ label: z79.string(),
22956
23057
  /** Default model if the caller doesn't pick one. */
22957
- defaultModel: z78.string(),
23058
+ defaultModel: z79.string(),
22958
23059
  /** Whether a usable API key was found (config.yaml or provider env var). */
22959
- configured: z78.boolean(),
23060
+ configured: z79.boolean(),
22960
23061
  /**
22961
23062
  * Where the key resolved from, if any. `null` when `configured === false`.
22962
23063
  * Surfaced so the UI can nudge users toward their preferred source of truth.
22963
23064
  */
22964
- keySource: z78.enum(["config", "env"]).nullable(),
23065
+ keySource: z79.enum(["config", "env"]).nullable(),
22965
23066
  /**
22966
23067
  * A short list of models to offer for this provider: the default first,
22967
23068
  * then a few stronger current models. A pinned model outside the list is
22968
23069
  * listed first. Any other model ID can still be requested.
22969
23070
  */
22970
- models: z78.array(z78.object({ id: z78.string(), displayName: z78.string() })).optional()
23071
+ models: z79.array(z79.object({ id: z79.string(), displayName: z79.string() })).optional()
22971
23072
  });
22972
- var agentProvidersResponseDtoSchema = z78.object({
23073
+ var agentProvidersResponseDtoSchema = z79.object({
22973
23074
  /**
22974
23075
  * Every provider Aero knows about. `configured === false` entries are
22975
23076
  * included so the UI can render them disabled with an onboarding hint.
22976
23077
  */
22977
- providers: z78.array(agentProviderOptionDtoSchema).default([]),
23078
+ providers: z79.array(agentProviderOptionDtoSchema).default([]),
22978
23079
  /**
22979
23080
  * Provider a new session uses when the caller names none: the
22980
23081
  * `agent.provider` pin when set (reported even without a key, as its
@@ -22984,50 +23085,50 @@ var agentProvidersResponseDtoSchema = z78.object({
22984
23085
  */
22985
23086
  defaultProvider: agentProviderIdSchema.nullable()
22986
23087
  });
22987
- var memorySourceSchema = z78.enum(["aero", "user", "compaction"]);
23088
+ var memorySourceSchema = z79.enum(["aero", "user", "compaction"]);
22988
23089
  var MemorySources = memorySourceSchema.enum;
22989
23090
  var AGENT_MEMORY_VALUE_MAX_BYTES = 2 * 1024;
22990
23091
  var AGENT_MEMORY_KEY_MAX_LENGTH = 128;
22991
- var agentMemoryUpsertRequestSchema = z78.object({
22992
- key: z78.string().min(1).max(AGENT_MEMORY_KEY_MAX_LENGTH),
22993
- value: z78.string().min(1)
23092
+ var agentMemoryUpsertRequestSchema = z79.object({
23093
+ key: z79.string().min(1).max(AGENT_MEMORY_KEY_MAX_LENGTH),
23094
+ value: z79.string().min(1)
22994
23095
  });
22995
- var agentMemoryDeleteRequestSchema = z78.object({
22996
- key: z78.string().min(1).max(AGENT_MEMORY_KEY_MAX_LENGTH)
23096
+ var agentMemoryDeleteRequestSchema = z79.object({
23097
+ key: z79.string().min(1).max(AGENT_MEMORY_KEY_MAX_LENGTH)
22997
23098
  });
22998
- var agentPromptRequestSchema = z78.object({
22999
- prompt: z78.string().trim().min(1),
23000
- conversationId: z78.string().min(1).nullable().optional(),
23099
+ var agentPromptRequestSchema = z79.object({
23100
+ prompt: z79.string().trim().min(1),
23101
+ conversationId: z79.string().min(1).nullable().optional(),
23001
23102
  provider: agentProviderIdSchema.optional(),
23002
- modelId: z78.string().trim().min(1).optional(),
23003
- scope: z78.enum(["all", "read-only"]).optional(),
23004
- profile: z78.enum(["default", "ads-operator"]).optional(),
23103
+ modelId: z79.string().trim().min(1).optional(),
23104
+ scope: z79.enum(["all", "read-only"]).optional(),
23105
+ profile: z79.enum(["default", "ads-operator"]).optional(),
23005
23106
  context: agentViewContextSchema.optional(),
23006
23107
  limits: agentTurnLimitsSchema.optional()
23007
23108
  });
23008
- var agentConversationMessageSchema = z78.looseObject({ role: z78.string(), content: z78.unknown().optional() });
23009
- var agentConversationSummarySchema = z78.object({
23010
- id: z78.string(),
23011
- title: z78.string(),
23012
- active: z78.boolean(),
23013
- modelProvider: z78.string(),
23014
- modelId: z78.string(),
23015
- createdAt: z78.string(),
23016
- updatedAt: z78.string()
23109
+ var agentConversationMessageSchema = z79.looseObject({ role: z79.string(), content: z79.unknown().optional() });
23110
+ var agentConversationSummarySchema = z79.object({
23111
+ id: z79.string(),
23112
+ title: z79.string(),
23113
+ active: z79.boolean(),
23114
+ modelProvider: z79.string(),
23115
+ modelId: z79.string(),
23116
+ createdAt: z79.string(),
23117
+ updatedAt: z79.string()
23017
23118
  });
23018
23119
  var agentConversationSchema = agentConversationSummarySchema.extend({
23019
- messages: z78.array(agentConversationMessageSchema),
23020
- isStreaming: z78.boolean()
23120
+ messages: z79.array(agentConversationMessageSchema),
23121
+ isStreaming: z79.boolean()
23021
23122
  });
23022
- var agentConversationListSchema = z78.object({
23023
- conversations: z78.array(agentConversationSummarySchema),
23024
- currentConversationId: z78.string().nullable(),
23025
- nextOffset: z78.number().int().nullable()
23123
+ var agentConversationListSchema = z79.object({
23124
+ conversations: z79.array(agentConversationSummarySchema),
23125
+ currentConversationId: z79.string().nullable(),
23126
+ nextOffset: z79.number().int().nullable()
23026
23127
  });
23027
- var agentConversationCreateSchema = z78.object({
23028
- id: z78.uuid()
23128
+ var agentConversationCreateSchema = z79.object({
23129
+ id: z79.uuid()
23029
23130
  }).strict();
23030
- var agentConversationDeleteSchema = z78.object({ id: z78.string(), status: z78.literal("deleted") });
23131
+ var agentConversationDeleteSchema = z79.object({ id: z79.string(), status: z79.literal("deleted") });
23031
23132
  function agentConversationTitle(messages) {
23032
23133
  for (const message of messages) {
23033
23134
  if (message.role !== "user") continue;
@@ -23039,49 +23140,49 @@ function agentConversationTitle(messages) {
23039
23140
  return "New conversation";
23040
23141
  }
23041
23142
  var aeroPreviewStarterIds = ["status", "changes", "gaps", "insights"];
23042
- var aeroPreviewStarterIdSchema = z78.enum(aeroPreviewStarterIds);
23043
- var aeroPreviewStepSchema = z78.object({
23143
+ var aeroPreviewStarterIdSchema = z79.enum(aeroPreviewStarterIds);
23144
+ var aeroPreviewStepSchema = z79.object({
23044
23145
  /** Assistant text shown before the tool call, when the turn narrates it. */
23045
- text: z78.string().optional(),
23046
- tool: z78.object({
23146
+ text: z79.string().optional(),
23147
+ tool: z79.object({
23047
23148
  /** Real Canonry MCP tool name, such as canonry_visibility_report. */
23048
- name: z78.string(),
23149
+ name: z79.string(),
23049
23150
  /** The tool's registered title, which the live bar shows as the card label. */
23050
- label: z78.string(),
23051
- arguments: z78.record(z78.string(), z78.unknown()),
23151
+ label: z79.string(),
23152
+ arguments: z79.record(z79.string(), z79.unknown()),
23052
23153
  /** A compact excerpt of the stored result, not the full payload. */
23053
- result: z78.unknown(),
23054
- durationMs: z78.number().int().nonnegative()
23154
+ result: z79.unknown(),
23155
+ durationMs: z79.number().int().nonnegative()
23055
23156
  })
23056
23157
  });
23057
- var aeroPreviewStarterSchema = z78.object({
23158
+ var aeroPreviewStarterSchema = z79.object({
23058
23159
  id: aeroPreviewStarterIdSchema,
23059
- steps: z78.array(aeroPreviewStepSchema),
23160
+ steps: z79.array(aeroPreviewStepSchema),
23060
23161
  /** Final assistant markdown. */
23061
- answer: z78.string()
23162
+ answer: z79.string()
23062
23163
  });
23063
- var aeroPreviewResponseSchema = z78.object({
23064
- project: z78.string(),
23065
- seededAt: z78.string(),
23066
- starters: z78.array(aeroPreviewStarterSchema)
23164
+ var aeroPreviewResponseSchema = z79.object({
23165
+ project: z79.string(),
23166
+ seededAt: z79.string(),
23167
+ starters: z79.array(aeroPreviewStarterSchema)
23067
23168
  });
23068
- var agentConversationListQuerySchema = z78.object({
23069
- offset: z78.coerce.number().int().min(0).default(0),
23070
- limit: z78.coerce.number().int().min(1).max(100).default(50)
23169
+ var agentConversationListQuerySchema = z79.object({
23170
+ offset: z79.coerce.number().int().min(0).default(0),
23171
+ limit: z79.coerce.number().int().min(1).max(100).default(50)
23071
23172
  }).strict();
23072
23173
 
23073
23174
  // ../contracts/src/sentiment.ts
23074
- import { z as z79 } from "zod";
23175
+ import { z as z80 } from "zod";
23075
23176
  var SENTIMENT_MODEL = "jev-1.13.0";
23076
23177
  var SENTIMENT_OPENROUTER_MODEL = "typesafe/jev-1.13";
23077
23178
  var SENTIMENT_OPENROUTER_SERVED_MODEL = "typesafe/jev-1.13-20260917";
23078
- var sentimentEvaluatorProviderSchema = z79.enum(["typesafe", "openrouter"]);
23179
+ var sentimentEvaluatorProviderSchema = z80.enum(["typesafe", "openrouter"]);
23079
23180
  var SENTIMENT_INTERVAL_LIMITATION = "Wilson 95% intervals assume independent observations. They exclude classifier error and dependence among related queries, Properties, and sweeps.";
23080
- var id = z79.string().trim().min(1).max(256);
23081
- var count = z79.number().int().nonnegative();
23082
- var runIds = z79.preprocess((value) => typeof value === "string" ? [value] : value, z79.array(id).min(1).max(100));
23083
- var rate = fraction(z79.number().min(0).max(1)).nullable();
23084
- var sentimentOutcomeSchema = z79.enum([
23181
+ var id = z80.string().trim().min(1).max(256);
23182
+ var count = z80.number().int().nonnegative();
23183
+ var runIds = z80.preprocess((value) => typeof value === "string" ? [value] : value, z80.array(id).min(1).max(100));
23184
+ var rate = fraction(z80.number().min(0).max(1)).nullable();
23185
+ var sentimentOutcomeSchema = z80.enum([
23085
23186
  "favorable",
23086
23187
  "mixed",
23087
23188
  "unfavorable",
@@ -23102,22 +23203,22 @@ var sentimentOutcomeSchema = z79.enum([
23102
23203
  "canceled"
23103
23204
  ]);
23104
23205
  var SentimentOutcomes = sentimentOutcomeSchema.enum;
23105
- var sentimentStateSchema = z79.enum(["disabled", "not-measured", "processing", "partial", "complete", "failed", "canceled", "unsupported"]);
23106
- var sentimentEvaluationDefinitionSchema = z79.object({
23107
- schemaVersion: z79.union([z79.literal(1), z79.literal(2)]),
23108
- requestedModel: z79.enum([SENTIMENT_MODEL, SENTIMENT_OPENROUTER_MODEL]),
23206
+ var sentimentStateSchema = z80.enum(["disabled", "not-measured", "processing", "partial", "complete", "failed", "canceled", "unsupported"]);
23207
+ var sentimentEvaluationDefinitionSchema = z80.object({
23208
+ schemaVersion: z80.union([z80.literal(1), z80.literal(2)]),
23209
+ requestedModel: z80.enum([SENTIMENT_MODEL, SENTIMENT_OPENROUTER_MODEL]),
23109
23210
  /** Omitted on historical direct TypeSafe definitions to preserve their immutable identity. */
23110
23211
  provider: sentimentEvaluatorProviderSchema.optional(),
23111
- expectedReturnedModel: z79.literal(SENTIMENT_OPENROUTER_SERVED_MODEL).optional(),
23212
+ expectedReturnedModel: z80.literal(SENTIMENT_OPENROUTER_SERVED_MODEL).optional(),
23112
23213
  verdictVersion: id,
23113
23214
  identityVersion: id,
23114
23215
  evidenceVersion: id,
23115
23216
  segmentationVersion: id,
23116
23217
  preprocessingVersion: id,
23117
- languagePolicy: z79.literal("en-only"),
23118
- comparisonMethodVersion: z79.literal("wilson-independent-v1"),
23119
- confidenceThreshold: z79.number().min(0).max(1).nullable(),
23120
- questions: z79.object({ identity: z79.string(), judgment: z79.string(), stance: z79.string(), conclusion: z79.string(), complaint: z79.string() }).strict()
23218
+ languagePolicy: z80.literal("en-only"),
23219
+ comparisonMethodVersion: z80.literal("wilson-independent-v1"),
23220
+ confidenceThreshold: z80.number().min(0).max(1).nullable(),
23221
+ questions: z80.object({ identity: z80.string(), judgment: z80.string(), stance: z80.string(), conclusion: z80.string(), complaint: z80.string() }).strict()
23121
23222
  }).strict().superRefine((definition, ctx) => {
23122
23223
  const routed = definition.provider === "openrouter";
23123
23224
  if (definition.requestedModel !== (routed ? SENTIMENT_OPENROUTER_MODEL : SENTIMENT_MODEL) || (routed ? definition.expectedReturnedModel !== SENTIMENT_OPENROUTER_SERVED_MODEL : definition.expectedReturnedModel !== void 0)) {
@@ -23160,7 +23261,7 @@ function storedDefinitionProjection(value) {
23160
23261
  if (typeof projected.questions === "object" && projected.questions !== null) projected.questions = Object.fromEntries(Object.entries(projected.questions).filter(([key]) => key !== "theme"));
23161
23262
  return projected;
23162
23263
  }
23163
- var storedSentimentEvaluationDefinitionSchema = z79.preprocess(storedDefinitionProjection, sentimentEvaluationDefinitionSchema);
23264
+ var storedSentimentEvaluationDefinitionSchema = z80.preprocess(storedDefinitionProjection, sentimentEvaluationDefinitionSchema);
23164
23265
  function canonicalSentimentJson(value) {
23165
23266
  function canonical(item) {
23166
23267
  if (Array.isArray(item)) return item.map(canonical);
@@ -23169,69 +23270,69 @@ function canonicalSentimentJson(value) {
23169
23270
  }
23170
23271
  return JSON.stringify(canonical(value));
23171
23272
  }
23172
- var sentimentSubjectSchema = z79.object({ id, displayName: z79.string(), aliases: z79.array(z79.string()), qualifiedAliases: z79.array(z79.string()).default([]), urls: z79.array(z79.string()), mentionNotApplicable: z79.boolean() }).strict();
23173
- var sentimentUsageEdgeSchema = z79.object({ queryId: id, executionNodeKey: id.nullable(), targetId: id, propertyId: id.nullable(), groupId: id.nullable(), marketId: id.nullable(), queryClass: z79.enum(["branded", "non-brand"]), queryText: z79.string().optional(), location: z79.string().nullable() }).strict();
23174
- var sentimentExecutionContextSchema = z79.object({
23273
+ var sentimentSubjectSchema = z80.object({ id, displayName: z80.string(), aliases: z80.array(z80.string()), qualifiedAliases: z80.array(z80.string()).default([]), urls: z80.array(z80.string()), mentionNotApplicable: z80.boolean() }).strict();
23274
+ var sentimentUsageEdgeSchema = z80.object({ queryId: id, executionNodeKey: id.nullable(), targetId: id, propertyId: id.nullable(), groupId: id.nullable(), marketId: id.nullable(), queryClass: z80.enum(["branded", "non-brand"]), queryText: z80.string().optional(), location: z80.string().nullable() }).strict();
23275
+ var sentimentExecutionContextSchema = z80.object({
23175
23276
  queryId: id,
23176
- queryText: z79.string(),
23177
- queryClass: z79.enum(["branded", "non-brand"]),
23277
+ queryText: z80.string(),
23278
+ queryClass: z80.enum(["branded", "non-brand"]),
23178
23279
  provider: id,
23179
- requestedModel: z79.string().nullable(),
23180
- servedModel: z79.string().nullable(),
23181
- location: z79.string().nullable(),
23182
- revision: z79.number().int().nullable(),
23183
- usageEdges: z79.array(sentimentUsageEdgeSchema),
23280
+ requestedModel: z80.string().nullable(),
23281
+ servedModel: z80.string().nullable(),
23282
+ location: z80.string().nullable(),
23283
+ revision: z80.number().int().nullable(),
23284
+ usageEdges: z80.array(sentimentUsageEdgeSchema),
23184
23285
  locationContext: locationContextSchema.nullable().default(null)
23185
23286
  }).strict();
23186
- var sentimentEvidenceSchema = z79.object({ id, text: z79.string().min(1), start: count, end: count }).strict();
23187
- var sentimentUsageSchema = z79.object({ kind: z79.enum(["reported", "estimated", "unknown"]), inputTokens: count.nullable(), outputTokens: count.nullable() }).strict();
23188
- var sentimentClassifierInputSchema = z79.object({
23287
+ var sentimentEvidenceSchema = z80.object({ id, text: z80.string().min(1), start: count, end: count }).strict();
23288
+ var sentimentUsageSchema = z80.object({ kind: z80.enum(["reported", "estimated", "unknown"]), inputTokens: count.nullable(), outputTokens: count.nullable() }).strict();
23289
+ var sentimentClassifierInputSchema = z80.object({
23189
23290
  sourceSnapshotId: id,
23190
- sourceText: z79.string(),
23291
+ sourceText: z80.string(),
23191
23292
  sourceTextHash: id,
23192
23293
  subject: sentimentSubjectSchema,
23193
23294
  subjectHash: id,
23194
23295
  context: sentimentExecutionContextSchema,
23195
- language: z79.string(),
23296
+ language: z80.string(),
23196
23297
  definition: sentimentEvaluationDefinitionSchema,
23197
- sentences: z79.array(sentimentEvidenceSchema)
23298
+ sentences: z80.array(sentimentEvidenceSchema)
23198
23299
  }).strict();
23199
- var storedSentimentClassifierInputSchema = z79.preprocess((value) => {
23300
+ var storedSentimentClassifierInputSchema = z80.preprocess((value) => {
23200
23301
  if (typeof value !== "object" || value === null || !("definition" in value)) return value;
23201
23302
  return { ...value, definition: storedDefinitionProjection(value.definition) };
23202
23303
  }, sentimentClassifierInputSchema);
23203
- var classifierCommon = { returnedModel: z79.string().nullable(), usage: sentimentUsageSchema };
23204
- var sentimentClassifierOutputSchema = z79.discriminatedUnion("kind", [
23205
- z79.object({
23206
- kind: z79.literal("classified"),
23304
+ var classifierCommon = { returnedModel: z80.string().nullable(), usage: sentimentUsageSchema };
23305
+ var sentimentClassifierOutputSchema = z80.discriminatedUnion("kind", [
23306
+ z80.object({
23307
+ kind: z80.literal("classified"),
23207
23308
  ...classifierCommon,
23208
- returnedModel: z79.string(),
23309
+ returnedModel: z80.string(),
23209
23310
  outcome: sentimentOutcomeSchema,
23210
- conclusion: z79.array(sentimentEvidenceSchema),
23211
- complaint: z79.array(sentimentEvidenceSchema).nullable(),
23212
- confidence: z79.number().min(0).max(1).nullable()
23311
+ conclusion: z80.array(sentimentEvidenceSchema),
23312
+ complaint: z80.array(sentimentEvidenceSchema).nullable(),
23313
+ confidence: z80.number().min(0).max(1).nullable()
23213
23314
  }).strict(),
23214
- z79.object({ kind: z79.literal("abstained"), ...classifierCommon, outcome: sentimentOutcomeSchema, reason: z79.string() }).strict(),
23215
- z79.object({ kind: z79.literal("failed"), ...classifierCommon, outcome: z79.literal("failed"), error: z79.object({ code: id, message: z79.string(), retryable: z79.boolean(), retryAfterMs: z79.number().nonnegative().nullable() }).strict() }).strict()
23315
+ z80.object({ kind: z80.literal("abstained"), ...classifierCommon, outcome: sentimentOutcomeSchema, reason: z80.string() }).strict(),
23316
+ z80.object({ kind: z80.literal("failed"), ...classifierCommon, outcome: z80.literal("failed"), error: z80.object({ code: id, message: z80.string(), retryable: z80.boolean(), retryAfterMs: z80.number().nonnegative().nullable() }).strict() }).strict()
23216
23317
  ]).superRefine((result, ctx) => {
23217
23318
  if (result.kind === "classified" && ["favorable", "mixed", "unfavorable"].includes(result.outcome) && result.conclusion.length === 0) {
23218
23319
  ctx.addIssue({ code: "custom", path: ["conclusion"], message: "Judgments require conclusion evidence" });
23219
23320
  }
23220
23321
  });
23221
- var storedSentimentClassifierOutputSchema = z79.preprocess((value) => typeof value === "object" && value !== null ? Object.fromEntries(Object.entries(value).filter(([key]) => key !== "themes")) : value, sentimentClassifierOutputSchema);
23222
- var sentimentSelectionBaseSchema = z79.object({
23322
+ var storedSentimentClassifierOutputSchema = z80.preprocess((value) => typeof value === "object" && value !== null ? Object.fromEntries(Object.entries(value).filter(([key]) => key !== "themes")) : value, sentimentClassifierOutputSchema);
23323
+ var sentimentSelectionBaseSchema = z80.object({
23223
23324
  runId: id.optional(),
23224
23325
  runIds: runIds.optional(),
23225
- revision: z79.coerce.number().int().positive().optional(),
23226
- mode: z79.enum(["auto", "simple", "advanced"]).default("auto"),
23227
- queryClass: z79.enum(["branded", "non-brand"]).default("branded"),
23228
- scope: z79.enum(["project", "property", "group", "market"]).default("project"),
23326
+ revision: z80.coerce.number().int().positive().optional(),
23327
+ mode: z80.enum(["auto", "simple", "advanced"]).default("auto"),
23328
+ queryClass: z80.enum(["branded", "non-brand"]).default("branded"),
23329
+ scope: z80.enum(["project", "property", "group", "market"]).default("project"),
23229
23330
  queryId: id.optional(),
23230
23331
  scopeKey: id.optional(),
23231
23332
  marketKey: id.optional(),
23232
23333
  provider: id.optional(),
23233
23334
  model: id.optional(),
23234
- location: z79.string().min(1).optional(),
23335
+ location: z80.string().min(1).optional(),
23235
23336
  evaluationDefinitionId: id.optional(),
23236
23337
  /** Exact frozen Advanced execution node of the selected query. Identity: it narrows the assessed population. */
23237
23338
  executionNodeKey: id.optional()
@@ -23241,26 +23342,26 @@ function exclusiveSentimentRuns(value, ctx) {
23241
23342
  if (value.runIds && new Set(value.runIds).size !== value.runIds.length) ctx.addIssue({ code: "custom", path: ["runIds"], message: "Run IDs must be unique." });
23242
23343
  }
23243
23344
  var sentimentSelectionSchema = sentimentSelectionBaseSchema.superRefine(exclusiveSentimentRuns);
23244
- var sentimentSummaryIncludeSchema = z79.enum(["assessments", "locations"]);
23345
+ var sentimentSummaryIncludeSchema = z80.enum(["assessments", "locations"]);
23245
23346
  var SENTIMENT_QUERY_PAGE_DEFAULT = 25;
23246
23347
  var SENTIMENT_QUERY_PAGE_MAX = 500;
23247
23348
  var sentimentSummaryRequestSchema = sentimentSelectionBaseSchema.extend({
23248
- include: z79.preprocess((value) => typeof value === "string" ? value.split(",").map((item) => item.trim()).filter(Boolean) : value, z79.array(sentimentSummaryIncludeSchema).max(2)).optional(),
23249
- queryLimit: z79.coerce.number().int().min(1).max(SENTIMENT_QUERY_PAGE_MAX).default(SENTIMENT_QUERY_PAGE_DEFAULT),
23250
- queryCursor: z79.string().min(1).max(16384).optional()
23349
+ include: z80.preprocess((value) => typeof value === "string" ? value.split(",").map((item) => item.trim()).filter(Boolean) : value, z80.array(sentimentSummaryIncludeSchema).max(2)).optional(),
23350
+ queryLimit: z80.coerce.number().int().min(1).max(SENTIMENT_QUERY_PAGE_MAX).default(SENTIMENT_QUERY_PAGE_DEFAULT),
23351
+ queryCursor: z80.string().min(1).max(16384).optional()
23251
23352
  }).superRefine(exclusiveSentimentRuns);
23252
- var sentimentEvidenceOutcomeFilterSchema = z79.preprocess((value) => {
23353
+ var sentimentEvidenceOutcomeFilterSchema = z80.preprocess((value) => {
23253
23354
  const items = typeof value === "string" ? [value] : Array.isArray(value) ? value : null;
23254
23355
  return items ? [...new Set(items.flatMap((item) => typeof item === "string" ? item.split(",").map((part) => part.trim()).filter(Boolean) : [item]))] : value;
23255
- }, z79.array(sentimentOutcomeSchema).min(1).max(sentimentOutcomeSchema.options.length));
23256
- var sentimentEvidenceRequestSchema = sentimentSelectionBaseSchema.extend({ assessmentId: id.optional(), outcome: sentimentEvidenceOutcomeFilterSchema.optional(), cursor: z79.string().min(1).max(16384).optional(), limit: z79.coerce.number().int().min(1).max(100).default(50) }).superRefine(exclusiveSentimentRuns);
23356
+ }, z80.array(sentimentOutcomeSchema).min(1).max(sentimentOutcomeSchema.options.length));
23357
+ var sentimentEvidenceRequestSchema = sentimentSelectionBaseSchema.extend({ assessmentId: id.optional(), outcome: sentimentEvidenceOutcomeFilterSchema.optional(), cursor: z80.string().min(1).max(16384).optional(), limit: z80.coerce.number().int().min(1).max(100).default(50) }).superRefine(exclusiveSentimentRuns);
23257
23358
  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) => {
23258
23359
  exclusiveSentimentRuns(value, ctx);
23259
23360
  if (value.runIds) ctx.addIssue({ code: "custom", path: ["runIds"], message: "Comparison requires one explicit run per period." });
23260
23361
  });
23261
- var sentimentResolvedSelectionSchema = sentimentSelectionBaseSchema.extend({ runId: id.nullable(), revision: z79.number().int().nullable(), evaluationDefinitionId: id.nullable(), mode: z79.enum(["simple", "advanced"]) });
23262
- var sentimentCountsSchema = z79.object(Object.fromEntries(sentimentOutcomeSchema.options.map((outcome) => [outcome, count]))).strict();
23263
- var sentimentCoverageSchema = z79.object({
23362
+ var sentimentResolvedSelectionSchema = sentimentSelectionBaseSchema.extend({ runId: id.nullable(), revision: z80.number().int().nullable(), evaluationDefinitionId: id.nullable(), mode: z80.enum(["simple", "advanced"]) });
23363
+ var sentimentCountsSchema = z80.object(Object.fromEntries(sentimentOutcomeSchema.options.map((outcome) => [outcome, count]))).strict();
23364
+ var sentimentCoverageSchema = z80.object({
23264
23365
  selected: count,
23265
23366
  eligibleAssessments: count,
23266
23367
  unadmittedAssessments: count,
@@ -23274,45 +23375,45 @@ var sentimentCoverageSchema = z79.object({
23274
23375
  expectedProviderSlots: count,
23275
23376
  completedProviderSlots: count
23276
23377
  }).strict();
23277
- var sentimentScoreSchema = z79.object({ favorableRate: rate, mixedRate: rate, unfavorableRate: rate, favorableDisplay: z79.string(), mixedDisplay: z79.string(), unfavorableDisplay: z79.string(), interval: z79.object({ low: z79.number(), high: z79.number() }).strict().nullable(), method: z79.literal("wilson-independent-v1"), limitation: z79.string() }).strict();
23278
- var headlineFields = { state: sentimentStateSchema, reason: z79.string().nullable(), provisional: z79.boolean(), coverage: sentimentCoverageSchema, score: sentimentScoreSchema };
23279
- var sentimentHeadlineSchema = z79.object({ ...headlineFields, selection: sentimentResolvedSelectionSchema, runIds: z79.array(id) }).strict();
23280
- var sentimentOverallHeadlineSchema = z79.object({ ...headlineFields, queryClass: z79.literal("all"), pooled: z79.literal(true).optional(), runIds: z79.array(id) }).strict();
23281
- var sentimentOverviewSchema = z79.object({ configured: z79.boolean(), branded: sentimentHeadlineSchema, nonBrand: sentimentHeadlineSchema, headlineQueryClass: z79.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();
23282
- var sentimentAssessmentSummarySchema = z79.object({
23378
+ var sentimentScoreSchema = z80.object({ favorableRate: rate, mixedRate: rate, unfavorableRate: rate, favorableDisplay: z80.string(), mixedDisplay: z80.string(), unfavorableDisplay: z80.string(), interval: z80.object({ low: z80.number(), high: z80.number() }).strict().nullable(), method: z80.literal("wilson-independent-v1"), limitation: z80.string() }).strict();
23379
+ var headlineFields = { state: sentimentStateSchema, reason: z80.string().nullable(), provisional: z80.boolean(), coverage: sentimentCoverageSchema, score: sentimentScoreSchema };
23380
+ var sentimentHeadlineSchema = z80.object({ ...headlineFields, selection: sentimentResolvedSelectionSchema, runIds: z80.array(id) }).strict();
23381
+ var sentimentOverallHeadlineSchema = z80.object({ ...headlineFields, queryClass: z80.literal("all"), pooled: z80.literal(true).optional(), runIds: z80.array(id) }).strict();
23382
+ var sentimentOverviewSchema = z80.object({ configured: z80.boolean(), branded: sentimentHeadlineSchema, nonBrand: sentimentHeadlineSchema, headlineQueryClass: z80.literal("branded").optional(), pooledOverall: sentimentOverallHeadlineSchema.optional(), overall: sentimentOverallHeadlineSchema.optional().describe("Deprecated compatibility field. Pooled branded and non-brand assessments; never use as the sentiment headline.") }).strict();
23383
+ var sentimentAssessmentSummarySchema = z80.object({
23283
23384
  assessmentId: id.nullable(),
23284
23385
  sourceSnapshotId: id,
23285
23386
  runId: id,
23286
23387
  subjectId: id,
23287
- subjectLabel: z79.string(),
23388
+ subjectLabel: z80.string(),
23288
23389
  executionNodeKey: id.nullable(),
23289
23390
  provider: id,
23290
- requestedModel: z79.string().nullable(),
23291
- servedModel: z79.string().nullable(),
23292
- location: z79.string().nullable(),
23391
+ requestedModel: z80.string().nullable(),
23392
+ servedModel: z80.string().nullable(),
23393
+ location: z80.string().nullable(),
23293
23394
  evaluationDefinitionId: id.nullable(),
23294
23395
  state: sentimentStateSchema,
23295
- outcome: z79.union([sentimentOutcomeSchema, z79.null()]),
23296
- reason: z79.string().nullable()
23396
+ outcome: z80.union([sentimentOutcomeSchema, z80.null()]),
23397
+ reason: z80.string().nullable()
23297
23398
  }).strict();
23298
- var sentimentQuerySummarySchema = z79.object({ ...headlineFields, queryId: id, executionNodeKey: id.nullable().optional(), queryText: z79.string(), queryClass: z79.enum(["branded", "non-brand"]), sourceSnapshotIds: z79.array(id), assessments: z79.array(sentimentAssessmentSummarySchema).default([]), locations: z79.array(z79.object({ ...headlineFields, location: z79.string().nullable(), sourceSnapshotIds: z79.array(id) }).strict()) }).strict();
23299
- var sentimentBreakdownSchema = z79.object({ ...headlineFields, dimension: z79.enum(["provider", "property", "market", "query"]), key: z79.string(), label: z79.string(), queryClass: z79.enum(["branded", "non-brand"]) }).strict();
23300
- var sentimentSummarySchema = z79.object({
23399
+ var sentimentQuerySummarySchema = z80.object({ ...headlineFields, queryId: id, executionNodeKey: id.nullable().optional(), queryText: z80.string(), queryClass: z80.enum(["branded", "non-brand"]), sourceSnapshotIds: z80.array(id), assessments: z80.array(sentimentAssessmentSummarySchema).default([]), locations: z80.array(z80.object({ ...headlineFields, location: z80.string().nullable(), sourceSnapshotIds: z80.array(id) }).strict()) }).strict();
23400
+ var sentimentBreakdownSchema = z80.object({ ...headlineFields, dimension: z80.enum(["provider", "property", "market", "query"]), key: z80.string(), label: z80.string(), queryClass: z80.enum(["branded", "non-brand"]) }).strict();
23401
+ var sentimentSummarySchema = z80.object({
23301
23402
  ...headlineFields,
23302
- configured: z79.boolean(),
23403
+ configured: z80.boolean(),
23303
23404
  selection: sentimentResolvedSelectionSchema,
23304
23405
  evaluationDefinition: sentimentEvaluationDefinitionSchema.nullable(),
23305
- breakdowns: z79.array(sentimentBreakdownSchema),
23306
- queries: z79.array(sentimentQuerySummarySchema),
23406
+ breakdowns: z80.array(sentimentBreakdownSchema),
23407
+ queries: z80.array(sentimentQuerySummarySchema),
23307
23408
  /**
23308
23409
  * Branded reads: the Properties with a mixed or unfavorable rating, most criticized first
23309
23410
  * ({@link rankCriticizedProperties}). `keys` are the first {@link SENTIMENT_CRITICIZED_PROPERTY_LIMIT}
23310
23411
  * property breakdown keys; `total` counts them all; `{ total: 0, keys: [] }` with fewer than two
23311
23412
  * Properties in view. Absent from older servers, comparison periods, and non-brand, disabled or unavailable reads.
23312
23413
  */
23313
- criticizedProperties: z79.object({ total: count, keys: z79.array(z79.string()) }).strict().optional(),
23414
+ criticizedProperties: z80.object({ total: count, keys: z80.array(z80.string()) }).strict().optional(),
23314
23415
  /** Present on the paged summary read; follow `nextCursor` as `queryCursor` for the next query rows. */
23315
- queryPage: z79.object({ total: count, limit: count, nextCursor: z79.string().nullable() }).strict().optional()
23416
+ queryPage: z80.object({ total: count, limit: count, nextCursor: z80.string().nullable() }).strict().optional()
23316
23417
  }).strict();
23317
23418
  var SENTIMENT_CRITICIZED_PROPERTY_LIMIT = 5;
23318
23419
  function rankCriticizedProperties(rows) {
@@ -23323,91 +23424,91 @@ function rankCriticizedProperties(rows) {
23323
23424
  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));
23324
23425
  return { total: criticized.length, keys: criticized.slice(0, SENTIMENT_CRITICIZED_PROPERTY_LIMIT).map((row) => row.key) };
23325
23426
  }
23326
- var sentimentSettingsUpdateSchema = z79.object({ enabled: z79.boolean().optional() }).strict();
23327
- var sentimentSettingsSchema = z79.object({
23427
+ var sentimentSettingsUpdateSchema = z80.object({ enabled: z80.boolean().optional() }).strict();
23428
+ var sentimentSettingsSchema = z80.object({
23328
23429
  provider: sentimentEvaluatorProviderSchema.optional(),
23329
- installEnabled: z79.boolean(),
23330
- enabled: z79.boolean(),
23331
- ready: z79.boolean(),
23332
- readinessReasons: z79.array(z79.string()),
23333
- model: z79.string(),
23430
+ installEnabled: z80.boolean(),
23431
+ enabled: z80.boolean(),
23432
+ ready: z80.boolean(),
23433
+ readinessReasons: z80.array(z80.string()),
23434
+ model: z80.string(),
23334
23435
  enablementEpoch: count,
23335
23436
  completionBoundary: count,
23336
23437
  evaluationDefinitionId: id.nullable(),
23337
- actions: z79.object({ configure: z79.boolean(), backfill: z79.boolean() }).strict(),
23338
- experimental: z79.literal(true),
23339
- disclosure: z79.string()
23340
- }).strict();
23341
- var sentimentBackfillSelectionSchema = sentimentSelectionBaseSchema.extend({ runIds: runIds.optional(), from: z79.string().datetime().optional(), to: z79.string().datetime().optional() }).superRefine(exclusiveSentimentRuns);
23342
- var sentimentBackfillRequestSchema = z79.object({ previewToken: z79.string().min(1).max(65536), idempotencyKey: z79.string().trim().min(1).max(128) }).strict();
23343
- var sentimentBackfillPreviewSchema = z79.object({
23344
- previewToken: z79.string().nullable(),
23345
- expiresAt: z79.string().nullable(),
23438
+ actions: z80.object({ configure: z80.boolean(), backfill: z80.boolean() }).strict(),
23439
+ experimental: z80.literal(true),
23440
+ disclosure: z80.string()
23441
+ }).strict();
23442
+ var sentimentBackfillSelectionSchema = sentimentSelectionBaseSchema.extend({ runIds: runIds.optional(), from: z80.string().datetime().optional(), to: z80.string().datetime().optional() }).superRefine(exclusiveSentimentRuns);
23443
+ var sentimentBackfillRequestSchema = z80.object({ previewToken: z80.string().min(1).max(65536), idempotencyKey: z80.string().trim().min(1).max(128) }).strict();
23444
+ var sentimentBackfillPreviewSchema = z80.object({
23445
+ previewToken: z80.string().nullable(),
23446
+ expiresAt: z80.string().nullable(),
23346
23447
  selection: sentimentBackfillSelectionSchema,
23347
23448
  evaluationDefinitionId: id.nullable(),
23348
23449
  eligibleAssessments: count,
23349
23450
  alreadyClassified: count,
23350
- skipped: z79.array(z79.object({ runId: id, reason: z79.string(), count }).strict()),
23451
+ skipped: z80.array(z80.object({ runId: id, reason: z80.string(), count }).strict()),
23351
23452
  estimatedInputTokens: count,
23352
- estimatedCostUsd: z79.number().nonnegative().nullable(),
23353
- estimateMethod: z79.string()
23453
+ estimatedCostUsd: z80.number().nonnegative().nullable(),
23454
+ estimateMethod: z80.string()
23354
23455
  }).strict();
23355
- var sentimentJobStateSchema = z79.enum(["pending", "running", "waiting-to-retry", "complete", "partial", "failed", "canceled"]);
23356
- var sentimentAttemptReceiptSchema = z79.object({ id, workItemId: id, dispatchedAt: z79.string(), completedAt: z79.string().nullable(), returnedModel: z79.string().nullable(), usage: sentimentUsageSchema, errorCode: z79.string().nullable() }).strict();
23357
- var sentimentJobSchema = z79.object({
23456
+ var sentimentJobStateSchema = z80.enum(["pending", "running", "waiting-to-retry", "complete", "partial", "failed", "canceled"]);
23457
+ var sentimentAttemptReceiptSchema = z80.object({ id, workItemId: id, dispatchedAt: z80.string(), completedAt: z80.string().nullable(), returnedModel: z80.string().nullable(), usage: sentimentUsageSchema, errorCode: z80.string().nullable() }).strict();
23458
+ var sentimentJobSchema = z80.object({
23358
23459
  id,
23359
23460
  projectId: id,
23360
- origin: z79.enum(["automatic", "backfill"]),
23461
+ origin: z80.enum(["automatic", "backfill"]),
23361
23462
  state: sentimentJobStateSchema,
23362
23463
  enablementEpoch: count,
23363
23464
  evaluationDefinitionId: id,
23364
23465
  selection: sentimentBackfillSelectionSchema,
23365
- createdAt: z79.string(),
23366
- updatedAt: z79.string(),
23466
+ createdAt: z80.string(),
23467
+ updatedAt: z80.string(),
23367
23468
  counts: sentimentCountsSchema,
23368
23469
  selected: count,
23369
- cancellationReason: z79.string().nullable(),
23370
- attempts: z79.array(sentimentAttemptReceiptSchema),
23470
+ cancellationReason: z80.string().nullable(),
23471
+ attempts: z80.array(sentimentAttemptReceiptSchema),
23371
23472
  /** Paged job read: every attempt of the job, and the cursor for the next (older) attempts. */
23372
23473
  attemptCount: count.optional(),
23373
- nextAttemptCursor: z79.string().nullable().optional()
23474
+ nextAttemptCursor: z80.string().nullable().optional()
23374
23475
  }).strict();
23375
23476
  var sentimentJobSummarySchema = sentimentJobSchema.omit({ attempts: true, attemptCount: true, nextAttemptCursor: true }).extend({ attemptCount: count }).strict();
23376
- var sentimentJobsSchema = z79.object({ jobs: z79.array(sentimentJobSummarySchema) }).strict();
23477
+ var sentimentJobsSchema = z80.object({ jobs: z80.array(sentimentJobSummarySchema) }).strict();
23377
23478
  var SENTIMENT_ATTEMPT_PAGE_DEFAULT = 50;
23378
- var sentimentJobRequestSchema = z79.object({
23379
- attemptLimit: z79.coerce.number().int().min(1).max(200).default(SENTIMENT_ATTEMPT_PAGE_DEFAULT),
23380
- attemptCursor: z79.string().min(1).max(4096).optional()
23479
+ var sentimentJobRequestSchema = z80.object({
23480
+ attemptLimit: z80.coerce.number().int().min(1).max(200).default(SENTIMENT_ATTEMPT_PAGE_DEFAULT),
23481
+ attemptCursor: z80.string().min(1).max(4096).optional()
23381
23482
  }).strict();
23382
- var sentimentEvidenceItemSchema = z79.object({
23483
+ var sentimentEvidenceItemSchema = z80.object({
23383
23484
  assessmentId: id,
23384
23485
  runId: id,
23385
23486
  sourceSnapshotId: id,
23386
- sourceText: z79.string(),
23487
+ sourceText: z80.string(),
23387
23488
  sourceTextHash: id,
23388
23489
  subject: sentimentSubjectSchema,
23389
23490
  subjectHash: id,
23390
23491
  context: sentimentExecutionContextSchema,
23391
23492
  evaluationDefinitionId: id,
23392
23493
  outcome: sentimentOutcomeSchema,
23393
- conclusion: z79.array(sentimentEvidenceSchema),
23394
- complaint: z79.array(sentimentEvidenceSchema).nullable(),
23395
- returnedModel: z79.string().nullable(),
23396
- reason: z79.string().nullable()
23494
+ conclusion: z80.array(sentimentEvidenceSchema),
23495
+ complaint: z80.array(sentimentEvidenceSchema).nullable(),
23496
+ returnedModel: z80.string().nullable(),
23497
+ reason: z80.string().nullable()
23397
23498
  }).strict();
23398
- var sentimentEvidencePageSchema = z79.object({ state: sentimentStateSchema, selection: sentimentResolvedSelectionSchema.extend({ assessmentId: id.optional(), outcome: z79.array(sentimentOutcomeSchema).optional() }), items: z79.array(sentimentEvidenceItemSchema), nextCursor: z79.string().nullable() }).strict();
23399
- var sentimentComparisonSchema = z79.object({
23499
+ var sentimentEvidencePageSchema = z80.object({ state: sentimentStateSchema, selection: sentimentResolvedSelectionSchema.extend({ assessmentId: id.optional(), outcome: z80.array(sentimentOutcomeSchema).optional() }), items: z80.array(sentimentEvidenceItemSchema), nextCursor: z80.string().nullable() }).strict();
23500
+ var sentimentComparisonSchema = z80.object({
23400
23501
  from: sentimentSummarySchema,
23401
23502
  to: sentimentSummarySchema,
23402
- verdict: z79.enum(["improved", "declined", "no-clear-change"]).nullable(),
23403
- favorableRateDelta: z79.number().nullable(),
23404
- refusalReasons: z79.array(z79.string()),
23503
+ verdict: z80.enum(["improved", "declined", "no-clear-change"]).nullable(),
23504
+ favorableRateDelta: z80.number().nullable(),
23505
+ refusalReasons: z80.array(z80.string()),
23405
23506
  commonUnits: count,
23406
23507
  excludedFrom: count,
23407
23508
  excludedTo: count,
23408
- changedScope: z79.boolean(),
23409
- method: z79.literal("wilson-independent-v1"),
23410
- limitation: z79.string()
23509
+ changedScope: z80.boolean(),
23510
+ method: z80.literal("wilson-independent-v1"),
23511
+ limitation: z80.string()
23411
23512
  }).strict();
23412
23513
  function emptySentimentCounts() {
23413
23514
  return Object.fromEntries(sentimentOutcomeSchema.options.map((outcome) => [outcome, 0]));
@@ -23444,7 +23545,7 @@ function aggregateSentiment(items, options = {}) {
23444
23545
  }
23445
23546
 
23446
23547
  // ../contracts/src/composites.ts
23447
- import { z as z80 } from "zod";
23548
+ import { z as z81 } from "zod";
23448
23549
  var PROJECT_OVERVIEW_QUERY_CLASS_SCOPE = {
23449
23550
  queryClass: "all",
23450
23551
  figures: [
@@ -23466,26 +23567,26 @@ var PROJECT_OVERVIEW_QUERY_CLASS_SCOPE = {
23466
23567
  ],
23467
23568
  note: "These figures pool branded and non-brand queries in one denominator. Only scores.mentionShare splits the classes. For one class, use a read filtered by queryClass."
23468
23569
  };
23469
- var metricToneSchema = z80.enum(["positive", "caution", "negative", "neutral"]);
23470
- var scoreSummarySchema = z80.object({
23471
- label: z80.string(),
23472
- value: z80.string(),
23473
- delta: z80.string(),
23570
+ var metricToneSchema = z81.enum(["positive", "caution", "negative", "neutral"]);
23571
+ var scoreSummarySchema = z81.object({
23572
+ label: z81.string(),
23573
+ value: z81.string(),
23574
+ delta: z81.string(),
23474
23575
  tone: metricToneSchema,
23475
- description: z80.string(),
23476
- tooltip: z80.string().optional(),
23477
- trend: z80.array(percent()),
23576
+ description: z81.string(),
23577
+ tooltip: z81.string().optional(),
23578
+ trend: z81.array(percent()),
23478
23579
  progress: percent().optional(),
23479
- providerCoverage: z80.string().optional()
23580
+ providerCoverage: z81.string().optional()
23480
23581
  });
23481
- var mentionShareBreakdownSchema = z80.object({
23482
- projectMentionSnapshots: z80.number().int().nonnegative(),
23483
- competitorMentionSnapshots: z80.number().int().nonnegative(),
23582
+ var mentionShareBreakdownSchema = z81.object({
23583
+ projectMentionSnapshots: z81.number().int().nonnegative(),
23584
+ competitorMentionSnapshots: z81.number().int().nonnegative(),
23484
23585
  /** `projectMentionSnapshots + competitorMentionSnapshots`, the denominator of `score` and every `ranking` share. */
23485
- combinedMentionSnapshots: z80.number().int().nonnegative(),
23486
- perCompetitor: z80.array(z80.object({
23487
- domain: z80.string(),
23488
- mentionSnapshots: z80.number().int().nonnegative(),
23586
+ combinedMentionSnapshots: z81.number().int().nonnegative(),
23587
+ perCompetitor: z81.array(z81.object({
23588
+ domain: z81.string(),
23589
+ mentionSnapshots: z81.number().int().nonnegative(),
23489
23590
  shareOfCompetitiveTotal: percent()
23490
23591
  })),
23491
23592
  /**
@@ -23495,50 +23596,50 @@ var mentionShareBreakdownSchema = z80.object({
23495
23596
  * Empty when there is no head-to-head: no tracked competitors, or no brand
23496
23597
  * named in this class.
23497
23598
  */
23498
- ranking: z80.array(z80.object({
23499
- kind: z80.enum(["project", "competitor"]),
23599
+ ranking: z81.array(z81.object({
23600
+ kind: z81.enum(["project", "competitor"]),
23500
23601
  /** The tracked competitor's domain. Null on the project's row. */
23501
- domain: z80.string().nullable(),
23502
- mentionSnapshots: z80.number().int().nonnegative(),
23503
- share: fraction(z80.number().min(0).max(1))
23602
+ domain: z81.string().nullable(),
23603
+ mentionSnapshots: z81.number().int().nonnegative(),
23604
+ share: fraction(z81.number().min(0).max(1))
23504
23605
  })),
23505
- snapshotsWithAnswerText: z80.number().int().nonnegative(),
23506
- snapshotsTotal: z80.number().int().nonnegative(),
23507
- score: percent(z80.number().min(0).max(100)).nullable()
23606
+ snapshotsWithAnswerText: z81.number().int().nonnegative(),
23607
+ snapshotsTotal: z81.number().int().nonnegative(),
23608
+ score: percent(z81.number().min(0).max(100)).nullable()
23508
23609
  });
23509
23610
  var mentionShareSchema = scoreSummarySchema.extend({
23510
23611
  /** Non-brand queries — the competitive figure. See `MentionShareDto`. */
23511
23612
  breakdown: mentionShareBreakdownSchema,
23512
- scope: z80.enum(["non-brand", "pooled"]),
23613
+ scope: z81.enum(["non-brand", "pooled"]),
23513
23614
  /** Branded queries, beside the competitive figure and never inside it. */
23514
23615
  branded: mentionShareBreakdownSchema
23515
23616
  });
23516
- var movementSummarySchema = z80.object({
23517
- gained: z80.number().int().nonnegative(),
23518
- lost: z80.number().int().nonnegative(),
23617
+ var movementSummarySchema = z81.object({
23618
+ gained: z81.number().int().nonnegative(),
23619
+ lost: z81.number().int().nonnegative(),
23519
23620
  tone: metricToneSchema,
23520
- hasPreviousRun: z80.boolean(),
23521
- gainedQueries: z80.array(z80.string()).optional(),
23522
- lostQueries: z80.array(z80.string()).optional()
23523
- });
23524
- var movementComparisonSchema = z80.object({
23525
- hasPreviousRun: z80.boolean(),
23526
- comparable: z80.boolean(),
23527
- querySetChanged: z80.boolean(),
23528
- previousRunAt: z80.string().nullable(),
23529
- currentQueryCount: z80.number().int().nonnegative(),
23530
- previousQueryCount: z80.number().int().nonnegative(),
23531
- comparableQueryCount: z80.number().int().nonnegative(),
23532
- addedQueryCount: z80.number().int().nonnegative(),
23533
- removedQueryCount: z80.number().int().nonnegative(),
23534
- addedQueries: z80.array(z80.string()),
23535
- removedQueries: z80.array(z80.string())
23536
- });
23537
- var projectOverviewInsightSchema = z80.object({
23538
- id: z80.string(),
23539
- projectId: z80.string(),
23540
- runId: z80.string().nullable(),
23541
- type: z80.enum([
23621
+ hasPreviousRun: z81.boolean(),
23622
+ gainedQueries: z81.array(z81.string()).optional(),
23623
+ lostQueries: z81.array(z81.string()).optional()
23624
+ });
23625
+ var movementComparisonSchema = z81.object({
23626
+ hasPreviousRun: z81.boolean(),
23627
+ comparable: z81.boolean(),
23628
+ querySetChanged: z81.boolean(),
23629
+ previousRunAt: z81.string().nullable(),
23630
+ currentQueryCount: z81.number().int().nonnegative(),
23631
+ previousQueryCount: z81.number().int().nonnegative(),
23632
+ comparableQueryCount: z81.number().int().nonnegative(),
23633
+ addedQueryCount: z81.number().int().nonnegative(),
23634
+ removedQueryCount: z81.number().int().nonnegative(),
23635
+ addedQueries: z81.array(z81.string()),
23636
+ removedQueries: z81.array(z81.string())
23637
+ });
23638
+ var projectOverviewInsightSchema = z81.object({
23639
+ id: z81.string(),
23640
+ projectId: z81.string(),
23641
+ runId: z81.string().nullable(),
23642
+ type: z81.enum([
23542
23643
  "regression",
23543
23644
  "gain",
23544
23645
  "opportunity",
@@ -23555,75 +23656,75 @@ var projectOverviewInsightSchema = z80.object({
23555
23656
  "gbp-keyword-drop"
23556
23657
  ]),
23557
23658
  severity: insightSeveritySchema,
23558
- title: z80.string(),
23559
- query: z80.string(),
23560
- provider: z80.string(),
23561
- recommendation: z80.object({
23562
- action: z80.string(),
23563
- target: z80.string().optional(),
23564
- reason: z80.string()
23659
+ title: z81.string(),
23660
+ query: z81.string(),
23661
+ provider: z81.string(),
23662
+ recommendation: z81.object({
23663
+ action: z81.string(),
23664
+ target: z81.string().optional(),
23665
+ reason: z81.string()
23565
23666
  }).optional(),
23566
- cause: z80.object({
23567
- cause: z80.string(),
23568
- competitorDomain: z80.string().optional(),
23569
- details: z80.string().optional()
23667
+ cause: z81.object({
23668
+ cause: z81.string(),
23669
+ competitorDomain: z81.string().optional(),
23670
+ details: z81.string().optional()
23570
23671
  }).optional(),
23571
- dismissed: z80.boolean(),
23572
- createdAt: z80.string()
23672
+ dismissed: z81.boolean(),
23673
+ createdAt: z81.string()
23573
23674
  });
23574
- var projectOverviewHealthSchema = z80.object({
23575
- id: z80.string(),
23576
- projectId: z80.string(),
23577
- runId: z80.string().nullable(),
23675
+ var projectOverviewHealthSchema = z81.object({
23676
+ id: z81.string(),
23677
+ projectId: z81.string(),
23678
+ runId: z81.string().nullable(),
23578
23679
  overallCitedRate: fraction(),
23579
23680
  overallMentionRate: fraction(),
23580
- totalPairs: z80.number().int().nonnegative(),
23581
- citedPairs: z80.number().int().nonnegative(),
23582
- mentionedPairs: z80.number().int().nonnegative(),
23583
- providerBreakdown: z80.record(z80.string(), z80.object({
23681
+ totalPairs: z81.number().int().nonnegative(),
23682
+ citedPairs: z81.number().int().nonnegative(),
23683
+ mentionedPairs: z81.number().int().nonnegative(),
23684
+ providerBreakdown: z81.record(z81.string(), z81.object({
23584
23685
  citedRate: fraction(),
23585
23686
  mentionRate: fraction(),
23586
- cited: z80.number().int().nonnegative(),
23587
- mentioned: z80.number().int().nonnegative(),
23588
- total: z80.number().int().nonnegative()
23687
+ cited: z81.number().int().nonnegative(),
23688
+ mentioned: z81.number().int().nonnegative(),
23689
+ total: z81.number().int().nonnegative()
23589
23690
  })),
23590
- createdAt: z80.string(),
23591
- status: z80.enum(["ready", "no-data"]),
23592
- reason: z80.literal("no-runs-yet").optional()
23691
+ createdAt: z81.string(),
23692
+ status: z81.enum(["ready", "no-data"]),
23693
+ reason: z81.literal("no-runs-yet").optional()
23593
23694
  });
23594
- var projectOverviewDtoSchema = z80.object({
23695
+ var projectOverviewDtoSchema = z81.object({
23595
23696
  sentiment: sentimentOverviewSchema.optional(),
23596
23697
  project: projectDtoSchema,
23597
23698
  latestRun: latestProjectRunDtoSchema,
23598
23699
  health: projectOverviewHealthSchema.nullable(),
23599
- topInsights: z80.array(projectOverviewInsightSchema),
23600
- queryClassScope: z80.object({
23601
- queryClass: z80.literal("all"),
23602
- figures: z80.array(z80.string()),
23603
- note: z80.string()
23700
+ topInsights: z81.array(projectOverviewInsightSchema),
23701
+ queryClassScope: z81.object({
23702
+ queryClass: z81.literal("all"),
23703
+ figures: z81.array(z81.string()),
23704
+ note: z81.string()
23604
23705
  }).optional(),
23605
- queryCounts: z80.object({
23606
- totalQueries: z80.number().int().nonnegative(),
23607
- citedQueries: z80.number().int().nonnegative(),
23608
- notCitedQueries: z80.number().int().nonnegative(),
23706
+ queryCounts: z81.object({
23707
+ totalQueries: z81.number().int().nonnegative(),
23708
+ citedQueries: z81.number().int().nonnegative(),
23709
+ notCitedQueries: z81.number().int().nonnegative(),
23609
23710
  citedRate: fraction(),
23610
- mentionedQueries: z80.number().int().nonnegative(),
23611
- notMentionedQueries: z80.number().int().nonnegative(),
23711
+ mentionedQueries: z81.number().int().nonnegative(),
23712
+ notMentionedQueries: z81.number().int().nonnegative(),
23612
23713
  mentionRate: fraction()
23613
23714
  }),
23614
- providers: z80.array(z80.object({
23615
- provider: z80.string(),
23715
+ providers: z81.array(z81.object({
23716
+ provider: z81.string(),
23616
23717
  citedRate: fraction(),
23617
- cited: z80.number().int().nonnegative(),
23618
- total: z80.number().int().nonnegative()
23718
+ cited: z81.number().int().nonnegative(),
23719
+ total: z81.number().int().nonnegative()
23619
23720
  })),
23620
- transitions: z80.object({
23621
- since: z80.string().nullable(),
23622
- gained: z80.number().int().nonnegative(),
23623
- lost: z80.number().int().nonnegative(),
23624
- emerging: z80.number().int().nonnegative()
23721
+ transitions: z81.object({
23722
+ since: z81.string().nullable(),
23723
+ gained: z81.number().int().nonnegative(),
23724
+ lost: z81.number().int().nonnegative(),
23725
+ emerging: z81.number().int().nonnegative()
23625
23726
  }),
23626
- scores: z80.object({
23727
+ scores: z81.object({
23627
23728
  mention: scoreSummarySchema,
23628
23729
  visibility: scoreSummarySchema,
23629
23730
  mentionShare: mentionShareSchema,
@@ -23637,74 +23738,74 @@ var projectOverviewDtoSchema = z80.object({
23637
23738
  citationMovement: movementSummarySchema,
23638
23739
  mentionMovement: movementSummarySchema,
23639
23740
  movementComparison: movementComparisonSchema,
23640
- competitors: z80.array(z80.object({
23641
- id: z80.string(),
23642
- domain: z80.string(),
23643
- aliases: z80.array(z80.string()).optional(),
23644
- autoAliasNames: z80.array(z80.string()).optional(),
23645
- citationCount: z80.number().int().nonnegative(),
23646
- totalQueries: z80.number().int().nonnegative(),
23647
- pressureLabel: z80.enum(["None", "Low", "Moderate", "High"]),
23648
- citedQueries: z80.array(z80.string())
23741
+ competitors: z81.array(z81.object({
23742
+ id: z81.string(),
23743
+ domain: z81.string(),
23744
+ aliases: z81.array(z81.string()).optional(),
23745
+ autoAliasNames: z81.array(z81.string()).optional(),
23746
+ citationCount: z81.number().int().nonnegative(),
23747
+ totalQueries: z81.number().int().nonnegative(),
23748
+ pressureLabel: z81.enum(["None", "Low", "Moderate", "High"]),
23749
+ citedQueries: z81.array(z81.string())
23649
23750
  })),
23650
- providerScores: z80.array(z80.object({
23651
- provider: z80.string(),
23652
- model: z80.string().nullable(),
23751
+ providerScores: z81.array(z81.object({
23752
+ provider: z81.string(),
23753
+ model: z81.string().nullable(),
23653
23754
  score: percent(),
23654
- cited: z80.number().int().nonnegative(),
23655
- total: z80.number().int().nonnegative(),
23656
- trend: z80.array(percent()).optional()
23755
+ cited: z81.number().int().nonnegative(),
23756
+ total: z81.number().int().nonnegative(),
23757
+ trend: z81.array(percent()).optional()
23657
23758
  })),
23658
- attentionItems: z80.array(z80.object({
23659
- id: z80.string(),
23759
+ attentionItems: z81.array(z81.object({
23760
+ id: z81.string(),
23660
23761
  tone: metricToneSchema,
23661
- title: z80.string(),
23662
- detail: z80.string(),
23663
- actionLabel: z80.string(),
23664
- href: z80.string()
23762
+ title: z81.string(),
23763
+ detail: z81.string(),
23764
+ actionLabel: z81.string(),
23765
+ href: z81.string()
23665
23766
  })),
23666
- runHistory: z80.array(z80.object({
23667
- runId: z80.string(),
23668
- createdAt: z80.string(),
23669
- citedCount: z80.number().int().nonnegative(),
23670
- totalCount: z80.number().int().nonnegative(),
23767
+ runHistory: z81.array(z81.object({
23768
+ runId: z81.string(),
23769
+ createdAt: z81.string(),
23770
+ citedCount: z81.number().int().nonnegative(),
23771
+ totalCount: z81.number().int().nonnegative(),
23671
23772
  citationRate: percent(),
23672
- mentionedCount: z80.number().int().nonnegative(),
23773
+ mentionedCount: z81.number().int().nonnegative(),
23673
23774
  mentionRate: percent(),
23674
- status: z80.string()
23775
+ status: z81.string()
23675
23776
  })),
23676
- suggestedQueries: z80.object({
23677
- rows: z80.array(z80.object({
23678
- query: z80.string(),
23679
- impressions: z80.number(),
23680
- clicks: z80.number(),
23681
- avgPosition: z80.number(),
23682
- reason: z80.string()
23777
+ suggestedQueries: z81.object({
23778
+ rows: z81.array(z81.object({
23779
+ query: z81.string(),
23780
+ impressions: z81.number(),
23781
+ clicks: z81.number(),
23782
+ avgPosition: z81.number(),
23783
+ reason: z81.string()
23683
23784
  })),
23684
- totalCandidates: z80.number().int().nonnegative(),
23685
- skippedAlreadyTracked: z80.number().int().nonnegative()
23785
+ totalCandidates: z81.number().int().nonnegative(),
23786
+ skippedAlreadyTracked: z81.number().int().nonnegative()
23686
23787
  }),
23687
- dateRangeLabel: z80.string(),
23688
- contextLabel: z80.string()
23689
- });
23690
- var searchHitKindSchema = z80.enum(["snapshot", "insight"]);
23691
- var projectSearchSnapshotHitSchema = z80.object({
23692
- kind: z80.literal("snapshot"),
23693
- id: z80.string(),
23694
- runId: z80.string(),
23695
- query: z80.string(),
23696
- provider: z80.string(),
23697
- model: z80.string().nullable(),
23788
+ dateRangeLabel: z81.string(),
23789
+ contextLabel: z81.string()
23790
+ });
23791
+ var searchHitKindSchema = z81.enum(["snapshot", "insight"]);
23792
+ var projectSearchSnapshotHitSchema = z81.object({
23793
+ kind: z81.literal("snapshot"),
23794
+ id: z81.string(),
23795
+ runId: z81.string(),
23796
+ query: z81.string(),
23797
+ provider: z81.string(),
23798
+ model: z81.string().nullable(),
23698
23799
  citationState: citationStateSchema,
23699
- matchedField: z80.enum(["answerText", "citedDomains", "citedUrls", "searchQueries", "query"]),
23700
- snippet: z80.string(),
23701
- createdAt: z80.string()
23702
- });
23703
- var projectSearchInsightHitSchema = z80.object({
23704
- kind: z80.literal("insight"),
23705
- id: z80.string(),
23706
- runId: z80.string().nullable(),
23707
- type: z80.enum([
23800
+ matchedField: z81.enum(["answerText", "citedDomains", "citedUrls", "searchQueries", "query"]),
23801
+ snippet: z81.string(),
23802
+ createdAt: z81.string()
23803
+ });
23804
+ var projectSearchInsightHitSchema = z81.object({
23805
+ kind: z81.literal("insight"),
23806
+ id: z81.string(),
23807
+ runId: z81.string().nullable(),
23808
+ type: z81.enum([
23708
23809
  "regression",
23709
23810
  "gain",
23710
23811
  "opportunity",
@@ -23722,23 +23823,23 @@ var projectSearchInsightHitSchema = z80.object({
23722
23823
  "gbp-keyword-drop"
23723
23824
  ]),
23724
23825
  severity: insightSeveritySchema,
23725
- title: z80.string(),
23726
- query: z80.string(),
23727
- provider: z80.string(),
23728
- matchedField: z80.enum(["title", "query", "recommendation", "cause"]),
23729
- snippet: z80.string(),
23730
- dismissed: z80.boolean(),
23731
- createdAt: z80.string()
23732
- });
23733
- var projectSearchHitSchema = z80.discriminatedUnion("kind", [
23826
+ title: z81.string(),
23827
+ query: z81.string(),
23828
+ provider: z81.string(),
23829
+ matchedField: z81.enum(["title", "query", "recommendation", "cause"]),
23830
+ snippet: z81.string(),
23831
+ dismissed: z81.boolean(),
23832
+ createdAt: z81.string()
23833
+ });
23834
+ var projectSearchHitSchema = z81.discriminatedUnion("kind", [
23734
23835
  projectSearchSnapshotHitSchema,
23735
23836
  projectSearchInsightHitSchema
23736
23837
  ]);
23737
- var projectSearchResponseSchema = z80.object({
23738
- query: z80.string(),
23739
- totalHits: z80.number().int().nonnegative(),
23740
- truncated: z80.boolean(),
23741
- hits: z80.array(projectSearchHitSchema)
23838
+ var projectSearchResponseSchema = z81.object({
23839
+ query: z81.string(),
23840
+ totalHits: z81.number().int().nonnegative(),
23841
+ truncated: z81.boolean(),
23842
+ hits: z81.array(projectSearchHitSchema)
23742
23843
  });
23743
23844
 
23744
23845
  // ../contracts/src/index-coverage.ts
@@ -23802,52 +23903,52 @@ function summarizeObservedQueryCounts(snapshots) {
23802
23903
  }
23803
23904
 
23804
23905
  // ../contracts/src/citations.ts
23805
- import { z as z81 } from "zod";
23806
- var citationCoverageProviderSchema = z81.object({
23807
- provider: z81.string(),
23906
+ import { z as z82 } from "zod";
23907
+ var citationCoverageProviderSchema = z82.object({
23908
+ provider: z82.string(),
23808
23909
  citationState: citationStateSchema,
23809
- cited: z81.boolean(),
23810
- mentioned: z81.boolean(),
23811
- runId: z81.string(),
23812
- runCreatedAt: z81.string()
23813
- });
23814
- var citationCoverageRowSchema = z81.object({
23815
- queryId: z81.string(),
23816
- query: z81.string(),
23817
- providers: z81.array(citationCoverageProviderSchema),
23818
- citedCount: z81.number().int().nonnegative(),
23819
- mentionedCount: z81.number().int().nonnegative(),
23820
- totalProviders: z81.number().int().nonnegative()
23821
- });
23822
- var competitorGapRowSchema = z81.object({
23823
- queryId: z81.string(),
23824
- query: z81.string(),
23825
- provider: z81.string(),
23826
- citingCompetitors: z81.array(z81.string()),
23827
- runId: z81.string(),
23828
- runCreatedAt: z81.string()
23829
- });
23830
- var citationVisibilitySummarySchema = z81.object({
23831
- providersConfigured: z81.number().int().nonnegative(),
23832
- providersCiting: z81.number().int().nonnegative(),
23833
- providersMentioning: z81.number().int().nonnegative(),
23834
- totalQueries: z81.number().int().nonnegative(),
23910
+ cited: z82.boolean(),
23911
+ mentioned: z82.boolean(),
23912
+ runId: z82.string(),
23913
+ runCreatedAt: z82.string()
23914
+ });
23915
+ var citationCoverageRowSchema = z82.object({
23916
+ queryId: z82.string(),
23917
+ query: z82.string(),
23918
+ providers: z82.array(citationCoverageProviderSchema),
23919
+ citedCount: z82.number().int().nonnegative(),
23920
+ mentionedCount: z82.number().int().nonnegative(),
23921
+ totalProviders: z82.number().int().nonnegative()
23922
+ });
23923
+ var competitorGapRowSchema = z82.object({
23924
+ queryId: z82.string(),
23925
+ query: z82.string(),
23926
+ provider: z82.string(),
23927
+ citingCompetitors: z82.array(z82.string()),
23928
+ runId: z82.string(),
23929
+ runCreatedAt: z82.string()
23930
+ });
23931
+ var citationVisibilitySummarySchema = z82.object({
23932
+ providersConfigured: z82.number().int().nonnegative(),
23933
+ providersCiting: z82.number().int().nonnegative(),
23934
+ providersMentioning: z82.number().int().nonnegative(),
23935
+ totalQueries: z82.number().int().nonnegative(),
23835
23936
  // Cross-tab buckets — each tracked query with at least one snapshot lands
23836
23937
  // in exactly one of these. Queries with zero snapshots are not counted in
23837
23938
  // any bucket; (sum of buckets) ≤ totalQueries.
23838
- queriesCitedAndMentioned: z81.number().int().nonnegative(),
23839
- queriesCitedOnly: z81.number().int().nonnegative(),
23840
- queriesMentionedOnly: z81.number().int().nonnegative(),
23841
- queriesInvisible: z81.number().int().nonnegative(),
23842
- latestRunId: z81.string().nullable(),
23843
- latestRunAt: z81.string().nullable()
23844
- });
23845
- var citationVisibilityResponseSchema = z81.object({
23939
+ queriesCitedAndMentioned: z82.number().int().nonnegative(),
23940
+ queriesCitedOnly: z82.number().int().nonnegative(),
23941
+ queriesMentionedOnly: z82.number().int().nonnegative(),
23942
+ queriesInvisible: z82.number().int().nonnegative(),
23943
+ latestRunId: z82.string().nullable(),
23944
+ latestRunAt: z82.string().nullable()
23945
+ });
23946
+ var citationVisibilityResponseSchema = z82.object({
23846
23947
  summary: citationVisibilitySummarySchema,
23847
- byQuery: z81.array(citationCoverageRowSchema),
23848
- competitorGaps: z81.array(competitorGapRowSchema),
23849
- status: z81.enum(["ready", "no-data"]),
23850
- reason: z81.enum(["no-runs-yet", "no-queries"]).optional()
23948
+ byQuery: z82.array(citationCoverageRowSchema),
23949
+ competitorGaps: z82.array(competitorGapRowSchema),
23950
+ status: z82.enum(["ready", "no-data"]),
23951
+ reason: z82.enum(["no-runs-yet", "no-queries"]).optional()
23851
23952
  });
23852
23953
  function emptyCitationVisibility(reason) {
23853
23954
  return {
@@ -23874,103 +23975,103 @@ function citationStateToCited(state) {
23874
23975
  }
23875
23976
 
23876
23977
  // ../contracts/src/organic-evidence.ts
23877
- import { z as z82 } from "zod";
23878
- var organicEvidencePeriodSchema = z82.union(windowDayValues(WINDOW_SETS.organicEvidence).map((value) => z82.literal(value)));
23978
+ import { z as z83 } from "zod";
23979
+ var organicEvidencePeriodSchema = z83.union(windowDayValues(WINDOW_SETS.organicEvidence).map((value) => z83.literal(value)));
23879
23980
  function parseOrganicEvidencePeriod(value) {
23880
23981
  return windowDays(parseWindowIn(value, WINDOW_SETS.organicEvidence, { field: "period", fallback: "90d" }));
23881
23982
  }
23882
- var cohortNameSchema = z82.enum(["earliest", "middle", "prior", "latest"]);
23883
- var countSchema = z82.object({
23884
- clicks: z82.number().int().nonnegative(),
23885
- impressions: z82.number().int().nonnegative()
23983
+ var cohortNameSchema = z83.enum(["earliest", "middle", "prior", "latest"]);
23984
+ var countSchema = z83.object({
23985
+ clicks: z83.number().int().nonnegative(),
23986
+ impressions: z83.number().int().nonnegative()
23886
23987
  });
23887
- var cohortSchema = z82.object({
23988
+ var cohortSchema = z83.object({
23888
23989
  name: cohortNameSchema,
23889
- startDate: z82.string(),
23890
- endDate: z82.string()
23990
+ startDate: z83.string(),
23991
+ endDate: z83.string()
23891
23992
  });
23892
23993
  var searchCohortSchema = cohortSchema.extend({ totals: countSchema });
23893
23994
  var sessionCohortSchema = cohortSchema.extend({
23894
- organicSessions: z82.number().int().nonnegative()
23895
- });
23896
- var sourceCoverageSchema = z82.object({
23897
- startDate: z82.string(),
23898
- endDate: z82.string(),
23899
- observedDays: z82.number().int().nonnegative()
23900
- });
23901
- var crawlerCountsSchema = z82.object({
23902
- verified: z82.number().int().nonnegative(),
23903
- claimedUnverified: z82.number().int().nonnegative(),
23904
- unknownAiLike: z82.number().int().nonnegative()
23905
- });
23906
- var referralCountsSchema = z82.object({
23907
- total: z82.number().int().nonnegative(),
23908
- paid: z82.number().int().nonnegative(),
23909
- organic: z82.number().int().nonnegative(),
23910
- unknown: z82.number().int().nonnegative()
23911
- });
23912
- var organicEvidenceDtoSchema = z82.object({
23913
- contractVersion: z82.literal("organic-evidence/v1"),
23995
+ organicSessions: z83.number().int().nonnegative()
23996
+ });
23997
+ var sourceCoverageSchema = z83.object({
23998
+ startDate: z83.string(),
23999
+ endDate: z83.string(),
24000
+ observedDays: z83.number().int().nonnegative()
24001
+ });
24002
+ var crawlerCountsSchema = z83.object({
24003
+ verified: z83.number().int().nonnegative(),
24004
+ claimedUnverified: z83.number().int().nonnegative(),
24005
+ unknownAiLike: z83.number().int().nonnegative()
24006
+ });
24007
+ var referralCountsSchema = z83.object({
24008
+ total: z83.number().int().nonnegative(),
24009
+ paid: z83.number().int().nonnegative(),
24010
+ organic: z83.number().int().nonnegative(),
24011
+ unknown: z83.number().int().nonnegative()
24012
+ });
24013
+ var organicEvidenceDtoSchema = z83.object({
24014
+ contractVersion: z83.literal("organic-evidence/v1"),
23914
24015
  periodDays: organicEvidencePeriodSchema,
23915
24016
  /** Latest headline evidence date, preferring the GSC property date when available. */
23916
- asOfDate: z82.string().nullable(),
23917
- coverage: z82.object({
23918
- gsc: z82.boolean(),
23919
- ga4: z82.boolean(),
23920
- server: z82.boolean(),
23921
- visibility: z82.boolean()
24017
+ asOfDate: z83.string().nullable(),
24018
+ coverage: z83.object({
24019
+ gsc: z83.boolean(),
24020
+ ga4: z83.boolean(),
24021
+ server: z83.boolean(),
24022
+ visibility: z83.boolean()
23922
24023
  }),
23923
- sourceCoverage: z82.object({
24024
+ sourceCoverage: z83.object({
23924
24025
  gsc: sourceCoverageSchema.nullable(),
23925
24026
  ga4: sourceCoverageSchema.nullable(),
23926
24027
  server: sourceCoverageSchema.nullable(),
23927
- visibility: z82.object({ completedAt: z82.string(), ageDays: z82.number().nonnegative() }).nullable()
24028
+ visibility: z83.object({ completedAt: z83.string(), ageDays: z83.number().nonnegative() }).nullable()
23928
24029
  }),
23929
- gsc: z82.object({
24030
+ gsc: z83.object({
23930
24031
  propertyTotals: countSchema,
23931
24032
  namedBrand: countSchema,
23932
24033
  namedNonBrand: countSchema,
23933
24034
  suppressedOrUnreportedResidual: countSchema,
23934
- cohorts: z82.array(searchCohortSchema)
24035
+ cohorts: z83.array(searchCohortSchema)
23935
24036
  }).nullable(),
23936
- ga4: z82.object({
23937
- organicSessions: z82.number().int().nonnegative(),
23938
- cohorts: z82.array(sessionCohortSchema)
24037
+ ga4: z83.object({
24038
+ organicSessions: z83.number().int().nonnegative(),
24039
+ cohorts: z83.array(sessionCohortSchema)
23939
24040
  }).nullable(),
23940
- gaAiReferrals: z82.object({
23941
- paidSessions: z82.number().int().nonnegative(),
23942
- organicSessions: z82.number().int().nonnegative()
24041
+ gaAiReferrals: z83.object({
24042
+ paidSessions: z83.number().int().nonnegative(),
24043
+ organicSessions: z83.number().int().nonnegative()
23943
24044
  }).nullable(),
23944
- server: z82.object({
24045
+ server: z83.object({
23945
24046
  crawlerHits: crawlerCountsSchema,
23946
24047
  userFetchHits: crawlerCountsSchema,
23947
24048
  referralSessions: referralCountsSchema
23948
24049
  }).nullable(),
23949
- visibility: z82.object({
23950
- runId: z82.string(),
23951
- completedAt: z82.string(),
23952
- ageDays: z82.number().nonnegative(),
23953
- answerPairs: z82.number().int().nonnegative(),
23954
- mentionedPairs: z82.number().int().nonnegative(),
23955
- citedPairs: z82.number().int().nonnegative()
24050
+ visibility: z83.object({
24051
+ runId: z83.string(),
24052
+ completedAt: z83.string(),
24053
+ ageDays: z83.number().nonnegative(),
24054
+ answerPairs: z83.number().int().nonnegative(),
24055
+ mentionedPairs: z83.number().int().nonnegative(),
24056
+ citedPairs: z83.number().int().nonnegative()
23956
24057
  }).nullable(),
23957
24058
  measurement: gaMeasurementAnalysisDtoSchema,
23958
- pages: z82.array(z82.object({
23959
- path: z82.string(),
24059
+ pages: z83.array(z83.object({
24060
+ path: z83.string(),
23960
24061
  gsc: countSchema,
23961
- ga4OrganicSessions: z82.number().int().nonnegative(),
23962
- server: z82.object({
24062
+ ga4OrganicSessions: z83.number().int().nonnegative(),
24063
+ server: z83.object({
23963
24064
  crawlerHits: crawlerCountsSchema,
23964
24065
  userFetchHits: crawlerCountsSchema,
23965
24066
  referralSessions: referralCountsSchema
23966
24067
  })
23967
24068
  })),
23968
- findings: z82.array(z82.object({
23969
- tone: z82.enum(["positive", "caution", "neutral"]),
23970
- title: z82.string(),
23971
- detail: z82.string()
24069
+ findings: z83.array(z83.object({
24070
+ tone: z83.enum(["positive", "caution", "neutral"]),
24071
+ title: z83.string(),
24072
+ detail: z83.string()
23972
24073
  })),
23973
- limitations: z82.array(z82.object({ code: z82.string(), detail: z82.string() }))
24074
+ limitations: z83.array(z83.object({ code: z83.string(), detail: z83.string() }))
23974
24075
  });
23975
24076
 
23976
24077
  // ../contracts/src/traffic-path.ts
@@ -24268,9 +24369,9 @@ function serializeForInlineScript(value) {
24268
24369
  }
24269
24370
 
24270
24371
  // ../contracts/src/outcome-telemetry.ts
24271
- import { z as z83 } from "zod";
24372
+ import { z as z84 } from "zod";
24272
24373
  var OUTCOME_SURFACES = ["cli", "mcp-stdio", "mcp-http", "aero", "api", "dashboard", "system"];
24273
- var outcomeSurfaceSchema = z83.enum(OUTCOME_SURFACES);
24374
+ var outcomeSurfaceSchema = z84.enum(OUTCOME_SURFACES);
24274
24375
  var OutcomeSurfaces = outcomeSurfaceSchema.enum;
24275
24376
  var INTEGRATION_NAMES = [
24276
24377
  "provider",
@@ -24292,19 +24393,19 @@ var INTEGRATION_NAMES = [
24292
24393
  /** The WordPress traffic-logger plugin source, apart from the WordPress publishing connection. */
24293
24394
  "traffic_wordpress"
24294
24395
  ];
24295
- var integrationNameSchema = z83.enum(INTEGRATION_NAMES);
24396
+ var integrationNameSchema = z84.enum(INTEGRATION_NAMES);
24296
24397
  var IntegrationNames = integrationNameSchema.enum;
24297
24398
  var CONNECTION_ACTIONS = ["connect", "disconnect", "test", "reauth", "select"];
24298
- var connectionActionSchema = z83.enum(CONNECTION_ACTIONS);
24399
+ var connectionActionSchema = z84.enum(CONNECTION_ACTIONS);
24299
24400
  var ConnectionActions = connectionActionSchema.enum;
24300
24401
  var CONNECTION_STATUSES = ["started", "succeeded", "failed", "cancelled"];
24301
- var connectionStatusSchema = z83.enum(CONNECTION_STATUSES);
24402
+ var connectionStatusSchema = z84.enum(CONNECTION_STATUSES);
24302
24403
  var ConnectionStatuses = connectionStatusSchema.enum;
24303
24404
  var OUTCOME_STATUSES = ["succeeded", "partial", "failed", "skipped", "cancelled"];
24304
- var outcomeStatusSchema = z83.enum(OUTCOME_STATUSES);
24405
+ var outcomeStatusSchema = z84.enum(OUTCOME_STATUSES);
24305
24406
  var OutcomeStatuses = outcomeStatusSchema.enum;
24306
24407
  var OUTCOME_TRIGGERS = ["manual", "scheduled", "agent", "startup", "retry", "push"];
24307
- var outcomeTriggerSchema = z83.enum(OUTCOME_TRIGGERS);
24408
+ var outcomeTriggerSchema = z84.enum(OUTCOME_TRIGGERS);
24308
24409
  var OutcomeTriggers = outcomeTriggerSchema.enum;
24309
24410
  var OUTCOME_REASON_CODES = [
24310
24411
  "AUTH_DENIED",
@@ -24341,7 +24442,7 @@ var OUTCOME_REASON_CODES = [
24341
24442
  "UNCAUGHT_EXCEPTION",
24342
24443
  "UNHANDLED_REJECTION"
24343
24444
  ];
24344
- var outcomeReasonCodeSchema = z83.enum(OUTCOME_REASON_CODES);
24445
+ var outcomeReasonCodeSchema = z84.enum(OUTCOME_REASON_CODES);
24345
24446
  var OutcomeReasonCodes = outcomeReasonCodeSchema.enum;
24346
24447
  var FEATURE_OPERATIONS = {
24347
24448
  search_console: ["sync", "inspect", "sitemap_submit"],
@@ -24371,7 +24472,7 @@ var FEATURE_OPERATIONS = {
24371
24472
  server: ["start", "crash"]
24372
24473
  };
24373
24474
  var FEATURE_NAMES = Object.keys(FEATURE_OPERATIONS);
24374
- var featureNameSchema = z83.enum(FEATURE_NAMES);
24475
+ var featureNameSchema = z84.enum(FEATURE_NAMES);
24375
24476
  var FeatureNames = featureNameSchema.enum;
24376
24477
  var OUTCOME_COUNT_KEYS = [
24377
24478
  "rows",
@@ -24409,16 +24510,16 @@ var OUTCOME_COUNT_KEYS = [
24409
24510
  ];
24410
24511
  var COUNT_KEY_SET = new Set(OUTCOME_COUNT_KEYS);
24411
24512
  var MAX_COUNT = 1e12;
24412
- var countValueSchema = z83.number().int().min(0).max(MAX_COUNT);
24413
- var countsSchema2 = z83.record(z83.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");
24513
+ var countValueSchema = z84.number().int().min(0).max(MAX_COUNT);
24514
+ var countsSchema2 = z84.record(z84.string(), countValueSchema).refine((obj) => Object.keys(obj).length > 0 && Object.keys(obj).length <= 12, "counts must have 1 to 12 keys").refine((obj) => Object.keys(obj).every((k) => COUNT_KEY_SET.has(k)), "unknown count key");
24414
24515
  var WEBHOOK_TARGETS = ["first_party", "slack", "discord"];
24415
- var webhookTargetSchema = z83.enum(WEBHOOK_TARGETS);
24516
+ var webhookTargetSchema = z84.enum(WEBHOOK_TARGETS);
24416
24517
  var WebhookTargets = webhookTargetSchema.enum;
24417
24518
  var STATUS_CLASSES = ["2xx", "3xx", "4xx", "5xx", "timeout", "network", "blocked"];
24418
- var statusClassSchema = z83.enum(STATUS_CLASSES);
24519
+ var statusClassSchema = z84.enum(STATUS_CLASSES);
24419
24520
  var StatusClasses = statusClassSchema.enum;
24420
24521
  var DURATION_BUCKETS = ["under_1s", "1s_to_10s", "10s_to_1m", "1m_to_5m", "5m_to_30m", "30m_or_more"];
24421
- var durationBucketSchema = z83.enum(DURATION_BUCKETS);
24522
+ var durationBucketSchema = z84.enum(DURATION_BUCKETS);
24422
24523
  var DurationBuckets = durationBucketSchema.enum;
24423
24524
  function bucketDuration(durationMs) {
24424
24525
  const duration = Number.isFinite(durationMs) ? Math.max(0, durationMs) : 0;
@@ -24429,12 +24530,12 @@ function bucketDuration(durationMs) {
24429
24530
  if (duration < 18e5) return "5m_to_30m";
24430
24531
  return "30m_or_more";
24431
24532
  }
24432
- var errorNameSchema = z83.string().regex(/^[A-Z_$][\w$]{0,39}$/i);
24433
- var agentSlugSchema = z83.string().regex(/^[a-z0-9][a-z0-9._-]{0,39}$/);
24434
- var providerNameSchema2 = z83.enum(PROVIDER_NAMES);
24435
- var modelIdSchema2 = z83.string().regex(/^[A-Z0-9][\w.:/@-]{0,99}$/i).refine((v) => !v.includes("://"), "a model id is never a URL");
24436
- var slugSchema = z83.string().regex(/^[a-z0-9][a-z0-9._-]{0,31}$/);
24437
- var integrationConnectionPropertiesSchema = z83.object({
24533
+ var errorNameSchema = z84.string().regex(/^[A-Z_$][\w$]{0,39}$/i);
24534
+ var agentSlugSchema = z84.string().regex(/^[a-z0-9][a-z0-9._-]{0,39}$/);
24535
+ var providerNameSchema2 = z84.enum(PROVIDER_NAMES);
24536
+ var modelIdSchema2 = z84.string().regex(/^[A-Z0-9][\w.:/@-]{0,99}$/i).refine((v) => !v.includes("://"), "a model id is never a URL");
24537
+ var slugSchema = z84.string().regex(/^[a-z0-9][a-z0-9._-]{0,31}$/);
24538
+ var integrationConnectionPropertiesSchema = z84.object({
24438
24539
  integration: integrationNameSchema,
24439
24540
  provider: providerNameSchema2.optional(),
24440
24541
  action: connectionActionSchema,
@@ -24445,9 +24546,9 @@ var integrationConnectionPropertiesSchema = z83.object({
24445
24546
  surface: outcomeSurfaceSchema.optional(),
24446
24547
  agent: agentSlugSchema.optional(),
24447
24548
  durationBucket: durationBucketSchema.optional(),
24448
- attempt: z83.number().int().min(1).max(1e6).optional(),
24549
+ attempt: z84.number().int().min(1).max(1e6).optional(),
24449
24550
  /** The install's first success of this kind; set by the helpers, never by callers. */
24450
- first: z83.literal(true).optional()
24551
+ first: z84.literal(true).optional()
24451
24552
  }).strict().refine(
24452
24553
  (p) => p.integration === IntegrationNames.provider === (p.provider !== void 0),
24453
24554
  "provider is required for, and only for, integration provider"
@@ -24455,9 +24556,9 @@ var integrationConnectionPropertiesSchema = z83.object({
24455
24556
  (p) => p.status === ConnectionStatuses.succeeded || p.status === ConnectionStatuses.started || p.reasonCode !== void 0,
24456
24557
  "a failed or cancelled attempt needs a reasonCode"
24457
24558
  );
24458
- var featureCompletedPropertiesSchema = z83.object({
24559
+ var featureCompletedPropertiesSchema = z84.object({
24459
24560
  feature: featureNameSchema,
24460
- operation: z83.string().regex(/^[a-z][a-z_]{0,31}$/),
24561
+ operation: z84.string().regex(/^[a-z][a-z_]{0,31}$/),
24461
24562
  status: outcomeStatusSchema,
24462
24563
  trigger: outcomeTriggerSchema.optional(),
24463
24564
  surface: outcomeSurfaceSchema.optional(),
@@ -24472,17 +24573,17 @@ var featureCompletedPropertiesSchema = z83.object({
24472
24573
  provider: providerNameSchema2.optional(),
24473
24574
  model: modelIdSchema2.optional(),
24474
24575
  modelProvider: slugSchema.optional(),
24475
- sampleRate: z83.number().int().min(1).max(1e6).optional(),
24476
- droppedBefore: z83.number().int().min(0).max(MAX_COUNT).optional(),
24477
- domainHash: z83.string().regex(/^[0-9a-f]{64}$/).optional(),
24478
- first: z83.literal(true).optional()
24576
+ sampleRate: z84.number().int().min(1).max(1e6).optional(),
24577
+ droppedBefore: z84.number().int().min(0).max(MAX_COUNT).optional(),
24578
+ domainHash: z84.string().regex(/^[0-9a-f]{64}$/).optional(),
24579
+ first: z84.literal(true).optional()
24479
24580
  }).strict().refine(
24480
24581
  (p) => FEATURE_OPERATIONS[p.feature].includes(p.operation),
24481
24582
  "operation is not one this feature reports"
24482
24583
  ).refine((p) => p.status === OutcomeStatuses.succeeded || p.reasonCode !== void 0, "a non-succeeded outcome needs a reasonCode");
24483
24584
  var INSTALL_SOURCES = ["npm", "homebrew", "docker", "source"];
24484
- var installSourceSchema = z83.enum(INSTALL_SOURCES);
24485
- var installRefSchema = z83.string().regex(/^[a-z0-9][a-z0-9-]{0,31}$/);
24585
+ var installSourceSchema = z84.enum(INSTALL_SOURCES);
24586
+ var installRefSchema = z84.string().regex(/^[a-z0-9][a-z0-9-]{0,31}$/);
24486
24587
  function normalizeInstallRef(value) {
24487
24588
  const ref = value?.trim().toLowerCase();
24488
24589
  return ref && installRefSchema.safeParse(ref).success ? ref : void 0;
@@ -24517,11 +24618,11 @@ var INSTALL_STATE_USAGE_KEYS = [
24517
24618
  ];
24518
24619
  var fixedKeyCounts = (keys) => {
24519
24620
  const allowed = new Set(keys);
24520
- return z83.record(z83.string(), countValueSchema).refine((obj) => Object.keys(obj).every((k) => allowed.has(k)), "unknown key");
24621
+ return z84.record(z84.string(), countValueSchema).refine((obj) => Object.keys(obj).every((k) => allowed.has(k)), "unknown key");
24521
24622
  };
24522
- var installStatePropertiesSchema = z83.object({
24523
- providers: z83.array(providerNameSchema2).max(PROVIDER_NAMES.length),
24524
- integrations: z83.array(integrationNameSchema.exclude([IntegrationNames.provider])).max(INTEGRATION_NAMES.length),
24623
+ var installStatePropertiesSchema = z84.object({
24624
+ providers: z84.array(providerNameSchema2).max(PROVIDER_NAMES.length),
24625
+ integrations: z84.array(integrationNameSchema.exclude([IntegrationNames.provider])).max(INTEGRATION_NAMES.length),
24525
24626
  counts: fixedKeyCounts(INSTALL_STATE_COUNT_KEYS),
24526
24627
  usage24h: fixedKeyCounts(INSTALL_STATE_USAGE_KEYS),
24527
24628
  providerCalls24h: fixedKeyCounts(PROVIDER_NAMES).optional(),
@@ -24602,7 +24703,7 @@ function classifyProviderOutcomeError(err) {
24602
24703
  }
24603
24704
 
24604
24705
  // ../contracts/src/ui-telemetry.ts
24605
- import { z as z84 } from "zod";
24706
+ import { z as z85 } from "zod";
24606
24707
  var UI_PAGES = [
24607
24708
  "/",
24608
24709
  "/projects",
@@ -24631,7 +24732,7 @@ var UI_PAGES = [
24631
24732
  "not-found",
24632
24733
  "other"
24633
24734
  ];
24634
- var uiPageSchema = z84.enum(UI_PAGES);
24735
+ var uiPageSchema = z85.enum(UI_PAGES);
24635
24736
  var UI_PROJECT_TABS = [
24636
24737
  "overview",
24637
24738
  "portfolio",
@@ -24649,7 +24750,7 @@ var UI_PROJECT_TABS = [
24649
24750
  "settings",
24650
24751
  "other"
24651
24752
  ];
24652
- var uiProjectTabSchema = z84.enum(UI_PROJECT_TABS);
24753
+ var uiProjectTabSchema = z85.enum(UI_PROJECT_TABS);
24653
24754
  var UI_ACTIONS = [
24654
24755
  "sweep.launch",
24655
24756
  "sweep.cancel",
@@ -24691,7 +24792,7 @@ var UI_ACTIONS = [
24691
24792
  /** A table search settled on a non-empty query (debounced or Enter; the text is never sent). */
24692
24793
  "search.submit"
24693
24794
  ];
24694
- var uiActionSchema = z84.enum(UI_ACTIONS);
24795
+ var uiActionSchema = z85.enum(UI_ACTIONS);
24695
24796
  var UI_INTEGRATIONS = [
24696
24797
  "google",
24697
24798
  "gsc",
@@ -24707,9 +24808,9 @@ var UI_INTEGRATIONS = [
24707
24808
  "traffic_cloud_run",
24708
24809
  "traffic_wordpress"
24709
24810
  ];
24710
- var uiIntegrationSchema = z84.enum(UI_INTEGRATIONS);
24811
+ var uiIntegrationSchema = z85.enum(UI_INTEGRATIONS);
24711
24812
  var UI_FILTERS = ["provider", "model", "location", "window", "query_class", "other"];
24712
- var uiFilterSchema = z84.enum(UI_FILTERS);
24813
+ var uiFilterSchema = z85.enum(UI_FILTERS);
24713
24814
  var UI_EXPORT_FORMATS = ["csv", "json", "html"];
24714
24815
  var UI_ERROR_KINDS = ["render", "unhandled", "api"];
24715
24816
  var UI_STATUS_CLASSES = ["4xx", "5xx", "network"];
@@ -24794,45 +24895,45 @@ function isUiApiRouteTemplate(route) {
24794
24895
  return PARAM_SEGMENT.test(segment) || UI_ROUTE_FIXED_CHILDREN.has(`${previous}/${segment}`);
24795
24896
  });
24796
24897
  }
24797
- var uiEventBaseSchema = z84.object({
24798
- eventId: z84.string().uuid(),
24799
- uiSessionId: z84.string().uuid(),
24898
+ var uiEventBaseSchema = z85.object({
24899
+ eventId: z85.string().uuid(),
24900
+ uiSessionId: z85.string().uuid(),
24800
24901
  page: uiPageSchema
24801
24902
  });
24802
- var uiTelemetryEventSchema = z84.discriminatedUnion("event", [
24903
+ var uiTelemetryEventSchema = z85.discriminatedUnion("event", [
24803
24904
  uiEventBaseSchema.extend({
24804
- event: z84.literal("ui.page_viewed"),
24905
+ event: z85.literal("ui.page_viewed"),
24805
24906
  tab: uiProjectTabSchema.optional()
24806
24907
  }).strict(),
24807
24908
  uiEventBaseSchema.extend({
24808
- event: z84.literal("ui.action"),
24909
+ event: z85.literal("ui.action"),
24809
24910
  action: uiActionSchema,
24810
24911
  tab: uiProjectTabSchema.optional(),
24811
24912
  integration: uiIntegrationSchema.optional(),
24812
- format: z84.enum(UI_EXPORT_FORMATS).optional(),
24913
+ format: z85.enum(UI_EXPORT_FORMATS).optional(),
24813
24914
  filter: uiFilterSchema.optional()
24814
24915
  }).strict(),
24815
24916
  uiEventBaseSchema.extend({
24816
- event: z84.literal("ui.error"),
24817
- kind: z84.enum(UI_ERROR_KINDS),
24917
+ event: z85.literal("ui.error"),
24918
+ kind: z85.enum(UI_ERROR_KINDS),
24818
24919
  tab: uiProjectTabSchema.optional(),
24819
- component: z84.string().regex(UI_COMPONENT_PATTERN).optional(),
24820
- errorName: z84.string().regex(UI_ERROR_NAME_PATTERN).optional(),
24821
- route: z84.string().max(UI_API_ROUTE_MAX_LENGTH).refine(isUiApiRouteTemplate, "route must be a route template").optional(),
24822
- method: z84.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]).optional(),
24823
- statusClass: z84.enum(UI_STATUS_CLASSES).optional(),
24824
- status: z84.number().int().min(400).max(599).optional()
24920
+ component: z85.string().regex(UI_COMPONENT_PATTERN).optional(),
24921
+ errorName: z85.string().regex(UI_ERROR_NAME_PATTERN).optional(),
24922
+ route: z85.string().max(UI_API_ROUTE_MAX_LENGTH).refine(isUiApiRouteTemplate, "route must be a route template").optional(),
24923
+ method: z85.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]).optional(),
24924
+ statusClass: z85.enum(UI_STATUS_CLASSES).optional(),
24925
+ status: z85.number().int().min(400).max(599).optional()
24825
24926
  }).strict(),
24826
24927
  uiEventBaseSchema.extend({
24827
- event: z84.literal("ui.vitals"),
24828
- metric: z84.enum(UI_VITAL_METRICS),
24829
- rating: z84.enum(UI_VITAL_RATINGS),
24928
+ event: z85.literal("ui.vitals"),
24929
+ metric: z85.enum(UI_VITAL_METRICS),
24930
+ rating: z85.enum(UI_VITAL_RATINGS),
24830
24931
  tab: uiProjectTabSchema.optional()
24831
24932
  }).strict()
24832
24933
  ]);
24833
24934
 
24834
24935
  // ../contracts/src/feedback.ts
24835
- import { z as z85 } from "zod";
24936
+ import { z as z86 } from "zod";
24836
24937
 
24837
24938
  // ../contracts/src/log-redaction.ts
24838
24939
  var REDACTED = "[REDACTED]";
@@ -24984,7 +25085,7 @@ function redactEmbeddedUrls(value) {
24984
25085
 
24985
25086
  // ../contracts/src/feedback.ts
24986
25087
  var FEEDBACK_KINDS = ["struggle", "bug", "improvement", "other"];
24987
- var feedbackKindSchema = z85.enum(FEEDBACK_KINDS);
25088
+ var feedbackKindSchema = z86.enum(FEEDBACK_KINDS);
24988
25089
  var FEEDBACK_LIMITS = {
24989
25090
  summary: 500,
24990
25091
  details: 4e3,
@@ -24992,17 +25093,17 @@ var FEEDBACK_LIMITS = {
24992
25093
  command: 120,
24993
25094
  errorCode: 40
24994
25095
  };
24995
- var feedbackSubmissionSchema = z85.object({
25096
+ var feedbackSubmissionSchema = z86.object({
24996
25097
  kind: feedbackKindSchema,
24997
- summary: z85.string().trim().min(1).max(FEEDBACK_LIMITS.summary),
24998
- details: z85.string().trim().min(1).max(FEEDBACK_LIMITS.details).optional(),
24999
- area: z85.string().trim().min(1).max(FEEDBACK_LIMITS.area).optional(),
25000
- command: z85.string().trim().min(1).max(FEEDBACK_LIMITS.command).optional(),
25001
- errorCode: z85.string().trim().min(1).max(FEEDBACK_LIMITS.errorCode).optional()
25098
+ summary: z86.string().trim().min(1).max(FEEDBACK_LIMITS.summary),
25099
+ details: z86.string().trim().min(1).max(FEEDBACK_LIMITS.details).optional(),
25100
+ area: z86.string().trim().min(1).max(FEEDBACK_LIMITS.area).optional(),
25101
+ command: z86.string().trim().min(1).max(FEEDBACK_LIMITS.command).optional(),
25102
+ errorCode: z86.string().trim().min(1).max(FEEDBACK_LIMITS.errorCode).optional()
25002
25103
  }).strict();
25003
- var feedbackAcceptedDtoSchema = z85.object({
25004
- accepted: z85.boolean(),
25005
- id: z85.string()
25104
+ var feedbackAcceptedDtoSchema = z86.object({
25105
+ accepted: z86.boolean(),
25106
+ id: z86.string()
25006
25107
  });
25007
25108
  function redactFeedbackText(value, limit) {
25008
25109
  return truncateUtf16(
@@ -25081,7 +25182,7 @@ function asRecord(value) {
25081
25182
  }
25082
25183
 
25083
25184
  // ../contracts/src/tolerant-read.ts
25084
- import { z as z86 } from "zod";
25185
+ import { z as z87 } from "zod";
25085
25186
  var WRAPPER_TYPES = /* @__PURE__ */ new Set(["optional", "nullable", "default", "prefault", "readonly", "catch", "nonoptional"]);
25086
25187
  var DEPTH_LIMIT = 64;
25087
25188
  function defOf(schema) {
@@ -25092,9 +25193,9 @@ function cloneWith(schema, changes) {
25092
25193
  }
25093
25194
  function openPrimitive(values) {
25094
25195
  if (values.length === 0) return void 0;
25095
- if (values.every((value) => typeof value === "string")) return z86.string();
25096
- if (values.every((value) => typeof value === "number")) return z86.number();
25097
- if (values.every((value) => typeof value === "boolean")) return z86.boolean();
25196
+ if (values.every((value) => typeof value === "string")) return z87.string();
25197
+ if (values.every((value) => typeof value === "number")) return z87.number();
25198
+ if (values.every((value) => typeof value === "boolean")) return z87.boolean();
25098
25199
  return void 0;
25099
25200
  }
25100
25201
  function walk2(schema, open, memo, depth) {
@@ -25108,7 +25209,7 @@ function walk2(schema, open, memo, depth) {
25108
25209
  const shape = Object.fromEntries(Object.entries(schema.shape).map(([key, child]) => [key, next(child)]));
25109
25210
  const declared = def.catchall;
25110
25211
  const catchall = open.get(schema) ?? (declared && defOf(declared).type !== "never" ? next(declared) : void 0);
25111
- result = catchall ? z86.object(shape).catchall(catchall) : z86.object(shape);
25212
+ result = catchall ? z87.object(shape).catchall(catchall) : z87.object(shape);
25112
25213
  } else if (WRAPPER_TYPES.has(def.type)) {
25113
25214
  const inner = def.innerType;
25114
25215
  const mapped = next(inner);
@@ -25125,10 +25226,10 @@ function walk2(schema, open, memo, depth) {
25125
25226
  const options = def.options;
25126
25227
  const mapped = options.map(next);
25127
25228
  const changed = mapped.some((option, index) => option !== options[index]);
25128
- result = !changed ? schema : def.discriminator ? z86.union(mapped) : cloneWith(schema, { options: mapped });
25229
+ result = !changed ? schema : def.discriminator ? z87.union(mapped) : cloneWith(schema, { options: mapped });
25129
25230
  } else if (def.type === "record") {
25130
25231
  const keyType = def.keyType, valueType = def.valueType;
25131
- const mappedKey = defOf(keyType).type === "enum" ? z86.string() : keyType;
25232
+ const mappedKey = defOf(keyType).type === "enum" ? z87.string() : keyType;
25132
25233
  const mappedValue = next(valueType);
25133
25234
  result = mappedKey === keyType && mappedValue === valueType ? schema : cloneWith(schema, { keyType: mappedKey, valueType: mappedValue });
25134
25235
  } else if (def.type === "intersection") {
@@ -25144,7 +25245,7 @@ function walk2(schema, open, memo, depth) {
25144
25245
  result = changed ? cloneWith(schema, { items: mappedItems, rest: mappedRest }) : schema;
25145
25246
  } else if (def.type === "lazy") {
25146
25247
  const getter = def.getter;
25147
- result = z86.lazy(() => next(getter()));
25248
+ result = z87.lazy(() => next(getter()));
25148
25249
  } else if (def.type === "enum") {
25149
25250
  result = openPrimitive(Object.values(def.entries)) ?? schema;
25150
25251
  } else if (def.type === "literal") {
@@ -25159,8 +25260,8 @@ function tolerantReadSchema(schema, options = {}) {
25159
25260
  }
25160
25261
 
25161
25262
  // ../contracts/src/sentiment-read.ts
25162
- import { z as z87 } from "zod";
25163
- var OPEN_COUNTS = { openKeys: [[sentimentCountsSchema, z87.number().int().nonnegative()]] };
25263
+ import { z as z88 } from "zod";
25264
+ var OPEN_COUNTS = { openKeys: [[sentimentCountsSchema, z88.number().int().nonnegative()]] };
25164
25265
  var sentimentSettingsReadSchema = tolerantReadSchema(sentimentSettingsSchema, OPEN_COUNTS);
25165
25266
  var sentimentSummaryReadSchema = tolerantReadSchema(sentimentSummarySchema, OPEN_COUNTS);
25166
25267
  var sentimentEvidencePageReadSchema = tolerantReadSchema(sentimentEvidencePageSchema, OPEN_COUNTS);
@@ -25190,29 +25291,29 @@ function rateOverChecked(numerator, answers, excluded, field) {
25190
25291
  }
25191
25292
 
25192
25293
  // ../contracts/src/cli-catalog.ts
25193
- import { z as z88 } from "zod";
25194
- var cliCatalogOptionSchema = z88.object({
25195
- name: z88.string(),
25196
- type: z88.enum(["string", "boolean"]),
25197
- multiple: z88.boolean()
25198
- });
25199
- var cliCatalogCommandSchema = z88.object({
25200
- id: z88.string(),
25201
- path: z88.array(z88.string()).min(1),
25202
- usage: z88.string(),
25203
- supportsDryRun: z88.boolean(),
25204
- windows: z88.array(z88.string()).optional(),
25205
- options: z88.array(cliCatalogOptionSchema),
25294
+ import { z as z89 } from "zod";
25295
+ var cliCatalogOptionSchema = z89.object({
25296
+ name: z89.string(),
25297
+ type: z89.enum(["string", "boolean"]),
25298
+ multiple: z89.boolean()
25299
+ });
25300
+ var cliCatalogCommandSchema = z89.object({
25301
+ id: z89.string(),
25302
+ path: z89.array(z89.string()).min(1),
25303
+ usage: z89.string(),
25304
+ supportsDryRun: z89.boolean(),
25305
+ windows: z89.array(z89.string()).optional(),
25306
+ options: z89.array(cliCatalogOptionSchema),
25206
25307
  access: operationAccessSchema
25207
25308
  });
25208
- var cliCatalogSchema = z88.object({
25209
- version: z88.string(),
25210
- globalOptions: z88.array(cliCatalogOptionSchema),
25211
- groups: z88.array(z88.object({
25212
- root: z88.string(),
25213
- section: z88.string(),
25214
- summary: z88.string(),
25215
- commands: z88.array(cliCatalogCommandSchema)
25309
+ var cliCatalogSchema = z89.object({
25310
+ version: z89.string(),
25311
+ globalOptions: z89.array(cliCatalogOptionSchema),
25312
+ groups: z89.array(z89.object({
25313
+ root: z89.string(),
25314
+ section: z89.string(),
25315
+ summary: z89.string(),
25316
+ commands: z89.array(cliCatalogCommandSchema)
25216
25317
  }))
25217
25318
  });
25218
25319
 
@@ -25260,6 +25361,8 @@ export {
25260
25361
  notificationEventSchema,
25261
25362
  notificationDtoSchema,
25262
25363
  notificationCreateRequestSchema,
25364
+ ReviewDeliveryStates,
25365
+ googleBusinessReviewUrl,
25263
25366
  AppError,
25264
25367
  notFound,
25265
25368
  alreadyExists,
@@ -26293,6 +26396,18 @@ export {
26293
26396
  LOCATION_REDIRECT_STATUSES,
26294
26397
  isLocationRedirectStatus,
26295
26398
  escapeLikePattern,
26399
+ GBP_POSTS_WRITE_SCOPE,
26400
+ GBP_LIVE_READ_SCOPE,
26401
+ gbpAccountNameSchema,
26402
+ gbpLocationNameSchema,
26403
+ gbpLocalPostNameSchema,
26404
+ GbpLocalPostStates,
26405
+ gbpLocalPostContentSchema,
26406
+ gbpLocalPostDtoSchema,
26407
+ gbpLocalPostListSchema,
26408
+ gbpLocalPostCreateSchema,
26409
+ gbpLocalPostAttemptSchema,
26410
+ gbpLiveReviewsSchema,
26296
26411
  READ_ONLY_SCOPE,
26297
26412
  WILDCARD_SCOPE,
26298
26413
  RESEARCH_RUN_SCOPE,