@canonry/canonry 7.111.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/README.md +1 -1
- package/assets/agent-workspace/skills/aero/references/ai-traffic-tracking.md +5 -3
- package/assets/agent-workspace/skills/canonry/references/aeo-analysis.md +8 -0
- package/assets/agent-workspace/skills/canonry/references/ai-traffic-tracking.md +5 -3
- package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +6 -0
- package/assets/agent-workspace/skills/canonry/references/server-side-traffic.md +4 -0
- package/assets/assets/{AccessControls-CJMIWtDc.js → AccessControls-8KGSA5-k.js} +1 -1
- package/assets/assets/{AgentSetupPage-DR8w0A9t.js → AgentSetupPage-Bqpw8_pa.js} +1 -1
- package/assets/assets/{AuditHistoryPanel-BLF2-WSw.js → AuditHistoryPanel-0zcL5_KV.js} +1 -1
- package/assets/assets/{BacklinksPage-BCuEkphC.js → BacklinksPage-Kypu_CBg.js} +1 -1
- package/assets/assets/{ChartPrimitives-Dxr7b1zf.js → ChartPrimitives-CuLSMZRf.js} +1 -1
- package/assets/assets/{HistoryPage-C3UcNB4C.js → HistoryPage-CsSkwiHD.js} +1 -1
- package/assets/assets/{MeasurementPropertyPage-BKDciQn4.js → MeasurementPropertyPage-D4PDu2k_.js} +1 -1
- package/assets/assets/{ProjectPage-BwkFGMs_.js → ProjectPage-D00B6b7C.js} +3 -3
- package/assets/assets/{RunsPage-BqteFByy.js → RunsPage-CtcGk2M9.js} +1 -1
- package/assets/assets/{ServerTrafficSection-CqHfSvux.js → ServerTrafficSection-BWd-wDZM.js} +1 -1
- package/assets/assets/{SettingsPage-BORbl6fR.js → SettingsPage-DHWJtLmM.js} +1 -1
- package/assets/assets/ToneBadge-Ci54jPqm.js +60 -0
- package/assets/assets/{TrafficPage-xqJU4CR4.js → TrafficPage-C-3_NTXQ.js} +1 -1
- package/assets/assets/{TrafficSourceDetailPage-CVHyU3Za.js → TrafficSourceDetailPage-CRzsuCei.js} +1 -1
- package/assets/assets/{account-context-DR0diETl.js → account-context-DDb7nBdB.js} +1 -1
- package/assets/assets/{agent-trust-copy-DX06JhNj.js → agent-trust-copy-DfskKzsn.js} +1 -1
- package/assets/assets/{card-BG4pD6H7.js → card-BM8bXgNt.js} +1 -1
- package/assets/assets/{index-CggAFvBE.js → index-IFRMBJbA.js} +3 -3
- package/assets/assets/{query-client-DiID-orC.js → query-client-BQBRNHRa.js} +1 -1
- package/assets/assets/{react-query-gPYNMl8L.js → react-query-CJRQ352v.js} +1 -1
- package/assets/assets/{react-sigma_core.esm.min-CaAAyMHy.js → react-sigma_core.esm.min-BX0xxddn.js} +1 -1
- package/assets/assets/{server-traffic-DGkceMij.js → server-traffic-F4hKNLJy.js} +1 -1
- package/assets/assets/{service-DqtXV3A5.js → service-D08PUQzL.js} +1 -1
- package/assets/index.html +8 -8
- package/dist/{ads-MA5UHDSK.js → ads-RNE2CDPT.js} +3 -3
- package/dist/{agent-QBDESRUX.js → agent-H3RZA7V5.js} +7 -7
- package/dist/{agent-ask-DVUWIY4T.js → agent-ask-ZVM4P74Z.js} +3 -3
- package/dist/{agent-conversations-Q7SE57ZA.js → agent-conversations-WTD4LMN3.js} +3 -3
- package/dist/{agent-journeys-OWNSW6GR.js → agent-journeys-YNBUYJH3.js} +3 -3
- package/dist/{agent-memory-YIVRBUPS.js → agent-memory-KKTISDMW.js} +3 -3
- package/dist/{agent-providers-UDILAU6B.js → agent-providers-VW3PJ2CU.js} +3 -3
- package/dist/{agent-transcript-KU7ELEEC.js → agent-transcript-DSYFCMFG.js} +3 -3
- package/dist/{analytics-WFMI7N5Y.js → analytics-RUC5ENEA.js} +3 -3
- package/dist/{apply-2WHADGXD.js → apply-3DDFBAE4.js} +3 -3
- package/dist/{backfill-ZNGMPK7N.js → backfill-MBD5GR5J.js} +10 -10
- package/dist/{backlinks-LH77XWHZ.js → backlinks-EWALMBY5.js} +3 -3
- package/dist/{bing-5OCPBLYU.js → bing-KKG2726P.js} +3 -3
- package/dist/{bootstrap-SCTHOCSM.js → bootstrap-F4CAPH2R.js} +10 -10
- package/dist/{cdp-6OEBXRAY.js → cdp-4VYUIAD6.js} +7 -7
- package/dist/{chunk-YQ5NFMQB.js → chunk-2QSAPDUL.js} +1 -1
- package/dist/{chunk-UKQPA7NT.js → chunk-3NDZ43NA.js} +4 -4
- package/dist/{chunk-44JAOWMT.js → chunk-3TPGHPOR.js} +3 -3
- package/dist/{chunk-IBTMJA76.js → chunk-4HRWQTQY.js} +7 -7
- package/dist/{chunk-H5LL4HMB.js → chunk-5A2HNY42.js} +1 -1
- package/dist/{chunk-46HRC23F.js → chunk-5IEINES2.js} +1 -1
- package/dist/{chunk-U4YVA2A2.js → chunk-67MQRWOS.js} +2 -2
- package/dist/{chunk-WK6SPZG4.js → chunk-BHPOICVI.js} +1 -1
- package/dist/{chunk-DR4QNC2H.js → chunk-BN3PZHJW.js} +2 -2
- package/dist/{chunk-YOQQUG7C.js → chunk-CAQAEJBN.js} +1 -1
- package/dist/{chunk-523WBUKU.js → chunk-CTUWWYNV.js} +4 -4
- package/dist/{chunk-PPOHDQ3T.js → chunk-DKFVL2BE.js} +2 -2
- package/dist/{chunk-QKEBSO3T.js → chunk-GYFRSG7F.js} +31 -3
- package/dist/{chunk-BZMIVLRX.js → chunk-H3OKX3IA.js} +5 -5
- package/dist/{chunk-IU26JPKH.js → chunk-H6LGOLBW.js} +1884 -1386
- package/dist/{chunk-A2VDUQB2.js → chunk-HL2BOPH3.js} +3 -3
- package/dist/{chunk-4EWCBHGV.js → chunk-I2X27ECL.js} +2 -2
- package/dist/{chunk-3SCJOPT5.js → chunk-IBX6VC7A.js} +3 -3
- package/dist/{chunk-CJRL5BT3.js → chunk-IMVE7Z6S.js} +1 -1
- package/dist/{chunk-MQU5QBUQ.js → chunk-IXAVIBKP.js} +1 -1
- package/dist/{chunk-S7TL4SCS.js → chunk-IXJCFQFA.js} +4 -4
- package/dist/{chunk-XAS6ARPI.js → chunk-J6UROG7V.js} +1 -1
- package/dist/{chunk-TSQG2PNH.js → chunk-JEDFYKBL.js} +409 -368
- package/dist/{chunk-EQ6RZE7U.js → chunk-LAGHIZVO.js} +43 -6
- package/dist/{chunk-ORX3X7P5.js → chunk-NFWEMRP5.js} +22 -22
- package/dist/{chunk-LGPITEEE.js → chunk-NLFXESPW.js} +1 -1
- package/dist/{chunk-CIDXBCEW.js → chunk-NNHI6SOT.js} +2 -2
- package/dist/{chunk-VXOZUCH4.js → chunk-OXHJGGXR.js} +5 -5
- package/dist/{chunk-N5U474SX.js → chunk-OYOIW25C.js} +4 -4
- package/dist/{chunk-EUARY2OX.js → chunk-RFJY5UW2.js} +929 -716
- package/dist/{chunk-KMES74KU.js → chunk-T3IRL4TY.js} +2 -1
- package/dist/{chunk-BNHQ55UD.js → chunk-TUOPSFAU.js} +3 -3
- package/dist/{chunk-LGPJMBH2.js → chunk-UNZJCCDO.js} +2 -2
- package/dist/{chunk-LPW2TRLI.js → chunk-VBXXP3YY.js} +7 -7
- package/dist/{chunk-GHNEC23U.js → chunk-WPTF34LH.js} +1 -1
- package/dist/{chunk-ZKYOGC7O.js → chunk-WQN32NXS.js} +1 -1
- package/dist/{chunk-5IX4ZOSU.js → chunk-YSDMYHDM.js} +1 -1
- package/dist/{citations-27ENEGJM.js → citations-FWWFTIOT.js} +52 -4
- package/dist/{cli-catalog-PAZQB7WG.js → cli-catalog-RCM2HUCT.js} +3 -3
- package/dist/{cli-commands-L6G5AQG2.js → cli-commands-FGF5ZY2E.js} +7 -7
- package/dist/cli.js +13 -13
- package/dist/{competitor-EK5UX6W6.js → competitor-KGKTAS53.js} +3 -3
- package/dist/{content-3MBCVYMR.js → content-TXZ4IOGJ.js} +3 -3
- package/dist/{dashboard-5LZMYX52.js → dashboard-IGBJPCUX.js} +6 -6
- package/dist/{demo-2NB2BVZO.js → demo-UXJ6SLWM.js} +1 -1
- package/dist/{demo-server-MUJ566YQ.js → demo-server-VFRGZEEQ.js} +13 -12
- package/dist/{discover-VMPF4CLS.js → discover-EJSVZOVY.js} +4 -4
- package/dist/{discover-eval-EK5ZAJKW.js → discover-eval-6U5C6O5F.js} +3 -3
- package/dist/{doctor-2KY5SS4O.js → doctor-ONEJYJ2A.js} +3 -3
- package/dist/{evidence-OXYY666S.js → evidence-DRQCHIWI.js} +3 -3
- package/dist/{export-cmd-5Q6TNXN6.js → export-cmd-YJ3AFLXR.js} +3 -3
- package/dist/{ga-CG3KAWEE.js → ga-AP4F2LSD.js} +3 -3
- package/dist/{gbp-F555XC4I.js → gbp-W2BZILFX.js} +3 -3
- package/dist/{google-44XHCXOZ.js → google-CNY7J4MZ.js} +4 -4
- package/dist/{google-marketing-MSJVMCMQ.js → google-marketing-OT2JSJUY.js} +1 -1
- package/dist/{health-cmd-KXCY4527.js → health-cmd-DU33WCDD.js} +4 -4
- package/dist/{history-Y6PMRNUA.js → history-HRY6TLYX.js} +3 -3
- package/dist/index.d.ts +70 -70
- package/dist/index.js +26 -26
- package/dist/{init-CCVUPSZZ.js → init-XQJZ6DQX.js} +12 -12
- package/dist/{insights-FGR5AU5D.js → insights-SMURU5LJ.js} +3 -3
- package/dist/intelligence-service-UEIV4CYJ.js +16 -0
- package/dist/{journeys-2V4KIVDF.js → journeys-BASXVLUD.js} +3 -3
- package/dist/{keys-2EOH2M22.js → keys-KBHFQCQ5.js} +3 -3
- package/dist/{keyword-XFHVSN3B.js → keyword-EPNX57S2.js} +3 -3
- package/dist/{logs-WJU66NI5.js → logs-EHWCAIDD.js} +3 -3
- package/dist/{mcp-23HANPN3.js → mcp-TIMFG2HU.js} +4 -4
- package/dist/mcp.js +10 -10
- package/dist/{measurement-plan-VQIG5UCP.js → measurement-plan-T2WUFQGZ.js} +5 -5
- package/dist/{notify-E33IOGRC.js → notify-EGJHQXJY.js} +3 -3
- package/dist/{organic-evidence-3YJ3WTF5.js → organic-evidence-NZ4BYT7G.js} +3 -3
- package/dist/{overview-66VPXGSA.js → overview-FSTEFM7S.js} +5 -5
- package/dist/{project-SHXJFR3K.js → project-ZOGGHFMI.js} +3 -3
- package/dist/{project-setup-SMTRU7UG.js → project-setup-DA55HKTE.js} +3 -3
- package/dist/{query-UNCXNQLZ.js → query-YSZCPFUW.js} +3 -3
- package/dist/{research-C5JIOYGU.js → research-C3BDNI7X.js} +3 -3
- package/dist/{results-export-WZZDWAQB.js → results-export-YBHQ4GJY.js} +3 -3
- package/dist/{run-NRBLHGT3.js → run-OI4Y4CPZ.js} +5 -5
- package/dist/{schedule-BOBKSQAN.js → schedule-HI5QUYZN.js} +3 -3
- package/dist/{search-26B4UX3P.js → search-H5VREMQP.js} +3 -3
- package/dist/{serve-3TN2RDHE.js → serve-OVEZ6LLG.js} +27 -27
- package/dist/{session-PTB4UBY3.js → session-6HUFUB6Y.js} +14 -14
- package/dist/{settings-25JAM5MJ.js → settings-M3TBHMXQ.js} +3 -3
- package/dist/{sitemaps-YXJIIT52.js → sitemaps-6ZZ4LAPG.js} +3 -3
- package/dist/{skills-HAYPXHWH.js → skills-HWXV6FII.js} +2 -2
- package/dist/{snapshot-V6D4W4MF.js → snapshot-VSQMPHFQ.js} +3 -3
- package/dist/{src-ENRBRVV2.js → src-54XVRI7X.js} +2 -2
- package/dist/{status-35RGWHEQ.js → status-6IB2JLE6.js} +5 -5
- package/dist/{technical-aeo-YG7Q3554.js → technical-aeo-PZHXLFS4.js} +3 -3
- package/dist/{telemetry-LUT6F4HJ.js → telemetry-K3XNIML6.js} +4 -4
- package/dist/{tools-NPGGINFO.js → tools-KQD2AZTB.js} +11 -11
- package/dist/{traffic-CKYSAD4T.js → traffic-ZRFDZG7J.js} +55 -13
- package/dist/{trends-NQZD7X67.js → trends-Q7YV4H6S.js} +3 -3
- package/dist/{users-6FPNRCXJ.js → users-KIC522TT.js} +3 -3
- package/dist/{visibility-stats-S2FXH3NH.js → visibility-stats-MN7367BK.js} +4 -4
- package/dist/{wordpress-BN62WUII.js → wordpress-7UL7Q5HH.js} +3 -3
- package/package.json +1 -1
- package/assets/assets/ToneBadge-Cu25HdVj.js +0 -60
- package/dist/intelligence-service-NOZAMR73.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))
|
|
@@ -21152,6 +21154,35 @@ function parseTrafficEventKindFilter(value) {
|
|
|
21152
21154
|
}
|
|
21153
21155
|
return kinds.length > 0 ? kinds : null;
|
|
21154
21156
|
}
|
|
21157
|
+
var trafficEventGroupFieldSchema = z62.enum(["agent", "path", "status", "source"]);
|
|
21158
|
+
var TrafficEventGroupFields = trafficEventGroupFieldSchema.enum;
|
|
21159
|
+
var TRAFFIC_EVENT_GROUP_BY_HINT = `one or more (comma-separated) of: ${trafficEventGroupFieldSchema.options.join(", ")}`;
|
|
21160
|
+
function parseTrafficEventGroupBy(value) {
|
|
21161
|
+
const fields = [];
|
|
21162
|
+
for (const member of value.split(",").map((part) => part.trim()).filter(Boolean)) {
|
|
21163
|
+
const parsed = trafficEventGroupFieldSchema.safeParse(member);
|
|
21164
|
+
if (!parsed.success) return null;
|
|
21165
|
+
if (!fields.includes(parsed.data)) fields.push(parsed.data);
|
|
21166
|
+
}
|
|
21167
|
+
return fields.length > 0 ? fields : null;
|
|
21168
|
+
}
|
|
21169
|
+
var trafficEventGroupSchema = z62.object({
|
|
21170
|
+
kind: trafficEventKindSchema,
|
|
21171
|
+
/** Present when grouped by agent: bot ID, or the AI product on AI-referral rows. */
|
|
21172
|
+
agent: z62.string().optional(),
|
|
21173
|
+
/** Present when grouped by path: fetched path, or the landing path on AI-referral rows. */
|
|
21174
|
+
path: z62.string().optional(),
|
|
21175
|
+
/** Present when grouped by status. */
|
|
21176
|
+
status: z62.number().int().optional(),
|
|
21177
|
+
/** Present when grouped by source. */
|
|
21178
|
+
sourceId: z62.string().optional(),
|
|
21179
|
+
/** Sum of `hits` over the group's rows, the same count the detail rows carry. */
|
|
21180
|
+
hits: z62.number().int().nonnegative(),
|
|
21181
|
+
/** Hourly detail rows in the group. */
|
|
21182
|
+
rows: z62.number().int().nonnegative(),
|
|
21183
|
+
firstHour: z62.string(),
|
|
21184
|
+
lastHour: z62.string()
|
|
21185
|
+
});
|
|
21155
21186
|
var trafficSeriesGranularitySchema = z62.enum(["hour", "day", "month"]);
|
|
21156
21187
|
var TrafficSeriesGranularities = trafficSeriesGranularitySchema.enum;
|
|
21157
21188
|
var trafficSeriesPointSchema = z62.object({
|
|
@@ -21334,14 +21365,50 @@ var trafficEventsResponseSchema = z62.object({
|
|
|
21334
21365
|
/** LANDED sessions ingested before the classifier shipped; unresolvable, never organic. */
|
|
21335
21366
|
aiReferralUnknownHits: z62.number().int().nonnegative()
|
|
21336
21367
|
}),
|
|
21368
|
+
/**
|
|
21369
|
+
* The filters every part of this response honors: totals, series, detail
|
|
21370
|
+
* rows and groups. Optional so a newer client reads an older API.
|
|
21371
|
+
*/
|
|
21372
|
+
filters: z62.object({
|
|
21373
|
+
kinds: z62.array(trafficEventKindSchema),
|
|
21374
|
+
sourceId: z62.string().nullable(),
|
|
21375
|
+
/** A page and the pages under it (`/faq` matches `/faq/x`, never `/faqs`): fetched path, or landing path on AI-referral rows. */
|
|
21376
|
+
path: z62.string().nullable(),
|
|
21377
|
+
/** Bot ID, or AI product on AI-referral rows. */
|
|
21378
|
+
agent: z62.string().nullable()
|
|
21379
|
+
}).optional(),
|
|
21337
21380
|
eventRows: z62.object({
|
|
21338
|
-
/** Total detail rows matching
|
|
21381
|
+
/** Total detail rows matching every filter, across all pages. */
|
|
21339
21382
|
total: z62.number().int().nonnegative(),
|
|
21340
|
-
/**
|
|
21383
|
+
/** Detail rows included in `events` on this page. */
|
|
21341
21384
|
returned: z62.number().int().nonnegative(),
|
|
21342
|
-
|
|
21385
|
+
/** True when another page follows; read it with `nextCursor`. */
|
|
21386
|
+
truncated: z62.boolean(),
|
|
21387
|
+
/**
|
|
21388
|
+
* Pass as `cursor` to read the next page, with the same filters; null on
|
|
21389
|
+
* the last page. Rows are newest hour first, in a fixed order, and the
|
|
21390
|
+
* cursor keeps the first page's window, so pages never repeat a row and
|
|
21391
|
+
* newer hours never shift a page. A row written between pages into an hour
|
|
21392
|
+
* the read has already passed (the current hour, or a late delivery) is not
|
|
21393
|
+
* returned: end the window at a finished hour for an exact read. Optional
|
|
21394
|
+
* so a newer client reads an older API.
|
|
21395
|
+
*/
|
|
21396
|
+
nextCursor: z62.string().nullable().optional()
|
|
21343
21397
|
}),
|
|
21344
|
-
events: z62.array(trafficEventEntrySchema)
|
|
21398
|
+
events: z62.array(trafficEventEntrySchema),
|
|
21399
|
+
/**
|
|
21400
|
+
* Present only when `groupBy` was asked for: totals over the whole filtered
|
|
21401
|
+
* window, most hits first, capped by `limit`.
|
|
21402
|
+
*/
|
|
21403
|
+
groups: z62.object({
|
|
21404
|
+
by: z62.array(trafficEventGroupFieldSchema),
|
|
21405
|
+
/** Groups that match, before `limit`. */
|
|
21406
|
+
total: z62.number().int().nonnegative(),
|
|
21407
|
+
returned: z62.number().int().nonnegative(),
|
|
21408
|
+
/** True when more groups match than `limit` let through. Narrow the filters or raise `limit` (max 5000). */
|
|
21409
|
+
truncated: z62.boolean(),
|
|
21410
|
+
entries: z62.array(trafficEventGroupSchema)
|
|
21411
|
+
}).optional()
|
|
21345
21412
|
});
|
|
21346
21413
|
var trafficSampleKindSchema = z62.enum(["crawler", "ai-user-fetch", "ai-referral", "unknown"]);
|
|
21347
21414
|
var TrafficSampleKinds = trafficSampleKindSchema.enum;
|
|
@@ -26047,21 +26114,157 @@ var snapshotReportSchema = z84.object({
|
|
|
26047
26114
|
summary: snapshotSummarySchema
|
|
26048
26115
|
});
|
|
26049
26116
|
|
|
26050
|
-
// ../contracts/src/
|
|
26117
|
+
// ../contracts/src/citation-urls.ts
|
|
26051
26118
|
import { z as z85 } from "zod";
|
|
26052
|
-
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({
|
|
26053
26256
|
window: metricsWindowSchema.optional(),
|
|
26054
|
-
minAnswers:
|
|
26055
|
-
queryClass:
|
|
26056
|
-
groupKey:
|
|
26057
|
-
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()
|
|
26058
26261
|
}).strict();
|
|
26059
|
-
var competitorSuggestionNameSchema =
|
|
26060
|
-
name:
|
|
26061
|
-
answerCount:
|
|
26062
|
-
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()
|
|
26063
26266
|
}).strict();
|
|
26064
|
-
var competitorSuggestionReasonSchema =
|
|
26267
|
+
var competitorSuggestionReasonSchema = z86.enum([
|
|
26065
26268
|
"below-min-answers",
|
|
26066
26269
|
"not-named",
|
|
26067
26270
|
"unpaired-name",
|
|
@@ -26072,56 +26275,56 @@ var competitorSuggestionReasonSchema = z85.enum([
|
|
|
26072
26275
|
"shared-host"
|
|
26073
26276
|
]);
|
|
26074
26277
|
var CompetitorSuggestionReasons = competitorSuggestionReasonSchema.enum;
|
|
26075
|
-
var competitorSuggestionStatusSchema =
|
|
26278
|
+
var competitorSuggestionStatusSchema = z86.enum(["suggested", "tracked", "excluded"]);
|
|
26076
26279
|
var CompetitorSuggestionStatuses = competitorSuggestionStatusSchema.enum;
|
|
26077
|
-
var competitorSuggestionSchema =
|
|
26078
|
-
domain:
|
|
26079
|
-
label:
|
|
26080
|
-
names:
|
|
26081
|
-
namingAnswers:
|
|
26082
|
-
citingAnswers:
|
|
26083
|
-
bothAnswers:
|
|
26084
|
-
pairedAnswers:
|
|
26085
|
-
namedByOtherNameAnswers:
|
|
26086
|
-
sweeps:
|
|
26087
|
-
firstSeenAt:
|
|
26088
|
-
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(),
|
|
26089
26292
|
surfaceClass: competitorLandscapeSurfaceClassSchema,
|
|
26090
|
-
tracked:
|
|
26091
|
-
marketKeys:
|
|
26293
|
+
tracked: z86.boolean(),
|
|
26294
|
+
marketKeys: z86.array(z86.string().trim().min(1)).optional(),
|
|
26092
26295
|
status: competitorSuggestionStatusSchema,
|
|
26093
26296
|
reason: competitorSuggestionReasonSchema.nullable(),
|
|
26094
|
-
sampleUrls:
|
|
26297
|
+
sampleUrls: z86.array(z86.string().url()).max(3)
|
|
26095
26298
|
}).strict();
|
|
26096
|
-
var competitorSuggestionsResponseSchema =
|
|
26097
|
-
project:
|
|
26299
|
+
var competitorSuggestionsResponseSchema = z86.object({
|
|
26300
|
+
project: z86.string().trim().min(1),
|
|
26098
26301
|
window: metricsWindowSchema,
|
|
26099
26302
|
scope: competitorLandscapeScopeSchema,
|
|
26100
|
-
filters:
|
|
26101
|
-
queryClass:
|
|
26102
|
-
groupKey:
|
|
26103
|
-
limit:
|
|
26104
|
-
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()
|
|
26105
26308
|
}).strict(),
|
|
26106
|
-
thresholds:
|
|
26107
|
-
candidates:
|
|
26108
|
-
candidatesTotal:
|
|
26109
|
-
excludedCounts:
|
|
26110
|
-
unresolvedNames:
|
|
26111
|
-
evidence:
|
|
26112
|
-
answeredResults:
|
|
26113
|
-
sourceResults:
|
|
26114
|
-
excludedProbeResults:
|
|
26115
|
-
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()
|
|
26116
26319
|
}).strict(),
|
|
26117
|
-
runCount:
|
|
26118
|
-
runIds:
|
|
26119
|
-
countUnits:
|
|
26120
|
-
answers:
|
|
26121
|
-
distinctNames:
|
|
26122
|
-
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())
|
|
26123
26326
|
}).strict(),
|
|
26124
|
-
truncated:
|
|
26327
|
+
truncated: z86.boolean()
|
|
26125
26328
|
}).strict();
|
|
26126
26329
|
var COMPETITOR_SUGGESTION_COUNT_UNITS = {
|
|
26127
26330
|
...COMPETITOR_LANDSCAPE_COUNT_UNITS,
|
|
@@ -26139,9 +26342,9 @@ var COMPETITOR_SUGGESTION_COUNT_UNITS = {
|
|
|
26139
26342
|
};
|
|
26140
26343
|
|
|
26141
26344
|
// ../contracts/src/intelligence.ts
|
|
26142
|
-
import { z as
|
|
26143
|
-
var insightSeveritySchema =
|
|
26144
|
-
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"]);
|
|
26145
26348
|
var InsightActionGroups = insightActionGroupSchema.enum;
|
|
26146
26349
|
var insightActionGroupByType = {
|
|
26147
26350
|
// Content-required: a missing or competitive answer needs new or updated material.
|
|
@@ -26163,10 +26366,10 @@ var insightActionGroupByType = {
|
|
|
26163
26366
|
"gbp-metric-drop": InsightActionGroups.investigate,
|
|
26164
26367
|
"gbp-keyword-drop": InsightActionGroups.investigate
|
|
26165
26368
|
};
|
|
26166
|
-
var healthSnapshotDtoSchema =
|
|
26167
|
-
id:
|
|
26168
|
-
projectId:
|
|
26169
|
-
runId:
|
|
26369
|
+
var healthSnapshotDtoSchema = z87.object({
|
|
26370
|
+
id: z87.string(),
|
|
26371
|
+
projectId: z87.string(),
|
|
26372
|
+
runId: z87.string().nullable(),
|
|
26170
26373
|
/**
|
|
26171
26374
|
* `citedPairs` over the pairs whose sources were checked (`totalPairs -
|
|
26172
26375
|
* citationNotMeasuredPairs`). Null when the engines returned no sources for
|
|
@@ -26181,57 +26384,57 @@ var healthSnapshotDtoSchema = z86.object({
|
|
|
26181
26384
|
* as 0 (the API coalesces NULL→0).
|
|
26182
26385
|
*/
|
|
26183
26386
|
overallMentionRate: fraction(),
|
|
26184
|
-
totalPairs:
|
|
26185
|
-
citedPairs:
|
|
26387
|
+
totalPairs: z87.number().int().nonnegative(),
|
|
26388
|
+
citedPairs: z87.number().int().nonnegative(),
|
|
26186
26389
|
/**
|
|
26187
26390
|
* Pairs whose engine returns no sources (a local model), out of every cited
|
|
26188
26391
|
* rate. Snapshots stored before this field existed read 0: they were
|
|
26189
26392
|
* computed with those pairs counted as not cited and are not rewritten.
|
|
26190
26393
|
*/
|
|
26191
|
-
citationNotMeasuredPairs:
|
|
26394
|
+
citationNotMeasuredPairs: z87.number().int().nonnegative(),
|
|
26192
26395
|
/** Count of pairs mentioned in the answer text. Legacy rows read back as 0. */
|
|
26193
|
-
mentionedPairs:
|
|
26194
|
-
providerBreakdown:
|
|
26396
|
+
mentionedPairs: z87.number().int().nonnegative(),
|
|
26397
|
+
providerBreakdown: z87.record(z87.string(), z87.object({
|
|
26195
26398
|
/** `cited / (total - citationNotMeasured)`; null when none of the engine's pairs carried sources. */
|
|
26196
26399
|
citedRate: fraction().nullable(),
|
|
26197
26400
|
mentionRate: fraction(),
|
|
26198
|
-
cited:
|
|
26199
|
-
mentioned:
|
|
26200
|
-
total:
|
|
26201
|
-
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()
|
|
26202
26405
|
})),
|
|
26203
|
-
createdAt:
|
|
26406
|
+
createdAt: z87.string(),
|
|
26204
26407
|
/**
|
|
26205
26408
|
* `'ready'` when the snapshot reflects real data; `'no-data'` for the
|
|
26206
26409
|
* sentinel returned by `/health/latest` when a project has no health
|
|
26207
26410
|
* snapshots yet (newly created, or only failed runs). Numeric fields are
|
|
26208
26411
|
* zero and `providerBreakdown` is `{}` in the no-data case.
|
|
26209
26412
|
*/
|
|
26210
|
-
status:
|
|
26413
|
+
status: z87.enum(["ready", "no-data"]),
|
|
26211
26414
|
/** Reason for `status === 'no-data'`. Absent when `status === 'ready'`. */
|
|
26212
|
-
reason:
|
|
26415
|
+
reason: z87.literal("no-runs-yet").optional()
|
|
26213
26416
|
});
|
|
26214
26417
|
|
|
26215
26418
|
// ../contracts/src/agent.ts
|
|
26216
|
-
import { z as
|
|
26217
|
-
var agentViewContextSchema =
|
|
26218
|
-
view:
|
|
26219
|
-
seoProfileId:
|
|
26220
|
-
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(),
|
|
26221
26424
|
/** The market-rankings region and market the SEO view is narrowed to. */
|
|
26222
|
-
seoRegionKey:
|
|
26223
|
-
seoMarketKey:
|
|
26425
|
+
seoRegionKey: z88.string().trim().min(1).max(200).optional(),
|
|
26426
|
+
seoMarketKey: z88.string().trim().min(1).max(200).optional(),
|
|
26224
26427
|
/** The active series of a saved SEO history chart. */
|
|
26225
|
-
seoTrend:
|
|
26428
|
+
seoTrend: z88.object({
|
|
26226
26429
|
days: seoTrendDaysSchema,
|
|
26227
26430
|
metric: seoTrendMetricSchema,
|
|
26228
26431
|
keyword: seoTrendKeywordSchema.optional()
|
|
26229
26432
|
}).strict().optional(),
|
|
26230
|
-
unavailableReason:
|
|
26433
|
+
unavailableReason: z88.string().trim().min(1).max(512).optional(),
|
|
26231
26434
|
selection: visibilityReportRequestSchema.optional(),
|
|
26232
|
-
page:
|
|
26233
|
-
runId:
|
|
26234
|
-
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()
|
|
26235
26438
|
}).strict().optional()
|
|
26236
26439
|
}).strict().superRefine((value, ctx) => {
|
|
26237
26440
|
if (value.seoProfileId && value.view !== "seo") ctx.addIssue({ code: "custom", message: "SEO profile context requires the SEO view." });
|
|
@@ -26245,9 +26448,9 @@ var agentViewContextSchema = z87.object({
|
|
|
26245
26448
|
if (value.page && value.view !== "site-health") ctx.addIssue({ code: "custom", message: "Page context requires the Agent Readiness view." });
|
|
26246
26449
|
if (value.selection && !["visibility", "property", "queries"].includes(value.view)) ctx.addIssue({ code: "custom", message: "Measurement selection requires a measurement view." });
|
|
26247
26450
|
});
|
|
26248
|
-
var agentTurnLimitsSchema =
|
|
26249
|
-
maxToolCalls:
|
|
26250
|
-
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)
|
|
26251
26454
|
}).strict();
|
|
26252
26455
|
function agentVisibilityEvidence(report, project, retrievedAt) {
|
|
26253
26456
|
const selection = report.selection;
|
|
@@ -26290,26 +26493,26 @@ function agentVisibilityEvidence(report, project, retrievedAt) {
|
|
|
26290
26493
|
))
|
|
26291
26494
|
};
|
|
26292
26495
|
}
|
|
26293
|
-
var agentProviderIdSchema =
|
|
26294
|
-
var agentProviderBackgroundPauseSchema =
|
|
26496
|
+
var agentProviderIdSchema = z88.enum(["claude", "openai", "gemini", "zai", "openrouter"]);
|
|
26497
|
+
var agentProviderBackgroundPauseSchema = z88.object({
|
|
26295
26498
|
reason: providerErrorCodeSchema.extract(["PROVIDER_AUTH", "PROVIDER_BILLING"]),
|
|
26296
|
-
retryAt:
|
|
26297
|
-
recovery:
|
|
26499
|
+
retryAt: z88.iso.datetime(),
|
|
26500
|
+
recovery: z88.string()
|
|
26298
26501
|
});
|
|
26299
|
-
var agentProviderOptionDtoSchema =
|
|
26502
|
+
var agentProviderOptionDtoSchema = z88.object({
|
|
26300
26503
|
/** Stable identifier — what clients pass back as `provider` on the prompt endpoint. */
|
|
26301
26504
|
id: agentProviderIdSchema,
|
|
26302
26505
|
/** Human-readable label for UI pickers, e.g. "Anthropic (Claude)". */
|
|
26303
|
-
label:
|
|
26506
|
+
label: z88.string(),
|
|
26304
26507
|
/** Default model if the caller doesn't pick one. */
|
|
26305
|
-
defaultModel:
|
|
26508
|
+
defaultModel: z88.string(),
|
|
26306
26509
|
/** Whether a usable API key was found (config.yaml or provider env var). */
|
|
26307
|
-
configured:
|
|
26510
|
+
configured: z88.boolean(),
|
|
26308
26511
|
/**
|
|
26309
26512
|
* Where the key resolved from, if any. `null` when `configured === false`.
|
|
26310
26513
|
* Surfaced so the UI can nudge users toward their preferred source of truth.
|
|
26311
26514
|
*/
|
|
26312
|
-
keySource:
|
|
26515
|
+
keySource: z88.enum(["config", "env"]).nullable(),
|
|
26313
26516
|
/** Current credential's automatic-work hold; omitted by hosts predating this field. */
|
|
26314
26517
|
backgroundPause: agentProviderBackgroundPauseSchema.nullable().optional(),
|
|
26315
26518
|
/**
|
|
@@ -26317,14 +26520,14 @@ var agentProviderOptionDtoSchema = z87.object({
|
|
|
26317
26520
|
* then a few stronger current models. A pinned model outside the list is
|
|
26318
26521
|
* listed first. Any other model ID can still be requested.
|
|
26319
26522
|
*/
|
|
26320
|
-
models:
|
|
26523
|
+
models: z88.array(z88.object({ id: z88.string(), displayName: z88.string() })).optional()
|
|
26321
26524
|
});
|
|
26322
|
-
var agentProvidersResponseDtoSchema =
|
|
26525
|
+
var agentProvidersResponseDtoSchema = z88.object({
|
|
26323
26526
|
/**
|
|
26324
26527
|
* Every provider Aero knows about. `configured === false` entries are
|
|
26325
26528
|
* included so the UI can render them disabled with an onboarding hint.
|
|
26326
26529
|
*/
|
|
26327
|
-
providers:
|
|
26530
|
+
providers: z88.array(agentProviderOptionDtoSchema).default([]),
|
|
26328
26531
|
/**
|
|
26329
26532
|
* Provider a new session uses when the caller names none: the
|
|
26330
26533
|
* `agent.provider` pin when set (reported even without a key, as its
|
|
@@ -26334,50 +26537,50 @@ var agentProvidersResponseDtoSchema = z87.object({
|
|
|
26334
26537
|
*/
|
|
26335
26538
|
defaultProvider: agentProviderIdSchema.nullable()
|
|
26336
26539
|
});
|
|
26337
|
-
var memorySourceSchema =
|
|
26540
|
+
var memorySourceSchema = z88.enum(["aero", "user", "compaction"]);
|
|
26338
26541
|
var MemorySources = memorySourceSchema.enum;
|
|
26339
26542
|
var AGENT_MEMORY_VALUE_MAX_BYTES = 2 * 1024;
|
|
26340
26543
|
var AGENT_MEMORY_KEY_MAX_LENGTH = 128;
|
|
26341
|
-
var agentMemoryUpsertRequestSchema =
|
|
26342
|
-
key:
|
|
26343
|
-
value:
|
|
26544
|
+
var agentMemoryUpsertRequestSchema = z88.object({
|
|
26545
|
+
key: z88.string().min(1).max(AGENT_MEMORY_KEY_MAX_LENGTH),
|
|
26546
|
+
value: z88.string().min(1)
|
|
26344
26547
|
});
|
|
26345
|
-
var agentMemoryDeleteRequestSchema =
|
|
26346
|
-
key:
|
|
26548
|
+
var agentMemoryDeleteRequestSchema = z88.object({
|
|
26549
|
+
key: z88.string().min(1).max(AGENT_MEMORY_KEY_MAX_LENGTH)
|
|
26347
26550
|
});
|
|
26348
|
-
var agentPromptRequestSchema =
|
|
26349
|
-
prompt:
|
|
26350
|
-
conversationId:
|
|
26551
|
+
var agentPromptRequestSchema = z88.object({
|
|
26552
|
+
prompt: z88.string().trim().min(1),
|
|
26553
|
+
conversationId: z88.string().min(1).nullable().optional(),
|
|
26351
26554
|
provider: agentProviderIdSchema.optional(),
|
|
26352
|
-
modelId:
|
|
26353
|
-
scope:
|
|
26354
|
-
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(),
|
|
26355
26558
|
context: agentViewContextSchema.optional(),
|
|
26356
26559
|
limits: agentTurnLimitsSchema.optional()
|
|
26357
26560
|
});
|
|
26358
|
-
var agentConversationMessageSchema =
|
|
26359
|
-
var agentConversationSummarySchema =
|
|
26360
|
-
id:
|
|
26361
|
-
title:
|
|
26362
|
-
active:
|
|
26363
|
-
modelProvider:
|
|
26364
|
-
modelId:
|
|
26365
|
-
createdAt:
|
|
26366
|
-
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()
|
|
26367
26570
|
});
|
|
26368
26571
|
var agentConversationSchema = agentConversationSummarySchema.extend({
|
|
26369
|
-
messages:
|
|
26370
|
-
isStreaming:
|
|
26572
|
+
messages: z88.array(agentConversationMessageSchema),
|
|
26573
|
+
isStreaming: z88.boolean()
|
|
26371
26574
|
});
|
|
26372
|
-
var agentConversationListSchema =
|
|
26373
|
-
conversations:
|
|
26374
|
-
currentConversationId:
|
|
26375
|
-
nextOffset:
|
|
26575
|
+
var agentConversationListSchema = z88.object({
|
|
26576
|
+
conversations: z88.array(agentConversationSummarySchema),
|
|
26577
|
+
currentConversationId: z88.string().nullable(),
|
|
26578
|
+
nextOffset: z88.number().int().nullable()
|
|
26376
26579
|
});
|
|
26377
|
-
var agentConversationCreateSchema =
|
|
26378
|
-
id:
|
|
26580
|
+
var agentConversationCreateSchema = z88.object({
|
|
26581
|
+
id: z88.uuid()
|
|
26379
26582
|
}).strict();
|
|
26380
|
-
var agentConversationDeleteSchema =
|
|
26583
|
+
var agentConversationDeleteSchema = z88.object({ id: z88.string(), status: z88.literal("deleted") });
|
|
26381
26584
|
function agentConversationTitle(messages) {
|
|
26382
26585
|
for (const message of messages) {
|
|
26383
26586
|
if (message.role !== "user") continue;
|
|
@@ -26389,49 +26592,49 @@ function agentConversationTitle(messages) {
|
|
|
26389
26592
|
return "New conversation";
|
|
26390
26593
|
}
|
|
26391
26594
|
var aeroPreviewStarterIds = ["status", "changes", "gaps", "insights"];
|
|
26392
|
-
var aeroPreviewStarterIdSchema =
|
|
26393
|
-
var aeroPreviewStepSchema =
|
|
26595
|
+
var aeroPreviewStarterIdSchema = z88.enum(aeroPreviewStarterIds);
|
|
26596
|
+
var aeroPreviewStepSchema = z88.object({
|
|
26394
26597
|
/** Assistant text shown before the tool call, when the turn narrates it. */
|
|
26395
|
-
text:
|
|
26396
|
-
tool:
|
|
26598
|
+
text: z88.string().optional(),
|
|
26599
|
+
tool: z88.object({
|
|
26397
26600
|
/** Real Canonry MCP tool name, such as canonry_visibility_report. */
|
|
26398
|
-
name:
|
|
26601
|
+
name: z88.string(),
|
|
26399
26602
|
/** The tool's registered title, which the live bar shows as the card label. */
|
|
26400
|
-
label:
|
|
26401
|
-
arguments:
|
|
26603
|
+
label: z88.string(),
|
|
26604
|
+
arguments: z88.record(z88.string(), z88.unknown()),
|
|
26402
26605
|
/** A compact excerpt of the stored result, not the full payload. */
|
|
26403
|
-
result:
|
|
26404
|
-
durationMs:
|
|
26606
|
+
result: z88.unknown(),
|
|
26607
|
+
durationMs: z88.number().int().nonnegative()
|
|
26405
26608
|
})
|
|
26406
26609
|
});
|
|
26407
|
-
var aeroPreviewStarterSchema =
|
|
26610
|
+
var aeroPreviewStarterSchema = z88.object({
|
|
26408
26611
|
id: aeroPreviewStarterIdSchema,
|
|
26409
|
-
steps:
|
|
26612
|
+
steps: z88.array(aeroPreviewStepSchema),
|
|
26410
26613
|
/** Final assistant markdown. */
|
|
26411
|
-
answer:
|
|
26614
|
+
answer: z88.string()
|
|
26412
26615
|
});
|
|
26413
|
-
var aeroPreviewResponseSchema =
|
|
26414
|
-
project:
|
|
26415
|
-
seededAt:
|
|
26416
|
-
starters:
|
|
26616
|
+
var aeroPreviewResponseSchema = z88.object({
|
|
26617
|
+
project: z88.string(),
|
|
26618
|
+
seededAt: z88.string(),
|
|
26619
|
+
starters: z88.array(aeroPreviewStarterSchema)
|
|
26417
26620
|
});
|
|
26418
|
-
var agentConversationListQuerySchema =
|
|
26419
|
-
offset:
|
|
26420
|
-
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)
|
|
26421
26624
|
}).strict();
|
|
26422
26625
|
|
|
26423
26626
|
// ../contracts/src/sentiment.ts
|
|
26424
|
-
import { z as
|
|
26627
|
+
import { z as z89 } from "zod";
|
|
26425
26628
|
var SENTIMENT_MODEL = "jev-1.13.0";
|
|
26426
26629
|
var SENTIMENT_OPENROUTER_MODEL = "typesafe/jev-1.13";
|
|
26427
26630
|
var SENTIMENT_OPENROUTER_SERVED_MODEL = "typesafe/jev-1.13-20260917";
|
|
26428
|
-
var sentimentEvaluatorProviderSchema =
|
|
26631
|
+
var sentimentEvaluatorProviderSchema = z89.enum(["typesafe", "openrouter"]);
|
|
26429
26632
|
var SENTIMENT_INTERVAL_LIMITATION = "Wilson 95% intervals assume independent observations. They exclude classifier error and dependence among related queries, Properties, and sweeps.";
|
|
26430
|
-
var id =
|
|
26431
|
-
var count2 =
|
|
26432
|
-
var runIds =
|
|
26433
|
-
var rate = fraction(
|
|
26434
|
-
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([
|
|
26435
26638
|
"favorable",
|
|
26436
26639
|
"mixed",
|
|
26437
26640
|
"unfavorable",
|
|
@@ -26452,22 +26655,22 @@ var sentimentOutcomeSchema = z88.enum([
|
|
|
26452
26655
|
"canceled"
|
|
26453
26656
|
]);
|
|
26454
26657
|
var SentimentOutcomes = sentimentOutcomeSchema.enum;
|
|
26455
|
-
var sentimentStateSchema =
|
|
26456
|
-
var sentimentEvaluationDefinitionSchema =
|
|
26457
|
-
schemaVersion:
|
|
26458
|
-
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]),
|
|
26459
26662
|
/** Omitted on historical direct TypeSafe definitions to preserve their immutable identity. */
|
|
26460
26663
|
provider: sentimentEvaluatorProviderSchema.optional(),
|
|
26461
|
-
expectedReturnedModel:
|
|
26664
|
+
expectedReturnedModel: z89.literal(SENTIMENT_OPENROUTER_SERVED_MODEL).optional(),
|
|
26462
26665
|
verdictVersion: id,
|
|
26463
26666
|
identityVersion: id,
|
|
26464
26667
|
evidenceVersion: id,
|
|
26465
26668
|
segmentationVersion: id,
|
|
26466
26669
|
preprocessingVersion: id,
|
|
26467
|
-
languagePolicy:
|
|
26468
|
-
comparisonMethodVersion:
|
|
26469
|
-
confidenceThreshold:
|
|
26470
|
-
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()
|
|
26471
26674
|
}).strict().superRefine((definition, ctx) => {
|
|
26472
26675
|
const routed = definition.provider === "openrouter";
|
|
26473
26676
|
if (definition.requestedModel !== (routed ? SENTIMENT_OPENROUTER_MODEL : SENTIMENT_MODEL) || (routed ? definition.expectedReturnedModel !== SENTIMENT_OPENROUTER_SERVED_MODEL : definition.expectedReturnedModel !== void 0)) {
|
|
@@ -26510,7 +26713,7 @@ function storedDefinitionProjection(value) {
|
|
|
26510
26713
|
if (typeof projected.questions === "object" && projected.questions !== null) projected.questions = Object.fromEntries(Object.entries(projected.questions).filter(([key]) => key !== "theme"));
|
|
26511
26714
|
return projected;
|
|
26512
26715
|
}
|
|
26513
|
-
var storedSentimentEvaluationDefinitionSchema =
|
|
26716
|
+
var storedSentimentEvaluationDefinitionSchema = z89.preprocess(storedDefinitionProjection, sentimentEvaluationDefinitionSchema);
|
|
26514
26717
|
function canonicalSentimentJson(value) {
|
|
26515
26718
|
function canonical(item) {
|
|
26516
26719
|
if (Array.isArray(item)) return item.map(canonical);
|
|
@@ -26519,69 +26722,69 @@ function canonicalSentimentJson(value) {
|
|
|
26519
26722
|
}
|
|
26520
26723
|
return JSON.stringify(canonical(value));
|
|
26521
26724
|
}
|
|
26522
|
-
var sentimentSubjectSchema =
|
|
26523
|
-
var sentimentUsageEdgeSchema =
|
|
26524
|
-
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({
|
|
26525
26728
|
queryId: id,
|
|
26526
|
-
queryText:
|
|
26527
|
-
queryClass:
|
|
26729
|
+
queryText: z89.string(),
|
|
26730
|
+
queryClass: z89.enum(["branded", "non-brand"]),
|
|
26528
26731
|
provider: id,
|
|
26529
|
-
requestedModel:
|
|
26530
|
-
servedModel:
|
|
26531
|
-
location:
|
|
26532
|
-
revision:
|
|
26533
|
-
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),
|
|
26534
26737
|
locationContext: locationContextSchema.nullable().default(null)
|
|
26535
26738
|
}).strict();
|
|
26536
|
-
var sentimentEvidenceSchema =
|
|
26537
|
-
var sentimentUsageSchema =
|
|
26538
|
-
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({
|
|
26539
26742
|
sourceSnapshotId: id,
|
|
26540
|
-
sourceText:
|
|
26743
|
+
sourceText: z89.string(),
|
|
26541
26744
|
sourceTextHash: id,
|
|
26542
26745
|
subject: sentimentSubjectSchema,
|
|
26543
26746
|
subjectHash: id,
|
|
26544
26747
|
context: sentimentExecutionContextSchema,
|
|
26545
|
-
language:
|
|
26748
|
+
language: z89.string(),
|
|
26546
26749
|
definition: sentimentEvaluationDefinitionSchema,
|
|
26547
|
-
sentences:
|
|
26750
|
+
sentences: z89.array(sentimentEvidenceSchema)
|
|
26548
26751
|
}).strict();
|
|
26549
|
-
var storedSentimentClassifierInputSchema =
|
|
26752
|
+
var storedSentimentClassifierInputSchema = z89.preprocess((value) => {
|
|
26550
26753
|
if (typeof value !== "object" || value === null || !("definition" in value)) return value;
|
|
26551
26754
|
return { ...value, definition: storedDefinitionProjection(value.definition) };
|
|
26552
26755
|
}, sentimentClassifierInputSchema);
|
|
26553
|
-
var classifierCommon = { returnedModel:
|
|
26554
|
-
var sentimentClassifierOutputSchema =
|
|
26555
|
-
|
|
26556
|
-
kind:
|
|
26756
|
+
var classifierCommon = { returnedModel: z89.string().nullable(), usage: sentimentUsageSchema };
|
|
26757
|
+
var sentimentClassifierOutputSchema = z89.discriminatedUnion("kind", [
|
|
26758
|
+
z89.object({
|
|
26759
|
+
kind: z89.literal("classified"),
|
|
26557
26760
|
...classifierCommon,
|
|
26558
|
-
returnedModel:
|
|
26761
|
+
returnedModel: z89.string(),
|
|
26559
26762
|
outcome: sentimentOutcomeSchema,
|
|
26560
|
-
conclusion:
|
|
26561
|
-
complaint:
|
|
26562
|
-
confidence:
|
|
26763
|
+
conclusion: z89.array(sentimentEvidenceSchema),
|
|
26764
|
+
complaint: z89.array(sentimentEvidenceSchema).nullable(),
|
|
26765
|
+
confidence: z89.number().min(0).max(1).nullable()
|
|
26563
26766
|
}).strict(),
|
|
26564
|
-
|
|
26565
|
-
|
|
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()
|
|
26566
26769
|
]).superRefine((result, ctx) => {
|
|
26567
26770
|
if (result.kind === "classified" && ["favorable", "mixed", "unfavorable"].includes(result.outcome) && result.conclusion.length === 0) {
|
|
26568
26771
|
ctx.addIssue({ code: "custom", path: ["conclusion"], message: "Judgments require conclusion evidence" });
|
|
26569
26772
|
}
|
|
26570
26773
|
});
|
|
26571
|
-
var storedSentimentClassifierOutputSchema =
|
|
26572
|
-
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({
|
|
26573
26776
|
runId: id.optional(),
|
|
26574
26777
|
runIds: runIds.optional(),
|
|
26575
|
-
revision:
|
|
26576
|
-
mode:
|
|
26577
|
-
queryClass:
|
|
26578
|
-
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"),
|
|
26579
26782
|
queryId: id.optional(),
|
|
26580
26783
|
scopeKey: id.optional(),
|
|
26581
26784
|
marketKey: id.optional(),
|
|
26582
26785
|
provider: id.optional(),
|
|
26583
26786
|
model: id.optional(),
|
|
26584
|
-
location:
|
|
26787
|
+
location: z89.string().min(1).optional(),
|
|
26585
26788
|
evaluationDefinitionId: id.optional(),
|
|
26586
26789
|
/** Exact frozen Advanced execution node of the selected query. Identity: it narrows the assessed population. */
|
|
26587
26790
|
executionNodeKey: id.optional()
|
|
@@ -26591,26 +26794,26 @@ function exclusiveSentimentRuns(value, ctx) {
|
|
|
26591
26794
|
if (value.runIds && new Set(value.runIds).size !== value.runIds.length) ctx.addIssue({ code: "custom", path: ["runIds"], message: "Run IDs must be unique." });
|
|
26592
26795
|
}
|
|
26593
26796
|
var sentimentSelectionSchema = sentimentSelectionBaseSchema.superRefine(exclusiveSentimentRuns);
|
|
26594
|
-
var sentimentSummaryIncludeSchema =
|
|
26797
|
+
var sentimentSummaryIncludeSchema = z89.enum(["assessments", "locations"]);
|
|
26595
26798
|
var SENTIMENT_QUERY_PAGE_DEFAULT = 25;
|
|
26596
26799
|
var SENTIMENT_QUERY_PAGE_MAX = 500;
|
|
26597
26800
|
var sentimentSummaryRequestSchema = sentimentSelectionBaseSchema.extend({
|
|
26598
|
-
include:
|
|
26599
|
-
queryLimit:
|
|
26600
|
-
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()
|
|
26601
26804
|
}).superRefine(exclusiveSentimentRuns);
|
|
26602
|
-
var sentimentEvidenceOutcomeFilterSchema =
|
|
26805
|
+
var sentimentEvidenceOutcomeFilterSchema = z89.preprocess((value) => {
|
|
26603
26806
|
const items = typeof value === "string" ? [value] : Array.isArray(value) ? value : null;
|
|
26604
26807
|
return items ? [...new Set(items.flatMap((item) => typeof item === "string" ? item.split(",").map((part) => part.trim()).filter(Boolean) : [item]))] : value;
|
|
26605
|
-
},
|
|
26606
|
-
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);
|
|
26607
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) => {
|
|
26608
26811
|
exclusiveSentimentRuns(value, ctx);
|
|
26609
26812
|
if (value.runIds) ctx.addIssue({ code: "custom", path: ["runIds"], message: "Comparison requires one explicit run per period." });
|
|
26610
26813
|
});
|
|
26611
|
-
var sentimentResolvedSelectionSchema = sentimentSelectionBaseSchema.extend({ runId: id.nullable(), revision:
|
|
26612
|
-
var sentimentCountsSchema =
|
|
26613
|
-
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({
|
|
26614
26817
|
selected: count2,
|
|
26615
26818
|
eligibleAssessments: count2,
|
|
26616
26819
|
unadmittedAssessments: count2,
|
|
@@ -26624,45 +26827,45 @@ var sentimentCoverageSchema = z88.object({
|
|
|
26624
26827
|
expectedProviderSlots: count2,
|
|
26625
26828
|
completedProviderSlots: count2
|
|
26626
26829
|
}).strict();
|
|
26627
|
-
var sentimentScoreSchema =
|
|
26628
|
-
var headlineFields = { state: sentimentStateSchema, reason:
|
|
26629
|
-
var sentimentHeadlineSchema =
|
|
26630
|
-
var sentimentOverallHeadlineSchema =
|
|
26631
|
-
var sentimentOverviewSchema =
|
|
26632
|
-
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({
|
|
26633
26836
|
assessmentId: id.nullable(),
|
|
26634
26837
|
sourceSnapshotId: id,
|
|
26635
26838
|
runId: id,
|
|
26636
26839
|
subjectId: id,
|
|
26637
|
-
subjectLabel:
|
|
26840
|
+
subjectLabel: z89.string(),
|
|
26638
26841
|
executionNodeKey: id.nullable(),
|
|
26639
26842
|
provider: id,
|
|
26640
|
-
requestedModel:
|
|
26641
|
-
servedModel:
|
|
26642
|
-
location:
|
|
26843
|
+
requestedModel: z89.string().nullable(),
|
|
26844
|
+
servedModel: z89.string().nullable(),
|
|
26845
|
+
location: z89.string().nullable(),
|
|
26643
26846
|
evaluationDefinitionId: id.nullable(),
|
|
26644
26847
|
state: sentimentStateSchema,
|
|
26645
|
-
outcome:
|
|
26646
|
-
reason:
|
|
26848
|
+
outcome: z89.union([sentimentOutcomeSchema, z89.null()]),
|
|
26849
|
+
reason: z89.string().nullable()
|
|
26647
26850
|
}).strict();
|
|
26648
|
-
var sentimentQuerySummarySchema =
|
|
26649
|
-
var sentimentBreakdownSchema =
|
|
26650
|
-
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({
|
|
26651
26854
|
...headlineFields,
|
|
26652
|
-
configured:
|
|
26855
|
+
configured: z89.boolean(),
|
|
26653
26856
|
selection: sentimentResolvedSelectionSchema,
|
|
26654
26857
|
evaluationDefinition: sentimentEvaluationDefinitionSchema.nullable(),
|
|
26655
|
-
breakdowns:
|
|
26656
|
-
queries:
|
|
26858
|
+
breakdowns: z89.array(sentimentBreakdownSchema),
|
|
26859
|
+
queries: z89.array(sentimentQuerySummarySchema),
|
|
26657
26860
|
/**
|
|
26658
26861
|
* Branded reads: the Properties with a mixed or unfavorable rating, most criticized first
|
|
26659
26862
|
* ({@link rankCriticizedProperties}). `keys` are the first {@link SENTIMENT_CRITICIZED_PROPERTY_LIMIT}
|
|
26660
26863
|
* property breakdown keys; `total` counts them all; `{ total: 0, keys: [] }` with fewer than two
|
|
26661
26864
|
* Properties in view. Absent from older servers, comparison periods, and non-brand, disabled or unavailable reads.
|
|
26662
26865
|
*/
|
|
26663
|
-
criticizedProperties:
|
|
26866
|
+
criticizedProperties: z89.object({ total: count2, keys: z89.array(z89.string()) }).strict().optional(),
|
|
26664
26867
|
/** Present on the paged summary read; follow `nextCursor` as `queryCursor` for the next query rows. */
|
|
26665
|
-
queryPage:
|
|
26868
|
+
queryPage: z89.object({ total: count2, limit: count2, nextCursor: z89.string().nullable() }).strict().optional()
|
|
26666
26869
|
}).strict();
|
|
26667
26870
|
var SENTIMENT_CRITICIZED_PROPERTY_LIMIT = 5;
|
|
26668
26871
|
function rankCriticizedProperties(rows) {
|
|
@@ -26673,92 +26876,92 @@ function rankCriticizedProperties(rows) {
|
|
|
26673
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));
|
|
26674
26877
|
return { total: criticized.length, keys: criticized.slice(0, SENTIMENT_CRITICIZED_PROPERTY_LIMIT).map((row) => row.key) };
|
|
26675
26878
|
}
|
|
26676
|
-
var sentimentSettingsUpdateSchema =
|
|
26677
|
-
var sentimentSettingsSchema =
|
|
26879
|
+
var sentimentSettingsUpdateSchema = z89.object({ enabled: z89.boolean().optional() }).strict();
|
|
26880
|
+
var sentimentSettingsSchema = z89.object({
|
|
26678
26881
|
provider: sentimentEvaluatorProviderSchema.optional(),
|
|
26679
|
-
installEnabled:
|
|
26680
|
-
enabled:
|
|
26681
|
-
ready:
|
|
26682
|
-
readinessReasons:
|
|
26683
|
-
model:
|
|
26882
|
+
installEnabled: z89.boolean(),
|
|
26883
|
+
enabled: z89.boolean(),
|
|
26884
|
+
ready: z89.boolean(),
|
|
26885
|
+
readinessReasons: z89.array(z89.string()),
|
|
26886
|
+
model: z89.string(),
|
|
26684
26887
|
enablementEpoch: count2,
|
|
26685
26888
|
completionBoundary: count2,
|
|
26686
26889
|
evaluationDefinitionId: id.nullable(),
|
|
26687
|
-
actions:
|
|
26890
|
+
actions: z89.object({ configure: z89.boolean(), backfill: z89.boolean() }).strict(),
|
|
26688
26891
|
// Kept for older clients. Sentiment is no longer labelled experimental, so the server sends false.
|
|
26689
|
-
experimental:
|
|
26690
|
-
disclosure:
|
|
26691
|
-
}).strict();
|
|
26692
|
-
var sentimentBackfillSelectionSchema = sentimentSelectionBaseSchema.extend({ runIds: runIds.optional(), from:
|
|
26693
|
-
var sentimentBackfillRequestSchema =
|
|
26694
|
-
var sentimentBackfillPreviewSchema =
|
|
26695
|
-
previewToken:
|
|
26696
|
-
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(),
|
|
26697
26900
|
selection: sentimentBackfillSelectionSchema,
|
|
26698
26901
|
evaluationDefinitionId: id.nullable(),
|
|
26699
26902
|
eligibleAssessments: count2,
|
|
26700
26903
|
alreadyClassified: count2,
|
|
26701
|
-
skipped:
|
|
26904
|
+
skipped: z89.array(z89.object({ runId: id, reason: z89.string(), count: count2 }).strict()),
|
|
26702
26905
|
estimatedInputTokens: count2,
|
|
26703
|
-
estimatedCostUsd:
|
|
26704
|
-
estimateMethod:
|
|
26906
|
+
estimatedCostUsd: z89.number().nonnegative().nullable(),
|
|
26907
|
+
estimateMethod: z89.string()
|
|
26705
26908
|
}).strict();
|
|
26706
|
-
var sentimentJobStateSchema =
|
|
26707
|
-
var sentimentAttemptReceiptSchema =
|
|
26708
|
-
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({
|
|
26709
26912
|
id,
|
|
26710
26913
|
projectId: id,
|
|
26711
|
-
origin:
|
|
26914
|
+
origin: z89.enum(["automatic", "backfill"]),
|
|
26712
26915
|
state: sentimentJobStateSchema,
|
|
26713
26916
|
enablementEpoch: count2,
|
|
26714
26917
|
evaluationDefinitionId: id,
|
|
26715
26918
|
selection: sentimentBackfillSelectionSchema,
|
|
26716
|
-
createdAt:
|
|
26717
|
-
updatedAt:
|
|
26919
|
+
createdAt: z89.string(),
|
|
26920
|
+
updatedAt: z89.string(),
|
|
26718
26921
|
counts: sentimentCountsSchema,
|
|
26719
26922
|
selected: count2,
|
|
26720
|
-
cancellationReason:
|
|
26721
|
-
attempts:
|
|
26923
|
+
cancellationReason: z89.string().nullable(),
|
|
26924
|
+
attempts: z89.array(sentimentAttemptReceiptSchema),
|
|
26722
26925
|
/** Paged job read: every attempt of the job, and the cursor for the next (older) attempts. */
|
|
26723
26926
|
attemptCount: count2.optional(),
|
|
26724
|
-
nextAttemptCursor:
|
|
26927
|
+
nextAttemptCursor: z89.string().nullable().optional()
|
|
26725
26928
|
}).strict();
|
|
26726
26929
|
var sentimentJobSummarySchema = sentimentJobSchema.omit({ attempts: true, attemptCount: true, nextAttemptCursor: true }).extend({ attemptCount: count2 }).strict();
|
|
26727
|
-
var sentimentJobsSchema =
|
|
26930
|
+
var sentimentJobsSchema = z89.object({ jobs: z89.array(sentimentJobSummarySchema) }).strict();
|
|
26728
26931
|
var SENTIMENT_ATTEMPT_PAGE_DEFAULT = 50;
|
|
26729
|
-
var sentimentJobRequestSchema =
|
|
26730
|
-
attemptLimit:
|
|
26731
|
-
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()
|
|
26732
26935
|
}).strict();
|
|
26733
|
-
var sentimentEvidenceItemSchema =
|
|
26936
|
+
var sentimentEvidenceItemSchema = z89.object({
|
|
26734
26937
|
assessmentId: id,
|
|
26735
26938
|
runId: id,
|
|
26736
26939
|
sourceSnapshotId: id,
|
|
26737
|
-
sourceText:
|
|
26940
|
+
sourceText: z89.string(),
|
|
26738
26941
|
sourceTextHash: id,
|
|
26739
26942
|
subject: sentimentSubjectSchema,
|
|
26740
26943
|
subjectHash: id,
|
|
26741
26944
|
context: sentimentExecutionContextSchema,
|
|
26742
26945
|
evaluationDefinitionId: id,
|
|
26743
26946
|
outcome: sentimentOutcomeSchema,
|
|
26744
|
-
conclusion:
|
|
26745
|
-
complaint:
|
|
26746
|
-
returnedModel:
|
|
26747
|
-
reason:
|
|
26947
|
+
conclusion: z89.array(sentimentEvidenceSchema),
|
|
26948
|
+
complaint: z89.array(sentimentEvidenceSchema).nullable(),
|
|
26949
|
+
returnedModel: z89.string().nullable(),
|
|
26950
|
+
reason: z89.string().nullable()
|
|
26748
26951
|
}).strict();
|
|
26749
|
-
var sentimentEvidencePageSchema =
|
|
26750
|
-
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({
|
|
26751
26954
|
from: sentimentSummarySchema,
|
|
26752
26955
|
to: sentimentSummarySchema,
|
|
26753
|
-
verdict:
|
|
26754
|
-
favorableRateDelta:
|
|
26755
|
-
refusalReasons:
|
|
26956
|
+
verdict: z89.enum(["improved", "declined", "no-clear-change"]).nullable(),
|
|
26957
|
+
favorableRateDelta: z89.number().nullable(),
|
|
26958
|
+
refusalReasons: z89.array(z89.string()),
|
|
26756
26959
|
commonUnits: count2,
|
|
26757
26960
|
excludedFrom: count2,
|
|
26758
26961
|
excludedTo: count2,
|
|
26759
|
-
changedScope:
|
|
26760
|
-
method:
|
|
26761
|
-
limitation:
|
|
26962
|
+
changedScope: z89.boolean(),
|
|
26963
|
+
method: z89.literal("wilson-independent-v1"),
|
|
26964
|
+
limitation: z89.string()
|
|
26762
26965
|
}).strict();
|
|
26763
26966
|
function emptySentimentCounts() {
|
|
26764
26967
|
return Object.fromEntries(sentimentOutcomeSchema.options.map((outcome) => [outcome, 0]));
|
|
@@ -26795,7 +26998,7 @@ function aggregateSentiment(items, options = {}) {
|
|
|
26795
26998
|
}
|
|
26796
26999
|
|
|
26797
27000
|
// ../contracts/src/composites.ts
|
|
26798
|
-
import { z as
|
|
27001
|
+
import { z as z90 } from "zod";
|
|
26799
27002
|
var PROJECT_OVERVIEW_QUERY_CLASS_SCOPE = {
|
|
26800
27003
|
queryClass: "all",
|
|
26801
27004
|
figures: [
|
|
@@ -26817,36 +27020,36 @@ var PROJECT_OVERVIEW_QUERY_CLASS_SCOPE = {
|
|
|
26817
27020
|
],
|
|
26818
27021
|
note: "These legacy figures pool branded and non-brand queries in one denominator. mentionCoverage and scores.mentionShare preserve separate class populations."
|
|
26819
27022
|
};
|
|
26820
|
-
var projectOverviewMentionCoverageSchema =
|
|
27023
|
+
var projectOverviewMentionCoverageSchema = z90.object({
|
|
26821
27024
|
selection: visibilityReportSelectionSchema,
|
|
26822
|
-
populations:
|
|
27025
|
+
populations: z90.array(z90.object({
|
|
26823
27026
|
queryClass: visibilityReportPopulationClassSchema,
|
|
26824
|
-
queryCount:
|
|
26825
|
-
answerCount:
|
|
27027
|
+
queryCount: z90.number().int().nonnegative(),
|
|
27028
|
+
answerCount: z90.number().int().nonnegative(),
|
|
26826
27029
|
mentionCoverage: visibilityReportRateSchema,
|
|
26827
27030
|
citationCoverage: visibilityReportRateSchema
|
|
26828
27031
|
}).strict())
|
|
26829
27032
|
}).strict();
|
|
26830
|
-
var metricToneSchema =
|
|
26831
|
-
var scoreSummarySchema =
|
|
26832
|
-
label:
|
|
26833
|
-
value:
|
|
26834
|
-
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(),
|
|
26835
27038
|
tone: metricToneSchema,
|
|
26836
|
-
description:
|
|
26837
|
-
tooltip:
|
|
26838
|
-
trend:
|
|
27039
|
+
description: z90.string(),
|
|
27040
|
+
tooltip: z90.string().optional(),
|
|
27041
|
+
trend: z90.array(percent()),
|
|
26839
27042
|
progress: percent().optional(),
|
|
26840
|
-
providerCoverage:
|
|
27043
|
+
providerCoverage: z90.string().optional()
|
|
26841
27044
|
});
|
|
26842
|
-
var mentionShareBreakdownSchema =
|
|
26843
|
-
projectMentionSnapshots:
|
|
26844
|
-
competitorMentionSnapshots:
|
|
27045
|
+
var mentionShareBreakdownSchema = z90.object({
|
|
27046
|
+
projectMentionSnapshots: z90.number().int().nonnegative(),
|
|
27047
|
+
competitorMentionSnapshots: z90.number().int().nonnegative(),
|
|
26845
27048
|
/** `projectMentionSnapshots + competitorMentionSnapshots`, the denominator of `score` and every `ranking` share. */
|
|
26846
|
-
combinedMentionSnapshots:
|
|
26847
|
-
perCompetitor:
|
|
26848
|
-
domain:
|
|
26849
|
-
mentionSnapshots:
|
|
27049
|
+
combinedMentionSnapshots: z90.number().int().nonnegative(),
|
|
27050
|
+
perCompetitor: z90.array(z90.object({
|
|
27051
|
+
domain: z90.string(),
|
|
27052
|
+
mentionSnapshots: z90.number().int().nonnegative(),
|
|
26850
27053
|
shareOfCompetitiveTotal: percent()
|
|
26851
27054
|
})),
|
|
26852
27055
|
/**
|
|
@@ -26856,50 +27059,50 @@ var mentionShareBreakdownSchema = z89.object({
|
|
|
26856
27059
|
* Empty when there is no head-to-head: no tracked competitors, or no brand
|
|
26857
27060
|
* named in this class.
|
|
26858
27061
|
*/
|
|
26859
|
-
ranking:
|
|
26860
|
-
kind:
|
|
27062
|
+
ranking: z90.array(z90.object({
|
|
27063
|
+
kind: z90.enum(["project", "competitor"]),
|
|
26861
27064
|
/** The tracked competitor's domain. Null on the project's row. */
|
|
26862
|
-
domain:
|
|
26863
|
-
mentionSnapshots:
|
|
26864
|
-
share: fraction(
|
|
27065
|
+
domain: z90.string().nullable(),
|
|
27066
|
+
mentionSnapshots: z90.number().int().nonnegative(),
|
|
27067
|
+
share: fraction(z90.number().min(0).max(1))
|
|
26865
27068
|
})),
|
|
26866
|
-
snapshotsWithAnswerText:
|
|
26867
|
-
snapshotsTotal:
|
|
26868
|
-
score: percent(
|
|
27069
|
+
snapshotsWithAnswerText: z90.number().int().nonnegative(),
|
|
27070
|
+
snapshotsTotal: z90.number().int().nonnegative(),
|
|
27071
|
+
score: percent(z90.number().min(0).max(100)).nullable()
|
|
26869
27072
|
});
|
|
26870
27073
|
var mentionShareSchema = scoreSummarySchema.extend({
|
|
26871
27074
|
/** Non-brand queries — the competitive figure. See `MentionShareDto`. */
|
|
26872
27075
|
breakdown: mentionShareBreakdownSchema,
|
|
26873
|
-
scope:
|
|
27076
|
+
scope: z90.enum(["non-brand", "pooled"]),
|
|
26874
27077
|
/** Branded queries, beside the competitive figure and never inside it. */
|
|
26875
27078
|
branded: mentionShareBreakdownSchema
|
|
26876
27079
|
});
|
|
26877
|
-
var movementSummarySchema =
|
|
26878
|
-
gained:
|
|
26879
|
-
lost:
|
|
27080
|
+
var movementSummarySchema = z90.object({
|
|
27081
|
+
gained: z90.number().int().nonnegative(),
|
|
27082
|
+
lost: z90.number().int().nonnegative(),
|
|
26880
27083
|
tone: metricToneSchema,
|
|
26881
|
-
hasPreviousRun:
|
|
26882
|
-
gainedQueries:
|
|
26883
|
-
lostQueries:
|
|
26884
|
-
});
|
|
26885
|
-
var movementComparisonSchema =
|
|
26886
|
-
hasPreviousRun:
|
|
26887
|
-
comparable:
|
|
26888
|
-
querySetChanged:
|
|
26889
|
-
previousRunAt:
|
|
26890
|
-
currentQueryCount:
|
|
26891
|
-
previousQueryCount:
|
|
26892
|
-
comparableQueryCount:
|
|
26893
|
-
addedQueryCount:
|
|
26894
|
-
removedQueryCount:
|
|
26895
|
-
addedQueries:
|
|
26896
|
-
removedQueries:
|
|
26897
|
-
});
|
|
26898
|
-
var projectOverviewInsightSchema =
|
|
26899
|
-
id:
|
|
26900
|
-
projectId:
|
|
26901
|
-
runId:
|
|
26902
|
-
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([
|
|
26903
27106
|
"regression",
|
|
26904
27107
|
"gain",
|
|
26905
27108
|
"opportunity",
|
|
@@ -26916,51 +27119,51 @@ var projectOverviewInsightSchema = z89.object({
|
|
|
26916
27119
|
"gbp-keyword-drop"
|
|
26917
27120
|
]),
|
|
26918
27121
|
severity: insightSeveritySchema,
|
|
26919
|
-
title:
|
|
26920
|
-
query:
|
|
26921
|
-
provider:
|
|
26922
|
-
recommendation:
|
|
26923
|
-
action:
|
|
26924
|
-
target:
|
|
26925
|
-
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()
|
|
26926
27129
|
}).optional(),
|
|
26927
|
-
cause:
|
|
26928
|
-
cause:
|
|
26929
|
-
competitorDomain:
|
|
26930
|
-
details:
|
|
27130
|
+
cause: z90.object({
|
|
27131
|
+
cause: z90.string(),
|
|
27132
|
+
competitorDomain: z90.string().optional(),
|
|
27133
|
+
details: z90.string().optional()
|
|
26931
27134
|
}).optional(),
|
|
26932
|
-
dismissed:
|
|
26933
|
-
createdAt:
|
|
27135
|
+
dismissed: z90.boolean(),
|
|
27136
|
+
createdAt: z90.string()
|
|
26934
27137
|
});
|
|
26935
|
-
var projectOverviewHealthSchema =
|
|
26936
|
-
id:
|
|
26937
|
-
projectId:
|
|
26938
|
-
runId:
|
|
27138
|
+
var projectOverviewHealthSchema = z90.object({
|
|
27139
|
+
id: z90.string(),
|
|
27140
|
+
projectId: z90.string(),
|
|
27141
|
+
runId: z90.string().nullable(),
|
|
26939
27142
|
overallCitedRate: fraction().nullable(),
|
|
26940
27143
|
overallMentionRate: fraction(),
|
|
26941
|
-
totalPairs:
|
|
26942
|
-
citedPairs:
|
|
26943
|
-
citationNotMeasuredPairs:
|
|
26944
|
-
mentionedPairs:
|
|
26945
|
-
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({
|
|
26946
27149
|
citedRate: fraction().nullable(),
|
|
26947
27150
|
mentionRate: fraction(),
|
|
26948
|
-
cited:
|
|
26949
|
-
mentioned:
|
|
26950
|
-
total:
|
|
26951
|
-
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()
|
|
26952
27155
|
})),
|
|
26953
|
-
createdAt:
|
|
26954
|
-
status:
|
|
26955
|
-
reason:
|
|
27156
|
+
createdAt: z90.string(),
|
|
27157
|
+
status: z90.enum(["ready", "no-data"]),
|
|
27158
|
+
reason: z90.literal("no-runs-yet").optional()
|
|
26956
27159
|
});
|
|
26957
|
-
var attentionItemSchema =
|
|
26958
|
-
id:
|
|
27160
|
+
var attentionItemSchema = z90.object({
|
|
27161
|
+
id: z90.string(),
|
|
26959
27162
|
tone: metricToneSchema,
|
|
26960
|
-
title:
|
|
26961
|
-
detail:
|
|
26962
|
-
actionLabel:
|
|
26963
|
-
href:
|
|
27163
|
+
title: z90.string(),
|
|
27164
|
+
detail: z90.string(),
|
|
27165
|
+
actionLabel: z90.string(),
|
|
27166
|
+
href: z90.string()
|
|
26964
27167
|
});
|
|
26965
27168
|
var OVERVIEW_WHAT_CHANGED_QUERY_LIMIT = 25;
|
|
26966
27169
|
var OVERVIEW_WHAT_CHANGED_UNAVAILABLE_REASONS = [
|
|
@@ -26979,94 +27182,94 @@ var OVERVIEW_WHAT_CHANGED_UNAVAILABLE_REASONS = [
|
|
|
26979
27182
|
/** Advanced: the previous sweep could not be read. */
|
|
26980
27183
|
"unreadable"
|
|
26981
27184
|
];
|
|
26982
|
-
var overviewWhatChangedQuerySchema =
|
|
27185
|
+
var overviewWhatChangedQuerySchema = z90.object({
|
|
26983
27186
|
/** The tracked query's id (Simple) or the plan's query id (Advanced). */
|
|
26984
|
-
queryId:
|
|
26985
|
-
query:
|
|
27187
|
+
queryId: z90.string().nullable(),
|
|
27188
|
+
query: z90.string(),
|
|
26986
27189
|
/** The server's class for the query; null when it has no single class. */
|
|
26987
27190
|
queryClass: queryClassSchema.nullable(),
|
|
26988
27191
|
/** Answer engines whose answer lost the signal. */
|
|
26989
|
-
providers:
|
|
27192
|
+
providers: z90.array(z90.string()),
|
|
26990
27193
|
/** Locations of those answers; null is an answer measured without a location. */
|
|
26991
|
-
locations:
|
|
27194
|
+
locations: z90.array(z90.string().nullable()),
|
|
26992
27195
|
/** Advanced: the Properties that lost the signal on this query. Always empty for Simple. */
|
|
26993
|
-
properties:
|
|
27196
|
+
properties: z90.array(z90.object({ key: z90.string(), label: z90.string() })),
|
|
26994
27197
|
/** Advanced: the frozen markets of the answers that lost it. Always empty for Simple. */
|
|
26995
|
-
markets:
|
|
27198
|
+
markets: z90.array(z90.object({ key: z90.string(), label: z90.string() }))
|
|
26996
27199
|
});
|
|
26997
|
-
var overviewWhatChangedSignalSchema =
|
|
27200
|
+
var overviewWhatChangedSignalSchema = z90.object({
|
|
26998
27201
|
/** Distinct queries that lost the signal in at least one answer of the latest check. */
|
|
26999
|
-
queryCount:
|
|
27202
|
+
queryCount: z90.number().int().nonnegative(),
|
|
27000
27203
|
/** At most `OVERVIEW_WHAT_CHANGED_QUERY_LIMIT` of those queries, in query text order. */
|
|
27001
|
-
queries:
|
|
27204
|
+
queries: z90.array(overviewWhatChangedQuerySchema),
|
|
27002
27205
|
/** True when `queries` names fewer queries than `queryCount`. */
|
|
27003
|
-
truncated:
|
|
27206
|
+
truncated: z90.boolean()
|
|
27004
27207
|
});
|
|
27005
|
-
var overviewWhatChangedComparisonSchema =
|
|
27006
|
-
|
|
27007
|
-
state:
|
|
27208
|
+
var overviewWhatChangedComparisonSchema = z90.discriminatedUnion("state", [
|
|
27209
|
+
z90.object({
|
|
27210
|
+
state: z90.literal("available"),
|
|
27008
27211
|
/** The earlier runs the latest check was compared with, newest first. */
|
|
27009
|
-
previousRunIds:
|
|
27212
|
+
previousRunIds: z90.array(z90.string()).min(1)
|
|
27010
27213
|
}),
|
|
27011
|
-
|
|
27012
|
-
state:
|
|
27013
|
-
reason:
|
|
27214
|
+
z90.object({
|
|
27215
|
+
state: z90.literal("unavailable"),
|
|
27216
|
+
reason: z90.enum(OVERVIEW_WHAT_CHANGED_UNAVAILABLE_REASONS)
|
|
27014
27217
|
})
|
|
27015
27218
|
]);
|
|
27016
|
-
var projectOverviewWhatChangedSchema =
|
|
27017
|
-
mode:
|
|
27219
|
+
var projectOverviewWhatChangedSchema = z90.object({
|
|
27220
|
+
mode: z90.enum(["simple", "advanced"]),
|
|
27018
27221
|
/** The completed check the lost signals read; null before the first one. */
|
|
27019
|
-
latestCheck:
|
|
27020
|
-
runIds:
|
|
27021
|
-
createdAt:
|
|
27222
|
+
latestCheck: z90.object({
|
|
27223
|
+
runIds: z90.array(z90.string()).min(1),
|
|
27224
|
+
createdAt: z90.string()
|
|
27022
27225
|
}).nullable(),
|
|
27023
27226
|
comparison: overviewWhatChangedComparisonSchema,
|
|
27024
27227
|
lostMentions: overviewWhatChangedSignalSchema,
|
|
27025
27228
|
lostCitations: overviewWhatChangedSignalSchema,
|
|
27026
27229
|
/** Queued and running AI Visibility runs, probes left out. */
|
|
27027
|
-
activeRuns:
|
|
27028
|
-
count:
|
|
27029
|
-
runIds:
|
|
27230
|
+
activeRuns: z90.object({
|
|
27231
|
+
count: z90.number().int().nonnegative(),
|
|
27232
|
+
runIds: z90.array(z90.string())
|
|
27030
27233
|
}),
|
|
27031
27234
|
/** The rows Overview lists for this project, in order. Empty when nothing changed. */
|
|
27032
|
-
items:
|
|
27235
|
+
items: z90.array(attentionItemSchema)
|
|
27033
27236
|
});
|
|
27034
|
-
var projectOverviewDtoSchema =
|
|
27237
|
+
var projectOverviewDtoSchema = z90.object({
|
|
27035
27238
|
sentiment: sentimentOverviewSchema.optional(),
|
|
27036
27239
|
mentionCoverage: projectOverviewMentionCoverageSchema.optional(),
|
|
27037
27240
|
project: projectDtoSchema,
|
|
27038
27241
|
latestRun: latestProjectRunDtoSchema,
|
|
27039
27242
|
health: projectOverviewHealthSchema.nullable(),
|
|
27040
|
-
topInsights:
|
|
27041
|
-
queryClassScope:
|
|
27042
|
-
queryClass:
|
|
27043
|
-
figures:
|
|
27044
|
-
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()
|
|
27045
27248
|
}).optional(),
|
|
27046
|
-
queryCounts:
|
|
27047
|
-
totalQueries:
|
|
27048
|
-
citedQueries:
|
|
27049
|
-
notCitedQueries:
|
|
27249
|
+
queryCounts: z90.object({
|
|
27250
|
+
totalQueries: z90.number().int().nonnegative(),
|
|
27251
|
+
citedQueries: z90.number().int().nonnegative(),
|
|
27252
|
+
notCitedQueries: z90.number().int().nonnegative(),
|
|
27050
27253
|
citedRate: fraction().nullable(),
|
|
27051
|
-
citationNotMeasuredQueries:
|
|
27052
|
-
mentionedQueries:
|
|
27053
|
-
notMentionedQueries:
|
|
27254
|
+
citationNotMeasuredQueries: z90.number().int().nonnegative(),
|
|
27255
|
+
mentionedQueries: z90.number().int().nonnegative(),
|
|
27256
|
+
notMentionedQueries: z90.number().int().nonnegative(),
|
|
27054
27257
|
mentionRate: fraction()
|
|
27055
27258
|
}),
|
|
27056
|
-
providers:
|
|
27057
|
-
provider:
|
|
27259
|
+
providers: z90.array(z90.object({
|
|
27260
|
+
provider: z90.string(),
|
|
27058
27261
|
citedRate: fraction().nullable(),
|
|
27059
|
-
cited:
|
|
27060
|
-
total:
|
|
27061
|
-
citationNotMeasured:
|
|
27262
|
+
cited: z90.number().int().nonnegative(),
|
|
27263
|
+
total: z90.number().int().nonnegative(),
|
|
27264
|
+
citationNotMeasured: z90.number().int().nonnegative()
|
|
27062
27265
|
})),
|
|
27063
|
-
transitions:
|
|
27064
|
-
since:
|
|
27065
|
-
gained:
|
|
27066
|
-
lost:
|
|
27067
|
-
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()
|
|
27068
27271
|
}),
|
|
27069
|
-
scores:
|
|
27272
|
+
scores: z90.object({
|
|
27070
27273
|
mention: scoreSummarySchema,
|
|
27071
27274
|
visibility: scoreSummarySchema,
|
|
27072
27275
|
mentionShare: mentionShareSchema,
|
|
@@ -27080,70 +27283,70 @@ var projectOverviewDtoSchema = z89.object({
|
|
|
27080
27283
|
citationMovement: movementSummarySchema,
|
|
27081
27284
|
mentionMovement: movementSummarySchema,
|
|
27082
27285
|
movementComparison: movementComparisonSchema,
|
|
27083
|
-
competitors:
|
|
27084
|
-
id:
|
|
27085
|
-
domain:
|
|
27086
|
-
aliases:
|
|
27087
|
-
autoAliasNames:
|
|
27088
|
-
citationCount:
|
|
27089
|
-
totalQueries:
|
|
27090
|
-
pressureLabel:
|
|
27091
|
-
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())
|
|
27092
27295
|
})),
|
|
27093
|
-
providerScores:
|
|
27094
|
-
provider:
|
|
27095
|
-
model:
|
|
27296
|
+
providerScores: z90.array(z90.object({
|
|
27297
|
+
provider: z90.string(),
|
|
27298
|
+
model: z90.string().nullable(),
|
|
27096
27299
|
score: percent().nullable(),
|
|
27097
|
-
cited:
|
|
27098
|
-
total:
|
|
27099
|
-
citationNotMeasured:
|
|
27100
|
-
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()
|
|
27101
27304
|
})),
|
|
27102
|
-
attentionItems:
|
|
27305
|
+
attentionItems: z90.array(attentionItemSchema),
|
|
27103
27306
|
whatChanged: projectOverviewWhatChangedSchema.optional(),
|
|
27104
|
-
runHistory:
|
|
27105
|
-
runId:
|
|
27106
|
-
createdAt:
|
|
27107
|
-
citedCount:
|
|
27108
|
-
totalCount:
|
|
27109
|
-
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(),
|
|
27110
27313
|
citationRate: percent().nullable(),
|
|
27111
|
-
mentionedCount:
|
|
27314
|
+
mentionedCount: z90.number().int().nonnegative(),
|
|
27112
27315
|
mentionRate: percent(),
|
|
27113
|
-
status:
|
|
27316
|
+
status: z90.string()
|
|
27114
27317
|
})),
|
|
27115
|
-
suggestedQueries:
|
|
27116
|
-
rows:
|
|
27117
|
-
query:
|
|
27118
|
-
impressions:
|
|
27119
|
-
clicks:
|
|
27120
|
-
avgPosition:
|
|
27121
|
-
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()
|
|
27122
27325
|
})),
|
|
27123
|
-
totalCandidates:
|
|
27124
|
-
skippedAlreadyTracked:
|
|
27326
|
+
totalCandidates: z90.number().int().nonnegative(),
|
|
27327
|
+
skippedAlreadyTracked: z90.number().int().nonnegative()
|
|
27125
27328
|
}),
|
|
27126
|
-
dateRangeLabel:
|
|
27127
|
-
contextLabel:
|
|
27128
|
-
});
|
|
27129
|
-
var searchHitKindSchema =
|
|
27130
|
-
var projectSearchSnapshotHitSchema =
|
|
27131
|
-
kind:
|
|
27132
|
-
id:
|
|
27133
|
-
runId:
|
|
27134
|
-
query:
|
|
27135
|
-
provider:
|
|
27136
|
-
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(),
|
|
27137
27340
|
citationState: citationStateSchema,
|
|
27138
|
-
matchedField:
|
|
27139
|
-
snippet:
|
|
27140
|
-
createdAt:
|
|
27141
|
-
});
|
|
27142
|
-
var projectSearchInsightHitSchema =
|
|
27143
|
-
kind:
|
|
27144
|
-
id:
|
|
27145
|
-
runId:
|
|
27146
|
-
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([
|
|
27147
27350
|
"regression",
|
|
27148
27351
|
"gain",
|
|
27149
27352
|
"opportunity",
|
|
@@ -27161,23 +27364,23 @@ var projectSearchInsightHitSchema = z89.object({
|
|
|
27161
27364
|
"gbp-keyword-drop"
|
|
27162
27365
|
]),
|
|
27163
27366
|
severity: insightSeveritySchema,
|
|
27164
|
-
title:
|
|
27165
|
-
query:
|
|
27166
|
-
provider:
|
|
27167
|
-
matchedField:
|
|
27168
|
-
snippet:
|
|
27169
|
-
dismissed:
|
|
27170
|
-
createdAt:
|
|
27171
|
-
});
|
|
27172
|
-
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", [
|
|
27173
27376
|
projectSearchSnapshotHitSchema,
|
|
27174
27377
|
projectSearchInsightHitSchema
|
|
27175
27378
|
]);
|
|
27176
|
-
var projectSearchResponseSchema =
|
|
27177
|
-
query:
|
|
27178
|
-
totalHits:
|
|
27179
|
-
truncated:
|
|
27180
|
-
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)
|
|
27181
27384
|
});
|
|
27182
27385
|
|
|
27183
27386
|
// ../contracts/src/index-coverage.ts
|
|
@@ -27265,107 +27468,107 @@ function summarizeObservedQueryCountsByClass(snapshots, classOf) {
|
|
|
27265
27468
|
}
|
|
27266
27469
|
|
|
27267
27470
|
// ../contracts/src/organic-evidence.ts
|
|
27268
|
-
import { z as
|
|
27269
|
-
var organicEvidencePeriodSchema =
|
|
27471
|
+
import { z as z91 } from "zod";
|
|
27472
|
+
var organicEvidencePeriodSchema = z91.union(windowDayValues(WINDOW_SETS.organicEvidence).map((value) => z91.literal(value)));
|
|
27270
27473
|
function parseOrganicEvidencePeriod(value) {
|
|
27271
27474
|
return windowDays(parseWindowIn(value, WINDOW_SETS.organicEvidence, { field: "period", fallback: "90d" }));
|
|
27272
27475
|
}
|
|
27273
|
-
var cohortNameSchema =
|
|
27274
|
-
var countSchema2 =
|
|
27275
|
-
clicks:
|
|
27276
|
-
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()
|
|
27277
27480
|
});
|
|
27278
|
-
var cohortSchema =
|
|
27481
|
+
var cohortSchema = z91.object({
|
|
27279
27482
|
name: cohortNameSchema,
|
|
27280
|
-
startDate:
|
|
27281
|
-
endDate:
|
|
27483
|
+
startDate: z91.string(),
|
|
27484
|
+
endDate: z91.string()
|
|
27282
27485
|
});
|
|
27283
27486
|
var searchCohortSchema = cohortSchema.extend({ totals: countSchema2 });
|
|
27284
27487
|
var sessionCohortSchema = cohortSchema.extend({
|
|
27285
|
-
organicSessions:
|
|
27286
|
-
});
|
|
27287
|
-
var sourceCoverageSchema =
|
|
27288
|
-
startDate:
|
|
27289
|
-
endDate:
|
|
27290
|
-
observedDays:
|
|
27291
|
-
});
|
|
27292
|
-
var crawlerCountsSchema =
|
|
27293
|
-
verified:
|
|
27294
|
-
claimedUnverified:
|
|
27295
|
-
unknownAiLike:
|
|
27296
|
-
});
|
|
27297
|
-
var referralCountsSchema =
|
|
27298
|
-
total:
|
|
27299
|
-
paid:
|
|
27300
|
-
organic:
|
|
27301
|
-
unknown:
|
|
27302
|
-
});
|
|
27303
|
-
var organicEvidenceDtoSchema =
|
|
27304
|
-
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"),
|
|
27305
27508
|
periodDays: organicEvidencePeriodSchema,
|
|
27306
27509
|
/** Latest headline evidence date, preferring the GSC property date when available. */
|
|
27307
|
-
asOfDate:
|
|
27308
|
-
coverage:
|
|
27309
|
-
gsc:
|
|
27310
|
-
ga4:
|
|
27311
|
-
server:
|
|
27312
|
-
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()
|
|
27313
27516
|
}),
|
|
27314
|
-
sourceCoverage:
|
|
27517
|
+
sourceCoverage: z91.object({
|
|
27315
27518
|
gsc: sourceCoverageSchema.nullable(),
|
|
27316
27519
|
ga4: sourceCoverageSchema.nullable(),
|
|
27317
27520
|
server: sourceCoverageSchema.nullable(),
|
|
27318
|
-
visibility:
|
|
27521
|
+
visibility: z91.object({ completedAt: z91.string(), ageDays: z91.number().nonnegative() }).nullable()
|
|
27319
27522
|
}),
|
|
27320
|
-
gsc:
|
|
27523
|
+
gsc: z91.object({
|
|
27321
27524
|
propertyTotals: countSchema2,
|
|
27322
27525
|
namedBrand: countSchema2,
|
|
27323
27526
|
namedNonBrand: countSchema2,
|
|
27324
27527
|
suppressedOrUnreportedResidual: countSchema2,
|
|
27325
|
-
cohorts:
|
|
27528
|
+
cohorts: z91.array(searchCohortSchema)
|
|
27326
27529
|
}).nullable(),
|
|
27327
|
-
ga4:
|
|
27328
|
-
organicSessions:
|
|
27329
|
-
cohorts:
|
|
27530
|
+
ga4: z91.object({
|
|
27531
|
+
organicSessions: z91.number().int().nonnegative(),
|
|
27532
|
+
cohorts: z91.array(sessionCohortSchema)
|
|
27330
27533
|
}).nullable(),
|
|
27331
|
-
gaAiReferrals:
|
|
27332
|
-
paidSessions:
|
|
27333
|
-
organicSessions:
|
|
27534
|
+
gaAiReferrals: z91.object({
|
|
27535
|
+
paidSessions: z91.number().int().nonnegative(),
|
|
27536
|
+
organicSessions: z91.number().int().nonnegative()
|
|
27334
27537
|
}).nullable(),
|
|
27335
|
-
server:
|
|
27538
|
+
server: z91.object({
|
|
27336
27539
|
crawlerHits: crawlerCountsSchema,
|
|
27337
27540
|
userFetchHits: crawlerCountsSchema,
|
|
27338
27541
|
referralSessions: referralCountsSchema
|
|
27339
27542
|
}).nullable(),
|
|
27340
|
-
visibility:
|
|
27341
|
-
runId:
|
|
27342
|
-
completedAt:
|
|
27343
|
-
ageDays:
|
|
27543
|
+
visibility: z91.object({
|
|
27544
|
+
runId: z91.string(),
|
|
27545
|
+
completedAt: z91.string(),
|
|
27546
|
+
ageDays: z91.number().nonnegative(),
|
|
27344
27547
|
/** Every (query × engine) answer in the run. The base of `mentionedPairs`. */
|
|
27345
|
-
answerPairs:
|
|
27346
|
-
mentionedPairs:
|
|
27548
|
+
answerPairs: z91.number().int().nonnegative(),
|
|
27549
|
+
mentionedPairs: z91.number().int().nonnegative(),
|
|
27347
27550
|
/** Out of `answerPairs - citationNotMeasuredPairs`, the answers whose sources were checked. */
|
|
27348
|
-
citedPairs:
|
|
27551
|
+
citedPairs: z91.number().int().nonnegative(),
|
|
27349
27552
|
/** Answers whose engine returns no sources (a local model): neither cited nor not cited. */
|
|
27350
|
-
citationNotMeasuredPairs:
|
|
27553
|
+
citationNotMeasuredPairs: z91.number().int().nonnegative()
|
|
27351
27554
|
}).nullable(),
|
|
27352
27555
|
measurement: gaMeasurementAnalysisDtoSchema,
|
|
27353
|
-
pages:
|
|
27354
|
-
path:
|
|
27556
|
+
pages: z91.array(z91.object({
|
|
27557
|
+
path: z91.string(),
|
|
27355
27558
|
gsc: countSchema2,
|
|
27356
|
-
ga4OrganicSessions:
|
|
27357
|
-
server:
|
|
27559
|
+
ga4OrganicSessions: z91.number().int().nonnegative(),
|
|
27560
|
+
server: z91.object({
|
|
27358
27561
|
crawlerHits: crawlerCountsSchema,
|
|
27359
27562
|
userFetchHits: crawlerCountsSchema,
|
|
27360
27563
|
referralSessions: referralCountsSchema
|
|
27361
27564
|
})
|
|
27362
27565
|
})),
|
|
27363
|
-
findings:
|
|
27364
|
-
tone:
|
|
27365
|
-
title:
|
|
27366
|
-
detail:
|
|
27566
|
+
findings: z91.array(z91.object({
|
|
27567
|
+
tone: z91.enum(["positive", "caution", "neutral"]),
|
|
27568
|
+
title: z91.string(),
|
|
27569
|
+
detail: z91.string()
|
|
27367
27570
|
})),
|
|
27368
|
-
limitations:
|
|
27571
|
+
limitations: z91.array(z91.object({ code: z91.string(), detail: z91.string() }))
|
|
27369
27572
|
});
|
|
27370
27573
|
|
|
27371
27574
|
// ../contracts/src/traffic-path.ts
|
|
@@ -27546,7 +27749,7 @@ function escapeLikePattern(value) {
|
|
|
27546
27749
|
}
|
|
27547
27750
|
|
|
27548
27751
|
// ../contracts/src/chatgpt.ts
|
|
27549
|
-
import { z as
|
|
27752
|
+
import { z as z92 } from "zod";
|
|
27550
27753
|
var CHATGPT_ISSUER = "https://auth.openai.com";
|
|
27551
27754
|
var CHATGPT_DISCOVERY_URL = `${CHATGPT_ISSUER}/.well-known/openid-configuration`;
|
|
27552
27755
|
var CHATGPT_RESOURCE = "https://api.openai.com/v1";
|
|
@@ -27562,7 +27765,7 @@ var ChatGptSignInIntents = {
|
|
|
27562
27765
|
login: "login",
|
|
27563
27766
|
connect: "connect"
|
|
27564
27767
|
};
|
|
27565
|
-
var chatGptSignInIntentSchema =
|
|
27768
|
+
var chatGptSignInIntentSchema = z92.enum(["login", "connect"]);
|
|
27566
27769
|
var ChatGptPlanStatuses = {
|
|
27567
27770
|
/** No plan grant: identity only, never connected, or disconnected. */
|
|
27568
27771
|
notConnected: "not-connected",
|
|
@@ -27571,7 +27774,7 @@ var ChatGptPlanStatuses = {
|
|
|
27571
27774
|
/** The grant stopped working (revoked in ChatGPT, refresh refused); connect again. */
|
|
27572
27775
|
reconnectRequired: "reconnect-required"
|
|
27573
27776
|
};
|
|
27574
|
-
var chatGptPlanStatusSchema =
|
|
27777
|
+
var chatGptPlanStatusSchema = z92.enum(["not-connected", "connected", "reconnect-required"]);
|
|
27575
27778
|
var ChatGptSignInErrors = {
|
|
27576
27779
|
disabled: "disabled",
|
|
27577
27780
|
notInvited: "not-invited",
|
|
@@ -27581,7 +27784,7 @@ var ChatGptSignInErrors = {
|
|
|
27581
27784
|
unverifiedEmail: "unverified-email",
|
|
27582
27785
|
failed: "failed"
|
|
27583
27786
|
};
|
|
27584
|
-
var chatGptSignInErrorSchema =
|
|
27787
|
+
var chatGptSignInErrorSchema = z92.enum([
|
|
27585
27788
|
"disabled",
|
|
27586
27789
|
"not-invited",
|
|
27587
27790
|
"denied",
|
|
@@ -27590,36 +27793,36 @@ var chatGptSignInErrorSchema = z91.enum([
|
|
|
27590
27793
|
"unverified-email",
|
|
27591
27794
|
"failed"
|
|
27592
27795
|
]);
|
|
27593
|
-
var chatGptAccountStatusSchema =
|
|
27796
|
+
var chatGptAccountStatusSchema = z92.object({
|
|
27594
27797
|
/** True once a ChatGPT account is linked to this person. */
|
|
27595
|
-
linked:
|
|
27798
|
+
linked: z92.boolean(),
|
|
27596
27799
|
/** The linked ChatGPT account's email, as OpenAI reported it at the last sign-in. */
|
|
27597
|
-
email:
|
|
27598
|
-
plan:
|
|
27800
|
+
email: z92.string().nullable(),
|
|
27801
|
+
plan: z92.object({
|
|
27599
27802
|
status: chatGptPlanStatusSchema,
|
|
27600
27803
|
/** The model Aero uses on this plan, once one has been chosen. */
|
|
27601
|
-
modelId:
|
|
27602
|
-
connectedAt:
|
|
27804
|
+
modelId: z92.string().nullable(),
|
|
27805
|
+
connectedAt: z92.string().nullable()
|
|
27603
27806
|
})
|
|
27604
27807
|
});
|
|
27605
|
-
var chatGptStatusDtoSchema =
|
|
27606
|
-
signInEnabled:
|
|
27607
|
-
planUsageEnabled:
|
|
27808
|
+
var chatGptStatusDtoSchema = z92.object({
|
|
27809
|
+
signInEnabled: z92.boolean(),
|
|
27810
|
+
planUsageEnabled: z92.boolean(),
|
|
27608
27811
|
/** True when a viewer must connect their own ChatGPT plan to use Aero at all (`chatgpt.requirePlan`). */
|
|
27609
|
-
planRequired:
|
|
27610
|
-
usageUrl:
|
|
27812
|
+
planRequired: z92.boolean(),
|
|
27813
|
+
usageUrl: z92.string(),
|
|
27611
27814
|
account: chatGptAccountStatusSchema.nullable()
|
|
27612
27815
|
});
|
|
27613
|
-
var chatGptModelDtoSchema =
|
|
27614
|
-
id:
|
|
27615
|
-
name:
|
|
27816
|
+
var chatGptModelDtoSchema = z92.object({
|
|
27817
|
+
id: z92.string(),
|
|
27818
|
+
name: z92.string()
|
|
27616
27819
|
});
|
|
27617
|
-
var chatGptModelListDtoSchema =
|
|
27618
|
-
models:
|
|
27619
|
-
selected:
|
|
27820
|
+
var chatGptModelListDtoSchema = z92.object({
|
|
27821
|
+
models: z92.array(chatGptModelDtoSchema),
|
|
27822
|
+
selected: z92.string().nullable()
|
|
27620
27823
|
});
|
|
27621
|
-
var chatGptModelSelectionRequestSchema =
|
|
27622
|
-
modelId:
|
|
27824
|
+
var chatGptModelSelectionRequestSchema = z92.object({
|
|
27825
|
+
modelId: z92.string().trim().min(1).max(200)
|
|
27623
27826
|
});
|
|
27624
27827
|
var CHATGPT_AERO_ERRORS = {
|
|
27625
27828
|
connectRequired: "CHATGPT_CONNECT_REQUIRED: Connect your ChatGPT plan to use Aero on this dashboard.",
|
|
@@ -27776,9 +27979,9 @@ function serializeForInlineScript(value) {
|
|
|
27776
27979
|
}
|
|
27777
27980
|
|
|
27778
27981
|
// ../contracts/src/outcome-telemetry.ts
|
|
27779
|
-
import { z as
|
|
27982
|
+
import { z as z93 } from "zod";
|
|
27780
27983
|
var OUTCOME_SURFACES = ["cli", "mcp-stdio", "mcp-http", "aero", "api", "dashboard", "system"];
|
|
27781
|
-
var outcomeSurfaceSchema =
|
|
27984
|
+
var outcomeSurfaceSchema = z93.enum(OUTCOME_SURFACES);
|
|
27782
27985
|
var OutcomeSurfaces = outcomeSurfaceSchema.enum;
|
|
27783
27986
|
var INTEGRATION_NAMES = [
|
|
27784
27987
|
"provider",
|
|
@@ -27800,19 +28003,19 @@ var INTEGRATION_NAMES = [
|
|
|
27800
28003
|
/** The WordPress traffic-logger plugin source, apart from the WordPress publishing connection. */
|
|
27801
28004
|
"traffic_wordpress"
|
|
27802
28005
|
];
|
|
27803
|
-
var integrationNameSchema =
|
|
28006
|
+
var integrationNameSchema = z93.enum(INTEGRATION_NAMES);
|
|
27804
28007
|
var IntegrationNames = integrationNameSchema.enum;
|
|
27805
28008
|
var CONNECTION_ACTIONS = ["connect", "disconnect", "test", "reauth", "select"];
|
|
27806
|
-
var connectionActionSchema =
|
|
28009
|
+
var connectionActionSchema = z93.enum(CONNECTION_ACTIONS);
|
|
27807
28010
|
var ConnectionActions = connectionActionSchema.enum;
|
|
27808
28011
|
var CONNECTION_STATUSES = ["started", "succeeded", "failed", "cancelled"];
|
|
27809
|
-
var connectionStatusSchema =
|
|
28012
|
+
var connectionStatusSchema = z93.enum(CONNECTION_STATUSES);
|
|
27810
28013
|
var ConnectionStatuses = connectionStatusSchema.enum;
|
|
27811
28014
|
var OUTCOME_STATUSES = ["succeeded", "partial", "failed", "skipped", "cancelled"];
|
|
27812
|
-
var outcomeStatusSchema =
|
|
28015
|
+
var outcomeStatusSchema = z93.enum(OUTCOME_STATUSES);
|
|
27813
28016
|
var OutcomeStatuses = outcomeStatusSchema.enum;
|
|
27814
28017
|
var OUTCOME_TRIGGERS = ["manual", "scheduled", "agent", "startup", "retry", "push"];
|
|
27815
|
-
var outcomeTriggerSchema =
|
|
28018
|
+
var outcomeTriggerSchema = z93.enum(OUTCOME_TRIGGERS);
|
|
27816
28019
|
var OutcomeTriggers = outcomeTriggerSchema.enum;
|
|
27817
28020
|
var OUTCOME_REASON_CODES = [
|
|
27818
28021
|
"AUTH_DENIED",
|
|
@@ -27849,7 +28052,7 @@ var OUTCOME_REASON_CODES = [
|
|
|
27849
28052
|
"UNCAUGHT_EXCEPTION",
|
|
27850
28053
|
"UNHANDLED_REJECTION"
|
|
27851
28054
|
];
|
|
27852
|
-
var outcomeReasonCodeSchema =
|
|
28055
|
+
var outcomeReasonCodeSchema = z93.enum(OUTCOME_REASON_CODES);
|
|
27853
28056
|
var OutcomeReasonCodes = outcomeReasonCodeSchema.enum;
|
|
27854
28057
|
var FEATURE_OPERATIONS = {
|
|
27855
28058
|
search_console: ["sync", "inspect", "sitemap_submit"],
|
|
@@ -27879,7 +28082,7 @@ var FEATURE_OPERATIONS = {
|
|
|
27879
28082
|
server: ["start", "crash"]
|
|
27880
28083
|
};
|
|
27881
28084
|
var FEATURE_NAMES = Object.keys(FEATURE_OPERATIONS);
|
|
27882
|
-
var featureNameSchema =
|
|
28085
|
+
var featureNameSchema = z93.enum(FEATURE_NAMES);
|
|
27883
28086
|
var FeatureNames = featureNameSchema.enum;
|
|
27884
28087
|
var OUTCOME_COUNT_KEYS = [
|
|
27885
28088
|
"rows",
|
|
@@ -27917,16 +28120,16 @@ var OUTCOME_COUNT_KEYS = [
|
|
|
27917
28120
|
];
|
|
27918
28121
|
var COUNT_KEY_SET = new Set(OUTCOME_COUNT_KEYS);
|
|
27919
28122
|
var MAX_COUNT = 1e12;
|
|
27920
|
-
var countValueSchema =
|
|
27921
|
-
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");
|
|
27922
28125
|
var WEBHOOK_TARGETS = ["first_party", "slack", "discord"];
|
|
27923
|
-
var webhookTargetSchema =
|
|
28126
|
+
var webhookTargetSchema = z93.enum(WEBHOOK_TARGETS);
|
|
27924
28127
|
var WebhookTargets = webhookTargetSchema.enum;
|
|
27925
28128
|
var STATUS_CLASSES = ["2xx", "3xx", "4xx", "5xx", "timeout", "network", "blocked"];
|
|
27926
|
-
var statusClassSchema =
|
|
28129
|
+
var statusClassSchema = z93.enum(STATUS_CLASSES);
|
|
27927
28130
|
var StatusClasses = statusClassSchema.enum;
|
|
27928
28131
|
var DURATION_BUCKETS = ["under_1s", "1s_to_10s", "10s_to_1m", "1m_to_5m", "5m_to_30m", "30m_or_more"];
|
|
27929
|
-
var durationBucketSchema =
|
|
28132
|
+
var durationBucketSchema = z93.enum(DURATION_BUCKETS);
|
|
27930
28133
|
var DurationBuckets = durationBucketSchema.enum;
|
|
27931
28134
|
function bucketDuration(durationMs) {
|
|
27932
28135
|
const duration = Number.isFinite(durationMs) ? Math.max(0, durationMs) : 0;
|
|
@@ -27937,14 +28140,14 @@ function bucketDuration(durationMs) {
|
|
|
27937
28140
|
if (duration < 18e5) return "5m_to_30m";
|
|
27938
28141
|
return "30m_or_more";
|
|
27939
28142
|
}
|
|
27940
|
-
var outcomeOperationKindSchema =
|
|
28143
|
+
var outcomeOperationKindSchema = z93.enum(["data-refresh", "url-coverage", "url-inspection", "agent-turn", "site-audit"]);
|
|
27941
28144
|
var OutcomeOperationKinds = outcomeOperationKindSchema.enum;
|
|
27942
|
-
var outcomePhaseSchema =
|
|
28145
|
+
var outcomePhaseSchema = z93.enum(["setup", "provider-request", "crawl", "persistence", "unknown"]);
|
|
27943
28146
|
var OutcomePhases = outcomePhaseSchema.enum;
|
|
27944
|
-
var outcomeDiagnosticsSchema =
|
|
28147
|
+
var outcomeDiagnosticsSchema = z93.object({
|
|
27945
28148
|
phase: outcomePhaseSchema,
|
|
27946
|
-
httpStatus:
|
|
27947
|
-
retryCount:
|
|
28149
|
+
httpStatus: z93.number().int().min(100).max(599).optional(),
|
|
28150
|
+
retryCount: z93.number().int().min(0).max(1e6).optional(),
|
|
27948
28151
|
retryAfterBucket: durationBucketSchema.optional(),
|
|
27949
28152
|
/** Unresolved units in this operation: URLs for coverage, sections for a refresh. */
|
|
27950
28153
|
remainingWork: countValueSchema.optional()
|
|
@@ -27967,12 +28170,12 @@ function buildOutcomeDiagnostics(error, context) {
|
|
|
27967
28170
|
return { phase: context.phase };
|
|
27968
28171
|
}
|
|
27969
28172
|
}
|
|
27970
|
-
var errorNameSchema =
|
|
27971
|
-
var agentSlugSchema =
|
|
27972
|
-
var providerNameSchema2 =
|
|
27973
|
-
var modelIdSchema2 =
|
|
27974
|
-
var slugSchema =
|
|
27975
|
-
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({
|
|
27976
28179
|
integration: integrationNameSchema,
|
|
27977
28180
|
provider: providerNameSchema2.optional(),
|
|
27978
28181
|
action: connectionActionSchema,
|
|
@@ -27983,9 +28186,9 @@ var integrationConnectionPropertiesSchema = z92.object({
|
|
|
27983
28186
|
surface: outcomeSurfaceSchema.optional(),
|
|
27984
28187
|
agent: agentSlugSchema.optional(),
|
|
27985
28188
|
durationBucket: durationBucketSchema.optional(),
|
|
27986
|
-
attempt:
|
|
28189
|
+
attempt: z93.number().int().min(1).max(1e6).optional(),
|
|
27987
28190
|
/** The install's first success of this kind; set by the helpers, never by callers. */
|
|
27988
|
-
first:
|
|
28191
|
+
first: z93.literal(true).optional()
|
|
27989
28192
|
}).strict().refine(
|
|
27990
28193
|
(p) => p.integration === IntegrationNames.provider === (p.provider !== void 0),
|
|
27991
28194
|
"provider is required for, and only for, integration provider"
|
|
@@ -27993,12 +28196,12 @@ var integrationConnectionPropertiesSchema = z92.object({
|
|
|
27993
28196
|
(p) => p.status === ConnectionStatuses.succeeded || p.status === ConnectionStatuses.started || p.reasonCode !== void 0,
|
|
27994
28197
|
"a failed or cancelled attempt needs a reasonCode"
|
|
27995
28198
|
);
|
|
27996
|
-
var featureCompletedPropertiesSchema =
|
|
28199
|
+
var featureCompletedPropertiesSchema = z93.object({
|
|
27997
28200
|
feature: featureNameSchema,
|
|
27998
|
-
operation:
|
|
28201
|
+
operation: z93.string().regex(/^[a-z][a-z_]{0,31}$/),
|
|
27999
28202
|
operationKind: outcomeOperationKindSchema.optional(),
|
|
28000
28203
|
/** Fresh random correlation id, never a project, run, account or conversation id. */
|
|
28001
|
-
operationId:
|
|
28204
|
+
operationId: z93.string().uuid().optional(),
|
|
28002
28205
|
diagnostics: outcomeDiagnosticsSchema.optional(),
|
|
28003
28206
|
status: outcomeStatusSchema,
|
|
28004
28207
|
trigger: outcomeTriggerSchema.optional(),
|
|
@@ -28014,17 +28217,17 @@ var featureCompletedPropertiesSchema = z92.object({
|
|
|
28014
28217
|
provider: providerNameSchema2.optional(),
|
|
28015
28218
|
model: modelIdSchema2.optional(),
|
|
28016
28219
|
modelProvider: slugSchema.optional(),
|
|
28017
|
-
sampleRate:
|
|
28018
|
-
droppedBefore:
|
|
28019
|
-
domainHash:
|
|
28020
|
-
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()
|
|
28021
28224
|
}).strict().refine(
|
|
28022
28225
|
(p) => FEATURE_OPERATIONS[p.feature].includes(p.operation),
|
|
28023
28226
|
"operation is not one this feature reports"
|
|
28024
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");
|
|
28025
28228
|
var INSTALL_SOURCES = ["npm", "homebrew", "docker", "source"];
|
|
28026
|
-
var installSourceSchema =
|
|
28027
|
-
var installRefSchema =
|
|
28229
|
+
var installSourceSchema = z93.enum(INSTALL_SOURCES);
|
|
28230
|
+
var installRefSchema = z93.string().regex(/^[a-z0-9][a-z0-9-]{0,31}$/);
|
|
28028
28231
|
function normalizeInstallRef(value) {
|
|
28029
28232
|
const ref = value?.trim().toLowerCase();
|
|
28030
28233
|
return ref && installRefSchema.safeParse(ref).success ? ref : void 0;
|
|
@@ -28059,11 +28262,11 @@ var INSTALL_STATE_USAGE_KEYS = [
|
|
|
28059
28262
|
];
|
|
28060
28263
|
var fixedKeyCounts = (keys) => {
|
|
28061
28264
|
const allowed = new Set(keys);
|
|
28062
|
-
return
|
|
28265
|
+
return z93.record(z93.string(), countValueSchema).refine((obj) => Object.keys(obj).every((k) => allowed.has(k)), "unknown key");
|
|
28063
28266
|
};
|
|
28064
|
-
var installStatePropertiesSchema =
|
|
28065
|
-
providers:
|
|
28066
|
-
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),
|
|
28067
28270
|
counts: fixedKeyCounts(INSTALL_STATE_COUNT_KEYS),
|
|
28068
28271
|
usage24h: fixedKeyCounts(INSTALL_STATE_USAGE_KEYS),
|
|
28069
28272
|
providerCalls24h: fixedKeyCounts(PROVIDER_NAMES).optional(),
|
|
@@ -28144,7 +28347,7 @@ function classifyProviderOutcomeError(err) {
|
|
|
28144
28347
|
}
|
|
28145
28348
|
|
|
28146
28349
|
// ../contracts/src/ui-telemetry.ts
|
|
28147
|
-
import { z as
|
|
28350
|
+
import { z as z94 } from "zod";
|
|
28148
28351
|
var UI_PAGES = [
|
|
28149
28352
|
"/",
|
|
28150
28353
|
"/projects",
|
|
@@ -28178,7 +28381,7 @@ var UI_PAGES = [
|
|
|
28178
28381
|
"not-found",
|
|
28179
28382
|
"other"
|
|
28180
28383
|
];
|
|
28181
|
-
var uiPageSchema =
|
|
28384
|
+
var uiPageSchema = z94.enum(UI_PAGES);
|
|
28182
28385
|
var UI_PROJECT_TABS = [
|
|
28183
28386
|
"overview",
|
|
28184
28387
|
"portfolio",
|
|
@@ -28200,7 +28403,7 @@ var UI_PROJECT_TABS = [
|
|
|
28200
28403
|
"settings",
|
|
28201
28404
|
"other"
|
|
28202
28405
|
];
|
|
28203
|
-
var uiProjectTabSchema =
|
|
28406
|
+
var uiProjectTabSchema = z94.enum(UI_PROJECT_TABS);
|
|
28204
28407
|
var UI_ACTIONS = [
|
|
28205
28408
|
"sweep.launch",
|
|
28206
28409
|
"sweep.cancel",
|
|
@@ -28253,7 +28456,7 @@ var UI_ACTIONS = [
|
|
|
28253
28456
|
/** A table search settled on a non-empty query (debounced or Enter; the text is never sent). */
|
|
28254
28457
|
"search.submit"
|
|
28255
28458
|
];
|
|
28256
|
-
var uiActionSchema =
|
|
28459
|
+
var uiActionSchema = z94.enum(UI_ACTIONS);
|
|
28257
28460
|
var UI_INTEGRATIONS = [
|
|
28258
28461
|
"google",
|
|
28259
28462
|
"gsc",
|
|
@@ -28269,9 +28472,9 @@ var UI_INTEGRATIONS = [
|
|
|
28269
28472
|
"traffic_cloud_run",
|
|
28270
28473
|
"traffic_wordpress"
|
|
28271
28474
|
];
|
|
28272
|
-
var uiIntegrationSchema =
|
|
28475
|
+
var uiIntegrationSchema = z94.enum(UI_INTEGRATIONS);
|
|
28273
28476
|
var UI_FILTERS = ["provider", "model", "location", "window", "query_class", "seoProfile", "other"];
|
|
28274
|
-
var uiFilterSchema =
|
|
28477
|
+
var uiFilterSchema = z94.enum(UI_FILTERS);
|
|
28275
28478
|
var UI_EXPORT_FORMATS = ["csv", "json", "html"];
|
|
28276
28479
|
var UI_ERROR_KINDS = ["render", "unhandled", "api"];
|
|
28277
28480
|
var UI_STATUS_CLASSES = ["4xx", "5xx", "network"];
|
|
@@ -28357,54 +28560,54 @@ function isUiApiRouteTemplate(route) {
|
|
|
28357
28560
|
return PARAM_SEGMENT.test(segment) || UI_ROUTE_FIXED_CHILDREN.has(`${previous}/${segment}`);
|
|
28358
28561
|
});
|
|
28359
28562
|
}
|
|
28360
|
-
var uiEventBaseSchema =
|
|
28361
|
-
eventId:
|
|
28362
|
-
uiSessionId:
|
|
28563
|
+
var uiEventBaseSchema = z94.object({
|
|
28564
|
+
eventId: z94.string().uuid(),
|
|
28565
|
+
uiSessionId: z94.string().uuid(),
|
|
28363
28566
|
page: uiPageSchema
|
|
28364
28567
|
});
|
|
28365
28568
|
var UI_PAGE_TIME_MAX_MS = 864e5;
|
|
28366
|
-
var uiTelemetryEventSchema =
|
|
28569
|
+
var uiTelemetryEventSchema = z94.discriminatedUnion("event", [
|
|
28367
28570
|
uiEventBaseSchema.extend({
|
|
28368
|
-
event:
|
|
28571
|
+
event: z94.literal("ui.page_time"),
|
|
28369
28572
|
tab: uiProjectTabSchema.optional(),
|
|
28370
|
-
visitId:
|
|
28371
|
-
foregroundMs:
|
|
28372
|
-
activeMs:
|
|
28373
|
-
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()
|
|
28374
28577
|
}).strict().refine((value) => value.activeMs <= value.foregroundMs, "active time cannot exceed foreground time"),
|
|
28375
28578
|
uiEventBaseSchema.extend({
|
|
28376
|
-
event:
|
|
28579
|
+
event: z94.literal("ui.page_viewed"),
|
|
28377
28580
|
tab: uiProjectTabSchema.optional()
|
|
28378
28581
|
}).strict(),
|
|
28379
28582
|
uiEventBaseSchema.extend({
|
|
28380
|
-
event:
|
|
28583
|
+
event: z94.literal("ui.action"),
|
|
28381
28584
|
action: uiActionSchema,
|
|
28382
28585
|
tab: uiProjectTabSchema.optional(),
|
|
28383
28586
|
integration: uiIntegrationSchema.optional(),
|
|
28384
|
-
format:
|
|
28587
|
+
format: z94.enum(UI_EXPORT_FORMATS).optional(),
|
|
28385
28588
|
filter: uiFilterSchema.optional()
|
|
28386
28589
|
}).strict(),
|
|
28387
28590
|
uiEventBaseSchema.extend({
|
|
28388
|
-
event:
|
|
28389
|
-
kind:
|
|
28591
|
+
event: z94.literal("ui.error"),
|
|
28592
|
+
kind: z94.enum(UI_ERROR_KINDS),
|
|
28390
28593
|
tab: uiProjectTabSchema.optional(),
|
|
28391
|
-
component:
|
|
28392
|
-
errorName:
|
|
28393
|
-
route:
|
|
28394
|
-
method:
|
|
28395
|
-
statusClass:
|
|
28396
|
-
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()
|
|
28397
28600
|
}).strict(),
|
|
28398
28601
|
uiEventBaseSchema.extend({
|
|
28399
|
-
event:
|
|
28400
|
-
metric:
|
|
28401
|
-
rating:
|
|
28602
|
+
event: z94.literal("ui.vitals"),
|
|
28603
|
+
metric: z94.enum(UI_VITAL_METRICS),
|
|
28604
|
+
rating: z94.enum(UI_VITAL_RATINGS),
|
|
28402
28605
|
tab: uiProjectTabSchema.optional()
|
|
28403
28606
|
}).strict()
|
|
28404
28607
|
]);
|
|
28405
28608
|
|
|
28406
28609
|
// ../contracts/src/feedback.ts
|
|
28407
|
-
import { z as
|
|
28610
|
+
import { z as z95 } from "zod";
|
|
28408
28611
|
|
|
28409
28612
|
// ../contracts/src/log-redaction.ts
|
|
28410
28613
|
var REDACTED = "[REDACTED]";
|
|
@@ -28563,7 +28766,7 @@ function redactEmbeddedUrls(value) {
|
|
|
28563
28766
|
|
|
28564
28767
|
// ../contracts/src/feedback.ts
|
|
28565
28768
|
var FEEDBACK_KINDS = ["struggle", "bug", "improvement", "other"];
|
|
28566
|
-
var feedbackKindSchema =
|
|
28769
|
+
var feedbackKindSchema = z95.enum(FEEDBACK_KINDS);
|
|
28567
28770
|
var FEEDBACK_LIMITS = {
|
|
28568
28771
|
summary: 500,
|
|
28569
28772
|
details: 4e3,
|
|
@@ -28571,17 +28774,17 @@ var FEEDBACK_LIMITS = {
|
|
|
28571
28774
|
command: 120,
|
|
28572
28775
|
errorCode: 40
|
|
28573
28776
|
};
|
|
28574
|
-
var feedbackSubmissionSchema =
|
|
28777
|
+
var feedbackSubmissionSchema = z95.object({
|
|
28575
28778
|
kind: feedbackKindSchema,
|
|
28576
|
-
summary:
|
|
28577
|
-
details:
|
|
28578
|
-
area:
|
|
28579
|
-
command:
|
|
28580
|
-
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()
|
|
28581
28784
|
}).strict();
|
|
28582
|
-
var feedbackAcceptedDtoSchema =
|
|
28583
|
-
accepted:
|
|
28584
|
-
id:
|
|
28785
|
+
var feedbackAcceptedDtoSchema = z95.object({
|
|
28786
|
+
accepted: z95.boolean(),
|
|
28787
|
+
id: z95.string()
|
|
28585
28788
|
});
|
|
28586
28789
|
function redactFeedbackText(value, limit) {
|
|
28587
28790
|
return truncateUtf16(
|
|
@@ -28660,7 +28863,7 @@ function asRecord(value) {
|
|
|
28660
28863
|
}
|
|
28661
28864
|
|
|
28662
28865
|
// ../contracts/src/tolerant-read.ts
|
|
28663
|
-
import { z as
|
|
28866
|
+
import { z as z96 } from "zod";
|
|
28664
28867
|
var WRAPPER_TYPES = /* @__PURE__ */ new Set(["optional", "nullable", "default", "prefault", "readonly", "catch", "nonoptional"]);
|
|
28665
28868
|
var DEPTH_LIMIT = 64;
|
|
28666
28869
|
function defOf(schema) {
|
|
@@ -28671,9 +28874,9 @@ function cloneWith(schema, changes) {
|
|
|
28671
28874
|
}
|
|
28672
28875
|
function openPrimitive(values) {
|
|
28673
28876
|
if (values.length === 0) return void 0;
|
|
28674
|
-
if (values.every((value) => typeof value === "string")) return
|
|
28675
|
-
if (values.every((value) => typeof value === "number")) return
|
|
28676
|
-
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();
|
|
28677
28880
|
return void 0;
|
|
28678
28881
|
}
|
|
28679
28882
|
function walk2(schema, open, memo, depth) {
|
|
@@ -28687,7 +28890,7 @@ function walk2(schema, open, memo, depth) {
|
|
|
28687
28890
|
const shape = Object.fromEntries(Object.entries(schema.shape).map(([key, child]) => [key, next(child)]));
|
|
28688
28891
|
const declared = def.catchall;
|
|
28689
28892
|
const catchall = open.get(schema) ?? (declared && defOf(declared).type !== "never" ? next(declared) : void 0);
|
|
28690
|
-
result = catchall ?
|
|
28893
|
+
result = catchall ? z96.object(shape).catchall(catchall) : z96.object(shape);
|
|
28691
28894
|
} else if (WRAPPER_TYPES.has(def.type)) {
|
|
28692
28895
|
const inner = def.innerType;
|
|
28693
28896
|
const mapped = next(inner);
|
|
@@ -28704,10 +28907,10 @@ function walk2(schema, open, memo, depth) {
|
|
|
28704
28907
|
const options = def.options;
|
|
28705
28908
|
const mapped = options.map(next);
|
|
28706
28909
|
const changed = mapped.some((option, index) => option !== options[index]);
|
|
28707
|
-
result = !changed ? schema : def.discriminator ?
|
|
28910
|
+
result = !changed ? schema : def.discriminator ? z96.union(mapped) : cloneWith(schema, { options: mapped });
|
|
28708
28911
|
} else if (def.type === "record") {
|
|
28709
28912
|
const keyType = def.keyType, valueType = def.valueType;
|
|
28710
|
-
const mappedKey = defOf(keyType).type === "enum" ?
|
|
28913
|
+
const mappedKey = defOf(keyType).type === "enum" ? z96.string() : keyType;
|
|
28711
28914
|
const mappedValue = next(valueType);
|
|
28712
28915
|
result = mappedKey === keyType && mappedValue === valueType ? schema : cloneWith(schema, { keyType: mappedKey, valueType: mappedValue });
|
|
28713
28916
|
} else if (def.type === "intersection") {
|
|
@@ -28723,7 +28926,7 @@ function walk2(schema, open, memo, depth) {
|
|
|
28723
28926
|
result = changed ? cloneWith(schema, { items: mappedItems, rest: mappedRest }) : schema;
|
|
28724
28927
|
} else if (def.type === "lazy") {
|
|
28725
28928
|
const getter = def.getter;
|
|
28726
|
-
result =
|
|
28929
|
+
result = z96.lazy(() => next(getter()));
|
|
28727
28930
|
} else if (def.type === "enum") {
|
|
28728
28931
|
result = openPrimitive(Object.values(def.entries)) ?? schema;
|
|
28729
28932
|
} else if (def.type === "literal") {
|
|
@@ -28738,8 +28941,8 @@ function tolerantReadSchema(schema, options = {}) {
|
|
|
28738
28941
|
}
|
|
28739
28942
|
|
|
28740
28943
|
// ../contracts/src/sentiment-read.ts
|
|
28741
|
-
import { z as
|
|
28742
|
-
var OPEN_COUNTS = { openKeys: [[sentimentCountsSchema,
|
|
28944
|
+
import { z as z97 } from "zod";
|
|
28945
|
+
var OPEN_COUNTS = { openKeys: [[sentimentCountsSchema, z97.number().int().nonnegative()]] };
|
|
28743
28946
|
var sentimentSettingsReadSchema = tolerantReadSchema(sentimentSettingsSchema, OPEN_COUNTS);
|
|
28744
28947
|
var sentimentSummaryReadSchema = tolerantReadSchema(sentimentSummarySchema, OPEN_COUNTS);
|
|
28745
28948
|
var sentimentEvidencePageReadSchema = tolerantReadSchema(sentimentEvidencePageSchema, OPEN_COUNTS);
|
|
@@ -28778,29 +28981,29 @@ function rateOverCheckedAnswers(numerator, answers, excluded) {
|
|
|
28778
28981
|
}
|
|
28779
28982
|
|
|
28780
28983
|
// ../contracts/src/cli-catalog.ts
|
|
28781
|
-
import { z as
|
|
28782
|
-
var cliCatalogOptionSchema =
|
|
28783
|
-
name:
|
|
28784
|
-
type:
|
|
28785
|
-
multiple:
|
|
28786
|
-
});
|
|
28787
|
-
var cliCatalogCommandSchema =
|
|
28788
|
-
id:
|
|
28789
|
-
path:
|
|
28790
|
-
usage:
|
|
28791
|
-
supportsDryRun:
|
|
28792
|
-
windows:
|
|
28793
|
-
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),
|
|
28794
28997
|
access: operationAccessSchema
|
|
28795
28998
|
});
|
|
28796
|
-
var cliCatalogSchema =
|
|
28797
|
-
version:
|
|
28798
|
-
globalOptions:
|
|
28799
|
-
groups:
|
|
28800
|
-
root:
|
|
28801
|
-
section:
|
|
28802
|
-
summary:
|
|
28803
|
-
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)
|
|
28804
29007
|
}))
|
|
28805
29008
|
});
|
|
28806
29009
|
|
|
@@ -29040,41 +29243,41 @@ function compareSeoKeywordGapsBy(sort) {
|
|
|
29040
29243
|
}
|
|
29041
29244
|
|
|
29042
29245
|
// ../contracts/src/sitemaps.ts
|
|
29043
|
-
import { z as
|
|
29044
|
-
var sitemapEngineSchema =
|
|
29246
|
+
import { z as z99 } from "zod";
|
|
29247
|
+
var sitemapEngineSchema = z99.enum(["google", "bing"]);
|
|
29045
29248
|
var SitemapEngines = sitemapEngineSchema.enum;
|
|
29046
|
-
var sitemapSourceSchema =
|
|
29047
|
-
var sitemapStateSchema =
|
|
29249
|
+
var sitemapSourceSchema = z99.enum(["site", "google", "bing"]);
|
|
29250
|
+
var sitemapStateSchema = z99.enum(["ok", "pending", "warnings", "errors", "other"]);
|
|
29048
29251
|
var SitemapStates = sitemapStateSchema.enum;
|
|
29049
|
-
var engineSitemapDtoSchema =
|
|
29050
|
-
url:
|
|
29252
|
+
var engineSitemapDtoSchema = z99.object({
|
|
29253
|
+
url: z99.string(),
|
|
29051
29254
|
/** The index this file was read from; null for a sitemap listed on its own. */
|
|
29052
|
-
parentUrl:
|
|
29053
|
-
isIndex:
|
|
29255
|
+
parentUrl: z99.string().nullable(),
|
|
29256
|
+
isIndex: z99.boolean(),
|
|
29054
29257
|
/** The engine's own type word (Bing: `Sitemap`, `Sitemap Index`, `RSS`; Google: `sitemap`, `rssFeed`). */
|
|
29055
|
-
type:
|
|
29258
|
+
type: z99.string().nullable(),
|
|
29056
29259
|
state: sitemapStateSchema,
|
|
29057
29260
|
/** The engine's status as it reads in its own console (Google: Success, Processing, Warnings, Errors; Bing's word as sent). */
|
|
29058
|
-
statusLabel:
|
|
29059
|
-
warnings:
|
|
29060
|
-
errors:
|
|
29261
|
+
statusLabel: z99.string(),
|
|
29262
|
+
warnings: z99.number().int().nonnegative().nullable(),
|
|
29263
|
+
errors: z99.number().int().nonnegative().nullable(),
|
|
29061
29264
|
/** URLs the engine counted in the sitemap; null when it reported none. */
|
|
29062
|
-
urlCount:
|
|
29265
|
+
urlCount: z99.number().int().nonnegative().nullable(),
|
|
29063
29266
|
/** Null when nobody submitted it: the engine found it itself. */
|
|
29064
|
-
submittedAt:
|
|
29267
|
+
submittedAt: z99.string().nullable(),
|
|
29065
29268
|
/** When the engine last read the file (Google: downloaded; Bing: crawled). */
|
|
29066
|
-
lastReadAt:
|
|
29269
|
+
lastReadAt: z99.string().nullable()
|
|
29067
29270
|
});
|
|
29068
|
-
var sitemapMissingDtoSchema =
|
|
29069
|
-
url:
|
|
29271
|
+
var sitemapMissingDtoSchema = z99.object({
|
|
29272
|
+
url: z99.string(),
|
|
29070
29273
|
/** Where Canonry saw it: the site's own sitemaps, or a submission to the other engine. */
|
|
29071
|
-
foundIn:
|
|
29274
|
+
foundIn: z99.array(sitemapSourceSchema)
|
|
29072
29275
|
});
|
|
29073
|
-
var engineSitemapsDtoSchema =
|
|
29276
|
+
var engineSitemapsDtoSchema = z99.object({
|
|
29074
29277
|
/** When this engine's list was last read in full. */
|
|
29075
|
-
syncedAt:
|
|
29278
|
+
syncedAt: z99.string(),
|
|
29076
29279
|
/** Every sitemap the engine lists, files inside an index included (`parentUrl`). */
|
|
29077
|
-
sitemaps:
|
|
29280
|
+
sitemaps: z99.array(engineSitemapDtoSchema),
|
|
29078
29281
|
/**
|
|
29079
29282
|
* Sitemaps the site declares or someone submitted to the other engine that
|
|
29080
29283
|
* this engine does not have, by URL. A file inside an index that is itself missing is left
|
|
@@ -29083,24 +29286,24 @@ var engineSitemapsDtoSchema = z98.object({
|
|
|
29083
29286
|
* this engine already has every sitemap the site declares. Google lists only
|
|
29084
29287
|
* sitemaps inside the connected property.
|
|
29085
29288
|
*/
|
|
29086
|
-
missing:
|
|
29289
|
+
missing: z99.array(sitemapMissingDtoSchema)
|
|
29087
29290
|
});
|
|
29088
|
-
var sitemapCoverageResponseDtoSchema =
|
|
29089
|
-
site:
|
|
29291
|
+
var sitemapCoverageResponseDtoSchema = z99.object({
|
|
29292
|
+
site: z99.object({
|
|
29090
29293
|
/** When the scan behind `sitemaps` ran; null before the first Agent Readiness audit scan. */
|
|
29091
|
-
scannedAt:
|
|
29092
|
-
runId:
|
|
29294
|
+
scannedAt: z99.string().nullable(),
|
|
29295
|
+
runId: z99.string().nullable(),
|
|
29093
29296
|
/** Sitemap files the scan read pages from. An index appears through its files. */
|
|
29094
|
-
sitemaps:
|
|
29297
|
+
sitemaps: z99.array(z99.string())
|
|
29095
29298
|
}),
|
|
29096
29299
|
/** Null when the engine is not connected or its list was never read. */
|
|
29097
29300
|
google: engineSitemapsDtoSchema.nullable(),
|
|
29098
29301
|
bing: engineSitemapsDtoSchema.nullable()
|
|
29099
29302
|
});
|
|
29100
|
-
var bingSubmitSitemapResponseDtoSchema =
|
|
29101
|
-
sitemapUrl:
|
|
29303
|
+
var bingSubmitSitemapResponseDtoSchema = z99.object({
|
|
29304
|
+
sitemapUrl: z99.string(),
|
|
29102
29305
|
/** Bing accepted the request. It lists a new sitemap after it reads it, so it shows from the next sync. */
|
|
29103
|
-
accepted:
|
|
29306
|
+
accepted: z99.literal(true)
|
|
29104
29307
|
});
|
|
29105
29308
|
|
|
29106
29309
|
export {
|
|
@@ -29992,6 +30195,14 @@ export {
|
|
|
29992
30195
|
resultsExportDtoSchema,
|
|
29993
30196
|
resultsClearRequestSchema,
|
|
29994
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,
|
|
29995
30206
|
AiReferralTrafficClasses,
|
|
29996
30207
|
classifyAiReferralTrafficClass,
|
|
29997
30208
|
aiReferralClassCounts,
|
|
@@ -30278,6 +30489,8 @@ export {
|
|
|
30278
30489
|
TrafficEventKinds,
|
|
30279
30490
|
TRAFFIC_EVENT_KIND_FILTER_HINT,
|
|
30280
30491
|
parseTrafficEventKindFilter,
|
|
30492
|
+
TRAFFIC_EVENT_GROUP_BY_HINT,
|
|
30493
|
+
parseTrafficEventGroupBy,
|
|
30281
30494
|
trafficSeriesGranularitySchema,
|
|
30282
30495
|
TrafficSeriesGranularities,
|
|
30283
30496
|
trafficEventsResponseSchema,
|