@canonry/canonry 7.17.0 → 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.
Files changed (35) hide show
  1. package/assets/assets/{AuditHistoryPanel-CUde9U_6.js → AuditHistoryPanel-Dga03Niw.js} +1 -1
  2. package/assets/assets/BacklinksPage-CfodWuIt.js +1 -0
  3. package/assets/assets/Hint-DICI5Jq9.js +1 -0
  4. package/assets/assets/{HistoryPage-DZSa1gYf.js → HistoryPage-BN_vTU5L.js} +1 -1
  5. package/assets/assets/{MeasurementPropertyPage-DgW17Jpd.js → MeasurementPropertyPage-CjiyzOmE.js} +1 -1
  6. package/assets/assets/ProjectPage-AxclA3YC.js +8 -0
  7. package/assets/assets/{RunsPage-DRfNd-Jp.js → RunsPage-Ca_ziCGC.js} +1 -1
  8. package/assets/assets/{SettingsPage-D38Gl1Nv.js → SettingsPage-SO1xl0d3.js} +1 -1
  9. package/assets/assets/SiteHealthSection-C9JgRzzs.js +4 -0
  10. package/assets/assets/{TrafficPage-DX3qRPgQ.js → TrafficPage-DrcbXNQB.js} +2 -2
  11. package/assets/assets/{TrafficSourceDetailPage-CigB82vX.js → TrafficSourceDetailPage-HDZGKgyd.js} +1 -1
  12. package/assets/assets/{extract-error-message-DsMnnkxT.js → extract-error-message-D48vwe7I.js} +1 -1
  13. package/assets/assets/index-BaBHBReI.js +86 -0
  14. package/assets/assets/{react-sigma_core.esm.min-CkYxzGpi.js → react-sigma_core.esm.min-DVHs4npB.js} +1 -1
  15. package/assets/assets/{v2-overview-adapter-5x8UiA07.js → v2-overview-adapter-CTEXuiRt.js} +1 -1
  16. package/assets/assets/{vendor-lucide-N6vOpZmh.js → vendor-lucide-Y6jANGfG.js} +1 -1
  17. package/assets/index.html +2 -2
  18. package/dist/{chunk-WEKVQK3O.js → chunk-3LPQ4JV5.js} +130 -103
  19. package/dist/{chunk-2MBI5SYB.js → chunk-4EDH2ORA.js} +3 -3
  20. package/dist/{chunk-PVWGKDY6.js → chunk-MIRAKDRW.js} +111 -79
  21. package/dist/{chunk-QPOXDS43.js → chunk-NPNU6UHD.js} +5 -4
  22. package/dist/{chunk-WVBLFG7H.js → chunk-P2XY5YX7.js} +2 -2
  23. package/dist/{chunk-RBQUGZM4.js → chunk-QAIJH74T.js} +1 -1
  24. package/dist/{chunk-3NAZXITW.js → chunk-YJS4OE6I.js} +615 -579
  25. package/dist/cli.js +15 -16
  26. package/dist/{demo-server-BVJFYR4V.js → demo-server-54SLPSJF.js} +6 -5
  27. package/dist/index.d.ts +7 -5
  28. package/dist/index.js +6 -6
  29. package/dist/{intelligence-service-FK2W72X7.js → intelligence-service-62CEP6M2.js} +2 -2
  30. package/dist/mcp.js +4 -4
  31. package/package.json +10 -10
  32. package/assets/assets/BacklinksPage-DMQPw8ks.js +0 -1
  33. package/assets/assets/ProjectPage-C8vdtqtA.js +0 -8
  34. package/assets/assets/SiteHealthSection-CR3zB84D.js +0 -4
  35. package/assets/assets/index-DBr6ISbx.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 compareText2(leftParts.host, rightParts.host) || matcherSpecificity(right) - matcherSpecificity(left) || compareText2(leftParts.pathname ?? "", rightParts.pathname ?? "") || compareText2(left.kind === "host" ? "" : left.pathCase, right.kind === "host" ? "" : right.pathCase);
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(compareText2).filter((alias) => {
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]) => compareText2(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 = [...new Set(input.providers.map((value) => value.trim().toLocaleLowerCase("en")).filter(Boolean))].sort(compareText2);
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 = canonicalStrings(scope.groups ?? []);
4327
- const requestedTargets = canonicalStrings(scope.targets ?? []);
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(compareText2);
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 = canonicalStrings(queryTexts.map(normalizeMeasurementExecutionQueryText).filter(Boolean));
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]) => compareText2(left, right)).map(([key, child]) => [key, canonicalJsonValue2(child)])
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) => compareText2(issuePathKey(left.path), issuePathKey(right.path)) || compareText2(left.message, right.message));
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 compareText2(left.kind, right.kind) || compareText2("targetKey" in left ? left.targetKey : "", "targetKey" in right ? right.targetKey : "") || compareText2(left.queryId, right.queryId) || compareText2(left.executionNodeKey, right.executionNodeKey);
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: canonicalStrings([left.targetKey, right.targetKey]),
4611
- aliases: canonicalStrings([left.alias, right.alias])
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) => compareText2(left.code, right.code) || compareText2(left.targetKeys.join("\0"), right.targetKeys.join("\0")) || compareText2(left.aliases.join("\0"), right.aliases.join("\0")));
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 = canonicalStrings(roots);
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 canonicalStrings(selection.queryIds)) {
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) => compareText2(left.stableKey, right.stableKey));
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: canonicalStrings(group.targetKeys),
4763
- ...group.competitors && group.competitors.length > 0 ? { competitors: canonicalStrings(group.competitors) } : {}
4764
- })).sort((left, right) => compareText2(left.stableKey, right.stableKey));
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: canonicalStrings([...selection.queryIds]),
4777
+ queryIds: sortedUnique([...selection.queryIds]),
4783
4778
  ...contextsEqual(selection.resolvedContext, defaultContext) ? {} : { context: selection.resolvedContext }
4784
- })).sort((left, right) => compareText2(left.targetKey, right.targetKey) || compareText2(contextKey(resolveContext(left.context, defaultContext)), contextKey(resolveContext(right.context, defaultContext))) || compareText2(left.queryIds.join("\0"), right.queryIds.join("\0")));
4785
- const querySnapshots = [...knownQueries.values()].map((query) => ({ queryId: query.queryId, queryText: query.queryText })).sort((left, right) => compareText2(left.queryId, right.queryId));
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 canonicalStrings(selection.queryIds)) addUsage("target", queryId, resolved, selection.targetKey);
4794
+ for (const queryId of sortedUnique(selection.queryIds)) addUsage("target", queryId, resolved, selection.targetKey);
4800
4795
  });
4801
- const executionNodes = [...nodeSeeds.entries()].sort(([left], [right]) => compareText2(left, right)).map(([signature, node]) => ({
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 sortedUnique(ids) {
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 sortedUnique(actionIds)) {
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: sortedUnique(actionIds),
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 configScheduleSchema = z22.object({
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
- }).refine(
10183
- (data) => [data.preset, data.cron, data.recurrence].filter((value) => value !== void 0).length === 1,
10184
- { message: 'Exactly one of "preset", "cron", or "recurrence" must be provided' }
10185
- ).optional();
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 configSpecSchema = z22.object({
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
- }).superRefine((spec, ctx) => {
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(compareText3),
10461
+ aliases: [...parsed.identity.aliases].sort(compareText),
10446
10462
  canonicalDomain: parsed.identity.canonicalDomain,
10447
- ownedDomains: [...parsed.identity.ownedDomains].sort(compareText3),
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(compareText3) } : {}
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) => compareText3(left.provider, right.provider)),
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(compareText3)
10466
- })).sort((left, right) => compareText3(left.domain, right.domain))
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) => compareText3(left.queryId, right.queryId))
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 compareText5 = (left, right) => left < right ? -1 : left > right ? 1 : 0;
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 sortedUnique2(days) {
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: sortedUnique2(perChange.filter((c) => c.confirmed !== false).map((c) => dayOf(c.date))),
13359
- unconfirmedDates: sortedUnique2(perChange.filter((c) => c.confirmed === false).map((c) => dayOf(c.date)))
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 = sortedUnique2([dayOf(entry.firstChangeDate), dayOf(entry.lastChangeDate)]);
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) => compareText4(left.provider, right.provider) || PRICING_TIER_ORDER.indexOf(left.pricingTier) - PRICING_TIER_ORDER.indexOf(right.pricingTier));
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
@@ -17425,6 +17446,10 @@ var GA_SEARCH_LANDING_WINDOW_DAYS = {
17425
17446
  };
17426
17447
  var GA_SEARCH_LANDING_DEFAULT_WINDOW = "28d";
17427
17448
  var GA_SEARCH_LANDING_DEFAULT_LIMIT = 50;
17449
+ var GA_SEARCH_LANDING_EMPTY_PAGE_LABEL = "(empty)";
17450
+ function gaSearchLandingPageLabel(landingPage) {
17451
+ return landingPage === "" ? GA_SEARCH_LANDING_EMPTY_PAGE_LABEL : landingPage;
17452
+ }
17428
17453
  var GA_SEARCH_LANDING_MAX_LIMIT = 1e3;
17429
17454
  var gaSearchLandingStatusSchema = z51.enum(["never-synced", "ready", "unavailable", "error"]);
17430
17455
  var gaSearchLandingMetricsSchema = z51.object({
@@ -19119,6 +19144,9 @@ function deriveIndexCoverage(input) {
19119
19144
  function normalizeQueryText(value) {
19120
19145
  return value.trim().toLowerCase();
19121
19146
  }
19147
+ function normalizeIdentityText(value) {
19148
+ return value.normalize("NFKC").trim().replace(/\s+/g, " ").toLocaleLowerCase("en");
19149
+ }
19122
19150
 
19123
19151
  // ../contracts/src/query-counts.ts
19124
19152
  function summarizeObservedQueryCounts(snapshots) {
@@ -20650,14 +20678,9 @@ var adsActivationAdGroupSchema = adsActivationEntityRefSchema.extend({
20650
20678
  var adsActivationCampaignSchema = adsActivationEntityRefSchema.extend({
20651
20679
  adGroups: z65.array(adsActivationAdGroupSchema).min(1).max(ADS_ACTIVATION_ABSOLUTE_MAX_ENTITIES - 1)
20652
20680
  }).strict();
20653
- function compareAdsActivationEntityIds(left, right) {
20654
- if (left < right) return -1;
20655
- if (left > right) return 1;
20656
- return 0;
20657
- }
20658
20681
  function addCanonicalEntityOrderIssue(items, path, ctx) {
20659
20682
  for (let index = 1; index < items.length; index += 1) {
20660
- if (compareAdsActivationEntityIds(items[index - 1].id, items[index].id) >= 0) {
20683
+ if (compareText(items[index - 1].id, items[index].id) >= 0) {
20661
20684
  ctx.addIssue({
20662
20685
  code: "custom",
20663
20686
  path,
@@ -20704,8 +20727,8 @@ function canonicalizeAdsActivationManifest(manifest) {
20704
20727
  adGroups: manifest.campaign.adGroups.map((group) => ({
20705
20728
  id: group.id,
20706
20729
  expectedUpdatedAt: group.expectedUpdatedAt,
20707
- ads: group.ads.map((ad) => ({ id: ad.id, expectedUpdatedAt: ad.expectedUpdatedAt })).sort((left, right) => compareAdsActivationEntityIds(left.id, right.id))
20708
- })).sort((left, right) => compareAdsActivationEntityIds(left.id, right.id))
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))
20709
20732
  }
20710
20733
  };
20711
20734
  }
@@ -22549,6 +22572,8 @@ export {
22549
22572
  AI_ENGINE_SELF_DOMAINS,
22550
22573
  VERTEX_AI_SEARCH_PROXY_DOMAIN,
22551
22574
  AI_PROVIDER_INFRA_DOMAINS,
22575
+ compareText,
22576
+ sortedUnique,
22552
22577
  hostOf,
22553
22578
  registrableDomain,
22554
22579
  normalizeProjectDomain,
@@ -22825,12 +22850,15 @@ export {
22825
22850
  projectCreateRequestSchema,
22826
22851
  normalizeProjectName,
22827
22852
  projectDtoSchema,
22853
+ projectDefaultLocationResponseSchema,
22828
22854
  queryDtoSchema,
22829
22855
  keywordDtoSchema,
22830
22856
  queryBatchRequestSchema,
22831
22857
  keywordBatchRequestSchema,
22832
22858
  queryGenerateRequestSchema,
22859
+ queryGenerateResponseSchema,
22833
22860
  keywordGenerateRequestSchema,
22861
+ keywordGenerateResponseSchema,
22834
22862
  competitorDtoSchema,
22835
22863
  competitorBatchRequestSchema,
22836
22864
  competitorAppendRequestSchema,
@@ -22840,6 +22868,7 @@ export {
22840
22868
  effectiveBrandNames,
22841
22869
  competitorAliasProjectIdentity,
22842
22870
  projectConfigSchema,
22871
+ projectConfigExportSchema,
22843
22872
  resolveConfigSpecQueries,
22844
22873
  simpleMeasurementDefinitionSchema,
22845
22874
  simpleMeasurementCompetitorNames,
@@ -23035,6 +23064,7 @@ export {
23035
23064
  withRetry,
23036
23065
  retryAfterDelayMs,
23037
23066
  isRetryableHttpError,
23067
+ escapeRegExp,
23038
23068
  mapWithConcurrency,
23039
23069
  bingUrlInspectionDtoSchema,
23040
23070
  bingCoverageSummaryDtoSchema,
@@ -23048,7 +23078,7 @@ export {
23048
23078
  cdpStatusDtoSchema,
23049
23079
  wordpressEnvSchema,
23050
23080
  wordpressStatusDtoSchema,
23051
- wordpressPageSummaryDtoSchema,
23081
+ wordpressPageListDtoSchema,
23052
23082
  wordpressSchemaBlockDtoSchema,
23053
23083
  wordpressPageDetailDtoSchema,
23054
23084
  wordpressManualAssistDtoSchema,
@@ -23155,6 +23185,7 @@ export {
23155
23185
  GA_SEARCH_LANDING_WINDOW_DAYS,
23156
23186
  GA_SEARCH_LANDING_DEFAULT_WINDOW,
23157
23187
  GA_SEARCH_LANDING_DEFAULT_LIMIT,
23188
+ gaSearchLandingPageLabel,
23158
23189
  GA_SEARCH_LANDING_MAX_LIMIT,
23159
23190
  gaSearchLandingPagesResponseSchema,
23160
23191
  gaSearchLandingHasSearchData,
@@ -23269,6 +23300,7 @@ export {
23269
23300
  groupIsoDateRanges,
23270
23301
  deriveIndexCoverage,
23271
23302
  normalizeQueryText,
23303
+ normalizeIdentityText,
23272
23304
  summarizeObservedQueryCounts,
23273
23305
  citationVisibilityResponseSchema,
23274
23306
  emptyCitationVisibility,
@@ -5,16 +5,17 @@ import {
5
5
  siteCrawlGraphNodes,
6
6
  siteCrawlPages,
7
7
  siteCrawlSnapshots
8
- } from "./chunk-3NAZXITW.js";
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-PVWGKDY6.js";
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] < right[0] ? -1 : left[0] > right[0] ? 1 : 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] < right.nodeKeys[0] ? -1 : left.nodeKeys[0] > right.nodeKeys[0] ? 1 : 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-RBQUGZM4.js";
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-PVWGKDY6.js";
53
+ } from "./chunk-MIRAKDRW.js";
54
54
 
55
55
  // src/config.ts
56
56
  import fs from "fs";
@@ -141,7 +141,7 @@ import {
141
141
  trafficSeriesGranularitySchema,
142
142
  visibilityCompareSelectionSchema,
143
143
  visibilityReportRequestSchema
144
- } from "./chunk-PVWGKDY6.js";
144
+ } from "./chunk-MIRAKDRW.js";
145
145
 
146
146
  // src/cli-error.ts
147
147
  function isMachineFormat(format) {