seo 0.20.0 → 0.20.1
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/cli.js +2 -2
- package/dist/{dist-rniZUhAU.js → dist-B1isXhiX.js} +1 -1
- package/dist/{dist-CP7JU-F_.js → dist-CElJ7UE2.js} +101 -101
- package/dist/dist-CElJ7UE2.js.map +1 -0
- package/dist/{esm-B6IvIMUU.js → esm-BwG6KnkI.js} +2 -2
- package/dist/{esm-B6IvIMUU.js.map → esm-BwG6KnkI.js.map} +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +13 -4
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +13 -4
- package/dist/mcp.js.map +1 -1
- package/package.json +1 -1
- package/dist/dist-CP7JU-F_.js.map +0 -1
package/dist/mcp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __seoCreateRequire } from 'node:module'; const require = __seoCreateRequire(import.meta.url);
|
|
2
|
-
import { i as __toESM, n as version, r as __commonJSMin, t as load } from "./esm-
|
|
2
|
+
import { i as __toESM, n as version, r as __commonJSMin, t as load } from "./esm-BwG6KnkI.js";
|
|
3
3
|
import { createHash, randomUUID, sign } from "node:crypto";
|
|
4
4
|
import { ZodOptional, z } from "zod";
|
|
5
5
|
import { arch, homedir, hostname, platform, tmpdir, totalmem } from "node:os";
|
|
@@ -22939,6 +22939,7 @@ const PRONOUNS = /\b(it|its|they|them|their|this|these|those)\b/gu;
|
|
|
22939
22939
|
const TIME_WORD = /\b(this|these|those) (morning|evening|afternoon|night|day|date|week|weekend|month|year|time)\b/gu;
|
|
22940
22940
|
const DUMMY_IT = /\b(now|rn|atm|tn|tdy|tmr|tmrw|tonite|yday|currently|to ?n?ight|to day|lastn\S*|(last|past|next|this) \S+|(mon|tues|wednes|thurs|fri|satur|sun)day|outside|dark|sunny|raining|snowing|o'?clock)\b|\bit (take|takes|took)\b.*\b(to|for)\b|\b(far|miles|km) (is|was) it (to|from|around|between)\b|\bis it (\S+ )?(safe|legal|illegal|possible|ok|okay|bad|good|better|best|hard|easy|normal|necessary|true|cheaper|rude|wise) (to|for|if)\b/u;
|
|
22941
22941
|
const IDENTIFY_IT = /^(what|which)( (kind|type|sort) of)?( \S+){1,2} (is|was) it\b|^(is|was) it (a|an|the) /u;
|
|
22942
|
+
const IT_FIELD = /(?<!\b(do|does|did|will|would|can|could|should|might|may|must|is|was|has|have|make|makes|let|help|helps|get|gets) )\bit (support|helpdesk|help desk|jobs?|careers?|manager|managers|director|department|dept|services?|company|companies|consultants?|consultancy|consulting|technicians?|admins?|administrators?|security|professionals?|industry|sector|salary|salaries|team|apprenticeships?|courses?|certifications?|contractors?|specialists?|analysts?|infrastructure|systems|budget|outsourcing|staff|roles?|skills|training|recruitment|recruiters?|engineers?|projects?|graduate|degree|asset|equipment|policy|procurement)\b|\b(work|working|works|jobs?|careers?|degree|degrees|experience|qualifications?|apprenticeships?|get|getting|break|switch|move) in(to)? it\b|\b(head|director|manager|vp|department) of it\b/gu;
|
|
22942
22943
|
const CLASS_WORD = /\b(name|surname|names|word|thing|one|company|brand|product|place|site|website|app|scam|service)\b/u;
|
|
22943
22944
|
const PRONOUN_WORDS = 10;
|
|
22944
22945
|
const DAYS$1 = [
|
|
@@ -22950,7 +22951,7 @@ const DAYS$1 = [
|
|
|
22950
22951
|
function pointsBack(text) {
|
|
22951
22952
|
const tokens = text.split(/\s+/u);
|
|
22952
22953
|
if (tokens.length >= PRONOUN_WORDS) return false;
|
|
22953
|
-
const found = text.replace(TIME_WORD, " ").replace(/(?<!^)\bits\b/gu, " ").match(PRONOUNS) ?? [];
|
|
22954
|
+
const found = text.replace(TIME_WORD, " ").replace(IT_FIELD, " ").replace(/(?<!^)\bits\b/gu, " ").match(PRONOUNS) ?? [];
|
|
22954
22955
|
if (!found.length) return false;
|
|
22955
22956
|
if (!found.every((word) => word === "it" || word === "its")) return true;
|
|
22956
22957
|
return !(DUMMY_IT.test(text) || IDENTIFY_IT.test(text) && !CLASS_WORD.test(text) || tokens.some((token) => token.length >= 4 && DAYS$1.some((day) => editsWithin(token, day, day.length >= 8 ? 2 : 1))));
|
|
@@ -40549,8 +40550,9 @@ var IndexMySite = class {
|
|
|
40549
40550
|
if (init.body !== void 0) headers["content-type"] = "application/json";
|
|
40550
40551
|
if (init.idempotencyKey) headers["idempotency-key"] = init.idempotencyKey;
|
|
40551
40552
|
let response;
|
|
40553
|
+
const fetcher = this.fetcher;
|
|
40552
40554
|
try {
|
|
40553
|
-
response = await
|
|
40555
|
+
response = await fetcher(new URL(path, this.base), {
|
|
40554
40556
|
method: init.method ?? "GET",
|
|
40555
40557
|
headers,
|
|
40556
40558
|
body: init.body === void 0 ? void 0 : JSON.stringify(init.body),
|
|
@@ -50225,7 +50227,7 @@ async function indexNowKey(input, submit, call) {
|
|
|
50225
50227
|
if (key !== saved) await submit.saveIndexNowKey(host, key);
|
|
50226
50228
|
const check = await checkKeyFile(host, key, submit.fetch);
|
|
50227
50229
|
return {
|
|
50228
|
-
text: check.live ? `IndexNow key for ${host} is live: ${check.url} returns the key. Send pages with ${call("submit", { action: "indexnow" })}.` : `IndexNow key for ${host}: ${key}${saved && key === saved ? " (saved earlier)" : " (saved now)"}. Not live yet: ${check.url} ${check.problem}.\n${setupSteps(host, key, call)}`,
|
|
50230
|
+
text: check.live ? `IndexNow key for ${host} is live: ${check.url} returns the key. ${submit.indexNowBlocked ? sendElsewhere(submit.indexNowBlocked, [], call) : `Send pages with ${call("submit", { action: "indexnow" })}.`}` : `IndexNow key for ${host}: ${key}${saved && key === saved ? " (saved earlier)" : " (saved now)"}. Not live yet: ${check.url} ${check.problem}.\n${setupSteps(host, key, call)}`,
|
|
50229
50231
|
data: {
|
|
50230
50232
|
action: "indexnow_key",
|
|
50231
50233
|
host,
|
|
@@ -50238,6 +50240,12 @@ async function indexNowKey(input, submit, call) {
|
|
|
50238
50240
|
}
|
|
50239
50241
|
};
|
|
50240
50242
|
}
|
|
50243
|
+
function sendElsewhere(reason, urls, call) {
|
|
50244
|
+
return `${reason}. Send pages to IndexNow from your own machine with the seo CLI, free: ${!urls.length ? "seo submit <url...>" : urls.length <= 3 ? `seo submit ${urls.join(" ")}` : `seo submit --file urls.txt, with the ${n(urls.length)} URLs one per line`}. Or send them with Index My Site's Bing option, which reaches Google and Bing for 2 credits a URL: ${call("submit", {
|
|
50245
|
+
action: "indexmysite",
|
|
50246
|
+
bing: "true"
|
|
50247
|
+
})}.`;
|
|
50248
|
+
}
|
|
50241
50249
|
async function indexNow(input, submit, call) {
|
|
50242
50250
|
const urls = cleanUrls(input.urls, INDEXNOW_MAX_URLS);
|
|
50243
50251
|
const hosts = [...new Set(urls.map((url) => new URL(url).hostname))];
|
|
@@ -50253,6 +50261,7 @@ async function indexNow(input, submit, call) {
|
|
|
50253
50261
|
const check = await checkKeyFile(host, key, submit.fetch);
|
|
50254
50262
|
if (!check.live) throw new CommandError("INVALID_INPUT", `Nothing was sent: the IndexNow key file ${check.url} is not live: it ${check.problem}. Search engines reject URLs until it is.\n${setupSteps(host, key, call)}`);
|
|
50255
50263
|
if (given && given !== await submit.indexNowKey(host)) await submit.saveIndexNowKey(host, given);
|
|
50264
|
+
if (submit.indexNowBlocked) throw new CommandError("NO_ACCESS", `Nothing was sent. ${sendElsewhere(submit.indexNowBlocked, urls, call)}`);
|
|
50256
50265
|
const result = await submitIndexNow({
|
|
50257
50266
|
host,
|
|
50258
50267
|
key,
|