@canonry/canonry 7.17.1 → 7.17.2
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/assets/{AuditHistoryPanel-CzjskfMX.js → AuditHistoryPanel-Dga03Niw.js} +1 -1
- package/assets/assets/BacklinksPage-CfodWuIt.js +1 -0
- package/assets/assets/Hint-DICI5Jq9.js +1 -0
- package/assets/assets/{HistoryPage-BZgVoYGm.js → HistoryPage-BN_vTU5L.js} +1 -1
- package/assets/assets/{MeasurementPropertyPage-EBI5sn-D.js → MeasurementPropertyPage-CjiyzOmE.js} +1 -1
- package/assets/assets/{ProjectPage-lGGjM_qj.js → ProjectPage-AxclA3YC.js} +6 -6
- package/assets/assets/{RunsPage-CuHi8241.js → RunsPage-Ca_ziCGC.js} +1 -1
- package/assets/assets/{SettingsPage-D0fgAoVu.js → SettingsPage-SO1xl0d3.js} +1 -1
- package/assets/assets/SiteHealthSection-C9JgRzzs.js +4 -0
- package/assets/assets/{TrafficPage-DD65RqeR.js → TrafficPage-DrcbXNQB.js} +1 -1
- package/assets/assets/{TrafficSourceDetailPage-CFVCj13J.js → TrafficSourceDetailPage-HDZGKgyd.js} +1 -1
- package/assets/assets/{extract-error-message-D118msoE.js → extract-error-message-D48vwe7I.js} +1 -1
- package/assets/assets/index-BaBHBReI.js +86 -0
- package/assets/assets/{react-sigma_core.esm.min-DdlHLMEz.js → react-sigma_core.esm.min-DVHs4npB.js} +1 -1
- package/assets/assets/{v2-overview-adapter-CoCb2aB0.js → v2-overview-adapter-CTEXuiRt.js} +1 -1
- package/assets/assets/{vendor-lucide-N6vOpZmh.js → vendor-lucide-Y6jANGfG.js} +1 -1
- package/assets/index.html +2 -2
- package/dist/{chunk-ORA5R7QM.js → chunk-3LPQ4JV5.js} +130 -103
- package/dist/{chunk-OPJCFDNR.js → chunk-4EDH2ORA.js} +3 -3
- package/dist/{chunk-MHB23E3N.js → chunk-MIRAKDRW.js} +106 -79
- package/dist/{chunk-C6GWKYGE.js → chunk-NPNU6UHD.js} +5 -4
- package/dist/{chunk-PLS4EM2Y.js → chunk-P2XY5YX7.js} +2 -2
- package/dist/{chunk-FK7AWV57.js → chunk-QAIJH74T.js} +1 -1
- package/dist/{chunk-ZQ7C6IFA.js → chunk-YJS4OE6I.js} +614 -578
- package/dist/cli.js +13 -15
- package/dist/{demo-server-WQDHQG6P.js → demo-server-54SLPSJF.js} +6 -5
- package/dist/index.d.ts +7 -5
- package/dist/index.js +6 -6
- package/dist/{intelligence-service-JWZRZ6JZ.js → intelligence-service-62CEP6M2.js} +2 -2
- package/dist/mcp.js +4 -4
- package/package.json +14 -14
- package/assets/assets/BacklinksPage-ToENGBdp.js +0 -1
- package/assets/assets/SiteHealthSection-DhLxldgs.js +0 -4
- package/assets/assets/index-DxFd1t4G.js +0 -86
|
@@ -2918,6 +2918,14 @@ function getDomainWithoutSuffix2(url, options) {
|
|
|
2918
2918
|
return parseImpl(url, 5, suffixLookup, options, RESULT).domainWithoutSuffix;
|
|
2919
2919
|
}
|
|
2920
2920
|
|
|
2921
|
+
// ../contracts/src/text-order.ts
|
|
2922
|
+
function compareText(left, right) {
|
|
2923
|
+
return left < right ? -1 : left > right ? 1 : 0;
|
|
2924
|
+
}
|
|
2925
|
+
function sortedUnique(values) {
|
|
2926
|
+
return [...new Set(values)].sort(compareText);
|
|
2927
|
+
}
|
|
2928
|
+
|
|
2921
2929
|
// ../contracts/src/url-normalize.ts
|
|
2922
2930
|
var DOMAIN_PARSE_OPTIONS = { allowPrivateDomains: true };
|
|
2923
2931
|
var LINKIFY = new LinkifyIt({ fuzzyLink: true, fuzzyEmail: false }).tlds(tlds_default2);
|
|
@@ -3070,11 +3078,7 @@ function normalizeUrlPath(input) {
|
|
|
3070
3078
|
pathPart = collapseRootIndex(pathPart);
|
|
3071
3079
|
pathPart = dropTrailingSlash(pathPart);
|
|
3072
3080
|
const pairs = parseQuery(queryPart).filter((p) => !shouldStrip(p.key));
|
|
3073
|
-
pairs.sort((a, b) =>
|
|
3074
|
-
if (a.key < b.key) return -1;
|
|
3075
|
-
if (a.key > b.key) return 1;
|
|
3076
|
-
return 0;
|
|
3077
|
-
});
|
|
3081
|
+
pairs.sort((a, b) => compareText(a.key, b.key));
|
|
3078
3082
|
if (pairs.length === 0) return pathPart;
|
|
3079
3083
|
return `${pathPart}?${encodeQuery(pairs)}`;
|
|
3080
3084
|
}
|
|
@@ -3594,9 +3598,6 @@ var measurementPlanV2Schema = z6.object({
|
|
|
3594
3598
|
}
|
|
3595
3599
|
}
|
|
3596
3600
|
});
|
|
3597
|
-
function compareText(left, right) {
|
|
3598
|
-
return left < right ? -1 : left > right ? 1 : 0;
|
|
3599
|
-
}
|
|
3600
3601
|
function canonicalJsonValue(value) {
|
|
3601
3602
|
if (Array.isArray(value)) return value.map(canonicalJsonValue);
|
|
3602
3603
|
if (value && typeof value === "object") {
|
|
@@ -4028,9 +4029,6 @@ var measurementTargetQuerySelectionSchema = z7.object({
|
|
|
4028
4029
|
queryIds: z7.array(measurementQueryIdSchema).min(1),
|
|
4029
4030
|
context: locationContextSchema.nullable().optional()
|
|
4030
4031
|
}).strict();
|
|
4031
|
-
function compareText2(left, right) {
|
|
4032
|
-
return left < right ? -1 : left > right ? 1 : 0;
|
|
4033
|
-
}
|
|
4034
4032
|
function duplicateValues(values, normalize = (value) => value) {
|
|
4035
4033
|
const seen = /* @__PURE__ */ new Set();
|
|
4036
4034
|
const duplicates = /* @__PURE__ */ new Set();
|
|
@@ -4080,26 +4078,23 @@ function matcherCanonicalKey(matcher) {
|
|
|
4080
4078
|
function compareMatchers(left, right) {
|
|
4081
4079
|
const leftParts = matcherParts(left);
|
|
4082
4080
|
const rightParts = matcherParts(right);
|
|
4083
|
-
return
|
|
4081
|
+
return compareText(leftParts.host, rightParts.host) || matcherSpecificity(right) - matcherSpecificity(left) || compareText(leftParts.pathname ?? "", rightParts.pathname ?? "") || compareText(left.kind === "host" ? "" : left.pathCase, right.kind === "host" ? "" : right.pathCase);
|
|
4084
4082
|
}
|
|
4085
4083
|
function canonicalAliases(values) {
|
|
4086
4084
|
const seen = /* @__PURE__ */ new Set();
|
|
4087
|
-
return [...values].sort(
|
|
4085
|
+
return [...values].sort(compareText).filter((alias) => {
|
|
4088
4086
|
const key = brandKeyFromText(alias);
|
|
4089
4087
|
if (seen.has(key)) return false;
|
|
4090
4088
|
seen.add(key);
|
|
4091
4089
|
return true;
|
|
4092
4090
|
});
|
|
4093
4091
|
}
|
|
4094
|
-
function canonicalStrings(values) {
|
|
4095
|
-
return [...new Set(values)].sort(compareText2);
|
|
4096
|
-
}
|
|
4097
4092
|
function canonicalMatchers(values) {
|
|
4098
4093
|
return [...new Map(values.map((matcher) => [matcherCanonicalKey(matcher), matcher])).values()].sort(compareMatchers);
|
|
4099
4094
|
}
|
|
4100
4095
|
function canonicalMetadata(value) {
|
|
4101
4096
|
if (!value || Object.keys(value).length === 0) return void 0;
|
|
4102
|
-
return Object.fromEntries(Object.entries(value).sort(([left], [right]) =>
|
|
4097
|
+
return Object.fromEntries(Object.entries(value).sort(([left], [right]) => compareText(left, right)));
|
|
4103
4098
|
}
|
|
4104
4099
|
var measurementPlanAuthoringSchema = z7.object({
|
|
4105
4100
|
schemaVersion: z7.literal(MEASUREMENT_PLAN_SCHEMA_VERSION),
|
|
@@ -4262,7 +4257,7 @@ var measurementExecutionIdentitySchema = z7.object({
|
|
|
4262
4257
|
checksum: z7.string().regex(/^[a-f0-9]{64}$/)
|
|
4263
4258
|
}).strict();
|
|
4264
4259
|
function normalizeExecutionIdentity(input) {
|
|
4265
|
-
const providers =
|
|
4260
|
+
const providers = sortedUnique(input.providers.map((value) => value.trim().toLocaleLowerCase("en")).filter(Boolean));
|
|
4266
4261
|
const models = {};
|
|
4267
4262
|
for (const provider of providers) {
|
|
4268
4263
|
const model = input.models[provider];
|
|
@@ -4323,8 +4318,8 @@ function measurementRunScopeIsEmpty(scope) {
|
|
|
4323
4318
|
return !scope || (scope.groups?.length ?? 0) === 0 && (scope.targets?.length ?? 0) === 0;
|
|
4324
4319
|
}
|
|
4325
4320
|
function resolveMeasurementRunScope(plan, scope) {
|
|
4326
|
-
const requestedGroups =
|
|
4327
|
-
const requestedTargets =
|
|
4321
|
+
const requestedGroups = sortedUnique(scope.groups ?? []);
|
|
4322
|
+
const requestedTargets = sortedUnique(scope.targets ?? []);
|
|
4328
4323
|
const groupsByKey = new Map(plan.groups.map((group) => [group.stableKey, group]));
|
|
4329
4324
|
const targetKeys = new Set(plan.targets.map((target) => target.stableKey));
|
|
4330
4325
|
const unknownGroups = requestedGroups.filter((key) => !groupsByKey.has(key));
|
|
@@ -4343,7 +4338,7 @@ function resolveMeasurementRunScope(plan, scope) {
|
|
|
4343
4338
|
for (const key of requestedGroups) {
|
|
4344
4339
|
for (const targetKey of groupsByKey.get(key).targetKeys) selected.add(targetKey);
|
|
4345
4340
|
}
|
|
4346
|
-
const resolvedTargets = [...selected].sort(
|
|
4341
|
+
const resolvedTargets = [...selected].sort(compareText);
|
|
4347
4342
|
const usedNodeKeys = new Set(plan.usageEdges.filter((edge) => edge.kind !== "baseline" && selected.has(edge.targetKey)).map((edge) => edge.executionNodeKey));
|
|
4348
4343
|
const executionNodes = plan.executionNodes.filter((node) => usedNodeKeys.has(node.stableKey));
|
|
4349
4344
|
if (executionNodes.length === 0) {
|
|
@@ -4358,7 +4353,7 @@ function resolveMeasurementRunScope(plan, scope) {
|
|
|
4358
4353
|
};
|
|
4359
4354
|
}
|
|
4360
4355
|
function resolveMeasurementRunQueryScope(plan, queryTexts) {
|
|
4361
|
-
const requested =
|
|
4356
|
+
const requested = sortedUnique(queryTexts.map(normalizeMeasurementExecutionQueryText).filter(Boolean));
|
|
4362
4357
|
const nodesByText = /* @__PURE__ */ new Map();
|
|
4363
4358
|
for (const node of plan.executionNodes) {
|
|
4364
4359
|
const key = normalizeMeasurementExecutionQueryText(node.queryText);
|
|
@@ -4536,7 +4531,7 @@ function canonicalJsonValue2(value) {
|
|
|
4536
4531
|
if (Array.isArray(value)) return value.map(canonicalJsonValue2);
|
|
4537
4532
|
if (value && typeof value === "object") {
|
|
4538
4533
|
return Object.fromEntries(
|
|
4539
|
-
Object.entries(value).filter(([, child]) => child !== void 0).sort(([left], [right]) =>
|
|
4534
|
+
Object.entries(value).filter(([, child]) => child !== void 0).sort(([left], [right]) => compareText(left, right)).map(([key, child]) => [key, canonicalJsonValue2(child)])
|
|
4540
4535
|
);
|
|
4541
4536
|
}
|
|
4542
4537
|
return value;
|
|
@@ -4575,7 +4570,7 @@ function issuePathKey(path) {
|
|
|
4575
4570
|
return path.map((part) => String(part)).join("\0");
|
|
4576
4571
|
}
|
|
4577
4572
|
function sortedIssues(issues) {
|
|
4578
|
-
return [...issues].sort((left, right) =>
|
|
4573
|
+
return [...issues].sort((left, right) => compareText(issuePathKey(left.path), issuePathKey(right.path)) || compareText(left.message, right.message));
|
|
4579
4574
|
}
|
|
4580
4575
|
function throwValidation(issues) {
|
|
4581
4576
|
throw new MeasurementPlanValidationError(sortedIssues(issues));
|
|
@@ -4589,7 +4584,7 @@ function usageEdgeKey(edge) {
|
|
|
4589
4584
|
return [edge.kind, edge.targetKey ?? "", edge.queryId, edge.nodeSignature].join("\0");
|
|
4590
4585
|
}
|
|
4591
4586
|
function compareUsageEdges(left, right) {
|
|
4592
|
-
return
|
|
4587
|
+
return compareText(left.kind, right.kind) || compareText("targetKey" in left ? left.targetKey : "", "targetKey" in right ? right.targetKey : "") || compareText(left.queryId, right.queryId) || compareText(left.executionNodeKey, right.executionNodeKey);
|
|
4593
4588
|
}
|
|
4594
4589
|
function warningsForAliases(targets) {
|
|
4595
4590
|
const warnings = [];
|
|
@@ -4607,8 +4602,8 @@ function warningsForAliases(targets) {
|
|
|
4607
4602
|
warnings.push({
|
|
4608
4603
|
code: "target-alias-prefix-overlap",
|
|
4609
4604
|
message: "Target aliases overlap by mention prefix",
|
|
4610
|
-
targetKeys:
|
|
4611
|
-
aliases:
|
|
4605
|
+
targetKeys: sortedUnique([left.targetKey, right.targetKey]),
|
|
4606
|
+
aliases: sortedUnique([left.alias, right.alias])
|
|
4612
4607
|
});
|
|
4613
4608
|
}
|
|
4614
4609
|
}
|
|
@@ -4618,7 +4613,7 @@ function warningsForAliases(targets) {
|
|
|
4618
4613
|
const key = [warning.code, warning.targetKeys.join("\0"), warning.aliases.join("\0")].join("\0");
|
|
4619
4614
|
deduped.set(key, warning);
|
|
4620
4615
|
}
|
|
4621
|
-
return [...deduped.values()].sort((left, right) =>
|
|
4616
|
+
return [...deduped.values()].sort((left, right) => compareText(left.code, right.code) || compareText(left.targetKeys.join("\0"), right.targetKeys.join("\0")) || compareText(left.aliases.join("\0"), right.aliases.join("\0")));
|
|
4622
4617
|
}
|
|
4623
4618
|
function compileMeasurementPlan(input, context) {
|
|
4624
4619
|
const parsed = measurementPlanInputSchema.safeParse(input);
|
|
@@ -4645,7 +4640,7 @@ function compileMeasurementPlan(input, context) {
|
|
|
4645
4640
|
issues.push({ path: ["context", index === 0 ? "canonicalDomain" : "ownedDomains", index - 1], message: "Project owned domain is invalid" });
|
|
4646
4641
|
}
|
|
4647
4642
|
});
|
|
4648
|
-
const effectiveOwnedHosts =
|
|
4643
|
+
const effectiveOwnedHosts = sortedUnique(roots);
|
|
4649
4644
|
const projectBrandNames = canonicalAliases([
|
|
4650
4645
|
...(context.brandNames ?? []).filter((name) => brandKeyFromText(name).length > 0),
|
|
4651
4646
|
...effectiveOwnedHosts.map(brandLabelFromDomain).filter((name) => brandKeyFromText(name).length >= 4)
|
|
@@ -4727,7 +4722,7 @@ function compileMeasurementPlan(input, context) {
|
|
|
4727
4722
|
};
|
|
4728
4723
|
plan.targetQuerySelections.forEach((selection, selectionIndex) => {
|
|
4729
4724
|
const resolved = resolvedSelectionContexts.get(selectionIndex) ?? null;
|
|
4730
|
-
for (const queryId of
|
|
4725
|
+
for (const queryId of sortedUnique(selection.queryIds)) {
|
|
4731
4726
|
noteTargetQueryAssignment(selection.targetKey, queryId, resolved, ["targetQuerySelections", selectionIndex, "context"]);
|
|
4732
4727
|
}
|
|
4733
4728
|
});
|
|
@@ -4755,13 +4750,13 @@ function compileMeasurementPlan(input, context) {
|
|
|
4755
4750
|
...metadata ? { metadata } : {},
|
|
4756
4751
|
mentionNotApplicable: aliases.length === 0
|
|
4757
4752
|
};
|
|
4758
|
-
}).sort((left, right) =>
|
|
4753
|
+
}).sort((left, right) => compareText(left.stableKey, right.stableKey));
|
|
4759
4754
|
const groups = plan.groups.map((group) => ({
|
|
4760
4755
|
stableKey: group.stableKey,
|
|
4761
4756
|
label: group.label,
|
|
4762
|
-
targetKeys:
|
|
4763
|
-
...group.competitors && group.competitors.length > 0 ? { competitors:
|
|
4764
|
-
})).sort((left, right) =>
|
|
4757
|
+
targetKeys: sortedUnique(group.targetKeys),
|
|
4758
|
+
...group.competitors && group.competitors.length > 0 ? { competitors: sortedUnique(group.competitors) } : {}
|
|
4759
|
+
})).sort((left, right) => compareText(left.stableKey, right.stableKey));
|
|
4765
4760
|
const mergedSelections = /* @__PURE__ */ new Map();
|
|
4766
4761
|
plan.targetQuerySelections.forEach((selection, selectionIndex) => {
|
|
4767
4762
|
const resolvedContext = resolvedSelectionContexts.get(selectionIndex) ?? null;
|
|
@@ -4779,10 +4774,10 @@ function compileMeasurementPlan(input, context) {
|
|
|
4779
4774
|
});
|
|
4780
4775
|
const targetQuerySelections = [...mergedSelections.values()].map((selection) => ({
|
|
4781
4776
|
targetKey: selection.targetKey,
|
|
4782
|
-
queryIds:
|
|
4777
|
+
queryIds: sortedUnique([...selection.queryIds]),
|
|
4783
4778
|
...contextsEqual(selection.resolvedContext, defaultContext) ? {} : { context: selection.resolvedContext }
|
|
4784
|
-
})).sort((left, right) =>
|
|
4785
|
-
const querySnapshots = [...knownQueries.values()].map((query) => ({ queryId: query.queryId, queryText: query.queryText })).sort((left, right) =>
|
|
4779
|
+
})).sort((left, right) => compareText(left.targetKey, right.targetKey) || compareText(contextKey(resolveContext(left.context, defaultContext)), contextKey(resolveContext(right.context, defaultContext))) || compareText(left.queryIds.join("\0"), right.queryIds.join("\0")));
|
|
4780
|
+
const querySnapshots = [...knownQueries.values()].map((query) => ({ queryId: query.queryId, queryText: query.queryText })).sort((left, right) => compareText(left.queryId, right.queryId));
|
|
4786
4781
|
const pendingUsages = /* @__PURE__ */ new Map();
|
|
4787
4782
|
const nodeSeeds = /* @__PURE__ */ new Map();
|
|
4788
4783
|
const addUsage = (kind, queryId, resolvedContext, targetKey) => {
|
|
@@ -4796,9 +4791,9 @@ function compileMeasurementPlan(input, context) {
|
|
|
4796
4791
|
for (const query of querySnapshots) addUsage("baseline", query.queryId, defaultContext);
|
|
4797
4792
|
targetQuerySelections.forEach((selection) => {
|
|
4798
4793
|
const resolved = resolveContext(selection.context, defaultContext);
|
|
4799
|
-
for (const queryId of
|
|
4794
|
+
for (const queryId of sortedUnique(selection.queryIds)) addUsage("target", queryId, resolved, selection.targetKey);
|
|
4800
4795
|
});
|
|
4801
|
-
const executionNodes = [...nodeSeeds.entries()].sort(([left], [right]) =>
|
|
4796
|
+
const executionNodes = [...nodeSeeds.entries()].sort(([left], [right]) => compareText(left, right)).map(([signature, node]) => ({
|
|
4802
4797
|
stableKey: `execution-${base64UrlEncode(signature)}`,
|
|
4803
4798
|
queryText: node.queryText,
|
|
4804
4799
|
context: node.context,
|
|
@@ -6623,14 +6618,14 @@ var googleAdsEffectiveGoalGraphDtoSchema = z14.object({
|
|
|
6623
6618
|
derivedAt: z14.string(),
|
|
6624
6619
|
campaigns: z14.array(googleAdsEffectiveCampaignGoalDtoSchema)
|
|
6625
6620
|
}).strict();
|
|
6626
|
-
function
|
|
6621
|
+
function sortedUnique2(ids) {
|
|
6627
6622
|
return [...new Set(ids)].sort((left, right) => left.localeCompare(right));
|
|
6628
6623
|
}
|
|
6629
6624
|
function actionMembership(actionIds, actionsById) {
|
|
6630
6625
|
const primary = [];
|
|
6631
6626
|
const secondary = [];
|
|
6632
6627
|
const missing = [];
|
|
6633
|
-
for (const actionId of
|
|
6628
|
+
for (const actionId of sortedUnique2(actionIds)) {
|
|
6634
6629
|
const action = actionsById.get(actionId);
|
|
6635
6630
|
if (!action) {
|
|
6636
6631
|
missing.push(actionId);
|
|
@@ -6640,7 +6635,7 @@ function actionMembership(actionIds, actionsById) {
|
|
|
6640
6635
|
else secondary.push(actionId);
|
|
6641
6636
|
}
|
|
6642
6637
|
return {
|
|
6643
|
-
conversionActionIds:
|
|
6638
|
+
conversionActionIds: sortedUnique2(actionIds),
|
|
6644
6639
|
primaryConversionActionIds: primary,
|
|
6645
6640
|
secondaryConversionActionIds: secondary,
|
|
6646
6641
|
missingConversionActionIds: missing
|
|
@@ -9810,6 +9805,9 @@ var projectDtoSchema = z18.object({
|
|
|
9810
9805
|
createdAt: z18.string().optional(),
|
|
9811
9806
|
updatedAt: z18.string().optional()
|
|
9812
9807
|
});
|
|
9808
|
+
var projectDefaultLocationResponseSchema = z18.object({
|
|
9809
|
+
defaultLocation: z18.string()
|
|
9810
|
+
});
|
|
9813
9811
|
var queryDtoSchema = z18.object({
|
|
9814
9812
|
id: z18.string(),
|
|
9815
9813
|
query: z18.string(),
|
|
@@ -9830,7 +9828,15 @@ var queryGenerateRequestSchema = z18.object({
|
|
|
9830
9828
|
provider: providerNameSchema,
|
|
9831
9829
|
count: z18.number().int().min(1).max(20).optional()
|
|
9832
9830
|
});
|
|
9831
|
+
var queryGenerateResponseSchema = z18.object({
|
|
9832
|
+
queries: z18.array(z18.string()),
|
|
9833
|
+
provider: z18.string()
|
|
9834
|
+
});
|
|
9833
9835
|
var keywordGenerateRequestSchema = queryGenerateRequestSchema;
|
|
9836
|
+
var keywordGenerateResponseSchema = z18.object({
|
|
9837
|
+
keywords: z18.array(z18.string()),
|
|
9838
|
+
provider: z18.string()
|
|
9839
|
+
});
|
|
9834
9840
|
var competitorDtoSchema = z18.object({
|
|
9835
9841
|
id: z18.string(),
|
|
9836
9842
|
domain: z18.string(),
|
|
@@ -10165,7 +10171,7 @@ var configMetadataSchema = z22.object({
|
|
|
10165
10171
|
}),
|
|
10166
10172
|
labels: z22.record(z22.string(), z22.string()).optional().default({})
|
|
10167
10173
|
});
|
|
10168
|
-
var
|
|
10174
|
+
var configScheduleObjectSchema = z22.object({
|
|
10169
10175
|
preset: z22.string().min(1).optional(),
|
|
10170
10176
|
cron: z22.string().min(1).optional(),
|
|
10171
10177
|
recurrence: calendarRecurrenceSchema.optional(),
|
|
@@ -10179,10 +10185,12 @@ var configScheduleSchema = z22.object({
|
|
|
10179
10185
|
* to enabled.
|
|
10180
10186
|
*/
|
|
10181
10187
|
enabled: z22.boolean().optional()
|
|
10182
|
-
})
|
|
10183
|
-
|
|
10184
|
-
|
|
10185
|
-
|
|
10188
|
+
});
|
|
10189
|
+
function hasOneScheduleTiming(schedule) {
|
|
10190
|
+
return [schedule.preset, schedule.cron, schedule.recurrence].filter((value) => value !== void 0).length === 1;
|
|
10191
|
+
}
|
|
10192
|
+
var oneScheduleTimingMessage = { message: 'Exactly one of "preset", "cron", or "recurrence" must be provided' };
|
|
10193
|
+
var configScheduleSchema = configScheduleObjectSchema.refine(hasOneScheduleTiming, oneScheduleTimingMessage).optional();
|
|
10186
10194
|
var configNotificationSchema = z22.object({
|
|
10187
10195
|
channel: z22.literal("webhook"),
|
|
10188
10196
|
url: z22.string().url(),
|
|
@@ -10198,7 +10206,7 @@ var configGoogleSchema = z22.object({
|
|
|
10198
10206
|
}).optional()
|
|
10199
10207
|
}).optional();
|
|
10200
10208
|
var configQueryListSchema = z22.array(z22.string().min(1));
|
|
10201
|
-
var
|
|
10209
|
+
var configSpecShape = {
|
|
10202
10210
|
displayName: z22.string().min(1),
|
|
10203
10211
|
canonicalDomain: z22.string().min(1),
|
|
10204
10212
|
ownedDomains: z22.array(z22.string().min(1)).optional().default([]),
|
|
@@ -10242,7 +10250,8 @@ var configSpecSchema = z22.object({
|
|
|
10242
10250
|
* `preview`.
|
|
10243
10251
|
*/
|
|
10244
10252
|
competitorAutoAliases: competitorAutoAliasModeInputSchema
|
|
10245
|
-
}
|
|
10253
|
+
};
|
|
10254
|
+
function checkConfigSpec(spec, ctx) {
|
|
10246
10255
|
if (spec.queries !== void 0 && spec.keywords !== void 0) {
|
|
10247
10256
|
ctx.addIssue({
|
|
10248
10257
|
code: "custom",
|
|
@@ -10265,13 +10274,23 @@ var configSpecSchema = z22.object({
|
|
|
10265
10274
|
path: ["defaultLocation"]
|
|
10266
10275
|
});
|
|
10267
10276
|
}
|
|
10268
|
-
}
|
|
10277
|
+
}
|
|
10278
|
+
var configSpecSchema = z22.object(configSpecShape).superRefine(checkConfigSpec);
|
|
10269
10279
|
var projectConfigSchema = z22.object({
|
|
10270
10280
|
apiVersion: z22.literal("canonry/v1"),
|
|
10271
10281
|
kind: z22.literal("Project"),
|
|
10272
10282
|
metadata: configMetadataSchema,
|
|
10273
10283
|
spec: configSpecSchema
|
|
10274
10284
|
});
|
|
10285
|
+
var projectConfigExportSchema = projectConfigSchema.extend({
|
|
10286
|
+
spec: z22.object({
|
|
10287
|
+
...configSpecShape,
|
|
10288
|
+
queries: configQueryListSchema,
|
|
10289
|
+
providerModels: providerModelsSchema.optional(),
|
|
10290
|
+
schedule: configScheduleObjectSchema.extend({ enabled: z22.boolean() }).refine(hasOneScheduleTiming, oneScheduleTimingMessage).optional(),
|
|
10291
|
+
autoExtractBacklinks: z22.boolean().optional()
|
|
10292
|
+
}).superRefine(checkConfigSpec)
|
|
10293
|
+
});
|
|
10275
10294
|
function resolveConfigSpecQueries(spec) {
|
|
10276
10295
|
return spec.queries ?? spec.keywords ?? [];
|
|
10277
10296
|
}
|
|
@@ -10432,9 +10451,6 @@ function buildSimpleMeasurementDefinition(input) {
|
|
|
10432
10451
|
}))
|
|
10433
10452
|
});
|
|
10434
10453
|
}
|
|
10435
|
-
function compareText3(left, right) {
|
|
10436
|
-
return left < right ? -1 : left > right ? 1 : 0;
|
|
10437
|
-
}
|
|
10438
10454
|
function canonicalSimpleMeasurementDefinitionJson(definition) {
|
|
10439
10455
|
const parsed = simpleMeasurementDefinitionSchema.parse(definition);
|
|
10440
10456
|
return JSON.stringify({
|
|
@@ -10442,11 +10458,11 @@ function canonicalSimpleMeasurementDefinitionJson(definition) {
|
|
|
10442
10458
|
capturedAt: parsed.capturedAt,
|
|
10443
10459
|
identity: {
|
|
10444
10460
|
displayName: parsed.identity.displayName,
|
|
10445
|
-
aliases: [...parsed.identity.aliases].sort(
|
|
10461
|
+
aliases: [...parsed.identity.aliases].sort(compareText),
|
|
10446
10462
|
canonicalDomain: parsed.identity.canonicalDomain,
|
|
10447
|
-
ownedDomains: [...parsed.identity.ownedDomains].sort(
|
|
10463
|
+
ownedDomains: [...parsed.identity.ownedDomains].sort(compareText),
|
|
10448
10464
|
// Absent and empty serialize alike, so pre-feature checksums never move.
|
|
10449
|
-
...parsed.identity.qualifiedAliases?.length ? { qualifiedAliases: [...parsed.identity.qualifiedAliases].sort(
|
|
10465
|
+
...parsed.identity.qualifiedAliases?.length ? { qualifiedAliases: [...parsed.identity.qualifiedAliases].sort(compareText) } : {}
|
|
10450
10466
|
},
|
|
10451
10467
|
country: parsed.country,
|
|
10452
10468
|
language: parsed.language,
|
|
@@ -10457,20 +10473,20 @@ function canonicalSimpleMeasurementDefinitionJson(definition) {
|
|
|
10457
10473
|
country: parsed.location.country,
|
|
10458
10474
|
...parsed.location.timezone === void 0 ? {} : { timezone: parsed.location.timezone }
|
|
10459
10475
|
},
|
|
10460
|
-
engines: [...parsed.engines].map((engine) => ({ provider: engine.provider, requestedModel: engine.requestedModel })).sort((left, right) =>
|
|
10476
|
+
engines: [...parsed.engines].map((engine) => ({ provider: engine.provider, requestedModel: engine.requestedModel })).sort((left, right) => compareText(left.provider, right.provider)),
|
|
10461
10477
|
...parsed.competitors === void 0 ? {} : {
|
|
10462
10478
|
competitors: [...parsed.competitors].map((competitor) => ({
|
|
10463
10479
|
domain: competitor.domain,
|
|
10464
10480
|
label: competitor.label,
|
|
10465
|
-
aliases: [...competitor.aliases].sort(
|
|
10466
|
-
})).sort((left, right) =>
|
|
10481
|
+
aliases: [...competitor.aliases].sort(compareText)
|
|
10482
|
+
})).sort((left, right) => compareText(left.domain, right.domain))
|
|
10467
10483
|
},
|
|
10468
10484
|
queries: [...parsed.queries].map((query) => ({
|
|
10469
10485
|
queryId: query.queryId,
|
|
10470
10486
|
queryText: query.queryText,
|
|
10471
10487
|
provenance: query.provenance,
|
|
10472
10488
|
queryClass: query.queryClass
|
|
10473
|
-
})).sort((left, right) =>
|
|
10489
|
+
})).sort((left, right) => compareText(left.queryId, right.queryId))
|
|
10474
10490
|
});
|
|
10475
10491
|
}
|
|
10476
10492
|
|
|
@@ -11301,8 +11317,7 @@ function parseMeasurementRunManifestV1(value) {
|
|
|
11301
11317
|
return measurementRunManifestV1Schema.parse(value);
|
|
11302
11318
|
}
|
|
11303
11319
|
function buildMeasurementRunManifestV1(input) {
|
|
11304
|
-
const
|
|
11305
|
-
const expectedSlots = [...input.expectedSlots].map((slot) => measurementExpectedSlotV1Schema.parse(slot)).sort((left, right) => compareText5(left.executionId, right.executionId) || compareText5(left.provider, right.provider) || compareText5(left.queryText, right.queryText) || compareText5(left.context?.label ?? "", right.context?.label ?? "") || compareText5(left.requestedModel ?? "", right.requestedModel ?? ""));
|
|
11320
|
+
const expectedSlots = [...input.expectedSlots].map((slot) => measurementExpectedSlotV1Schema.parse(slot)).sort((left, right) => compareText(left.executionId, right.executionId) || compareText(left.provider, right.provider) || compareText(left.queryText, right.queryText) || compareText(left.context?.label ?? "", right.context?.label ?? "") || compareText(left.requestedModel ?? "", right.requestedModel ?? ""));
|
|
11306
11321
|
return measurementRunManifestV1Schema.parse({ schemaVersion: 1, expectedSlots });
|
|
11307
11322
|
}
|
|
11308
11323
|
var measurementCompletenessSchema = z26.object({
|
|
@@ -13332,7 +13347,7 @@ function countOf(value) {
|
|
|
13332
13347
|
function dayOf(value) {
|
|
13333
13348
|
return typeof value === "string" && value.trim().length >= 10 ? value.trim().slice(0, 10) : null;
|
|
13334
13349
|
}
|
|
13335
|
-
function
|
|
13350
|
+
function sortedUnique3(days) {
|
|
13336
13351
|
return [...new Set(days.filter((d) => d !== null))].sort();
|
|
13337
13352
|
}
|
|
13338
13353
|
function normalizeEngineChange(provider, entry, engineName) {
|
|
@@ -13355,11 +13370,11 @@ function normalizeEngineChange(provider, entry, engineName) {
|
|
|
13355
13370
|
if (perChange.length > 0) {
|
|
13356
13371
|
return {
|
|
13357
13372
|
...common,
|
|
13358
|
-
confirmedDates:
|
|
13359
|
-
unconfirmedDates:
|
|
13373
|
+
confirmedDates: sortedUnique3(perChange.filter((c) => c.confirmed !== false).map((c) => dayOf(c.date))),
|
|
13374
|
+
unconfirmedDates: sortedUnique3(perChange.filter((c) => c.confirmed === false).map((c) => dayOf(c.date)))
|
|
13360
13375
|
};
|
|
13361
13376
|
}
|
|
13362
|
-
const span =
|
|
13377
|
+
const span = sortedUnique3([dayOf(entry.firstChangeDate), dayOf(entry.lastChangeDate)]);
|
|
13363
13378
|
if (changeCount === 0) return { ...common, confirmedDates: [], unconfirmedDates: [] };
|
|
13364
13379
|
if (unconfirmedCount === 0) return { ...common, confirmedDates: span, unconfirmedDates: [] };
|
|
13365
13380
|
if (common.confirmedCount === 0) return { ...common, confirmedDates: [], unconfirmedDates: span };
|
|
@@ -14628,6 +14643,11 @@ function isRetryableHttpError(err) {
|
|
|
14628
14643
|
return true;
|
|
14629
14644
|
}
|
|
14630
14645
|
|
|
14646
|
+
// ../contracts/src/regexp.ts
|
|
14647
|
+
function escapeRegExp(str) {
|
|
14648
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
14649
|
+
}
|
|
14650
|
+
|
|
14631
14651
|
// ../contracts/src/concurrency.ts
|
|
14632
14652
|
async function mapWithConcurrency(items, concurrency, fn) {
|
|
14633
14653
|
if (items.length === 0) return [];
|
|
@@ -14796,6 +14816,10 @@ var wordpressPageSummaryDtoSchema = z39.object({
|
|
|
14796
14816
|
modifiedAt: z39.string().nullable().optional(),
|
|
14797
14817
|
link: z39.string().nullable().optional()
|
|
14798
14818
|
});
|
|
14819
|
+
var wordpressPageListDtoSchema = z39.object({
|
|
14820
|
+
env: wordpressEnvSchema,
|
|
14821
|
+
pages: z39.array(wordpressPageSummaryDtoSchema)
|
|
14822
|
+
});
|
|
14799
14823
|
var wordpressSeoStateDtoSchema = z39.object({
|
|
14800
14824
|
title: z39.string().nullable(),
|
|
14801
14825
|
description: z39.string().nullable(),
|
|
@@ -15131,9 +15155,6 @@ function batchDispatchRefusalMessage(ineligible) {
|
|
|
15131
15155
|
].join(" ");
|
|
15132
15156
|
}
|
|
15133
15157
|
var PRICING_TIER_ORDER = [PricingTiers.standard, PricingTiers.batch];
|
|
15134
|
-
function compareText4(left, right) {
|
|
15135
|
-
return left < right ? -1 : left > right ? 1 : 0;
|
|
15136
|
-
}
|
|
15137
15158
|
function summarizeRunUsage(rows) {
|
|
15138
15159
|
const groups = /* @__PURE__ */ new Map();
|
|
15139
15160
|
for (const row of rows) {
|
|
@@ -15164,7 +15185,7 @@ function summarizeRunUsage(rows) {
|
|
|
15164
15185
|
}
|
|
15165
15186
|
groups.set(key, group);
|
|
15166
15187
|
}
|
|
15167
|
-
return [...groups.values()].sort((left, right) =>
|
|
15188
|
+
return [...groups.values()].sort((left, right) => compareText(left.provider, right.provider) || PRICING_TIER_ORDER.indexOf(left.pricingTier) - PRICING_TIER_ORDER.indexOf(right.pricingTier));
|
|
15168
15189
|
}
|
|
15169
15190
|
|
|
15170
15191
|
// ../contracts/src/snapshot.ts
|
|
@@ -19123,6 +19144,9 @@ function deriveIndexCoverage(input) {
|
|
|
19123
19144
|
function normalizeQueryText(value) {
|
|
19124
19145
|
return value.trim().toLowerCase();
|
|
19125
19146
|
}
|
|
19147
|
+
function normalizeIdentityText(value) {
|
|
19148
|
+
return value.normalize("NFKC").trim().replace(/\s+/g, " ").toLocaleLowerCase("en");
|
|
19149
|
+
}
|
|
19126
19150
|
|
|
19127
19151
|
// ../contracts/src/query-counts.ts
|
|
19128
19152
|
function summarizeObservedQueryCounts(snapshots) {
|
|
@@ -20654,14 +20678,9 @@ var adsActivationAdGroupSchema = adsActivationEntityRefSchema.extend({
|
|
|
20654
20678
|
var adsActivationCampaignSchema = adsActivationEntityRefSchema.extend({
|
|
20655
20679
|
adGroups: z65.array(adsActivationAdGroupSchema).min(1).max(ADS_ACTIVATION_ABSOLUTE_MAX_ENTITIES - 1)
|
|
20656
20680
|
}).strict();
|
|
20657
|
-
function compareAdsActivationEntityIds(left, right) {
|
|
20658
|
-
if (left < right) return -1;
|
|
20659
|
-
if (left > right) return 1;
|
|
20660
|
-
return 0;
|
|
20661
|
-
}
|
|
20662
20681
|
function addCanonicalEntityOrderIssue(items, path, ctx) {
|
|
20663
20682
|
for (let index = 1; index < items.length; index += 1) {
|
|
20664
|
-
if (
|
|
20683
|
+
if (compareText(items[index - 1].id, items[index].id) >= 0) {
|
|
20665
20684
|
ctx.addIssue({
|
|
20666
20685
|
code: "custom",
|
|
20667
20686
|
path,
|
|
@@ -20708,8 +20727,8 @@ function canonicalizeAdsActivationManifest(manifest) {
|
|
|
20708
20727
|
adGroups: manifest.campaign.adGroups.map((group) => ({
|
|
20709
20728
|
id: group.id,
|
|
20710
20729
|
expectedUpdatedAt: group.expectedUpdatedAt,
|
|
20711
|
-
ads: group.ads.map((ad) => ({ id: ad.id, expectedUpdatedAt: ad.expectedUpdatedAt })).sort((left, right) =>
|
|
20712
|
-
})).sort((left, right) =>
|
|
20730
|
+
ads: group.ads.map((ad) => ({ id: ad.id, expectedUpdatedAt: ad.expectedUpdatedAt })).sort((left, right) => compareText(left.id, right.id))
|
|
20731
|
+
})).sort((left, right) => compareText(left.id, right.id))
|
|
20713
20732
|
}
|
|
20714
20733
|
};
|
|
20715
20734
|
}
|
|
@@ -22553,6 +22572,8 @@ export {
|
|
|
22553
22572
|
AI_ENGINE_SELF_DOMAINS,
|
|
22554
22573
|
VERTEX_AI_SEARCH_PROXY_DOMAIN,
|
|
22555
22574
|
AI_PROVIDER_INFRA_DOMAINS,
|
|
22575
|
+
compareText,
|
|
22576
|
+
sortedUnique,
|
|
22556
22577
|
hostOf,
|
|
22557
22578
|
registrableDomain,
|
|
22558
22579
|
normalizeProjectDomain,
|
|
@@ -22829,12 +22850,15 @@ export {
|
|
|
22829
22850
|
projectCreateRequestSchema,
|
|
22830
22851
|
normalizeProjectName,
|
|
22831
22852
|
projectDtoSchema,
|
|
22853
|
+
projectDefaultLocationResponseSchema,
|
|
22832
22854
|
queryDtoSchema,
|
|
22833
22855
|
keywordDtoSchema,
|
|
22834
22856
|
queryBatchRequestSchema,
|
|
22835
22857
|
keywordBatchRequestSchema,
|
|
22836
22858
|
queryGenerateRequestSchema,
|
|
22859
|
+
queryGenerateResponseSchema,
|
|
22837
22860
|
keywordGenerateRequestSchema,
|
|
22861
|
+
keywordGenerateResponseSchema,
|
|
22838
22862
|
competitorDtoSchema,
|
|
22839
22863
|
competitorBatchRequestSchema,
|
|
22840
22864
|
competitorAppendRequestSchema,
|
|
@@ -22844,6 +22868,7 @@ export {
|
|
|
22844
22868
|
effectiveBrandNames,
|
|
22845
22869
|
competitorAliasProjectIdentity,
|
|
22846
22870
|
projectConfigSchema,
|
|
22871
|
+
projectConfigExportSchema,
|
|
22847
22872
|
resolveConfigSpecQueries,
|
|
22848
22873
|
simpleMeasurementDefinitionSchema,
|
|
22849
22874
|
simpleMeasurementCompetitorNames,
|
|
@@ -23039,6 +23064,7 @@ export {
|
|
|
23039
23064
|
withRetry,
|
|
23040
23065
|
retryAfterDelayMs,
|
|
23041
23066
|
isRetryableHttpError,
|
|
23067
|
+
escapeRegExp,
|
|
23042
23068
|
mapWithConcurrency,
|
|
23043
23069
|
bingUrlInspectionDtoSchema,
|
|
23044
23070
|
bingCoverageSummaryDtoSchema,
|
|
@@ -23052,7 +23078,7 @@ export {
|
|
|
23052
23078
|
cdpStatusDtoSchema,
|
|
23053
23079
|
wordpressEnvSchema,
|
|
23054
23080
|
wordpressStatusDtoSchema,
|
|
23055
|
-
|
|
23081
|
+
wordpressPageListDtoSchema,
|
|
23056
23082
|
wordpressSchemaBlockDtoSchema,
|
|
23057
23083
|
wordpressPageDetailDtoSchema,
|
|
23058
23084
|
wordpressManualAssistDtoSchema,
|
|
@@ -23274,6 +23300,7 @@ export {
|
|
|
23274
23300
|
groupIsoDateRanges,
|
|
23275
23301
|
deriveIndexCoverage,
|
|
23276
23302
|
normalizeQueryText,
|
|
23303
|
+
normalizeIdentityText,
|
|
23277
23304
|
summarizeObservedQueryCounts,
|
|
23278
23305
|
citationVisibilityResponseSchema,
|
|
23279
23306
|
emptyCitationVisibility,
|
|
@@ -5,16 +5,17 @@ import {
|
|
|
5
5
|
siteCrawlGraphNodes,
|
|
6
6
|
siteCrawlPages,
|
|
7
7
|
siteCrawlSnapshots
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-YJS4OE6I.js";
|
|
9
9
|
import {
|
|
10
10
|
SITE_CRAWL_GRAPH_MAX_EDGES,
|
|
11
11
|
SITE_CRAWL_GRAPH_MAX_NODES,
|
|
12
12
|
SiteAuditFactorStatuses,
|
|
13
13
|
TEMPLATE_LINK_RATIO_THRESHOLD,
|
|
14
|
+
compareText,
|
|
14
15
|
factorStatusFromDistribution,
|
|
15
16
|
factorStatusFromScore,
|
|
16
17
|
roundPreservingTotal
|
|
17
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-MIRAKDRW.js";
|
|
18
19
|
|
|
19
20
|
// src/site-audit-factors.ts
|
|
20
21
|
function recordedSharePct(factor) {
|
|
@@ -354,7 +355,7 @@ function siteCrawlGraphComponents(nodeKeys, edges) {
|
|
|
354
355
|
if (group) group.push(key);
|
|
355
356
|
else members.set(root, [key]);
|
|
356
357
|
}
|
|
357
|
-
return [...members.values()].sort((left, right) => right.length - left.length || (left[0]
|
|
358
|
+
return [...members.values()].sort((left, right) => right.length - left.length || compareText(left[0], right[0]));
|
|
358
359
|
}
|
|
359
360
|
function describeComponent(nodeKeys, byKey) {
|
|
360
361
|
let sumX = 0;
|
|
@@ -383,7 +384,7 @@ function packSiteCrawlGraphComponents(positions, edges, nodeSpacing) {
|
|
|
383
384
|
const described = components.map((nodeKeys) => describeComponent(nodeKeys, byKey));
|
|
384
385
|
const [anchor, ...rest] = described;
|
|
385
386
|
const spacing = Math.max(nodeSpacing, Number.EPSILON) * COMPONENT_PACKING_SPACING_FACTOR;
|
|
386
|
-
const ordered = [...rest].sort((left, right) => right.radius - left.radius || (left.nodeKeys[0]
|
|
387
|
+
const ordered = [...rest].sort((left, right) => right.radius - left.radius || compareText(left.nodeKeys[0], right.nodeKeys[0]));
|
|
387
388
|
const moved = /* @__PURE__ */ new Map();
|
|
388
389
|
let ringRadius = anchor.radius + spacing;
|
|
389
390
|
let ringPitch = 0;
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
PACKAGE_VERSION,
|
|
6
6
|
canonryMcpTools,
|
|
7
7
|
isMachineFormat
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-QAIJH74T.js";
|
|
9
9
|
import {
|
|
10
10
|
AGENT_PROVIDER_IDS,
|
|
11
11
|
CANONRY_NPM_PACKAGE_URL,
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
skillsClientSchema,
|
|
51
51
|
upgradeCaveatFor,
|
|
52
52
|
upgradeCommandFor
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-MIRAKDRW.js";
|
|
54
54
|
|
|
55
55
|
// src/config.ts
|
|
56
56
|
import fs from "fs";
|