seo 0.17.2 → 0.17.4

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/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __seoCreateRequire } from 'node:module'; const require = __seoCreateRequire(import.meta.url);
2
- import { n as version, t as load } from "./esm-BR8_7rhM.js";
2
+ import { n as version, t as load } from "./esm-LhrUicGJ.js";
3
3
  import { SEO_PROVIDER_API_VERSION } from "./provider-sdk.js";
4
4
  import crypto$1, { createHash, randomUUID, sign } from "node:crypto";
5
5
  import { z } from "zod";
@@ -31243,6 +31243,17 @@ const PROSE = [
31243
31243
  "quote",
31244
31244
  "prop"
31245
31245
  ];
31246
+ const SENTENCE_KINDS = [
31247
+ "paragraph",
31248
+ "quote",
31249
+ "prop",
31250
+ "list"
31251
+ ];
31252
+ const RHYTHM_KINDS = [
31253
+ "paragraph",
31254
+ "quote",
31255
+ "prop"
31256
+ ];
31246
31257
  const ALL = [
31247
31258
  "paragraph",
31248
31259
  "list",
@@ -31496,7 +31507,7 @@ const PHRASE_RULES = [
31496
31507
  id: "significance-inflation",
31497
31508
  family: "ai",
31498
31509
  level: "error",
31499
- description: "Importance puffery: \"plays a crucial role\", \"marks a pivotal moment\", \"a testament to\".",
31510
+ description: "Importance puffery: \"plays a crucial role\", \"marks a pivotal moment\", \"a testament to\", \"the part that really matters\".",
31500
31511
  patterns: [
31501
31512
  /\bplays? an? (?:crucial|pivotal|vital|key|significant|critical|central|important|major) role\b/gi,
31502
31513
  /\b(?:marks?|marking|represents?|signals?) an? (?:pivotal|significant|important|major|defining|watershed|key) (?:moment|shift|turning point|milestone|step)\b/gi,
@@ -31515,8 +31526,11 @@ const PHRASE_RULES = [
31515
31526
  /\b(?:a|another) (?:major|key|significant|important|huge|big|proud) milestone\b/gi,
31516
31527
  /\bbuilding a better (?:future|world|tomorrow)\b/gi,
31517
31528
  /\bthe implications are (?:profound|significant|enormous|huge|far-reaching)\b/gi,
31518
- /\b(?:is|was) an (?:event|experience|attraction) in itself\b/gi
31529
+ /\b(?:is|was) an (?:event|experience|attraction) in itself\b/gi,
31530
+ /\b(?:answers|asks|addresses) the (?:actual|real) question\b/gi,
31531
+ /\bthe (?:one |only )?(?:part|bit|thing|piece|step|number|leg|detail|line|row) that (?:actually|really|truly) (?:matters|counts)\b/gi
31519
31532
  ],
31533
+ levelFor: (match) => /question|that (?:actually|really|truly)/i.test(match.text) ? "warning" : void 0,
31520
31534
  message: "It inflates importance without saying what changed.",
31521
31535
  fix: "Cut it, or name the concrete effect the text already states. Do not add a number that is not there."
31522
31536
  },
@@ -31524,9 +31538,9 @@ const PHRASE_RULES = [
31524
31538
  id: "participle-tail",
31525
31539
  family: "ai",
31526
31540
  level: "error",
31527
- description: "A sentence that ends on \", highlighting/underscoring/showcasing ...\" commentary.",
31541
+ description: "A sentence that ends on \", highlighting/underscoring/suggesting ...\" commentary.",
31528
31542
  kinds: PROSE,
31529
- patterns: [/,\s+(?:highlighting|underscoring|emphasi[sz]ing|showcasing|symboli[sz]ing|solidifying|cementing|signall?ing|reinforcing|fostering|cultivating|paving the way|setting the stage|demonstrating|illustrating|reflecting|ensuring|marking|contributing to)\b[^.!?]{0,120}[.!?]?/gi, /,\s+(?:giving (?:users|teams|customers|small teams|every \w+|people) (?:a|an|the|more)\b|freeing (?:you|them|up)\b|making it (?:easy|easier|simple|simpler|effortless|possible) (?:for|to)\b|creating an? (?:[\w-]+ )?(?:experience|panorama|atmosphere|sense)\b|delivering (?:real-time|accurate|predictions|reliable|a seamless|an intuitive)\b)[^.!?]{0,120}[.!?]?/gi],
31543
+ patterns: [/,\s+(?:highlighting|underscoring|emphasi[sz]ing|showcasing|symboli[sz]ing|solidifying|cementing|signall?ing|reinforcing|fostering|cultivating|paving the way|setting the stage|suggesting|demonstrating|illustrating|reflecting|ensuring|marking|contributing to)\b[^.!?]{0,120}[.!?]?/gi, /,\s+(?:giving (?:users|teams|customers|small teams|every \w+|people) (?:a|an|the|more)\b|freeing (?:you|them|up)\b|making it (?:easy|easier|simple|simpler|effortless|possible) (?:for|to)\b|creating an? (?:[\w-]+ )?(?:experience|panorama|atmosphere|sense)\b|delivering (?:real-time|accurate|predictions|reliable|a seamless|an intuitive)\b)[^.!?]{0,120}[.!?]?/gi],
31530
31544
  levelFor: (match) => /^,\s+(?:reflecting|ensuring|marking|contributing|demonstrating|illustrating|giving|freeing|making|creating|delivering)/i.test(match.text) ? "warning" : void 0,
31531
31545
  message: "The \", highlighting ...\" tail comments on the sentence instead of adding a fact.",
31532
31546
  fix: "End the sentence at the comma. If the tail holds a real fact, give it its own sentence with a subject and verb."
@@ -31639,6 +31653,7 @@ const PHRASE_RULES = [
31639
31653
  /\bpunch(?:es|ing)? (?:well )?above (?:its|their|his|her) weight\b/gi,
31640
31654
  /\b(?:thrilled|delighted) to (?:announce|share|introduce|unveil)\b/gi,
31641
31655
  /\bthe (?:whole|entire) point\b/gi,
31656
+ /\bthe only (?:[\w-]+ ){1,3}(?:I|we) (?:actually |really |still )?trust\b/gi,
31642
31657
  /,? which is (?:the (?:whole |real |entire )?point|exactly the point|kind of the point)\b/gi
31643
31658
  ],
31644
31659
  message: (match) => `"${match.text}" is a stock phrase that would fit any page.`,
@@ -31763,6 +31778,16 @@ const PHRASE_RULES = [
31763
31778
  message: "Two hedges where one, or none, would do.",
31764
31779
  fix: "Keep one qualifier, or state what the evidence shows."
31765
31780
  },
31781
+ {
31782
+ id: "false-range",
31783
+ family: "ai",
31784
+ level: "error",
31785
+ kinds: PROSE,
31786
+ description: "Stacked \"from X to Y\" ranges that sound broad but name no scale: \"from the Big Bang to the cosmic web, from stars to dark matter\".",
31787
+ patterns: [/\bfrom [^,.;:!?\n]{1,40} to [^,.;:!?\n]{1,40},\s+(?:and )?from [^,.;:!?\n]{1,40} to [^,.;:!?\n]{1,40}/gi],
31788
+ message: "Two \"from X to Y\" ranges in a row cover everything and say nothing.",
31789
+ fix: "Name the specific things the text covers, or cut the ranges."
31790
+ },
31766
31791
  {
31767
31792
  id: "colon-reveal",
31768
31793
  family: "ai",
@@ -31821,27 +31846,30 @@ const PHRASE_RULES = [
31821
31846
  family: "ai",
31822
31847
  level: "error",
31823
31848
  kinds: PROSE,
31824
- description: "A one-line denial used as a beat: \"It isn't.\" \"Not quite.\" \"But only part.\"",
31849
+ description: "A one-line denial used as a beat: \"It isn't.\" \"Not quite.\" \"The sixth is not.\" \"; the data didn't.\"",
31825
31850
  patterns: [
31826
31851
  /(?:^|[.!?:]\s+)(?:It|That|This|They|He|She|We) (?:isn't|wasn't|doesn't|didn't|won't|aren't|weren't|is not|was not|does not|did not)\.(?=\s|$)/g,
31827
31852
  /(?:^|[.!?:]\s+)(?:Not quite|Not even close|Not really|Not anymore|Not any more)\.(?=\s|$)/g,
31828
- /(?:^|[.!?:]\s+)(?:But|And) only (?:part|half|some|partly)\.(?=\s|$)/g
31853
+ /(?:^|[.!?:]\s+)(?:But|And) only (?:part|half|some|partly)\.(?=\s|$)/g,
31854
+ /(?:^|[.!?]\s+)The (?:[\w-]+ ){0,1}[\w-]+ (?:isn't|wasn't|doesn't|didn't|won't|aren't|weren't|hasn't|haven't|is not|was not|does not|did not|are not|were not|has not)\.(?=\s|$)/g,
31855
+ /;\s+(?:the|its|their|our|your) (?:[\w-]+ ){0,1}[\w-]+ (?:isn't|wasn't|doesn't|didn't|won't|aren't|weren't|hasn't|haven't|is not|was not|does not|did not|are not|were not|has not)\.(?=\s|$)/gi
31829
31856
  ],
31830
- message: "A two-word denial used for rhythm. It makes the reader wait.",
31831
- fix: "Join it to the sentence before, so the point is stated once."
31857
+ message: "A bare denial used for rhythm. It makes the reader wait.",
31858
+ fix: "Join it to the sentence before and name the thing, so the point is stated once."
31832
31859
  },
31833
31860
  {
31834
31861
  id: "strawman",
31835
31862
  family: "ai",
31836
31863
  level: "error",
31837
31864
  kinds: PROSE,
31838
- description: "An answer to an objection nobody raised: \"It isn't perfect.\", \"doesn't have to be stressful\", \"None of this means\", \"This isn't about\".",
31865
+ description: "An answer to an objection nobody raised: \"It isn't perfect.\", \"doesn't have to be stressful\", \"None of this means\", \"This isn't about\", \"is the obvious reading, and it is wrong\".",
31839
31866
  patterns: [
31840
31867
  /(?:^|[.!?:]\s+)(?:It|This|That|Nothing|No \w+)(?:'s| is|'s not| isn't| is not| wasn't| was not) (?:not )?perfect\.(?=\s|$)/g,
31841
31868
  /\b(?:doesn't|does not|don't|do not|needn't|need not) (?:have to |need to )?be (?:so )?(?:stressful|hard|complicated|difficult|painful|expensive|overwhelming|a chore|scary|intimidating|daunting|confusing|a headache)\b/gi,
31842
31869
  /(?:^|[.!?]\s)None of this means\b/g,
31843
31870
  /(?:^|[.!?]\s)(?:This|That|It)(?: isn't| is not|'s not) (?:just |really |only )?about\b/g,
31844
- /\b(?:isn't|is not|ain't) rocket science\b/gi
31871
+ /\b(?:isn't|is not|ain't) rocket science\b/gi,
31872
+ /\bis the (?:obvious|natural|easy|tempting|intuitive|common|usual|first) (?:reading|answer|interpretation|explanation|assumption|guess|conclusion|take)(?:,)? (?:and|but) (?:it(?:'s| is| was)|that(?:'s| is)) (?:wrong|mistaken|backwards|not (?:quite )?right)\b/gi
31845
31873
  ],
31846
31874
  message: "It answers a doubt the reader did not raise.",
31847
31875
  fix: "Cut it, or state the limit or the point plainly as a fact."
@@ -32102,7 +32130,7 @@ const SEO_RULES = {
32102
32130
  family: "copy",
32103
32131
  level: "error",
32104
32132
  presets: { docs: "warning" },
32105
- description: "Headings that label instead of telling: \"Overview\", \"Key takeaways\", \"Why it matters\", \"The ultimate guide\"."
32133
+ description: "Headings that label instead of telling, or tease: \"Overview\", \"Key takeaways\", \"Why it matters\", 'What \"exhausted\" means', \"X is dead\"."
32106
32134
  },
32107
32135
  emoji: {
32108
32136
  id: "emoji",
@@ -32174,6 +32202,7 @@ function lengths(ctx) {
32174
32202
  }
32175
32203
  }
32176
32204
  const HEADING_CLICHE = /^(?:a )?(?:deep dive|under the hood|demystifying\b|why (?:it|this|that) matters|a closer look|the ultimate guide|everything you need to know|mastering\b|unlocking\b|the power of\b|the future of\b|what you'll learn|key takeaways|final thoughts|wrapping up|conclusion|in conclusion|tl;?dr|overview|introduction|the road ahead|looking ahead|challenges and (?:legacy|opportunities|future)|future outlook|the bottom line|let's dive in|get started today|(?:the )?(?:challenge|solution|results?)$|at a glance$|first impressions$|a note of thanks$)/i;
32205
+ const HEADING_COY = /^(?:what "[^"]{1,40}" (?:really |actually )?means$|[^?]{1,60} is dead$|the one [\w-]+ (?:that|which|you|we)\b)/i;
32177
32206
  function headings(ctx) {
32178
32207
  const list = ctx.blocks(["heading"]);
32179
32208
  const h1s = list.filter((block) => block.level === 1);
@@ -32183,7 +32212,8 @@ function headings(ctx) {
32183
32212
  const level = block.level ?? 2;
32184
32213
  if (previous && level > previous + 1) ctx.hit(SEO_RULES.headingSkip, block, 0, block.text.length, `This H${level} follows an H${previous}.`, `Make it an H${previous + 1}, or add the missing level above it.`);
32185
32214
  previous = level;
32186
- if (HEADING_CLICHE.test(block.norm)) ctx.hit(SEO_RULES.headingCliche, block, 0, block.text.length, "A heading that labels the section instead of saying what is in it.", "Name what the section tells the reader, such as \"Check coverage before trusting the count\".");
32215
+ const coy = HEADING_COY.test(block.norm);
32216
+ if (coy || HEADING_CLICHE.test(block.norm)) ctx.hit(SEO_RULES.headingCliche, block, 0, block.text.length, coy ? "A heading that teases or announces a verdict instead of saying what is in the section." : "A heading that labels the section instead of saying what is in it.", "Name what the section tells the reader, such as \"Check coverage before trusting the count\".");
32187
32217
  }
32188
32218
  }
32189
32219
  const EMOJI = /^\p{Extended_Pictographic}/u;
@@ -32300,94 +32330,8 @@ function runSeoRules(ctx) {
32300
32330
  heroLength(ctx);
32301
32331
  reviews(ctx);
32302
32332
  }
32303
- // packages/core/src/lint/rules-structure.ts
32304
- const SENTENCE_KINDS = [
32305
- "paragraph",
32306
- "quote",
32307
- "prop",
32308
- "list"
32309
- ];
32310
- const RHYTHM_KINDS = [
32311
- "paragraph",
32312
- "quote",
32313
- "prop"
32314
- ];
32315
- const STRUCTURE_RULES = {
32316
- negativeParallelism: {
32317
- id: "negative-parallelism",
32318
- family: "ai",
32319
- level: "error",
32320
- description: "\"It isn't X, it's Y\" and \"isn't just X. It's Y.\" reframes."
32321
- },
32322
- contrastReframe: {
32323
- id: "contrast-reframe",
32324
- family: "ai",
32325
- level: "error",
32326
- presets: { docs: "warning" },
32327
- description: "A trailing \", not X\" or \"rather than X\" contrast added for drama: \"The fix is in the template, not in 600 posts.\""
32328
- },
32329
- heresAnnouncement: {
32330
- id: "heres-announcement",
32331
- family: "ai",
32332
- level: "error",
32333
- presets: { docs: "off" },
32334
- description: "A short \"Here's the X\" sentence that announces what comes next instead of saying it."
32335
- },
32336
- pithyFragment: {
32337
- id: "pithy-fragment",
32338
- family: "ai",
32339
- level: "error",
32340
- description: "Verbless slogan fragments: \"Same essay, two titles.\", \"Every month. No exceptions.\", \"$299 per month. That's it.\""
32341
- },
32342
- stockCloser: {
32343
- id: "stock-closer",
32344
- family: "ai",
32345
- level: "error",
32346
- description: "A stock kicker line: \"That's a real win.\" \"That is what makes this interesting.\""
32347
- },
32348
- negativeReframe: {
32349
- id: "negative-reframe",
32350
- family: "ai",
32351
- level: "warning",
32352
- description: "A short \"That's not how/what ...\" dismissal."
32353
- },
32354
- figurativeWorth: {
32355
- id: "figurative-worth",
32356
- family: "ai",
32357
- level: "error",
32358
- description: "A \"worth + -ing\" idiom that mixes its metaphor or points at the reader: \"a fight worth picking\", \"worth noting\"."
32359
- },
32360
- anaphora: {
32361
- id: "anaphora",
32362
- family: "ai",
32363
- level: "error",
32364
- description: "Short sentences in a row that start with the same word: two or more \"No ...\" sentences, or three or more starting \"It's\", \"They\", \"We\" or \"You\"."
32365
- },
32366
- vocabularyCluster: {
32367
- id: "ai-vocabulary-cluster",
32368
- family: "ai",
32369
- level: "warning",
32370
- description: "Two or more words such as crucial, pivotal, foster, landscape or journey in one paragraph."
32371
- },
32372
- triad: {
32373
- id: "triad",
32374
- family: "ai",
32375
- level: "warning",
32376
- presets: { docs: "off" },
32377
- description: "Formula triads: three parallel clauses (\"It is cheap, it is reversible, and it works\"), three items that open with the same word, three adjectives after \"is\", or three abstract nouns. Plain lists of three are left alone."
32378
- },
32379
- inventedLabel: {
32380
- id: "invented-label",
32381
- family: "ai",
32382
- level: "warning",
32383
- description: "Two or more coined labels such as \"the integration tax\" or \"the supervision paradox\"."
32384
- },
32385
- pseudoCleft: {
32386
- id: "pseudo-cleft",
32387
- family: "ai",
32388
- level: "warning",
32389
- description: "Repeated \"What makes this work is ...\" or \"The problem is that ...\" setups."
32390
- },
32333
+ // packages/core/src/lint/rules-bold.ts
32334
+ const BOLD_RULES = {
32391
32335
  boldEmphasis: {
32392
32336
  id: "bold-emphasis",
32393
32337
  family: "ai",
@@ -32403,7 +32347,87 @@ const STRUCTURE_RULES = {
32403
32347
  family: "ai",
32404
32348
  level: "warning",
32405
32349
  presets: { docs: "off" },
32406
- description: "Three or more list items in a row that open with a bold label."
32350
+ description: "Three or more list items in a row that open with a bold label, or one whose label the item then repeats: \"**Performance:** Performance has been improved.\""
32351
+ }
32352
+ };
32353
+ const RESTATED = /^\s*(?:[-*+]|\d{1,9}[.)])\s+(?:\*\*|__)(?:[^*_\n]{0,30}\s)?([a-z]{4})[^*_\s]*(?:\*\*|__)\s*[:.]?\s+\1/i;
32354
+ function boldLabels(ctx) {
32355
+ const rule = BOLD_RULES.boldLabels;
32356
+ if (ctx.level(rule) === "off") return;
32357
+ if (ctx.doc.format !== "md" && ctx.doc.format !== "mdx") return;
32358
+ const lists = ctx.blocks(["list"]);
32359
+ let run = [];
32360
+ const report = () => {
32361
+ if (run.length >= 3) {
32362
+ const first = run[0];
32363
+ ctx.hit(rule, first, 0, Math.min(first.text.length, 60), `${run.length} list items in a row open with a bold label.`, "Drop the bold labels and write each item as one plain sentence, or use a table if the items really are parallel.");
32364
+ }
32365
+ run = [];
32366
+ };
32367
+ let previous = null;
32368
+ for (const block of lists) {
32369
+ const offset = block.map[0] ?? 0;
32370
+ const line = ctx.doc.source.lastIndexOf("\n", offset) + 1;
32371
+ const raw = ctx.doc.source.slice(line, offset + 4);
32372
+ const bold = /^\s*(?:[-*+]|\d{1,9}[.)])\s+(?:\*\*|__)/.test(raw);
32373
+ if (bold && RESTATED.test(ctx.doc.source.slice(line, line + 200))) ctx.hit(rule, block, 0, Math.min(block.text.length, 60), "The item repeats its bold label.", "Drop the label and keep the sentence, or cut the repeat.");
32374
+ const adjacent = previous !== null && ctx.doc.blocks.indexOf(block) === ctx.doc.blocks.indexOf(previous) + 1;
32375
+ if (!bold || !adjacent) report();
32376
+ if (bold) run.push(block);
32377
+ previous = block;
32378
+ }
32379
+ report();
32380
+ }
32381
+ function boldEmphasis(ctx) {
32382
+ const rule = BOLD_RULES.boldEmphasis;
32383
+ if (ctx.level(rule) === "off") return;
32384
+ const markdown = ctx.doc.format === "md" || ctx.doc.format === "mdx";
32385
+ const re = markdown ? /(\*\*|__)(?=\S)[^*_\n]+?\1/g : /<(strong|b)\b[^>]*>[^<]{1,200}<\/\1>/gi;
32386
+ const prose = ctx.blocks([
32387
+ "paragraph",
32388
+ "list",
32389
+ "quote",
32390
+ "prop"
32391
+ ]);
32392
+ const spans = [];
32393
+ for (const found of ctx.doc.source.matchAll(re)) {
32394
+ const open = markdown ? 2 : found[0].indexOf(">") + 1;
32395
+ const from = (found.index ?? 0) + open;
32396
+ const to = (found.index ?? 0) + found[0].length - (markdown ? 2 : found[0].length - found[0].lastIndexOf("<"));
32397
+ for (const block of prose) {
32398
+ const first = block.map[0] ?? 0;
32399
+ const last = block.map[block.map.length - 1] ?? 0;
32400
+ if (from < first || from > last) continue;
32401
+ const start = block.map.indexOf(from);
32402
+ if (start <= 0 && block.kind === "list") break;
32403
+ if (start < 0) break;
32404
+ let end = start;
32405
+ while (end < block.map.length && (block.map[end] ?? 0) < to) end++;
32406
+ spans.push({
32407
+ block,
32408
+ start,
32409
+ end
32410
+ });
32411
+ break;
32412
+ }
32413
+ }
32414
+ if (spans.length < 3 || spans.length * 100 <= ctx.proseWords) return;
32415
+ for (const span of spans) ctx.hit(rule, span.block, span.start, span.end, `${spans.length} bold phrases in ${ctx.proseWords.toLocaleString("en-US")} words of prose. Bold this often stops meaning "important".`, "Remove the bold here. Keep bold, if any, for the one thing a skimming reader must not miss.");
32416
+ }
32417
+ // packages/core/src/lint/rules-contrast.ts
32418
+ const CONTRAST_RULES = {
32419
+ negativeParallelism: {
32420
+ id: "negative-parallelism",
32421
+ family: "ai",
32422
+ level: "error",
32423
+ description: "\"It isn't X, it's Y\" and \"isn't just X. It's Y.\" reframes."
32424
+ },
32425
+ contrastReframe: {
32426
+ id: "contrast-reframe",
32427
+ family: "ai",
32428
+ level: "error",
32429
+ presets: { docs: "warning" },
32430
+ description: "A trailing \", not X\" or \"rather than X\" contrast added for drama: \"The fix is in the template, not in 600 posts.\""
32407
32431
  }
32408
32432
  };
32409
32433
  const NEG = "(?:\\b(?:is|are|was|were)(?:n't|\\s+not)\\b|\\b(?:it|this|that|they|we|you)(?:'s|'re)\\s+not\\b)";
@@ -32431,7 +32455,7 @@ const PARALLEL = [
32431
32455
  ];
32432
32456
  const FRAMING = /^(?:the |this |that |our |my |your )?(?:real )?(?:problem|question|answer|issue|point|goal|story|bottleneck|fix|difference|trick|lesson|catch|risk|gap|win|work|job|key|opportunity|plan|idea|value)\b/i;
32433
32457
  function negativeParallelism(ctx) {
32434
- const rule = STRUCTURE_RULES.negativeParallelism;
32458
+ const rule = CONTRAST_RULES.negativeParallelism;
32435
32459
  for (const block of ctx.blocks(SENTENCE_KINDS)) {
32436
32460
  const sentences = ctx.sentences(block);
32437
32461
  const taken = [];
@@ -32495,7 +32519,7 @@ function gerund(word) {
32495
32519
  }
32496
32520
  const NOT_JUST = /,\s+not (?:just|merely|simply) [^,.;:!?]{1,50}[.!?]?$|\bnot (?:just|merely|simply) [^,.;:!?]{1,50},? but\b/i;
32497
32521
  function contrastReframe(ctx) {
32498
- const rule = STRUCTURE_RULES.contrastReframe;
32522
+ const rule = CONTRAST_RULES.contrastReframe;
32499
32523
  if (ctx.level(rule) === "off") return;
32500
32524
  for (const block of ctx.blocks([...SENTENCE_KINDS, "heading"])) for (const sentence of ctx.sentences(block)) {
32501
32525
  const text = sentence.text;
@@ -32539,8 +32563,227 @@ function contrastReframe(ctx) {
32539
32563
  }
32540
32564
  }
32541
32565
  }
32566
+ // packages/core/src/lint/rules-counted.ts
32567
+ const COUNTED_RULES = {
32568
+ vocabularyCluster: {
32569
+ id: "ai-vocabulary-cluster",
32570
+ family: "ai",
32571
+ level: "warning",
32572
+ description: "Two or more words such as crucial, pivotal, foster, landscape or journey in one paragraph."
32573
+ },
32574
+ triad: {
32575
+ id: "triad",
32576
+ family: "ai",
32577
+ level: "warning",
32578
+ presets: { docs: "off" },
32579
+ description: "Formula triads: three parallel clauses (\"It is cheap, it is reversible, and it works\"), three items that open with the same word, three adjectives after \"is\", or three abstract nouns. Plain lists of three are left alone."
32580
+ },
32581
+ inventedLabel: {
32582
+ id: "invented-label",
32583
+ family: "ai",
32584
+ level: "warning",
32585
+ description: "Two or more coined labels such as \"the integration tax\" or \"the supervision paradox\"."
32586
+ },
32587
+ colonDensity: {
32588
+ id: "colon-density",
32589
+ family: "ai",
32590
+ level: "warning",
32591
+ description: "Colons used mid-sentence as a pause or lead-in, three or more per 1,000 words. One is ordinary; a piece full of them reads as AI."
32592
+ },
32593
+ pseudoCleft: {
32594
+ id: "pseudo-cleft",
32595
+ family: "ai",
32596
+ level: "warning",
32597
+ description: "Repeated \"What makes this work is ...\" or \"The problem is that ...\" setups."
32598
+ }
32599
+ };
32600
+ const TIER2 = /\b(?:crucial(?:ly)?|pivotal|vibrant|comprehensive|enhanc(?:e|es|ed|ing|ement)|foster(?:s|ed|ing)?|harness(?:es|ed|ing)?|navigat(?:e|es|ed|ing)|streamlin(?:e|es|ed|ing)|empower(?:s|ed|ing|ment)?|elevat(?:e|es|ed|ing)|unleash(?:es|ed|ing)?|transformative|nuanced?|myriad|plethora|encompass(?:es|ed|ing)?|cultivat(?:e|es|ed|ing)|resonat(?:e|es|ed|ing)|cornerstone|poised|burgeoning|nascent|quintessential|overarching|actionable|impactful|landscape|ecosystem|journey|additionally|notably|moreover|furthermore|profound(?:ly)?|quietly|fundamentally|remarkabl[ey]|arguably|invaluable|deeply (?:rooted|committed|integrated|personal|meaningful))\b/gi;
32601
+ const TECHNICAL = /^(?:comprehensive|ecosystem|streamlin|navigat)/i;
32602
+ function vocabularyCluster(ctx) {
32603
+ const rule = COUNTED_RULES.vocabularyCluster;
32604
+ if (ctx.level(rule) === "off") return;
32605
+ for (const block of ctx.blocks([
32606
+ "paragraph",
32607
+ "list",
32608
+ "quote",
32609
+ "prop",
32610
+ "heading",
32611
+ "description",
32612
+ "title"
32613
+ ])) {
32614
+ const seen = /* @__PURE__ */ new Map();
32615
+ TIER2.lastIndex = 0;
32616
+ for (const found of block.norm.matchAll(TIER2)) {
32617
+ const word = found[0].toLowerCase();
32618
+ if (ctx.preset === "docs" && TECHNICAL.test(word)) continue;
32619
+ const stem = word.slice(0, 6);
32620
+ const start = found.index ?? 0;
32621
+ if (ctx.preset === "landing" || ctx.preset === "meta") {
32622
+ ctx.hit(rule, block, start, start + found[0].length, `"${found[0]}" is filler in short copy.`, "Use the plain word, or the concrete thing it stands for.");
32623
+ continue;
32624
+ }
32625
+ if (!seen.has(stem)) seen.set(stem, start);
32626
+ if (seen.size === 2 && !seen.has(`${stem}!`)) {
32627
+ seen.set(`${stem}!`, start);
32628
+ const listed = [...seen.keys()].filter((key) => !key.endsWith("!"));
32629
+ ctx.hit(rule, block, start, start + found[0].length, `This paragraph stacks words common in AI text (${listed.length} of them, ending with "${found[0]}").`, "Rewrite with plain words: \"important\" for crucial, \"help\" for foster, \"field\" for landscape, or cut them.");
32630
+ }
32631
+ }
32632
+ }
32633
+ }
32634
+ const SERIES = /\b[\w'$-]+(?: [\w'$-]+){0,5}(?:, [\w'$-]+(?: [\w'$-]+){0,5}){1,3},? (?:and|or) [\w'$-]+(?: [\w'$-]+){0,5}/g;
32635
+ const ABSTRACT_TRIAD = /\b[a-z]+(?:tion|sion|ity|ness|ment|ence|ance|ism), (?:and )?[a-z]+(?:tion|sion|ity|ness|ment|ence|ance|ism),? and [a-z]+(?:tion|sion|ity|ness|ment|ence|ance|ism)\b/gi;
32636
+ const ECHO = new Set("to our your their my his her its every each more less no it they we you".split(" "));
32637
+ const COPULA = /\b(?:is|are|was|were|'s|feels?|felt|looks?|stays?|remains?|seems?)\s+$/i;
32638
+ function formulaTriad(items, before) {
32639
+ const firsts = items.map((item) => words$2(item)[0]?.toLowerCase() ?? "");
32640
+ const echo = firsts[0] ?? "";
32641
+ if (ECHO.has(echo) && firsts.every((first) => first === echo)) return `Each item opens with "${echo}".`;
32642
+ if (items.every((item) => /^(?:the|their|our|your|its|it|they|we|you|he|she)\b/i.test(item) && words$2(item).length >= 3 && words$2(item).length <= 7 && !verbless(item))) return "Three parallel clauses in a row.";
32643
+ if (items.every((item) => /^[a-z]/.test(item) && words$2(item).length <= 2 && !PREPOSITIONS.has(words$2(item)[0] ?? "")) && COPULA.test(before)) return "A string of adjectives after \"is\".";
32644
+ if (items.every((item) => /^\w+ed\b/i.test(item) && words$2(item).length <= 3)) return "A string of past participles.";
32645
+ return null;
32646
+ }
32647
+ function triads(ctx) {
32648
+ const rule = COUNTED_RULES.triad;
32649
+ if (ctx.level(rule) === "off") return;
32650
+ for (const block of ctx.blocks([
32651
+ "paragraph",
32652
+ "quote",
32653
+ "prop",
32654
+ "list"
32655
+ ])) {
32656
+ const taken = [];
32657
+ ABSTRACT_TRIAD.lastIndex = 0;
32658
+ for (const match of block.norm.matchAll(ABSTRACT_TRIAD)) {
32659
+ const start = match.index ?? 0;
32660
+ taken.push([start, start + match[0].length]);
32661
+ ctx.hit(rule, block, start, start + match[0].length, "Three abstract nouns in a row sound weighty but say little.", "Keep the one that matters and give an example of it.");
32662
+ }
32663
+ for (const sentence of ctx.sentences(block)) {
32664
+ SERIES.lastIndex = 0;
32665
+ for (const match of sentence.text.matchAll(SERIES)) {
32666
+ let from = match.index ?? 0;
32667
+ const raw = match[0].split(/,\s*(?:(?:and|or)\s+)?|\s+(?:and|or)\s+(?=[^,]*$)/);
32668
+ if (raw.length < 3) continue;
32669
+ const items = [...raw];
32670
+ const head = raw[0] ?? "";
32671
+ const lead = /^.*\b(?:is|are|was|were|'s|feels?|looks?|stays?|remains?|seems?|of|for|to|with|by|from|on|in|like|including|as)\s+/i.exec(head);
32672
+ if (lead && words$2(head.slice(lead[0].length)).length) {
32673
+ items[0] = head.slice(lead[0].length);
32674
+ from += lead[0].length;
32675
+ }
32676
+ const end = sentence.start + (match.index ?? 0) + match[0].length;
32677
+ const before = block.norm.slice(sentence.start, sentence.start + from);
32678
+ const echo = words$2(raw[1] ?? "")[0]?.toLowerCase() ?? "";
32679
+ const inFirst = new RegExp(`\\b${echo}\\b(?!.*\\b${echo}\\b)`, "i").exec(head);
32680
+ if (ECHO.has(echo) && inFirst && inFirst.index > 0) {
32681
+ items[0] = head.slice(inFirst.index);
32682
+ from = (match.index ?? 0) + inFirst.index;
32683
+ }
32684
+ const plain = formulaTriad(raw, "");
32685
+ const why = plain ?? formulaTriad(items, before);
32686
+ if (!why) continue;
32687
+ if (plain) from = match.index ?? 0;
32688
+ const start = sentence.start + from;
32689
+ if (taken.some(([a, b]) => start < b && end > a)) continue;
32690
+ taken.push([start, end]);
32691
+ ctx.hit(rule, block, start, end, `A list of ${items.length} that reads as a formula. ${why}`, "Keep the items the reader needs. If all of them are needed, write them plainly or as two sentences; if one was added for rhythm, cut it.");
32692
+ }
32693
+ }
32694
+ }
32695
+ }
32696
+ function countedPatterns(ctx) {
32697
+ const labels = COUNTED_RULES.inventedLabel;
32698
+ const clefts = COUNTED_RULES.pseudoCleft;
32699
+ for (const [rule, re] of [[labels, /\bthe [a-z]+(?:-[a-z]+)? (?:paradox|trap|tax|creep|divide|vacuum|inversion|cliff|treadmill|illusion|fallacy|flywheel|moat)\b/gi], [clefts, /(?:^|[.!?]\s+)(?:What (?:makes|made|matters|changed|really|actually|you get|this means|I (?:like|love|learned|found))\b[^.!?]{0,40}\s+(?:is|was)\b|The (?:problem|difference|catch|key|trick|point|reason) is that\b)/g]]) {
32700
+ if (ctx.level(rule) === "off") continue;
32701
+ const found = [];
32702
+ for (const block of ctx.blocks(RHYTHM_KINDS)) {
32703
+ re.lastIndex = 0;
32704
+ for (const match of block.norm.matchAll(re)) {
32705
+ let start = match.index ?? 0;
32706
+ while (/[\s.!?]/.test(block.norm[start] ?? "")) start++;
32707
+ found.push({
32708
+ block,
32709
+ start,
32710
+ end: (match.index ?? 0) + match[0].length
32711
+ });
32712
+ }
32713
+ }
32714
+ if (found.length < 2) continue;
32715
+ for (const item of found) ctx.hit(rule, item.block, item.start, item.end, rule === labels ? `${found.length} coined labels in one piece. Each asks the reader to learn a term.` : `${found.length} "What X is" or "The problem is that" setups in one piece.`, rule === labels ? "Describe the thing in plain words instead of naming it." : "Start with the subject and say the thing directly.");
32716
+ }
32717
+ }
32718
+ function colonDensity(ctx) {
32719
+ const rule = COUNTED_RULES.colonDensity;
32720
+ if (ctx.level(rule) === "off") return;
32721
+ const found = [];
32722
+ for (const block of ctx.blocks(SENTENCE_KINDS)) {
32723
+ const sentences = ctx.sentences(block);
32724
+ for (const match of block.norm.matchAll(/:\s+(?=\S)/g)) {
32725
+ const at = match.index ?? 0;
32726
+ const after = block.norm.slice(at + match[0].length);
32727
+ if (/^["'(]/.test(after)) continue;
32728
+ const lead = block.norm.slice(sentenceAt(sentences, at).start, at);
32729
+ if (words$2(lead).length <= 4 && verbless(lead)) continue;
32730
+ const source = block.map[at] ?? -1;
32731
+ if (/^(?:\*\*|__)/.test(ctx.doc.source.slice(source + 1, source + 3)) || /(?:\*\*|__)$/.test(ctx.doc.source.slice(source - 2, source))) continue;
32732
+ if (block.links.some((link) => link.start <= at && link.end > at)) continue;
32733
+ if (insideQuotes(block.norm, at, at + 1)) continue;
32734
+ const clause = after.match(/^(?:[^.!?;]|[.!?](?=\S)){0,60}/)?.[0] ?? "";
32735
+ found.push({
32736
+ block,
32737
+ start: at,
32738
+ end: at + match[0].length + clause.trimEnd().length
32739
+ });
32740
+ }
32741
+ }
32742
+ if (found.length < 4 || found.length * 1e3 < 3 * ctx.proseWords) return;
32743
+ for (const item of found) ctx.hit(rule, item.block, item.start, item.end, `${found.length} mid-sentence colons in ${ctx.proseWords.toLocaleString("en-US")} words. A colon used as a pause in sentence after sentence is a common AI habit.`, "Use a full stop, or join the two parts with a plain word such as \"because\" or \"so\". Keep colons that introduce a list or a quotation.");
32744
+ }
32745
+ // packages/core/src/lint/rules-rhythm.ts
32746
+ const RHYTHM_RULES = {
32747
+ heresAnnouncement: {
32748
+ id: "heres-announcement",
32749
+ family: "ai",
32750
+ level: "error",
32751
+ presets: { docs: "off" },
32752
+ description: "A short \"Here's the X\" sentence that announces what comes next instead of saying it."
32753
+ },
32754
+ pithyFragment: {
32755
+ id: "pithy-fragment",
32756
+ family: "ai",
32757
+ level: "error",
32758
+ description: "Verbless slogan fragments: \"Same essay, two titles.\", \"Every month. No exceptions.\", \"$299 per month. That's it.\""
32759
+ },
32760
+ stockCloser: {
32761
+ id: "stock-closer",
32762
+ family: "ai",
32763
+ level: "error",
32764
+ description: "A stock kicker line: \"That's a real win.\" \"That is what makes this interesting.\" \"That's why X mattered.\""
32765
+ },
32766
+ negativeReframe: {
32767
+ id: "negative-reframe",
32768
+ family: "ai",
32769
+ level: "warning",
32770
+ description: "A short \"That's not how/what ...\" dismissal."
32771
+ },
32772
+ figurativeWorth: {
32773
+ id: "figurative-worth",
32774
+ family: "ai",
32775
+ level: "error",
32776
+ description: "A \"worth + -ing\" idiom that mixes its metaphor or points at the reader: \"a fight worth picking\", \"worth noting\"."
32777
+ },
32778
+ anaphora: {
32779
+ id: "anaphora",
32780
+ family: "ai",
32781
+ level: "error",
32782
+ description: "Short sentences in a row that start with the same word: two or more \"No ...\" sentences, or three or more starting \"It's\", \"They\", \"We\" or \"You\"."
32783
+ }
32784
+ };
32542
32785
  function heresAnnouncement(ctx) {
32543
- const rule = STRUCTURE_RULES.heresAnnouncement;
32786
+ const rule = RHYTHM_RULES.heresAnnouncement;
32544
32787
  if (ctx.level(rule) === "off") return;
32545
32788
  for (const block of ctx.blocks([
32546
32789
  "paragraph",
@@ -32595,7 +32838,7 @@ function fragmentRuns(ctx, rule) {
32595
32838
  }
32596
32839
  }
32597
32840
  function pithyFragment(ctx) {
32598
- const rule = STRUCTURE_RULES.pithyFragment;
32841
+ const rule = RHYTHM_RULES.pithyFragment;
32599
32842
  if (ctx.level(rule) === "off") return;
32600
32843
  fragmentRuns(ctx, rule);
32601
32844
  for (const block of ctx.blocks(RHYTHM_KINDS)) for (const sentence of ctx.sentences(block)) {
@@ -32618,11 +32861,12 @@ const CLOSERS = [
32618
32861
  /^(?:and |but |so )?(?:that|this)(?:'s| is| was) (?:exactly )?what makes [^.]{1,60}(?:interesting|special|different|powerful|unique|useful|valuable|effective|work|works|matter|compelling|worth \w+)\.$/i,
32619
32862
  /^(?:and |but |so )?(?:that|this)(?:'s| is) (?:why|where|how) (?:it|this|that) (?:matters|counts|works)\.$/i,
32620
32863
  /^(?:and |but )?that distinction matters\.$/i,
32864
+ /^(?:and |but |so )?(?:that|this)(?:'s| is| was) (?:why|what|how) [^.]{1,80} (?:mattered|made (?:all )?the difference|paid off)\.$/i,
32621
32865
  /^(?:and |but )?(?:that|this)(?:'s| is) (?:huge|everything|the whole thing|what matters|all that matters)\.$/i
32622
32866
  ];
32623
32867
  function stockCloser(ctx) {
32624
- const rule = STRUCTURE_RULES.stockCloser;
32625
- const reframe = STRUCTURE_RULES.negativeReframe;
32868
+ const rule = RHYTHM_RULES.stockCloser;
32869
+ const reframe = RHYTHM_RULES.negativeReframe;
32626
32870
  for (const block of ctx.blocks(RHYTHM_KINDS)) for (const sentence of ctx.sentences(block)) {
32627
32871
  const text = sentence.text;
32628
32872
  if (CLOSERS.some((re) => re.test(text))) {
@@ -32634,7 +32878,7 @@ function stockCloser(ctx) {
32634
32878
  }
32635
32879
  const FIGURATIVE_NOUNS = "fights?|battles?|hills?|wars?|bets?|gambles?|races?|risks?|horses?|roads?|bridges?|doors?|games?|ships?|cards?";
32636
32880
  function figurativeWorth(ctx) {
32637
- const rule = STRUCTURE_RULES.figurativeWorth;
32881
+ const rule = RHYTHM_RULES.figurativeWorth;
32638
32882
  const strong = new RegExp(`\\b(?:${FIGURATIVE_NOUNS}) worth \\w+ing\\b`, "gi");
32639
32883
  const reader = /\bworth (?:noting|mentioning|knowing|highlighting|calling out|pointing out|flagging|a (?:closer |second )?look)\b/gi;
32640
32884
  const any = /\b(\w+) worth (\w+ing)\b/gi;
@@ -32679,7 +32923,7 @@ function staccato(ctx) {
32679
32923
  }
32680
32924
  }
32681
32925
  function anaphora(ctx) {
32682
- const rule = STRUCTURE_RULES.anaphora;
32926
+ const rule = RHYTHM_RULES.anaphora;
32683
32927
  if (ctx.level(rule) === "off") return;
32684
32928
  for (const block of ctx.blocks(RHYTHM_KINDS)) {
32685
32929
  const sentences = ctx.sentences(block);
@@ -32708,186 +32952,24 @@ function anaphora(ctx) {
32708
32952
  }
32709
32953
  }
32710
32954
  }
32711
- const TIER2 = /\b(?:crucial(?:ly)?|pivotal|vibrant|comprehensive|enhanc(?:e|es|ed|ing|ement)|foster(?:s|ed|ing)?|harness(?:es|ed|ing)?|navigat(?:e|es|ed|ing)|streamlin(?:e|es|ed|ing)|empower(?:s|ed|ing|ment)?|elevat(?:e|es|ed|ing)|unleash(?:es|ed|ing)?|transformative|nuanced?|myriad|plethora|encompass(?:es|ed|ing)?|cultivat(?:e|es|ed|ing)|resonat(?:e|es|ed|ing)|cornerstone|poised|burgeoning|nascent|quintessential|overarching|actionable|impactful|landscape|ecosystem|journey|additionally|notably|moreover|furthermore|profound(?:ly)?|quietly|fundamentally|remarkabl[ey]|arguably|invaluable|deeply (?:rooted|committed|integrated|personal|meaningful))\b/gi;
32712
- const TECHNICAL = /^(?:comprehensive|ecosystem|streamlin|navigat)/i;
32713
- function vocabularyCluster(ctx) {
32714
- const rule = STRUCTURE_RULES.vocabularyCluster;
32715
- if (ctx.level(rule) === "off") return;
32716
- for (const block of ctx.blocks([
32717
- "paragraph",
32718
- "list",
32719
- "quote",
32720
- "prop",
32721
- "heading",
32722
- "description",
32723
- "title"
32724
- ])) {
32725
- const seen = /* @__PURE__ */ new Map();
32726
- TIER2.lastIndex = 0;
32727
- for (const found of block.norm.matchAll(TIER2)) {
32728
- const word = found[0].toLowerCase();
32729
- if (ctx.preset === "docs" && TECHNICAL.test(word)) continue;
32730
- const stem = word.slice(0, 6);
32731
- const start = found.index ?? 0;
32732
- if (ctx.preset === "landing" || ctx.preset === "meta") {
32733
- ctx.hit(rule, block, start, start + found[0].length, `"${found[0]}" is filler in short copy.`, "Use the plain word, or the concrete thing it stands for.");
32734
- continue;
32735
- }
32736
- if (!seen.has(stem)) seen.set(stem, start);
32737
- if (seen.size === 2 && !seen.has(`${stem}!`)) {
32738
- seen.set(`${stem}!`, start);
32739
- const listed = [...seen.keys()].filter((key) => !key.endsWith("!"));
32740
- ctx.hit(rule, block, start, start + found[0].length, `This paragraph stacks words common in AI text (${listed.length} of them, ending with "${found[0]}").`, "Rewrite with plain words: \"important\" for crucial, \"help\" for foster, \"field\" for landscape, or cut them.");
32741
- }
32742
- }
32743
- }
32744
- }
32745
- const SERIES = /\b[\w'$-]+(?: [\w'$-]+){0,5}(?:, [\w'$-]+(?: [\w'$-]+){0,5}){1,3},? (?:and|or) [\w'$-]+(?: [\w'$-]+){0,5}/g;
32746
- const ABSTRACT_TRIAD = /\b[a-z]+(?:tion|sion|ity|ness|ment|ence|ance|ism), (?:and )?[a-z]+(?:tion|sion|ity|ness|ment|ence|ance|ism),? and [a-z]+(?:tion|sion|ity|ness|ment|ence|ance|ism)\b/gi;
32747
- const ECHO = new Set("to our your their my his her its every each more less no it they we you".split(" "));
32748
- const COPULA = /\b(?:is|are|was|were|'s|feels?|felt|looks?|stays?|remains?|seems?)\s+$/i;
32749
- function formulaTriad(items, before) {
32750
- const firsts = items.map((item) => words$2(item)[0]?.toLowerCase() ?? "");
32751
- const echo = firsts[0] ?? "";
32752
- if (ECHO.has(echo) && firsts.every((first) => first === echo)) return `Each item opens with "${echo}".`;
32753
- if (items.every((item) => /^(?:the|their|our|your|its|it|they|we|you|he|she)\b/i.test(item) && words$2(item).length >= 3 && words$2(item).length <= 7 && !verbless(item))) return "Three parallel clauses in a row.";
32754
- if (items.every((item) => /^[a-z]/.test(item) && words$2(item).length <= 2 && !PREPOSITIONS.has(words$2(item)[0] ?? "")) && COPULA.test(before)) return "A string of adjectives after \"is\".";
32755
- if (items.every((item) => /^\w+ed\b/i.test(item) && words$2(item).length <= 3)) return "A string of past participles.";
32756
- return null;
32757
- }
32758
- function triads(ctx) {
32759
- const rule = STRUCTURE_RULES.triad;
32760
- if (ctx.level(rule) === "off") return;
32761
- for (const block of ctx.blocks([
32762
- "paragraph",
32763
- "quote",
32764
- "prop",
32765
- "list"
32766
- ])) {
32767
- const taken = [];
32768
- ABSTRACT_TRIAD.lastIndex = 0;
32769
- for (const match of block.norm.matchAll(ABSTRACT_TRIAD)) {
32770
- const start = match.index ?? 0;
32771
- taken.push([start, start + match[0].length]);
32772
- ctx.hit(rule, block, start, start + match[0].length, "Three abstract nouns in a row sound weighty but say little.", "Keep the one that matters and give an example of it.");
32773
- }
32774
- for (const sentence of ctx.sentences(block)) {
32775
- SERIES.lastIndex = 0;
32776
- for (const match of sentence.text.matchAll(SERIES)) {
32777
- let from = match.index ?? 0;
32778
- const raw = match[0].split(/,\s*(?:(?:and|or)\s+)?|\s+(?:and|or)\s+(?=[^,]*$)/);
32779
- if (raw.length < 3) continue;
32780
- const items = [...raw];
32781
- const head = raw[0] ?? "";
32782
- const lead = /^.*\b(?:is|are|was|were|'s|feels?|looks?|stays?|remains?|seems?|of|for|to|with|by|from|on|in|like|including|as)\s+/i.exec(head);
32783
- if (lead && words$2(head.slice(lead[0].length)).length) {
32784
- items[0] = head.slice(lead[0].length);
32785
- from += lead[0].length;
32786
- }
32787
- const end = sentence.start + (match.index ?? 0) + match[0].length;
32788
- const before = block.norm.slice(sentence.start, sentence.start + from);
32789
- const echo = words$2(raw[1] ?? "")[0]?.toLowerCase() ?? "";
32790
- const inFirst = new RegExp(`\\b${echo}\\b(?!.*\\b${echo}\\b)`, "i").exec(head);
32791
- if (ECHO.has(echo) && inFirst && inFirst.index > 0) {
32792
- items[0] = head.slice(inFirst.index);
32793
- from = (match.index ?? 0) + inFirst.index;
32794
- }
32795
- const plain = formulaTriad(raw, "");
32796
- const why = plain ?? formulaTriad(items, before);
32797
- if (!why) continue;
32798
- if (plain) from = match.index ?? 0;
32799
- const start = sentence.start + from;
32800
- if (taken.some(([a, b]) => start < b && end > a)) continue;
32801
- taken.push([start, end]);
32802
- ctx.hit(rule, block, start, end, `A list of ${items.length} that reads as a formula. ${why}`, "Keep the items the reader needs. If all of them are needed, write them plainly or as two sentences; if one was added for rhythm, cut it.");
32803
- }
32804
- }
32805
- }
32806
- }
32807
- function countedPatterns(ctx) {
32808
- const labels = STRUCTURE_RULES.inventedLabel;
32809
- const clefts = STRUCTURE_RULES.pseudoCleft;
32810
- for (const [rule, re] of [[labels, /\bthe [a-z]+(?:-[a-z]+)? (?:paradox|trap|tax|creep|divide|vacuum|inversion|cliff|treadmill|illusion|fallacy|flywheel|moat)\b/gi], [clefts, /(?:^|[.!?]\s+)(?:What (?:makes|made|matters|changed|really|actually|you get|this means|I (?:like|love|learned|found))\b[^.!?]{0,40}\s+(?:is|was)\b|The (?:problem|difference|catch|key|trick|point|reason) is that\b)/g]]) {
32811
- if (ctx.level(rule) === "off") continue;
32812
- const found = [];
32813
- for (const block of ctx.blocks(RHYTHM_KINDS)) {
32814
- re.lastIndex = 0;
32815
- for (const match of block.norm.matchAll(re)) {
32816
- let start = match.index ?? 0;
32817
- while (/[\s.!?]/.test(block.norm[start] ?? "")) start++;
32818
- found.push({
32819
- block,
32820
- start,
32821
- end: (match.index ?? 0) + match[0].length
32822
- });
32823
- }
32824
- }
32825
- if (found.length < 2) continue;
32826
- for (const item of found) ctx.hit(rule, item.block, item.start, item.end, rule === labels ? `${found.length} coined labels in one piece. Each asks the reader to learn a term.` : `${found.length} "What X is" or "The problem is that" setups in one piece.`, rule === labels ? "Describe the thing in plain words instead of naming it." : "Start with the subject and say the thing directly.");
32827
- }
32828
- }
32829
- function boldLabels(ctx) {
32830
- const rule = STRUCTURE_RULES.boldLabels;
32831
- if (ctx.level(rule) === "off") return;
32832
- if (ctx.doc.format !== "md" && ctx.doc.format !== "mdx") return;
32833
- const lists = ctx.blocks(["list"]);
32834
- let run = [];
32835
- const report = () => {
32836
- if (run.length >= 3) {
32837
- const first = run[0];
32838
- ctx.hit(rule, first, 0, Math.min(first.text.length, 60), `${run.length} list items in a row open with a bold label.`, "Drop the bold labels and write each item as one plain sentence, or use a table if the items really are parallel.");
32839
- }
32840
- run = [];
32841
- };
32842
- let previous = null;
32843
- for (const block of lists) {
32844
- const offset = block.map[0] ?? 0;
32845
- const line = ctx.doc.source.lastIndexOf("\n", offset) + 1;
32846
- const raw = ctx.doc.source.slice(line, offset + 4);
32847
- const bold = /^\s*(?:[-*+]|\d{1,9}[.)])\s+(?:\*\*|__)/.test(raw);
32848
- const adjacent = previous !== null && ctx.doc.blocks.indexOf(block) === ctx.doc.blocks.indexOf(previous) + 1;
32849
- if (!bold || !adjacent) report();
32850
- if (bold) run.push(block);
32851
- previous = block;
32852
- }
32853
- report();
32854
- }
32855
- function boldEmphasis(ctx) {
32856
- const rule = STRUCTURE_RULES.boldEmphasis;
32857
- if (ctx.level(rule) === "off") return;
32858
- const markdown = ctx.doc.format === "md" || ctx.doc.format === "mdx";
32859
- const re = markdown ? /(\*\*|__)(?=\S)[^*_\n]+?\1/g : /<(strong|b)\b[^>]*>[^<]{1,200}<\/\1>/gi;
32860
- const prose = ctx.blocks([
32861
- "paragraph",
32862
- "list",
32863
- "quote",
32864
- "prop"
32865
- ]);
32866
- const spans = [];
32867
- for (const found of ctx.doc.source.matchAll(re)) {
32868
- const open = markdown ? 2 : found[0].indexOf(">") + 1;
32869
- const from = (found.index ?? 0) + open;
32870
- const to = (found.index ?? 0) + found[0].length - (markdown ? 2 : found[0].length - found[0].lastIndexOf("<"));
32871
- for (const block of prose) {
32872
- const first = block.map[0] ?? 0;
32873
- const last = block.map[block.map.length - 1] ?? 0;
32874
- if (from < first || from > last) continue;
32875
- const start = block.map.indexOf(from);
32876
- if (start <= 0 && block.kind === "list") break;
32877
- if (start < 0) break;
32878
- let end = start;
32879
- while (end < block.map.length && (block.map[end] ?? 0) < to) end++;
32880
- spans.push({
32881
- block,
32882
- start,
32883
- end
32884
- });
32885
- break;
32886
- }
32887
- }
32888
- if (spans.length < 3 || spans.length * 100 <= ctx.proseWords) return;
32889
- for (const span of spans) ctx.hit(rule, span.block, span.start, span.end, `${spans.length} bold phrases in ${ctx.proseWords.toLocaleString("en-US")} words of prose. Bold this often stops meaning "important".`, "Remove the bold here. Keep bold, if any, for the one thing a skimming reader must not miss.");
32890
- }
32955
+ // packages/core/src/lint/rules-structure.ts
32956
+ const STRUCTURE_RULES = {
32957
+ negativeParallelism: CONTRAST_RULES.negativeParallelism,
32958
+ contrastReframe: CONTRAST_RULES.contrastReframe,
32959
+ heresAnnouncement: RHYTHM_RULES.heresAnnouncement,
32960
+ pithyFragment: RHYTHM_RULES.pithyFragment,
32961
+ stockCloser: RHYTHM_RULES.stockCloser,
32962
+ negativeReframe: RHYTHM_RULES.negativeReframe,
32963
+ figurativeWorth: RHYTHM_RULES.figurativeWorth,
32964
+ anaphora: RHYTHM_RULES.anaphora,
32965
+ vocabularyCluster: COUNTED_RULES.vocabularyCluster,
32966
+ triad: COUNTED_RULES.triad,
32967
+ inventedLabel: COUNTED_RULES.inventedLabel,
32968
+ colonDensity: COUNTED_RULES.colonDensity,
32969
+ pseudoCleft: COUNTED_RULES.pseudoCleft,
32970
+ boldEmphasis: BOLD_RULES.boldEmphasis,
32971
+ boldLabels: BOLD_RULES.boldLabels
32972
+ };
32891
32973
  function runStructureRules(ctx) {
32892
32974
  negativeParallelism(ctx);
32893
32975
  contrastReframe(ctx);
@@ -32900,6 +32982,7 @@ function runStructureRules(ctx) {
32900
32982
  vocabularyCluster(ctx);
32901
32983
  triads(ctx);
32902
32984
  countedPatterns(ctx);
32985
+ colonDensity(ctx);
32903
32986
  boldLabels(ctx);
32904
32987
  boldEmphasis(ctx);
32905
32988
  }
@@ -35143,7 +35226,7 @@ async function analyticsBeside(access, site, range, before, pages) {
35143
35226
  }
35144
35227
  // packages/core/src/commands/audit.ts
35145
35228
  const AUDIT_SECTION = "weekly-audit";
35146
- const AUDIT_SECTION_TEXT = "What the weekly crawl of the site found (broken and redirected internal links, missing, empty or duplicate titles and descriptions, missing H1s, noindex for Google, canonicals to another page, sitemap URLs that do not return 200, thin pages, tags that JavaScript changes), with what is new, back or resolved since the crawl before. Only for sites added to the weekly site audit beta.";
35229
+ const AUDIT_SECTION_TEXT = "What the weekly crawl of the site found (broken and redirected internal links, missing, empty or duplicate titles and descriptions, missing H1s, noindex for Google, canonicals to another page, sitemap URLs that do not return 200, thin pages, tags that JavaScript changes), with what is new, back or resolved since the crawl before. Only for sites in the weekly site audit.";
35147
35230
  const AUDIT_RULES = {
35148
35231
  link_to_error: "Internal links to a page that returns an error",
35149
35232
  link_to_redirect: "Internal links to a redirect",
@@ -38202,6 +38285,46 @@ async function saveResearch(store, key, saved) {
38202
38285
  if (!store) return;
38203
38286
  await store.put(key, JSON.stringify(saved), RESEARCH_TTL_SECONDS).catch(() => void 0);
38204
38287
  }
38288
+ // packages/core/src/commands/research-installed.ts
38289
+ async function installedSerpResearch(provider, input, serp) {
38290
+ if (!serp) throw new CommandError("INVALID_INPUT", `${provider} is not a built-in provider. Here the providers are dataforseo and ahrefs; installed provider packages run only in the seo CLI and the local MCP server (seo mcp serve).`);
38291
+ if (input.keywords.length === 0) throw new CommandError("INVALID_INPUT", "serp needs keywords.");
38292
+ const keywords = input.keywords.slice(0, serpKeywords(input));
38293
+ const language = dataForSeoMarket(input.country, null).language_code;
38294
+ const missed = [];
38295
+ const warnings = [];
38296
+ let costMicros = 0;
38297
+ let partial = false;
38298
+ let depth = serpDepth(input);
38299
+ const rows = await eachKeyword(keywords, missed, async (keyword) => {
38300
+ const got = await serp({
38301
+ provider,
38302
+ keyword,
38303
+ country: input.country,
38304
+ language,
38305
+ device: input.device ?? "desktop",
38306
+ depth: serpDepth(input)
38307
+ });
38308
+ depth = Math.min(depth, got.depth);
38309
+ costMicros = costMicros === null || got.costMicros === null ? null : costMicros + got.costMicros;
38310
+ partial ||= got.partial;
38311
+ warnings.push(...got.warnings.map((warning) => `${keyword}: ${warning}`));
38312
+ return got.rows.map((row) => ({
38313
+ keyword,
38314
+ ...row
38315
+ }));
38316
+ });
38317
+ const answered = new Set(rows.map((row) => row.keyword));
38318
+ if (depth < serpDepth(input)) warnings.unshift(`The package reads at most ${depth} results a keyword, so this read ${depth} of the ${serpDepth(input)} asked for.`);
38319
+ return {
38320
+ rows,
38321
+ costUsd: costMicros === null ? null : Number((costMicros / 1e6).toFixed(6)),
38322
+ partial,
38323
+ missed,
38324
+ noData: keywords.filter((keyword) => !missed.includes(keyword) && !answered.has(keyword)),
38325
+ warnings
38326
+ };
38327
+ }
38205
38328
  // packages/core/src/commands/research.ts
38206
38329
  const RESEARCH_ACTIONS = [
38207
38330
  "keyword_metrics",
@@ -38218,7 +38341,7 @@ const RESEARCH_ACTIONS = [
38218
38341
  "index_check"
38219
38342
  ];
38220
38343
  const RESEARCH_PROVIDERS = ["dataforseo", "ahrefs"];
38221
- const RESEARCH_HELP = `provider is optional: without it the call uses the saved key, DataForSEO when both are saved. The target is a domain (the whole site), a path ending in / such as example.com/blog/ (every URL under it), or one page; scope overrides that. keyword_metrics (keywords: volume, difficulty, CPC), keyword_ideas (up to 5 seed keywords: searches that contain each seed, by volume), ranked_keywords (target: keywords a site, subfolder or page ranks for, with the provider's traffic total for the whole target), top_pages (target: the pages with the most estimated organic traffic), serp (keywords, up to 5: the ranking pages with their organic position beside DataForSEO's rank_absolute, which also counts AI Overviews and other blocks, plus the AI Overview's sources; device desktop or mobile, DataForSEO only; each with its domain's authority: DataForSEO domain_rank 0 to 100, Ahrefs domain_rating; depth sets results per keyword, default 20; rows run position by position across the keywords), index_check (DataForSEO only; target: one page URL; keywords: up to 2 exact phrases from the page, default its H1 or title. Searches Google for site:<url> and each "<phrase>" on desktop and mobile, retries failed searches, treats Google's fallback to unrelated sites as no match, and says indexed, not found or unknown with each search's evidence; about $0.01 a page), serp_overlap (2 to 10 keywords: for each pair, how many of their top 10 pages and sites are the same, to decide one page or several; results without a real page are counted, not compared), competitors (target: domains that share keywords), backlinks (target: referring domains), pages_by_backlinks (target: the pages with the most referring domains), link_gap (target and 2 to 5 competitors: referring domains that link to two or more competitors and not the target, highest authority first, from each site's top 1,000 referring domains; costs one backlinks call per site), ai_answers (DataForSEO only; target: the site. Without keywords it takes the site’s top 10 chat-style and long questions from Search Console’s AI-shaped queries itself. With up to 10 questions in keywords it asks those instead, and the target can be any domain, such as a competitor's. Each answer row also lists the other sites it cites, and the notes rank them. Answers come from DataForSEO's queue: answers not ready after about 40 seconds are returned as tasks, already paid for; call again with the same target and those tasks to read them at no cost. It asks ChatGPT search, Google AI Mode and Google AI Overviews each one and says whether the answer cites or mentions the site. DataForSEO’s queue prices are about $0.0072 a question across the three engines, so about $0.07 a run: tell the person before running it). Rows with a domain, and the target, get a free Ahrefs domain_rating column. Numbers are provider estimates, not Search Console data.`;
38344
+ const RESEARCH_HELP = `provider is optional: without it the call uses the saved key, DataForSEO when both are saved. In the CLI and the local MCP server, serp can also use a provider package installed on this machine that supplies live search results: pass its id as provider. The target is a domain (the whole site), a path ending in / such as example.com/blog/ (every URL under it), or one page; scope overrides that. keyword_metrics (keywords: volume, difficulty, CPC), keyword_ideas (up to 5 seed keywords: searches that contain each seed, by volume), ranked_keywords (target: keywords a site, subfolder or page ranks for, with the provider's traffic total for the whole target), top_pages (target: the pages with the most estimated organic traffic), serp (keywords, up to 5: the ranking pages with their organic position beside DataForSEO's rank_absolute, which also counts AI Overviews and other blocks, plus the AI Overview's sources; device desktop or mobile, DataForSEO only; each with its domain's authority: DataForSEO domain_rank 0 to 100, Ahrefs domain_rating; depth sets results per keyword, default 20; rows run position by position across the keywords), index_check (DataForSEO only; target: one page URL; keywords: up to 2 exact phrases from the page, default its H1 or title. Searches Google for site:<url> and each "<phrase>" on desktop and mobile, retries failed searches, treats Google's fallback to unrelated sites as no match, and says indexed, not found or unknown with each search's evidence; about $0.01 a page), serp_overlap (2 to 10 keywords: for each pair, how many of their top 10 pages and sites are the same, to decide one page or several; results without a real page are counted, not compared), competitors (target: domains that share keywords), backlinks (target: referring domains), pages_by_backlinks (target: the pages with the most referring domains), link_gap (target and 2 to 5 competitors: referring domains that link to two or more competitors and not the target, highest authority first, from each site's top 1,000 referring domains; costs one backlinks call per site), ai_answers (DataForSEO only; target: the site. Without keywords it takes the site’s top 10 chat-style and long questions from Search Console’s AI-shaped queries itself. With up to 10 questions in keywords it asks those instead, and the target can be any domain, such as a competitor's. Each answer row also lists the other sites it cites, and the notes rank them. Answers come from DataForSEO's queue: answers not ready after about 40 seconds are returned as tasks, already paid for; call again with the same target and those tasks to read them at no cost. It asks ChatGPT search, Google AI Mode and Google AI Overviews each one and says whether the answer cites or mentions the site. DataForSEO’s queue prices are about $0.0072 a question across the three engines, so about $0.07 a run: tell the person before running it). Rows with a domain, and the target, get a free Ahrefs domain_rating column. Numbers are provider estimates, not Search Console data.`;
38222
38345
  const GENERIC_PLATFORMS = [
38223
38346
  "youtube.com",
38224
38347
  "facebook.com",
@@ -38280,6 +38403,8 @@ async function runResearch(input, keys, options) {
38280
38403
  const offset = input.offset ?? 0;
38281
38404
  if (input.action === "ai_answers") throw new CommandError("INVALID_INPUT", "ai_answers runs on its own.");
38282
38405
  const provider = chooseProvider(input.provider, keys);
38406
+ const builtIn = RESEARCH_PROVIDERS.includes(provider) ? provider : null;
38407
+ if (!builtIn && input.action !== "serp") throw new CommandError("INVALID_INPUT", `An installed provider answers serp only; ${input.action} needs a built-in provider.`);
38283
38408
  if (input.action === "index_check") {
38284
38409
  if (provider === "ahrefs") throw new CommandError("INVALID_INPUT", "index_check uses DataForSEO: it runs live Google searches, which Ahrefs does not offer.");
38285
38410
  return runIndexCheck({
@@ -38312,20 +38437,23 @@ async function runResearch(input, keys, options) {
38312
38437
  const store = options.store ?? workersResearchStore();
38313
38438
  const key = await researchKey([
38314
38439
  provider,
38315
- provider === "dataforseo" ? keys.get("x-dataforseo-login") : keys.get("x-ahrefs-key"),
38440
+ builtIn ? keys.get(KEY_HEADER[builtIn]) : null,
38316
38441
  request
38317
38442
  ]);
38318
38443
  const saved = await readResearch(store, key, limit);
38319
- const result = saved?.result ?? await research(provider, keys, {
38444
+ const result = saved?.result ?? (builtIn ? await research(builtIn, keys, {
38320
38445
  ...request,
38321
38446
  limit
38322
- });
38447
+ }) : await installedSerpResearch(provider, {
38448
+ ...request,
38449
+ limit
38450
+ }, options.installedSerp));
38323
38451
  if (!saved) await saveResearch(store, key, {
38324
38452
  limit,
38325
38453
  savedAt: (/* @__PURE__ */ new Date()).toISOString(),
38326
38454
  result
38327
38455
  });
38328
- const { rows: fetched, costUsd: paid, partial, missed, noData, floor, leftOut, available, siteTotal, rankFailed, compared, aiOverviews } = result;
38456
+ const { rows: fetched, costUsd: paid, partial, missed, noData, floor, leftOut, available, siteTotal, rankFailed, compared, aiOverviews, warnings } = result;
38329
38457
  const costUsd = saved ? 0 : paid;
38330
38458
  const order = new Map(request.keywords.map((word, index) => [word, index]));
38331
38459
  const found = input.action === "serp" && request.keywords.length > 1 ? [...fetched].sort((a, b) => Number(a.position ?? 0) - Number(b.position ?? 0) || (order.get(String(a.keyword)) ?? 0) - (order.get(String(b.keyword)) ?? 0)) : fetched;
@@ -38354,18 +38482,19 @@ async function runResearch(input, keys, options) {
38354
38482
  notes: [
38355
38483
  `${provider} estimates, in the provider’s own units.`,
38356
38484
  ...compared ? [`Compared: ${compared.withPage} of ${compared.results} top results had a real page, so shared_pages counts only those; ${compared.results - compared.withPage} came back as Google redirect links and could not be compared by page. ${compared.withSite} had a known site for shared_sites. Unique pages and sites are counted per keyword.${compared.withPage < compared.results / 2 && provider === "dataforseo" ? " With this few pages, shared_pages cannot settle one page or several; provider ahrefs returns real pages." : ""}`] : [],
38357
- ...VOLUME_ACTIONS.includes(input.action) ? [`Volume model: ${VOLUME_MODEL[provider]} ${VOLUMES_DIFFER}`] : [],
38485
+ ...VOLUME_ACTIONS.includes(input.action) && builtIn ? [`Volume model: ${VOLUME_MODEL[builtIn]} ${VOLUMES_DIFFER}`] : [],
38358
38486
  ...input.action === "serp" || input.action === "ranked_keywords" ? [positionNote(provider)] : [],
38359
38487
  ...aiOverviews?.length ? [aiOverviewNote(aiOverviews, request.keywords.length)] : input.action === "serp" && provider === "dataforseo" && rows.length ? ["No AI Overview on these results pages."] : [],
38360
38488
  ...perKeyword ? [`Results per keyword: ${Object.entries(perKeyword).map(([word, count]) => `${word} ${count}`).join(", ")}. Rows run position by position across the keywords.`] : [],
38361
- ...siteTotal ? [siteTotalNote(provider, siteTotal, rows.length)] : [],
38489
+ ...siteTotal && builtIn ? [siteTotalNote(builtIn, siteTotal, rows.length)] : [],
38362
38490
  ...available !== void 0 && available > found.length ? [`Capped: ${provider} has ${available.toLocaleString("en-US")} rows for this; this read the first ${found.length.toLocaleString("en-US")} in its order.`] : [],
38363
38491
  ...!found.length && scope ? [emptyNote(provider, input.action)] : [],
38364
38492
  ...input.action === "serp" && provider === "dataforseo" ? [rankFailed ? "domain_rank is missing: the DataForSEO rank call failed, so it is unknown, not zero." : "domain_rank is DataForSEO's own authority score for the domain, 0 to 100. It is not Ahrefs' Domain Rating."] : [],
38365
38493
  ...input.action === "serp" && !drKey && provider === "dataforseo" ? ["No domain_rating column: Domain Rating by Ahrefs needs an Ahrefs key (or the hosted MCP at https://seoskill.dev/mcp, which adds it)."] : [],
38366
38494
  ...store && rated.rows.length > 50 ? ["The result is kept for a day, so the next pages, and the same rows in full, cost nothing more."] : [],
38367
- ...saved ? [`Read from the result saved at ${saved.savedAt}, at no new cost${paid ? ` (it cost $${paid} then)` : ""}. Results are kept for a day.`] : costUsd !== null ? [`DataForSEO cost: $${costUsd}.`] : [],
38368
- ...partial ? ["Partial: DataForSEO could not fetch some pages of results, so rows may be missing."] : [],
38495
+ ...saved ? [`Read from the result saved at ${saved.savedAt}, at no new cost${paid ? ` (it cost $${paid} then)` : ""}. Results are kept for a day.`] : costUsd !== null ? [builtIn ? `DataForSEO cost: $${costUsd}.` : `Cost the ${provider} package reports: $${costUsd}.`] : [],
38496
+ ...partial ? [`Partial: ${builtIn ? "DataForSEO" : provider} could not fetch some pages of results, so rows may be missing.`] : [],
38497
+ ...warnings?.length ? [`${provider} warnings: ${warnings.join(" ")}`] : [],
38369
38498
  ...missed.length ? [`Partial: ${provider} failed for ${missed.join(", ")}, so those keywords have no rows. Ask for them again.`] : [],
38370
38499
  ...noData.length ? [noDataNote(provider, input.action, noData)] : [],
38371
38500
  ...byDr ? [rows.length > GAP_RATED ? `Sorted by Domain Rating for the top ${GAP_RATED} rows by DataForSEO rank; the ${rows.length - GAP_RATED} rows after them follow by rank, with no Domain Rating.` : "Sorted by Domain Rating, then DataForSEO rank."] : [],
@@ -38383,9 +38512,9 @@ async function runResearch(input, keys, options) {
38383
38512
  action: input.action,
38384
38513
  target: target || null,
38385
38514
  scope,
38386
- siteTotal: siteTotal ? {
38515
+ siteTotal: siteTotal && builtIn ? {
38387
38516
  ...siteTotal,
38388
- model: TRAFFIC_MODEL[provider]
38517
+ model: TRAFFIC_MODEL[builtIn]
38389
38518
  } : null,
38390
38519
  available: available ?? null,
38391
38520
  country,
@@ -38400,6 +38529,7 @@ async function runResearch(input, keys, options) {
38400
38529
  partial,
38401
38530
  missedKeywords: missed,
38402
38531
  noDataKeywords: noData,
38532
+ ...warnings?.length ? { warnings } : {},
38403
38533
  ...input.action === "link_gap" ? {
38404
38534
  competitors: input.competitors ?? [],
38405
38535
  cutAt: floor ?? null,
@@ -38416,6 +38546,7 @@ async function runResearch(input, keys, options) {
38416
38546
  };
38417
38547
  }
38418
38548
  function positionNote(provider) {
38549
+ if (provider !== "dataforseo" && provider !== "ahrefs") return `position is the organic position the ${provider} package reports (its rankGroup); rank_absolute is its rank among every block on the page, and type is featured_snippet for a featured snippet, which has no organic position.`;
38419
38550
  return provider === "dataforseo" ? "position is the organic position: the nth organic link (DataForSEO rank_group). rank_absolute counts every block on the page from the top, AI Overviews, People Also Ask, videos and images included, so it is higher. A featured snippet has type featured_snippet and no organic position." : "position is the organic position: the nth row Ahrefs marks organic. ahrefs_position is Ahrefs' own position field, and type lists what each row is.";
38420
38551
  }
38421
38552
  function aiOverviewNote(overviews, keywords) {
@@ -39184,11 +39315,11 @@ async function runAllSites(deps, sites) {
39184
39315
  if (!data && sites) {
39185
39316
  const list = await sites();
39186
39317
  return {
39187
- text: `No site given. Pick one below and send it: ${deps.call("report", { site: "<site>" })}. The summary of every site is for accounts in the weekly site audit beta.\n\n${list.text}`,
39318
+ text: `No site given. Pick one below and send it: ${deps.call("report", { site: "<site>" })}. The summary of every site is for accounts with the weekly site audit.\n\n${list.text}`,
39188
39319
  data: list.data
39189
39320
  };
39190
39321
  }
39191
- if (!data) throw new CommandError("INVALID_INPUT", `No site given. Name one: ${deps.call("report", { site: "<site>" })}. The summary of every site is for accounts in the weekly site audit beta.`);
39322
+ if (!data) throw new CommandError("INVALID_INPUT", `No site given. Name one: ${deps.call("report", { site: "<site>" })}. The summary of every site is for accounts with the weekly site audit.`);
39192
39323
  const startMs = Date.parse(`${data.start}T00:00:00Z`);
39193
39324
  const endMs = Date.parse(`${data.end}T00:00:00Z`) + DAY_MS;
39194
39325
  const urgency = (site) => issues(site, startMs, endMs)[0]?.rank ?? Number.POSITIVE_INFINITY;
@@ -39283,9 +39414,9 @@ const SHARED_TOOLS = [
39283
39414
  name: "seo_report",
39284
39415
  command: "report",
39285
39416
  title: "Search Console report",
39286
- description: `Start here. Without site: a short summary of every site in the person's weekly site audit (beta) for last week, with each site's Google index, weekly crawl and search clicks, sites with changes first, ending with the site to ask about next; an account outside that beta gets its site list to pick from. With site: the main report for that Search Console property, the overview plus each section's row count and top rows. With site and section: that section's rows; page sections also check their top 20 URLs live. Sections:\n${Object.entries(SECTIONS).map(([id, text]) => `- ${id}: ${text}`).join("\n")}\n- ${ISSUES_SECTION}: ${ISSUES_SECTION_TEXT}\n- ${UPDATES_SECTION}: ${UPDATES_SECTION_TEXT}\nWith site, mark and issues: records what the person decided about those issue ids (fixed, ignored, or open to undo) and runs no checks.`,
39417
+ description: `Start here. Without site: a short summary of every site in the person's weekly site audit for last week, with each site's Google index, weekly crawl and search clicks, sites with changes first, ending with the site to ask about next; an account without the audit gets its site list to pick from. With site: the main report for that Search Console property, the overview plus each section's row count and top rows. With site and section: that section's rows; page sections also check their top 20 URLs live. Sections:\n${Object.entries(SECTIONS).map(([id, text]) => `- ${id}: ${text}`).join("\n")}\n- ${ISSUES_SECTION}: ${ISSUES_SECTION_TEXT}\n- ${UPDATES_SECTION}: ${UPDATES_SECTION_TEXT}\nWith site, mark and issues: records what the person decided about those issue ids (fixed, ignored, or open to undo) and runs no checks.`,
39287
39418
  input: z.object({
39288
- site: site.optional().describe("Leave it out for the summary of every audited site (weekly site audit beta). Otherwise a Search Console property or site, such as sc-domain:example.com, https://example.com/ or example.com."),
39419
+ site: site.optional().describe("Leave it out for the summary of every site in the weekly site audit. Otherwise a Search Console property or site, such as sc-domain:example.com, https://example.com/ or example.com."),
39289
39420
  section: z.enum([
39290
39421
  ...SECTION_IDS,
39291
39422
  ISSUES_SECTION,
@@ -39403,7 +39534,7 @@ const SHARED_TOOLS = [
39403
39534
  title: "Keyword, competitor, backlink and AI answer data",
39404
39535
  description: `Data from the person’s own DataForSEO or Ahrefs account, which costs them credits. It uses the key the person saved on their seoskill.dev account (or on this machine for the CLI). Actions: ${RESEARCH_HELP}`,
39405
39536
  input: z.object({
39406
- provider: z.enum(RESEARCH_PROVIDERS).optional().describe("Optional. Without it, the saved key; DataForSEO when both are saved."),
39537
+ provider: z.string().max(64).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).optional().describe(`${RESEARCH_PROVIDERS.join(" or ")}. Optional: without it, the saved key; DataForSEO when both are saved. For serp in the CLI and the local MCP server it can also be the id of an installed provider package with live search results.`),
39407
39538
  action: z.enum(RESEARCH_ACTIONS),
39408
39539
  keywords: z.array(z.string().min(1)).max(100).default([]),
39409
39540
  target: z.string().default("").describe("Domain (the whole site), a path ending in / for every URL under it, such as example.com/blog/, or one page."),
@@ -39420,7 +39551,7 @@ const SHARED_TOOLS = [
39420
39551
  run: async (surface, input) => {
39421
39552
  const more = (offset) => `seo_research with the same input, detail "rows", offset ${offset}`;
39422
39553
  if (input.action === "ai_answers") {
39423
- if (input.provider === "ahrefs") throw new CommandError("INVALID_INPUT", "ai_answers uses dataforseo.");
39554
+ if (input.provider && input.provider !== "dataforseo") throw new CommandError("INVALID_INPUT", "ai_answers uses dataforseo.");
39424
39555
  return runAiAnswers({
39425
39556
  site: input.keywords.length || input.tasks.length ? input.target : await surface.resolveSite(input.target),
39426
39557
  country: input.country,
@@ -39435,6 +39566,7 @@ const SHARED_TOOLS = [
39435
39566
  return runResearch(input, await surface.keys(), {
39436
39567
  drKey: surface.drKey,
39437
39568
  store: surface.researchStore,
39569
+ installedSerp: surface.installedSerp,
39438
39570
  call: more
39439
39571
  });
39440
39572
  }
@@ -39533,7 +39665,7 @@ function indexFromStore(shared) {
39533
39665
  const paged = "detail" in shared.input.shape;
39534
39666
  return {
39535
39667
  ...shared,
39536
- description: `${shared.description} For a site in the weekly site audit beta it answers at once from the URL Inspection results this server keeps for the site, checked in the background each day, and says how many URLs are covered, how many are queued and the time left.`,
39668
+ description: `${shared.description} For a site in the weekly site audit it answers at once from the URL Inspection results this server keeps for the site, checked in the background each day, and says how many URLs are covered, how many are queued and the time left.`,
39537
39669
  run: async (surface, parsed) => {
39538
39670
  const input = parsed;
39539
39671
  const audit = surface.deps.audit;
@@ -41314,6 +41446,133 @@ async function uninstallProviderExtension(id, options = {}) {
41314
41446
  ], { cwd: packagesDir });
41315
41447
  return removeInstalledProviderPackage(id);
41316
41448
  }
41449
+ // packages/core/src/provider-extensions/serp.ts
41450
+ const nullableText = z.string().max(5e4).nullable();
41451
+ const serpSnapshotResultSchema = z.object({
41452
+ observedAt: z.string().max(100),
41453
+ effectiveKeyword: z.string().trim().min(1).max(1e3),
41454
+ searchEngineDomain: z.string().max(253).nullable(),
41455
+ checkUrl: z.url().max(8192).nullable(),
41456
+ resultCount: z.number().int().nonnegative().safe().nullable(),
41457
+ pagesCount: z.number().int().nonnegative().max(100).safe().nullable(),
41458
+ features: z.array(z.string().trim().min(1).max(100)).max(100),
41459
+ organicResults: z.array(z.object({
41460
+ rankGroup: z.number().int().positive().safe(),
41461
+ rankAbsolute: z.number().int().positive().safe(),
41462
+ page: z.number().int().positive().max(100).safe(),
41463
+ domain: z.string().trim().min(1).max(253),
41464
+ url: z.url().max(8192),
41465
+ title: z.string().max(1e4).nullable(),
41466
+ description: nullableText,
41467
+ isFeaturedSnippet: z.boolean().nullable()
41468
+ }).strict()).max(100),
41469
+ localPack: z.object({
41470
+ present: z.boolean(),
41471
+ returnedRows: z.number().int().nonnegative().max(100).safe(),
41472
+ retainedRows: z.number().int().nonnegative().max(100).safe(),
41473
+ invalidRows: z.number().int().nonnegative().max(100).safe(),
41474
+ results: z.array(z.unknown()).max(100)
41475
+ }).strict(),
41476
+ coverage: z.object({
41477
+ returnedRows: z.number().int().nonnegative().max(1e4).safe(),
41478
+ retainedRows: z.number().int().nonnegative().max(100).safe(),
41479
+ invalidRows: z.number().int().nonnegative().max(1e4).safe(),
41480
+ providerTotalRows: z.number().int().nonnegative().safe().nullable(),
41481
+ completeness: z.enum([
41482
+ "complete",
41483
+ "partial",
41484
+ "capped"
41485
+ ]),
41486
+ nextCursor: z.string().max(500).nullable()
41487
+ }).strict(),
41488
+ request: z.object({
41489
+ endpoint: z.string().trim().min(1).max(500),
41490
+ filters: z.record(z.string().min(1).max(100), z.union([
41491
+ z.string().max(1e3),
41492
+ z.number().finite(),
41493
+ z.boolean()
41494
+ ])),
41495
+ sort: z.array(z.string().min(1).max(200)).max(20)
41496
+ }).strict(),
41497
+ cost: z.object({
41498
+ estimatedMicros: z.number().int().nonnegative().safe().nullable(),
41499
+ actualMicros: z.number().int().nonnegative().safe().nullable(),
41500
+ taskIds: z.array(z.string().min(1).max(500)).max(20),
41501
+ native: z.object({
41502
+ unit: z.string().trim().min(1).max(100),
41503
+ estimatedUnits: z.number().finite().nonnegative().nullable(),
41504
+ actualUnits: z.number().finite().nonnegative().nullable(),
41505
+ remainingBefore: z.number().finite().nonnegative().nullable()
41506
+ }).strict().optional()
41507
+ }).strict(),
41508
+ qualityWarnings: z.array(z.object({
41509
+ code: z.string().trim().min(1).max(100),
41510
+ message: z.string().trim().min(1).max(500),
41511
+ field: z.string().max(200).optional(),
41512
+ row: z.number().int().positive().safe().optional()
41513
+ }).strict()).max(50)
41514
+ }).strict();
41515
+ const same = (list, value) => !list || list.some((item) => item.toLowerCase() === value.toLowerCase());
41516
+ function supports(capability, market) {
41517
+ return capability.markets.some((entry) => same(entry.searchEngines, market.searchEngine) && same(entry.countryCodes, market.countryCode) && same(entry.languageCodes, market.languageCode) && same(entry.devices, market.device ?? "desktop"));
41518
+ }
41519
+ const installedProviderSerp = async (input) => {
41520
+ const loaded = await loadProviderExtensions();
41521
+ const provider = loaded.registry.get(input.provider);
41522
+ if (!provider) throw new CommandError("INVALID_INPUT", `No provider ${input.provider} is installed. The built-in providers are dataforseo and ahrefs; \`seo providers list\` shows installed packages.`);
41523
+ const capability = loaded.registry.capability(provider.id, "serp-snapshot");
41524
+ if (!capability) throw new CommandError("INVALID_INPUT", `${provider.displayName} has no live search results (serp-snapshot), so it cannot answer serp. \`seo providers describe ${provider.id}\` lists its own actions.`);
41525
+ const market = {
41526
+ searchEngine: "google",
41527
+ countryCode: input.country.toUpperCase(),
41528
+ languageCode: input.language,
41529
+ device: input.device
41530
+ };
41531
+ if (!supports(capability, market)) throw new CommandError("INVALID_INPUT", `${provider.displayName} has no ${input.device} Google results for country ${input.country} in language ${input.language}.`);
41532
+ let account;
41533
+ let credentials;
41534
+ try {
41535
+ account = normalizeProviderExtensionAccount(provider, readProviderExtensionAccount(provider.id));
41536
+ credentials = await readProviderExtensionCredentials({
41537
+ providerId: provider.id,
41538
+ account,
41539
+ fields: provider.connection.fields
41540
+ });
41541
+ } catch (error) {
41542
+ throw new CommandError("NO_KEY", `${error instanceof Error ? error.message : String(error)} Connect it with \`seo providers connect ${provider.id}\`.`);
41543
+ }
41544
+ const depth = Math.min(input.depth, capability.maxDepth);
41545
+ let raw;
41546
+ try {
41547
+ raw = await capability.run({
41548
+ account,
41549
+ credentials,
41550
+ keyword: input.keyword,
41551
+ market,
41552
+ depth
41553
+ }, runtimeForProvider(provider.id, { maxRequests: capability.maxRequests }));
41554
+ } catch (error) {
41555
+ throw new CommandError("PROVIDER_ERROR", safeProviderAdapterError(provider.id, error, credentials).message);
41556
+ }
41557
+ const parsed = serpSnapshotResultSchema.safeParse(raw);
41558
+ if (!parsed.success) throw new CommandError("PROVIDER_ERROR", `${provider.displayName} returned a results page that does not match the serp-snapshot shape.`);
41559
+ const result = parsed.data;
41560
+ const warnings = result.qualityWarnings.map((warning) => warning.message);
41561
+ return {
41562
+ rows: [...result.organicResults].sort((a, b) => a.rankAbsolute - b.rankAbsolute || (a.url < b.url ? -1 : 1)).map((item) => ({
41563
+ position: item.isFeaturedSnippet ? null : item.rankGroup,
41564
+ rank_absolute: item.rankAbsolute,
41565
+ type: item.isFeaturedSnippet ? "featured_snippet" : "organic",
41566
+ url: item.url,
41567
+ domain: item.domain,
41568
+ title: item.title
41569
+ })),
41570
+ costMicros: result.cost.actualMicros,
41571
+ partial: result.coverage.completeness === "partial",
41572
+ warnings,
41573
+ depth
41574
+ };
41575
+ };
41317
41576
  // packages/core/src/providers/ahrefs/schema.ts
41318
41577
  const ahrefsLimitsAndUsageResponseSchema = z.object({ limits_and_usage: z.object({
41319
41578
  api_key_expiration_date: z.string().trim().min(1).max(100),
@@ -42363,6 +42622,6 @@ function isoDate(daysAgo = 0) {
42363
42622
  date.setUTCDate(date.getUTCDate() - daysAgo);
42364
42623
  return date.toISOString().slice(0, 10);
42365
42624
  }
42366
- export { AHREFS_API_KEY_ENV, AHREFS_API_KEY_SECRET, AI_REFERRAL_SOURCES, AI_REFERRAL_SOURCES_VERSION, ANALYTICS_PROVIDER_IDS, AUDIT_PAGE_RULE_IDS, AhrefsClient, BING_API_KEY_ENV, BING_API_KEY_SECRET, BROWSER_USER_AGENT, CANNIBAL_MAXIMUM_DOMINANT_SHARE, CANNIBAL_MINIMUM_PAGE_IMPRESSIONS, CANNIBAL_MINIMUM_PAGE_SHARE, CLICKY_SITEKEY_ENV, CLICKY_SITE_KEYS_SECRET, CLOUD_SIGN_IN, CLOUD_URL, CRAWL_SKIP_REASONS, CTR_DEFAULT_LIMIT, CTR_MAX_LIMIT, CTR_MAX_MIN_IMPRESSIONS, DATAFORSEO_CREDENTIAL_SECRET, DATAFORSEO_LOGIN_ENV, DATAFORSEO_PASSWORD_ENV, DEFAULT_MAX_PAGES, DEFAULT_SEARCH_CONSOLE_EXPORT_ROW_LIMIT, DEFAULT_UNREACHED_PAGE_LIMIT, DataForSeoClient, DecisionModelError, DecisionRunner, GOOGLE_TIMEOUT_MS, GSC_FINAL_DATA_LAG_DAYS, GSC_TIME_ZONE, GoogleApiError, INCIDENTS_URL, JsonFileStorageAdapter, LINK_ROLES, LINT_MAX_FILES, LOCAL_BING_CONNECT, LOCAL_SIGN_IN, LOG_MAX_AGE_MS, LOG_MAX_FILE_BYTES, LOG_MAX_TOTAL_BYTES, LocalCredentialsProvider, MANAGED_PROVIDER_SECRET_NAMES, MAX_CRAWL_CONCURRENCY, MAX_CRAWL_DEPTH, MAX_CRAWL_PAGES, MAX_CRAWL_TIMEOUT_MS, MAX_MAX_PAGES, MAX_SEARCH_CONSOLE_EXPORT_FILES, MAX_SEARCH_CONSOLE_EXPORT_ROW_LIMIT, PAGE_TYPES, PROVIDER_ERROR_CODES, PROVIDER_SECRET_NAMES, ProviderError, ProviderExtensionRegistry, RESEARCH_IMPORT_COLUMN_KEYS, ResponseSizeLimitError, SEARCH_INTENTS, SEO_CRAWLER_IDENTITY, SEO_CRAWLER_TOKEN, SEO_CRAWLER_USER_AGENT, SEO_PROVIDER_API_VERSION, SEO_VERSION, SERP_TITLE_REFERENCE_WIDTH_PX, SERP_TITLE_WIDTH_PROFILE, SITEMAP_FILE_URL_LIMIT, SITE_CHECK_MAX_ISSUES, SITE_CHECK_MAX_PAGES, SITE_FACTS_DEFAULT_CONCURRENCY, SITE_FACTS_MAX_CONCURRENCY, SITE_FACTS_MAX_SITES, SITE_FACTS_TIMEOUT_MS, STEP_CHANGE_RULES, SeoError, ServiceAccountAccessTokenClient, SessionLedger, TELEMETRY_AGENTS, TELEMETRY_ENDPOINT, TELEMETRY_ERROR_CATEGORIES, TELEMETRY_EVENTS, TELEMETRY_FAILURE_CONTEXTS, TELEMETRY_FAILURE_REASONS, TELEMETRY_NOTICE, TELEMETRY_OPERATIONS, TELEMETRY_REPORTS, TELEMETRY_SCHEMA_VERSION, TELEMETRY_TIMEOUT_MS, TYPESAFE_API_KEY_ENV, URL_INSPECTION_TIMEOUT_MS, agentActionsView, aiReferralSourceForValue, aiReferralsReport, analyticsConnectionLabel, analyticsConnectionProviderId, analyticsConnectionSchema, analyticsProviderDetails, analyticsProviderSchema, analyzeAiReferralRows, analyzeCannibalImportRows, analyzeCannibalRows, analyzeCtrUnderperformersFromRows, analyzeDecay, analyzeIndexCoverageSignals, analyzePageOpportunitiesFromRows, analyzeQueryClustersFromRows, analyzeQuickWinsFromRows, analyzeSecondPageRows, analyzeSegmentRows, analyzeStrikingDistanceRows, analyzeTrafficAnomalyRows, assertCrawlConfigLimits, assertUrlMatchesGscProperty, auditCrawlPages, auditCrawlRequests, auditPage, authStatus, bearerFetch, boundedSitemapInventory, buildAgentFindings, buildQueryClusterReportFromRows, buildTelemetryPayload, builtPagePath, cacheDb, cannibalDataStatus, cannibalImportReport, cannibalReport, cannibalReportWith, changeWindow, checkBuiltSite, checkDatabaseReadiness, checkSites, classifyTelemetryFailure, clearCache, cloudAccountFor, cloudBing, cloudCredentials, cloudGoogleEmails, cloudGoogleToken, cloudKeys, cloudLinked, cloudLogout, cloudWeek, clusterQueryRows, combineRobotsValues, compareSegmentRows, configSchema, contentCoverageRecommendation, contentCoverageType, contentOptimizationFromPageOpportunities, contentOptimizationReport, countLabel, crawlConfigHash, crawlConfigSchema, crawlCoverageCaveat, crawlDefinitionId, crawlFixToQueueItem, crawlImplementationQueueWorkflow, crawlIssueGroupSchema, crawlIssueSchema, crawlOne, crawlPageSnapshotSchema, crawlReportSchema, crawlReportSummarySchema, crawlRequestObservationSchema, crawlRunId, crawlSite, crawlSkipImpact, crawlSkipReasonCountsFromRecord, crawlStatusOnly, crawlTopFixSchema, crawlerJsonSchemas, crawlerRuleCategorySchema, crawlerRuleIdSchema, crawlerRuleInfoSchema, crawlerRuleRecommendationSchema, crawlerRuleSeveritySchema, crawlerSchemas, createAuthorizedClient, createCrawlReport, createCtrBenchmarkContext, createGoogleAccessTokenClient, createLogger, createPageRenderer, ctrUnderperformersReport, ctrUnderperformersReportWith, decayClusterDrafts, decayComparisonRange, decayingReport, decayingReportWith, deleteAhrefsApiKey, deleteBingApiKey, deleteClickySiteKey, deleteDataForSeoCredentials, deleteManagedProviderSecrets, deleteProviderExtensionAccount, deleteProviderExtensionCredentials, deleteProviderSecret, deleteTokens, deriveBrandTerms, describeInstalledProviderExtension, detectAgentName, detectBrandTerms, detectTelemetryAgent, diagnoseCsvFiles, diagnoseProperty, diagnosePropertyWorkflow, effectiveRobotsDirectives, effectiveSnippetControl, ensurePrivateDatabaseFiles, ensureSeoCliDirs, estimateSerpTitleWidth, expectedCtrForPosition, explainRule, fetchCruxFieldData, fetchFailureKind, fetchPage, fetchPageStatus, fetchSearchStatusIncidents, fetchSitemapUrls, fileSize, finalGscDateRange, findOverlappingSearchUpdates, finishCloudLogin, formatRelativeExpiry, ga4MatchReason, ga4PropertyIdFromName, ga4ReportQualityWarnings, ga4RequestCanUseCache, ga4RowsToObjects, getAuthModeStatus, getCacheStats, getClientConfig, getDb, getPrivacySnapshot, getSeoCliPaths, getServiceAccountConfig, getServiceAccountStatus, getTelemetryStatus, getTokenStorageStatus, googleJson, groupCrawlIssues, hasMetaRobotsDirective, hasRule, hasXRobotsDirective, hashKey, indexCoverageSignals, inferTemplateMovement, initializeTelemetry, inspectProviderPackage, inspectSearchConsoleUrl, inspectUrl, installProviderPackage, installedProviderPackageSchema, installedProviderPackagesSchema, internalLinksReport, internalLinksReportWith, interpretUpdateCorrelation, isBrandQuery, isNewerVersion, isSkippableReportError, isTelemetryCi, isTelemetryOperation, isTelemetryReport, isoDate, isoWeek, latestFinalGscDate, linkRecover, linkRecoverRecommendation, lintPaths, listAnalyticsAccounts, listAnalyticsDataStreams, listGa4AccountSummaries, listGa4DataStreams, listGoogleAccounts, listInstalledProviderExtensions, listRules, listSearchConsoleSites, listSearchUpdates, listSites, loadInstalledProviderExtensions, loadProviderExtensions, loadProviderPackage, loadSearchConsoleExport, localAccounts, localBing, localCredentialsProvider, localError, localGoogleFetch, localInternalLinksDependencies, localRefreshClicky, localResearchKeys, localResearchStore, loginWithLoopback, makeRunId, matchGa4WebStreams, measureCoverage, metaRobotsDirectives, migrateLegacyMacConfig, missingOAuthClientMessage, missingSharedClientLoginMessage, nodeCommandDeps, normalizeBrandText, normalizeClickySiteId, normalizeClickySiteKey, normalizeCrawlConfig, normalizeCrawlSkipReasonCounts, normalizeForCoverage, normalizeHttpUrl, normalizeJavaScriptRenderingMode, normalizeLoadedCrawlReport, normalizeProviderExtensionAccount, normalizedResearchColumnName, notSignedIn, noteCacheWrite, openCloudLink, pageEvidenceRecommendation, pageOpportunitiesReport, parseOlderThan, pendingCloudLogin, performanceAudit, performanceReportIsCacheable, plural, providerCapabilitySchema, providerConnectionFieldSchema, providerExactVersionSchema, providerExtensionIdSchema, providerIdSchema, providerIntegritySchema, providerKindSchema, providerPackageManifestSchema, providerPackageNameSchema, providerPreferenceSchema, providerRegistrationSchema, providerRequestJson, providerRequestText, pruneLogs, publicHttpFetch, queryClusterReport, queryClusterTokens, queryContentCoverageFromPage, queryContentFieldsFromPage, queryFieldCoverage, queryOpportunityRecommendation, queryPageMetrics, queryPageTopQuery, queryPagesMetrics, queryPagesMetricsBatch, queryPagesTopQueries, queryPagesTopQueriesBatch, querySearchAnalytics, quickWinsCsvRows, quickWinsReport, quickWinsReportWith, readAhrefsApiKey, readAllTokens, readBingApiKey, readBoundedResponseText, readClickySiteKey, readClickySiteKeys, readConfig, readDataForSeoCredentials, readInstalledProviderPackages, readJson, readJsonOrUndefined, readLintFiles, readOauthClient, readProviderExtensionAccount, readProviderExtensionCredentials, readProviderSecret, readTokens, recommendationForRule, reconcileExportPagesWithCrawl, redirectTrace, refreshAuthToken, refreshPrioritiesCsvFiles, refreshPrioritiesWorkflow, registrableDomain, removeInstalledProviderPackage, renderCrawlCsv, renderCrawlHtml, renderCrawlJunit, renderCrawlMarkdownTickets, renderCrawlPagesCsv, renderCrawlPretty, renderCsv, renderPresentationTablesMarkdown, renderWorkflowMarkdown, reportNarrative, requestHeaders, requirePageVerification, researchImportColumns, resetSeoData, resolveLocalSite, resolveSegmentRanges, resolveSeoCliPaths, reviewObservations, roundedPosition, runAnalyticsProviderLandingPages, runAnalyticsReport, runDoctor, runGa4Report, runProviderExtensionAction, runtimeForProvider, safeProviderAdapterError, saveInstalledProviderPackage, searchAnalyticsRows, searchUpdatesFromIncidents, secondPage, secondPageWith, segmentComparisonRange, segmentImpact, segmentRangeDays, seoErrorEnvelope, sessionSourceInListFilter, setActiveGoogleAccount, setTelemetryEnabled, setTokenStorageMode, shiftIsoDate, shouldExcludeBrandQuery, siteStartUrl, snapshotFetchedPage, startCloudLogin, strikingDistance, strikingDistanceWith, summarizeCrawlReport, pageTechnicalSignals as technicalPageSignals, telemetryErrorCategory, toSeoError, tokenSchema, tokenStoreSchema, topFixes, trackTelemetryCommandFailed, trackTelemetryReportComplete, trackTelemetryReportFailed, trackTelemetryReportStart, trackTelemetrySetupComplete, trafficAnomaly, trafficAnomalyWith, typesafeDecisionModel, unavailableSegmentImpactReport, unicodeTokens, uninstallProviderExtension, updateCorrelation, updateNotice, updatePostmortemCsvFiles, updatePostmortemWorkflow, urlInspectionQuota, validateResearchImportColumnSources, verifyAnalyticsProvider, verifyProviderExtension, verifyQueryContent, verifyQueryContentWith, withAgentReportContract, withRankingHistory, withinGoogleTimeout, workflowPresentation, writeAhrefsApiKey, writeBingApiKey, writeClickySiteKey, writeConfig, writeDataForSeoCredentials, writeInstalledProviderPackages, writeOauthClient, writeProviderExtensionAccount, writeProviderExtensionCredentials, writeProviderSecret, writeToCache, writeTokens, xRobotsDirectives };
42625
+ export { AHREFS_API_KEY_ENV, AHREFS_API_KEY_SECRET, AI_REFERRAL_SOURCES, AI_REFERRAL_SOURCES_VERSION, ANALYTICS_PROVIDER_IDS, AUDIT_PAGE_RULE_IDS, AhrefsClient, BING_API_KEY_ENV, BING_API_KEY_SECRET, BROWSER_USER_AGENT, CANNIBAL_MAXIMUM_DOMINANT_SHARE, CANNIBAL_MINIMUM_PAGE_IMPRESSIONS, CANNIBAL_MINIMUM_PAGE_SHARE, CLICKY_SITEKEY_ENV, CLICKY_SITE_KEYS_SECRET, CLOUD_SIGN_IN, CLOUD_URL, CRAWL_SKIP_REASONS, CTR_DEFAULT_LIMIT, CTR_MAX_LIMIT, CTR_MAX_MIN_IMPRESSIONS, DATAFORSEO_CREDENTIAL_SECRET, DATAFORSEO_LOGIN_ENV, DATAFORSEO_PASSWORD_ENV, DEFAULT_MAX_PAGES, DEFAULT_SEARCH_CONSOLE_EXPORT_ROW_LIMIT, DEFAULT_UNREACHED_PAGE_LIMIT, DataForSeoClient, DecisionModelError, DecisionRunner, GOOGLE_TIMEOUT_MS, GSC_FINAL_DATA_LAG_DAYS, GSC_TIME_ZONE, GoogleApiError, INCIDENTS_URL, JsonFileStorageAdapter, LINK_ROLES, LINT_MAX_FILES, LOCAL_BING_CONNECT, LOCAL_SIGN_IN, LOG_MAX_AGE_MS, LOG_MAX_FILE_BYTES, LOG_MAX_TOTAL_BYTES, LocalCredentialsProvider, MANAGED_PROVIDER_SECRET_NAMES, MAX_CRAWL_CONCURRENCY, MAX_CRAWL_DEPTH, MAX_CRAWL_PAGES, MAX_CRAWL_TIMEOUT_MS, MAX_MAX_PAGES, MAX_SEARCH_CONSOLE_EXPORT_FILES, MAX_SEARCH_CONSOLE_EXPORT_ROW_LIMIT, PAGE_TYPES, PROVIDER_ERROR_CODES, PROVIDER_SECRET_NAMES, ProviderError, ProviderExtensionRegistry, RESEARCH_IMPORT_COLUMN_KEYS, ResponseSizeLimitError, SEARCH_INTENTS, SEO_CRAWLER_IDENTITY, SEO_CRAWLER_TOKEN, SEO_CRAWLER_USER_AGENT, SEO_PROVIDER_API_VERSION, SEO_VERSION, SERP_TITLE_REFERENCE_WIDTH_PX, SERP_TITLE_WIDTH_PROFILE, SITEMAP_FILE_URL_LIMIT, SITE_CHECK_MAX_ISSUES, SITE_CHECK_MAX_PAGES, SITE_FACTS_DEFAULT_CONCURRENCY, SITE_FACTS_MAX_CONCURRENCY, SITE_FACTS_MAX_SITES, SITE_FACTS_TIMEOUT_MS, STEP_CHANGE_RULES, SeoError, ServiceAccountAccessTokenClient, SessionLedger, TELEMETRY_AGENTS, TELEMETRY_ENDPOINT, TELEMETRY_ERROR_CATEGORIES, TELEMETRY_EVENTS, TELEMETRY_FAILURE_CONTEXTS, TELEMETRY_FAILURE_REASONS, TELEMETRY_NOTICE, TELEMETRY_OPERATIONS, TELEMETRY_REPORTS, TELEMETRY_SCHEMA_VERSION, TELEMETRY_TIMEOUT_MS, TYPESAFE_API_KEY_ENV, URL_INSPECTION_TIMEOUT_MS, agentActionsView, aiReferralSourceForValue, aiReferralsReport, analyticsConnectionLabel, analyticsConnectionProviderId, analyticsConnectionSchema, analyticsProviderDetails, analyticsProviderSchema, analyzeAiReferralRows, analyzeCannibalImportRows, analyzeCannibalRows, analyzeCtrUnderperformersFromRows, analyzeDecay, analyzeIndexCoverageSignals, analyzePageOpportunitiesFromRows, analyzeQueryClustersFromRows, analyzeQuickWinsFromRows, analyzeSecondPageRows, analyzeSegmentRows, analyzeStrikingDistanceRows, analyzeTrafficAnomalyRows, assertCrawlConfigLimits, assertUrlMatchesGscProperty, auditCrawlPages, auditCrawlRequests, auditPage, authStatus, bearerFetch, boundedSitemapInventory, buildAgentFindings, buildQueryClusterReportFromRows, buildTelemetryPayload, builtPagePath, cacheDb, cannibalDataStatus, cannibalImportReport, cannibalReport, cannibalReportWith, changeWindow, checkBuiltSite, checkDatabaseReadiness, checkSites, classifyTelemetryFailure, clearCache, cloudAccountFor, cloudBing, cloudCredentials, cloudGoogleEmails, cloudGoogleToken, cloudKeys, cloudLinked, cloudLogout, cloudWeek, clusterQueryRows, combineRobotsValues, compareSegmentRows, configSchema, contentCoverageRecommendation, contentCoverageType, contentOptimizationFromPageOpportunities, contentOptimizationReport, countLabel, crawlConfigHash, crawlConfigSchema, crawlCoverageCaveat, crawlDefinitionId, crawlFixToQueueItem, crawlImplementationQueueWorkflow, crawlIssueGroupSchema, crawlIssueSchema, crawlOne, crawlPageSnapshotSchema, crawlReportSchema, crawlReportSummarySchema, crawlRequestObservationSchema, crawlRunId, crawlSite, crawlSkipImpact, crawlSkipReasonCountsFromRecord, crawlStatusOnly, crawlTopFixSchema, crawlerJsonSchemas, crawlerRuleCategorySchema, crawlerRuleIdSchema, crawlerRuleInfoSchema, crawlerRuleRecommendationSchema, crawlerRuleSeveritySchema, crawlerSchemas, createAuthorizedClient, createCrawlReport, createCtrBenchmarkContext, createGoogleAccessTokenClient, createLogger, createPageRenderer, ctrUnderperformersReport, ctrUnderperformersReportWith, decayClusterDrafts, decayComparisonRange, decayingReport, decayingReportWith, deleteAhrefsApiKey, deleteBingApiKey, deleteClickySiteKey, deleteDataForSeoCredentials, deleteManagedProviderSecrets, deleteProviderExtensionAccount, deleteProviderExtensionCredentials, deleteProviderSecret, deleteTokens, deriveBrandTerms, describeInstalledProviderExtension, detectAgentName, detectBrandTerms, detectTelemetryAgent, diagnoseCsvFiles, diagnoseProperty, diagnosePropertyWorkflow, effectiveRobotsDirectives, effectiveSnippetControl, ensurePrivateDatabaseFiles, ensureSeoCliDirs, estimateSerpTitleWidth, expectedCtrForPosition, explainRule, fetchCruxFieldData, fetchFailureKind, fetchPage, fetchPageStatus, fetchSearchStatusIncidents, fetchSitemapUrls, fileSize, finalGscDateRange, findOverlappingSearchUpdates, finishCloudLogin, formatRelativeExpiry, ga4MatchReason, ga4PropertyIdFromName, ga4ReportQualityWarnings, ga4RequestCanUseCache, ga4RowsToObjects, getAuthModeStatus, getCacheStats, getClientConfig, getDb, getPrivacySnapshot, getSeoCliPaths, getServiceAccountConfig, getServiceAccountStatus, getTelemetryStatus, getTokenStorageStatus, googleJson, groupCrawlIssues, hasMetaRobotsDirective, hasRule, hasXRobotsDirective, hashKey, indexCoverageSignals, inferTemplateMovement, initializeTelemetry, inspectProviderPackage, inspectSearchConsoleUrl, inspectUrl, installProviderPackage, installedProviderPackageSchema, installedProviderPackagesSchema, installedProviderSerp, internalLinksReport, internalLinksReportWith, interpretUpdateCorrelation, isBrandQuery, isNewerVersion, isSkippableReportError, isTelemetryCi, isTelemetryOperation, isTelemetryReport, isoDate, isoWeek, latestFinalGscDate, linkRecover, linkRecoverRecommendation, lintPaths, listAnalyticsAccounts, listAnalyticsDataStreams, listGa4AccountSummaries, listGa4DataStreams, listGoogleAccounts, listInstalledProviderExtensions, listRules, listSearchConsoleSites, listSearchUpdates, listSites, loadInstalledProviderExtensions, loadProviderExtensions, loadProviderPackage, loadSearchConsoleExport, localAccounts, localBing, localCredentialsProvider, localError, localGoogleFetch, localInternalLinksDependencies, localRefreshClicky, localResearchKeys, localResearchStore, loginWithLoopback, makeRunId, matchGa4WebStreams, measureCoverage, metaRobotsDirectives, migrateLegacyMacConfig, missingOAuthClientMessage, missingSharedClientLoginMessage, nodeCommandDeps, normalizeBrandText, normalizeClickySiteId, normalizeClickySiteKey, normalizeCrawlConfig, normalizeCrawlSkipReasonCounts, normalizeForCoverage, normalizeHttpUrl, normalizeJavaScriptRenderingMode, normalizeLoadedCrawlReport, normalizeProviderExtensionAccount, normalizedResearchColumnName, notSignedIn, noteCacheWrite, openCloudLink, pageEvidenceRecommendation, pageOpportunitiesReport, parseOlderThan, pendingCloudLogin, performanceAudit, performanceReportIsCacheable, plural, providerCapabilitySchema, providerConnectionFieldSchema, providerExactVersionSchema, providerExtensionIdSchema, providerIdSchema, providerIntegritySchema, providerKindSchema, providerPackageManifestSchema, providerPackageNameSchema, providerPreferenceSchema, providerRegistrationSchema, providerRequestJson, providerRequestText, pruneLogs, publicHttpFetch, queryClusterReport, queryClusterTokens, queryContentCoverageFromPage, queryContentFieldsFromPage, queryFieldCoverage, queryOpportunityRecommendation, queryPageMetrics, queryPageTopQuery, queryPagesMetrics, queryPagesMetricsBatch, queryPagesTopQueries, queryPagesTopQueriesBatch, querySearchAnalytics, quickWinsCsvRows, quickWinsReport, quickWinsReportWith, readAhrefsApiKey, readAllTokens, readBingApiKey, readBoundedResponseText, readClickySiteKey, readClickySiteKeys, readConfig, readDataForSeoCredentials, readInstalledProviderPackages, readJson, readJsonOrUndefined, readLintFiles, readOauthClient, readProviderExtensionAccount, readProviderExtensionCredentials, readProviderSecret, readTokens, recommendationForRule, reconcileExportPagesWithCrawl, redirectTrace, refreshAuthToken, refreshPrioritiesCsvFiles, refreshPrioritiesWorkflow, registrableDomain, removeInstalledProviderPackage, renderCrawlCsv, renderCrawlHtml, renderCrawlJunit, renderCrawlMarkdownTickets, renderCrawlPagesCsv, renderCrawlPretty, renderCsv, renderPresentationTablesMarkdown, renderWorkflowMarkdown, reportNarrative, requestHeaders, requirePageVerification, researchImportColumns, resetSeoData, resolveLocalSite, resolveSegmentRanges, resolveSeoCliPaths, reviewObservations, roundedPosition, runAnalyticsProviderLandingPages, runAnalyticsReport, runDoctor, runGa4Report, runProviderExtensionAction, runtimeForProvider, safeProviderAdapterError, saveInstalledProviderPackage, searchAnalyticsRows, searchUpdatesFromIncidents, secondPage, secondPageWith, segmentComparisonRange, segmentImpact, segmentRangeDays, seoErrorEnvelope, sessionSourceInListFilter, setActiveGoogleAccount, setTelemetryEnabled, setTokenStorageMode, shiftIsoDate, shouldExcludeBrandQuery, siteStartUrl, snapshotFetchedPage, startCloudLogin, strikingDistance, strikingDistanceWith, summarizeCrawlReport, pageTechnicalSignals as technicalPageSignals, telemetryErrorCategory, toSeoError, tokenSchema, tokenStoreSchema, topFixes, trackTelemetryCommandFailed, trackTelemetryReportComplete, trackTelemetryReportFailed, trackTelemetryReportStart, trackTelemetrySetupComplete, trafficAnomaly, trafficAnomalyWith, typesafeDecisionModel, unavailableSegmentImpactReport, unicodeTokens, uninstallProviderExtension, updateCorrelation, updateNotice, updatePostmortemCsvFiles, updatePostmortemWorkflow, urlInspectionQuota, validateResearchImportColumnSources, verifyAnalyticsProvider, verifyProviderExtension, verifyQueryContent, verifyQueryContentWith, withAgentReportContract, withRankingHistory, withinGoogleTimeout, workflowPresentation, writeAhrefsApiKey, writeBingApiKey, writeClickySiteKey, writeConfig, writeDataForSeoCredentials, writeInstalledProviderPackages, writeOauthClient, writeProviderExtensionAccount, writeProviderExtensionCredentials, writeProviderSecret, writeToCache, writeTokens, xRobotsDirectives };
42367
42626
 
42368
42627
  //# sourceMappingURL=index.js.map