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