seo 0.8.3 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -21332,6 +21332,12 @@ declare function finishCloudLogin(): Promise<'linked' | 'pending' | 'expired'>;
21332
21332
  declare function cloudLogout(): Promise<boolean>;
21333
21333
  declare function openCloudLink(url: string): Promise<void>;
21334
21334
  //#endregion
21335
+ //#region packages/core/src/commands/sites.d.ts
21336
+ type GoogleAccount = {
21337
+ email: string | null;
21338
+ google: GoogleFetch;
21339
+ };
21340
+ //#endregion
21335
21341
  //#region packages/core/src/commands/analytics-site.d.ts
21336
21342
  type AnalyticsAccess = {
21337
21343
  accounts: () => Promise<GoogleAccount[]>;
@@ -21358,7 +21364,7 @@ declare const COMMANDS: {
21358
21364
  };
21359
21365
  readonly research: {
21360
21366
  readonly where: "anywhere";
21361
- readonly summary: "Keyword metrics, ranked keywords, SERPs, competitors and backlinks from DataForSEO or Ahrefs.";
21367
+ readonly summary: "Keyword metrics, ranked keywords, SERPs, competitors and backlinks from DataForSEO or Ahrefs, and whether AI answers cite the site.";
21362
21368
  };
21363
21369
  readonly data: {
21364
21370
  readonly where: "anywhere";
@@ -21413,12 +21419,6 @@ type PageMarkdown = {
21413
21419
  error: string;
21414
21420
  };
21415
21421
  //#endregion
21416
- //#region packages/core/src/commands/sites.d.ts
21417
- type GoogleAccount = {
21418
- email: string | null;
21419
- google: GoogleFetch;
21420
- };
21421
- //#endregion
21422
21422
  //#region packages/core/src/storage/config.d.ts
21423
21423
  type TokenStorageMode = 'keychain' | 'file';
21424
21424
  type TokenStorageStatus = {
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-BZhSLbcQ.js";
2
+ import { n as version, t as load } from "./esm-gP6ovS6b.js";
3
3
  import { SEO_PROVIDER_API_VERSION } from "./provider-sdk.js";
4
4
  import crypto, { createHash, randomUUID, sign } from "node:crypto";
5
5
  import { z } from "zod";
@@ -27559,6 +27559,30 @@ async function detectBrandTerms(input) {
27559
27559
  candidates: ranked
27560
27560
  };
27561
27561
  }
27562
+ //#endregion
27563
+ //#region packages/core/src/analyze/ai-queries.ts
27564
+ const RULES = [
27565
+ ["agent_prompt", "^(search the web for|browse the web|find sources)|do not invent|return the [0-9]+ most relevant|include source urls|context: location|do not include location|question: |reply only with|the model you are using"],
27566
+ ["tracker", "\\. ?my location is |\\?\\. ?my( |$)|^evaluate the .+ on "],
27567
+ ["reply", "^(yes|yeah|yep|ok|okay|sure|yes please|go on|continue|keep going|tell me more|why not|how so|really|exactly|show me|and then|thanks|thank you|got it|what else|anything else)[?!.,]*$"],
27568
+ ["follow_up", "^(what|how) about .{1,40}$|^(and|so|ok so|okay so|but) (what|which|how|why) "],
27569
+ ["operator", "(^|\\s)-?(site|before|after|intitle|inurl|intext|filetype):|\"[^\"]*\" or \""],
27570
+ ["chat", "\\b(please|can you|could you|give me|show me|tell me|i want|i need|i have|i am|should i|do i need|is it worth|help me|walk me through)\\b|^(what|how|why|is|does|can|will|would) (it|that|this|they)\\b"],
27571
+ ["long", "^(\\S+\\s+){9,}\\S+$"]
27572
+ ];
27573
+ RULES.map(([kind, pattern]) => [kind, new RegExp(pattern)]);
27574
+ RULES.map(([, pattern]) => `(?:${pattern})`).join("|");
27575
+ new Set("the and for with that this what which who how why when where are is was can does do did you your our from about into than then them they their there have has had will would should could not but its it’s me my i am of to in on at by or an as be if so".split(" "));
27576
+ new Map(`
27577
+ ae:ar al:sq am:hy ao:pt ar:es at:de au:en az:az ba:bs bd:bn be:nl bf:fr
27578
+ bg:bg bh:ar bo:es br:pt ca:en ch:de ci:fr cl:es cm:fr co:es cr:es cy:el
27579
+ cz:cs de:de dk:da dz:ar ec:es ee:et eg:ar es:es fi:fi fr:fr gb:en gh:en
27580
+ gr:el gt:es hk:en hr:hr hu:hu id:id ie:en il:he in:en it:it jo:ar jp:ja
27581
+ ke:en kh:en kr:ko kz:ru lk:en lt:lt lv:lv ma:ar mc:fr md:ro mk:mk mm:en
27582
+ mt:en mx:es my:en ng:en ni:es nl:nl no:nb nz:en pa:es pe:es ph:en pk:en
27583
+ pl:pl pt:pt py:es ro:ro rs:sr sa:ar se:sv sg:en si:sl sk:sk sn:fr sv:es
27584
+ th:th tn:ar tr:tr tw:zh-TW ua:uk us:en uy:es ve:es vn:vi za:en
27585
+ `.trim().split(/\s+/).map((pair) => pair.split(":")));
27562
27586
  const DIMENSIONS = [
27563
27587
  "query",
27564
27588
  "page",
@@ -27746,20 +27770,6 @@ function checkPages(urls) {
27746
27770
  return Promise.all(urls.slice(0, MAX_PAGES).map(facts));
27747
27771
  }
27748
27772
  //#endregion
27749
- //#region packages/core/src/analyze/ai-queries.ts
27750
- const RULES = [
27751
- ["agent_prompt", "^(search the web for|browse the web|find sources)|do not invent|return the [0-9]+ most relevant|include source urls|context: location|do not include location|question: "],
27752
- ["tracker", "\\. ?my location is |^evaluate the .+ on "],
27753
- ["reply", "^(yes|yeah|yep|ok|okay|sure|yes please|go on|continue|keep going|tell me more|why not|how so|really|exactly|show me|and then|thanks|thank you|got it|what else|anything else)[?!.,]*$"],
27754
- ["follow_up", "^(what|how) about .{1,40}$|^(and|so|ok so|okay so|but) (what|which|how|why) "],
27755
- ["operator", "(^|\\s)-?(site|before|after|intitle|inurl|intext|filetype):|\"[^\"]*\" or \""],
27756
- ["chat", "\\b(please|can you|could you|give me|show me|tell me|i want|i need|i have|i am|should i|do i need|is it worth|help me|walk me through)\\b|^(what|how|why|is|does|can|will|would) (it|that|this|they)\\b"],
27757
- ["long", "^(\\S+\\s+){9,}\\S+$"]
27758
- ];
27759
- RULES.map(([kind, pattern]) => [kind, new RegExp(pattern)]);
27760
- RULES.map(([, pattern]) => `(?:${pattern})`).join("|");
27761
- new Set("the and for with that this what which who how why when where are is was can does do did you your our from about into than then them they their there have has had will would should could not but its it’s me my i am of to in on at by or an as be if so".split(" "));
27762
- //#endregion
27763
27773
  //#region packages/core/src/commands/report.ts
27764
27774
  const SECTIONS = {
27765
27775
  overview: "Site totals (clicks, impressions, CTR, position) against the previous period, by device, with the top pages and queries and their change, and Google Analytics sessions for the same dates from the property whose web stream matches the site.",
@@ -27774,16 +27784,6 @@ const SECTIONS = {
27774
27784
  bing: "Bing’s top queries from Bing Webmaster Tools with Google’s clicks, impressions and position for the same query beside them, and the same for pages."
27775
27785
  };
27776
27786
  const SECTION_IDS = Object.keys(SECTIONS);
27777
- new Map(`
27778
- ae:ar al:sq am:hy ao:pt ar:es at:de au:en az:az ba:bs bd:bn be:nl bf:fr
27779
- bg:bg bh:ar bo:es br:pt ca:en ch:de ci:fr cl:es cm:fr co:es cr:es cy:el
27780
- cz:cs de:de dk:da dz:ar ec:es ee:et eg:ar es:es fi:fi fr:fr gb:en gh:en
27781
- gr:el gt:es hk:en hr:hr hu:hu id:id ie:en il:he in:en it:it jo:ar jp:ja
27782
- ke:en kh:en kr:ko kz:ru lk:en lt:lt lv:lv ma:ar mc:fr md:ro mk:mk mm:en
27783
- mt:en mx:es my:en ng:en ni:es nl:nl no:nb nz:en pa:es pe:es ph:en pk:en
27784
- pl:pl pt:pt py:es ro:ro rs:sr sa:ar se:sv sg:en si:sl sk:sk sn:fr sv:es
27785
- th:th tn:ar tr:tr tw:zh-TW ua:uk us:en uy:es ve:es vn:vi za:en
27786
- `.trim().split(/\s+/).map((pair) => pair.split(":")));
27787
27787
  //#endregion
27788
27788
  //#region packages/core/src/commands/research.ts
27789
27789
  const RESEARCH_ACTIONS = [
@@ -27791,9 +27791,11 @@ const RESEARCH_ACTIONS = [
27791
27791
  "ranked_keywords",
27792
27792
  "serp",
27793
27793
  "competitors",
27794
- "backlinks"
27794
+ "backlinks",
27795
+ "ai_answers"
27795
27796
  ];
27796
27797
  const RESEARCH_PROVIDERS = ["dataforseo", "ahrefs"];
27798
+ const RESEARCH_HELP = `keyword_metrics (keywords: volume, difficulty, CPC), ranked_keywords (target: keywords a domain or URL ranks for), serp (keywords, up to 5: the ranking pages), competitors (target: domains that share keywords), backlinks (target: referring domains), ai_answers (DataForSEO only; target: the site. It takes the site’s top 10 chat-style and long questions from Search Console’s AI-shaped queries itself, then asks ChatGPT search, Google AI Mode and Google AI Overviews each one and says whether the answer cites or mentions the site. DataForSEO’s live prices are $0.012 a question, so up to about $0.12 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.`;
27797
27799
  //#endregion
27798
27800
  //#region packages/core/src/commands/site.ts
27799
27801
  function indexStatusFrom(result) {
@@ -27846,7 +27848,7 @@ z.object({}), `${Object.entries(SECTIONS).map(([id, text]) => `- ${id}: ${text}`
27846
27848
  }), `${LOST_PAGES_RULE}`, z.object({
27847
27849
  site,
27848
27850
  ...dates
27849
- }), z.object({
27851
+ }), `${RESEARCH_HELP}`, z.object({
27850
27852
  provider: z.enum(RESEARCH_PROVIDERS),
27851
27853
  action: z.enum(RESEARCH_ACTIONS),
27852
27854
  keywords: z.array(z.string().min(1)).max(100).default([]),