seo-supervisor 1.2.0 → 2.0.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.
Files changed (207) hide show
  1. package/.claude-plugin/icon.png +0 -0
  2. package/.claude-plugin/marketplace.json +2 -2
  3. package/.claude-plugin/plugin.json +16 -3
  4. package/CHANGELOG.md +430 -0
  5. package/NOTICE +7 -0
  6. package/README.md +230 -25
  7. package/agents/seo-auditor.md +16 -0
  8. package/agents/seo-reviewer.md +16 -0
  9. package/bin/agents.mjs +194 -29
  10. package/bin/extras.mjs +422 -0
  11. package/bin/prompt.mjs +34 -14
  12. package/bin/seo-supervisor.mjs +386 -53
  13. package/commands/seo-audit.md +29 -3
  14. package/commands/seo-brief.md +28 -0
  15. package/commands/seo-connect.md +27 -0
  16. package/commands/seo-fix.md +24 -3
  17. package/commands/seo-grow.md +26 -0
  18. package/commands/seo-launch.md +17 -3
  19. package/commands/seo-review.md +13 -1
  20. package/commands/seo-rewrite.md +25 -0
  21. package/commands/seo-setup.md +17 -1
  22. package/commands/seo-watch.md +28 -0
  23. package/hooks/hooks.json +117 -0
  24. package/package.json +20 -7
  25. package/skills/seo-supervisor/NOTICE +7 -0
  26. package/skills/seo-supervisor/SKILL.md +302 -21
  27. package/skills/seo-supervisor/audience.md +61 -0
  28. package/skills/seo-supervisor/examples/drafts/security.md +41 -0
  29. package/skills/seo-supervisor/examples/hooks/README.md +28 -0
  30. package/skills/seo-supervisor/examples/hooks/claude-code-settings.json +15 -0
  31. package/skills/seo-supervisor/examples/hooks/codex-hooks.json +17 -0
  32. package/skills/seo-supervisor/examples/hooks/copilot-hooks.json +15 -0
  33. package/skills/seo-supervisor/examples/hooks/cursor-hooks.json +11 -0
  34. package/skills/seo-supervisor/examples/hooks/github-actions.yml +21 -0
  35. package/skills/seo-supervisor/examples/hooks/pre-commit +17 -0
  36. package/skills/seo-supervisor/examples/hooks/reading-ease.yml +24 -0
  37. package/skills/seo-supervisor/examples/sample-audit.json +94 -2
  38. package/skills/seo-supervisor/examples/sample-report.html +111 -61
  39. package/skills/seo-supervisor/examples/sample-report.md +147 -44
  40. package/skills/seo-supervisor/examples/scheduled-runs.md +89 -0
  41. package/skills/seo-supervisor/examples/snippets.md +648 -1
  42. package/skills/seo-supervisor/grow.md +342 -0
  43. package/skills/seo-supervisor/og-images.md +85 -0
  44. package/skills/seo-supervisor/page-types.md +124 -0
  45. package/skills/seo-supervisor/planning.md +19 -7
  46. package/skills/seo-supervisor/profile-template.md +41 -0
  47. package/skills/seo-supervisor/report-format.md +177 -10
  48. package/skills/seo-supervisor/rewrite.md +59 -0
  49. package/skills/seo-supervisor/rules/ai-search.md +65 -12
  50. package/skills/seo-supervisor/rules/content.md +33 -9
  51. package/skills/seo-supervisor/rules/crawl-index.md +33 -6
  52. package/skills/seo-supervisor/rules/internal-linking.md +49 -6
  53. package/skills/seo-supervisor/rules/launch-monitoring.md +17 -8
  54. package/skills/seo-supervisor/rules/media.md +13 -1
  55. package/skills/seo-supervisor/rules/metadata.md +41 -9
  56. package/skills/seo-supervisor/rules/performance.md +50 -5
  57. package/skills/seo-supervisor/rules/rendering.md +39 -2
  58. package/skills/seo-supervisor/rules/search-intent.md +32 -0
  59. package/skills/seo-supervisor/rules/sitemaps-robots.md +24 -12
  60. package/skills/seo-supervisor/rules/structured-data.md +37 -14
  61. package/skills/seo-supervisor/rules/trust-security.md +25 -2
  62. package/skills/seo-supervisor/rules/urls.md +10 -2
  63. package/skills/seo-supervisor/scripts/ai-answers.mjs +314 -0
  64. package/skills/seo-supervisor/scripts/backlinks.mjs +412 -0
  65. package/skills/seo-supervisor/scripts/change-check.mjs +281 -0
  66. package/skills/seo-supervisor/scripts/checks/agents.mjs +488 -0
  67. package/skills/seo-supervisor/scripts/checks/assets.mjs +404 -0
  68. package/skills/seo-supervisor/scripts/checks/bots.mjs +146 -0
  69. package/skills/seo-supervisor/scripts/checks/business-type.mjs +193 -0
  70. package/skills/seo-supervisor/scripts/checks/content.mjs +391 -0
  71. package/skills/seo-supervisor/scripts/checks/coverage.mjs +184 -0
  72. package/skills/seo-supervisor/scripts/checks/crawl.mjs +95 -0
  73. package/skills/seo-supervisor/scripts/checks/hreflang.mjs +396 -0
  74. package/skills/seo-supervisor/scripts/checks/hygiene.mjs +227 -0
  75. package/skills/seo-supervisor/scripts/checks/lighthouse.mjs +271 -0
  76. package/skills/seo-supervisor/scripts/checks/link-strength.mjs +59 -0
  77. package/skills/seo-supervisor/scripts/checks/links.mjs +360 -0
  78. package/skills/seo-supervisor/scripts/checks/local.mjs +101 -0
  79. package/skills/seo-supervisor/scripts/checks/media.mjs +194 -0
  80. package/skills/seo-supervisor/scripts/checks/outbound.mjs +53 -0
  81. package/skills/seo-supervisor/scripts/checks/page.mjs +223 -0
  82. package/skills/seo-supervisor/scripts/checks/probes.mjs +130 -0
  83. package/skills/seo-supervisor/scripts/checks/render.mjs +552 -0
  84. package/skills/seo-supervisor/scripts/checks/robots.mjs +144 -0
  85. package/skills/seo-supervisor/scripts/checks/schema.mjs +206 -0
  86. package/skills/seo-supervisor/scripts/checks/site-agents.mjs +79 -0
  87. package/skills/seo-supervisor/scripts/checks/site-content.mjs +135 -0
  88. package/skills/seo-supervisor/scripts/checks/site-hygiene.mjs +202 -0
  89. package/skills/seo-supervisor/scripts/checks/site-pages.mjs +474 -0
  90. package/skills/seo-supervisor/scripts/checks/site-security.mjs +102 -0
  91. package/skills/seo-supervisor/scripts/checks/sitemap.mjs +473 -0
  92. package/skills/seo-supervisor/scripts/checks/speed.mjs +267 -0
  93. package/skills/seo-supervisor/scripts/checks/technical.mjs +368 -0
  94. package/skills/seo-supervisor/scripts/checks/tls.mjs +297 -0
  95. package/skills/seo-supervisor/scripts/checks/trust.mjs +421 -0
  96. package/skills/seo-supervisor/scripts/checks/visual.mjs +1132 -0
  97. package/skills/seo-supervisor/scripts/checks/writing.mjs +192 -0
  98. package/skills/seo-supervisor/scripts/commoncrawl.mjs +452 -0
  99. package/skills/seo-supervisor/scripts/connect-keys.mjs +422 -0
  100. package/skills/seo-supervisor/scripts/content-scan.mjs +515 -158
  101. package/skills/seo-supervisor/scripts/crawl/catalog.mjs +1248 -0
  102. package/skills/seo-supervisor/scripts/crawl/fetch.mjs +362 -0
  103. package/skills/seo-supervisor/scripts/crawl/page.mjs +741 -0
  104. package/skills/seo-supervisor/scripts/crawl/queue.mjs +190 -0
  105. package/skills/seo-supervisor/scripts/dashboard.mjs +140 -0
  106. package/skills/seo-supervisor/scripts/data/ai-bots.json +38 -0
  107. package/skills/seo-supervisor/scripts/data/build-schema-vocab.mjs +57 -0
  108. package/skills/seo-supervisor/scripts/data/business-types.json +338 -0
  109. package/skills/seo-supervisor/scripts/data/google-rich-results.json +79 -0
  110. package/skills/seo-supervisor/scripts/data/schema-vocab.json +1 -0
  111. package/skills/seo-supervisor/scripts/deploy-check.mjs +462 -0
  112. package/skills/seo-supervisor/scripts/disavow.mjs +176 -0
  113. package/skills/seo-supervisor/scripts/doctor.mjs +174 -0
  114. package/skills/seo-supervisor/scripts/geo-grid.mjs +371 -0
  115. package/skills/seo-supervisor/scripts/google/search-console.mjs +151 -0
  116. package/skills/seo-supervisor/scripts/google/session.mjs +167 -0
  117. package/skills/seo-supervisor/scripts/google-updates.mjs +189 -0
  118. package/skills/seo-supervisor/scripts/google.mjs +1341 -0
  119. package/skills/seo-supervisor/scripts/gsc-import.mjs +298 -0
  120. package/skills/seo-supervisor/scripts/guard/adapters/claude-code.mjs +149 -0
  121. package/skills/seo-supervisor/scripts/guard/adapters/cline.mjs +28 -0
  122. package/skills/seo-supervisor/scripts/guard/adapters/codex.mjs +26 -0
  123. package/skills/seo-supervisor/scripts/guard/adapters/copilot.mjs +36 -0
  124. package/skills/seo-supervisor/scripts/guard/adapters/cursor.mjs +33 -0
  125. package/skills/seo-supervisor/scripts/guard/adapters/devin.mjs +25 -0
  126. package/skills/seo-supervisor/scripts/guard/adapters/edits.mjs +124 -0
  127. package/skills/seo-supervisor/scripts/guard/mode.mjs +37 -0
  128. package/skills/seo-supervisor/scripts/guard/rules.mjs +931 -0
  129. package/skills/seo-supervisor/scripts/guard.mjs +74 -0
  130. package/skills/seo-supervisor/scripts/images.mjs +408 -0
  131. package/skills/seo-supervisor/scripts/indexnow.mjs +300 -0
  132. package/skills/seo-supervisor/scripts/issues.mjs +217 -0
  133. package/skills/seo-supervisor/scripts/keys/authority.mjs +135 -0
  134. package/skills/seo-supervisor/scripts/keys/bing.mjs +239 -0
  135. package/skills/seo-supervisor/scripts/keys/clarity.mjs +137 -0
  136. package/skills/seo-supervisor/scripts/keys/dataforseo.mjs +57 -0
  137. package/skills/seo-supervisor/scripts/keys/googleplaces.mjs +26 -0
  138. package/skills/seo-supervisor/scripts/keys/http.mjs +212 -0
  139. package/skills/seo-supervisor/scripts/keys/matomo.mjs +138 -0
  140. package/skills/seo-supervisor/scripts/keys/openai.mjs +26 -0
  141. package/skills/seo-supervisor/scripts/keys/perplexity.mjs +26 -0
  142. package/skills/seo-supervisor/scripts/keys/posthog.mjs +165 -0
  143. package/skills/seo-supervisor/scripts/keys/semrush.mjs +25 -0
  144. package/skills/seo-supervisor/scripts/keys/services.mjs +41 -0
  145. package/skills/seo-supervisor/scripts/keys/store.mjs +140 -0
  146. package/skills/seo-supervisor/scripts/keys/visits.mjs +58 -0
  147. package/skills/seo-supervisor/scripts/keys/youtube.mjs +84 -0
  148. package/skills/seo-supervisor/scripts/keyword-data.mjs +316 -0
  149. package/skills/seo-supervisor/scripts/keyword-ideas.mjs +503 -0
  150. package/skills/seo-supervisor/scripts/lib/args.mjs +56 -0
  151. package/skills/seo-supervisor/scripts/lib/business.mjs +27 -0
  152. package/skills/seo-supervisor/scripts/lib/cdp.mjs +242 -0
  153. package/skills/seo-supervisor/scripts/lib/cli.mjs +56 -0
  154. package/skills/seo-supervisor/scripts/lib/csv.mjs +38 -0
  155. package/skills/seo-supervisor/scripts/lib/findings.mjs +100 -0
  156. package/skills/seo-supervisor/scripts/lib/google-client.mjs +9 -0
  157. package/skills/seo-supervisor/scripts/lib/html.mjs +146 -0
  158. package/skills/seo-supervisor/scripts/lib/http.mjs +28 -0
  159. package/skills/seo-supervisor/scripts/lib/image-size.mjs +78 -0
  160. package/skills/seo-supervisor/scripts/lib/is-main.mjs +13 -0
  161. package/skills/seo-supervisor/scripts/lib/net.mjs +116 -0
  162. package/skills/seo-supervisor/scripts/lib/proxy.mjs +47 -0
  163. package/skills/seo-supervisor/scripts/lib/recheck.mjs +106 -0
  164. package/skills/seo-supervisor/scripts/lib/redact.mjs +78 -0
  165. package/skills/seo-supervisor/scripts/lib/robots.mjs +73 -0
  166. package/skills/seo-supervisor/scripts/lib/score.mjs +266 -0
  167. package/skills/seo-supervisor/scripts/lib/settings-dir.mjs +81 -0
  168. package/skills/seo-supervisor/scripts/links-import.mjs +603 -0
  169. package/skills/seo-supervisor/scripts/log-scan.mjs +597 -0
  170. package/skills/seo-supervisor/scripts/og-card.mjs +273 -0
  171. package/skills/seo-supervisor/scripts/osm.mjs +359 -0
  172. package/skills/seo-supervisor/scripts/rdap.mjs +164 -0
  173. package/skills/seo-supervisor/scripts/render-report.mjs +324 -690
  174. package/skills/seo-supervisor/scripts/report/client.js +37 -0
  175. package/skills/seo-supervisor/scripts/report/diff.mjs +264 -0
  176. package/skills/seo-supervisor/scripts/report/findings.mjs +165 -0
  177. package/skills/seo-supervisor/scripts/report/format.mjs +111 -0
  178. package/skills/seo-supervisor/scripts/report/markdown.mjs +250 -0
  179. package/skills/seo-supervisor/scripts/report/model.mjs +171 -0
  180. package/skills/seo-supervisor/scripts/report/overview-lines.mjs +158 -0
  181. package/skills/seo-supervisor/scripts/report/overview.mjs +224 -0
  182. package/skills/seo-supervisor/scripts/report/page.mjs +127 -0
  183. package/skills/seo-supervisor/scripts/report/panel.mjs +172 -0
  184. package/skills/seo-supervisor/scripts/report/panels/ai.mjs +211 -0
  185. package/skills/seo-supervisor/scripts/report/panels/connections.mjs +139 -0
  186. package/skills/seo-supervisor/scripts/report/panels/content.mjs +204 -0
  187. package/skills/seo-supervisor/scripts/report/panels/data-search.mjs +379 -0
  188. package/skills/seo-supervisor/scripts/report/panels/data-site.mjs +44 -0
  189. package/skills/seo-supervisor/scripts/report/panels/links.mjs +380 -0
  190. package/skills/seo-supervisor/scripts/report/panels/local.mjs +221 -0
  191. package/skills/seo-supervisor/scripts/report/panels/site.mjs +359 -0
  192. package/skills/seo-supervisor/scripts/report/panels/speed-media.mjs +267 -0
  193. package/skills/seo-supervisor/scripts/report/sources.mjs +163 -0
  194. package/skills/seo-supervisor/scripts/report/styles.css +223 -0
  195. package/skills/seo-supervisor/scripts/report/traffic.mjs +264 -0
  196. package/skills/seo-supervisor/scripts/report-plan.mjs +112 -33
  197. package/skills/seo-supervisor/scripts/schema-check.mjs +717 -0
  198. package/skills/seo-supervisor/scripts/seo-crawl.mjs +1086 -638
  199. package/skills/seo-supervisor/scripts/seo-diff.mjs +584 -0
  200. package/skills/seo-supervisor/scripts/update-check.mjs +82 -0
  201. package/skills/seo-supervisor/site-types/content.md +34 -1
  202. package/skills/seo-supervisor/site-types/ecommerce.md +38 -1
  203. package/skills/seo-supervisor/site-types/local-business.md +96 -6
  204. package/skills/seo-supervisor/site-types/services.md +46 -0
  205. package/skills/seo-supervisor/site-types/tools.md +3 -3
  206. package/skills/seo-supervisor/strategy.md +232 -0
  207. package/skills/seo-supervisor/troubleshooting.md +56 -0
@@ -0,0 +1,503 @@
1
+ #!/usr/bin/env node
2
+ // @ts-check
3
+ // Keyword ideas from real sources only, each labelled with its source. No volumes or difficulty: keyword-data.mjs adds
4
+ // those.
5
+ import { readFileSync, writeFileSync, mkdirSync } from "node:fs";
6
+ import { basename, dirname, join, resolve } from "node:path";
7
+ import { isMain } from "./lib/is-main.mjs";
8
+ import { parseArgs } from "./lib/args.mjs";
9
+ import { Fail, runMain } from "./lib/cli.mjs";
10
+ import { addTraffic } from "./gsc-import.mjs";
11
+ import { classify, withSiteName } from "./links-import.mjs";
12
+
13
+ const USAGE =
14
+ 'usage: node keyword-ideas.mjs --google seo-audit/google.json | --gsc seo-audit/gsc.json [--crawl seo-audit/seo-crawl.json] [--brand "Acme"] [--extra seo-audit/keyword-extra.json] [--out seo-audit/keyword-ideas.json]';
15
+ const MIN_IMPRESSIONS = 10; // as gsc-import's query-competition: under 10 is the long tail
16
+ const MAX = 50; // ideas per group, most impressions first
17
+
18
+ // Words: lower case, accents dropped ("Café" is "cafe"), anything but letters and digits splits them.
19
+ const norm = s =>
20
+ String(s ?? "")
21
+ .normalize("NFKD")
22
+ .replace(/\p{M}/gu, "")
23
+ .toLowerCase()
24
+ .replace(/[^\p{L}\p{N}]+/gu, " ")
25
+ .trim();
26
+ // Scripts written without spaces between words, as seo-crawl.mjs lists them: no reliable words, so no gap is claimed.
27
+ const NOSPACE = /[\p{scx=Han}\p{scx=Hira}\p{scx=Kana}\p{scx=Thai}\p{scx=Laoo}\p{scx=Khmr}\p{scx=Mymr}]/u;
28
+ // Words that don't say what a query is about: question words, filler and short function words in English, Spanish,
29
+ // French, German, Portuguese and Italian (accents dropped). Words under 3 letters are skipped anyway.
30
+ const STOP = new Set(
31
+ (
32
+ "what whats how why when where who whom whose which can could does did doing are was were been being have has had " +
33
+ "should would will shall may might must the and for with from into your yours you our ours out about near nearby best top cheap cheapest " +
34
+ "free online official good great versus than that this these those there their them they its not any all some much many more most get " +
35
+ "just also very only own same such too here myself yourself " +
36
+ "para por con sin los las del una uno unos unas que como mas sobre entre desde hasta cual cuales donde cuando quien porque esta este esto son " +
37
+ "les des une pour avec dans sur par aux est sont qui quoi comment pourquoi quel quelle quels quelles sans chez leur leurs vous nous " +
38
+ "der die das den dem und mit fur von ein eine einen einem einer auf aus bei nach zum zur ist sind wie warum wann welche welcher welches oder " +
39
+ "com dos das uma uns umas sem nos nas pelo pela onde quando qual quais " +
40
+ "per della delle dei degli gli che come nel nella nei sul sulla dove quale quali perche"
41
+ ).split(" "),
42
+ );
43
+ export const mainWords = s => [
44
+ ...new Set(
45
+ norm(s)
46
+ .split(" ")
47
+ .filter(w => (w.length >= 3 || /\d/.test(w)) && !STOP.has(w)),
48
+ ),
49
+ ];
50
+ // One word holds the other with up to 3 more letters, so plurals and simple endings match ("repair", "repairs",
51
+ // "precios"). Prefix matching only, no stemming or synonyms ("plumber" and "plumbing" differ). Add a per-language
52
+ // stemmer if false gaps show up.
53
+ const same = (a, b) => {
54
+ const [s, l] = a.length <= b.length ? [a, b] : [b, a];
55
+ return a === b || (s.length >= 3 && l.startsWith(s) && l.length - s.length <= 3);
56
+ };
57
+ // A page is about a query when its title and H1 hold the query's main words. With 3 or more, all but one is enough: the
58
+ // extra word is usually a place or a detail ("boiler servicing leeds" on a page titled "Boiler servicing").
59
+ const covers = (pageWords, words) =>
60
+ words.filter(w => pageWords.some(p => same(w, p))).length >= (words.length >= 3 ? words.length - 1 : words.length);
61
+ // English question words followed by at least two more words ("how much" alone isn't a question), or a question mark in
62
+ // any language. "can", "do", "is" and the like start a question only before a pronoun or an article, so "can opener
63
+ // electric" and "do it yourself bathroom" aren't questions.
64
+ const QUESTION =
65
+ /^(?:(?:what|what['’]?s|how|why|when|where|who|whom|whose|which)\s+\S+\s+\S+|(?!do\s+it\s+yourself\b)(?:can|could|does|do|did|is|are|should|would|will)\s+(?:i|you|we|they|he|she|it|my|your|our|their|a|an|the|this|that|these|those|there|anyone|someone|people)\s+\S+)|[??¿]/i;
66
+ // The same escaping as render-report.mjs, which doesn't export it: a backslash before each special character.
67
+ const md = s =>
68
+ String(s ?? "")
69
+ .replace(/\s+/g, " ")
70
+ .replace(/[\\`*_[\]<>|]/g, "\\$&");
71
+ const pathOf = u => {
72
+ try {
73
+ const x = new URL(u);
74
+ return x.pathname + x.search;
75
+ } catch {
76
+ return String(u);
77
+ }
78
+ };
79
+ const valid = r =>
80
+ r && typeof r.query === "string" && r.query.trim() && Number.isFinite(r.impressions) && Number.isFinite(r.position);
81
+
82
+ // search is google.json or gsc.json; words is the page-words file that crawl.pageWords names, or null.
83
+ export function keywordIdeas({ search, crawl = null, brand, extra = [], words = null }) {
84
+ const notes = [];
85
+ const pageQueries = search.pageQueries && typeof search.pageQueries === "object" ? search.pageQueries : {};
86
+ let rows = (Array.isArray(search.queries) ? search.queries : []).filter(valid);
87
+ // Only per-page exports: the site's queries are their sum (position weighted by impressions, as for pages).
88
+ if (!rows.length) {
89
+ const sum = {};
90
+ for (const list of Object.values(pageQueries))
91
+ for (const r of (Array.isArray(list) ? list : []).filter(valid))
92
+ addTraffic(sum, r.query, {
93
+ clicks: r.clicks || 0,
94
+ impressions: r.impressions,
95
+ ctr: r.ctr || 0,
96
+ position: r.position,
97
+ });
98
+ rows = Object.entries(sum).map(([query, m]) => ({ query, ...m }));
99
+ }
100
+ if (!rows.length) notes.push("The Search Console data has no queries, so only the --extra phrases are listed.");
101
+ // The page that shows for each query: the one with most of its impressions.
102
+ const top = new Map();
103
+ for (const [path, list] of Object.entries(pageQueries))
104
+ for (const r of (Array.isArray(list) ? list : []).filter(valid)) {
105
+ const k = r.query.toLowerCase(),
106
+ t = top.get(k);
107
+ if (!t || r.impressions > t.impressions) top.set(k, { path, impressions: r.impressions });
108
+ }
109
+
110
+ const site = search.site || crawl?.siteOrigin,
111
+ host = (() => {
112
+ try {
113
+ return new URL(site).hostname;
114
+ } catch {
115
+ return "";
116
+ }
117
+ })();
118
+ const given = brand || crawl?.options?.brand,
119
+ brandName = host ? withSiteName(given, host) : given || "";
120
+ notes.push(
121
+ brandName
122
+ ? `Brand queries are left out using “${brandName.split("|").join("” or “")}”${given ? ` (${brand ? "from --brand" : "the crawl's --brand"}${host ? " and the site's address" : ""})` : ", taken from the site's address. Pass --brand with the business name if it's different"}.`
123
+ : "No brand name was given or found, so brand queries weren't left out. Pass --brand with the business name.",
124
+ );
125
+
126
+ // Pages with a title or H1 to compare. A crawl that stopped at its page limit, or whose pages have neither (blocked,
127
+ // or built in the browser), can't show that no page is about a query, so gaps aren't judged.
128
+ const crawled = Array.isArray(crawl?.pages) ? crawl.pages.filter(p => p?.url && (p.title || p.h1Text)) : null;
129
+ const pages =
130
+ crawled?.length && !crawl.stats?.capped
131
+ ? crawled.map(p => ({ path: pathOf(p.url), words: mainWords(`${p.title || ""} ${p.h1Text || ""}`) }))
132
+ : null;
133
+ // The page whose title or H1 is about the phrase, null when none is, undefined when that can't be judged.
134
+ const about = phrase =>
135
+ !pages || NOSPACE.test(phrase) ? undefined : (pages.find(p => covers(p.words, mainWords(phrase)))?.path ?? null);
136
+ if (!crawl)
137
+ notes.push(
138
+ "Without --crawl, page titles and H1s weren't read, so “shown for, but no page is about it” wasn't checked.",
139
+ );
140
+ else if (crawl.stats?.capped && crawled?.length)
141
+ notes.push(
142
+ "The crawl stopped at its page limit (--max), so a page it didn't reach may be about a query. “Shown for, but no page is about it” wasn't checked.",
143
+ );
144
+ else if (!pages)
145
+ notes.push(
146
+ "No crawled page has a title or H1 (the crawl may have been blocked, or the pages are built in the browser), so “shown for, but no page is about it” wasn't checked.",
147
+ );
148
+ const unjudged = pages ? rows.filter(r => NOSPACE.test(r.query)).length : 0;
149
+ if (unjudged)
150
+ notes.push(
151
+ `${unjudged} quer${unjudged === 1 ? "y is" : "ies are"} in a script written without spaces between words, so whether a page is about ${unjudged === 1 ? "it" : "them"} wasn't judged.`,
152
+ );
153
+
154
+ const almostThere = [],
155
+ gaps = pages ? [] : null,
156
+ questions = [];
157
+ for (const r of [...rows].sort((a, b) => b.impressions - a.impressions)) {
158
+ if (r.impressions < MIN_IMPRESSIONS) continue;
159
+ const kind = classify(r.query, brandName || ""),
160
+ page = top.get(r.query.toLowerCase())?.path ?? null;
161
+ const idea = use => ({
162
+ phrase: r.query,
163
+ source: "Search Console",
164
+ evidence: { impressions: r.impressions, clicks: r.clicks ?? 0, position: r.position, page },
165
+ use,
166
+ });
167
+ if (kind === "other" && r.position >= 8 && r.position <= 20) {
168
+ almostThere.push(
169
+ idea(
170
+ page
171
+ ? `Improve ${page} for this query: answer it clearly, use its words in a heading if they fit, and link to the page from related pages.`
172
+ : "Find the page that shows for it in Search Console (Performance, filter by this query, then Pages), and answer the query clearly on that page.",
173
+ ),
174
+ );
175
+ } else if (QUESTION.test(r.query) && (kind === "other" || kind === "brand")) {
176
+ // Brand questions stay: "does acme deliver to ireland" is a good FAQ entry.
177
+ const a = about(r.query);
178
+ questions.push(
179
+ idea(
180
+ a
181
+ ? `Answer it in a short section or an FAQ on ${a}, which is already about this.`
182
+ : `${a === null && r.position > 10 ? "No page is about this yet. " : ""}Answer it in an FAQ or a section on the page that fits best.`,
183
+ ),
184
+ );
185
+ } else if (kind === "other" && gaps && r.position > 10 && about(r.query) === null) {
186
+ // On page one (position 10 or better), Google already sees a page as about the query, whatever its title says.
187
+ gaps.push(
188
+ idea("No page's title or H1 is about this. A new page, or a section on a related page, could answer it."),
189
+ );
190
+ }
191
+ }
192
+
193
+ const list = Array.isArray(extra) ? extra : [];
194
+ const ok = list.filter(
195
+ e => typeof e?.phrase === "string" && e.phrase.trim() && typeof e.source === "string" && e.source.trim(),
196
+ );
197
+ if (ok.length < list.length)
198
+ notes.push(
199
+ `${list.length - ok.length} entr${list.length - ok.length === 1 ? "y" : "ies"} in --extra ${list.length - ok.length === 1 ? "was" : "were"} skipped: each needs a phrase and a source.`,
200
+ );
201
+ const seen = new Set(),
202
+ byQuery = new Map(rows.map(r => [norm(r.query), r]));
203
+ const fromOutside = ok
204
+ .filter(e => {
205
+ const k = norm(e.phrase) + "\n" + e.source.trim();
206
+ return !seen.has(k) && seen.add(k);
207
+ })
208
+ .map(e => {
209
+ const a = about(e.phrase),
210
+ r = byQuery.get(norm(e.phrase));
211
+ return {
212
+ phrase: e.phrase.trim(),
213
+ source: e.source.trim(),
214
+ evidence: r
215
+ ? {
216
+ impressions: r.impressions,
217
+ clicks: r.clicks ?? 0,
218
+ position: r.position,
219
+ page: top.get(r.query.toLowerCase())?.path ?? null,
220
+ }
221
+ : null,
222
+ use: a
223
+ ? `${a} is already about this: check it answers it well.`
224
+ : a === null
225
+ ? "No page's title or H1 is about this. A new page or a section, if it fits what the site offers."
226
+ : "Check whether a page already covers it; if not, a new page or a section, if it fits what the site offers.",
227
+ };
228
+ });
229
+
230
+ // From the crawl's page words: searches a page shows for whose words its text lacks by covers()'s rule, and pages
231
+ // that hold a search's words but don't link to its top page. Within one site, pages whose title and paragraphs match
232
+ // the questions people ask are cited more by AI answers (a preprint). https://arxiv.org/abs/2610.15033
233
+ const pw = crawl?.pageWords,
234
+ side =
235
+ pw && words?.stamp === pw.stamp && Array.isArray(words.pages)
236
+ ? words.pages.filter(p => typeof p?.path === "string" && typeof p.words === "string")
237
+ : null;
238
+ const why = !Object.values(pageQueries).some(l => Array.isArray(l) && l.some(valid))
239
+ ? "the Search Console data has no per-page queries (google.mjs fetch reads them; with exports, use gsc-import.mjs --page-queries)"
240
+ : !crawl
241
+ ? "there's no --crawl"
242
+ : !pw
243
+ ? "the crawl has no page words, so an older crawler made it (run seo-crawl.mjs again)"
244
+ : !side
245
+ ? `${pw.file} is missing or from another crawl (run seo-crawl.mjs again)`
246
+ : null;
247
+ let linkIdeas = null,
248
+ queryGaps = null;
249
+ if (why) notes.push(`Internal link ideas and searches a page doesn't mention weren't checked: ${why}.`);
250
+ else {
251
+ const pairs = Object.entries(pageQueries)
252
+ .flatMap(([path, list]) =>
253
+ (Array.isArray(list) ? list : [])
254
+ .filter(
255
+ r =>
256
+ valid(r) &&
257
+ r.impressions >= MIN_IMPRESSIONS &&
258
+ !NOSPACE.test(r.query) &&
259
+ classify(r.query, brandName || "") === "other",
260
+ )
261
+ .map(r => ({ path, r, w: mainWords(r.query) })),
262
+ )
263
+ .filter(x => x.w.length)
264
+ .sort((a, b) => b.r.impressions - a.r.impressions);
265
+ // Each page's words are read once, against the searches' words only, and matched as same() matches them: a page
266
+ // word holds a search word equal to it, one it starts with plus up to 3 letters, or one that starts with it plus up
267
+ // to 3.
268
+ const want = new Set(pairs.flatMap(x => x.w)),
269
+ longer = new Map(),
270
+ withWord = new Map(),
271
+ push = (m, k, v) => (m.get(k) || m.set(k, []).get(k)).push(v);
272
+ for (const s of want) for (let i = 1; i <= 3 && s.length - i >= 3; i++) push(longer, s.slice(0, -i), s);
273
+ const held = side.map(p => {
274
+ const h = new Set();
275
+ for (const w of p.words.split(" ")) {
276
+ if (want.has(w)) h.add(w);
277
+ for (let i = 1; i <= 3 && w.length - i >= 3; i++) if (want.has(w.slice(0, -i))) h.add(w.slice(0, -i));
278
+ for (const s of longer.get(w) || []) h.add(s);
279
+ }
280
+ return h;
281
+ });
282
+ held.forEach((h, i) => {
283
+ for (const s of h) push(withWord, s, i);
284
+ });
285
+ const at = new Map(side.map((p, i) => [p.path, i])),
286
+ enough = (n, w) => n >= (w.length >= 3 ? w.length - 1 : w.length); // covers()'s rule
287
+ const unread = new Set(),
288
+ spaceless = new Set(),
289
+ pages = n => `${n} page${n === 1 ? "" : "s"}`;
290
+ linkIdeas = [];
291
+ queryGaps = [];
292
+ for (const { path, r, w } of pairs) {
293
+ const x = at.get(path),
294
+ ev = { page: path, query: r.query, impressions: r.impressions, clicks: r.clicks ?? 0, position: r.position };
295
+ if (x === undefined) {
296
+ unread.add(path);
297
+ continue;
298
+ }
299
+ const missing = w.filter(s => !held[x].has(s));
300
+ if (side[x].nospace) spaceless.add(path);
301
+ else if (!enough(w.length - missing.length, w)) queryGaps.push({ ...ev, missing });
302
+ // One page to link to for each search; past MAX + 1 ideas, the rest aren't looked for (most impressions come
303
+ // first).
304
+ if (linkIdeas.length > MAX || top.get(r.query.toLowerCase())?.path !== path) continue;
305
+ const count = new Map();
306
+ for (const s of w) for (const a of withWord.get(s) || []) count.set(a, (count.get(a) || 0) + 1);
307
+ // Pages holding every word first, then the crawl's order (roughly nearest the home page first).
308
+ const from = [...count]
309
+ .filter(([a, n]) => a !== x && enough(n, w) && !(Array.isArray(side[a].links) && side[a].links.includes(x)))
310
+ .sort((a, b) => b[1] - a[1] || a[0] - b[0])
311
+ .slice(0, 3)
312
+ .map(([a]) => side[a].path);
313
+ if (from.length) linkIdeas.push({ ...ev, from });
314
+ }
315
+ if (linkIdeas.length > MAX) {
316
+ notes.push(`Internal link ideas: only the ${MAX} with the most impressions are listed, and there are more.`);
317
+ linkIdeas.length = MAX;
318
+ }
319
+ if (unread.size)
320
+ notes.push(
321
+ `${pages(unread.size)} with Search Console queries ${unread.size === 1 ? "isn't" : "aren't"} among the crawl's indexable pages (not reached, noindex, pointing elsewhere with a canonical, or built in the browser), so ${unread.size === 1 ? "it wasn't" : "they weren't"} checked for link ideas or searches ${unread.size === 1 ? "it doesn't" : "they don't"} mention.`,
322
+ );
323
+ if (spaceless.size)
324
+ notes.push(
325
+ `${pages(spaceless.size)} ${spaceless.size === 1 ? "is" : "are"} mostly in a script written without spaces between words, so which searches ${spaceless.size === 1 ? "it doesn't" : "they don't"} mention wasn't judged.`,
326
+ );
327
+ }
328
+
329
+ const cap = (name, g) => {
330
+ if (g && g.length > MAX)
331
+ notes.push(`${name}: only the first ${MAX} of ${g.length} are listed, most impressions first.`);
332
+ return g && g.slice(0, MAX);
333
+ };
334
+ notes.push(
335
+ "Almost there is per query. Search Console's almost-page-one finding (INTENT-04) is per page: a page at position 8 to 20 overall. The two often overlap, but a page can rank well overall and still be almost there for one query. These ideas aren't findings and never change the score.",
336
+ // https://developers.google.com/search/blog/2022/10/performance-data-deep-dive
337
+ "Search Console hides rare queries to protect searchers' privacy (ones fewer than a few dozen people searched in two to three months), so some real searches aren't here.",
338
+ "There are no search volumes or difficulty scores: those need paid data, and none are guessed.",
339
+ "You pick which ideas become targets. Only the ones you pick go into the profile's Target phrases table, with their source.",
340
+ );
341
+ return {
342
+ tool: "seo-supervisor-keyword-ideas",
343
+ period: search.period ?? null,
344
+ brand: brandName || null,
345
+ almostThere: cap("Almost there", almostThere),
346
+ gaps: cap("Shown for, but no page is about it", gaps),
347
+ questions: cap("Questions people search", questions),
348
+ extra: cap("Ideas from search results and competitors", fromOutside),
349
+ linkIdeas: cap("Internal link ideas", linkIdeas),
350
+ queryGaps: cap("Searches a page doesn't mention", queryGaps),
351
+ notes,
352
+ };
353
+ }
354
+
355
+ const GROUPS = [
356
+ [
357
+ "almostThere",
358
+ "Almost there",
359
+ "Queries at position 8 to 20 with impressions, and the page that shows for each. A small improvement can bring them onto page one.",
360
+ ],
361
+ [
362
+ "gaps",
363
+ "Shown for, but no page is about it",
364
+ "Queries with impressions, below page one, where no page's title or H1 holds the query's main words. Brand queries are left out.",
365
+ ],
366
+ [
367
+ "questions",
368
+ "Questions people search",
369
+ "Question-shaped queries, found by English question words or a question mark in any language. Each could be an FAQ or a section.",
370
+ ],
371
+ [
372
+ "extra",
373
+ "Ideas from search results and competitors",
374
+ "Phrases collected with outside checks on. Each keeps the source it came from.",
375
+ ],
376
+ ];
377
+ const LIMITS = `Searches with at least ${MIN_IMPRESSIONS} impressions on the page, brand searches left out. At most ${MAX}, most impressions first (our own limit).`;
378
+ // https://developers.google.com/search/docs/crawling-indexing/links-crawlable
379
+ const PAGE_GROUPS = /** @type {[string, string, string, string, (i: any) => string[]][]} */ ([
380
+ [
381
+ "linkIdeas",
382
+ "Internal link ideas",
383
+ `A page shows in Google for a search, and other pages mention that search in their title, H1 or main text but don't link to it. Google uses links to find pages and to judge what they're about, and a link's words tell people and Google what the page is. So a link from those pages, in a sentence about the search, could help. ${LIMITS} Up to 3 pages each (our own limit), those using every word first.`,
384
+ "Pages that mention it but don't link to it",
385
+ i => i.from,
386
+ ],
387
+ [
388
+ "queryGaps",
389
+ "Searches a page doesn't mention",
390
+ `Searches a page shows in Google for, whose words its title, H1 and main text don't use. A page can't answer a search well if it never mentions it. A 2026 study of AI answers found that, within one site, pages whose title and paragraphs match the questions people ask get cited more (Chen and Koudas, a preprint, not yet peer reviewed). Add the words only where they fit what the page is about. ${LIMITS}`,
391
+ "Words the page doesn't use",
392
+ i => i.missing,
393
+ ],
394
+ ]);
395
+
396
+ export function ideasMarkdown(r) {
397
+ const n = x => Number(x).toLocaleString("en-US");
398
+ const L = [
399
+ "# Keyword ideas",
400
+ "",
401
+ `From Search Console${r.period ? ` (${md(r.period)})` : ""}. Information only: you pick which ideas become targets.`,
402
+ "",
403
+ ];
404
+ for (const [key, title, what] of GROUPS) {
405
+ L.push(`## ${title}`, "", what, "");
406
+ const g = r[key];
407
+ if (!g) {
408
+ L.push("Not checked: run with --crawl to read page titles and H1s.", "");
409
+ continue;
410
+ }
411
+ if (!g.length) {
412
+ L.push("None.", "");
413
+ continue;
414
+ }
415
+ L.push("| Phrase | Source | Evidence | Suggested use |", "| --- | --- | --- | --- |");
416
+ for (const i of g) {
417
+ const e = i.evidence,
418
+ ev = e
419
+ ? `${n(e.impressions)} impressions, ${n(e.clicks)} clicks, position ${e.position}${e.page ? `, shows ${md(e.page)}` : ""}`
420
+ : "";
421
+ L.push(`| ${md(i.phrase)} | ${md(i.source)} | ${ev} | ${md(i.use)} |`);
422
+ }
423
+ L.push("");
424
+ }
425
+ for (const [key, title, what, col, list] of PAGE_GROUPS) {
426
+ L.push(`## ${title}`, "", what, "");
427
+ const g = r[key];
428
+ if (!g) {
429
+ L.push("Not checked: the notes say why.", "");
430
+ continue;
431
+ }
432
+ if (!g.length) {
433
+ L.push("None.", "");
434
+ continue;
435
+ }
436
+ L.push(
437
+ `| Page | Search | Evidence | ${col} |`,
438
+ "| --- | --- | --- | --- |",
439
+ ...g.map(
440
+ i =>
441
+ `| ${md(i.page)} | ${md(i.query)} | ${n(i.impressions)} impressions on this page, ${n(i.clicks)} clicks, position ${i.position} | ${list(i).map(md).join(", ")} |`,
442
+ ),
443
+ "",
444
+ );
445
+ }
446
+ L.push("## Notes", "", ...r.notes.map(x => `- ${md(x)}`), "");
447
+ return L.join("\n");
448
+ }
449
+
450
+ function main(argv) {
451
+ const args = parseArgs(argv, {
452
+ flags: ["google", "gsc", "crawl", "brand", "extra", "out"],
453
+ positionals: 0,
454
+ usage: USAGE,
455
+ });
456
+ const str = k => (typeof args[k] === "string" ? args[k] : null);
457
+ const file = str("google") || str("gsc");
458
+ if (!file || (str("google") && str("gsc"))) throw new Fail(USAGE);
459
+ const read = f => {
460
+ try {
461
+ return JSON.parse(readFileSync(f, "utf8"));
462
+ } catch (e) {
463
+ throw new Fail(
464
+ `keyword-ideas: can't read ${f} (${e.code === "ENOENT" ? "it isn't there" : e.code || "it isn't JSON"}).`,
465
+ );
466
+ }
467
+ };
468
+ const search = read(file),
469
+ crawl = str("crawl") ? read(args.crawl) : null,
470
+ extra = str("extra") ? read(args.extra) : [];
471
+ if (!search || typeof search !== "object")
472
+ throw new Fail(`keyword-ideas: ${file} isn't google.mjs's or gsc-import.mjs's output.`);
473
+ if (crawl && !Array.isArray(crawl.pages))
474
+ throw new Fail(`keyword-ideas: ${args.crawl} isn't the crawler's seo-crawl.json (it has no pages list).`);
475
+ if (!Array.isArray(extra))
476
+ throw new Fail(`keyword-ideas: ${args.extra} must be a JSON list of { "phrase", "source" }.`);
477
+ const any = l => Array.isArray(l) && l.some(valid);
478
+ if (!any(search.queries) && !Object.values(search.pageQueries || {}).some(any) && !extra.length)
479
+ throw new Fail(
480
+ `keyword-ideas: ${file} has no search queries. Import Search Console's Queries export with gsc-import.mjs --queries, or run google.mjs fetch, then try again.`,
481
+ );
482
+ // Only pageWords' file name is used, so nothing outside the crawl's folder is read. keywordIdeas notes a missing
483
+ // file.
484
+ let words = null;
485
+ if (typeof crawl?.pageWords?.file === "string")
486
+ try {
487
+ words = JSON.parse(readFileSync(join(dirname(resolve(args.crawl)), basename(crawl.pageWords.file)), "utf8"));
488
+ } catch {
489
+ /* noted */
490
+ }
491
+ const r = keywordIdeas({ search, crawl, brand: str("brand"), extra, words });
492
+ const out = resolve(str("out") || "seo-audit/keyword-ideas.json"),
493
+ mdOut = out.replace(/\.json$/i, "") + ".md";
494
+ mkdirSync(dirname(out), { recursive: true });
495
+ writeFileSync(out, JSON.stringify(r, null, 2));
496
+ writeFileSync(mdOut, ideasMarkdown(r));
497
+ console.log(
498
+ `keyword-ideas: ${r.almostThere.length} almost there, ${r.gaps ? `${r.gaps.length} with no page about them` : "pages not checked (no --crawl)"}, ${r.questions.length} questions, ${r.extra.length} from outside checks, ${r.linkIdeas ? `${r.linkIdeas.length} internal link ideas, ${r.queryGaps.length} searches a page doesn't mention` : "link ideas not checked (see the notes)"} · wrote ${out} and ${mdOut}`,
499
+ );
500
+ return 0;
501
+ }
502
+
503
+ if (isMain(import.meta.url)) await runMain(() => main(process.argv.slice(2)));
@@ -0,0 +1,56 @@
1
+ // @ts-check
2
+ // The scripts' one argument parser: --name value, --name=value and --name alone (true). A word not starting with --
3
+ // is the previous flag's value, else a positional in _; a value never starts with --, so "--out --yes" sets both true.
4
+ // A repeated flag keeps its last value unless it's in lists. --help or -h anywhere prints usage and exits 0 (runMain).
5
+ import { Fail } from "./cli.mjs";
6
+
7
+ export const isHelp = a => a === "--help" || a === "-h";
8
+
9
+ /**
10
+ * @param {string[]} argv the words after the script's name
11
+ * @param {{ flags?: string[], booleans?: string[], aliases?: Record<string, string>, lists?: string[], positionals?: number, usage?: string }} [o]
12
+ * flags: the flags that take a value; when given, any flag not listed here, in booleans, lists or aliases stops the
13
+ * script, so a misspelt one isn't silently ignored. booleans: flags that never take a value (the next word stays a
14
+ * positional). aliases: another spelling → the flag's own name. lists: flags that may repeat, collected in an array.
15
+ * positionals: how many positional words the script takes (any number unless given); one more stops the script.
16
+ * usage: what --help prints.
17
+ * @returns {{ _: string[], [flag: string]: any }}
18
+ */
19
+ export function parseArgs(
20
+ argv,
21
+ {
22
+ flags,
23
+ booleans = [],
24
+ aliases = {},
25
+ lists = [],
26
+ positionals = Infinity,
27
+ usage = "See the comment at the top of the script for its options.",
28
+ } = {},
29
+ ) {
30
+ if (argv.some(isHelp)) throw new Fail(usage, 0);
31
+ const out = /** @type {{ _: string[], [flag: string]: any }} */ ({ _: [] });
32
+ for (let i = 0; i < argv.length; i++) {
33
+ const a = argv[i];
34
+ if (!a.startsWith("--")) {
35
+ if (out._.length >= positionals)
36
+ throw new Fail(
37
+ `unexpected "${a}": options start with --, like --${a.replace(/^-+/, "")}${positionals ? "" : "; this script takes no other words"}.`,
38
+ );
39
+ out._.push(a);
40
+ continue;
41
+ }
42
+ const eq = a.indexOf("="),
43
+ name = a.slice(2, eq < 0 ? undefined : eq),
44
+ k = Object.hasOwn(aliases, name) ? aliases[name] : name;
45
+ let v = /** @type {string | true | undefined} */ (eq < 0 ? undefined : a.slice(eq + 1));
46
+ if (flags && ![flags, booleans, lists].some(l => l.includes(k)))
47
+ throw new Fail(`unknown option --${name}. Check its spelling against the script's usage.`);
48
+ if (booleans.includes(k)) {
49
+ if (v !== undefined) throw new Fail(`--${name} takes no value (got --${name}=${v}).`);
50
+ v = true;
51
+ } else if (v === undefined) v = i + 1 < argv.length && !argv[i + 1].startsWith("--") ? argv[++i] : true;
52
+ if (lists.includes(k)) (out[k] ||= []).push(v);
53
+ else out[k] = v;
54
+ }
55
+ return out;
56
+ }
@@ -0,0 +1,27 @@
1
+ // @ts-check
2
+ // Whether a schema.org type is a business, read from schema.org's type tree (data/schema-vocab.json) so every subtype
3
+ // counts, not only the names a pattern happens to list.
4
+ import { readFileSync } from "node:fs";
5
+
6
+ /** @type {Record<string, string[]> | undefined} */
7
+ let types;
8
+ // Null prototype, so a page's "constructor" or "__proto__" type is just an unknown name.
9
+ /** schema.org's types, each with its parent types. */
10
+ export const schemaTypes = () =>
11
+ (types ??= Object.assign(
12
+ Object.create(null),
13
+ JSON.parse(readFileSync(new URL("../data/schema-vocab.json", import.meta.url), "utf8")).types,
14
+ ));
15
+ const cache = new Map();
16
+ /** A type and every type above it in schema.org's tree. @type {(t: string) => Set<string>} */
17
+ export const ancestors = t =>
18
+ cache.get(t) || cache.set(t, new Set([t, ...(schemaTypes()[t] || []).flatMap(p => [...ancestors(p)])])).get(t);
19
+ /** @param {string} t @param {string} base */
20
+ export const isA = (t, base) => ancestors(t).has(base);
21
+ // A page may write the type as a schema.org URL ("https://schema.org/Bakery") or with a prefix ("schema:Bakery").
22
+ const term = t => (typeof t === "string" ? t.trim().replace(/^(?:https?:\/\/schema\.org\/|schema:)/, "") : "");
23
+ /** Organization or any subtype: a company, shop, clinic, school or club. A Service, Person, Brand or WebSite isn't. */
24
+ export const isBusinessType = t => isA(term(t), "Organization");
25
+ /** LocalBusiness or any subtype: a business with a place customers visit, or an area it serves. An online-only shop,
26
+ * a Corporation or a School isn't one. */
27
+ export const isLocalBusinessType = t => isA(term(t), "LocalBusiness");