@canonry/canonry 7.0.0 → 7.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/agent-workspace/skills/canonry/references/aeo-analysis.md +5 -3
- package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +19 -2
- package/assets/assets/AuditHistoryPanel-Duvyi8vx.js +1 -0
- package/assets/assets/{BacklinksPage-HIM0fmV7.js → BacklinksPage-CY5AllQu.js} +1 -1
- package/assets/assets/{HistoryPage-BjEVp-fk.js → HistoryPage-C0Gr0gcj.js} +1 -1
- package/assets/assets/{MeasurementPropertyPage-BnVDR2y_.js → MeasurementPropertyPage-DrAB6VKX.js} +1 -1
- package/assets/assets/ProjectPage-DSxvvnAd.js +8 -0
- package/assets/assets/{RunsPage-fJQe2qJc.js → RunsPage-DMxOrtfl.js} +1 -1
- package/assets/assets/{SettingsPage-1yam5tl6.js → SettingsPage-sxiUNt2A.js} +1 -1
- package/assets/assets/SiteHealthSection--6tZe3hM.js +4 -0
- package/assets/assets/{TrafficPage-BdNEscz8.js → TrafficPage-CvSQDNTi.js} +2 -2
- package/assets/assets/{TrafficSourceDetailPage-CMEgr4Aw.js → TrafficSourceDetailPage-BaYeIBmc.js} +1 -1
- package/assets/assets/{extract-error-message-D2dhaJaW.js → extract-error-message-76IWhqQF.js} +1 -1
- package/assets/assets/index-BlrH2zRW.js +86 -0
- package/assets/assets/index-HWSQgVum.css +1 -0
- package/assets/assets/{react-sigma_core.esm.min-oP23IWpt.js → react-sigma_core.esm.min-CkAcKW2k.js} +1 -1
- package/assets/assets/{v2-overview-adapter-DYatWs7N.js → v2-overview-adapter-DnEE4E9w.js} +1 -1
- package/assets/index.html +2 -2
- package/dist/{chunk-TUHQ5BBQ.js → chunk-BYSSJEL7.js} +9 -8
- package/dist/{chunk-LXWY4NKP.js → chunk-EQBYK77W.js} +3 -3
- package/dist/{chunk-HQJ25LI7.js → chunk-FDBQOQLP.js} +2 -2
- package/dist/{chunk-EZ54X4XH.js → chunk-RCQJI3UX.js} +125 -86
- package/dist/{chunk-RRIZ5AKI.js → chunk-SVTVBPIT.js} +2 -2
- package/dist/{chunk-OOUDIVIU.js → chunk-TY3CJKKR.js} +458 -184
- package/dist/{chunk-A5PALGQD.js → chunk-UIDHHZH3.js} +94 -190
- package/dist/cli.js +32 -16
- package/dist/{demo-server-LHHDVXQW.js → demo-server-GWRYDPJC.js} +4 -4
- package/dist/index.js +6 -6
- package/dist/{intelligence-service-ZVKZLLKL.js → intelligence-service-3L2665AK.js} +2 -2
- package/dist/mcp.js +4 -4
- package/package.json +12 -12
- package/assets/assets/AuditHistoryPanel-DBYsgVsn.js +0 -1
- package/assets/assets/ProjectPage-BhCM47KA.js +0 -8
- package/assets/assets/SiteHealthSection-DysU2M6C.js +0 -4
- package/assets/assets/index-CgT2Btdn.css +0 -1
- package/assets/assets/index-D9ODLKpH.js +0 -86
|
@@ -6278,8 +6278,15 @@ var snapshotDiffResponseSchema = z12.object({
|
|
|
6278
6278
|
run2: z12.string(),
|
|
6279
6279
|
diff: z12.array(snapshotDiffRowSchema)
|
|
6280
6280
|
});
|
|
6281
|
+
var observedQueryCountsSchema = z12.object({
|
|
6282
|
+
totalQueries: z12.number().int().nonnegative(),
|
|
6283
|
+
citedQueries: z12.number().int().nonnegative(),
|
|
6284
|
+
mentionedQueries: z12.number().int().nonnegative()
|
|
6285
|
+
});
|
|
6281
6286
|
var runDetailDtoSchema = runDtoSchema.extend({
|
|
6282
6287
|
snapshots: z12.array(querySnapshotDtoSchema).optional(),
|
|
6288
|
+
/** Observed queries in this exact run. Null when a snapshot lacks query identity; omitted by older servers. */
|
|
6289
|
+
queryCounts: observedQueryCountsSchema.nullable().optional(),
|
|
6283
6290
|
/** The run's provider batches, oldest first. Empty when nothing was batched. */
|
|
6284
6291
|
providerBatches: z12.array(providerBatchSummaryDtoSchema).optional(),
|
|
6285
6292
|
/** Usage and estimated cost per provider and price tier. Empty when no answer carries usage. */
|
|
@@ -9669,14 +9676,14 @@ function breakdownShares(parts) {
|
|
|
9669
9676
|
const total = parts.reduce((sum, part) => sum + Math.max(0, part), 0);
|
|
9670
9677
|
return parts.map((part) => shareOf(part, total) ?? 0);
|
|
9671
9678
|
}
|
|
9672
|
-
function wilsonInterval(successes, n,
|
|
9679
|
+
function wilsonInterval(successes, n, z71 = 1.96) {
|
|
9673
9680
|
if (!Number.isFinite(n) || n <= 0) return null;
|
|
9674
9681
|
const s = Math.max(0, Math.min(successes, n));
|
|
9675
9682
|
const p = s / n;
|
|
9676
|
-
const z210 =
|
|
9683
|
+
const z210 = z71 * z71;
|
|
9677
9684
|
const denom = 1 + z210 / n;
|
|
9678
9685
|
const center = (p + z210 / (2 * n)) / denom;
|
|
9679
|
-
const margin =
|
|
9686
|
+
const margin = z71 / denom * Math.sqrt(p * (1 - p) / n + z210 / (4 * n * n));
|
|
9680
9687
|
return {
|
|
9681
9688
|
low: round(Math.max(0, center - margin)),
|
|
9682
9689
|
high: round(Math.min(1, center + margin))
|
|
@@ -9976,7 +9983,20 @@ var gscQueryTotalsDtoSchema = z27.object({
|
|
|
9976
9983
|
* window paired with only `endDate` spans that many days ending on it. A
|
|
9977
9984
|
* `null` side is unbounded.
|
|
9978
9985
|
*/
|
|
9979
|
-
window: gscWindowRangeSchema
|
|
9986
|
+
window: gscWindowRangeSchema.extend({
|
|
9987
|
+
/**
|
|
9988
|
+
* The first date with stored per-query rows (either query table), ignoring
|
|
9989
|
+
* the window; `null` with none. The lower edge of what this route can
|
|
9990
|
+
* answer: a window starting before it is only partly covered, because
|
|
9991
|
+
* Search Analytics stores no row for an unfetched day and the sum would
|
|
9992
|
+
* read as low traffic rather than missing data.
|
|
9993
|
+
*
|
|
9994
|
+
* Optional on the wire, like `basis` above: a server older than the field
|
|
9995
|
+
* omits it, which means coverage is unknown, not that no rows are stored.
|
|
9996
|
+
* This route always sends it.
|
|
9997
|
+
*/
|
|
9998
|
+
earliestDataDate: z27.string().nullable().optional()
|
|
9999
|
+
})
|
|
9980
10000
|
});
|
|
9981
10001
|
var gscUrlInspectionDtoSchema = z27.object({
|
|
9982
10002
|
id: z27.string(),
|
|
@@ -11283,12 +11303,6 @@ function isRetryableHttpError(err) {
|
|
|
11283
11303
|
return status >= 500 || status === 429;
|
|
11284
11304
|
}
|
|
11285
11305
|
}
|
|
11286
|
-
if (err instanceof Error) {
|
|
11287
|
-
const msg = err.message.toLowerCase();
|
|
11288
|
-
if (msg.includes("fetch failed") || msg.includes("econnreset") || msg.includes("etimedout") || msg.includes("enotfound") || msg.includes("econnrefused") || msg.includes("network error")) {
|
|
11289
|
-
return true;
|
|
11290
|
-
}
|
|
11291
|
-
}
|
|
11292
11306
|
return true;
|
|
11293
11307
|
}
|
|
11294
11308
|
|
|
@@ -15642,7 +15656,11 @@ var sentimentSummaryRequestSchema = sentimentSelectionBaseSchema.extend({
|
|
|
15642
15656
|
queryLimit: z51.coerce.number().int().min(1).max(SENTIMENT_QUERY_PAGE_MAX).default(SENTIMENT_QUERY_PAGE_DEFAULT),
|
|
15643
15657
|
queryCursor: z51.string().min(1).max(16384).optional()
|
|
15644
15658
|
}).superRefine(exclusiveSentimentRuns);
|
|
15645
|
-
var
|
|
15659
|
+
var sentimentEvidenceOutcomeFilterSchema = z51.preprocess((value) => {
|
|
15660
|
+
const items = typeof value === "string" ? [value] : Array.isArray(value) ? value : null;
|
|
15661
|
+
return items ? [...new Set(items.flatMap((item) => typeof item === "string" ? item.split(",").map((part) => part.trim()).filter(Boolean) : [item]))] : value;
|
|
15662
|
+
}, z51.array(sentimentOutcomeSchema).min(1).max(sentimentOutcomeSchema.options.length));
|
|
15663
|
+
var sentimentEvidenceRequestSchema = sentimentSelectionBaseSchema.extend({ assessmentId: id.optional(), outcome: sentimentEvidenceOutcomeFilterSchema.optional(), cursor: z51.string().min(1).max(16384).optional(), limit: z51.coerce.number().int().min(1).max(100).default(50) }).superRefine(exclusiveSentimentRuns);
|
|
15646
15664
|
var sentimentCompareRequestSchema = sentimentSelectionBaseSchema.extend({ fromRunId: id, toRunId: id }).superRefine((value, ctx) => {
|
|
15647
15665
|
exclusiveSentimentRuns(value, ctx);
|
|
15648
15666
|
if (value.runIds) ctx.addIssue({ code: "custom", path: ["runIds"], message: "Comparison requires one explicit run per period." });
|
|
@@ -15692,9 +15710,25 @@ var sentimentSummarySchema = z51.object({
|
|
|
15692
15710
|
evaluationDefinition: sentimentEvaluationDefinitionSchema.nullable(),
|
|
15693
15711
|
breakdowns: z51.array(sentimentBreakdownSchema),
|
|
15694
15712
|
queries: z51.array(sentimentQuerySummarySchema),
|
|
15713
|
+
/**
|
|
15714
|
+
* Branded reads: the Properties with a mixed or unfavorable rating, most criticized first
|
|
15715
|
+
* ({@link rankCriticizedProperties}). `keys` are the first {@link SENTIMENT_CRITICIZED_PROPERTY_LIMIT}
|
|
15716
|
+
* property breakdown keys; `total` counts them all; `{ total: 0, keys: [] }` with fewer than two
|
|
15717
|
+
* Properties in view. Absent from older servers, comparison periods, and non-brand, disabled or unavailable reads.
|
|
15718
|
+
*/
|
|
15719
|
+
criticizedProperties: z51.object({ total: count, keys: z51.array(z51.string()) }).strict().optional(),
|
|
15695
15720
|
/** Present on the paged summary read; follow `nextCursor` as `queryCursor` for the next query rows. */
|
|
15696
15721
|
queryPage: z51.object({ total: count, limit: count, nextCursor: z51.string().nullable() }).strict().optional()
|
|
15697
15722
|
}).strict();
|
|
15723
|
+
var SENTIMENT_CRITICIZED_PROPERTY_LIMIT = 5;
|
|
15724
|
+
function rankCriticizedProperties(rows) {
|
|
15725
|
+
const properties = rows.filter((row) => row.dimension === "property");
|
|
15726
|
+
if (properties.length < 2) return { total: 0, keys: [] };
|
|
15727
|
+
const criticized = properties.filter((row) => row.coverage.counts.mixed + row.coverage.counts.unfavorable > 0);
|
|
15728
|
+
const criticism = (row) => row.coverage.counts.mixed + row.coverage.counts.unfavorable;
|
|
15729
|
+
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));
|
|
15730
|
+
return { total: criticized.length, keys: criticized.slice(0, SENTIMENT_CRITICIZED_PROPERTY_LIMIT).map((row) => row.key) };
|
|
15731
|
+
}
|
|
15698
15732
|
var sentimentSettingsUpdateSchema = z51.object({ enabled: z51.boolean().optional() }).strict();
|
|
15699
15733
|
var sentimentSettingsSchema = z51.object({
|
|
15700
15734
|
installEnabled: z51.boolean(),
|
|
@@ -15766,7 +15800,7 @@ var sentimentEvidenceItemSchema = z51.object({
|
|
|
15766
15800
|
returnedModel: z51.string().nullable(),
|
|
15767
15801
|
reason: z51.string().nullable()
|
|
15768
15802
|
}).strict();
|
|
15769
|
-
var sentimentEvidencePageSchema = z51.object({ state: sentimentStateSchema, selection: sentimentResolvedSelectionSchema.extend({ assessmentId: id.optional() }), items: z51.array(sentimentEvidenceItemSchema), nextCursor: z51.string().nullable() }).strict();
|
|
15803
|
+
var sentimentEvidencePageSchema = z51.object({ state: sentimentStateSchema, selection: sentimentResolvedSelectionSchema.extend({ assessmentId: id.optional(), outcome: z51.array(sentimentOutcomeSchema).optional() }), items: z51.array(sentimentEvidenceItemSchema), nextCursor: z51.string().nullable() }).strict();
|
|
15770
15804
|
var sentimentComparisonSchema = z51.object({
|
|
15771
15805
|
from: sentimentSummarySchema,
|
|
15772
15806
|
to: sentimentSummarySchema,
|
|
@@ -16501,6 +16535,19 @@ function normalizeQueryText(value) {
|
|
|
16501
16535
|
return value.trim().toLowerCase();
|
|
16502
16536
|
}
|
|
16503
16537
|
|
|
16538
|
+
// ../contracts/src/query-counts.ts
|
|
16539
|
+
function summarizeObservedQueryCounts(snapshots) {
|
|
16540
|
+
const queries = /* @__PURE__ */ new Set();
|
|
16541
|
+
const cited = /* @__PURE__ */ new Set();
|
|
16542
|
+
const mentioned = /* @__PURE__ */ new Set();
|
|
16543
|
+
for (const snapshot of snapshots) {
|
|
16544
|
+
queries.add(snapshot.queryId);
|
|
16545
|
+
if (snapshot.citationState === CitationStates.cited) cited.add(snapshot.queryId);
|
|
16546
|
+
if (snapshot.answerMentioned === true) mentioned.add(snapshot.queryId);
|
|
16547
|
+
}
|
|
16548
|
+
return { totalQueries: queries.size, citedQueries: cited.size, mentionedQueries: mentioned.size };
|
|
16549
|
+
}
|
|
16550
|
+
|
|
16504
16551
|
// ../contracts/src/citations.ts
|
|
16505
16552
|
import { z as z55 } from "zod";
|
|
16506
16553
|
var citationCoverageProviderSchema = z55.object({
|
|
@@ -19015,8 +19062,231 @@ function detectAgentRuntime(env) {
|
|
|
19015
19062
|
return AGENT_NONE;
|
|
19016
19063
|
}
|
|
19017
19064
|
|
|
19018
|
-
// ../contracts/src/
|
|
19065
|
+
// ../contracts/src/ui-telemetry.ts
|
|
19019
19066
|
import { z as z64 } from "zod";
|
|
19067
|
+
var UI_PAGES = [
|
|
19068
|
+
"/",
|
|
19069
|
+
"/projects",
|
|
19070
|
+
"/projects/:projectName",
|
|
19071
|
+
"/projects/:projectName/portfolio",
|
|
19072
|
+
"/projects/:projectName/search-console",
|
|
19073
|
+
"/projects/:projectName/conversions",
|
|
19074
|
+
"/projects/:projectName/local",
|
|
19075
|
+
"/projects/:projectName/discovery",
|
|
19076
|
+
"/projects/:projectName/queries",
|
|
19077
|
+
"/projects/:projectName/properties/:targetKey",
|
|
19078
|
+
"/projects/:projectName/report",
|
|
19079
|
+
"/projects/:projectName/activity",
|
|
19080
|
+
"/projects/:projectName/backlinks",
|
|
19081
|
+
"/projects/:projectName/technical-aeo",
|
|
19082
|
+
"/projects/:projectName/history",
|
|
19083
|
+
"/projects/:projectName/settings",
|
|
19084
|
+
"/runs",
|
|
19085
|
+
"/history",
|
|
19086
|
+
"/settings",
|
|
19087
|
+
"/setup",
|
|
19088
|
+
"/backlinks",
|
|
19089
|
+
"/traffic",
|
|
19090
|
+
"/traffic/:projectName/:sourceId",
|
|
19091
|
+
"not-found",
|
|
19092
|
+
"other"
|
|
19093
|
+
];
|
|
19094
|
+
var uiPageSchema = z64.enum(UI_PAGES);
|
|
19095
|
+
var UI_PROJECT_TABS = [
|
|
19096
|
+
"overview",
|
|
19097
|
+
"portfolio",
|
|
19098
|
+
"search-console",
|
|
19099
|
+
"conversions",
|
|
19100
|
+
"local",
|
|
19101
|
+
"discovery",
|
|
19102
|
+
"queries",
|
|
19103
|
+
"properties",
|
|
19104
|
+
"report",
|
|
19105
|
+
"activity",
|
|
19106
|
+
"backlinks",
|
|
19107
|
+
"technical-aeo",
|
|
19108
|
+
"history",
|
|
19109
|
+
"settings",
|
|
19110
|
+
"other"
|
|
19111
|
+
];
|
|
19112
|
+
var uiProjectTabSchema = z64.enum(UI_PROJECT_TABS);
|
|
19113
|
+
var UI_ACTIONS = [
|
|
19114
|
+
"sweep.launch",
|
|
19115
|
+
"sweep.cancel",
|
|
19116
|
+
"site_audit.launch",
|
|
19117
|
+
"project.create",
|
|
19118
|
+
"project.update",
|
|
19119
|
+
"project.delete",
|
|
19120
|
+
"query.add",
|
|
19121
|
+
"query.delete",
|
|
19122
|
+
"query.generate",
|
|
19123
|
+
"competitor.save",
|
|
19124
|
+
"competitor.delete",
|
|
19125
|
+
"schedule.save",
|
|
19126
|
+
"schedule.delete",
|
|
19127
|
+
"provider.save",
|
|
19128
|
+
"settings.save",
|
|
19129
|
+
/** An OAuth flow was started; the connection is not confirmed yet. */
|
|
19130
|
+
"integration.connect_started",
|
|
19131
|
+
/** A connection was confirmed (credentials accepted, or a property/account chosen). */
|
|
19132
|
+
"integration.connect",
|
|
19133
|
+
"integration.disconnect",
|
|
19134
|
+
"traffic.sync",
|
|
19135
|
+
"notification.save",
|
|
19136
|
+
"notification.test",
|
|
19137
|
+
"measurement_plan.publish",
|
|
19138
|
+
"discovery.run",
|
|
19139
|
+
"api_key.create",
|
|
19140
|
+
"api_key.revoke",
|
|
19141
|
+
"export.download",
|
|
19142
|
+
"report.download",
|
|
19143
|
+
"aero.open",
|
|
19144
|
+
"aero.send",
|
|
19145
|
+
/** A shared filter settled on a new value (debounced; the value is never sent). */
|
|
19146
|
+
"filter.change",
|
|
19147
|
+
/** A table search settled on a non-empty query (debounced or Enter; the text is never sent). */
|
|
19148
|
+
"search.submit"
|
|
19149
|
+
];
|
|
19150
|
+
var uiActionSchema = z64.enum(UI_ACTIONS);
|
|
19151
|
+
var UI_INTEGRATIONS = [
|
|
19152
|
+
"google",
|
|
19153
|
+
"gsc",
|
|
19154
|
+
"ga",
|
|
19155
|
+
"bing",
|
|
19156
|
+
"gbp",
|
|
19157
|
+
"wordpress",
|
|
19158
|
+
"openai_ads",
|
|
19159
|
+
"google_ads",
|
|
19160
|
+
"gtm",
|
|
19161
|
+
"traffic_cloudflare",
|
|
19162
|
+
"traffic_vercel",
|
|
19163
|
+
"traffic_cloud_run",
|
|
19164
|
+
"traffic_wordpress"
|
|
19165
|
+
];
|
|
19166
|
+
var uiIntegrationSchema = z64.enum(UI_INTEGRATIONS);
|
|
19167
|
+
var UI_FILTERS = ["provider", "model", "location", "window", "query_class", "other"];
|
|
19168
|
+
var uiFilterSchema = z64.enum(UI_FILTERS);
|
|
19169
|
+
var UI_EXPORT_FORMATS = ["csv", "json", "html"];
|
|
19170
|
+
var UI_ERROR_KINDS = ["render", "unhandled", "api"];
|
|
19171
|
+
var UI_STATUS_CLASSES = ["4xx", "5xx", "network"];
|
|
19172
|
+
var UI_VITAL_METRICS = ["LCP", "INP", "CLS", "FCP", "TTFB"];
|
|
19173
|
+
var UI_VITAL_RATINGS = ["good", "needs-improvement", "poor"];
|
|
19174
|
+
var UI_COMPONENT_PATTERN = /^[a-z][a-z0-9-]{0,39}$/;
|
|
19175
|
+
var UI_ERROR_NAME_PATTERN = /^[a-z_$][\w$]{0,39}$/i;
|
|
19176
|
+
var UI_API_ROUTE_PATTERN = /^\/api\/v1(?:\/(?:[a-z][a-z0-9-]*(?:\.[a-z]+)?|\{[A-Za-z]+\}))*$/;
|
|
19177
|
+
var UI_API_ROUTE_MAX_LENGTH = 160;
|
|
19178
|
+
var UI_ROUTE_ID_COLLECTIONS = /* @__PURE__ */ new Set([
|
|
19179
|
+
"accounts",
|
|
19180
|
+
"activation-grants",
|
|
19181
|
+
"ad-groups",
|
|
19182
|
+
"ads",
|
|
19183
|
+
"cache",
|
|
19184
|
+
"campaigns",
|
|
19185
|
+
"competitors",
|
|
19186
|
+
"confirm",
|
|
19187
|
+
"connections",
|
|
19188
|
+
"containers",
|
|
19189
|
+
"contracts",
|
|
19190
|
+
"conversations",
|
|
19191
|
+
"dismissals",
|
|
19192
|
+
"insights",
|
|
19193
|
+
"jobs",
|
|
19194
|
+
"keys",
|
|
19195
|
+
"locations",
|
|
19196
|
+
"measurement-query-sets",
|
|
19197
|
+
"measurement-query-templates",
|
|
19198
|
+
"notifications",
|
|
19199
|
+
"operations",
|
|
19200
|
+
"projects",
|
|
19201
|
+
"providers",
|
|
19202
|
+
"queries",
|
|
19203
|
+
"recommendations",
|
|
19204
|
+
"runs",
|
|
19205
|
+
"screenshots",
|
|
19206
|
+
"segments",
|
|
19207
|
+
"sessions",
|
|
19208
|
+
"snapshots",
|
|
19209
|
+
"sources",
|
|
19210
|
+
"users",
|
|
19211
|
+
"versions"
|
|
19212
|
+
]);
|
|
19213
|
+
var UI_ROUTE_FIXED_CHILDREN = /* @__PURE__ */ new Set([
|
|
19214
|
+
"ads/account",
|
|
19215
|
+
"ads/activation-grants",
|
|
19216
|
+
"ads/ad-groups",
|
|
19217
|
+
"ads/ads",
|
|
19218
|
+
"ads/campaigns",
|
|
19219
|
+
"ads/connect",
|
|
19220
|
+
"ads/connection",
|
|
19221
|
+
"ads/conversions",
|
|
19222
|
+
"ads/delivery-diagnostics",
|
|
19223
|
+
"ads/files",
|
|
19224
|
+
"ads/geo",
|
|
19225
|
+
"ads/insights",
|
|
19226
|
+
"ads/live-delivery",
|
|
19227
|
+
"ads/operations",
|
|
19228
|
+
"ads/status",
|
|
19229
|
+
"ads/summary",
|
|
19230
|
+
"ads/sync",
|
|
19231
|
+
"keys/self",
|
|
19232
|
+
"locations/default",
|
|
19233
|
+
"locations/discover",
|
|
19234
|
+
"notifications/events",
|
|
19235
|
+
"operations/logs",
|
|
19236
|
+
"queries/generate",
|
|
19237
|
+
"queries/replace-preview",
|
|
19238
|
+
"runs/latest",
|
|
19239
|
+
"snapshots/diff"
|
|
19240
|
+
]);
|
|
19241
|
+
var PARAM_SEGMENT = /^\{[a-z]+\}$/i;
|
|
19242
|
+
function isUiApiRouteTemplate(route) {
|
|
19243
|
+
if (route.length > UI_API_ROUTE_MAX_LENGTH || route.includes("://")) return false;
|
|
19244
|
+
if (!UI_API_ROUTE_PATTERN.test(route)) return false;
|
|
19245
|
+
const segments = route.split("/").slice(3);
|
|
19246
|
+
return segments.every((segment, index) => {
|
|
19247
|
+
const previous = segments[index - 1];
|
|
19248
|
+
if (previous === void 0 || !UI_ROUTE_ID_COLLECTIONS.has(previous)) return true;
|
|
19249
|
+
return PARAM_SEGMENT.test(segment) || UI_ROUTE_FIXED_CHILDREN.has(`${previous}/${segment}`);
|
|
19250
|
+
});
|
|
19251
|
+
}
|
|
19252
|
+
var uiEventBaseSchema = z64.object({
|
|
19253
|
+
eventId: z64.string().uuid(),
|
|
19254
|
+
uiSessionId: z64.string().uuid(),
|
|
19255
|
+
page: uiPageSchema
|
|
19256
|
+
});
|
|
19257
|
+
var uiTelemetryEventSchema = z64.discriminatedUnion("event", [
|
|
19258
|
+
uiEventBaseSchema.extend({
|
|
19259
|
+
event: z64.literal("ui.page_viewed"),
|
|
19260
|
+
tab: uiProjectTabSchema.optional()
|
|
19261
|
+
}).strict(),
|
|
19262
|
+
uiEventBaseSchema.extend({
|
|
19263
|
+
event: z64.literal("ui.action"),
|
|
19264
|
+
action: uiActionSchema,
|
|
19265
|
+
tab: uiProjectTabSchema.optional(),
|
|
19266
|
+
integration: uiIntegrationSchema.optional(),
|
|
19267
|
+
format: z64.enum(UI_EXPORT_FORMATS).optional(),
|
|
19268
|
+
filter: uiFilterSchema.optional()
|
|
19269
|
+
}).strict(),
|
|
19270
|
+
uiEventBaseSchema.extend({
|
|
19271
|
+
event: z64.literal("ui.error"),
|
|
19272
|
+
kind: z64.enum(UI_ERROR_KINDS),
|
|
19273
|
+
tab: uiProjectTabSchema.optional(),
|
|
19274
|
+
component: z64.string().regex(UI_COMPONENT_PATTERN).optional(),
|
|
19275
|
+
errorName: z64.string().regex(UI_ERROR_NAME_PATTERN).optional(),
|
|
19276
|
+
route: z64.string().max(UI_API_ROUTE_MAX_LENGTH).refine(isUiApiRouteTemplate, "route must be a route template").optional(),
|
|
19277
|
+
method: z64.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]).optional(),
|
|
19278
|
+
statusClass: z64.enum(UI_STATUS_CLASSES).optional(),
|
|
19279
|
+
status: z64.number().int().min(400).max(599).optional()
|
|
19280
|
+
}).strict(),
|
|
19281
|
+
uiEventBaseSchema.extend({
|
|
19282
|
+
event: z64.literal("ui.vitals"),
|
|
19283
|
+
metric: z64.enum(UI_VITAL_METRICS),
|
|
19284
|
+
rating: z64.enum(UI_VITAL_RATINGS)
|
|
19285
|
+
}).strict()
|
|
19286
|
+
]);
|
|
19287
|
+
|
|
19288
|
+
// ../contracts/src/feedback.ts
|
|
19289
|
+
import { z as z65 } from "zod";
|
|
19020
19290
|
|
|
19021
19291
|
// ../contracts/src/log-redaction.ts
|
|
19022
19292
|
var REDACTED = "[REDACTED]";
|
|
@@ -19168,7 +19438,7 @@ function redactEmbeddedUrls(value) {
|
|
|
19168
19438
|
|
|
19169
19439
|
// ../contracts/src/feedback.ts
|
|
19170
19440
|
var FEEDBACK_KINDS = ["struggle", "bug", "improvement", "other"];
|
|
19171
|
-
var feedbackKindSchema =
|
|
19441
|
+
var feedbackKindSchema = z65.enum(FEEDBACK_KINDS);
|
|
19172
19442
|
var FEEDBACK_LIMITS = {
|
|
19173
19443
|
summary: 500,
|
|
19174
19444
|
details: 4e3,
|
|
@@ -19176,17 +19446,17 @@ var FEEDBACK_LIMITS = {
|
|
|
19176
19446
|
command: 120,
|
|
19177
19447
|
errorCode: 40
|
|
19178
19448
|
};
|
|
19179
|
-
var feedbackSubmissionSchema =
|
|
19449
|
+
var feedbackSubmissionSchema = z65.object({
|
|
19180
19450
|
kind: feedbackKindSchema,
|
|
19181
|
-
summary:
|
|
19182
|
-
details:
|
|
19183
|
-
area:
|
|
19184
|
-
command:
|
|
19185
|
-
errorCode:
|
|
19451
|
+
summary: z65.string().trim().min(1).max(FEEDBACK_LIMITS.summary),
|
|
19452
|
+
details: z65.string().trim().min(1).max(FEEDBACK_LIMITS.details).optional(),
|
|
19453
|
+
area: z65.string().trim().min(1).max(FEEDBACK_LIMITS.area).optional(),
|
|
19454
|
+
command: z65.string().trim().min(1).max(FEEDBACK_LIMITS.command).optional(),
|
|
19455
|
+
errorCode: z65.string().trim().min(1).max(FEEDBACK_LIMITS.errorCode).optional()
|
|
19186
19456
|
}).strict();
|
|
19187
|
-
var feedbackAcceptedDtoSchema =
|
|
19188
|
-
accepted:
|
|
19189
|
-
id:
|
|
19457
|
+
var feedbackAcceptedDtoSchema = z65.object({
|
|
19458
|
+
accepted: z65.boolean(),
|
|
19459
|
+
id: z65.string()
|
|
19190
19460
|
});
|
|
19191
19461
|
function redactFeedbackText(value, limit) {
|
|
19192
19462
|
return truncateUtf16(
|
|
@@ -19203,90 +19473,90 @@ var SECRET_FLAG_VALUE = /(?<=^|[ \t])(--?(?:[a-z\d]+-)*(?:key|token|secret|passw
|
|
|
19203
19473
|
var BARE_CREDENTIAL = /\b(?:sk-[\w-]{16,}|AIza[\w-]{30,}|pplx-[A-Za-z0-9]{16,}|gh[pousr]_[A-Za-z0-9]{20,}|github_pat_\w{20,}|cnry_[\w-]{16,})/g;
|
|
19204
19474
|
|
|
19205
19475
|
// ../contracts/src/operational-logs.ts
|
|
19206
|
-
import { z as
|
|
19207
|
-
var operationalLogLevelSchema =
|
|
19208
|
-
var diagnosticContextSchema =
|
|
19209
|
-
runId:
|
|
19210
|
-
projectId:
|
|
19211
|
-
requestId:
|
|
19212
|
-
actor:
|
|
19213
|
-
credentialId:
|
|
19214
|
-
userAgent:
|
|
19215
|
-
actorSession:
|
|
19216
|
-
method:
|
|
19217
|
-
route:
|
|
19218
|
-
operationId:
|
|
19219
|
-
jobId:
|
|
19220
|
-
taskId:
|
|
19221
|
-
traceId:
|
|
19222
|
-
provider:
|
|
19223
|
-
errorCode:
|
|
19224
|
-
attempt:
|
|
19225
|
-
count:
|
|
19226
|
-
total:
|
|
19227
|
-
progress:
|
|
19228
|
-
httpStatus:
|
|
19229
|
-
statusCode:
|
|
19230
|
-
durationMs:
|
|
19231
|
-
bytes:
|
|
19232
|
-
retryAfterMs:
|
|
19233
|
-
retriable:
|
|
19234
|
-
retrying:
|
|
19235
|
-
cancelled:
|
|
19236
|
-
success:
|
|
19237
|
-
}).strict();
|
|
19238
|
-
var operationalLogEntryDtoSchema =
|
|
19239
|
-
cursor:
|
|
19240
|
-
ts:
|
|
19476
|
+
import { z as z66 } from "zod";
|
|
19477
|
+
var operationalLogLevelSchema = z66.enum(["trace", "debug", "info", "warn", "error", "fatal"]);
|
|
19478
|
+
var diagnosticContextSchema = z66.object({
|
|
19479
|
+
runId: z66.string().min(1).max(256).optional(),
|
|
19480
|
+
projectId: z66.string().min(1).max(256).optional(),
|
|
19481
|
+
requestId: z66.string().min(1).max(256).optional(),
|
|
19482
|
+
actor: z66.string().min(1).max(512).optional(),
|
|
19483
|
+
credentialId: z66.string().min(1).max(512).optional(),
|
|
19484
|
+
userAgent: z66.string().min(1).max(512).optional(),
|
|
19485
|
+
actorSession: z66.string().min(1).max(512).optional(),
|
|
19486
|
+
method: z66.string().min(1).max(16).optional(),
|
|
19487
|
+
route: z66.string().min(1).max(256).optional(),
|
|
19488
|
+
operationId: z66.string().min(1).max(256).optional(),
|
|
19489
|
+
jobId: z66.string().min(1).max(256).optional(),
|
|
19490
|
+
taskId: z66.string().min(1).max(256).optional(),
|
|
19491
|
+
traceId: z66.string().min(1).max(256).optional(),
|
|
19492
|
+
provider: z66.string().min(1).max(256).optional(),
|
|
19493
|
+
errorCode: z66.string().min(1).max(128).optional(),
|
|
19494
|
+
attempt: z66.number().finite().optional(),
|
|
19495
|
+
count: z66.number().finite().optional(),
|
|
19496
|
+
total: z66.number().finite().optional(),
|
|
19497
|
+
progress: z66.number().finite().optional(),
|
|
19498
|
+
httpStatus: z66.number().finite().optional(),
|
|
19499
|
+
statusCode: z66.number().finite().optional(),
|
|
19500
|
+
durationMs: z66.number().finite().optional(),
|
|
19501
|
+
bytes: z66.number().finite().optional(),
|
|
19502
|
+
retryAfterMs: z66.number().finite().optional(),
|
|
19503
|
+
retriable: z66.boolean().optional(),
|
|
19504
|
+
retrying: z66.boolean().optional(),
|
|
19505
|
+
cancelled: z66.boolean().optional(),
|
|
19506
|
+
success: z66.boolean().optional()
|
|
19507
|
+
}).strict();
|
|
19508
|
+
var operationalLogEntryDtoSchema = z66.object({
|
|
19509
|
+
cursor: z66.string().min(1).max(512),
|
|
19510
|
+
ts: z66.string().datetime(),
|
|
19241
19511
|
level: operationalLogLevelSchema,
|
|
19242
|
-
module:
|
|
19243
|
-
action:
|
|
19244
|
-
message:
|
|
19245
|
-
runId:
|
|
19246
|
-
projectId:
|
|
19512
|
+
module: z66.string().min(1).max(256),
|
|
19513
|
+
action: z66.string().min(1).max(256),
|
|
19514
|
+
message: z66.string().max(4096).optional(),
|
|
19515
|
+
runId: z66.string().min(1).max(256).optional(),
|
|
19516
|
+
projectId: z66.string().min(1).max(256).optional(),
|
|
19247
19517
|
context: diagnosticContextSchema
|
|
19248
19518
|
}).strict();
|
|
19249
|
-
var logQuerySchema =
|
|
19519
|
+
var logQuerySchema = z66.object({
|
|
19250
19520
|
level: operationalLogLevelSchema.optional(),
|
|
19251
|
-
module:
|
|
19252
|
-
runId:
|
|
19253
|
-
projectId:
|
|
19254
|
-
actor:
|
|
19255
|
-
requestId:
|
|
19256
|
-
since:
|
|
19257
|
-
until:
|
|
19258
|
-
limit:
|
|
19259
|
-
cursor:
|
|
19521
|
+
module: z66.string().trim().min(1).max(256).optional(),
|
|
19522
|
+
runId: z66.string().trim().min(1).max(256).optional(),
|
|
19523
|
+
projectId: z66.string().trim().min(1).max(256).optional(),
|
|
19524
|
+
actor: z66.string().trim().min(1).max(512).optional(),
|
|
19525
|
+
requestId: z66.string().trim().min(1).max(256).optional(),
|
|
19526
|
+
since: z66.string().datetime().optional(),
|
|
19527
|
+
until: z66.string().datetime().optional(),
|
|
19528
|
+
limit: z66.coerce.number().int().min(1).max(200).default(100),
|
|
19529
|
+
cursor: z66.string().trim().min(1).max(512).optional()
|
|
19260
19530
|
}).strict().superRefine((query, ctx) => {
|
|
19261
19531
|
if (query.since && query.until && Date.parse(query.since) > Date.parse(query.until)) {
|
|
19262
|
-
ctx.addIssue({ code:
|
|
19532
|
+
ctx.addIssue({ code: z66.ZodIssueCode.custom, path: ["until"], message: '"until" must be on or after "since".' });
|
|
19263
19533
|
}
|
|
19264
19534
|
});
|
|
19265
|
-
var retentionPolicySchema =
|
|
19266
|
-
maxEntries:
|
|
19267
|
-
maxAgeSeconds:
|
|
19535
|
+
var retentionPolicySchema = z66.object({
|
|
19536
|
+
maxEntries: z66.number().int().positive(),
|
|
19537
|
+
maxAgeSeconds: z66.number().int().positive()
|
|
19268
19538
|
}).strict();
|
|
19269
|
-
var operationalLogListDtoSchema =
|
|
19270
|
-
entries:
|
|
19271
|
-
nextCursor:
|
|
19539
|
+
var operationalLogListDtoSchema = z66.object({
|
|
19540
|
+
entries: z66.array(operationalLogEntryDtoSchema),
|
|
19541
|
+
nextCursor: z66.string().min(1).max(512).nullable(),
|
|
19272
19542
|
/** Matching entries left after this page. */
|
|
19273
|
-
truncated:
|
|
19543
|
+
truncated: z66.number().int().nonnegative(),
|
|
19274
19544
|
/** Entries evicted by the active retention policy. */
|
|
19275
|
-
dropped:
|
|
19276
|
-
retention:
|
|
19545
|
+
dropped: z66.number().int().nonnegative(),
|
|
19546
|
+
retention: z66.enum(["process", "durable"]),
|
|
19277
19547
|
retentionPolicy: retentionPolicySchema.optional(),
|
|
19278
19548
|
/** Best-effort persistence failures observed by this store. */
|
|
19279
|
-
captureErrors:
|
|
19280
|
-
observedAt:
|
|
19549
|
+
captureErrors: z66.number().int().nonnegative().optional(),
|
|
19550
|
+
observedAt: z66.string().datetime()
|
|
19281
19551
|
}).strict();
|
|
19282
19552
|
var OPERATIONAL_LOG_FIELDS_HEADER = "x-canonry-log-fields";
|
|
19283
19553
|
var OPERATIONAL_LOG_OPT_IN_CONTEXT_FIELDS = ["provider"];
|
|
19284
|
-
var diagnosticContextReadSchema =
|
|
19285
|
-
var operationalLogEntryReadSchema =
|
|
19286
|
-
var operationalLogListReadSchema =
|
|
19554
|
+
var diagnosticContextReadSchema = z66.object(diagnosticContextSchema.shape);
|
|
19555
|
+
var operationalLogEntryReadSchema = z66.object({ ...operationalLogEntryDtoSchema.shape, context: diagnosticContextReadSchema });
|
|
19556
|
+
var operationalLogListReadSchema = z66.object({
|
|
19287
19557
|
...operationalLogListDtoSchema.shape,
|
|
19288
|
-
entries:
|
|
19289
|
-
retentionPolicy:
|
|
19558
|
+
entries: z66.array(operationalLogEntryReadSchema),
|
|
19559
|
+
retentionPolicy: z66.object(retentionPolicySchema.shape).optional()
|
|
19290
19560
|
});
|
|
19291
19561
|
|
|
19292
19562
|
// ../contracts/src/semver.ts
|
|
@@ -19352,38 +19622,38 @@ function asRecord(value) {
|
|
|
19352
19622
|
}
|
|
19353
19623
|
|
|
19354
19624
|
// ../contracts/src/referral-assessment.ts
|
|
19355
|
-
import { z as
|
|
19356
|
-
var referralAssessmentQuerySchema =
|
|
19625
|
+
import { z as z67 } from "zod";
|
|
19626
|
+
var referralAssessmentQuerySchema = z67.object({
|
|
19357
19627
|
startDate: calendarDateSchema,
|
|
19358
19628
|
endDate: calendarDateSchema,
|
|
19359
|
-
sourceId:
|
|
19360
|
-
burstThreshold:
|
|
19361
|
-
ratioThreshold:
|
|
19362
|
-
limit:
|
|
19363
|
-
}).strict();
|
|
19364
|
-
var countsSchema =
|
|
19365
|
-
total:
|
|
19366
|
-
paid:
|
|
19367
|
-
organic:
|
|
19368
|
-
unknown:
|
|
19369
|
-
});
|
|
19370
|
-
var referralAssessmentSchema =
|
|
19371
|
-
scope:
|
|
19372
|
-
project:
|
|
19373
|
-
sourceId:
|
|
19374
|
-
attribution:
|
|
19375
|
-
unavailableDimensions:
|
|
19629
|
+
sourceId: z67.string().trim().min(1).optional(),
|
|
19630
|
+
burstThreshold: z67.number().int().min(1).max(1e6).optional(),
|
|
19631
|
+
ratioThreshold: z67.number().min(1).max(1e3).optional(),
|
|
19632
|
+
limit: z67.number().int().min(1).max(500).optional()
|
|
19633
|
+
}).strict();
|
|
19634
|
+
var countsSchema = z67.object({
|
|
19635
|
+
total: z67.number().int().nonnegative(),
|
|
19636
|
+
paid: z67.number().int().nonnegative(),
|
|
19637
|
+
organic: z67.number().int().nonnegative(),
|
|
19638
|
+
unknown: z67.number().int().nonnegative()
|
|
19639
|
+
});
|
|
19640
|
+
var referralAssessmentSchema = z67.object({
|
|
19641
|
+
scope: z67.object({
|
|
19642
|
+
project: z67.string(),
|
|
19643
|
+
sourceId: z67.string().nullable(),
|
|
19644
|
+
attribution: z67.literal("project-source-only"),
|
|
19645
|
+
unavailableDimensions: z67.array(z67.enum(["property", "target", "market"]))
|
|
19376
19646
|
}),
|
|
19377
|
-
window:
|
|
19378
|
-
rule:
|
|
19379
|
-
version:
|
|
19380
|
-
burstThreshold:
|
|
19381
|
-
ratioThreshold:
|
|
19382
|
-
calibration:
|
|
19383
|
-
grouping:
|
|
19384
|
-
confirmsAutomation:
|
|
19647
|
+
window: z67.object({ startDate: calendarDateSchema, endDate: calendarDateSchema, timeZone: z67.literal("UTC") }),
|
|
19648
|
+
rule: z67.object({
|
|
19649
|
+
version: z67.literal("hourly-normalized-path-v1"),
|
|
19650
|
+
burstThreshold: z67.number().int().positive(),
|
|
19651
|
+
ratioThreshold: z67.number().positive(),
|
|
19652
|
+
calibration: z67.enum(["uncalibrated-default", "request-override"]),
|
|
19653
|
+
grouping: z67.array(z67.string()),
|
|
19654
|
+
confirmsAutomation: z67.literal(false)
|
|
19385
19655
|
}),
|
|
19386
|
-
totals:
|
|
19656
|
+
totals: z67.object({
|
|
19387
19657
|
raw: countsSchema,
|
|
19388
19658
|
redirects: countsSchema,
|
|
19389
19659
|
subresources: countsSchema,
|
|
@@ -19391,42 +19661,42 @@ var referralAssessmentSchema = z66.object({
|
|
|
19391
19661
|
suspected: countsSchema,
|
|
19392
19662
|
adjustedEstimate: countsSchema
|
|
19393
19663
|
}),
|
|
19394
|
-
bursts:
|
|
19395
|
-
sourceId:
|
|
19396
|
-
product:
|
|
19397
|
-
landingPathNormalized:
|
|
19398
|
-
tsHour:
|
|
19664
|
+
bursts: z67.array(z67.object({
|
|
19665
|
+
sourceId: z67.string(),
|
|
19666
|
+
product: z67.string(),
|
|
19667
|
+
landingPathNormalized: z67.string(),
|
|
19668
|
+
tsHour: z67.string(),
|
|
19399
19669
|
counts: countsSchema
|
|
19400
19670
|
})),
|
|
19401
|
-
evidence:
|
|
19402
|
-
comparison:
|
|
19403
|
-
status:
|
|
19404
|
-
serverCountable:
|
|
19405
|
-
serverObservation:
|
|
19671
|
+
evidence: z67.object({ total: z67.number().int().nonnegative(), returned: z67.number().int().nonnegative(), truncated: z67.boolean() }),
|
|
19672
|
+
comparison: z67.object({
|
|
19673
|
+
status: z67.literal("unavailable"),
|
|
19674
|
+
serverCountable: z67.number().int().nonnegative(),
|
|
19675
|
+
serverObservation: z67.enum(["missing", "observed-zero", "observed-positive"]),
|
|
19406
19676
|
/**
|
|
19407
19677
|
* Dimension-deduplicated GA AI sessions. With no stored AI row in the
|
|
19408
19678
|
* window: `0` (`observed-zero`) when the latest GA sync queried the whole
|
|
19409
19679
|
* window (GA4 omits zero rows), else `null` (`missing`).
|
|
19410
19680
|
*/
|
|
19411
|
-
gaSessions:
|
|
19412
|
-
gaObservation:
|
|
19681
|
+
gaSessions: z67.number().int().nonnegative().nullable(),
|
|
19682
|
+
gaObservation: z67.enum(["missing", "observed-zero", "observed-positive"]),
|
|
19413
19683
|
/**
|
|
19414
19684
|
* Descriptive quotient only (`serverCountable / gaSessions`, a multiplier
|
|
19415
19685
|
* where 3 is three times as many, never a percent), rounded to 2
|
|
19416
19686
|
* decimals. Not a matched, coverage-complete comparison.
|
|
19417
19687
|
*/
|
|
19418
|
-
observedRatio:
|
|
19688
|
+
observedRatio: z67.number().nonnegative().nullable(),
|
|
19419
19689
|
/** Compares the rounded `observedRatio` with `rule.ratioThreshold`. */
|
|
19420
|
-
observedRatioAboveThreshold:
|
|
19421
|
-
ratio:
|
|
19422
|
-
reasons:
|
|
19423
|
-
gaScope:
|
|
19690
|
+
observedRatioAboveThreshold: z67.boolean().nullable(),
|
|
19691
|
+
ratio: z67.null(),
|
|
19692
|
+
reasons: z67.array(z67.string()),
|
|
19693
|
+
gaScope: z67.literal("project")
|
|
19424
19694
|
}),
|
|
19425
|
-
caveats:
|
|
19695
|
+
caveats: z67.array(z67.string())
|
|
19426
19696
|
});
|
|
19427
19697
|
|
|
19428
19698
|
// ../contracts/src/tolerant-read.ts
|
|
19429
|
-
import { z as
|
|
19699
|
+
import { z as z68 } from "zod";
|
|
19430
19700
|
var WRAPPER_TYPES = /* @__PURE__ */ new Set(["optional", "nullable", "default", "prefault", "readonly", "catch", "nonoptional"]);
|
|
19431
19701
|
var DEPTH_LIMIT = 64;
|
|
19432
19702
|
function defOf(schema) {
|
|
@@ -19437,9 +19707,9 @@ function cloneWith(schema, changes) {
|
|
|
19437
19707
|
}
|
|
19438
19708
|
function openPrimitive(values) {
|
|
19439
19709
|
if (values.length === 0) return void 0;
|
|
19440
|
-
if (values.every((value) => typeof value === "string")) return
|
|
19441
|
-
if (values.every((value) => typeof value === "number")) return
|
|
19442
|
-
if (values.every((value) => typeof value === "boolean")) return
|
|
19710
|
+
if (values.every((value) => typeof value === "string")) return z68.string();
|
|
19711
|
+
if (values.every((value) => typeof value === "number")) return z68.number();
|
|
19712
|
+
if (values.every((value) => typeof value === "boolean")) return z68.boolean();
|
|
19443
19713
|
return void 0;
|
|
19444
19714
|
}
|
|
19445
19715
|
function walk2(schema, open, memo, depth) {
|
|
@@ -19453,7 +19723,7 @@ function walk2(schema, open, memo, depth) {
|
|
|
19453
19723
|
const shape = Object.fromEntries(Object.entries(schema.shape).map(([key, child]) => [key, next(child)]));
|
|
19454
19724
|
const declared = def.catchall;
|
|
19455
19725
|
const catchall = open.get(schema) ?? (declared && defOf(declared).type !== "never" ? next(declared) : void 0);
|
|
19456
|
-
result = catchall ?
|
|
19726
|
+
result = catchall ? z68.object(shape).catchall(catchall) : z68.object(shape);
|
|
19457
19727
|
} else if (WRAPPER_TYPES.has(def.type)) {
|
|
19458
19728
|
const inner = def.innerType;
|
|
19459
19729
|
const mapped = next(inner);
|
|
@@ -19470,10 +19740,10 @@ function walk2(schema, open, memo, depth) {
|
|
|
19470
19740
|
const options = def.options;
|
|
19471
19741
|
const mapped = options.map(next);
|
|
19472
19742
|
const changed = mapped.some((option, index) => option !== options[index]);
|
|
19473
|
-
result = !changed ? schema : def.discriminator ?
|
|
19743
|
+
result = !changed ? schema : def.discriminator ? z68.union(mapped) : cloneWith(schema, { options: mapped });
|
|
19474
19744
|
} else if (def.type === "record") {
|
|
19475
19745
|
const keyType = def.keyType, valueType = def.valueType;
|
|
19476
|
-
const mappedKey = defOf(keyType).type === "enum" ?
|
|
19746
|
+
const mappedKey = defOf(keyType).type === "enum" ? z68.string() : keyType;
|
|
19477
19747
|
const mappedValue = next(valueType);
|
|
19478
19748
|
result = mappedKey === keyType && mappedValue === valueType ? schema : cloneWith(schema, { keyType: mappedKey, valueType: mappedValue });
|
|
19479
19749
|
} else if (def.type === "intersection") {
|
|
@@ -19489,7 +19759,7 @@ function walk2(schema, open, memo, depth) {
|
|
|
19489
19759
|
result = changed ? cloneWith(schema, { items: mappedItems, rest: mappedRest }) : schema;
|
|
19490
19760
|
} else if (def.type === "lazy") {
|
|
19491
19761
|
const getter = def.getter;
|
|
19492
|
-
result =
|
|
19762
|
+
result = z68.lazy(() => next(getter()));
|
|
19493
19763
|
} else if (def.type === "enum") {
|
|
19494
19764
|
result = openPrimitive(Object.values(def.entries)) ?? schema;
|
|
19495
19765
|
} else if (def.type === "literal") {
|
|
@@ -19504,8 +19774,8 @@ function tolerantReadSchema(schema, options = {}) {
|
|
|
19504
19774
|
}
|
|
19505
19775
|
|
|
19506
19776
|
// ../contracts/src/sentiment-read.ts
|
|
19507
|
-
import { z as
|
|
19508
|
-
var OPEN_COUNTS = { openKeys: [[sentimentCountsSchema,
|
|
19777
|
+
import { z as z69 } from "zod";
|
|
19778
|
+
var OPEN_COUNTS = { openKeys: [[sentimentCountsSchema, z69.number().int().nonnegative()]] };
|
|
19509
19779
|
var sentimentSettingsReadSchema = tolerantReadSchema(sentimentSettingsSchema, OPEN_COUNTS);
|
|
19510
19780
|
var sentimentSummaryReadSchema = tolerantReadSchema(sentimentSummarySchema, OPEN_COUNTS);
|
|
19511
19781
|
var sentimentEvidencePageReadSchema = tolerantReadSchema(sentimentEvidencePageSchema, OPEN_COUNTS);
|
|
@@ -19515,10 +19785,10 @@ var sentimentJobReadSchema = tolerantReadSchema(sentimentJobSchema, OPEN_COUNTS)
|
|
|
19515
19785
|
var sentimentJobsReadSchema = tolerantReadSchema(sentimentJobsSchema, OPEN_COUNTS);
|
|
19516
19786
|
|
|
19517
19787
|
// ../contracts/src/traffic-analytics.ts
|
|
19518
|
-
import { z as
|
|
19788
|
+
import { z as z70 } from "zod";
|
|
19519
19789
|
var TRAFFIC_ANALYTICS_PERIOD_OPTIONS = [7, 14, 30, 90];
|
|
19520
19790
|
var TRAFFIC_ANALYTICS_DEFAULT_PERIOD_DAYS = 30;
|
|
19521
|
-
var trafficAnalyticsPeriodSchema =
|
|
19791
|
+
var trafficAnalyticsPeriodSchema = z70.union([z70.literal(7), z70.literal(14), z70.literal(30), z70.literal(90)]).describe("Traffic activity window in days (7, 14, 30, or 90). Defaults to 30 when omitted.");
|
|
19522
19792
|
function parseTrafficAnalyticsPeriod(value) {
|
|
19523
19793
|
if (value === void 0 || value === null || value === "") return TRAFFIC_ANALYTICS_DEFAULT_PERIOD_DAYS;
|
|
19524
19794
|
const parsed = typeof value === "number" ? value : Number(value);
|
|
@@ -19528,17 +19798,17 @@ function parseTrafficAnalyticsPeriod(value) {
|
|
|
19528
19798
|
}
|
|
19529
19799
|
return result.data;
|
|
19530
19800
|
}
|
|
19531
|
-
var trafficActivityCountSchema =
|
|
19532
|
-
var trafficActivitySummarySchema =
|
|
19801
|
+
var trafficActivityCountSchema = z70.object({ current: z70.number(), prior: z70.number(), deltaPct: percent().nullable() });
|
|
19802
|
+
var trafficActivitySummarySchema = z70.object({
|
|
19533
19803
|
/** ISO8601 inclusive lower bound of the selected window (default: 30 days). */
|
|
19534
|
-
windowStart:
|
|
19804
|
+
windowStart: z70.string(),
|
|
19535
19805
|
/** ISO8601 inclusive upper bound. */
|
|
19536
|
-
windowEnd:
|
|
19806
|
+
windowEnd: z70.string(),
|
|
19537
19807
|
/** Earliest stored project observation across crawler, user-fetch and referral hourly rows; not window-bound. */
|
|
19538
|
-
coverageStart:
|
|
19808
|
+
coverageStart: z70.string().nullable(),
|
|
19539
19809
|
/** Recording began on or before the prior window start. This does not establish uninterrupted ingestion. */
|
|
19540
|
-
priorWindowComplete:
|
|
19541
|
-
hasData:
|
|
19810
|
+
priorWindowComplete: z70.boolean(),
|
|
19811
|
+
hasData: z70.boolean().describe("True when the selected or prior window has stored crawler, user-fetch, countable referral or operator evidence, or the selected window has referral redirects. False means no qualifying stored evidence; it can occur with no, paused, errored or never-synced ingestion and out-of-window observations. It does not establish measured zero traffic or source health."),
|
|
19542
19812
|
/** Verified crawler hits during the selected period and the equal preceding period. */
|
|
19543
19813
|
verifiedCrawlerHits: trafficActivityCountSchema,
|
|
19544
19814
|
/** Unverified crawler hits during the selected period, separate from verified hits. */
|
|
@@ -19567,7 +19837,7 @@ var trafficActivitySummarySchema = z69.object({
|
|
|
19567
19837
|
* is exactly the thing to fix, so the summary must show it rather
|
|
19568
19838
|
* than render an empty section.
|
|
19569
19839
|
*/
|
|
19570
|
-
referralRedirects:
|
|
19840
|
+
referralRedirects: z70.number().int().nonnegative(),
|
|
19571
19841
|
/**
|
|
19572
19842
|
* `referralArrivals` split by traffic class. The three buckets sum to it.
|
|
19573
19843
|
*
|
|
@@ -19576,31 +19846,31 @@ var trafficActivitySummarySchema = z69.object({
|
|
|
19576
19846
|
* never be resolved. Reporting them as organic would overstate earned AI
|
|
19577
19847
|
* traffic by exactly a client's ad volume.
|
|
19578
19848
|
*/
|
|
19579
|
-
referralArrivalsByClass:
|
|
19849
|
+
referralArrivalsByClass: z70.object({
|
|
19580
19850
|
paid: trafficActivityCountSchema,
|
|
19581
19851
|
organic: trafficActivityCountSchema,
|
|
19582
19852
|
unclassified: trafficActivityCountSchema
|
|
19583
19853
|
}),
|
|
19584
19854
|
/** Pre-rendered one-line breakdown, e.g. "Paid 1,200 · Organic 24". Empty when there is nothing to split. */
|
|
19585
|
-
referralArrivalsClassSummary:
|
|
19855
|
+
referralArrivalsClassSummary: z70.string(),
|
|
19586
19856
|
/** Per-AI-operator breakdown (OpenAI, Anthropic, Google AI, Perplexity, …). */
|
|
19587
|
-
byOperator:
|
|
19588
|
-
operator:
|
|
19589
|
-
verifiedHits:
|
|
19857
|
+
byOperator: z70.array(z70.object({
|
|
19858
|
+
operator: z70.string(),
|
|
19859
|
+
verifiedHits: z70.number(),
|
|
19590
19860
|
/** claimed-bot UA, source IP not in a published range. */
|
|
19591
|
-
unverifiedHits:
|
|
19861
|
+
unverifiedHits: z70.number(),
|
|
19592
19862
|
/** Per-user fetches from this operator's AI surface (ChatGPT-User, …). */
|
|
19593
|
-
userFetchHits:
|
|
19594
|
-
referralArrivals:
|
|
19863
|
+
userFetchHits: z70.number(),
|
|
19864
|
+
referralArrivals: z70.number(),
|
|
19595
19865
|
deltaPct: percent().nullable()
|
|
19596
19866
|
})),
|
|
19597
19867
|
/**
|
|
19598
19868
|
* Top crawled paths during the selected period, with both verified and
|
|
19599
19869
|
* unverified crawler hits. These are request counts, not citation evidence.
|
|
19600
19870
|
*/
|
|
19601
|
-
topCrawledPaths:
|
|
19602
|
-
path:
|
|
19603
|
-
verifiedHits:
|
|
19871
|
+
topCrawledPaths: z70.array(z70.object({
|
|
19872
|
+
path: z70.string(),
|
|
19873
|
+
verifiedHits: z70.number(),
|
|
19604
19874
|
/**
|
|
19605
19875
|
* Hits from a crawler that identified itself but whose source IP could not
|
|
19606
19876
|
* be matched against the operator's published ranges. Additive, not an
|
|
@@ -19608,36 +19878,36 @@ var trafficActivitySummarySchema = z69.object({
|
|
|
19608
19878
|
* logs, for one), so for those projects every hit lands here and a
|
|
19609
19879
|
* verified-only view reports zero against real crawl activity.
|
|
19610
19880
|
*/
|
|
19611
|
-
unverifiedHits:
|
|
19881
|
+
unverifiedHits: z70.number().default(0),
|
|
19612
19882
|
/** How many distinct AI operators crawled this path in the window. */
|
|
19613
|
-
distinctOperators:
|
|
19883
|
+
distinctOperators: z70.number()
|
|
19614
19884
|
})),
|
|
19615
19885
|
/** AI products that sent ≥1 session in the window (referral by destination). */
|
|
19616
|
-
referralProducts:
|
|
19617
|
-
product:
|
|
19618
|
-
arrivals:
|
|
19619
|
-
distinctLandingPaths:
|
|
19886
|
+
referralProducts: z70.array(z70.object({
|
|
19887
|
+
product: z70.string(),
|
|
19888
|
+
arrivals: z70.number(),
|
|
19889
|
+
distinctLandingPaths: z70.number()
|
|
19620
19890
|
})),
|
|
19621
19891
|
/** Daily request counts during the selected period. */
|
|
19622
|
-
dailyTrend:
|
|
19623
|
-
date:
|
|
19624
|
-
verifiedCrawlerHits:
|
|
19892
|
+
dailyTrend: z70.array(z70.object({
|
|
19893
|
+
date: z70.string(),
|
|
19894
|
+
verifiedCrawlerHits: z70.number(),
|
|
19625
19895
|
/** See topCrawledPaths.unverifiedHits. Plotted alongside, never instead. */
|
|
19626
|
-
unverifiedCrawlerHits:
|
|
19627
|
-
userFetchHits:
|
|
19628
|
-
referralArrivals:
|
|
19896
|
+
unverifiedCrawlerHits: z70.number().default(0),
|
|
19897
|
+
userFetchHits: z70.number(),
|
|
19898
|
+
referralArrivals: z70.number()
|
|
19629
19899
|
})),
|
|
19630
19900
|
/**
|
|
19631
19901
|
* Top landing paths for AI-referral sessions during the selected period.
|
|
19632
19902
|
* Complements crawler paths with server-observed referral arrivals.
|
|
19633
19903
|
*/
|
|
19634
|
-
topReferralLandingPaths:
|
|
19635
|
-
path:
|
|
19636
|
-
arrivals:
|
|
19637
|
-
distinctProducts:
|
|
19904
|
+
topReferralLandingPaths: z70.array(z70.object({
|
|
19905
|
+
path: z70.string(),
|
|
19906
|
+
arrivals: z70.number(),
|
|
19907
|
+
distinctProducts: z70.number()
|
|
19638
19908
|
}))
|
|
19639
19909
|
});
|
|
19640
|
-
var trafficAnalyticsResponseSchema =
|
|
19910
|
+
var trafficAnalyticsResponseSchema = z70.object({
|
|
19641
19911
|
/** Null when no non-archived traffic source is connected. Connected sources without events return zero counts. */
|
|
19642
19912
|
activity: trafficActivitySummarySchema.nullable()
|
|
19643
19913
|
});
|
|
@@ -20320,9 +20590,11 @@ export {
|
|
|
20320
20590
|
SENTIMENT_QUERY_PAGE_DEFAULT,
|
|
20321
20591
|
SENTIMENT_QUERY_PAGE_MAX,
|
|
20322
20592
|
sentimentSummaryRequestSchema,
|
|
20593
|
+
sentimentEvidenceOutcomeFilterSchema,
|
|
20323
20594
|
sentimentEvidenceRequestSchema,
|
|
20324
20595
|
sentimentCompareRequestSchema,
|
|
20325
20596
|
sentimentSummarySchema,
|
|
20597
|
+
rankCriticizedProperties,
|
|
20326
20598
|
sentimentSettingsUpdateSchema,
|
|
20327
20599
|
sentimentSettingsSchema,
|
|
20328
20600
|
sentimentBackfillSelectionSchema,
|
|
@@ -20368,6 +20640,7 @@ export {
|
|
|
20368
20640
|
groupIsoDateRanges,
|
|
20369
20641
|
deriveIndexCoverage,
|
|
20370
20642
|
normalizeQueryText,
|
|
20643
|
+
summarizeObservedQueryCounts,
|
|
20371
20644
|
citationVisibilityResponseSchema,
|
|
20372
20645
|
emptyCitationVisibility,
|
|
20373
20646
|
citationStateToCited,
|
|
@@ -20544,6 +20817,7 @@ export {
|
|
|
20544
20817
|
AGENT_NONE,
|
|
20545
20818
|
normalizeAgentSlug,
|
|
20546
20819
|
detectAgentRuntime,
|
|
20820
|
+
uiTelemetryEventSchema,
|
|
20547
20821
|
isSensitiveDiagnosticQueryKey,
|
|
20548
20822
|
redactLogValue,
|
|
20549
20823
|
redactLogString,
|