@canonry/canonry 6.2.0 → 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 +12 -0
- package/assets/assets/{AuditHistoryPanel-CuEMfkaA.js → AuditHistoryPanel-BUYWIjlG.js} +1 -1
- package/assets/assets/{BacklinksPage-CftadZ1-.js → BacklinksPage-aBcxpN_9.js} +1 -1
- package/assets/assets/{HistoryPage-DouRgshN.js → HistoryPage-PoBuxiY_.js} +1 -1
- package/assets/assets/{MeasurementPropertyPage-qfqv2qs9.js → MeasurementPropertyPage-DyjyqHac.js} +1 -1
- package/assets/assets/{ProjectPage-DqEVwe4t.js → ProjectPage-Mmv5YW-K.js} +1 -1
- package/assets/assets/{RunsPage-CUkMs0gB.js → RunsPage-CHHxOpzo.js} +1 -1
- package/assets/assets/{SettingsPage-LLQ40tSh.js → SettingsPage-CNKnrLXC.js} +1 -1
- package/assets/assets/{SiteHealthSection-Ba7foDiU.js → SiteHealthSection-C9RivT7G.js} +3 -3
- package/assets/assets/{TrafficPage-Cu_ZR3--.js → TrafficPage-CY-ibXnb.js} +1 -1
- package/assets/assets/{TrafficSourceDetailPage-NKZq7jf9.js → TrafficSourceDetailPage-BgiPXubs.js} +1 -1
- package/assets/assets/{extract-error-message-BdQYrz9N.js → extract-error-message-H1dzzfBP.js} +1 -1
- package/assets/assets/{index-HOeLz1ZL.js → index-DSCun3I9.js} +21 -21
- package/assets/assets/{react-sigma_core.esm.min-CZaoE5cU.js → react-sigma_core.esm.min-uiYtR_DU.js} +1 -1
- package/assets/assets/{v2-overview-adapter-BVx4nI49.js → v2-overview-adapter-BQokN2eb.js} +1 -1
- package/assets/index.html +1 -1
- package/dist/{chunk-Y2B7JRSB.js → chunk-5GY5WBAF.js} +3 -3
- package/dist/{chunk-W3GDZZNF.js → chunk-DERWXLHX.js} +15 -1
- package/dist/{chunk-6EPN4XY5.js → chunk-EV5G5QRR.js} +324 -280
- package/dist/{chunk-4EKOKWQT.js → chunk-FSRVG2H7.js} +2 -2
- package/dist/{chunk-2RFHQ6XT.js → chunk-OTROA7CN.js} +199 -106
- package/dist/{chunk-ENI3GOWW.js → chunk-QVGG76UW.js} +78 -24
- package/dist/{chunk-V6JUBTNL.js → chunk-ZZEPF3A5.js} +23 -3
- package/dist/cli.js +53 -8
- package/dist/{demo-server-CH7MOBXW.js → demo-server-5MNLI6GC.js} +4 -4
- package/dist/index.js +6 -6
- package/dist/{intelligence-service-4IONMOFB.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))
|
|
@@ -20105,6 +20105,193 @@ function detectAgentRuntime(env) {
|
|
|
20105
20105
|
return AGENT_NONE;
|
|
20106
20106
|
}
|
|
20107
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
|
+
|
|
20108
20295
|
// ../contracts/src/trend-stability.ts
|
|
20109
20296
|
var MIN_TREND_POINTS = 4;
|
|
20110
20297
|
function isTrendBaseline(points) {
|
|
@@ -20112,14 +20299,14 @@ function isTrendBaseline(points) {
|
|
|
20112
20299
|
}
|
|
20113
20300
|
|
|
20114
20301
|
// ../contracts/src/report-sections.ts
|
|
20115
|
-
import { z as
|
|
20302
|
+
import { z as z67 } from "zod";
|
|
20116
20303
|
var CLIENT_AUDIENCE = reportAudienceSchema.enum.client;
|
|
20117
20304
|
var BOTH_AUDIENCES = reportActionAudienceSchema.enum.both;
|
|
20118
20305
|
var ADVANCED_MODE = visibilityReportResolvedModeSchema.enum.advanced;
|
|
20119
20306
|
function pluralize(count2, singular, plural = `${singular}s`) {
|
|
20120
20307
|
return count2 === 1 ? singular : plural;
|
|
20121
20308
|
}
|
|
20122
|
-
var reportSectionIdSchema =
|
|
20309
|
+
var reportSectionIdSchema = z67.enum([
|
|
20123
20310
|
"client-summary",
|
|
20124
20311
|
"executive-summary",
|
|
20125
20312
|
"share-of-voice",
|
|
@@ -20842,240 +21029,92 @@ var REPORT_SECTION_COPY = {
|
|
|
20842
21029
|
};
|
|
20843
21030
|
|
|
20844
21031
|
// ../contracts/src/operational-logs.ts
|
|
20845
|
-
import { z as
|
|
20846
|
-
var operationalLogLevelSchema =
|
|
20847
|
-
var diagnosticContextSchema =
|
|
20848
|
-
runId:
|
|
20849
|
-
projectId:
|
|
20850
|
-
requestId:
|
|
20851
|
-
actor:
|
|
20852
|
-
credentialId:
|
|
20853
|
-
userAgent:
|
|
20854
|
-
actorSession:
|
|
20855
|
-
method:
|
|
20856
|
-
route:
|
|
20857
|
-
operationId:
|
|
20858
|
-
jobId:
|
|
20859
|
-
taskId:
|
|
20860
|
-
traceId:
|
|
20861
|
-
provider:
|
|
20862
|
-
errorCode:
|
|
20863
|
-
attempt:
|
|
20864
|
-
count:
|
|
20865
|
-
total:
|
|
20866
|
-
progress:
|
|
20867
|
-
httpStatus:
|
|
20868
|
-
statusCode:
|
|
20869
|
-
durationMs:
|
|
20870
|
-
bytes:
|
|
20871
|
-
retryAfterMs:
|
|
20872
|
-
retriable:
|
|
20873
|
-
retrying:
|
|
20874
|
-
cancelled:
|
|
20875
|
-
success:
|
|
20876
|
-
}).strict();
|
|
20877
|
-
var operationalLogEntryDtoSchema =
|
|
20878
|
-
cursor:
|
|
20879
|
-
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(),
|
|
20880
21067
|
level: operationalLogLevelSchema,
|
|
20881
|
-
module:
|
|
20882
|
-
action:
|
|
20883
|
-
message:
|
|
20884
|
-
runId:
|
|
20885
|
-
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(),
|
|
20886
21073
|
context: diagnosticContextSchema
|
|
20887
21074
|
}).strict();
|
|
20888
|
-
var logQuerySchema =
|
|
21075
|
+
var logQuerySchema = z68.object({
|
|
20889
21076
|
level: operationalLogLevelSchema.optional(),
|
|
20890
|
-
module:
|
|
20891
|
-
runId:
|
|
20892
|
-
projectId:
|
|
20893
|
-
actor:
|
|
20894
|
-
requestId:
|
|
20895
|
-
since:
|
|
20896
|
-
until:
|
|
20897
|
-
limit:
|
|
20898
|
-
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()
|
|
20899
21086
|
}).strict().superRefine((query, ctx) => {
|
|
20900
21087
|
if (query.since && query.until && Date.parse(query.since) > Date.parse(query.until)) {
|
|
20901
|
-
ctx.addIssue({ code:
|
|
21088
|
+
ctx.addIssue({ code: z68.ZodIssueCode.custom, path: ["until"], message: '"until" must be on or after "since".' });
|
|
20902
21089
|
}
|
|
20903
21090
|
});
|
|
20904
|
-
var retentionPolicySchema =
|
|
20905
|
-
maxEntries:
|
|
20906
|
-
maxAgeSeconds:
|
|
21091
|
+
var retentionPolicySchema = z68.object({
|
|
21092
|
+
maxEntries: z68.number().int().positive(),
|
|
21093
|
+
maxAgeSeconds: z68.number().int().positive()
|
|
20907
21094
|
}).strict();
|
|
20908
|
-
var operationalLogListDtoSchema =
|
|
20909
|
-
entries:
|
|
20910
|
-
nextCursor:
|
|
21095
|
+
var operationalLogListDtoSchema = z68.object({
|
|
21096
|
+
entries: z68.array(operationalLogEntryDtoSchema),
|
|
21097
|
+
nextCursor: z68.string().min(1).max(512).nullable(),
|
|
20911
21098
|
/** Matching entries left after this page. */
|
|
20912
|
-
truncated:
|
|
21099
|
+
truncated: z68.number().int().nonnegative(),
|
|
20913
21100
|
/** Entries evicted by the active retention policy. */
|
|
20914
|
-
dropped:
|
|
20915
|
-
retention:
|
|
21101
|
+
dropped: z68.number().int().nonnegative(),
|
|
21102
|
+
retention: z68.enum(["process", "durable"]),
|
|
20916
21103
|
retentionPolicy: retentionPolicySchema.optional(),
|
|
20917
21104
|
/** Best-effort persistence failures observed by this store. */
|
|
20918
|
-
captureErrors:
|
|
20919
|
-
observedAt:
|
|
21105
|
+
captureErrors: z68.number().int().nonnegative().optional(),
|
|
21106
|
+
observedAt: z68.string().datetime()
|
|
20920
21107
|
}).strict();
|
|
20921
21108
|
var OPERATIONAL_LOG_FIELDS_HEADER = "x-canonry-log-fields";
|
|
20922
21109
|
var OPERATIONAL_LOG_OPT_IN_CONTEXT_FIELDS = ["provider"];
|
|
20923
|
-
var diagnosticContextReadSchema =
|
|
20924
|
-
var operationalLogEntryReadSchema =
|
|
20925
|
-
var operationalLogListReadSchema =
|
|
21110
|
+
var diagnosticContextReadSchema = z68.object(diagnosticContextSchema.shape);
|
|
21111
|
+
var operationalLogEntryReadSchema = z68.object({ ...operationalLogEntryDtoSchema.shape, context: diagnosticContextReadSchema });
|
|
21112
|
+
var operationalLogListReadSchema = z68.object({
|
|
20926
21113
|
...operationalLogListDtoSchema.shape,
|
|
20927
|
-
entries:
|
|
20928
|
-
retentionPolicy:
|
|
21114
|
+
entries: z68.array(operationalLogEntryReadSchema),
|
|
21115
|
+
retentionPolicy: z68.object(retentionPolicySchema.shape).optional()
|
|
20929
21116
|
});
|
|
20930
21117
|
|
|
20931
|
-
// ../contracts/src/log-redaction.ts
|
|
20932
|
-
var REDACTED = "[REDACTED]";
|
|
20933
|
-
var TRUNCATED = "[TRUNCATED]";
|
|
20934
|
-
var CIRCULAR = "[CIRCULAR]";
|
|
20935
|
-
var UNREADABLE = "[UNREADABLE]";
|
|
20936
|
-
var OMITTED = "[OMITTED]";
|
|
20937
|
-
var MAX_DEPTH = 6;
|
|
20938
|
-
var MAX_ARRAY_ITEMS = 50;
|
|
20939
|
-
var MAX_OBJECT_KEYS = 100;
|
|
20940
|
-
var MAX_STRING_LENGTH = 4096;
|
|
20941
|
-
var secretKey = /api[ _-]?key|authorization|auth(?:entication)?|cookie|password|secret|token|credential/i;
|
|
20942
|
-
var escapedSecretAssignment = /\\+["'][\w -]*(?:api[ _-]?key|auth|cookie|password|secret|token|credential)[\w -]*\\+["']\s*:/i;
|
|
20943
|
-
var unsafeGraphKey = /^(?:req|res|request|reply|raw|socket|headers?|body|responsebody|apiresponse|rawresponse|providerbody|providerresponse)$/i;
|
|
20944
|
-
var providerNameKey = /^provider$/i;
|
|
20945
|
-
function isSensitiveDiagnosticQueryKey(key) {
|
|
20946
|
-
return secretKey.test(key) || /^key$/i.test(key);
|
|
20947
|
-
}
|
|
20948
|
-
function redactLogValue(value) {
|
|
20949
|
-
try {
|
|
20950
|
-
return redactValue(value, 0, /* @__PURE__ */ new WeakSet());
|
|
20951
|
-
} catch {
|
|
20952
|
-
return UNREADABLE;
|
|
20953
|
-
}
|
|
20954
|
-
}
|
|
20955
|
-
function redactLogString(value) {
|
|
20956
|
-
try {
|
|
20957
|
-
const clipped = value.length > MAX_STRING_LENGTH ? `${value.slice(0, MAX_STRING_LENGTH)}${TRUNCATED}` : value;
|
|
20958
|
-
if (escapedSecretAssignment.test(clipped)) return REDACTED;
|
|
20959
|
-
return redactEmbeddedUrls(clipped).replace(/\b((?:set-cookie|cookie)\s*[:=]\s*)[^\r\n]*(?:\r?\n[ \t][^\r\n]*)*/gi, `$1${REDACTED}`).replace(
|
|
20960
|
-
/(["']?[\w-]*(?:api[ _-]?key|auth|cookie|password|secret|token|credential)[\w-]*["']?\s*[=:]\s*)(?:"(?:\\.|[^"\\])*(?:"|$)|'(?:\\.|[^'\\])*(?:'|$))/gi,
|
|
20961
|
-
`$1${REDACTED}`
|
|
20962
|
-
).replace(/\b(Bearer|Basic)\s+[^\s,;]+/gi, (_match, scheme) => `${scheme} ${REDACTED}`).replace(
|
|
20963
|
-
/(api[ _-]?key|authorization|auth(?:entication)?|cookie|password|secret|token|credential)\s*([=:])\s*(?!\[REDACTED\])[^\s&,'")\]}]+/gi,
|
|
20964
|
-
`$1$2${REDACTED}`
|
|
20965
|
-
).slice(0, MAX_STRING_LENGTH);
|
|
20966
|
-
} catch {
|
|
20967
|
-
return UNREADABLE;
|
|
20968
|
-
}
|
|
20969
|
-
}
|
|
20970
|
-
function redactValue(value, depth, seen, key) {
|
|
20971
|
-
if (key && diagnosticIdentity(key, value) !== void 0) return value;
|
|
20972
|
-
if (key && secretKey.test(key)) return REDACTED;
|
|
20973
|
-
if (key && unsafeGraphKey.test(key)) return OMITTED;
|
|
20974
|
-
if (key && providerNameKey.test(key) && typeof value === "object" && value !== null) return OMITTED;
|
|
20975
|
-
if (value === null || typeof value === "boolean") return value;
|
|
20976
|
-
if (typeof value === "number") return Number.isFinite(value) ? value : String(value);
|
|
20977
|
-
if (typeof value === "string") return redactLogString(value);
|
|
20978
|
-
if (typeof value === "bigint") return value.toString();
|
|
20979
|
-
if (typeof value === "undefined") return void 0;
|
|
20980
|
-
if (typeof value === "symbol" || typeof value === "function") return `[${typeof value}]`;
|
|
20981
|
-
if (depth >= MAX_DEPTH) return TRUNCATED;
|
|
20982
|
-
if (typeof value !== "object") return UNREADABLE;
|
|
20983
|
-
if (seen.has(value)) return CIRCULAR;
|
|
20984
|
-
seen.add(value);
|
|
20985
|
-
try {
|
|
20986
|
-
if (value instanceof Error) return redactError(value, depth, seen);
|
|
20987
|
-
if (Array.isArray(value)) {
|
|
20988
|
-
const output2 = [];
|
|
20989
|
-
const length = safeArrayLength(value);
|
|
20990
|
-
for (let index = 0; index < Math.min(length, MAX_ARRAY_ITEMS); index++) {
|
|
20991
|
-
output2.push(redactValue(safeProperty(value, String(index)), depth + 1, seen));
|
|
20992
|
-
}
|
|
20993
|
-
if (length > MAX_ARRAY_ITEMS) output2.push(TRUNCATED);
|
|
20994
|
-
return output2;
|
|
20995
|
-
}
|
|
20996
|
-
const output = {};
|
|
20997
|
-
const keys = safeKeys(value);
|
|
20998
|
-
for (const nestedKey of keys.slice(0, MAX_OBJECT_KEYS)) {
|
|
20999
|
-
output[nestedKey] = redactValue(safeProperty(value, nestedKey), depth + 1, seen, nestedKey);
|
|
21000
|
-
}
|
|
21001
|
-
if (keys.length > MAX_OBJECT_KEYS) output.__truncated = true;
|
|
21002
|
-
return output;
|
|
21003
|
-
} catch {
|
|
21004
|
-
return UNREADABLE;
|
|
21005
|
-
} finally {
|
|
21006
|
-
seen.delete(value);
|
|
21007
|
-
}
|
|
21008
|
-
}
|
|
21009
|
-
function diagnosticIdentity(key, value) {
|
|
21010
|
-
if (typeof value !== "string") return void 0;
|
|
21011
|
-
if (key === "actor" && /^(?:api-key|user):[\w.-]{1,256}$/.test(value)) return value;
|
|
21012
|
-
if (key === "credentialId" && /^[\w.-]{1,256}$/.test(value)) return value;
|
|
21013
|
-
return void 0;
|
|
21014
|
-
}
|
|
21015
|
-
function redactError(error, depth, seen) {
|
|
21016
|
-
const output = {
|
|
21017
|
-
name: redactLogString(safeErrorString(error, "name")),
|
|
21018
|
-
message: redactLogString(safeErrorString(error, "message"))
|
|
21019
|
-
};
|
|
21020
|
-
const stack = safeErrorString(error, "stack");
|
|
21021
|
-
if (stack) output.stack = redactLogString(stack);
|
|
21022
|
-
for (const key of safeKeys(error).slice(0, MAX_OBJECT_KEYS)) {
|
|
21023
|
-
output[key] = redactValue(safeProperty(error, key), depth + 1, seen, key);
|
|
21024
|
-
}
|
|
21025
|
-
return output;
|
|
21026
|
-
}
|
|
21027
|
-
function safeKeys(value) {
|
|
21028
|
-
try {
|
|
21029
|
-
return Object.keys(value);
|
|
21030
|
-
} catch {
|
|
21031
|
-
return [];
|
|
21032
|
-
}
|
|
21033
|
-
}
|
|
21034
|
-
function safeArrayLength(value) {
|
|
21035
|
-
try {
|
|
21036
|
-
return Number.isSafeInteger(value.length) && value.length >= 0 ? value.length : 0;
|
|
21037
|
-
} catch {
|
|
21038
|
-
return 0;
|
|
21039
|
-
}
|
|
21040
|
-
}
|
|
21041
|
-
function safeProperty(value, key) {
|
|
21042
|
-
try {
|
|
21043
|
-
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
21044
|
-
if (!descriptor || !("value" in descriptor)) return UNREADABLE;
|
|
21045
|
-
return descriptor.value;
|
|
21046
|
-
} catch {
|
|
21047
|
-
return UNREADABLE;
|
|
21048
|
-
}
|
|
21049
|
-
}
|
|
21050
|
-
function safeErrorString(error, key) {
|
|
21051
|
-
try {
|
|
21052
|
-
const value = error[key];
|
|
21053
|
-
return typeof value === "string" ? value : "";
|
|
21054
|
-
} catch {
|
|
21055
|
-
return UNREADABLE;
|
|
21056
|
-
}
|
|
21057
|
-
}
|
|
21058
|
-
function redactEmbeddedUrls(value) {
|
|
21059
|
-
return value.replace(/https?:\/\/[^\s<>"']+/gi, (candidate) => {
|
|
21060
|
-
if (candidate.includes(TRUNCATED)) return "[TRUNCATED_URL]";
|
|
21061
|
-
const suffix = candidate.match(/[),.;!?\]}]+$/)?.[0] ?? "";
|
|
21062
|
-
const rawUrl = suffix ? candidate.slice(0, -suffix.length) : candidate;
|
|
21063
|
-
try {
|
|
21064
|
-
const url = new URL(rawUrl);
|
|
21065
|
-
if (url.username || url.password) {
|
|
21066
|
-
url.username = REDACTED;
|
|
21067
|
-
url.password = REDACTED;
|
|
21068
|
-
}
|
|
21069
|
-
for (const key of [...url.searchParams.keys()]) {
|
|
21070
|
-
if (isSensitiveDiagnosticQueryKey(key)) url.searchParams.set(key, REDACTED);
|
|
21071
|
-
}
|
|
21072
|
-
return `${url.toString()}${suffix}`;
|
|
21073
|
-
} catch {
|
|
21074
|
-
return `[REDACTED_URL]${suffix}`;
|
|
21075
|
-
}
|
|
21076
|
-
});
|
|
21077
|
-
}
|
|
21078
|
-
|
|
21079
21118
|
// ../contracts/src/semver.ts
|
|
21080
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;
|
|
21081
21120
|
var MAX_SEMVER_LENGTH = 128;
|
|
@@ -21139,38 +21178,38 @@ function asRecord(value) {
|
|
|
21139
21178
|
}
|
|
21140
21179
|
|
|
21141
21180
|
// ../contracts/src/referral-assessment.ts
|
|
21142
|
-
import { z as
|
|
21143
|
-
var referralAssessmentQuerySchema =
|
|
21181
|
+
import { z as z69 } from "zod";
|
|
21182
|
+
var referralAssessmentQuerySchema = z69.object({
|
|
21144
21183
|
startDate: calendarDateSchema,
|
|
21145
21184
|
endDate: calendarDateSchema,
|
|
21146
|
-
sourceId:
|
|
21147
|
-
burstThreshold:
|
|
21148
|
-
ratioThreshold:
|
|
21149
|
-
limit:
|
|
21150
|
-
}).strict();
|
|
21151
|
-
var countsSchema =
|
|
21152
|
-
total:
|
|
21153
|
-
paid:
|
|
21154
|
-
organic:
|
|
21155
|
-
unknown:
|
|
21156
|
-
});
|
|
21157
|
-
var referralAssessmentSchema =
|
|
21158
|
-
scope:
|
|
21159
|
-
project:
|
|
21160
|
-
sourceId:
|
|
21161
|
-
attribution:
|
|
21162
|
-
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"]))
|
|
21163
21202
|
}),
|
|
21164
|
-
window:
|
|
21165
|
-
rule:
|
|
21166
|
-
version:
|
|
21167
|
-
burstThreshold:
|
|
21168
|
-
ratioThreshold:
|
|
21169
|
-
calibration:
|
|
21170
|
-
grouping:
|
|
21171
|
-
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)
|
|
21172
21211
|
}),
|
|
21173
|
-
totals:
|
|
21212
|
+
totals: z69.object({
|
|
21174
21213
|
raw: countsSchema,
|
|
21175
21214
|
redirects: countsSchema,
|
|
21176
21215
|
subresources: countsSchema,
|
|
@@ -21178,42 +21217,42 @@ var referralAssessmentSchema = z68.object({
|
|
|
21178
21217
|
suspected: countsSchema,
|
|
21179
21218
|
adjustedEstimate: countsSchema
|
|
21180
21219
|
}),
|
|
21181
|
-
bursts:
|
|
21182
|
-
sourceId:
|
|
21183
|
-
product:
|
|
21184
|
-
landingPathNormalized:
|
|
21185
|
-
tsHour:
|
|
21220
|
+
bursts: z69.array(z69.object({
|
|
21221
|
+
sourceId: z69.string(),
|
|
21222
|
+
product: z69.string(),
|
|
21223
|
+
landingPathNormalized: z69.string(),
|
|
21224
|
+
tsHour: z69.string(),
|
|
21186
21225
|
counts: countsSchema
|
|
21187
21226
|
})),
|
|
21188
|
-
evidence:
|
|
21189
|
-
comparison:
|
|
21190
|
-
status:
|
|
21191
|
-
serverCountable:
|
|
21192
|
-
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"]),
|
|
21193
21232
|
/**
|
|
21194
21233
|
* Dimension-deduplicated GA AI sessions. With no stored AI row in the
|
|
21195
21234
|
* window: `0` (`observed-zero`) when the latest GA sync queried the whole
|
|
21196
21235
|
* window (GA4 omits zero rows), else `null` (`missing`).
|
|
21197
21236
|
*/
|
|
21198
|
-
gaSessions:
|
|
21199
|
-
gaObservation:
|
|
21237
|
+
gaSessions: z69.number().int().nonnegative().nullable(),
|
|
21238
|
+
gaObservation: z69.enum(["missing", "observed-zero", "observed-positive"]),
|
|
21200
21239
|
/**
|
|
21201
21240
|
* Descriptive quotient only (`serverCountable / gaSessions`, a multiplier
|
|
21202
21241
|
* where 3 is three times as many, never a percent), rounded to 2
|
|
21203
21242
|
* decimals. Not a matched, coverage-complete comparison.
|
|
21204
21243
|
*/
|
|
21205
|
-
observedRatio:
|
|
21244
|
+
observedRatio: z69.number().nonnegative().nullable(),
|
|
21206
21245
|
/** Compares the rounded `observedRatio` with `rule.ratioThreshold`. */
|
|
21207
|
-
observedRatioAboveThreshold:
|
|
21208
|
-
ratio:
|
|
21209
|
-
reasons:
|
|
21210
|
-
gaScope:
|
|
21246
|
+
observedRatioAboveThreshold: z69.boolean().nullable(),
|
|
21247
|
+
ratio: z69.null(),
|
|
21248
|
+
reasons: z69.array(z69.string()),
|
|
21249
|
+
gaScope: z69.literal("project")
|
|
21211
21250
|
}),
|
|
21212
|
-
caveats:
|
|
21251
|
+
caveats: z69.array(z69.string())
|
|
21213
21252
|
});
|
|
21214
21253
|
|
|
21215
21254
|
// ../contracts/src/tolerant-read.ts
|
|
21216
|
-
import { z as
|
|
21255
|
+
import { z as z70 } from "zod";
|
|
21217
21256
|
var WRAPPER_TYPES = /* @__PURE__ */ new Set(["optional", "nullable", "default", "prefault", "readonly", "catch", "nonoptional"]);
|
|
21218
21257
|
var DEPTH_LIMIT = 64;
|
|
21219
21258
|
function defOf(schema) {
|
|
@@ -21224,9 +21263,9 @@ function cloneWith(schema, changes) {
|
|
|
21224
21263
|
}
|
|
21225
21264
|
function openPrimitive(values) {
|
|
21226
21265
|
if (values.length === 0) return void 0;
|
|
21227
|
-
if (values.every((value) => typeof value === "string")) return
|
|
21228
|
-
if (values.every((value) => typeof value === "number")) return
|
|
21229
|
-
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();
|
|
21230
21269
|
return void 0;
|
|
21231
21270
|
}
|
|
21232
21271
|
function walk2(schema, open, memo, depth) {
|
|
@@ -21240,7 +21279,7 @@ function walk2(schema, open, memo, depth) {
|
|
|
21240
21279
|
const shape = Object.fromEntries(Object.entries(schema.shape).map(([key, child]) => [key, next(child)]));
|
|
21241
21280
|
const declared = def.catchall;
|
|
21242
21281
|
const catchall = open.get(schema) ?? (declared && defOf(declared).type !== "never" ? next(declared) : void 0);
|
|
21243
|
-
result = catchall ?
|
|
21282
|
+
result = catchall ? z70.object(shape).catchall(catchall) : z70.object(shape);
|
|
21244
21283
|
} else if (WRAPPER_TYPES.has(def.type)) {
|
|
21245
21284
|
const inner = def.innerType;
|
|
21246
21285
|
const mapped = next(inner);
|
|
@@ -21257,10 +21296,10 @@ function walk2(schema, open, memo, depth) {
|
|
|
21257
21296
|
const options = def.options;
|
|
21258
21297
|
const mapped = options.map(next);
|
|
21259
21298
|
const changed = mapped.some((option, index) => option !== options[index]);
|
|
21260
|
-
result = !changed ? schema : def.discriminator ?
|
|
21299
|
+
result = !changed ? schema : def.discriminator ? z70.union(mapped) : cloneWith(schema, { options: mapped });
|
|
21261
21300
|
} else if (def.type === "record") {
|
|
21262
21301
|
const keyType = def.keyType, valueType = def.valueType;
|
|
21263
|
-
const mappedKey = defOf(keyType).type === "enum" ?
|
|
21302
|
+
const mappedKey = defOf(keyType).type === "enum" ? z70.string() : keyType;
|
|
21264
21303
|
const mappedValue = next(valueType);
|
|
21265
21304
|
result = mappedKey === keyType && mappedValue === valueType ? schema : cloneWith(schema, { keyType: mappedKey, valueType: mappedValue });
|
|
21266
21305
|
} else if (def.type === "intersection") {
|
|
@@ -21276,7 +21315,7 @@ function walk2(schema, open, memo, depth) {
|
|
|
21276
21315
|
result = changed ? cloneWith(schema, { items: mappedItems, rest: mappedRest }) : schema;
|
|
21277
21316
|
} else if (def.type === "lazy") {
|
|
21278
21317
|
const getter = def.getter;
|
|
21279
|
-
result =
|
|
21318
|
+
result = z70.lazy(() => next(getter()));
|
|
21280
21319
|
} else if (def.type === "enum") {
|
|
21281
21320
|
result = openPrimitive(Object.values(def.entries)) ?? schema;
|
|
21282
21321
|
} else if (def.type === "literal") {
|
|
@@ -21291,8 +21330,8 @@ function tolerantReadSchema(schema, options = {}) {
|
|
|
21291
21330
|
}
|
|
21292
21331
|
|
|
21293
21332
|
// ../contracts/src/sentiment-read.ts
|
|
21294
|
-
import { z as
|
|
21295
|
-
var OPEN_COUNTS = { openKeys: [[sentimentCountsSchema,
|
|
21333
|
+
import { z as z71 } from "zod";
|
|
21334
|
+
var OPEN_COUNTS = { openKeys: [[sentimentCountsSchema, z71.number().int().nonnegative()]] };
|
|
21296
21335
|
var sentimentSettingsReadSchema = tolerantReadSchema(sentimentSettingsSchema, OPEN_COUNTS);
|
|
21297
21336
|
var sentimentSummaryReadSchema = tolerantReadSchema(sentimentSummarySchema, OPEN_COUNTS);
|
|
21298
21337
|
var sentimentEvidencePageReadSchema = tolerantReadSchema(sentimentEvidencePageSchema, OPEN_COUNTS);
|
|
@@ -22228,6 +22267,15 @@ export {
|
|
|
22228
22267
|
AGENT_NONE,
|
|
22229
22268
|
normalizeAgentSlug,
|
|
22230
22269
|
detectAgentRuntime,
|
|
22270
|
+
isSensitiveDiagnosticQueryKey,
|
|
22271
|
+
redactLogValue,
|
|
22272
|
+
redactLogString,
|
|
22273
|
+
diagnosticIdentity,
|
|
22274
|
+
FEEDBACK_KINDS,
|
|
22275
|
+
FEEDBACK_LIMITS,
|
|
22276
|
+
feedbackSubmissionSchema,
|
|
22277
|
+
feedbackAcceptedDtoSchema,
|
|
22278
|
+
redactFeedbackText,
|
|
22231
22279
|
MIN_TREND_POINTS,
|
|
22232
22280
|
isTrendBaseline,
|
|
22233
22281
|
ReportSectionIds,
|
|
@@ -22295,10 +22343,6 @@ export {
|
|
|
22295
22343
|
OPERATIONAL_LOG_FIELDS_HEADER,
|
|
22296
22344
|
OPERATIONAL_LOG_OPT_IN_CONTEXT_FIELDS,
|
|
22297
22345
|
operationalLogListReadSchema,
|
|
22298
|
-
isSensitiveDiagnosticQueryKey,
|
|
22299
|
-
redactLogValue,
|
|
22300
|
-
redactLogString,
|
|
22301
|
-
diagnosticIdentity,
|
|
22302
22346
|
isStrictSemver,
|
|
22303
22347
|
compareSemver,
|
|
22304
22348
|
CANONRY_NPM_PACKAGE_URL,
|