@canonry/canonry 6.1.5 → 6.3.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/canonry-cli.md +13 -1
- package/assets/assets/{AuditHistoryPanel-D-W_kwEY.js → AuditHistoryPanel-BUYWIjlG.js} +1 -1
- package/assets/assets/{BacklinksPage-BeqCFRO3.js → BacklinksPage-aBcxpN_9.js} +1 -1
- package/assets/assets/{HistoryPage-wAPbY0z4.js → HistoryPage-PoBuxiY_.js} +1 -1
- package/assets/assets/{MeasurementPropertyPage-BSOrkHCB.js → MeasurementPropertyPage-DyjyqHac.js} +1 -1
- package/assets/assets/{ProjectPage-v0C7CwyA.js → ProjectPage-Mmv5YW-K.js} +1 -1
- package/assets/assets/{RunsPage-CxolaIps.js → RunsPage-CHHxOpzo.js} +1 -1
- package/assets/assets/{SettingsPage-BQqJz0Ms.js → SettingsPage-CNKnrLXC.js} +1 -1
- package/assets/assets/{SiteHealthSection-C56kNcQQ.js → SiteHealthSection-C9RivT7G.js} +3 -3
- package/assets/assets/{TrafficPage-BDmWdYWf.js → TrafficPage-CY-ibXnb.js} +1 -1
- package/assets/assets/{TrafficSourceDetailPage-DZl3YNBs.js → TrafficSourceDetailPage-BgiPXubs.js} +1 -1
- package/assets/assets/{extract-error-message-D0mBVEGn.js → extract-error-message-H1dzzfBP.js} +1 -1
- package/assets/assets/{index-DZ__RzGa.js → index-DSCun3I9.js} +22 -22
- package/assets/assets/{react-sigma_core.esm.min-BQNp33-g.js → react-sigma_core.esm.min-uiYtR_DU.js} +1 -1
- package/assets/assets/{v2-overview-adapter-XZbD7swG.js → v2-overview-adapter-BQokN2eb.js} +1 -1
- package/assets/index.html +1 -1
- package/dist/{chunk-PAYC6TQ2.js → chunk-5GY5WBAF.js} +3 -3
- package/dist/{chunk-5QH72CTN.js → chunk-DERWXLHX.js} +15 -1
- package/dist/{chunk-J7LV4CS2.js → chunk-EV5G5QRR.js} +335 -280
- package/dist/{chunk-MSFBNFTI.js → chunk-FSRVG2H7.js} +2 -2
- package/dist/{chunk-4UEX44C3.js → chunk-OTROA7CN.js} +395 -173
- package/dist/{chunk-MTEVU6KG.js → chunk-QVGG76UW.js} +79 -24
- package/dist/{chunk-FRBKYQN7.js → chunk-ZZEPF3A5.js} +24 -4
- package/dist/cli.js +55 -10
- package/dist/{demo-server-UGILQVEC.js → demo-server-5MNLI6GC.js} +4 -4
- package/dist/index.js +6 -6
- package/dist/{intelligence-service-JYGP6LME.js → intelligence-service-5J36RBEM.js} +2 -2
- package/dist/mcp.js +4 -4
- package/package.json +11 -11
|
@@ -9775,14 +9775,14 @@ function breakdownShares(parts) {
|
|
|
9775
9775
|
const total = parts.reduce((sum, part) => sum + Math.max(0, part), 0);
|
|
9776
9776
|
return parts.map((part) => shareOf(part, total) ?? 0);
|
|
9777
9777
|
}
|
|
9778
|
-
function wilsonInterval(successes, n,
|
|
9778
|
+
function wilsonInterval(successes, n, z72 = 1.96) {
|
|
9779
9779
|
if (!Number.isFinite(n) || n <= 0) return null;
|
|
9780
9780
|
const s = Math.max(0, Math.min(successes, n));
|
|
9781
9781
|
const p = s / n;
|
|
9782
|
-
const z210 =
|
|
9782
|
+
const z210 = z72 * z72;
|
|
9783
9783
|
const denom = 1 + z210 / n;
|
|
9784
9784
|
const center = (p + z210 / (2 * n)) / denom;
|
|
9785
|
-
const margin =
|
|
9785
|
+
const margin = z72 / denom * Math.sqrt(p * (1 - p) / n + z210 / (4 * n * n));
|
|
9786
9786
|
return {
|
|
9787
9787
|
low: round(Math.max(0, center - margin)),
|
|
9788
9788
|
high: round(Math.min(1, center + margin))
|
|
@@ -19859,6 +19859,7 @@ function serializeForInlineScript(value) {
|
|
|
19859
19859
|
var PROVIDER_ERROR_PRIORITY = [
|
|
19860
19860
|
"PROVIDER_AUTH",
|
|
19861
19861
|
"RATE_LIMITED",
|
|
19862
|
+
"PROVIDER_UNAVAILABLE",
|
|
19862
19863
|
"TIMEOUT",
|
|
19863
19864
|
"NETWORK",
|
|
19864
19865
|
"PARSE_ERROR",
|
|
@@ -19871,6 +19872,10 @@ function classifyProviderErrorMessage(message) {
|
|
|
19871
19872
|
if (/\b429\b|rate[_ -]?limit|too many requests|quota[_ -]?exceeded/i.test(message)) {
|
|
19872
19873
|
return "RATE_LIMITED";
|
|
19873
19874
|
}
|
|
19875
|
+
const status = extractProviderHttpStatus(message);
|
|
19876
|
+
if (status !== void 0 && status >= 500 || /overloaded|service unavailable|bad gateway|internal server error/i.test(message)) {
|
|
19877
|
+
return "PROVIDER_UNAVAILABLE";
|
|
19878
|
+
}
|
|
19874
19879
|
if (/timeout|timed out|ETIMEDOUT/i.test(message)) {
|
|
19875
19880
|
return "TIMEOUT";
|
|
19876
19881
|
}
|
|
@@ -19892,6 +19897,11 @@ function classifyProviderErrorMessages(messages) {
|
|
|
19892
19897
|
}
|
|
19893
19898
|
return "UNKNOWN";
|
|
19894
19899
|
}
|
|
19900
|
+
function extractProviderHttpStatus(message) {
|
|
19901
|
+
const text = message.replace(/^(?:\[[^\]]+\]\s*)+/, "");
|
|
19902
|
+
const match = /^([1-5]\d\d)\b/.exec(text) ?? /\b(?:status(?: code)?|http)[:=]?\s*([1-5]\d\d)\b/i.exec(text) ?? /"(?:code|status)"\s*:\s*([1-5]\d\d)\b/.exec(text);
|
|
19903
|
+
return match ? Number(match[1]) : void 0;
|
|
19904
|
+
}
|
|
19895
19905
|
|
|
19896
19906
|
// ../contracts/src/telemetry.ts
|
|
19897
19907
|
import { z as z65 } from "zod";
|
|
@@ -20095,6 +20105,193 @@ function detectAgentRuntime(env) {
|
|
|
20095
20105
|
return AGENT_NONE;
|
|
20096
20106
|
}
|
|
20097
20107
|
|
|
20108
|
+
// ../contracts/src/feedback.ts
|
|
20109
|
+
import { z as z66 } from "zod";
|
|
20110
|
+
|
|
20111
|
+
// ../contracts/src/log-redaction.ts
|
|
20112
|
+
var REDACTED = "[REDACTED]";
|
|
20113
|
+
var TRUNCATED = "[TRUNCATED]";
|
|
20114
|
+
var CIRCULAR = "[CIRCULAR]";
|
|
20115
|
+
var UNREADABLE = "[UNREADABLE]";
|
|
20116
|
+
var OMITTED = "[OMITTED]";
|
|
20117
|
+
var MAX_DEPTH = 6;
|
|
20118
|
+
var MAX_ARRAY_ITEMS = 50;
|
|
20119
|
+
var MAX_OBJECT_KEYS = 100;
|
|
20120
|
+
var MAX_STRING_LENGTH = 4096;
|
|
20121
|
+
var secretKey = /api[ _-]?key|authorization|auth(?:entication)?|cookie|password|secret|token|credential/i;
|
|
20122
|
+
var escapedSecretAssignment = /\\+["'][\w -]*(?:api[ _-]?key|auth|cookie|password|secret|token|credential)[\w -]*\\+["']\s*:/i;
|
|
20123
|
+
var unsafeGraphKey = /^(?:req|res|request|reply|raw|socket|headers?|body|responsebody|apiresponse|rawresponse|providerbody|providerresponse)$/i;
|
|
20124
|
+
var providerNameKey = /^provider$/i;
|
|
20125
|
+
function isSensitiveDiagnosticQueryKey(key) {
|
|
20126
|
+
return secretKey.test(key) || /^key$/i.test(key);
|
|
20127
|
+
}
|
|
20128
|
+
function redactLogValue(value) {
|
|
20129
|
+
try {
|
|
20130
|
+
return redactValue(value, 0, /* @__PURE__ */ new WeakSet());
|
|
20131
|
+
} catch {
|
|
20132
|
+
return UNREADABLE;
|
|
20133
|
+
}
|
|
20134
|
+
}
|
|
20135
|
+
function redactLogString(value) {
|
|
20136
|
+
try {
|
|
20137
|
+
const clipped = value.length > MAX_STRING_LENGTH ? `${value.slice(0, MAX_STRING_LENGTH)}${TRUNCATED}` : value;
|
|
20138
|
+
if (escapedSecretAssignment.test(clipped)) return REDACTED;
|
|
20139
|
+
return redactEmbeddedUrls(clipped).replace(/\b((?:set-cookie|cookie)\s*[:=]\s*)[^\r\n]*(?:\r?\n[ \t][^\r\n]*)*/gi, `$1${REDACTED}`).replace(
|
|
20140
|
+
/(["']?[\w-]*(?:api[ _-]?key|auth|cookie|password|secret|token|credential)[\w-]*["']?\s*[=:]\s*)(?:"(?:\\.|[^"\\])*(?:"|$)|'(?:\\.|[^'\\])*(?:'|$))/gi,
|
|
20141
|
+
`$1${REDACTED}`
|
|
20142
|
+
).replace(/\b(Bearer|Basic)\s+[^\s,;]+/gi, (_match, scheme) => `${scheme} ${REDACTED}`).replace(
|
|
20143
|
+
/(api[ _-]?key|authorization|auth(?:entication)?|cookie|password|secret|token|credential)\s*([=:])\s*(?!\[REDACTED\])[^\s&,'")\]}]+/gi,
|
|
20144
|
+
`$1$2${REDACTED}`
|
|
20145
|
+
).slice(0, MAX_STRING_LENGTH);
|
|
20146
|
+
} catch {
|
|
20147
|
+
return UNREADABLE;
|
|
20148
|
+
}
|
|
20149
|
+
}
|
|
20150
|
+
function redactValue(value, depth, seen, key) {
|
|
20151
|
+
if (key && diagnosticIdentity(key, value) !== void 0) return value;
|
|
20152
|
+
if (key && secretKey.test(key)) return REDACTED;
|
|
20153
|
+
if (key && unsafeGraphKey.test(key)) return OMITTED;
|
|
20154
|
+
if (key && providerNameKey.test(key) && typeof value === "object" && value !== null) return OMITTED;
|
|
20155
|
+
if (value === null || typeof value === "boolean") return value;
|
|
20156
|
+
if (typeof value === "number") return Number.isFinite(value) ? value : String(value);
|
|
20157
|
+
if (typeof value === "string") return redactLogString(value);
|
|
20158
|
+
if (typeof value === "bigint") return value.toString();
|
|
20159
|
+
if (typeof value === "undefined") return void 0;
|
|
20160
|
+
if (typeof value === "symbol" || typeof value === "function") return `[${typeof value}]`;
|
|
20161
|
+
if (depth >= MAX_DEPTH) return TRUNCATED;
|
|
20162
|
+
if (typeof value !== "object") return UNREADABLE;
|
|
20163
|
+
if (seen.has(value)) return CIRCULAR;
|
|
20164
|
+
seen.add(value);
|
|
20165
|
+
try {
|
|
20166
|
+
if (value instanceof Error) return redactError(value, depth, seen);
|
|
20167
|
+
if (Array.isArray(value)) {
|
|
20168
|
+
const output2 = [];
|
|
20169
|
+
const length = safeArrayLength(value);
|
|
20170
|
+
for (let index = 0; index < Math.min(length, MAX_ARRAY_ITEMS); index++) {
|
|
20171
|
+
output2.push(redactValue(safeProperty(value, String(index)), depth + 1, seen));
|
|
20172
|
+
}
|
|
20173
|
+
if (length > MAX_ARRAY_ITEMS) output2.push(TRUNCATED);
|
|
20174
|
+
return output2;
|
|
20175
|
+
}
|
|
20176
|
+
const output = {};
|
|
20177
|
+
const keys = safeKeys(value);
|
|
20178
|
+
for (const nestedKey of keys.slice(0, MAX_OBJECT_KEYS)) {
|
|
20179
|
+
output[nestedKey] = redactValue(safeProperty(value, nestedKey), depth + 1, seen, nestedKey);
|
|
20180
|
+
}
|
|
20181
|
+
if (keys.length > MAX_OBJECT_KEYS) output.__truncated = true;
|
|
20182
|
+
return output;
|
|
20183
|
+
} catch {
|
|
20184
|
+
return UNREADABLE;
|
|
20185
|
+
} finally {
|
|
20186
|
+
seen.delete(value);
|
|
20187
|
+
}
|
|
20188
|
+
}
|
|
20189
|
+
function diagnosticIdentity(key, value) {
|
|
20190
|
+
if (typeof value !== "string") return void 0;
|
|
20191
|
+
if (key === "actor" && /^(?:api-key|user):[\w.-]{1,256}$/.test(value)) return value;
|
|
20192
|
+
if (key === "credentialId" && /^[\w.-]{1,256}$/.test(value)) return value;
|
|
20193
|
+
return void 0;
|
|
20194
|
+
}
|
|
20195
|
+
function redactError(error, depth, seen) {
|
|
20196
|
+
const output = {
|
|
20197
|
+
name: redactLogString(safeErrorString(error, "name")),
|
|
20198
|
+
message: redactLogString(safeErrorString(error, "message"))
|
|
20199
|
+
};
|
|
20200
|
+
const stack = safeErrorString(error, "stack");
|
|
20201
|
+
if (stack) output.stack = redactLogString(stack);
|
|
20202
|
+
for (const key of safeKeys(error).slice(0, MAX_OBJECT_KEYS)) {
|
|
20203
|
+
output[key] = redactValue(safeProperty(error, key), depth + 1, seen, key);
|
|
20204
|
+
}
|
|
20205
|
+
return output;
|
|
20206
|
+
}
|
|
20207
|
+
function safeKeys(value) {
|
|
20208
|
+
try {
|
|
20209
|
+
return Object.keys(value);
|
|
20210
|
+
} catch {
|
|
20211
|
+
return [];
|
|
20212
|
+
}
|
|
20213
|
+
}
|
|
20214
|
+
function safeArrayLength(value) {
|
|
20215
|
+
try {
|
|
20216
|
+
return Number.isSafeInteger(value.length) && value.length >= 0 ? value.length : 0;
|
|
20217
|
+
} catch {
|
|
20218
|
+
return 0;
|
|
20219
|
+
}
|
|
20220
|
+
}
|
|
20221
|
+
function safeProperty(value, key) {
|
|
20222
|
+
try {
|
|
20223
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
20224
|
+
if (!descriptor || !("value" in descriptor)) return UNREADABLE;
|
|
20225
|
+
return descriptor.value;
|
|
20226
|
+
} catch {
|
|
20227
|
+
return UNREADABLE;
|
|
20228
|
+
}
|
|
20229
|
+
}
|
|
20230
|
+
function safeErrorString(error, key) {
|
|
20231
|
+
try {
|
|
20232
|
+
const value = error[key];
|
|
20233
|
+
return typeof value === "string" ? value : "";
|
|
20234
|
+
} catch {
|
|
20235
|
+
return UNREADABLE;
|
|
20236
|
+
}
|
|
20237
|
+
}
|
|
20238
|
+
function redactEmbeddedUrls(value) {
|
|
20239
|
+
return value.replace(/https?:\/\/[^\s<>"']+/gi, (candidate) => {
|
|
20240
|
+
if (candidate.includes(TRUNCATED)) return "[TRUNCATED_URL]";
|
|
20241
|
+
const suffix = candidate.match(/[),.;!?\]}]+$/)?.[0] ?? "";
|
|
20242
|
+
const rawUrl = suffix ? candidate.slice(0, -suffix.length) : candidate;
|
|
20243
|
+
try {
|
|
20244
|
+
const url = new URL(rawUrl);
|
|
20245
|
+
if (url.username || url.password) {
|
|
20246
|
+
url.username = REDACTED;
|
|
20247
|
+
url.password = REDACTED;
|
|
20248
|
+
}
|
|
20249
|
+
for (const key of [...url.searchParams.keys()]) {
|
|
20250
|
+
if (isSensitiveDiagnosticQueryKey(key)) url.searchParams.set(key, REDACTED);
|
|
20251
|
+
}
|
|
20252
|
+
return `${url.toString()}${suffix}`;
|
|
20253
|
+
} catch {
|
|
20254
|
+
return `[REDACTED_URL]${suffix}`;
|
|
20255
|
+
}
|
|
20256
|
+
});
|
|
20257
|
+
}
|
|
20258
|
+
|
|
20259
|
+
// ../contracts/src/feedback.ts
|
|
20260
|
+
var FEEDBACK_KINDS = ["struggle", "bug", "improvement", "other"];
|
|
20261
|
+
var feedbackKindSchema = z66.enum(FEEDBACK_KINDS);
|
|
20262
|
+
var FEEDBACK_LIMITS = {
|
|
20263
|
+
summary: 500,
|
|
20264
|
+
details: 4e3,
|
|
20265
|
+
area: 40,
|
|
20266
|
+
command: 120,
|
|
20267
|
+
errorCode: 40
|
|
20268
|
+
};
|
|
20269
|
+
var feedbackSubmissionSchema = z66.object({
|
|
20270
|
+
kind: feedbackKindSchema,
|
|
20271
|
+
summary: z66.string().trim().min(1).max(FEEDBACK_LIMITS.summary),
|
|
20272
|
+
details: z66.string().trim().min(1).max(FEEDBACK_LIMITS.details).optional(),
|
|
20273
|
+
area: z66.string().trim().min(1).max(FEEDBACK_LIMITS.area).optional(),
|
|
20274
|
+
command: z66.string().trim().min(1).max(FEEDBACK_LIMITS.command).optional(),
|
|
20275
|
+
errorCode: z66.string().trim().min(1).max(FEEDBACK_LIMITS.errorCode).optional()
|
|
20276
|
+
}).strict();
|
|
20277
|
+
var feedbackAcceptedDtoSchema = z66.object({
|
|
20278
|
+
accepted: z66.boolean(),
|
|
20279
|
+
id: z66.string()
|
|
20280
|
+
});
|
|
20281
|
+
function redactFeedbackText(value, limit) {
|
|
20282
|
+
return truncateUtf16(
|
|
20283
|
+
redactLogString(value).replace(SECRET_FLAG_VALUE, "$1 [REDACTED]").replace(BARE_CREDENTIAL, "[REDACTED]"),
|
|
20284
|
+
limit
|
|
20285
|
+
);
|
|
20286
|
+
}
|
|
20287
|
+
function truncateUtf16(value, limit) {
|
|
20288
|
+
if (value.length <= limit) return value;
|
|
20289
|
+
const cut = value.slice(0, limit);
|
|
20290
|
+
return /[\uD800-\uDBFF]$/.test(cut) ? cut.slice(0, -1) : cut;
|
|
20291
|
+
}
|
|
20292
|
+
var SECRET_FLAG_VALUE = /(?<=^|[ \t])(--?(?:[a-z\d]+-)*(?:key|token|secret|password|passwd|credential|credentials|auth|authorization|bearer)(?:-[a-z\d]+)*)(?:[ \t]*=[ \t]*|[ \t]+)(?!\[REDACTED\])(?:"[^"\n]*"|'[^'\n]*'|\S+)/gim;
|
|
20293
|
+
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;
|
|
20294
|
+
|
|
20098
20295
|
// ../contracts/src/trend-stability.ts
|
|
20099
20296
|
var MIN_TREND_POINTS = 4;
|
|
20100
20297
|
function isTrendBaseline(points) {
|
|
@@ -20102,14 +20299,14 @@ function isTrendBaseline(points) {
|
|
|
20102
20299
|
}
|
|
20103
20300
|
|
|
20104
20301
|
// ../contracts/src/report-sections.ts
|
|
20105
|
-
import { z as
|
|
20302
|
+
import { z as z67 } from "zod";
|
|
20106
20303
|
var CLIENT_AUDIENCE = reportAudienceSchema.enum.client;
|
|
20107
20304
|
var BOTH_AUDIENCES = reportActionAudienceSchema.enum.both;
|
|
20108
20305
|
var ADVANCED_MODE = visibilityReportResolvedModeSchema.enum.advanced;
|
|
20109
20306
|
function pluralize(count2, singular, plural = `${singular}s`) {
|
|
20110
20307
|
return count2 === 1 ? singular : plural;
|
|
20111
20308
|
}
|
|
20112
|
-
var reportSectionIdSchema =
|
|
20309
|
+
var reportSectionIdSchema = z67.enum([
|
|
20113
20310
|
"client-summary",
|
|
20114
20311
|
"executive-summary",
|
|
20115
20312
|
"share-of-voice",
|
|
@@ -20832,240 +21029,92 @@ var REPORT_SECTION_COPY = {
|
|
|
20832
21029
|
};
|
|
20833
21030
|
|
|
20834
21031
|
// ../contracts/src/operational-logs.ts
|
|
20835
|
-
import { z as
|
|
20836
|
-
var operationalLogLevelSchema =
|
|
20837
|
-
var diagnosticContextSchema =
|
|
20838
|
-
runId:
|
|
20839
|
-
projectId:
|
|
20840
|
-
requestId:
|
|
20841
|
-
actor:
|
|
20842
|
-
credentialId:
|
|
20843
|
-
userAgent:
|
|
20844
|
-
actorSession:
|
|
20845
|
-
method:
|
|
20846
|
-
route:
|
|
20847
|
-
operationId:
|
|
20848
|
-
jobId:
|
|
20849
|
-
taskId:
|
|
20850
|
-
traceId:
|
|
20851
|
-
provider:
|
|
20852
|
-
errorCode:
|
|
20853
|
-
attempt:
|
|
20854
|
-
count:
|
|
20855
|
-
total:
|
|
20856
|
-
progress:
|
|
20857
|
-
httpStatus:
|
|
20858
|
-
statusCode:
|
|
20859
|
-
durationMs:
|
|
20860
|
-
bytes:
|
|
20861
|
-
retryAfterMs:
|
|
20862
|
-
retriable:
|
|
20863
|
-
retrying:
|
|
20864
|
-
cancelled:
|
|
20865
|
-
success:
|
|
20866
|
-
}).strict();
|
|
20867
|
-
var operationalLogEntryDtoSchema =
|
|
20868
|
-
cursor:
|
|
20869
|
-
ts:
|
|
21032
|
+
import { z as z68 } from "zod";
|
|
21033
|
+
var operationalLogLevelSchema = z68.enum(["trace", "debug", "info", "warn", "error", "fatal"]);
|
|
21034
|
+
var diagnosticContextSchema = z68.object({
|
|
21035
|
+
runId: z68.string().min(1).max(256).optional(),
|
|
21036
|
+
projectId: z68.string().min(1).max(256).optional(),
|
|
21037
|
+
requestId: z68.string().min(1).max(256).optional(),
|
|
21038
|
+
actor: z68.string().min(1).max(512).optional(),
|
|
21039
|
+
credentialId: z68.string().min(1).max(512).optional(),
|
|
21040
|
+
userAgent: z68.string().min(1).max(512).optional(),
|
|
21041
|
+
actorSession: z68.string().min(1).max(512).optional(),
|
|
21042
|
+
method: z68.string().min(1).max(16).optional(),
|
|
21043
|
+
route: z68.string().min(1).max(256).optional(),
|
|
21044
|
+
operationId: z68.string().min(1).max(256).optional(),
|
|
21045
|
+
jobId: z68.string().min(1).max(256).optional(),
|
|
21046
|
+
taskId: z68.string().min(1).max(256).optional(),
|
|
21047
|
+
traceId: z68.string().min(1).max(256).optional(),
|
|
21048
|
+
provider: z68.string().min(1).max(256).optional(),
|
|
21049
|
+
errorCode: z68.string().min(1).max(128).optional(),
|
|
21050
|
+
attempt: z68.number().finite().optional(),
|
|
21051
|
+
count: z68.number().finite().optional(),
|
|
21052
|
+
total: z68.number().finite().optional(),
|
|
21053
|
+
progress: z68.number().finite().optional(),
|
|
21054
|
+
httpStatus: z68.number().finite().optional(),
|
|
21055
|
+
statusCode: z68.number().finite().optional(),
|
|
21056
|
+
durationMs: z68.number().finite().optional(),
|
|
21057
|
+
bytes: z68.number().finite().optional(),
|
|
21058
|
+
retryAfterMs: z68.number().finite().optional(),
|
|
21059
|
+
retriable: z68.boolean().optional(),
|
|
21060
|
+
retrying: z68.boolean().optional(),
|
|
21061
|
+
cancelled: z68.boolean().optional(),
|
|
21062
|
+
success: z68.boolean().optional()
|
|
21063
|
+
}).strict();
|
|
21064
|
+
var operationalLogEntryDtoSchema = z68.object({
|
|
21065
|
+
cursor: z68.string().min(1).max(512),
|
|
21066
|
+
ts: z68.string().datetime(),
|
|
20870
21067
|
level: operationalLogLevelSchema,
|
|
20871
|
-
module:
|
|
20872
|
-
action:
|
|
20873
|
-
message:
|
|
20874
|
-
runId:
|
|
20875
|
-
projectId:
|
|
21068
|
+
module: z68.string().min(1).max(256),
|
|
21069
|
+
action: z68.string().min(1).max(256),
|
|
21070
|
+
message: z68.string().max(4096).optional(),
|
|
21071
|
+
runId: z68.string().min(1).max(256).optional(),
|
|
21072
|
+
projectId: z68.string().min(1).max(256).optional(),
|
|
20876
21073
|
context: diagnosticContextSchema
|
|
20877
21074
|
}).strict();
|
|
20878
|
-
var logQuerySchema =
|
|
21075
|
+
var logQuerySchema = z68.object({
|
|
20879
21076
|
level: operationalLogLevelSchema.optional(),
|
|
20880
|
-
module:
|
|
20881
|
-
runId:
|
|
20882
|
-
projectId:
|
|
20883
|
-
actor:
|
|
20884
|
-
requestId:
|
|
20885
|
-
since:
|
|
20886
|
-
until:
|
|
20887
|
-
limit:
|
|
20888
|
-
cursor:
|
|
21077
|
+
module: z68.string().trim().min(1).max(256).optional(),
|
|
21078
|
+
runId: z68.string().trim().min(1).max(256).optional(),
|
|
21079
|
+
projectId: z68.string().trim().min(1).max(256).optional(),
|
|
21080
|
+
actor: z68.string().trim().min(1).max(512).optional(),
|
|
21081
|
+
requestId: z68.string().trim().min(1).max(256).optional(),
|
|
21082
|
+
since: z68.string().datetime().optional(),
|
|
21083
|
+
until: z68.string().datetime().optional(),
|
|
21084
|
+
limit: z68.coerce.number().int().min(1).max(200).default(100),
|
|
21085
|
+
cursor: z68.string().trim().min(1).max(512).optional()
|
|
20889
21086
|
}).strict().superRefine((query, ctx) => {
|
|
20890
21087
|
if (query.since && query.until && Date.parse(query.since) > Date.parse(query.until)) {
|
|
20891
|
-
ctx.addIssue({ code:
|
|
21088
|
+
ctx.addIssue({ code: z68.ZodIssueCode.custom, path: ["until"], message: '"until" must be on or after "since".' });
|
|
20892
21089
|
}
|
|
20893
21090
|
});
|
|
20894
|
-
var retentionPolicySchema =
|
|
20895
|
-
maxEntries:
|
|
20896
|
-
maxAgeSeconds:
|
|
21091
|
+
var retentionPolicySchema = z68.object({
|
|
21092
|
+
maxEntries: z68.number().int().positive(),
|
|
21093
|
+
maxAgeSeconds: z68.number().int().positive()
|
|
20897
21094
|
}).strict();
|
|
20898
|
-
var operationalLogListDtoSchema =
|
|
20899
|
-
entries:
|
|
20900
|
-
nextCursor:
|
|
21095
|
+
var operationalLogListDtoSchema = z68.object({
|
|
21096
|
+
entries: z68.array(operationalLogEntryDtoSchema),
|
|
21097
|
+
nextCursor: z68.string().min(1).max(512).nullable(),
|
|
20901
21098
|
/** Matching entries left after this page. */
|
|
20902
|
-
truncated:
|
|
21099
|
+
truncated: z68.number().int().nonnegative(),
|
|
20903
21100
|
/** Entries evicted by the active retention policy. */
|
|
20904
|
-
dropped:
|
|
20905
|
-
retention:
|
|
21101
|
+
dropped: z68.number().int().nonnegative(),
|
|
21102
|
+
retention: z68.enum(["process", "durable"]),
|
|
20906
21103
|
retentionPolicy: retentionPolicySchema.optional(),
|
|
20907
21104
|
/** Best-effort persistence failures observed by this store. */
|
|
20908
|
-
captureErrors:
|
|
20909
|
-
observedAt:
|
|
21105
|
+
captureErrors: z68.number().int().nonnegative().optional(),
|
|
21106
|
+
observedAt: z68.string().datetime()
|
|
20910
21107
|
}).strict();
|
|
20911
21108
|
var OPERATIONAL_LOG_FIELDS_HEADER = "x-canonry-log-fields";
|
|
20912
21109
|
var OPERATIONAL_LOG_OPT_IN_CONTEXT_FIELDS = ["provider"];
|
|
20913
|
-
var diagnosticContextReadSchema =
|
|
20914
|
-
var operationalLogEntryReadSchema =
|
|
20915
|
-
var operationalLogListReadSchema =
|
|
21110
|
+
var diagnosticContextReadSchema = z68.object(diagnosticContextSchema.shape);
|
|
21111
|
+
var operationalLogEntryReadSchema = z68.object({ ...operationalLogEntryDtoSchema.shape, context: diagnosticContextReadSchema });
|
|
21112
|
+
var operationalLogListReadSchema = z68.object({
|
|
20916
21113
|
...operationalLogListDtoSchema.shape,
|
|
20917
|
-
entries:
|
|
20918
|
-
retentionPolicy:
|
|
21114
|
+
entries: z68.array(operationalLogEntryReadSchema),
|
|
21115
|
+
retentionPolicy: z68.object(retentionPolicySchema.shape).optional()
|
|
20919
21116
|
});
|
|
20920
21117
|
|
|
20921
|
-
// ../contracts/src/log-redaction.ts
|
|
20922
|
-
var REDACTED = "[REDACTED]";
|
|
20923
|
-
var TRUNCATED = "[TRUNCATED]";
|
|
20924
|
-
var CIRCULAR = "[CIRCULAR]";
|
|
20925
|
-
var UNREADABLE = "[UNREADABLE]";
|
|
20926
|
-
var OMITTED = "[OMITTED]";
|
|
20927
|
-
var MAX_DEPTH = 6;
|
|
20928
|
-
var MAX_ARRAY_ITEMS = 50;
|
|
20929
|
-
var MAX_OBJECT_KEYS = 100;
|
|
20930
|
-
var MAX_STRING_LENGTH = 4096;
|
|
20931
|
-
var secretKey = /api[ _-]?key|authorization|auth(?:entication)?|cookie|password|secret|token|credential/i;
|
|
20932
|
-
var escapedSecretAssignment = /\\+["'][\w -]*(?:api[ _-]?key|auth|cookie|password|secret|token|credential)[\w -]*\\+["']\s*:/i;
|
|
20933
|
-
var unsafeGraphKey = /^(?:req|res|request|reply|raw|socket|headers?|body|responsebody|apiresponse|rawresponse|providerbody|providerresponse)$/i;
|
|
20934
|
-
var providerNameKey = /^provider$/i;
|
|
20935
|
-
function isSensitiveDiagnosticQueryKey(key) {
|
|
20936
|
-
return secretKey.test(key) || /^key$/i.test(key);
|
|
20937
|
-
}
|
|
20938
|
-
function redactLogValue(value) {
|
|
20939
|
-
try {
|
|
20940
|
-
return redactValue(value, 0, /* @__PURE__ */ new WeakSet());
|
|
20941
|
-
} catch {
|
|
20942
|
-
return UNREADABLE;
|
|
20943
|
-
}
|
|
20944
|
-
}
|
|
20945
|
-
function redactLogString(value) {
|
|
20946
|
-
try {
|
|
20947
|
-
const clipped = value.length > MAX_STRING_LENGTH ? `${value.slice(0, MAX_STRING_LENGTH)}${TRUNCATED}` : value;
|
|
20948
|
-
if (escapedSecretAssignment.test(clipped)) return REDACTED;
|
|
20949
|
-
return redactEmbeddedUrls(clipped).replace(/\b((?:set-cookie|cookie)\s*[:=]\s*)[^\r\n]*(?:\r?\n[ \t][^\r\n]*)*/gi, `$1${REDACTED}`).replace(
|
|
20950
|
-
/(["']?[\w-]*(?:api[ _-]?key|auth|cookie|password|secret|token|credential)[\w-]*["']?\s*[=:]\s*)(?:"(?:\\.|[^"\\])*(?:"|$)|'(?:\\.|[^'\\])*(?:'|$))/gi,
|
|
20951
|
-
`$1${REDACTED}`
|
|
20952
|
-
).replace(/\b(Bearer|Basic)\s+[^\s,;]+/gi, (_match, scheme) => `${scheme} ${REDACTED}`).replace(
|
|
20953
|
-
/(api[ _-]?key|authorization|auth(?:entication)?|cookie|password|secret|token|credential)\s*([=:])\s*(?!\[REDACTED\])[^\s&,'")\]}]+/gi,
|
|
20954
|
-
`$1$2${REDACTED}`
|
|
20955
|
-
).slice(0, MAX_STRING_LENGTH);
|
|
20956
|
-
} catch {
|
|
20957
|
-
return UNREADABLE;
|
|
20958
|
-
}
|
|
20959
|
-
}
|
|
20960
|
-
function redactValue(value, depth, seen, key) {
|
|
20961
|
-
if (key && diagnosticIdentity(key, value) !== void 0) return value;
|
|
20962
|
-
if (key && secretKey.test(key)) return REDACTED;
|
|
20963
|
-
if (key && unsafeGraphKey.test(key)) return OMITTED;
|
|
20964
|
-
if (key && providerNameKey.test(key) && typeof value === "object" && value !== null) return OMITTED;
|
|
20965
|
-
if (value === null || typeof value === "boolean") return value;
|
|
20966
|
-
if (typeof value === "number") return Number.isFinite(value) ? value : String(value);
|
|
20967
|
-
if (typeof value === "string") return redactLogString(value);
|
|
20968
|
-
if (typeof value === "bigint") return value.toString();
|
|
20969
|
-
if (typeof value === "undefined") return void 0;
|
|
20970
|
-
if (typeof value === "symbol" || typeof value === "function") return `[${typeof value}]`;
|
|
20971
|
-
if (depth >= MAX_DEPTH) return TRUNCATED;
|
|
20972
|
-
if (typeof value !== "object") return UNREADABLE;
|
|
20973
|
-
if (seen.has(value)) return CIRCULAR;
|
|
20974
|
-
seen.add(value);
|
|
20975
|
-
try {
|
|
20976
|
-
if (value instanceof Error) return redactError(value, depth, seen);
|
|
20977
|
-
if (Array.isArray(value)) {
|
|
20978
|
-
const output2 = [];
|
|
20979
|
-
const length = safeArrayLength(value);
|
|
20980
|
-
for (let index = 0; index < Math.min(length, MAX_ARRAY_ITEMS); index++) {
|
|
20981
|
-
output2.push(redactValue(safeProperty(value, String(index)), depth + 1, seen));
|
|
20982
|
-
}
|
|
20983
|
-
if (length > MAX_ARRAY_ITEMS) output2.push(TRUNCATED);
|
|
20984
|
-
return output2;
|
|
20985
|
-
}
|
|
20986
|
-
const output = {};
|
|
20987
|
-
const keys = safeKeys(value);
|
|
20988
|
-
for (const nestedKey of keys.slice(0, MAX_OBJECT_KEYS)) {
|
|
20989
|
-
output[nestedKey] = redactValue(safeProperty(value, nestedKey), depth + 1, seen, nestedKey);
|
|
20990
|
-
}
|
|
20991
|
-
if (keys.length > MAX_OBJECT_KEYS) output.__truncated = true;
|
|
20992
|
-
return output;
|
|
20993
|
-
} catch {
|
|
20994
|
-
return UNREADABLE;
|
|
20995
|
-
} finally {
|
|
20996
|
-
seen.delete(value);
|
|
20997
|
-
}
|
|
20998
|
-
}
|
|
20999
|
-
function diagnosticIdentity(key, value) {
|
|
21000
|
-
if (typeof value !== "string") return void 0;
|
|
21001
|
-
if (key === "actor" && /^(?:api-key|user):[\w.-]{1,256}$/.test(value)) return value;
|
|
21002
|
-
if (key === "credentialId" && /^[\w.-]{1,256}$/.test(value)) return value;
|
|
21003
|
-
return void 0;
|
|
21004
|
-
}
|
|
21005
|
-
function redactError(error, depth, seen) {
|
|
21006
|
-
const output = {
|
|
21007
|
-
name: redactLogString(safeErrorString(error, "name")),
|
|
21008
|
-
message: redactLogString(safeErrorString(error, "message"))
|
|
21009
|
-
};
|
|
21010
|
-
const stack = safeErrorString(error, "stack");
|
|
21011
|
-
if (stack) output.stack = redactLogString(stack);
|
|
21012
|
-
for (const key of safeKeys(error).slice(0, MAX_OBJECT_KEYS)) {
|
|
21013
|
-
output[key] = redactValue(safeProperty(error, key), depth + 1, seen, key);
|
|
21014
|
-
}
|
|
21015
|
-
return output;
|
|
21016
|
-
}
|
|
21017
|
-
function safeKeys(value) {
|
|
21018
|
-
try {
|
|
21019
|
-
return Object.keys(value);
|
|
21020
|
-
} catch {
|
|
21021
|
-
return [];
|
|
21022
|
-
}
|
|
21023
|
-
}
|
|
21024
|
-
function safeArrayLength(value) {
|
|
21025
|
-
try {
|
|
21026
|
-
return Number.isSafeInteger(value.length) && value.length >= 0 ? value.length : 0;
|
|
21027
|
-
} catch {
|
|
21028
|
-
return 0;
|
|
21029
|
-
}
|
|
21030
|
-
}
|
|
21031
|
-
function safeProperty(value, key) {
|
|
21032
|
-
try {
|
|
21033
|
-
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
21034
|
-
if (!descriptor || !("value" in descriptor)) return UNREADABLE;
|
|
21035
|
-
return descriptor.value;
|
|
21036
|
-
} catch {
|
|
21037
|
-
return UNREADABLE;
|
|
21038
|
-
}
|
|
21039
|
-
}
|
|
21040
|
-
function safeErrorString(error, key) {
|
|
21041
|
-
try {
|
|
21042
|
-
const value = error[key];
|
|
21043
|
-
return typeof value === "string" ? value : "";
|
|
21044
|
-
} catch {
|
|
21045
|
-
return UNREADABLE;
|
|
21046
|
-
}
|
|
21047
|
-
}
|
|
21048
|
-
function redactEmbeddedUrls(value) {
|
|
21049
|
-
return value.replace(/https?:\/\/[^\s<>"']+/gi, (candidate) => {
|
|
21050
|
-
if (candidate.includes(TRUNCATED)) return "[TRUNCATED_URL]";
|
|
21051
|
-
const suffix = candidate.match(/[),.;!?\]}]+$/)?.[0] ?? "";
|
|
21052
|
-
const rawUrl = suffix ? candidate.slice(0, -suffix.length) : candidate;
|
|
21053
|
-
try {
|
|
21054
|
-
const url = new URL(rawUrl);
|
|
21055
|
-
if (url.username || url.password) {
|
|
21056
|
-
url.username = REDACTED;
|
|
21057
|
-
url.password = REDACTED;
|
|
21058
|
-
}
|
|
21059
|
-
for (const key of [...url.searchParams.keys()]) {
|
|
21060
|
-
if (isSensitiveDiagnosticQueryKey(key)) url.searchParams.set(key, REDACTED);
|
|
21061
|
-
}
|
|
21062
|
-
return `${url.toString()}${suffix}`;
|
|
21063
|
-
} catch {
|
|
21064
|
-
return `[REDACTED_URL]${suffix}`;
|
|
21065
|
-
}
|
|
21066
|
-
});
|
|
21067
|
-
}
|
|
21068
|
-
|
|
21069
21118
|
// ../contracts/src/semver.ts
|
|
21070
21119
|
var STRICT_SEMVER = /^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-[\da-z-]+(?:\.[\da-z-]+)*)?(?:\+[\da-z-]+(?:\.[\da-z-]+)*)?$/i;
|
|
21071
21120
|
var MAX_SEMVER_LENGTH = 128;
|
|
@@ -21129,38 +21178,38 @@ function asRecord(value) {
|
|
|
21129
21178
|
}
|
|
21130
21179
|
|
|
21131
21180
|
// ../contracts/src/referral-assessment.ts
|
|
21132
|
-
import { z as
|
|
21133
|
-
var referralAssessmentQuerySchema =
|
|
21181
|
+
import { z as z69 } from "zod";
|
|
21182
|
+
var referralAssessmentQuerySchema = z69.object({
|
|
21134
21183
|
startDate: calendarDateSchema,
|
|
21135
21184
|
endDate: calendarDateSchema,
|
|
21136
|
-
sourceId:
|
|
21137
|
-
burstThreshold:
|
|
21138
|
-
ratioThreshold:
|
|
21139
|
-
limit:
|
|
21140
|
-
}).strict();
|
|
21141
|
-
var countsSchema =
|
|
21142
|
-
total:
|
|
21143
|
-
paid:
|
|
21144
|
-
organic:
|
|
21145
|
-
unknown:
|
|
21146
|
-
});
|
|
21147
|
-
var referralAssessmentSchema =
|
|
21148
|
-
scope:
|
|
21149
|
-
project:
|
|
21150
|
-
sourceId:
|
|
21151
|
-
attribution:
|
|
21152
|
-
unavailableDimensions:
|
|
21185
|
+
sourceId: z69.string().trim().min(1).optional(),
|
|
21186
|
+
burstThreshold: z69.number().int().min(1).max(1e6).optional(),
|
|
21187
|
+
ratioThreshold: z69.number().min(1).max(1e3).optional(),
|
|
21188
|
+
limit: z69.number().int().min(1).max(500).optional()
|
|
21189
|
+
}).strict();
|
|
21190
|
+
var countsSchema = z69.object({
|
|
21191
|
+
total: z69.number().int().nonnegative(),
|
|
21192
|
+
paid: z69.number().int().nonnegative(),
|
|
21193
|
+
organic: z69.number().int().nonnegative(),
|
|
21194
|
+
unknown: z69.number().int().nonnegative()
|
|
21195
|
+
});
|
|
21196
|
+
var referralAssessmentSchema = z69.object({
|
|
21197
|
+
scope: z69.object({
|
|
21198
|
+
project: z69.string(),
|
|
21199
|
+
sourceId: z69.string().nullable(),
|
|
21200
|
+
attribution: z69.literal("project-source-only"),
|
|
21201
|
+
unavailableDimensions: z69.array(z69.enum(["property", "target", "market"]))
|
|
21153
21202
|
}),
|
|
21154
|
-
window:
|
|
21155
|
-
rule:
|
|
21156
|
-
version:
|
|
21157
|
-
burstThreshold:
|
|
21158
|
-
ratioThreshold:
|
|
21159
|
-
calibration:
|
|
21160
|
-
grouping:
|
|
21161
|
-
confirmsAutomation:
|
|
21203
|
+
window: z69.object({ startDate: calendarDateSchema, endDate: calendarDateSchema, timeZone: z69.literal("UTC") }),
|
|
21204
|
+
rule: z69.object({
|
|
21205
|
+
version: z69.literal("hourly-normalized-path-v1"),
|
|
21206
|
+
burstThreshold: z69.number().int().positive(),
|
|
21207
|
+
ratioThreshold: z69.number().positive(),
|
|
21208
|
+
calibration: z69.enum(["uncalibrated-default", "request-override"]),
|
|
21209
|
+
grouping: z69.array(z69.string()),
|
|
21210
|
+
confirmsAutomation: z69.literal(false)
|
|
21162
21211
|
}),
|
|
21163
|
-
totals:
|
|
21212
|
+
totals: z69.object({
|
|
21164
21213
|
raw: countsSchema,
|
|
21165
21214
|
redirects: countsSchema,
|
|
21166
21215
|
subresources: countsSchema,
|
|
@@ -21168,42 +21217,42 @@ var referralAssessmentSchema = z68.object({
|
|
|
21168
21217
|
suspected: countsSchema,
|
|
21169
21218
|
adjustedEstimate: countsSchema
|
|
21170
21219
|
}),
|
|
21171
|
-
bursts:
|
|
21172
|
-
sourceId:
|
|
21173
|
-
product:
|
|
21174
|
-
landingPathNormalized:
|
|
21175
|
-
tsHour:
|
|
21220
|
+
bursts: z69.array(z69.object({
|
|
21221
|
+
sourceId: z69.string(),
|
|
21222
|
+
product: z69.string(),
|
|
21223
|
+
landingPathNormalized: z69.string(),
|
|
21224
|
+
tsHour: z69.string(),
|
|
21176
21225
|
counts: countsSchema
|
|
21177
21226
|
})),
|
|
21178
|
-
evidence:
|
|
21179
|
-
comparison:
|
|
21180
|
-
status:
|
|
21181
|
-
serverCountable:
|
|
21182
|
-
serverObservation:
|
|
21227
|
+
evidence: z69.object({ total: z69.number().int().nonnegative(), returned: z69.number().int().nonnegative(), truncated: z69.boolean() }),
|
|
21228
|
+
comparison: z69.object({
|
|
21229
|
+
status: z69.literal("unavailable"),
|
|
21230
|
+
serverCountable: z69.number().int().nonnegative(),
|
|
21231
|
+
serverObservation: z69.enum(["missing", "observed-zero", "observed-positive"]),
|
|
21183
21232
|
/**
|
|
21184
21233
|
* Dimension-deduplicated GA AI sessions. With no stored AI row in the
|
|
21185
21234
|
* window: `0` (`observed-zero`) when the latest GA sync queried the whole
|
|
21186
21235
|
* window (GA4 omits zero rows), else `null` (`missing`).
|
|
21187
21236
|
*/
|
|
21188
|
-
gaSessions:
|
|
21189
|
-
gaObservation:
|
|
21237
|
+
gaSessions: z69.number().int().nonnegative().nullable(),
|
|
21238
|
+
gaObservation: z69.enum(["missing", "observed-zero", "observed-positive"]),
|
|
21190
21239
|
/**
|
|
21191
21240
|
* Descriptive quotient only (`serverCountable / gaSessions`, a multiplier
|
|
21192
21241
|
* where 3 is three times as many, never a percent), rounded to 2
|
|
21193
21242
|
* decimals. Not a matched, coverage-complete comparison.
|
|
21194
21243
|
*/
|
|
21195
|
-
observedRatio:
|
|
21244
|
+
observedRatio: z69.number().nonnegative().nullable(),
|
|
21196
21245
|
/** Compares the rounded `observedRatio` with `rule.ratioThreshold`. */
|
|
21197
|
-
observedRatioAboveThreshold:
|
|
21198
|
-
ratio:
|
|
21199
|
-
reasons:
|
|
21200
|
-
gaScope:
|
|
21246
|
+
observedRatioAboveThreshold: z69.boolean().nullable(),
|
|
21247
|
+
ratio: z69.null(),
|
|
21248
|
+
reasons: z69.array(z69.string()),
|
|
21249
|
+
gaScope: z69.literal("project")
|
|
21201
21250
|
}),
|
|
21202
|
-
caveats:
|
|
21251
|
+
caveats: z69.array(z69.string())
|
|
21203
21252
|
});
|
|
21204
21253
|
|
|
21205
21254
|
// ../contracts/src/tolerant-read.ts
|
|
21206
|
-
import { z as
|
|
21255
|
+
import { z as z70 } from "zod";
|
|
21207
21256
|
var WRAPPER_TYPES = /* @__PURE__ */ new Set(["optional", "nullable", "default", "prefault", "readonly", "catch", "nonoptional"]);
|
|
21208
21257
|
var DEPTH_LIMIT = 64;
|
|
21209
21258
|
function defOf(schema) {
|
|
@@ -21214,9 +21263,9 @@ function cloneWith(schema, changes) {
|
|
|
21214
21263
|
}
|
|
21215
21264
|
function openPrimitive(values) {
|
|
21216
21265
|
if (values.length === 0) return void 0;
|
|
21217
|
-
if (values.every((value) => typeof value === "string")) return
|
|
21218
|
-
if (values.every((value) => typeof value === "number")) return
|
|
21219
|
-
if (values.every((value) => typeof value === "boolean")) return
|
|
21266
|
+
if (values.every((value) => typeof value === "string")) return z70.string();
|
|
21267
|
+
if (values.every((value) => typeof value === "number")) return z70.number();
|
|
21268
|
+
if (values.every((value) => typeof value === "boolean")) return z70.boolean();
|
|
21220
21269
|
return void 0;
|
|
21221
21270
|
}
|
|
21222
21271
|
function walk2(schema, open, memo, depth) {
|
|
@@ -21230,7 +21279,7 @@ function walk2(schema, open, memo, depth) {
|
|
|
21230
21279
|
const shape = Object.fromEntries(Object.entries(schema.shape).map(([key, child]) => [key, next(child)]));
|
|
21231
21280
|
const declared = def.catchall;
|
|
21232
21281
|
const catchall = open.get(schema) ?? (declared && defOf(declared).type !== "never" ? next(declared) : void 0);
|
|
21233
|
-
result = catchall ?
|
|
21282
|
+
result = catchall ? z70.object(shape).catchall(catchall) : z70.object(shape);
|
|
21234
21283
|
} else if (WRAPPER_TYPES.has(def.type)) {
|
|
21235
21284
|
const inner = def.innerType;
|
|
21236
21285
|
const mapped = next(inner);
|
|
@@ -21247,10 +21296,10 @@ function walk2(schema, open, memo, depth) {
|
|
|
21247
21296
|
const options = def.options;
|
|
21248
21297
|
const mapped = options.map(next);
|
|
21249
21298
|
const changed = mapped.some((option, index) => option !== options[index]);
|
|
21250
|
-
result = !changed ? schema : def.discriminator ?
|
|
21299
|
+
result = !changed ? schema : def.discriminator ? z70.union(mapped) : cloneWith(schema, { options: mapped });
|
|
21251
21300
|
} else if (def.type === "record") {
|
|
21252
21301
|
const keyType = def.keyType, valueType = def.valueType;
|
|
21253
|
-
const mappedKey = defOf(keyType).type === "enum" ?
|
|
21302
|
+
const mappedKey = defOf(keyType).type === "enum" ? z70.string() : keyType;
|
|
21254
21303
|
const mappedValue = next(valueType);
|
|
21255
21304
|
result = mappedKey === keyType && mappedValue === valueType ? schema : cloneWith(schema, { keyType: mappedKey, valueType: mappedValue });
|
|
21256
21305
|
} else if (def.type === "intersection") {
|
|
@@ -21266,7 +21315,7 @@ function walk2(schema, open, memo, depth) {
|
|
|
21266
21315
|
result = changed ? cloneWith(schema, { items: mappedItems, rest: mappedRest }) : schema;
|
|
21267
21316
|
} else if (def.type === "lazy") {
|
|
21268
21317
|
const getter = def.getter;
|
|
21269
|
-
result =
|
|
21318
|
+
result = z70.lazy(() => next(getter()));
|
|
21270
21319
|
} else if (def.type === "enum") {
|
|
21271
21320
|
result = openPrimitive(Object.values(def.entries)) ?? schema;
|
|
21272
21321
|
} else if (def.type === "literal") {
|
|
@@ -21281,8 +21330,8 @@ function tolerantReadSchema(schema, options = {}) {
|
|
|
21281
21330
|
}
|
|
21282
21331
|
|
|
21283
21332
|
// ../contracts/src/sentiment-read.ts
|
|
21284
|
-
import { z as
|
|
21285
|
-
var OPEN_COUNTS = { openKeys: [[sentimentCountsSchema,
|
|
21333
|
+
import { z as z71 } from "zod";
|
|
21334
|
+
var OPEN_COUNTS = { openKeys: [[sentimentCountsSchema, z71.number().int().nonnegative()]] };
|
|
21286
21335
|
var sentimentSettingsReadSchema = tolerantReadSchema(sentimentSettingsSchema, OPEN_COUNTS);
|
|
21287
21336
|
var sentimentSummaryReadSchema = tolerantReadSchema(sentimentSummarySchema, OPEN_COUNTS);
|
|
21288
21337
|
var sentimentEvidencePageReadSchema = tolerantReadSchema(sentimentEvidencePageSchema, OPEN_COUNTS);
|
|
@@ -22203,6 +22252,7 @@ export {
|
|
|
22203
22252
|
serializeForInlineScript,
|
|
22204
22253
|
classifyProviderErrorMessage,
|
|
22205
22254
|
classifyProviderErrorMessages,
|
|
22255
|
+
extractProviderHttpStatus,
|
|
22206
22256
|
telemetryStatusDtoSchema,
|
|
22207
22257
|
normalizeTelemetryStatus,
|
|
22208
22258
|
maskTelemetryAnonymousId,
|
|
@@ -22217,6 +22267,15 @@ export {
|
|
|
22217
22267
|
AGENT_NONE,
|
|
22218
22268
|
normalizeAgentSlug,
|
|
22219
22269
|
detectAgentRuntime,
|
|
22270
|
+
isSensitiveDiagnosticQueryKey,
|
|
22271
|
+
redactLogValue,
|
|
22272
|
+
redactLogString,
|
|
22273
|
+
diagnosticIdentity,
|
|
22274
|
+
FEEDBACK_KINDS,
|
|
22275
|
+
FEEDBACK_LIMITS,
|
|
22276
|
+
feedbackSubmissionSchema,
|
|
22277
|
+
feedbackAcceptedDtoSchema,
|
|
22278
|
+
redactFeedbackText,
|
|
22220
22279
|
MIN_TREND_POINTS,
|
|
22221
22280
|
isTrendBaseline,
|
|
22222
22281
|
ReportSectionIds,
|
|
@@ -22284,10 +22343,6 @@ export {
|
|
|
22284
22343
|
OPERATIONAL_LOG_FIELDS_HEADER,
|
|
22285
22344
|
OPERATIONAL_LOG_OPT_IN_CONTEXT_FIELDS,
|
|
22286
22345
|
operationalLogListReadSchema,
|
|
22287
|
-
isSensitiveDiagnosticQueryKey,
|
|
22288
|
-
redactLogValue,
|
|
22289
|
-
redactLogString,
|
|
22290
|
-
diagnosticIdentity,
|
|
22291
22346
|
isStrictSemver,
|
|
22292
22347
|
compareSemver,
|
|
22293
22348
|
CANONRY_NPM_PACKAGE_URL,
|