seo 0.17.5 → 0.17.6

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/dist/mcp.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __seoCreateRequire } from 'node:module'; const require = __seoCreateRequire(import.meta.url);
2
- import { i as __toESM, n as version, r as __commonJSMin, t as load } from "./esm-lrKCsK_C.js";
2
+ import { i as __toESM, n as version, r as __commonJSMin, t as load } from "./esm-D7vj4X6E.js";
3
3
  import { createHash, randomUUID, sign } from "node:crypto";
4
4
  import { ZodOptional, z } from "zod";
5
5
  import { arch, homedir, platform, tmpdir, totalmem } from "node:os";
@@ -22024,7 +22024,7 @@ const QUERY_FLAG_METHOD = {
22024
22024
  heuristic: true,
22025
22025
  ranking: "flagged_rows_after_unflagged_rows",
22026
22026
  flags: {
22027
- "likely-automated": "Snake_case identifier tokens, 20 or more words, or 8 or more ASCII words with no common function word. Such queries often come from scripts, prompts or tools, not people.",
22027
+ "likely-automated": "A numbered prefix such as \"12264: \", snake_case identifier tokens, 20 or more words, or 8 or more ASCII words with no common function word. Such queries often come from scripts, prompts or tools, not people.",
22028
22028
  "navigational-other": "Names a domain that is not the property's host, ends with a spoken domain suffix or a login/site/app word, starts with a large platform name and adds no topic word, or is one short ASCII word that is not a brand term. Such queries usually look for another site."
22029
22029
  }
22030
22030
  };
@@ -22088,8 +22088,10 @@ const FUNCTION_WORDS$1 = /* @__PURE__ */ new Set([
22088
22088
  "und"
22089
22089
  ]);
22090
22090
  const IDENTIFIER_TOKEN = /[\p{L}\p{N}]_[\p{L}\p{N}]/u;
22091
+ const NUMBERED_PREFIX = /^\d{4,}:\s+\S/u;
22091
22092
  /** Heuristic: the query looks machine-generated rather than typed by a person. */
22092
22093
  function isLikelyAutomatedQuery(query) {
22094
+ if (NUMBERED_PREFIX.test(query.trim())) return true;
22093
22095
  if (query.trim().split(/\s+/).filter(Boolean).some((token) => IDENTIFIER_TOKEN.test(token))) return true;
22094
22096
  const tokens = tokenize(query);
22095
22097
  if (tokens.length >= 20) return true;
@@ -33358,6 +33360,7 @@ function selectRows(input) {
33358
33360
  belowMinimumRows: 0,
33359
33361
  lowActionabilityRows: 0,
33360
33362
  brandRows: 0,
33363
+ sitelinkRows: 0,
33361
33364
  eligibleRows: 0,
33362
33365
  likelyAutomatedRows: 0,
33363
33366
  navigationalOtherRows: 0,
@@ -33378,16 +33381,23 @@ function selectRows(input) {
33378
33381
  brandTerms: input.brandTerms,
33379
33382
  includeBrand: input.includeBrand
33380
33383
  })) selection.brandRows++;
33381
- else {
33382
- rows.push(row);
33383
- selection.eligibleRows++;
33384
- }
33384
+ else rows.push(row);
33385
33385
  }
33386
+ const kept = withoutSitelinkRows(rows);
33387
+ selection.sitelinkRows = rows.length - kept.length;
33388
+ selection.eligibleRows = kept.length;
33386
33389
  return {
33387
- rows,
33390
+ rows: kept,
33388
33391
  selection
33389
33392
  };
33390
33393
  }
33394
+ const SITELINK_MINIMUM_PAGES = 3;
33395
+ function withoutSitelinkRows(rows) {
33396
+ const counts = /* @__PURE__ */ new Map();
33397
+ const key = (row) => `${row.keys[0]?.trim()}\n${row.impressions}\n${row.position}`;
33398
+ for (const row of rows) counts.set(key(row), (counts.get(key(row)) ?? 0) + 1);
33399
+ return rows.filter((row) => (counts.get(key(row)) ?? 0) < SITELINK_MINIMUM_PAGES);
33400
+ }
33391
33401
  function analyzeStrikingDistanceRows(input) {
33392
33402
  const collapsed = collapseFragmentPageRows(input.rows, { pageKeyIndex: 1 });
33393
33403
  const minImpressionsPolicy = resolveMinImpressionsPolicy({
@@ -33462,6 +33472,7 @@ function analyzeStrikingDistanceRows(input) {
33462
33472
  "minimum_impressions",
33463
33473
  "query_quality",
33464
33474
  "brand",
33475
+ "sitelinks",
33465
33476
  "query_flag_ranking"
33466
33477
  ],
33467
33478
  selection: selected.selection
@@ -33625,6 +33636,7 @@ async function strikingDistanceWith(input, dependencies) {
33625
33636
  `Brand queries: ${analysis.brand.filtering}. Brand terms used: ${analysis.brand.terms.join(", ") || "none"} (${analysis.brand.source === "provided" ? "provided" : "host forms, plus the bare domain stem only when Search Console shows the site is its navigational answer"}).`,
33626
33637
  analysis.selection.fragmentRows ? `${countLabel(analysis.selection.fragmentRows, "source row")} with a #fragment URL merged into the base URL.` : "",
33627
33638
  analysis.selection.flaggedRows ? `${countLabel(analysis.selection.flaggedRows, "eligible row")} carry heuristic query flags (likely-automated or navigational-other) and rank after unflagged rows.` : "",
33639
+ analysis.selection.sitelinkRows ? `${countLabel(analysis.selection.sitelinkRows, "row")} left out as sitelinks: three or more pages for the same query with the same impressions and average position, which is one result shown with its sitelinks. A heuristic.` : "",
33628
33640
  "Position is GSC average position for the property's topmost result per impression; it does not prove a URL ranked on a literal second results page every time.",
33629
33641
  "Search Analytics exposes retained query rows only. Anonymized and lower-value queries can be absent even when pagination is exhausted.",
33630
33642
  "Priority is a demand-and-position heuristic, not an estimated click lift or proof that a change will improve rankings.",