domain-hound 0.1.8 → 0.1.10
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/.agents/plugins/marketplace.json +1 -1
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +45 -17
- package/clis/domain-check/company-search.mjs +1 -0
- package/clis/domain-check/google-play.mjs +11 -48
- package/clis/domain-check/google-search.mjs +3 -2
- package/clis/domain-check/handles.mjs +235 -106
- package/clis/domain-check/index.mjs +22 -7
- package/clis/domain-check/name-score.mjs +348 -0
- package/clis/domain-check/name-search.mjs +4 -6
- package/clis/domain-check/naming-method.mjs +37 -8
- package/clis/domain-check/price-catalog.mjs +12 -12
- package/clis/domain-check/public-name-checks.mjs +275 -0
- package/clis/domain-check/score-log.mjs +54 -0
- package/clis/domain-check/triage-sources.mjs +4 -1
- package/clis/domain-check/triage.mjs +109 -53
- package/clis/domain-check/youtube-handle.mjs +18 -0
- package/display.mjs +23 -18
- package/dossier.mjs +1 -1
- package/hosted-results.mjs +168 -0
- package/hosted.mjs +209 -0
- package/package.json +8 -1
- package/plugin.json +1 -1
- package/results-style.mjs +3 -0
- package/results.mjs +160 -58
- package/server.json +2 -2
- package/server.mjs +229 -23
- package/share.mjs +15 -5
- package/site/r/share-format.mjs +16 -5
- package/skills/naming/SKILL.md +76 -0
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
import { foldLatin } from './triage-sources.mjs';
|
|
2
|
+
import { scoreBand, scoreLabel } from '../../site/r/share-format.mjs';
|
|
3
|
+
|
|
4
|
+
// Name score v1 (2026-11-25): how clear the road is for one name, 0 to 100. It is not a probability; it stays a
|
|
5
|
+
// ranking of checked evidence until logged outcomes calibrate it.
|
|
6
|
+
// Order: bans (in code, before anything is scored), then hard filters on the checked evidence, then the points.
|
|
7
|
+
// A check that failed or is missing is never clear: it earns 40% of its component (rounded down) and a reason
|
|
8
|
+
// that says "Not checked" (or "Still checking" while the follow-up runs).
|
|
9
|
+
export const scoreVersion = 'v1';
|
|
10
|
+
export { scoreBand, scoreLabel };
|
|
11
|
+
export const scoreWeights = { domain: 22, price: 3, trademark: 25, rivals: 20, apps: 8, handles: 7, quality: 15 };
|
|
12
|
+
const componentOrder = Object.keys(scoreWeights);
|
|
13
|
+
export const endingPoints = { com: 22, ai: 19, io: 16, dev: 14, app: 12, co: 10, so: 8, me: 6, si: 4, xyz: 2, tech: 2 };
|
|
14
|
+
// v1 scores endings within $60 over 3 years; a larger budget the person gave widens the picks, not this filter.
|
|
15
|
+
export const scoreCapUsd = 60;
|
|
16
|
+
// Until the EU office answers, a clean US screen still leaves the trademark component at 20 of 25.
|
|
17
|
+
export const trademarkCapWithoutEu = 20;
|
|
18
|
+
// A failed USPTO or rival check, or naming bans the caller left unchecked, keep a name out of Strong.
|
|
19
|
+
export const uncheckedCap = 79;
|
|
20
|
+
const handleWeights = { GitHub: 3, npm: 2, Bluesky: 2 };
|
|
21
|
+
const unknownPart = max => Math.floor(max * 0.4);
|
|
22
|
+
|
|
23
|
+
// The evidence keys the caller supplies per name, for the bans code cannot decide on its own.
|
|
24
|
+
export const candidateFields = {
|
|
25
|
+
recipe: ['odd-pair', 'pun', 'blend', 'insider', 'phrase', 'other'],
|
|
26
|
+
relation: ['direct', 'loose', 'none'],
|
|
27
|
+
spellings: 'integer',
|
|
28
|
+
realWord: 'boolean',
|
|
29
|
+
descriptive: 'boolean',
|
|
30
|
+
misspelled: 'boolean',
|
|
31
|
+
narrow: 'boolean',
|
|
32
|
+
soundsLike: ['none', 'competitor', 'drug', 'pokemon'],
|
|
33
|
+
badMeaning: ['none', 'mild', 'severe'],
|
|
34
|
+
language: ['english', 'asked', 'other'],
|
|
35
|
+
};
|
|
36
|
+
const banEvidence = ['realWord', 'descriptive', 'misspelled', 'narrow', 'soundsLike'];
|
|
37
|
+
|
|
38
|
+
export function validCandidate(value) {
|
|
39
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) return false;
|
|
40
|
+
return Object.entries(value).every(([key, field]) => {
|
|
41
|
+
if (!Object.hasOwn(candidateFields, key)) return false;
|
|
42
|
+
const rule = candidateFields[key];
|
|
43
|
+
if (rule === 'boolean') return typeof field === 'boolean';
|
|
44
|
+
if (rule === 'integer') return Number.isInteger(field) && field >= 1 && field <= 5;
|
|
45
|
+
return rule.includes(field);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// The words of a name as typed: spaces, hyphens, digits and camel case split it ("LoomAI" -> loom, ai).
|
|
50
|
+
function words(input) {
|
|
51
|
+
return String(input ?? '').normalize('NFC').replace(/(\p{Ll})(\p{Lu})/gu, '$1 $2').replace(/(\p{Lu})(\p{Lu}\p{Ll})/gu, '$1 $2')
|
|
52
|
+
.toLowerCase().split(/[^\p{L}\p{N}]+/u).filter(Boolean);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export const letterCount = input => foldLatin(input).replace(/[^a-z]/g, '').length;
|
|
56
|
+
|
|
57
|
+
// Spoken syllables: vowel groups per word, a silent final e dropped, at least one per word.
|
|
58
|
+
export function syllableCount(input) {
|
|
59
|
+
const parts = String(input ?? '').replace(/([a-z])([A-Z])/g, '$1 $2').toLowerCase()
|
|
60
|
+
.normalize('NFKD').replace(/\p{M}/gu, '').match(/[a-z]+/g) ?? [];
|
|
61
|
+
return parts.reduce((total, part) => {
|
|
62
|
+
const spoken = /[^aeiouy]le$/.test(part) ? part : part.replace(/([aeiouy].*[^aeiouy])e$/, '$1');
|
|
63
|
+
return total + Math.max(1, (spoken.match(/[aeiouy]+/g) ?? []).length);
|
|
64
|
+
}, 0);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const banned = new Set(['ai', 'gpt', 'bot', 'smart']);
|
|
68
|
+
const botWords = new Set(['robot', 'abbot', 'sabot', 'talbot']);
|
|
69
|
+
const generic = ['hub', 'base', 'flow', 'labs', 'lab', 'apps', 'app', 'pro'];
|
|
70
|
+
const ioWords = new Set(['studio', 'radio', 'patio', 'audio', 'ratio', 'folio', 'polio', 'cheerio', 'portfolio', 'oratorio', 'trio', 'brio']);
|
|
71
|
+
|
|
72
|
+
// The deterministic bans, then the bans the caller's evidence decides. Returns the first ban, or null.
|
|
73
|
+
export function nameBan(input, candidate = {}) {
|
|
74
|
+
const text = String(input ?? '').trim();
|
|
75
|
+
const parts = words(text);
|
|
76
|
+
const key = foldLatin(text).replace(/[^a-z0-9]/g, '');
|
|
77
|
+
const last = parts.at(-1) ?? '';
|
|
78
|
+
if (/[\d_-]/.test(text)) return 'Numbers or hyphens';
|
|
79
|
+
if (candidate.language === 'other' || (/[^\x00-\x7F]/.test(text) && candidate.language !== 'asked')) return 'Not English';
|
|
80
|
+
if (parts.some(part => banned.has(part)) || key.includes('gpt') || key.startsWith('smart')
|
|
81
|
+
|| (/bot$/.test(key) && !botWords.has(last))) return 'AI, GPT, bot or smart in the name';
|
|
82
|
+
if (letterCount(text) > 12) return 'Over 12 letters';
|
|
83
|
+
if (syllableCount(text) > 3) return 'Over 3 syllables';
|
|
84
|
+
if ((last.length > 4 && last.endsWith('ify')) || /[bcdghjkmnpqrstvwxz]ly$/.test(last)
|
|
85
|
+
|| (last.length >= 4 && last.endsWith('io') && !ioWords.has(last))) return 'Trend ending (-ly, -ify, -io)';
|
|
86
|
+
if (!/[aeiouy]/.test(key) || /[bcdfgklmnpstvz]r$/.test(last)) return 'Dropped vowels';
|
|
87
|
+
if ((parts.length > 1 && parts.some(part => generic.includes(part)))
|
|
88
|
+
|| (parts.length === 1 && generic.some(word => key.endsWith(word) && key.length - word.length >= 3))) {
|
|
89
|
+
return 'Subject word plus a generic word';
|
|
90
|
+
}
|
|
91
|
+
if (candidate.descriptive === true) return 'Pure descriptive';
|
|
92
|
+
if (candidate.realWord === false) return 'Pure invented, no real word inside';
|
|
93
|
+
if (candidate.misspelled === true) return 'Deliberate misspelling';
|
|
94
|
+
if (['competitor', 'drug', 'pokemon'].includes(candidate.soundsLike)) {
|
|
95
|
+
return 'Sounds like a ' + (candidate.soundsLike === 'pokemon' ? 'Pokemon' : candidate.soundsLike);
|
|
96
|
+
}
|
|
97
|
+
if (candidate.narrow === true) return 'Too narrow for the product';
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const money = value => '$' + value.toFixed(2);
|
|
102
|
+
const listed = items => items.length < 3 ? items.join(' and ') : items.slice(0, -1).join(', ') + ' and ' + items.at(-1);
|
|
103
|
+
const unknownText = (state, what) => (state === 'pending' ? 'Still checking: ' : 'Not checked: ') + what;
|
|
104
|
+
const known = value => typeof value === 'number' && Number.isFinite(value);
|
|
105
|
+
|
|
106
|
+
function domainParts(options, cap) {
|
|
107
|
+
const fits = (options ?? []).filter(option => option && known(option.total) && Math.round(option.total * 100) <= Math.round(cap * 100)
|
|
108
|
+
&& option.registry === true);
|
|
109
|
+
const scored = fits.map(option => {
|
|
110
|
+
const ending = endingPoints[option.ending] ?? 0;
|
|
111
|
+
const price = option.total <= 30 ? 3 : option.total <= 45 ? 2 : 1;
|
|
112
|
+
return { ...option, ending: option.ending, points: ending, price };
|
|
113
|
+
}).sort((a, b) => b.points + b.price - a.points - a.price || a.total - b.total);
|
|
114
|
+
return scored[0] ?? null;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// marks: { us: 'ok' | 'unknown' | 'pending', eu: 'ok' | 'unknown' | 'pending' | 'off', list: [{ tier, sameClass, live }] }
|
|
118
|
+
function trademarkPart(marks) {
|
|
119
|
+
const list = Array.isArray(marks?.list) ? marks.list : [];
|
|
120
|
+
const identical = mark => mark.tier === 'Exact';
|
|
121
|
+
// Fuzzy (one edit) counts as near-identical; a mark with no class or no live status counts against the name.
|
|
122
|
+
// A dead mark is skipped. Only an identical mark with a verified live status in your classes is a hard filter; one whose
|
|
123
|
+
// status is unclear scores as the worst scored case instead.
|
|
124
|
+
const marksLeft = list.filter(mark => mark && mark.live !== false);
|
|
125
|
+
if (marksLeft.some(mark => identical(mark) && mark.sameClass === true && mark.live === true)) {
|
|
126
|
+
return { filtered: 'Identical live trademark in your classes' };
|
|
127
|
+
}
|
|
128
|
+
// Unknown classes (null) score as your classes.
|
|
129
|
+
const worst = marksLeft.reduce((low, mark) => Math.min(low, mark.sameClass !== false ? 5 : identical(mark) ? 12 : 18), 25);
|
|
130
|
+
const usState = marks?.us === 'ok' ? 'ok' : marks?.us === 'pending' ? 'pending' : 'unknown';
|
|
131
|
+
const texts = { 5: marksLeft.some(mark => identical(mark) && mark.sameClass !== false) ? 'Identical trademark, status or class unclear'
|
|
132
|
+
: 'Near-identical trademark in your classes', 12: 'Identical trademark in another class',
|
|
133
|
+
18: 'Near-identical trademark in another class' };
|
|
134
|
+
if (usState !== 'ok') {
|
|
135
|
+
// A hit from another office still counts when the US check failed.
|
|
136
|
+
const points = Math.min(worst, unknownPart(25));
|
|
137
|
+
return { points, state: usState, losses: [{ loss: 25 - points, text: unknownText(usState, 'US trademarks'), unknown: true }] };
|
|
138
|
+
}
|
|
139
|
+
const losses = worst < 25 ? [{ loss: 25 - worst, text: texts[worst] }] : [];
|
|
140
|
+
let points = worst;
|
|
141
|
+
const euState = marks?.eu === 'ok' ? 'ok' : marks?.eu === 'pending' ? 'pending' : 'unknown';
|
|
142
|
+
if (euState !== 'ok') {
|
|
143
|
+
losses.push({ loss: Math.max(0, points - trademarkCapWithoutEu), text: unknownText(euState, 'EU trademarks'), unknown: true });
|
|
144
|
+
points = Math.min(points, trademarkCapWithoutEu);
|
|
145
|
+
}
|
|
146
|
+
return { points, state: 'ok', losses, best: worst === 25 ? 'No trademark match found' + (euState === 'ok' ? ' in the US or EU' : ' in the US') : null };
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// rivals: { state: 'ok' | 'unknown' | 'pending', list: [{ level: 'strong' | 'some' | 'none' | 'dormant', sameSubject }], company }
|
|
150
|
+
// list holds the rivals already measured, even when another source failed, so a known strong same-subject rival still
|
|
151
|
+
// filters the name. company is true only with evidence of a same-name registered company in the same sector.
|
|
152
|
+
function rivalPart(rivals) {
|
|
153
|
+
const state = rivals?.state === 'ok' ? 'ok' : rivals?.state === 'pending' ? 'pending' : 'unknown';
|
|
154
|
+
let points = 20;
|
|
155
|
+
let text = null;
|
|
156
|
+
for (const rival of Array.isArray(rivals?.list) ? rivals.list : []) {
|
|
157
|
+
// Without a subject (no about or category), a rival's subject is unclear and counts as yours, short of the filter.
|
|
158
|
+
const same = rival.sameSubject;
|
|
159
|
+
if (rival.level === 'strong' && same === true) return { filtered: 'Same-name rival with strong traction in your subject' };
|
|
160
|
+
const [value, label] = rival.level === 'strong' ? [4, same === false ? 'Same-name rival with strong traction'
|
|
161
|
+
: 'Same-name rival with strong traction, subject unclear']
|
|
162
|
+
: rival.level === 'some' ? same === false ? [12, 'Same-name use with some traction']
|
|
163
|
+
: [5, same === true ? 'Same-name rival in your subject' : 'Same-name use with some traction, subject unclear']
|
|
164
|
+
: rival.level === 'dormant' ? [18, 'Dormant same-name site'] : [20, null];
|
|
165
|
+
if (value < points) [points, text] = [value, label];
|
|
166
|
+
}
|
|
167
|
+
const losses = text ? [{ loss: 20 - points, text }] : [];
|
|
168
|
+
if (state !== 'ok' && points > unknownPart(20)) {
|
|
169
|
+
losses.push({ loss: points - unknownPart(20), text: unknownText(state, 'rivals'), unknown: true });
|
|
170
|
+
points = unknownPart(20);
|
|
171
|
+
} else if (state !== 'ok') losses.push({ loss: 0, text: unknownText(state, 'rivals'), unknown: true });
|
|
172
|
+
if (rivals?.company === true) losses.push({ loss: 3, text: 'Same-name registered company in your sector' });
|
|
173
|
+
return { points: Math.max(0, points - (rivals?.company === true ? 3 : 0)), state, losses,
|
|
174
|
+
best: state === 'ok' && points === 20 && rivals?.company !== true ? 'No same-name rival found' : null };
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// apps: { state: 'ok' | 'unknown' | 'pending', list: [{ sameCategory: true | false | null }] }; list keeps the hits
|
|
178
|
+
// one store returned even when the other store failed.
|
|
179
|
+
function appPart(apps) {
|
|
180
|
+
const state = apps?.state === 'ok' ? 'ok' : apps?.state === 'pending' ? 'pending' : 'unknown';
|
|
181
|
+
const list = Array.isArray(apps?.list) ? apps.list : [];
|
|
182
|
+
const same = list.some(app => app?.sameCategory !== false);
|
|
183
|
+
const unclear = same && !list.some(app => app?.sameCategory === true);
|
|
184
|
+
let points = !list.length ? 8 : same ? 1 : 5;
|
|
185
|
+
const losses = list.length ? [{ loss: 8 - points,
|
|
186
|
+
text: same ? unclear ? 'Same-name app, category unclear' : 'Same-name app in your category' : 'Same-name app in another category' }] : [];
|
|
187
|
+
if (state !== 'ok') {
|
|
188
|
+
losses.push({ loss: Math.max(0, points - unknownPart(8)), text: unknownText(state, 'app stores'), unknown: true });
|
|
189
|
+
points = Math.min(points, unknownPart(8));
|
|
190
|
+
}
|
|
191
|
+
return { points, state, losses, best: state === 'ok' && !list.length ? 'No same-name app' : null };
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// handles: { GitHub, npm, Bluesky }: 'free' | 'taken' | 'pending' | anything else (not checked).
|
|
195
|
+
// The handles not checked earn 40% of their combined weight, rounded down (all three: 2 of 7).
|
|
196
|
+
function handlePart(handles = {}) {
|
|
197
|
+
let points = 0;
|
|
198
|
+
let missing = 0;
|
|
199
|
+
const taken = [];
|
|
200
|
+
const unknown = [];
|
|
201
|
+
let pending = false;
|
|
202
|
+
for (const [platform, weight] of Object.entries(handleWeights)) {
|
|
203
|
+
const state = handles?.[platform];
|
|
204
|
+
if (state === 'free') points += weight;
|
|
205
|
+
else if (state === 'taken') taken.push(platform);
|
|
206
|
+
else {
|
|
207
|
+
missing += weight;
|
|
208
|
+
unknown.push(platform);
|
|
209
|
+
if (state === 'pending') pending = true;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
points += unknownPart(missing);
|
|
213
|
+
const losses = [];
|
|
214
|
+
if (taken.length) losses.push({ loss: taken.reduce((sum, platform) => sum + handleWeights[platform], 0),
|
|
215
|
+
text: 'Handle taken: ' + listed(taken) });
|
|
216
|
+
if (unknown.length) losses.push({ loss: missing - unknownPart(missing),
|
|
217
|
+
text: unknownText(pending ? 'pending' : 'unknown', 'handles (' + listed(unknown) + ')'), unknown: true });
|
|
218
|
+
return { points, state: unknown.length ? pending ? 'pending' : 'unknown' : 'ok', losses,
|
|
219
|
+
best: points === 7 ? 'No public profiles found on GitHub, npm or Bluesky' : null };
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
function qualityPart(name, candidate, meaning) {
|
|
223
|
+
const count = letterCount(name);
|
|
224
|
+
const syllables = syllableCount(name);
|
|
225
|
+
const losses = [];
|
|
226
|
+
const length = count <= 6 ? 4 : count <= 9 ? 3 : 1;
|
|
227
|
+
if (length < 4) losses.push({ loss: 4 - length, text: count + ' letters' });
|
|
228
|
+
const sound = syllables <= 2 ? 3 : 2;
|
|
229
|
+
if (sound < 3) losses.push({ loss: 1, text: 'Three syllables' });
|
|
230
|
+
let spelling = 0;
|
|
231
|
+
if (candidate.spellings === 1) spelling = 4;
|
|
232
|
+
else if (Number.isInteger(candidate.spellings)) losses.push({ loss: 4, text: 'More than one spelling when heard' });
|
|
233
|
+
else {
|
|
234
|
+
spelling = unknownPart(4);
|
|
235
|
+
losses.push({ loss: 4 - spelling, text: 'Not checked: spelling by ear', unknown: true });
|
|
236
|
+
}
|
|
237
|
+
let relation = 0;
|
|
238
|
+
if (candidate.relation === 'direct') relation = 4;
|
|
239
|
+
else if (candidate.relation === 'loose') {
|
|
240
|
+
relation = 2;
|
|
241
|
+
losses.push({ loss: 2, text: 'Loose link to the subject' });
|
|
242
|
+
} else if (candidate.relation === 'none') losses.push({ loss: 4, text: 'No link to the subject' });
|
|
243
|
+
else {
|
|
244
|
+
relation = unknownPart(4);
|
|
245
|
+
losses.push({ loss: 4 - relation, text: 'Not checked: subject fit', unknown: true });
|
|
246
|
+
}
|
|
247
|
+
const mild = meaning || candidate.badMeaning === 'mild';
|
|
248
|
+
if (mild) losses.push({ loss: 5, text: 'Mild bad meaning' });
|
|
249
|
+
const points = length + sound + spelling + relation - (mild ? 5 : 0);
|
|
250
|
+
return { points, state: losses.some(loss => loss.unknown) ? 'unknown' : 'ok', losses,
|
|
251
|
+
best: length >= 3 && sound === 3 && !mild ? 'Short and easy to say' : null };
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// input: { name, candidate, domains: [{ ending, total, registry }], marks, rivals, apps, handles, meaning }
|
|
255
|
+
// meaning: the local 14-language screen ({ how }) or null. Returns { value, band, reasons, ... } or { filtered }.
|
|
256
|
+
export function scoreName(input) {
|
|
257
|
+
const candidate = validCandidate(input?.candidate) ? input.candidate : {};
|
|
258
|
+
const name = String(input?.name ?? '');
|
|
259
|
+
const ban = nameBan(name, candidate);
|
|
260
|
+
if (ban) return { version: scoreVersion, filtered: ban, kind: 'ban' };
|
|
261
|
+
if (input?.meaning?.how === 'is' || candidate.badMeaning === 'severe') return { version: scoreVersion, filtered: 'Severe bad meaning', kind: 'filter' };
|
|
262
|
+
const domain = domainParts(input?.domains, scoreCapUsd);
|
|
263
|
+
if (!domain) return { version: scoreVersion, filtered: 'No available ending with a known price within ' + money(scoreCapUsd) + ' over 3 years', kind: 'filter' };
|
|
264
|
+
const trademark = trademarkPart(input.marks);
|
|
265
|
+
const rivals = rivalPart(input.rivals);
|
|
266
|
+
for (const part of [trademark, rivals]) if (part.filtered) return { version: scoreVersion, filtered: part.filtered, kind: 'filter' };
|
|
267
|
+
const parts = {
|
|
268
|
+
domain: { points: domain.points, state: 'ok', best: '.' + domain.ending + ' is available, ' + money(domain.total) + ' for 3 years',
|
|
269
|
+
losses: domain.points < 22 ? [{ loss: 22 - domain.points, text: 'Best available ending is .' + domain.ending }] : [] },
|
|
270
|
+
price: { points: domain.price, state: 'ok', losses: domain.price < 3 ? [{ loss: 3 - domain.price, text: money(domain.total) + ' for 3 years' }] : [] },
|
|
271
|
+
trademark, rivals, apps: appPart(input.apps), handles: handlePart(input.handles),
|
|
272
|
+
quality: qualityPart(name, candidate, input.meaning),
|
|
273
|
+
};
|
|
274
|
+
const raw = componentOrder.reduce((sum, key) => sum + parts[key].points, 0);
|
|
275
|
+
const caps = [];
|
|
276
|
+
let value = Math.max(0, Math.min(100, raw));
|
|
277
|
+
const missingBans = banEvidence.filter(key => !Object.hasOwn(candidate, key));
|
|
278
|
+
const extra = [];
|
|
279
|
+
if (trademark.state !== 'ok' || rivals.state !== 'ok') {
|
|
280
|
+
if (value > uncheckedCap) caps.push('sources');
|
|
281
|
+
value = Math.min(value, uncheckedCap);
|
|
282
|
+
}
|
|
283
|
+
if (missingBans.length) {
|
|
284
|
+
if (value > uncheckedCap) caps.push('bans');
|
|
285
|
+
extra.push({ loss: Math.max(0, value - uncheckedCap), text: 'Not checked: naming bans', unknown: true });
|
|
286
|
+
value = Math.min(value, uncheckedCap);
|
|
287
|
+
}
|
|
288
|
+
const items = [...componentOrder.flatMap(key => parts[key].losses.map(item => ({ ...item, key }))), ...extra];
|
|
289
|
+
// Every check that was not done, in plain words, whether or not it cost points.
|
|
290
|
+
const notChecked = [...new Set(items.filter(item => item.unknown).map(item => item.text.replace(/^(?:Not checked|Still checking): /, '')))];
|
|
291
|
+
const losses = items.filter(item => item.loss > 0)
|
|
292
|
+
.sort((a, b) => b.loss - a.loss || Number(Boolean(b.unknown)) - Number(Boolean(a.unknown)));
|
|
293
|
+
const [best] = componentOrder.filter(key => parts[key].best && parts[key].points > 0)
|
|
294
|
+
.sort((a, b) => parts[b].points / scoreWeights[b] - parts[a].points / scoreWeights[a]
|
|
295
|
+
|| componentOrder.indexOf(a) - componentOrder.indexOf(b));
|
|
296
|
+
const reasons = best ? [parts[best].best] : [];
|
|
297
|
+
const chosen = losses.slice(0, 3 - reasons.length);
|
|
298
|
+
// An unknown that costs points always takes one of the slots.
|
|
299
|
+
const unknown = losses.find(item => item.unknown);
|
|
300
|
+
if (unknown && !chosen.includes(unknown)) chosen[chosen.length - 1] = unknown;
|
|
301
|
+
reasons.push(...chosen.map(item => item.text));
|
|
302
|
+
const pending = componentOrder.some(key => parts[key].state === 'pending');
|
|
303
|
+
return {
|
|
304
|
+
version: scoreVersion, value, band: scoreBand(value), reasons, ...(pending && { pending: true }),
|
|
305
|
+
components: Object.fromEntries(componentOrder.map(key => [key, parts[key].points])),
|
|
306
|
+
unknown: componentOrder.filter(key => parts[key].state !== 'ok'),
|
|
307
|
+
notChecked,
|
|
308
|
+
...(missingBans.length && { bansUnchecked: missingBans }),
|
|
309
|
+
...(caps.length && { caps }),
|
|
310
|
+
...(input.candidate?.recipe && candidate.recipe && { recipe: candidate.recipe }),
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// The handle states the score reads: free, taken, pending or (anything else) not checked.
|
|
315
|
+
export function scoreHandles(rows) {
|
|
316
|
+
if (!Array.isArray(rows)) return {};
|
|
317
|
+
return Object.fromEntries(['GitHub', 'npm', 'Bluesky'].map(platform => {
|
|
318
|
+
const row = rows.find(entry => entry?.platform === platform);
|
|
319
|
+
return [platform, row?.state === 'taken' ? 'taken' : row?.state === 'not-found' ? 'free'
|
|
320
|
+
: row?.why === 'still checking' ? 'pending' : null];
|
|
321
|
+
}));
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// The part of a score that travels in tool results and on the page: value, band, reasons, or the filter.
|
|
325
|
+
export function compactScore(score) {
|
|
326
|
+
if (!score) return null;
|
|
327
|
+
if (score.filtered) return { filtered: score.filtered };
|
|
328
|
+
return { value: score.value, band: score.band, reasons: score.reasons, ...(score.notChecked?.length && { notChecked: score.notChecked }),
|
|
329
|
+
...(score.pending && { pending: true }), ...(score.overridesAvoid && { overridesAvoid: true }) };
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// "Name score 91/100 - how clear the road is"
|
|
333
|
+
export function scoreHeadline(score) {
|
|
334
|
+
return score && known(score.value) ? 'Name score ' + score.value + '/100 - ' + scoreLabel : null;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
// Whether a row may be a pick: the legacy Avoid guard stays, except for a scored name whose only Avoid is a strong rival in
|
|
338
|
+
// a different subject (overridesAvoid; the score carries that penalty). Hard filters always rule out the pick.
|
|
339
|
+
export function scoreEligible(row) {
|
|
340
|
+
return !row?.score?.filtered && (row?.verdict !== 'Avoid' || (known(row?.score?.value) && row.score.overridesAvoid === true));
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// Ranking across names: finished scores first, highest first; then scores still waiting on checks; then names
|
|
344
|
+
// without a score. Returns 0 when neither has a score, so callers keep their own order.
|
|
345
|
+
export function compareScores(a, b) {
|
|
346
|
+
const tier = score => known(score?.value) ? score.pending ? 1 : 0 : 2;
|
|
347
|
+
return tier(a) - tier(b) || (tier(a) < 2 ? b.value - a.value : 0);
|
|
348
|
+
}
|
|
@@ -46,10 +46,8 @@ export { requestEndings, supportedEndings };
|
|
|
46
46
|
export const restrictedEndings = Object.keys(facts).filter(tld => facts[tld].eligibility);
|
|
47
47
|
const firstCost = row => row.firstPayment ?? Infinity;
|
|
48
48
|
|
|
49
|
-
//
|
|
50
|
-
|
|
51
|
-
// Other supported endings (.net, .org, regional endings) rank after them in catalog order.
|
|
52
|
-
export const qualityEndings = ['com', 'ai', 'io', 'dev', 'app', 'co', 'so', 'me', 'si', 'xyz', 'tech'];
|
|
49
|
+
// The local fallback keeps the hosted checker's order. Explicit requests can override it.
|
|
50
|
+
export const qualityEndings = defaultEndings;
|
|
53
51
|
// The default pick stays within this many dollars of payments due in 3 years; a budget the person gave replaces it.
|
|
54
52
|
export const pickCapUsd = 60;
|
|
55
53
|
|
|
@@ -78,7 +76,7 @@ function fitsCap(option, { budget } = {}) {
|
|
|
78
76
|
// The one pick rule. options are free, eligible, in-scope rows shaped { domain, now, total } (total = payments due in
|
|
79
77
|
// 3 years). The pick is the highest-quality option within the cap; when none fits, the least paid over 3 years.
|
|
80
78
|
// .ai is never the default: only when the person asked for it or its 3-year total fits the budget they gave.
|
|
81
|
-
export function choosePick(options, { requested = [], eligible = [], budget } = {}) {
|
|
79
|
+
export function choosePick(options, { requested = [], eligible = [], budget, allowOverCap = true } = {}) {
|
|
82
80
|
const allowed = options.filter(option => domainEnding(option.domain) !== 'ai' || asked(option.domain, requested) >= 0
|
|
83
81
|
|| (budget != null && known(option.total) && cents(option.total) <= cents(budget)));
|
|
84
82
|
const rank = option => qualityRank(option.domain, requested, eligible);
|
|
@@ -87,7 +85,7 @@ export function choosePick(options, { requested = [], eligible = [], budget } =
|
|
|
87
85
|
|| (a.total ?? Infinity) - (b.total ?? Infinity)
|
|
88
86
|
|| (a.now ?? Infinity) - (b.now ?? Infinity) || a.domain.localeCompare(b.domain);
|
|
89
87
|
return allowed.filter(option => fitsCap(option, { budget })).sort(byQuality)[0]
|
|
90
|
-
?? lowestTotal(allowed, rank);
|
|
88
|
+
?? (allowOverCap ? lowestTotal(allowed, rank) : undefined);
|
|
91
89
|
}
|
|
92
90
|
|
|
93
91
|
// The least paid over 3 years; the cheaper first payment, then quality, breaks a tie.
|
|
@@ -12,12 +12,41 @@ export const geoInstruction = 'GEO (presence in AI answers): for each name, answ
|
|
|
12
12
|
+ 'whether you know a specific brand, company or product by that exact name: "known: <what it is, a few words>" or "unknown". '
|
|
13
13
|
+ 'Say unknown for a plain dictionary word or when unsure. Do not guess.';
|
|
14
14
|
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
export const
|
|
15
|
+
// Real names by naming type, from the 2026-11-25 naming reference (213 names). Types and patterns only: the method never
|
|
16
|
+
// tells or invents origin stories. The last three show types the bans exclude.
|
|
17
|
+
export const referenceExamples = [
|
|
18
|
+
['real word, repurposed', 'Stripe'], ['real word, repurposed', 'Linear'], ['compound', 'GitHub'], ['compound', 'Datadog'],
|
|
19
|
+
['blend', 'Instagram'], ['blend', 'Vercel'], ['phrase', 'Hugging Face'], ['phrase', 'Liquid Death'], ['metaphor', 'Mistral'],
|
|
20
|
+
['invented (banned here)', 'Figma'], ['misspelling (banned here)', 'Lyft'], ['acronym (not a recipe)', 'Redis'],
|
|
21
|
+
];
|
|
22
|
+
export const steeringQuestion = 'Which two do you love, and which one do you hate?';
|
|
23
|
+
const exampleLine = () => {
|
|
24
|
+
const types = new Map();
|
|
25
|
+
for (const [type, name] of referenceExamples) types.set(type, [...types.get(type) ?? [], name]);
|
|
26
|
+
return [...types].map(([type, names]) => type + ': ' + names.join(', ')).join('; ');
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// Naming skill v1, the same method as the Claude Code plugin skill (skills/naming/SKILL.md). One screening call:
|
|
30
|
+
// triage_names checks every ending for all the names it gets and screens the first five, so the recipe skips the
|
|
31
|
+
// preliminary check_domains batch (check_domains with shortlist still works for existing callers).
|
|
32
|
+
export const namingRecipe = (about = '') => 'Naming recipe (naming skill v1). English names unless asked. The name must last.\n'
|
|
18
33
|
+ (about ? '1. Brief: ' + about.replace(/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]+/gu, ' ').trim()
|
|
19
|
-
+ '.\n' : '1. Brief:
|
|
20
|
-
+ '2.
|
|
21
|
-
+ '3.
|
|
22
|
-
+ '
|
|
23
|
-
+ '
|
|
34
|
+
+ '.\n' : '1. Brief: what it does, for whom, the feel in two words, names to avoid. At most three questions.\n')
|
|
35
|
+
+ '2. Subject words: about 30 (objects, verbs, tools, places, roles, jargon, sounds). Pick 6 territories of meaning or sound; aim for the gap competitors leave.\n'
|
|
36
|
+
+ '3. Generate 150, 25 per territory, every recipe. Each name contains or puns on a subject word. No judging yet.\n'
|
|
37
|
+
+ '4. Filter: drop bans, over 12 letters or 3 syllables, more than one spelling by ear, hard to say, near-twins.\n'
|
|
38
|
+
+ '5. Screen: call triage_names ONCE with your best EIGHT, strongest first (the first five get marks, apps and rivals). '
|
|
39
|
+
+ 'Add about, geo from memory, any endings or budget, and candidates: per name recipe, relation (direct/loose/none), spellings, '
|
|
40
|
+
+ 'realWord, descriptive, misspelled, narrow, soundsLike, badMeaning, language. Missing evidence counts as not checked. Skip check_domains.\n'
|
|
41
|
+
+ '6. Answer: Relay say as written, starting with its results page line. Show only names with a Name score, ranked by score; '
|
|
42
|
+
+ 'fewer than 5: say so and run another round, never pad. Name score is how clear the road is, not a probability. '
|
|
43
|
+
+ 'Do not call again; the complete local results page fills in by itself.\n'
|
|
44
|
+
+ '7. Steer: ask exactly "' + steeringQuestion + '" Find what the two loved names share and what the hated one signals; '
|
|
45
|
+
+ 'generate the next round that way. Never re-show a rejected name.\n'
|
|
46
|
+
+ 'Recipes (suggestive or arbitrary, never descriptive): odd pair (default), subject word + unexpected concrete word, Loomfox; '
|
|
47
|
+
+ 'pun, a familiar phrase with a subject word swapped in by sound, Grepvine; blend on a shared syllable, both words audible, Inboxer; '
|
|
48
|
+
+ 'insider term outsiders hear as an image, Cold Kerf; phrase or character, Captain Diff.\n'
|
|
49
|
+
+ 'Bans (code drops them before scoring): two subject words, or one + hub/base/flow/labs/app/pro; no real word inside; '
|
|
50
|
+
+ '-ly, -ify, -io, dropped vowels, misspellings, numbers, hyphens; AI, GPT, bot, smart; sounds like a competitor, drug or Pokemon; '
|
|
51
|
+
+ 'names one feature; invented origin stories or claims about real brands.\n'
|
|
52
|
+
+ 'Real names by type (patterns only): ' + exampleLine() + '.';
|
|
@@ -7,16 +7,16 @@ import { cacheDir, readCache, writeCache } from './cache.mjs';
|
|
|
7
7
|
import { withShopPages } from './confirm.mjs';
|
|
8
8
|
import { catalogPrice, dynadotOffer, offer, shops } from './prices.mjs';
|
|
9
9
|
|
|
10
|
-
//
|
|
11
|
-
|
|
12
|
-
export const
|
|
13
|
-
// Checked only when the person asks for them (or names them in endings).
|
|
14
|
-
export const requestEndings = ['net', 'org', 'sh', 'gg', 'inc', 'studio', 'se', 'dk', 'de', 'uk', 'co.uk', 'eu'];
|
|
10
|
+
// Default order follows the hosted checker. Other catalog endings are available on request.
|
|
11
|
+
export const targetEndings = ['com', 'ai', 'io', 'dev', 'co', 'so', 'sh', 'inc', 'tech', 'app'];
|
|
12
|
+
export const requestEndings = ['me', 'si', 'no', 'xyz', 'net', 'org', 'gg', 'studio', 'se', 'dk', 'de', 'uk', 'co.uk', 'eu'];
|
|
15
13
|
export const supportedEndings = [...targetEndings, ...requestEndings];
|
|
16
|
-
//
|
|
17
|
-
const
|
|
14
|
+
// Older on-disk snapshots used these required entries. Keep reading them on the local fallback path.
|
|
15
|
+
const legacyCatalogEndings = ['com', 'ai', 'io', 'me', 'co', 'dev', 'app', 'si', 'so', 'no'];
|
|
16
|
+
// The local catalog validates standard prices up to $500. Only the hosted catalog covers .inc renewals.
|
|
17
|
+
const refreshEndings = targetEndings.filter(ending => ending !== 'inc');
|
|
18
18
|
const otherEndings = ['so', 'no'];
|
|
19
|
-
const spaceshipEndings =
|
|
19
|
+
const spaceshipEndings = legacyCatalogEndings.filter(tld => !otherEndings.includes(tld));
|
|
20
20
|
const filename = 'prices.json';
|
|
21
21
|
const day = 86_400_000;
|
|
22
22
|
const primaryShops = ['spaceship', 'porkbun', 'dynadot'];
|
|
@@ -35,7 +35,7 @@ function validPrice(row, shop) {
|
|
|
35
35
|
|
|
36
36
|
function validSource(id, prices) {
|
|
37
37
|
const entries = Object.entries(prices ?? {});
|
|
38
|
-
const required = id === 'spaceship' ? spaceshipEndings : ['gandi', ...snapshotShops].includes(id) ? [] : ['com', 'io'
|
|
38
|
+
const required = id === 'spaceship' ? spaceshipEndings : ['gandi', ...snapshotShops].includes(id) ? [] : ['com', 'io'];
|
|
39
39
|
return entries.length > 0 && required.every(tld => Object.hasOwn(prices, tld)) &&
|
|
40
40
|
entries.every(([tld, row]) => supportedEndings.includes(tld) && validPrice(row, shops[id].name));
|
|
41
41
|
}
|
|
@@ -47,7 +47,7 @@ function validDate(value) {
|
|
|
47
47
|
export function validCatalog(value) {
|
|
48
48
|
if (!validDate(value?.checkedAt)) return false;
|
|
49
49
|
if (!value.catalogs) {
|
|
50
|
-
return
|
|
50
|
+
return legacyCatalogEndings.every(tld => validPrice(value.prices?.[tld], otherEndings.includes(tld) ? 'Gandi' : 'Spaceship'));
|
|
51
51
|
}
|
|
52
52
|
return Object.keys(value.catalogs).length > 0 && Object.entries(value.catalogs).every(([id, source]) =>
|
|
53
53
|
[...primaryShops, 'gandi', ...snapshotShops].includes(id) && validDate(source.checkedAt) && validSource(id, source.prices));
|
|
@@ -145,7 +145,7 @@ export async function getNameCatalog({ directory = cacheDir, now = new Date(), s
|
|
|
145
145
|
const saved = await loadCachedCatalog(directory);
|
|
146
146
|
const sources = sourcesOf(saved);
|
|
147
147
|
const refresh = !saved || automaticShops.some(id => isCatalogStale(sources[id]?.checkedAt, now)) ||
|
|
148
|
-
|
|
148
|
+
refreshEndings.some(tld => !primaryShops.some(id => sources[id]?.prices[tld]) &&
|
|
149
149
|
(!sources.gandi?.prices[tld] || isCatalogStale(sources.gandi.checkedAt, now)));
|
|
150
150
|
if (directory && refresh) {
|
|
151
151
|
void Promise.resolve().then(() => scheduleRefresh(directory)).catch(() => {});
|
|
@@ -333,7 +333,7 @@ export async function refreshPrices({
|
|
|
333
333
|
refreshedShops.push(id);
|
|
334
334
|
}
|
|
335
335
|
|
|
336
|
-
const gaps =
|
|
336
|
+
const gaps = refreshEndings.filter(tld => !primaryShops.some(id => catalogs[id]?.prices[tld]));
|
|
337
337
|
if (gaps.length) {
|
|
338
338
|
const rows = await Promise.allSettled(gaps.map(tld => Promise.resolve().then(() => gandi(tld))));
|
|
339
339
|
const prices = {};
|